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 pa1(a1,_array_count(a1)); + algo::aryptr pa2(a2,_array_count(a2)); + algo::aryptr pa3(a3,_array_count(a3)); + + // pnew + algo::ByteAry buf; + Varlen2aMsg *msg = Varlen2aMsg_FmtByteAry(buf,pa1,pa2,pa3); + + vrfy_(Arycmp(u1_Getary(*msg),pa1)); + vrfy_(Arycmp(u2_Getary(*msg),pa2)); + vrfy_(Arycmp(u3_Getary(*msg),pa3)); + + vrfyeq_(tempstr()<<*msg, "atf_amc.Varlen2aMsg u1.0:1 u1.1:2 u1.2:3 u2.0:4 u2.1:5 u2.2:6 u3.0:7 u3.1:8 u3.2:9"); + + // read + algo::Refurbish(buf); + atf_amc::MsgHeaderMsgs_ReadStrptr("atf_amc.Varlen2aMsg u3.0:7 u2.0:4 u1.0:1 u3.1:8 u2.1:5 u1.1:2 u3.2:9 u2.2:6 u1.2:3", buf); + msg = (Varlen2aMsg *)buf.ary_elems; + vrfy_(Arycmp(u1_Getary(*msg),pa1)); + vrfy_(Arycmp(u2_Getary(*msg),pa2)); + vrfy_(Arycmp(u3_Getary(*msg),pa3)); + vrfyeq_(ToStrPtr(ary_Getary(buf)), Bytes("\002\020,\000" + "\014\000" + "\030\000" + "\001\000\000\000" + "\002\000\000\000" + "\003\000\000\000" + "\004\000\000\000" + "\005\000\000\000" + "\006\000\000\000" + "\007\000\000\000" + "\010\000\000\000" + "\011\000\000\000")); +} + +void atf_amc::amctest_Varlen2m() { + algo::ByteAry buf; + const char *str = "atf_amc.Varlen2mMsg" + " m3:'atf_amc.Varlen2Msg s1:ii s2:1 s3:9'" + " m2:'atf_amc.Varlen2Msg s1:h s2:2 s3:8'" + " m1:'atf_amc.Varlen2Msg s1:gg s2:3 s3:7'" + " m3:'atf_amc.Varlen2Msg s1:fff s2:4 s3:6'" + " m2:'atf_amc.Varlen2Msg s1:eee s2:5 s3:5'" + " m1:'atf_amc.Varlen2Msg s1:dddd s2:6 s3:4'" + " m3:'atf_amc.Varlen2Msg s1:ccc s2:7 s3:3'" + " m2:'atf_amc.Varlen2Msg s1:bc s2:8 s3:2'" + " m1:'atf_amc.Varlen2Msg s1:a s2:9 s3:1'"; + atf_amc::MsgHeaderMsgs_ReadStrptr(str,buf); + Varlen2mMsg *msg = (Varlen2mMsg*)buf.ary_elems; + + const char *str1 = + "atf_amc.Varlen2mMsg" + " m1.0:\"atf_amc.Varlen2Msg s1:gg s2:3 s3:7\"" + " m1.1:\"atf_amc.Varlen2Msg s1:dddd s2:6 s3:4\"" + " m1.2:\"atf_amc.Varlen2Msg s1:a s2:9 s3:1\"" + " m2.0:\"atf_amc.Varlen2Msg s1:h s2:2 s3:8\"" + " m2.1:\"atf_amc.Varlen2Msg s1:eee s2:5 s3:5\"" + " m2.2:\"atf_amc.Varlen2Msg s1:bc s2:8 s3:2\"" + " m3.0:\"atf_amc.Varlen2Msg s1:ii s2:1 s3:9\"" + " m3.1:\"atf_amc.Varlen2Msg s1:fff s2:4 s3:6\"" + " m3.2:\"atf_amc.Varlen2Msg s1:ccc s2:7 s3:3\""; + vrfyeq_(tempstr()<<*msg, str1); + + const char str2[] = "\004\020w\000%\000I\000" + "\001\020\014\000\002\000\003\000gg37" + "\001\020\016\000\004\000\005\000dddd64" + "\001\020\013\000\001\000\002\000a91" + "\001\020\013\000\001\000\002\000h28" + "\001\020\r\000\003\000\004\000eee55" + "\001\020\014\000\002\000\003\000bc82" + "\001\020\014\000\002\000\003\000ii19" + "\001\020\r\000\003\000\004\000fff46" + "\001\020\r\000\003\000\004\000ccc73"; + vrfyeq_(ToStrPtr(ary_Getary(buf)), Bytes(str2)); +} + +void atf_amc::amctest_Varlen2v() { + algo::ByteAry buf; + const char *str = "atf_amc.Varlen2vMsg" + " v1:'atf_amc.VarlenK i:1'" + " v1:'atf_amc.VarlenK i:2 i:3'" + " v1:'atf_amc.VarlenK i:4'" + + " v2:'atf_amc.VarlenK i:5 i:6'" + " v2:'atf_amc.VarlenK i:7'" + " v2:'atf_amc.VarlenK i:8 i:9'" + + " v3:'atf_amc.VarlenK i:10'" + " v3:'atf_amc.VarlenK i:11 i:12'" + " v3:'atf_amc.VarlenK i:13 i:14 i:15'"; + atf_amc::MsgHeaderMsgs_ReadStrptr(str,buf); + Varlen2vMsg *msg = (Varlen2vMsg*)buf.ary_elems; + + const char *str1 = "atf_amc.Varlen2vMsg" + " v1.0:\"atf_amc.VarlenK i.0:1\"" + " v1.1:\"atf_amc.VarlenK i.0:2 i.1:3\"" + " v1.2:\"atf_amc.VarlenK i.0:4\"" + " v2.0:\"atf_amc.VarlenK i.0:5 i.1:6\"" + " v2.1:\"atf_amc.VarlenK i.0:7\"" + " v2.2:\"atf_amc.VarlenK i.0:8 i.1:9\"" + " v3.0:\"atf_amc.VarlenK i.0:10\"" + " v3.1:\"atf_amc.VarlenK i.0:11 i.1:12\"" + " v3.2:\"atf_amc.VarlenK i.0:13 i.1:14 i.2:15\""; + vrfyeq_(tempstr()<<*msg, str1); + + const char str2[] = "\003\020h\000\034\000<\000" + "\010\000\000\000\001\000\000\000" + "\014\000\000\000\002\000\000\000\003\000\000\000" + "\010\000\000\000\004\000\000\000" + "\014\000\000\000\005\000\000\000\006\000\000\000" + "\010\000\000\000\007\000\000\000" + "\014\000\000\000\010\000\000\000\t\000\000\000" + "\010\000\000\000\012\000\000\000" + "\014\000\000\000\013\000\000\000\014\000\000\000" + "\020\000\000\000\015\000\000\000\016\000\000\000\017\000\000\000"; + vrfyeq_(ToStrPtr(ary_Getary(buf)), Bytes(str2)); +} diff --git a/cpp/atf_amc/zdlist.cpp b/cpp/atf_amc/zdlist.cpp index 20e0ce00..1dd93a49 100644 --- a/cpp/atf_amc/zdlist.cpp +++ b/cpp/atf_amc/zdlist.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/zdlist.cpp // diff --git a/cpp/atf_amc/zslist.cpp b/cpp/atf_amc/zslist.cpp index fade1942..0800610e 100644 --- a/cpp/atf_amc/zslist.cpp +++ b/cpp/atf_amc/zslist.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/zslist.cpp // diff --git a/cpp/atf_ci/abt_md.cpp b/cpp/atf_ci/abt_md.cpp new file mode 100644 index 00000000..60d6496f --- /dev/null +++ b/cpp/atf_ci/abt_md.cpp @@ -0,0 +1,53 @@ +// Copyright (C) 2023-2026 AlgoRND +// Copyright (C) 2020-2023 Astra +// +// 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: atf_ci (exe) -- Normalization tests (see citest table) +// Exceptions: yes +// Source: cpp/atf_ci/abt_md.cpp +// + +#include "include/atf_ci.h" +#include "include/define.h" + +// Runs in sandbox +void atf_ci::citest_abt_md_after_ssimfile_is_added() { + // create a new ssimdb + { + command::acr_ed_proc acr_ed; + acr_ed.cmd.create=true; + acr_ed.cmd.target="dev"; + acr_ed.cmd.nstype=dmmeta_Nstype_nstype_ssimdb; + acr_ed.cmd.write=true; + acr_ed_ExecX(acr_ed); + } + + // create a new ssimfile + { + command::acr_ed_proc acr_ed; + acr_ed.cmd.create=true; + acr_ed.cmd.ssimfile="dev.xyz"; + acr_ed.cmd.write=true; + acr_ed_ExecX(acr_ed); + } + + // run abt_md to produce xyz.md and add it into README.md + command::abt_md_proc abt_md; + abt_md.cmd.readmefile.expr = "txt/ssimdb/dev/%"; + abt_md_ExecX(abt_md); + + vrfy_(SysCmd("grep 'dev.xyz' txt/ssimdb/dev/README.md")==0); +} diff --git a/cpp/atf_ci/acr_ed.cpp b/cpp/atf_ci/acr_ed.cpp index 297c5ad9..02a557df 100644 --- a/cpp/atf_ci/acr_ed.cpp +++ b/cpp/atf_ci/acr_ed.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2020-2023 Astra // // License: GPL @@ -44,6 +44,33 @@ void atf_ci::citest_acr_ed_ssimdb() { // ----------------------------------------------------------------------------- +// Runs in sandbox +void atf_ci::citest_acr_ed_unittest() { + // create a new ssimdb + command::acr_ed_proc acr_ed; + acr_ed.cmd.create=true; + acr_ed.cmd.unittest="algo_lib.SomeTest"; + acr_ed.cmd.write=true; + acr_ed_ExecX(acr_ed); + + // check that everything is ok + command::acr_proc acr; + acr.cmd.query = "%"; + acr.cmd.check=true; + acr_ExecX(acr); + + command::abt_proc abt; + abt.cmd.target.expr = "%"; + abt.cmd.build=true; + abt_ExecX(abt); + + command::atf_unit_proc atf_unit; + atf_unit.cmd.unittest.expr = "algo_lib.SomeTest"; + atf_unit_ExecX(atf_unit); +} + +// ----------------------------------------------------------------------------- + // Runs in sandbox void atf_ci::citest_acr_ed_ssimfile() { // create a new ssimdb diff --git a/cpp/atf_ci/apm.cpp b/cpp/atf_ci/apm.cpp index 44f6d59a..5b9271cc 100644 --- a/cpp/atf_ci/apm.cpp +++ b/cpp/atf_ci/apm.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/atf_ci/bootstrap.cpp b/cpp/atf_ci/bootstrap.cpp index 66e3c591..596f5471 100644 --- a/cpp/atf_ci/bootstrap.cpp +++ b/cpp/atf_ci/bootstrap.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2020-2023 Astra // // License: GPL diff --git a/cpp/atf_ci/cppcheck.cpp b/cpp/atf_ci/cppcheck.cpp index 4a9ce6b9..cfd7ced6 100644 --- a/cpp/atf_ci/cppcheck.cpp +++ b/cpp/atf_ci/cppcheck.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2020-2023 Astra // // License: GPL diff --git a/cpp/atf_ci/main.cpp b/cpp/atf_ci/main.cpp index b5a5e171..92aef0cc 100644 --- a/cpp/atf_ci/main.cpp +++ b/cpp/atf_ci/main.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 // @@ -97,6 +97,8 @@ void atf_ci::citest_atf_unit() { void atf_ci::citest_atf_comp() { command::atf_comp_proc atf_comp; atf_comp.cmd.capture = CaptureQ(); + atf_comp.cmd.maxerr = 3; + atf_comp.cmd.maxrepeat = 10000; atf_comp_ExecX(atf_comp); } @@ -105,6 +107,7 @@ void atf_ci::citest_atf_comp_cov() { command::atf_comp_proc atf_comp; atf_comp.cmd.build = true; atf_comp.cmd.covcapture = CaptureQ(); + atf_comp.cmd.maxerr = 3; atf_comp.cmd.covcheck = !atf_comp.cmd.covcapture; atf_comp_ExecX(atf_comp); } @@ -113,6 +116,7 @@ void atf_ci::citest_atf_comp_cov() { void atf_ci::citest_atf_comp_mem() { command::atf_comp_proc atf_comp; atf_comp.cmd.build = true; + atf_comp.cmd.maxerr = 3; atf_comp.cmd.memcheck = true; atf_comp_ExecX(atf_comp); } @@ -146,12 +150,54 @@ void atf_ci::citest_gitfile() { // ----------------------------------------------------------------------------- +algo::UnTime atf_ci::FileAtime(algo::strptr fname) { + struct stat st; + algo::UnTime ret; + if (stat(Zeroterm(tempstr()<args; + } + return ret; +} + +static tempstr GetFilter(atf_comp::FComptest &comptest) { + tempstr ret; + if (comptest.c_tfilt) { + ret << comptest.c_tfilt->filter; + } + return ret; +} + +// ----------------------------------------------------------------------------- + // Compute component directory depending on config given on command line -void atf_comp::Main_GuessCompdir() { - atf_comp::_db.compdir = atf_comp::_db.cmdline.compdir; - if (atf_comp::_db.compdir == "") { - atf_comp::_db.compdir = tempstr("build/")<filter); } @@ -112,19 +129,17 @@ void atf_comp::SetupCmdline(atf_comp::FComptest &comptest, algo_lib::Replscope & comptest.bash.cmd.c << " "; Ins(&R,comptest.bash.cmd.c,comptest.c_targs->args,false); } + vrfy_(comptest.dir != ""); if (atf_comp::_db.cmdline.memcheck) { - comptest.file_memcheck = tempstr() - << DirFileJoin(atf_comp::_db.tempdir,comptest.comptest) << ".memcheck.log"; + comptest.file_memcheck = DirFileJoin(comptest.dir, "memcheck.log"); comptest.bash.cmd.c = tempstr() << "valgrind --tool=memcheck --log-file=" << comptest.file_memcheck << " " << comptest.bash.cmd.c; DeleteFile(comptest.file_memcheck); } if (atf_comp::_db.cmdline.callgrind) { - comptest.file_callgrind_log = tempstr() - << DirFileJoin(atf_comp::_db.tempdir,comptest.comptest) << ".callgrind.log"; - comptest.file_callgrind_out = tempstr() - << DirFileJoin(atf_comp::_db.tempdir,comptest.comptest) << ".callgrind.out"; + comptest.file_callgrind_log = DirFileJoin(comptest.dir, "callgrind.log"); + comptest.file_callgrind_out = DirFileJoin(comptest.dir, "callgrind.out"); comptest.bash.cmd.c = tempstr() << "valgrind --tool=callgrind" << " --log-file=" << comptest.file_callgrind_log @@ -134,10 +149,20 @@ void atf_comp::SetupCmdline(atf_comp::FComptest &comptest, algo_lib::Replscope & DeleteFile(comptest.file_callgrind_out); } if (atf_comp::_db.cmdline.cfg == dev_Cfg_cfg_coverage) { - comptest.covdir = tempstr() << DirFileJoin(atf_comp::_db.tempdir,comptest.comptest) << ".cov.d"; + FCovdir *covdir = zd_covdir_free_RemoveFirst(); + if (!covdir) { + covdir = &covdir_Alloc(); + covdir->covdir = _db.cmdline.covfast + ? DirFileJoin(atf_comp::_db.tempdir,"cov.d/") << covdir_N() + : DirFileJoin(comptest.dir, "cov.d"); + } + comptest.c_covdir = covdir; command::atf_cov_proc atf_cov; - atf_cov.cmd.covdir = comptest.covdir; - atf_cov.cmd.logfile = DirFileJoin( comptest.covdir,"atf_cov.log"); + atf_cov.cmd.covdir = covdir->covdir; + atf_cov.cmd.incremental = _db.cmdline.covfast; + atf_cov.cmd.logfile = _db.cmdline.covfast + ? DirFileJoin(covdir->covdir, comptest.comptest) << ".atf_cov.log" + : DirFileJoin(covdir->covdir,"atf_cov.log"); atf_cov.cmd.runcmd = comptest.bash.cmd.c; comptest.bash.cmd.c = tempstr() << atf_cov.path << " "; atf_cov_PrintArgv(atf_cov.cmd,comptest.bash.cmd.c); @@ -149,7 +174,7 @@ void atf_comp::SetupCmdline(atf_comp::FComptest &comptest, algo_lib::Replscope & // Initialize COMPTEST.FILE_TEST_IN // Write input messages to file void atf_comp::PrepareInput(atf_comp::FComptest &comptest) { - comptest.file_test_in = tempstr() << DirFileJoin(atf_comp::_db.tempdir,comptest.comptest) << ".in"; + comptest.file_test_in = DirFileJoin(comptest.dir,"in"); tempstr teststr; ind_beg(comptest_zd_tmsg_curs,tmsg,comptest) { if (dir_Get(tmsg) == atfdb_Msgdir_msgdir_in) { @@ -162,62 +187,70 @@ void atf_comp::PrepareInput(atf_comp::FComptest &comptest) { // ----------------------------------------------------------------------------- void atf_comp::Comptest_Start(atf_comp::FComptest &comptest) { - atf_comp::_db.report.nrun++; - verblog("atf_comp.test_start" - << Keyval("comptest",comptest.comptest)); - atf_comp::zd_run_comptest_Insert(comptest); - PrepareInput(comptest); - comptest.file_test_out = tempstr() << DirFileJoin(atf_comp::_db.tempdir,comptest.comptest) << ".out"; - auto tempdir = algo::DirFileJoin(_db.tempdir,comptest.comptest); - algo::CreateDirRecurse(tempdir); - - // compute command line - algo_lib::Replscope R; - Set(R,"$tempdir",tempdir); - Set(R,"$comptest",comptest.comptest); - Set(R,"$compdir",atf_comp::_db.compdir); - SetupCmdline(comptest,R); - tempstr out; - out << "# atf_comp -report:N -printinput "<args); - } - if (comptest.c_tfilt && ch_N(comptest.c_tfilt->filter)) { - out << " | " << Subst(R,comptest.filter_command); - } - verblog("repro: "<" << comptest.file_test_out; - comptest.bash.fstderr = ">&1"; - } - int rc = bash_Start(comptest.bash); - if (rc != 0) { - comptest.err << "Failed to start "<" << comptest.file_test_out; + comptest.bash.fstderr = ">&1"; + } + int rc = bash_Start(comptest.bash); + if (rc != 0) { + comptest.err << "Failed to start "<= _db.cmdline.maxerr) { + prerr("atf_comp: skipping rest of tests"); + // don't reschedule + } else if (!_db.ncore_used || _db.ncore_used + zd_sel_comptest_First()->ncore <= atf_comp::_db.cmdline.maxjobs) { atf_comp::FComptest &comptest = *atf_comp::zd_sel_comptest_RemoveFirst(); - if (atf_comp::_db.report.nerr >= _db.cmdline.maxerr) { - atf_comp::zd_sel_comptest_RemoveAll(); - prerr("atf_comp: too many errors, not starting tests"); - break; - } Comptest_Start(comptest); + ThScheduleIn(_db.th_runtest, algo::SchedTime(0)); + } else { + // don't reschedule -- exiting comptest will reschedule } } @@ -287,7 +320,6 @@ i32 atf_comp::GetNumMemoryErrors(atf_comp::FComptest &comptest) { // Cleanup test structure after run void atf_comp::Comptest_Finish(atf_comp::FComptest &comptest) { - dbglog("Comptest_Finish"); bool did_run = !(comptest.start == algo::SchedTime()); algo::ListSep ls("; "); if (did_run) { @@ -314,19 +346,42 @@ void atf_comp::Comptest_Finish(atf_comp::FComptest &comptest) { << Keyval("output_file",comptest.file_callgrind_out) << Keyval("comment","Use kcachegrind (linux), or qcachegrind (macos) to open the file")); } + comptest.nrun++; + comptest.finish = algo::CurrSchedTime(); + comptest.elapsed = ElapsedSecs(comptest.start,comptest.finish); + if (comptest.err != "") { + prlog("Component test output below:"); + ind_beg(algo::FileLine_curs,line,comptest.file_test_out) { + prlog(" "< 1) { + out << "ncore " << comptest.ncore << eol; + } + out << "timeout "<filter)) { out << "filter "<filter<comptest=comptest.comptest; + tfilt_XrefMaybe(*tfilt); + } + } + if (comptest.c_tfilt) { + comptest.c_tfilt->filter = Trimmed(newfilter); + } + comptest.c_targs->args = algo::Trimmed(Pathcomp(oldargs,"|LL")); + comptest.need_write = GetArgs(comptest) != oldargs || GetFilter(comptest) != oldfilter; + } }ind_end; } @@ -484,8 +579,16 @@ void atf_comp::Main_Write() { void atf_comp::Main_Select() { ind_beg(_db_comptest_curs,comptest,_db) { atf_comp::_db.report.ntest++; - if (Regx_Match(_db.cmdline.comptest, comptest.comptest) - && (!_db.cmdline.memcheck || _db.cmdline.force || comptest.memcheck)) { + bool match = Regx_Match(_db.cmdline.comptest, comptest.comptest); + // skip tests marked memcheck:N in memcheck mode + if (_db.cmdline.memcheck) { + match = match && (comptest.memcheck || _db.cmdline.force); + } + // skip tests marked coverage:N in coverage mode + if (_db.cmdline.cfg == dev_Cfg_cfg_coverage) { + match = match && (comptest.coverage || _db.cmdline.force); + } + if (match) { zd_sel_comptest_Insert(comptest); } else { atf_comp::_db.report.nskip++; @@ -535,10 +638,6 @@ void atf_comp::Main_RewriteCmdline() { || (_db.cmdline.mdbg && _db.cmdline.covcheck) ,"-mdbg flag is incompatible with coverage"); - if (_db.cmdline.maxjobs==0) { - _db.cmdline.maxjobs = sysconf(_SC_NPROCESSORS_ONLN); - } - i32_UpdateMax(_db.cmdline.maxjobs,1); int n_tools = _db.cmdline.memcheck + _db.cmdline.callgrind; vrfy(n_tools<=1,"-memcheck and -callgrind are mutually exclusive"); @@ -557,9 +656,25 @@ void atf_comp::Main_RewriteCmdline() { _db.cmdline.cfg=dev_Cfg_cfg_coverage; } if (_db.cmdline.normalize || _db.cmdline.print || _db.cmdline.printinput|| _db.cmdline.mdbg) { + _db.cmdline.report=false;// will mess up the print _db.cmdline.e=false; // doesn't make sense _db.cmdline.run = false; } + if (_db.cmdline.maxjobs==0) { + if (_db.cmdline.cfg==dev_Cfg_cfg_coverage) { + _db.cmdline.maxjobs = 1; + } else { + _db.cmdline.maxjobs = sysconf(_SC_NPROCESSORS_ONLN); + } + } + // if invoked as atf_comp -minrepeat 1000, then set both to 1000 + i32_UpdateMax(_db.cmdline.maxrepeat, _db.cmdline.minrepeat); + // disable repeat when calculating coverage or doing slow checking + if (_db.cmdline.memcheck || _db.cmdline.callgrind || _db.cmdline.cfg == dev_Cfg_cfg_coverage) { + _db.cmdline.minrepeat = i32_Min(1, _db.cmdline.minrepeat); + _db.cmdline.maxrepeat = 1; + } + i32_UpdateMax(_db.cmdline.maxjobs,1); // print potentially new command line // #AL# I think the options -covcapture, -covcheck should go away // In -cfg:coverage mode, the coverage information should be considered part of the test @@ -572,6 +687,8 @@ void atf_comp::Main_RewriteCmdline() { <comment.value = rest; - } else if (comptest && StartsWithQ(line,"exit_code")) { + } else if (comptest && word == "exit_code") { u8_ReadStrptrMaybe(comptest->exit_code,rest); - } else if (comptest && StartsWithQ(line,"filter")) { + } else if (comptest && word == "ncore") { + i32_ReadStrptrMaybe(comptest->ncore,rest); + } else if (comptest && word == "repeat") { + i32_ReadStrptrMaybe(comptest->repeat,rest); + } else if (comptest && word == "timeout") { + i32_ReadStrptrMaybe(comptest->timeout,rest); + } else if (comptest && word == "memcheck") { + bool_ReadStrptrMaybe(comptest->memcheck,rest); + } else if (comptest && word == "coverage") { + bool_ReadStrptrMaybe(comptest->coverage,rest); + } else if (comptest && word == "filter") { if (!comptest->c_tfilt) { atf_comp::FTfilt &tfilt=tfilt_Alloc(); tfilt.comptest=comptest->comptest; diff --git a/cpp/atf_cov/atf_cov.cpp b/cpp/atf_cov/atf_cov.cpp index 85956ff3..dde58602 100644 --- a/cpp/atf_cov/atf_cov.cpp +++ b/cpp/atf_cov/atf_cov.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2023 Astra // // License: GPL @@ -70,7 +70,9 @@ static void DeleteFiles(strptr dir, strptr pattern) { static void CleanupDirPhase(strptr covdir, atf_cov_Phase_value_Enum phase) { if (phase == atf_cov_Phase_value_runcmd) { - DeleteFiles(covdir,"*.gcda"); + if (!atf_cov::_db.cmdline.incremental) { + DeleteFiles(covdir,"*.gcda"); + } phase = atf_cov_Phase_value_gcov;// grab the next phases too } if (phase == atf_cov_Phase_value_gcov) { diff --git a/cpp/atf_exp/atf_exp.cpp b/cpp/atf_exp/atf_exp.cpp new file mode 100644 index 00000000..ae0ed422 --- /dev/null +++ b/cpp/atf_exp/atf_exp.cpp @@ -0,0 +1,457 @@ +// Copyright (C) 2024,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: atf_exp (exe) -- ATF expect +// Exceptions: yes +// Source: cpp/atf_exp/atf_exp.cpp +// +// This source code constitutes confidential information and trade secrets +// of AlgoRND. Unauthorized copying, distribution or sharing of this file, +// via any medium, is strictly prohibited. + +#include "include/algo.h" +#include "include/atf_exp.h" + +// Add variable NAME=VALUE to global replscope +// And append a line to $tempdir/vars +void atf_exp::SetVar(algo::strptr name, algo::strptr value) { + Set(_db.R,tempstr()<<"$"< 0) { + memmove(parent.ary_elems, parent.ary_elems + n, rest); + parent.ary_n = rest; + } else { + ary_RemoveAll(parent); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// +// STDIN MESSAGES +// +//////////////////////////////////////////////////////////////////////////////// + +// remove directory +void atf_exp::In_RemDirRecurseMsg(ams::RemDirRecurseMsg &msg) { + algo::RemDirRecurse(Subst(_db.R,pathname_Getary(msg)),msg.remove_topmost); +} + +//------------------------------------------------------------------------------ + +// start new subprocess +void atf_exp::In_ProcStartMsg(ams::ProcStartMsg &msg) { + if (ind_proc_Find(msg.proc)) { + prerr("atf_exp.badproc" + <=0); + errno_vrfy_(grantpt(fdp)==0); + errno_vrfy_(unlockpt(fdp)==0); + errno_vrfy_((fdc = open(ptsname(fdp),O_RDWR|O_CLOEXEC|O_NOCTTY))>=0); + fd[0][0] = fd[1][1] = fdc; + fd[0][1] = fd[1][0] = fdp; + } else { + errno_vrfy_(pipe2(fd[0],O_CLOEXEC)==0); + errno_vrfy_(pipe2(fd[1],O_CLOEXEC)==0); + } + algo::Fildes in(fd[1][0]); + algo::Fildes out(fd[0][1]); + SetBlockingMode(in,false); + SetBlockingMode(out,false); + in_BeginRead(proc,in); + out_BeginWrite(proc,out,false); + + proc.bash.fstdin = tempstr() << "<&" << fd[0][0]; + proc.bash.fstdout = tempstr() << ">&" << fd[1][1]; + proc.bash.fstderr = proc.bash.fstdout; + try {// failed substitution -> failed test + proc.bash.cmd.c = Subst(_db.R,cmd_Getary(msg)); + } catch (algo_lib::ErrorX &x) { + proc.bash.cmd.c = "false"; + } + bash_Start(proc.bash); + if (proc.bash.pid > 0) { + proc.pid = proc.bash.pid; + ind_proc_pid_InsertMaybe(proc); + } + close(fd[0][0]); + close(fd[1][1]); + ProcStatus(proc); + } +} + +//------------------------------------------------------------------------------ + +// Switch focus to process, start reading process output +// and waiting `until` string. +// Empty string means until process exit. +// Launch timer. +void atf_exp::In_ProcReadMsg(ams::ProcReadMsg &msg) { + if ((_db.c_proc_read = ind_proc_Find(msg.proc))) { + _db.proc_read_until = until_Getary(msg); + _db.c_proc_read->wait = !ch_N(_db.proc_read_until); + // suspend stdin + while (FFdin *fdin = cd_fdin_read_RemoveFirst()) { + cd_fdin_suspend_Insert(*fdin); + } + // launch timer + hook_Set0(_db.timeout,Timeout); + ThScheduleIn(_db.timeout, algo::ToSchedTime(_db.cmdline.timeout)); + // read shelved + ProcRead(*_db.c_proc_read); + } else { + prerr("atf_exp.badproc" + <out_iohook); + } else { + proc->out_delay_close = true; + } + } else { + prerr("atf_exp.badproc" + <pid > 0) { + kill(proc->pid,msg.signal); + } + } else { + prerr("atf_exp.badproc" + <length; + cstring out; + ams::MsgHeaderMsgs_Print(out,*pmsg,UINT_MAX); + prlog(out); + found = ch_N(_db.proc_read_until) && algo::FindStr(out,_db.proc_read_until) >= 0; + }ind_end; + ary_Shift(proc.output,next_pmsg-first_pmsg); + found |= !ch_N(_db.proc_read_until) && del; // handle empty until case + // if found - resume stdin, remove timer + if (found) { + _db.c_proc_read = NULL; + while (FFdin *fdin = cd_fdin_suspend_RemoveFirst()) { + cd_fdin_read_Insert(*fdin); + } + bh_timehook_Remove(_db.timeout); + } else { + // since this function is non-blocking, + // not found doesn't mean timed out... + // see Timeout function for that + } + // delete process + if (del) { + proc_Delete(proc); + } + } +} + +//------------------------------------------------------------------------------ + +// timeout hook +void atf_exp::Timeout() { + if (_db.c_proc_read) { + FProc &proc = *_db.c_proc_read; + prlog("atf_exp.timeout" + << Keyval("proc",proc.proc) + << Keyval("pid", proc.pid) + << Keyval("wait",proc.wait) + << Keyval("in_eof",proc.in_eof) + << Keyval("in_msgvalid",proc.in_msgvalid) + << Keyval("out_n",out_N(proc)) + << Keyval("output_n",ary_N(proc.output)) + << Keyval("until",_db.proc_read_until)); + if (_db.cmdline.dbgshell){ + // invoke live bash with current env + TimeoutBash(); + // then continue with exit + prlog("atf_exp.timeout: continue to MainLoop exit"); + } + algo_lib::ReqExitMainLoop(); + algo_lib::_db.exit_code=1; + } +} + +//------------------------------------------------------------------------------ + +// issue process status message +void atf_exp::ProcStatus(atf_exp::FProc &proc) { + cstring status; + if (proc.pid) { + status = "Running"; + } else { + if (proc.bash.pid == 0) { + status = "NotStarted"; + } else if (proc.bash.pid < 0) { + status << "StartFailed: " << strerror(proc.bash.status); + } else if (WIFEXITED(proc.bash.status)) { + status << "Exited: " << WEXITSTATUS(proc.bash.status); + } else if (WIFSIGNALED(proc.bash.status)) { + status << strsignal(WTERMSIG(proc.bash.status)); + if (WCOREDUMP(proc.bash.status)) { + status << " (core dumped)"; + } + } + } + ProcStatusMsg_FmtAppend(proc.output,proc.proc,status); +} + +//------------------------------------------------------------------------------ + +// process read hook: +// - capture process variables in form of `$name:value`, +// which could be utilized when launching next process using `$name` substitution +// in ams.ProcStartMsg cmd:"... $name ..." +// - store process output as ams.ProcMsg in process output buffer (shelf) +void atf_exp::cd_proc_read_Step() { + if (FProc *proc = cd_proc_read_RotateFirst()) { + strptr line = in_GetMsg(*proc); + if (ch_N(line)) { + if (StartsWithQ(line,"atf.var")) {// filter these out + ind_beg(algo::Attr_curs,attr,RestFrom(line,7)) { + SetVar(attr.name,attr.value); + }ind_end; + } + ProcMsg_FmtAppend(proc->output,proc->proc,line); + } + in_SkipMsg(*proc); + ProcRead(*proc); // handles eof + } +} + +//------------------------------------------------------------------------------ + +// write to subprocess +void atf_exp::cd_proc_outflow_Step() { + if (FProc *proc = cd_proc_outflow_RotateFirst()) { + out_Outflow(*proc); + if (proc->out_delay_close && !out_N(*proc)) { + // close proc stdin from sending side + algo::Refurbish(proc->out_iohook); + } + } +} + +//------------------------------------------------------------------------------ + +// wait subprocess +void atf_exp::ind_proc_pid_Step() { + int status = 0; + int pid = waitpid(-1,&status,WNOHANG); + if (pid > 0) { + // child exited or killed + if (WIFEXITED(status) || WIFSIGNALED(status)) { + if (FProc *proc = ind_proc_pid_Find(pid)) { + ind_proc_pid_Remove(*proc); + proc->pid = 0; + ProcRead(*proc);// read remainder of output from the process + } else { + prerr("Unknown PID: " << pid); + } + } + } else { + // nothing interesting + ind_proc_pid_SetDelay(algo::ToSchedTime(60.0)); + } +} + +//------------------------------------------------------------------------------ + +// Handle SIGCHLD +void atf_exp::SigchldHandler(int sig) { + (void)sig; + atf_exp::ind_proc_pid_SetDelay(algo::SchedTime()); +} + +//------------------------------------------------------------------------------ + +// Setup signal handlers +void atf_exp::SetupSignalHandlers() { + // SIGCHLD + struct sigaction sigact; + sigact.sa_handler = SigchldHandler; + sigemptyset(&sigact.sa_mask); + sigact.sa_flags = SA_RESTART; + (void)sigaction(SIGCHLD, &sigact, 0); + // SIGPIPE + signal(SIGPIPE,SIG_IGN); +} + +// ----------------------------------------------------------------------------- + +// invoke bash with interactive input +void atf_exp::TimeoutBash() { + cstring cmd; + Ins(&_db.R, cmd,"echo Interactive bash entered on timeout"); + Ins(&_db.R, cmd,"source $tempdir/vars"); + Ins(&_db.R, cmd,"exec | base64 >test/gcli/gitlab_token.base64 // 3. A public/private key for the project "deploy key" is used // 4. ~/.ssh/config is modified to use the key for host "glpat?" // // Github // 1. A private repo "vparizhs/ghp" is created (can be a different user?) -// 2. A "fine grained" "access token" key for the project is generated: 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 - also shows public projects r/o! +// 2. A "fine grained" "access token" key for the project is generated, it is pretty long +// - also shows public projects r/o! +// Token is converted to base64 file in test/gcli/github_token.base64 +// | base64 test/gcli/github_token.base64 // 3. A public/private key for the repo "deploy key" is used // 4. ~/.ssh/config is modified to use the key for host "ghp?" // @@ -245,6 +249,7 @@ static void PrepGitdir(){ ind_beg(atf_gcli::_db_gclienv_curs,gclienv,atf_gcli::_db) if (gclienv.gclienv!="all"){ tempstr repo(gclienvsub_Get(gclienv.gclienv,gclidb_Gclisub_gclisub__REPO).uval); tempstr gitdir(gclienvsub_Get(gclienv.gclienv,gclidb_Gclisub_gclisub__GITDIR).uval); + tempstr idrsa_file(gclienvsub_Get(gclienv.gclienv,gclidb_Gclisub_gclisub__ID_RSA).uval); if (repo!=""){ tempstr cmd; algo_lib::Replscope R; @@ -259,8 +264,13 @@ static void PrepGitdir(){ Ins(&R,cmd,"rm -fr temp/.$gitdir $std"); Ins(&R,cmd,"mkdir -p temp/.$gitdir"); Ins(&R,cmd,"git -C temp/.$gitdir init $std"); - Ins(&R,cmd,"cp .git/config temp/.$gitdir/.git/config"); - + // set the private key for the project + Set(R,"$idrsa_file",idrsa_file); + Ins(&R,cmd,"cat $idrsa_file | base64 -d > temp/.$gitdir/id_rsa"); + Ins(&R,cmd,"chmod go-rwx temp/.$gitdir/id_rsa"); + // point git to the private key + Set(R,"$PWD",getenv("PWD")); + Ins(&R,cmd,"git -C temp/.$gitdir config core.sshCommand \"ssh -i $PWD/temp/.$gitdir/id_rsa\""); Ins(&R,cmd,"echo \"# atf_gcli $proj\" >> temp/.$gitdir/README.md"); Ins(&R,cmd,"git -C temp/.$gitdir add README.md $std"); Ins(&R,cmd,"git -C temp/.$gitdir commit -m \"first commit\" $std"); @@ -268,7 +278,7 @@ static void PrepGitdir(){ Ins(&R,cmd,"git -C temp/.$gitdir push -u $proj master -f $std"); Ins(&R,cmd,"mkdir -p temp/.$gitdir/temp"); - SysCmd(cmd,FailokQ(false),DryrunQ(atf_gcli::_db.cmdline.dry_run),EchoQ(algo_lib::_db.cmdline.verbose)); + SysCmd(cmd,FailokQ(false),DryrunQ(atf_gcli::_db.cmdline.dry_run)); } }ind_end; } @@ -307,8 +317,19 @@ void atf_gcli::DebugDump() { } // ----------------------------------------------------------------------------- - +//Github doesn't like to see its tokens visible, even though these are "test only" tokens +static void RecoverTokenFromBase64(){ + ind_beg(atf_gcli::_db_gclienvsub_curs,gclienvsub,atf_gcli::_db) if (sub_Get(gclienvsub)==gclidb_Gclisub_gclisub__TOKEN){ + tempstr cmd("base64 -d "); + cmd< @@ -2437,7 +2474,7 @@ void atf_unit::unittest_algo_lib_Mmap() { // write to file via OS file api { algo_lib::FFildes writefd; - writefd.fd = OpenWrite(fname,algo_FileFlags_append); + writefd.fd = OpenWrite(fname,algo_FileFlags_write|algo_FileFlags_read); lseek(writefd.fd.value,0,SEEK_SET); ssize_t ret_val = write(writefd.fd.value, "123456", 6); (void) ret_val; @@ -2699,3 +2736,83 @@ void atf_unit::unittest_algo_lib_ReverseBits() { vrfyeq_(algo::u8_ReverseBits(0x55),0xaa); vrfyeq_(algo::u8_ReverseBits(0xaa),0x55); } + +static void Zigzag32(i32 value, strptr hex) { + { + algo::ByteAry buf; + algo::EncodeVLCLEI32Z(buf,value); + tempstr out = tempstr() << ary_Getary(buf); + vrfyeq_(out,hex); + } + { + i32 decoded(0); + algo::ByteAry buf; + ByteAry_ReadStrptrMaybe(buf,hex); + algo::memptr ptr = ary_Getary(buf); + algo::DecodeVLCLEI32Z(ptr,decoded); + vrfy_(!elems_N(ptr)); + vrfyeq_(decoded,value); + } +} + +static void Zigzag64(i64 value, strptr hex) { + { + algo::ByteAry buf; + algo::EncodeVLCLEI64Z(buf,value); + tempstr out = tempstr() << ary_Getary(buf); + vrfyeq_(out,hex); + } + { + i64 decoded(0); + algo::ByteAry buf; + ByteAry_ReadStrptrMaybe(buf,hex); + algo::memptr ptr = ary_Getary(buf); + algo::DecodeVLCLEI64Z(ptr,decoded); + vrfy_(!elems_N(ptr)); + vrfyeq_(decoded,value); + } +} + +void atf_unit::unittest_algo_lib_Zigzag() { + Zigzag32(0,"00"); + Zigzag32(-1,"01"); + Zigzag32(1,"02"); + Zigzag32(-2,"03"); + Zigzag32(2, "04"); + Zigzag32(1000,"d0 0f"); + Zigzag32(-1000,"cf 0f"); + Zigzag32(0x7fffffff,"fe ff ff ff 0f"); + Zigzag32(-0x80000000,"ff ff ff ff 0f"); + + Zigzag64(0,"00"); + Zigzag64(-1,"01"); + Zigzag64(1,"02"); + Zigzag64(-2,"03"); + Zigzag64(2, "04"); + Zigzag64(1000,"d0 0f"); + Zigzag64(-1000,"cf 0f"); + //Zigzag64(0x7fffffffffffffff,"fe ff ff ff ff ff ff ff ff 01"); + Zigzag64(-0x8000000000000000,"ff ff ff ff ff ff ff ff ff 01"); +} +// -------------------------------------------------------------------------------- + +// Test that a file opened in append mode always writes at the end +// regardless of file position +void atf_unit::unittest_algo_lib_FileAppend() { + algo::strptr fname = "temp/appendfile"; + DeleteFile(fname); + algo::Fildes fildes = algo::OpenFile(fname, algo_FileFlags_append); + WriteFile(fildes, (u8*)"blah", 4); + SeekFile(fildes, 2); + WriteFile(fildes, (u8*)"bleh", 4); + vrfy(FileToString(fname)=="blahbleh", "append mode doesn't work"); +} + +// -------------------------------------------------------------------------------- + +void atf_unit::unittest_algo_lib_Url() { + vrfyeq_(algo::UrlDecode("///012abcdefACDEF%21%22%234%%%1z+",false),"///012abcdefACDEF!\"#4%%%1z+"); + algo::Tuple tuple; + ParseUrl(tuple,"/api/v1/stream?beg=100&end=inf&par%201=Hello%20World!&flag&par2=John%26Co."); + vrfyeq_(tempstr()<|\n" - "|---|---|---|\n" - "|-|-|-|\n" - "|val3|val2|val1|\n" - ); + Check(out, + "|col1...|col2|col3
|\n" + "|---|---|---|\n" + "|-|-|-|\n" + "|val3|val2|val1|\n" + ); Refurbish(out); FTxttbl_Print(tbl,out); - vrfyeq_(out, - "col1... col2 col3\n\n" - " - - -\n" - "val3 val2 val1\n" - ); + Check(out, + "col1... col2 col3\n\n" + " - - -\n" + "val3 val2 val1\n" + ); // Check AddCols algo::Refurbish(tbl); @@ -66,10 +78,10 @@ void atf_unit::unittest_algo_lib_Txttbl(){ AddCols(tbl,"*,*,*",algo_TextJust_j_left); Refurbish(out); FTxttbl_Print(tbl,out); - vrfyeq_(out, - "aaa bbb ccc\n" - " * * *\n" - " * * *\n" - "* * *\n" - ); + Check(out, + "aaa bbb ccc\n" + " * * *\n" + " * * *\n" + "* * *\n" + ); } diff --git a/cpp/atf_unit/ams.cpp b/cpp/atf_unit/ams.cpp index 70e0e98f..09fb24cb 100644 --- a/cpp/atf_unit/ams.cpp +++ b/cpp/atf_unit/ams.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 @@ -22,20 +22,21 @@ #include "include/atf_unit.h" #include "include/gen/ams_gen.h" #include "include/gen/ams_gen.inl.h" +#include "include/lib_ams.h" // -------------------------------------------------------------------------------- void atf_unit::unittest_ams_StreamId() { - // Compose a stream ID and check that it prints correctly - ams::ProcType proctype=ams_ProcType_0; - ams::StreamType streamtype=ams_StreamType_ctl; - ams::ProcId proc_id(proctype,0); - ams::StreamId id = ams::StreamId(proc_id,streamtype,1); + // Compose a shm ID and check that it prints correctly + ams::Proctype proctype=ams_Proctype_; + ams::Shmtype shmtype=ams_Shmtype_ctl; + ams::ProcId proc_id = lib_ams::MakeProcId(proctype,1,2); + ams::ShmId id = ams::ShmId(proc_id,shmtype,1); prlog(id); - vrfy_((tempstr() << id) == "0-0.ctl-1"); + vrfy_((tempstr() << id) == "-1-2.ctl-1"); // Read the ID back and compare with original - ams::StreamId id2; - ams::StreamId_ReadStrptrMaybe(id2,(tempstr()<. +// +// Target: atf_unit (exe) -- Unit tests (see unittest table) +// Exceptions: yes +// Source: cpp/atf_unit/lib_curl.cpp +// + +#include "include/atf_unit.h" +#include "include/lib_curl.h" + +// ----------------------------------------------------------------------------- +static void PrintCurlResp(lib_curl::FResponse &resp,strptr test){ + tempstr out(lib_curl::PrintCurlResp(resp,/*nodate*/false)); + tempstr fname("temp/lib_curl_"); + fname<. +// +// Contacting ICE: +// Target: atf_unit (exe) -- Unit tests (see unittest table) +// Exceptions: yes +// Source: cpp/atf_unit/lib_netio.cpp +// +// -------------------------------------------------------------------------------- + +#include "include/atf_unit.h" +#include "include/lib_netio.h" + +void atf_unit::unittest_lib_netio_GetHostAddr(){ + vrfy(lib_netio::GetHostAddr("example.com")!="","example.com resolution failed"); + vrfy(lib_netio::GetHostAddr("8.8.8.8")=="8.8.8.8","8.8.8.8 resolution failed"); + vrfy(lib_netio::GetHostAddr("0.0.0.0")=="0.0.0.0","0.0.0.0 resolution failed"); + vrfy(lib_netio::GetHostAddr("example.invalid")=="","example.invalid is resolved - wrong!"); + vrfy(lib_netio::GetHostAddr("")=="","empty string is resolved - wrong!"); + vrfy(lib_netio::GetHostAddr("0.0.0.0/24")=="","badly formed ip is resoved"); +} diff --git a/cpp/atf_unit/lib_sql.cpp b/cpp/atf_unit/lib_sql.cpp index e2dd562a..846c1a73 100644 --- a/cpp/atf_unit/lib_sql.cpp +++ b/cpp/atf_unit/lib_sql.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 diff --git a/cpp/atf_unit/line.cpp b/cpp/atf_unit/line.cpp index 1f450d19..517885c9 100644 --- a/cpp/atf_unit/line.cpp +++ b/cpp/atf_unit/line.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 // diff --git a/cpp/atf_unit/lockfile.cpp b/cpp/atf_unit/lockfile.cpp index a8b9e03b..330e840e 100644 --- a/cpp/atf_unit/lockfile.cpp +++ b/cpp/atf_unit/lockfile.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 // diff --git a/cpp/atf_unit/main.cpp b/cpp/atf_unit/main.cpp index c6739a9f..fad698e3 100644 --- a/cpp/atf_unit/main.cpp +++ b/cpp/atf_unit/main.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023 AlgoRND +// Copyright (C) 2023,2026 AlgoRND // Copyright (C) 2020-2023 Astra // Copyright (C) 2013-2019 NYSE | Intercontinental Exchange // Copyright (C) 2008-2013 AlgoEngineering LLC diff --git a/cpp/atf_unit/parsenum.cpp b/cpp/atf_unit/parsenum.cpp index 74e4e968..6eced214 100644 --- a/cpp/atf_unit/parsenum.cpp +++ b/cpp/atf_unit/parsenum.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2020-2023 Astra // // License: GPL @@ -45,11 +45,7 @@ static u64 test_atoi_be(const u8 *str, u32 len) { } // Template function to facilitate all test cases -template -static void TestStrNumConv( - rettype (*func) (argtype arg, u32 &ok) - ,rettype (*afunc)(argtype arg, u32 len, u32 &ok) - ,rettype (*sfunc)(strptr arg, u32 &ok)) { +template static void TestStrNumConv(rettype (*func) (argtype arg, u32 &ok),rettype (*afunc)(argtype arg, u32 len, u32 &ok),rettype (*sfunc)(strptr arg, u32 &ok)) { u8 buf[N]; // nominal cases for one running digit on the background of all other digits are the same diff --git a/cpp/atf_unit/regx.cpp b/cpp/atf_unit/regx.cpp index fdf50368..32d0655c 100644 --- a/cpp/atf_unit/regx.cpp +++ b/cpp/atf_unit/regx.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2020-2021 Astra // // License: GPL @@ -24,125 +24,192 @@ //*****------------------------------------------------ Oct 8 1999 ------***** -static bool RegxMatch(strptr expr, strptr str) { +static bool RegxMatch(strptr expr, strptr str, algo_lib::RegxStyle style = algo_lib_RegxStyle_default) { algo_lib::Regx regx; - Regx_ReadDflt(regx,expr); - return Regx_Match(regx,str); -} -static bool RegxMatchShell(strptr expr, strptr str) { - algo_lib::Regx regx; - Regx_ReadShell(regx,expr,true); + Regx_ReadStyle(regx,expr,style,true); return Regx_Match(regx,str); } -static bool RegxMatchSql(strptr expr, strptr str) { +static bool RegxLiteralQ(strptr expr, algo_lib::RegxStyle style) { algo_lib::Regx regx; - Regx_ReadSql(regx,expr,true); - return Regx_Match(regx,str); + Regx_ReadStyle(regx,expr,style,true); + return literal_Get(regx.flags); } -static bool RegxAcrLiteralQ(strptr expr) { +static algo::i32_Range RegxFind(strptr expr, algo::strptr str, int start = 0, algo_lib::RegxStyle style = algo_lib_RegxStyle_default) { algo_lib::Regx regx; - Regx_ReadAcr(regx,expr,true); - return regx.literal; + Regx_ReadStyle(regx,expr,style,false); + return Regx_Find(regx,str,start); } -static bool RegxSqlLiteralQ(strptr expr) { +static bool ValidRegxQ(strptr expr) { algo_lib::Regx regx; - Regx_ReadSql(regx,expr,true); - return regx.literal; + Regx_ReadDflt(regx,expr); + return valid_Get(regx.flags); } // -------------------------------------------------------------------------------- void atf_unit::unittest_algo_lib_Regx() { - vrfyeq_(RegxMatch("", ""), true);// empty regx matches empty string - vrfyeq_(RegxMatch("", "x"), false);// empty regx matches empty string only - vrfyeq_(RegxMatch(".*", "abcd") , true); - vrfyeq_(RegxMatch("a.*", "abcd") , true); - vrfyeq_(RegxMatch("ab.*", "abcd") , true); - vrfyeq_(RegxMatch("abc.*", "abcd") , true); - vrfyeq_(RegxMatch("abcd.*", "abcd") , true); - vrfyeq_(RegxMatch("abcd.*", "abcde") , true); - vrfyeq_(RegxMatch(".+", "abcd") , true); - vrfyeq_(RegxMatch(".+", "" ) , false); - vrfyeq_(RegxMatch("ab+c", "abc") , true); - vrfyeq_(RegxMatch("ab+c", "abbbbbbbbbbbbbbbbbbbbc") , true); - vrfyeq_(RegxMatch("abcd", "abcd") , true); - vrfyeq_(RegxMatch("a(b|c)d", "acd") , true); - vrfyeq_(RegxMatch("a(b|c)d", "abd") , true); - vrfyeq_(RegxMatch("abcd", "abc") , false); - vrfyeq_(RegxMatch(".*", "") , true); - vrfyeq_(RegxMatch(".*", ".*") , true); - vrfyeq_(RegxMatch(".*", "\x80\xff") , true); - vrfyeq_(RegxMatch("\x82\x83", "\x82\x83") , true); - vrfyeq_(RegxMatch("\x82", "\x81") , false); - vrfyeq_(RegxMatch("[\x81-\x85]+", "\x82\x83") , true); - vrfyeq_(RegxMatch("[\x81-\x85]", "\x80") , false); - - vrfyeq_(RegxMatch("(", ""), true);// bad regx -- but must match - vrfyeq_(RegxMatch("(((", ""), true);// bad regx -- but must match - vrfyeq_(RegxMatch(")", ")"), true);// bad regx -- but must match + // Check empty (just-initialized) regex + { + algo_lib::Regx regx; + vrfyeq_(Regx_Match(regx,""),true); + vrfyeq_(Regx_Match(regx,"a"),false); + } + + // Macros + vrfyeq_(RegxMatch("\\w+","abcde_12345"),true); + vrfyeq_(RegxMatch("\\w+","a-b"),false); + vrfyeq_(RegxMatch("\\d+","0123456789"),true); + vrfyeq_(RegxMatch("\\s*a","a"),true); + vrfyeq_(RegxMatch("\\s+a","a"),false); + vrfyeq_(RegxMatch("\\s+a"," a"),true); + + vrfyeq_(RegxMatch("", ""), true); + vrfyeq_(RegxMatch("", "x"), false); + vrfyeq_(RegxMatch("x", "x"), true); + vrfyeq_(RegxMatch("x", "xy"), false); + + vrfyeq_(RegxMatch(".*", ""), true); + vrfyeq_(RegxMatch(".*", "abcd"), true); + vrfyeq_(RegxMatch("a.*", "abcd"), true); + vrfyeq_(RegxMatch("ab.*", "abcd"), true); + vrfyeq_(RegxMatch("abc.*", "abcd"), true); + vrfyeq_(RegxMatch("abcd.*", "abcd"), true); + vrfyeq_(RegxMatch("abcd.*", "abcde"), true); + vrfyeq_(RegxMatch(".*", ".*"), true); + vrfyeq_(RegxMatch(".*", "\x80\xff"), true); + + vrfyeq_(RegxMatch(".+", "abcd"), true); + vrfyeq_(RegxMatch(".+", "" ), false); + vrfyeq_(RegxMatch("ab+c", "abc"), true); + vrfyeq_(RegxMatch("ab+c", "abbbbbbbbbbbbbbbbbbbbc"), true); + + vrfyeq_(RegxMatch("a|b", "a"), true); + vrfyeq_(RegxMatch("a|b", "b"), true); + + vrfyeq_(RegxMatch("a|b", "c"), false); + vrfyeq_(RegxMatch("(a|b)", "b"), true); + vrfyeq_(RegxMatch("(a|b)", "a"), true); + + vrfyeq_(RegxMatch("[a]", "a"), true); + vrfyeq_(RegxMatch("[a]", "b"), false); + vrfyeq_(RegxMatch("c[a]b", "cab"), true); + vrfyeq_(RegxMatch("c[a-z]b", "ctb"), true); + vrfyeq_(RegxMatch("c[a-z]b", "cAb"), false); + vrfyeq_(RegxMatch("[^a]", "a"), false); + vrfyeq_(RegxMatch("[^a]", "b"), true); + + vrfyeq_(RegxMatch("a(b|c)d", "acd"), true); + vrfyeq_(RegxMatch("a(b|c)d", "abd"), true); + vrfyeq_(RegxMatch("abcd", "abc"), false); + vrfyeq_(RegxMatch("\x82\x83", "\x82\x83"), true); + vrfyeq_(RegxMatch("\x82", "\x81"), false); + vrfyeq_(RegxMatch("[\x81-\x85]+", "\x82\x83"), true); + vrfyeq_(RegxMatch("[\x81-\x85]", "\x80"), false); + + vrfyeq_(RegxMatch("()", ""), true); + vrfyeq_(RegxMatch(".*(.*).*", "abcde"), true); + + vrfyeq_(RegxMatch("^aaa", "aaa"), true); + vrfyeq_(RegxMatch("^aaa", "bbb"), false); + + vrfyeq_(RegxMatch(".*(^a|b)", "a"), true); + vrfyeq_(RegxMatch(".*(^a|b)", "b"), true); + vrfyeq_(RegxMatch(".*(^a|b)", "c"), false); + vrfyeq_(RegxMatch(".*(^a|b)", ""), false); + vrfyeq_(RegxMatch(".*(^a|b)", "DDDb"), true); + vrfyeq_(RegxMatch(".*(^a|b)", "DDDa"), false); + + // test trailing anchor + vrfyeq_(RegxMatch(".*(a$|b).*", "bbba"), true); + vrfyeq_(RegxMatch(".*(a$|b).*", "cccbfff"), true); + vrfyeq_(RegxMatch(".*(a$|b).*", ""), false); + vrfyeq_(RegxMatch(".*(a$|b).*", "a"), true); + vrfyeq_(RegxMatch(".*(a$|b).*", "ac"), false); + vrfyeq_(RegxMatch(".*(a$|b).*", "ab"), true); + vrfyeq_(RegxMatch("xxxb$", "xxxb"), true); + vrfyeq_(!RegxMatch("xxxb$", "xxxbc"), true); + vrfyeq_(RegxMatch("abra.*$", "abra"), true); + vrfyeq_(RegxMatch("abra.*$", "abraddd"), true); + vrfyeq_(RegxMatch("abra.*$", "abcaddd"), false); + + vrfyeq_(ValidRegxQ("("), false); // bad regx + + vrfyeq_(RegxMatch("(", ""), false); // bad regx + vrfyeq_(RegxMatch("(((", ""), false);// bad regx + vrfyeq_(RegxMatch(")", ")"), true); vrfyeq_(RegxMatch("[", "["), true);// bad regx -- but must match vrfyeq_(RegxMatch("]", "]"), true);// bad regx -- but must match - vrfyeq_(RegxMatch("]](", "]]"), true);// bad regx -- but must match + vrfyeq_(RegxMatch("]](", "]]"), false);// bad regx vrfyeq_(RegxMatch("[a-b", "[a-b"), true);// bad regx -- but must match vrfyeq_(RegxMatch("", ""), true);// bad regx -- but must match - vrfyeq_(RegxMatchShell("*makefile*", "temp_makefile"), true); - vrfyeq_(RegxMatchShell("*makefile*", "makefile"), true); - vrfyeq_(RegxMatchShell("*make.ile", "makefile"), false);// should not match -- . is not special - vrfyeq_(RegxMatchShell("%", "makefile"), false);// should not match -- . is not special - - vrfyeq_(RegxMatchSql("", ""), true);// empty regx matches empty string - vrfyeq_(RegxMatchSql("", "x"), false);// empty regx matches empty string only - vrfyeq_(RegxMatchSql("\\_", "a"), false);// escaped underscore -> real char - vrfyeq_(RegxMatchSql("%", ""), true); - vrfyeq_(RegxMatchSql("%", "a"), true); - vrfyeq_(RegxMatchSql("%%%%%%", "a"), true); - vrfyeq_(RegxMatchSql("asdf%f", "asdfasdfasdf"), true);// wildcard - vrfyeq_(RegxMatchSql("asdf\\%f", "asdfasdfasdf"), false);// escaped wildcard - vrfyeq_(RegxMatchSql("asdf\\%f", "asdf%f"), true);// should be ok - vrfyeq_(RegxMatchSql("(a|b)", "a"), true);// should be ok - vrfyeq_(RegxMatchSql("(a|b)", "b"), true);// should be ok - vrfyeq_(RegxMatchSql("(a|b)", "c"), false);// should be ok - vrfyeq_(RegxMatchSql("(a|b)(d|e)", "ae"), true);// should be ok - vrfyeq_(RegxMatchSql("(a|b)(d|e)", "bd"), true);// should be ok - vrfyeq_(RegxMatchSql("(a|b)(d|e)", "bd"), true);// should be ok - - vrfy_(RegxSqlLiteralQ("")); - vrfy_(RegxSqlLiteralQ("2")); - vrfy_(RegxSqlLiteralQ(".")); - vrfy_(RegxSqlLiteralQ("*")); - vrfy_(RegxSqlLiteralQ("+")); - vrfy_(RegxSqlLiteralQ("?")); - vrfy_(RegxSqlLiteralQ("$")); - vrfy_(RegxSqlLiteralQ("^")); - vrfy_(!RegxSqlLiteralQ("_")); - vrfy_(!RegxSqlLiteralQ("|")); - vrfy_(!RegxSqlLiteralQ("%")); - vrfy_(!RegxSqlLiteralQ("(")); - vrfy_(!RegxSqlLiteralQ(")")); - vrfy_(!RegxSqlLiteralQ("[")); - vrfy_(!RegxSqlLiteralQ("]")); - - vrfy_(RegxAcrLiteralQ("")); - vrfy_(RegxAcrLiteralQ("2")); - vrfy_(RegxAcrLiteralQ(".")); - vrfy_(RegxAcrLiteralQ("_")); - vrfy_(RegxAcrLiteralQ("*")); - vrfy_(RegxAcrLiteralQ("+")); - vrfy_(RegxAcrLiteralQ("?")); - vrfy_(RegxAcrLiteralQ("$")); - vrfy_(RegxAcrLiteralQ("^")); - vrfy_(!RegxAcrLiteralQ("|")); - vrfy_(!RegxAcrLiteralQ("%")); - vrfy_(!RegxAcrLiteralQ("(")); - vrfy_(!RegxAcrLiteralQ(")")); - vrfy_(!RegxAcrLiteralQ("[")); - vrfy_(!RegxAcrLiteralQ("]")); + vrfyeq_(RegxMatch("*makefile*", "temp_makefile", algo_lib_RegxStyle_shell), true); + vrfyeq_(RegxMatch("*makefile*", "makefile", algo_lib_RegxStyle_shell), true); + vrfyeq_(RegxMatch("*make.ile", "makefile", algo_lib_RegxStyle_shell), false);// should not match -- . is not special + vrfyeq_(RegxMatch("%", "makefile", algo_lib_RegxStyle_shell), false);// should not match -- . is not special + + vrfyeq_(RegxMatch("", "", algo_lib_RegxStyle_sql), true); + vrfyeq_(RegxMatch("", "x", algo_lib_RegxStyle_sql), false); + vrfyeq_(RegxMatch("\\_", "a", algo_lib_RegxStyle_sql), false);// escaped underscore -> real char + vrfyeq_(RegxMatch("%", "", algo_lib_RegxStyle_sql), true); + vrfyeq_(RegxMatch("%", "a", algo_lib_RegxStyle_sql), true); + vrfyeq_(RegxMatch("%%%%%%", "a", algo_lib_RegxStyle_sql), true); + vrfyeq_(RegxMatch("asdf%f", "asdfasdfasdf", algo_lib_RegxStyle_sql), true);// wildcard + vrfyeq_(RegxMatch("asdf\\%f", "asdfasdfasdf", algo_lib_RegxStyle_sql), false);// escaped wildcard + vrfyeq_(RegxMatch("asdf\\%f", "asdf%f", algo_lib_RegxStyle_sql), true);// should be ok + vrfyeq_(RegxMatch("(a|b)", "a", algo_lib_RegxStyle_sql), true);// should be ok + vrfyeq_(RegxMatch("(a|b)", "b", algo_lib_RegxStyle_sql), true);// should be ok + vrfyeq_(RegxMatch("(a|b)", "c", algo_lib_RegxStyle_sql), false);// should be ok + vrfyeq_(RegxMatch("(a|b)(d|e)", "ae", algo_lib_RegxStyle_sql), true); + vrfyeq_(RegxMatch("(a|b)(d|e)", "bd", algo_lib_RegxStyle_sql), true); + vrfyeq_(RegxMatch("(a|b)(d|e)", "bd", algo_lib_RegxStyle_sql), true); + + vrfyeq_(RegxMatch("", "", algo_lib_RegxStyle_literal), true); + vrfyeq_(RegxMatch("", "x", algo_lib_RegxStyle_literal), false); + vrfyeq_(RegxMatch("x", "x", algo_lib_RegxStyle_literal), true); + vrfyeq_(RegxMatch("x", "", algo_lib_RegxStyle_literal), false); + vrfyeq_(RegxMatch(".*", "xyz", algo_lib_RegxStyle_literal), false); + vrfyeq_(RegxMatch(".*", ".*", algo_lib_RegxStyle_literal), true); + + vrfy_(RegxLiteralQ("", algo_lib_RegxStyle_default)); + vrfy_(RegxLiteralQ("abc", algo_lib_RegxStyle_default)); + vrfy_(!RegxLiteralQ(".*", algo_lib_RegxStyle_default)); + vrfy_(!RegxLiteralQ(".*().*", algo_lib_RegxStyle_default)); + vrfy_(!RegxLiteralQ(".*(.*).*", algo_lib_RegxStyle_default)); + + vrfy_(RegxLiteralQ("2", algo_lib_RegxStyle_sql)); + vrfy_(RegxLiteralQ("abcxyz$^", algo_lib_RegxStyle_sql)); + vrfy_(!RegxLiteralQ("a|b", algo_lib_RegxStyle_sql)); + vrfy_(!RegxLiteralQ("(d)", algo_lib_RegxStyle_sql)); + vrfy_(!RegxLiteralQ("%", algo_lib_RegxStyle_sql)); + + vrfy_(RegxLiteralQ("", algo_lib_RegxStyle_sql)); + vrfy_(RegxLiteralQ("2abcxyz$^", algo_lib_RegxStyle_sql)); + vrfy_(!RegxLiteralQ("a|b", algo_lib_RegxStyle_sql)); + vrfy_(!RegxLiteralQ("(d)", algo_lib_RegxStyle_sql)); + vrfy_(!RegxLiteralQ("%", algo_lib_RegxStyle_sql)); + + vrfy_(RegxLiteralQ("2abcxyz$^", algo_lib_RegxStyle_acr)); + vrfy_(!RegxLiteralQ("a|b", algo_lib_RegxStyle_acr)); + vrfy_(!RegxLiteralQ("(d)", algo_lib_RegxStyle_acr)); + vrfy_(!RegxLiteralQ("%", algo_lib_RegxStyle_acr)); + + vrfyeq_(RegxFind("ca","abracadabra"),algo::i32_Range(4,6)); + vrfyeq_(RegxFind("c.d.b","abracadabra"),algo::i32_Range(4,9)); + + // this one doesn't work because regx figures out right away that abracadabra matches .* + // and returns 0,0 0 -- todo figure out what to do with that + //vrfyeq_(RegxFind(".*","abracadabra"),algo::i32_Range(0,11)); } // ----------------------------------------------------------------------------- static void ShortCircuitMatch(strptr regx_str, strptr str, int njunk, strptr junkstr, bool expect, int maxcycles) { + prlog("test short circuit" + </dev/null 2>/dev/null "</dev/null 2>/dev/null "<> $HOME/.ssh/config"); - // Remove config file - Ins(&R,cmd,"rm -f $HOME/.ssh/config.d/$HOSTSSH"); - // Form config file - Ins(&R,cmd,"cat << 'EOFGCLI' > $HOME/.ssh/config.d/$HOSTSSH"); - Ins(&R,githost.ssh_config,"# Generated by gcli"); - Ins(&R,githost.ssh_config,"Host $HOSTSSH"); - Ins(&R,githost.ssh_config,"HostName $IP"); - Ins(&R,githost.ssh_config,"Port $PORT"); - Ins(&R,githost.ssh_config,"IdentityFile ~/.ssh/$ID"); - Ins(&R,githost.ssh_config,"StrictHostKeyChecking no"); - Ins(&R,githost.ssh_config,"UserKnownHostsFile=/dev/null"); - Ins(&R,githost.ssh_config,"LogLevel=QUIET"); - cmd<sshid); - } - - host=Subst(R,"$host_$sshport_$sshid"); - Set(R,"$githost",gclidb::Githost_Concat_git_host_gitrepo(git_Get(githost_in),host,gitrepo_Get(githost_in))); - gcli::FGithost &githost=gcli::ind_githost_GetOrCreate(host); - githost.ip=Subst(R,"$host"); - githost.port=Subst(R,"$sshport"); - githost.id=Subst(R,"$sshid"); - githost.id_file=Subst(R,"$sshfile"); - + Set(R,"$repo",grepo.name); + Set(R,"$githost",grepo.ssh_repo); // Set git remote cmd=GitCmd(Subst(R," remote remove $repo 2>/dev/null"))</dev/null"))<issue); } } + // consider operation successful, remove file + RemoveEditFile(); } // ----------------------------------------------------------------------------- void gcli::gtblact_issue_start(gcli::FGtblact >blact){ @@ -362,25 +378,31 @@ void gcli::gtblact_issue_start(gcli::FGtblact >blact){ gcli::FIssue &issue=ReadSingleIssue(gtblact); // gcli::FIssue &issue=ValidateIssue(issue_key); // Check branch exists - CheckGitBranchExists(issue_key); - // Check dir is clean - AssertGitWorkDirClean(); - // Checkout branch - GitCheckoutMasterBranch(issue); - // Add "in_progress" label here, preserve other labels - gcli::_db.cmdline.e=false; // just in case - // zd_gtblact_Extend(gclidb_Gtblact_gtblact_issue_update); - // if "in_progress" label present, just show the issue. - tempstr labels(issue.labels); - if (Replace(labels,gclidb_Label_label_in_progress,gclidb_Label_label_in_progress)){ - zd_gtblact_Extend(gclidb_Gtblact_gtblact_issue_list,id); - } else { - if (labels!=""){ - labels<<","; + if (CheckGitBranchExists(issue_key)){ + // Check dir is clean + AssertGitWorkDirClean(); + // Checkout branch + GitCheckoutMasterBranch(issue); + // Add "in_progress" label here, preserve other labels + gcli::_db.cmdline.e=false; // just in case + // zd_gtblact_Extend(gclidb_Gtblact_gtblact_issue_update); + // if "in_progress" label present, just show the issue. + tempstr labels(issue.labels); + if (Replace(labels,gclidb_Label_label_in_progress,gclidb_Label_label_in_progress)){ + zd_gtblact_Extend(gclidb_Gtblact_gtblact_issue_list,id); + } else { + if (labels!=""){ + labels<<","; + } + labels<gtype==gclidb_Gtype_gtype_glpat){ + gclicmd_mrlist.cond=tempstr()<<"state="<select) { - dbglog("TUPLE"); + prcat(debug,"TUPLE"); FormTuple(gclicmd); } // Fill all fields matching jkey with its value @@ -71,7 +71,7 @@ static void JsonJkeyVal(gcli::FGclicmd &gclicmd, cstring &jkey, strptr val){ gclicmdf.uval<value) == sizeof(pad_byte)); +} + // --- i16..ReadStrptrMaybe // Read fields of i16 from an ascii string. // Attempt to parse i16 from in_str @@ -96,8 +114,8 @@ bool i16_ReadStrptrMaybe(i16 &parent, algo::strptr in_str) { if (retval) { parent = num; } else { - algo_lib::SaveBadTag("comment", "i16_ReadStrptrMaybe: bad number"); - algo_lib::SaveBadTag("value",in_str); + algo_lib::AppendErrtext("comment", "i16_ReadStrptrMaybe: bad number"); + algo_lib::AppendErrtext("value",in_str); } return retval; } @@ -174,8 +192,8 @@ bool i32_ReadStrptrMaybe(i32 &parent, algo::strptr in_str) { if (retval) { parent = num; } else { - algo_lib::SaveBadTag("comment", "i32_ReadStrptrMaybe: bad number"); - algo_lib::SaveBadTag("value",in_str); + algo_lib::AppendErrtext("comment", "i32_ReadStrptrMaybe: bad number"); + algo_lib::AppendErrtext("value",in_str); } return retval; } @@ -268,8 +286,8 @@ bool i64_ReadStrptrMaybe(i64 &parent, algo::strptr in_str) { if (retval) { parent = num; } else { - algo_lib::SaveBadTag("comment", "i64_ReadStrptrMaybe: bad number"); - algo_lib::SaveBadTag("value",in_str); + algo_lib::AppendErrtext("comment", "i64_ReadStrptrMaybe: bad number"); + algo_lib::AppendErrtext("value",in_str); } return retval; } @@ -346,8 +364,8 @@ bool i8_ReadStrptrMaybe(i8 &parent, algo::strptr in_str) { if (retval) { parent = num; } else { - algo_lib::SaveBadTag("comment", "i8_ReadStrptrMaybe: bad number"); - algo_lib::SaveBadTag("value",in_str); + algo_lib::AppendErrtext("comment", "i8_ReadStrptrMaybe: bad number"); + algo_lib::AppendErrtext("value",in_str); } return retval; } @@ -424,8 +442,8 @@ bool u8_ReadStrptrMaybe(u8 &parent, algo::strptr in_str) { if (retval) { parent = num; } else { - algo_lib::SaveBadTag("comment", "u8_ReadStrptrMaybe: bad number"); - algo_lib::SaveBadTag("value",in_str); + algo_lib::AppendErrtext("comment", "u8_ReadStrptrMaybe: bad number"); + algo_lib::AppendErrtext("value",in_str); } return retval; } @@ -518,8 +536,8 @@ bool u128_ReadStrptrMaybe(u128 &parent, algo::strptr in_str) { if (retval) { parent = num; } else { - algo_lib::SaveBadTag("comment", "u128_ReadStrptrMaybe: bad number"); - algo_lib::SaveBadTag("value",in_str); + algo_lib::AppendErrtext("comment", "u128_ReadStrptrMaybe: bad number"); + algo_lib::AppendErrtext("value",in_str); } return retval; } @@ -596,8 +614,8 @@ bool u16_ReadStrptrMaybe(u16 &parent, algo::strptr in_str) { if (retval) { parent = num; } else { - algo_lib::SaveBadTag("comment", "u16_ReadStrptrMaybe: bad number"); - algo_lib::SaveBadTag("value",in_str); + algo_lib::AppendErrtext("comment", "u16_ReadStrptrMaybe: bad number"); + algo_lib::AppendErrtext("value",in_str); } return retval; } @@ -674,8 +692,8 @@ bool u32_ReadStrptrMaybe(u32 &parent, algo::strptr in_str) { if (retval) { parent = num; } else { - algo_lib::SaveBadTag("comment", "u32_ReadStrptrMaybe: bad number"); - algo_lib::SaveBadTag("value",in_str); + algo_lib::AppendErrtext("comment", "u32_ReadStrptrMaybe: bad number"); + algo_lib::AppendErrtext("value",in_str); } return retval; } @@ -768,8 +786,8 @@ bool u64_ReadStrptrMaybe(u64 &parent, algo::strptr in_str) { if (retval) { parent = num; } else { - algo_lib::SaveBadTag("comment", "u64_ReadStrptrMaybe: bad number"); - algo_lib::SaveBadTag("value",in_str); + algo_lib::AppendErrtext("comment", "u64_ReadStrptrMaybe: bad number"); + algo_lib::AppendErrtext("value",in_str); } return retval; } diff --git a/cpp/gen/abt_gen.cpp b/cpp/gen/abt_gen.cpp index fd2b12c7..b274c1c1 100644 --- a/cpp/gen/abt_gen.cpp +++ b/cpp/gen/abt_gen.cpp @@ -37,10 +37,13 @@ #include "include/gen/report_gen.inl.h" #include "include/gen/dmmeta_gen.h" #include "include/gen/dmmeta_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep abt::FDb abt::_db; // dependency found via dev.targdep @@ -73,15 +76,15 @@ const char *abt_help = " -disas regx \"\" Regex of function to disassemble\n" " -report Y Print final report\n" " -jcdb string \"\" Create JSON compilation database in specified file\n" -" -cache int auto Cache mode (auto|none|gcache|gcache-force|ccache)\n" +" -cache enum auto Cache mode (auto|none|gcache|gcache-force|ccache)\n" " auto Select cache automatically among enabled\n" " none No cache\n" " gcache Select gcache if enabled (no cache if disabled)\n" " gcache-force Pass --force to gcache (no cache if disabled)\n" " ccache Select ccache if enabled (no cache if disabled)\n" " -shortlink Try to shorten sort link if possible\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -224,6 +227,7 @@ void abt::FBuilddir_Init(abt::FBuilddir& builddir) { builddir.select = bool(false); builddir.p_compiler = NULL; builddir.ind_builddir_next = (abt::FBuilddir*)-1; // (abt.FDb.ind_builddir) not-in-hash + builddir.ind_builddir_hashval = 0; // stored hash value } // --- abt.FBuilddir..Uninit @@ -723,14 +727,9 @@ bool abt::tool_opt_XrefMaybe(abt::FToolOpt &row) { // Find row by key. Return NULL if not found. abt::FTarget* abt::ind_target_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_target_buckets_n - 1); - abt::FTarget* *e = &_db.ind_target_buckets_elems[index]; - abt::FTarget* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).target == key; - if (done) break; - e = &ret->ind_target_next; - } while (true); + abt::FTarget *ret = _db.ind_target_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_target_next) { + } return ret; } @@ -754,10 +753,11 @@ abt::FTarget& abt::ind_target_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_target.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_target_InsertMaybe(abt::FTarget& row) { - ind_target_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_target_next == (abt::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + row.ind_target_hashval = algo::Smallstr16_Hash(0, row.target); + ind_target_Reserve(1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); abt::FTarget* *prev = &_db.ind_target_buckets_elems[index]; do { abt::FTarget* ret = *prev; @@ -783,7 +783,7 @@ bool abt::ind_target_InsertMaybe(abt::FTarget& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_target_Remove(abt::FTarget& row) { if (LIKELY(row.ind_target_next != (abt::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); abt::FTarget* *prev = &_db.ind_target_buckets_elems[index]; // addr of pointer to current element while (abt::FTarget *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -800,8 +800,14 @@ void abt::ind_target_Remove(abt::FTarget& row) { // --- abt.FDb.ind_target.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_target_Reserve(int n) { + ind_target_AbsReserve(_db.ind_target_n + n); +} + +// --- abt.FDb.ind_target.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_target_AbsReserve(int n) { u32 old_nbuckets = _db.ind_target_buckets_n; - u32 new_nelems = _db.ind_target_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -820,7 +826,7 @@ void abt::ind_target_Reserve(int n) { while (elem) { abt::FTarget &row = *elem; abt::FTarget* next = row.ind_target_next; - u32 index = algo::Smallstr16_Hash(0, row.target) & (new_nbuckets-1); + u32 index = row.ind_target_hashval & (new_nbuckets-1); row.ind_target_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -943,14 +949,9 @@ bool abt::target_XrefMaybe(abt::FTarget &row) { // Find row by key. Return NULL if not found. abt::FTargsrc* abt::ind_targsrc_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_targsrc_buckets_n - 1); - abt::FTargsrc* *e = &_db.ind_targsrc_buckets_elems[index]; - abt::FTargsrc* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).targsrc == key; - if (done) break; - e = &ret->ind_targsrc_next; - } while (true); + abt::FTargsrc *ret = _db.ind_targsrc_buckets_elems[index]; + for (; ret && !((*ret).targsrc == key); ret = ret->ind_targsrc_next) { + } return ret; } @@ -974,10 +975,11 @@ abt::FTargsrc& abt::ind_targsrc_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_targsrc.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_targsrc_InsertMaybe(abt::FTargsrc& row) { - ind_targsrc_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_targsrc_next == (abt::FTargsrc*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.targsrc) & (_db.ind_targsrc_buckets_n - 1); + row.ind_targsrc_hashval = algo::Smallstr100_Hash(0, row.targsrc); + ind_targsrc_Reserve(1); + u32 index = row.ind_targsrc_hashval & (_db.ind_targsrc_buckets_n - 1); abt::FTargsrc* *prev = &_db.ind_targsrc_buckets_elems[index]; do { abt::FTargsrc* ret = *prev; @@ -1003,7 +1005,7 @@ bool abt::ind_targsrc_InsertMaybe(abt::FTargsrc& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_targsrc_Remove(abt::FTargsrc& row) { if (LIKELY(row.ind_targsrc_next != (abt::FTargsrc*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.targsrc) & (_db.ind_targsrc_buckets_n - 1); + u32 index = row.ind_targsrc_hashval & (_db.ind_targsrc_buckets_n - 1); abt::FTargsrc* *prev = &_db.ind_targsrc_buckets_elems[index]; // addr of pointer to current element while (abt::FTargsrc *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1020,8 +1022,14 @@ void abt::ind_targsrc_Remove(abt::FTargsrc& row) { // --- abt.FDb.ind_targsrc.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_targsrc_Reserve(int n) { + ind_targsrc_AbsReserve(_db.ind_targsrc_n + n); +} + +// --- abt.FDb.ind_targsrc.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_targsrc_AbsReserve(int n) { u32 old_nbuckets = _db.ind_targsrc_buckets_n; - u32 new_nelems = _db.ind_targsrc_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1040,7 +1048,7 @@ void abt::ind_targsrc_Reserve(int n) { while (elem) { abt::FTargsrc &row = *elem; abt::FTargsrc* next = row.ind_targsrc_next; - u32 index = algo::Smallstr100_Hash(0, row.targsrc) & (new_nbuckets-1); + u32 index = row.ind_targsrc_hashval & (new_nbuckets-1); row.ind_targsrc_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1470,9 +1478,8 @@ void abt::ReadArgv() { } if (ch_N(attrname) == 0) { err << "abt: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:abt.FDb.cmdline @@ -1526,7 +1536,7 @@ void abt::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -1571,7 +1581,7 @@ static void abt::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'abt.Input' signature:'e6410c40f922d321b99d2a6d7a62d27f1d49a5ac'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'abt.Input' signature:'a3467e9a802a9e293d88ca8cb2cead5a09c85dcf'"); } // --- abt.FDb._db.InsertStrptrMaybe @@ -1707,8 +1717,8 @@ bool abt::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && abt::LoadTuplesFile(algo::SsimFname(root,"dev.arch"),recursive); retval = retval && abt::LoadTuplesFile(algo::SsimFname(root,"dev.builddir"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -1780,14 +1790,9 @@ bool abt::_db_XrefMaybe() { // Find row by key. Return NULL if not found. abt::FSyscmd* abt::ind_syscmd_Find(i64 key) { u32 index = ::i64_Hash(0, key) & (_db.ind_syscmd_buckets_n - 1); - abt::FSyscmd* *e = &_db.ind_syscmd_buckets_elems[index]; - abt::FSyscmd* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).syscmd == key; - if (done) break; - e = &ret->ind_syscmd_next; - } while (true); + abt::FSyscmd *ret = _db.ind_syscmd_buckets_elems[index]; + for (; ret && !((*ret).syscmd == key); ret = ret->ind_syscmd_next) { + } return ret; } @@ -1811,10 +1816,11 @@ abt::FSyscmd& abt::ind_syscmd_GetOrCreate(i64 key) { // --- abt.FDb.ind_syscmd.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_syscmd_InsertMaybe(abt::FSyscmd& row) { - ind_syscmd_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_syscmd_next == (abt::FSyscmd*)-1)) {// check if in hash already - u32 index = ::i64_Hash(0, row.syscmd) & (_db.ind_syscmd_buckets_n - 1); + row.ind_syscmd_hashval = ::i64_Hash(0, row.syscmd); + ind_syscmd_Reserve(1); + u32 index = row.ind_syscmd_hashval & (_db.ind_syscmd_buckets_n - 1); abt::FSyscmd* *prev = &_db.ind_syscmd_buckets_elems[index]; do { abt::FSyscmd* ret = *prev; @@ -1840,7 +1846,7 @@ bool abt::ind_syscmd_InsertMaybe(abt::FSyscmd& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_syscmd_Remove(abt::FSyscmd& row) { if (LIKELY(row.ind_syscmd_next != (abt::FSyscmd*)-1)) {// check if in hash already - u32 index = ::i64_Hash(0, row.syscmd) & (_db.ind_syscmd_buckets_n - 1); + u32 index = row.ind_syscmd_hashval & (_db.ind_syscmd_buckets_n - 1); abt::FSyscmd* *prev = &_db.ind_syscmd_buckets_elems[index]; // addr of pointer to current element while (abt::FSyscmd *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1857,8 +1863,14 @@ void abt::ind_syscmd_Remove(abt::FSyscmd& row) { // --- abt.FDb.ind_syscmd.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_syscmd_Reserve(int n) { + ind_syscmd_AbsReserve(_db.ind_syscmd_n + n); +} + +// --- abt.FDb.ind_syscmd.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_syscmd_AbsReserve(int n) { u32 old_nbuckets = _db.ind_syscmd_buckets_n; - u32 new_nelems = _db.ind_syscmd_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1877,7 +1889,7 @@ void abt::ind_syscmd_Reserve(int n) { while (elem) { abt::FSyscmd &row = *elem; abt::FSyscmd* next = row.ind_syscmd_next; - u32 index = ::i64_Hash(0, row.syscmd) & (new_nbuckets-1); + u32 index = row.ind_syscmd_hashval & (new_nbuckets-1); row.ind_syscmd_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1894,14 +1906,9 @@ void abt::ind_syscmd_Reserve(int n) { // Find row by key. Return NULL if not found. abt::FSyscmd* abt::ind_running_Find(i32 key) { u32 index = ::i32_Hash(0, key) & (_db.ind_running_buckets_n - 1); - abt::FSyscmd* *e = &_db.ind_running_buckets_elems[index]; - abt::FSyscmd* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).pid == key; - if (done) break; - e = &ret->ind_running_next; - } while (true); + abt::FSyscmd *ret = _db.ind_running_buckets_elems[index]; + for (; ret && !((*ret).pid == key); ret = ret->ind_running_next) { + } return ret; } @@ -1925,10 +1932,11 @@ abt::FSyscmd& abt::ind_running_GetOrCreate(i32 key) { // --- abt.FDb.ind_running.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_running_InsertMaybe(abt::FSyscmd& row) { - ind_running_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_running_next == (abt::FSyscmd*)-1)) {// check if in hash already - u32 index = ::i32_Hash(0, row.pid) & (_db.ind_running_buckets_n - 1); + row.ind_running_hashval = ::i32_Hash(0, row.pid); + ind_running_Reserve(1); + u32 index = row.ind_running_hashval & (_db.ind_running_buckets_n - 1); abt::FSyscmd* *prev = &_db.ind_running_buckets_elems[index]; do { abt::FSyscmd* ret = *prev; @@ -1954,7 +1962,7 @@ bool abt::ind_running_InsertMaybe(abt::FSyscmd& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_running_Remove(abt::FSyscmd& row) { if (LIKELY(row.ind_running_next != (abt::FSyscmd*)-1)) {// check if in hash already - u32 index = ::i32_Hash(0, row.pid) & (_db.ind_running_buckets_n - 1); + u32 index = row.ind_running_hashval & (_db.ind_running_buckets_n - 1); abt::FSyscmd* *prev = &_db.ind_running_buckets_elems[index]; // addr of pointer to current element while (abt::FSyscmd *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1971,8 +1979,14 @@ void abt::ind_running_Remove(abt::FSyscmd& row) { // --- abt.FDb.ind_running.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_running_Reserve(int n) { + ind_running_AbsReserve(_db.ind_running_n + n); +} + +// --- abt.FDb.ind_running.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_running_AbsReserve(int n) { u32 old_nbuckets = _db.ind_running_buckets_n; - u32 new_nelems = _db.ind_running_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1991,7 +2005,7 @@ void abt::ind_running_Reserve(int n) { while (elem) { abt::FSyscmd &row = *elem; abt::FSyscmd* next = row.ind_running_next; - u32 index = ::i32_Hash(0, row.pid) & (new_nbuckets-1); + u32 index = row.ind_running_hashval & (new_nbuckets-1); row.ind_running_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2008,14 +2022,9 @@ void abt::ind_running_Reserve(int n) { // Find row by key. Return NULL if not found. abt::FSrcfile* abt::ind_srcfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_srcfile_buckets_n - 1); - abt::FSrcfile* *e = &_db.ind_srcfile_buckets_elems[index]; - abt::FSrcfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).srcfile == key; - if (done) break; - e = &ret->ind_srcfile_next; - } while (true); + abt::FSrcfile *ret = _db.ind_srcfile_buckets_elems[index]; + for (; ret && !((*ret).srcfile == key); ret = ret->ind_srcfile_next) { + } return ret; } @@ -2039,10 +2048,11 @@ abt::FSrcfile& abt::ind_srcfile_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_srcfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_srcfile_InsertMaybe(abt::FSrcfile& row) { - ind_srcfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_srcfile_next == (abt::FSrcfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.srcfile) & (_db.ind_srcfile_buckets_n - 1); + row.ind_srcfile_hashval = algo::Smallstr200_Hash(0, row.srcfile); + ind_srcfile_Reserve(1); + u32 index = row.ind_srcfile_hashval & (_db.ind_srcfile_buckets_n - 1); abt::FSrcfile* *prev = &_db.ind_srcfile_buckets_elems[index]; do { abt::FSrcfile* ret = *prev; @@ -2068,7 +2078,7 @@ bool abt::ind_srcfile_InsertMaybe(abt::FSrcfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_srcfile_Remove(abt::FSrcfile& row) { if (LIKELY(row.ind_srcfile_next != (abt::FSrcfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.srcfile) & (_db.ind_srcfile_buckets_n - 1); + u32 index = row.ind_srcfile_hashval & (_db.ind_srcfile_buckets_n - 1); abt::FSrcfile* *prev = &_db.ind_srcfile_buckets_elems[index]; // addr of pointer to current element while (abt::FSrcfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2085,8 +2095,14 @@ void abt::ind_srcfile_Remove(abt::FSrcfile& row) { // --- abt.FDb.ind_srcfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_srcfile_Reserve(int n) { + ind_srcfile_AbsReserve(_db.ind_srcfile_n + n); +} + +// --- abt.FDb.ind_srcfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_srcfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_srcfile_buckets_n; - u32 new_nelems = _db.ind_srcfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2105,7 +2121,7 @@ void abt::ind_srcfile_Reserve(int n) { while (elem) { abt::FSrcfile &row = *elem; abt::FSrcfile* next = row.ind_srcfile_next; - u32 index = algo::Smallstr200_Hash(0, row.srcfile) & (new_nbuckets-1); + u32 index = row.ind_srcfile_hashval & (new_nbuckets-1); row.ind_srcfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2219,14 +2235,9 @@ bool abt::cfg_XrefMaybe(abt::FCfg &row) { // Find row by key. Return NULL if not found. abt::FCfg* abt::ind_cfg_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_cfg_buckets_n - 1); - abt::FCfg* *e = &_db.ind_cfg_buckets_elems[index]; - abt::FCfg* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).cfg == key; - if (done) break; - e = &ret->ind_cfg_next; - } while (true); + abt::FCfg *ret = _db.ind_cfg_buckets_elems[index]; + for (; ret && !((*ret).cfg == key); ret = ret->ind_cfg_next) { + } return ret; } @@ -2250,10 +2261,11 @@ abt::FCfg& abt::ind_cfg_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_cfg.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_cfg_InsertMaybe(abt::FCfg& row) { - ind_cfg_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_cfg_next == (abt::FCfg*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.cfg) & (_db.ind_cfg_buckets_n - 1); + row.ind_cfg_hashval = algo::Smallstr50_Hash(0, row.cfg); + ind_cfg_Reserve(1); + u32 index = row.ind_cfg_hashval & (_db.ind_cfg_buckets_n - 1); abt::FCfg* *prev = &_db.ind_cfg_buckets_elems[index]; do { abt::FCfg* ret = *prev; @@ -2279,7 +2291,7 @@ bool abt::ind_cfg_InsertMaybe(abt::FCfg& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_cfg_Remove(abt::FCfg& row) { if (LIKELY(row.ind_cfg_next != (abt::FCfg*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.cfg) & (_db.ind_cfg_buckets_n - 1); + u32 index = row.ind_cfg_hashval & (_db.ind_cfg_buckets_n - 1); abt::FCfg* *prev = &_db.ind_cfg_buckets_elems[index]; // addr of pointer to current element while (abt::FCfg *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2296,8 +2308,14 @@ void abt::ind_cfg_Remove(abt::FCfg& row) { // --- abt.FDb.ind_cfg.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_cfg_Reserve(int n) { + ind_cfg_AbsReserve(_db.ind_cfg_n + n); +} + +// --- abt.FDb.ind_cfg.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_cfg_AbsReserve(int n) { u32 old_nbuckets = _db.ind_cfg_buckets_n; - u32 new_nelems = _db.ind_cfg_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2316,7 +2334,7 @@ void abt::ind_cfg_Reserve(int n) { while (elem) { abt::FCfg &row = *elem; abt::FCfg* next = row.ind_cfg_next; - u32 index = algo::Smallstr50_Hash(0, row.cfg) & (new_nbuckets-1); + u32 index = row.ind_cfg_hashval & (new_nbuckets-1); row.ind_cfg_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2430,14 +2448,9 @@ bool abt::uname_XrefMaybe(abt::FUname &row) { // Find row by key. Return NULL if not found. abt::FUname* abt::ind_uname_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_uname_buckets_n - 1); - abt::FUname* *e = &_db.ind_uname_buckets_elems[index]; - abt::FUname* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).uname == key; - if (done) break; - e = &ret->ind_uname_next; - } while (true); + abt::FUname *ret = _db.ind_uname_buckets_elems[index]; + for (; ret && !((*ret).uname == key); ret = ret->ind_uname_next) { + } return ret; } @@ -2461,10 +2474,11 @@ abt::FUname& abt::ind_uname_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_uname.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_uname_InsertMaybe(abt::FUname& row) { - ind_uname_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_uname_next == (abt::FUname*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.uname) & (_db.ind_uname_buckets_n - 1); + row.ind_uname_hashval = algo::Smallstr50_Hash(0, row.uname); + ind_uname_Reserve(1); + u32 index = row.ind_uname_hashval & (_db.ind_uname_buckets_n - 1); abt::FUname* *prev = &_db.ind_uname_buckets_elems[index]; do { abt::FUname* ret = *prev; @@ -2490,7 +2504,7 @@ bool abt::ind_uname_InsertMaybe(abt::FUname& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_uname_Remove(abt::FUname& row) { if (LIKELY(row.ind_uname_next != (abt::FUname*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.uname) & (_db.ind_uname_buckets_n - 1); + u32 index = row.ind_uname_hashval & (_db.ind_uname_buckets_n - 1); abt::FUname* *prev = &_db.ind_uname_buckets_elems[index]; // addr of pointer to current element while (abt::FUname *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2507,8 +2521,14 @@ void abt::ind_uname_Remove(abt::FUname& row) { // --- abt.FDb.ind_uname.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_uname_Reserve(int n) { + ind_uname_AbsReserve(_db.ind_uname_n + n); +} + +// --- abt.FDb.ind_uname.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_uname_AbsReserve(int n) { u32 old_nbuckets = _db.ind_uname_buckets_n; - u32 new_nelems = _db.ind_uname_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2527,7 +2547,7 @@ void abt::ind_uname_Reserve(int n) { while (elem) { abt::FUname &row = *elem; abt::FUname* next = row.ind_uname_next; - u32 index = algo::Smallstr50_Hash(0, row.uname) & (new_nbuckets-1); + u32 index = row.ind_uname_hashval & (new_nbuckets-1); row.ind_uname_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2641,14 +2661,9 @@ bool abt::compiler_XrefMaybe(abt::FCompiler &row) { // Find row by key. Return NULL if not found. abt::FCompiler* abt::ind_compiler_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_compiler_buckets_n - 1); - abt::FCompiler* *e = &_db.ind_compiler_buckets_elems[index]; - abt::FCompiler* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).compiler == key; - if (done) break; - e = &ret->ind_compiler_next; - } while (true); + abt::FCompiler *ret = _db.ind_compiler_buckets_elems[index]; + for (; ret && !((*ret).compiler == key); ret = ret->ind_compiler_next) { + } return ret; } @@ -2672,10 +2687,11 @@ abt::FCompiler& abt::ind_compiler_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_compiler.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_compiler_InsertMaybe(abt::FCompiler& row) { - ind_compiler_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_compiler_next == (abt::FCompiler*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.compiler) & (_db.ind_compiler_buckets_n - 1); + row.ind_compiler_hashval = algo::Smallstr50_Hash(0, row.compiler); + ind_compiler_Reserve(1); + u32 index = row.ind_compiler_hashval & (_db.ind_compiler_buckets_n - 1); abt::FCompiler* *prev = &_db.ind_compiler_buckets_elems[index]; do { abt::FCompiler* ret = *prev; @@ -2701,7 +2717,7 @@ bool abt::ind_compiler_InsertMaybe(abt::FCompiler& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_compiler_Remove(abt::FCompiler& row) { if (LIKELY(row.ind_compiler_next != (abt::FCompiler*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.compiler) & (_db.ind_compiler_buckets_n - 1); + u32 index = row.ind_compiler_hashval & (_db.ind_compiler_buckets_n - 1); abt::FCompiler* *prev = &_db.ind_compiler_buckets_elems[index]; // addr of pointer to current element while (abt::FCompiler *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2718,8 +2734,14 @@ void abt::ind_compiler_Remove(abt::FCompiler& row) { // --- abt.FDb.ind_compiler.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_compiler_Reserve(int n) { + ind_compiler_AbsReserve(_db.ind_compiler_n + n); +} + +// --- abt.FDb.ind_compiler.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_compiler_AbsReserve(int n) { u32 old_nbuckets = _db.ind_compiler_buckets_n; - u32 new_nelems = _db.ind_compiler_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2738,7 +2760,7 @@ void abt::ind_compiler_Reserve(int n) { while (elem) { abt::FCompiler &row = *elem; abt::FCompiler* next = row.ind_compiler_next; - u32 index = algo::Smallstr50_Hash(0, row.compiler) & (new_nbuckets-1); + u32 index = row.ind_compiler_hashval & (new_nbuckets-1); row.ind_compiler_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2852,14 +2874,9 @@ bool abt::arch_XrefMaybe(abt::FArch &row) { // Find row by key. Return NULL if not found. abt::FArch* abt::ind_arch_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_arch_buckets_n - 1); - abt::FArch* *e = &_db.ind_arch_buckets_elems[index]; - abt::FArch* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).arch == key; - if (done) break; - e = &ret->ind_arch_next; - } while (true); + abt::FArch *ret = _db.ind_arch_buckets_elems[index]; + for (; ret && !((*ret).arch == key); ret = ret->ind_arch_next) { + } return ret; } @@ -2883,10 +2900,11 @@ abt::FArch& abt::ind_arch_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_arch.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_arch_InsertMaybe(abt::FArch& row) { - ind_arch_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_arch_next == (abt::FArch*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.arch) & (_db.ind_arch_buckets_n - 1); + row.ind_arch_hashval = algo::Smallstr50_Hash(0, row.arch); + ind_arch_Reserve(1); + u32 index = row.ind_arch_hashval & (_db.ind_arch_buckets_n - 1); abt::FArch* *prev = &_db.ind_arch_buckets_elems[index]; do { abt::FArch* ret = *prev; @@ -2912,7 +2930,7 @@ bool abt::ind_arch_InsertMaybe(abt::FArch& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_arch_Remove(abt::FArch& row) { if (LIKELY(row.ind_arch_next != (abt::FArch*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.arch) & (_db.ind_arch_buckets_n - 1); + u32 index = row.ind_arch_hashval & (_db.ind_arch_buckets_n - 1); abt::FArch* *prev = &_db.ind_arch_buckets_elems[index]; // addr of pointer to current element while (abt::FArch *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2929,8 +2947,14 @@ void abt::ind_arch_Remove(abt::FArch& row) { // --- abt.FDb.ind_arch.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_arch_Reserve(int n) { + ind_arch_AbsReserve(_db.ind_arch_n + n); +} + +// --- abt.FDb.ind_arch.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_arch_AbsReserve(int n) { u32 old_nbuckets = _db.ind_arch_buckets_n; - u32 new_nelems = _db.ind_arch_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2949,7 +2973,7 @@ void abt::ind_arch_Reserve(int n) { while (elem) { abt::FArch &row = *elem; abt::FArch* next = row.ind_arch_next; - u32 index = algo::Smallstr50_Hash(0, row.arch) & (new_nbuckets-1); + u32 index = row.ind_arch_hashval & (new_nbuckets-1); row.ind_arch_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3498,14 +3522,9 @@ bool abt::syslib_XrefMaybe(abt::FSyslib &row) { // Find row by key. Return NULL if not found. abt::FSyslib* abt::ind_syslib_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_syslib_buckets_n - 1); - abt::FSyslib* *e = &_db.ind_syslib_buckets_elems[index]; - abt::FSyslib* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).syslib == key; - if (done) break; - e = &ret->ind_syslib_next; - } while (true); + abt::FSyslib *ret = _db.ind_syslib_buckets_elems[index]; + for (; ret && !((*ret).syslib == key); ret = ret->ind_syslib_next) { + } return ret; } @@ -3529,10 +3548,11 @@ abt::FSyslib& abt::ind_syslib_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_syslib.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_syslib_InsertMaybe(abt::FSyslib& row) { - ind_syslib_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_syslib_next == (abt::FSyslib*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.syslib) & (_db.ind_syslib_buckets_n - 1); + row.ind_syslib_hashval = algo::Smallstr50_Hash(0, row.syslib); + ind_syslib_Reserve(1); + u32 index = row.ind_syslib_hashval & (_db.ind_syslib_buckets_n - 1); abt::FSyslib* *prev = &_db.ind_syslib_buckets_elems[index]; do { abt::FSyslib* ret = *prev; @@ -3558,7 +3578,7 @@ bool abt::ind_syslib_InsertMaybe(abt::FSyslib& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_syslib_Remove(abt::FSyslib& row) { if (LIKELY(row.ind_syslib_next != (abt::FSyslib*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.syslib) & (_db.ind_syslib_buckets_n - 1); + u32 index = row.ind_syslib_hashval & (_db.ind_syslib_buckets_n - 1); abt::FSyslib* *prev = &_db.ind_syslib_buckets_elems[index]; // addr of pointer to current element while (abt::FSyslib *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3575,8 +3595,14 @@ void abt::ind_syslib_Remove(abt::FSyslib& row) { // --- abt.FDb.ind_syslib.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_syslib_Reserve(int n) { + ind_syslib_AbsReserve(_db.ind_syslib_n + n); +} + +// --- abt.FDb.ind_syslib.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_syslib_AbsReserve(int n) { u32 old_nbuckets = _db.ind_syslib_buckets_n; - u32 new_nelems = _db.ind_syslib_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3595,7 +3621,7 @@ void abt::ind_syslib_Reserve(int n) { while (elem) { abt::FSyslib &row = *elem; abt::FSyslib* next = row.ind_syslib_next; - u32 index = algo::Smallstr50_Hash(0, row.syslib) & (new_nbuckets-1); + u32 index = row.ind_syslib_hashval & (new_nbuckets-1); row.ind_syslib_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3727,14 +3753,9 @@ bool abt::include_XrefMaybe(abt::FInclude &row) { // Find row by key. Return NULL if not found. abt::FInclude* abt::ind_include_Find(const algo::strptr& key) { u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_include_buckets_n - 1); - abt::FInclude* *e = &_db.ind_include_buckets_elems[index]; - abt::FInclude* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).include == key; - if (done) break; - e = &ret->ind_include_next; - } while (true); + abt::FInclude *ret = _db.ind_include_buckets_elems[index]; + for (; ret && !((*ret).include == key); ret = ret->ind_include_next) { + } return ret; } @@ -3758,10 +3779,11 @@ abt::FInclude& abt::ind_include_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_include.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_include_InsertMaybe(abt::FInclude& row) { - ind_include_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_include_next == (abt::FInclude*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.include) & (_db.ind_include_buckets_n - 1); + row.ind_include_hashval = algo::Smallstr200_Hash(0, row.include); + ind_include_Reserve(1); + u32 index = row.ind_include_hashval & (_db.ind_include_buckets_n - 1); abt::FInclude* *prev = &_db.ind_include_buckets_elems[index]; do { abt::FInclude* ret = *prev; @@ -3787,7 +3809,7 @@ bool abt::ind_include_InsertMaybe(abt::FInclude& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_include_Remove(abt::FInclude& row) { if (LIKELY(row.ind_include_next != (abt::FInclude*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.include) & (_db.ind_include_buckets_n - 1); + u32 index = row.ind_include_hashval & (_db.ind_include_buckets_n - 1); abt::FInclude* *prev = &_db.ind_include_buckets_elems[index]; // addr of pointer to current element while (abt::FInclude *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3804,8 +3826,14 @@ void abt::ind_include_Remove(abt::FInclude& row) { // --- abt.FDb.ind_include.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_include_Reserve(int n) { + ind_include_AbsReserve(_db.ind_include_n + n); +} + +// --- abt.FDb.ind_include.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_include_AbsReserve(int n) { u32 old_nbuckets = _db.ind_include_buckets_n; - u32 new_nelems = _db.ind_include_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3824,7 +3852,7 @@ void abt::ind_include_Reserve(int n) { while (elem) { abt::FInclude &row = *elem; abt::FInclude* next = row.ind_include_next; - u32 index = algo::Smallstr200_Hash(0, row.include) & (new_nbuckets-1); + u32 index = row.ind_include_hashval & (new_nbuckets-1); row.ind_include_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3899,6 +3927,25 @@ algo::aryptr abt::sysincl_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- abt.FDb.sysincl.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr abt::sysincl_AllocNAt(int n_elems, int at) { + sysincl_Reserve(n_elems); + int n = _db.sysincl_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("abt.bad_alloc_n_at field:abt.FDb.sysincl comment:'index out of range'"); + } + algo::cstring *elems = _db.sysincl_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + _db.sysincl_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- abt.FDb.sysincl.Remove // Remove item by index. If index outside of range, do nothing. void abt::sysincl_Remove(u32 i) { @@ -3975,6 +4022,30 @@ bool abt::sysincl_ReadStrptrMaybe(algo::strptr in_str) { return retval; } +// --- abt.FDb.sysincl.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void abt::sysincl_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.sysincl_elems && rhs.elems < _db.sysincl_elems + _db.sysincl_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("abt.tary_alias field:abt.FDb.sysincl comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.sysincl_elems+1))) { + FatalErrorExit("abt.bad_insary field:abt.FDb.sysincl comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.sysincl_n - at; + sysincl_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.sysincl_elems + at + nnew + i) algo::cstring(_db.sysincl_elems[at + i]); + _db.sysincl_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.sysincl_elems + at + i) algo::cstring(rhs[i]); + } + _db.sysincl_n += nnew; +} + // --- abt.FDb.zs_origsel_target.Insert // Insert row into linked list. If row is already in linked list, do nothing. void abt::zs_origsel_target_Insert(abt::FTarget& row) { @@ -4151,14 +4222,9 @@ bool abt::ns_XrefMaybe(abt::FNs &row) { // Find row by key. Return NULL if not found. abt::FNs* abt::ind_ns_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_ns_buckets_n - 1); - abt::FNs* *e = &_db.ind_ns_buckets_elems[index]; - abt::FNs* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ns == key; - if (done) break; - e = &ret->ind_ns_next; - } while (true); + abt::FNs *ret = _db.ind_ns_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_ns_next) { + } return ret; } @@ -4182,10 +4248,11 @@ abt::FNs& abt::ind_ns_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_ns.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_ns_InsertMaybe(abt::FNs& row) { - ind_ns_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ns_next == (abt::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + row.ind_ns_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_ns_Reserve(1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); abt::FNs* *prev = &_db.ind_ns_buckets_elems[index]; do { abt::FNs* ret = *prev; @@ -4211,7 +4278,7 @@ bool abt::ind_ns_InsertMaybe(abt::FNs& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_ns_Remove(abt::FNs& row) { if (LIKELY(row.ind_ns_next != (abt::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); abt::FNs* *prev = &_db.ind_ns_buckets_elems[index]; // addr of pointer to current element while (abt::FNs *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4228,8 +4295,14 @@ void abt::ind_ns_Remove(abt::FNs& row) { // --- abt.FDb.ind_ns.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_ns_Reserve(int n) { + ind_ns_AbsReserve(_db.ind_ns_n + n); +} + +// --- abt.FDb.ind_ns.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_ns_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ns_buckets_n; - u32 new_nelems = _db.ind_ns_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4248,7 +4321,7 @@ void abt::ind_ns_Reserve(int n) { while (elem) { abt::FNs &row = *elem; abt::FNs* next = row.ind_ns_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_ns_hashval & (new_nbuckets-1); row.ind_ns_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4351,14 +4424,9 @@ bool abt::filestat_XrefMaybe(abt::FFilestat &row) { // Find row by key. Return NULL if not found. abt::FFilestat* abt::ind_filestat_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_filestat_buckets_n - 1); - abt::FFilestat* *e = &_db.ind_filestat_buckets_elems[index]; - abt::FFilestat* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).filename == key; - if (done) break; - e = &ret->ind_filestat_next; - } while (true); + abt::FFilestat *ret = _db.ind_filestat_buckets_elems[index]; + for (; ret && !((*ret).filename == key); ret = ret->ind_filestat_next) { + } return ret; } @@ -4382,10 +4450,11 @@ abt::FFilestat& abt::ind_filestat_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_filestat.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_filestat_InsertMaybe(abt::FFilestat& row) { - ind_filestat_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_filestat_next == (abt::FFilestat*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.filename) & (_db.ind_filestat_buckets_n - 1); + row.ind_filestat_hashval = algo::cstring_Hash(0, row.filename); + ind_filestat_Reserve(1); + u32 index = row.ind_filestat_hashval & (_db.ind_filestat_buckets_n - 1); abt::FFilestat* *prev = &_db.ind_filestat_buckets_elems[index]; do { abt::FFilestat* ret = *prev; @@ -4411,7 +4480,7 @@ bool abt::ind_filestat_InsertMaybe(abt::FFilestat& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_filestat_Remove(abt::FFilestat& row) { if (LIKELY(row.ind_filestat_next != (abt::FFilestat*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.filename) & (_db.ind_filestat_buckets_n - 1); + u32 index = row.ind_filestat_hashval & (_db.ind_filestat_buckets_n - 1); abt::FFilestat* *prev = &_db.ind_filestat_buckets_elems[index]; // addr of pointer to current element while (abt::FFilestat *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4428,8 +4497,14 @@ void abt::ind_filestat_Remove(abt::FFilestat& row) { // --- abt.FDb.ind_filestat.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_filestat_Reserve(int n) { + ind_filestat_AbsReserve(_db.ind_filestat_n + n); +} + +// --- abt.FDb.ind_filestat.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_filestat_AbsReserve(int n) { u32 old_nbuckets = _db.ind_filestat_buckets_n; - u32 new_nelems = _db.ind_filestat_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4448,7 +4523,7 @@ void abt::ind_filestat_Reserve(int n) { while (elem) { abt::FFilestat &row = *elem; abt::FFilestat* next = row.ind_filestat_next; - u32 index = algo::cstring_Hash(0, row.filename) & (new_nbuckets-1); + u32 index = row.ind_filestat_hashval & (new_nbuckets-1); row.ind_filestat_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4581,14 +4656,9 @@ bool abt::builddir_XrefMaybe(abt::FBuilddir &row) { // Find row by key. Return NULL if not found. abt::FBuilddir* abt::ind_builddir_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_builddir_buckets_n - 1); - abt::FBuilddir* *e = &_db.ind_builddir_buckets_elems[index]; - abt::FBuilddir* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).builddir == key; - if (done) break; - e = &ret->ind_builddir_next; - } while (true); + abt::FBuilddir *ret = _db.ind_builddir_buckets_elems[index]; + for (; ret && !((*ret).builddir == key); ret = ret->ind_builddir_next) { + } return ret; } @@ -4612,10 +4682,11 @@ abt::FBuilddir& abt::ind_builddir_GetOrCreate(const algo::strptr& key) { // --- abt.FDb.ind_builddir.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt::ind_builddir_InsertMaybe(abt::FBuilddir& row) { - ind_builddir_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_builddir_next == (abt::FBuilddir*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.builddir) & (_db.ind_builddir_buckets_n - 1); + row.ind_builddir_hashval = algo::Smallstr50_Hash(0, row.builddir); + ind_builddir_Reserve(1); + u32 index = row.ind_builddir_hashval & (_db.ind_builddir_buckets_n - 1); abt::FBuilddir* *prev = &_db.ind_builddir_buckets_elems[index]; do { abt::FBuilddir* ret = *prev; @@ -4641,7 +4712,7 @@ bool abt::ind_builddir_InsertMaybe(abt::FBuilddir& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt::ind_builddir_Remove(abt::FBuilddir& row) { if (LIKELY(row.ind_builddir_next != (abt::FBuilddir*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.builddir) & (_db.ind_builddir_buckets_n - 1); + u32 index = row.ind_builddir_hashval & (_db.ind_builddir_buckets_n - 1); abt::FBuilddir* *prev = &_db.ind_builddir_buckets_elems[index]; // addr of pointer to current element while (abt::FBuilddir *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4658,8 +4729,14 @@ void abt::ind_builddir_Remove(abt::FBuilddir& row) { // --- abt.FDb.ind_builddir.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt::ind_builddir_Reserve(int n) { + ind_builddir_AbsReserve(_db.ind_builddir_n + n); +} + +// --- abt.FDb.ind_builddir.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt::ind_builddir_AbsReserve(int n) { u32 old_nbuckets = _db.ind_builddir_buckets_n; - u32 new_nelems = _db.ind_builddir_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4678,7 +4755,7 @@ void abt::ind_builddir_Reserve(int n) { while (elem) { abt::FBuilddir &row = *elem; abt::FBuilddir* next = row.ind_builddir_next; - u32 index = algo::Smallstr50_Hash(0, row.builddir) & (new_nbuckets-1); + u32 index = row.ind_builddir_hashval & (new_nbuckets-1); row.ind_builddir_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -5386,12 +5463,12 @@ algo::Smallstr10 abt::ext_Get(abt::FSrcfile& srcfile) { // --- abt.FSrcfile.zd_include.Insert // Insert row into linked list. If row is already in linked list, do nothing. void abt::zd_include_Insert(abt::FSrcfile& srcfile, abt::FInclude& row) { - if (!zd_include_InLlistQ(row)) { + if (!srcfile_zd_include_InLlistQ(row)) { abt::FInclude* old_tail = srcfile.zd_include_tail; - row.zd_include_next = NULL; - row.zd_include_prev = old_tail; + row.srcfile_zd_include_next = NULL; + row.srcfile_zd_include_prev = old_tail; srcfile.zd_include_tail = &row; - abt::FInclude **new_row_a = &old_tail->zd_include_next; + abt::FInclude **new_row_a = &old_tail->srcfile_zd_include_next; abt::FInclude **new_row_b = &srcfile.zd_include_head; abt::FInclude **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -5402,23 +5479,23 @@ void abt::zd_include_Insert(abt::FSrcfile& srcfile, abt::FInclude& row) { // --- abt.FSrcfile.zd_include.Remove // Remove element from index. If element is not in index, do nothing. void abt::zd_include_Remove(abt::FSrcfile& srcfile, abt::FInclude& row) { - if (zd_include_InLlistQ(row)) { + if (srcfile_zd_include_InLlistQ(row)) { abt::FInclude* old_head = srcfile.zd_include_head; (void)old_head; // in case it's not used - abt::FInclude* prev = row.zd_include_prev; - abt::FInclude* next = row.zd_include_next; + abt::FInclude* prev = row.srcfile_zd_include_prev; + abt::FInclude* next = row.srcfile_zd_include_next; // if element is first, adjust list head; otherwise, adjust previous element's next - abt::FInclude **new_next_a = &prev->zd_include_next; + abt::FInclude **new_next_a = &prev->srcfile_zd_include_next; abt::FInclude **new_next_b = &srcfile.zd_include_head; abt::FInclude **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - abt::FInclude **new_prev_a = &next->zd_include_prev; + abt::FInclude **new_prev_a = &next->srcfile_zd_include_prev; abt::FInclude **new_prev_b = &srcfile.zd_include_tail; abt::FInclude **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; srcfile.zd_include_n--; - row.zd_include_next=(abt::FInclude*)-1; // not-in-list + row.srcfile_zd_include_next=(abt::FInclude*)-1; // not-in-list } } @@ -5430,9 +5507,9 @@ void abt::zd_include_RemoveAll(abt::FSrcfile& srcfile) { srcfile.zd_include_tail = NULL; srcfile.zd_include_n = 0; while (row) { - abt::FInclude* row_next = row->zd_include_next; - row->zd_include_next = (abt::FInclude*)-1; - row->zd_include_prev = NULL; + abt::FInclude* row_next = row->srcfile_zd_include_next; + row->srcfile_zd_include_next = (abt::FInclude*)-1; + row->srcfile_zd_include_prev = NULL; row = row_next; } } @@ -5443,14 +5520,14 @@ abt::FInclude* abt::zd_include_RemoveFirst(abt::FSrcfile& srcfile) { abt::FInclude *row = NULL; row = srcfile.zd_include_head; if (row) { - abt::FInclude *next = row->zd_include_next; + abt::FInclude *next = row->srcfile_zd_include_next; srcfile.zd_include_head = next; - abt::FInclude **new_end_a = &next->zd_include_prev; + abt::FInclude **new_end_a = &next->srcfile_zd_include_prev; abt::FInclude **new_end_b = &srcfile.zd_include_tail; abt::FInclude **new_end = next ? new_end_a : new_end_b; *new_end = NULL; srcfile.zd_include_n--; - row->zd_include_next = (abt::FInclude*)-1; // mark as not-in-list + row->srcfile_zd_include_next = (abt::FInclude*)-1; // mark as not-in-list } return row; } @@ -5468,6 +5545,7 @@ void abt::FSrcfile_Init(abt::FSrcfile& srcfile) { srcfile.zd_include_tail = NULL; // (abt.FSrcfile.zd_include) srcfile.printed = bool(false); srcfile.ind_srcfile_next = (abt::FSrcfile*)-1; // (abt.FDb.ind_srcfile) not-in-hash + srcfile.ind_srcfile_hashval = 0; // stored hash value srcfile.zs_srcfile_read_next = (abt::FSrcfile*)-1; // (abt.FDb.zs_srcfile_read) not-in-list srcfile.zd_inclstack_next = (abt::FSrcfile*)-1; // (abt.FDb.zd_inclstack) not-in-list srcfile.zd_inclstack_prev = NULL; // (abt.FDb.zd_inclstack) @@ -5511,15 +5589,11 @@ void abt::syscmd_CopyIn(abt::FSyscmd &row, dev::Syscmd &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt::c_prior_Insert(abt::FSyscmd& syscmd, abt::FSyscmddep& row) { - if (bool_Update(row.syscmd_c_prior_in_ary,true)) { - // reserve space + if (!row.syscmd_c_prior_in_ary) { c_prior_Reserve(syscmd, 1); - u32 n = syscmd.c_prior_n; - u32 at = n; - abt::FSyscmddep* *elems = syscmd.c_prior_elems; - elems[at] = &row; - syscmd.c_prior_n = n+1; - + u32 n = syscmd.c_prior_n++; + syscmd.c_prior_elems[n] = &row; + row.syscmd_c_prior_in_ary = true; } } @@ -5528,7 +5602,7 @@ void abt::c_prior_Insert(abt::FSyscmd& syscmd, abt::FSyscmddep& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool abt::c_prior_InsertMaybe(abt::FSyscmd& syscmd, abt::FSyscmddep& row) { - bool retval = !row.syscmd_c_prior_in_ary; + bool retval = !syscmd_c_prior_InAryQ(row); c_prior_Insert(syscmd,row); // check is performed in _Insert again return retval; } @@ -5536,18 +5610,18 @@ bool abt::c_prior_InsertMaybe(abt::FSyscmd& syscmd, abt::FSyscmddep& row) { // --- abt.FSyscmd.c_prior.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt::c_prior_Remove(abt::FSyscmd& syscmd, abt::FSyscmddep& row) { + int n = syscmd.c_prior_n; if (bool_Update(row.syscmd_c_prior_in_ary,false)) { - int lim = syscmd.c_prior_n; abt::FSyscmddep* *elems = syscmd.c_prior_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { abt::FSyscmddep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt::FSyscmddep*) * (lim - j); + size_t nbytes = sizeof(abt::FSyscmddep*) * (n - j); memmove(elems + i, elems + j, nbytes); - syscmd.c_prior_n = lim - 1; + syscmd.c_prior_n = n - 1; break; } } @@ -5575,15 +5649,11 @@ void abt::c_prior_Reserve(abt::FSyscmd& syscmd, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt::c_next_Insert(abt::FSyscmd& syscmd, abt::FSyscmddep& row) { - if (bool_Update(row.syscmd_c_next_in_ary,true)) { - // reserve space + if (!row.syscmd_c_next_in_ary) { c_next_Reserve(syscmd, 1); - u32 n = syscmd.c_next_n; - u32 at = n; - abt::FSyscmddep* *elems = syscmd.c_next_elems; - elems[at] = &row; - syscmd.c_next_n = n+1; - + u32 n = syscmd.c_next_n++; + syscmd.c_next_elems[n] = &row; + row.syscmd_c_next_in_ary = true; } } @@ -5592,7 +5662,7 @@ void abt::c_next_Insert(abt::FSyscmd& syscmd, abt::FSyscmddep& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool abt::c_next_InsertMaybe(abt::FSyscmd& syscmd, abt::FSyscmddep& row) { - bool retval = !row.syscmd_c_next_in_ary; + bool retval = !syscmd_c_next_InAryQ(row); c_next_Insert(syscmd,row); // check is performed in _Insert again return retval; } @@ -5600,18 +5670,18 @@ bool abt::c_next_InsertMaybe(abt::FSyscmd& syscmd, abt::FSyscmddep& row) { // --- abt.FSyscmd.c_next.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt::c_next_Remove(abt::FSyscmd& syscmd, abt::FSyscmddep& row) { + int n = syscmd.c_next_n; if (bool_Update(row.syscmd_c_next_in_ary,false)) { - int lim = syscmd.c_next_n; abt::FSyscmddep* *elems = syscmd.c_next_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { abt::FSyscmddep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt::FSyscmddep*) * (lim - j); + size_t nbytes = sizeof(abt::FSyscmddep*) * (n - j); memmove(elems + i, elems + j, nbytes); - syscmd.c_next_n = lim - 1; + syscmd.c_next_n = n - 1; break; } } @@ -5655,7 +5725,9 @@ void abt::FSyscmd_Init(abt::FSyscmd& syscmd) { syscmd.line_n = u64(0); syscmd.redirect = bool(true); syscmd.ind_syscmd_next = (abt::FSyscmd*)-1; // (abt.FDb.ind_syscmd) not-in-hash + syscmd.ind_syscmd_hashval = 0; // stored hash value syscmd.ind_running_next = (abt::FSyscmd*)-1; // (abt.FDb.ind_running) not-in-hash + syscmd.ind_running_hashval = 0; // stored hash value syscmd.bh_syscmd_idx = -1; // (abt.FDb.bh_syscmd) not-in-heap } @@ -5771,15 +5843,11 @@ void abt::target_CopyIn(abt::FTarget &row, dev::Target &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt::c_targsrc_Insert(abt::FTarget& target, abt::FTargsrc& row) { - if (bool_Update(row.target_c_targsrc_in_ary,true)) { - // reserve space + if (!row.target_c_targsrc_in_ary) { c_targsrc_Reserve(target, 1); - u32 n = target.c_targsrc_n; - u32 at = n; - abt::FTargsrc* *elems = target.c_targsrc_elems; - elems[at] = &row; - target.c_targsrc_n = n+1; - + u32 n = target.c_targsrc_n++; + target.c_targsrc_elems[n] = &row; + row.target_c_targsrc_in_ary = true; } } @@ -5788,7 +5856,7 @@ void abt::c_targsrc_Insert(abt::FTarget& target, abt::FTargsrc& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool abt::c_targsrc_InsertMaybe(abt::FTarget& target, abt::FTargsrc& row) { - bool retval = !row.target_c_targsrc_in_ary; + bool retval = !target_c_targsrc_InAryQ(row); c_targsrc_Insert(target,row); // check is performed in _Insert again return retval; } @@ -5796,18 +5864,18 @@ bool abt::c_targsrc_InsertMaybe(abt::FTarget& target, abt::FTargsrc& row) { // --- abt.FTarget.c_targsrc.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt::c_targsrc_Remove(abt::FTarget& target, abt::FTargsrc& row) { + int n = target.c_targsrc_n; if (bool_Update(row.target_c_targsrc_in_ary,false)) { - int lim = target.c_targsrc_n; abt::FTargsrc* *elems = target.c_targsrc_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { abt::FTargsrc* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt::FTargsrc*) * (lim - j); + size_t nbytes = sizeof(abt::FTargsrc*) * (n - j); memmove(elems + i, elems + j, nbytes); - target.c_targsrc_n = lim - 1; + target.c_targsrc_n = n - 1; break; } } @@ -5835,14 +5903,9 @@ void abt::c_targsrc_Reserve(abt::FTarget& target, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt::c_srcfile_Insert(abt::FTarget& target, abt::FSrcfile& row) { - // reserve space c_srcfile_Reserve(target, 1); - u32 n = target.c_srcfile_n; - u32 at = n; - abt::FSrcfile* *elems = target.c_srcfile_elems; - elems[at] = &row; - target.c_srcfile_n = n+1; - + u32 n = target.c_srcfile_n++; + target.c_srcfile_elems[n] = &row; } // --- abt.FTarget.c_srcfile.ScanInsertMaybe @@ -5871,20 +5934,18 @@ bool abt::c_srcfile_ScanInsertMaybe(abt::FTarget& target, abt::FSrcfile& row) { // --- abt.FTarget.c_srcfile.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt::c_srcfile_Remove(abt::FTarget& target, abt::FSrcfile& row) { - int lim = target.c_srcfile_n; - abt::FSrcfile* *elems = target.c_srcfile_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - abt::FSrcfile* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(abt::FSrcfile*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - target.c_srcfile_n = lim - 1; - break; + int n = target.c_srcfile_n; + int j=0; + for (int i=0; i=0; i--) { + for (int i = n-1; i>=0; i--) { abt::FTargdep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt::FTargdep*) * (lim - j); + size_t nbytes = sizeof(abt::FTargdep*) * (n - j); memmove(elems + i, elems + j, nbytes); - target.c_targdep_n = lim - 1; + target.c_targdep_n = n - 1; break; } } @@ -5972,15 +6029,11 @@ void abt::c_targdep_Reserve(abt::FTarget& target, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt::c_targsyslib_Insert(abt::FTarget& target, abt::FTargsyslib& row) { - if (bool_Update(row.target_c_targsyslib_in_ary,true)) { - // reserve space + if (!row.target_c_targsyslib_in_ary) { c_targsyslib_Reserve(target, 1); - u32 n = target.c_targsyslib_n; - u32 at = n; - abt::FTargsyslib* *elems = target.c_targsyslib_elems; - elems[at] = &row; - target.c_targsyslib_n = n+1; - + u32 n = target.c_targsyslib_n++; + target.c_targsyslib_elems[n] = &row; + row.target_c_targsyslib_in_ary = true; } } @@ -5989,7 +6042,7 @@ void abt::c_targsyslib_Insert(abt::FTarget& target, abt::FTargsyslib& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool abt::c_targsyslib_InsertMaybe(abt::FTarget& target, abt::FTargsyslib& row) { - bool retval = !row.target_c_targsyslib_in_ary; + bool retval = !target_c_targsyslib_InAryQ(row); c_targsyslib_Insert(target,row); // check is performed in _Insert again return retval; } @@ -5997,18 +6050,18 @@ bool abt::c_targsyslib_InsertMaybe(abt::FTarget& target, abt::FTargsyslib& row) // --- abt.FTarget.c_targsyslib.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt::c_targsyslib_Remove(abt::FTarget& target, abt::FTargsyslib& row) { + int n = target.c_targsyslib_n; if (bool_Update(row.target_c_targsyslib_in_ary,false)) { - int lim = target.c_targsyslib_n; abt::FTargsyslib* *elems = target.c_targsyslib_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { abt::FTargsyslib* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt::FTargsyslib*) * (lim - j); + size_t nbytes = sizeof(abt::FTargsyslib*) * (n - j); memmove(elems + i, elems + j, nbytes); - target.c_targsyslib_n = lim - 1; + target.c_targsyslib_n = n - 1; break; } } @@ -6036,14 +6089,9 @@ void abt::c_targsyslib_Reserve(abt::FTarget& target, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt::c_alldep_Insert(abt::FTarget& target, abt::FTarget& row) { - // reserve space c_alldep_Reserve(target, 1); - u32 n = target.c_alldep_n; - u32 at = n; - abt::FTarget* *elems = target.c_alldep_elems; - elems[at] = &row; - target.c_alldep_n = n+1; - + u32 n = target.c_alldep_n++; + target.c_alldep_elems[n] = &row; } // --- abt.FTarget.c_alldep.ScanInsertMaybe @@ -6072,20 +6120,18 @@ bool abt::c_alldep_ScanInsertMaybe(abt::FTarget& target, abt::FTarget& row) { // --- abt.FTarget.c_alldep.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt::c_alldep_Remove(abt::FTarget& target, abt::FTarget& row) { - int lim = target.c_alldep_n; - abt::FTarget* *elems = target.c_alldep_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - abt::FTarget* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(abt::FTarget*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - target.c_alldep_n = lim - 1; - break; + int n = target.c_alldep_n; + int j=0; + for (int i=0; i] [[-section:]] [options]\n" -" OPTION TYPE DFLT COMMENT\n" -" -in string \"data\" Input directory or filename, - for stdin\n" -" [readme] regx \"%\" Regx of readme to process/show (empty=all)\n" -" -ns regx \"\" (overrides -readme) Process readmes for this namespace\n" -" [section] regx \"%\" Select specific section to process\n" -" -update Y (action) Update mode: Re-generate mdfiles\n" -" -check (action) Check mode: Check syntax and links\n" -" -link (with -print) Print links\n" -" -anchor (with -print) Print anchors\n" -" -print (action) Query mode: Print .md section without evaluating\n" -" -dry_run Do not write changes to disk\n" -" -external Check external links as well (may fail if no internet connection)\n" -" -evalcmd Y Execute inline-commands\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" -" -help Print help and exit; alias -h\n" -" -version Print version and exit\n" -" -signature Show signatures and exit; alias -sig\n" +"Usage: abt_md [[-readmefile:]] [[-section:]] [options]\n" +" OPTION TYPE DFLT COMMENT\n" +" -in string \"data\" Input directory or filename, - for stdin\n" +" [readmefile] regx \"%\" Regx of readme to process/show (empty=all)\n" +" -ns regx \"\" (overrides -readme) Process readmes for this namespace\n" +" [section] regx \"%\" Select specific section to process\n" +" -update Y (action) Update mode: Re-generate mdfiles\n" +" -check (action) Check mode: Check syntax and links\n" +" -link (with -print) Print links\n" +" -anchor (with -print) Print anchors\n" +" -print (action) Query mode: Print .md section without evaluating\n" +" -dry_run Do not write changes to disk\n" +" -external Check external links as well (may fail if no internet connection)\n" +" -evalcmd Y Execute inline-commands\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" +" -help Print help and exit; alias -h\n" +" -version Print version and exit\n" +" -signature Show signatures and exit; alias -sig\n" ; @@ -93,8 +93,8 @@ namespace abt_md { // gen:ns_print_proto // Load statically available data into tables, register tables and database. // func:abt_md.FDb._db.InitReflection static void InitReflection(); - // func:abt_md.FDb.readme.InputMaybe - static bool readme_InputMaybe(dev::Readme &elem) __attribute__((nothrow)); + // func:abt_md.FDb.readmefile.InputMaybe + static bool readmefile_InputMaybe(dev::Readmefile &elem) __attribute__((nothrow)); // func:abt_md.FDb.mdsection.LoadStatic static void mdsection_LoadStatic() __attribute__((nothrow)); // Find new location for ROW starting at IDX @@ -143,6 +143,12 @@ namespace abt_md { // gen:ns_print_proto static bool target_InputMaybe(dev::Target &elem) __attribute__((nothrow)); // func:abt_md.FDb.targdep.InputMaybe static bool targdep_InputMaybe(dev::Targdep &elem) __attribute__((nothrow)); + // func:abt_md.FDb.finput.InputMaybe + static bool finput_InputMaybe(dmmeta::Finput &elem) __attribute__((nothrow)); + // func:abt_md.FDb.dispatch.InputMaybe + static bool dispatch_InputMaybe(dmmeta::Dispatch &elem) __attribute__((nothrow)); + // func:abt_md.FDb.dispatch_msg.InputMaybe + static bool dispatch_msg_InputMaybe(dmmeta::DispatchMsg &elem) __attribute__((nothrow)); // find trace by row id (used to implement reflection) // func:abt_md.FDb.trace.RowidFind static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); @@ -180,7 +186,10 @@ void abt_md::comptest_CopyOut(abt_md::FComptest &row, atfdb::Comptest &out) { out.comptest = row.comptest; out.timeout = row.timeout; out.memcheck = row.memcheck; + out.coverage = row.coverage; out.exit_code = row.exit_code; + out.ncore = row.ncore; + out.repeat = row.repeat; out.comment = row.comment; } @@ -190,7 +199,10 @@ void abt_md::comptest_CopyIn(abt_md::FComptest &row, atfdb::Comptest &in) { row.comptest = in.comptest; row.timeout = in.timeout; row.memcheck = in.memcheck; + row.coverage = in.coverage; row.exit_code = in.exit_code; + row.ncore = in.ncore; + row.repeat = in.repeat; row.comment = in.comment; } @@ -206,6 +218,18 @@ algo::Smallstr50 abt_md::testname_Get(abt_md::FComptest& comptest) { return ret; } +// --- abt_md.FComptest..Init +// Set all fields to initial values. +void abt_md::FComptest_Init(abt_md::FComptest& comptest) { + comptest.timeout = i32(10); + comptest.memcheck = bool(true); + comptest.coverage = bool(true); + comptest.exit_code = u8(0); + comptest.ncore = i32(1); + comptest.repeat = i32(1); + comptest.ns_c_comptest_in_ary = bool(false); +} + // --- abt_md.FComptest..Uninit void abt_md::FComptest_Uninit(abt_md::FComptest& comptest) { abt_md::FComptest &row = comptest; (void)row; @@ -245,15 +269,11 @@ algo::Smallstr100 abt_md::name_Get(abt_md::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt_md::c_field_Insert(abt_md::FCtype& ctype, abt_md::FField& row) { - if (bool_Update(row.ctype_c_field_in_ary,true)) { - // reserve space + if (!row.ctype_c_field_in_ary) { c_field_Reserve(ctype, 1); - u32 n = ctype.c_field_n; - u32 at = n; - abt_md::FField* *elems = ctype.c_field_elems; - elems[at] = &row; - ctype.c_field_n = n+1; - + u32 n = ctype.c_field_n++; + ctype.c_field_elems[n] = &row; + row.ctype_c_field_in_ary = true; } } @@ -262,7 +282,7 @@ void abt_md::c_field_Insert(abt_md::FCtype& ctype, abt_md::FField& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool abt_md::c_field_InsertMaybe(abt_md::FCtype& ctype, abt_md::FField& row) { - bool retval = !row.ctype_c_field_in_ary; + bool retval = !ctype_c_field_InAryQ(row); c_field_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -270,18 +290,18 @@ bool abt_md::c_field_InsertMaybe(abt_md::FCtype& ctype, abt_md::FField& row) { // --- abt_md.FCtype.c_field.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt_md::c_field_Remove(abt_md::FCtype& ctype, abt_md::FField& row) { + int n = ctype.c_field_n; if (bool_Update(row.ctype_c_field_in_ary,false)) { - int lim = ctype.c_field_n; abt_md::FField* *elems = ctype.c_field_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { abt_md::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt_md::FField*) * (lim - j); + size_t nbytes = sizeof(abt_md::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_field_n = lim - 1; + ctype.c_field_n = n - 1; break; } } @@ -309,15 +329,11 @@ void abt_md::c_field_Reserve(abt_md::FCtype& ctype, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt_md::c_field_arg_Insert(abt_md::FCtype& ctype, abt_md::FField& row) { - if (bool_Update(row.ctype_c_field_arg_in_ary,true)) { - // reserve space + if (!row.ctype_c_field_arg_in_ary) { c_field_arg_Reserve(ctype, 1); - u32 n = ctype.c_field_arg_n; - u32 at = n; - abt_md::FField* *elems = ctype.c_field_arg_elems; - elems[at] = &row; - ctype.c_field_arg_n = n+1; - + u32 n = ctype.c_field_arg_n++; + ctype.c_field_arg_elems[n] = &row; + row.ctype_c_field_arg_in_ary = true; } } @@ -326,7 +342,7 @@ void abt_md::c_field_arg_Insert(abt_md::FCtype& ctype, abt_md::FField& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool abt_md::c_field_arg_InsertMaybe(abt_md::FCtype& ctype, abt_md::FField& row) { - bool retval = !row.ctype_c_field_arg_in_ary; + bool retval = !ctype_c_field_arg_InAryQ(row); c_field_arg_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -334,18 +350,18 @@ bool abt_md::c_field_arg_InsertMaybe(abt_md::FCtype& ctype, abt_md::FField& row) // --- abt_md.FCtype.c_field_arg.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt_md::c_field_arg_Remove(abt_md::FCtype& ctype, abt_md::FField& row) { + int n = ctype.c_field_arg_n; if (bool_Update(row.ctype_c_field_arg_in_ary,false)) { - int lim = ctype.c_field_arg_n; abt_md::FField* *elems = ctype.c_field_arg_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { abt_md::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt_md::FField*) * (lim - j); + size_t nbytes = sizeof(abt_md::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_field_arg_n = lim - 1; + ctype.c_field_arg_n = n - 1; break; } } @@ -420,12 +436,12 @@ void abt_md::regx_path_Print(abt_md::FMdsection& mdsection, algo::cstring &out) // --- abt_md.FMdsection.zd_file_section.Insert // Insert row into linked list. If row is already in linked list, do nothing. void abt_md::zd_file_section_Insert(abt_md::FMdsection& mdsection, abt_md::FFileSection& row) { - if (!zd_file_section_InLlistQ(row)) { + if (!mdsection_zd_file_section_InLlistQ(row)) { abt_md::FFileSection* old_tail = mdsection.zd_file_section_tail; - row.zd_file_section_next = NULL; - row.zd_file_section_prev = old_tail; + row.mdsection_zd_file_section_next = NULL; + row.mdsection_zd_file_section_prev = old_tail; mdsection.zd_file_section_tail = &row; - abt_md::FFileSection **new_row_a = &old_tail->zd_file_section_next; + abt_md::FFileSection **new_row_a = &old_tail->mdsection_zd_file_section_next; abt_md::FFileSection **new_row_b = &mdsection.zd_file_section_head; abt_md::FFileSection **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -436,23 +452,23 @@ void abt_md::zd_file_section_Insert(abt_md::FMdsection& mdsection, abt_md::FFile // --- abt_md.FMdsection.zd_file_section.Remove // Remove element from index. If element is not in index, do nothing. void abt_md::zd_file_section_Remove(abt_md::FMdsection& mdsection, abt_md::FFileSection& row) { - if (zd_file_section_InLlistQ(row)) { + if (mdsection_zd_file_section_InLlistQ(row)) { abt_md::FFileSection* old_head = mdsection.zd_file_section_head; (void)old_head; // in case it's not used - abt_md::FFileSection* prev = row.zd_file_section_prev; - abt_md::FFileSection* next = row.zd_file_section_next; + abt_md::FFileSection* prev = row.mdsection_zd_file_section_prev; + abt_md::FFileSection* next = row.mdsection_zd_file_section_next; // if element is first, adjust list head; otherwise, adjust previous element's next - abt_md::FFileSection **new_next_a = &prev->zd_file_section_next; + abt_md::FFileSection **new_next_a = &prev->mdsection_zd_file_section_next; abt_md::FFileSection **new_next_b = &mdsection.zd_file_section_head; abt_md::FFileSection **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - abt_md::FFileSection **new_prev_a = &next->zd_file_section_prev; + abt_md::FFileSection **new_prev_a = &next->mdsection_zd_file_section_prev; abt_md::FFileSection **new_prev_b = &mdsection.zd_file_section_tail; abt_md::FFileSection **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; mdsection.zd_file_section_n--; - row.zd_file_section_next=(abt_md::FFileSection*)-1; // not-in-list + row.mdsection_zd_file_section_next=(abt_md::FFileSection*)-1; // not-in-list } } @@ -464,9 +480,9 @@ void abt_md::zd_file_section_RemoveAll(abt_md::FMdsection& mdsection) { mdsection.zd_file_section_tail = NULL; mdsection.zd_file_section_n = 0; while (row) { - abt_md::FFileSection* row_next = row->zd_file_section_next; - row->zd_file_section_next = (abt_md::FFileSection*)-1; - row->zd_file_section_prev = NULL; + abt_md::FFileSection* row_next = row->mdsection_zd_file_section_next; + row->mdsection_zd_file_section_next = (abt_md::FFileSection*)-1; + row->mdsection_zd_file_section_prev = NULL; row = row_next; } } @@ -477,14 +493,14 @@ abt_md::FFileSection* abt_md::zd_file_section_RemoveFirst(abt_md::FMdsection& md abt_md::FFileSection *row = NULL; row = mdsection.zd_file_section_head; if (row) { - abt_md::FFileSection *next = row->zd_file_section_next; + abt_md::FFileSection *next = row->mdsection_zd_file_section_next; mdsection.zd_file_section_head = next; - abt_md::FFileSection **new_end_a = &next->zd_file_section_prev; + abt_md::FFileSection **new_end_a = &next->mdsection_zd_file_section_prev; abt_md::FFileSection **new_end_b = &mdsection.zd_file_section_tail; abt_md::FFileSection **new_end = next ? new_end_a : new_end_b; *new_end = NULL; mdsection.zd_file_section_n--; - row->zd_file_section_next = (abt_md::FFileSection*)-1; // mark as not-in-list + row->mdsection_zd_file_section_next = (abt_md::FFileSection*)-1; // mark as not-in-list } return row; } @@ -594,9 +610,8 @@ void abt_md::ReadArgv() { } if (ch_N(attrname) == 0) { err << "abt_md: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:abt_md.FDb.cmdline @@ -650,7 +668,7 @@ void abt_md::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -695,7 +713,7 @@ static void abt_md::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'abt_md.Input' signature:'f2418f59a8d671bde387788c12ed2748090ae825'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'abt_md.Input' signature:'1d64073c67d090b1a9ec75e09f0de10c7c1bc7d2'"); } // --- abt_md.FDb._db.InsertStrptrMaybe @@ -706,10 +724,10 @@ bool abt_md::InsertStrptrMaybe(algo::strptr str) { abt_md::TableId table_id(-1); value_SetStrptrMaybe(table_id, algo::GetTypeTag(str)); switch (value_GetEnum(table_id)) { - case abt_md_TableId_dev_Readme: { // finput:abt_md.FDb.readme - dev::Readme elem; - retval = dev::Readme_ReadStrptrMaybe(elem, str); - retval = retval && readme_InputMaybe(elem); + case abt_md_TableId_dev_Readmefile: { // finput:abt_md.FDb.readmefile + dev::Readmefile elem; + retval = dev::Readmefile_ReadStrptrMaybe(elem, str); + retval = retval && readmefile_InputMaybe(elem); break; } case abt_md_TableId_dmmeta_Ns: { // finput:abt_md.FDb.ns @@ -814,6 +832,24 @@ bool abt_md::InsertStrptrMaybe(algo::strptr str) { retval = retval && targdep_InputMaybe(elem); break; } + case abt_md_TableId_dmmeta_Finput: { // finput:abt_md.FDb.finput + dmmeta::Finput elem; + retval = dmmeta::Finput_ReadStrptrMaybe(elem, str); + retval = retval && finput_InputMaybe(elem); + break; + } + case abt_md_TableId_dmmeta_Dispatch: { // finput:abt_md.FDb.dispatch + dmmeta::Dispatch elem; + retval = dmmeta::Dispatch_ReadStrptrMaybe(elem, str); + retval = retval && dispatch_InputMaybe(elem); + break; + } + case abt_md_TableId_dmmeta_DispatchMsg: { // finput:abt_md.FDb.dispatch_msg + dmmeta::DispatchMsg elem; + retval = dmmeta::DispatchMsg_ReadStrptrMaybe(elem, str); + retval = retval && dispatch_msg_InputMaybe(elem); + break; + } default: break; } //switch @@ -842,18 +878,21 @@ bool abt_md::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dmmeta.ssimfile"),recursive); retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dmmeta.gstatic"),recursive); retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dmmeta.gconst"),recursive); + retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dmmeta.finput"),recursive); retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dmmeta.fconst"),recursive); + retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispatch"),recursive); retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); + retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispatch_msg"),recursive); retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dev.target"),recursive); retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dev.targsrc"),recursive); retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dev.targdep"),recursive); retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dev.scriptfile"),recursive); retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dev.readmesort"),recursive); - retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dev.readme"),recursive); + retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"dev.readmefile"),recursive); retval = retval && abt_md::LoadTuplesFile(algo::SsimFname(root,"atfdb.comptest"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -921,163 +960,159 @@ bool abt_md::_db_XrefMaybe() { return retval; } -// --- abt_md.FDb.readme.Alloc +// --- abt_md.FDb.readmefile.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -abt_md::FReadme& abt_md::readme_Alloc() { - abt_md::FReadme* row = readme_AllocMaybe(); +abt_md::FReadmefile& abt_md::readmefile_Alloc() { + abt_md::FReadmefile* row = readmefile_AllocMaybe(); if (UNLIKELY(row == NULL)) { - FatalErrorExit("abt_md.out_of_mem field:abt_md.FDb.readme comment:'Alloc failed'"); + FatalErrorExit("abt_md.out_of_mem field:abt_md.FDb.readmefile comment:'Alloc failed'"); } return *row; } -// --- abt_md.FDb.readme.AllocMaybe +// --- abt_md.FDb.readmefile.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -abt_md::FReadme* abt_md::readme_AllocMaybe() { - abt_md::FReadme *row = (abt_md::FReadme*)readme_AllocMem(); +abt_md::FReadmefile* abt_md::readmefile_AllocMaybe() { + abt_md::FReadmefile *row = (abt_md::FReadmefile*)readmefile_AllocMem(); if (row) { - new (row) abt_md::FReadme; // call constructor + new (row) abt_md::FReadmefile; // call constructor } return row; } -// --- abt_md.FDb.readme.InsertMaybe +// --- abt_md.FDb.readmefile.InsertMaybe // Create new row from struct. // Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -abt_md::FReadme* abt_md::readme_InsertMaybe(const dev::Readme &value) { - abt_md::FReadme *row = &readme_Alloc(); // if out of memory, process dies. if input error, return NULL. - readme_CopyIn(*row,const_cast(value)); - bool ok = readme_XrefMaybe(*row); // this may return false +abt_md::FReadmefile* abt_md::readmefile_InsertMaybe(const dev::Readmefile &value) { + abt_md::FReadmefile *row = &readmefile_Alloc(); // if out of memory, process dies. if input error, return NULL. + readmefile_CopyIn(*row,const_cast(value)); + bool ok = readmefile_XrefMaybe(*row); // this may return false if (!ok) { - readme_RemoveLast(); // delete offending row, any existing xrefs are cleared + readmefile_RemoveLast(); // delete offending row, any existing xrefs are cleared row = NULL; // forget this ever happened } return row; } -// --- abt_md.FDb.readme.AllocMem +// --- abt_md.FDb.readmefile.AllocMem // Allocate space for one element. If no memory available, return NULL. -void* abt_md::readme_AllocMem() { - u64 new_nelems = _db.readme_n+1; +void* abt_md::readmefile_AllocMem() { + u64 new_nelems = _db.readmefile_n+1; // compute level and index on level u64 bsr = algo::u64_BitScanReverse(new_nelems); u64 base = u64(1)<0; ) { +void abt_md::readmefile_RemoveAll() { + for (u64 n = _db.readmefile_n; n>0; ) { n--; - readme_qFind(u64(n)).~FReadme(); // destroy last element - _db.readme_n = i32(n); + readmefile_qFind(u64(n)).~FReadmefile(); // destroy last element + _db.readmefile_n = i32(n); } } -// --- abt_md.FDb.readme.RemoveLast +// --- abt_md.FDb.readmefile.RemoveLast // Delete last element of array. Do nothing if array is empty. -void abt_md::readme_RemoveLast() { - u64 n = _db.readme_n; +void abt_md::readmefile_RemoveLast() { + u64 n = _db.readmefile_n; if (n > 0) { n -= 1; - readme_qFind(u64(n)).~FReadme(); - _db.readme_n = i32(n); + readmefile_qFind(u64(n)).~FReadmefile(); + _db.readmefile_n = i32(n); } } -// --- abt_md.FDb.readme.InputMaybe -static bool abt_md::readme_InputMaybe(dev::Readme &elem) { +// --- abt_md.FDb.readmefile.InputMaybe +static bool abt_md::readmefile_InputMaybe(dev::Readmefile &elem) { bool retval = true; - retval = readme_InsertMaybe(elem) != nullptr; + retval = readmefile_InsertMaybe(elem) != nullptr; return retval; } -// --- abt_md.FDb.readme.XrefMaybe +// --- abt_md.FDb.readmefile.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool abt_md::readme_XrefMaybe(abt_md::FReadme &row) { +bool abt_md::readmefile_XrefMaybe(abt_md::FReadmefile &row) { bool retval = true; (void)row; - // insert readme into index ind_readme + // insert readmefile into index ind_readmefile if (true) { // user-defined insert condition - bool success = ind_readme_InsertMaybe(row); + bool success = ind_readmefile_InsertMaybe(row); if (UNLIKELY(!success)) { ch_RemoveAll(algo_lib::_db.errtext); - algo_lib::_db.errtext << "abt_md.duplicate_key xref:abt_md.FDb.ind_readme"; // check for duplicate key + algo_lib::_db.errtext << "abt_md.duplicate_key xref:abt_md.FDb.ind_readmefile"; // check for duplicate key return false; } } return retval; } -// --- abt_md.FDb.ind_readme.Find +// --- abt_md.FDb.ind_readmefile.Find // Find row by key. Return NULL if not found. -abt_md::FReadme* abt_md::ind_readme_Find(const algo::strptr& key) { - u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_readme_buckets_n - 1); - abt_md::FReadme* *e = &_db.ind_readme_buckets_elems[index]; - abt_md::FReadme* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gitfile == key; - if (done) break; - e = &ret->ind_readme_next; - } while (true); +abt_md::FReadmefile* abt_md::ind_readmefile_Find(const algo::strptr& key) { + u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_readmefile_buckets_n - 1); + abt_md::FReadmefile *ret = _db.ind_readmefile_buckets_elems[index]; + for (; ret && !((*ret).gitfile == key); ret = ret->ind_readmefile_next) { + } return ret; } -// --- abt_md.FDb.ind_readme.FindX +// --- abt_md.FDb.ind_readmefile.FindX // Look up row by key and return reference. Throw exception if not found -abt_md::FReadme& abt_md::ind_readme_FindX(const algo::strptr& key) { - abt_md::FReadme* ret = ind_readme_Find(key); - vrfy(ret, tempstr() << "abt_md.key_error table:ind_readme key:'"<ind_readme_next; + prev = &ret->ind_readmefile_next; } while (true); if (retval) { - row.ind_readme_next = *prev; - _db.ind_readme_n++; + row.ind_readmefile_next = *prev; + _db.ind_readmefile_n++; *prev = &row; } } return retval; } -// --- abt_md.FDb.ind_readme.Remove +// --- abt_md.FDb.ind_readmefile.Remove // Remove reference to element from hash index. If element is not in hash, do nothing -void abt_md::ind_readme_Remove(abt_md::FReadme& row) { - if (LIKELY(row.ind_readme_next != (abt_md::FReadme*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (_db.ind_readme_buckets_n - 1); - abt_md::FReadme* *prev = &_db.ind_readme_buckets_elems[index]; // addr of pointer to current element - while (abt_md::FReadme *next = *prev) { // scan the collision chain for our element +void abt_md::ind_readmefile_Remove(abt_md::FReadmefile& row) { + if (LIKELY(row.ind_readmefile_next != (abt_md::FReadmefile*)-1)) {// check if in hash already + u32 index = row.ind_readmefile_hashval & (_db.ind_readmefile_buckets_n - 1); + abt_md::FReadmefile* *prev = &_db.ind_readmefile_buckets_elems[index]; // addr of pointer to current element + while (abt_md::FReadmefile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_readme_next; // unlink (singly linked list) - _db.ind_readme_n--; - row.ind_readme_next = (abt_md::FReadme*)-1;// not-in-hash + *prev = next->ind_readmefile_next; // unlink (singly linked list) + _db.ind_readmefile_n--; + row.ind_readmefile_next = (abt_md::FReadmefile*)-1;// not-in-hash break; } - prev = &next->ind_readme_next; + prev = &next->ind_readmefile_next; } } } -// --- abt_md.FDb.ind_readme.Reserve +// --- abt_md.FDb.ind_readmefile.Reserve // Reserve enough room in the hash for N more elements. Return success code. -void abt_md::ind_readme_Reserve(int n) { - u32 old_nbuckets = _db.ind_readme_buckets_n; - u32 new_nelems = _db.ind_readme_n + n; +void abt_md::ind_readmefile_Reserve(int n) { + ind_readmefile_AbsReserve(_db.ind_readmefile_n + n); +} + +// --- abt_md.FDb.ind_readmefile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_readmefile_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_readmefile_buckets_n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); - u32 old_size = old_nbuckets * sizeof(abt_md::FReadme*); - u32 new_size = new_nbuckets * sizeof(abt_md::FReadme*); + u32 old_size = old_nbuckets * sizeof(abt_md::FReadmefile*); + u32 new_size = new_nbuckets * sizeof(abt_md::FReadmefile*); // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably // means new memory will have to be allocated anyway - abt_md::FReadme* *new_buckets = (abt_md::FReadme**)algo_lib::malloc_AllocMem(new_size); + abt_md::FReadmefile* *new_buckets = (abt_md::FReadmefile**)algo_lib::malloc_AllocMem(new_size); if (UNLIKELY(!new_buckets)) { - FatalErrorExit("abt_md.out_of_memory field:abt_md.FDb.ind_readme"); + FatalErrorExit("abt_md.out_of_memory field:abt_md.FDb.ind_readmefile"); } memset(new_buckets, 0, new_size); // clear pointers // rehash all entries - for (int i = 0; i < _db.ind_readme_buckets_n; i++) { - abt_md::FReadme* elem = _db.ind_readme_buckets_elems[i]; + for (int i = 0; i < _db.ind_readmefile_buckets_n; i++) { + abt_md::FReadmefile* elem = _db.ind_readmefile_buckets_elems[i]; while (elem) { - abt_md::FReadme &row = *elem; - abt_md::FReadme* next = row.ind_readme_next; - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (new_nbuckets-1); - row.ind_readme_next = new_buckets[index]; + abt_md::FReadmefile &row = *elem; + abt_md::FReadmefile* next = row.ind_readmefile_next; + u32 index = row.ind_readmefile_hashval & (new_nbuckets-1); + row.ind_readmefile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } } // free old array - algo_lib::malloc_FreeMem(_db.ind_readme_buckets_elems, old_size); - _db.ind_readme_buckets_elems = new_buckets; - _db.ind_readme_buckets_n = new_nbuckets; + algo_lib::malloc_FreeMem(_db.ind_readmefile_buckets_elems, old_size); + _db.ind_readmefile_buckets_elems = new_buckets; + _db.ind_readmefile_buckets_n = new_nbuckets; } } @@ -1222,7 +1263,7 @@ static void abt_md::mdsection_LoadStatic() { ,{ "dev.mdsection mdsection:Limitations match:\"### Limitations\" path:\"\" genlist:\"\" comment:\"Tool limitations\"", abt_md::mdsection_Limitations } ,{ "dev.mdsection mdsection:Content match:\"### ---\" path:\"\" genlist:\"\" comment:\"Any other content (hard-coded)\"", abt_md::mdsection_Content } ,{ "dev.mdsection mdsection:Example match:\"### Example%\" path:\"\" genlist:\"\" comment:\"User-provided example\"", abt_md::mdsection_Example } - ,{ "dev.mdsection mdsection:Attributes match:\"### Attributes\" path:\"txt/ssimdb/%.md|txt/internals/(lib|protocol)/%/README.md\" genlist:\"\" comment:\"\"", abt_md::mdsection_Attributes } + ,{ "dev.mdsection mdsection:Attributes match:\"### Attributes\" path:txt/ssimdb/%.md genlist:\"\" comment:\"\"", abt_md::mdsection_Attributes } ,{ "dev.mdsection mdsection:Ctypes match:\"### Ctypes\" path:txt/protocol/%/README.md genlist:\"\" comment:\"\"", abt_md::mdsection_Ctypes } ,{ "dev.mdsection mdsection:Functions match:\"### Functions\" path:\"txt/(protocol|lib)/%/README.md\" genlist:\"\" comment:\"\"", abt_md::mdsection_Functions } ,{ "dev.mdsection mdsection:Tables match:\"### Tables\" path:txt/ssimdb/%/README.md genlist:\"\" comment:NULL", abt_md::mdsection_Tables } @@ -1232,6 +1273,7 @@ static void abt_md::mdsection_LoadStatic() { ,{ "dev.mdsection mdsection:CmdlineUses match:\"### Used In Commands\" path:txt/ssimdb/%.md genlist:\"\" comment:\"\"", abt_md::mdsection_CmdlineUses } ,{ "dev.mdsection mdsection:Options match:\"### Options\" path:txt/exe/%/README.md genlist:\"####\" comment:\"(semi-gen) List of command-line options\"", abt_md::mdsection_Options } ,{ "dev.mdsection mdsection:Inputs match:\"### Inputs\" path:\"txt/(exe|lib)/%/README.md\" genlist:\"\" comment:\"(gen) list of command inputs\"", abt_md::mdsection_Inputs } + ,{ "dev.mdsection mdsection:InputMessages match:\"### Input Messages\" path:txt/exe/%/README.md genlist:\"\" comment:\"(gen) list of input messages\"", abt_md::mdsection_InputMessages } ,{ "dev.mdsection mdsection:Sources match:\"### Sources\" path:\"txt/(exe/%/internals.md|lib/%/README.md)\" genlist:\"\" comment:\"(build) Build information\"", abt_md::mdsection_Sources } ,{ "dev.mdsection mdsection:Dependencies match:\"### Dependencies\" path:\"txt/(exe/%/internals.md|lib/%/README.md)\" genlist:\"\" comment:\"(build) Dependency information\"", abt_md::mdsection_Dependencies } ,{ "dev.mdsection mdsection:Imdb match:\"### In Memory DB\" path:\"txt/(exe/%/internals.md|lib/%/README.md)\" genlist:\"\" comment:\"(gen) list of structs, access paths etc\"", abt_md::mdsection_Imdb } @@ -1637,14 +1679,9 @@ bool abt_md::ns_XrefMaybe(abt_md::FNs &row) { // Find row by key. Return NULL if not found. abt_md::FNs* abt_md::ind_ns_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_ns_buckets_n - 1); - abt_md::FNs* *e = &_db.ind_ns_buckets_elems[index]; - abt_md::FNs* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ns == key; - if (done) break; - e = &ret->ind_ns_next; - } while (true); + abt_md::FNs *ret = _db.ind_ns_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_ns_next) { + } return ret; } @@ -1676,10 +1713,11 @@ abt_md::FNs& abt_md::ind_ns_GetOrCreate(const algo::strptr& key) { // --- abt_md.FDb.ind_ns.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_ns_InsertMaybe(abt_md::FNs& row) { - ind_ns_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ns_next == (abt_md::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + row.ind_ns_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_ns_Reserve(1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); abt_md::FNs* *prev = &_db.ind_ns_buckets_elems[index]; do { abt_md::FNs* ret = *prev; @@ -1705,7 +1743,7 @@ bool abt_md::ind_ns_InsertMaybe(abt_md::FNs& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_ns_Remove(abt_md::FNs& row) { if (LIKELY(row.ind_ns_next != (abt_md::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); abt_md::FNs* *prev = &_db.ind_ns_buckets_elems[index]; // addr of pointer to current element while (abt_md::FNs *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1722,8 +1760,14 @@ void abt_md::ind_ns_Remove(abt_md::FNs& row) { // --- abt_md.FDb.ind_ns.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_ns_Reserve(int n) { + ind_ns_AbsReserve(_db.ind_ns_n + n); +} + +// --- abt_md.FDb.ind_ns.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_ns_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ns_buckets_n; - u32 new_nelems = _db.ind_ns_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1742,7 +1786,7 @@ void abt_md::ind_ns_Reserve(int n) { while (elem) { abt_md::FNs &row = *elem; abt_md::FNs* next = row.ind_ns_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_ns_hashval & (new_nbuckets-1); row.ind_ns_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1884,14 +1928,9 @@ bool abt_md::ssimfile_XrefMaybe(abt_md::FSsimfile &row) { // Find row by key. Return NULL if not found. abt_md::FSsimfile* abt_md::ind_ssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimfile_buckets_n - 1); - abt_md::FSsimfile* *e = &_db.ind_ssimfile_buckets_elems[index]; - abt_md::FSsimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimfile_next; - } while (true); + abt_md::FSsimfile *ret = _db.ind_ssimfile_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimfile_next) { + } return ret; } @@ -1906,10 +1945,11 @@ abt_md::FSsimfile& abt_md::ind_ssimfile_FindX(const algo::strptr& key) { // --- abt_md.FDb.ind_ssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_ssimfile_InsertMaybe(abt_md::FSsimfile& row) { - ind_ssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimfile_next == (abt_md::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + row.ind_ssimfile_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimfile_Reserve(1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); abt_md::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; do { abt_md::FSsimfile* ret = *prev; @@ -1935,7 +1975,7 @@ bool abt_md::ind_ssimfile_InsertMaybe(abt_md::FSsimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_ssimfile_Remove(abt_md::FSsimfile& row) { if (LIKELY(row.ind_ssimfile_next != (abt_md::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); abt_md::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; // addr of pointer to current element while (abt_md::FSsimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1952,8 +1992,14 @@ void abt_md::ind_ssimfile_Remove(abt_md::FSsimfile& row) { // --- abt_md.FDb.ind_ssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_ssimfile_Reserve(int n) { + ind_ssimfile_AbsReserve(_db.ind_ssimfile_n + n); +} + +// --- abt_md.FDb.ind_ssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_ssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimfile_buckets_n; - u32 new_nelems = _db.ind_ssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1972,7 +2018,7 @@ void abt_md::ind_ssimfile_Reserve(int n) { while (elem) { abt_md::FSsimfile &row = *elem; abt_md::FSsimfile* next = row.ind_ssimfile_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimfile_hashval & (new_nbuckets-1); row.ind_ssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2109,14 +2155,9 @@ bool abt_md::ctype_XrefMaybe(abt_md::FCtype &row) { // Find row by key. Return NULL if not found. abt_md::FCtype* abt_md::ind_ctype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctype_buckets_n - 1); - abt_md::FCtype* *e = &_db.ind_ctype_buckets_elems[index]; - abt_md::FCtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctype_next; - } while (true); + abt_md::FCtype *ret = _db.ind_ctype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctype_next) { + } return ret; } @@ -2131,10 +2172,11 @@ abt_md::FCtype& abt_md::ind_ctype_FindX(const algo::strptr& key) { // --- abt_md.FDb.ind_ctype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_ctype_InsertMaybe(abt_md::FCtype& row) { - ind_ctype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ctype_next == (abt_md::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + row.ind_ctype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctype_Reserve(1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); abt_md::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; do { abt_md::FCtype* ret = *prev; @@ -2160,7 +2202,7 @@ bool abt_md::ind_ctype_InsertMaybe(abt_md::FCtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_ctype_Remove(abt_md::FCtype& row) { if (LIKELY(row.ind_ctype_next != (abt_md::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); abt_md::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; // addr of pointer to current element while (abt_md::FCtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2177,8 +2219,14 @@ void abt_md::ind_ctype_Remove(abt_md::FCtype& row) { // --- abt_md.FDb.ind_ctype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_ctype_Reserve(int n) { + ind_ctype_AbsReserve(_db.ind_ctype_n + n); +} + +// --- abt_md.FDb.ind_ctype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_ctype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ctype_buckets_n; - u32 new_nelems = _db.ind_ctype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2197,7 +2245,7 @@ void abt_md::ind_ctype_Reserve(int n) { while (elem) { abt_md::FCtype &row = *elem; abt_md::FCtype* next = row.ind_ctype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ctype_hashval & (new_nbuckets-1); row.ind_ctype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2347,14 +2395,9 @@ bool abt_md::field_XrefMaybe(abt_md::FField &row) { // Find row by key. Return NULL if not found. abt_md::FField* abt_md::ind_field_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_field_buckets_n - 1); - abt_md::FField* *e = &_db.ind_field_buckets_elems[index]; - abt_md::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + abt_md::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_field_next) { + } return ret; } @@ -2369,10 +2412,11 @@ abt_md::FField& abt_md::ind_field_FindX(const algo::strptr& key) { // --- abt_md.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_field_InsertMaybe(abt_md::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (abt_md::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::Smallstr100_Hash(0, row.field); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); abt_md::FField* *prev = &_db.ind_field_buckets_elems[index]; do { abt_md::FField* ret = *prev; @@ -2398,7 +2442,7 @@ bool abt_md::ind_field_InsertMaybe(abt_md::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_field_Remove(abt_md::FField& row) { if (LIKELY(row.ind_field_next != (abt_md::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); abt_md::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (abt_md::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2415,8 +2459,14 @@ void abt_md::ind_field_Remove(abt_md::FField& row) { // --- abt_md.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- abt_md.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2435,7 +2485,7 @@ void abt_md::ind_field_Reserve(int n) { while (elem) { abt_md::FField &row = *elem; abt_md::FField* next = row.ind_field_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2799,14 +2849,9 @@ void abt_md::ind_human_text_Cascdel() { // Find row by key. Return NULL if not found. abt_md::FHumanText* abt_md::ind_human_text_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_human_text_buckets_n - 1); - abt_md::FHumanText* *e = &_db.ind_human_text_buckets_elems[index]; - abt_md::FHumanText* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).key == key; - if (done) break; - e = &ret->ind_human_text_next; - } while (true); + abt_md::FHumanText *ret = _db.ind_human_text_buckets_elems[index]; + for (; ret && !((*ret).key == key); ret = ret->ind_human_text_next) { + } return ret; } @@ -2838,10 +2883,11 @@ abt_md::FHumanText& abt_md::ind_human_text_GetOrCreate(const algo::strptr& key) // --- abt_md.FDb.ind_human_text.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_human_text_InsertMaybe(abt_md::FHumanText& row) { - ind_human_text_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_human_text_next == (abt_md::FHumanText*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.key) & (_db.ind_human_text_buckets_n - 1); + row.ind_human_text_hashval = algo::cstring_Hash(0, row.key); + ind_human_text_Reserve(1); + u32 index = row.ind_human_text_hashval & (_db.ind_human_text_buckets_n - 1); abt_md::FHumanText* *prev = &_db.ind_human_text_buckets_elems[index]; do { abt_md::FHumanText* ret = *prev; @@ -2867,7 +2913,7 @@ bool abt_md::ind_human_text_InsertMaybe(abt_md::FHumanText& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_human_text_Remove(abt_md::FHumanText& row) { if (LIKELY(row.ind_human_text_next != (abt_md::FHumanText*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.key) & (_db.ind_human_text_buckets_n - 1); + u32 index = row.ind_human_text_hashval & (_db.ind_human_text_buckets_n - 1); abt_md::FHumanText* *prev = &_db.ind_human_text_buckets_elems[index]; // addr of pointer to current element while (abt_md::FHumanText *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2884,8 +2930,14 @@ void abt_md::ind_human_text_Remove(abt_md::FHumanText& row) { // --- abt_md.FDb.ind_human_text.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_human_text_Reserve(int n) { + ind_human_text_AbsReserve(_db.ind_human_text_n + n); +} + +// --- abt_md.FDb.ind_human_text.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_human_text_AbsReserve(int n) { u32 old_nbuckets = _db.ind_human_text_buckets_n; - u32 new_nelems = _db.ind_human_text_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2904,7 +2956,7 @@ void abt_md::ind_human_text_Reserve(int n) { while (elem) { abt_md::FHumanText &row = *elem; abt_md::FHumanText* next = row.ind_human_text_next; - u32 index = algo::cstring_Hash(0, row.key) & (new_nbuckets-1); + u32 index = row.ind_human_text_hashval & (new_nbuckets-1); row.ind_human_text_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3028,14 +3080,9 @@ bool abt_md::scriptfile_XrefMaybe(abt_md::FScriptfile &row) { // Find row by key. Return NULL if not found. abt_md::FScriptfile* abt_md::ind_scriptfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_scriptfile_buckets_n - 1); - abt_md::FScriptfile* *e = &_db.ind_scriptfile_buckets_elems[index]; - abt_md::FScriptfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gitfile == key; - if (done) break; - e = &ret->ind_scriptfile_next; - } while (true); + abt_md::FScriptfile *ret = _db.ind_scriptfile_buckets_elems[index]; + for (; ret && !((*ret).gitfile == key); ret = ret->ind_scriptfile_next) { + } return ret; } @@ -3067,10 +3114,11 @@ abt_md::FScriptfile& abt_md::ind_scriptfile_GetOrCreate(const algo::strptr& key) // --- abt_md.FDb.ind_scriptfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_scriptfile_InsertMaybe(abt_md::FScriptfile& row) { - ind_scriptfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_scriptfile_next == (abt_md::FScriptfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (_db.ind_scriptfile_buckets_n - 1); + row.ind_scriptfile_hashval = algo::Smallstr200_Hash(0, row.gitfile); + ind_scriptfile_Reserve(1); + u32 index = row.ind_scriptfile_hashval & (_db.ind_scriptfile_buckets_n - 1); abt_md::FScriptfile* *prev = &_db.ind_scriptfile_buckets_elems[index]; do { abt_md::FScriptfile* ret = *prev; @@ -3096,7 +3144,7 @@ bool abt_md::ind_scriptfile_InsertMaybe(abt_md::FScriptfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_scriptfile_Remove(abt_md::FScriptfile& row) { if (LIKELY(row.ind_scriptfile_next != (abt_md::FScriptfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (_db.ind_scriptfile_buckets_n - 1); + u32 index = row.ind_scriptfile_hashval & (_db.ind_scriptfile_buckets_n - 1); abt_md::FScriptfile* *prev = &_db.ind_scriptfile_buckets_elems[index]; // addr of pointer to current element while (abt_md::FScriptfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3113,8 +3161,14 @@ void abt_md::ind_scriptfile_Remove(abt_md::FScriptfile& row) { // --- abt_md.FDb.ind_scriptfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_scriptfile_Reserve(int n) { + ind_scriptfile_AbsReserve(_db.ind_scriptfile_n + n); +} + +// --- abt_md.FDb.ind_scriptfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_scriptfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_scriptfile_buckets_n; - u32 new_nelems = _db.ind_scriptfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3133,7 +3187,7 @@ void abt_md::ind_scriptfile_Reserve(int n) { while (elem) { abt_md::FScriptfile &row = *elem; abt_md::FScriptfile* next = row.ind_scriptfile_next; - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (new_nbuckets-1); + u32 index = row.ind_scriptfile_hashval & (new_nbuckets-1); row.ind_scriptfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3257,14 +3311,9 @@ bool abt_md::nstype_XrefMaybe(abt_md::FNstype &row) { // Find row by key. Return NULL if not found. abt_md::FNstype* abt_md::ind_nstype_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_nstype_buckets_n - 1); - abt_md::FNstype* *e = &_db.ind_nstype_buckets_elems[index]; - abt_md::FNstype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).nstype == key; - if (done) break; - e = &ret->ind_nstype_next; - } while (true); + abt_md::FNstype *ret = _db.ind_nstype_buckets_elems[index]; + for (; ret && !((*ret).nstype == key); ret = ret->ind_nstype_next) { + } return ret; } @@ -3296,10 +3345,11 @@ abt_md::FNstype& abt_md::ind_nstype_GetOrCreate(const algo::strptr& key) { // --- abt_md.FDb.ind_nstype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_nstype_InsertMaybe(abt_md::FNstype& row) { - ind_nstype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_nstype_next == (abt_md::FNstype*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.nstype) & (_db.ind_nstype_buckets_n - 1); + row.ind_nstype_hashval = algo::Smallstr50_Hash(0, row.nstype); + ind_nstype_Reserve(1); + u32 index = row.ind_nstype_hashval & (_db.ind_nstype_buckets_n - 1); abt_md::FNstype* *prev = &_db.ind_nstype_buckets_elems[index]; do { abt_md::FNstype* ret = *prev; @@ -3325,7 +3375,7 @@ bool abt_md::ind_nstype_InsertMaybe(abt_md::FNstype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_nstype_Remove(abt_md::FNstype& row) { if (LIKELY(row.ind_nstype_next != (abt_md::FNstype*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.nstype) & (_db.ind_nstype_buckets_n - 1); + u32 index = row.ind_nstype_hashval & (_db.ind_nstype_buckets_n - 1); abt_md::FNstype* *prev = &_db.ind_nstype_buckets_elems[index]; // addr of pointer to current element while (abt_md::FNstype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3342,8 +3392,14 @@ void abt_md::ind_nstype_Remove(abt_md::FNstype& row) { // --- abt_md.FDb.ind_nstype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_nstype_Reserve(int n) { + ind_nstype_AbsReserve(_db.ind_nstype_n + n); +} + +// --- abt_md.FDb.ind_nstype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_nstype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_nstype_buckets_n; - u32 new_nelems = _db.ind_nstype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3362,7 +3418,7 @@ void abt_md::ind_nstype_Reserve(int n) { while (elem) { abt_md::FNstype &row = *elem; abt_md::FNstype* next = row.ind_nstype_next; - u32 index = algo::Smallstr50_Hash(0, row.nstype) & (new_nbuckets-1); + u32 index = row.ind_nstype_hashval & (new_nbuckets-1); row.ind_nstype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3572,14 +3628,9 @@ bool abt_md::anchor_XrefMaybe(abt_md::FAnchor &row) { // Find row by key. Return NULL if not found. abt_md::FAnchor* abt_md::ind_anchor_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_anchor_buckets_n - 1); - abt_md::FAnchor* *e = &_db.ind_anchor_buckets_elems[index]; - abt_md::FAnchor* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).anchor == key; - if (done) break; - e = &ret->ind_anchor_next; - } while (true); + abt_md::FAnchor *ret = _db.ind_anchor_buckets_elems[index]; + for (; ret && !((*ret).anchor == key); ret = ret->ind_anchor_next) { + } return ret; } @@ -3611,10 +3662,11 @@ abt_md::FAnchor& abt_md::ind_anchor_GetOrCreate(const algo::strptr& key) { // --- abt_md.FDb.ind_anchor.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_anchor_InsertMaybe(abt_md::FAnchor& row) { - ind_anchor_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_anchor_next == (abt_md::FAnchor*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.anchor) & (_db.ind_anchor_buckets_n - 1); + row.ind_anchor_hashval = algo::cstring_Hash(0, row.anchor); + ind_anchor_Reserve(1); + u32 index = row.ind_anchor_hashval & (_db.ind_anchor_buckets_n - 1); abt_md::FAnchor* *prev = &_db.ind_anchor_buckets_elems[index]; do { abt_md::FAnchor* ret = *prev; @@ -3640,7 +3692,7 @@ bool abt_md::ind_anchor_InsertMaybe(abt_md::FAnchor& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_anchor_Remove(abt_md::FAnchor& row) { if (LIKELY(row.ind_anchor_next != (abt_md::FAnchor*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.anchor) & (_db.ind_anchor_buckets_n - 1); + u32 index = row.ind_anchor_hashval & (_db.ind_anchor_buckets_n - 1); abt_md::FAnchor* *prev = &_db.ind_anchor_buckets_elems[index]; // addr of pointer to current element while (abt_md::FAnchor *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3657,8 +3709,14 @@ void abt_md::ind_anchor_Remove(abt_md::FAnchor& row) { // --- abt_md.FDb.ind_anchor.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_anchor_Reserve(int n) { + ind_anchor_AbsReserve(_db.ind_anchor_n + n); +} + +// --- abt_md.FDb.ind_anchor.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_anchor_AbsReserve(int n) { u32 old_nbuckets = _db.ind_anchor_buckets_n; - u32 new_nelems = _db.ind_anchor_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3677,7 +3735,7 @@ void abt_md::ind_anchor_Reserve(int n) { while (elem) { abt_md::FAnchor &row = *elem; abt_md::FAnchor* next = row.ind_anchor_next; - u32 index = algo::cstring_Hash(0, row.anchor) & (new_nbuckets-1); + u32 index = row.ind_anchor_hashval & (new_nbuckets-1); row.ind_anchor_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3985,14 +4043,9 @@ bool abt_md::tclass_XrefMaybe(abt_md::FTclass &row) { // Find row by key. Return NULL if not found. abt_md::FTclass* abt_md::ind_tclass_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_tclass_buckets_n - 1); - abt_md::FTclass* *e = &_db.ind_tclass_buckets_elems[index]; - abt_md::FTclass* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).tclass == key; - if (done) break; - e = &ret->ind_tclass_next; - } while (true); + abt_md::FTclass *ret = _db.ind_tclass_buckets_elems[index]; + for (; ret && !((*ret).tclass == key); ret = ret->ind_tclass_next) { + } return ret; } @@ -4024,10 +4077,11 @@ abt_md::FTclass& abt_md::ind_tclass_GetOrCreate(const algo::strptr& key) { // --- abt_md.FDb.ind_tclass.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_tclass_InsertMaybe(abt_md::FTclass& row) { - ind_tclass_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_tclass_next == (abt_md::FTclass*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.tclass) & (_db.ind_tclass_buckets_n - 1); + row.ind_tclass_hashval = algo::Smallstr50_Hash(0, row.tclass); + ind_tclass_Reserve(1); + u32 index = row.ind_tclass_hashval & (_db.ind_tclass_buckets_n - 1); abt_md::FTclass* *prev = &_db.ind_tclass_buckets_elems[index]; do { abt_md::FTclass* ret = *prev; @@ -4053,7 +4107,7 @@ bool abt_md::ind_tclass_InsertMaybe(abt_md::FTclass& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_tclass_Remove(abt_md::FTclass& row) { if (LIKELY(row.ind_tclass_next != (abt_md::FTclass*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.tclass) & (_db.ind_tclass_buckets_n - 1); + u32 index = row.ind_tclass_hashval & (_db.ind_tclass_buckets_n - 1); abt_md::FTclass* *prev = &_db.ind_tclass_buckets_elems[index]; // addr of pointer to current element while (abt_md::FTclass *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4070,8 +4124,14 @@ void abt_md::ind_tclass_Remove(abt_md::FTclass& row) { // --- abt_md.FDb.ind_tclass.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_tclass_Reserve(int n) { + ind_tclass_AbsReserve(_db.ind_tclass_n + n); +} + +// --- abt_md.FDb.ind_tclass.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_tclass_AbsReserve(int n) { u32 old_nbuckets = _db.ind_tclass_buckets_n; - u32 new_nelems = _db.ind_tclass_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4090,7 +4150,7 @@ void abt_md::ind_tclass_Reserve(int n) { while (elem) { abt_md::FTclass &row = *elem; abt_md::FTclass* next = row.ind_tclass_next; - u32 index = algo::Smallstr50_Hash(0, row.tclass) & (new_nbuckets-1); + u32 index = row.ind_tclass_hashval & (new_nbuckets-1); row.ind_tclass_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4433,14 +4493,9 @@ bool abt_md::readmesort_XrefMaybe(abt_md::FReadmesort &row) { // Find row by key. Return NULL if not found. abt_md::FReadmesort* abt_md::ind_readmesort_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_readmesort_buckets_n - 1); - abt_md::FReadmesort* *e = &_db.ind_readmesort_buckets_elems[index]; - abt_md::FReadmesort* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).readmesort == key; - if (done) break; - e = &ret->ind_readmesort_next; - } while (true); + abt_md::FReadmesort *ret = _db.ind_readmesort_buckets_elems[index]; + for (; ret && !((*ret).readmesort == key); ret = ret->ind_readmesort_next) { + } return ret; } @@ -4472,10 +4527,11 @@ abt_md::FReadmesort& abt_md::ind_readmesort_GetOrCreate(const algo::strptr& key) // --- abt_md.FDb.ind_readmesort.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_readmesort_InsertMaybe(abt_md::FReadmesort& row) { - ind_readmesort_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_readmesort_next == (abt_md::FReadmesort*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.readmesort) & (_db.ind_readmesort_buckets_n - 1); + row.ind_readmesort_hashval = algo::Smallstr250_Hash(0, row.readmesort); + ind_readmesort_Reserve(1); + u32 index = row.ind_readmesort_hashval & (_db.ind_readmesort_buckets_n - 1); abt_md::FReadmesort* *prev = &_db.ind_readmesort_buckets_elems[index]; do { abt_md::FReadmesort* ret = *prev; @@ -4501,7 +4557,7 @@ bool abt_md::ind_readmesort_InsertMaybe(abt_md::FReadmesort& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_readmesort_Remove(abt_md::FReadmesort& row) { if (LIKELY(row.ind_readmesort_next != (abt_md::FReadmesort*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.readmesort) & (_db.ind_readmesort_buckets_n - 1); + u32 index = row.ind_readmesort_hashval & (_db.ind_readmesort_buckets_n - 1); abt_md::FReadmesort* *prev = &_db.ind_readmesort_buckets_elems[index]; // addr of pointer to current element while (abt_md::FReadmesort *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4518,8 +4574,14 @@ void abt_md::ind_readmesort_Remove(abt_md::FReadmesort& row) { // --- abt_md.FDb.ind_readmesort.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_readmesort_Reserve(int n) { + ind_readmesort_AbsReserve(_db.ind_readmesort_n + n); +} + +// --- abt_md.FDb.ind_readmesort.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_readmesort_AbsReserve(int n) { u32 old_nbuckets = _db.ind_readmesort_buckets_n; - u32 new_nelems = _db.ind_readmesort_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4538,7 +4600,7 @@ void abt_md::ind_readmesort_Reserve(int n) { while (elem) { abt_md::FReadmesort &row = *elem; abt_md::FReadmesort* next = row.ind_readmesort_next; - u32 index = algo::Smallstr250_Hash(0, row.readmesort) & (new_nbuckets-1); + u32 index = row.ind_readmesort_hashval & (new_nbuckets-1); row.ind_readmesort_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4662,14 +4724,9 @@ bool abt_md::gstatic_XrefMaybe(abt_md::FGstatic &row) { // Find row by key. Return NULL if not found. abt_md::FGstatic* abt_md::ind_gstatic_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_gstatic_buckets_n - 1); - abt_md::FGstatic* *e = &_db.ind_gstatic_buckets_elems[index]; - abt_md::FGstatic* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_gstatic_next; - } while (true); + abt_md::FGstatic *ret = _db.ind_gstatic_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_gstatic_next) { + } return ret; } @@ -4701,10 +4758,11 @@ abt_md::FGstatic& abt_md::ind_gstatic_GetOrCreate(const algo::strptr& key) { // --- abt_md.FDb.ind_gstatic.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_gstatic_InsertMaybe(abt_md::FGstatic& row) { - ind_gstatic_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gstatic_next == (abt_md::FGstatic*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_gstatic_buckets_n - 1); + row.ind_gstatic_hashval = algo::Smallstr100_Hash(0, row.field); + ind_gstatic_Reserve(1); + u32 index = row.ind_gstatic_hashval & (_db.ind_gstatic_buckets_n - 1); abt_md::FGstatic* *prev = &_db.ind_gstatic_buckets_elems[index]; do { abt_md::FGstatic* ret = *prev; @@ -4730,7 +4788,7 @@ bool abt_md::ind_gstatic_InsertMaybe(abt_md::FGstatic& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_gstatic_Remove(abt_md::FGstatic& row) { if (LIKELY(row.ind_gstatic_next != (abt_md::FGstatic*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_gstatic_buckets_n - 1); + u32 index = row.ind_gstatic_hashval & (_db.ind_gstatic_buckets_n - 1); abt_md::FGstatic* *prev = &_db.ind_gstatic_buckets_elems[index]; // addr of pointer to current element while (abt_md::FGstatic *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4747,8 +4805,14 @@ void abt_md::ind_gstatic_Remove(abt_md::FGstatic& row) { // --- abt_md.FDb.ind_gstatic.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_gstatic_Reserve(int n) { + ind_gstatic_AbsReserve(_db.ind_gstatic_n + n); +} + +// --- abt_md.FDb.ind_gstatic.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_gstatic_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gstatic_buckets_n; - u32 new_nelems = _db.ind_gstatic_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4767,7 +4831,7 @@ void abt_md::ind_gstatic_Reserve(int n) { while (elem) { abt_md::FGstatic &row = *elem; abt_md::FGstatic* next = row.ind_gstatic_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_gstatic_hashval & (new_nbuckets-1); row.ind_gstatic_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -5025,14 +5089,9 @@ bool abt_md::targdep_XrefMaybe(abt_md::FTargdep &row) { // Find row by key. Return NULL if not found. abt_md::FTarget* abt_md::ind_target_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_target_buckets_n - 1); - abt_md::FTarget* *e = &_db.ind_target_buckets_elems[index]; - abt_md::FTarget* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).target == key; - if (done) break; - e = &ret->ind_target_next; - } while (true); + abt_md::FTarget *ret = _db.ind_target_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_target_next) { + } return ret; } @@ -5047,10 +5106,11 @@ abt_md::FTarget& abt_md::ind_target_FindX(const algo::strptr& key) { // --- abt_md.FDb.ind_target.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool abt_md::ind_target_InsertMaybe(abt_md::FTarget& row) { - ind_target_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_target_next == (abt_md::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + row.ind_target_hashval = algo::Smallstr16_Hash(0, row.target); + ind_target_Reserve(1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); abt_md::FTarget* *prev = &_db.ind_target_buckets_elems[index]; do { abt_md::FTarget* ret = *prev; @@ -5076,7 +5136,7 @@ bool abt_md::ind_target_InsertMaybe(abt_md::FTarget& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void abt_md::ind_target_Remove(abt_md::FTarget& row) { if (LIKELY(row.ind_target_next != (abt_md::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); abt_md::FTarget* *prev = &_db.ind_target_buckets_elems[index]; // addr of pointer to current element while (abt_md::FTarget *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -5093,8 +5153,14 @@ void abt_md::ind_target_Remove(abt_md::FTarget& row) { // --- abt_md.FDb.ind_target.Reserve // Reserve enough room in the hash for N more elements. Return success code. void abt_md::ind_target_Reserve(int n) { + ind_target_AbsReserve(_db.ind_target_n + n); +} + +// --- abt_md.FDb.ind_target.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_target_AbsReserve(int n) { u32 old_nbuckets = _db.ind_target_buckets_n; - u32 new_nelems = _db.ind_target_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -5113,7 +5179,7 @@ void abt_md::ind_target_Reserve(int n) { while (elem) { abt_md::FTarget &row = *elem; abt_md::FTarget* next = row.ind_target_next; - u32 index = algo::Smallstr16_Hash(0, row.target) & (new_nbuckets-1); + u32 index = row.ind_target_hashval & (new_nbuckets-1); row.ind_target_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -5126,170 +5192,697 @@ void abt_md::ind_target_Reserve(int n) { } } -// --- abt_md.FDb.trace.RowidFind -// find trace by row id (used to implement reflection) -static algo::ImrowPtr abt_md::trace_RowidFind(int t) { - return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +// --- abt_md.FDb.finput.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +abt_md::FFinput& abt_md::finput_Alloc() { + abt_md::FFinput* row = finput_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("abt_md.out_of_mem field:abt_md.FDb.finput comment:'Alloc failed'"); + } + return *row; } -// --- abt_md.FDb.trace.N -// Function return 1 -inline static i32 abt_md::trace_N() { - return 1; +// --- abt_md.FDb.finput.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +abt_md::FFinput* abt_md::finput_AllocMaybe() { + abt_md::FFinput *row = (abt_md::FFinput*)finput_AllocMem(); + if (row) { + new (row) abt_md::FFinput; // call constructor + } + return row; } -// --- abt_md.FDb.bh_file_section_curs.Add -static void abt_md::_db_bh_file_section_curs_Add(_db_bh_file_section_curs &curs, abt_md::FFileSection& row) { - u32 n = curs.temp_n; - int i = n; - curs.temp_n = n+1; - abt_md::FFileSection* *elems = curs.temp_elems; - while (i>0) { - int j = (i-1)/2; - abt_md::FFileSection* p = elems[j]; - if (!bh_file_section_ElemLt(row,*p)) { - break; - } - elems[i]=p; - i=j; +// --- abt_md.FDb.finput.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +abt_md::FFinput* abt_md::finput_InsertMaybe(const dmmeta::Finput &value) { + abt_md::FFinput *row = &finput_Alloc(); // if out of memory, process dies. if input error, return NULL. + finput_CopyIn(*row,const_cast(value)); + bool ok = finput_XrefMaybe(*row); // this may return false + if (!ok) { + finput_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened } - elems[i]=&row; + return row; } -// --- abt_md.FDb.bh_file_section_curs.Reserve -void abt_md::_db_bh_file_section_curs_Reserve(_db_bh_file_section_curs &curs, int n) { - if (n > curs.temp_max) { - size_t old_size = sizeof(void*) * curs.temp_max; - size_t new_size = sizeof(void*) * bh_file_section_N(); - curs.temp_elems = (abt_md::FFileSection**)algo_lib::malloc_ReallocMem(curs.temp_elems, old_size, new_size); - if (!curs.temp_elems) { - algo::FatalErrorExit("abt_md.cursor_out_of_memory func:abt_md.FDb.bh_file_section_curs.Reserve"); +// --- abt_md.FDb.finput.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* abt_md::finput_AllocMem() { + u64 new_nelems = _db.finput_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)< 0) { - abt_md::FFileSection &first = *parent.bh_file_section_elems[0]; - curs.temp_elems[0] = &first; // insert first element in heap - curs.temp_n = 1; +// --- abt_md.FDb.finput.RemoveAll +// Remove all elements from Lary +void abt_md::finput_RemoveAll() { + for (u64 n = _db.finput_n; n>0; ) { + n--; + finput_qFind(u64(n)).~FFinput(); // destroy last element + _db.finput_n = i32(n); } } -// --- abt_md.FDb.bh_file_section_curs.Next -// Advance cursor. -void abt_md::_db_bh_file_section_curs_Next(_db_bh_file_section_curs &curs) { - abt_md::FFileSection* *elems = curs.temp_elems; - int n = curs.temp_n; +// --- abt_md.FDb.finput.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void abt_md::finput_RemoveLast() { + u64 n = _db.finput_n; if (n > 0) { - // remove top element from heap - abt_md::FFileSection* dead = elems[0]; - int i = 0; - abt_md::FFileSection* last = curs.temp_elems[n-1]; - // downheap last elem - do { - abt_md::FFileSection* choose = last; - int l = i*2+1; - if (lbh_file_section_idx; - i = (index*2+1); - if (i < bh_file_section_N()) { - abt_md::FFileSection &elem = *curs.parent->bh_file_section_elems[i]; - _db_bh_file_section_curs_Add(curs, elem); - } - if (i+1 < bh_file_section_N()) { - abt_md::FFileSection &elem = *curs.parent->bh_file_section_elems[i + 1]; - _db_bh_file_section_curs_Add(curs, elem); - } + n -= 1; + finput_qFind(u64(n)).~FFinput(); + _db.finput_n = i32(n); } } -// --- abt_md.FDb.ind_human_text_curs.Reset -void abt_md::_db_ind_human_text_curs_Reset(_db_ind_human_text_curs &curs, abt_md::FDb &parent) { - curs.bucket = 0; - curs.parent = &parent; - curs.prow = &parent.ind_human_text_buckets_elems[0]; // hash never has zero buckets - while (!*curs.prow) { - curs.bucket += 1; - if (curs.bucket == parent.ind_human_text_buckets_n) break; - curs.prow = &parent.ind_human_text_buckets_elems[curs.bucket]; - } +// --- abt_md.FDb.finput.InputMaybe +static bool abt_md::finput_InputMaybe(dmmeta::Finput &elem) { + bool retval = true; + retval = finput_InsertMaybe(elem) != nullptr; + return retval; } -// --- abt_md.FDb..Init -// Set all fields to initial values. -void abt_md::FDb_Init() { - // initialize LAry readme (abt_md.FDb.readme) - _db.readme_n = 0; - memset(_db.readme_lary, 0, sizeof(_db.readme_lary)); // zero out all level pointers - abt_md::FReadme* readme_first = (abt_md::FReadme*)algo_lib::malloc_AllocMem(sizeof(abt_md::FReadme) * (u64(1)<<4)); - if (!readme_first) { - FatalErrorExit("out of memory"); - } - for (int i = 0; i < 4; i++) { - _db.readme_lary[i] = readme_first; - readme_first += 1ULL<zd_scanns_next; + abt_md::FNs **new_row_b = &_db.zd_scanns_head; + abt_md::FNs **new_row = old_tail ? new_row_a : new_row_b; + *new_row = &row; + _db.zd_scanns_n++; } - for (int i = 0; i < 4; i++) { - _db.ns_lary[i] = ns_first; - ns_first += 1ULL<zd_scanns_next; + abt_md::FNs **new_next_b = &_db.zd_scanns_head; + abt_md::FNs **new_next = prev ? new_next_a : new_next_b; + *new_next = next; + // if element is last, adjust list tail; otherwise, adjust next element's prev + abt_md::FNs **new_prev_a = &next->zd_scanns_prev; + abt_md::FNs **new_prev_b = &_db.zd_scanns_tail; + abt_md::FNs **new_prev = next ? new_prev_a : new_prev_b; + *new_prev = prev; + _db.zd_scanns_n--; + row.zd_scanns_next=(abt_md::FNs*)-1; // not-in-list } - // initialize hash table for abt_md::FNs; - _db.ind_ns_n = 0; // (abt_md.FDb.ind_ns) - _db.ind_ns_buckets_n = 4; // (abt_md.FDb.ind_ns) +} + +// --- abt_md.FDb.zd_scanns.RemoveAll +// Empty the index. (The rows are not deleted) +void abt_md::zd_scanns_RemoveAll() { + abt_md::FNs* row = _db.zd_scanns_head; + _db.zd_scanns_head = NULL; + _db.zd_scanns_tail = NULL; + _db.zd_scanns_n = 0; + while (row) { + abt_md::FNs* row_next = row->zd_scanns_next; + row->zd_scanns_next = (abt_md::FNs*)-1; + row->zd_scanns_prev = NULL; + row = row_next; + } +} + +// --- abt_md.FDb.zd_scanns.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +abt_md::FNs* abt_md::zd_scanns_RemoveFirst() { + abt_md::FNs *row = NULL; + row = _db.zd_scanns_head; + if (row) { + abt_md::FNs *next = row->zd_scanns_next; + _db.zd_scanns_head = next; + abt_md::FNs **new_end_a = &next->zd_scanns_prev; + abt_md::FNs **new_end_b = &_db.zd_scanns_tail; + abt_md::FNs **new_end = next ? new_end_a : new_end_b; + *new_end = NULL; + _db.zd_scanns_n--; + row->zd_scanns_next = (abt_md::FNs*)-1; // mark as not-in-list + } + return row; +} + +// --- abt_md.FDb.dispatch.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +abt_md::FDispatch& abt_md::dispatch_Alloc() { + abt_md::FDispatch* row = dispatch_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("abt_md.out_of_mem field:abt_md.FDb.dispatch comment:'Alloc failed'"); + } + return *row; +} + +// --- abt_md.FDb.dispatch.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +abt_md::FDispatch* abt_md::dispatch_AllocMaybe() { + abt_md::FDispatch *row = (abt_md::FDispatch*)dispatch_AllocMem(); + if (row) { + new (row) abt_md::FDispatch; // call constructor + } + return row; +} + +// --- abt_md.FDb.dispatch.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +abt_md::FDispatch* abt_md::dispatch_InsertMaybe(const dmmeta::Dispatch &value) { + abt_md::FDispatch *row = &dispatch_Alloc(); // if out of memory, process dies. if input error, return NULL. + dispatch_CopyIn(*row,const_cast(value)); + bool ok = dispatch_XrefMaybe(*row); // this may return false + if (!ok) { + dispatch_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- abt_md.FDb.dispatch.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* abt_md::dispatch_AllocMem() { + u64 new_nelems = _db.dispatch_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + dispatch_qFind(u64(n)).~FDispatch(); // destroy last element + _db.dispatch_n = i32(n); + } +} + +// --- abt_md.FDb.dispatch.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void abt_md::dispatch_RemoveLast() { + u64 n = _db.dispatch_n; + if (n > 0) { + n -= 1; + dispatch_qFind(u64(n)).~FDispatch(); + _db.dispatch_n = i32(n); + } +} + +// --- abt_md.FDb.dispatch.InputMaybe +static bool abt_md::dispatch_InputMaybe(dmmeta::Dispatch &elem) { + bool retval = true; + retval = dispatch_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- abt_md.FDb.dispatch.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool abt_md::dispatch_XrefMaybe(abt_md::FDispatch &row) { + bool retval = true; + (void)row; + // insert dispatch into index ind_dispatch + if (true) { // user-defined insert condition + bool success = ind_dispatch_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "abt_md.duplicate_key xref:abt_md.FDb.ind_dispatch"; // check for duplicate key + return false; + } + } + abt_md::FNs* p_ns = abt_md::ind_ns_Find(ns_Get(row)); + if (UNLIKELY(!p_ns)) { + algo_lib::ResetErrtext() << "abt_md.bad_xref index:abt_md.FDb.ind_ns" << Keyval("key", ns_Get(row)); + return false; + } + // insert dispatch into index c_dispatch + if (true) { // user-defined insert condition + c_dispatch_Insert(*p_ns, row); + } + return retval; +} + +// --- abt_md.FDb.ind_dispatch.Find +// Find row by key. Return NULL if not found. +abt_md::FDispatch* abt_md::ind_dispatch_Find(const algo::strptr& key) { + u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_dispatch_buckets_n - 1); + abt_md::FDispatch *ret = _db.ind_dispatch_buckets_elems[index]; + for (; ret && !((*ret).dispatch == key); ret = ret->ind_dispatch_next) { + } + return ret; +} + +// --- abt_md.FDb.ind_dispatch.FindX +// Look up row by key and return reference. Throw exception if not found +abt_md::FDispatch& abt_md::ind_dispatch_FindX(const algo::strptr& key) { + abt_md::FDispatch* ret = ind_dispatch_Find(key); + vrfy(ret, tempstr() << "abt_md.key_error table:ind_dispatch key:'"<ind_dispatch_next; + } while (true); + if (retval) { + row.ind_dispatch_next = *prev; + _db.ind_dispatch_n++; + *prev = &row; + } + } + return retval; +} + +// --- abt_md.FDb.ind_dispatch.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void abt_md::ind_dispatch_Remove(abt_md::FDispatch& row) { + if (LIKELY(row.ind_dispatch_next != (abt_md::FDispatch*)-1)) {// check if in hash already + u32 index = row.ind_dispatch_hashval & (_db.ind_dispatch_buckets_n - 1); + abt_md::FDispatch* *prev = &_db.ind_dispatch_buckets_elems[index]; // addr of pointer to current element + while (abt_md::FDispatch *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_dispatch_next; // unlink (singly linked list) + _db.ind_dispatch_n--; + row.ind_dispatch_next = (abt_md::FDispatch*)-1;// not-in-hash + break; + } + prev = &next->ind_dispatch_next; + } + } +} + +// --- abt_md.FDb.ind_dispatch.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void abt_md::ind_dispatch_Reserve(int n) { + ind_dispatch_AbsReserve(_db.ind_dispatch_n + n); +} + +// --- abt_md.FDb.ind_dispatch.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void abt_md::ind_dispatch_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_dispatch_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(abt_md::FDispatch*); + u32 new_size = new_nbuckets * sizeof(abt_md::FDispatch*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + abt_md::FDispatch* *new_buckets = (abt_md::FDispatch**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("abt_md.out_of_memory field:abt_md.FDb.ind_dispatch"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_dispatch_buckets_n; i++) { + abt_md::FDispatch* elem = _db.ind_dispatch_buckets_elems[i]; + while (elem) { + abt_md::FDispatch &row = *elem; + abt_md::FDispatch* next = row.ind_dispatch_next; + u32 index = row.ind_dispatch_hashval & (new_nbuckets-1); + row.ind_dispatch_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_dispatch_buckets_elems, old_size); + _db.ind_dispatch_buckets_elems = new_buckets; + _db.ind_dispatch_buckets_n = new_nbuckets; + } +} + +// --- abt_md.FDb.dispatch_msg.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +abt_md::FDispatchMsg& abt_md::dispatch_msg_Alloc() { + abt_md::FDispatchMsg* row = dispatch_msg_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("abt_md.out_of_mem field:abt_md.FDb.dispatch_msg comment:'Alloc failed'"); + } + return *row; +} + +// --- abt_md.FDb.dispatch_msg.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +abt_md::FDispatchMsg* abt_md::dispatch_msg_AllocMaybe() { + abt_md::FDispatchMsg *row = (abt_md::FDispatchMsg*)dispatch_msg_AllocMem(); + if (row) { + new (row) abt_md::FDispatchMsg; // call constructor + } + return row; +} + +// --- abt_md.FDb.dispatch_msg.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +abt_md::FDispatchMsg* abt_md::dispatch_msg_InsertMaybe(const dmmeta::DispatchMsg &value) { + abt_md::FDispatchMsg *row = &dispatch_msg_Alloc(); // if out of memory, process dies. if input error, return NULL. + dispatch_msg_CopyIn(*row,const_cast(value)); + bool ok = dispatch_msg_XrefMaybe(*row); // this may return false + if (!ok) { + dispatch_msg_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- abt_md.FDb.dispatch_msg.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* abt_md::dispatch_msg_AllocMem() { + u64 new_nelems = _db.dispatch_msg_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + dispatch_msg_qFind(u64(n)).~FDispatchMsg(); // destroy last element + _db.dispatch_msg_n = i32(n); + } +} + +// --- abt_md.FDb.dispatch_msg.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void abt_md::dispatch_msg_RemoveLast() { + u64 n = _db.dispatch_msg_n; + if (n > 0) { + n -= 1; + dispatch_msg_qFind(u64(n)).~FDispatchMsg(); + _db.dispatch_msg_n = i32(n); + } +} + +// --- abt_md.FDb.dispatch_msg.InputMaybe +static bool abt_md::dispatch_msg_InputMaybe(dmmeta::DispatchMsg &elem) { + bool retval = true; + retval = dispatch_msg_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- abt_md.FDb.dispatch_msg.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool abt_md::dispatch_msg_XrefMaybe(abt_md::FDispatchMsg &row) { + bool retval = true; + (void)row; + abt_md::FCtype* p_ctype = abt_md::ind_ctype_Find(ctype_Get(row)); + if (UNLIKELY(!p_ctype)) { + algo_lib::ResetErrtext() << "abt_md.bad_xref index:abt_md.FDb.ind_ctype" << Keyval("key", ctype_Get(row)); + return false; + } + // dispatch_msg: save pointer to ctype + if (true) { // user-defined insert condition + row.p_ctype = p_ctype; + } + abt_md::FDispatch* p_dispatch = abt_md::ind_dispatch_Find(dispatch_Get(row)); + if (UNLIKELY(!p_dispatch)) { + algo_lib::ResetErrtext() << "abt_md.bad_xref index:abt_md.FDb.ind_dispatch" << Keyval("key", dispatch_Get(row)); + return false; + } + // insert dispatch_msg into index c_dispatch_msg + if (true) { // user-defined insert condition + c_dispatch_msg_Insert(*p_dispatch, row); + } + return retval; +} + +// --- abt_md.FDb.trace.RowidFind +// find trace by row id (used to implement reflection) +static algo::ImrowPtr abt_md::trace_RowidFind(int t) { + return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +} + +// --- abt_md.FDb.trace.N +// Function return 1 +inline static i32 abt_md::trace_N() { + return 1; +} + +// --- abt_md.FDb.bh_file_section_curs.Add +static void abt_md::_db_bh_file_section_curs_Add(_db_bh_file_section_curs &curs, abt_md::FFileSection& row) { + u32 n = curs.temp_n; + int i = n; + curs.temp_n = n+1; + abt_md::FFileSection* *elems = curs.temp_elems; + while (i>0) { + int j = (i-1)/2; + abt_md::FFileSection* p = elems[j]; + if (!bh_file_section_ElemLt(row,*p)) { + break; + } + elems[i]=p; + i=j; + } + elems[i]=&row; +} + +// --- abt_md.FDb.bh_file_section_curs.Reserve +void abt_md::_db_bh_file_section_curs_Reserve(_db_bh_file_section_curs &curs, int n) { + if (n > curs.temp_max) { + size_t old_size = sizeof(void*) * curs.temp_max; + size_t new_size = sizeof(void*) * bh_file_section_N(); + curs.temp_elems = (abt_md::FFileSection**)algo_lib::malloc_ReallocMem(curs.temp_elems, old_size, new_size); + if (!curs.temp_elems) { + algo::FatalErrorExit("abt_md.cursor_out_of_memory func:abt_md.FDb.bh_file_section_curs.Reserve"); + } + curs.temp_max = bh_file_section_N(); + } +} + +// --- abt_md.FDb.bh_file_section_curs.Reset +// Reset cursor. If HEAP is non-empty, add its top element to CURS. +void abt_md::_db_bh_file_section_curs_Reset(_db_bh_file_section_curs &curs, abt_md::FDb &parent) { + curs.parent = &parent; + _db_bh_file_section_curs_Reserve(curs, bh_file_section_N()); + curs.temp_n = 0; + if (parent.bh_file_section_n > 0) { + abt_md::FFileSection &first = *parent.bh_file_section_elems[0]; + curs.temp_elems[0] = &first; // insert first element in heap + curs.temp_n = 1; + } +} + +// --- abt_md.FDb.bh_file_section_curs.Next +// Advance cursor. +void abt_md::_db_bh_file_section_curs_Next(_db_bh_file_section_curs &curs) { + abt_md::FFileSection* *elems = curs.temp_elems; + int n = curs.temp_n; + if (n > 0) { + // remove top element from heap + abt_md::FFileSection* dead = elems[0]; + int i = 0; + abt_md::FFileSection* last = curs.temp_elems[n-1]; + // downheap last elem + do { + abt_md::FFileSection* choose = last; + int l = i*2+1; + if (lbh_file_section_idx; + i = (index*2+1); + if (i < bh_file_section_N()) { + abt_md::FFileSection &elem = *curs.parent->bh_file_section_elems[i]; + _db_bh_file_section_curs_Add(curs, elem); + } + if (i+1 < bh_file_section_N()) { + abt_md::FFileSection &elem = *curs.parent->bh_file_section_elems[i + 1]; + _db_bh_file_section_curs_Add(curs, elem); + } + } +} + +// --- abt_md.FDb.ind_human_text_curs.Reset +void abt_md::_db_ind_human_text_curs_Reset(_db_ind_human_text_curs &curs, abt_md::FDb &parent) { + curs.bucket = 0; + curs.parent = &parent; + curs.prow = &parent.ind_human_text_buckets_elems[0]; // hash never has zero buckets + while (!*curs.prow) { + curs.bucket += 1; + if (curs.bucket == parent.ind_human_text_buckets_n) break; + curs.prow = &parent.ind_human_text_buckets_elems[curs.bucket]; + } +} + +// --- abt_md.FDb..Init +// Set all fields to initial values. +void abt_md::FDb_Init() { + // initialize LAry readmefile (abt_md.FDb.readmefile) + _db.readmefile_n = 0; + memset(_db.readmefile_lary, 0, sizeof(_db.readmefile_lary)); // zero out all level pointers + abt_md::FReadmefile* readmefile_first = (abt_md::FReadmefile*)algo_lib::malloc_AllocMem(sizeof(abt_md::FReadmefile) * (u64(1)<<4)); + if (!readmefile_first) { + FatalErrorExit("out of memory"); + } + for (int i = 0; i < 4; i++) { + _db.readmefile_lary[i] = readmefile_first; + readmefile_first += 1ULL<bh_dirent_idx = idx; + p->parent_bh_dirent_idx = idx; elems[idx] = p; idx = child; child = idx*2+1; @@ -5763,12 +6412,12 @@ static int abt_md::bh_dirent_Downheap(abt_md::FDirscan& parent, abt_md::FDirent& // --- abt_md.FDirscan.bh_dirent.Insert // Insert row. Row must not already be in index. If row is already in index, do nothing. void abt_md::bh_dirent_Insert(abt_md::FDirscan& parent, abt_md::FDirent& row) { - if (LIKELY(row.bh_dirent_idx == -1)) { + if (LIKELY(row.parent_bh_dirent_idx == -1)) { bh_dirent_Reserve(parent, 1); int n = parent.bh_dirent_n; parent.bh_dirent_n = n + 1; int new_idx = bh_dirent_Upheap(parent, row, n); - row.bh_dirent_idx = new_idx; + row.parent_bh_dirent_idx = new_idx; parent.bh_dirent_elems[new_idx] = &row; } } @@ -5777,7 +6426,7 @@ void abt_md::bh_dirent_Insert(abt_md::FDirscan& parent, abt_md::FDirent& row) { // If row is in heap, update its position. If row is not in heap, insert it. // Return new position of item in the heap (0=top) i32 abt_md::bh_dirent_Reheap(abt_md::FDirscan& parent, abt_md::FDirent& row) { - int old_idx = row.bh_dirent_idx; + int old_idx = row.parent_bh_dirent_idx; bool isnew = old_idx == -1; if (isnew) { bh_dirent_Reserve(parent, 1); @@ -5787,7 +6436,7 @@ i32 abt_md::bh_dirent_Reheap(abt_md::FDirscan& parent, abt_md::FDirent& row) { if (!isnew && new_idx == old_idx) { new_idx = bh_dirent_Downheap(parent, row, old_idx); } - row.bh_dirent_idx = new_idx; + row.parent_bh_dirent_idx = new_idx; parent.bh_dirent_elems[new_idx] = &row; return new_idx; } @@ -5800,7 +6449,7 @@ i32 abt_md::bh_dirent_Reheap(abt_md::FDirscan& parent, abt_md::FDirent& row) { i32 abt_md::bh_dirent_ReheapFirst(abt_md::FDirscan& parent) { abt_md::FDirent &row = *parent.bh_dirent_elems[0]; i32 new_idx = bh_dirent_Downheap(parent, row, 0); - row.bh_dirent_idx = new_idx; + row.parent_bh_dirent_idx = new_idx; parent.bh_dirent_elems[new_idx] = &row; return new_idx; } @@ -5809,9 +6458,9 @@ i32 abt_md::bh_dirent_ReheapFirst(abt_md::FDirscan& parent) { // Remove element from index. If element is not in index, do nothing. void abt_md::bh_dirent_Remove(abt_md::FDirscan& parent, abt_md::FDirent& row) { if (bh_dirent_InBheapQ(row)) { - int old_idx = row.bh_dirent_idx; + int old_idx = row.parent_bh_dirent_idx; if (parent.bh_dirent_elems[old_idx] == &row) { // sanity check: heap points back to row - row.bh_dirent_idx = -1; // mark not in heap + row.parent_bh_dirent_idx = -1; // mark not in heap i32 n = parent.bh_dirent_n - 1; // index of last element in heap parent.bh_dirent_n = n; // decrease count if (old_idx != n) { @@ -5820,7 +6469,7 @@ void abt_md::bh_dirent_Remove(abt_md::FDirscan& parent, abt_md::FDirent& row) { if (new_idx == old_idx) { new_idx = bh_dirent_Downheap(parent, *elem, old_idx); } - elem->bh_dirent_idx = new_idx; + elem->parent_bh_dirent_idx = new_idx; parent.bh_dirent_elems[new_idx] = elem; } } @@ -5832,7 +6481,7 @@ void abt_md::bh_dirent_Remove(abt_md::FDirscan& parent, abt_md::FDirent& row) { void abt_md::bh_dirent_RemoveAll(abt_md::FDirscan& parent) { int n = parent.bh_dirent_n; for (int i = n - 1; i>=0; i--) { - parent.bh_dirent_elems[i]->bh_dirent_idx = -1; // mark not-in-heap + parent.bh_dirent_elems[i]->parent_bh_dirent_idx = -1; // mark not-in-heap } parent.bh_dirent_n = 0; } @@ -5844,13 +6493,13 @@ abt_md::FDirent* abt_md::bh_dirent_RemoveFirst(abt_md::FDirscan& parent) { abt_md::FDirent *row = NULL; if (parent.bh_dirent_n > 0) { row = parent.bh_dirent_elems[0]; - row->bh_dirent_idx = -1; // mark not in heap + row->parent_bh_dirent_idx = -1; // mark not in heap i32 n = parent.bh_dirent_n - 1; // index of last element in heap parent.bh_dirent_n = n; // decrease count if (n) { abt_md::FDirent &elem = *parent.bh_dirent_elems[n]; int new_idx = bh_dirent_Downheap(parent, elem, 0); - elem.bh_dirent_idx = new_idx; + elem.parent_bh_dirent_idx = new_idx; parent.bh_dirent_elems[new_idx] = &elem; } } @@ -5885,7 +6534,7 @@ static int abt_md::bh_dirent_Upheap(abt_md::FDirscan& parent, abt_md::FDirent& r if (!bh_dirent_ElemLt(parent, row, *p)) { break; } - p->bh_dirent_idx = idx; + p->parent_bh_dirent_idx = idx; elems[idx] = p; idx = j; } @@ -6059,7 +6708,7 @@ void abt_md::FDirscan_bh_dirent_curs_Next(FDirscan_bh_dirent_curs &curs) { i = l; } while (i < n); curs.temp_n = n-1; - int index = dead->bh_dirent_idx; + int index = dead->parent_bh_dirent_idx; i = (index*2+1); if (i < bh_dirent_N((*curs.parent))) { abt_md::FDirent &elem = *curs.parent->bh_dirent_elems[i]; @@ -6109,6 +6758,175 @@ void abt_md::FDirscan_Uninit(abt_md::FDirscan& parent) { algo_lib::malloc_FreeMem((u8*)parent.bh_dirent_elems, sizeof(abt_md::FDirent*)*parent.bh_dirent_max); // (abt_md.FDirscan.bh_dirent) } +// --- abt_md.FDispatch.base.CopyOut +// Copy fields out of row +void abt_md::dispatch_CopyOut(abt_md::FDispatch &row, dmmeta::Dispatch &out) { + out.dispatch = row.dispatch; + out.unk = row.unk; + out.read = row.read; + out.print = row.print; + out.haslen = row.haslen; + out.call = row.call; + out.strict = row.strict; + out.dyn = row.dyn; + out.kafka = row.kafka; + out.comment = row.comment; +} + +// --- abt_md.FDispatch.base.CopyIn +// Copy fields in to row +void abt_md::dispatch_CopyIn(abt_md::FDispatch &row, dmmeta::Dispatch &in) { + row.dispatch = in.dispatch; + row.unk = in.unk; + row.read = in.read; + row.print = in.print; + row.haslen = in.haslen; + row.call = in.call; + row.strict = in.strict; + row.dyn = in.dyn; + row.kafka = in.kafka; + row.comment = in.comment; +} + +// --- abt_md.FDispatch.ns.Get +algo::Smallstr16 abt_md::ns_Get(abt_md::FDispatch& dispatch) { + algo::Smallstr16 ret(algo::Pathcomp(dispatch.dispatch, ".RL")); + return ret; +} + +// --- abt_md.FDispatch.name.Get +algo::Smallstr50 abt_md::name_Get(abt_md::FDispatch& dispatch) { + algo::Smallstr50 ret(algo::Pathcomp(dispatch.dispatch, ".RR")); + return ret; +} + +// --- abt_md.FDispatch.c_dispatch_msg.Insert +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +void abt_md::c_dispatch_msg_Insert(abt_md::FDispatch& dispatch, abt_md::FDispatchMsg& row) { + if (!row.dispatch_c_dispatch_msg_in_ary) { + c_dispatch_msg_Reserve(dispatch, 1); + u32 n = dispatch.c_dispatch_msg_n++; + dispatch.c_dispatch_msg_elems[n] = &row; + row.dispatch_c_dispatch_msg_in_ary = true; + } +} + +// --- abt_md.FDispatch.c_dispatch_msg.InsertMaybe +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +bool abt_md::c_dispatch_msg_InsertMaybe(abt_md::FDispatch& dispatch, abt_md::FDispatchMsg& row) { + bool retval = !dispatch_c_dispatch_msg_InAryQ(row); + c_dispatch_msg_Insert(dispatch,row); // check is performed in _Insert again + return retval; +} + +// --- abt_md.FDispatch.c_dispatch_msg.Remove +// Find element using linear scan. If element is in array, remove, otherwise do nothing +void abt_md::c_dispatch_msg_Remove(abt_md::FDispatch& dispatch, abt_md::FDispatchMsg& row) { + int n = dispatch.c_dispatch_msg_n; + if (bool_Update(row.dispatch_c_dispatch_msg_in_ary,false)) { + abt_md::FDispatchMsg* *elems = dispatch.c_dispatch_msg_elems; + // search backward, so that most recently added element is found first. + // if found, shift array. + for (int i = n-1; i>=0; i--) { + abt_md::FDispatchMsg* elem = elems[i]; // fetch element + if (elem == &row) { + int j = i + 1; + size_t nbytes = sizeof(abt_md::FDispatchMsg*) * (n - j); + memmove(elems + i, elems + j, nbytes); + dispatch.c_dispatch_msg_n = n - 1; + break; + } + } + } +} + +// --- abt_md.FDispatch.c_dispatch_msg.Reserve +// Reserve space in index for N more elements; +void abt_md::c_dispatch_msg_Reserve(abt_md::FDispatch& dispatch, u32 n) { + u32 old_max = dispatch.c_dispatch_msg_max; + if (UNLIKELY(dispatch.c_dispatch_msg_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(abt_md::FDispatchMsg*); + u32 new_size = new_max * sizeof(abt_md::FDispatchMsg*); + void *new_mem = algo_lib::malloc_ReallocMem(dispatch.c_dispatch_msg_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("abt_md.out_of_memory field:abt_md.FDispatch.c_dispatch_msg"); + } + dispatch.c_dispatch_msg_elems = (abt_md::FDispatchMsg**)new_mem; + dispatch.c_dispatch_msg_max = new_max; + } +} + +// --- abt_md.FDispatch..Init +// Set all fields to initial values. +void abt_md::FDispatch_Init(abt_md::FDispatch& dispatch) { + dispatch.unk = bool(false); + dispatch.read = bool(false); + dispatch.print = bool(false); + dispatch.haslen = bool(false); + dispatch.call = bool(false); + dispatch.strict = bool(false); + dispatch.dyn = bool(false); + dispatch.kafka = bool(false); + dispatch.c_dispatch_msg_elems = NULL; // (abt_md.FDispatch.c_dispatch_msg) + dispatch.c_dispatch_msg_n = 0; // (abt_md.FDispatch.c_dispatch_msg) + dispatch.c_dispatch_msg_max = 0; // (abt_md.FDispatch.c_dispatch_msg) + dispatch.ns_c_dispatch_in_ary = bool(false); + dispatch.ind_dispatch_next = (abt_md::FDispatch*)-1; // (abt_md.FDb.ind_dispatch) not-in-hash + dispatch.ind_dispatch_hashval = 0; // stored hash value +} + +// --- abt_md.FDispatch..Uninit +void abt_md::FDispatch_Uninit(abt_md::FDispatch& dispatch) { + abt_md::FDispatch &row = dispatch; (void)row; + ind_dispatch_Remove(row); // remove dispatch from index ind_dispatch + abt_md::FNs* p_ns = abt_md::ind_ns_Find(ns_Get(row)); + if (p_ns) { + c_dispatch_Remove(*p_ns, row);// remove dispatch from index c_dispatch + } + + // abt_md.FDispatch.c_dispatch_msg.Uninit (Ptrary) // + algo_lib::malloc_FreeMem(dispatch.c_dispatch_msg_elems, sizeof(abt_md::FDispatchMsg*)*dispatch.c_dispatch_msg_max); // (abt_md.FDispatch.c_dispatch_msg) +} + +// --- abt_md.FDispatchMsg.base.CopyOut +// Copy fields out of row +void abt_md::dispatch_msg_CopyOut(abt_md::FDispatchMsg &row, dmmeta::DispatchMsg &out) { + out.dispatch_msg = row.dispatch_msg; + out.comment = row.comment; +} + +// --- abt_md.FDispatchMsg.base.CopyIn +// Copy fields in to row +void abt_md::dispatch_msg_CopyIn(abt_md::FDispatchMsg &row, dmmeta::DispatchMsg &in) { + row.dispatch_msg = in.dispatch_msg; + row.comment = in.comment; +} + +// --- abt_md.FDispatchMsg.dispatch.Get +algo::Smallstr50 abt_md::dispatch_Get(abt_md::FDispatchMsg& dispatch_msg) { + algo::Smallstr50 ret(algo::Pathcomp(dispatch_msg.dispatch_msg, "/RL")); + return ret; +} + +// --- abt_md.FDispatchMsg.ctype.Get +algo::Smallstr100 abt_md::ctype_Get(abt_md::FDispatchMsg& dispatch_msg) { + algo::Smallstr100 ret(algo::Pathcomp(dispatch_msg.dispatch_msg, "/RR")); + return ret; +} + +// --- abt_md.FDispatchMsg..Uninit +void abt_md::FDispatchMsg_Uninit(abt_md::FDispatchMsg& dispatch_msg) { + abt_md::FDispatchMsg &row = dispatch_msg; (void)row; + abt_md::FDispatch* p_dispatch = abt_md::ind_dispatch_Find(dispatch_Get(row)); + if (p_dispatch) { + c_dispatch_msg_Remove(*p_dispatch, row);// remove dispatch_msg from index c_dispatch_msg + } +} + // --- abt_md.FFconst.base.CopyOut // Copy fields out of row void abt_md::fconst_CopyOut(abt_md::FFconst &row, dmmeta::Fconst &out) { @@ -6188,15 +7006,11 @@ algo::Smallstr50 abt_md::name_Get(abt_md::FField& field) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt_md::c_fconst_Insert(abt_md::FField& field, abt_md::FFconst& row) { - if (bool_Update(row.field_c_fconst_in_ary,true)) { - // reserve space + if (!row.field_c_fconst_in_ary) { c_fconst_Reserve(field, 1); - u32 n = field.c_fconst_n; - u32 at = n; - abt_md::FFconst* *elems = field.c_fconst_elems; - elems[at] = &row; - field.c_fconst_n = n+1; - + u32 n = field.c_fconst_n++; + field.c_fconst_elems[n] = &row; + row.field_c_fconst_in_ary = true; } } @@ -6205,7 +7019,7 @@ void abt_md::c_fconst_Insert(abt_md::FField& field, abt_md::FFconst& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool abt_md::c_fconst_InsertMaybe(abt_md::FField& field, abt_md::FFconst& row) { - bool retval = !row.field_c_fconst_in_ary; + bool retval = !field_c_fconst_InAryQ(row); c_fconst_Insert(field,row); // check is performed in _Insert again return retval; } @@ -6213,18 +7027,18 @@ bool abt_md::c_fconst_InsertMaybe(abt_md::FField& field, abt_md::FFconst& row) { // --- abt_md.FField.c_fconst.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt_md::c_fconst_Remove(abt_md::FField& field, abt_md::FFconst& row) { + int n = field.c_fconst_n; if (bool_Update(row.field_c_fconst_in_ary,false)) { - int lim = field.c_fconst_n; abt_md::FFconst* *elems = field.c_fconst_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { abt_md::FFconst* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt_md::FFconst*) * (lim - j); + size_t nbytes = sizeof(abt_md::FFconst*) * (n - j); memmove(elems + i, elems + j, nbytes); - field.c_fconst_n = lim - 1; + field.c_fconst_n = n - 1; break; } } @@ -6263,6 +7077,7 @@ void abt_md::FField_Init(abt_md::FField& field) { field.ctype_c_field_in_ary = bool(false); field.ctype_c_field_arg_in_ary = bool(false); field.ind_field_next = (abt_md::FField*)-1; // (abt_md.FDb.ind_field) not-in-hash + field.ind_field_hashval = 0; // stored hash value } // --- abt_md.FField..Uninit @@ -6292,6 +7107,41 @@ void abt_md::FFileSection_Uninit(abt_md::FFileSection& file_section) { } } +// --- abt_md.FFinput.base.CopyOut +// Copy fields out of row +void abt_md::finput_CopyOut(abt_md::FFinput &row, dmmeta::Finput &out) { + out.field = row.field; + out.extrn = row.extrn; + out.update = row.update; + out.strict = row.strict; + out.comment = row.comment; +} + +// --- abt_md.FFinput.base.CopyIn +// Copy fields in to row +void abt_md::finput_CopyIn(abt_md::FFinput &row, dmmeta::Finput &in) { + row.field = in.field; + row.extrn = in.extrn; + row.update = in.update; + row.strict = in.strict; + row.comment = in.comment; +} + +// --- abt_md.FFinput.ns.Get +algo::Smallstr16 abt_md::ns_Get(abt_md::FFinput& finput) { + algo::Smallstr16 ret(algo::Pathcomp(finput.field, ".LL")); + return ret; +} + +// --- abt_md.FFinput..Uninit +void abt_md::FFinput_Uninit(abt_md::FFinput& finput) { + abt_md::FFinput &row = finput; (void)row; + abt_md::FNs* p_ns = abt_md::ind_ns_Find(ns_Get(row)); + if (p_ns) { + zd_finput_Remove(*p_ns, row);// remove finput from index zd_finput + } +} + // --- abt_md.FGconst.base.CopyOut // Copy fields out of row void abt_md::gconst_CopyOut(abt_md::FGconst &row, dmmeta::Gconst &out) { @@ -6379,15 +7229,11 @@ void abt_md::ns_CopyIn(abt_md::FNs &row, dmmeta::Ns &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt_md::c_targsrc_Insert(abt_md::FNs& ns, abt_md::FTargsrc& row) { - if (bool_Update(row.ns_c_targsrc_in_ary,true)) { - // reserve space + if (!row.ns_c_targsrc_in_ary) { c_targsrc_Reserve(ns, 1); - u32 n = ns.c_targsrc_n; - u32 at = n; - abt_md::FTargsrc* *elems = ns.c_targsrc_elems; - elems[at] = &row; - ns.c_targsrc_n = n+1; - + u32 n = ns.c_targsrc_n++; + ns.c_targsrc_elems[n] = &row; + row.ns_c_targsrc_in_ary = true; } } @@ -6396,7 +7242,7 @@ void abt_md::c_targsrc_Insert(abt_md::FNs& ns, abt_md::FTargsrc& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool abt_md::c_targsrc_InsertMaybe(abt_md::FNs& ns, abt_md::FTargsrc& row) { - bool retval = !row.ns_c_targsrc_in_ary; + bool retval = !ns_c_targsrc_InAryQ(row); c_targsrc_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -6404,18 +7250,18 @@ bool abt_md::c_targsrc_InsertMaybe(abt_md::FNs& ns, abt_md::FTargsrc& row) { // --- abt_md.FNs.c_targsrc.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt_md::c_targsrc_Remove(abt_md::FNs& ns, abt_md::FTargsrc& row) { + int n = ns.c_targsrc_n; if (bool_Update(row.ns_c_targsrc_in_ary,false)) { - int lim = ns.c_targsrc_n; abt_md::FTargsrc* *elems = ns.c_targsrc_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { abt_md::FTargsrc* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt_md::FTargsrc*) * (lim - j); + size_t nbytes = sizeof(abt_md::FTargsrc*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_targsrc_n = lim - 1; + ns.c_targsrc_n = n - 1; break; } } @@ -6443,15 +7289,11 @@ void abt_md::c_targsrc_Reserve(abt_md::FNs& ns, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt_md::c_ctype_Insert(abt_md::FNs& ns, abt_md::FCtype& row) { - if (bool_Update(row.ns_c_ctype_in_ary,true)) { - // reserve space + if (!row.ns_c_ctype_in_ary) { c_ctype_Reserve(ns, 1); - u32 n = ns.c_ctype_n; - u32 at = n; - abt_md::FCtype* *elems = ns.c_ctype_elems; - elems[at] = &row; - ns.c_ctype_n = n+1; - + u32 n = ns.c_ctype_n++; + ns.c_ctype_elems[n] = &row; + row.ns_c_ctype_in_ary = true; } } @@ -6460,7 +7302,7 @@ void abt_md::c_ctype_Insert(abt_md::FNs& ns, abt_md::FCtype& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool abt_md::c_ctype_InsertMaybe(abt_md::FNs& ns, abt_md::FCtype& row) { - bool retval = !row.ns_c_ctype_in_ary; + bool retval = !ns_c_ctype_InAryQ(row); c_ctype_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -6468,18 +7310,18 @@ bool abt_md::c_ctype_InsertMaybe(abt_md::FNs& ns, abt_md::FCtype& row) { // --- abt_md.FNs.c_ctype.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt_md::c_ctype_Remove(abt_md::FNs& ns, abt_md::FCtype& row) { + int n = ns.c_ctype_n; if (bool_Update(row.ns_c_ctype_in_ary,false)) { - int lim = ns.c_ctype_n; abt_md::FCtype* *elems = ns.c_ctype_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { abt_md::FCtype* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt_md::FCtype*) * (lim - j); + size_t nbytes = sizeof(abt_md::FCtype*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_ctype_n = lim - 1; + ns.c_ctype_n = n - 1; break; } } @@ -6507,15 +7349,11 @@ void abt_md::c_ctype_Reserve(abt_md::FNs& ns, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt_md::c_comptest_Insert(abt_md::FNs& ns, abt_md::FComptest& row) { - if (bool_Update(row.ns_c_comptest_in_ary,true)) { - // reserve space + if (!row.ns_c_comptest_in_ary) { c_comptest_Reserve(ns, 1); - u32 n = ns.c_comptest_n; - u32 at = n; - abt_md::FComptest* *elems = ns.c_comptest_elems; - elems[at] = &row; - ns.c_comptest_n = n+1; - + u32 n = ns.c_comptest_n++; + ns.c_comptest_elems[n] = &row; + row.ns_c_comptest_in_ary = true; } } @@ -6524,7 +7362,7 @@ void abt_md::c_comptest_Insert(abt_md::FNs& ns, abt_md::FComptest& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool abt_md::c_comptest_InsertMaybe(abt_md::FNs& ns, abt_md::FComptest& row) { - bool retval = !row.ns_c_comptest_in_ary; + bool retval = !ns_c_comptest_InAryQ(row); c_comptest_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -6532,18 +7370,18 @@ bool abt_md::c_comptest_InsertMaybe(abt_md::FNs& ns, abt_md::FComptest& row) { // --- abt_md.FNs.c_comptest.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt_md::c_comptest_Remove(abt_md::FNs& ns, abt_md::FComptest& row) { + int n = ns.c_comptest_n; if (bool_Update(row.ns_c_comptest_in_ary,false)) { - int lim = ns.c_comptest_n; abt_md::FComptest* *elems = ns.c_comptest_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { abt_md::FComptest* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt_md::FComptest*) * (lim - j); + size_t nbytes = sizeof(abt_md::FComptest*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_comptest_n = lim - 1; + ns.c_comptest_n = n - 1; break; } } @@ -6567,10 +7405,172 @@ void abt_md::c_comptest_Reserve(abt_md::FNs& ns, u32 n) { } } +// --- abt_md.FNs.zd_finput.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void abt_md::zd_finput_Insert(abt_md::FNs& ns, abt_md::FFinput& row) { + if (!ns_zd_finput_InLlistQ(row)) { + abt_md::FFinput* old_tail = ns.zd_finput_tail; + row.ns_zd_finput_next = NULL; + row.ns_zd_finput_prev = old_tail; + ns.zd_finput_tail = &row; + abt_md::FFinput **new_row_a = &old_tail->ns_zd_finput_next; + abt_md::FFinput **new_row_b = &ns.zd_finput_head; + abt_md::FFinput **new_row = old_tail ? new_row_a : new_row_b; + *new_row = &row; + ns.zd_finput_n++; + } +} + +// --- abt_md.FNs.zd_finput.Remove +// Remove element from index. If element is not in index, do nothing. +void abt_md::zd_finput_Remove(abt_md::FNs& ns, abt_md::FFinput& row) { + if (ns_zd_finput_InLlistQ(row)) { + abt_md::FFinput* old_head = ns.zd_finput_head; + (void)old_head; // in case it's not used + abt_md::FFinput* prev = row.ns_zd_finput_prev; + abt_md::FFinput* next = row.ns_zd_finput_next; + // if element is first, adjust list head; otherwise, adjust previous element's next + abt_md::FFinput **new_next_a = &prev->ns_zd_finput_next; + abt_md::FFinput **new_next_b = &ns.zd_finput_head; + abt_md::FFinput **new_next = prev ? new_next_a : new_next_b; + *new_next = next; + // if element is last, adjust list tail; otherwise, adjust next element's prev + abt_md::FFinput **new_prev_a = &next->ns_zd_finput_prev; + abt_md::FFinput **new_prev_b = &ns.zd_finput_tail; + abt_md::FFinput **new_prev = next ? new_prev_a : new_prev_b; + *new_prev = prev; + ns.zd_finput_n--; + row.ns_zd_finput_next=(abt_md::FFinput*)-1; // not-in-list + } +} + +// --- abt_md.FNs.zd_finput.RemoveAll +// Empty the index. (The rows are not deleted) +void abt_md::zd_finput_RemoveAll(abt_md::FNs& ns) { + abt_md::FFinput* row = ns.zd_finput_head; + ns.zd_finput_head = NULL; + ns.zd_finput_tail = NULL; + ns.zd_finput_n = 0; + while (row) { + abt_md::FFinput* row_next = row->ns_zd_finput_next; + row->ns_zd_finput_next = (abt_md::FFinput*)-1; + row->ns_zd_finput_prev = NULL; + row = row_next; + } +} + +// --- abt_md.FNs.zd_finput.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +abt_md::FFinput* abt_md::zd_finput_RemoveFirst(abt_md::FNs& ns) { + abt_md::FFinput *row = NULL; + row = ns.zd_finput_head; + if (row) { + abt_md::FFinput *next = row->ns_zd_finput_next; + ns.zd_finput_head = next; + abt_md::FFinput **new_end_a = &next->ns_zd_finput_prev; + abt_md::FFinput **new_end_b = &ns.zd_finput_tail; + abt_md::FFinput **new_end = next ? new_end_a : new_end_b; + *new_end = NULL; + ns.zd_finput_n--; + row->ns_zd_finput_next = (abt_md::FFinput*)-1; // mark as not-in-list + } + return row; +} + +// --- abt_md.FNs.c_dispatch.Insert +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +void abt_md::c_dispatch_Insert(abt_md::FNs& ns, abt_md::FDispatch& row) { + if (!row.ns_c_dispatch_in_ary) { + c_dispatch_Reserve(ns, 1); + u32 n = ns.c_dispatch_n++; + ns.c_dispatch_elems[n] = &row; + row.ns_c_dispatch_in_ary = true; + } +} + +// --- abt_md.FNs.c_dispatch.InsertMaybe +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +bool abt_md::c_dispatch_InsertMaybe(abt_md::FNs& ns, abt_md::FDispatch& row) { + bool retval = !ns_c_dispatch_InAryQ(row); + c_dispatch_Insert(ns,row); // check is performed in _Insert again + return retval; +} + +// --- abt_md.FNs.c_dispatch.Remove +// Find element using linear scan. If element is in array, remove, otherwise do nothing +void abt_md::c_dispatch_Remove(abt_md::FNs& ns, abt_md::FDispatch& row) { + int n = ns.c_dispatch_n; + if (bool_Update(row.ns_c_dispatch_in_ary,false)) { + abt_md::FDispatch* *elems = ns.c_dispatch_elems; + // search backward, so that most recently added element is found first. + // if found, shift array. + for (int i = n-1; i>=0; i--) { + abt_md::FDispatch* elem = elems[i]; // fetch element + if (elem == &row) { + int j = i + 1; + size_t nbytes = sizeof(abt_md::FDispatch*) * (n - j); + memmove(elems + i, elems + j, nbytes); + ns.c_dispatch_n = n - 1; + break; + } + } + } +} + +// --- abt_md.FNs.c_dispatch.Reserve +// Reserve space in index for N more elements; +void abt_md::c_dispatch_Reserve(abt_md::FNs& ns, u32 n) { + u32 old_max = ns.c_dispatch_max; + if (UNLIKELY(ns.c_dispatch_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(abt_md::FDispatch*); + u32 new_size = new_max * sizeof(abt_md::FDispatch*); + void *new_mem = algo_lib::malloc_ReallocMem(ns.c_dispatch_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("abt_md.out_of_memory field:abt_md.FNs.c_dispatch"); + } + ns.c_dispatch_elems = (abt_md::FDispatch**)new_mem; + ns.c_dispatch_max = new_max; + } +} + +// --- abt_md.FNs..Init +// Set all fields to initial values. +void abt_md::FNs_Init(abt_md::FNs& ns) { + ns.c_readmefile = NULL; + ns.c_targsrc_elems = NULL; // (abt_md.FNs.c_targsrc) + ns.c_targsrc_n = 0; // (abt_md.FNs.c_targsrc) + ns.c_targsrc_max = 0; // (abt_md.FNs.c_targsrc) + ns.c_ctype_elems = NULL; // (abt_md.FNs.c_ctype) + ns.c_ctype_n = 0; // (abt_md.FNs.c_ctype) + ns.c_ctype_max = 0; // (abt_md.FNs.c_ctype) + ns.c_comptest_elems = NULL; // (abt_md.FNs.c_comptest) + ns.c_comptest_n = 0; // (abt_md.FNs.c_comptest) + ns.c_comptest_max = 0; // (abt_md.FNs.c_comptest) + ns.c_target = NULL; + ns.zd_finput_head = NULL; // (abt_md.FNs.zd_finput) + ns.zd_finput_n = 0; // (abt_md.FNs.zd_finput) + ns.zd_finput_tail = NULL; // (abt_md.FNs.zd_finput) + ns.c_dispatch_elems = NULL; // (abt_md.FNs.c_dispatch) + ns.c_dispatch_n = 0; // (abt_md.FNs.c_dispatch) + ns.c_dispatch_max = 0; // (abt_md.FNs.c_dispatch) + ns.ind_ns_next = (abt_md::FNs*)-1; // (abt_md.FDb.ind_ns) not-in-hash + ns.ind_ns_hashval = 0; // stored hash value + ns.zd_scanns_next = (abt_md::FNs*)-1; // (abt_md.FDb.zd_scanns) not-in-list + ns.zd_scanns_prev = NULL; // (abt_md.FDb.zd_scanns) +} + // --- abt_md.FNs..Uninit void abt_md::FNs_Uninit(abt_md::FNs& ns) { abt_md::FNs &row = ns; (void)row; ind_ns_Remove(row); // remove ns from index ind_ns + zd_scanns_Remove(row); // remove ns from index zd_scanns + + // abt_md.FNs.c_dispatch.Uninit (Ptrary) // + algo_lib::malloc_FreeMem(ns.c_dispatch_elems, sizeof(abt_md::FDispatch*)*ns.c_dispatch_max); // (abt_md.FNs.c_dispatch) // abt_md.FNs.c_comptest.Uninit (Ptrary) // algo_lib::malloc_FreeMem(ns.c_comptest_elems, sizeof(abt_md::FComptest*)*ns.c_comptest_max); // (abt_md.FNs.c_comptest) @@ -6602,9 +7602,9 @@ void abt_md::FNstype_Uninit(abt_md::FNstype& nstype) { ind_nstype_Remove(row); // remove nstype from index ind_nstype } -// --- abt_md.FReadme.base.CopyOut +// --- abt_md.FReadmefile.base.CopyOut // Copy fields out of row -void abt_md::readme_CopyOut(abt_md::FReadme &row, dev::Readme &out) { +void abt_md::readmefile_CopyOut(abt_md::FReadmefile &row, dev::Readmefile &out) { out.gitfile = row.gitfile; out.inl = row.inl; out.sandbox = row.sandbox; @@ -6612,9 +7612,9 @@ void abt_md::readme_CopyOut(abt_md::FReadme &row, dev::Readme &out) { out.comment = row.comment; } -// --- abt_md.FReadme.base.CopyIn +// --- abt_md.FReadmefile.base.CopyIn // Copy fields in to row -void abt_md::readme_CopyIn(abt_md::FReadme &row, dev::Readme &in) { +void abt_md::readmefile_CopyIn(abt_md::FReadmefile &row, dev::Readmefile &in) { row.gitfile = in.gitfile; row.inl = in.inl; row.sandbox = in.sandbox; @@ -6622,23 +7622,24 @@ void abt_md::readme_CopyIn(abt_md::FReadme &row, dev::Readme &in) { row.comment = in.comment; } -// --- abt_md.FReadme..Init +// --- abt_md.FReadmefile..Init // Set all fields to initial values. -void abt_md::FReadme_Init(abt_md::FReadme& readme) { - readme.inl = bool(false); - readme.sandbox = bool(false); - readme.p_ns = NULL; - readme.p_ssimfile = NULL; - readme.p_ctype = NULL; - readme.p_scriptfile = NULL; - readme.select = bool(false); - readme.ind_readme_next = (abt_md::FReadme*)-1; // (abt_md.FDb.ind_readme) not-in-hash +void abt_md::FReadmefile_Init(abt_md::FReadmefile& readmefile) { + readmefile.inl = bool(false); + readmefile.sandbox = bool(false); + readmefile.p_ns = NULL; + readmefile.p_ssimfile = NULL; + readmefile.p_ctype = NULL; + readmefile.p_scriptfile = NULL; + readmefile.select = bool(false); + readmefile.ind_readmefile_next = (abt_md::FReadmefile*)-1; // (abt_md.FDb.ind_readmefile) not-in-hash + readmefile.ind_readmefile_hashval = 0; // stored hash value } -// --- abt_md.FReadme..Uninit -void abt_md::FReadme_Uninit(abt_md::FReadme& readme) { - abt_md::FReadme &row = readme; (void)row; - ind_readme_Remove(row); // remove readme from index ind_readme +// --- abt_md.FReadmefile..Uninit +void abt_md::FReadmefile_Uninit(abt_md::FReadmefile& readmefile) { + abt_md::FReadmefile &row = readmefile; (void)row; + ind_readmefile_Remove(row); // remove readmefile from index ind_readmefile } // --- abt_md.FReadmesort.base.CopyOut @@ -6859,15 +7860,11 @@ void abt_md::target_CopyIn(abt_md::FTarget &row, dev::Target &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void abt_md::c_targdep_Insert(abt_md::FTarget& target, abt_md::FTargdep& row) { - if (bool_Update(row.target_c_targdep_in_ary,true)) { - // reserve space + if (!row.target_c_targdep_in_ary) { c_targdep_Reserve(target, 1); - u32 n = target.c_targdep_n; - u32 at = n; - abt_md::FTargdep* *elems = target.c_targdep_elems; - elems[at] = &row; - target.c_targdep_n = n+1; - + u32 n = target.c_targdep_n++; + target.c_targdep_elems[n] = &row; + row.target_c_targdep_in_ary = true; } } @@ -6876,7 +7873,7 @@ void abt_md::c_targdep_Insert(abt_md::FTarget& target, abt_md::FTargdep& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool abt_md::c_targdep_InsertMaybe(abt_md::FTarget& target, abt_md::FTargdep& row) { - bool retval = !row.target_c_targdep_in_ary; + bool retval = !target_c_targdep_InAryQ(row); c_targdep_Insert(target,row); // check is performed in _Insert again return retval; } @@ -6884,18 +7881,18 @@ bool abt_md::c_targdep_InsertMaybe(abt_md::FTarget& target, abt_md::FTargdep& ro // --- abt_md.FTarget.c_targdep.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void abt_md::c_targdep_Remove(abt_md::FTarget& target, abt_md::FTargdep& row) { + int n = target.c_targdep_n; if (bool_Update(row.target_c_targdep_in_ary,false)) { - int lim = target.c_targdep_n; abt_md::FTargdep* *elems = target.c_targdep_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { abt_md::FTargdep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(abt_md::FTargdep*) * (lim - j); + size_t nbytes = sizeof(abt_md::FTargdep*) * (n - j); memmove(elems + i, elems + j, nbytes); - target.c_targdep_n = lim - 1; + target.c_targdep_n = n - 1; break; } } @@ -7077,13 +8074,16 @@ const char* abt_md::value_ToCstr(const abt_md::TableId& parent) { switch(value_GetEnum(parent)) { case abt_md_TableId_atfdb_Comptest : ret = "atfdb.Comptest"; break; case abt_md_TableId_dmmeta_Ctype : ret = "dmmeta.Ctype"; break; + case abt_md_TableId_dmmeta_Dispatch: ret = "dmmeta.Dispatch"; break; + case abt_md_TableId_dmmeta_DispatchMsg: ret = "dmmeta.DispatchMsg"; break; case abt_md_TableId_dmmeta_Fconst : ret = "dmmeta.Fconst"; break; case abt_md_TableId_dmmeta_Field : ret = "dmmeta.Field"; break; + case abt_md_TableId_dmmeta_Finput : ret = "dmmeta.Finput"; break; case abt_md_TableId_dmmeta_Gconst : ret = "dmmeta.Gconst"; break; case abt_md_TableId_dmmeta_Gstatic : ret = "dmmeta.Gstatic"; break; case abt_md_TableId_dmmeta_Ns : ret = "dmmeta.Ns"; break; case abt_md_TableId_dmmeta_Nstype : ret = "dmmeta.Nstype"; break; - case abt_md_TableId_dev_Readme : ret = "dev.Readme"; break; + case abt_md_TableId_dev_Readmefile : ret = "dev.Readmefile"; break; case abt_md_TableId_dev_Readmesort : ret = "dev.Readmesort"; break; case abt_md_TableId_dmmeta_Reftype : ret = "dmmeta.Reftype"; break; case abt_md_TableId_dev_Scriptfile : ret = "dev.Scriptfile"; break; @@ -7131,18 +8131,10 @@ bool abt_md::value_SetStrptrMaybe(abt_md::TableId& parent, algo::strptr rhs) { } case 10: { switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('d','e','v','.','R','e','a','d'): { - if (memcmp(rhs.elems+8,"me",2)==0) { value_SetEnum(parent,abt_md_TableId_dev_Readme); ret = true; break; } - break; - } case LE_STR8('d','e','v','.','T','a','r','g'): { if (memcmp(rhs.elems+8,"et",2)==0) { value_SetEnum(parent,abt_md_TableId_dev_Target); ret = true; break; } break; } - case LE_STR8('d','e','v','.','r','e','a','d'): { - if (memcmp(rhs.elems+8,"me",2)==0) { value_SetEnum(parent,abt_md_TableId_dev_readme); ret = true; break; } - break; - } case LE_STR8('d','e','v','.','t','a','r','g'): { if (memcmp(rhs.elems+8,"et",2)==0) { value_SetEnum(parent,abt_md_TableId_dev_target); ret = true; break; } break; @@ -7198,6 +8190,7 @@ bool abt_md::value_SetStrptrMaybe(abt_md::TableId& parent, algo::strptr rhs) { switch (algo::ReadLE64(rhs.elems)) { case LE_STR8('d','m','m','e','t','a','.','F'): { if (memcmp(rhs.elems+8,"const",5)==0) { value_SetEnum(parent,abt_md_TableId_dmmeta_Fconst); ret = true; break; } + if (memcmp(rhs.elems+8,"input",5)==0) { value_SetEnum(parent,abt_md_TableId_dmmeta_Finput); ret = true; break; } break; } case LE_STR8('d','m','m','e','t','a','.','G'): { @@ -7214,6 +8207,7 @@ bool abt_md::value_SetStrptrMaybe(abt_md::TableId& parent, algo::strptr rhs) { } case LE_STR8('d','m','m','e','t','a','.','f'): { if (memcmp(rhs.elems+8,"const",5)==0) { value_SetEnum(parent,abt_md_TableId_dmmeta_fconst); ret = true; break; } + if (memcmp(rhs.elems+8,"input",5)==0) { value_SetEnum(parent,abt_md_TableId_dmmeta_finput); ret = true; break; } break; } case LE_STR8('d','m','m','e','t','a','.','g'): { @@ -7242,6 +8236,7 @@ bool abt_md::value_SetStrptrMaybe(abt_md::TableId& parent, algo::strptr rhs) { break; } case LE_STR8('d','e','v','.','R','e','a','d'): { + if (memcmp(rhs.elems+8,"mefile",6)==0) { value_SetEnum(parent,abt_md_TableId_dev_Readmefile); ret = true; break; } if (memcmp(rhs.elems+8,"mesort",6)==0) { value_SetEnum(parent,abt_md_TableId_dev_Readmesort); ret = true; break; } break; } @@ -7250,6 +8245,7 @@ bool abt_md::value_SetStrptrMaybe(abt_md::TableId& parent, algo::strptr rhs) { break; } case LE_STR8('d','e','v','.','r','e','a','d'): { + if (memcmp(rhs.elems+8,"mefile",6)==0) { value_SetEnum(parent,abt_md_TableId_dev_readmefile); ret = true; break; } if (memcmp(rhs.elems+8,"mesort",6)==0) { value_SetEnum(parent,abt_md_TableId_dev_readmesort); ret = true; break; } break; } @@ -7278,10 +8274,18 @@ bool abt_md::value_SetStrptrMaybe(abt_md::TableId& parent, algo::strptr rhs) { } case 15: { switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('d','m','m','e','t','a','.','D'): { + if (memcmp(rhs.elems+8,"ispatch",7)==0) { value_SetEnum(parent,abt_md_TableId_dmmeta_Dispatch); ret = true; break; } + break; + } case LE_STR8('d','m','m','e','t','a','.','S'): { if (memcmp(rhs.elems+8,"simfile",7)==0) { value_SetEnum(parent,abt_md_TableId_dmmeta_Ssimfile); ret = true; break; } break; } + case LE_STR8('d','m','m','e','t','a','.','d'): { + if (memcmp(rhs.elems+8,"ispatch",7)==0) { value_SetEnum(parent,abt_md_TableId_dmmeta_dispatch); ret = true; break; } + break; + } case LE_STR8('d','m','m','e','t','a','.','s'): { if (memcmp(rhs.elems+8,"simfile",7)==0) { value_SetEnum(parent,abt_md_TableId_dmmeta_ssimfile); ret = true; break; } break; @@ -7289,6 +8293,24 @@ bool abt_md::value_SetStrptrMaybe(abt_md::TableId& parent, algo::strptr rhs) { } break; } + case 18: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('d','m','m','e','t','a','.','D'): { + if (memcmp(rhs.elems+8,"ispatchMsg",10)==0) { value_SetEnum(parent,abt_md_TableId_dmmeta_DispatchMsg); ret = true; break; } + break; + } + } + break; + } + case 19: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('d','m','m','e','t','a','.','d'): { + if (memcmp(rhs.elems+8,"ispatch_msg",11)==0) { value_SetEnum(parent,abt_md_TableId_dmmeta_dispatch_msg); ret = true; break; } + break; + } + } + break; + } } return ret; } @@ -7340,12 +8362,13 @@ void abt_md::StaticCheck() { // --- abt_md...main int main(int argc, char **argv) { try { - algo_lib::FDb_Init(); lib_json::FDb_Init(); + algo_lib::FDb_Init(); abt_md::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock abt_md::ReadArgv(); // dmmeta.main:abt_md abt_md::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -7357,8 +8380,8 @@ int main(int argc, char **argv) { } try { abt_md::FDb_Uninit(); - lib_json::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/acr_compl_gen.cpp b/cpp/gen/acr_compl_gen.cpp index 15b46805..386e1413 100644 --- a/cpp/gen/acr_compl_gen.cpp +++ b/cpp/gen/acr_compl_gen.cpp @@ -31,12 +31,15 @@ #include "include/gen/dmmeta_gen.inl.h" #include "include/gen/command_gen.h" #include "include/gen/command_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep acr_compl::FDb acr_compl::_db; // dependency found via dev.targdep @@ -52,8 +55,8 @@ const char *acr_compl_help = " -type string \"9\" Simulates COMP_TYPE (debug)\n" " -install Produce bash commands to install the handler\n" " -debug_log string \"\" Log file for debug information, overrides ACR_COMPL_DEBUG_LOG\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -195,13 +198,14 @@ bool acr_compl::Badness_ReadFieldMaybe(acr_compl::Badness& parent, algo::strptr switch(field_id) { case acr_compl_FieldId_badness: { retval = badness_ReadStrptrMaybe(parent, strval); - break; - } + } break; case acr_compl_FieldId_strkey: { retval = algo::cstring_ReadStrptrMaybe(parent.strkey, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -250,13 +254,14 @@ bool acr_compl::Completion_ReadFieldMaybe(acr_compl::Completion& parent, algo::s switch(field_id) { case acr_compl_FieldId_value: { retval = algo::cstring_ReadStrptrMaybe(parent.value, strval); - break; - } + } break; case acr_compl_FieldId_nospace: { retval = bool_ReadStrptrMaybe(parent.nospace, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -374,25 +379,23 @@ bool acr_compl::FCompletion_ReadFieldMaybe(acr_compl::FCompletion& parent, algo: switch(field_id) { case acr_compl_FieldId_msghdr: { retval = false; - break; - } + } break; case acr_compl_FieldId_value: { retval = algo::cstring_ReadStrptrMaybe(parent.value, strval); - break; - } + } break; case acr_compl_FieldId_nospace: { retval = bool_ReadStrptrMaybe(parent.nospace, strval); - break; - } + } break; case acr_compl_FieldId_badness: { retval = acr_compl::Badness_ReadStrptrMaybe(parent.badness, strval); - break; - } + } break; case acr_compl_FieldId_field: { retval = false; - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -468,15 +471,11 @@ algo::Smallstr100 acr_compl::name_Get(acr_compl::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr_compl::c_field_Insert(acr_compl::FCtype& ctype, acr_compl::FField& row) { - if (bool_Update(row.ctype_c_field_in_ary,true)) { - // reserve space + if (!row.ctype_c_field_in_ary) { c_field_Reserve(ctype, 1); - u32 n = ctype.c_field_n; - u32 at = n; - acr_compl::FField* *elems = ctype.c_field_elems; - elems[at] = &row; - ctype.c_field_n = n+1; - + u32 n = ctype.c_field_n++; + ctype.c_field_elems[n] = &row; + row.ctype_c_field_in_ary = true; } } @@ -485,7 +484,7 @@ void acr_compl::c_field_Insert(acr_compl::FCtype& ctype, acr_compl::FField& row) // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool acr_compl::c_field_InsertMaybe(acr_compl::FCtype& ctype, acr_compl::FField& row) { - bool retval = !row.ctype_c_field_in_ary; + bool retval = !ctype_c_field_InAryQ(row); c_field_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -493,18 +492,18 @@ bool acr_compl::c_field_InsertMaybe(acr_compl::FCtype& ctype, acr_compl::FField& // --- acr_compl.FCtype.c_field.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr_compl::c_field_Remove(acr_compl::FCtype& ctype, acr_compl::FField& row) { + int n = ctype.c_field_n; if (bool_Update(row.ctype_c_field_in_ary,false)) { - int lim = ctype.c_field_n; acr_compl::FField* *elems = ctype.c_field_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { acr_compl::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(acr_compl::FField*) * (lim - j); + size_t nbytes = sizeof(acr_compl::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_field_n = lim - 1; + ctype.c_field_n = n - 1; break; } } @@ -635,9 +634,8 @@ void acr_compl::ReadArgv() { } if (ch_N(attrname) == 0) { err << "acr_compl: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -840,8 +841,8 @@ bool acr_compl::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && acr_compl::LoadTuplesFile(algo::SsimFname(root,"dmmeta.argvtype"),recursive); retval = retval && acr_compl::LoadTuplesFile(algo::SsimFname(root,"dmmeta.anonfld"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -971,6 +972,25 @@ algo::aryptr acr_compl::word_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- acr_compl.FDb.word.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr acr_compl::word_AllocNAt(int n_elems, int at) { + word_Reserve(n_elems); + int n = _db.word_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("acr_compl.bad_alloc_n_at field:acr_compl.FDb.word comment:'index out of range'"); + } + algo::cstring *elems = _db.word_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + _db.word_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- acr_compl.FDb.word.Remove // Remove item by index. If index outside of range, do nothing. void acr_compl::word_Remove(u32 i) { @@ -1047,6 +1067,30 @@ bool acr_compl::word_ReadStrptrMaybe(algo::strptr in_str) { return retval; } +// --- acr_compl.FDb.word.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void acr_compl::word_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.word_elems && rhs.elems < _db.word_elems + _db.word_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("acr_compl.tary_alias field:acr_compl.FDb.word comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.word_elems+1))) { + FatalErrorExit("acr_compl.bad_insary field:acr_compl.FDb.word comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.word_n - at; + word_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.word_elems + at + nnew + i) algo::cstring(_db.word_elems[at + i]); + _db.word_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.word_elems + at + i) algo::cstring(rhs[i]); + } + _db.word_n += nnew; +} + // --- acr_compl.FDb.ctype.Alloc // Allocate memory for new default row. // If out of memory, process is killed. @@ -1148,14 +1192,9 @@ bool acr_compl::ctype_XrefMaybe(acr_compl::FCtype &row) { // Find row by key. Return NULL if not found. acr_compl::FCtype* acr_compl::ind_ctype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctype_buckets_n - 1); - acr_compl::FCtype* *e = &_db.ind_ctype_buckets_elems[index]; - acr_compl::FCtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctype_next; - } while (true); + acr_compl::FCtype *ret = _db.ind_ctype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctype_next) { + } return ret; } @@ -1179,10 +1218,11 @@ acr_compl::FCtype& acr_compl::ind_ctype_GetOrCreate(const algo::strptr& key) { // --- acr_compl.FDb.ind_ctype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_compl::ind_ctype_InsertMaybe(acr_compl::FCtype& row) { - ind_ctype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ctype_next == (acr_compl::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + row.ind_ctype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctype_Reserve(1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); acr_compl::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; do { acr_compl::FCtype* ret = *prev; @@ -1208,7 +1248,7 @@ bool acr_compl::ind_ctype_InsertMaybe(acr_compl::FCtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_compl::ind_ctype_Remove(acr_compl::FCtype& row) { if (LIKELY(row.ind_ctype_next != (acr_compl::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); acr_compl::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; // addr of pointer to current element while (acr_compl::FCtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1225,8 +1265,14 @@ void acr_compl::ind_ctype_Remove(acr_compl::FCtype& row) { // --- acr_compl.FDb.ind_ctype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_compl::ind_ctype_Reserve(int n) { + ind_ctype_AbsReserve(_db.ind_ctype_n + n); +} + +// --- acr_compl.FDb.ind_ctype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_compl::ind_ctype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ctype_buckets_n; - u32 new_nelems = _db.ind_ctype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1245,7 +1291,7 @@ void acr_compl::ind_ctype_Reserve(int n) { while (elem) { acr_compl::FCtype &row = *elem; acr_compl::FCtype* next = row.ind_ctype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ctype_hashval & (new_nbuckets-1); row.ind_ctype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1381,24 +1427,20 @@ bool acr_compl::field_XrefMaybe(acr_compl::FField &row) { // Find row by key. Return NULL if not found. acr_compl::FField* acr_compl::ind_field_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_field_buckets_n - 1); - acr_compl::FField* *e = &_db.ind_field_buckets_elems[index]; - acr_compl::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + acr_compl::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_field_next) { + } return ret; } // --- acr_compl.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_compl::ind_field_InsertMaybe(acr_compl::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (acr_compl::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::Smallstr100_Hash(0, row.field); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); acr_compl::FField* *prev = &_db.ind_field_buckets_elems[index]; do { acr_compl::FField* ret = *prev; @@ -1424,7 +1466,7 @@ bool acr_compl::ind_field_InsertMaybe(acr_compl::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_compl::ind_field_Remove(acr_compl::FField& row) { if (LIKELY(row.ind_field_next != (acr_compl::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); acr_compl::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (acr_compl::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1441,8 +1483,14 @@ void acr_compl::ind_field_Remove(acr_compl::FField& row) { // --- acr_compl.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_compl::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- acr_compl.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_compl::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1461,7 +1509,7 @@ void acr_compl::ind_field_Reserve(int n) { while (elem) { acr_compl::FField &row = *elem; acr_compl::FField* next = row.ind_field_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1593,24 +1641,20 @@ bool acr_compl::ssimfile_XrefMaybe(acr_compl::FSsimfile &row) { // Find row by key. Return NULL if not found. acr_compl::FSsimfile* acr_compl::ind_ssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimfile_buckets_n - 1); - acr_compl::FSsimfile* *e = &_db.ind_ssimfile_buckets_elems[index]; - acr_compl::FSsimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimfile_next; - } while (true); + acr_compl::FSsimfile *ret = _db.ind_ssimfile_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimfile_next) { + } return ret; } // --- acr_compl.FDb.ind_ssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_compl::ind_ssimfile_InsertMaybe(acr_compl::FSsimfile& row) { - ind_ssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimfile_next == (acr_compl::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + row.ind_ssimfile_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimfile_Reserve(1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); acr_compl::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; do { acr_compl::FSsimfile* ret = *prev; @@ -1636,7 +1680,7 @@ bool acr_compl::ind_ssimfile_InsertMaybe(acr_compl::FSsimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_compl::ind_ssimfile_Remove(acr_compl::FSsimfile& row) { if (LIKELY(row.ind_ssimfile_next != (acr_compl::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); acr_compl::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; // addr of pointer to current element while (acr_compl::FSsimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1653,8 +1697,14 @@ void acr_compl::ind_ssimfile_Remove(acr_compl::FSsimfile& row) { // --- acr_compl.FDb.ind_ssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_compl::ind_ssimfile_Reserve(int n) { + ind_ssimfile_AbsReserve(_db.ind_ssimfile_n + n); +} + +// --- acr_compl.FDb.ind_ssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_compl::ind_ssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimfile_buckets_n; - u32 new_nelems = _db.ind_ssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1673,7 +1723,7 @@ void acr_compl::ind_ssimfile_Reserve(int n) { while (elem) { acr_compl::FSsimfile &row = *elem; acr_compl::FSsimfile* next = row.ind_ssimfile_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimfile_hashval & (new_nbuckets-1); row.ind_ssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2590,14 +2640,9 @@ acr_compl::FField* acr_compl::zd_cmd_field_RemoveFirst() { // Find row by key. Return NULL if not found. acr_compl::FNs* acr_compl::ind_ns_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_ns_buckets_n - 1); - acr_compl::FNs* *e = &_db.ind_ns_buckets_elems[index]; - acr_compl::FNs* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ns == key; - if (done) break; - e = &ret->ind_ns_next; - } while (true); + acr_compl::FNs *ret = _db.ind_ns_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_ns_next) { + } return ret; } @@ -2621,10 +2666,11 @@ acr_compl::FNs& acr_compl::ind_ns_GetOrCreate(const algo::strptr& key) { // --- acr_compl.FDb.ind_ns.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_compl::ind_ns_InsertMaybe(acr_compl::FNs& row) { - ind_ns_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ns_next == (acr_compl::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + row.ind_ns_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_ns_Reserve(1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); acr_compl::FNs* *prev = &_db.ind_ns_buckets_elems[index]; do { acr_compl::FNs* ret = *prev; @@ -2650,7 +2696,7 @@ bool acr_compl::ind_ns_InsertMaybe(acr_compl::FNs& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_compl::ind_ns_Remove(acr_compl::FNs& row) { if (LIKELY(row.ind_ns_next != (acr_compl::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); acr_compl::FNs* *prev = &_db.ind_ns_buckets_elems[index]; // addr of pointer to current element while (acr_compl::FNs *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2667,8 +2713,14 @@ void acr_compl::ind_ns_Remove(acr_compl::FNs& row) { // --- acr_compl.FDb.ind_ns.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_compl::ind_ns_Reserve(int n) { + ind_ns_AbsReserve(_db.ind_ns_n + n); +} + +// --- acr_compl.FDb.ind_ns.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_compl::ind_ns_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ns_buckets_n; - u32 new_nelems = _db.ind_ns_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2687,7 +2739,7 @@ void acr_compl::ind_ns_Reserve(int n) { while (elem) { acr_compl::FNs &row = *elem; acr_compl::FNs* next = row.ind_ns_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_ns_hashval & (new_nbuckets-1); row.ind_ns_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2704,24 +2756,20 @@ void acr_compl::ind_ns_Reserve(int n) { // Find row by key. Return NULL if not found. acr_compl::FField* acr_compl::ind_cmd_field_name_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_cmd_field_name_buckets_n - 1); - acr_compl::FField* *e = &_db.ind_cmd_field_name_buckets_elems[index]; - acr_compl::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || name_Get((*ret)) == key; - if (done) break; - e = &ret->ind_cmd_field_name_next; - } while (true); + acr_compl::FField *ret = _db.ind_cmd_field_name_buckets_elems[index]; + for (; ret && !(name_Get((*ret)) == key); ret = ret->ind_cmd_field_name_next) { + } return ret; } // --- acr_compl.FDb.ind_cmd_field_name.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_compl::ind_cmd_field_name_InsertMaybe(acr_compl::FField& row) { - ind_cmd_field_name_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_cmd_field_name_next == (acr_compl::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, name_Get(row)) & (_db.ind_cmd_field_name_buckets_n - 1); + row.ind_cmd_field_name_hashval = algo::Smallstr50_Hash(0, name_Get(row)); + ind_cmd_field_name_Reserve(1); + u32 index = row.ind_cmd_field_name_hashval & (_db.ind_cmd_field_name_buckets_n - 1); acr_compl::FField* *prev = &_db.ind_cmd_field_name_buckets_elems[index]; if (retval) { row.ind_cmd_field_name_next = *prev; @@ -2736,7 +2784,7 @@ bool acr_compl::ind_cmd_field_name_InsertMaybe(acr_compl::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_compl::ind_cmd_field_name_Remove(acr_compl::FField& row) { if (LIKELY(row.ind_cmd_field_name_next != (acr_compl::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, name_Get(row)) & (_db.ind_cmd_field_name_buckets_n - 1); + u32 index = row.ind_cmd_field_name_hashval & (_db.ind_cmd_field_name_buckets_n - 1); acr_compl::FField* *prev = &_db.ind_cmd_field_name_buckets_elems[index]; // addr of pointer to current element while (acr_compl::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2753,8 +2801,14 @@ void acr_compl::ind_cmd_field_name_Remove(acr_compl::FField& row) { // --- acr_compl.FDb.ind_cmd_field_name.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_compl::ind_cmd_field_name_Reserve(int n) { + ind_cmd_field_name_AbsReserve(_db.ind_cmd_field_name_n + n); +} + +// --- acr_compl.FDb.ind_cmd_field_name.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_compl::ind_cmd_field_name_AbsReserve(int n) { u32 old_nbuckets = _db.ind_cmd_field_name_buckets_n; - u32 new_nelems = _db.ind_cmd_field_name_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2773,7 +2827,7 @@ void acr_compl::ind_cmd_field_name_Reserve(int n) { while (elem) { acr_compl::FField &row = *elem; acr_compl::FField* next = row.ind_cmd_field_name_next; - u32 index = algo::Smallstr50_Hash(0, name_Get(row)) & (new_nbuckets-1); + u32 index = row.ind_cmd_field_name_hashval & (new_nbuckets-1); row.ind_cmd_field_name_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3631,15 +3685,11 @@ algo::Smallstr50 acr_compl::name_Get(acr_compl::FField& field) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr_compl::c_fconst_Insert(acr_compl::FField& field, acr_compl::FFconst& row) { - if (bool_Update(row.field_c_fconst_in_ary,true)) { - // reserve space + if (!row.field_c_fconst_in_ary) { c_fconst_Reserve(field, 1); - u32 n = field.c_fconst_n; - u32 at = n; - acr_compl::FFconst* *elems = field.c_fconst_elems; - elems[at] = &row; - field.c_fconst_n = n+1; - + u32 n = field.c_fconst_n++; + field.c_fconst_elems[n] = &row; + row.field_c_fconst_in_ary = true; } } @@ -3648,7 +3698,7 @@ void acr_compl::c_fconst_Insert(acr_compl::FField& field, acr_compl::FFconst& ro // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool acr_compl::c_fconst_InsertMaybe(acr_compl::FField& field, acr_compl::FFconst& row) { - bool retval = !row.field_c_fconst_in_ary; + bool retval = !field_c_fconst_InAryQ(row); c_fconst_Insert(field,row); // check is performed in _Insert again return retval; } @@ -3656,18 +3706,18 @@ bool acr_compl::c_fconst_InsertMaybe(acr_compl::FField& field, acr_compl::FFcons // --- acr_compl.FField.c_fconst.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr_compl::c_fconst_Remove(acr_compl::FField& field, acr_compl::FFconst& row) { + int n = field.c_fconst_n; if (bool_Update(row.field_c_fconst_in_ary,false)) { - int lim = field.c_fconst_n; acr_compl::FFconst* *elems = field.c_fconst_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { acr_compl::FFconst* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(acr_compl::FFconst*) * (lim - j); + size_t nbytes = sizeof(acr_compl::FFconst*) * (n - j); memmove(elems + i, elems + j, nbytes); - field.c_fconst_n = lim - 1; + field.c_fconst_n = n - 1; break; } } @@ -3695,14 +3745,9 @@ void acr_compl::c_fconst_Reserve(acr_compl::FField& field, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr_compl::c_falias_srcfield_Insert(acr_compl::FField& field, acr_compl::FFalias& row) { - // reserve space c_falias_srcfield_Reserve(field, 1); - u32 n = field.c_falias_srcfield_n; - u32 at = n; - acr_compl::FFalias* *elems = field.c_falias_srcfield_elems; - elems[at] = &row; - field.c_falias_srcfield_n = n+1; - + u32 n = field.c_falias_srcfield_n++; + field.c_falias_srcfield_elems[n] = &row; } // --- acr_compl.FField.c_falias_srcfield.ScanInsertMaybe @@ -3731,20 +3776,18 @@ bool acr_compl::c_falias_srcfield_ScanInsertMaybe(acr_compl::FField& field, acr_ // --- acr_compl.FField.c_falias_srcfield.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr_compl::c_falias_srcfield_Remove(acr_compl::FField& field, acr_compl::FFalias& row) { - int lim = field.c_falias_srcfield_n; - acr_compl::FFalias* *elems = field.c_falias_srcfield_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - acr_compl::FFalias* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr_compl::FFalias*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - field.c_falias_srcfield_n = lim - 1; - break; + int n = field.c_falias_srcfield_n; + int j=0; + for (int i=0; izs_value_next; + acr_dm::FValue **new_row_a = &old_tail->attr_zs_value_next; acr_dm::FValue **new_row_b = &attr.zs_value_head; acr_dm::FValue **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -107,13 +110,13 @@ void acr_dm::zs_value_Insert(acr_dm::FAttr& attr, acr_dm::FValue& row) { // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. void acr_dm::zs_value_Remove(acr_dm::FAttr& attr, acr_dm::FValue& row) { - if (zs_value_InLlistQ(row)) { + if (attr_zs_value_InLlistQ(row)) { acr_dm::FValue* old_head = attr.zs_value_head; (void)old_head; // in case it's not used acr_dm::FValue* prev=NULL; acr_dm::FValue* cur = attr.zs_value_head; while (cur) { // search for element by pointer - acr_dm::FValue* next = cur->zs_value_next; + acr_dm::FValue* next = cur->attr_zs_value_next; if (cur == &row) { attr.zs_value_n--; // adjust count @@ -122,11 +125,11 @@ void acr_dm::zs_value_Remove(acr_dm::FAttr& attr, acr_dm::FValue& row) { } // disconnect element from linked list if (prev) { - prev->zs_value_next = next; + prev->attr_zs_value_next = next; } else { attr.zs_value_head = next; } - row.zs_value_next = (acr_dm::FValue*)-1; // not-in-list + row.attr_zs_value_next = (acr_dm::FValue*)-1; // not-in-list break; } prev = cur; @@ -143,8 +146,8 @@ void acr_dm::zs_value_RemoveAll(acr_dm::FAttr& attr) { attr.zs_value_tail = NULL; attr.zs_value_n = 0; while (row) { - acr_dm::FValue* row_next = row->zs_value_next; - row->zs_value_next = (acr_dm::FValue*)-1; + acr_dm::FValue* row_next = row->attr_zs_value_next; + row->attr_zs_value_next = (acr_dm::FValue*)-1; row = row_next; } } @@ -155,14 +158,14 @@ acr_dm::FValue* acr_dm::zs_value_RemoveFirst(acr_dm::FAttr& attr) { acr_dm::FValue *row = NULL; row = attr.zs_value_head; if (row) { - acr_dm::FValue *next = row->zs_value_next; + acr_dm::FValue *next = row->attr_zs_value_next; attr.zs_value_head = next; // clear list's tail pointer if list is empty. if (!next) { attr.zs_value_tail = NULL; } attr.zs_value_n--; - row->zs_value_next = (acr_dm::FValue*)-1; // mark as not-in-list + row->attr_zs_value_next = (acr_dm::FValue*)-1; // mark as not-in-list } return row; } @@ -271,9 +274,8 @@ void acr_dm::ReadArgv() { } if (ch_N(attrname) == 0) { err << "acr_dm: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:acr_dm.FDb.cmdline @@ -327,7 +332,7 @@ void acr_dm::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -394,8 +399,8 @@ bool acr_dm::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && acr_dm::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -552,14 +557,9 @@ bool acr_dm::tuple_XrefMaybe(acr_dm::FTuple &row) { // Find row by key. Return NULL if not found. acr_dm::FTuple* acr_dm::ind_tuple_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_tuple_buckets_n - 1); - acr_dm::FTuple* *e = &_db.ind_tuple_buckets_elems[index]; - acr_dm::FTuple* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).key == key; - if (done) break; - e = &ret->ind_tuple_next; - } while (true); + acr_dm::FTuple *ret = _db.ind_tuple_buckets_elems[index]; + for (; ret && !((*ret).key == key); ret = ret->ind_tuple_next) { + } return ret; } @@ -591,10 +591,11 @@ acr_dm::FTuple& acr_dm::ind_tuple_GetOrCreate(const algo::strptr& key) { // --- acr_dm.FDb.ind_tuple.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_dm::ind_tuple_InsertMaybe(acr_dm::FTuple& row) { - ind_tuple_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_tuple_next == (acr_dm::FTuple*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.key) & (_db.ind_tuple_buckets_n - 1); + row.ind_tuple_hashval = algo::cstring_Hash(0, row.key); + ind_tuple_Reserve(1); + u32 index = row.ind_tuple_hashval & (_db.ind_tuple_buckets_n - 1); acr_dm::FTuple* *prev = &_db.ind_tuple_buckets_elems[index]; do { acr_dm::FTuple* ret = *prev; @@ -620,7 +621,7 @@ bool acr_dm::ind_tuple_InsertMaybe(acr_dm::FTuple& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_dm::ind_tuple_Remove(acr_dm::FTuple& row) { if (LIKELY(row.ind_tuple_next != (acr_dm::FTuple*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.key) & (_db.ind_tuple_buckets_n - 1); + u32 index = row.ind_tuple_hashval & (_db.ind_tuple_buckets_n - 1); acr_dm::FTuple* *prev = &_db.ind_tuple_buckets_elems[index]; // addr of pointer to current element while (acr_dm::FTuple *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -637,8 +638,14 @@ void acr_dm::ind_tuple_Remove(acr_dm::FTuple& row) { // --- acr_dm.FDb.ind_tuple.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_dm::ind_tuple_Reserve(int n) { + ind_tuple_AbsReserve(_db.ind_tuple_n + n); +} + +// --- acr_dm.FDb.ind_tuple.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_dm::ind_tuple_AbsReserve(int n) { u32 old_nbuckets = _db.ind_tuple_buckets_n; - u32 new_nelems = _db.ind_tuple_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -657,7 +664,7 @@ void acr_dm::ind_tuple_Reserve(int n) { while (elem) { acr_dm::FTuple &row = *elem; acr_dm::FTuple* next = row.ind_tuple_next; - u32 index = algo::cstring_Hash(0, row.key) & (new_nbuckets-1); + u32 index = row.ind_tuple_hashval & (new_nbuckets-1); row.ind_tuple_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1196,17 +1203,17 @@ bool acr_dm::Rowid_ReadFieldMaybe(acr_dm::Rowid& parent, algo::strptr field, alg switch(field_id) { case acr_dm_FieldId_f1: { retval = i32_ReadStrptrMaybe(parent.f1, strval); - break; - } + } break; case acr_dm_FieldId_f2: { retval = i32_ReadStrptrMaybe(parent.f2, strval); - break; - } + } break; case acr_dm_FieldId_f3: { retval = i32_ReadStrptrMaybe(parent.f3, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1243,30 +1250,14 @@ void acr_dm::Rowid_Print(acr_dm::Rowid& row, algo::cstring& str) { i32_Print(row.f3, str); } -// --- acr_dm.Source.source_bitcurs.Next -// proceed to next item -void acr_dm::Source_source_bitcurs_Next(Source_source_bitcurs &curs) { - ++curs.bit; - int index = curs.bit / 8; - int offset = curs.bit % 8; - for (; index < curs.n_elems; ++index, offset = 0) { - u64 rest = curs.elems[index] >> offset; - if (rest) { - offset += algo::u64_BitScanForward(rest); - break; - } - } - curs.bit = index * 8 + offset; -} - // --- acr_dm.FTuple.zs_attr.Insert // Insert row into linked list. If row is already in linked list, do nothing. void acr_dm::zs_attr_Insert(acr_dm::FTuple& tuple, acr_dm::FAttr& row) { - if (!zs_attr_InLlistQ(row)) { + if (!tuple_zs_attr_InLlistQ(row)) { acr_dm::FAttr* old_tail = tuple.zs_attr_tail; - row.zs_attr_next = NULL; + row.tuple_zs_attr_next = NULL; tuple.zs_attr_tail = &row; - acr_dm::FAttr **new_row_a = &old_tail->zs_attr_next; + acr_dm::FAttr **new_row_a = &old_tail->tuple_zs_attr_next; acr_dm::FAttr **new_row_b = &tuple.zs_attr_head; acr_dm::FAttr **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -1278,13 +1269,13 @@ void acr_dm::zs_attr_Insert(acr_dm::FTuple& tuple, acr_dm::FAttr& row) { // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. void acr_dm::zs_attr_Remove(acr_dm::FTuple& tuple, acr_dm::FAttr& row) { - if (zs_attr_InLlistQ(row)) { + if (tuple_zs_attr_InLlistQ(row)) { acr_dm::FAttr* old_head = tuple.zs_attr_head; (void)old_head; // in case it's not used acr_dm::FAttr* prev=NULL; acr_dm::FAttr* cur = tuple.zs_attr_head; while (cur) { // search for element by pointer - acr_dm::FAttr* next = cur->zs_attr_next; + acr_dm::FAttr* next = cur->tuple_zs_attr_next; if (cur == &row) { tuple.zs_attr_n--; // adjust count @@ -1293,11 +1284,11 @@ void acr_dm::zs_attr_Remove(acr_dm::FTuple& tuple, acr_dm::FAttr& row) { } // disconnect element from linked list if (prev) { - prev->zs_attr_next = next; + prev->tuple_zs_attr_next = next; } else { tuple.zs_attr_head = next; } - row.zs_attr_next = (acr_dm::FAttr*)-1; // not-in-list + row.tuple_zs_attr_next = (acr_dm::FAttr*)-1; // not-in-list break; } prev = cur; @@ -1314,8 +1305,8 @@ void acr_dm::zs_attr_RemoveAll(acr_dm::FTuple& tuple) { tuple.zs_attr_tail = NULL; tuple.zs_attr_n = 0; while (row) { - acr_dm::FAttr* row_next = row->zs_attr_next; - row->zs_attr_next = (acr_dm::FAttr*)-1; + acr_dm::FAttr* row_next = row->tuple_zs_attr_next; + row->tuple_zs_attr_next = (acr_dm::FAttr*)-1; row = row_next; } } @@ -1326,14 +1317,14 @@ acr_dm::FAttr* acr_dm::zs_attr_RemoveFirst(acr_dm::FTuple& tuple) { acr_dm::FAttr *row = NULL; row = tuple.zs_attr_head; if (row) { - acr_dm::FAttr *next = row->zs_attr_next; + acr_dm::FAttr *next = row->tuple_zs_attr_next; tuple.zs_attr_head = next; // clear list's tail pointer if list is empty. if (!next) { tuple.zs_attr_tail = NULL; } tuple.zs_attr_n--; - row->zs_attr_next = (acr_dm::FAttr*)-1; // mark as not-in-list + row->tuple_zs_attr_next = (acr_dm::FAttr*)-1; // mark as not-in-list } return row; } @@ -1459,11 +1450,13 @@ void acr_dm::StaticCheck() { // --- acr_dm...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); acr_dm::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock acr_dm::ReadArgv(); // dmmeta.main:acr_dm acr_dm::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -1476,6 +1469,7 @@ int main(int argc, char **argv) { try { acr_dm::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/acr_ed_gen.cpp b/cpp/gen/acr_ed_gen.cpp index 2fa9e8f7..52cae691 100644 --- a/cpp/gen/acr_ed_gen.cpp +++ b/cpp/gen/acr_ed_gen.cpp @@ -33,18 +33,18 @@ #include "include/gen/command_gen.inl.h" #include "include/gen/dev_gen.h" #include "include/gen/dev_gen.inl.h" -#include "include/gen/algo_lib_gen.h" -#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_json_gen.h" #include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order -algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_json::FDb lib_json::_db; // dependency found via dev.targdep +algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep acr_ed::FDb acr_ed::_db; // dependency found via dev.targdep namespace acr_ed { @@ -97,8 +97,9 @@ const char *acr_ed_help = " -showcpp (With -sandbox), show resulting diff\n" " -msgtype string \"\" (with -ctype) use this msgtype as type\n" " -anonfld Create anonfld\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -amc Y Run amc if needed\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -108,13 +109,11 @@ const char *acr_ed_help = } // namespace acr_ed namespace acr_ed { // gen:ns_gsymbol const char* atfdb_cijob_comp("comp"); - const char* atfdb_cijob_cov("cov"); + const char* atfdb_cijob_coverage("coverage"); const char* atfdb_cijob_memcheck("memcheck"); const char* atfdb_cijob_normalize("normalize"); } // gen:ns_gsymbol namespace acr_ed { // gen:ns_gsymbol - const algo::strptr dev_package_amc("amc"); - const algo::strptr dev_package_apm("apm"); const algo::strptr dev_package_openacr("openacr"); } // gen:ns_gsymbol namespace acr_ed { // gen:ns_print_proto @@ -155,6 +154,8 @@ namespace acr_ed { // gen:ns_print_proto static void edaction_LoadStatic() __attribute__((nothrow)); // func:acr_ed.FDb.gitfile.InputMaybe static bool gitfile_InputMaybe(dev::Gitfile &elem) __attribute__((nothrow)); + // func:acr_ed.FDb.msgtype.InputMaybe + static bool msgtype_InputMaybe(dmmeta::Msgtype &elem) __attribute__((nothrow)); // find trace by row id (used to implement reflection) // func:acr_ed.FDb.trace.RowidFind static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); @@ -292,15 +293,11 @@ algo::Smallstr100 acr_ed::name_Get(acr_ed::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr_ed::c_field_Insert(acr_ed::FCtype& ctype, acr_ed::FField& row) { - if (bool_Update(row.ctype_c_field_in_ary,true)) { - // reserve space + if (!row.ctype_c_field_in_ary) { c_field_Reserve(ctype, 1); - u32 n = ctype.c_field_n; - u32 at = n; - acr_ed::FField* *elems = ctype.c_field_elems; - elems[at] = &row; - ctype.c_field_n = n+1; - + u32 n = ctype.c_field_n++; + ctype.c_field_elems[n] = &row; + row.ctype_c_field_in_ary = true; } } @@ -309,7 +306,7 @@ void acr_ed::c_field_Insert(acr_ed::FCtype& ctype, acr_ed::FField& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool acr_ed::c_field_InsertMaybe(acr_ed::FCtype& ctype, acr_ed::FField& row) { - bool retval = !row.ctype_c_field_in_ary; + bool retval = !ctype_c_field_InAryQ(row); c_field_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -317,18 +314,18 @@ bool acr_ed::c_field_InsertMaybe(acr_ed::FCtype& ctype, acr_ed::FField& row) { // --- acr_ed.FCtype.c_field.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr_ed::c_field_Remove(acr_ed::FCtype& ctype, acr_ed::FField& row) { + int n = ctype.c_field_n; if (bool_Update(row.ctype_c_field_in_ary,false)) { - int lim = ctype.c_field_n; acr_ed::FField* *elems = ctype.c_field_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { acr_ed::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(acr_ed::FField*) * (lim - j); + size_t nbytes = sizeof(acr_ed::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_field_n = lim - 1; + ctype.c_field_n = n - 1; break; } } @@ -356,14 +353,9 @@ void acr_ed::c_field_Reserve(acr_ed::FCtype& ctype, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr_ed::c_cfmt_Insert(acr_ed::FCtype& ctype, acr_ed::FCfmt& row) { - // reserve space c_cfmt_Reserve(ctype, 1); - u32 n = ctype.c_cfmt_n; - u32 at = n; - acr_ed::FCfmt* *elems = ctype.c_cfmt_elems; - elems[at] = &row; - ctype.c_cfmt_n = n+1; - + u32 n = ctype.c_cfmt_n++; + ctype.c_cfmt_elems[n] = &row; } // --- acr_ed.FCtype.c_cfmt.ScanInsertMaybe @@ -392,20 +384,18 @@ bool acr_ed::c_cfmt_ScanInsertMaybe(acr_ed::FCtype& ctype, acr_ed::FCfmt& row) { // --- acr_ed.FCtype.c_cfmt.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr_ed::c_cfmt_Remove(acr_ed::FCtype& ctype, acr_ed::FCfmt& row) { - int lim = ctype.c_cfmt_n; - acr_ed::FCfmt* *elems = ctype.c_cfmt_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - acr_ed::FCfmt* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr_ed::FCfmt*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - ctype.c_cfmt_n = lim - 1; - break; + int n = ctype.c_cfmt_n; + int j=0; + for (int i=0; iind_ns_next; - } while (true); + acr_ed::FNs *ret = _db.ind_ns_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_ns_next) { + } return ret; } @@ -638,10 +624,11 @@ acr_ed::FNs& acr_ed::ind_ns_GetOrCreate(const algo::strptr& key) { // --- acr_ed.FDb.ind_ns.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_ed::ind_ns_InsertMaybe(acr_ed::FNs& row) { - ind_ns_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ns_next == (acr_ed::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + row.ind_ns_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_ns_Reserve(1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); acr_ed::FNs* *prev = &_db.ind_ns_buckets_elems[index]; do { acr_ed::FNs* ret = *prev; @@ -667,7 +654,7 @@ bool acr_ed::ind_ns_InsertMaybe(acr_ed::FNs& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_ed::ind_ns_Remove(acr_ed::FNs& row) { if (LIKELY(row.ind_ns_next != (acr_ed::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); acr_ed::FNs* *prev = &_db.ind_ns_buckets_elems[index]; // addr of pointer to current element while (acr_ed::FNs *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -684,8 +671,14 @@ void acr_ed::ind_ns_Remove(acr_ed::FNs& row) { // --- acr_ed.FDb.ind_ns.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_ed::ind_ns_Reserve(int n) { + ind_ns_AbsReserve(_db.ind_ns_n + n); +} + +// --- acr_ed.FDb.ind_ns.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_ed::ind_ns_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ns_buckets_n; - u32 new_nelems = _db.ind_ns_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -704,7 +697,7 @@ void acr_ed::ind_ns_Reserve(int n) { while (elem) { acr_ed::FNs &row = *elem; acr_ed::FNs* next = row.ind_ns_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_ns_hashval & (new_nbuckets-1); row.ind_ns_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -786,9 +779,8 @@ void acr_ed::ReadArgv() { } if (ch_N(attrname) == 0) { err << "acr_ed: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:acr_ed.FDb.cmdline @@ -842,7 +837,7 @@ void acr_ed::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -887,7 +882,7 @@ static void acr_ed::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'acr_ed.Input' signature:'042948d5ec028115be9d280cd8fe64e20bae7485'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'acr_ed.Input' signature:'c33981549fb661085a0bfba14529630cc4312242'"); } // --- acr_ed.FDb._db.InsertStrptrMaybe @@ -994,6 +989,12 @@ bool acr_ed::InsertStrptrMaybe(algo::strptr str) { retval = retval && gitfile_InputMaybe(elem); break; } + case acr_ed_TableId_dmmeta_Msgtype: { // finput:acr_ed.FDb.msgtype + dmmeta::Msgtype elem; + retval = dmmeta::Msgtype_ReadStrptrMaybe(elem, str); + retval = retval && msgtype_InputMaybe(elem); + break; + } default: break; } //switch @@ -1012,7 +1013,6 @@ bool acr_ed::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (root == "-") { retval = acr_ed::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); } else if (DirectoryQ(root)) { - retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dev.gitfile"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.ns"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.ctype"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.field"),recursive); @@ -1020,6 +1020,7 @@ bool acr_ed::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.nsdb"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.ssimfile"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.pack"),recursive); + retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.msgtype"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.fprefix"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.listtype"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); @@ -1027,11 +1028,12 @@ bool acr_ed::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.cpptype"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dmmeta.cfmt"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dev.target"),recursive); + retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dev.gitfile"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dev.targsrc"),recursive); retval = retval && acr_ed::LoadTuplesFile(algo::SsimFname(root,"dev.sbpath"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -1231,14 +1233,9 @@ bool acr_ed::field_XrefMaybe(acr_ed::FField &row) { // Find row by key. Return NULL if not found. acr_ed::FField* acr_ed::ind_field_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_field_buckets_n - 1); - acr_ed::FField* *e = &_db.ind_field_buckets_elems[index]; - acr_ed::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + acr_ed::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_field_next) { + } return ret; } @@ -1253,10 +1250,11 @@ acr_ed::FField& acr_ed::ind_field_FindX(const algo::strptr& key) { // --- acr_ed.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_ed::ind_field_InsertMaybe(acr_ed::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (acr_ed::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::Smallstr100_Hash(0, row.field); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); acr_ed::FField* *prev = &_db.ind_field_buckets_elems[index]; do { acr_ed::FField* ret = *prev; @@ -1282,7 +1280,7 @@ bool acr_ed::ind_field_InsertMaybe(acr_ed::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_ed::ind_field_Remove(acr_ed::FField& row) { if (LIKELY(row.ind_field_next != (acr_ed::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); acr_ed::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (acr_ed::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1299,8 +1297,14 @@ void acr_ed::ind_field_Remove(acr_ed::FField& row) { // --- acr_ed.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_ed::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- acr_ed.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_ed::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1319,7 +1323,7 @@ void acr_ed::ind_field_Reserve(int n) { while (elem) { acr_ed::FField &row = *elem; acr_ed::FField* next = row.ind_field_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1442,14 +1446,9 @@ bool acr_ed::ctype_XrefMaybe(acr_ed::FCtype &row) { // Find row by key. Return NULL if not found. acr_ed::FCtype* acr_ed::ind_ctype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctype_buckets_n - 1); - acr_ed::FCtype* *e = &_db.ind_ctype_buckets_elems[index]; - acr_ed::FCtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctype_next; - } while (true); + acr_ed::FCtype *ret = _db.ind_ctype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctype_next) { + } return ret; } @@ -1464,10 +1463,11 @@ acr_ed::FCtype& acr_ed::ind_ctype_FindX(const algo::strptr& key) { // --- acr_ed.FDb.ind_ctype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_ed::ind_ctype_InsertMaybe(acr_ed::FCtype& row) { - ind_ctype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ctype_next == (acr_ed::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + row.ind_ctype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctype_Reserve(1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); acr_ed::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; do { acr_ed::FCtype* ret = *prev; @@ -1493,7 +1493,7 @@ bool acr_ed::ind_ctype_InsertMaybe(acr_ed::FCtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_ed::ind_ctype_Remove(acr_ed::FCtype& row) { if (LIKELY(row.ind_ctype_next != (acr_ed::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); acr_ed::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; // addr of pointer to current element while (acr_ed::FCtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1510,8 +1510,14 @@ void acr_ed::ind_ctype_Remove(acr_ed::FCtype& row) { // --- acr_ed.FDb.ind_ctype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_ed::ind_ctype_Reserve(int n) { + ind_ctype_AbsReserve(_db.ind_ctype_n + n); +} + +// --- acr_ed.FDb.ind_ctype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_ed::ind_ctype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ctype_buckets_n; - u32 new_nelems = _db.ind_ctype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1530,7 +1536,7 @@ void acr_ed::ind_ctype_Reserve(int n) { while (elem) { acr_ed::FCtype &row = *elem; acr_ed::FCtype* next = row.ind_ctype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ctype_hashval & (new_nbuckets-1); row.ind_ctype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1671,14 +1677,9 @@ bool acr_ed::ssimfile_XrefMaybe(acr_ed::FSsimfile &row) { // Find row by key. Return NULL if not found. acr_ed::FSsimfile* acr_ed::ind_ssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimfile_buckets_n - 1); - acr_ed::FSsimfile* *e = &_db.ind_ssimfile_buckets_elems[index]; - acr_ed::FSsimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimfile_next; - } while (true); + acr_ed::FSsimfile *ret = _db.ind_ssimfile_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimfile_next) { + } return ret; } @@ -1693,10 +1694,11 @@ acr_ed::FSsimfile& acr_ed::ind_ssimfile_FindX(const algo::strptr& key) { // --- acr_ed.FDb.ind_ssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_ed::ind_ssimfile_InsertMaybe(acr_ed::FSsimfile& row) { - ind_ssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimfile_next == (acr_ed::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + row.ind_ssimfile_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimfile_Reserve(1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); acr_ed::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; do { acr_ed::FSsimfile* ret = *prev; @@ -1722,7 +1724,7 @@ bool acr_ed::ind_ssimfile_InsertMaybe(acr_ed::FSsimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_ed::ind_ssimfile_Remove(acr_ed::FSsimfile& row) { if (LIKELY(row.ind_ssimfile_next != (acr_ed::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); acr_ed::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; // addr of pointer to current element while (acr_ed::FSsimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1739,8 +1741,14 @@ void acr_ed::ind_ssimfile_Remove(acr_ed::FSsimfile& row) { // --- acr_ed.FDb.ind_ssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_ed::ind_ssimfile_Reserve(int n) { + ind_ssimfile_AbsReserve(_db.ind_ssimfile_n + n); +} + +// --- acr_ed.FDb.ind_ssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_ed::ind_ssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimfile_buckets_n; - u32 new_nelems = _db.ind_ssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1759,7 +1767,7 @@ void acr_ed::ind_ssimfile_Reserve(int n) { while (elem) { acr_ed::FSsimfile &row = *elem; acr_ed::FSsimfile* next = row.ind_ssimfile_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimfile_hashval & (new_nbuckets-1); row.ind_ssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1936,6 +1944,25 @@ algo::aryptr acr_ed::vis_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- acr_ed.FDb.vis.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr acr_ed::vis_AllocNAt(int n_elems, int at) { + vis_Reserve(n_elems); + int n = _db.vis_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("acr_ed.bad_alloc_n_at field:acr_ed.FDb.vis comment:'index out of range'"); + } + algo::cstring *elems = _db.vis_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + _db.vis_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- acr_ed.FDb.vis.Remove // Remove item by index. If index outside of range, do nothing. void acr_ed::vis_Remove(u32 i) { @@ -2012,6 +2039,30 @@ bool acr_ed::vis_ReadStrptrMaybe(algo::strptr in_str) { return retval; } +// --- acr_ed.FDb.vis.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void acr_ed::vis_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.vis_elems && rhs.elems < _db.vis_elems + _db.vis_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("acr_ed.tary_alias field:acr_ed.FDb.vis comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.vis_elems+1))) { + FatalErrorExit("acr_ed.bad_insary field:acr_ed.FDb.vis comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.vis_n - at; + vis_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.vis_elems + at + nnew + i) algo::cstring(_db.vis_elems[at + i]); + _db.vis_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.vis_elems + at + i) algo::cstring(rhs[i]); + } + _db.vis_n += nnew; +} + // --- acr_ed.FDb.listtype.Alloc // Allocate memory for new default row. // If out of memory, process is killed. @@ -2113,14 +2164,9 @@ bool acr_ed::listtype_XrefMaybe(acr_ed::FListtype &row) { // Find row by key. Return NULL if not found. acr_ed::FListtype* acr_ed::ind_listtype_Find(const algo::strptr& key) { u32 index = algo::Smallstr5_Hash(0, key) & (_db.ind_listtype_buckets_n - 1); - acr_ed::FListtype* *e = &_db.ind_listtype_buckets_elems[index]; - acr_ed::FListtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).listtype == key; - if (done) break; - e = &ret->ind_listtype_next; - } while (true); + acr_ed::FListtype *ret = _db.ind_listtype_buckets_elems[index]; + for (; ret && !((*ret).listtype == key); ret = ret->ind_listtype_next) { + } return ret; } @@ -2152,10 +2198,11 @@ acr_ed::FListtype& acr_ed::ind_listtype_GetOrCreate(const algo::strptr& key) { // --- acr_ed.FDb.ind_listtype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_ed::ind_listtype_InsertMaybe(acr_ed::FListtype& row) { - ind_listtype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_listtype_next == (acr_ed::FListtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr5_Hash(0, row.listtype) & (_db.ind_listtype_buckets_n - 1); + row.ind_listtype_hashval = algo::Smallstr5_Hash(0, row.listtype); + ind_listtype_Reserve(1); + u32 index = row.ind_listtype_hashval & (_db.ind_listtype_buckets_n - 1); acr_ed::FListtype* *prev = &_db.ind_listtype_buckets_elems[index]; do { acr_ed::FListtype* ret = *prev; @@ -2181,7 +2228,7 @@ bool acr_ed::ind_listtype_InsertMaybe(acr_ed::FListtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_ed::ind_listtype_Remove(acr_ed::FListtype& row) { if (LIKELY(row.ind_listtype_next != (acr_ed::FListtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr5_Hash(0, row.listtype) & (_db.ind_listtype_buckets_n - 1); + u32 index = row.ind_listtype_hashval & (_db.ind_listtype_buckets_n - 1); acr_ed::FListtype* *prev = &_db.ind_listtype_buckets_elems[index]; // addr of pointer to current element while (acr_ed::FListtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2198,8 +2245,14 @@ void acr_ed::ind_listtype_Remove(acr_ed::FListtype& row) { // --- acr_ed.FDb.ind_listtype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_ed::ind_listtype_Reserve(int n) { + ind_listtype_AbsReserve(_db.ind_listtype_n + n); +} + +// --- acr_ed.FDb.ind_listtype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_ed::ind_listtype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_listtype_buckets_n; - u32 new_nelems = _db.ind_listtype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2218,7 +2271,7 @@ void acr_ed::ind_listtype_Reserve(int n) { while (elem) { acr_ed::FListtype &row = *elem; acr_ed::FListtype* next = row.ind_listtype_next; - u32 index = algo::Smallstr5_Hash(0, row.listtype) & (new_nbuckets-1); + u32 index = row.ind_listtype_hashval & (new_nbuckets-1); row.ind_listtype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2332,14 +2385,9 @@ bool acr_ed::fprefix_XrefMaybe(acr_ed::FFprefix &row) { // Find row by key. Return NULL if not found. acr_ed::FFprefix* acr_ed::ind_fprefix_Find(const algo::strptr& key) { u32 index = algo::Smallstr5_Hash(0, key) & (_db.ind_fprefix_buckets_n - 1); - acr_ed::FFprefix* *e = &_db.ind_fprefix_buckets_elems[index]; - acr_ed::FFprefix* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).fprefix == key; - if (done) break; - e = &ret->ind_fprefix_next; - } while (true); + acr_ed::FFprefix *ret = _db.ind_fprefix_buckets_elems[index]; + for (; ret && !((*ret).fprefix == key); ret = ret->ind_fprefix_next) { + } return ret; } @@ -2371,10 +2419,11 @@ acr_ed::FFprefix& acr_ed::ind_fprefix_GetOrCreate(const algo::strptr& key) { // --- acr_ed.FDb.ind_fprefix.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_ed::ind_fprefix_InsertMaybe(acr_ed::FFprefix& row) { - ind_fprefix_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fprefix_next == (acr_ed::FFprefix*)-1)) {// check if in hash already - u32 index = algo::Smallstr5_Hash(0, row.fprefix) & (_db.ind_fprefix_buckets_n - 1); + row.ind_fprefix_hashval = algo::Smallstr5_Hash(0, row.fprefix); + ind_fprefix_Reserve(1); + u32 index = row.ind_fprefix_hashval & (_db.ind_fprefix_buckets_n - 1); acr_ed::FFprefix* *prev = &_db.ind_fprefix_buckets_elems[index]; do { acr_ed::FFprefix* ret = *prev; @@ -2400,7 +2449,7 @@ bool acr_ed::ind_fprefix_InsertMaybe(acr_ed::FFprefix& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_ed::ind_fprefix_Remove(acr_ed::FFprefix& row) { if (LIKELY(row.ind_fprefix_next != (acr_ed::FFprefix*)-1)) {// check if in hash already - u32 index = algo::Smallstr5_Hash(0, row.fprefix) & (_db.ind_fprefix_buckets_n - 1); + u32 index = row.ind_fprefix_hashval & (_db.ind_fprefix_buckets_n - 1); acr_ed::FFprefix* *prev = &_db.ind_fprefix_buckets_elems[index]; // addr of pointer to current element while (acr_ed::FFprefix *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2417,8 +2466,14 @@ void acr_ed::ind_fprefix_Remove(acr_ed::FFprefix& row) { // --- acr_ed.FDb.ind_fprefix.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_ed::ind_fprefix_Reserve(int n) { + ind_fprefix_AbsReserve(_db.ind_fprefix_n + n); +} + +// --- acr_ed.FDb.ind_fprefix.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_ed::ind_fprefix_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fprefix_buckets_n; - u32 new_nelems = _db.ind_fprefix_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2437,7 +2492,7 @@ void acr_ed::ind_fprefix_Reserve(int n) { while (elem) { acr_ed::FFprefix &row = *elem; acr_ed::FFprefix* next = row.ind_fprefix_next; - u32 index = algo::Smallstr5_Hash(0, row.fprefix) & (new_nbuckets-1); + u32 index = row.ind_fprefix_hashval & (new_nbuckets-1); row.ind_fprefix_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2560,14 +2615,9 @@ bool acr_ed::target_XrefMaybe(acr_ed::FTarget &row) { // Find row by key. Return NULL if not found. acr_ed::FTarget* acr_ed::ind_target_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_target_buckets_n - 1); - acr_ed::FTarget* *e = &_db.ind_target_buckets_elems[index]; - acr_ed::FTarget* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).target == key; - if (done) break; - e = &ret->ind_target_next; - } while (true); + acr_ed::FTarget *ret = _db.ind_target_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_target_next) { + } return ret; } @@ -2582,10 +2632,11 @@ acr_ed::FTarget& acr_ed::ind_target_FindX(const algo::strptr& key) { // --- acr_ed.FDb.ind_target.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_ed::ind_target_InsertMaybe(acr_ed::FTarget& row) { - ind_target_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_target_next == (acr_ed::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + row.ind_target_hashval = algo::Smallstr16_Hash(0, row.target); + ind_target_Reserve(1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); acr_ed::FTarget* *prev = &_db.ind_target_buckets_elems[index]; do { acr_ed::FTarget* ret = *prev; @@ -2611,7 +2662,7 @@ bool acr_ed::ind_target_InsertMaybe(acr_ed::FTarget& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_ed::ind_target_Remove(acr_ed::FTarget& row) { if (LIKELY(row.ind_target_next != (acr_ed::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); acr_ed::FTarget* *prev = &_db.ind_target_buckets_elems[index]; // addr of pointer to current element while (acr_ed::FTarget *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2628,8 +2679,14 @@ void acr_ed::ind_target_Remove(acr_ed::FTarget& row) { // --- acr_ed.FDb.ind_target.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_ed::ind_target_Reserve(int n) { + ind_target_AbsReserve(_db.ind_target_n + n); +} + +// --- acr_ed.FDb.ind_target.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_ed::ind_target_AbsReserve(int n) { u32 old_nbuckets = _db.ind_target_buckets_n; - u32 new_nelems = _db.ind_target_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2648,7 +2705,7 @@ void acr_ed::ind_target_Reserve(int n) { while (elem) { acr_ed::FTarget &row = *elem; acr_ed::FTarget* next = row.ind_target_next; - u32 index = algo::Smallstr16_Hash(0, row.target) & (new_nbuckets-1); + u32 index = row.ind_target_hashval & (new_nbuckets-1); row.ind_target_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2827,7 +2884,7 @@ algo::Fildes acr_ed::abt_StartRead(algo_lib::FFildes &read) { // --- acr_ed.FDb.abt.Kill // Kill subprocess and wait void acr_ed::abt_Kill() { - if (_db.abt_pid != 0) { + if (_db.abt_pid > 0) { kill(_db.abt_pid,9); abt_Wait(); } @@ -3722,14 +3779,9 @@ bool acr_ed::nsdb_XrefMaybe(acr_ed::FNsdb &row) { // Find row by key. Return NULL if not found. acr_ed::FNsdb* acr_ed::ind_nsdb_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_nsdb_buckets_n - 1); - acr_ed::FNsdb* *e = &_db.ind_nsdb_buckets_elems[index]; - acr_ed::FNsdb* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ns == key; - if (done) break; - e = &ret->ind_nsdb_next; - } while (true); + acr_ed::FNsdb *ret = _db.ind_nsdb_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_nsdb_next) { + } return ret; } @@ -3761,10 +3813,11 @@ acr_ed::FNsdb& acr_ed::ind_nsdb_GetOrCreate(const algo::strptr& key) { // --- acr_ed.FDb.ind_nsdb.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_ed::ind_nsdb_InsertMaybe(acr_ed::FNsdb& row) { - ind_nsdb_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_nsdb_next == (acr_ed::FNsdb*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_nsdb_buckets_n - 1); + row.ind_nsdb_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_nsdb_Reserve(1); + u32 index = row.ind_nsdb_hashval & (_db.ind_nsdb_buckets_n - 1); acr_ed::FNsdb* *prev = &_db.ind_nsdb_buckets_elems[index]; do { acr_ed::FNsdb* ret = *prev; @@ -3790,7 +3843,7 @@ bool acr_ed::ind_nsdb_InsertMaybe(acr_ed::FNsdb& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_ed::ind_nsdb_Remove(acr_ed::FNsdb& row) { if (LIKELY(row.ind_nsdb_next != (acr_ed::FNsdb*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_nsdb_buckets_n - 1); + u32 index = row.ind_nsdb_hashval & (_db.ind_nsdb_buckets_n - 1); acr_ed::FNsdb* *prev = &_db.ind_nsdb_buckets_elems[index]; // addr of pointer to current element while (acr_ed::FNsdb *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3807,8 +3860,14 @@ void acr_ed::ind_nsdb_Remove(acr_ed::FNsdb& row) { // --- acr_ed.FDb.ind_nsdb.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_ed::ind_nsdb_Reserve(int n) { + ind_nsdb_AbsReserve(_db.ind_nsdb_n + n); +} + +// --- acr_ed.FDb.ind_nsdb.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_ed::ind_nsdb_AbsReserve(int n) { u32 old_nbuckets = _db.ind_nsdb_buckets_n; - u32 new_nelems = _db.ind_nsdb_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3827,7 +3886,7 @@ void acr_ed::ind_nsdb_Reserve(int n) { while (elem) { acr_ed::FNsdb &row = *elem; acr_ed::FNsdb* next = row.ind_nsdb_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_nsdb_hashval & (new_nbuckets-1); row.ind_nsdb_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3956,14 +4015,9 @@ bool acr_ed::edaction_XrefMaybe(acr_ed::FEdaction &row) { // Find row by key. Return NULL if not found. acr_ed::FEdaction* acr_ed::ind_edaction_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_edaction_buckets_n - 1); - acr_ed::FEdaction* *e = &_db.ind_edaction_buckets_elems[index]; - acr_ed::FEdaction* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).edaction == key; - if (done) break; - e = &ret->ind_edaction_next; - } while (true); + acr_ed::FEdaction *ret = _db.ind_edaction_buckets_elems[index]; + for (; ret && !((*ret).edaction == key); ret = ret->ind_edaction_next) { + } return ret; } @@ -3995,10 +4049,11 @@ acr_ed::FEdaction& acr_ed::ind_edaction_GetOrCreate(const algo::strptr& key) { // --- acr_ed.FDb.ind_edaction.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_ed::ind_edaction_InsertMaybe(acr_ed::FEdaction& row) { - ind_edaction_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_edaction_next == (acr_ed::FEdaction*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.edaction) & (_db.ind_edaction_buckets_n - 1); + row.ind_edaction_hashval = algo::Smallstr50_Hash(0, row.edaction); + ind_edaction_Reserve(1); + u32 index = row.ind_edaction_hashval & (_db.ind_edaction_buckets_n - 1); acr_ed::FEdaction* *prev = &_db.ind_edaction_buckets_elems[index]; do { acr_ed::FEdaction* ret = *prev; @@ -4024,7 +4079,7 @@ bool acr_ed::ind_edaction_InsertMaybe(acr_ed::FEdaction& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_ed::ind_edaction_Remove(acr_ed::FEdaction& row) { if (LIKELY(row.ind_edaction_next != (acr_ed::FEdaction*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.edaction) & (_db.ind_edaction_buckets_n - 1); + u32 index = row.ind_edaction_hashval & (_db.ind_edaction_buckets_n - 1); acr_ed::FEdaction* *prev = &_db.ind_edaction_buckets_elems[index]; // addr of pointer to current element while (acr_ed::FEdaction *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4041,8 +4096,14 @@ void acr_ed::ind_edaction_Remove(acr_ed::FEdaction& row) { // --- acr_ed.FDb.ind_edaction.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_ed::ind_edaction_Reserve(int n) { + ind_edaction_AbsReserve(_db.ind_edaction_n + n); +} + +// --- acr_ed.FDb.ind_edaction.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_ed::ind_edaction_AbsReserve(int n) { u32 old_nbuckets = _db.ind_edaction_buckets_n; - u32 new_nelems = _db.ind_edaction_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4061,7 +4122,7 @@ void acr_ed::ind_edaction_Reserve(int n) { while (elem) { acr_ed::FEdaction &row = *elem; acr_ed::FEdaction* next = row.ind_edaction_next; - u32 index = algo::Smallstr50_Hash(0, row.edaction) & (new_nbuckets-1); + u32 index = row.ind_edaction_hashval & (new_nbuckets-1); row.ind_edaction_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4172,6 +4233,104 @@ bool acr_ed::gitfile_XrefMaybe(acr_ed::FGitfile &row) { return retval; } +// --- acr_ed.FDb.msgtype.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +acr_ed::FMsgtype& acr_ed::msgtype_Alloc() { + acr_ed::FMsgtype* row = msgtype_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("acr_ed.out_of_mem field:acr_ed.FDb.msgtype comment:'Alloc failed'"); + } + return *row; +} + +// --- acr_ed.FDb.msgtype.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +acr_ed::FMsgtype* acr_ed::msgtype_AllocMaybe() { + acr_ed::FMsgtype *row = (acr_ed::FMsgtype*)msgtype_AllocMem(); + if (row) { + new (row) acr_ed::FMsgtype; // call constructor + } + return row; +} + +// --- acr_ed.FDb.msgtype.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +acr_ed::FMsgtype* acr_ed::msgtype_InsertMaybe(const dmmeta::Msgtype &value) { + acr_ed::FMsgtype *row = &msgtype_Alloc(); // if out of memory, process dies. if input error, return NULL. + msgtype_CopyIn(*row,const_cast(value)); + bool ok = msgtype_XrefMaybe(*row); // this may return false + if (!ok) { + msgtype_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- acr_ed.FDb.msgtype.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* acr_ed::msgtype_AllocMem() { + u64 new_nelems = _db.msgtype_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + msgtype_qFind(u64(n)).~FMsgtype(); // destroy last element + _db.msgtype_n = i32(n); + } +} + +// --- acr_ed.FDb.msgtype.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void acr_ed::msgtype_RemoveLast() { + u64 n = _db.msgtype_n; + if (n > 0) { + n -= 1; + msgtype_qFind(u64(n)).~FMsgtype(); + _db.msgtype_n = i32(n); + } +} + +// --- acr_ed.FDb.msgtype.InputMaybe +static bool acr_ed::msgtype_InputMaybe(dmmeta::Msgtype &elem) { + bool retval = true; + retval = msgtype_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- acr_ed.FDb.msgtype.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool acr_ed::msgtype_XrefMaybe(acr_ed::FMsgtype &row) { + bool retval = true; + (void)row; + return retval; +} + // --- acr_ed.FDb.trace.RowidFind // find trace by row id (used to implement reflection) static algo::ImrowPtr acr_ed::trace_RowidFind(int t) { @@ -4445,6 +4604,17 @@ void acr_ed::FDb_Init() { _db.gitfile_lary[i] = gitfile_first; gitfile_first += 1ULL<zd_targsrc_next; + acr_ed::FTargsrc **new_row_a = &old_tail->target_zd_targsrc_next; acr_ed::FTargsrc **new_row_b = &target.zd_targsrc_head; acr_ed::FTargsrc **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -4821,23 +5009,23 @@ void acr_ed::zd_targsrc_Insert(acr_ed::FTarget& target, acr_ed::FTargsrc& row) { // --- acr_ed.FTarget.zd_targsrc.Remove // Remove element from index. If element is not in index, do nothing. void acr_ed::zd_targsrc_Remove(acr_ed::FTarget& target, acr_ed::FTargsrc& row) { - if (zd_targsrc_InLlistQ(row)) { + if (target_zd_targsrc_InLlistQ(row)) { acr_ed::FTargsrc* old_head = target.zd_targsrc_head; (void)old_head; // in case it's not used - acr_ed::FTargsrc* prev = row.zd_targsrc_prev; - acr_ed::FTargsrc* next = row.zd_targsrc_next; + acr_ed::FTargsrc* prev = row.target_zd_targsrc_prev; + acr_ed::FTargsrc* next = row.target_zd_targsrc_next; // if element is first, adjust list head; otherwise, adjust previous element's next - acr_ed::FTargsrc **new_next_a = &prev->zd_targsrc_next; + acr_ed::FTargsrc **new_next_a = &prev->target_zd_targsrc_next; acr_ed::FTargsrc **new_next_b = &target.zd_targsrc_head; acr_ed::FTargsrc **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - acr_ed::FTargsrc **new_prev_a = &next->zd_targsrc_prev; + acr_ed::FTargsrc **new_prev_a = &next->target_zd_targsrc_prev; acr_ed::FTargsrc **new_prev_b = &target.zd_targsrc_tail; acr_ed::FTargsrc **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; target.zd_targsrc_n--; - row.zd_targsrc_next=(acr_ed::FTargsrc*)-1; // not-in-list + row.target_zd_targsrc_next=(acr_ed::FTargsrc*)-1; // not-in-list } } @@ -4849,9 +5037,9 @@ void acr_ed::zd_targsrc_RemoveAll(acr_ed::FTarget& target) { target.zd_targsrc_tail = NULL; target.zd_targsrc_n = 0; while (row) { - acr_ed::FTargsrc* row_next = row->zd_targsrc_next; - row->zd_targsrc_next = (acr_ed::FTargsrc*)-1; - row->zd_targsrc_prev = NULL; + acr_ed::FTargsrc* row_next = row->target_zd_targsrc_next; + row->target_zd_targsrc_next = (acr_ed::FTargsrc*)-1; + row->target_zd_targsrc_prev = NULL; row = row_next; } } @@ -4862,14 +5050,14 @@ acr_ed::FTargsrc* acr_ed::zd_targsrc_RemoveFirst(acr_ed::FTarget& target) { acr_ed::FTargsrc *row = NULL; row = target.zd_targsrc_head; if (row) { - acr_ed::FTargsrc *next = row->zd_targsrc_next; + acr_ed::FTargsrc *next = row->target_zd_targsrc_next; target.zd_targsrc_head = next; - acr_ed::FTargsrc **new_end_a = &next->zd_targsrc_prev; + acr_ed::FTargsrc **new_end_a = &next->target_zd_targsrc_prev; acr_ed::FTargsrc **new_end_b = &target.zd_targsrc_tail; acr_ed::FTargsrc **new_end = next ? new_end_a : new_end_b; *new_end = NULL; target.zd_targsrc_n--; - row->zd_targsrc_next = (acr_ed::FTargsrc*)-1; // mark as not-in-list + row->target_zd_targsrc_next = (acr_ed::FTargsrc*)-1; // mark as not-in-list } return row; } @@ -5040,6 +5228,7 @@ const char* acr_ed::value_ToCstr(const acr_ed::TableId& parent) { case acr_ed_TableId_dmmeta_Fprefix : ret = "dmmeta.Fprefix"; break; case acr_ed_TableId_dev_Gitfile : ret = "dev.Gitfile"; break; case acr_ed_TableId_dmmeta_Listtype: ret = "dmmeta.Listtype"; break; + case acr_ed_TableId_dmmeta_Msgtype : ret = "dmmeta.Msgtype"; break; case acr_ed_TableId_dmmeta_Ns : ret = "dmmeta.Ns"; break; case acr_ed_TableId_dmmeta_Nsdb : ret = "dmmeta.Nsdb"; break; case acr_ed_TableId_dmmeta_Pack : ret = "dmmeta.Pack"; break; @@ -5183,6 +5372,10 @@ bool acr_ed::value_SetStrptrMaybe(acr_ed::TableId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"prefix",6)==0) { value_SetEnum(parent,acr_ed_TableId_dmmeta_Fprefix); ret = true; break; } break; } + case LE_STR8('d','m','m','e','t','a','.','M'): { + if (memcmp(rhs.elems+8,"sgtype",6)==0) { value_SetEnum(parent,acr_ed_TableId_dmmeta_Msgtype); ret = true; break; } + break; + } case LE_STR8('d','m','m','e','t','a','.','T'): { if (memcmp(rhs.elems+8,"ypefld",6)==0) { value_SetEnum(parent,acr_ed_TableId_dmmeta_Typefld); ret = true; break; } break; @@ -5195,6 +5388,10 @@ bool acr_ed::value_SetStrptrMaybe(acr_ed::TableId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"prefix",6)==0) { value_SetEnum(parent,acr_ed_TableId_dmmeta_fprefix); ret = true; break; } break; } + case LE_STR8('d','m','m','e','t','a','.','m'): { + if (memcmp(rhs.elems+8,"sgtype",6)==0) { value_SetEnum(parent,acr_ed_TableId_dmmeta_msgtype); ret = true; break; } + break; + } case LE_STR8('d','m','m','e','t','a','.','t'): { if (memcmp(rhs.elems+8,"ypefld",6)==0) { value_SetEnum(parent,acr_ed_TableId_dmmeta_typefld); ret = true; break; } break; @@ -5274,12 +5471,13 @@ void acr_ed::StaticCheck() { // --- acr_ed...main int main(int argc, char **argv) { try { - algo_lib::FDb_Init(); lib_json::FDb_Init(); + algo_lib::FDb_Init(); acr_ed::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock acr_ed::ReadArgv(); // dmmeta.main:acr_ed acr_ed::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -5291,8 +5489,8 @@ int main(int argc, char **argv) { } try { acr_ed::FDb_Uninit(); - lib_json::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/acr_gen.cpp b/cpp/gen/acr_gen.cpp index 5f9fb038..ed36a6b1 100644 --- a/cpp/gen/acr_gen.cpp +++ b/cpp/gen/acr_gen.cpp @@ -37,12 +37,15 @@ #include "include/gen/command_gen.inl.h" #include "include/gen/report_gen.h" #include "include/gen/report_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/lib_amcdb_gen.h" #include "include/gen/lib_amcdb_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep acr::FDb acr::_db; // dependency found via dev.targdep @@ -90,8 +93,8 @@ const char *acr_help = " -field... string Fields to select\n" " -regxof string \"\" Single field: output regx of matching field values\n" " -meta Select meta-data for selected records\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -327,14 +330,9 @@ void acr::FCdflt_Uninit(acr::FCdflt& cdflt) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr::c_bad_rec_Insert(acr::FCheck& check, acr::FRec& row) { - // reserve space c_bad_rec_Reserve(check, 1); - u32 n = check.c_bad_rec_n; - u32 at = n; - acr::FRec* *elems = check.c_bad_rec_elems; - elems[at] = &row; - check.c_bad_rec_n = n+1; - + u32 n = check.c_bad_rec_n++; + check.c_bad_rec_elems[n] = &row; } // --- acr.FCheck.c_bad_rec.ScanInsertMaybe @@ -363,20 +361,18 @@ bool acr::c_bad_rec_ScanInsertMaybe(acr::FCheck& check, acr::FRec& row) { // --- acr.FCheck.c_bad_rec.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr::c_bad_rec_Remove(acr::FCheck& check, acr::FRec& row) { - int lim = check.c_bad_rec_n; - acr::FRec* *elems = check.c_bad_rec_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - acr::FRec* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr::FRec*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - check.c_bad_rec_n = lim - 1; - break; + int n = check.c_bad_rec_n; + int j=0; + for (int i=0; i acr::ary_name_AllocN(acr::FCheck& check, int n_elems return algo::aryptr(elems + old_n, n_elems); } +// --- acr.FCheck.ary_name.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr acr::ary_name_AllocNAt(acr::FCheck& check, int n_elems, int at) { + ary_name_Reserve(check, n_elems); + int n = check.ary_name_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("acr.bad_alloc_n_at field:acr.FCheck.ary_name comment:'index out of range'"); + } + algo::cstring *elems = check.ary_name_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + check.ary_name_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- acr.FCheck.ary_name.Remove // Remove item by index. If index outside of range, do nothing. void acr::ary_name_Remove(acr::FCheck& check, u32 i) { @@ -554,6 +569,30 @@ bool acr::ary_name_ReadStrptrMaybe(acr::FCheck& check, algo::strptr in_str) { return retval; } +// --- acr.FCheck.ary_name.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void acr::ary_name_Insary(acr::FCheck& check, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= check.ary_name_elems && rhs.elems < check.ary_name_elems + check.ary_name_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("acr.tary_alias field:acr.FCheck.ary_name comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(check.ary_name_elems+1))) { + FatalErrorExit("acr.bad_insary field:acr.FCheck.ary_name comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = check.ary_name_n - at; + ary_name_Reserve(check, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (check.ary_name_elems + at + nnew + i) algo::cstring(check.ary_name_elems[at + i]); + check.ary_name_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (check.ary_name_elems + at + i) algo::cstring(rhs[i]); + } + check.ary_name_n += nnew; +} + // --- acr.FCheck..Uninit void acr::FCheck_Uninit(acr::FCheck& check) { acr::FCheck &row = check; (void)row; @@ -616,15 +655,11 @@ algo::Smallstr100 acr::name_Get(acr::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr::c_field_Insert(acr::FCtype& ctype, acr::FField& row) { - if (bool_Update(row.ctype_c_field_in_ary,true)) { - // reserve space + if (!row.ctype_c_field_in_ary) { c_field_Reserve(ctype, 1); - u32 n = ctype.c_field_n; - u32 at = n; - acr::FField* *elems = ctype.c_field_elems; - elems[at] = &row; - ctype.c_field_n = n+1; - + u32 n = ctype.c_field_n++; + ctype.c_field_elems[n] = &row; + row.ctype_c_field_in_ary = true; } } @@ -633,7 +668,7 @@ void acr::c_field_Insert(acr::FCtype& ctype, acr::FField& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool acr::c_field_InsertMaybe(acr::FCtype& ctype, acr::FField& row) { - bool retval = !row.ctype_c_field_in_ary; + bool retval = !ctype_c_field_InAryQ(row); c_field_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -641,18 +676,18 @@ bool acr::c_field_InsertMaybe(acr::FCtype& ctype, acr::FField& row) { // --- acr.FCtype.c_field.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr::c_field_Remove(acr::FCtype& ctype, acr::FField& row) { + int n = ctype.c_field_n; if (bool_Update(row.ctype_c_field_in_ary,false)) { - int lim = ctype.c_field_n; acr::FField* *elems = ctype.c_field_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { acr::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(acr::FField*) * (lim - j); + size_t nbytes = sizeof(acr::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_field_n = lim - 1; + ctype.c_field_n = n - 1; break; } } @@ -676,70 +711,70 @@ void acr::c_field_Reserve(acr::FCtype& ctype, u32 n) { } } -// --- acr.FCtype.zd_ctype_rec.Insert +// --- acr.FCtype.zd_rec.Insert // Insert row into linked list. If row is already in linked list, do nothing. -void acr::zd_ctype_rec_Insert(acr::FCtype& ctype, acr::FRec& row) { - if (!zd_ctype_rec_InLlistQ(row)) { - acr::FRec* old_tail = ctype.zd_ctype_rec_tail; - row.zd_ctype_rec_next = NULL; - row.zd_ctype_rec_prev = old_tail; - ctype.zd_ctype_rec_tail = &row; - acr::FRec **new_row_a = &old_tail->zd_ctype_rec_next; - acr::FRec **new_row_b = &ctype.zd_ctype_rec_head; +void acr::zd_rec_Insert(acr::FCtype& ctype, acr::FRec& row) { + if (!ctype_zd_rec_InLlistQ(row)) { + acr::FRec* old_tail = ctype.zd_rec_tail; + row.ctype_zd_rec_next = NULL; + row.ctype_zd_rec_prev = old_tail; + ctype.zd_rec_tail = &row; + acr::FRec **new_row_a = &old_tail->ctype_zd_rec_next; + acr::FRec **new_row_b = &ctype.zd_rec_head; acr::FRec **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; } } -// --- acr.FCtype.zd_ctype_rec.Remove +// --- acr.FCtype.zd_rec.Remove // Remove element from index. If element is not in index, do nothing. -void acr::zd_ctype_rec_Remove(acr::FCtype& ctype, acr::FRec& row) { - if (zd_ctype_rec_InLlistQ(row)) { - acr::FRec* old_head = ctype.zd_ctype_rec_head; +void acr::zd_rec_Remove(acr::FCtype& ctype, acr::FRec& row) { + if (ctype_zd_rec_InLlistQ(row)) { + acr::FRec* old_head = ctype.zd_rec_head; (void)old_head; // in case it's not used - acr::FRec* prev = row.zd_ctype_rec_prev; - acr::FRec* next = row.zd_ctype_rec_next; + acr::FRec* prev = row.ctype_zd_rec_prev; + acr::FRec* next = row.ctype_zd_rec_next; // if element is first, adjust list head; otherwise, adjust previous element's next - acr::FRec **new_next_a = &prev->zd_ctype_rec_next; - acr::FRec **new_next_b = &ctype.zd_ctype_rec_head; + acr::FRec **new_next_a = &prev->ctype_zd_rec_next; + acr::FRec **new_next_b = &ctype.zd_rec_head; acr::FRec **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - acr::FRec **new_prev_a = &next->zd_ctype_rec_prev; - acr::FRec **new_prev_b = &ctype.zd_ctype_rec_tail; + acr::FRec **new_prev_a = &next->ctype_zd_rec_prev; + acr::FRec **new_prev_b = &ctype.zd_rec_tail; acr::FRec **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; - row.zd_ctype_rec_next=(acr::FRec*)-1; // not-in-list + row.ctype_zd_rec_next=(acr::FRec*)-1; // not-in-list } } -// --- acr.FCtype.zd_ctype_rec.RemoveAll +// --- acr.FCtype.zd_rec.RemoveAll // Empty the index. (The rows are not deleted) -void acr::zd_ctype_rec_RemoveAll(acr::FCtype& ctype) { - acr::FRec* row = ctype.zd_ctype_rec_head; - ctype.zd_ctype_rec_head = NULL; - ctype.zd_ctype_rec_tail = NULL; +void acr::zd_rec_RemoveAll(acr::FCtype& ctype) { + acr::FRec* row = ctype.zd_rec_head; + ctype.zd_rec_head = NULL; + ctype.zd_rec_tail = NULL; while (row) { - acr::FRec* row_next = row->zd_ctype_rec_next; - row->zd_ctype_rec_next = (acr::FRec*)-1; - row->zd_ctype_rec_prev = NULL; + acr::FRec* row_next = row->ctype_zd_rec_next; + row->ctype_zd_rec_next = (acr::FRec*)-1; + row->ctype_zd_rec_prev = NULL; row = row_next; } } -// --- acr.FCtype.zd_ctype_rec.RemoveFirst +// --- acr.FCtype.zd_rec.RemoveFirst // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -acr::FRec* acr::zd_ctype_rec_RemoveFirst(acr::FCtype& ctype) { +acr::FRec* acr::zd_rec_RemoveFirst(acr::FCtype& ctype) { acr::FRec *row = NULL; - row = ctype.zd_ctype_rec_head; + row = ctype.zd_rec_head; if (row) { - acr::FRec *next = row->zd_ctype_rec_next; - ctype.zd_ctype_rec_head = next; - acr::FRec **new_end_a = &next->zd_ctype_rec_prev; - acr::FRec **new_end_b = &ctype.zd_ctype_rec_tail; + acr::FRec *next = row->ctype_zd_rec_next; + ctype.zd_rec_head = next; + acr::FRec **new_end_a = &next->ctype_zd_rec_prev; + acr::FRec **new_end_b = &ctype.zd_rec_tail; acr::FRec **new_end = next ? new_end_a : new_end_b; *new_end = NULL; - row->zd_ctype_rec_next = (acr::FRec*)-1; // mark as not-in-list + row->ctype_zd_rec_next = (acr::FRec*)-1; // mark as not-in-list } return row; } @@ -748,24 +783,20 @@ acr::FRec* acr::zd_ctype_rec_RemoveFirst(acr::FCtype& ctype) { // Find row by key. Return NULL if not found. acr::FRec* acr::ind_ctype_rec_Find(acr::FCtype& ctype, const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (ctype.ind_ctype_rec_buckets_n - 1); - acr::FRec* *e = &ctype.ind_ctype_rec_buckets_elems[index]; - acr::FRec* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).pkey == key; - if (done) break; - e = &ret->ind_ctype_rec_next; - } while (true); + acr::FRec *ret = ctype.ind_ctype_rec_buckets_elems[index]; + for (; ret && !((*ret).pkey == key); ret = ret->ctype_ind_ctype_rec_next) { + } return ret; } // --- acr.FCtype.ind_ctype_rec.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr::ind_ctype_rec_InsertMaybe(acr::FCtype& ctype, acr::FRec& row) { - ind_ctype_rec_Reserve(ctype, 1); bool retval = true; // if already in hash, InsertMaybe returns true - if (LIKELY(row.ind_ctype_rec_next == (acr::FRec*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.pkey) & (ctype.ind_ctype_rec_buckets_n - 1); + if (LIKELY(row.ctype_ind_ctype_rec_next == (acr::FRec*)-1)) {// check if in hash already + row.ctype_ind_ctype_rec_hashval = algo::cstring_Hash(0, row.pkey); + ind_ctype_rec_Reserve(ctype, 1); + u32 index = row.ctype_ind_ctype_rec_hashval & (ctype.ind_ctype_rec_buckets_n - 1); acr::FRec* *prev = &ctype.ind_ctype_rec_buckets_elems[index]; do { acr::FRec* ret = *prev; @@ -776,10 +807,10 @@ bool acr::ind_ctype_rec_InsertMaybe(acr::FCtype& ctype, acr::FRec& row) { retval = false; break; } - prev = &ret->ind_ctype_rec_next; + prev = &ret->ctype_ind_ctype_rec_next; } while (true); if (retval) { - row.ind_ctype_rec_next = *prev; + row.ctype_ind_ctype_rec_next = *prev; ctype.ind_ctype_rec_n++; *prev = &row; } @@ -790,17 +821,17 @@ bool acr::ind_ctype_rec_InsertMaybe(acr::FCtype& ctype, acr::FRec& row) { // --- acr.FCtype.ind_ctype_rec.Remove // Remove reference to element from hash index. If element is not in hash, do nothing void acr::ind_ctype_rec_Remove(acr::FCtype& ctype, acr::FRec& row) { - if (LIKELY(row.ind_ctype_rec_next != (acr::FRec*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.pkey) & (ctype.ind_ctype_rec_buckets_n - 1); + if (LIKELY(row.ctype_ind_ctype_rec_next != (acr::FRec*)-1)) {// check if in hash already + u32 index = row.ctype_ind_ctype_rec_hashval & (ctype.ind_ctype_rec_buckets_n - 1); acr::FRec* *prev = &ctype.ind_ctype_rec_buckets_elems[index]; // addr of pointer to current element while (acr::FRec *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_ctype_rec_next; // unlink (singly linked list) + *prev = next->ctype_ind_ctype_rec_next; // unlink (singly linked list) ctype.ind_ctype_rec_n--; - row.ind_ctype_rec_next = (acr::FRec*)-1;// not-in-hash + row.ctype_ind_ctype_rec_next = (acr::FRec*)-1;// not-in-hash break; } - prev = &next->ind_ctype_rec_next; + prev = &next->ctype_ind_ctype_rec_next; } } } @@ -808,8 +839,14 @@ void acr::ind_ctype_rec_Remove(acr::FCtype& ctype, acr::FRec& row) { // --- acr.FCtype.ind_ctype_rec.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr::ind_ctype_rec_Reserve(acr::FCtype& ctype, int n) { + ind_ctype_rec_AbsReserve(ctype,ctype.ind_ctype_rec_n + n); +} + +// --- acr.FCtype.ind_ctype_rec.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr::ind_ctype_rec_AbsReserve(acr::FCtype& ctype, int n) { u32 old_nbuckets = ctype.ind_ctype_rec_buckets_n; - u32 new_nelems = ctype.ind_ctype_rec_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -827,9 +864,9 @@ void acr::ind_ctype_rec_Reserve(acr::FCtype& ctype, int n) { acr::FRec* elem = ctype.ind_ctype_rec_buckets_elems[i]; while (elem) { acr::FRec &row = *elem; - acr::FRec* next = row.ind_ctype_rec_next; - u32 index = algo::cstring_Hash(0, row.pkey) & (new_nbuckets-1); - row.ind_ctype_rec_next = new_buckets[index]; + acr::FRec* next = row.ctype_ind_ctype_rec_next; + u32 index = row.ctype_ind_ctype_rec_hashval & (new_nbuckets-1); + row.ctype_ind_ctype_rec_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } @@ -841,70 +878,70 @@ void acr::ind_ctype_rec_Reserve(acr::FCtype& ctype, int n) { } } -// --- acr.FCtype.zd_ctype_selrec.Insert +// --- acr.FCtype.zd_selrec.Insert // Insert row into linked list. If row is already in linked list, do nothing. -void acr::zd_ctype_selrec_Insert(acr::FCtype& ctype, acr::FRec& row) { - if (!zd_ctype_selrec_InLlistQ(row)) { - acr::FRec* old_tail = ctype.zd_ctype_selrec_tail; - row.zd_ctype_selrec_next = NULL; - row.zd_ctype_selrec_prev = old_tail; - ctype.zd_ctype_selrec_tail = &row; - acr::FRec **new_row_a = &old_tail->zd_ctype_selrec_next; - acr::FRec **new_row_b = &ctype.zd_ctype_selrec_head; +void acr::zd_selrec_Insert(acr::FCtype& ctype, acr::FRec& row) { + if (!ctype_zd_selrec_InLlistQ(row)) { + acr::FRec* old_tail = ctype.zd_selrec_tail; + row.ctype_zd_selrec_next = NULL; + row.ctype_zd_selrec_prev = old_tail; + ctype.zd_selrec_tail = &row; + acr::FRec **new_row_a = &old_tail->ctype_zd_selrec_next; + acr::FRec **new_row_b = &ctype.zd_selrec_head; acr::FRec **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; } } -// --- acr.FCtype.zd_ctype_selrec.Remove +// --- acr.FCtype.zd_selrec.Remove // Remove element from index. If element is not in index, do nothing. -void acr::zd_ctype_selrec_Remove(acr::FCtype& ctype, acr::FRec& row) { - if (zd_ctype_selrec_InLlistQ(row)) { - acr::FRec* old_head = ctype.zd_ctype_selrec_head; +void acr::zd_selrec_Remove(acr::FCtype& ctype, acr::FRec& row) { + if (ctype_zd_selrec_InLlistQ(row)) { + acr::FRec* old_head = ctype.zd_selrec_head; (void)old_head; // in case it's not used - acr::FRec* prev = row.zd_ctype_selrec_prev; - acr::FRec* next = row.zd_ctype_selrec_next; + acr::FRec* prev = row.ctype_zd_selrec_prev; + acr::FRec* next = row.ctype_zd_selrec_next; // if element is first, adjust list head; otherwise, adjust previous element's next - acr::FRec **new_next_a = &prev->zd_ctype_selrec_next; - acr::FRec **new_next_b = &ctype.zd_ctype_selrec_head; + acr::FRec **new_next_a = &prev->ctype_zd_selrec_next; + acr::FRec **new_next_b = &ctype.zd_selrec_head; acr::FRec **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - acr::FRec **new_prev_a = &next->zd_ctype_selrec_prev; - acr::FRec **new_prev_b = &ctype.zd_ctype_selrec_tail; + acr::FRec **new_prev_a = &next->ctype_zd_selrec_prev; + acr::FRec **new_prev_b = &ctype.zd_selrec_tail; acr::FRec **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; - row.zd_ctype_selrec_next=(acr::FRec*)-1; // not-in-list + row.ctype_zd_selrec_next=(acr::FRec*)-1; // not-in-list } } -// --- acr.FCtype.zd_ctype_selrec.RemoveAll +// --- acr.FCtype.zd_selrec.RemoveAll // Empty the index. (The rows are not deleted) -void acr::zd_ctype_selrec_RemoveAll(acr::FCtype& ctype) { - acr::FRec* row = ctype.zd_ctype_selrec_head; - ctype.zd_ctype_selrec_head = NULL; - ctype.zd_ctype_selrec_tail = NULL; +void acr::zd_selrec_RemoveAll(acr::FCtype& ctype) { + acr::FRec* row = ctype.zd_selrec_head; + ctype.zd_selrec_head = NULL; + ctype.zd_selrec_tail = NULL; while (row) { - acr::FRec* row_next = row->zd_ctype_selrec_next; - row->zd_ctype_selrec_next = (acr::FRec*)-1; - row->zd_ctype_selrec_prev = NULL; + acr::FRec* row_next = row->ctype_zd_selrec_next; + row->ctype_zd_selrec_next = (acr::FRec*)-1; + row->ctype_zd_selrec_prev = NULL; row = row_next; } } -// --- acr.FCtype.zd_ctype_selrec.RemoveFirst +// --- acr.FCtype.zd_selrec.RemoveFirst // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -acr::FRec* acr::zd_ctype_selrec_RemoveFirst(acr::FCtype& ctype) { +acr::FRec* acr::zd_selrec_RemoveFirst(acr::FCtype& ctype) { acr::FRec *row = NULL; - row = ctype.zd_ctype_selrec_head; + row = ctype.zd_selrec_head; if (row) { - acr::FRec *next = row->zd_ctype_selrec_next; - ctype.zd_ctype_selrec_head = next; - acr::FRec **new_end_a = &next->zd_ctype_selrec_prev; - acr::FRec **new_end_b = &ctype.zd_ctype_selrec_tail; + acr::FRec *next = row->ctype_zd_selrec_next; + ctype.zd_selrec_head = next; + acr::FRec **new_end_a = &next->ctype_zd_selrec_prev; + acr::FRec **new_end_b = &ctype.zd_selrec_tail; acr::FRec **new_end = next ? new_end_a : new_end_b; *new_end = NULL; - row->zd_ctype_selrec_next = (acr::FRec*)-1; // mark as not-in-list + row->ctype_zd_selrec_next = (acr::FRec*)-1; // mark as not-in-list } return row; } @@ -913,14 +950,9 @@ acr::FRec* acr::zd_ctype_selrec_RemoveFirst(acr::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr::c_child_Insert(acr::FCtype& ctype, acr::FCtype& row) { - // reserve space c_child_Reserve(ctype, 1); - u32 n = ctype.c_child_n; - u32 at = n; - acr::FCtype* *elems = ctype.c_child_elems; - elems[at] = &row; - ctype.c_child_n = n+1; - + u32 n = ctype.c_child_n++; + ctype.c_child_elems[n] = &row; } // --- acr.FCtype.c_child.ScanInsertMaybe @@ -949,20 +981,18 @@ bool acr::c_child_ScanInsertMaybe(acr::FCtype& ctype, acr::FCtype& row) { // --- acr.FCtype.c_child.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr::c_child_Remove(acr::FCtype& ctype, acr::FCtype& row) { - int lim = ctype.c_child_n; - acr::FCtype* *elems = ctype.c_child_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - acr::FCtype* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr::FCtype*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - ctype.c_child_n = lim - 1; - break; + int n = ctype.c_child_n; + int j=0; + for (int i=0; izd_arg_next; + acr::FField **new_row_a = &old_tail->ctype_zd_arg_next; acr::FField **new_row_b = &ctype.zd_arg_head; acr::FField **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -1001,23 +1031,23 @@ void acr::zd_arg_Insert(acr::FCtype& ctype, acr::FField& row) { // --- acr.FCtype.zd_arg.Remove // Remove element from index. If element is not in index, do nothing. void acr::zd_arg_Remove(acr::FCtype& ctype, acr::FField& row) { - if (zd_arg_InLlistQ(row)) { + if (ctype_zd_arg_InLlistQ(row)) { acr::FField* old_head = ctype.zd_arg_head; (void)old_head; // in case it's not used - acr::FField* prev = row.zd_arg_prev; - acr::FField* next = row.zd_arg_next; + acr::FField* prev = row.ctype_zd_arg_prev; + acr::FField* next = row.ctype_zd_arg_next; // if element is first, adjust list head; otherwise, adjust previous element's next - acr::FField **new_next_a = &prev->zd_arg_next; + acr::FField **new_next_a = &prev->ctype_zd_arg_next; acr::FField **new_next_b = &ctype.zd_arg_head; acr::FField **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - acr::FField **new_prev_a = &next->zd_arg_prev; + acr::FField **new_prev_a = &next->ctype_zd_arg_prev; acr::FField **new_prev_b = &ctype.zd_arg_tail; acr::FField **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; ctype.zd_arg_n--; - row.zd_arg_next=(acr::FField*)-1; // not-in-list + row.ctype_zd_arg_next=(acr::FField*)-1; // not-in-list } } @@ -1029,9 +1059,9 @@ void acr::zd_arg_RemoveAll(acr::FCtype& ctype) { ctype.zd_arg_tail = NULL; ctype.zd_arg_n = 0; while (row) { - acr::FField* row_next = row->zd_arg_next; - row->zd_arg_next = (acr::FField*)-1; - row->zd_arg_prev = NULL; + acr::FField* row_next = row->ctype_zd_arg_next; + row->ctype_zd_arg_next = (acr::FField*)-1; + row->ctype_zd_arg_prev = NULL; row = row_next; } } @@ -1042,14 +1072,14 @@ acr::FField* acr::zd_arg_RemoveFirst(acr::FCtype& ctype) { acr::FField *row = NULL; row = ctype.zd_arg_head; if (row) { - acr::FField *next = row->zd_arg_next; + acr::FField *next = row->ctype_zd_arg_next; ctype.zd_arg_head = next; - acr::FField **new_end_a = &next->zd_arg_prev; + acr::FField **new_end_a = &next->ctype_zd_arg_prev; acr::FField **new_end_b = &ctype.zd_arg_tail; acr::FField **new_end = next ? new_end_a : new_end_b; *new_end = NULL; ctype.zd_arg_n--; - row->zd_arg_next = (acr::FField*)-1; // mark as not-in-list + row->ctype_zd_arg_next = (acr::FField*)-1; // mark as not-in-list } return row; } @@ -1058,15 +1088,11 @@ acr::FField* acr::zd_arg_RemoveFirst(acr::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr::c_ssimreq_Insert(acr::FCtype& ctype, acr::FSsimreq& row) { - if (bool_Update(row.ctype_c_ssimreq_in_ary,true)) { - // reserve space + if (!row.ctype_c_ssimreq_in_ary) { c_ssimreq_Reserve(ctype, 1); - u32 n = ctype.c_ssimreq_n; - u32 at = n; - acr::FSsimreq* *elems = ctype.c_ssimreq_elems; - elems[at] = &row; - ctype.c_ssimreq_n = n+1; - + u32 n = ctype.c_ssimreq_n++; + ctype.c_ssimreq_elems[n] = &row; + row.ctype_c_ssimreq_in_ary = true; } } @@ -1075,7 +1101,7 @@ void acr::c_ssimreq_Insert(acr::FCtype& ctype, acr::FSsimreq& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool acr::c_ssimreq_InsertMaybe(acr::FCtype& ctype, acr::FSsimreq& row) { - bool retval = !row.ctype_c_ssimreq_in_ary; + bool retval = !ctype_c_ssimreq_InAryQ(row); c_ssimreq_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -1083,18 +1109,18 @@ bool acr::c_ssimreq_InsertMaybe(acr::FCtype& ctype, acr::FSsimreq& row) { // --- acr.FCtype.c_ssimreq.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr::c_ssimreq_Remove(acr::FCtype& ctype, acr::FSsimreq& row) { + int n = ctype.c_ssimreq_n; if (bool_Update(row.ctype_c_ssimreq_in_ary,false)) { - int lim = ctype.c_ssimreq_n; acr::FSsimreq* *elems = ctype.c_ssimreq_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { acr::FSsimreq* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(acr::FSsimreq*) * (lim - j); + size_t nbytes = sizeof(acr::FSsimreq*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_ssimreq_n = lim - 1; + ctype.c_ssimreq_n = n - 1; break; } } @@ -1138,8 +1164,8 @@ void acr::FCtype_Init(acr::FCtype& ctype) { ctype.c_field_max = 0; // (acr.FCtype.c_field) ctype.c_cdflt = NULL; ctype.c_ssimfile = NULL; - ctype.zd_ctype_rec_head = NULL; // (acr.FCtype.zd_ctype_rec) - ctype.zd_ctype_rec_tail = NULL; // (acr.FCtype.zd_ctype_rec) + ctype.zd_rec_head = NULL; // (acr.FCtype.zd_rec) + ctype.zd_rec_tail = NULL; // (acr.FCtype.zd_rec) // initialize hash table for acr::FRec; ctype.ind_ctype_rec_n = 0; // (acr.FCtype.ind_ctype_rec) ctype.ind_ctype_rec_buckets_n = 4; // (acr.FCtype.ind_ctype_rec) @@ -1148,8 +1174,8 @@ void acr::FCtype_Init(acr::FCtype& ctype) { FatalErrorExit("out of memory"); // (acr.FCtype.ind_ctype_rec) } memset(ctype.ind_ctype_rec_buckets_elems, 0, sizeof(acr::FRec*)*ctype.ind_ctype_rec_buckets_n); // (acr.FCtype.ind_ctype_rec) - ctype.zd_ctype_selrec_head = NULL; // (acr.FCtype.zd_ctype_selrec) - ctype.zd_ctype_selrec_tail = NULL; // (acr.FCtype.zd_ctype_selrec) + ctype.zd_selrec_head = NULL; // (acr.FCtype.zd_selrec) + ctype.zd_selrec_tail = NULL; // (acr.FCtype.zd_selrec) ctype.n_insert = i32(0); ctype.rank = i32(false); ctype.c_child_elems = NULL; // (acr.FCtype.c_child) @@ -1168,8 +1194,9 @@ void acr::FCtype_Init(acr::FCtype& ctype) { ctype.c_ssimreq_elems = NULL; // (acr.FCtype.c_ssimreq) ctype.c_ssimreq_n = 0; // (acr.FCtype.c_ssimreq) ctype.c_ssimreq_max = 0; // (acr.FCtype.c_ssimreq) - ctype._db_c_ctype_front_in_ary = bool(false); + ctype.c_ctype_front_in_ary = bool(false); ctype.ind_ctype_next = (acr::FCtype*)-1; // (acr.FDb.ind_ctype) not-in-hash + ctype.ind_ctype_hashval = 0; // stored hash value ctype.zd_sel_ctype_next = (acr::FCtype*)-1; // (acr.FDb.zd_sel_ctype) not-in-list ctype.zd_sel_ctype_prev = NULL; // (acr.FDb.zd_sel_ctype) ctype.bh_ctype_topo_idx = -1; // (acr.FDb.bh_ctype_topo) not-in-heap @@ -2097,9 +2124,9 @@ bool acr::rec_XrefMaybe(acr::FRec &row) { return false; } } - // insert rec into index zd_ctype_rec + // insert rec into index zd_rec if (true) { // user-defined insert condition - zd_ctype_rec_Insert(*p_p_ctype, row); + zd_rec_Insert(*p_p_ctype, row); } return retval; } @@ -2602,9 +2629,8 @@ void acr::ReadArgv() { } if (ch_N(attrname) == 0) { err << "acr: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:acr.FDb.cmdline @@ -2658,7 +2687,7 @@ void acr::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -2703,7 +2732,7 @@ static void acr::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'acr.Input' signature:'a69d341ad2eab159ab4ccafa9c9a1d991af5589c'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'acr.Input' signature:'bb2ab492247f7dd389e5b120d6369aafe91d87da'"); } // --- acr.FDb._db.InsertStrptrMaybe @@ -2830,8 +2859,8 @@ bool acr::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && acr::LoadTuplesFile(algo::SsimFname(root,"dmmeta.anonfld"),recursive); retval = retval && acr::LoadTuplesFile(algo::SsimFname(root,"amcdb.bltin"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -2903,24 +2932,20 @@ bool acr::_db_XrefMaybe() { // Find row by key. Return NULL if not found. acr::FCtype* acr::ind_ctype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctype_buckets_n - 1); - acr::FCtype* *e = &_db.ind_ctype_buckets_elems[index]; - acr::FCtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctype_next; - } while (true); + acr::FCtype *ret = _db.ind_ctype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctype_next) { + } return ret; } // --- acr.FDb.ind_ctype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr::ind_ctype_InsertMaybe(acr::FCtype& row) { - ind_ctype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ctype_next == (acr::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + row.ind_ctype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctype_Reserve(1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); acr::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; do { acr::FCtype* ret = *prev; @@ -2946,7 +2971,7 @@ bool acr::ind_ctype_InsertMaybe(acr::FCtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr::ind_ctype_Remove(acr::FCtype& row) { if (LIKELY(row.ind_ctype_next != (acr::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); acr::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; // addr of pointer to current element while (acr::FCtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2963,8 +2988,14 @@ void acr::ind_ctype_Remove(acr::FCtype& row) { // --- acr.FDb.ind_ctype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr::ind_ctype_Reserve(int n) { + ind_ctype_AbsReserve(_db.ind_ctype_n + n); +} + +// --- acr.FDb.ind_ctype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr::ind_ctype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ctype_buckets_n; - u32 new_nelems = _db.ind_ctype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2983,7 +3014,7 @@ void acr::ind_ctype_Reserve(int n) { while (elem) { acr::FCtype &row = *elem; acr::FCtype* next = row.ind_ctype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ctype_hashval & (new_nbuckets-1); row.ind_ctype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3000,24 +3031,20 @@ void acr::ind_ctype_Reserve(int n) { // Find row by key. Return NULL if not found. acr::FField* acr::ind_field_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_field_buckets_n - 1); - acr::FField* *e = &_db.ind_field_buckets_elems[index]; - acr::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + acr::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_field_next) { + } return ret; } // --- acr.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr::ind_field_InsertMaybe(acr::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (acr::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::Smallstr100_Hash(0, row.field); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); acr::FField* *prev = &_db.ind_field_buckets_elems[index]; do { acr::FField* ret = *prev; @@ -3043,7 +3070,7 @@ bool acr::ind_field_InsertMaybe(acr::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr::ind_field_Remove(acr::FField& row) { if (LIKELY(row.ind_field_next != (acr::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); acr::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (acr::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3060,8 +3087,14 @@ void acr::ind_field_Remove(acr::FField& row) { // --- acr.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- acr.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3080,7 +3113,7 @@ void acr::ind_field_Reserve(int n) { while (elem) { acr::FField &row = *elem; acr::FField* next = row.ind_field_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3097,14 +3130,9 @@ void acr::ind_field_Reserve(int n) { // Find row by key. Return NULL if not found. acr::FFile* acr::ind_file_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_file_buckets_n - 1); - acr::FFile* *e = &_db.ind_file_buckets_elems[index]; - acr::FFile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).file == key; - if (done) break; - e = &ret->ind_file_next; - } while (true); + acr::FFile *ret = _db.ind_file_buckets_elems[index]; + for (; ret && !((*ret).file == key); ret = ret->ind_file_next) { + } return ret; } @@ -3128,10 +3156,11 @@ acr::FFile& acr::ind_file_GetOrCreate(const algo::strptr& key) { // --- acr.FDb.ind_file.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr::ind_file_InsertMaybe(acr::FFile& row) { - ind_file_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_file_next == (acr::FFile*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.file) & (_db.ind_file_buckets_n - 1); + row.ind_file_hashval = algo::cstring_Hash(0, row.file); + ind_file_Reserve(1); + u32 index = row.ind_file_hashval & (_db.ind_file_buckets_n - 1); acr::FFile* *prev = &_db.ind_file_buckets_elems[index]; do { acr::FFile* ret = *prev; @@ -3157,7 +3186,7 @@ bool acr::ind_file_InsertMaybe(acr::FFile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr::ind_file_Remove(acr::FFile& row) { if (LIKELY(row.ind_file_next != (acr::FFile*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.file) & (_db.ind_file_buckets_n - 1); + u32 index = row.ind_file_hashval & (_db.ind_file_buckets_n - 1); acr::FFile* *prev = &_db.ind_file_buckets_elems[index]; // addr of pointer to current element while (acr::FFile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3174,8 +3203,14 @@ void acr::ind_file_Remove(acr::FFile& row) { // --- acr.FDb.ind_file.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr::ind_file_Reserve(int n) { + ind_file_AbsReserve(_db.ind_file_n + n); +} + +// --- acr.FDb.ind_file.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr::ind_file_AbsReserve(int n) { u32 old_nbuckets = _db.ind_file_buckets_n; - u32 new_nelems = _db.ind_file_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3194,7 +3229,7 @@ void acr::ind_file_Reserve(int n) { while (elem) { acr::FFile &row = *elem; acr::FFile* next = row.ind_file_next; - u32 index = algo::cstring_Hash(0, row.file) & (new_nbuckets-1); + u32 index = row.ind_file_hashval & (new_nbuckets-1); row.ind_file_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3901,14 +3936,9 @@ bool acr::tempkey_XrefMaybe(acr::FTempkey &row) { // Find row by key. Return NULL if not found. acr::FTempkey* acr::ind_tempkey_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_tempkey_buckets_n - 1); - acr::FTempkey* *e = &_db.ind_tempkey_buckets_elems[index]; - acr::FTempkey* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).tempkey == key; - if (done) break; - e = &ret->ind_tempkey_next; - } while (true); + acr::FTempkey *ret = _db.ind_tempkey_buckets_elems[index]; + for (; ret && !((*ret).tempkey == key); ret = ret->ind_tempkey_next) { + } return ret; } @@ -3932,10 +3962,11 @@ acr::FTempkey& acr::ind_tempkey_GetOrCreate(const algo::strptr& key) { // --- acr.FDb.ind_tempkey.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr::ind_tempkey_InsertMaybe(acr::FTempkey& row) { - ind_tempkey_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_tempkey_next == (acr::FTempkey*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.tempkey) & (_db.ind_tempkey_buckets_n - 1); + row.ind_tempkey_hashval = algo::cstring_Hash(0, row.tempkey); + ind_tempkey_Reserve(1); + u32 index = row.ind_tempkey_hashval & (_db.ind_tempkey_buckets_n - 1); acr::FTempkey* *prev = &_db.ind_tempkey_buckets_elems[index]; do { acr::FTempkey* ret = *prev; @@ -3961,7 +3992,7 @@ bool acr::ind_tempkey_InsertMaybe(acr::FTempkey& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr::ind_tempkey_Remove(acr::FTempkey& row) { if (LIKELY(row.ind_tempkey_next != (acr::FTempkey*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.tempkey) & (_db.ind_tempkey_buckets_n - 1); + u32 index = row.ind_tempkey_hashval & (_db.ind_tempkey_buckets_n - 1); acr::FTempkey* *prev = &_db.ind_tempkey_buckets_elems[index]; // addr of pointer to current element while (acr::FTempkey *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3978,8 +4009,14 @@ void acr::ind_tempkey_Remove(acr::FTempkey& row) { // --- acr.FDb.ind_tempkey.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr::ind_tempkey_Reserve(int n) { + ind_tempkey_AbsReserve(_db.ind_tempkey_n + n); +} + +// --- acr.FDb.ind_tempkey.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr::ind_tempkey_AbsReserve(int n) { u32 old_nbuckets = _db.ind_tempkey_buckets_n; - u32 new_nelems = _db.ind_tempkey_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3998,7 +4035,7 @@ void acr::ind_tempkey_Reserve(int n) { while (elem) { acr::FTempkey &row = *elem; acr::FTempkey* next = row.ind_tempkey_next; - u32 index = algo::cstring_Hash(0, row.tempkey) & (new_nbuckets-1); + u32 index = row.ind_tempkey_hashval & (new_nbuckets-1); row.ind_tempkey_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4015,24 +4052,20 @@ void acr::ind_tempkey_Reserve(int n) { // Find row by key. Return NULL if not found. acr::FSsimfile* acr::ind_ssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimfile_buckets_n - 1); - acr::FSsimfile* *e = &_db.ind_ssimfile_buckets_elems[index]; - acr::FSsimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimfile_next; - } while (true); + acr::FSsimfile *ret = _db.ind_ssimfile_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimfile_next) { + } return ret; } // --- acr.FDb.ind_ssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr::ind_ssimfile_InsertMaybe(acr::FSsimfile& row) { - ind_ssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimfile_next == (acr::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + row.ind_ssimfile_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimfile_Reserve(1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); acr::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; do { acr::FSsimfile* ret = *prev; @@ -4058,7 +4091,7 @@ bool acr::ind_ssimfile_InsertMaybe(acr::FSsimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr::ind_ssimfile_Remove(acr::FSsimfile& row) { if (LIKELY(row.ind_ssimfile_next != (acr::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); acr::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; // addr of pointer to current element while (acr::FSsimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4075,8 +4108,14 @@ void acr::ind_ssimfile_Remove(acr::FSsimfile& row) { // --- acr.FDb.ind_ssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr::ind_ssimfile_Reserve(int n) { + ind_ssimfile_AbsReserve(_db.ind_ssimfile_n + n); +} + +// --- acr.FDb.ind_ssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr::ind_ssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimfile_buckets_n; - u32 new_nelems = _db.ind_ssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4095,7 +4134,7 @@ void acr::ind_ssimfile_Reserve(int n) { while (elem) { acr::FSsimfile &row = *elem; acr::FSsimfile* next = row.ind_ssimfile_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimfile_hashval & (new_nbuckets-1); row.ind_ssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4397,24 +4436,20 @@ bool acr::ssimsort_XrefMaybe(acr::FSsimsort &row) { // Find row by key. Return NULL if not found. acr::FSsimsort* acr::ind_ssimsort_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimsort_buckets_n - 1); - acr::FSsimsort* *e = &_db.ind_ssimsort_buckets_elems[index]; - acr::FSsimsort* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimsort_next; - } while (true); + acr::FSsimsort *ret = _db.ind_ssimsort_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimsort_next) { + } return ret; } // --- acr.FDb.ind_ssimsort.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr::ind_ssimsort_InsertMaybe(acr::FSsimsort& row) { - ind_ssimsort_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimsort_next == (acr::FSsimsort*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimsort_buckets_n - 1); + row.ind_ssimsort_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimsort_Reserve(1); + u32 index = row.ind_ssimsort_hashval & (_db.ind_ssimsort_buckets_n - 1); acr::FSsimsort* *prev = &_db.ind_ssimsort_buckets_elems[index]; do { acr::FSsimsort* ret = *prev; @@ -4440,7 +4475,7 @@ bool acr::ind_ssimsort_InsertMaybe(acr::FSsimsort& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr::ind_ssimsort_Remove(acr::FSsimsort& row) { if (LIKELY(row.ind_ssimsort_next != (acr::FSsimsort*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimsort_buckets_n - 1); + u32 index = row.ind_ssimsort_hashval & (_db.ind_ssimsort_buckets_n - 1); acr::FSsimsort* *prev = &_db.ind_ssimsort_buckets_elems[index]; // addr of pointer to current element while (acr::FSsimsort *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4457,8 +4492,14 @@ void acr::ind_ssimsort_Remove(acr::FSsimsort& row) { // --- acr.FDb.ind_ssimsort.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr::ind_ssimsort_Reserve(int n) { + ind_ssimsort_AbsReserve(_db.ind_ssimsort_n + n); +} + +// --- acr.FDb.ind_ssimsort.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr::ind_ssimsort_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimsort_buckets_n; - u32 new_nelems = _db.ind_ssimsort_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4477,7 +4518,7 @@ void acr::ind_ssimsort_Reserve(int n) { while (elem) { acr::FSsimsort &row = *elem; acr::FSsimsort* next = row.ind_ssimsort_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimsort_hashval & (new_nbuckets-1); row.ind_ssimsort_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4679,14 +4720,9 @@ bool acr::funique_XrefMaybe(acr::FFunique &row) { // Find row by key. Return NULL if not found. acr::FUniqueattr* acr::ind_uniqueattr_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_uniqueattr_buckets_n - 1); - acr::FUniqueattr* *e = &_db.ind_uniqueattr_buckets_elems[index]; - acr::FUniqueattr* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).uniqueattr == key; - if (done) break; - e = &ret->ind_uniqueattr_next; - } while (true); + acr::FUniqueattr *ret = _db.ind_uniqueattr_buckets_elems[index]; + for (; ret && !((*ret).uniqueattr == key); ret = ret->ind_uniqueattr_next) { + } return ret; } @@ -4710,10 +4746,11 @@ acr::FUniqueattr& acr::ind_uniqueattr_GetOrCreate(const algo::strptr& key) { // --- acr.FDb.ind_uniqueattr.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr::ind_uniqueattr_InsertMaybe(acr::FUniqueattr& row) { - ind_uniqueattr_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_uniqueattr_next == (acr::FUniqueattr*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.uniqueattr) & (_db.ind_uniqueattr_buckets_n - 1); + row.ind_uniqueattr_hashval = algo::cstring_Hash(0, row.uniqueattr); + ind_uniqueattr_Reserve(1); + u32 index = row.ind_uniqueattr_hashval & (_db.ind_uniqueattr_buckets_n - 1); acr::FUniqueattr* *prev = &_db.ind_uniqueattr_buckets_elems[index]; do { acr::FUniqueattr* ret = *prev; @@ -4739,7 +4776,7 @@ bool acr::ind_uniqueattr_InsertMaybe(acr::FUniqueattr& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr::ind_uniqueattr_Remove(acr::FUniqueattr& row) { if (LIKELY(row.ind_uniqueattr_next != (acr::FUniqueattr*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.uniqueattr) & (_db.ind_uniqueattr_buckets_n - 1); + u32 index = row.ind_uniqueattr_hashval & (_db.ind_uniqueattr_buckets_n - 1); acr::FUniqueattr* *prev = &_db.ind_uniqueattr_buckets_elems[index]; // addr of pointer to current element while (acr::FUniqueattr *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4756,8 +4793,14 @@ void acr::ind_uniqueattr_Remove(acr::FUniqueattr& row) { // --- acr.FDb.ind_uniqueattr.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr::ind_uniqueattr_Reserve(int n) { + ind_uniqueattr_AbsReserve(_db.ind_uniqueattr_n + n); +} + +// --- acr.FDb.ind_uniqueattr.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr::ind_uniqueattr_AbsReserve(int n) { u32 old_nbuckets = _db.ind_uniqueattr_buckets_n; - u32 new_nelems = _db.ind_uniqueattr_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4776,7 +4819,7 @@ void acr::ind_uniqueattr_Reserve(int n) { while (elem) { acr::FUniqueattr &row = *elem; acr::FUniqueattr* next = row.ind_uniqueattr_next; - u32 index = algo::cstring_Hash(0, row.uniqueattr) & (new_nbuckets-1); + u32 index = row.ind_uniqueattr_hashval & (new_nbuckets-1); row.ind_uniqueattr_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -5297,15 +5340,11 @@ bool acr::ssimreq_XrefMaybe(acr::FSsimreq &row) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr::c_ssimreq_rec_Insert(acr::FRec& row) { - if (bool_Update(row._db_c_ssimreq_rec_in_ary,true)) { - // reserve space + if (!row.c_ssimreq_rec_in_ary) { c_ssimreq_rec_Reserve(1); - u32 n = _db.c_ssimreq_rec_n; - u32 at = n; - acr::FRec* *elems = _db.c_ssimreq_rec_elems; - elems[at] = &row; - _db.c_ssimreq_rec_n = n+1; - + u32 n = _db.c_ssimreq_rec_n++; + _db.c_ssimreq_rec_elems[n] = &row; + row.c_ssimreq_rec_in_ary = true; } } @@ -5314,7 +5353,7 @@ void acr::c_ssimreq_rec_Insert(acr::FRec& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool acr::c_ssimreq_rec_InsertMaybe(acr::FRec& row) { - bool retval = !row._db_c_ssimreq_rec_in_ary; + bool retval = !c_ssimreq_rec_InAryQ(row); c_ssimreq_rec_Insert(row); // check is performed in _Insert again return retval; } @@ -5322,18 +5361,18 @@ bool acr::c_ssimreq_rec_InsertMaybe(acr::FRec& row) { // --- acr.FDb.c_ssimreq_rec.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr::c_ssimreq_rec_Remove(acr::FRec& row) { - if (bool_Update(row._db_c_ssimreq_rec_in_ary,false)) { - int lim = _db.c_ssimreq_rec_n; + int n = _db.c_ssimreq_rec_n; + if (bool_Update(row.c_ssimreq_rec_in_ary,false)) { acr::FRec* *elems = _db.c_ssimreq_rec_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { acr::FRec* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(acr::FRec*) * (lim - j); + size_t nbytes = sizeof(acr::FRec*) * (n - j); memmove(elems + i, elems + j, nbytes); - _db.c_ssimreq_rec_n = lim - 1; + _db.c_ssimreq_rec_n = n - 1; break; } } @@ -5361,15 +5400,11 @@ void acr::c_ssimreq_rec_Reserve(u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr::c_ctype_front_Insert(acr::FCtype& row) { - if (bool_Update(row._db_c_ctype_front_in_ary,true)) { - // reserve space + if (!row.c_ctype_front_in_ary) { c_ctype_front_Reserve(1); - u32 n = _db.c_ctype_front_n; - u32 at = n; - acr::FCtype* *elems = _db.c_ctype_front_elems; - elems[at] = &row; - _db.c_ctype_front_n = n+1; - + u32 n = _db.c_ctype_front_n++; + _db.c_ctype_front_elems[n] = &row; + row.c_ctype_front_in_ary = true; } } @@ -5378,7 +5413,7 @@ void acr::c_ctype_front_Insert(acr::FCtype& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool acr::c_ctype_front_InsertMaybe(acr::FCtype& row) { - bool retval = !row._db_c_ctype_front_in_ary; + bool retval = !c_ctype_front_InAryQ(row); c_ctype_front_Insert(row); // check is performed in _Insert again return retval; } @@ -5386,18 +5421,18 @@ bool acr::c_ctype_front_InsertMaybe(acr::FCtype& row) { // --- acr.FDb.c_ctype_front.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr::c_ctype_front_Remove(acr::FCtype& row) { - if (bool_Update(row._db_c_ctype_front_in_ary,false)) { - int lim = _db.c_ctype_front_n; + int n = _db.c_ctype_front_n; + if (bool_Update(row.c_ctype_front_in_ary,false)) { acr::FCtype* *elems = _db.c_ctype_front_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { acr::FCtype* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(acr::FCtype*) * (lim - j); + size_t nbytes = sizeof(acr::FCtype*) * (n - j); memmove(elems + i, elems + j, nbytes); - _db.c_ctype_front_n = lim - 1; + _db.c_ctype_front_n = n - 1; break; } } @@ -5511,14 +5546,9 @@ bool acr::sortkey_XrefMaybe(acr::FSortkey &row) { // Find row by key. Return NULL if not found. acr::FSortkey* acr::ind_sortkey_Find(const acr::RecSortkey& key) { u32 index = acr::RecSortkey_Hash(0, key) & (_db.ind_sortkey_buckets_n - 1); - acr::FSortkey* *e = &_db.ind_sortkey_buckets_elems[index]; - acr::FSortkey* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).sortkey == key; - if (done) break; - e = &ret->ind_sortkey_next; - } while (true); + acr::FSortkey *ret = _db.ind_sortkey_buckets_elems[index]; + for (; ret && !((*ret).sortkey == key); ret = ret->ind_sortkey_next) { + } return ret; } @@ -5542,10 +5572,11 @@ acr::FSortkey& acr::ind_sortkey_GetOrCreate(const acr::RecSortkey& key) { // --- acr.FDb.ind_sortkey.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr::ind_sortkey_InsertMaybe(acr::FSortkey& row) { - ind_sortkey_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_sortkey_next == (acr::FSortkey*)-1)) {// check if in hash already - u32 index = acr::RecSortkey_Hash(0, row.sortkey) & (_db.ind_sortkey_buckets_n - 1); + row.ind_sortkey_hashval = acr::RecSortkey_Hash(0, row.sortkey); + ind_sortkey_Reserve(1); + u32 index = row.ind_sortkey_hashval & (_db.ind_sortkey_buckets_n - 1); acr::FSortkey* *prev = &_db.ind_sortkey_buckets_elems[index]; do { acr::FSortkey* ret = *prev; @@ -5571,7 +5602,7 @@ bool acr::ind_sortkey_InsertMaybe(acr::FSortkey& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr::ind_sortkey_Remove(acr::FSortkey& row) { if (LIKELY(row.ind_sortkey_next != (acr::FSortkey*)-1)) {// check if in hash already - u32 index = acr::RecSortkey_Hash(0, row.sortkey) & (_db.ind_sortkey_buckets_n - 1); + u32 index = row.ind_sortkey_hashval & (_db.ind_sortkey_buckets_n - 1); acr::FSortkey* *prev = &_db.ind_sortkey_buckets_elems[index]; // addr of pointer to current element while (acr::FSortkey *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -5588,8 +5619,14 @@ void acr::ind_sortkey_Remove(acr::FSortkey& row) { // --- acr.FDb.ind_sortkey.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr::ind_sortkey_Reserve(int n) { + ind_sortkey_AbsReserve(_db.ind_sortkey_n + n); +} + +// --- acr.FDb.ind_sortkey.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr::ind_sortkey_AbsReserve(int n) { u32 old_nbuckets = _db.ind_sortkey_buckets_n; - u32 new_nelems = _db.ind_sortkey_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -5608,7 +5645,7 @@ void acr::ind_sortkey_Reserve(int n) { while (elem) { acr::FSortkey &row = *elem; acr::FSortkey* next = row.ind_sortkey_next; - u32 index = acr::RecSortkey_Hash(0, row.sortkey) & (new_nbuckets-1); + u32 index = row.ind_sortkey_hashval & (new_nbuckets-1); row.ind_sortkey_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -6261,9 +6298,10 @@ void acr::FField_Init(acr::FField& field) { field.anon = bool(false); field.unique = bool(false); field.ctype_c_field_in_ary = bool(false); - field.zd_arg_next = (acr::FField*)-1; // (acr.FCtype.zd_arg) not-in-list - field.zd_arg_prev = NULL; // (acr.FCtype.zd_arg) + field.ctype_zd_arg_next = (acr::FField*)-1; // (acr.FCtype.zd_arg) not-in-list + field.ctype_zd_arg_prev = NULL; // (acr.FCtype.zd_arg) field.ind_field_next = (acr::FField*)-1; // (acr.FDb.ind_field) not-in-hash + field.ind_field_hashval = 0; // stored hash value } // --- acr.FField..Uninit @@ -6283,12 +6321,12 @@ void acr::FField_Uninit(acr::FField& field) { // --- acr.FFile.zd_frec.Insert // Insert row into linked list. If row is already in linked list, do nothing. void acr::zd_frec_Insert(acr::FFile& file, acr::FRec& row) { - if (!zd_frec_InLlistQ(row)) { + if (!file_zd_frec_InLlistQ(row)) { acr::FRec* old_tail = file.zd_frec_tail; - row.zd_frec_next = NULL; - row.zd_frec_prev = old_tail; + row.file_zd_frec_next = NULL; + row.file_zd_frec_prev = old_tail; file.zd_frec_tail = &row; - acr::FRec **new_row_a = &old_tail->zd_frec_next; + acr::FRec **new_row_a = &old_tail->file_zd_frec_next; acr::FRec **new_row_b = &file.zd_frec_head; acr::FRec **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -6298,22 +6336,22 @@ void acr::zd_frec_Insert(acr::FFile& file, acr::FRec& row) { // --- acr.FFile.zd_frec.Remove // Remove element from index. If element is not in index, do nothing. void acr::zd_frec_Remove(acr::FFile& file, acr::FRec& row) { - if (zd_frec_InLlistQ(row)) { + if (file_zd_frec_InLlistQ(row)) { acr::FRec* old_head = file.zd_frec_head; (void)old_head; // in case it's not used - acr::FRec* prev = row.zd_frec_prev; - acr::FRec* next = row.zd_frec_next; + acr::FRec* prev = row.file_zd_frec_prev; + acr::FRec* next = row.file_zd_frec_next; // if element is first, adjust list head; otherwise, adjust previous element's next - acr::FRec **new_next_a = &prev->zd_frec_next; + acr::FRec **new_next_a = &prev->file_zd_frec_next; acr::FRec **new_next_b = &file.zd_frec_head; acr::FRec **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - acr::FRec **new_prev_a = &next->zd_frec_prev; + acr::FRec **new_prev_a = &next->file_zd_frec_prev; acr::FRec **new_prev_b = &file.zd_frec_tail; acr::FRec **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; - row.zd_frec_next=(acr::FRec*)-1; // not-in-list + row.file_zd_frec_next=(acr::FRec*)-1; // not-in-list } } @@ -6324,9 +6362,9 @@ void acr::zd_frec_RemoveAll(acr::FFile& file) { file.zd_frec_head = NULL; file.zd_frec_tail = NULL; while (row) { - acr::FRec* row_next = row->zd_frec_next; - row->zd_frec_next = (acr::FRec*)-1; - row->zd_frec_prev = NULL; + acr::FRec* row_next = row->file_zd_frec_next; + row->file_zd_frec_next = (acr::FRec*)-1; + row->file_zd_frec_prev = NULL; row = row_next; } } @@ -6337,13 +6375,13 @@ acr::FRec* acr::zd_frec_RemoveFirst(acr::FFile& file) { acr::FRec *row = NULL; row = file.zd_frec_head; if (row) { - acr::FRec *next = row->zd_frec_next; + acr::FRec *next = row->file_zd_frec_next; file.zd_frec_head = next; - acr::FRec **new_end_a = &next->zd_frec_prev; + acr::FRec **new_end_a = &next->file_zd_frec_prev; acr::FRec **new_end_b = &file.zd_frec_tail; acr::FRec **new_end = next ? new_end_a : new_end_b; *new_end = NULL; - row->zd_frec_next = (acr::FRec*)-1; // mark as not-in-list + row->file_zd_frec_next = (acr::FRec*)-1; // mark as not-in-list } return row; } @@ -6497,12 +6535,12 @@ void acr::PlineKey_Print(acr::PlineKey& row, algo::cstring& str) { // --- acr.FPline.zd_child.Insert // Insert row into linked list. If row is already in linked list, do nothing. void acr::zd_child_Insert(acr::FPline& pline, acr::FPdep& row) { - if (!zd_child_InLlistQ(row)) { + if (!pline_zd_child_InLlistQ(row)) { acr::FPdep* old_tail = pline.zd_child_tail; - row.zd_child_next = NULL; - row.zd_child_prev = old_tail; + row.pline_zd_child_next = NULL; + row.pline_zd_child_prev = old_tail; pline.zd_child_tail = &row; - acr::FPdep **new_row_a = &old_tail->zd_child_next; + acr::FPdep **new_row_a = &old_tail->pline_zd_child_next; acr::FPdep **new_row_b = &pline.zd_child_head; acr::FPdep **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -6512,22 +6550,22 @@ void acr::zd_child_Insert(acr::FPline& pline, acr::FPdep& row) { // --- acr.FPline.zd_child.Remove // Remove element from index. If element is not in index, do nothing. void acr::zd_child_Remove(acr::FPline& pline, acr::FPdep& row) { - if (zd_child_InLlistQ(row)) { + if (pline_zd_child_InLlistQ(row)) { acr::FPdep* old_head = pline.zd_child_head; (void)old_head; // in case it's not used - acr::FPdep* prev = row.zd_child_prev; - acr::FPdep* next = row.zd_child_next; + acr::FPdep* prev = row.pline_zd_child_prev; + acr::FPdep* next = row.pline_zd_child_next; // if element is first, adjust list head; otherwise, adjust previous element's next - acr::FPdep **new_next_a = &prev->zd_child_next; + acr::FPdep **new_next_a = &prev->pline_zd_child_next; acr::FPdep **new_next_b = &pline.zd_child_head; acr::FPdep **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - acr::FPdep **new_prev_a = &next->zd_child_prev; + acr::FPdep **new_prev_a = &next->pline_zd_child_prev; acr::FPdep **new_prev_b = &pline.zd_child_tail; acr::FPdep **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; - row.zd_child_next=(acr::FPdep*)-1; // not-in-list + row.pline_zd_child_next=(acr::FPdep*)-1; // not-in-list } } @@ -6538,9 +6576,9 @@ void acr::zd_child_RemoveAll(acr::FPline& pline) { pline.zd_child_head = NULL; pline.zd_child_tail = NULL; while (row) { - acr::FPdep* row_next = row->zd_child_next; - row->zd_child_next = (acr::FPdep*)-1; - row->zd_child_prev = NULL; + acr::FPdep* row_next = row->pline_zd_child_next; + row->pline_zd_child_next = (acr::FPdep*)-1; + row->pline_zd_child_prev = NULL; row = row_next; } } @@ -6551,13 +6589,13 @@ acr::FPdep* acr::zd_child_RemoveFirst(acr::FPline& pline) { acr::FPdep *row = NULL; row = pline.zd_child_head; if (row) { - acr::FPdep *next = row->zd_child_next; + acr::FPdep *next = row->pline_zd_child_next; pline.zd_child_head = next; - acr::FPdep **new_end_a = &next->zd_child_prev; + acr::FPdep **new_end_a = &next->pline_zd_child_prev; acr::FPdep **new_end_b = &pline.zd_child_tail; acr::FPdep **new_end = next ? new_end_a : new_end_b; *new_end = NULL; - row->zd_child_next = (acr::FPdep*)-1; // mark as not-in-list + row->pline_zd_child_next = (acr::FPdep*)-1; // mark as not-in-list } return row; } @@ -6580,7 +6618,7 @@ void acr::ind_printattr_Cascdel(acr::FPrint& print) { for (int i = 0; i < print.ind_printattr_buckets_n; i++) { acr::FPrintAttr *elem = print.ind_printattr_buckets_elems[i]; while (elem) { - acr::FPrintAttr *next = elem->ind_printattr_next; + acr::FPrintAttr *next = elem->print_ind_printattr_next; printattr_Delete(*elem); elem = next; } @@ -6592,24 +6630,20 @@ void acr::ind_printattr_Cascdel(acr::FPrint& print) { // Find row by key. Return NULL if not found. acr::FPrintAttr* acr::ind_printattr_Find(acr::FPrint& print, const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (print.ind_printattr_buckets_n - 1); - acr::FPrintAttr* *e = &print.ind_printattr_buckets_elems[index]; - acr::FPrintAttr* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_printattr_next; - } while (true); + acr::FPrintAttr *ret = print.ind_printattr_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->print_ind_printattr_next) { + } return ret; } // --- acr.FPrint.ind_printattr.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr::ind_printattr_InsertMaybe(acr::FPrint& print, acr::FPrintAttr& row) { - ind_printattr_Reserve(print, 1); bool retval = true; // if already in hash, InsertMaybe returns true - if (LIKELY(row.ind_printattr_next == (acr::FPrintAttr*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (print.ind_printattr_buckets_n - 1); + if (LIKELY(row.print_ind_printattr_next == (acr::FPrintAttr*)-1)) {// check if in hash already + row.print_ind_printattr_hashval = algo::Smallstr100_Hash(0, row.field); + ind_printattr_Reserve(print, 1); + u32 index = row.print_ind_printattr_hashval & (print.ind_printattr_buckets_n - 1); acr::FPrintAttr* *prev = &print.ind_printattr_buckets_elems[index]; do { acr::FPrintAttr* ret = *prev; @@ -6620,10 +6654,10 @@ bool acr::ind_printattr_InsertMaybe(acr::FPrint& print, acr::FPrintAttr& row) { retval = false; break; } - prev = &ret->ind_printattr_next; + prev = &ret->print_ind_printattr_next; } while (true); if (retval) { - row.ind_printattr_next = *prev; + row.print_ind_printattr_next = *prev; print.ind_printattr_n++; *prev = &row; } @@ -6634,17 +6668,17 @@ bool acr::ind_printattr_InsertMaybe(acr::FPrint& print, acr::FPrintAttr& row) { // --- acr.FPrint.ind_printattr.Remove // Remove reference to element from hash index. If element is not in hash, do nothing void acr::ind_printattr_Remove(acr::FPrint& print, acr::FPrintAttr& row) { - if (LIKELY(row.ind_printattr_next != (acr::FPrintAttr*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (print.ind_printattr_buckets_n - 1); + if (LIKELY(row.print_ind_printattr_next != (acr::FPrintAttr*)-1)) {// check if in hash already + u32 index = row.print_ind_printattr_hashval & (print.ind_printattr_buckets_n - 1); acr::FPrintAttr* *prev = &print.ind_printattr_buckets_elems[index]; // addr of pointer to current element while (acr::FPrintAttr *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_printattr_next; // unlink (singly linked list) + *prev = next->print_ind_printattr_next; // unlink (singly linked list) print.ind_printattr_n--; - row.ind_printattr_next = (acr::FPrintAttr*)-1;// not-in-hash + row.print_ind_printattr_next = (acr::FPrintAttr*)-1;// not-in-hash break; } - prev = &next->ind_printattr_next; + prev = &next->print_ind_printattr_next; } } } @@ -6652,8 +6686,14 @@ void acr::ind_printattr_Remove(acr::FPrint& print, acr::FPrintAttr& row) { // --- acr.FPrint.ind_printattr.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr::ind_printattr_Reserve(acr::FPrint& print, int n) { + ind_printattr_AbsReserve(print,print.ind_printattr_n + n); +} + +// --- acr.FPrint.ind_printattr.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr::ind_printattr_AbsReserve(acr::FPrint& print, int n) { u32 old_nbuckets = print.ind_printattr_buckets_n; - u32 new_nelems = print.ind_printattr_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -6671,9 +6711,9 @@ void acr::ind_printattr_Reserve(acr::FPrint& print, int n) { acr::FPrintAttr* elem = print.ind_printattr_buckets_elems[i]; while (elem) { acr::FPrintAttr &row = *elem; - acr::FPrintAttr* next = row.ind_printattr_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); - row.ind_printattr_next = new_buckets[index]; + acr::FPrintAttr* next = row.print_ind_printattr_next; + u32 index = row.print_ind_printattr_hashval & (new_nbuckets-1); + row.print_ind_printattr_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } @@ -6689,14 +6729,9 @@ void acr::ind_printattr_Reserve(acr::FPrint& print, int n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr::c_pline_Insert(acr::FPrint& print, acr::FPline& row) { - // reserve space c_pline_Reserve(print, 1); - u32 n = print.c_pline_n; - u32 at = n; - acr::FPline* *elems = print.c_pline_elems; - elems[at] = &row; - print.c_pline_n = n+1; - + u32 n = print.c_pline_n++; + print.c_pline_elems[n] = &row; } // --- acr.FPrint.c_pline.ScanInsertMaybe @@ -6725,20 +6760,18 @@ bool acr::c_pline_ScanInsertMaybe(acr::FPrint& print, acr::FPline& row) { // --- acr.FPrint.c_pline.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr::c_pline_Remove(acr::FPrint& print, acr::FPline& row) { - int lim = print.c_pline_n; - acr::FPline* *elems = print.c_pline_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - acr::FPline* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr::FPline*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - print.c_pline_n = lim - 1; - break; + int n = print.c_pline_n; + int j=0; + for (int i=0; i acr::where_AllocN(acr::FQuery& query, int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- acr.FQuery.where.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr acr::where_AllocNAt(acr::FQuery& query, int n_elems, int at) { + where_Reserve(query, n_elems); + int n = query.where_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("acr.bad_alloc_n_at field:acr.FQuery.where comment:'index out of range'"); + } + acr::AttrRegx *elems = query.where_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(acr::AttrRegx)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) acr::AttrRegx(); // construct new element, default initialize + } + query.where_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- acr.FQuery.where.Remove // Remove item by index. If index outside of range, do nothing. void acr::where_Remove(acr::FQuery& query, u32 i) { @@ -7059,6 +7111,30 @@ algo::aryptr acr::where_AllocNVal(acr::FQuery& query, int n_elems return algo::aryptr(elems + old_n, n_elems); } +// --- acr.FQuery.where.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void acr::where_Insary(acr::FQuery& query, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= query.where_elems && rhs.elems < query.where_elems + query.where_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("acr.tary_alias field:acr.FQuery.where comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(query.where_elems+1))) { + FatalErrorExit("acr.bad_insary field:acr.FQuery.where comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = query.where_n - at; + where_Reserve(query, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (query.where_elems + at + nnew + i) acr::AttrRegx(query.where_elems[at + i]); + query.where_elems[at + i].~AttrRegx(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (query.where_elems + at + i) acr::AttrRegx(rhs[i]); + } + query.where_n += nnew; +} + // --- acr.FQuery.ssimfile.Print // Print back to string void acr::ssimfile_Print(acr::FQuery& query, algo::cstring &out) { @@ -7069,14 +7145,9 @@ void acr::ssimfile_Print(acr::FQuery& query, algo::cstring &out) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr::c_ctype_Insert(acr::FQuery& query, acr::FCtype& row) { - // reserve space c_ctype_Reserve(query, 1); - u32 n = query.c_ctype_n; - u32 at = n; - acr::FCtype* *elems = query.c_ctype_elems; - elems[at] = &row; - query.c_ctype_n = n+1; - + u32 n = query.c_ctype_n++; + query.c_ctype_elems[n] = &row; } // --- acr.FQuery.c_ctype.ScanInsertMaybe @@ -7105,20 +7176,18 @@ bool acr::c_ctype_ScanInsertMaybe(acr::FQuery& query, acr::FCtype& row) { // --- acr.FQuery.c_ctype.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr::c_ctype_Remove(acr::FQuery& query, acr::FCtype& row) { - int lim = query.c_ctype_n; - acr::FCtype* *elems = query.c_ctype_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - acr::FCtype* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr::FCtype*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - query.c_ctype_n = lim - 1; - break; + int n = query.c_ctype_n; + int j=0; + for (int i=0; i=0; i--) { - acr::FField* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr::FField*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - query.c_field_n = lim - 1; - break; + int n = query.c_field_n; + int j=0; + for (int i=0; i=0; i--) { - acr::FRec* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr::FRec*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - query.c_rec_n = lim - 1; - break; + int n = query.c_rec_n; + int j=0; + for (int i=0; i~cstring(); + algo_lib::malloc_FreeMem(rec.oldhead, sizeof(algo::cstring)); + rec.oldhead = NULL; + } +} + // --- acr.FRec..Init // Set all fields to initial values. void acr::FRec_Init(acr::FRec& rec) { rec.oldpkey = NULL; + rec.oldhead = NULL; rec.del = bool(false); rec.mod = bool(false); rec.metasel = bool(false); @@ -7414,17 +7496,18 @@ void acr::FRec_Init(acr::FRec& rec) { rec.p_infile = NULL; rec.p_ctype = NULL; rec.lineno = i32(0); - rec._db_c_ssimreq_rec_in_ary = bool(false); - rec.zd_ctype_rec_next = (acr::FRec*)-1; // (acr.FCtype.zd_ctype_rec) not-in-list - rec.zd_ctype_rec_prev = NULL; // (acr.FCtype.zd_ctype_rec) - rec.ind_ctype_rec_next = (acr::FRec*)-1; // (acr.FCtype.ind_ctype_rec) not-in-hash - rec.zd_ctype_selrec_next = (acr::FRec*)-1; // (acr.FCtype.zd_ctype_selrec) not-in-list - rec.zd_ctype_selrec_prev = NULL; // (acr.FCtype.zd_ctype_selrec) + rec.c_ssimreq_rec_in_ary = bool(false); + rec.ctype_zd_rec_next = (acr::FRec*)-1; // (acr.FCtype.zd_rec) not-in-list + rec.ctype_zd_rec_prev = NULL; // (acr.FCtype.zd_rec) + rec.ctype_ind_ctype_rec_next = (acr::FRec*)-1; // (acr.FCtype.ind_ctype_rec) not-in-hash + rec.ctype_ind_ctype_rec_hashval = 0; // stored hash value + rec.ctype_zd_selrec_next = (acr::FRec*)-1; // (acr.FCtype.zd_selrec) not-in-list + rec.ctype_zd_selrec_prev = NULL; // (acr.FCtype.zd_selrec) rec.rec_next = (acr::FRec*)-1; // (acr.FDb.rec) not-in-tpool's freelist rec.zd_all_selrec_next = (acr::FRec*)-1; // (acr.FDb.zd_all_selrec) not-in-list rec.zd_all_selrec_prev = NULL; // (acr.FDb.zd_all_selrec) - rec.zd_frec_next = (acr::FRec*)-1; // (acr.FFile.zd_frec) not-in-list - rec.zd_frec_prev = NULL; // (acr.FFile.zd_frec) + rec.file_zd_frec_next = (acr::FRec*)-1; // (acr.FFile.zd_frec) not-in-list + rec.file_zd_frec_prev = NULL; // (acr.FFile.zd_frec) } // --- acr.FRec..Uninit @@ -7440,12 +7523,15 @@ void acr::FRec_Uninit(acr::FRec& rec) { ind_ctype_rec_Remove(*p_p_ctype, row);// remove rec from index ind_ctype_rec } if (p_p_ctype) { - zd_ctype_selrec_Remove(*p_p_ctype, row);// remove rec from index zd_ctype_selrec + zd_selrec_Remove(*p_p_ctype, row);// remove rec from index zd_selrec } if (p_p_ctype) { - zd_ctype_rec_Remove(*p_p_ctype, row);// remove rec from index zd_ctype_rec + zd_rec_Remove(*p_p_ctype, row);// remove rec from index zd_rec } + // acr.FRec.oldhead.Uninit (Delptr) //Old tuple head (if renamed) + oldhead_Delete(rec); + // acr.FRec.oldpkey.Uninit (Delptr) //Old pkey (if renamed) oldpkey_Delete(rec); } @@ -7487,8 +7573,8 @@ void acr::FRec_Print(acr::FRec& row, algo::cstring& str) { i32_Print(row.lineno, temp); PrintAttrSpaceReset(str,"lineno", temp); - bool_Print(row._db_c_ssimreq_rec_in_ary, temp); - PrintAttrSpaceReset(str,"_db_c_ssimreq_rec_in_ary", temp); + bool_Print(row.c_ssimreq_rec_in_ary, temp); + PrintAttrSpaceReset(str,"c_ssimreq_rec_in_ary", temp); } // --- acr.FSmallstr.base.CopyOut @@ -7708,14 +7794,9 @@ void acr::FUniqueattr_Uninit(acr::FUniqueattr& uniqueattr) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr::c_cmtrec_Insert(acr::FWrite& write, acr::FRec& row) { - // reserve space c_cmtrec_Reserve(write, 1); - u32 n = write.c_cmtrec_n; - u32 at = n; - acr::FRec* *elems = write.c_cmtrec_elems; - elems[at] = &row; - write.c_cmtrec_n = n+1; - + u32 n = write.c_cmtrec_n++; + write.c_cmtrec_elems[n] = &row; } // --- acr.FWrite.c_cmtrec.ScanInsertMaybe @@ -7744,20 +7825,18 @@ bool acr::c_cmtrec_ScanInsertMaybe(acr::FWrite& write, acr::FRec& row) { // --- acr.FWrite.c_cmtrec.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr::c_cmtrec_Remove(acr::FWrite& write, acr::FRec& row) { - int lim = write.c_cmtrec_n; - acr::FRec* *elems = write.c_cmtrec_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - acr::FRec* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr::FRec*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - write.c_cmtrec_n = lim - 1; - break; + int n = write.c_cmtrec_n; + int j=0; + for (int i=0; i=0; i--) { + for (int i = n-1; i>=0; i--) { acr_in::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(acr_in::FField*) * (lim - j); + size_t nbytes = sizeof(acr_in::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_field_n = lim - 1; + ctype.c_field_n = n - 1; break; } } @@ -193,14 +192,9 @@ void acr_in::c_field_Reserve(acr_in::FCtype& ctype, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr_in::c_ctype_Insert(acr_in::FCtype& ctype, acr_in::FCtype& row) { - // reserve space c_ctype_Reserve(ctype, 1); - u32 n = ctype.c_ctype_n; - u32 at = n; - acr_in::FCtype* *elems = ctype.c_ctype_elems; - elems[at] = &row; - ctype.c_ctype_n = n+1; - + u32 n = ctype.c_ctype_n++; + ctype.c_ctype_elems[n] = &row; } // --- acr_in.FCtype.c_ctype.ScanInsertMaybe @@ -229,20 +223,18 @@ bool acr_in::c_ctype_ScanInsertMaybe(acr_in::FCtype& ctype, acr_in::FCtype& row) // --- acr_in.FCtype.c_ctype.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr_in::c_ctype_Remove(acr_in::FCtype& ctype, acr_in::FCtype& row) { - int lim = ctype.c_ctype_n; - acr_in::FCtype* *elems = ctype.c_ctype_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - acr_in::FCtype* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr_in::FCtype*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - ctype.c_ctype_n = lim - 1; - break; + int n = ctype.c_ctype_n; + int j=0; + for (int i=0; iind_tuple_next; - } while (true); + acr_in::FTuple *ret = _db.ind_tuple_buckets_elems[index]; + for (; ret && !((*ret).key == key); ret = ret->ind_tuple_next) { + } return ret; } @@ -436,10 +424,11 @@ acr_in::FTuple& acr_in::ind_tuple_GetOrCreate(const algo::strptr& key) { // --- acr_in.FDb.ind_tuple.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_in::ind_tuple_InsertMaybe(acr_in::FTuple& row) { - ind_tuple_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_tuple_next == (acr_in::FTuple*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.key) & (_db.ind_tuple_buckets_n - 1); + row.ind_tuple_hashval = algo::cstring_Hash(0, row.key); + ind_tuple_Reserve(1); + u32 index = row.ind_tuple_hashval & (_db.ind_tuple_buckets_n - 1); acr_in::FTuple* *prev = &_db.ind_tuple_buckets_elems[index]; do { acr_in::FTuple* ret = *prev; @@ -465,7 +454,7 @@ bool acr_in::ind_tuple_InsertMaybe(acr_in::FTuple& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_in::ind_tuple_Remove(acr_in::FTuple& row) { if (LIKELY(row.ind_tuple_next != (acr_in::FTuple*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.key) & (_db.ind_tuple_buckets_n - 1); + u32 index = row.ind_tuple_hashval & (_db.ind_tuple_buckets_n - 1); acr_in::FTuple* *prev = &_db.ind_tuple_buckets_elems[index]; // addr of pointer to current element while (acr_in::FTuple *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -482,8 +471,14 @@ void acr_in::ind_tuple_Remove(acr_in::FTuple& row) { // --- acr_in.FDb.ind_tuple.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_in::ind_tuple_Reserve(int n) { + ind_tuple_AbsReserve(_db.ind_tuple_n + n); +} + +// --- acr_in.FDb.ind_tuple.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_in::ind_tuple_AbsReserve(int n) { u32 old_nbuckets = _db.ind_tuple_buckets_n; - u32 new_nelems = _db.ind_tuple_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -502,7 +497,7 @@ void acr_in::ind_tuple_Reserve(int n) { while (elem) { acr_in::FTuple &row = *elem; acr_in::FTuple* next = row.ind_tuple_next; - u32 index = algo::cstring_Hash(0, row.key) & (new_nbuckets-1); + u32 index = row.ind_tuple_hashval & (new_nbuckets-1); row.ind_tuple_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -601,9 +596,8 @@ void acr_in::ReadArgv() { } if (ch_N(attrname) == 0) { err << "acr_in: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:acr_in.FDb.cmdline @@ -657,7 +654,7 @@ void acr_in::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -796,8 +793,8 @@ bool acr_in::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && acr_in::LoadTuplesFile(algo::SsimFname(root,"dev.target"),recursive); retval = retval && acr_in::LoadTuplesFile(algo::SsimFname(root,"dev.targdep"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -1103,14 +1100,9 @@ bool acr_in::field_XrefMaybe(acr_in::FField &row) { // Find row by key. Return NULL if not found. acr_in::FField* acr_in::ind_field_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_field_buckets_n - 1); - acr_in::FField* *e = &_db.ind_field_buckets_elems[index]; - acr_in::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + acr_in::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_field_next) { + } return ret; } @@ -1125,10 +1117,11 @@ acr_in::FField& acr_in::ind_field_FindX(const algo::strptr& key) { // --- acr_in.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_in::ind_field_InsertMaybe(acr_in::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (acr_in::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::Smallstr100_Hash(0, row.field); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); acr_in::FField* *prev = &_db.ind_field_buckets_elems[index]; do { acr_in::FField* ret = *prev; @@ -1154,7 +1147,7 @@ bool acr_in::ind_field_InsertMaybe(acr_in::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_in::ind_field_Remove(acr_in::FField& row) { if (LIKELY(row.ind_field_next != (acr_in::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); acr_in::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (acr_in::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1171,8 +1164,14 @@ void acr_in::ind_field_Remove(acr_in::FField& row) { // --- acr_in.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_in::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- acr_in.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_in::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1191,7 +1190,7 @@ void acr_in::ind_field_Reserve(int n) { while (elem) { acr_in::FField &row = *elem; acr_in::FField* next = row.ind_field_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1314,14 +1313,9 @@ bool acr_in::ctype_XrefMaybe(acr_in::FCtype &row) { // Find row by key. Return NULL if not found. acr_in::FCtype* acr_in::ind_ctype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctype_buckets_n - 1); - acr_in::FCtype* *e = &_db.ind_ctype_buckets_elems[index]; - acr_in::FCtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctype_next; - } while (true); + acr_in::FCtype *ret = _db.ind_ctype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctype_next) { + } return ret; } @@ -1336,10 +1330,11 @@ acr_in::FCtype& acr_in::ind_ctype_FindX(const algo::strptr& key) { // --- acr_in.FDb.ind_ctype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_in::ind_ctype_InsertMaybe(acr_in::FCtype& row) { - ind_ctype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ctype_next == (acr_in::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + row.ind_ctype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctype_Reserve(1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); acr_in::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; do { acr_in::FCtype* ret = *prev; @@ -1365,7 +1360,7 @@ bool acr_in::ind_ctype_InsertMaybe(acr_in::FCtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_in::ind_ctype_Remove(acr_in::FCtype& row) { if (LIKELY(row.ind_ctype_next != (acr_in::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); acr_in::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; // addr of pointer to current element while (acr_in::FCtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1382,8 +1377,14 @@ void acr_in::ind_ctype_Remove(acr_in::FCtype& row) { // --- acr_in.FDb.ind_ctype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_in::ind_ctype_Reserve(int n) { + ind_ctype_AbsReserve(_db.ind_ctype_n + n); +} + +// --- acr_in.FDb.ind_ctype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_in::ind_ctype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ctype_buckets_n; - u32 new_nelems = _db.ind_ctype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1402,7 +1403,7 @@ void acr_in::ind_ctype_Reserve(int n) { while (elem) { acr_in::FCtype &row = *elem; acr_in::FCtype* next = row.ind_ctype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ctype_hashval & (new_nbuckets-1); row.ind_ctype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1631,14 +1632,9 @@ bool acr_in::ns_XrefMaybe(acr_in::FNs &row) { // Find row by key. Return NULL if not found. acr_in::FNs* acr_in::ind_ns_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_ns_buckets_n - 1); - acr_in::FNs* *e = &_db.ind_ns_buckets_elems[index]; - acr_in::FNs* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ns == key; - if (done) break; - e = &ret->ind_ns_next; - } while (true); + acr_in::FNs *ret = _db.ind_ns_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_ns_next) { + } return ret; } @@ -1670,10 +1666,11 @@ acr_in::FNs& acr_in::ind_ns_GetOrCreate(const algo::strptr& key) { // --- acr_in.FDb.ind_ns.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_in::ind_ns_InsertMaybe(acr_in::FNs& row) { - ind_ns_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ns_next == (acr_in::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + row.ind_ns_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_ns_Reserve(1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); acr_in::FNs* *prev = &_db.ind_ns_buckets_elems[index]; do { acr_in::FNs* ret = *prev; @@ -1699,7 +1696,7 @@ bool acr_in::ind_ns_InsertMaybe(acr_in::FNs& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_in::ind_ns_Remove(acr_in::FNs& row) { if (LIKELY(row.ind_ns_next != (acr_in::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); acr_in::FNs* *prev = &_db.ind_ns_buckets_elems[index]; // addr of pointer to current element while (acr_in::FNs *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1716,8 +1713,14 @@ void acr_in::ind_ns_Remove(acr_in::FNs& row) { // --- acr_in.FDb.ind_ns.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_in::ind_ns_Reserve(int n) { + ind_ns_AbsReserve(_db.ind_ns_n + n); +} + +// --- acr_in.FDb.ind_ns.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_in::ind_ns_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ns_buckets_n; - u32 new_nelems = _db.ind_ns_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1736,7 +1739,7 @@ void acr_in::ind_ns_Reserve(int n) { while (elem) { acr_in::FNs &row = *elem; acr_in::FNs* next = row.ind_ns_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_ns_hashval & (new_nbuckets-1); row.ind_ns_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2105,14 +2108,9 @@ bool acr_in::dispsig_XrefMaybe(acr_in::FDispsig &row) { // Find row by key. Return NULL if not found. acr_in::FDispsig* acr_in::ind_dispsig_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_dispsig_buckets_n - 1); - acr_in::FDispsig* *e = &_db.ind_dispsig_buckets_elems[index]; - acr_in::FDispsig* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).dispsig == key; - if (done) break; - e = &ret->ind_dispsig_next; - } while (true); + acr_in::FDispsig *ret = _db.ind_dispsig_buckets_elems[index]; + for (; ret && !((*ret).dispsig == key); ret = ret->ind_dispsig_next) { + } return ret; } @@ -2127,10 +2125,11 @@ acr_in::FDispsig& acr_in::ind_dispsig_FindX(const algo::strptr& key) { // --- acr_in.FDb.ind_dispsig.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_in::ind_dispsig_InsertMaybe(acr_in::FDispsig& row) { - ind_dispsig_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_dispsig_next == (acr_in::FDispsig*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.dispsig) & (_db.ind_dispsig_buckets_n - 1); + row.ind_dispsig_hashval = algo::Smallstr50_Hash(0, row.dispsig); + ind_dispsig_Reserve(1); + u32 index = row.ind_dispsig_hashval & (_db.ind_dispsig_buckets_n - 1); acr_in::FDispsig* *prev = &_db.ind_dispsig_buckets_elems[index]; do { acr_in::FDispsig* ret = *prev; @@ -2156,7 +2155,7 @@ bool acr_in::ind_dispsig_InsertMaybe(acr_in::FDispsig& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_in::ind_dispsig_Remove(acr_in::FDispsig& row) { if (LIKELY(row.ind_dispsig_next != (acr_in::FDispsig*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.dispsig) & (_db.ind_dispsig_buckets_n - 1); + u32 index = row.ind_dispsig_hashval & (_db.ind_dispsig_buckets_n - 1); acr_in::FDispsig* *prev = &_db.ind_dispsig_buckets_elems[index]; // addr of pointer to current element while (acr_in::FDispsig *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2173,8 +2172,14 @@ void acr_in::ind_dispsig_Remove(acr_in::FDispsig& row) { // --- acr_in.FDb.ind_dispsig.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_in::ind_dispsig_Reserve(int n) { + ind_dispsig_AbsReserve(_db.ind_dispsig_n + n); +} + +// --- acr_in.FDb.ind_dispsig.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_in::ind_dispsig_AbsReserve(int n) { u32 old_nbuckets = _db.ind_dispsig_buckets_n; - u32 new_nelems = _db.ind_dispsig_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2193,7 +2198,7 @@ void acr_in::ind_dispsig_Reserve(int n) { while (elem) { acr_in::FDispsig &row = *elem; acr_in::FDispsig* next = row.ind_dispsig_next; - u32 index = algo::Smallstr50_Hash(0, row.dispsig) & (new_nbuckets-1); + u32 index = row.ind_dispsig_hashval & (new_nbuckets-1); row.ind_dispsig_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2426,14 +2431,9 @@ acr_in::FCtype* acr_in::zd_related_RemoveFirst() { // Find row by key. Return NULL if not found. acr_in::FFinput* acr_in::ind_finput_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_finput_buckets_n - 1); - acr_in::FFinput* *e = &_db.ind_finput_buckets_elems[index]; - acr_in::FFinput* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_finput_next; - } while (true); + acr_in::FFinput *ret = _db.ind_finput_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_finput_next) { + } return ret; } @@ -2448,10 +2448,11 @@ acr_in::FFinput& acr_in::ind_finput_FindX(const algo::strptr& key) { // --- acr_in.FDb.ind_finput.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_in::ind_finput_InsertMaybe(acr_in::FFinput& row) { - ind_finput_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_finput_next == (acr_in::FFinput*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_finput_buckets_n - 1); + row.ind_finput_hashval = algo::Smallstr100_Hash(0, row.field); + ind_finput_Reserve(1); + u32 index = row.ind_finput_hashval & (_db.ind_finput_buckets_n - 1); acr_in::FFinput* *prev = &_db.ind_finput_buckets_elems[index]; do { acr_in::FFinput* ret = *prev; @@ -2477,7 +2478,7 @@ bool acr_in::ind_finput_InsertMaybe(acr_in::FFinput& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_in::ind_finput_Remove(acr_in::FFinput& row) { if (LIKELY(row.ind_finput_next != (acr_in::FFinput*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_finput_buckets_n - 1); + u32 index = row.ind_finput_hashval & (_db.ind_finput_buckets_n - 1); acr_in::FFinput* *prev = &_db.ind_finput_buckets_elems[index]; // addr of pointer to current element while (acr_in::FFinput *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2494,8 +2495,14 @@ void acr_in::ind_finput_Remove(acr_in::FFinput& row) { // --- acr_in.FDb.ind_finput.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_in::ind_finput_Reserve(int n) { + ind_finput_AbsReserve(_db.ind_finput_n + n); +} + +// --- acr_in.FDb.ind_finput.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_in::ind_finput_AbsReserve(int n) { u32 old_nbuckets = _db.ind_finput_buckets_n; - u32 new_nelems = _db.ind_finput_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2514,7 +2521,7 @@ void acr_in::ind_finput_Reserve(int n) { while (elem) { acr_in::FFinput &row = *elem; acr_in::FFinput* next = row.ind_finput_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_finput_hashval & (new_nbuckets-1); row.ind_finput_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2646,14 +2653,9 @@ bool acr_in::target_XrefMaybe(acr_in::FTarget &row) { // Find row by key. Return NULL if not found. acr_in::FTarget* acr_in::ind_target_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_target_buckets_n - 1); - acr_in::FTarget* *e = &_db.ind_target_buckets_elems[index]; - acr_in::FTarget* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).target == key; - if (done) break; - e = &ret->ind_target_next; - } while (true); + acr_in::FTarget *ret = _db.ind_target_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_target_next) { + } return ret; } @@ -2668,10 +2670,11 @@ acr_in::FTarget& acr_in::ind_target_FindX(const algo::strptr& key) { // --- acr_in.FDb.ind_target.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_in::ind_target_InsertMaybe(acr_in::FTarget& row) { - ind_target_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_target_next == (acr_in::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + row.ind_target_hashval = algo::Smallstr16_Hash(0, row.target); + ind_target_Reserve(1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); acr_in::FTarget* *prev = &_db.ind_target_buckets_elems[index]; do { acr_in::FTarget* ret = *prev; @@ -2697,7 +2700,7 @@ bool acr_in::ind_target_InsertMaybe(acr_in::FTarget& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_in::ind_target_Remove(acr_in::FTarget& row) { if (LIKELY(row.ind_target_next != (acr_in::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); acr_in::FTarget* *prev = &_db.ind_target_buckets_elems[index]; // addr of pointer to current element while (acr_in::FTarget *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2714,8 +2717,14 @@ void acr_in::ind_target_Remove(acr_in::FTarget& row) { // --- acr_in.FDb.ind_target.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_in::ind_target_Reserve(int n) { + ind_target_AbsReserve(_db.ind_target_n + n); +} + +// --- acr_in.FDb.ind_target.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_in::ind_target_AbsReserve(int n) { u32 old_nbuckets = _db.ind_target_buckets_n; - u32 new_nelems = _db.ind_target_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2734,7 +2743,7 @@ void acr_in::ind_target_Reserve(int n) { while (elem) { acr_in::FTarget &row = *elem; acr_in::FTarget* next = row.ind_target_next; - u32 index = algo::Smallstr16_Hash(0, row.target) & (new_nbuckets-1); + u32 index = row.ind_target_hashval & (new_nbuckets-1); row.ind_target_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3045,14 +3054,9 @@ bool acr_in::nsssimfile_XrefMaybe(acr_in::FNsssimfile &row) { // Find row by key. Return NULL if not found. acr_in::FNsssimfile* acr_in::ind_nsssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_nsssimfile_buckets_n - 1); - acr_in::FNsssimfile* *e = &_db.ind_nsssimfile_buckets_elems[index]; - acr_in::FNsssimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).nsssimfile == key; - if (done) break; - e = &ret->ind_nsssimfile_next; - } while (true); + acr_in::FNsssimfile *ret = _db.ind_nsssimfile_buckets_elems[index]; + for (; ret && !((*ret).nsssimfile == key); ret = ret->ind_nsssimfile_next) { + } return ret; } @@ -3067,10 +3071,11 @@ acr_in::FNsssimfile& acr_in::ind_nsssimfile_FindX(const algo::strptr& key) { // --- acr_in.FDb.ind_nsssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_in::ind_nsssimfile_InsertMaybe(acr_in::FNsssimfile& row) { - ind_nsssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_nsssimfile_next == (acr_in::FNsssimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.nsssimfile) & (_db.ind_nsssimfile_buckets_n - 1); + row.ind_nsssimfile_hashval = algo::Smallstr200_Hash(0, row.nsssimfile); + ind_nsssimfile_Reserve(1); + u32 index = row.ind_nsssimfile_hashval & (_db.ind_nsssimfile_buckets_n - 1); acr_in::FNsssimfile* *prev = &_db.ind_nsssimfile_buckets_elems[index]; do { acr_in::FNsssimfile* ret = *prev; @@ -3096,7 +3101,7 @@ bool acr_in::ind_nsssimfile_InsertMaybe(acr_in::FNsssimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_in::ind_nsssimfile_Remove(acr_in::FNsssimfile& row) { if (LIKELY(row.ind_nsssimfile_next != (acr_in::FNsssimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.nsssimfile) & (_db.ind_nsssimfile_buckets_n - 1); + u32 index = row.ind_nsssimfile_hashval & (_db.ind_nsssimfile_buckets_n - 1); acr_in::FNsssimfile* *prev = &_db.ind_nsssimfile_buckets_elems[index]; // addr of pointer to current element while (acr_in::FNsssimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3113,8 +3118,14 @@ void acr_in::ind_nsssimfile_Remove(acr_in::FNsssimfile& row) { // --- acr_in.FDb.ind_nsssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_in::ind_nsssimfile_Reserve(int n) { + ind_nsssimfile_AbsReserve(_db.ind_nsssimfile_n + n); +} + +// --- acr_in.FDb.ind_nsssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_in::ind_nsssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_nsssimfile_buckets_n; - u32 new_nelems = _db.ind_nsssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3133,7 +3144,7 @@ void acr_in::ind_nsssimfile_Reserve(int n) { while (elem) { acr_in::FNsssimfile &row = *elem; acr_in::FNsssimfile* next = row.ind_nsssimfile_next; - u32 index = algo::Smallstr200_Hash(0, row.nsssimfile) & (new_nbuckets-1); + u32 index = row.ind_nsssimfile_hashval & (new_nbuckets-1); row.ind_nsssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3150,14 +3161,9 @@ void acr_in::ind_nsssimfile_Reserve(int n) { // Find row by key. Return NULL if not found. acr_in::FSsimfile* acr_in::ind_ssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimfile_buckets_n - 1); - acr_in::FSsimfile* *e = &_db.ind_ssimfile_buckets_elems[index]; - acr_in::FSsimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimfile_next; - } while (true); + acr_in::FSsimfile *ret = _db.ind_ssimfile_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimfile_next) { + } return ret; } @@ -3172,10 +3178,11 @@ acr_in::FSsimfile& acr_in::ind_ssimfile_FindX(const algo::strptr& key) { // --- acr_in.FDb.ind_ssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool acr_in::ind_ssimfile_InsertMaybe(acr_in::FSsimfile& row) { - ind_ssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimfile_next == (acr_in::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + row.ind_ssimfile_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimfile_Reserve(1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); acr_in::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; do { acr_in::FSsimfile* ret = *prev; @@ -3201,7 +3208,7 @@ bool acr_in::ind_ssimfile_InsertMaybe(acr_in::FSsimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void acr_in::ind_ssimfile_Remove(acr_in::FSsimfile& row) { if (LIKELY(row.ind_ssimfile_next != (acr_in::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); acr_in::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; // addr of pointer to current element while (acr_in::FSsimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3218,8 +3225,14 @@ void acr_in::ind_ssimfile_Remove(acr_in::FSsimfile& row) { // --- acr_in.FDb.ind_ssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void acr_in::ind_ssimfile_Reserve(int n) { + ind_ssimfile_AbsReserve(_db.ind_ssimfile_n + n); +} + +// --- acr_in.FDb.ind_ssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void acr_in::ind_ssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimfile_buckets_n; - u32 new_nelems = _db.ind_ssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3238,7 +3251,7 @@ void acr_in::ind_ssimfile_Reserve(int n) { while (elem) { acr_in::FSsimfile &row = *elem; acr_in::FSsimfile* next = row.ind_ssimfile_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimfile_hashval & (new_nbuckets-1); row.ind_ssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3625,6 +3638,7 @@ void acr_in::FField_Init(acr_in::FField& field) { field.c_substr = NULL; field.ctype_c_field_in_ary = bool(false); field.ind_field_next = (acr_in::FField*)-1; // (acr_in.FDb.ind_field) not-in-hash + field.ind_field_hashval = 0; // stored hash value } // --- acr_in.FField..Uninit @@ -3690,12 +3704,12 @@ void acr_in::ns_CopyIn(acr_in::FNs &row, dmmeta::Ns &in) { // --- acr_in.FNs.zd_nsssimfile_ns.Insert // Insert row into linked list. If row is already in linked list, do nothing. void acr_in::zd_nsssimfile_ns_Insert(acr_in::FNs& ns, acr_in::FNsssimfile& row) { - if (!zd_nsssimfile_ns_InLlistQ(row)) { + if (!ns_zd_nsssimfile_ns_InLlistQ(row)) { acr_in::FNsssimfile* old_tail = ns.zd_nsssimfile_ns_tail; - row.zd_nsssimfile_ns_next = NULL; - row.zd_nsssimfile_ns_prev = old_tail; + row.ns_zd_nsssimfile_ns_next = NULL; + row.ns_zd_nsssimfile_ns_prev = old_tail; ns.zd_nsssimfile_ns_tail = &row; - acr_in::FNsssimfile **new_row_a = &old_tail->zd_nsssimfile_ns_next; + acr_in::FNsssimfile **new_row_a = &old_tail->ns_zd_nsssimfile_ns_next; acr_in::FNsssimfile **new_row_b = &ns.zd_nsssimfile_ns_head; acr_in::FNsssimfile **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -3706,23 +3720,23 @@ void acr_in::zd_nsssimfile_ns_Insert(acr_in::FNs& ns, acr_in::FNsssimfile& row) // --- acr_in.FNs.zd_nsssimfile_ns.Remove // Remove element from index. If element is not in index, do nothing. void acr_in::zd_nsssimfile_ns_Remove(acr_in::FNs& ns, acr_in::FNsssimfile& row) { - if (zd_nsssimfile_ns_InLlistQ(row)) { + if (ns_zd_nsssimfile_ns_InLlistQ(row)) { acr_in::FNsssimfile* old_head = ns.zd_nsssimfile_ns_head; (void)old_head; // in case it's not used - acr_in::FNsssimfile* prev = row.zd_nsssimfile_ns_prev; - acr_in::FNsssimfile* next = row.zd_nsssimfile_ns_next; + acr_in::FNsssimfile* prev = row.ns_zd_nsssimfile_ns_prev; + acr_in::FNsssimfile* next = row.ns_zd_nsssimfile_ns_next; // if element is first, adjust list head; otherwise, adjust previous element's next - acr_in::FNsssimfile **new_next_a = &prev->zd_nsssimfile_ns_next; + acr_in::FNsssimfile **new_next_a = &prev->ns_zd_nsssimfile_ns_next; acr_in::FNsssimfile **new_next_b = &ns.zd_nsssimfile_ns_head; acr_in::FNsssimfile **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - acr_in::FNsssimfile **new_prev_a = &next->zd_nsssimfile_ns_prev; + acr_in::FNsssimfile **new_prev_a = &next->ns_zd_nsssimfile_ns_prev; acr_in::FNsssimfile **new_prev_b = &ns.zd_nsssimfile_ns_tail; acr_in::FNsssimfile **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; ns.zd_nsssimfile_ns_n--; - row.zd_nsssimfile_ns_next=(acr_in::FNsssimfile*)-1; // not-in-list + row.ns_zd_nsssimfile_ns_next=(acr_in::FNsssimfile*)-1; // not-in-list } } @@ -3734,9 +3748,9 @@ void acr_in::zd_nsssimfile_ns_RemoveAll(acr_in::FNs& ns) { ns.zd_nsssimfile_ns_tail = NULL; ns.zd_nsssimfile_ns_n = 0; while (row) { - acr_in::FNsssimfile* row_next = row->zd_nsssimfile_ns_next; - row->zd_nsssimfile_ns_next = (acr_in::FNsssimfile*)-1; - row->zd_nsssimfile_ns_prev = NULL; + acr_in::FNsssimfile* row_next = row->ns_zd_nsssimfile_ns_next; + row->ns_zd_nsssimfile_ns_next = (acr_in::FNsssimfile*)-1; + row->ns_zd_nsssimfile_ns_prev = NULL; row = row_next; } } @@ -3747,14 +3761,14 @@ acr_in::FNsssimfile* acr_in::zd_nsssimfile_ns_RemoveFirst(acr_in::FNs& ns) { acr_in::FNsssimfile *row = NULL; row = ns.zd_nsssimfile_ns_head; if (row) { - acr_in::FNsssimfile *next = row->zd_nsssimfile_ns_next; + acr_in::FNsssimfile *next = row->ns_zd_nsssimfile_ns_next; ns.zd_nsssimfile_ns_head = next; - acr_in::FNsssimfile **new_end_a = &next->zd_nsssimfile_ns_prev; + acr_in::FNsssimfile **new_end_a = &next->ns_zd_nsssimfile_ns_prev; acr_in::FNsssimfile **new_end_b = &ns.zd_nsssimfile_ns_tail; acr_in::FNsssimfile **new_end = next ? new_end_a : new_end_b; *new_end = NULL; ns.zd_nsssimfile_ns_n--; - row->zd_nsssimfile_ns_next = (acr_in::FNsssimfile*)-1; // mark as not-in-list + row->ns_zd_nsssimfile_ns_next = (acr_in::FNsssimfile*)-1; // mark as not-in-list } return row; } @@ -3831,12 +3845,12 @@ algo::Smallstr50 acr_in::name_Get(acr_in::FSsimfile& ssimfile) { // --- acr_in.FSsimfile.zd_nsssimfile_ssimfile.Insert // Insert row into linked list. If row is already in linked list, do nothing. void acr_in::zd_nsssimfile_ssimfile_Insert(acr_in::FSsimfile& ssimfile, acr_in::FNsssimfile& row) { - if (!zd_nsssimfile_ssimfile_InLlistQ(row)) { + if (!ssimfile_zd_nsssimfile_ssimfile_InLlistQ(row)) { acr_in::FNsssimfile* old_tail = ssimfile.zd_nsssimfile_ssimfile_tail; - row.zd_nsssimfile_ssimfile_next = NULL; - row.zd_nsssimfile_ssimfile_prev = old_tail; + row.ssimfile_zd_nsssimfile_ssimfile_next = NULL; + row.ssimfile_zd_nsssimfile_ssimfile_prev = old_tail; ssimfile.zd_nsssimfile_ssimfile_tail = &row; - acr_in::FNsssimfile **new_row_a = &old_tail->zd_nsssimfile_ssimfile_next; + acr_in::FNsssimfile **new_row_a = &old_tail->ssimfile_zd_nsssimfile_ssimfile_next; acr_in::FNsssimfile **new_row_b = &ssimfile.zd_nsssimfile_ssimfile_head; acr_in::FNsssimfile **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -3847,23 +3861,23 @@ void acr_in::zd_nsssimfile_ssimfile_Insert(acr_in::FSsimfile& ssimfile, acr_in:: // --- acr_in.FSsimfile.zd_nsssimfile_ssimfile.Remove // Remove element from index. If element is not in index, do nothing. void acr_in::zd_nsssimfile_ssimfile_Remove(acr_in::FSsimfile& ssimfile, acr_in::FNsssimfile& row) { - if (zd_nsssimfile_ssimfile_InLlistQ(row)) { + if (ssimfile_zd_nsssimfile_ssimfile_InLlistQ(row)) { acr_in::FNsssimfile* old_head = ssimfile.zd_nsssimfile_ssimfile_head; (void)old_head; // in case it's not used - acr_in::FNsssimfile* prev = row.zd_nsssimfile_ssimfile_prev; - acr_in::FNsssimfile* next = row.zd_nsssimfile_ssimfile_next; + acr_in::FNsssimfile* prev = row.ssimfile_zd_nsssimfile_ssimfile_prev; + acr_in::FNsssimfile* next = row.ssimfile_zd_nsssimfile_ssimfile_next; // if element is first, adjust list head; otherwise, adjust previous element's next - acr_in::FNsssimfile **new_next_a = &prev->zd_nsssimfile_ssimfile_next; + acr_in::FNsssimfile **new_next_a = &prev->ssimfile_zd_nsssimfile_ssimfile_next; acr_in::FNsssimfile **new_next_b = &ssimfile.zd_nsssimfile_ssimfile_head; acr_in::FNsssimfile **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - acr_in::FNsssimfile **new_prev_a = &next->zd_nsssimfile_ssimfile_prev; + acr_in::FNsssimfile **new_prev_a = &next->ssimfile_zd_nsssimfile_ssimfile_prev; acr_in::FNsssimfile **new_prev_b = &ssimfile.zd_nsssimfile_ssimfile_tail; acr_in::FNsssimfile **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; ssimfile.zd_nsssimfile_ssimfile_n--; - row.zd_nsssimfile_ssimfile_next=(acr_in::FNsssimfile*)-1; // not-in-list + row.ssimfile_zd_nsssimfile_ssimfile_next=(acr_in::FNsssimfile*)-1; // not-in-list } } @@ -3875,9 +3889,9 @@ void acr_in::zd_nsssimfile_ssimfile_RemoveAll(acr_in::FSsimfile& ssimfile) { ssimfile.zd_nsssimfile_ssimfile_tail = NULL; ssimfile.zd_nsssimfile_ssimfile_n = 0; while (row) { - acr_in::FNsssimfile* row_next = row->zd_nsssimfile_ssimfile_next; - row->zd_nsssimfile_ssimfile_next = (acr_in::FNsssimfile*)-1; - row->zd_nsssimfile_ssimfile_prev = NULL; + acr_in::FNsssimfile* row_next = row->ssimfile_zd_nsssimfile_ssimfile_next; + row->ssimfile_zd_nsssimfile_ssimfile_next = (acr_in::FNsssimfile*)-1; + row->ssimfile_zd_nsssimfile_ssimfile_prev = NULL; row = row_next; } } @@ -3888,14 +3902,14 @@ acr_in::FNsssimfile* acr_in::zd_nsssimfile_ssimfile_RemoveFirst(acr_in::FSsimfil acr_in::FNsssimfile *row = NULL; row = ssimfile.zd_nsssimfile_ssimfile_head; if (row) { - acr_in::FNsssimfile *next = row->zd_nsssimfile_ssimfile_next; + acr_in::FNsssimfile *next = row->ssimfile_zd_nsssimfile_ssimfile_next; ssimfile.zd_nsssimfile_ssimfile_head = next; - acr_in::FNsssimfile **new_end_a = &next->zd_nsssimfile_ssimfile_prev; + acr_in::FNsssimfile **new_end_a = &next->ssimfile_zd_nsssimfile_ssimfile_prev; acr_in::FNsssimfile **new_end_b = &ssimfile.zd_nsssimfile_ssimfile_tail; acr_in::FNsssimfile **new_end = next ? new_end_a : new_end_b; *new_end = NULL; ssimfile.zd_nsssimfile_ssimfile_n--; - row->zd_nsssimfile_ssimfile_next = (acr_in::FNsssimfile*)-1; // mark as not-in-list + row->ssimfile_zd_nsssimfile_ssimfile_next = (acr_in::FNsssimfile*)-1; // mark as not-in-list } return row; } @@ -3991,15 +4005,11 @@ void acr_in::target_CopyIn(acr_in::FTarget &row, dev::Target &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr_in::c_targdep_Insert(acr_in::FTarget& target, acr_in::FTargdep& row) { - if (bool_Update(row.target_c_targdep_in_ary,true)) { - // reserve space + if (!row.target_c_targdep_in_ary) { c_targdep_Reserve(target, 1); - u32 n = target.c_targdep_n; - u32 at = n; - acr_in::FTargdep* *elems = target.c_targdep_elems; - elems[at] = &row; - target.c_targdep_n = n+1; - + u32 n = target.c_targdep_n++; + target.c_targdep_elems[n] = &row; + row.target_c_targdep_in_ary = true; } } @@ -4008,7 +4018,7 @@ void acr_in::c_targdep_Insert(acr_in::FTarget& target, acr_in::FTargdep& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool acr_in::c_targdep_InsertMaybe(acr_in::FTarget& target, acr_in::FTargdep& row) { - bool retval = !row.target_c_targdep_in_ary; + bool retval = !target_c_targdep_InAryQ(row); c_targdep_Insert(target,row); // check is performed in _Insert again return retval; } @@ -4016,18 +4026,18 @@ bool acr_in::c_targdep_InsertMaybe(acr_in::FTarget& target, acr_in::FTargdep& ro // --- acr_in.FTarget.c_targdep.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr_in::c_targdep_Remove(acr_in::FTarget& target, acr_in::FTargdep& row) { + int n = target.c_targdep_n; if (bool_Update(row.target_c_targdep_in_ary,false)) { - int lim = target.c_targdep_n; acr_in::FTargdep* *elems = target.c_targdep_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { acr_in::FTargdep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(acr_in::FTargdep*) * (lim - j); + size_t nbytes = sizeof(acr_in::FTargdep*) * (n - j); memmove(elems + i, elems + j, nbytes); - target.c_targdep_n = lim - 1; + target.c_targdep_n = n - 1; break; } } @@ -4055,15 +4065,11 @@ void acr_in::c_targdep_Reserve(acr_in::FTarget& target, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr_in::c_targdep_child_Insert(acr_in::FTarget& target, acr_in::FTargdep& row) { - if (bool_Update(row.target_c_targdep_child_in_ary,true)) { - // reserve space + if (!row.target_c_targdep_child_in_ary) { c_targdep_child_Reserve(target, 1); - u32 n = target.c_targdep_child_n; - u32 at = n; - acr_in::FTargdep* *elems = target.c_targdep_child_elems; - elems[at] = &row; - target.c_targdep_child_n = n+1; - + u32 n = target.c_targdep_child_n++; + target.c_targdep_child_elems[n] = &row; + row.target_c_targdep_child_in_ary = true; } } @@ -4072,7 +4078,7 @@ void acr_in::c_targdep_child_Insert(acr_in::FTarget& target, acr_in::FTargdep& r // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool acr_in::c_targdep_child_InsertMaybe(acr_in::FTarget& target, acr_in::FTargdep& row) { - bool retval = !row.target_c_targdep_child_in_ary; + bool retval = !target_c_targdep_child_InAryQ(row); c_targdep_child_Insert(target,row); // check is performed in _Insert again return retval; } @@ -4080,18 +4086,18 @@ bool acr_in::c_targdep_child_InsertMaybe(acr_in::FTarget& target, acr_in::FTargd // --- acr_in.FTarget.c_targdep_child.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr_in::c_targdep_child_Remove(acr_in::FTarget& target, acr_in::FTargdep& row) { + int n = target.c_targdep_child_n; if (bool_Update(row.target_c_targdep_child_in_ary,false)) { - int lim = target.c_targdep_child_n; acr_in::FTargdep* *elems = target.c_targdep_child_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { acr_in::FTargdep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(acr_in::FTargdep*) * (lim - j); + size_t nbytes = sizeof(acr_in::FTargdep*) * (n - j); memmove(elems + i, elems + j, nbytes); - target.c_targdep_child_n = lim - 1; + target.c_targdep_child_n = n - 1; break; } } @@ -4136,14 +4142,9 @@ void acr_in::FTarget_Uninit(acr_in::FTarget& target) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void acr_in::c_child_Insert(acr_in::FTuple& tuple, acr_in::FTuple& row) { - // reserve space c_child_Reserve(tuple, 1); - u32 n = tuple.c_child_n; - u32 at = n; - acr_in::FTuple* *elems = tuple.c_child_elems; - elems[at] = &row; - tuple.c_child_n = n+1; - + u32 n = tuple.c_child_n++; + tuple.c_child_elems[n] = &row; } // --- acr_in.FTuple.c_child.ScanInsertMaybe @@ -4172,20 +4173,18 @@ bool acr_in::c_child_ScanInsertMaybe(acr_in::FTuple& tuple, acr_in::FTuple& row) // --- acr_in.FTuple.c_child.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void acr_in::c_child_Remove(acr_in::FTuple& tuple, acr_in::FTuple& row) { - int lim = tuple.c_child_n; - acr_in::FTuple* *elems = tuple.c_child_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - acr_in::FTuple* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr_in::FTuple*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - tuple.c_child_n = lim - 1; - break; + int n = tuple.c_child_n; + int j=0; + for (int i=0; i=0; i--) { - acr_in::FTuple* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(acr_in::FTuple*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - tuple.c_parent_n = lim - 1; - break; + int n = tuple.c_parent_n; + int j=0; + for (int i=0; i acr_my::ary_ns_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- acr_my.FDb.ary_ns.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr acr_my::ary_ns_AllocNAt(int n_elems, int at) { + ary_ns_Reserve(n_elems); + int n = _db.ary_ns_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("acr_my.bad_alloc_n_at field:acr_my.FDb.ary_ns comment:'index out of range'"); + } + algo::cstring *elems = _db.ary_ns_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + _db.ary_ns_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- acr_my.FDb.ary_ns.Remove // Remove item by index. If index outside of range, do nothing. void acr_my::ary_ns_Remove(u32 i) { @@ -230,6 +252,30 @@ bool acr_my::ary_ns_ReadStrptrMaybe(algo::strptr in_str) { return retval; } +// --- acr_my.FDb.ary_ns.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void acr_my::ary_ns_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.ary_ns_elems && rhs.elems < _db.ary_ns_elems + _db.ary_ns_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("acr_my.tary_alias field:acr_my.FDb.ary_ns comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.ary_ns_elems+1))) { + FatalErrorExit("acr_my.bad_insary field:acr_my.FDb.ary_ns comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.ary_ns_n - at; + ary_ns_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.ary_ns_elems + at + nnew + i) algo::cstring(_db.ary_ns_elems[at + i]); + _db.ary_ns_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.ary_ns_elems + at + i) algo::cstring(rhs[i]); + } + _db.ary_ns_n += nnew; +} + // --- acr_my.FDb._db.ReadArgv // Read argc,argv directly into the fields of the command line(s) // The following fields are updated: @@ -316,9 +362,8 @@ void acr_my::ReadArgv() { } if (ch_N(attrname) == 0) { err << "acr_my: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:acr_my.FDb.cmdline @@ -372,7 +420,7 @@ void acr_my::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -462,8 +510,8 @@ bool acr_my::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && acr_my::LoadTuplesFile(algo::SsimFname(root,"dmmeta.ssimfile"),recursive); retval = retval && acr_my::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -998,11 +1046,13 @@ void acr_my::StaticCheck() { // --- acr_my...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); acr_my::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock acr_my::ReadArgv(); // dmmeta.main:acr_my acr_my::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -1015,6 +1065,7 @@ int main(int argc, char **argv) { try { acr_my::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/algo_gen.cpp b/cpp/gen/algo_gen.cpp index e5886227..a8f3ee06 100644 --- a/cpp/gen/algo_gen.cpp +++ b/cpp/gen/algo_gen.cpp @@ -43,6 +43,26 @@ namespace algo { // gen:ns_print_proto inline static bool linear_ReadStrptrMaybe(algo::FileFlags &parent, algo::strptr in_str) __attribute__((nothrow)); // func:algo.FileFlags.printerr.ReadStrptrMaybe inline static bool printerr_ReadStrptrMaybe(algo::FileFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // Swap values elem_a and elem_b + // func:algo.I32RangeAry.ary.Swap + inline static void ary_Swap(algo::i32_Range &elem_a, algo::i32_Range &elem_b) __attribute__((nothrow)); + // Left circular shift of three-tuple + // func:algo.I32RangeAry.ary.Rotleft + inline static void ary_Rotleft(algo::i32_Range &elem_a, algo::i32_Range &elem_b, algo::i32_Range &elem_c) __attribute__((nothrow)); + // Compare values elem_a and elem_b + // The comparison function must be anti-symmetric: if a>b, then !(b>a). + // If not, mayhem results. + // func:algo.I32RangeAry.ary.Lt + static bool ary_Lt(algo::i32_Range &elem_a, algo::i32_Range &elem_b) __attribute__((nothrow)); + // Internal insertion sort + // func:algo.I32RangeAry.ary.IntInsertionSort + static void ary_IntInsertionSort(algo::i32_Range *elems, int n) __attribute__((nothrow)); + // Internal heap sort + // func:algo.I32RangeAry.ary.IntHeapSort + static void ary_IntHeapSort(algo::i32_Range *elems, int n) __attribute__((nothrow)); + // Quick sort engine + // func:algo.I32RangeAry.ary.IntQuickSort + static void ary_IntQuickSort(algo::i32_Range *elems, int n, int depth) __attribute__((nothrow)); // func:algo.IOEvtFlags.read.ReadStrptrMaybe inline static bool read_ReadStrptrMaybe(algo::IOEvtFlags &parent, algo::strptr in_str) __attribute__((nothrow)); // func:algo.IOEvtFlags.write.ReadStrptrMaybe @@ -150,6 +170,23 @@ algo::aryptr algo::ch_AllocN(algo::cstring& parent, int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- algo.cstring.ch.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo::ch_AllocNAt(algo::cstring& parent, int n_elems, int at) { + ch_Reserve(parent, n_elems); + int n = parent.ch_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo.bad_alloc_n_at field:algo.cstring.ch comment:'index out of range'"); + } + char *elems = parent.ch_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(char)); + memset(elems + at, 0, n_elems); // initialize new space + parent.ch_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo.cstring.ch.Remove // Remove item by index. If index outside of range, do nothing. void algo::ch_Remove(algo::cstring& parent, u32 i) { @@ -232,6 +269,25 @@ bool algo::ch_ReadStrptrMaybe(algo::cstring& parent, algo::strptr in_str) { return retval; } +// --- algo.cstring.ch.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo::ch_Insary(algo::cstring& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ch_elems && rhs.elems < parent.ch_elems + parent.ch_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.cstring.ch comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.ch_elems+1))) { + FatalErrorExit("algo.bad_insary field:algo.cstring.ch comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.ch_n - at; + ch_Reserve(parent, nnew); // reserve space + memmove(parent.ch_elems + at + nnew, parent.ch_elems + at, nmove * sizeof(char)); + memcpy(parent.ch_elems + at, rhs.elems, nnew * sizeof(char)); + parent.ch_n += nnew; +} + // --- algo.cstring..Uninit void algo::cstring_Uninit(algo::cstring& parent) { algo::cstring &row = parent; (void)row; @@ -412,6 +468,23 @@ algo::aryptr algo::ary_AllocN(algo::ByteAry& parent, int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- algo.ByteAry.ary.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo::ary_AllocNAt(algo::ByteAry& parent, int n_elems, int at) { + ary_Reserve(parent, n_elems); + int n = parent.ary_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo.bad_alloc_n_at field:algo.ByteAry.ary comment:'index out of range'"); + } + u8 *elems = parent.ary_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u8)); + memset(elems + at, 0, n_elems); // initialize new space + parent.ary_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo.ByteAry.ary.Remove // Remove item by index. If index outside of range, do nothing. void algo::ary_Remove(algo::ByteAry& parent, u32 i) { @@ -494,6 +567,25 @@ bool algo::ary_ReadStrptrMaybe(algo::ByteAry& parent, algo::strptr in_str) { return retval; } +// --- algo.ByteAry.ary.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo::ary_Insary(algo::ByteAry& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.ByteAry.ary comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.ary_elems+1))) { + FatalErrorExit("algo.bad_insary field:algo.ByteAry.ary comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.ary_n - at; + ary_Reserve(parent, nnew); // reserve space + memmove(parent.ary_elems + at + nnew, parent.ary_elems + at, nmove * sizeof(u8)); + memcpy(parent.ary_elems + at, rhs.elems, nnew * sizeof(u8)); + parent.ary_n += nnew; +} + // --- algo.ByteAry..Uninit void algo::ByteAry_Uninit(algo::ByteAry& parent) { algo::ByteAry &row = parent; (void)row; @@ -547,22 +639,6 @@ bool algo::ch_ReadStrptrMaybe(algo::Charset& parent, algo::strptr in_str) { return retval; } -// --- algo.Charset.ch_bitcurs.Next -// proceed to next item -void algo::Charset_ch_bitcurs_Next(Charset_ch_bitcurs &curs) { - ++curs.bit; - int index = curs.bit / 64; - int offset = curs.bit % 64; - for (; index < curs.n_elems; ++index, offset = 0) { - u64 rest = curs.elems[index] >> offset; - if (rest) { - offset += algo::u64_BitScanForward(rest); - break; - } - } - curs.bit = index * 64 + offset; -} - // --- algo.Smallstr150.ch.Print void algo::ch_Print(algo::Smallstr150& parent, algo::cstring &out) { ch_Addary(out, ch_Getary(parent)); @@ -576,7 +652,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr150& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 150"); + algo_lib::AppendErrtext("comment","text too long, limit 150"); } return retval; } @@ -648,7 +724,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr250& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 250"); + algo_lib::AppendErrtext("comment","text too long, limit 250"); } return retval; } @@ -804,6 +880,7 @@ const char* algo::value_ToCstr(const algo::Errns& parent) { switch(value_GetEnum(parent)) { case algo_Errns_unix : ret = "unix"; break; case algo_Errns_win : ret = "win"; break; + case algo_Errns_ssl : ret = "ssl"; break; } return ret; } @@ -829,6 +906,9 @@ bool algo::value_SetStrptrMaybe(algo::Errns& parent, algo::strptr rhs) { switch (elems_N(rhs)) { case 3: { switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('s','s','l'): { + value_SetEnum(parent,algo_Errns_ssl); ret = true; break; + } case LE_STR3('w','i','n'): { value_SetEnum(parent,algo_Errns_win); ret = true; break; } @@ -927,6 +1007,7 @@ const char* algo::value_ToCstr(const algo::FieldId& parent) { switch(value_GetEnum(parent)) { case algo_FieldId_name : ret = "name"; break; case algo_FieldId_value : ret = "value"; break; + case algo_FieldId_ary : ret = "ary"; break; case algo_FieldId_ch : ret = "ch"; break; case algo_FieldId_exponent : ret = "exponent"; break; case algo_FieldId_mantissa : ret = "mantissa"; break; @@ -949,7 +1030,6 @@ const char* algo::value_ToCstr(const algo::FieldId& parent) { case algo_FieldId_overflow : ret = "overflow"; break; case algo_FieldId_hex : ret = "hex"; break; case algo_FieldId_sha1sig : ret = "sha1sig"; break; - case algo_FieldId_ary : ret = "ary"; break; case algo_FieldId_attrs : ret = "attrs"; break; case algo_FieldId_head : ret = "head"; break; case algo_FieldId_protocol : ret = "protocol"; break; @@ -1284,41 +1364,35 @@ bool algo::FileFlags_ReadFieldMaybe(algo::FileFlags& parent, algo::strptr field, switch(field_id) { case algo_FieldId_value: { retval = u32_ReadStrptrMaybe(parent.value, strval); - break; - } + } break; case algo_FieldId_append: { retval = append_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_read: { retval = read_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_write: { retval = write_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId__throw: { retval = _throw_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_temp: { retval = temp_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_overlap: { retval = overlap_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_linear: { retval = linear_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_printerr: { retval = printerr_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1885,6 +1959,374 @@ void algo::I32Dec5_Print(algo::I32Dec5 row, algo::cstring& str) { algo::value_Print(row, str); } +// --- algo.I32RangeAry.ary.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr algo::ary_Addary(algo::I32RangeAry& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.I32RangeAry.ary comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + ary_Reserve(parent, nnew); // reserve space + int at = parent.ary_n; + for (int i = 0; i < nnew; i++) { + new (parent.ary_elems + at + i) algo::i32_Range(rhs[i]); + parent.ary_n++; + } + return algo::aryptr(parent.ary_elems + at, nnew); +} + +// --- algo.I32RangeAry.ary.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +algo::i32_Range& algo::ary_Alloc(algo::I32RangeAry& parent) { + ary_Reserve(parent, 1); + int n = parent.ary_n; + int at = n; + algo::i32_Range *elems = parent.ary_elems; + new (elems + at) algo::i32_Range(); // construct new element, default initializer + parent.ary_n = n+1; + return elems[at]; +} + +// --- algo.I32RangeAry.ary.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::i32_Range& algo::ary_AllocAt(algo::I32RangeAry& parent, int at) { + ary_Reserve(parent, 1); + int n = parent.ary_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("algo.bad_alloc_at field:algo.I32RangeAry.ary comment:'index out of range'"); + } + algo::i32_Range *elems = parent.ary_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(algo::i32_Range)); + new (elems + at) algo::i32_Range(); // construct element, default initializer + parent.ary_n = n+1; + return elems[at]; +} + +// --- algo.I32RangeAry.ary.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr algo::ary_AllocN(algo::I32RangeAry& parent, int n_elems) { + ary_Reserve(parent, n_elems); + int old_n = parent.ary_n; + int new_n = old_n + n_elems; + algo::i32_Range *elems = parent.ary_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo::i32_Range(); // construct new element, default initialize + } + parent.ary_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- algo.I32RangeAry.ary.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo::ary_AllocNAt(algo::I32RangeAry& parent, int n_elems, int at) { + ary_Reserve(parent, n_elems); + int n = parent.ary_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo.bad_alloc_n_at field:algo.I32RangeAry.ary comment:'index out of range'"); + } + algo::i32_Range *elems = parent.ary_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::i32_Range)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::i32_Range(); // construct new element, default initialize + } + parent.ary_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- algo.I32RangeAry.ary.Remove +// Remove item by index. If index outside of range, do nothing. +void algo::ary_Remove(algo::I32RangeAry& parent, u32 i) { + u32 lim = parent.ary_n; + algo::i32_Range *elems = parent.ary_elems; + if (i < lim) { + memmove(elems + i, elems + (i + 1), sizeof(algo::i32_Range) * (lim - (i + 1))); + parent.ary_n = lim - 1; + } +} + +// --- algo.I32RangeAry.ary.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void algo::ary_RemoveLast(algo::I32RangeAry& parent) { + u64 n = parent.ary_n; + if (n > 0) { + n -= 1; + parent.ary_n = n; + } +} + +// --- algo.I32RangeAry.ary.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void algo::ary_AbsReserve(algo::I32RangeAry& parent, int n) { + u32 old_max = parent.ary_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.ary_elems, old_max * sizeof(algo::i32_Range), new_max * sizeof(algo::i32_Range)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("algo.tary_nomem field:algo.I32RangeAry.ary comment:'out of memory'"); + } + parent.ary_elems = (algo::i32_Range*)new_mem; + parent.ary_max = new_max; + } +} + +// --- algo.I32RangeAry.ary.Setary +// Copy contents of RHS to PARENT. +void algo::ary_Setary(algo::I32RangeAry& parent, algo::I32RangeAry &rhs) { + ary_RemoveAll(parent); + int nnew = rhs.ary_n; + ary_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.ary_elems + i) algo::i32_Range(ary_qFind(rhs, i)); + parent.ary_n = i + 1; + } +} + +// --- algo.I32RangeAry.ary.Setary2 +// Copy specified array into ary, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void algo::ary_Setary(algo::I32RangeAry& parent, const algo::aryptr &rhs) { + ary_RemoveAll(parent); + ary_Addary(parent, rhs); +} + +// --- algo.I32RangeAry.ary.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr algo::ary_AllocNVal(algo::I32RangeAry& parent, int n_elems, const algo::i32_Range& val) { + ary_Reserve(parent, n_elems); + int old_n = parent.ary_n; + int new_n = old_n + n_elems; + algo::i32_Range *elems = parent.ary_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo::i32_Range(val); + } + parent.ary_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- algo.I32RangeAry.ary.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo::ary_Insary(algo::I32RangeAry& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.I32RangeAry.ary comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.ary_elems+1))) { + FatalErrorExit("algo.bad_insary field:algo.I32RangeAry.ary comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.ary_n - at; + ary_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.ary_elems + at + nnew + i) algo::i32_Range(parent.ary_elems[at + i]); + } + for (int i = 0; i < nnew; ++i) { + new (parent.ary_elems + at + i) algo::i32_Range(rhs[i]); + } + parent.ary_n += nnew; +} + +// --- algo.I32RangeAry.ary.Swap +// Swap values elem_a and elem_b +inline static void algo::ary_Swap(algo::i32_Range &elem_a, algo::i32_Range &elem_b) { + u8 temp[sizeof(algo::i32_Range)]; + memcpy(&temp , &elem_a, sizeof(algo::i32_Range)); + memcpy(&elem_a, &elem_b, sizeof(algo::i32_Range)); + memcpy(&elem_b, &temp , sizeof(algo::i32_Range)); +} + +// --- algo.I32RangeAry.ary.Rotleft +// Left circular shift of three-tuple +inline static void algo::ary_Rotleft(algo::i32_Range &elem_a, algo::i32_Range &elem_b, algo::i32_Range &elem_c) { + u8 temp[sizeof(algo::i32_Range)]; + memcpy(&temp, &elem_a , sizeof(algo::i32_Range)); + memcpy(&elem_a , &elem_b , sizeof(algo::i32_Range)); + memcpy(&elem_b , &elem_c , sizeof(algo::i32_Range)); + memcpy(&elem_c , &temp, sizeof(algo::i32_Range)); +} + +// --- algo.I32RangeAry.ary.Lt +// Compare values elem_a and elem_b +// The comparison function must be anti-symmetric: if a>b, then !(b>a). +// If not, mayhem results. +static bool algo::ary_Lt(algo::i32_Range &elem_a, algo::i32_Range &elem_b) { + bool ret; + ret = elem_a.beg < elem_b.beg; + return ret; +} + +// --- algo.I32RangeAry.ary.SortedQ +// Verify whether array is sorted +bool algo::ary_SortedQ(algo::I32RangeAry& parent) { + algo::i32_Range *elems = ary_Getary(parent).elems; + int n = ary_N(parent); + for (int i = 1; i < n; i++) { + if (ary_Lt(elems[i], elems[i-1])) { + return false; + } + } + return true; +} + +// --- algo.I32RangeAry.ary.IntInsertionSort +// Internal insertion sort +static void algo::ary_IntInsertionSort(algo::i32_Range *elems, int n) { + for (int i = 1; i < n; ++i) { + int j = i; + // find the spot for ith element. + while (j>0 && ary_Lt(elems[i], elems[j-1])) { + j--; + } + if (j=0; i--) { + int k = 0; + int l = 1; + while (l16) { + // detect degenerate case and revert to heap sort + if (depth==0) { + ary_IntHeapSort(elems,n); + return; + } + // elements to sort initially to determine pivot. + // choose pp=n/2 in case the input is already sorted. + int pi = 0; + int pp = n/2; + int pj = n-1; + // insertion sort for 1st, middle and last element + if (ary_Lt(elems[pp], elems[pi])) { + ary_Swap(elems[pi], elems[pp]); + } + if (ary_Lt(elems[pj], elems[pp])) { + if (ary_Lt(elems[pj], elems[pi])) { + ary_Rotleft(elems[pi], elems[pj], elems[pp]); + } else { + ary_Swap(elems[pj], elems[pp]); + } + } + // deposit pivot near the end of the array and skip it. + ary_Swap(elems[--pj], elems[pp]); + // reference to pivot + algo::i32_Range &pivot = elems[pj]; + for(;;){ + while (ary_Lt(elems[++pi], pivot)) { + } + while (ary_Lt(pivot, elems[--pj])) { + } + if (pj <= pi) { + break; + } + ary_Swap(elems[pi],elems[pj]); + } + depth -= 1; + ary_IntQuickSort(elems, pi, depth); + elems += pi; + n -= pi; + } + // sort the remainder of this section + ary_IntInsertionSort(elems,n); +} + +// --- algo.I32RangeAry.ary.InsertionSort +// Insertion sort +void algo::ary_InsertionSort(algo::I32RangeAry& parent) { + algo::i32_Range *elems = ary_Getary(parent).elems; + int n = ary_N(parent); + ary_IntInsertionSort(elems, n); +} + +// --- algo.I32RangeAry.ary.HeapSort +// Heap sort +void algo::ary_HeapSort(algo::I32RangeAry& parent) { + algo::i32_Range *elems = ary_Getary(parent).elems; + int n = ary_N(parent); + ary_IntHeapSort(elems, n); +} + +// --- algo.I32RangeAry.ary.QuickSort +// Quick sort +void algo::ary_QuickSort(algo::I32RangeAry& parent) { + // compute max recursion depth based on number of elements in the array + int max_depth = algo::CeilingLog2(u32(ary_N(parent) + 1)) + 3; + algo::i32_Range *elems = ary_Getary(parent).elems; + int n = ary_N(parent); + ary_IntQuickSort(elems, n, max_depth); +} + +// --- algo.I32RangeAry..Uninit +void algo::I32RangeAry_Uninit(algo::I32RangeAry& parent) { + algo::I32RangeAry &row = parent; (void)row; + + // algo.I32RangeAry.ary.Uninit (Tary) // + // remove all elements from algo.I32RangeAry.ary + ary_RemoveAll(parent); + // free memory for Tary algo.I32RangeAry.ary + algo_lib::malloc_FreeMem(parent.ary_elems, sizeof(algo::i32_Range)*parent.ary_max); // (algo.I32RangeAry.ary) +} + +// --- algo.I32RangeAry..AssignOp +algo::I32RangeAry& algo::I32RangeAry::operator =(const algo::I32RangeAry &rhs) { + ary_Setary(*this, ary_Getary(const_cast(rhs))); + return *this; +} + +// --- algo.I32RangeAry..CopyCtor + algo::I32RangeAry::I32RangeAry(const algo::I32RangeAry &rhs) { + ary_elems = 0; // (algo.I32RangeAry.ary) + ary_n = 0; // (algo.I32RangeAry.ary) + ary_max = 0; // (algo.I32RangeAry.ary) + ary_Setary(*this, ary_Getary(const_cast(rhs))); +} + // --- algo.I64Dec1.value.SetDoubleMaybe // Set value of field value, using rounding. // If value is out of range for the target type, return false. @@ -2857,25 +3299,23 @@ bool algo::IOEvtFlags_ReadFieldMaybe(algo::IOEvtFlags& parent, algo::strptr fiel switch(field_id) { case algo_FieldId_value: { retval = u32_ReadStrptrMaybe(parent.value, strval); - break; - } + } break; case algo_FieldId_read: { retval = read_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_write: { retval = write_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_eof: { retval = eof_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_err: { retval = err_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2962,13 +3402,14 @@ bool algo::IPoint_ReadFieldMaybe(algo::IPoint& parent, algo::strptr field, algo: switch(field_id) { case algo_FieldId_x: { retval = i32_ReadStrptrMaybe(parent.x, strval); - break; - } + } break; case algo_FieldId_y: { retval = i32_ReadStrptrMaybe(parent.y, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3013,7 +3454,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr50& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 50"); + algo_lib::AppendErrtext("comment","text too long, limit 50"); } return retval; } @@ -3094,7 +3535,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr100& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 100"); + algo_lib::AppendErrtext("comment","text too long, limit 100"); } return retval; } @@ -3222,6 +3663,23 @@ algo::aryptr algo::buf_AllocN(algo::LineBuf& parent, int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- algo.LineBuf.buf.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo::buf_AllocNAt(algo::LineBuf& parent, int n_elems, int at) { + buf_Reserve(parent, n_elems); + int n = parent.buf_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo.bad_alloc_n_at field:algo.LineBuf.buf comment:'index out of range'"); + } + char *elems = parent.buf_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(char)); + memset(elems + at, 0, n_elems); // initialize new space + parent.buf_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo.LineBuf.buf.Remove // Remove item by index. If index outside of range, do nothing. void algo::buf_Remove(algo::LineBuf& parent, u32 i) { @@ -3304,6 +3762,25 @@ bool algo::buf_ReadStrptrMaybe(algo::LineBuf& parent, algo::strptr in_str) { return retval; } +// --- algo.LineBuf.buf.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo::buf_Insary(algo::LineBuf& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.buf_elems && rhs.elems < parent.buf_elems + parent.buf_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.LineBuf.buf comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.buf_elems+1))) { + FatalErrorExit("algo.bad_insary field:algo.LineBuf.buf comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.buf_n - at; + buf_Reserve(parent, nnew); // reserve space + memmove(parent.buf_elems + at + nnew, parent.buf_elems + at, nmove * sizeof(char)); + memcpy(parent.buf_elems + at, rhs.elems, nnew * sizeof(char)); + parent.buf_n += nnew; +} + // --- algo.LineBuf..Uninit void algo::LineBuf_Uninit(algo::LineBuf& parent) { algo::LineBuf &row = parent; (void)row; @@ -3349,7 +3826,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr10_U64& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 10"); + algo_lib::AppendErrtext("comment","text too long, limit 10"); } return retval; } @@ -3459,7 +3936,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr11_U64& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 11"); + algo_lib::AppendErrtext("comment","text too long, limit 11"); } return retval; } @@ -3569,7 +4046,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr12_U64& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 12"); + algo_lib::AppendErrtext("comment","text too long, limit 12"); } return retval; } @@ -3679,7 +4156,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr13_U64_Base36& parent, algo::strptr r ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 13"); + algo_lib::AppendErrtext("comment","text too long, limit 13"); } return retval; } @@ -3809,7 +4286,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr16_U64_Base16& parent, algo::strptr r ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 16"); + algo_lib::AppendErrtext("comment","text too long, limit 16"); } return retval; } @@ -3937,7 +4414,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr1_U32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 1"); + algo_lib::AppendErrtext("comment","text too long, limit 1"); } return retval; } @@ -4047,7 +4524,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr20_U64& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 20"); + algo_lib::AppendErrtext("comment","text too long, limit 20"); } return retval; } @@ -4165,7 +4642,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr22_U64& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 22"); + algo_lib::AppendErrtext("comment","text too long, limit 22"); } return retval; } @@ -4283,7 +4760,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr2_U32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 2"); + algo_lib::AppendErrtext("comment","text too long, limit 2"); } return retval; } @@ -4393,7 +4870,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr3_U32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 3"); + algo_lib::AppendErrtext("comment","text too long, limit 3"); } return retval; } @@ -4503,7 +4980,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr4_U32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 4"); + algo_lib::AppendErrtext("comment","text too long, limit 4"); } return retval; } @@ -4613,7 +5090,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr5_U32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 5"); + algo_lib::AppendErrtext("comment","text too long, limit 5"); } return retval; } @@ -4723,7 +5200,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr5_U32_Base36& parent, algo::strptr rh ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 5"); + algo_lib::AppendErrtext("comment","text too long, limit 5"); } return retval; } @@ -4850,7 +5327,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr6_U32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 6"); + algo_lib::AppendErrtext("comment","text too long, limit 6"); } return retval; } @@ -4960,7 +5437,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr7_U32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 7"); + algo_lib::AppendErrtext("comment","text too long, limit 7"); } return retval; } @@ -5070,7 +5547,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr7_U32_Base36& parent, algo::strptr rh ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 7"); + algo_lib::AppendErrtext("comment","text too long, limit 7"); } return retval; } @@ -5198,7 +5675,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr8_U32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 8"); + algo_lib::AppendErrtext("comment","text too long, limit 8"); } return retval; } @@ -5308,7 +5785,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr8_U32_Base16& parent, algo::strptr rh ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 8"); + algo_lib::AppendErrtext("comment","text too long, limit 8"); } return retval; } @@ -5436,7 +5913,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr8_U64& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 8"); + algo_lib::AppendErrtext("comment","text too long, limit 8"); } return retval; } @@ -5546,7 +6023,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr9_U32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 9"); + algo_lib::AppendErrtext("comment","text too long, limit 9"); } return retval; } @@ -5656,7 +6133,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LnumStr9_U64& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 9"); + algo_lib::AppendErrtext("comment","text too long, limit 9"); } return retval; } @@ -5766,7 +6243,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr10& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 10"); + algo_lib::AppendErrtext("comment","text too long, limit 10"); } return retval; } @@ -5824,7 +6301,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr12& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 12"); + algo_lib::AppendErrtext("comment","text too long, limit 12"); } return retval; } @@ -5882,7 +6359,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr14& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 14"); + algo_lib::AppendErrtext("comment","text too long, limit 14"); } return retval; } @@ -5940,7 +6417,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr15& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 15"); + algo_lib::AppendErrtext("comment","text too long, limit 15"); } return retval; } @@ -5998,7 +6475,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr20_I64& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 20"); + algo_lib::AppendErrtext("comment","text too long, limit 20"); } return retval; } @@ -6129,7 +6606,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr20_U64& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 20"); + algo_lib::AppendErrtext("comment","text too long, limit 20"); } return retval; } @@ -6247,7 +6724,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr3& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 3"); + algo_lib::AppendErrtext("comment","text too long, limit 3"); } return retval; } @@ -6305,7 +6782,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr3_I16& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 3"); + algo_lib::AppendErrtext("comment","text too long, limit 3"); } return retval; } @@ -6428,7 +6905,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr4& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 4"); + algo_lib::AppendErrtext("comment","text too long, limit 4"); } return retval; } @@ -6486,7 +6963,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr5& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 5"); + algo_lib::AppendErrtext("comment","text too long, limit 5"); } return retval; } @@ -6544,7 +7021,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr5_I16& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 5"); + algo_lib::AppendErrtext("comment","text too long, limit 5"); } return retval; } @@ -6660,7 +7137,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr6& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 6"); + algo_lib::AppendErrtext("comment","text too long, limit 6"); } return retval; } @@ -6718,7 +7195,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr6_U32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 6"); + algo_lib::AppendErrtext("comment","text too long, limit 6"); } return retval; } @@ -6828,7 +7305,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr7_I32_Base36& parent, algo::strptr ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 7"); + algo_lib::AppendErrtext("comment","text too long, limit 7"); } return retval; } @@ -6969,7 +7446,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr8& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 8"); + algo_lib::AppendErrtext("comment","text too long, limit 8"); } return retval; } @@ -7027,7 +7504,7 @@ bool algo::ch_ReadStrptrMaybe(algo::LspaceStr9& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 9"); + algo_lib::AppendErrtext("comment","text too long, limit 9"); } return retval; } @@ -7323,29 +7800,26 @@ bool algo::NumParseFlags_ReadFieldMaybe(algo::NumParseFlags& parent, algo::strpt switch(field_id) { case algo_FieldId_value: { retval = u32_ReadStrptrMaybe(parent.value, strval); - break; - } + } break; case algo_FieldId_err: { retval = err_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_ok: { retval = ok_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_neg: { retval = neg_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_overflow: { retval = overflow_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_FieldId_hex: { retval = hex_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7444,7 +7918,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr1& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 1"); + algo_lib::AppendErrtext("comment","text too long, limit 1"); } return retval; } @@ -7502,7 +7976,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr10& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 10"); + algo_lib::AppendErrtext("comment","text too long, limit 10"); } return retval; } @@ -7560,7 +8034,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr100& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 100"); + algo_lib::AppendErrtext("comment","text too long, limit 100"); } return retval; } @@ -7618,7 +8092,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr1000& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 1000"); + algo_lib::AppendErrtext("comment","text too long, limit 1000"); } return retval; } @@ -7676,7 +8150,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr11& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 11"); + algo_lib::AppendErrtext("comment","text too long, limit 11"); } return retval; } @@ -7734,7 +8208,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr12& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 12"); + algo_lib::AppendErrtext("comment","text too long, limit 12"); } return retval; } @@ -7792,7 +8266,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr129& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 129"); + algo_lib::AppendErrtext("comment","text too long, limit 129"); } return retval; } @@ -7850,7 +8324,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr13& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 13"); + algo_lib::AppendErrtext("comment","text too long, limit 13"); } return retval; } @@ -7908,7 +8382,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr14& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 14"); + algo_lib::AppendErrtext("comment","text too long, limit 14"); } return retval; } @@ -7966,7 +8440,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr15& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 15"); + algo_lib::AppendErrtext("comment","text too long, limit 15"); } return retval; } @@ -8024,7 +8498,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr151& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 151"); + algo_lib::AppendErrtext("comment","text too long, limit 151"); } return retval; } @@ -8082,7 +8556,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr16& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 16"); + algo_lib::AppendErrtext("comment","text too long, limit 16"); } return retval; } @@ -8140,7 +8614,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr17& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 17"); + algo_lib::AppendErrtext("comment","text too long, limit 17"); } return retval; } @@ -8198,7 +8672,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr18& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 18"); + algo_lib::AppendErrtext("comment","text too long, limit 18"); } return retval; } @@ -8256,7 +8730,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr19& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 19"); + algo_lib::AppendErrtext("comment","text too long, limit 19"); } return retval; } @@ -8314,7 +8788,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr2& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 2"); + algo_lib::AppendErrtext("comment","text too long, limit 2"); } return retval; } @@ -8372,7 +8846,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr20& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 20"); + algo_lib::AppendErrtext("comment","text too long, limit 20"); } return retval; } @@ -8430,7 +8904,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr21& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 21"); + algo_lib::AppendErrtext("comment","text too long, limit 21"); } return retval; } @@ -8488,7 +8962,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr24& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 24"); + algo_lib::AppendErrtext("comment","text too long, limit 24"); } return retval; } @@ -8546,7 +9020,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr25& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 25"); + algo_lib::AppendErrtext("comment","text too long, limit 25"); } return retval; } @@ -8604,7 +9078,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr28& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 28"); + algo_lib::AppendErrtext("comment","text too long, limit 28"); } return retval; } @@ -8662,7 +9136,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr3& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 3"); + algo_lib::AppendErrtext("comment","text too long, limit 3"); } return retval; } @@ -8720,7 +9194,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr30& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 30"); + algo_lib::AppendErrtext("comment","text too long, limit 30"); } return retval; } @@ -8778,7 +9252,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 32"); + algo_lib::AppendErrtext("comment","text too long, limit 32"); } return retval; } @@ -8836,7 +9310,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr33& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 33"); + algo_lib::AppendErrtext("comment","text too long, limit 33"); } return retval; } @@ -8894,7 +9368,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr35& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 35"); + algo_lib::AppendErrtext("comment","text too long, limit 35"); } return retval; } @@ -8952,7 +9426,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr36& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 36"); + algo_lib::AppendErrtext("comment","text too long, limit 36"); } return retval; } @@ -9010,7 +9484,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr4& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 4"); + algo_lib::AppendErrtext("comment","text too long, limit 4"); } return retval; } @@ -9068,7 +9542,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr40& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 40"); + algo_lib::AppendErrtext("comment","text too long, limit 40"); } return retval; } @@ -9126,7 +9600,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr41& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 41"); + algo_lib::AppendErrtext("comment","text too long, limit 41"); } return retval; } @@ -9184,7 +9658,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr43& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 43"); + algo_lib::AppendErrtext("comment","text too long, limit 43"); } return retval; } @@ -9242,7 +9716,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr44& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 44"); + algo_lib::AppendErrtext("comment","text too long, limit 44"); } return retval; } @@ -9300,7 +9774,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr48& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 48"); + algo_lib::AppendErrtext("comment","text too long, limit 48"); } return retval; } @@ -9358,7 +9832,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr5& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 5"); + algo_lib::AppendErrtext("comment","text too long, limit 5"); } return retval; } @@ -9416,7 +9890,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr50& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 50"); + algo_lib::AppendErrtext("comment","text too long, limit 50"); } return retval; } @@ -9474,7 +9948,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr54& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 54"); + algo_lib::AppendErrtext("comment","text too long, limit 54"); } return retval; } @@ -9532,7 +10006,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr55& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 55"); + algo_lib::AppendErrtext("comment","text too long, limit 55"); } return retval; } @@ -9590,7 +10064,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr6& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 6"); + algo_lib::AppendErrtext("comment","text too long, limit 6"); } return retval; } @@ -9648,7 +10122,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr60& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 60"); + algo_lib::AppendErrtext("comment","text too long, limit 60"); } return retval; } @@ -9706,7 +10180,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr62& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 62"); + algo_lib::AppendErrtext("comment","text too long, limit 62"); } return retval; } @@ -9764,7 +10238,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr66& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 66"); + algo_lib::AppendErrtext("comment","text too long, limit 66"); } return retval; } @@ -9822,7 +10296,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr6_U32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 6"); + algo_lib::AppendErrtext("comment","text too long, limit 6"); } return retval; } @@ -9932,7 +10406,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr7& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 7"); + algo_lib::AppendErrtext("comment","text too long, limit 7"); } return retval; } @@ -9990,7 +10464,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr8& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 8"); + algo_lib::AppendErrtext("comment","text too long, limit 8"); } return retval; } @@ -10048,7 +10522,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr80& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 80"); + algo_lib::AppendErrtext("comment","text too long, limit 80"); } return retval; } @@ -10106,7 +10580,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RnullStr9& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 9"); + algo_lib::AppendErrtext("comment","text too long, limit 9"); } return retval; } @@ -10164,7 +10638,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr10& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 10"); + algo_lib::AppendErrtext("comment","text too long, limit 10"); } return retval; } @@ -10222,7 +10696,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr100& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 100"); + algo_lib::AppendErrtext("comment","text too long, limit 100"); } return retval; } @@ -10280,7 +10754,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr11& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 11"); + algo_lib::AppendErrtext("comment","text too long, limit 11"); } return retval; } @@ -10338,7 +10812,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr12& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 12"); + algo_lib::AppendErrtext("comment","text too long, limit 12"); } return retval; } @@ -10396,7 +10870,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr128& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 128"); + algo_lib::AppendErrtext("comment","text too long, limit 128"); } return retval; } @@ -10454,7 +10928,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr14& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 14"); + algo_lib::AppendErrtext("comment","text too long, limit 14"); } return retval; } @@ -10512,7 +10986,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr15& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 15"); + algo_lib::AppendErrtext("comment","text too long, limit 15"); } return retval; } @@ -10570,7 +11044,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr16& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 16"); + algo_lib::AppendErrtext("comment","text too long, limit 16"); } return retval; } @@ -10628,7 +11102,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr18& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 18"); + algo_lib::AppendErrtext("comment","text too long, limit 18"); } return retval; } @@ -10686,7 +11160,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr2& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 2"); + algo_lib::AppendErrtext("comment","text too long, limit 2"); } return retval; } @@ -10744,7 +11218,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr20& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 20"); + algo_lib::AppendErrtext("comment","text too long, limit 20"); } return retval; } @@ -10802,7 +11276,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr200& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 200"); + algo_lib::AppendErrtext("comment","text too long, limit 200"); } return retval; } @@ -10825,7 +11299,7 @@ void algo::ch_SetStrptr(algo::RspaceStr200& parent, const algo::strptr& rhs) { } // --- algo.RspaceStr200..Hash -u32 algo::RspaceStr200_Hash(u32 prev, const algo::RspaceStr200& rhs) { +u32 algo::RspaceStr200_Hash(u32 prev, algo::RspaceStr200 rhs) { algo::strptr ch_strptr = ch_Getary(rhs); prev = ::strptr_Hash(prev, ch_strptr); return prev; @@ -10843,7 +11317,7 @@ bool algo::RspaceStr200_ReadStrptrMaybe(algo::RspaceStr200 &parent, algo::strptr // --- algo.RspaceStr200..Print // print string representation of ROW to string STR // cfmt:algo.RspaceStr200.String printfmt:Raw -void algo::RspaceStr200_Print(algo::RspaceStr200& row, algo::cstring& str) { +void algo::RspaceStr200_Print(algo::RspaceStr200 row, algo::cstring& str) { algo::ch_Print(row, str); } @@ -10860,7 +11334,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr21& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 21"); + algo_lib::AppendErrtext("comment","text too long, limit 21"); } return retval; } @@ -10918,7 +11392,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr24& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 24"); + algo_lib::AppendErrtext("comment","text too long, limit 24"); } return retval; } @@ -10976,7 +11450,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr240& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 240"); + algo_lib::AppendErrtext("comment","text too long, limit 240"); } return retval; } @@ -11034,7 +11508,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr25& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 25"); + algo_lib::AppendErrtext("comment","text too long, limit 25"); } return retval; } @@ -11092,7 +11566,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr26& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 26"); + algo_lib::AppendErrtext("comment","text too long, limit 26"); } return retval; } @@ -11150,7 +11624,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr3& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 3"); + algo_lib::AppendErrtext("comment","text too long, limit 3"); } return retval; } @@ -11208,7 +11682,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr31& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 31"); + algo_lib::AppendErrtext("comment","text too long, limit 31"); } return retval; } @@ -11266,7 +11740,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 32"); + algo_lib::AppendErrtext("comment","text too long, limit 32"); } return retval; } @@ -11324,7 +11798,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr4& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 4"); + algo_lib::AppendErrtext("comment","text too long, limit 4"); } return retval; } @@ -11382,7 +11856,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr40& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 40"); + algo_lib::AppendErrtext("comment","text too long, limit 40"); } return retval; } @@ -11440,7 +11914,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr5& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 5"); + algo_lib::AppendErrtext("comment","text too long, limit 5"); } return retval; } @@ -11498,7 +11972,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr50& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 50"); + algo_lib::AppendErrtext("comment","text too long, limit 50"); } return retval; } @@ -11556,7 +12030,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr6& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 6"); + algo_lib::AppendErrtext("comment","text too long, limit 6"); } return retval; } @@ -11614,7 +12088,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr64& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 64"); + algo_lib::AppendErrtext("comment","text too long, limit 64"); } return retval; } @@ -11672,7 +12146,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr7& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 7"); + algo_lib::AppendErrtext("comment","text too long, limit 7"); } return retval; } @@ -11730,7 +12204,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr75& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 75"); + algo_lib::AppendErrtext("comment","text too long, limit 75"); } return retval; } @@ -11788,7 +12262,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr8& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 8"); + algo_lib::AppendErrtext("comment","text too long, limit 8"); } return retval; } @@ -11846,7 +12320,7 @@ bool algo::ch_ReadStrptrMaybe(algo::RspaceStr9& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 9"); + algo_lib::AppendErrtext("comment","text too long, limit 9"); } return retval; } @@ -11977,7 +12451,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr1& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 1"); + algo_lib::AppendErrtext("comment","text too long, limit 1"); } return retval; } @@ -12033,7 +12507,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr10& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 10"); + algo_lib::AppendErrtext("comment","text too long, limit 10"); } return retval; } @@ -12089,7 +12563,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr16& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 16"); + algo_lib::AppendErrtext("comment","text too long, limit 16"); } return retval; } @@ -12145,7 +12619,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr2& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 2"); + algo_lib::AppendErrtext("comment","text too long, limit 2"); } return retval; } @@ -12201,7 +12675,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr20& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 20"); + algo_lib::AppendErrtext("comment","text too long, limit 20"); } return retval; } @@ -12257,7 +12731,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr200& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 200"); + algo_lib::AppendErrtext("comment","text too long, limit 200"); } return retval; } @@ -12300,6 +12774,62 @@ void algo::Smallstr200_Print(algo::Smallstr200& row, algo::cstring& str) { algo::ch_Print(row, str); } +// --- algo.Smallstr249.ch.Print +void algo::ch_Print(algo::Smallstr249& parent, algo::cstring &out) { + ch_Addary(out, ch_Getary(parent)); +} + +// --- algo.Smallstr249.ch.ReadStrptrMaybe +// Convert string to field. Return success value +bool algo::ch_ReadStrptrMaybe(algo::Smallstr249& parent, algo::strptr rhs) { + bool retval = false; + if (rhs.n_elems <= 249) { + ch_SetStrptr(parent, rhs); + retval = true; + } else { + algo_lib::AppendErrtext("comment","text too long, limit 249"); + } + return retval; +} + +// --- algo.Smallstr249.ch.SetStrptr +// Copy from strptr, clipping length +// Set string to the value provided by RHS. +// If RHS is too large, it is silently clipped. +void algo::ch_SetStrptr(algo::Smallstr249& parent, const algo::strptr& rhs) { + int len = i32_Min(rhs.n_elems, 249); + char *rhs_elems = rhs.elems; + int i = 0; + int j = 0; + for (; i < len; i++, j++) { + parent.ch[j] = rhs_elems[i]; + } + parent.n_ch = u8(len); +} + +// --- algo.Smallstr249..Hash +u32 algo::Smallstr249_Hash(u32 prev, const algo::Smallstr249& rhs) { + algo::strptr ch_strptr = ch_Getary(rhs); + prev = ::strptr_Hash(prev, ch_strptr); + return prev; +} + +// --- algo.Smallstr249..ReadStrptrMaybe +// Read fields of algo::Smallstr249 from an ascii string. +// The format of the string is the format of the algo::Smallstr249's only field +bool algo::Smallstr249_ReadStrptrMaybe(algo::Smallstr249 &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && ch_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- algo.Smallstr249..Print +// print string representation of ROW to string STR +// cfmt:algo.Smallstr249.String printfmt:Raw +void algo::Smallstr249_Print(algo::Smallstr249& row, algo::cstring& str) { + algo::ch_Print(row, str); +} + // --- algo.Smallstr25.ch.Print void algo::ch_Print(algo::Smallstr25& parent, algo::cstring &out) { ch_Addary(out, ch_Getary(parent)); @@ -12313,7 +12843,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr25& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 25"); + algo_lib::AppendErrtext("comment","text too long, limit 25"); } return retval; } @@ -12356,6 +12886,62 @@ void algo::Smallstr25_Print(algo::Smallstr25& row, algo::cstring& str) { algo::ch_Print(row, str); } +// --- algo.Smallstr255.ch.Print +void algo::ch_Print(algo::Smallstr255& parent, algo::cstring &out) { + ch_Addary(out, ch_Getary(parent)); +} + +// --- algo.Smallstr255.ch.ReadStrptrMaybe +// Convert string to field. Return success value +bool algo::ch_ReadStrptrMaybe(algo::Smallstr255& parent, algo::strptr rhs) { + bool retval = false; + if (rhs.n_elems <= 255) { + ch_SetStrptr(parent, rhs); + retval = true; + } else { + algo_lib::AppendErrtext("comment","text too long, limit 255"); + } + return retval; +} + +// --- algo.Smallstr255.ch.SetStrptr +// Copy from strptr, clipping length +// Set string to the value provided by RHS. +// If RHS is too large, it is silently clipped. +void algo::ch_SetStrptr(algo::Smallstr255& parent, const algo::strptr& rhs) { + int len = i32_Min(rhs.n_elems, 255); + char *rhs_elems = rhs.elems; + int i = 0; + int j = 0; + for (; i < len; i++, j++) { + parent.ch[j] = rhs_elems[i]; + } + parent.n_ch = u8(len); +} + +// --- algo.Smallstr255..Hash +u32 algo::Smallstr255_Hash(u32 prev, const algo::Smallstr255& rhs) { + algo::strptr ch_strptr = ch_Getary(rhs); + prev = ::strptr_Hash(prev, ch_strptr); + return prev; +} + +// --- algo.Smallstr255..ReadStrptrMaybe +// Read fields of algo::Smallstr255 from an ascii string. +// The format of the string is the format of the algo::Smallstr255's only field +bool algo::Smallstr255_ReadStrptrMaybe(algo::Smallstr255 &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && ch_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- algo.Smallstr255..Print +// print string representation of ROW to string STR +// cfmt:algo.Smallstr255.String printfmt:Raw +void algo::Smallstr255_Print(algo::Smallstr255& row, algo::cstring& str) { + algo::ch_Print(row, str); +} + // --- algo.Smallstr3.ch.Print void algo::ch_Print(algo::Smallstr3& parent, algo::cstring &out) { ch_Addary(out, ch_Getary(parent)); @@ -12369,7 +12955,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr3& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 3"); + algo_lib::AppendErrtext("comment","text too long, limit 3"); } return retval; } @@ -12425,7 +13011,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr30& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 30"); + algo_lib::AppendErrtext("comment","text too long, limit 30"); } return retval; } @@ -12481,7 +13067,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr32& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 32"); + algo_lib::AppendErrtext("comment","text too long, limit 32"); } return retval; } @@ -12537,7 +13123,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr4& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 4"); + algo_lib::AppendErrtext("comment","text too long, limit 4"); } return retval; } @@ -12593,7 +13179,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr40& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 40"); + algo_lib::AppendErrtext("comment","text too long, limit 40"); } return retval; } @@ -12649,7 +13235,7 @@ bool algo::ch_ReadStrptrMaybe(algo::Smallstr5& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 5"); + algo_lib::AppendErrtext("comment","text too long, limit 5"); } return retval; } @@ -12754,6 +13340,25 @@ algo::aryptr algo::ary_AllocN(algo::StringAry& parent, int n_elem return algo::aryptr(elems + old_n, n_elems); } +// --- algo.StringAry.ary.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo::ary_AllocNAt(algo::StringAry& parent, int n_elems, int at) { + ary_Reserve(parent, n_elems); + int n = parent.ary_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo.bad_alloc_n_at field:algo.StringAry.ary comment:'index out of range'"); + } + algo::cstring *elems = parent.ary_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.ary_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo.StringAry.ary.Remove // Remove item by index. If index outside of range, do nothing. void algo::ary_Remove(algo::StringAry& parent, u32 i) { @@ -12850,6 +13455,30 @@ bool algo::ary_ReadStrptrMaybe(algo::StringAry& parent, algo::strptr in_str) { return retval; } +// --- algo.StringAry.ary.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo::ary_Insary(algo::StringAry& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.StringAry.ary comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.ary_elems+1))) { + FatalErrorExit("algo.bad_insary field:algo.StringAry.ary comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.ary_n - at; + ary_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.ary_elems + at + nnew + i) algo::cstring(parent.ary_elems[at + i]); + parent.ary_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.ary_elems + at + i) algo::cstring(rhs[i]); + } + parent.ary_n += nnew; +} + // --- algo.StringAry..ReadStrptrMaybe // Read fields of algo::StringAry from an ascii string. // The format of the string is the format of the algo::StringAry's only field @@ -13008,6 +13637,7 @@ const char* algo::value_ToCstr(const algo::TextJust& parent) { case algo_TextJust_j_right : ret = "j_right"; break; case algo_TextJust_j_left : ret = "j_left"; break; case algo_TextJust_j_center : ret = "j_center"; break; + case algo_TextJust_j_auto : ret = "j_auto"; break; } return ret; } @@ -13033,6 +13663,9 @@ bool algo::value_SetStrptrMaybe(algo::TextJust& parent, algo::strptr rhs) { switch (elems_N(rhs)) { case 6: { switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('j','_','a','u','t','o'): { + value_SetEnum(parent,algo_TextJust_j_auto); ret = true; break; + } case LE_STR6('j','_','l','e','f','t'): { value_SetEnum(parent,algo_TextJust_j_left); ret = true; break; } @@ -13193,6 +13826,25 @@ algo::aryptr algo::attrs_AllocN(algo::Tuple& parent, int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- algo.Tuple.attrs.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo::attrs_AllocNAt(algo::Tuple& parent, int n_elems, int at) { + attrs_Reserve(parent, n_elems); + int n = parent.attrs_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo.bad_alloc_n_at field:algo.Tuple.attrs comment:'index out of range'"); + } + algo::Attr *elems = parent.attrs_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::Attr)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::Attr(); // construct new element, default initialize + } + parent.attrs_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo.Tuple.attrs.Remove // Remove item by index. If index outside of range, do nothing. void algo::attrs_Remove(algo::Tuple& parent, u32 i) { @@ -13289,6 +13941,30 @@ bool algo::attrs_ReadStrptrMaybe(algo::Tuple& parent, algo::strptr in_str) { return retval; } +// --- algo.Tuple.attrs.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo::attrs_Insary(algo::Tuple& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.attrs_elems && rhs.elems < parent.attrs_elems + parent.attrs_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.Tuple.attrs comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.attrs_elems+1))) { + FatalErrorExit("algo.bad_insary field:algo.Tuple.attrs comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.attrs_n - at; + attrs_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.attrs_elems + at + nnew + i) algo::Attr(parent.attrs_elems[at + i]); + parent.attrs_elems[at + i].~Attr(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.attrs_elems + at + i) algo::Attr(rhs[i]); + } + parent.attrs_n += nnew; +} + // --- algo.Tuple..Uninit void algo::Tuple_Uninit(algo::Tuple& parent) { algo::Tuple &row = parent; (void)row; @@ -13317,6 +13993,256 @@ algo::Tuple& algo::Tuple::operator =(const algo::Tuple &rhs) { attrs_Setary(*this, attrs_Getary(const_cast(rhs))); } +// --- algo.U16Ary.ary.Eq +bool algo::ary_Eq(const algo::U16Ary& parent,const algo::U16Ary &rhs) { + int len = ary_N(parent); + if (len != ary_N(rhs)) { + return false; + } + for (int i = 0; i < len; i++) { + if (!(parent.ary_elems[i] == rhs.ary_elems[i])) { + return false; + } + } + return true; +} + +// --- algo.U16Ary.ary.Cmp +int algo::ary_Cmp(algo::U16Ary& parent, algo::U16Ary &rhs) { + int len = i32_Min(ary_N(parent), ary_N(rhs)); + int retval = 0; + for (int i = 0; i < len; i++) { + retval = u16_Cmp(parent.ary_elems[i], rhs.ary_elems[i]); + if (retval != 0) { + return retval; + } + } + return i32_Cmp(ary_N(parent), ary_N(rhs)); +} + +// --- algo.U16Ary.ary.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr algo::ary_Addary(algo::U16Ary& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.U16Ary.ary comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + ary_Reserve(parent, nnew); // reserve space + int at = parent.ary_n; + memcpy(parent.ary_elems + at, rhs.elems, nnew * sizeof(u16)); + parent.ary_n += nnew; + return algo::aryptr(parent.ary_elems + at, nnew); +} + +// --- algo.U16Ary.ary.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +u16& algo::ary_Alloc(algo::U16Ary& parent) { + ary_Reserve(parent, 1); + int n = parent.ary_n; + int at = n; + u16 *elems = parent.ary_elems; + new (elems + at) u16(0); // construct new element, default initializer + parent.ary_n = n+1; + return elems[at]; +} + +// --- algo.U16Ary.ary.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +u16& algo::ary_AllocAt(algo::U16Ary& parent, int at) { + ary_Reserve(parent, 1); + int n = parent.ary_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("algo.bad_alloc_at field:algo.U16Ary.ary comment:'index out of range'"); + } + u16 *elems = parent.ary_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(u16)); + new (elems + at) u16(0); // construct element, default initializer + parent.ary_n = n+1; + return elems[at]; +} + +// --- algo.U16Ary.ary.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr algo::ary_AllocN(algo::U16Ary& parent, int n_elems) { + ary_Reserve(parent, n_elems); + int old_n = parent.ary_n; + int new_n = old_n + n_elems; + u16 *elems = parent.ary_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) u16(0); // construct new element, default initialize + } + parent.ary_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- algo.U16Ary.ary.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo::ary_AllocNAt(algo::U16Ary& parent, int n_elems, int at) { + ary_Reserve(parent, n_elems); + int n = parent.ary_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo.bad_alloc_n_at field:algo.U16Ary.ary comment:'index out of range'"); + } + u16 *elems = parent.ary_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u16)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) u16(0); // construct new element, default initialize + } + parent.ary_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- algo.U16Ary.ary.Remove +// Remove item by index. If index outside of range, do nothing. +void algo::ary_Remove(algo::U16Ary& parent, u32 i) { + u32 lim = parent.ary_n; + u16 *elems = parent.ary_elems; + if (i < lim) { + memmove(elems + i, elems + (i + 1), sizeof(u16) * (lim - (i + 1))); + parent.ary_n = lim - 1; + } +} + +// --- algo.U16Ary.ary.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void algo::ary_RemoveLast(algo::U16Ary& parent) { + u64 n = parent.ary_n; + if (n > 0) { + n -= 1; + parent.ary_n = n; + } +} + +// --- algo.U16Ary.ary.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void algo::ary_AbsReserve(algo::U16Ary& parent, int n) { + u32 old_max = parent.ary_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.ary_elems, old_max * sizeof(u16), new_max * sizeof(u16)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("algo.tary_nomem field:algo.U16Ary.ary comment:'out of memory'"); + } + parent.ary_elems = (u16*)new_mem; + parent.ary_max = new_max; + } +} + +// --- algo.U16Ary.ary.Setary +// Copy contents of RHS to PARENT. +void algo::ary_Setary(algo::U16Ary& parent, algo::U16Ary &rhs) { + ary_RemoveAll(parent); + int nnew = rhs.ary_n; + ary_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.ary_elems + i) u16(ary_qFind(rhs, i)); + parent.ary_n = i + 1; + } +} + +// --- algo.U16Ary.ary.Setary2 +// Copy specified array into ary, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void algo::ary_Setary(algo::U16Ary& parent, const algo::aryptr &rhs) { + ary_RemoveAll(parent); + ary_Addary(parent, rhs); +} + +// --- algo.U16Ary.ary.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr algo::ary_AllocNVal(algo::U16Ary& parent, int n_elems, const u16& val) { + ary_Reserve(parent, n_elems); + int old_n = parent.ary_n; + int new_n = old_n + n_elems; + u16 *elems = parent.ary_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) u16(val); + } + parent.ary_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- algo.U16Ary.ary.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool algo::ary_ReadStrptrMaybe(algo::U16Ary& parent, algo::strptr in_str) { + bool retval = true; + u16 &elem = ary_Alloc(parent); + retval = u16_ReadStrptrMaybe(elem, in_str); + if (!retval) { + ary_RemoveLast(parent); + } + return retval; +} + +// --- algo.U16Ary.ary.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo::ary_Insary(algo::U16Ary& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.U16Ary.ary comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.ary_elems+1))) { + FatalErrorExit("algo.bad_insary field:algo.U16Ary.ary comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.ary_n - at; + ary_Reserve(parent, nnew); // reserve space + memmove(parent.ary_elems + at + nnew, parent.ary_elems + at, nmove * sizeof(u16)); + memcpy(parent.ary_elems + at, rhs.elems, nnew * sizeof(u16)); + parent.ary_n += nnew; +} + +// --- algo.U16Ary..Uninit +void algo::U16Ary_Uninit(algo::U16Ary& parent) { + algo::U16Ary &row = parent; (void)row; + + // algo.U16Ary.ary.Uninit (Tary) //Array of u16 values + // remove all elements from algo.U16Ary.ary + ary_RemoveAll(parent); + // free memory for Tary algo.U16Ary.ary + algo_lib::malloc_FreeMem(parent.ary_elems, sizeof(u16)*parent.ary_max); // (algo.U16Ary.ary) +} + +// --- algo.U16Ary..Print +// print string representation of ROW to string STR +// cfmt:algo.U16Ary.String printfmt:Tuple +void algo::U16Ary_Print(algo::U16Ary& row, algo::cstring& str) { + algo::tempstr temp; + str << "algo.U16Ary"; + + ind_beg(U16Ary_ary_curs,ary,row) { + u16_Print(ary, temp); + tempstr name; + name << "ary."; + name << ind_curs(ary).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; +} + +// --- algo.U16Ary..AssignOp +algo::U16Ary& algo::U16Ary::operator =(const algo::U16Ary &rhs) { + ary_Setary(*this, ary_Getary(const_cast(rhs))); + return *this; +} + +// --- algo.U16Ary..CopyCtor + algo::U16Ary::U16Ary(const algo::U16Ary &rhs) { + ary_elems = 0; // (algo.U16Ary.ary) + ary_n = 0; // (algo.U16Ary.ary) + ary_max = 0; // (algo.U16Ary.ary) + ary_Setary(*this, ary_Getary(const_cast(rhs))); +} + // --- algo.U16Dec2.value.SetDoubleMaybe // Set value of field value, using rounding. // If value is out of range for the target type, return false. @@ -13401,6 +14327,256 @@ void algo::U16Dec2_Print(algo::U16Dec2 row, algo::cstring& str) { algo::value_Print(row, str); } +// --- algo.U32Ary.ary.Eq +bool algo::ary_Eq(const algo::U32Ary& parent,const algo::U32Ary &rhs) { + int len = ary_N(parent); + if (len != ary_N(rhs)) { + return false; + } + for (int i = 0; i < len; i++) { + if (!(parent.ary_elems[i] == rhs.ary_elems[i])) { + return false; + } + } + return true; +} + +// --- algo.U32Ary.ary.Cmp +int algo::ary_Cmp(algo::U32Ary& parent, algo::U32Ary &rhs) { + int len = i32_Min(ary_N(parent), ary_N(rhs)); + int retval = 0; + for (int i = 0; i < len; i++) { + retval = u32_Cmp(parent.ary_elems[i], rhs.ary_elems[i]); + if (retval != 0) { + return retval; + } + } + return i32_Cmp(ary_N(parent), ary_N(rhs)); +} + +// --- algo.U32Ary.ary.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr algo::ary_Addary(algo::U32Ary& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.U32Ary.ary comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + ary_Reserve(parent, nnew); // reserve space + int at = parent.ary_n; + memcpy(parent.ary_elems + at, rhs.elems, nnew * sizeof(u32)); + parent.ary_n += nnew; + return algo::aryptr(parent.ary_elems + at, nnew); +} + +// --- algo.U32Ary.ary.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +u32& algo::ary_Alloc(algo::U32Ary& parent) { + ary_Reserve(parent, 1); + int n = parent.ary_n; + int at = n; + u32 *elems = parent.ary_elems; + new (elems + at) u32(0); // construct new element, default initializer + parent.ary_n = n+1; + return elems[at]; +} + +// --- algo.U32Ary.ary.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +u32& algo::ary_AllocAt(algo::U32Ary& parent, int at) { + ary_Reserve(parent, 1); + int n = parent.ary_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("algo.bad_alloc_at field:algo.U32Ary.ary comment:'index out of range'"); + } + u32 *elems = parent.ary_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(u32)); + new (elems + at) u32(0); // construct element, default initializer + parent.ary_n = n+1; + return elems[at]; +} + +// --- algo.U32Ary.ary.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr algo::ary_AllocN(algo::U32Ary& parent, int n_elems) { + ary_Reserve(parent, n_elems); + int old_n = parent.ary_n; + int new_n = old_n + n_elems; + u32 *elems = parent.ary_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) u32(0); // construct new element, default initialize + } + parent.ary_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- algo.U32Ary.ary.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo::ary_AllocNAt(algo::U32Ary& parent, int n_elems, int at) { + ary_Reserve(parent, n_elems); + int n = parent.ary_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo.bad_alloc_n_at field:algo.U32Ary.ary comment:'index out of range'"); + } + u32 *elems = parent.ary_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u32)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) u32(0); // construct new element, default initialize + } + parent.ary_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- algo.U32Ary.ary.Remove +// Remove item by index. If index outside of range, do nothing. +void algo::ary_Remove(algo::U32Ary& parent, u32 i) { + u32 lim = parent.ary_n; + u32 *elems = parent.ary_elems; + if (i < lim) { + memmove(elems + i, elems + (i + 1), sizeof(u32) * (lim - (i + 1))); + parent.ary_n = lim - 1; + } +} + +// --- algo.U32Ary.ary.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void algo::ary_RemoveLast(algo::U32Ary& parent) { + u64 n = parent.ary_n; + if (n > 0) { + n -= 1; + parent.ary_n = n; + } +} + +// --- algo.U32Ary.ary.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void algo::ary_AbsReserve(algo::U32Ary& parent, int n) { + u32 old_max = parent.ary_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.ary_elems, old_max * sizeof(u32), new_max * sizeof(u32)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("algo.tary_nomem field:algo.U32Ary.ary comment:'out of memory'"); + } + parent.ary_elems = (u32*)new_mem; + parent.ary_max = new_max; + } +} + +// --- algo.U32Ary.ary.Setary +// Copy contents of RHS to PARENT. +void algo::ary_Setary(algo::U32Ary& parent, algo::U32Ary &rhs) { + ary_RemoveAll(parent); + int nnew = rhs.ary_n; + ary_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.ary_elems + i) u32(ary_qFind(rhs, i)); + parent.ary_n = i + 1; + } +} + +// --- algo.U32Ary.ary.Setary2 +// Copy specified array into ary, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void algo::ary_Setary(algo::U32Ary& parent, const algo::aryptr &rhs) { + ary_RemoveAll(parent); + ary_Addary(parent, rhs); +} + +// --- algo.U32Ary.ary.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr algo::ary_AllocNVal(algo::U32Ary& parent, int n_elems, const u32& val) { + ary_Reserve(parent, n_elems); + int old_n = parent.ary_n; + int new_n = old_n + n_elems; + u32 *elems = parent.ary_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) u32(val); + } + parent.ary_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- algo.U32Ary.ary.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool algo::ary_ReadStrptrMaybe(algo::U32Ary& parent, algo::strptr in_str) { + bool retval = true; + u32 &elem = ary_Alloc(parent); + retval = u32_ReadStrptrMaybe(elem, in_str); + if (!retval) { + ary_RemoveLast(parent); + } + return retval; +} + +// --- algo.U32Ary.ary.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo::ary_Insary(algo::U32Ary& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.U32Ary.ary comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.ary_elems+1))) { + FatalErrorExit("algo.bad_insary field:algo.U32Ary.ary comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.ary_n - at; + ary_Reserve(parent, nnew); // reserve space + memmove(parent.ary_elems + at + nnew, parent.ary_elems + at, nmove * sizeof(u32)); + memcpy(parent.ary_elems + at, rhs.elems, nnew * sizeof(u32)); + parent.ary_n += nnew; +} + +// --- algo.U32Ary..Uninit +void algo::U32Ary_Uninit(algo::U32Ary& parent) { + algo::U32Ary &row = parent; (void)row; + + // algo.U32Ary.ary.Uninit (Tary) //Array of u16 values + // remove all elements from algo.U32Ary.ary + ary_RemoveAll(parent); + // free memory for Tary algo.U32Ary.ary + algo_lib::malloc_FreeMem(parent.ary_elems, sizeof(u32)*parent.ary_max); // (algo.U32Ary.ary) +} + +// --- algo.U32Ary..Print +// print string representation of ROW to string STR +// cfmt:algo.U32Ary.String printfmt:Tuple +void algo::U32Ary_Print(algo::U32Ary& row, algo::cstring& str) { + algo::tempstr temp; + str << "algo.U32Ary"; + + ind_beg(U32Ary_ary_curs,ary,row) { + u32_Print(ary, temp); + tempstr name; + name << "ary."; + name << ind_curs(ary).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; +} + +// --- algo.U32Ary..AssignOp +algo::U32Ary& algo::U32Ary::operator =(const algo::U32Ary &rhs) { + ary_Setary(*this, ary_Getary(const_cast(rhs))); + return *this; +} + +// --- algo.U32Ary..CopyCtor + algo::U32Ary::U32Ary(const algo::U32Ary &rhs) { + ary_elems = 0; // (algo.U32Ary.ary) + ary_n = 0; // (algo.U32Ary.ary) + ary_max = 0; // (algo.U32Ary.ary) + ary_Setary(*this, ary_Getary(const_cast(rhs))); +} + // --- algo.U32Dec1.value.SetDoubleMaybe // Set value of field value, using rounding. // If value is out of range for the target type, return false. @@ -13821,6 +14997,49 @@ void algo::U32Dec5_Print(algo::U32Dec5 row, algo::cstring& str) { algo::value_Print(row, str); } +// --- algo.U32LinearKey..ReadStrptrMaybe +// Read fields of algo::U32LinearKey from an ascii string. +// The format of the string is the format of the algo::U32LinearKey's only field +bool algo::U32LinearKey_ReadStrptrMaybe(algo::U32LinearKey &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && u32_ReadStrptrMaybe(parent.value, in_str); + return retval; +} + +// --- algo.U32LinearKey..Print +// print string representation of ROW to string STR +// cfmt:algo.U32LinearKey.String printfmt:Raw +void algo::U32LinearKey_Print(algo::U32LinearKey row, algo::cstring& str) { + u32_Print(row.value, str); +} + +// --- algo.U64Ary.ary.Eq +bool algo::ary_Eq(const algo::U64Ary& parent,const algo::U64Ary &rhs) { + int len = ary_N(parent); + if (len != ary_N(rhs)) { + return false; + } + for (int i = 0; i < len; i++) { + if (!(parent.ary_elems[i] == rhs.ary_elems[i])) { + return false; + } + } + return true; +} + +// --- algo.U64Ary.ary.Cmp +int algo::ary_Cmp(algo::U64Ary& parent, algo::U64Ary &rhs) { + int len = i32_Min(ary_N(parent), ary_N(rhs)); + int retval = 0; + for (int i = 0; i < len; i++) { + retval = u64_Cmp(parent.ary_elems[i], rhs.ary_elems[i]); + if (retval != 0) { + return retval; + } + } + return i32_Cmp(ary_N(parent), ary_N(rhs)); +} + // --- algo.U64Ary.ary.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -13881,6 +15100,25 @@ algo::aryptr algo::ary_AllocN(algo::U64Ary& parent, int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- algo.U64Ary.ary.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo::ary_AllocNAt(algo::U64Ary& parent, int n_elems, int at) { + ary_Reserve(parent, n_elems); + int n = parent.ary_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo.bad_alloc_n_at field:algo.U64Ary.ary comment:'index out of range'"); + } + u64 *elems = parent.ary_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u64)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) u64(0); // construct new element, default initialize + } + parent.ary_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo.U64Ary.ary.Remove // Remove item by index. If index outside of range, do nothing. void algo::ary_Remove(algo::U64Ary& parent, u32 i) { @@ -13965,6 +15203,25 @@ bool algo::ary_ReadStrptrMaybe(algo::U64Ary& parent, algo::strptr in_str) { return retval; } +// --- algo.U64Ary.ary.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo::ary_Insary(algo::U64Ary& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo.tary_alias field:algo.U64Ary.ary comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.ary_elems+1))) { + FatalErrorExit("algo.bad_insary field:algo.U64Ary.ary comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.ary_n - at; + ary_Reserve(parent, nnew); // reserve space + memmove(parent.ary_elems + at + nnew, parent.ary_elems + at, nmove * sizeof(u64)); + memcpy(parent.ary_elems + at, rhs.elems, nnew * sizeof(u64)); + parent.ary_n += nnew; +} + // --- algo.U64Ary..Uninit void algo::U64Ary_Uninit(algo::U64Ary& parent) { algo::U64Ary &row = parent; (void)row; @@ -13976,6 +15233,22 @@ void algo::U64Ary_Uninit(algo::U64Ary& parent) { algo_lib::malloc_FreeMem(parent.ary_elems, sizeof(u64)*parent.ary_max); // (algo.U64Ary.ary) } +// --- algo.U64Ary..Print +// print string representation of ROW to string STR +// cfmt:algo.U64Ary.String printfmt:Tuple +void algo::U64Ary_Print(algo::U64Ary& row, algo::cstring& str) { + algo::tempstr temp; + str << "algo.U64Ary"; + + ind_beg(U64Ary_ary_curs,ary,row) { + u64_Print(ary, temp); + tempstr name; + name << "ary."; + name << ind_curs(ary).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; +} + // --- algo.U64Ary..AssignOp algo::U64Ary& algo::U64Ary::operator =(const algo::U64Ary &rhs) { ary_Setary(*this, ary_Getary(const_cast(rhs))); @@ -15201,6 +16474,9 @@ void algo::StaticCheck() { algo_assert(sizeof(algo::ImrowXrefXFcn) == 8); // csize:algo.ImrowXrefXFcn algo_assert(sizeof(algo::strptr) == 16); // csize:algo.strptr algo_assert(sizeof(algo::PrlogFcn) == 8); // csize:algo.PrlogFcn + algo_assert(sizeof(algo::RspaceStr8) == 8); // csize:algo.RspaceStr8 + algo_assert(sizeof(algo::RspaceStr9) == 9); // csize:algo.RspaceStr9 + algo_assert(sizeof(algo::Smallstr10) == 12); // csize:algo.Smallstr10 algo_assert(sizeof(algo::memptr) == 16); // csize:algo.memptr algo_assert(_offset_of(algo::UnTime, value) + sizeof(((algo::UnTime*)0)->value) == sizeof(algo::UnTime)); // check that bitfield fits width diff --git a/cpp/gen/algo_lib_gen.cpp b/cpp/gen/algo_lib_gen.cpp index 026e3abb..ad2ee34e 100644 --- a/cpp/gen/algo_lib_gen.cpp +++ b/cpp/gen/algo_lib_gen.cpp @@ -29,6 +29,8 @@ #include "include/gen/algo_gen.inl.h" #include "include/gen/dmmeta_gen.h" #include "include/gen/dmmeta_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" //#pragma endinclude algo_lib::_db_bh_timehook_curs::~_db_bh_timehook_curs() { algo_lib::lpool_FreeMem(temp_elems, sizeof(void*) * temp_max); @@ -40,6 +42,18 @@ namespace algo_lib { // gen:ns_print_proto inline static bool verbose_ReadStrptrMaybe(algo_lib::Cmdline &parent, algo::strptr in_str) __attribute__((nothrow)); // func:algo_lib.Cmdline.debug.ReadStrptrMaybe inline static bool debug_ReadStrptrMaybe(algo_lib::Cmdline &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:algo_lib.RegxFlags.trace.ReadStrptrMaybe + inline static bool trace_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:algo_lib.RegxFlags.capture.ReadStrptrMaybe + inline static bool capture_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:algo_lib.RegxFlags.valid.ReadStrptrMaybe + inline static bool valid_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:algo_lib.RegxFlags.literal.ReadStrptrMaybe + inline static bool literal_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:algo_lib.RegxFlags.accepts_all.ReadStrptrMaybe + inline static bool accepts_all_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:algo_lib.RegxFlags.fullmatch.ReadStrptrMaybe + inline static bool fullmatch_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) __attribute__((nothrow)); // Load statically available data into tables, register tables and database. // func:algo_lib.FDb._db.InitReflection static void InitReflection(); @@ -55,6 +69,11 @@ namespace algo_lib { // gen:ns_print_proto inline static bool bh_timehook_ElemLt(algo_lib::FTimehook &a, algo_lib::FTimehook &b) __attribute__((nothrow)); // func:algo_lib.FDb.bh_timehook_curs.Add static void _db_bh_timehook_curs_Add(_db_bh_timehook_curs &curs, algo_lib::FTimehook& row); + // Update cycles count from previous clock capture + // func:algo_lib.FDb.bh_timehook.UpdateCycles + inline static void bh_timehook_UpdateCycles() __attribute__((nothrow)); + // func:algo_lib.FDb.bh_timehook.Call + inline static void bh_timehook_Call() __attribute__((nothrow)); // func:algo_lib.FDb.logcat.LoadStatic static void logcat_LoadStatic() __attribute__((nothrow)); // find trace by row id (used to implement reflection) @@ -86,26 +105,6 @@ namespace algo_lib { // gen:ns_print_proto // Quick sort engine // func:algo_lib.FTxttbl.c_txtrow.IntQuickSort static void c_txtrow_IntQuickSort(algo_lib::FTxtrow* *elems, int n, int depth) __attribute__((nothrow)); - // Swap values elem_a and elem_b - // func:algo_lib.RegxState.ch_class.Swap - inline static void ch_class_Swap(algo::i32_Range &elem_a, algo::i32_Range &elem_b) __attribute__((nothrow)); - // Left circular shift of three-tuple - // func:algo_lib.RegxState.ch_class.Rotleft - inline static void ch_class_Rotleft(algo::i32_Range &elem_a, algo::i32_Range &elem_b, algo::i32_Range &elem_c) __attribute__((nothrow)); - // Compare values elem_a and elem_b - // The comparison function must be anti-symmetric: if a>b, then !(b>a). - // If not, mayhem results. - // func:algo_lib.RegxState.ch_class.Lt - static bool ch_class_Lt(algo::i32_Range &elem_a, algo::i32_Range &elem_b) __attribute__((nothrow)); - // Internal insertion sort - // func:algo_lib.RegxState.ch_class.IntInsertionSort - static void ch_class_IntInsertionSort(algo::i32_Range *elems, int n) __attribute__((nothrow)); - // Internal heap sort - // func:algo_lib.RegxState.ch_class.IntHeapSort - static void ch_class_IntHeapSort(algo::i32_Range *elems, int n) __attribute__((nothrow)); - // Quick sort engine - // func:algo_lib.RegxState.ch_class.IntQuickSort - static void ch_class_IntQuickSort(algo::i32_Range *elems, int n, int depth) __attribute__((nothrow)); // func:algo_lib...SizeCheck inline static void SizeCheck(); } // gen:ns_print_proto @@ -189,6 +188,25 @@ algo::aryptr algo_lib::ary_AllocN(algo_lib::Bitset& parent, int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- algo_lib.Bitset.ary.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo_lib::ary_AllocNAt(algo_lib::Bitset& parent, int n_elems, int at) { + ary_Reserve(parent, n_elems); + int n = parent.ary_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo_lib.bad_alloc_n_at field:algo_lib.Bitset.ary comment:'index out of range'"); + } + u64 *elems = parent.ary_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u64)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) u64(0); // construct new element, default initialize + } + parent.ary_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo_lib.Bitset.ary.Remove // Remove item by index. If index outside of range, do nothing. void algo_lib::ary_Remove(algo_lib::Bitset& parent, u32 i) { @@ -273,6 +291,25 @@ bool algo_lib::ary_ReadStrptrMaybe(algo_lib::Bitset& parent, algo::strptr in_str return retval; } +// --- algo_lib.Bitset.ary.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo_lib::ary_Insary(algo_lib::Bitset& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo_lib.tary_alias field:algo_lib.Bitset.ary comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.ary_elems+1))) { + FatalErrorExit("algo_lib.bad_insary field:algo_lib.Bitset.ary comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.ary_n - at; + ary_Reserve(parent, nnew); // reserve space + memmove(parent.ary_elems + at + nnew, parent.ary_elems + at, nmove * sizeof(u64)); + memcpy(parent.ary_elems + at, rhs.elems, nnew * sizeof(u64)); + parent.ary_n += nnew; +} + // --- algo_lib.Bitset.ary_bitcurs.Next // proceed to next item void algo_lib::Bitset_ary_bitcurs_Next(Bitset_ary_bitcurs &curs) { @@ -419,41 +456,35 @@ bool algo_lib::Cmdline_ReadFieldMaybe(algo_lib::Cmdline& parent, algo::strptr fi switch(field_id) { case algo_lib_FieldId_verbose: { retval = verbose_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_lib_FieldId_debug: { retval = debug_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_lib_FieldId_help: { retval = bool_ReadStrptrMaybe(parent.help, strval); - break; - } + } break; case algo_lib_FieldId_version: { retval = bool_ReadStrptrMaybe(parent.version, strval); - break; - } + } break; case algo_lib_FieldId_signature: { retval = bool_ReadStrptrMaybe(parent.signature, strval); - break; - } + } break; case algo_lib_FieldId_v: { retval = v_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_lib_FieldId_d: { retval = d_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_lib_FieldId_sig: { retval = sig_ReadStrptrMaybe(parent, strval); - break; - } + } break; case algo_lib_FieldId_h: { retval = h_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -481,47 +512,47 @@ bool algo_lib::Cmdline_ReadTupleMaybe(algo_lib::Cmdline &parent, algo::Tuple &tu i32 algo_lib::Cmdline_NArgs(algo_lib::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case algo_lib_FieldId_verbose: { // $comment + case algo_lib_FieldId_verbose: { // dmmeta.fflag: emptyval specified; no argument required but value may be specified as verbose:value *out_anon = false; retval=0; out_dflt="1"; } break; - case algo_lib_FieldId_debug: { // dmmeta.fflag: emptyval specified; no argument required but value may be specified as verbose:value + case algo_lib_FieldId_debug: { // dmmeta.fflag: emptyval specified; no argument required but value may be specified as debug:value *out_anon = false; retval=0; out_dflt="1"; } break; - case algo_lib_FieldId_help: { // dmmeta.fflag: emptyval specified; no argument required but value may be specified as debug:value + case algo_lib_FieldId_help: { // bool: no argument required but value may be specified as help:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case algo_lib_FieldId_version: { // bool: no argument required but value may be specified as help:Y + case algo_lib_FieldId_version: { // bool: no argument required but value may be specified as version:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case algo_lib_FieldId_signature: { // bool: no argument required but value may be specified as version:Y + case algo_lib_FieldId_signature: { // bool: no argument required but value may be specified as signature:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case algo_lib_FieldId_v: { // bool: no argument required but value may be specified as signature:Y + case algo_lib_FieldId_v: { // dmmeta.fflag: emptyval specified; no argument required but value may be specified as v:value *out_anon = false; retval=0; out_dflt="1"; } break; - case algo_lib_FieldId_d: { // dmmeta.fflag: emptyval specified; no argument required but value may be specified as v:value + case algo_lib_FieldId_d: { // dmmeta.fflag: emptyval specified; no argument required but value may be specified as d:value *out_anon = false; retval=0; out_dflt="1"; } break; - case algo_lib_FieldId_sig: { // dmmeta.fflag: emptyval specified; no argument required but value may be specified as d:value + case algo_lib_FieldId_sig: { // bool: no argument required but value may be specified as sig:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case algo_lib_FieldId_h: { // bool: no argument required but value may be specified as sig:Y + case algo_lib_FieldId_h: { // bool: no argument required but value may be specified as h:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -594,6 +625,25 @@ algo::aryptr algo_lib::ary_tok_AllocN(algo_lib::CsvParse& csvpars return algo::aryptr(elems + old_n, n_elems); } +// --- algo_lib.CsvParse.ary_tok.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo_lib::ary_tok_AllocNAt(algo_lib::CsvParse& csvparse, int n_elems, int at) { + ary_tok_Reserve(csvparse, n_elems); + int n = csvparse.ary_tok_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo_lib.bad_alloc_n_at field:algo_lib.CsvParse.ary_tok comment:'index out of range'"); + } + algo::cstring *elems = csvparse.ary_tok_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + csvparse.ary_tok_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo_lib.CsvParse.ary_tok.Remove // Remove item by index. If index outside of range, do nothing. void algo_lib::ary_tok_Remove(algo_lib::CsvParse& csvparse, u32 i) { @@ -690,6 +740,30 @@ bool algo_lib::ary_tok_ReadStrptrMaybe(algo_lib::CsvParse& csvparse, algo::strpt return retval; } +// --- algo_lib.CsvParse.ary_tok.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo_lib::ary_tok_Insary(algo_lib::CsvParse& csvparse, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= csvparse.ary_tok_elems && rhs.elems < csvparse.ary_tok_elems + csvparse.ary_tok_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo_lib.tary_alias field:algo_lib.CsvParse.ary_tok comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(csvparse.ary_tok_elems+1))) { + FatalErrorExit("algo_lib.bad_insary field:algo_lib.CsvParse.ary_tok comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = csvparse.ary_tok_n - at; + ary_tok_Reserve(csvparse, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (csvparse.ary_tok_elems + at + nnew + i) algo::cstring(csvparse.ary_tok_elems[at + i]); + csvparse.ary_tok_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (csvparse.ary_tok_elems + at + i) algo::cstring(rhs[i]); + } + csvparse.ary_tok_n += nnew; +} + // --- algo_lib.CsvParse..Uninit void algo_lib::CsvParse_Uninit(algo_lib::CsvParse& csvparse) { algo_lib::CsvParse &row = csvparse; (void)row; @@ -772,21 +846,20 @@ bool algo_lib::FTimehook_ReadFieldMaybe(algo_lib::FTimehook& parent, algo::strpt switch(field_id) { case algo_lib_FieldId_time: { retval = algo::SchedTime_ReadStrptrMaybe(parent.time, strval); - break; - } + } break; case algo_lib_FieldId_delay: { retval = algo::SchedTime_ReadStrptrMaybe(parent.delay, strval); - break; - } + } break; case algo_lib_FieldId_hook: { retval = false; - break; - } + } break; case algo_lib_FieldId_recurrent: { retval = bool_ReadStrptrMaybe(parent.recurrent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -857,108 +930,637 @@ void algo_lib::FImdb_Uninit(algo_lib::FImdb& imdb) { ind_imdb_Remove(row); // remove imdb from index ind_imdb } -// --- algo_lib.FLogcat.base.CopyOut -// Copy fields out of row -void algo_lib::logcat_CopyOut(algo_lib::FLogcat &row, dmmeta::Logcat &out) { - out.logcat = row.logcat; - out.enabled = row.enabled; - out.builtin = row.builtin; - out.comment = row.comment; +// --- algo_lib.RegxFlags.trace.ReadStrptrMaybe +inline static bool algo_lib::trace_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) { + bool retval = true; + bool trace_tmp; + retval = bool_ReadStrptrMaybe(trace_tmp, in_str); + if (retval) { + trace_Set(parent, trace_tmp); + } + return retval; } -// --- algo_lib.FLogcat.base.CopyIn -// Copy fields in to row -void algo_lib::logcat_CopyIn(algo_lib::FLogcat &row, dmmeta::Logcat &in) { - row.logcat = in.logcat; - row.enabled = in.enabled; - row.builtin = in.builtin; - row.comment = in.comment; +// --- algo_lib.RegxFlags.capture.ReadStrptrMaybe +inline static bool algo_lib::capture_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) { + bool retval = true; + bool capture_tmp; + retval = bool_ReadStrptrMaybe(capture_tmp, in_str); + if (retval) { + capture_Set(parent, capture_tmp); + } + return retval; } -// --- algo_lib.FLogcat..Uninit -void algo_lib::FLogcat_Uninit(algo_lib::FLogcat& logcat) { - algo_lib::FLogcat &row = logcat; (void)row; - ind_logcat_Remove(row); // remove logcat from index ind_logcat +// --- algo_lib.RegxFlags.valid.ReadStrptrMaybe +inline static bool algo_lib::valid_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) { + bool retval = true; + bool valid_tmp; + retval = bool_ReadStrptrMaybe(valid_tmp, in_str); + if (retval) { + valid_Set(parent, valid_tmp); + } + return retval; } -// --- algo_lib.trace..Init -// Set all fields to initial values. -void algo_lib::trace_Init(algo_lib::trace& parent) { - parent.n_mmap = u64(0); - parent.n_sbrk = u64(0); - parent.tot_insert_err = u64(0); - parent.tot_selfcheck_err = u64(0); - parent.tot_update_err = u64(0); - parent.step_bh_timehook = u64(0); - parent.step_bh_timehook_cycles = u64(0); - parent.step_giveup_time = u64(0); - parent.step_giveup_time_cycles = u64(0); - parent.alloc__db_malloc = u64(0); - parent.del__db_malloc = u64(0); +// --- algo_lib.RegxFlags.literal.ReadStrptrMaybe +inline static bool algo_lib::literal_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) { + bool retval = true; + bool literal_tmp; + retval = bool_ReadStrptrMaybe(literal_tmp, in_str); + if (retval) { + literal_Set(parent, literal_tmp); + } + return retval; } -// --- algo_lib.trace..Print -// print string representation of ROW to string STR -// cfmt:algo_lib.trace.String printfmt:Tuple -void algo_lib::trace_Print(algo_lib::trace& row, algo::cstring& str) { - algo::tempstr temp; - str << "algo_lib.trace"; - - u64_Print(row.n_mmap, temp); - PrintAttrSpaceReset(str,"n_mmap", temp); - - u64_Print(row.n_sbrk, temp); - PrintAttrSpaceReset(str,"n_sbrk", temp); - - u64_Print(row.tot_insert_err, temp); - PrintAttrSpaceReset(str,"tot_insert_err", temp); - - u64_Print(row.tot_selfcheck_err, temp); - PrintAttrSpaceReset(str,"tot_selfcheck_err", temp); +// --- algo_lib.RegxFlags.accepts_all.ReadStrptrMaybe +inline static bool algo_lib::accepts_all_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) { + bool retval = true; + bool accepts_all_tmp; + retval = bool_ReadStrptrMaybe(accepts_all_tmp, in_str); + if (retval) { + accepts_all_Set(parent, accepts_all_tmp); + } + return retval; +} - u64_Print(row.tot_update_err, temp); - PrintAttrSpaceReset(str,"tot_update_err", temp); +// --- algo_lib.RegxFlags.fullmatch.ReadStrptrMaybe +inline static bool algo_lib::fullmatch_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) { + bool retval = true; + bool fullmatch_tmp; + retval = bool_ReadStrptrMaybe(fullmatch_tmp, in_str); + if (retval) { + fullmatch_Set(parent, fullmatch_tmp); + } + return retval; +} - u64_Print(row.step_bh_timehook, temp); - PrintAttrSpaceReset(str,"step_bh_timehook", temp); +// --- algo_lib.RegxFlags..ReadFieldMaybe +bool algo_lib::RegxFlags_ReadFieldMaybe(algo_lib::RegxFlags& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + algo_lib::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case algo_lib_FieldId_value: { + retval = u8_ReadStrptrMaybe(parent.value, strval); + } break; + case algo_lib_FieldId_trace: { + retval = trace_ReadStrptrMaybe(parent, strval); + } break; + case algo_lib_FieldId_capture: { + retval = capture_ReadStrptrMaybe(parent, strval); + } break; + case algo_lib_FieldId_valid: { + retval = valid_ReadStrptrMaybe(parent, strval); + } break; + case algo_lib_FieldId_literal: { + retval = literal_ReadStrptrMaybe(parent, strval); + } break; + case algo_lib_FieldId_accepts_all: { + retval = accepts_all_ReadStrptrMaybe(parent, strval); + } break; + case algo_lib_FieldId_fullmatch: { + retval = fullmatch_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} - u64_Print(row.step_bh_timehook_cycles, temp); - PrintAttrSpaceReset(str,"step_bh_timehook_cycles", temp); +// --- algo_lib.RegxFlags..ReadStrptrMaybe +// Read fields of algo_lib::RegxFlags from an ascii string. +bool algo_lib::RegxFlags_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) { + bool retval = true; + // Clear affected bits first) + trace_Set(parent, false); + capture_Set(parent, false); + valid_Set(parent, false); + literal_Set(parent, false); + accepts_all_Set(parent, false); + fullmatch_Set(parent, false); + // Read ','-separated list of bools + while (ch_N(in_str)) { + strptr field_name; + algo::NextSep(in_str,',',field_name); + field_name = algo::Trimmed(field_name); + if (ch_N(field_name)) { + algo_lib::FieldId field_id; + bool ok = algo_lib::value_SetStrptrMaybe(field_id,field_name); + if (ok) { + switch (field_id) { + case algo_lib_FieldId_trace: { + trace_Set(parent, true); + } break; + case algo_lib_FieldId_capture: { + capture_Set(parent, true); + } break; + case algo_lib_FieldId_valid: { + valid_Set(parent, true); + } break; + case algo_lib_FieldId_literal: { + literal_Set(parent, true); + } break; + case algo_lib_FieldId_accepts_all: { + accepts_all_Set(parent, true); + } break; + case algo_lib_FieldId_fullmatch: { + fullmatch_Set(parent, true); + } break; + default: ok = false; break; + } + } + if (!ok) { + algo_lib::AppendErrtext("bitfld",field_name); + retval = false; + } + } + } + return retval; +} - u64_Print(row.step_giveup_time, temp); - PrintAttrSpaceReset(str,"step_giveup_time", temp); +// --- algo_lib.RegxFlags..Print +// print string representation of ROW to string STR +// cfmt:algo_lib.RegxFlags.String printfmt:Bitset +void algo_lib::RegxFlags_Print(algo_lib::RegxFlags row, algo::cstring& str) { + algo::ListSep ls(","); + if (trace_Get(row)) { + str << ls << "trace"; + } + if (capture_Get(row)) { + str << ls << "capture"; + } + if (valid_Get(row)) { + str << ls << "valid"; + } + if (literal_Get(row)) { + str << ls << "literal"; + } + if (accepts_all_Get(row)) { + str << ls << "accepts_all"; + } + if (fullmatch_Get(row)) { + str << ls << "fullmatch"; + } +} - u64_Print(row.step_giveup_time_cycles, temp); - PrintAttrSpaceReset(str,"step_giveup_time_cycles", temp); +// --- algo_lib.RegxFlags..GetAnon +algo::strptr algo_lib::RegxFlags_GetAnon(algo_lib::RegxFlags &parent, i32 idx) { + (void)parent;//only to avoid -Wunused-parameter + switch(idx) { + case(0): return strptr("value", 5); + default: return algo::strptr(); + } +} - u64_Print(row.alloc__db_malloc, temp); - PrintAttrSpaceReset(str,"alloc__db_malloc", temp); +// --- algo_lib.RegxStyle.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* algo_lib::value_ToCstr(const algo_lib::RegxStyle& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case algo_lib_RegxStyle_default : ret = "default"; break; + case algo_lib_RegxStyle_sql : ret = "sql"; break; + case algo_lib_RegxStyle_acr : ret = "acr"; break; + case algo_lib_RegxStyle_shell : ret = "shell"; break; + case algo_lib_RegxStyle_literal : ret = "literal"; break; + } + return ret; +} - u64_Print(row.del__db_malloc, temp); - PrintAttrSpaceReset(str,"del__db_malloc", temp); +// --- algo_lib.RegxStyle.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void algo_lib::value_Print(const algo_lib::RegxStyle& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } } -// --- algo_lib.FDb.sbrk.AllocMem -// Allocate a new piece of memory at least SIZE bytes long. -// If out of memory, return NULL -// Newly allocated memory is initialized to zeros -void* algo_lib::sbrk_AllocMem(u32 size) { - void *ret; -#if defined(__MACH__) || __FreeBSD__>0 || __CYGWIN__>0 || defined(WIN32) - ret = malloc(size); -#else - ret = MAP_FAILED; - u32 bigsize = 1024*2048; - if (size >= bigsize) { // big block -- will be registered - size = (size + bigsize - 1) / bigsize * bigsize; - int prot = PROT_READ | PROT_WRITE; - int flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE; - bool use_huge = _db.sbrk_huge_alloc + size < _db.sbrk_huge_limit; - if (use_huge) { - ret = mmap(0x0, size, prot, flags | MAP_HUGETLB, 0, 0); // try huge pages - } - // linux huge page handling is buggy -- MAP_POPULATE doesn't guarantee - // that pages are there. subsequent page fault may cause a SIGBUS. +// --- algo_lib.RegxStyle.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool algo_lib::value_SetStrptrMaybe(algo_lib::RegxStyle& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('a','c','r'): { + value_SetEnum(parent,algo_lib_RegxStyle_acr); ret = true; break; + } + case LE_STR3('s','q','l'): { + value_SetEnum(parent,algo_lib_RegxStyle_sql); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('s','h','e','l','l'): { + value_SetEnum(parent,algo_lib_RegxStyle_shell); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('d','e','f','a','u','l','t'): { + value_SetEnum(parent,algo_lib_RegxStyle_default); ret = true; break; + } + case LE_STR7('l','i','t','e','r','a','l'): { + value_SetEnum(parent,algo_lib_RegxStyle_literal); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- algo_lib.RegxStyle.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void algo_lib::value_SetStrptr(algo_lib::RegxStyle& parent, algo::strptr rhs, algo_lib_RegxStyleEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- algo_lib.RegxStyle.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool algo_lib::value_ReadStrptrMaybe(algo_lib::RegxStyle& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- algo_lib.RegxStyle..ReadStrptrMaybe +// Read fields of algo_lib::RegxStyle from an ascii string. +// The format of the string is the format of the algo_lib::RegxStyle's only field +bool algo_lib::RegxStyle_ReadStrptrMaybe(algo_lib::RegxStyle &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- algo_lib.RegxStyle..Print +// print string representation of ROW to string STR +// cfmt:algo_lib.RegxStyle.String printfmt:Raw +void algo_lib::RegxStyle_Print(algo_lib::RegxStyle& row, algo::cstring& str) { + algo_lib::value_Print(row, str); +} + +// --- algo_lib.Regx.state.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr algo_lib::state_Addary(algo_lib::Regx& regx, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= regx.state_elems && rhs.elems < regx.state_elems + regx.state_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo_lib.tary_alias field:algo_lib.Regx.state comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + state_Reserve(regx, nnew); // reserve space + int at = regx.state_n; + for (int i = 0; i < nnew; i++) { + new (regx.state_elems + at + i) algo_lib::RegxState(rhs[i]); + regx.state_n++; + } + return algo::aryptr(regx.state_elems + at, nnew); +} + +// --- algo_lib.Regx.state.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +algo_lib::RegxState& algo_lib::state_Alloc(algo_lib::Regx& regx) { + state_Reserve(regx, 1); + int n = regx.state_n; + int at = n; + algo_lib::RegxState *elems = regx.state_elems; + new (elems + at) algo_lib::RegxState(); // construct new element, default initializer + regx.state_n = n+1; + return elems[at]; +} + +// --- algo_lib.Regx.state.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo_lib::RegxState& algo_lib::state_AllocAt(algo_lib::Regx& regx, int at) { + state_Reserve(regx, 1); + int n = regx.state_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("algo_lib.bad_alloc_at field:algo_lib.Regx.state comment:'index out of range'"); + } + algo_lib::RegxState *elems = regx.state_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(algo_lib::RegxState)); + new (elems + at) algo_lib::RegxState(); // construct element, default initializer + regx.state_n = n+1; + return elems[at]; +} + +// --- algo_lib.Regx.state.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr algo_lib::state_AllocN(algo_lib::Regx& regx, int n_elems) { + state_Reserve(regx, n_elems); + int old_n = regx.state_n; + int new_n = old_n + n_elems; + algo_lib::RegxState *elems = regx.state_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo_lib::RegxState(); // construct new element, default initialize + } + regx.state_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- algo_lib.Regx.state.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo_lib::state_AllocNAt(algo_lib::Regx& regx, int n_elems, int at) { + state_Reserve(regx, n_elems); + int n = regx.state_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo_lib.bad_alloc_n_at field:algo_lib.Regx.state comment:'index out of range'"); + } + algo_lib::RegxState *elems = regx.state_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo_lib::RegxState)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo_lib::RegxState(); // construct new element, default initialize + } + regx.state_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- algo_lib.Regx.state.Remove +// Remove item by index. If index outside of range, do nothing. +void algo_lib::state_Remove(algo_lib::Regx& regx, u32 i) { + u32 lim = regx.state_n; + algo_lib::RegxState *elems = regx.state_elems; + if (i < lim) { + elems[i].~RegxState(); // destroy element + memmove(elems + i, elems + (i + 1), sizeof(algo_lib::RegxState) * (lim - (i + 1))); + regx.state_n = lim - 1; + } +} + +// --- algo_lib.Regx.state.RemoveAll +void algo_lib::state_RemoveAll(algo_lib::Regx& regx) { + u32 n = regx.state_n; + while (n > 0) { + n -= 1; + regx.state_elems[n].~RegxState(); + regx.state_n = n; + } +} + +// --- algo_lib.Regx.state.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void algo_lib::state_RemoveLast(algo_lib::Regx& regx) { + u64 n = regx.state_n; + if (n > 0) { + n -= 1; + state_qFind(regx, u64(n)).~RegxState(); + regx.state_n = n; + } +} + +// --- algo_lib.Regx.state.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void algo_lib::state_AbsReserve(algo_lib::Regx& regx, int n) { + u32 old_max = regx.state_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::lpool_ReallocMem(regx.state_elems, old_max * sizeof(algo_lib::RegxState), new_max * sizeof(algo_lib::RegxState)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("algo_lib.tary_nomem field:algo_lib.Regx.state comment:'out of memory'"); + } + regx.state_elems = (algo_lib::RegxState*)new_mem; + regx.state_max = new_max; + } +} + +// --- algo_lib.Regx.state.Setary +// Copy contents of RHS to PARENT. +void algo_lib::state_Setary(algo_lib::Regx& regx, algo_lib::Regx &rhs) { + state_RemoveAll(regx); + int nnew = rhs.state_n; + state_Reserve(regx, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (regx.state_elems + i) algo_lib::RegxState(state_qFind(rhs, i)); + regx.state_n = i + 1; + } +} + +// --- algo_lib.Regx.state.Setary2 +// Copy specified array into state, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void algo_lib::state_Setary(algo_lib::Regx& regx, const algo::aryptr &rhs) { + state_RemoveAll(regx); + state_Addary(regx, rhs); +} + +// --- algo_lib.Regx.state.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr algo_lib::state_AllocNVal(algo_lib::Regx& regx, int n_elems, const algo_lib::RegxState& val) { + state_Reserve(regx, n_elems); + int old_n = regx.state_n; + int new_n = old_n + n_elems; + algo_lib::RegxState *elems = regx.state_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo_lib::RegxState(val); + } + regx.state_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- algo_lib.Regx.state.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo_lib::state_Insary(algo_lib::Regx& regx, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= regx.state_elems && rhs.elems < regx.state_elems + regx.state_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo_lib.tary_alias field:algo_lib.Regx.state comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(regx.state_elems+1))) { + FatalErrorExit("algo_lib.bad_insary field:algo_lib.Regx.state comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = regx.state_n - at; + state_Reserve(regx, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (regx.state_elems + at + nnew + i) algo_lib::RegxState(regx.state_elems[at + i]); + regx.state_elems[at + i].~RegxState(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (regx.state_elems + at + i) algo_lib::RegxState(rhs[i]); + } + regx.state_n += nnew; +} + +// --- algo_lib.Regx..Uninit +void algo_lib::Regx_Uninit(algo_lib::Regx& regx) { + algo_lib::Regx &row = regx; (void)row; + + // algo_lib.Regx.state.Uninit (Tary) //Array of states + // remove all elements from algo_lib.Regx.state + state_RemoveAll(regx); + // free memory for Tary algo_lib.Regx.state + algo_lib::lpool_FreeMem(regx.state_elems, sizeof(algo_lib::RegxState)*regx.state_max); // (algo_lib.Regx.state) +} + +// --- algo_lib.Regx..AssignOp +algo_lib::Regx& algo_lib::Regx::operator =(const algo_lib::Regx &rhs) { + expr = rhs.expr; + state_Setary(*this, state_Getary(const_cast(rhs))); + flags = rhs.flags; + style = rhs.style; + return *this; +} + +// --- algo_lib.Regx..CopyCtor + algo_lib::Regx::Regx(const algo_lib::Regx &rhs) + : expr(rhs.expr) + , flags(rhs.flags) + , style(rhs.style) + { + state_elems = 0; // (algo_lib.Regx.state) + state_n = 0; // (algo_lib.Regx.state) + state_max = 0; // (algo_lib.Regx.state) + state_Setary(*this, state_Getary(const_cast(rhs))); +} + +// --- algo_lib.FLogcat.base.CopyOut +// Copy fields out of row +void algo_lib::logcat_CopyOut(algo_lib::FLogcat &row, dmmeta::Logcat &out) { + out.logcat = row.logcat; + out.enabled = row.enabled; + out.builtin = row.builtin; + out.stdout = row.stdout; + out.maxmsg = row.maxmsg; + out.window = row.window; + out.comment = row.comment; +} + +// --- algo_lib.FLogcat.base.CopyIn +// Copy fields in to row +void algo_lib::logcat_CopyIn(algo_lib::FLogcat &row, dmmeta::Logcat &in) { + row.logcat = in.logcat; + row.enabled = in.enabled; + row.builtin = in.builtin; + row.stdout = in.stdout; + row.maxmsg = in.maxmsg; + row.window = in.window; + row.comment = in.comment; +} + +// --- algo_lib.FLogcat..Init +// Set all fields to initial values. +void algo_lib::FLogcat_Init(algo_lib::FLogcat& logcat) { + logcat.enabled = bool(false); + logcat.builtin = bool(false); + logcat.stdout = bool(false); + logcat.maxmsg = i32(0); + logcat.window = i32(0); + logcat.nmsg = i64(0); + logcat.ind_logcat_next = (algo_lib::FLogcat*)-1; // (algo_lib.FDb.ind_logcat) not-in-hash + logcat.ind_logcat_hashval = 0; // stored hash value +} + +// --- algo_lib.FLogcat..Uninit +void algo_lib::FLogcat_Uninit(algo_lib::FLogcat& logcat) { + algo_lib::FLogcat &row = logcat; (void)row; + ind_logcat_Remove(row); // remove logcat from index ind_logcat +} + +// --- algo_lib.trace..Init +// Set all fields to initial values. +void algo_lib::trace_Init(algo_lib::trace& parent) { + parent.n_mmap = u64(0); + parent.n_sbrk = u64(0); + parent.tot_insert_err = u64(0); + parent.tot_selfcheck_err = u64(0); + parent.tot_update_err = u64(0); + parent.step_bh_timehook = u64(0); + parent.step_bh_timehook_cycles = u64(0); + parent.step_giveup_time = u64(0); + parent.step_giveup_time_cycles = u64(0); + parent.alloc__db_malloc = u64(0); + parent.del__db_malloc = u64(0); +} + +// --- algo_lib.trace..Print +// print string representation of ROW to string STR +// cfmt:algo_lib.trace.String printfmt:Tuple +void algo_lib::trace_Print(algo_lib::trace& row, algo::cstring& str) { + algo::tempstr temp; + str << "algo_lib.trace"; + + u64_Print(row.n_mmap, temp); + PrintAttrSpaceReset(str,"n_mmap", temp); + + u64_Print(row.n_sbrk, temp); + PrintAttrSpaceReset(str,"n_sbrk", temp); + + u64_Print(row.tot_insert_err, temp); + PrintAttrSpaceReset(str,"tot_insert_err", temp); + + u64_Print(row.tot_selfcheck_err, temp); + PrintAttrSpaceReset(str,"tot_selfcheck_err", temp); + + u64_Print(row.tot_update_err, temp); + PrintAttrSpaceReset(str,"tot_update_err", temp); + + u64_Print(row.step_bh_timehook, temp); + PrintAttrSpaceReset(str,"step_bh_timehook", temp); + + u64_Print(row.step_bh_timehook_cycles, temp); + PrintAttrSpaceReset(str,"step_bh_timehook_cycles", temp); + + u64_Print(row.step_giveup_time, temp); + PrintAttrSpaceReset(str,"step_giveup_time", temp); + + u64_Print(row.step_giveup_time_cycles, temp); + PrintAttrSpaceReset(str,"step_giveup_time_cycles", temp); + + u64_Print(row.alloc__db_malloc, temp); + PrintAttrSpaceReset(str,"alloc__db_malloc", temp); + + u64_Print(row.del__db_malloc, temp); + PrintAttrSpaceReset(str,"del__db_malloc", temp); +} + +// --- algo_lib.FDb.sbrk.AllocMem +// Allocate a new piece of memory at least SIZE bytes long. +// If out of memory, return NULL +// Newly allocated memory is initialized to zeros +void* algo_lib::sbrk_AllocMem(u32 size) { + void *ret; +#if defined(__MACH__) || __FreeBSD__>0 || __CYGWIN__>0 || defined(WIN32) + ret = malloc(size); +#else + ret = MAP_FAILED; + u32 bigsize = 1024*2048; + if (size >= bigsize) { // big block -- will be registered + size = (size + bigsize - 1) / bigsize * bigsize; + int prot = PROT_READ | PROT_WRITE; + int flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE; + bool use_huge = _db.sbrk_huge_alloc + size < _db.sbrk_huge_limit; + if (use_huge) { + ret = mmap(0x0, size, prot, flags | MAP_HUGETLB, 0, 0); // try huge pages + } + // linux huge page handling is buggy -- MAP_POPULATE doesn't guarantee + // that pages are there. subsequent page fault may cause a SIGBUS. // fortunately there is a way to detect this condition using mlock. if (use_huge && ret != MAP_FAILED) { int rc = mlock(ret, size); @@ -1207,8 +1809,8 @@ bool algo_lib::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && algo_lib::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -1251,18 +1853,6 @@ bool algo_lib::LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) return retval; } -// --- algo_lib.FDb._db.Init -void algo_lib::Init() { - algo_lib::_db.last_signal = 0; - ind_beg_aryptr(cstring, str, algo_lib::temp_strings_Getary()) { - ch_Reserve(str, 256); - }ind_end_aryptr; - algo_lib::_db.n_temp = algo_lib::temp_strings_N(); - algo_lib::bh_timehook_Reserve(32); - algo_lib::InitCpuHz(); - algo_lib::_db.eol = true; -} - // --- algo_lib.FDb._db.LoadSsimfileMaybe // Load specified ssimfile. bool algo_lib::LoadSsimfileMaybe(algo::strptr fname, bool recursive) { @@ -1391,14 +1981,9 @@ bool algo_lib::imtable_XrefMaybe(algo_lib::FImtable &row) { // Find row by key. Return NULL if not found. algo_lib::FImtable* algo_lib::ind_imtable_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_imtable_buckets_n - 1); - algo_lib::FImtable* *e = &_db.ind_imtable_buckets_elems[index]; - algo_lib::FImtable* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).imtable == key; - if (done) break; - e = &ret->ind_imtable_next; - } while (true); + algo_lib::FImtable *ret = _db.ind_imtable_buckets_elems[index]; + for (; ret && !((*ret).imtable == key); ret = ret->ind_imtable_next) { + } return ret; } @@ -1422,10 +2007,11 @@ algo_lib::FImtable& algo_lib::ind_imtable_GetOrCreate(const algo::strptr& key) { // --- algo_lib.FDb.ind_imtable.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool algo_lib::ind_imtable_InsertMaybe(algo_lib::FImtable& row) { - ind_imtable_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_imtable_next == (algo_lib::FImtable*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.imtable) & (_db.ind_imtable_buckets_n - 1); + row.ind_imtable_hashval = algo::Smallstr50_Hash(0, row.imtable); + ind_imtable_Reserve(1); + u32 index = row.ind_imtable_hashval & (_db.ind_imtable_buckets_n - 1); algo_lib::FImtable* *prev = &_db.ind_imtable_buckets_elems[index]; do { algo_lib::FImtable* ret = *prev; @@ -1451,7 +2037,7 @@ bool algo_lib::ind_imtable_InsertMaybe(algo_lib::FImtable& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void algo_lib::ind_imtable_Remove(algo_lib::FImtable& row) { if (LIKELY(row.ind_imtable_next != (algo_lib::FImtable*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.imtable) & (_db.ind_imtable_buckets_n - 1); + u32 index = row.ind_imtable_hashval & (_db.ind_imtable_buckets_n - 1); algo_lib::FImtable* *prev = &_db.ind_imtable_buckets_elems[index]; // addr of pointer to current element while (algo_lib::FImtable *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1468,8 +2054,14 @@ void algo_lib::ind_imtable_Remove(algo_lib::FImtable& row) { // --- algo_lib.FDb.ind_imtable.Reserve // Reserve enough room in the hash for N more elements. Return success code. void algo_lib::ind_imtable_Reserve(int n) { + ind_imtable_AbsReserve(_db.ind_imtable_n + n); +} + +// --- algo_lib.FDb.ind_imtable.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void algo_lib::ind_imtable_AbsReserve(int n) { u32 old_nbuckets = _db.ind_imtable_buckets_n; - u32 new_nelems = _db.ind_imtable_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1488,7 +2080,7 @@ void algo_lib::ind_imtable_Reserve(int n) { while (elem) { algo_lib::FImtable &row = *elem; algo_lib::FImtable* next = row.ind_imtable_next; - u32 index = algo::Smallstr50_Hash(0, row.imtable) & (new_nbuckets-1); + u32 index = row.ind_imtable_hashval & (new_nbuckets-1); row.ind_imtable_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1774,7 +2366,7 @@ void algo_lib::bh_timehook_FirstChanged() { // --- algo_lib.FDb.bh_timehook.UpdateCycles // Update cycles count from previous clock capture -void algo_lib::bh_timehook_UpdateCycles() { +inline static void algo_lib::bh_timehook_UpdateCycles() { u64 cur_cycles = algo::get_cycles(); u64 prev_cycles = algo_lib::_db.clock.value; ++algo_lib::_db.trace.step_bh_timehook; @@ -1782,6 +2374,25 @@ void algo_lib::bh_timehook_UpdateCycles() { algo_lib::_db.clock = algo::SchedTime(cur_cycles); } +// --- algo_lib.FDb.bh_timehook.Call +inline static void algo_lib::bh_timehook_Call() { + // Call Step for all entries expired by this time. + // (_db.clock may get updated during this loop, but only those entries + // that expired prior will be processed.) + algo_lib::_db.step_limit = algo_lib::_db.clock; + while (algo_lib::FTimehook *bh_timehook = algo_lib::bh_timehook_First()) { // fstep:algo_lib.FDb.bh_timehook + algo::SchedTime expire = (*bh_timehook).time; + if (expire < algo_lib::_db.step_limit) { + algo_lib::bh_timehook_Step(); // steptype:InlineOnce: call function at specified time + bh_timehook_UpdateCycles(); + algo_lib::_db.next_loop.value = algo_lib::_db.step_limit; + } else { + algo_lib::_db.next_loop.value = u64_Min(expire, algo_lib::_db.next_loop); + break; + } + } +} + // --- algo_lib.FDb.dispsigcheck.Alloc // Allocate memory for new default row. // If out of memory, process is killed. @@ -1876,14 +2487,9 @@ bool algo_lib::dispsigcheck_XrefMaybe(algo_lib::FDispsigcheck &row) { // Find row by key. Return NULL if not found. algo_lib::FDispsigcheck* algo_lib::ind_dispsigcheck_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_dispsigcheck_buckets_n - 1); - algo_lib::FDispsigcheck* *e = &_db.ind_dispsigcheck_buckets_elems[index]; - algo_lib::FDispsigcheck* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).dispsig == key; - if (done) break; - e = &ret->ind_dispsigcheck_next; - } while (true); + algo_lib::FDispsigcheck *ret = _db.ind_dispsigcheck_buckets_elems[index]; + for (; ret && !((*ret).dispsig == key); ret = ret->ind_dispsigcheck_next) { + } return ret; } @@ -1907,10 +2513,11 @@ algo_lib::FDispsigcheck& algo_lib::ind_dispsigcheck_GetOrCreate(const algo::strp // --- algo_lib.FDb.ind_dispsigcheck.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool algo_lib::ind_dispsigcheck_InsertMaybe(algo_lib::FDispsigcheck& row) { - ind_dispsigcheck_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_dispsigcheck_next == (algo_lib::FDispsigcheck*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.dispsig) & (_db.ind_dispsigcheck_buckets_n - 1); + row.ind_dispsigcheck_hashval = algo::Smallstr50_Hash(0, row.dispsig); + ind_dispsigcheck_Reserve(1); + u32 index = row.ind_dispsigcheck_hashval & (_db.ind_dispsigcheck_buckets_n - 1); algo_lib::FDispsigcheck* *prev = &_db.ind_dispsigcheck_buckets_elems[index]; do { algo_lib::FDispsigcheck* ret = *prev; @@ -1936,7 +2543,7 @@ bool algo_lib::ind_dispsigcheck_InsertMaybe(algo_lib::FDispsigcheck& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void algo_lib::ind_dispsigcheck_Remove(algo_lib::FDispsigcheck& row) { if (LIKELY(row.ind_dispsigcheck_next != (algo_lib::FDispsigcheck*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.dispsig) & (_db.ind_dispsigcheck_buckets_n - 1); + u32 index = row.ind_dispsigcheck_hashval & (_db.ind_dispsigcheck_buckets_n - 1); algo_lib::FDispsigcheck* *prev = &_db.ind_dispsigcheck_buckets_elems[index]; // addr of pointer to current element while (algo_lib::FDispsigcheck *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1953,8 +2560,14 @@ void algo_lib::ind_dispsigcheck_Remove(algo_lib::FDispsigcheck& row) { // --- algo_lib.FDb.ind_dispsigcheck.Reserve // Reserve enough room in the hash for N more elements. Return success code. void algo_lib::ind_dispsigcheck_Reserve(int n) { + ind_dispsigcheck_AbsReserve(_db.ind_dispsigcheck_n + n); +} + +// --- algo_lib.FDb.ind_dispsigcheck.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void algo_lib::ind_dispsigcheck_AbsReserve(int n) { u32 old_nbuckets = _db.ind_dispsigcheck_buckets_n; - u32 new_nelems = _db.ind_dispsigcheck_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1973,7 +2586,7 @@ void algo_lib::ind_dispsigcheck_Reserve(int n) { while (elem) { algo_lib::FDispsigcheck &row = *elem; algo_lib::FDispsigcheck* next = row.ind_dispsigcheck_next; - u32 index = algo::Smallstr50_Hash(0, row.dispsig) & (new_nbuckets-1); + u32 index = row.ind_dispsigcheck_hashval & (new_nbuckets-1); row.ind_dispsigcheck_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2055,14 +2668,9 @@ bool algo_lib::imdb_XrefMaybe(algo_lib::FImdb &row) { // Find row by key. Return NULL if not found. algo_lib::FImdb* algo_lib::ind_imdb_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_imdb_buckets_n - 1); - algo_lib::FImdb* *e = &_db.ind_imdb_buckets_elems[index]; - algo_lib::FImdb* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).imdb == key; - if (done) break; - e = &ret->ind_imdb_next; - } while (true); + algo_lib::FImdb *ret = _db.ind_imdb_buckets_elems[index]; + for (; ret && !((*ret).imdb == key); ret = ret->ind_imdb_next) { + } return ret; } @@ -2086,10 +2694,11 @@ algo_lib::FImdb& algo_lib::ind_imdb_GetOrCreate(const algo::strptr& key) { // --- algo_lib.FDb.ind_imdb.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool algo_lib::ind_imdb_InsertMaybe(algo_lib::FImdb& row) { - ind_imdb_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_imdb_next == (algo_lib::FImdb*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.imdb) & (_db.ind_imdb_buckets_n - 1); + row.ind_imdb_hashval = algo::Smallstr50_Hash(0, row.imdb); + ind_imdb_Reserve(1); + u32 index = row.ind_imdb_hashval & (_db.ind_imdb_buckets_n - 1); algo_lib::FImdb* *prev = &_db.ind_imdb_buckets_elems[index]; do { algo_lib::FImdb* ret = *prev; @@ -2115,7 +2724,7 @@ bool algo_lib::ind_imdb_InsertMaybe(algo_lib::FImdb& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void algo_lib::ind_imdb_Remove(algo_lib::FImdb& row) { if (LIKELY(row.ind_imdb_next != (algo_lib::FImdb*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.imdb) & (_db.ind_imdb_buckets_n - 1); + u32 index = row.ind_imdb_hashval & (_db.ind_imdb_buckets_n - 1); algo_lib::FImdb* *prev = &_db.ind_imdb_buckets_elems[index]; // addr of pointer to current element while (algo_lib::FImdb *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2132,8 +2741,14 @@ void algo_lib::ind_imdb_Remove(algo_lib::FImdb& row) { // --- algo_lib.FDb.ind_imdb.Reserve // Reserve enough room in the hash for N more elements. Return success code. void algo_lib::ind_imdb_Reserve(int n) { + ind_imdb_AbsReserve(_db.ind_imdb_n + n); +} + +// --- algo_lib.FDb.ind_imdb.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void algo_lib::ind_imdb_AbsReserve(int n) { u32 old_nbuckets = _db.ind_imdb_buckets_n; - u32 new_nelems = _db.ind_imdb_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2152,7 +2767,7 @@ void algo_lib::ind_imdb_Reserve(int n) { while (elem) { algo_lib::FImdb &row = *elem; algo_lib::FImdb* next = row.ind_imdb_next; - u32 index = algo::Smallstr50_Hash(0, row.imdb) & (new_nbuckets-1); + u32 index = row.ind_imdb_hashval & (new_nbuckets-1); row.ind_imdb_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2550,16 +3165,6 @@ bool algo_lib::replvar_XrefMaybe(algo_lib::FReplvar &row) { return retval; } -// --- algo_lib.FDb.giveup_time.UpdateCycles -// Update cycles count from previous clock capture -void algo_lib::giveup_time_UpdateCycles() { - u64 cur_cycles = algo::get_cycles(); - u64 prev_cycles = algo_lib::_db.clock.value; - ++algo_lib::_db.trace.step_giveup_time; - algo_lib::_db.trace.step_giveup_time_cycles += cur_cycles - prev_cycles; - algo_lib::_db.clock = algo::SchedTime(cur_cycles); -} - // --- algo_lib.FDb.logcat.Alloc // Allocate memory for new default row. // If out of memory, process is killed. @@ -2621,9 +3226,16 @@ static void algo_lib::logcat_LoadStatic() { static struct _t { const char *s; } data[] = { - { "dmmeta.logcat logcat:expect enabled:N builtin:N comment:\"lib_ams expect implementation\"" } - ,{ "dmmeta.logcat logcat:stderr enabled:Y builtin:Y comment:\"Standard error (cannot be disabled)\"" } - ,{ "dmmeta.logcat logcat:stdout enabled:Y builtin:Y comment:\"Standard output (cannot be disabled)\"" } + { "dmmeta.logcat logcat:ams enabled:N builtin:N stdout:Y maxmsg:0 window:0 comment:\"Trace ams bus\"" } + ,{ "dmmeta.logcat logcat:debug enabled:N builtin:N stdout:N maxmsg:0 window:0 comment:\"Debug messages\"" } + ,{ "dmmeta.logcat logcat:inserr enabled:N builtin:Y stdout:N maxmsg:10 window:10 comment:\"In-memory db insert error\"" } + ,{ "dmmeta.logcat logcat:slowness enabled:N builtin:N stdout:Y maxmsg:10 window:5 comment:\"Debug slowness\"" } + ,{ "dmmeta.logcat logcat:stderr enabled:Y builtin:Y stdout:N maxmsg:0 window:0 comment:\"Standard error (cannot be disabled)\"" } + ,{ "dmmeta.logcat logcat:stdout enabled:Y builtin:Y stdout:Y maxmsg:0 window:0 comment:\"Standard output (cannot be disabled)\"" } + ,{ "dmmeta.logcat logcat:timestamps enabled:N builtin:N stdout:Y maxmsg:0 window:0 comment:\"Show timestamps\"" } + ,{ "dmmeta.logcat logcat:verbose enabled:N builtin:N stdout:N maxmsg:0 window:0 comment:\"Verbose messages go here\"" } + ,{ "dmmeta.logcat logcat:verbose2 enabled:N builtin:N stdout:N maxmsg:0 window:0 comment:\"Extra verbose messages go here\"" } + ,{ "dmmeta.logcat logcat:warn enabled:Y builtin:N stdout:N maxmsg:100 window:5 comment:Warnings" } ,{NULL} }; (void)data; @@ -2659,14 +3271,9 @@ bool algo_lib::logcat_XrefMaybe(algo_lib::FLogcat &row) { // Find row by key. Return NULL if not found. algo_lib::FLogcat* algo_lib::ind_logcat_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_logcat_buckets_n - 1); - algo_lib::FLogcat* *e = &_db.ind_logcat_buckets_elems[index]; - algo_lib::FLogcat* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).logcat == key; - if (done) break; - e = &ret->ind_logcat_next; - } while (true); + algo_lib::FLogcat *ret = _db.ind_logcat_buckets_elems[index]; + for (; ret && !((*ret).logcat == key); ret = ret->ind_logcat_next) { + } return ret; } @@ -2690,10 +3297,11 @@ algo_lib::FLogcat& algo_lib::ind_logcat_GetOrCreate(const algo::strptr& key) { // --- algo_lib.FDb.ind_logcat.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool algo_lib::ind_logcat_InsertMaybe(algo_lib::FLogcat& row) { - ind_logcat_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_logcat_next == (algo_lib::FLogcat*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.logcat) & (_db.ind_logcat_buckets_n - 1); + row.ind_logcat_hashval = algo::Smallstr50_Hash(0, row.logcat); + ind_logcat_Reserve(1); + u32 index = row.ind_logcat_hashval & (_db.ind_logcat_buckets_n - 1); algo_lib::FLogcat* *prev = &_db.ind_logcat_buckets_elems[index]; do { algo_lib::FLogcat* ret = *prev; @@ -2719,7 +3327,7 @@ bool algo_lib::ind_logcat_InsertMaybe(algo_lib::FLogcat& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void algo_lib::ind_logcat_Remove(algo_lib::FLogcat& row) { if (LIKELY(row.ind_logcat_next != (algo_lib::FLogcat*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.logcat) & (_db.ind_logcat_buckets_n - 1); + u32 index = row.ind_logcat_hashval & (_db.ind_logcat_buckets_n - 1); algo_lib::FLogcat* *prev = &_db.ind_logcat_buckets_elems[index]; // addr of pointer to current element while (algo_lib::FLogcat *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2736,8 +3344,14 @@ void algo_lib::ind_logcat_Remove(algo_lib::FLogcat& row) { // --- algo_lib.FDb.ind_logcat.Reserve // Reserve enough room in the hash for N more elements. Return success code. void algo_lib::ind_logcat_Reserve(int n) { + ind_logcat_AbsReserve(_db.ind_logcat_n + n); +} + +// --- algo_lib.FDb.ind_logcat.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void algo_lib::ind_logcat_AbsReserve(int n) { u32 old_nbuckets = _db.ind_logcat_buckets_n; - u32 new_nelems = _db.ind_logcat_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2756,7 +3370,7 @@ void algo_lib::ind_logcat_Reserve(int n) { while (elem) { algo_lib::FLogcat &row = *elem; algo_lib::FLogcat* next = row.ind_logcat_next; - u32 index = algo::Smallstr50_Hash(0, row.logcat) & (new_nbuckets-1); + u32 index = row.ind_logcat_hashval & (new_nbuckets-1); row.ind_logcat_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2831,6 +3445,25 @@ algo::aryptr algo_lib::exec_args_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- algo_lib.FDb.exec_args.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo_lib::exec_args_AllocNAt(int n_elems, int at) { + exec_args_Reserve(n_elems); + int n = _db.exec_args_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo_lib.bad_alloc_n_at field:algo_lib.FDb.exec_args comment:'index out of range'"); + } + algo::cstring *elems = _db.exec_args_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + _db.exec_args_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo_lib.FDb.exec_args.Remove // Remove item by index. If index outside of range, do nothing. void algo_lib::exec_args_Remove(u32 i) { @@ -2907,6 +3540,30 @@ bool algo_lib::exec_args_ReadStrptrMaybe(algo::strptr in_str) { return retval; } +// --- algo_lib.FDb.exec_args.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo_lib::exec_args_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.exec_args_elems && rhs.elems < _db.exec_args_elems + _db.exec_args_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo_lib.tary_alias field:algo_lib.FDb.exec_args comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.exec_args_elems+1))) { + FatalErrorExit("algo_lib.bad_insary field:algo_lib.FDb.exec_args comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.exec_args_n - at; + exec_args_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.exec_args_elems + at + nnew + i) algo::cstring(_db.exec_args_elems[at + i]); + _db.exec_args_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.exec_args_elems + at + i) algo::cstring(rhs[i]); + } + _db.exec_args_n += nnew; +} + // --- algo_lib.FDb.dirstack.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -2969,6 +3626,25 @@ algo::aryptr algo_lib::dirstack_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- algo_lib.FDb.dirstack.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo_lib::dirstack_AllocNAt(int n_elems, int at) { + dirstack_Reserve(n_elems); + int n = _db.dirstack_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo_lib.bad_alloc_n_at field:algo_lib.FDb.dirstack comment:'index out of range'"); + } + algo::cstring *elems = _db.dirstack_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + _db.dirstack_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo_lib.FDb.dirstack.Remove // Remove item by index. If index outside of range, do nothing. void algo_lib::dirstack_Remove(u32 i) { @@ -3045,6 +3721,49 @@ bool algo_lib::dirstack_ReadStrptrMaybe(algo::strptr in_str) { return retval; } +// --- algo_lib.FDb.dirstack.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo_lib::dirstack_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.dirstack_elems && rhs.elems < _db.dirstack_elems + _db.dirstack_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo_lib.tary_alias field:algo_lib.FDb.dirstack comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.dirstack_elems+1))) { + FatalErrorExit("algo_lib.bad_insary field:algo_lib.FDb.dirstack comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.dirstack_n - at; + dirstack_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.dirstack_elems + at + nnew + i) algo::cstring(_db.dirstack_elems[at + i]); + _db.dirstack_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.dirstack_elems + at + i) algo::cstring(rhs[i]); + } + _db.dirstack_n += nnew; +} + +// --- algo_lib.FDb.errns.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool algo_lib::errns_XrefMaybe(algo_lib::FErrns &row) { + bool retval = true; + (void)row; + return retval; +} + +// --- algo_lib.FDb.giveup_time.UpdateCycles +// Update cycles count from previous clock capture +void algo_lib::giveup_time_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + u64 prev_cycles = algo_lib::_db.clock.value; + ++algo_lib::_db.trace.step_giveup_time; + algo_lib::_db.trace.step_giveup_time_cycles += cur_cycles - prev_cycles; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + // --- algo_lib.FDb.trace.RowidFind // find trace by row id (used to implement reflection) static algo::ImrowPtr algo_lib::trace_RowidFind(int t) { @@ -3160,7 +3879,6 @@ void algo_lib::FDb_Init() { _db.clocks_to_ns = double(0.0); _db.n_temp = u32(0); _db.last_signal = u32(0); - _db.eol = bool(false); _db.cpu_hz = u64(0); (void)Charset_ReadStrptrMaybe(_db.ArgvIdent, "a-zA-Z0-9_"); (void)Charset_ReadStrptrMaybe(_db.BashQuotesafe, "a-zA-Z0-9_^%@./-"); @@ -3168,14 +3886,7 @@ void algo_lib::FDb_Init() { (void)Charset_ReadStrptrPlain(_db.SsimBreakName, "[]{}()\t \r\n:"); (void)Charset_ReadStrptrPlain(_db.SsimBreakValue, "[]{}()\t \r\n"); (void)Charset_ReadStrptrMaybe(_db.SsimQuotesafe, "a-zA-Z0-9_;&*^%$@.!:,+/-"); - algo_lib::_db.last_signal = 0; - ind_beg_aryptr(cstring, str, algo_lib::temp_strings_Getary()) { - ch_Reserve(str, 256); - }ind_end_aryptr; - algo_lib::_db.n_temp = algo_lib::temp_strings_N(); - algo_lib::bh_timehook_Reserve(32); - algo_lib::InitCpuHz(); - algo_lib::_db.eol = true; + _db_Userinit(); // dmmeta.fuserinit:algo_lib.FDb._db // initialize LAry imtable (algo_lib.FDb.imtable) _db.imtable_n = 0; memset(_db.imtable_lary, 0, sizeof(_db.imtable_lary)); // zero out all level pointers @@ -3242,10 +3953,7 @@ void algo_lib::FDb_Init() { _db.replvar_blocksize = algo::BumpToPow2(64 * sizeof(algo_lib::FReplvar)); // allocate 64-127 elements at a time _db.giveup_count = u64(0); _db.stringtofile_nwrite = u32(0); - _db.giveup_time = bool(true); - _db.sleep_roundup = bool(false); _db.last_sleep_clocks = u64(0); - _db.show_insert_err_lim = u32(0); (void)Charset_ReadStrptrMaybe(_db.Urlsafe, "0-9a-zA-Z_.~"); _db.winjob = u64(0); _db.Prlog = algo::PrlogFcn(algo::Prlog); @@ -3258,17 +3966,18 @@ void algo_lib::FDb_Init() { FatalErrorExit("out of memory"); // (algo_lib.FDb.ind_logcat) } memset(_db.ind_logcat_buckets_elems, 0, sizeof(algo_lib::FLogcat*)*_db.ind_logcat_buckets_n); // (algo_lib.FDb.ind_logcat) - _db.show_tstamp = bool(false); _db.tstamp_fmt = algo::strptr("%Y/%m/%dT%H:%M:%S.%.6X "); - _db.fildes_stdout = algo::Fildes(1); - _db.fildes_stderr = algo::Fildes(2); - _db.pending_eol = bool(false); _db.exec_args_elems = 0; // (algo_lib.FDb.exec_args) _db.exec_args_n = 0; // (algo_lib.FDb.exec_args) _db.exec_args_max = 0; // (algo_lib.FDb.exec_args) _db.dirstack_elems = 0; // (algo_lib.FDb.dirstack) _db.dirstack_n = 0; // (algo_lib.FDb.dirstack) _db.dirstack_max = 0; // (algo_lib.FDb.dirstack) + errns_Userinit(); // dmmeta.fuserinit:algo_lib.FDb.errns + _db.use_epoll_pwait2 = bool(false); + _db.pending_eol = bool(false); + _db.giveup_time = bool(true); + _db.show_tstamp = bool(false); algo_lib::InitReflection(); _db.h_fatalerror = NULL; @@ -3478,15 +4187,11 @@ void algo_lib::c_txtcell_Cascdel(algo_lib::FTxtrow& txtrow) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void algo_lib::c_txtcell_Insert(algo_lib::FTxtrow& txtrow, algo_lib::FTxtcell& row) { - if (bool_Update(row.txtrow_c_txtcell_in_ary,true)) { - // reserve space + if (!row.txtrow_c_txtcell_in_ary) { c_txtcell_Reserve(txtrow, 1); - u32 n = txtrow.c_txtcell_n; - u32 at = n; - algo_lib::FTxtcell* *elems = txtrow.c_txtcell_elems; - elems[at] = &row; - txtrow.c_txtcell_n = n+1; - + u32 n = txtrow.c_txtcell_n++; + txtrow.c_txtcell_elems[n] = &row; + row.txtrow_c_txtcell_in_ary = true; } } @@ -3495,7 +4200,7 @@ void algo_lib::c_txtcell_Insert(algo_lib::FTxtrow& txtrow, algo_lib::FTxtcell& r // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool algo_lib::c_txtcell_InsertMaybe(algo_lib::FTxtrow& txtrow, algo_lib::FTxtcell& row) { - bool retval = !row.txtrow_c_txtcell_in_ary; + bool retval = !txtrow_c_txtcell_InAryQ(row); c_txtcell_Insert(txtrow,row); // check is performed in _Insert again return retval; } @@ -3503,18 +4208,18 @@ bool algo_lib::c_txtcell_InsertMaybe(algo_lib::FTxtrow& txtrow, algo_lib::FTxtce // --- algo_lib.FTxtrow.c_txtcell.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void algo_lib::c_txtcell_Remove(algo_lib::FTxtrow& txtrow, algo_lib::FTxtcell& row) { + int n = txtrow.c_txtcell_n; if (bool_Update(row.txtrow_c_txtcell_in_ary,false)) { - int lim = txtrow.c_txtcell_n; algo_lib::FTxtcell* *elems = txtrow.c_txtcell_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { algo_lib::FTxtcell* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(algo_lib::FTxtcell*) * (lim - j); + size_t nbytes = sizeof(algo_lib::FTxtcell*) * (n - j); memmove(elems + i, elems + j, nbytes); - txtrow.c_txtcell_n = lim - 1; + txtrow.c_txtcell_n = n - 1; break; } } @@ -3570,15 +4275,11 @@ void algo_lib::c_txtrow_Cascdel(algo_lib::FTxttbl& txttbl) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void algo_lib::c_txtrow_Insert(algo_lib::FTxttbl& txttbl, algo_lib::FTxtrow& row) { - if (bool_Update(row.txttbl_c_txtrow_in_ary,true)) { - // reserve space + if (!row.txttbl_c_txtrow_in_ary) { c_txtrow_Reserve(txttbl, 1); - u32 n = txttbl.c_txtrow_n; - u32 at = n; - algo_lib::FTxtrow* *elems = txttbl.c_txtrow_elems; - elems[at] = &row; - txttbl.c_txtrow_n = n+1; - + u32 n = txttbl.c_txtrow_n++; + txttbl.c_txtrow_elems[n] = &row; + row.txttbl_c_txtrow_in_ary = true; } } @@ -3587,7 +4288,7 @@ void algo_lib::c_txtrow_Insert(algo_lib::FTxttbl& txttbl, algo_lib::FTxtrow& row // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool algo_lib::c_txtrow_InsertMaybe(algo_lib::FTxttbl& txttbl, algo_lib::FTxtrow& row) { - bool retval = !row.txttbl_c_txtrow_in_ary; + bool retval = !txttbl_c_txtrow_InAryQ(row); c_txtrow_Insert(txttbl,row); // check is performed in _Insert again return retval; } @@ -3595,18 +4296,18 @@ bool algo_lib::c_txtrow_InsertMaybe(algo_lib::FTxttbl& txttbl, algo_lib::FTxtrow // --- algo_lib.FTxttbl.c_txtrow.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void algo_lib::c_txtrow_Remove(algo_lib::FTxttbl& txttbl, algo_lib::FTxtrow& row) { + int n = txttbl.c_txtrow_n; if (bool_Update(row.txttbl_c_txtrow_in_ary,false)) { - int lim = txttbl.c_txtrow_n; algo_lib::FTxtrow* *elems = txttbl.c_txtrow_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { algo_lib::FTxtrow* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(algo_lib::FTxtrow*) * (lim - j); + size_t nbytes = sizeof(algo_lib::FTxtrow*) * (n - j); memmove(elems + i, elems + j, nbytes); - txttbl.c_txtrow_n = lim - 1; + txttbl.c_txtrow_n = n - 1; break; } } @@ -3801,7 +4502,7 @@ void algo_lib::FTxttbl_Uninit(algo_lib::FTxttbl& txttbl) { algo_lib::FTxttbl &row = txttbl; (void)row; c_txtrow_Cascdel(txttbl); // dmmeta.cascdel:algo_lib.FTxttbl.c_txtrow - // algo_lib.FTxttbl.c_txtrow.Uninit (Ptrary) //Array of cells + // algo_lib.FTxttbl.c_txtrow.Uninit (Ptrary) //Array of rows algo_lib::lpool_FreeMem(txttbl.c_txtrow_elems, sizeof(algo_lib::FTxtrow*)*txttbl.c_txtrow_max); // (algo_lib.FTxttbl.c_txtrow) } @@ -3827,17 +4528,21 @@ const char* algo_lib::value_ToCstr(const algo_lib::FieldId& parent) { case algo_lib_FieldId_recurrent : ret = "recurrent"; break; case algo_lib_FieldId_expr : ret = "expr"; break; case algo_lib_FieldId_state : ret = "state"; break; - case algo_lib_FieldId_front : ret = "front"; break; - case algo_lib_FieldId_next_front : ret = "next_front"; break; - case algo_lib_FieldId_start : ret = "start"; break; - case algo_lib_FieldId_accept : ret = "accept"; break; - case algo_lib_FieldId_parseerror : ret = "parseerror"; break; - case algo_lib_FieldId_accepts_all : ret = "accepts_all"; break; - case algo_lib_FieldId_literal : ret = "literal"; break; + case algo_lib_FieldId_flags : ret = "flags"; break; + case algo_lib_FieldId_style : ret = "style"; break; case algo_lib_FieldId_type : ret = "type"; break; - case algo_lib_FieldId_in : ret = "in"; break; - case algo_lib_FieldId_out : ret = "out"; break; + case algo_lib_FieldId_first : ret = "first"; break; + case algo_lib_FieldId_last : ret = "last"; break; case algo_lib_FieldId_value : ret = "value"; break; + case algo_lib_FieldId_trace : ret = "trace"; break; + case algo_lib_FieldId_capture : ret = "capture"; break; + case algo_lib_FieldId_valid : ret = "valid"; break; + case algo_lib_FieldId_literal : ret = "literal"; break; + case algo_lib_FieldId_accepts_all : ret = "accepts_all"; break; + case algo_lib_FieldId_fullmatch : ret = "fullmatch"; break; + case algo_lib_FieldId_op : ret = "op"; break; + case algo_lib_FieldId_consume : ret = "consume"; break; + case algo_lib_FieldId_imm : ret = "imm"; break; } return ret; } @@ -3877,8 +4582,8 @@ bool algo_lib::value_SetStrptrMaybe(algo_lib::FieldId& parent, algo::strptr rhs) } case 2: { switch (u64(algo::ReadLE16(rhs.elems))) { - case LE_STR2('i','n'): { - value_SetEnum(parent,algo_lib_FieldId_in); ret = true; break; + case LE_STR2('o','p'): { + value_SetEnum(parent,algo_lib_FieldId_op); ret = true; break; } } break; @@ -3888,8 +4593,8 @@ bool algo_lib::value_SetStrptrMaybe(algo_lib::FieldId& parent, algo::strptr rhs) case LE_STR3('a','r','y'): { value_SetEnum(parent,algo_lib_FieldId_ary); ret = true; break; } - case LE_STR3('o','u','t'): { - value_SetEnum(parent,algo_lib_FieldId_out); ret = true; break; + case LE_STR3('i','m','m'): { + value_SetEnum(parent,algo_lib_FieldId_imm); ret = true; break; } case LE_STR3('s','i','g'): { value_SetEnum(parent,algo_lib_FieldId_sig); ret = true; break; @@ -3908,6 +4613,9 @@ bool algo_lib::value_SetStrptrMaybe(algo_lib::FieldId& parent, algo::strptr rhs) case LE_STR4('h','o','o','k'): { value_SetEnum(parent,algo_lib_FieldId_hook); ret = true; break; } + case LE_STR4('l','a','s','t'): { + value_SetEnum(parent,algo_lib_FieldId_last); ret = true; break; + } case LE_STR4('t','i','m','e'): { value_SetEnum(parent,algo_lib_FieldId_time); ret = true; break; } @@ -3925,31 +4633,38 @@ bool algo_lib::value_SetStrptrMaybe(algo_lib::FieldId& parent, algo::strptr rhs) case LE_STR5('d','e','l','a','y'): { value_SetEnum(parent,algo_lib_FieldId_delay); ret = true; break; } - case LE_STR5('f','r','o','n','t'): { - value_SetEnum(parent,algo_lib_FieldId_front); ret = true; break; + case LE_STR5('f','i','r','s','t'): { + value_SetEnum(parent,algo_lib_FieldId_first); ret = true; break; } - case LE_STR5('s','t','a','r','t'): { - value_SetEnum(parent,algo_lib_FieldId_start); ret = true; break; + case LE_STR5('f','l','a','g','s'): { + value_SetEnum(parent,algo_lib_FieldId_flags); ret = true; break; } case LE_STR5('s','t','a','t','e'): { value_SetEnum(parent,algo_lib_FieldId_state); ret = true; break; } + case LE_STR5('s','t','y','l','e'): { + value_SetEnum(parent,algo_lib_FieldId_style); ret = true; break; + } + case LE_STR5('t','r','a','c','e'): { + value_SetEnum(parent,algo_lib_FieldId_trace); ret = true; break; + } + case LE_STR5('v','a','l','i','d'): { + value_SetEnum(parent,algo_lib_FieldId_valid); ret = true; break; + } case LE_STR5('v','a','l','u','e'): { value_SetEnum(parent,algo_lib_FieldId_value); ret = true; break; } } break; } - case 6: { - switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { - case LE_STR6('a','c','c','e','p','t'): { - value_SetEnum(parent,algo_lib_FieldId_accept); ret = true; break; - } - } - break; - } case 7: { switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('c','a','p','t','u','r','e'): { + value_SetEnum(parent,algo_lib_FieldId_capture); ret = true; break; + } + case LE_STR7('c','o','n','s','u','m','e'): { + value_SetEnum(parent,algo_lib_FieldId_consume); ret = true; break; + } case LE_STR7('l','i','t','e','r','a','l'): { value_SetEnum(parent,algo_lib_FieldId_literal); ret = true; break; } @@ -3964,6 +4679,10 @@ bool algo_lib::value_SetStrptrMaybe(algo_lib::FieldId& parent, algo::strptr rhs) } case 9: { switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('f','u','l','l','m','a','t','c'): { + if (memcmp(rhs.elems+8,"h",1)==0) { value_SetEnum(parent,algo_lib_FieldId_fullmatch); ret = true; break; } + break; + } case LE_STR8('r','e','c','u','r','r','e','n'): { if (memcmp(rhs.elems+8,"t",1)==0) { value_SetEnum(parent,algo_lib_FieldId_recurrent); ret = true; break; } break; @@ -3975,19 +4694,6 @@ bool algo_lib::value_SetStrptrMaybe(algo_lib::FieldId& parent, algo::strptr rhs) } break; } - case 10: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('n','e','x','t','_','f','r','o'): { - if (memcmp(rhs.elems+8,"nt",2)==0) { value_SetEnum(parent,algo_lib_FieldId_next_front); ret = true; break; } - break; - } - case LE_STR8('p','a','r','s','e','e','r','r'): { - if (memcmp(rhs.elems+8,"or",2)==0) { value_SetEnum(parent,algo_lib_FieldId_parseerror); ret = true; break; } - break; - } - } - break; - } case 11: { switch (algo::ReadLE64(rhs.elems)) { case LE_STR8('a','c','c','e','p','t','s','_'): { @@ -4010,286 +4716,100 @@ void algo_lib::value_SetStrptr(algo_lib::FieldId& parent, algo::strptr rhs, algo // --- algo_lib.FieldId.value.ReadStrptrMaybe // Convert string to field. Return success value -bool algo_lib::value_ReadStrptrMaybe(algo_lib::FieldId& parent, algo::strptr rhs) { - bool retval = false; - retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion - if (!retval) { // didn't work? try reading as underlying type - retval = i32_ReadStrptrMaybe(parent.value,rhs); - } - return retval; -} - -// --- algo_lib.FieldId..ReadStrptrMaybe -// Read fields of algo_lib::FieldId from an ascii string. -// The format of the string is the format of the algo_lib::FieldId's only field -bool algo_lib::FieldId_ReadStrptrMaybe(algo_lib::FieldId &parent, algo::strptr in_str) { - bool retval = true; - retval = retval && value_ReadStrptrMaybe(parent, in_str); - return retval; -} - -// --- algo_lib.FieldId..Print -// print string representation of ROW to string STR -// cfmt:algo_lib.FieldId.String printfmt:Raw -void algo_lib::FieldId_Print(algo_lib::FieldId& row, algo::cstring& str) { - algo_lib::value_Print(row, str); -} - -// --- algo_lib.InTextFile.temp_buf.Alloc -// Allocate memory for new default row. -// If out of memory, process is killed. -u8& algo_lib::temp_buf_Alloc(algo_lib::InTextFile& parent) { - u8* row = temp_buf_AllocMaybe(parent); - if (UNLIKELY(row == NULL)) { - FatalErrorExit("algo_lib.out_of_mem field:algo_lib.InTextFile.temp_buf comment:'Alloc failed'"); - } - return *row; -} - -// --- algo_lib.InTextFile.temp_buf.AllocMaybe -// Allocate memory for new element. If out of memory, return NULL. -u8* algo_lib::temp_buf_AllocMaybe(algo_lib::InTextFile& parent) { - u8 *row = (u8*)temp_buf_AllocMem(parent); - if (row) { - new (row) u8; // call constructor - } - return row; -} - -// --- algo_lib.InTextFile.temp_buf.RemoveAll -// Destroy all elements of Inlary -void algo_lib::temp_buf_RemoveAll(algo_lib::InTextFile& parent) { - parent.temp_buf_n = 0; -} - -// --- algo_lib.InTextFile.temp_buf.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void algo_lib::temp_buf_RemoveLast(algo_lib::InTextFile& parent) { - u64 n = parent.temp_buf_n; - if (n > 0) { - n -= 1; - parent.temp_buf_n = n; - } -} - -// --- algo_lib.InTextFile.temp_buf.Print -// Convert temp_buf to a string. -// Array is printed as a regular string. -void algo_lib::temp_buf_Print(algo_lib::InTextFile& parent, algo::cstring &rhs) { - rhs << algo::memptr_ToStrptr(temp_buf_Getary(parent)); -} - -// --- algo_lib.InTextFile.temp_buf.ReadStrptrMaybe -// Read array from string -// Convert string to field. Return success value -bool algo_lib::temp_buf_ReadStrptrMaybe(algo_lib::InTextFile& parent, algo::strptr in_str) { - bool retval = true; - i32 newlen = i32_Min(in_str.n_elems, 8192); - memcpy(reinterpret_cast(parent.temp_buf_data), in_str.elems, newlen); - parent.temp_buf_n = newlen; - return retval; -} - -// --- algo_lib.InTextFile..Init -// Set all fields to initial values. -void algo_lib::InTextFile_Init(algo_lib::InTextFile& parent) { - parent.own_fd = bool(true); - parent.temp_buf_n = 0; // temp_buf: initialize count -} - -// --- algo_lib.InTextFile..Uninit -void algo_lib::InTextFile_Uninit(algo_lib::InTextFile& parent) { - algo_lib::InTextFile &row = parent; (void)row; - file_Cleanup(parent); // dmmeta.fcleanup:algo_lib.InTextFile.file - - // algo_lib.InTextFile.temp_buf.Uninit (Inlary) // - temp_buf_RemoveAll(parent); -} - -// --- algo_lib.Regx.state.Addary -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -algo::aryptr algo_lib::state_Addary(algo_lib::Regx& regx, algo::aryptr rhs) { - bool overlaps = rhs.n_elems>0 && rhs.elems >= regx.state_elems && rhs.elems < regx.state_elems + regx.state_max; - if (UNLIKELY(overlaps)) { - FatalErrorExit("algo_lib.tary_alias field:algo_lib.Regx.state comment:'alias error: sub-array is being appended to the whole'"); - } - int nnew = rhs.n_elems; - state_Reserve(regx, nnew); // reserve space - int at = regx.state_n; - for (int i = 0; i < nnew; i++) { - new (regx.state_elems + at + i) algo_lib::RegxState(rhs[i]); - regx.state_n++; - } - return algo::aryptr(regx.state_elems + at, nnew); -} - -// --- algo_lib.Regx.state.Alloc -// Reserve space. Insert element at the end -// The new element is initialized to a default value -algo_lib::RegxState& algo_lib::state_Alloc(algo_lib::Regx& regx) { - state_Reserve(regx, 1); - int n = regx.state_n; - int at = n; - algo_lib::RegxState *elems = regx.state_elems; - new (elems + at) algo_lib::RegxState(); // construct new element, default initializer - regx.state_n = n+1; - return elems[at]; -} - -// --- algo_lib.Regx.state.AllocAt -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -algo_lib::RegxState& algo_lib::state_AllocAt(algo_lib::Regx& regx, int at) { - state_Reserve(regx, 1); - int n = regx.state_n; - if (UNLIKELY(u64(at) >= u64(n+1))) { - FatalErrorExit("algo_lib.bad_alloc_at field:algo_lib.Regx.state comment:'index out of range'"); - } - algo_lib::RegxState *elems = regx.state_elems; - memmove(elems + at + 1, elems + at, (n - at) * sizeof(algo_lib::RegxState)); - new (elems + at) algo_lib::RegxState(); // construct element, default initializer - regx.state_n = n+1; - return elems[at]; -} - -// --- algo_lib.Regx.state.AllocN -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr algo_lib::state_AllocN(algo_lib::Regx& regx, int n_elems) { - state_Reserve(regx, n_elems); - int old_n = regx.state_n; - int new_n = old_n + n_elems; - algo_lib::RegxState *elems = regx.state_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) algo_lib::RegxState(); // construct new element, default initialize - } - regx.state_n = new_n; - return algo::aryptr(elems + old_n, n_elems); -} - -// --- algo_lib.Regx.state.Remove -// Remove item by index. If index outside of range, do nothing. -void algo_lib::state_Remove(algo_lib::Regx& regx, u32 i) { - u32 lim = regx.state_n; - algo_lib::RegxState *elems = regx.state_elems; - if (i < lim) { - elems[i].~RegxState(); // destroy element - memmove(elems + i, elems + (i + 1), sizeof(algo_lib::RegxState) * (lim - (i + 1))); - regx.state_n = lim - 1; +bool algo_lib::value_ReadStrptrMaybe(algo_lib::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); } + return retval; } -// --- algo_lib.Regx.state.RemoveAll -void algo_lib::state_RemoveAll(algo_lib::Regx& regx) { - u32 n = regx.state_n; - while (n > 0) { - n -= 1; - regx.state_elems[n].~RegxState(); - regx.state_n = n; - } +// --- algo_lib.FieldId..ReadStrptrMaybe +// Read fields of algo_lib::FieldId from an ascii string. +// The format of the string is the format of the algo_lib::FieldId's only field +bool algo_lib::FieldId_ReadStrptrMaybe(algo_lib::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; } -// --- algo_lib.Regx.state.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void algo_lib::state_RemoveLast(algo_lib::Regx& regx) { - u64 n = regx.state_n; - if (n > 0) { - n -= 1; - state_qFind(regx, u64(n)).~RegxState(); - regx.state_n = n; - } +// --- algo_lib.FieldId..Print +// print string representation of ROW to string STR +// cfmt:algo_lib.FieldId.String printfmt:Raw +void algo_lib::FieldId_Print(algo_lib::FieldId& row, algo::cstring& str) { + algo_lib::value_Print(row, str); } -// --- algo_lib.Regx.state.AbsReserve -// Make sure N elements fit in array. Process dies if out of memory -void algo_lib::state_AbsReserve(algo_lib::Regx& regx, int n) { - u32 old_max = regx.state_max; - if (n > i32(old_max)) { - u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); - void *new_mem = algo_lib::lpool_ReallocMem(regx.state_elems, old_max * sizeof(algo_lib::RegxState), new_max * sizeof(algo_lib::RegxState)); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("algo_lib.tary_nomem field:algo_lib.Regx.state comment:'out of memory'"); - } - regx.state_elems = (algo_lib::RegxState*)new_mem; - regx.state_max = new_max; +// --- algo_lib.InTextFile.temp_buf.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +u8& algo_lib::temp_buf_Alloc(algo_lib::InTextFile& parent) { + u8* row = temp_buf_AllocMaybe(parent); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("algo_lib.out_of_mem field:algo_lib.InTextFile.temp_buf comment:'Alloc failed'"); } + return *row; } -// --- algo_lib.Regx.state.Setary -// Copy contents of RHS to PARENT. -void algo_lib::state_Setary(algo_lib::Regx& regx, algo_lib::Regx &rhs) { - state_RemoveAll(regx); - int nnew = rhs.state_n; - state_Reserve(regx, nnew); // reserve space - for (int i = 0; i < nnew; i++) { // copy elements over - new (regx.state_elems + i) algo_lib::RegxState(state_qFind(rhs, i)); - regx.state_n = i + 1; +// --- algo_lib.InTextFile.temp_buf.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +u8* algo_lib::temp_buf_AllocMaybe(algo_lib::InTextFile& parent) { + u8 *row = (u8*)temp_buf_AllocMem(parent); + if (row) { + new (row) u8; // call constructor } + return row; } -// --- algo_lib.Regx.state.Setary2 -// Copy specified array into state, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -void algo_lib::state_Setary(algo_lib::Regx& regx, const algo::aryptr &rhs) { - state_RemoveAll(regx); - state_Addary(regx, rhs); +// --- algo_lib.InTextFile.temp_buf.RemoveAll +// Destroy all elements of Inlary +void algo_lib::temp_buf_RemoveAll(algo_lib::InTextFile& parent) { + parent.temp_buf_n = 0; } -// --- algo_lib.Regx.state.AllocNVal -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr algo_lib::state_AllocNVal(algo_lib::Regx& regx, int n_elems, const algo_lib::RegxState& val) { - state_Reserve(regx, n_elems); - int old_n = regx.state_n; - int new_n = old_n + n_elems; - algo_lib::RegxState *elems = regx.state_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) algo_lib::RegxState(val); +// --- algo_lib.InTextFile.temp_buf.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void algo_lib::temp_buf_RemoveLast(algo_lib::InTextFile& parent) { + u64 n = parent.temp_buf_n; + if (n > 0) { + n -= 1; + parent.temp_buf_n = n; } - regx.state_n = new_n; - return algo::aryptr(elems + old_n, n_elems); } -// --- algo_lib.Regx..Uninit -void algo_lib::Regx_Uninit(algo_lib::Regx& regx) { - algo_lib::Regx &row = regx; (void)row; +// --- algo_lib.InTextFile.temp_buf.Print +// Convert temp_buf to a string. +// Array is printed as a regular string. +void algo_lib::temp_buf_Print(algo_lib::InTextFile& parent, algo::cstring &rhs) { + rhs << algo::memptr_ToStrptr(temp_buf_Getary(parent)); +} - // algo_lib.Regx.state.Uninit (Tary) //Array of states - // remove all elements from algo_lib.Regx.state - state_RemoveAll(regx); - // free memory for Tary algo_lib.Regx.state - algo_lib::lpool_FreeMem(regx.state_elems, sizeof(algo_lib::RegxState)*regx.state_max); // (algo_lib.Regx.state) +// --- algo_lib.InTextFile.temp_buf.ReadStrptrMaybe +// Read array from string +// Convert string to field. Return success value +bool algo_lib::temp_buf_ReadStrptrMaybe(algo_lib::InTextFile& parent, algo::strptr in_str) { + bool retval = true; + i32 newlen = i32_Min(in_str.n_elems, 8192); + memcpy(reinterpret_cast(parent.temp_buf_data), in_str.elems, newlen); + parent.temp_buf_n = newlen; + return retval; } -// --- algo_lib.Regx..AssignOp -algo_lib::Regx& algo_lib::Regx::operator =(const algo_lib::Regx &rhs) { - expr = rhs.expr; - state_Setary(*this, state_Getary(const_cast(rhs))); - front = rhs.front; - next_front = rhs.next_front; - start = rhs.start; - accept = rhs.accept; - parseerror = rhs.parseerror; - accepts_all = rhs.accepts_all; - literal = rhs.literal; - return *this; +// --- algo_lib.InTextFile..Init +// Set all fields to initial values. +void algo_lib::InTextFile_Init(algo_lib::InTextFile& parent) { + parent.own_fd = bool(true); + parent.temp_buf_n = 0; // temp_buf: initialize count } -// --- algo_lib.Regx..CopyCtor - algo_lib::Regx::Regx(const algo_lib::Regx &rhs) - : expr(rhs.expr) - , front(rhs.front) - , next_front(rhs.next_front) - , start(rhs.start) - , accept(rhs.accept) - , parseerror(rhs.parseerror) - , accepts_all(rhs.accepts_all) - , literal(rhs.literal) - { - state_elems = 0; // (algo_lib.Regx.state) - state_n = 0; // (algo_lib.Regx.state) - state_max = 0; // (algo_lib.Regx.state) - state_Setary(*this, state_Getary(const_cast(rhs))); +// --- algo_lib.InTextFile..Uninit +void algo_lib::InTextFile_Uninit(algo_lib::InTextFile& parent) { + algo_lib::InTextFile &row = parent; (void)row; + file_Cleanup(parent); // dmmeta.fcleanup:algo_lib.InTextFile.file + + // algo_lib.InTextFile.temp_buf.Uninit (Inlary) // + temp_buf_RemoveAll(parent); } // --- algo_lib.RegxToken.type.ToCstr @@ -4299,8 +4819,10 @@ const char* algo_lib::type_ToCstr(const algo_lib::RegxToken& parent) { const char *ret = NULL; switch(type_GetEnum(parent)) { case algo_lib_RegxToken_type_expr : ret = "expr"; break; + case algo_lib_RegxToken_type_start : ret = "start"; break; case algo_lib_RegxToken_type_or : ret = "or"; break; case algo_lib_RegxToken_type_lparen: ret = "lparen"; break; + case algo_lib_RegxToken_type_rparen: ret = "rparen"; break; } return ret; } @@ -4340,11 +4862,22 @@ bool algo_lib::type_SetStrptrMaybe(algo_lib::RegxToken& parent, algo::strptr rhs } break; } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('s','t','a','r','t'): { + type_SetEnum(parent,algo_lib_RegxToken_type_start); ret = true; break; + } + } + break; + } case 6: { switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { case LE_STR6('l','p','a','r','e','n'): { type_SetEnum(parent,algo_lib_RegxToken_type_lparen); ret = true; break; } + case LE_STR6('r','p','a','r','e','n'): { + type_SetEnum(parent,algo_lib_RegxToken_type_rparen); ret = true; break; + } } break; } @@ -4386,25 +4919,185 @@ void algo_lib::RegxToken_Print(algo_lib::RegxToken& row, algo::cstring& str) { algo_lib::type_Print(row, str); } -// --- algo_lib.RegxExpr..ReadFieldMaybe -bool algo_lib::RegxExpr_ReadFieldMaybe(algo_lib::RegxExpr& parent, algo::strptr field, algo::strptr strval) { +// --- algo_lib.RegxExpr..ReadFieldMaybe +bool algo_lib::RegxExpr_ReadFieldMaybe(algo_lib::RegxExpr& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + algo_lib::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case algo_lib_FieldId_type: { + retval = algo_lib::RegxToken_ReadStrptrMaybe(parent.type, strval); + } break; + case algo_lib_FieldId_first: { + retval = i32_ReadStrptrMaybe(parent.first, strval); + } break; + case algo_lib_FieldId_last: { + retval = algo_lib::Bitset_ReadStrptrMaybe(parent.last, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- algo_lib.RegxExpr..ReadStrptrMaybe +// Read fields of algo_lib::RegxExpr from an ascii string. +// The format of the string is an ssim Tuple +bool algo_lib::RegxExpr_ReadStrptrMaybe(algo_lib::RegxExpr &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "algo_lib.RegxExpr"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && RegxExpr_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- algo_lib.RegxExpr..Print +// print string representation of ROW to string STR +// cfmt:algo_lib.RegxExpr.String printfmt:Tuple +void algo_lib::RegxExpr_Print(algo_lib::RegxExpr& row, algo::cstring& str) { + algo::tempstr temp; + str << "algo_lib.RegxExpr"; + + algo_lib::RegxToken_Print(row.type, temp); + PrintAttrSpaceReset(str,"type", temp); + + i32_Print(row.first, temp); + PrintAttrSpaceReset(str,"first", temp); + + algo_lib::Bitset_Print(row.last, temp); + PrintAttrSpaceReset(str,"last", temp); +} + +// --- algo_lib.RegxOp.op.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* algo_lib::op_ToCstr(const algo_lib::RegxOp& parent) { + const char *ret = NULL; + switch(op_GetEnum(parent)) { + case algo_lib_RegxOp_charrange : ret = "charrange"; break; + case algo_lib_RegxOp_char : ret = "char"; break; + case algo_lib_RegxOp_true : ret = "true"; break; + case algo_lib_RegxOp_stringbeg : ret = "stringbeg"; break; + case algo_lib_RegxOp_lparen : ret = "lparen"; break; + case algo_lib_RegxOp_rparen : ret = "rparen"; break; + case algo_lib_RegxOp_stringend : ret = "stringend"; break; + case algo_lib_RegxOp_accept : ret = "accept"; break; + case algo_lib_RegxOp_noop : ret = "noop"; break; + } + return ret; +} + +// --- algo_lib.RegxOp.op.Print +// Convert op to a string. First, attempt conversion to a known string. +// If no string matches, print op as a numeric value. +void algo_lib::op_Print(const algo_lib::RegxOp& parent, algo::cstring &lhs) { + const char *strval = op_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.op; + } +} + +// --- algo_lib.RegxOp.op.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool algo_lib::op_SetStrptrMaybe(algo_lib::RegxOp& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('c','h','a','r'): { + op_SetEnum(parent,algo_lib_RegxOp_char); ret = true; break; + } + case LE_STR4('n','o','o','p'): { + op_SetEnum(parent,algo_lib_RegxOp_noop); ret = true; break; + } + case LE_STR4('t','r','u','e'): { + op_SetEnum(parent,algo_lib_RegxOp_true); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('a','c','c','e','p','t'): { + op_SetEnum(parent,algo_lib_RegxOp_accept); ret = true; break; + } + case LE_STR6('l','p','a','r','e','n'): { + op_SetEnum(parent,algo_lib_RegxOp_lparen); ret = true; break; + } + case LE_STR6('r','p','a','r','e','n'): { + op_SetEnum(parent,algo_lib_RegxOp_rparen); ret = true; break; + } + } + break; + } + case 9: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','h','a','r','r','a','n','g'): { + if (memcmp(rhs.elems+8,"e",1)==0) { op_SetEnum(parent,algo_lib_RegxOp_charrange); ret = true; break; } + break; + } + case LE_STR8('s','t','r','i','n','g','b','e'): { + if (memcmp(rhs.elems+8,"g",1)==0) { op_SetEnum(parent,algo_lib_RegxOp_stringbeg); ret = true; break; } + break; + } + case LE_STR8('s','t','r','i','n','g','e','n'): { + if (memcmp(rhs.elems+8,"d",1)==0) { op_SetEnum(parent,algo_lib_RegxOp_stringend); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- algo_lib.RegxOp.op.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void algo_lib::op_SetStrptr(algo_lib::RegxOp& parent, algo::strptr rhs, algo_lib_RegxOpEnum dflt) { + if (!op_SetStrptrMaybe(parent,rhs)) op_SetEnum(parent,dflt); +} + +// --- algo_lib.RegxOp.op.ReadStrptrMaybe +// Convert string to field. Return success value +bool algo_lib::op_ReadStrptrMaybe(algo_lib::RegxOp& parent, algo::strptr rhs) { + bool retval = false; + retval = op_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.op,rhs); + } + return retval; +} + +// --- algo_lib.RegxOp..ReadFieldMaybe +bool algo_lib::RegxOp_ReadFieldMaybe(algo_lib::RegxOp& parent, algo::strptr field, algo::strptr strval) { bool retval = true; algo_lib::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case algo_lib_FieldId_type: { - retval = algo_lib::RegxToken_ReadStrptrMaybe(parent.type, strval); - break; - } - case algo_lib_FieldId_in: { - retval = i32_ReadStrptrMaybe(parent.in, strval); - break; - } - case algo_lib_FieldId_out: { - retval = algo_lib::Bitset_ReadStrptrMaybe(parent.out, strval); - break; - } - default: break; + case algo_lib_FieldId_op: { + retval = op_ReadStrptrMaybe(parent, strval); + } break; + case algo_lib_FieldId_consume: { + retval = u8_ReadStrptrMaybe(parent.consume, strval); + } break; + case algo_lib_FieldId_imm: { + retval = u16_ReadStrptrMaybe(parent.imm, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -4412,33 +5105,42 @@ bool algo_lib::RegxExpr_ReadFieldMaybe(algo_lib::RegxExpr& parent, algo::strptr return retval; } -// --- algo_lib.RegxExpr..ReadStrptrMaybe -// Read fields of algo_lib::RegxExpr from an ascii string. -// The format of the string is an ssim Tuple -bool algo_lib::RegxExpr_ReadStrptrMaybe(algo_lib::RegxExpr &parent, algo::strptr in_str) { +// --- algo_lib.RegxOp..ReadStrptrMaybe +// Read fields of algo_lib::RegxOp from an ascii string. +// The format of the string is a string with separated values +bool algo_lib::RegxOp_ReadStrptrMaybe(algo_lib::RegxOp &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "algo_lib.RegxExpr"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && RegxExpr_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; + algo::strptr value; + + algo::NextSep(in_str, ',', value); + retval = retval && op_ReadStrptrMaybe(parent, value); + + algo::NextSep(in_str, ',', value); + retval = retval && u8_ReadStrptrMaybe(parent.consume, value); + + value = in_str; + retval = retval && u16_ReadStrptrMaybe(parent.imm, value); return retval; } -// --- algo_lib.RegxExpr..Print +// --- algo_lib.RegxOp..Print // print string representation of ROW to string STR -// cfmt:algo_lib.RegxExpr.String printfmt:Tuple -void algo_lib::RegxExpr_Print(algo_lib::RegxExpr& row, algo::cstring& str) { - algo::tempstr temp; - str << "algo_lib.RegxExpr"; - - algo_lib::RegxToken_Print(row.type, temp); - PrintAttrSpaceReset(str,"type", temp); - - i32_Print(row.in, temp); - PrintAttrSpaceReset(str,"in", temp); +// cfmt:algo_lib.RegxOp.String printfmt:Sep +void algo_lib::RegxOp_Print(algo_lib::RegxOp& row, algo::cstring& str) { + algo_lib::op_Print(row, str); + str << ','; + u8_Print(row.consume, str); + str << ','; + u16_Print(row.imm, str); +} - algo_lib::Bitset_Print(row.out, temp); - PrintAttrSpaceReset(str,"out", temp); +// --- algo_lib.RegxOp..GetAnon +algo::strptr algo_lib::RegxOp_GetAnon(algo_lib::RegxOp &parent, i32 idx) { + (void)parent;//only to avoid -Wunused-parameter + switch(idx) { + case(0): return strptr("op", 2); + default: return algo::strptr(); + } } // --- algo_lib.RegxParse.ary_expr.Addary @@ -4503,6 +5205,25 @@ algo::aryptr algo_lib::ary_expr_AllocN(algo_lib::RegxParse& return algo::aryptr(elems + old_n, n_elems); } +// --- algo_lib.RegxParse.ary_expr.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo_lib::ary_expr_AllocNAt(algo_lib::RegxParse& regxparse, int n_elems, int at) { + ary_expr_Reserve(regxparse, n_elems); + int n = regxparse.ary_expr_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo_lib.bad_alloc_n_at field:algo_lib.RegxParse.ary_expr comment:'index out of range'"); + } + algo_lib::RegxExpr *elems = regxparse.ary_expr_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo_lib::RegxExpr)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo_lib::RegxExpr(); // construct new element, default initialize + } + regxparse.ary_expr_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo_lib.RegxParse.ary_expr.Remove // Remove item by index. If index outside of range, do nothing. void algo_lib::ary_expr_Remove(algo_lib::RegxParse& regxparse, u32 i) { @@ -4599,11 +5320,35 @@ bool algo_lib::ary_expr_ReadStrptrMaybe(algo_lib::RegxParse& regxparse, algo::st return retval; } +// --- algo_lib.RegxParse.ary_expr.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo_lib::ary_expr_Insary(algo_lib::RegxParse& regxparse, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= regxparse.ary_expr_elems && rhs.elems < regxparse.ary_expr_elems + regxparse.ary_expr_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo_lib.tary_alias field:algo_lib.RegxParse.ary_expr comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(regxparse.ary_expr_elems+1))) { + FatalErrorExit("algo_lib.bad_insary field:algo_lib.RegxParse.ary_expr comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = regxparse.ary_expr_n - at; + ary_expr_Reserve(regxparse, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (regxparse.ary_expr_elems + at + nnew + i) algo_lib::RegxExpr(regxparse.ary_expr_elems[at + i]); + regxparse.ary_expr_elems[at + i].~RegxExpr(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (regxparse.ary_expr_elems + at + i) algo_lib::RegxExpr(rhs[i]); + } + regxparse.ary_expr_n += nnew; +} + // --- algo_lib.RegxParse..Uninit void algo_lib::RegxParse_Uninit(algo_lib::RegxParse& regxparse) { algo_lib::RegxParse &row = regxparse; (void)row; - // algo_lib.RegxParse.ary_expr.Uninit (Tary) //Output expression array + // algo_lib.RegxParse.ary_expr.Uninit (Tary) //Expression stack // remove all elements from algo_lib.RegxParse.ary_expr ary_expr_RemoveAll(regxparse); // free memory for Tary algo_lib.RegxParse.ary_expr @@ -4620,6 +5365,9 @@ void algo_lib::RegxParse_Print(algo_lib::RegxParse& row, algo::cstring& str) { algo::strptr_Print(row.input, temp); PrintAttrSpaceReset(str,"input", temp); + i32_Print(row.nextgroup, temp); + PrintAttrSpaceReset(str,"nextgroup", temp); + ind_beg(regxparse_ary_expr_curs,ary_expr,row) { algo_lib::RegxExpr_Print(ary_expr, temp); tempstr name; @@ -4632,6 +5380,7 @@ void algo_lib::RegxParse_Print(algo_lib::RegxParse& row, algo::cstring& str) { // --- algo_lib.RegxParse..AssignOp algo_lib::RegxParse& algo_lib::RegxParse::operator =(const algo_lib::RegxParse &rhs) { input = rhs.input; + nextgroup = rhs.nextgroup; p_regx = rhs.p_regx; ary_expr_Setary(*this, ary_expr_Getary(const_cast(rhs))); return *this; @@ -4640,6 +5389,7 @@ algo_lib::RegxParse& algo_lib::RegxParse::operator =(const algo_lib::RegxParse & // --- algo_lib.RegxParse..CopyCtor algo_lib::RegxParse::RegxParse(const algo_lib::RegxParse &rhs) : input(rhs.input) + , nextgroup(rhs.nextgroup) , p_regx(rhs.p_regx) { ary_expr_elems = 0; // (algo_lib.RegxParse.ary_expr) @@ -4648,337 +5398,6 @@ algo_lib::RegxParse& algo_lib::RegxParse::operator =(const algo_lib::RegxParse & ary_expr_Setary(*this, ary_expr_Getary(const_cast(rhs))); } -// --- algo_lib.RegxState.ch_class.Addary -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -algo::aryptr algo_lib::ch_class_Addary(algo_lib::RegxState& parent, algo::aryptr rhs) { - bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ch_class_elems && rhs.elems < parent.ch_class_elems + parent.ch_class_max; - if (UNLIKELY(overlaps)) { - FatalErrorExit("algo_lib.tary_alias field:algo_lib.RegxState.ch_class comment:'alias error: sub-array is being appended to the whole'"); - } - int nnew = rhs.n_elems; - ch_class_Reserve(parent, nnew); // reserve space - int at = parent.ch_class_n; - for (int i = 0; i < nnew; i++) { - new (parent.ch_class_elems + at + i) algo::i32_Range(rhs[i]); - parent.ch_class_n++; - } - return algo::aryptr(parent.ch_class_elems + at, nnew); -} - -// --- algo_lib.RegxState.ch_class.Alloc -// Reserve space. Insert element at the end -// The new element is initialized to a default value -algo::i32_Range& algo_lib::ch_class_Alloc(algo_lib::RegxState& parent) { - ch_class_Reserve(parent, 1); - int n = parent.ch_class_n; - int at = n; - algo::i32_Range *elems = parent.ch_class_elems; - new (elems + at) algo::i32_Range(); // construct new element, default initializer - parent.ch_class_n = n+1; - return elems[at]; -} - -// --- algo_lib.RegxState.ch_class.AllocAt -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -algo::i32_Range& algo_lib::ch_class_AllocAt(algo_lib::RegxState& parent, int at) { - ch_class_Reserve(parent, 1); - int n = parent.ch_class_n; - if (UNLIKELY(u64(at) >= u64(n+1))) { - FatalErrorExit("algo_lib.bad_alloc_at field:algo_lib.RegxState.ch_class comment:'index out of range'"); - } - algo::i32_Range *elems = parent.ch_class_elems; - memmove(elems + at + 1, elems + at, (n - at) * sizeof(algo::i32_Range)); - new (elems + at) algo::i32_Range(); // construct element, default initializer - parent.ch_class_n = n+1; - return elems[at]; -} - -// --- algo_lib.RegxState.ch_class.AllocN -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr algo_lib::ch_class_AllocN(algo_lib::RegxState& parent, int n_elems) { - ch_class_Reserve(parent, n_elems); - int old_n = parent.ch_class_n; - int new_n = old_n + n_elems; - algo::i32_Range *elems = parent.ch_class_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) algo::i32_Range(); // construct new element, default initialize - } - parent.ch_class_n = new_n; - return algo::aryptr(elems + old_n, n_elems); -} - -// --- algo_lib.RegxState.ch_class.Remove -// Remove item by index. If index outside of range, do nothing. -void algo_lib::ch_class_Remove(algo_lib::RegxState& parent, u32 i) { - u32 lim = parent.ch_class_n; - algo::i32_Range *elems = parent.ch_class_elems; - if (i < lim) { - memmove(elems + i, elems + (i + 1), sizeof(algo::i32_Range) * (lim - (i + 1))); - parent.ch_class_n = lim - 1; - } -} - -// --- algo_lib.RegxState.ch_class.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void algo_lib::ch_class_RemoveLast(algo_lib::RegxState& parent) { - u64 n = parent.ch_class_n; - if (n > 0) { - n -= 1; - parent.ch_class_n = n; - } -} - -// --- algo_lib.RegxState.ch_class.AbsReserve -// Make sure N elements fit in array. Process dies if out of memory -void algo_lib::ch_class_AbsReserve(algo_lib::RegxState& parent, int n) { - u32 old_max = parent.ch_class_max; - if (n > i32(old_max)) { - u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); - void *new_mem = algo_lib::lpool_ReallocMem(parent.ch_class_elems, old_max * sizeof(algo::i32_Range), new_max * sizeof(algo::i32_Range)); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("algo_lib.tary_nomem field:algo_lib.RegxState.ch_class comment:'out of memory'"); - } - parent.ch_class_elems = (algo::i32_Range*)new_mem; - parent.ch_class_max = new_max; - } -} - -// --- algo_lib.RegxState.ch_class.Setary -// Copy contents of RHS to PARENT. -void algo_lib::ch_class_Setary(algo_lib::RegxState& parent, algo_lib::RegxState &rhs) { - ch_class_RemoveAll(parent); - int nnew = rhs.ch_class_n; - ch_class_Reserve(parent, nnew); // reserve space - for (int i = 0; i < nnew; i++) { // copy elements over - new (parent.ch_class_elems + i) algo::i32_Range(ch_class_qFind(rhs, i)); - parent.ch_class_n = i + 1; - } -} - -// --- algo_lib.RegxState.ch_class.Setary2 -// Copy specified array into ch_class, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -void algo_lib::ch_class_Setary(algo_lib::RegxState& parent, const algo::aryptr &rhs) { - ch_class_RemoveAll(parent); - ch_class_Addary(parent, rhs); -} - -// --- algo_lib.RegxState.ch_class.AllocNVal -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr algo_lib::ch_class_AllocNVal(algo_lib::RegxState& parent, int n_elems, const algo::i32_Range& val) { - ch_class_Reserve(parent, n_elems); - int old_n = parent.ch_class_n; - int new_n = old_n + n_elems; - algo::i32_Range *elems = parent.ch_class_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) algo::i32_Range(val); - } - parent.ch_class_n = new_n; - return algo::aryptr(elems + old_n, n_elems); -} - -// --- algo_lib.RegxState.ch_class.Swap -// Swap values elem_a and elem_b -inline static void algo_lib::ch_class_Swap(algo::i32_Range &elem_a, algo::i32_Range &elem_b) { - u8 temp[sizeof(algo::i32_Range)]; - memcpy(&temp , &elem_a, sizeof(algo::i32_Range)); - memcpy(&elem_a, &elem_b, sizeof(algo::i32_Range)); - memcpy(&elem_b, &temp , sizeof(algo::i32_Range)); -} - -// --- algo_lib.RegxState.ch_class.Rotleft -// Left circular shift of three-tuple -inline static void algo_lib::ch_class_Rotleft(algo::i32_Range &elem_a, algo::i32_Range &elem_b, algo::i32_Range &elem_c) { - u8 temp[sizeof(algo::i32_Range)]; - memcpy(&temp, &elem_a , sizeof(algo::i32_Range)); - memcpy(&elem_a , &elem_b , sizeof(algo::i32_Range)); - memcpy(&elem_b , &elem_c , sizeof(algo::i32_Range)); - memcpy(&elem_c , &temp, sizeof(algo::i32_Range)); -} - -// --- algo_lib.RegxState.ch_class.Lt -// Compare values elem_a and elem_b -// The comparison function must be anti-symmetric: if a>b, then !(b>a). -// If not, mayhem results. -static bool algo_lib::ch_class_Lt(algo::i32_Range &elem_a, algo::i32_Range &elem_b) { - bool ret; - ret = elem_a.beg < elem_b.beg; - return ret; -} - -// --- algo_lib.RegxState.ch_class.SortedQ -// Verify whether array is sorted -bool algo_lib::ch_class_SortedQ(algo_lib::RegxState& parent) { - algo::i32_Range *elems = ch_class_Getary(parent).elems; - int n = ch_class_N(parent); - for (int i = 1; i < n; i++) { - if (ch_class_Lt(elems[i], elems[i-1])) { - return false; - } - } - return true; -} - -// --- algo_lib.RegxState.ch_class.IntInsertionSort -// Internal insertion sort -static void algo_lib::ch_class_IntInsertionSort(algo::i32_Range *elems, int n) { - for (int i = 1; i < n; ++i) { - int j = i; - // find the spot for ith element. - while (j>0 && ch_class_Lt(elems[i], elems[j-1])) { - j--; - } - if (j=0; i--) { - int k = 0; - int l = 1; - while (l16) { - // detect degenerate case and revert to heap sort - if (depth==0) { - ch_class_IntHeapSort(elems,n); - return; - } - // elements to sort initially to determine pivot. - // choose pp=n/2 in case the input is already sorted. - int pi = 0; - int pp = n/2; - int pj = n-1; - // insertion sort for 1st, middle and last element - if (ch_class_Lt(elems[pp], elems[pi])) { - ch_class_Swap(elems[pi], elems[pp]); - } - if (ch_class_Lt(elems[pj], elems[pp])) { - if (ch_class_Lt(elems[pj], elems[pi])) { - ch_class_Rotleft(elems[pi], elems[pj], elems[pp]); - } else { - ch_class_Swap(elems[pj], elems[pp]); - } - } - // deposit pivot near the end of the array and skip it. - ch_class_Swap(elems[--pj], elems[pp]); - // reference to pivot - algo::i32_Range &pivot = elems[pj]; - for(;;){ - while (ch_class_Lt(elems[++pi], pivot)) { - } - while (ch_class_Lt(pivot, elems[--pj])) { - } - if (pj <= pi) { - break; - } - ch_class_Swap(elems[pi],elems[pj]); - } - depth -= 1; - ch_class_IntQuickSort(elems, pi, depth); - elems += pi; - n -= pi; - } - // sort the remainder of this section - ch_class_IntInsertionSort(elems,n); -} - -// --- algo_lib.RegxState.ch_class.InsertionSort -// Insertion sort -void algo_lib::ch_class_InsertionSort(algo_lib::RegxState& parent) { - algo::i32_Range *elems = ch_class_Getary(parent).elems; - int n = ch_class_N(parent); - ch_class_IntInsertionSort(elems, n); -} - -// --- algo_lib.RegxState.ch_class.HeapSort -// Heap sort -void algo_lib::ch_class_HeapSort(algo_lib::RegxState& parent) { - algo::i32_Range *elems = ch_class_Getary(parent).elems; - int n = ch_class_N(parent); - ch_class_IntHeapSort(elems, n); -} - -// --- algo_lib.RegxState.ch_class.QuickSort -// Quick sort -void algo_lib::ch_class_QuickSort(algo_lib::RegxState& parent) { - // compute max recursion depth based on number of elements in the array - int max_depth = algo::CeilingLog2(u32(ch_class_N(parent) + 1)) + 3; - algo::i32_Range *elems = ch_class_Getary(parent).elems; - int n = ch_class_N(parent); - ch_class_IntQuickSort(elems, n, max_depth); -} - -// --- algo_lib.RegxState..Uninit -void algo_lib::RegxState_Uninit(algo_lib::RegxState& parent) { - algo_lib::RegxState &row = parent; (void)row; - - // algo_lib.RegxState.ch_class.Uninit (Tary) //What to match - // remove all elements from algo_lib.RegxState.ch_class - ch_class_RemoveAll(parent); - // free memory for Tary algo_lib.RegxState.ch_class - algo_lib::lpool_FreeMem(parent.ch_class_elems, sizeof(algo::i32_Range)*parent.ch_class_max); // (algo_lib.RegxState.ch_class) -} - -// --- algo_lib.RegxState..AssignOp -algo_lib::RegxState& algo_lib::RegxState::operator =(const algo_lib::RegxState &rhs) { - ch_class_Setary(*this, ch_class_Getary(const_cast(rhs))); - out = rhs.out; - accept_all = rhs.accept_all; - return *this; -} - -// --- algo_lib.RegxState..CopyCtor - algo_lib::RegxState::RegxState(const algo_lib::RegxState &rhs) - : out(rhs.out) - , accept_all(rhs.accept_all) - { - ch_class_elems = 0; // (algo_lib.RegxState.ch_class) - ch_class_n = 0; // (algo_lib.RegxState.ch_class) - ch_class_max = 0; // (algo_lib.RegxState.ch_class) - ch_class_Setary(*this, ch_class_Getary(const_cast(rhs))); -} - // --- algo_lib.Replscope.ind_replvar.Cascdel // Delete all rows reachable through the hash index void algo_lib::ind_replvar_Cascdel(algo_lib::Replscope& replscope) { @@ -4986,7 +5405,7 @@ void algo_lib::ind_replvar_Cascdel(algo_lib::Replscope& replscope) { for (int i = 0; i < replscope.ind_replvar_buckets_n; i++) { algo_lib::FReplvar *elem = replscope.ind_replvar_buckets_elems[i]; while (elem) { - algo_lib::FReplvar *next = elem->ind_replvar_next; + algo_lib::FReplvar *next = elem->replscope_ind_replvar_next; replvar_Delete(*elem); elem = next; } @@ -4998,24 +5417,20 @@ void algo_lib::ind_replvar_Cascdel(algo_lib::Replscope& replscope) { // Find row by key. Return NULL if not found. algo_lib::FReplvar* algo_lib::ind_replvar_Find(algo_lib::Replscope& replscope, const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (replscope.ind_replvar_buckets_n - 1); - algo_lib::FReplvar* *e = &replscope.ind_replvar_buckets_elems[index]; - algo_lib::FReplvar* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).key == key; - if (done) break; - e = &ret->ind_replvar_next; - } while (true); + algo_lib::FReplvar *ret = replscope.ind_replvar_buckets_elems[index]; + for (; ret && !((*ret).key == key); ret = ret->replscope_ind_replvar_next) { + } return ret; } // --- algo_lib.Replscope.ind_replvar.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool algo_lib::ind_replvar_InsertMaybe(algo_lib::Replscope& replscope, algo_lib::FReplvar& row) { - ind_replvar_Reserve(replscope, 1); bool retval = true; // if already in hash, InsertMaybe returns true - if (LIKELY(row.ind_replvar_next == (algo_lib::FReplvar*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.key) & (replscope.ind_replvar_buckets_n - 1); + if (LIKELY(row.replscope_ind_replvar_next == (algo_lib::FReplvar*)-1)) {// check if in hash already + row.replscope_ind_replvar_hashval = algo::cstring_Hash(0, row.key); + ind_replvar_Reserve(replscope, 1); + u32 index = row.replscope_ind_replvar_hashval & (replscope.ind_replvar_buckets_n - 1); algo_lib::FReplvar* *prev = &replscope.ind_replvar_buckets_elems[index]; do { algo_lib::FReplvar* ret = *prev; @@ -5026,10 +5441,10 @@ bool algo_lib::ind_replvar_InsertMaybe(algo_lib::Replscope& replscope, algo_lib: retval = false; break; } - prev = &ret->ind_replvar_next; + prev = &ret->replscope_ind_replvar_next; } while (true); if (retval) { - row.ind_replvar_next = *prev; + row.replscope_ind_replvar_next = *prev; replscope.ind_replvar_n++; *prev = &row; } @@ -5040,17 +5455,17 @@ bool algo_lib::ind_replvar_InsertMaybe(algo_lib::Replscope& replscope, algo_lib: // --- algo_lib.Replscope.ind_replvar.Remove // Remove reference to element from hash index. If element is not in hash, do nothing void algo_lib::ind_replvar_Remove(algo_lib::Replscope& replscope, algo_lib::FReplvar& row) { - if (LIKELY(row.ind_replvar_next != (algo_lib::FReplvar*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.key) & (replscope.ind_replvar_buckets_n - 1); + if (LIKELY(row.replscope_ind_replvar_next != (algo_lib::FReplvar*)-1)) {// check if in hash already + u32 index = row.replscope_ind_replvar_hashval & (replscope.ind_replvar_buckets_n - 1); algo_lib::FReplvar* *prev = &replscope.ind_replvar_buckets_elems[index]; // addr of pointer to current element while (algo_lib::FReplvar *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_replvar_next; // unlink (singly linked list) + *prev = next->replscope_ind_replvar_next; // unlink (singly linked list) replscope.ind_replvar_n--; - row.ind_replvar_next = (algo_lib::FReplvar*)-1;// not-in-hash + row.replscope_ind_replvar_next = (algo_lib::FReplvar*)-1;// not-in-hash break; } - prev = &next->ind_replvar_next; + prev = &next->replscope_ind_replvar_next; } } } @@ -5058,8 +5473,14 @@ void algo_lib::ind_replvar_Remove(algo_lib::Replscope& replscope, algo_lib::FRep // --- algo_lib.Replscope.ind_replvar.Reserve // Reserve enough room in the hash for N more elements. Return success code. void algo_lib::ind_replvar_Reserve(algo_lib::Replscope& replscope, int n) { + ind_replvar_AbsReserve(replscope,replscope.ind_replvar_n + n); +} + +// --- algo_lib.Replscope.ind_replvar.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void algo_lib::ind_replvar_AbsReserve(algo_lib::Replscope& replscope, int n) { u32 old_nbuckets = replscope.ind_replvar_buckets_n; - u32 new_nelems = replscope.ind_replvar_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -5077,9 +5498,9 @@ void algo_lib::ind_replvar_Reserve(algo_lib::Replscope& replscope, int n) { algo_lib::FReplvar* elem = replscope.ind_replvar_buckets_elems[i]; while (elem) { algo_lib::FReplvar &row = *elem; - algo_lib::FReplvar* next = row.ind_replvar_next; - u32 index = algo::cstring_Hash(0, row.key) & (new_nbuckets-1); - row.ind_replvar_next = new_buckets[index]; + algo_lib::FReplvar* next = row.replscope_ind_replvar_next; + u32 index = row.replscope_ind_replvar_hashval & (new_nbuckets-1); + row.replscope_ind_replvar_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } @@ -5107,7 +5528,7 @@ void algo_lib::replscope_ind_replvar_curs_Reset(replscope_ind_replvar_curs &curs // Set all fields to initial values. void algo_lib::Replscope_Init(algo_lib::Replscope& replscope) { replscope.eatcomma = bool(true); - replscope.fatal = bool(false); + replscope.strict = u8(0); // initialize hash table for algo_lib::FReplvar; replscope.ind_replvar_n = 0; // (algo_lib.Replscope.ind_replvar) replscope.ind_replvar_buckets_n = 4; // (algo_lib.Replscope.ind_replvar) @@ -5122,7 +5543,6 @@ void algo_lib::Replscope_Init(algo_lib::Replscope& replscope) { void algo_lib::Replscope_Uninit(algo_lib::Replscope& replscope) { algo_lib::Replscope &row = replscope; (void)row; ind_replvar_Cascdel(replscope); // dmmeta.cascdel:algo_lib.Replscope.ind_replvar - ind_replvar_Cleanup(replscope); // dmmeta.fcleanup:algo_lib.Replscope.ind_replvar // algo_lib.Replscope.ind_replvar.Uninit (Thash) // algo_lib::lpool_FreeMem(replscope.ind_replvar_buckets_elems, sizeof(algo_lib::FReplvar*)*replscope.ind_replvar_buckets_n); // (algo_lib.Replscope.ind_replvar) @@ -5138,8 +5558,8 @@ void algo_lib::Replscope_Print(algo_lib::Replscope& row, algo::cstring& str) { bool_Print(row.eatcomma, temp); PrintAttrSpaceReset(str,"eatcomma", temp); - bool_Print(row.fatal, temp); - PrintAttrSpaceReset(str,"fatal", temp); + u8_Print(row.strict, temp); + PrintAttrSpaceReset(str,"strict", temp); } // --- algo_lib.TableId.value.ToCstr @@ -5283,6 +5703,25 @@ algo::aryptr algo_lib::width_AllocN(algo_lib::Tabulate& tabulate, int n_ele return algo::aryptr(elems + old_n, n_elems); } +// --- algo_lib.Tabulate.width.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr algo_lib::width_AllocNAt(algo_lib::Tabulate& tabulate, int n_elems, int at) { + width_Reserve(tabulate, n_elems); + int n = tabulate.width_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("algo_lib.bad_alloc_n_at field:algo_lib.Tabulate.width comment:'index out of range'"); + } + i32 *elems = tabulate.width_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(i32)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) i32(0); // construct new element, default initialize + } + tabulate.width_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- algo_lib.Tabulate.width.Remove // Remove item by index. If index outside of range, do nothing. void algo_lib::width_Remove(algo_lib::Tabulate& tabulate, u32 i) { @@ -5367,6 +5806,25 @@ bool algo_lib::width_ReadStrptrMaybe(algo_lib::Tabulate& tabulate, algo::strptr return retval; } +// --- algo_lib.Tabulate.width.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void algo_lib::width_Insary(algo_lib::Tabulate& tabulate, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= tabulate.width_elems && rhs.elems < tabulate.width_elems + tabulate.width_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("algo_lib.tary_alias field:algo_lib.Tabulate.width comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(tabulate.width_elems+1))) { + FatalErrorExit("algo_lib.bad_insary field:algo_lib.Tabulate.width comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = tabulate.width_n - at; + width_Reserve(tabulate, nnew); // reserve space + memmove(tabulate.width_elems + at + nnew, tabulate.width_elems + at, nmove * sizeof(i32)); + memcpy(tabulate.width_elems + at, rhs.elems, nnew * sizeof(i32)); + tabulate.width_n += nnew; +} + // --- algo_lib.Tabulate..Uninit void algo_lib::Tabulate_Uninit(algo_lib::Tabulate& tabulate) { algo_lib::Tabulate &row = tabulate; (void)row; @@ -5421,8 +5879,12 @@ inline static void algo_lib::SizeCheck() { // --- algo_lib...StaticCheck void algo_lib::StaticCheck() { algo_assert(sizeof(algo_lib::_db_h_fatalerror_hook) == 8); // csize:algo_lib._db_h_fatalerror_hook + algo_assert(sizeof(algo_lib::errns_decode_hook) == 8); // csize:algo_lib.errns_decode_hook algo_assert(sizeof(algo_lib::iohook_callback_hook) == 8); // csize:algo_lib.iohook_callback_hook algo_assert(sizeof(algo_lib::timehook_hook_hook) == 8); // csize:algo_lib.timehook_hook_hook + // check that bitfield fits width + algo_assert(sizeof(((algo_lib::RegxFlags*)0)->value)*8 >= 6); + algo_assert(_offset_of(algo_lib::RegxFlags, value) + sizeof(((algo_lib::RegxFlags*)0)->value) == sizeof(algo_lib::RegxFlags)); algo_assert(_offset_of(algo_lib::trace, del__db_malloc) + sizeof(((algo_lib::trace*)0)->del__db_malloc) == sizeof(algo_lib::trace)); algo_assert(_offset_of(algo_lib::FieldId, value) + sizeof(((algo_lib::FieldId*)0)->value) == sizeof(algo_lib::FieldId)); } diff --git a/cpp/gen/amc_gc_gen.cpp b/cpp/gen/amc_gc_gen.cpp index a8ee3dd1..6995d36c 100644 --- a/cpp/gen/amc_gc_gen.cpp +++ b/cpp/gen/amc_gc_gen.cpp @@ -29,12 +29,15 @@ #include "include/gen/command_gen.inl.h" #include "include/gen/algo_gen.h" #include "include/gen/algo_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep amc_gc::FDb amc_gc::_db; // dependency found via dev.targdep @@ -47,8 +50,8 @@ const char *amc_gc_help = " -key regx \"\" ACR query selecting records to eliminate, e.g. dmmeta.ctype:amc.%\n" " -include Garbage collect includes for specified target\n" " -in string \"data\" Input directory or filename, - for stdin\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -148,9 +151,8 @@ void amc_gc::ReadArgv() { } if (ch_N(attrname) == 0) { err << "amc_gc: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:amc_gc.FDb.cmdline @@ -204,7 +209,7 @@ void amc_gc::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -271,8 +276,8 @@ bool amc_gc::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && amc_gc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -452,11 +457,13 @@ void amc_gc::StaticCheck() { // --- amc_gc...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); amc_gc::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock amc_gc::ReadArgv(); // dmmeta.main:amc_gc amc_gc::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -469,6 +476,7 @@ int main(int argc, char **argv) { try { amc_gc::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/amc_gen.cpp b/cpp/gen/amc_gen.cpp index e7a70e24..c08edae9 100644 --- a/cpp/gen/amc_gen.cpp +++ b/cpp/gen/amc_gen.cpp @@ -39,12 +39,15 @@ #include "include/gen/algo_lib_gen.inl.h" #include "include/gen/dev_gen.h" #include "include/gen/dev_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/lib_amcdb_gen.h" #include "include/gen/lib_amcdb_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep amc::FDb amc::_db; // dependency found via dev.targdep @@ -52,19 +55,20 @@ namespace amc { const char *amc_help = "amc: Algo Model Compiler: generate code under include/gen and cpp/gen\n" "Usage: amc [[-query:]] [options]\n" -" OPTION TYPE DFLT COMMENT\n" -" -in_dir string \"data\" Root of input ssim dir\n" -" [query] string \"\" Query mode: generate code for specified object\n" -" -out_dir string \".\" Root of output cpp dir\n" -" -proto Print prototype\n" -" -report Y Final report\n" -" -e Open matching records in editor\n" -" -trace regx \"\" Regx of something to trace code generation\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" -" -help Print help and exit; alias -h\n" -" -version Print version and exit\n" -" -signature Show signatures and exit; alias -sig\n" +" OPTION TYPE DFLT COMMENT\n" +" -in_dir string \"data\" Root of input ssim dir\n" +" [query] string \"\" Query mode: generate code for specified object\n" +" -out_dir string \".\" Root of output cpp dir\n" +" -proto Print prototype\n" +" -showcomment Y Show generated comments\n" +" -report Y Final report\n" +" -e Open matching records in editor\n" +" -trace regx \"\" Regx of something to trace code generation\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" +" -help Print help and exit; alias -h\n" +" -version Print version and exit\n" +" -signature Show signatures and exit; alias -sig\n" ; @@ -93,6 +97,19 @@ namespace amc { // gen:ns_gsymbol namespace amc { // gen:ns_gsymbol const algo::strptr dev_gitfile_conf_copyright_txt("conf/copyright.txt"); } // gen:ns_gsymbol +namespace amc { // gen:ns_gsymbol + const char* dmmeta_fbufiotype_nofd("nofd"); + const char* dmmeta_fbufiotype_openssl("openssl"); + const char* dmmeta_fbufiotype_standard("standard"); +} // gen:ns_gsymbol +namespace amc { // gen:ns_gsymbol + const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_common("common"); + const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_data("data"); + const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_field("field"); + const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_header("header"); + const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_request("request"); + const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_response("response"); +} // gen:ns_gsymbol namespace amc { // gen:ns_print_proto // Extract next character from STR and advance IDX // func:amc.Enumstr.str.Nextchar @@ -280,26 +297,6 @@ namespace amc { // gen:ns_print_proto static bool fdelay_InputMaybe(dmmeta::Fdelay &elem) __attribute__((nothrow)); // func:amc.FDb.disptrace.InputMaybe static bool disptrace_InputMaybe(dmmeta::Disptrace &elem) __attribute__((nothrow)); - // Swap values elem_a and elem_b - // func:amc.FDb.c_dispsig_sorted.Swap - inline static void c_dispsig_sorted_Swap(amc::FDispsig* &elem_a, amc::FDispsig* &elem_b) __attribute__((nothrow)); - // Left circular shift of three-tuple - // func:amc.FDb.c_dispsig_sorted.Rotleft - inline static void c_dispsig_sorted_Rotleft(amc::FDispsig* &elem_a, amc::FDispsig* &elem_b, amc::FDispsig* &elem_c) __attribute__((nothrow)); - // Compare values elem_a and elem_b - // The comparison function must be anti-symmetric: if a>b, then !(b>a). - // If not, mayhem results. - // func:amc.FDb.c_dispsig_sorted.Lt - static bool c_dispsig_sorted_Lt(amc::FDispsig &elem_a, amc::FDispsig &elem_b) __attribute__((nothrow)); - // Internal insertion sort - // func:amc.FDb.c_dispsig_sorted.IntInsertionSort - static void c_dispsig_sorted_IntInsertionSort(amc::FDispsig* *elems, int n) __attribute__((nothrow)); - // Internal heap sort - // func:amc.FDb.c_dispsig_sorted.IntHeapSort - static void c_dispsig_sorted_IntHeapSort(amc::FDispsig* *elems, int n) __attribute__((nothrow)); - // Quick sort engine - // func:amc.FDb.c_dispsig_sorted.IntQuickSort - static void c_dispsig_sorted_IntQuickSort(amc::FDispsig* *elems, int n, int depth) __attribute__((nothrow)); // func:amc.FDb.target.InputMaybe static bool target_InputMaybe(dev::Target &elem) __attribute__((nothrow)); // func:amc.FDb.targdep.InputMaybe @@ -378,26 +375,6 @@ namespace amc { // gen:ns_print_proto // Quick sort engine // func:amc.FDb.c_substr_field.IntQuickSort static void c_substr_field_IntQuickSort(amc::FSubstr* *elems, int n, int depth) __attribute__((nothrow)); - // Swap values elem_a and elem_b - // func:amc.FDb.c_ctypelen.Swap - inline static void c_ctypelen_Swap(amc::FCtypelen* &elem_a, amc::FCtypelen* &elem_b) __attribute__((nothrow)); - // Left circular shift of three-tuple - // func:amc.FDb.c_ctypelen.Rotleft - inline static void c_ctypelen_Rotleft(amc::FCtypelen* &elem_a, amc::FCtypelen* &elem_b, amc::FCtypelen* &elem_c) __attribute__((nothrow)); - // Compare values elem_a and elem_b - // The comparison function must be anti-symmetric: if a>b, then !(b>a). - // If not, mayhem results. - // func:amc.FDb.c_ctypelen.Lt - static bool c_ctypelen_Lt(amc::FCtypelen &elem_a, amc::FCtypelen &elem_b) __attribute__((nothrow)); - // Internal insertion sort - // func:amc.FDb.c_ctypelen.IntInsertionSort - static void c_ctypelen_IntInsertionSort(amc::FCtypelen* *elems, int n) __attribute__((nothrow)); - // Internal heap sort - // func:amc.FDb.c_ctypelen.IntHeapSort - static void c_ctypelen_IntHeapSort(amc::FCtypelen* *elems, int n) __attribute__((nothrow)); - // Quick sort engine - // func:amc.FDb.c_ctypelen.IntQuickSort - static void c_ctypelen_IntQuickSort(amc::FCtypelen* *elems, int n, int depth) __attribute__((nothrow)); // func:amc.FDb.fbase.InputMaybe static bool fbase_InputMaybe(dmmeta::Fbase &elem) __attribute__((nothrow)); // func:amc.FDb.nossimfile.InputMaybe @@ -440,6 +417,16 @@ namespace amc { // gen:ns_print_proto static bool ssimsort_InputMaybe(dmmeta::Ssimsort &elem) __attribute__((nothrow)); // func:amc.FDb.fbuftype.InputMaybe static bool fbuftype_InputMaybe(dmmeta::Fbuftype &elem) __attribute__((nothrow)); + // func:amc.FDb.nsjs.InputMaybe + static bool nsjs_InputMaybe(dmmeta::Nsjs &elem) __attribute__((nothrow)); + // func:amc.FDb.jstype.InputMaybe + static bool jstype_InputMaybe(dmmeta::Jstype &elem) __attribute__((nothrow)); + // func:amc.FDb.ckafka.InputMaybe + static bool ckafka_InputMaybe(dmmeta::Ckafka &elem) __attribute__((nothrow)); + // func:amc.FDb.fkafka.InputMaybe + static bool fkafka_InputMaybe(dmmeta::Fkafka &elem) __attribute__((nothrow)); + // func:amc.FDb.steptype.InputMaybe + static bool steptype_InputMaybe(dmmeta::Steptype &elem) __attribute__((nothrow)); // find trace by row id (used to implement reflection) // func:amc.FDb.trace.RowidFind static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); @@ -1096,13 +1083,14 @@ bool amc::Enumstr_ReadFieldMaybe(amc::Enumstr& parent, algo::strptr field, algo: switch(field_id) { case amc_FieldId_len: { retval = i32_ReadStrptrMaybe(parent.len, strval); - break; - } + } break; case amc_FieldId_str: { retval = algo::RnullStr8_ReadStrptrMaybe(parent.str, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1568,6 +1556,37 @@ void amc::FChash_Uninit(amc::FChash& chash) { ind_chash_Remove(row); // remove chash from index ind_chash } +// --- amc.FCkafka.base.CopyOut +// Copy fields out of row +void amc::ckafka_CopyOut(amc::FCkafka &row, dmmeta::Ckafka &out) { + out.ctype = row.ctype; + out.kind = row.kind; + out.root = row.root; + out.valid_versions = row.valid_versions; + out.flexible_versions = row.flexible_versions; + out.comment = row.comment; +} + +// --- amc.FCkafka.base.CopyIn +// Copy fields in to row +void amc::ckafka_CopyIn(amc::FCkafka &row, dmmeta::Ckafka &in) { + row.ctype = in.ctype; + row.kind = in.kind; + row.root = in.root; + row.valid_versions = in.valid_versions; + row.flexible_versions = in.flexible_versions; + row.comment = in.comment; +} + +// --- amc.FCkafka..Uninit +void amc::FCkafka_Uninit(amc::FCkafka& ckafka) { + amc::FCkafka &row = ckafka; (void)row; + amc::FCtype* p_ctype = amc::ind_ctype_Find(row.ctype); + if (p_ctype) { + c_ckafka_Remove(*p_ctype, row);// remove ckafka from index c_ckafka + } +} + // --- amc.FCppfunc.msghdr.CopyOut // Copy fields out of row void amc::cppfunc_CopyOut(amc::FCppfunc &row, dmmeta::Cppfunc &out) { @@ -1704,11 +1723,11 @@ algo::Smallstr100 amc::name_Get(amc::FCtype& ctype) { // --- amc.FCtype.zs_cfmt.Insert // Insert row into linked list. If row is already in linked list, do nothing. void amc::zs_cfmt_Insert(amc::FCtype& ctype, amc::FCfmt& row) { - if (!zs_cfmt_InLlistQ(row)) { + if (!ctype_zs_cfmt_InLlistQ(row)) { amc::FCfmt* old_tail = ctype.zs_cfmt_tail; - row.zs_cfmt_next = NULL; + row.ctype_zs_cfmt_next = NULL; ctype.zs_cfmt_tail = &row; - amc::FCfmt **new_row_a = &old_tail->zs_cfmt_next; + amc::FCfmt **new_row_a = &old_tail->ctype_zs_cfmt_next; amc::FCfmt **new_row_b = &ctype.zs_cfmt_head; amc::FCfmt **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -1719,13 +1738,13 @@ void amc::zs_cfmt_Insert(amc::FCtype& ctype, amc::FCfmt& row) { // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. void amc::zs_cfmt_Remove(amc::FCtype& ctype, amc::FCfmt& row) { - if (zs_cfmt_InLlistQ(row)) { + if (ctype_zs_cfmt_InLlistQ(row)) { amc::FCfmt* old_head = ctype.zs_cfmt_head; (void)old_head; // in case it's not used amc::FCfmt* prev=NULL; amc::FCfmt* cur = ctype.zs_cfmt_head; while (cur) { // search for element by pointer - amc::FCfmt* next = cur->zs_cfmt_next; + amc::FCfmt* next = cur->ctype_zs_cfmt_next; if (cur == &row) { if (!next) { @@ -1733,11 +1752,11 @@ void amc::zs_cfmt_Remove(amc::FCtype& ctype, amc::FCfmt& row) { } // disconnect element from linked list if (prev) { - prev->zs_cfmt_next = next; + prev->ctype_zs_cfmt_next = next; } else { ctype.zs_cfmt_head = next; } - row.zs_cfmt_next = (amc::FCfmt*)-1; // not-in-list + row.ctype_zs_cfmt_next = (amc::FCfmt*)-1; // not-in-list break; } prev = cur; @@ -1753,8 +1772,8 @@ void amc::zs_cfmt_RemoveAll(amc::FCtype& ctype) { ctype.zs_cfmt_head = NULL; ctype.zs_cfmt_tail = NULL; while (row) { - amc::FCfmt* row_next = row->zs_cfmt_next; - row->zs_cfmt_next = (amc::FCfmt*)-1; + amc::FCfmt* row_next = row->ctype_zs_cfmt_next; + row->ctype_zs_cfmt_next = (amc::FCfmt*)-1; row = row_next; } } @@ -1765,13 +1784,13 @@ amc::FCfmt* amc::zs_cfmt_RemoveFirst(amc::FCtype& ctype) { amc::FCfmt *row = NULL; row = ctype.zs_cfmt_head; if (row) { - amc::FCfmt *next = row->zs_cfmt_next; + amc::FCfmt *next = row->ctype_zs_cfmt_next; ctype.zs_cfmt_head = next; // clear list's tail pointer if list is empty. if (!next) { ctype.zs_cfmt_tail = NULL; } - row->zs_cfmt_next = (amc::FCfmt*)-1; // mark as not-in-list + row->ctype_zs_cfmt_next = (amc::FCfmt*)-1; // mark as not-in-list } return row; } @@ -1780,14 +1799,9 @@ amc::FCfmt* amc::zs_cfmt_RemoveFirst(amc::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_field_Insert(amc::FCtype& ctype, amc::FField& row) { - // reserve space c_field_Reserve(ctype, 1); - u32 n = ctype.c_field_n; - u32 at = n; - amc::FField* *elems = ctype.c_field_elems; - elems[at] = &row; - ctype.c_field_n = n+1; - + u32 n = ctype.c_field_n++; + ctype.c_field_elems[n] = &row; } // --- amc.FCtype.c_field.ScanInsertMaybe @@ -1816,20 +1830,18 @@ bool amc::c_field_ScanInsertMaybe(amc::FCtype& ctype, amc::FField& row) { // --- amc.FCtype.c_field.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_field_Remove(amc::FCtype& ctype, amc::FField& row) { - int lim = ctype.c_field_n; - amc::FField* *elems = ctype.c_field_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc::FField* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FField*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - ctype.c_field_n = lim - 1; - break; + int n = ctype.c_field_n; + int j=0; + for (int i=0; i=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FStatictuple* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FStatictuple*) * (lim - j); + size_t nbytes = sizeof(amc::FStatictuple*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_static_n = lim - 1; + ctype.c_static_n = n - 1; break; } } @@ -2083,14 +2091,9 @@ void amc::c_static_Reserve(amc::FCtype& ctype, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_parent_Insert(amc::FCtype& ctype, amc::FCtype& row) { - // reserve space c_parent_Reserve(ctype, 1); - u32 n = ctype.c_parent_n; - u32 at = n; - amc::FCtype* *elems = ctype.c_parent_elems; - elems[at] = &row; - ctype.c_parent_n = n+1; - + u32 n = ctype.c_parent_n++; + ctype.c_parent_elems[n] = &row; } // --- amc.FCtype.c_parent.ScanInsertMaybe @@ -2119,20 +2122,18 @@ bool amc::c_parent_ScanInsertMaybe(amc::FCtype& ctype, amc::FCtype& row) { // --- amc.FCtype.c_parent.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_parent_Remove(amc::FCtype& ctype, amc::FCtype& row) { - int lim = ctype.c_parent_n; - amc::FCtype* *elems = ctype.c_parent_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc::FCtype* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FCtype*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - ctype.c_parent_n = lim - 1; - break; + int n = ctype.c_parent_n; + int j=0; + for (int i=0; i=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FPmaskfld* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FPmaskfld*) * (lim - j); + size_t nbytes = sizeof(amc::FPmaskfld*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_pmaskfld_n = lim - 1; + ctype.c_pmaskfld_n = n - 1; break; } } @@ -2220,15 +2217,11 @@ void amc::c_pmaskfld_Reserve(amc::FCtype& ctype, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_datafld_Insert(amc::FCtype& ctype, amc::FField& row) { - if (bool_Update(row.ctype_c_datafld_in_ary,true)) { - // reserve space + if (!row.ctype_c_datafld_in_ary) { c_datafld_Reserve(ctype, 1); - u32 n = ctype.c_datafld_n; - u32 at = n; - amc::FField* *elems = ctype.c_datafld_elems; - elems[at] = &row; - ctype.c_datafld_n = n+1; - + u32 n = ctype.c_datafld_n++; + ctype.c_datafld_elems[n] = &row; + row.ctype_c_datafld_in_ary = true; } } @@ -2237,7 +2230,7 @@ void amc::c_datafld_Insert(amc::FCtype& ctype, amc::FField& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_datafld_InsertMaybe(amc::FCtype& ctype, amc::FField& row) { - bool retval = !row.ctype_c_datafld_in_ary; + bool retval = !ctype_c_datafld_InAryQ(row); c_datafld_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -2245,18 +2238,18 @@ bool amc::c_datafld_InsertMaybe(amc::FCtype& ctype, amc::FField& row) { // --- amc.FCtype.c_datafld.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_datafld_Remove(amc::FCtype& ctype, amc::FField& row) { + int n = ctype.c_datafld_n; if (bool_Update(row.ctype_c_datafld_in_ary,false)) { - int lim = ctype.c_datafld_n; amc::FField* *elems = ctype.c_datafld_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FField*) * (lim - j); + size_t nbytes = sizeof(amc::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_datafld_n = lim - 1; + ctype.c_datafld_n = n - 1; break; } } @@ -2283,12 +2276,12 @@ void amc::c_datafld_Reserve(amc::FCtype& ctype, u32 n) { // --- amc.FCtype.zd_inst.Insert // Insert row into linked list. If row is already in linked list, do nothing. void amc::zd_inst_Insert(amc::FCtype& ctype, amc::FField& row) { - if (!zd_inst_InLlistQ(row)) { + if (!ctype_zd_inst_InLlistQ(row)) { amc::FField* old_tail = ctype.zd_inst_tail; - row.zd_inst_next = NULL; - row.zd_inst_prev = old_tail; + row.ctype_zd_inst_next = NULL; + row.ctype_zd_inst_prev = old_tail; ctype.zd_inst_tail = &row; - amc::FField **new_row_a = &old_tail->zd_inst_next; + amc::FField **new_row_a = &old_tail->ctype_zd_inst_next; amc::FField **new_row_b = &ctype.zd_inst_head; amc::FField **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -2299,23 +2292,23 @@ void amc::zd_inst_Insert(amc::FCtype& ctype, amc::FField& row) { // --- amc.FCtype.zd_inst.Remove // Remove element from index. If element is not in index, do nothing. void amc::zd_inst_Remove(amc::FCtype& ctype, amc::FField& row) { - if (zd_inst_InLlistQ(row)) { + if (ctype_zd_inst_InLlistQ(row)) { amc::FField* old_head = ctype.zd_inst_head; (void)old_head; // in case it's not used - amc::FField* prev = row.zd_inst_prev; - amc::FField* next = row.zd_inst_next; + amc::FField* prev = row.ctype_zd_inst_prev; + amc::FField* next = row.ctype_zd_inst_next; // if element is first, adjust list head; otherwise, adjust previous element's next - amc::FField **new_next_a = &prev->zd_inst_next; + amc::FField **new_next_a = &prev->ctype_zd_inst_next; amc::FField **new_next_b = &ctype.zd_inst_head; amc::FField **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - amc::FField **new_prev_a = &next->zd_inst_prev; + amc::FField **new_prev_a = &next->ctype_zd_inst_prev; amc::FField **new_prev_b = &ctype.zd_inst_tail; amc::FField **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; ctype.zd_inst_n--; - row.zd_inst_next=(amc::FField*)-1; // not-in-list + row.ctype_zd_inst_next=(amc::FField*)-1; // not-in-list } } @@ -2327,9 +2320,9 @@ void amc::zd_inst_RemoveAll(amc::FCtype& ctype) { ctype.zd_inst_tail = NULL; ctype.zd_inst_n = 0; while (row) { - amc::FField* row_next = row->zd_inst_next; - row->zd_inst_next = (amc::FField*)-1; - row->zd_inst_prev = NULL; + amc::FField* row_next = row->ctype_zd_inst_next; + row->ctype_zd_inst_next = (amc::FField*)-1; + row->ctype_zd_inst_prev = NULL; row = row_next; } } @@ -2340,14 +2333,14 @@ amc::FField* amc::zd_inst_RemoveFirst(amc::FCtype& ctype) { amc::FField *row = NULL; row = ctype.zd_inst_head; if (row) { - amc::FField *next = row->zd_inst_next; + amc::FField *next = row->ctype_zd_inst_next; ctype.zd_inst_head = next; - amc::FField **new_end_a = &next->zd_inst_prev; + amc::FField **new_end_a = &next->ctype_zd_inst_prev; amc::FField **new_end_b = &ctype.zd_inst_tail; amc::FField **new_end = next ? new_end_a : new_end_b; *new_end = NULL; ctype.zd_inst_n--; - row->zd_inst_next = (amc::FField*)-1; // mark as not-in-list + row->ctype_zd_inst_next = (amc::FField*)-1; // mark as not-in-list } return row; } @@ -2355,11 +2348,11 @@ amc::FField* amc::zd_inst_RemoveFirst(amc::FCtype& ctype) { // --- amc.FCtype.zs_xref.Insert // Insert row into linked list. If row is already in linked list, do nothing. void amc::zs_xref_Insert(amc::FCtype& ctype, amc::FXref& row) { - if (!zs_xref_InLlistQ(row)) { + if (!ctype_zs_xref_InLlistQ(row)) { amc::FXref* old_tail = ctype.zs_xref_tail; - row.zs_xref_next = NULL; + row.ctype_zs_xref_next = NULL; ctype.zs_xref_tail = &row; - amc::FXref **new_row_a = &old_tail->zs_xref_next; + amc::FXref **new_row_a = &old_tail->ctype_zs_xref_next; amc::FXref **new_row_b = &ctype.zs_xref_head; amc::FXref **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -2371,13 +2364,13 @@ void amc::zs_xref_Insert(amc::FCtype& ctype, amc::FXref& row) { // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. void amc::zs_xref_Remove(amc::FCtype& ctype, amc::FXref& row) { - if (zs_xref_InLlistQ(row)) { + if (ctype_zs_xref_InLlistQ(row)) { amc::FXref* old_head = ctype.zs_xref_head; (void)old_head; // in case it's not used amc::FXref* prev=NULL; amc::FXref* cur = ctype.zs_xref_head; while (cur) { // search for element by pointer - amc::FXref* next = cur->zs_xref_next; + amc::FXref* next = cur->ctype_zs_xref_next; if (cur == &row) { ctype.zs_xref_n--; // adjust count @@ -2386,11 +2379,11 @@ void amc::zs_xref_Remove(amc::FCtype& ctype, amc::FXref& row) { } // disconnect element from linked list if (prev) { - prev->zs_xref_next = next; + prev->ctype_zs_xref_next = next; } else { ctype.zs_xref_head = next; } - row.zs_xref_next = (amc::FXref*)-1; // not-in-list + row.ctype_zs_xref_next = (amc::FXref*)-1; // not-in-list break; } prev = cur; @@ -2407,8 +2400,8 @@ void amc::zs_xref_RemoveAll(amc::FCtype& ctype) { ctype.zs_xref_tail = NULL; ctype.zs_xref_n = 0; while (row) { - amc::FXref* row_next = row->zs_xref_next; - row->zs_xref_next = (amc::FXref*)-1; + amc::FXref* row_next = row->ctype_zs_xref_next; + row->ctype_zs_xref_next = (amc::FXref*)-1; row = row_next; } } @@ -2419,14 +2412,14 @@ amc::FXref* amc::zs_xref_RemoveFirst(amc::FCtype& ctype) { amc::FXref *row = NULL; row = ctype.zs_xref_head; if (row) { - amc::FXref *next = row->zs_xref_next; + amc::FXref *next = row->ctype_zs_xref_next; ctype.zs_xref_head = next; // clear list's tail pointer if list is empty. if (!next) { ctype.zs_xref_tail = NULL; } ctype.zs_xref_n--; - row->zs_xref_next = (amc::FXref*)-1; // mark as not-in-list + row->ctype_zs_xref_next = (amc::FXref*)-1; // mark as not-in-list } return row; } @@ -2435,14 +2428,9 @@ amc::FXref* amc::zs_xref_RemoveFirst(amc::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_ffunc_Insert(amc::FCtype& ctype, amc::FFunc& row) { - // reserve space c_ffunc_Reserve(ctype, 1); - u32 n = ctype.c_ffunc_n; - u32 at = n; - amc::FFunc* *elems = ctype.c_ffunc_elems; - elems[at] = &row; - ctype.c_ffunc_n = n+1; - + u32 n = ctype.c_ffunc_n++; + ctype.c_ffunc_elems[n] = &row; } // --- amc.FCtype.c_ffunc.ScanInsertMaybe @@ -2471,20 +2459,18 @@ bool amc::c_ffunc_ScanInsertMaybe(amc::FCtype& ctype, amc::FFunc& row) { // --- amc.FCtype.c_ffunc.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_ffunc_Remove(amc::FCtype& ctype, amc::FFunc& row) { - int lim = ctype.c_ffunc_n; - amc::FFunc* *elems = ctype.c_ffunc_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc::FFunc* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FFunc*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - ctype.c_ffunc_n = lim - 1; - break; + int n = ctype.c_ffunc_n; + int j=0; + for (int i=0; izd_cafter_next; + amc::FCafter **new_row_a = &old_tail->ctype_zd_cafter_next; amc::FCafter **new_row_b = &ctype.zd_cafter_head; amc::FCafter **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -2523,23 +2509,23 @@ void amc::zd_cafter_Insert(amc::FCtype& ctype, amc::FCafter& row) { // --- amc.FCtype.zd_cafter.Remove // Remove element from index. If element is not in index, do nothing. void amc::zd_cafter_Remove(amc::FCtype& ctype, amc::FCafter& row) { - if (zd_cafter_InLlistQ(row)) { + if (ctype_zd_cafter_InLlistQ(row)) { amc::FCafter* old_head = ctype.zd_cafter_head; (void)old_head; // in case it's not used - amc::FCafter* prev = row.zd_cafter_prev; - amc::FCafter* next = row.zd_cafter_next; + amc::FCafter* prev = row.ctype_zd_cafter_prev; + amc::FCafter* next = row.ctype_zd_cafter_next; // if element is first, adjust list head; otherwise, adjust previous element's next - amc::FCafter **new_next_a = &prev->zd_cafter_next; + amc::FCafter **new_next_a = &prev->ctype_zd_cafter_next; amc::FCafter **new_next_b = &ctype.zd_cafter_head; amc::FCafter **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - amc::FCafter **new_prev_a = &next->zd_cafter_prev; + amc::FCafter **new_prev_a = &next->ctype_zd_cafter_prev; amc::FCafter **new_prev_b = &ctype.zd_cafter_tail; amc::FCafter **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; ctype.zd_cafter_n--; - row.zd_cafter_next=(amc::FCafter*)-1; // not-in-list + row.ctype_zd_cafter_next=(amc::FCafter*)-1; // not-in-list } } @@ -2551,9 +2537,9 @@ void amc::zd_cafter_RemoveAll(amc::FCtype& ctype) { ctype.zd_cafter_tail = NULL; ctype.zd_cafter_n = 0; while (row) { - amc::FCafter* row_next = row->zd_cafter_next; - row->zd_cafter_next = (amc::FCafter*)-1; - row->zd_cafter_prev = NULL; + amc::FCafter* row_next = row->ctype_zd_cafter_next; + row->ctype_zd_cafter_next = (amc::FCafter*)-1; + row->ctype_zd_cafter_prev = NULL; row = row_next; } } @@ -2564,14 +2550,14 @@ amc::FCafter* amc::zd_cafter_RemoveFirst(amc::FCtype& ctype) { amc::FCafter *row = NULL; row = ctype.zd_cafter_head; if (row) { - amc::FCafter *next = row->zd_cafter_next; + amc::FCafter *next = row->ctype_zd_cafter_next; ctype.zd_cafter_head = next; - amc::FCafter **new_end_a = &next->zd_cafter_prev; + amc::FCafter **new_end_a = &next->ctype_zd_cafter_prev; amc::FCafter **new_end_b = &ctype.zd_cafter_tail; amc::FCafter **new_end = next ? new_end_a : new_end_b; *new_end = NULL; ctype.zd_cafter_n--; - row->zd_cafter_next = (amc::FCafter*)-1; // mark as not-in-list + row->ctype_zd_cafter_next = (amc::FCafter*)-1; // mark as not-in-list } return row; } @@ -2579,12 +2565,12 @@ amc::FCafter* amc::zd_cafter_RemoveFirst(amc::FCtype& ctype) { // --- amc.FCtype.zd_access.Insert // Insert row into linked list. If row is already in linked list, do nothing. void amc::zd_access_Insert(amc::FCtype& ctype, amc::FField& row) { - if (!zd_access_InLlistQ(row)) { + if (!ctype_zd_access_InLlistQ(row)) { amc::FField* old_tail = ctype.zd_access_tail; - row.zd_access_next = NULL; - row.zd_access_prev = old_tail; + row.ctype_zd_access_next = NULL; + row.ctype_zd_access_prev = old_tail; ctype.zd_access_tail = &row; - amc::FField **new_row_a = &old_tail->zd_access_next; + amc::FField **new_row_a = &old_tail->ctype_zd_access_next; amc::FField **new_row_b = &ctype.zd_access_head; amc::FField **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -2595,23 +2581,23 @@ void amc::zd_access_Insert(amc::FCtype& ctype, amc::FField& row) { // --- amc.FCtype.zd_access.Remove // Remove element from index. If element is not in index, do nothing. void amc::zd_access_Remove(amc::FCtype& ctype, amc::FField& row) { - if (zd_access_InLlistQ(row)) { + if (ctype_zd_access_InLlistQ(row)) { amc::FField* old_head = ctype.zd_access_head; (void)old_head; // in case it's not used - amc::FField* prev = row.zd_access_prev; - amc::FField* next = row.zd_access_next; + amc::FField* prev = row.ctype_zd_access_prev; + amc::FField* next = row.ctype_zd_access_next; // if element is first, adjust list head; otherwise, adjust previous element's next - amc::FField **new_next_a = &prev->zd_access_next; + amc::FField **new_next_a = &prev->ctype_zd_access_next; amc::FField **new_next_b = &ctype.zd_access_head; amc::FField **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - amc::FField **new_prev_a = &next->zd_access_prev; + amc::FField **new_prev_a = &next->ctype_zd_access_prev; amc::FField **new_prev_b = &ctype.zd_access_tail; amc::FField **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; ctype.zd_access_n--; - row.zd_access_next=(amc::FField*)-1; // not-in-list + row.ctype_zd_access_next=(amc::FField*)-1; // not-in-list } } @@ -2623,9 +2609,9 @@ void amc::zd_access_RemoveAll(amc::FCtype& ctype) { ctype.zd_access_tail = NULL; ctype.zd_access_n = 0; while (row) { - amc::FField* row_next = row->zd_access_next; - row->zd_access_next = (amc::FField*)-1; - row->zd_access_prev = NULL; + amc::FField* row_next = row->ctype_zd_access_next; + row->ctype_zd_access_next = (amc::FField*)-1; + row->ctype_zd_access_prev = NULL; row = row_next; } } @@ -2636,14 +2622,14 @@ amc::FField* amc::zd_access_RemoveFirst(amc::FCtype& ctype) { amc::FField *row = NULL; row = ctype.zd_access_head; if (row) { - amc::FField *next = row->zd_access_next; + amc::FField *next = row->ctype_zd_access_next; ctype.zd_access_head = next; - amc::FField **new_end_a = &next->zd_access_prev; + amc::FField **new_end_a = &next->ctype_zd_access_prev; amc::FField **new_end_b = &ctype.zd_access_tail; amc::FField **new_end = next ? new_end_a : new_end_b; *new_end = NULL; ctype.zd_access_n--; - row->zd_access_next = (amc::FField*)-1; // mark as not-in-list + row->ctype_zd_access_next = (amc::FField*)-1; // mark as not-in-list } return row; } @@ -2652,15 +2638,11 @@ amc::FField* amc::zd_access_RemoveFirst(amc::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_fcurs_Insert(amc::FCtype& ctype, amc::FFcurs& row) { - if (bool_Update(row.ctype_c_fcurs_in_ary,true)) { - // reserve space + if (!row.ctype_c_fcurs_in_ary) { c_fcurs_Reserve(ctype, 1); - u32 n = ctype.c_fcurs_n; - u32 at = n; - amc::FFcurs* *elems = ctype.c_fcurs_elems; - elems[at] = &row; - ctype.c_fcurs_n = n+1; - + u32 n = ctype.c_fcurs_n++; + ctype.c_fcurs_elems[n] = &row; + row.ctype_c_fcurs_in_ary = true; } } @@ -2669,7 +2651,7 @@ void amc::c_fcurs_Insert(amc::FCtype& ctype, amc::FFcurs& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_fcurs_InsertMaybe(amc::FCtype& ctype, amc::FFcurs& row) { - bool retval = !row.ctype_c_fcurs_in_ary; + bool retval = !ctype_c_fcurs_InAryQ(row); c_fcurs_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -2677,18 +2659,18 @@ bool amc::c_fcurs_InsertMaybe(amc::FCtype& ctype, amc::FFcurs& row) { // --- amc.FCtype.c_fcurs.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_fcurs_Remove(amc::FCtype& ctype, amc::FFcurs& row) { + int n = ctype.c_fcurs_n; if (bool_Update(row.ctype_c_fcurs_in_ary,false)) { - int lim = ctype.c_fcurs_n; amc::FFcurs* *elems = ctype.c_fcurs_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FFcurs* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FFcurs*) * (lim - j); + size_t nbytes = sizeof(amc::FFcurs*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_fcurs_n = lim - 1; + ctype.c_fcurs_n = n - 1; break; } } @@ -2716,15 +2698,11 @@ void amc::c_fcurs_Reserve(amc::FCtype& ctype, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_ffast_Insert(amc::FCtype& ctype, amc::FFfast& row) { - if (bool_Update(row.ctype_c_ffast_in_ary,true)) { - // reserve space + if (!row.ctype_c_ffast_in_ary) { c_ffast_Reserve(ctype, 1); - u32 n = ctype.c_ffast_n; - u32 at = n; - amc::FFfast* *elems = ctype.c_ffast_elems; - elems[at] = &row; - ctype.c_ffast_n = n+1; - + u32 n = ctype.c_ffast_n++; + ctype.c_ffast_elems[n] = &row; + row.ctype_c_ffast_in_ary = true; } } @@ -2733,7 +2711,7 @@ void amc::c_ffast_Insert(amc::FCtype& ctype, amc::FFfast& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_ffast_InsertMaybe(amc::FCtype& ctype, amc::FFfast& row) { - bool retval = !row.ctype_c_ffast_in_ary; + bool retval = !ctype_c_ffast_InAryQ(row); c_ffast_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -2741,18 +2719,18 @@ bool amc::c_ffast_InsertMaybe(amc::FCtype& ctype, amc::FFfast& row) { // --- amc.FCtype.c_ffast.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_ffast_Remove(amc::FCtype& ctype, amc::FFfast& row) { + int n = ctype.c_ffast_n; if (bool_Update(row.ctype_c_ffast_in_ary,false)) { - int lim = ctype.c_ffast_n; amc::FFfast* *elems = ctype.c_ffast_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FFfast* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FFfast*) * (lim - j); + size_t nbytes = sizeof(amc::FFfast*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_ffast_n = lim - 1; + ctype.c_ffast_n = n - 1; break; } } @@ -2942,6 +2920,78 @@ void amc::c_ffast_QuickSort(amc::FCtype& ctype) { c_ffast_IntQuickSort(elems, n, max_depth); } +// --- amc.FCtype.zd_varlenfld.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void amc::zd_varlenfld_Insert(amc::FCtype& ctype, amc::FField& row) { + if (!ctype_zd_varlenfld_InLlistQ(row)) { + amc::FField* old_tail = ctype.zd_varlenfld_tail; + row.ctype_zd_varlenfld_next = NULL; + row.ctype_zd_varlenfld_prev = old_tail; + ctype.zd_varlenfld_tail = &row; + amc::FField **new_row_a = &old_tail->ctype_zd_varlenfld_next; + amc::FField **new_row_b = &ctype.zd_varlenfld_head; + amc::FField **new_row = old_tail ? new_row_a : new_row_b; + *new_row = &row; + ctype.zd_varlenfld_n++; + } +} + +// --- amc.FCtype.zd_varlenfld.Remove +// Remove element from index. If element is not in index, do nothing. +void amc::zd_varlenfld_Remove(amc::FCtype& ctype, amc::FField& row) { + if (ctype_zd_varlenfld_InLlistQ(row)) { + amc::FField* old_head = ctype.zd_varlenfld_head; + (void)old_head; // in case it's not used + amc::FField* prev = row.ctype_zd_varlenfld_prev; + amc::FField* next = row.ctype_zd_varlenfld_next; + // if element is first, adjust list head; otherwise, adjust previous element's next + amc::FField **new_next_a = &prev->ctype_zd_varlenfld_next; + amc::FField **new_next_b = &ctype.zd_varlenfld_head; + amc::FField **new_next = prev ? new_next_a : new_next_b; + *new_next = next; + // if element is last, adjust list tail; otherwise, adjust next element's prev + amc::FField **new_prev_a = &next->ctype_zd_varlenfld_prev; + amc::FField **new_prev_b = &ctype.zd_varlenfld_tail; + amc::FField **new_prev = next ? new_prev_a : new_prev_b; + *new_prev = prev; + ctype.zd_varlenfld_n--; + row.ctype_zd_varlenfld_next=(amc::FField*)-1; // not-in-list + } +} + +// --- amc.FCtype.zd_varlenfld.RemoveAll +// Empty the index. (The rows are not deleted) +void amc::zd_varlenfld_RemoveAll(amc::FCtype& ctype) { + amc::FField* row = ctype.zd_varlenfld_head; + ctype.zd_varlenfld_head = NULL; + ctype.zd_varlenfld_tail = NULL; + ctype.zd_varlenfld_n = 0; + while (row) { + amc::FField* row_next = row->ctype_zd_varlenfld_next; + row->ctype_zd_varlenfld_next = (amc::FField*)-1; + row->ctype_zd_varlenfld_prev = NULL; + row = row_next; + } +} + +// --- amc.FCtype.zd_varlenfld.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +amc::FField* amc::zd_varlenfld_RemoveFirst(amc::FCtype& ctype) { + amc::FField *row = NULL; + row = ctype.zd_varlenfld_head; + if (row) { + amc::FField *next = row->ctype_zd_varlenfld_next; + ctype.zd_varlenfld_head = next; + amc::FField **new_end_a = &next->ctype_zd_varlenfld_prev; + amc::FField **new_end_b = &ctype.zd_varlenfld_tail; + amc::FField **new_end = next ? new_end_a : new_end_b; + *new_end = NULL; + ctype.zd_varlenfld_n--; + row->ctype_zd_varlenfld_next = (amc::FField*)-1; // mark as not-in-list + } + return row; +} + // --- amc.FCtype..Init // Set all fields to initial values. void amc::FCtype_Init(amc::FCtype& ctype) { @@ -2954,7 +3004,6 @@ void amc::FCtype_Init(amc::FCtype& ctype) { ctype.c_field_n = 0; // (amc.FCtype.c_field) ctype.c_field_max = 0; // (amc.FCtype.c_field) ctype.c_msgtype = NULL; - ctype.c_varlenfld = NULL; ctype.c_optfld = NULL; ctype.c_static_elems = NULL; // (amc.FCtype.c_static) ctype.c_static_n = 0; // (amc.FCtype.c_static) @@ -3002,13 +3051,11 @@ void amc::FCtype_Init(amc::FCtype& ctype) { ctype.c_fcurs_max = 0; // (amc.FCtype.c_fcurs) ctype.c_ctypelen = NULL; ctype.size_unknown = bool(false); - ctype.copy_priv_valid = bool(false); ctype.size_locked = bool(false); ctype.topo_visited = bool(false); ctype.enum_visited = bool(false); ctype.fields_cloned = bool(false); ctype.original = bool(false); - ctype.copy_priv = bool(false); ctype.plaindata = bool(false); ctype.alignment = u32(1); ctype.n_padbytes = i32(0); @@ -3022,8 +3069,14 @@ void amc::FCtype_Init(amc::FCtype& ctype) { ctype.c_ffast_n = 0; // (amc.FCtype.c_ffast) ctype.c_ffast_max = 0; // (amc.FCtype.c_ffast) ctype.in_copy_priv = bool(false); + ctype.zd_varlenfld_head = NULL; // (amc.FCtype.zd_varlenfld) + ctype.zd_varlenfld_n = 0; // (amc.FCtype.zd_varlenfld) + ctype.zd_varlenfld_tail = NULL; // (amc.FCtype.zd_varlenfld) + ctype.c_jstype = NULL; + ctype.c_ckafka = NULL; ctype.ns_c_ctype_in_ary = bool(false); ctype.ind_ctype_next = (amc::FCtype*)-1; // (amc.FDb.ind_ctype) not-in-hash + ctype.ind_ctype_hashval = 0; // stored hash value ctype.zsl_ctype_pack_tran_next = (amc::FCtype*)-1; // (amc.FDb.zsl_ctype_pack_tran) not-in-list ctype.zs_sig_visit_next = (amc::FCtype*)-1; // (amc.FDb.zs_sig_visit) not-in-list } @@ -3091,7 +3144,6 @@ void amc::FCtypelen_Uninit(amc::FCtypelen& ctypelen) { if (p_ctype) { c_ctypelen_Remove(*p_ctype, row);// remove ctypelen from index c_ctypelen } - c_ctypelen_Remove(row); // remove ctypelen from index c_ctypelen } // --- amc.FTclass.msghdr.CopyOut @@ -3112,15 +3164,11 @@ void amc::tclass_CopyIn(amc::FTclass &row, amcdb::Tclass &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_tfunc_Insert(amc::FTclass& tclass, amc::FTfunc& row) { - if (bool_Update(row.tclass_c_tfunc_in_ary,true)) { - // reserve space + if (!row.tclass_c_tfunc_in_ary) { c_tfunc_Reserve(tclass, 1); - u32 n = tclass.c_tfunc_n; - u32 at = n; - amc::FTfunc* *elems = tclass.c_tfunc_elems; - elems[at] = &row; - tclass.c_tfunc_n = n+1; - + u32 n = tclass.c_tfunc_n++; + tclass.c_tfunc_elems[n] = &row; + row.tclass_c_tfunc_in_ary = true; } } @@ -3129,7 +3177,7 @@ void amc::c_tfunc_Insert(amc::FTclass& tclass, amc::FTfunc& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_tfunc_InsertMaybe(amc::FTclass& tclass, amc::FTfunc& row) { - bool retval = !row.tclass_c_tfunc_in_ary; + bool retval = !tclass_c_tfunc_InAryQ(row); c_tfunc_Insert(tclass,row); // check is performed in _Insert again return retval; } @@ -3137,18 +3185,18 @@ bool amc::c_tfunc_InsertMaybe(amc::FTclass& tclass, amc::FTfunc& row) { // --- amc.FTclass.c_tfunc.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_tfunc_Remove(amc::FTclass& tclass, amc::FTfunc& row) { + int n = tclass.c_tfunc_n; if (bool_Update(row.tclass_c_tfunc_in_ary,false)) { - int lim = tclass.c_tfunc_n; amc::FTfunc* *elems = tclass.c_tfunc_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FTfunc* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FTfunc*) * (lim - j); + size_t nbytes = sizeof(amc::FTfunc*) * (n - j); memmove(elems + i, elems + j, nbytes); - tclass.c_tfunc_n = lim - 1; + tclass.c_tfunc_n = n - 1; break; } } @@ -3431,14 +3479,9 @@ bool amc::fsort_XrefMaybe(amc::FFsort &row) { // Find row by key. Return NULL if not found. amc::FCfmt* amc::ind_cfmt_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_cfmt_buckets_n - 1); - amc::FCfmt* *e = &_db.ind_cfmt_buckets_elems[index]; - amc::FCfmt* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).cfmt == key; - if (done) break; - e = &ret->ind_cfmt_next; - } while (true); + amc::FCfmt *ret = _db.ind_cfmt_buckets_elems[index]; + for (; ret && !((*ret).cfmt == key); ret = ret->ind_cfmt_next) { + } return ret; } @@ -3462,10 +3505,11 @@ amc::FCfmt& amc::ind_cfmt_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_cfmt.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_cfmt_InsertMaybe(amc::FCfmt& row) { - ind_cfmt_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_cfmt_next == (amc::FCfmt*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.cfmt) & (_db.ind_cfmt_buckets_n - 1); + row.ind_cfmt_hashval = algo::Smallstr100_Hash(0, row.cfmt); + ind_cfmt_Reserve(1); + u32 index = row.ind_cfmt_hashval & (_db.ind_cfmt_buckets_n - 1); amc::FCfmt* *prev = &_db.ind_cfmt_buckets_elems[index]; do { amc::FCfmt* ret = *prev; @@ -3491,7 +3535,7 @@ bool amc::ind_cfmt_InsertMaybe(amc::FCfmt& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_cfmt_Remove(amc::FCfmt& row) { if (LIKELY(row.ind_cfmt_next != (amc::FCfmt*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.cfmt) & (_db.ind_cfmt_buckets_n - 1); + u32 index = row.ind_cfmt_hashval & (_db.ind_cfmt_buckets_n - 1); amc::FCfmt* *prev = &_db.ind_cfmt_buckets_elems[index]; // addr of pointer to current element while (amc::FCfmt *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3508,8 +3552,14 @@ void amc::ind_cfmt_Remove(amc::FCfmt& row) { // --- amc.FDb.ind_cfmt.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_cfmt_Reserve(int n) { + ind_cfmt_AbsReserve(_db.ind_cfmt_n + n); +} + +// --- amc.FDb.ind_cfmt.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_cfmt_AbsReserve(int n) { u32 old_nbuckets = _db.ind_cfmt_buckets_n; - u32 new_nelems = _db.ind_cfmt_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3528,7 +3578,7 @@ void amc::ind_cfmt_Reserve(int n) { while (elem) { amc::FCfmt &row = *elem; amc::FCfmt* next = row.ind_cfmt_next; - u32 index = algo::Smallstr100_Hash(0, row.cfmt) & (new_nbuckets-1); + u32 index = row.ind_cfmt_hashval & (new_nbuckets-1); row.ind_cfmt_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -5328,6 +5378,15 @@ bool amc::lenfld_XrefMaybe(amc::FLenfld &row) { return false; } } + // insert lenfld into index c_lenfld + if (true) { // user-defined insert condition + bool success = c_lenfld_InsertMaybe(*p_field, row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "amc.duplicate_key xref:amc.FField.c_lenfld"; // check for duplicate key + return false; + } + } return retval; } @@ -6787,9 +6846,8 @@ void amc::ReadArgv() { } if (ch_N(attrname) == 0) { err << "amc: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -6881,7 +6942,7 @@ static void amc::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'amc.Input' signature:'1028c706dfd39d2aeb9bcab5542184a9d2642574'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'amc.Input' signature:'e9d5953ed69a710a66a2fe892cfbeee717f873b3'"); } // --- amc.FDb._db.InsertStrptrMaybe @@ -7492,6 +7553,36 @@ bool amc::InsertStrptrMaybe(algo::strptr str) { retval = retval && fbuftype_InputMaybe(elem); break; } + case amc_TableId_dmmeta_Nsjs: { // finput:amc.FDb.nsjs + dmmeta::Nsjs elem; + retval = dmmeta::Nsjs_ReadStrptrMaybe(elem, str); + retval = retval && nsjs_InputMaybe(elem); + break; + } + case amc_TableId_dmmeta_Jstype: { // finput:amc.FDb.jstype + dmmeta::Jstype elem; + retval = dmmeta::Jstype_ReadStrptrMaybe(elem, str); + retval = retval && jstype_InputMaybe(elem); + break; + } + case amc_TableId_dmmeta_Ckafka: { // finput:amc.FDb.ckafka + dmmeta::Ckafka elem; + retval = dmmeta::Ckafka_ReadStrptrMaybe(elem, str); + retval = retval && ckafka_InputMaybe(elem); + break; + } + case amc_TableId_dmmeta_Fkafka: { // finput:amc.FDb.fkafka + dmmeta::Fkafka elem; + retval = dmmeta::Fkafka_ReadStrptrMaybe(elem, str); + retval = retval && fkafka_InputMaybe(elem); + break; + } + case amc_TableId_dmmeta_Steptype: { // finput:amc.FDb.steptype + dmmeta::Steptype elem; + retval = dmmeta::Steptype_ReadStrptrMaybe(elem, str); + retval = retval && steptype_InputMaybe(elem); + break; + } default: break; } //switch @@ -7520,6 +7611,7 @@ bool amc::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.thash"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.tary"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.substr"),recursive); + retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.steptype"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.nsdb"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.ssimfile"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.ssimvolatile"),recursive); @@ -7535,6 +7627,7 @@ bool amc::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.numstr"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.nsx"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.nsproto"),recursive); + retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.nsjs"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.nsinclude"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.nscpp"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.noxref"),recursive); @@ -7546,6 +7639,7 @@ bool amc::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.listtype"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.llist"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.lenfld"),recursive); + retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.jstype"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.inlary"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.hook"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.gsymbol"),recursive); @@ -7563,6 +7657,7 @@ bool amc::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.fnoremove"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.floadtuples"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.fldoffset"),recursive); + retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.fkafka"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.finput"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.findrem"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.fflag"),recursive); @@ -7593,6 +7688,7 @@ bool amc::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.csize"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.cpptype"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.cppfunc"),recursive); + retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.ckafka"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.chash"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.charset"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.cget"),recursive); @@ -7612,8 +7708,8 @@ bool amc::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"amcdb.tcurs"),recursive); retval = retval && amc::LoadTuplesFile(algo::SsimFname(root,"amcdb.bltin"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -7657,19 +7753,6 @@ bool amc::LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) { return retval; } -// --- amc.FDb._db.SaveTuples -// Save ssim data to given directory. -u32 amc::SaveTuples(algo::strptr root) { - u32 retval = 0; - u32 nbefore = algo_lib::_db.stringtofile_nwrite; - (void)tracefld_SaveSsimfile(SsimFname(root, "dmmeta.tracefld")); - (void)tracerec_SaveSsimfile(SsimFname(root, "dmmeta.tracerec")); - (void)c_dispsig_sorted_SaveSsimfile(SsimFname(root, "dmmeta.dispsig")); - (void)c_ctypelen_SaveSsimfile(SsimFname(root, "dmmeta.ctypelen")); - retval = algo_lib::_db.stringtofile_nwrite - nbefore; - return retval; -} - // --- amc.FDb._db.LoadSsimfileMaybe // Load specified ssimfile. bool amc::LoadSsimfileMaybe(algo::strptr fname, bool recursive) { @@ -7698,14 +7781,9 @@ bool amc::_db_XrefMaybe() { // Find row by key. Return NULL if not found. amc::FBltin* amc::ind_bltin_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_bltin_buckets_n - 1); - amc::FBltin* *e = &_db.ind_bltin_buckets_elems[index]; - amc::FBltin* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_bltin_next; - } while (true); + amc::FBltin *ret = _db.ind_bltin_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_bltin_next) { + } return ret; } @@ -7729,10 +7807,11 @@ amc::FBltin& amc::ind_bltin_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_bltin.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_bltin_InsertMaybe(amc::FBltin& row) { - ind_bltin_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_bltin_next == (amc::FBltin*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_bltin_buckets_n - 1); + row.ind_bltin_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_bltin_Reserve(1); + u32 index = row.ind_bltin_hashval & (_db.ind_bltin_buckets_n - 1); amc::FBltin* *prev = &_db.ind_bltin_buckets_elems[index]; do { amc::FBltin* ret = *prev; @@ -7758,7 +7837,7 @@ bool amc::ind_bltin_InsertMaybe(amc::FBltin& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_bltin_Remove(amc::FBltin& row) { if (LIKELY(row.ind_bltin_next != (amc::FBltin*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_bltin_buckets_n - 1); + u32 index = row.ind_bltin_hashval & (_db.ind_bltin_buckets_n - 1); amc::FBltin* *prev = &_db.ind_bltin_buckets_elems[index]; // addr of pointer to current element while (amc::FBltin *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -7775,8 +7854,14 @@ void amc::ind_bltin_Remove(amc::FBltin& row) { // --- amc.FDb.ind_bltin.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_bltin_Reserve(int n) { + ind_bltin_AbsReserve(_db.ind_bltin_n + n); +} + +// --- amc.FDb.ind_bltin.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_bltin_AbsReserve(int n) { u32 old_nbuckets = _db.ind_bltin_buckets_n; - u32 new_nelems = _db.ind_bltin_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -7795,7 +7880,7 @@ void amc::ind_bltin_Reserve(int n) { while (elem) { amc::FBltin &row = *elem; amc::FBltin* next = row.ind_bltin_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_bltin_hashval & (new_nbuckets-1); row.ind_bltin_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -7812,14 +7897,9 @@ void amc::ind_bltin_Reserve(int n) { // Find row by key. Return NULL if not found. amc::FCtype* amc::ind_ctype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctype_buckets_n - 1); - amc::FCtype* *e = &_db.ind_ctype_buckets_elems[index]; - amc::FCtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctype_next; - } while (true); + amc::FCtype *ret = _db.ind_ctype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctype_next) { + } return ret; } @@ -7843,10 +7923,11 @@ amc::FCtype& amc::ind_ctype_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_ctype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_ctype_InsertMaybe(amc::FCtype& row) { - ind_ctype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ctype_next == (amc::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + row.ind_ctype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctype_Reserve(1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); amc::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; do { amc::FCtype* ret = *prev; @@ -7872,7 +7953,7 @@ bool amc::ind_ctype_InsertMaybe(amc::FCtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_ctype_Remove(amc::FCtype& row) { if (LIKELY(row.ind_ctype_next != (amc::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); amc::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; // addr of pointer to current element while (amc::FCtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -7889,8 +7970,14 @@ void amc::ind_ctype_Remove(amc::FCtype& row) { // --- amc.FDb.ind_ctype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_ctype_Reserve(int n) { + ind_ctype_AbsReserve(_db.ind_ctype_n + n); +} + +// --- amc.FDb.ind_ctype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_ctype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ctype_buckets_n; - u32 new_nelems = _db.ind_ctype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -7909,7 +7996,7 @@ void amc::ind_ctype_Reserve(int n) { while (elem) { amc::FCtype &row = *elem; amc::FCtype* next = row.ind_ctype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ctype_hashval & (new_nbuckets-1); row.ind_ctype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -7926,14 +8013,9 @@ void amc::ind_ctype_Reserve(int n) { // Find row by key. Return NULL if not found. amc::FDispatch* amc::ind_dispatch_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_dispatch_buckets_n - 1); - amc::FDispatch* *e = &_db.ind_dispatch_buckets_elems[index]; - amc::FDispatch* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).dispatch == key; - if (done) break; - e = &ret->ind_dispatch_next; - } while (true); + amc::FDispatch *ret = _db.ind_dispatch_buckets_elems[index]; + for (; ret && !((*ret).dispatch == key); ret = ret->ind_dispatch_next) { + } return ret; } @@ -7957,10 +8039,11 @@ amc::FDispatch& amc::ind_dispatch_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_dispatch.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_dispatch_InsertMaybe(amc::FDispatch& row) { - ind_dispatch_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_dispatch_next == (amc::FDispatch*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.dispatch) & (_db.ind_dispatch_buckets_n - 1); + row.ind_dispatch_hashval = algo::Smallstr50_Hash(0, row.dispatch); + ind_dispatch_Reserve(1); + u32 index = row.ind_dispatch_hashval & (_db.ind_dispatch_buckets_n - 1); amc::FDispatch* *prev = &_db.ind_dispatch_buckets_elems[index]; do { amc::FDispatch* ret = *prev; @@ -7986,7 +8069,7 @@ bool amc::ind_dispatch_InsertMaybe(amc::FDispatch& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_dispatch_Remove(amc::FDispatch& row) { if (LIKELY(row.ind_dispatch_next != (amc::FDispatch*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.dispatch) & (_db.ind_dispatch_buckets_n - 1); + u32 index = row.ind_dispatch_hashval & (_db.ind_dispatch_buckets_n - 1); amc::FDispatch* *prev = &_db.ind_dispatch_buckets_elems[index]; // addr of pointer to current element while (amc::FDispatch *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -8003,8 +8086,14 @@ void amc::ind_dispatch_Remove(amc::FDispatch& row) { // --- amc.FDb.ind_dispatch.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_dispatch_Reserve(int n) { + ind_dispatch_AbsReserve(_db.ind_dispatch_n + n); +} + +// --- amc.FDb.ind_dispatch.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_dispatch_AbsReserve(int n) { u32 old_nbuckets = _db.ind_dispatch_buckets_n; - u32 new_nelems = _db.ind_dispatch_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -8023,7 +8112,7 @@ void amc::ind_dispatch_Reserve(int n) { while (elem) { amc::FDispatch &row = *elem; amc::FDispatch* next = row.ind_dispatch_next; - u32 index = algo::Smallstr50_Hash(0, row.dispatch) & (new_nbuckets-1); + u32 index = row.ind_dispatch_hashval & (new_nbuckets-1); row.ind_dispatch_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -8040,14 +8129,9 @@ void amc::ind_dispatch_Reserve(int n) { // Find row by key. Return NULL if not found. amc::FFunc* amc::ind_func_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_func_buckets_n - 1); - amc::FFunc* *e = &_db.ind_func_buckets_elems[index]; - amc::FFunc* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).func == key; - if (done) break; - e = &ret->ind_func_next; - } while (true); + amc::FFunc *ret = _db.ind_func_buckets_elems[index]; + for (; ret && !((*ret).func == key); ret = ret->ind_func_next) { + } return ret; } @@ -8071,10 +8155,11 @@ amc::FFunc& amc::ind_func_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_func.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_func_InsertMaybe(amc::FFunc& row) { - ind_func_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_func_next == (amc::FFunc*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.func) & (_db.ind_func_buckets_n - 1); + row.ind_func_hashval = algo::Smallstr100_Hash(0, row.func); + ind_func_Reserve(1); + u32 index = row.ind_func_hashval & (_db.ind_func_buckets_n - 1); amc::FFunc* *prev = &_db.ind_func_buckets_elems[index]; do { amc::FFunc* ret = *prev; @@ -8100,7 +8185,7 @@ bool amc::ind_func_InsertMaybe(amc::FFunc& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_func_Remove(amc::FFunc& row) { if (LIKELY(row.ind_func_next != (amc::FFunc*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.func) & (_db.ind_func_buckets_n - 1); + u32 index = row.ind_func_hashval & (_db.ind_func_buckets_n - 1); amc::FFunc* *prev = &_db.ind_func_buckets_elems[index]; // addr of pointer to current element while (amc::FFunc *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -8117,8 +8202,14 @@ void amc::ind_func_Remove(amc::FFunc& row) { // --- amc.FDb.ind_func.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_func_Reserve(int n) { + ind_func_AbsReserve(_db.ind_func_n + n); +} + +// --- amc.FDb.ind_func.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_func_AbsReserve(int n) { u32 old_nbuckets = _db.ind_func_buckets_n; - u32 new_nelems = _db.ind_func_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -8137,7 +8228,7 @@ void amc::ind_func_Reserve(int n) { while (elem) { amc::FFunc &row = *elem; amc::FFunc* next = row.ind_func_next; - u32 index = algo::Smallstr100_Hash(0, row.func) & (new_nbuckets-1); + u32 index = row.ind_func_hashval & (new_nbuckets-1); row.ind_func_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -8154,24 +8245,20 @@ void amc::ind_func_Reserve(int n) { // Find row by key. Return NULL if not found. amc::FField* amc::ind_field_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_field_buckets_n - 1); - amc::FField* *e = &_db.ind_field_buckets_elems[index]; - amc::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + amc::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_field_next) { + } return ret; } // --- amc.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_field_InsertMaybe(amc::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (amc::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::Smallstr100_Hash(0, row.field); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); amc::FField* *prev = &_db.ind_field_buckets_elems[index]; do { amc::FField* ret = *prev; @@ -8197,7 +8284,7 @@ bool amc::ind_field_InsertMaybe(amc::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_field_Remove(amc::FField& row) { if (LIKELY(row.ind_field_next != (amc::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); amc::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (amc::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -8214,8 +8301,14 @@ void amc::ind_field_Remove(amc::FField& row) { // --- amc.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- amc.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -8234,7 +8327,7 @@ void amc::ind_field_Reserve(int n) { while (elem) { amc::FField &row = *elem; amc::FField* next = row.ind_field_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -8251,14 +8344,9 @@ void amc::ind_field_Reserve(int n) { // Find row by key. Return NULL if not found. amc::FNs* amc::ind_ns_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_ns_buckets_n - 1); - amc::FNs* *e = &_db.ind_ns_buckets_elems[index]; - amc::FNs* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ns == key; - if (done) break; - e = &ret->ind_ns_next; - } while (true); + amc::FNs *ret = _db.ind_ns_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_ns_next) { + } return ret; } @@ -8282,10 +8370,11 @@ amc::FNs& amc::ind_ns_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_ns.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_ns_InsertMaybe(amc::FNs& row) { - ind_ns_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ns_next == (amc::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + row.ind_ns_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_ns_Reserve(1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); amc::FNs* *prev = &_db.ind_ns_buckets_elems[index]; do { amc::FNs* ret = *prev; @@ -8311,7 +8400,7 @@ bool amc::ind_ns_InsertMaybe(amc::FNs& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_ns_Remove(amc::FNs& row) { if (LIKELY(row.ind_ns_next != (amc::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); amc::FNs* *prev = &_db.ind_ns_buckets_elems[index]; // addr of pointer to current element while (amc::FNs *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -8328,8 +8417,14 @@ void amc::ind_ns_Remove(amc::FNs& row) { // --- amc.FDb.ind_ns.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_ns_Reserve(int n) { + ind_ns_AbsReserve(_db.ind_ns_n + n); +} + +// --- amc.FDb.ind_ns.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_ns_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ns_buckets_n; - u32 new_nelems = _db.ind_ns_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -8348,7 +8443,7 @@ void amc::ind_ns_Reserve(int n) { while (elem) { amc::FNs &row = *elem; amc::FNs* next = row.ind_ns_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_ns_hashval & (new_nbuckets-1); row.ind_ns_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -8365,14 +8460,9 @@ void amc::ind_ns_Reserve(int n) { // Find row by key. Return NULL if not found. amc::FPnew* amc::ind_pnew_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_pnew_buckets_n - 1); - amc::FPnew* *e = &_db.ind_pnew_buckets_elems[index]; - amc::FPnew* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).pnew == key; - if (done) break; - e = &ret->ind_pnew_next; - } while (true); + amc::FPnew *ret = _db.ind_pnew_buckets_elems[index]; + for (; ret && !((*ret).pnew == key); ret = ret->ind_pnew_next) { + } return ret; } @@ -8396,10 +8486,11 @@ amc::FPnew& amc::ind_pnew_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_pnew.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_pnew_InsertMaybe(amc::FPnew& row) { - ind_pnew_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_pnew_next == (amc::FPnew*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.pnew) & (_db.ind_pnew_buckets_n - 1); + row.ind_pnew_hashval = algo::Smallstr100_Hash(0, row.pnew); + ind_pnew_Reserve(1); + u32 index = row.ind_pnew_hashval & (_db.ind_pnew_buckets_n - 1); amc::FPnew* *prev = &_db.ind_pnew_buckets_elems[index]; do { amc::FPnew* ret = *prev; @@ -8425,7 +8516,7 @@ bool amc::ind_pnew_InsertMaybe(amc::FPnew& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_pnew_Remove(amc::FPnew& row) { if (LIKELY(row.ind_pnew_next != (amc::FPnew*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.pnew) & (_db.ind_pnew_buckets_n - 1); + u32 index = row.ind_pnew_hashval & (_db.ind_pnew_buckets_n - 1); amc::FPnew* *prev = &_db.ind_pnew_buckets_elems[index]; // addr of pointer to current element while (amc::FPnew *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -8442,8 +8533,14 @@ void amc::ind_pnew_Remove(amc::FPnew& row) { // --- amc.FDb.ind_pnew.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_pnew_Reserve(int n) { + ind_pnew_AbsReserve(_db.ind_pnew_n + n); +} + +// --- amc.FDb.ind_pnew.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_pnew_AbsReserve(int n) { u32 old_nbuckets = _db.ind_pnew_buckets_n; - u32 new_nelems = _db.ind_pnew_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -8462,7 +8559,7 @@ void amc::ind_pnew_Reserve(int n) { while (elem) { amc::FPnew &row = *elem; amc::FPnew* next = row.ind_pnew_next; - u32 index = algo::Smallstr100_Hash(0, row.pnew) & (new_nbuckets-1); + u32 index = row.ind_pnew_hashval & (new_nbuckets-1); row.ind_pnew_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -8479,14 +8576,9 @@ void amc::ind_pnew_Reserve(int n) { // Find row by key. Return NULL if not found. amc::FXref* amc::ind_xref_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_xref_buckets_n - 1); - amc::FXref* *e = &_db.ind_xref_buckets_elems[index]; - amc::FXref* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_xref_next; - } while (true); + amc::FXref *ret = _db.ind_xref_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_xref_next) { + } return ret; } @@ -8510,10 +8602,11 @@ amc::FXref& amc::ind_xref_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_xref.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_xref_InsertMaybe(amc::FXref& row) { - ind_xref_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_xref_next == (amc::FXref*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_xref_buckets_n - 1); + row.ind_xref_hashval = algo::Smallstr100_Hash(0, row.field); + ind_xref_Reserve(1); + u32 index = row.ind_xref_hashval & (_db.ind_xref_buckets_n - 1); amc::FXref* *prev = &_db.ind_xref_buckets_elems[index]; do { amc::FXref* ret = *prev; @@ -8539,7 +8632,7 @@ bool amc::ind_xref_InsertMaybe(amc::FXref& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_xref_Remove(amc::FXref& row) { if (LIKELY(row.ind_xref_next != (amc::FXref*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_xref_buckets_n - 1); + u32 index = row.ind_xref_hashval & (_db.ind_xref_buckets_n - 1); amc::FXref* *prev = &_db.ind_xref_buckets_elems[index]; // addr of pointer to current element while (amc::FXref *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -8556,8 +8649,14 @@ void amc::ind_xref_Remove(amc::FXref& row) { // --- amc.FDb.ind_xref.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_xref_Reserve(int n) { + ind_xref_AbsReserve(_db.ind_xref_n + n); +} + +// --- amc.FDb.ind_xref.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_xref_AbsReserve(int n) { u32 old_nbuckets = _db.ind_xref_buckets_n; - u32 new_nelems = _db.ind_xref_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -8576,7 +8675,7 @@ void amc::ind_xref_Reserve(int n) { while (elem) { amc::FXref &row = *elem; amc::FXref* next = row.ind_xref_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_xref_hashval & (new_nbuckets-1); row.ind_xref_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -8708,14 +8807,9 @@ bool amc::cpptype_XrefMaybe(amc::FCpptype &row) { // Find row by key. Return NULL if not found. amc::FCpptype* amc::ind_cpptype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_cpptype_buckets_n - 1); - amc::FCpptype* *e = &_db.ind_cpptype_buckets_elems[index]; - amc::FCpptype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_cpptype_next; - } while (true); + amc::FCpptype *ret = _db.ind_cpptype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_cpptype_next) { + } return ret; } @@ -8739,10 +8833,11 @@ amc::FCpptype& amc::ind_cpptype_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_cpptype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_cpptype_InsertMaybe(amc::FCpptype& row) { - ind_cpptype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_cpptype_next == (amc::FCpptype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_cpptype_buckets_n - 1); + row.ind_cpptype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_cpptype_Reserve(1); + u32 index = row.ind_cpptype_hashval & (_db.ind_cpptype_buckets_n - 1); amc::FCpptype* *prev = &_db.ind_cpptype_buckets_elems[index]; do { amc::FCpptype* ret = *prev; @@ -8768,7 +8863,7 @@ bool amc::ind_cpptype_InsertMaybe(amc::FCpptype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_cpptype_Remove(amc::FCpptype& row) { if (LIKELY(row.ind_cpptype_next != (amc::FCpptype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_cpptype_buckets_n - 1); + u32 index = row.ind_cpptype_hashval & (_db.ind_cpptype_buckets_n - 1); amc::FCpptype* *prev = &_db.ind_cpptype_buckets_elems[index]; // addr of pointer to current element while (amc::FCpptype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -8785,8 +8880,14 @@ void amc::ind_cpptype_Remove(amc::FCpptype& row) { // --- amc.FDb.ind_cpptype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_cpptype_Reserve(int n) { + ind_cpptype_AbsReserve(_db.ind_cpptype_n + n); +} + +// --- amc.FDb.ind_cpptype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_cpptype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_cpptype_buckets_n; - u32 new_nelems = _db.ind_cpptype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -8805,7 +8906,7 @@ void amc::ind_cpptype_Reserve(int n) { while (elem) { amc::FCpptype &row = *elem; amc::FCpptype* next = row.ind_cpptype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_cpptype_hashval & (new_nbuckets-1); row.ind_cpptype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -8933,14 +9034,9 @@ bool amc::inlary_XrefMaybe(amc::FInlary &row) { // Find row by key. Return NULL if not found. amc::FInlary* amc::ind_inlary_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_inlary_buckets_n - 1); - amc::FInlary* *e = &_db.ind_inlary_buckets_elems[index]; - amc::FInlary* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_inlary_next; - } while (true); + amc::FInlary *ret = _db.ind_inlary_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_inlary_next) { + } return ret; } @@ -8964,10 +9060,11 @@ amc::FInlary& amc::ind_inlary_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_inlary.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_inlary_InsertMaybe(amc::FInlary& row) { - ind_inlary_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_inlary_next == (amc::FInlary*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_inlary_buckets_n - 1); + row.ind_inlary_hashval = algo::Smallstr100_Hash(0, row.field); + ind_inlary_Reserve(1); + u32 index = row.ind_inlary_hashval & (_db.ind_inlary_buckets_n - 1); amc::FInlary* *prev = &_db.ind_inlary_buckets_elems[index]; do { amc::FInlary* ret = *prev; @@ -8993,7 +9090,7 @@ bool amc::ind_inlary_InsertMaybe(amc::FInlary& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_inlary_Remove(amc::FInlary& row) { if (LIKELY(row.ind_inlary_next != (amc::FInlary*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_inlary_buckets_n - 1); + u32 index = row.ind_inlary_hashval & (_db.ind_inlary_buckets_n - 1); amc::FInlary* *prev = &_db.ind_inlary_buckets_elems[index]; // addr of pointer to current element while (amc::FInlary *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -9010,8 +9107,14 @@ void amc::ind_inlary_Remove(amc::FInlary& row) { // --- amc.FDb.ind_inlary.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_inlary_Reserve(int n) { + ind_inlary_AbsReserve(_db.ind_inlary_n + n); +} + +// --- amc.FDb.ind_inlary.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_inlary_AbsReserve(int n) { u32 old_nbuckets = _db.ind_inlary_buckets_n; - u32 new_nelems = _db.ind_inlary_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -9030,7 +9133,7 @@ void amc::ind_inlary_Reserve(int n) { while (elem) { amc::FInlary &row = *elem; amc::FInlary* next = row.ind_inlary_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_inlary_hashval & (new_nbuckets-1); row.ind_inlary_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -9162,14 +9265,9 @@ bool amc::tary_XrefMaybe(amc::FTary &row) { // Find row by key. Return NULL if not found. amc::FTary* amc::ind_tary_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_tary_buckets_n - 1); - amc::FTary* *e = &_db.ind_tary_buckets_elems[index]; - amc::FTary* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_tary_next; - } while (true); + amc::FTary *ret = _db.ind_tary_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_tary_next) { + } return ret; } @@ -9193,10 +9291,11 @@ amc::FTary& amc::ind_tary_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_tary.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_tary_InsertMaybe(amc::FTary& row) { - ind_tary_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_tary_next == (amc::FTary*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_tary_buckets_n - 1); + row.ind_tary_hashval = algo::Smallstr100_Hash(0, row.field); + ind_tary_Reserve(1); + u32 index = row.ind_tary_hashval & (_db.ind_tary_buckets_n - 1); amc::FTary* *prev = &_db.ind_tary_buckets_elems[index]; do { amc::FTary* ret = *prev; @@ -9222,7 +9321,7 @@ bool amc::ind_tary_InsertMaybe(amc::FTary& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_tary_Remove(amc::FTary& row) { if (LIKELY(row.ind_tary_next != (amc::FTary*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_tary_buckets_n - 1); + u32 index = row.ind_tary_hashval & (_db.ind_tary_buckets_n - 1); amc::FTary* *prev = &_db.ind_tary_buckets_elems[index]; // addr of pointer to current element while (amc::FTary *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -9239,8 +9338,14 @@ void amc::ind_tary_Remove(amc::FTary& row) { // --- amc.FDb.ind_tary.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_tary_Reserve(int n) { + ind_tary_AbsReserve(_db.ind_tary_n + n); +} + +// --- amc.FDb.ind_tary.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_tary_AbsReserve(int n) { u32 old_nbuckets = _db.ind_tary_buckets_n; - u32 new_nelems = _db.ind_tary_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -9259,7 +9364,7 @@ void amc::ind_tary_Reserve(int n) { while (elem) { amc::FTary &row = *elem; amc::FTary* next = row.ind_tary_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_tary_hashval & (new_nbuckets-1); row.ind_tary_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -9489,14 +9594,9 @@ bool amc::rowid_XrefMaybe(amc::FRowid &row) { // Find row by key. Return NULL if not found. amc::FRowid* amc::ind_rowid_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_rowid_buckets_n - 1); - amc::FRowid* *e = &_db.ind_rowid_buckets_elems[index]; - amc::FRowid* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_rowid_next; - } while (true); + amc::FRowid *ret = _db.ind_rowid_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_rowid_next) { + } return ret; } @@ -9520,10 +9620,11 @@ amc::FRowid& amc::ind_rowid_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_rowid.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_rowid_InsertMaybe(amc::FRowid& row) { - ind_rowid_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_rowid_next == (amc::FRowid*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_rowid_buckets_n - 1); + row.ind_rowid_hashval = algo::Smallstr100_Hash(0, row.field); + ind_rowid_Reserve(1); + u32 index = row.ind_rowid_hashval & (_db.ind_rowid_buckets_n - 1); amc::FRowid* *prev = &_db.ind_rowid_buckets_elems[index]; do { amc::FRowid* ret = *prev; @@ -9549,7 +9650,7 @@ bool amc::ind_rowid_InsertMaybe(amc::FRowid& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_rowid_Remove(amc::FRowid& row) { if (LIKELY(row.ind_rowid_next != (amc::FRowid*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_rowid_buckets_n - 1); + u32 index = row.ind_rowid_hashval & (_db.ind_rowid_buckets_n - 1); amc::FRowid* *prev = &_db.ind_rowid_buckets_elems[index]; // addr of pointer to current element while (amc::FRowid *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -9566,8 +9667,14 @@ void amc::ind_rowid_Remove(amc::FRowid& row) { // --- amc.FDb.ind_rowid.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_rowid_Reserve(int n) { + ind_rowid_AbsReserve(_db.ind_rowid_n + n); +} + +// --- amc.FDb.ind_rowid.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_rowid_AbsReserve(int n) { u32 old_nbuckets = _db.ind_rowid_buckets_n; - u32 new_nelems = _db.ind_rowid_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -9586,7 +9693,7 @@ void amc::ind_rowid_Reserve(int n) { while (elem) { amc::FRowid &row = *elem; amc::FRowid* next = row.ind_rowid_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_rowid_hashval & (new_nbuckets-1); row.ind_rowid_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -10058,14 +10165,9 @@ bool amc::ssimfile_XrefMaybe(amc::FSsimfile &row) { // Find row by key. Return NULL if not found. amc::FSsimfile* amc::ind_ssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimfile_buckets_n - 1); - amc::FSsimfile* *e = &_db.ind_ssimfile_buckets_elems[index]; - amc::FSsimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimfile_next; - } while (true); + amc::FSsimfile *ret = _db.ind_ssimfile_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimfile_next) { + } return ret; } @@ -10089,10 +10191,11 @@ amc::FSsimfile& amc::ind_ssimfile_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_ssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_ssimfile_InsertMaybe(amc::FSsimfile& row) { - ind_ssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimfile_next == (amc::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + row.ind_ssimfile_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimfile_Reserve(1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); amc::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; do { amc::FSsimfile* ret = *prev; @@ -10118,7 +10221,7 @@ bool amc::ind_ssimfile_InsertMaybe(amc::FSsimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_ssimfile_Remove(amc::FSsimfile& row) { if (LIKELY(row.ind_ssimfile_next != (amc::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); amc::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; // addr of pointer to current element while (amc::FSsimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -10135,8 +10238,14 @@ void amc::ind_ssimfile_Remove(amc::FSsimfile& row) { // --- amc.FDb.ind_ssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_ssimfile_Reserve(int n) { + ind_ssimfile_AbsReserve(_db.ind_ssimfile_n + n); +} + +// --- amc.FDb.ind_ssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_ssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimfile_buckets_n; - u32 new_nelems = _db.ind_ssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -10155,7 +10264,7 @@ void amc::ind_ssimfile_Reserve(int n) { while (elem) { amc::FSsimfile &row = *elem; amc::FSsimfile* next = row.ind_ssimfile_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimfile_hashval & (new_nbuckets-1); row.ind_ssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -10287,14 +10396,9 @@ bool amc::pack_XrefMaybe(amc::FPack &row) { // Find row by key. Return NULL if not found. amc::FPack* amc::ind_pack_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_pack_buckets_n - 1); - amc::FPack* *e = &_db.ind_pack_buckets_elems[index]; - amc::FPack* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_pack_next; - } while (true); + amc::FPack *ret = _db.ind_pack_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_pack_next) { + } return ret; } @@ -10318,10 +10422,11 @@ amc::FPack& amc::ind_pack_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_pack.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_pack_InsertMaybe(amc::FPack& row) { - ind_pack_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_pack_next == (amc::FPack*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_pack_buckets_n - 1); + row.ind_pack_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_pack_Reserve(1); + u32 index = row.ind_pack_hashval & (_db.ind_pack_buckets_n - 1); amc::FPack* *prev = &_db.ind_pack_buckets_elems[index]; do { amc::FPack* ret = *prev; @@ -10347,7 +10452,7 @@ bool amc::ind_pack_InsertMaybe(amc::FPack& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_pack_Remove(amc::FPack& row) { if (LIKELY(row.ind_pack_next != (amc::FPack*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_pack_buckets_n - 1); + u32 index = row.ind_pack_hashval & (_db.ind_pack_buckets_n - 1); amc::FPack* *prev = &_db.ind_pack_buckets_elems[index]; // addr of pointer to current element while (amc::FPack *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -10364,8 +10469,14 @@ void amc::ind_pack_Remove(amc::FPack& row) { // --- amc.FDb.ind_pack.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_pack_Reserve(int n) { + ind_pack_AbsReserve(_db.ind_pack_n + n); +} + +// --- amc.FDb.ind_pack.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_pack_AbsReserve(int n) { u32 old_nbuckets = _db.ind_pack_buckets_n; - u32 new_nelems = _db.ind_pack_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -10384,7 +10495,7 @@ void amc::ind_pack_Reserve(int n) { while (elem) { amc::FPack &row = *elem; amc::FPack* next = row.ind_pack_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_pack_hashval & (new_nbuckets-1); row.ind_pack_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -10401,14 +10512,9 @@ void amc::ind_pack_Reserve(int n) { // Find row by key. Return NULL if not found. amc::FSmallstr* amc::ind_smallstr_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_smallstr_buckets_n - 1); - amc::FSmallstr* *e = &_db.ind_smallstr_buckets_elems[index]; - amc::FSmallstr* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_smallstr_next; - } while (true); + amc::FSmallstr *ret = _db.ind_smallstr_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_smallstr_next) { + } return ret; } @@ -10432,10 +10538,11 @@ amc::FSmallstr& amc::ind_smallstr_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_smallstr.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_smallstr_InsertMaybe(amc::FSmallstr& row) { - ind_smallstr_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_smallstr_next == (amc::FSmallstr*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_smallstr_buckets_n - 1); + row.ind_smallstr_hashval = algo::Smallstr100_Hash(0, row.field); + ind_smallstr_Reserve(1); + u32 index = row.ind_smallstr_hashval & (_db.ind_smallstr_buckets_n - 1); amc::FSmallstr* *prev = &_db.ind_smallstr_buckets_elems[index]; do { amc::FSmallstr* ret = *prev; @@ -10461,7 +10568,7 @@ bool amc::ind_smallstr_InsertMaybe(amc::FSmallstr& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_smallstr_Remove(amc::FSmallstr& row) { if (LIKELY(row.ind_smallstr_next != (amc::FSmallstr*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_smallstr_buckets_n - 1); + u32 index = row.ind_smallstr_hashval & (_db.ind_smallstr_buckets_n - 1); amc::FSmallstr* *prev = &_db.ind_smallstr_buckets_elems[index]; // addr of pointer to current element while (amc::FSmallstr *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -10478,8 +10585,14 @@ void amc::ind_smallstr_Remove(amc::FSmallstr& row) { // --- amc.FDb.ind_smallstr.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_smallstr_Reserve(int n) { + ind_smallstr_AbsReserve(_db.ind_smallstr_n + n); +} + +// --- amc.FDb.ind_smallstr.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_smallstr_AbsReserve(int n) { u32 old_nbuckets = _db.ind_smallstr_buckets_n; - u32 new_nelems = _db.ind_smallstr_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -10498,7 +10611,7 @@ void amc::ind_smallstr_Reserve(int n) { while (elem) { amc::FSmallstr &row = *elem; amc::FSmallstr* next = row.ind_smallstr_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_smallstr_hashval & (new_nbuckets-1); row.ind_smallstr_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -10621,14 +10734,9 @@ bool amc::ptrary_XrefMaybe(amc::FPtrary &row) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_ctype_sorted_Insert(amc::FCtype& row) { - // reserve space c_ctype_sorted_Reserve(1); - u32 n = _db.c_ctype_sorted_n; - u32 at = n; - amc::FCtype* *elems = _db.c_ctype_sorted_elems; - elems[at] = &row; - _db.c_ctype_sorted_n = n+1; - + u32 n = _db.c_ctype_sorted_n++; + _db.c_ctype_sorted_elems[n] = &row; } // --- amc.FDb.c_ctype_sorted.ScanInsertMaybe @@ -10657,20 +10765,18 @@ bool amc::c_ctype_sorted_ScanInsertMaybe(amc::FCtype& row) { // --- amc.FDb.c_ctype_sorted.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_ctype_sorted_Remove(amc::FCtype& row) { - int lim = _db.c_ctype_sorted_n; - amc::FCtype* *elems = _db.c_ctype_sorted_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc::FCtype* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FCtype*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - _db.c_ctype_sorted_n = lim - 1; - break; + int n = _db.c_ctype_sorted_n; + int j=0; + for (int i=0; iind_enumstr_len_next; - } while (true); + amc::FEnumstrLen *ret = _db.ind_enumstr_len_buckets_elems[index]; + for (; ret && !((*ret).len == key); ret = ret->ind_enumstr_len_next) { + } return ret; } @@ -11251,10 +11352,11 @@ amc::FEnumstrLen& amc::ind_enumstr_len_GetOrCreate(i32 key) { // --- amc.FDb.ind_enumstr_len.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_enumstr_len_InsertMaybe(amc::FEnumstrLen& row) { - ind_enumstr_len_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_enumstr_len_next == (amc::FEnumstrLen*)-1)) {// check if in hash already - u32 index = ::i32_Hash(0, row.len) & (_db.ind_enumstr_len_buckets_n - 1); + row.ind_enumstr_len_hashval = ::i32_Hash(0, row.len); + ind_enumstr_len_Reserve(1); + u32 index = row.ind_enumstr_len_hashval & (_db.ind_enumstr_len_buckets_n - 1); amc::FEnumstrLen* *prev = &_db.ind_enumstr_len_buckets_elems[index]; do { amc::FEnumstrLen* ret = *prev; @@ -11280,7 +11382,7 @@ bool amc::ind_enumstr_len_InsertMaybe(amc::FEnumstrLen& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_enumstr_len_Remove(amc::FEnumstrLen& row) { if (LIKELY(row.ind_enumstr_len_next != (amc::FEnumstrLen*)-1)) {// check if in hash already - u32 index = ::i32_Hash(0, row.len) & (_db.ind_enumstr_len_buckets_n - 1); + u32 index = row.ind_enumstr_len_hashval & (_db.ind_enumstr_len_buckets_n - 1); amc::FEnumstrLen* *prev = &_db.ind_enumstr_len_buckets_elems[index]; // addr of pointer to current element while (amc::FEnumstrLen *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -11297,8 +11399,14 @@ void amc::ind_enumstr_len_Remove(amc::FEnumstrLen& row) { // --- amc.FDb.ind_enumstr_len.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_enumstr_len_Reserve(int n) { + ind_enumstr_len_AbsReserve(_db.ind_enumstr_len_n + n); +} + +// --- amc.FDb.ind_enumstr_len.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_enumstr_len_AbsReserve(int n) { u32 old_nbuckets = _db.ind_enumstr_len_buckets_n; - u32 new_nelems = _db.ind_enumstr_len_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -11317,7 +11425,7 @@ void amc::ind_enumstr_len_Reserve(int n) { while (elem) { amc::FEnumstrLen &row = *elem; amc::FEnumstrLen* next = row.ind_enumstr_len_next; - u32 index = ::i32_Hash(0, row.len) & (new_nbuckets-1); + u32 index = row.ind_enumstr_len_hashval & (new_nbuckets-1); row.ind_enumstr_len_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -11334,14 +11442,9 @@ void amc::ind_enumstr_len_Reserve(int n) { // Find row by key. Return NULL if not found. amc::FEnumstr* amc::ind_enumstr_Find(const amc::Enumstr& key) { u32 index = amc::Enumstr_Hash(0, key) & (_db.ind_enumstr_buckets_n - 1); - amc::FEnumstr* *e = &_db.ind_enumstr_buckets_elems[index]; - amc::FEnumstr* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).enumstr == key; - if (done) break; - e = &ret->ind_enumstr_next; - } while (true); + amc::FEnumstr *ret = _db.ind_enumstr_buckets_elems[index]; + for (; ret && !((*ret).enumstr == key); ret = ret->ind_enumstr_next) { + } return ret; } @@ -11365,10 +11468,11 @@ amc::FEnumstr& amc::ind_enumstr_GetOrCreate(const amc::Enumstr& key) { // --- amc.FDb.ind_enumstr.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_enumstr_InsertMaybe(amc::FEnumstr& row) { - ind_enumstr_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_enumstr_next == (amc::FEnumstr*)-1)) {// check if in hash already - u32 index = amc::Enumstr_Hash(0, row.enumstr) & (_db.ind_enumstr_buckets_n - 1); + row.ind_enumstr_hashval = amc::Enumstr_Hash(0, row.enumstr); + ind_enumstr_Reserve(1); + u32 index = row.ind_enumstr_hashval & (_db.ind_enumstr_buckets_n - 1); amc::FEnumstr* *prev = &_db.ind_enumstr_buckets_elems[index]; do { amc::FEnumstr* ret = *prev; @@ -11394,7 +11498,7 @@ bool amc::ind_enumstr_InsertMaybe(amc::FEnumstr& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_enumstr_Remove(amc::FEnumstr& row) { if (LIKELY(row.ind_enumstr_next != (amc::FEnumstr*)-1)) {// check if in hash already - u32 index = amc::Enumstr_Hash(0, row.enumstr) & (_db.ind_enumstr_buckets_n - 1); + u32 index = row.ind_enumstr_hashval & (_db.ind_enumstr_buckets_n - 1); amc::FEnumstr* *prev = &_db.ind_enumstr_buckets_elems[index]; // addr of pointer to current element while (amc::FEnumstr *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -11411,8 +11515,14 @@ void amc::ind_enumstr_Remove(amc::FEnumstr& row) { // --- amc.FDb.ind_enumstr.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_enumstr_Reserve(int n) { + ind_enumstr_AbsReserve(_db.ind_enumstr_n + n); +} + +// --- amc.FDb.ind_enumstr.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_enumstr_AbsReserve(int n) { u32 old_nbuckets = _db.ind_enumstr_buckets_n; - u32 new_nelems = _db.ind_enumstr_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -11431,7 +11541,7 @@ void amc::ind_enumstr_Reserve(int n) { while (elem) { amc::FEnumstr &row = *elem; amc::FEnumstr* next = row.ind_enumstr_next; - u32 index = amc::Enumstr_Hash(0, row.enumstr) & (new_nbuckets-1); + u32 index = row.ind_enumstr_hashval & (new_nbuckets-1); row.ind_enumstr_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -11563,14 +11673,9 @@ bool amc::fbitset_XrefMaybe(amc::FFbitset &row) { // Find row by key. Return NULL if not found. amc::FFbitset* amc::ind_fbitset_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_fbitset_buckets_n - 1); - amc::FFbitset* *e = &_db.ind_fbitset_buckets_elems[index]; - amc::FFbitset* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_fbitset_next; - } while (true); + amc::FFbitset *ret = _db.ind_fbitset_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_fbitset_next) { + } return ret; } @@ -11594,10 +11699,11 @@ amc::FFbitset& amc::ind_fbitset_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_fbitset.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_fbitset_InsertMaybe(amc::FFbitset& row) { - ind_fbitset_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fbitset_next == (amc::FFbitset*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_fbitset_buckets_n - 1); + row.ind_fbitset_hashval = algo::Smallstr100_Hash(0, row.field); + ind_fbitset_Reserve(1); + u32 index = row.ind_fbitset_hashval & (_db.ind_fbitset_buckets_n - 1); amc::FFbitset* *prev = &_db.ind_fbitset_buckets_elems[index]; do { amc::FFbitset* ret = *prev; @@ -11623,7 +11729,7 @@ bool amc::ind_fbitset_InsertMaybe(amc::FFbitset& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_fbitset_Remove(amc::FFbitset& row) { if (LIKELY(row.ind_fbitset_next != (amc::FFbitset*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_fbitset_buckets_n - 1); + u32 index = row.ind_fbitset_hashval & (_db.ind_fbitset_buckets_n - 1); amc::FFbitset* *prev = &_db.ind_fbitset_buckets_elems[index]; // addr of pointer to current element while (amc::FFbitset *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -11640,8 +11746,14 @@ void amc::ind_fbitset_Remove(amc::FFbitset& row) { // --- amc.FDb.ind_fbitset.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_fbitset_Reserve(int n) { + ind_fbitset_AbsReserve(_db.ind_fbitset_n + n); +} + +// --- amc.FDb.ind_fbitset.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_fbitset_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fbitset_buckets_n; - u32 new_nelems = _db.ind_fbitset_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -11660,7 +11772,7 @@ void amc::ind_fbitset_Reserve(int n) { while (elem) { amc::FFbitset &row = *elem; amc::FFbitset* next = row.ind_fbitset_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_fbitset_hashval & (new_nbuckets-1); row.ind_fbitset_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -11898,14 +12010,9 @@ bool amc::fdec_XrefMaybe(amc::FFdec &row) { // Find row by key. Return NULL if not found. amc::FFdec* amc::ind_fdec_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_fdec_buckets_n - 1); - amc::FFdec* *e = &_db.ind_fdec_buckets_elems[index]; - amc::FFdec* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_fdec_next; - } while (true); + amc::FFdec *ret = _db.ind_fdec_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_fdec_next) { + } return ret; } @@ -11929,10 +12036,11 @@ amc::FFdec& amc::ind_fdec_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_fdec.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_fdec_InsertMaybe(amc::FFdec& row) { - ind_fdec_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fdec_next == (amc::FFdec*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_fdec_buckets_n - 1); + row.ind_fdec_hashval = algo::Smallstr100_Hash(0, row.field); + ind_fdec_Reserve(1); + u32 index = row.ind_fdec_hashval & (_db.ind_fdec_buckets_n - 1); amc::FFdec* *prev = &_db.ind_fdec_buckets_elems[index]; do { amc::FFdec* ret = *prev; @@ -11958,7 +12066,7 @@ bool amc::ind_fdec_InsertMaybe(amc::FFdec& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_fdec_Remove(amc::FFdec& row) { if (LIKELY(row.ind_fdec_next != (amc::FFdec*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_fdec_buckets_n - 1); + u32 index = row.ind_fdec_hashval & (_db.ind_fdec_buckets_n - 1); amc::FFdec* *prev = &_db.ind_fdec_buckets_elems[index]; // addr of pointer to current element while (amc::FFdec *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -11975,8 +12083,14 @@ void amc::ind_fdec_Remove(amc::FFdec& row) { // --- amc.FDb.ind_fdec.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_fdec_Reserve(int n) { + ind_fdec_AbsReserve(_db.ind_fdec_n + n); +} + +// --- amc.FDb.ind_fdec.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_fdec_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fdec_buckets_n; - u32 new_nelems = _db.ind_fdec_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -11995,7 +12109,7 @@ void amc::ind_fdec_Reserve(int n) { while (elem) { amc::FFdec &row = *elem; amc::FFdec* next = row.ind_fdec_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_fdec_hashval & (new_nbuckets-1); row.ind_fdec_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -12012,14 +12126,9 @@ void amc::ind_fdec_Reserve(int n) { // Find row by key. Return NULL if not found. amc::FReftype* amc::ind_reftype_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_reftype_buckets_n - 1); - amc::FReftype* *e = &_db.ind_reftype_buckets_elems[index]; - amc::FReftype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).reftype == key; - if (done) break; - e = &ret->ind_reftype_next; - } while (true); + amc::FReftype *ret = _db.ind_reftype_buckets_elems[index]; + for (; ret && !((*ret).reftype == key); ret = ret->ind_reftype_next) { + } return ret; } @@ -12043,10 +12152,11 @@ amc::FReftype& amc::ind_reftype_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_reftype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_reftype_InsertMaybe(amc::FReftype& row) { - ind_reftype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_reftype_next == (amc::FReftype*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.reftype) & (_db.ind_reftype_buckets_n - 1); + row.ind_reftype_hashval = algo::Smallstr50_Hash(0, row.reftype); + ind_reftype_Reserve(1); + u32 index = row.ind_reftype_hashval & (_db.ind_reftype_buckets_n - 1); amc::FReftype* *prev = &_db.ind_reftype_buckets_elems[index]; do { amc::FReftype* ret = *prev; @@ -12072,7 +12182,7 @@ bool amc::ind_reftype_InsertMaybe(amc::FReftype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_reftype_Remove(amc::FReftype& row) { if (LIKELY(row.ind_reftype_next != (amc::FReftype*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.reftype) & (_db.ind_reftype_buckets_n - 1); + u32 index = row.ind_reftype_hashval & (_db.ind_reftype_buckets_n - 1); amc::FReftype* *prev = &_db.ind_reftype_buckets_elems[index]; // addr of pointer to current element while (amc::FReftype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -12089,8 +12199,14 @@ void amc::ind_reftype_Remove(amc::FReftype& row) { // --- amc.FDb.ind_reftype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_reftype_Reserve(int n) { + ind_reftype_AbsReserve(_db.ind_reftype_n + n); +} + +// --- amc.FDb.ind_reftype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_reftype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_reftype_buckets_n; - u32 new_nelems = _db.ind_reftype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -12109,7 +12225,7 @@ void amc::ind_reftype_Reserve(int n) { while (elem) { amc::FReftype &row = *elem; amc::FReftype* next = row.ind_reftype_next; - u32 index = algo::Smallstr50_Hash(0, row.reftype) & (new_nbuckets-1); + u32 index = row.ind_reftype_hashval & (new_nbuckets-1); row.ind_reftype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -12236,14 +12352,9 @@ bool amc::fconst_XrefMaybe(amc::FFconst &row) { // Find row by key. Return NULL if not found. amc::FFconst* amc::ind_fconst_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_fconst_buckets_n - 1); - amc::FFconst* *e = &_db.ind_fconst_buckets_elems[index]; - amc::FFconst* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).fconst == key; - if (done) break; - e = &ret->ind_fconst_next; - } while (true); + amc::FFconst *ret = _db.ind_fconst_buckets_elems[index]; + for (; ret && !((*ret).fconst == key); ret = ret->ind_fconst_next) { + } return ret; } @@ -12267,10 +12378,11 @@ amc::FFconst& amc::ind_fconst_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_fconst.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_fconst_InsertMaybe(amc::FFconst& row) { - ind_fconst_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fconst_next == (amc::FFconst*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.fconst) & (_db.ind_fconst_buckets_n - 1); + row.ind_fconst_hashval = algo::Smallstr100_Hash(0, row.fconst); + ind_fconst_Reserve(1); + u32 index = row.ind_fconst_hashval & (_db.ind_fconst_buckets_n - 1); amc::FFconst* *prev = &_db.ind_fconst_buckets_elems[index]; do { amc::FFconst* ret = *prev; @@ -12296,7 +12408,7 @@ bool amc::ind_fconst_InsertMaybe(amc::FFconst& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_fconst_Remove(amc::FFconst& row) { if (LIKELY(row.ind_fconst_next != (amc::FFconst*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.fconst) & (_db.ind_fconst_buckets_n - 1); + u32 index = row.ind_fconst_hashval & (_db.ind_fconst_buckets_n - 1); amc::FFconst* *prev = &_db.ind_fconst_buckets_elems[index]; // addr of pointer to current element while (amc::FFconst *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -12313,8 +12425,14 @@ void amc::ind_fconst_Remove(amc::FFconst& row) { // --- amc.FDb.ind_fconst.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_fconst_Reserve(int n) { + ind_fconst_AbsReserve(_db.ind_fconst_n + n); +} + +// --- amc.FDb.ind_fconst.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_fconst_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fconst_buckets_n; - u32 new_nelems = _db.ind_fconst_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -12333,7 +12451,7 @@ void amc::ind_fconst_Reserve(int n) { while (elem) { amc::FFconst &row = *elem; amc::FFconst* next = row.ind_fconst_next; - u32 index = algo::Smallstr100_Hash(0, row.fconst) & (new_nbuckets-1); + u32 index = row.ind_fconst_hashval & (new_nbuckets-1); row.ind_fconst_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -12350,14 +12468,9 @@ void amc::ind_fconst_Reserve(int n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_ns_sorted_Insert(amc::FNs& row) { - // reserve space c_ns_sorted_Reserve(1); - u32 n = _db.c_ns_sorted_n; - u32 at = n; - amc::FNs* *elems = _db.c_ns_sorted_elems; - elems[at] = &row; - _db.c_ns_sorted_n = n+1; - + u32 n = _db.c_ns_sorted_n++; + _db.c_ns_sorted_elems[n] = &row; } // --- amc.FDb.c_ns_sorted.ScanInsertMaybe @@ -12386,20 +12499,18 @@ bool amc::c_ns_sorted_ScanInsertMaybe(amc::FNs& row) { // --- amc.FDb.c_ns_sorted.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_ns_sorted_Remove(amc::FNs& row) { - int lim = _db.c_ns_sorted_n; - amc::FNs* *elems = _db.c_ns_sorted_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc::FNs* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FNs*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - _db.c_ns_sorted_n = lim - 1; - break; + int n = _db.c_ns_sorted_n; + int j=0; + for (int i=0; iind_fbuf_next; - } while (true); + amc::FFbuf *ret = _db.ind_fbuf_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_fbuf_next) { + } return ret; } @@ -12809,10 +12915,11 @@ amc::FFbuf& amc::ind_fbuf_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_fbuf.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_fbuf_InsertMaybe(amc::FFbuf& row) { - ind_fbuf_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fbuf_next == (amc::FFbuf*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_fbuf_buckets_n - 1); + row.ind_fbuf_hashval = algo::Smallstr100_Hash(0, row.field); + ind_fbuf_Reserve(1); + u32 index = row.ind_fbuf_hashval & (_db.ind_fbuf_buckets_n - 1); amc::FFbuf* *prev = &_db.ind_fbuf_buckets_elems[index]; do { amc::FFbuf* ret = *prev; @@ -12838,7 +12945,7 @@ bool amc::ind_fbuf_InsertMaybe(amc::FFbuf& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_fbuf_Remove(amc::FFbuf& row) { if (LIKELY(row.ind_fbuf_next != (amc::FFbuf*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_fbuf_buckets_n - 1); + u32 index = row.ind_fbuf_hashval & (_db.ind_fbuf_buckets_n - 1); amc::FFbuf* *prev = &_db.ind_fbuf_buckets_elems[index]; // addr of pointer to current element while (amc::FFbuf *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -12855,8 +12962,14 @@ void amc::ind_fbuf_Remove(amc::FFbuf& row) { // --- amc.FDb.ind_fbuf.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_fbuf_Reserve(int n) { + ind_fbuf_AbsReserve(_db.ind_fbuf_n + n); +} + +// --- amc.FDb.ind_fbuf.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_fbuf_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fbuf_buckets_n; - u32 new_nelems = _db.ind_fbuf_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -12875,7 +12988,7 @@ void amc::ind_fbuf_Reserve(int n) { while (elem) { amc::FFbuf &row = *elem; amc::FFbuf* next = row.ind_fbuf_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_fbuf_hashval & (new_nbuckets-1); row.ind_fbuf_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -13003,14 +13116,9 @@ bool amc::chash_XrefMaybe(amc::FChash &row) { // Find row by key. Return NULL if not found. amc::FChash* amc::ind_chash_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_chash_buckets_n - 1); - amc::FChash* *e = &_db.ind_chash_buckets_elems[index]; - amc::FChash* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_chash_next; - } while (true); + amc::FChash *ret = _db.ind_chash_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_chash_next) { + } return ret; } @@ -13034,10 +13142,11 @@ amc::FChash& amc::ind_chash_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_chash.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_chash_InsertMaybe(amc::FChash& row) { - ind_chash_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_chash_next == (amc::FChash*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_chash_buckets_n - 1); + row.ind_chash_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_chash_Reserve(1); + u32 index = row.ind_chash_hashval & (_db.ind_chash_buckets_n - 1); amc::FChash* *prev = &_db.ind_chash_buckets_elems[index]; do { amc::FChash* ret = *prev; @@ -13063,7 +13172,7 @@ bool amc::ind_chash_InsertMaybe(amc::FChash& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_chash_Remove(amc::FChash& row) { if (LIKELY(row.ind_chash_next != (amc::FChash*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_chash_buckets_n - 1); + u32 index = row.ind_chash_hashval & (_db.ind_chash_buckets_n - 1); amc::FChash* *prev = &_db.ind_chash_buckets_elems[index]; // addr of pointer to current element while (amc::FChash *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -13080,8 +13189,14 @@ void amc::ind_chash_Remove(amc::FChash& row) { // --- amc.FDb.ind_chash.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_chash_Reserve(int n) { + ind_chash_AbsReserve(_db.ind_chash_n + n); +} + +// --- amc.FDb.ind_chash.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_chash_AbsReserve(int n) { u32 old_nbuckets = _db.ind_chash_buckets_n; - u32 new_nelems = _db.ind_chash_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -13100,7 +13215,7 @@ void amc::ind_chash_Reserve(int n) { while (elem) { amc::FChash &row = *elem; amc::FChash* next = row.ind_chash_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_chash_hashval & (new_nbuckets-1); row.ind_chash_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -13228,14 +13343,9 @@ bool amc::ccmp_XrefMaybe(amc::FCcmp &row) { // Find row by key. Return NULL if not found. amc::FCcmp* amc::ind_ccmp_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ccmp_buckets_n - 1); - amc::FCcmp* *e = &_db.ind_ccmp_buckets_elems[index]; - amc::FCcmp* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ccmp_next; - } while (true); + amc::FCcmp *ret = _db.ind_ccmp_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ccmp_next) { + } return ret; } @@ -13259,10 +13369,11 @@ amc::FCcmp& amc::ind_ccmp_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_ccmp.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_ccmp_InsertMaybe(amc::FCcmp& row) { - ind_ccmp_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ccmp_next == (amc::FCcmp*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ccmp_buckets_n - 1); + row.ind_ccmp_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ccmp_Reserve(1); + u32 index = row.ind_ccmp_hashval & (_db.ind_ccmp_buckets_n - 1); amc::FCcmp* *prev = &_db.ind_ccmp_buckets_elems[index]; do { amc::FCcmp* ret = *prev; @@ -13288,7 +13399,7 @@ bool amc::ind_ccmp_InsertMaybe(amc::FCcmp& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_ccmp_Remove(amc::FCcmp& row) { if (LIKELY(row.ind_ccmp_next != (amc::FCcmp*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ccmp_buckets_n - 1); + u32 index = row.ind_ccmp_hashval & (_db.ind_ccmp_buckets_n - 1); amc::FCcmp* *prev = &_db.ind_ccmp_buckets_elems[index]; // addr of pointer to current element while (amc::FCcmp *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -13305,8 +13416,14 @@ void amc::ind_ccmp_Remove(amc::FCcmp& row) { // --- amc.FDb.ind_ccmp.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_ccmp_Reserve(int n) { + ind_ccmp_AbsReserve(_db.ind_ccmp_n + n); +} + +// --- amc.FDb.ind_ccmp.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_ccmp_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ccmp_buckets_n; - u32 new_nelems = _db.ind_ccmp_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -13325,7 +13442,7 @@ void amc::ind_ccmp_Reserve(int n) { while (elem) { amc::FCcmp &row = *elem; amc::FCcmp* next = row.ind_ccmp_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ccmp_hashval & (new_nbuckets-1); row.ind_ccmp_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -13709,14 +13826,9 @@ bool amc::listtype_XrefMaybe(amc::FListtype &row) { // Find row by key. Return NULL if not found. amc::FListtype* amc::ind_listtype_Find(const algo::strptr& key) { u32 index = algo::Smallstr5_Hash(0, key) & (_db.ind_listtype_buckets_n - 1); - amc::FListtype* *e = &_db.ind_listtype_buckets_elems[index]; - amc::FListtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).listtype == key; - if (done) break; - e = &ret->ind_listtype_next; - } while (true); + amc::FListtype *ret = _db.ind_listtype_buckets_elems[index]; + for (; ret && !((*ret).listtype == key); ret = ret->ind_listtype_next) { + } return ret; } @@ -13740,10 +13852,11 @@ amc::FListtype& amc::ind_listtype_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_listtype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_listtype_InsertMaybe(amc::FListtype& row) { - ind_listtype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_listtype_next == (amc::FListtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr5_Hash(0, row.listtype) & (_db.ind_listtype_buckets_n - 1); + row.ind_listtype_hashval = algo::Smallstr5_Hash(0, row.listtype); + ind_listtype_Reserve(1); + u32 index = row.ind_listtype_hashval & (_db.ind_listtype_buckets_n - 1); amc::FListtype* *prev = &_db.ind_listtype_buckets_elems[index]; do { amc::FListtype* ret = *prev; @@ -13769,7 +13882,7 @@ bool amc::ind_listtype_InsertMaybe(amc::FListtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_listtype_Remove(amc::FListtype& row) { if (LIKELY(row.ind_listtype_next != (amc::FListtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr5_Hash(0, row.listtype) & (_db.ind_listtype_buckets_n - 1); + u32 index = row.ind_listtype_hashval & (_db.ind_listtype_buckets_n - 1); amc::FListtype* *prev = &_db.ind_listtype_buckets_elems[index]; // addr of pointer to current element while (amc::FListtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -13786,8 +13899,14 @@ void amc::ind_listtype_Remove(amc::FListtype& row) { // --- amc.FDb.ind_listtype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_listtype_Reserve(int n) { + ind_listtype_AbsReserve(_db.ind_listtype_n + n); +} + +// --- amc.FDb.ind_listtype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_listtype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_listtype_buckets_n; - u32 new_nelems = _db.ind_listtype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -13806,7 +13925,7 @@ void amc::ind_listtype_Reserve(int n) { while (elem) { amc::FListtype &row = *elem; amc::FListtype* next = row.ind_listtype_next; - u32 index = algo::Smallstr5_Hash(0, row.listtype) & (new_nbuckets-1); + u32 index = row.ind_listtype_hashval & (new_nbuckets-1); row.ind_listtype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -13913,6 +14032,15 @@ bool amc::fstep_XrefMaybe(amc::FFstep &row) { if (true) { // user-defined insert condition row.p_field = p_field; } + amc::FSteptype* p_steptype = amc::ind_steptype_Find(row.steptype); + if (UNLIKELY(!p_steptype)) { + algo_lib::ResetErrtext() << "amc.bad_xref index:amc.FDb.ind_steptype" << Keyval("key", row.steptype); + return false; + } + // fstep: save pointer to steptype + if (true) { // user-defined insert condition + row.p_steptype = p_steptype; + } // insert fstep into index c_fstep if (true) { // user-defined insert condition bool success = c_fstep_InsertMaybe(*p_field, row); @@ -14257,14 +14385,9 @@ bool amc::disptrace_XrefMaybe(amc::FDisptrace &row) { // Find row by key. Return NULL if not found. amc::FFstep* amc::ind_fstep_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_fstep_buckets_n - 1); - amc::FFstep* *e = &_db.ind_fstep_buckets_elems[index]; - amc::FFstep* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).fstep == key; - if (done) break; - e = &ret->ind_fstep_next; - } while (true); + amc::FFstep *ret = _db.ind_fstep_buckets_elems[index]; + for (; ret && !((*ret).fstep == key); ret = ret->ind_fstep_next) { + } return ret; } @@ -14288,10 +14411,11 @@ amc::FFstep& amc::ind_fstep_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_fstep.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_fstep_InsertMaybe(amc::FFstep& row) { - ind_fstep_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fstep_next == (amc::FFstep*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.fstep) & (_db.ind_fstep_buckets_n - 1); + row.ind_fstep_hashval = algo::Smallstr100_Hash(0, row.fstep); + ind_fstep_Reserve(1); + u32 index = row.ind_fstep_hashval & (_db.ind_fstep_buckets_n - 1); amc::FFstep* *prev = &_db.ind_fstep_buckets_elems[index]; do { amc::FFstep* ret = *prev; @@ -14317,7 +14441,7 @@ bool amc::ind_fstep_InsertMaybe(amc::FFstep& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_fstep_Remove(amc::FFstep& row) { if (LIKELY(row.ind_fstep_next != (amc::FFstep*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.fstep) & (_db.ind_fstep_buckets_n - 1); + u32 index = row.ind_fstep_hashval & (_db.ind_fstep_buckets_n - 1); amc::FFstep* *prev = &_db.ind_fstep_buckets_elems[index]; // addr of pointer to current element while (amc::FFstep *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -14334,8 +14458,14 @@ void amc::ind_fstep_Remove(amc::FFstep& row) { // --- amc.FDb.ind_fstep.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_fstep_Reserve(int n) { + ind_fstep_AbsReserve(_db.ind_fstep_n + n); +} + +// --- amc.FDb.ind_fstep.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_fstep_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fstep_buckets_n; - u32 new_nelems = _db.ind_fstep_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -14354,7 +14484,7 @@ void amc::ind_fstep_Reserve(int n) { while (elem) { amc::FFstep &row = *elem; amc::FFstep* next = row.ind_fstep_next; - u32 index = algo::Smallstr100_Hash(0, row.fstep) & (new_nbuckets-1); + u32 index = row.ind_fstep_hashval & (new_nbuckets-1); row.ind_fstep_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -14449,21 +14579,6 @@ void amc::tracefld_RemoveLast() { } } -// --- amc.FDb.tracefld.SaveSsimfile -// Save table to ssimfile -bool amc::tracefld_SaveSsimfile(algo::strptr fname) { - cstring text; - ind_beg(amc::_db_tracefld_curs, tracefld, amc::_db) { - dmmeta::Tracefld out; - tracefld_CopyOut(tracefld, out); - dmmeta::Tracefld_Print(out, text); - text << eol; - }ind_end; - (void)algo::CreateDirRecurse(algo::GetDirName(fname)); - // it is a silent error if the file cannot be saved. - return algo::SafeStringToFile(text, fname); -} - // --- amc.FDb.tracefld.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. @@ -14555,21 +14670,6 @@ void amc::tracerec_RemoveLast() { } } -// --- amc.FDb.tracerec.SaveSsimfile -// Save table to ssimfile -bool amc::tracerec_SaveSsimfile(algo::strptr fname) { - cstring text; - ind_beg(amc::_db_tracerec_curs, tracerec, amc::_db) { - dmmeta::Tracerec out; - tracerec_CopyOut(tracerec, out); - dmmeta::Tracerec_Print(out, text); - text << eol; - }ind_end; - (void)algo::CreateDirRecurse(algo::GetDirName(fname)); - // it is a silent error if the file cannot be saved. - return algo::SafeStringToFile(text, fname); -} - // --- amc.FDb.tracerec.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. @@ -14667,10 +14767,6 @@ void amc::dispsig_RemoveLast() { bool amc::dispsig_XrefMaybe(amc::FDispsig &row) { bool retval = true; (void)row; - // insert dispsig into index c_dispsig_sorted - if (true) { // user-defined insert condition - c_dispsig_sorted_Insert(row); - } amc::FNs* p_ns = amc::ind_ns_Find(ns_Get(row)); if (UNLIKELY(!p_ns)) { algo_lib::ResetErrtext() << "amc.bad_xref index:amc.FDb.ind_ns" << Keyval("key", ns_Get(row)); @@ -14683,251 +14779,6 @@ bool amc::dispsig_XrefMaybe(amc::FDispsig &row) { return retval; } -// --- amc.FDb.c_dispsig_sorted.Insert -// Insert pointer to row into array. Row must not already be in array. -// If pointer is already in the array, it may be inserted twice. -void amc::c_dispsig_sorted_Insert(amc::FDispsig& row) { - if (bool_Update(row._db_c_dispsig_sorted_in_ary,true)) { - // reserve space - c_dispsig_sorted_Reserve(1); - u32 n = _db.c_dispsig_sorted_n; - u32 at = n; - amc::FDispsig* *elems = _db.c_dispsig_sorted_elems; - elems[at] = &row; - _db.c_dispsig_sorted_n = n+1; - - } -} - -// --- amc.FDb.c_dispsig_sorted.InsertMaybe -// Insert pointer to row in array. -// If row is already in the array, do nothing. -// Return value: whether element was inserted into array. -bool amc::c_dispsig_sorted_InsertMaybe(amc::FDispsig& row) { - bool retval = !row._db_c_dispsig_sorted_in_ary; - c_dispsig_sorted_Insert(row); // check is performed in _Insert again - return retval; -} - -// --- amc.FDb.c_dispsig_sorted.Remove -// Find element using linear scan. If element is in array, remove, otherwise do nothing -void amc::c_dispsig_sorted_Remove(amc::FDispsig& row) { - if (bool_Update(row._db_c_dispsig_sorted_in_ary,false)) { - int lim = _db.c_dispsig_sorted_n; - amc::FDispsig* *elems = _db.c_dispsig_sorted_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc::FDispsig* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FDispsig*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - _db.c_dispsig_sorted_n = lim - 1; - break; - } - } - } -} - -// --- amc.FDb.c_dispsig_sorted.Reserve -// Reserve space in index for N more elements; -void amc::c_dispsig_sorted_Reserve(u32 n) { - u32 old_max = _db.c_dispsig_sorted_max; - if (UNLIKELY(_db.c_dispsig_sorted_n + n > old_max)) { - u32 new_max = u32_Max(4, old_max * 2); - u32 old_size = old_max * sizeof(amc::FDispsig*); - u32 new_size = new_max * sizeof(amc::FDispsig*); - void *new_mem = amc::lpool_ReallocMem(_db.c_dispsig_sorted_elems, old_size, new_size); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("amc.out_of_memory field:amc.FDb.c_dispsig_sorted"); - } - _db.c_dispsig_sorted_elems = (amc::FDispsig**)new_mem; - _db.c_dispsig_sorted_max = new_max; - } -} - -// --- amc.FDb.c_dispsig_sorted.Swap -// Swap values elem_a and elem_b -inline static void amc::c_dispsig_sorted_Swap(amc::FDispsig* &elem_a, amc::FDispsig* &elem_b) { - amc::FDispsig *temp = elem_a; - elem_a = elem_b; - elem_b = temp; -} - -// --- amc.FDb.c_dispsig_sorted.Rotleft -// Left circular shift of three-tuple -inline static void amc::c_dispsig_sorted_Rotleft(amc::FDispsig* &elem_a, amc::FDispsig* &elem_b, amc::FDispsig* &elem_c) { - amc::FDispsig *temp = elem_a; - elem_a = elem_b; - elem_b = elem_c; - elem_c = temp; -} - -// --- amc.FDb.c_dispsig_sorted.Lt -// Compare values elem_a and elem_b -// The comparison function must be anti-symmetric: if a>b, then !(b>a). -// If not, mayhem results. -static bool amc::c_dispsig_sorted_Lt(amc::FDispsig &elem_a, amc::FDispsig &elem_b) { - bool ret; - ret = elem_a.dispsig < elem_b.dispsig; - return ret; -} - -// --- amc.FDb.c_dispsig_sorted.SortedQ -// Verify whether array is sorted -bool amc::c_dispsig_sorted_SortedQ() { - amc::FDispsig* *elems = c_dispsig_sorted_Getary().elems; - int n = c_dispsig_sorted_N(); - for (int i = 1; i < n; i++) { - if (c_dispsig_sorted_Lt(*elems[i], *elems[i-1])) { - return false; - } - } - return true; -} - -// --- amc.FDb.c_dispsig_sorted.IntInsertionSort -// Internal insertion sort -static void amc::c_dispsig_sorted_IntInsertionSort(amc::FDispsig* *elems, int n) { - for (int i = 1; i < n; ++i) { - int j = i; - amc::FDispsig *tmp = elems[i]; - // shift elements up by one - if (c_dispsig_sorted_Lt(*tmp, *elems[j-1])) { - do { - elems[j] = elems[j-1]; - j--; - } while (j>0 && c_dispsig_sorted_Lt(*tmp, *elems[j-1])); - elems[j] = tmp; - } - } -} - -// --- amc.FDb.c_dispsig_sorted.IntHeapSort -// Internal heap sort -static void amc::c_dispsig_sorted_IntHeapSort(amc::FDispsig* *elems, int n) { - // construct max-heap. - // k=current element - // j=parent element - for (int i = 1; i < n; i++) { - int k=i; - int j=(i-1)/2; - while (c_dispsig_sorted_Lt(*elems[j], *elems[k])) { - c_dispsig_sorted_Swap(elems[k],elems[j]); - k=j; - j=(k-1)/2; - } - } - // remove elements from heap one-by-one, - // deposit them in reverse order starting at the end of ARY. - for (int i = n - 1; i>=0; i--) { - int k = 0; - int l = 1; - while (l16) { - // detect degenerate case and revert to heap sort - if (depth==0) { - c_dispsig_sorted_IntHeapSort(elems,n); - return; - } - // elements to sort initially to determine pivot. - // choose pp=n/2 in case the input is already sorted. - int pi = 0; - int pp = n/2; - int pj = n-1; - // insertion sort for 1st, middle and last element - if (c_dispsig_sorted_Lt(*elems[pp], *elems[pi])) { - c_dispsig_sorted_Swap(elems[pi], elems[pp]); - } - if (c_dispsig_sorted_Lt(*elems[pj], *elems[pp])) { - if (c_dispsig_sorted_Lt(*elems[pj], *elems[pi])) { - c_dispsig_sorted_Rotleft(elems[pi], elems[pj], elems[pp]); - } else { - c_dispsig_sorted_Swap(elems[pj], elems[pp]); - } - } - // deposit pivot near the end of the array and skip it. - c_dispsig_sorted_Swap(elems[--pj], elems[pp]); - // copy pivot into temporary variable - amc::FDispsig *pivot = elems[pj]; - for(;;){ - while (c_dispsig_sorted_Lt(*elems[++pi], *pivot)) { - } - while (c_dispsig_sorted_Lt(*pivot, *elems[--pj])) { - } - if (pj <= pi) { - break; - } - c_dispsig_sorted_Swap(elems[pi],elems[pj]); - } - depth -= 1; - c_dispsig_sorted_IntQuickSort(elems, pi, depth); - elems += pi; - n -= pi; - } - // sort the remainder of this section - c_dispsig_sorted_IntInsertionSort(elems,n); -} - -// --- amc.FDb.c_dispsig_sorted.InsertionSort -// Insertion sort -void amc::c_dispsig_sorted_InsertionSort() { - amc::FDispsig* *elems = c_dispsig_sorted_Getary().elems; - int n = c_dispsig_sorted_N(); - c_dispsig_sorted_IntInsertionSort(elems, n); -} - -// --- amc.FDb.c_dispsig_sorted.HeapSort -// Heap sort -void amc::c_dispsig_sorted_HeapSort() { - amc::FDispsig* *elems = c_dispsig_sorted_Getary().elems; - int n = c_dispsig_sorted_N(); - c_dispsig_sorted_IntHeapSort(elems, n); -} - -// --- amc.FDb.c_dispsig_sorted.QuickSort -// Quick sort -void amc::c_dispsig_sorted_QuickSort() { - // compute max recursion depth based on number of elements in the array - int max_depth = algo::CeilingLog2(u32(c_dispsig_sorted_N() + 1)) + 3; - amc::FDispsig* *elems = c_dispsig_sorted_Getary().elems; - int n = c_dispsig_sorted_N(); - c_dispsig_sorted_IntQuickSort(elems, n, max_depth); -} - -// --- amc.FDb.c_dispsig_sorted.SaveSsimfile -// Save table to ssimfile -bool amc::c_dispsig_sorted_SaveSsimfile(algo::strptr fname) { - cstring text; - ind_beg(amc::_db_c_dispsig_sorted_curs, c_dispsig_sorted, amc::_db) { - dmmeta::Dispsig out; - dispsig_CopyOut(c_dispsig_sorted, out); - dmmeta::Dispsig_Print(out, text); - text << eol; - }ind_end; - (void)algo::CreateDirRecurse(algo::GetDirName(fname)); - // it is a silent error if the file cannot be saved. - return algo::SafeStringToFile(text, fname); -} - // --- amc.FDb.zs_sig_visit.Insert // Insert row into linked list. If row is already in linked list, do nothing. void amc::zs_sig_visit_Insert(amc::FCtype& row) { @@ -15122,14 +14973,9 @@ bool amc::target_XrefMaybe(amc::FTarget &row) { // Find row by key. Return NULL if not found. amc::FTarget* amc::ind_target_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_target_buckets_n - 1); - amc::FTarget* *e = &_db.ind_target_buckets_elems[index]; - amc::FTarget* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).target == key; - if (done) break; - e = &ret->ind_target_next; - } while (true); + amc::FTarget *ret = _db.ind_target_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_target_next) { + } return ret; } @@ -15153,10 +14999,11 @@ amc::FTarget& amc::ind_target_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_target.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_target_InsertMaybe(amc::FTarget& row) { - ind_target_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_target_next == (amc::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + row.ind_target_hashval = algo::Smallstr16_Hash(0, row.target); + ind_target_Reserve(1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); amc::FTarget* *prev = &_db.ind_target_buckets_elems[index]; do { amc::FTarget* ret = *prev; @@ -15182,7 +15029,7 @@ bool amc::ind_target_InsertMaybe(amc::FTarget& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_target_Remove(amc::FTarget& row) { if (LIKELY(row.ind_target_next != (amc::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); amc::FTarget* *prev = &_db.ind_target_buckets_elems[index]; // addr of pointer to current element while (amc::FTarget *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -15199,8 +15046,14 @@ void amc::ind_target_Remove(amc::FTarget& row) { // --- amc.FDb.ind_target.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_target_Reserve(int n) { + ind_target_AbsReserve(_db.ind_target_n + n); +} + +// --- amc.FDb.ind_target.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_target_AbsReserve(int n) { u32 old_nbuckets = _db.ind_target_buckets_n; - u32 new_nelems = _db.ind_target_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -15219,7 +15072,7 @@ void amc::ind_target_Reserve(int n) { while (elem) { amc::FTarget &row = *elem; amc::FTarget* next = row.ind_target_next; - u32 index = algo::Smallstr16_Hash(0, row.target) & (new_nbuckets-1); + u32 index = row.ind_target_hashval & (new_nbuckets-1); row.ind_target_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -15687,14 +15540,9 @@ bool amc::fwddecl_XrefMaybe(amc::FFwddecl &row) { // Find row by key. Return NULL if not found. amc::FFwddecl* amc::ind_fwddecl_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_fwddecl_buckets_n - 1); - amc::FFwddecl* *e = &_db.ind_fwddecl_buckets_elems[index]; - amc::FFwddecl* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).fwddecl == key; - if (done) break; - e = &ret->ind_fwddecl_next; - } while (true); + amc::FFwddecl *ret = _db.ind_fwddecl_buckets_elems[index]; + for (; ret && !((*ret).fwddecl == key); ret = ret->ind_fwddecl_next) { + } return ret; } @@ -15718,10 +15566,11 @@ amc::FFwddecl& amc::ind_fwddecl_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_fwddecl.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_fwddecl_InsertMaybe(amc::FFwddecl& row) { - ind_fwddecl_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fwddecl_next == (amc::FFwddecl*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.fwddecl) & (_db.ind_fwddecl_buckets_n - 1); + row.ind_fwddecl_hashval = algo::Smallstr100_Hash(0, row.fwddecl); + ind_fwddecl_Reserve(1); + u32 index = row.ind_fwddecl_hashval & (_db.ind_fwddecl_buckets_n - 1); amc::FFwddecl* *prev = &_db.ind_fwddecl_buckets_elems[index]; do { amc::FFwddecl* ret = *prev; @@ -15747,7 +15596,7 @@ bool amc::ind_fwddecl_InsertMaybe(amc::FFwddecl& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_fwddecl_Remove(amc::FFwddecl& row) { if (LIKELY(row.ind_fwddecl_next != (amc::FFwddecl*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.fwddecl) & (_db.ind_fwddecl_buckets_n - 1); + u32 index = row.ind_fwddecl_hashval & (_db.ind_fwddecl_buckets_n - 1); amc::FFwddecl* *prev = &_db.ind_fwddecl_buckets_elems[index]; // addr of pointer to current element while (amc::FFwddecl *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -15764,8 +15613,14 @@ void amc::ind_fwddecl_Remove(amc::FFwddecl& row) { // --- amc.FDb.ind_fwddecl.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_fwddecl_Reserve(int n) { + ind_fwddecl_AbsReserve(_db.ind_fwddecl_n + n); +} + +// --- amc.FDb.ind_fwddecl.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_fwddecl_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fwddecl_buckets_n; - u32 new_nelems = _db.ind_fwddecl_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -15784,7 +15639,7 @@ void amc::ind_fwddecl_Reserve(int n) { while (elem) { amc::FFwddecl &row = *elem; amc::FFwddecl* next = row.ind_fwddecl_next; - u32 index = algo::Smallstr100_Hash(0, row.fwddecl) & (new_nbuckets-1); + u32 index = row.ind_fwddecl_hashval & (new_nbuckets-1); row.ind_fwddecl_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -16014,6 +15869,8 @@ static void amc::tfunc_LoadStatic() { ,{ "amcdb.tfunc tfunc:Ctype.NArgs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Used with command lines\"", amc::tfunc_Ctype_NArgs } ,{ "amcdb.tfunc tfunc:Ctype.FastEncode hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ctype_FastEncode } ,{ "amcdb.tfunc tfunc:Ctype.FastDecode hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ctype_FastDecode } + ,{ "amcdb.tfunc tfunc:Ctype.KafkaEncode hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ctype_KafkaEncode } + ,{ "amcdb.tfunc tfunc:Ctype.KafkaDecode hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ctype_KafkaDecode } ,{ "amcdb.tfunc tfunc:Ctype.AssignOp hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ctype_AssignOp } ,{ "amcdb.tfunc tfunc:Ctype.FixEncode hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ctype_FixEncode } ,{ "amcdb.tfunc tfunc:Ctype2.Ctor hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ctype2_Ctor } @@ -16059,7 +15916,8 @@ static void amc::tfunc_LoadStatic() { ,{ "amcdb.tfunc tfunc:Fbuf.Shift hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Internal function to shift data left\"", amc::tfunc_Fbuf_Shift } ,{ "amcdb.tfunc tfunc:Fbuf.SkipBytes hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Skip N bytes when reading\"", amc::tfunc_Fbuf_SkipBytes } ,{ "amcdb.tfunc tfunc:Fbuf.SkipMsg hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Skip current message, if any\"", amc::tfunc_Fbuf_SkipMsg } - ,{ "amcdb.tfunc tfunc:Fbuf.WriteAll hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Attempt to write buffer contents to fd\"", amc::tfunc_Fbuf_WriteAll } + ,{ "amcdb.tfunc tfunc:Fbuf.WriteAll hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Attempt to write buffer contents to fbuf, return success\"", amc::tfunc_Fbuf_WriteAll } + ,{ "amcdb.tfunc tfunc:Fbuf.WriteReserve hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Write buffer contents to fbuf, reallocate as needed\"", amc::tfunc_Fbuf_WriteReserve } ,{ "amcdb.tfunc tfunc:Fbuf.WriteMsg hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Write message to buffer. If the entire message is written, return true, otherwise false.\"", amc::tfunc_Fbuf_WriteMsg } ,{ "amcdb.tfunc tfunc:Fbuf.Uninit hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:\"Free memory\"", amc::tfunc_Fbuf_Uninit } ,{ "amcdb.tfunc tfunc:Fcast.Cast hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Fcast_Cast } @@ -16189,6 +16047,8 @@ static void amc::tfunc_LoadStatic() { ,{ "amcdb.tfunc tfunc:Ptrary.Find hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:\"Look up row by row id. Return NULL if out of range\"", amc::tfunc_Ptrary_Find } ,{ "amcdb.tfunc tfunc:Ptrary.Getary hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:\"Return array of pointers\"", amc::tfunc_Ptrary_Getary } ,{ "amcdb.tfunc tfunc:Ptrary.Init hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:\"\"", amc::tfunc_Ptrary_Init } + ,{ "amcdb.tfunc tfunc:Ptrary.First hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure:Y ismacro:N comment:\"\"", amc::tfunc_Ptrary_First } + ,{ "amcdb.tfunc tfunc:Ptrary.Last hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure:Y ismacro:N comment:\"\"", amc::tfunc_Ptrary_Last } ,{ "amcdb.tfunc tfunc:Ptrary.Insert hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ptrary_Insert } ,{ "amcdb.tfunc tfunc:Ptrary.InsertMaybe hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ptrary_InsertMaybe } ,{ "amcdb.tfunc tfunc:Ptrary.ScanInsertMaybe hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ptrary_ScanInsertMaybe } @@ -16198,7 +16058,9 @@ static void amc::tfunc_LoadStatic() { ,{ "amcdb.tfunc tfunc:Ptrary.Reserve hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Reserve space in index for N more elements;\"", amc::tfunc_Ptrary_Reserve } ,{ "amcdb.tfunc tfunc:Ptrary.Uninit hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:\"\"", amc::tfunc_Ptrary_Uninit } ,{ "amcdb.tfunc tfunc:Ptrary.curs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ptrary_curs } + ,{ "amcdb.tfunc tfunc:Ptrary.RemoveFirst hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Heap-like Ptrary: remove first element\"", amc::tfunc_Ptrary_RemoveFirst } ,{ "amcdb.tfunc tfunc:Ptrary.oncecurs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Ptrary_oncecurs } + ,{ "amcdb.tfunc tfunc:Ptrary.RemoveLast hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Ptrary: remove last element\"", amc::tfunc_Ptrary_RemoveLast } ,{ "amcdb.tfunc tfunc:Ptrary.qFind hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:\"Return reference without bounds checking\"", amc::tfunc_Ptrary_qFind } ,{ "amcdb.tfunc tfunc:Ptrary.InAryQ hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:\"True if row is in any ptrary instance\"", amc::tfunc_Ptrary_InAryQ } ,{ "amcdb.tfunc tfunc:Ptrary.qLast hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:\"Reference to last element without bounds checking\"", amc::tfunc_Ptrary_qLast } @@ -16214,7 +16076,6 @@ static void amc::tfunc_LoadStatic() { ,{ "amcdb.tfunc tfunc:Smallstr.Add hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Smallstr_Add } ,{ "amcdb.tfunc tfunc:Smallstr.AddStrptr hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Smallstr_AddStrptr } ,{ "amcdb.tfunc tfunc:Smallstr.Getary hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Smallstr_Getary } - ,{ "amcdb.tfunc tfunc:Smallstr.HashStrptr hasthrow:N leaf:N poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Smallstr_HashStrptr } ,{ "amcdb.tfunc tfunc:Smallstr.Init hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:Y comment:\"\"", amc::tfunc_Smallstr_Init } ,{ "amcdb.tfunc tfunc:Smallstr.Max hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Smallstr_Max } ,{ "amcdb.tfunc tfunc:Smallstr.N hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure:Y ismacro:N comment:\"\"", amc::tfunc_Smallstr_N } @@ -16247,6 +16108,7 @@ static void amc::tfunc_LoadStatic() { ,{ "amcdb.tfunc tfunc:Tary.Alloc hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:\"\"", amc::tfunc_Tary_Alloc } ,{ "amcdb.tfunc tfunc:Tary.AllocAt hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:\"\"", amc::tfunc_Tary_AllocAt } ,{ "amcdb.tfunc tfunc:Tary.AllocN hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:\"Reserve space. Insert N elements at the end of the array, return pointer to array\"", amc::tfunc_Tary_AllocN } + ,{ "amcdb.tfunc tfunc:Tary.AllocNAt hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:\"Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements\"", amc::tfunc_Tary_AllocNAt } ,{ "amcdb.tfunc tfunc:Tary.EmptyQ hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:\"Return true if index is empty\"", amc::tfunc_Tary_EmptyQ } ,{ "amcdb.tfunc tfunc:Tary.Find hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure:N ismacro:N comment:\"Look up row by row id. Return NULL if out of range\"", amc::tfunc_Tary_Find } ,{ "amcdb.tfunc tfunc:Tary.Getary hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:\"Return array pointer by value\"", amc::tfunc_Tary_Getary } @@ -16272,6 +16134,7 @@ static void amc::tfunc_LoadStatic() { ,{ "amcdb.tfunc tfunc:Tary.curs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Tary_curs } ,{ "amcdb.tfunc tfunc:Tary.AllocNVal hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Reserve space. Insert N elements at the end of the array, return pointer to array\"", amc::tfunc_Tary_AllocNVal } ,{ "amcdb.tfunc tfunc:Tary.ReadStrptrMaybe hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Tary_ReadStrptrMaybe } + ,{ "amcdb.tfunc tfunc:Tary.Insary hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Insert array at specific position\"", amc::tfunc_Tary_Insary } ,{ "amcdb.tfunc tfunc:Thash.Cascdel hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Delete all rows reachable through the hash index\"", amc::tfunc_Thash_Cascdel } ,{ "amcdb.tfunc tfunc:Thash.EmptyQ hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:\"Return true if hash is empty\"", amc::tfunc_Thash_EmptyQ } ,{ "amcdb.tfunc tfunc:Thash.Find hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:\"Find row by key. Return NULL if not found.\"", amc::tfunc_Thash_Find } @@ -16282,6 +16145,7 @@ static void amc::tfunc_LoadStatic() { ,{ "amcdb.tfunc tfunc:Thash.InsertMaybe hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Thash_InsertMaybe } ,{ "amcdb.tfunc tfunc:Thash.Remove hasthrow:N leaf:Y poolfunc:Y inl:N wur:N pure:N ismacro:N comment:\"Remove reference to element from hash index. If element is not in hash, do nothing\"", amc::tfunc_Thash_Remove } ,{ "amcdb.tfunc tfunc:Thash.Reserve hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Reserve enough room in the hash for N more elements. Return success code.\"", amc::tfunc_Thash_Reserve } + ,{ "amcdb.tfunc tfunc:Thash.AbsReserve hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"Reserve enough room for exacty N elements. Return success code.\"", amc::tfunc_Thash_AbsReserve } ,{ "amcdb.tfunc tfunc:Thash.FindRemove hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Thash_FindRemove } ,{ "amcdb.tfunc tfunc:Thash.Uninit hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:\"\"", amc::tfunc_Thash_Uninit } ,{ "amcdb.tfunc tfunc:Thash.curs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Thash_curs } @@ -16302,6 +16166,7 @@ static void amc::tfunc_LoadStatic() { ,{ "amcdb.tfunc tfunc:Varlen.ReadStrptrMaybe hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Varlen_ReadStrptrMaybe } ,{ "amcdb.tfunc tfunc:Varlen.curs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Varlen_curs } ,{ "amcdb.tfunc tfunc:Varlen.Print hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_Varlen_Print } + ,{ "amcdb.tfunc tfunc:Varlen.Init hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:\"\"", amc::tfunc_Varlen_Init } ,{ "amcdb.tfunc tfunc:ZSListMT.DestructiveFirst hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:\"\"", amc::tfunc_ZSListMT_DestructiveFirst } ,{ "amcdb.tfunc tfunc:ZSListMT.InLlistQ hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure:N ismacro:N comment:\"Return true if row is in index, false otherwise. Row must be non-NULL.\"", amc::tfunc_ZSListMT_InLlistQ } ,{ "amcdb.tfunc tfunc:ZSListMT.Init hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:\"\"", amc::tfunc_ZSListMT_Init } @@ -16353,14 +16218,9 @@ bool amc::tfunc_XrefMaybe(amc::FTfunc &row) { // Find row by key. Return NULL if not found. amc::FTfunc* amc::ind_tfunc_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_tfunc_buckets_n - 1); - amc::FTfunc* *e = &_db.ind_tfunc_buckets_elems[index]; - amc::FTfunc* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).tfunc == key; - if (done) break; - e = &ret->ind_tfunc_next; - } while (true); + amc::FTfunc *ret = _db.ind_tfunc_buckets_elems[index]; + for (; ret && !((*ret).tfunc == key); ret = ret->ind_tfunc_next) { + } return ret; } @@ -16384,10 +16244,11 @@ amc::FTfunc& amc::ind_tfunc_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_tfunc.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_tfunc_InsertMaybe(amc::FTfunc& row) { - ind_tfunc_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_tfunc_next == (amc::FTfunc*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.tfunc) & (_db.ind_tfunc_buckets_n - 1); + row.ind_tfunc_hashval = algo::Smallstr50_Hash(0, row.tfunc); + ind_tfunc_Reserve(1); + u32 index = row.ind_tfunc_hashval & (_db.ind_tfunc_buckets_n - 1); amc::FTfunc* *prev = &_db.ind_tfunc_buckets_elems[index]; do { amc::FTfunc* ret = *prev; @@ -16413,7 +16274,7 @@ bool amc::ind_tfunc_InsertMaybe(amc::FTfunc& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_tfunc_Remove(amc::FTfunc& row) { if (LIKELY(row.ind_tfunc_next != (amc::FTfunc*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.tfunc) & (_db.ind_tfunc_buckets_n - 1); + u32 index = row.ind_tfunc_hashval & (_db.ind_tfunc_buckets_n - 1); amc::FTfunc* *prev = &_db.ind_tfunc_buckets_elems[index]; // addr of pointer to current element while (amc::FTfunc *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -16430,8 +16291,14 @@ void amc::ind_tfunc_Remove(amc::FTfunc& row) { // --- amc.FDb.ind_tfunc.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_tfunc_Reserve(int n) { + ind_tfunc_AbsReserve(_db.ind_tfunc_n + n); +} + +// --- amc.FDb.ind_tfunc.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_tfunc_AbsReserve(int n) { u32 old_nbuckets = _db.ind_tfunc_buckets_n; - u32 new_nelems = _db.ind_tfunc_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -16450,7 +16317,7 @@ void amc::ind_tfunc_Reserve(int n) { while (elem) { amc::FTfunc &row = *elem; amc::FTfunc* next = row.ind_tfunc_next; - u32 index = algo::Smallstr50_Hash(0, row.tfunc) & (new_nbuckets-1); + u32 index = row.ind_tfunc_hashval & (new_nbuckets-1); row.ind_tfunc_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -16634,7 +16501,13 @@ static void amc::gen_LoadStatic() { ,{ "amcdb.gen gen:ns_func perns:Y comment:\"Print all functions bodies\"", amc::gen_ns_func } ,{ "amcdb.gen gen:ns_operators perns:Y comment:\"Generate C++ operators <<, <, >, etc.\"", amc::gen_ns_operators } ,{ "amcdb.gen gen:ns_check_lim perns:Y comment:\"Check that no functions/fields were added after function lock\"", amc::gen_ns_check_lim } + ,{ "amcdb.gen gen:create_userfunc perns:N comment:\"Create userfunc table (table of user-defined functions)\"", amc::gen_create_userfunc } + ,{ "amcdb.gen gen:nsjs_field perns:N comment:\"\"", amc::gen_nsjs_field } + ,{ "amcdb.gen gen:nsjs_ctype perns:N comment:\"\"", amc::gen_nsjs_ctype } + ,{ "amcdb.gen gen:nsjs_ns perns:N comment:\"\"", amc::gen_nsjs_ns } + ,{ "amcdb.gen gen:nsjs_module perns:Y comment:\"Create js module\"", amc::gen_nsjs_module } ,{ "amcdb.gen gen:ns_write perns:Y comment:\"Output namespace data\"", amc::gen_ns_write } + ,{ "amcdb.gen gen:table_write perns:N comment:\"Output table data\"", amc::gen_table_write } ,{NULL, NULL} }; (void)data; @@ -16914,14 +16787,9 @@ bool amc::tclass_XrefMaybe(amc::FTclass &row) { // Find row by key. Return NULL if not found. amc::FTclass* amc::ind_tclass_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_tclass_buckets_n - 1); - amc::FTclass* *e = &_db.ind_tclass_buckets_elems[index]; - amc::FTclass* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).tclass == key; - if (done) break; - e = &ret->ind_tclass_next; - } while (true); + amc::FTclass *ret = _db.ind_tclass_buckets_elems[index]; + for (; ret && !((*ret).tclass == key); ret = ret->ind_tclass_next) { + } return ret; } @@ -16945,10 +16813,11 @@ amc::FTclass& amc::ind_tclass_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_tclass.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_tclass_InsertMaybe(amc::FTclass& row) { - ind_tclass_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_tclass_next == (amc::FTclass*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.tclass) & (_db.ind_tclass_buckets_n - 1); + row.ind_tclass_hashval = algo::Smallstr50_Hash(0, row.tclass); + ind_tclass_Reserve(1); + u32 index = row.ind_tclass_hashval & (_db.ind_tclass_buckets_n - 1); amc::FTclass* *prev = &_db.ind_tclass_buckets_elems[index]; do { amc::FTclass* ret = *prev; @@ -16974,7 +16843,7 @@ bool amc::ind_tclass_InsertMaybe(amc::FTclass& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_tclass_Remove(amc::FTclass& row) { if (LIKELY(row.ind_tclass_next != (amc::FTclass*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.tclass) & (_db.ind_tclass_buckets_n - 1); + u32 index = row.ind_tclass_hashval & (_db.ind_tclass_buckets_n - 1); amc::FTclass* *prev = &_db.ind_tclass_buckets_elems[index]; // addr of pointer to current element while (amc::FTclass *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -16991,8 +16860,14 @@ void amc::ind_tclass_Remove(amc::FTclass& row) { // --- amc.FDb.ind_tclass.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_tclass_Reserve(int n) { + ind_tclass_AbsReserve(_db.ind_tclass_n + n); +} + +// --- amc.FDb.ind_tclass.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_tclass_AbsReserve(int n) { u32 old_nbuckets = _db.ind_tclass_buckets_n; - u32 new_nelems = _db.ind_tclass_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -17011,7 +16886,7 @@ void amc::ind_tclass_Reserve(int n) { while (elem) { amc::FTclass &row = *elem; amc::FTclass* next = row.ind_tclass_next; - u32 index = algo::Smallstr50_Hash(0, row.tclass) & (new_nbuckets-1); + u32 index = row.ind_tclass_hashval & (new_nbuckets-1); row.ind_tclass_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -18407,14 +18282,9 @@ bool amc::fcmdline_XrefMaybe(amc::FFcmdline &row) { // Find row by key. Return NULL if not found. amc::FMain* amc::ind_main_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_main_buckets_n - 1); - amc::FMain* *e = &_db.ind_main_buckets_elems[index]; - amc::FMain* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ns == key; - if (done) break; - e = &ret->ind_main_next; - } while (true); + amc::FMain *ret = _db.ind_main_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_main_next) { + } return ret; } @@ -18438,10 +18308,11 @@ amc::FMain& amc::ind_main_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_main.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_main_InsertMaybe(amc::FMain& row) { - ind_main_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_main_next == (amc::FMain*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_main_buckets_n - 1); + row.ind_main_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_main_Reserve(1); + u32 index = row.ind_main_hashval & (_db.ind_main_buckets_n - 1); amc::FMain* *prev = &_db.ind_main_buckets_elems[index]; do { amc::FMain* ret = *prev; @@ -18467,7 +18338,7 @@ bool amc::ind_main_InsertMaybe(amc::FMain& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_main_Remove(amc::FMain& row) { if (LIKELY(row.ind_main_next != (amc::FMain*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_main_buckets_n - 1); + u32 index = row.ind_main_hashval & (_db.ind_main_buckets_n - 1); amc::FMain* *prev = &_db.ind_main_buckets_elems[index]; // addr of pointer to current element while (amc::FMain *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -18484,8 +18355,14 @@ void amc::ind_main_Remove(amc::FMain& row) { // --- amc.FDb.ind_main.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_main_Reserve(int n) { + ind_main_AbsReserve(_db.ind_main_n + n); +} + +// --- amc.FDb.ind_main.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_main_AbsReserve(int n) { u32 old_nbuckets = _db.ind_main_buckets_n; - u32 new_nelems = _db.ind_main_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -18504,7 +18381,7 @@ void amc::ind_main_Reserve(int n) { while (elem) { amc::FMain &row = *elem; amc::FMain* next = row.ind_main_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_main_hashval & (new_nbuckets-1); row.ind_main_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -19107,24 +18984,20 @@ amc::FSubstr* amc::zd_substr_params_RemoveFirst() { // Find row by key. Return NULL if not found. amc::FFconst* amc::ind_fconst_int_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_fconst_int_buckets_n - 1); - amc::FFconst* *e = &_db.ind_fconst_int_buckets_elems[index]; - amc::FFconst* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).cpp_value == key; - if (done) break; - e = &ret->ind_fconst_int_next; - } while (true); + amc::FFconst *ret = _db.ind_fconst_int_buckets_elems[index]; + for (; ret && !((*ret).cpp_value == key); ret = ret->ind_fconst_int_next) { + } return ret; } // --- amc.FDb.ind_fconst_int.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_fconst_int_InsertMaybe(amc::FFconst& row) { - ind_fconst_int_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fconst_int_next == (amc::FFconst*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.cpp_value) & (_db.ind_fconst_int_buckets_n - 1); + row.ind_fconst_int_hashval = algo::cstring_Hash(0, row.cpp_value); + ind_fconst_int_Reserve(1); + u32 index = row.ind_fconst_int_hashval & (_db.ind_fconst_int_buckets_n - 1); amc::FFconst* *prev = &_db.ind_fconst_int_buckets_elems[index]; do { amc::FFconst* ret = *prev; @@ -19150,7 +19023,7 @@ bool amc::ind_fconst_int_InsertMaybe(amc::FFconst& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_fconst_int_Remove(amc::FFconst& row) { if (LIKELY(row.ind_fconst_int_next != (amc::FFconst*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.cpp_value) & (_db.ind_fconst_int_buckets_n - 1); + u32 index = row.ind_fconst_int_hashval & (_db.ind_fconst_int_buckets_n - 1); amc::FFconst* *prev = &_db.ind_fconst_int_buckets_elems[index]; // addr of pointer to current element while (amc::FFconst *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -19167,8 +19040,14 @@ void amc::ind_fconst_int_Remove(amc::FFconst& row) { // --- amc.FDb.ind_fconst_int.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_fconst_int_Reserve(int n) { + ind_fconst_int_AbsReserve(_db.ind_fconst_int_n + n); +} + +// --- amc.FDb.ind_fconst_int.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_fconst_int_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fconst_int_buckets_n; - u32 new_nelems = _db.ind_fconst_int_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -19187,7 +19066,7 @@ void amc::ind_fconst_int_Reserve(int n) { while (elem) { amc::FFconst &row = *elem; amc::FFconst* next = row.ind_fconst_int_next; - u32 index = algo::cstring_Hash(0, row.cpp_value) & (new_nbuckets-1); + u32 index = row.ind_fconst_int_hashval & (new_nbuckets-1); row.ind_fconst_int_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -19310,14 +19189,9 @@ bool amc::fprefix_XrefMaybe(amc::FFprefix &row) { // Find row by key. Return NULL if not found. amc::FFprefix* amc::ind_prefix_Find(const algo::strptr& key) { u32 index = algo::Smallstr5_Hash(0, key) & (_db.ind_prefix_buckets_n - 1); - amc::FFprefix* *e = &_db.ind_prefix_buckets_elems[index]; - amc::FFprefix* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).fprefix == key; - if (done) break; - e = &ret->ind_prefix_next; - } while (true); + amc::FFprefix *ret = _db.ind_prefix_buckets_elems[index]; + for (; ret && !((*ret).fprefix == key); ret = ret->ind_prefix_next) { + } return ret; } @@ -19341,10 +19215,11 @@ amc::FFprefix& amc::ind_prefix_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_prefix.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_prefix_InsertMaybe(amc::FFprefix& row) { - ind_prefix_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_prefix_next == (amc::FFprefix*)-1)) {// check if in hash already - u32 index = algo::Smallstr5_Hash(0, row.fprefix) & (_db.ind_prefix_buckets_n - 1); + row.ind_prefix_hashval = algo::Smallstr5_Hash(0, row.fprefix); + ind_prefix_Reserve(1); + u32 index = row.ind_prefix_hashval & (_db.ind_prefix_buckets_n - 1); amc::FFprefix* *prev = &_db.ind_prefix_buckets_elems[index]; do { amc::FFprefix* ret = *prev; @@ -19370,7 +19245,7 @@ bool amc::ind_prefix_InsertMaybe(amc::FFprefix& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_prefix_Remove(amc::FFprefix& row) { if (LIKELY(row.ind_prefix_next != (amc::FFprefix*)-1)) {// check if in hash already - u32 index = algo::Smallstr5_Hash(0, row.fprefix) & (_db.ind_prefix_buckets_n - 1); + u32 index = row.ind_prefix_hashval & (_db.ind_prefix_buckets_n - 1); amc::FFprefix* *prev = &_db.ind_prefix_buckets_elems[index]; // addr of pointer to current element while (amc::FFprefix *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -19387,8 +19262,14 @@ void amc::ind_prefix_Remove(amc::FFprefix& row) { // --- amc.FDb.ind_prefix.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_prefix_Reserve(int n) { + ind_prefix_AbsReserve(_db.ind_prefix_n + n); +} + +// --- amc.FDb.ind_prefix.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_prefix_AbsReserve(int n) { u32 old_nbuckets = _db.ind_prefix_buckets_n; - u32 new_nelems = _db.ind_prefix_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -19407,7 +19288,7 @@ void amc::ind_prefix_Reserve(int n) { while (elem) { amc::FFprefix &row = *elem; amc::FFprefix* next = row.ind_prefix_next; - u32 index = algo::Smallstr5_Hash(0, row.fprefix) & (new_nbuckets-1); + u32 index = row.ind_prefix_hashval & (new_nbuckets-1); row.ind_prefix_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -19628,15 +19509,11 @@ bool amc::fnoremove_XrefMaybe(amc::FFnoremove &row) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_substr_field_Insert(amc::FSubstr& row) { - if (bool_Update(row._db_c_substr_field_in_ary,true)) { - // reserve space + if (!row.c_substr_field_in_ary) { c_substr_field_Reserve(1); - u32 n = _db.c_substr_field_n; - u32 at = n; - amc::FSubstr* *elems = _db.c_substr_field_elems; - elems[at] = &row; - _db.c_substr_field_n = n+1; - + u32 n = _db.c_substr_field_n++; + _db.c_substr_field_elems[n] = &row; + row.c_substr_field_in_ary = true; } } @@ -19645,7 +19522,7 @@ void amc::c_substr_field_Insert(amc::FSubstr& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_substr_field_InsertMaybe(amc::FSubstr& row) { - bool retval = !row._db_c_substr_field_in_ary; + bool retval = !c_substr_field_InAryQ(row); c_substr_field_Insert(row); // check is performed in _Insert again return retval; } @@ -19653,18 +19530,18 @@ bool amc::c_substr_field_InsertMaybe(amc::FSubstr& row) { // --- amc.FDb.c_substr_field.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_substr_field_Remove(amc::FSubstr& row) { - if (bool_Update(row._db_c_substr_field_in_ary,false)) { - int lim = _db.c_substr_field_n; + int n = _db.c_substr_field_n; + if (bool_Update(row.c_substr_field_in_ary,false)) { amc::FSubstr* *elems = _db.c_substr_field_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FSubstr* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FSubstr*) * (lim - j); + size_t nbytes = sizeof(amc::FSubstr*) * (n - j); memmove(elems + i, elems + j, nbytes); - _db.c_substr_field_n = lim - 1; + _db.c_substr_field_n = n - 1; break; } } @@ -19956,381 +19833,68 @@ bool amc::ctypelen_XrefMaybe(amc::FCtypelen &row) { return false; } } - // insert ctypelen into index c_ctypelen - if (true) { // user-defined insert condition - c_ctypelen_Insert(row); - } return retval; } -// --- amc.FDb.c_ctypelen.Insert -// Insert pointer to row into array. Row must not already be in array. -// If pointer is already in the array, it may be inserted twice. -void amc::c_ctypelen_Insert(amc::FCtypelen& row) { - if (bool_Update(row._db_c_ctypelen_in_ary,true)) { - // reserve space - c_ctypelen_Reserve(1); - u32 n = _db.c_ctypelen_n; - u32 at = n; - amc::FCtypelen* *elems = _db.c_ctypelen_elems; - elems[at] = &row; - _db.c_ctypelen_n = n+1; - +// --- amc.FDb.fbase.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +amc::FFbase& amc::fbase_Alloc() { + amc::FFbase* row = fbase_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("amc.out_of_mem field:amc.FDb.fbase comment:'Alloc failed'"); } + return *row; } -// --- amc.FDb.c_ctypelen.InsertMaybe -// Insert pointer to row in array. -// If row is already in the array, do nothing. -// Return value: whether element was inserted into array. -bool amc::c_ctypelen_InsertMaybe(amc::FCtypelen& row) { - bool retval = !row._db_c_ctypelen_in_ary; - c_ctypelen_Insert(row); // check is performed in _Insert again - return retval; +// --- amc.FDb.fbase.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +amc::FFbase* amc::fbase_AllocMaybe() { + amc::FFbase *row = (amc::FFbase*)fbase_AllocMem(); + if (row) { + new (row) amc::FFbase; // call constructor + } + return row; } -// --- amc.FDb.c_ctypelen.Remove -// Find element using linear scan. If element is in array, remove, otherwise do nothing -void amc::c_ctypelen_Remove(amc::FCtypelen& row) { - if (bool_Update(row._db_c_ctypelen_in_ary,false)) { - int lim = _db.c_ctypelen_n; - amc::FCtypelen* *elems = _db.c_ctypelen_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc::FCtypelen* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FCtypelen*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - _db.c_ctypelen_n = lim - 1; - break; - } - } +// --- amc.FDb.fbase.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +amc::FFbase* amc::fbase_InsertMaybe(const dmmeta::Fbase &value) { + amc::FFbase *row = &fbase_Alloc(); // if out of memory, process dies. if input error, return NULL. + fbase_CopyIn(*row,const_cast(value)); + bool ok = fbase_XrefMaybe(*row); // this may return false + if (!ok) { + fbase_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened } + return row; } -// --- amc.FDb.c_ctypelen.Reserve -// Reserve space in index for N more elements; -void amc::c_ctypelen_Reserve(u32 n) { - u32 old_max = _db.c_ctypelen_max; - if (UNLIKELY(_db.c_ctypelen_n + n > old_max)) { - u32 new_max = u32_Max(4, old_max * 2); - u32 old_size = old_max * sizeof(amc::FCtypelen*); - u32 new_size = new_max * sizeof(amc::FCtypelen*); - void *new_mem = amc::lpool_ReallocMem(_db.c_ctypelen_elems, old_size, new_size); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("amc.out_of_memory field:amc.FDb.c_ctypelen"); +// --- amc.FDb.fbase.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* amc::fbase_AllocMem() { + u64 new_nelems = _db.fbase_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<b, then !(b>a). -// If not, mayhem results. -static bool amc::c_ctypelen_Lt(amc::FCtypelen &elem_a, amc::FCtypelen &elem_b) { - bool ret; - ret = elem_a.ctype < elem_b.ctype; - return ret; -} - -// --- amc.FDb.c_ctypelen.SortedQ -// Verify whether array is sorted -bool amc::c_ctypelen_SortedQ() { - amc::FCtypelen* *elems = c_ctypelen_Getary().elems; - int n = c_ctypelen_N(); - for (int i = 1; i < n; i++) { - if (c_ctypelen_Lt(*elems[i], *elems[i-1])) { - return false; - } - } - return true; -} - -// --- amc.FDb.c_ctypelen.IntInsertionSort -// Internal insertion sort -static void amc::c_ctypelen_IntInsertionSort(amc::FCtypelen* *elems, int n) { - for (int i = 1; i < n; ++i) { - int j = i; - amc::FCtypelen *tmp = elems[i]; - // shift elements up by one - if (c_ctypelen_Lt(*tmp, *elems[j-1])) { - do { - elems[j] = elems[j-1]; - j--; - } while (j>0 && c_ctypelen_Lt(*tmp, *elems[j-1])); - elems[j] = tmp; - } - } -} - -// --- amc.FDb.c_ctypelen.IntHeapSort -// Internal heap sort -static void amc::c_ctypelen_IntHeapSort(amc::FCtypelen* *elems, int n) { - // construct max-heap. - // k=current element - // j=parent element - for (int i = 1; i < n; i++) { - int k=i; - int j=(i-1)/2; - while (c_ctypelen_Lt(*elems[j], *elems[k])) { - c_ctypelen_Swap(elems[k],elems[j]); - k=j; - j=(k-1)/2; - } - } - // remove elements from heap one-by-one, - // deposit them in reverse order starting at the end of ARY. - for (int i = n - 1; i>=0; i--) { - int k = 0; - int l = 1; - while (l16) { - // detect degenerate case and revert to heap sort - if (depth==0) { - c_ctypelen_IntHeapSort(elems,n); - return; - } - // elements to sort initially to determine pivot. - // choose pp=n/2 in case the input is already sorted. - int pi = 0; - int pp = n/2; - int pj = n-1; - // insertion sort for 1st, middle and last element - if (c_ctypelen_Lt(*elems[pp], *elems[pi])) { - c_ctypelen_Swap(elems[pi], elems[pp]); - } - if (c_ctypelen_Lt(*elems[pj], *elems[pp])) { - if (c_ctypelen_Lt(*elems[pj], *elems[pi])) { - c_ctypelen_Rotleft(elems[pi], elems[pj], elems[pp]); - } else { - c_ctypelen_Swap(elems[pj], elems[pp]); - } - } - // deposit pivot near the end of the array and skip it. - c_ctypelen_Swap(elems[--pj], elems[pp]); - // copy pivot into temporary variable - amc::FCtypelen *pivot = elems[pj]; - for(;;){ - while (c_ctypelen_Lt(*elems[++pi], *pivot)) { - } - while (c_ctypelen_Lt(*pivot, *elems[--pj])) { - } - if (pj <= pi) { - break; - } - c_ctypelen_Swap(elems[pi],elems[pj]); - } - depth -= 1; - c_ctypelen_IntQuickSort(elems, pi, depth); - elems += pi; - n -= pi; - } - // sort the remainder of this section - c_ctypelen_IntInsertionSort(elems,n); -} - -// --- amc.FDb.c_ctypelen.InsertionSort -// Insertion sort -void amc::c_ctypelen_InsertionSort() { - amc::FCtypelen* *elems = c_ctypelen_Getary().elems; - int n = c_ctypelen_N(); - c_ctypelen_IntInsertionSort(elems, n); -} - -// --- amc.FDb.c_ctypelen.HeapSort -// Heap sort -void amc::c_ctypelen_HeapSort() { - amc::FCtypelen* *elems = c_ctypelen_Getary().elems; - int n = c_ctypelen_N(); - c_ctypelen_IntHeapSort(elems, n); -} - -// --- amc.FDb.c_ctypelen.QuickSort -// Quick sort -void amc::c_ctypelen_QuickSort() { - // compute max recursion depth based on number of elements in the array - int max_depth = algo::CeilingLog2(u32(c_ctypelen_N() + 1)) + 3; - amc::FCtypelen* *elems = c_ctypelen_Getary().elems; - int n = c_ctypelen_N(); - c_ctypelen_IntQuickSort(elems, n, max_depth); -} - -// --- amc.FDb.c_ctypelen.SaveSsimfile -// Save table to ssimfile -bool amc::c_ctypelen_SaveSsimfile(algo::strptr fname) { - cstring text; - ind_beg(amc::_db_c_ctypelen_curs, c_ctypelen, amc::_db) { - dmmeta::Ctypelen out; - ctypelen_CopyOut(c_ctypelen, out); - dmmeta::Ctypelen_Print(out, text); - text << eol; - }ind_end; - (void)algo::CreateDirRecurse(algo::GetDirName(fname)); - // it is a silent error if the file cannot be saved. - return algo::SafeStringToFile(text, fname); -} - -// --- amc.FDb.c_tempfield.Insert -// Insert pointer to row into array. Row must not already be in array. -// If pointer is already in the array, it may be inserted twice. -void amc::c_tempfield_Insert(amc::FField& row) { - if (bool_Update(row._db_c_tempfield_in_ary,true)) { - // reserve space - c_tempfield_Reserve(1); - u32 n = _db.c_tempfield_n; - u32 at = n; - amc::FField* *elems = _db.c_tempfield_elems; - elems[at] = &row; - _db.c_tempfield_n = n+1; - - } -} - -// --- amc.FDb.c_tempfield.InsertMaybe -// Insert pointer to row in array. -// If row is already in the array, do nothing. -// Return value: whether element was inserted into array. -bool amc::c_tempfield_InsertMaybe(amc::FField& row) { - bool retval = !row._db_c_tempfield_in_ary; - c_tempfield_Insert(row); // check is performed in _Insert again - return retval; -} - -// --- amc.FDb.c_tempfield.Remove -// Find element using linear scan. If element is in array, remove, otherwise do nothing -void amc::c_tempfield_Remove(amc::FField& row) { - if (bool_Update(row._db_c_tempfield_in_ary,false)) { - int lim = _db.c_tempfield_n; - amc::FField* *elems = _db.c_tempfield_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc::FField* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FField*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - _db.c_tempfield_n = lim - 1; - break; - } - } - } -} - -// --- amc.FDb.c_tempfield.Reserve -// Reserve space in index for N more elements; -void amc::c_tempfield_Reserve(u32 n) { - u32 old_max = _db.c_tempfield_max; - if (UNLIKELY(_db.c_tempfield_n + n > old_max)) { - u32 new_max = u32_Max(4, old_max * 2); - u32 old_size = old_max * sizeof(amc::FField*); - u32 new_size = new_max * sizeof(amc::FField*); - void *new_mem = amc::lpool_ReallocMem(_db.c_tempfield_elems, old_size, new_size); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("amc.out_of_memory field:amc.FDb.c_tempfield"); - } - _db.c_tempfield_elems = (amc::FField**)new_mem; - _db.c_tempfield_max = new_max; - } -} - -// --- amc.FDb.fbase.Alloc -// Allocate memory for new default row. -// If out of memory, process is killed. -amc::FFbase& amc::fbase_Alloc() { - amc::FFbase* row = fbase_AllocMaybe(); - if (UNLIKELY(row == NULL)) { - FatalErrorExit("amc.out_of_mem field:amc.FDb.fbase comment:'Alloc failed'"); - } - return *row; -} - -// --- amc.FDb.fbase.AllocMaybe -// Allocate memory for new element. If out of memory, return NULL. -amc::FFbase* amc::fbase_AllocMaybe() { - amc::FFbase *row = (amc::FFbase*)fbase_AllocMem(); - if (row) { - new (row) amc::FFbase; // call constructor - } - return row; -} - -// --- amc.FDb.fbase.InsertMaybe -// Create new row from struct. -// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -amc::FFbase* amc::fbase_InsertMaybe(const dmmeta::Fbase &value) { - amc::FFbase *row = &fbase_Alloc(); // if out of memory, process dies. if input error, return NULL. - fbase_CopyIn(*row,const_cast(value)); - bool ok = fbase_XrefMaybe(*row); // this may return false - if (!ok) { - fbase_RemoveLast(); // delete offending row, any existing xrefs are cleared - row = NULL; // forget this ever happened - } - return row; -} - -// --- amc.FDb.fbase.AllocMem -// Allocate space for one element. If no memory available, return NULL. -void* amc::fbase_AllocMem() { - u64 new_nelems = _db.fbase_n+1; - // compute level and index on level - u64 bsr = algo::u64_BitScanReverse(new_nelems); - u64 base = u64(1)<ind_fcmap_next; - } while (true); + amc::FFcmap *ret = _db.ind_fcmap_buckets_elems[index]; + for (; ret && !((*ret).fcmap == key); ret = ret->ind_fcmap_next) { + } return ret; } @@ -20419,10 +19978,11 @@ amc::FFcmap& amc::ind_fcmap_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_fcmap.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_fcmap_InsertMaybe(amc::FFcmap& row) { - ind_fcmap_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fcmap_next == (amc::FFcmap*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.fcmap) & (_db.ind_fcmap_buckets_n - 1); + row.ind_fcmap_hashval = algo::Smallstr250_Hash(0, row.fcmap); + ind_fcmap_Reserve(1); + u32 index = row.ind_fcmap_hashval & (_db.ind_fcmap_buckets_n - 1); amc::FFcmap* *prev = &_db.ind_fcmap_buckets_elems[index]; do { amc::FFcmap* ret = *prev; @@ -20448,7 +20008,7 @@ bool amc::ind_fcmap_InsertMaybe(amc::FFcmap& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_fcmap_Remove(amc::FFcmap& row) { if (LIKELY(row.ind_fcmap_next != (amc::FFcmap*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.fcmap) & (_db.ind_fcmap_buckets_n - 1); + u32 index = row.ind_fcmap_hashval & (_db.ind_fcmap_buckets_n - 1); amc::FFcmap* *prev = &_db.ind_fcmap_buckets_elems[index]; // addr of pointer to current element while (amc::FFcmap *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -20465,8 +20025,14 @@ void amc::ind_fcmap_Remove(amc::FFcmap& row) { // --- amc.FDb.ind_fcmap.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_fcmap_Reserve(int n) { + ind_fcmap_AbsReserve(_db.ind_fcmap_n + n); +} + +// --- amc.FDb.ind_fcmap.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_fcmap_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fcmap_buckets_n; - u32 new_nelems = _db.ind_fcmap_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -20485,7 +20051,7 @@ void amc::ind_fcmap_Reserve(int n) { while (elem) { amc::FFcmap &row = *elem; amc::FFcmap* next = row.ind_fcmap_next; - u32 index = algo::Smallstr250_Hash(0, row.fcmap) & (new_nbuckets-1); + u32 index = row.ind_fcmap_hashval & (new_nbuckets-1); row.ind_fcmap_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -21774,14 +21340,9 @@ bool amc::fuserinit_XrefMaybe(amc::FFuserinit &row) { // Find row by key. Return NULL if not found. amc::FFcurs* amc::ind_fcurs_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_fcurs_buckets_n - 1); - amc::FFcurs* *e = &_db.ind_fcurs_buckets_elems[index]; - amc::FFcurs* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).fcurs == key; - if (done) break; - e = &ret->ind_fcurs_next; - } while (true); + amc::FFcurs *ret = _db.ind_fcurs_buckets_elems[index]; + for (; ret && !((*ret).fcurs == key); ret = ret->ind_fcurs_next) { + } return ret; } @@ -21805,10 +21366,11 @@ amc::FFcurs& amc::ind_fcurs_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_fcurs.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_fcurs_InsertMaybe(amc::FFcurs& row) { - ind_fcurs_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fcurs_next == (amc::FFcurs*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.fcurs) & (_db.ind_fcurs_buckets_n - 1); + row.ind_fcurs_hashval = algo::Smallstr50_Hash(0, row.fcurs); + ind_fcurs_Reserve(1); + u32 index = row.ind_fcurs_hashval & (_db.ind_fcurs_buckets_n - 1); amc::FFcurs* *prev = &_db.ind_fcurs_buckets_elems[index]; do { amc::FFcurs* ret = *prev; @@ -21834,7 +21396,7 @@ bool amc::ind_fcurs_InsertMaybe(amc::FFcurs& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_fcurs_Remove(amc::FFcurs& row) { if (LIKELY(row.ind_fcurs_next != (amc::FFcurs*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.fcurs) & (_db.ind_fcurs_buckets_n - 1); + u32 index = row.ind_fcurs_hashval & (_db.ind_fcurs_buckets_n - 1); amc::FFcurs* *prev = &_db.ind_fcurs_buckets_elems[index]; // addr of pointer to current element while (amc::FFcurs *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -21851,8 +21413,14 @@ void amc::ind_fcurs_Remove(amc::FFcurs& row) { // --- amc.FDb.ind_fcurs.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_fcurs_Reserve(int n) { + ind_fcurs_AbsReserve(_db.ind_fcurs_n + n); +} + +// --- amc.FDb.ind_fcurs.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_fcurs_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fcurs_buckets_n; - u32 new_nelems = _db.ind_fcurs_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -21871,7 +21439,7 @@ void amc::ind_fcurs_Reserve(int n) { while (elem) { amc::FFcurs &row = *elem; amc::FFcurs* next = row.ind_fcurs_next; - u32 index = algo::Smallstr50_Hash(0, row.fcurs) & (new_nbuckets-1); + u32 index = row.ind_fcurs_hashval & (new_nbuckets-1); row.ind_fcurs_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -22233,14 +21801,9 @@ bool amc::fflag_XrefMaybe(amc::FFflag &row) { // Find row by key. Return NULL if not found. amc::FFflag* amc::ind_fflag_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_fflag_buckets_n - 1); - amc::FFflag* *e = &_db.ind_fflag_buckets_elems[index]; - amc::FFflag* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_fflag_next; - } while (true); + amc::FFflag *ret = _db.ind_fflag_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_fflag_next) { + } return ret; } @@ -22264,10 +21827,11 @@ amc::FFflag& amc::ind_fflag_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_fflag.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_fflag_InsertMaybe(amc::FFflag& row) { - ind_fflag_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fflag_next == (amc::FFflag*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_fflag_buckets_n - 1); + row.ind_fflag_hashval = algo::Smallstr100_Hash(0, row.field); + ind_fflag_Reserve(1); + u32 index = row.ind_fflag_hashval & (_db.ind_fflag_buckets_n - 1); amc::FFflag* *prev = &_db.ind_fflag_buckets_elems[index]; do { amc::FFflag* ret = *prev; @@ -22293,7 +21857,7 @@ bool amc::ind_fflag_InsertMaybe(amc::FFflag& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_fflag_Remove(amc::FFflag& row) { if (LIKELY(row.ind_fflag_next != (amc::FFflag*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_fflag_buckets_n - 1); + u32 index = row.ind_fflag_hashval & (_db.ind_fflag_buckets_n - 1); amc::FFflag* *prev = &_db.ind_fflag_buckets_elems[index]; // addr of pointer to current element while (amc::FFflag *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -22310,8 +21874,14 @@ void amc::ind_fflag_Remove(amc::FFflag& row) { // --- amc.FDb.ind_fflag.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_fflag_Reserve(int n) { + ind_fflag_AbsReserve(_db.ind_fflag_n + n); +} + +// --- amc.FDb.ind_fflag.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_fflag_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fflag_buckets_n; - u32 new_nelems = _db.ind_fflag_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -22330,7 +21900,7 @@ void amc::ind_fflag_Reserve(int n) { while (elem) { amc::FFflag &row = *elem; amc::FFflag* next = row.ind_fflag_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_fflag_hashval & (new_nbuckets-1); row.ind_fflag_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -22575,14 +22145,9 @@ bool amc::license_XrefMaybe(amc::FLicense &row) { // Find row by key. Return NULL if not found. amc::FLicense* amc::ind_license_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_license_buckets_n - 1); - amc::FLicense* *e = &_db.ind_license_buckets_elems[index]; - amc::FLicense* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).license == key; - if (done) break; - e = &ret->ind_license_next; - } while (true); + amc::FLicense *ret = _db.ind_license_buckets_elems[index]; + for (; ret && !((*ret).license == key); ret = ret->ind_license_next) { + } return ret; } @@ -22606,10 +22171,11 @@ amc::FLicense& amc::ind_license_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_license.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_license_InsertMaybe(amc::FLicense& row) { - ind_license_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_license_next == (amc::FLicense*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.license) & (_db.ind_license_buckets_n - 1); + row.ind_license_hashval = algo::Smallstr50_Hash(0, row.license); + ind_license_Reserve(1); + u32 index = row.ind_license_hashval & (_db.ind_license_buckets_n - 1); amc::FLicense* *prev = &_db.ind_license_buckets_elems[index]; do { amc::FLicense* ret = *prev; @@ -22635,7 +22201,7 @@ bool amc::ind_license_InsertMaybe(amc::FLicense& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_license_Remove(amc::FLicense& row) { if (LIKELY(row.ind_license_next != (amc::FLicense*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.license) & (_db.ind_license_buckets_n - 1); + u32 index = row.ind_license_hashval & (_db.ind_license_buckets_n - 1); amc::FLicense* *prev = &_db.ind_license_buckets_elems[index]; // addr of pointer to current element while (amc::FLicense *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -22652,8 +22218,14 @@ void amc::ind_license_Remove(amc::FLicense& row) { // --- amc.FDb.ind_license.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_license_Reserve(int n) { + ind_license_AbsReserve(_db.ind_license_n + n); +} + +// --- amc.FDb.ind_license.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_license_AbsReserve(int n) { u32 old_nbuckets = _db.ind_license_buckets_n; - u32 new_nelems = _db.ind_license_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -22672,7 +22244,7 @@ void amc::ind_license_Reserve(int n) { while (elem) { amc::FLicense &row = *elem; amc::FLicense* next = row.ind_license_next; - u32 index = algo::Smallstr50_Hash(0, row.license) & (new_nbuckets-1); + u32 index = row.ind_license_hashval & (new_nbuckets-1); row.ind_license_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -22689,15 +22261,11 @@ void amc::ind_license_Reserve(int n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_ssimfile_sorted_Insert(amc::FSsimfile& row) { - if (bool_Update(row._db_c_ssimfile_sorted_in_ary,true)) { - // reserve space + if (!row.c_ssimfile_sorted_in_ary) { c_ssimfile_sorted_Reserve(1); - u32 n = _db.c_ssimfile_sorted_n; - u32 at = n; - amc::FSsimfile* *elems = _db.c_ssimfile_sorted_elems; - elems[at] = &row; - _db.c_ssimfile_sorted_n = n+1; - + u32 n = _db.c_ssimfile_sorted_n++; + _db.c_ssimfile_sorted_elems[n] = &row; + row.c_ssimfile_sorted_in_ary = true; } } @@ -22706,7 +22274,7 @@ void amc::c_ssimfile_sorted_Insert(amc::FSsimfile& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_ssimfile_sorted_InsertMaybe(amc::FSsimfile& row) { - bool retval = !row._db_c_ssimfile_sorted_in_ary; + bool retval = !c_ssimfile_sorted_InAryQ(row); c_ssimfile_sorted_Insert(row); // check is performed in _Insert again return retval; } @@ -22714,18 +22282,18 @@ bool amc::c_ssimfile_sorted_InsertMaybe(amc::FSsimfile& row) { // --- amc.FDb.c_ssimfile_sorted.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_ssimfile_sorted_Remove(amc::FSsimfile& row) { - if (bool_Update(row._db_c_ssimfile_sorted_in_ary,false)) { - int lim = _db.c_ssimfile_sorted_n; + int n = _db.c_ssimfile_sorted_n; + if (bool_Update(row.c_ssimfile_sorted_in_ary,false)) { amc::FSsimfile* *elems = _db.c_ssimfile_sorted_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FSsimfile* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FSsimfile*) * (lim - j); + size_t nbytes = sizeof(amc::FSsimfile*) * (n - j); memmove(elems + i, elems + j, nbytes); - _db.c_ssimfile_sorted_n = lim - 1; + _db.c_ssimfile_sorted_n = n - 1; break; } } @@ -23208,14 +22776,9 @@ bool amc::pmaskfld_member_XrefMaybe(amc::FPmaskfldMember &row) { // Find row by key. Return NULL if not found. amc::FPmaskfld* amc::ind_pmaskfld_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_pmaskfld_buckets_n - 1); - amc::FPmaskfld* *e = &_db.ind_pmaskfld_buckets_elems[index]; - amc::FPmaskfld* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_pmaskfld_next; - } while (true); + amc::FPmaskfld *ret = _db.ind_pmaskfld_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_pmaskfld_next) { + } return ret; } @@ -23239,10 +22802,11 @@ amc::FPmaskfld& amc::ind_pmaskfld_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_pmaskfld.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_pmaskfld_InsertMaybe(amc::FPmaskfld& row) { - ind_pmaskfld_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_pmaskfld_next == (amc::FPmaskfld*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_pmaskfld_buckets_n - 1); + row.ind_pmaskfld_hashval = algo::Smallstr100_Hash(0, row.field); + ind_pmaskfld_Reserve(1); + u32 index = row.ind_pmaskfld_hashval & (_db.ind_pmaskfld_buckets_n - 1); amc::FPmaskfld* *prev = &_db.ind_pmaskfld_buckets_elems[index]; do { amc::FPmaskfld* ret = *prev; @@ -23268,7 +22832,7 @@ bool amc::ind_pmaskfld_InsertMaybe(amc::FPmaskfld& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_pmaskfld_Remove(amc::FPmaskfld& row) { if (LIKELY(row.ind_pmaskfld_next != (amc::FPmaskfld*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_pmaskfld_buckets_n - 1); + u32 index = row.ind_pmaskfld_hashval & (_db.ind_pmaskfld_buckets_n - 1); amc::FPmaskfld* *prev = &_db.ind_pmaskfld_buckets_elems[index]; // addr of pointer to current element while (amc::FPmaskfld *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -23285,8 +22849,14 @@ void amc::ind_pmaskfld_Remove(amc::FPmaskfld& row) { // --- amc.FDb.ind_pmaskfld.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_pmaskfld_Reserve(int n) { + ind_pmaskfld_AbsReserve(_db.ind_pmaskfld_n + n); +} + +// --- amc.FDb.ind_pmaskfld.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_pmaskfld_AbsReserve(int n) { u32 old_nbuckets = _db.ind_pmaskfld_buckets_n; - u32 new_nelems = _db.ind_pmaskfld_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -23305,7 +22875,7 @@ void amc::ind_pmaskfld_Reserve(int n) { while (elem) { amc::FPmaskfld &row = *elem; amc::FPmaskfld* next = row.ind_pmaskfld_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_pmaskfld_hashval & (new_nbuckets-1); row.ind_pmaskfld_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -23545,14 +23115,9 @@ bool amc::fbuftype_XrefMaybe(amc::FFbuftype &row) { // Find row by key. Return NULL if not found. amc::FFbuftype* amc::ind_fbuftype_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_fbuftype_buckets_n - 1); - amc::FFbuftype* *e = &_db.ind_fbuftype_buckets_elems[index]; - amc::FFbuftype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).fbuftype == key; - if (done) break; - e = &ret->ind_fbuftype_next; - } while (true); + amc::FFbuftype *ret = _db.ind_fbuftype_buckets_elems[index]; + for (; ret && !((*ret).fbuftype == key); ret = ret->ind_fbuftype_next) { + } return ret; } @@ -23576,10 +23141,11 @@ amc::FFbuftype& amc::ind_fbuftype_GetOrCreate(const algo::strptr& key) { // --- amc.FDb.ind_fbuftype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_fbuftype_InsertMaybe(amc::FFbuftype& row) { - ind_fbuftype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fbuftype_next == (amc::FFbuftype*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.fbuftype) & (_db.ind_fbuftype_buckets_n - 1); + row.ind_fbuftype_hashval = algo::Smallstr50_Hash(0, row.fbuftype); + ind_fbuftype_Reserve(1); + u32 index = row.ind_fbuftype_hashval & (_db.ind_fbuftype_buckets_n - 1); amc::FFbuftype* *prev = &_db.ind_fbuftype_buckets_elems[index]; do { amc::FFbuftype* ret = *prev; @@ -23605,7 +23171,7 @@ bool amc::ind_fbuftype_InsertMaybe(amc::FFbuftype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_fbuftype_Remove(amc::FFbuftype& row) { if (LIKELY(row.ind_fbuftype_next != (amc::FFbuftype*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.fbuftype) & (_db.ind_fbuftype_buckets_n - 1); + u32 index = row.ind_fbuftype_hashval & (_db.ind_fbuftype_buckets_n - 1); amc::FFbuftype* *prev = &_db.ind_fbuftype_buckets_elems[index]; // addr of pointer to current element while (amc::FFbuftype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -23622,8 +23188,14 @@ void amc::ind_fbuftype_Remove(amc::FFbuftype& row) { // --- amc.FDb.ind_fbuftype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_fbuftype_Reserve(int n) { + ind_fbuftype_AbsReserve(_db.ind_fbuftype_n + n); +} + +// --- amc.FDb.ind_fbuftype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_fbuftype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fbuftype_buckets_n; - u32 new_nelems = _db.ind_fbuftype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -23642,7 +23214,7 @@ void amc::ind_fbuftype_Reserve(int n) { while (elem) { amc::FFbuftype &row = *elem; amc::FFbuftype* next = row.ind_fbuftype_next; - u32 index = algo::Smallstr50_Hash(0, row.fbuftype) & (new_nbuckets-1); + u32 index = row.ind_fbuftype_hashval & (new_nbuckets-1); row.ind_fbuftype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -23655,30 +23227,792 @@ void amc::ind_fbuftype_Reserve(int n) { } } -// --- amc.FDb.trace.RowidFind -// find trace by row id (used to implement reflection) -static algo::ImrowPtr amc::trace_RowidFind(int t) { - return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +// --- amc.FDb.nsjs.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +amc::FNsjs& amc::nsjs_Alloc() { + amc::FNsjs* row = nsjs_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("amc.out_of_mem field:amc.FDb.nsjs comment:'Alloc failed'"); + } + return *row; } -// --- amc.FDb.trace.N -// Function return 1 -inline static i32 amc::trace_N() { - return 1; +// --- amc.FDb.nsjs.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +amc::FNsjs* amc::nsjs_AllocMaybe() { + amc::FNsjs *row = (amc::FNsjs*)nsjs_AllocMem(); + if (row) { + new (row) amc::FNsjs; // call constructor + } + return row; } -// --- amc.FDb.bh_enumstr_len_curs.Add -static void amc::_db_bh_enumstr_len_curs_Add(_db_bh_enumstr_len_curs &curs, amc::FEnumstrLen& row) { - u32 n = curs.temp_n; - int i = n; - curs.temp_n = n+1; - amc::FEnumstrLen* *elems = curs.temp_elems; - while (i>0) { - int j = (i-1)/2; - amc::FEnumstrLen* p = elems[j]; - if (!bh_enumstr_len_ElemLt(row,*p)) { - break; - } +// --- amc.FDb.nsjs.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +amc::FNsjs* amc::nsjs_InsertMaybe(const dmmeta::Nsjs &value) { + amc::FNsjs *row = &nsjs_Alloc(); // if out of memory, process dies. if input error, return NULL. + nsjs_CopyIn(*row,const_cast(value)); + bool ok = nsjs_XrefMaybe(*row); // this may return false + if (!ok) { + nsjs_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- amc.FDb.nsjs.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* amc::nsjs_AllocMem() { + u64 new_nelems = _db.nsjs_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + nsjs_qFind(u64(n)).~FNsjs(); // destroy last element + _db.nsjs_n = i32(n); + } +} + +// --- amc.FDb.nsjs.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void amc::nsjs_RemoveLast() { + u64 n = _db.nsjs_n; + if (n > 0) { + n -= 1; + nsjs_qFind(u64(n)).~FNsjs(); + _db.nsjs_n = i32(n); + } +} + +// --- amc.FDb.nsjs.InputMaybe +static bool amc::nsjs_InputMaybe(dmmeta::Nsjs &elem) { + bool retval = true; + retval = nsjs_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- amc.FDb.nsjs.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool amc::nsjs_XrefMaybe(amc::FNsjs &row) { + bool retval = true; + (void)row; + amc::FNs* p_ns = amc::ind_ns_Find(row.ns); + if (UNLIKELY(!p_ns)) { + algo_lib::ResetErrtext() << "amc.bad_xref index:amc.FDb.ind_ns" << Keyval("key", row.ns); + return false; + } + // insert nsjs into index c_nsjs + if (true) { // user-defined insert condition + bool success = c_nsjs_InsertMaybe(*p_ns, row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "amc.duplicate_key xref:amc.FNs.c_nsjs"; // check for duplicate key + return false; + } + } + return retval; +} + +// --- amc.FDb.jstype.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +amc::FJstype& amc::jstype_Alloc() { + amc::FJstype* row = jstype_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("amc.out_of_mem field:amc.FDb.jstype comment:'Alloc failed'"); + } + return *row; +} + +// --- amc.FDb.jstype.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +amc::FJstype* amc::jstype_AllocMaybe() { + amc::FJstype *row = (amc::FJstype*)jstype_AllocMem(); + if (row) { + new (row) amc::FJstype; // call constructor + } + return row; +} + +// --- amc.FDb.jstype.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +amc::FJstype* amc::jstype_InsertMaybe(const dmmeta::Jstype &value) { + amc::FJstype *row = &jstype_Alloc(); // if out of memory, process dies. if input error, return NULL. + jstype_CopyIn(*row,const_cast(value)); + bool ok = jstype_XrefMaybe(*row); // this may return false + if (!ok) { + jstype_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- amc.FDb.jstype.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* amc::jstype_AllocMem() { + u64 new_nelems = _db.jstype_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + jstype_qFind(u64(n)).~FJstype(); // destroy last element + _db.jstype_n = i32(n); + } +} + +// --- amc.FDb.jstype.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void amc::jstype_RemoveLast() { + u64 n = _db.jstype_n; + if (n > 0) { + n -= 1; + jstype_qFind(u64(n)).~FJstype(); + _db.jstype_n = i32(n); + } +} + +// --- amc.FDb.jstype.InputMaybe +static bool amc::jstype_InputMaybe(dmmeta::Jstype &elem) { + bool retval = true; + retval = jstype_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- amc.FDb.jstype.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool amc::jstype_XrefMaybe(amc::FJstype &row) { + bool retval = true; + (void)row; + amc::FCtype* p_ctype = amc::ind_ctype_Find(row.ctype); + if (UNLIKELY(!p_ctype)) { + algo_lib::ResetErrtext() << "amc.bad_xref index:amc.FDb.ind_ctype" << Keyval("key", row.ctype); + return false; + } + // insert jstype into index c_jstype + if (true) { // user-defined insert condition + bool success = c_jstype_InsertMaybe(*p_ctype, row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "amc.duplicate_key xref:amc.FCtype.c_jstype"; // check for duplicate key + return false; + } + } + return retval; +} + +// --- amc.FDb.ckafka.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +amc::FCkafka& amc::ckafka_Alloc() { + amc::FCkafka* row = ckafka_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("amc.out_of_mem field:amc.FDb.ckafka comment:'Alloc failed'"); + } + return *row; +} + +// --- amc.FDb.ckafka.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +amc::FCkafka* amc::ckafka_AllocMaybe() { + amc::FCkafka *row = (amc::FCkafka*)ckafka_AllocMem(); + if (row) { + new (row) amc::FCkafka; // call constructor + } + return row; +} + +// --- amc.FDb.ckafka.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +amc::FCkafka* amc::ckafka_InsertMaybe(const dmmeta::Ckafka &value) { + amc::FCkafka *row = &ckafka_Alloc(); // if out of memory, process dies. if input error, return NULL. + ckafka_CopyIn(*row,const_cast(value)); + bool ok = ckafka_XrefMaybe(*row); // this may return false + if (!ok) { + ckafka_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- amc.FDb.ckafka.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* amc::ckafka_AllocMem() { + u64 new_nelems = _db.ckafka_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + ckafka_qFind(u64(n)).~FCkafka(); // destroy last element + _db.ckafka_n = i32(n); + } +} + +// --- amc.FDb.ckafka.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void amc::ckafka_RemoveLast() { + u64 n = _db.ckafka_n; + if (n > 0) { + n -= 1; + ckafka_qFind(u64(n)).~FCkafka(); + _db.ckafka_n = i32(n); + } +} + +// --- amc.FDb.ckafka.InputMaybe +static bool amc::ckafka_InputMaybe(dmmeta::Ckafka &elem) { + bool retval = true; + retval = ckafka_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- amc.FDb.ckafka.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool amc::ckafka_XrefMaybe(amc::FCkafka &row) { + bool retval = true; + (void)row; + amc::FCtype* p_ctype = amc::ind_ctype_Find(row.ctype); + if (UNLIKELY(!p_ctype)) { + algo_lib::ResetErrtext() << "amc.bad_xref index:amc.FDb.ind_ctype" << Keyval("key", row.ctype); + return false; + } + // insert ckafka into index c_ckafka + if (true) { // user-defined insert condition + bool success = c_ckafka_InsertMaybe(*p_ctype, row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "amc.duplicate_key xref:amc.FCtype.c_ckafka"; // check for duplicate key + return false; + } + } + return retval; +} + +// --- amc.FDb.fkafka.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +amc::FFkafka& amc::fkafka_Alloc() { + amc::FFkafka* row = fkafka_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("amc.out_of_mem field:amc.FDb.fkafka comment:'Alloc failed'"); + } + return *row; +} + +// --- amc.FDb.fkafka.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +amc::FFkafka* amc::fkafka_AllocMaybe() { + amc::FFkafka *row = (amc::FFkafka*)fkafka_AllocMem(); + if (row) { + new (row) amc::FFkafka; // call constructor + } + return row; +} + +// --- amc.FDb.fkafka.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +amc::FFkafka* amc::fkafka_InsertMaybe(const dmmeta::Fkafka &value) { + amc::FFkafka *row = &fkafka_Alloc(); // if out of memory, process dies. if input error, return NULL. + fkafka_CopyIn(*row,const_cast(value)); + bool ok = fkafka_XrefMaybe(*row); // this may return false + if (!ok) { + fkafka_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- amc.FDb.fkafka.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* amc::fkafka_AllocMem() { + u64 new_nelems = _db.fkafka_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + fkafka_qFind(u64(n)).~FFkafka(); // destroy last element + _db.fkafka_n = i32(n); + } +} + +// --- amc.FDb.fkafka.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void amc::fkafka_RemoveLast() { + u64 n = _db.fkafka_n; + if (n > 0) { + n -= 1; + fkafka_qFind(u64(n)).~FFkafka(); + _db.fkafka_n = i32(n); + } +} + +// --- amc.FDb.fkafka.InputMaybe +static bool amc::fkafka_InputMaybe(dmmeta::Fkafka &elem) { + bool retval = true; + retval = fkafka_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- amc.FDb.fkafka.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool amc::fkafka_XrefMaybe(amc::FFkafka &row) { + bool retval = true; + (void)row; + amc::FField* p_field = amc::ind_field_Find(row.field); + if (UNLIKELY(!p_field)) { + algo_lib::ResetErrtext() << "amc.bad_xref index:amc.FDb.ind_field" << Keyval("key", row.field); + return false; + } + // insert fkafka into index c_fkafka + if (true) { // user-defined insert condition + bool success = c_fkafka_InsertMaybe(*p_field, row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "amc.duplicate_key xref:amc.FField.c_fkafka"; // check for duplicate key + return false; + } + } + return retval; +} + +// --- amc.FDb.userfunc.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +amc::FUserfunc& amc::userfunc_Alloc() { + amc::FUserfunc* row = userfunc_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("amc.out_of_mem field:amc.FDb.userfunc comment:'Alloc failed'"); + } + return *row; +} + +// --- amc.FDb.userfunc.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +amc::FUserfunc* amc::userfunc_AllocMaybe() { + amc::FUserfunc *row = (amc::FUserfunc*)userfunc_AllocMem(); + if (row) { + new (row) amc::FUserfunc; // call constructor + } + return row; +} + +// --- amc.FDb.userfunc.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +amc::FUserfunc* amc::userfunc_InsertMaybe(const dmmeta::Userfunc &value) { + amc::FUserfunc *row = &userfunc_Alloc(); // if out of memory, process dies. if input error, return NULL. + userfunc_CopyIn(*row,const_cast(value)); + bool ok = userfunc_XrefMaybe(*row); // this may return false + if (!ok) { + userfunc_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- amc.FDb.userfunc.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* amc::userfunc_AllocMem() { + u64 new_nelems = _db.userfunc_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + userfunc_qFind(u64(n)).~FUserfunc(); // destroy last element + _db.userfunc_n = i32(n); + } +} + +// --- amc.FDb.userfunc.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void amc::userfunc_RemoveLast() { + u64 n = _db.userfunc_n; + if (n > 0) { + n -= 1; + userfunc_qFind(u64(n)).~FUserfunc(); + _db.userfunc_n = i32(n); + } +} + +// --- amc.FDb.userfunc.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool amc::userfunc_XrefMaybe(amc::FUserfunc &row) { + bool retval = true; + (void)row; + return retval; +} + +// --- amc.FDb.steptype.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +amc::FSteptype& amc::steptype_Alloc() { + amc::FSteptype* row = steptype_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("amc.out_of_mem field:amc.FDb.steptype comment:'Alloc failed'"); + } + return *row; +} + +// --- amc.FDb.steptype.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +amc::FSteptype* amc::steptype_AllocMaybe() { + amc::FSteptype *row = (amc::FSteptype*)steptype_AllocMem(); + if (row) { + new (row) amc::FSteptype; // call constructor + } + return row; +} + +// --- amc.FDb.steptype.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +amc::FSteptype* amc::steptype_InsertMaybe(const dmmeta::Steptype &value) { + amc::FSteptype *row = &steptype_Alloc(); // if out of memory, process dies. if input error, return NULL. + steptype_CopyIn(*row,const_cast(value)); + bool ok = steptype_XrefMaybe(*row); // this may return false + if (!ok) { + steptype_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- amc.FDb.steptype.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* amc::steptype_AllocMem() { + u64 new_nelems = _db.steptype_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + steptype_qFind(u64(n)).~FSteptype(); // destroy last element + _db.steptype_n = i32(n); + } +} + +// --- amc.FDb.steptype.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void amc::steptype_RemoveLast() { + u64 n = _db.steptype_n; + if (n > 0) { + n -= 1; + steptype_qFind(u64(n)).~FSteptype(); + _db.steptype_n = i32(n); + } +} + +// --- amc.FDb.steptype.InputMaybe +static bool amc::steptype_InputMaybe(dmmeta::Steptype &elem) { + bool retval = true; + retval = steptype_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- amc.FDb.steptype.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool amc::steptype_XrefMaybe(amc::FSteptype &row) { + bool retval = true; + (void)row; + // insert steptype into index ind_steptype + if (true) { // user-defined insert condition + bool success = ind_steptype_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "amc.duplicate_key xref:amc.FDb.ind_steptype"; // check for duplicate key + return false; + } + } + return retval; +} + +// --- amc.FDb.ind_steptype.Find +// Find row by key. Return NULL if not found. +amc::FSteptype* amc::ind_steptype_Find(const algo::strptr& key) { + u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_steptype_buckets_n - 1); + amc::FSteptype *ret = _db.ind_steptype_buckets_elems[index]; + for (; ret && !((*ret).steptype == key); ret = ret->ind_steptype_next) { + } + return ret; +} + +// --- amc.FDb.ind_steptype.GetOrCreate +// Find row by key. If not found, create and x-reference a new row with with this key. +amc::FSteptype& amc::ind_steptype_GetOrCreate(const algo::strptr& key) { + amc::FSteptype* ret = ind_steptype_Find(key); + if (!ret) { // if memory alloc fails, process dies; if insert fails, function returns NULL. + ret = &steptype_Alloc(); + (*ret).steptype = key; + bool good = steptype_XrefMaybe(*ret); + if (!good) { + steptype_RemoveLast(); // delete offending row, any existing xrefs are cleared + ret = NULL; + } + } + vrfy(ret, tempstr() << "amc.create_error table:ind_steptype key:'"<ind_steptype_next; + } while (true); + if (retval) { + row.ind_steptype_next = *prev; + _db.ind_steptype_n++; + *prev = &row; + } + } + return retval; +} + +// --- amc.FDb.ind_steptype.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void amc::ind_steptype_Remove(amc::FSteptype& row) { + if (LIKELY(row.ind_steptype_next != (amc::FSteptype*)-1)) {// check if in hash already + u32 index = row.ind_steptype_hashval & (_db.ind_steptype_buckets_n - 1); + amc::FSteptype* *prev = &_db.ind_steptype_buckets_elems[index]; // addr of pointer to current element + while (amc::FSteptype *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_steptype_next; // unlink (singly linked list) + _db.ind_steptype_n--; + row.ind_steptype_next = (amc::FSteptype*)-1;// not-in-hash + break; + } + prev = &next->ind_steptype_next; + } + } +} + +// --- amc.FDb.ind_steptype.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void amc::ind_steptype_Reserve(int n) { + ind_steptype_AbsReserve(_db.ind_steptype_n + n); +} + +// --- amc.FDb.ind_steptype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_steptype_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_steptype_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(amc::FSteptype*); + u32 new_size = new_nbuckets * sizeof(amc::FSteptype*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + amc::FSteptype* *new_buckets = (amc::FSteptype**)amc::lpool_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("amc.out_of_memory field:amc.FDb.ind_steptype"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_steptype_buckets_n; i++) { + amc::FSteptype* elem = _db.ind_steptype_buckets_elems[i]; + while (elem) { + amc::FSteptype &row = *elem; + amc::FSteptype* next = row.ind_steptype_next; + u32 index = row.ind_steptype_hashval & (new_nbuckets-1); + row.ind_steptype_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + amc::lpool_FreeMem(_db.ind_steptype_buckets_elems, old_size); + _db.ind_steptype_buckets_elems = new_buckets; + _db.ind_steptype_buckets_n = new_nbuckets; + } +} + +// --- amc.FDb.trace.RowidFind +// find trace by row id (used to implement reflection) +static algo::ImrowPtr amc::trace_RowidFind(int t) { + return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +} + +// --- amc.FDb.trace.N +// Function return 1 +inline static i32 amc::trace_N() { + return 1; +} + +// --- amc.FDb.bh_enumstr_len_curs.Add +static void amc::_db_bh_enumstr_len_curs_Add(_db_bh_enumstr_len_curs &curs, amc::FEnumstrLen& row) { + u32 n = curs.temp_n; + int i = n; + curs.temp_n = n+1; + amc::FEnumstrLen* *elems = curs.temp_elems; + while (i>0) { + int j = (i-1)/2; + amc::FEnumstrLen* p = elems[j]; + if (!bh_enumstr_len_ElemLt(row,*p)) { + break; + } elems[i]=p; i=j; } @@ -24648,9 +24982,6 @@ void amc::FDb_Init() { _db.dispsig_lary[i] = dispsig_first; dispsig_first += 1ULL<=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FDispatchmsg* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FDispatchmsg*) * (lim - j); + size_t nbytes = sizeof(amc::FDispatchmsg*) * (n - j); memmove(elems + i, elems + j, nbytes); - dispatch.c_dispatch_msg_n = lim - 1; + dispatch.c_dispatch_msg_n = n - 1; break; } } @@ -25940,6 +26351,8 @@ void amc::FDispatch_Init(amc::FDispatch& dispatch) { dispatch.haslen = bool(false); dispatch.call = bool(false); dispatch.strict = bool(false); + dispatch.dyn = bool(false); + dispatch.kafka = bool(false); dispatch.p_ctype_hdr = NULL; dispatch.p_casetype = NULL; dispatch.c_dispfilter = NULL; @@ -25951,6 +26364,7 @@ void amc::FDispatch_Init(amc::FDispatch& dispatch) { dispatch.c_dispctx = NULL; dispatch.ns_c_dispatch_in_ary = bool(false); dispatch.ind_dispatch_next = (amc::FDispatch*)-1; // (amc.FDb.ind_dispatch) not-in-hash + dispatch.ind_dispatch_hashval = 0; // stored hash value } // --- amc.FDispatch..Uninit @@ -26080,7 +26494,6 @@ algo::Smallstr50 amc::name_Get(amc::FDispsig& dispsig) { // --- amc.FDispsig..Uninit void amc::FDispsig_Uninit(amc::FDispsig& dispsig) { amc::FDispsig &row = dispsig; (void)row; - c_dispsig_sorted_Remove(row); // remove dispsig from index c_dispsig_sorted amc::FNs* p_ns = amc::ind_ns_Find(ns_Get(row)); if (p_ns) { c_dispsig_Remove(*p_ns, row);// remove dispsig from index c_dispsig @@ -26116,14 +26529,9 @@ void amc::FDisptrace_Uninit(amc::FDisptrace& disptrace) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_fconst_Insert(amc::FEnumstr& enumstr, amc::FFconst& row) { - // reserve space c_fconst_Reserve(enumstr, 1); - u32 n = enumstr.c_fconst_n; - u32 at = n; - amc::FFconst* *elems = enumstr.c_fconst_elems; - elems[at] = &row; - enumstr.c_fconst_n = n+1; - + u32 n = enumstr.c_fconst_n++; + enumstr.c_fconst_elems[n] = &row; } // --- amc.FEnumstr.c_fconst.ScanInsertMaybe @@ -26152,20 +26560,18 @@ bool amc::c_fconst_ScanInsertMaybe(amc::FEnumstr& enumstr, amc::FFconst& row) { // --- amc.FEnumstr.c_fconst.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_fconst_Remove(amc::FEnumstr& enumstr, amc::FFconst& row) { - int lim = enumstr.c_fconst_n; - amc::FFconst* *elems = enumstr.c_fconst_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc::FFconst* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FFconst*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - enumstr.c_fconst_n = lim - 1; - break; + int n = enumstr.c_fconst_n; + int j=0; + for (int i=0; ibh_enumstr_idx = idx; + p->enumstr_len_bh_enumstr_idx = idx; elems[idx] = p; idx = child; child = idx*2+1; @@ -26238,12 +26644,12 @@ static int amc::bh_enumstr_Downheap(amc::FEnumstrLen& enumstr_len, amc::FEnumstr // --- amc.FEnumstrLen.bh_enumstr.Insert // Insert row. Row must not already be in index. If row is already in index, do nothing. void amc::bh_enumstr_Insert(amc::FEnumstrLen& enumstr_len, amc::FEnumstr& row) { - if (LIKELY(row.bh_enumstr_idx == -1)) { + if (LIKELY(row.enumstr_len_bh_enumstr_idx == -1)) { bh_enumstr_Reserve(enumstr_len, 1); int n = enumstr_len.bh_enumstr_n; enumstr_len.bh_enumstr_n = n + 1; int new_idx = bh_enumstr_Upheap(enumstr_len, row, n); - row.bh_enumstr_idx = new_idx; + row.enumstr_len_bh_enumstr_idx = new_idx; enumstr_len.bh_enumstr_elems[new_idx] = &row; } } @@ -26252,7 +26658,7 @@ void amc::bh_enumstr_Insert(amc::FEnumstrLen& enumstr_len, amc::FEnumstr& row) { // If row is in heap, update its position. If row is not in heap, insert it. // Return new position of item in the heap (0=top) i32 amc::bh_enumstr_Reheap(amc::FEnumstrLen& enumstr_len, amc::FEnumstr& row) { - int old_idx = row.bh_enumstr_idx; + int old_idx = row.enumstr_len_bh_enumstr_idx; bool isnew = old_idx == -1; if (isnew) { bh_enumstr_Reserve(enumstr_len, 1); @@ -26262,7 +26668,7 @@ i32 amc::bh_enumstr_Reheap(amc::FEnumstrLen& enumstr_len, amc::FEnumstr& row) { if (!isnew && new_idx == old_idx) { new_idx = bh_enumstr_Downheap(enumstr_len, row, old_idx); } - row.bh_enumstr_idx = new_idx; + row.enumstr_len_bh_enumstr_idx = new_idx; enumstr_len.bh_enumstr_elems[new_idx] = &row; return new_idx; } @@ -26275,7 +26681,7 @@ i32 amc::bh_enumstr_Reheap(amc::FEnumstrLen& enumstr_len, amc::FEnumstr& row) { i32 amc::bh_enumstr_ReheapFirst(amc::FEnumstrLen& enumstr_len) { amc::FEnumstr &row = *enumstr_len.bh_enumstr_elems[0]; i32 new_idx = bh_enumstr_Downheap(enumstr_len, row, 0); - row.bh_enumstr_idx = new_idx; + row.enumstr_len_bh_enumstr_idx = new_idx; enumstr_len.bh_enumstr_elems[new_idx] = &row; return new_idx; } @@ -26284,9 +26690,9 @@ i32 amc::bh_enumstr_ReheapFirst(amc::FEnumstrLen& enumstr_len) { // Remove element from index. If element is not in index, do nothing. void amc::bh_enumstr_Remove(amc::FEnumstrLen& enumstr_len, amc::FEnumstr& row) { if (bh_enumstr_InBheapQ(row)) { - int old_idx = row.bh_enumstr_idx; + int old_idx = row.enumstr_len_bh_enumstr_idx; if (enumstr_len.bh_enumstr_elems[old_idx] == &row) { // sanity check: heap points back to row - row.bh_enumstr_idx = -1; // mark not in heap + row.enumstr_len_bh_enumstr_idx = -1; // mark not in heap i32 n = enumstr_len.bh_enumstr_n - 1; // index of last element in heap enumstr_len.bh_enumstr_n = n; // decrease count if (old_idx != n) { @@ -26295,7 +26701,7 @@ void amc::bh_enumstr_Remove(amc::FEnumstrLen& enumstr_len, amc::FEnumstr& row) { if (new_idx == old_idx) { new_idx = bh_enumstr_Downheap(enumstr_len, *elem, old_idx); } - elem->bh_enumstr_idx = new_idx; + elem->enumstr_len_bh_enumstr_idx = new_idx; enumstr_len.bh_enumstr_elems[new_idx] = elem; } } @@ -26307,7 +26713,7 @@ void amc::bh_enumstr_Remove(amc::FEnumstrLen& enumstr_len, amc::FEnumstr& row) { void amc::bh_enumstr_RemoveAll(amc::FEnumstrLen& enumstr_len) { int n = enumstr_len.bh_enumstr_n; for (int i = n - 1; i>=0; i--) { - enumstr_len.bh_enumstr_elems[i]->bh_enumstr_idx = -1; // mark not-in-heap + enumstr_len.bh_enumstr_elems[i]->enumstr_len_bh_enumstr_idx = -1; // mark not-in-heap } enumstr_len.bh_enumstr_n = 0; } @@ -26319,13 +26725,13 @@ amc::FEnumstr* amc::bh_enumstr_RemoveFirst(amc::FEnumstrLen& enumstr_len) { amc::FEnumstr *row = NULL; if (enumstr_len.bh_enumstr_n > 0) { row = enumstr_len.bh_enumstr_elems[0]; - row->bh_enumstr_idx = -1; // mark not in heap + row->enumstr_len_bh_enumstr_idx = -1; // mark not in heap i32 n = enumstr_len.bh_enumstr_n - 1; // index of last element in heap enumstr_len.bh_enumstr_n = n; // decrease count if (n) { amc::FEnumstr &elem = *enumstr_len.bh_enumstr_elems[n]; int new_idx = bh_enumstr_Downheap(enumstr_len, elem, 0); - elem.bh_enumstr_idx = new_idx; + elem.enumstr_len_bh_enumstr_idx = new_idx; enumstr_len.bh_enumstr_elems[new_idx] = &elem; } } @@ -26360,7 +26766,7 @@ static int amc::bh_enumstr_Upheap(amc::FEnumstrLen& enumstr_len, amc::FEnumstr& if (!bh_enumstr_ElemLt(enumstr_len, row, *p)) { break; } - p->bh_enumstr_idx = idx; + p->enumstr_len_bh_enumstr_idx = idx; elems[idx] = p; idx = j; } @@ -26448,7 +26854,7 @@ void amc::enumstr_len_bh_enumstr_curs_Next(enumstr_len_bh_enumstr_curs &curs) { i = l; } while (i < n); curs.temp_n = n-1; - int index = dead->bh_enumstr_idx; + int index = dead->enumstr_len_bh_enumstr_idx; i = (index*2+1); if (i < bh_enumstr_N((*curs.parent))) { amc::FEnumstr &elem = *curs.parent->bh_enumstr_elems[i]; @@ -26576,6 +26982,7 @@ void amc::fbuf_CopyOut(amc::FFbuf &row, dmmeta::Fbuf &out) { out.fbuftype = row.fbuftype; out.insready = row.insready; out.inseof = row.inseof; + out.iotype = row.iotype; // comment: field stripped (see dmmeta.fbase:amc.FFbuf.msghdr) } @@ -26587,6 +26994,7 @@ void amc::fbuf_CopyIn(amc::FFbuf &row, dmmeta::Fbuf &in) { row.fbuftype = in.fbuftype; row.insready = in.insready; row.inseof = in.inseof; + row.iotype = in.iotype; // comment: field stripped (see dmmeta.fbase:amc.FFbuf.msghdr) } @@ -26596,6 +27004,18 @@ algo::Smallstr50 amc::fbufdir_Get(amc::FFbuf& fbuf) { return ret; } +// --- amc.FFbuf..Init +// Set all fields to initial values. +void amc::FFbuf_Init(amc::FFbuf& fbuf) { + fbuf.max = u32(0); + fbuf.iotype = algo::strptr("standard"); + fbuf.p_insready = NULL; + fbuf.p_inseof = NULL; + fbuf.p_fbuftype = NULL; + fbuf.ind_fbuf_next = (amc::FFbuf*)-1; // (amc.FDb.ind_fbuf) not-in-hash + fbuf.ind_fbuf_hashval = 0; // stored hash value +} + // --- amc.FFbuf..Uninit void amc::FFbuf_Uninit(amc::FFbuf& fbuf) { amc::FFbuf &row = fbuf; (void)row; @@ -26724,7 +27144,8 @@ void amc::FFcmap_Init(amc::FFcmap& fcmap) { fcmap.p_rightField = NULL; fcmap.c_convfunc = NULL; fcmap.ind_fcmap_next = (amc::FFcmap*)-1; // (amc.FDb.ind_fcmap) not-in-hash - fcmap.zs_fcmap_next = (amc::FFcmap*)-1; // (amc.FField.zs_fcmap) not-in-list + fcmap.ind_fcmap_hashval = 0; // stored hash value + fcmap.field_zs_fcmap_next = (amc::FFcmap*)-1; // (amc.FField.zs_fcmap) not-in-list } // --- amc.FFcmap..Uninit @@ -26857,7 +27278,9 @@ void amc::FFconst_Init(amc::FFconst& fconst) { fconst.int_val = i64(0); fconst.field_c_fconst_in_ary = bool(false); fconst.ind_fconst_next = (amc::FFconst*)-1; // (amc.FDb.ind_fconst) not-in-hash + fconst.ind_fconst_hashval = 0; // stored hash value fconst.ind_fconst_int_next = (amc::FFconst*)-1; // (amc.FDb.ind_fconst_int) not-in-hash + fconst.ind_fconst_int_hashval = 0; // stored hash value } // --- amc.FFconst..Uninit @@ -27116,14 +27539,9 @@ algo::Smallstr50 amc::name_Get(amc::FField& field) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_ffunc_Insert(amc::FField& field, amc::FFunc& row) { - // reserve space c_ffunc_Reserve(field, 1); - u32 n = field.c_ffunc_n; - u32 at = n; - amc::FFunc* *elems = field.c_ffunc_elems; - elems[at] = &row; - field.c_ffunc_n = n+1; - + u32 n = field.c_ffunc_n++; + field.c_ffunc_elems[n] = &row; } // --- amc.FField.c_ffunc.ScanInsertMaybe @@ -27152,20 +27570,18 @@ bool amc::c_ffunc_ScanInsertMaybe(amc::FField& field, amc::FFunc& row) { // --- amc.FField.c_ffunc.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_ffunc_Remove(amc::FField& field, amc::FFunc& row) { - int lim = field.c_ffunc_n; - amc::FFunc* *elems = field.c_ffunc_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc::FFunc* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FFunc*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - field.c_ffunc_n = lim - 1; - break; + int n = field.c_ffunc_n; + int j=0; + for (int i=0; i=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FFconst* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FFconst*) * (lim - j); + size_t nbytes = sizeof(amc::FFconst*) * (n - j); memmove(elems + i, elems + j, nbytes); - field.c_fconst_n = lim - 1; + field.c_fconst_n = n - 1; break; } } @@ -27252,12 +27664,12 @@ void amc::c_fconst_Reserve(amc::FField& field, u32 n) { // --- amc.FField.zd_xref_keyfld.Insert // Insert row into linked list. If row is already in linked list, do nothing. void amc::zd_xref_keyfld_Insert(amc::FField& field, amc::FXref& row) { - if (!zd_xref_keyfld_InLlistQ(row)) { + if (!field_zd_xref_keyfld_InLlistQ(row)) { amc::FXref* old_tail = field.zd_xref_keyfld_tail; - row.zd_xref_keyfld_next = NULL; - row.zd_xref_keyfld_prev = old_tail; + row.field_zd_xref_keyfld_next = NULL; + row.field_zd_xref_keyfld_prev = old_tail; field.zd_xref_keyfld_tail = &row; - amc::FXref **new_row_a = &old_tail->zd_xref_keyfld_next; + amc::FXref **new_row_a = &old_tail->field_zd_xref_keyfld_next; amc::FXref **new_row_b = &field.zd_xref_keyfld_head; amc::FXref **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -27268,23 +27680,23 @@ void amc::zd_xref_keyfld_Insert(amc::FField& field, amc::FXref& row) { // --- amc.FField.zd_xref_keyfld.Remove // Remove element from index. If element is not in index, do nothing. void amc::zd_xref_keyfld_Remove(amc::FField& field, amc::FXref& row) { - if (zd_xref_keyfld_InLlistQ(row)) { + if (field_zd_xref_keyfld_InLlistQ(row)) { amc::FXref* old_head = field.zd_xref_keyfld_head; (void)old_head; // in case it's not used - amc::FXref* prev = row.zd_xref_keyfld_prev; - amc::FXref* next = row.zd_xref_keyfld_next; + amc::FXref* prev = row.field_zd_xref_keyfld_prev; + amc::FXref* next = row.field_zd_xref_keyfld_next; // if element is first, adjust list head; otherwise, adjust previous element's next - amc::FXref **new_next_a = &prev->zd_xref_keyfld_next; + amc::FXref **new_next_a = &prev->field_zd_xref_keyfld_next; amc::FXref **new_next_b = &field.zd_xref_keyfld_head; amc::FXref **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - amc::FXref **new_prev_a = &next->zd_xref_keyfld_prev; + amc::FXref **new_prev_a = &next->field_zd_xref_keyfld_prev; amc::FXref **new_prev_b = &field.zd_xref_keyfld_tail; amc::FXref **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; field.zd_xref_keyfld_n--; - row.zd_xref_keyfld_next=(amc::FXref*)-1; // not-in-list + row.field_zd_xref_keyfld_next=(amc::FXref*)-1; // not-in-list } } @@ -27296,9 +27708,9 @@ void amc::zd_xref_keyfld_RemoveAll(amc::FField& field) { field.zd_xref_keyfld_tail = NULL; field.zd_xref_keyfld_n = 0; while (row) { - amc::FXref* row_next = row->zd_xref_keyfld_next; - row->zd_xref_keyfld_next = (amc::FXref*)-1; - row->zd_xref_keyfld_prev = NULL; + amc::FXref* row_next = row->field_zd_xref_keyfld_next; + row->field_zd_xref_keyfld_next = (amc::FXref*)-1; + row->field_zd_xref_keyfld_prev = NULL; row = row_next; } } @@ -27309,14 +27721,14 @@ amc::FXref* amc::zd_xref_keyfld_RemoveFirst(amc::FField& field) { amc::FXref *row = NULL; row = field.zd_xref_keyfld_head; if (row) { - amc::FXref *next = row->zd_xref_keyfld_next; + amc::FXref *next = row->field_zd_xref_keyfld_next; field.zd_xref_keyfld_head = next; - amc::FXref **new_end_a = &next->zd_xref_keyfld_prev; + amc::FXref **new_end_a = &next->field_zd_xref_keyfld_prev; amc::FXref **new_end_b = &field.zd_xref_keyfld_tail; amc::FXref **new_end = next ? new_end_a : new_end_b; *new_end = NULL; field.zd_xref_keyfld_n--; - row->zd_xref_keyfld_next = (amc::FXref*)-1; // mark as not-in-list + row->field_zd_xref_keyfld_next = (amc::FXref*)-1; // mark as not-in-list } return row; } @@ -27324,11 +27736,11 @@ amc::FXref* amc::zd_xref_keyfld_RemoveFirst(amc::FField& field) { // --- amc.FField.zs_fcmap.Insert // Insert row into linked list. If row is already in linked list, do nothing. void amc::zs_fcmap_Insert(amc::FField& field, amc::FFcmap& row) { - if (!zs_fcmap_InLlistQ(row)) { + if (!field_zs_fcmap_InLlistQ(row)) { amc::FFcmap* old_tail = field.zs_fcmap_tail; - row.zs_fcmap_next = NULL; + row.field_zs_fcmap_next = NULL; field.zs_fcmap_tail = &row; - amc::FFcmap **new_row_a = &old_tail->zs_fcmap_next; + amc::FFcmap **new_row_a = &old_tail->field_zs_fcmap_next; amc::FFcmap **new_row_b = &field.zs_fcmap_head; amc::FFcmap **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -27339,13 +27751,13 @@ void amc::zs_fcmap_Insert(amc::FField& field, amc::FFcmap& row) { // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. void amc::zs_fcmap_Remove(amc::FField& field, amc::FFcmap& row) { - if (zs_fcmap_InLlistQ(row)) { + if (field_zs_fcmap_InLlistQ(row)) { amc::FFcmap* old_head = field.zs_fcmap_head; (void)old_head; // in case it's not used amc::FFcmap* prev=NULL; amc::FFcmap* cur = field.zs_fcmap_head; while (cur) { // search for element by pointer - amc::FFcmap* next = cur->zs_fcmap_next; + amc::FFcmap* next = cur->field_zs_fcmap_next; if (cur == &row) { if (!next) { @@ -27353,11 +27765,11 @@ void amc::zs_fcmap_Remove(amc::FField& field, amc::FFcmap& row) { } // disconnect element from linked list if (prev) { - prev->zs_fcmap_next = next; + prev->field_zs_fcmap_next = next; } else { field.zs_fcmap_head = next; } - row.zs_fcmap_next = (amc::FFcmap*)-1; // not-in-list + row.field_zs_fcmap_next = (amc::FFcmap*)-1; // not-in-list break; } prev = cur; @@ -27373,8 +27785,8 @@ void amc::zs_fcmap_RemoveAll(amc::FField& field) { field.zs_fcmap_head = NULL; field.zs_fcmap_tail = NULL; while (row) { - amc::FFcmap* row_next = row->zs_fcmap_next; - row->zs_fcmap_next = (amc::FFcmap*)-1; + amc::FFcmap* row_next = row->field_zs_fcmap_next; + row->field_zs_fcmap_next = (amc::FFcmap*)-1; row = row_next; } } @@ -27385,13 +27797,13 @@ amc::FFcmap* amc::zs_fcmap_RemoveFirst(amc::FField& field) { amc::FFcmap *row = NULL; row = field.zs_fcmap_head; if (row) { - amc::FFcmap *next = row->zs_fcmap_next; + amc::FFcmap *next = row->field_zs_fcmap_next; field.zs_fcmap_head = next; // clear list's tail pointer if list is empty. if (!next) { field.zs_fcmap_tail = NULL; } - row->zs_fcmap_next = (amc::FFcmap*)-1; // mark as not-in-list + row->field_zs_fcmap_next = (amc::FFcmap*)-1; // mark as not-in-list } return row; } @@ -27425,7 +27837,7 @@ static int amc::bh_bitfld_Downheap(amc::FField& field, amc::FBitfld& row, int id if (!bh_bitfld_ElemLt(field, *p,row)) { break; } - p->bh_bitfld_idx = idx; + p->field_bh_bitfld_idx = idx; elems[idx] = p; idx = child; child = idx*2+1; @@ -27436,12 +27848,12 @@ static int amc::bh_bitfld_Downheap(amc::FField& field, amc::FBitfld& row, int id // --- amc.FField.bh_bitfld.Insert // Insert row. Row must not already be in index. If row is already in index, do nothing. void amc::bh_bitfld_Insert(amc::FField& field, amc::FBitfld& row) { - if (LIKELY(row.bh_bitfld_idx == -1)) { + if (LIKELY(row.field_bh_bitfld_idx == -1)) { bh_bitfld_Reserve(field, 1); int n = field.bh_bitfld_n; field.bh_bitfld_n = n + 1; int new_idx = bh_bitfld_Upheap(field, row, n); - row.bh_bitfld_idx = new_idx; + row.field_bh_bitfld_idx = new_idx; field.bh_bitfld_elems[new_idx] = &row; } } @@ -27450,7 +27862,7 @@ void amc::bh_bitfld_Insert(amc::FField& field, amc::FBitfld& row) { // If row is in heap, update its position. If row is not in heap, insert it. // Return new position of item in the heap (0=top) i32 amc::bh_bitfld_Reheap(amc::FField& field, amc::FBitfld& row) { - int old_idx = row.bh_bitfld_idx; + int old_idx = row.field_bh_bitfld_idx; bool isnew = old_idx == -1; if (isnew) { bh_bitfld_Reserve(field, 1); @@ -27460,7 +27872,7 @@ i32 amc::bh_bitfld_Reheap(amc::FField& field, amc::FBitfld& row) { if (!isnew && new_idx == old_idx) { new_idx = bh_bitfld_Downheap(field, row, old_idx); } - row.bh_bitfld_idx = new_idx; + row.field_bh_bitfld_idx = new_idx; field.bh_bitfld_elems[new_idx] = &row; return new_idx; } @@ -27473,7 +27885,7 @@ i32 amc::bh_bitfld_Reheap(amc::FField& field, amc::FBitfld& row) { i32 amc::bh_bitfld_ReheapFirst(amc::FField& field) { amc::FBitfld &row = *field.bh_bitfld_elems[0]; i32 new_idx = bh_bitfld_Downheap(field, row, 0); - row.bh_bitfld_idx = new_idx; + row.field_bh_bitfld_idx = new_idx; field.bh_bitfld_elems[new_idx] = &row; return new_idx; } @@ -27482,9 +27894,9 @@ i32 amc::bh_bitfld_ReheapFirst(amc::FField& field) { // Remove element from index. If element is not in index, do nothing. void amc::bh_bitfld_Remove(amc::FField& field, amc::FBitfld& row) { if (bh_bitfld_InBheapQ(row)) { - int old_idx = row.bh_bitfld_idx; + int old_idx = row.field_bh_bitfld_idx; if (field.bh_bitfld_elems[old_idx] == &row) { // sanity check: heap points back to row - row.bh_bitfld_idx = -1; // mark not in heap + row.field_bh_bitfld_idx = -1; // mark not in heap i32 n = field.bh_bitfld_n - 1; // index of last element in heap field.bh_bitfld_n = n; // decrease count if (old_idx != n) { @@ -27493,7 +27905,7 @@ void amc::bh_bitfld_Remove(amc::FField& field, amc::FBitfld& row) { if (new_idx == old_idx) { new_idx = bh_bitfld_Downheap(field, *elem, old_idx); } - elem->bh_bitfld_idx = new_idx; + elem->field_bh_bitfld_idx = new_idx; field.bh_bitfld_elems[new_idx] = elem; } } @@ -27505,7 +27917,7 @@ void amc::bh_bitfld_Remove(amc::FField& field, amc::FBitfld& row) { void amc::bh_bitfld_RemoveAll(amc::FField& field) { int n = field.bh_bitfld_n; for (int i = n - 1; i>=0; i--) { - field.bh_bitfld_elems[i]->bh_bitfld_idx = -1; // mark not-in-heap + field.bh_bitfld_elems[i]->field_bh_bitfld_idx = -1; // mark not-in-heap } field.bh_bitfld_n = 0; } @@ -27517,13 +27929,13 @@ amc::FBitfld* amc::bh_bitfld_RemoveFirst(amc::FField& field) { amc::FBitfld *row = NULL; if (field.bh_bitfld_n > 0) { row = field.bh_bitfld_elems[0]; - row->bh_bitfld_idx = -1; // mark not in heap + row->field_bh_bitfld_idx = -1; // mark not in heap i32 n = field.bh_bitfld_n - 1; // index of last element in heap field.bh_bitfld_n = n; // decrease count if (n) { amc::FBitfld &elem = *field.bh_bitfld_elems[n]; int new_idx = bh_bitfld_Downheap(field, elem, 0); - elem.bh_bitfld_idx = new_idx; + elem.field_bh_bitfld_idx = new_idx; field.bh_bitfld_elems[new_idx] = &elem; } } @@ -27558,7 +27970,7 @@ static int amc::bh_bitfld_Upheap(amc::FField& field, amc::FBitfld& row, int idx) if (!bh_bitfld_ElemLt(field, row, *p)) { break; } - p->bh_bitfld_idx = idx; + p->field_bh_bitfld_idx = idx; elems[idx] = p; idx = j; } @@ -27575,15 +27987,11 @@ inline static bool amc::bh_bitfld_ElemLt(amc::FField& field, amc::FBitfld &a, am // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_ffast_Insert(amc::FField& field, amc::FFfast& row) { - if (bool_Update(row.field_c_ffast_in_ary,true)) { - // reserve space + if (!row.field_c_ffast_in_ary) { c_ffast_Reserve(field, 1); - u32 n = field.c_ffast_n; - u32 at = n; - amc::FFfast* *elems = field.c_ffast_elems; - elems[at] = &row; - field.c_ffast_n = n+1; - + u32 n = field.c_ffast_n++; + field.c_ffast_elems[n] = &row; + row.field_c_ffast_in_ary = true; } } @@ -27592,7 +28000,7 @@ void amc::c_ffast_Insert(amc::FField& field, amc::FFfast& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_ffast_InsertMaybe(amc::FField& field, amc::FFfast& row) { - bool retval = !row.field_c_ffast_in_ary; + bool retval = !field_c_ffast_InAryQ(row); c_ffast_Insert(field,row); // check is performed in _Insert again return retval; } @@ -27600,18 +28008,18 @@ bool amc::c_ffast_InsertMaybe(amc::FField& field, amc::FFfast& row) { // --- amc.FField.c_ffast.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_ffast_Remove(amc::FField& field, amc::FFfast& row) { + int n = field.c_ffast_n; if (bool_Update(row.field_c_ffast_in_ary,false)) { - int lim = field.c_ffast_n; amc::FFfast* *elems = field.c_ffast_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FFfast* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FFfast*) * (lim - j); + size_t nbytes = sizeof(amc::FFfast*) * (n - j); memmove(elems + i, elems + j, nbytes); - field.c_ffast_n = lim - 1; + field.c_ffast_n = n - 1; break; } } @@ -27639,15 +28047,11 @@ void amc::c_ffast_Reserve(amc::FField& field, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_pmaskfld_member_Insert(amc::FField& field, amc::FPmaskfldMember& row) { - if (bool_Update(row.field_c_pmaskfld_member_in_ary,true)) { - // reserve space + if (!row.field_c_pmaskfld_member_in_ary) { c_pmaskfld_member_Reserve(field, 1); - u32 n = field.c_pmaskfld_member_n; - u32 at = n; - amc::FPmaskfldMember* *elems = field.c_pmaskfld_member_elems; - elems[at] = &row; - field.c_pmaskfld_member_n = n+1; - + u32 n = field.c_pmaskfld_member_n++; + field.c_pmaskfld_member_elems[n] = &row; + row.field_c_pmaskfld_member_in_ary = true; } } @@ -27656,7 +28060,7 @@ void amc::c_pmaskfld_member_Insert(amc::FField& field, amc::FPmaskfldMember& row // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_pmaskfld_member_InsertMaybe(amc::FField& field, amc::FPmaskfldMember& row) { - bool retval = !row.field_c_pmaskfld_member_in_ary; + bool retval = !field_c_pmaskfld_member_InAryQ(row); c_pmaskfld_member_Insert(field,row); // check is performed in _Insert again return retval; } @@ -27664,18 +28068,18 @@ bool amc::c_pmaskfld_member_InsertMaybe(amc::FField& field, amc::FPmaskfldMember // --- amc.FField.c_pmaskfld_member.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_pmaskfld_member_Remove(amc::FField& field, amc::FPmaskfldMember& row) { + int n = field.c_pmaskfld_member_n; if (bool_Update(row.field_c_pmaskfld_member_in_ary,false)) { - int lim = field.c_pmaskfld_member_n; amc::FPmaskfldMember* *elems = field.c_pmaskfld_member_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FPmaskfldMember* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FPmaskfldMember*) * (lim - j); + size_t nbytes = sizeof(amc::FPmaskfldMember*) * (n - j); memmove(elems + i, elems + j, nbytes); - field.c_pmaskfld_member_n = lim - 1; + field.c_pmaskfld_member_n = n - 1; break; } } @@ -27784,13 +28188,17 @@ void amc::FField_Init(amc::FField& field) { field.c_pmaskfld_member_elems = NULL; // (amc.FField.c_pmaskfld_member) field.c_pmaskfld_member_n = 0; // (amc.FField.c_pmaskfld_member) field.c_pmaskfld_member_max = 0; // (amc.FField.c_pmaskfld_member) + field.c_lenfld = NULL; + field.c_fkafka = NULL; field.ctype_c_datafld_in_ary = bool(false); - field._db_c_tempfield_in_ary = bool(false); - field.zd_inst_next = (amc::FField*)-1; // (amc.FCtype.zd_inst) not-in-list - field.zd_inst_prev = NULL; // (amc.FCtype.zd_inst) - field.zd_access_next = (amc::FField*)-1; // (amc.FCtype.zd_access) not-in-list - field.zd_access_prev = NULL; // (amc.FCtype.zd_access) + field.ctype_zd_inst_next = (amc::FField*)-1; // (amc.FCtype.zd_inst) not-in-list + field.ctype_zd_inst_prev = NULL; // (amc.FCtype.zd_inst) + field.ctype_zd_access_next = (amc::FField*)-1; // (amc.FCtype.zd_access) not-in-list + field.ctype_zd_access_prev = NULL; // (amc.FCtype.zd_access) + field.ctype_zd_varlenfld_next = (amc::FField*)-1; // (amc.FCtype.zd_varlenfld) not-in-list + field.ctype_zd_varlenfld_prev = NULL; // (amc.FCtype.zd_varlenfld) field.ind_field_next = (amc::FField*)-1; // (amc.FDb.ind_field) not-in-hash + field.ind_field_hashval = 0; // stored hash value field.zs_ordkeyfield_next = (amc::FField*)-1; // (amc.FDb.zs_ordkeyfield) not-in-list } @@ -27869,7 +28277,7 @@ void amc::field_bh_bitfld_curs_Next(field_bh_bitfld_curs &curs) { i = l; } while (i < n); curs.temp_n = n-1; - int index = dead->bh_bitfld_idx; + int index = dead->field_bh_bitfld_idx; i = (index*2+1); if (i < bh_bitfld_N((*curs.parent))) { amc::FBitfld &elem = *curs.parent->bh_bitfld_elems[i]; @@ -27890,9 +28298,6 @@ void amc::FField_Uninit(amc::FField& field) { if (p_ctype) { c_field_Remove(*p_ctype, row);// remove field from index c_field } - if (p_ctype) { - c_varlenfld_Remove(*p_ctype, row);// remove field from index c_varlenfld - } if (p_ctype) { c_optfld_Remove(*p_ctype, row);// remove field from index c_optfld } @@ -27911,6 +28316,9 @@ void amc::FField_Uninit(amc::FField& field) { zd_access_Remove(*p_arg, row);// remove field from index zd_access } zs_ordkeyfield_Remove(row); // remove field from index zs_ordkeyfield + if (p_ctype) { + zd_varlenfld_Remove(*p_ctype, row);// remove field from index zd_varlenfld + } // amc.FField.c_pmaskfld_member.Uninit (Ptrary) // amc::lpool_FreeMem(field.c_pmaskfld_member_elems, sizeof(amc::FPmaskfldMember*)*field.c_pmaskfld_member_max); // (amc.FField.c_pmaskfld_member) @@ -27986,6 +28394,37 @@ void amc::FFinput_Uninit(amc::FFinput& finput) { } } +// --- amc.FFkafka.base.CopyOut +// Copy fields out of row +void amc::fkafka_CopyOut(amc::FFkafka &row, dmmeta::Fkafka &out) { + out.field = row.field; + out.versions = row.versions; + out.nullable_versions = row.nullable_versions; + out.tagged_versions = row.tagged_versions; + out.tag = row.tag; + out.comment = row.comment; +} + +// --- amc.FFkafka.base.CopyIn +// Copy fields in to row +void amc::fkafka_CopyIn(amc::FFkafka &row, dmmeta::Fkafka &in) { + row.field = in.field; + row.versions = in.versions; + row.nullable_versions = in.nullable_versions; + row.tagged_versions = in.tagged_versions; + row.tag = in.tag; + row.comment = in.comment; +} + +// --- amc.FFkafka..Uninit +void amc::FFkafka_Uninit(amc::FFkafka& fkafka) { + amc::FFkafka &row = fkafka; (void)row; + amc::FField* p_field = amc::ind_field_Find(row.field); + if (p_field) { + c_fkafka_Remove(*p_field, row);// remove fkafka from index c_fkafka + } +} + // --- amc.FFldoffset.msghdr.CopyOut // Copy fields out of row void amc::fldoffset_CopyOut(amc::FFldoffset &row, dmmeta::Fldoffset &out) { @@ -28208,6 +28647,17 @@ algo::Smallstr50 amc::name_Get(amc::FFstep& fstep) { return ret; } +// --- amc.FFstep..Init +// Set all fields to initial values. +void amc::FFstep_Init(amc::FFstep& fstep) { + fstep.c_fdelay = NULL; + fstep.p_field = NULL; + fstep.p_steptype = NULL; + fstep.ns_c_fstep_in_ary = bool(false); + fstep.ind_fstep_next = (amc::FFstep*)-1; // (amc.FDb.ind_fstep) not-in-hash + fstep.ind_fstep_hashval = 0; // stored hash value +} + // --- amc.FFstep..Uninit void amc::FFstep_Uninit(amc::FFstep& fstep) { amc::FFstep &row = fstep; (void)row; @@ -28347,6 +28797,25 @@ algo::aryptr amc::funcarg_AllocN(amc::FFunc& func, int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- amc.FFunc.funcarg.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr amc::funcarg_AllocNAt(amc::FFunc& func, int n_elems, int at) { + funcarg_Reserve(func, n_elems); + int n = func.funcarg_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("amc.bad_alloc_n_at field:amc.FFunc.funcarg comment:'index out of range'"); + } + amc::Funcarg *elems = func.funcarg_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(amc::Funcarg)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) amc::Funcarg(); // construct new element, default initialize + } + func.funcarg_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- amc.FFunc.funcarg.Remove // Remove item by index. If index outside of range, do nothing. void amc::funcarg_Remove(amc::FFunc& func, u32 i) { @@ -28429,19 +28898,41 @@ algo::aryptr amc::funcarg_AllocNVal(amc::FFunc& func, int n_elems, return algo::aryptr(elems + old_n, n_elems); } +// --- amc.FFunc.funcarg.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void amc::funcarg_Insary(amc::FFunc& func, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= func.funcarg_elems && rhs.elems < func.funcarg_elems + func.funcarg_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("amc.tary_alias field:amc.FFunc.funcarg comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(func.funcarg_elems+1))) { + FatalErrorExit("amc.bad_insary field:amc.FFunc.funcarg comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = func.funcarg_n - at; + funcarg_Reserve(func, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (func.funcarg_elems + at + nnew + i) amc::Funcarg(func.funcarg_elems[at + i]); + func.funcarg_elems[at + i].~Funcarg(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (func.funcarg_elems + at + i) amc::Funcarg(rhs[i]); + } + func.funcarg_n += nnew; +} + // --- amc.FFunc..Init // Set all fields to initial values. void amc::FFunc_Init(amc::FFunc& func) { func.extrn = bool(false); func.p_ns = NULL; - func.inl = bool(false); func.funcarg_elems = 0; // (amc.FFunc.funcarg) func.funcarg_n = 0; // (amc.FFunc.funcarg) func.funcarg_max = 0; // (amc.FFunc.funcarg) func.printed = bool(false); func.throws = bool(false); func.nothrow = bool(false); - func.oper = bool(false); func.member = bool(false); func.disable = bool(false); func.deprecate = bool(false); @@ -28458,8 +28949,10 @@ void amc::FFunc_Init(amc::FFunc& func) { func.isexplicit = bool(false); func.istmpl = bool(false); func.deleted = bool(false); + func.inl = bool(false); func.ns_c_func_in_ary = bool(false); func.ind_func_next = (amc::FFunc*)-1; // (amc.FDb.ind_func) not-in-hash + func.ind_func_hashval = 0; // stored hash value func.cd_temp_func_next = (amc::FFunc*)-1; // (amc.FDb.cd_temp_func) not-in-list func.cd_temp_func_prev = NULL; // (amc.FDb.cd_temp_func) } @@ -28622,24 +29115,20 @@ void amc::FGen_Uninit(amc::FGen& gen) { // Find row by key. Return NULL if not found. amc::FGenXrefSeen* amc::ind_seen_Find(amc::FGenXref& parent, const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (parent.ind_seen_buckets_n - 1); - amc::FGenXrefSeen* *e = &parent.ind_seen_buckets_elems[index]; - amc::FGenXrefSeen* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).value == key; - if (done) break; - e = &ret->ind_seen_next; - } while (true); + amc::FGenXrefSeen *ret = parent.ind_seen_buckets_elems[index]; + for (; ret && !((*ret).value == key); ret = ret->parent_ind_seen_next) { + } return ret; } // --- amc.FGenXref.ind_seen.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc::ind_seen_InsertMaybe(amc::FGenXref& parent, amc::FGenXrefSeen& row) { - ind_seen_Reserve(parent, 1); bool retval = true; // if already in hash, InsertMaybe returns true - if (LIKELY(row.ind_seen_next == (amc::FGenXrefSeen*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.value) & (parent.ind_seen_buckets_n - 1); + if (LIKELY(row.parent_ind_seen_next == (amc::FGenXrefSeen*)-1)) {// check if in hash already + row.parent_ind_seen_hashval = algo::cstring_Hash(0, row.value); + ind_seen_Reserve(parent, 1); + u32 index = row.parent_ind_seen_hashval & (parent.ind_seen_buckets_n - 1); amc::FGenXrefSeen* *prev = &parent.ind_seen_buckets_elems[index]; do { amc::FGenXrefSeen* ret = *prev; @@ -28650,10 +29139,10 @@ bool amc::ind_seen_InsertMaybe(amc::FGenXref& parent, amc::FGenXrefSeen& row) { retval = false; break; } - prev = &ret->ind_seen_next; + prev = &ret->parent_ind_seen_next; } while (true); if (retval) { - row.ind_seen_next = *prev; + row.parent_ind_seen_next = *prev; parent.ind_seen_n++; *prev = &row; } @@ -28664,17 +29153,17 @@ bool amc::ind_seen_InsertMaybe(amc::FGenXref& parent, amc::FGenXrefSeen& row) { // --- amc.FGenXref.ind_seen.Remove // Remove reference to element from hash index. If element is not in hash, do nothing void amc::ind_seen_Remove(amc::FGenXref& parent, amc::FGenXrefSeen& row) { - if (LIKELY(row.ind_seen_next != (amc::FGenXrefSeen*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.value) & (parent.ind_seen_buckets_n - 1); + if (LIKELY(row.parent_ind_seen_next != (amc::FGenXrefSeen*)-1)) {// check if in hash already + u32 index = row.parent_ind_seen_hashval & (parent.ind_seen_buckets_n - 1); amc::FGenXrefSeen* *prev = &parent.ind_seen_buckets_elems[index]; // addr of pointer to current element while (amc::FGenXrefSeen *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_seen_next; // unlink (singly linked list) + *prev = next->parent_ind_seen_next; // unlink (singly linked list) parent.ind_seen_n--; - row.ind_seen_next = (amc::FGenXrefSeen*)-1;// not-in-hash + row.parent_ind_seen_next = (amc::FGenXrefSeen*)-1;// not-in-hash break; } - prev = &next->ind_seen_next; + prev = &next->parent_ind_seen_next; } } } @@ -28682,8 +29171,14 @@ void amc::ind_seen_Remove(amc::FGenXref& parent, amc::FGenXrefSeen& row) { // --- amc.FGenXref.ind_seen.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc::ind_seen_Reserve(amc::FGenXref& parent, int n) { + ind_seen_AbsReserve(parent,parent.ind_seen_n + n); +} + +// --- amc.FGenXref.ind_seen.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc::ind_seen_AbsReserve(amc::FGenXref& parent, int n) { u32 old_nbuckets = parent.ind_seen_buckets_n; - u32 new_nelems = parent.ind_seen_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -28701,9 +29196,9 @@ void amc::ind_seen_Reserve(amc::FGenXref& parent, int n) { amc::FGenXrefSeen* elem = parent.ind_seen_buckets_elems[i]; while (elem) { amc::FGenXrefSeen &row = *elem; - amc::FGenXrefSeen* next = row.ind_seen_next; - u32 index = algo::cstring_Hash(0, row.value) & (new_nbuckets-1); - row.ind_seen_next = new_buckets[index]; + amc::FGenXrefSeen* next = row.parent_ind_seen_next; + u32 index = row.parent_ind_seen_hashval & (new_nbuckets-1); + row.parent_ind_seen_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } @@ -28910,14 +29405,12 @@ void amc::FGsymbol_Uninit(amc::FGsymbol& gsymbol) { // Copy fields out of row void amc::hook_CopyOut(amc::FHook &row, dmmeta::Hook &out) { out.field = row.field; - out.comment = row.comment; } // --- amc.FHook.base.CopyIn // Copy fields in to row void amc::hook_CopyIn(amc::FHook &row, dmmeta::Hook &in) { row.field = in.field; - row.comment = in.comment; } // --- amc.FHook..Uninit @@ -28957,6 +29450,29 @@ void amc::FInlary_Uninit(amc::FInlary& inlary) { } } +// --- amc.FJstype.base.CopyOut +// Copy fields out of row +void amc::jstype_CopyOut(amc::FJstype &row, dmmeta::Jstype &out) { + out.ctype = row.ctype; + out.comment = row.comment; +} + +// --- amc.FJstype.base.CopyIn +// Copy fields in to row +void amc::jstype_CopyIn(amc::FJstype &row, dmmeta::Jstype &in) { + row.ctype = in.ctype; + row.comment = in.comment; +} + +// --- amc.FJstype..Uninit +void amc::FJstype_Uninit(amc::FJstype& jstype) { + amc::FJstype &row = jstype; (void)row; + amc::FCtype* p_ctype = amc::ind_ctype_Find(row.ctype); + if (p_ctype) { + c_jstype_Remove(*p_ctype, row);// remove jstype from index c_jstype + } +} + // --- amc.FLenfld.msghdr.CopyOut // Copy fields out of row void amc::lenfld_CopyOut(amc::FLenfld &row, dmmeta::Lenfld &out) { @@ -28984,6 +29500,10 @@ void amc::FLenfld_Uninit(amc::FLenfld& lenfld) { if (p_ctype) { c_lenfld_Remove(*p_ctype, row);// remove lenfld from index c_lenfld } + amc::FField* p_field = amc::ind_field_Find(row.field); + if (p_field) { + c_lenfld_Remove(*p_field, row);// remove lenfld from index c_lenfld + } } // --- amc.FLicense.base.CopyOut @@ -29203,15 +29723,11 @@ void amc::ns_CopyIn(amc::FNs &row, dmmeta::Ns &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_ctype_Insert(amc::FNs& ns, amc::FCtype& row) { - if (bool_Update(row.ns_c_ctype_in_ary,true)) { - // reserve space + if (!row.ns_c_ctype_in_ary) { c_ctype_Reserve(ns, 1); - u32 n = ns.c_ctype_n; - u32 at = n; - amc::FCtype* *elems = ns.c_ctype_elems; - elems[at] = &row; - ns.c_ctype_n = n+1; - + u32 n = ns.c_ctype_n++; + ns.c_ctype_elems[n] = &row; + row.ns_c_ctype_in_ary = true; } } @@ -29220,7 +29736,7 @@ void amc::c_ctype_Insert(amc::FNs& ns, amc::FCtype& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_ctype_InsertMaybe(amc::FNs& ns, amc::FCtype& row) { - bool retval = !row.ns_c_ctype_in_ary; + bool retval = !ns_c_ctype_InAryQ(row); c_ctype_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -29228,18 +29744,18 @@ bool amc::c_ctype_InsertMaybe(amc::FNs& ns, amc::FCtype& row) { // --- amc.FNs.c_ctype.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_ctype_Remove(amc::FNs& ns, amc::FCtype& row) { + int n = ns.c_ctype_n; if (bool_Update(row.ns_c_ctype_in_ary,false)) { - int lim = ns.c_ctype_n; amc::FCtype* *elems = ns.c_ctype_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FCtype* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FCtype*) * (lim - j); + size_t nbytes = sizeof(amc::FCtype*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_ctype_n = lim - 1; + ns.c_ctype_n = n - 1; break; } } @@ -29267,15 +29783,11 @@ void amc::c_ctype_Reserve(amc::FNs& ns, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_func_Insert(amc::FNs& ns, amc::FFunc& row) { - if (bool_Update(row.ns_c_func_in_ary,true)) { - // reserve space + if (!row.ns_c_func_in_ary) { c_func_Reserve(ns, 1); - u32 n = ns.c_func_n; - u32 at = n; - amc::FFunc* *elems = ns.c_func_elems; - elems[at] = &row; - ns.c_func_n = n+1; - + u32 n = ns.c_func_n++; + ns.c_func_elems[n] = &row; + row.ns_c_func_in_ary = true; } } @@ -29284,7 +29796,7 @@ void amc::c_func_Insert(amc::FNs& ns, amc::FFunc& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_func_InsertMaybe(amc::FNs& ns, amc::FFunc& row) { - bool retval = !row.ns_c_func_in_ary; + bool retval = !ns_c_func_InAryQ(row); c_func_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -29292,18 +29804,18 @@ bool amc::c_func_InsertMaybe(amc::FNs& ns, amc::FFunc& row) { // --- amc.FNs.c_func.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_func_Remove(amc::FNs& ns, amc::FFunc& row) { + int n = ns.c_func_n; if (bool_Update(row.ns_c_func_in_ary,false)) { - int lim = ns.c_func_n; amc::FFunc* *elems = ns.c_func_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FFunc* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FFunc*) * (lim - j); + size_t nbytes = sizeof(amc::FFunc*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_func_n = lim - 1; + ns.c_func_n = n - 1; break; } } @@ -29331,15 +29843,11 @@ void amc::c_func_Reserve(amc::FNs& ns, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_dispatch_Insert(amc::FNs& ns, amc::FDispatch& row) { - if (bool_Update(row.ns_c_dispatch_in_ary,true)) { - // reserve space + if (!row.ns_c_dispatch_in_ary) { c_dispatch_Reserve(ns, 1); - u32 n = ns.c_dispatch_n; - u32 at = n; - amc::FDispatch* *elems = ns.c_dispatch_elems; - elems[at] = &row; - ns.c_dispatch_n = n+1; - + u32 n = ns.c_dispatch_n++; + ns.c_dispatch_elems[n] = &row; + row.ns_c_dispatch_in_ary = true; } } @@ -29348,7 +29856,7 @@ void amc::c_dispatch_Insert(amc::FNs& ns, amc::FDispatch& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_dispatch_InsertMaybe(amc::FNs& ns, amc::FDispatch& row) { - bool retval = !row.ns_c_dispatch_in_ary; + bool retval = !ns_c_dispatch_InAryQ(row); c_dispatch_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -29356,18 +29864,18 @@ bool amc::c_dispatch_InsertMaybe(amc::FNs& ns, amc::FDispatch& row) { // --- amc.FNs.c_dispatch.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_dispatch_Remove(amc::FNs& ns, amc::FDispatch& row) { + int n = ns.c_dispatch_n; if (bool_Update(row.ns_c_dispatch_in_ary,false)) { - int lim = ns.c_dispatch_n; amc::FDispatch* *elems = ns.c_dispatch_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FDispatch* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FDispatch*) * (lim - j); + size_t nbytes = sizeof(amc::FDispatch*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_dispatch_n = lim - 1; + ns.c_dispatch_n = n - 1; break; } } @@ -29395,15 +29903,11 @@ void amc::c_dispatch_Reserve(amc::FNs& ns, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_gstatic_Insert(amc::FNs& ns, amc::FGstatic& row) { - if (bool_Update(row.ns_c_gstatic_in_ary,true)) { - // reserve space + if (!row.ns_c_gstatic_in_ary) { c_gstatic_Reserve(ns, 1); - u32 n = ns.c_gstatic_n; - u32 at = n; - amc::FGstatic* *elems = ns.c_gstatic_elems; - elems[at] = &row; - ns.c_gstatic_n = n+1; - + u32 n = ns.c_gstatic_n++; + ns.c_gstatic_elems[n] = &row; + row.ns_c_gstatic_in_ary = true; } } @@ -29412,7 +29916,7 @@ void amc::c_gstatic_Insert(amc::FNs& ns, amc::FGstatic& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_gstatic_InsertMaybe(amc::FNs& ns, amc::FGstatic& row) { - bool retval = !row.ns_c_gstatic_in_ary; + bool retval = !ns_c_gstatic_InAryQ(row); c_gstatic_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -29420,18 +29924,18 @@ bool amc::c_gstatic_InsertMaybe(amc::FNs& ns, amc::FGstatic& row) { // --- amc.FNs.c_gstatic.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_gstatic_Remove(amc::FNs& ns, amc::FGstatic& row) { + int n = ns.c_gstatic_n; if (bool_Update(row.ns_c_gstatic_in_ary,false)) { - int lim = ns.c_gstatic_n; amc::FGstatic* *elems = ns.c_gstatic_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FGstatic* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FGstatic*) * (lim - j); + size_t nbytes = sizeof(amc::FGstatic*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_gstatic_n = lim - 1; + ns.c_gstatic_n = n - 1; break; } } @@ -29517,6 +30021,25 @@ algo::aryptr amc::include_AllocN(amc::FNs& ns, int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- amc.FNs.include.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr amc::include_AllocNAt(amc::FNs& ns, int n_elems, int at) { + include_Reserve(ns, n_elems); + int n = ns.include_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("amc.bad_alloc_n_at field:amc.FNs.include comment:'index out of range'"); + } + algo::cstring *elems = ns.include_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + ns.include_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- amc.FNs.include.Remove // Remove item by index. If index outside of range, do nothing. void amc::include_Remove(amc::FNs& ns, u32 i) { @@ -29613,19 +30136,39 @@ bool amc::include_ReadStrptrMaybe(amc::FNs& ns, algo::strptr in_str) { return retval; } +// --- amc.FNs.include.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void amc::include_Insary(amc::FNs& ns, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= ns.include_elems && rhs.elems < ns.include_elems + ns.include_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("amc.tary_alias field:amc.FNs.include comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(ns.include_elems+1))) { + FatalErrorExit("amc.bad_insary field:amc.FNs.include comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = ns.include_n - at; + include_Reserve(ns, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (ns.include_elems + at + nnew + i) algo::cstring(ns.include_elems[at + i]); + ns.include_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (ns.include_elems + at + i) algo::cstring(rhs[i]); + } + ns.include_n += nnew; +} + // --- amc.FNs.c_dispsig.Insert // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_dispsig_Insert(amc::FNs& ns, amc::FDispsig& row) { - if (bool_Update(row.ns_c_dispsig_in_ary,true)) { - // reserve space + if (!row.ns_c_dispsig_in_ary) { c_dispsig_Reserve(ns, 1); - u32 n = ns.c_dispsig_n; - u32 at = n; - amc::FDispsig* *elems = ns.c_dispsig_elems; - elems[at] = &row; - ns.c_dispsig_n = n+1; - + u32 n = ns.c_dispsig_n++; + ns.c_dispsig_elems[n] = &row; + row.ns_c_dispsig_in_ary = true; } } @@ -29634,7 +30177,7 @@ void amc::c_dispsig_Insert(amc::FNs& ns, amc::FDispsig& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_dispsig_InsertMaybe(amc::FNs& ns, amc::FDispsig& row) { - bool retval = !row.ns_c_dispsig_in_ary; + bool retval = !ns_c_dispsig_InAryQ(row); c_dispsig_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -29642,18 +30185,18 @@ bool amc::c_dispsig_InsertMaybe(amc::FNs& ns, amc::FDispsig& row) { // --- amc.FNs.c_dispsig.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_dispsig_Remove(amc::FNs& ns, amc::FDispsig& row) { + int n = ns.c_dispsig_n; if (bool_Update(row.ns_c_dispsig_in_ary,false)) { - int lim = ns.c_dispsig_n; amc::FDispsig* *elems = ns.c_dispsig_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FDispsig* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FDispsig*) * (lim - j); + size_t nbytes = sizeof(amc::FDispsig*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_dispsig_n = lim - 1; + ns.c_dispsig_n = n - 1; break; } } @@ -29681,14 +30224,9 @@ void amc::c_dispsig_Reserve(amc::FNs& ns, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_parentns_Insert(amc::FNs& ns, amc::FNs& row) { - // reserve space c_parentns_Reserve(ns, 1); - u32 n = ns.c_parentns_n; - u32 at = n; - amc::FNs* *elems = ns.c_parentns_elems; - elems[at] = &row; - ns.c_parentns_n = n+1; - + u32 n = ns.c_parentns_n++; + ns.c_parentns_elems[n] = &row; } // --- amc.FNs.c_parentns.ScanInsertMaybe @@ -29717,20 +30255,18 @@ bool amc::c_parentns_ScanInsertMaybe(amc::FNs& ns, amc::FNs& row) { // --- amc.FNs.c_parentns.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_parentns_Remove(amc::FNs& ns, amc::FNs& row) { - int lim = ns.c_parentns_n; - amc::FNs* *elems = ns.c_parentns_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc::FNs* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FNs*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - ns.c_parentns_n = lim - 1; - break; + int n = ns.c_parentns_n; + int j=0; + for (int i=0; i=0; i--) { - amc::FNs* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FNs*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - ns.c_cppincl_n = lim - 1; - break; + int n = ns.c_cppincl_n; + int j=0; + for (int i=0; i=0; i--) { - amc::FNs* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(amc::FNs*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - ns.c_hdrincl_n = lim - 1; - break; + int n = ns.c_hdrincl_n; + int j=0; + for (int i=0; i=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FFwddecl* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FFwddecl*) * (lim - j); + size_t nbytes = sizeof(amc::FFwddecl*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_fwddecl_n = lim - 1; + ns.c_fwddecl_n = n - 1; break; } } @@ -29964,15 +30482,11 @@ void amc::c_fwddecl_Reserve(amc::FNs& ns, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_pnew_Insert(amc::FNs& ns, amc::FPnew& row) { - if (bool_Update(row.ns_c_pnew_in_ary,true)) { - // reserve space + if (!row.ns_c_pnew_in_ary) { c_pnew_Reserve(ns, 1); - u32 n = ns.c_pnew_n; - u32 at = n; - amc::FPnew* *elems = ns.c_pnew_elems; - elems[at] = &row; - ns.c_pnew_n = n+1; - + u32 n = ns.c_pnew_n++; + ns.c_pnew_elems[n] = &row; + row.ns_c_pnew_in_ary = true; } } @@ -29981,7 +30495,7 @@ void amc::c_pnew_Insert(amc::FNs& ns, amc::FPnew& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_pnew_InsertMaybe(amc::FNs& ns, amc::FPnew& row) { - bool retval = !row.ns_c_pnew_in_ary; + bool retval = !ns_c_pnew_InAryQ(row); c_pnew_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -29989,18 +30503,18 @@ bool amc::c_pnew_InsertMaybe(amc::FNs& ns, amc::FPnew& row) { // --- amc.FNs.c_pnew.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_pnew_Remove(amc::FNs& ns, amc::FPnew& row) { + int n = ns.c_pnew_n; if (bool_Update(row.ns_c_pnew_in_ary,false)) { - int lim = ns.c_pnew_n; amc::FPnew* *elems = ns.c_pnew_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FPnew* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FPnew*) * (lim - j); + size_t nbytes = sizeof(amc::FPnew*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_pnew_n = lim - 1; + ns.c_pnew_n = n - 1; break; } } @@ -30043,15 +30557,11 @@ void amc::c_outfile_Cascdel(amc::FNs& ns) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_outfile_Insert(amc::FNs& ns, amc::FOutfile& row) { - if (bool_Update(row.ns_c_outfile_in_ary,true)) { - // reserve space + if (!row.ns_c_outfile_in_ary) { c_outfile_Reserve(ns, 1); - u32 n = ns.c_outfile_n; - u32 at = n; - amc::FOutfile* *elems = ns.c_outfile_elems; - elems[at] = &row; - ns.c_outfile_n = n+1; - + u32 n = ns.c_outfile_n++; + ns.c_outfile_elems[n] = &row; + row.ns_c_outfile_in_ary = true; } } @@ -30060,7 +30570,7 @@ void amc::c_outfile_Insert(amc::FNs& ns, amc::FOutfile& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_outfile_InsertMaybe(amc::FNs& ns, amc::FOutfile& row) { - bool retval = !row.ns_c_outfile_in_ary; + bool retval = !ns_c_outfile_InAryQ(row); c_outfile_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -30068,18 +30578,18 @@ bool amc::c_outfile_InsertMaybe(amc::FNs& ns, amc::FOutfile& row) { // --- amc.FNs.c_outfile.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_outfile_Remove(amc::FNs& ns, amc::FOutfile& row) { + int n = ns.c_outfile_n; if (bool_Update(row.ns_c_outfile_in_ary,false)) { - int lim = ns.c_outfile_n; amc::FOutfile* *elems = ns.c_outfile_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FOutfile* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FOutfile*) * (lim - j); + size_t nbytes = sizeof(amc::FOutfile*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_outfile_n = lim - 1; + ns.c_outfile_n = n - 1; break; } } @@ -30107,15 +30617,11 @@ void amc::c_outfile_Reserve(amc::FNs& ns, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_foutput_Insert(amc::FNs& ns, amc::FFoutput& row) { - if (bool_Update(row.ns_c_foutput_in_ary,true)) { - // reserve space + if (!row.ns_c_foutput_in_ary) { c_foutput_Reserve(ns, 1); - u32 n = ns.c_foutput_n; - u32 at = n; - amc::FFoutput* *elems = ns.c_foutput_elems; - elems[at] = &row; - ns.c_foutput_n = n+1; - + u32 n = ns.c_foutput_n++; + ns.c_foutput_elems[n] = &row; + row.ns_c_foutput_in_ary = true; } } @@ -30124,7 +30630,7 @@ void amc::c_foutput_Insert(amc::FNs& ns, amc::FFoutput& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_foutput_InsertMaybe(amc::FNs& ns, amc::FFoutput& row) { - bool retval = !row.ns_c_foutput_in_ary; + bool retval = !ns_c_foutput_InAryQ(row); c_foutput_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -30132,18 +30638,18 @@ bool amc::c_foutput_InsertMaybe(amc::FNs& ns, amc::FFoutput& row) { // --- amc.FNs.c_foutput.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_foutput_Remove(amc::FNs& ns, amc::FFoutput& row) { + int n = ns.c_foutput_n; if (bool_Update(row.ns_c_foutput_in_ary,false)) { - int lim = ns.c_foutput_n; amc::FFoutput* *elems = ns.c_foutput_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FFoutput* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FFoutput*) * (lim - j); + size_t nbytes = sizeof(amc::FFoutput*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_foutput_n = lim - 1; + ns.c_foutput_n = n - 1; break; } } @@ -30171,15 +30677,11 @@ void amc::c_foutput_Reserve(amc::FNs& ns, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_fstep_Insert(amc::FNs& ns, amc::FFstep& row) { - if (bool_Update(row.ns_c_fstep_in_ary,true)) { - // reserve space + if (!row.ns_c_fstep_in_ary) { c_fstep_Reserve(ns, 1); - u32 n = ns.c_fstep_n; - u32 at = n; - amc::FFstep* *elems = ns.c_fstep_elems; - elems[at] = &row; - ns.c_fstep_n = n+1; - + u32 n = ns.c_fstep_n++; + ns.c_fstep_elems[n] = &row; + row.ns_c_fstep_in_ary = true; } } @@ -30188,7 +30690,7 @@ void amc::c_fstep_Insert(amc::FNs& ns, amc::FFstep& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_fstep_InsertMaybe(amc::FNs& ns, amc::FFstep& row) { - bool retval = !row.ns_c_fstep_in_ary; + bool retval = !ns_c_fstep_InAryQ(row); c_fstep_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -30196,18 +30698,18 @@ bool amc::c_fstep_InsertMaybe(amc::FNs& ns, amc::FFstep& row) { // --- amc.FNs.c_fstep.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_fstep_Remove(amc::FNs& ns, amc::FFstep& row) { + int n = ns.c_fstep_n; if (bool_Update(row.ns_c_fstep_in_ary,false)) { - int lim = ns.c_fstep_n; amc::FFstep* *elems = ns.c_fstep_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FFstep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FFstep*) * (lim - j); + size_t nbytes = sizeof(amc::FFstep*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_fstep_n = lim - 1; + ns.c_fstep_n = n - 1; break; } } @@ -30235,15 +30737,11 @@ void amc::c_fstep_Reserve(amc::FNs& ns, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_gsymbol_Insert(amc::FNs& ns, amc::FGsymbol& row) { - if (bool_Update(row.ns_c_gsymbol_in_ary,true)) { - // reserve space + if (!row.ns_c_gsymbol_in_ary) { c_gsymbol_Reserve(ns, 1); - u32 n = ns.c_gsymbol_n; - u32 at = n; - amc::FGsymbol* *elems = ns.c_gsymbol_elems; - elems[at] = &row; - ns.c_gsymbol_n = n+1; - + u32 n = ns.c_gsymbol_n++; + ns.c_gsymbol_elems[n] = &row; + row.ns_c_gsymbol_in_ary = true; } } @@ -30252,7 +30750,7 @@ void amc::c_gsymbol_Insert(amc::FNs& ns, amc::FGsymbol& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_gsymbol_InsertMaybe(amc::FNs& ns, amc::FGsymbol& row) { - bool retval = !row.ns_c_gsymbol_in_ary; + bool retval = !ns_c_gsymbol_InAryQ(row); c_gsymbol_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -30260,18 +30758,18 @@ bool amc::c_gsymbol_InsertMaybe(amc::FNs& ns, amc::FGsymbol& row) { // --- amc.FNs.c_gsymbol.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_gsymbol_Remove(amc::FNs& ns, amc::FGsymbol& row) { + int n = ns.c_gsymbol_n; if (bool_Update(row.ns_c_gsymbol_in_ary,false)) { - int lim = ns.c_gsymbol_n; amc::FGsymbol* *elems = ns.c_gsymbol_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FGsymbol* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FGsymbol*) * (lim - j); + size_t nbytes = sizeof(amc::FGsymbol*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_gsymbol_n = lim - 1; + ns.c_gsymbol_n = n - 1; break; } } @@ -30299,15 +30797,11 @@ void amc::c_gsymbol_Reserve(amc::FNs& ns, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_nsinclude_Insert(amc::FNs& ns, amc::FNsinclude& row) { - if (bool_Update(row.ns_c_nsinclude_in_ary,true)) { - // reserve space + if (!row.ns_c_nsinclude_in_ary) { c_nsinclude_Reserve(ns, 1); - u32 n = ns.c_nsinclude_n; - u32 at = n; - amc::FNsinclude* *elems = ns.c_nsinclude_elems; - elems[at] = &row; - ns.c_nsinclude_n = n+1; - + u32 n = ns.c_nsinclude_n++; + ns.c_nsinclude_elems[n] = &row; + row.ns_c_nsinclude_in_ary = true; } } @@ -30316,7 +30810,7 @@ void amc::c_nsinclude_Insert(amc::FNs& ns, amc::FNsinclude& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_nsinclude_InsertMaybe(amc::FNs& ns, amc::FNsinclude& row) { - bool retval = !row.ns_c_nsinclude_in_ary; + bool retval = !ns_c_nsinclude_InAryQ(row); c_nsinclude_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -30324,18 +30818,18 @@ bool amc::c_nsinclude_InsertMaybe(amc::FNs& ns, amc::FNsinclude& row) { // --- amc.FNs.c_nsinclude.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_nsinclude_Remove(amc::FNs& ns, amc::FNsinclude& row) { + int n = ns.c_nsinclude_n; if (bool_Update(row.ns_c_nsinclude_in_ary,false)) { - int lim = ns.c_nsinclude_n; amc::FNsinclude* *elems = ns.c_nsinclude_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FNsinclude* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FNsinclude*) * (lim - j); + size_t nbytes = sizeof(amc::FNsinclude*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_nsinclude_n = lim - 1; + ns.c_nsinclude_n = n - 1; break; } } @@ -30424,7 +30918,9 @@ void amc::FNs_Init(amc::FNs& ns) { ns.c_nsinclude_max = 0; // (amc.FNs.c_nsinclude) ns.c_nscpp = NULL; ns.p_license = NULL; + ns.c_nsjs = NULL; ns.ind_ns_next = (amc::FNs*)-1; // (amc.FDb.ind_ns) not-in-hash + ns.ind_ns_hashval = 0; // stored hash value } // --- amc.FNs..Uninit @@ -30568,6 +31064,33 @@ void amc::FNsinclude_Uninit(amc::FNsinclude& nsinclude) { } } +// --- amc.FNsjs.base.CopyOut +// Copy fields out of row +void amc::nsjs_CopyOut(amc::FNsjs &row, dmmeta::Nsjs &out) { + out.ns = row.ns; + out.typescript = row.typescript; + out.gensel = row.gensel; + out.comment = row.comment; +} + +// --- amc.FNsjs.base.CopyIn +// Copy fields in to row +void amc::nsjs_CopyIn(amc::FNsjs &row, dmmeta::Nsjs &in) { + row.ns = in.ns; + row.typescript = in.typescript; + row.gensel = in.gensel; + row.comment = in.comment; +} + +// --- amc.FNsjs..Uninit +void amc::FNsjs_Uninit(amc::FNsjs& nsjs) { + amc::FNsjs &row = nsjs; (void)row; + amc::FNs* p_ns = amc::ind_ns_Find(row.ns); + if (p_ns) { + c_nsjs_Remove(*p_ns, row);// remove nsjs from index c_nsjs + } +} + // --- amc.FNsproto.base.CopyOut // Copy fields out of row void amc::nsproto_CopyOut(amc::FNsproto &row, dmmeta::Nsproto &out) { @@ -30716,15 +31239,11 @@ algo::Smallstr100 amc::ctype_Get(amc::FPmaskfld& pmaskfld) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_pmaskfld_member_Insert(amc::FPmaskfld& pmaskfld, amc::FPmaskfldMember& row) { - if (bool_Update(row.pmaskfld_c_pmaskfld_member_in_ary,true)) { - // reserve space + if (!row.pmaskfld_c_pmaskfld_member_in_ary) { c_pmaskfld_member_Reserve(pmaskfld, 1); - u32 n = pmaskfld.c_pmaskfld_member_n; - u32 at = n; - amc::FPmaskfldMember* *elems = pmaskfld.c_pmaskfld_member_elems; - elems[at] = &row; - pmaskfld.c_pmaskfld_member_n = n+1; - + u32 n = pmaskfld.c_pmaskfld_member_n++; + pmaskfld.c_pmaskfld_member_elems[n] = &row; + row.pmaskfld_c_pmaskfld_member_in_ary = true; } } @@ -30733,7 +31252,7 @@ void amc::c_pmaskfld_member_Insert(amc::FPmaskfld& pmaskfld, amc::FPmaskfldMembe // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_pmaskfld_member_InsertMaybe(amc::FPmaskfld& pmaskfld, amc::FPmaskfldMember& row) { - bool retval = !row.pmaskfld_c_pmaskfld_member_in_ary; + bool retval = !pmaskfld_c_pmaskfld_member_InAryQ(row); c_pmaskfld_member_Insert(pmaskfld,row); // check is performed in _Insert again return retval; } @@ -30741,18 +31260,18 @@ bool amc::c_pmaskfld_member_InsertMaybe(amc::FPmaskfld& pmaskfld, amc::FPmaskfld // --- amc.FPmaskfld.c_pmaskfld_member.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_pmaskfld_member_Remove(amc::FPmaskfld& pmaskfld, amc::FPmaskfldMember& row) { + int n = pmaskfld.c_pmaskfld_member_n; if (bool_Update(row.pmaskfld_c_pmaskfld_member_in_ary,false)) { - int lim = pmaskfld.c_pmaskfld_member_n; amc::FPmaskfldMember* *elems = pmaskfld.c_pmaskfld_member_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FPmaskfldMember* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FPmaskfldMember*) * (lim - j); + size_t nbytes = sizeof(amc::FPmaskfldMember*) * (n - j); memmove(elems + i, elems + j, nbytes); - pmaskfld.c_pmaskfld_member_n = lim - 1; + pmaskfld.c_pmaskfld_member_n = n - 1; break; } } @@ -30879,6 +31398,7 @@ void amc::FPnew_Uninit(amc::FPnew& pnew) { void amc::ptrary_CopyOut(amc::FPtrary &row, dmmeta::Ptrary &out) { out.field = row.field; out.unique = row.unique; + out.heaplike = row.heaplike; } // --- amc.FPtrary.msghdr.CopyIn @@ -30886,6 +31406,7 @@ void amc::ptrary_CopyOut(amc::FPtrary &row, dmmeta::Ptrary &out) { void amc::ptrary_CopyIn(amc::FPtrary &row, dmmeta::Ptrary &in) { row.field = in.field; row.unique = in.unique; + row.heaplike = in.heaplike; } // --- amc.FPtrary..Uninit @@ -30934,11 +31455,11 @@ void amc::reftype_CopyIn(amc::FReftype &row, dmmeta::Reftype &in) { // --- amc.FReftype.zs_fprefix.Insert // Insert row into linked list. If row is already in linked list, do nothing. void amc::zs_fprefix_Insert(amc::FReftype& reftype, amc::FFprefix& row) { - if (!zs_fprefix_InLlistQ(row)) { + if (!reftype_zs_fprefix_InLlistQ(row)) { amc::FFprefix* old_tail = reftype.zs_fprefix_tail; - row.zs_fprefix_next = NULL; + row.reftype_zs_fprefix_next = NULL; reftype.zs_fprefix_tail = &row; - amc::FFprefix **new_row_a = &old_tail->zs_fprefix_next; + amc::FFprefix **new_row_a = &old_tail->reftype_zs_fprefix_next; amc::FFprefix **new_row_b = &reftype.zs_fprefix_head; amc::FFprefix **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -30949,13 +31470,13 @@ void amc::zs_fprefix_Insert(amc::FReftype& reftype, amc::FFprefix& row) { // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. void amc::zs_fprefix_Remove(amc::FReftype& reftype, amc::FFprefix& row) { - if (zs_fprefix_InLlistQ(row)) { + if (reftype_zs_fprefix_InLlistQ(row)) { amc::FFprefix* old_head = reftype.zs_fprefix_head; (void)old_head; // in case it's not used amc::FFprefix* prev=NULL; amc::FFprefix* cur = reftype.zs_fprefix_head; while (cur) { // search for element by pointer - amc::FFprefix* next = cur->zs_fprefix_next; + amc::FFprefix* next = cur->reftype_zs_fprefix_next; if (cur == &row) { if (!next) { @@ -30963,11 +31484,11 @@ void amc::zs_fprefix_Remove(amc::FReftype& reftype, amc::FFprefix& row) { } // disconnect element from linked list if (prev) { - prev->zs_fprefix_next = next; + prev->reftype_zs_fprefix_next = next; } else { reftype.zs_fprefix_head = next; } - row.zs_fprefix_next = (amc::FFprefix*)-1; // not-in-list + row.reftype_zs_fprefix_next = (amc::FFprefix*)-1; // not-in-list break; } prev = cur; @@ -30983,8 +31504,8 @@ void amc::zs_fprefix_RemoveAll(amc::FReftype& reftype) { reftype.zs_fprefix_head = NULL; reftype.zs_fprefix_tail = NULL; while (row) { - amc::FFprefix* row_next = row->zs_fprefix_next; - row->zs_fprefix_next = (amc::FFprefix*)-1; + amc::FFprefix* row_next = row->reftype_zs_fprefix_next; + row->reftype_zs_fprefix_next = (amc::FFprefix*)-1; row = row_next; } } @@ -30995,13 +31516,13 @@ amc::FFprefix* amc::zs_fprefix_RemoveFirst(amc::FReftype& reftype) { amc::FFprefix *row = NULL; row = reftype.zs_fprefix_head; if (row) { - amc::FFprefix *next = row->zs_fprefix_next; + amc::FFprefix *next = row->reftype_zs_fprefix_next; reftype.zs_fprefix_head = next; // clear list's tail pointer if list is empty. if (!next) { reftype.zs_fprefix_tail = NULL; } - row->zs_fprefix_next = (amc::FFprefix*)-1; // mark as not-in-list + row->reftype_zs_fprefix_next = (amc::FFprefix*)-1; // mark as not-in-list } return row; } @@ -31026,6 +31547,7 @@ void amc::FReftype_Init(amc::FReftype& reftype) { reftype.zs_fprefix_head = NULL; // (amc.FReftype.zs_fprefix) reftype.zs_fprefix_tail = NULL; // (amc.FReftype.zs_fprefix) reftype.ind_reftype_next = (amc::FReftype*)-1; // (amc.FDb.ind_reftype) not-in-hash + reftype.ind_reftype_hashval = 0; // stored hash value } // --- amc.FReftype..Uninit @@ -31157,8 +31679,9 @@ void amc::FSsimfile_Init(amc::FSsimfile& ssimfile) { ssimfile.topovisit = bool(false); ssimfile.topoindex = i32(0); ssimfile.input_select = bool(false); - ssimfile._db_c_ssimfile_sorted_in_ary = bool(false); + ssimfile.c_ssimfile_sorted_in_ary = bool(false); ssimfile.ind_ssimfile_next = (amc::FSsimfile*)-1; // (amc.FDb.ind_ssimfile) not-in-hash + ssimfile.ind_ssimfile_hashval = 0; // stored hash value ssimfile.zd_ssimfile_todo_next = (amc::FSsimfile*)-1; // (amc.FDb.zd_ssimfile_todo) not-in-list ssimfile.zd_ssimfile_todo_prev = NULL; // (amc.FDb.zd_ssimfile_todo) } @@ -31223,6 +31746,26 @@ void amc::FStatictuple_Uninit(amc::FStatictuple& static_tuple) { } } +// --- amc.FSteptype.base.CopyOut +// Copy fields out of row +void amc::steptype_CopyOut(amc::FSteptype &row, dmmeta::Steptype &out) { + out.steptype = row.steptype; + out.comment = row.comment; +} + +// --- amc.FSteptype.base.CopyIn +// Copy fields in to row +void amc::steptype_CopyIn(amc::FSteptype &row, dmmeta::Steptype &in) { + row.steptype = in.steptype; + row.comment = in.comment; +} + +// --- amc.FSteptype..Uninit +void amc::FSteptype_Uninit(amc::FSteptype& steptype) { + amc::FSteptype &row = steptype; (void)row; + ind_steptype_Remove(row); // remove steptype from index ind_steptype +} + // --- amc.FSubstr.msghdr.CopyOut // Copy fields out of row void amc::substr_CopyOut(amc::FSubstr &row, dmmeta::Substr &out) { @@ -31300,15 +31843,11 @@ void amc::target_CopyIn(amc::FTarget &row, dev::Target &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc::c_targdep_Insert(amc::FTarget& target, amc::FTargdep& row) { - if (bool_Update(row.target_c_targdep_in_ary,true)) { - // reserve space + if (!row.target_c_targdep_in_ary) { c_targdep_Reserve(target, 1); - u32 n = target.c_targdep_n; - u32 at = n; - amc::FTargdep* *elems = target.c_targdep_elems; - elems[at] = &row; - target.c_targdep_n = n+1; - + u32 n = target.c_targdep_n++; + target.c_targdep_elems[n] = &row; + row.target_c_targdep_in_ary = true; } } @@ -31317,7 +31856,7 @@ void amc::c_targdep_Insert(amc::FTarget& target, amc::FTargdep& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc::c_targdep_InsertMaybe(amc::FTarget& target, amc::FTargdep& row) { - bool retval = !row.target_c_targdep_in_ary; + bool retval = !target_c_targdep_InAryQ(row); c_targdep_Insert(target,row); // check is performed in _Insert again return retval; } @@ -31325,18 +31864,18 @@ bool amc::c_targdep_InsertMaybe(amc::FTarget& target, amc::FTargdep& row) { // --- amc.FTarget.c_targdep.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc::c_targdep_Remove(amc::FTarget& target, amc::FTargdep& row) { + int n = target.c_targdep_n; if (bool_Update(row.target_c_targdep_in_ary,false)) { - int lim = target.c_targdep_n; amc::FTargdep* *elems = target.c_targdep_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc::FTargdep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc::FTargdep*) * (lim - j); + size_t nbytes = sizeof(amc::FTargdep*) * (n - j); memmove(elems + i, elems + j, nbytes); - target.c_targdep_n = lim - 1; + target.c_targdep_n = n - 1; break; } } @@ -31483,6 +32022,7 @@ void amc::FTfunc_Init(amc::FTfunc& tfunc) { tfunc.c_tcurs = NULL; tfunc.tclass_c_tfunc_in_ary = bool(false); tfunc.ind_tfunc_next = (amc::FTfunc*)-1; // (amc.FDb.ind_tfunc) not-in-hash + tfunc.ind_tfunc_hashval = 0; // stored hash value tfunc.step = NULL; } @@ -31608,6 +32148,24 @@ void amc::FTypefld_Uninit(amc::FTypefld& typefld) { } } +// --- amc.FUserfunc.base.CopyOut +// Copy fields out of row +void amc::userfunc_CopyOut(amc::FUserfunc &row, dmmeta::Userfunc &out) { + out.userfunc = row.userfunc; + out.acrkey = row.acrkey; + out.cppname = row.cppname; + out.comment = row.comment; +} + +// --- amc.FUserfunc.base.CopyIn +// Copy fields in to row +void amc::userfunc_CopyIn(amc::FUserfunc &row, dmmeta::Userfunc &in) { + row.userfunc = in.userfunc; + row.acrkey = in.acrkey; + row.cppname = in.cppname; + row.comment = in.comment; +} + // --- amc.FUsertracefld.msghdr.CopyOut // Copy fields out of row void amc::usertracefld_CopyOut(amc::FUsertracefld &row, dmmeta::Usertracefld &out) { @@ -31671,10 +32229,11 @@ void amc::FXref_Init(amc::FXref& xref) { xref.c_nocascdel = NULL; xref.p_viafld = NULL; xref.p_keyfld = NULL; - xref.zs_xref_next = (amc::FXref*)-1; // (amc.FCtype.zs_xref) not-in-list + xref.ctype_zs_xref_next = (amc::FXref*)-1; // (amc.FCtype.zs_xref) not-in-list xref.ind_xref_next = (amc::FXref*)-1; // (amc.FDb.ind_xref) not-in-hash - xref.zd_xref_keyfld_next = (amc::FXref*)-1; // (amc.FField.zd_xref_keyfld) not-in-list - xref.zd_xref_keyfld_prev = NULL; // (amc.FField.zd_xref_keyfld) + xref.ind_xref_hashval = 0; // stored hash value + xref.field_zd_xref_keyfld_next = (amc::FXref*)-1; // (amc.FField.zd_xref_keyfld) not-in-list + xref.field_zd_xref_keyfld_prev = NULL; // (amc.FField.zd_xref_keyfld) } // --- amc.FXref..Uninit @@ -31799,7 +32358,7 @@ const char* amc::value_ToCstr(const amc::Pnewtype& parent) { const char *ret = NULL; switch(value_GetEnum(parent)) { case amc_Pnewtype_Memptr : ret = "Memptr"; break; - case amc_Pnewtype_AmsStream : ret = "AmsStream"; break; + case amc_Pnewtype_Shm : ret = "Shm"; break; case amc_Pnewtype_Fixed : ret = "Fixed"; break; case amc_Pnewtype_Dynamic : ret = "Dynamic"; break; case amc_Pnewtype_ByteAry : ret = "ByteAry"; break; @@ -31827,6 +32386,14 @@ void amc::value_Print(const amc::Pnewtype& parent, algo::cstring &lhs) { bool amc::value_SetStrptrMaybe(amc::Pnewtype& parent, algo::strptr rhs) { bool ret = false; switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('S','h','m'): { + value_SetEnum(parent,amc_Pnewtype_Shm); ret = true; break; + } + } + break; + } case 5: { switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { case LE_STR5('F','i','x','e','d'): { @@ -31857,15 +32424,6 @@ bool amc::value_SetStrptrMaybe(amc::Pnewtype& parent, algo::strptr rhs) { } break; } - case 9: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('A','m','s','S','t','r','e','a'): { - if (memcmp(rhs.elems+8,"m",1)==0) { value_SetEnum(parent,amc_Pnewtype_AmsStream); ret = true; break; } - break; - } - } - break; - } } return ret; } @@ -31925,6 +32483,7 @@ const char* amc::value_ToCstr(const amc::TableId& parent) { case amc_TableId_dmmeta_Cget : ret = "dmmeta.Cget"; break; case amc_TableId_dmmeta_Charset : ret = "dmmeta.Charset"; break; case amc_TableId_dmmeta_Chash : ret = "dmmeta.Chash"; break; + case amc_TableId_dmmeta_Ckafka : ret = "dmmeta.Ckafka"; break; case amc_TableId_dmmeta_Cppfunc : ret = "dmmeta.Cppfunc"; break; case amc_TableId_dmmeta_Cpptype : ret = "dmmeta.Cpptype"; break; case amc_TableId_dmmeta_Csize : ret = "dmmeta.Csize"; break; @@ -31956,6 +32515,7 @@ const char* amc::value_ToCstr(const amc::TableId& parent) { case amc_TableId_dmmeta_Field : ret = "dmmeta.Field"; break; case amc_TableId_dmmeta_Findrem : ret = "dmmeta.Findrem"; break; case amc_TableId_dmmeta_Finput : ret = "dmmeta.Finput"; break; + case amc_TableId_dmmeta_Fkafka : ret = "dmmeta.Fkafka"; break; case amc_TableId_dmmeta_Fldoffset : ret = "dmmeta.Fldoffset"; break; case amc_TableId_dmmeta_Floadtuples: ret = "dmmeta.Floadtuples"; break; case amc_TableId_dmmeta_Fnoremove : ret = "dmmeta.Fnoremove"; break; @@ -31974,6 +32534,7 @@ const char* amc::value_ToCstr(const amc::TableId& parent) { case amc_TableId_dmmeta_Gsymbol : ret = "dmmeta.Gsymbol"; break; case amc_TableId_dmmeta_Hook : ret = "dmmeta.Hook"; break; case amc_TableId_dmmeta_Inlary : ret = "dmmeta.Inlary"; break; + case amc_TableId_dmmeta_Jstype : ret = "dmmeta.Jstype"; break; case amc_TableId_dmmeta_Lenfld : ret = "dmmeta.Lenfld"; break; case amc_TableId_dev_License : ret = "dev.License"; break; case amc_TableId_dmmeta_Listtype : ret = "dmmeta.Listtype"; break; @@ -31987,6 +32548,7 @@ const char* amc::value_ToCstr(const amc::TableId& parent) { case amc_TableId_dmmeta_Nscpp : ret = "dmmeta.Nscpp"; break; case amc_TableId_dmmeta_Nsdb : ret = "dmmeta.Nsdb"; break; case amc_TableId_dmmeta_Nsinclude : ret = "dmmeta.Nsinclude"; break; + case amc_TableId_dmmeta_Nsjs : ret = "dmmeta.Nsjs"; break; case amc_TableId_dmmeta_Nsproto : ret = "dmmeta.Nsproto"; break; case amc_TableId_dmmeta_Nsx : ret = "dmmeta.Nsx"; break; case amc_TableId_dmmeta_Numstr : ret = "dmmeta.Numstr"; break; @@ -32001,6 +32563,7 @@ const char* amc::value_ToCstr(const amc::TableId& parent) { case amc_TableId_dmmeta_Ssimfile : ret = "dmmeta.Ssimfile"; break; case amc_TableId_dmmeta_Ssimsort : ret = "dmmeta.Ssimsort"; break; case amc_TableId_dmmeta_Ssimvolatile: ret = "dmmeta.Ssimvolatile"; break; + case amc_TableId_dmmeta_Steptype : ret = "dmmeta.Steptype"; break; case amc_TableId_dmmeta_Substr : ret = "dmmeta.Substr"; break; case amc_TableId_dev_Targdep : ret = "dev.Targdep"; break; case amc_TableId_dev_Target : ret = "dev.Target"; break; @@ -32125,6 +32688,7 @@ bool amc::value_SetStrptrMaybe(amc::TableId& parent, algo::strptr rhs) { } case LE_STR8('d','m','m','e','t','a','.','N'): { if (memcmp(rhs.elems+8,"sdb",3)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Nsdb); ret = true; break; } + if (memcmp(rhs.elems+8,"sjs",3)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Nsjs); ret = true; break; } break; } case LE_STR8('d','m','m','e','t','a','.','P'): { @@ -32164,6 +32728,7 @@ bool amc::value_SetStrptrMaybe(amc::TableId& parent, algo::strptr rhs) { } case LE_STR8('d','m','m','e','t','a','.','n'): { if (memcmp(rhs.elems+8,"sdb",3)==0) { value_SetEnum(parent,amc_TableId_dmmeta_nsdb); ret = true; break; } + if (memcmp(rhs.elems+8,"sjs",3)==0) { value_SetEnum(parent,amc_TableId_dmmeta_nsjs); ret = true; break; } break; } case LE_STR8('d','m','m','e','t','a','.','p'): { @@ -32269,6 +32834,7 @@ bool amc::value_SetStrptrMaybe(amc::TableId& parent, algo::strptr rhs) { } case LE_STR8('d','m','m','e','t','a','.','C'): { if (memcmp(rhs.elems+8,"after",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Cafter); ret = true; break; } + if (memcmp(rhs.elems+8,"kafka",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Ckafka); ret = true; break; } break; } case LE_STR8('d','m','m','e','t','a','.','F'): { @@ -32276,6 +32842,7 @@ bool amc::value_SetStrptrMaybe(amc::TableId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"const",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Fconst); ret = true; break; } if (memcmp(rhs.elems+8,"delay",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Fdelay); ret = true; break; } if (memcmp(rhs.elems+8,"input",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Finput); ret = true; break; } + if (memcmp(rhs.elems+8,"kafka",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Fkafka); ret = true; break; } if (memcmp(rhs.elems+8,"trace",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Ftrace); ret = true; break; } break; } @@ -32287,6 +32854,10 @@ bool amc::value_SetStrptrMaybe(amc::TableId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"nlary",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Inlary); ret = true; break; } break; } + case LE_STR8('d','m','m','e','t','a','.','J'): { + if (memcmp(rhs.elems+8,"stype",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Jstype); ret = true; break; } + break; + } case LE_STR8('d','m','m','e','t','a','.','L'): { if (memcmp(rhs.elems+8,"enfld",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Lenfld); ret = true; break; } break; @@ -32310,6 +32881,7 @@ bool amc::value_SetStrptrMaybe(amc::TableId& parent, algo::strptr rhs) { } case LE_STR8('d','m','m','e','t','a','.','c'): { if (memcmp(rhs.elems+8,"after",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_cafter); ret = true; break; } + if (memcmp(rhs.elems+8,"kafka",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_ckafka); ret = true; break; } break; } case LE_STR8('d','m','m','e','t','a','.','f'): { @@ -32317,6 +32889,7 @@ bool amc::value_SetStrptrMaybe(amc::TableId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"const",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_fconst); ret = true; break; } if (memcmp(rhs.elems+8,"delay",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_fdelay); ret = true; break; } if (memcmp(rhs.elems+8,"input",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_finput); ret = true; break; } + if (memcmp(rhs.elems+8,"kafka",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_fkafka); ret = true; break; } if (memcmp(rhs.elems+8,"trace",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_ftrace); ret = true; break; } break; } @@ -32328,6 +32901,10 @@ bool amc::value_SetStrptrMaybe(amc::TableId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"nlary",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_inlary); ret = true; break; } break; } + case LE_STR8('d','m','m','e','t','a','.','j'): { + if (memcmp(rhs.elems+8,"stype",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_jstype); ret = true; break; } + break; + } case LE_STR8('d','m','m','e','t','a','.','l'): { if (memcmp(rhs.elems+8,"enfld",5)==0) { value_SetEnum(parent,amc_TableId_dmmeta_lenfld); ret = true; break; } break; @@ -32480,6 +33057,7 @@ bool amc::value_SetStrptrMaybe(amc::TableId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"mallstr",7)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Smallstr); ret = true; break; } if (memcmp(rhs.elems+8,"simfile",7)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Ssimfile); ret = true; break; } if (memcmp(rhs.elems+8,"simsort",7)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Ssimsort); ret = true; break; } + if (memcmp(rhs.elems+8,"teptype",7)==0) { value_SetEnum(parent,amc_TableId_dmmeta_Steptype); ret = true; break; } break; } case LE_STR8('d','m','m','e','t','a','.','a'): { @@ -32513,6 +33091,7 @@ bool amc::value_SetStrptrMaybe(amc::TableId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"mallstr",7)==0) { value_SetEnum(parent,amc_TableId_dmmeta_smallstr); ret = true; break; } if (memcmp(rhs.elems+8,"simfile",7)==0) { value_SetEnum(parent,amc_TableId_dmmeta_ssimfile); ret = true; break; } if (memcmp(rhs.elems+8,"simsort",7)==0) { value_SetEnum(parent,amc_TableId_dmmeta_ssimsort); ret = true; break; } + if (memcmp(rhs.elems+8,"teptype",7)==0) { value_SetEnum(parent,amc_TableId_dmmeta_steptype); ret = true; break; } break; } } @@ -32687,11 +33266,13 @@ void amc::StaticCheck() { // --- amc...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); amc::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock amc::ReadArgv(); // dmmeta.main:amc amc::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -32704,6 +33285,7 @@ int main(int argc, char **argv) { try { amc::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/amc_vis_gen.cpp b/cpp/gen/amc_vis_gen.cpp index 87f6a38a..686a0bba 100644 --- a/cpp/gen/amc_vis_gen.cpp +++ b/cpp/gen/amc_vis_gen.cpp @@ -31,12 +31,15 @@ #include "include/gen/algo_gen.inl.h" #include "include/gen/command_gen.h" #include "include/gen/command_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep amc_vis::FDb amc_vis::_db; // dependency found via dev.targdep @@ -49,12 +52,12 @@ const char *amc_vis_help = " -in string \"data\" Input directory or filename, - for stdin\n" " -dot string \"\" Save dot file with specified filename\n" " -xref Include all ctypes referenced by selected ones\n" -" -xns Cross namespace boundaries\n" +" -xns Y Cross namespace boundaries\n" " -noinput Deselect module inputs\n" " -check Check model for dependency problems\n" " -render Y Produce an ascii drawing\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -95,15 +98,15 @@ namespace amc_vis { // gen:ns_print_proto // Find new location for ROW starting at IDX // NOTE: Rest of heap is rearranged, but pointer to ROW is NOT stored in array. // func:amc_vis.FDb.bh_link.Downheap - static int bh_link_Downheap(amc_vis::Link& row, int idx) __attribute__((nothrow)); + static int bh_link_Downheap(amc_vis::FLink& row, int idx) __attribute__((nothrow)); // Find and return index of new location for element ROW in the heap, starting at index IDX. // Move any elements along the way but do not modify ROW. // func:amc_vis.FDb.bh_link.Upheap - static int bh_link_Upheap(amc_vis::Link& row, int idx) __attribute__((nothrow)); + static int bh_link_Upheap(amc_vis::FLink& row, int idx) __attribute__((nothrow)); // func:amc_vis.FDb.bh_link.ElemLt - inline static bool bh_link_ElemLt(amc_vis::Link &a, amc_vis::Link &b) __attribute__((nothrow)); + inline static bool bh_link_ElemLt(amc_vis::FLink &a, amc_vis::FLink &b) __attribute__((nothrow)); // func:amc_vis.FDb.bh_link_curs.Add - static void _db_bh_link_curs_Add(_db_bh_link_curs &curs, amc_vis::Link& row); + static void _db_bh_link_curs_Add(_db_bh_link_curs &curs, amc_vis::FLink& row); // func:amc_vis.FDb.reftype.InputMaybe static bool reftype_InputMaybe(dmmeta::Reftype &elem) __attribute__((nothrow)); // func:amc_vis.FDb.finput.InputMaybe @@ -148,15 +151,11 @@ algo::Smallstr100 amc_vis::name_Get(amc_vis::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void amc_vis::c_field_Insert(amc_vis::FCtype& ctype, amc_vis::FField& row) { - if (bool_Update(row.ctype_c_field_in_ary,true)) { - // reserve space + if (!row.ctype_c_field_in_ary) { c_field_Reserve(ctype, 1); - u32 n = ctype.c_field_n; - u32 at = n; - amc_vis::FField* *elems = ctype.c_field_elems; - elems[at] = &row; - ctype.c_field_n = n+1; - + u32 n = ctype.c_field_n++; + ctype.c_field_elems[n] = &row; + row.ctype_c_field_in_ary = true; } } @@ -165,7 +164,7 @@ void amc_vis::c_field_Insert(amc_vis::FCtype& ctype, amc_vis::FField& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool amc_vis::c_field_InsertMaybe(amc_vis::FCtype& ctype, amc_vis::FField& row) { - bool retval = !row.ctype_c_field_in_ary; + bool retval = !ctype_c_field_InAryQ(row); c_field_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -173,18 +172,18 @@ bool amc_vis::c_field_InsertMaybe(amc_vis::FCtype& ctype, amc_vis::FField& row) // --- amc_vis.FCtype.c_field.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void amc_vis::c_field_Remove(amc_vis::FCtype& ctype, amc_vis::FField& row) { + int n = ctype.c_field_n; if (bool_Update(row.ctype_c_field_in_ary,false)) { - int lim = ctype.c_field_n; amc_vis::FField* *elems = ctype.c_field_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { amc_vis::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc_vis::FField*) * (lim - j); + size_t nbytes = sizeof(amc_vis::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_field_n = lim - 1; + ctype.c_field_n = n - 1; break; } } @@ -208,6 +207,23 @@ void amc_vis::c_field_Reserve(amc_vis::FCtype& ctype, u32 n) { } } +// --- amc_vis.FCtype..Init +// Set all fields to initial values. +void amc_vis::FCtype_Init(amc_vis::FCtype& ctype) { + ctype.p_base = NULL; + ctype.c_field_elems = NULL; // (amc_vis.FCtype.c_field) + ctype.c_field_n = 0; // (amc_vis.FCtype.c_field) + ctype.c_field_max = 0; // (amc_vis.FCtype.c_field) + ctype.mm_id = i32(0); + ctype.isinput = bool(false); + ctype.userselect = bool(false); + ctype.color = u16(0); + ctype.ind_ctype_next = (amc_vis::FCtype*)-1; // (amc_vis.FDb.ind_ctype) not-in-hash + ctype.ind_ctype_hashval = 0; // stored hash value + ctype.zd_select_next = (amc_vis::FCtype*)-1; // (amc_vis.FDb.zd_select) not-in-list + ctype.zd_select_prev = NULL; // (amc_vis.FDb.zd_select) +} + // --- amc_vis.FCtype..Uninit void amc_vis::FCtype_Uninit(amc_vis::FCtype& ctype) { amc_vis::FCtype &row = ctype; (void)row; @@ -660,9 +676,8 @@ void amc_vis::ReadArgv() { } if (ch_N(attrname) == 0) { err << "amc_vis: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:amc_vis.FDb.cmdline @@ -716,7 +734,7 @@ void amc_vis::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -761,7 +779,7 @@ static void amc_vis::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'amc_vis.Input' signature:'533c01b711e8b6ff9e6268d40b3b5c11331f68b5'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'amc_vis.Input' signature:'3fd9f00c5d7a2ad359db59975e0c5ca517daced4'"); } // --- amc_vis.FDb._db.InsertStrptrMaybe @@ -820,8 +838,8 @@ bool amc_vis::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && amc_vis::LoadTuplesFile(algo::SsimFname(root,"dmmeta.finput"),recursive); retval = retval && amc_vis::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -893,14 +911,9 @@ bool amc_vis::_db_XrefMaybe() { // Find row by key. Return NULL if not found. amc_vis::FCtype* amc_vis::ind_ctype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctype_buckets_n - 1); - amc_vis::FCtype* *e = &_db.ind_ctype_buckets_elems[index]; - amc_vis::FCtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctype_next; - } while (true); + amc_vis::FCtype *ret = _db.ind_ctype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctype_next) { + } return ret; } @@ -932,10 +945,11 @@ amc_vis::FCtype& amc_vis::ind_ctype_GetOrCreate(const algo::strptr& key) { // --- amc_vis.FDb.ind_ctype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc_vis::ind_ctype_InsertMaybe(amc_vis::FCtype& row) { - ind_ctype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ctype_next == (amc_vis::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + row.ind_ctype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctype_Reserve(1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); amc_vis::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; do { amc_vis::FCtype* ret = *prev; @@ -961,7 +975,7 @@ bool amc_vis::ind_ctype_InsertMaybe(amc_vis::FCtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc_vis::ind_ctype_Remove(amc_vis::FCtype& row) { if (LIKELY(row.ind_ctype_next != (amc_vis::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); amc_vis::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; // addr of pointer to current element while (amc_vis::FCtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -978,8 +992,14 @@ void amc_vis::ind_ctype_Remove(amc_vis::FCtype& row) { // --- amc_vis.FDb.ind_ctype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc_vis::ind_ctype_Reserve(int n) { + ind_ctype_AbsReserve(_db.ind_ctype_n + n); +} + +// --- amc_vis.FDb.ind_ctype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc_vis::ind_ctype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ctype_buckets_n; - u32 new_nelems = _db.ind_ctype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -998,7 +1018,7 @@ void amc_vis::ind_ctype_Reserve(int n) { while (elem) { amc_vis::FCtype &row = *elem; amc_vis::FCtype* next = row.ind_ctype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ctype_hashval & (new_nbuckets-1); row.ind_ctype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1015,14 +1035,9 @@ void amc_vis::ind_ctype_Reserve(int n) { // Find row by key. Return NULL if not found. amc_vis::FField* amc_vis::ind_field_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_field_buckets_n - 1); - amc_vis::FField* *e = &_db.ind_field_buckets_elems[index]; - amc_vis::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + amc_vis::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_field_next) { + } return ret; } @@ -1037,10 +1052,11 @@ amc_vis::FField& amc_vis::ind_field_FindX(const algo::strptr& key) { // --- amc_vis.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc_vis::ind_field_InsertMaybe(amc_vis::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (amc_vis::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::Smallstr100_Hash(0, row.field); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); amc_vis::FField* *prev = &_db.ind_field_buckets_elems[index]; do { amc_vis::FField* ret = *prev; @@ -1066,7 +1082,7 @@ bool amc_vis::ind_field_InsertMaybe(amc_vis::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc_vis::ind_field_Remove(amc_vis::FField& row) { if (LIKELY(row.ind_field_next != (amc_vis::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); amc_vis::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (amc_vis::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1083,8 +1099,14 @@ void amc_vis::ind_field_Remove(amc_vis::FField& row) { // --- amc_vis.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc_vis::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- amc_vis.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc_vis::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1103,7 +1125,7 @@ void amc_vis::ind_field_Reserve(int n) { while (elem) { amc_vis::FField &row = *elem; amc_vis::FField* next = row.ind_field_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1207,14 +1229,9 @@ bool amc_vis::node_XrefMaybe(amc_vis::FNode &row) { // Find row by key. Return NULL if not found. amc_vis::FNode* amc_vis::ind_node_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_node_buckets_n - 1); - amc_vis::FNode* *e = &_db.ind_node_buckets_elems[index]; - amc_vis::FNode* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).node == key; - if (done) break; - e = &ret->ind_node_next; - } while (true); + amc_vis::FNode *ret = _db.ind_node_buckets_elems[index]; + for (; ret && !((*ret).node == key); ret = ret->ind_node_next) { + } return ret; } @@ -1246,10 +1263,11 @@ amc_vis::FNode& amc_vis::ind_node_GetOrCreate(const algo::strptr& key) { // --- amc_vis.FDb.ind_node.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc_vis::ind_node_InsertMaybe(amc_vis::FNode& row) { - ind_node_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_node_next == (amc_vis::FNode*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.node) & (_db.ind_node_buckets_n - 1); + row.ind_node_hashval = algo::Smallstr100_Hash(0, row.node); + ind_node_Reserve(1); + u32 index = row.ind_node_hashval & (_db.ind_node_buckets_n - 1); amc_vis::FNode* *prev = &_db.ind_node_buckets_elems[index]; do { amc_vis::FNode* ret = *prev; @@ -1275,7 +1293,7 @@ bool amc_vis::ind_node_InsertMaybe(amc_vis::FNode& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc_vis::ind_node_Remove(amc_vis::FNode& row) { if (LIKELY(row.ind_node_next != (amc_vis::FNode*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.node) & (_db.ind_node_buckets_n - 1); + u32 index = row.ind_node_hashval & (_db.ind_node_buckets_n - 1); amc_vis::FNode* *prev = &_db.ind_node_buckets_elems[index]; // addr of pointer to current element while (amc_vis::FNode *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1292,8 +1310,14 @@ void amc_vis::ind_node_Remove(amc_vis::FNode& row) { // --- amc_vis.FDb.ind_node.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc_vis::ind_node_Reserve(int n) { + ind_node_AbsReserve(_db.ind_node_n + n); +} + +// --- amc_vis.FDb.ind_node.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc_vis::ind_node_AbsReserve(int n) { u32 old_nbuckets = _db.ind_node_buckets_n; - u32 new_nelems = _db.ind_node_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1312,7 +1336,7 @@ void amc_vis::ind_node_Reserve(int n) { while (elem) { amc_vis::FNode &row = *elem; amc_vis::FNode* next = row.ind_node_next; - u32 index = algo::Smallstr100_Hash(0, row.node) & (new_nbuckets-1); + u32 index = row.ind_node_hashval & (new_nbuckets-1); row.ind_node_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1328,8 +1352,8 @@ void amc_vis::ind_node_Reserve(int n) { // --- amc_vis.FDb.link.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -amc_vis::Link& amc_vis::link_Alloc() { - amc_vis::Link* row = link_AllocMaybe(); +amc_vis::FLink& amc_vis::link_Alloc() { + amc_vis::FLink* row = link_AllocMaybe(); if (UNLIKELY(row == NULL)) { FatalErrorExit("amc_vis.out_of_mem field:amc_vis.FDb.link comment:'Alloc failed'"); } @@ -1338,10 +1362,10 @@ amc_vis::Link& amc_vis::link_Alloc() { // --- amc_vis.FDb.link.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -amc_vis::Link* amc_vis::link_AllocMaybe() { - amc_vis::Link *row = (amc_vis::Link*)link_AllocMem(); +amc_vis::FLink* amc_vis::link_AllocMaybe() { + amc_vis::FLink *row = (amc_vis::FLink*)link_AllocMem(); if (row) { - new (row) amc_vis::Link; // call constructor + new (row) amc_vis::FLink; // call constructor } return row; } @@ -1356,11 +1380,11 @@ void* amc_vis::link_AllocMem() { u64 index = new_nelems-base; void *ret = NULL; // if level doesn't exist yet, create it - amc_vis::Link* lev = NULL; + amc_vis::FLink* lev = NULL; if (bsr < 32) { lev = _db.link_lary[bsr]; if (!lev) { - lev=(amc_vis::Link*)algo_lib::malloc_AllocMem(sizeof(amc_vis::Link) * (u64(1)<0; ) { n--; - link_qFind(u64(n)).~Link(); // destroy last element + link_qFind(u64(n)).~FLink(); // destroy last element _db.link_n = i32(n); } } @@ -1388,7 +1412,7 @@ void amc_vis::link_RemoveLast() { u64 n = _db.link_n; if (n > 0) { n -= 1; - link_qFind(u64(n)).~Link(); + link_qFind(u64(n)).~FLink(); _db.link_n = i32(n); } } @@ -1396,7 +1420,7 @@ void amc_vis::link_RemoveLast() { // --- amc_vis.FDb.link.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool amc_vis::link_XrefMaybe(amc_vis::Link &row) { +bool amc_vis::link_XrefMaybe(amc_vis::FLink &row) { bool retval = true; (void)row; // insert link into index ind_link @@ -1431,37 +1455,33 @@ bool amc_vis::link_XrefMaybe(amc_vis::Link &row) { // --- amc_vis.FDb.ind_link.Find // Find row by key. Return NULL if not found. -amc_vis::Link* amc_vis::ind_link_Find(const algo::strptr& key) { - u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_link_buckets_n - 1); - amc_vis::Link* *e = &_db.ind_link_buckets_elems[index]; - amc_vis::Link* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).link == key; - if (done) break; - e = &ret->ind_link_next; - } while (true); +amc_vis::FLink* amc_vis::ind_link_Find(const algo::strptr& key) { + u32 index = algo::cstring_Hash(0, key) & (_db.ind_link_buckets_n - 1); + amc_vis::FLink *ret = _db.ind_link_buckets_elems[index]; + for (; ret && !((*ret).link == key); ret = ret->ind_link_next) { + } return ret; } // --- amc_vis.FDb.ind_link.FindX // Look up row by key and return reference. Throw exception if not found -amc_vis::Link& amc_vis::ind_link_FindX(const algo::strptr& key) { - amc_vis::Link* ret = ind_link_Find(key); +amc_vis::FLink& amc_vis::ind_link_FindX(const algo::strptr& key) { + amc_vis::FLink* ret = ind_link_Find(key); vrfy(ret, tempstr() << "amc_vis.key_error table:ind_link key:'"<ind_link_next; // unlink (singly linked list) _db.ind_link_n--; - row.ind_link_next = (amc_vis::Link*)-1;// not-in-hash + row.ind_link_next = (amc_vis::FLink*)-1;// not-in-hash break; } prev = &next->ind_link_next; @@ -1501,27 +1521,33 @@ void amc_vis::ind_link_Remove(amc_vis::Link& row) { // --- amc_vis.FDb.ind_link.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc_vis::ind_link_Reserve(int n) { + ind_link_AbsReserve(_db.ind_link_n + n); +} + +// --- amc_vis.FDb.ind_link.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc_vis::ind_link_AbsReserve(int n) { u32 old_nbuckets = _db.ind_link_buckets_n; - u32 new_nelems = _db.ind_link_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); - u32 old_size = old_nbuckets * sizeof(amc_vis::Link*); - u32 new_size = new_nbuckets * sizeof(amc_vis::Link*); + u32 old_size = old_nbuckets * sizeof(amc_vis::FLink*); + u32 new_size = new_nbuckets * sizeof(amc_vis::FLink*); // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably // means new memory will have to be allocated anyway - amc_vis::Link* *new_buckets = (amc_vis::Link**)algo_lib::malloc_AllocMem(new_size); + amc_vis::FLink* *new_buckets = (amc_vis::FLink**)algo_lib::malloc_AllocMem(new_size); if (UNLIKELY(!new_buckets)) { FatalErrorExit("amc_vis.out_of_memory field:amc_vis.FDb.ind_link"); } memset(new_buckets, 0, new_size); // clear pointers // rehash all entries for (int i = 0; i < _db.ind_link_buckets_n; i++) { - amc_vis::Link* elem = _db.ind_link_buckets_elems[i]; + amc_vis::FLink* elem = _db.ind_link_buckets_elems[i]; while (elem) { - amc_vis::Link &row = *elem; - amc_vis::Link* next = row.ind_link_next; - u32 index = algo::Smallstr100_Hash(0, row.link) & (new_nbuckets-1); + amc_vis::FLink &row = *elem; + amc_vis::FLink* next = row.ind_link_next; + u32 index = row.ind_link_hashval & (new_nbuckets-1); row.ind_link_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1537,8 +1563,8 @@ void amc_vis::ind_link_Reserve(int n) { // --- amc_vis.FDb.linkdep.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -amc_vis::Linkdep& amc_vis::linkdep_Alloc() { - amc_vis::Linkdep* row = linkdep_AllocMaybe(); +amc_vis::FLinkdep& amc_vis::linkdep_Alloc() { + amc_vis::FLinkdep* row = linkdep_AllocMaybe(); if (UNLIKELY(row == NULL)) { FatalErrorExit("amc_vis.out_of_mem field:amc_vis.FDb.linkdep comment:'Alloc failed'"); } @@ -1547,10 +1573,10 @@ amc_vis::Linkdep& amc_vis::linkdep_Alloc() { // --- amc_vis.FDb.linkdep.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -amc_vis::Linkdep* amc_vis::linkdep_AllocMaybe() { - amc_vis::Linkdep *row = (amc_vis::Linkdep*)linkdep_AllocMem(); +amc_vis::FLinkdep* amc_vis::linkdep_AllocMaybe() { + amc_vis::FLinkdep *row = (amc_vis::FLinkdep*)linkdep_AllocMem(); if (row) { - new (row) amc_vis::Linkdep; // call constructor + new (row) amc_vis::FLinkdep; // call constructor row->rowid = i32(linkdep_N() - 1); } return row; @@ -1566,11 +1592,11 @@ void* amc_vis::linkdep_AllocMem() { u64 index = new_nelems-base; void *ret = NULL; // if level doesn't exist yet, create it - amc_vis::Linkdep* lev = NULL; + amc_vis::FLinkdep* lev = NULL; if (bsr < 32) { lev = _db.linkdep_lary[bsr]; if (!lev) { - lev=(amc_vis::Linkdep*)algo_lib::malloc_AllocMem(sizeof(amc_vis::Linkdep) * (u64(1)<0; ) { n--; - linkdep_qFind(i32(n)).~Linkdep(); // destroy last element + linkdep_qFind(i32(n)).~FLinkdep(); // destroy last element _db.linkdep_n = i32(n); } } @@ -1598,7 +1624,7 @@ void amc_vis::linkdep_RemoveLast() { u64 n = _db.linkdep_n; if (n > 0) { n -= 1; - linkdep_qFind(i32(n)).~Linkdep(); + linkdep_qFind(i32(n)).~FLinkdep(); _db.linkdep_n = i32(n); } } @@ -1606,21 +1632,21 @@ void amc_vis::linkdep_RemoveLast() { // --- amc_vis.FDb.linkdep.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool amc_vis::linkdep_XrefMaybe(amc_vis::Linkdep &row) { +bool amc_vis::linkdep_XrefMaybe(amc_vis::FLinkdep &row) { bool retval = true; (void)row; - amc_vis::Link* p_p_link_from = row.p_link_from; + amc_vis::FLink* p_p_link_from = row.p_link_from; if (UNLIKELY(!p_p_link_from)) { - algo_lib::ResetErrtext() << "amc_vis.null_ref xref:amc_vis.Link.zd_linkdep_out"; + algo_lib::ResetErrtext() << "amc_vis.null_ref xref:amc_vis.FLink.zd_linkdep_out"; return false; } // insert linkdep into index zd_linkdep_out if (true) { // user-defined insert condition zd_linkdep_out_Insert(*p_p_link_from, row); } - amc_vis::Link* p_p_link_to = row.p_link_to; + amc_vis::FLink* p_p_link_to = row.p_link_to; if (UNLIKELY(!p_p_link_to)) { - algo_lib::ResetErrtext() << "amc_vis.null_ref xref:amc_vis.Link.zd_linkdep_in"; + algo_lib::ResetErrtext() << "amc_vis.null_ref xref:amc_vis.FLink.zd_linkdep_in"; return false; } // insert linkdep into index zd_linkdep_in @@ -1633,16 +1659,12 @@ bool amc_vis::linkdep_XrefMaybe(amc_vis::Linkdep &row) { // --- amc_vis.FDb.c_linklist.Insert // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. -void amc_vis::c_linklist_Insert(amc_vis::Link& row) { - if (bool_Update(row._db_c_linklist_in_ary,true)) { - // reserve space +void amc_vis::c_linklist_Insert(amc_vis::FLink& row) { + if (!row.c_linklist_in_ary) { c_linklist_Reserve(1); - u32 n = _db.c_linklist_n; - u32 at = n; - amc_vis::Link* *elems = _db.c_linklist_elems; - elems[at] = &row; - _db.c_linklist_n = n+1; - + u32 n = _db.c_linklist_n++; + _db.c_linklist_elems[n] = &row; + row.c_linklist_in_ary = true; } } @@ -1650,27 +1672,27 @@ void amc_vis::c_linklist_Insert(amc_vis::Link& row) { // Insert pointer to row in array. // If row is already in the array, do nothing. // Return value: whether element was inserted into array. -bool amc_vis::c_linklist_InsertMaybe(amc_vis::Link& row) { - bool retval = !row._db_c_linklist_in_ary; +bool amc_vis::c_linklist_InsertMaybe(amc_vis::FLink& row) { + bool retval = !c_linklist_InAryQ(row); c_linklist_Insert(row); // check is performed in _Insert again return retval; } // --- amc_vis.FDb.c_linklist.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing -void amc_vis::c_linklist_Remove(amc_vis::Link& row) { - if (bool_Update(row._db_c_linklist_in_ary,false)) { - int lim = _db.c_linklist_n; - amc_vis::Link* *elems = _db.c_linklist_elems; +void amc_vis::c_linklist_Remove(amc_vis::FLink& row) { + int n = _db.c_linklist_n; + if (bool_Update(row.c_linklist_in_ary,false)) { + amc_vis::FLink* *elems = _db.c_linklist_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { - amc_vis::Link* elem = elems[i]; // fetch element + for (int i = n-1; i>=0; i--) { + amc_vis::FLink* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(amc_vis::Link*) * (lim - j); + size_t nbytes = sizeof(amc_vis::FLink*) * (n - j); memmove(elems + i, elems + j, nbytes); - _db.c_linklist_n = lim - 1; + _db.c_linklist_n = n - 1; break; } } @@ -1683,13 +1705,13 @@ void amc_vis::c_linklist_Reserve(u32 n) { u32 old_max = _db.c_linklist_max; if (UNLIKELY(_db.c_linklist_n + n > old_max)) { u32 new_max = u32_Max(4, old_max * 2); - u32 old_size = old_max * sizeof(amc_vis::Link*); - u32 new_size = new_max * sizeof(amc_vis::Link*); + u32 old_size = old_max * sizeof(amc_vis::FLink*); + u32 new_size = new_max * sizeof(amc_vis::FLink*); void *new_mem = algo_lib::malloc_ReallocMem(_db.c_linklist_elems, old_size, new_size); if (UNLIKELY(!new_mem)) { FatalErrorExit("amc_vis.out_of_memory field:amc_vis.FDb.c_linklist"); } - _db.c_linklist_elems = (amc_vis::Link**)new_mem; + _db.c_linklist_elems = (amc_vis::FLink**)new_mem; _db.c_linklist_max = new_max; } } @@ -1873,7 +1895,7 @@ inline static bool amc_vis::bh_node_ElemLt(amc_vis::FNode &a, amc_vis::FNode &b) // Remove all elements from heap and free memory used by the array. void amc_vis::bh_link_Dealloc() { bh_link_RemoveAll(); - algo_lib::malloc_FreeMem(_db.bh_link_elems, sizeof(amc_vis::Link*)*_db.bh_link_max); + algo_lib::malloc_FreeMem(_db.bh_link_elems, sizeof(amc_vis::FLink*)*_db.bh_link_max); _db.bh_link_max = 0; _db.bh_link_elems = NULL; } @@ -1881,15 +1903,15 @@ void amc_vis::bh_link_Dealloc() { // --- amc_vis.FDb.bh_link.Downheap // Find new location for ROW starting at IDX // NOTE: Rest of heap is rearranged, but pointer to ROW is NOT stored in array. -static int amc_vis::bh_link_Downheap(amc_vis::Link& row, int idx) { - amc_vis::Link* *elems = _db.bh_link_elems; +static int amc_vis::bh_link_Downheap(amc_vis::FLink& row, int idx) { + amc_vis::FLink* *elems = _db.bh_link_elems; int n = _db.bh_link_n; int child = idx*2+1; while (child < n) { - amc_vis::Link* p = elems[child]; // left child + amc_vis::FLink* p = elems[child]; // left child int rchild = child+1; if (rchild < n) { - amc_vis::Link* q = elems[rchild]; // right child + amc_vis::FLink* q = elems[rchild]; // right child if (bh_link_ElemLt(*q,*p)) { child = rchild; p = q; @@ -1908,7 +1930,7 @@ static int amc_vis::bh_link_Downheap(amc_vis::Link& row, int idx) { // --- amc_vis.FDb.bh_link.Insert // Insert row. Row must not already be in index. If row is already in index, do nothing. -void amc_vis::bh_link_Insert(amc_vis::Link& row) { +void amc_vis::bh_link_Insert(amc_vis::FLink& row) { if (LIKELY(row.bh_link_idx == -1)) { bh_link_Reserve(1); int n = _db.bh_link_n; @@ -1922,7 +1944,7 @@ void amc_vis::bh_link_Insert(amc_vis::Link& row) { // --- amc_vis.FDb.bh_link.Reheap // If row is in heap, update its position. If row is not in heap, insert it. // Return new position of item in the heap (0=top) -i32 amc_vis::bh_link_Reheap(amc_vis::Link& row) { +i32 amc_vis::bh_link_Reheap(amc_vis::FLink& row) { int old_idx = row.bh_link_idx; bool isnew = old_idx == -1; if (isnew) { @@ -1944,7 +1966,7 @@ i32 amc_vis::bh_link_Reheap(amc_vis::Link& row) { // Return new position of item in the heap (0=top). // Heap must be non-empty or behavior is undefined. i32 amc_vis::bh_link_ReheapFirst() { - amc_vis::Link &row = *_db.bh_link_elems[0]; + amc_vis::FLink &row = *_db.bh_link_elems[0]; i32 new_idx = bh_link_Downheap(row, 0); row.bh_link_idx = new_idx; _db.bh_link_elems[new_idx] = &row; @@ -1953,7 +1975,7 @@ i32 amc_vis::bh_link_ReheapFirst() { // --- amc_vis.FDb.bh_link.Remove // Remove element from index. If element is not in index, do nothing. -void amc_vis::bh_link_Remove(amc_vis::Link& row) { +void amc_vis::bh_link_Remove(amc_vis::FLink& row) { if (bh_link_InBheapQ(row)) { int old_idx = row.bh_link_idx; if (_db.bh_link_elems[old_idx] == &row) { // sanity check: heap points back to row @@ -1961,7 +1983,7 @@ void amc_vis::bh_link_Remove(amc_vis::Link& row) { i32 n = _db.bh_link_n - 1; // index of last element in heap _db.bh_link_n = n; // decrease count if (old_idx != n) { - amc_vis::Link *elem = _db.bh_link_elems[n]; + amc_vis::FLink *elem = _db.bh_link_elems[n]; int new_idx = bh_link_Upheap(*elem, old_idx); if (new_idx == old_idx) { new_idx = bh_link_Downheap(*elem, old_idx); @@ -1986,15 +2008,15 @@ void amc_vis::bh_link_RemoveAll() { // --- amc_vis.FDb.bh_link.RemoveFirst // If index is empty, return NULL. Otherwise remove and return first key in index. // Call 'head changed' trigger. -amc_vis::Link* amc_vis::bh_link_RemoveFirst() { - amc_vis::Link *row = NULL; +amc_vis::FLink* amc_vis::bh_link_RemoveFirst() { + amc_vis::FLink *row = NULL; if (_db.bh_link_n > 0) { row = _db.bh_link_elems[0]; row->bh_link_idx = -1; // mark not in heap i32 n = _db.bh_link_n - 1; // index of last element in heap _db.bh_link_n = n; // decrease count if (n) { - amc_vis::Link &elem = *_db.bh_link_elems[n]; + amc_vis::FLink &elem = *_db.bh_link_elems[n]; int new_idx = bh_link_Downheap(elem, 0); elem.bh_link_idx = new_idx; _db.bh_link_elems[new_idx] = &elem; @@ -2009,13 +2031,13 @@ void amc_vis::bh_link_Reserve(int n) { i32 old_max = _db.bh_link_max; if (UNLIKELY(_db.bh_link_n + n > old_max)) { u32 new_max = u32_Max(4, old_max * 2); - u32 old_size = old_max * sizeof(amc_vis::Link*); - u32 new_size = new_max * sizeof(amc_vis::Link*); + u32 old_size = old_max * sizeof(amc_vis::FLink*); + u32 new_size = new_max * sizeof(amc_vis::FLink*); void *new_mem = algo_lib::malloc_ReallocMem(_db.bh_link_elems, old_size, new_size); if (UNLIKELY(!new_mem)) { FatalErrorExit("amc_vis.out_of_memory field:amc_vis.FDb.bh_link"); } - _db.bh_link_elems = (amc_vis::Link**)new_mem; + _db.bh_link_elems = (amc_vis::FLink**)new_mem; _db.bh_link_max = new_max; } } @@ -2023,11 +2045,11 @@ void amc_vis::bh_link_Reserve(int n) { // --- amc_vis.FDb.bh_link.Upheap // Find and return index of new location for element ROW in the heap, starting at index IDX. // Move any elements along the way but do not modify ROW. -static int amc_vis::bh_link_Upheap(amc_vis::Link& row, int idx) { - amc_vis::Link* *elems = _db.bh_link_elems; +static int amc_vis::bh_link_Upheap(amc_vis::FLink& row, int idx) { + amc_vis::FLink* *elems = _db.bh_link_elems; while (idx>0) { int j = (idx-1)/2; - amc_vis::Link* p = elems[j]; + amc_vis::FLink* p = elems[j]; if (!bh_link_ElemLt(row, *p)) { break; } @@ -2039,7 +2061,7 @@ static int amc_vis::bh_link_Upheap(amc_vis::Link& row, int idx) { } // --- amc_vis.FDb.bh_link.ElemLt -inline static bool amc_vis::bh_link_ElemLt(amc_vis::Link &a, amc_vis::Link &b) { +inline static bool amc_vis::bh_link_ElemLt(amc_vis::FLink &a, amc_vis::FLink &b) { (void)_db; return linkkey_Lt(a, b); } @@ -2145,14 +2167,9 @@ bool amc_vis::reftype_XrefMaybe(amc_vis::FReftype &row) { // Find row by key. Return NULL if not found. amc_vis::FReftype* amc_vis::ind_reftype_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_reftype_buckets_n - 1); - amc_vis::FReftype* *e = &_db.ind_reftype_buckets_elems[index]; - amc_vis::FReftype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).reftype == key; - if (done) break; - e = &ret->ind_reftype_next; - } while (true); + amc_vis::FReftype *ret = _db.ind_reftype_buckets_elems[index]; + for (; ret && !((*ret).reftype == key); ret = ret->ind_reftype_next) { + } return ret; } @@ -2184,10 +2201,11 @@ amc_vis::FReftype& amc_vis::ind_reftype_GetOrCreate(const algo::strptr& key) { // --- amc_vis.FDb.ind_reftype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool amc_vis::ind_reftype_InsertMaybe(amc_vis::FReftype& row) { - ind_reftype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_reftype_next == (amc_vis::FReftype*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.reftype) & (_db.ind_reftype_buckets_n - 1); + row.ind_reftype_hashval = algo::Smallstr50_Hash(0, row.reftype); + ind_reftype_Reserve(1); + u32 index = row.ind_reftype_hashval & (_db.ind_reftype_buckets_n - 1); amc_vis::FReftype* *prev = &_db.ind_reftype_buckets_elems[index]; do { amc_vis::FReftype* ret = *prev; @@ -2213,7 +2231,7 @@ bool amc_vis::ind_reftype_InsertMaybe(amc_vis::FReftype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void amc_vis::ind_reftype_Remove(amc_vis::FReftype& row) { if (LIKELY(row.ind_reftype_next != (amc_vis::FReftype*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.reftype) & (_db.ind_reftype_buckets_n - 1); + u32 index = row.ind_reftype_hashval & (_db.ind_reftype_buckets_n - 1); amc_vis::FReftype* *prev = &_db.ind_reftype_buckets_elems[index]; // addr of pointer to current element while (amc_vis::FReftype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2230,8 +2248,14 @@ void amc_vis::ind_reftype_Remove(amc_vis::FReftype& row) { // --- amc_vis.FDb.ind_reftype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void amc_vis::ind_reftype_Reserve(int n) { + ind_reftype_AbsReserve(_db.ind_reftype_n + n); +} + +// --- amc_vis.FDb.ind_reftype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void amc_vis::ind_reftype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_reftype_buckets_n; - u32 new_nelems = _db.ind_reftype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2250,7 +2274,7 @@ void amc_vis::ind_reftype_Reserve(int n) { while (elem) { amc_vis::FReftype &row = *elem; amc_vis::FReftype* next = row.ind_reftype_next; - u32 index = algo::Smallstr50_Hash(0, row.reftype) & (new_nbuckets-1); + u32 index = row.ind_reftype_hashval & (new_nbuckets-1); row.ind_reftype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2362,8 +2386,8 @@ bool amc_vis::nodedep_XrefMaybe(amc_vis::FNodedep &row) { // --- amc_vis.FDb.outrow.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -amc_vis::Outrow& amc_vis::outrow_Alloc() { - amc_vis::Outrow* row = outrow_AllocMaybe(); +amc_vis::FOutrow& amc_vis::outrow_Alloc() { + amc_vis::FOutrow* row = outrow_AllocMaybe(); if (UNLIKELY(row == NULL)) { FatalErrorExit("amc_vis.out_of_mem field:amc_vis.FDb.outrow comment:'Alloc failed'"); } @@ -2372,10 +2396,10 @@ amc_vis::Outrow& amc_vis::outrow_Alloc() { // --- amc_vis.FDb.outrow.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -amc_vis::Outrow* amc_vis::outrow_AllocMaybe() { - amc_vis::Outrow *row = (amc_vis::Outrow*)outrow_AllocMem(); +amc_vis::FOutrow* amc_vis::outrow_AllocMaybe() { + amc_vis::FOutrow *row = (amc_vis::FOutrow*)outrow_AllocMem(); if (row) { - new (row) amc_vis::Outrow; // call constructor + new (row) amc_vis::FOutrow; // call constructor row->rowid = i32(outrow_N() - 1); } return row; @@ -2391,11 +2415,11 @@ void* amc_vis::outrow_AllocMem() { u64 index = new_nelems-base; void *ret = NULL; // if level doesn't exist yet, create it - amc_vis::Outrow* lev = NULL; + amc_vis::FOutrow* lev = NULL; if (bsr < 32) { lev = _db.outrow_lary[bsr]; if (!lev) { - lev=(amc_vis::Outrow*)algo_lib::malloc_AllocMem(sizeof(amc_vis::Outrow) * (u64(1)<0; ) { n--; - outrow_qFind(i32(n)).~Outrow(); // destroy last element + outrow_qFind(i32(n)).~FOutrow(); // destroy last element _db.outrow_n = i32(n); } } @@ -2423,7 +2447,7 @@ void amc_vis::outrow_RemoveLast() { u64 n = _db.outrow_n; if (n > 0) { n -= 1; - outrow_qFind(i32(n)).~Outrow(); + outrow_qFind(i32(n)).~FOutrow(); _db.outrow_n = i32(n); } } @@ -2431,7 +2455,7 @@ void amc_vis::outrow_RemoveLast() { // --- amc_vis.FDb.outrow.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool amc_vis::outrow_XrefMaybe(amc_vis::Outrow &row) { +bool amc_vis::outrow_XrefMaybe(amc_vis::FOutrow &row) { bool retval = true; (void)row; return retval; @@ -2712,14 +2736,14 @@ void amc_vis::_db_bh_node_curs_Next(_db_bh_node_curs &curs) { } // --- amc_vis.FDb.bh_link_curs.Add -static void amc_vis::_db_bh_link_curs_Add(_db_bh_link_curs &curs, amc_vis::Link& row) { +static void amc_vis::_db_bh_link_curs_Add(_db_bh_link_curs &curs, amc_vis::FLink& row) { u32 n = curs.temp_n; int i = n; curs.temp_n = n+1; - amc_vis::Link* *elems = curs.temp_elems; + amc_vis::FLink* *elems = curs.temp_elems; while (i>0) { int j = (i-1)/2; - amc_vis::Link* p = elems[j]; + amc_vis::FLink* p = elems[j]; if (!bh_link_ElemLt(row,*p)) { break; } @@ -2734,7 +2758,7 @@ void amc_vis::_db_bh_link_curs_Reserve(_db_bh_link_curs &curs, int n) { if (n > curs.temp_max) { size_t old_size = sizeof(void*) * curs.temp_max; size_t new_size = sizeof(void*) * bh_link_N(); - curs.temp_elems = (amc_vis::Link**)algo_lib::malloc_ReallocMem(curs.temp_elems, old_size, new_size); + curs.temp_elems = (amc_vis::FLink**)algo_lib::malloc_ReallocMem(curs.temp_elems, old_size, new_size); if (!curs.temp_elems) { algo::FatalErrorExit("amc_vis.cursor_out_of_memory func:amc_vis.FDb.bh_link_curs.Reserve"); } @@ -2749,7 +2773,7 @@ void amc_vis::_db_bh_link_curs_Reset(_db_bh_link_curs &curs, amc_vis::FDb &paren _db_bh_link_curs_Reserve(curs, bh_link_N()); curs.temp_n = 0; if (parent.bh_link_n > 0) { - amc_vis::Link &first = *parent.bh_link_elems[0]; + amc_vis::FLink &first = *parent.bh_link_elems[0]; curs.temp_elems[0] = &first; // insert first element in heap curs.temp_n = 1; } @@ -2758,22 +2782,22 @@ void amc_vis::_db_bh_link_curs_Reset(_db_bh_link_curs &curs, amc_vis::FDb &paren // --- amc_vis.FDb.bh_link_curs.Next // Advance cursor. void amc_vis::_db_bh_link_curs_Next(_db_bh_link_curs &curs) { - amc_vis::Link* *elems = curs.temp_elems; + amc_vis::FLink* *elems = curs.temp_elems; int n = curs.temp_n; if (n > 0) { // remove top element from heap - amc_vis::Link* dead = elems[0]; + amc_vis::FLink* dead = elems[0]; int i = 0; - amc_vis::Link* last = curs.temp_elems[n-1]; + amc_vis::FLink* last = curs.temp_elems[n-1]; // downheap last elem do { - amc_vis::Link* choose = last; + amc_vis::FLink* choose = last; int l = i*2+1; if (lbh_link_idx; i = (index*2+1); if (i < bh_link_N()) { - amc_vis::Link &elem = *curs.parent->bh_link_elems[i]; + amc_vis::FLink &elem = *curs.parent->bh_link_elems[i]; _db_bh_link_curs_Add(curs, elem); } if (i+1 < bh_link_N()) { - amc_vis::Link &elem = *curs.parent->bh_link_elems[i + 1]; + amc_vis::FLink &elem = *curs.parent->bh_link_elems[i + 1]; _db_bh_link_curs_Add(curs, elem); } } @@ -2863,7 +2887,7 @@ void amc_vis::FDb_Init() { // initialize LAry link (amc_vis.FDb.link) _db.link_n = 0; memset(_db.link_lary, 0, sizeof(_db.link_lary)); // zero out all level pointers - amc_vis::Link* link_first = (amc_vis::Link*)algo_lib::malloc_AllocMem(sizeof(amc_vis::Link) * (u64(1)<<4)); + amc_vis::FLink* link_first = (amc_vis::FLink*)algo_lib::malloc_AllocMem(sizeof(amc_vis::FLink) * (u64(1)<<4)); if (!link_first) { FatalErrorExit("out of memory"); } @@ -2871,18 +2895,18 @@ void amc_vis::FDb_Init() { _db.link_lary[i] = link_first; link_first += 1ULL<link_zd_linkdep_out_next; + amc_vis::FLinkdep **new_row_b = &link.zd_linkdep_out_head; + amc_vis::FLinkdep **new_row = old_tail ? new_row_a : new_row_b; + *new_row = &row; + } +} + +// --- amc_vis.FLink.zd_linkdep_out.Remove +// Remove element from index. If element is not in index, do nothing. +void amc_vis::zd_linkdep_out_Remove(amc_vis::FLink& link, amc_vis::FLinkdep& row) { + if (link_zd_linkdep_out_InLlistQ(row)) { + amc_vis::FLinkdep* old_head = link.zd_linkdep_out_head; + (void)old_head; // in case it's not used + amc_vis::FLinkdep* prev = row.link_zd_linkdep_out_prev; + amc_vis::FLinkdep* next = row.link_zd_linkdep_out_next; + // if element is first, adjust list head; otherwise, adjust previous element's next + amc_vis::FLinkdep **new_next_a = &prev->link_zd_linkdep_out_next; + amc_vis::FLinkdep **new_next_b = &link.zd_linkdep_out_head; + amc_vis::FLinkdep **new_next = prev ? new_next_a : new_next_b; + *new_next = next; + // if element is last, adjust list tail; otherwise, adjust next element's prev + amc_vis::FLinkdep **new_prev_a = &next->link_zd_linkdep_out_prev; + amc_vis::FLinkdep **new_prev_b = &link.zd_linkdep_out_tail; + amc_vis::FLinkdep **new_prev = next ? new_prev_a : new_prev_b; + *new_prev = prev; + row.link_zd_linkdep_out_next=(amc_vis::FLinkdep*)-1; // not-in-list + } +} + +// --- amc_vis.FLink.zd_linkdep_out.RemoveAll +// Empty the index. (The rows are not deleted) +void amc_vis::zd_linkdep_out_RemoveAll(amc_vis::FLink& link) { + amc_vis::FLinkdep* row = link.zd_linkdep_out_head; + link.zd_linkdep_out_head = NULL; + link.zd_linkdep_out_tail = NULL; + while (row) { + amc_vis::FLinkdep* row_next = row->link_zd_linkdep_out_next; + row->link_zd_linkdep_out_next = (amc_vis::FLinkdep*)-1; + row->link_zd_linkdep_out_prev = NULL; + row = row_next; + } +} + +// --- amc_vis.FLink.zd_linkdep_out.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +amc_vis::FLinkdep* amc_vis::zd_linkdep_out_RemoveFirst(amc_vis::FLink& link) { + amc_vis::FLinkdep *row = NULL; + row = link.zd_linkdep_out_head; + if (row) { + amc_vis::FLinkdep *next = row->link_zd_linkdep_out_next; + link.zd_linkdep_out_head = next; + amc_vis::FLinkdep **new_end_a = &next->link_zd_linkdep_out_prev; + amc_vis::FLinkdep **new_end_b = &link.zd_linkdep_out_tail; + amc_vis::FLinkdep **new_end = next ? new_end_a : new_end_b; + *new_end = NULL; + row->link_zd_linkdep_out_next = (amc_vis::FLinkdep*)-1; // mark as not-in-list + } + return row; +} + +// --- amc_vis.FLink.zd_linkdep_in.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void amc_vis::zd_linkdep_in_Insert(amc_vis::FLink& link, amc_vis::FLinkdep& row) { + if (!link_zd_linkdep_in_InLlistQ(row)) { + amc_vis::FLinkdep* old_tail = link.zd_linkdep_in_tail; + row.link_zd_linkdep_in_next = NULL; + row.link_zd_linkdep_in_prev = old_tail; + link.zd_linkdep_in_tail = &row; + amc_vis::FLinkdep **new_row_a = &old_tail->link_zd_linkdep_in_next; + amc_vis::FLinkdep **new_row_b = &link.zd_linkdep_in_head; + amc_vis::FLinkdep **new_row = old_tail ? new_row_a : new_row_b; + *new_row = &row; + } +} + +// --- amc_vis.FLink.zd_linkdep_in.Remove +// Remove element from index. If element is not in index, do nothing. +void amc_vis::zd_linkdep_in_Remove(amc_vis::FLink& link, amc_vis::FLinkdep& row) { + if (link_zd_linkdep_in_InLlistQ(row)) { + amc_vis::FLinkdep* old_head = link.zd_linkdep_in_head; + (void)old_head; // in case it's not used + amc_vis::FLinkdep* prev = row.link_zd_linkdep_in_prev; + amc_vis::FLinkdep* next = row.link_zd_linkdep_in_next; + // if element is first, adjust list head; otherwise, adjust previous element's next + amc_vis::FLinkdep **new_next_a = &prev->link_zd_linkdep_in_next; + amc_vis::FLinkdep **new_next_b = &link.zd_linkdep_in_head; + amc_vis::FLinkdep **new_next = prev ? new_next_a : new_next_b; + *new_next = next; + // if element is last, adjust list tail; otherwise, adjust next element's prev + amc_vis::FLinkdep **new_prev_a = &next->link_zd_linkdep_in_prev; + amc_vis::FLinkdep **new_prev_b = &link.zd_linkdep_in_tail; + amc_vis::FLinkdep **new_prev = next ? new_prev_a : new_prev_b; + *new_prev = prev; + row.link_zd_linkdep_in_next=(amc_vis::FLinkdep*)-1; // not-in-list + } +} + +// --- amc_vis.FLink.zd_linkdep_in.RemoveAll +// Empty the index. (The rows are not deleted) +void amc_vis::zd_linkdep_in_RemoveAll(amc_vis::FLink& link) { + amc_vis::FLinkdep* row = link.zd_linkdep_in_head; + link.zd_linkdep_in_head = NULL; + link.zd_linkdep_in_tail = NULL; + while (row) { + amc_vis::FLinkdep* row_next = row->link_zd_linkdep_in_next; + row->link_zd_linkdep_in_next = (amc_vis::FLinkdep*)-1; + row->link_zd_linkdep_in_prev = NULL; + row = row_next; + } +} + +// --- amc_vis.FLink.zd_linkdep_in.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +amc_vis::FLinkdep* amc_vis::zd_linkdep_in_RemoveFirst(amc_vis::FLink& link) { + amc_vis::FLinkdep *row = NULL; + row = link.zd_linkdep_in_head; + if (row) { + amc_vis::FLinkdep *next = row->link_zd_linkdep_in_next; + link.zd_linkdep_in_head = next; + amc_vis::FLinkdep **new_end_a = &next->link_zd_linkdep_in_prev; + amc_vis::FLinkdep **new_end_b = &link.zd_linkdep_in_tail; + amc_vis::FLinkdep **new_end = next ? new_end_a : new_end_b; + *new_end = NULL; + row->link_zd_linkdep_in_next = (amc_vis::FLinkdep*)-1; // mark as not-in-list + } + return row; +} + +// --- amc_vis.FLink..Init +// Set all fields to initial values. +void amc_vis::FLink_Init(amc_vis::FLink& link) { + link.outrow = i32(0); + link.p_node1 = NULL; + link.p_node2 = NULL; + link.upptr = bool(false); + link.zd_linkdep_out_head = NULL; // (amc_vis.FLink.zd_linkdep_out) + link.zd_linkdep_out_tail = NULL; // (amc_vis.FLink.zd_linkdep_out) + link.zd_linkdep_in_head = NULL; // (amc_vis.FLink.zd_linkdep_in) + link.zd_linkdep_in_tail = NULL; // (amc_vis.FLink.zd_linkdep_in) + link.c_linklist_in_ary = bool(false); + link.ind_link_next = (amc_vis::FLink*)-1; // (amc_vis.FDb.ind_link) not-in-hash + link.ind_link_hashval = 0; // stored hash value + link.bh_link_idx = -1; // (amc_vis.FDb.bh_link) not-in-heap + link.node_zd_link_out_next = (amc_vis::FLink*)-1; // (amc_vis.FNode.zd_link_out) not-in-list + link.node_zd_link_out_prev = NULL; // (amc_vis.FNode.zd_link_out) + link.node_zd_link_in_next = (amc_vis::FLink*)-1; // (amc_vis.FNode.zd_link_in) not-in-list + link.node_zd_link_in_prev = NULL; // (amc_vis.FNode.zd_link_in) +} + +// --- amc_vis.FLink..Uninit +void amc_vis::FLink_Uninit(amc_vis::FLink& link) { + amc_vis::FLink &row = link; (void)row; + ind_link_Remove(row); // remove link from index ind_link + c_linklist_Remove(row); // remove link from index c_linklist + bh_link_Remove(row); // remove link from index bh_link + amc_vis::FNode* p_p_node1 = row.p_node1; + if (p_p_node1) { + zd_link_out_Remove(*p_p_node1, row);// remove link from index zd_link_out + } + amc_vis::FNode* p_p_node2 = row.p_node2; + if (p_p_node2) { + zd_link_in_Remove(*p_p_node2, row);// remove link from index zd_link_in + } +} + +// --- amc_vis.FLink..Print +// print string representation of ROW to string STR +// cfmt:amc_vis.FLink.String printfmt:Tuple +void amc_vis::FLink_Print(amc_vis::FLink& row, algo::cstring& str) { + algo::tempstr temp; + str << "amc_vis.FLink"; + + algo::cstring_Print(row.link, temp); + PrintAttrSpaceReset(str,"link", temp); + + algo::cstring_Print(row.label1, temp); + PrintAttrSpaceReset(str,"label1", temp); + + algo::cstring_Print(row.label2, temp); + PrintAttrSpaceReset(str,"label2", temp); + + amc_vis::Linkkey_Print(row.linkkey, temp); + PrintAttrSpaceReset(str,"linkkey", temp); + + i32_Print(row.outrow, temp); + PrintAttrSpaceReset(str,"outrow", temp); + + bool_Print(row.upptr, temp); + PrintAttrSpaceReset(str,"upptr", temp); + + bool_Print(row.c_linklist_in_ary, temp); + PrintAttrSpaceReset(str,"c_linklist_in_ary", temp); +} + +// --- amc_vis.FLinkdep..Uninit +void amc_vis::FLinkdep_Uninit(amc_vis::FLinkdep& linkdep) { + amc_vis::FLinkdep &row = linkdep; (void)row; + amc_vis::FLink* p_p_link_from = row.p_link_from; + if (p_p_link_from) { + zd_linkdep_out_Remove(*p_p_link_from, row);// remove linkdep from index zd_linkdep_out + } + amc_vis::FLink* p_p_link_to = row.p_link_to; + if (p_p_link_to) { + zd_linkdep_in_Remove(*p_p_link_to, row);// remove linkdep from index zd_linkdep_in + } +} + +// --- amc_vis.FLinkdep..Print +// print string representation of ROW to string STR +// cfmt:amc_vis.FLinkdep.String printfmt:Tuple +void amc_vis::FLinkdep_Print(amc_vis::FLinkdep& row, algo::cstring& str) { + algo::tempstr temp; + str << "amc_vis.FLinkdep"; + + i32_Print(row.row, temp); + PrintAttrSpaceReset(str,"row", temp); + + i32_Print(row.rowid, temp); + PrintAttrSpaceReset(str,"rowid", temp); + + bool_Print(row.up, temp); + PrintAttrSpaceReset(str,"up", temp); + + bool_Print(row.inst, temp); + PrintAttrSpaceReset(str,"inst", temp); +} + // --- amc_vis.Nodekey..Print // print string representation of ROW to string STR // cfmt:amc_vis.Nodekey.String printfmt:Sep @@ -3116,19 +3397,17 @@ void amc_vis::Nodekey_Print(amc_vis::Nodekey row, algo::cstring& str) { u32_Print(row.n_ct_in, str); str << '.'; i32_Print(row.idx, str); - str << '.'; - i32_Print(row.prev_xpos, str); } // --- amc_vis.FNode.zd_nodedep_out.Insert // Insert row into linked list. If row is already in linked list, do nothing. void amc_vis::zd_nodedep_out_Insert(amc_vis::FNode& node, amc_vis::FNodedep& row) { - if (!zd_nodedep_out_InLlistQ(row)) { + if (!node_zd_nodedep_out_InLlistQ(row)) { amc_vis::FNodedep* old_tail = node.zd_nodedep_out_tail; - row.zd_nodedep_out_next = NULL; - row.zd_nodedep_out_prev = old_tail; + row.node_zd_nodedep_out_next = NULL; + row.node_zd_nodedep_out_prev = old_tail; node.zd_nodedep_out_tail = &row; - amc_vis::FNodedep **new_row_a = &old_tail->zd_nodedep_out_next; + amc_vis::FNodedep **new_row_a = &old_tail->node_zd_nodedep_out_next; amc_vis::FNodedep **new_row_b = &node.zd_nodedep_out_head; amc_vis::FNodedep **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -3138,22 +3417,22 @@ void amc_vis::zd_nodedep_out_Insert(amc_vis::FNode& node, amc_vis::FNodedep& row // --- amc_vis.FNode.zd_nodedep_out.Remove // Remove element from index. If element is not in index, do nothing. void amc_vis::zd_nodedep_out_Remove(amc_vis::FNode& node, amc_vis::FNodedep& row) { - if (zd_nodedep_out_InLlistQ(row)) { + if (node_zd_nodedep_out_InLlistQ(row)) { amc_vis::FNodedep* old_head = node.zd_nodedep_out_head; (void)old_head; // in case it's not used - amc_vis::FNodedep* prev = row.zd_nodedep_out_prev; - amc_vis::FNodedep* next = row.zd_nodedep_out_next; + amc_vis::FNodedep* prev = row.node_zd_nodedep_out_prev; + amc_vis::FNodedep* next = row.node_zd_nodedep_out_next; // if element is first, adjust list head; otherwise, adjust previous element's next - amc_vis::FNodedep **new_next_a = &prev->zd_nodedep_out_next; + amc_vis::FNodedep **new_next_a = &prev->node_zd_nodedep_out_next; amc_vis::FNodedep **new_next_b = &node.zd_nodedep_out_head; amc_vis::FNodedep **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - amc_vis::FNodedep **new_prev_a = &next->zd_nodedep_out_prev; + amc_vis::FNodedep **new_prev_a = &next->node_zd_nodedep_out_prev; amc_vis::FNodedep **new_prev_b = &node.zd_nodedep_out_tail; amc_vis::FNodedep **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; - row.zd_nodedep_out_next=(amc_vis::FNodedep*)-1; // not-in-list + row.node_zd_nodedep_out_next=(amc_vis::FNodedep*)-1; // not-in-list } } @@ -3164,9 +3443,9 @@ void amc_vis::zd_nodedep_out_RemoveAll(amc_vis::FNode& node) { node.zd_nodedep_out_head = NULL; node.zd_nodedep_out_tail = NULL; while (row) { - amc_vis::FNodedep* row_next = row->zd_nodedep_out_next; - row->zd_nodedep_out_next = (amc_vis::FNodedep*)-1; - row->zd_nodedep_out_prev = NULL; + amc_vis::FNodedep* row_next = row->node_zd_nodedep_out_next; + row->node_zd_nodedep_out_next = (amc_vis::FNodedep*)-1; + row->node_zd_nodedep_out_prev = NULL; row = row_next; } } @@ -3177,13 +3456,13 @@ amc_vis::FNodedep* amc_vis::zd_nodedep_out_RemoveFirst(amc_vis::FNode& node) { amc_vis::FNodedep *row = NULL; row = node.zd_nodedep_out_head; if (row) { - amc_vis::FNodedep *next = row->zd_nodedep_out_next; + amc_vis::FNodedep *next = row->node_zd_nodedep_out_next; node.zd_nodedep_out_head = next; - amc_vis::FNodedep **new_end_a = &next->zd_nodedep_out_prev; + amc_vis::FNodedep **new_end_a = &next->node_zd_nodedep_out_prev; amc_vis::FNodedep **new_end_b = &node.zd_nodedep_out_tail; amc_vis::FNodedep **new_end = next ? new_end_a : new_end_b; *new_end = NULL; - row->zd_nodedep_out_next = (amc_vis::FNodedep*)-1; // mark as not-in-list + row->node_zd_nodedep_out_next = (amc_vis::FNodedep*)-1; // mark as not-in-list } return row; } @@ -3191,12 +3470,12 @@ amc_vis::FNodedep* amc_vis::zd_nodedep_out_RemoveFirst(amc_vis::FNode& node) { // --- amc_vis.FNode.zd_nodedep_in.Insert // Insert row into linked list. If row is already in linked list, do nothing. void amc_vis::zd_nodedep_in_Insert(amc_vis::FNode& node, amc_vis::FNodedep& row) { - if (!zd_nodedep_in_InLlistQ(row)) { + if (!node_zd_nodedep_in_InLlistQ(row)) { amc_vis::FNodedep* old_tail = node.zd_nodedep_in_tail; - row.zd_nodedep_in_next = NULL; - row.zd_nodedep_in_prev = old_tail; + row.node_zd_nodedep_in_next = NULL; + row.node_zd_nodedep_in_prev = old_tail; node.zd_nodedep_in_tail = &row; - amc_vis::FNodedep **new_row_a = &old_tail->zd_nodedep_in_next; + amc_vis::FNodedep **new_row_a = &old_tail->node_zd_nodedep_in_next; amc_vis::FNodedep **new_row_b = &node.zd_nodedep_in_head; amc_vis::FNodedep **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -3207,23 +3486,23 @@ void amc_vis::zd_nodedep_in_Insert(amc_vis::FNode& node, amc_vis::FNodedep& row) // --- amc_vis.FNode.zd_nodedep_in.Remove // Remove element from index. If element is not in index, do nothing. void amc_vis::zd_nodedep_in_Remove(amc_vis::FNode& node, amc_vis::FNodedep& row) { - if (zd_nodedep_in_InLlistQ(row)) { + if (node_zd_nodedep_in_InLlistQ(row)) { amc_vis::FNodedep* old_head = node.zd_nodedep_in_head; (void)old_head; // in case it's not used - amc_vis::FNodedep* prev = row.zd_nodedep_in_prev; - amc_vis::FNodedep* next = row.zd_nodedep_in_next; + amc_vis::FNodedep* prev = row.node_zd_nodedep_in_prev; + amc_vis::FNodedep* next = row.node_zd_nodedep_in_next; // if element is first, adjust list head; otherwise, adjust previous element's next - amc_vis::FNodedep **new_next_a = &prev->zd_nodedep_in_next; + amc_vis::FNodedep **new_next_a = &prev->node_zd_nodedep_in_next; amc_vis::FNodedep **new_next_b = &node.zd_nodedep_in_head; amc_vis::FNodedep **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - amc_vis::FNodedep **new_prev_a = &next->zd_nodedep_in_prev; + amc_vis::FNodedep **new_prev_a = &next->node_zd_nodedep_in_prev; amc_vis::FNodedep **new_prev_b = &node.zd_nodedep_in_tail; amc_vis::FNodedep **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; node.zd_nodedep_in_n--; - row.zd_nodedep_in_next=(amc_vis::FNodedep*)-1; // not-in-list + row.node_zd_nodedep_in_next=(amc_vis::FNodedep*)-1; // not-in-list } } @@ -3235,9 +3514,9 @@ void amc_vis::zd_nodedep_in_RemoveAll(amc_vis::FNode& node) { node.zd_nodedep_in_tail = NULL; node.zd_nodedep_in_n = 0; while (row) { - amc_vis::FNodedep* row_next = row->zd_nodedep_in_next; - row->zd_nodedep_in_next = (amc_vis::FNodedep*)-1; - row->zd_nodedep_in_prev = NULL; + amc_vis::FNodedep* row_next = row->node_zd_nodedep_in_next; + row->node_zd_nodedep_in_next = (amc_vis::FNodedep*)-1; + row->node_zd_nodedep_in_prev = NULL; row = row_next; } } @@ -3248,29 +3527,29 @@ amc_vis::FNodedep* amc_vis::zd_nodedep_in_RemoveFirst(amc_vis::FNode& node) { amc_vis::FNodedep *row = NULL; row = node.zd_nodedep_in_head; if (row) { - amc_vis::FNodedep *next = row->zd_nodedep_in_next; + amc_vis::FNodedep *next = row->node_zd_nodedep_in_next; node.zd_nodedep_in_head = next; - amc_vis::FNodedep **new_end_a = &next->zd_nodedep_in_prev; + amc_vis::FNodedep **new_end_a = &next->node_zd_nodedep_in_prev; amc_vis::FNodedep **new_end_b = &node.zd_nodedep_in_tail; amc_vis::FNodedep **new_end = next ? new_end_a : new_end_b; *new_end = NULL; node.zd_nodedep_in_n--; - row->zd_nodedep_in_next = (amc_vis::FNodedep*)-1; // mark as not-in-list + row->node_zd_nodedep_in_next = (amc_vis::FNodedep*)-1; // mark as not-in-list } return row; } // --- amc_vis.FNode.zd_link_out.Insert // Insert row into linked list. If row is already in linked list, do nothing. -void amc_vis::zd_link_out_Insert(amc_vis::FNode& node, amc_vis::Link& row) { - if (!zd_link_out_InLlistQ(row)) { - amc_vis::Link* old_tail = node.zd_link_out_tail; - row.zd_link_out_next = NULL; - row.zd_link_out_prev = old_tail; +void amc_vis::zd_link_out_Insert(amc_vis::FNode& node, amc_vis::FLink& row) { + if (!node_zd_link_out_InLlistQ(row)) { + amc_vis::FLink* old_tail = node.zd_link_out_tail; + row.node_zd_link_out_next = NULL; + row.node_zd_link_out_prev = old_tail; node.zd_link_out_tail = &row; - amc_vis::Link **new_row_a = &old_tail->zd_link_out_next; - amc_vis::Link **new_row_b = &node.zd_link_out_head; - amc_vis::Link **new_row = old_tail ? new_row_a : new_row_b; + amc_vis::FLink **new_row_a = &old_tail->node_zd_link_out_next; + amc_vis::FLink **new_row_b = &node.zd_link_out_head; + amc_vis::FLink **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; node.zd_link_out_n++; } @@ -3278,71 +3557,71 @@ void amc_vis::zd_link_out_Insert(amc_vis::FNode& node, amc_vis::Link& row) { // --- amc_vis.FNode.zd_link_out.Remove // Remove element from index. If element is not in index, do nothing. -void amc_vis::zd_link_out_Remove(amc_vis::FNode& node, amc_vis::Link& row) { - if (zd_link_out_InLlistQ(row)) { - amc_vis::Link* old_head = node.zd_link_out_head; +void amc_vis::zd_link_out_Remove(amc_vis::FNode& node, amc_vis::FLink& row) { + if (node_zd_link_out_InLlistQ(row)) { + amc_vis::FLink* old_head = node.zd_link_out_head; (void)old_head; // in case it's not used - amc_vis::Link* prev = row.zd_link_out_prev; - amc_vis::Link* next = row.zd_link_out_next; + amc_vis::FLink* prev = row.node_zd_link_out_prev; + amc_vis::FLink* next = row.node_zd_link_out_next; // if element is first, adjust list head; otherwise, adjust previous element's next - amc_vis::Link **new_next_a = &prev->zd_link_out_next; - amc_vis::Link **new_next_b = &node.zd_link_out_head; - amc_vis::Link **new_next = prev ? new_next_a : new_next_b; + amc_vis::FLink **new_next_a = &prev->node_zd_link_out_next; + amc_vis::FLink **new_next_b = &node.zd_link_out_head; + amc_vis::FLink **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - amc_vis::Link **new_prev_a = &next->zd_link_out_prev; - amc_vis::Link **new_prev_b = &node.zd_link_out_tail; - amc_vis::Link **new_prev = next ? new_prev_a : new_prev_b; + amc_vis::FLink **new_prev_a = &next->node_zd_link_out_prev; + amc_vis::FLink **new_prev_b = &node.zd_link_out_tail; + amc_vis::FLink **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; node.zd_link_out_n--; - row.zd_link_out_next=(amc_vis::Link*)-1; // not-in-list + row.node_zd_link_out_next=(amc_vis::FLink*)-1; // not-in-list } } // --- amc_vis.FNode.zd_link_out.RemoveAll // Empty the index. (The rows are not deleted) void amc_vis::zd_link_out_RemoveAll(amc_vis::FNode& node) { - amc_vis::Link* row = node.zd_link_out_head; + amc_vis::FLink* row = node.zd_link_out_head; node.zd_link_out_head = NULL; node.zd_link_out_tail = NULL; node.zd_link_out_n = 0; while (row) { - amc_vis::Link* row_next = row->zd_link_out_next; - row->zd_link_out_next = (amc_vis::Link*)-1; - row->zd_link_out_prev = NULL; + amc_vis::FLink* row_next = row->node_zd_link_out_next; + row->node_zd_link_out_next = (amc_vis::FLink*)-1; + row->node_zd_link_out_prev = NULL; row = row_next; } } // --- amc_vis.FNode.zd_link_out.RemoveFirst // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -amc_vis::Link* amc_vis::zd_link_out_RemoveFirst(amc_vis::FNode& node) { - amc_vis::Link *row = NULL; +amc_vis::FLink* amc_vis::zd_link_out_RemoveFirst(amc_vis::FNode& node) { + amc_vis::FLink *row = NULL; row = node.zd_link_out_head; if (row) { - amc_vis::Link *next = row->zd_link_out_next; + amc_vis::FLink *next = row->node_zd_link_out_next; node.zd_link_out_head = next; - amc_vis::Link **new_end_a = &next->zd_link_out_prev; - amc_vis::Link **new_end_b = &node.zd_link_out_tail; - amc_vis::Link **new_end = next ? new_end_a : new_end_b; + amc_vis::FLink **new_end_a = &next->node_zd_link_out_prev; + amc_vis::FLink **new_end_b = &node.zd_link_out_tail; + amc_vis::FLink **new_end = next ? new_end_a : new_end_b; *new_end = NULL; node.zd_link_out_n--; - row->zd_link_out_next = (amc_vis::Link*)-1; // mark as not-in-list + row->node_zd_link_out_next = (amc_vis::FLink*)-1; // mark as not-in-list } return row; } // --- amc_vis.FNode.zd_link_in.Insert // Insert row into linked list. If row is already in linked list, do nothing. -void amc_vis::zd_link_in_Insert(amc_vis::FNode& node, amc_vis::Link& row) { - if (!zd_link_in_InLlistQ(row)) { - amc_vis::Link* old_tail = node.zd_link_in_tail; - row.zd_link_in_next = NULL; - row.zd_link_in_prev = old_tail; +void amc_vis::zd_link_in_Insert(amc_vis::FNode& node, amc_vis::FLink& row) { + if (!node_zd_link_in_InLlistQ(row)) { + amc_vis::FLink* old_tail = node.zd_link_in_tail; + row.node_zd_link_in_next = NULL; + row.node_zd_link_in_prev = old_tail; node.zd_link_in_tail = &row; - amc_vis::Link **new_row_a = &old_tail->zd_link_in_next; - amc_vis::Link **new_row_b = &node.zd_link_in_head; - amc_vis::Link **new_row = old_tail ? new_row_a : new_row_b; + amc_vis::FLink **new_row_a = &old_tail->node_zd_link_in_next; + amc_vis::FLink **new_row_b = &node.zd_link_in_head; + amc_vis::FLink **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; node.zd_link_in_n++; } @@ -3350,56 +3629,56 @@ void amc_vis::zd_link_in_Insert(amc_vis::FNode& node, amc_vis::Link& row) { // --- amc_vis.FNode.zd_link_in.Remove // Remove element from index. If element is not in index, do nothing. -void amc_vis::zd_link_in_Remove(amc_vis::FNode& node, amc_vis::Link& row) { - if (zd_link_in_InLlistQ(row)) { - amc_vis::Link* old_head = node.zd_link_in_head; +void amc_vis::zd_link_in_Remove(amc_vis::FNode& node, amc_vis::FLink& row) { + if (node_zd_link_in_InLlistQ(row)) { + amc_vis::FLink* old_head = node.zd_link_in_head; (void)old_head; // in case it's not used - amc_vis::Link* prev = row.zd_link_in_prev; - amc_vis::Link* next = row.zd_link_in_next; + amc_vis::FLink* prev = row.node_zd_link_in_prev; + amc_vis::FLink* next = row.node_zd_link_in_next; // if element is first, adjust list head; otherwise, adjust previous element's next - amc_vis::Link **new_next_a = &prev->zd_link_in_next; - amc_vis::Link **new_next_b = &node.zd_link_in_head; - amc_vis::Link **new_next = prev ? new_next_a : new_next_b; + amc_vis::FLink **new_next_a = &prev->node_zd_link_in_next; + amc_vis::FLink **new_next_b = &node.zd_link_in_head; + amc_vis::FLink **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - amc_vis::Link **new_prev_a = &next->zd_link_in_prev; - amc_vis::Link **new_prev_b = &node.zd_link_in_tail; - amc_vis::Link **new_prev = next ? new_prev_a : new_prev_b; + amc_vis::FLink **new_prev_a = &next->node_zd_link_in_prev; + amc_vis::FLink **new_prev_b = &node.zd_link_in_tail; + amc_vis::FLink **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; node.zd_link_in_n--; - row.zd_link_in_next=(amc_vis::Link*)-1; // not-in-list + row.node_zd_link_in_next=(amc_vis::FLink*)-1; // not-in-list } } // --- amc_vis.FNode.zd_link_in.RemoveAll // Empty the index. (The rows are not deleted) void amc_vis::zd_link_in_RemoveAll(amc_vis::FNode& node) { - amc_vis::Link* row = node.zd_link_in_head; + amc_vis::FLink* row = node.zd_link_in_head; node.zd_link_in_head = NULL; node.zd_link_in_tail = NULL; node.zd_link_in_n = 0; while (row) { - amc_vis::Link* row_next = row->zd_link_in_next; - row->zd_link_in_next = (amc_vis::Link*)-1; - row->zd_link_in_prev = NULL; + amc_vis::FLink* row_next = row->node_zd_link_in_next; + row->node_zd_link_in_next = (amc_vis::FLink*)-1; + row->node_zd_link_in_prev = NULL; row = row_next; } } // --- amc_vis.FNode.zd_link_in.RemoveFirst // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -amc_vis::Link* amc_vis::zd_link_in_RemoveFirst(amc_vis::FNode& node) { - amc_vis::Link *row = NULL; +amc_vis::FLink* amc_vis::zd_link_in_RemoveFirst(amc_vis::FNode& node) { + amc_vis::FLink *row = NULL; row = node.zd_link_in_head; if (row) { - amc_vis::Link *next = row->zd_link_in_next; + amc_vis::FLink *next = row->node_zd_link_in_next; node.zd_link_in_head = next; - amc_vis::Link **new_end_a = &next->zd_link_in_prev; - amc_vis::Link **new_end_b = &node.zd_link_in_tail; - amc_vis::Link **new_end = next ? new_end_a : new_end_b; + amc_vis::FLink **new_end_a = &next->node_zd_link_in_prev; + amc_vis::FLink **new_end_b = &node.zd_link_in_tail; + amc_vis::FLink **new_end = next ? new_end_a : new_end_b; *new_end = NULL; node.zd_link_in_n--; - row->zd_link_in_next = (amc_vis::Link*)-1; // mark as not-in-list + row->node_zd_link_in_next = (amc_vis::FLink*)-1; // mark as not-in-list } return row; } @@ -3407,7 +3686,7 @@ amc_vis::Link* amc_vis::zd_link_in_RemoveFirst(amc_vis::FNode& node) { // --- amc_vis.FNode..Init // Set all fields to initial values. void amc_vis::FNode_Init(amc_vis::FNode& node) { - node.xpos = i32(1); + node.xpos = i32(0); node.c_bottom = NULL; node.c_top = NULL; node.p_ctype = NULL; @@ -3424,6 +3703,7 @@ void amc_vis::FNode_Init(amc_vis::FNode& node) { node.zd_link_in_n = 0; // (amc_vis.FNode.zd_link_in) node.zd_link_in_tail = NULL; // (amc_vis.FNode.zd_link_in) node.ind_node_next = (amc_vis::FNode*)-1; // (amc_vis.FDb.ind_node) not-in-hash + node.ind_node_hashval = 0; // stored hash value node.bh_node_idx = -1; // (amc_vis.FDb.bh_node) not-in-heap } @@ -3447,65 +3727,295 @@ void amc_vis::FNodedep_Uninit(amc_vis::FNodedep& nodedep) { } } -// --- amc_vis.FReftype.msghdr.CopyOut -// Copy fields out of row -void amc_vis::reftype_CopyOut(amc_vis::FReftype &row, dmmeta::Reftype &out) { - out.reftype = row.reftype; - out.isval = row.isval; - out.cascins = row.cascins; - out.usebasepool = row.usebasepool; - out.cancopy = row.cancopy; - out.isxref = row.isxref; - out.del = row.del; - out.up = row.up; - out.isnew = row.isnew; - out.hasalloc = row.hasalloc; - out.inst = row.inst; - out.varlen = row.varlen; +// --- amc_vis.FOutrow.text.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr amc_vis::text_Addary(amc_vis::FOutrow& outrow, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= outrow.text_elems && rhs.elems < outrow.text_elems + outrow.text_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("amc_vis.tary_alias field:amc_vis.FOutrow.text comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + text_Reserve(outrow, nnew); // reserve space + int at = outrow.text_n; + memcpy(outrow.text_elems + at, rhs.elems, nnew * sizeof(u16)); + outrow.text_n += nnew; + return algo::aryptr(outrow.text_elems + at, nnew); } -// --- amc_vis.FReftype.msghdr.CopyIn -// Copy fields in to row -void amc_vis::reftype_CopyIn(amc_vis::FReftype &row, dmmeta::Reftype &in) { - row.reftype = in.reftype; - row.isval = in.isval; - row.cascins = in.cascins; - row.usebasepool = in.usebasepool; - row.cancopy = in.cancopy; - row.isxref = in.isxref; - row.del = in.del; - row.up = in.up; - row.isnew = in.isnew; - row.hasalloc = in.hasalloc; - row.inst = in.inst; - row.varlen = in.varlen; +// --- amc_vis.FOutrow.text.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +u16& amc_vis::text_Alloc(amc_vis::FOutrow& outrow) { + text_Reserve(outrow, 1); + int n = outrow.text_n; + int at = n; + u16 *elems = outrow.text_elems; + new (elems + at) u16(0); // construct new element, default initializer + outrow.text_n = n+1; + return elems[at]; } -// --- amc_vis.FReftype..Init -// Set all fields to initial values. -void amc_vis::FReftype_Init(amc_vis::FReftype& reftype) { - reftype.reftype = algo::strptr("Val"); - reftype.isval = bool(false); - reftype.cascins = bool(false); - reftype.usebasepool = bool(false); - reftype.cancopy = bool(false); - reftype.isxref = bool(false); - reftype.del = bool(false); - reftype.up = bool(false); - reftype.isnew = bool(false); - reftype.hasalloc = bool(false); - reftype.inst = bool(false); - reftype.varlen = bool(false); - reftype.ind_reftype_next = (amc_vis::FReftype*)-1; // (amc_vis.FDb.ind_reftype) not-in-hash +// --- amc_vis.FOutrow.text.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +u16& amc_vis::text_AllocAt(amc_vis::FOutrow& outrow, int at) { + text_Reserve(outrow, 1); + int n = outrow.text_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("amc_vis.bad_alloc_at field:amc_vis.FOutrow.text comment:'index out of range'"); + } + u16 *elems = outrow.text_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(u16)); + new (elems + at) u16(0); // construct element, default initializer + outrow.text_n = n+1; + return elems[at]; } -// --- amc_vis.FReftype..Uninit -void amc_vis::FReftype_Uninit(amc_vis::FReftype& reftype) { - amc_vis::FReftype &row = reftype; (void)row; - ind_reftype_Remove(row); // remove reftype from index ind_reftype +// --- amc_vis.FOutrow.text.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr amc_vis::text_AllocN(amc_vis::FOutrow& outrow, int n_elems) { + text_Reserve(outrow, n_elems); + int old_n = outrow.text_n; + int new_n = old_n + n_elems; + u16 *elems = outrow.text_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) u16(0); // construct new element, default initialize + } + outrow.text_n = new_n; + return algo::aryptr(elems + old_n, n_elems); } -// --- amc_vis.FieldId.value.ToCstr +// --- amc_vis.FOutrow.text.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr amc_vis::text_AllocNAt(amc_vis::FOutrow& outrow, int n_elems, int at) { + text_Reserve(outrow, n_elems); + int n = outrow.text_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("amc_vis.bad_alloc_n_at field:amc_vis.FOutrow.text comment:'index out of range'"); + } + u16 *elems = outrow.text_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u16)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) u16(0); // construct new element, default initialize + } + outrow.text_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- amc_vis.FOutrow.text.Remove +// Remove item by index. If index outside of range, do nothing. +void amc_vis::text_Remove(amc_vis::FOutrow& outrow, u32 i) { + u32 lim = outrow.text_n; + u16 *elems = outrow.text_elems; + if (i < lim) { + memmove(elems + i, elems + (i + 1), sizeof(u16) * (lim - (i + 1))); + outrow.text_n = lim - 1; + } +} + +// --- amc_vis.FOutrow.text.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void amc_vis::text_RemoveLast(amc_vis::FOutrow& outrow) { + u64 n = outrow.text_n; + if (n > 0) { + n -= 1; + outrow.text_n = n; + } +} + +// --- amc_vis.FOutrow.text.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void amc_vis::text_AbsReserve(amc_vis::FOutrow& outrow, int n) { + u32 old_max = outrow.text_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(outrow.text_elems, old_max * sizeof(u16), new_max * sizeof(u16)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("amc_vis.tary_nomem field:amc_vis.FOutrow.text comment:'out of memory'"); + } + outrow.text_elems = (u16*)new_mem; + outrow.text_max = new_max; + } +} + +// --- amc_vis.FOutrow.text.Setary +// Copy contents of RHS to PARENT. +void amc_vis::text_Setary(amc_vis::FOutrow& outrow, amc_vis::FOutrow &rhs) { + text_RemoveAll(outrow); + int nnew = rhs.text_n; + text_Reserve(outrow, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (outrow.text_elems + i) u16(text_qFind(rhs, i)); + outrow.text_n = i + 1; + } +} + +// --- amc_vis.FOutrow.text.Setary2 +// Copy specified array into text, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void amc_vis::text_Setary(amc_vis::FOutrow& outrow, const algo::aryptr &rhs) { + text_RemoveAll(outrow); + text_Addary(outrow, rhs); +} + +// --- amc_vis.FOutrow.text.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr amc_vis::text_AllocNVal(amc_vis::FOutrow& outrow, int n_elems, const u16& val) { + text_Reserve(outrow, n_elems); + int old_n = outrow.text_n; + int new_n = old_n + n_elems; + u16 *elems = outrow.text_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) u16(val); + } + outrow.text_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- amc_vis.FOutrow.text.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool amc_vis::text_ReadStrptrMaybe(amc_vis::FOutrow& outrow, algo::strptr in_str) { + bool retval = true; + u16 &elem = text_Alloc(outrow); + retval = u16_ReadStrptrMaybe(elem, in_str); + if (!retval) { + text_RemoveLast(outrow); + } + return retval; +} + +// --- amc_vis.FOutrow.text.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void amc_vis::text_Insary(amc_vis::FOutrow& outrow, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= outrow.text_elems && rhs.elems < outrow.text_elems + outrow.text_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("amc_vis.tary_alias field:amc_vis.FOutrow.text comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(outrow.text_elems+1))) { + FatalErrorExit("amc_vis.bad_insary field:amc_vis.FOutrow.text comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = outrow.text_n - at; + text_Reserve(outrow, nnew); // reserve space + memmove(outrow.text_elems + at + nnew, outrow.text_elems + at, nmove * sizeof(u16)); + memcpy(outrow.text_elems + at, rhs.elems, nnew * sizeof(u16)); + outrow.text_n += nnew; +} + +// --- amc_vis.FOutrow..Uninit +void amc_vis::FOutrow_Uninit(amc_vis::FOutrow& outrow) { + amc_vis::FOutrow &row = outrow; (void)row; + + // amc_vis.FOutrow.text.Uninit (Tary) //Lower byte=text; Upper byte=color + // remove all elements from amc_vis.FOutrow.text + text_RemoveAll(outrow); + // free memory for Tary amc_vis.FOutrow.text + algo_lib::malloc_FreeMem(outrow.text_elems, sizeof(u16)*outrow.text_max); // (amc_vis.FOutrow.text) +} + +// --- amc_vis.FOutrow..Print +// print string representation of ROW to string STR +// cfmt:amc_vis.FOutrow.String printfmt:Tuple +void amc_vis::FOutrow_Print(amc_vis::FOutrow& row, algo::cstring& str) { + algo::tempstr temp; + str << "amc_vis.FOutrow"; + + i32_Print(row.rowid, temp); + PrintAttrSpaceReset(str,"rowid", temp); + + ind_beg(outrow_text_curs,text,row) { + u16_Print(text, temp); + tempstr name; + name << "text."; + name << ind_curs(text).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; +} + +// --- amc_vis.FOutrow..AssignOp +amc_vis::FOutrow& amc_vis::FOutrow::operator =(const amc_vis::FOutrow &rhs) { + rowid = rhs.rowid; + text_Setary(*this, text_Getary(const_cast(rhs))); + return *this; +} + +// --- amc_vis.FOutrow..CopyCtor + amc_vis::FOutrow::FOutrow(const amc_vis::FOutrow &rhs) + : rowid(rhs.rowid) + { + text_elems = 0; // (amc_vis.FOutrow.text) + text_n = 0; // (amc_vis.FOutrow.text) + text_max = 0; // (amc_vis.FOutrow.text) + text_Setary(*this, text_Getary(const_cast(rhs))); +} + +// --- amc_vis.FReftype.msghdr.CopyOut +// Copy fields out of row +void amc_vis::reftype_CopyOut(amc_vis::FReftype &row, dmmeta::Reftype &out) { + out.reftype = row.reftype; + out.isval = row.isval; + out.cascins = row.cascins; + out.usebasepool = row.usebasepool; + out.cancopy = row.cancopy; + out.isxref = row.isxref; + out.del = row.del; + out.up = row.up; + out.isnew = row.isnew; + out.hasalloc = row.hasalloc; + out.inst = row.inst; + out.varlen = row.varlen; +} + +// --- amc_vis.FReftype.msghdr.CopyIn +// Copy fields in to row +void amc_vis::reftype_CopyIn(amc_vis::FReftype &row, dmmeta::Reftype &in) { + row.reftype = in.reftype; + row.isval = in.isval; + row.cascins = in.cascins; + row.usebasepool = in.usebasepool; + row.cancopy = in.cancopy; + row.isxref = in.isxref; + row.del = in.del; + row.up = in.up; + row.isnew = in.isnew; + row.hasalloc = in.hasalloc; + row.inst = in.inst; + row.varlen = in.varlen; +} + +// --- amc_vis.FReftype..Init +// Set all fields to initial values. +void amc_vis::FReftype_Init(amc_vis::FReftype& reftype) { + reftype.reftype = algo::strptr("Val"); + reftype.isval = bool(false); + reftype.cascins = bool(false); + reftype.usebasepool = bool(false); + reftype.cancopy = bool(false); + reftype.isxref = bool(false); + reftype.del = bool(false); + reftype.up = bool(false); + reftype.isnew = bool(false); + reftype.hasalloc = bool(false); + reftype.inst = bool(false); + reftype.varlen = bool(false); + reftype.ind_reftype_next = (amc_vis::FReftype*)-1; // (amc_vis.FDb.ind_reftype) not-in-hash + reftype.ind_reftype_hashval = 0; // stored hash value +} + +// --- amc_vis.FReftype..Uninit +void amc_vis::FReftype_Uninit(amc_vis::FReftype& reftype) { + amc_vis::FReftype &row = reftype; (void)row; + ind_reftype_Remove(row); // remove reftype from index ind_reftype +} + +// --- amc_vis.FieldId.value.ToCstr // Convert numeric value of field to one of predefined string constants. // If string is found, return a static C string. Otherwise, return NULL. const char* amc_vis::value_ToCstr(const amc_vis::FieldId& parent) { @@ -3581,480 +4091,6 @@ void amc_vis::FieldId_Print(amc_vis::FieldId& row, algo::cstring& str) { amc_vis::value_Print(row, str); } -// --- amc_vis.Linkkey..Cmp -i32 amc_vis::Linkkey_Cmp(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) { - i32 retval = 0; - retval = u32_Cmp(lhs.n_link_in, rhs.n_link_in); - if (retval != 0) { - return retval; - } - retval = i32_Cmp(lhs.samecol, rhs.samecol); - if (retval != 0) { - return retval; - } - retval = i32_Cmp(lhs.colweight, rhs.colweight); - if (retval != 0) { - return retval; - } - retval = i32_Cmp(lhs.topbot, rhs.topbot); - return retval; -} - -// --- amc_vis.Linkkey..Eq -bool amc_vis::Linkkey_Eq(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) { - bool retval = true; - retval = u32_Eq(lhs.n_link_in, rhs.n_link_in); - if (!retval) { - return false; - } - retval = i32_Eq(lhs.samecol, rhs.samecol); - if (!retval) { - return false; - } - retval = i32_Eq(lhs.colweight, rhs.colweight); - if (!retval) { - return false; - } - retval = i32_Eq(lhs.topbot, rhs.topbot); - return retval; -} - -// --- amc_vis.Linkkey..Print -// print string representation of ROW to string STR -// cfmt:amc_vis.Linkkey.String printfmt:Tuple -void amc_vis::Linkkey_Print(amc_vis::Linkkey row, algo::cstring& str) { - algo::tempstr temp; - str << "amc_vis.Linkkey"; - - u32_Print(row.n_link_in, temp); - PrintAttrSpaceReset(str,"n_link_in", temp); - - i32_Print(row.samecol, temp); - PrintAttrSpaceReset(str,"samecol", temp); - - i32_Print(row.colweight, temp); - PrintAttrSpaceReset(str,"colweight", temp); - - i32_Print(row.topbot, temp); - PrintAttrSpaceReset(str,"topbot", temp); -} - -// --- amc_vis.Link.zd_linkdep_out.Insert -// Insert row into linked list. If row is already in linked list, do nothing. -void amc_vis::zd_linkdep_out_Insert(amc_vis::Link& link, amc_vis::Linkdep& row) { - if (!zd_linkdep_out_InLlistQ(row)) { - amc_vis::Linkdep* old_tail = link.zd_linkdep_out_tail; - row.zd_linkdep_out_next = NULL; - row.zd_linkdep_out_prev = old_tail; - link.zd_linkdep_out_tail = &row; - amc_vis::Linkdep **new_row_a = &old_tail->zd_linkdep_out_next; - amc_vis::Linkdep **new_row_b = &link.zd_linkdep_out_head; - amc_vis::Linkdep **new_row = old_tail ? new_row_a : new_row_b; - *new_row = &row; - } -} - -// --- amc_vis.Link.zd_linkdep_out.Remove -// Remove element from index. If element is not in index, do nothing. -void amc_vis::zd_linkdep_out_Remove(amc_vis::Link& link, amc_vis::Linkdep& row) { - if (zd_linkdep_out_InLlistQ(row)) { - amc_vis::Linkdep* old_head = link.zd_linkdep_out_head; - (void)old_head; // in case it's not used - amc_vis::Linkdep* prev = row.zd_linkdep_out_prev; - amc_vis::Linkdep* next = row.zd_linkdep_out_next; - // if element is first, adjust list head; otherwise, adjust previous element's next - amc_vis::Linkdep **new_next_a = &prev->zd_linkdep_out_next; - amc_vis::Linkdep **new_next_b = &link.zd_linkdep_out_head; - amc_vis::Linkdep **new_next = prev ? new_next_a : new_next_b; - *new_next = next; - // if element is last, adjust list tail; otherwise, adjust next element's prev - amc_vis::Linkdep **new_prev_a = &next->zd_linkdep_out_prev; - amc_vis::Linkdep **new_prev_b = &link.zd_linkdep_out_tail; - amc_vis::Linkdep **new_prev = next ? new_prev_a : new_prev_b; - *new_prev = prev; - row.zd_linkdep_out_next=(amc_vis::Linkdep*)-1; // not-in-list - } -} - -// --- amc_vis.Link.zd_linkdep_out.RemoveAll -// Empty the index. (The rows are not deleted) -void amc_vis::zd_linkdep_out_RemoveAll(amc_vis::Link& link) { - amc_vis::Linkdep* row = link.zd_linkdep_out_head; - link.zd_linkdep_out_head = NULL; - link.zd_linkdep_out_tail = NULL; - while (row) { - amc_vis::Linkdep* row_next = row->zd_linkdep_out_next; - row->zd_linkdep_out_next = (amc_vis::Linkdep*)-1; - row->zd_linkdep_out_prev = NULL; - row = row_next; - } -} - -// --- amc_vis.Link.zd_linkdep_out.RemoveFirst -// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -amc_vis::Linkdep* amc_vis::zd_linkdep_out_RemoveFirst(amc_vis::Link& link) { - amc_vis::Linkdep *row = NULL; - row = link.zd_linkdep_out_head; - if (row) { - amc_vis::Linkdep *next = row->zd_linkdep_out_next; - link.zd_linkdep_out_head = next; - amc_vis::Linkdep **new_end_a = &next->zd_linkdep_out_prev; - amc_vis::Linkdep **new_end_b = &link.zd_linkdep_out_tail; - amc_vis::Linkdep **new_end = next ? new_end_a : new_end_b; - *new_end = NULL; - row->zd_linkdep_out_next = (amc_vis::Linkdep*)-1; // mark as not-in-list - } - return row; -} - -// --- amc_vis.Link.zd_linkdep_in.Insert -// Insert row into linked list. If row is already in linked list, do nothing. -void amc_vis::zd_linkdep_in_Insert(amc_vis::Link& link, amc_vis::Linkdep& row) { - if (!zd_linkdep_in_InLlistQ(row)) { - amc_vis::Linkdep* old_tail = link.zd_linkdep_in_tail; - row.zd_linkdep_in_next = NULL; - row.zd_linkdep_in_prev = old_tail; - link.zd_linkdep_in_tail = &row; - amc_vis::Linkdep **new_row_a = &old_tail->zd_linkdep_in_next; - amc_vis::Linkdep **new_row_b = &link.zd_linkdep_in_head; - amc_vis::Linkdep **new_row = old_tail ? new_row_a : new_row_b; - *new_row = &row; - } -} - -// --- amc_vis.Link.zd_linkdep_in.Remove -// Remove element from index. If element is not in index, do nothing. -void amc_vis::zd_linkdep_in_Remove(amc_vis::Link& link, amc_vis::Linkdep& row) { - if (zd_linkdep_in_InLlistQ(row)) { - amc_vis::Linkdep* old_head = link.zd_linkdep_in_head; - (void)old_head; // in case it's not used - amc_vis::Linkdep* prev = row.zd_linkdep_in_prev; - amc_vis::Linkdep* next = row.zd_linkdep_in_next; - // if element is first, adjust list head; otherwise, adjust previous element's next - amc_vis::Linkdep **new_next_a = &prev->zd_linkdep_in_next; - amc_vis::Linkdep **new_next_b = &link.zd_linkdep_in_head; - amc_vis::Linkdep **new_next = prev ? new_next_a : new_next_b; - *new_next = next; - // if element is last, adjust list tail; otherwise, adjust next element's prev - amc_vis::Linkdep **new_prev_a = &next->zd_linkdep_in_prev; - amc_vis::Linkdep **new_prev_b = &link.zd_linkdep_in_tail; - amc_vis::Linkdep **new_prev = next ? new_prev_a : new_prev_b; - *new_prev = prev; - row.zd_linkdep_in_next=(amc_vis::Linkdep*)-1; // not-in-list - } -} - -// --- amc_vis.Link.zd_linkdep_in.RemoveAll -// Empty the index. (The rows are not deleted) -void amc_vis::zd_linkdep_in_RemoveAll(amc_vis::Link& link) { - amc_vis::Linkdep* row = link.zd_linkdep_in_head; - link.zd_linkdep_in_head = NULL; - link.zd_linkdep_in_tail = NULL; - while (row) { - amc_vis::Linkdep* row_next = row->zd_linkdep_in_next; - row->zd_linkdep_in_next = (amc_vis::Linkdep*)-1; - row->zd_linkdep_in_prev = NULL; - row = row_next; - } -} - -// --- amc_vis.Link.zd_linkdep_in.RemoveFirst -// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -amc_vis::Linkdep* amc_vis::zd_linkdep_in_RemoveFirst(amc_vis::Link& link) { - amc_vis::Linkdep *row = NULL; - row = link.zd_linkdep_in_head; - if (row) { - amc_vis::Linkdep *next = row->zd_linkdep_in_next; - link.zd_linkdep_in_head = next; - amc_vis::Linkdep **new_end_a = &next->zd_linkdep_in_prev; - amc_vis::Linkdep **new_end_b = &link.zd_linkdep_in_tail; - amc_vis::Linkdep **new_end = next ? new_end_a : new_end_b; - *new_end = NULL; - row->zd_linkdep_in_next = (amc_vis::Linkdep*)-1; // mark as not-in-list - } - return row; -} - -// --- amc_vis.Link..Init -// Set all fields to initial values. -void amc_vis::Link_Init(amc_vis::Link& link) { - link.outrow = i32(0); - link.p_node1 = NULL; - link.p_node2 = NULL; - link.upptr = bool(false); - link.zd_linkdep_out_head = NULL; // (amc_vis.Link.zd_linkdep_out) - link.zd_linkdep_out_tail = NULL; // (amc_vis.Link.zd_linkdep_out) - link.zd_linkdep_in_head = NULL; // (amc_vis.Link.zd_linkdep_in) - link.zd_linkdep_in_tail = NULL; // (amc_vis.Link.zd_linkdep_in) - link._db_c_linklist_in_ary = bool(false); - link.ind_link_next = (amc_vis::Link*)-1; // (amc_vis.FDb.ind_link) not-in-hash - link.bh_link_idx = -1; // (amc_vis.FDb.bh_link) not-in-heap - link.zd_link_out_next = (amc_vis::Link*)-1; // (amc_vis.FNode.zd_link_out) not-in-list - link.zd_link_out_prev = NULL; // (amc_vis.FNode.zd_link_out) - link.zd_link_in_next = (amc_vis::Link*)-1; // (amc_vis.FNode.zd_link_in) not-in-list - link.zd_link_in_prev = NULL; // (amc_vis.FNode.zd_link_in) -} - -// --- amc_vis.Link..Uninit -void amc_vis::Link_Uninit(amc_vis::Link& link) { - amc_vis::Link &row = link; (void)row; - ind_link_Remove(row); // remove link from index ind_link - c_linklist_Remove(row); // remove link from index c_linklist - bh_link_Remove(row); // remove link from index bh_link - amc_vis::FNode* p_p_node1 = row.p_node1; - if (p_p_node1) { - zd_link_out_Remove(*p_p_node1, row);// remove link from index zd_link_out - } - amc_vis::FNode* p_p_node2 = row.p_node2; - if (p_p_node2) { - zd_link_in_Remove(*p_p_node2, row);// remove link from index zd_link_in - } -} - -// --- amc_vis.Link..Print -// print string representation of ROW to string STR -// cfmt:amc_vis.Link.String printfmt:Tuple -void amc_vis::Link_Print(amc_vis::Link& row, algo::cstring& str) { - algo::tempstr temp; - str << "amc_vis.Link"; - - algo::Smallstr100_Print(row.link, temp); - PrintAttrSpaceReset(str,"link", temp); - - algo::Smallstr100_Print(row.label1, temp); - PrintAttrSpaceReset(str,"label1", temp); - - algo::Smallstr100_Print(row.label2, temp); - PrintAttrSpaceReset(str,"label2", temp); - - amc_vis::Linkkey_Print(row.linkkey, temp); - PrintAttrSpaceReset(str,"linkkey", temp); - - i32_Print(row.outrow, temp); - PrintAttrSpaceReset(str,"outrow", temp); - - bool_Print(row.upptr, temp); - PrintAttrSpaceReset(str,"upptr", temp); - - bool_Print(row._db_c_linklist_in_ary, temp); - PrintAttrSpaceReset(str,"_db_c_linklist_in_ary", temp); -} - -// --- amc_vis.Linkdep..Uninit -void amc_vis::Linkdep_Uninit(amc_vis::Linkdep& linkdep) { - amc_vis::Linkdep &row = linkdep; (void)row; - amc_vis::Link* p_p_link_from = row.p_link_from; - if (p_p_link_from) { - zd_linkdep_out_Remove(*p_p_link_from, row);// remove linkdep from index zd_linkdep_out - } - amc_vis::Link* p_p_link_to = row.p_link_to; - if (p_p_link_to) { - zd_linkdep_in_Remove(*p_p_link_to, row);// remove linkdep from index zd_linkdep_in - } -} - -// --- amc_vis.Linkdep..Print -// print string representation of ROW to string STR -// cfmt:amc_vis.Linkdep.String printfmt:Tuple -void amc_vis::Linkdep_Print(amc_vis::Linkdep& row, algo::cstring& str) { - algo::tempstr temp; - str << "amc_vis.Linkdep"; - - i32_Print(row.row, temp); - PrintAttrSpaceReset(str,"row", temp); - - i32_Print(row.rowid, temp); - PrintAttrSpaceReset(str,"rowid", temp); - - bool_Print(row.up, temp); - PrintAttrSpaceReset(str,"up", temp); - - bool_Print(row.inst, temp); - PrintAttrSpaceReset(str,"inst", temp); -} - -// --- amc_vis.Outrow.text.Addary -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -algo::aryptr amc_vis::text_Addary(amc_vis::Outrow& outrow, algo::aryptr rhs) { - bool overlaps = rhs.n_elems>0 && rhs.elems >= outrow.text_elems && rhs.elems < outrow.text_elems + outrow.text_max; - if (UNLIKELY(overlaps)) { - FatalErrorExit("amc_vis.tary_alias field:amc_vis.Outrow.text comment:'alias error: sub-array is being appended to the whole'"); - } - int nnew = rhs.n_elems; - text_Reserve(outrow, nnew); // reserve space - int at = outrow.text_n; - memcpy(outrow.text_elems + at, rhs.elems, nnew * sizeof(u8)); - outrow.text_n += nnew; - return algo::aryptr(outrow.text_elems + at, nnew); -} - -// --- amc_vis.Outrow.text.Alloc -// Reserve space. Insert element at the end -// The new element is initialized to a default value -u8& amc_vis::text_Alloc(amc_vis::Outrow& outrow) { - text_Reserve(outrow, 1); - int n = outrow.text_n; - int at = n; - u8 *elems = outrow.text_elems; - new (elems + at) u8(0); // construct new element, default initializer - outrow.text_n = n+1; - return elems[at]; -} - -// --- amc_vis.Outrow.text.AllocAt -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -u8& amc_vis::text_AllocAt(amc_vis::Outrow& outrow, int at) { - text_Reserve(outrow, 1); - int n = outrow.text_n; - if (UNLIKELY(u64(at) >= u64(n+1))) { - FatalErrorExit("amc_vis.bad_alloc_at field:amc_vis.Outrow.text comment:'index out of range'"); - } - u8 *elems = outrow.text_elems; - memmove(elems + at + 1, elems + at, (n - at) * sizeof(u8)); - new (elems + at) u8(0); // construct element, default initializer - outrow.text_n = n+1; - return elems[at]; -} - -// --- amc_vis.Outrow.text.AllocN -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr amc_vis::text_AllocN(amc_vis::Outrow& outrow, int n_elems) { - text_Reserve(outrow, n_elems); - int old_n = outrow.text_n; - int new_n = old_n + n_elems; - u8 *elems = outrow.text_elems; - memset(elems + old_n, 0, new_n - old_n); // initialize new space - outrow.text_n = new_n; - return algo::aryptr(elems + old_n, n_elems); -} - -// --- amc_vis.Outrow.text.Remove -// Remove item by index. If index outside of range, do nothing. -void amc_vis::text_Remove(amc_vis::Outrow& outrow, u32 i) { - u32 lim = outrow.text_n; - u8 *elems = outrow.text_elems; - if (i < lim) { - memmove(elems + i, elems + (i + 1), sizeof(u8) * (lim - (i + 1))); - outrow.text_n = lim - 1; - } -} - -// --- amc_vis.Outrow.text.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void amc_vis::text_RemoveLast(amc_vis::Outrow& outrow) { - u64 n = outrow.text_n; - if (n > 0) { - n -= 1; - outrow.text_n = n; - } -} - -// --- amc_vis.Outrow.text.AbsReserve -// Make sure N elements fit in array. Process dies if out of memory -void amc_vis::text_AbsReserve(amc_vis::Outrow& outrow, int n) { - u32 old_max = outrow.text_max; - if (n > i32(old_max)) { - u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); - void *new_mem = algo_lib::malloc_ReallocMem(outrow.text_elems, old_max * sizeof(u8), new_max * sizeof(u8)); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("amc_vis.tary_nomem field:amc_vis.Outrow.text comment:'out of memory'"); - } - outrow.text_elems = (u8*)new_mem; - outrow.text_max = new_max; - } -} - -// --- amc_vis.Outrow.text.Print -// Convert text to a string. -// Array is printed as a regular string. -void amc_vis::text_Print(amc_vis::Outrow& outrow, algo::cstring &rhs) { - rhs << algo::memptr_ToStrptr(text_Getary(outrow)); -} - -// --- amc_vis.Outrow.text.Setary -// Copy contents of RHS to PARENT. -void amc_vis::text_Setary(amc_vis::Outrow& outrow, amc_vis::Outrow &rhs) { - text_RemoveAll(outrow); - int nnew = rhs.text_n; - text_Reserve(outrow, nnew); // reserve space - memcpy(outrow.text_elems, rhs.text_elems, nnew * sizeof(u8)); - outrow.text_n = nnew; -} - -// --- amc_vis.Outrow.text.Setary2 -// Copy specified array into text, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -void amc_vis::text_Setary(amc_vis::Outrow& outrow, const algo::aryptr &rhs) { - text_RemoveAll(outrow); - text_Addary(outrow, rhs); -} - -// --- amc_vis.Outrow.text.AllocNVal -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr amc_vis::text_AllocNVal(amc_vis::Outrow& outrow, int n_elems, const u8& val) { - text_Reserve(outrow, n_elems); - int old_n = outrow.text_n; - int new_n = old_n + n_elems; - u8 *elems = outrow.text_elems; - memset(elems + old_n, val, new_n - old_n); // initialize new space - outrow.text_n = new_n; - return algo::aryptr(elems + old_n, n_elems); -} - -// --- amc_vis.Outrow.text.ReadStrptrMaybe -// The array is replaced with the input string. Function always succeeds. -bool amc_vis::text_ReadStrptrMaybe(amc_vis::Outrow& outrow, algo::strptr in_str) { - bool retval = true; - text_RemoveAll(outrow); - text_Addary(outrow,algo::strptr_ToMemptr(in_str)); - return retval; -} - -// --- amc_vis.Outrow..Uninit -void amc_vis::Outrow_Uninit(amc_vis::Outrow& outrow) { - amc_vis::Outrow &row = outrow; (void)row; - - // amc_vis.Outrow.text.Uninit (Tary) //text - // remove all elements from amc_vis.Outrow.text - text_RemoveAll(outrow); - // free memory for Tary amc_vis.Outrow.text - algo_lib::malloc_FreeMem(outrow.text_elems, sizeof(u8)*outrow.text_max); // (amc_vis.Outrow.text) -} - -// --- amc_vis.Outrow..Print -// print string representation of ROW to string STR -// cfmt:amc_vis.Outrow.String printfmt:Tuple -void amc_vis::Outrow_Print(amc_vis::Outrow& row, algo::cstring& str) { - algo::tempstr temp; - str << "amc_vis.Outrow"; - - i32_Print(row.rowid, temp); - PrintAttrSpaceReset(str,"rowid", temp); - - amc_vis::text_Print(row, temp); - PrintAttrSpaceReset(str,"text", temp); -} - -// --- amc_vis.Outrow..AssignOp -amc_vis::Outrow& amc_vis::Outrow::operator =(const amc_vis::Outrow &rhs) { - rowid = rhs.rowid; - text_Setary(*this, text_Getary(const_cast(rhs))); - return *this; -} - -// --- amc_vis.Outrow..CopyCtor - amc_vis::Outrow::Outrow(const amc_vis::Outrow &rhs) - : rowid(rhs.rowid) - { - text_elems = 0; // (amc_vis.Outrow.text) - text_n = 0; // (amc_vis.Outrow.text) - text_max = 0; // (amc_vis.Outrow.text) - text_Setary(*this, text_Getary(const_cast(rhs))); -} - // --- amc_vis.TableId.value.ToCstr // Convert numeric value of field to one of predefined string constants. // If string is found, return a static C string. Otherwise, return NULL. @@ -4185,11 +4221,13 @@ void amc_vis::StaticCheck() { // --- amc_vis...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); amc_vis::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock amc_vis::ReadArgv(); // dmmeta.main:amc_vis amc_vis::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -4202,6 +4240,7 @@ int main(int argc, char **argv) { try { amc_vis::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/amcdb_gen.cpp b/cpp/gen/amcdb_gen.cpp index 98dcdab5..d085d03c 100644 --- a/cpp/gen/amcdb_gen.cpp +++ b/cpp/gen/amcdb_gen.cpp @@ -108,25 +108,23 @@ bool amcdb::Bltin_ReadFieldMaybe(amcdb::Bltin& parent, algo::strptr field, algo: switch(field_id) { case amcdb_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case amcdb_FieldId_likeu64: { retval = bool_ReadStrptrMaybe(parent.likeu64, strval); - break; - } + } break; case amcdb_FieldId_bigendok: { retval = bool_ReadStrptrMaybe(parent.bigendok, strval); - break; - } + } break; case amcdb_FieldId_issigned: { retval = bool_ReadStrptrMaybe(parent.issigned, strval); - break; - } + } break; case amcdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -177,13 +175,14 @@ bool amcdb::Curstype_ReadFieldMaybe(amcdb::Curstype& parent, algo::strptr field, switch(field_id) { case amcdb_FieldId_curstype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.curstype, strval); - break; - } + } break; case amcdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -406,17 +405,17 @@ bool amcdb::Gen_ReadFieldMaybe(amcdb::Gen& parent, algo::strptr field, algo::str switch(field_id) { case amcdb_FieldId_gen: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gen, strval); - break; - } + } break; case amcdb_FieldId_perns: { retval = bool_ReadStrptrMaybe(parent.perns, strval); - break; - } + } break; case amcdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -461,13 +460,14 @@ bool amcdb::Regxtype_ReadFieldMaybe(amcdb::Regxtype& parent, algo::strptr field, switch(field_id) { case amcdb_FieldId_regxtype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.regxtype, strval); - break; - } + } break; case amcdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -509,13 +509,14 @@ bool amcdb::Tclass_ReadFieldMaybe(amcdb::Tclass& parent, algo::strptr field, alg switch(field_id) { case amcdb_FieldId_tclass: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.tclass, strval); - break; - } + } break; case amcdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -569,21 +570,20 @@ bool amcdb::Tcurs_ReadFieldMaybe(amcdb::Tcurs& parent, algo::strptr field, algo: switch(field_id) { case amcdb_FieldId_tfunc: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.tfunc, strval); - break; - } + } break; case amcdb_FieldId_dflt: { retval = bool_ReadStrptrMaybe(parent.dflt, strval); - break; - } + } break; case amcdb_FieldId_curstype: { retval = false; - break; - } + } break; case amcdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -657,49 +657,41 @@ bool amcdb::Tfunc_ReadFieldMaybe(amcdb::Tfunc& parent, algo::strptr field, algo: switch(field_id) { case amcdb_FieldId_tfunc: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.tfunc, strval); - break; - } + } break; case amcdb_FieldId_tclass: { retval = false; - break; - } + } break; case amcdb_FieldId_name: { retval = false; - break; - } + } break; case amcdb_FieldId_hasthrow: { retval = bool_ReadStrptrMaybe(parent.hasthrow, strval); - break; - } + } break; case amcdb_FieldId_leaf: { retval = bool_ReadStrptrMaybe(parent.leaf, strval); - break; - } + } break; case amcdb_FieldId_poolfunc: { retval = bool_ReadStrptrMaybe(parent.poolfunc, strval); - break; - } + } break; case amcdb_FieldId_inl: { retval = bool_ReadStrptrMaybe(parent.inl, strval); - break; - } + } break; case amcdb_FieldId_wur: { retval = bool_ReadStrptrMaybe(parent.wur, strval); - break; - } + } break; case amcdb_FieldId_pure: { retval = bool_ReadStrptrMaybe(parent.pure, strval); - break; - } + } break; case amcdb_FieldId_ismacro: { retval = bool_ReadStrptrMaybe(parent.ismacro, strval); - break; - } + } break; case amcdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); diff --git a/cpp/gen/ams_gen.cpp b/cpp/gen/ams_gen.cpp index c670cce4..26731fd2 100644 --- a/cpp/gen/ams_gen.cpp +++ b/cpp/gen/ams_gen.cpp @@ -31,58 +31,92 @@ #include "include/gen/ietf_gen.inl.h" #include "include/gen/fm_gen.h" #include "include/gen/fm_gen.inl.h" +#include "include/gen/ws_gen.h" +#include "include/gen/ws_gen.inl.h" //#pragma endinclude namespace ams { // gen:ns_print_proto - // func:ams.StreamFlags.write.ReadStrptrMaybe - inline static bool write_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) __attribute__((nothrow)); - // func:ams.StreamFlags.read.ReadStrptrMaybe - inline static bool read_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) __attribute__((nothrow)); - // func:ams.StreamFlags.nonblock.ReadStrptrMaybe - inline static bool nonblock_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) __attribute__((nothrow)); - // func:ams.StreamFlags.trace_read.ReadStrptrMaybe - inline static bool trace_read_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) __attribute__((nothrow)); - // func:ams.StreamFlags.trace_write.ReadStrptrMaybe - inline static bool trace_write_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) __attribute__((nothrow)); - // func:ams.StreamFlags.write_err.ReadStrptrMaybe - inline static bool write_err_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) __attribute__((nothrow)); - // func:ams.StreamFlags.trace_text.ReadStrptrMaybe - inline static bool trace_text_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ams.ProcId.proctype.ReadStrptrMaybe + inline static bool proctype_ReadStrptrMaybe(ams::ProcId &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ams.ProcId.nodeidx.ReadStrptrMaybe + inline static bool nodeidx_ReadStrptrMaybe(ams::ProcId &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ams.ProcId.procidx.ReadStrptrMaybe + inline static bool procidx_ReadStrptrMaybe(ams::ProcId &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ams.ShmFlags.write.ReadStrptrMaybe + inline static bool write_ReadStrptrMaybe(ams::ShmFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ams.ShmFlags.read.ReadStrptrMaybe + inline static bool read_ReadStrptrMaybe(ams::ShmFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ams.ShmFlags.nonblock.ReadStrptrMaybe + inline static bool nonblock_ReadStrptrMaybe(ams::ShmFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ams.ShmFlags.write_err.ReadStrptrMaybe + inline static bool write_err_ReadStrptrMaybe(ams::ShmFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ams.ShmemberFlags.r.ReadStrptrMaybe + inline static bool r_ReadStrptrMaybe(ams::ShmemberFlags &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ams.ShmemberFlags.w.ReadStrptrMaybe + inline static bool w_ReadStrptrMaybe(ams::ShmemberFlags &parent, algo::strptr in_str) __attribute__((nothrow)); // func:ams...SizeCheck inline static void SizeCheck(); } // gen:ns_print_proto -// --- ams.AlarmSyncMsg.base.CopyOut +// --- ams.ExpectMsg.base.CopyOut // Copy fields out of row -void ams::parent_CopyOut(ams::AlarmSyncMsg &row, ams::MsgHeader &out) { +void ams::parent_CopyOut(ams::ExpectMsg &row, ams::MsgHeader &out) { // type: field value is computed // length: field value is computed (void)row;//only to avoid -Wunused-parameter (void)out;//only to avoid -Wunused-parameter } -// --- ams.AlarmSyncMsg..ReadFieldMaybe -bool ams::AlarmSyncMsg_ReadFieldMaybe(ams::AlarmSyncMsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ExpectMsg.text.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ams::text_Getary(ams::ExpectMsg& parent) { + return algo::aryptr(text_Addr(parent), text_N(parent)); +} + +// --- ams.ExpectMsg.text.Addr +char* ams::text_Addr(ams::ExpectMsg& parent) { + return (char*)((u8*)&parent + sizeof(ams::ExpectMsg)); // address of varlen portion +} + +// --- ams.ExpectMsg.text.ReadStrptrMaybe +// Convert string to field. Return success value +bool ams::text_ReadStrptrMaybe(ams::ExpectMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- ams.ExpectMsg.text.Print +// Convert text to a string. +// Array is printed as a regular string. +void ams::text_Print(ams::ExpectMsg& parent, algo::cstring &rhs) { + rhs << text_Getary(parent); +} + +// --- ams.ExpectMsg..ReadFieldMaybe +bool ams::ExpectMsg_ReadFieldMaybe(ams::ExpectMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { case ams_FieldId_base: { retval = false; - break; - } + } break; case ams_FieldId_type: { retval = false; - break; - } + } break; case ams_FieldId_length: { retval = false; - break; - } - case ams_FieldId_updated_after: { - retval = algo::UnTime_ReadStrptrMaybe(parent.updated_after, strval); - break; - } - default: break; + } break; + case ams_FieldId_text: { + retval = text_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -90,45 +124,77 @@ bool ams::AlarmSyncMsg_ReadFieldMaybe(ams::AlarmSyncMsg& parent, algo::strptr fi return retval; } -// --- ams.AlarmSyncMsg..ReadStrptrMaybe -// Read fields of ams::AlarmSyncMsg from an ascii string. +// --- ams.ExpectMsg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ams::ExpectMsg from an ascii string. // The format of the string is an ssim Tuple -bool ams::AlarmSyncMsg_ReadStrptrMaybe(ams::AlarmSyncMsg &parent, algo::strptr in_str) { +bool ams::ExpectMsg_ReadStrptrMaybe(ams::ExpectMsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.AlarmSyncMsg"); + retval = algo::StripTypeTag(in_str, "ams.ExpectMsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && AlarmSyncMsg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && ExpectMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- ams.AlarmSyncMsg..Print +// --- ams.ExpectMsg..Print // print string representation of ROW to string STR -// cfmt:ams.AlarmSyncMsg.String printfmt:Tuple -void ams::AlarmSyncMsg_Print(ams::AlarmSyncMsg& row, algo::cstring& str) { +// cfmt:ams.ExpectMsg.String printfmt:Tuple +void ams::ExpectMsg_Print(ams::ExpectMsg& row, algo::cstring& str) { algo::tempstr temp; - str << "ams.AlarmSyncMsg"; + str << "ams.ExpectMsg"; - algo::UnTime_Print(row.updated_after, temp); - PrintAttrSpaceReset(str,"updated_after", temp); + ams::text_Print(row, temp); + PrintAttrSpaceReset(str,"text", temp); } -// --- ams.ProcType.value.ToCstr +// --- ams.FieldId.value.ToCstr // Convert numeric value of field to one of predefined string constants. // If string is found, return a static C string. Otherwise, return NULL. -const char* ams::value_ToCstr(const ams::ProcType& parent) { +const char* ams::value_ToCstr(const ams::FieldId& parent) { const char *ret = NULL; switch(value_GetEnum(parent)) { - case ams_ProcType_0 : ret = "0"; break; - case ams_ProcType_amstest : ret = "amstest"; break; + case ams_FieldId_base : ret = "base"; break; + case ams_FieldId_type : ret = "type"; break; + case ams_FieldId_length : ret = "length"; break; + case ams_FieldId_text : ret = "text"; break; + case ams_FieldId_proc_id : ret = "proc_id"; break; + case ams_FieldId_payload : ret = "payload"; break; + case ams_FieldId_tstamp : ret = "tstamp"; break; + case ams_FieldId_logcat : ret = "logcat"; break; + case ams_FieldId_proc : ret = "proc"; break; + case ams_FieldId_value : ret = "value"; break; + case ams_FieldId_proctype : ret = "proctype"; break; + case ams_FieldId_nodeidx : ret = "nodeidx"; break; + case ams_FieldId_procidx : ret = "procidx"; break; + case ams_FieldId_signal : ret = "signal"; break; + case ams_FieldId_until : ret = "until"; break; + case ams_FieldId_pty : ret = "pty"; break; + case ams_FieldId_cmd : ret = "cmd"; break; + case ams_FieldId_status : ret = "status"; break; + case ams_FieldId_remove_topmost : ret = "remove_topmost"; break; + case ams_FieldId_pathname : ret = "pathname"; break; + case ams_FieldId_write : ret = "write"; break; + case ams_FieldId_read : ret = "read"; break; + case ams_FieldId_nonblock : ret = "nonblock"; break; + case ams_FieldId_write_err : ret = "write_err"; break; + case ams_FieldId_shmember : ret = "shmember"; break; + case ams_FieldId_off : ret = "off"; break; + case ams_FieldId_wbudget : ret = "wbudget"; break; + case ams_FieldId_shmtype : ret = "shmtype"; break; + case ams_FieldId_index : ret = "index"; break; + case ams_FieldId_r : ret = "r"; break; + case ams_FieldId_w : ret = "w"; break; + case ams_FieldId_shm_id : ret = "shm_id"; break; + case ams_FieldId_flags : ret = "flags"; break; } return ret; } -// --- ams.ProcType.value.Print +// --- ams.FieldId.value.Print // Convert value to a string. First, attempt conversion to a known string. // If no string matches, print value as a numeric value. -void ams::value_Print(const ams::ProcType& parent, algo::cstring &lhs) { +void ams::value_Print(const ams::FieldId& parent, algo::cstring &lhs) { const char *strval = value_ToCstr(parent); if (strval) { lhs << strval; @@ -137,25 +203,155 @@ void ams::value_Print(const ams::ProcType& parent, algo::cstring &lhs) { } } -// --- ams.ProcType.value.SetStrptrMaybe +// --- ams.FieldId.value.SetStrptrMaybe // Convert string to field. // If the string is invalid, do not modify field and return false. // In case of success, return true -bool ams::value_SetStrptrMaybe(ams::ProcType& parent, algo::strptr rhs) { +bool ams::value_SetStrptrMaybe(ams::FieldId& parent, algo::strptr rhs) { bool ret = false; switch (elems_N(rhs)) { case 1: { switch (u64(rhs[0])) { - case '0': { - value_SetEnum(parent,ams_ProcType_0); ret = true; break; + case 'r': { + value_SetEnum(parent,ams_FieldId_r); ret = true; break; + } + case 'w': { + value_SetEnum(parent,ams_FieldId_w); ret = true; break; + } + } + break; + } + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('c','m','d'): { + value_SetEnum(parent,ams_FieldId_cmd); ret = true; break; + } + case LE_STR3('o','f','f'): { + value_SetEnum(parent,ams_FieldId_off); ret = true; break; + } + case LE_STR3('p','t','y'): { + value_SetEnum(parent,ams_FieldId_pty); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('b','a','s','e'): { + value_SetEnum(parent,ams_FieldId_base); ret = true; break; + } + case LE_STR4('p','r','o','c'): { + value_SetEnum(parent,ams_FieldId_proc); ret = true; break; + } + case LE_STR4('r','e','a','d'): { + value_SetEnum(parent,ams_FieldId_read); ret = true; break; + } + case LE_STR4('t','e','x','t'): { + value_SetEnum(parent,ams_FieldId_text); ret = true; break; + } + case LE_STR4('t','y','p','e'): { + value_SetEnum(parent,ams_FieldId_type); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('f','l','a','g','s'): { + value_SetEnum(parent,ams_FieldId_flags); ret = true; break; + } + case LE_STR5('i','n','d','e','x'): { + value_SetEnum(parent,ams_FieldId_index); ret = true; break; + } + case LE_STR5('u','n','t','i','l'): { + value_SetEnum(parent,ams_FieldId_until); ret = true; break; + } + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,ams_FieldId_value); ret = true; break; + } + case LE_STR5('w','r','i','t','e'): { + value_SetEnum(parent,ams_FieldId_write); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('l','e','n','g','t','h'): { + value_SetEnum(parent,ams_FieldId_length); ret = true; break; + } + case LE_STR6('l','o','g','c','a','t'): { + value_SetEnum(parent,ams_FieldId_logcat); ret = true; break; + } + case LE_STR6('s','h','m','_','i','d'): { + value_SetEnum(parent,ams_FieldId_shm_id); ret = true; break; + } + case LE_STR6('s','i','g','n','a','l'): { + value_SetEnum(parent,ams_FieldId_signal); ret = true; break; + } + case LE_STR6('s','t','a','t','u','s'): { + value_SetEnum(parent,ams_FieldId_status); ret = true; break; + } + case LE_STR6('t','s','t','a','m','p'): { + value_SetEnum(parent,ams_FieldId_tstamp); ret = true; break; } } break; } case 7: { switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { - case LE_STR7('a','m','s','t','e','s','t'): { - value_SetEnum(parent,ams_ProcType_amstest); ret = true; break; + case LE_STR7('n','o','d','e','i','d','x'): { + value_SetEnum(parent,ams_FieldId_nodeidx); ret = true; break; + } + case LE_STR7('p','a','y','l','o','a','d'): { + value_SetEnum(parent,ams_FieldId_payload); ret = true; break; + } + case LE_STR7('p','r','o','c','_','i','d'): { + value_SetEnum(parent,ams_FieldId_proc_id); ret = true; break; + } + case LE_STR7('p','r','o','c','i','d','x'): { + value_SetEnum(parent,ams_FieldId_procidx); ret = true; break; + } + case LE_STR7('s','h','m','t','y','p','e'): { + value_SetEnum(parent,ams_FieldId_shmtype); ret = true; break; + } + case LE_STR7('w','b','u','d','g','e','t'): { + value_SetEnum(parent,ams_FieldId_wbudget); ret = true; break; + } + } + break; + } + case 8: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('n','o','n','b','l','o','c','k'): { + value_SetEnum(parent,ams_FieldId_nonblock); ret = true; break; + } + case LE_STR8('p','a','t','h','n','a','m','e'): { + value_SetEnum(parent,ams_FieldId_pathname); ret = true; break; + } + case LE_STR8('p','r','o','c','t','y','p','e'): { + value_SetEnum(parent,ams_FieldId_proctype); ret = true; break; + } + case LE_STR8('s','h','m','e','m','b','e','r'): { + value_SetEnum(parent,ams_FieldId_shmember); ret = true; break; + } + } + break; + } + case 9: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('w','r','i','t','e','_','e','r'): { + if (memcmp(rhs.elems+8,"r",1)==0) { value_SetEnum(parent,ams_FieldId_write_err); ret = true; break; } + break; + } + } + break; + } + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('r','e','m','o','v','e','_','t'): { + if (memcmp(rhs.elems+8,"opmost",6)==0) { value_SetEnum(parent,ams_FieldId_remove_topmost); ret = true; break; } + break; } } break; @@ -164,105 +360,56 @@ bool ams::value_SetStrptrMaybe(ams::ProcType& parent, algo::strptr rhs) { return ret; } -// --- ams.ProcType.value.SetStrptr +// --- ams.FieldId.value.SetStrptr // Convert string to field. // If the string is invalid, set numeric value to DFLT -void ams::value_SetStrptr(ams::ProcType& parent, algo::strptr rhs, ams_ProcTypeEnum dflt) { +void ams::value_SetStrptr(ams::FieldId& parent, algo::strptr rhs, ams_FieldIdEnum dflt) { if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); } -// --- ams.ProcType.value.ReadStrptrMaybe +// --- ams.FieldId.value.ReadStrptrMaybe // Convert string to field. Return success value -bool ams::value_ReadStrptrMaybe(ams::ProcType& parent, algo::strptr rhs) { +bool ams::value_ReadStrptrMaybe(ams::FieldId& parent, algo::strptr rhs) { bool retval = false; retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion if (!retval) { // didn't work? try reading as underlying type - retval = u8_ReadStrptrMaybe(parent.value,rhs); + retval = i32_ReadStrptrMaybe(parent.value,rhs); } return retval; } -// --- ams.ProcType..ReadStrptrMaybe -// Read fields of ams::ProcType from an ascii string. -// The format of the string is the format of the ams::ProcType's only field -bool ams::ProcType_ReadStrptrMaybe(ams::ProcType &parent, algo::strptr in_str) { +// --- ams.FieldId..ReadStrptrMaybe +// Read fields of ams::FieldId from an ascii string. +// The format of the string is the format of the ams::FieldId's only field +bool ams::FieldId_ReadStrptrMaybe(ams::FieldId &parent, algo::strptr in_str) { bool retval = true; retval = retval && value_ReadStrptrMaybe(parent, in_str); return retval; } -// --- ams.ProcType..Print +// --- ams.FieldId..Print // print string representation of ROW to string STR -// cfmt:ams.ProcType.String printfmt:Raw -void ams::ProcType_Print(ams::ProcType row, algo::cstring& str) { +// cfmt:ams.FieldId.String printfmt:Raw +void ams::FieldId_Print(ams::FieldId& row, algo::cstring& str) { ams::value_Print(row, str); } -// --- ams.ProcId..ReadFieldMaybe -bool ams::ProcId_ReadFieldMaybe(ams::ProcId& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case ams_FieldId_proc_type: { - retval = ams::ProcType_ReadStrptrMaybe(parent.proc_type, strval); - break; - } - case ams_FieldId_procidx: { - retval = u8_ReadStrptrMaybe(parent.procidx, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- ams.ProcId..ReadStrptrMaybe -// Read fields of ams::ProcId from an ascii string. -// The format of the string is a string with separated values -bool ams::ProcId_ReadStrptrMaybe(ams::ProcId &parent, algo::strptr in_str) { - bool retval = true; - algo::strptr value; - - algo::NextSep(in_str, '-', value); - retval = retval && ams::ProcType_ReadStrptrMaybe(parent.proc_type, value); - - value = in_str; - retval = retval && u8_ReadStrptrMaybe(parent.procidx, value); - return retval; -} - -// --- ams.ProcId..Print -// print string representation of ROW to string STR -// cfmt:ams.ProcId.String printfmt:Sep -void ams::ProcId_Print(ams::ProcId row, algo::cstring& str) { - ams::ProcType_Print(row.proc_type, str); - str << '-'; - u8_Print(row.procidx, str); -} - -// --- ams.StreamType.value.ToCstr +// --- ams.Proctype.value.ToCstr // Convert numeric value of field to one of predefined string constants. // If string is found, return a static C string. Otherwise, return NULL. -const char* ams::value_ToCstr(const ams::StreamType& parent) { +const char* ams::value_ToCstr(const ams::Proctype& parent) { const char *ret = NULL; switch(value_GetEnum(parent)) { - case ams_StreamType_0 : ret = "0"; break; - case ams_StreamType_ctl : ret = "ctl"; break; - case ams_StreamType_io : ret = "io"; break; - case ams_StreamType_out : ret = "out"; break; - case ams_StreamType_trace : ret = "trace"; break; + case ams_Proctype_ : ret = ""; break; + case ams_Proctype_ams_sendtest : ret = "ams_sendtest"; break; } return ret; } -// --- ams.StreamType.value.Print +// --- ams.Proctype.value.Print // Convert value to a string. First, attempt conversion to a known string. // If no string matches, print value as a numeric value. -void ams::value_Print(const ams::StreamType& parent, algo::cstring &lhs) { +void ams::value_Print(const ams::Proctype& parent, algo::cstring &lhs) { const char *strval = value_ToCstr(parent); if (strval) { lhs << strval; @@ -271,44 +418,23 @@ void ams::value_Print(const ams::StreamType& parent, algo::cstring &lhs) { } } -// --- ams.StreamType.value.SetStrptrMaybe +// --- ams.Proctype.value.SetStrptrMaybe // Convert string to field. // If the string is invalid, do not modify field and return false. // In case of success, return true -bool ams::value_SetStrptrMaybe(ams::StreamType& parent, algo::strptr rhs) { +bool ams::value_SetStrptrMaybe(ams::Proctype& parent, algo::strptr rhs) { bool ret = false; switch (elems_N(rhs)) { - case 1: { - switch (u64(rhs[0])) { - case '0': { - value_SetEnum(parent,ams_StreamType_0); ret = true; break; - } - } - break; - } - case 2: { - switch (u64(algo::ReadLE16(rhs.elems))) { - case LE_STR2('i','o'): { - value_SetEnum(parent,ams_StreamType_io); ret = true; break; - } - } + case 0: { + value_SetEnum(parent,ams_Proctype_); + ret = true; break; } - case 3: { - switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { - case LE_STR3('c','t','l'): { - value_SetEnum(parent,ams_StreamType_ctl); ret = true; break; - } - case LE_STR3('o','u','t'): { - value_SetEnum(parent,ams_StreamType_out); ret = true; break; - } - } - break; - } - case 5: { - switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { - case LE_STR5('t','r','a','c','e'): { - value_SetEnum(parent,ams_StreamType_trace); ret = true; break; + case 12: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','m','s','_','s','e','n','d'): { + if (memcmp(rhs.elems+8,"test",4)==0) { value_SetEnum(parent,ams_Proctype_ams_sendtest); ret = true; break; } + break; } } break; @@ -317,16 +443,16 @@ bool ams::value_SetStrptrMaybe(ams::StreamType& parent, algo::strptr rhs) { return ret; } -// --- ams.StreamType.value.SetStrptr +// --- ams.Proctype.value.SetStrptr // Convert string to field. // If the string is invalid, set numeric value to DFLT -void ams::value_SetStrptr(ams::StreamType& parent, algo::strptr rhs, ams_StreamTypeEnum dflt) { +void ams::value_SetStrptr(ams::Proctype& parent, algo::strptr rhs, ams_ProctypeEnum dflt) { if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); } -// --- ams.StreamType.value.ReadStrptrMaybe +// --- ams.Proctype.value.ReadStrptrMaybe // Convert string to field. Return success value -bool ams::value_ReadStrptrMaybe(ams::StreamType& parent, algo::strptr rhs) { +bool ams::value_ReadStrptrMaybe(ams::Proctype& parent, algo::strptr rhs) { bool retval = false; retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion if (!retval) { // didn't work? try reading as underlying type @@ -335,41 +461,77 @@ bool ams::value_ReadStrptrMaybe(ams::StreamType& parent, algo::strptr rhs) { return retval; } -// --- ams.StreamType..ReadStrptrMaybe -// Read fields of ams::StreamType from an ascii string. -// The format of the string is the format of the ams::StreamType's only field -bool ams::StreamType_ReadStrptrMaybe(ams::StreamType &parent, algo::strptr in_str) { +// --- ams.Proctype..ReadStrptrMaybe +// Read fields of ams::Proctype from an ascii string. +// The format of the string is the format of the ams::Proctype's only field +bool ams::Proctype_ReadStrptrMaybe(ams::Proctype &parent, algo::strptr in_str) { bool retval = true; retval = retval && value_ReadStrptrMaybe(parent, in_str); return retval; } -// --- ams.StreamType..Print +// --- ams.Proctype..Print // print string representation of ROW to string STR -// cfmt:ams.StreamType.String printfmt:Raw -void ams::StreamType_Print(ams::StreamType row, algo::cstring& str) { +// cfmt:ams.Proctype.String printfmt:Raw +void ams::Proctype_Print(ams::Proctype row, algo::cstring& str) { ams::value_Print(row, str); } -// --- ams.StreamId..ReadFieldMaybe -bool ams::StreamId_ReadFieldMaybe(ams::StreamId& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ProcId.proctype.ReadStrptrMaybe +inline static bool ams::proctype_ReadStrptrMaybe(ams::ProcId &parent, algo::strptr in_str) { + bool retval = true; + ams::Proctype proctype_tmp; + retval = ams::Proctype_ReadStrptrMaybe(proctype_tmp, in_str); + if (retval) { + proctype_Set(parent, proctype_tmp); + } + return retval; +} + +// --- ams.ProcId.nodeidx.ReadStrptrMaybe +inline static bool ams::nodeidx_ReadStrptrMaybe(ams::ProcId &parent, algo::strptr in_str) { + bool retval = true; + u8 nodeidx_tmp; + retval = u8_ReadStrptrMaybe(nodeidx_tmp, in_str); + if (retval) { + nodeidx_Set(parent, nodeidx_tmp); + } + return retval; +} + +// --- ams.ProcId.procidx.ReadStrptrMaybe +inline static bool ams::procidx_ReadStrptrMaybe(ams::ProcId &parent, algo::strptr in_str) { + bool retval = true; + u8 procidx_tmp; + retval = u8_ReadStrptrMaybe(procidx_tmp, in_str); + if (retval) { + procidx_Set(parent, procidx_tmp); + } + return retval; +} + +// --- ams.ProcId..ReadFieldMaybe +bool ams::ProcId_ReadFieldMaybe(ams::ProcId& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case ams_FieldId_proc_id: { - retval = ams::ProcId_ReadStrptrMaybe(parent.proc_id, strval); - break; - } - case ams_FieldId_stream_type: { - retval = ams::StreamType_ReadStrptrMaybe(parent.stream_type, strval); - break; - } - case ams_FieldId_streamidx: { - retval = u8_ReadStrptrMaybe(parent.streamidx, strval); - break; - } - default: break; + case ams_FieldId_value: { + retval = u32_ReadStrptrMaybe(parent.value, strval); + } break; + case ams_FieldId_proctype: { + retval = proctype_ReadStrptrMaybe(parent, strval); + } break; + case ams_FieldId_nodeidx: { + retval = nodeidx_ReadStrptrMaybe(parent, strval); + } break; + case ams_FieldId_procidx: { + retval = procidx_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -377,129 +539,98 @@ bool ams::StreamId_ReadFieldMaybe(ams::StreamId& parent, algo::strptr field, alg return retval; } -// --- ams.StreamId..ReadStrptrMaybe -// Read fields of ams::StreamId from an ascii string. +// --- ams.ProcId..ReadStrptrMaybe +// Read fields of ams::ProcId from an ascii string. // The format of the string is a string with separated values -bool ams::StreamId_ReadStrptrMaybe(ams::StreamId &parent, algo::strptr in_str) { +bool ams::ProcId_ReadStrptrMaybe(ams::ProcId &parent, algo::strptr in_str) { bool retval = true; algo::strptr value; - algo::NextSep(in_str, '.', value); - retval = retval && ams::ProcId_ReadStrptrMaybe(parent.proc_id, value); + algo::NextSep(in_str, '-', value); + retval = retval && proctype_ReadStrptrMaybe(parent, value); algo::NextSep(in_str, '-', value); - retval = retval && ams::StreamType_ReadStrptrMaybe(parent.stream_type, value); + retval = retval && nodeidx_ReadStrptrMaybe(parent, value); value = in_str; - retval = retval && u8_ReadStrptrMaybe(parent.streamidx, value); + retval = retval && procidx_ReadStrptrMaybe(parent, value); return retval; } -// --- ams.StreamId..Print +// --- ams.ProcId..Print // print string representation of ROW to string STR -// cfmt:ams.StreamId.String printfmt:Sep -void ams::StreamId_Print(ams::StreamId row, algo::cstring& str) { - ams::ProcId_Print(row.proc_id, str); - str << '.'; - ams::StreamType_Print(row.stream_type, str); +// cfmt:ams.ProcId.String printfmt:Sep +void ams::ProcId_Print(ams::ProcId row, algo::cstring& str) { + ams::Proctype_Print(proctype_Get(row), str); str << '-'; - u8_Print(row.streamidx, str); + u8_Print(nodeidx_Get(row), str); + str << '-'; + u8_Print(procidx_Get(row), str); } -// --- ams.DfltStream.base.CopyOut +// --- ams.InputLineMsg.base.CopyOut // Copy fields out of row -void ams::parent_CopyOut(ams::DfltStream &row, ams::MsgHeader &out) { +void ams::parent_CopyOut(ams::InputLineMsg &row, ams::MsgHeader &out) { // type: field value is computed // length: field value is computed (void)row;//only to avoid -Wunused-parameter (void)out;//only to avoid -Wunused-parameter } -// --- ams.DfltStream..ReadFieldMaybe -bool ams::DfltStream_ReadFieldMaybe(ams::DfltStream& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case ams_FieldId_base: { - retval = false; - break; - } - case ams_FieldId_type: { - retval = false; - break; - } - case ams_FieldId_length: { - retval = false; - break; - } - case ams_FieldId_stream_id: { - retval = ams::StreamId_ReadStrptrMaybe(parent.stream_id, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; +// --- ams.InputLineMsg.payload.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ams::payload_Getary(ams::InputLineMsg& parent) { + return algo::aryptr(payload_Addr(parent), payload_N(parent)); } -// --- ams.DfltStream..ReadStrptrMaybe -// Read fields of ams::DfltStream from an ascii string. -// The format of the string is an ssim Tuple -bool ams::DfltStream_ReadStrptrMaybe(ams::DfltStream &parent, algo::strptr in_str) { - bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.DfltStream"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && DfltStream_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; +// --- ams.InputLineMsg.payload.Addr +char* ams::payload_Addr(ams::InputLineMsg& parent) { + return (char*)((u8*)&parent + sizeof(ams::InputLineMsg)); // address of varlen portion } -// --- ams.DfltStream..Print -// print string representation of ROW to string STR -// cfmt:ams.DfltStream.String printfmt:Tuple -void ams::DfltStream_Print(ams::DfltStream& row, algo::cstring& str) { - algo::tempstr temp; - str << "ams.DfltStream"; - - ams::StreamId_Print(row.stream_id, temp); - PrintAttrSpaceReset(str,"stream_id", temp); +// --- ams.InputLineMsg.payload.ReadStrptrMaybe +// Convert string to field. Return success value +bool ams::payload_ReadStrptrMaybe(ams::InputLineMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; } -// --- ams.DumpStreamTableMsg.base.CopyOut -// Copy fields out of row -void ams::parent_CopyOut(ams::DumpStreamTableMsg &row, ams::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter +// --- ams.InputLineMsg.payload.Print +// Convert payload to a string. +// Array is printed as a regular string. +void ams::payload_Print(ams::InputLineMsg& parent, algo::cstring &rhs) { + rhs << payload_Getary(parent); } -// --- ams.DumpStreamTableMsg..ReadFieldMaybe -bool ams::DumpStreamTableMsg_ReadFieldMaybe(ams::DumpStreamTableMsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.InputLineMsg..ReadFieldMaybe +bool ams::InputLineMsg_ReadFieldMaybe(ams::InputLineMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { case ams_FieldId_base: { retval = false; - break; - } + } break; case ams_FieldId_type: { retval = false; - break; - } + } break; case ams_FieldId_length: { retval = false; - break; - } + } break; case ams_FieldId_proc_id: { retval = ams::ProcId_ReadStrptrMaybe(parent.proc_id, strval); - break; - } - default: break; + } break; + case ams_FieldId_payload: { + retval = payload_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -507,52 +638,86 @@ bool ams::DumpStreamTableMsg_ReadFieldMaybe(ams::DumpStreamTableMsg& parent, alg return retval; } -// --- ams.DumpStreamTableMsg..ReadStrptrMaybe -// Read fields of ams::DumpStreamTableMsg from an ascii string. +// --- ams.InputLineMsg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ams::InputLineMsg from an ascii string. // The format of the string is an ssim Tuple -bool ams::DumpStreamTableMsg_ReadStrptrMaybe(ams::DumpStreamTableMsg &parent, algo::strptr in_str) { +bool ams::InputLineMsg_ReadStrptrMaybe(ams::InputLineMsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.DumpStreamTableMsg"); + retval = algo::StripTypeTag(in_str, "ams.InputLineMsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && DumpStreamTableMsg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && InputLineMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- ams.DumpStreamTableMsg..Print +// --- ams.InputLineMsg..Print // print string representation of ROW to string STR -// cfmt:ams.DumpStreamTableMsg.String printfmt:Tuple -void ams::DumpStreamTableMsg_Print(ams::DumpStreamTableMsg& row, algo::cstring& str) { +// cfmt:ams.InputLineMsg.String printfmt:Tuple +void ams::InputLineMsg_Print(ams::InputLineMsg& row, algo::cstring& str) { algo::tempstr temp; - str << "ams.DumpStreamTableMsg"; + str << "ams.InputLineMsg"; ams::ProcId_Print(row.proc_id, temp); PrintAttrSpaceReset(str,"proc_id", temp); + + ams::payload_Print(row, temp); + PrintAttrSpaceReset(str,"payload", temp); } -// --- ams.ExpectMsg.base.CopyOut +// --- ams.LogMsg.base.CopyOut // Copy fields out of row -void ams::parent_CopyOut(ams::ExpectMsg &row, ams::MsgHeader &out) { +void ams::parent_CopyOut(ams::LogMsg &row, ams::MsgHeader &out) { // type: field value is computed // length: field value is computed (void)row;//only to avoid -Wunused-parameter (void)out;//only to avoid -Wunused-parameter } -// --- ams.ExpectMsg.text.Getary +// --- ams.LogMsg.logcat.Getary // Access var-length portion as an aryptr. Length is determined from one of the fields. -algo::aryptr ams::text_Getary(ams::ExpectMsg& parent) { +algo::aryptr ams::logcat_Getary(ams::LogMsg& parent) { + return algo::aryptr(logcat_Addr(parent), logcat_N(parent)); +} + +// --- ams.LogMsg.logcat.Addr +char* ams::logcat_Addr(ams::LogMsg& parent) { + return (char*)((u8*)&parent + sizeof(ams::LogMsg)); // address of varlen portion +} + +// --- ams.LogMsg.logcat.ReadStrptrMaybe +// Convert string to field. Return success value +bool ams::logcat_ReadStrptrMaybe(ams::LogMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Insary(*algo_lib::_db.varlenbuf,strptr_ToMemptr(in_str),parent.logcat_end); + u32 incr = ch_N(in_str); + parent.logcat_end = u32(parent.logcat_end + incr); + } + return retval; +} + +// --- ams.LogMsg.logcat.Print +// Convert logcat to a string. +// Array is printed as a regular string. +void ams::logcat_Print(ams::LogMsg& parent, algo::cstring &rhs) { + rhs << logcat_Getary(parent); +} + +// --- ams.LogMsg.text.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ams::text_Getary(ams::LogMsg& parent) { return algo::aryptr(text_Addr(parent), text_N(parent)); } -// --- ams.ExpectMsg.text.Addr -char* ams::text_Addr(ams::ExpectMsg& parent) { - return (char*)((u8*)&parent + sizeof(ams::ExpectMsg)); // address of varlen portion +// --- ams.LogMsg.text.Addr +char* ams::text_Addr(ams::LogMsg& parent) { + return (char*)((u8*)&parent + sizeof(ams::LogMsg) + parent.logcat_end); // address of varlen portion } -// --- ams.ExpectMsg.text.ReadStrptrMaybe +// --- ams.LogMsg.text.ReadStrptrMaybe // Convert string to field. Return success value -bool ams::text_ReadStrptrMaybe(ams::ExpectMsg& parent, algo::strptr in_str) { +bool ams::text_ReadStrptrMaybe(ams::LogMsg& parent, algo::strptr in_str) { bool retval = true; if (algo_lib::_db.varlenbuf) { ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); @@ -561,36 +726,44 @@ bool ams::text_ReadStrptrMaybe(ams::ExpectMsg& parent, algo::strptr in_str) { return retval; } -// --- ams.ExpectMsg.text.Print +// --- ams.LogMsg.text.Print // Convert text to a string. // Array is printed as a regular string. -void ams::text_Print(ams::ExpectMsg& parent, algo::cstring &rhs) { +void ams::text_Print(ams::LogMsg& parent, algo::cstring &rhs) { rhs << text_Getary(parent); } -// --- ams.ExpectMsg..ReadFieldMaybe -bool ams::ExpectMsg_ReadFieldMaybe(ams::ExpectMsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.LogMsg..ReadFieldMaybe +bool ams::LogMsg_ReadFieldMaybe(ams::LogMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { case ams_FieldId_base: { retval = false; - break; - } + } break; case ams_FieldId_type: { retval = false; - break; - } + } break; case ams_FieldId_length: { retval = false; - break; - } + } break; + case ams_FieldId_proc_id: { + retval = ams::ProcId_ReadStrptrMaybe(parent.proc_id, strval); + } break; + case ams_FieldId_tstamp: { + retval = algo::SchedTime_ReadStrptrMaybe(parent.tstamp, strval); + } break; + case ams_FieldId_logcat: { + retval = logcat_ReadStrptrMaybe(parent, strval); + } break; case ams_FieldId_text: { retval = text_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -598,254 +771,257 @@ bool ams::ExpectMsg_ReadFieldMaybe(ams::ExpectMsg& parent, algo::strptr field, a return retval; } -// --- ams.ExpectMsg..ReadStrptrMaybe +// --- ams.LogMsg..ReadStrptrMaybe // Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::ExpectMsg from an ascii string. +// Read fields of ams::LogMsg from an ascii string. // The format of the string is an ssim Tuple -bool ams::ExpectMsg_ReadStrptrMaybe(ams::ExpectMsg &parent, algo::strptr in_str) { +bool ams::LogMsg_ReadStrptrMaybe(ams::LogMsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.ExpectMsg"); + retval = algo::StripTypeTag(in_str, "ams.LogMsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && ExpectMsg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && LogMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- ams.ExpectMsg..Print +// --- ams.LogMsg..Print // print string representation of ROW to string STR -// cfmt:ams.ExpectMsg.String printfmt:Tuple -void ams::ExpectMsg_Print(ams::ExpectMsg& row, algo::cstring& str) { +// cfmt:ams.LogMsg.String printfmt:Tuple +void ams::LogMsg_Print(ams::LogMsg& row, algo::cstring& str) { algo::tempstr temp; - str << "ams.ExpectMsg"; + str << "ams.LogMsg"; + + ams::ProcId_Print(row.proc_id, temp); + PrintAttrSpaceReset(str,"proc_id", temp); + + algo::SchedTime_Print(row.tstamp, temp); + PrintAttrSpaceReset(str,"tstamp", temp); + + ams::logcat_Print(row, temp); + PrintAttrSpaceReset(str,"logcat", temp); ams::text_Print(row, temp); PrintAttrSpaceReset(str,"text", temp); } -// --- ams.FieldId.value.ToCstr -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -const char* ams::value_ToCstr(const ams::FieldId& parent) { - const char *ret = NULL; - switch(value_GetEnum(parent)) { - case ams_FieldId_base : ret = "base"; break; - case ams_FieldId_type : ret = "type"; break; - case ams_FieldId_length : ret = "length"; break; - case ams_FieldId_updated_after : ret = "updated_after"; break; - case ams_FieldId_stream_id : ret = "stream_id"; break; - case ams_FieldId_proc_id : ret = "proc_id"; break; - case ams_FieldId_text : ret = "text"; break; - case ams_FieldId_time : ret = "time"; break; - case ams_FieldId_payload : ret = "payload"; break; - case ams_FieldId_logcat : ret = "logcat"; break; - case ams_FieldId_tstamp : ret = "tstamp"; break; - case ams_FieldId_mode : ret = "mode"; break; - case ams_FieldId_member : ret = "member"; break; - case ams_FieldId_pos : ret = "pos"; break; - case ams_FieldId_data : ret = "data"; break; - case ams_FieldId_proc_type : ret = "proc_type"; break; - case ams_FieldId_procidx : ret = "procidx"; break; - case ams_FieldId_value : ret = "value"; break; - case ams_FieldId_seqmsg_id : ret = "seqmsg_id"; break; - case ams_FieldId_tsc : ret = "tsc"; break; - case ams_FieldId_seq : ret = "seq"; break; - case ams_FieldId_off : ret = "off"; break; - case ams_FieldId_write : ret = "write"; break; - case ams_FieldId_read : ret = "read"; break; - case ams_FieldId_nonblock : ret = "nonblock"; break; - case ams_FieldId_trace_read : ret = "trace_read"; break; - case ams_FieldId_trace_write : ret = "trace_write"; break; - case ams_FieldId_write_err : ret = "write_err"; break; - case ams_FieldId_trace_text : ret = "trace_text"; break; - case ams_FieldId_wbudget : ret = "wbudget"; break; - case ams_FieldId_stream_type : ret = "stream_type"; break; - case ams_FieldId_streamidx : ret = "streamidx"; break; - case ams_FieldId_proc : ret = "proc"; break; - case ams_FieldId_trace : ret = "trace"; break; - case ams_FieldId_part : ret = "part"; break; - } - return ret; +// --- ams.MsgBlock.header.CopyOut +// Copy fields out of row +void ams::parent_CopyOut(ams::MsgBlock &row, ams::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter } -// --- ams.FieldId.value.Print -// Convert value to a string. First, attempt conversion to a known string. -// If no string matches, print value as a numeric value. -void ams::value_Print(const ams::FieldId& parent, algo::cstring &lhs) { - const char *strval = value_ToCstr(parent); +// --- ams.MsgBlock.messages.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ams::messages_Getary(ams::MsgBlock& parent) { + return algo::aryptr(messages_Addr(parent), messages_N(parent)); +} + +// --- ams.MsgBlock.messages.Addr +u8* ams::messages_Addr(ams::MsgBlock& parent) { + return (u8*)((u8*)&parent + sizeof(ams::MsgBlock)); // address of varlen portion +} + +// --- ams.MsgBlock.messages.Print +// Convert messages to a string. +// Array is printed as a regular string. +void ams::messages_Print(ams::MsgBlock& parent, algo::cstring &rhs) { + rhs << algo::memptr_ToStrptr(messages_Getary(parent)); +} + +// --- ams.MsgBlock..Print +// print string representation of ROW to string STR +// cfmt:ams.MsgBlock.String printfmt:Tuple +void ams::MsgBlock_Print(ams::MsgBlock& row, algo::cstring& str) { + algo::tempstr temp; + str << "ams.MsgBlock"; + + u64_Print(row.first_seqno, temp); + PrintAttrSpaceReset(str,"first_seqno", temp); + + u32_Print(row.n_messages, temp); + PrintAttrSpaceReset(str,"n_messages", temp); + + u32_Print(row.original_length, temp); + PrintAttrSpaceReset(str,"original_length", temp); + + ams::messages_Print(row, temp); + PrintAttrSpaceReset(str,"messages", temp); +} + +// --- ams.MsgHeader.type.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* ams::type_ToCstr(const ams::MsgHeader& payload) { + const char *ret = NULL; + switch(type_GetEnum(payload)) { + case ams_MsgHeader_type_ams_ExpectMsg: ret = "ams.ExpectMsg"; break; + case ams_MsgHeader_type_ams_InputLineMsg: ret = "ams.InputLineMsg"; break; + case ams_MsgHeader_type_ams_LogMsg : ret = "ams.LogMsg"; break; + case ams_MsgHeader_type_ams_MsgBlock: ret = "ams.MsgBlock"; break; + case ams_MsgHeader_type_ams_ProcEofMsg: ret = "ams.ProcEofMsg"; break; + case ams_MsgHeader_type_ams_ProcKillMsg: ret = "ams.ProcKillMsg"; break; + case ams_MsgHeader_type_ams_ProcMsg: ret = "ams.ProcMsg"; break; + case ams_MsgHeader_type_ams_ProcReadMsg: ret = "ams.ProcReadMsg"; break; + case ams_MsgHeader_type_ams_ProcStartMsg: ret = "ams.ProcStartMsg"; break; + case ams_MsgHeader_type_ams_ProcStatusMsg: ret = "ams.ProcStatusMsg"; break; + case ams_MsgHeader_type_ams_RemDirRecurseMsg: ret = "ams.RemDirRecurseMsg"; break; + case ams_MsgHeader_type_ams_ShmHbMsg: ret = "ams.ShmHbMsg"; break; + case ams_MsgHeader_type_ams_Shmmsg : ret = "ams.Shmmsg"; break; + case ams_MsgHeader_type_ams_TerminateMsg: ret = "ams.TerminateMsg"; break; + case ams_MsgHeader_type_ams_UdpFrame: ret = "ams.UdpFrame"; break; + case ams_MsgHeader_type_fm_AlarmMsg: ret = "fm.AlarmMsg"; break; + case ams_MsgHeader_type_ws_CloseMsg: ret = "ws.CloseMsg"; break; + case ams_MsgHeader_type_ws_ConnectMsg: ret = "ws.ConnectMsg"; break; + case ams_MsgHeader_type_ws_DataMsg : ret = "ws.DataMsg"; break; + case ams_MsgHeader_type_ws_ServerStartMsg: ret = "ws.ServerStartMsg"; break; + case ams_MsgHeader_type_ws_ServerStopMsg: ret = "ws.ServerStopMsg"; break; + } + return ret; +} + +// --- ams.MsgHeader.type.Print +// Convert type to a string. First, attempt conversion to a known string. +// If no string matches, print type as a numeric value. +void ams::type_Print(const ams::MsgHeader& payload, algo::cstring &lhs) { + const char *strval = type_ToCstr(payload); if (strval) { lhs << strval; } else { - lhs << parent.value; + lhs << payload.type; } } -// --- ams.FieldId.value.SetStrptrMaybe +// --- ams.MsgHeader.type.SetStrptrMaybe // Convert string to field. // If the string is invalid, do not modify field and return false. // In case of success, return true -bool ams::value_SetStrptrMaybe(ams::FieldId& parent, algo::strptr rhs) { +bool ams::type_SetStrptrMaybe(ams::MsgHeader& payload, algo::strptr rhs) { bool ret = false; switch (elems_N(rhs)) { - case 3: { - switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { - case LE_STR3('o','f','f'): { - value_SetEnum(parent,ams_FieldId_off); ret = true; break; - } - case LE_STR3('p','o','s'): { - value_SetEnum(parent,ams_FieldId_pos); ret = true; break; + case 10: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','m','s','.','L','o','g','M'): { + if (memcmp(rhs.elems+8,"sg",2)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_LogMsg); ret = true; break; } + break; } - case LE_STR3('s','e','q'): { - value_SetEnum(parent,ams_FieldId_seq); ret = true; break; + case LE_STR8('a','m','s','.','S','h','m','m'): { + if (memcmp(rhs.elems+8,"sg",2)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_Shmmsg); ret = true; break; } + break; } - case LE_STR3('t','s','c'): { - value_SetEnum(parent,ams_FieldId_tsc); ret = true; break; + case LE_STR8('w','s','.','D','a','t','a','M'): { + if (memcmp(rhs.elems+8,"sg",2)==0) { type_SetEnum(payload,ams_MsgHeader_type_ws_DataMsg); ret = true; break; } + break; } } break; } - case 4: { - switch (u64(algo::ReadLE32(rhs.elems))) { - case LE_STR4('b','a','s','e'): { - value_SetEnum(parent,ams_FieldId_base); ret = true; break; - } - case LE_STR4('d','a','t','a'): { - value_SetEnum(parent,ams_FieldId_data); ret = true; break; - } - case LE_STR4('m','o','d','e'): { - value_SetEnum(parent,ams_FieldId_mode); ret = true; break; - } - case LE_STR4('p','a','r','t'): { - value_SetEnum(parent,ams_FieldId_part); ret = true; break; - } - case LE_STR4('p','r','o','c'): { - value_SetEnum(parent,ams_FieldId_proc); ret = true; break; - } - case LE_STR4('r','e','a','d'): { - value_SetEnum(parent,ams_FieldId_read); ret = true; break; - } - case LE_STR4('t','e','x','t'): { - value_SetEnum(parent,ams_FieldId_text); ret = true; break; + case 11: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"Msg",3)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_ProcMsg); ret = true; break; } + break; } - case LE_STR4('t','i','m','e'): { - value_SetEnum(parent,ams_FieldId_time); ret = true; break; + case LE_STR8('f','m','.','A','l','a','r','m'): { + if (memcmp(rhs.elems+8,"Msg",3)==0) { type_SetEnum(payload,ams_MsgHeader_type_fm_AlarmMsg); ret = true; break; } + break; } - case LE_STR4('t','y','p','e'): { - value_SetEnum(parent,ams_FieldId_type); ret = true; break; + case LE_STR8('w','s','.','C','l','o','s','e'): { + if (memcmp(rhs.elems+8,"Msg",3)==0) { type_SetEnum(payload,ams_MsgHeader_type_ws_CloseMsg); ret = true; break; } + break; } } break; } - case 5: { - switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { - case LE_STR5('t','r','a','c','e'): { - value_SetEnum(parent,ams_FieldId_trace); ret = true; break; + case 12: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','m','s','.','M','s','g','B'): { + if (memcmp(rhs.elems+8,"lock",4)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_MsgBlock); ret = true; break; } + break; } - case LE_STR5('v','a','l','u','e'): { - value_SetEnum(parent,ams_FieldId_value); ret = true; break; + case LE_STR8('a','m','s','.','S','h','m','H'): { + if (memcmp(rhs.elems+8,"bMsg",4)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_ShmHbMsg); ret = true; break; } + break; } - case LE_STR5('w','r','i','t','e'): { - value_SetEnum(parent,ams_FieldId_write); ret = true; break; + case LE_STR8('a','m','s','.','U','d','p','F'): { + if (memcmp(rhs.elems+8,"rame",4)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_UdpFrame); ret = true; break; } + break; } } break; } - case 6: { - switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { - case LE_STR6('l','e','n','g','t','h'): { - value_SetEnum(parent,ams_FieldId_length); ret = true; break; - } - case LE_STR6('l','o','g','c','a','t'): { - value_SetEnum(parent,ams_FieldId_logcat); ret = true; break; - } - case LE_STR6('m','e','m','b','e','r'): { - value_SetEnum(parent,ams_FieldId_member); ret = true; break; + case 13: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','m','s','.','E','x','p','e'): { + if (memcmp(rhs.elems+8,"ctMsg",5)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_ExpectMsg); ret = true; break; } + break; } - case LE_STR6('t','s','t','a','m','p'): { - value_SetEnum(parent,ams_FieldId_tstamp); ret = true; break; + case LE_STR8('w','s','.','C','o','n','n','e'): { + if (memcmp(rhs.elems+8,"ctMsg",5)==0) { type_SetEnum(payload,ams_MsgHeader_type_ws_ConnectMsg); ret = true; break; } + break; } } break; } - case 7: { - switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { - case LE_STR7('p','a','y','l','o','a','d'): { - value_SetEnum(parent,ams_FieldId_payload); ret = true; break; - } - case LE_STR7('p','r','o','c','_','i','d'): { - value_SetEnum(parent,ams_FieldId_proc_id); ret = true; break; - } - case LE_STR7('p','r','o','c','i','d','x'): { - value_SetEnum(parent,ams_FieldId_procidx); ret = true; break; - } - case LE_STR7('w','b','u','d','g','e','t'): { - value_SetEnum(parent,ams_FieldId_wbudget); ret = true; break; + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"EofMsg",6)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_ProcEofMsg); ret = true; break; } + break; } } break; } - case 8: { + case 15: { switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('n','o','n','b','l','o','c','k'): { - value_SetEnum(parent,ams_FieldId_nonblock); ret = true; break; + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"KillMsg",7)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_ProcKillMsg); ret = true; break; } + if (memcmp(rhs.elems+8,"ReadMsg",7)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_ProcReadMsg); ret = true; break; } + break; } } break; } - case 9: { + case 16: { switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('p','r','o','c','_','t','y','p'): { - if (memcmp(rhs.elems+8,"e",1)==0) { value_SetEnum(parent,ams_FieldId_proc_type); ret = true; break; } - break; - } - case LE_STR8('s','e','q','m','s','g','_','i'): { - if (memcmp(rhs.elems+8,"d",1)==0) { value_SetEnum(parent,ams_FieldId_seqmsg_id); ret = true; break; } - break; - } - case LE_STR8('s','t','r','e','a','m','_','i'): { - if (memcmp(rhs.elems+8,"d",1)==0) { value_SetEnum(parent,ams_FieldId_stream_id); ret = true; break; } - break; - } - case LE_STR8('s','t','r','e','a','m','i','d'): { - if (memcmp(rhs.elems+8,"x",1)==0) { value_SetEnum(parent,ams_FieldId_streamidx); ret = true; break; } + case LE_STR8('a','m','s','.','I','n','p','u'): { + if (memcmp(rhs.elems+8,"tLineMsg",8)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_InputLineMsg); ret = true; break; } break; } - case LE_STR8('w','r','i','t','e','_','e','r'): { - if (memcmp(rhs.elems+8,"r",1)==0) { value_SetEnum(parent,ams_FieldId_write_err); ret = true; break; } + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"StartMsg",8)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_ProcStartMsg); ret = true; break; } break; } - } - break; - } - case 10: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('t','r','a','c','e','_','r','e'): { - if (memcmp(rhs.elems+8,"ad",2)==0) { value_SetEnum(parent,ams_FieldId_trace_read); ret = true; break; } + case LE_STR8('a','m','s','.','T','e','r','m'): { + if (memcmp(rhs.elems+8,"inateMsg",8)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_TerminateMsg); ret = true; break; } break; } - case LE_STR8('t','r','a','c','e','_','t','e'): { - if (memcmp(rhs.elems+8,"xt",2)==0) { value_SetEnum(parent,ams_FieldId_trace_text); ret = true; break; } + case LE_STR8('w','s','.','S','e','r','v','e'): { + if (memcmp(rhs.elems+8,"rStopMsg",8)==0) { type_SetEnum(payload,ams_MsgHeader_type_ws_ServerStopMsg); ret = true; break; } break; } } break; } - case 11: { + case 17: { switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('s','t','r','e','a','m','_','t'): { - if (memcmp(rhs.elems+8,"ype",3)==0) { value_SetEnum(parent,ams_FieldId_stream_type); ret = true; break; } + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"StatusMsg",9)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_ProcStatusMsg); ret = true; break; } break; } - case LE_STR8('t','r','a','c','e','_','w','r'): { - if (memcmp(rhs.elems+8,"ite",3)==0) { value_SetEnum(parent,ams_FieldId_trace_write); ret = true; break; } + case LE_STR8('w','s','.','S','e','r','v','e'): { + if (memcmp(rhs.elems+8,"rStartMsg",9)==0) { type_SetEnum(payload,ams_MsgHeader_type_ws_ServerStartMsg); ret = true; break; } break; } } break; } - case 13: { + case 20: { switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('u','p','d','a','t','e','d','_'): { - if (memcmp(rhs.elems+8,"after",5)==0) { value_SetEnum(parent,ams_FieldId_updated_after); ret = true; break; } + case LE_STR8('a','m','s','.','R','e','m','D'): { + if (memcmp(rhs.elems+8,"irRecurseMsg",12)==0) { type_SetEnum(payload,ams_MsgHeader_type_ams_RemDirRecurseMsg); ret = true; break; } break; } } @@ -855,72 +1031,40 @@ bool ams::value_SetStrptrMaybe(ams::FieldId& parent, algo::strptr rhs) { return ret; } -// --- ams.FieldId.value.SetStrptr +// --- ams.MsgHeader.type.SetStrptr // Convert string to field. // If the string is invalid, set numeric value to DFLT -void ams::value_SetStrptr(ams::FieldId& parent, algo::strptr rhs, ams_FieldIdEnum dflt) { - if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +void ams::type_SetStrptr(ams::MsgHeader& payload, algo::strptr rhs, ams_MsgHeader_type_Enum dflt) { + if (!type_SetStrptrMaybe(payload,rhs)) type_SetEnum(payload,dflt); } -// --- ams.FieldId.value.ReadStrptrMaybe +// --- ams.MsgHeader.type.ReadStrptrMaybe // Convert string to field. Return success value -bool ams::value_ReadStrptrMaybe(ams::FieldId& parent, algo::strptr rhs) { +bool ams::type_ReadStrptrMaybe(ams::MsgHeader& payload, algo::strptr rhs) { bool retval = false; - retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + retval = type_SetStrptrMaybe(payload,rhs); // try symbol conversion if (!retval) { // didn't work? try reading as underlying type - retval = i32_ReadStrptrMaybe(parent.value,rhs); + retval = u32_ReadStrptrMaybe(payload.type,rhs); } return retval; } -// --- ams.FieldId..ReadStrptrMaybe -// Read fields of ams::FieldId from an ascii string. -// The format of the string is the format of the ams::FieldId's only field -bool ams::FieldId_ReadStrptrMaybe(ams::FieldId &parent, algo::strptr in_str) { - bool retval = true; - retval = retval && value_ReadStrptrMaybe(parent, in_str); - return retval; -} - -// --- ams.FieldId..Print -// print string representation of ROW to string STR -// cfmt:ams.FieldId.String printfmt:Raw -void ams::FieldId_Print(ams::FieldId& row, algo::cstring& str) { - ams::value_Print(row, str); -} - -// --- ams.HeartbeatMsg.base.CopyOut -// Copy fields out of row -void ams::parent_CopyOut(ams::HeartbeatMsg &row, ams::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter -} - -// --- ams.HeartbeatMsg..ReadFieldMaybe -bool ams::HeartbeatMsg_ReadFieldMaybe(ams::HeartbeatMsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.MsgHeader..ReadFieldMaybe +bool ams::MsgHeader_ReadFieldMaybe(ams::MsgHeader& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case ams_FieldId_base: { - retval = false; - break; - } case ams_FieldId_type: { - retval = false; - break; - } + retval = type_ReadStrptrMaybe(parent, strval); + } break; case ams_FieldId_length: { retval = false; - break; - } - case ams_FieldId_time: { - retval = algo::UnTime_ReadStrptrMaybe(parent.time, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -928,672 +1072,56 @@ bool ams::HeartbeatMsg_ReadFieldMaybe(ams::HeartbeatMsg& parent, algo::strptr fi return retval; } -// --- ams.HeartbeatMsg..ReadStrptrMaybe -// Read fields of ams::HeartbeatMsg from an ascii string. +// --- ams.MsgHeader..ReadStrptrMaybe +// Read fields of ams::MsgHeader from an ascii string. // The format of the string is an ssim Tuple -bool ams::HeartbeatMsg_ReadStrptrMaybe(ams::HeartbeatMsg &parent, algo::strptr in_str) { +bool ams::MsgHeader_ReadStrptrMaybe(ams::MsgHeader &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.HeartbeatMsg"); + retval = algo::StripTypeTag(in_str, "ams.MsgHeader"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && HeartbeatMsg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && MsgHeader_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- ams.HeartbeatMsg..Print +// --- ams.MsgHeader..Print // print string representation of ROW to string STR -// cfmt:ams.HeartbeatMsg.String printfmt:Tuple -void ams::HeartbeatMsg_Print(ams::HeartbeatMsg& row, algo::cstring& str) { +// cfmt:ams.MsgHeader.String printfmt:Tuple +void ams::MsgHeader_Print(ams::MsgHeader& row, algo::cstring& str) { algo::tempstr temp; - str << "ams.HeartbeatMsg"; - - algo::UnTime_Print(row.time, temp); - PrintAttrSpaceReset(str,"time", temp); -} - -// --- ams.InputLineMsg.base.CopyOut -// Copy fields out of row -void ams::parent_CopyOut(ams::InputLineMsg &row, ams::MsgHeader &out) { - // type: field value is computed - // length: field value is computed + str << "ams.MsgHeader"; (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter } -// --- ams.InputLineMsg.payload.Getary -// Access var-length portion as an aryptr. Length is determined from one of the fields. -algo::aryptr ams::payload_Getary(ams::InputLineMsg& parent) { - return algo::aryptr(payload_Addr(parent), payload_N(parent)); -} - -// --- ams.InputLineMsg.payload.Addr -char* ams::payload_Addr(ams::InputLineMsg& parent) { - return (char*)((u8*)&parent + sizeof(ams::InputLineMsg)); // address of varlen portion -} - -// --- ams.InputLineMsg.payload.ReadStrptrMaybe -// Convert string to field. Return success value -bool ams::payload_ReadStrptrMaybe(ams::InputLineMsg& parent, algo::strptr in_str) { - bool retval = true; - if (algo_lib::_db.varlenbuf) { - ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); - } - (void)parent;//only to avoid -Wunused-parameter - return retval; -} - -// --- ams.InputLineMsg.payload.Print -// Convert payload to a string. -// Array is printed as a regular string. -void ams::payload_Print(ams::InputLineMsg& parent, algo::cstring &rhs) { - rhs << payload_Getary(parent); -} - -// --- ams.InputLineMsg..ReadFieldMaybe -bool ams::InputLineMsg_ReadFieldMaybe(ams::InputLineMsg& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); - switch(field_id) { - case ams_FieldId_base: { - retval = false; - break; - } - case ams_FieldId_type: { - retval = false; - break; - } - case ams_FieldId_length: { - retval = false; - break; - } - case ams_FieldId_payload: { - retval = payload_ReadStrptrMaybe(parent, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- ams.InputLineMsg..ReadStrptrMaybe -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::InputLineMsg from an ascii string. -// The format of the string is an ssim Tuple -bool ams::InputLineMsg_ReadStrptrMaybe(ams::InputLineMsg &parent, algo::strptr in_str) { - bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.InputLineMsg"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && InputLineMsg_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; -} - -// --- ams.InputLineMsg..Print -// print string representation of ROW to string STR -// cfmt:ams.InputLineMsg.String printfmt:Tuple -void ams::InputLineMsg_Print(ams::InputLineMsg& row, algo::cstring& str) { - algo::tempstr temp; - str << "ams.InputLineMsg"; - - ams::payload_Print(row, temp); - PrintAttrSpaceReset(str,"payload", temp); -} - -// --- ams.LogMsg.base.CopyOut -// Copy fields out of row -void ams::parent_CopyOut(ams::LogMsg &row, ams::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter -} - -// --- ams.LogMsg.text.Getary -// Access var-length portion as an aryptr. Length is determined from one of the fields. -algo::aryptr ams::text_Getary(ams::LogMsg& parent) { - return algo::aryptr(text_Addr(parent), text_N(parent)); -} - -// --- ams.LogMsg.text.Addr -char* ams::text_Addr(ams::LogMsg& parent) { - return (char*)((u8*)&parent + sizeof(ams::LogMsg)); // address of varlen portion -} - -// --- ams.LogMsg.text.ReadStrptrMaybe -// Convert string to field. Return success value -bool ams::text_ReadStrptrMaybe(ams::LogMsg& parent, algo::strptr in_str) { - bool retval = true; - if (algo_lib::_db.varlenbuf) { - ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); - } - (void)parent;//only to avoid -Wunused-parameter - return retval; -} - -// --- ams.LogMsg.text.Print -// Convert text to a string. -// Array is printed as a regular string. -void ams::text_Print(ams::LogMsg& parent, algo::cstring &rhs) { - rhs << text_Getary(parent); -} - -// --- ams.LogMsg..ReadFieldMaybe -bool ams::LogMsg_ReadFieldMaybe(ams::LogMsg& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); - switch(field_id) { - case ams_FieldId_base: { - retval = false; - break; - } - case ams_FieldId_type: { - retval = false; - break; - } - case ams_FieldId_length: { - retval = false; - break; - } - case ams_FieldId_logcat: { - retval = algo::RnullStr50_ReadStrptrMaybe(parent.logcat, strval); - break; - } - case ams_FieldId_tstamp: { - retval = algo::SchedTime_ReadStrptrMaybe(parent.tstamp, strval); - break; - } - case ams_FieldId_text: { - retval = text_ReadStrptrMaybe(parent, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- ams.LogMsg..ReadStrptrMaybe -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::LogMsg from an ascii string. -// The format of the string is an ssim Tuple -bool ams::LogMsg_ReadStrptrMaybe(ams::LogMsg &parent, algo::strptr in_str) { - bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.LogMsg"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && LogMsg_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; -} - -// --- ams.LogMsg..Print -// print string representation of ROW to string STR -// cfmt:ams.LogMsg.String printfmt:Tuple -void ams::LogMsg_Print(ams::LogMsg& row, algo::cstring& str) { - algo::tempstr temp; - str << "ams.LogMsg"; - - algo::RnullStr50_Print(row.logcat, temp); - PrintAttrSpaceReset(str,"logcat", temp); - - algo::SchedTime_Print(row.tstamp, temp); - PrintAttrSpaceReset(str,"tstamp", temp); - - ams::text_Print(row, temp); - PrintAttrSpaceReset(str,"text", temp); -} - -// --- ams.Member.mode.ToCstr -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -const char* ams::mode_ToCstr(const ams::Member& parent) { - const char *ret = NULL; - switch(mode_GetEnum(parent)) { - case ams_Member_mode_r : ret = "r"; break; - case ams_Member_mode_w : ret = "w"; break; - } - return ret; -} - -// --- ams.Member.mode.Print -// Convert mode to a string. First, attempt conversion to a known string. -// If no string matches, print mode as a numeric value. -void ams::mode_Print(const ams::Member& parent, algo::cstring &lhs) { - const char *strval = mode_ToCstr(parent); - if (strval) { - lhs << strval; - } else { - lhs << parent.mode; - } -} - -// --- ams.Member.mode.SetStrptrMaybe -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -bool ams::mode_SetStrptrMaybe(ams::Member& parent, algo::strptr rhs) { - bool ret = false; - switch (elems_N(rhs)) { - case 1: { - switch (u64(rhs[0])) { - case 'r': { - mode_SetEnum(parent,ams_Member_mode_r); ret = true; break; - } - case 'w': { - mode_SetEnum(parent,ams_Member_mode_w); ret = true; break; - } - } - break; - } - } - return ret; -} - -// --- ams.Member.mode.SetStrptr -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -void ams::mode_SetStrptr(ams::Member& parent, algo::strptr rhs, ams_Member_mode_Enum dflt) { - if (!mode_SetStrptrMaybe(parent,rhs)) mode_SetEnum(parent,dflt); -} - -// --- ams.Member.mode.ReadStrptrMaybe -// Convert string to field. Return success value -bool ams::mode_ReadStrptrMaybe(ams::Member& parent, algo::strptr rhs) { - bool retval = false; - retval = mode_SetStrptrMaybe(parent,rhs); // try symbol conversion - if (!retval) { // didn't work? try reading as underlying type - retval = u8_ReadStrptrMaybe(parent.mode,rhs); - } - return retval; -} - -// --- ams.Member..ReadFieldMaybe -bool ams::Member_ReadFieldMaybe(ams::Member& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case ams_FieldId_proc_id: { - retval = ams::ProcId_ReadStrptrMaybe(parent.proc_id, strval); - break; - } - case ams_FieldId_stream_id: { - retval = ams::StreamId_ReadStrptrMaybe(parent.stream_id, strval); - break; - } - case ams_FieldId_mode: { - retval = mode_ReadStrptrMaybe(parent, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- ams.Member..ReadStrptrMaybe -// Read fields of ams::Member from an ascii string. -// The format of the string is a string with separated values -bool ams::Member_ReadStrptrMaybe(ams::Member &parent, algo::strptr in_str) { - bool retval = true; - algo::strptr value; - - algo::NextSep(in_str, '/', value); - retval = retval && ams::ProcId_ReadStrptrMaybe(parent.proc_id, value); - - algo::NextSep(in_str, ',', value); - retval = retval && ams::StreamId_ReadStrptrMaybe(parent.stream_id, value); - - value = in_str; - retval = retval && mode_ReadStrptrMaybe(parent, value); - return retval; -} - -// --- ams.Member..Print -// print string representation of ROW to string STR -// cfmt:ams.Member.String printfmt:Sep -void ams::Member_Print(ams::Member row, algo::cstring& str) { - ams::ProcId_Print(row.proc_id, str); - str << '/'; - ams::StreamId_Print(row.stream_id, str); - str << ','; - ams::mode_Print(row, str); -} - -// --- ams.MsgBlock.header.CopyOut -// Copy fields out of row -void ams::parent_CopyOut(ams::MsgBlock &row, ams::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter -} - -// --- ams.MsgBlock.messages.Getary -// Access var-length portion as an aryptr. Length is determined from one of the fields. -algo::aryptr ams::messages_Getary(ams::MsgBlock& parent) { - return algo::aryptr(messages_Addr(parent), messages_N(parent)); -} - -// --- ams.MsgBlock.messages.Addr -u8* ams::messages_Addr(ams::MsgBlock& parent) { - return (u8*)((u8*)&parent + sizeof(ams::MsgBlock)); // address of varlen portion -} - -// --- ams.MsgBlock.messages.Print -// Convert messages to a string. -// Array is printed as a regular string. -void ams::messages_Print(ams::MsgBlock& parent, algo::cstring &rhs) { - rhs << algo::memptr_ToStrptr(messages_Getary(parent)); -} - -// --- ams.MsgBlock..Print -// print string representation of ROW to string STR -// cfmt:ams.MsgBlock.String printfmt:Tuple -void ams::MsgBlock_Print(ams::MsgBlock& row, algo::cstring& str) { - algo::tempstr temp; - str << "ams.MsgBlock"; - - u64_Print(row.first_seqno, temp); - PrintAttrSpaceReset(str,"first_seqno", temp); - - u32_Print(row.n_messages, temp); - PrintAttrSpaceReset(str,"n_messages", temp); - - u32_Print(row.original_length, temp); - PrintAttrSpaceReset(str,"original_length", temp); - - ams::messages_Print(row, temp); - PrintAttrSpaceReset(str,"messages", temp); -} - -// --- ams.MsgHeader.type.ToCstr -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -const char* ams::type_ToCstr(const ams::MsgHeader& data) { - const char *ret = NULL; - switch(type_GetEnum(data)) { - case ams_MsgHeader_type_ams_AlarmSyncMsg: ret = "ams.AlarmSyncMsg"; break; - case ams_MsgHeader_type_ams_DfltStream: ret = "ams.DfltStream"; break; - case ams_MsgHeader_type_ams_DumpStreamTableMsg: ret = "ams.DumpStreamTableMsg"; break; - case ams_MsgHeader_type_ams_ExpectMsg: ret = "ams.ExpectMsg"; break; - case ams_MsgHeader_type_ams_HeartbeatMsg: ret = "ams.HeartbeatMsg"; break; - case ams_MsgHeader_type_ams_InputLineMsg: ret = "ams.InputLineMsg"; break; - case ams_MsgHeader_type_ams_LogMsg : ret = "ams.LogMsg"; break; - case ams_MsgHeader_type_ams_MsgBlock: ret = "ams.MsgBlock"; break; - case ams_MsgHeader_type_ams_OpenMsg: ret = "ams.OpenMsg"; break; - case ams_MsgHeader_type_ams_PrlogMsg: ret = "ams.PrlogMsg"; break; - case ams_MsgHeader_type_ams_ProcAddMsg: ret = "ams.ProcAddMsg"; break; - case ams_MsgHeader_type_ams_ProcRemoveMsg: ret = "ams.ProcRemoveMsg"; break; - case ams_MsgHeader_type_ams_Seqmsg : ret = "ams.Seqmsg"; break; - case ams_MsgHeader_type_ams_SeqmsgTrace: ret = "ams.SeqmsgTrace"; break; - case ams_MsgHeader_type_ams_StreamHbMsg: ret = "ams.StreamHbMsg"; break; - case ams_MsgHeader_type_ams_TerminateMsg: ret = "ams.TerminateMsg"; break; - case ams_MsgHeader_type_ams_Trace2Msg: ret = "ams.Trace2Msg"; break; - case ams_MsgHeader_type_ams_TraceInfo2Msg: ret = "ams.TraceInfo2Msg"; break; - case ams_MsgHeader_type_ams_TraceInfoMsg: ret = "ams.TraceInfoMsg"; break; - case ams_MsgHeader_type_ams_TraceMsg: ret = "ams.TraceMsg"; break; - case ams_MsgHeader_type_ams_UdpFrame: ret = "ams.UdpFrame"; break; - case ams_MsgHeader_type_fm_AlarmMsg: ret = "fm.AlarmMsg"; break; - } - return ret; -} - -// --- ams.MsgHeader.type.Print -// Convert type to a string. First, attempt conversion to a known string. -// If no string matches, print type as a numeric value. -void ams::type_Print(const ams::MsgHeader& data, algo::cstring &lhs) { - const char *strval = type_ToCstr(data); - if (strval) { - lhs << strval; - } else { - lhs << data.type; - } -} - -// --- ams.MsgHeader.type.SetStrptrMaybe -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -bool ams::type_SetStrptrMaybe(ams::MsgHeader& data, algo::strptr rhs) { - bool ret = false; - switch (elems_N(rhs)) { - case 10: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','L','o','g','M'): { - if (memcmp(rhs.elems+8,"sg",2)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_LogMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','S','e','q','m'): { - if (memcmp(rhs.elems+8,"sg",2)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_Seqmsg); ret = true; break; } - break; - } - } - break; - } - case 11: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','O','p','e','n'): { - if (memcmp(rhs.elems+8,"Msg",3)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_OpenMsg); ret = true; break; } - break; - } - case LE_STR8('f','m','.','A','l','a','r','m'): { - if (memcmp(rhs.elems+8,"Msg",3)==0) { type_SetEnum(data,ams_MsgHeader_type_fm_AlarmMsg); ret = true; break; } - break; - } - } - break; - } - case 12: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','M','s','g','B'): { - if (memcmp(rhs.elems+8,"lock",4)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_MsgBlock); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','P','r','l','o'): { - if (memcmp(rhs.elems+8,"gMsg",4)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_PrlogMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','T','r','a','c'): { - if (memcmp(rhs.elems+8,"eMsg",4)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_TraceMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','U','d','p','F'): { - if (memcmp(rhs.elems+8,"rame",4)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_UdpFrame); ret = true; break; } - break; - } - } - break; - } - case 13: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','E','x','p','e'): { - if (memcmp(rhs.elems+8,"ctMsg",5)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_ExpectMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','T','r','a','c'): { - if (memcmp(rhs.elems+8,"e2Msg",5)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_Trace2Msg); ret = true; break; } - break; - } - } - break; - } - case 14: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','D','f','l','t'): { - if (memcmp(rhs.elems+8,"Stream",6)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_DfltStream); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','P','r','o','c'): { - if (memcmp(rhs.elems+8,"AddMsg",6)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_ProcAddMsg); ret = true; break; } - break; - } - } - break; - } - case 15: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','S','e','q','m'): { - if (memcmp(rhs.elems+8,"sgTrace",7)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_SeqmsgTrace); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','S','t','r','e'): { - if (memcmp(rhs.elems+8,"amHbMsg",7)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_StreamHbMsg); ret = true; break; } - break; - } - } - break; - } - case 16: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','A','l','a','r'): { - if (memcmp(rhs.elems+8,"mSyncMsg",8)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_AlarmSyncMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','H','e','a','r'): { - if (memcmp(rhs.elems+8,"tbeatMsg",8)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_HeartbeatMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','I','n','p','u'): { - if (memcmp(rhs.elems+8,"tLineMsg",8)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_InputLineMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','T','e','r','m'): { - if (memcmp(rhs.elems+8,"inateMsg",8)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_TerminateMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','T','r','a','c'): { - if (memcmp(rhs.elems+8,"eInfoMsg",8)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_TraceInfoMsg); ret = true; break; } - break; - } - } - break; - } - case 17: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','P','r','o','c'): { - if (memcmp(rhs.elems+8,"RemoveMsg",9)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_ProcRemoveMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','T','r','a','c'): { - if (memcmp(rhs.elems+8,"eInfo2Msg",9)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_TraceInfo2Msg); ret = true; break; } - break; - } - } - break; - } - case 22: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','D','u','m','p'): { - if (memcmp(rhs.elems+8,"StreamTableMsg",14)==0) { type_SetEnum(data,ams_MsgHeader_type_ams_DumpStreamTableMsg); ret = true; break; } - break; - } - } - break; - } - } - return ret; -} - -// --- ams.MsgHeader.type.SetStrptr -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -void ams::type_SetStrptr(ams::MsgHeader& data, algo::strptr rhs, ams_MsgHeader_type_Enum dflt) { - if (!type_SetStrptrMaybe(data,rhs)) type_SetEnum(data,dflt); -} - -// --- ams.MsgHeader.type.ReadStrptrMaybe -// Convert string to field. Return success value -bool ams::type_ReadStrptrMaybe(ams::MsgHeader& data, algo::strptr rhs) { - bool retval = false; - retval = type_SetStrptrMaybe(data,rhs); // try symbol conversion - if (!retval) { // didn't work? try reading as underlying type - retval = u32_ReadStrptrMaybe(data.type,rhs); - } - return retval; -} - -// --- ams.MsgHeader..ReadFieldMaybe -bool ams::MsgHeader_ReadFieldMaybe(ams::MsgHeader& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case ams_FieldId_type: { - retval = type_ReadStrptrMaybe(parent, strval); - break; - } - case ams_FieldId_length: { - retval = false; - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- ams.MsgHeader..ReadStrptrMaybe -// Read fields of ams::MsgHeader from an ascii string. -// The format of the string is an ssim Tuple -bool ams::MsgHeader_ReadStrptrMaybe(ams::MsgHeader &parent, algo::strptr in_str) { - bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.MsgHeader"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && MsgHeader_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; -} - -// --- ams.MsgHeader..Print -// print string representation of ROW to string STR -// cfmt:ams.MsgHeader.String printfmt:Tuple -void ams::MsgHeader_Print(ams::MsgHeader& row, algo::cstring& str) { - algo::tempstr temp; - str << "ams.MsgHeader"; - (void)row;//only to avoid -Wunused-parameter -} - -// --- ams.MsgHeaderMsgsCase.value.ToCstr -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -const char* ams::value_ToCstr(const ams::MsgHeaderMsgsCase& parent) { - const char *ret = NULL; - switch(value_GetEnum(parent)) { - case ams_MsgHeaderMsgsCase_ams_AlarmSyncMsg: ret = "ams.AlarmSyncMsg"; break; - case ams_MsgHeaderMsgsCase_ams_DfltStream: ret = "ams.DfltStream"; break; - case ams_MsgHeaderMsgsCase_ams_DumpStreamTableMsg: ret = "ams.DumpStreamTableMsg"; break; - case ams_MsgHeaderMsgsCase_ams_ExpectMsg: ret = "ams.ExpectMsg"; break; - case ams_MsgHeaderMsgsCase_ams_HeartbeatMsg: ret = "ams.HeartbeatMsg"; break; - case ams_MsgHeaderMsgsCase_ams_InputLineMsg: ret = "ams.InputLineMsg"; break; - case ams_MsgHeaderMsgsCase_ams_LogMsg: ret = "ams.LogMsg"; break; - case ams_MsgHeaderMsgsCase_ams_MsgBlock: ret = "ams.MsgBlock"; break; - case ams_MsgHeaderMsgsCase_ams_OpenMsg: ret = "ams.OpenMsg"; break; - case ams_MsgHeaderMsgsCase_ams_PrlogMsg: ret = "ams.PrlogMsg"; break; - case ams_MsgHeaderMsgsCase_ams_ProcAddMsg: ret = "ams.ProcAddMsg"; break; - case ams_MsgHeaderMsgsCase_ams_ProcRemoveMsg: ret = "ams.ProcRemoveMsg"; break; - case ams_MsgHeaderMsgsCase_ams_Seqmsg: ret = "ams.Seqmsg"; break; - case ams_MsgHeaderMsgsCase_ams_SeqmsgTrace: ret = "ams.SeqmsgTrace"; break; - case ams_MsgHeaderMsgsCase_ams_StreamHbMsg: ret = "ams.StreamHbMsg"; break; - case ams_MsgHeaderMsgsCase_ams_TerminateMsg: ret = "ams.TerminateMsg"; break; - case ams_MsgHeaderMsgsCase_ams_Trace2Msg: ret = "ams.Trace2Msg"; break; - case ams_MsgHeaderMsgsCase_ams_TraceInfo2Msg: ret = "ams.TraceInfo2Msg"; break; - case ams_MsgHeaderMsgsCase_ams_TraceInfoMsg: ret = "ams.TraceInfoMsg"; break; - case ams_MsgHeaderMsgsCase_ams_TraceMsg: ret = "ams.TraceMsg"; break; - case ams_MsgHeaderMsgsCase_ams_UdpFrame: ret = "ams.UdpFrame"; break; - case ams_MsgHeaderMsgsCase_fm_AlarmMsg: ret = "fm.AlarmMsg"; break; - } - return ret; +// --- ams.MsgHeaderMsgsCase.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* ams::value_ToCstr(const ams::MsgHeaderMsgsCase& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case ams_MsgHeaderMsgsCase_ams_ExpectMsg: ret = "ams.ExpectMsg"; break; + case ams_MsgHeaderMsgsCase_ams_InputLineMsg: ret = "ams.InputLineMsg"; break; + case ams_MsgHeaderMsgsCase_ams_LogMsg: ret = "ams.LogMsg"; break; + case ams_MsgHeaderMsgsCase_ams_MsgBlock: ret = "ams.MsgBlock"; break; + case ams_MsgHeaderMsgsCase_ams_ProcEofMsg: ret = "ams.ProcEofMsg"; break; + case ams_MsgHeaderMsgsCase_ams_ProcKillMsg: ret = "ams.ProcKillMsg"; break; + case ams_MsgHeaderMsgsCase_ams_ProcMsg: ret = "ams.ProcMsg"; break; + case ams_MsgHeaderMsgsCase_ams_ProcReadMsg: ret = "ams.ProcReadMsg"; break; + case ams_MsgHeaderMsgsCase_ams_ProcStartMsg: ret = "ams.ProcStartMsg"; break; + case ams_MsgHeaderMsgsCase_ams_ProcStatusMsg: ret = "ams.ProcStatusMsg"; break; + case ams_MsgHeaderMsgsCase_ams_RemDirRecurseMsg: ret = "ams.RemDirRecurseMsg"; break; + case ams_MsgHeaderMsgsCase_ams_ShmHbMsg: ret = "ams.ShmHbMsg"; break; + case ams_MsgHeaderMsgsCase_ams_Shmmsg: ret = "ams.Shmmsg"; break; + case ams_MsgHeaderMsgsCase_ams_TerminateMsg: ret = "ams.TerminateMsg"; break; + case ams_MsgHeaderMsgsCase_ams_UdpFrame: ret = "ams.UdpFrame"; break; + case ams_MsgHeaderMsgsCase_fm_AlarmMsg: ret = "fm.AlarmMsg"; break; + case ams_MsgHeaderMsgsCase_ws_CloseMsg: ret = "ws.CloseMsg"; break; + case ams_MsgHeaderMsgsCase_ws_ConnectMsg: ret = "ws.ConnectMsg"; break; + case ams_MsgHeaderMsgsCase_ws_DataMsg: ret = "ws.DataMsg"; break; + case ams_MsgHeaderMsgsCase_ws_ServerStartMsg: ret = "ws.ServerStartMsg"; break; + case ams_MsgHeaderMsgsCase_ws_ServerStopMsg: ret = "ws.ServerStopMsg"; break; + } + return ret; } // --- ams.MsgHeaderMsgsCase.value.Print @@ -1621,8 +1149,12 @@ bool ams::value_SetStrptrMaybe(ams::MsgHeaderMsgsCase& parent, algo::strptr rhs) if (memcmp(rhs.elems+8,"sg",2)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_LogMsg); ret = true; break; } break; } - case LE_STR8('a','m','s','.','S','e','q','m'): { - if (memcmp(rhs.elems+8,"sg",2)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_Seqmsg); ret = true; break; } + case LE_STR8('a','m','s','.','S','h','m','m'): { + if (memcmp(rhs.elems+8,"sg",2)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_Shmmsg); ret = true; break; } + break; + } + case LE_STR8('w','s','.','D','a','t','a','M'): { + if (memcmp(rhs.elems+8,"sg",2)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ws_DataMsg); ret = true; break; } break; } } @@ -1630,14 +1162,18 @@ bool ams::value_SetStrptrMaybe(ams::MsgHeaderMsgsCase& parent, algo::strptr rhs) } case 11: { switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','O','p','e','n'): { - if (memcmp(rhs.elems+8,"Msg",3)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_OpenMsg); ret = true; break; } + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"Msg",3)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_ProcMsg); ret = true; break; } break; } case LE_STR8('f','m','.','A','l','a','r','m'): { if (memcmp(rhs.elems+8,"Msg",3)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_fm_AlarmMsg); ret = true; break; } break; } + case LE_STR8('w','s','.','C','l','o','s','e'): { + if (memcmp(rhs.elems+8,"Msg",3)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ws_CloseMsg); ret = true; break; } + break; + } } break; } @@ -1647,12 +1183,8 @@ bool ams::value_SetStrptrMaybe(ams::MsgHeaderMsgsCase& parent, algo::strptr rhs) if (memcmp(rhs.elems+8,"lock",4)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_MsgBlock); ret = true; break; } break; } - case LE_STR8('a','m','s','.','P','r','l','o'): { - if (memcmp(rhs.elems+8,"gMsg",4)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_PrlogMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','T','r','a','c'): { - if (memcmp(rhs.elems+8,"eMsg",4)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_TraceMsg); ret = true; break; } + case LE_STR8('a','m','s','.','S','h','m','H'): { + if (memcmp(rhs.elems+8,"bMsg",4)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_ShmHbMsg); ret = true; break; } break; } case LE_STR8('a','m','s','.','U','d','p','F'): { @@ -1668,8 +1200,8 @@ bool ams::value_SetStrptrMaybe(ams::MsgHeaderMsgsCase& parent, algo::strptr rhs) if (memcmp(rhs.elems+8,"ctMsg",5)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_ExpectMsg); ret = true; break; } break; } - case LE_STR8('a','m','s','.','T','r','a','c'): { - if (memcmp(rhs.elems+8,"e2Msg",5)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_Trace2Msg); ret = true; break; } + case LE_STR8('w','s','.','C','o','n','n','e'): { + if (memcmp(rhs.elems+8,"ctMsg",5)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ws_ConnectMsg); ret = true; break; } break; } } @@ -1677,12 +1209,8 @@ bool ams::value_SetStrptrMaybe(ams::MsgHeaderMsgsCase& parent, algo::strptr rhs) } case 14: { switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','D','f','l','t'): { - if (memcmp(rhs.elems+8,"Stream",6)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_DfltStream); ret = true; break; } - break; - } case LE_STR8('a','m','s','.','P','r','o','c'): { - if (memcmp(rhs.elems+8,"AddMsg",6)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_ProcAddMsg); ret = true; break; } + if (memcmp(rhs.elems+8,"EofMsg",6)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_ProcEofMsg); ret = true; break; } break; } } @@ -1690,12 +1218,9 @@ bool ams::value_SetStrptrMaybe(ams::MsgHeaderMsgsCase& parent, algo::strptr rhs) } case 15: { switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','S','e','q','m'): { - if (memcmp(rhs.elems+8,"sgTrace",7)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_SeqmsgTrace); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','S','t','r','e'): { - if (memcmp(rhs.elems+8,"amHbMsg",7)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_StreamHbMsg); ret = true; break; } + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"KillMsg",7)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_ProcKillMsg); ret = true; break; } + if (memcmp(rhs.elems+8,"ReadMsg",7)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_ProcReadMsg); ret = true; break; } break; } } @@ -1703,24 +1228,20 @@ bool ams::value_SetStrptrMaybe(ams::MsgHeaderMsgsCase& parent, algo::strptr rhs) } case 16: { switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','A','l','a','r'): { - if (memcmp(rhs.elems+8,"mSyncMsg",8)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_AlarmSyncMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','H','e','a','r'): { - if (memcmp(rhs.elems+8,"tbeatMsg",8)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_HeartbeatMsg); ret = true; break; } - break; - } case LE_STR8('a','m','s','.','I','n','p','u'): { if (memcmp(rhs.elems+8,"tLineMsg",8)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_InputLineMsg); ret = true; break; } break; } + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"StartMsg",8)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_ProcStartMsg); ret = true; break; } + break; + } case LE_STR8('a','m','s','.','T','e','r','m'): { if (memcmp(rhs.elems+8,"inateMsg",8)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_TerminateMsg); ret = true; break; } break; } - case LE_STR8('a','m','s','.','T','r','a','c'): { - if (memcmp(rhs.elems+8,"eInfoMsg",8)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_TraceInfoMsg); ret = true; break; } + case LE_STR8('w','s','.','S','e','r','v','e'): { + if (memcmp(rhs.elems+8,"rStopMsg",8)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ws_ServerStopMsg); ret = true; break; } break; } } @@ -1729,20 +1250,20 @@ bool ams::value_SetStrptrMaybe(ams::MsgHeaderMsgsCase& parent, algo::strptr rhs) case 17: { switch (algo::ReadLE64(rhs.elems)) { case LE_STR8('a','m','s','.','P','r','o','c'): { - if (memcmp(rhs.elems+8,"RemoveMsg",9)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_ProcRemoveMsg); ret = true; break; } + if (memcmp(rhs.elems+8,"StatusMsg",9)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_ProcStatusMsg); ret = true; break; } break; } - case LE_STR8('a','m','s','.','T','r','a','c'): { - if (memcmp(rhs.elems+8,"eInfo2Msg",9)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_TraceInfo2Msg); ret = true; break; } + case LE_STR8('w','s','.','S','e','r','v','e'): { + if (memcmp(rhs.elems+8,"rStartMsg",9)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ws_ServerStartMsg); ret = true; break; } break; } } break; } - case 22: { + case 20: { switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','D','u','m','p'): { - if (memcmp(rhs.elems+8,"StreamTableMsg",14)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_DumpStreamTableMsg); ret = true; break; } + case LE_STR8('a','m','s','.','R','e','m','D'): { + if (memcmp(rhs.elems+8,"irRecurseMsg",12)==0) { value_SetEnum(parent,ams_MsgHeaderMsgsCase_ams_RemDirRecurseMsg); ret = true; break; } break; } } @@ -1770,30 +1291,110 @@ bool ams::value_ReadStrptrMaybe(ams::MsgHeaderMsgsCase& parent, algo::strptr rhs return retval; } -// --- ams.MsgHeaderMsgsCase..ReadStrptrMaybe -// Read fields of ams::MsgHeaderMsgsCase from an ascii string. -// The format of the string is the format of the ams::MsgHeaderMsgsCase's only field -bool ams::MsgHeaderMsgsCase_ReadStrptrMaybe(ams::MsgHeaderMsgsCase &parent, algo::strptr in_str) { +// --- ams.MsgHeaderMsgsCase..ReadStrptrMaybe +// Read fields of ams::MsgHeaderMsgsCase from an ascii string. +// The format of the string is the format of the ams::MsgHeaderMsgsCase's only field +bool ams::MsgHeaderMsgsCase_ReadStrptrMaybe(ams::MsgHeaderMsgsCase &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- ams.ProcEofMsg.base.CopyOut +// Copy fields out of row +void ams::parent_CopyOut(ams::ProcEofMsg &row, ams::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter +} + +// --- ams.ProcEofMsg..ReadFieldMaybe +bool ams::ProcEofMsg_ReadFieldMaybe(ams::ProcEofMsg& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ams::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case ams_FieldId_base: { + retval = false; + } break; + case ams_FieldId_type: { + retval = false; + } break; + case ams_FieldId_length: { + retval = false; + } break; + case ams_FieldId_proc: { + retval = algo::RnullStr50_ReadStrptrMaybe(parent.proc, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ams.ProcEofMsg..ReadStrptrMaybe +// Read fields of ams::ProcEofMsg from an ascii string. +// The format of the string is an ssim Tuple +bool ams::ProcEofMsg_ReadStrptrMaybe(ams::ProcEofMsg &parent, algo::strptr in_str) { bool retval = true; - retval = retval && value_ReadStrptrMaybe(parent, in_str); + retval = algo::StripTypeTag(in_str, "ams.ProcEofMsg"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && ProcEofMsg_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; return retval; } -// --- ams.StreamPos..ReadFieldMaybe -bool ams::StreamPos_ReadFieldMaybe(ams::StreamPos& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ProcEofMsg..Print +// print string representation of ROW to string STR +// cfmt:ams.ProcEofMsg.String printfmt:Tuple +void ams::ProcEofMsg_Print(ams::ProcEofMsg& row, algo::cstring& str) { + algo::tempstr temp; + str << "ams.ProcEofMsg"; + + algo::RnullStr50_Print(row.proc, temp); + PrintAttrSpaceReset(str,"proc", temp); +} + +// --- ams.ProcKillMsg.base.CopyOut +// Copy fields out of row +void ams::parent_CopyOut(ams::ProcKillMsg &row, ams::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter +} + +// --- ams.ProcKillMsg..ReadFieldMaybe +bool ams::ProcKillMsg_ReadFieldMaybe(ams::ProcKillMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case ams_FieldId_seq: { - retval = u64_ReadStrptrMaybe(parent.seq, strval); - break; - } - case ams_FieldId_off: { - retval = u64_ReadStrptrMaybe(parent.off, strval); - break; - } - default: break; + case ams_FieldId_base: { + retval = false; + } break; + case ams_FieldId_type: { + retval = false; + } break; + case ams_FieldId_length: { + retval = false; + } break; + case ams_FieldId_proc: { + retval = algo::RnullStr50_ReadStrptrMaybe(parent.proc, strval); + } break; + case ams_FieldId_signal: { + retval = i32_ReadStrptrMaybe(parent.signal, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1801,66 +1402,95 @@ bool ams::StreamPos_ReadFieldMaybe(ams::StreamPos& parent, algo::strptr field, a return retval; } -// --- ams.StreamPos..ReadStrptrMaybe -// Read fields of ams::StreamPos from an ascii string. -// The format of the string is a string with separated values -bool ams::StreamPos_ReadStrptrMaybe(ams::StreamPos &parent, algo::strptr in_str) { +// --- ams.ProcKillMsg..ReadStrptrMaybe +// Read fields of ams::ProcKillMsg from an ascii string. +// The format of the string is an ssim Tuple +bool ams::ProcKillMsg_ReadStrptrMaybe(ams::ProcKillMsg &parent, algo::strptr in_str) { bool retval = true; - algo::strptr value; - - algo::NextSep(in_str, ',', value); - retval = retval && u64_ReadStrptrMaybe(parent.seq, value); - - value = in_str; - retval = retval && u64_ReadStrptrMaybe(parent.off, value); + retval = algo::StripTypeTag(in_str, "ams.ProcKillMsg"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && ProcKillMsg_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; return retval; } -// --- ams.StreamPos..Print +// --- ams.ProcKillMsg..Print // print string representation of ROW to string STR -// cfmt:ams.StreamPos.String printfmt:Sep -void ams::StreamPos_Print(ams::StreamPos row, algo::cstring& str) { - u64_Print(row.seq, str); - str << ','; - u64_Print(row.off, str); +// cfmt:ams.ProcKillMsg.String printfmt:Tuple +void ams::ProcKillMsg_Print(ams::ProcKillMsg& row, algo::cstring& str) { + algo::tempstr temp; + str << "ams.ProcKillMsg"; + + algo::RnullStr50_Print(row.proc, temp); + PrintAttrSpaceReset(str,"proc", temp); + + i32_Print(row.signal, temp); + PrintAttrSpaceReset(str,"signal", temp); } -// --- ams.OpenMsg.base.CopyOut +// --- ams.ProcMsg.base.CopyOut // Copy fields out of row -void ams::parent_CopyOut(ams::OpenMsg &row, ams::MsgHeader &out) { +void ams::parent_CopyOut(ams::ProcMsg &row, ams::MsgHeader &out) { // type: field value is computed // length: field value is computed (void)row;//only to avoid -Wunused-parameter (void)out;//only to avoid -Wunused-parameter } -// --- ams.OpenMsg..ReadFieldMaybe -bool ams::OpenMsg_ReadFieldMaybe(ams::OpenMsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ProcMsg.payload.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ams::payload_Getary(ams::ProcMsg& parent) { + return algo::aryptr(payload_Addr(parent), payload_N(parent)); +} + +// --- ams.ProcMsg.payload.Addr +char* ams::payload_Addr(ams::ProcMsg& parent) { + return (char*)((u8*)&parent + sizeof(ams::ProcMsg)); // address of varlen portion +} + +// --- ams.ProcMsg.payload.ReadStrptrMaybe +// Convert string to field. Return success value +bool ams::payload_ReadStrptrMaybe(ams::ProcMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- ams.ProcMsg.payload.Print +// Convert payload to a string. +// Array is printed as a regular string. +void ams::payload_Print(ams::ProcMsg& parent, algo::cstring &rhs) { + rhs << payload_Getary(parent); +} + +// --- ams.ProcMsg..ReadFieldMaybe +bool ams::ProcMsg_ReadFieldMaybe(ams::ProcMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { case ams_FieldId_base: { retval = false; - break; - } + } break; case ams_FieldId_type: { retval = false; - break; - } + } break; case ams_FieldId_length: { retval = false; - break; - } - case ams_FieldId_member: { - retval = ams::Member_ReadStrptrMaybe(parent.member, strval); - break; - } - case ams_FieldId_pos: { - retval = ams::StreamPos_ReadStrptrMaybe(parent.pos, strval); - break; - } - default: break; + } break; + case ams_FieldId_proc: { + retval = algo::RnullStr50_ReadStrptrMaybe(parent.proc, strval); + } break; + case ams_FieldId_payload: { + retval = payload_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1868,101 +1498,96 @@ bool ams::OpenMsg_ReadFieldMaybe(ams::OpenMsg& parent, algo::strptr field, algo: return retval; } -// --- ams.OpenMsg..ReadStrptrMaybe -// Read fields of ams::OpenMsg from an ascii string. +// --- ams.ProcMsg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ams::ProcMsg from an ascii string. // The format of the string is an ssim Tuple -bool ams::OpenMsg_ReadStrptrMaybe(ams::OpenMsg &parent, algo::strptr in_str) { +bool ams::ProcMsg_ReadStrptrMaybe(ams::ProcMsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.OpenMsg"); + retval = algo::StripTypeTag(in_str, "ams.ProcMsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && OpenMsg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && ProcMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- ams.OpenMsg..Print +// --- ams.ProcMsg..Print // print string representation of ROW to string STR -// cfmt:ams.OpenMsg.String printfmt:Tuple -void ams::OpenMsg_Print(ams::OpenMsg& row, algo::cstring& str) { +// cfmt:ams.ProcMsg.String printfmt:Tuple +void ams::ProcMsg_Print(ams::ProcMsg& row, algo::cstring& str) { algo::tempstr temp; - str << "ams.OpenMsg"; + str << "ams.ProcMsg"; - ams::Member_Print(row.member, temp); - PrintAttrSpaceReset(str,"member", temp); + algo::RnullStr50_Print(row.proc, temp); + PrintAttrSpaceReset(str,"proc", temp); - ams::StreamPos_Print(row.pos, temp); - PrintAttrSpaceReset(str,"pos", temp); + ams::payload_Print(row, temp); + PrintAttrSpaceReset(str,"payload", temp); } -// --- ams.PrlogMsg.base.CopyOut +// --- ams.ProcReadMsg.base.CopyOut // Copy fields out of row -void ams::parent_CopyOut(ams::PrlogMsg &row, ams::MsgHeader &out) { +void ams::parent_CopyOut(ams::ProcReadMsg &row, ams::MsgHeader &out) { // type: field value is computed // length: field value is computed (void)row;//only to avoid -Wunused-parameter (void)out;//only to avoid -Wunused-parameter } -// --- ams.PrlogMsg.data.Getary -// Access optional portion as an array of bytes -algo::aryptr ams::data_Getary(ams::PrlogMsg& parent) { - u8 *end = (u8*)&parent + sizeof(ams::PrlogMsg); - return algo::aryptr(end, i32(parent.length) - ssizeof(ams::PrlogMsg)); +// --- ams.ProcReadMsg.until.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ams::until_Getary(ams::ProcReadMsg& parent) { + return algo::aryptr(until_Addr(parent), until_N(parent)); } -// --- ams.PrlogMsg.data.Print -void ams::data_Print(ams::PrlogMsg& parent, cstring &out) { - (void)out; - (void)parent; - if (ams::MsgHeader *data = data_Get(parent)) { - ams::MsgHeaderMsgs_Print(out, *data, INT_MAX); - } +// --- ams.ProcReadMsg.until.Addr +char* ams::until_Addr(ams::ProcReadMsg& parent) { + return (char*)((u8*)&parent + sizeof(ams::ProcReadMsg)); // address of varlen portion } -// --- ams.PrlogMsg.data.ReadStrptrMaybe +// --- ams.ProcReadMsg.until.ReadStrptrMaybe // Convert string to field. Return success value -bool ams::data_ReadStrptrMaybe(ams::PrlogMsg &parent, algo::strptr in_str) { - bool retval = false; +bool ams::until_ReadStrptrMaybe(ams::ProcReadMsg& parent, algo::strptr in_str) { + bool retval = true; if (algo_lib::_db.varlenbuf) { - algo::ByteAry temp; - retval = ams::MsgHeaderMsgs_ReadStrptrMaybe(in_str, temp); // read any of several message types here - ary_Setary(*algo_lib::_db.varlenbuf, ary_Getary(temp)); // return it + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); } (void)parent;//only to avoid -Wunused-parameter return retval; } -// --- ams.PrlogMsg..ReadFieldMaybe -bool ams::PrlogMsg_ReadFieldMaybe(ams::PrlogMsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ProcReadMsg.until.Print +// Convert until to a string. +// Array is printed as a regular string. +void ams::until_Print(ams::ProcReadMsg& parent, algo::cstring &rhs) { + rhs << until_Getary(parent); +} + +// --- ams.ProcReadMsg..ReadFieldMaybe +bool ams::ProcReadMsg_ReadFieldMaybe(ams::ProcReadMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { case ams_FieldId_base: { retval = false; - break; - } + } break; case ams_FieldId_type: { retval = false; - break; - } + } break; case ams_FieldId_length: { retval = false; - break; - } - case ams_FieldId_logcat: { - retval = algo::RnullStr50_ReadStrptrMaybe(parent.logcat, strval); - break; - } - case ams_FieldId_tstamp: { - retval = algo::SchedTime_ReadStrptrMaybe(parent.tstamp, strval); - break; - } - case ams_FieldId_data: { - retval = data_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + case ams_FieldId_proc: { + retval = algo::RnullStr50_ReadStrptrMaybe(parent.proc, strval); + } break; + case ams_FieldId_until: { + retval = until_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1970,70 +1595,99 @@ bool ams::PrlogMsg_ReadFieldMaybe(ams::PrlogMsg& parent, algo::strptr field, alg return retval; } -// --- ams.PrlogMsg..ReadStrptrMaybe +// --- ams.ProcReadMsg..ReadStrptrMaybe // Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::PrlogMsg from an ascii string. +// Read fields of ams::ProcReadMsg from an ascii string. // The format of the string is an ssim Tuple -bool ams::PrlogMsg_ReadStrptrMaybe(ams::PrlogMsg &parent, algo::strptr in_str) { +bool ams::ProcReadMsg_ReadStrptrMaybe(ams::ProcReadMsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.PrlogMsg"); + retval = algo::StripTypeTag(in_str, "ams.ProcReadMsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && PrlogMsg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && ProcReadMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- ams.PrlogMsg..Print +// --- ams.ProcReadMsg..Print // print string representation of ROW to string STR -// cfmt:ams.PrlogMsg.String printfmt:Tuple -void ams::PrlogMsg_Print(ams::PrlogMsg& row, algo::cstring& str) { +// cfmt:ams.ProcReadMsg.String printfmt:Tuple +void ams::ProcReadMsg_Print(ams::ProcReadMsg& row, algo::cstring& str) { algo::tempstr temp; - str << "ams.PrlogMsg"; - - algo::RnullStr50_Print(row.logcat, temp); - PrintAttrSpaceReset(str,"logcat", temp); + str << "ams.ProcReadMsg"; - algo::SchedTime_Print(row.tstamp, temp); - PrintAttrSpaceReset(str,"tstamp", temp); + algo::RnullStr50_Print(row.proc, temp); + PrintAttrSpaceReset(str,"proc", temp); - if (data_Get(row)) { - ams::data_Print(row, temp); - PrintAttrSpaceReset(str,"data", temp); - } + ams::until_Print(row, temp); + PrintAttrSpaceReset(str,"until", temp); } -// --- ams.ProcAddMsg.base.CopyOut +// --- ams.ProcStartMsg.base.CopyOut // Copy fields out of row -void ams::parent_CopyOut(ams::ProcAddMsg &row, ams::MsgHeader &out) { +void ams::parent_CopyOut(ams::ProcStartMsg &row, ams::MsgHeader &out) { // type: field value is computed // length: field value is computed (void)row;//only to avoid -Wunused-parameter (void)out;//only to avoid -Wunused-parameter } -// --- ams.ProcAddMsg..ReadFieldMaybe -bool ams::ProcAddMsg_ReadFieldMaybe(ams::ProcAddMsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ProcStartMsg.cmd.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ams::cmd_Getary(ams::ProcStartMsg& parent) { + return algo::aryptr(cmd_Addr(parent), cmd_N(parent)); +} + +// --- ams.ProcStartMsg.cmd.Addr +char* ams::cmd_Addr(ams::ProcStartMsg& parent) { + return (char*)((u8*)&parent + sizeof(ams::ProcStartMsg)); // address of varlen portion +} + +// --- ams.ProcStartMsg.cmd.ReadStrptrMaybe +// Convert string to field. Return success value +bool ams::cmd_ReadStrptrMaybe(ams::ProcStartMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- ams.ProcStartMsg.cmd.Print +// Convert cmd to a string. +// Array is printed as a regular string. +void ams::cmd_Print(ams::ProcStartMsg& parent, algo::cstring &rhs) { + rhs << cmd_Getary(parent); +} + +// --- ams.ProcStartMsg..ReadFieldMaybe +bool ams::ProcStartMsg_ReadFieldMaybe(ams::ProcStartMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { case ams_FieldId_base: { retval = false; - break; - } + } break; case ams_FieldId_type: { retval = false; - break; - } + } break; case ams_FieldId_length: { retval = false; - break; - } - case ams_FieldId_proc_id: { - retval = ams::ProcId_ReadStrptrMaybe(parent.proc_id, strval); - break; - } - default: break; + } break; + case ams_FieldId_proc: { + retval = algo::RnullStr50_ReadStrptrMaybe(parent.proc, strval); + } break; + case ams_FieldId_pty: { + retval = bool_ReadStrptrMaybe(parent.pty, strval); + } break; + case ams_FieldId_cmd: { + retval = cmd_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2041,61 +1695,70 @@ bool ams::ProcAddMsg_ReadFieldMaybe(ams::ProcAddMsg& parent, algo::strptr field, return retval; } -// --- ams.ProcAddMsg..ReadStrptrMaybe -// Read fields of ams::ProcAddMsg from an ascii string. +// --- ams.ProcStartMsg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ams::ProcStartMsg from an ascii string. // The format of the string is an ssim Tuple -bool ams::ProcAddMsg_ReadStrptrMaybe(ams::ProcAddMsg &parent, algo::strptr in_str) { +bool ams::ProcStartMsg_ReadStrptrMaybe(ams::ProcStartMsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.ProcAddMsg"); + retval = algo::StripTypeTag(in_str, "ams.ProcStartMsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && ProcAddMsg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && ProcStartMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- ams.ProcAddMsg..Print +// --- ams.ProcStartMsg..Print // print string representation of ROW to string STR -// cfmt:ams.ProcAddMsg.String printfmt:Tuple -void ams::ProcAddMsg_Print(ams::ProcAddMsg& row, algo::cstring& str) { +// cfmt:ams.ProcStartMsg.String printfmt:Tuple +void ams::ProcStartMsg_Print(ams::ProcStartMsg& row, algo::cstring& str) { algo::tempstr temp; - str << "ams.ProcAddMsg"; + str << "ams.ProcStartMsg"; - ams::ProcId_Print(row.proc_id, temp); - PrintAttrSpaceReset(str,"proc_id", temp); + algo::RnullStr50_Print(row.proc, temp); + PrintAttrSpaceReset(str,"proc", temp); + + bool_Print(row.pty, temp); + PrintAttrSpaceReset(str,"pty", temp); + + ams::cmd_Print(row, temp); + PrintAttrSpaceReset(str,"cmd", temp); } -// --- ams.ProcRemoveMsg.base.CopyOut +// --- ams.ProcStatusMsg.base.CopyOut // Copy fields out of row -void ams::parent_CopyOut(ams::ProcRemoveMsg &row, ams::MsgHeader &out) { +void ams::parent_CopyOut(ams::ProcStatusMsg &row, ams::MsgHeader &out) { // type: field value is computed // length: field value is computed (void)row;//only to avoid -Wunused-parameter (void)out;//only to avoid -Wunused-parameter } -// --- ams.ProcRemoveMsg..ReadFieldMaybe -bool ams::ProcRemoveMsg_ReadFieldMaybe(ams::ProcRemoveMsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ProcStatusMsg..ReadFieldMaybe +bool ams::ProcStatusMsg_ReadFieldMaybe(ams::ProcStatusMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case ams_FieldId_base: { retval = false; - break; - } + } break; case ams_FieldId_type: { retval = false; - break; - } + } break; case ams_FieldId_length: { retval = false; - break; - } - case ams_FieldId_proc_id: { - retval = ams::ProcId_ReadStrptrMaybe(parent.proc_id, strval); - break; - } - default: break; + } break; + case ams_FieldId_proc: { + retval = algo::RnullStr50_ReadStrptrMaybe(parent.proc, strval); + } break; + case ams_FieldId_status: { + retval = algo::RnullStr50_ReadStrptrMaybe(parent.status, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2103,48 +1766,95 @@ bool ams::ProcRemoveMsg_ReadFieldMaybe(ams::ProcRemoveMsg& parent, algo::strptr return retval; } -// --- ams.ProcRemoveMsg..ReadStrptrMaybe -// Read fields of ams::ProcRemoveMsg from an ascii string. +// --- ams.ProcStatusMsg..ReadStrptrMaybe +// Read fields of ams::ProcStatusMsg from an ascii string. // The format of the string is an ssim Tuple -bool ams::ProcRemoveMsg_ReadStrptrMaybe(ams::ProcRemoveMsg &parent, algo::strptr in_str) { +bool ams::ProcStatusMsg_ReadStrptrMaybe(ams::ProcStatusMsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.ProcRemoveMsg"); + retval = algo::StripTypeTag(in_str, "ams.ProcStatusMsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && ProcRemoveMsg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && ProcStatusMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- ams.ProcRemoveMsg..Print +// --- ams.ProcStatusMsg..Print // print string representation of ROW to string STR -// cfmt:ams.ProcRemoveMsg.String printfmt:Tuple -void ams::ProcRemoveMsg_Print(ams::ProcRemoveMsg& row, algo::cstring& str) { +// cfmt:ams.ProcStatusMsg.String printfmt:Tuple +void ams::ProcStatusMsg_Print(ams::ProcStatusMsg& row, algo::cstring& str) { algo::tempstr temp; - str << "ams.ProcRemoveMsg"; + str << "ams.ProcStatusMsg"; - ams::ProcId_Print(row.proc_id, temp); - PrintAttrSpaceReset(str,"proc_id", temp); + algo::RnullStr50_Print(row.proc, temp); + PrintAttrSpaceReset(str,"proc", temp); + + algo::RnullStr50_Print(row.status, temp); + PrintAttrSpaceReset(str,"status", temp); +} + +// --- ams.RemDirRecurseMsg.base.CopyOut +// Copy fields out of row +void ams::parent_CopyOut(ams::RemDirRecurseMsg &row, ams::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter +} + +// --- ams.RemDirRecurseMsg.pathname.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ams::pathname_Getary(ams::RemDirRecurseMsg& parent) { + return algo::aryptr(pathname_Addr(parent), pathname_N(parent)); +} + +// --- ams.RemDirRecurseMsg.pathname.Addr +char* ams::pathname_Addr(ams::RemDirRecurseMsg& parent) { + return (char*)((u8*)&parent + sizeof(ams::RemDirRecurseMsg)); // address of varlen portion +} + +// --- ams.RemDirRecurseMsg.pathname.ReadStrptrMaybe +// Convert string to field. Return success value +bool ams::pathname_ReadStrptrMaybe(ams::RemDirRecurseMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; } -// --- ams.SeqmsgId..ReadFieldMaybe -bool ams::SeqmsgId_ReadFieldMaybe(ams::SeqmsgId& parent, algo::strptr field, algo::strptr strval) { +// --- ams.RemDirRecurseMsg.pathname.Print +// Convert pathname to a string. +// Array is printed as a regular string. +void ams::pathname_Print(ams::RemDirRecurseMsg& parent, algo::cstring &rhs) { + rhs << pathname_Getary(parent); +} + +// --- ams.RemDirRecurseMsg..ReadFieldMaybe +bool ams::RemDirRecurseMsg_ReadFieldMaybe(ams::RemDirRecurseMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { - case ams_FieldId_stream_id: { - retval = ams::StreamId_ReadStrptrMaybe(parent.stream_id, strval); - break; - } - case ams_FieldId_seq: { - retval = u64_ReadStrptrMaybe(parent.seq, strval); - break; - } - case ams_FieldId_off: { - retval = u32_ReadStrptrMaybe(parent.off, strval); - break; - } - default: break; + case ams_FieldId_base: { + retval = false; + } break; + case ams_FieldId_type: { + retval = false; + } break; + case ams_FieldId_length: { + retval = false; + } break; + case ams_FieldId_remove_topmost: { + retval = bool_ReadStrptrMaybe(parent.remove_topmost, strval); + } break; + case ams_FieldId_pathname: { + retval = pathname_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2152,104 +1862,102 @@ bool ams::SeqmsgId_ReadFieldMaybe(ams::SeqmsgId& parent, algo::strptr field, alg return retval; } -// --- ams.SeqmsgId..ReadStrptrMaybe -// Read fields of ams::SeqmsgId from an ascii string. -// The format of the string is a string with separated values -bool ams::SeqmsgId_ReadStrptrMaybe(ams::SeqmsgId &parent, algo::strptr in_str) { +// --- ams.RemDirRecurseMsg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ams::RemDirRecurseMsg from an ascii string. +// The format of the string is an ssim Tuple +bool ams::RemDirRecurseMsg_ReadStrptrMaybe(ams::RemDirRecurseMsg &parent, algo::strptr in_str) { bool retval = true; - algo::strptr value; - - algo::NextSep(in_str, '@', value); - retval = retval && ams::StreamId_ReadStrptrMaybe(parent.stream_id, value); - - algo::NextSep(in_str, ',', value); - retval = retval && u64_ReadStrptrMaybe(parent.seq, value); - - value = in_str; - retval = retval && u32_ReadStrptrMaybe(parent.off, value); + retval = algo::StripTypeTag(in_str, "ams.RemDirRecurseMsg"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && RemDirRecurseMsg_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; return retval; } -// --- ams.SeqmsgId..Print +// --- ams.RemDirRecurseMsg..Print // print string representation of ROW to string STR -// cfmt:ams.SeqmsgId.String printfmt:Sep -void ams::SeqmsgId_Print(ams::SeqmsgId row, algo::cstring& str) { - ams::StreamId_Print(row.stream_id, str); - str << '@'; - u64_Print(row.seq, str); - str << ','; - u32_Print(row.off, str); +// cfmt:ams.RemDirRecurseMsg.String printfmt:Tuple +void ams::RemDirRecurseMsg_Print(ams::RemDirRecurseMsg& row, algo::cstring& str) { + algo::tempstr temp; + str << "ams.RemDirRecurseMsg"; + + bool_Print(row.remove_topmost, temp); + PrintAttrSpaceReset(str,"remove_topmost", temp); + + ams::pathname_Print(row, temp); + PrintAttrSpaceReset(str,"pathname", temp); } -// --- ams.Seqmsg.base.CopyOut -// Copy fields out of row -void ams::parent_CopyOut(ams::Seqmsg &row, ams::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter +// --- ams.ShmFlags.write.ReadStrptrMaybe +inline static bool ams::write_ReadStrptrMaybe(ams::ShmFlags &parent, algo::strptr in_str) { + bool retval = true; + bool write_tmp; + retval = bool_ReadStrptrMaybe(write_tmp, in_str); + if (retval) { + write_Set(parent, write_tmp); + } + return retval; } -// --- ams.Seqmsg.payload.Getary -// Access optional portion as an array of bytes -algo::aryptr ams::payload_Getary(ams::Seqmsg& parent) { - u8 *end = (u8*)&parent + sizeof(ams::Seqmsg); - return algo::aryptr(end, i32(parent.length) - ssizeof(ams::Seqmsg)); +// --- ams.ShmFlags.read.ReadStrptrMaybe +inline static bool ams::read_ReadStrptrMaybe(ams::ShmFlags &parent, algo::strptr in_str) { + bool retval = true; + bool read_tmp; + retval = bool_ReadStrptrMaybe(read_tmp, in_str); + if (retval) { + read_Set(parent, read_tmp); + } + return retval; } -// --- ams.Seqmsg.payload.Print -void ams::payload_Print(ams::Seqmsg& parent, cstring &out) { - (void)out; - (void)parent; - if (ams::MsgHeader *payload = payload_Get(parent)) { - ams::MsgHeaderMsgs_Print(out, *payload, INT_MAX); +// --- ams.ShmFlags.nonblock.ReadStrptrMaybe +inline static bool ams::nonblock_ReadStrptrMaybe(ams::ShmFlags &parent, algo::strptr in_str) { + bool retval = true; + bool nonblock_tmp; + retval = bool_ReadStrptrMaybe(nonblock_tmp, in_str); + if (retval) { + nonblock_Set(parent, nonblock_tmp); } + return retval; } -// --- ams.Seqmsg.payload.ReadStrptrMaybe -// Convert string to field. Return success value -bool ams::payload_ReadStrptrMaybe(ams::Seqmsg &parent, algo::strptr in_str) { - bool retval = false; - if (algo_lib::_db.varlenbuf) { - algo::ByteAry temp; - retval = ams::MsgHeaderMsgs_ReadStrptrMaybe(in_str, temp); // read any of several message types here - ary_Setary(*algo_lib::_db.varlenbuf, ary_Getary(temp)); // return it +// --- ams.ShmFlags.write_err.ReadStrptrMaybe +inline static bool ams::write_err_ReadStrptrMaybe(ams::ShmFlags &parent, algo::strptr in_str) { + bool retval = true; + bool write_err_tmp; + retval = bool_ReadStrptrMaybe(write_err_tmp, in_str); + if (retval) { + write_err_Set(parent, write_err_tmp); } - (void)parent;//only to avoid -Wunused-parameter return retval; } -// --- ams.Seqmsg..ReadFieldMaybe -bool ams::Seqmsg_ReadFieldMaybe(ams::Seqmsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ShmFlags..ReadFieldMaybe +bool ams::ShmFlags_ReadFieldMaybe(ams::ShmFlags& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case ams_FieldId_base: { - retval = false; - break; - } - case ams_FieldId_type: { - retval = false; - break; - } - case ams_FieldId_length: { + case ams_FieldId_value: { + retval = u8_ReadStrptrMaybe(parent.value, strval); + } break; + case ams_FieldId_write: { + retval = write_ReadStrptrMaybe(parent, strval); + } break; + case ams_FieldId_read: { + retval = read_ReadStrptrMaybe(parent, strval); + } break; + case ams_FieldId_nonblock: { + retval = nonblock_ReadStrptrMaybe(parent, strval); + } break; + case ams_FieldId_write_err: { + retval = write_err_ReadStrptrMaybe(parent, strval); + } break; + default: { retval = false; - break; - } - case ams_FieldId_seqmsg_id: { - retval = ams::SeqmsgId_ReadStrptrMaybe(parent.seqmsg_id, strval); - break; - } - case ams_FieldId_tsc: { - retval = u64_ReadStrptrMaybe(parent.tsc, strval); - break; - } - case ams_FieldId_payload: { - retval = payload_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2257,85 +1965,119 @@ bool ams::Seqmsg_ReadFieldMaybe(ams::Seqmsg& parent, algo::strptr field, algo::s return retval; } -// --- ams.Seqmsg..ReadStrptrMaybe -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::Seqmsg from an ascii string. -// The format of the string is an ssim Tuple -bool ams::Seqmsg_ReadStrptrMaybe(ams::Seqmsg &parent, algo::strptr in_str) { +// --- ams.ShmFlags..ReadStrptrMaybe +// Read fields of ams::ShmFlags from an ascii string. +bool ams::ShmFlags_ReadStrptrMaybe(ams::ShmFlags &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.Seqmsg"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && Seqmsg_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; + // Clear affected bits first) + write_Set(parent, false); + read_Set(parent, false); + nonblock_Set(parent, false); + write_err_Set(parent, false); + // Read ','-separated list of bools + while (ch_N(in_str)) { + strptr field_name; + algo::NextSep(in_str,',',field_name); + field_name = algo::Trimmed(field_name); + if (ch_N(field_name)) { + ams::FieldId field_id; + bool ok = ams::value_SetStrptrMaybe(field_id,field_name); + if (ok) { + switch (field_id) { + case ams_FieldId_write: { + write_Set(parent, true); + } break; + case ams_FieldId_read: { + read_Set(parent, true); + } break; + case ams_FieldId_nonblock: { + nonblock_Set(parent, true); + } break; + case ams_FieldId_write_err: { + write_err_Set(parent, true); + } break; + default: ok = false; break; + } + } + if (!ok) { + algo_lib::AppendErrtext("bitfld",field_name); + retval = false; + } + } + } return retval; } -// --- ams.Seqmsg..Print +// --- ams.ShmFlags..Print // print string representation of ROW to string STR -// cfmt:ams.Seqmsg.String printfmt:Tuple -void ams::Seqmsg_Print(ams::Seqmsg& row, algo::cstring& str) { - algo::tempstr temp; - str << "ams.Seqmsg"; - - ams::SeqmsgId_Print(row.seqmsg_id, temp); - PrintAttrSpaceReset(str,"seqmsg_id", temp); - - u64_Print(row.tsc, temp); - PrintAttrSpaceReset(str,"tsc", temp); - - if (payload_Get(row)) { - ams::payload_Print(row, temp); - PrintAttrSpaceReset(str,"payload", temp); +// cfmt:ams.ShmFlags.String printfmt:Bitset +void ams::ShmFlags_Print(ams::ShmFlags row, algo::cstring& str) { + algo::ListSep ls(","); + if (write_Get(row)) { + str << ls << "write"; + } + if (read_Get(row)) { + str << ls << "read"; + } + if (nonblock_Get(row)) { + str << ls << "nonblock"; + } + if (write_err_Get(row)) { + str << ls << "write_err"; } } -// --- ams.SeqmsgTrace.base.CopyOut -// Copy fields out of row -void ams::parent_CopyOut(ams::SeqmsgTrace &row, ams::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter +// --- ams.ShmFlags..GetAnon +algo::strptr ams::ShmFlags_GetAnon(ams::ShmFlags &parent, i32 idx) { + (void)parent;//only to avoid -Wunused-parameter + switch(idx) { + case(0): return strptr("value", 5); + default: return algo::strptr(); + } } -// --- ams.SeqmsgTrace.mode.ToCstr +// --- ams.Shmtype.value.ToCstr // Convert numeric value of field to one of predefined string constants. // If string is found, return a static C string. Otherwise, return NULL. -const char* ams::mode_ToCstr(const ams::SeqmsgTrace& parent) { +const char* ams::value_ToCstr(const ams::Shmtype& parent) { const char *ret = NULL; - switch(mode_GetEnum(parent)) { - case ams_SeqmsgTrace_mode_r : ret = "r"; break; - case ams_SeqmsgTrace_mode_w : ret = "w"; break; + switch(value_GetEnum(parent)) { + case ams_Shmtype_ctl : ret = "ctl"; break; + case ams_Shmtype_log : ret = "log"; break; + case ams_Shmtype_out : ret = "out"; break; } return ret; } -// --- ams.SeqmsgTrace.mode.Print -// Convert mode to a string. First, attempt conversion to a known string. -// If no string matches, print mode as a numeric value. -void ams::mode_Print(const ams::SeqmsgTrace& parent, algo::cstring &lhs) { - const char *strval = mode_ToCstr(parent); +// --- ams.Shmtype.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void ams::value_Print(const ams::Shmtype& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); if (strval) { lhs << strval; } else { - lhs << parent.mode; + lhs << parent.value; } } -// --- ams.SeqmsgTrace.mode.SetStrptrMaybe +// --- ams.Shmtype.value.SetStrptrMaybe // Convert string to field. // If the string is invalid, do not modify field and return false. // In case of success, return true -bool ams::mode_SetStrptrMaybe(ams::SeqmsgTrace& parent, algo::strptr rhs) { +bool ams::value_SetStrptrMaybe(ams::Shmtype& parent, algo::strptr rhs) { bool ret = false; switch (elems_N(rhs)) { - case 1: { - switch (u64(rhs[0])) { - case 'r': { - mode_SetEnum(parent,ams_SeqmsgTrace_mode_r); ret = true; break; + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('c','t','l'): { + value_SetEnum(parent,ams_Shmtype_ctl); ret = true; break; } - case 'w': { - mode_SetEnum(parent,ams_SeqmsgTrace_mode_w); ret = true; break; + case LE_STR3('l','o','g'): { + value_SetEnum(parent,ams_Shmtype_log); ret = true; break; + } + case LE_STR3('o','u','t'): { + value_SetEnum(parent,ams_Shmtype_out); ret = true; break; } } break; @@ -2344,92 +2086,59 @@ bool ams::mode_SetStrptrMaybe(ams::SeqmsgTrace& parent, algo::strptr rhs) { return ret; } -// --- ams.SeqmsgTrace.mode.SetStrptr +// --- ams.Shmtype.value.SetStrptr // Convert string to field. // If the string is invalid, set numeric value to DFLT -void ams::mode_SetStrptr(ams::SeqmsgTrace& parent, algo::strptr rhs, ams_SeqmsgTrace_mode_Enum dflt) { - if (!mode_SetStrptrMaybe(parent,rhs)) mode_SetEnum(parent,dflt); +void ams::value_SetStrptr(ams::Shmtype& parent, algo::strptr rhs, ams_ShmtypeEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); } -// --- ams.SeqmsgTrace.mode.ReadStrptrMaybe +// --- ams.Shmtype.value.ReadStrptrMaybe // Convert string to field. Return success value -bool ams::mode_ReadStrptrMaybe(ams::SeqmsgTrace& parent, algo::strptr rhs) { +bool ams::value_ReadStrptrMaybe(ams::Shmtype& parent, algo::strptr rhs) { bool retval = false; - retval = mode_SetStrptrMaybe(parent,rhs); // try symbol conversion + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion if (!retval) { // didn't work? try reading as underlying type - retval = u8_ReadStrptrMaybe(parent.mode,rhs); + retval = u8_ReadStrptrMaybe(parent.value,rhs); } return retval; } -// --- ams.SeqmsgTrace.payload.Getary -// Access optional portion as an array of bytes -algo::aryptr ams::payload_Getary(ams::SeqmsgTrace& parent) { - u8 *end = (u8*)&parent + sizeof(ams::SeqmsgTrace); - return algo::aryptr(end, i32(parent.length) - ssizeof(ams::SeqmsgTrace)); -} - -// --- ams.SeqmsgTrace.payload.Print -void ams::payload_Print(ams::SeqmsgTrace& parent, cstring &out) { - (void)out; - (void)parent; - if (ams::MsgHeader *payload = payload_Get(parent)) { - ams::MsgHeaderMsgs_Print(out, *payload, INT_MAX); - } +// --- ams.Shmtype..ReadStrptrMaybe +// Read fields of ams::Shmtype from an ascii string. +// The format of the string is the format of the ams::Shmtype's only field +bool ams::Shmtype_ReadStrptrMaybe(ams::Shmtype &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; } -// --- ams.SeqmsgTrace.payload.ReadStrptrMaybe -// Convert string to field. Return success value -bool ams::payload_ReadStrptrMaybe(ams::SeqmsgTrace &parent, algo::strptr in_str) { - bool retval = false; - if (algo_lib::_db.varlenbuf) { - algo::ByteAry temp; - retval = ams::MsgHeaderMsgs_ReadStrptrMaybe(in_str, temp); // read any of several message types here - ary_Setary(*algo_lib::_db.varlenbuf, ary_Getary(temp)); // return it - } - (void)parent;//only to avoid -Wunused-parameter - return retval; +// --- ams.Shmtype..Print +// print string representation of ROW to string STR +// cfmt:ams.Shmtype.String printfmt:Raw +void ams::Shmtype_Print(ams::Shmtype row, algo::cstring& str) { + ams::value_Print(row, str); } -// --- ams.SeqmsgTrace..ReadFieldMaybe -bool ams::SeqmsgTrace_ReadFieldMaybe(ams::SeqmsgTrace& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ShmId..ReadFieldMaybe +bool ams::ShmId_ReadFieldMaybe(ams::ShmId& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case ams_FieldId_base: { - retval = false; - break; - } - case ams_FieldId_type: { - retval = false; - break; - } - case ams_FieldId_length: { - retval = false; - break; - } case ams_FieldId_proc_id: { retval = ams::ProcId_ReadStrptrMaybe(parent.proc_id, strval); - break; - } - case ams_FieldId_mode: { - retval = mode_ReadStrptrMaybe(parent, strval); - break; - } - case ams_FieldId_seqmsg_id: { - retval = ams::SeqmsgId_ReadStrptrMaybe(parent.seqmsg_id, strval); - break; - } - case ams_FieldId_tsc: { - retval = u64_ReadStrptrMaybe(parent.tsc, strval); - break; - } - case ams_FieldId_payload: { - retval = payload_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + case ams_FieldId_shmtype: { + retval = ams::Shmtype_ReadStrptrMaybe(parent.shmtype, strval); + } break; + case ams_FieldId_index: { + retval = u8_ReadStrptrMaybe(parent.index, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2437,160 +2146,76 @@ bool ams::SeqmsgTrace_ReadFieldMaybe(ams::SeqmsgTrace& parent, algo::strptr fiel return retval; } -// --- ams.SeqmsgTrace..ReadStrptrMaybe -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::SeqmsgTrace from an ascii string. -// The format of the string is an ssim Tuple -bool ams::SeqmsgTrace_ReadStrptrMaybe(ams::SeqmsgTrace &parent, algo::strptr in_str) { - bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.SeqmsgTrace"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && SeqmsgTrace_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; -} - -// --- ams.SeqmsgTrace..Print -// print string representation of ROW to string STR -// cfmt:ams.SeqmsgTrace.String printfmt:Tuple -void ams::SeqmsgTrace_Print(ams::SeqmsgTrace& row, algo::cstring& str) { - algo::tempstr temp; - str << "ams.SeqmsgTrace"; - - ams::ProcId_Print(row.proc_id, temp); - PrintAttrSpaceReset(str,"proc_id", temp); - - ams::mode_Print(row, temp); - PrintAttrSpaceReset(str,"mode", temp); - - ams::SeqmsgId_Print(row.seqmsg_id, temp); - PrintAttrSpaceReset(str,"seqmsg_id", temp); - - u64_Print(row.tsc, temp); - PrintAttrSpaceReset(str,"tsc", temp); - - if (payload_Get(row)) { - ams::payload_Print(row, temp); - PrintAttrSpaceReset(str,"payload", temp); - } -} - -// --- ams.StreamFlags.write.ReadStrptrMaybe -inline static bool ams::write_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) { +// --- ams.ShmId..ReadStrptrMaybe +// Read fields of ams::ShmId from an ascii string. +// The format of the string is a string with separated values +bool ams::ShmId_ReadStrptrMaybe(ams::ShmId &parent, algo::strptr in_str) { bool retval = true; - bool write_tmp; - retval = bool_ReadStrptrMaybe(write_tmp, in_str); - if (retval) { - write_Set(parent, write_tmp); - } - return retval; -} + algo::strptr value; -// --- ams.StreamFlags.read.ReadStrptrMaybe -inline static bool ams::read_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) { - bool retval = true; - bool read_tmp; - retval = bool_ReadStrptrMaybe(read_tmp, in_str); - if (retval) { - read_Set(parent, read_tmp); - } - return retval; -} + algo::NextSep(in_str, '.', value); + retval = retval && ams::ProcId_ReadStrptrMaybe(parent.proc_id, value); -// --- ams.StreamFlags.nonblock.ReadStrptrMaybe -inline static bool ams::nonblock_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) { - bool retval = true; - bool nonblock_tmp; - retval = bool_ReadStrptrMaybe(nonblock_tmp, in_str); - if (retval) { - nonblock_Set(parent, nonblock_tmp); - } - return retval; -} + algo::NextSep(in_str, '-', value); + retval = retval && ams::Shmtype_ReadStrptrMaybe(parent.shmtype, value); -// --- ams.StreamFlags.trace_read.ReadStrptrMaybe -inline static bool ams::trace_read_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) { - bool retval = true; - bool trace_read_tmp; - retval = bool_ReadStrptrMaybe(trace_read_tmp, in_str); - if (retval) { - trace_read_Set(parent, trace_read_tmp); - } + value = in_str; + retval = retval && u8_ReadStrptrMaybe(parent.index, value); return retval; } -// --- ams.StreamFlags.trace_write.ReadStrptrMaybe -inline static bool ams::trace_write_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) { - bool retval = true; - bool trace_write_tmp; - retval = bool_ReadStrptrMaybe(trace_write_tmp, in_str); - if (retval) { - trace_write_Set(parent, trace_write_tmp); - } - return retval; +// --- ams.ShmId..Print +// print string representation of ROW to string STR +// cfmt:ams.ShmId.String printfmt:Sep +void ams::ShmId_Print(ams::ShmId row, algo::cstring& str) { + ams::ProcId_Print(row.proc_id, str); + str << '.'; + ams::Shmtype_Print(row.shmtype, str); + str << '-'; + u8_Print(row.index, str); } -// --- ams.StreamFlags.write_err.ReadStrptrMaybe -inline static bool ams::write_err_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) { +// --- ams.ShmemberFlags.r.ReadStrptrMaybe +inline static bool ams::r_ReadStrptrMaybe(ams::ShmemberFlags &parent, algo::strptr in_str) { bool retval = true; - bool write_err_tmp; - retval = bool_ReadStrptrMaybe(write_err_tmp, in_str); + bool r_tmp; + retval = bool_ReadStrptrMaybe(r_tmp, in_str); if (retval) { - write_err_Set(parent, write_err_tmp); + r_Set(parent, r_tmp); } return retval; } -// --- ams.StreamFlags.trace_text.ReadStrptrMaybe -inline static bool ams::trace_text_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) { +// --- ams.ShmemberFlags.w.ReadStrptrMaybe +inline static bool ams::w_ReadStrptrMaybe(ams::ShmemberFlags &parent, algo::strptr in_str) { bool retval = true; - bool trace_text_tmp; - retval = bool_ReadStrptrMaybe(trace_text_tmp, in_str); + bool w_tmp; + retval = bool_ReadStrptrMaybe(w_tmp, in_str); if (retval) { - trace_text_Set(parent, trace_text_tmp); + w_Set(parent, w_tmp); } return retval; } -// --- ams.StreamFlags..ReadFieldMaybe -bool ams::StreamFlags_ReadFieldMaybe(ams::StreamFlags& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ShmemberFlags..ReadFieldMaybe +bool ams::ShmemberFlags_ReadFieldMaybe(ams::ShmemberFlags& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case ams_FieldId_value: { - retval = u8_ReadStrptrMaybe(parent.value, strval); - break; - } - case ams_FieldId_write: { - retval = write_ReadStrptrMaybe(parent, strval); - break; - } - case ams_FieldId_read: { - retval = read_ReadStrptrMaybe(parent, strval); - break; - } - case ams_FieldId_nonblock: { - retval = nonblock_ReadStrptrMaybe(parent, strval); - break; - } - case ams_FieldId_trace_read: { - retval = trace_read_ReadStrptrMaybe(parent, strval); - break; - } - case ams_FieldId_trace_write: { - retval = trace_write_ReadStrptrMaybe(parent, strval); - break; - } - case ams_FieldId_write_err: { - retval = write_err_ReadStrptrMaybe(parent, strval); - break; - } - case ams_FieldId_trace_text: { - retval = trace_text_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + retval = u16_ReadStrptrMaybe(parent.value, strval); + } break; + case ams_FieldId_r: { + retval = r_ReadStrptrMaybe(parent, strval); + } break; + case ams_FieldId_w: { + retval = w_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2598,18 +2223,13 @@ bool ams::StreamFlags_ReadFieldMaybe(ams::StreamFlags& parent, algo::strptr fiel return retval; } -// --- ams.StreamFlags..ReadStrptrMaybe -// Read fields of ams::StreamFlags from an ascii string. -bool ams::StreamFlags_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) { +// --- ams.ShmemberFlags..ReadStrptrMaybe +// Read fields of ams::ShmemberFlags from an ascii string. +bool ams::ShmemberFlags_ReadStrptrMaybe(ams::ShmemberFlags &parent, algo::strptr in_str) { bool retval = true; // Clear affected bits first) - write_Set(parent, false); - read_Set(parent, false); - nonblock_Set(parent, false); - trace_read_Set(parent, false); - trace_write_Set(parent, false); - write_err_Set(parent, false); - trace_text_Set(parent, false); + r_Set(parent, false); + w_Set(parent, false); // Read ','-separated list of bools while (ch_N(in_str)) { strptr field_name; @@ -2620,26 +2240,11 @@ bool ams::StreamFlags_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_ bool ok = ams::value_SetStrptrMaybe(field_id,field_name); if (ok) { switch (field_id) { - case ams_FieldId_write: { - write_Set(parent, true); - } break; - case ams_FieldId_read: { - read_Set(parent, true); - } break; - case ams_FieldId_nonblock: { - nonblock_Set(parent, true); - } break; - case ams_FieldId_trace_read: { - trace_read_Set(parent, true); - } break; - case ams_FieldId_trace_write: { - trace_write_Set(parent, true); + case ams_FieldId_r: { + r_Set(parent, true); } break; - case ams_FieldId_write_err: { - write_err_Set(parent, true); - } break; - case ams_FieldId_trace_text: { - trace_text_Set(parent, true); + case ams_FieldId_w: { + w_Set(parent, true); } break; default: ok = false; break; } @@ -2653,36 +2258,21 @@ bool ams::StreamFlags_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_ return retval; } -// --- ams.StreamFlags..Print +// --- ams.ShmemberFlags..Print // print string representation of ROW to string STR -// cfmt:ams.StreamFlags.String printfmt:Bitset -void ams::StreamFlags_Print(ams::StreamFlags row, algo::cstring& str) { +// cfmt:ams.ShmemberFlags.String printfmt:Bitset +void ams::ShmemberFlags_Print(ams::ShmemberFlags row, algo::cstring& str) { algo::ListSep ls(","); - if (write_Get(row)) { - str << ls << "write"; - } - if (read_Get(row)) { - str << ls << "read"; - } - if (nonblock_Get(row)) { - str << ls << "nonblock"; - } - if (trace_read_Get(row)) { - str << ls << "trace_read"; + if (r_Get(row)) { + str << ls << "r"; } - if (trace_write_Get(row)) { - str << ls << "trace_write"; - } - if (write_err_Get(row)) { - str << ls << "write_err"; - } - if (trace_text_Get(row)) { - str << ls << "trace_text"; + if (w_Get(row)) { + str << ls << "w"; } } -// --- ams.StreamFlags..GetAnon -algo::strptr ams::StreamFlags_GetAnon(ams::StreamFlags &parent, i32 idx) { +// --- ams.ShmemberFlags..GetAnon +algo::strptr ams::ShmemberFlags_GetAnon(ams::ShmemberFlags &parent, i32 idx) { (void)parent;//only to avoid -Wunused-parameter switch(idx) { case(0): return strptr("value", 5); @@ -2690,207 +2280,25 @@ algo::strptr ams::StreamFlags_GetAnon(ams::StreamFlags &parent, i32 idx) { } } -// --- ams.StreamHbMsg.base.CopyOut -// Copy fields out of row -void ams::parent_CopyOut(ams::StreamHbMsg &row, ams::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter -} - -// --- ams.StreamHbMsg..ReadFieldMaybe -bool ams::StreamHbMsg_ReadFieldMaybe(ams::StreamHbMsg& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case ams_FieldId_base: { - retval = false; - break; - } - case ams_FieldId_type: { - retval = false; - break; - } - case ams_FieldId_length: { - retval = false; - break; - } - case ams_FieldId_member: { - retval = ams::Member_ReadStrptrMaybe(parent.member, strval); - break; - } - case ams_FieldId_pos: { - retval = ams::StreamPos_ReadStrptrMaybe(parent.pos, strval); - break; - } - case ams_FieldId_wbudget: { - retval = u32_ReadStrptrMaybe(parent.wbudget, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- ams.StreamHbMsg..ReadStrptrMaybe -// Read fields of ams::StreamHbMsg from an ascii string. -// The format of the string is an ssim Tuple -bool ams::StreamHbMsg_ReadStrptrMaybe(ams::StreamHbMsg &parent, algo::strptr in_str) { - bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.StreamHbMsg"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && StreamHbMsg_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; -} - -// --- ams.StreamHbMsg..Print -// print string representation of ROW to string STR -// cfmt:ams.StreamHbMsg.String printfmt:Tuple -void ams::StreamHbMsg_Print(ams::StreamHbMsg& row, algo::cstring& str) { - algo::tempstr temp; - str << "ams.StreamHbMsg"; - - ams::Member_Print(row.member, temp); - PrintAttrSpaceReset(str,"member", temp); - - ams::StreamPos_Print(row.pos, temp); - PrintAttrSpaceReset(str,"pos", temp); - - u32_Print(row.wbudget, temp); - PrintAttrSpaceReset(str,"wbudget", temp); -} - -// --- ams.TerminateMsg.base.CopyOut -// Copy fields out of row -void ams::parent_CopyOut(ams::TerminateMsg &row, ams::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter -} - -// --- ams.TerminateMsg..ReadFieldMaybe -bool ams::TerminateMsg_ReadFieldMaybe(ams::TerminateMsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ShmemberId..ReadFieldMaybe +bool ams::ShmemberId_ReadFieldMaybe(ams::ShmemberId& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case ams_FieldId_base: { - retval = false; - break; - } - case ams_FieldId_type: { - retval = false; - break; - } - case ams_FieldId_length: { - retval = false; - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - (void)parent;//only to avoid -Wunused-parameter - (void)strval;//only to avoid -Wunused-parameter - return retval; -} - -// --- ams.TerminateMsg..ReadStrptrMaybe -// Read fields of ams::TerminateMsg from an ascii string. -// The format of the string is an ssim Tuple -bool ams::TerminateMsg_ReadStrptrMaybe(ams::TerminateMsg &parent, algo::strptr in_str) { - bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.TerminateMsg"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && TerminateMsg_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; -} - -// --- ams.TerminateMsg..Print -// print string representation of ROW to string STR -// cfmt:ams.TerminateMsg.String printfmt:Tuple -void ams::TerminateMsg_Print(ams::TerminateMsg& row, algo::cstring& str) { - algo::tempstr temp; - str << "ams.TerminateMsg"; - (void)row;//only to avoid -Wunused-parameter -} - -// --- ams.Trace2Msg.base.CopyOut -// Copy fields out of row -void ams::parent_CopyOut(ams::Trace2Msg &row, ams::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter -} - -// --- ams.Trace2Msg.data.Getary -// Access var-length portion as an aryptr. Length is determined from one of the fields. -algo::aryptr ams::data_Getary(ams::Trace2Msg& parent) { - return algo::aryptr(data_Addr(parent), data_N(parent)); -} - -// --- ams.Trace2Msg.data.Addr -u64* ams::data_Addr(ams::Trace2Msg& parent) { - return (u64*)((u8*)&parent + sizeof(ams::Trace2Msg)); // address of varlen portion -} - -// --- ams.Trace2Msg.data.ReadStrptrMaybe -// Convert string to field. Return success value -bool ams::data_ReadStrptrMaybe(ams::Trace2Msg& parent, algo::strptr in_str) { - bool retval = true; - if (algo_lib::_db.varlenbuf) { - u64 *data_tmp = new(ary_AllocN(*algo_lib::_db.varlenbuf, sizeof(u64)).elems) u64; - retval = u64_ReadStrptrMaybe(*data_tmp, in_str); - } - (void)parent;//only to avoid -Wunused-parameter - return retval; -} - -// --- ams.Trace2Msg..ReadFieldMaybe -bool ams::Trace2Msg_ReadFieldMaybe(ams::Trace2Msg& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); - switch(field_id) { - case ams_FieldId_base: { - retval = false; - break; - } - case ams_FieldId_type: { - retval = false; - break; - } - case ams_FieldId_length: { + case ams_FieldId_shm_id: { + retval = ams::ShmId_ReadStrptrMaybe(parent.shm_id, strval); + } break; + case ams_FieldId_proc_id: { + retval = ams::ProcId_ReadStrptrMaybe(parent.proc_id, strval); + } break; + case ams_FieldId_flags: { + retval = ams::ShmemberFlags_ReadStrptrMaybe(parent.flags, strval); + } break; + default: { retval = false; - break; - } - case ams_FieldId_proc: { - retval = ams::ProcId_ReadStrptrMaybe(parent.proc, strval); - break; - } - case ams_FieldId_trace: { - retval = u8_ReadStrptrMaybe(parent.trace, strval); - break; - } - case ams_FieldId_tstamp: { - retval = algo::UnTime_ReadStrptrMaybe(parent.tstamp, strval); - break; - } - case ams_FieldId_data: { - retval = data_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2898,121 +2306,72 @@ bool ams::Trace2Msg_ReadFieldMaybe(ams::Trace2Msg& parent, algo::strptr field, a return retval; } -// --- ams.Trace2Msg..ReadStrptrMaybe -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::Trace2Msg from an ascii string. -// The format of the string is an ssim Tuple -bool ams::Trace2Msg_ReadStrptrMaybe(ams::Trace2Msg &parent, algo::strptr in_str) { +// --- ams.ShmemberId..ReadStrptrMaybe +// Read fields of ams::ShmemberId from an ascii string. +// The format of the string is a string with separated values +bool ams::ShmemberId_ReadStrptrMaybe(ams::ShmemberId &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.Trace2Msg"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && Trace2Msg_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; -} - -// --- ams.Trace2Msg..Print -// print string representation of ROW to string STR -// cfmt:ams.Trace2Msg.String printfmt:Tuple -void ams::Trace2Msg_Print(ams::Trace2Msg& row, algo::cstring& str) { - algo::tempstr temp; - str << "ams.Trace2Msg"; - - ams::ProcId_Print(row.proc, temp); - PrintAttrSpaceReset(str,"proc", temp); - - u8_Print(row.trace, temp); - PrintAttrSpaceReset(str,"trace", temp); - - algo::UnTime_Print(row.tstamp, temp); - PrintAttrSpaceReset(str,"tstamp", temp); - - ind_beg(Trace2Msg_data_curs,data,row) { - u64_Print(data, temp); - tempstr name; - name << "data."; - name << ind_curs(data).index; - PrintAttrSpaceReset(str, name, temp); - }ind_end; -} - -// --- ams.TraceInfo2Msg.base.CopyOut -// Copy fields out of row -void ams::parent_CopyOut(ams::TraceInfo2Msg &row, ams::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter -} + algo::strptr value; -// --- ams.TraceInfo2Msg.data.Getary -// Access var-length portion as an aryptr. Length is determined from one of the fields. -algo::aryptr ams::data_Getary(ams::TraceInfo2Msg& parent) { - return algo::aryptr(data_Addr(parent), data_N(parent)); -} + algo::NextSep(in_str, '/', value); + retval = retval && ams::ShmId_ReadStrptrMaybe(parent.shm_id, value); -// --- ams.TraceInfo2Msg.data.Addr -char* ams::data_Addr(ams::TraceInfo2Msg& parent) { - return (char*)((u8*)&parent + sizeof(ams::TraceInfo2Msg)); // address of varlen portion -} + algo::NextSep(in_str, ',', value); + retval = retval && ams::ProcId_ReadStrptrMaybe(parent.proc_id, value); -// --- ams.TraceInfo2Msg.data.ReadStrptrMaybe -// Convert string to field. Return success value -bool ams::data_ReadStrptrMaybe(ams::TraceInfo2Msg& parent, algo::strptr in_str) { - bool retval = true; - if (algo_lib::_db.varlenbuf) { - ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); - } - (void)parent;//only to avoid -Wunused-parameter + value = in_str; + retval = retval && ams::ShmemberFlags_ReadStrptrMaybe(parent.flags, value); return retval; } -// --- ams.TraceInfo2Msg.data.Print -// Convert data to a string. -// Array is printed as a regular string. -void ams::data_Print(ams::TraceInfo2Msg& parent, algo::cstring &rhs) { - rhs << data_Getary(parent); +// --- ams.ShmemberId..Print +// print string representation of ROW to string STR +// cfmt:ams.ShmemberId.String printfmt:Sep +void ams::ShmemberId_Print(ams::ShmemberId row, algo::cstring& str) { + ams::ShmId_Print(row.shm_id, str); + str << '/'; + ams::ProcId_Print(row.proc_id, str); + str << ','; + ams::ShmemberFlags_Print(row.flags, str); +} + +// --- ams.ShmHbMsg.base.CopyOut +// Copy fields out of row +void ams::parent_CopyOut(ams::ShmHbMsg &row, ams::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter } -// --- ams.TraceInfo2Msg..ReadFieldMaybe -bool ams::TraceInfo2Msg_ReadFieldMaybe(ams::TraceInfo2Msg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.ShmHbMsg..ReadFieldMaybe +bool ams::ShmHbMsg_ReadFieldMaybe(ams::ShmHbMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case ams_FieldId_base: { retval = false; - break; - } + } break; case ams_FieldId_type: { retval = false; - break; - } + } break; case ams_FieldId_length: { retval = false; - break; - } - case ams_FieldId_proc: { - retval = ams::ProcId_ReadStrptrMaybe(parent.proc, strval); - break; - } - case ams_FieldId_trace: { - retval = u8_ReadStrptrMaybe(parent.trace, strval); - break; - } - case ams_FieldId_tstamp: { - retval = algo::UnTime_ReadStrptrMaybe(parent.tstamp, strval); - break; - } - case ams_FieldId_part: { - retval = u8_ReadStrptrMaybe(parent.part, strval); - break; - } - case ams_FieldId_data: { - retval = data_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + case ams_FieldId_shmember: { + retval = ams::ShmemberId_ReadStrptrMaybe(parent.shmember, strval); + } break; + case ams_FieldId_off: { + retval = u64_ReadStrptrMaybe(parent.off, strval); + } break; + case ams_FieldId_wbudget: { + retval = u32_ReadStrptrMaybe(parent.wbudget, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3020,115 +2379,104 @@ bool ams::TraceInfo2Msg_ReadFieldMaybe(ams::TraceInfo2Msg& parent, algo::strptr return retval; } -// --- ams.TraceInfo2Msg..ReadStrptrMaybe -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::TraceInfo2Msg from an ascii string. +// --- ams.ShmHbMsg..ReadStrptrMaybe +// Read fields of ams::ShmHbMsg from an ascii string. // The format of the string is an ssim Tuple -bool ams::TraceInfo2Msg_ReadStrptrMaybe(ams::TraceInfo2Msg &parent, algo::strptr in_str) { +bool ams::ShmHbMsg_ReadStrptrMaybe(ams::ShmHbMsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.TraceInfo2Msg"); + retval = algo::StripTypeTag(in_str, "ams.ShmHbMsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && TraceInfo2Msg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && ShmHbMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- ams.TraceInfo2Msg..Print +// --- ams.ShmHbMsg..Print // print string representation of ROW to string STR -// cfmt:ams.TraceInfo2Msg.String printfmt:Tuple -void ams::TraceInfo2Msg_Print(ams::TraceInfo2Msg& row, algo::cstring& str) { +// cfmt:ams.ShmHbMsg.String printfmt:Tuple +void ams::ShmHbMsg_Print(ams::ShmHbMsg& row, algo::cstring& str) { algo::tempstr temp; - str << "ams.TraceInfo2Msg"; - - ams::ProcId_Print(row.proc, temp); - PrintAttrSpaceReset(str,"proc", temp); - - u8_Print(row.trace, temp); - PrintAttrSpaceReset(str,"trace", temp); + str << "ams.ShmHbMsg"; - algo::UnTime_Print(row.tstamp, temp); - PrintAttrSpaceReset(str,"tstamp", temp); + ams::ShmemberId_Print(row.shmember, temp); + PrintAttrSpaceReset(str,"shmember", temp); - u8_Print(row.part, temp); - PrintAttrSpaceReset(str,"part", temp); + u64_Print(row.off, temp); + PrintAttrSpaceReset(str,"off", temp); - ams::data_Print(row, temp); - PrintAttrSpaceReset(str,"data", temp); + u32_Print(row.wbudget, temp); + PrintAttrSpaceReset(str,"wbudget", temp); } -// --- ams.TraceInfoMsg.base.CopyOut +// --- ams.Shmmsg.base.CopyOut // Copy fields out of row -void ams::parent_CopyOut(ams::TraceInfoMsg &row, ams::MsgHeader &out) { +void ams::parent_CopyOut(ams::Shmmsg &row, ams::MsgHeader &out) { // type: field value is computed // length: field value is computed (void)row;//only to avoid -Wunused-parameter (void)out;//only to avoid -Wunused-parameter } -// --- ams.TraceInfoMsg.data.Getary -// Access var-length portion as an aryptr. Length is determined from one of the fields. -algo::aryptr ams::data_Getary(ams::TraceInfoMsg& parent) { - return algo::aryptr(data_Addr(parent), data_N(parent)); +// --- ams.Shmmsg.payload.Getary +// Access optional portion as an array of bytes +algo::aryptr ams::payload_Getary(ams::Shmmsg& parent) { + u8 *end = (u8*)&parent + sizeof(ams::Shmmsg); + return algo::aryptr(end, i32(parent.length) - ssizeof(ams::Shmmsg)); } -// --- ams.TraceInfoMsg.data.Addr -char* ams::data_Addr(ams::TraceInfoMsg& parent) { - return (char*)((u8*)&parent + sizeof(ams::TraceInfoMsg)); // address of varlen portion +// --- ams.Shmmsg.payload.Print +void ams::payload_Print(ams::Shmmsg& parent, cstring &out) { + (void)out; + (void)parent; + if (ams::MsgHeader *payload = payload_Get(parent)) { + ams::MsgHeaderMsgs_Print(out, *payload, INT_MAX); + } } -// --- ams.TraceInfoMsg.data.ReadStrptrMaybe +// --- ams.Shmmsg.payload.ReadStrptrMaybe // Convert string to field. Return success value -bool ams::data_ReadStrptrMaybe(ams::TraceInfoMsg& parent, algo::strptr in_str) { - bool retval = true; +bool ams::payload_ReadStrptrMaybe(ams::Shmmsg &parent, algo::strptr in_str) { + bool retval = false; if (algo_lib::_db.varlenbuf) { - ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + algo::ByteAry temp; + retval = ams::MsgHeaderMsgs_ReadStrptrMaybe(in_str, temp); // read any of several message types here + ary_Setary(*algo_lib::_db.varlenbuf, ary_Getary(temp)); // return it } (void)parent;//only to avoid -Wunused-parameter return retval; } -// --- ams.TraceInfoMsg.data.Print -// Convert data to a string. -// Array is printed as a regular string. -void ams::data_Print(ams::TraceInfoMsg& parent, algo::cstring &rhs) { - rhs << data_Getary(parent); -} - -// --- ams.TraceInfoMsg..ReadFieldMaybe -bool ams::TraceInfoMsg_ReadFieldMaybe(ams::TraceInfoMsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.Shmmsg..ReadFieldMaybe +bool ams::Shmmsg_ReadFieldMaybe(ams::Shmmsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case ams_FieldId_base: { retval = false; - break; - } + } break; case ams_FieldId_type: { retval = false; - break; - } + } break; case ams_FieldId_length: { retval = false; - break; - } - case ams_FieldId_proc: { - retval = ams::ProcId_ReadStrptrMaybe(parent.proc, strval); - break; - } + } break; + case ams_FieldId_shm_id: { + retval = ams::ShmId_ReadStrptrMaybe(parent.shm_id, strval); + } break; + case ams_FieldId_off: { + retval = u64_ReadStrptrMaybe(parent.off, strval); + } break; case ams_FieldId_tstamp: { - retval = algo::UnTime_ReadStrptrMaybe(parent.tstamp, strval); - break; - } - case ams_FieldId_part: { - retval = u8_ReadStrptrMaybe(parent.part, strval); - break; - } - case ams_FieldId_data: { - retval = data_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + retval = u64_ReadStrptrMaybe(parent.tstamp, strval); + } break; + case ams_FieldId_payload: { + retval = payload_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3136,142 +2484,97 @@ bool ams::TraceInfoMsg_ReadFieldMaybe(ams::TraceInfoMsg& parent, algo::strptr fi return retval; } -// --- ams.TraceInfoMsg..ReadStrptrMaybe +// --- ams.Shmmsg..ReadStrptrMaybe // Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::TraceInfoMsg from an ascii string. +// Read fields of ams::Shmmsg from an ascii string. // The format of the string is an ssim Tuple -bool ams::TraceInfoMsg_ReadStrptrMaybe(ams::TraceInfoMsg &parent, algo::strptr in_str) { +bool ams::Shmmsg_ReadStrptrMaybe(ams::Shmmsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.TraceInfoMsg"); + retval = algo::StripTypeTag(in_str, "ams.Shmmsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && TraceInfoMsg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && Shmmsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- ams.TraceInfoMsg..Print +// --- ams.Shmmsg..Print // print string representation of ROW to string STR -// cfmt:ams.TraceInfoMsg.String printfmt:Tuple -void ams::TraceInfoMsg_Print(ams::TraceInfoMsg& row, algo::cstring& str) { +// cfmt:ams.Shmmsg.String printfmt:Tuple +void ams::Shmmsg_Print(ams::Shmmsg& row, algo::cstring& str) { algo::tempstr temp; - str << "ams.TraceInfoMsg"; + str << "ams.Shmmsg"; - ams::ProcId_Print(row.proc, temp); - PrintAttrSpaceReset(str,"proc", temp); + ams::ShmId_Print(row.shm_id, temp); + PrintAttrSpaceReset(str,"shm_id", temp); - algo::UnTime_Print(row.tstamp, temp); - PrintAttrSpaceReset(str,"tstamp", temp); + u64_Print(row.off, temp); + PrintAttrSpaceReset(str,"off", temp); - u8_Print(row.part, temp); - PrintAttrSpaceReset(str,"part", temp); + u64_Print(row.tstamp, temp); + PrintAttrSpaceReset(str,"tstamp", temp); - ams::data_Print(row, temp); - PrintAttrSpaceReset(str,"data", temp); + if (payload_Get(row)) { + ams::payload_Print(row, temp); + PrintAttrSpaceReset(str,"payload", temp); + } } -// --- ams.TraceMsg.base.CopyOut +// --- ams.TerminateMsg.base.CopyOut // Copy fields out of row -void ams::parent_CopyOut(ams::TraceMsg &row, ams::MsgHeader &out) { +void ams::parent_CopyOut(ams::TerminateMsg &row, ams::MsgHeader &out) { // type: field value is computed // length: field value is computed (void)row;//only to avoid -Wunused-parameter (void)out;//only to avoid -Wunused-parameter } -// --- ams.TraceMsg.data.Getary -// Access var-length portion as an aryptr. Length is determined from one of the fields. -algo::aryptr ams::data_Getary(ams::TraceMsg& parent) { - return algo::aryptr(data_Addr(parent), data_N(parent)); -} - -// --- ams.TraceMsg.data.Addr -u64* ams::data_Addr(ams::TraceMsg& parent) { - return (u64*)((u8*)&parent + sizeof(ams::TraceMsg)); // address of varlen portion -} - -// --- ams.TraceMsg.data.ReadStrptrMaybe -// Convert string to field. Return success value -bool ams::data_ReadStrptrMaybe(ams::TraceMsg& parent, algo::strptr in_str) { - bool retval = true; - if (algo_lib::_db.varlenbuf) { - u64 *data_tmp = new(ary_AllocN(*algo_lib::_db.varlenbuf, sizeof(u64)).elems) u64; - retval = u64_ReadStrptrMaybe(*data_tmp, in_str); - } - (void)parent;//only to avoid -Wunused-parameter - return retval; -} - -// --- ams.TraceMsg..ReadFieldMaybe -bool ams::TraceMsg_ReadFieldMaybe(ams::TraceMsg& parent, algo::strptr field, algo::strptr strval) { +// --- ams.TerminateMsg..ReadFieldMaybe +bool ams::TerminateMsg_ReadFieldMaybe(ams::TerminateMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; ams::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case ams_FieldId_base: { retval = false; - break; - } + } break; case ams_FieldId_type: { retval = false; - break; - } + } break; case ams_FieldId_length: { retval = false; - break; - } - case ams_FieldId_proc: { - retval = ams::ProcId_ReadStrptrMaybe(parent.proc, strval); - break; - } - case ams_FieldId_tstamp: { - retval = algo::UnTime_ReadStrptrMaybe(parent.tstamp, strval); - break; - } - case ams_FieldId_data: { - retval = data_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); } + (void)parent;//only to avoid -Wunused-parameter + (void)strval;//only to avoid -Wunused-parameter return retval; } -// --- ams.TraceMsg..ReadStrptrMaybe -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::TraceMsg from an ascii string. +// --- ams.TerminateMsg..ReadStrptrMaybe +// Read fields of ams::TerminateMsg from an ascii string. // The format of the string is an ssim Tuple -bool ams::TraceMsg_ReadStrptrMaybe(ams::TraceMsg &parent, algo::strptr in_str) { +bool ams::TerminateMsg_ReadStrptrMaybe(ams::TerminateMsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "ams.TraceMsg"); + retval = algo::StripTypeTag(in_str, "ams.TerminateMsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && TraceMsg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && TerminateMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- ams.TraceMsg..Print +// --- ams.TerminateMsg..Print // print string representation of ROW to string STR -// cfmt:ams.TraceMsg.String printfmt:Tuple -void ams::TraceMsg_Print(ams::TraceMsg& row, algo::cstring& str) { +// cfmt:ams.TerminateMsg.String printfmt:Tuple +void ams::TerminateMsg_Print(ams::TerminateMsg& row, algo::cstring& str) { algo::tempstr temp; - str << "ams.TraceMsg"; - - ams::ProcId_Print(row.proc, temp); - PrintAttrSpaceReset(str,"proc", temp); - - algo::UnTime_Print(row.tstamp, temp); - PrintAttrSpaceReset(str,"tstamp", temp); - - ind_beg(TraceMsg_data_curs,data,row) { - u64_Print(data, temp); - tempstr name; - name << "data."; - name << ind_curs(data).index; - PrintAttrSpaceReset(str, name, temp); - }ind_end; + str << "ams.TerminateMsg"; + (void)row;//only to avoid -Wunused-parameter } // --- ams.UdpFrame.header.CopyOut @@ -3333,27 +2636,26 @@ inline static void ams::SizeCheck() { // --- ams...StaticCheck void ams::StaticCheck() { - algo_assert(_offset_of(ams::AlarmSyncMsg, updated_after) + sizeof(((ams::AlarmSyncMsg*)0)->updated_after) == sizeof(ams::AlarmSyncMsg)); - algo_assert(_offset_of(ams::ProcType, value) + sizeof(((ams::ProcType*)0)->value) == sizeof(ams::ProcType)); - algo_assert(_offset_of(ams::ProcId, procidx) + sizeof(((ams::ProcId*)0)->procidx) == sizeof(ams::ProcId)); - algo_assert(_offset_of(ams::StreamType, value) + sizeof(((ams::StreamType*)0)->value) == sizeof(ams::StreamType)); - algo_assert(_offset_of(ams::StreamId, streamidx) + sizeof(((ams::StreamId*)0)->streamidx) == sizeof(ams::StreamId)); - algo_assert(_offset_of(ams::DfltStream, stream_id) + sizeof(((ams::DfltStream*)0)->stream_id) == sizeof(ams::DfltStream)); - algo_assert(_offset_of(ams::DumpStreamTableMsg, proc_id) + sizeof(((ams::DumpStreamTableMsg*)0)->proc_id) == sizeof(ams::DumpStreamTableMsg)); algo_assert(_offset_of(ams::FieldId, value) + sizeof(((ams::FieldId*)0)->value) == sizeof(ams::FieldId)); - algo_assert(_offset_of(ams::HeartbeatMsg, time) + sizeof(((ams::HeartbeatMsg*)0)->time) == sizeof(ams::HeartbeatMsg)); - algo_assert(_offset_of(ams::Member, mode) + sizeof(((ams::Member*)0)->mode) == sizeof(ams::Member)); + algo_assert(_offset_of(ams::Proctype, value) + sizeof(((ams::Proctype*)0)->value) == sizeof(ams::Proctype)); + // check that bitfield fits width + algo_assert(sizeof(((ams::ProcId*)0)->value)*8 >= 32); + algo_assert(_offset_of(ams::ProcId, value) + sizeof(((ams::ProcId*)0)->value) == sizeof(ams::ProcId)); algo_assert(_offset_of(ams::MsgHeaderMsgsCase, value) + sizeof(((ams::MsgHeaderMsgsCase*)0)->value) == sizeof(ams::MsgHeaderMsgsCase)); algo_assert(_offset_of(ams::MsgHeader_curs, msglen) + sizeof(((ams::MsgHeader_curs*)0)->msglen) == sizeof(ams::MsgHeader_curs)); - algo_assert(_offset_of(ams::StreamPos, off) + sizeof(((ams::StreamPos*)0)->off) == sizeof(ams::StreamPos)); - algo_assert(_offset_of(ams::OpenMsg, pos) + sizeof(((ams::OpenMsg*)0)->pos) == sizeof(ams::OpenMsg)); - algo_assert(_offset_of(ams::ProcAddMsg, proc_id) + sizeof(((ams::ProcAddMsg*)0)->proc_id) == sizeof(ams::ProcAddMsg)); - algo_assert(_offset_of(ams::ProcRemoveMsg, proc_id) + sizeof(((ams::ProcRemoveMsg*)0)->proc_id) == sizeof(ams::ProcRemoveMsg)); - algo_assert(_offset_of(ams::SeqmsgId, off) + sizeof(((ams::SeqmsgId*)0)->off) == sizeof(ams::SeqmsgId)); + algo_assert(_offset_of(ams::ProcEofMsg, proc) + sizeof(((ams::ProcEofMsg*)0)->proc) == sizeof(ams::ProcEofMsg)); + algo_assert(_offset_of(ams::ProcKillMsg, signal) + sizeof(((ams::ProcKillMsg*)0)->signal) == sizeof(ams::ProcKillMsg)); + algo_assert(_offset_of(ams::ProcStatusMsg, status) + sizeof(((ams::ProcStatusMsg*)0)->status) == sizeof(ams::ProcStatusMsg)); // check that bitfield fits width - algo_assert(sizeof(((ams::StreamFlags*)0)->value)*8 >= 8); - algo_assert(_offset_of(ams::StreamFlags, value) + sizeof(((ams::StreamFlags*)0)->value) == sizeof(ams::StreamFlags)); - algo_assert(_offset_of(ams::StreamHbMsg, wbudget) + sizeof(((ams::StreamHbMsg*)0)->wbudget) == sizeof(ams::StreamHbMsg)); + algo_assert(sizeof(((ams::ShmFlags*)0)->value)*8 >= 7); + algo_assert(_offset_of(ams::ShmFlags, value) + sizeof(((ams::ShmFlags*)0)->value) == sizeof(ams::ShmFlags)); + algo_assert(_offset_of(ams::Shmtype, value) + sizeof(((ams::Shmtype*)0)->value) == sizeof(ams::Shmtype)); + algo_assert(_offset_of(ams::ShmId, index) + sizeof(((ams::ShmId*)0)->index) == sizeof(ams::ShmId)); + // check that bitfield fits width + algo_assert(sizeof(((ams::ShmemberFlags*)0)->value)*8 >= 2); + algo_assert(_offset_of(ams::ShmemberFlags, value) + sizeof(((ams::ShmemberFlags*)0)->value) == sizeof(ams::ShmemberFlags)); + algo_assert(_offset_of(ams::ShmemberId, flags) + sizeof(((ams::ShmemberId*)0)->flags) == sizeof(ams::ShmemberId)); + algo_assert(_offset_of(ams::ShmHbMsg, wbudget) + sizeof(((ams::ShmHbMsg*)0)->wbudget) == sizeof(ams::ShmHbMsg)); algo_assert(_offset_of(ams::TerminateMsg, length) + sizeof(((ams::TerminateMsg*)0)->length) == sizeof(ams::TerminateMsg)); } @@ -3363,31 +2665,11 @@ void ams::StaticCheck() { // This function will additionally validate that sizeof(Msg) <= msg_len bool ams::MsgHeaderMsgs_Print(algo::cstring &str, ams::MsgHeader &msg, u32 msg_len) { switch(msg.type) { - case 18: { - if (sizeof(ams::AlarmSyncMsg) > msg_len) { return false; } - AlarmSyncMsg_Print((ams::AlarmSyncMsg&)(msg), str); - return true; - } - case 21: { - if (sizeof(ams::DfltStream) > msg_len) { return false; } - DfltStream_Print((ams::DfltStream&)(msg), str); - return true; - } - case 12: { - if (sizeof(ams::DumpStreamTableMsg) > msg_len) { return false; } - DumpStreamTableMsg_Print((ams::DumpStreamTableMsg&)(msg), str); - return true; - } case 395: { if (sizeof(ams::ExpectMsg) > msg_len) { return false; } ExpectMsg_Print((ams::ExpectMsg&)(msg), str); return true; } - case 16: { - if (sizeof(ams::HeartbeatMsg) > msg_len) { return false; } - HeartbeatMsg_Print((ams::HeartbeatMsg&)(msg), str); - return true; - } case 22: { if (sizeof(ams::InputLineMsg) > msg_len) { return false; } InputLineMsg_Print((ams::InputLineMsg&)(msg), str); @@ -3403,39 +2685,49 @@ bool ams::MsgHeaderMsgs_Print(algo::cstring &str, ams::MsgHeader &msg, u32 msg_l MsgBlock_Print((ams::MsgBlock&)(msg), str); return true; } - case 7: { - if (sizeof(ams::OpenMsg) > msg_len) { return false; } - OpenMsg_Print((ams::OpenMsg&)(msg), str); + case 703: { + if (sizeof(ams::ProcEofMsg) > msg_len) { return false; } + ProcEofMsg_Print((ams::ProcEofMsg&)(msg), str); return true; } - case 229: { - if (sizeof(ams::PrlogMsg) > msg_len) { return false; } - PrlogMsg_Print((ams::PrlogMsg&)(msg), str); + case 704: { + if (sizeof(ams::ProcKillMsg) > msg_len) { return false; } + ProcKillMsg_Print((ams::ProcKillMsg&)(msg), str); return true; } - case 4: { - if (sizeof(ams::ProcAddMsg) > msg_len) { return false; } - ProcAddMsg_Print((ams::ProcAddMsg&)(msg), str); + case 701: { + if (sizeof(ams::ProcMsg) > msg_len) { return false; } + ProcMsg_Print((ams::ProcMsg&)(msg), str); return true; } - case 5: { - if (sizeof(ams::ProcRemoveMsg) > msg_len) { return false; } - ProcRemoveMsg_Print((ams::ProcRemoveMsg&)(msg), str); + case 702: { + if (sizeof(ams::ProcReadMsg) > msg_len) { return false; } + ProcReadMsg_Print((ams::ProcReadMsg&)(msg), str); return true; } - case 10: { - if (sizeof(ams::Seqmsg) > msg_len) { return false; } - Seqmsg_Print((ams::Seqmsg&)(msg), str); + case 700: { + if (sizeof(ams::ProcStartMsg) > msg_len) { return false; } + ProcStartMsg_Print((ams::ProcStartMsg&)(msg), str); return true; } - case 11: { - if (sizeof(ams::SeqmsgTrace) > msg_len) { return false; } - SeqmsgTrace_Print((ams::SeqmsgTrace&)(msg), str); + case 705: { + if (sizeof(ams::ProcStatusMsg) > msg_len) { return false; } + ProcStatusMsg_Print((ams::ProcStatusMsg&)(msg), str); + return true; + } + case 633: { + if (sizeof(ams::RemDirRecurseMsg) > msg_len) { return false; } + RemDirRecurseMsg_Print((ams::RemDirRecurseMsg&)(msg), str); return true; } case 3: { - if (sizeof(ams::StreamHbMsg) > msg_len) { return false; } - StreamHbMsg_Print((ams::StreamHbMsg&)(msg), str); + if (sizeof(ams::ShmHbMsg) > msg_len) { return false; } + ShmHbMsg_Print((ams::ShmHbMsg&)(msg), str); + return true; + } + case 10: { + if (sizeof(ams::Shmmsg) > msg_len) { return false; } + Shmmsg_Print((ams::Shmmsg&)(msg), str); return true; } case 352: { @@ -3443,34 +2735,39 @@ bool ams::MsgHeaderMsgs_Print(algo::cstring &str, ams::MsgHeader &msg, u32 msg_l TerminateMsg_Print((ams::TerminateMsg&)(msg), str); return true; } - case 108: { - if (sizeof(ams::Trace2Msg) > msg_len) { return false; } - Trace2Msg_Print((ams::Trace2Msg&)(msg), str); + case 2: { + if (sizeof(ams::UdpFrame) > msg_len) { return false; } + UdpFrame_Print((ams::UdpFrame&)(msg), str); return true; } - case 109: { - if (sizeof(ams::TraceInfo2Msg) > msg_len) { return false; } - TraceInfo2Msg_Print((ams::TraceInfo2Msg&)(msg), str); + case 17: { + if (sizeof(fm::AlarmMsg) > msg_len) { return false; } + AlarmMsg_Print((fm::AlarmMsg&)(msg), str); return true; } - case 9: { - if (sizeof(ams::TraceInfoMsg) > msg_len) { return false; } - TraceInfoMsg_Print((ams::TraceInfoMsg&)(msg), str); + case 504: { + if (sizeof(ws::CloseMsg) > msg_len) { return false; } + CloseMsg_Print((ws::CloseMsg&)(msg), str); return true; } - case 8: { - if (sizeof(ams::TraceMsg) > msg_len) { return false; } - TraceMsg_Print((ams::TraceMsg&)(msg), str); + case 502: { + if (sizeof(ws::ConnectMsg) > msg_len) { return false; } + ConnectMsg_Print((ws::ConnectMsg&)(msg), str); return true; } - case 2: { - if (sizeof(ams::UdpFrame) > msg_len) { return false; } - UdpFrame_Print((ams::UdpFrame&)(msg), str); + case 503: { + if (sizeof(ws::DataMsg) > msg_len) { return false; } + DataMsg_Print((ws::DataMsg&)(msg), str); return true; } - case 17: { - if (sizeof(fm::AlarmMsg) > msg_len) { return false; } - AlarmMsg_Print((fm::AlarmMsg&)(msg), str); + case 500: { + if (sizeof(ws::ServerStartMsg) > msg_len) { return false; } + ServerStartMsg_Print((ws::ServerStartMsg&)(msg), str); + return true; + } + case 501: { + if (sizeof(ws::ServerStopMsg) > msg_len) { return false; } + ServerStopMsg_Print((ws::ServerStopMsg&)(msg), str); return true; } default: @@ -3489,24 +2786,6 @@ ams::MsgHeaderMsgsCase ams::MsgHeaderMsgs_ReadStrptr(algo::strptr str, algo::Byt ams::MsgHeaderMsgsCase msgtype; value_SetStrptrMaybe(msgtype, msgtype_str); // map string -> enum switch (value_GetEnum(msgtype)) { // what message is it? - case ams_MsgHeaderMsgsCase_ams_AlarmSyncMsg: { - int len = sizeof(ams::AlarmSyncMsg); - ams::AlarmSyncMsg *ctype = new(ary_AllocN(buf, len).elems) ams::AlarmSyncMsg; // default values - ok = AlarmSyncMsg_ReadStrptrMaybe(*ctype, str); // now read attributes - } break; // ams::AlarmSyncMsg case - - case ams_MsgHeaderMsgsCase_ams_DfltStream: { - int len = sizeof(ams::DfltStream); - ams::DfltStream *ctype = new(ary_AllocN(buf, len).elems) ams::DfltStream; // default values - ok = DfltStream_ReadStrptrMaybe(*ctype, str); // now read attributes - } break; // ams::DfltStream case - - case ams_MsgHeaderMsgsCase_ams_DumpStreamTableMsg: { - int len = sizeof(ams::DumpStreamTableMsg); - ams::DumpStreamTableMsg *ctype = new(ary_AllocN(buf, len).elems) ams::DumpStreamTableMsg; // default values - ok = DumpStreamTableMsg_ReadStrptrMaybe(*ctype, str); // now read attributes - } break; // ams::DumpStreamTableMsg case - case ams_MsgHeaderMsgsCase_ams_ExpectMsg: { int len = sizeof(ams::ExpectMsg); ams::ExpectMsg *ctype = new(ary_AllocN(buf, len).elems) ams::ExpectMsg; // default values @@ -3520,12 +2799,6 @@ ams::MsgHeaderMsgsCase ams::MsgHeaderMsgs_ReadStrptr(algo::strptr str, algo::Byt algo_lib::_db.varlenbuf = varlenbuf_save; } break; // ams::ExpectMsg case - case ams_MsgHeaderMsgsCase_ams_HeartbeatMsg: { - int len = sizeof(ams::HeartbeatMsg); - ams::HeartbeatMsg *ctype = new(ary_AllocN(buf, len).elems) ams::HeartbeatMsg; // default values - ok = HeartbeatMsg_ReadStrptrMaybe(*ctype, str); // now read attributes - } break; // ams::HeartbeatMsg case - case ams_MsgHeaderMsgsCase_ams_InputLineMsg: { int len = sizeof(ams::InputLineMsg); ams::InputLineMsg *ctype = new(ary_AllocN(buf, len).elems) ams::InputLineMsg; // default values @@ -3556,136 +2829,154 @@ ams::MsgHeaderMsgsCase ams::MsgHeaderMsgs_ReadStrptr(algo::strptr str, algo::Byt // no cfmt read:Y found -- cannot read } break; // ams::MsgBlock case - case ams_MsgHeaderMsgsCase_ams_OpenMsg: { - int len = sizeof(ams::OpenMsg); - ams::OpenMsg *ctype = new(ary_AllocN(buf, len).elems) ams::OpenMsg; // default values - ok = OpenMsg_ReadStrptrMaybe(*ctype, str); // now read attributes - } break; // ams::OpenMsg case - - case ams_MsgHeaderMsgsCase_ams_PrlogMsg: { - int len = sizeof(ams::PrlogMsg); - ams::PrlogMsg *ctype = new(ary_AllocN(buf, len).elems) ams::PrlogMsg; // default values + case ams_MsgHeaderMsgsCase_ams_ProcEofMsg: { + int len = sizeof(ams::ProcEofMsg); + ams::ProcEofMsg *ctype = new(ary_AllocN(buf, len).elems) ams::ProcEofMsg; // default values + ok = ProcEofMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + } break; // ams::ProcEofMsg case + + case ams_MsgHeaderMsgsCase_ams_ProcKillMsg: { + int len = sizeof(ams::ProcKillMsg); + ams::ProcKillMsg *ctype = new(ary_AllocN(buf, len).elems) ams::ProcKillMsg; // default values + ok = ProcKillMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + } break; // ams::ProcKillMsg case + + case ams_MsgHeaderMsgsCase_ams_ProcMsg: { + int len = sizeof(ams::ProcMsg); + ams::ProcMsg *ctype = new(ary_AllocN(buf, len).elems) ams::ProcMsg; // default values algo::ByteAry varlenbuf; algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; algo_lib::_db.varlenbuf = &varlenbuf; - ok = PrlogMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + ok = ProcMsg_ReadStrptrMaybe(*ctype, str); // now read attributes len += ary_N(varlenbuf); ctype->length = u32(len); ary_Addary(buf, ary_Getary(varlenbuf)); algo_lib::_db.varlenbuf = varlenbuf_save; - } break; // ams::PrlogMsg case - - case ams_MsgHeaderMsgsCase_ams_ProcAddMsg: { - int len = sizeof(ams::ProcAddMsg); - ams::ProcAddMsg *ctype = new(ary_AllocN(buf, len).elems) ams::ProcAddMsg; // default values - ok = ProcAddMsg_ReadStrptrMaybe(*ctype, str); // now read attributes - } break; // ams::ProcAddMsg case - - case ams_MsgHeaderMsgsCase_ams_ProcRemoveMsg: { - int len = sizeof(ams::ProcRemoveMsg); - ams::ProcRemoveMsg *ctype = new(ary_AllocN(buf, len).elems) ams::ProcRemoveMsg; // default values - ok = ProcRemoveMsg_ReadStrptrMaybe(*ctype, str); // now read attributes - } break; // ams::ProcRemoveMsg case - - case ams_MsgHeaderMsgsCase_ams_Seqmsg: { - int len = sizeof(ams::Seqmsg); - ams::Seqmsg *ctype = new(ary_AllocN(buf, len).elems) ams::Seqmsg; // default values + } break; // ams::ProcMsg case + + case ams_MsgHeaderMsgsCase_ams_ProcReadMsg: { + int len = sizeof(ams::ProcReadMsg); + ams::ProcReadMsg *ctype = new(ary_AllocN(buf, len).elems) ams::ProcReadMsg; // default values algo::ByteAry varlenbuf; algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; algo_lib::_db.varlenbuf = &varlenbuf; - ok = Seqmsg_ReadStrptrMaybe(*ctype, str); // now read attributes + ok = ProcReadMsg_ReadStrptrMaybe(*ctype, str); // now read attributes len += ary_N(varlenbuf); ctype->length = u32(len); ary_Addary(buf, ary_Getary(varlenbuf)); algo_lib::_db.varlenbuf = varlenbuf_save; - } break; // ams::Seqmsg case + } break; // ams::ProcReadMsg case - case ams_MsgHeaderMsgsCase_ams_SeqmsgTrace: { - int len = sizeof(ams::SeqmsgTrace); - ams::SeqmsgTrace *ctype = new(ary_AllocN(buf, len).elems) ams::SeqmsgTrace; // default values + case ams_MsgHeaderMsgsCase_ams_ProcStartMsg: { + int len = sizeof(ams::ProcStartMsg); + ams::ProcStartMsg *ctype = new(ary_AllocN(buf, len).elems) ams::ProcStartMsg; // default values algo::ByteAry varlenbuf; algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; algo_lib::_db.varlenbuf = &varlenbuf; - ok = SeqmsgTrace_ReadStrptrMaybe(*ctype, str); // now read attributes + ok = ProcStartMsg_ReadStrptrMaybe(*ctype, str); // now read attributes len += ary_N(varlenbuf); ctype->length = u32(len); ary_Addary(buf, ary_Getary(varlenbuf)); algo_lib::_db.varlenbuf = varlenbuf_save; - } break; // ams::SeqmsgTrace case - - case ams_MsgHeaderMsgsCase_ams_StreamHbMsg: { - int len = sizeof(ams::StreamHbMsg); - ams::StreamHbMsg *ctype = new(ary_AllocN(buf, len).elems) ams::StreamHbMsg; // default values - ok = StreamHbMsg_ReadStrptrMaybe(*ctype, str); // now read attributes - } break; // ams::StreamHbMsg case + } break; // ams::ProcStartMsg case - case ams_MsgHeaderMsgsCase_ams_TerminateMsg: { - int len = sizeof(ams::TerminateMsg); - ams::TerminateMsg *ctype = new(ary_AllocN(buf, len).elems) ams::TerminateMsg; // default values - ok = TerminateMsg_ReadStrptrMaybe(*ctype, str); // now read attributes - } break; // ams::TerminateMsg case + case ams_MsgHeaderMsgsCase_ams_ProcStatusMsg: { + int len = sizeof(ams::ProcStatusMsg); + ams::ProcStatusMsg *ctype = new(ary_AllocN(buf, len).elems) ams::ProcStatusMsg; // default values + ok = ProcStatusMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + } break; // ams::ProcStatusMsg case - case ams_MsgHeaderMsgsCase_ams_Trace2Msg: { - int len = sizeof(ams::Trace2Msg); - ams::Trace2Msg *ctype = new(ary_AllocN(buf, len).elems) ams::Trace2Msg; // default values + case ams_MsgHeaderMsgsCase_ams_RemDirRecurseMsg: { + int len = sizeof(ams::RemDirRecurseMsg); + ams::RemDirRecurseMsg *ctype = new(ary_AllocN(buf, len).elems) ams::RemDirRecurseMsg; // default values algo::ByteAry varlenbuf; algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; algo_lib::_db.varlenbuf = &varlenbuf; - ok = Trace2Msg_ReadStrptrMaybe(*ctype, str); // now read attributes + ok = RemDirRecurseMsg_ReadStrptrMaybe(*ctype, str); // now read attributes len += ary_N(varlenbuf); ctype->length = u32(len); ary_Addary(buf, ary_Getary(varlenbuf)); algo_lib::_db.varlenbuf = varlenbuf_save; - } break; // ams::Trace2Msg case + } break; // ams::RemDirRecurseMsg case + + case ams_MsgHeaderMsgsCase_ams_ShmHbMsg: { + int len = sizeof(ams::ShmHbMsg); + ams::ShmHbMsg *ctype = new(ary_AllocN(buf, len).elems) ams::ShmHbMsg; // default values + ok = ShmHbMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + } break; // ams::ShmHbMsg case - case ams_MsgHeaderMsgsCase_ams_TraceInfo2Msg: { - int len = sizeof(ams::TraceInfo2Msg); - ams::TraceInfo2Msg *ctype = new(ary_AllocN(buf, len).elems) ams::TraceInfo2Msg; // default values + case ams_MsgHeaderMsgsCase_ams_Shmmsg: { + int len = sizeof(ams::Shmmsg); + ams::Shmmsg *ctype = new(ary_AllocN(buf, len).elems) ams::Shmmsg; // default values algo::ByteAry varlenbuf; algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; algo_lib::_db.varlenbuf = &varlenbuf; - ok = TraceInfo2Msg_ReadStrptrMaybe(*ctype, str); // now read attributes + ok = Shmmsg_ReadStrptrMaybe(*ctype, str); // now read attributes len += ary_N(varlenbuf); ctype->length = u32(len); ary_Addary(buf, ary_Getary(varlenbuf)); algo_lib::_db.varlenbuf = varlenbuf_save; - } break; // ams::TraceInfo2Msg case + } break; // ams::Shmmsg case + + case ams_MsgHeaderMsgsCase_ams_TerminateMsg: { + int len = sizeof(ams::TerminateMsg); + ams::TerminateMsg *ctype = new(ary_AllocN(buf, len).elems) ams::TerminateMsg; // default values + ok = TerminateMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + } break; // ams::TerminateMsg case + + case ams_MsgHeaderMsgsCase_ams_UdpFrame: { + // no cfmt read:Y found -- cannot read + } break; // ams::UdpFrame case + + case ams_MsgHeaderMsgsCase_fm_AlarmMsg: { + int len = sizeof(fm::AlarmMsg); + fm::AlarmMsg *ctype = new(ary_AllocN(buf, len).elems) fm::AlarmMsg; // default values + ok = AlarmMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + } break; // fm::AlarmMsg case - case ams_MsgHeaderMsgsCase_ams_TraceInfoMsg: { - int len = sizeof(ams::TraceInfoMsg); - ams::TraceInfoMsg *ctype = new(ary_AllocN(buf, len).elems) ams::TraceInfoMsg; // default values + case ams_MsgHeaderMsgsCase_ws_CloseMsg: { + int len = sizeof(ws::CloseMsg); + ws::CloseMsg *ctype = new(ary_AllocN(buf, len).elems) ws::CloseMsg; // default values algo::ByteAry varlenbuf; algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; algo_lib::_db.varlenbuf = &varlenbuf; - ok = TraceInfoMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + ok = CloseMsg_ReadStrptrMaybe(*ctype, str); // now read attributes len += ary_N(varlenbuf); ctype->length = u32(len); ary_Addary(buf, ary_Getary(varlenbuf)); algo_lib::_db.varlenbuf = varlenbuf_save; - } break; // ams::TraceInfoMsg case + } break; // ws::CloseMsg case - case ams_MsgHeaderMsgsCase_ams_TraceMsg: { - int len = sizeof(ams::TraceMsg); - ams::TraceMsg *ctype = new(ary_AllocN(buf, len).elems) ams::TraceMsg; // default values + case ams_MsgHeaderMsgsCase_ws_ConnectMsg: { + int len = sizeof(ws::ConnectMsg); + ws::ConnectMsg *ctype = new(ary_AllocN(buf, len).elems) ws::ConnectMsg; // default values + ok = ConnectMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + } break; // ws::ConnectMsg case + + case ams_MsgHeaderMsgsCase_ws_DataMsg: { + int len = sizeof(ws::DataMsg); + ws::DataMsg *ctype = new(ary_AllocN(buf, len).elems) ws::DataMsg; // default values algo::ByteAry varlenbuf; algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; algo_lib::_db.varlenbuf = &varlenbuf; - ok = TraceMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + ok = DataMsg_ReadStrptrMaybe(*ctype, str); // now read attributes len += ary_N(varlenbuf); ctype->length = u32(len); ary_Addary(buf, ary_Getary(varlenbuf)); algo_lib::_db.varlenbuf = varlenbuf_save; - } break; // ams::TraceMsg case + } break; // ws::DataMsg case - case ams_MsgHeaderMsgsCase_ams_UdpFrame: { - // no cfmt read:Y found -- cannot read - } break; // ams::UdpFrame case + case ams_MsgHeaderMsgsCase_ws_ServerStartMsg: { + int len = sizeof(ws::ServerStartMsg); + ws::ServerStartMsg *ctype = new(ary_AllocN(buf, len).elems) ws::ServerStartMsg; // default values + ok = ServerStartMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + } break; // ws::ServerStartMsg case - case ams_MsgHeaderMsgsCase_fm_AlarmMsg: { - int len = sizeof(fm::AlarmMsg); - fm::AlarmMsg *ctype = new(ary_AllocN(buf, len).elems) fm::AlarmMsg; // default values - ok = AlarmMsg_ReadStrptrMaybe(*ctype, str); // now read attributes - } break; // fm::AlarmMsg case + case ams_MsgHeaderMsgsCase_ws_ServerStopMsg: { + int len = sizeof(ws::ServerStopMsg); + ws::ServerStopMsg *ctype = new(ary_AllocN(buf, len).elems) ws::ServerStopMsg; // default values + ok = ServerStopMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + } break; // ws::ServerStopMsg case default: break; } @@ -3702,18 +2993,22 @@ bool ams::MsgHeaderMsgs_ReadStrptrMaybe(algo::strptr str, algo::ByteAry &buf) { // --- ams...LogMsg_FmtByteAry // Construct a new ams::LogMsg in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -ams::LogMsg * ams::LogMsg_FmtByteAry(algo::ByteAry &buf, const algo::strptr& logcat, algo::SchedTime tstamp, algo::aryptr text) { +ams::LogMsg * ams::LogMsg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc_id, algo::SchedTime tstamp, algo::aryptr logcat, algo::aryptr text) { ams::LogMsg *msg = NULL; size_t len = sizeof(ams::LogMsg); - u32 ary_len = elems_N(text) * sizeof(char); - len += ary_len; + u32 logcat_ary_len = elems_N(logcat) * sizeof(char); + len += logcat_ary_len; + u32 text_ary_len = elems_N(text) * sizeof(char); + len += text_ary_len; ary_RemoveAll(buf); msg = (ams::LogMsg*)ary_AllocN(buf,len).elems; msg->type = u32(6); msg->length = u32(len + (0)); - msg->logcat = logcat; + msg->proc_id = proc_id; msg->tstamp = tstamp; - memcpy(text_Addr(*msg), text.elems, ary_len); + memcpy(logcat_Addr(*msg), logcat.elems, logcat_ary_len); + (*msg).logcat_end = u32(logcat_ary_len); + memcpy(text_Addr(*msg), text.elems, text_ary_len); return msg; } @@ -3723,8 +3018,8 @@ ams::LogMsg * ams::LogMsg_FmtByteAry(algo::ByteAry &buf, const algo::strptr& log ams::MsgBlock * ams::MsgBlock_FmtByteAry(algo::ByteAry &buf, u64 first_seqno, u32 n_messages, u32 original_length, algo::aryptr messages) { ams::MsgBlock *msg = NULL; size_t len = sizeof(ams::MsgBlock); - u32 ary_len = elems_N(messages) * sizeof(u8); - len += ary_len; + u32 messages_ary_len = elems_N(messages) * sizeof(u8); + len += messages_ary_len; ary_RemoveAll(buf); msg = (ams::MsgBlock*)ary_AllocN(buf,len).elems; msg->type = u32(1); @@ -3732,7 +3027,7 @@ ams::MsgBlock * ams::MsgBlock_FmtByteAry(algo::ByteAry &buf, u64 first_seqno, u3 msg->first_seqno = first_seqno; msg->n_messages = n_messages; msg->original_length = original_length; - memcpy(messages_Addr(*msg), messages.elems, ary_len); + memcpy(messages_Addr(*msg), messages.elems, messages_ary_len); return msg; } @@ -3743,8 +3038,8 @@ ams::MsgBlock * ams::MsgBlock_FmtByteAry(algo::ByteAry &buf, u64 first_seqno, u3 ams::MsgBlock * ams::MsgBlock_FmtMemptr(algo::memptr &buf, u64 first_seqno, u32 n_messages, u32 original_length, algo::aryptr messages) { ams::MsgBlock *msg = NULL; size_t len = sizeof(ams::MsgBlock); - u32 ary_len = elems_N(messages) * sizeof(u8); - len += ary_len; + u32 messages_ary_len = elems_N(messages) * sizeof(u8); + len += messages_ary_len; if (len > u32(elems_N(buf))) { return NULL; // no room. } @@ -3755,105 +3050,7 @@ ams::MsgBlock * ams::MsgBlock_FmtMemptr(algo::memptr &buf, u64 first_seqno, u32 msg->first_seqno = first_seqno; msg->n_messages = n_messages; msg->original_length = original_length; - memcpy(messages_Addr(*msg), messages.elems, ary_len); - return msg; -} - -// --- ams...SeqmsgTrace_FmtByteAry -// Construct a new ams::SeqmsgTrace in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::SeqmsgTrace * ams::SeqmsgTrace_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc_id, u8 mode, ams::SeqmsgId seqmsg_id, u64 tsc, ams::MsgHeader* payload) { - ams::SeqmsgTrace *msg = NULL; - size_t len = sizeof(ams::SeqmsgTrace); - int opt_len = payload ? i32(payload[0].length) : 0; - len += opt_len; - ary_RemoveAll(buf); - msg = (ams::SeqmsgTrace*)ary_AllocN(buf,len).elems; - msg->type = u32(11); - msg->length = u32(len + (0)); - msg->proc_id = proc_id; - msg->mode = mode; - msg->seqmsg_id = seqmsg_id; - msg->tsc = tsc; - if (payload) { - memcpy((u8*)msg + sizeof(ams::SeqmsgTrace), payload, opt_len); - } - return msg; -} - -// --- ams...Trace2Msg_FmtByteAry -// Construct a new ams::Trace2Msg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::Trace2Msg * ams::Trace2Msg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc, u8 trace, algo::UnTime tstamp, algo::aryptr data) { - ams::Trace2Msg *msg = NULL; - size_t len = sizeof(ams::Trace2Msg); - u32 ary_len = elems_N(data) * sizeof(u64); - len += ary_len; - ary_RemoveAll(buf); - msg = (ams::Trace2Msg*)ary_AllocN(buf,len).elems; - msg->type = u32(108); - msg->length = u32(len + (0)); - msg->proc = proc; - msg->trace = trace; - msg->tstamp = tstamp; - memcpy(data_Addr(*msg), data.elems, ary_len); - return msg; -} - -// --- ams...TraceInfo2Msg_FmtByteAry -// Construct a new ams::TraceInfo2Msg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::TraceInfo2Msg * ams::TraceInfo2Msg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc, u8 trace, algo::UnTime tstamp, u8 part, algo::aryptr data) { - ams::TraceInfo2Msg *msg = NULL; - size_t len = sizeof(ams::TraceInfo2Msg); - u32 ary_len = elems_N(data) * sizeof(char); - len += ary_len; - ary_RemoveAll(buf); - msg = (ams::TraceInfo2Msg*)ary_AllocN(buf,len).elems; - msg->type = u32(109); - msg->length = u32(len + (0)); - msg->proc = proc; - msg->trace = trace; - msg->tstamp = tstamp; - msg->part = part; - memcpy(data_Addr(*msg), data.elems, ary_len); - return msg; -} - -// --- ams...TraceInfoMsg_FmtByteAry -// Construct a new ams::TraceInfoMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::TraceInfoMsg * ams::TraceInfoMsg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc, algo::UnTime tstamp, u8 part, algo::aryptr data) { - ams::TraceInfoMsg *msg = NULL; - size_t len = sizeof(ams::TraceInfoMsg); - u32 ary_len = elems_N(data) * sizeof(char); - len += ary_len; - ary_RemoveAll(buf); - msg = (ams::TraceInfoMsg*)ary_AllocN(buf,len).elems; - msg->type = u32(9); - msg->length = u32(len + (0)); - msg->proc = proc; - msg->tstamp = tstamp; - msg->part = part; - memcpy(data_Addr(*msg), data.elems, ary_len); - return msg; -} - -// --- ams...TraceMsg_FmtByteAry -// Construct a new ams::TraceMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::TraceMsg * ams::TraceMsg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc, algo::UnTime tstamp, algo::aryptr data) { - ams::TraceMsg *msg = NULL; - size_t len = sizeof(ams::TraceMsg); - u32 ary_len = elems_N(data) * sizeof(u64); - len += ary_len; - ary_RemoveAll(buf); - msg = (ams::TraceMsg*)ary_AllocN(buf,len).elems; - msg->type = u32(8); - msg->length = u32(len + (0)); - msg->proc = proc; - msg->tstamp = tstamp; - memcpy(data_Addr(*msg), data.elems, ary_len); + memcpy(messages_Addr(*msg), messages.elems, messages_ary_len); return msg; } @@ -3863,8 +3060,8 @@ ams::TraceMsg * ams::TraceMsg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc, a ams::UdpFrame * ams::UdpFrame_FmtByteAry(algo::ByteAry &buf, algo::UnTime timestamp, ietf::Ipv4 src_ip, ietf::Ipv4 dst_ip, u16 src_port, u16 dst_port, algo::aryptr payload) { ams::UdpFrame *msg = NULL; size_t len = sizeof(ams::UdpFrame); - u32 ary_len = elems_N(payload) * sizeof(u8); - len += ary_len; + u32 payload_ary_len = elems_N(payload) * sizeof(u8); + len += payload_ary_len; ary_RemoveAll(buf); msg = (ams::UdpFrame*)ary_AllocN(buf,len).elems; msg->type = u32(2); @@ -3874,7 +3071,7 @@ ams::UdpFrame * ams::UdpFrame_FmtByteAry(algo::ByteAry &buf, algo::UnTime timest msg->dst_ip = dst_ip; msg->src_port = src_port; msg->dst_port = dst_port; - memcpy(payload_Addr(*msg), payload.elems, ary_len); + memcpy(payload_Addr(*msg), payload.elems, payload_ary_len); return msg; } @@ -3885,8 +3082,8 @@ ams::UdpFrame * ams::UdpFrame_FmtByteAry(algo::ByteAry &buf, algo::UnTime timest ams::UdpFrame * ams::UdpFrame_FmtMemptr(algo::memptr &buf, algo::UnTime timestamp, ietf::Ipv4 src_ip, ietf::Ipv4 dst_ip, u16 src_port, u16 dst_port, algo::aryptr payload) { ams::UdpFrame *msg = NULL; size_t len = sizeof(ams::UdpFrame); - u32 ary_len = elems_N(payload) * sizeof(u8); - len += ary_len; + u32 payload_ary_len = elems_N(payload) * sizeof(u8); + len += payload_ary_len; if (len > u32(elems_N(buf))) { return NULL; // no room. } @@ -3899,6 +3096,6 @@ ams::UdpFrame * ams::UdpFrame_FmtMemptr(algo::memptr &buf, algo::UnTime timestam msg->dst_ip = dst_ip; msg->src_port = src_port; msg->dst_port = dst_port; - memcpy(payload_Addr(*msg), payload.elems, ary_len); + memcpy(payload_Addr(*msg), payload.elems, payload_ary_len); return msg; } diff --git a/cpp/gen/ams_sendtest_gen.cpp b/cpp/gen/ams_sendtest_gen.cpp index eec46a10..0d89e5ab 100644 --- a/cpp/gen/ams_sendtest_gen.cpp +++ b/cpp/gen/ams_sendtest_gen.cpp @@ -43,8 +43,8 @@ // Instantiate all libraries linked into this executable, // in dependency order -algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_json::FDb lib_json::_db; // dependency found via dev.targdep +algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_ams::FDb lib_ams::_db; // dependency found via dev.targdep ams_sendtest::FDb ams_sendtest::_db; // dependency found via dev.targdep @@ -67,8 +67,8 @@ const char *ams_sendtest_help = " -msgsize_max int 1024 Maximum message length\n" " -bufsize int 32768 Shared memory buffer size\n" " -recvdelay int 0 Pause nanoseconds between messages\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -100,6 +100,12 @@ void ams_sendtest::AmsSendTest_Print(ams_sendtest::AmsSendTest& row, algo::cstri u64_Print(row.n_msg_send, temp); PrintAttrSpaceReset(str,"n_msg_send", temp); + u64_Print(row.off_send, temp); + PrintAttrSpaceReset(str,"off_send", temp); + + u64_Print(row.off_recv, temp); + PrintAttrSpaceReset(str,"off_recv", temp); + u64_Print(row.n_msg_recv, temp); PrintAttrSpaceReset(str,"n_msg_recv", temp); @@ -171,7 +177,7 @@ algo::Fildes ams_sendtest::child_StartRead(ams_sendtest::FChild& child, algo_lib // --- ams_sendtest.FChild.child.Kill // Kill subprocess and wait void ams_sendtest::child_Kill(ams_sendtest::FChild& child) { - if (child.child_pid != 0) { + if (child.child_pid > 0) { kill(child.child_pid,9); child_Wait(child); } @@ -437,9 +443,8 @@ void ams_sendtest::ReadArgv() { } if (ch_N(attrname) == 0) { err << "ams_sendtest: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:ams_sendtest.FDb.cmdline @@ -493,7 +501,7 @@ void ams_sendtest::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -560,8 +568,8 @@ bool ams_sendtest::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && ams_sendtest::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -833,13 +841,14 @@ void ams_sendtest::StaticCheck() { // --- ams_sendtest...main int main(int argc, char **argv) { try { - algo_lib::FDb_Init(); lib_json::FDb_Init(); + algo_lib::FDb_Init(); lib_ams::FDb_Init(); ams_sendtest::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock ams_sendtest::ReadArgv(); // dmmeta.main:ams_sendtest ams_sendtest::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -852,8 +861,8 @@ int main(int argc, char **argv) { try { ams_sendtest::FDb_Uninit(); lib_ams::FDb_Uninit(); - lib_json::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/amsdb_gen.cpp b/cpp/gen/amsdb_gen.cpp index fffae180..46159da4 100644 --- a/cpp/gen/amsdb_gen.cpp +++ b/cpp/gen/amsdb_gen.cpp @@ -45,7 +45,8 @@ const char* amsdb::value_ToCstr(const amsdb::FieldId& parent) { case amsdb_FieldId_id : ret = "id"; break; case amsdb_FieldId_ns : ret = "ns"; break; case amsdb_FieldId_comment : ret = "comment"; break; - case amsdb_FieldId_streamtype : ret = "streamtype"; break; + case amsdb_FieldId_shmtype : ret = "shmtype"; break; + case amsdb_FieldId_nonblock : ret = "nonblock"; break; case amsdb_FieldId_value : ret = "value"; break; } return ret; @@ -94,26 +95,23 @@ bool amsdb::value_SetStrptrMaybe(amsdb::FieldId& parent, algo::strptr rhs) { case LE_STR7('c','o','m','m','e','n','t'): { value_SetEnum(parent,amsdb_FieldId_comment); ret = true; break; } + case LE_STR7('s','h','m','t','y','p','e'): { + value_SetEnum(parent,amsdb_FieldId_shmtype); ret = true; break; + } } break; } case 8: { switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('n','o','n','b','l','o','c','k'): { + value_SetEnum(parent,amsdb_FieldId_nonblock); ret = true; break; + } case LE_STR8('p','r','o','c','t','y','p','e'): { value_SetEnum(parent,amsdb_FieldId_proctype); ret = true; break; } } break; } - case 10: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('s','t','r','e','a','m','t','y'): { - if (memcmp(rhs.elems+8,"pe",2)==0) { value_SetEnum(parent,amsdb_FieldId_streamtype); ret = true; break; } - break; - } - } - break; - } } return ret; } @@ -152,29 +150,28 @@ void amsdb::FieldId_Print(amsdb::FieldId& row, algo::cstring& str) { amsdb::value_Print(row, str); } -// --- amsdb.ProcType..ReadFieldMaybe -bool amsdb::ProcType_ReadFieldMaybe(amsdb::ProcType& parent, algo::strptr field, algo::strptr strval) { +// --- amsdb.Proctype..ReadFieldMaybe +bool amsdb::Proctype_ReadFieldMaybe(amsdb::Proctype& parent, algo::strptr field, algo::strptr strval) { bool retval = true; amsdb::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case amsdb_FieldId_proctype: { - retval = algo::Smallstr50_ReadStrptrMaybe(parent.proctype, strval); - break; - } + retval = algo::Smallstr16_ReadStrptrMaybe(parent.proctype, strval); + } break; case amsdb_FieldId_id: { retval = u32_ReadStrptrMaybe(parent.id, strval); - break; - } + } break; case amsdb_FieldId_ns: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.ns, strval); - break; - } + } break; case amsdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -182,26 +179,26 @@ bool amsdb::ProcType_ReadFieldMaybe(amsdb::ProcType& parent, algo::strptr field, return retval; } -// --- amsdb.ProcType..ReadStrptrMaybe -// Read fields of amsdb::ProcType from an ascii string. +// --- amsdb.Proctype..ReadStrptrMaybe +// Read fields of amsdb::Proctype from an ascii string. // The format of the string is an ssim Tuple -bool amsdb::ProcType_ReadStrptrMaybe(amsdb::ProcType &parent, algo::strptr in_str) { +bool amsdb::Proctype_ReadStrptrMaybe(amsdb::Proctype &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "amsdb.proctype") || algo::StripTypeTag(in_str, "amsdb.ProcType"); + retval = algo::StripTypeTag(in_str, "amsdb.proctype") || algo::StripTypeTag(in_str, "amsdb.Proctype"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && ProcType_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && Proctype_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- amsdb.ProcType..Print +// --- amsdb.Proctype..Print // print string representation of ROW to string STR -// cfmt:amsdb.ProcType.String printfmt:Tuple -void amsdb::ProcType_Print(amsdb::ProcType& row, algo::cstring& str) { +// cfmt:amsdb.Proctype.String printfmt:Tuple +void amsdb::Proctype_Print(amsdb::Proctype& row, algo::cstring& str) { algo::tempstr temp; str << "amsdb.proctype"; - algo::Smallstr50_Print(row.proctype, temp); + algo::Smallstr16_Print(row.proctype, temp); PrintAttrSpaceReset(str,"proctype", temp); u32_Print(row.id, temp); @@ -214,25 +211,28 @@ void amsdb::ProcType_Print(amsdb::ProcType& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } -// --- amsdb.StreamType..ReadFieldMaybe -bool amsdb::StreamType_ReadFieldMaybe(amsdb::StreamType& parent, algo::strptr field, algo::strptr strval) { +// --- amsdb.Shmtype..ReadFieldMaybe +bool amsdb::Shmtype_ReadFieldMaybe(amsdb::Shmtype& parent, algo::strptr field, algo::strptr strval) { bool retval = true; amsdb::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case amsdb_FieldId_streamtype: { - retval = algo::Smallstr50_ReadStrptrMaybe(parent.streamtype, strval); - break; - } + case amsdb_FieldId_shmtype: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.shmtype, strval); + } break; case amsdb_FieldId_id: { - retval = ams::StreamType_ReadStrptrMaybe(parent.id, strval); - break; - } + retval = ams::Shmtype_ReadStrptrMaybe(parent.id, strval); + } break; + case amsdb_FieldId_nonblock: { + retval = bool_ReadStrptrMaybe(parent.nonblock, strval); + } break; case amsdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -240,32 +240,35 @@ bool amsdb::StreamType_ReadFieldMaybe(amsdb::StreamType& parent, algo::strptr fi return retval; } -// --- amsdb.StreamType..ReadStrptrMaybe -// Read fields of amsdb::StreamType from an ascii string. +// --- amsdb.Shmtype..ReadStrptrMaybe +// Read fields of amsdb::Shmtype from an ascii string. // The format of the string is an ssim Tuple -bool amsdb::StreamType_ReadStrptrMaybe(amsdb::StreamType &parent, algo::strptr in_str) { +bool amsdb::Shmtype_ReadStrptrMaybe(amsdb::Shmtype &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "amsdb.streamtype") || algo::StripTypeTag(in_str, "amsdb.StreamType"); + retval = algo::StripTypeTag(in_str, "amsdb.shmtype") || algo::StripTypeTag(in_str, "amsdb.Shmtype"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && StreamType_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && Shmtype_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- amsdb.StreamType..Print +// --- amsdb.Shmtype..Print // print string representation of ROW to string STR -// cfmt:amsdb.StreamType.String printfmt:Tuple -void amsdb::StreamType_Print(amsdb::StreamType& row, algo::cstring& str) { +// cfmt:amsdb.Shmtype.String printfmt:Tuple +void amsdb::Shmtype_Print(amsdb::Shmtype& row, algo::cstring& str) { algo::tempstr temp; - str << "amsdb.streamtype"; + str << "amsdb.shmtype"; - algo::Smallstr50_Print(row.streamtype, temp); - PrintAttrSpaceReset(str,"streamtype", temp); + algo::Smallstr50_Print(row.shmtype, temp); + PrintAttrSpaceReset(str,"shmtype", temp); - // printing funique, gconst id for pkey amsdb.StreamType.streamtype + // printing funique, gconst id for pkey amsdb.Shmtype.shmtype u8_Print(row.id.value, temp); PrintAttrSpaceReset(str,"id", temp); + bool_Print(row.nonblock, temp); + PrintAttrSpaceReset(str,"nonblock", temp); + algo::Comment_Print(row.comment, temp); PrintAttrSpaceReset(str,"comment", temp); } diff --git a/cpp/gen/apm_gen.cpp b/cpp/gen/apm_gen.cpp index f9d7fb14..3bbe73fb 100644 --- a/cpp/gen/apm_gen.cpp +++ b/cpp/gen/apm_gen.cpp @@ -35,24 +35,24 @@ #include "include/gen/dev_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/lib_amcdb_gen.h" #include "include/gen/lib_amcdb_gen.inl.h" #include "include/gen/lib_ctype_gen.h" #include "include/gen/lib_ctype_gen.inl.h" #include "include/gen/lib_git_gen.h" #include "include/gen/lib_git_gen.inl.h" -#include "include/gen/lib_json_gen.h" -#include "include/gen/lib_json_gen.inl.h" #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_ctype::FDb lib_ctype::_db; // dependency found via dev.targdep lib_git::FDb lib_git::_db; // dependency found via dev.targdep -lib_json::FDb lib_json::_db; // dependency found via dev.targdep apm::FDb apm::_db; // dependency found via dev.targdep namespace apm { @@ -86,8 +86,8 @@ const char *apm_help = " -data_in string \"data\" Dataset from which package records are loaded\n" " -e Open selected records in editor\n" " -binpath string \"bin\" (internal use)\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -96,8 +96,6 @@ const char *apm_help = } // namespace apm namespace apm { // gen:ns_gsymbol - const algo::strptr dev_package_amc("amc"); - const algo::strptr dev_package_apm("apm"); const algo::strptr dev_package_openacr("openacr"); } // gen:ns_gsymbol namespace apm { // gen:ns_print_proto @@ -162,15 +160,11 @@ algo::Smallstr100 apm::name_Get(apm::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void apm::c_field_Insert(apm::FCtype& ctype, apm::FField& row) { - if (bool_Update(row.ctype_c_field_in_ary,true)) { - // reserve space + if (!row.ctype_c_field_in_ary) { c_field_Reserve(ctype, 1); - u32 n = ctype.c_field_n; - u32 at = n; - apm::FField* *elems = ctype.c_field_elems; - elems[at] = &row; - ctype.c_field_n = n+1; - + u32 n = ctype.c_field_n++; + ctype.c_field_elems[n] = &row; + row.ctype_c_field_in_ary = true; } } @@ -179,7 +173,7 @@ void apm::c_field_Insert(apm::FCtype& ctype, apm::FField& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool apm::c_field_InsertMaybe(apm::FCtype& ctype, apm::FField& row) { - bool retval = !row.ctype_c_field_in_ary; + bool retval = !ctype_c_field_InAryQ(row); c_field_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -187,18 +181,18 @@ bool apm::c_field_InsertMaybe(apm::FCtype& ctype, apm::FField& row) { // --- apm.FCtype.c_field.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void apm::c_field_Remove(apm::FCtype& ctype, apm::FField& row) { + int n = ctype.c_field_n; if (bool_Update(row.ctype_c_field_in_ary,false)) { - int lim = ctype.c_field_n; apm::FField* *elems = ctype.c_field_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { apm::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(apm::FField*) * (lim - j); + size_t nbytes = sizeof(apm::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_field_n = lim - 1; + ctype.c_field_n = n - 1; break; } } @@ -226,15 +220,11 @@ void apm::c_field_Reserve(apm::FCtype& ctype, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void apm::c_ssimreq_Insert(apm::FCtype& ctype, apm::FSsimreq& row) { - if (bool_Update(row.ctype_c_ssimreq_in_ary,true)) { - // reserve space + if (!row.ctype_c_ssimreq_in_ary) { c_ssimreq_Reserve(ctype, 1); - u32 n = ctype.c_ssimreq_n; - u32 at = n; - apm::FSsimreq* *elems = ctype.c_ssimreq_elems; - elems[at] = &row; - ctype.c_ssimreq_n = n+1; - + u32 n = ctype.c_ssimreq_n++; + ctype.c_ssimreq_elems[n] = &row; + row.ctype_c_ssimreq_in_ary = true; } } @@ -243,7 +233,7 @@ void apm::c_ssimreq_Insert(apm::FCtype& ctype, apm::FSsimreq& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool apm::c_ssimreq_InsertMaybe(apm::FCtype& ctype, apm::FSsimreq& row) { - bool retval = !row.ctype_c_ssimreq_in_ary; + bool retval = !ctype_c_ssimreq_InAryQ(row); c_ssimreq_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -251,18 +241,18 @@ bool apm::c_ssimreq_InsertMaybe(apm::FCtype& ctype, apm::FSsimreq& row) { // --- apm.FCtype.c_ssimreq.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void apm::c_ssimreq_Remove(apm::FCtype& ctype, apm::FSsimreq& row) { + int n = ctype.c_ssimreq_n; if (bool_Update(row.ctype_c_ssimreq_in_ary,false)) { - int lim = ctype.c_ssimreq_n; apm::FSsimreq* *elems = ctype.c_ssimreq_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { apm::FSsimreq* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(apm::FSsimreq*) * (lim - j); + size_t nbytes = sizeof(apm::FSsimreq*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_ssimreq_n = lim - 1; + ctype.c_ssimreq_n = n - 1; break; } } @@ -393,9 +383,8 @@ void apm::ReadArgv() { } if (ch_N(attrname) == 0) { err << "apm: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:apm.FDb.cmdline @@ -449,7 +441,7 @@ void apm::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -494,7 +486,7 @@ static void apm::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'apm.Input' signature:'6cd9ce149ee2dcf2150fc77eec6ace0504e98b5a'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'apm.Input' signature:'8e39e16efc1a10730e148e6d4ccba5b97e895ab6'"); } // --- apm.FDb._db.InsertStrptrMaybe @@ -605,8 +597,8 @@ bool apm::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && apm::LoadTuplesFile(algo::SsimFname(root,"dev.pkgdep"),recursive); retval = retval && apm::LoadTuplesFile(algo::SsimFname(root,"amcdb.bltin"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -858,14 +850,9 @@ apm::FPackage* apm::zd_sel_package_RemoveFirst() { // Find row by key. Return NULL if not found. apm::FPackage* apm::ind_package_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_package_buckets_n - 1); - apm::FPackage* *e = &_db.ind_package_buckets_elems[index]; - apm::FPackage* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).package == key; - if (done) break; - e = &ret->ind_package_next; - } while (true); + apm::FPackage *ret = _db.ind_package_buckets_elems[index]; + for (; ret && !((*ret).package == key); ret = ret->ind_package_next) { + } return ret; } @@ -897,10 +884,11 @@ apm::FPackage& apm::ind_package_GetOrCreate(const algo::strptr& key) { // --- apm.FDb.ind_package.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool apm::ind_package_InsertMaybe(apm::FPackage& row) { - ind_package_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_package_next == (apm::FPackage*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.package) & (_db.ind_package_buckets_n - 1); + row.ind_package_hashval = algo::Smallstr50_Hash(0, row.package); + ind_package_Reserve(1); + u32 index = row.ind_package_hashval & (_db.ind_package_buckets_n - 1); apm::FPackage* *prev = &_db.ind_package_buckets_elems[index]; do { apm::FPackage* ret = *prev; @@ -926,7 +914,7 @@ bool apm::ind_package_InsertMaybe(apm::FPackage& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void apm::ind_package_Remove(apm::FPackage& row) { if (LIKELY(row.ind_package_next != (apm::FPackage*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.package) & (_db.ind_package_buckets_n - 1); + u32 index = row.ind_package_hashval & (_db.ind_package_buckets_n - 1); apm::FPackage* *prev = &_db.ind_package_buckets_elems[index]; // addr of pointer to current element while (apm::FPackage *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -943,8 +931,14 @@ void apm::ind_package_Remove(apm::FPackage& row) { // --- apm.FDb.ind_package.Reserve // Reserve enough room in the hash for N more elements. Return success code. void apm::ind_package_Reserve(int n) { + ind_package_AbsReserve(_db.ind_package_n + n); +} + +// --- apm.FDb.ind_package.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void apm::ind_package_AbsReserve(int n) { u32 old_nbuckets = _db.ind_package_buckets_n; - u32 new_nelems = _db.ind_package_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -963,7 +957,7 @@ void apm::ind_package_Reserve(int n) { while (elem) { apm::FPackage &row = *elem; apm::FPackage* next = row.ind_package_next; - u32 index = algo::Smallstr50_Hash(0, row.package) & (new_nbuckets-1); + u32 index = row.ind_package_hashval & (new_nbuckets-1); row.ind_package_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1306,14 +1300,9 @@ bool apm::mergefile_XrefMaybe(apm::FMergefile &row) { // Find row by key. Return NULL if not found. apm::FMergefile* apm::ind_mergefile_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_mergefile_buckets_n - 1); - apm::FMergefile* *e = &_db.ind_mergefile_buckets_elems[index]; - apm::FMergefile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).mergefile == key; - if (done) break; - e = &ret->ind_mergefile_next; - } while (true); + apm::FMergefile *ret = _db.ind_mergefile_buckets_elems[index]; + for (; ret && !((*ret).mergefile == key); ret = ret->ind_mergefile_next) { + } return ret; } @@ -1345,10 +1334,11 @@ apm::FMergefile& apm::ind_mergefile_GetOrCreate(const algo::strptr& key) { // --- apm.FDb.ind_mergefile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool apm::ind_mergefile_InsertMaybe(apm::FMergefile& row) { - ind_mergefile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_mergefile_next == (apm::FMergefile*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.mergefile) & (_db.ind_mergefile_buckets_n - 1); + row.ind_mergefile_hashval = algo::cstring_Hash(0, row.mergefile); + ind_mergefile_Reserve(1); + u32 index = row.ind_mergefile_hashval & (_db.ind_mergefile_buckets_n - 1); apm::FMergefile* *prev = &_db.ind_mergefile_buckets_elems[index]; do { apm::FMergefile* ret = *prev; @@ -1374,7 +1364,7 @@ bool apm::ind_mergefile_InsertMaybe(apm::FMergefile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void apm::ind_mergefile_Remove(apm::FMergefile& row) { if (LIKELY(row.ind_mergefile_next != (apm::FMergefile*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.mergefile) & (_db.ind_mergefile_buckets_n - 1); + u32 index = row.ind_mergefile_hashval & (_db.ind_mergefile_buckets_n - 1); apm::FMergefile* *prev = &_db.ind_mergefile_buckets_elems[index]; // addr of pointer to current element while (apm::FMergefile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1391,8 +1381,14 @@ void apm::ind_mergefile_Remove(apm::FMergefile& row) { // --- apm.FDb.ind_mergefile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void apm::ind_mergefile_Reserve(int n) { + ind_mergefile_AbsReserve(_db.ind_mergefile_n + n); +} + +// --- apm.FDb.ind_mergefile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void apm::ind_mergefile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_mergefile_buckets_n; - u32 new_nelems = _db.ind_mergefile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1411,7 +1407,7 @@ void apm::ind_mergefile_Reserve(int n) { while (elem) { apm::FMergefile &row = *elem; apm::FMergefile* next = row.ind_mergefile_next; - u32 index = algo::cstring_Hash(0, row.mergefile) & (new_nbuckets-1); + u32 index = row.ind_mergefile_hashval & (new_nbuckets-1); row.ind_mergefile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1428,14 +1424,9 @@ void apm::ind_mergefile_Reserve(int n) { // Find row by key. Return NULL if not found. apm::FPkgkey* apm::ind_pkgkey_Find(const algo::strptr& key) { u32 index = algo::Smallstr150_Hash(0, key) & (_db.ind_pkgkey_buckets_n - 1); - apm::FPkgkey* *e = &_db.ind_pkgkey_buckets_elems[index]; - apm::FPkgkey* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).pkgkey == key; - if (done) break; - e = &ret->ind_pkgkey_next; - } while (true); + apm::FPkgkey *ret = _db.ind_pkgkey_buckets_elems[index]; + for (; ret && !((*ret).pkgkey == key); ret = ret->ind_pkgkey_next) { + } return ret; } @@ -1450,10 +1441,11 @@ apm::FPkgkey& apm::ind_pkgkey_FindX(const algo::strptr& key) { // --- apm.FDb.ind_pkgkey.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool apm::ind_pkgkey_InsertMaybe(apm::FPkgkey& row) { - ind_pkgkey_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_pkgkey_next == (apm::FPkgkey*)-1)) {// check if in hash already - u32 index = algo::Smallstr150_Hash(0, row.pkgkey) & (_db.ind_pkgkey_buckets_n - 1); + row.ind_pkgkey_hashval = algo::Smallstr150_Hash(0, row.pkgkey); + ind_pkgkey_Reserve(1); + u32 index = row.ind_pkgkey_hashval & (_db.ind_pkgkey_buckets_n - 1); apm::FPkgkey* *prev = &_db.ind_pkgkey_buckets_elems[index]; do { apm::FPkgkey* ret = *prev; @@ -1479,7 +1471,7 @@ bool apm::ind_pkgkey_InsertMaybe(apm::FPkgkey& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void apm::ind_pkgkey_Remove(apm::FPkgkey& row) { if (LIKELY(row.ind_pkgkey_next != (apm::FPkgkey*)-1)) {// check if in hash already - u32 index = algo::Smallstr150_Hash(0, row.pkgkey) & (_db.ind_pkgkey_buckets_n - 1); + u32 index = row.ind_pkgkey_hashval & (_db.ind_pkgkey_buckets_n - 1); apm::FPkgkey* *prev = &_db.ind_pkgkey_buckets_elems[index]; // addr of pointer to current element while (apm::FPkgkey *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1496,8 +1488,14 @@ void apm::ind_pkgkey_Remove(apm::FPkgkey& row) { // --- apm.FDb.ind_pkgkey.Reserve // Reserve enough room in the hash for N more elements. Return success code. void apm::ind_pkgkey_Reserve(int n) { + ind_pkgkey_AbsReserve(_db.ind_pkgkey_n + n); +} + +// --- apm.FDb.ind_pkgkey.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void apm::ind_pkgkey_AbsReserve(int n) { u32 old_nbuckets = _db.ind_pkgkey_buckets_n; - u32 new_nelems = _db.ind_pkgkey_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1516,7 +1514,7 @@ void apm::ind_pkgkey_Reserve(int n) { while (elem) { apm::FPkgkey &row = *elem; apm::FPkgkey* next = row.ind_pkgkey_next; - u32 index = algo::Smallstr150_Hash(0, row.pkgkey) & (new_nbuckets-1); + u32 index = row.ind_pkgkey_hashval & (new_nbuckets-1); row.ind_pkgkey_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1640,14 +1638,9 @@ bool apm::ctype_XrefMaybe(apm::FCtype &row) { // Find row by key. Return NULL if not found. apm::FCtype* apm::ind_ctype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctype_buckets_n - 1); - apm::FCtype* *e = &_db.ind_ctype_buckets_elems[index]; - apm::FCtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctype_next; - } while (true); + apm::FCtype *ret = _db.ind_ctype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctype_next) { + } return ret; } @@ -1679,10 +1672,11 @@ apm::FCtype& apm::ind_ctype_GetOrCreate(const algo::strptr& key) { // --- apm.FDb.ind_ctype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool apm::ind_ctype_InsertMaybe(apm::FCtype& row) { - ind_ctype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ctype_next == (apm::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + row.ind_ctype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctype_Reserve(1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); apm::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; do { apm::FCtype* ret = *prev; @@ -1708,7 +1702,7 @@ bool apm::ind_ctype_InsertMaybe(apm::FCtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void apm::ind_ctype_Remove(apm::FCtype& row) { if (LIKELY(row.ind_ctype_next != (apm::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); apm::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; // addr of pointer to current element while (apm::FCtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1725,8 +1719,14 @@ void apm::ind_ctype_Remove(apm::FCtype& row) { // --- apm.FDb.ind_ctype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void apm::ind_ctype_Reserve(int n) { + ind_ctype_AbsReserve(_db.ind_ctype_n + n); +} + +// --- apm.FDb.ind_ctype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void apm::ind_ctype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ctype_buckets_n; - u32 new_nelems = _db.ind_ctype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1745,7 +1745,7 @@ void apm::ind_ctype_Reserve(int n) { while (elem) { apm::FCtype &row = *elem; apm::FCtype* next = row.ind_ctype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ctype_hashval & (new_nbuckets-1); row.ind_ctype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1891,14 +1891,9 @@ bool apm::field_XrefMaybe(apm::FField &row) { // Find row by key. Return NULL if not found. apm::FField* apm::ind_field_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_field_buckets_n - 1); - apm::FField* *e = &_db.ind_field_buckets_elems[index]; - apm::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + apm::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_field_next) { + } return ret; } @@ -1913,10 +1908,11 @@ apm::FField& apm::ind_field_FindX(const algo::strptr& key) { // --- apm.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool apm::ind_field_InsertMaybe(apm::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (apm::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::Smallstr100_Hash(0, row.field); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); apm::FField* *prev = &_db.ind_field_buckets_elems[index]; do { apm::FField* ret = *prev; @@ -1942,7 +1938,7 @@ bool apm::ind_field_InsertMaybe(apm::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void apm::ind_field_Remove(apm::FField& row) { if (LIKELY(row.ind_field_next != (apm::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); apm::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (apm::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1959,8 +1955,14 @@ void apm::ind_field_Remove(apm::FField& row) { // --- apm.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void apm::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- apm.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void apm::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1979,7 +1981,7 @@ void apm::ind_field_Reserve(int n) { while (elem) { apm::FField &row = *elem; apm::FField* next = row.ind_field_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2121,14 +2123,9 @@ bool apm::ssimfile_XrefMaybe(apm::FSsimfile &row) { // Find row by key. Return NULL if not found. apm::FSsimfile* apm::ind_ssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimfile_buckets_n - 1); - apm::FSsimfile* *e = &_db.ind_ssimfile_buckets_elems[index]; - apm::FSsimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimfile_next; - } while (true); + apm::FSsimfile *ret = _db.ind_ssimfile_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimfile_next) { + } return ret; } @@ -2143,10 +2140,11 @@ apm::FSsimfile& apm::ind_ssimfile_FindX(const algo::strptr& key) { // --- apm.FDb.ind_ssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool apm::ind_ssimfile_InsertMaybe(apm::FSsimfile& row) { - ind_ssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimfile_next == (apm::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + row.ind_ssimfile_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimfile_Reserve(1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); apm::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; do { apm::FSsimfile* ret = *prev; @@ -2172,7 +2170,7 @@ bool apm::ind_ssimfile_InsertMaybe(apm::FSsimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void apm::ind_ssimfile_Remove(apm::FSsimfile& row) { if (LIKELY(row.ind_ssimfile_next != (apm::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); apm::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; // addr of pointer to current element while (apm::FSsimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2189,8 +2187,14 @@ void apm::ind_ssimfile_Remove(apm::FSsimfile& row) { // --- apm.FDb.ind_ssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void apm::ind_ssimfile_Reserve(int n) { + ind_ssimfile_AbsReserve(_db.ind_ssimfile_n + n); +} + +// --- apm.FDb.ind_ssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void apm::ind_ssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimfile_buckets_n; - u32 new_nelems = _db.ind_ssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2209,7 +2213,7 @@ void apm::ind_ssimfile_Reserve(int n) { while (elem) { apm::FSsimfile &row = *elem; apm::FSsimfile* next = row.ind_ssimfile_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimfile_hashval & (new_nbuckets-1); row.ind_ssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2343,14 +2347,9 @@ bool apm::rec_XrefMaybe(apm::FRec &row) { // Find row by key. Return NULL if not found. apm::FRec* apm::ind_rec_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_rec_buckets_n - 1); - apm::FRec* *e = &_db.ind_rec_buckets_elems[index]; - apm::FRec* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).rec == key; - if (done) break; - e = &ret->ind_rec_next; - } while (true); + apm::FRec *ret = _db.ind_rec_buckets_elems[index]; + for (; ret && !((*ret).rec == key); ret = ret->ind_rec_next) { + } return ret; } @@ -2365,10 +2364,11 @@ apm::FRec& apm::ind_rec_FindX(const algo::strptr& key) { // --- apm.FDb.ind_rec.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool apm::ind_rec_InsertMaybe(apm::FRec& row) { - ind_rec_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_rec_next == (apm::FRec*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.rec) & (_db.ind_rec_buckets_n - 1); + row.ind_rec_hashval = algo::cstring_Hash(0, row.rec); + ind_rec_Reserve(1); + u32 index = row.ind_rec_hashval & (_db.ind_rec_buckets_n - 1); apm::FRec* *prev = &_db.ind_rec_buckets_elems[index]; do { apm::FRec* ret = *prev; @@ -2394,7 +2394,7 @@ bool apm::ind_rec_InsertMaybe(apm::FRec& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void apm::ind_rec_Remove(apm::FRec& row) { if (LIKELY(row.ind_rec_next != (apm::FRec*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.rec) & (_db.ind_rec_buckets_n - 1); + u32 index = row.ind_rec_hashval & (_db.ind_rec_buckets_n - 1); apm::FRec* *prev = &_db.ind_rec_buckets_elems[index]; // addr of pointer to current element while (apm::FRec *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2411,8 +2411,14 @@ void apm::ind_rec_Remove(apm::FRec& row) { // --- apm.FDb.ind_rec.Reserve // Reserve enough room in the hash for N more elements. Return success code. void apm::ind_rec_Reserve(int n) { + ind_rec_AbsReserve(_db.ind_rec_n + n); +} + +// --- apm.FDb.ind_rec.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void apm::ind_rec_AbsReserve(int n) { u32 old_nbuckets = _db.ind_rec_buckets_n; - u32 new_nelems = _db.ind_rec_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2431,7 +2437,7 @@ void apm::ind_rec_Reserve(int n) { while (elem) { apm::FRec &row = *elem; apm::FRec* next = row.ind_rec_next; - u32 index = algo::cstring_Hash(0, row.rec) & (new_nbuckets-1); + u32 index = row.ind_rec_hashval & (new_nbuckets-1); row.ind_rec_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3194,14 +3200,9 @@ bool apm::mkdir_XrefMaybe(apm::FMkdir &row) { // Find row by key. Return NULL if not found. apm::FMkdir* apm::ind_mkdir_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_mkdir_buckets_n - 1); - apm::FMkdir* *e = &_db.ind_mkdir_buckets_elems[index]; - apm::FMkdir* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).mkdir == key; - if (done) break; - e = &ret->ind_mkdir_next; - } while (true); + apm::FMkdir *ret = _db.ind_mkdir_buckets_elems[index]; + for (; ret && !((*ret).mkdir == key); ret = ret->ind_mkdir_next) { + } return ret; } @@ -3233,10 +3234,11 @@ apm::FMkdir& apm::ind_mkdir_GetOrCreate(const algo::strptr& key) { // --- apm.FDb.ind_mkdir.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool apm::ind_mkdir_InsertMaybe(apm::FMkdir& row) { - ind_mkdir_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_mkdir_next == (apm::FMkdir*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.mkdir) & (_db.ind_mkdir_buckets_n - 1); + row.ind_mkdir_hashval = algo::cstring_Hash(0, row.mkdir); + ind_mkdir_Reserve(1); + u32 index = row.ind_mkdir_hashval & (_db.ind_mkdir_buckets_n - 1); apm::FMkdir* *prev = &_db.ind_mkdir_buckets_elems[index]; do { apm::FMkdir* ret = *prev; @@ -3262,7 +3264,7 @@ bool apm::ind_mkdir_InsertMaybe(apm::FMkdir& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void apm::ind_mkdir_Remove(apm::FMkdir& row) { if (LIKELY(row.ind_mkdir_next != (apm::FMkdir*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.mkdir) & (_db.ind_mkdir_buckets_n - 1); + u32 index = row.ind_mkdir_hashval & (_db.ind_mkdir_buckets_n - 1); apm::FMkdir* *prev = &_db.ind_mkdir_buckets_elems[index]; // addr of pointer to current element while (apm::FMkdir *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3279,8 +3281,14 @@ void apm::ind_mkdir_Remove(apm::FMkdir& row) { // --- apm.FDb.ind_mkdir.Reserve // Reserve enough room in the hash for N more elements. Return success code. void apm::ind_mkdir_Reserve(int n) { + ind_mkdir_AbsReserve(_db.ind_mkdir_n + n); +} + +// --- apm.FDb.ind_mkdir.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void apm::ind_mkdir_AbsReserve(int n) { u32 old_nbuckets = _db.ind_mkdir_buckets_n; - u32 new_nelems = _db.ind_mkdir_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3299,7 +3307,7 @@ void apm::ind_mkdir_Reserve(int n) { while (elem) { apm::FMkdir &row = *elem; apm::FMkdir* next = row.ind_mkdir_next; - u32 index = algo::cstring_Hash(0, row.mkdir) & (new_nbuckets-1); + u32 index = row.ind_mkdir_hashval & (new_nbuckets-1); row.ind_mkdir_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3744,6 +3752,7 @@ void apm::FField_Init(apm::FField& field) { field.p_arg = NULL; field.ctype_c_field_in_ary = bool(false); field.ind_field_next = (apm::FField*)-1; // (apm.FDb.ind_field) not-in-hash + field.ind_field_hashval = 0; // stored hash value } // --- apm.FField..Uninit @@ -3836,12 +3845,12 @@ void apm::package_CopyIn(apm::FPackage &row, dev::Package &in) { // --- apm.FPackage.zd_pkgkey.Insert // Insert row into linked list. If row is already in linked list, do nothing. void apm::zd_pkgkey_Insert(apm::FPackage& package, apm::FPkgkey& row) { - if (!zd_pkgkey_InLlistQ(row)) { + if (!package_zd_pkgkey_InLlistQ(row)) { apm::FPkgkey* old_tail = package.zd_pkgkey_tail; - row.zd_pkgkey_next = NULL; - row.zd_pkgkey_prev = old_tail; + row.package_zd_pkgkey_next = NULL; + row.package_zd_pkgkey_prev = old_tail; package.zd_pkgkey_tail = &row; - apm::FPkgkey **new_row_a = &old_tail->zd_pkgkey_next; + apm::FPkgkey **new_row_a = &old_tail->package_zd_pkgkey_next; apm::FPkgkey **new_row_b = &package.zd_pkgkey_head; apm::FPkgkey **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -3852,23 +3861,23 @@ void apm::zd_pkgkey_Insert(apm::FPackage& package, apm::FPkgkey& row) { // --- apm.FPackage.zd_pkgkey.Remove // Remove element from index. If element is not in index, do nothing. void apm::zd_pkgkey_Remove(apm::FPackage& package, apm::FPkgkey& row) { - if (zd_pkgkey_InLlistQ(row)) { + if (package_zd_pkgkey_InLlistQ(row)) { apm::FPkgkey* old_head = package.zd_pkgkey_head; (void)old_head; // in case it's not used - apm::FPkgkey* prev = row.zd_pkgkey_prev; - apm::FPkgkey* next = row.zd_pkgkey_next; + apm::FPkgkey* prev = row.package_zd_pkgkey_prev; + apm::FPkgkey* next = row.package_zd_pkgkey_next; // if element is first, adjust list head; otherwise, adjust previous element's next - apm::FPkgkey **new_next_a = &prev->zd_pkgkey_next; + apm::FPkgkey **new_next_a = &prev->package_zd_pkgkey_next; apm::FPkgkey **new_next_b = &package.zd_pkgkey_head; apm::FPkgkey **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - apm::FPkgkey **new_prev_a = &next->zd_pkgkey_prev; + apm::FPkgkey **new_prev_a = &next->package_zd_pkgkey_prev; apm::FPkgkey **new_prev_b = &package.zd_pkgkey_tail; apm::FPkgkey **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; package.zd_pkgkey_n--; - row.zd_pkgkey_next=(apm::FPkgkey*)-1; // not-in-list + row.package_zd_pkgkey_next=(apm::FPkgkey*)-1; // not-in-list } } @@ -3880,9 +3889,9 @@ void apm::zd_pkgkey_RemoveAll(apm::FPackage& package) { package.zd_pkgkey_tail = NULL; package.zd_pkgkey_n = 0; while (row) { - apm::FPkgkey* row_next = row->zd_pkgkey_next; - row->zd_pkgkey_next = (apm::FPkgkey*)-1; - row->zd_pkgkey_prev = NULL; + apm::FPkgkey* row_next = row->package_zd_pkgkey_next; + row->package_zd_pkgkey_next = (apm::FPkgkey*)-1; + row->package_zd_pkgkey_prev = NULL; row = row_next; } } @@ -3893,14 +3902,14 @@ apm::FPkgkey* apm::zd_pkgkey_RemoveFirst(apm::FPackage& package) { apm::FPkgkey *row = NULL; row = package.zd_pkgkey_head; if (row) { - apm::FPkgkey *next = row->zd_pkgkey_next; + apm::FPkgkey *next = row->package_zd_pkgkey_next; package.zd_pkgkey_head = next; - apm::FPkgkey **new_end_a = &next->zd_pkgkey_prev; + apm::FPkgkey **new_end_a = &next->package_zd_pkgkey_prev; apm::FPkgkey **new_end_b = &package.zd_pkgkey_tail; apm::FPkgkey **new_end = next ? new_end_a : new_end_b; *new_end = NULL; package.zd_pkgkey_n--; - row->zd_pkgkey_next = (apm::FPkgkey*)-1; // mark as not-in-list + row->package_zd_pkgkey_next = (apm::FPkgkey*)-1; // mark as not-in-list } return row; } @@ -3909,15 +3918,11 @@ apm::FPkgkey* apm::zd_pkgkey_RemoveFirst(apm::FPackage& package) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void apm::c_pkgdep_Insert(apm::FPackage& package, apm::FPkgdep& row) { - if (bool_Update(row.package_c_pkgdep_in_ary,true)) { - // reserve space + if (!row.package_c_pkgdep_in_ary) { c_pkgdep_Reserve(package, 1); - u32 n = package.c_pkgdep_n; - u32 at = n; - apm::FPkgdep* *elems = package.c_pkgdep_elems; - elems[at] = &row; - package.c_pkgdep_n = n+1; - + u32 n = package.c_pkgdep_n++; + package.c_pkgdep_elems[n] = &row; + row.package_c_pkgdep_in_ary = true; } } @@ -3926,7 +3931,7 @@ void apm::c_pkgdep_Insert(apm::FPackage& package, apm::FPkgdep& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool apm::c_pkgdep_InsertMaybe(apm::FPackage& package, apm::FPkgdep& row) { - bool retval = !row.package_c_pkgdep_in_ary; + bool retval = !package_c_pkgdep_InAryQ(row); c_pkgdep_Insert(package,row); // check is performed in _Insert again return retval; } @@ -3934,18 +3939,18 @@ bool apm::c_pkgdep_InsertMaybe(apm::FPackage& package, apm::FPkgdep& row) { // --- apm.FPackage.c_pkgdep.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void apm::c_pkgdep_Remove(apm::FPackage& package, apm::FPkgdep& row) { + int n = package.c_pkgdep_n; if (bool_Update(row.package_c_pkgdep_in_ary,false)) { - int lim = package.c_pkgdep_n; apm::FPkgdep* *elems = package.c_pkgdep_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { apm::FPkgdep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(apm::FPkgdep*) * (lim - j); + size_t nbytes = sizeof(apm::FPkgdep*) * (n - j); memmove(elems + i, elems + j, nbytes); - package.c_pkgdep_n = lim - 1; + package.c_pkgdep_n = n - 1; break; } } @@ -3973,15 +3978,11 @@ void apm::c_pkgdep_Reserve(apm::FPackage& package, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void apm::c_pkgdep_parent_Insert(apm::FPackage& package, apm::FPkgdep& row) { - if (bool_Update(row.package_c_pkgdep_parent_in_ary,true)) { - // reserve space + if (!row.package_c_pkgdep_parent_in_ary) { c_pkgdep_parent_Reserve(package, 1); - u32 n = package.c_pkgdep_parent_n; - u32 at = n; - apm::FPkgdep* *elems = package.c_pkgdep_parent_elems; - elems[at] = &row; - package.c_pkgdep_parent_n = n+1; - + u32 n = package.c_pkgdep_parent_n++; + package.c_pkgdep_parent_elems[n] = &row; + row.package_c_pkgdep_parent_in_ary = true; } } @@ -3990,7 +3991,7 @@ void apm::c_pkgdep_parent_Insert(apm::FPackage& package, apm::FPkgdep& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool apm::c_pkgdep_parent_InsertMaybe(apm::FPackage& package, apm::FPkgdep& row) { - bool retval = !row.package_c_pkgdep_parent_in_ary; + bool retval = !package_c_pkgdep_parent_InAryQ(row); c_pkgdep_parent_Insert(package,row); // check is performed in _Insert again return retval; } @@ -3998,18 +3999,18 @@ bool apm::c_pkgdep_parent_InsertMaybe(apm::FPackage& package, apm::FPkgdep& row) // --- apm.FPackage.c_pkgdep_parent.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void apm::c_pkgdep_parent_Remove(apm::FPackage& package, apm::FPkgdep& row) { + int n = package.c_pkgdep_parent_n; if (bool_Update(row.package_c_pkgdep_parent_in_ary,false)) { - int lim = package.c_pkgdep_parent_n; apm::FPkgdep* *elems = package.c_pkgdep_parent_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { apm::FPkgdep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(apm::FPkgdep*) * (lim - j); + size_t nbytes = sizeof(apm::FPkgdep*) * (n - j); memmove(elems + i, elems + j, nbytes); - package.c_pkgdep_parent_n = lim - 1; + package.c_pkgdep_parent_n = n - 1; break; } } @@ -4036,12 +4037,12 @@ void apm::c_pkgdep_parent_Reserve(apm::FPackage& package, u32 n) { // --- apm.FPackage.zd_pkgrec.Insert // Insert row into linked list. If row is already in linked list, do nothing. void apm::zd_pkgrec_Insert(apm::FPackage& package, apm::FPkgrec& row) { - if (!zd_pkgrec_InLlistQ(row)) { + if (!package_zd_pkgrec_InLlistQ(row)) { apm::FPkgrec* old_tail = package.zd_pkgrec_tail; - row.zd_pkgrec_next = NULL; - row.zd_pkgrec_prev = old_tail; + row.package_zd_pkgrec_next = NULL; + row.package_zd_pkgrec_prev = old_tail; package.zd_pkgrec_tail = &row; - apm::FPkgrec **new_row_a = &old_tail->zd_pkgrec_next; + apm::FPkgrec **new_row_a = &old_tail->package_zd_pkgrec_next; apm::FPkgrec **new_row_b = &package.zd_pkgrec_head; apm::FPkgrec **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -4052,23 +4053,23 @@ void apm::zd_pkgrec_Insert(apm::FPackage& package, apm::FPkgrec& row) { // --- apm.FPackage.zd_pkgrec.Remove // Remove element from index. If element is not in index, do nothing. void apm::zd_pkgrec_Remove(apm::FPackage& package, apm::FPkgrec& row) { - if (zd_pkgrec_InLlistQ(row)) { + if (package_zd_pkgrec_InLlistQ(row)) { apm::FPkgrec* old_head = package.zd_pkgrec_head; (void)old_head; // in case it's not used - apm::FPkgrec* prev = row.zd_pkgrec_prev; - apm::FPkgrec* next = row.zd_pkgrec_next; + apm::FPkgrec* prev = row.package_zd_pkgrec_prev; + apm::FPkgrec* next = row.package_zd_pkgrec_next; // if element is first, adjust list head; otherwise, adjust previous element's next - apm::FPkgrec **new_next_a = &prev->zd_pkgrec_next; + apm::FPkgrec **new_next_a = &prev->package_zd_pkgrec_next; apm::FPkgrec **new_next_b = &package.zd_pkgrec_head; apm::FPkgrec **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - apm::FPkgrec **new_prev_a = &next->zd_pkgrec_prev; + apm::FPkgrec **new_prev_a = &next->package_zd_pkgrec_prev; apm::FPkgrec **new_prev_b = &package.zd_pkgrec_tail; apm::FPkgrec **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; package.zd_pkgrec_n--; - row.zd_pkgrec_next=(apm::FPkgrec*)-1; // not-in-list + row.package_zd_pkgrec_next=(apm::FPkgrec*)-1; // not-in-list } } @@ -4080,9 +4081,9 @@ void apm::zd_pkgrec_RemoveAll(apm::FPackage& package) { package.zd_pkgrec_tail = NULL; package.zd_pkgrec_n = 0; while (row) { - apm::FPkgrec* row_next = row->zd_pkgrec_next; - row->zd_pkgrec_next = (apm::FPkgrec*)-1; - row->zd_pkgrec_prev = NULL; + apm::FPkgrec* row_next = row->package_zd_pkgrec_next; + row->package_zd_pkgrec_next = (apm::FPkgrec*)-1; + row->package_zd_pkgrec_prev = NULL; row = row_next; } } @@ -4093,14 +4094,14 @@ apm::FPkgrec* apm::zd_pkgrec_RemoveFirst(apm::FPackage& package) { apm::FPkgrec *row = NULL; row = package.zd_pkgrec_head; if (row) { - apm::FPkgrec *next = row->zd_pkgrec_next; + apm::FPkgrec *next = row->package_zd_pkgrec_next; package.zd_pkgrec_head = next; - apm::FPkgrec **new_end_a = &next->zd_pkgrec_prev; + apm::FPkgrec **new_end_a = &next->package_zd_pkgrec_prev; apm::FPkgrec **new_end_b = &package.zd_pkgrec_tail; apm::FPkgrec **new_end = next ? new_end_a : new_end_b; *new_end = NULL; package.zd_pkgrec_n--; - row->zd_pkgrec_next = (apm::FPkgrec*)-1; // mark as not-in-list + row->package_zd_pkgrec_next = (apm::FPkgrec*)-1; // mark as not-in-list } return row; } @@ -4190,15 +4191,11 @@ algo::Smallstr150 apm::key_Get(apm::FPkgkey& pkgkey) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void apm::c_pkgrec_Insert(apm::FPkgkey& pkgkey, apm::FPkgrec& row) { - if (bool_Update(row.pkgkey_c_pkgrec_in_ary,true)) { - // reserve space + if (!row.pkgkey_c_pkgrec_in_ary) { c_pkgrec_Reserve(pkgkey, 1); - u32 n = pkgkey.c_pkgrec_n; - u32 at = n; - apm::FPkgrec* *elems = pkgkey.c_pkgrec_elems; - elems[at] = &row; - pkgkey.c_pkgrec_n = n+1; - + u32 n = pkgkey.c_pkgrec_n++; + pkgkey.c_pkgrec_elems[n] = &row; + row.pkgkey_c_pkgrec_in_ary = true; } } @@ -4207,7 +4204,7 @@ void apm::c_pkgrec_Insert(apm::FPkgkey& pkgkey, apm::FPkgrec& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool apm::c_pkgrec_InsertMaybe(apm::FPkgkey& pkgkey, apm::FPkgrec& row) { - bool retval = !row.pkgkey_c_pkgrec_in_ary; + bool retval = !pkgkey_c_pkgrec_InAryQ(row); c_pkgrec_Insert(pkgkey,row); // check is performed in _Insert again return retval; } @@ -4215,18 +4212,18 @@ bool apm::c_pkgrec_InsertMaybe(apm::FPkgkey& pkgkey, apm::FPkgrec& row) { // --- apm.FPkgkey.c_pkgrec.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void apm::c_pkgrec_Remove(apm::FPkgkey& pkgkey, apm::FPkgrec& row) { + int n = pkgkey.c_pkgrec_n; if (bool_Update(row.pkgkey_c_pkgrec_in_ary,false)) { - int lim = pkgkey.c_pkgrec_n; apm::FPkgrec* *elems = pkgkey.c_pkgrec_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { apm::FPkgrec* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(apm::FPkgrec*) * (lim - j); + size_t nbytes = sizeof(apm::FPkgrec*) * (n - j); memmove(elems + i, elems + j, nbytes); - pkgkey.c_pkgrec_n = lim - 1; + pkgkey.c_pkgrec_n = n - 1; break; } } @@ -4284,14 +4281,9 @@ void apm::FPkgrec_Uninit(apm::FPkgrec& pkgrec) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void apm::c_child_Insert(apm::FRec& rec, apm::FRec& row) { - // reserve space c_child_Reserve(rec, 1); - u32 n = rec.c_child_n; - u32 at = n; - apm::FRec* *elems = rec.c_child_elems; - elems[at] = &row; - rec.c_child_n = n+1; - + u32 n = rec.c_child_n++; + rec.c_child_elems[n] = &row; } // --- apm.FRec.c_child.ScanInsertMaybe @@ -4320,20 +4312,18 @@ bool apm::c_child_ScanInsertMaybe(apm::FRec& rec, apm::FRec& row) { // --- apm.FRec.c_child.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void apm::c_child_Remove(apm::FRec& rec, apm::FRec& row) { - int lim = rec.c_child_n; - apm::FRec* *elems = rec.c_child_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - apm::FRec* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(apm::FRec*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - rec.c_child_n = lim - 1; - break; + int n = rec.c_child_n; + int j=0; + for (int i=0; izd_rec_pkgrec_next; + apm::FPkgrec **new_row_a = &old_tail->rec_zd_rec_pkgrec_next; apm::FPkgrec **new_row_b = &rec.zd_rec_pkgrec_head; apm::FPkgrec **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -4380,23 +4370,23 @@ void apm::zd_rec_pkgrec_Insert(apm::FRec& rec, apm::FPkgrec& row) { // --- apm.FRec.zd_rec_pkgrec.Remove // Remove element from index. If element is not in index, do nothing. void apm::zd_rec_pkgrec_Remove(apm::FRec& rec, apm::FPkgrec& row) { - if (zd_rec_pkgrec_InLlistQ(row)) { + if (rec_zd_rec_pkgrec_InLlistQ(row)) { apm::FPkgrec* old_head = rec.zd_rec_pkgrec_head; (void)old_head; // in case it's not used - apm::FPkgrec* prev = row.zd_rec_pkgrec_prev; - apm::FPkgrec* next = row.zd_rec_pkgrec_next; + apm::FPkgrec* prev = row.rec_zd_rec_pkgrec_prev; + apm::FPkgrec* next = row.rec_zd_rec_pkgrec_next; // if element is first, adjust list head; otherwise, adjust previous element's next - apm::FPkgrec **new_next_a = &prev->zd_rec_pkgrec_next; + apm::FPkgrec **new_next_a = &prev->rec_zd_rec_pkgrec_next; apm::FPkgrec **new_next_b = &rec.zd_rec_pkgrec_head; apm::FPkgrec **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - apm::FPkgrec **new_prev_a = &next->zd_rec_pkgrec_prev; + apm::FPkgrec **new_prev_a = &next->rec_zd_rec_pkgrec_prev; apm::FPkgrec **new_prev_b = &rec.zd_rec_pkgrec_tail; apm::FPkgrec **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; rec.zd_rec_pkgrec_n--; - row.zd_rec_pkgrec_next=(apm::FPkgrec*)-1; // not-in-list + row.rec_zd_rec_pkgrec_next=(apm::FPkgrec*)-1; // not-in-list } } @@ -4408,9 +4398,9 @@ void apm::zd_rec_pkgrec_RemoveAll(apm::FRec& rec) { rec.zd_rec_pkgrec_tail = NULL; rec.zd_rec_pkgrec_n = 0; while (row) { - apm::FPkgrec* row_next = row->zd_rec_pkgrec_next; - row->zd_rec_pkgrec_next = (apm::FPkgrec*)-1; - row->zd_rec_pkgrec_prev = NULL; + apm::FPkgrec* row_next = row->rec_zd_rec_pkgrec_next; + row->rec_zd_rec_pkgrec_next = (apm::FPkgrec*)-1; + row->rec_zd_rec_pkgrec_prev = NULL; row = row_next; } } @@ -4421,14 +4411,14 @@ apm::FPkgrec* apm::zd_rec_pkgrec_RemoveFirst(apm::FRec& rec) { apm::FPkgrec *row = NULL; row = rec.zd_rec_pkgrec_head; if (row) { - apm::FPkgrec *next = row->zd_rec_pkgrec_next; + apm::FPkgrec *next = row->rec_zd_rec_pkgrec_next; rec.zd_rec_pkgrec_head = next; - apm::FPkgrec **new_end_a = &next->zd_rec_pkgrec_prev; + apm::FPkgrec **new_end_a = &next->rec_zd_rec_pkgrec_prev; apm::FPkgrec **new_end_b = &rec.zd_rec_pkgrec_tail; apm::FPkgrec **new_end = next ? new_end_a : new_end_b; *new_end = NULL; rec.zd_rec_pkgrec_n--; - row->zd_rec_pkgrec_next = (apm::FPkgrec*)-1; // mark as not-in-list + row->rec_zd_rec_pkgrec_next = (apm::FPkgrec*)-1; // mark as not-in-list } return row; } @@ -4485,12 +4475,12 @@ algo::Smallstr50 apm::name_Get(apm::FSsimfile& ssimfile) { // --- apm.FSsimfile.zd_ssimfile_rec.Insert // Insert row into linked list. If row is already in linked list, do nothing. void apm::zd_ssimfile_rec_Insert(apm::FSsimfile& ssimfile, apm::FRec& row) { - if (!zd_ssimfile_rec_InLlistQ(row)) { + if (!ssimfile_zd_ssimfile_rec_InLlistQ(row)) { apm::FRec* old_tail = ssimfile.zd_ssimfile_rec_tail; - row.zd_ssimfile_rec_next = NULL; - row.zd_ssimfile_rec_prev = old_tail; + row.ssimfile_zd_ssimfile_rec_next = NULL; + row.ssimfile_zd_ssimfile_rec_prev = old_tail; ssimfile.zd_ssimfile_rec_tail = &row; - apm::FRec **new_row_a = &old_tail->zd_ssimfile_rec_next; + apm::FRec **new_row_a = &old_tail->ssimfile_zd_ssimfile_rec_next; apm::FRec **new_row_b = &ssimfile.zd_ssimfile_rec_head; apm::FRec **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -4501,23 +4491,23 @@ void apm::zd_ssimfile_rec_Insert(apm::FSsimfile& ssimfile, apm::FRec& row) { // --- apm.FSsimfile.zd_ssimfile_rec.Remove // Remove element from index. If element is not in index, do nothing. void apm::zd_ssimfile_rec_Remove(apm::FSsimfile& ssimfile, apm::FRec& row) { - if (zd_ssimfile_rec_InLlistQ(row)) { + if (ssimfile_zd_ssimfile_rec_InLlistQ(row)) { apm::FRec* old_head = ssimfile.zd_ssimfile_rec_head; (void)old_head; // in case it's not used - apm::FRec* prev = row.zd_ssimfile_rec_prev; - apm::FRec* next = row.zd_ssimfile_rec_next; + apm::FRec* prev = row.ssimfile_zd_ssimfile_rec_prev; + apm::FRec* next = row.ssimfile_zd_ssimfile_rec_next; // if element is first, adjust list head; otherwise, adjust previous element's next - apm::FRec **new_next_a = &prev->zd_ssimfile_rec_next; + apm::FRec **new_next_a = &prev->ssimfile_zd_ssimfile_rec_next; apm::FRec **new_next_b = &ssimfile.zd_ssimfile_rec_head; apm::FRec **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - apm::FRec **new_prev_a = &next->zd_ssimfile_rec_prev; + apm::FRec **new_prev_a = &next->ssimfile_zd_ssimfile_rec_prev; apm::FRec **new_prev_b = &ssimfile.zd_ssimfile_rec_tail; apm::FRec **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; ssimfile.zd_ssimfile_rec_n--; - row.zd_ssimfile_rec_next=(apm::FRec*)-1; // not-in-list + row.ssimfile_zd_ssimfile_rec_next=(apm::FRec*)-1; // not-in-list } } @@ -4529,9 +4519,9 @@ void apm::zd_ssimfile_rec_RemoveAll(apm::FSsimfile& ssimfile) { ssimfile.zd_ssimfile_rec_tail = NULL; ssimfile.zd_ssimfile_rec_n = 0; while (row) { - apm::FRec* row_next = row->zd_ssimfile_rec_next; - row->zd_ssimfile_rec_next = (apm::FRec*)-1; - row->zd_ssimfile_rec_prev = NULL; + apm::FRec* row_next = row->ssimfile_zd_ssimfile_rec_next; + row->ssimfile_zd_ssimfile_rec_next = (apm::FRec*)-1; + row->ssimfile_zd_ssimfile_rec_prev = NULL; row = row_next; } } @@ -4542,14 +4532,14 @@ apm::FRec* apm::zd_ssimfile_rec_RemoveFirst(apm::FSsimfile& ssimfile) { apm::FRec *row = NULL; row = ssimfile.zd_ssimfile_rec_head; if (row) { - apm::FRec *next = row->zd_ssimfile_rec_next; + apm::FRec *next = row->ssimfile_zd_ssimfile_rec_next; ssimfile.zd_ssimfile_rec_head = next; - apm::FRec **new_end_a = &next->zd_ssimfile_rec_prev; + apm::FRec **new_end_a = &next->ssimfile_zd_ssimfile_rec_prev; apm::FRec **new_end_b = &ssimfile.zd_ssimfile_rec_tail; apm::FRec **new_end = next ? new_end_a : new_end_b; *new_end = NULL; ssimfile.zd_ssimfile_rec_n--; - row->zd_ssimfile_rec_next = (apm::FRec*)-1; // mark as not-in-list + row->ssimfile_zd_ssimfile_rec_next = (apm::FRec*)-1; // mark as not-in-list } return row; } @@ -4931,14 +4921,15 @@ void apm::StaticCheck() { // --- apm...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); lib_ctype::FDb_Init(); lib_git::FDb_Init(); - lib_json::FDb_Init(); apm::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock apm::ReadArgv(); // dmmeta.main:apm apm::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -4950,10 +4941,10 @@ int main(int argc, char **argv) { } try { apm::FDb_Uninit(); - lib_json::FDb_Uninit(); lib_git::FDb_Uninit(); lib_ctype::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/aqlite_gen.cpp b/cpp/gen/aqlite_gen.cpp index cf2d07a6..02f82b6a 100644 --- a/cpp/gen/aqlite_gen.cpp +++ b/cpp/gen/aqlite_gen.cpp @@ -29,10 +29,10 @@ #include "include/gen/command_gen.inl.h" #include "include/gen/algo_gen.h" #include "include/gen/algo_gen.inl.h" -#include "include/gen/algo_lib_gen.h" -#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_json_gen.h" #include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" #include "include/gen/lib_sqlite_gen.h" @@ -41,8 +41,8 @@ // Instantiate all libraries linked into this executable, // in dependency order -algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_json::FDb lib_json::_db; // dependency found via dev.targdep +algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_sqlite::FDb lib_sqlite::_db; // dependency found via dev.targdep aqlite::FDb aqlite::_db; // dependency found via dev.targdep @@ -50,15 +50,16 @@ namespace aqlite { const char *aqlite_help = "aqlite: Runs sqlite queries against ssim files\n" "Usage: aqlite [-cmd:] [options]\n" -" OPTION TYPE DFLT COMMENT\n" -" -in string \"data\" Input directory or filename, - for stdin\n" -" -schema string \"data\" Schema dir\n" -" [cmd] string Sql Query to run\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" -" -help Print help and exit; alias -h\n" -" -version Print version and exit\n" -" -signature Show signatures and exit; alias -sig\n" +" OPTION TYPE DFLT COMMENT\n" +" -in string \"data\" Input directory or filename, - for stdin\n" +" -schema string \"data\" Schema dir\n" +" [cmd] string Sql Query to run\n" +" -ns regx \"dmmeta\" Regx of databases to attach\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" +" -help Print help and exit; alias -h\n" +" -version Print version and exit\n" +" -signature Show signatures and exit; alias -sig\n" ; @@ -173,9 +174,8 @@ void aqlite::ReadArgv() { } if (ch_N(attrname) == 0) { err << "aqlite: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { if (!cmd_present) { err << "aqlite: Missing value for required argument -cmd (see -help)" << eol; @@ -234,7 +237,7 @@ void aqlite::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -307,8 +310,8 @@ bool aqlite::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && aqlite::LoadTuplesFile(algo::SsimFname(root,"dmmeta.sqltype"),recursive); retval = retval && aqlite::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -484,13 +487,14 @@ void aqlite::StaticCheck() { // --- aqlite...main int main(int argc, char **argv) { try { - algo_lib::FDb_Init(); lib_json::FDb_Init(); + algo_lib::FDb_Init(); lib_sqlite::FDb_Init(); aqlite::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock aqlite::ReadArgv(); // dmmeta.main:aqlite aqlite::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -503,8 +507,8 @@ int main(int argc, char **argv) { try { aqlite::FDb_Uninit(); lib_sqlite::FDb_Uninit(); - lib_json::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/atf_amc_gen.cpp b/cpp/gen/atf_amc_gen.cpp index 4cbcc0dc..8a3691f3 100644 --- a/cpp/gen/atf_amc_gen.cpp +++ b/cpp/gen/atf_amc_gen.cpp @@ -45,9 +45,9 @@ // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_exec::FDb lib_exec::_db; // dependency found via dev.targdep -lib_json::FDb lib_json::_db; // dependency found via dev.targdep atf_amc::FDb atf_amc::_db; // dependency found via dev.targdep atf_amc::cascdel_bh_child_bheap_curs::~cascdel_bh_child_bheap_curs() { @@ -69,8 +69,8 @@ const char *atf_amc_help = " [amctest] regx \"%\" SQL regex, selecting test to run\n" " -dofork Y Use fork\n" " -q Quiet mode\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -78,6 +78,11 @@ const char *atf_amc_help = } // namespace atf_amc +atf_amc::_db_bh_time_entry_curs::~_db_bh_time_entry_curs() { + algo_lib::malloc_FreeMem(temp_elems, sizeof(void*) * temp_max); + +} + atf_amc::typea_bh_typeb_curs::~typea_bh_typeb_curs() { algo_lib::malloc_FreeMem(temp_elems, sizeof(void*) * temp_max); @@ -163,7 +168,7 @@ namespace atf_amc { // gen:ns_print_proto // func:atf_amc.FCascdel.tr_child_atree.ElemLt inline static bool tr_child_atree_ElemLt(atf_amc::FCascdel& cascdel, atf_amc::FCascdel &a, atf_amc::FCascdel &b) __attribute__((nothrow)); // func:atf_amc.FCascdel.tr_child_atree.UpdateDepth - static void tr_child_atree_updateDepth(atf_amc::FCascdel& node) __attribute__((nothrow)); + static void cascdel_tr_child_atree_updateDepth(atf_amc::FCascdel& node) __attribute__((nothrow)); // rotates the tree in from->to direction // func:atf_amc.FCascdel.tr_child_atree.Turn static void tr_child_atree_Turn(atf_amc::FCascdel& from, atf_amc::FCascdel& to) __attribute__((nothrow)); @@ -215,6 +220,28 @@ namespace atf_amc { // gen:ns_print_proto inline static void tr_avl_Connect(atf_amc::FAvl* parent, atf_amc::FAvl* child, bool left) __attribute__((nothrow)); // func:atf_amc.FDb.listtype.LoadStatic static void listtype_LoadStatic() __attribute__((nothrow)); + // Find new location for ROW starting at IDX + // NOTE: Rest of heap is rearranged, but pointer to ROW is NOT stored in array. + // func:atf_amc.FDb.bh_time_entry.Downheap + static int bh_time_entry_Downheap(atf_amc::FTimeEntry& row, int idx) __attribute__((nothrow)); + // Find and return index of new location for element ROW in the heap, starting at index IDX. + // Move any elements along the way but do not modify ROW. + // func:atf_amc.FDb.bh_time_entry.Upheap + static int bh_time_entry_Upheap(atf_amc::FTimeEntry& row, int idx) __attribute__((nothrow)); + // func:atf_amc.FDb.bh_time_entry.ElemLt + inline static bool bh_time_entry_ElemLt(atf_amc::FTimeEntry &a, atf_amc::FTimeEntry &b) __attribute__((nothrow)); + // func:atf_amc.FDb.bh_time_entry_curs.Add + static void _db_bh_time_entry_curs_Add(_db_bh_time_entry_curs &curs, atf_amc::FTimeEntry& row); + // First element of index changed. + // If index bh_time_entry is empty, deschedule time hook _db.th_bh_time_entry. + // If index is non-empty, update time hook to fire at specified time. + // func:atf_amc.FDb.bh_time_entry.FirstChanged + static void bh_time_entry_FirstChanged() __attribute__((nothrow)); + // Update cycles count from previous clock capture + // func:atf_amc.FDb.bh_time_entry.UpdateCycles + static void bh_time_entry_UpdateCycles() __attribute__((nothrow)); + // func:atf_amc.FDb.bh_time_entry.Call + static void bh_time_entry_Call() __attribute__((nothrow)); // find trace by row id (used to implement reflection) // func:atf_amc.FDb.trace.RowidFind static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); @@ -589,17 +616,17 @@ bool atf_amc::BitfldType1_ReadFieldMaybe(atf_amc::BitfldType1& parent, algo::str switch(field_id) { case atf_amc_FieldId_value: { retval = u64_ReadStrptrMaybe(parent.value, strval); - break; - } + } break; case atf_amc_FieldId_bit1: { retval = bit1_ReadStrptrMaybe(parent, strval); - break; - } + } break; case atf_amc_FieldId_bits5: { retval = bits5_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -663,21 +690,20 @@ bool atf_amc::BitfldType2_ReadFieldMaybe(atf_amc::BitfldType2& parent, algo::str switch(field_id) { case atf_amc_FieldId_value: { retval = u64_ReadStrptrMaybe(parent.value, strval); - break; - } + } break; case atf_amc_FieldId_bit0: { retval = bit0_ReadStrptrMaybe(parent, strval); - break; - } + } break; case atf_amc_FieldId_bit1: { retval = bit1_ReadStrptrMaybe(parent, strval); - break; - } + } break; case atf_amc_FieldId_freebool: { retval = bool_ReadStrptrMaybe(parent.freebool, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -819,6 +845,23 @@ algo::aryptr atf_amc::in_GetMsg(atf_amc::Bytebuf& bytebuf) { return ret; } +// --- atf_amc.Bytebuf.in.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void atf_amc::in_Realloc(atf_amc::Bytebuf& bytebuf, int new_max) { + new_max = i32_Max(new_max, bytebuf.in_end); + u8 *new_mem = bytebuf.in_elems + ? (u8*)algo_lib::malloc_ReallocMem(bytebuf.in_elems, bytebuf.in_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.fbuf_nomem field:atf_amc.Bytebuf.in comment:'out of memory'"); + } + bytebuf.in_elems = new_mem; + bytebuf.in_max = new_max; +} + // --- atf_amc.Bytebuf.in.RemoveAll // Empty bfufer // Discard contents of the buffer. @@ -880,7 +923,7 @@ void atf_amc::in_SkipMsg(atf_amc::Bytebuf& bytebuf) { } // --- atf_amc.Bytebuf.in.WriteAll -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. @@ -894,22 +937,51 @@ bool atf_amc::in_WriteAll(atf_amc::Bytebuf& bytebuf, u8 *in, i32 in_n) { // now try to write the message. i32 end = bytebuf.in_end; bool fits = end + in_n <= max; - if (fits && in_n > 0) { - memcpy(bytebuf.in_elems + end, in, in_n); - bytebuf.in_end = end + in_n; + if (fits) { + if (in_n > 0) { + memcpy(bytebuf.in_elems + end, in, in_n); + bytebuf.in_end = end + in_n; + } } return fits; } +// --- atf_amc.Bytebuf.in.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void atf_amc::in_WriteReserve(atf_amc::Bytebuf& bytebuf, u8 *in, i32 in_n) { + if (!in_WriteAll(bytebuf, in, in_n)) { + in_Realloc(bytebuf, bytebuf.in_max*2); + if (!in_WriteAll(bytebuf, in, in_n)) { + FatalErrorExit("in: out of memory"); + } + } +} + // --- atf_amc.Bytebuf..Init // Set all fields to initial values. void atf_amc::Bytebuf_Init(atf_amc::Bytebuf& bytebuf) { + bytebuf.in_elems = NULL; // in: initialize + bytebuf.in_max = 0; // in: initialize bytebuf.in_end = 0; // in: initialize bytebuf.in_start = 0; // in: initialize bytebuf.in_eof = false; // in: initialize bytebuf.in_msgvalid = false; // in: initialize bytebuf.in_msglen = 0; // in: initialize bytebuf.in_epoll_enable = true; // in: initialize + in_Realloc(bytebuf, 64); +} + +// --- atf_amc.Bytebuf..Uninit +void atf_amc::Bytebuf_Uninit(atf_amc::Bytebuf& bytebuf) { + atf_amc::Bytebuf &row = bytebuf; (void)row; + + // atf_amc.Bytebuf.in.Uninit (Fbuf) //Streaming buffer + if (bytebuf.in_elems) { + algo_lib::malloc_FreeMem(bytebuf.in_elems, sizeof(char)*bytebuf.in_max); // (atf_amc.Bytebuf.in) + } + bytebuf.in_elems = NULL; + bytebuf.in_max = 0; } // --- atf_amc.Bytebuf..Print @@ -1018,7 +1090,7 @@ void atf_amc::in_SkipMsg(atf_amc::BytebufDyn& bytebuf_dyn) { } // --- atf_amc.BytebufDyn.in.WriteAll -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. @@ -1032,13 +1104,27 @@ bool atf_amc::in_WriteAll(atf_amc::BytebufDyn& bytebuf_dyn, u8 *in, i32 in_n) { // now try to write the message. i32 end = bytebuf_dyn.in_end; bool fits = end + in_n <= max; - if (fits && in_n > 0) { - memcpy(bytebuf_dyn.in_elems + end, in, in_n); - bytebuf_dyn.in_end = end + in_n; + if (fits) { + if (in_n > 0) { + memcpy(bytebuf_dyn.in_elems + end, in, in_n); + bytebuf_dyn.in_end = end + in_n; + } } return fits; } +// --- atf_amc.BytebufDyn.in.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void atf_amc::in_WriteReserve(atf_amc::BytebufDyn& bytebuf_dyn, u8 *in, i32 in_n) { + if (!in_WriteAll(bytebuf_dyn, in, in_n)) { + in_Realloc(bytebuf_dyn, bytebuf_dyn.in_max*2); + if (!in_WriteAll(bytebuf_dyn, in, in_n)) { + FatalErrorExit("in: out of memory"); + } + } +} + // --- atf_amc.BytebufDyn..Init // Set all fields to initial values. void atf_amc::BytebufDyn_Init(atf_amc::BytebufDyn& bytebuf_dyn) { @@ -1050,6 +1136,7 @@ void atf_amc::BytebufDyn_Init(atf_amc::BytebufDyn& bytebuf_dyn) { bytebuf_dyn.in_msgvalid = false; // in: initialize bytebuf_dyn.in_msglen = 0; // in: initialize bytebuf_dyn.in_epoll_enable = true; // in: initialize + in_Realloc(bytebuf_dyn, 0); } // --- atf_amc.BytebufDyn..Uninit @@ -1114,13 +1201,14 @@ bool atf_amc::Ctype2Attr_ReadFieldMaybe(atf_amc::Ctype2Attr& parent, algo::strpt switch(field_id) { case atf_amc_FieldId_attr1: { retval = u32_ReadStrptrMaybe(parent.attr1, strval); - break; - } + } break; case atf_amc_FieldId_attr2: { retval = u32_ReadStrptrMaybe(parent.attr2, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1175,13 +1263,14 @@ bool atf_amc::Ctype2AttrAnon_ReadFieldMaybe(atf_amc::Ctype2AttrAnon& parent, alg switch(field_id) { case atf_amc_FieldId_attr1: { retval = u32_ReadStrptrMaybe(parent.attr1, strval); - break; - } + } break; case atf_amc_FieldId_attr2: { retval = u32_ReadStrptrMaybe(parent.attr2, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1451,22 +1540,6 @@ inline static bool atf_amc::intval_ReadStrptrMaybe(atf_amc::DispFilter &parent, return retval; } -// --- atf_amc.DispFilter.pmask_bitcurs.Next -// proceed to next item -void atf_amc::DispFilter_pmask_bitcurs_Next(DispFilter_pmask_bitcurs &curs) { - ++curs.bit; - int index = curs.bit / 64; - int offset = curs.bit % 64; - for (; index < curs.n_elems; ++index, offset = 0) { - u64 rest = curs.elems[index] >> offset; - if (rest) { - offset += algo::u64_BitScanForward(rest); - break; - } - } - curs.bit = index * 64 + offset; -} - // --- atf_amc.DispFilter..ReadFieldMaybe bool atf_amc::DispFilter_ReadFieldMaybe(atf_amc::DispFilter& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -1475,79 +1548,71 @@ bool atf_amc::DispFilter_ReadFieldMaybe(atf_amc::DispFilter& parent, algo::strpt switch(field_id) { case atf_amc_FieldId_pmask: { retval = pmask_ReadStrptrMaybe(parent, strval); - break; - } + } break; case atf_amc_FieldId_strval: { retval = strval_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 0); } - break; - } + } break; case atf_amc_FieldId_strval_regx: { retval = strval_regx_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 1); } - break; - } + } break; case atf_amc_FieldId_strval2: { retval = strval2_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 2); } - break; - } + } break; case atf_amc_FieldId_strval2_regx: { retval = strval2_regx_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 3); } - break; - } + } break; case atf_amc_FieldId_start_dateval: { retval = start_dateval_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 4); } - break; - } + } break; case atf_amc_FieldId_end_dateval: { retval = end_dateval_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 5); } - break; - } + } break; case atf_amc_FieldId_dateval: { retval = dateval_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 6); } - break; - } + } break; case atf_amc_FieldId_start_intval: { retval = start_intval_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 7); } - break; - } + } break; case atf_amc_FieldId_end_intval: { retval = end_intval_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 8); } - break; - } + } break; case atf_amc_FieldId_intval: { retval = intval_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 9); } - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1665,17 +1730,17 @@ bool atf_amc::DispType1_ReadFieldMaybe(atf_amc::DispType1& parent, algo::strptr switch(field_id) { case atf_amc_FieldId_strval: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.strval, strval); - break; - } + } break; case atf_amc_FieldId_strval2: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.strval2, strval); - break; - } + } break; case atf_amc_FieldId_dateval: { retval = algo::UnTime_ReadStrptrMaybe(parent.dateval, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1736,13 +1801,14 @@ bool atf_amc::DispType3_ReadFieldMaybe(atf_amc::DispType3& parent, algo::strptr switch(field_id) { case atf_amc_FieldId_intval: { retval = u32_ReadStrptrMaybe(parent.intval, strval); - break; - } + } break; case atf_amc_FieldId_strval: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.strval, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1936,15 +2002,11 @@ void atf_amc::c_child_ptrary_Cascdel(atf_amc::FCascdel& cascdel) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void atf_amc::c_child_ptrary_Insert(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& row) { - if (bool_Update(row.cascdel_c_child_ptrary_in_ary,true)) { - // reserve space + if (!row.cascdel_c_child_ptrary_in_ary) { c_child_ptrary_Reserve(cascdel, 1); - u32 n = cascdel.c_child_ptrary_n; - u32 at = n; - atf_amc::FCascdel* *elems = cascdel.c_child_ptrary_elems; - elems[at] = &row; - cascdel.c_child_ptrary_n = n+1; - + u32 n = cascdel.c_child_ptrary_n++; + cascdel.c_child_ptrary_elems[n] = &row; + row.cascdel_c_child_ptrary_in_ary = true; } } @@ -1953,7 +2015,7 @@ void atf_amc::c_child_ptrary_Insert(atf_amc::FCascdel& cascdel, atf_amc::FCascde // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool atf_amc::c_child_ptrary_InsertMaybe(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& row) { - bool retval = !row.cascdel_c_child_ptrary_in_ary; + bool retval = !cascdel_c_child_ptrary_InAryQ(row); c_child_ptrary_Insert(cascdel,row); // check is performed in _Insert again return retval; } @@ -1961,18 +2023,18 @@ bool atf_amc::c_child_ptrary_InsertMaybe(atf_amc::FCascdel& cascdel, atf_amc::FC // --- atf_amc.FCascdel.c_child_ptrary.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void atf_amc::c_child_ptrary_Remove(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& row) { + int n = cascdel.c_child_ptrary_n; if (bool_Update(row.cascdel_c_child_ptrary_in_ary,false)) { - int lim = cascdel.c_child_ptrary_n; atf_amc::FCascdel* *elems = cascdel.c_child_ptrary_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { atf_amc::FCascdel* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(atf_amc::FCascdel*) * (lim - j); + size_t nbytes = sizeof(atf_amc::FCascdel*) * (n - j); memmove(elems + i, elems + j, nbytes); - cascdel.c_child_ptrary_n = lim - 1; + cascdel.c_child_ptrary_n = n - 1; break; } } @@ -2003,7 +2065,7 @@ void atf_amc::ind_child_thash_Cascdel(atf_amc::FCascdel& cascdel) { for (int i = 0; i < cascdel.ind_child_thash_buckets_n; i++) { atf_amc::FCascdel *elem = cascdel.ind_child_thash_buckets_elems[i]; while (elem) { - atf_amc::FCascdel *next = elem->ind_child_thash_next; + atf_amc::FCascdel *next = elem->cascdel_ind_child_thash_next; cascdel_Delete(*elem); elem = next; } @@ -2015,24 +2077,28 @@ void atf_amc::ind_child_thash_Cascdel(atf_amc::FCascdel& cascdel) { // Find row by key. Return NULL if not found. atf_amc::FCascdel* atf_amc::ind_child_thash_Find(atf_amc::FCascdel& cascdel, u32 key) { u32 index = ::u32_Hash(0, key) & (cascdel.ind_child_thash_buckets_n - 1); - atf_amc::FCascdel* *e = &cascdel.ind_child_thash_buckets_elems[index]; - atf_amc::FCascdel* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).key == key; - if (done) break; - e = &ret->ind_child_thash_next; - } while (true); + atf_amc::FCascdel *ret = cascdel.ind_child_thash_buckets_elems[index]; + for (; ret && !((*ret).key == key); ret = ret->cascdel_ind_child_thash_next) { + } return ret; } +// --- atf_amc.FCascdel.ind_child_thash.FindX +// Look up row by key and return reference. Throw exception if not found +atf_amc::FCascdel& atf_amc::ind_child_thash_FindX(atf_amc::FCascdel& cascdel, u32 key) { + atf_amc::FCascdel* ret = ind_child_thash_Find(cascdel, key); + vrfy(ret, tempstr() << "atf_amc.key_error table:ind_child_thash key:'"<ind_child_thash_next; + prev = &ret->cascdel_ind_child_thash_next; } while (true); if (retval) { - row.ind_child_thash_next = *prev; + row.cascdel_ind_child_thash_next = *prev; cascdel.ind_child_thash_n++; *prev = &row; } @@ -2057,17 +2123,17 @@ bool atf_amc::ind_child_thash_InsertMaybe(atf_amc::FCascdel& cascdel, atf_amc::F // --- atf_amc.FCascdel.ind_child_thash.Remove // Remove reference to element from hash index. If element is not in hash, do nothing void atf_amc::ind_child_thash_Remove(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& row) { - if (LIKELY(row.ind_child_thash_next != (atf_amc::FCascdel*)-1)) {// check if in hash already - u32 index = ::u32_Hash(0, row.key) & (cascdel.ind_child_thash_buckets_n - 1); + if (LIKELY(row.cascdel_ind_child_thash_next != (atf_amc::FCascdel*)-1)) {// check if in hash already + u32 index = row.cascdel_ind_child_thash_hashval & (cascdel.ind_child_thash_buckets_n - 1); atf_amc::FCascdel* *prev = &cascdel.ind_child_thash_buckets_elems[index]; // addr of pointer to current element while (atf_amc::FCascdel *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_child_thash_next; // unlink (singly linked list) + *prev = next->cascdel_ind_child_thash_next; // unlink (singly linked list) cascdel.ind_child_thash_n--; - row.ind_child_thash_next = (atf_amc::FCascdel*)-1;// not-in-hash + row.cascdel_ind_child_thash_next = (atf_amc::FCascdel*)-1;// not-in-hash break; } - prev = &next->ind_child_thash_next; + prev = &next->cascdel_ind_child_thash_next; } } } @@ -2075,8 +2141,14 @@ void atf_amc::ind_child_thash_Remove(atf_amc::FCascdel& cascdel, atf_amc::FCascd // --- atf_amc.FCascdel.ind_child_thash.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_amc::ind_child_thash_Reserve(atf_amc::FCascdel& cascdel, int n) { + ind_child_thash_AbsReserve(cascdel,cascdel.ind_child_thash_n + n); +} + +// --- atf_amc.FCascdel.ind_child_thash.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_amc::ind_child_thash_AbsReserve(atf_amc::FCascdel& cascdel, int n) { u32 old_nbuckets = cascdel.ind_child_thash_buckets_n; - u32 new_nelems = cascdel.ind_child_thash_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2094,9 +2166,9 @@ void atf_amc::ind_child_thash_Reserve(atf_amc::FCascdel& cascdel, int n) { atf_amc::FCascdel* elem = cascdel.ind_child_thash_buckets_elems[i]; while (elem) { atf_amc::FCascdel &row = *elem; - atf_amc::FCascdel* next = row.ind_child_thash_next; - u32 index = ::u32_Hash(0, row.key) & (new_nbuckets-1); - row.ind_child_thash_next = new_buckets[index]; + atf_amc::FCascdel* next = row.cascdel_ind_child_thash_next; + u32 index = row.cascdel_ind_child_thash_hashval & (new_nbuckets-1); + row.cascdel_ind_child_thash_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } @@ -2116,7 +2188,7 @@ void atf_amc::bh_child_bheap_Cascdel(atf_amc::FCascdel& cascdel) { while (n > 0) { n--; atf_amc::FCascdel &elem = *cascdel.bh_child_bheap_elems[n]; // pick cheapest element to remove - elem.bh_child_bheap_idx = -1; // mark not-in-heap + elem.cascdel_bh_child_bheap_idx = -1; // mark not-in-heap cascdel.bh_child_bheap_n = n; cascdel_Delete(elem); } @@ -2151,7 +2223,7 @@ static int atf_amc::bh_child_bheap_Downheap(atf_amc::FCascdel& cascdel, atf_amc: if (!bh_child_bheap_ElemLt(cascdel, *p,row)) { break; } - p->bh_child_bheap_idx = idx; + p->cascdel_bh_child_bheap_idx = idx; elems[idx] = p; idx = child; child = idx*2+1; @@ -2162,12 +2234,12 @@ static int atf_amc::bh_child_bheap_Downheap(atf_amc::FCascdel& cascdel, atf_amc: // --- atf_amc.FCascdel.bh_child_bheap.Insert // Insert row. Row must not already be in index. If row is already in index, do nothing. void atf_amc::bh_child_bheap_Insert(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& row) { - if (LIKELY(row.bh_child_bheap_idx == -1)) { + if (LIKELY(row.cascdel_bh_child_bheap_idx == -1)) { bh_child_bheap_Reserve(cascdel, 1); int n = cascdel.bh_child_bheap_n; cascdel.bh_child_bheap_n = n + 1; int new_idx = bh_child_bheap_Upheap(cascdel, row, n); - row.bh_child_bheap_idx = new_idx; + row.cascdel_bh_child_bheap_idx = new_idx; cascdel.bh_child_bheap_elems[new_idx] = &row; } } @@ -2176,7 +2248,7 @@ void atf_amc::bh_child_bheap_Insert(atf_amc::FCascdel& cascdel, atf_amc::FCascde // If row is in heap, update its position. If row is not in heap, insert it. // Return new position of item in the heap (0=top) i32 atf_amc::bh_child_bheap_Reheap(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& row) { - int old_idx = row.bh_child_bheap_idx; + int old_idx = row.cascdel_bh_child_bheap_idx; bool isnew = old_idx == -1; if (isnew) { bh_child_bheap_Reserve(cascdel, 1); @@ -2186,7 +2258,7 @@ i32 atf_amc::bh_child_bheap_Reheap(atf_amc::FCascdel& cascdel, atf_amc::FCascdel if (!isnew && new_idx == old_idx) { new_idx = bh_child_bheap_Downheap(cascdel, row, old_idx); } - row.bh_child_bheap_idx = new_idx; + row.cascdel_bh_child_bheap_idx = new_idx; cascdel.bh_child_bheap_elems[new_idx] = &row; return new_idx; } @@ -2199,7 +2271,7 @@ i32 atf_amc::bh_child_bheap_Reheap(atf_amc::FCascdel& cascdel, atf_amc::FCascdel i32 atf_amc::bh_child_bheap_ReheapFirst(atf_amc::FCascdel& cascdel) { atf_amc::FCascdel &row = *cascdel.bh_child_bheap_elems[0]; i32 new_idx = bh_child_bheap_Downheap(cascdel, row, 0); - row.bh_child_bheap_idx = new_idx; + row.cascdel_bh_child_bheap_idx = new_idx; cascdel.bh_child_bheap_elems[new_idx] = &row; return new_idx; } @@ -2208,9 +2280,9 @@ i32 atf_amc::bh_child_bheap_ReheapFirst(atf_amc::FCascdel& cascdel) { // Remove element from index. If element is not in index, do nothing. void atf_amc::bh_child_bheap_Remove(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& row) { if (bh_child_bheap_InBheapQ(row)) { - int old_idx = row.bh_child_bheap_idx; + int old_idx = row.cascdel_bh_child_bheap_idx; if (cascdel.bh_child_bheap_elems[old_idx] == &row) { // sanity check: heap points back to row - row.bh_child_bheap_idx = -1; // mark not in heap + row.cascdel_bh_child_bheap_idx = -1; // mark not in heap i32 n = cascdel.bh_child_bheap_n - 1; // index of last element in heap cascdel.bh_child_bheap_n = n; // decrease count if (old_idx != n) { @@ -2219,7 +2291,7 @@ void atf_amc::bh_child_bheap_Remove(atf_amc::FCascdel& cascdel, atf_amc::FCascde if (new_idx == old_idx) { new_idx = bh_child_bheap_Downheap(cascdel, *elem, old_idx); } - elem->bh_child_bheap_idx = new_idx; + elem->cascdel_bh_child_bheap_idx = new_idx; cascdel.bh_child_bheap_elems[new_idx] = elem; } } @@ -2231,7 +2303,7 @@ void atf_amc::bh_child_bheap_Remove(atf_amc::FCascdel& cascdel, atf_amc::FCascde void atf_amc::bh_child_bheap_RemoveAll(atf_amc::FCascdel& cascdel) { int n = cascdel.bh_child_bheap_n; for (int i = n - 1; i>=0; i--) { - cascdel.bh_child_bheap_elems[i]->bh_child_bheap_idx = -1; // mark not-in-heap + cascdel.bh_child_bheap_elems[i]->cascdel_bh_child_bheap_idx = -1; // mark not-in-heap } cascdel.bh_child_bheap_n = 0; } @@ -2243,13 +2315,13 @@ atf_amc::FCascdel* atf_amc::bh_child_bheap_RemoveFirst(atf_amc::FCascdel& cascde atf_amc::FCascdel *row = NULL; if (cascdel.bh_child_bheap_n > 0) { row = cascdel.bh_child_bheap_elems[0]; - row->bh_child_bheap_idx = -1; // mark not in heap + row->cascdel_bh_child_bheap_idx = -1; // mark not in heap i32 n = cascdel.bh_child_bheap_n - 1; // index of last element in heap cascdel.bh_child_bheap_n = n; // decrease count if (n) { atf_amc::FCascdel &elem = *cascdel.bh_child_bheap_elems[n]; int new_idx = bh_child_bheap_Downheap(cascdel, elem, 0); - elem.bh_child_bheap_idx = new_idx; + elem.cascdel_bh_child_bheap_idx = new_idx; cascdel.bh_child_bheap_elems[new_idx] = &elem; } } @@ -2311,7 +2383,7 @@ static int atf_amc::bh_child_bheap_Upheap(atf_amc::FCascdel& cascdel, atf_amc::F if (!bh_child_bheap_ElemLt(cascdel, row, *p)) { break; } - p->bh_child_bheap_idx = idx; + p->cascdel_bh_child_bheap_idx = idx; elems[idx] = p; idx = j; } @@ -2341,12 +2413,12 @@ void atf_amc::zd_childlist_Cascdel(atf_amc::FCascdel& cascdel) { // --- atf_amc.FCascdel.zd_childlist.Insert // Insert row into linked list. If row is already in linked list, do nothing. void atf_amc::zd_childlist_Insert(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& row) { - if (!zd_childlist_InLlistQ(row)) { + if (!cascdel_zd_childlist_InLlistQ(row)) { atf_amc::FCascdel* old_tail = cascdel.zd_childlist_tail; - row.zd_childlist_next = NULL; - row.zd_childlist_prev = old_tail; + row.cascdel_zd_childlist_next = NULL; + row.cascdel_zd_childlist_prev = old_tail; cascdel.zd_childlist_tail = &row; - atf_amc::FCascdel **new_row_a = &old_tail->zd_childlist_next; + atf_amc::FCascdel **new_row_a = &old_tail->cascdel_zd_childlist_next; atf_amc::FCascdel **new_row_b = &cascdel.zd_childlist_head; atf_amc::FCascdel **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -2357,23 +2429,23 @@ void atf_amc::zd_childlist_Insert(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& // --- atf_amc.FCascdel.zd_childlist.Remove // Remove element from index. If element is not in index, do nothing. void atf_amc::zd_childlist_Remove(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& row) { - if (zd_childlist_InLlistQ(row)) { + if (cascdel_zd_childlist_InLlistQ(row)) { atf_amc::FCascdel* old_head = cascdel.zd_childlist_head; (void)old_head; // in case it's not used - atf_amc::FCascdel* prev = row.zd_childlist_prev; - atf_amc::FCascdel* next = row.zd_childlist_next; + atf_amc::FCascdel* prev = row.cascdel_zd_childlist_prev; + atf_amc::FCascdel* next = row.cascdel_zd_childlist_next; // if element is first, adjust list head; otherwise, adjust previous element's next - atf_amc::FCascdel **new_next_a = &prev->zd_childlist_next; + atf_amc::FCascdel **new_next_a = &prev->cascdel_zd_childlist_next; atf_amc::FCascdel **new_next_b = &cascdel.zd_childlist_head; atf_amc::FCascdel **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - atf_amc::FCascdel **new_prev_a = &next->zd_childlist_prev; + atf_amc::FCascdel **new_prev_a = &next->cascdel_zd_childlist_prev; atf_amc::FCascdel **new_prev_b = &cascdel.zd_childlist_tail; atf_amc::FCascdel **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; cascdel.zd_childlist_n--; - row.zd_childlist_next=(atf_amc::FCascdel*)-1; // not-in-list + row.cascdel_zd_childlist_next=(atf_amc::FCascdel*)-1; // not-in-list } } @@ -2385,9 +2457,9 @@ void atf_amc::zd_childlist_RemoveAll(atf_amc::FCascdel& cascdel) { cascdel.zd_childlist_tail = NULL; cascdel.zd_childlist_n = 0; while (row) { - atf_amc::FCascdel* row_next = row->zd_childlist_next; - row->zd_childlist_next = (atf_amc::FCascdel*)-1; - row->zd_childlist_prev = NULL; + atf_amc::FCascdel* row_next = row->cascdel_zd_childlist_next; + row->cascdel_zd_childlist_next = (atf_amc::FCascdel*)-1; + row->cascdel_zd_childlist_prev = NULL; row = row_next; } } @@ -2398,14 +2470,14 @@ atf_amc::FCascdel* atf_amc::zd_childlist_RemoveFirst(atf_amc::FCascdel& cascdel) atf_amc::FCascdel *row = NULL; row = cascdel.zd_childlist_head; if (row) { - atf_amc::FCascdel *next = row->zd_childlist_next; + atf_amc::FCascdel *next = row->cascdel_zd_childlist_next; cascdel.zd_childlist_head = next; - atf_amc::FCascdel **new_end_a = &next->zd_childlist_prev; + atf_amc::FCascdel **new_end_a = &next->cascdel_zd_childlist_prev; atf_amc::FCascdel **new_end_b = &cascdel.zd_childlist_tail; atf_amc::FCascdel **new_end = next ? new_end_a : new_end_b; *new_end = NULL; cascdel.zd_childlist_n--; - row->zd_childlist_next = (atf_amc::FCascdel*)-1; // mark as not-in-list + row->cascdel_zd_childlist_next = (atf_amc::FCascdel*)-1; // mark as not-in-list } return row; } @@ -2421,8 +2493,8 @@ void atf_amc::tr_child_atree_Cascdel(atf_amc::FCascdel& cascdel) { // --- atf_amc.FCascdel.tr_child_atree.FirstImpl atf_amc::FCascdel* atf_amc::tr_child_atree_FirstImpl(atf_amc::FCascdel* root) { atf_amc::FCascdel *result = root; - while(result != NULL && result->tr_child_atree_left != NULL){ - result = result->tr_child_atree_left; + while(result != NULL && result->cascdel_tr_child_atree_left != NULL){ + result = result->cascdel_tr_child_atree_left; } return result; } @@ -2439,7 +2511,7 @@ void atf_amc::tr_child_atree_InsertImpl(atf_amc::FCascdel& cascdel, atf_amc::FCa bool left = false; while(parent != NULL){ left = tr_child_atree_ElemLt(cascdel, row, *parent); - atf_amc::FCascdel* side = left ? parent->tr_child_atree_left : parent->tr_child_atree_right; + atf_amc::FCascdel* side = left ? parent->cascdel_tr_child_atree_left : parent->cascdel_tr_child_atree_right; if(side == NULL){ break; } @@ -2465,28 +2537,28 @@ void atf_amc::tr_child_atree_Remove(atf_amc::FCascdel& cascdel, atf_amc::FCascde return; } atf_amc::FCascdel* next = NULL; - if(row.tr_child_atree_depth > 1){ - next = tr_child_atree_Balance(row) < 0 ? tr_child_atree_FirstImpl(row.tr_child_atree_right) : tr_child_atree_LastImpl(row.tr_child_atree_left); + if(row.cascdel_tr_child_atree_depth > 1){ + next = tr_child_atree_Balance(row) < 0 ? tr_child_atree_FirstImpl(row.cascdel_tr_child_atree_right) : tr_child_atree_LastImpl(row.cascdel_tr_child_atree_left); atf_amc::FCascdel* leaf = tr_child_atree_TallerChild(*next); if(leaf){ tr_child_atree_Turn(*leaf, *next); } } - atf_amc::FCascdel* root = row.tr_child_atree_up; + atf_amc::FCascdel* root = row.cascdel_tr_child_atree_up; atf_amc::FCascdel* prop = root;//propagate point if(next){ - prop = next->tr_child_atree_up == &row ? next : next->tr_child_atree_up; + prop = next->cascdel_tr_child_atree_up == &row ? next : next->cascdel_tr_child_atree_up; tr_child_atree_Disconnect(*next); - tr_child_atree_Connect(next, row.tr_child_atree_left, true); - tr_child_atree_Connect(next, row.tr_child_atree_right, false); + tr_child_atree_Connect(next, row.cascdel_tr_child_atree_left, true); + tr_child_atree_Connect(next, row.cascdel_tr_child_atree_right, false); } - bool dir = root && root->tr_child_atree_left == &row; + bool dir = root && root->cascdel_tr_child_atree_left == &row; tr_child_atree_Connect(root, next, dir); cascdel.tr_child_atree_root = prop ? tr_child_atree_Propagate(*prop) : NULL; - row.tr_child_atree_depth = 0; - row.tr_child_atree_left = NULL; - row.tr_child_atree_right = NULL; - row.tr_child_atree_up = (atf_amc::FCascdel*)-1; + row.cascdel_tr_child_atree_depth = 0; + row.cascdel_tr_child_atree_left = NULL; + row.cascdel_tr_child_atree_right = NULL; + row.cascdel_tr_child_atree_up = (atf_amc::FCascdel*)-1; cascdel.tr_child_atree_n--; } @@ -2500,8 +2572,8 @@ void atf_amc::tr_child_atree_RemoveFirst(atf_amc::FCascdel& cascdel) { // --- atf_amc.FCascdel.tr_child_atree.Balance i32 atf_amc::tr_child_atree_Balance(atf_amc::FCascdel& row) { - i32 left = row.tr_child_atree_left ? row.tr_child_atree_left->tr_child_atree_depth : 0; - i32 right = row.tr_child_atree_right ? row.tr_child_atree_right->tr_child_atree_depth : 0; + i32 left = row.cascdel_tr_child_atree_left ? row.cascdel_tr_child_atree_left->cascdel_tr_child_atree_depth : 0; + i32 right = row.cascdel_tr_child_atree_right ? row.cascdel_tr_child_atree_right->cascdel_tr_child_atree_depth : 0; return left - right; } @@ -2511,10 +2583,10 @@ atf_amc::FCascdel* atf_amc::tr_child_atree_Propagate(atf_amc::FCascdel& pnode) { atf_amc::FCascdel *root = &pnode; atf_amc::FCascdel* node = &pnode; while(node != NULL){ - tr_child_atree_updateDepth(*node); + cascdel_tr_child_atree_updateDepth(*node); tr_child_atree_Rebalance(*node); root = node; - node = node->tr_child_atree_up; + node = node->cascdel_tr_child_atree_up; } return root; } @@ -2522,18 +2594,18 @@ atf_amc::FCascdel* atf_amc::tr_child_atree_Propagate(atf_amc::FCascdel& pnode) { // --- atf_amc.FCascdel.tr_child_atree.TallerChild // Returns the child that has greater height. inline static atf_amc::FCascdel* atf_amc::tr_child_atree_TallerChild(atf_amc::FCascdel& node) { - return tr_child_atree_Balance(node) < 0 ? node.tr_child_atree_right : node.tr_child_atree_left; + return tr_child_atree_Balance(node) < 0 ? node.cascdel_tr_child_atree_right : node.cascdel_tr_child_atree_left; } // --- atf_amc.FCascdel.tr_child_atree.Disconnect // Disconnects the subtree(branch) from the parent static void atf_amc::tr_child_atree_Disconnect(atf_amc::FCascdel& node) { - atf_amc::FCascdel* parent = node.tr_child_atree_up; + atf_amc::FCascdel* parent = node.cascdel_tr_child_atree_up; if(parent != NULL){ - bool left = parent->tr_child_atree_left == &node; - (left ? parent->tr_child_atree_left : parent->tr_child_atree_right) = NULL; + bool left = parent->cascdel_tr_child_atree_left == &node; + (left ? parent->cascdel_tr_child_atree_left : parent->cascdel_tr_child_atree_right) = NULL; } - node.tr_child_atree_up = NULL; + node.cascdel_tr_child_atree_up = NULL; } // --- atf_amc.FCascdel.tr_child_atree.Rebalance @@ -2542,28 +2614,28 @@ void atf_amc::tr_child_atree_Rebalance(atf_amc::FCascdel& node) { if (algo::Abs(tr_child_atree_Balance(node)) > 1){ atf_amc::FCascdel* deep1 = tr_child_atree_TallerChild(node); atf_amc::FCascdel* deep2 = tr_child_atree_TallerChild(*deep1); - bool turn = tr_child_atree_Balance(*deep1)!=0 && (node.tr_child_atree_left == deep1) != (deep1->tr_child_atree_left == deep2); + bool turn = tr_child_atree_Balance(*deep1)!=0 && (node.cascdel_tr_child_atree_left == deep1) != (deep1->cascdel_tr_child_atree_left == deep2); if(turn){ tr_child_atree_Turn(*deep2, *deep1); algo::TSwap(deep1, deep2); } tr_child_atree_Turn(*deep1, node); - tr_child_atree_updateDepth(node); - tr_child_atree_updateDepth(*deep2); - tr_child_atree_updateDepth(*deep1); + cascdel_tr_child_atree_updateDepth(node); + cascdel_tr_child_atree_updateDepth(*deep2); + cascdel_tr_child_atree_updateDepth(*deep1); } } // --- atf_amc.FCascdel.tr_child_atree.Next atf_amc::FCascdel* atf_amc::tr_child_atree_Next(atf_amc::FCascdel& node) { atf_amc::FCascdel *result = &node; - if(result->tr_child_atree_right == NULL){ - while(result->tr_child_atree_up != NULL && result->tr_child_atree_up->tr_child_atree_right == result){ - result = result->tr_child_atree_up; + if(result->cascdel_tr_child_atree_right == NULL){ + while(result->cascdel_tr_child_atree_up != NULL && result->cascdel_tr_child_atree_up->cascdel_tr_child_atree_right == result){ + result = result->cascdel_tr_child_atree_up; } - result = result->tr_child_atree_up; + result = result->cascdel_tr_child_atree_up; }else{ - result = tr_child_atree_FirstImpl(result->tr_child_atree_right); + result = tr_child_atree_FirstImpl(result->cascdel_tr_child_atree_right); } return result; } @@ -2571,13 +2643,13 @@ atf_amc::FCascdel* atf_amc::tr_child_atree_Next(atf_amc::FCascdel& node) { // --- atf_amc.FCascdel.tr_child_atree.Prev atf_amc::FCascdel* atf_amc::tr_child_atree_Prev(atf_amc::FCascdel& node) { atf_amc::FCascdel *result = &node; - if(result->tr_child_atree_left == NULL){ - while(result->tr_child_atree_up != NULL && result->tr_child_atree_up->tr_child_atree_left == result){ - result = result->tr_child_atree_up; + if(result->cascdel_tr_child_atree_left == NULL){ + while(result->cascdel_tr_child_atree_up != NULL && result->cascdel_tr_child_atree_up->cascdel_tr_child_atree_left == result){ + result = result->cascdel_tr_child_atree_up; } - result = result->tr_child_atree_up; + result = result->cascdel_tr_child_atree_up; }else{ - result = tr_child_atree_LastImpl(result->tr_child_atree_left); + result = tr_child_atree_LastImpl(result->cascdel_tr_child_atree_left); } return result; } @@ -2585,8 +2657,8 @@ atf_amc::FCascdel* atf_amc::tr_child_atree_Prev(atf_amc::FCascdel& node) { // --- atf_amc.FCascdel.tr_child_atree.LastImpl atf_amc::FCascdel* atf_amc::tr_child_atree_LastImpl(atf_amc::FCascdel* root) { atf_amc::FCascdel *result = root; - while(result != NULL && result->tr_child_atree_right != NULL){ - result = result->tr_child_atree_right; + while(result != NULL && result->cascdel_tr_child_atree_right != NULL){ + result = result->cascdel_tr_child_atree_right; } return result; } @@ -2604,20 +2676,20 @@ inline static bool atf_amc::tr_child_atree_ElemLt(atf_amc::FCascdel& cascdel, at } // --- atf_amc.FCascdel.tr_child_atree.UpdateDepth -static void atf_amc::tr_child_atree_updateDepth(atf_amc::FCascdel& node) { - i32 ldepth = node.tr_child_atree_left != NULL ? node.tr_child_atree_left->tr_child_atree_depth : 0; - i32 rdepth = node.tr_child_atree_right != NULL ? node.tr_child_atree_right->tr_child_atree_depth : 0; - node.tr_child_atree_depth = i32_Max(ldepth, rdepth) + 1; +static void atf_amc::cascdel_tr_child_atree_updateDepth(atf_amc::FCascdel& node) { + i32 ldepth = node.cascdel_tr_child_atree_left != NULL ? node.cascdel_tr_child_atree_left->cascdel_tr_child_atree_depth : 0; + i32 rdepth = node.cascdel_tr_child_atree_right != NULL ? node.cascdel_tr_child_atree_right->cascdel_tr_child_atree_depth : 0; + node.cascdel_tr_child_atree_depth = i32_Max(ldepth, rdepth) + 1; } // --- atf_amc.FCascdel.tr_child_atree.Turn // rotates the tree in from->to direction static void atf_amc::tr_child_atree_Turn(atf_amc::FCascdel& from, atf_amc::FCascdel& to) { - atf_amc::FCascdel* root = to.tr_child_atree_up; - bool dir = root && root->tr_child_atree_left == &to; + atf_amc::FCascdel* root = to.cascdel_tr_child_atree_up; + bool dir = root && root->cascdel_tr_child_atree_left == &to; tr_child_atree_Connect(root, &from, dir); - dir = to.tr_child_atree_left == &from; - atf_amc::FCascdel* orphan = (dir ? from.tr_child_atree_right : from.tr_child_atree_left);//other side + dir = to.cascdel_tr_child_atree_left == &from; + atf_amc::FCascdel* orphan = (dir ? from.cascdel_tr_child_atree_right : from.cascdel_tr_child_atree_left);//other side tr_child_atree_Connect(&from, &to , !dir); tr_child_atree_Connect(&to, orphan, dir); } @@ -2625,10 +2697,10 @@ static void atf_amc::tr_child_atree_Turn(atf_amc::FCascdel& from, atf_amc::FCasc // --- atf_amc.FCascdel.tr_child_atree.Connect inline static void atf_amc::tr_child_atree_Connect(atf_amc::FCascdel* parent, atf_amc::FCascdel* child, bool left) { if(parent){ - (left ? parent->tr_child_atree_left : parent->tr_child_atree_right) = child; + (left ? parent->cascdel_tr_child_atree_left : parent->cascdel_tr_child_atree_right) = child; } if(child){ - child->tr_child_atree_up = parent; + child->cascdel_tr_child_atree_up = parent; } } @@ -2636,11 +2708,11 @@ inline static void atf_amc::tr_child_atree_Connect(atf_amc::FCascdel* parent, at // Empty the index. (rows may be deleted if cascdel) void atf_amc::tr_child_atree_RemoveAllImpl(atf_amc::FCascdel& cascdel, atf_amc::FCascdel* root, bool del) { if(root != NULL){ - tr_child_atree_RemoveAllImpl(cascdel, root->tr_child_atree_left, del); - tr_child_atree_RemoveAllImpl(cascdel, root->tr_child_atree_right, del); + tr_child_atree_RemoveAllImpl(cascdel, root->cascdel_tr_child_atree_left, del); + tr_child_atree_RemoveAllImpl(cascdel, root->cascdel_tr_child_atree_right, del); tr_child_atree_Disconnect(*root); - root->tr_child_atree_depth = 0;//the pointers are taken care of by Disconnect - root->tr_child_atree_up = (atf_amc::FCascdel*)-1;//the pointers are taken care of by Disconnect + root->cascdel_tr_child_atree_depth = 0;//the pointers are taken care of by Disconnect + root->cascdel_tr_child_atree_up = (atf_amc::FCascdel*)-1;//the pointers are taken care of by Disconnect if(del){ cascdel_Delete(*root); } @@ -2661,7 +2733,7 @@ atf_amc::FCascdel* atf_amc::tr_child_atree_FirstGe(atf_amc::FCascdel& cascdel, c bool left = false; while(result){ left = !((*result).key < val); - atf_amc::FCascdel* side = left ? result->tr_child_atree_left : result->tr_child_atree_right; + atf_amc::FCascdel* side = left ? result->cascdel_tr_child_atree_left : result->cascdel_tr_child_atree_right; if(side==NULL){ break; } @@ -2680,7 +2752,7 @@ atf_amc::FCascdel* atf_amc::tr_child_atree_LastLt(atf_amc::FCascdel& cascdel, co bool left = false; while(result){ left = val < (*result).key; - atf_amc::FCascdel* side = left ? result->tr_child_atree_left : result->tr_child_atree_right; + atf_amc::FCascdel* side = left ? result->cascdel_tr_child_atree_left : result->cascdel_tr_child_atree_right; if(side==NULL){ break; } @@ -2719,14 +2791,15 @@ void atf_amc::FCascdel_Init(atf_amc::FCascdel& cascdel) { cascdel.tr_child_atree_root = NULL; // (atf_amc.FCascdel.tr_child_atree) cascdel.tr_child_atree_n = 0; cascdel.cascdel_c_child_ptrary_in_ary = bool(false); - cascdel.ind_child_thash_next = (atf_amc::FCascdel*)-1; // (atf_amc.FCascdel.ind_child_thash) not-in-hash - cascdel.bh_child_bheap_idx = -1; // (atf_amc.FCascdel.bh_child_bheap) not-in-heap - cascdel.zd_childlist_next = (atf_amc::FCascdel*)-1; // (atf_amc.FCascdel.zd_childlist) not-in-list - cascdel.zd_childlist_prev = NULL; // (atf_amc.FCascdel.zd_childlist) - cascdel.tr_child_atree_up = (atf_amc::FCascdel*)-1; // (atf_amc.FCascdel.tr_child_atree) not in tree - cascdel.tr_child_atree_left = NULL; - cascdel.tr_child_atree_right = NULL; - cascdel.tr_child_atree_depth = 0; + cascdel.cascdel_ind_child_thash_next = (atf_amc::FCascdel*)-1; // (atf_amc.FCascdel.ind_child_thash) not-in-hash + cascdel.cascdel_ind_child_thash_hashval = 0; // stored hash value + cascdel.cascdel_bh_child_bheap_idx = -1; // (atf_amc.FCascdel.bh_child_bheap) not-in-heap + cascdel.cascdel_zd_childlist_next = (atf_amc::FCascdel*)-1; // (atf_amc.FCascdel.zd_childlist) not-in-list + cascdel.cascdel_zd_childlist_prev = NULL; // (atf_amc.FCascdel.zd_childlist) + cascdel.cascdel_tr_child_atree_up = (atf_amc::FCascdel*)-1; // (atf_amc.FCascdel.tr_child_atree) not in tree + cascdel.cascdel_tr_child_atree_left = NULL; + cascdel.cascdel_tr_child_atree_right = NULL; + cascdel.cascdel_tr_child_atree_depth = 0; cascdel.cascdel_next = (atf_amc::FCascdel*)-1; // (atf_amc.FDb.cascdel) not-in-tpool's freelist } @@ -2805,7 +2878,7 @@ void atf_amc::cascdel_bh_child_bheap_curs_Next(cascdel_bh_child_bheap_curs &curs i = l; } while (i < n); curs.temp_n = n-1; - int index = dead->bh_child_bheap_idx; + int index = dead->cascdel_bh_child_bheap_idx; i = (index*2+1); if (i < bh_child_bheap_N((*curs.parent))) { atf_amc::FCascdel &elem = *curs.parent->bh_child_bheap_elems[i]; @@ -2821,6 +2894,7 @@ void atf_amc::cascdel_bh_child_bheap_curs_Next(cascdel_bh_child_bheap_curs &curs // --- atf_amc.FCascdel..Uninit void atf_amc::FCascdel_Uninit(atf_amc::FCascdel& cascdel) { atf_amc::FCascdel &row = cascdel; (void)row; + key_Cleanup(cascdel); // dmmeta.fcleanup:atf_amc.FCascdel.key tr_child_atree_Cascdel(cascdel); // dmmeta.cascdel:atf_amc.FCascdel.tr_child_atree zd_childlist_Cascdel(cascdel); // dmmeta.cascdel:atf_amc.FCascdel.zd_childlist bh_child_bheap_Cascdel(cascdel); // dmmeta.cascdel:atf_amc.FCascdel.bh_child_bheap @@ -2846,7 +2920,6 @@ void atf_amc::FCascdel_Uninit(atf_amc::FCascdel& cascdel) { if (p_p_parent) { tr_child_atree_Remove(*p_p_parent, row);// remove cascdel from index tr_child_atree } - key_Cleanup(cascdel); // dmmeta.fcleanup:atf_amc.FCascdel.key // atf_amc.FCascdel.bh_child_bheap.Uninit (Bheap) // algo_lib::malloc_FreeMem((u8*)cascdel.bh_child_bheap_elems, sizeof(atf_amc::FCascdel*)*cascdel.bh_child_bheap_max); // (atf_amc.FCascdel.bh_child_bheap) @@ -4485,17 +4558,20 @@ bool atf_amc::types_XrefMaybe(atf_amc::FTypeS &row) { // Find row by key. Return NULL if not found. atf_amc::FTypeS* atf_amc::ind_types_Find(i32 key) { u32 index = ::i32_Hash(0, key) & (_db.ind_types_buckets_n - 1); - atf_amc::FTypeS* *e = &_db.ind_types_buckets_elems[index]; - atf_amc::FTypeS* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).types == key; - if (done) break; - e = &ret->ind_types_next; - } while (true); + atf_amc::FTypeS *ret = _db.ind_types_buckets_elems[index]; + for (; ret && !((*ret).types == key); ret = ret->ind_types_next) { + } return ret; } +// --- atf_amc.FDb.ind_types.FindX +// Look up row by key and return reference. Throw exception if not found +atf_amc::FTypeS& atf_amc::ind_types_FindX(i32 key) { + atf_amc::FTypeS* ret = ind_types_Find(key); + vrfy(ret, tempstr() << "atf_amc.key_error table:ind_types key:'"< old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4582,7 +4665,7 @@ void atf_amc::ind_types_Reserve(int n) { while (elem) { atf_amc::FTypeS &row = *elem; atf_amc::FTypeS* next = row.ind_types_next; - u32 index = ::i32_Hash(0, row.types) & (new_nbuckets-1); + u32 index = row.ind_types_hashval & (new_nbuckets-1); row.ind_types_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4599,17 +4682,20 @@ void atf_amc::ind_types_Reserve(int n) { // Find row by key. Return NULL if not found. atf_amc::FTypeA* atf_amc::ind_typea_Find(i32 key) { u32 index = ::i32_Hash(0, key) & (_db.ind_typea_buckets_n - 1); - atf_amc::FTypeA* *e = &_db.ind_typea_buckets_elems[index]; - atf_amc::FTypeA* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).typea == key; - if (done) break; - e = &ret->ind_typea_next; - } while (true); + atf_amc::FTypeA *ret = _db.ind_typea_buckets_elems[index]; + for (; ret && !((*ret).typea == key); ret = ret->ind_typea_next) { + } return ret; } +// --- atf_amc.FDb.ind_typea.FindX +// Look up row by key and return reference. Throw exception if not found +atf_amc::FTypeA& atf_amc::ind_typea_FindX(i32 key) { + atf_amc::FTypeA* ret = ind_typea_Find(key); + vrfy(ret, tempstr() << "atf_amc.key_error table:ind_typea key:'"< old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4696,7 +4789,7 @@ void atf_amc::ind_typea_Reserve(int n) { while (elem) { atf_amc::FTypeA &row = *elem; atf_amc::FTypeA* next = row.ind_typea_next; - u32 index = ::i32_Hash(0, row.typea) & (new_nbuckets-1); + u32 index = row.ind_typea_hashval & (new_nbuckets-1); row.ind_typea_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4795,9 +4888,8 @@ void atf_amc::ReadArgv() { } if (ch_N(attrname) == 0) { err << "atf_amc: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:atf_amc.FDb.cmdline @@ -4851,7 +4946,7 @@ void atf_amc::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -4948,8 +5043,8 @@ bool atf_amc::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && atf_amc::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -5229,17 +5324,20 @@ bool atf_amc::cstring_XrefMaybe(atf_amc::FCstring &row) { // Find row by key. Return NULL if not found. atf_amc::FCstring* atf_amc::ind_cstring_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_cstring_buckets_n - 1); - atf_amc::FCstring* *e = &_db.ind_cstring_buckets_elems[index]; - atf_amc::FCstring* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).str == key; - if (done) break; - e = &ret->ind_cstring_next; - } while (true); + atf_amc::FCstring *ret = _db.ind_cstring_buckets_elems[index]; + for (; ret && !((*ret).str == key); ret = ret->ind_cstring_next) { + } return ret; } +// --- atf_amc.FDb.ind_cstring.FindX +// Look up row by key and return reference. Throw exception if not found +atf_amc::FCstring& atf_amc::ind_cstring_FindX(const algo::strptr& key) { + atf_amc::FCstring* ret = ind_cstring_Find(key); + vrfy(ret, tempstr() << "atf_amc.key_error table:ind_cstring key:'"< old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -5326,7 +5431,7 @@ void atf_amc::ind_cstring_Reserve(int n) { while (elem) { atf_amc::FCstring &row = *elem; atf_amc::FCstring* next = row.ind_cstring_next; - u32 index = algo::cstring_Hash(0, row.str) & (new_nbuckets-1); + u32 index = row.ind_cstring_hashval & (new_nbuckets-1); row.ind_cstring_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -6039,7 +6144,9 @@ static void atf_amc::amctest_LoadStatic() { ,{ "atfdb.amctest amctest:PrintBase36 comment:\"\"", atf_amc::amctest_PrintBase36 } ,{ "atfdb.amctest amctest:PrintRawGconst comment:\"Check that gconst field within tuple is printed as raw\"", atf_amc::amctest_PrintRawGconst } ,{ "atfdb.amctest amctest:PtraryCursor comment:\"Test Ptrary cursor\"", atf_amc::amctest_PtraryCursor } + ,{ "atfdb.amctest amctest:PtraryHeaplike comment:\"Test heap-like Ptrary\"", atf_amc::amctest_PtraryHeaplike } ,{ "atfdb.amctest amctest:PtraryInsert comment:\"Insert/Remove invariants for Ptrary\"", atf_amc::amctest_PtraryInsert } + ,{ "atfdb.amctest amctest:PtraryNonUnique comment:\"Test non-unique heap-like\"", atf_amc::amctest_PtraryNonUnique } ,{ "atfdb.amctest amctest:ReadProc comment:\"Read from subprocess\"", atf_amc::amctest_ReadProc } ,{ "atfdb.amctest amctest:ReadTuple1 comment:\"A single field is printed without field name\"", atf_amc::amctest_ReadTuple1 } ,{ "atfdb.amctest amctest:ReadTuple2 comment:\"Two fields are printed as name-value pairs.\"", atf_amc::amctest_ReadTuple2 } @@ -6050,10 +6157,13 @@ static void atf_amc::amctest_LoadStatic() { ,{ "atfdb.amctest amctest:Scratch comment:\"Scratch area for new test development\"", atf_amc::amctest_Scratch } ,{ "atfdb.amctest amctest:SetGetnumBase10 comment:\"\"", atf_amc::amctest_SetGetnumBase10 } ,{ "atfdb.amctest amctest:SubstrDfltval comment:\"\"", atf_amc::amctest_SubstrDfltval } + ,{ "atfdb.amctest amctest:TaryAllocNAt comment:\"\"", atf_amc::amctest_TaryAllocNAt } + ,{ "atfdb.amctest amctest:TaryHash comment:\"\"", atf_amc::amctest_TaryHash } ,{ "atfdb.amctest amctest:TaryInit comment:\"u32: Add element to Tary, check that it's initialized\"", atf_amc::amctest_TaryInit } ,{ "atfdb.amctest amctest:TaryInit2 comment:\"u32: Add N elements to Tary, check that they're initialized\"", atf_amc::amctest_TaryInit2 } ,{ "atfdb.amctest amctest:TaryInit3 comment:\"u8: Add element to Tary, check that it's initialized\"", atf_amc::amctest_TaryInit3 } ,{ "atfdb.amctest amctest:TaryInit4 comment:\"u8: Add N elements to Tary, check that they're initialized\"", atf_amc::amctest_TaryInit4 } + ,{ "atfdb.amctest amctest:TaryInsary comment:\"\"", atf_amc::amctest_TaryInsary } ,{ "atfdb.amctest amctest:TaryReserve comment:\"\"", atf_amc::amctest_TaryReserve } ,{ "atfdb.amctest amctest:TestBitfld comment:\"U16 bitfields: Set values, check that they were set\"", atf_amc::amctest_TestBitfld } ,{ "atfdb.amctest amctest:TestBitfld2 comment:\"U128 bitfields: Set values, check that they were set\"", atf_amc::amctest_TestBitfld2 } @@ -6081,9 +6191,15 @@ static void atf_amc::amctest_LoadStatic() { ,{ "atfdb.amctest amctest:ThashFindRemove comment:\"\"", atf_amc::amctest_ThashFindRemove } ,{ "atfdb.amctest amctest:ThashGetOrCreate comment:\"\"", atf_amc::amctest_ThashGetOrCreate } ,{ "atfdb.amctest amctest:ThashInsertMaybe comment:\"\"", atf_amc::amctest_ThashInsertMaybe } + ,{ "atfdb.amctest amctest:ThashLinear comment:\"\"", atf_amc::amctest_ThashLinear } ,{ "atfdb.amctest amctest:ThashRemove comment:\"\"", atf_amc::amctest_ThashRemove } + ,{ "atfdb.amctest amctest:ThashStrkey comment:\"\"", atf_amc::amctest_ThashStrkey } ,{ "atfdb.amctest amctest:ThashXref comment:\"\"", atf_amc::amctest_ThashXref } ,{ "atfdb.amctest amctest:Typetag comment:\"\"", atf_amc::amctest_Typetag } + ,{ "atfdb.amctest amctest:Varlen2 comment:\"\"", atf_amc::amctest_Varlen2 } + ,{ "atfdb.amctest amctest:Varlen2a comment:\"\"", atf_amc::amctest_Varlen2a } + ,{ "atfdb.amctest amctest:Varlen2m comment:\"\"", atf_amc::amctest_Varlen2m } + ,{ "atfdb.amctest amctest:Varlen2v comment:\"\"", atf_amc::amctest_Varlen2v } ,{ "atfdb.amctest amctest:VarlenAlloc comment:\"\"", atf_amc::amctest_VarlenAlloc } ,{ "atfdb.amctest amctest:VarlenExternLength comment:\"\"", atf_amc::amctest_VarlenExternLength } ,{ "atfdb.amctest amctest:VarlenMsgs comment:\"Variable-length messages (Opt+Varlen)\"", atf_amc::amctest_VarlenMsgs } @@ -6132,6 +6248,7 @@ static void atf_amc::amctest_LoadStatic() { ,{ "atfdb.amctest amctest:fstep_Inline comment:\"Check step type\"", atf_amc::amctest_fstep_Inline } ,{ "atfdb.amctest amctest:fstep_InlineOnce comment:\"Check step type\"", atf_amc::amctest_fstep_InlineOnce } ,{ "atfdb.amctest amctest:fstep_InlineRecur comment:\"Check step type\"", atf_amc::amctest_fstep_InlineRecur } + ,{ "atfdb.amctest amctest:fstep_TimeHookOnce comment:\"Check step type\"", atf_amc::amctest_fstep_TimeHookOnce } ,{ "atfdb.amctest amctest:fstep_TimeHookRecur comment:\"Check step type\"", atf_amc::amctest_fstep_TimeHookRecur } ,{ "atfdb.amctest amctest:linebuf_test1 comment:\"Initial state -- no line\"", atf_amc::amctest_linebuf_test1 } ,{ "atfdb.amctest amctest:linebuf_test2 comment:\"write a line, read line back\"", atf_amc::amctest_linebuf_test2 } @@ -6149,8 +6266,8 @@ static void atf_amc::amctest_LoadStatic() { ,{ "atfdb.amctest amctest:msgbuf_test3 comment:\"good message, then not enough data\"", atf_amc::amctest_msgbuf_test3 } ,{ "atfdb.amctest amctest:msgbuf_test4 comment:\"message, read partial message, supply new data, read message\"", atf_amc::amctest_msgbuf_test4 } ,{ "atfdb.amctest amctest:msgbuf_test5 comment:\"If GetMsg returns NULL, buffer is removed from read list\"", atf_amc::amctest_msgbuf_test5 } - ,{ "atfdb.amctest amctest:msgbuf_test6 comment:\"Write runt message to buffer, check that eof and error flags are set\"", atf_amc::amctest_msgbuf_test6 } - ,{ "atfdb.amctest amctest:msgbuf_test7 comment:\"Write HUGE message to buffer, check that error flag is set\"", atf_amc::amctest_msgbuf_test7 } + ,{ "atfdb.amctest amctest:msgbuf_test6 comment:\"Write runt message to buffer, check that eof and err flags are set\"", atf_amc::amctest_msgbuf_test6 } + ,{ "atfdb.amctest amctest:msgbuf_test7 comment:\"Write HUGE message to buffer, check that err flag is set\"", atf_amc::amctest_msgbuf_test7 } ,{ "atfdb.amctest amctest:msgbuf_test8 comment:\"Write message to pipe, read it\"", atf_amc::amctest_msgbuf_test8 } ,{ "atfdb.amctest amctest:msgbuf_test9 comment:\"Write 2 messages to temp buffer. Feed them 1 by one through buffer\"", atf_amc::amctest_msgbuf_test9 } ,{NULL, NULL} @@ -6749,15 +6866,11 @@ bool atf_amc::optg_XrefMaybe(atf_amc::FOptG &row) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void atf_amc::c_typek_Insert(atf_amc::FTypeK& row) { - if (bool_Update(row._db_c_typek_in_ary,true)) { - // reserve space + if (!row.c_typek_in_ary) { c_typek_Reserve(1); - u32 n = _db.c_typek_n; - u32 at = n; - atf_amc::FTypeK* *elems = _db.c_typek_elems; - elems[at] = &row; - _db.c_typek_n = n+1; - + u32 n = _db.c_typek_n++; + _db.c_typek_elems[n] = &row; + row.c_typek_in_ary = true; } } @@ -6766,7 +6879,7 @@ void atf_amc::c_typek_Insert(atf_amc::FTypeK& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool atf_amc::c_typek_InsertMaybe(atf_amc::FTypeK& row) { - bool retval = !row._db_c_typek_in_ary; + bool retval = !c_typek_InAryQ(row); c_typek_Insert(row); // check is performed in _Insert again return retval; } @@ -6774,18 +6887,18 @@ bool atf_amc::c_typek_InsertMaybe(atf_amc::FTypeK& row) { // --- atf_amc.FDb.c_typek.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void atf_amc::c_typek_Remove(atf_amc::FTypeK& row) { - if (bool_Update(row._db_c_typek_in_ary,false)) { - int lim = _db.c_typek_n; + int n = _db.c_typek_n; + if (bool_Update(row.c_typek_in_ary,false)) { atf_amc::FTypeK* *elems = _db.c_typek_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { atf_amc::FTypeK* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(atf_amc::FTypeK*) * (lim - j); + size_t nbytes = sizeof(atf_amc::FTypeK*) * (n - j); memmove(elems + i, elems + j, nbytes); - _db.c_typek_n = lim - 1; + _db.c_typek_n = n - 1; break; } } @@ -6809,6 +6922,155 @@ void atf_amc::c_typek_Reserve(u32 n) { } } +// --- atf_amc.FDb.c_typel.Insert +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +void atf_amc::c_typel_Insert(atf_amc::FTypeL& row) { + if (row.c_typel_idx == -1) { + c_typel_Reserve(1); + u32 n = _db.c_typel_n++; + _db.c_typel_elems[n] = &row; + row.c_typel_idx = n; + } +} + +// --- atf_amc.FDb.c_typel.InsertMaybe +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +bool atf_amc::c_typel_InsertMaybe(atf_amc::FTypeL& row) { + bool retval = !c_typel_InAryQ(row); + c_typel_Insert(row); // check is performed in _Insert again + return retval; +} + +// --- atf_amc.FDb.c_typel.Remove +// Find element using linear scan. If element is in array, remove, otherwise do nothing +void atf_amc::c_typel_Remove(atf_amc::FTypeL& row) { + int n = _db.c_typel_n; + int idx = row.c_typel_idx; + if (idx != -1) { + atf_amc::FTypeL *last = _db.c_typel_elems[n-1]; + last->c_typel_idx = idx; + _db.c_typel_elems[idx] = last; + row.c_typel_idx = -1; + _db.c_typel_n = n - 1; + } +} + +// --- atf_amc.FDb.c_typel.Reserve +// Reserve space in index for N more elements; +void atf_amc::c_typel_Reserve(u32 n) { + u32 old_max = _db.c_typel_max; + if (UNLIKELY(_db.c_typel_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(atf_amc::FTypeL*); + u32 new_size = new_max * sizeof(atf_amc::FTypeL*); + void *new_mem = algo_lib::malloc_ReallocMem(_db.c_typel_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.out_of_memory field:atf_amc.FDb.c_typel"); + } + _db.c_typel_elems = (atf_amc::FTypeL**)new_mem; + _db.c_typel_max = new_max; + } +} + +// --- atf_amc.FDb.c_typel.RemoveFirst +// Heap-like Ptrary: remove first element +// If index is empty, return NULL. Otherwise remove and return first element in index. +atf_amc::FTypeL* atf_amc::c_typel_RemoveFirst() { + atf_amc::FTypeL *row = NULL; + int n = _db.c_typel_n; + if (n > 0) { + row = _db.c_typel_elems[0]; + row->c_typel_idx=-1; + _db.c_typel_elems[n-1]->c_typel_idx=0; + _db.c_typel_elems[0]=_db.c_typel_elems[n-1]; + _db.c_typel_n = n-1; + } + return row; +} + +// --- atf_amc.FDb.c_typel.RemoveLast +// Ptrary: remove last element +// If index is empty, return NULL. Otherwise remove and return last element in index. +atf_amc::FTypeL* atf_amc::c_typel_RemoveLast() { + atf_amc::FTypeL *row = NULL; + int n = _db.c_typel_n; + if (n > 0) { + row = _db.c_typel_elems[n-1]; + row->c_typel_idx=-1; + _db.c_typel_n = n-1; + } + return row; +} + +// --- atf_amc.FDb.c_typem.Insert +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +void atf_amc::c_typem_Insert(atf_amc::FTypeM& row) { + c_typem_Reserve(1); + u32 n = _db.c_typem_n++; + _db.c_typem_elems[n] = &row; +} + +// --- atf_amc.FDb.c_typem.ScanInsertMaybe +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Linear search is used to locate the element. +// Return value: whether element was inserted into array. +bool atf_amc::c_typem_ScanInsertMaybe(atf_amc::FTypeM& row) { + bool retval = true; + u32 n = _db.c_typem_n; + for (u32 i = 0; i < n; i++) { + if (_db.c_typem_elems[i] == &row) { + retval = false; + break; + } + } + if (retval) { + // reserve space + c_typem_Reserve(1); + _db.c_typem_elems[n] = &row; + _db.c_typem_n = n+1; + } + return retval; +} + +// --- atf_amc.FDb.c_typem.Remove +// Find element using linear scan. If element is in array, remove, otherwise do nothing +void atf_amc::c_typem_Remove(atf_amc::FTypeM& row) { + int n = _db.c_typem_n; + int j=0; + for (int i=0; i old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(atf_amc::FTypeM*); + u32 new_size = new_max * sizeof(atf_amc::FTypeM*); + void *new_mem = algo_lib::malloc_ReallocMem(_db.c_typem_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.out_of_memory field:atf_amc.FDb.c_typem"); + } + _db.c_typem_elems = (atf_amc::FTypeM**)new_mem; + _db.c_typem_max = new_max; + } +} + // --- atf_amc.FDb.avl.Alloc // Allocate memory for new default row. // If out of memory, process is killed. @@ -7384,17 +7646,20 @@ bool atf_amc::bytebuf_dyn_XrefMaybe(atf_amc::BytebufDyn &row) { // Find row by key. Return NULL if not found. atf_amc::FThashElem* atf_amc::ind_thash_elem_Find(u64 key) { u32 index = ::u64_Hash(0, key) & (_db.ind_thash_elem_buckets_n - 1); - atf_amc::FThashElem* *e = &_db.ind_thash_elem_buckets_elems[index]; - atf_amc::FThashElem* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).key == key; - if (done) break; - e = &ret->ind_thash_elem_next; - } while (true); + atf_amc::FThashElem *ret = _db.ind_thash_elem_buckets_elems[index]; + for (; ret && !((*ret).key == key); ret = ret->ind_thash_elem_next) { + } return ret; } +// --- atf_amc.FDb.ind_thash_elem.FindX +// Look up row by key and return reference. Throw exception if not found +atf_amc::FThashElem& atf_amc::ind_thash_elem_FindX(u64 key) { + atf_amc::FThashElem* ret = ind_thash_elem_Find(key); + vrfy(ret, tempstr() << "atf_amc.key_error table:ind_thash_elem key:'"< old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -7481,7 +7753,7 @@ void atf_amc::ind_thash_elem_Reserve(int n) { while (elem) { atf_amc::FThashElem &row = *elem; atf_amc::FThashElem* next = row.ind_thash_elem_next; - u32 index = ::u64_Hash(0, row.key) & (new_nbuckets-1); + u32 index = row.ind_thash_elem_hashval & (new_nbuckets-1); row.ind_thash_elem_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -7599,718 +7871,1993 @@ bool atf_amc::thash_elem_XrefMaybe(atf_amc::FThashElem &row) { return retval; } -// --- atf_amc.FDb.trace.RowidFind -// find trace by row id (used to implement reflection) -static algo::ImrowPtr atf_amc::trace_RowidFind(int t) { - return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +// --- atf_amc.FDb.hashable.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +atf_amc::Hashable& atf_amc::hashable_Alloc() { + atf_amc::Hashable* row = hashable_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("atf_amc.out_of_mem field:atf_amc.FDb.hashable comment:'Alloc failed'"); + } + return *row; } -// --- atf_amc.FDb.trace.N -// Function return 1 -inline static i32 atf_amc::trace_N() { - return 1; +// --- atf_amc.FDb.hashable.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +atf_amc::Hashable* atf_amc::hashable_AllocMaybe() { + atf_amc::Hashable *row = (atf_amc::Hashable*)hashable_AllocMem(); + if (row) { + new (row) atf_amc::Hashable; // call constructor + } + return row; } -// --- atf_amc.FDb.bh_typec_curs.Add -static void atf_amc::_db_bh_typec_curs_Add(_db_bh_typec_curs &curs, atf_amc::FTypeC& row) { - u32 n = curs.temp_n; - int i = n; - curs.temp_n = n+1; - atf_amc::FTypeC* *elems = curs.temp_elems; - while (i>0) { - int j = (i-1)/2; - atf_amc::FTypeC* p = elems[j]; - if (!bh_typec_ElemLt(row,*p)) { +// --- atf_amc.FDb.hashable.Delete +// Remove row from all global and cross indices, then deallocate row +void atf_amc::hashable_Delete(atf_amc::Hashable &row) { + row.~Hashable(); + hashable_FreeMem(row); +} + +// --- atf_amc.FDb.hashable.AllocMem +// Allocate space for one element +// If no memory available, return NULL. +void* atf_amc::hashable_AllocMem() { + atf_amc::Hashable *row = _db.hashable_free; + if (UNLIKELY(!row)) { + hashable_Reserve(1); + row = _db.hashable_free; + } + if (row) { + _db.hashable_free = row->hashable_next; + } + return row; +} + +// --- atf_amc.FDb.hashable.FreeMem +// Remove mem from all global and cross indices, then deallocate mem +void atf_amc::hashable_FreeMem(atf_amc::Hashable &row) { + if (UNLIKELY(row.hashable_next != (atf_amc::Hashable*)-1)) { + FatalErrorExit("atf_amc.tpool_double_delete pool:atf_amc.FDb.hashable comment:'double deletion caught'"); + } + row.hashable_next = _db.hashable_free; // insert into free list + _db.hashable_free = &row; +} + +// --- atf_amc.FDb.hashable.Reserve +// Preallocate memory for N more elements +// Return number of elements actually reserved. +u64 atf_amc::hashable_Reserve(u64 n_elems) { + u64 ret = 0; + while (ret < n_elems) { + u64 size = _db.hashable_blocksize; // underlying allocator is probably Lpool + u64 reserved = hashable_ReserveMem(size); + ret += reserved; + if (reserved == 0) { break; } - elems[i]=p; - i=j; } - elems[i]=&row; + return ret; } -// --- atf_amc.FDb.bh_typec_curs.Reserve -void atf_amc::_db_bh_typec_curs_Reserve(_db_bh_typec_curs &curs, int n) { - if (n > curs.temp_max) { - size_t old_size = sizeof(void*) * curs.temp_max; - size_t new_size = sizeof(void*) * bh_typec_N(); - curs.temp_elems = (atf_amc::FTypeC**)algo_lib::malloc_ReallocMem(curs.temp_elems, old_size, new_size); - if (!curs.temp_elems) { - algo::FatalErrorExit("atf_amc.cursor_out_of_memory func:atf_amc.FDb.bh_typec_curs.Reserve"); +// --- atf_amc.FDb.hashable.ReserveMem +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +u64 atf_amc::hashable_ReserveMem(u64 size) { + u64 ret = 0; + if (size >= sizeof(atf_amc::Hashable)) { + atf_amc::Hashable *mem = (atf_amc::Hashable*)algo_lib::malloc_AllocMem(size); + ret = mem ? size / sizeof(atf_amc::Hashable) : 0; + // add newly allocated elements to the free list; + for (u64 i=0; i < ret; i++) { + mem[i].hashable_next = _db.hashable_free; + _db.hashable_free = mem+i; } - curs.temp_max = bh_typec_N(); } + return ret; } -// --- atf_amc.FDb.bh_typec_curs.Reset -// Reset cursor. If HEAP is non-empty, add its top element to CURS. -void atf_amc::_db_bh_typec_curs_Reset(_db_bh_typec_curs &curs, atf_amc::FDb &parent) { - curs.parent = &parent; - _db_bh_typec_curs_Reserve(curs, bh_typec_N()); - curs.temp_n = 0; - if (parent.bh_typec_n > 0) { - atf_amc::FTypeC &first = *parent.bh_typec_elems[0]; - curs.temp_elems[0] = &first; // insert first element in heap - curs.temp_n = 1; +// --- atf_amc.FDb.hashable.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool atf_amc::hashable_XrefMaybe(atf_amc::Hashable &row) { + bool retval = true; + (void)row; + // insert hashable into index ind_hashable + if (true) { // user-defined insert condition + bool success = ind_hashable_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "atf_amc.duplicate_key xref:atf_amc.FDb.ind_hashable"; // check for duplicate key + return false; + } } + return retval; } -// --- atf_amc.FDb.bh_typec_curs.Next -// Advance cursor. -void atf_amc::_db_bh_typec_curs_Next(_db_bh_typec_curs &curs) { - atf_amc::FTypeC* *elems = curs.temp_elems; - int n = curs.temp_n; - if (n > 0) { - // remove top element from heap - atf_amc::FTypeC* dead = elems[0]; - int i = 0; - atf_amc::FTypeC* last = curs.temp_elems[n-1]; - // downheap last elem +// --- atf_amc.FDb.ind_hashable.Find +// Find row by key. Return NULL if not found. +atf_amc::Hashable* atf_amc::ind_hashable_Find(const algo::U64Ary& key) { + u32 index = algo::U64Ary_Hash(0, key) & (_db.ind_hashable_buckets_n - 1); + atf_amc::Hashable *ret = _db.ind_hashable_buckets_elems[index]; + for (; ret && !((*ret).key == key); ret = ret->ind_hashable_next) { + } + return ret; +} + +// --- atf_amc.FDb.ind_hashable.FindX +// Look up row by key and return reference. Throw exception if not found +atf_amc::Hashable& atf_amc::ind_hashable_FindX(const algo::U64Ary& key) { + atf_amc::Hashable* ret = ind_hashable_Find(key); + vrfy(ret, tempstr() << "atf_amc.key_error table:ind_hashable key:'"<bh_typec_idx; - i = (index*2+1); - if (i < bh_typec_N()) { - atf_amc::FTypeC &elem = *curs.parent->bh_typec_elems[i]; - _db_bh_typec_curs_Add(curs, elem); + if ((*ret).key == row.key) { // exit condition 2: found matching key + retval = false; + break; + } + prev = &ret->ind_hashable_next; + } while (true); + if (retval) { + row.ind_hashable_next = *prev; + _db.ind_hashable_n++; + *prev = &row; } - if (i+1 < bh_typec_N()) { - atf_amc::FTypeC &elem = *curs.parent->bh_typec_elems[i + 1]; - _db_bh_typec_curs_Add(curs, elem); + } + return retval; +} + +// --- atf_amc.FDb.ind_hashable.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void atf_amc::ind_hashable_Remove(atf_amc::Hashable& row) { + if (LIKELY(row.ind_hashable_next != (atf_amc::Hashable*)-1)) {// check if in hash already + u32 index = row.ind_hashable_hashval & (_db.ind_hashable_buckets_n - 1); + atf_amc::Hashable* *prev = &_db.ind_hashable_buckets_elems[index]; // addr of pointer to current element + while (atf_amc::Hashable *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_hashable_next; // unlink (singly linked list) + _db.ind_hashable_n--; + row.ind_hashable_next = (atf_amc::Hashable*)-1;// not-in-hash + break; + } + prev = &next->ind_hashable_next; } } } -// --- atf_amc.FDb..Init -// Set all fields to initial values. -void atf_amc::FDb_Init() { - _db.bh_typec_max = 0; // (atf_amc.FDb.bh_typec) - _db.bh_typec_n = 0; // (atf_amc.FDb.bh_typec) - _db.bh_typec_elems = NULL; // (atf_amc.FDb.bh_typec) - _db.zdl_h_typec_head = NULL; // (atf_amc.FDb.zdl_h_typec) - _db.zdl_h_typec_n = 0; // (atf_amc.FDb.zdl_h_typec) - _db.zdl_h_typec_tail = NULL; // (atf_amc.FDb.zdl_h_typec) - _db.zd_t_typec_head = NULL; // (atf_amc.FDb.zd_t_typec) - _db.zd_t_typec_n = 0; // (atf_amc.FDb.zd_t_typec) - _db.zd_t_typec_tail = NULL; // (atf_amc.FDb.zd_t_typec) - _db.zd_typed_head = NULL; // (atf_amc.FDb.zd_typed) - _db.zd_typed_n = 0; // (atf_amc.FDb.zd_typed) - _db.zd_typed_tail = NULL; // (atf_amc.FDb.zd_typed) - _db.zs_t_typed_head = NULL; // (atf_amc.FDb.zs_t_typed) - _db.zs_t_typed_n = 0; // (atf_amc.FDb.zs_t_typed) - _db.zs_t_typed_tail = NULL; // (atf_amc.FDb.zs_t_typed) - _db.cd_typed_head = NULL; // (atf_amc.FDb.cd_typed) - _db.cd_typed_n = 0; // (atf_amc.FDb.cd_typed) - _db.zsl_h_typec_head = NULL; // (atf_amc.FDb.zsl_h_typec) - _db.zsl_h_typec_n = 0; // (atf_amc.FDb.zsl_h_typec) - _db.zsl_h_typec_tail = NULL; // (atf_amc.FDb.zsl_h_typec) - _db.zs_t_typec_head = NULL; // (atf_amc.FDb.zs_t_typec) - _db.zs_t_typec_n = 0; // (atf_amc.FDb.zs_t_typec) - _db.zs_t_typec_tail = NULL; // (atf_amc.FDb.zs_t_typec) - _db.zs_mt_typec_head = NULL; // (atf_amc.FDb.zs_mt_typec) - _db.zs_mt_typec_mt = NULL; // (atf_amc.FDb.zs_mt_typec) - _db.zdl_hnt_typec_head = NULL; // (atf_amc.FDb.zdl_hnt_typec) - _db.zdl_hnt_typec_n = 0; // (atf_amc.FDb.zdl_hnt_typec) - _db.cdl_h_typec_head = NULL; // (atf_amc.FDb.cdl_h_typec) - _db.cdl_h_typec_n = 0; // (atf_amc.FDb.cdl_h_typec) - _db.cd_t_typec_head = NULL; // (atf_amc.FDb.cd_t_typec) - _db.cd_t_typec_n = 0; // (atf_amc.FDb.cd_t_typec) - _db.csl_h_typec_head = NULL; // (atf_amc.FDb.csl_h_typec) - _db.csl_h_typec_n = 0; // (atf_amc.FDb.csl_h_typec) - _db.csl_h_typec_tail = NULL; // (atf_amc.FDb.csl_h_typec) - _db.cs_t_typec_head = NULL; // (atf_amc.FDb.cs_t_typec) - _db.cs_t_typec_n = 0; // (atf_amc.FDb.cs_t_typec) - _db.cs_t_typec_tail = NULL; // (atf_amc.FDb.cs_t_typec) - // initialize LAry typea (atf_amc.FDb.typea) - _db.typea_n = 0; - memset(_db.typea_lary, 0, sizeof(_db.typea_lary)); // zero out all level pointers - atf_amc::FTypeA* typea_first = (atf_amc::FTypeA*)algo_lib::malloc_AllocMem(sizeof(atf_amc::FTypeA) * (u64(1)<<4)); - if (!typea_first) { - FatalErrorExit("out of memory"); +// --- atf_amc.FDb.ind_hashable.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void atf_amc::ind_hashable_Reserve(int n) { + ind_hashable_AbsReserve(_db.ind_hashable_n + n); +} + +// --- atf_amc.FDb.ind_hashable.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_amc::ind_hashable_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_hashable_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(atf_amc::Hashable*); + u32 new_size = new_nbuckets * sizeof(atf_amc::Hashable*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + atf_amc::Hashable* *new_buckets = (atf_amc::Hashable**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("atf_amc.out_of_memory field:atf_amc.FDb.ind_hashable"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_hashable_buckets_n; i++) { + atf_amc::Hashable* elem = _db.ind_hashable_buckets_elems[i]; + while (elem) { + atf_amc::Hashable &row = *elem; + atf_amc::Hashable* next = row.ind_hashable_next; + u32 index = row.ind_hashable_hashval & (new_nbuckets-1); + row.ind_hashable_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_hashable_buckets_elems, old_size); + _db.ind_hashable_buckets_elems = new_buckets; + _db.ind_hashable_buckets_n = new_nbuckets; } - for (int i = 0; i < 4; i++) { - _db.typea_lary[i] = typea_first; - typea_first += 1ULL<time_entry_next; } - memset(_db.ind_types_buckets_elems, 0, sizeof(atf_amc::FTypeS*)*_db.ind_types_buckets_n); // (atf_amc.FDb.ind_types) - // initialize hash table for atf_amc::FTypeA; - _db.ind_typea_n = 0; // (atf_amc.FDb.ind_typea) - _db.ind_typea_buckets_n = 4; // (atf_amc.FDb.ind_typea) - _db.ind_typea_buckets_elems = (atf_amc::FTypeA**)algo_lib::malloc_AllocMem(sizeof(atf_amc::FTypeA*)*_db.ind_typea_buckets_n); // initial buckets (atf_amc.FDb.ind_typea) - if (!_db.ind_typea_buckets_elems) { - FatalErrorExit("out of memory"); // (atf_amc.FDb.ind_typea) - } - memset(_db.ind_typea_buckets_elems, 0, sizeof(atf_amc::FTypeA*)*_db.ind_typea_buckets_n); // (atf_amc.FDb.ind_typea) - _db.cs_h_count = i32(0); - _db.cs_t_count = i32(0); - _db.zs_h_count = i32(0); - _db.zs_t_count = i32(0); - _db.zs_mt_count = i32(0); - _db.bh_count = i32(0); - // initialize LAry typet (atf_amc.FDb.typet) - _db.typet_n = 0; - memset(_db.typet_lary, 0, sizeof(_db.typet_lary)); // zero out all level pointers - atf_amc::FTypeT* typet_first = (atf_amc::FTypeT*)algo_lib::malloc_AllocMem(sizeof(atf_amc::FTypeT) * (u64(1)<<4)); - if (!typet_first) { - FatalErrorExit("out of memory"); + return row; +} + +// --- atf_amc.FDb.time_entry.FreeMem +// Remove mem from all global and cross indices, then deallocate mem +void atf_amc::time_entry_FreeMem(atf_amc::FTimeEntry &row) { + if (UNLIKELY(row.time_entry_next != (atf_amc::FTimeEntry*)-1)) { + FatalErrorExit("atf_amc.tpool_double_delete pool:atf_amc.FDb.time_entry comment:'double deletion caught'"); } - for (int i = 0; i < 4; i++) { - _db.typet_lary[i] = typet_first; - typet_first += 1ULL<= sizeof(atf_amc::FTimeEntry)) { + atf_amc::FTimeEntry *mem = (atf_amc::FTimeEntry*)algo_lib::malloc_AllocMem(size); + ret = mem ? size / sizeof(atf_amc::FTimeEntry) : 0; + // add newly allocated elements to the free list; + for (u64 i=0; i < ret; i++) { + mem[i].time_entry_next = _db.time_entry_free; + _db.time_entry_free = mem+i; + } } - for (int i = 0; i < 4; i++) { - _db.cstring_lary[i] = cstring_first; - cstring_first += 1ULL<bh_time_entry_idx = idx; + elems[idx] = p; + idx = child; + child = idx*2+1; } - // initialize hash table for atf_amc::FCstring; - _db.ind_cstring_n = 0; // (atf_amc.FDb.ind_cstring) - _db.ind_cstring_buckets_n = 4; // (atf_amc.FDb.ind_cstring) - _db.ind_cstring_buckets_elems = (atf_amc::FCstring**)algo_lib::malloc_AllocMem(sizeof(atf_amc::FCstring*)*_db.ind_cstring_buckets_n); // initial buckets (atf_amc.FDb.ind_cstring) - if (!_db.ind_cstring_buckets_elems) { - FatalErrorExit("out of memory"); // (atf_amc.FDb.ind_cstring) + return idx; +} + +// --- atf_amc.FDb.bh_time_entry.Insert +// Insert row. Row must not already be in index. If row is already in index, do nothing. +void atf_amc::bh_time_entry_Insert(atf_amc::FTimeEntry& row) { + if (LIKELY(row.bh_time_entry_idx == -1)) { + bh_time_entry_Reserve(1); + int n = _db.bh_time_entry_n; + _db.bh_time_entry_n = n + 1; + int new_idx = bh_time_entry_Upheap(row, n); + row.bh_time_entry_idx = new_idx; + _db.bh_time_entry_elems[new_idx] = &row; + if (new_idx==0) { + bh_time_entry_FirstChanged(); + } } - memset(_db.ind_cstring_buckets_elems, 0, sizeof(atf_amc::FCstring*)*_db.ind_cstring_buckets_n); // (atf_amc.FDb.ind_cstring) - _db.cd_in_msg_head = NULL; // (atf_amc.FDb.cd_in_msg) - // typeb: initialize Tpool - _db.typeb_free = NULL; - _db.typeb_blocksize = algo::BumpToPow2(64 * sizeof(atf_amc::FTypeB)); // allocate 64-127 elements at a time - // pooledbe64: initialize Tpool - _db.pooledbe64_free = NULL; - _db.pooledbe64_blocksize = algo::BumpToPow2(64 * sizeof(atf_amc::PooledBE64)); // allocate 64-127 elements at a time - memset(_db.varlen_extern_free, 0, sizeof(_db.varlen_extern_free)); - _db.varlen_extern_n = 0; - // initialize LAry amctest (atf_amc.FDb.amctest) - _db.amctest_n = 0; - memset(_db.amctest_lary, 0, sizeof(_db.amctest_lary)); // zero out all level pointers - atf_amc::FAmctest* amctest_first = (atf_amc::FAmctest*)algo_lib::malloc_AllocMem(sizeof(atf_amc::FAmctest) * (u64(1)<<4)); - if (!amctest_first) { - FatalErrorExit("out of memory"); +} + +// --- atf_amc.FDb.bh_time_entry.Reheap +// If row is in heap, update its position. If row is not in heap, insert it. +// Return new position of item in the heap (0=top) +// If first item of the is changed, update fstep:atf_amc.FDb.bh_time_entry +i32 atf_amc::bh_time_entry_Reheap(atf_amc::FTimeEntry& row) { + int old_idx = row.bh_time_entry_idx; + bool isnew = old_idx == -1; + if (isnew) { + bh_time_entry_Reserve(1); + old_idx = _db.bh_time_entry_n++; } - for (int i = 0; i < 4; i++) { - _db.amctest_lary[i] = amctest_first; - amctest_first += 1ULL<bh_time_entry_idx = new_idx; + _db.bh_time_entry_elems[new_idx] = elem; + } + if (old_idx == 0) { + bh_time_entry_FirstChanged(); + } + } } - memset(_db.ind_thash_elem_buckets_elems, 0, sizeof(atf_amc::FThashElem*)*_db.ind_thash_elem_buckets_n); // (atf_amc.FDb.ind_thash_elem) - // initialize LAry thash_elem (atf_amc.FDb.thash_elem) - _db.thash_elem_n = 0; - memset(_db.thash_elem_lary, 0, sizeof(_db.thash_elem_lary)); // zero out all level pointers - atf_amc::FThashElem* thash_elem_first = (atf_amc::FThashElem*)algo_lib::malloc_AllocMem(sizeof(atf_amc::FThashElem) * (u64(1)<<4)); - if (!thash_elem_first) { - FatalErrorExit("out of memory"); +} + +// --- atf_amc.FDb.bh_time_entry.RemoveAll +// Remove all elements from binary heap +void atf_amc::bh_time_entry_RemoveAll() { + int n = _db.bh_time_entry_n; + for (int i = n - 1; i>=0; i--) { + _db.bh_time_entry_elems[i]->bh_time_entry_idx = -1; // mark not-in-heap } - for (int i = 0; i < 4; i++) { - _db.thash_elem_lary[i] = thash_elem_first; - thash_elem_first += 1ULL< 0) { + bh_time_entry_FirstChanged(); } +} - atf_amc::InitReflection(); - amctest_LoadStatic(); // gen:ns_gstatic gstatic:atf_amc.FDb.amctest load atf_amc.FAmctest records - listtype_LoadStatic(); // gen:ns_gstatic gstatic:atf_amc.FDb.listtype load atf_amc.FListtype records +// --- atf_amc.FDb.bh_time_entry.RemoveFirst +// If index is empty, return NULL. Otherwise remove and return first key in index. +// Call 'head changed' trigger. +atf_amc::FTimeEntry* atf_amc::bh_time_entry_RemoveFirst() { + atf_amc::FTimeEntry *row = NULL; + if (_db.bh_time_entry_n > 0) { + row = _db.bh_time_entry_elems[0]; + row->bh_time_entry_idx = -1; // mark not in heap + i32 n = _db.bh_time_entry_n - 1; // index of last element in heap + _db.bh_time_entry_n = n; // decrease count + if (n) { + atf_amc::FTimeEntry &elem = *_db.bh_time_entry_elems[n]; + int new_idx = bh_time_entry_Downheap(elem, 0); + elem.bh_time_entry_idx = new_idx; + _db.bh_time_entry_elems[new_idx] = &elem; + } + bh_time_entry_FirstChanged(); + } + return row; } -// --- atf_amc.FDb..Uninit -void atf_amc::FDb_Uninit() { - atf_amc::FDb &row = _db; (void)row; +// --- atf_amc.FDb.bh_time_entry.Reserve +// Reserve space in index for N more elements +void atf_amc::bh_time_entry_Reserve(int n) { + i32 old_max = _db.bh_time_entry_max; + if (UNLIKELY(_db.bh_time_entry_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(atf_amc::FTimeEntry*); + u32 new_size = new_max * sizeof(atf_amc::FTimeEntry*); + void *new_mem = algo_lib::malloc_ReallocMem(_db.bh_time_entry_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.out_of_memory field:atf_amc.FDb.bh_time_entry"); + } + _db.bh_time_entry_elems = (atf_amc::FTimeEntry**)new_mem; + _db.bh_time_entry_max = new_max; + } +} - // atf_amc.FDb.thash_elem.Uninit (Lary) // - // skip destruction in global scope +// --- atf_amc.FDb.bh_time_entry.Upheap +// Find and return index of new location for element ROW in the heap, starting at index IDX. +// Move any elements along the way but do not modify ROW. +static int atf_amc::bh_time_entry_Upheap(atf_amc::FTimeEntry& row, int idx) { + atf_amc::FTimeEntry* *elems = _db.bh_time_entry_elems; + while (idx>0) { + int j = (idx-1)/2; + atf_amc::FTimeEntry* p = elems[j]; + if (!bh_time_entry_ElemLt(row, *p)) { + break; + } + p->bh_time_entry_idx = idx; + elems[idx] = p; + idx = j; + } + return idx; +} - // atf_amc.FDb.ind_thash_elem.Uninit (Thash) // - // skip destruction of ind_thash_elem in global scope +// --- atf_amc.FDb.bh_time_entry.ElemLt +inline static bool atf_amc::bh_time_entry_ElemLt(atf_amc::FTimeEntry &a, atf_amc::FTimeEntry &b) { + (void)_db; + return time_Lt(a, b); +} - // atf_amc.FDb.listtype.Uninit (Inlary) // - // skip destruction in global scope +// --- atf_amc.FDb.bh_time_entry.FirstChanged +// First element of index changed. +// If index bh_time_entry is empty, deschedule time hook _db.th_bh_time_entry. +// If index is non-empty, update time hook to fire at specified time. +static void atf_amc::bh_time_entry_FirstChanged() { + FTimeEntry* row = bh_time_entry_First(); + if (row) { + _db.th_bh_time_entry.time = row->time; + bh_timehook_Reheap(_db.th_bh_time_entry); // (atf_amc.FDb.bh_time_entry) TimeHookOnce + } else { + bh_timehook_Remove(_db.th_bh_time_entry); + } +} - // atf_amc.FDb.avl.Uninit (Lary) // - // skip destruction in global scope +// --- atf_amc.FDb.bh_time_entry.UpdateCycles +// Update cycles count from previous clock capture +static void atf_amc::bh_time_entry_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} - // atf_amc.FDb.c_typek.Uninit (Ptrary) // - algo_lib::malloc_FreeMem(_db.c_typek_elems, sizeof(atf_amc::FTypeK*)*_db.c_typek_max); // (atf_amc.FDb.c_typek) +// --- atf_amc.FDb.bh_time_entry.Call +static void atf_amc::bh_time_entry_Call() { + // Call Step for all entries expired by this time. + // (_db.clock may get updated during this loop, but only those entries + // that expired prior will be processed.) + algo_lib::_db.step_limit = algo_lib::_db.clock; + while (atf_amc::FTimeEntry *bh_time_entry = atf_amc::bh_time_entry_First()) { // fstep:atf_amc.FDb.bh_time_entry + algo::SchedTime expire = (*bh_time_entry).time; + if (expire < algo_lib::_db.step_limit) { + atf_amc::bh_time_entry_Step(); // steptype:InlineOnce: call function at specified time + bh_time_entry_UpdateCycles(); + } else { + break; + } + } +} - // atf_amc.FDb.amctest.Uninit (Lary) // - // skip destruction in global scope +// --- atf_amc.FDb.ind_linear.Find +// Find row by key. Return NULL if not found. +atf_amc::FHashableLinear* atf_amc::ind_linear_Find(algo::U32LinearKey key) { + u32 index = key; + atf_amc::FHashableLinear *ret = index < u32(_db.ind_linear_buckets_n) ? _db.ind_linear_buckets_elems[index] : NULL; + return ret; +} - // atf_amc.FDb.ind_cstring.Uninit (Thash) // - // skip destruction of ind_cstring in global scope +// --- atf_amc.FDb.ind_linear.FindX +// Look up row by key and return reference. Throw exception if not found +atf_amc::FHashableLinear& atf_amc::ind_linear_FindX(algo::U32LinearKey key) { + atf_amc::FHashableLinear* ret = ind_linear_Find(key); + vrfy(ret, tempstr() << "atf_amc.key_error table:ind_linear key:'"<ind_linear_next; + } while (true); + if (retval) { + row.ind_linear_next = *prev; + _db.ind_linear_n++; + *prev = &row; + } + } return retval; } -// --- atf_amc.TypeG..Print -// print string representation of ROW to string STR -// cfmt:atf_amc.TypeG.String printfmt:Raw -void atf_amc::TypeG_Print(atf_amc::TypeG& row, algo::cstring& str) { - i32_Print(row.typeg, str); -} - -// --- atf_amc.FOptG.optg.CopyOut -// Copy fields out of row -void atf_amc::optg_CopyOut(atf_amc::FOptG &row, atf_amc::OptG &out) { - // length: field value is computed - // typeg: unknown field type (Opt), skipped - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter +// --- atf_amc.FDb.ind_linear.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void atf_amc::ind_linear_Remove(atf_amc::FHashableLinear& row) { + if (LIKELY(row.ind_linear_next != (atf_amc::FHashableLinear*)-1)) {// check if in hash already + u32 index = row.ind_linear_hashval; + atf_amc::FHashableLinear* *prev = index < u32(_db.ind_linear_buckets_n) ? &_db.ind_linear_buckets_elems[index] : NULL; // addr of pointer to current element + while (atf_amc::FHashableLinear *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_linear_next; // unlink (singly linked list) + _db.ind_linear_n--; + row.ind_linear_next = (atf_amc::FHashableLinear*)-1;// not-in-hash + break; + } + prev = &next->ind_linear_next; + } + } } -// --- atf_amc.FOptG.optg.CopyIn -// Copy fields in to row -void atf_amc::optg_CopyIn(atf_amc::FOptG &row, atf_amc::OptG &in) { - // length: field value is computed - // typeg: unknown field reftype (Opt), skipped - (void)row;//only to avoid -Wunused-parameter - (void)in;//only to avoid -Wunused-parameter +// --- atf_amc.FDb.ind_linear.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void atf_amc::ind_linear_Reserve(int n) { + ind_linear_AbsReserve(_db.ind_linear_n + n); } -// --- atf_amc.FOptG.typeg.Getary -// Access optional portion as an array of bytes -algo::aryptr atf_amc::typeg_Getary(atf_amc::FOptG& optg) { - u8 *end = (u8*)&optg + sizeof(atf_amc::FOptG); - return algo::aryptr(end, i32(optg.length) - ssizeof(atf_amc::FOptG)); +// --- atf_amc.FDb.ind_linear.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_amc::ind_linear_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_linear_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(atf_amc::FHashableLinear*); + u32 new_size = new_nbuckets * sizeof(atf_amc::FHashableLinear*); + // realloc, old entries keep their positions + atf_amc::FHashableLinear* *new_buckets = (atf_amc::FHashableLinear**)algo_lib::malloc_ReallocMem(_db.ind_linear_buckets_elems, old_size, new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("atf_amc.out_of_memory field:atf_amc.FDb.ind_linear"); + } + // clear tail of reallocated space + memset(new_buckets+old_nbuckets, 0, new_size-old_size); + _db.ind_linear_buckets_elems = new_buckets; + _db.ind_linear_buckets_n = new_nbuckets; + } } -// --- atf_amc.FPerfSortString.orig.Addary -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -algo::aryptr atf_amc::orig_Addary(atf_amc::FPerfSortString& parent, algo::aryptr rhs) { - bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.orig_elems && rhs.elems < parent.orig_elems + parent.orig_max; - if (UNLIKELY(overlaps)) { - FatalErrorExit("atf_amc.tary_alias field:atf_amc.FPerfSortString.orig comment:'alias error: sub-array is being appended to the whole'"); +// --- atf_amc.FDb.ind_linear.FindRemove +atf_amc::FHashableLinear* atf_amc::ind_linear_FindRemove(algo::U32LinearKey key) { + u32 index = key; + atf_amc::FHashableLinear* *prev = index < u32(_db.ind_linear_buckets_n) ? &_db.ind_linear_buckets_elems[index] : NULL; // addr of pointer to current element + atf_amc::FHashableLinear* ret=NULL; + if (prev) { + do { + ret = *prev; + bool done = !ret || (*ret).key == key; + if (done) break; + prev = &ret->ind_linear_next; + } while (true); } - int nnew = rhs.n_elems; - orig_Reserve(parent, nnew); // reserve space - int at = parent.orig_n; - for (int i = 0; i < nnew; i++) { - new (parent.orig_elems + at + i) atf_amc::Cstr(rhs[i]); - parent.orig_n++; + if (ret) { + *prev = ret->ind_linear_next; + ret->ind_linear_next = (atf_amc::FHashableLinear*)-1; // not-in-hash + _db.ind_linear_n--; } - return algo::aryptr(parent.orig_elems + at, nnew); + return ret; } -// --- atf_amc.FPerfSortString.orig.Alloc -// Reserve space. Insert element at the end -// The new element is initialized to a default value -atf_amc::Cstr& atf_amc::orig_Alloc(atf_amc::FPerfSortString& parent) { - orig_Reserve(parent, 1); - int n = parent.orig_n; - int at = n; - atf_amc::Cstr *elems = parent.orig_elems; - new (elems + at) atf_amc::Cstr(); // construct new element, default initializer - parent.orig_n = n+1; - return elems[at]; +// --- atf_amc.FDb.hashable_linear.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +atf_amc::FHashableLinear& atf_amc::hashable_linear_Alloc() { + atf_amc::FHashableLinear* row = hashable_linear_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("atf_amc.out_of_mem field:atf_amc.FDb.hashable_linear comment:'Alloc failed'"); + } + return *row; } -// --- atf_amc.FPerfSortString.orig.AllocAt -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -atf_amc::Cstr& atf_amc::orig_AllocAt(atf_amc::FPerfSortString& parent, int at) { - orig_Reserve(parent, 1); - int n = parent.orig_n; - if (UNLIKELY(u64(at) >= u64(n+1))) { - FatalErrorExit("atf_amc.bad_alloc_at field:atf_amc.FPerfSortString.orig comment:'index out of range'"); +// --- atf_amc.FDb.hashable_linear.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +atf_amc::FHashableLinear* atf_amc::hashable_linear_AllocMaybe() { + atf_amc::FHashableLinear *row = (atf_amc::FHashableLinear*)hashable_linear_AllocMem(); + if (row) { + new (row) atf_amc::FHashableLinear; // call constructor } - atf_amc::Cstr *elems = parent.orig_elems; - memmove(elems + at + 1, elems + at, (n - at) * sizeof(atf_amc::Cstr)); - new (elems + at) atf_amc::Cstr(); // construct element, default initializer - parent.orig_n = n+1; - return elems[at]; + return row; } -// --- atf_amc.FPerfSortString.orig.AllocN -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr atf_amc::orig_AllocN(atf_amc::FPerfSortString& parent, int n_elems) { - orig_Reserve(parent, n_elems); - int old_n = parent.orig_n; - int new_n = old_n + n_elems; - atf_amc::Cstr *elems = parent.orig_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) atf_amc::Cstr(); // construct new element, default initialize - } - parent.orig_n = new_n; - return algo::aryptr(elems + old_n, n_elems); +// --- atf_amc.FDb.hashable_linear.Delete +// Remove row from all global and cross indices, then deallocate row +void atf_amc::hashable_linear_Delete(atf_amc::FHashableLinear &row) { + row.~FHashableLinear(); + hashable_linear_FreeMem(row); } -// --- atf_amc.FPerfSortString.orig.Remove -// Remove item by index. If index outside of range, do nothing. -void atf_amc::orig_Remove(atf_amc::FPerfSortString& parent, u32 i) { - u32 lim = parent.orig_n; - atf_amc::Cstr *elems = parent.orig_elems; - if (i < lim) { - elems[i].~Cstr(); // destroy element - memmove(elems + i, elems + (i + 1), sizeof(atf_amc::Cstr) * (lim - (i + 1))); - parent.orig_n = lim - 1; +// --- atf_amc.FDb.hashable_linear.AllocMem +// Allocate space for one element +// If no memory available, return NULL. +void* atf_amc::hashable_linear_AllocMem() { + atf_amc::FHashableLinear *row = _db.hashable_linear_free; + if (UNLIKELY(!row)) { + hashable_linear_Reserve(1); + row = _db.hashable_linear_free; + } + if (row) { + _db.hashable_linear_free = row->hashable_linear_next; } + return row; } -// --- atf_amc.FPerfSortString.orig.RemoveAll -void atf_amc::orig_RemoveAll(atf_amc::FPerfSortString& parent) { - u32 n = parent.orig_n; - while (n > 0) { - n -= 1; - parent.orig_elems[n].~Cstr(); - parent.orig_n = n; +// --- atf_amc.FDb.hashable_linear.FreeMem +// Remove mem from all global and cross indices, then deallocate mem +void atf_amc::hashable_linear_FreeMem(atf_amc::FHashableLinear &row) { + if (UNLIKELY(row.hashable_linear_next != (atf_amc::FHashableLinear*)-1)) { + FatalErrorExit("atf_amc.tpool_double_delete pool:atf_amc.FDb.hashable_linear comment:'double deletion caught'"); } + row.hashable_linear_next = _db.hashable_linear_free; // insert into free list + _db.hashable_linear_free = &row; } -// --- atf_amc.FPerfSortString.orig.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void atf_amc::orig_RemoveLast(atf_amc::FPerfSortString& parent) { - u64 n = parent.orig_n; - if (n > 0) { - n -= 1; - orig_qFind(parent, u64(n)).~Cstr(); - parent.orig_n = n; +// --- atf_amc.FDb.hashable_linear.Reserve +// Preallocate memory for N more elements +// Return number of elements actually reserved. +u64 atf_amc::hashable_linear_Reserve(u64 n_elems) { + u64 ret = 0; + while (ret < n_elems) { + u64 size = _db.hashable_linear_blocksize; // underlying allocator is probably Lpool + u64 reserved = hashable_linear_ReserveMem(size); + ret += reserved; + if (reserved == 0) { + break; + } } + return ret; } -// --- atf_amc.FPerfSortString.orig.AbsReserve -// Make sure N elements fit in array. Process dies if out of memory -void atf_amc::orig_AbsReserve(atf_amc::FPerfSortString& parent, int n) { - u32 old_max = parent.orig_max; - if (n > i32(old_max)) { - u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); - void *new_mem = algo_lib::malloc_ReallocMem(parent.orig_elems, old_max * sizeof(atf_amc::Cstr), new_max * sizeof(atf_amc::Cstr)); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("atf_amc.tary_nomem field:atf_amc.FPerfSortString.orig comment:'out of memory'"); +// --- atf_amc.FDb.hashable_linear.ReserveMem +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +u64 atf_amc::hashable_linear_ReserveMem(u64 size) { + u64 ret = 0; + if (size >= sizeof(atf_amc::FHashableLinear)) { + atf_amc::FHashableLinear *mem = (atf_amc::FHashableLinear*)algo_lib::malloc_AllocMem(size); + ret = mem ? size / sizeof(atf_amc::FHashableLinear) : 0; + // add newly allocated elements to the free list; + for (u64 i=0; i < ret; i++) { + mem[i].hashable_linear_next = _db.hashable_linear_free; + _db.hashable_linear_free = mem+i; } - parent.orig_elems = (atf_amc::Cstr*)new_mem; - parent.orig_max = new_max; } + return ret; } -// --- atf_amc.FPerfSortString.orig.Setary -// Copy contents of RHS to PARENT. -void atf_amc::orig_Setary(atf_amc::FPerfSortString& parent, atf_amc::FPerfSortString &rhs) { - orig_RemoveAll(parent); - int nnew = rhs.orig_n; - orig_Reserve(parent, nnew); // reserve space - for (int i = 0; i < nnew; i++) { // copy elements over - new (parent.orig_elems + i) atf_amc::Cstr(orig_qFind(rhs, i)); - parent.orig_n = i + 1; +// --- atf_amc.FDb.hashable_linear.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool atf_amc::hashable_linear_XrefMaybe(atf_amc::FHashableLinear &row) { + bool retval = true; + (void)row; + // insert hashable_linear into index ind_linear + if (true) { // user-defined insert condition + bool success = ind_linear_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "atf_amc.duplicate_key xref:atf_amc.FDb.ind_linear"; // check for duplicate key + return false; + } } + return retval; } -// --- atf_amc.FPerfSortString.orig.Setary2 -// Copy specified array into orig, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -void atf_amc::orig_Setary(atf_amc::FPerfSortString& parent, const algo::aryptr &rhs) { - orig_RemoveAll(parent); - orig_Addary(parent, rhs); +// --- atf_amc.FDb.strkey.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +atf_amc::Strkey& atf_amc::strkey_Alloc() { + atf_amc::Strkey* row = strkey_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("atf_amc.out_of_mem field:atf_amc.FDb.strkey comment:'Alloc failed'"); + } + return *row; } -// --- atf_amc.FPerfSortString.orig.AllocNVal -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr atf_amc::orig_AllocNVal(atf_amc::FPerfSortString& parent, int n_elems, const atf_amc::Cstr& val) { - orig_Reserve(parent, n_elems); - int old_n = parent.orig_n; - int new_n = old_n + n_elems; - atf_amc::Cstr *elems = parent.orig_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) atf_amc::Cstr(val); +// --- atf_amc.FDb.strkey.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +atf_amc::Strkey* atf_amc::strkey_AllocMaybe() { + atf_amc::Strkey *row = (atf_amc::Strkey*)strkey_AllocMem(); + if (row) { + new (row) atf_amc::Strkey; // call constructor } - parent.orig_n = new_n; - return algo::aryptr(elems + old_n, n_elems); + return row; } -// --- atf_amc.FPerfSortString.sorted1.Addary -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -algo::aryptr atf_amc::sorted1_Addary(atf_amc::FPerfSortString& parent, algo::aryptr rhs) { - bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.sorted1_elems && rhs.elems < parent.sorted1_elems + parent.sorted1_max; - if (UNLIKELY(overlaps)) { - FatalErrorExit("atf_amc.tary_alias field:atf_amc.FPerfSortString.sorted1 comment:'alias error: sub-array is being appended to the whole'"); +// --- atf_amc.FDb.strkey.Delete +// Remove row from all global and cross indices, then deallocate row +void atf_amc::strkey_Delete(atf_amc::Strkey &row) { + row.~Strkey(); + strkey_FreeMem(row); +} + +// --- atf_amc.FDb.strkey.AllocMem +// Allocate space for one element +// If no memory available, return NULL. +void* atf_amc::strkey_AllocMem() { + atf_amc::Strkey *row = _db.strkey_free; + if (UNLIKELY(!row)) { + strkey_Reserve(1); + row = _db.strkey_free; } - int nnew = rhs.n_elems; - sorted1_Reserve(parent, nnew); // reserve space - int at = parent.sorted1_n; - for (int i = 0; i < nnew; i++) { - new (parent.sorted1_elems + at + i) atf_amc::Cstr(rhs[i]); - parent.sorted1_n++; + if (row) { + _db.strkey_free = row->strkey_next; } - return algo::aryptr(parent.sorted1_elems + at, nnew); + return row; } -// --- atf_amc.FPerfSortString.sorted1.Alloc -// Reserve space. Insert element at the end -// The new element is initialized to a default value -atf_amc::Cstr& atf_amc::sorted1_Alloc(atf_amc::FPerfSortString& parent) { - sorted1_Reserve(parent, 1); - int n = parent.sorted1_n; - int at = n; - atf_amc::Cstr *elems = parent.sorted1_elems; - new (elems + at) atf_amc::Cstr(); // construct new element, default initializer - parent.sorted1_n = n+1; - return elems[at]; +// --- atf_amc.FDb.strkey.FreeMem +// Remove mem from all global and cross indices, then deallocate mem +void atf_amc::strkey_FreeMem(atf_amc::Strkey &row) { + if (UNLIKELY(row.strkey_next != (atf_amc::Strkey*)-1)) { + FatalErrorExit("atf_amc.tpool_double_delete pool:atf_amc.FDb.strkey comment:'double deletion caught'"); + } + row.strkey_next = _db.strkey_free; // insert into free list + _db.strkey_free = &row; } -// --- atf_amc.FPerfSortString.sorted1.AllocAt -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -atf_amc::Cstr& atf_amc::sorted1_AllocAt(atf_amc::FPerfSortString& parent, int at) { - sorted1_Reserve(parent, 1); - int n = parent.sorted1_n; - if (UNLIKELY(u64(at) >= u64(n+1))) { - FatalErrorExit("atf_amc.bad_alloc_at field:atf_amc.FPerfSortString.sorted1 comment:'index out of range'"); +// --- atf_amc.FDb.strkey.Reserve +// Preallocate memory for N more elements +// Return number of elements actually reserved. +u64 atf_amc::strkey_Reserve(u64 n_elems) { + u64 ret = 0; + while (ret < n_elems) { + u64 size = _db.strkey_blocksize; // underlying allocator is probably Lpool + u64 reserved = strkey_ReserveMem(size); + ret += reserved; + if (reserved == 0) { + break; + } } - atf_amc::Cstr *elems = parent.sorted1_elems; - memmove(elems + at + 1, elems + at, (n - at) * sizeof(atf_amc::Cstr)); - new (elems + at) atf_amc::Cstr(); // construct element, default initializer - parent.sorted1_n = n+1; - return elems[at]; + return ret; } -// --- atf_amc.FPerfSortString.sorted1.AllocN -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr atf_amc::sorted1_AllocN(atf_amc::FPerfSortString& parent, int n_elems) { - sorted1_Reserve(parent, n_elems); - int old_n = parent.sorted1_n; - int new_n = old_n + n_elems; - atf_amc::Cstr *elems = parent.sorted1_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) atf_amc::Cstr(); // construct new element, default initialize +// --- atf_amc.FDb.strkey.ReserveMem +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +u64 atf_amc::strkey_ReserveMem(u64 size) { + u64 ret = 0; + if (size >= sizeof(atf_amc::Strkey)) { + atf_amc::Strkey *mem = (atf_amc::Strkey*)algo_lib::malloc_AllocMem(size); + ret = mem ? size / sizeof(atf_amc::Strkey) : 0; + // add newly allocated elements to the free list; + for (u64 i=0; i < ret; i++) { + mem[i].strkey_next = _db.strkey_free; + _db.strkey_free = mem+i; + } } - parent.sorted1_n = new_n; - return algo::aryptr(elems + old_n, n_elems); + return ret; } -// --- atf_amc.FPerfSortString.sorted1.Remove -// Remove item by index. If index outside of range, do nothing. -void atf_amc::sorted1_Remove(atf_amc::FPerfSortString& parent, u32 i) { - u32 lim = parent.sorted1_n; - atf_amc::Cstr *elems = parent.sorted1_elems; - if (i < lim) { - elems[i].~Cstr(); // destroy element - memmove(elems + i, elems + (i + 1), sizeof(atf_amc::Cstr) * (lim - (i + 1))); - parent.sorted1_n = lim - 1; +// --- atf_amc.FDb.strkey.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool atf_amc::strkey_XrefMaybe(atf_amc::Strkey &row) { + bool retval = true; + (void)row; + // insert strkey into index ind_strkey + if (true) { // user-defined insert condition + bool success = ind_strkey_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "atf_amc.duplicate_key xref:atf_amc.FDb.ind_strkey"; // check for duplicate key + return false; + } } + return retval; } -// --- atf_amc.FPerfSortString.sorted1.RemoveAll -void atf_amc::sorted1_RemoveAll(atf_amc::FPerfSortString& parent) { - u32 n = parent.sorted1_n; - while (n > 0) { - n -= 1; - parent.sorted1_elems[n].~Cstr(); - parent.sorted1_n = n; +// --- atf_amc.FDb.ind_strkey.Find +// Find row by key. Return NULL if not found. +atf_amc::Strkey* atf_amc::ind_strkey_Find(const algo::strptr& key) { + u32 index = algo::cstring_Hash(0, key) & (_db.ind_strkey_buckets_n - 1); + atf_amc::Strkey *ret = _db.ind_strkey_buckets_elems[index]; + for (; ret && !((*ret).strkey == key); ret = ret->ind_strkey_next) { } + return ret; } -// --- atf_amc.FPerfSortString.sorted1.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void atf_amc::sorted1_RemoveLast(atf_amc::FPerfSortString& parent) { - u64 n = parent.sorted1_n; - if (n > 0) { - n -= 1; - sorted1_qFind(parent, u64(n)).~Cstr(); - parent.sorted1_n = n; +// --- atf_amc.FDb.ind_strkey.FindX +// Look up row by key and return reference. Throw exception if not found +atf_amc::Strkey& atf_amc::ind_strkey_FindX(const algo::strptr& key) { + atf_amc::Strkey* ret = ind_strkey_Find(key); + vrfy(ret, tempstr() << "atf_amc.key_error table:ind_strkey key:'"< i32(old_max)) { - u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); - void *new_mem = algo_lib::malloc_ReallocMem(parent.sorted1_elems, old_max * sizeof(atf_amc::Cstr), new_max * sizeof(atf_amc::Cstr)); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("atf_amc.tary_nomem field:atf_amc.FPerfSortString.sorted1 comment:'out of memory'"); +// --- atf_amc.FDb.ind_strkey.InsertMaybe +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +bool atf_amc::ind_strkey_InsertMaybe(atf_amc::Strkey& row) { + bool retval = true; // if already in hash, InsertMaybe returns true + if (LIKELY(row.ind_strkey_next == (atf_amc::Strkey*)-1)) {// check if in hash already + row.ind_strkey_hashval = algo::cstring_Hash(0, row.strkey); + ind_strkey_Reserve(1); + u32 index = row.ind_strkey_hashval & (_db.ind_strkey_buckets_n - 1); + atf_amc::Strkey* *prev = &_db.ind_strkey_buckets_elems[index]; + do { + atf_amc::Strkey* ret = *prev; + if (!ret) { // exit condition 1: reached the end of the list + break; + } + if ((*ret).strkey == row.strkey) { // exit condition 2: found matching key + retval = false; + break; + } + prev = &ret->ind_strkey_next; + } while (true); + if (retval) { + row.ind_strkey_next = *prev; + _db.ind_strkey_n++; + *prev = &row; } - parent.sorted1_elems = (atf_amc::Cstr*)new_mem; - parent.sorted1_max = new_max; } + return retval; } -// --- atf_amc.FPerfSortString.sorted1.Setary -// Copy contents of RHS to PARENT. -void atf_amc::sorted1_Setary(atf_amc::FPerfSortString& parent, atf_amc::FPerfSortString &rhs) { - sorted1_RemoveAll(parent); - int nnew = rhs.sorted1_n; - sorted1_Reserve(parent, nnew); // reserve space - for (int i = 0; i < nnew; i++) { // copy elements over - new (parent.sorted1_elems + i) atf_amc::Cstr(sorted1_qFind(rhs, i)); - parent.sorted1_n = i + 1; +// --- atf_amc.FDb.ind_strkey.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void atf_amc::ind_strkey_Remove(atf_amc::Strkey& row) { + if (LIKELY(row.ind_strkey_next != (atf_amc::Strkey*)-1)) {// check if in hash already + u32 index = row.ind_strkey_hashval & (_db.ind_strkey_buckets_n - 1); + atf_amc::Strkey* *prev = &_db.ind_strkey_buckets_elems[index]; // addr of pointer to current element + while (atf_amc::Strkey *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_strkey_next; // unlink (singly linked list) + _db.ind_strkey_n--; + row.ind_strkey_next = (atf_amc::Strkey*)-1;// not-in-hash + break; + } + prev = &next->ind_strkey_next; + } } } -// --- atf_amc.FPerfSortString.sorted1.Setary2 -// Copy specified array into sorted1, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -void atf_amc::sorted1_Setary(atf_amc::FPerfSortString& parent, const algo::aryptr &rhs) { - sorted1_RemoveAll(parent); - sorted1_Addary(parent, rhs); +// --- atf_amc.FDb.ind_strkey.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void atf_amc::ind_strkey_Reserve(int n) { + ind_strkey_AbsReserve(_db.ind_strkey_n + n); } -// --- atf_amc.FPerfSortString.sorted1.AllocNVal -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr atf_amc::sorted1_AllocNVal(atf_amc::FPerfSortString& parent, int n_elems, const atf_amc::Cstr& val) { - sorted1_Reserve(parent, n_elems); - int old_n = parent.sorted1_n; - int new_n = old_n + n_elems; - atf_amc::Cstr *elems = parent.sorted1_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) atf_amc::Cstr(val); +// --- atf_amc.FDb.ind_strkey.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_amc::ind_strkey_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_strkey_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(atf_amc::Strkey*); + u32 new_size = new_nbuckets * sizeof(atf_amc::Strkey*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + atf_amc::Strkey* *new_buckets = (atf_amc::Strkey**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("atf_amc.out_of_memory field:atf_amc.FDb.ind_strkey"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_strkey_buckets_n; i++) { + atf_amc::Strkey* elem = _db.ind_strkey_buckets_elems[i]; + while (elem) { + atf_amc::Strkey &row = *elem; + atf_amc::Strkey* next = row.ind_strkey_next; + u32 index = row.ind_strkey_hashval & (new_nbuckets-1); + row.ind_strkey_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_strkey_buckets_elems, old_size); + _db.ind_strkey_buckets_elems = new_buckets; + _db.ind_strkey_buckets_n = new_nbuckets; } - parent.sorted1_n = new_n; - return algo::aryptr(elems + old_n, n_elems); } -// --- atf_amc.FPerfSortString.sorted1.Swap -// Swap values elem_a and elem_b -inline static void atf_amc::sorted1_Swap(atf_amc::Cstr &elem_a, atf_amc::Cstr &elem_b) { - u8 temp[sizeof(atf_amc::Cstr)]; - memcpy(&temp , &elem_a, sizeof(atf_amc::Cstr)); - memcpy(&elem_a, &elem_b, sizeof(atf_amc::Cstr)); - memcpy(&elem_b, &temp , sizeof(atf_amc::Cstr)); +// --- atf_amc.FDb.trace.RowidFind +// find trace by row id (used to implement reflection) +static algo::ImrowPtr atf_amc::trace_RowidFind(int t) { + return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); } -// --- atf_amc.FPerfSortString.sorted1.Rotleft -// Left circular shift of three-tuple -inline static void atf_amc::sorted1_Rotleft(atf_amc::Cstr &elem_a, atf_amc::Cstr &elem_b, atf_amc::Cstr &elem_c) { - u8 temp[sizeof(atf_amc::Cstr)]; - memcpy(&temp, &elem_a , sizeof(atf_amc::Cstr)); - memcpy(&elem_a , &elem_b , sizeof(atf_amc::Cstr)); - memcpy(&elem_b , &elem_c , sizeof(atf_amc::Cstr)); - memcpy(&elem_c , &temp, sizeof(atf_amc::Cstr)); +// --- atf_amc.FDb.trace.N +// Function return 1 +inline static i32 atf_amc::trace_N() { + return 1; } -// --- atf_amc.FPerfSortString.sorted1.Lt -// Compare values elem_a and elem_b -// The comparison function must be anti-symmetric: if a>b, then !(b>a). -// If not, mayhem results. -static bool atf_amc::sorted1_Lt(atf_amc::Cstr &elem_a, atf_amc::Cstr &elem_b) { - bool ret; - ret = val_Lt(elem_a, elem_b); - return ret; +// --- atf_amc.FDb.bh_typec_curs.Add +static void atf_amc::_db_bh_typec_curs_Add(_db_bh_typec_curs &curs, atf_amc::FTypeC& row) { + u32 n = curs.temp_n; + int i = n; + curs.temp_n = n+1; + atf_amc::FTypeC* *elems = curs.temp_elems; + while (i>0) { + int j = (i-1)/2; + atf_amc::FTypeC* p = elems[j]; + if (!bh_typec_ElemLt(row,*p)) { + break; + } + elems[i]=p; + i=j; + } + elems[i]=&row; } -// --- atf_amc.FPerfSortString.sorted1.SortedQ -// Verify whether array is sorted -bool atf_amc::sorted1_SortedQ(atf_amc::FPerfSortString& parent) { - atf_amc::Cstr *elems = sorted1_Getary(parent).elems; - int n = sorted1_N(parent); - for (int i = 1; i < n; i++) { - if (sorted1_Lt(elems[i], elems[i-1])) { - return false; +// --- atf_amc.FDb.bh_typec_curs.Reserve +void atf_amc::_db_bh_typec_curs_Reserve(_db_bh_typec_curs &curs, int n) { + if (n > curs.temp_max) { + size_t old_size = sizeof(void*) * curs.temp_max; + size_t new_size = sizeof(void*) * bh_typec_N(); + curs.temp_elems = (atf_amc::FTypeC**)algo_lib::malloc_ReallocMem(curs.temp_elems, old_size, new_size); + if (!curs.temp_elems) { + algo::FatalErrorExit("atf_amc.cursor_out_of_memory func:atf_amc.FDb.bh_typec_curs.Reserve"); } + curs.temp_max = bh_typec_N(); } - return true; } -// --- atf_amc.FPerfSortString.sorted1.IntInsertionSort -// Internal insertion sort -static void atf_amc::sorted1_IntInsertionSort(atf_amc::Cstr *elems, int n) { - for (int i = 1; i < n; ++i) { +// --- atf_amc.FDb.bh_typec_curs.Reset +// Reset cursor. If HEAP is non-empty, add its top element to CURS. +void atf_amc::_db_bh_typec_curs_Reset(_db_bh_typec_curs &curs, atf_amc::FDb &parent) { + curs.parent = &parent; + _db_bh_typec_curs_Reserve(curs, bh_typec_N()); + curs.temp_n = 0; + if (parent.bh_typec_n > 0) { + atf_amc::FTypeC &first = *parent.bh_typec_elems[0]; + curs.temp_elems[0] = &first; // insert first element in heap + curs.temp_n = 1; + } +} + +// --- atf_amc.FDb.bh_typec_curs.Next +// Advance cursor. +void atf_amc::_db_bh_typec_curs_Next(_db_bh_typec_curs &curs) { + atf_amc::FTypeC* *elems = curs.temp_elems; + int n = curs.temp_n; + if (n > 0) { + // remove top element from heap + atf_amc::FTypeC* dead = elems[0]; + int i = 0; + atf_amc::FTypeC* last = curs.temp_elems[n-1]; + // downheap last elem + do { + atf_amc::FTypeC* choose = last; + int l = i*2+1; + if (lbh_typec_idx; + i = (index*2+1); + if (i < bh_typec_N()) { + atf_amc::FTypeC &elem = *curs.parent->bh_typec_elems[i]; + _db_bh_typec_curs_Add(curs, elem); + } + if (i+1 < bh_typec_N()) { + atf_amc::FTypeC &elem = *curs.parent->bh_typec_elems[i + 1]; + _db_bh_typec_curs_Add(curs, elem); + } + } +} + +// --- atf_amc.FDb.bh_time_entry_curs.Add +static void atf_amc::_db_bh_time_entry_curs_Add(_db_bh_time_entry_curs &curs, atf_amc::FTimeEntry& row) { + u32 n = curs.temp_n; + int i = n; + curs.temp_n = n+1; + atf_amc::FTimeEntry* *elems = curs.temp_elems; + while (i>0) { + int j = (i-1)/2; + atf_amc::FTimeEntry* p = elems[j]; + if (!bh_time_entry_ElemLt(row,*p)) { + break; + } + elems[i]=p; + i=j; + } + elems[i]=&row; +} + +// --- atf_amc.FDb.bh_time_entry_curs.Reserve +void atf_amc::_db_bh_time_entry_curs_Reserve(_db_bh_time_entry_curs &curs, int n) { + if (n > curs.temp_max) { + size_t old_size = sizeof(void*) * curs.temp_max; + size_t new_size = sizeof(void*) * bh_time_entry_N(); + curs.temp_elems = (atf_amc::FTimeEntry**)algo_lib::malloc_ReallocMem(curs.temp_elems, old_size, new_size); + if (!curs.temp_elems) { + algo::FatalErrorExit("atf_amc.cursor_out_of_memory func:atf_amc.FDb.bh_time_entry_curs.Reserve"); + } + curs.temp_max = bh_time_entry_N(); + } +} + +// --- atf_amc.FDb.bh_time_entry_curs.Reset +// Reset cursor. If HEAP is non-empty, add its top element to CURS. +void atf_amc::_db_bh_time_entry_curs_Reset(_db_bh_time_entry_curs &curs, atf_amc::FDb &parent) { + curs.parent = &parent; + _db_bh_time_entry_curs_Reserve(curs, bh_time_entry_N()); + curs.temp_n = 0; + if (parent.bh_time_entry_n > 0) { + atf_amc::FTimeEntry &first = *parent.bh_time_entry_elems[0]; + curs.temp_elems[0] = &first; // insert first element in heap + curs.temp_n = 1; + } +} + +// --- atf_amc.FDb.bh_time_entry_curs.Next +// Advance cursor. +void atf_amc::_db_bh_time_entry_curs_Next(_db_bh_time_entry_curs &curs) { + atf_amc::FTimeEntry* *elems = curs.temp_elems; + int n = curs.temp_n; + if (n > 0) { + // remove top element from heap + atf_amc::FTimeEntry* dead = elems[0]; + int i = 0; + atf_amc::FTimeEntry* last = curs.temp_elems[n-1]; + // downheap last elem + do { + atf_amc::FTimeEntry* choose = last; + int l = i*2+1; + if (lbh_time_entry_idx; + i = (index*2+1); + if (i < bh_time_entry_N()) { + atf_amc::FTimeEntry &elem = *curs.parent->bh_time_entry_elems[i]; + _db_bh_time_entry_curs_Add(curs, elem); + } + if (i+1 < bh_time_entry_N()) { + atf_amc::FTimeEntry &elem = *curs.parent->bh_time_entry_elems[i + 1]; + _db_bh_time_entry_curs_Add(curs, elem); + } + } +} + +// --- atf_amc.FDb.ind_linear_curs.Reset +void atf_amc::_db_ind_linear_curs_Reset(_db_ind_linear_curs &curs, atf_amc::FDb &parent) { + curs.bucket = 0; + curs.parent = &parent; + curs.prow = &parent.ind_linear_buckets_elems[0]; // hash never has zero buckets + while (!*curs.prow) { + curs.bucket += 1; + if (curs.bucket == parent.ind_linear_buckets_n) break; + curs.prow = &parent.ind_linear_buckets_elems[curs.bucket]; + } +} + +// --- atf_amc.FDb..Init +// Set all fields to initial values. +void atf_amc::FDb_Init() { + _db.bh_typec_max = 0; // (atf_amc.FDb.bh_typec) + _db.bh_typec_n = 0; // (atf_amc.FDb.bh_typec) + _db.bh_typec_elems = NULL; // (atf_amc.FDb.bh_typec) + _db.zdl_h_typec_head = NULL; // (atf_amc.FDb.zdl_h_typec) + _db.zdl_h_typec_n = 0; // (atf_amc.FDb.zdl_h_typec) + _db.zdl_h_typec_tail = NULL; // (atf_amc.FDb.zdl_h_typec) + _db.zd_t_typec_head = NULL; // (atf_amc.FDb.zd_t_typec) + _db.zd_t_typec_n = 0; // (atf_amc.FDb.zd_t_typec) + _db.zd_t_typec_tail = NULL; // (atf_amc.FDb.zd_t_typec) + _db.zd_typed_head = NULL; // (atf_amc.FDb.zd_typed) + _db.zd_typed_n = 0; // (atf_amc.FDb.zd_typed) + _db.zd_typed_tail = NULL; // (atf_amc.FDb.zd_typed) + _db.zs_t_typed_head = NULL; // (atf_amc.FDb.zs_t_typed) + _db.zs_t_typed_n = 0; // (atf_amc.FDb.zs_t_typed) + _db.zs_t_typed_tail = NULL; // (atf_amc.FDb.zs_t_typed) + _db.cd_typed_head = NULL; // (atf_amc.FDb.cd_typed) + _db.cd_typed_n = 0; // (atf_amc.FDb.cd_typed) + _db.zsl_h_typec_head = NULL; // (atf_amc.FDb.zsl_h_typec) + _db.zsl_h_typec_n = 0; // (atf_amc.FDb.zsl_h_typec) + _db.zsl_h_typec_tail = NULL; // (atf_amc.FDb.zsl_h_typec) + _db.zs_t_typec_head = NULL; // (atf_amc.FDb.zs_t_typec) + _db.zs_t_typec_n = 0; // (atf_amc.FDb.zs_t_typec) + _db.zs_t_typec_tail = NULL; // (atf_amc.FDb.zs_t_typec) + _db.zs_mt_typec_head = NULL; // (atf_amc.FDb.zs_mt_typec) + _db.zs_mt_typec_mt = NULL; // (atf_amc.FDb.zs_mt_typec) + _db.zdl_hnt_typec_head = NULL; // (atf_amc.FDb.zdl_hnt_typec) + _db.zdl_hnt_typec_n = 0; // (atf_amc.FDb.zdl_hnt_typec) + _db.cdl_h_typec_head = NULL; // (atf_amc.FDb.cdl_h_typec) + _db.cdl_h_typec_n = 0; // (atf_amc.FDb.cdl_h_typec) + _db.cd_t_typec_head = NULL; // (atf_amc.FDb.cd_t_typec) + _db.cd_t_typec_n = 0; // (atf_amc.FDb.cd_t_typec) + _db.csl_h_typec_head = NULL; // (atf_amc.FDb.csl_h_typec) + _db.csl_h_typec_n = 0; // (atf_amc.FDb.csl_h_typec) + _db.csl_h_typec_tail = NULL; // (atf_amc.FDb.csl_h_typec) + _db.cs_t_typec_head = NULL; // (atf_amc.FDb.cs_t_typec) + _db.cs_t_typec_n = 0; // (atf_amc.FDb.cs_t_typec) + _db.cs_t_typec_tail = NULL; // (atf_amc.FDb.cs_t_typec) + // initialize LAry typea (atf_amc.FDb.typea) + _db.typea_n = 0; + memset(_db.typea_lary, 0, sizeof(_db.typea_lary)); // zero out all level pointers + atf_amc::FTypeA* typea_first = (atf_amc::FTypeA*)algo_lib::malloc_AllocMem(sizeof(atf_amc::FTypeA) * (u64(1)<<4)); + if (!typea_first) { + FatalErrorExit("out of memory"); + } + for (int i = 0; i < 4; i++) { + _db.typea_lary[i] = typea_first; + typea_first += 1ULL< atf_amc::typeg_Getary(atf_amc::FOptG& optg) { + u8 *end = (u8*)&optg + sizeof(atf_amc::FOptG); + return algo::aryptr(end, i32(optg.length) - ssizeof(atf_amc::FOptG)); +} + +// --- atf_amc.FPerfSortString.orig.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr atf_amc::orig_Addary(atf_amc::FPerfSortString& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.orig_elems && rhs.elems < parent.orig_elems + parent.orig_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_amc.tary_alias field:atf_amc.FPerfSortString.orig comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + orig_Reserve(parent, nnew); // reserve space + int at = parent.orig_n; + for (int i = 0; i < nnew; i++) { + new (parent.orig_elems + at + i) atf_amc::Cstr(rhs[i]); + parent.orig_n++; + } + return algo::aryptr(parent.orig_elems + at, nnew); +} + +// --- atf_amc.FPerfSortString.orig.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +atf_amc::Cstr& atf_amc::orig_Alloc(atf_amc::FPerfSortString& parent) { + orig_Reserve(parent, 1); + int n = parent.orig_n; + int at = n; + atf_amc::Cstr *elems = parent.orig_elems; + new (elems + at) atf_amc::Cstr(); // construct new element, default initializer + parent.orig_n = n+1; + return elems[at]; +} + +// --- atf_amc.FPerfSortString.orig.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +atf_amc::Cstr& atf_amc::orig_AllocAt(atf_amc::FPerfSortString& parent, int at) { + orig_Reserve(parent, 1); + int n = parent.orig_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("atf_amc.bad_alloc_at field:atf_amc.FPerfSortString.orig comment:'index out of range'"); + } + atf_amc::Cstr *elems = parent.orig_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(atf_amc::Cstr)); + new (elems + at) atf_amc::Cstr(); // construct element, default initializer + parent.orig_n = n+1; + return elems[at]; +} + +// --- atf_amc.FPerfSortString.orig.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr atf_amc::orig_AllocN(atf_amc::FPerfSortString& parent, int n_elems) { + orig_Reserve(parent, n_elems); + int old_n = parent.orig_n; + int new_n = old_n + n_elems; + atf_amc::Cstr *elems = parent.orig_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) atf_amc::Cstr(); // construct new element, default initialize + } + parent.orig_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- atf_amc.FPerfSortString.orig.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr atf_amc::orig_AllocNAt(atf_amc::FPerfSortString& parent, int n_elems, int at) { + orig_Reserve(parent, n_elems); + int n = parent.orig_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("atf_amc.bad_alloc_n_at field:atf_amc.FPerfSortString.orig comment:'index out of range'"); + } + atf_amc::Cstr *elems = parent.orig_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(atf_amc::Cstr)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) atf_amc::Cstr(); // construct new element, default initialize + } + parent.orig_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- atf_amc.FPerfSortString.orig.Remove +// Remove item by index. If index outside of range, do nothing. +void atf_amc::orig_Remove(atf_amc::FPerfSortString& parent, u32 i) { + u32 lim = parent.orig_n; + atf_amc::Cstr *elems = parent.orig_elems; + if (i < lim) { + elems[i].~Cstr(); // destroy element + memmove(elems + i, elems + (i + 1), sizeof(atf_amc::Cstr) * (lim - (i + 1))); + parent.orig_n = lim - 1; + } +} + +// --- atf_amc.FPerfSortString.orig.RemoveAll +void atf_amc::orig_RemoveAll(atf_amc::FPerfSortString& parent) { + u32 n = parent.orig_n; + while (n > 0) { + n -= 1; + parent.orig_elems[n].~Cstr(); + parent.orig_n = n; + } +} + +// --- atf_amc.FPerfSortString.orig.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void atf_amc::orig_RemoveLast(atf_amc::FPerfSortString& parent) { + u64 n = parent.orig_n; + if (n > 0) { + n -= 1; + orig_qFind(parent, u64(n)).~Cstr(); + parent.orig_n = n; + } +} + +// --- atf_amc.FPerfSortString.orig.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void atf_amc::orig_AbsReserve(atf_amc::FPerfSortString& parent, int n) { + u32 old_max = parent.orig_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.orig_elems, old_max * sizeof(atf_amc::Cstr), new_max * sizeof(atf_amc::Cstr)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.tary_nomem field:atf_amc.FPerfSortString.orig comment:'out of memory'"); + } + parent.orig_elems = (atf_amc::Cstr*)new_mem; + parent.orig_max = new_max; + } +} + +// --- atf_amc.FPerfSortString.orig.Setary +// Copy contents of RHS to PARENT. +void atf_amc::orig_Setary(atf_amc::FPerfSortString& parent, atf_amc::FPerfSortString &rhs) { + orig_RemoveAll(parent); + int nnew = rhs.orig_n; + orig_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.orig_elems + i) atf_amc::Cstr(orig_qFind(rhs, i)); + parent.orig_n = i + 1; + } +} + +// --- atf_amc.FPerfSortString.orig.Setary2 +// Copy specified array into orig, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void atf_amc::orig_Setary(atf_amc::FPerfSortString& parent, const algo::aryptr &rhs) { + orig_RemoveAll(parent); + orig_Addary(parent, rhs); +} + +// --- atf_amc.FPerfSortString.orig.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr atf_amc::orig_AllocNVal(atf_amc::FPerfSortString& parent, int n_elems, const atf_amc::Cstr& val) { + orig_Reserve(parent, n_elems); + int old_n = parent.orig_n; + int new_n = old_n + n_elems; + atf_amc::Cstr *elems = parent.orig_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) atf_amc::Cstr(val); + } + parent.orig_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- atf_amc.FPerfSortString.orig.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void atf_amc::orig_Insary(atf_amc::FPerfSortString& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.orig_elems && rhs.elems < parent.orig_elems + parent.orig_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_amc.tary_alias field:atf_amc.FPerfSortString.orig comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.orig_elems+1))) { + FatalErrorExit("atf_amc.bad_insary field:atf_amc.FPerfSortString.orig comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.orig_n - at; + orig_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.orig_elems + at + nnew + i) atf_amc::Cstr(parent.orig_elems[at + i]); + parent.orig_elems[at + i].~Cstr(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.orig_elems + at + i) atf_amc::Cstr(rhs[i]); + } + parent.orig_n += nnew; +} + +// --- atf_amc.FPerfSortString.sorted1.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr atf_amc::sorted1_Addary(atf_amc::FPerfSortString& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.sorted1_elems && rhs.elems < parent.sorted1_elems + parent.sorted1_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_amc.tary_alias field:atf_amc.FPerfSortString.sorted1 comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + sorted1_Reserve(parent, nnew); // reserve space + int at = parent.sorted1_n; + for (int i = 0; i < nnew; i++) { + new (parent.sorted1_elems + at + i) atf_amc::Cstr(rhs[i]); + parent.sorted1_n++; + } + return algo::aryptr(parent.sorted1_elems + at, nnew); +} + +// --- atf_amc.FPerfSortString.sorted1.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +atf_amc::Cstr& atf_amc::sorted1_Alloc(atf_amc::FPerfSortString& parent) { + sorted1_Reserve(parent, 1); + int n = parent.sorted1_n; + int at = n; + atf_amc::Cstr *elems = parent.sorted1_elems; + new (elems + at) atf_amc::Cstr(); // construct new element, default initializer + parent.sorted1_n = n+1; + return elems[at]; +} + +// --- atf_amc.FPerfSortString.sorted1.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +atf_amc::Cstr& atf_amc::sorted1_AllocAt(atf_amc::FPerfSortString& parent, int at) { + sorted1_Reserve(parent, 1); + int n = parent.sorted1_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("atf_amc.bad_alloc_at field:atf_amc.FPerfSortString.sorted1 comment:'index out of range'"); + } + atf_amc::Cstr *elems = parent.sorted1_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(atf_amc::Cstr)); + new (elems + at) atf_amc::Cstr(); // construct element, default initializer + parent.sorted1_n = n+1; + return elems[at]; +} + +// --- atf_amc.FPerfSortString.sorted1.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr atf_amc::sorted1_AllocN(atf_amc::FPerfSortString& parent, int n_elems) { + sorted1_Reserve(parent, n_elems); + int old_n = parent.sorted1_n; + int new_n = old_n + n_elems; + atf_amc::Cstr *elems = parent.sorted1_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) atf_amc::Cstr(); // construct new element, default initialize + } + parent.sorted1_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- atf_amc.FPerfSortString.sorted1.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr atf_amc::sorted1_AllocNAt(atf_amc::FPerfSortString& parent, int n_elems, int at) { + sorted1_Reserve(parent, n_elems); + int n = parent.sorted1_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("atf_amc.bad_alloc_n_at field:atf_amc.FPerfSortString.sorted1 comment:'index out of range'"); + } + atf_amc::Cstr *elems = parent.sorted1_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(atf_amc::Cstr)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) atf_amc::Cstr(); // construct new element, default initialize + } + parent.sorted1_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- atf_amc.FPerfSortString.sorted1.Remove +// Remove item by index. If index outside of range, do nothing. +void atf_amc::sorted1_Remove(atf_amc::FPerfSortString& parent, u32 i) { + u32 lim = parent.sorted1_n; + atf_amc::Cstr *elems = parent.sorted1_elems; + if (i < lim) { + elems[i].~Cstr(); // destroy element + memmove(elems + i, elems + (i + 1), sizeof(atf_amc::Cstr) * (lim - (i + 1))); + parent.sorted1_n = lim - 1; + } +} + +// --- atf_amc.FPerfSortString.sorted1.RemoveAll +void atf_amc::sorted1_RemoveAll(atf_amc::FPerfSortString& parent) { + u32 n = parent.sorted1_n; + while (n > 0) { + n -= 1; + parent.sorted1_elems[n].~Cstr(); + parent.sorted1_n = n; + } +} + +// --- atf_amc.FPerfSortString.sorted1.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void atf_amc::sorted1_RemoveLast(atf_amc::FPerfSortString& parent) { + u64 n = parent.sorted1_n; + if (n > 0) { + n -= 1; + sorted1_qFind(parent, u64(n)).~Cstr(); + parent.sorted1_n = n; + } +} + +// --- atf_amc.FPerfSortString.sorted1.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void atf_amc::sorted1_AbsReserve(atf_amc::FPerfSortString& parent, int n) { + u32 old_max = parent.sorted1_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.sorted1_elems, old_max * sizeof(atf_amc::Cstr), new_max * sizeof(atf_amc::Cstr)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.tary_nomem field:atf_amc.FPerfSortString.sorted1 comment:'out of memory'"); + } + parent.sorted1_elems = (atf_amc::Cstr*)new_mem; + parent.sorted1_max = new_max; + } +} + +// --- atf_amc.FPerfSortString.sorted1.Setary +// Copy contents of RHS to PARENT. +void atf_amc::sorted1_Setary(atf_amc::FPerfSortString& parent, atf_amc::FPerfSortString &rhs) { + sorted1_RemoveAll(parent); + int nnew = rhs.sorted1_n; + sorted1_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.sorted1_elems + i) atf_amc::Cstr(sorted1_qFind(rhs, i)); + parent.sorted1_n = i + 1; + } +} + +// --- atf_amc.FPerfSortString.sorted1.Setary2 +// Copy specified array into sorted1, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void atf_amc::sorted1_Setary(atf_amc::FPerfSortString& parent, const algo::aryptr &rhs) { + sorted1_RemoveAll(parent); + sorted1_Addary(parent, rhs); +} + +// --- atf_amc.FPerfSortString.sorted1.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr atf_amc::sorted1_AllocNVal(atf_amc::FPerfSortString& parent, int n_elems, const atf_amc::Cstr& val) { + sorted1_Reserve(parent, n_elems); + int old_n = parent.sorted1_n; + int new_n = old_n + n_elems; + atf_amc::Cstr *elems = parent.sorted1_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) atf_amc::Cstr(val); + } + parent.sorted1_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- atf_amc.FPerfSortString.sorted1.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void atf_amc::sorted1_Insary(atf_amc::FPerfSortString& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.sorted1_elems && rhs.elems < parent.sorted1_elems + parent.sorted1_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_amc.tary_alias field:atf_amc.FPerfSortString.sorted1 comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.sorted1_elems+1))) { + FatalErrorExit("atf_amc.bad_insary field:atf_amc.FPerfSortString.sorted1 comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.sorted1_n - at; + sorted1_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.sorted1_elems + at + nnew + i) atf_amc::Cstr(parent.sorted1_elems[at + i]); + parent.sorted1_elems[at + i].~Cstr(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.sorted1_elems + at + i) atf_amc::Cstr(rhs[i]); + } + parent.sorted1_n += nnew; +} + +// --- atf_amc.FPerfSortString.sorted1.Swap +// Swap values elem_a and elem_b +inline static void atf_amc::sorted1_Swap(atf_amc::Cstr &elem_a, atf_amc::Cstr &elem_b) { + u8 temp[sizeof(atf_amc::Cstr)]; + memcpy(&temp , &elem_a, sizeof(atf_amc::Cstr)); + memcpy(&elem_a, &elem_b, sizeof(atf_amc::Cstr)); + memcpy(&elem_b, &temp , sizeof(atf_amc::Cstr)); +} + +// --- atf_amc.FPerfSortString.sorted1.Rotleft +// Left circular shift of three-tuple +inline static void atf_amc::sorted1_Rotleft(atf_amc::Cstr &elem_a, atf_amc::Cstr &elem_b, atf_amc::Cstr &elem_c) { + u8 temp[sizeof(atf_amc::Cstr)]; + memcpy(&temp, &elem_a , sizeof(atf_amc::Cstr)); + memcpy(&elem_a , &elem_b , sizeof(atf_amc::Cstr)); + memcpy(&elem_b , &elem_c , sizeof(atf_amc::Cstr)); + memcpy(&elem_c , &temp, sizeof(atf_amc::Cstr)); +} + +// --- atf_amc.FPerfSortString.sorted1.Lt +// Compare values elem_a and elem_b +// The comparison function must be anti-symmetric: if a>b, then !(b>a). +// If not, mayhem results. +static bool atf_amc::sorted1_Lt(atf_amc::Cstr &elem_a, atf_amc::Cstr &elem_b) { + bool ret; + ret = val_Lt(elem_a, elem_b); + return ret; +} + +// --- atf_amc.FPerfSortString.sorted1.SortedQ +// Verify whether array is sorted +bool atf_amc::sorted1_SortedQ(atf_amc::FPerfSortString& parent) { + atf_amc::Cstr *elems = sorted1_Getary(parent).elems; + int n = sorted1_N(parent); + for (int i = 1; i < n; i++) { + if (sorted1_Lt(elems[i], elems[i-1])) { + return false; + } + } + return true; +} + +// --- atf_amc.FPerfSortString.sorted1.IntInsertionSort +// Internal insertion sort +static void atf_amc::sorted1_IntInsertionSort(atf_amc::Cstr *elems, int n) { + for (int i = 1; i < n; ++i) { int j = i; // find the spot for ith element. while (j>0 && sorted1_Lt(elems[i], elems[j-1])) { @@ -8476,6 +10023,12 @@ void atf_amc::FThashElem_Uninit(atf_amc::FThashElem& thash_elem) { ind_thash_elem_Remove(row); // remove thash_elem from index ind_thash_elem } +// --- atf_amc.FTimeEntry..Uninit +void atf_amc::FTimeEntry_Uninit(atf_amc::FTimeEntry& time_entry) { + atf_amc::FTimeEntry &row = time_entry; (void)row; + bh_time_entry_Remove(row); // remove time_entry from index bh_time_entry +} + // --- atf_amc.FTypeC.msghdr.CopyOut // Copy fields out of row void atf_amc::typec_CopyOut(atf_amc::FTypeC &row, atf_amc::TypeC &out) { @@ -8599,12 +10152,12 @@ void atf_amc::zdl_typeb_Cascdel(atf_amc::FTypeA& typea) { // --- atf_amc.FTypeA.zdl_typeb.Insert // Insert row into linked list. If row is already in linked list, do nothing. void atf_amc::zdl_typeb_Insert(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) { - if (!zdl_typeb_InLlistQ(row)) { + if (!typea_zdl_typeb_InLlistQ(row)) { atf_amc::FTypeB* old_head = typea.zdl_typeb_head; - row.zdl_typeb_prev = NULL; - row.zdl_typeb_next = old_head; + row.typea_zdl_typeb_prev = NULL; + row.typea_zdl_typeb_next = old_head; typea.zdl_typeb_head = &row; - atf_amc::FTypeB **new_row_a = &old_head->zdl_typeb_prev; + atf_amc::FTypeB **new_row_a = &old_head->typea_zdl_typeb_prev; atf_amc::FTypeB **new_row_b = &typea.zdl_typeb_tail; atf_amc::FTypeB **new_row = old_head ? new_row_a : new_row_b; *new_row = &row; @@ -8615,23 +10168,23 @@ void atf_amc::zdl_typeb_Insert(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) { // --- atf_amc.FTypeA.zdl_typeb.Remove // Remove element from index. If element is not in index, do nothing. void atf_amc::zdl_typeb_Remove(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) { - if (zdl_typeb_InLlistQ(row)) { + if (typea_zdl_typeb_InLlistQ(row)) { atf_amc::FTypeB* old_head = typea.zdl_typeb_head; (void)old_head; // in case it's not used - atf_amc::FTypeB* prev = row.zdl_typeb_prev; - atf_amc::FTypeB* next = row.zdl_typeb_next; + atf_amc::FTypeB* prev = row.typea_zdl_typeb_prev; + atf_amc::FTypeB* next = row.typea_zdl_typeb_next; // if element is first, adjust list head; otherwise, adjust previous element's next - atf_amc::FTypeB **new_next_a = &prev->zdl_typeb_next; + atf_amc::FTypeB **new_next_a = &prev->typea_zdl_typeb_next; atf_amc::FTypeB **new_next_b = &typea.zdl_typeb_head; atf_amc::FTypeB **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - atf_amc::FTypeB **new_prev_a = &next->zdl_typeb_prev; + atf_amc::FTypeB **new_prev_a = &next->typea_zdl_typeb_prev; atf_amc::FTypeB **new_prev_b = &typea.zdl_typeb_tail; atf_amc::FTypeB **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; typea.zdl_typeb_n--; - row.zdl_typeb_next=(atf_amc::FTypeB*)-1; // not-in-list + row.typea_zdl_typeb_next=(atf_amc::FTypeB*)-1; // not-in-list } } @@ -8643,9 +10196,9 @@ void atf_amc::zdl_typeb_RemoveAll(atf_amc::FTypeA& typea) { typea.zdl_typeb_tail = NULL; typea.zdl_typeb_n = 0; while (row) { - atf_amc::FTypeB* row_next = row->zdl_typeb_next; - row->zdl_typeb_next = (atf_amc::FTypeB*)-1; - row->zdl_typeb_prev = NULL; + atf_amc::FTypeB* row_next = row->typea_zdl_typeb_next; + row->typea_zdl_typeb_next = (atf_amc::FTypeB*)-1; + row->typea_zdl_typeb_prev = NULL; row = row_next; } } @@ -8656,14 +10209,14 @@ atf_amc::FTypeB* atf_amc::zdl_typeb_RemoveFirst(atf_amc::FTypeA& typea) { atf_amc::FTypeB *row = NULL; row = typea.zdl_typeb_head; if (row) { - atf_amc::FTypeB *next = row->zdl_typeb_next; + atf_amc::FTypeB *next = row->typea_zdl_typeb_next; typea.zdl_typeb_head = next; - atf_amc::FTypeB **new_end_a = &next->zdl_typeb_prev; + atf_amc::FTypeB **new_end_a = &next->typea_zdl_typeb_prev; atf_amc::FTypeB **new_end_b = &typea.zdl_typeb_tail; atf_amc::FTypeB **new_end = next ? new_end_a : new_end_b; *new_end = NULL; typea.zdl_typeb_n--; - row->zdl_typeb_next = (atf_amc::FTypeB*)-1; // mark as not-in-list + row->typea_zdl_typeb_next = (atf_amc::FTypeB*)-1; // mark as not-in-list } return row; } @@ -8676,7 +10229,7 @@ void atf_amc::bh_typeb_Cascdel(atf_amc::FTypeA& typea) { while (n > 0) { n--; atf_amc::FTypeB &elem = *typea.bh_typeb_elems[n]; // pick cheapest element to remove - elem.bh_typeb_idx = -1; // mark not-in-heap + elem.typea_bh_typeb_idx = -1; // mark not-in-heap typea.bh_typeb_n = n; typeb_Delete(elem); } @@ -8711,7 +10264,7 @@ static int atf_amc::bh_typeb_Downheap(atf_amc::FTypeA& typea, atf_amc::FTypeB& r if (!bh_typeb_ElemLt(typea, *p,row)) { break; } - p->bh_typeb_idx = idx; + p->typea_bh_typeb_idx = idx; elems[idx] = p; idx = child; child = idx*2+1; @@ -8722,12 +10275,12 @@ static int atf_amc::bh_typeb_Downheap(atf_amc::FTypeA& typea, atf_amc::FTypeB& r // --- atf_amc.FTypeA.bh_typeb.Insert // Insert row. Row must not already be in index. If row is already in index, do nothing. void atf_amc::bh_typeb_Insert(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) { - if (LIKELY(row.bh_typeb_idx == -1)) { + if (LIKELY(row.typea_bh_typeb_idx == -1)) { bh_typeb_Reserve(typea, 1); int n = typea.bh_typeb_n; typea.bh_typeb_n = n + 1; int new_idx = bh_typeb_Upheap(typea, row, n); - row.bh_typeb_idx = new_idx; + row.typea_bh_typeb_idx = new_idx; typea.bh_typeb_elems[new_idx] = &row; } } @@ -8736,7 +10289,7 @@ void atf_amc::bh_typeb_Insert(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) { // If row is in heap, update its position. If row is not in heap, insert it. // Return new position of item in the heap (0=top) i32 atf_amc::bh_typeb_Reheap(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) { - int old_idx = row.bh_typeb_idx; + int old_idx = row.typea_bh_typeb_idx; bool isnew = old_idx == -1; if (isnew) { bh_typeb_Reserve(typea, 1); @@ -8746,7 +10299,7 @@ i32 atf_amc::bh_typeb_Reheap(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) { if (!isnew && new_idx == old_idx) { new_idx = bh_typeb_Downheap(typea, row, old_idx); } - row.bh_typeb_idx = new_idx; + row.typea_bh_typeb_idx = new_idx; typea.bh_typeb_elems[new_idx] = &row; return new_idx; } @@ -8759,7 +10312,7 @@ i32 atf_amc::bh_typeb_Reheap(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) { i32 atf_amc::bh_typeb_ReheapFirst(atf_amc::FTypeA& typea) { atf_amc::FTypeB &row = *typea.bh_typeb_elems[0]; i32 new_idx = bh_typeb_Downheap(typea, row, 0); - row.bh_typeb_idx = new_idx; + row.typea_bh_typeb_idx = new_idx; typea.bh_typeb_elems[new_idx] = &row; return new_idx; } @@ -8768,9 +10321,9 @@ i32 atf_amc::bh_typeb_ReheapFirst(atf_amc::FTypeA& typea) { // Remove element from index. If element is not in index, do nothing. void atf_amc::bh_typeb_Remove(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) { if (bh_typeb_InBheapQ(row)) { - int old_idx = row.bh_typeb_idx; + int old_idx = row.typea_bh_typeb_idx; if (typea.bh_typeb_elems[old_idx] == &row) { // sanity check: heap points back to row - row.bh_typeb_idx = -1; // mark not in heap + row.typea_bh_typeb_idx = -1; // mark not in heap i32 n = typea.bh_typeb_n - 1; // index of last element in heap typea.bh_typeb_n = n; // decrease count if (old_idx != n) { @@ -8779,7 +10332,7 @@ void atf_amc::bh_typeb_Remove(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) { if (new_idx == old_idx) { new_idx = bh_typeb_Downheap(typea, *elem, old_idx); } - elem->bh_typeb_idx = new_idx; + elem->typea_bh_typeb_idx = new_idx; typea.bh_typeb_elems[new_idx] = elem; } } @@ -8791,7 +10344,7 @@ void atf_amc::bh_typeb_Remove(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) { void atf_amc::bh_typeb_RemoveAll(atf_amc::FTypeA& typea) { int n = typea.bh_typeb_n; for (int i = n - 1; i>=0; i--) { - typea.bh_typeb_elems[i]->bh_typeb_idx = -1; // mark not-in-heap + typea.bh_typeb_elems[i]->typea_bh_typeb_idx = -1; // mark not-in-heap } typea.bh_typeb_n = 0; } @@ -8803,13 +10356,13 @@ atf_amc::FTypeB* atf_amc::bh_typeb_RemoveFirst(atf_amc::FTypeA& typea) { atf_amc::FTypeB *row = NULL; if (typea.bh_typeb_n > 0) { row = typea.bh_typeb_elems[0]; - row->bh_typeb_idx = -1; // mark not in heap + row->typea_bh_typeb_idx = -1; // mark not in heap i32 n = typea.bh_typeb_n - 1; // index of last element in heap typea.bh_typeb_n = n; // decrease count if (n) { atf_amc::FTypeB &elem = *typea.bh_typeb_elems[n]; int new_idx = bh_typeb_Downheap(typea, elem, 0); - elem.bh_typeb_idx = new_idx; + elem.typea_bh_typeb_idx = new_idx; typea.bh_typeb_elems[new_idx] = &elem; } } @@ -8844,7 +10397,7 @@ static int atf_amc::bh_typeb_Upheap(atf_amc::FTypeA& typea, atf_amc::FTypeB& row if (!bh_typeb_ElemLt(typea, row, *p)) { break; } - p->bh_typeb_idx = idx; + p->typea_bh_typeb_idx = idx; elems[idx] = p; idx = j; } @@ -8870,6 +10423,7 @@ void atf_amc::FTypeA_Init(atf_amc::FTypeA& typea) { typea.bh_typeb_n = 0; // (atf_amc.FTypeA.bh_typeb) typea.bh_typeb_elems = NULL; // (atf_amc.FTypeA.bh_typeb) typea.ind_typea_next = (atf_amc::FTypeA*)-1; // (atf_amc.FDb.ind_typea) not-in-hash + typea.ind_typea_hashval = 0; // stored hash value } // --- atf_amc.FTypeA.bh_typeb_curs.Add @@ -8947,7 +10501,7 @@ void atf_amc::typea_bh_typeb_curs_Next(typea_bh_typeb_curs &curs) { i = l; } while (i < n); curs.temp_n = n-1; - int index = dead->bh_typeb_idx; + int index = dead->typea_bh_typeb_idx; i = (index*2+1); if (i < bh_typeb_N((*curs.parent))) { atf_amc::FTypeB &elem = *curs.parent->bh_typeb_elems[i]; @@ -9080,12 +10634,12 @@ void atf_amc::types_CopyIn(atf_amc::FTypeS &row, atf_amc::TypeS &in) { // --- atf_amc.FTypeS.zdl_typet.Insert // Insert row into linked list. If row is already in linked list, do nothing. void atf_amc::zdl_typet_Insert(atf_amc::FTypeS& types, atf_amc::FTypeT& row) { - if (!zdl_typet_InLlistQ(row)) { + if (!types_zdl_typet_InLlistQ(row)) { atf_amc::FTypeT* old_head = types.zdl_typet_head; - row.zdl_typet_prev = NULL; - row.zdl_typet_next = old_head; + row.types_zdl_typet_prev = NULL; + row.types_zdl_typet_next = old_head; types.zdl_typet_head = &row; - atf_amc::FTypeT **new_row_a = &old_head->zdl_typet_prev; + atf_amc::FTypeT **new_row_a = &old_head->types_zdl_typet_prev; atf_amc::FTypeT **new_row_b = &types.zdl_typet_tail; atf_amc::FTypeT **new_row = old_head ? new_row_a : new_row_b; *new_row = &row; @@ -9096,23 +10650,23 @@ void atf_amc::zdl_typet_Insert(atf_amc::FTypeS& types, atf_amc::FTypeT& row) { // --- atf_amc.FTypeS.zdl_typet.Remove // Remove element from index. If element is not in index, do nothing. void atf_amc::zdl_typet_Remove(atf_amc::FTypeS& types, atf_amc::FTypeT& row) { - if (zdl_typet_InLlistQ(row)) { + if (types_zdl_typet_InLlistQ(row)) { atf_amc::FTypeT* old_head = types.zdl_typet_head; (void)old_head; // in case it's not used - atf_amc::FTypeT* prev = row.zdl_typet_prev; - atf_amc::FTypeT* next = row.zdl_typet_next; + atf_amc::FTypeT* prev = row.types_zdl_typet_prev; + atf_amc::FTypeT* next = row.types_zdl_typet_next; // if element is first, adjust list head; otherwise, adjust previous element's next - atf_amc::FTypeT **new_next_a = &prev->zdl_typet_next; + atf_amc::FTypeT **new_next_a = &prev->types_zdl_typet_next; atf_amc::FTypeT **new_next_b = &types.zdl_typet_head; atf_amc::FTypeT **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - atf_amc::FTypeT **new_prev_a = &next->zdl_typet_prev; + atf_amc::FTypeT **new_prev_a = &next->types_zdl_typet_prev; atf_amc::FTypeT **new_prev_b = &types.zdl_typet_tail; atf_amc::FTypeT **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; types.zdl_typet_n--; - row.zdl_typet_next=(atf_amc::FTypeT*)-1; // not-in-list + row.types_zdl_typet_next=(atf_amc::FTypeT*)-1; // not-in-list } } @@ -9124,9 +10678,9 @@ void atf_amc::zdl_typet_RemoveAll(atf_amc::FTypeS& types) { types.zdl_typet_tail = NULL; types.zdl_typet_n = 0; while (row) { - atf_amc::FTypeT* row_next = row->zdl_typet_next; - row->zdl_typet_next = (atf_amc::FTypeT*)-1; - row->zdl_typet_prev = NULL; + atf_amc::FTypeT* row_next = row->types_zdl_typet_next; + row->types_zdl_typet_next = (atf_amc::FTypeT*)-1; + row->types_zdl_typet_prev = NULL; row = row_next; } } @@ -9137,14 +10691,14 @@ atf_amc::FTypeT* atf_amc::zdl_typet_RemoveFirst(atf_amc::FTypeS& types) { atf_amc::FTypeT *row = NULL; row = types.zdl_typet_head; if (row) { - atf_amc::FTypeT *next = row->zdl_typet_next; + atf_amc::FTypeT *next = row->types_zdl_typet_next; types.zdl_typet_head = next; - atf_amc::FTypeT **new_end_a = &next->zdl_typet_prev; + atf_amc::FTypeT **new_end_a = &next->types_zdl_typet_prev; atf_amc::FTypeT **new_end_b = &types.zdl_typet_tail; atf_amc::FTypeT **new_end = next ? new_end_a : new_end_b; *new_end = NULL; types.zdl_typet_n--; - row->zdl_typet_next = (atf_amc::FTypeT*)-1; // mark as not-in-list + row->types_zdl_typet_next = (atf_amc::FTypeT*)-1; // mark as not-in-list } return row; } @@ -9291,6 +10845,25 @@ algo::aryptr atf_amc::tary_AllocN(atf_amc::FUnitSort& parent, in return algo::aryptr(elems + old_n, n_elems); } +// --- atf_amc.FUnitSort.tary.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr atf_amc::tary_AllocNAt(atf_amc::FUnitSort& parent, int n_elems, int at) { + tary_Reserve(parent, n_elems); + int n = parent.tary_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("atf_amc.bad_alloc_n_at field:atf_amc.FUnitSort.tary comment:'index out of range'"); + } + atf_amc::TypeA *elems = parent.tary_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(atf_amc::TypeA)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) atf_amc::TypeA(); // construct new element, default initialize + } + parent.tary_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- atf_amc.FUnitSort.tary.Remove // Remove item by index. If index outside of range, do nothing. void atf_amc::tary_Remove(atf_amc::FUnitSort& parent, u32 i) { @@ -9387,6 +10960,30 @@ bool atf_amc::tary_ReadStrptrMaybe(atf_amc::FUnitSort& parent, algo::strptr in_s return retval; } +// --- atf_amc.FUnitSort.tary.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void atf_amc::tary_Insary(atf_amc::FUnitSort& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.tary_elems && rhs.elems < parent.tary_elems + parent.tary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_amc.tary_alias field:atf_amc.FUnitSort.tary comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.tary_elems+1))) { + FatalErrorExit("atf_amc.bad_insary field:atf_amc.FUnitSort.tary comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.tary_n - at; + tary_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.tary_elems + at + nnew + i) atf_amc::TypeA(parent.tary_elems[at + i]); + parent.tary_elems[at + i].~TypeA(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.tary_elems + at + i) atf_amc::TypeA(rhs[i]); + } + parent.tary_n += nnew; +} + // --- atf_amc.FUnitSort.tary.Swap // Swap values elem_a and elem_b inline static void atf_amc::tary_Swap(atf_amc::TypeA &elem_a, atf_amc::TypeA &elem_b) { @@ -9560,14 +11157,9 @@ void atf_amc::tary_QuickSort(atf_amc::FUnitSort& parent) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void atf_amc::c_ptrary_Insert(atf_amc::FUnitSort& parent, atf_amc::TypeA& row) { - // reserve space c_ptrary_Reserve(parent, 1); - u32 n = parent.c_ptrary_n; - u32 at = n; - atf_amc::TypeA* *elems = parent.c_ptrary_elems; - elems[at] = &row; - parent.c_ptrary_n = n+1; - + u32 n = parent.c_ptrary_n++; + parent.c_ptrary_elems[n] = &row; } // --- atf_amc.FUnitSort.c_ptrary.ScanInsertMaybe @@ -9596,20 +11188,18 @@ bool atf_amc::c_ptrary_ScanInsertMaybe(atf_amc::FUnitSort& parent, atf_amc::Type // --- atf_amc.FUnitSort.c_ptrary.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void atf_amc::c_ptrary_Remove(atf_amc::FUnitSort& parent, atf_amc::TypeA& row) { - int lim = parent.c_ptrary_n; - atf_amc::TypeA* *elems = parent.c_ptrary_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - atf_amc::TypeA* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(atf_amc::TypeA*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - parent.c_ptrary_n = lim - 1; - break; + int n = parent.c_ptrary_n; + int j=0; + for (int i=0; i atf_amc::in_GetMsg(atf_amc::Linebuf& linebuf) { return ret; } +// --- atf_amc.Linebuf.in.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void atf_amc::in_Realloc(atf_amc::Linebuf& linebuf, int new_max) { + new_max = i32_Max(new_max, linebuf.in_end); + u8 *new_mem = linebuf.in_elems + ? (u8*)algo_lib::malloc_ReallocMem(linebuf.in_elems, linebuf.in_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.fbuf_nomem field:atf_amc.Linebuf.in comment:'out of memory'"); + } + linebuf.in_elems = new_mem; + linebuf.in_max = new_max; +} + // --- atf_amc.Linebuf.in.RemoveAll // Empty bfufer // Discard contents of the buffer. @@ -10969,7 +12631,7 @@ void atf_amc::in_SkipMsg(atf_amc::Linebuf& linebuf) { } // --- atf_amc.Linebuf.in.WriteAll -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. @@ -10983,22 +12645,51 @@ bool atf_amc::in_WriteAll(atf_amc::Linebuf& linebuf, u8 *in, i32 in_n) { // now try to write the message. i32 end = linebuf.in_end; bool fits = end + in_n <= max; - if (fits && in_n > 0) { - memcpy(linebuf.in_elems + end, in, in_n); - linebuf.in_end = end + in_n; + if (fits) { + if (in_n > 0) { + memcpy(linebuf.in_elems + end, in, in_n); + linebuf.in_end = end + in_n; + } } return fits; } +// --- atf_amc.Linebuf.in.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void atf_amc::in_WriteReserve(atf_amc::Linebuf& linebuf, u8 *in, i32 in_n) { + if (!in_WriteAll(linebuf, in, in_n)) { + in_Realloc(linebuf, linebuf.in_max*2); + if (!in_WriteAll(linebuf, in, in_n)) { + FatalErrorExit("in: out of memory"); + } + } +} + // --- atf_amc.Linebuf..Init // Set all fields to initial values. void atf_amc::Linebuf_Init(atf_amc::Linebuf& linebuf) { + linebuf.in_elems = NULL; // in: initialize + linebuf.in_max = 0; // in: initialize linebuf.in_end = 0; // in: initialize linebuf.in_start = 0; // in: initialize linebuf.in_eof = false; // in: initialize linebuf.in_msgvalid = false; // in: initialize linebuf.in_msglen = 0; // in: initialize linebuf.in_epoll_enable = true; // in: initialize + in_Realloc(linebuf, 64); +} + +// --- atf_amc.Linebuf..Uninit +void atf_amc::Linebuf_Uninit(atf_amc::Linebuf& linebuf) { + atf_amc::Linebuf &row = linebuf; (void)row; + + // atf_amc.Linebuf.in.Uninit (Fbuf) //Delimited buffer + if (linebuf.in_elems) { + algo_lib::malloc_FreeMem(linebuf.in_elems, sizeof(char)*linebuf.in_max); // (atf_amc.Linebuf.in) + } + linebuf.in_elems = NULL; + linebuf.in_max = 0; } // --- atf_amc.Linebuf..Print @@ -11084,13 +12775,14 @@ bool atf_amc::MsgHdrLT_ReadFieldMaybe(atf_amc::MsgHdrLT& parent, algo::strptr fi switch(field_id) { case atf_amc_FieldId_len: { retval = false; - break; - } + } break; case atf_amc_FieldId_type: { retval = type_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -11203,6 +12895,10 @@ const char* atf_amc::value_ToCstr(const atf_amc::MsgType& parent) { switch(value_GetEnum(parent)) { case atf_amc_MsgType_atf_amc_Seqmsg: ret = "atf_amc.Seqmsg"; break; case atf_amc_MsgType_atf_amc_Text : ret = "atf_amc.Text"; break; + case atf_amc_MsgType_atf_amc_Varlen2Msg: ret = "atf_amc.Varlen2Msg"; break; + case atf_amc_MsgType_atf_amc_Varlen2aMsg: ret = "atf_amc.Varlen2aMsg"; break; + case atf_amc_MsgType_atf_amc_Varlen2mMsg: ret = "atf_amc.Varlen2mMsg"; break; + case atf_amc_MsgType_atf_amc_Varlen2vMsg: ret = "atf_amc.Varlen2vMsg"; break; case atf_amc_MsgType_atf_amc_VarlenMsg: ret = "atf_amc.VarlenMsg"; break; } return ret; @@ -11254,6 +12950,26 @@ bool atf_amc::value_SetStrptrMaybe(atf_amc::MsgType& parent, algo::strptr rhs) { } break; } + case 18: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','t','f','_','a','m','c','.'): { + if (memcmp(rhs.elems+8,"Varlen2Msg",10)==0) { value_SetEnum(parent,atf_amc_MsgType_atf_amc_Varlen2Msg); ret = true; break; } + break; + } + } + break; + } + case 19: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','t','f','_','a','m','c','.'): { + if (memcmp(rhs.elems+8,"Varlen2aMsg",11)==0) { value_SetEnum(parent,atf_amc_MsgType_atf_amc_Varlen2aMsg); ret = true; break; } + if (memcmp(rhs.elems+8,"Varlen2mMsg",11)==0) { value_SetEnum(parent,atf_amc_MsgType_atf_amc_Varlen2mMsg); ret = true; break; } + if (memcmp(rhs.elems+8,"Varlen2vMsg",11)==0) { value_SetEnum(parent,atf_amc_MsgType_atf_amc_Varlen2vMsg); ret = true; break; } + break; + } + } + break; + } } return ret; } @@ -11316,13 +13032,14 @@ bool atf_amc::MsgHeader_ReadFieldMaybe(atf_amc::MsgHeader& parent, algo::strptr switch(field_id) { case atf_amc_FieldId_type: { retval = false; - break; - } + } break; case atf_amc_FieldId_length: { retval = false; - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -11370,21 +13087,20 @@ bool atf_amc::MsgLTA_ReadFieldMaybe(atf_amc::MsgLTA& parent, algo::strptr field, switch(field_id) { case atf_amc_FieldId_base: { retval = false; - break; - } + } break; case atf_amc_FieldId_len: { retval = false; - break; - } + } break; case atf_amc_FieldId_type: { retval = false; - break; - } + } break; case atf_amc_FieldId_a: { retval = algo::RspaceStr4_ReadStrptrMaybe(parent.a, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -11432,21 +13148,20 @@ bool atf_amc::MsgLTB_ReadFieldMaybe(atf_amc::MsgLTB& parent, algo::strptr field, switch(field_id) { case atf_amc_FieldId_base: { retval = false; - break; - } + } break; case atf_amc_FieldId_len: { retval = false; - break; - } + } break; case atf_amc_FieldId_type: { retval = false; - break; - } + } break; case atf_amc_FieldId_b: { retval = algo::RspaceStr6_ReadStrptrMaybe(parent.b, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -11532,21 +13247,20 @@ bool atf_amc::MsgLTO_ReadFieldMaybe(atf_amc::MsgLTO& parent, algo::strptr field, switch(field_id) { case atf_amc_FieldId_base: { retval = false; - break; - } + } break; case atf_amc_FieldId_len: { retval = false; - break; - } + } break; case atf_amc_FieldId_type: { retval = false; - break; - } + } break; case atf_amc_FieldId_o: { retval = o_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -11620,22 +13334,21 @@ bool atf_amc::MsgLTV_ReadFieldMaybe(atf_amc::MsgLTV& parent, algo::strptr field, (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { case atf_amc_FieldId_base: { - retval = false; - break; - } + retval = false; + } break; case atf_amc_FieldId_len: { retval = false; - break; - } + } break; case atf_amc_FieldId_type: { retval = false; - break; - } + } break; case atf_amc_FieldId_v: { retval = v_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -11678,8 +13391,8 @@ void atf_amc::MsgLTV_Print(atf_amc::MsgLTV& row, algo::cstring& str) { // File descriptor becomes owned by atf_amc::Msgbuf.in_buf via FIohook field. // Whenever the file descriptor becomes readable, insert msgbuf into cd_in_msg. void atf_amc::in_buf_BeginRead(atf_amc::Msgbuf& msgbuf, algo::Fildes fd) { - callback_Set1(msgbuf.in_buf_iohook, msgbuf, atf_amc::cd_in_msg_Insert); msgbuf.in_buf_iohook.fildes = fd; + callback_Set1(msgbuf.in_buf_iohook, msgbuf, atf_amc::cd_in_msg_Insert); IOEvtFlags flags; read_Set(flags, true); if (msgbuf.in_buf_epoll_enable) { @@ -11721,6 +13434,23 @@ atf_amc::MsgHeader* atf_amc::in_buf_GetMsg(atf_amc::Msgbuf& msgbuf) { return ret; } +// --- atf_amc.Msgbuf.in_buf.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void atf_amc::in_buf_Realloc(atf_amc::Msgbuf& msgbuf, int new_max) { + new_max = i32_Max(new_max, msgbuf.in_buf_end); + u8 *new_mem = msgbuf.in_buf_elems + ? (u8*)algo_lib::malloc_ReallocMem(msgbuf.in_buf_elems, msgbuf.in_buf_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.fbuf_nomem field:atf_amc.Msgbuf.in_buf comment:'out of memory'"); + } + msgbuf.in_buf_elems = new_mem; + msgbuf.in_buf_max = new_max; +} + // --- atf_amc.Msgbuf.in_buf.Refill // Refill buffer. Return false if no further refill possible (input buffer exhausted) bool atf_amc::in_buf_Refill(atf_amc::Msgbuf& msgbuf) { @@ -11810,7 +13540,7 @@ void atf_amc::in_buf_SkipMsg(atf_amc::Msgbuf& msgbuf) { } // --- atf_amc.Msgbuf.in_buf.WriteAll -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. @@ -11824,13 +13554,27 @@ bool atf_amc::in_buf_WriteAll(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) { // now try to write the message. i32 end = msgbuf.in_buf_end; bool fits = end + in_n <= max; - if (fits && in_n > 0) { - memcpy(msgbuf.in_buf_elems + end, in, in_n); - msgbuf.in_buf_end = end + in_n; + if (fits) { + if (in_n > 0) { + memcpy(msgbuf.in_buf_elems + end, in, in_n); + msgbuf.in_buf_end = end + in_n; + } } return fits; } +// --- atf_amc.Msgbuf.in_buf.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void atf_amc::in_buf_WriteReserve(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) { + if (!in_buf_WriteAll(msgbuf, in, in_n)) { + in_buf_Realloc(msgbuf, msgbuf.in_buf_max*2); + if (!in_buf_WriteAll(msgbuf, in, in_n)) { + FatalErrorExit("in_buf: out of memory"); + } + } +} + // --- atf_amc.Msgbuf.in_buf.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. @@ -11846,8 +13590,8 @@ bool atf_amc::in_buf_XrefMaybe(atf_amc::MsgHeader &row) { // File descriptor becomes owned by atf_amc::Msgbuf.in_custom via FIohook field. // Whenever the file descriptor becomes readable, insert msgbuf into cd_in_msg. void atf_amc::in_custom_BeginRead(atf_amc::Msgbuf& msgbuf, algo::Fildes fd) { - callback_Set1(msgbuf.in_custom_iohook, msgbuf, atf_amc::cd_in_msg_Insert); msgbuf.in_custom_iohook.fildes = fd; + callback_Set1(msgbuf.in_custom_iohook, msgbuf, atf_amc::cd_in_msg_Insert); IOEvtFlags flags; read_Set(flags, true); if (msgbuf.in_custom_epoll_enable) { @@ -11892,6 +13636,23 @@ algo::aryptr atf_amc::in_custom_GetMsg(atf_amc::Msgbuf& msgbuf) { return ret; } +// --- atf_amc.Msgbuf.in_custom.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void atf_amc::in_custom_Realloc(atf_amc::Msgbuf& msgbuf, int new_max) { + new_max = i32_Max(new_max, msgbuf.in_custom_end); + u8 *new_mem = msgbuf.in_custom_elems + ? (u8*)algo_lib::malloc_ReallocMem(msgbuf.in_custom_elems, msgbuf.in_custom_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.fbuf_nomem field:atf_amc.Msgbuf.in_custom comment:'out of memory'"); + } + msgbuf.in_custom_elems = new_mem; + msgbuf.in_custom_max = new_max; +} + // --- atf_amc.Msgbuf.in_custom.Refill // Refill buffer. Return false if no further refill possible (input buffer exhausted) bool atf_amc::in_custom_Refill(atf_amc::Msgbuf& msgbuf) { @@ -11971,7 +13732,7 @@ void atf_amc::in_custom_SkipMsg(atf_amc::Msgbuf& msgbuf) { } // --- atf_amc.Msgbuf.in_custom.WriteAll -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. @@ -11985,13 +13746,44 @@ bool atf_amc::in_custom_WriteAll(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) { // now try to write the message. i32 end = msgbuf.in_custom_end; bool fits = end + in_n <= max; - if (fits && in_n > 0) { - memcpy(msgbuf.in_custom_elems + end, in, in_n); - msgbuf.in_custom_end = end + in_n; + if (fits) { + if (in_n > 0) { + memcpy(msgbuf.in_custom_elems + end, in, in_n); + msgbuf.in_custom_end = end + in_n; + } } return fits; } +// --- atf_amc.Msgbuf.in_custom.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void atf_amc::in_custom_WriteReserve(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) { + if (!in_custom_WriteAll(msgbuf, in, in_n)) { + in_custom_Realloc(msgbuf, msgbuf.in_custom_max*2); + if (!in_custom_WriteAll(msgbuf, in, in_n)) { + FatalErrorExit("in_custom: out of memory"); + } + } +} + +// --- atf_amc.Msgbuf.out_extra.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void atf_amc::out_extra_Realloc(atf_amc::Msgbuf& msgbuf, int new_max) { + new_max = i32_Max(new_max, msgbuf.out_extra_end); + u8 *new_mem = msgbuf.out_extra_elems + ? (u8*)algo_lib::malloc_ReallocMem(msgbuf.out_extra_elems, msgbuf.out_extra_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.fbuf_nomem field:atf_amc.Msgbuf.out_extra comment:'out of memory'"); + } + msgbuf.out_extra_elems = new_mem; + msgbuf.out_extra_max = new_max; +} + // --- atf_amc.Msgbuf.out_extra.RemoveAll // Empty bfufer // Discard contents of the buffer. @@ -12040,7 +13832,7 @@ void atf_amc::out_extra_SkipMsg(atf_amc::Msgbuf& msgbuf) { } // --- atf_amc.Msgbuf.out_extra.WriteAll -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. @@ -12054,13 +13846,27 @@ bool atf_amc::out_extra_WriteAll(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) { // now try to write the message. i32 end = msgbuf.out_extra_end; bool fits = end + in_n <= max; - if (fits && in_n > 0) { - memcpy(msgbuf.out_extra_elems + end, in, in_n); - msgbuf.out_extra_end = end + in_n; + if (fits) { + if (in_n > 0) { + memcpy(msgbuf.out_extra_elems + end, in, in_n); + msgbuf.out_extra_end = end + in_n; + } } return fits; } +// --- atf_amc.Msgbuf.out_extra.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void atf_amc::out_extra_WriteReserve(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) { + if (!out_extra_WriteAll(msgbuf, in, in_n)) { + out_extra_Realloc(msgbuf, msgbuf.out_extra_max*2); + if (!out_extra_WriteAll(msgbuf, in, in_n)) { + FatalErrorExit("out_extra: out of memory"); + } + } +} + // --- atf_amc.Msgbuf.out_extra.WriteMsg // Write message to buffer. If the entire message is written, return true, otherwise false. bool atf_amc::out_extra_WriteMsg(atf_amc::Msgbuf& msgbuf, atf_amc::MsgHdrLT &msg) { @@ -12084,6 +13890,23 @@ atf_amc::MsgHdrLT* atf_amc::in_extra_GetMsg(atf_amc::Msgbuf& msgbuf) { return ret; } +// --- atf_amc.Msgbuf.in_extra.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void atf_amc::in_extra_Realloc(atf_amc::Msgbuf& msgbuf, int new_max) { + new_max = i32_Max(new_max, msgbuf.in_extra_end); + u8 *new_mem = msgbuf.in_extra_elems + ? (u8*)algo_lib::malloc_ReallocMem(msgbuf.in_extra_elems, msgbuf.in_extra_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.fbuf_nomem field:atf_amc.Msgbuf.in_extra comment:'out of memory'"); + } + msgbuf.in_extra_elems = new_mem; + msgbuf.in_extra_max = new_max; +} + // --- atf_amc.Msgbuf.in_extra.RemoveAll // Empty bfufer // Discard contents of the buffer. @@ -12142,7 +13965,7 @@ void atf_amc::in_extra_SkipMsg(atf_amc::Msgbuf& msgbuf) { } // --- atf_amc.Msgbuf.in_extra.WriteAll -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. @@ -12156,40 +13979,66 @@ bool atf_amc::in_extra_WriteAll(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) { // now try to write the message. i32 end = msgbuf.in_extra_end; bool fits = end + in_n <= max; - if (fits && in_n > 0) { - memcpy(msgbuf.in_extra_elems + end, in, in_n); - msgbuf.in_extra_end = end + in_n; + if (fits) { + if (in_n > 0) { + memcpy(msgbuf.in_extra_elems + end, in, in_n); + msgbuf.in_extra_end = end + in_n; + } } return fits; } +// --- atf_amc.Msgbuf.in_extra.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void atf_amc::in_extra_WriteReserve(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) { + if (!in_extra_WriteAll(msgbuf, in, in_n)) { + in_extra_Realloc(msgbuf, msgbuf.in_extra_max*2); + if (!in_extra_WriteAll(msgbuf, in, in_n)) { + FatalErrorExit("in_extra: out of memory"); + } + } +} + // --- atf_amc.Msgbuf..Init // Set all fields to initial values. void atf_amc::Msgbuf_Init(atf_amc::Msgbuf& msgbuf) { + msgbuf.in_buf_elems = NULL; // in_buf: initialize + msgbuf.in_buf_max = 0; // in_buf: initialize msgbuf.in_buf_end = 0; // in_buf: initialize msgbuf.in_buf_start = 0; // in_buf: initialize msgbuf.in_buf_eof = false; // in_buf: initialize msgbuf.in_buf_msgvalid = false; // in_buf: initialize msgbuf.in_buf_msglen = 0; // in_buf: initialize msgbuf.in_buf_epoll_enable = true; // in_buf: initialize + in_buf_Realloc(msgbuf, 64); + msgbuf.in_custom_elems = NULL; // in_custom: initialize + msgbuf.in_custom_max = 0; // in_custom: initialize msgbuf.in_custom_end = 0; // in_custom: initialize msgbuf.in_custom_start = 0; // in_custom: initialize msgbuf.in_custom_eof = false; // in_custom: initialize msgbuf.in_custom_msgvalid = false; // in_custom: initialize msgbuf.in_custom_msglen = 0; // in_custom: initialize msgbuf.in_custom_epoll_enable = true; // in_custom: initialize + in_custom_Realloc(msgbuf, 64); + msgbuf.out_extra_elems = NULL; // out_extra: initialize + msgbuf.out_extra_max = 0; // out_extra: initialize msgbuf.out_extra_end = 0; // out_extra: initialize msgbuf.out_extra_start = 0; // out_extra: initialize msgbuf.out_extra_eof = false; // out_extra: initialize msgbuf.out_extra_msgvalid = false; // out_extra: initialize msgbuf.out_extra_msglen = 0; // out_extra: initialize msgbuf.out_extra_epoll_enable = true; // out_extra: initialize + out_extra_Realloc(msgbuf, 64); + msgbuf.in_extra_elems = NULL; // in_extra: initialize + msgbuf.in_extra_max = 0; // in_extra: initialize msgbuf.in_extra_end = 0; // in_extra: initialize msgbuf.in_extra_start = 0; // in_extra: initialize msgbuf.in_extra_eof = false; // in_extra: initialize msgbuf.in_extra_msgvalid = false; // in_extra: initialize msgbuf.in_extra_msglen = 0; // in_extra: initialize msgbuf.in_extra_epoll_enable = true; // in_extra: initialize + in_extra_Realloc(msgbuf, 64); msgbuf.cd_in_msg_next = (atf_amc::Msgbuf*)-1; // (atf_amc.FDb.cd_in_msg) not-in-list msgbuf.cd_in_msg_prev = NULL; // (atf_amc.FDb.cd_in_msg) } @@ -12198,6 +14047,34 @@ void atf_amc::Msgbuf_Init(atf_amc::Msgbuf& msgbuf) { void atf_amc::Msgbuf_Uninit(atf_amc::Msgbuf& msgbuf) { atf_amc::Msgbuf &row = msgbuf; (void)row; cd_in_msg_Remove(row); // remove msgbuf from index cd_in_msg + + // atf_amc.Msgbuf.in_extra.Uninit (Fbuf) //Message-based buffer + if (msgbuf.in_extra_elems) { + algo_lib::malloc_FreeMem(msgbuf.in_extra_elems, sizeof(atf_amc::MsgHdrLT)*msgbuf.in_extra_max); // (atf_amc.Msgbuf.in_extra) + } + msgbuf.in_extra_elems = NULL; + msgbuf.in_extra_max = 0; + + // atf_amc.Msgbuf.out_extra.Uninit (Fbuf) //Message-based buffer + if (msgbuf.out_extra_elems) { + algo_lib::malloc_FreeMem(msgbuf.out_extra_elems, sizeof(atf_amc::MsgHdrLT)*msgbuf.out_extra_max); // (atf_amc.Msgbuf.out_extra) + } + msgbuf.out_extra_elems = NULL; + msgbuf.out_extra_max = 0; + + // atf_amc.Msgbuf.in_custom.Uninit (Fbuf) //Message-based buffer + if (msgbuf.in_custom_elems) { + algo_lib::malloc_FreeMem(msgbuf.in_custom_elems, sizeof(char)*msgbuf.in_custom_max); // (atf_amc.Msgbuf.in_custom) + } + msgbuf.in_custom_elems = NULL; + msgbuf.in_custom_max = 0; + + // atf_amc.Msgbuf.in_buf.Uninit (Fbuf) //Message-based buffer + if (msgbuf.in_buf_elems) { + algo_lib::malloc_FreeMem(msgbuf.in_buf_elems, sizeof(atf_amc::MsgHeader)*msgbuf.in_buf_max); // (atf_amc.Msgbuf.in_buf) + } + msgbuf.in_buf_elems = NULL; + msgbuf.in_buf_max = 0; } // --- atf_amc.Msgbuf..Print @@ -12328,13 +14205,14 @@ bool atf_amc::OptAlloc_ReadFieldMaybe(atf_amc::OptAlloc& parent, algo::strptr fi switch(field_id) { case atf_amc_FieldId_length: { retval = false; - break; - } + } break; case atf_amc_FieldId_typeg: { retval = typeg_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -12402,13 +14280,14 @@ bool atf_amc::OptG_ReadFieldMaybe(atf_amc::OptG& parent, algo::strptr field, alg switch(field_id) { case atf_amc_FieldId_length: { retval = false; - break; - } + } break; case atf_amc_FieldId_typeg: { retval = typeg_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -12494,13 +14373,14 @@ bool atf_amc::OptOptG_ReadFieldMaybe(atf_amc::OptOptG& parent, algo::strptr fiel switch(field_id) { case atf_amc_FieldId_length: { retval = false; - break; - } + } break; case atf_amc_FieldId_optg: { retval = optg_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -12611,54 +14491,6 @@ inline static bool atf_amc::value7_ReadStrptrMaybe(atf_amc::PmaskMultiple &paren return retval; } -// --- atf_amc.PmaskMultiple.present_bitcurs.Next -// proceed to next item -void atf_amc::PmaskMultiple_present_bitcurs_Next(PmaskMultiple_present_bitcurs &curs) { - ++curs.bit; - int index = curs.bit / 32; - int offset = curs.bit % 32; - for (; index < curs.n_elems; ++index, offset = 0) { - u64 rest = curs.elems[index] >> offset; - if (rest) { - offset += algo::u64_BitScanForward(rest); - break; - } - } - curs.bit = index * 32 + offset; -} - -// --- atf_amc.PmaskMultiple.assigned_bitcurs.Next -// proceed to next item -void atf_amc::PmaskMultiple_assigned_bitcurs_Next(PmaskMultiple_assigned_bitcurs &curs) { - ++curs.bit; - int index = curs.bit / 32; - int offset = curs.bit % 32; - for (; index < curs.n_elems; ++index, offset = 0) { - u64 rest = curs.elems[index] >> offset; - if (rest) { - offset += algo::u64_BitScanForward(rest); - break; - } - } - curs.bit = index * 32 + offset; -} - -// --- atf_amc.PmaskMultiple.nullable_bitcurs.Next -// proceed to next item -void atf_amc::PmaskMultiple_nullable_bitcurs_Next(PmaskMultiple_nullable_bitcurs &curs) { - ++curs.bit; - int index = curs.bit / 32; - int offset = curs.bit % 32; - for (; index < curs.n_elems; ++index, offset = 0) { - u64 rest = curs.elems[index] >> offset; - if (rest) { - offset += algo::u64_BitScanForward(rest); - break; - } - } - curs.bit = index * 32 + offset; -} - // --- atf_amc.PmaskMultiple..ReadFieldMaybe bool atf_amc::PmaskMultiple_ReadFieldMaybe(atf_amc::PmaskMultiple& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -12667,16 +14499,13 @@ bool atf_amc::PmaskMultiple_ReadFieldMaybe(atf_amc::PmaskMultiple& parent, algo: switch(field_id) { case atf_amc_FieldId_present: { retval = false; - break; - } + } break; case atf_amc_FieldId_assigned: { retval = false; - break; - } + } break; case atf_amc_FieldId_nullable: { retval = false; - break; - } + } break; case atf_amc_FieldId_value1: { retval = value1_ReadStrptrMaybe(parent, strval); if (retval) { @@ -12684,16 +14513,14 @@ bool atf_amc::PmaskMultiple_ReadFieldMaybe(atf_amc::PmaskMultiple& parent, algo: assigned_qSetBit(parent, 0); present_qSetBit(parent, 0); } - break; - } + } break; case atf_amc_FieldId_value2: { retval = value2_ReadStrptrMaybe(parent, strval); if (retval) { assigned_qSetBit(parent, 1); present_qSetBit(parent, 1); } - break; - } + } break; case atf_amc_FieldId_value3: { retval = value3_ReadStrptrMaybe(parent, strval); if (retval) { @@ -12701,16 +14528,14 @@ bool atf_amc::PmaskMultiple_ReadFieldMaybe(atf_amc::PmaskMultiple& parent, algo: assigned_qSetBit(parent, 2); present_qSetBit(parent, 2); } - break; - } + } break; case atf_amc_FieldId_value4: { retval = value4_ReadStrptrMaybe(parent, strval); if (retval) { assigned_qSetBit(parent, 3); present_qSetBit(parent, 3); } - break; - } + } break; case atf_amc_FieldId_value5: { retval = value5_ReadStrptrMaybe(parent, strval); if (retval) { @@ -12718,25 +14543,25 @@ bool atf_amc::PmaskMultiple_ReadFieldMaybe(atf_amc::PmaskMultiple& parent, algo: assigned_qSetBit(parent, 4); present_qSetBit(parent, 4); } - break; - } + } break; case atf_amc_FieldId_value6: { retval = value6_ReadStrptrMaybe(parent, strval); if (retval) { assigned_qSetBit(parent, 5); present_qSetBit(parent, 5); } - break; - } + } break; case atf_amc_FieldId_value7: { retval = value7_ReadStrptrMaybe(parent, strval); if (retval) { assigned_qSetBit(parent, 6); present_qSetBit(parent, 6); } - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -13595,506 +15420,437 @@ bool atf_amc::PmaskU128_ReadFieldMaybe(atf_amc::PmaskU128& parent, algo::strptr switch(field_id) { case atf_amc_FieldId_pmask: { retval = false; - break; - } + } break; case atf_amc_FieldId_value: { retval = value_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 0); } - break; - } + } break; case atf_amc_FieldId_value2: { retval = value2_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 1); } - break; - } + } break; case atf_amc_FieldId_value3: { retval = value3_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 2); } - break; - } + } break; case atf_amc_FieldId_value21: { retval = value21_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 3); } - break; - } + } break; case atf_amc_FieldId_value22: { retval = value22_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 4); } - break; - } + } break; case atf_amc_FieldId_value23: { retval = value23_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 5); } - break; - } + } break; case atf_amc_FieldId_value24: { retval = value24_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 6); } - break; - } + } break; case atf_amc_FieldId_value25: { retval = value25_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 7); } - break; - } + } break; case atf_amc_FieldId_value26: { retval = value26_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 8); } - break; - } + } break; case atf_amc_FieldId_value20: { retval = value20_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 9); } - break; - } + } break; case atf_amc_FieldId_value28: { retval = value28_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 10); } - break; - } + } break; case atf_amc_FieldId_value29: { retval = value29_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 11); } - break; - } + } break; case atf_amc_FieldId_value30: { retval = value30_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 12); } - break; - } + } break; case atf_amc_FieldId_value31: { retval = value31_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 13); } - break; - } + } break; case atf_amc_FieldId_value32: { retval = value32_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 14); } - break; - } + } break; case atf_amc_FieldId_value27: { retval = value27_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 15); } - break; - } + } break; case atf_amc_FieldId_value19: { retval = value19_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 16); } - break; - } + } break; case atf_amc_FieldId_value18: { retval = value18_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 17); } - break; - } + } break; case atf_amc_FieldId_value4: { retval = value4_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 18); } - break; - } + } break; case atf_amc_FieldId_value5: { retval = value5_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 19); } - break; - } + } break; case atf_amc_FieldId_value6: { retval = value6_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 20); } - break; - } + } break; case atf_amc_FieldId_value7: { retval = value7_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 21); } - break; - } + } break; case atf_amc_FieldId_value8: { retval = value8_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 22); } - break; - } + } break; case atf_amc_FieldId_value9: { retval = value9_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 23); } - break; - } + } break; case atf_amc_FieldId_value69: { retval = value69_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 24); } - break; - } + } break; case atf_amc_FieldId_value11: { retval = value11_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 25); } - break; - } + } break; case atf_amc_FieldId_value12: { retval = value12_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 26); } - break; - } + } break; case atf_amc_FieldId_value13: { retval = value13_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 27); } - break; - } + } break; case atf_amc_FieldId_value14: { retval = value14_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 28); } - break; - } + } break; case atf_amc_FieldId_value15: { retval = value15_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 29); } - break; - } + } break; case atf_amc_FieldId_value16: { retval = value16_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 30); } - break; - } + } break; case atf_amc_FieldId_value33: { retval = value33_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 31); } - break; - } + } break; case atf_amc_FieldId_value10: { retval = value10_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 32); } - break; - } + } break; case atf_amc_FieldId_value17: { retval = value17_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 33); } - break; - } + } break; case atf_amc_FieldId_value35: { retval = value35_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 34); } - break; - } + } break; case atf_amc_FieldId_value55: { retval = value55_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 35); } - break; - } + } break; case atf_amc_FieldId_value56: { retval = value56_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 36); } - break; - } + } break; case atf_amc_FieldId_value57: { retval = value57_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 37); } - break; - } + } break; case atf_amc_FieldId_value58: { retval = value58_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 38); } - break; - } + } break; case atf_amc_FieldId_value59: { retval = value59_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 39); } - break; - } + } break; case atf_amc_FieldId_value60: { retval = value60_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 40); } - break; - } + } break; case atf_amc_FieldId_value54: { retval = value54_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 41); } - break; - } + } break; case atf_amc_FieldId_value62: { retval = value62_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 42); } - break; - } + } break; case atf_amc_FieldId_value63: { retval = value63_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 43); } - break; - } + } break; case atf_amc_FieldId_value64: { retval = value64_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 44); } - break; - } + } break; case atf_amc_FieldId_value65: { retval = value65_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 45); } - break; - } + } break; case atf_amc_FieldId_value66: { retval = value66_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 46); } - break; - } + } break; case atf_amc_FieldId_value67: { retval = value67_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 47); } - break; - } + } break; case atf_amc_FieldId_value68: { retval = value68_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 48); } - break; - } + } break; case atf_amc_FieldId_value61: { retval = value61_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 49); } - break; - } + } break; case atf_amc_FieldId_value34: { retval = value34_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 50); } - break; - } + } break; case atf_amc_FieldId_value52: { retval = value52_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 51); } - break; - } + } break; case atf_amc_FieldId_value36: { retval = value36_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 52); } - break; - } + } break; case atf_amc_FieldId_value37: { retval = value37_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 53); } - break; - } + } break; case atf_amc_FieldId_value38: { retval = value38_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 54); } - break; - } + } break; case atf_amc_FieldId_value39: { retval = value39_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 55); } - break; - } + } break; case atf_amc_FieldId_value40: { retval = value40_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 56); } - break; - } + } break; case atf_amc_FieldId_value41: { retval = value41_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 57); } - break; - } + } break; case atf_amc_FieldId_value42: { retval = value42_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 58); } - break; - } + } break; case atf_amc_FieldId_value53: { retval = value53_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 59); } - break; - } + } break; case atf_amc_FieldId_value44: { retval = value44_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 60); } - break; - } + } break; case atf_amc_FieldId_value45: { retval = value45_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 61); } - break; - } + } break; case atf_amc_FieldId_value46: { retval = value46_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 62); } - break; - } + } break; case atf_amc_FieldId_value47: { retval = value47_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 63); } - break; - } + } break; case atf_amc_FieldId_value48: { retval = value48_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 64); } - break; - } + } break; case atf_amc_FieldId_value49: { retval = value49_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 65); } - break; - } + } break; case atf_amc_FieldId_value50: { retval = value50_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 66); } - break; - } + } break; case atf_amc_FieldId_value51: { retval = value51_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 67); } - break; - } + } break; case atf_amc_FieldId_value43: { retval = value43_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 68); } - break; - } + } break; case atf_amc_FieldId_value70: { retval = value70_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 69); } - break; - } + } break; case atf_amc_FieldId_value71: { retval = value71_ReadStrptrMaybe(parent, strval); if (retval) { pmask_qSetBit(parent, 70); } - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -14348,187 +16104,569 @@ void atf_amc::PmaskU128_Print(atf_amc::PmaskU128& row, algo::cstring& str) { u32_Print(row.value61, temp); PrintAttrSpaceReset(str,"value61", temp); - u32_Print(row.value34, temp); - PrintAttrSpaceReset(str,"value34", temp); + u32_Print(row.value34, temp); + PrintAttrSpaceReset(str,"value34", temp); + + u32_Print(row.value52, temp); + PrintAttrSpaceReset(str,"value52", temp); + + u32_Print(row.value36, temp); + PrintAttrSpaceReset(str,"value36", temp); + + u32_Print(row.value37, temp); + PrintAttrSpaceReset(str,"value37", temp); + + u32_Print(row.value38, temp); + PrintAttrSpaceReset(str,"value38", temp); + + u32_Print(row.value39, temp); + PrintAttrSpaceReset(str,"value39", temp); + + u32_Print(row.value40, temp); + PrintAttrSpaceReset(str,"value40", temp); + + u32_Print(row.value41, temp); + PrintAttrSpaceReset(str,"value41", temp); + + u32_Print(row.value42, temp); + PrintAttrSpaceReset(str,"value42", temp); + + u32_Print(row.value53, temp); + PrintAttrSpaceReset(str,"value53", temp); + + u32_Print(row.value44, temp); + PrintAttrSpaceReset(str,"value44", temp); + + u32_Print(row.value45, temp); + PrintAttrSpaceReset(str,"value45", temp); + + u32_Print(row.value46, temp); + PrintAttrSpaceReset(str,"value46", temp); + + u32_Print(row.value47, temp); + PrintAttrSpaceReset(str,"value47", temp); + + u32_Print(row.value48, temp); + PrintAttrSpaceReset(str,"value48", temp); + + u32_Print(row.value49, temp); + PrintAttrSpaceReset(str,"value49", temp); + + u32_Print(row.value50, temp); + PrintAttrSpaceReset(str,"value50", temp); + + u32_Print(row.value51, temp); + PrintAttrSpaceReset(str,"value51", temp); + + u32_Print(row.value43, temp); + PrintAttrSpaceReset(str,"value43", temp); + + u32_Print(row.value70, temp); + PrintAttrSpaceReset(str,"value70", temp); + + u32_Print(row.value71, temp); + PrintAttrSpaceReset(str,"value71", temp); +} + +// --- atf_amc.PmaskU32.value.ReadStrptrMaybe +inline static bool atf_amc::value_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { + bool retval = true; + u32 value_tmp; + retval = u32_ReadStrptrMaybe(value_tmp, in_str); + if (retval) { + value_Set(parent, value_tmp); + } + return retval; +} + +// --- atf_amc.PmaskU32.value2.ReadStrptrMaybe +inline static bool atf_amc::value2_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { + bool retval = true; + u32 value2_tmp; + retval = u32_ReadStrptrMaybe(value2_tmp, in_str); + if (retval) { + value2_Set(parent, value2_tmp); + } + return retval; +} + +// --- atf_amc.PmaskU32.value3.ReadStrptrMaybe +inline static bool atf_amc::value3_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { + bool retval = true; + u32 value3_tmp; + retval = u32_ReadStrptrMaybe(value3_tmp, in_str); + if (retval) { + value3_Set(parent, value3_tmp); + } + return retval; +} + +// --- atf_amc.PmaskU32.value4.ReadStrptrMaybe +inline static bool atf_amc::value4_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { + bool retval = true; + u32 value4_tmp; + retval = u32_ReadStrptrMaybe(value4_tmp, in_str); + if (retval) { + value4_Set(parent, value4_tmp); + } + return retval; +} + +// --- atf_amc.PmaskU32.value5.ReadStrptrMaybe +inline static bool atf_amc::value5_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { + bool retval = true; + u32 value5_tmp; + retval = u32_ReadStrptrMaybe(value5_tmp, in_str); + if (retval) { + value5_Set(parent, value5_tmp); + } + return retval; +} + +// --- atf_amc.PmaskU32..ReadFieldMaybe +bool atf_amc::PmaskU32_ReadFieldMaybe(atf_amc::PmaskU32& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + atf_amc::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case atf_amc_FieldId_pmask: { + retval = false; + } break; + case atf_amc_FieldId_value: { + retval = value_ReadStrptrMaybe(parent, strval); + if (retval) { + pmask_qSetBit(parent, 0); + } + } break; + case atf_amc_FieldId_value2: { + retval = value2_ReadStrptrMaybe(parent, strval); + if (retval) { + pmask_qSetBit(parent, 1); + } + } break; + case atf_amc_FieldId_value3: { + retval = value3_ReadStrptrMaybe(parent, strval); + if (retval) { + pmask_qSetBit(parent, 2); + } + } break; + case atf_amc_FieldId_value4: { + retval = value4_ReadStrptrMaybe(parent, strval); + if (retval) { + pmask_qSetBit(parent, 3); + } + } break; + case atf_amc_FieldId_value5: { + retval = value5_ReadStrptrMaybe(parent, strval); + if (retval) { + pmask_qSetBit(parent, 4); + } + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- atf_amc.PmaskU32..ReadStrptrMaybe +// Read fields of atf_amc::PmaskU32 from an ascii string. +// The format of the string is an ssim Tuple +bool atf_amc::PmaskU32_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "atf_amc.PmaskU32"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && PmaskU32_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- atf_amc.PmaskU32..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.PmaskU32.String printfmt:Tuple +void atf_amc::PmaskU32_Print(atf_amc::PmaskU32& row, algo::cstring& str) { + algo::tempstr temp; + str << "atf_amc.PmaskU32"; + + u32_Print(row.value, temp); + PrintAttrSpaceReset(str,"value", temp); + + u32_Print(row.value2, temp); + PrintAttrSpaceReset(str,"value2", temp); + + u32_Print(row.value3, temp); + PrintAttrSpaceReset(str,"value3", temp); + + u32_Print(row.value4, temp); + PrintAttrSpaceReset(str,"value4", temp); + + u32_Print(row.value5, temp); + PrintAttrSpaceReset(str,"value5", temp); +} + +// --- atf_amc.PmaskU555.pmask.ReadStrptrMaybe +// Read array from string +// Convert string to field. Return success value +bool atf_amc::pmask_ReadStrptrMaybe(atf_amc::PmaskU555& parent, algo::strptr in_str) { + bool retval = true; + if (10>0) { + retval = u64_ReadStrptrMaybe(parent.pmask_elems[0], in_str); + } + return retval; +} + +// --- atf_amc.PooledBE64.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* atf_amc::value_ToCstr(const atf_amc::PooledBE64& pooledbe64) { + const char *ret = NULL; + switch(value_GetEnum(pooledbe64)) { + case atf_amc_PooledBE64_value_A : ret = "A"; break; + case atf_amc_PooledBE64_value_B : ret = "B"; break; + } + return ret; +} + +// --- atf_amc.PooledBE64.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void atf_amc::value_Print(const atf_amc::PooledBE64& pooledbe64, algo::cstring &lhs) { + const char *strval = value_ToCstr(pooledbe64); + if (strval) { + lhs << strval; + } else { + lhs << value_Get(pooledbe64); + } +} - u32_Print(row.value52, temp); - PrintAttrSpaceReset(str,"value52", temp); +// --- atf_amc.PooledBE64.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool atf_amc::value_SetStrptrMaybe(atf_amc::PooledBE64& pooledbe64, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 1: { + switch (u64(rhs[0])) { + case 'A': { + value_SetEnum(pooledbe64,atf_amc_PooledBE64_value_A); ret = true; break; + } + case 'B': { + value_SetEnum(pooledbe64,atf_amc_PooledBE64_value_B); ret = true; break; + } + } + break; + } + } + return ret; +} - u32_Print(row.value36, temp); - PrintAttrSpaceReset(str,"value36", temp); +// --- atf_amc.PooledBE64.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void atf_amc::value_SetStrptr(atf_amc::PooledBE64& pooledbe64, algo::strptr rhs, atf_amc_PooledBE64_value_Enum dflt) { + if (!value_SetStrptrMaybe(pooledbe64,rhs)) value_SetEnum(pooledbe64,dflt); +} - u32_Print(row.value37, temp); - PrintAttrSpaceReset(str,"value37", temp); +// --- atf_amc.PooledBE64.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::value_ReadStrptrMaybe(atf_amc::PooledBE64& pooledbe64, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(pooledbe64,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + u64 value_tmp; + retval = u64_ReadStrptrMaybe(value_tmp, rhs); + if (retval) { + value_Set(pooledbe64, value_tmp); + } + } + return retval; +} - u32_Print(row.value38, temp); - PrintAttrSpaceReset(str,"value38", temp); +// --- atf_amc.PooledBE64..ReadFieldMaybe +bool atf_amc::PooledBE64_ReadFieldMaybe(atf_amc::PooledBE64& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + atf_amc::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case atf_amc_FieldId_value: { + retval = value_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} - u32_Print(row.value39, temp); - PrintAttrSpaceReset(str,"value39", temp); +// --- atf_amc.PooledBE64..ReadStrptrMaybe +// Read fields of atf_amc::PooledBE64 from an ascii string. +// The format of the string is an ssim Tuple +bool atf_amc::PooledBE64_ReadStrptrMaybe(atf_amc::PooledBE64 &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "atf_amc.PooledBE64"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && PooledBE64_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} - u32_Print(row.value40, temp); - PrintAttrSpaceReset(str,"value40", temp); +// --- atf_amc.PooledBE64..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.PooledBE64.String printfmt:Tuple +void atf_amc::PooledBE64_Print(atf_amc::PooledBE64& row, algo::cstring& str) { + algo::tempstr temp; + str << "atf_amc.PooledBE64"; - u32_Print(row.value41, temp); - PrintAttrSpaceReset(str,"value41", temp); + atf_amc::value_Print(row, temp); + PrintAttrSpaceReset(str,"value", temp); +} - u32_Print(row.value42, temp); - PrintAttrSpaceReset(str,"value42", temp); +// --- atf_amc.RnullStr6_U32.ch.Print +void atf_amc::ch_Print(atf_amc::RnullStr6_U32& parent, algo::cstring &out) { + ch_Addary(out, ch_Getary(parent)); +} - u32_Print(row.value53, temp); - PrintAttrSpaceReset(str,"value53", temp); +// --- atf_amc.RnullStr6_U32.ch.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::ch_ReadStrptrMaybe(atf_amc::RnullStr6_U32& parent, algo::strptr rhs) { + bool retval = false; + if (rhs.n_elems <= 6) { + ch_SetStrptr(parent, rhs); + retval = true; + } else { + algo_lib::AppendErrtext("comment","text too long, limit 6"); + } + return retval; +} - u32_Print(row.value44, temp); - PrintAttrSpaceReset(str,"value44", temp); +// --- atf_amc.RnullStr6_U32.ch.SetStrptr +// Copy from strptr, clipping length +// Set string to the value provided by RHS. +// If RHS is too large, it is silently clipped. +void atf_amc::ch_SetStrptr(atf_amc::RnullStr6_U32& parent, const algo::strptr& rhs) { + int len = i32_Min(rhs.n_elems, 6); + char *rhs_elems = rhs.elems; + int i = 0; + int j = 0; + for (; i < len; i++, j++) { + parent.ch[j] = rhs_elems[i]; + } + for (; j < 6; j++) { + parent.ch[j] = 0; + } +} - u32_Print(row.value45, temp); - PrintAttrSpaceReset(str,"value45", temp); +// --- atf_amc.RnullStr6_U32.ch.Getnum +// Convert field to numeric value. If the value is too large +// for the target type, or the string is invalid, the result +// is undefined, and and_ok is set to false. +// Empty string is evaluated to zero. +u32 atf_amc::ch_Getnum(atf_amc::RnullStr6_U32& parent, bool &and_ok) { + u64 val = 0; + algo::strptr str = ch_Getary(parent); + if (elems_N(str)>0) { // empty string maps to zero + u32 ok = 1; + val = aParseNum8(str, ok); + and_ok &= (ok != 0); + } + return u32(val); +} - u32_Print(row.value46, temp); - PrintAttrSpaceReset(str,"value46", temp); +// --- atf_amc.RnullStr6_U32.ch.GetnumDflt +// Convert field to numeric value. If the value is too large +// for the target type, or the string is invalid, return default value. +// Empty string is evaluated to zero. +u32 atf_amc::ch_GetnumDflt(atf_amc::RnullStr6_U32& parent, u32 dflt) { + bool ok = true; + u32 result = ch_Getnum(parent, ok); + return ok ? result : dflt; +} - u32_Print(row.value47, temp); - PrintAttrSpaceReset(str,"value47", temp); +// --- atf_amc.RnullStr6_U32.ch.Geti64 +// Convert field to numeric value. If the value is too large +// for the target type, or the string is invalid, throw an exception. +// Empty string is evaluated to zero. +i64 atf_amc::ch_Geti64(atf_amc::RnullStr6_U32& parent, bool &out_ok) { + out_ok = true; + i64 result = ch_Getnum(parent, out_ok); + return result; +} - u32_Print(row.value48, temp); - PrintAttrSpaceReset(str,"value48", temp); +// --- atf_amc.RnullStr6_U32.ch.SetnumMaybe +// Set string to number specified in RHS performing base-10 conversion. +// If the number is too large for the string, return false. +bool atf_amc::ch_SetnumMaybe(atf_amc::RnullStr6_U32& parent, i64 rhs) { + char buf[128]; + int length = 0; + int charpos = 64; + u64 val = rhs; + length = algo::u32_FmtBuf(val, (u8*)buf + charpos); + bool retval = length <= 6; + if (retval) { + ch_SetStrptr(parent, algo::strptr(buf + charpos, length)); + } + return retval; +} - u32_Print(row.value49, temp); - PrintAttrSpaceReset(str,"value49", temp); +// --- atf_amc.RnullStr6_U32..Hash +u32 atf_amc::RnullStr6_U32_Hash(u32 prev, const atf_amc::RnullStr6_U32& rhs) { + algo::strptr ch_strptr = ch_Getary(rhs); + prev = ::strptr_Hash(prev, ch_strptr); + return prev; +} - u32_Print(row.value50, temp); - PrintAttrSpaceReset(str,"value50", temp); +// --- atf_amc.RnullStr6_U32..ReadStrptrMaybe +// Read fields of atf_amc::RnullStr6_U32 from an ascii string. +// The format of the string is the format of the atf_amc::RnullStr6_U32's only field +bool atf_amc::RnullStr6_U32_ReadStrptrMaybe(atf_amc::RnullStr6_U32 &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && ch_ReadStrptrMaybe(parent, in_str); + return retval; +} - u32_Print(row.value51, temp); - PrintAttrSpaceReset(str,"value51", temp); +// --- atf_amc.RnullStr6_U32..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.RnullStr6_U32.String printfmt:Raw +void atf_amc::RnullStr6_U32_Print(atf_amc::RnullStr6_U32& row, algo::cstring& str) { + atf_amc::ch_Print(row, str); +} - u32_Print(row.value43, temp); - PrintAttrSpaceReset(str,"value43", temp); +// --- atf_amc.RpasU32Str6.ch.Print +void atf_amc::ch_Print(atf_amc::RpasU32Str6& parent, algo::cstring &out) { + ch_Addary(out, ch_Getary(parent)); +} - u32_Print(row.value70, temp); - PrintAttrSpaceReset(str,"value70", temp); +// --- atf_amc.RpasU32Str6.ch.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::ch_ReadStrptrMaybe(atf_amc::RpasU32Str6& parent, algo::strptr rhs) { + bool retval = false; + if (rhs.n_elems <= 6) { + ch_SetStrptr(parent, rhs); + retval = true; + } else { + algo_lib::AppendErrtext("comment","text too long, limit 6"); + } + return retval; +} - u32_Print(row.value71, temp); - PrintAttrSpaceReset(str,"value71", temp); +// --- atf_amc.RpasU32Str6.ch.SetStrptr +// Copy from strptr, clipping length +// Set string to the value provided by RHS. +// If RHS is too large, it is silently clipped. +void atf_amc::ch_SetStrptr(atf_amc::RpasU32Str6& parent, const algo::strptr& rhs) { + int len = i32_Min(rhs.n_elems, 6); + char *rhs_elems = rhs.elems; + int i = 0; + int j = 0; + for (; i < len; i++, j++) { + parent.ch[j] = rhs_elems[i]; + } + parent.n_ch = u8(len); } -// --- atf_amc.PmaskU32.value.ReadStrptrMaybe -inline static bool atf_amc::value_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { - bool retval = true; - u32 value_tmp; - retval = u32_ReadStrptrMaybe(value_tmp, in_str); - if (retval) { - value_Set(parent, value_tmp); +// --- atf_amc.RpasU32Str6.ch.Getnum +// Convert field to numeric value. If the value is too large +// for the target type, or the string is invalid, the result +// is undefined, and and_ok is set to false. +// Empty string is evaluated to zero. +u32 atf_amc::ch_Getnum(atf_amc::RpasU32Str6& parent, bool &and_ok) { + u64 val = 0; + algo::strptr str = ch_Getary(parent); + if (elems_N(str)>0) { // empty string maps to zero + u32 ok = 1; + val = aParseNum8(str, ok); + and_ok &= (ok != 0); } - return retval; + return u32(val); } -// --- atf_amc.PmaskU32.value2.ReadStrptrMaybe -inline static bool atf_amc::value2_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { - bool retval = true; - u32 value2_tmp; - retval = u32_ReadStrptrMaybe(value2_tmp, in_str); - if (retval) { - value2_Set(parent, value2_tmp); - } - return retval; +// --- atf_amc.RpasU32Str6.ch.GetnumDflt +// Convert field to numeric value. If the value is too large +// for the target type, or the string is invalid, return default value. +// Empty string is evaluated to zero. +u32 atf_amc::ch_GetnumDflt(atf_amc::RpasU32Str6& parent, u32 dflt) { + bool ok = true; + u32 result = ch_Getnum(parent, ok); + return ok ? result : dflt; } -// --- atf_amc.PmaskU32.value3.ReadStrptrMaybe -inline static bool atf_amc::value3_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { - bool retval = true; - u32 value3_tmp; - retval = u32_ReadStrptrMaybe(value3_tmp, in_str); - if (retval) { - value3_Set(parent, value3_tmp); - } - return retval; +// --- atf_amc.RpasU32Str6.ch.Geti64 +// Convert field to numeric value. If the value is too large +// for the target type, or the string is invalid, throw an exception. +// Empty string is evaluated to zero. +i64 atf_amc::ch_Geti64(atf_amc::RpasU32Str6& parent, bool &out_ok) { + out_ok = true; + i64 result = ch_Getnum(parent, out_ok); + return result; } -// --- atf_amc.PmaskU32.value4.ReadStrptrMaybe -inline static bool atf_amc::value4_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { - bool retval = true; - u32 value4_tmp; - retval = u32_ReadStrptrMaybe(value4_tmp, in_str); +// --- atf_amc.RpasU32Str6.ch.SetnumMaybe +// Set string to number specified in RHS performing base-10 conversion. +// If the number is too large for the string, return false. +bool atf_amc::ch_SetnumMaybe(atf_amc::RpasU32Str6& parent, i64 rhs) { + char buf[128]; + int length = 0; + int charpos = 64; + u64 val = rhs; + length = algo::u32_FmtBuf(val, (u8*)buf + charpos); + bool retval = length <= 6; if (retval) { - value4_Set(parent, value4_tmp); + ch_SetStrptr(parent, algo::strptr(buf + charpos, length)); } return retval; } -// --- atf_amc.PmaskU32.value5.ReadStrptrMaybe -inline static bool atf_amc::value5_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { +// --- atf_amc.RpasU32Str6..Hash +u32 atf_amc::RpasU32Str6_Hash(u32 prev, const atf_amc::RpasU32Str6& rhs) { + algo::strptr ch_strptr = ch_Getary(rhs); + prev = ::strptr_Hash(prev, ch_strptr); + return prev; +} + +// --- atf_amc.RpasU32Str6..ReadStrptrMaybe +// Read fields of atf_amc::RpasU32Str6 from an ascii string. +// The format of the string is the format of the atf_amc::RpasU32Str6's only field +bool atf_amc::RpasU32Str6_ReadStrptrMaybe(atf_amc::RpasU32Str6 &parent, algo::strptr in_str) { bool retval = true; - u32 value5_tmp; - retval = u32_ReadStrptrMaybe(value5_tmp, in_str); - if (retval) { - value5_Set(parent, value5_tmp); - } + retval = retval && ch_ReadStrptrMaybe(parent, in_str); return retval; } -// --- atf_amc.PmaskU32.pmask_bitcurs.Next -// proceed to next item -void atf_amc::PmaskU32_pmask_bitcurs_Next(PmaskU32_pmask_bitcurs &curs) { - ++curs.bit; - int index = curs.bit / 32; - int offset = curs.bit % 32; - for (; index < curs.n_elems; ++index, offset = 0) { - u64 rest = curs.elems[index] >> offset; - if (rest) { - offset += algo::u64_BitScanForward(rest); - break; - } - } - curs.bit = index * 32 + offset; +// --- atf_amc.RpasU32Str6..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.RpasU32Str6.String printfmt:Raw +void atf_amc::RpasU32Str6_Print(atf_amc::RpasU32Str6& row, algo::cstring& str) { + atf_amc::ch_Print(row, str); } -// --- atf_amc.PmaskU32..ReadFieldMaybe -bool atf_amc::PmaskU32_ReadFieldMaybe(atf_amc::PmaskU32& parent, algo::strptr field, algo::strptr strval) { +// --- atf_amc.Sep1..ReadFieldMaybe +bool atf_amc::Sep1_ReadFieldMaybe(atf_amc::Sep1& parent, algo::strptr field, algo::strptr strval) { bool retval = true; atf_amc::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case atf_amc_FieldId_pmask: { + case atf_amc_FieldId_val1: { + retval = u32_ReadStrptrMaybe(parent.val1, strval); + } break; + case atf_amc_FieldId_val2: { + retval = u32_ReadStrptrMaybe(parent.val2, strval); + } break; + case atf_amc_FieldId_val3: { + retval = u32_ReadStrptrMaybe(parent.val3, strval); + } break; + default: { retval = false; - break; - } - case atf_amc_FieldId_value: { - retval = value_ReadStrptrMaybe(parent, strval); - if (retval) { - pmask_qSetBit(parent, 0); - } - break; - } - case atf_amc_FieldId_value2: { - retval = value2_ReadStrptrMaybe(parent, strval); - if (retval) { - pmask_qSetBit(parent, 1); - } - break; - } - case atf_amc_FieldId_value3: { - retval = value3_ReadStrptrMaybe(parent, strval); - if (retval) { - pmask_qSetBit(parent, 2); - } - break; - } - case atf_amc_FieldId_value4: { - retval = value4_ReadStrptrMaybe(parent, strval); - if (retval) { - pmask_qSetBit(parent, 3); - } - break; - } - case atf_amc_FieldId_value5: { - retval = value5_ReadStrptrMaybe(parent, strval); - if (retval) { - pmask_qSetBit(parent, 4); - } - break; - } - default: break; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -14536,147 +16674,95 @@ bool atf_amc::PmaskU32_ReadFieldMaybe(atf_amc::PmaskU32& parent, algo::strptr fi return retval; } -// --- atf_amc.PmaskU32..ReadStrptrMaybe -// Read fields of atf_amc::PmaskU32 from an ascii string. -// The format of the string is an ssim Tuple -bool atf_amc::PmaskU32_ReadStrptrMaybe(atf_amc::PmaskU32 &parent, algo::strptr in_str) { +// --- atf_amc.Sep1..ReadStrptrMaybe +// Read fields of atf_amc::Sep1 from an ascii string. +// The format of the string is a string with separated values +bool atf_amc::Sep1_ReadStrptrMaybe(atf_amc::Sep1 &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "atf_amc.PmaskU32"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && PmaskU32_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; -} - -// --- atf_amc.PmaskU32..Print -// print string representation of ROW to string STR -// cfmt:atf_amc.PmaskU32.String printfmt:Tuple -void atf_amc::PmaskU32_Print(atf_amc::PmaskU32& row, algo::cstring& str) { - algo::tempstr temp; - str << "atf_amc.PmaskU32"; - - u32_Print(row.value, temp); - PrintAttrSpaceReset(str,"value", temp); - - u32_Print(row.value2, temp); - PrintAttrSpaceReset(str,"value2", temp); - - u32_Print(row.value3, temp); - PrintAttrSpaceReset(str,"value3", temp); + algo::strptr value; - u32_Print(row.value4, temp); - PrintAttrSpaceReset(str,"value4", temp); + algo::NextSep(in_str, '-', value); + retval = retval && u32_ReadStrptrMaybe(parent.val1, value); - u32_Print(row.value5, temp); - PrintAttrSpaceReset(str,"value5", temp); -} + algo::NextSep(in_str, '/', value); + retval = retval && u32_ReadStrptrMaybe(parent.val2, value); -// --- atf_amc.PmaskU555.pmask.ReadStrptrMaybe -// Read array from string -// Convert string to field. Return success value -bool atf_amc::pmask_ReadStrptrMaybe(atf_amc::PmaskU555& parent, algo::strptr in_str) { - bool retval = true; - if (10>0) { - retval = u64_ReadStrptrMaybe(parent.pmask_elems[0], in_str); - } + value = in_str; + retval = retval && u32_ReadStrptrMaybe(parent.val3, value); return retval; } -// --- atf_amc.PmaskU555.pmask_bitcurs.Next -// proceed to next item -void atf_amc::PmaskU555_pmask_bitcurs_Next(PmaskU555_pmask_bitcurs &curs) { - ++curs.bit; - int index = curs.bit / 64; - int offset = curs.bit % 64; - for (; index < curs.n_elems; ++index, offset = 0) { - u64 rest = curs.elems[index] >> offset; - if (rest) { - offset += algo::u64_BitScanForward(rest); - break; - } - } - curs.bit = index * 64 + offset; -} - -// --- atf_amc.PooledBE64.value.ToCstr -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -const char* atf_amc::value_ToCstr(const atf_amc::PooledBE64& pooledbe64) { - const char *ret = NULL; - switch(value_GetEnum(pooledbe64)) { - case atf_amc_PooledBE64_value_A : ret = "A"; break; - case atf_amc_PooledBE64_value_B : ret = "B"; break; - } - return ret; +// --- atf_amc.Sep1..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.Sep1.String printfmt:Sep +void atf_amc::Sep1_Print(atf_amc::Sep1& row, algo::cstring& str) { + u32_Print(row.val1, str); + str << '-'; + u32_Print(row.val2, str); + str << '/'; + u32_Print(row.val3, str); } -// --- atf_amc.PooledBE64.value.Print -// Convert value to a string. First, attempt conversion to a known string. -// If no string matches, print value as a numeric value. -void atf_amc::value_Print(const atf_amc::PooledBE64& pooledbe64, algo::cstring &lhs) { - const char *strval = value_ToCstr(pooledbe64); - if (strval) { - lhs << strval; - } else { - lhs << value_Get(pooledbe64); - } +// --- atf_amc.Seqmsg.msghdr.CopyOut +// Copy fields out of row +void atf_amc::parent_CopyOut(atf_amc::Seqmsg &row, atf_amc::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter } -// --- atf_amc.PooledBE64.value.SetStrptrMaybe -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -bool atf_amc::value_SetStrptrMaybe(atf_amc::PooledBE64& pooledbe64, algo::strptr rhs) { - bool ret = false; - switch (elems_N(rhs)) { - case 1: { - switch (u64(rhs[0])) { - case 'A': { - value_SetEnum(pooledbe64,atf_amc_PooledBE64_value_A); ret = true; break; - } - case 'B': { - value_SetEnum(pooledbe64,atf_amc_PooledBE64_value_B); ret = true; break; - } - } - break; - } - } - return ret; +// --- atf_amc.Seqmsg.payload.Getary +// Access optional portion as an array of bytes +algo::aryptr atf_amc::payload_Getary(atf_amc::Seqmsg& parent) { + u8 *end = (u8*)&parent + sizeof(atf_amc::Seqmsg); + return algo::aryptr(end, i32(parent.length) - ssizeof(atf_amc::Seqmsg)); } -// --- atf_amc.PooledBE64.value.SetStrptr -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -void atf_amc::value_SetStrptr(atf_amc::PooledBE64& pooledbe64, algo::strptr rhs, atf_amc_PooledBE64_value_Enum dflt) { - if (!value_SetStrptrMaybe(pooledbe64,rhs)) value_SetEnum(pooledbe64,dflt); +// --- atf_amc.Seqmsg.payload.Print +void atf_amc::payload_Print(atf_amc::Seqmsg& parent, cstring &out) { + (void)out; + (void)parent; + if (atf_amc::MsgHeader *payload = payload_Get(parent)) { + atf_amc::MsgHeaderMsgs_Print(out, *payload, INT_MAX); + } } -// --- atf_amc.PooledBE64.value.ReadStrptrMaybe +// --- atf_amc.Seqmsg.payload.ReadStrptrMaybe // Convert string to field. Return success value -bool atf_amc::value_ReadStrptrMaybe(atf_amc::PooledBE64& pooledbe64, algo::strptr rhs) { +bool atf_amc::payload_ReadStrptrMaybe(atf_amc::Seqmsg &parent, algo::strptr in_str) { bool retval = false; - retval = value_SetStrptrMaybe(pooledbe64,rhs); // try symbol conversion - if (!retval) { // didn't work? try reading as underlying type - u64 value_tmp; - retval = u64_ReadStrptrMaybe(value_tmp, rhs); - if (retval) { - value_Set(pooledbe64, value_tmp); - } + if (algo_lib::_db.varlenbuf) { + algo::ByteAry temp; + retval = atf_amc::MsgHeaderMsgs_ReadStrptrMaybe(in_str, temp); // read any of several message types here + ary_Setary(*algo_lib::_db.varlenbuf, ary_Getary(temp)); // return it } + (void)parent;//only to avoid -Wunused-parameter return retval; } -// --- atf_amc.PooledBE64..ReadFieldMaybe -bool atf_amc::PooledBE64_ReadFieldMaybe(atf_amc::PooledBE64& parent, algo::strptr field, algo::strptr strval) { +// --- atf_amc.Seqmsg..ReadFieldMaybe +bool atf_amc::Seqmsg_ReadFieldMaybe(atf_amc::Seqmsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; atf_amc::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case atf_amc_FieldId_value: { - retval = value_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + case atf_amc_FieldId_msghdr: { + retval = false; + } break; + case atf_amc_FieldId_type: { + retval = false; + } break; + case atf_amc_FieldId_length: { + retval = false; + } break; + case atf_amc_FieldId_payload: { + retval = payload_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -14684,969 +16770,1040 @@ bool atf_amc::PooledBE64_ReadFieldMaybe(atf_amc::PooledBE64& parent, algo::strpt return retval; } -// --- atf_amc.PooledBE64..ReadStrptrMaybe -// Read fields of atf_amc::PooledBE64 from an ascii string. +// --- atf_amc.Seqmsg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::Seqmsg from an ascii string. // The format of the string is an ssim Tuple -bool atf_amc::PooledBE64_ReadStrptrMaybe(atf_amc::PooledBE64 &parent, algo::strptr in_str) { +bool atf_amc::Seqmsg_ReadStrptrMaybe(atf_amc::Seqmsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "atf_amc.PooledBE64"); + retval = algo::StripTypeTag(in_str, "atf_amc.Seqmsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && PooledBE64_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && Seqmsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- atf_amc.PooledBE64..Print +// --- atf_amc.Seqmsg..Print // print string representation of ROW to string STR -// cfmt:atf_amc.PooledBE64.String printfmt:Tuple -void atf_amc::PooledBE64_Print(atf_amc::PooledBE64& row, algo::cstring& str) { +// cfmt:atf_amc.Seqmsg.String printfmt:Tuple +void atf_amc::Seqmsg_Print(atf_amc::Seqmsg& row, algo::cstring& str) { algo::tempstr temp; - str << "atf_amc.PooledBE64"; + str << "atf_amc.Seqmsg"; - atf_amc::value_Print(row, temp); - PrintAttrSpaceReset(str,"value", temp); + if (payload_Get(row)) { + atf_amc::payload_Print(row, temp); + PrintAttrSpaceReset(str,"payload", temp); + } } -// --- atf_amc.RnullStr6_U32.ch.Print -void atf_amc::ch_Print(atf_amc::RnullStr6_U32& parent, algo::cstring &out) { - ch_Addary(out, ch_Getary(parent)); +// --- atf_amc.SortedStr.novs.Nextchar +// Extract next character from STR and advance IDX +inline static int atf_amc::novs_Nextchar(const atf_amc::SortedStr& parent, algo::strptr &str, int &idx) { + (void)parent; + int i = idx; + int ch = str.elems[i]; + i++; + idx = i; + return ch; } -// --- atf_amc.RnullStr6_U32.ch.ReadStrptrMaybe -// Convert string to field. Return success value -bool atf_amc::ch_ReadStrptrMaybe(atf_amc::RnullStr6_U32& parent, algo::strptr rhs) { - bool retval = false; - if (rhs.n_elems <= 6) { - ch_SetStrptr(parent, rhs); - retval = true; - } else { - algo_lib::SaveBadTag("comment","text too long, limit 6"); +// --- atf_amc.SortedStr.vs.Nextchar +// Extract next character from STR and advance IDX +inline static u64 atf_amc::vs_Nextchar(const atf_amc::SortedStr& parent, algo::strptr &str, int &idx) { + (void)parent; + int i = idx; + u64 ch = str.elems[i]; + i++; + // detect number in string and eat it up into CH. + // (this only works for base-10 numbers + // Digits are sorted before chars + if (unsigned(ch - '0') < 10) { + while(i < str.n_elems) { // resulting char sorts before ascii 47 + unsigned dig = str.elems[i] - '0'; + if (dig >= 10) break; + ch = ch * 10 + dig; + i++; + } + } else if (ch > '9') { + // create space between '0'..'9' for 15-digit numbers + ch += 1000000000000000LL; } - return retval; + idx = i; + return ch; } -// --- atf_amc.RnullStr6_U32.ch.SetStrptr -// Copy from strptr, clipping length -// Set string to the value provided by RHS. -// If RHS is too large, it is silently clipped. -void atf_amc::ch_SetStrptr(atf_amc::RnullStr6_U32& parent, const algo::strptr& rhs) { - int len = i32_Min(rhs.n_elems, 6); - char *rhs_elems = rhs.elems; - int i = 0; - int j = 0; - for (; i < len; i++, j++) { - parent.ch[j] = rhs_elems[i]; - } - for (; j < 6; j++) { - parent.ch[j] = 0; +// --- atf_amc.SortedStr.vs.Cmp +// Compare two fields. +// Comparison uses version sort (detect embedded integers). +// Comparison is case-insensitive. +i32 atf_amc::vs_Cmp(atf_amc::SortedStr& parent, atf_amc::SortedStr &rhs) { + i32 retval = 0; + int idx_a = 0; + int idx_b = 0; + algo::strptr str_a = ch_Getary(parent.vs); + algo::strptr str_b = ch_Getary(rhs.vs); + int n_a = elems_N(str_a); + int n_b = elems_N(str_b); + retval = i32_Cmp(n_a,n_b); + while (idx_a < n_a && idx_b < n_b) { + u64 ch_a = vs_Nextchar(parent, str_a, idx_a); + u64 ch_b = vs_Nextchar(rhs, str_b, idx_b); + if (ch_a != ch_b) { + retval = (ch_a > ch_b)*2-1; + break; + } } + return retval; } -// --- atf_amc.RnullStr6_U32.ch.Getnum -// Convert field to numeric value. If the value is too large -// for the target type, or the string is invalid, the result -// is undefined, and and_ok is set to false. -// Empty string is evaluated to zero. -u32 atf_amc::ch_Getnum(atf_amc::RnullStr6_U32& parent, bool &and_ok) { - u64 val = 0; - algo::strptr str = ch_Getary(parent); - if (elems_N(str)>0) { // empty string maps to zero - u32 ok = 1; - val = aParseNum8(str, ok); - and_ok &= (ok != 0); +// --- atf_amc.SsimfilesCase.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* atf_amc::value_ToCstr(const atf_amc::SsimfilesCase& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case atf_amc_SsimfilesCase_dmmeta_Ctype: ret = "dmmeta.Ctype"; break; } - return u32(val); -} - -// --- atf_amc.RnullStr6_U32.ch.GetnumDflt -// Convert field to numeric value. If the value is too large -// for the target type, or the string is invalid, return default value. -// Empty string is evaluated to zero. -u32 atf_amc::ch_GetnumDflt(atf_amc::RnullStr6_U32& parent, u32 dflt) { - bool ok = true; - u32 result = ch_Getnum(parent, ok); - return ok ? result : dflt; + return ret; } -// --- atf_amc.RnullStr6_U32.ch.Geti64 -// Convert field to numeric value. If the value is too large -// for the target type, or the string is invalid, throw an exception. -// Empty string is evaluated to zero. -i64 atf_amc::ch_Geti64(atf_amc::RnullStr6_U32& parent, bool &out_ok) { - out_ok = true; - i64 result = ch_Getnum(parent, out_ok); - return result; +// --- atf_amc.SsimfilesCase.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void atf_amc::value_Print(const atf_amc::SsimfilesCase& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } } -// --- atf_amc.RnullStr6_U32.ch.SetnumMaybe -// Set string to number specified in RHS performing base-10 conversion. -// If the number is too large for the string, return false. -bool atf_amc::ch_SetnumMaybe(atf_amc::RnullStr6_U32& parent, i64 rhs) { - char buf[128]; - int length = 0; - int charpos = 64; - u64 val = rhs; - length = algo::u32_FmtBuf(val, (u8*)buf + charpos); - bool retval = length <= 6; - if (retval) { - ch_SetStrptr(parent, algo::strptr(buf + charpos, length)); +// --- atf_amc.SsimfilesCase.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool atf_amc::value_SetStrptrMaybe(atf_amc::SsimfilesCase& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 12: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('d','m','m','e','t','a','.','C'): { + if (memcmp(rhs.elems+8,"type",4)==0) { value_SetEnum(parent,atf_amc_SsimfilesCase_dmmeta_Ctype); ret = true; break; } + break; + } + case LE_STR8('d','m','m','e','t','a','.','c'): { + if (memcmp(rhs.elems+8,"type",4)==0) { value_SetEnum(parent,atf_amc_SsimfilesCase_dmmeta_ctype); ret = true; break; } + break; + } + } + break; + } } - return retval; + return ret; } -// --- atf_amc.RnullStr6_U32..Hash -u32 atf_amc::RnullStr6_U32_Hash(u32 prev, const atf_amc::RnullStr6_U32& rhs) { - algo::strptr ch_strptr = ch_Getary(rhs); - prev = ::strptr_Hash(prev, ch_strptr); - return prev; +// --- atf_amc.SsimfilesCase.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void atf_amc::value_SetStrptr(atf_amc::SsimfilesCase& parent, algo::strptr rhs, atf_amc_SsimfilesCaseEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); } -// --- atf_amc.RnullStr6_U32..ReadStrptrMaybe -// Read fields of atf_amc::RnullStr6_U32 from an ascii string. -// The format of the string is the format of the atf_amc::RnullStr6_U32's only field -bool atf_amc::RnullStr6_U32_ReadStrptrMaybe(atf_amc::RnullStr6_U32 &parent, algo::strptr in_str) { +// --- atf_amc.SsimfilesCase.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::value_ReadStrptrMaybe(atf_amc::SsimfilesCase& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- atf_amc.SsimfilesCase..ReadStrptrMaybe +// Read fields of atf_amc::SsimfilesCase from an ascii string. +// The format of the string is the format of the atf_amc::SsimfilesCase's only field +bool atf_amc::SsimfilesCase_ReadStrptrMaybe(atf_amc::SsimfilesCase &parent, algo::strptr in_str) { bool retval = true; - retval = retval && ch_ReadStrptrMaybe(parent, in_str); + retval = retval && value_ReadStrptrMaybe(parent, in_str); return retval; } -// --- atf_amc.RnullStr6_U32..Print -// print string representation of ROW to string STR -// cfmt:atf_amc.RnullStr6_U32.String printfmt:Raw -void atf_amc::RnullStr6_U32_Print(atf_amc::RnullStr6_U32& row, algo::cstring& str) { - atf_amc::ch_Print(row, str); +// --- atf_amc.Strkey..Uninit +void atf_amc::Strkey_Uninit(atf_amc::Strkey& strkey) { + atf_amc::Strkey &row = strkey; (void)row; + ind_strkey_Remove(row); // remove strkey from index ind_strkey } -// --- atf_amc.RpasU32Str6.ch.Print -void atf_amc::ch_Print(atf_amc::RpasU32Str6& parent, algo::cstring &out) { - ch_Addary(out, ch_Getary(parent)); +// --- atf_amc.TableId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* atf_amc::value_ToCstr(const atf_amc::TableId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case atf_amc_TableId_atf_amc_TypeS : ret = "atf_amc.TypeS"; break; + case atf_amc_TableId_atf_amc_TypeT : ret = "atf_amc.TypeT"; break; + } + return ret; } -// --- atf_amc.RpasU32Str6.ch.ReadStrptrMaybe -// Convert string to field. Return success value -bool atf_amc::ch_ReadStrptrMaybe(atf_amc::RpasU32Str6& parent, algo::strptr rhs) { - bool retval = false; - if (rhs.n_elems <= 6) { - ch_SetStrptr(parent, rhs); - retval = true; +// --- atf_amc.TableId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void atf_amc::value_Print(const atf_amc::TableId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; } else { - algo_lib::SaveBadTag("comment","text too long, limit 6"); + lhs << parent.value; } - return retval; } -// --- atf_amc.RpasU32Str6.ch.SetStrptr -// Copy from strptr, clipping length -// Set string to the value provided by RHS. -// If RHS is too large, it is silently clipped. -void atf_amc::ch_SetStrptr(atf_amc::RpasU32Str6& parent, const algo::strptr& rhs) { - int len = i32_Min(rhs.n_elems, 6); - char *rhs_elems = rhs.elems; - int i = 0; - int j = 0; - for (; i < len; i++, j++) { - parent.ch[j] = rhs_elems[i]; +// --- atf_amc.TableId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool atf_amc::value_SetStrptrMaybe(atf_amc::TableId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 13: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','t','f','_','a','m','c','.'): { + if (memcmp(rhs.elems+8,"TypeS",5)==0) { value_SetEnum(parent,atf_amc_TableId_atf_amc_TypeS); ret = true; break; } + if (memcmp(rhs.elems+8,"TypeT",5)==0) { value_SetEnum(parent,atf_amc_TableId_atf_amc_TypeT); ret = true; break; } + break; + } + } + break; + } } - parent.n_ch = u8(len); + return ret; } -// --- atf_amc.RpasU32Str6.ch.Getnum -// Convert field to numeric value. If the value is too large -// for the target type, or the string is invalid, the result -// is undefined, and and_ok is set to false. -// Empty string is evaluated to zero. -u32 atf_amc::ch_Getnum(atf_amc::RpasU32Str6& parent, bool &and_ok) { - u64 val = 0; - algo::strptr str = ch_Getary(parent); - if (elems_N(str)>0) { // empty string maps to zero - u32 ok = 1; - val = aParseNum8(str, ok); - and_ok &= (ok != 0); +// --- atf_amc.TableId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void atf_amc::value_SetStrptr(atf_amc::TableId& parent, algo::strptr rhs, atf_amc_TableIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- atf_amc.TableId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::value_ReadStrptrMaybe(atf_amc::TableId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); } - return u32(val); + return retval; } -// --- atf_amc.RpasU32Str6.ch.GetnumDflt -// Convert field to numeric value. If the value is too large -// for the target type, or the string is invalid, return default value. -// Empty string is evaluated to zero. -u32 atf_amc::ch_GetnumDflt(atf_amc::RpasU32Str6& parent, u32 dflt) { - bool ok = true; - u32 result = ch_Getnum(parent, ok); - return ok ? result : dflt; +// --- atf_amc.TableId..ReadStrptrMaybe +// Read fields of atf_amc::TableId from an ascii string. +// The format of the string is the format of the atf_amc::TableId's only field +bool atf_amc::TableId_ReadStrptrMaybe(atf_amc::TableId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; } -// --- atf_amc.RpasU32Str6.ch.Geti64 -// Convert field to numeric value. If the value is too large -// for the target type, or the string is invalid, throw an exception. -// Empty string is evaluated to zero. -i64 atf_amc::ch_Geti64(atf_amc::RpasU32Str6& parent, bool &out_ok) { - out_ok = true; - i64 result = ch_Getnum(parent, out_ok); - return result; +// --- atf_amc.TableId..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.TableId.String printfmt:Raw +void atf_amc::TableId_Print(atf_amc::TableId& row, algo::cstring& str) { + atf_amc::value_Print(row, str); } -// --- atf_amc.RpasU32Str6.ch.SetnumMaybe -// Set string to number specified in RHS performing base-10 conversion. -// If the number is too large for the string, return false. -bool atf_amc::ch_SetnumMaybe(atf_amc::RpasU32Str6& parent, i64 rhs) { - char buf[128]; - int length = 0; - int charpos = 64; - u64 val = rhs; - length = algo::u32_FmtBuf(val, (u8*)buf + charpos); - bool retval = length <= 6; - if (retval) { - ch_SetStrptr(parent, algo::strptr(buf + charpos, length)); +// --- atf_amc.TaryU32.tary_u32.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr atf_amc::tary_u32_Addary(atf_amc::TaryU32& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.tary_u32_elems && rhs.elems < parent.tary_u32_elems + parent.tary_u32_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_amc.tary_alias field:atf_amc.TaryU32.tary_u32 comment:'alias error: sub-array is being appended to the whole'"); } - return retval; + int nnew = rhs.n_elems; + tary_u32_Reserve(parent, nnew); // reserve space + int at = parent.tary_u32_n; + memcpy(parent.tary_u32_elems + at, rhs.elems, nnew * sizeof(u32)); + parent.tary_u32_n += nnew; + return algo::aryptr(parent.tary_u32_elems + at, nnew); } -// --- atf_amc.RpasU32Str6..Hash -u32 atf_amc::RpasU32Str6_Hash(u32 prev, const atf_amc::RpasU32Str6& rhs) { - algo::strptr ch_strptr = ch_Getary(rhs); - prev = ::strptr_Hash(prev, ch_strptr); - return prev; +// --- atf_amc.TaryU32.tary_u32.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +u32& atf_amc::tary_u32_Alloc(atf_amc::TaryU32& parent) { + tary_u32_Reserve(parent, 1); + int n = parent.tary_u32_n; + int at = n; + u32 *elems = parent.tary_u32_elems; + new (elems + at) u32(44); // construct new element, default initializer + parent.tary_u32_n = n+1; + return elems[at]; } -// --- atf_amc.RpasU32Str6..ReadStrptrMaybe -// Read fields of atf_amc::RpasU32Str6 from an ascii string. -// The format of the string is the format of the atf_amc::RpasU32Str6's only field -bool atf_amc::RpasU32Str6_ReadStrptrMaybe(atf_amc::RpasU32Str6 &parent, algo::strptr in_str) { - bool retval = true; - retval = retval && ch_ReadStrptrMaybe(parent, in_str); - return retval; +// --- atf_amc.TaryU32.tary_u32.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +u32& atf_amc::tary_u32_AllocAt(atf_amc::TaryU32& parent, int at) { + tary_u32_Reserve(parent, 1); + int n = parent.tary_u32_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("atf_amc.bad_alloc_at field:atf_amc.TaryU32.tary_u32 comment:'index out of range'"); + } + u32 *elems = parent.tary_u32_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(u32)); + new (elems + at) u32(44); // construct element, default initializer + parent.tary_u32_n = n+1; + return elems[at]; } -// --- atf_amc.RpasU32Str6..Print -// print string representation of ROW to string STR -// cfmt:atf_amc.RpasU32Str6.String printfmt:Raw -void atf_amc::RpasU32Str6_Print(atf_amc::RpasU32Str6& row, algo::cstring& str) { - atf_amc::ch_Print(row, str); +// --- atf_amc.TaryU32.tary_u32.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr atf_amc::tary_u32_AllocN(atf_amc::TaryU32& parent, int n_elems) { + tary_u32_Reserve(parent, n_elems); + int old_n = parent.tary_u32_n; + int new_n = old_n + n_elems; + u32 *elems = parent.tary_u32_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) u32(44); // construct new element, default initialize + } + parent.tary_u32_n = new_n; + return algo::aryptr(elems + old_n, n_elems); } -// --- atf_amc.Sep1..ReadFieldMaybe -bool atf_amc::Sep1_ReadFieldMaybe(atf_amc::Sep1& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - atf_amc::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case atf_amc_FieldId_val1: { - retval = u32_ReadStrptrMaybe(parent.val1, strval); - break; - } - case atf_amc_FieldId_val2: { - retval = u32_ReadStrptrMaybe(parent.val2, strval); - break; - } - case atf_amc_FieldId_val3: { - retval = u32_ReadStrptrMaybe(parent.val3, strval); - break; - } - default: break; +// --- atf_amc.TaryU32.tary_u32.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr atf_amc::tary_u32_AllocNAt(atf_amc::TaryU32& parent, int n_elems, int at) { + tary_u32_Reserve(parent, n_elems); + int n = parent.tary_u32_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("atf_amc.bad_alloc_n_at field:atf_amc.TaryU32.tary_u32 comment:'index out of range'"); } - if (!retval) { - algo_lib::AppendErrtext("attr",field); + u32 *elems = parent.tary_u32_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u32)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) u32(44); // construct new element, default initialize } - return retval; + parent.tary_u32_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); } -// --- atf_amc.Sep1..ReadStrptrMaybe -// Read fields of atf_amc::Sep1 from an ascii string. -// The format of the string is a string with separated values -bool atf_amc::Sep1_ReadStrptrMaybe(atf_amc::Sep1 &parent, algo::strptr in_str) { - bool retval = true; - algo::strptr value; - - algo::NextSep(in_str, '-', value); - retval = retval && u32_ReadStrptrMaybe(parent.val1, value); - - algo::NextSep(in_str, '/', value); - retval = retval && u32_ReadStrptrMaybe(parent.val2, value); +// --- atf_amc.TaryU32.tary_u32.Remove +// Remove item by index. If index outside of range, do nothing. +void atf_amc::tary_u32_Remove(atf_amc::TaryU32& parent, u32 i) { + u32 lim = parent.tary_u32_n; + u32 *elems = parent.tary_u32_elems; + if (i < lim) { + memmove(elems + i, elems + (i + 1), sizeof(u32) * (lim - (i + 1))); + parent.tary_u32_n = lim - 1; + } +} - value = in_str; - retval = retval && u32_ReadStrptrMaybe(parent.val3, value); - return retval; +// --- atf_amc.TaryU32.tary_u32.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void atf_amc::tary_u32_RemoveLast(atf_amc::TaryU32& parent) { + u64 n = parent.tary_u32_n; + if (n > 0) { + n -= 1; + parent.tary_u32_n = n; + } } -// --- atf_amc.Sep1..Print -// print string representation of ROW to string STR -// cfmt:atf_amc.Sep1.String printfmt:Sep -void atf_amc::Sep1_Print(atf_amc::Sep1& row, algo::cstring& str) { - u32_Print(row.val1, str); - str << '-'; - u32_Print(row.val2, str); - str << '/'; - u32_Print(row.val3, str); +// --- atf_amc.TaryU32.tary_u32.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void atf_amc::tary_u32_AbsReserve(atf_amc::TaryU32& parent, int n) { + u32 old_max = parent.tary_u32_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.tary_u32_elems, old_max * sizeof(u32), new_max * sizeof(u32)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.tary_nomem field:atf_amc.TaryU32.tary_u32 comment:'out of memory'"); + } + parent.tary_u32_elems = (u32*)new_mem; + parent.tary_u32_max = new_max; + } } -// --- atf_amc.Seqmsg.msghdr.CopyOut -// Copy fields out of row -void atf_amc::parent_CopyOut(atf_amc::Seqmsg &row, atf_amc::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter +// --- atf_amc.TaryU32.tary_u32.Setary +// Copy contents of RHS to PARENT. +void atf_amc::tary_u32_Setary(atf_amc::TaryU32& parent, atf_amc::TaryU32 &rhs) { + tary_u32_RemoveAll(parent); + int nnew = rhs.tary_u32_n; + tary_u32_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.tary_u32_elems + i) u32(tary_u32_qFind(rhs, i)); + parent.tary_u32_n = i + 1; + } } -// --- atf_amc.Seqmsg.payload.Getary -// Access optional portion as an array of bytes -algo::aryptr atf_amc::payload_Getary(atf_amc::Seqmsg& parent) { - u8 *end = (u8*)&parent + sizeof(atf_amc::Seqmsg); - return algo::aryptr(end, i32(parent.length) - ssizeof(atf_amc::Seqmsg)); +// --- atf_amc.TaryU32.tary_u32.Setary2 +// Copy specified array into tary_u32, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void atf_amc::tary_u32_Setary(atf_amc::TaryU32& parent, const algo::aryptr &rhs) { + tary_u32_RemoveAll(parent); + tary_u32_Addary(parent, rhs); } -// --- atf_amc.Seqmsg.payload.Print -void atf_amc::payload_Print(atf_amc::Seqmsg& parent, cstring &out) { - (void)out; - (void)parent; - if (atf_amc::MsgHeader *payload = payload_Get(parent)) { - atf_amc::MsgHeaderMsgs_Print(out, *payload, INT_MAX); +// --- atf_amc.TaryU32.tary_u32.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr atf_amc::tary_u32_AllocNVal(atf_amc::TaryU32& parent, int n_elems, const u32& val) { + tary_u32_Reserve(parent, n_elems); + int old_n = parent.tary_u32_n; + int new_n = old_n + n_elems; + u32 *elems = parent.tary_u32_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) u32(val); } + parent.tary_u32_n = new_n; + return algo::aryptr(elems + old_n, n_elems); } -// --- atf_amc.Seqmsg.payload.ReadStrptrMaybe -// Convert string to field. Return success value -bool atf_amc::payload_ReadStrptrMaybe(atf_amc::Seqmsg &parent, algo::strptr in_str) { - bool retval = false; - if (algo_lib::_db.varlenbuf) { - algo::ByteAry temp; - retval = atf_amc::MsgHeaderMsgs_ReadStrptrMaybe(in_str, temp); // read any of several message types here - ary_Setary(*algo_lib::_db.varlenbuf, ary_Getary(temp)); // return it +// --- atf_amc.TaryU32.tary_u32.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool atf_amc::tary_u32_ReadStrptrMaybe(atf_amc::TaryU32& parent, algo::strptr in_str) { + bool retval = true; + u32 &elem = tary_u32_Alloc(parent); + retval = u32_ReadStrptrMaybe(elem, in_str); + if (!retval) { + tary_u32_RemoveLast(parent); } - (void)parent;//only to avoid -Wunused-parameter return retval; } -// --- atf_amc.Seqmsg..ReadFieldMaybe -bool atf_amc::Seqmsg_ReadFieldMaybe(atf_amc::Seqmsg& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - atf_amc::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case atf_amc_FieldId_msghdr: { - retval = false; - break; - } - case atf_amc_FieldId_type: { - retval = false; - break; - } - case atf_amc_FieldId_length: { - retval = false; - break; - } - case atf_amc_FieldId_payload: { - retval = payload_ReadStrptrMaybe(parent, strval); - break; - } - default: break; +// --- atf_amc.TaryU32.tary_u32.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void atf_amc::tary_u32_Insary(atf_amc::TaryU32& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.tary_u32_elems && rhs.elems < parent.tary_u32_elems + parent.tary_u32_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_amc.tary_alias field:atf_amc.TaryU32.tary_u32 comment:'alias error: sub-array is being appended to the whole'"); } - if (!retval) { - algo_lib::AppendErrtext("attr",field); + if (UNLIKELY(u64(at) >= u64(parent.tary_u32_elems+1))) { + FatalErrorExit("atf_amc.bad_insary field:atf_amc.TaryU32.tary_u32 comment:'index out of range'"); } - return retval; + int nnew = rhs.n_elems; + int nmove = parent.tary_u32_n - at; + tary_u32_Reserve(parent, nnew); // reserve space + memmove(parent.tary_u32_elems + at + nnew, parent.tary_u32_elems + at, nmove * sizeof(u32)); + memcpy(parent.tary_u32_elems + at, rhs.elems, nnew * sizeof(u32)); + parent.tary_u32_n += nnew; } -// --- atf_amc.Seqmsg..ReadStrptrMaybe -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of atf_amc::Seqmsg from an ascii string. -// The format of the string is an ssim Tuple -bool atf_amc::Seqmsg_ReadStrptrMaybe(atf_amc::Seqmsg &parent, algo::strptr in_str) { - bool retval = true; - retval = algo::StripTypeTag(in_str, "atf_amc.Seqmsg"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && Seqmsg_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; +// --- atf_amc.TaryU32..Uninit +void atf_amc::TaryU32_Uninit(atf_amc::TaryU32& parent) { + atf_amc::TaryU32 &row = parent; (void)row; + + // atf_amc.TaryU32.tary_u32.Uninit (Tary) // + // remove all elements from atf_amc.TaryU32.tary_u32 + tary_u32_RemoveAll(parent); + // free memory for Tary atf_amc.TaryU32.tary_u32 + algo_lib::malloc_FreeMem(parent.tary_u32_elems, sizeof(u32)*parent.tary_u32_max); // (atf_amc.TaryU32.tary_u32) } -// --- atf_amc.Seqmsg..Print -// print string representation of ROW to string STR -// cfmt:atf_amc.Seqmsg.String printfmt:Tuple -void atf_amc::Seqmsg_Print(atf_amc::Seqmsg& row, algo::cstring& str) { - algo::tempstr temp; - str << "atf_amc.Seqmsg"; +// --- atf_amc.TaryU32..AssignOp +atf_amc::TaryU32& atf_amc::TaryU32::operator =(const atf_amc::TaryU32 &rhs) { + tary_u32_Setary(*this, tary_u32_Getary(const_cast(rhs))); + return *this; +} - if (payload_Get(row)) { - atf_amc::payload_Print(row, temp); - PrintAttrSpaceReset(str,"payload", temp); +// --- atf_amc.TaryU32..CopyCtor + atf_amc::TaryU32::TaryU32(const atf_amc::TaryU32 &rhs) { + tary_u32_elems = 0; // (atf_amc.TaryU32.tary_u32) + tary_u32_n = 0; // (atf_amc.TaryU32.tary_u32) + tary_u32_max = 0; // (atf_amc.TaryU32.tary_u32) + tary_u32_Setary(*this, tary_u32_Getary(const_cast(rhs))); +} + +// --- atf_amc.TaryU8.ary.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr atf_amc::ary_Addary(atf_amc::TaryU8& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_amc.tary_alias field:atf_amc.TaryU8.ary comment:'alias error: sub-array is being appended to the whole'"); } + int nnew = rhs.n_elems; + ary_Reserve(parent, nnew); // reserve space + int at = parent.ary_n; + memcpy(parent.ary_elems + at, rhs.elems, nnew * sizeof(u8)); + parent.ary_n += nnew; + return algo::aryptr(parent.ary_elems + at, nnew); } -// --- atf_amc.SortedStr.novs.Nextchar -// Extract next character from STR and advance IDX -inline static int atf_amc::novs_Nextchar(const atf_amc::SortedStr& parent, algo::strptr &str, int &idx) { - (void)parent; - int i = idx; - int ch = str.elems[i]; - i++; - idx = i; - return ch; +// --- atf_amc.TaryU8.ary.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +u8& atf_amc::ary_Alloc(atf_amc::TaryU8& parent) { + ary_Reserve(parent, 1); + int n = parent.ary_n; + int at = n; + u8 *elems = parent.ary_elems; + new (elems + at) u8(44); // construct new element, default initializer + parent.ary_n = n+1; + return elems[at]; } -// --- atf_amc.SortedStr.vs.Nextchar -// Extract next character from STR and advance IDX -inline static u64 atf_amc::vs_Nextchar(const atf_amc::SortedStr& parent, algo::strptr &str, int &idx) { - (void)parent; - int i = idx; - u64 ch = str.elems[i]; - i++; - // detect number in string and eat it up into CH. - // (this only works for base-10 numbers - // Digits are sorted before chars - if (unsigned(ch - '0') < 10) { - while(i < str.n_elems) { // resulting char sorts before ascii 47 - unsigned dig = str.elems[i] - '0'; - if (dig >= 10) break; - ch = ch * 10 + dig; - i++; - } - } else if (ch > '9') { - // create space between '0'..'9' for 15-digit numbers - ch += 1000000000000000LL; +// --- atf_amc.TaryU8.ary.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +u8& atf_amc::ary_AllocAt(atf_amc::TaryU8& parent, int at) { + ary_Reserve(parent, 1); + int n = parent.ary_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("atf_amc.bad_alloc_at field:atf_amc.TaryU8.ary comment:'index out of range'"); } - idx = i; - return ch; + u8 *elems = parent.ary_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(u8)); + new (elems + at) u8(44); // construct element, default initializer + parent.ary_n = n+1; + return elems[at]; } -// --- atf_amc.SortedStr.vs.Cmp -// Compare two fields. -// Comparison uses version sort (detect embedded integers). -// Comparison is case-insensitive. -i32 atf_amc::vs_Cmp(atf_amc::SortedStr& parent, atf_amc::SortedStr &rhs) { - i32 retval = 0; - int idx_a = 0; - int idx_b = 0; - algo::strptr str_a = ch_Getary(parent.vs); - algo::strptr str_b = ch_Getary(rhs.vs); - int n_a = elems_N(str_a); - int n_b = elems_N(str_b); - retval = i32_Cmp(n_a,n_b); - while (idx_a < n_a && idx_b < n_b) { - u64 ch_a = vs_Nextchar(parent, str_a, idx_a); - u64 ch_b = vs_Nextchar(rhs, str_b, idx_b); - if (ch_a != ch_b) { - retval = (ch_a > ch_b)*2-1; - break; - } +// --- atf_amc.TaryU8.ary.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr atf_amc::ary_AllocN(atf_amc::TaryU8& parent, int n_elems) { + ary_Reserve(parent, n_elems); + int old_n = parent.ary_n; + int new_n = old_n + n_elems; + u8 *elems = parent.ary_elems; + memset(elems + old_n, 44, new_n - old_n); // initialize new space + parent.ary_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- atf_amc.TaryU8.ary.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr atf_amc::ary_AllocNAt(atf_amc::TaryU8& parent, int n_elems, int at) { + ary_Reserve(parent, n_elems); + int n = parent.ary_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("atf_amc.bad_alloc_n_at field:atf_amc.TaryU8.ary comment:'index out of range'"); } - return retval; + u8 *elems = parent.ary_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u8)); + memset(elems + at, 44, n_elems); // initialize new space + parent.ary_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); } -// --- atf_amc.SsimfilesCase.value.ToCstr -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -const char* atf_amc::value_ToCstr(const atf_amc::SsimfilesCase& parent) { - const char *ret = NULL; - switch(value_GetEnum(parent)) { - case atf_amc_SsimfilesCase_dmmeta_Ctype: ret = "dmmeta.Ctype"; break; +// --- atf_amc.TaryU8.ary.Remove +// Remove item by index. If index outside of range, do nothing. +void atf_amc::ary_Remove(atf_amc::TaryU8& parent, u32 i) { + u32 lim = parent.ary_n; + u8 *elems = parent.ary_elems; + if (i < lim) { + memmove(elems + i, elems + (i + 1), sizeof(u8) * (lim - (i + 1))); + parent.ary_n = lim - 1; } - return ret; } -// --- atf_amc.SsimfilesCase.value.Print -// Convert value to a string. First, attempt conversion to a known string. -// If no string matches, print value as a numeric value. -void atf_amc::value_Print(const atf_amc::SsimfilesCase& parent, algo::cstring &lhs) { - const char *strval = value_ToCstr(parent); - if (strval) { - lhs << strval; - } else { - lhs << parent.value; +// --- atf_amc.TaryU8.ary.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void atf_amc::ary_RemoveLast(atf_amc::TaryU8& parent) { + u64 n = parent.ary_n; + if (n > 0) { + n -= 1; + parent.ary_n = n; } } -// --- atf_amc.SsimfilesCase.value.SetStrptrMaybe -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -bool atf_amc::value_SetStrptrMaybe(atf_amc::SsimfilesCase& parent, algo::strptr rhs) { - bool ret = false; - switch (elems_N(rhs)) { - case 12: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('d','m','m','e','t','a','.','C'): { - if (memcmp(rhs.elems+8,"type",4)==0) { value_SetEnum(parent,atf_amc_SsimfilesCase_dmmeta_Ctype); ret = true; break; } - break; - } - case LE_STR8('d','m','m','e','t','a','.','c'): { - if (memcmp(rhs.elems+8,"type",4)==0) { value_SetEnum(parent,atf_amc_SsimfilesCase_dmmeta_ctype); ret = true; break; } - break; - } - } - break; +// --- atf_amc.TaryU8.ary.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void atf_amc::ary_AbsReserve(atf_amc::TaryU8& parent, int n) { + u32 old_max = parent.ary_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.ary_elems, old_max * sizeof(u8), new_max * sizeof(u8)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_amc.tary_nomem field:atf_amc.TaryU8.ary comment:'out of memory'"); } + parent.ary_elems = (u8*)new_mem; + parent.ary_max = new_max; } - return ret; } -// --- atf_amc.SsimfilesCase.value.SetStrptr -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -void atf_amc::value_SetStrptr(atf_amc::SsimfilesCase& parent, algo::strptr rhs, atf_amc_SsimfilesCaseEnum dflt) { - if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +// --- atf_amc.TaryU8.ary.Print +// Convert ary to a string. +// Array is printed as a regular string. +void atf_amc::ary_Print(atf_amc::TaryU8& parent, algo::cstring &rhs) { + rhs << algo::memptr_ToStrptr(ary_Getary(parent)); } -// --- atf_amc.SsimfilesCase.value.ReadStrptrMaybe -// Convert string to field. Return success value -bool atf_amc::value_ReadStrptrMaybe(atf_amc::SsimfilesCase& parent, algo::strptr rhs) { - bool retval = false; - retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion - if (!retval) { // didn't work? try reading as underlying type - retval = u32_ReadStrptrMaybe(parent.value,rhs); - } - return retval; +// --- atf_amc.TaryU8.ary.Setary +// Copy contents of RHS to PARENT. +void atf_amc::ary_Setary(atf_amc::TaryU8& parent, atf_amc::TaryU8 &rhs) { + ary_RemoveAll(parent); + int nnew = rhs.ary_n; + ary_Reserve(parent, nnew); // reserve space + memcpy(parent.ary_elems, rhs.ary_elems, nnew * sizeof(u8)); + parent.ary_n = nnew; } -// --- atf_amc.SsimfilesCase..ReadStrptrMaybe -// Read fields of atf_amc::SsimfilesCase from an ascii string. -// The format of the string is the format of the atf_amc::SsimfilesCase's only field -bool atf_amc::SsimfilesCase_ReadStrptrMaybe(atf_amc::SsimfilesCase &parent, algo::strptr in_str) { +// --- atf_amc.TaryU8.ary.Setary2 +// Copy specified array into ary, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void atf_amc::ary_Setary(atf_amc::TaryU8& parent, const algo::aryptr &rhs) { + ary_RemoveAll(parent); + ary_Addary(parent, rhs); +} + +// --- atf_amc.TaryU8.ary.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr atf_amc::ary_AllocNVal(atf_amc::TaryU8& parent, int n_elems, const u8& val) { + ary_Reserve(parent, n_elems); + int old_n = parent.ary_n; + int new_n = old_n + n_elems; + u8 *elems = parent.ary_elems; + memset(elems + old_n, val, new_n - old_n); // initialize new space + parent.ary_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- atf_amc.TaryU8.ary.ReadStrptrMaybe +// The array is replaced with the input string. Function always succeeds. +bool atf_amc::ary_ReadStrptrMaybe(atf_amc::TaryU8& parent, algo::strptr in_str) { bool retval = true; - retval = retval && value_ReadStrptrMaybe(parent, in_str); + ary_RemoveAll(parent); + ary_Addary(parent,algo::strptr_ToMemptr(in_str)); return retval; } -// --- atf_amc.TableId.value.ToCstr -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -const char* atf_amc::value_ToCstr(const atf_amc::TableId& parent) { - const char *ret = NULL; - switch(value_GetEnum(parent)) { - case atf_amc_TableId_atf_amc_TypeS : ret = "atf_amc.TypeS"; break; - case atf_amc_TableId_atf_amc_TypeT : ret = "atf_amc.TypeT"; break; +// --- atf_amc.TaryU8.ary.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void atf_amc::ary_Insary(atf_amc::TaryU8& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_amc.tary_alias field:atf_amc.TaryU8.ary comment:'alias error: sub-array is being appended to the whole'"); } - return ret; + if (UNLIKELY(u64(at) >= u64(parent.ary_elems+1))) { + FatalErrorExit("atf_amc.bad_insary field:atf_amc.TaryU8.ary comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.ary_n - at; + ary_Reserve(parent, nnew); // reserve space + memmove(parent.ary_elems + at + nnew, parent.ary_elems + at, nmove * sizeof(u8)); + memcpy(parent.ary_elems + at, rhs.elems, nnew * sizeof(u8)); + parent.ary_n += nnew; } -// --- atf_amc.TableId.value.Print -// Convert value to a string. First, attempt conversion to a known string. -// If no string matches, print value as a numeric value. -void atf_amc::value_Print(const atf_amc::TableId& parent, algo::cstring &lhs) { - const char *strval = value_ToCstr(parent); - if (strval) { - lhs << strval; - } else { - lhs << parent.value; - } +// --- atf_amc.TaryU8..Uninit +void atf_amc::TaryU8_Uninit(atf_amc::TaryU8& parent) { + atf_amc::TaryU8 &row = parent; (void)row; + + // atf_amc.TaryU8.ary.Uninit (Tary) // + // remove all elements from atf_amc.TaryU8.ary + ary_RemoveAll(parent); + // free memory for Tary atf_amc.TaryU8.ary + algo_lib::malloc_FreeMem(parent.ary_elems, sizeof(u8)*parent.ary_max); // (atf_amc.TaryU8.ary) } -// --- atf_amc.TableId.value.SetStrptrMaybe -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -bool atf_amc::value_SetStrptrMaybe(atf_amc::TableId& parent, algo::strptr rhs) { - bool ret = false; - switch (elems_N(rhs)) { - case 13: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','t','f','_','a','m','c','.'): { - if (memcmp(rhs.elems+8,"TypeS",5)==0) { value_SetEnum(parent,atf_amc_TableId_atf_amc_TypeS); ret = true; break; } - if (memcmp(rhs.elems+8,"TypeT",5)==0) { value_SetEnum(parent,atf_amc_TableId_atf_amc_TypeT); ret = true; break; } - break; - } - } - break; - } - } - return ret; +// --- atf_amc.TaryU8..AssignOp +atf_amc::TaryU8& atf_amc::TaryU8::operator =(const atf_amc::TaryU8 &rhs) { + ary_Setary(*this, ary_Getary(const_cast(rhs))); + return *this; } -// --- atf_amc.TableId.value.SetStrptr -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -void atf_amc::value_SetStrptr(atf_amc::TableId& parent, algo::strptr rhs, atf_amc_TableIdEnum dflt) { - if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +// --- atf_amc.TaryU8..CopyCtor + atf_amc::TaryU8::TaryU8(const atf_amc::TaryU8 &rhs) { + ary_elems = 0; // (atf_amc.TaryU8.ary) + ary_n = 0; // (atf_amc.TaryU8.ary) + ary_max = 0; // (atf_amc.TaryU8.ary) + ary_Setary(*this, ary_Getary(const_cast(rhs))); } -// --- atf_amc.TableId.value.ReadStrptrMaybe +// --- atf_amc.TestRegx1.val.Print +// Print back to string +void atf_amc::val_Print(atf_amc::TestRegx1& parent, algo::cstring &out) { + Regx_Print(parent.val, out); +} + +// --- atf_amc.TestRegx1.val.ReadStrptrMaybe +// Read Regx from string // Convert string to field. Return success value -bool atf_amc::value_ReadStrptrMaybe(atf_amc::TableId& parent, algo::strptr rhs) { - bool retval = false; - retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion - if (!retval) { // didn't work? try reading as underlying type - retval = i32_ReadStrptrMaybe(parent.value,rhs); - } +bool atf_amc::val_ReadStrptrMaybe(atf_amc::TestRegx1& parent, algo::strptr in) { + bool retval = true; + Regx_ReadSql(parent.val, in, true); return retval; } -// --- atf_amc.TableId..ReadStrptrMaybe -// Read fields of atf_amc::TableId from an ascii string. -// The format of the string is the format of the atf_amc::TableId's only field -bool atf_amc::TableId_ReadStrptrMaybe(atf_amc::TableId &parent, algo::strptr in_str) { +// --- atf_amc.TestRegx1..ReadFieldMaybe +bool atf_amc::TestRegx1_ReadFieldMaybe(atf_amc::TestRegx1& parent, algo::strptr field, algo::strptr strval) { bool retval = true; - retval = retval && value_ReadStrptrMaybe(parent, in_str); + atf_amc::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case atf_amc_FieldId_val: { + retval = val_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } return retval; } -// --- atf_amc.TableId..Print -// print string representation of ROW to string STR -// cfmt:atf_amc.TableId.String printfmt:Raw -void atf_amc::TableId_Print(atf_amc::TableId& row, algo::cstring& str) { - atf_amc::value_Print(row, str); +// --- atf_amc.TestRegx1..ReadStrptrMaybe +// Read fields of atf_amc::TestRegx1 from an ascii string. +// The format of the string is an ssim Tuple +bool atf_amc::TestRegx1_ReadStrptrMaybe(atf_amc::TestRegx1 &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "atf_amc.TestRegx1"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && TestRegx1_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; } -// --- atf_amc.TaryU32.tary_u32.Addary -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -algo::aryptr atf_amc::tary_u32_Addary(atf_amc::TaryU32& parent, algo::aryptr rhs) { - bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.tary_u32_elems && rhs.elems < parent.tary_u32_elems + parent.tary_u32_max; - if (UNLIKELY(overlaps)) { - FatalErrorExit("atf_amc.tary_alias field:atf_amc.TaryU32.tary_u32 comment:'alias error: sub-array is being appended to the whole'"); - } - int nnew = rhs.n_elems; - tary_u32_Reserve(parent, nnew); // reserve space - int at = parent.tary_u32_n; - memcpy(parent.tary_u32_elems + at, rhs.elems, nnew * sizeof(u32)); - parent.tary_u32_n += nnew; - return algo::aryptr(parent.tary_u32_elems + at, nnew); -} +// --- atf_amc.TestRegx1..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.TestRegx1.String printfmt:Tuple +void atf_amc::TestRegx1_Print(atf_amc::TestRegx1& row, algo::cstring& str) { + algo::tempstr temp; + str << "atf_amc.TestRegx1"; -// --- atf_amc.TaryU32.tary_u32.Alloc -// Reserve space. Insert element at the end -// The new element is initialized to a default value -u32& atf_amc::tary_u32_Alloc(atf_amc::TaryU32& parent) { - tary_u32_Reserve(parent, 1); - int n = parent.tary_u32_n; - int at = n; - u32 *elems = parent.tary_u32_elems; - new (elems + at) u32(44); // construct new element, default initializer - parent.tary_u32_n = n+1; - return elems[at]; + atf_amc::val_Print(row, temp); + PrintAttrSpaceReset(str,"val", temp); } -// --- atf_amc.TaryU32.tary_u32.AllocAt -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -u32& atf_amc::tary_u32_AllocAt(atf_amc::TaryU32& parent, int at) { - tary_u32_Reserve(parent, 1); - int n = parent.tary_u32_n; - if (UNLIKELY(u64(at) >= u64(n+1))) { - FatalErrorExit("atf_amc.bad_alloc_at field:atf_amc.TaryU32.tary_u32 comment:'index out of range'"); - } - u32 *elems = parent.tary_u32_elems; - memmove(elems + at + 1, elems + at, (n - at) * sizeof(u32)); - new (elems + at) u32(44); // construct element, default initializer - parent.tary_u32_n = n+1; - return elems[at]; +// --- atf_amc.TestType..ReadStrptrMaybe +// Read fields of atf_amc::TestType from an ascii string. +bool atf_amc::TestType_ReadStrptrMaybe(atf_amc::TestType &parent, algo::strptr in_str) { + bool retval = true; + (void)parent;//only to avoid -Wunused-parameter + (void)in_str;//only to avoid -Wunused-parameter + return retval; } -// --- atf_amc.TaryU32.tary_u32.AllocN -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr atf_amc::tary_u32_AllocN(atf_amc::TaryU32& parent, int n_elems) { - tary_u32_Reserve(parent, n_elems); - int old_n = parent.tary_u32_n; - int new_n = old_n + n_elems; - u32 *elems = parent.tary_u32_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) u32(44); // construct new element, default initialize - } - parent.tary_u32_n = new_n; - return algo::aryptr(elems + old_n, n_elems); +// --- atf_amc.TestType..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.TestType.String printfmt:Raw +void atf_amc::TestType_Print(atf_amc::TestType& row, algo::cstring& str) { + (void)row;//only to avoid -Wunused-parameter + (void)str;//only to avoid -Wunused-parameter } -// --- atf_amc.TaryU32.tary_u32.Remove -// Remove item by index. If index outside of range, do nothing. -void atf_amc::tary_u32_Remove(atf_amc::TaryU32& parent, u32 i) { - u32 lim = parent.tary_u32_n; - u32 *elems = parent.tary_u32_elems; - if (i < lim) { - memmove(elems + i, elems + (i + 1), sizeof(u32) * (lim - (i + 1))); - parent.tary_u32_n = lim - 1; - } +// --- atf_amc.Text.msghdr.CopyOut +// Copy fields out of row +void atf_amc::parent_CopyOut(atf_amc::Text &row, atf_amc::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter } -// --- atf_amc.TaryU32.tary_u32.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void atf_amc::tary_u32_RemoveLast(atf_amc::TaryU32& parent) { - u64 n = parent.tary_u32_n; - if (n > 0) { - n -= 1; - parent.tary_u32_n = n; - } +// --- atf_amc.Text.text.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::text_Getary(atf_amc::Text& parent) { + return algo::aryptr(text_Addr(parent), text_N(parent)); } -// --- atf_amc.TaryU32.tary_u32.AbsReserve -// Make sure N elements fit in array. Process dies if out of memory -void atf_amc::tary_u32_AbsReserve(atf_amc::TaryU32& parent, int n) { - u32 old_max = parent.tary_u32_max; - if (n > i32(old_max)) { - u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); - void *new_mem = algo_lib::malloc_ReallocMem(parent.tary_u32_elems, old_max * sizeof(u32), new_max * sizeof(u32)); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("atf_amc.tary_nomem field:atf_amc.TaryU32.tary_u32 comment:'out of memory'"); - } - parent.tary_u32_elems = (u32*)new_mem; - parent.tary_u32_max = new_max; - } +// --- atf_amc.Text.text.Addr +char* atf_amc::text_Addr(atf_amc::Text& parent) { + return (char*)((u8*)&parent + sizeof(atf_amc::Text)); // address of varlen portion } -// --- atf_amc.TaryU32.tary_u32.Setary -// Copy contents of RHS to PARENT. -void atf_amc::tary_u32_Setary(atf_amc::TaryU32& parent, atf_amc::TaryU32 &rhs) { - tary_u32_RemoveAll(parent); - int nnew = rhs.tary_u32_n; - tary_u32_Reserve(parent, nnew); // reserve space - for (int i = 0; i < nnew; i++) { // copy elements over - new (parent.tary_u32_elems + i) u32(tary_u32_qFind(rhs, i)); - parent.tary_u32_n = i + 1; +// --- atf_amc.Text.text.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::text_ReadStrptrMaybe(atf_amc::Text& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); } + (void)parent;//only to avoid -Wunused-parameter + return retval; } -// --- atf_amc.TaryU32.tary_u32.Setary2 -// Copy specified array into tary_u32, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -void atf_amc::tary_u32_Setary(atf_amc::TaryU32& parent, const algo::aryptr &rhs) { - tary_u32_RemoveAll(parent); - tary_u32_Addary(parent, rhs); -} - -// --- atf_amc.TaryU32.tary_u32.AllocNVal -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr atf_amc::tary_u32_AllocNVal(atf_amc::TaryU32& parent, int n_elems, const u32& val) { - tary_u32_Reserve(parent, n_elems); - int old_n = parent.tary_u32_n; - int new_n = old_n + n_elems; - u32 *elems = parent.tary_u32_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) u32(val); - } - parent.tary_u32_n = new_n; - return algo::aryptr(elems + old_n, n_elems); +// --- atf_amc.Text.text.Print +// Convert text to a string. +// Array is printed as a regular string. +void atf_amc::text_Print(atf_amc::Text& parent, algo::cstring &rhs) { + rhs << text_Getary(parent); } -// --- atf_amc.TaryU32.tary_u32.ReadStrptrMaybe -// A single element is read from input string and appended to the array. -// If the string contains an error, the array is untouched. -// Function returns success value. -bool atf_amc::tary_u32_ReadStrptrMaybe(atf_amc::TaryU32& parent, algo::strptr in_str) { +// --- atf_amc.Text..ReadFieldMaybe +bool atf_amc::Text_ReadFieldMaybe(atf_amc::Text& parent, algo::strptr field, algo::strptr strval) { bool retval = true; - u32 &elem = tary_u32_Alloc(parent); - retval = u32_ReadStrptrMaybe(elem, in_str); + atf_amc::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case atf_amc_FieldId_msghdr: { + retval = false; + } break; + case atf_amc_FieldId_type: { + retval = false; + } break; + case atf_amc_FieldId_length: { + retval = false; + } break; + case atf_amc_FieldId_text: { + retval = text_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } if (!retval) { - tary_u32_RemoveLast(parent); + algo_lib::AppendErrtext("attr",field); } return retval; } -// --- atf_amc.TaryU32..Uninit -void atf_amc::TaryU32_Uninit(atf_amc::TaryU32& parent) { - atf_amc::TaryU32 &row = parent; (void)row; - - // atf_amc.TaryU32.tary_u32.Uninit (Tary) // - // remove all elements from atf_amc.TaryU32.tary_u32 - tary_u32_RemoveAll(parent); - // free memory for Tary atf_amc.TaryU32.tary_u32 - algo_lib::malloc_FreeMem(parent.tary_u32_elems, sizeof(u32)*parent.tary_u32_max); // (atf_amc.TaryU32.tary_u32) +// --- atf_amc.Text..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::Text from an ascii string. +// The format of the string is an ssim Tuple +bool atf_amc::Text_ReadStrptrMaybe(atf_amc::Text &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "atf_amc.Text"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Text_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; } -// --- atf_amc.TaryU32..AssignOp -atf_amc::TaryU32& atf_amc::TaryU32::operator =(const atf_amc::TaryU32 &rhs) { - tary_u32_Setary(*this, tary_u32_Getary(const_cast(rhs))); - return *this; -} +// --- atf_amc.Text..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.Text.String printfmt:Tuple +void atf_amc::Text_Print(atf_amc::Text& row, algo::cstring& str) { + algo::tempstr temp; + str << "atf_amc.Text"; -// --- atf_amc.TaryU32..CopyCtor - atf_amc::TaryU32::TaryU32(const atf_amc::TaryU32 &rhs) { - tary_u32_elems = 0; // (atf_amc.TaryU32.tary_u32) - tary_u32_n = 0; // (atf_amc.TaryU32.tary_u32) - tary_u32_max = 0; // (atf_amc.TaryU32.tary_u32) - tary_u32_Setary(*this, tary_u32_Getary(const_cast(rhs))); + atf_amc::text_Print(row, temp); + PrintAttrSpaceReset(str,"text", temp); } -// --- atf_amc.TaryU8.ary.Addary -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -algo::aryptr atf_amc::ary_Addary(atf_amc::TaryU8& parent, algo::aryptr rhs) { - bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.ary_elems && rhs.elems < parent.ary_elems + parent.ary_max; - if (UNLIKELY(overlaps)) { - FatalErrorExit("atf_amc.tary_alias field:atf_amc.TaryU8.ary comment:'alias error: sub-array is being appended to the whole'"); +// --- atf_amc.TypeB..ReadFieldMaybe +bool atf_amc::TypeB_ReadFieldMaybe(atf_amc::TypeB& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + atf_amc::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case atf_amc_FieldId_typea: { + retval = i32_ReadStrptrMaybe(parent.typea, strval); + } break; + case atf_amc_FieldId_j: { + retval = i32_ReadStrptrMaybe(parent.j, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } - int nnew = rhs.n_elems; - ary_Reserve(parent, nnew); // reserve space - int at = parent.ary_n; - memcpy(parent.ary_elems + at, rhs.elems, nnew * sizeof(u8)); - parent.ary_n += nnew; - return algo::aryptr(parent.ary_elems + at, nnew); + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; } -// --- atf_amc.TaryU8.ary.Alloc -// Reserve space. Insert element at the end -// The new element is initialized to a default value -u8& atf_amc::ary_Alloc(atf_amc::TaryU8& parent) { - ary_Reserve(parent, 1); - int n = parent.ary_n; - int at = n; - u8 *elems = parent.ary_elems; - new (elems + at) u8(44); // construct new element, default initializer - parent.ary_n = n+1; - return elems[at]; +// --- atf_amc.TypeB..ReadStrptrMaybe +// Read fields of atf_amc::TypeB from an ascii string. +// The format of the string is an ssim Tuple +bool atf_amc::TypeB_ReadStrptrMaybe(atf_amc::TypeB &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "atf_amc.TypeB"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && TypeB_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; } -// --- atf_amc.TaryU8.ary.AllocAt -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -u8& atf_amc::ary_AllocAt(atf_amc::TaryU8& parent, int at) { - ary_Reserve(parent, 1); - int n = parent.ary_n; - if (UNLIKELY(u64(at) >= u64(n+1))) { - FatalErrorExit("atf_amc.bad_alloc_at field:atf_amc.TaryU8.ary comment:'index out of range'"); - } - u8 *elems = parent.ary_elems; - memmove(elems + at + 1, elems + at, (n - at) * sizeof(u8)); - new (elems + at) u8(44); // construct element, default initializer - parent.ary_n = n+1; - return elems[at]; +// --- atf_amc.TypeB..FmtJson +// Create JSON representation of atf_amc::TypeB under PARENT node +// cfmt:atf_amc.TypeB.Json printfmt:Auto +lib_json::FNode * atf_amc::TypeB_FmtJson(atf_amc::TypeB& row, lib_json::FNode *parent) { + lib_json::FNode *object_node = &lib_json::node_Alloc(); + object_node->p_parent = parent?parent:object_node; + object_node->type = lib_json_FNode_type_object; + node_XrefMaybe(*object_node); + + lib_json::FNode *typea_field_node = &lib_json::node_Alloc(); + typea_field_node->p_parent = object_node; + typea_field_node->type = lib_json_FNode_type_field; + typea_field_node->value = "typea"; + node_XrefMaybe(*typea_field_node); + i32_FmtJson(const_cast(row).typea,typea_field_node); + + lib_json::FNode *j_field_node = &lib_json::node_Alloc(); + j_field_node->p_parent = object_node; + j_field_node->type = lib_json_FNode_type_field; + j_field_node->value = "j"; + node_XrefMaybe(*j_field_node); + i32_FmtJson(const_cast(row).j,j_field_node); + return object_node; } -// --- atf_amc.TaryU8.ary.AllocN -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr atf_amc::ary_AllocN(atf_amc::TaryU8& parent, int n_elems) { - ary_Reserve(parent, n_elems); - int old_n = parent.ary_n; - int new_n = old_n + n_elems; - u8 *elems = parent.ary_elems; - memset(elems + old_n, 44, new_n - old_n); // initialize new space - parent.ary_n = new_n; - return algo::aryptr(elems + old_n, n_elems); +// --- atf_amc.TypeB..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.TypeB.String printfmt:Tuple +void atf_amc::TypeB_Print(atf_amc::TypeB& row, algo::cstring& str) { + algo::tempstr temp; + str << "atf_amc.TypeB"; + + i32_Print(row.typea, temp); + PrintAttrSpaceReset(str,"typea", temp); + + i32_Print(row.j, temp); + PrintAttrSpaceReset(str,"j", temp); } -// --- atf_amc.TaryU8.ary.Remove -// Remove item by index. If index outside of range, do nothing. -void atf_amc::ary_Remove(atf_amc::TaryU8& parent, u32 i) { - u32 lim = parent.ary_n; - u8 *elems = parent.ary_elems; - if (i < lim) { - memmove(elems + i, elems + (i + 1), sizeof(u8) * (lim - (i + 1))); - parent.ary_n = lim - 1; +// --- atf_amc.TypeBE32en.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* atf_amc::value_ToCstr(const atf_amc::TypeBE32en& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case atf_amc_TypeBE32en_value_val1 : ret = "val1"; break; + case atf_amc_TypeBE32en_value_val2 : ret = "val2"; break; } + return ret; } -// --- atf_amc.TaryU8.ary.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void atf_amc::ary_RemoveLast(atf_amc::TaryU8& parent) { - u64 n = parent.ary_n; - if (n > 0) { - n -= 1; - parent.ary_n = n; +// --- atf_amc.TypeBE32en.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void atf_amc::value_Print(const atf_amc::TypeBE32en& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << value_Get(parent); } } -// --- atf_amc.TaryU8.ary.AbsReserve -// Make sure N elements fit in array. Process dies if out of memory -void atf_amc::ary_AbsReserve(atf_amc::TaryU8& parent, int n) { - u32 old_max = parent.ary_max; - if (n > i32(old_max)) { - u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); - void *new_mem = algo_lib::malloc_ReallocMem(parent.ary_elems, old_max * sizeof(u8), new_max * sizeof(u8)); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("atf_amc.tary_nomem field:atf_amc.TaryU8.ary comment:'out of memory'"); +// --- atf_amc.TypeBE32en.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool atf_amc::value_SetStrptrMaybe(atf_amc::TypeBE32en& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('v','a','l','1'): { + value_SetEnum(parent,atf_amc_TypeBE32en_value_val1); ret = true; break; + } + case LE_STR4('v','a','l','2'): { + value_SetEnum(parent,atf_amc_TypeBE32en_value_val2); ret = true; break; + } + } + break; } - parent.ary_elems = (u8*)new_mem; - parent.ary_max = new_max; } + return ret; } -// --- atf_amc.TaryU8.ary.Print -// Convert ary to a string. -// Array is printed as a regular string. -void atf_amc::ary_Print(atf_amc::TaryU8& parent, algo::cstring &rhs) { - rhs << algo::memptr_ToStrptr(ary_Getary(parent)); -} - -// --- atf_amc.TaryU8.ary.Setary -// Copy contents of RHS to PARENT. -void atf_amc::ary_Setary(atf_amc::TaryU8& parent, atf_amc::TaryU8 &rhs) { - ary_RemoveAll(parent); - int nnew = rhs.ary_n; - ary_Reserve(parent, nnew); // reserve space - memcpy(parent.ary_elems, rhs.ary_elems, nnew * sizeof(u8)); - parent.ary_n = nnew; -} - -// --- atf_amc.TaryU8.ary.Setary2 -// Copy specified array into ary, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -void atf_amc::ary_Setary(atf_amc::TaryU8& parent, const algo::aryptr &rhs) { - ary_RemoveAll(parent); - ary_Addary(parent, rhs); +// --- atf_amc.TypeBE32en.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void atf_amc::value_SetStrptr(atf_amc::TypeBE32en& parent, algo::strptr rhs, atf_amc_TypeBE32en_value_Enum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); } -// --- atf_amc.TaryU8.ary.AllocNVal -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr atf_amc::ary_AllocNVal(atf_amc::TaryU8& parent, int n_elems, const u8& val) { - ary_Reserve(parent, n_elems); - int old_n = parent.ary_n; - int new_n = old_n + n_elems; - u8 *elems = parent.ary_elems; - memset(elems + old_n, val, new_n - old_n); // initialize new space - parent.ary_n = new_n; - return algo::aryptr(elems + old_n, n_elems); +// --- atf_amc.TypeBE32en.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::value_ReadStrptrMaybe(atf_amc::TypeBE32en& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + u32 value_tmp; + retval = u32_ReadStrptrMaybe(value_tmp, rhs); + if (retval) { + value_Set(parent, value_tmp); + } + } + return retval; } -// --- atf_amc.TaryU8.ary.ReadStrptrMaybe -// The array is replaced with the input string. Function always succeeds. -bool atf_amc::ary_ReadStrptrMaybe(atf_amc::TaryU8& parent, algo::strptr in_str) { +// --- atf_amc.TypeBE32en..ReadFieldMaybe +bool atf_amc::TypeBE32en_ReadFieldMaybe(atf_amc::TypeBE32en& parent, algo::strptr field, algo::strptr strval) { bool retval = true; - ary_RemoveAll(parent); - ary_Addary(parent,algo::strptr_ToMemptr(in_str)); + atf_amc::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case atf_amc_FieldId_value: { + retval = value_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } return retval; } -// --- atf_amc.TaryU8..Uninit -void atf_amc::TaryU8_Uninit(atf_amc::TaryU8& parent) { - atf_amc::TaryU8 &row = parent; (void)row; - - // atf_amc.TaryU8.ary.Uninit (Tary) // - // remove all elements from atf_amc.TaryU8.ary - ary_RemoveAll(parent); - // free memory for Tary atf_amc.TaryU8.ary - algo_lib::malloc_FreeMem(parent.ary_elems, sizeof(u8)*parent.ary_max); // (atf_amc.TaryU8.ary) -} - -// --- atf_amc.TaryU8..AssignOp -atf_amc::TaryU8& atf_amc::TaryU8::operator =(const atf_amc::TaryU8 &rhs) { - ary_Setary(*this, ary_Getary(const_cast(rhs))); - return *this; +// --- atf_amc.TypeBE32en..ReadStrptrMaybe +// Read fields of atf_amc::TypeBE32en from an ascii string. +// The format of the string is the format of the atf_amc::TypeBE32en's only field +bool atf_amc::TypeBE32en_ReadStrptrMaybe(atf_amc::TypeBE32en &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; } -// --- atf_amc.TaryU8..CopyCtor - atf_amc::TaryU8::TaryU8(const atf_amc::TaryU8 &rhs) { - ary_elems = 0; // (atf_amc.TaryU8.ary) - ary_n = 0; // (atf_amc.TaryU8.ary) - ary_max = 0; // (atf_amc.TaryU8.ary) - ary_Setary(*this, ary_Getary(const_cast(rhs))); +// --- atf_amc.TypeBE32en..ReadTupleMaybe +// Read fields of atf_amc::TypeBE32en from attributes of ascii tuple TUPLE +bool atf_amc::TypeBE32en_ReadTupleMaybe(atf_amc::TypeBE32en &parent, algo::Tuple &tuple) { + bool retval = true; + ind_beg(algo::Tuple_attrs_curs,attr,tuple) { + retval = TypeBE32en_ReadFieldMaybe(parent, attr.name, attr.value); + if (!retval) { + break; + } + }ind_end; + return retval; } -// --- atf_amc.TestRegx1.val.Print -// Print back to string -void atf_amc::val_Print(atf_amc::TestRegx1& parent, algo::cstring &out) { - Regx_Print(parent.val, out); +// --- atf_amc.TypeBE32en..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.TypeBE32en.String printfmt:Raw +void atf_amc::TypeBE32en_Print(atf_amc::TypeBE32en& row, algo::cstring& str) { + atf_amc::value_Print(row, str); } -// --- atf_amc.TestRegx1.val.ReadStrptrMaybe -// Read Regx from string -// Convert string to field. Return success value -bool atf_amc::val_ReadStrptrMaybe(atf_amc::TestRegx1& parent, algo::strptr in) { +// --- atf_amc.TypeBE64.value.ReadStrptrMaybe +inline static bool atf_amc::value_ReadStrptrMaybe(atf_amc::TypeBE64 &parent, algo::strptr in_str) { bool retval = true; - Regx_ReadSql(parent.val, in, true); + u64 value_tmp; + retval = u64_ReadStrptrMaybe(value_tmp, in_str); + if (retval) { + value_Set(parent, value_tmp); + } return retval; } -// --- atf_amc.TestRegx1..ReadFieldMaybe -bool atf_amc::TestRegx1_ReadFieldMaybe(atf_amc::TestRegx1& parent, algo::strptr field, algo::strptr strval) { +// --- atf_amc.TypeBE64..ReadFieldMaybe +bool atf_amc::TypeBE64_ReadFieldMaybe(atf_amc::TypeBE64& parent, algo::strptr field, algo::strptr strval) { bool retval = true; atf_amc::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case atf_amc_FieldId_val: { - retval = val_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + case atf_amc_FieldId_value: { + retval = value_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -15654,107 +17811,132 @@ bool atf_amc::TestRegx1_ReadFieldMaybe(atf_amc::TestRegx1& parent, algo::strptr return retval; } -// --- atf_amc.TestRegx1..ReadStrptrMaybe -// Read fields of atf_amc::TestRegx1 from an ascii string. -// The format of the string is an ssim Tuple -bool atf_amc::TestRegx1_ReadStrptrMaybe(atf_amc::TestRegx1 &parent, algo::strptr in_str) { +// --- atf_amc.TypeBE64..ReadStrptrMaybe +// Read fields of atf_amc::TypeBE64 from an ascii string. +// The format of the string is the format of the atf_amc::TypeBE64's only field +bool atf_amc::TypeBE64_ReadStrptrMaybe(atf_amc::TypeBE64 &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "atf_amc.TestRegx1"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && TestRegx1_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- atf_amc.TypeBE64..ReadTupleMaybe +// Read fields of atf_amc::TypeBE64 from attributes of ascii tuple TUPLE +bool atf_amc::TypeBE64_ReadTupleMaybe(atf_amc::TypeBE64 &parent, algo::Tuple &tuple) { + bool retval = true; + ind_beg(algo::Tuple_attrs_curs,attr,tuple) { + retval = TypeBE64_ReadFieldMaybe(parent, attr.name, attr.value); + if (!retval) { + break; + } }ind_end; return retval; } -// --- atf_amc.TestRegx1..Print +// --- atf_amc.TypeBE64..Print // print string representation of ROW to string STR -// cfmt:atf_amc.TestRegx1.String printfmt:Tuple -void atf_amc::TestRegx1_Print(atf_amc::TestRegx1& row, algo::cstring& str) { - algo::tempstr temp; - str << "atf_amc.TestRegx1"; - - atf_amc::val_Print(row, temp); - PrintAttrSpaceReset(str,"val", temp); +// cfmt:atf_amc.TypeBE64.String printfmt:Raw +void atf_amc::TypeBE64_Print(atf_amc::TypeBE64& row, algo::cstring& str) { + u64_Print(value_Get(row), str); } -// --- atf_amc.TestType..ReadStrptrMaybe -// Read fields of atf_amc::TestType from an ascii string. -bool atf_amc::TestType_ReadStrptrMaybe(atf_amc::TestType &parent, algo::strptr in_str) { +// --- atf_amc.TypeC..ReadStrptrMaybe +// Read fields of atf_amc::TypeC from an ascii string. +// The format of the string is the format of the atf_amc::TypeC's only field +bool atf_amc::TypeC_ReadStrptrMaybe(atf_amc::TypeC &parent, algo::strptr in_str) { bool retval = true; - (void)parent;//only to avoid -Wunused-parameter - (void)in_str;//only to avoid -Wunused-parameter + retval = retval && i32_ReadStrptrMaybe(parent.typec, in_str); return retval; } -// --- atf_amc.TestType..Print +// --- atf_amc.TypeC..Print // print string representation of ROW to string STR -// cfmt:atf_amc.TestType.String printfmt:Raw -void atf_amc::TestType_Print(atf_amc::TestType& row, algo::cstring& str) { - (void)row;//only to avoid -Wunused-parameter - (void)str;//only to avoid -Wunused-parameter +// cfmt:atf_amc.TypeC.String printfmt:Raw +void atf_amc::TypeC_Print(atf_amc::TypeC& row, algo::cstring& str) { + i32_Print(row.typec, str); } -// --- atf_amc.Text.msghdr.CopyOut -// Copy fields out of row -void atf_amc::parent_CopyOut(atf_amc::Text &row, atf_amc::MsgHeader &out) { - // type: field value is computed - // length: field value is computed - (void)row;//only to avoid -Wunused-parameter - (void)out;//only to avoid -Wunused-parameter +// --- atf_amc.TypeH..ReadStrptrMaybe +// Read fields of atf_amc::TypeH from an ascii string. +// The format of the string is the format of the atf_amc::TypeH's only field +bool atf_amc::TypeH_ReadStrptrMaybe(atf_amc::TypeH &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && i32_ReadStrptrMaybe(parent.typeh, in_str); + return retval; } -// --- atf_amc.Text.text.Getary -// Access var-length portion as an aryptr. Length is determined from one of the fields. -algo::aryptr atf_amc::text_Getary(atf_amc::Text& parent) { - return algo::aryptr(text_Addr(parent), text_N(parent)); +// --- atf_amc.TypeH..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.TypeH.String printfmt:Raw +void atf_amc::TypeH_Print(atf_amc::TypeH& row, algo::cstring& str) { + i32_Print(row.typeh, str); } -// --- atf_amc.Text.text.Addr -char* atf_amc::text_Addr(atf_amc::Text& parent) { - return (char*)((u8*)&parent + sizeof(atf_amc::Text)); // address of varlen portion +// --- atf_amc.TypeS..ReadFieldMaybe +bool atf_amc::TypeS_ReadFieldMaybe(atf_amc::TypeS& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + atf_amc::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case atf_amc_FieldId_types: { + retval = i32_ReadStrptrMaybe(parent.types, strval); + } break; + case atf_amc_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; } -// --- atf_amc.Text.text.ReadStrptrMaybe -// Convert string to field. Return success value -bool atf_amc::text_ReadStrptrMaybe(atf_amc::Text& parent, algo::strptr in_str) { +// --- atf_amc.TypeS..ReadStrptrMaybe +// Read fields of atf_amc::TypeS from an ascii string. +// The format of the string is an ssim Tuple +bool atf_amc::TypeS_ReadStrptrMaybe(atf_amc::TypeS &parent, algo::strptr in_str) { bool retval = true; - if (algo_lib::_db.varlenbuf) { - ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); - } - (void)parent;//only to avoid -Wunused-parameter + retval = algo::StripTypeTag(in_str, "atf_amc.TypeS"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && TypeS_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; return retval; } -// --- atf_amc.Text.text.Print -// Convert text to a string. -// Array is printed as a regular string. -void atf_amc::text_Print(atf_amc::Text& parent, algo::cstring &rhs) { - rhs << text_Getary(parent); +// --- atf_amc.TypeS..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.TypeS.String printfmt:Tuple +void atf_amc::TypeS_Print(atf_amc::TypeS& row, algo::cstring& str) { + algo::tempstr temp; + str << "atf_amc.TypeS"; + + i32_Print(row.types, temp); + PrintAttrSpaceReset(str,"types", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); } -// --- atf_amc.Text..ReadFieldMaybe -bool atf_amc::Text_ReadFieldMaybe(atf_amc::Text& parent, algo::strptr field, algo::strptr strval) { +// --- atf_amc.TypeT..ReadFieldMaybe +bool atf_amc::TypeT_ReadFieldMaybe(atf_amc::TypeT& parent, algo::strptr field, algo::strptr strval) { bool retval = true; atf_amc::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case atf_amc_FieldId_msghdr: { - retval = false; - break; - } - case atf_amc_FieldId_type: { - retval = false; - break; - } - case atf_amc_FieldId_length: { + case atf_amc_FieldId_types: { + retval = i32_ReadStrptrMaybe(parent.types, strval); + } break; + case atf_amc_FieldId_j: { + retval = i32_ReadStrptrMaybe(parent.j, strval); + } break; + default: { retval = false; - break; - } - case atf_amc_FieldId_text: { - retval = text_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -15762,45 +17944,48 @@ bool atf_amc::Text_ReadFieldMaybe(atf_amc::Text& parent, algo::strptr field, alg return retval; } -// --- atf_amc.Text..ReadStrptrMaybe -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of atf_amc::Text from an ascii string. +// --- atf_amc.TypeT..ReadStrptrMaybe +// Read fields of atf_amc::TypeT from an ascii string. // The format of the string is an ssim Tuple -bool atf_amc::Text_ReadStrptrMaybe(atf_amc::Text &parent, algo::strptr in_str) { +bool atf_amc::TypeT_ReadStrptrMaybe(atf_amc::TypeT &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "atf_amc.Text"); + retval = algo::StripTypeTag(in_str, "atf_amc.TypeT"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && Text_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && TypeT_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- atf_amc.Text..Print +// --- atf_amc.TypeT..Print // print string representation of ROW to string STR -// cfmt:atf_amc.Text.String printfmt:Tuple -void atf_amc::Text_Print(atf_amc::Text& row, algo::cstring& str) { +// cfmt:atf_amc.TypeT.String printfmt:Tuple +void atf_amc::TypeT_Print(atf_amc::TypeT& row, algo::cstring& str) { algo::tempstr temp; - str << "atf_amc.Text"; + str << "atf_amc.TypeT"; - atf_amc::text_Print(row, temp); - PrintAttrSpaceReset(str,"text", temp); + i32_Print(row.types, temp); + PrintAttrSpaceReset(str,"types", temp); + + i32_Print(row.j, temp); + PrintAttrSpaceReset(str,"j", temp); } -// --- atf_amc.TypeB..ReadFieldMaybe -bool atf_amc::TypeB_ReadFieldMaybe(atf_amc::TypeB& parent, algo::strptr field, algo::strptr strval) { +// --- atf_amc.TypeTVal..ReadFieldMaybe +bool atf_amc::TypeTVal_ReadFieldMaybe(atf_amc::TypeTVal& parent, algo::strptr field, algo::strptr strval) { bool retval = true; atf_amc::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case atf_amc_FieldId_typea: { - retval = i32_ReadStrptrMaybe(parent.typea, strval); - break; - } + case atf_amc_FieldId_types: { + retval = atf_amc::TypeS_ReadStrptrMaybe(parent.types, strval); + } break; case atf_amc_FieldId_j: { retval = i32_ReadStrptrMaybe(parent.j, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -15808,95 +17993,70 @@ bool atf_amc::TypeB_ReadFieldMaybe(atf_amc::TypeB& parent, algo::strptr field, a return retval; } -// --- atf_amc.TypeB..ReadStrptrMaybe -// Read fields of atf_amc::TypeB from an ascii string. +// --- atf_amc.TypeTVal..ReadStrptrMaybe +// Read fields of atf_amc::TypeTVal from an ascii string. // The format of the string is an ssim Tuple -bool atf_amc::TypeB_ReadStrptrMaybe(atf_amc::TypeB &parent, algo::strptr in_str) { +bool atf_amc::TypeTVal_ReadStrptrMaybe(atf_amc::TypeTVal &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "atf_amc.TypeB"); + retval = algo::StripTypeTag(in_str, "atf_amc.TypeTVal"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && TypeB_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && TypeTVal_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- atf_amc.TypeB..FmtJson -// Create JSON representation of atf_amc::TypeB under PARENT node -// cfmt:atf_amc.TypeB.Json printfmt:Auto -lib_json::FNode * atf_amc::TypeB_FmtJson(atf_amc::TypeB& row, lib_json::FNode *parent) { - lib_json::FNode *object_node = &lib_json::node_Alloc(); - object_node->p_parent = parent?parent:object_node; - object_node->type = lib_json_FNode_type_object; - node_XrefMaybe(*object_node); - - lib_json::FNode *typea_field_node = &lib_json::node_Alloc(); - typea_field_node->p_parent = object_node; - typea_field_node->type = lib_json_FNode_type_field; - typea_field_node->value = "typea"; - node_XrefMaybe(*typea_field_node); - i32_FmtJson(const_cast(row).typea,typea_field_node); - - lib_json::FNode *j_field_node = &lib_json::node_Alloc(); - j_field_node->p_parent = object_node; - j_field_node->type = lib_json_FNode_type_field; - j_field_node->value = "j"; - node_XrefMaybe(*j_field_node); - i32_FmtJson(const_cast(row).j,j_field_node); - return object_node; -} - -// --- atf_amc.TypeB..Print +// --- atf_amc.TypeTVal..Print // print string representation of ROW to string STR -// cfmt:atf_amc.TypeB.String printfmt:Tuple -void atf_amc::TypeB_Print(atf_amc::TypeB& row, algo::cstring& str) { +// cfmt:atf_amc.TypeTVal.String printfmt:Tuple +void atf_amc::TypeTVal_Print(atf_amc::TypeTVal& row, algo::cstring& str) { algo::tempstr temp; - str << "atf_amc.TypeB"; + str << "atf_amc.TypeTVal"; - i32_Print(row.typea, temp); - PrintAttrSpaceReset(str,"typea", temp); + atf_amc::TypeS_Print(row.types, temp); + PrintAttrSpaceReset(str,"types", temp); i32_Print(row.j, temp); PrintAttrSpaceReset(str,"j", temp); } -// --- atf_amc.TypeBE32en.value.ToCstr +// --- atf_amc.Typefconst.value.ToCstr // Convert numeric value of field to one of predefined string constants. // If string is found, return a static C string. Otherwise, return NULL. -const char* atf_amc::value_ToCstr(const atf_amc::TypeBE32en& parent) { +const char* atf_amc::value_ToCstr(const atf_amc::Typefconst& parent) { const char *ret = NULL; switch(value_GetEnum(parent)) { - case atf_amc_TypeBE32en_value_val1 : ret = "val1"; break; - case atf_amc_TypeBE32en_value_val2 : ret = "val2"; break; + case atf_amc_Typefconst_value_strval1: ret = "strval1"; break; + case atf_amc_Typefconst_value_strval2: ret = "strval2"; break; } return ret; } -// --- atf_amc.TypeBE32en.value.Print +// --- atf_amc.Typefconst.value.Print // Convert value to a string. First, attempt conversion to a known string. // If no string matches, print value as a numeric value. -void atf_amc::value_Print(const atf_amc::TypeBE32en& parent, algo::cstring &lhs) { +void atf_amc::value_Print(const atf_amc::Typefconst& parent, algo::cstring &lhs) { const char *strval = value_ToCstr(parent); if (strval) { lhs << strval; } else { - lhs << value_Get(parent); + lhs << parent.value; } } -// --- atf_amc.TypeBE32en.value.SetStrptrMaybe +// --- atf_amc.Typefconst.value.SetStrptrMaybe // Convert string to field. // If the string is invalid, do not modify field and return false. // In case of success, return true -bool atf_amc::value_SetStrptrMaybe(atf_amc::TypeBE32en& parent, algo::strptr rhs) { +bool atf_amc::value_SetStrptrMaybe(atf_amc::Typefconst& parent, algo::strptr rhs) { bool ret = false; switch (elems_N(rhs)) { - case 4: { - switch (u64(algo::ReadLE32(rhs.elems))) { - case LE_STR4('v','a','l','1'): { - value_SetEnum(parent,atf_amc_TypeBE32en_value_val1); ret = true; break; + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('s','t','r','v','a','l','1'): { + value_SetEnum(parent,atf_amc_Typefconst_value_strval1); ret = true; break; } - case LE_STR4('v','a','l','2'): { - value_SetEnum(parent,atf_amc_TypeBE32en_value_val2); ret = true; break; + case LE_STR7('s','t','r','v','a','l','2'): { + value_SetEnum(parent,atf_amc_Typefconst_value_strval2); ret = true; break; } } break; @@ -15905,39 +18065,37 @@ bool atf_amc::value_SetStrptrMaybe(atf_amc::TypeBE32en& parent, algo::strptr rhs return ret; } -// --- atf_amc.TypeBE32en.value.SetStrptr +// --- atf_amc.Typefconst.value.SetStrptr // Convert string to field. // If the string is invalid, set numeric value to DFLT -void atf_amc::value_SetStrptr(atf_amc::TypeBE32en& parent, algo::strptr rhs, atf_amc_TypeBE32en_value_Enum dflt) { +void atf_amc::value_SetStrptr(atf_amc::Typefconst& parent, algo::strptr rhs, atf_amc_Typefconst_value_Enum dflt) { if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); } -// --- atf_amc.TypeBE32en.value.ReadStrptrMaybe +// --- atf_amc.Typefconst.value.ReadStrptrMaybe // Convert string to field. Return success value -bool atf_amc::value_ReadStrptrMaybe(atf_amc::TypeBE32en& parent, algo::strptr rhs) { +bool atf_amc::value_ReadStrptrMaybe(atf_amc::Typefconst& parent, algo::strptr rhs) { bool retval = false; retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion if (!retval) { // didn't work? try reading as underlying type - u32 value_tmp; - retval = u32_ReadStrptrMaybe(value_tmp, rhs); - if (retval) { - value_Set(parent, value_tmp); - } + retval = u32_ReadStrptrMaybe(parent.value,rhs); } return retval; } -// --- atf_amc.TypeBE32en..ReadFieldMaybe -bool atf_amc::TypeBE32en_ReadFieldMaybe(atf_amc::TypeBE32en& parent, algo::strptr field, algo::strptr strval) { +// --- atf_amc.Typefconst..ReadFieldMaybe +bool atf_amc::Typefconst_ReadFieldMaybe(atf_amc::Typefconst& parent, algo::strptr field, algo::strptr strval) { bool retval = true; atf_amc::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case atf_amc_FieldId_value: { retval = value_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -15945,21 +18103,21 @@ bool atf_amc::TypeBE32en_ReadFieldMaybe(atf_amc::TypeBE32en& parent, algo::strpt return retval; } -// --- atf_amc.TypeBE32en..ReadStrptrMaybe -// Read fields of atf_amc::TypeBE32en from an ascii string. -// The format of the string is the format of the atf_amc::TypeBE32en's only field -bool atf_amc::TypeBE32en_ReadStrptrMaybe(atf_amc::TypeBE32en &parent, algo::strptr in_str) { +// --- atf_amc.Typefconst..ReadStrptrMaybe +// Read fields of atf_amc::Typefconst from an ascii string. +// The format of the string is the format of the atf_amc::Typefconst's only field +bool atf_amc::Typefconst_ReadStrptrMaybe(atf_amc::Typefconst &parent, algo::strptr in_str) { bool retval = true; retval = retval && value_ReadStrptrMaybe(parent, in_str); return retval; } -// --- atf_amc.TypeBE32en..ReadTupleMaybe -// Read fields of atf_amc::TypeBE32en from attributes of ascii tuple TUPLE -bool atf_amc::TypeBE32en_ReadTupleMaybe(atf_amc::TypeBE32en &parent, algo::Tuple &tuple) { +// --- atf_amc.Typefconst..ReadTupleMaybe +// Read fields of atf_amc::Typefconst from attributes of ascii tuple TUPLE +bool atf_amc::Typefconst_ReadTupleMaybe(atf_amc::Typefconst &parent, algo::Tuple &tuple) { bool retval = true; ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - retval = TypeBE32en_ReadFieldMaybe(parent, attr.name, attr.value); + retval = Typefconst_ReadFieldMaybe(parent, attr.name, attr.value); if (!retval) { break; } @@ -15967,35 +18125,140 @@ bool atf_amc::TypeBE32en_ReadTupleMaybe(atf_amc::TypeBE32en &parent, algo::Tuple return retval; } -// --- atf_amc.TypeBE32en..Print +// --- atf_amc.Typefconst..Print // print string representation of ROW to string STR -// cfmt:atf_amc.TypeBE32en.String printfmt:Raw -void atf_amc::TypeBE32en_Print(atf_amc::TypeBE32en& row, algo::cstring& str) { +// cfmt:atf_amc.Typefconst.String printfmt:Raw +void atf_amc::Typefconst_Print(atf_amc::Typefconst& row, algo::cstring& str) { atf_amc::value_Print(row, str); } -// --- atf_amc.TypeBE64.value.ReadStrptrMaybe -inline static bool atf_amc::value_ReadStrptrMaybe(atf_amc::TypeBE64 &parent, algo::strptr in_str) { +// --- atf_amc.Varlen2Msg.base.CopyOut +// Copy fields out of row +void atf_amc::parent_CopyOut(atf_amc::Varlen2Msg &row, atf_amc::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter +} + +// --- atf_amc.Varlen2Msg.s1.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::s1_Getary(atf_amc::Varlen2Msg& parent) { + return algo::aryptr(s1_Addr(parent), s1_N(parent)); +} + +// --- atf_amc.Varlen2Msg.s1.Addr +char* atf_amc::s1_Addr(atf_amc::Varlen2Msg& parent) { + return (char*)((u8*)&parent + sizeof(atf_amc::Varlen2Msg)); // address of varlen portion +} + +// --- atf_amc.Varlen2Msg.s1.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::s1_ReadStrptrMaybe(atf_amc::Varlen2Msg& parent, algo::strptr in_str) { bool retval = true; - u64 value_tmp; - retval = u64_ReadStrptrMaybe(value_tmp, in_str); - if (retval) { - value_Set(parent, value_tmp); + if (algo_lib::_db.varlenbuf) { + ary_Insary(*algo_lib::_db.varlenbuf,strptr_ToMemptr(in_str),parent.s1_end); + u32 incr = ch_N(in_str); + parent.s1_end = atf_amc::MsgLength(parent.s1_end + incr); + parent.s2_end = atf_amc::MsgLength(parent.s2_end + incr); } return retval; } -// --- atf_amc.TypeBE64..ReadFieldMaybe -bool atf_amc::TypeBE64_ReadFieldMaybe(atf_amc::TypeBE64& parent, algo::strptr field, algo::strptr strval) { +// --- atf_amc.Varlen2Msg.s1.Print +// Convert s1 to a string. +// Array is printed as a regular string. +void atf_amc::s1_Print(atf_amc::Varlen2Msg& parent, algo::cstring &rhs) { + rhs << s1_Getary(parent); +} + +// --- atf_amc.Varlen2Msg.s2.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::s2_Getary(atf_amc::Varlen2Msg& parent) { + return algo::aryptr(s2_Addr(parent), s2_N(parent)); +} + +// --- atf_amc.Varlen2Msg.s2.Addr +char* atf_amc::s2_Addr(atf_amc::Varlen2Msg& parent) { + return (char*)((u8*)&parent + sizeof(atf_amc::Varlen2Msg) + parent.s1_end); // address of varlen portion +} + +// --- atf_amc.Varlen2Msg.s2.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::s2_ReadStrptrMaybe(atf_amc::Varlen2Msg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Insary(*algo_lib::_db.varlenbuf,strptr_ToMemptr(in_str),parent.s2_end); + u32 incr = ch_N(in_str); + parent.s2_end = atf_amc::MsgLength(parent.s2_end + incr); + } + return retval; +} + +// --- atf_amc.Varlen2Msg.s2.Print +// Convert s2 to a string. +// Array is printed as a regular string. +void atf_amc::s2_Print(atf_amc::Varlen2Msg& parent, algo::cstring &rhs) { + rhs << s2_Getary(parent); +} + +// --- atf_amc.Varlen2Msg.s3.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::s3_Getary(atf_amc::Varlen2Msg& parent) { + return algo::aryptr(s3_Addr(parent), s3_N(parent)); +} + +// --- atf_amc.Varlen2Msg.s3.Addr +char* atf_amc::s3_Addr(atf_amc::Varlen2Msg& parent) { + return (char*)((u8*)&parent + sizeof(atf_amc::Varlen2Msg) + parent.s2_end); // address of varlen portion +} + +// --- atf_amc.Varlen2Msg.s3.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::s3_ReadStrptrMaybe(atf_amc::Varlen2Msg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- atf_amc.Varlen2Msg.s3.Print +// Convert s3 to a string. +// Array is printed as a regular string. +void atf_amc::s3_Print(atf_amc::Varlen2Msg& parent, algo::cstring &rhs) { + rhs << s3_Getary(parent); +} + +// --- atf_amc.Varlen2Msg..ReadFieldMaybe +bool atf_amc::Varlen2Msg_ReadFieldMaybe(atf_amc::Varlen2Msg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; atf_amc::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { - case atf_amc_FieldId_value: { - retval = value_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + case atf_amc_FieldId_base: { + retval = false; + } break; + case atf_amc_FieldId_type: { + retval = false; + } break; + case atf_amc_FieldId_length: { + retval = false; + } break; + case atf_amc_FieldId_s1: { + retval = s1_ReadStrptrMaybe(parent, strval); + } break; + case atf_amc_FieldId_s2: { + retval = s2_ReadStrptrMaybe(parent, strval); + } break; + case atf_amc_FieldId_s3: { + retval = s3_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -16003,82 +18266,145 @@ bool atf_amc::TypeBE64_ReadFieldMaybe(atf_amc::TypeBE64& parent, algo::strptr fi return retval; } -// --- atf_amc.TypeBE64..ReadStrptrMaybe -// Read fields of atf_amc::TypeBE64 from an ascii string. -// The format of the string is the format of the atf_amc::TypeBE64's only field -bool atf_amc::TypeBE64_ReadStrptrMaybe(atf_amc::TypeBE64 &parent, algo::strptr in_str) { +// --- atf_amc.Varlen2Msg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::Varlen2Msg from an ascii string. +// The format of the string is an ssim Tuple +bool atf_amc::Varlen2Msg_ReadStrptrMaybe(atf_amc::Varlen2Msg &parent, algo::strptr in_str) { bool retval = true; - retval = retval && value_ReadStrptrMaybe(parent, in_str); + retval = algo::StripTypeTag(in_str, "atf_amc.Varlen2Msg"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Varlen2Msg_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; return retval; } -// --- atf_amc.TypeBE64..ReadTupleMaybe -// Read fields of atf_amc::TypeBE64 from attributes of ascii tuple TUPLE -bool atf_amc::TypeBE64_ReadTupleMaybe(atf_amc::TypeBE64 &parent, algo::Tuple &tuple) { +// --- atf_amc.Varlen2Msg..Print +// print string representation of ROW to string STR +// cfmt:atf_amc.Varlen2Msg.String printfmt:Tuple +void atf_amc::Varlen2Msg_Print(atf_amc::Varlen2Msg& row, algo::cstring& str) { + algo::tempstr temp; + str << "atf_amc.Varlen2Msg"; + + atf_amc::s1_Print(row, temp); + PrintAttrSpaceReset(str,"s1", temp); + + atf_amc::s2_Print(row, temp); + PrintAttrSpaceReset(str,"s2", temp); + + atf_amc::s3_Print(row, temp); + PrintAttrSpaceReset(str,"s3", temp); +} + +// --- atf_amc.Varlen2aMsg.base.CopyOut +// Copy fields out of row +void atf_amc::parent_CopyOut(atf_amc::Varlen2aMsg &row, atf_amc::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter +} + +// --- atf_amc.Varlen2aMsg.u1.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::u1_Getary(atf_amc::Varlen2aMsg& parent) { + return algo::aryptr(u1_Addr(parent), u1_N(parent)); +} + +// --- atf_amc.Varlen2aMsg.u1.Addr +u32* atf_amc::u1_Addr(atf_amc::Varlen2aMsg& parent) { + return (u32*)((u8*)&parent + sizeof(atf_amc::Varlen2aMsg)); // address of varlen portion +} + +// --- atf_amc.Varlen2aMsg.u1.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::u1_ReadStrptrMaybe(atf_amc::Varlen2aMsg& parent, algo::strptr in_str) { bool retval = true; - ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - retval = TypeBE64_ReadFieldMaybe(parent, attr.name, attr.value); - if (!retval) { - break; - } - }ind_end; + if (algo_lib::_db.varlenbuf) { + u32 *u1_tmp = new(ary_AllocNAt(*algo_lib::_db.varlenbuf, sizeof(u32), parent.u1_end).elems) u32; + u32 incr = sizeof(u32); + retval = u32_ReadStrptrMaybe(*u1_tmp, in_str); + parent.u1_end = atf_amc::MsgLength(parent.u1_end + incr); + parent.u2_end = atf_amc::MsgLength(parent.u2_end + incr); + } return retval; } -// --- atf_amc.TypeBE64..Print -// print string representation of ROW to string STR -// cfmt:atf_amc.TypeBE64.String printfmt:Raw -void atf_amc::TypeBE64_Print(atf_amc::TypeBE64& row, algo::cstring& str) { - u64_Print(value_Get(row), str); +// --- atf_amc.Varlen2aMsg.u2.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::u2_Getary(atf_amc::Varlen2aMsg& parent) { + return algo::aryptr(u2_Addr(parent), u2_N(parent)); } -// --- atf_amc.TypeC..ReadStrptrMaybe -// Read fields of atf_amc::TypeC from an ascii string. -// The format of the string is the format of the atf_amc::TypeC's only field -bool atf_amc::TypeC_ReadStrptrMaybe(atf_amc::TypeC &parent, algo::strptr in_str) { +// --- atf_amc.Varlen2aMsg.u2.Addr +u32* atf_amc::u2_Addr(atf_amc::Varlen2aMsg& parent) { + return (u32*)((u8*)&parent + sizeof(atf_amc::Varlen2aMsg) + parent.u1_end); // address of varlen portion +} + +// --- atf_amc.Varlen2aMsg.u2.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::u2_ReadStrptrMaybe(atf_amc::Varlen2aMsg& parent, algo::strptr in_str) { bool retval = true; - retval = retval && i32_ReadStrptrMaybe(parent.typec, in_str); + if (algo_lib::_db.varlenbuf) { + u32 *u2_tmp = new(ary_AllocNAt(*algo_lib::_db.varlenbuf, sizeof(u32), parent.u2_end).elems) u32; + u32 incr = sizeof(u32); + retval = u32_ReadStrptrMaybe(*u2_tmp, in_str); + parent.u2_end = atf_amc::MsgLength(parent.u2_end + incr); + } return retval; } -// --- atf_amc.TypeC..Print -// print string representation of ROW to string STR -// cfmt:atf_amc.TypeC.String printfmt:Raw -void atf_amc::TypeC_Print(atf_amc::TypeC& row, algo::cstring& str) { - i32_Print(row.typec, str); +// --- atf_amc.Varlen2aMsg.u3.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::u3_Getary(atf_amc::Varlen2aMsg& parent) { + return algo::aryptr(u3_Addr(parent), u3_N(parent)); } -// --- atf_amc.TypeH..ReadStrptrMaybe -// Read fields of atf_amc::TypeH from an ascii string. -// The format of the string is the format of the atf_amc::TypeH's only field -bool atf_amc::TypeH_ReadStrptrMaybe(atf_amc::TypeH &parent, algo::strptr in_str) { +// --- atf_amc.Varlen2aMsg.u3.Addr +u32* atf_amc::u3_Addr(atf_amc::Varlen2aMsg& parent) { + return (u32*)((u8*)&parent + sizeof(atf_amc::Varlen2aMsg) + parent.u2_end); // address of varlen portion +} + +// --- atf_amc.Varlen2aMsg.u3.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::u3_ReadStrptrMaybe(atf_amc::Varlen2aMsg& parent, algo::strptr in_str) { bool retval = true; - retval = retval && i32_ReadStrptrMaybe(parent.typeh, in_str); + if (algo_lib::_db.varlenbuf) { + u32 *u3_tmp = new(ary_AllocN(*algo_lib::_db.varlenbuf, sizeof(u32)).elems) u32; + retval = u32_ReadStrptrMaybe(*u3_tmp, in_str); + } + (void)parent;//only to avoid -Wunused-parameter return retval; } -// --- atf_amc.TypeH..Print -// print string representation of ROW to string STR -// cfmt:atf_amc.TypeH.String printfmt:Raw -void atf_amc::TypeH_Print(atf_amc::TypeH& row, algo::cstring& str) { - i32_Print(row.typeh, str); -} - -// --- atf_amc.TypeS..ReadFieldMaybe -bool atf_amc::TypeS_ReadFieldMaybe(atf_amc::TypeS& parent, algo::strptr field, algo::strptr strval) { +// --- atf_amc.Varlen2aMsg..ReadFieldMaybe +bool atf_amc::Varlen2aMsg_ReadFieldMaybe(atf_amc::Varlen2aMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; atf_amc::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { - case atf_amc_FieldId_types: { - retval = i32_ReadStrptrMaybe(parent.types, strval); - break; - } - case atf_amc_FieldId_comment: { - retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + case atf_amc_FieldId_base: { + retval = false; + } break; + case atf_amc_FieldId_type: { + retval = false; + } break; + case atf_amc_FieldId_length: { + retval = false; + } break; + case atf_amc_FieldId_u1: { + retval = u1_ReadStrptrMaybe(parent, strval); + } break; + case atf_amc_FieldId_u2: { + retval = u2_ReadStrptrMaybe(parent, strval); + } break; + case atf_amc_FieldId_u3: { + retval = u3_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -16086,47 +18412,163 @@ bool atf_amc::TypeS_ReadFieldMaybe(atf_amc::TypeS& parent, algo::strptr field, a return retval; } -// --- atf_amc.TypeS..ReadStrptrMaybe -// Read fields of atf_amc::TypeS from an ascii string. +// --- atf_amc.Varlen2aMsg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::Varlen2aMsg from an ascii string. // The format of the string is an ssim Tuple -bool atf_amc::TypeS_ReadStrptrMaybe(atf_amc::TypeS &parent, algo::strptr in_str) { +bool atf_amc::Varlen2aMsg_ReadStrptrMaybe(atf_amc::Varlen2aMsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "atf_amc.TypeS"); + retval = algo::StripTypeTag(in_str, "atf_amc.Varlen2aMsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && TypeS_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && Varlen2aMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- atf_amc.TypeS..Print +// --- atf_amc.Varlen2aMsg..Print // print string representation of ROW to string STR -// cfmt:atf_amc.TypeS.String printfmt:Tuple -void atf_amc::TypeS_Print(atf_amc::TypeS& row, algo::cstring& str) { +// cfmt:atf_amc.Varlen2aMsg.String printfmt:Tuple +void atf_amc::Varlen2aMsg_Print(atf_amc::Varlen2aMsg& row, algo::cstring& str) { algo::tempstr temp; - str << "atf_amc.TypeS"; + str << "atf_amc.Varlen2aMsg"; - i32_Print(row.types, temp); - PrintAttrSpaceReset(str,"types", temp); + ind_beg(Varlen2aMsg_u1_curs,u1,row) { + u32_Print(u1, temp); + tempstr name; + name << "u1."; + name << ind_curs(u1).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; - algo::Comment_Print(row.comment, temp); - PrintAttrSpaceReset(str,"comment", temp); + ind_beg(Varlen2aMsg_u2_curs,u2,row) { + u32_Print(u2, temp); + tempstr name; + name << "u2."; + name << ind_curs(u2).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; + + ind_beg(Varlen2aMsg_u3_curs,u3,row) { + u32_Print(u3, temp); + tempstr name; + name << "u3."; + name << ind_curs(u3).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; } -// --- atf_amc.TypeT..ReadFieldMaybe -bool atf_amc::TypeT_ReadFieldMaybe(atf_amc::TypeT& parent, algo::strptr field, algo::strptr strval) { +// --- atf_amc.Varlen2mMsg.base.CopyOut +// Copy fields out of row +void atf_amc::parent_CopyOut(atf_amc::Varlen2mMsg &row, atf_amc::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter +} + +// --- atf_amc.Varlen2mMsg.m1.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::m1_Getary(atf_amc::Varlen2mMsg& parent) { + return algo::aryptr(m1_Addr(parent), m1_N(parent)); +} + +// --- atf_amc.Varlen2mMsg.m1.Addr +u8* atf_amc::m1_Addr(atf_amc::Varlen2mMsg& parent) { + return (u8*)((u8*)&parent + sizeof(atf_amc::Varlen2mMsg)); // address of varlen portion +} + +// --- atf_amc.Varlen2mMsg.m1.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::m1_ReadStrptrMaybe(atf_amc::Varlen2mMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + algo::ByteAry temp; + retval = atf_amc::MsgHeaderMsgs_ReadStrptrMaybe(in_str, temp); // read any of several message types here + ary_Insary(*algo_lib::_db.varlenbuf,ary_Getary(temp),parent.m1_end); + u32 incr = ary_N(temp); + parent.m1_end = atf_amc::MsgLength(parent.m1_end + incr); + parent.m2_end = atf_amc::MsgLength(parent.m2_end + incr); + } + return retval; +} + +// --- atf_amc.Varlen2mMsg.m2.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::m2_Getary(atf_amc::Varlen2mMsg& parent) { + return algo::aryptr(m2_Addr(parent), m2_N(parent)); +} + +// --- atf_amc.Varlen2mMsg.m2.Addr +u8* atf_amc::m2_Addr(atf_amc::Varlen2mMsg& parent) { + return (u8*)((u8*)&parent + sizeof(atf_amc::Varlen2mMsg) + parent.m1_end); // address of varlen portion +} + +// --- atf_amc.Varlen2mMsg.m2.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::m2_ReadStrptrMaybe(atf_amc::Varlen2mMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + algo::ByteAry temp; + retval = atf_amc::MsgHeaderMsgs_ReadStrptrMaybe(in_str, temp); // read any of several message types here + ary_Insary(*algo_lib::_db.varlenbuf,ary_Getary(temp),parent.m2_end); + u32 incr = ary_N(temp); + parent.m2_end = atf_amc::MsgLength(parent.m2_end + incr); + } + return retval; +} + +// --- atf_amc.Varlen2mMsg.m3.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::m3_Getary(atf_amc::Varlen2mMsg& parent) { + return algo::aryptr(m3_Addr(parent), m3_N(parent)); +} + +// --- atf_amc.Varlen2mMsg.m3.Addr +u8* atf_amc::m3_Addr(atf_amc::Varlen2mMsg& parent) { + return (u8*)((u8*)&parent + sizeof(atf_amc::Varlen2mMsg) + parent.m2_end); // address of varlen portion +} + +// --- atf_amc.Varlen2mMsg.m3.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::m3_ReadStrptrMaybe(atf_amc::Varlen2mMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + algo::ByteAry temp; + retval = atf_amc::MsgHeaderMsgs_ReadStrptrMaybe(in_str, temp); // read any of several message types here + ary_Addary(*algo_lib::_db.varlenbuf, ary_Getary(temp)); // return it + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- atf_amc.Varlen2mMsg..ReadFieldMaybe +bool atf_amc::Varlen2mMsg_ReadFieldMaybe(atf_amc::Varlen2mMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; atf_amc::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { - case atf_amc_FieldId_types: { - retval = i32_ReadStrptrMaybe(parent.types, strval); - break; - } - case atf_amc_FieldId_j: { - retval = i32_ReadStrptrMaybe(parent.j, strval); - break; - } - default: break; + case atf_amc_FieldId_base: { + retval = false; + } break; + case atf_amc_FieldId_type: { + retval = false; + } break; + case atf_amc_FieldId_length: { + retval = false; + } break; + case atf_amc_FieldId_m1: { + retval = m1_ReadStrptrMaybe(parent, strval); + } break; + case atf_amc_FieldId_m2: { + retval = m2_ReadStrptrMaybe(parent, strval); + } break; + case atf_amc_FieldId_m3: { + retval = m3_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -16134,47 +18576,90 @@ bool atf_amc::TypeT_ReadFieldMaybe(atf_amc::TypeT& parent, algo::strptr field, a return retval; } -// --- atf_amc.TypeT..ReadStrptrMaybe -// Read fields of atf_amc::TypeT from an ascii string. +// --- atf_amc.Varlen2mMsg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::Varlen2mMsg from an ascii string. // The format of the string is an ssim Tuple -bool atf_amc::TypeT_ReadStrptrMaybe(atf_amc::TypeT &parent, algo::strptr in_str) { +bool atf_amc::Varlen2mMsg_ReadStrptrMaybe(atf_amc::Varlen2mMsg &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "atf_amc.TypeT"); + retval = algo::StripTypeTag(in_str, "atf_amc.Varlen2mMsg"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && TypeT_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && Varlen2mMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- atf_amc.TypeT..Print +// --- atf_amc.Varlen2mMsg..Print // print string representation of ROW to string STR -// cfmt:atf_amc.TypeT.String printfmt:Tuple -void atf_amc::TypeT_Print(atf_amc::TypeT& row, algo::cstring& str) { +// cfmt:atf_amc.Varlen2mMsg.String printfmt:Tuple +void atf_amc::Varlen2mMsg_Print(atf_amc::Varlen2mMsg& row, algo::cstring& str) { algo::tempstr temp; - str << "atf_amc.TypeT"; + str << "atf_amc.Varlen2mMsg"; - i32_Print(row.types, temp); - PrintAttrSpaceReset(str,"types", temp); + ind_beg(Varlen2mMsg_m1_curs,m1,row) { + atf_amc::MsgHeaderMsgs_Print(temp, m1, INT_MAX); + tempstr name; + name << "m1."; + name << ind_curs(m1).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; - i32_Print(row.j, temp); - PrintAttrSpaceReset(str,"j", temp); + ind_beg(Varlen2mMsg_m2_curs,m2,row) { + atf_amc::MsgHeaderMsgs_Print(temp, m2, INT_MAX); + tempstr name; + name << "m2."; + name << ind_curs(m2).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; + + ind_beg(Varlen2mMsg_m3_curs,m3,row) { + atf_amc::MsgHeaderMsgs_Print(temp, m3, INT_MAX); + tempstr name; + name << "m3."; + name << ind_curs(m3).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; } -// --- atf_amc.TypeTVal..ReadFieldMaybe -bool atf_amc::TypeTVal_ReadFieldMaybe(atf_amc::TypeTVal& parent, algo::strptr field, algo::strptr strval) { +// --- atf_amc.VarlenK.i.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::i_Getary(atf_amc::VarlenK& v1) { + return algo::aryptr(i_Addr(v1), i_N(v1)); +} + +// --- atf_amc.VarlenK.i.Addr +u32* atf_amc::i_Addr(atf_amc::VarlenK& v1) { + return (u32*)((u8*)&v1 + sizeof(atf_amc::VarlenK)); // address of varlen portion +} + +// --- atf_amc.VarlenK.i.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::i_ReadStrptrMaybe(atf_amc::VarlenK& v1, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + u32 *i_tmp = new(ary_AllocN(*algo_lib::_db.varlenbuf, sizeof(u32)).elems) u32; + retval = u32_ReadStrptrMaybe(*i_tmp, in_str); + } + (void)v1;//only to avoid -Wunused-parameter + return retval; +} + +// --- atf_amc.VarlenK..ReadFieldMaybe +bool atf_amc::VarlenK_ReadFieldMaybe(atf_amc::VarlenK& parent, algo::strptr field, algo::strptr strval) { bool retval = true; atf_amc::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { - case atf_amc_FieldId_types: { - retval = atf_amc::TypeS_ReadStrptrMaybe(parent.types, strval); - break; - } - case atf_amc_FieldId_j: { - retval = i32_ReadStrptrMaybe(parent.j, strval); - break; - } - default: break; + case atf_amc_FieldId_length: { + retval = false; + } break; + case atf_amc_FieldId_i: { + retval = i_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -16182,107 +18667,173 @@ bool atf_amc::TypeTVal_ReadFieldMaybe(atf_amc::TypeTVal& parent, algo::strptr fi return retval; } -// --- atf_amc.TypeTVal..ReadStrptrMaybe -// Read fields of atf_amc::TypeTVal from an ascii string. +// --- atf_amc.VarlenK..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::VarlenK from an ascii string. // The format of the string is an ssim Tuple -bool atf_amc::TypeTVal_ReadStrptrMaybe(atf_amc::TypeTVal &parent, algo::strptr in_str) { +bool atf_amc::VarlenK_ReadStrptrMaybe(atf_amc::VarlenK &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "atf_amc.TypeTVal"); + retval = algo::StripTypeTag(in_str, "atf_amc.VarlenK"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && TypeTVal_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && VarlenK_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- atf_amc.TypeTVal..Print +// --- atf_amc.VarlenK..Print // print string representation of ROW to string STR -// cfmt:atf_amc.TypeTVal.String printfmt:Tuple -void atf_amc::TypeTVal_Print(atf_amc::TypeTVal& row, algo::cstring& str) { +// cfmt:atf_amc.VarlenK.String printfmt:Tuple +void atf_amc::VarlenK_Print(atf_amc::VarlenK& row, algo::cstring& str) { algo::tempstr temp; - str << "atf_amc.TypeTVal"; + str << "atf_amc.VarlenK"; - atf_amc::TypeS_Print(row.types, temp); - PrintAttrSpaceReset(str,"types", temp); + ind_beg(v1_i_curs,i,row) { + u32_Print(i, temp); + tempstr name; + name << "i."; + name << ind_curs(i).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; +} - i32_Print(row.j, temp); - PrintAttrSpaceReset(str,"j", temp); +// --- atf_amc.Varlen2vMsg.base.CopyOut +// Copy fields out of row +void atf_amc::parent_CopyOut(atf_amc::Varlen2vMsg &row, atf_amc::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter } -// --- atf_amc.Typefconst.value.ToCstr -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -const char* atf_amc::value_ToCstr(const atf_amc::Typefconst& parent) { - const char *ret = NULL; - switch(value_GetEnum(parent)) { - case atf_amc_Typefconst_value_strval1: ret = "strval1"; break; - case atf_amc_Typefconst_value_strval2: ret = "strval2"; break; - } - return ret; +// --- atf_amc.Varlen2vMsg.v1.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::v1_Getary(atf_amc::Varlen2vMsg& parent) { + return algo::aryptr(v1_Addr(parent), v1_N(parent)); } -// --- atf_amc.Typefconst.value.Print -// Convert value to a string. First, attempt conversion to a known string. -// If no string matches, print value as a numeric value. -void atf_amc::value_Print(const atf_amc::Typefconst& parent, algo::cstring &lhs) { - const char *strval = value_ToCstr(parent); - if (strval) { - lhs << strval; - } else { - lhs << parent.value; +// --- atf_amc.Varlen2vMsg.v1.Addr +u8* atf_amc::v1_Addr(atf_amc::Varlen2vMsg& parent) { + return (u8*)((u8*)&parent + sizeof(atf_amc::Varlen2vMsg)); // address of varlen portion +} + +// --- atf_amc.Varlen2vMsg.v1.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::v1_ReadStrptrMaybe(atf_amc::Varlen2vMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + atf_amc::VarlenK *v1_tmp = new(ary_AllocNAt(*algo_lib::_db.varlenbuf, sizeof(atf_amc::VarlenK), parent.v1_end).elems) atf_amc::VarlenK; + u32 incr = sizeof(atf_amc::VarlenK); + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + retval = atf_amc::VarlenK_ReadStrptrMaybe(*v1_tmp, in_str); + algo_lib::_db.varlenbuf = varlenbuf_save; + (*v1_tmp).length = atf_amc::MsgLength(sizeof(atf_amc::VarlenK)+ary_N(varlenbuf)); + ary_Insary(*algo_lib::_db.varlenbuf,varlenbuf,parent.v1_end+sizeof(atf_amc::VarlenK)); + incr += ary_N(varlenbuf); + parent.v1_end = atf_amc::MsgLength(parent.v1_end + incr); + parent.v2_end = atf_amc::MsgLength(parent.v2_end + incr); } + return retval; +} + +// --- atf_amc.Varlen2vMsg.v1.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool atf_amc::v1_XrefMaybe(atf_amc::VarlenK &row) { + bool retval = true; + (void)row; + return retval; } -// --- atf_amc.Typefconst.value.SetStrptrMaybe -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -bool atf_amc::value_SetStrptrMaybe(atf_amc::Typefconst& parent, algo::strptr rhs) { - bool ret = false; - switch (elems_N(rhs)) { - case 7: { - switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { - case LE_STR7('s','t','r','v','a','l','1'): { - value_SetEnum(parent,atf_amc_Typefconst_value_strval1); ret = true; break; - } - case LE_STR7('s','t','r','v','a','l','2'): { - value_SetEnum(parent,atf_amc_Typefconst_value_strval2); ret = true; break; - } - } - break; - } +// --- atf_amc.Varlen2vMsg.v2.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::v2_Getary(atf_amc::Varlen2vMsg& parent) { + return algo::aryptr(v2_Addr(parent), v2_N(parent)); +} + +// --- atf_amc.Varlen2vMsg.v2.Addr +u8* atf_amc::v2_Addr(atf_amc::Varlen2vMsg& parent) { + return (u8*)((u8*)&parent + sizeof(atf_amc::Varlen2vMsg) + parent.v1_end); // address of varlen portion +} + +// --- atf_amc.Varlen2vMsg.v2.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_amc::v2_ReadStrptrMaybe(atf_amc::Varlen2vMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + atf_amc::VarlenK *v2_tmp = new(ary_AllocNAt(*algo_lib::_db.varlenbuf, sizeof(atf_amc::VarlenK), parent.v2_end).elems) atf_amc::VarlenK; + u32 incr = sizeof(atf_amc::VarlenK); + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + retval = atf_amc::VarlenK_ReadStrptrMaybe(*v2_tmp, in_str); + algo_lib::_db.varlenbuf = varlenbuf_save; + (*v2_tmp).length = atf_amc::MsgLength(sizeof(atf_amc::VarlenK)+ary_N(varlenbuf)); + ary_Insary(*algo_lib::_db.varlenbuf,varlenbuf,parent.v2_end+sizeof(atf_amc::VarlenK)); + incr += ary_N(varlenbuf); + parent.v2_end = atf_amc::MsgLength(parent.v2_end + incr); } - return ret; + return retval; } -// --- atf_amc.Typefconst.value.SetStrptr -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -void atf_amc::value_SetStrptr(atf_amc::Typefconst& parent, algo::strptr rhs, atf_amc_Typefconst_value_Enum dflt) { - if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +// --- atf_amc.Varlen2vMsg.v3.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr atf_amc::v3_Getary(atf_amc::Varlen2vMsg& parent) { + return algo::aryptr(v3_Addr(parent), v3_N(parent)); } -// --- atf_amc.Typefconst.value.ReadStrptrMaybe +// --- atf_amc.Varlen2vMsg.v3.Addr +u8* atf_amc::v3_Addr(atf_amc::Varlen2vMsg& parent) { + return (u8*)((u8*)&parent + sizeof(atf_amc::Varlen2vMsg) + parent.v2_end); // address of varlen portion +} + +// --- atf_amc.Varlen2vMsg.v3.ReadStrptrMaybe // Convert string to field. Return success value -bool atf_amc::value_ReadStrptrMaybe(atf_amc::Typefconst& parent, algo::strptr rhs) { - bool retval = false; - retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion - if (!retval) { // didn't work? try reading as underlying type - retval = u32_ReadStrptrMaybe(parent.value,rhs); +bool atf_amc::v3_ReadStrptrMaybe(atf_amc::Varlen2vMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + atf_amc::VarlenK *v3_tmp = new(ary_AllocN(*algo_lib::_db.varlenbuf, sizeof(atf_amc::VarlenK)).elems) atf_amc::VarlenK; + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + retval = atf_amc::VarlenK_ReadStrptrMaybe(*v3_tmp, in_str); + algo_lib::_db.varlenbuf = varlenbuf_save; + (*v3_tmp).length = atf_amc::MsgLength(sizeof(atf_amc::VarlenK)+ary_N(varlenbuf)); + ary_Addary(*algo_lib::_db.varlenbuf,varlenbuf); } + (void)parent;//only to avoid -Wunused-parameter return retval; } -// --- atf_amc.Typefconst..ReadFieldMaybe -bool atf_amc::Typefconst_ReadFieldMaybe(atf_amc::Typefconst& parent, algo::strptr field, algo::strptr strval) { +// --- atf_amc.Varlen2vMsg..ReadFieldMaybe +bool atf_amc::Varlen2vMsg_ReadFieldMaybe(atf_amc::Varlen2vMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; atf_amc::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); switch(field_id) { - case atf_amc_FieldId_value: { - retval = value_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + case atf_amc_FieldId_base: { + retval = false; + } break; + case atf_amc_FieldId_type: { + retval = false; + } break; + case atf_amc_FieldId_length: { + retval = false; + } break; + case atf_amc_FieldId_v1: { + retval = v1_ReadStrptrMaybe(parent, strval); + } break; + case atf_amc_FieldId_v2: { + retval = v2_ReadStrptrMaybe(parent, strval); + } break; + case atf_amc_FieldId_v3: { + retval = v3_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -16290,33 +18841,49 @@ bool atf_amc::Typefconst_ReadFieldMaybe(atf_amc::Typefconst& parent, algo::strpt return retval; } -// --- atf_amc.Typefconst..ReadStrptrMaybe -// Read fields of atf_amc::Typefconst from an ascii string. -// The format of the string is the format of the atf_amc::Typefconst's only field -bool atf_amc::Typefconst_ReadStrptrMaybe(atf_amc::Typefconst &parent, algo::strptr in_str) { - bool retval = true; - retval = retval && value_ReadStrptrMaybe(parent, in_str); - return retval; -} - -// --- atf_amc.Typefconst..ReadTupleMaybe -// Read fields of atf_amc::Typefconst from attributes of ascii tuple TUPLE -bool atf_amc::Typefconst_ReadTupleMaybe(atf_amc::Typefconst &parent, algo::Tuple &tuple) { +// --- atf_amc.Varlen2vMsg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::Varlen2vMsg from an ascii string. +// The format of the string is an ssim Tuple +bool atf_amc::Varlen2vMsg_ReadStrptrMaybe(atf_amc::Varlen2vMsg &parent, algo::strptr in_str) { bool retval = true; - ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - retval = Typefconst_ReadFieldMaybe(parent, attr.name, attr.value); - if (!retval) { - break; - } + retval = algo::StripTypeTag(in_str, "atf_amc.Varlen2vMsg"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Varlen2vMsg_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- atf_amc.Typefconst..Print +// --- atf_amc.Varlen2vMsg..Print // print string representation of ROW to string STR -// cfmt:atf_amc.Typefconst.String printfmt:Raw -void atf_amc::Typefconst_Print(atf_amc::Typefconst& row, algo::cstring& str) { - atf_amc::value_Print(row, str); +// cfmt:atf_amc.Varlen2vMsg.String printfmt:Tuple +void atf_amc::Varlen2vMsg_Print(atf_amc::Varlen2vMsg& row, algo::cstring& str) { + algo::tempstr temp; + str << "atf_amc.Varlen2vMsg"; + + ind_beg(Varlen2vMsg_v1_curs,v1,row) { + atf_amc::VarlenK_Print(v1, temp); + tempstr name; + name << "v1."; + name << ind_curs(v1).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; + + ind_beg(Varlen2vMsg_v2_curs,v2,row) { + atf_amc::VarlenK_Print(v2, temp); + tempstr name; + name << "v2."; + name << ind_curs(v2).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; + + ind_beg(Varlen2vMsg_v3_curs,v3,row) { + atf_amc::VarlenK_Print(v3, temp); + tempstr name; + name << "v3."; + name << ind_curs(v3).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; } // --- atf_amc.VarlenAlloc.elem.Getary @@ -16530,80 +19097,6 @@ bool atf_amc::typeh_XrefMaybe(atf_amc::TypeH &row) { return retval; } -// --- atf_amc.VarlenK.i.Getary -// Access var-length portion as an aryptr. Length is determined from one of the fields. -algo::aryptr atf_amc::i_Getary(atf_amc::VarlenK& k) { - return algo::aryptr(i_Addr(k), i_N(k)); -} - -// --- atf_amc.VarlenK.i.Addr -u32* atf_amc::i_Addr(atf_amc::VarlenK& k) { - return (u32*)((u8*)&k + sizeof(atf_amc::VarlenK)); // address of varlen portion -} - -// --- atf_amc.VarlenK.i.ReadStrptrMaybe -// Convert string to field. Return success value -bool atf_amc::i_ReadStrptrMaybe(atf_amc::VarlenK& k, algo::strptr in_str) { - bool retval = true; - if (algo_lib::_db.varlenbuf) { - u32 *i_tmp = new(ary_AllocN(*algo_lib::_db.varlenbuf, sizeof(u32)).elems) u32; - retval = u32_ReadStrptrMaybe(*i_tmp, in_str); - } - (void)k;//only to avoid -Wunused-parameter - return retval; -} - -// --- atf_amc.VarlenK..ReadFieldMaybe -bool atf_amc::VarlenK_ReadFieldMaybe(atf_amc::VarlenK& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - atf_amc::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); - switch(field_id) { - case atf_amc_FieldId_length: { - retval = false; - break; - } - case atf_amc_FieldId_i: { - retval = i_ReadStrptrMaybe(parent, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- atf_amc.VarlenK..ReadStrptrMaybe -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of atf_amc::VarlenK from an ascii string. -// The format of the string is an ssim Tuple -bool atf_amc::VarlenK_ReadStrptrMaybe(atf_amc::VarlenK &parent, algo::strptr in_str) { - bool retval = true; - retval = algo::StripTypeTag(in_str, "atf_amc.VarlenK"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && VarlenK_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; -} - -// --- atf_amc.VarlenK..Print -// print string representation of ROW to string STR -// cfmt:atf_amc.VarlenK.String printfmt:Tuple -void atf_amc::VarlenK_Print(atf_amc::VarlenK& row, algo::cstring& str) { - algo::tempstr temp; - str << "atf_amc.VarlenK"; - - ind_beg(k_i_curs,i,row) { - u32_Print(i, temp); - tempstr name; - name << "i."; - name << ind_curs(i).index; - PrintAttrSpaceReset(str, name, temp); - }ind_end; -} - // --- atf_amc.VarlenMsg.base.CopyOut // Copy fields out of row void atf_amc::parent_CopyOut(atf_amc::VarlenMsg &row, atf_amc::MsgHeader &out) { @@ -16630,21 +19123,18 @@ bool atf_amc::k_ReadStrptrMaybe(atf_amc::VarlenMsg& parent, algo::strptr in_str) bool retval = true; if (algo_lib::_db.varlenbuf) { atf_amc::VarlenK *k_tmp = new(ary_AllocN(*algo_lib::_db.varlenbuf, sizeof(atf_amc::VarlenK)).elems) atf_amc::VarlenK; + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; retval = atf_amc::VarlenK_ReadStrptrMaybe(*k_tmp, in_str); + algo_lib::_db.varlenbuf = varlenbuf_save; + (*k_tmp).length = atf_amc::MsgLength(sizeof(atf_amc::VarlenK)+ary_N(varlenbuf)); + ary_Addary(*algo_lib::_db.varlenbuf,varlenbuf); } (void)parent;//only to avoid -Wunused-parameter return retval; } -// --- atf_amc.VarlenMsg.k.XrefMaybe -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool atf_amc::k_XrefMaybe(atf_amc::VarlenK &row) { - bool retval = true; - (void)row; - return retval; -} - // --- atf_amc.VarlenMsg..ReadFieldMaybe bool atf_amc::VarlenMsg_ReadFieldMaybe(atf_amc::VarlenMsg& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -16653,21 +19143,20 @@ bool atf_amc::VarlenMsg_ReadFieldMaybe(atf_amc::VarlenMsg& parent, algo::strptr switch(field_id) { case atf_amc_FieldId_base: { retval = false; - break; - } + } break; case atf_amc_FieldId_type: { retval = false; - break; - } + } break; case atf_amc_FieldId_length: { retval = false; - break; - } + } break; case atf_amc_FieldId_k: { retval = k_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -16838,6 +19327,26 @@ bool atf_amc::MsgHeaderMsgs_Print(algo::cstring &str, atf_amc::MsgHeader &msg, u Text_Print((atf_amc::Text&)(msg), str); return true; } + case 0x1001: { + if (sizeof(atf_amc::Varlen2Msg) > msg_len) { return false; } + Varlen2Msg_Print((atf_amc::Varlen2Msg&)(msg), str); + return true; + } + case 0x1002: { + if (sizeof(atf_amc::Varlen2aMsg) > msg_len) { return false; } + Varlen2aMsg_Print((atf_amc::Varlen2aMsg&)(msg), str); + return true; + } + case 0x1004: { + if (sizeof(atf_amc::Varlen2mMsg) > msg_len) { return false; } + Varlen2mMsg_Print((atf_amc::Varlen2mMsg&)(msg), str); + return true; + } + case 0x1003: { + if (sizeof(atf_amc::Varlen2vMsg) > msg_len) { return false; } + Varlen2vMsg_Print((atf_amc::Varlen2vMsg&)(msg), str); + return true; + } case 0x1000: { if (sizeof(atf_amc::VarlenMsg) > msg_len) { return false; } VarlenMsg_Print((atf_amc::VarlenMsg&)(msg), str); @@ -17008,6 +19517,58 @@ atf_amc::MsgType atf_amc::MsgHeaderMsgs_ReadStrptr(algo::strptr str, algo::ByteA algo_lib::_db.varlenbuf = varlenbuf_save; } break; // atf_amc::Text case + case atf_amc_MsgType_atf_amc_Varlen2Msg: { + int len = sizeof(atf_amc::Varlen2Msg); + atf_amc::Varlen2Msg *ctype = new(ary_AllocN(buf, len).elems) atf_amc::Varlen2Msg; // default values + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + ok = Varlen2Msg_ReadStrptrMaybe(*ctype, str); // now read attributes + len += ary_N(varlenbuf); + ctype->length = atf_amc::MsgLength(len); + ary_Addary(buf, ary_Getary(varlenbuf)); + algo_lib::_db.varlenbuf = varlenbuf_save; + } break; // atf_amc::Varlen2Msg case + + case atf_amc_MsgType_atf_amc_Varlen2aMsg: { + int len = sizeof(atf_amc::Varlen2aMsg); + atf_amc::Varlen2aMsg *ctype = new(ary_AllocN(buf, len).elems) atf_amc::Varlen2aMsg; // default values + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + ok = Varlen2aMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + len += ary_N(varlenbuf); + ctype->length = atf_amc::MsgLength(len); + ary_Addary(buf, ary_Getary(varlenbuf)); + algo_lib::_db.varlenbuf = varlenbuf_save; + } break; // atf_amc::Varlen2aMsg case + + case atf_amc_MsgType_atf_amc_Varlen2mMsg: { + int len = sizeof(atf_amc::Varlen2mMsg); + atf_amc::Varlen2mMsg *ctype = new(ary_AllocN(buf, len).elems) atf_amc::Varlen2mMsg; // default values + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + ok = Varlen2mMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + len += ary_N(varlenbuf); + ctype->length = atf_amc::MsgLength(len); + ary_Addary(buf, ary_Getary(varlenbuf)); + algo_lib::_db.varlenbuf = varlenbuf_save; + } break; // atf_amc::Varlen2mMsg case + + case atf_amc_MsgType_atf_amc_Varlen2vMsg: { + int len = sizeof(atf_amc::Varlen2vMsg); + atf_amc::Varlen2vMsg *ctype = new(ary_AllocN(buf, len).elems) atf_amc::Varlen2vMsg; // default values + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + ok = Varlen2vMsg_ReadStrptrMaybe(*ctype, str); // now read attributes + len += ary_N(varlenbuf); + ctype->length = atf_amc::MsgLength(len); + ary_Addary(buf, ary_Getary(varlenbuf)); + algo_lib::_db.varlenbuf = varlenbuf_save; + } break; // atf_amc::Varlen2vMsg case + case atf_amc_MsgType_atf_amc_VarlenMsg: { int len = sizeof(atf_amc::VarlenMsg); atf_amc::VarlenMsg *ctype = new(ary_AllocN(buf, len).elems) atf_amc::VarlenMsg; // default values @@ -17057,13 +19618,13 @@ atf_amc::MsgLTO * atf_amc::MsgLTO_FmtByteAry(algo::ByteAry &buf, atf_amc::MsgHdr atf_amc::MsgLTV * atf_amc::MsgLTV_FmtByteAry(algo::ByteAry &buf, algo::memptr v) { atf_amc::MsgLTV *msg = NULL; size_t len = sizeof(atf_amc::MsgLTV); - u32 ary_len = elems_N(v) * sizeof(u8); - len += ary_len; + u32 v_ary_len = elems_N(v) * sizeof(u8); + len += v_ary_len; ary_RemoveAll(buf); msg = (atf_amc::MsgLTV*)ary_AllocN(buf,len).elems; msg->len = u8(len + (-2)); msg->type = char('V'); - memcpy(v_Addr(*msg), v.elems, ary_len); + memcpy(v_Addr(*msg), v.elems, v_ary_len); return msg; } @@ -17147,13 +19708,109 @@ atf_amc::OptOptG * atf_amc::OptOptG_FmtMemptr(algo::memptr &buf, atf_amc::OptG* atf_amc::Text * atf_amc::Text_FmtByteAry(algo::ByteAry &buf, algo::aryptr text) { atf_amc::Text *msg = NULL; size_t len = sizeof(atf_amc::Text); - u32 ary_len = elems_N(text) * sizeof(char); - len += ary_len; + u32 text_ary_len = elems_N(text) * sizeof(char); + len += text_ary_len; ary_RemoveAll(buf); msg = (atf_amc::Text*)ary_AllocN(buf,len).elems; msg->type = atf_amc::MsgType(0x0412); msg->length = atf_amc::MsgLength(len + (0)); - memcpy(text_Addr(*msg), text.elems, ary_len); + memcpy(text_Addr(*msg), text.elems, text_ary_len); + return msg; +} + +// --- atf_amc...Varlen2Msg_FmtByteAry +// Construct a new atf_amc::Varlen2Msg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +atf_amc::Varlen2Msg * atf_amc::Varlen2Msg_FmtByteAry(algo::ByteAry &buf, algo::aryptr s1, algo::aryptr s2, algo::aryptr s3) { + atf_amc::Varlen2Msg *msg = NULL; + size_t len = sizeof(atf_amc::Varlen2Msg); + u32 s1_ary_len = elems_N(s1) * sizeof(char); + len += s1_ary_len; + u32 s2_ary_len = elems_N(s2) * sizeof(char); + len += s2_ary_len; + u32 s3_ary_len = elems_N(s3) * sizeof(char); + len += s3_ary_len; + ary_RemoveAll(buf); + msg = (atf_amc::Varlen2Msg*)ary_AllocN(buf,len).elems; + msg->type = atf_amc::MsgType(0x1001); + msg->length = atf_amc::MsgLength(len + (0)); + memcpy(s1_Addr(*msg), s1.elems, s1_ary_len); + (*msg).s1_end = atf_amc::MsgLength(s1_ary_len); + memcpy(s2_Addr(*msg), s2.elems, s2_ary_len); + (*msg).s2_end = atf_amc::MsgLength((*msg).s1_end + s2_ary_len); + memcpy(s3_Addr(*msg), s3.elems, s3_ary_len); + return msg; +} + +// --- atf_amc...Varlen2aMsg_FmtByteAry +// Construct a new atf_amc::Varlen2aMsg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +atf_amc::Varlen2aMsg * atf_amc::Varlen2aMsg_FmtByteAry(algo::ByteAry &buf, algo::aryptr u1, algo::aryptr u2, algo::aryptr u3) { + atf_amc::Varlen2aMsg *msg = NULL; + size_t len = sizeof(atf_amc::Varlen2aMsg); + u32 u1_ary_len = elems_N(u1) * sizeof(u32); + len += u1_ary_len; + u32 u2_ary_len = elems_N(u2) * sizeof(u32); + len += u2_ary_len; + u32 u3_ary_len = elems_N(u3) * sizeof(u32); + len += u3_ary_len; + ary_RemoveAll(buf); + msg = (atf_amc::Varlen2aMsg*)ary_AllocN(buf,len).elems; + msg->type = atf_amc::MsgType(0x1002); + msg->length = atf_amc::MsgLength(len + (0)); + memcpy(u1_Addr(*msg), u1.elems, u1_ary_len); + (*msg).u1_end = atf_amc::MsgLength(u1_ary_len); + memcpy(u2_Addr(*msg), u2.elems, u2_ary_len); + (*msg).u2_end = atf_amc::MsgLength((*msg).u1_end + u2_ary_len); + memcpy(u3_Addr(*msg), u3.elems, u3_ary_len); + return msg; +} + +// --- atf_amc...Varlen2mMsg_FmtByteAry +// Construct a new atf_amc::Varlen2mMsg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +atf_amc::Varlen2mMsg * atf_amc::Varlen2mMsg_FmtByteAry(algo::ByteAry &buf, algo::memptr m1, algo::memptr m2, algo::memptr m3) { + atf_amc::Varlen2mMsg *msg = NULL; + size_t len = sizeof(atf_amc::Varlen2mMsg); + u32 m1_ary_len = elems_N(m1) * sizeof(u8); + len += m1_ary_len; + u32 m2_ary_len = elems_N(m2) * sizeof(u8); + len += m2_ary_len; + u32 m3_ary_len = elems_N(m3) * sizeof(u8); + len += m3_ary_len; + ary_RemoveAll(buf); + msg = (atf_amc::Varlen2mMsg*)ary_AllocN(buf,len).elems; + msg->type = atf_amc::MsgType(0x1004); + msg->length = atf_amc::MsgLength(len + (0)); + memcpy(m1_Addr(*msg), m1.elems, m1_ary_len); + (*msg).m1_end = atf_amc::MsgLength(m1_ary_len); + memcpy(m2_Addr(*msg), m2.elems, m2_ary_len); + (*msg).m2_end = atf_amc::MsgLength((*msg).m1_end + m2_ary_len); + memcpy(m3_Addr(*msg), m3.elems, m3_ary_len); + return msg; +} + +// --- atf_amc...Varlen2vMsg_FmtByteAry +// Construct a new atf_amc::Varlen2vMsg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +atf_amc::Varlen2vMsg * atf_amc::Varlen2vMsg_FmtByteAry(algo::ByteAry &buf, algo::memptr v1, algo::memptr v2, algo::memptr v3) { + atf_amc::Varlen2vMsg *msg = NULL; + size_t len = sizeof(atf_amc::Varlen2vMsg); + u32 v1_ary_len = elems_N(v1) * sizeof(u8); + len += v1_ary_len; + u32 v2_ary_len = elems_N(v2) * sizeof(u8); + len += v2_ary_len; + u32 v3_ary_len = elems_N(v3) * sizeof(u8); + len += v3_ary_len; + ary_RemoveAll(buf); + msg = (atf_amc::Varlen2vMsg*)ary_AllocN(buf,len).elems; + msg->type = atf_amc::MsgType(0x1003); + msg->length = atf_amc::MsgLength(len + (0)); + memcpy(v1_Addr(*msg), v1.elems, v1_ary_len); + (*msg).v1_end = atf_amc::MsgLength(v1_ary_len); + memcpy(v2_Addr(*msg), v2.elems, v2_ary_len); + (*msg).v2_end = atf_amc::MsgLength((*msg).v1_end + v2_ary_len); + memcpy(v3_Addr(*msg), v3.elems, v3_ary_len); return msg; } @@ -17163,12 +19820,12 @@ atf_amc::Text * atf_amc::Text_FmtByteAry(algo::ByteAry &buf, algo::aryptr atf_amc::VarlenK * atf_amc::VarlenK_FmtByteAry(algo::ByteAry &buf, algo::aryptr i) { atf_amc::VarlenK *msg = NULL; size_t len = sizeof(atf_amc::VarlenK); - u32 ary_len = elems_N(i) * sizeof(u32); - len += ary_len; + u32 i_ary_len = elems_N(i) * sizeof(u32); + len += i_ary_len; ary_RemoveAll(buf); msg = (atf_amc::VarlenK*)ary_AllocN(buf,len).elems; msg->length = u32(len + (0)); - memcpy(i_Addr(*msg), i.elems, ary_len); + memcpy(i_Addr(*msg), i.elems, i_ary_len); return msg; } @@ -17179,28 +19836,29 @@ atf_amc::VarlenK * atf_amc::VarlenK_FmtByteAry(algo::ByteAry &buf, algo::aryptr< atf_amc::VarlenK * atf_amc::VarlenK_FmtMemptr(algo::memptr &buf, algo::aryptr i) { atf_amc::VarlenK *msg = NULL; size_t len = sizeof(atf_amc::VarlenK); - u32 ary_len = elems_N(i) * sizeof(u32); - len += ary_len; + u32 i_ary_len = elems_N(i) * sizeof(u32); + len += i_ary_len; if (len > u32(elems_N(buf))) { return NULL; // no room. } msg = (atf_amc::VarlenK*)buf.elems; buf = RestFrom(buf,len); msg->length = u32(len + (0)); - memcpy(i_Addr(*msg), i.elems, ary_len); + memcpy(i_Addr(*msg), i.elems, i_ary_len); return msg; } // --- atf_amc...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); lib_exec::FDb_Init(); - lib_json::FDb_Init(); atf_amc::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock atf_amc::ReadArgv(); // dmmeta.main:atf_amc atf_amc::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -17212,9 +19870,9 @@ int main(int argc, char **argv) { } try { atf_amc::FDb_Uninit(); - lib_json::FDb_Uninit(); lib_exec::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/atf_ci_gen.cpp b/cpp/gen/atf_ci_gen.cpp index a20ca818..98b56275 100644 --- a/cpp/gen/atf_ci_gen.cpp +++ b/cpp/gen/atf_ci_gen.cpp @@ -35,6 +35,8 @@ #include "include/gen/command_gen.inl.h" #include "include/gen/dmmeta_gen.h" #include "include/gen/dmmeta_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_amcdb_gen.h" @@ -43,42 +45,41 @@ #include "include/gen/lib_ctype_gen.inl.h" #include "include/gen/lib_git_gen.h" #include "include/gen/lib_git_gen.inl.h" -#include "include/gen/lib_json_gen.h" -#include "include/gen/lib_json_gen.inl.h" #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_ctype::FDb lib_ctype::_db; // dependency found via dev.targdep lib_git::FDb lib_git::_db; // dependency found via dev.targdep -lib_json::FDb lib_json::_db; // dependency found via dev.targdep atf_ci::FDb atf_ci::_db; // dependency found via dev.targdep namespace atf_ci { const char *atf_ci_help = "atf_ci: Normalization tests (see citest table)\n" "Usage: atf_ci [[-citest:]] [options]\n" -" OPTION TYPE DFLT COMMENT\n" -" -in string \"data\" Input directory or filename, - for stdin\n" -" [citest] regx \"%\" Regx of tests to run\n" -" -maxerr int 0 Exit after this many errors\n" -" -cijob regx \"%\"\n" -" -capture Capture the output of the test\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" -" -help Print help and exit; alias -h\n" -" -version Print version and exit\n" -" -signature Show signatures and exit; alias -sig\n" +" OPTION TYPE DFLT COMMENT\n" +" -in string \"data\" Input directory or filename, - for stdin\n" +" [citest] regx \"%\" Regx of tests to run\n" +" -maxerr int 0 Exit after this many errors\n" +" -cijob regx \"%\"\n" +" -capture Capture the output of the test\n" +" -check_clean Y Check for modifications after each test\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" +" -help Print help and exit; alias -h\n" +" -version Print version and exit\n" +" -signature Show signatures and exit; alias -sig\n" ; } // namespace atf_ci namespace atf_ci { // gen:ns_gsymbol const atfdb::CijobPkey atfdb_cijob_comp("comp"); - const atfdb::CijobPkey atfdb_cijob_cov("cov"); + const atfdb::CijobPkey atfdb_cijob_coverage("coverage"); const atfdb::CijobPkey atfdb_cijob_memcheck("memcheck"); const atfdb::CijobPkey atfdb_cijob_normalize("normalize"); } // gen:ns_gsymbol @@ -108,8 +109,8 @@ namespace atf_ci { // gen:ns_print_proto static bool scriptfile_InputMaybe(dev::Scriptfile &elem) __attribute__((nothrow)); // func:atf_ci.FDb.ns.InputMaybe static bool ns_InputMaybe(dmmeta::Ns &elem) __attribute__((nothrow)); - // func:atf_ci.FDb.readme.InputMaybe - static bool readme_InputMaybe(dev::Readme &elem) __attribute__((nothrow)); + // func:atf_ci.FDb.readmefile.InputMaybe + static bool readmefile_InputMaybe(dev::Readmefile &elem) __attribute__((nothrow)); // func:atf_ci.FDb.builddir.InputMaybe static bool builddir_InputMaybe(dev::Builddir &elem) __attribute__((nothrow)); // func:atf_ci.FDb.cfg.InputMaybe @@ -333,9 +334,8 @@ void atf_ci::ReadArgv() { } if (ch_N(attrname) == 0) { err << "atf_ci: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:atf_ci.FDb.cmdline @@ -389,7 +392,7 @@ void atf_ci::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -434,7 +437,7 @@ static void atf_ci::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'atf_ci.Input' signature:'7a8e5cb51bc025925f1aa7f6a12998146ebda21c'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'atf_ci.Input' signature:'572ca634bbac62d53a8602668fbaa85db3b791f8'"); } // --- atf_ci.FDb._db.InsertStrptrMaybe @@ -463,10 +466,10 @@ bool atf_ci::InsertStrptrMaybe(algo::strptr str) { retval = retval && ns_InputMaybe(elem); break; } - case atf_ci_TableId_dev_Readme: { // finput:atf_ci.FDb.readme - dev::Readme elem; - retval = dev::Readme_ReadStrptrMaybe(elem, str); - retval = retval && readme_InputMaybe(elem); + case atf_ci_TableId_dev_Readmefile: { // finput:atf_ci.FDb.readmefile + dev::Readmefile elem; + retval = dev::Readmefile_ReadStrptrMaybe(elem, str); + retval = retval && readmefile_InputMaybe(elem); break; } case atf_ci_TableId_dev_Builddir: { // finput:atf_ci.FDb.builddir @@ -529,7 +532,6 @@ bool atf_ci::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (root == "-") { retval = atf_ci::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); } else if (DirectoryQ(root)) { - retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dev.gitfile"),recursive); retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dmmeta.ns"),recursive); retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dmmeta.ctype"),recursive); retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dmmeta.field"),recursive); @@ -543,9 +545,10 @@ bool atf_ci::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dmmeta.cfmt"),recursive); retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dmmeta.cdflt"),recursive); retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dev.unstablefld"),recursive); + retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dev.gitfile"),recursive); retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dev.targsrc"),recursive); retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dev.scriptfile"),recursive); - retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dev.readme"),recursive); + retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dev.readmefile"),recursive); retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dev.noindent"),recursive); retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dev.msgfile"),recursive); retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"dev.cfg"),recursive); @@ -553,8 +556,8 @@ bool atf_ci::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"atfdb.cipackage"),recursive); retval = retval && atf_ci::LoadTuplesFile(algo::SsimFname(root,"amcdb.bltin"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -712,9 +715,10 @@ static void atf_ci::citest_LoadStatic() { void (*step)(); } data[] = { { "atfdb.citest citest:checkclean cijob:normalize sandbox:N comment:\"Check that no files are modified\"", atf_ci::citest_checkclean } - ,{ "atfdb.citest citest:atf_amc cijob:comp sandbox:N comment:\"Test amc (run atf_amc)\"", atf_ci::citest_atf_amc } + ,{ "atfdb.citest citest:cleantemp cijob:normalize sandbox:N comment:\"Clean out temp directory every once in a while\"", atf_ci::citest_cleantemp } ,{ "atfdb.citest citest:gitfile cijob:normalize sandbox:N comment:\"Update gitfile tables by scanning filesystem\"", atf_ci::citest_gitfile } ,{ "atfdb.citest citest:scanreadme cijob:normalize sandbox:N comment:\"Update readme tables by scanning filesystem\"", atf_ci::citest_scanreadme } + ,{ "atfdb.citest citest:quickreadme cijob:normalize sandbox:N comment:\"Quick re-generate of readmes (without evaluation)\"", atf_ci::citest_quickreadme } ,{ "atfdb.citest citest:ssimfile cijob:normalize sandbox:N comment:\"Check for .ssim files with no corresponding ssimfile entry\"", atf_ci::citest_ssimfile } ,{ "atfdb.citest citest:normalize_acr cijob:normalize sandbox:N comment:\"Read ssim databases into memory and write back\"", atf_ci::citest_normalize_acr } ,{ "atfdb.citest citest:src_lim cijob:normalize sandbox:N comment:\"Source code police\"", atf_ci::citest_src_lim } @@ -722,30 +726,34 @@ static void atf_ci::citest_LoadStatic() { ,{ "atfdb.citest citest:bootstrap cijob:normalize sandbox:N comment:\"Re-generate bootstrap files\"", atf_ci::citest_bootstrap } ,{ "atfdb.citest citest:shebang cijob:normalize sandbox:N comment:\"\"", atf_ci::citest_shebang } ,{ "atfdb.citest citest:encoding cijob:normalize sandbox:N comment:\"Check Encoding of h/cpp files\"", atf_ci::citest_encoding } - ,{ "atfdb.citest citest:readme cijob:normalize sandbox:N comment:\"Re-generate readme files\"", atf_ci::citest_readme } ,{ "atfdb.citest citest:file_header cijob:normalize sandbox:N comment:\"Update headers in source files\"", atf_ci::citest_file_header } ,{ "atfdb.citest citest:non-copyrighted cijob:normalize sandbox:N comment:\"Find non-copyrighted files\"", atf_ci::citest_non_copyrighted } ,{ "atfdb.citest citest:iffy_src cijob:normalize sandbox:N comment:\"Check for iffy source constructs with src_func\"", atf_ci::citest_iffy_src } ,{ "atfdb.citest citest:stray_gen cijob:normalize sandbox:N comment:\"*/gen/* file that doesn't appear to be generated by amc\"", atf_ci::citest_stray_gen } ,{ "atfdb.citest citest:tempcode cijob:normalize sandbox:N comment:\"Check for temp code inserted for testing only\"", atf_ci::citest_tempcode } ,{ "atfdb.citest citest:lineendings cijob:normalize sandbox:N comment:\"Correct windows-style line endings in known text files\"", atf_ci::citest_lineendings } + ,{ "atfdb.citest citest:update_script cijob:normalize sandbox:N comment:\"Update scriptfile table\"", atf_ci::citest_update_script } ,{ "atfdb.citest citest:indent_script cijob:normalize sandbox:N comment:\"Indent any bash script file\"", atf_ci::citest_indent_script } - ,{ "atfdb.citest citest:comptest cijob:comp sandbox:N comment:\"Rewrite/normalize component tests\"", atf_ci::citest_comptest } - ,{ "atfdb.citest citest:cppcheck cijob:comp sandbox:N comment:\"Cppcheck static code analysis\"", atf_ci::citest_cppcheck } - ,{ "atfdb.citest citest:bintests cijob:comp sandbox:N comment:\"Run bin/test-* scripts\"", atf_ci::citest_bintests } + ,{ "atfdb.citest citest:cppcheck cijob:normalize sandbox:N comment:\"Cppcheck static code analysis\"", atf_ci::citest_cppcheck } ,{ "atfdb.citest citest:indent_srcfile cijob:normalize sandbox:N comment:\"Indent any source files modified in last commit\"", atf_ci::citest_indent_srcfile } + ,{ "atfdb.citest citest:readme cijob:normalize sandbox:N comment:\"Re-generate readme files\"", atf_ci::citest_readme } ,{ "atfdb.citest citest:normalize_amc_vis cijob:normalize sandbox:N comment:\"Check that amc_vis doesn't see any circular dependencies\"", atf_ci::citest_normalize_amc_vis } ,{ "atfdb.citest citest:normalize_acr_my cijob:normalize sandbox:N comment:\"Round trip ssim databases through MariaDB and back\"", atf_ci::citest_normalize_acr_my } ,{ "atfdb.citest citest:apm_check cijob:normalize sandbox:N comment:\"\"", atf_ci::citest_apm_check } + ,{ "atfdb.citest citest:atf_amc cijob:comp sandbox:N comment:\"Test amc (run atf_amc)\"", atf_ci::citest_atf_amc } + ,{ "atfdb.citest citest:comptest cijob:comp sandbox:N comment:\"Rewrite/normalize component tests\"", atf_ci::citest_comptest } + ,{ "atfdb.citest citest:bintests cijob:comp sandbox:N comment:\"Run bin/test-* scripts\"", atf_ci::citest_bintests } ,{ "atfdb.citest citest:atf_unit cijob:comp sandbox:N comment:\"Run unit tests\"", atf_ci::citest_atf_unit } ,{ "atfdb.citest citest:atf_comp cijob:comp sandbox:N comment:\"Run component tests\"", atf_ci::citest_atf_comp } - ,{ "atfdb.citest citest:atf_comp_cov cijob:cov sandbox:N comment:\"Check component test coverage\"", atf_ci::citest_atf_comp_cov } - ,{ "atfdb.citest citest:apm cijob:comp sandbox:Y comment:\"Test APM\"", atf_ci::citest_apm } - ,{ "atfdb.citest citest:atf_comp_mem cijob:memcheck sandbox:N comment:\"Run component tests in memcheck mode (slow)\"", atf_ci::citest_atf_comp_mem } + ,{ "atfdb.citest citest:atf_comp_cov cijob:coverage sandbox:N comment:\"Check component test coverage\"", atf_ci::citest_atf_comp_cov } ,{ "atfdb.citest citest:acr_ed_ssimfile cijob:comp sandbox:Y comment:\"Create a new ssimfile\"", atf_ci::citest_acr_ed_ssimfile } ,{ "atfdb.citest citest:acr_ed_ssimdb cijob:comp sandbox:Y comment:\"Create a new ssimdb\"", atf_ci::citest_acr_ed_ssimdb } - ,{ "atfdb.citest citest:apm_reinstall cijob:comp sandbox:Y comment:\"Check that packages are removable\"", atf_ci::citest_apm_reinstall } + ,{ "atfdb.citest citest:acr_ed_unittest cijob:comp sandbox:Y comment:\"Create a new unit test\"", atf_ci::citest_acr_ed_unittest } ,{ "atfdb.citest citest:acr_ed_target cijob:comp sandbox:Y comment:\"Takes a while - do it last\"", atf_ci::citest_acr_ed_target } + ,{ "atfdb.citest citest:apm cijob:comp sandbox:Y comment:\"Test APM\"", atf_ci::citest_apm } + ,{ "atfdb.citest citest:apm_reinstall cijob:comp sandbox:Y comment:\"Check that packages are removable\"", atf_ci::citest_apm_reinstall } + ,{ "atfdb.citest citest:abt_md_after_ssimfile_is_added cijob:comp sandbox:Y comment:\"Test that directory README.md is updated with all new .md files\"", atf_ci::citest_abt_md_after_ssimfile_is_added } + ,{ "atfdb.citest citest:atf_comp_mem cijob:memcheck sandbox:N comment:\"Run component tests in memcheck mode (slow)\"", atf_ci::citest_atf_comp_mem } ,{NULL, NULL} }; (void)data; @@ -879,14 +887,9 @@ bool atf_ci::ssimfile_XrefMaybe(atf_ci::FSsimfile &row) { // Find row by key. Return NULL if not found. atf_ci::FSsimfile* atf_ci::ind_ssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimfile_buckets_n - 1); - atf_ci::FSsimfile* *e = &_db.ind_ssimfile_buckets_elems[index]; - atf_ci::FSsimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimfile_next; - } while (true); + atf_ci::FSsimfile *ret = _db.ind_ssimfile_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimfile_next) { + } return ret; } @@ -918,10 +921,11 @@ atf_ci::FSsimfile& atf_ci::ind_ssimfile_GetOrCreate(const algo::strptr& key) { // --- atf_ci.FDb.ind_ssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_ci::ind_ssimfile_InsertMaybe(atf_ci::FSsimfile& row) { - ind_ssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimfile_next == (atf_ci::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + row.ind_ssimfile_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimfile_Reserve(1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); atf_ci::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; do { atf_ci::FSsimfile* ret = *prev; @@ -947,7 +951,7 @@ bool atf_ci::ind_ssimfile_InsertMaybe(atf_ci::FSsimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_ci::ind_ssimfile_Remove(atf_ci::FSsimfile& row) { if (LIKELY(row.ind_ssimfile_next != (atf_ci::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); atf_ci::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; // addr of pointer to current element while (atf_ci::FSsimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -964,8 +968,14 @@ void atf_ci::ind_ssimfile_Remove(atf_ci::FSsimfile& row) { // --- atf_ci.FDb.ind_ssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_ci::ind_ssimfile_Reserve(int n) { + ind_ssimfile_AbsReserve(_db.ind_ssimfile_n + n); +} + +// --- atf_ci.FDb.ind_ssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_ci::ind_ssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimfile_buckets_n; - u32 new_nelems = _db.ind_ssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -984,7 +994,7 @@ void atf_ci::ind_ssimfile_Reserve(int n) { while (elem) { atf_ci::FSsimfile &row = *elem; atf_ci::FSsimfile* next = row.ind_ssimfile_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimfile_hashval & (new_nbuckets-1); row.ind_ssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1122,14 +1132,9 @@ bool atf_ci::scriptfile_XrefMaybe(atf_ci::FScriptfile &row) { // Find row by key. Return NULL if not found. atf_ci::FScriptfile* atf_ci::ind_scriptfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_scriptfile_buckets_n - 1); - atf_ci::FScriptfile* *e = &_db.ind_scriptfile_buckets_elems[index]; - atf_ci::FScriptfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gitfile == key; - if (done) break; - e = &ret->ind_scriptfile_next; - } while (true); + atf_ci::FScriptfile *ret = _db.ind_scriptfile_buckets_elems[index]; + for (; ret && !((*ret).gitfile == key); ret = ret->ind_scriptfile_next) { + } return ret; } @@ -1144,10 +1149,11 @@ atf_ci::FScriptfile& atf_ci::ind_scriptfile_FindX(const algo::strptr& key) { // --- atf_ci.FDb.ind_scriptfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_ci::ind_scriptfile_InsertMaybe(atf_ci::FScriptfile& row) { - ind_scriptfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_scriptfile_next == (atf_ci::FScriptfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (_db.ind_scriptfile_buckets_n - 1); + row.ind_scriptfile_hashval = algo::Smallstr200_Hash(0, row.gitfile); + ind_scriptfile_Reserve(1); + u32 index = row.ind_scriptfile_hashval & (_db.ind_scriptfile_buckets_n - 1); atf_ci::FScriptfile* *prev = &_db.ind_scriptfile_buckets_elems[index]; do { atf_ci::FScriptfile* ret = *prev; @@ -1173,7 +1179,7 @@ bool atf_ci::ind_scriptfile_InsertMaybe(atf_ci::FScriptfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_ci::ind_scriptfile_Remove(atf_ci::FScriptfile& row) { if (LIKELY(row.ind_scriptfile_next != (atf_ci::FScriptfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (_db.ind_scriptfile_buckets_n - 1); + u32 index = row.ind_scriptfile_hashval & (_db.ind_scriptfile_buckets_n - 1); atf_ci::FScriptfile* *prev = &_db.ind_scriptfile_buckets_elems[index]; // addr of pointer to current element while (atf_ci::FScriptfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1190,8 +1196,14 @@ void atf_ci::ind_scriptfile_Remove(atf_ci::FScriptfile& row) { // --- atf_ci.FDb.ind_scriptfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_ci::ind_scriptfile_Reserve(int n) { + ind_scriptfile_AbsReserve(_db.ind_scriptfile_n + n); +} + +// --- atf_ci.FDb.ind_scriptfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_ci::ind_scriptfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_scriptfile_buckets_n; - u32 new_nelems = _db.ind_scriptfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1210,7 +1222,7 @@ void atf_ci::ind_scriptfile_Reserve(int n) { while (elem) { atf_ci::FScriptfile &row = *elem; atf_ci::FScriptfile* next = row.ind_scriptfile_next; - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (new_nbuckets-1); + u32 index = row.ind_scriptfile_hashval & (new_nbuckets-1); row.ind_scriptfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1334,14 +1346,9 @@ bool atf_ci::ns_XrefMaybe(atf_ci::FNs &row) { // Find row by key. Return NULL if not found. atf_ci::FNs* atf_ci::ind_ns_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_ns_buckets_n - 1); - atf_ci::FNs* *e = &_db.ind_ns_buckets_elems[index]; - atf_ci::FNs* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ns == key; - if (done) break; - e = &ret->ind_ns_next; - } while (true); + atf_ci::FNs *ret = _db.ind_ns_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_ns_next) { + } return ret; } @@ -1373,10 +1380,11 @@ atf_ci::FNs& atf_ci::ind_ns_GetOrCreate(const algo::strptr& key) { // --- atf_ci.FDb.ind_ns.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_ci::ind_ns_InsertMaybe(atf_ci::FNs& row) { - ind_ns_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ns_next == (atf_ci::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + row.ind_ns_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_ns_Reserve(1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); atf_ci::FNs* *prev = &_db.ind_ns_buckets_elems[index]; do { atf_ci::FNs* ret = *prev; @@ -1402,7 +1410,7 @@ bool atf_ci::ind_ns_InsertMaybe(atf_ci::FNs& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_ci::ind_ns_Remove(atf_ci::FNs& row) { if (LIKELY(row.ind_ns_next != (atf_ci::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); atf_ci::FNs* *prev = &_db.ind_ns_buckets_elems[index]; // addr of pointer to current element while (atf_ci::FNs *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1419,8 +1427,14 @@ void atf_ci::ind_ns_Remove(atf_ci::FNs& row) { // --- atf_ci.FDb.ind_ns.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_ci::ind_ns_Reserve(int n) { + ind_ns_AbsReserve(_db.ind_ns_n + n); +} + +// --- atf_ci.FDb.ind_ns.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_ci::ind_ns_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ns_buckets_n; - u32 new_nelems = _db.ind_ns_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1439,7 +1453,7 @@ void atf_ci::ind_ns_Reserve(int n) { while (elem) { atf_ci::FNs &row = *elem; atf_ci::FNs* next = row.ind_ns_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_ns_hashval & (new_nbuckets-1); row.ind_ns_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1452,99 +1466,99 @@ void atf_ci::ind_ns_Reserve(int n) { } } -// --- atf_ci.FDb.readme.Alloc +// --- atf_ci.FDb.readmefile.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -atf_ci::FReadme& atf_ci::readme_Alloc() { - atf_ci::FReadme* row = readme_AllocMaybe(); +atf_ci::FReadmefile& atf_ci::readmefile_Alloc() { + atf_ci::FReadmefile* row = readmefile_AllocMaybe(); if (UNLIKELY(row == NULL)) { - FatalErrorExit("atf_ci.out_of_mem field:atf_ci.FDb.readme comment:'Alloc failed'"); + FatalErrorExit("atf_ci.out_of_mem field:atf_ci.FDb.readmefile comment:'Alloc failed'"); } return *row; } -// --- atf_ci.FDb.readme.AllocMaybe +// --- atf_ci.FDb.readmefile.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -atf_ci::FReadme* atf_ci::readme_AllocMaybe() { - atf_ci::FReadme *row = (atf_ci::FReadme*)readme_AllocMem(); +atf_ci::FReadmefile* atf_ci::readmefile_AllocMaybe() { + atf_ci::FReadmefile *row = (atf_ci::FReadmefile*)readmefile_AllocMem(); if (row) { - new (row) atf_ci::FReadme; // call constructor + new (row) atf_ci::FReadmefile; // call constructor } return row; } -// --- atf_ci.FDb.readme.InsertMaybe +// --- atf_ci.FDb.readmefile.InsertMaybe // Create new row from struct. // Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -atf_ci::FReadme* atf_ci::readme_InsertMaybe(const dev::Readme &value) { - atf_ci::FReadme *row = &readme_Alloc(); // if out of memory, process dies. if input error, return NULL. - readme_CopyIn(*row,const_cast(value)); - bool ok = readme_XrefMaybe(*row); // this may return false +atf_ci::FReadmefile* atf_ci::readmefile_InsertMaybe(const dev::Readmefile &value) { + atf_ci::FReadmefile *row = &readmefile_Alloc(); // if out of memory, process dies. if input error, return NULL. + readmefile_CopyIn(*row,const_cast(value)); + bool ok = readmefile_XrefMaybe(*row); // this may return false if (!ok) { - readme_RemoveLast(); // delete offending row, any existing xrefs are cleared + readmefile_RemoveLast(); // delete offending row, any existing xrefs are cleared row = NULL; // forget this ever happened } return row; } -// --- atf_ci.FDb.readme.AllocMem +// --- atf_ci.FDb.readmefile.AllocMem // Allocate space for one element. If no memory available, return NULL. -void* atf_ci::readme_AllocMem() { - u64 new_nelems = _db.readme_n+1; +void* atf_ci::readmefile_AllocMem() { + u64 new_nelems = _db.readmefile_n+1; // compute level and index on level u64 bsr = algo::u64_BitScanReverse(new_nelems); u64 base = u64(1)<0; ) { +void atf_ci::readmefile_RemoveAll() { + for (u64 n = _db.readmefile_n; n>0; ) { n--; - readme_qFind(u64(n)).~FReadme(); // destroy last element - _db.readme_n = i32(n); + readmefile_qFind(u64(n)).~FReadmefile(); // destroy last element + _db.readmefile_n = i32(n); } } -// --- atf_ci.FDb.readme.RemoveLast +// --- atf_ci.FDb.readmefile.RemoveLast // Delete last element of array. Do nothing if array is empty. -void atf_ci::readme_RemoveLast() { - u64 n = _db.readme_n; +void atf_ci::readmefile_RemoveLast() { + u64 n = _db.readmefile_n; if (n > 0) { n -= 1; - readme_qFind(u64(n)).~FReadme(); - _db.readme_n = i32(n); + readmefile_qFind(u64(n)).~FReadmefile(); + _db.readmefile_n = i32(n); } } -// --- atf_ci.FDb.readme.InputMaybe -static bool atf_ci::readme_InputMaybe(dev::Readme &elem) { +// --- atf_ci.FDb.readmefile.InputMaybe +static bool atf_ci::readmefile_InputMaybe(dev::Readmefile &elem) { bool retval = true; - retval = readme_InsertMaybe(elem) != nullptr; + retval = readmefile_InsertMaybe(elem) != nullptr; return retval; } -// --- atf_ci.FDb.readme.XrefMaybe +// --- atf_ci.FDb.readmefile.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool atf_ci::readme_XrefMaybe(atf_ci::FReadme &row) { +bool atf_ci::readmefile_XrefMaybe(atf_ci::FReadmefile &row) { bool retval = true; (void)row; return retval; @@ -1759,14 +1773,9 @@ bool atf_ci::cfg_XrefMaybe(atf_ci::FCfg &row) { // Find row by key. Return NULL if not found. atf_ci::FBuilddir* atf_ci::ind_builddir_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_builddir_buckets_n - 1); - atf_ci::FBuilddir* *e = &_db.ind_builddir_buckets_elems[index]; - atf_ci::FBuilddir* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).builddir == key; - if (done) break; - e = &ret->ind_builddir_next; - } while (true); + atf_ci::FBuilddir *ret = _db.ind_builddir_buckets_elems[index]; + for (; ret && !((*ret).builddir == key); ret = ret->ind_builddir_next) { + } return ret; } @@ -1798,10 +1807,11 @@ atf_ci::FBuilddir& atf_ci::ind_builddir_GetOrCreate(const algo::strptr& key) { // --- atf_ci.FDb.ind_builddir.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_ci::ind_builddir_InsertMaybe(atf_ci::FBuilddir& row) { - ind_builddir_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_builddir_next == (atf_ci::FBuilddir*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.builddir) & (_db.ind_builddir_buckets_n - 1); + row.ind_builddir_hashval = algo::Smallstr50_Hash(0, row.builddir); + ind_builddir_Reserve(1); + u32 index = row.ind_builddir_hashval & (_db.ind_builddir_buckets_n - 1); atf_ci::FBuilddir* *prev = &_db.ind_builddir_buckets_elems[index]; do { atf_ci::FBuilddir* ret = *prev; @@ -1827,7 +1837,7 @@ bool atf_ci::ind_builddir_InsertMaybe(atf_ci::FBuilddir& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_ci::ind_builddir_Remove(atf_ci::FBuilddir& row) { if (LIKELY(row.ind_builddir_next != (atf_ci::FBuilddir*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.builddir) & (_db.ind_builddir_buckets_n - 1); + u32 index = row.ind_builddir_hashval & (_db.ind_builddir_buckets_n - 1); atf_ci::FBuilddir* *prev = &_db.ind_builddir_buckets_elems[index]; // addr of pointer to current element while (atf_ci::FBuilddir *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1844,8 +1854,14 @@ void atf_ci::ind_builddir_Remove(atf_ci::FBuilddir& row) { // --- atf_ci.FDb.ind_builddir.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_ci::ind_builddir_Reserve(int n) { + ind_builddir_AbsReserve(_db.ind_builddir_n + n); +} + +// --- atf_ci.FDb.ind_builddir.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_ci::ind_builddir_AbsReserve(int n) { u32 old_nbuckets = _db.ind_builddir_buckets_n; - u32 new_nelems = _db.ind_builddir_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1864,7 +1880,7 @@ void atf_ci::ind_builddir_Reserve(int n) { while (elem) { atf_ci::FBuilddir &row = *elem; atf_ci::FBuilddir* next = row.ind_builddir_next; - u32 index = algo::Smallstr50_Hash(0, row.builddir) & (new_nbuckets-1); + u32 index = row.ind_builddir_hashval & (new_nbuckets-1); row.ind_builddir_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1988,14 +2004,9 @@ bool atf_ci::gitfile_XrefMaybe(atf_ci::FGitfile &row) { // Find row by key. Return NULL if not found. atf_ci::FGitfile* atf_ci::ind_gitfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_gitfile_buckets_n - 1); - atf_ci::FGitfile* *e = &_db.ind_gitfile_buckets_elems[index]; - atf_ci::FGitfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gitfile == key; - if (done) break; - e = &ret->ind_gitfile_next; - } while (true); + atf_ci::FGitfile *ret = _db.ind_gitfile_buckets_elems[index]; + for (; ret && !((*ret).gitfile == key); ret = ret->ind_gitfile_next) { + } return ret; } @@ -2027,10 +2038,11 @@ atf_ci::FGitfile& atf_ci::ind_gitfile_GetOrCreate(const algo::strptr& key) { // --- atf_ci.FDb.ind_gitfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_ci::ind_gitfile_InsertMaybe(atf_ci::FGitfile& row) { - ind_gitfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gitfile_next == (atf_ci::FGitfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (_db.ind_gitfile_buckets_n - 1); + row.ind_gitfile_hashval = algo::Smallstr200_Hash(0, row.gitfile); + ind_gitfile_Reserve(1); + u32 index = row.ind_gitfile_hashval & (_db.ind_gitfile_buckets_n - 1); atf_ci::FGitfile* *prev = &_db.ind_gitfile_buckets_elems[index]; do { atf_ci::FGitfile* ret = *prev; @@ -2056,7 +2068,7 @@ bool atf_ci::ind_gitfile_InsertMaybe(atf_ci::FGitfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_ci::ind_gitfile_Remove(atf_ci::FGitfile& row) { if (LIKELY(row.ind_gitfile_next != (atf_ci::FGitfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (_db.ind_gitfile_buckets_n - 1); + u32 index = row.ind_gitfile_hashval & (_db.ind_gitfile_buckets_n - 1); atf_ci::FGitfile* *prev = &_db.ind_gitfile_buckets_elems[index]; // addr of pointer to current element while (atf_ci::FGitfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2073,8 +2085,14 @@ void atf_ci::ind_gitfile_Remove(atf_ci::FGitfile& row) { // --- atf_ci.FDb.ind_gitfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_ci::ind_gitfile_Reserve(int n) { + ind_gitfile_AbsReserve(_db.ind_gitfile_n + n); +} + +// --- atf_ci.FDb.ind_gitfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_ci::ind_gitfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gitfile_buckets_n; - u32 new_nelems = _db.ind_gitfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2093,7 +2111,7 @@ void atf_ci::ind_gitfile_Reserve(int n) { while (elem) { atf_ci::FGitfile &row = *elem; atf_ci::FGitfile* next = row.ind_gitfile_next; - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (new_nbuckets-1); + u32 index = row.ind_gitfile_hashval & (new_nbuckets-1); row.ind_gitfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2432,14 +2450,9 @@ bool atf_ci::msgfile_XrefMaybe(atf_ci::FMsgfile &row) { // Find row by key. Return NULL if not found. atf_ci::FCitest* atf_ci::ind_citest_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_citest_buckets_n - 1); - atf_ci::FCitest* *e = &_db.ind_citest_buckets_elems[index]; - atf_ci::FCitest* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).citest == key; - if (done) break; - e = &ret->ind_citest_next; - } while (true); + atf_ci::FCitest *ret = _db.ind_citest_buckets_elems[index]; + for (; ret && !((*ret).citest == key); ret = ret->ind_citest_next) { + } return ret; } @@ -2471,10 +2484,11 @@ atf_ci::FCitest& atf_ci::ind_citest_GetOrCreate(const algo::strptr& key) { // --- atf_ci.FDb.ind_citest.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_ci::ind_citest_InsertMaybe(atf_ci::FCitest& row) { - ind_citest_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_citest_next == (atf_ci::FCitest*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.citest) & (_db.ind_citest_buckets_n - 1); + row.ind_citest_hashval = algo::Smallstr50_Hash(0, row.citest); + ind_citest_Reserve(1); + u32 index = row.ind_citest_hashval & (_db.ind_citest_buckets_n - 1); atf_ci::FCitest* *prev = &_db.ind_citest_buckets_elems[index]; do { atf_ci::FCitest* ret = *prev; @@ -2500,7 +2514,7 @@ bool atf_ci::ind_citest_InsertMaybe(atf_ci::FCitest& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_ci::ind_citest_Remove(atf_ci::FCitest& row) { if (LIKELY(row.ind_citest_next != (atf_ci::FCitest*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.citest) & (_db.ind_citest_buckets_n - 1); + u32 index = row.ind_citest_hashval & (_db.ind_citest_buckets_n - 1); atf_ci::FCitest* *prev = &_db.ind_citest_buckets_elems[index]; // addr of pointer to current element while (atf_ci::FCitest *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2517,8 +2531,14 @@ void atf_ci::ind_citest_Remove(atf_ci::FCitest& row) { // --- atf_ci.FDb.ind_citest.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_ci::ind_citest_Reserve(int n) { + ind_citest_AbsReserve(_db.ind_citest_n + n); +} + +// --- atf_ci.FDb.ind_citest.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_ci::ind_citest_AbsReserve(int n) { u32 old_nbuckets = _db.ind_citest_buckets_n; - u32 new_nelems = _db.ind_citest_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2537,7 +2557,7 @@ void atf_ci::ind_citest_Reserve(int n) { while (elem) { atf_ci::FCitest &row = *elem; atf_ci::FCitest* next = row.ind_citest_next; - u32 index = algo::Smallstr50_Hash(0, row.citest) & (new_nbuckets-1); + u32 index = row.ind_citest_hashval & (new_nbuckets-1); row.ind_citest_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2640,14 +2660,9 @@ bool atf_ci::file_XrefMaybe(atf_ci::File &row) { // Find row by key. Return NULL if not found. atf_ci::File* atf_ci::ind_file_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_file_buckets_n - 1); - atf_ci::File* *e = &_db.ind_file_buckets_elems[index]; - atf_ci::File* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).file == key; - if (done) break; - e = &ret->ind_file_next; - } while (true); + atf_ci::File *ret = _db.ind_file_buckets_elems[index]; + for (; ret && !((*ret).file == key); ret = ret->ind_file_next) { + } return ret; } @@ -2679,10 +2694,11 @@ atf_ci::File& atf_ci::ind_file_GetOrCreate(const algo::strptr& key) { // --- atf_ci.FDb.ind_file.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_ci::ind_file_InsertMaybe(atf_ci::File& row) { - ind_file_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_file_next == (atf_ci::File*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.file) & (_db.ind_file_buckets_n - 1); + row.ind_file_hashval = algo::cstring_Hash(0, row.file); + ind_file_Reserve(1); + u32 index = row.ind_file_hashval & (_db.ind_file_buckets_n - 1); atf_ci::File* *prev = &_db.ind_file_buckets_elems[index]; do { atf_ci::File* ret = *prev; @@ -2708,7 +2724,7 @@ bool atf_ci::ind_file_InsertMaybe(atf_ci::File& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_ci::ind_file_Remove(atf_ci::File& row) { if (LIKELY(row.ind_file_next != (atf_ci::File*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.file) & (_db.ind_file_buckets_n - 1); + u32 index = row.ind_file_hashval & (_db.ind_file_buckets_n - 1); atf_ci::File* *prev = &_db.ind_file_buckets_elems[index]; // addr of pointer to current element while (atf_ci::File *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2725,8 +2741,14 @@ void atf_ci::ind_file_Remove(atf_ci::File& row) { // --- atf_ci.FDb.ind_file.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_ci::ind_file_Reserve(int n) { + ind_file_AbsReserve(_db.ind_file_n + n); +} + +// --- atf_ci.FDb.ind_file.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_ci::ind_file_AbsReserve(int n) { u32 old_nbuckets = _db.ind_file_buckets_n; - u32 new_nelems = _db.ind_file_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2745,7 +2767,7 @@ void atf_ci::ind_file_Reserve(int n) { while (elem) { atf_ci::File &row = *elem; atf_ci::File* next = row.ind_file_next; - u32 index = algo::cstring_Hash(0, row.file) & (new_nbuckets-1); + u32 index = row.ind_file_hashval & (new_nbuckets-1); row.ind_file_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2940,16 +2962,16 @@ void atf_ci::FDb_Init() { FatalErrorExit("out of memory"); // (atf_ci.FDb.ind_ns) } memset(_db.ind_ns_buckets_elems, 0, sizeof(atf_ci::FNs*)*_db.ind_ns_buckets_n); // (atf_ci.FDb.ind_ns) - // initialize LAry readme (atf_ci.FDb.readme) - _db.readme_n = 0; - memset(_db.readme_lary, 0, sizeof(_db.readme_lary)); // zero out all level pointers - atf_ci::FReadme* readme_first = (atf_ci::FReadme*)algo_lib::malloc_AllocMem(sizeof(atf_ci::FReadme) * (u64(1)<<4)); - if (!readme_first) { + // initialize LAry readmefile (atf_ci.FDb.readmefile) + _db.readmefile_n = 0; + memset(_db.readmefile_lary, 0, sizeof(_db.readmefile_lary)); // zero out all level pointers + atf_ci::FReadmefile* readmefile_first = (atf_ci::FReadmefile*)algo_lib::malloc_AllocMem(sizeof(atf_ci::FReadmefile) * (u64(1)<<4)); + if (!readmefile_first) { FatalErrorExit("out of memory"); } for (int i = 0; i < 4; i++) { - _db.readme_lary[i] = readme_first; - readme_first += 1ULL< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { if (!astr_present) { err << "atf_cmdline: Missing value for required argument -astr (see -help)" << eol; @@ -252,7 +257,7 @@ void atf_cmdline::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -319,8 +324,8 @@ bool atf_cmdline::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && atf_cmdline::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -494,11 +499,13 @@ void atf_cmdline::StaticCheck() { // --- atf_cmdline...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); atf_cmdline::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock atf_cmdline::ReadArgv(); // dmmeta.main:atf_cmdline atf_cmdline::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -511,6 +518,7 @@ int main(int argc, char **argv) { try { atf_cmdline::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/atf_comp_gen.cpp b/cpp/gen/atf_comp_gen.cpp index 20a19d82..ba48f13b 100644 --- a/cpp/gen/atf_comp_gen.cpp +++ b/cpp/gen/atf_comp_gen.cpp @@ -35,21 +35,21 @@ #include "include/gen/algo_lib_gen.inl.h" #include "include/gen/report_gen.h" #include "include/gen/report_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/lib_amcdb_gen.h" #include "include/gen/lib_amcdb_gen.inl.h" #include "include/gen/lib_ctype_gen.h" #include "include/gen/lib_ctype_gen.inl.h" -#include "include/gen/lib_json_gen.h" -#include "include/gen/lib_json_gen.inl.h" #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_ctype::FDb lib_ctype::_db; // dependency found via dev.targdep -lib_json::FDb lib_json::_db; // dependency found via dev.targdep atf_comp::FDb atf_comp::_db; // dependency found via dev.targdep namespace atf_comp { @@ -68,12 +68,11 @@ const char *atf_comp_help = " -normalize (action) Renumber and normalize tmsgs\n" " -covcapture (action) Capture new coverage percentages and save back\n" " -covcheck (action) Check coverage percentages against tgtcov table\n" -" -compdir string \"\" Component image directory (exe)\n" +" -bindir string \"\" Directory with binaries (default: build/cfg)\n" " -cfg string \"release\" Set config\n" " -check_untracked Y Check for untracked file before allowing test to run\n" -" -maxerr int 1 Exit after this many errors\n" +" -maxerr int 3 Exit after this many errors\n" " -build Build given cfg before test\n" -" -ood Check given cfg for ood before test\n" " -memcheck Run under memory checker (valgrind)\n" " -force (With -memcheck) run suppressed memcheck\n" " -callgrind Run under callgrind profiler (valgrind)\n" @@ -81,10 +80,13 @@ const char *atf_comp_help = " -stream prints component's output\n" " -i Read and execute testcase from stdin\n" " -write Y (implied with -e) Write any changes back to ssim tables\n" -" -report Print final report\n" +" -report Y Print final report\n" " -b string \"\" Breakpoint passed to mdbg as-is\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -covfast Y Speedup coverage processing\n" +" -minrepeat int 0 Execute every comptest at least this many times\n" +" -maxrepeat int 1 Don't repeat any individual comptest more than X times\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -98,14 +100,6 @@ namespace atf_comp { // gen:ns_print_proto static void InitReflection(); // func:atf_comp.FDb.comptest.InputMaybe static bool comptest_InputMaybe(atfdb::Comptest &elem) __attribute__((nothrow)); - // First element of index changed. - // func:atf_comp.FDb.zd_sel_comptest.FirstChanged - static void zd_sel_comptest_FirstChanged() __attribute__((nothrow)); - // Update cycles count from previous clock capture - // func:atf_comp.FDb.zd_sel_comptest.UpdateCycles - inline static void zd_sel_comptest_UpdateCycles() __attribute__((nothrow)); - // func:atf_comp.FDb.zd_sel_comptest.Call - inline static void zd_sel_comptest_Call() __attribute__((nothrow)); // func:atf_comp.FDb.targs.InputMaybe static bool targs_InputMaybe(atfdb::Targs &elem) __attribute__((nothrow)); // func:atf_comp.FDb.tmsg.InputMaybe @@ -133,7 +127,10 @@ void atf_comp::comptest_CopyOut(atf_comp::FComptest &row, atfdb::Comptest &out) out.comptest = row.comptest; out.timeout = row.timeout; out.memcheck = row.memcheck; + out.coverage = row.coverage; out.exit_code = row.exit_code; + out.ncore = row.ncore; + out.repeat = row.repeat; out.comment = row.comment; } @@ -143,7 +140,10 @@ void atf_comp::comptest_CopyIn(atf_comp::FComptest &row, atfdb::Comptest &in) { row.comptest = in.comptest; row.timeout = in.timeout; row.memcheck = in.memcheck; + row.coverage = in.coverage; row.exit_code = in.exit_code; + row.ncore = in.ncore; + row.repeat = in.repeat; row.comment = in.comment; } @@ -192,12 +192,12 @@ void atf_comp::zd_tmsg_Cascdel(atf_comp::FComptest& comptest) { // --- atf_comp.FComptest.zd_tmsg.Insert // Insert row into linked list. If row is already in linked list, do nothing. void atf_comp::zd_tmsg_Insert(atf_comp::FComptest& comptest, atf_comp::FTmsg& row) { - if (!zd_tmsg_InLlistQ(row)) { + if (!comptest_zd_tmsg_InLlistQ(row)) { atf_comp::FTmsg* old_tail = comptest.zd_tmsg_tail; - row.zd_tmsg_next = NULL; - row.zd_tmsg_prev = old_tail; + row.comptest_zd_tmsg_next = NULL; + row.comptest_zd_tmsg_prev = old_tail; comptest.zd_tmsg_tail = &row; - atf_comp::FTmsg **new_row_a = &old_tail->zd_tmsg_next; + atf_comp::FTmsg **new_row_a = &old_tail->comptest_zd_tmsg_next; atf_comp::FTmsg **new_row_b = &comptest.zd_tmsg_head; atf_comp::FTmsg **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -208,23 +208,23 @@ void atf_comp::zd_tmsg_Insert(atf_comp::FComptest& comptest, atf_comp::FTmsg& ro // --- atf_comp.FComptest.zd_tmsg.Remove // Remove element from index. If element is not in index, do nothing. void atf_comp::zd_tmsg_Remove(atf_comp::FComptest& comptest, atf_comp::FTmsg& row) { - if (zd_tmsg_InLlistQ(row)) { + if (comptest_zd_tmsg_InLlistQ(row)) { atf_comp::FTmsg* old_head = comptest.zd_tmsg_head; (void)old_head; // in case it's not used - atf_comp::FTmsg* prev = row.zd_tmsg_prev; - atf_comp::FTmsg* next = row.zd_tmsg_next; + atf_comp::FTmsg* prev = row.comptest_zd_tmsg_prev; + atf_comp::FTmsg* next = row.comptest_zd_tmsg_next; // if element is first, adjust list head; otherwise, adjust previous element's next - atf_comp::FTmsg **new_next_a = &prev->zd_tmsg_next; + atf_comp::FTmsg **new_next_a = &prev->comptest_zd_tmsg_next; atf_comp::FTmsg **new_next_b = &comptest.zd_tmsg_head; atf_comp::FTmsg **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - atf_comp::FTmsg **new_prev_a = &next->zd_tmsg_prev; + atf_comp::FTmsg **new_prev_a = &next->comptest_zd_tmsg_prev; atf_comp::FTmsg **new_prev_b = &comptest.zd_tmsg_tail; atf_comp::FTmsg **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; comptest.zd_tmsg_n--; - row.zd_tmsg_next=(atf_comp::FTmsg*)-1; // not-in-list + row.comptest_zd_tmsg_next=(atf_comp::FTmsg*)-1; // not-in-list } } @@ -236,9 +236,9 @@ void atf_comp::zd_tmsg_RemoveAll(atf_comp::FComptest& comptest) { comptest.zd_tmsg_tail = NULL; comptest.zd_tmsg_n = 0; while (row) { - atf_comp::FTmsg* row_next = row->zd_tmsg_next; - row->zd_tmsg_next = (atf_comp::FTmsg*)-1; - row->zd_tmsg_prev = NULL; + atf_comp::FTmsg* row_next = row->comptest_zd_tmsg_next; + row->comptest_zd_tmsg_next = (atf_comp::FTmsg*)-1; + row->comptest_zd_tmsg_prev = NULL; row = row_next; } } @@ -249,14 +249,14 @@ atf_comp::FTmsg* atf_comp::zd_tmsg_RemoveFirst(atf_comp::FComptest& comptest) { atf_comp::FTmsg *row = NULL; row = comptest.zd_tmsg_head; if (row) { - atf_comp::FTmsg *next = row->zd_tmsg_next; + atf_comp::FTmsg *next = row->comptest_zd_tmsg_next; comptest.zd_tmsg_head = next; - atf_comp::FTmsg **new_end_a = &next->zd_tmsg_prev; + atf_comp::FTmsg **new_end_a = &next->comptest_zd_tmsg_prev; atf_comp::FTmsg **new_end_b = &comptest.zd_tmsg_tail; atf_comp::FTmsg **new_end = next ? new_end_a : new_end_b; *new_end = NULL; comptest.zd_tmsg_n--; - row->zd_tmsg_next = (atf_comp::FTmsg*)-1; // mark as not-in-list + row->comptest_zd_tmsg_next = (atf_comp::FTmsg*)-1; // mark as not-in-list } return row; } @@ -266,17 +266,23 @@ atf_comp::FTmsg* atf_comp::zd_tmsg_RemoveFirst(atf_comp::FComptest& comptest) { void atf_comp::FComptest_Init(atf_comp::FComptest& comptest) { comptest.timeout = i32(10); comptest.memcheck = bool(true); + comptest.coverage = bool(true); comptest.exit_code = u8(0); + comptest.ncore = i32(1); + comptest.repeat = i32(1); comptest.c_targs = NULL; comptest.msg_index = i32(0); comptest.c_tfilt = NULL; comptest.elapsed = double(0.0); comptest.success = bool(false); + comptest.nrun = i32(0); comptest.zd_tmsg_head = NULL; // (atf_comp.FComptest.zd_tmsg) comptest.zd_tmsg_n = 0; // (atf_comp.FComptest.zd_tmsg) comptest.zd_tmsg_tail = NULL; // (atf_comp.FComptest.zd_tmsg) comptest.need_write = bool(false); + comptest.c_covdir = NULL; comptest.ind_comptest_next = (atf_comp::FComptest*)-1; // (atf_comp.FDb.ind_comptest) not-in-hash + comptest.ind_comptest_hashval = 0; // stored hash value comptest.zd_sel_comptest_next = (atf_comp::FComptest*)-1; // (atf_comp.FDb.zd_sel_comptest) not-in-list comptest.zd_sel_comptest_prev = NULL; // (atf_comp.FDb.zd_sel_comptest) comptest.zd_run_comptest_next = (atf_comp::FComptest*)-1; // (atf_comp.FDb.zd_run_comptest) not-in-list @@ -297,6 +303,12 @@ void atf_comp::FComptest_Uninit(atf_comp::FComptest& comptest) { zd_out_comptest_Remove(row); // remove comptest from index zd_out_comptest } +// --- atf_comp.FCovdir..Uninit +void atf_comp::FCovdir_Uninit(atf_comp::FCovdir& covdir) { + atf_comp::FCovdir &row = covdir; (void)row; + zd_covdir_free_Remove(row); // remove covdir from index zd_covdir_free +} + // --- atf_comp.trace..Print // print string representation of ROW to string STR // cfmt:atf_comp.trace.String printfmt:Tuple @@ -392,9 +404,8 @@ void atf_comp::ReadArgv() { } if (ch_N(attrname) == 0) { err << "atf_comp: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:atf_comp.FDb.cmdline @@ -448,7 +462,7 @@ void atf_comp::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -474,7 +488,6 @@ void atf_comp::MainLoop() { // --- atf_comp.FDb._db.Step // Main step void atf_comp::Step() { - zd_sel_comptest_Call(); zd_run_comptest_Call(); } @@ -495,7 +508,7 @@ static void atf_comp::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'atf_comp.Input' signature:'b05bbcc62beda39e9afa4145fceb830147523bd6'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'atf_comp.Input' signature:'a1f857af527d388c20fb27796f5f322b4bd1e42f'"); } // --- atf_comp.FDb._db.InsertStrptrMaybe @@ -566,8 +579,8 @@ bool atf_comp::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && atf_comp::LoadTuplesFile(algo::SsimFname(root,"atfdb.targs"),recursive); retval = retval && atf_comp::LoadTuplesFile(algo::SsimFname(root,"amcdb.bltin"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -765,14 +778,9 @@ bool atf_comp::comptest_XrefMaybe(atf_comp::FComptest &row) { // Find row by key. Return NULL if not found. atf_comp::FComptest* atf_comp::ind_comptest_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_comptest_buckets_n - 1); - atf_comp::FComptest* *e = &_db.ind_comptest_buckets_elems[index]; - atf_comp::FComptest* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).comptest == key; - if (done) break; - e = &ret->ind_comptest_next; - } while (true); + atf_comp::FComptest *ret = _db.ind_comptest_buckets_elems[index]; + for (; ret && !((*ret).comptest == key); ret = ret->ind_comptest_next) { + } return ret; } @@ -804,10 +812,11 @@ atf_comp::FComptest& atf_comp::ind_comptest_GetOrCreate(const algo::strptr& key) // --- atf_comp.FDb.ind_comptest.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_comp::ind_comptest_InsertMaybe(atf_comp::FComptest& row) { - ind_comptest_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_comptest_next == (atf_comp::FComptest*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.comptest) & (_db.ind_comptest_buckets_n - 1); + row.ind_comptest_hashval = algo::Smallstr50_Hash(0, row.comptest); + ind_comptest_Reserve(1); + u32 index = row.ind_comptest_hashval & (_db.ind_comptest_buckets_n - 1); atf_comp::FComptest* *prev = &_db.ind_comptest_buckets_elems[index]; do { atf_comp::FComptest* ret = *prev; @@ -833,7 +842,7 @@ bool atf_comp::ind_comptest_InsertMaybe(atf_comp::FComptest& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_comp::ind_comptest_Remove(atf_comp::FComptest& row) { if (LIKELY(row.ind_comptest_next != (atf_comp::FComptest*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.comptest) & (_db.ind_comptest_buckets_n - 1); + u32 index = row.ind_comptest_hashval & (_db.ind_comptest_buckets_n - 1); atf_comp::FComptest* *prev = &_db.ind_comptest_buckets_elems[index]; // addr of pointer to current element while (atf_comp::FComptest *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -850,8 +859,14 @@ void atf_comp::ind_comptest_Remove(atf_comp::FComptest& row) { // --- atf_comp.FDb.ind_comptest.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_comp::ind_comptest_Reserve(int n) { + ind_comptest_AbsReserve(_db.ind_comptest_n + n); +} + +// --- atf_comp.FDb.ind_comptest.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_comp::ind_comptest_AbsReserve(int n) { u32 old_nbuckets = _db.ind_comptest_buckets_n; - u32 new_nelems = _db.ind_comptest_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -870,7 +885,7 @@ void atf_comp::ind_comptest_Reserve(int n) { while (elem) { atf_comp::FComptest &row = *elem; atf_comp::FComptest* next = row.ind_comptest_next; - u32 index = algo::Smallstr50_Hash(0, row.comptest) & (new_nbuckets-1); + u32 index = row.ind_comptest_hashval & (new_nbuckets-1); row.ind_comptest_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -896,9 +911,6 @@ void atf_comp::zd_sel_comptest_Insert(atf_comp::FComptest& row) { atf_comp::FComptest **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; _db.zd_sel_comptest_n++; - if (_db.zd_sel_comptest_head == &row) { - zd_sel_comptest_FirstChanged(); - } } } @@ -922,9 +934,6 @@ void atf_comp::zd_sel_comptest_Remove(atf_comp::FComptest& row) { *new_prev = prev; _db.zd_sel_comptest_n--; row.zd_sel_comptest_next=(atf_comp::FComptest*)-1; // not-in-list - if (old_head != _db.zd_sel_comptest_head) { - zd_sel_comptest_FirstChanged(); - } } } @@ -935,21 +944,16 @@ void atf_comp::zd_sel_comptest_RemoveAll() { _db.zd_sel_comptest_head = NULL; _db.zd_sel_comptest_tail = NULL; _db.zd_sel_comptest_n = 0; - bool do_fire = (NULL != row); while (row) { atf_comp::FComptest* row_next = row->zd_sel_comptest_next; row->zd_sel_comptest_next = (atf_comp::FComptest*)-1; row->zd_sel_comptest_prev = NULL; row = row_next; } - if (do_fire) { - zd_sel_comptest_FirstChanged(); - } } // --- atf_comp.FDb.zd_sel_comptest.RemoveFirst // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -// Call FirstChanged trigger. atf_comp::FComptest* atf_comp::zd_sel_comptest_RemoveFirst() { atf_comp::FComptest *row = NULL; row = _db.zd_sel_comptest_head; @@ -962,32 +966,10 @@ atf_comp::FComptest* atf_comp::zd_sel_comptest_RemoveFirst() { *new_end = NULL; _db.zd_sel_comptest_n--; row->zd_sel_comptest_next = (atf_comp::FComptest*)-1; // mark as not-in-list - zd_sel_comptest_FirstChanged(); } return row; } -// --- atf_comp.FDb.zd_sel_comptest.FirstChanged -// First element of index changed. -static void atf_comp::zd_sel_comptest_FirstChanged() { -} - -// --- atf_comp.FDb.zd_sel_comptest.UpdateCycles -// Update cycles count from previous clock capture -inline static void atf_comp::zd_sel_comptest_UpdateCycles() { - u64 cur_cycles = algo::get_cycles(); - algo_lib::_db.clock = algo::SchedTime(cur_cycles); -} - -// --- atf_comp.FDb.zd_sel_comptest.Call -inline static void atf_comp::zd_sel_comptest_Call() { - if (!atf_comp::zd_sel_comptest_EmptyQ()) { // fstep:atf_comp.FDb.zd_sel_comptest - atf_comp::zd_sel_comptest_Step(); // steptype:Inline: call function on every step - zd_sel_comptest_UpdateCycles(); - algo_lib::_db.next_loop = algo_lib::_db.clock; - } -} - // --- atf_comp.FDb.targs.Alloc // Allocate memory for new default row. // If out of memory, process is killed. @@ -1382,6 +1364,15 @@ bool atf_comp::tfilt_XrefMaybe(atf_comp::FTfilt &row) { if (true) { // user-defined insert condition zd_out_tfilt_Insert(row); } + // insert tfilt into index ind_tfilt + if (true) { // user-defined insert condition + bool success = ind_tfilt_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "atf_comp.duplicate_key xref:atf_comp.FDb.ind_tfilt"; // check for duplicate key + return false; + } + } return retval; } @@ -1854,6 +1845,266 @@ bool atf_comp::zd_out_targs_SaveSsimfile(algo::strptr fname) { return algo::SafeStringToFile(text, fname); } +// --- atf_comp.FDb.covdir.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +atf_comp::FCovdir& atf_comp::covdir_Alloc() { + atf_comp::FCovdir* row = covdir_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("atf_comp.out_of_mem field:atf_comp.FDb.covdir comment:'Alloc failed'"); + } + return *row; +} + +// --- atf_comp.FDb.covdir.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +atf_comp::FCovdir* atf_comp::covdir_AllocMaybe() { + atf_comp::FCovdir *row = (atf_comp::FCovdir*)covdir_AllocMem(); + if (row) { + new (row) atf_comp::FCovdir; // call constructor + } + return row; +} + +// --- atf_comp.FDb.covdir.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* atf_comp::covdir_AllocMem() { + u64 new_nelems = _db.covdir_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + covdir_qFind(u64(n)).~FCovdir(); // destroy last element + _db.covdir_n = i32(n); + } +} + +// --- atf_comp.FDb.covdir.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void atf_comp::covdir_RemoveLast() { + u64 n = _db.covdir_n; + if (n > 0) { + n -= 1; + covdir_qFind(u64(n)).~FCovdir(); + _db.covdir_n = i32(n); + } +} + +// --- atf_comp.FDb.covdir.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool atf_comp::covdir_XrefMaybe(atf_comp::FCovdir &row) { + bool retval = true; + (void)row; + // insert covdir into index zd_covdir_free + if (true) { // user-defined insert condition + zd_covdir_free_Insert(row); + } + return retval; +} + +// --- atf_comp.FDb.zd_covdir_free.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void atf_comp::zd_covdir_free_Insert(atf_comp::FCovdir& row) { + if (!zd_covdir_free_InLlistQ(row)) { + atf_comp::FCovdir* old_tail = _db.zd_covdir_free_tail; + row.zd_covdir_free_next = NULL; + row.zd_covdir_free_prev = old_tail; + _db.zd_covdir_free_tail = &row; + atf_comp::FCovdir **new_row_a = &old_tail->zd_covdir_free_next; + atf_comp::FCovdir **new_row_b = &_db.zd_covdir_free_head; + atf_comp::FCovdir **new_row = old_tail ? new_row_a : new_row_b; + *new_row = &row; + _db.zd_covdir_free_n++; + } +} + +// --- atf_comp.FDb.zd_covdir_free.Remove +// Remove element from index. If element is not in index, do nothing. +void atf_comp::zd_covdir_free_Remove(atf_comp::FCovdir& row) { + if (zd_covdir_free_InLlistQ(row)) { + atf_comp::FCovdir* old_head = _db.zd_covdir_free_head; + (void)old_head; // in case it's not used + atf_comp::FCovdir* prev = row.zd_covdir_free_prev; + atf_comp::FCovdir* next = row.zd_covdir_free_next; + // if element is first, adjust list head; otherwise, adjust previous element's next + atf_comp::FCovdir **new_next_a = &prev->zd_covdir_free_next; + atf_comp::FCovdir **new_next_b = &_db.zd_covdir_free_head; + atf_comp::FCovdir **new_next = prev ? new_next_a : new_next_b; + *new_next = next; + // if element is last, adjust list tail; otherwise, adjust next element's prev + atf_comp::FCovdir **new_prev_a = &next->zd_covdir_free_prev; + atf_comp::FCovdir **new_prev_b = &_db.zd_covdir_free_tail; + atf_comp::FCovdir **new_prev = next ? new_prev_a : new_prev_b; + *new_prev = prev; + _db.zd_covdir_free_n--; + row.zd_covdir_free_next=(atf_comp::FCovdir*)-1; // not-in-list + } +} + +// --- atf_comp.FDb.zd_covdir_free.RemoveAll +// Empty the index. (The rows are not deleted) +void atf_comp::zd_covdir_free_RemoveAll() { + atf_comp::FCovdir* row = _db.zd_covdir_free_head; + _db.zd_covdir_free_head = NULL; + _db.zd_covdir_free_tail = NULL; + _db.zd_covdir_free_n = 0; + while (row) { + atf_comp::FCovdir* row_next = row->zd_covdir_free_next; + row->zd_covdir_free_next = (atf_comp::FCovdir*)-1; + row->zd_covdir_free_prev = NULL; + row = row_next; + } +} + +// --- atf_comp.FDb.zd_covdir_free.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +atf_comp::FCovdir* atf_comp::zd_covdir_free_RemoveFirst() { + atf_comp::FCovdir *row = NULL; + row = _db.zd_covdir_free_head; + if (row) { + atf_comp::FCovdir *next = row->zd_covdir_free_next; + _db.zd_covdir_free_head = next; + atf_comp::FCovdir **new_end_a = &next->zd_covdir_free_prev; + atf_comp::FCovdir **new_end_b = &_db.zd_covdir_free_tail; + atf_comp::FCovdir **new_end = next ? new_end_a : new_end_b; + *new_end = NULL; + _db.zd_covdir_free_n--; + row->zd_covdir_free_next = (atf_comp::FCovdir*)-1; // mark as not-in-list + } + return row; +} + +// --- atf_comp.FDb.ind_tfilt.Find +// Find row by key. Return NULL if not found. +atf_comp::FTfilt* atf_comp::ind_tfilt_Find(const algo::strptr& key) { + u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_tfilt_buckets_n - 1); + atf_comp::FTfilt *ret = _db.ind_tfilt_buckets_elems[index]; + for (; ret && !((*ret).comptest == key); ret = ret->ind_tfilt_next) { + } + return ret; +} + +// --- atf_comp.FDb.ind_tfilt.FindX +// Look up row by key and return reference. Throw exception if not found +atf_comp::FTfilt& atf_comp::ind_tfilt_FindX(const algo::strptr& key) { + atf_comp::FTfilt* ret = ind_tfilt_Find(key); + vrfy(ret, tempstr() << "atf_comp.key_error table:ind_tfilt key:'"<ind_tfilt_next; + } while (true); + if (retval) { + row.ind_tfilt_next = *prev; + _db.ind_tfilt_n++; + *prev = &row; + } + } + return retval; +} + +// --- atf_comp.FDb.ind_tfilt.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void atf_comp::ind_tfilt_Remove(atf_comp::FTfilt& row) { + if (LIKELY(row.ind_tfilt_next != (atf_comp::FTfilt*)-1)) {// check if in hash already + u32 index = row.ind_tfilt_hashval & (_db.ind_tfilt_buckets_n - 1); + atf_comp::FTfilt* *prev = &_db.ind_tfilt_buckets_elems[index]; // addr of pointer to current element + while (atf_comp::FTfilt *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_tfilt_next; // unlink (singly linked list) + _db.ind_tfilt_n--; + row.ind_tfilt_next = (atf_comp::FTfilt*)-1;// not-in-hash + break; + } + prev = &next->ind_tfilt_next; + } + } +} + +// --- atf_comp.FDb.ind_tfilt.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void atf_comp::ind_tfilt_Reserve(int n) { + ind_tfilt_AbsReserve(_db.ind_tfilt_n + n); +} + +// --- atf_comp.FDb.ind_tfilt.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_comp::ind_tfilt_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_tfilt_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(atf_comp::FTfilt*); + u32 new_size = new_nbuckets * sizeof(atf_comp::FTfilt*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + atf_comp::FTfilt* *new_buckets = (atf_comp::FTfilt**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("atf_comp.out_of_memory field:atf_comp.FDb.ind_tfilt"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_tfilt_buckets_n; i++) { + atf_comp::FTfilt* elem = _db.ind_tfilt_buckets_elems[i]; + while (elem) { + atf_comp::FTfilt &row = *elem; + atf_comp::FTfilt* next = row.ind_tfilt_next; + u32 index = row.ind_tfilt_hashval & (new_nbuckets-1); + row.ind_tfilt_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_tfilt_buckets_elems, old_size); + _db.ind_tfilt_buckets_elems = new_buckets; + _db.ind_tfilt_buckets_n = new_nbuckets; + } +} + // --- atf_comp.FDb.trace.RowidFind // find trace by row id (used to implement reflection) static algo::ImrowPtr atf_comp::trace_RowidFind(int t) { @@ -1917,6 +2168,29 @@ void atf_comp::FDb_Init() { _db.zd_out_targs_head = NULL; // (atf_comp.FDb.zd_out_targs) _db.zd_out_targs_n = 0; // (atf_comp.FDb.zd_out_targs) _db.zd_out_targs_tail = NULL; // (atf_comp.FDb.zd_out_targs) + // initialize LAry covdir (atf_comp.FDb.covdir) + _db.covdir_n = 0; + memset(_db.covdir_lary, 0, sizeof(_db.covdir_lary)); // zero out all level pointers + atf_comp::FCovdir* covdir_first = (atf_comp::FCovdir*)algo_lib::malloc_AllocMem(sizeof(atf_comp::FCovdir) * (u64(1)<<4)); + if (!covdir_first) { + FatalErrorExit("out of memory"); + } + for (int i = 0; i < 4; i++) { + _db.covdir_lary[i] = covdir_first; + covdir_first += 1ULL< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:atf_cov.FDb.cmdline @@ -360,7 +366,7 @@ void atf_cov::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -405,7 +411,7 @@ static void atf_cov::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'atf_cov.Input' signature:'bae3d22d101a439927195b2697d7d68f8ee4bff5'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'atf_cov.Input' signature:'d66d21a3b569781c26e5ede79240bebe11ae80c4'"); } // --- atf_cov.FDb._db.InsertStrptrMaybe @@ -476,17 +482,17 @@ bool atf_cov::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (root == "-") { retval = atf_cov::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); } else if (DirectoryQ(root)) { - retval = retval && atf_cov::LoadTuplesFile(algo::SsimFname(root,"dev.gitfile"),recursive); retval = retval && atf_cov::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); retval = retval && atf_cov::LoadTuplesFile(algo::SsimFname(root,"dev.target"),recursive); retval = retval && atf_cov::LoadTuplesFile(algo::SsimFname(root,"dev.tgtcov"),recursive); + retval = retval && atf_cov::LoadTuplesFile(algo::SsimFname(root,"dev.gitfile"),recursive); retval = retval && atf_cov::LoadTuplesFile(algo::SsimFname(root,"dev.targsrc"),recursive); retval = retval && atf_cov::LoadTuplesFile(algo::SsimFname(root,"dev.covtarget"),recursive); retval = retval && atf_cov::LoadTuplesFile(algo::SsimFname(root,"dev.covline"),recursive); retval = retval && atf_cov::LoadTuplesFile(algo::SsimFname(root,"dev.covfile"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -677,15 +683,10 @@ bool atf_cov::covline_XrefMaybe(atf_cov::FCovline &row) { // --- atf_cov.FDb.ind_covline.Find // Find row by key. Return NULL if not found. atf_cov::FCovline* atf_cov::ind_covline_Find(const algo::strptr& key) { - u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_covline_buckets_n - 1); - atf_cov::FCovline* *e = &_db.ind_covline_buckets_elems[index]; - atf_cov::FCovline* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).covline == key; - if (done) break; - e = &ret->ind_covline_next; - } while (true); + u32 index = algo::cstring_Hash(0, key) & (_db.ind_covline_buckets_n - 1); + atf_cov::FCovline *ret = _db.ind_covline_buckets_elems[index]; + for (; ret && !((*ret).covline == key); ret = ret->ind_covline_next) { + } return ret; } @@ -700,10 +701,11 @@ atf_cov::FCovline& atf_cov::ind_covline_FindX(const algo::strptr& key) { // --- atf_cov.FDb.ind_covline.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_cov::ind_covline_InsertMaybe(atf_cov::FCovline& row) { - ind_covline_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_covline_next == (atf_cov::FCovline*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.covline) & (_db.ind_covline_buckets_n - 1); + row.ind_covline_hashval = algo::cstring_Hash(0, row.covline); + ind_covline_Reserve(1); + u32 index = row.ind_covline_hashval & (_db.ind_covline_buckets_n - 1); atf_cov::FCovline* *prev = &_db.ind_covline_buckets_elems[index]; do { atf_cov::FCovline* ret = *prev; @@ -729,7 +731,7 @@ bool atf_cov::ind_covline_InsertMaybe(atf_cov::FCovline& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_cov::ind_covline_Remove(atf_cov::FCovline& row) { if (LIKELY(row.ind_covline_next != (atf_cov::FCovline*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.covline) & (_db.ind_covline_buckets_n - 1); + u32 index = row.ind_covline_hashval & (_db.ind_covline_buckets_n - 1); atf_cov::FCovline* *prev = &_db.ind_covline_buckets_elems[index]; // addr of pointer to current element while (atf_cov::FCovline *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -746,8 +748,14 @@ void atf_cov::ind_covline_Remove(atf_cov::FCovline& row) { // --- atf_cov.FDb.ind_covline.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_cov::ind_covline_Reserve(int n) { + ind_covline_AbsReserve(_db.ind_covline_n + n); +} + +// --- atf_cov.FDb.ind_covline.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_cov::ind_covline_AbsReserve(int n) { u32 old_nbuckets = _db.ind_covline_buckets_n; - u32 new_nelems = _db.ind_covline_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -766,7 +774,7 @@ void atf_cov::ind_covline_Reserve(int n) { while (elem) { atf_cov::FCovline &row = *elem; atf_cov::FCovline* next = row.ind_covline_next; - u32 index = algo::Smallstr200_Hash(0, row.covline) & (new_nbuckets-1); + u32 index = row.ind_covline_hashval & (new_nbuckets-1); row.ind_covline_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -890,14 +898,9 @@ bool atf_cov::target_XrefMaybe(atf_cov::FTarget &row) { // Find row by key. Return NULL if not found. atf_cov::FTarget* atf_cov::ind_target_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_target_buckets_n - 1); - atf_cov::FTarget* *e = &_db.ind_target_buckets_elems[index]; - atf_cov::FTarget* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).target == key; - if (done) break; - e = &ret->ind_target_next; - } while (true); + atf_cov::FTarget *ret = _db.ind_target_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_target_next) { + } return ret; } @@ -929,10 +932,11 @@ atf_cov::FTarget& atf_cov::ind_target_GetOrCreate(const algo::strptr& key) { // --- atf_cov.FDb.ind_target.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_cov::ind_target_InsertMaybe(atf_cov::FTarget& row) { - ind_target_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_target_next == (atf_cov::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + row.ind_target_hashval = algo::Smallstr16_Hash(0, row.target); + ind_target_Reserve(1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); atf_cov::FTarget* *prev = &_db.ind_target_buckets_elems[index]; do { atf_cov::FTarget* ret = *prev; @@ -958,7 +962,7 @@ bool atf_cov::ind_target_InsertMaybe(atf_cov::FTarget& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_cov::ind_target_Remove(atf_cov::FTarget& row) { if (LIKELY(row.ind_target_next != (atf_cov::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); atf_cov::FTarget* *prev = &_db.ind_target_buckets_elems[index]; // addr of pointer to current element while (atf_cov::FTarget *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -975,8 +979,14 @@ void atf_cov::ind_target_Remove(atf_cov::FTarget& row) { // --- atf_cov.FDb.ind_target.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_cov::ind_target_Reserve(int n) { + ind_target_AbsReserve(_db.ind_target_n + n); +} + +// --- atf_cov.FDb.ind_target.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_cov::ind_target_AbsReserve(int n) { u32 old_nbuckets = _db.ind_target_buckets_n; - u32 new_nelems = _db.ind_target_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -995,7 +1005,7 @@ void atf_cov::ind_target_Reserve(int n) { while (elem) { atf_cov::FTarget &row = *elem; atf_cov::FTarget* next = row.ind_target_next; - u32 index = algo::Smallstr16_Hash(0, row.target) & (new_nbuckets-1); + u32 index = row.ind_target_hashval & (new_nbuckets-1); row.ind_target_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1150,14 +1160,9 @@ bool atf_cov::targsrc_XrefMaybe(atf_cov::FTargsrc &row) { // Find row by key. Return NULL if not found. atf_cov::FTargsrc* atf_cov::ind_targsrc_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_targsrc_buckets_n - 1); - atf_cov::FTargsrc* *e = &_db.ind_targsrc_buckets_elems[index]; - atf_cov::FTargsrc* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).targsrc == key; - if (done) break; - e = &ret->ind_targsrc_next; - } while (true); + atf_cov::FTargsrc *ret = _db.ind_targsrc_buckets_elems[index]; + for (; ret && !((*ret).targsrc == key); ret = ret->ind_targsrc_next) { + } return ret; } @@ -1172,10 +1177,11 @@ atf_cov::FTargsrc& atf_cov::ind_targsrc_FindX(const algo::strptr& key) { // --- atf_cov.FDb.ind_targsrc.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_cov::ind_targsrc_InsertMaybe(atf_cov::FTargsrc& row) { - ind_targsrc_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_targsrc_next == (atf_cov::FTargsrc*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.targsrc) & (_db.ind_targsrc_buckets_n - 1); + row.ind_targsrc_hashval = algo::Smallstr100_Hash(0, row.targsrc); + ind_targsrc_Reserve(1); + u32 index = row.ind_targsrc_hashval & (_db.ind_targsrc_buckets_n - 1); atf_cov::FTargsrc* *prev = &_db.ind_targsrc_buckets_elems[index]; do { atf_cov::FTargsrc* ret = *prev; @@ -1201,7 +1207,7 @@ bool atf_cov::ind_targsrc_InsertMaybe(atf_cov::FTargsrc& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_cov::ind_targsrc_Remove(atf_cov::FTargsrc& row) { if (LIKELY(row.ind_targsrc_next != (atf_cov::FTargsrc*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.targsrc) & (_db.ind_targsrc_buckets_n - 1); + u32 index = row.ind_targsrc_hashval & (_db.ind_targsrc_buckets_n - 1); atf_cov::FTargsrc* *prev = &_db.ind_targsrc_buckets_elems[index]; // addr of pointer to current element while (atf_cov::FTargsrc *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1218,8 +1224,14 @@ void atf_cov::ind_targsrc_Remove(atf_cov::FTargsrc& row) { // --- atf_cov.FDb.ind_targsrc.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_cov::ind_targsrc_Reserve(int n) { + ind_targsrc_AbsReserve(_db.ind_targsrc_n + n); +} + +// --- atf_cov.FDb.ind_targsrc.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_cov::ind_targsrc_AbsReserve(int n) { u32 old_nbuckets = _db.ind_targsrc_buckets_n; - u32 new_nelems = _db.ind_targsrc_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1238,7 +1250,7 @@ void atf_cov::ind_targsrc_Reserve(int n) { while (elem) { atf_cov::FTargsrc &row = *elem; atf_cov::FTargsrc* next = row.ind_targsrc_next; - u32 index = algo::Smallstr100_Hash(0, row.targsrc) & (new_nbuckets-1); + u32 index = row.ind_targsrc_hashval & (new_nbuckets-1); row.ind_targsrc_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1362,14 +1374,9 @@ bool atf_cov::gitfile_XrefMaybe(atf_cov::FGitfile &row) { // Find row by key. Return NULL if not found. atf_cov::FGitfile* atf_cov::ind_gitfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_gitfile_buckets_n - 1); - atf_cov::FGitfile* *e = &_db.ind_gitfile_buckets_elems[index]; - atf_cov::FGitfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gitfile == key; - if (done) break; - e = &ret->ind_gitfile_next; - } while (true); + atf_cov::FGitfile *ret = _db.ind_gitfile_buckets_elems[index]; + for (; ret && !((*ret).gitfile == key); ret = ret->ind_gitfile_next) { + } return ret; } @@ -1401,10 +1408,11 @@ atf_cov::FGitfile& atf_cov::ind_gitfile_GetOrCreate(const algo::strptr& key) { // --- atf_cov.FDb.ind_gitfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_cov::ind_gitfile_InsertMaybe(atf_cov::FGitfile& row) { - ind_gitfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gitfile_next == (atf_cov::FGitfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (_db.ind_gitfile_buckets_n - 1); + row.ind_gitfile_hashval = algo::Smallstr200_Hash(0, row.gitfile); + ind_gitfile_Reserve(1); + u32 index = row.ind_gitfile_hashval & (_db.ind_gitfile_buckets_n - 1); atf_cov::FGitfile* *prev = &_db.ind_gitfile_buckets_elems[index]; do { atf_cov::FGitfile* ret = *prev; @@ -1430,7 +1438,7 @@ bool atf_cov::ind_gitfile_InsertMaybe(atf_cov::FGitfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_cov::ind_gitfile_Remove(atf_cov::FGitfile& row) { if (LIKELY(row.ind_gitfile_next != (atf_cov::FGitfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (_db.ind_gitfile_buckets_n - 1); + u32 index = row.ind_gitfile_hashval & (_db.ind_gitfile_buckets_n - 1); atf_cov::FGitfile* *prev = &_db.ind_gitfile_buckets_elems[index]; // addr of pointer to current element while (atf_cov::FGitfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1447,8 +1455,14 @@ void atf_cov::ind_gitfile_Remove(atf_cov::FGitfile& row) { // --- atf_cov.FDb.ind_gitfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_cov::ind_gitfile_Reserve(int n) { + ind_gitfile_AbsReserve(_db.ind_gitfile_n + n); +} + +// --- atf_cov.FDb.ind_gitfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_cov::ind_gitfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gitfile_buckets_n; - u32 new_nelems = _db.ind_gitfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1467,7 +1481,7 @@ void atf_cov::ind_gitfile_Reserve(int n) { while (elem) { atf_cov::FGitfile &row = *elem; atf_cov::FGitfile* next = row.ind_gitfile_next; - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (new_nbuckets-1); + u32 index = row.ind_gitfile_hashval & (new_nbuckets-1); row.ind_gitfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1829,14 +1843,9 @@ bool atf_cov::tgtcov_XrefMaybe(atf_cov::FTgtcov &row) { // Find row by key. Return NULL if not found. atf_cov::FTgtcov* atf_cov::ind_tgtcov_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_tgtcov_buckets_n - 1); - atf_cov::FTgtcov* *e = &_db.ind_tgtcov_buckets_elems[index]; - atf_cov::FTgtcov* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).target == key; - if (done) break; - e = &ret->ind_tgtcov_next; - } while (true); + atf_cov::FTgtcov *ret = _db.ind_tgtcov_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_tgtcov_next) { + } return ret; } @@ -1851,10 +1860,11 @@ atf_cov::FTgtcov& atf_cov::ind_tgtcov_FindX(const algo::strptr& key) { // --- atf_cov.FDb.ind_tgtcov.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_cov::ind_tgtcov_InsertMaybe(atf_cov::FTgtcov& row) { - ind_tgtcov_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_tgtcov_next == (atf_cov::FTgtcov*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_tgtcov_buckets_n - 1); + row.ind_tgtcov_hashval = algo::Smallstr16_Hash(0, row.target); + ind_tgtcov_Reserve(1); + u32 index = row.ind_tgtcov_hashval & (_db.ind_tgtcov_buckets_n - 1); atf_cov::FTgtcov* *prev = &_db.ind_tgtcov_buckets_elems[index]; do { atf_cov::FTgtcov* ret = *prev; @@ -1880,7 +1890,7 @@ bool atf_cov::ind_tgtcov_InsertMaybe(atf_cov::FTgtcov& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_cov::ind_tgtcov_Remove(atf_cov::FTgtcov& row) { if (LIKELY(row.ind_tgtcov_next != (atf_cov::FTgtcov*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_tgtcov_buckets_n - 1); + u32 index = row.ind_tgtcov_hashval & (_db.ind_tgtcov_buckets_n - 1); atf_cov::FTgtcov* *prev = &_db.ind_tgtcov_buckets_elems[index]; // addr of pointer to current element while (atf_cov::FTgtcov *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1897,8 +1907,14 @@ void atf_cov::ind_tgtcov_Remove(atf_cov::FTgtcov& row) { // --- atf_cov.FDb.ind_tgtcov.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_cov::ind_tgtcov_Reserve(int n) { + ind_tgtcov_AbsReserve(_db.ind_tgtcov_n + n); +} + +// --- atf_cov.FDb.ind_tgtcov.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_cov::ind_tgtcov_AbsReserve(int n) { u32 old_nbuckets = _db.ind_tgtcov_buckets_n; - u32 new_nelems = _db.ind_tgtcov_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1917,7 +1933,7 @@ void atf_cov::ind_tgtcov_Reserve(int n) { while (elem) { atf_cov::FTgtcov &row = *elem; atf_cov::FTgtcov* next = row.ind_tgtcov_next; - u32 index = algo::Smallstr16_Hash(0, row.target) & (new_nbuckets-1); + u32 index = row.ind_tgtcov_hashval & (new_nbuckets-1); row.ind_tgtcov_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2129,15 +2145,11 @@ algo::Smallstr50 atf_cov::ext_Get(atf_cov::FGitfile& gitfile) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void atf_cov::c_covline_Insert(atf_cov::FGitfile& gitfile, atf_cov::FCovline& row) { - if (bool_Update(row.gitfile_c_covline_in_ary,true)) { - // reserve space + if (!row.gitfile_c_covline_in_ary) { c_covline_Reserve(gitfile, 1); - u32 n = gitfile.c_covline_n; - u32 at = n; - atf_cov::FCovline* *elems = gitfile.c_covline_elems; - elems[at] = &row; - gitfile.c_covline_n = n+1; - + u32 n = gitfile.c_covline_n++; + gitfile.c_covline_elems[n] = &row; + row.gitfile_c_covline_in_ary = true; } } @@ -2146,7 +2158,7 @@ void atf_cov::c_covline_Insert(atf_cov::FGitfile& gitfile, atf_cov::FCovline& ro // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool atf_cov::c_covline_InsertMaybe(atf_cov::FGitfile& gitfile, atf_cov::FCovline& row) { - bool retval = !row.gitfile_c_covline_in_ary; + bool retval = !gitfile_c_covline_InAryQ(row); c_covline_Insert(gitfile,row); // check is performed in _Insert again return retval; } @@ -2154,18 +2166,18 @@ bool atf_cov::c_covline_InsertMaybe(atf_cov::FGitfile& gitfile, atf_cov::FCovlin // --- atf_cov.FGitfile.c_covline.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void atf_cov::c_covline_Remove(atf_cov::FGitfile& gitfile, atf_cov::FCovline& row) { + int n = gitfile.c_covline_n; if (bool_Update(row.gitfile_c_covline_in_ary,false)) { - int lim = gitfile.c_covline_n; atf_cov::FCovline* *elems = gitfile.c_covline_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { atf_cov::FCovline* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(atf_cov::FCovline*) * (lim - j); + size_t nbytes = sizeof(atf_cov::FCovline*) * (n - j); memmove(elems + i, elems + j, nbytes); - gitfile.c_covline_n = lim - 1; + gitfile.c_covline_n = n - 1; break; } } @@ -2214,15 +2226,11 @@ void atf_cov::target_CopyIn(atf_cov::FTarget &row, dev::Target &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void atf_cov::c_targsrc_Insert(atf_cov::FTarget& target, atf_cov::FTargsrc& row) { - if (bool_Update(row.target_c_targsrc_in_ary,true)) { - // reserve space + if (!row.target_c_targsrc_in_ary) { c_targsrc_Reserve(target, 1); - u32 n = target.c_targsrc_n; - u32 at = n; - atf_cov::FTargsrc* *elems = target.c_targsrc_elems; - elems[at] = &row; - target.c_targsrc_n = n+1; - + u32 n = target.c_targsrc_n++; + target.c_targsrc_elems[n] = &row; + row.target_c_targsrc_in_ary = true; } } @@ -2231,7 +2239,7 @@ void atf_cov::c_targsrc_Insert(atf_cov::FTarget& target, atf_cov::FTargsrc& row) // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool atf_cov::c_targsrc_InsertMaybe(atf_cov::FTarget& target, atf_cov::FTargsrc& row) { - bool retval = !row.target_c_targsrc_in_ary; + bool retval = !target_c_targsrc_InAryQ(row); c_targsrc_Insert(target,row); // check is performed in _Insert again return retval; } @@ -2239,18 +2247,18 @@ bool atf_cov::c_targsrc_InsertMaybe(atf_cov::FTarget& target, atf_cov::FTargsrc& // --- atf_cov.FTarget.c_targsrc.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void atf_cov::c_targsrc_Remove(atf_cov::FTarget& target, atf_cov::FTargsrc& row) { + int n = target.c_targsrc_n; if (bool_Update(row.target_c_targsrc_in_ary,false)) { - int lim = target.c_targsrc_n; atf_cov::FTargsrc* *elems = target.c_targsrc_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { atf_cov::FTargsrc* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(atf_cov::FTargsrc*) * (lim - j); + size_t nbytes = sizeof(atf_cov::FTargsrc*) * (n - j); memmove(elems + i, elems + j, nbytes); - target.c_targsrc_n = lim - 1; + target.c_targsrc_n = n - 1; break; } } @@ -2683,11 +2691,13 @@ void atf_cov::StaticCheck() { // --- atf_cov...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); atf_cov::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock atf_cov::ReadArgv(); // dmmeta.main:atf_cov atf_cov::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -2700,6 +2710,7 @@ int main(int argc, char **argv) { try { atf_cov::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/atf_exp_gen.cpp b/cpp/gen/atf_exp_gen.cpp new file mode 100644 index 00000000..bb9f27ad --- /dev/null +++ b/cpp/gen/atf_exp_gen.cpp @@ -0,0 +1,2746 @@ +// +// cpp/gen/atf_exp_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/atf_exp_gen.h" +#include "include/gen/atf_exp_gen.inl.h" +#include "include/gen/command_gen.h" +#include "include/gen/command_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +#include "include/gen/ams_gen.h" +#include "include/gen/ams_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" +#include "include/gen/lib_prot_gen.h" +#include "include/gen/lib_prot_gen.inl.h" +//#pragma endinclude + +// Instantiate all libraries linked into this executable, +// in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep +algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep +atf_exp::FDb atf_exp::_db; // dependency found via dev.targdep + +namespace atf_exp { +const char *atf_exp_help = +"atf_exp: ATF expect\n" +"Usage: atf_exp [options]\n" +" OPTION TYPE DFLT COMMENT\n" +" -in string \"data\" Input directory or filename, - for stdin\n" +" -trace string \"\" Regx of things to trace\n" +" -bindir string \"bin\" Directory with binaries\n" +" -comptest string \"\" Component test name\n" +" -tempdir string \"\" Temporary directory for the component test\n" +" -timeout double 8.0 Timeout in seconds for a step\n" +" -dbgshell Invoke bash with curr envs in case of timeout\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" +" -help Print help and exit; alias -h\n" +" -version Print version and exit\n" +" -signature Show signatures and exit; alias -sig\n" +; + + +} // namespace atf_exp +namespace atf_exp { // gen:ns_print_proto + // Load statically available data into tables, register tables and database. + // func:atf_exp.FDb._db.InitReflection + static void InitReflection(); + // First element of index changed. + // func:atf_exp.FDb.cd_proc_read.FirstChanged + static void cd_proc_read_FirstChanged() __attribute__((nothrow)); + // Update cycles count from previous clock capture + // func:atf_exp.FDb.cd_proc_read.UpdateCycles + inline static void cd_proc_read_UpdateCycles() __attribute__((nothrow)); + // func:atf_exp.FDb.cd_proc_read.Call + inline static void cd_proc_read_Call() __attribute__((nothrow)); + // First element of index changed. + // func:atf_exp.FDb.cd_proc_outflow.FirstChanged + static void cd_proc_outflow_FirstChanged() __attribute__((nothrow)); + // Update cycles count from previous clock capture + // func:atf_exp.FDb.cd_proc_outflow.UpdateCycles + inline static void cd_proc_outflow_UpdateCycles() __attribute__((nothrow)); + // func:atf_exp.FDb.cd_proc_outflow.Call + inline static void cd_proc_outflow_Call() __attribute__((nothrow)); + // Update cycles count from previous clock capture + // func:atf_exp.FDb.ind_proc_pid.UpdateCycles + inline static void ind_proc_pid_UpdateCycles() __attribute__((nothrow)); + // func:atf_exp.FDb.ind_proc_pid.Call + inline static void ind_proc_pid_Call() __attribute__((nothrow)); + // First element of index changed. + // func:atf_exp.FDb.cd_fdin_eof.FirstChanged + static void cd_fdin_eof_FirstChanged() __attribute__((nothrow)); + // Update cycles count from previous clock capture + // func:atf_exp.FDb.cd_fdin_eof.UpdateCycles + inline static void cd_fdin_eof_UpdateCycles() __attribute__((nothrow)); + // func:atf_exp.FDb.cd_fdin_eof.Call + inline static void cd_fdin_eof_Call() __attribute__((nothrow)); + // First element of index changed. + // func:atf_exp.FDb.cd_fdin_read.FirstChanged + static void cd_fdin_read_FirstChanged() __attribute__((nothrow)); + // Update cycles count from previous clock capture + // func:atf_exp.FDb.cd_fdin_read.UpdateCycles + inline static void cd_fdin_read_UpdateCycles() __attribute__((nothrow)); + // func:atf_exp.FDb.cd_fdin_read.Call + inline static void cd_fdin_read_Call() __attribute__((nothrow)); + // find trace by row id (used to implement reflection) + // func:atf_exp.FDb.trace.RowidFind + static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); + // Function return 1 + // func:atf_exp.FDb.trace.N + inline static i32 trace_N() __attribute__((__warn_unused_result__, nothrow, pure)); + // Internal function to scan for a message + // + // func:atf_exp.FFdin.in.ScanMsg + static void in_ScanMsg(atf_exp::FFdin& fdin) __attribute__((nothrow)); + // Internal function to shift data left + // Shift existing bytes over to the beginning of the buffer + // func:atf_exp.FFdin.in.Shift + static void in_Shift(atf_exp::FFdin& fdin) __attribute__((nothrow)); + // Internal function to scan for a message + // + // func:atf_exp.FProc.in.ScanMsg + static void in_ScanMsg(atf_exp::FProc& proc) __attribute__((nothrow)); + // Internal function to shift data left + // Shift existing bytes over to the beginning of the buffer + // func:atf_exp.FProc.in.Shift + static void in_Shift(atf_exp::FProc& proc) __attribute__((nothrow)); + // Internal function to shift data left + // Shift existing bytes over to the beginning of the buffer + // func:atf_exp.FProc.out.Shift + static void out_Shift(atf_exp::FProc& proc) __attribute__((nothrow)); + // func:atf_exp...SizeCheck + inline static void SizeCheck(); + // func:atf_exp.In.ProcEofMsg.UpdateCycles + static void In_ProcEofMsg_UpdateCycles(); + // func:atf_exp.In.ProcKillMsg.UpdateCycles + static void In_ProcKillMsg_UpdateCycles(); + // func:atf_exp.In.ProcMsg.UpdateCycles + static void In_ProcMsg_UpdateCycles(); + // func:atf_exp.In.ProcReadMsg.UpdateCycles + static void In_ProcReadMsg_UpdateCycles(); + // func:atf_exp.In.ProcStartMsg.UpdateCycles + static void In_ProcStartMsg_UpdateCycles(); + // func:atf_exp.In.RemDirRecurseMsg.UpdateCycles + static void In_RemDirRecurseMsg_UpdateCycles(); + // func:atf_exp.In.TerminateMsg.UpdateCycles + static void In_TerminateMsg_UpdateCycles(); +} // gen:ns_print_proto + +// --- atf_exp.trace..Init +// Set all fields to initial values. +void atf_exp::trace_Init(atf_exp::trace& parent) { + parent.dispatch_In_ProcEofMsg = u64(0); + parent.dispatch_In_ProcEofMsg_cycles = u64(0); + parent.dispatch_In_ProcKillMsg = u64(0); + parent.dispatch_In_ProcKillMsg_cycles = u64(0); + parent.dispatch_In_ProcMsg = u64(0); + parent.dispatch_In_ProcMsg_cycles = u64(0); + parent.dispatch_In_ProcReadMsg = u64(0); + parent.dispatch_In_ProcReadMsg_cycles = u64(0); + parent.dispatch_In_ProcStartMsg = u64(0); + parent.dispatch_In_ProcStartMsg_cycles = u64(0); + parent.dispatch_In_RemDirRecurseMsg = u64(0); + parent.dispatch_In_RemDirRecurseMsg_cycles = u64(0); + parent.dispatch_In_TerminateMsg = u64(0); + parent.dispatch_In_TerminateMsg_cycles = u64(0); + parent.dispatch_In_Unkmsg = u64(0); + parent.dispatch_In_Unkmsg_cycles = u64(0); +} + +// --- atf_exp.trace..Print +// print string representation of ROW to string STR +// cfmt:atf_exp.trace.String printfmt:Tuple +void atf_exp::trace_Print(atf_exp::trace& row, algo::cstring& str) { + algo::tempstr temp; + str << "atf_exp.trace"; + + u64_Print(row.dispatch_In_ProcEofMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_ProcEofMsg", temp); + + u64_Print(row.dispatch_In_ProcEofMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_ProcEofMsg_cycles", temp); + + u64_Print(row.dispatch_In_ProcKillMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_ProcKillMsg", temp); + + u64_Print(row.dispatch_In_ProcKillMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_ProcKillMsg_cycles", temp); + + u64_Print(row.dispatch_In_ProcMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_ProcMsg", temp); + + u64_Print(row.dispatch_In_ProcMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_ProcMsg_cycles", temp); + + u64_Print(row.dispatch_In_ProcReadMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_ProcReadMsg", temp); + + u64_Print(row.dispatch_In_ProcReadMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_ProcReadMsg_cycles", temp); + + u64_Print(row.dispatch_In_ProcStartMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_ProcStartMsg", temp); + + u64_Print(row.dispatch_In_ProcStartMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_ProcStartMsg_cycles", temp); + + u64_Print(row.dispatch_In_RemDirRecurseMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_RemDirRecurseMsg", temp); + + u64_Print(row.dispatch_In_RemDirRecurseMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_RemDirRecurseMsg_cycles", temp); + + u64_Print(row.dispatch_In_TerminateMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_TerminateMsg", temp); + + u64_Print(row.dispatch_In_TerminateMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_TerminateMsg_cycles", temp); + + u64_Print(row.dispatch_In_Unkmsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_Unkmsg", temp); + + u64_Print(row.dispatch_In_Unkmsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_Unkmsg_cycles", temp); +} + +// --- atf_exp.FDb._db.ReadArgv +// Read argc,argv directly into the fields of the command line(s) +// The following fields are updated: +// atf_exp.FDb.cmdline +// algo_lib.FDb.cmdline +void atf_exp::ReadArgv() { + command::atf_exp &cmd = atf_exp::_db.cmdline; + algo_lib::Cmdline &base = algo_lib::_db.cmdline; + int needarg=-1;// unknown + int argidx=1;// skip process name + tempstr err; + algo::strptr attrname; + bool isanon=false; // true if attrname is anonfld (positional) + algo_lib::FieldId baseattrid; + command::FieldId attrid; + bool endopt=false; + int whichns=0;// which namespace does the current attribute belong to + for (; argidx < algo_lib::_db.argc; argidx++) { + algo::strptr arg = algo_lib::_db.argv[argidx]; + algo::strptr attrval; + algo::strptr dfltval; + bool haveval=false; + bool dash=elems_N(arg)>1 && arg.elems[0]=='-'; // a single dash is not an option + // this attribute is a value + if (endopt || needarg>0 || !dash) { + attrval=arg; + haveval=true; + } else { + // this attribute is a field name (with - or --) + // or a -- by itself + bool dashdash = elems_N(arg) >= 2 && arg.elems[1]=='-'; + int skip = int(dash) + dashdash; + attrname=ch_RestFrom(arg,skip); + if (skip==2 && elems_N(arg)==2) { + endopt=true; + continue;// nothing else to do here + } + // parse "-a:B" arg into attrname,attrvalue + algo::i32_Range colon = TFind(attrname,':'); + if (colon.beg < colon.end) { + attrval=ch_RestFrom(attrname,colon.end); + attrname=ch_FirstN(attrname,colon.beg); + haveval=true; + } + // look up which command (this one or the base) contains the field + whichns=0; + needarg=-1; + // look up parameter information in base namespace (needarg will be -1 if lookup fails) + if (algo_lib::FieldId_ReadStrptrMaybe(baseattrid,attrname)) { + needarg = algo_lib::Cmdline_NArgs(baseattrid,dfltval,&isanon); + } + if (needarg<0) { + whichns=1; + // look up parameter information in this namespace (needarg will be -1 if lookup fails) + if (command::FieldId_ReadStrptrMaybe(attrid,attrname)) { + needarg = command::atf_exp_NArgs(attrid,dfltval,&isanon); + } + } + if (attrval == "" && dfltval != "") { + attrval=dfltval; + haveval=true; + } + if (needarg<0) { + err<<"atf_exp: unknown option "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; + if (!dohelp) { + } + // dmmeta.floadtuples:atf_exp.FDb.cmdline + if (!dohelp && err=="") { + algo_lib::ResetErrtext(); + if (!atf_exp::LoadTuplesMaybe(cmd.in,true)) { + err << "atf_exp.load_input "<(value)); + bool ok = proc_XrefMaybe(*row); // this may return false + if (!ok) { + proc_Delete(*row); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- atf_exp.FDb.proc.Delete +// Remove row from all global and cross indices, then deallocate row +void atf_exp::proc_Delete(atf_exp::FProc &row) { + row.~FProc(); + proc_FreeMem(row); +} + +// --- atf_exp.FDb.proc.AllocMem +// Allocate space for one element +// If no memory available, return NULL. +void* atf_exp::proc_AllocMem() { + atf_exp::FProc *row = _db.proc_free; + if (UNLIKELY(!row)) { + proc_Reserve(1); + row = _db.proc_free; + } + if (row) { + _db.proc_free = row->proc_next; + } + return row; +} + +// --- atf_exp.FDb.proc.FreeMem +// Remove mem from all global and cross indices, then deallocate mem +void atf_exp::proc_FreeMem(atf_exp::FProc &row) { + if (UNLIKELY(row.proc_next != (atf_exp::FProc*)-1)) { + FatalErrorExit("atf_exp.tpool_double_delete pool:atf_exp.FDb.proc comment:'double deletion caught'"); + } + row.proc_next = _db.proc_free; // insert into free list + _db.proc_free = &row; +} + +// --- atf_exp.FDb.proc.Reserve +// Preallocate memory for N more elements +// Return number of elements actually reserved. +u64 atf_exp::proc_Reserve(u64 n_elems) { + u64 ret = 0; + while (ret < n_elems) { + u64 size = _db.proc_blocksize; // underlying allocator is probably Lpool + u64 reserved = proc_ReserveMem(size); + ret += reserved; + if (reserved == 0) { + break; + } + } + return ret; +} + +// --- atf_exp.FDb.proc.ReserveMem +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +u64 atf_exp::proc_ReserveMem(u64 size) { + u64 ret = 0; + if (size >= sizeof(atf_exp::FProc)) { + atf_exp::FProc *mem = (atf_exp::FProc*)algo_lib::malloc_AllocMem(size); + ret = mem ? size / sizeof(atf_exp::FProc) : 0; + // add newly allocated elements to the free list; + for (u64 i=0; i < ret; i++) { + mem[i].proc_next = _db.proc_free; + _db.proc_free = mem+i; + } + } + return ret; +} + +// --- atf_exp.FDb.proc.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool atf_exp::proc_XrefMaybe(atf_exp::FProc &row) { + bool retval = true; + (void)row; + // insert proc into index ind_proc + if (true) { // user-defined insert condition + bool success = ind_proc_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "atf_exp.duplicate_key xref:atf_exp.FDb.ind_proc"; // check for duplicate key + return false; + } + } + // insert proc into index zd_proc + if (true) { // user-defined insert condition + zd_proc_Insert(row); + } + return retval; +} + +// --- atf_exp.FDb.ind_proc.Find +// Find row by key. Return NULL if not found. +atf_exp::FProc* atf_exp::ind_proc_Find(const algo::strptr& key) { + u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_proc_buckets_n - 1); + atf_exp::FProc *ret = _db.ind_proc_buckets_elems[index]; + for (; ret && !((*ret).proc == key); ret = ret->ind_proc_next) { + } + return ret; +} + +// --- atf_exp.FDb.ind_proc.FindX +// Look up row by key and return reference. Throw exception if not found +atf_exp::FProc& atf_exp::ind_proc_FindX(const algo::strptr& key) { + atf_exp::FProc* ret = ind_proc_Find(key); + vrfy(ret, tempstr() << "atf_exp.key_error table:ind_proc key:'"<ind_proc_next; + } while (true); + if (retval) { + row.ind_proc_next = *prev; + _db.ind_proc_n++; + *prev = &row; + } + } + return retval; +} + +// --- atf_exp.FDb.ind_proc.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void atf_exp::ind_proc_Remove(atf_exp::FProc& row) { + if (LIKELY(row.ind_proc_next != (atf_exp::FProc*)-1)) {// check if in hash already + u32 index = row.ind_proc_hashval & (_db.ind_proc_buckets_n - 1); + atf_exp::FProc* *prev = &_db.ind_proc_buckets_elems[index]; // addr of pointer to current element + while (atf_exp::FProc *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_proc_next; // unlink (singly linked list) + _db.ind_proc_n--; + row.ind_proc_next = (atf_exp::FProc*)-1;// not-in-hash + break; + } + prev = &next->ind_proc_next; + } + } +} + +// --- atf_exp.FDb.ind_proc.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void atf_exp::ind_proc_Reserve(int n) { + ind_proc_AbsReserve(_db.ind_proc_n + n); +} + +// --- atf_exp.FDb.ind_proc.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_exp::ind_proc_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_proc_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(atf_exp::FProc*); + u32 new_size = new_nbuckets * sizeof(atf_exp::FProc*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + atf_exp::FProc* *new_buckets = (atf_exp::FProc**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("atf_exp.out_of_memory field:atf_exp.FDb.ind_proc"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_proc_buckets_n; i++) { + atf_exp::FProc* elem = _db.ind_proc_buckets_elems[i]; + while (elem) { + atf_exp::FProc &row = *elem; + atf_exp::FProc* next = row.ind_proc_next; + u32 index = row.ind_proc_hashval & (new_nbuckets-1); + row.ind_proc_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_proc_buckets_elems, old_size); + _db.ind_proc_buckets_elems = new_buckets; + _db.ind_proc_buckets_n = new_nbuckets; + } +} + +// --- atf_exp.FDb.zd_proc.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void atf_exp::zd_proc_Insert(atf_exp::FProc& row) { + if (!zd_proc_InLlistQ(row)) { + atf_exp::FProc* old_tail = _db.zd_proc_tail; + row.zd_proc_next = NULL; + row.zd_proc_prev = old_tail; + _db.zd_proc_tail = &row; + atf_exp::FProc **new_row_a = &old_tail->zd_proc_next; + atf_exp::FProc **new_row_b = &_db.zd_proc_head; + atf_exp::FProc **new_row = old_tail ? new_row_a : new_row_b; + *new_row = &row; + _db.zd_proc_n++; + } +} + +// --- atf_exp.FDb.zd_proc.Remove +// Remove element from index. If element is not in index, do nothing. +void atf_exp::zd_proc_Remove(atf_exp::FProc& row) { + if (zd_proc_InLlistQ(row)) { + atf_exp::FProc* old_head = _db.zd_proc_head; + (void)old_head; // in case it's not used + atf_exp::FProc* prev = row.zd_proc_prev; + atf_exp::FProc* next = row.zd_proc_next; + // if element is first, adjust list head; otherwise, adjust previous element's next + atf_exp::FProc **new_next_a = &prev->zd_proc_next; + atf_exp::FProc **new_next_b = &_db.zd_proc_head; + atf_exp::FProc **new_next = prev ? new_next_a : new_next_b; + *new_next = next; + // if element is last, adjust list tail; otherwise, adjust next element's prev + atf_exp::FProc **new_prev_a = &next->zd_proc_prev; + atf_exp::FProc **new_prev_b = &_db.zd_proc_tail; + atf_exp::FProc **new_prev = next ? new_prev_a : new_prev_b; + *new_prev = prev; + _db.zd_proc_n--; + row.zd_proc_next=(atf_exp::FProc*)-1; // not-in-list + } +} + +// --- atf_exp.FDb.zd_proc.RemoveAll +// Empty the index. (The rows are not deleted) +void atf_exp::zd_proc_RemoveAll() { + atf_exp::FProc* row = _db.zd_proc_head; + _db.zd_proc_head = NULL; + _db.zd_proc_tail = NULL; + _db.zd_proc_n = 0; + while (row) { + atf_exp::FProc* row_next = row->zd_proc_next; + row->zd_proc_next = (atf_exp::FProc*)-1; + row->zd_proc_prev = NULL; + row = row_next; + } +} + +// --- atf_exp.FDb.zd_proc.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +atf_exp::FProc* atf_exp::zd_proc_RemoveFirst() { + atf_exp::FProc *row = NULL; + row = _db.zd_proc_head; + if (row) { + atf_exp::FProc *next = row->zd_proc_next; + _db.zd_proc_head = next; + atf_exp::FProc **new_end_a = &next->zd_proc_prev; + atf_exp::FProc **new_end_b = &_db.zd_proc_tail; + atf_exp::FProc **new_end = next ? new_end_a : new_end_b; + *new_end = NULL; + _db.zd_proc_n--; + row->zd_proc_next = (atf_exp::FProc*)-1; // mark as not-in-list + } + return row; +} + +// --- atf_exp.FDb.cd_proc_read.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void atf_exp::cd_proc_read_Insert(atf_exp::FProc& row) { + if (!cd_proc_read_InLlistQ(row)) { + if (_db.cd_proc_read_head) { + row.cd_proc_read_next = _db.cd_proc_read_head; + row.cd_proc_read_prev = _db.cd_proc_read_head->cd_proc_read_prev; + row.cd_proc_read_prev->cd_proc_read_next = &row; + row.cd_proc_read_next->cd_proc_read_prev = &row; + } else { + row.cd_proc_read_next = &row; + row.cd_proc_read_prev = &row; + _db.cd_proc_read_head = &row; + } + _db.cd_proc_read_n++; + if (_db.cd_proc_read_head == &row) { + cd_proc_read_FirstChanged(); + } + } +} + +// --- atf_exp.FDb.cd_proc_read.Remove +// Remove element from index. If element is not in index, do nothing. +void atf_exp::cd_proc_read_Remove(atf_exp::FProc& row) { + if (cd_proc_read_InLlistQ(row)) { + atf_exp::FProc* old_head = _db.cd_proc_read_head; + (void)old_head; // in case it's not used + atf_exp::FProc *oldnext = row.cd_proc_read_next; + atf_exp::FProc *oldprev = row.cd_proc_read_prev; + oldnext->cd_proc_read_prev = oldprev; // remove element from list + oldprev->cd_proc_read_next = oldnext; + _db.cd_proc_read_n--; // adjust count + if (&row == _db.cd_proc_read_head) { + _db.cd_proc_read_head = oldnext==&row ? NULL : oldnext; // adjust list head + } + row.cd_proc_read_next = (atf_exp::FProc*)-1; // mark element as not-in-list); + row.cd_proc_read_prev = NULL; // clear back-pointer + if (old_head != _db.cd_proc_read_head) { + cd_proc_read_FirstChanged(); + } + } +} + +// --- atf_exp.FDb.cd_proc_read.RemoveAll +// Empty the index. (The rows are not deleted) +void atf_exp::cd_proc_read_RemoveAll() { + atf_exp::FProc* row = _db.cd_proc_read_head; + atf_exp::FProc* head = _db.cd_proc_read_head; + _db.cd_proc_read_head = NULL; + _db.cd_proc_read_n = 0; + bool do_fire = (NULL != row); + while (row) { + atf_exp::FProc* row_next = row->cd_proc_read_next; + row->cd_proc_read_next = (atf_exp::FProc*)-1; + row->cd_proc_read_prev = NULL; + row = row_next != head ? row_next : NULL; + } + if (do_fire) { + cd_proc_read_FirstChanged(); + } +} + +// --- atf_exp.FDb.cd_proc_read.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// Call FirstChanged trigger. +atf_exp::FProc* atf_exp::cd_proc_read_RemoveFirst() { + atf_exp::FProc *row = NULL; + row = _db.cd_proc_read_head; + if (row) { + bool hasmore = row!=row->cd_proc_read_next; + _db.cd_proc_read_head = hasmore ? row->cd_proc_read_next : NULL; + row->cd_proc_read_next->cd_proc_read_prev = row->cd_proc_read_prev; + row->cd_proc_read_prev->cd_proc_read_next = row->cd_proc_read_next; + row->cd_proc_read_prev = NULL; + _db.cd_proc_read_n--; + row->cd_proc_read_next = (atf_exp::FProc*)-1; // mark as not-in-list + cd_proc_read_FirstChanged(); + } + return row; +} + +// --- atf_exp.FDb.cd_proc_read.RotateFirst +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +atf_exp::FProc* atf_exp::cd_proc_read_RotateFirst() { + atf_exp::FProc *row = NULL; + row = _db.cd_proc_read_head; + if (row) { + _db.cd_proc_read_head = row->cd_proc_read_next; + } + return row; +} + +// --- atf_exp.FDb.cd_proc_read.FirstChanged +// First element of index changed. +static void atf_exp::cd_proc_read_FirstChanged() { +} + +// --- atf_exp.FDb.cd_proc_read.UpdateCycles +// Update cycles count from previous clock capture +inline static void atf_exp::cd_proc_read_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.FDb.cd_proc_read.Call +inline static void atf_exp::cd_proc_read_Call() { + if (!atf_exp::cd_proc_read_EmptyQ()) { // fstep:atf_exp.FDb.cd_proc_read + atf_exp::cd_proc_read_Step(); // steptype:Inline: call function on every step + cd_proc_read_UpdateCycles(); + algo_lib::_db.next_loop = algo_lib::_db.clock; + } +} + +// --- atf_exp.FDb.cd_proc_outflow.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void atf_exp::cd_proc_outflow_Insert(atf_exp::FProc& row) { + if (!cd_proc_outflow_InLlistQ(row)) { + if (_db.cd_proc_outflow_head) { + row.cd_proc_outflow_next = _db.cd_proc_outflow_head; + row.cd_proc_outflow_prev = _db.cd_proc_outflow_head->cd_proc_outflow_prev; + row.cd_proc_outflow_prev->cd_proc_outflow_next = &row; + row.cd_proc_outflow_next->cd_proc_outflow_prev = &row; + } else { + row.cd_proc_outflow_next = &row; + row.cd_proc_outflow_prev = &row; + _db.cd_proc_outflow_head = &row; + } + _db.cd_proc_outflow_n++; + if (_db.cd_proc_outflow_head == &row) { + cd_proc_outflow_FirstChanged(); + } + } +} + +// --- atf_exp.FDb.cd_proc_outflow.Remove +// Remove element from index. If element is not in index, do nothing. +void atf_exp::cd_proc_outflow_Remove(atf_exp::FProc& row) { + if (cd_proc_outflow_InLlistQ(row)) { + atf_exp::FProc* old_head = _db.cd_proc_outflow_head; + (void)old_head; // in case it's not used + atf_exp::FProc *oldnext = row.cd_proc_outflow_next; + atf_exp::FProc *oldprev = row.cd_proc_outflow_prev; + oldnext->cd_proc_outflow_prev = oldprev; // remove element from list + oldprev->cd_proc_outflow_next = oldnext; + _db.cd_proc_outflow_n--; // adjust count + if (&row == _db.cd_proc_outflow_head) { + _db.cd_proc_outflow_head = oldnext==&row ? NULL : oldnext; // adjust list head + } + row.cd_proc_outflow_next = (atf_exp::FProc*)-1; // mark element as not-in-list); + row.cd_proc_outflow_prev = NULL; // clear back-pointer + if (old_head != _db.cd_proc_outflow_head) { + cd_proc_outflow_FirstChanged(); + } + } +} + +// --- atf_exp.FDb.cd_proc_outflow.RemoveAll +// Empty the index. (The rows are not deleted) +void atf_exp::cd_proc_outflow_RemoveAll() { + atf_exp::FProc* row = _db.cd_proc_outflow_head; + atf_exp::FProc* head = _db.cd_proc_outflow_head; + _db.cd_proc_outflow_head = NULL; + _db.cd_proc_outflow_n = 0; + bool do_fire = (NULL != row); + while (row) { + atf_exp::FProc* row_next = row->cd_proc_outflow_next; + row->cd_proc_outflow_next = (atf_exp::FProc*)-1; + row->cd_proc_outflow_prev = NULL; + row = row_next != head ? row_next : NULL; + } + if (do_fire) { + cd_proc_outflow_FirstChanged(); + } +} + +// --- atf_exp.FDb.cd_proc_outflow.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// Call FirstChanged trigger. +atf_exp::FProc* atf_exp::cd_proc_outflow_RemoveFirst() { + atf_exp::FProc *row = NULL; + row = _db.cd_proc_outflow_head; + if (row) { + bool hasmore = row!=row->cd_proc_outflow_next; + _db.cd_proc_outflow_head = hasmore ? row->cd_proc_outflow_next : NULL; + row->cd_proc_outflow_next->cd_proc_outflow_prev = row->cd_proc_outflow_prev; + row->cd_proc_outflow_prev->cd_proc_outflow_next = row->cd_proc_outflow_next; + row->cd_proc_outflow_prev = NULL; + _db.cd_proc_outflow_n--; + row->cd_proc_outflow_next = (atf_exp::FProc*)-1; // mark as not-in-list + cd_proc_outflow_FirstChanged(); + } + return row; +} + +// --- atf_exp.FDb.cd_proc_outflow.RotateFirst +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +atf_exp::FProc* atf_exp::cd_proc_outflow_RotateFirst() { + atf_exp::FProc *row = NULL; + row = _db.cd_proc_outflow_head; + if (row) { + _db.cd_proc_outflow_head = row->cd_proc_outflow_next; + } + return row; +} + +// --- atf_exp.FDb.cd_proc_outflow.FirstChanged +// First element of index changed. +static void atf_exp::cd_proc_outflow_FirstChanged() { +} + +// --- atf_exp.FDb.cd_proc_outflow.UpdateCycles +// Update cycles count from previous clock capture +inline static void atf_exp::cd_proc_outflow_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.FDb.cd_proc_outflow.Call +inline static void atf_exp::cd_proc_outflow_Call() { + if (!atf_exp::cd_proc_outflow_EmptyQ()) { // fstep:atf_exp.FDb.cd_proc_outflow + atf_exp::cd_proc_outflow_Step(); // steptype:Inline: call function on every step + cd_proc_outflow_UpdateCycles(); + algo_lib::_db.next_loop = algo_lib::_db.clock; + } +} + +// --- atf_exp.FDb.ind_proc_pid.Find +// Find row by key. Return NULL if not found. +atf_exp::FProc* atf_exp::ind_proc_pid_Find(i32 key) { + u32 index = ::i32_Hash(0, key) & (_db.ind_proc_pid_buckets_n - 1); + atf_exp::FProc *ret = _db.ind_proc_pid_buckets_elems[index]; + for (; ret && !((*ret).pid == key); ret = ret->ind_proc_pid_next) { + } + return ret; +} + +// --- atf_exp.FDb.ind_proc_pid.FindX +// Look up row by key and return reference. Throw exception if not found +atf_exp::FProc& atf_exp::ind_proc_pid_FindX(i32 key) { + atf_exp::FProc* ret = ind_proc_pid_Find(key); + vrfy(ret, tempstr() << "atf_exp.key_error table:ind_proc_pid key:'"<ind_proc_pid_next; + } while (true); + if (retval) { + row.ind_proc_pid_next = *prev; + _db.ind_proc_pid_n++; + *prev = &row; + } + } + return retval; +} + +// --- atf_exp.FDb.ind_proc_pid.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void atf_exp::ind_proc_pid_Remove(atf_exp::FProc& row) { + if (LIKELY(row.ind_proc_pid_next != (atf_exp::FProc*)-1)) {// check if in hash already + u32 index = row.ind_proc_pid_hashval & (_db.ind_proc_pid_buckets_n - 1); + atf_exp::FProc* *prev = &_db.ind_proc_pid_buckets_elems[index]; // addr of pointer to current element + while (atf_exp::FProc *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_proc_pid_next; // unlink (singly linked list) + _db.ind_proc_pid_n--; + row.ind_proc_pid_next = (atf_exp::FProc*)-1;// not-in-hash + break; + } + prev = &next->ind_proc_pid_next; + } + } +} + +// --- atf_exp.FDb.ind_proc_pid.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void atf_exp::ind_proc_pid_Reserve(int n) { + ind_proc_pid_AbsReserve(_db.ind_proc_pid_n + n); +} + +// --- atf_exp.FDb.ind_proc_pid.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_exp::ind_proc_pid_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_proc_pid_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(atf_exp::FProc*); + u32 new_size = new_nbuckets * sizeof(atf_exp::FProc*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + atf_exp::FProc* *new_buckets = (atf_exp::FProc**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("atf_exp.out_of_memory field:atf_exp.FDb.ind_proc_pid"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_proc_pid_buckets_n; i++) { + atf_exp::FProc* elem = _db.ind_proc_pid_buckets_elems[i]; + while (elem) { + atf_exp::FProc &row = *elem; + atf_exp::FProc* next = row.ind_proc_pid_next; + u32 index = row.ind_proc_pid_hashval & (new_nbuckets-1); + row.ind_proc_pid_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_proc_pid_buckets_elems, old_size); + _db.ind_proc_pid_buckets_elems = new_buckets; + _db.ind_proc_pid_buckets_n = new_nbuckets; + } +} + +// --- atf_exp.FDb.ind_proc_pid.UpdateCycles +// Update cycles count from previous clock capture +inline static void atf_exp::ind_proc_pid_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.FDb.ind_proc_pid.Call +inline static void atf_exp::ind_proc_pid_Call() { + if (!atf_exp::ind_proc_pid_EmptyQ()) { // fstep:atf_exp.FDb.ind_proc_pid + if (atf_exp::_db.ind_proc_pid_next < algo_lib::_db.clock) { + atf_exp::_db.ind_proc_pid_next = algo_lib::_db.clock + atf_exp::_db.ind_proc_pid_delay; + atf_exp::ind_proc_pid_Step(); // steptype:InlineRecur: call function every N clock cycles + ind_proc_pid_UpdateCycles(); + } + algo_lib::_db.next_loop.value = u64_Min(atf_exp::_db.ind_proc_pid_next, algo_lib::_db.next_loop); + } +} + +// --- atf_exp.FDb.ind_proc_pid.SetDelay +// Set inter-step delay to specified value. +// The difference between new delay and current delay is added to the next scheduled time. +void atf_exp::ind_proc_pid_SetDelay(algo::SchedTime delay) { + i64 diff = delay.value - atf_exp::_db.ind_proc_pid_delay.value; + atf_exp::_db.ind_proc_pid_delay = delay; + if (diff > 0) { + atf_exp::_db.ind_proc_pid_next.value += diff; + } else { + atf_exp::_db.ind_proc_pid_next.value = algo::u64_SubClip(atf_exp::_db.ind_proc_pid_next.value,-diff); + } +} + +// --- atf_exp.FDb.fdin.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +atf_exp::FFdin& atf_exp::fdin_Alloc() { + atf_exp::FFdin* row = fdin_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("atf_exp.out_of_mem field:atf_exp.FDb.fdin comment:'Alloc failed'"); + } + return *row; +} + +// --- atf_exp.FDb.fdin.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +atf_exp::FFdin* atf_exp::fdin_AllocMaybe() { + atf_exp::FFdin *row = (atf_exp::FFdin*)fdin_AllocMem(); + if (row) { + new (row) atf_exp::FFdin; // call constructor + } + return row; +} + +// --- atf_exp.FDb.fdin.Delete +// Remove row from all global and cross indices, then deallocate row +void atf_exp::fdin_Delete(atf_exp::FFdin &row) { + row.~FFdin(); + fdin_FreeMem(row); +} + +// --- atf_exp.FDb.fdin.AllocMem +// Allocate space for one element +// If no memory available, return NULL. +void* atf_exp::fdin_AllocMem() { + atf_exp::FFdin *row = _db.fdin_free; + if (UNLIKELY(!row)) { + fdin_Reserve(1); + row = _db.fdin_free; + } + if (row) { + _db.fdin_free = row->fdin_next; + } + return row; +} + +// --- atf_exp.FDb.fdin.FreeMem +// Remove mem from all global and cross indices, then deallocate mem +void atf_exp::fdin_FreeMem(atf_exp::FFdin &row) { + if (UNLIKELY(row.fdin_next != (atf_exp::FFdin*)-1)) { + FatalErrorExit("atf_exp.tpool_double_delete pool:atf_exp.FDb.fdin comment:'double deletion caught'"); + } + row.fdin_next = _db.fdin_free; // insert into free list + _db.fdin_free = &row; +} + +// --- atf_exp.FDb.fdin.Reserve +// Preallocate memory for N more elements +// Return number of elements actually reserved. +u64 atf_exp::fdin_Reserve(u64 n_elems) { + u64 ret = 0; + while (ret < n_elems) { + u64 size = _db.fdin_blocksize; // underlying allocator is probably Lpool + u64 reserved = fdin_ReserveMem(size); + ret += reserved; + if (reserved == 0) { + break; + } + } + return ret; +} + +// --- atf_exp.FDb.fdin.ReserveMem +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +u64 atf_exp::fdin_ReserveMem(u64 size) { + u64 ret = 0; + if (size >= sizeof(atf_exp::FFdin)) { + atf_exp::FFdin *mem = (atf_exp::FFdin*)algo_lib::malloc_AllocMem(size); + ret = mem ? size / sizeof(atf_exp::FFdin) : 0; + // add newly allocated elements to the free list; + for (u64 i=0; i < ret; i++) { + mem[i].fdin_next = _db.fdin_free; + _db.fdin_free = mem+i; + } + } + return ret; +} + +// --- atf_exp.FDb.fdin.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool atf_exp::fdin_XrefMaybe(atf_exp::FFdin &row) { + bool retval = true; + (void)row; + return retval; +} + +// --- atf_exp.FDb.cd_fdin_eof.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void atf_exp::cd_fdin_eof_Insert(atf_exp::FFdin& row) { + if (!cd_fdin_eof_InLlistQ(row)) { + if (_db.cd_fdin_eof_head) { + row.cd_fdin_eof_next = _db.cd_fdin_eof_head; + row.cd_fdin_eof_prev = _db.cd_fdin_eof_head->cd_fdin_eof_prev; + row.cd_fdin_eof_prev->cd_fdin_eof_next = &row; + row.cd_fdin_eof_next->cd_fdin_eof_prev = &row; + } else { + row.cd_fdin_eof_next = &row; + row.cd_fdin_eof_prev = &row; + _db.cd_fdin_eof_head = &row; + } + _db.cd_fdin_eof_n++; + if (_db.cd_fdin_eof_head == &row) { + cd_fdin_eof_FirstChanged(); + } + } +} + +// --- atf_exp.FDb.cd_fdin_eof.Remove +// Remove element from index. If element is not in index, do nothing. +void atf_exp::cd_fdin_eof_Remove(atf_exp::FFdin& row) { + if (cd_fdin_eof_InLlistQ(row)) { + atf_exp::FFdin* old_head = _db.cd_fdin_eof_head; + (void)old_head; // in case it's not used + atf_exp::FFdin *oldnext = row.cd_fdin_eof_next; + atf_exp::FFdin *oldprev = row.cd_fdin_eof_prev; + oldnext->cd_fdin_eof_prev = oldprev; // remove element from list + oldprev->cd_fdin_eof_next = oldnext; + _db.cd_fdin_eof_n--; // adjust count + if (&row == _db.cd_fdin_eof_head) { + _db.cd_fdin_eof_head = oldnext==&row ? NULL : oldnext; // adjust list head + } + row.cd_fdin_eof_next = (atf_exp::FFdin*)-1; // mark element as not-in-list); + row.cd_fdin_eof_prev = NULL; // clear back-pointer + if (old_head != _db.cd_fdin_eof_head) { + cd_fdin_eof_FirstChanged(); + } + } +} + +// --- atf_exp.FDb.cd_fdin_eof.RemoveAll +// Empty the index. (The rows are not deleted) +void atf_exp::cd_fdin_eof_RemoveAll() { + atf_exp::FFdin* row = _db.cd_fdin_eof_head; + atf_exp::FFdin* head = _db.cd_fdin_eof_head; + _db.cd_fdin_eof_head = NULL; + _db.cd_fdin_eof_n = 0; + bool do_fire = (NULL != row); + while (row) { + atf_exp::FFdin* row_next = row->cd_fdin_eof_next; + row->cd_fdin_eof_next = (atf_exp::FFdin*)-1; + row->cd_fdin_eof_prev = NULL; + row = row_next != head ? row_next : NULL; + } + if (do_fire) { + cd_fdin_eof_FirstChanged(); + } +} + +// --- atf_exp.FDb.cd_fdin_eof.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// Call FirstChanged trigger. +atf_exp::FFdin* atf_exp::cd_fdin_eof_RemoveFirst() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_eof_head; + if (row) { + bool hasmore = row!=row->cd_fdin_eof_next; + _db.cd_fdin_eof_head = hasmore ? row->cd_fdin_eof_next : NULL; + row->cd_fdin_eof_next->cd_fdin_eof_prev = row->cd_fdin_eof_prev; + row->cd_fdin_eof_prev->cd_fdin_eof_next = row->cd_fdin_eof_next; + row->cd_fdin_eof_prev = NULL; + _db.cd_fdin_eof_n--; + row->cd_fdin_eof_next = (atf_exp::FFdin*)-1; // mark as not-in-list + cd_fdin_eof_FirstChanged(); + } + return row; +} + +// --- atf_exp.FDb.cd_fdin_eof.RotateFirst +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +atf_exp::FFdin* atf_exp::cd_fdin_eof_RotateFirst() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_eof_head; + if (row) { + _db.cd_fdin_eof_head = row->cd_fdin_eof_next; + } + return row; +} + +// --- atf_exp.FDb.cd_fdin_eof.FirstChanged +// First element of index changed. +static void atf_exp::cd_fdin_eof_FirstChanged() { +} + +// --- atf_exp.FDb.cd_fdin_eof.UpdateCycles +// Update cycles count from previous clock capture +inline static void atf_exp::cd_fdin_eof_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.FDb.cd_fdin_eof.Call +inline static void atf_exp::cd_fdin_eof_Call() { + if (!atf_exp::cd_fdin_eof_EmptyQ()) { // fstep:atf_exp.FDb.cd_fdin_eof + atf_exp::cd_fdin_eof_Step(); // steptype:Inline: call function on every step + cd_fdin_eof_UpdateCycles(); + algo_lib::_db.next_loop = algo_lib::_db.clock; + } +} + +// --- atf_exp.FDb.cd_fdin_read.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void atf_exp::cd_fdin_read_Insert(atf_exp::FFdin& row) { + if (!cd_fdin_read_InLlistQ(row)) { + if (_db.cd_fdin_read_head) { + row.cd_fdin_read_next = _db.cd_fdin_read_head; + row.cd_fdin_read_prev = _db.cd_fdin_read_head->cd_fdin_read_prev; + row.cd_fdin_read_prev->cd_fdin_read_next = &row; + row.cd_fdin_read_next->cd_fdin_read_prev = &row; + } else { + row.cd_fdin_read_next = &row; + row.cd_fdin_read_prev = &row; + _db.cd_fdin_read_head = &row; + } + _db.cd_fdin_read_n++; + if (_db.cd_fdin_read_head == &row) { + cd_fdin_read_FirstChanged(); + } + } +} + +// --- atf_exp.FDb.cd_fdin_read.Remove +// Remove element from index. If element is not in index, do nothing. +void atf_exp::cd_fdin_read_Remove(atf_exp::FFdin& row) { + if (cd_fdin_read_InLlistQ(row)) { + atf_exp::FFdin* old_head = _db.cd_fdin_read_head; + (void)old_head; // in case it's not used + atf_exp::FFdin *oldnext = row.cd_fdin_read_next; + atf_exp::FFdin *oldprev = row.cd_fdin_read_prev; + oldnext->cd_fdin_read_prev = oldprev; // remove element from list + oldprev->cd_fdin_read_next = oldnext; + _db.cd_fdin_read_n--; // adjust count + if (&row == _db.cd_fdin_read_head) { + _db.cd_fdin_read_head = oldnext==&row ? NULL : oldnext; // adjust list head + } + row.cd_fdin_read_next = (atf_exp::FFdin*)-1; // mark element as not-in-list); + row.cd_fdin_read_prev = NULL; // clear back-pointer + if (old_head != _db.cd_fdin_read_head) { + cd_fdin_read_FirstChanged(); + } + } +} + +// --- atf_exp.FDb.cd_fdin_read.RemoveAll +// Empty the index. (The rows are not deleted) +void atf_exp::cd_fdin_read_RemoveAll() { + atf_exp::FFdin* row = _db.cd_fdin_read_head; + atf_exp::FFdin* head = _db.cd_fdin_read_head; + _db.cd_fdin_read_head = NULL; + _db.cd_fdin_read_n = 0; + bool do_fire = (NULL != row); + while (row) { + atf_exp::FFdin* row_next = row->cd_fdin_read_next; + row->cd_fdin_read_next = (atf_exp::FFdin*)-1; + row->cd_fdin_read_prev = NULL; + row = row_next != head ? row_next : NULL; + } + if (do_fire) { + cd_fdin_read_FirstChanged(); + } +} + +// --- atf_exp.FDb.cd_fdin_read.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// Call FirstChanged trigger. +atf_exp::FFdin* atf_exp::cd_fdin_read_RemoveFirst() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_read_head; + if (row) { + bool hasmore = row!=row->cd_fdin_read_next; + _db.cd_fdin_read_head = hasmore ? row->cd_fdin_read_next : NULL; + row->cd_fdin_read_next->cd_fdin_read_prev = row->cd_fdin_read_prev; + row->cd_fdin_read_prev->cd_fdin_read_next = row->cd_fdin_read_next; + row->cd_fdin_read_prev = NULL; + _db.cd_fdin_read_n--; + row->cd_fdin_read_next = (atf_exp::FFdin*)-1; // mark as not-in-list + cd_fdin_read_FirstChanged(); + } + return row; +} + +// --- atf_exp.FDb.cd_fdin_read.RotateFirst +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +atf_exp::FFdin* atf_exp::cd_fdin_read_RotateFirst() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_read_head; + if (row) { + _db.cd_fdin_read_head = row->cd_fdin_read_next; + } + return row; +} + +// --- atf_exp.FDb.cd_fdin_read.FirstChanged +// First element of index changed. +static void atf_exp::cd_fdin_read_FirstChanged() { +} + +// --- atf_exp.FDb.cd_fdin_read.UpdateCycles +// Update cycles count from previous clock capture +inline static void atf_exp::cd_fdin_read_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.FDb.cd_fdin_read.Call +inline static void atf_exp::cd_fdin_read_Call() { + if (!atf_exp::cd_fdin_read_EmptyQ()) { // fstep:atf_exp.FDb.cd_fdin_read + atf_exp::cd_fdin_read_Step(); // steptype:Inline: call function on every step + cd_fdin_read_UpdateCycles(); + algo_lib::_db.next_loop = algo_lib::_db.clock; + } +} + +// --- atf_exp.FDb.cd_fdin_suspend.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void atf_exp::cd_fdin_suspend_Insert(atf_exp::FFdin& row) { + if (!cd_fdin_suspend_InLlistQ(row)) { + if (_db.cd_fdin_suspend_head) { + row.cd_fdin_suspend_next = _db.cd_fdin_suspend_head; + row.cd_fdin_suspend_prev = _db.cd_fdin_suspend_head->cd_fdin_suspend_prev; + row.cd_fdin_suspend_prev->cd_fdin_suspend_next = &row; + row.cd_fdin_suspend_next->cd_fdin_suspend_prev = &row; + } else { + row.cd_fdin_suspend_next = &row; + row.cd_fdin_suspend_prev = &row; + _db.cd_fdin_suspend_head = &row; + } + _db.cd_fdin_suspend_n++; + } +} + +// --- atf_exp.FDb.cd_fdin_suspend.Remove +// Remove element from index. If element is not in index, do nothing. +void atf_exp::cd_fdin_suspend_Remove(atf_exp::FFdin& row) { + if (cd_fdin_suspend_InLlistQ(row)) { + atf_exp::FFdin* old_head = _db.cd_fdin_suspend_head; + (void)old_head; // in case it's not used + atf_exp::FFdin *oldnext = row.cd_fdin_suspend_next; + atf_exp::FFdin *oldprev = row.cd_fdin_suspend_prev; + oldnext->cd_fdin_suspend_prev = oldprev; // remove element from list + oldprev->cd_fdin_suspend_next = oldnext; + _db.cd_fdin_suspend_n--; // adjust count + if (&row == _db.cd_fdin_suspend_head) { + _db.cd_fdin_suspend_head = oldnext==&row ? NULL : oldnext; // adjust list head + } + row.cd_fdin_suspend_next = (atf_exp::FFdin*)-1; // mark element as not-in-list); + row.cd_fdin_suspend_prev = NULL; // clear back-pointer + } +} + +// --- atf_exp.FDb.cd_fdin_suspend.RemoveAll +// Empty the index. (The rows are not deleted) +void atf_exp::cd_fdin_suspend_RemoveAll() { + atf_exp::FFdin* row = _db.cd_fdin_suspend_head; + atf_exp::FFdin* head = _db.cd_fdin_suspend_head; + _db.cd_fdin_suspend_head = NULL; + _db.cd_fdin_suspend_n = 0; + while (row) { + atf_exp::FFdin* row_next = row->cd_fdin_suspend_next; + row->cd_fdin_suspend_next = (atf_exp::FFdin*)-1; + row->cd_fdin_suspend_prev = NULL; + row = row_next != head ? row_next : NULL; + } +} + +// --- atf_exp.FDb.cd_fdin_suspend.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +atf_exp::FFdin* atf_exp::cd_fdin_suspend_RemoveFirst() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_suspend_head; + if (row) { + bool hasmore = row!=row->cd_fdin_suspend_next; + _db.cd_fdin_suspend_head = hasmore ? row->cd_fdin_suspend_next : NULL; + row->cd_fdin_suspend_next->cd_fdin_suspend_prev = row->cd_fdin_suspend_prev; + row->cd_fdin_suspend_prev->cd_fdin_suspend_next = row->cd_fdin_suspend_next; + row->cd_fdin_suspend_prev = NULL; + _db.cd_fdin_suspend_n--; + row->cd_fdin_suspend_next = (atf_exp::FFdin*)-1; // mark as not-in-list + } + return row; +} + +// --- atf_exp.FDb.cd_fdin_suspend.RotateFirst +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +atf_exp::FFdin* atf_exp::cd_fdin_suspend_RotateFirst() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_suspend_head; + if (row) { + _db.cd_fdin_suspend_head = row->cd_fdin_suspend_next; + } + return row; +} + +// --- atf_exp.FDb.trace.RowidFind +// find trace by row id (used to implement reflection) +static algo::ImrowPtr atf_exp::trace_RowidFind(int t) { + return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +} + +// --- atf_exp.FDb.trace.N +// Function return 1 +inline static i32 atf_exp::trace_N() { + return 1; +} + +// --- atf_exp.FDb..Init +// Set all fields to initial values. +void atf_exp::FDb_Init() { + // proc: initialize Tpool + _db.proc_free = NULL; + _db.proc_blocksize = algo::BumpToPow2(64 * sizeof(atf_exp::FProc)); // allocate 64-127 elements at a time + // initialize hash table for atf_exp::FProc; + _db.ind_proc_n = 0; // (atf_exp.FDb.ind_proc) + _db.ind_proc_buckets_n = 4; // (atf_exp.FDb.ind_proc) + _db.ind_proc_buckets_elems = (atf_exp::FProc**)algo_lib::malloc_AllocMem(sizeof(atf_exp::FProc*)*_db.ind_proc_buckets_n); // initial buckets (atf_exp.FDb.ind_proc) + if (!_db.ind_proc_buckets_elems) { + FatalErrorExit("out of memory"); // (atf_exp.FDb.ind_proc) + } + memset(_db.ind_proc_buckets_elems, 0, sizeof(atf_exp::FProc*)*_db.ind_proc_buckets_n); // (atf_exp.FDb.ind_proc) + _db.zd_proc_head = NULL; // (atf_exp.FDb.zd_proc) + _db.zd_proc_n = 0; // (atf_exp.FDb.zd_proc) + _db.zd_proc_tail = NULL; // (atf_exp.FDb.zd_proc) + _db.cd_proc_read_head = NULL; // (atf_exp.FDb.cd_proc_read) + _db.cd_proc_read_n = 0; // (atf_exp.FDb.cd_proc_read) + _db.cd_proc_outflow_head = NULL; // (atf_exp.FDb.cd_proc_outflow) + _db.cd_proc_outflow_n = 0; // (atf_exp.FDb.cd_proc_outflow) + // initialize hash table for atf_exp::FProc; + _db.ind_proc_pid_n = 0; // (atf_exp.FDb.ind_proc_pid) + _db.ind_proc_pid_buckets_n = 4; // (atf_exp.FDb.ind_proc_pid) + _db.ind_proc_pid_buckets_elems = (atf_exp::FProc**)algo_lib::malloc_AllocMem(sizeof(atf_exp::FProc*)*_db.ind_proc_pid_buckets_n); // initial buckets (atf_exp.FDb.ind_proc_pid) + if (!_db.ind_proc_pid_buckets_elems) { + FatalErrorExit("out of memory"); // (atf_exp.FDb.ind_proc_pid) + } + memset(_db.ind_proc_pid_buckets_elems, 0, sizeof(atf_exp::FProc*)*_db.ind_proc_pid_buckets_n); // (atf_exp.FDb.ind_proc_pid) + atf_exp::_db.ind_proc_pid_delay = algo::ToSchedTime(60); // initialize fstep delay (atf_exp.FDb.ind_proc_pid) + _db.c_proc_read = NULL; + // fdin: initialize Tpool + _db.fdin_free = NULL; + _db.fdin_blocksize = algo::BumpToPow2(64 * sizeof(atf_exp::FFdin)); // allocate 64-127 elements at a time + _db.cd_fdin_eof_head = NULL; // (atf_exp.FDb.cd_fdin_eof) + _db.cd_fdin_eof_n = 0; // (atf_exp.FDb.cd_fdin_eof) + _db.cd_fdin_read_head = NULL; // (atf_exp.FDb.cd_fdin_read) + _db.cd_fdin_read_n = 0; // (atf_exp.FDb.cd_fdin_read) + _db.cd_fdin_suspend_head = NULL; // (atf_exp.FDb.cd_fdin_suspend) + _db.cd_fdin_suspend_n = 0; // (atf_exp.FDb.cd_fdin_suspend) + + atf_exp::InitReflection(); +} + +// --- atf_exp.FDb..Uninit +void atf_exp::FDb_Uninit() { + atf_exp::FDb &row = _db; (void)row; + + // atf_exp.FDb.ind_proc_pid.Uninit (Thash) // + // skip destruction of ind_proc_pid in global scope + + // atf_exp.FDb.ind_proc.Uninit (Thash) // + // skip destruction of ind_proc in global scope +} + +// --- atf_exp.FFdin.in.BeginRead +// Attach fbuf to Iohook for reading +// Attach file descriptor and begin reading using edge-triggered epoll. +// File descriptor becomes owned by atf_exp::FFdin.in via FIohook field. +// Whenever the file descriptor becomes readable, insert fdin into cd_fdin_read. +void atf_exp::in_BeginRead(atf_exp::FFdin& fdin, algo::Fildes fd) { + fdin.in_iohook.fildes = fd; + callback_Set1(fdin.in_iohook, fdin, atf_exp::cd_fdin_read_Insert); + IOEvtFlags flags; + read_Set(flags, true); + if (fdin.in_epoll_enable) { + algo_lib::IohookAdd(fdin.in_iohook, flags); + } else { + atf_exp::cd_fdin_read_Insert(fdin); + } +} + +// --- atf_exp.FFdin.in.EndRead +// Set EOF flag +void atf_exp::in_EndRead(atf_exp::FFdin& fdin) { + if (ValidQ(fdin.in_iohook.fildes)) { + fdin.in_eof = true; + atf_exp::cd_fdin_read_Insert(fdin); + } +} + +// --- atf_exp.FFdin.in.GetMsg +// Detect incoming message in buffer and return it +// Look for valid message at current position in the buffer. +// If message is already there, return a pointer to it. Do not skip message (call SkipMsg to do that). +// If there is no message, read once from underlying file descriptor and try again. +// The message is found by looking for delimiter '\n'. +// The return value is an aryptr. If ret.elems is non-NULL, the message is valid (possibly empty). +// If ret.elems is NULL, no message can be extracted from buffer. +// The returned aryptr excludes the trailing deliminter. +// SkipMsg will skip both the line and the deliminter. +// A partial line at the end of input is NOT returned (TODO?) +// +algo::aryptr atf_exp::in_GetMsg(atf_exp::FFdin& fdin) { + algo::aryptr ret; + if (!fdin.in_msgvalid) { + in_ScanMsg(fdin); + if (!fdin.in_msgvalid) { + bool readable = in_Refill(fdin); + if (readable) { + in_ScanMsg(fdin); + } + } + } + char *hdr = (char*)(fdin.in_elems + fdin.in_start); + if (fdin.in_msgvalid) { + ret.elems = hdr; + ret.n_elems = fdin.in_msglen; + } + return ret; +} + +// --- atf_exp.FFdin.in.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void atf_exp::in_Realloc(atf_exp::FFdin& fdin, int new_max) { + new_max = i32_Max(new_max, fdin.in_end); + u8 *new_mem = fdin.in_elems + ? (u8*)algo_lib::malloc_ReallocMem(fdin.in_elems, fdin.in_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_exp.fbuf_nomem field:atf_exp.FFdin.in comment:'out of memory'"); + } + fdin.in_elems = new_mem; + fdin.in_max = new_max; +} + +// --- atf_exp.FFdin.in.Refill +// Refill buffer. Return false if no further refill possible (input buffer exhausted) +bool atf_exp::in_Refill(atf_exp::FFdin& fdin) { + bool readable = ValidQ(fdin.in_iohook.fildes); + if (readable) { + int fd = fdin.in_iohook.fildes.value; + i32 max = in_Max(fdin); + i32 end = fdin.in_end; + i32 nbytes = end - fdin.in_start; // # bytes currently in buffer + i32 nfree = max - end; // bytes available at the end of buffer + if (nbytes == 0 || nfree == 0) { // make more room for reading (or take advantage of free shift) + in_Shift(fdin); + end = fdin.in_end; + nfree = max - end; + } + ssize_t ret = read(fd, fdin.in_elems + end, nfree); + readable = !(ret < 0 && errno == EAGAIN); + bool error = ret < 0 && errno != EAGAIN; // detect permanent error on this fd + bool eof = error || (ret == 0 && nfree > 0); + fdin.in_end += i32_Max(ret,0); // new end of bytes + if (error) { + fdin.in_err = algo::FromErrno(errno); // fetch errno + } + fdin.in_eof |= eof; + } + if (!readable && fdin.in_epoll_enable) { + atf_exp::cd_fdin_read_Remove(fdin); + } + return readable; +} + +// --- atf_exp.FFdin.in.RemoveAll +// Empty bfufer +// Discard contents of the buffer. +void atf_exp::in_RemoveAll(atf_exp::FFdin& fdin) { + fdin.in_start = 0; + fdin.in_end = 0; + fdin.in_msgvalid = false; +} + +// --- atf_exp.FFdin.in.ScanMsg +// Internal function to scan for a message +// +static void atf_exp::in_ScanMsg(atf_exp::FFdin& fdin) { + char *hdr = (char*)(fdin.in_elems + fdin.in_start); + i32 avail = in_N(fdin); + i32 msglen; + bool found = false; + // scan for delimiter starting from the previous place where we left off. + // at the end, save offset back to fdin so we don't have to re-scan. + // returned message length **does not include delimiter**. + // a line that exceeds buffer length is not returned. + for (msglen = fdin.in_msglen; msglen < avail; msglen += sizeof(char)) { + if (hdr[msglen] == '\n') { // delimiter? + found = true; + break; + } + } + if (!found && msglen >= in_Max(fdin)) { + fdin.in_eof = true; // cause user to detect eof + fdin.in_err = algo::FromErrno(E2BIG); // argument list too big -- closest error code + } + fdin.in_msglen = msglen; + fdin.in_msgvalid = found; +} + +// --- atf_exp.FFdin.in.Shift +// Internal function to shift data left +// Shift existing bytes over to the beginning of the buffer +static void atf_exp::in_Shift(atf_exp::FFdin& fdin) { + i32 start = fdin.in_start; + i32 bytes_n = fdin.in_end - start; + if (bytes_n > 0) { + memmove(fdin.in_elems, fdin.in_elems + start, bytes_n); + } + fdin.in_end = bytes_n; + fdin.in_start = 0; +} + +// --- atf_exp.FFdin.in.SkipBytes +// Skip N bytes when reading +// Mark some buffer contents as read. +// +void atf_exp::in_SkipBytes(atf_exp::FFdin& fdin, int n) { + int avail = fdin.in_end - fdin.in_start; + n = i32_Min(n,avail); + fdin.in_start += n; + fdin.in_msgvalid = false; +} + +// --- atf_exp.FFdin.in.SkipMsg +// Skip current message, if any +// Skip current message, if any. +void atf_exp::in_SkipMsg(atf_exp::FFdin& fdin) { + if (fdin.in_msgvalid) { + int skip = fdin.in_msglen; + skip += ssizeof(char); // delimiter + i32 start = fdin.in_start; + start += skip; + fdin.in_start = start; + fdin.in_msgvalid = false; + fdin.in_msglen = 0; // reset message length -- important for delimited streams + } +} + +// --- atf_exp.FFdin.in.WriteAll +// Attempt to write buffer contents to fbuf, return success +// Write bytes to the buffer. If the entire block is written, return true, +// Otherwise return false. +// Bytes in the buffer are potentially shifted left to make room for the message. +// +bool atf_exp::in_WriteAll(atf_exp::FFdin& fdin, u8 *in, i32 in_n) { + int max = in_Max(fdin); + // check if message doesn't fit. if so, shift bytes over. + if (fdin.in_end + in_n > max) { + in_Shift(fdin); + } + // now try to write the message. + i32 end = fdin.in_end; + bool fits = end + in_n <= max; + if (fits) { + if (in_n > 0) { + memcpy(fdin.in_elems + end, in, in_n); + fdin.in_end = end + in_n; + } + } + return fits; +} + +// --- atf_exp.FFdin.in.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void atf_exp::in_WriteReserve(atf_exp::FFdin& fdin, u8 *in, i32 in_n) { + if (!in_WriteAll(fdin, in, in_n)) { + in_Realloc(fdin, fdin.in_max*2); + if (!in_WriteAll(fdin, in, in_n)) { + FatalErrorExit("in: out of memory"); + } + } +} + +// --- atf_exp.FFdin..Init +// Set all fields to initial values. +void atf_exp::FFdin_Init(atf_exp::FFdin& fdin) { + fdin.in_elems = NULL; // in: initialize + fdin.in_max = 0; // in: initialize + fdin.in_end = 0; // in: initialize + fdin.in_start = 0; // in: initialize + fdin.in_eof = false; // in: initialize + fdin.in_msgvalid = false; // in: initialize + fdin.in_msglen = 0; // in: initialize + fdin.in_epoll_enable = true; // in: initialize + in_Realloc(fdin, 8192); + fdin.fdin_next = (atf_exp::FFdin*)-1; // (atf_exp.FDb.fdin) not-in-tpool's freelist + fdin.cd_fdin_eof_next = (atf_exp::FFdin*)-1; // (atf_exp.FDb.cd_fdin_eof) not-in-list + fdin.cd_fdin_eof_prev = NULL; // (atf_exp.FDb.cd_fdin_eof) + fdin.cd_fdin_read_next = (atf_exp::FFdin*)-1; // (atf_exp.FDb.cd_fdin_read) not-in-list + fdin.cd_fdin_read_prev = NULL; // (atf_exp.FDb.cd_fdin_read) + fdin.cd_fdin_suspend_next = (atf_exp::FFdin*)-1; // (atf_exp.FDb.cd_fdin_suspend) not-in-list + fdin.cd_fdin_suspend_prev = NULL; // (atf_exp.FDb.cd_fdin_suspend) +} + +// --- atf_exp.FFdin..Uninit +void atf_exp::FFdin_Uninit(atf_exp::FFdin& fdin) { + atf_exp::FFdin &row = fdin; (void)row; + cd_fdin_eof_Remove(row); // remove fdin from index cd_fdin_eof + cd_fdin_read_Remove(row); // remove fdin from index cd_fdin_read + cd_fdin_suspend_Remove(row); // remove fdin from index cd_fdin_suspend + + // atf_exp.FFdin.in.Uninit (Fbuf) // + if (fdin.in_elems) { + algo_lib::malloc_FreeMem(fdin.in_elems, sizeof(char)*fdin.in_max); // (atf_exp.FFdin.in) + } + fdin.in_elems = NULL; + fdin.in_max = 0; +} + +// --- atf_exp.FProc.base.CopyOut +// Copy fields out of row +void atf_exp::proc_CopyOut(atf_exp::FProc &row, atf_exp::Proc &out) { + out.proc = row.proc; +} + +// --- atf_exp.FProc.base.CopyIn +// Copy fields in to row +void atf_exp::proc_CopyIn(atf_exp::FProc &row, atf_exp::Proc &in) { + row.proc = in.proc; +} + +// --- atf_exp.FProc.in.BeginRead +// Attach fbuf to Iohook for reading +// Attach file descriptor and begin reading using edge-triggered epoll. +// File descriptor becomes owned by atf_exp::FProc.in via FIohook field. +// Whenever the file descriptor becomes readable, insert proc into cd_proc_read. +void atf_exp::in_BeginRead(atf_exp::FProc& proc, algo::Fildes fd) { + proc.in_iohook.fildes = fd; + callback_Set1(proc.in_iohook, proc, atf_exp::cd_proc_read_Insert); + IOEvtFlags flags; + read_Set(flags, true); + if (proc.in_epoll_enable) { + algo_lib::IohookAdd(proc.in_iohook, flags); + } else { + atf_exp::cd_proc_read_Insert(proc); + } +} + +// --- atf_exp.FProc.in.EndRead +// Set EOF flag +void atf_exp::in_EndRead(atf_exp::FProc& proc) { + if (ValidQ(proc.in_iohook.fildes)) { + proc.in_eof = true; + atf_exp::cd_proc_read_Insert(proc); + } +} + +// --- atf_exp.FProc.in.GetMsg +// Detect incoming message in buffer and return it +// Look for valid message at current position in the buffer. +// If message is already there, return a pointer to it. Do not skip message (call SkipMsg to do that). +// If there is no message, read once from underlying file descriptor and try again. +// The message is found by looking for delimiter '\n'. +// The return value is an aryptr. If ret.elems is non-NULL, the message is valid (possibly empty). +// If ret.elems is NULL, no message can be extracted from buffer. +// The returned aryptr excludes the trailing deliminter. +// SkipMsg will skip both the line and the deliminter. +// A partial line at the end of input is NOT returned (TODO?) +// +algo::aryptr atf_exp::in_GetMsg(atf_exp::FProc& proc) { + algo::aryptr ret; + if (!proc.in_msgvalid) { + in_ScanMsg(proc); + if (!proc.in_msgvalid) { + bool readable = in_Refill(proc); + if (readable) { + in_ScanMsg(proc); + } + } + } + char *hdr = (char*)(proc.in_elems + proc.in_start); + if (proc.in_msgvalid) { + ret.elems = hdr; + ret.n_elems = proc.in_msglen; + } + return ret; +} + +// --- atf_exp.FProc.in.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void atf_exp::in_Realloc(atf_exp::FProc& proc, int new_max) { + new_max = i32_Max(new_max, proc.in_end); + u8 *new_mem = proc.in_elems + ? (u8*)algo_lib::malloc_ReallocMem(proc.in_elems, proc.in_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_exp.fbuf_nomem field:atf_exp.FProc.in comment:'out of memory'"); + } + proc.in_elems = new_mem; + proc.in_max = new_max; +} + +// --- atf_exp.FProc.in.Refill +// Refill buffer. Return false if no further refill possible (input buffer exhausted) +bool atf_exp::in_Refill(atf_exp::FProc& proc) { + bool readable = ValidQ(proc.in_iohook.fildes); + if (readable) { + int fd = proc.in_iohook.fildes.value; + i32 max = in_Max(proc); + i32 end = proc.in_end; + i32 nbytes = end - proc.in_start; // # bytes currently in buffer + i32 nfree = max - end; // bytes available at the end of buffer + if (nbytes == 0 || nfree == 0) { // make more room for reading (or take advantage of free shift) + in_Shift(proc); + end = proc.in_end; + nfree = max - end; + } + ssize_t ret = read(fd, proc.in_elems + end, nfree); + readable = !(ret < 0 && errno == EAGAIN); + bool error = ret < 0 && errno != EAGAIN; // detect permanent error on this fd + bool eof = error || (ret == 0 && nfree > 0); + proc.in_end += i32_Max(ret,0); // new end of bytes + if (error) { + proc.in_err = algo::FromErrno(errno); // fetch errno + } + proc.in_eof |= eof; + } + if (!readable && proc.in_epoll_enable) { + atf_exp::cd_proc_read_Remove(proc); + } + return readable; +} + +// --- atf_exp.FProc.in.RemoveAll +// Empty bfufer +// Discard contents of the buffer. +void atf_exp::in_RemoveAll(atf_exp::FProc& proc) { + proc.in_start = 0; + proc.in_end = 0; + proc.in_msgvalid = false; +} + +// --- atf_exp.FProc.in.ScanMsg +// Internal function to scan for a message +// +static void atf_exp::in_ScanMsg(atf_exp::FProc& proc) { + char *hdr = (char*)(proc.in_elems + proc.in_start); + i32 avail = in_N(proc); + i32 msglen; + bool found = false; + // scan for delimiter starting from the previous place where we left off. + // at the end, save offset back to proc so we don't have to re-scan. + // returned message length **does not include delimiter**. + // a line that exceeds buffer length is not returned. + for (msglen = proc.in_msglen; msglen < avail; msglen += sizeof(char)) { + if (hdr[msglen] == '\n') { // delimiter? + found = true; + break; + } + } + if (!found && msglen >= in_Max(proc)) { + proc.in_eof = true; // cause user to detect eof + proc.in_err = algo::FromErrno(E2BIG); // argument list too big -- closest error code + } + proc.in_msglen = msglen; + proc.in_msgvalid = found; +} + +// --- atf_exp.FProc.in.Shift +// Internal function to shift data left +// Shift existing bytes over to the beginning of the buffer +static void atf_exp::in_Shift(atf_exp::FProc& proc) { + i32 start = proc.in_start; + i32 bytes_n = proc.in_end - start; + if (bytes_n > 0) { + memmove(proc.in_elems, proc.in_elems + start, bytes_n); + } + proc.in_end = bytes_n; + proc.in_start = 0; +} + +// --- atf_exp.FProc.in.SkipBytes +// Skip N bytes when reading +// Mark some buffer contents as read. +// +void atf_exp::in_SkipBytes(atf_exp::FProc& proc, int n) { + int avail = proc.in_end - proc.in_start; + n = i32_Min(n,avail); + proc.in_start += n; + proc.in_msgvalid = false; +} + +// --- atf_exp.FProc.in.SkipMsg +// Skip current message, if any +// Skip current message, if any. +void atf_exp::in_SkipMsg(atf_exp::FProc& proc) { + if (proc.in_msgvalid) { + int skip = proc.in_msglen; + skip += ssizeof(char); // delimiter + i32 start = proc.in_start; + start += skip; + proc.in_start = start; + proc.in_msgvalid = false; + proc.in_msglen = 0; // reset message length -- important for delimited streams + } +} + +// --- atf_exp.FProc.in.WriteAll +// Attempt to write buffer contents to fbuf, return success +// Write bytes to the buffer. If the entire block is written, return true, +// Otherwise return false. +// Bytes in the buffer are potentially shifted left to make room for the message. +// +bool atf_exp::in_WriteAll(atf_exp::FProc& proc, u8 *in, i32 in_n) { + int max = in_Max(proc); + // check if message doesn't fit. if so, shift bytes over. + if (proc.in_end + in_n > max) { + in_Shift(proc); + } + // now try to write the message. + i32 end = proc.in_end; + bool fits = end + in_n <= max; + if (fits) { + if (in_n > 0) { + memcpy(proc.in_elems + end, in, in_n); + proc.in_end = end + in_n; + } + } + return fits; +} + +// --- atf_exp.FProc.in.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void atf_exp::in_WriteReserve(atf_exp::FProc& proc, u8 *in, i32 in_n) { + if (!in_WriteAll(proc, in, in_n)) { + in_Realloc(proc, proc.in_max*2); + if (!in_WriteAll(proc, in, in_n)) { + FatalErrorExit("in: out of memory"); + } + } +} + +// --- atf_exp.FProc.out.EndWrite +// Send zero-byte write +void atf_exp::out_EndWrite(atf_exp::FProc& proc) { + if (ValidQ(proc.out_iohook.fildes)) { + // zero-byte write for remote side + ssize_t rc=write(proc.out_iohook.fildes.value, "", 0); + (void)rc; + } +} + +// --- atf_exp.FProc.out.BeginWrite +// Attach fbuf to Iohook for writing +// Attach file descriptor and begin outflowing buffer reading using edge-triggered epoll. +// Whenever buffer is non-empty and fd is writable, insert proc into cd_proc_outflow. +// User should implement a step function that calls out_Outflow. +void atf_exp::out_BeginWrite(atf_exp::FProc& proc, algo::Fildes fd, bool nodelete) { + callback_Set1(proc.out_iohook, proc, atf_exp::cd_proc_outflow_Insert); + if (nodelete) { + proc.out_epoll_enable = false; // cannot register fd twice -- disable epoll on shared fd + proc.out_iohook.nodelete = true; + } + proc.out_iohook.fildes = fd; + IOEvtFlags flags; + write_Set(flags, true); + if (proc.out_epoll_enable) { + algo_lib::IohookAdd(proc.out_iohook, flags); + } +} + +// --- atf_exp.FProc.out.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void atf_exp::out_Realloc(atf_exp::FProc& proc, int new_max) { + new_max = i32_Max(new_max, proc.out_end); + u8 *new_mem = proc.out_elems + ? (u8*)algo_lib::malloc_ReallocMem(proc.out_elems, proc.out_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("atf_exp.fbuf_nomem field:atf_exp.FProc.out comment:'out of memory'"); + } + proc.out_elems = new_mem; + proc.out_max = new_max; +} + +// --- atf_exp.FProc.out.Outflow +// Transfer bytes from buffer to fd using write() +// Once all bytes are written or when fd buffer is full, buffer is automatically removed from cd_proc_outflow list. +// Edge-triggered epoll will re-insert out into cd_proc_outflow. +bool atf_exp::out_Outflow(atf_exp::FProc& proc) { + int nwrite = out_N(proc); + int start = proc.out_start; + int nwritten; + nwritten = nwrite > 0 ? write(proc.out_iohook.fildes.value, proc.out_elems + start, nwrite) : 0; + bool good = nwritten >= 0 || errno == EAGAIN; + if (!good) { + proc.out_err = algo::FromErrno(errno); // save error code + } + if (nwritten > 0) { + out_SkipBytes(proc,nwritten); // skip written bytes + } + bool done = out_N(proc)==0; + if (proc.out_epoll_enable) { + done |= nwritten<0; + } + if (done) { + atf_exp::cd_proc_outflow_Remove(proc); // done writing + } + return nwritten > 0; +} + +// --- atf_exp.FProc.out.RemoveAll +// Empty bfufer +// Discard contents of the buffer. +void atf_exp::out_RemoveAll(atf_exp::FProc& proc) { + proc.out_start = 0; + proc.out_end = 0; + proc.out_msgvalid = false; +} + +// --- atf_exp.FProc.out.Shift +// Internal function to shift data left +// Shift existing bytes over to the beginning of the buffer +static void atf_exp::out_Shift(atf_exp::FProc& proc) { + i32 start = proc.out_start; + i32 bytes_n = proc.out_end - start; + if (bytes_n > 0) { + memmove(proc.out_elems, proc.out_elems + start, bytes_n); + } + proc.out_end = bytes_n; + proc.out_start = 0; +} + +// --- atf_exp.FProc.out.SkipBytes +// Skip N bytes when reading +// Mark some buffer contents as read. +// +void atf_exp::out_SkipBytes(atf_exp::FProc& proc, int n) { + int avail = proc.out_end - proc.out_start; + n = i32_Min(n,avail); + proc.out_start += n; + proc.out_msgvalid = false; +} + +// --- atf_exp.FProc.out.SkipMsg +// Skip current message, if any +// Skip current message, if any. +void atf_exp::out_SkipMsg(atf_exp::FProc& proc) { + if (proc.out_msgvalid) { + int skip = proc.out_msglen; + skip += ssizeof(char); // delimiter + i32 start = proc.out_start; + start += skip; + proc.out_start = start; + proc.out_msgvalid = false; + proc.out_msglen = 0; // reset message length -- important for delimited streams + } +} + +// --- atf_exp.FProc.out.WriteAll +// Attempt to write buffer contents to fbuf, return success +// Write bytes to the buffer. If the entire block is written, return true, +// Otherwise return false. +// Bytes in the buffer are potentially shifted left to make room for the message. +// +bool atf_exp::out_WriteAll(atf_exp::FProc& proc, u8 *in, i32 in_n) { + int max = out_Max(proc); + // check if message doesn't fit. if so, shift bytes over. + if (proc.out_end + in_n > max) { + out_Shift(proc); + } + // now try to write the message. + i32 end = proc.out_end; + bool fits = end + in_n <= max; + if (fits) { + if (proc.out_zerocopy && out_N(proc)==0) {// in kernel bypass situations this is faster + int rc = write(proc.out_iohook.fildes.value, in, in_n); + if (rc >= 0) { + in += rc; + in_n -= rc; + } + } + if (in_n > 0) { + memcpy(proc.out_elems + end, in, in_n); + proc.out_end = end + in_n; + cd_proc_outflow_Insert(proc); // schedule outflow + } + } + return fits; +} + +// --- atf_exp.FProc.out.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void atf_exp::out_WriteReserve(atf_exp::FProc& proc, u8 *in, i32 in_n) { + if (!out_WriteAll(proc, in, in_n)) { + out_Realloc(proc, proc.out_max*2); + if (!out_WriteAll(proc, in, in_n)) { + FatalErrorExit("out: out of memory"); + } + } +} + +// --- atf_exp.FProc..Init +// Set all fields to initial values. +void atf_exp::FProc_Init(atf_exp::FProc& proc) { + proc.in_elems = NULL; // in: initialize + proc.in_max = 0; // in: initialize + proc.in_end = 0; // in: initialize + proc.in_start = 0; // in: initialize + proc.in_eof = false; // in: initialize + proc.in_msgvalid = false; // in: initialize + proc.in_msglen = 0; // in: initialize + proc.in_epoll_enable = true; // in: initialize + in_Realloc(proc, 1048576); + proc.out_elems = NULL; // out: initialize + proc.out_max = 0; // out: initialize + proc.out_end = 0; // out: initialize + proc.out_start = 0; // out: initialize + proc.out_eof = false; // out: initialize + proc.out_zerocopy = false; // out: initialize + proc.out_n_eagain = 0; // out: initialize + proc.out_msgvalid = false; // out: initialize + proc.out_msglen = 0; // out: initialize + proc.out_epoll_enable = true; // out: initialize + out_Realloc(proc, 1048576); + proc.pid = i32(0); + proc.out_delay_close = bool(false); + proc.wait = bool(false); + proc.proc_next = (atf_exp::FProc*)-1; // (atf_exp.FDb.proc) not-in-tpool's freelist + proc.ind_proc_next = (atf_exp::FProc*)-1; // (atf_exp.FDb.ind_proc) not-in-hash + proc.ind_proc_hashval = 0; // stored hash value + proc.zd_proc_next = (atf_exp::FProc*)-1; // (atf_exp.FDb.zd_proc) not-in-list + proc.zd_proc_prev = NULL; // (atf_exp.FDb.zd_proc) + proc.cd_proc_read_next = (atf_exp::FProc*)-1; // (atf_exp.FDb.cd_proc_read) not-in-list + proc.cd_proc_read_prev = NULL; // (atf_exp.FDb.cd_proc_read) + proc.cd_proc_outflow_next = (atf_exp::FProc*)-1; // (atf_exp.FDb.cd_proc_outflow) not-in-list + proc.cd_proc_outflow_prev = NULL; // (atf_exp.FDb.cd_proc_outflow) + proc.ind_proc_pid_next = (atf_exp::FProc*)-1; // (atf_exp.FDb.ind_proc_pid) not-in-hash + proc.ind_proc_pid_hashval = 0; // stored hash value +} + +// --- atf_exp.FProc..Uninit +void atf_exp::FProc_Uninit(atf_exp::FProc& proc) { + atf_exp::FProc &row = proc; (void)row; + ind_proc_Remove(row); // remove proc from index ind_proc + zd_proc_Remove(row); // remove proc from index zd_proc + cd_proc_read_Remove(row); // remove proc from index cd_proc_read + cd_proc_outflow_Remove(row); // remove proc from index cd_proc_outflow + ind_proc_pid_Remove(row); // remove proc from index ind_proc_pid + c_proc_read_Remove(row); // remove proc from index c_proc_read + + // atf_exp.FProc.out.Uninit (Fbuf) // + if (proc.out_elems) { + algo_lib::malloc_FreeMem(proc.out_elems, sizeof(char)*proc.out_max); // (atf_exp.FProc.out) + } + proc.out_elems = NULL; + proc.out_max = 0; + + // atf_exp.FProc.in.Uninit (Fbuf) // + if (proc.in_elems) { + algo_lib::malloc_FreeMem(proc.in_elems, sizeof(char)*proc.in_max); // (atf_exp.FProc.in) + } + proc.in_elems = NULL; + proc.in_max = 0; +} + +// --- atf_exp.FieldId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* atf_exp::value_ToCstr(const atf_exp::FieldId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case atf_exp_FieldId_value : ret = "value"; break; + } + return ret; +} + +// --- atf_exp.FieldId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void atf_exp::value_Print(const atf_exp::FieldId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- atf_exp.FieldId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool atf_exp::value_SetStrptrMaybe(atf_exp::FieldId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,atf_exp_FieldId_value); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- atf_exp.FieldId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void atf_exp::value_SetStrptr(atf_exp::FieldId& parent, algo::strptr rhs, atf_exp_FieldIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- atf_exp.FieldId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_exp::value_ReadStrptrMaybe(atf_exp::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- atf_exp.FieldId..ReadStrptrMaybe +// Read fields of atf_exp::FieldId from an ascii string. +// The format of the string is the format of the atf_exp::FieldId's only field +bool atf_exp::FieldId_ReadStrptrMaybe(atf_exp::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- atf_exp.FieldId..Print +// print string representation of ROW to string STR +// cfmt:atf_exp.FieldId.String printfmt:Raw +void atf_exp::FieldId_Print(atf_exp::FieldId& row, algo::cstring& str) { + atf_exp::value_Print(row, str); +} + +// --- atf_exp.InCase.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* atf_exp::value_ToCstr(const atf_exp::InCase& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case atf_exp_InCase_ams_ProcEofMsg : ret = "ams.ProcEofMsg"; break; + case atf_exp_InCase_ams_ProcKillMsg: ret = "ams.ProcKillMsg"; break; + case atf_exp_InCase_ams_ProcMsg : ret = "ams.ProcMsg"; break; + case atf_exp_InCase_ams_ProcReadMsg: ret = "ams.ProcReadMsg"; break; + case atf_exp_InCase_ams_ProcStartMsg: ret = "ams.ProcStartMsg"; break; + case atf_exp_InCase_ams_RemDirRecurseMsg: ret = "ams.RemDirRecurseMsg"; break; + case atf_exp_InCase_ams_TerminateMsg: ret = "ams.TerminateMsg"; break; + } + return ret; +} + +// --- atf_exp.InCase.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void atf_exp::value_Print(const atf_exp::InCase& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- atf_exp.InCase.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool atf_exp::value_SetStrptrMaybe(atf_exp::InCase& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 11: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"Msg",3)==0) { value_SetEnum(parent,atf_exp_InCase_ams_ProcMsg); ret = true; break; } + break; + } + } + break; + } + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"EofMsg",6)==0) { value_SetEnum(parent,atf_exp_InCase_ams_ProcEofMsg); ret = true; break; } + break; + } + } + break; + } + case 15: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"KillMsg",7)==0) { value_SetEnum(parent,atf_exp_InCase_ams_ProcKillMsg); ret = true; break; } + if (memcmp(rhs.elems+8,"ReadMsg",7)==0) { value_SetEnum(parent,atf_exp_InCase_ams_ProcReadMsg); ret = true; break; } + break; + } + } + break; + } + case 16: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','m','s','.','P','r','o','c'): { + if (memcmp(rhs.elems+8,"StartMsg",8)==0) { value_SetEnum(parent,atf_exp_InCase_ams_ProcStartMsg); ret = true; break; } + break; + } + case LE_STR8('a','m','s','.','T','e','r','m'): { + if (memcmp(rhs.elems+8,"inateMsg",8)==0) { value_SetEnum(parent,atf_exp_InCase_ams_TerminateMsg); ret = true; break; } + break; + } + } + break; + } + case 20: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','m','s','.','R','e','m','D'): { + if (memcmp(rhs.elems+8,"irRecurseMsg",12)==0) { value_SetEnum(parent,atf_exp_InCase_ams_RemDirRecurseMsg); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- atf_exp.InCase.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void atf_exp::value_SetStrptr(atf_exp::InCase& parent, algo::strptr rhs, atf_exp_InCaseEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- atf_exp.InCase.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool atf_exp::value_ReadStrptrMaybe(atf_exp::InCase& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- atf_exp.InCase..ReadStrptrMaybe +// Read fields of atf_exp::InCase from an ascii string. +// The format of the string is the format of the atf_exp::InCase's only field +bool atf_exp::InCase_ReadStrptrMaybe(atf_exp::InCase &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- atf_exp...SizeCheck +inline static void atf_exp::SizeCheck() { +} + +// --- atf_exp...StaticCheck +void atf_exp::StaticCheck() { + algo_assert(_offset_of(atf_exp::trace, dispatch_In_Unkmsg_cycles) + sizeof(((atf_exp::trace*)0)->dispatch_In_Unkmsg_cycles) == sizeof(atf_exp::trace)); + algo_assert(_offset_of(atf_exp::FieldId, value) + sizeof(((atf_exp::FieldId*)0)->value) == sizeof(atf_exp::FieldId)); + algo_assert(_offset_of(atf_exp::InCase, value) + sizeof(((atf_exp::InCase*)0)->value) == sizeof(atf_exp::InCase)); +} + +// --- atf_exp.In.ProcEofMsg.UpdateCycles +void atf_exp::In_ProcEofMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + atf_exp::_db.trace.dispatch_In_ProcEofMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.In.ProcKillMsg.UpdateCycles +void atf_exp::In_ProcKillMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + atf_exp::_db.trace.dispatch_In_ProcKillMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.In.ProcMsg.UpdateCycles +void atf_exp::In_ProcMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + atf_exp::_db.trace.dispatch_In_ProcMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.In.ProcReadMsg.UpdateCycles +void atf_exp::In_ProcReadMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + atf_exp::_db.trace.dispatch_In_ProcReadMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.In.ProcStartMsg.UpdateCycles +void atf_exp::In_ProcStartMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + atf_exp::_db.trace.dispatch_In_ProcStartMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.In.RemDirRecurseMsg.UpdateCycles +void atf_exp::In_RemDirRecurseMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + atf_exp::_db.trace.dispatch_In_RemDirRecurseMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.In.TerminateMsg.UpdateCycles +void atf_exp::In_TerminateMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + atf_exp::_db.trace.dispatch_In_TerminateMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- atf_exp.In..DispatchRaw +int atf_exp::InDispatchRaw(atf_exp::InCase type, u8 *msg, u32 len) { + int ret = 0; + switch(type) { + case 703: if (sizeof(ams::ProcEofMsg) <= len) { + ++atf_exp::_db.trace.dispatch_In_ProcEofMsg; + atf_exp::In_ProcEofMsg((ams::ProcEofMsg&)*msg); + atf_exp::In_ProcEofMsg_UpdateCycles(); + ret = (int)sizeof(ams::ProcEofMsg); + } break; + case 704: if (sizeof(ams::ProcKillMsg) <= len) { + ++atf_exp::_db.trace.dispatch_In_ProcKillMsg; + atf_exp::In_ProcKillMsg((ams::ProcKillMsg&)*msg); + atf_exp::In_ProcKillMsg_UpdateCycles(); + ret = (int)sizeof(ams::ProcKillMsg); + } break; + case 701: if (sizeof(ams::ProcMsg) <= len) { + ++atf_exp::_db.trace.dispatch_In_ProcMsg; + atf_exp::In_ProcMsg((ams::ProcMsg&)*msg); + atf_exp::In_ProcMsg_UpdateCycles(); + ret = (int)sizeof(ams::ProcMsg); + } break; + case 702: if (sizeof(ams::ProcReadMsg) <= len) { + ++atf_exp::_db.trace.dispatch_In_ProcReadMsg; + atf_exp::In_ProcReadMsg((ams::ProcReadMsg&)*msg); + atf_exp::In_ProcReadMsg_UpdateCycles(); + ret = (int)sizeof(ams::ProcReadMsg); + } break; + case 700: if (sizeof(ams::ProcStartMsg) <= len) { + ++atf_exp::_db.trace.dispatch_In_ProcStartMsg; + atf_exp::In_ProcStartMsg((ams::ProcStartMsg&)*msg); + atf_exp::In_ProcStartMsg_UpdateCycles(); + ret = (int)sizeof(ams::ProcStartMsg); + } break; + case 633: if (sizeof(ams::RemDirRecurseMsg) <= len) { + ++atf_exp::_db.trace.dispatch_In_RemDirRecurseMsg; + atf_exp::In_RemDirRecurseMsg((ams::RemDirRecurseMsg&)*msg); + atf_exp::In_RemDirRecurseMsg_UpdateCycles(); + ret = (int)sizeof(ams::RemDirRecurseMsg); + } break; + case 352: if (sizeof(ams::TerminateMsg) <= len) { + ++atf_exp::_db.trace.dispatch_In_TerminateMsg; + atf_exp::In_TerminateMsg((ams::TerminateMsg&)*msg); + atf_exp::In_TerminateMsg_UpdateCycles(); + ret = (int)sizeof(ams::TerminateMsg); + } break; + default: + ++atf_exp::_db.trace.dispatch_In_Unkmsg; + break; + } + return ret; +} + +// --- atf_exp.In..Dispatch +int atf_exp::InDispatch(ams::MsgHeader& msg) { + return InDispatchRaw(atf_exp::InCase(msg.type), (u8*)&msg, i32(msg.length)); +} + +// --- atf_exp.In..Dispatch2 +// void rettype useful for hooks +void atf_exp::vInDispatch(ams::MsgHeader& msg) { + InDispatch(msg); +} + +// --- atf_exp...ProcMsg_FmtAppend +// Construct a new ams::ProcMsg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +ams::ProcMsg * atf_exp::ProcMsg_FmtAppend(algo::ByteAry &buf, const algo::strptr& proc, algo::aryptr payload) { + ams::ProcMsg *msg = NULL; + size_t len = sizeof(ams::ProcMsg); + u32 payload_ary_len = elems_N(payload) * sizeof(char); + len += payload_ary_len; + msg = (ams::ProcMsg*)ary_AllocN(buf,len).elems; + msg->type = u32(701); + msg->length = u32(len + (0)); + msg->proc = proc; + memcpy(payload_Addr(*msg), payload.elems, payload_ary_len); + return msg; +} + +// --- atf_exp...ProcStatusMsg_FmtAppend +// Construct a new ams::ProcStatusMsg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +ams::ProcStatusMsg * atf_exp::ProcStatusMsg_FmtAppend(algo::ByteAry &buf, const algo::strptr& proc, const algo::strptr& status) { + ams::ProcStatusMsg *msg = NULL; + size_t len = sizeof(ams::ProcStatusMsg); + msg = (ams::ProcStatusMsg*)ary_AllocN(buf,len).elems; + msg->type = u32(705); + msg->length = u32(len + (0)); + msg->proc = proc; + msg->status = status; + return msg; +} + +// --- atf_exp...main +int main(int argc, char **argv) { + try { + lib_json::FDb_Init(); + algo_lib::FDb_Init(); + atf_exp::FDb_Init(); + algo_lib::_db.argc = argc; + algo_lib::_db.argv = argv; + algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock + atf_exp::ReadArgv(); // dmmeta.main:atf_exp + atf_exp::Main(); // user-defined main + } catch(algo_lib::ErrorX &x) { + prerr("atf_exp.error " << x); // there may be additional hints in DetachBadTags + algo_lib::_db.exit_code = 1; + } + if (algo_lib::_db.last_signal) { + algo_lib::_db.exit_code = 1; + } + try { + atf_exp::FDb_Uninit(); + algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); + } catch(algo_lib::ErrorX &) { + // don't print anything, might crash + algo_lib::_db.exit_code = 1; + } + // only the lower 1 byte makes it to the outside world + (void)i32_UpdateMin(algo_lib::_db.exit_code,255); + return algo_lib::_db.exit_code; +} + +// --- atf_exp...WinMain +#if defined(WIN32) +int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int) { + return main(__argc,__argv); +} +#endif diff --git a/cpp/gen/atf_fuzz_gen.cpp b/cpp/gen/atf_fuzz_gen.cpp index 763f9f6a..7c27f78b 100644 --- a/cpp/gen/atf_fuzz_gen.cpp +++ b/cpp/gen/atf_fuzz_gen.cpp @@ -33,18 +33,18 @@ #include "include/gen/algo_gen.inl.h" #include "include/gen/dev_gen.h" #include "include/gen/dev_gen.inl.h" -#include "include/gen/algo_lib_gen.h" -#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_json_gen.h" #include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order -algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_json::FDb lib_json::_db; // dependency found via dev.targdep +algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep atf_fuzz::FDb atf_fuzz::_db; // dependency found via dev.targdep namespace atf_fuzz { @@ -60,8 +60,8 @@ const char *atf_fuzz_help = " -in string \"data\" Input directory or filename, - for stdin\n" " -seed int 0 Random seed\n" " -testprob double 1 Run each case with this probability\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -182,9 +182,8 @@ void atf_fuzz::ReadArgv() { } if (ch_N(attrname) == 0) { err << "atf_fuzz: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:atf_fuzz.FDb.cmdline @@ -238,7 +240,7 @@ void atf_fuzz::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -321,8 +323,8 @@ bool atf_fuzz::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && atf_fuzz::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); retval = retval && atf_fuzz::LoadTuplesFile(algo::SsimFname(root,"dev.target"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -613,14 +615,9 @@ bool atf_fuzz::target_XrefMaybe(atf_fuzz::FTarget &row) { // Find row by key. Return NULL if not found. atf_fuzz::FTarget* atf_fuzz::ind_target_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_target_buckets_n - 1); - atf_fuzz::FTarget* *e = &_db.ind_target_buckets_elems[index]; - atf_fuzz::FTarget* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).target == key; - if (done) break; - e = &ret->ind_target_next; - } while (true); + atf_fuzz::FTarget *ret = _db.ind_target_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_target_next) { + } return ret; } @@ -652,10 +649,11 @@ atf_fuzz::FTarget& atf_fuzz::ind_target_GetOrCreate(const algo::strptr& key) { // --- atf_fuzz.FDb.ind_target.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_fuzz::ind_target_InsertMaybe(atf_fuzz::FTarget& row) { - ind_target_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_target_next == (atf_fuzz::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + row.ind_target_hashval = algo::Smallstr16_Hash(0, row.target); + ind_target_Reserve(1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); atf_fuzz::FTarget* *prev = &_db.ind_target_buckets_elems[index]; do { atf_fuzz::FTarget* ret = *prev; @@ -681,7 +679,7 @@ bool atf_fuzz::ind_target_InsertMaybe(atf_fuzz::FTarget& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_fuzz::ind_target_Remove(atf_fuzz::FTarget& row) { if (LIKELY(row.ind_target_next != (atf_fuzz::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); atf_fuzz::FTarget* *prev = &_db.ind_target_buckets_elems[index]; // addr of pointer to current element while (atf_fuzz::FTarget *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -698,8 +696,14 @@ void atf_fuzz::ind_target_Remove(atf_fuzz::FTarget& row) { // --- atf_fuzz.FDb.ind_target.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_fuzz::ind_target_Reserve(int n) { + ind_target_AbsReserve(_db.ind_target_n + n); +} + +// --- atf_fuzz.FDb.ind_target.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_fuzz::ind_target_AbsReserve(int n) { u32 old_nbuckets = _db.ind_target_buckets_n; - u32 new_nelems = _db.ind_target_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -718,7 +722,7 @@ void atf_fuzz::ind_target_Reserve(int n) { while (elem) { atf_fuzz::FTarget &row = *elem; atf_fuzz::FTarget* next = row.ind_target_next; - u32 index = algo::Smallstr16_Hash(0, row.target) & (new_nbuckets-1); + u32 index = row.ind_target_hashval & (new_nbuckets-1); row.ind_target_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -998,12 +1002,13 @@ void atf_fuzz::StaticCheck() { // --- atf_fuzz...main int main(int argc, char **argv) { try { - algo_lib::FDb_Init(); lib_json::FDb_Init(); + algo_lib::FDb_Init(); atf_fuzz::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock atf_fuzz::ReadArgv(); // dmmeta.main:atf_fuzz atf_fuzz::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -1015,8 +1020,8 @@ int main(int argc, char **argv) { } try { atf_fuzz::FDb_Uninit(); - lib_json::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/atf_gcli_gen.cpp b/cpp/gen/atf_gcli_gen.cpp index c7989edb..d69e2373 100644 --- a/cpp/gen/atf_gcli_gen.cpp +++ b/cpp/gen/atf_gcli_gen.cpp @@ -41,8 +41,8 @@ // Instantiate all libraries linked into this executable, // in dependency order -algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_json::FDb lib_json::_db; // dependency found via dev.targdep +algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep atf_gcli::FDb atf_gcli::_db; // dependency found via dev.targdep namespace atf_gcli { @@ -59,8 +59,8 @@ const char *atf_gcli_help = " -skip_init Skip setting local files - already set\n" " -skip_git_init Skip setting local files - already set\n" " -dry_run Print actions, do not perform\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -170,9 +170,8 @@ void atf_gcli::ReadArgv() { } if (ch_N(attrname) == 0) { err << "atf_gcli: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:atf_gcli.FDb.cmdline @@ -226,7 +228,7 @@ void atf_gcli::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -337,8 +339,8 @@ bool atf_gcli::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && atf_gcli::LoadTuplesFile(algo::SsimFname(root,"gclidb.gclienvsub"),recursive); retval = retval && atf_gcli::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -651,14 +653,9 @@ bool atf_gcli::gtblacttstout_XrefMaybe(atf_gcli::FGtblacttstout &row) { // Find row by key. Return NULL if not found. atf_gcli::FGtblacttst* atf_gcli::ind_gtblacttst_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_gtblacttst_buckets_n - 1); - atf_gcli::FGtblacttst* *e = &_db.ind_gtblacttst_buckets_elems[index]; - atf_gcli::FGtblacttst* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gtblacttst == key; - if (done) break; - e = &ret->ind_gtblacttst_next; - } while (true); + atf_gcli::FGtblacttst *ret = _db.ind_gtblacttst_buckets_elems[index]; + for (; ret && !((*ret).gtblacttst == key); ret = ret->ind_gtblacttst_next) { + } return ret; } @@ -673,10 +670,11 @@ atf_gcli::FGtblacttst& atf_gcli::ind_gtblacttst_FindX(const algo::strptr& key) { // --- atf_gcli.FDb.ind_gtblacttst.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_gcli::ind_gtblacttst_InsertMaybe(atf_gcli::FGtblacttst& row) { - ind_gtblacttst_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gtblacttst_next == (atf_gcli::FGtblacttst*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gtblacttst) & (_db.ind_gtblacttst_buckets_n - 1); + row.ind_gtblacttst_hashval = algo::Smallstr250_Hash(0, row.gtblacttst); + ind_gtblacttst_Reserve(1); + u32 index = row.ind_gtblacttst_hashval & (_db.ind_gtblacttst_buckets_n - 1); atf_gcli::FGtblacttst* *prev = &_db.ind_gtblacttst_buckets_elems[index]; do { atf_gcli::FGtblacttst* ret = *prev; @@ -702,7 +700,7 @@ bool atf_gcli::ind_gtblacttst_InsertMaybe(atf_gcli::FGtblacttst& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_gcli::ind_gtblacttst_Remove(atf_gcli::FGtblacttst& row) { if (LIKELY(row.ind_gtblacttst_next != (atf_gcli::FGtblacttst*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gtblacttst) & (_db.ind_gtblacttst_buckets_n - 1); + u32 index = row.ind_gtblacttst_hashval & (_db.ind_gtblacttst_buckets_n - 1); atf_gcli::FGtblacttst* *prev = &_db.ind_gtblacttst_buckets_elems[index]; // addr of pointer to current element while (atf_gcli::FGtblacttst *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -719,8 +717,14 @@ void atf_gcli::ind_gtblacttst_Remove(atf_gcli::FGtblacttst& row) { // --- atf_gcli.FDb.ind_gtblacttst.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_gcli::ind_gtblacttst_Reserve(int n) { + ind_gtblacttst_AbsReserve(_db.ind_gtblacttst_n + n); +} + +// --- atf_gcli.FDb.ind_gtblacttst.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_gcli::ind_gtblacttst_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gtblacttst_buckets_n; - u32 new_nelems = _db.ind_gtblacttst_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -739,7 +743,7 @@ void atf_gcli::ind_gtblacttst_Reserve(int n) { while (elem) { atf_gcli::FGtblacttst &row = *elem; atf_gcli::FGtblacttst* next = row.ind_gtblacttst_next; - u32 index = algo::Smallstr250_Hash(0, row.gtblacttst) & (new_nbuckets-1); + u32 index = row.ind_gtblacttst_hashval & (new_nbuckets-1); row.ind_gtblacttst_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -756,14 +760,9 @@ void atf_gcli::ind_gtblacttst_Reserve(int n) { // Find row by key. Return NULL if not found. atf_gcli::FGtblacttstout* atf_gcli::ind_gtblacttstout_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_gtblacttstout_buckets_n - 1); - atf_gcli::FGtblacttstout* *e = &_db.ind_gtblacttstout_buckets_elems[index]; - atf_gcli::FGtblacttstout* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gtblacttstout == key; - if (done) break; - e = &ret->ind_gtblacttstout_next; - } while (true); + atf_gcli::FGtblacttstout *ret = _db.ind_gtblacttstout_buckets_elems[index]; + for (; ret && !((*ret).gtblacttstout == key); ret = ret->ind_gtblacttstout_next) { + } return ret; } @@ -778,10 +777,11 @@ atf_gcli::FGtblacttstout& atf_gcli::ind_gtblacttstout_FindX(const algo::strptr& // --- atf_gcli.FDb.ind_gtblacttstout.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_gcli::ind_gtblacttstout_InsertMaybe(atf_gcli::FGtblacttstout& row) { - ind_gtblacttstout_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gtblacttstout_next == (atf_gcli::FGtblacttstout*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gtblacttstout) & (_db.ind_gtblacttstout_buckets_n - 1); + row.ind_gtblacttstout_hashval = algo::Smallstr250_Hash(0, row.gtblacttstout); + ind_gtblacttstout_Reserve(1); + u32 index = row.ind_gtblacttstout_hashval & (_db.ind_gtblacttstout_buckets_n - 1); atf_gcli::FGtblacttstout* *prev = &_db.ind_gtblacttstout_buckets_elems[index]; do { atf_gcli::FGtblacttstout* ret = *prev; @@ -807,7 +807,7 @@ bool atf_gcli::ind_gtblacttstout_InsertMaybe(atf_gcli::FGtblacttstout& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_gcli::ind_gtblacttstout_Remove(atf_gcli::FGtblacttstout& row) { if (LIKELY(row.ind_gtblacttstout_next != (atf_gcli::FGtblacttstout*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gtblacttstout) & (_db.ind_gtblacttstout_buckets_n - 1); + u32 index = row.ind_gtblacttstout_hashval & (_db.ind_gtblacttstout_buckets_n - 1); atf_gcli::FGtblacttstout* *prev = &_db.ind_gtblacttstout_buckets_elems[index]; // addr of pointer to current element while (atf_gcli::FGtblacttstout *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -824,8 +824,14 @@ void atf_gcli::ind_gtblacttstout_Remove(atf_gcli::FGtblacttstout& row) { // --- atf_gcli.FDb.ind_gtblacttstout.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_gcli::ind_gtblacttstout_Reserve(int n) { + ind_gtblacttstout_AbsReserve(_db.ind_gtblacttstout_n + n); +} + +// --- atf_gcli.FDb.ind_gtblacttstout.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_gcli::ind_gtblacttstout_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gtblacttstout_buckets_n; - u32 new_nelems = _db.ind_gtblacttstout_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -844,7 +850,7 @@ void atf_gcli::ind_gtblacttstout_Reserve(int n) { while (elem) { atf_gcli::FGtblacttstout &row = *elem; atf_gcli::FGtblacttstout* next = row.ind_gtblacttstout_next; - u32 index = algo::Smallstr250_Hash(0, row.gtblacttstout) & (new_nbuckets-1); + u32 index = row.ind_gtblacttstout_hashval & (new_nbuckets-1); row.ind_gtblacttstout_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -861,15 +867,11 @@ void atf_gcli::ind_gtblacttstout_Reserve(int n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void atf_gcli::c_gtblacttst_Insert(atf_gcli::FGtblacttst& row) { - if (bool_Update(row._db_c_gtblacttst_in_ary,true)) { - // reserve space + if (!row.c_gtblacttst_in_ary) { c_gtblacttst_Reserve(1); - u32 n = _db.c_gtblacttst_n; - u32 at = n; - atf_gcli::FGtblacttst* *elems = _db.c_gtblacttst_elems; - elems[at] = &row; - _db.c_gtblacttst_n = n+1; - + u32 n = _db.c_gtblacttst_n++; + _db.c_gtblacttst_elems[n] = &row; + row.c_gtblacttst_in_ary = true; } } @@ -878,7 +880,7 @@ void atf_gcli::c_gtblacttst_Insert(atf_gcli::FGtblacttst& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool atf_gcli::c_gtblacttst_InsertMaybe(atf_gcli::FGtblacttst& row) { - bool retval = !row._db_c_gtblacttst_in_ary; + bool retval = !c_gtblacttst_InAryQ(row); c_gtblacttst_Insert(row); // check is performed in _Insert again return retval; } @@ -886,18 +888,18 @@ bool atf_gcli::c_gtblacttst_InsertMaybe(atf_gcli::FGtblacttst& row) { // --- atf_gcli.FDb.c_gtblacttst.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void atf_gcli::c_gtblacttst_Remove(atf_gcli::FGtblacttst& row) { - if (bool_Update(row._db_c_gtblacttst_in_ary,false)) { - int lim = _db.c_gtblacttst_n; + int n = _db.c_gtblacttst_n; + if (bool_Update(row.c_gtblacttst_in_ary,false)) { atf_gcli::FGtblacttst* *elems = _db.c_gtblacttst_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { atf_gcli::FGtblacttst* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(atf_gcli::FGtblacttst*) * (lim - j); + size_t nbytes = sizeof(atf_gcli::FGtblacttst*) * (n - j); memmove(elems + i, elems + j, nbytes); - _db.c_gtblacttst_n = lim - 1; + _db.c_gtblacttst_n = n - 1; break; } } @@ -1148,14 +1150,9 @@ bool atf_gcli::gclienv_XrefMaybe(atf_gcli::FGclienv &row) { // Find row by key. Return NULL if not found. atf_gcli::FGclienv* atf_gcli::ind_gclienv_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_gclienv_buckets_n - 1); - atf_gcli::FGclienv* *e = &_db.ind_gclienv_buckets_elems[index]; - atf_gcli::FGclienv* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gclienv == key; - if (done) break; - e = &ret->ind_gclienv_next; - } while (true); + atf_gcli::FGclienv *ret = _db.ind_gclienv_buckets_elems[index]; + for (; ret && !((*ret).gclienv == key); ret = ret->ind_gclienv_next) { + } return ret; } @@ -1187,10 +1184,11 @@ atf_gcli::FGclienv& atf_gcli::ind_gclienv_GetOrCreate(const algo::strptr& key) { // --- atf_gcli.FDb.ind_gclienv.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_gcli::ind_gclienv_InsertMaybe(atf_gcli::FGclienv& row) { - ind_gclienv_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gclienv_next == (atf_gcli::FGclienv*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gclienv) & (_db.ind_gclienv_buckets_n - 1); + row.ind_gclienv_hashval = algo::Smallstr50_Hash(0, row.gclienv); + ind_gclienv_Reserve(1); + u32 index = row.ind_gclienv_hashval & (_db.ind_gclienv_buckets_n - 1); atf_gcli::FGclienv* *prev = &_db.ind_gclienv_buckets_elems[index]; do { atf_gcli::FGclienv* ret = *prev; @@ -1216,7 +1214,7 @@ bool atf_gcli::ind_gclienv_InsertMaybe(atf_gcli::FGclienv& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_gcli::ind_gclienv_Remove(atf_gcli::FGclienv& row) { if (LIKELY(row.ind_gclienv_next != (atf_gcli::FGclienv*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gclienv) & (_db.ind_gclienv_buckets_n - 1); + u32 index = row.ind_gclienv_hashval & (_db.ind_gclienv_buckets_n - 1); atf_gcli::FGclienv* *prev = &_db.ind_gclienv_buckets_elems[index]; // addr of pointer to current element while (atf_gcli::FGclienv *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1233,8 +1231,14 @@ void atf_gcli::ind_gclienv_Remove(atf_gcli::FGclienv& row) { // --- atf_gcli.FDb.ind_gclienv.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_gcli::ind_gclienv_Reserve(int n) { + ind_gclienv_AbsReserve(_db.ind_gclienv_n + n); +} + +// --- atf_gcli.FDb.ind_gclienv.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_gcli::ind_gclienv_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gclienv_buckets_n; - u32 new_nelems = _db.ind_gclienv_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1253,7 +1257,7 @@ void atf_gcli::ind_gclienv_Reserve(int n) { while (elem) { atf_gcli::FGclienv &row = *elem; atf_gcli::FGclienv* next = row.ind_gclienv_next; - u32 index = algo::Smallstr50_Hash(0, row.gclienv) & (new_nbuckets-1); + u32 index = row.ind_gclienv_hashval & (new_nbuckets-1); row.ind_gclienv_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1270,14 +1274,9 @@ void atf_gcli::ind_gclienv_Reserve(int n) { // Find row by key. Return NULL if not found. atf_gcli::FGclienvsub* atf_gcli::ind_gclienvsub_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_gclienvsub_buckets_n - 1); - atf_gcli::FGclienvsub* *e = &_db.ind_gclienvsub_buckets_elems[index]; - atf_gcli::FGclienvsub* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gclienvsub == key; - if (done) break; - e = &ret->ind_gclienvsub_next; - } while (true); + atf_gcli::FGclienvsub *ret = _db.ind_gclienvsub_buckets_elems[index]; + for (; ret && !((*ret).gclienvsub == key); ret = ret->ind_gclienvsub_next) { + } return ret; } @@ -1292,10 +1291,11 @@ atf_gcli::FGclienvsub& atf_gcli::ind_gclienvsub_FindX(const algo::strptr& key) { // --- atf_gcli.FDb.ind_gclienvsub.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_gcli::ind_gclienvsub_InsertMaybe(atf_gcli::FGclienvsub& row) { - ind_gclienvsub_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gclienvsub_next == (atf_gcli::FGclienvsub*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gclienvsub) & (_db.ind_gclienvsub_buckets_n - 1); + row.ind_gclienvsub_hashval = algo::Smallstr50_Hash(0, row.gclienvsub); + ind_gclienvsub_Reserve(1); + u32 index = row.ind_gclienvsub_hashval & (_db.ind_gclienvsub_buckets_n - 1); atf_gcli::FGclienvsub* *prev = &_db.ind_gclienvsub_buckets_elems[index]; do { atf_gcli::FGclienvsub* ret = *prev; @@ -1321,7 +1321,7 @@ bool atf_gcli::ind_gclienvsub_InsertMaybe(atf_gcli::FGclienvsub& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_gcli::ind_gclienvsub_Remove(atf_gcli::FGclienvsub& row) { if (LIKELY(row.ind_gclienvsub_next != (atf_gcli::FGclienvsub*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gclienvsub) & (_db.ind_gclienvsub_buckets_n - 1); + u32 index = row.ind_gclienvsub_hashval & (_db.ind_gclienvsub_buckets_n - 1); atf_gcli::FGclienvsub* *prev = &_db.ind_gclienvsub_buckets_elems[index]; // addr of pointer to current element while (atf_gcli::FGclienvsub *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1338,8 +1338,14 @@ void atf_gcli::ind_gclienvsub_Remove(atf_gcli::FGclienvsub& row) { // --- atf_gcli.FDb.ind_gclienvsub.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_gcli::ind_gclienvsub_Reserve(int n) { + ind_gclienvsub_AbsReserve(_db.ind_gclienvsub_n + n); +} + +// --- atf_gcli.FDb.ind_gclienvsub.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_gcli::ind_gclienvsub_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gclienvsub_buckets_n; - u32 new_nelems = _db.ind_gclienvsub_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1358,7 +1364,7 @@ void atf_gcli::ind_gclienvsub_Reserve(int n) { while (elem) { atf_gcli::FGclienvsub &row = *elem; atf_gcli::FGclienvsub* next = row.ind_gclienvsub_next; - u32 index = algo::Smallstr50_Hash(0, row.gclienvsub) & (new_nbuckets-1); + u32 index = row.ind_gclienvsub_hashval & (new_nbuckets-1); row.ind_gclienvsub_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1482,14 +1488,9 @@ bool atf_gcli::gtblact_XrefMaybe(atf_gcli::FGtblact &row) { // Find row by key. Return NULL if not found. atf_gcli::FGtblact* atf_gcli::ind_gtblact_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_gtblact_buckets_n - 1); - atf_gcli::FGtblact* *e = &_db.ind_gtblact_buckets_elems[index]; - atf_gcli::FGtblact* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gtblact == key; - if (done) break; - e = &ret->ind_gtblact_next; - } while (true); + atf_gcli::FGtblact *ret = _db.ind_gtblact_buckets_elems[index]; + for (; ret && !((*ret).gtblact == key); ret = ret->ind_gtblact_next) { + } return ret; } @@ -1521,10 +1522,11 @@ atf_gcli::FGtblact& atf_gcli::ind_gtblact_GetOrCreate(const algo::strptr& key) { // --- atf_gcli.FDb.ind_gtblact.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_gcli::ind_gtblact_InsertMaybe(atf_gcli::FGtblact& row) { - ind_gtblact_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gtblact_next == (atf_gcli::FGtblact*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gtblact) & (_db.ind_gtblact_buckets_n - 1); + row.ind_gtblact_hashval = algo::Smallstr50_Hash(0, row.gtblact); + ind_gtblact_Reserve(1); + u32 index = row.ind_gtblact_hashval & (_db.ind_gtblact_buckets_n - 1); atf_gcli::FGtblact* *prev = &_db.ind_gtblact_buckets_elems[index]; do { atf_gcli::FGtblact* ret = *prev; @@ -1550,7 +1552,7 @@ bool atf_gcli::ind_gtblact_InsertMaybe(atf_gcli::FGtblact& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_gcli::ind_gtblact_Remove(atf_gcli::FGtblact& row) { if (LIKELY(row.ind_gtblact_next != (atf_gcli::FGtblact*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gtblact) & (_db.ind_gtblact_buckets_n - 1); + u32 index = row.ind_gtblact_hashval & (_db.ind_gtblact_buckets_n - 1); atf_gcli::FGtblact* *prev = &_db.ind_gtblact_buckets_elems[index]; // addr of pointer to current element while (atf_gcli::FGtblact *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1567,8 +1569,14 @@ void atf_gcli::ind_gtblact_Remove(atf_gcli::FGtblact& row) { // --- atf_gcli.FDb.ind_gtblact.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_gcli::ind_gtblact_Reserve(int n) { + ind_gtblact_AbsReserve(_db.ind_gtblact_n + n); +} + +// --- atf_gcli.FDb.ind_gtblact.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_gcli::ind_gtblact_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gtblact_buckets_n; - u32 new_nelems = _db.ind_gtblact_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1587,7 +1595,7 @@ void atf_gcli::ind_gtblact_Reserve(int n) { while (elem) { atf_gcli::FGtblact &row = *elem; atf_gcli::FGtblact* next = row.ind_gtblact_next; - u32 index = algo::Smallstr50_Hash(0, row.gtblact) & (new_nbuckets-1); + u32 index = row.ind_gtblact_hashval & (new_nbuckets-1); row.ind_gtblact_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1775,15 +1783,11 @@ void atf_gcli::gclienv_CopyIn(atf_gcli::FGclienv &row, gclidb::Gclienv &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void atf_gcli::c_gclienvsub_Insert(atf_gcli::FGclienv& gclienv, atf_gcli::FGclienvsub& row) { - if (bool_Update(row.gclienv_c_gclienvsub_in_ary,true)) { - // reserve space + if (!row.gclienv_c_gclienvsub_in_ary) { c_gclienvsub_Reserve(gclienv, 1); - u32 n = gclienv.c_gclienvsub_n; - u32 at = n; - atf_gcli::FGclienvsub* *elems = gclienv.c_gclienvsub_elems; - elems[at] = &row; - gclienv.c_gclienvsub_n = n+1; - + u32 n = gclienv.c_gclienvsub_n++; + gclienv.c_gclienvsub_elems[n] = &row; + row.gclienv_c_gclienvsub_in_ary = true; } } @@ -1792,7 +1796,7 @@ void atf_gcli::c_gclienvsub_Insert(atf_gcli::FGclienv& gclienv, atf_gcli::FGclie // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool atf_gcli::c_gclienvsub_InsertMaybe(atf_gcli::FGclienv& gclienv, atf_gcli::FGclienvsub& row) { - bool retval = !row.gclienv_c_gclienvsub_in_ary; + bool retval = !gclienv_c_gclienvsub_InAryQ(row); c_gclienvsub_Insert(gclienv,row); // check is performed in _Insert again return retval; } @@ -1800,18 +1804,18 @@ bool atf_gcli::c_gclienvsub_InsertMaybe(atf_gcli::FGclienv& gclienv, atf_gcli::F // --- atf_gcli.FGclienv.c_gclienvsub.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void atf_gcli::c_gclienvsub_Remove(atf_gcli::FGclienv& gclienv, atf_gcli::FGclienvsub& row) { + int n = gclienv.c_gclienvsub_n; if (bool_Update(row.gclienv_c_gclienvsub_in_ary,false)) { - int lim = gclienv.c_gclienvsub_n; atf_gcli::FGclienvsub* *elems = gclienv.c_gclienvsub_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { atf_gcli::FGclienvsub* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(atf_gcli::FGclienvsub*) * (lim - j); + size_t nbytes = sizeof(atf_gcli::FGclienvsub*) * (n - j); memmove(elems + i, elems + j, nbytes); - gclienv.c_gclienvsub_n = lim - 1; + gclienv.c_gclienvsub_n = n - 1; break; } } @@ -1925,6 +1929,7 @@ void atf_gcli::FGtblact_Init(atf_gcli::FGtblact& gtblact) { gtblact.ghub_run = u32(0); gtblact.ghub_fail = u32(0); gtblact.ind_gtblact_next = (atf_gcli::FGtblact*)-1; // (atf_gcli.FDb.ind_gtblact) not-in-hash + gtblact.ind_gtblact_hashval = 0; // stored hash value } // --- atf_gcli.FGtblact..Uninit @@ -1973,15 +1978,11 @@ algo::cstring atf_gcli::t_Get(atf_gcli::FGtblacttst& gtblacttst) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void atf_gcli::c_gtblacttstout_Insert(atf_gcli::FGtblacttst& gtblacttst, atf_gcli::FGtblacttstout& row) { - if (bool_Update(row.gtblacttst_c_gtblacttstout_in_ary,true)) { - // reserve space + if (!row.gtblacttst_c_gtblacttstout_in_ary) { c_gtblacttstout_Reserve(gtblacttst, 1); - u32 n = gtblacttst.c_gtblacttstout_n; - u32 at = n; - atf_gcli::FGtblacttstout* *elems = gtblacttst.c_gtblacttstout_elems; - elems[at] = &row; - gtblacttst.c_gtblacttstout_n = n+1; - + u32 n = gtblacttst.c_gtblacttstout_n++; + gtblacttst.c_gtblacttstout_elems[n] = &row; + row.gtblacttst_c_gtblacttstout_in_ary = true; } } @@ -1990,7 +1991,7 @@ void atf_gcli::c_gtblacttstout_Insert(atf_gcli::FGtblacttst& gtblacttst, atf_gcl // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool atf_gcli::c_gtblacttstout_InsertMaybe(atf_gcli::FGtblacttst& gtblacttst, atf_gcli::FGtblacttstout& row) { - bool retval = !row.gtblacttst_c_gtblacttstout_in_ary; + bool retval = !gtblacttst_c_gtblacttstout_InAryQ(row); c_gtblacttstout_Insert(gtblacttst,row); // check is performed in _Insert again return retval; } @@ -1998,18 +1999,18 @@ bool atf_gcli::c_gtblacttstout_InsertMaybe(atf_gcli::FGtblacttst& gtblacttst, at // --- atf_gcli.FGtblacttst.c_gtblacttstout.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void atf_gcli::c_gtblacttstout_Remove(atf_gcli::FGtblacttst& gtblacttst, atf_gcli::FGtblacttstout& row) { + int n = gtblacttst.c_gtblacttstout_n; if (bool_Update(row.gtblacttst_c_gtblacttstout_in_ary,false)) { - int lim = gtblacttst.c_gtblacttstout_n; atf_gcli::FGtblacttstout* *elems = gtblacttst.c_gtblacttstout_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { atf_gcli::FGtblacttstout* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(atf_gcli::FGtblacttstout*) * (lim - j); + size_t nbytes = sizeof(atf_gcli::FGtblacttstout*) * (n - j); memmove(elems + i, elems + j, nbytes); - gtblacttst.c_gtblacttstout_n = lim - 1; + gtblacttst.c_gtblacttstout_n = n - 1; break; } } @@ -2044,8 +2045,9 @@ void atf_gcli::FGtblacttst_Init(atf_gcli::FGtblacttst& gtblacttst) { gtblacttst.select = bool(false); gtblacttst.p_gclienv = NULL; gtblacttst.p_gtblact = NULL; - gtblacttst._db_c_gtblacttst_in_ary = bool(false); + gtblacttst.c_gtblacttst_in_ary = bool(false); gtblacttst.ind_gtblacttst_next = (atf_gcli::FGtblacttst*)-1; // (atf_gcli.FDb.ind_gtblacttst) not-in-hash + gtblacttst.ind_gtblacttst_hashval = 0; // stored hash value } // --- atf_gcli.FGtblacttst..Uninit @@ -2296,12 +2298,13 @@ void atf_gcli::StaticCheck() { // --- atf_gcli...main int main(int argc, char **argv) { try { - algo_lib::FDb_Init(); lib_json::FDb_Init(); + algo_lib::FDb_Init(); atf_gcli::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock atf_gcli::ReadArgv(); // dmmeta.main:atf_gcli atf_gcli::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -2313,8 +2316,8 @@ int main(int argc, char **argv) { } try { atf_gcli::FDb_Uninit(); - lib_json::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/atf_gen.cpp b/cpp/gen/atf_gen.cpp index 8956702f..53328be8 100644 --- a/cpp/gen/atf_gen.cpp +++ b/cpp/gen/atf_gen.cpp @@ -271,25 +271,23 @@ bool atf::Testrun_ReadFieldMaybe(atf::Testrun& parent, algo::strptr field, algo: switch(field_id) { case atf_FieldId_testrun: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.testrun, strval); - break; - } + } break; case atf_FieldId_testresult: { retval = atf::Testresult_ReadStrptrMaybe(parent.testresult, strval); - break; - } + } break; case atf_FieldId_n_step: { retval = u64_ReadStrptrMaybe(parent.n_step, strval); - break; - } + } break; case atf_FieldId_n_cmp: { retval = u64_ReadStrptrMaybe(parent.n_cmp, strval); - break; - } + } break; case atf_FieldId_comment: { retval = algo::cstring_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); diff --git a/cpp/gen/atf_nrun_gen.cpp b/cpp/gen/atf_nrun_gen.cpp index 3e2e444b..6e391316 100644 --- a/cpp/gen/atf_nrun_gen.cpp +++ b/cpp/gen/atf_nrun_gen.cpp @@ -29,12 +29,15 @@ #include "include/gen/command_gen.inl.h" #include "include/gen/algo_gen.h" #include "include/gen/algo_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep atf_nrun::FDb atf_nrun::_db; // dependency found via dev.targdep @@ -46,8 +49,8 @@ const char *atf_nrun_help = " -in string \"data\" Input directory or filename, - for stdin\n" " -maxjobs int 2 Number of simultaneous jobs\n" " [ncmd] int 6\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -174,9 +177,8 @@ void atf_nrun::ReadArgv() { } if (ch_N(attrname) == 0) { err << "atf_nrun: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:atf_nrun.FDb.cmdline @@ -230,7 +235,7 @@ void atf_nrun::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -299,8 +304,8 @@ bool atf_nrun::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && atf_nrun::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -449,14 +454,9 @@ bool atf_nrun::fentry_XrefMaybe(atf_nrun::FEntry &row) { // Find row by key. Return NULL if not found. atf_nrun::FEntry* atf_nrun::ind_running_Find(i32 key) { u32 index = ::i32_Hash(0, key) & (_db.ind_running_buckets_n - 1); - atf_nrun::FEntry* *e = &_db.ind_running_buckets_elems[index]; - atf_nrun::FEntry* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).pid == key; - if (done) break; - e = &ret->ind_running_next; - } while (true); + atf_nrun::FEntry *ret = _db.ind_running_buckets_elems[index]; + for (; ret && !((*ret).pid == key); ret = ret->ind_running_next) { + } return ret; } @@ -488,10 +488,11 @@ atf_nrun::FEntry& atf_nrun::ind_running_GetOrCreate(i32 key) { // --- atf_nrun.FDb.ind_running.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_nrun::ind_running_InsertMaybe(atf_nrun::FEntry& row) { - ind_running_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_running_next == (atf_nrun::FEntry*)-1)) {// check if in hash already - u32 index = ::i32_Hash(0, row.pid) & (_db.ind_running_buckets_n - 1); + row.ind_running_hashval = ::i32_Hash(0, row.pid); + ind_running_Reserve(1); + u32 index = row.ind_running_hashval & (_db.ind_running_buckets_n - 1); atf_nrun::FEntry* *prev = &_db.ind_running_buckets_elems[index]; do { atf_nrun::FEntry* ret = *prev; @@ -517,7 +518,7 @@ bool atf_nrun::ind_running_InsertMaybe(atf_nrun::FEntry& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_nrun::ind_running_Remove(atf_nrun::FEntry& row) { if (LIKELY(row.ind_running_next != (atf_nrun::FEntry*)-1)) {// check if in hash already - u32 index = ::i32_Hash(0, row.pid) & (_db.ind_running_buckets_n - 1); + u32 index = row.ind_running_hashval & (_db.ind_running_buckets_n - 1); atf_nrun::FEntry* *prev = &_db.ind_running_buckets_elems[index]; // addr of pointer to current element while (atf_nrun::FEntry *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -534,8 +535,14 @@ void atf_nrun::ind_running_Remove(atf_nrun::FEntry& row) { // --- atf_nrun.FDb.ind_running.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_nrun::ind_running_Reserve(int n) { + ind_running_AbsReserve(_db.ind_running_n + n); +} + +// --- atf_nrun.FDb.ind_running.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_nrun::ind_running_AbsReserve(int n) { u32 old_nbuckets = _db.ind_running_buckets_n; - u32 new_nelems = _db.ind_running_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -554,7 +561,7 @@ void atf_nrun::ind_running_Reserve(int n) { while (elem) { atf_nrun::FEntry &row = *elem; atf_nrun::FEntry* next = row.ind_running_next; - u32 index = ::i32_Hash(0, row.pid) & (new_nbuckets-1); + u32 index = row.ind_running_hashval & (new_nbuckets-1); row.ind_running_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -827,7 +834,7 @@ algo::Fildes atf_nrun::job_StartRead(atf_nrun::FEntry& fentry, algo_lib::FFildes // --- atf_nrun.FEntry.job.Kill // Kill subprocess and wait void atf_nrun::job_Kill(atf_nrun::FEntry& fentry) { - if (fentry.job_pid != 0) { + if (fentry.job_pid > 0) { kill(fentry.job_pid,9); job_Wait(fentry); } @@ -926,6 +933,7 @@ void atf_nrun::FEntry_Init(atf_nrun::FEntry& fentry) { fentry.job_timeout = i32(0); fentry.job_status = i32(0); fentry.ind_running_next = (atf_nrun::FEntry*)-1; // (atf_nrun.FDb.ind_running) not-in-hash + fentry.ind_running_hashval = 0; // stored hash value fentry.zd_todo_next = (atf_nrun::FEntry*)-1; // (atf_nrun.FDb.zd_todo) not-in-list fentry.zd_todo_prev = NULL; // (atf_nrun.FDb.zd_todo) } @@ -1028,11 +1036,13 @@ void atf_nrun::StaticCheck() { // --- atf_nrun...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); atf_nrun::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock atf_nrun::ReadArgv(); // dmmeta.main:atf_nrun atf_nrun::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -1045,6 +1055,7 @@ int main(int argc, char **argv) { try { atf_nrun::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/atf_unit_gen.cpp b/cpp/gen/atf_unit_gen.cpp index 5c5c7d07..becb6f92 100644 --- a/cpp/gen/atf_unit_gen.cpp +++ b/cpp/gen/atf_unit_gen.cpp @@ -35,29 +35,35 @@ #include "include/gen/atfdb_gen.inl.h" #include "include/gen/lib_exec_gen.h" #include "include/gen/lib_exec_gen.inl.h" -#include "include/gen/algo_lib_gen.h" -#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_json_gen.h" #include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" #include "include/gen/lib_ams_gen.h" #include "include/gen/lib_ams_gen.inl.h" +#include "include/gen/lib_curl_gen.h" +#include "include/gen/lib_curl_gen.inl.h" #include "include/gen/lib_fm_gen.h" #include "include/gen/lib_fm_gen.inl.h" +#include "include/gen/lib_netio_gen.h" +#include "include/gen/lib_netio_gen.inl.h" #include "include/gen/lib_sql_gen.h" #include "include/gen/lib_sql_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order -algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep -lib_json::FDb lib_json::_db; // dependency found via dev.targdep -lib_ams::FDb lib_ams::_db; // dependency found via dev.targdep -lib_exec::FDb lib_exec::_db; // dependency found via dev.targdep -lib_fm::FDb lib_fm::_db; // dependency found via dev.targdep -lib_sql::FDb lib_sql::_db; // dependency found via dev.targdep -atf_unit::FDb atf_unit::_db; // dependency found via dev.targdep +lib_json::FDb lib_json::_db; // dependency found via dev.targdep +algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep +lib_ams::FDb lib_ams::_db; // dependency found via dev.targdep +lib_curl::FDb lib_curl::_db; // dependency found via dev.targdep +lib_exec::FDb lib_exec::_db; // dependency found via dev.targdep +lib_fm::FDb lib_fm::_db; // dependency found via dev.targdep +lib_netio::FDb lib_netio::_db; // dependency found via dev.targdep +lib_sql::FDb lib_sql::_db; // dependency found via dev.targdep +atf_unit::FDb atf_unit::_db; // dependency found via dev.targdep namespace atf_unit { const char *atf_unit_help = @@ -74,8 +80,8 @@ const char *atf_unit_help = " -report Y Print final report\n" " -capture Re-capture test results\n" " -check_untracked Y Check for untracked file before allowing test to run\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -258,7 +264,7 @@ algo::Fildes atf_unit::acr_ed_StartRead(algo_lib::FFildes &read) { // --- atf_unit.FDb.acr_ed.Kill // Kill subprocess and wait void atf_unit::acr_ed_Kill() { - if (_db.acr_ed_pid != 0) { + if (_db.acr_ed_pid > 0) { kill(_db.acr_ed_pid,9); acr_ed_Wait(); } @@ -610,6 +616,12 @@ void atf_unit::acr_ed_ToArgv(algo::StringAry& args) { *arg << "-anonfld:"; bool_Print(_db.acr_ed_cmd.anonfld, *arg); } + + if (_db.acr_ed_cmd.amc != true) { + cstring *arg = &ary_Alloc(args); + *arg << "-amc:"; + bool_Print(_db.acr_ed_cmd.amc, *arg); + } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } @@ -1114,6 +1126,7 @@ static void atf_unit::unittest_LoadStatic() { ,{ "atfdb.unittest unittest:algo_lib.DoTestRounding comment:\"\"", atf_unit::unittest_algo_lib_DoTestRounding } ,{ "atfdb.unittest unittest:algo_lib.ExitCode comment:\"\"", atf_unit::unittest_algo_lib_ExitCode } ,{ "atfdb.unittest unittest:algo_lib.FTruncate comment:\"\"", atf_unit::unittest_algo_lib_FTruncate } + ,{ "atfdb.unittest unittest:algo_lib.FileAppend comment:\"\"", atf_unit::unittest_algo_lib_FileAppend } ,{ "atfdb.unittest unittest:algo_lib.FileLine_curs comment:\"\"", atf_unit::unittest_algo_lib_FileLine_curs } ,{ "atfdb.unittest unittest:algo_lib.FileQ comment:\"\"", atf_unit::unittest_algo_lib_FileQ } ,{ "atfdb.unittest unittest:algo_lib.FileToString comment:\"\"", atf_unit::unittest_algo_lib_FileToString } @@ -1155,15 +1168,18 @@ static void atf_unit::unittest_LoadStatic() { ,{ "atfdb.unittest unittest:algo_lib.PrintPad comment:\"\"", atf_unit::unittest_algo_lib_PrintPad } ,{ "atfdb.unittest unittest:algo_lib.PrintSsim comment:\"\"", atf_unit::unittest_algo_lib_PrintSsim } ,{ "atfdb.unittest unittest:algo_lib.PrintUnTime comment:\"\"", atf_unit::unittest_algo_lib_PrintUnTime } + ,{ "atfdb.unittest unittest:algo_lib.PrintUuid comment:\"\"", atf_unit::unittest_algo_lib_PrintUuid } ,{ "atfdb.unittest unittest:algo_lib.PrintWithCommas comment:\"\"", atf_unit::unittest_algo_lib_PrintWithCommas } ,{ "atfdb.unittest unittest:algo_lib.ReadLine comment:\"\"", atf_unit::unittest_algo_lib_ReadLine } ,{ "atfdb.unittest unittest:algo_lib.ReadModuleId comment:\"\"", atf_unit::unittest_algo_lib_ReadModuleId } + ,{ "atfdb.unittest unittest:algo_lib.ReadUuid comment:\"\"", atf_unit::unittest_algo_lib_ReadUuid } ,{ "atfdb.unittest unittest:algo_lib.Regx comment:\"\"", atf_unit::unittest_algo_lib_Regx } ,{ "atfdb.unittest unittest:algo_lib.RegxReadTwice comment:\"\"", atf_unit::unittest_algo_lib_RegxReadTwice } ,{ "atfdb.unittest unittest:algo_lib.RegxReadTwice2 comment:\"\"", atf_unit::unittest_algo_lib_RegxReadTwice2 } ,{ "atfdb.unittest unittest:algo_lib.RegxShortCircuit comment:\"\"", atf_unit::unittest_algo_lib_RegxShortCircuit } ,{ "atfdb.unittest unittest:algo_lib.RemDirRecurse comment:\"Test RemDirRecurse functions\"", atf_unit::unittest_algo_lib_RemDirRecurse } ,{ "atfdb.unittest unittest:algo_lib.Replscope comment:\"\"", atf_unit::unittest_algo_lib_Replscope } + ,{ "atfdb.unittest unittest:algo_lib.ReplscopeSharedPrefix comment:\"\"", atf_unit::unittest_algo_lib_ReplscopeSharedPrefix } ,{ "atfdb.unittest unittest:algo_lib.ReverseBits comment:\"\"", atf_unit::unittest_algo_lib_ReverseBits } ,{ "atfdb.unittest unittest:algo_lib.SchedTime comment:\"\"", atf_unit::unittest_algo_lib_SchedTime } ,{ "atfdb.unittest unittest:algo_lib.Sleep comment:\"\"", atf_unit::unittest_algo_lib_Sleep } @@ -1195,6 +1211,8 @@ static void atf_unit::unittest_LoadStatic() { ,{ "atfdb.unittest unittest:algo_lib.Txttbl comment:\"\"", atf_unit::unittest_algo_lib_Txttbl } ,{ "atfdb.unittest unittest:algo_lib.U128PrintHex comment:\"\"", atf_unit::unittest_algo_lib_U128PrintHex } ,{ "atfdb.unittest unittest:algo_lib.UnescapeC comment:\"\"", atf_unit::unittest_algo_lib_UnescapeC } + ,{ "atfdb.unittest unittest:algo_lib.Url comment:\"\"", atf_unit::unittest_algo_lib_Url } + ,{ "atfdb.unittest unittest:algo_lib.Zigzag comment:\"\"", atf_unit::unittest_algo_lib_Zigzag } ,{ "atfdb.unittest unittest:algo_lib.flock comment:\"\"", atf_unit::unittest_algo_lib_flock } ,{ "atfdb.unittest unittest:algo_lib.strptr_Eq comment:\"\"", atf_unit::unittest_algo_lib_strptr_Eq } ,{ "atfdb.unittest unittest:algo_lib.test_strptr comment:\"\"", atf_unit::unittest_algo_lib_test_strptr } @@ -1205,6 +1223,10 @@ static void atf_unit::unittest_LoadStatic() { ,{ "atfdb.unittest unittest:atf_unit.Outfile comment:\"\"", atf_unit::unittest_atf_unit_Outfile } ,{ "atfdb.unittest unittest:fm comment:\"\"", atf_unit::unittest_fm } ,{ "atfdb.unittest unittest:lib_ams.Test1 comment:WIP", atf_unit::unittest_lib_ams_Test1 } + ,{ "atfdb.unittest unittest:lib_curl.GET_Echo comment:\"GET /echo\"", atf_unit::unittest_lib_curl_GET_Echo } + ,{ "atfdb.unittest unittest:lib_curl.POST_JSON comment:\"POST /echo with JSON + header\"", atf_unit::unittest_lib_curl_POST_JSON } + ,{ "atfdb.unittest unittest:lib_curl.PUT_PLAINTEXT comment:\"PUT /echo with plain text\"", atf_unit::unittest_lib_curl_PUT_PLAINTEXT } + ,{ "atfdb.unittest unittest:lib_curl.STATUS_200 comment:\"GET status 200\"", atf_unit::unittest_lib_curl_STATUS_200 } ,{ "atfdb.unittest unittest:lib_exec.Dependency comment:\"\"", atf_unit::unittest_lib_exec_Dependency } ,{ "atfdb.unittest unittest:lib_exec.Parallel1 comment:\"\"", atf_unit::unittest_lib_exec_Parallel1 } ,{ "atfdb.unittest unittest:lib_exec.Timeout comment:\"\"", atf_unit::unittest_lib_exec_Timeout } @@ -1315,6 +1337,7 @@ static void atf_unit::unittest_LoadStatic() { ,{ "atfdb.unittest unittest:lib_json.TokenNull comment:\"Single null token\"", atf_unit::unittest_lib_json_TokenNull } ,{ "atfdb.unittest unittest:lib_json.TokenTrue comment:\"Single true token\"", atf_unit::unittest_lib_json_TokenTrue } ,{ "atfdb.unittest unittest:lib_json.Typical comment:\"Normal case similar to typical usage\"", atf_unit::unittest_lib_json_Typical } + ,{ "atfdb.unittest unittest:lib_netio_GetHostAddr comment:\"resolve hostname to ips\"", atf_unit::unittest_lib_netio_GetHostAddr } ,{ "atfdb.unittest unittest:lib_sql.Main comment:\"\"", atf_unit::unittest_lib_sql_Main } ,{NULL, NULL} }; @@ -1434,9 +1457,8 @@ void atf_unit::ReadArgv() { } if (ch_N(attrname) == 0) { err << "atf_unit: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:atf_unit.FDb.cmdline @@ -1490,7 +1515,7 @@ void atf_unit::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -1559,8 +1584,8 @@ bool atf_unit::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && atf_unit::LoadTuplesFile(algo::SsimFname(root,"fmdb.alm_code"),recursive); retval = retval && atf_unit::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -1633,14 +1658,9 @@ bool atf_unit::_db_XrefMaybe() { // Find row by key. Return NULL if not found. atf_unit::FUnittest* atf_unit::ind_unittest_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_unittest_buckets_n - 1); - atf_unit::FUnittest* *e = &_db.ind_unittest_buckets_elems[index]; - atf_unit::FUnittest* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).unittest == key; - if (done) break; - e = &ret->ind_unittest_next; - } while (true); + atf_unit::FUnittest *ret = _db.ind_unittest_buckets_elems[index]; + for (; ret && !((*ret).unittest == key); ret = ret->ind_unittest_next) { + } return ret; } @@ -1672,10 +1692,11 @@ atf_unit::FUnittest& atf_unit::ind_unittest_GetOrCreate(const algo::strptr& key) // --- atf_unit.FDb.ind_unittest.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool atf_unit::ind_unittest_InsertMaybe(atf_unit::FUnittest& row) { - ind_unittest_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_unittest_next == (atf_unit::FUnittest*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.unittest) & (_db.ind_unittest_buckets_n - 1); + row.ind_unittest_hashval = algo::Smallstr50_Hash(0, row.unittest); + ind_unittest_Reserve(1); + u32 index = row.ind_unittest_hashval & (_db.ind_unittest_buckets_n - 1); atf_unit::FUnittest* *prev = &_db.ind_unittest_buckets_elems[index]; do { atf_unit::FUnittest* ret = *prev; @@ -1701,7 +1722,7 @@ bool atf_unit::ind_unittest_InsertMaybe(atf_unit::FUnittest& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void atf_unit::ind_unittest_Remove(atf_unit::FUnittest& row) { if (LIKELY(row.ind_unittest_next != (atf_unit::FUnittest*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.unittest) & (_db.ind_unittest_buckets_n - 1); + u32 index = row.ind_unittest_hashval & (_db.ind_unittest_buckets_n - 1); atf_unit::FUnittest* *prev = &_db.ind_unittest_buckets_elems[index]; // addr of pointer to current element while (atf_unit::FUnittest *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1718,8 +1739,14 @@ void atf_unit::ind_unittest_Remove(atf_unit::FUnittest& row) { // --- atf_unit.FDb.ind_unittest.Reserve // Reserve enough room in the hash for N more elements. Return success code. void atf_unit::ind_unittest_Reserve(int n) { + ind_unittest_AbsReserve(_db.ind_unittest_n + n); +} + +// --- atf_unit.FDb.ind_unittest.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void atf_unit::ind_unittest_AbsReserve(int n) { u32 old_nbuckets = _db.ind_unittest_buckets_n; - u32 new_nelems = _db.ind_unittest_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1738,7 +1765,7 @@ void atf_unit::ind_unittest_Reserve(int n) { while (elem) { atf_unit::FUnittest &row = *elem; atf_unit::FUnittest* next = row.ind_unittest_next; - u32 index = algo::Smallstr50_Hash(0, row.unittest) & (new_nbuckets-1); + u32 index = row.ind_unittest_hashval & (new_nbuckets-1); row.ind_unittest_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1883,6 +1910,25 @@ algo::aryptr atf_unit::orig_AllocN(atf_unit::FPerfSort& parent, i return algo::aryptr(elems + old_n, n_elems); } +// --- atf_unit.FPerfSort.orig.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr atf_unit::orig_AllocNAt(atf_unit::FPerfSort& parent, int n_elems, int at) { + orig_Reserve(parent, n_elems); + int n = parent.orig_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("atf_unit.bad_alloc_n_at field:atf_unit.FPerfSort.orig comment:'index out of range'"); + } + atf_unit::Dbl *elems = parent.orig_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(atf_unit::Dbl)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) atf_unit::Dbl(); // construct new element, default initialize + } + parent.orig_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- atf_unit.FPerfSort.orig.Remove // Remove item by index. If index outside of range, do nothing. void atf_unit::orig_Remove(atf_unit::FPerfSort& parent, u32 i) { @@ -1967,6 +2013,29 @@ bool atf_unit::orig_ReadStrptrMaybe(atf_unit::FPerfSort& parent, algo::strptr in return retval; } +// --- atf_unit.FPerfSort.orig.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void atf_unit::orig_Insary(atf_unit::FPerfSort& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.orig_elems && rhs.elems < parent.orig_elems + parent.orig_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_unit.tary_alias field:atf_unit.FPerfSort.orig comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.orig_elems+1))) { + FatalErrorExit("atf_unit.bad_insary field:atf_unit.FPerfSort.orig comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.orig_n - at; + orig_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.orig_elems + at + nnew + i) atf_unit::Dbl(parent.orig_elems[at + i]); + } + for (int i = 0; i < nnew; ++i) { + new (parent.orig_elems + at + i) atf_unit::Dbl(rhs[i]); + } + parent.orig_n += nnew; +} + // --- atf_unit.FPerfSort.sorted.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -2029,6 +2098,25 @@ algo::aryptr atf_unit::sorted_AllocN(atf_unit::FPerfSort& parent, return algo::aryptr(elems + old_n, n_elems); } +// --- atf_unit.FPerfSort.sorted.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr atf_unit::sorted_AllocNAt(atf_unit::FPerfSort& parent, int n_elems, int at) { + sorted_Reserve(parent, n_elems); + int n = parent.sorted_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("atf_unit.bad_alloc_n_at field:atf_unit.FPerfSort.sorted comment:'index out of range'"); + } + atf_unit::Dbl *elems = parent.sorted_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(atf_unit::Dbl)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) atf_unit::Dbl(); // construct new element, default initialize + } + parent.sorted_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- atf_unit.FPerfSort.sorted.Remove // Remove item by index. If index outside of range, do nothing. void atf_unit::sorted_Remove(atf_unit::FPerfSort& parent, u32 i) { @@ -2113,6 +2201,29 @@ bool atf_unit::sorted_ReadStrptrMaybe(atf_unit::FPerfSort& parent, algo::strptr return retval; } +// --- atf_unit.FPerfSort.sorted.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void atf_unit::sorted_Insary(atf_unit::FPerfSort& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.sorted_elems && rhs.elems < parent.sorted_elems + parent.sorted_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_unit.tary_alias field:atf_unit.FPerfSort.sorted comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.sorted_elems+1))) { + FatalErrorExit("atf_unit.bad_insary field:atf_unit.FPerfSort.sorted comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.sorted_n - at; + sorted_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.sorted_elems + at + nnew + i) atf_unit::Dbl(parent.sorted_elems[at + i]); + } + for (int i = 0; i < nnew; ++i) { + new (parent.sorted_elems + at + i) atf_unit::Dbl(rhs[i]); + } + parent.sorted_n += nnew; +} + // --- atf_unit.FPerfSort.sorted.Swap // Swap values elem_a and elem_b inline static void atf_unit::sorted_Swap(atf_unit::Dbl &elem_a, atf_unit::Dbl &elem_b) { @@ -2339,6 +2450,25 @@ algo::aryptr atf_unit::index_AllocN(atf_unit::FPerfSort& parent, int n_elem return algo::aryptr(elems + old_n, n_elems); } +// --- atf_unit.FPerfSort.index.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr atf_unit::index_AllocNAt(atf_unit::FPerfSort& parent, int n_elems, int at) { + index_Reserve(parent, n_elems); + int n = parent.index_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("atf_unit.bad_alloc_n_at field:atf_unit.FPerfSort.index comment:'index out of range'"); + } + i32 *elems = parent.index_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(i32)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) i32(0); // construct new element, default initialize + } + parent.index_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- atf_unit.FPerfSort.index.Remove // Remove item by index. If index outside of range, do nothing. void atf_unit::index_Remove(atf_unit::FPerfSort& parent, u32 i) { @@ -2423,6 +2553,25 @@ bool atf_unit::index_ReadStrptrMaybe(atf_unit::FPerfSort& parent, algo::strptr i return retval; } +// --- atf_unit.FPerfSort.index.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void atf_unit::index_Insary(atf_unit::FPerfSort& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.index_elems && rhs.elems < parent.index_elems + parent.index_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("atf_unit.tary_alias field:atf_unit.FPerfSort.index comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.index_elems+1))) { + FatalErrorExit("atf_unit.bad_insary field:atf_unit.FPerfSort.index comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.index_n - at; + index_Reserve(parent, nnew); // reserve space + memmove(parent.index_elems + at + nnew, parent.index_elems + at, nmove * sizeof(i32)); + memcpy(parent.index_elems + at, rhs.elems, nnew * sizeof(i32)); + parent.index_n += nnew; +} + // --- atf_unit.FPerfSort..Uninit void atf_unit::FPerfSort_Uninit(atf_unit::FPerfSort& parent) { atf_unit::FPerfSort &row = parent; (void)row; @@ -2484,8 +2633,8 @@ void atf_unit::unittest_CopyIn(atf_unit::FUnittest &row, atfdb::Unittest &in) { row.comment = in.comment; } -// --- atf_unit.FUnittest.target.Get -algo::Smallstr16 atf_unit::target_Get(atf_unit::FUnittest& unittest) { +// --- atf_unit.FUnittest.ns.Get +algo::Smallstr16 atf_unit::ns_Get(atf_unit::FUnittest& unittest) { algo::Smallstr16 ret(algo::Pathcomp(unittest.unittest, ".RL")); return ret; } @@ -2657,13 +2806,14 @@ bool atf_unit::TypeB_ReadFieldMaybe(atf_unit::TypeB& parent, algo::strptr field, switch(field_id) { case atf_unit_FieldId_typea: { retval = i32_ReadStrptrMaybe(parent.typea, strval); - break; - } + } break; case atf_unit_FieldId_j: { retval = i32_ReadStrptrMaybe(parent.j, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2951,16 +3101,19 @@ void atf_unit::StaticCheck() { // --- atf_unit...main int main(int argc, char **argv) { try { - algo_lib::FDb_Init(); lib_json::FDb_Init(); + algo_lib::FDb_Init(); lib_ams::FDb_Init(); + lib_curl::FDb_Init(); lib_exec::FDb_Init(); lib_fm::FDb_Init(); + lib_netio::FDb_Init(); lib_sql::FDb_Init(); atf_unit::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock atf_unit::ReadArgv(); // dmmeta.main:atf_unit atf_unit::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -2973,11 +3126,13 @@ int main(int argc, char **argv) { try { atf_unit::FDb_Uninit(); lib_sql::FDb_Uninit(); + lib_netio::FDb_Uninit(); lib_fm::FDb_Uninit(); lib_exec::FDb_Uninit(); + lib_curl::FDb_Uninit(); lib_ams::FDb_Uninit(); - lib_json::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/atfdb_gen.cpp b/cpp/gen/atfdb_gen.cpp index 4abb6458..edad492a 100644 --- a/cpp/gen/atfdb_gen.cpp +++ b/cpp/gen/atfdb_gen.cpp @@ -45,13 +45,14 @@ bool atfdb::Amctest_ReadFieldMaybe(atfdb::Amctest& parent, algo::strptr field, a switch(field_id) { case atfdb_FieldId_amctest: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.amctest, strval); - break; - } + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -93,13 +94,14 @@ bool atfdb::Cijob_ReadFieldMaybe(atfdb::Cijob& parent, algo::strptr field, algo: switch(field_id) { case atfdb_FieldId_cijob: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.cijob, strval); - break; - } + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -141,25 +143,23 @@ bool atfdb::Cipackage_ReadFieldMaybe(atfdb::Cipackage& parent, algo::strptr fiel switch(field_id) { case atfdb_FieldId_package: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.package, strval); - break; - } + } break; case atfdb_FieldId_remove: { retval = bool_ReadStrptrMaybe(parent.remove, strval); - break; - } + } break; case atfdb_FieldId_build: { retval = bool_ReadStrptrMaybe(parent.build, strval); - break; - } + } break; case atfdb_FieldId_reinstall: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.reinstall, strval); - break; - } + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -210,21 +210,20 @@ bool atfdb::Citest_ReadFieldMaybe(atfdb::Citest& parent, algo::strptr field, alg switch(field_id) { case atfdb_FieldId_citest: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.citest, strval); - break; - } + } break; case atfdb_FieldId_cijob: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.cijob, strval); - break; - } + } break; case atfdb_FieldId_sandbox: { retval = bool_ReadStrptrMaybe(parent.sandbox, strval); - break; - } + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -301,33 +300,38 @@ bool atfdb::Comptest_ReadFieldMaybe(atfdb::Comptest& parent, algo::strptr field, switch(field_id) { case atfdb_FieldId_comptest: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.comptest, strval); - break; - } + } break; case atfdb_FieldId_target: { retval = false; - break; - } + } break; case atfdb_FieldId_testname: { retval = false; - break; - } + } break; case atfdb_FieldId_timeout: { retval = i32_ReadStrptrMaybe(parent.timeout, strval); - break; - } + } break; case atfdb_FieldId_memcheck: { retval = bool_ReadStrptrMaybe(parent.memcheck, strval); - break; - } + } break; + case atfdb_FieldId_coverage: { + retval = bool_ReadStrptrMaybe(parent.coverage, strval); + } break; case atfdb_FieldId_exit_code: { retval = u8_ReadStrptrMaybe(parent.exit_code, strval); - break; - } + } break; + case atfdb_FieldId_ncore: { + retval = i32_ReadStrptrMaybe(parent.ncore, strval); + } break; + case atfdb_FieldId_repeat: { + retval = i32_ReadStrptrMaybe(parent.repeat, strval); + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -347,6 +351,17 @@ bool atfdb::Comptest_ReadStrptrMaybe(atfdb::Comptest &parent, algo::strptr in_st return retval; } +// --- atfdb.Comptest..Init +// Set all fields to initial values. +void atfdb::Comptest_Init(atfdb::Comptest& parent) { + parent.timeout = i32(10); + parent.memcheck = bool(true); + parent.coverage = bool(true); + parent.exit_code = u8(0); + parent.ncore = i32(1); + parent.repeat = i32(1); +} + // --- atfdb.Comptest..Print // print string representation of ROW to string STR // cfmt:atfdb.Comptest.String printfmt:Tuple @@ -363,9 +378,18 @@ void atfdb::Comptest_Print(atfdb::Comptest& row, algo::cstring& str) { bool_Print(row.memcheck, temp); PrintAttrSpaceReset(str,"memcheck", temp); + bool_Print(row.coverage, temp); + PrintAttrSpaceReset(str,"coverage", temp); + u8_Print(row.exit_code, temp); PrintAttrSpaceReset(str,"exit_code", temp); + i32_Print(row.ncore, temp); + PrintAttrSpaceReset(str,"ncore", temp); + + i32_Print(row.repeat, temp); + PrintAttrSpaceReset(str,"repeat", temp); + algo::Comment_Print(row.comment, temp); PrintAttrSpaceReset(str,"comment", temp); } @@ -390,7 +414,10 @@ const char* atfdb::value_ToCstr(const atfdb::FieldId& parent) { case atfdb_FieldId_testname : ret = "testname"; break; case atfdb_FieldId_timeout : ret = "timeout"; break; case atfdb_FieldId_memcheck : ret = "memcheck"; break; + case atfdb_FieldId_coverage : ret = "coverage"; break; case atfdb_FieldId_exit_code : ret = "exit_code"; break; + case atfdb_FieldId_ncore : ret = "ncore"; break; + case atfdb_FieldId_repeat : ret = "repeat"; break; case atfdb_FieldId_fuzzstrat : ret = "fuzzstrat"; break; case atfdb_FieldId_msgdir : ret = "msgdir"; break; case atfdb_FieldId_args : ret = "args"; break; @@ -404,6 +431,8 @@ const char* atfdb::value_ToCstr(const atfdb::FieldId& parent) { case atfdb_FieldId_istuple : ret = "istuple"; break; case atfdb_FieldId_msg : ret = "msg"; break; case atfdb_FieldId_unittest : ret = "unittest"; break; + case atfdb_FieldId_ns : ret = "ns"; break; + case atfdb_FieldId_var : ret = "var"; break; case atfdb_FieldId_value : ret = "value"; break; } return ret; @@ -428,6 +457,14 @@ void atfdb::value_Print(const atfdb::FieldId& parent, algo::cstring &lhs) { bool atfdb::value_SetStrptrMaybe(atfdb::FieldId& parent, algo::strptr rhs) { bool ret = false; switch (elems_N(rhs)) { + case 2: { + switch (u64(algo::ReadLE16(rhs.elems))) { + case LE_STR2('n','s'): { + value_SetEnum(parent,atfdb_FieldId_ns); ret = true; break; + } + } + break; + } case 3: { switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { case LE_STR3('d','i','r'): { @@ -436,6 +473,9 @@ bool atfdb::value_SetStrptrMaybe(atfdb::FieldId& parent, algo::strptr rhs) { case LE_STR3('m','s','g'): { value_SetEnum(parent,atfdb_FieldId_msg); ret = true; break; } + case LE_STR3('v','a','r'): { + value_SetEnum(parent,atfdb_FieldId_var); ret = true; break; + } } break; } @@ -461,6 +501,9 @@ bool atfdb::value_SetStrptrMaybe(atfdb::FieldId& parent, algo::strptr rhs) { case LE_STR5('c','i','j','o','b'): { value_SetEnum(parent,atfdb_FieldId_cijob); ret = true; break; } + case LE_STR5('n','c','o','r','e'): { + value_SetEnum(parent,atfdb_FieldId_ncore); ret = true; break; + } case LE_STR5('v','a','l','u','e'): { value_SetEnum(parent,atfdb_FieldId_value); ret = true; break; } @@ -481,6 +524,9 @@ bool atfdb::value_SetStrptrMaybe(atfdb::FieldId& parent, algo::strptr rhs) { case LE_STR6('r','e','m','o','v','e'): { value_SetEnum(parent,atfdb_FieldId_remove); ret = true; break; } + case LE_STR6('r','e','p','e','a','t'): { + value_SetEnum(parent,atfdb_FieldId_repeat); ret = true; break; + } case LE_STR6('t','a','r','g','e','t'): { value_SetEnum(parent,atfdb_FieldId_target); ret = true; break; } @@ -515,6 +561,9 @@ bool atfdb::value_SetStrptrMaybe(atfdb::FieldId& parent, algo::strptr rhs) { case LE_STR8('c','o','m','p','t','e','s','t'): { value_SetEnum(parent,atfdb_FieldId_comptest); ret = true; break; } + case LE_STR8('c','o','v','e','r','a','g','e'): { + value_SetEnum(parent,atfdb_FieldId_coverage); ret = true; break; + } case LE_STR8('m','e','m','c','h','e','c','k'): { value_SetEnum(parent,atfdb_FieldId_memcheck); ret = true; break; } @@ -609,13 +658,14 @@ bool atfdb::Fuzzstrat_ReadFieldMaybe(atfdb::Fuzzstrat& parent, algo::strptr fiel switch(field_id) { case atfdb_FieldId_fuzzstrat: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.fuzzstrat, strval); - break; - } + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -657,13 +707,14 @@ bool atfdb::Msgdir_ReadFieldMaybe(atfdb::Msgdir& parent, algo::strptr field, alg switch(field_id) { case atfdb_FieldId_msgdir: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.msgdir, strval); - break; - } + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -705,13 +756,14 @@ bool atfdb::Targs_ReadFieldMaybe(atfdb::Targs& parent, algo::strptr field, algo: switch(field_id) { case atfdb_FieldId_comptest: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.comptest, strval); - break; - } + } break; case atfdb_FieldId_args: { retval = algo::cstring_ReadStrptrMaybe(parent.args, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -753,13 +805,14 @@ bool atfdb::TestGsymbolChar_ReadFieldMaybe(atfdb::TestGsymbolChar& parent, algo: switch(field_id) { case atfdb_FieldId_test_gsymbol_char: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.test_gsymbol_char, strval); - break; - } + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -801,13 +854,14 @@ bool atfdb::TestGsymbolPkey_ReadFieldMaybe(atfdb::TestGsymbolPkey& parent, algo: switch(field_id) { case atfdb_FieldId_test_gsymbol_pkey: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.test_gsymbol_pkey, strval); - break; - } + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -849,13 +903,14 @@ bool atfdb::TestGsymbolStrptr_ReadFieldMaybe(atfdb::TestGsymbolStrptr& parent, a switch(field_id) { case atfdb_FieldId_test_gsymbol_strptr: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.test_gsymbol_strptr, strval); - break; - } + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -897,17 +952,17 @@ bool atfdb::Tfilt_ReadFieldMaybe(atfdb::Tfilt& parent, algo::strptr field, algo: switch(field_id) { case atfdb_FieldId_comptest: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.comptest, strval); - break; - } + } break; case atfdb_FieldId_filter: { retval = algo::cstring_ReadStrptrMaybe(parent.filter, strval); - break; - } + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -997,29 +1052,26 @@ bool atfdb::Tmsg_ReadFieldMaybe(atfdb::Tmsg& parent, algo::strptr field, algo::s switch(field_id) { case atfdb_FieldId_tmsg: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.tmsg, strval); - break; - } + } break; case atfdb_FieldId_comptest: { retval = false; - break; - } + } break; case atfdb_FieldId_rank: { retval = false; - break; - } + } break; case atfdb_FieldId_dir: { retval = false; - break; - } + } break; case atfdb_FieldId_istuple: { retval = bool_ReadStrptrMaybe(parent.istuple, strval); - break; - } + } break; case atfdb_FieldId_msg: { retval = algo::cstring_ReadStrptrMaybe(parent.msg, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1056,14 +1108,14 @@ void atfdb::Tmsg_Print(atfdb::Tmsg& row, algo::cstring& str) { PrintAttrSpaceReset(str,"msg", temp); } -// --- atfdb.Unittest.target.Get -algo::Smallstr16 atfdb::target_Get(atfdb::Unittest& parent) { +// --- atfdb.Unittest.ns.Get +algo::Smallstr16 atfdb::ns_Get(atfdb::Unittest& parent) { algo::Smallstr16 ret(algo::Pathcomp(parent.unittest, ".RL")); return ret; } -// --- atfdb.Unittest.target.Get2 -algo::Smallstr16 atfdb::Unittest_target_Get(algo::strptr arg) { +// --- atfdb.Unittest.ns.Get2 +algo::Smallstr16 atfdb::Unittest_ns_Get(algo::strptr arg) { algo::Smallstr16 ret(algo::Pathcomp(arg, ".RL")); return ret; } @@ -1080,9 +1132,9 @@ algo::Smallstr50 atfdb::Unittest_testname_Get(algo::strptr arg) { return ret; } -// --- atfdb.Unittest..Concat_target_testname -tempstr atfdb::Unittest_Concat_target_testname( const algo::strptr& target ,const algo::strptr& testname ) { - return tempstr() << target <<'.'<< testname ; +// --- atfdb.Unittest..Concat_ns_testname +tempstr atfdb::Unittest_Concat_ns_testname( const algo::strptr& ns ,const algo::strptr& testname ) { + return tempstr() << ns <<'.'<< testname ; } // --- atfdb.Unittest..ReadFieldMaybe @@ -1093,21 +1145,20 @@ bool atfdb::Unittest_ReadFieldMaybe(atfdb::Unittest& parent, algo::strptr field, switch(field_id) { case atfdb_FieldId_unittest: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.unittest, strval); - break; - } - case atfdb_FieldId_target: { + } break; + case atfdb_FieldId_ns: { retval = false; - break; - } + } break; case atfdb_FieldId_testname: { retval = false; - break; - } + } break; case atfdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1154,6 +1205,61 @@ void atfdb::Unittest_Print(atfdb::Unittest& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } +// --- atfdb.Var..ReadFieldMaybe +bool atfdb::Var_ReadFieldMaybe(atfdb::Var& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + atfdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case atfdb_FieldId_var: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.var, strval); + } break; + case atfdb_FieldId_value: { + retval = algo::Smallstr100_ReadStrptrMaybe(parent.value, strval); + } break; + case atfdb_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- atfdb.Var..ReadStrptrMaybe +// Read fields of atfdb::Var from an ascii string. +// The format of the string is an ssim Tuple +bool atfdb::Var_ReadStrptrMaybe(atfdb::Var &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "atfdb.var") || algo::StripTypeTag(in_str, "atfdb.Var"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Var_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- atfdb.Var..Print +// print string representation of ROW to string STR +// cfmt:atfdb.Var.String printfmt:Tuple +void atfdb::Var_Print(atfdb::Var& row, algo::cstring& str) { + algo::tempstr temp; + str << "atfdb.var"; + + algo::Smallstr50_Print(row.var, temp); + PrintAttrSpaceReset(str,"var", temp); + + algo::Smallstr100_Print(row.value, temp); + PrintAttrSpaceReset(str,"value", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + // --- atfdb...SizeCheck inline static void atfdb::SizeCheck() { } diff --git a/cpp/gen/bash2html_gen.cpp b/cpp/gen/bash2html_gen.cpp index fac34aaa..842ed654 100644 --- a/cpp/gen/bash2html_gen.cpp +++ b/cpp/gen/bash2html_gen.cpp @@ -27,12 +27,15 @@ #include "include/gen/bash2html_gen.inl.h" #include "include/gen/command_gen.h" #include "include/gen/command_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep bash2html::FDb bash2html::_db; // dependency found via dev.targdep @@ -43,8 +46,8 @@ const char *bash2html_help = " OPTION TYPE DFLT COMMENT\n" " -in string \"data\" Input directory or filename, - for stdin\n" " -test Produce Test Output\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -144,9 +147,8 @@ void bash2html::ReadArgv() { } if (ch_N(attrname) == 0) { err << "bash2html: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:bash2html.FDb.cmdline @@ -200,7 +205,7 @@ void bash2html::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -267,8 +272,8 @@ bool bash2html::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && bash2html::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -442,11 +447,13 @@ void bash2html::StaticCheck() { // --- bash2html...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); bash2html::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock bash2html::ReadArgv(); // dmmeta.main:bash2html bash2html::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -459,6 +466,7 @@ int main(int argc, char **argv) { try { bash2html::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/command_gen.cpp b/cpp/gen/command_gen.cpp index ba4f9d1c..ea4691bf 100644 --- a/cpp/gen/command_gen.cpp +++ b/cpp/gen/command_gen.cpp @@ -67,7 +67,7 @@ const char* command::value_ToCstr(const command::FieldId& parent) { case command_FieldId_jcdb : ret = "jcdb"; break; case command_FieldId_cache : ret = "cache"; break; case command_FieldId_shortlink : ret = "shortlink"; break; - case command_FieldId_readme : ret = "readme"; break; + case command_FieldId_readmefile : ret = "readmefile"; break; case command_FieldId_ns : ret = "ns"; break; case command_FieldId_section : ret = "section"; break; case command_FieldId_update : ret = "update"; break; @@ -154,6 +154,7 @@ const char* command::value_ToCstr(const command::FieldId& parent) { case command_FieldId_showcpp : ret = "showcpp"; break; case command_FieldId_msgtype : ret = "msgtype"; break; case command_FieldId_anonfld : ret = "anonfld"; break; + case command_FieldId_amc : ret = "amc"; break; case command_FieldId_sigcheck : ret = "sigcheck"; break; case command_FieldId_data_dir : ret = "data_dir"; break; case command_FieldId_related : ret = "related"; break; @@ -170,6 +171,7 @@ const char* command::value_ToCstr(const command::FieldId& parent) { case command_FieldId_in_dir : ret = "in_dir"; break; case command_FieldId_out_dir : ret = "out_dir"; break; case command_FieldId_proto : ret = "proto"; break; + case command_FieldId_showcomment : ret = "showcomment"; break; case command_FieldId_trace : ret = "trace"; break; case command_FieldId_key : ret = "key"; break; case command_FieldId_include : ret = "include"; break; @@ -209,6 +211,7 @@ const char* command::value_ToCstr(const command::FieldId& parent) { case command_FieldId_q : ret = "q"; break; case command_FieldId_cijob : ret = "cijob"; break; case command_FieldId_capture : ret = "capture"; break; + case command_FieldId_check_clean : ret = "check_clean"; break; case command_FieldId_exec : ret = "exec"; break; case command_FieldId_astr : ret = "astr"; break; case command_FieldId_anum : ret = "anum"; break; @@ -237,13 +240,16 @@ const char* command::value_ToCstr(const command::FieldId& parent) { case command_FieldId_normalize : ret = "normalize"; break; case command_FieldId_covcapture : ret = "covcapture"; break; case command_FieldId_covcheck : ret = "covcheck"; break; - case command_FieldId_compdir : ret = "compdir"; break; + case command_FieldId_bindir : ret = "bindir"; break; case command_FieldId_check_untracked: ret = "check_untracked"; break; case command_FieldId_memcheck : ret = "memcheck"; break; case command_FieldId_callgrind : ret = "callgrind"; break; case command_FieldId_stream : ret = "stream"; break; case command_FieldId_i : ret = "i"; break; case command_FieldId_b : ret = "b"; break; + case command_FieldId_covfast : ret = "covfast"; break; + case command_FieldId_minrepeat : ret = "minrepeat"; break; + case command_FieldId_maxrepeat : ret = "maxrepeat"; break; case command_FieldId_covdir : ret = "covdir"; break; case command_FieldId_logfile : ret = "logfile"; break; case command_FieldId_runcmd : ret = "runcmd"; break; @@ -253,6 +259,9 @@ const char* command::value_ToCstr(const command::FieldId& parent) { case command_FieldId_ssim : ret = "ssim"; break; case command_FieldId_xmlpretty : ret = "xmlpretty"; break; case command_FieldId_summary : ret = "summary"; break; + case command_FieldId_incremental : ret = "incremental"; break; + case command_FieldId_tempdir : ret = "tempdir"; break; + case command_FieldId_dbgshell : ret = "dbgshell"; break; case command_FieldId_reprofile : ret = "reprofile"; break; case command_FieldId_args : ret = "args"; break; case command_FieldId_inputfile : ret = "inputfile"; break; @@ -283,7 +292,11 @@ const char* command::value_ToCstr(const command::FieldId& parent) { case command_FieldId_authdir : ret = "authdir"; break; case command_FieldId_gitdir : ret = "gitdir"; break; case command_FieldId_show_gitlab_system_notes: ret = "show_gitlab_system_notes"; break; + case command_FieldId_file : ret = "file"; break; + case command_FieldId_kv : ret = "kv"; break; + case command_FieldId_output : ret = "output"; break; case command_FieldId_attach : ret = "attach"; break; + case command_FieldId_pid : ret = "pid"; break; case command_FieldId_catchthrow : ret = "catchthrow"; break; case command_FieldId_tui : ret = "tui"; break; case command_FieldId_bcmd : ret = "bcmd"; break; @@ -291,6 +304,7 @@ const char* command::value_ToCstr(const command::FieldId& parent) { case command_FieldId_manywin : ret = "manywin"; break; case command_FieldId_follow_child : ret = "follow_child"; break; case command_FieldId_py : ret = "py"; break; + case command_FieldId_mp : ret = "mp"; break; case command_FieldId_writessimfile : ret = "writessimfile"; break; case command_FieldId_url : ret = "url"; break; case command_FieldId_tables : ret = "tables"; break; @@ -301,27 +315,35 @@ const char* command::value_ToCstr(const command::FieldId& parent) { case command_FieldId_commit : ret = "commit"; break; case command_FieldId_undo : ret = "undo"; break; case command_FieldId_hash : ret = "hash"; break; + case command_FieldId_parse_make : ret = "parse_make"; break; + case command_FieldId_makefile : ret = "makefile"; break; case command_FieldId_expr : ret = "expr"; break; case command_FieldId_style : ret = "style"; break; + case command_FieldId_full : ret = "full"; break; + case command_FieldId_f : ret = "f"; break; case command_FieldId_match : ret = "match"; break; case command_FieldId_string : ret = "string"; break; - case command_FieldId_show : ret = "show"; break; case command_FieldId_name : ret = "name"; break; case command_FieldId_files : ret = "files"; break; case command_FieldId_refs : ret = "refs"; break; - case command_FieldId_body : ret = "body"; break; case command_FieldId_targsrc : ret = "targsrc"; break; + case command_FieldId_acrkey : ret = "acrkey"; break; case command_FieldId_func : ret = "func"; break; case command_FieldId_nextfile : ret = "nextfile"; break; case command_FieldId_other : ret = "other"; break; case command_FieldId_updateproto : ret = "updateproto"; break; - case command_FieldId_listfunc : ret = "listfunc"; break; + case command_FieldId_createmissing : ret = "createmissing"; break; case command_FieldId_iffy : ret = "iffy"; break; case command_FieldId_gen : ret = "gen"; break; case command_FieldId_showloc : ret = "showloc"; break; case command_FieldId_showstatic : ret = "showstatic"; break; + case command_FieldId_matchproto : ret = "matchproto"; break; + case command_FieldId_matchbody : ret = "matchbody"; break; + case command_FieldId_matchcomment : ret = "matchcomment"; break; case command_FieldId_showsortkey : ret = "showsortkey"; break; + case command_FieldId_showbody : ret = "showbody"; break; case command_FieldId_sortname : ret = "sortname"; break; + case command_FieldId_printssim : ret = "printssim"; break; case command_FieldId_baddecl : ret = "baddecl"; break; case command_FieldId_indent : ret = "indent"; break; case command_FieldId_update_copyright: ret = "update_copyright"; break; @@ -379,6 +401,9 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case 'e': { value_SetEnum(parent,command_FieldId_e); ret = true; break; } + case 'f': { + value_SetEnum(parent,command_FieldId_f); ret = true; break; + } case 'g': { value_SetEnum(parent,command_FieldId_g); ret = true; break; } @@ -417,6 +442,12 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR2('i','n'): { value_SetEnum(parent,command_FieldId_in); ret = true; break; } + case LE_STR2('k','v'): { + value_SetEnum(parent,command_FieldId_kv); ret = true; break; + } + case LE_STR2('m','p'): { + value_SetEnum(parent,command_FieldId_mp); ret = true; break; + } case LE_STR2('m','r'): { value_SetEnum(parent,command_FieldId_mr); ret = true; break; } @@ -434,6 +465,9 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { } case 3: { switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('a','m','c'): { + value_SetEnum(parent,command_FieldId_amc); ret = true; break; + } case LE_STR3('a','r','g'): { value_SetEnum(parent,command_FieldId_arg); ret = true; break; } @@ -473,6 +507,9 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR3('o','o','d'): { value_SetEnum(parent,command_FieldId_ood); ret = true; break; } + case LE_STR3('p','i','d'): { + value_SetEnum(parent,command_FieldId_pid); ret = true; break; + } case LE_STR3('r','e','f'): { value_SetEnum(parent,command_FieldId_ref); ret = true; break; } @@ -523,9 +560,6 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR4('b','c','m','d'): { value_SetEnum(parent,command_FieldId_bcmd); ret = true; break; } - case LE_STR4('b','o','d','y'): { - value_SetEnum(parent,command_FieldId_body); ret = true; break; - } case LE_STR4('d','a','t','a'): { value_SetEnum(parent,command_FieldId_data); ret = true; break; } @@ -550,12 +584,18 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR4('e','x','p','r'): { value_SetEnum(parent,command_FieldId_expr); ret = true; break; } + case LE_STR4('f','i','l','e'): { + value_SetEnum(parent,command_FieldId_file); ret = true; break; + } case LE_STR4('f','k','e','y'): { value_SetEnum(parent,command_FieldId_fkey); ret = true; break; } case LE_STR4('f','l','a','g'): { value_SetEnum(parent,command_FieldId_flag); ret = true; break; } + case LE_STR4('f','u','l','l'): { + value_SetEnum(parent,command_FieldId_full); ret = true; break; + } case LE_STR4('f','u','n','c'): { value_SetEnum(parent,command_FieldId_func); ret = true; break; } @@ -625,9 +665,6 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR4('s','e','r','v'): { value_SetEnum(parent,command_FieldId_serv); ret = true; break; } - case LE_STR4('s','h','o','w'): { - value_SetEnum(parent,command_FieldId_show); ret = true; break; - } case LE_STR4('s','s','i','m'): { value_SetEnum(parent,command_FieldId_ssim); ret = true; break; } @@ -797,6 +834,9 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR6('a','c','c','e','p','t'): { value_SetEnum(parent,command_FieldId_accept); ret = true; break; } + case LE_STR6('a','c','r','k','e','y'): { + value_SetEnum(parent,command_FieldId_acrkey); ret = true; break; + } case LE_STR6('a','n','c','h','o','r'): { value_SetEnum(parent,command_FieldId_anchor); ret = true; break; } @@ -809,6 +849,9 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR6('b','i','g','e','n','d'): { value_SetEnum(parent,command_FieldId_bigend); ret = true; break; } + case LE_STR6('b','i','n','d','i','r'): { + value_SetEnum(parent,command_FieldId_bindir); ret = true; break; + } case LE_STR6('c','c','o','n','s','t'): { value_SetEnum(parent,command_FieldId_cconst); ret = true; break; } @@ -878,12 +921,12 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR6('o','r','i','g','i','n'): { value_SetEnum(parent,command_FieldId_origin); ret = true; break; } + case LE_STR6('o','u','t','p','u','t'): { + value_SetEnum(parent,command_FieldId_output); ret = true; break; + } case LE_STR6('p','r','e','t','t','y'): { value_SetEnum(parent,command_FieldId_pretty); ret = true; break; } - case LE_STR6('r','e','a','d','m','e'): { - value_SetEnum(parent,command_FieldId_readme); ret = true; break; - } case LE_STR6('r','e','g','x','o','f'): { value_SetEnum(parent,command_FieldId_regxof); ret = true; break; } @@ -976,8 +1019,8 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR7('c','o','m','m','e','n','t'): { value_SetEnum(parent,command_FieldId_comment); ret = true; break; } - case LE_STR7('c','o','m','p','d','i','r'): { - value_SetEnum(parent,command_FieldId_compdir); ret = true; break; + case LE_STR7('c','o','v','f','a','s','t'): { + value_SetEnum(parent,command_FieldId_covfast); ret = true; break; } case LE_STR7('c','p','p','f','u','n','c'): { value_SetEnum(parent,command_FieldId_cppfunc); ret = true; break; @@ -1096,6 +1139,9 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR7('t','a','r','g','s','r','c'): { value_SetEnum(parent,command_FieldId_targsrc); ret = true; break; } + case LE_STR7('t','e','m','p','d','i','r'): { + value_SetEnum(parent,command_FieldId_tempdir); ret = true; break; + } case LE_STR7('t','i','m','e','o','u','t'): { value_SetEnum(parent,command_FieldId_timeout); ret = true; break; } @@ -1131,15 +1177,18 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR8('d','a','t','a','_','d','i','r'): { value_SetEnum(parent,command_FieldId_data_dir); ret = true; break; } + case LE_STR8('d','b','g','s','h','e','l','l'): { + value_SetEnum(parent,command_FieldId_dbgshell); ret = true; break; + } case LE_STR8('e','x','t','e','r','n','a','l'): { value_SetEnum(parent,command_FieldId_external); ret = true; break; } - case LE_STR8('l','i','s','t','f','u','n','c'): { - value_SetEnum(parent,command_FieldId_listfunc); ret = true; break; - } case LE_STR8('l','i','s','t','i','n','c','l'): { value_SetEnum(parent,command_FieldId_listincl); ret = true; break; } + case LE_STR8('m','a','k','e','f','i','l','e'): { + value_SetEnum(parent,command_FieldId_makefile); ret = true; break; + } case LE_STR8('m','a','x','g','r','o','u','p'): { value_SetEnum(parent,command_FieldId_maxgroup); ret = true; break; } @@ -1161,6 +1210,9 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { case LE_STR8('s','e','l','e','c','t','o','r'): { value_SetEnum(parent,command_FieldId_selector); ret = true; break; } + case LE_STR8('s','h','o','w','b','o','d','y'): { + value_SetEnum(parent,command_FieldId_showbody); ret = true; break; + } case LE_STR8('s','h','o','w','f','i','l','e'): { value_SetEnum(parent,command_FieldId_showfile); ret = true; break; } @@ -1207,14 +1259,26 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"e",1)==0) { value_SetEnum(parent,command_FieldId_inputfile); ret = true; break; } break; } + case LE_STR8('m','a','t','c','h','b','o','d'): { + if (memcmp(rhs.elems+8,"y",1)==0) { value_SetEnum(parent,command_FieldId_matchbody); ret = true; break; } + break; + } case LE_STR8('m','a','x','p','a','c','k','e'): { if (memcmp(rhs.elems+8,"t",1)==0) { value_SetEnum(parent,command_FieldId_maxpacket); ret = true; break; } break; } + case LE_STR8('m','a','x','r','e','p','e','a'): { + if (memcmp(rhs.elems+8,"t",1)==0) { value_SetEnum(parent,command_FieldId_maxrepeat); ret = true; break; } + break; + } case LE_STR8('m','e','r','g','e','p','a','t'): { if (memcmp(rhs.elems+8,"h",1)==0) { value_SetEnum(parent,command_FieldId_mergepath); ret = true; break; } break; } + case LE_STR8('m','i','n','r','e','p','e','a'): { + if (memcmp(rhs.elems+8,"t",1)==0) { value_SetEnum(parent,command_FieldId_minrepeat); ret = true; break; } + break; + } case LE_STR8('n','o','r','m','a','l','i','z'): { if (memcmp(rhs.elems+8,"e",1)==0) { value_SetEnum(parent,command_FieldId_normalize); ret = true; break; } break; @@ -1223,6 +1287,10 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"s",1)==0) { value_SetEnum(parent,command_FieldId_perf_secs); ret = true; break; } break; } + case LE_STR8('p','r','i','n','t','s','s','i'): { + if (memcmp(rhs.elems+8,"m",1)==0) { value_SetEnum(parent,command_FieldId_printssim); ret = true; break; } + break; + } case LE_STR8('r','e','c','v','d','e','l','a'): { if (memcmp(rhs.elems+8,"y",1)==0) { value_SetEnum(parent,command_FieldId_recvdelay); ret = true; break; } break; @@ -1272,14 +1340,26 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"st",2)==0) { value_SetEnum(parent,command_FieldId_gtblacttst); ret = true; break; } break; } + case LE_STR8('m','a','t','c','h','p','r','o'): { + if (memcmp(rhs.elems+8,"to",2)==0) { value_SetEnum(parent,command_FieldId_matchproto); ret = true; break; } + break; + } case LE_STR8('n','e','e','d','s','_','w','o'): { if (memcmp(rhs.elems+8,"rk",2)==0) { value_SetEnum(parent,command_FieldId_needs_work); ret = true; break; } break; } + case LE_STR8('p','a','r','s','e','_','m','a'): { + if (memcmp(rhs.elems+8,"ke",2)==0) { value_SetEnum(parent,command_FieldId_parse_make); ret = true; break; } + break; + } case LE_STR8('p','r','i','n','t','i','n','p'): { if (memcmp(rhs.elems+8,"ut",2)==0) { value_SetEnum(parent,command_FieldId_printinput); ret = true; break; } break; } + case LE_STR8('r','e','a','d','m','e','f','i'): { + if (memcmp(rhs.elems+8,"le",2)==0) { value_SetEnum(parent,command_FieldId_readmefile); ret = true; break; } + break; + } case LE_STR8('s','c','r','i','p','t','f','i'): { if (memcmp(rhs.elems+8,"le",2)==0) { value_SetEnum(parent,command_FieldId_scriptfile); ret = true; break; } break; @@ -1297,6 +1377,10 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { } case 11: { switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','h','e','c','k','_','c','l'): { + if (memcmp(rhs.elems+8,"ean",3)==0) { value_SetEnum(parent,command_FieldId_check_clean); ret = true; break; } + break; + } case LE_STR8('f','i','l','e','_','p','r','e'): { if (memcmp(rhs.elems+8,"fix",3)==0) { value_SetEnum(parent,command_FieldId_file_prefix); ret = true; break; } break; @@ -1305,6 +1389,10 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"ote",3)==0) { value_SetEnum(parent,command_FieldId_ignoreQuote); ret = true; break; } break; } + case LE_STR8('i','n','c','r','e','m','e','n'): { + if (memcmp(rhs.elems+8,"tal",3)==0) { value_SetEnum(parent,command_FieldId_incremental); ret = true; break; } + break; + } case LE_STR8('m','s','g','s','i','z','e','_'): { if (memcmp(rhs.elems+8,"min",3)==0) { value_SetEnum(parent,command_FieldId_msgsize_min); ret = true; break; } if (memcmp(rhs.elems+8,"max",3)==0) { value_SetEnum(parent,command_FieldId_msgsize_max); ret = true; break; } @@ -1314,6 +1402,10 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"ile",3)==0) { value_SetEnum(parent,command_FieldId_notssimfile); ret = true; break; } break; } + case LE_STR8('s','h','o','w','c','o','m','m'): { + if (memcmp(rhs.elems+8,"ent",3)==0) { value_SetEnum(parent,command_FieldId_showcomment); ret = true; break; } + break; + } case LE_STR8('s','h','o','w','s','o','r','t'): { if (memcmp(rhs.elems+8,"key",3)==0) { value_SetEnum(parent,command_FieldId_showsortkey); ret = true; break; } break; @@ -1335,6 +1427,10 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"hild",4)==0) { value_SetEnum(parent,command_FieldId_follow_child); ret = true; break; } break; } + case LE_STR8('m','a','t','c','h','c','o','m'): { + if (memcmp(rhs.elems+8,"ment",4)==0) { value_SetEnum(parent,command_FieldId_matchcomment); ret = true; break; } + break; + } case LE_STR8('o','u','t','s','e','p','a','r'): { if (memcmp(rhs.elems+8,"ator",4)==0) { value_SetEnum(parent,command_FieldId_outseparator); ret = true; break; } break; @@ -1356,6 +1452,10 @@ bool command::value_SetStrptrMaybe(command::FieldId& parent, algo::strptr rhs) { } case 13: { switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','r','e','a','t','e','m','i'): { + if (memcmp(rhs.elems+8,"ssing",5)==0) { value_SetEnum(parent,command_FieldId_createmissing); ret = true; break; } + break; + } case LE_STR8('p','r','e','f','e','r','_','s'): { if (memcmp(rhs.elems+8,"igned",5)==0) { value_SetEnum(parent,command_FieldId_prefer_signed); ret = true; break; } break; @@ -1595,109 +1695,86 @@ bool command::abt_ReadFieldMaybe(command::abt& parent, algo::strptr field, algo: switch(field_id) { case command_FieldId_target: { retval = target_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_cfg: { retval = cfg_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_compiler: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.compiler, strval); - break; - } + } break; case command_FieldId_uname: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.uname, strval); - break; - } + } break; case command_FieldId_arch: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.arch, strval); - break; - } + } break; case command_FieldId_ood: { retval = bool_ReadStrptrMaybe(parent.ood, strval); - break; - } + } break; case command_FieldId_list: { retval = bool_ReadStrptrMaybe(parent.list, strval); - break; - } + } break; case command_FieldId_listincl: { retval = bool_ReadStrptrMaybe(parent.listincl, strval); - break; - } + } break; case command_FieldId_build: { retval = bool_ReadStrptrMaybe(parent.build, strval); - break; - } + } break; case command_FieldId_preproc: { retval = bool_ReadStrptrMaybe(parent.preproc, strval); - break; - } + } break; case command_FieldId_srcfile: { retval = srcfile_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_clean: { retval = bool_ReadStrptrMaybe(parent.clean, strval); - break; - } + } break; case command_FieldId_dry_run: { retval = bool_ReadStrptrMaybe(parent.dry_run, strval); - break; - } + } break; case command_FieldId_maxjobs: { retval = i32_ReadStrptrMaybe(parent.maxjobs, strval); - break; - } + } break; case command_FieldId_printcmd: { retval = bool_ReadStrptrMaybe(parent.printcmd, strval); - break; - } + } break; case command_FieldId_force: { retval = bool_ReadStrptrMaybe(parent.force, strval); - break; - } + } break; case command_FieldId_install: { retval = bool_ReadStrptrMaybe(parent.install, strval); - break; - } + } break; case command_FieldId_coverity: { retval = bool_ReadStrptrMaybe(parent.coverity, strval); - break; - } + } break; case command_FieldId_package: { retval = algo::cstring_ReadStrptrMaybe(parent.package, strval); - break; - } + } break; case command_FieldId_maxerr: { retval = u32_ReadStrptrMaybe(parent.maxerr, strval); - break; - } + } break; case command_FieldId_disas: { retval = disas_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_report: { retval = bool_ReadStrptrMaybe(parent.report, strval); - break; - } + } break; case command_FieldId_jcdb: { retval = algo::cstring_ReadStrptrMaybe(parent.jcdb, strval); - break; - } + } break; case command_FieldId_cache: { retval = cache_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_shortlink: { retval = bool_ReadStrptrMaybe(parent.shortlink, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1949,106 +2026,106 @@ algo::strptr command::abt_GetAnon(command::abt &parent, i32 idx) { i32 command::abt_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_target: { // $comment + case command_FieldId_target: { // *out_anon = true; } break; - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_cfg: { // $comment + case command_FieldId_cfg: { // *out_anon = false; } break; - case command_FieldId_compiler: { // $comment + case command_FieldId_compiler: { // *out_anon = false; } break; - case command_FieldId_uname: { // $comment + case command_FieldId_uname: { // *out_anon = false; } break; - case command_FieldId_arch: { // $comment + case command_FieldId_arch: { // *out_anon = false; } break; - case command_FieldId_ood: { // $comment + case command_FieldId_ood: { // bool: no argument required but value may be specified as ood:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_list: { // bool: no argument required but value may be specified as ood:Y + case command_FieldId_list: { // bool: no argument required but value may be specified as list:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_listincl: { // bool: no argument required but value may be specified as list:Y + case command_FieldId_listincl: { // bool: no argument required but value may be specified as listincl:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_build: { // bool: no argument required but value may be specified as listincl:Y + case command_FieldId_build: { // bool: no argument required but value may be specified as build:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_preproc: { // bool: no argument required but value may be specified as build:Y + case command_FieldId_preproc: { // bool: no argument required but value may be specified as preproc:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_srcfile: { // bool: no argument required but value may be specified as preproc:Y + case command_FieldId_srcfile: { // *out_anon = false; } break; - case command_FieldId_clean: { // bool: no argument required but value may be specified as preproc:Y + case command_FieldId_clean: { // bool: no argument required but value may be specified as clean:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_dry_run: { // bool: no argument required but value may be specified as clean:Y + case command_FieldId_dry_run: { // bool: no argument required but value may be specified as dry_run:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_maxjobs: { // bool: no argument required but value may be specified as dry_run:Y + case command_FieldId_maxjobs: { // *out_anon = false; } break; - case command_FieldId_printcmd: { // bool: no argument required but value may be specified as dry_run:Y + case command_FieldId_printcmd: { // bool: no argument required but value may be specified as printcmd:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_force: { // bool: no argument required but value may be specified as printcmd:Y + case command_FieldId_force: { // bool: no argument required but value may be specified as force:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_install: { // bool: no argument required but value may be specified as force:Y + case command_FieldId_install: { // bool: no argument required but value may be specified as install:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_coverity: { // bool: no argument required but value may be specified as install:Y + case command_FieldId_coverity: { // bool: no argument required but value may be specified as coverity:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_package: { // bool: no argument required but value may be specified as coverity:Y + case command_FieldId_package: { // *out_anon = false; } break; - case command_FieldId_maxerr: { // bool: no argument required but value may be specified as coverity:Y + case command_FieldId_maxerr: { // *out_anon = false; } break; - case command_FieldId_disas: { // bool: no argument required but value may be specified as coverity:Y + case command_FieldId_disas: { // *out_anon = false; } break; - case command_FieldId_report: { // bool: no argument required but value may be specified as coverity:Y + case command_FieldId_report: { // bool: no argument required but value may be specified as report:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_jcdb: { // bool: no argument required but value may be specified as report:Y + case command_FieldId_jcdb: { // *out_anon = false; } break; - case command_FieldId_cache: { // bool: no argument required but value may be specified as report:Y + case command_FieldId_cache: { // *out_anon = false; } break; - case command_FieldId_shortlink: { // bool: no argument required but value may be specified as report:Y + case command_FieldId_shortlink: { // bool: no argument required but value may be specified as shortlink:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -2059,18 +2136,18 @@ i32 command::abt_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out return retval; } -// --- command.abt_md.readme.Print +// --- command.abt_md.readmefile.Print // Print back to string -void command::readme_Print(command::abt_md& parent, algo::cstring &out) { - Regx_Print(parent.readme, out); +void command::readmefile_Print(command::abt_md& parent, algo::cstring &out) { + Regx_Print(parent.readmefile, out); } -// --- command.abt_md.readme.ReadStrptrMaybe +// --- command.abt_md.readmefile.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::readme_ReadStrptrMaybe(command::abt_md& parent, algo::strptr in) { +bool command::readmefile_ReadStrptrMaybe(command::abt_md& parent, algo::strptr in) { bool retval = true; - Regx_ReadSql(parent.readme, in, true); + Regx_ReadSql(parent.readmefile, in, true); return retval; } @@ -2112,53 +2189,44 @@ bool command::abt_md_ReadFieldMaybe(command::abt_md& parent, algo::strptr field, switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_readme: { - retval = readme_ReadStrptrMaybe(parent, strval); - break; - } + } break; + case command_FieldId_readmefile: { + retval = readmefile_ReadStrptrMaybe(parent, strval); + } break; case command_FieldId_ns: { retval = ns_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_section: { retval = section_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_update: { retval = bool_ReadStrptrMaybe(parent.update, strval); - break; - } + } break; case command_FieldId_check: { retval = bool_ReadStrptrMaybe(parent.check, strval); - break; - } + } break; case command_FieldId_link: { retval = bool_ReadStrptrMaybe(parent.link, strval); - break; - } + } break; case command_FieldId_anchor: { retval = bool_ReadStrptrMaybe(parent.anchor, strval); - break; - } + } break; case command_FieldId_print: { retval = bool_ReadStrptrMaybe(parent.print, strval); - break; - } + } break; case command_FieldId_dry_run: { retval = bool_ReadStrptrMaybe(parent.dry_run, strval); - break; - } + } break; case command_FieldId_external: { retval = bool_ReadStrptrMaybe(parent.external, strval); - break; - } + } break; case command_FieldId_evalcmd: { retval = bool_ReadStrptrMaybe(parent.evalcmd, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2187,7 +2255,7 @@ bool command::abt_md_ReadTupleMaybe(command::abt_md &parent, algo::Tuple &tuple) // Set all fields to initial values. void command::abt_md_Init(command::abt_md& parent) { parent.in = algo::strptr("data"); - Regx_ReadSql(parent.readme, "%", true); + Regx_ReadSql(parent.readmefile, "%", true); Regx_ReadSql(parent.ns, "", true); Regx_ReadSql(parent.section, "%", true); parent.update = bool(true); @@ -2231,8 +2299,8 @@ void command::abt_md_PrintArgv(command::abt_md& row, algo::cstring& str) { strptr_PrintBash(temp,str); } ch_RemoveAll(temp); - command::readme_Print(const_cast(row), temp); - str << " -readme:"; + command::readmefile_Print(const_cast(row), temp); + str << " -readmefile:"; strptr_PrintBash(temp,str); if (!(row.ns.expr == "")) { ch_RemoveAll(temp); @@ -2298,7 +2366,7 @@ void command::abt_md_PrintArgv(command::abt_md& row, algo::cstring& str) { algo::strptr command::abt_md_GetAnon(command::abt_md &parent, i32 idx) { (void)parent;//only to avoid -Wunused-parameter switch(idx) { - case(0): return strptr("readme", 6); + case(0): return strptr("readmefile", 10); case(1): return strptr("section", 7); default: return algo::strptr(); } @@ -2311,54 +2379,54 @@ algo::strptr command::abt_md_GetAnon(command::abt_md &parent, i32 idx) { i32 command::abt_md_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_readme: { // $comment + case command_FieldId_readmefile: { // *out_anon = true; } break; - case command_FieldId_ns: { // $comment + case command_FieldId_ns: { // *out_anon = false; } break; - case command_FieldId_section: { // $comment + case command_FieldId_section: { // *out_anon = true; } break; - case command_FieldId_update: { // $comment + case command_FieldId_update: { // bool: no argument required but value may be specified as update:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_check: { // bool: no argument required but value may be specified as update:Y + case command_FieldId_check: { // bool: no argument required but value may be specified as check:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_link: { // bool: no argument required but value may be specified as check:Y + case command_FieldId_link: { // bool: no argument required but value may be specified as link:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_anchor: { // bool: no argument required but value may be specified as link:Y + case command_FieldId_anchor: { // bool: no argument required but value may be specified as anchor:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_print: { // bool: no argument required but value may be specified as anchor:Y + case command_FieldId_print: { // bool: no argument required but value may be specified as print:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_dry_run: { // bool: no argument required but value may be specified as print:Y + case command_FieldId_dry_run: { // bool: no argument required but value may be specified as dry_run:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_external: { // bool: no argument required but value may be specified as dry_run:Y + case command_FieldId_external: { // bool: no argument required but value may be specified as external:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_evalcmd: { // bool: no argument required but value may be specified as external:Y + case command_FieldId_evalcmd: { // bool: no argument required but value may be specified as evalcmd:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -2424,7 +2492,7 @@ algo::Fildes command::abt_md_StartRead(command::abt_md_proc& parent, algo_lib::F // --- command.abt_md_proc.abt_md.Kill // Kill subprocess and wait void command::abt_md_Kill(command::abt_md_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); abt_md_Wait(parent); } @@ -2513,10 +2581,10 @@ void command::abt_md_ToArgv(command::abt_md_proc& parent, algo::StringAry& args) cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.readme.expr != "%") { + if (parent.cmd.readmefile.expr != "%") { cstring *arg = &ary_Alloc(args); - *arg << "-readme:"; - command::readme_Print(parent.cmd, *arg); + *arg << "-readmefile:"; + command::readmefile_Print(parent.cmd, *arg); } if (parent.cmd.ns.expr != "") { @@ -2646,7 +2714,7 @@ algo::Fildes command::abt_StartRead(command::abt_proc& parent, algo_lib::FFildes // --- command.abt_proc.abt.Kill // Kill subprocess and wait void command::abt_Kill(command::abt_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); abt_Wait(parent); } @@ -2959,6 +3027,25 @@ algo::aryptr command::where_AllocN(command::acr& parent, int n_el return algo::aryptr(elems + old_n, n_elems); } +// --- command.acr.where.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::where_AllocNAt(command::acr& parent, int n_elems, int at) { + where_Reserve(parent, n_elems); + int n = parent.where_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.acr.where comment:'index out of range'"); + } + algo::cstring *elems = parent.where_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.where_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- command.acr.where.Remove // Remove item by index. If index outside of range, do nothing. void command::where_Remove(command::acr& parent, u32 i) { @@ -3055,6 +3142,30 @@ bool command::where_ReadStrptrMaybe(command::acr& parent, algo::strptr in_str) { return retval; } +// --- command.acr.where.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::where_Insary(command::acr& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.where_elems && rhs.elems < parent.where_elems + parent.where_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.acr.where comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.where_elems+1))) { + FatalErrorExit("command.bad_insary field:command.acr.where comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.where_n - at; + where_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.where_elems + at + nnew + i) algo::cstring(parent.where_elems[at + i]); + parent.where_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.where_elems + at + i) algo::cstring(rhs[i]); + } + parent.where_n += nnew; +} + // --- command.acr.field.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -3117,6 +3228,25 @@ algo::aryptr command::field_AllocN(command::acr& parent, int n_el return algo::aryptr(elems + old_n, n_elems); } +// --- command.acr.field.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::field_AllocNAt(command::acr& parent, int n_elems, int at) { + field_Reserve(parent, n_elems); + int n = parent.field_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.acr.field comment:'index out of range'"); + } + algo::cstring *elems = parent.field_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.field_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- command.acr.field.Remove // Remove item by index. If index outside of range, do nothing. void command::field_Remove(command::acr& parent, u32 i) { @@ -3213,6 +3343,30 @@ bool command::field_ReadStrptrMaybe(command::acr& parent, algo::strptr in_str) { return retval; } +// --- command.acr.field.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::field_Insary(command::acr& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.field_elems && rhs.elems < parent.field_elems + parent.field_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.acr.field comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.field_elems+1))) { + FatalErrorExit("command.bad_insary field:command.acr.field comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.field_n - at; + field_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.field_elems + at + nnew + i) algo::cstring(parent.field_elems[at + i]); + parent.field_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.field_elems + at + i) algo::cstring(rhs[i]); + } + parent.field_n += nnew; +} + // --- command.acr..ReadFieldMaybe bool command::acr_ReadFieldMaybe(command::acr& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -3221,161 +3375,125 @@ bool command::acr_ReadFieldMaybe(command::acr& parent, algo::strptr field, algo: switch(field_id) { case command_FieldId_query: { retval = algo::cstring_ReadStrptrMaybe(parent.query, strval); - break; - } + } break; case command_FieldId_where: { retval = where_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_del: { retval = bool_ReadStrptrMaybe(parent.del, strval); - break; - } + } break; case command_FieldId_sel: { retval = bool_ReadStrptrMaybe(parent.sel, strval); - break; - } + } break; case command_FieldId_insert: { retval = bool_ReadStrptrMaybe(parent.insert, strval); - break; - } + } break; case command_FieldId_replace: { retval = bool_ReadStrptrMaybe(parent.replace, strval); - break; - } + } break; case command_FieldId_update: { retval = bool_ReadStrptrMaybe(parent.update, strval); - break; - } + } break; case command_FieldId_merge: { retval = bool_ReadStrptrMaybe(parent.merge, strval); - break; - } + } break; case command_FieldId_unused: { retval = bool_ReadStrptrMaybe(parent.unused, strval); - break; - } + } break; case command_FieldId_trunc: { retval = bool_ReadStrptrMaybe(parent.trunc, strval); - break; - } + } break; case command_FieldId_check: { retval = bool_ReadStrptrMaybe(parent.check, strval); - break; - } + } break; case command_FieldId_selerr: { retval = bool_ReadStrptrMaybe(parent.selerr, strval); - break; - } + } break; case command_FieldId_maxshow: { retval = i32_ReadStrptrMaybe(parent.maxshow, strval); - break; - } + } break; case command_FieldId_write: { retval = bool_ReadStrptrMaybe(parent.write, strval); - break; - } + } break; case command_FieldId_rename: { retval = algo::cstring_ReadStrptrMaybe(parent.rename, strval); - break; - } + } break; case command_FieldId_nup: { retval = i32_ReadStrptrMaybe(parent.nup, strval); - break; - } + } break; case command_FieldId_ndown: { retval = i32_ReadStrptrMaybe(parent.ndown, strval); - break; - } + } break; case command_FieldId_l: { retval = bool_ReadStrptrMaybe(parent.l, strval); - break; - } + } break; case command_FieldId_xref: { retval = bool_ReadStrptrMaybe(parent.xref, strval); - break; - } + } break; case command_FieldId_fldfunc: { retval = bool_ReadStrptrMaybe(parent.fldfunc, strval); - break; - } + } break; case command_FieldId_maxgroup: { retval = i32_ReadStrptrMaybe(parent.maxgroup, strval); - break; - } + } break; case command_FieldId_pretty: { retval = bool_ReadStrptrMaybe(parent.pretty, strval); - break; - } + } break; case command_FieldId_tree: { retval = bool_ReadStrptrMaybe(parent.tree, strval); - break; - } + } break; case command_FieldId_loose: { retval = bool_ReadStrptrMaybe(parent.loose, strval); - break; - } + } break; case command_FieldId_my: { retval = bool_ReadStrptrMaybe(parent.my, strval); - break; - } + } break; case command_FieldId_schema: { retval = algo::cstring_ReadStrptrMaybe(parent.schema, strval); - break; - } + } break; case command_FieldId_e: { retval = bool_ReadStrptrMaybe(parent.e, strval); - break; - } + } break; case command_FieldId_t: { retval = bool_ReadStrptrMaybe(parent.t, strval); - break; - } + } break; case command_FieldId_g: { retval = bool_ReadStrptrMaybe(parent.g, strval); - break; - } + } break; case command_FieldId_x: { retval = bool_ReadStrptrMaybe(parent.x, strval); - break; - } + } break; case command_FieldId_rowid: { retval = bool_ReadStrptrMaybe(parent.rowid, strval); - break; - } + } break; case command_FieldId_cmt: { retval = bool_ReadStrptrMaybe(parent.cmt, strval); - break; - } + } break; case command_FieldId_report: { retval = bool_ReadStrptrMaybe(parent.report, strval); - break; - } + } break; case command_FieldId_print: { retval = bool_ReadStrptrMaybe(parent.print, strval); - break; - } + } break; case command_FieldId_cmd: { retval = algo::cstring_ReadStrptrMaybe(parent.cmd, strval); - break; - } + } break; case command_FieldId_field: { retval = field_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_regxof: { retval = algo::cstring_ReadStrptrMaybe(parent.regxof, strval); - break; - } + } break; case command_FieldId_meta: { retval = bool_ReadStrptrMaybe(parent.meta, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3739,173 +3857,173 @@ algo::strptr command::acr_GetAnon(command::acr &parent, i32 idx) { i32 command::acr_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_query: { // $comment + case command_FieldId_query: { // *out_anon = true; } break; - case command_FieldId_where: { // $comment + case command_FieldId_where: { // *out_anon = false; } break; - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_del: { // $comment + case command_FieldId_del: { // bool: no argument required but value may be specified as del:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_sel: { // bool: no argument required but value may be specified as del:Y + case command_FieldId_sel: { // bool: no argument required but value may be specified as sel:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_insert: { // bool: no argument required but value may be specified as sel:Y + case command_FieldId_insert: { // bool: no argument required but value may be specified as insert:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_replace: { // bool: no argument required but value may be specified as insert:Y + case command_FieldId_replace: { // bool: no argument required but value may be specified as replace:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_update: { // bool: no argument required but value may be specified as replace:Y + case command_FieldId_update: { // bool: no argument required but value may be specified as update:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_merge: { // bool: no argument required but value may be specified as update:Y + case command_FieldId_merge: { // bool: no argument required but value may be specified as merge:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_unused: { // bool: no argument required but value may be specified as merge:Y + case command_FieldId_unused: { // bool: no argument required but value may be specified as unused:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_trunc: { // bool: no argument required but value may be specified as unused:Y + case command_FieldId_trunc: { // bool: no argument required but value may be specified as trunc:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_check: { // bool: no argument required but value may be specified as trunc:Y + case command_FieldId_check: { // bool: no argument required but value may be specified as check:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_selerr: { // bool: no argument required but value may be specified as check:Y + case command_FieldId_selerr: { // bool: no argument required but value may be specified as selerr:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_maxshow: { // bool: no argument required but value may be specified as selerr:Y + case command_FieldId_maxshow: { // *out_anon = false; } break; - case command_FieldId_write: { // bool: no argument required but value may be specified as selerr:Y + case command_FieldId_write: { // bool: no argument required but value may be specified as write:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_rename: { // bool: no argument required but value may be specified as write:Y + case command_FieldId_rename: { // *out_anon = false; } break; - case command_FieldId_nup: { // bool: no argument required but value may be specified as write:Y + case command_FieldId_nup: { // *out_anon = false; } break; - case command_FieldId_ndown: { // bool: no argument required but value may be specified as write:Y + case command_FieldId_ndown: { // *out_anon = false; } break; - case command_FieldId_l: { // bool: no argument required but value may be specified as write:Y + case command_FieldId_l: { // bool: no argument required but value may be specified as l:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_xref: { // bool: no argument required but value may be specified as l:Y + case command_FieldId_xref: { // bool: no argument required but value may be specified as xref:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_fldfunc: { // bool: no argument required but value may be specified as xref:Y + case command_FieldId_fldfunc: { // bool: no argument required but value may be specified as fldfunc:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_maxgroup: { // bool: no argument required but value may be specified as fldfunc:Y + case command_FieldId_maxgroup: { // *out_anon = false; } break; - case command_FieldId_pretty: { // bool: no argument required but value may be specified as fldfunc:Y + case command_FieldId_pretty: { // bool: no argument required but value may be specified as pretty:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_tree: { // bool: no argument required but value may be specified as pretty:Y + case command_FieldId_tree: { // bool: no argument required but value may be specified as tree:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_loose: { // bool: no argument required but value may be specified as tree:Y + case command_FieldId_loose: { // bool: no argument required but value may be specified as loose:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_my: { // bool: no argument required but value may be specified as loose:Y + case command_FieldId_my: { // bool: no argument required but value may be specified as my:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_schema: { // bool: no argument required but value may be specified as my:Y + case command_FieldId_schema: { // *out_anon = false; } break; - case command_FieldId_e: { // bool: no argument required but value may be specified as my:Y + case command_FieldId_e: { // bool: no argument required but value may be specified as e:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_t: { // bool: no argument required but value may be specified as e:Y + case command_FieldId_t: { // bool: no argument required but value may be specified as t:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_g: { // bool: no argument required but value may be specified as t:Y + case command_FieldId_g: { // bool: no argument required but value may be specified as g:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_x: { // bool: no argument required but value may be specified as g:Y + case command_FieldId_x: { // bool: no argument required but value may be specified as x:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_rowid: { // bool: no argument required but value may be specified as x:Y + case command_FieldId_rowid: { // bool: no argument required but value may be specified as rowid:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_cmt: { // bool: no argument required but value may be specified as rowid:Y + case command_FieldId_cmt: { // bool: no argument required but value may be specified as cmt:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_report: { // bool: no argument required but value may be specified as cmt:Y + case command_FieldId_report: { // bool: no argument required but value may be specified as report:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_print: { // bool: no argument required but value may be specified as report:Y + case command_FieldId_print: { // bool: no argument required but value may be specified as print:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_cmd: { // bool: no argument required but value may be specified as print:Y + case command_FieldId_cmd: { // *out_anon = false; } break; - case command_FieldId_field: { // bool: no argument required but value may be specified as print:Y + case command_FieldId_field: { // *out_anon = false; } break; - case command_FieldId_regxof: { // bool: no argument required but value may be specified as print:Y + case command_FieldId_regxof: { // *out_anon = false; } break; - case command_FieldId_meta: { // bool: no argument required but value may be specified as print:Y + case command_FieldId_meta: { // bool: no argument required but value may be specified as meta:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -4018,33 +4136,29 @@ bool command::acr_compl_ReadFieldMaybe(command::acr_compl& parent, algo::strptr switch(field_id) { case command_FieldId_data: { retval = algo::cstring_ReadStrptrMaybe(parent.data, strval); - break; - } + } break; case command_FieldId_schema: { retval = algo::cstring_ReadStrptrMaybe(parent.schema, strval); - break; - } + } break; case command_FieldId_line: { retval = algo::cstring_ReadStrptrMaybe(parent.line, strval); - break; - } + } break; case command_FieldId_point: { retval = algo::cstring_ReadStrptrMaybe(parent.point, strval); - break; - } + } break; case command_FieldId_type: { retval = algo::cstring_ReadStrptrMaybe(parent.type, strval); - break; - } + } break; case command_FieldId_install: { retval = bool_ReadStrptrMaybe(parent.install, strval); - break; - } + } break; case command_FieldId_debug_log: { retval = algo::cstring_ReadStrptrMaybe(parent.debug_log, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -4181,27 +4295,27 @@ void command::acr_compl_Print(command::acr_compl& row, algo::cstring& str) { i32 command::acr_compl_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_data: { // $comment + case command_FieldId_data: { // *out_anon = false; } break; - case command_FieldId_schema: { // $comment + case command_FieldId_schema: { // *out_anon = false; } break; - case command_FieldId_line: { // $comment + case command_FieldId_line: { // *out_anon = false; } break; - case command_FieldId_point: { // $comment + case command_FieldId_point: { // *out_anon = false; } break; - case command_FieldId_type: { // $comment + case command_FieldId_type: { // *out_anon = false; } break; - case command_FieldId_install: { // $comment + case command_FieldId_install: { // bool: no argument required but value may be specified as install:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_debug_log: { // bool: no argument required but value may be specified as install:Y + case command_FieldId_debug_log: { // *out_anon = false; } break; default: @@ -4265,7 +4379,7 @@ algo::Fildes command::acr_compl_StartRead(command::acr_compl_proc& parent, algo_ // --- command.acr_compl_proc.acr_compl.Kill // Kill subprocess and wait void command::acr_compl_Kill(command::acr_compl_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); acr_compl_Wait(parent); } @@ -4464,6 +4578,25 @@ algo::aryptr command::arg_AllocN(command::acr_dm& parent, int n_e return algo::aryptr(elems + old_n, n_elems); } +// --- command.acr_dm.arg.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::arg_AllocNAt(command::acr_dm& parent, int n_elems, int at) { + arg_Reserve(parent, n_elems); + int n = parent.arg_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.acr_dm.arg comment:'index out of range'"); + } + algo::cstring *elems = parent.arg_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.arg_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- command.acr_dm.arg.Remove // Remove item by index. If index outside of range, do nothing. void command::arg_Remove(command::acr_dm& parent, u32 i) { @@ -4560,6 +4693,30 @@ bool command::arg_ReadStrptrMaybe(command::acr_dm& parent, algo::strptr in_str) return retval; } +// --- command.acr_dm.arg.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::arg_Insary(command::acr_dm& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.arg_elems && rhs.elems < parent.arg_elems + parent.arg_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.acr_dm.arg comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.arg_elems+1))) { + FatalErrorExit("command.bad_insary field:command.acr_dm.arg comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.arg_n - at; + arg_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.arg_elems + at + nnew + i) algo::cstring(parent.arg_elems[at + i]); + parent.arg_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.arg_elems + at + i) algo::cstring(rhs[i]); + } + parent.arg_n += nnew; +} + // --- command.acr_dm..ReadFieldMaybe bool command::acr_dm_ReadFieldMaybe(command::acr_dm& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -4568,25 +4725,23 @@ bool command::acr_dm_ReadFieldMaybe(command::acr_dm& parent, algo::strptr field, switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_arg: { retval = arg_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_write_ours: { retval = bool_ReadStrptrMaybe(parent.write_ours, strval); - break; - } + } break; case command_FieldId_msize: { retval = u8_ReadStrptrMaybe(parent.msize, strval); - break; - } + } break; case command_FieldId_rowid: { retval = bool_ReadStrptrMaybe(parent.rowid, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -4693,21 +4848,21 @@ algo::strptr command::acr_dm_GetAnon(command::acr_dm &parent, i32 idx) { i32 command::acr_dm_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_arg: { // $comment + case command_FieldId_arg: { // *out_anon = true; } break; - case command_FieldId_write_ours: { // $comment + case command_FieldId_write_ours: { // bool: no argument required but value may be specified as write_ours:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_msize: { // bool: no argument required but value may be specified as write_ours:Y + case command_FieldId_msize: { // *out_anon = false; } break; - case command_FieldId_rowid: { // bool: no argument required but value may be specified as write_ours:Y + case command_FieldId_rowid: { // bool: no argument required but value may be specified as rowid:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -4796,7 +4951,7 @@ algo::Fildes command::acr_dm_StartRead(command::acr_dm_proc& parent, algo_lib::F // --- command.acr_dm_proc.acr_dm.Kill // Kill subprocess and wait void command::acr_dm_Kill(command::acr_dm_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); acr_dm_Wait(parent); } @@ -4928,185 +5083,146 @@ bool command::acr_ed_ReadFieldMaybe(command::acr_ed& parent, algo::strptr field, switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_create: { retval = bool_ReadStrptrMaybe(parent.create, strval); - break; - } + } break; case command_FieldId_del: { retval = bool_ReadStrptrMaybe(parent.del, strval); - break; - } + } break; case command_FieldId_rename: { retval = algo::cstring_ReadStrptrMaybe(parent.rename, strval); - break; - } + } break; case command_FieldId_finput: { retval = bool_ReadStrptrMaybe(parent.finput, strval); - break; - } + } break; case command_FieldId_foutput: { retval = bool_ReadStrptrMaybe(parent.foutput, strval); - break; - } + } break; case command_FieldId_srcfile: { retval = algo::cstring_ReadStrptrMaybe(parent.srcfile, strval); - break; - } + } break; case command_FieldId_gstatic: { retval = bool_ReadStrptrMaybe(parent.gstatic, strval); - break; - } + } break; case command_FieldId_indexed: { retval = bool_ReadStrptrMaybe(parent.indexed, strval); - break; - } + } break; case command_FieldId_target: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.target, strval); - break; - } + } break; case command_FieldId_nstype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.nstype, strval); - break; - } + } break; case command_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case command_FieldId_pooltype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.pooltype, strval); - break; - } + } break; case command_FieldId_ssimfile: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.ssimfile, strval); - break; - } + } break; case command_FieldId_subset: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.subset, strval); - break; - } + } break; case command_FieldId_subset2: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.subset2, strval); - break; - } + } break; case command_FieldId_separator: { retval = algo::cstring_ReadStrptrMaybe(parent.separator, strval); - break; - } + } break; case command_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case command_FieldId_arg: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.arg, strval); - break; - } + } break; case command_FieldId_dflt: { retval = algo::cstring_ReadStrptrMaybe(parent.dflt, strval); - break; - } + } break; case command_FieldId_anon: { retval = bool_ReadStrptrMaybe(parent.anon, strval); - break; - } + } break; case command_FieldId_bigend: { retval = bool_ReadStrptrMaybe(parent.bigend, strval); - break; - } + } break; case command_FieldId_cascdel: { retval = bool_ReadStrptrMaybe(parent.cascdel, strval); - break; - } + } break; case command_FieldId_before: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.before, strval); - break; - } + } break; case command_FieldId_substr: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.substr, strval); - break; - } + } break; case command_FieldId_alias: { retval = bool_ReadStrptrMaybe(parent.alias, strval); - break; - } + } break; case command_FieldId_srcfield: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.srcfield, strval); - break; - } + } break; case command_FieldId_fstep: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.fstep, strval); - break; - } + } break; case command_FieldId_inscond: { retval = algo::cstring_ReadStrptrMaybe(parent.inscond, strval); - break; - } + } break; case command_FieldId_reftype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.reftype, strval); - break; - } + } break; case command_FieldId_hashfld: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.hashfld, strval); - break; - } + } break; case command_FieldId_sortfld: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.sortfld, strval); - break; - } + } break; case command_FieldId_unittest: { retval = algo::cstring_ReadStrptrMaybe(parent.unittest, strval); - break; - } + } break; case command_FieldId_citest: { retval = algo::cstring_ReadStrptrMaybe(parent.citest, strval); - break; - } + } break; case command_FieldId_cppfunc: { retval = algo::cstring_ReadStrptrMaybe(parent.cppfunc, strval); - break; - } + } break; case command_FieldId_xref: { retval = bool_ReadStrptrMaybe(parent.xref, strval); - break; - } + } break; case command_FieldId_via: { retval = algo::cstring_ReadStrptrMaybe(parent.via, strval); - break; - } + } break; case command_FieldId_write: { retval = bool_ReadStrptrMaybe(parent.write, strval); - break; - } + } break; case command_FieldId_e: { retval = bool_ReadStrptrMaybe(parent.e, strval); - break; - } + } break; case command_FieldId_comment: { retval = algo::cstring_ReadStrptrMaybe(parent.comment, strval); - break; - } + } break; case command_FieldId_sandbox: { retval = bool_ReadStrptrMaybe(parent.sandbox, strval); - break; - } + } break; case command_FieldId_test: { retval = bool_ReadStrptrMaybe(parent.test, strval); - break; - } + } break; case command_FieldId_showcpp: { retval = bool_ReadStrptrMaybe(parent.showcpp, strval); - break; - } + } break; case command_FieldId_msgtype: { retval = algo::cstring_ReadStrptrMaybe(parent.msgtype, strval); - break; - } + } break; case command_FieldId_anonfld: { retval = bool_ReadStrptrMaybe(parent.anonfld, strval); - break; - } - default: break; + } break; + case command_FieldId_amc: { + retval = bool_ReadStrptrMaybe(parent.amc, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5175,6 +5291,7 @@ void command::acr_ed_Init(command::acr_ed& parent) { parent.showcpp = bool(false); parent.msgtype = algo::strptr(""); parent.anonfld = bool(false); + parent.amc = bool(true); } // --- command.acr_ed..ToCmdline @@ -5471,6 +5588,12 @@ void command::acr_ed_PrintArgv(command::acr_ed& row, algo::cstring& str) { str << " -anonfld:"; strptr_PrintBash(temp,str); } + if (!(row.amc == true)) { + ch_RemoveAll(temp); + bool_Print(row.amc, temp); + str << " -amc:"; + strptr_PrintBash(temp,str); + } } // --- command.acr_ed..NArgs @@ -5480,171 +5603,176 @@ void command::acr_ed_PrintArgv(command::acr_ed& row, algo::cstring& str) { i32 command::acr_ed_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_create: { // $comment + case command_FieldId_create: { // bool: no argument required but value may be specified as create:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_del: { // bool: no argument required but value may be specified as create:Y + case command_FieldId_del: { // bool: no argument required but value may be specified as del:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_rename: { // bool: no argument required but value may be specified as del:Y + case command_FieldId_rename: { // *out_anon = false; } break; - case command_FieldId_finput: { // bool: no argument required but value may be specified as del:Y + case command_FieldId_finput: { // bool: no argument required but value may be specified as finput:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_foutput: { // bool: no argument required but value may be specified as finput:Y + case command_FieldId_foutput: { // bool: no argument required but value may be specified as foutput:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_srcfile: { // bool: no argument required but value may be specified as foutput:Y + case command_FieldId_srcfile: { // *out_anon = false; } break; - case command_FieldId_gstatic: { // bool: no argument required but value may be specified as foutput:Y + case command_FieldId_gstatic: { // bool: no argument required but value may be specified as gstatic:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_indexed: { // bool: no argument required but value may be specified as gstatic:Y + case command_FieldId_indexed: { // bool: no argument required but value may be specified as indexed:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_target: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_target: { // *out_anon = false; } break; - case command_FieldId_nstype: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_nstype: { // *out_anon = false; } break; - case command_FieldId_ctype: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_ctype: { // *out_anon = false; } break; - case command_FieldId_pooltype: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_pooltype: { // *out_anon = false; } break; - case command_FieldId_ssimfile: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_ssimfile: { // *out_anon = false; } break; - case command_FieldId_subset: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_subset: { // *out_anon = false; } break; - case command_FieldId_subset2: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_subset2: { // *out_anon = false; } break; - case command_FieldId_separator: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_separator: { // *out_anon = false; } break; - case command_FieldId_field: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_field: { // *out_anon = false; } break; - case command_FieldId_arg: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_arg: { // *out_anon = false; } break; - case command_FieldId_dflt: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_dflt: { // *out_anon = false; } break; - case command_FieldId_anon: { // bool: no argument required but value may be specified as indexed:Y + case command_FieldId_anon: { // bool: no argument required but value may be specified as anon:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_bigend: { // bool: no argument required but value may be specified as anon:Y + case command_FieldId_bigend: { // bool: no argument required but value may be specified as bigend:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_cascdel: { // bool: no argument required but value may be specified as bigend:Y + case command_FieldId_cascdel: { // bool: no argument required but value may be specified as cascdel:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_before: { // bool: no argument required but value may be specified as cascdel:Y + case command_FieldId_before: { // *out_anon = false; } break; - case command_FieldId_substr: { // bool: no argument required but value may be specified as cascdel:Y + case command_FieldId_substr: { // *out_anon = false; } break; - case command_FieldId_alias: { // bool: no argument required but value may be specified as cascdel:Y + case command_FieldId_alias: { // bool: no argument required but value may be specified as alias:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_srcfield: { // bool: no argument required but value may be specified as alias:Y + case command_FieldId_srcfield: { // *out_anon = false; } break; - case command_FieldId_fstep: { // bool: no argument required but value may be specified as alias:Y + case command_FieldId_fstep: { // *out_anon = false; } break; - case command_FieldId_inscond: { // bool: no argument required but value may be specified as alias:Y + case command_FieldId_inscond: { // *out_anon = false; } break; - case command_FieldId_reftype: { // bool: no argument required but value may be specified as alias:Y + case command_FieldId_reftype: { // *out_anon = false; } break; - case command_FieldId_hashfld: { // bool: no argument required but value may be specified as alias:Y + case command_FieldId_hashfld: { // *out_anon = false; } break; - case command_FieldId_sortfld: { // bool: no argument required but value may be specified as alias:Y + case command_FieldId_sortfld: { // *out_anon = false; } break; - case command_FieldId_unittest: { // bool: no argument required but value may be specified as alias:Y + case command_FieldId_unittest: { // *out_anon = false; } break; - case command_FieldId_citest: { // bool: no argument required but value may be specified as alias:Y + case command_FieldId_citest: { // *out_anon = false; } break; - case command_FieldId_cppfunc: { // bool: no argument required but value may be specified as alias:Y + case command_FieldId_cppfunc: { // *out_anon = false; } break; - case command_FieldId_xref: { // bool: no argument required but value may be specified as alias:Y + case command_FieldId_xref: { // bool: no argument required but value may be specified as xref:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_via: { // bool: no argument required but value may be specified as xref:Y + case command_FieldId_via: { // *out_anon = false; } break; - case command_FieldId_write: { // bool: no argument required but value may be specified as xref:Y + case command_FieldId_write: { // bool: no argument required but value may be specified as write:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_e: { // bool: no argument required but value may be specified as write:Y + case command_FieldId_e: { // bool: no argument required but value may be specified as e:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_comment: { // bool: no argument required but value may be specified as e:Y + case command_FieldId_comment: { // *out_anon = false; } break; - case command_FieldId_sandbox: { // bool: no argument required but value may be specified as e:Y + case command_FieldId_sandbox: { // bool: no argument required but value may be specified as sandbox:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_test: { // bool: no argument required but value may be specified as sandbox:Y + case command_FieldId_test: { // bool: no argument required but value may be specified as test:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_showcpp: { // bool: no argument required but value may be specified as test:Y + case command_FieldId_showcpp: { // bool: no argument required but value may be specified as showcpp:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_msgtype: { // bool: no argument required but value may be specified as showcpp:Y + case command_FieldId_msgtype: { // + *out_anon = false; + } break; + case command_FieldId_anonfld: { // bool: no argument required but value may be specified as anonfld:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_anonfld: { // bool: no argument required but value may be specified as showcpp:Y + case command_FieldId_amc: { // bool: no argument required but value may be specified as amc:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -5710,7 +5838,7 @@ algo::Fildes command::acr_ed_StartRead(command::acr_ed_proc& parent, algo_lib::F // --- command.acr_ed_proc.acr_ed.Kill // Kill subprocess and wait void command::acr_ed_Kill(command::acr_ed_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); acr_ed_Wait(parent); } @@ -6062,6 +6190,12 @@ void command::acr_ed_ToArgv(command::acr_ed_proc& parent, algo::StringAry& args) *arg << "-anonfld:"; bool_Print(parent.cmd.anonfld, *arg); } + + if (parent.cmd.amc != true) { + cstring *arg = &ary_Alloc(args); + *arg << "-amc:"; + bool_Print(parent.cmd.amc, *arg); + } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } @@ -6128,49 +6262,41 @@ bool command::acr_in_ReadFieldMaybe(command::acr_in& parent, algo::strptr field, switch(field_id) { case command_FieldId_ns: { retval = ns_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_data: { retval = bool_ReadStrptrMaybe(parent.data, strval); - break; - } + } break; case command_FieldId_sigcheck: { retval = bool_ReadStrptrMaybe(parent.sigcheck, strval); - break; - } + } break; case command_FieldId_list: { retval = bool_ReadStrptrMaybe(parent.list, strval); - break; - } + } break; case command_FieldId_t: { retval = bool_ReadStrptrMaybe(parent.t, strval); - break; - } + } break; case command_FieldId_data_dir: { retval = algo::cstring_ReadStrptrMaybe(parent.data_dir, strval); - break; - } + } break; case command_FieldId_schema: { retval = algo::cstring_ReadStrptrMaybe(parent.schema, strval); - break; - } + } break; case command_FieldId_related: { retval = algo::cstring_ReadStrptrMaybe(parent.related, strval); - break; - } + } break; case command_FieldId_notssimfile: { retval = notssimfile_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_checkable: { retval = bool_ReadStrptrMaybe(parent.checkable, strval); - break; - } + } break; case command_FieldId_r: { retval = r_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6317,47 +6443,47 @@ algo::strptr command::acr_in_GetAnon(command::acr_in &parent, i32 idx) { i32 command::acr_in_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_ns: { // $comment + case command_FieldId_ns: { // *out_anon = true; } break; - case command_FieldId_data: { // $comment + case command_FieldId_data: { // bool: no argument required but value may be specified as data:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_sigcheck: { // bool: no argument required but value may be specified as data:Y + case command_FieldId_sigcheck: { // bool: no argument required but value may be specified as sigcheck:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_list: { // bool: no argument required but value may be specified as sigcheck:Y + case command_FieldId_list: { // bool: no argument required but value may be specified as list:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_t: { // bool: no argument required but value may be specified as list:Y + case command_FieldId_t: { // bool: no argument required but value may be specified as t:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_data_dir: { // bool: no argument required but value may be specified as t:Y + case command_FieldId_data_dir: { // *out_anon = false; } break; - case command_FieldId_schema: { // bool: no argument required but value may be specified as t:Y + case command_FieldId_schema: { // *out_anon = false; } break; - case command_FieldId_related: { // bool: no argument required but value may be specified as t:Y + case command_FieldId_related: { // *out_anon = false; } break; - case command_FieldId_notssimfile: { // bool: no argument required but value may be specified as t:Y + case command_FieldId_notssimfile: { // *out_anon = false; } break; - case command_FieldId_checkable: { // bool: no argument required but value may be specified as t:Y + case command_FieldId_checkable: { // bool: no argument required but value may be specified as checkable:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_r: { // bool: no argument required but value may be specified as checkable:Y + case command_FieldId_r: { // *out_anon = false; } break; default: @@ -6421,7 +6547,7 @@ algo::Fildes command::acr_in_StartRead(command::acr_in_proc& parent, algo_lib::F // --- command.acr_in_proc.acr_in.Kill // Kill subprocess and wait void command::acr_in_Kill(command::acr_in_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); acr_in_Wait(parent); } @@ -6605,49 +6731,41 @@ bool command::acr_my_ReadFieldMaybe(command::acr_my& parent, algo::strptr field, switch(field_id) { case command_FieldId_nsdb: { retval = nsdb_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_schema: { retval = algo::cstring_ReadStrptrMaybe(parent.schema, strval); - break; - } + } break; case command_FieldId_fldfunc: { retval = bool_ReadStrptrMaybe(parent.fldfunc, strval); - break; - } + } break; case command_FieldId_fkey: { retval = bool_ReadStrptrMaybe(parent.fkey, strval); - break; - } + } break; case command_FieldId_e: { retval = bool_ReadStrptrMaybe(parent.e, strval); - break; - } + } break; case command_FieldId_start: { retval = bool_ReadStrptrMaybe(parent.start, strval); - break; - } + } break; case command_FieldId_stop: { retval = bool_ReadStrptrMaybe(parent.stop, strval); - break; - } + } break; case command_FieldId_abort: { retval = bool_ReadStrptrMaybe(parent.abort, strval); - break; - } + } break; case command_FieldId_shell: { retval = bool_ReadStrptrMaybe(parent.shell, strval); - break; - } + } break; case command_FieldId_serv: { retval = bool_ReadStrptrMaybe(parent.serv, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6794,51 +6912,51 @@ algo::strptr command::acr_my_GetAnon(command::acr_my &parent, i32 idx) { i32 command::acr_my_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_nsdb: { // $comment + case command_FieldId_nsdb: { // *out_anon = true; } break; - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_schema: { // $comment + case command_FieldId_schema: { // *out_anon = false; } break; - case command_FieldId_fldfunc: { // $comment + case command_FieldId_fldfunc: { // bool: no argument required but value may be specified as fldfunc:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_fkey: { // bool: no argument required but value may be specified as fldfunc:Y + case command_FieldId_fkey: { // bool: no argument required but value may be specified as fkey:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_e: { // bool: no argument required but value may be specified as fkey:Y + case command_FieldId_e: { // bool: no argument required but value may be specified as e:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_start: { // bool: no argument required but value may be specified as e:Y + case command_FieldId_start: { // bool: no argument required but value may be specified as start:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_stop: { // bool: no argument required but value may be specified as start:Y + case command_FieldId_stop: { // bool: no argument required but value may be specified as stop:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_abort: { // bool: no argument required but value may be specified as stop:Y + case command_FieldId_abort: { // bool: no argument required but value may be specified as abort:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_shell: { // bool: no argument required but value may be specified as abort:Y + case command_FieldId_shell: { // bool: no argument required but value may be specified as shell:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_serv: { // bool: no argument required but value may be specified as shell:Y + case command_FieldId_serv: { // bool: no argument required but value may be specified as serv:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -6904,7 +7022,7 @@ algo::Fildes command::acr_my_StartRead(command::acr_my_proc& parent, algo_lib::F // --- command.acr_my_proc.acr_my.Kill // Kill subprocess and wait void command::acr_my_Kill(command::acr_my_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); acr_my_Wait(parent); } @@ -7120,7 +7238,7 @@ algo::Fildes command::acr_StartRead(command::acr_proc& parent, algo_lib::FFildes // --- command.acr_proc.acr.Kill // Kill subprocess and wait void command::acr_Kill(command::acr_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); acr_Wait(parent); } @@ -7470,33 +7588,32 @@ bool command::amc_ReadFieldMaybe(command::amc& parent, algo::strptr field, algo: switch(field_id) { case command_FieldId_in_dir: { retval = algo::cstring_ReadStrptrMaybe(parent.in_dir, strval); - break; - } + } break; case command_FieldId_query: { retval = algo::cstring_ReadStrptrMaybe(parent.query, strval); - break; - } + } break; case command_FieldId_out_dir: { retval = algo::cstring_ReadStrptrMaybe(parent.out_dir, strval); - break; - } + } break; case command_FieldId_proto: { retval = bool_ReadStrptrMaybe(parent.proto, strval); - break; - } + } break; + case command_FieldId_showcomment: { + retval = bool_ReadStrptrMaybe(parent.showcomment, strval); + } break; case command_FieldId_report: { retval = bool_ReadStrptrMaybe(parent.report, strval); - break; - } + } break; case command_FieldId_e: { retval = bool_ReadStrptrMaybe(parent.e, strval); - break; - } + } break; case command_FieldId_trace: { retval = trace_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7528,6 +7645,7 @@ void command::amc_Init(command::amc& parent) { parent.query = algo::strptr(""); parent.out_dir = algo::strptr("."); parent.proto = bool(false); + parent.showcomment = bool(true); parent.report = bool(true); parent.e = bool(false); Regx_ReadSql(parent.trace, "", true); @@ -7579,6 +7697,12 @@ void command::amc_PrintArgv(command::amc& row, algo::cstring& str) { str << " -proto:"; strptr_PrintBash(temp,str); } + if (!(row.showcomment == true)) { + ch_RemoveAll(temp); + bool_Print(row.showcomment, temp); + str << " -showcomment:"; + strptr_PrintBash(temp,str); + } if (!(row.report == true)) { ch_RemoveAll(temp); bool_Print(row.report, temp); @@ -7615,31 +7739,36 @@ algo::strptr command::amc_GetAnon(command::amc &parent, i32 idx) { i32 command::amc_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in_dir: { // $comment + case command_FieldId_in_dir: { // *out_anon = false; } break; - case command_FieldId_query: { // $comment + case command_FieldId_query: { // *out_anon = true; } break; - case command_FieldId_out_dir: { // $comment + case command_FieldId_out_dir: { // + *out_anon = false; + } break; + case command_FieldId_proto: { // bool: no argument required but value may be specified as proto:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_proto: { // $comment + case command_FieldId_showcomment: { // bool: no argument required but value may be specified as showcomment:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_report: { // bool: no argument required but value may be specified as proto:Y + case command_FieldId_report: { // bool: no argument required but value may be specified as report:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_e: { // bool: no argument required but value may be specified as report:Y + case command_FieldId_e: { // bool: no argument required but value may be specified as e:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_trace: { // bool: no argument required but value may be specified as e:Y + case command_FieldId_trace: { // *out_anon = false; } break; default: @@ -7686,21 +7815,20 @@ bool command::amc_gc_ReadFieldMaybe(command::amc_gc& parent, algo::strptr field, switch(field_id) { case command_FieldId_target: { retval = target_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_key: { retval = key_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_include: { retval = bool_ReadStrptrMaybe(parent.include, strval); - break; - } + } break; case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7787,18 +7915,18 @@ void command::amc_gc_PrintArgv(command::amc_gc& row, algo::cstring& str) { i32 command::amc_gc_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_target: { // $comment + case command_FieldId_target: { // *out_anon = false; } break; - case command_FieldId_key: { // $comment + case command_FieldId_key: { // *out_anon = false; } break; - case command_FieldId_include: { // $comment + case command_FieldId_include: { // bool: no argument required but value may be specified as include:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_in: { // bool: no argument required but value may be specified as include:Y + case command_FieldId_in: { // *out_anon = false; } break; default: @@ -7862,7 +7990,7 @@ algo::Fildes command::amc_gc_StartRead(command::amc_gc_proc& parent, algo_lib::F // --- command.amc_gc_proc.amc_gc.Kill // Kill subprocess and wait void command::amc_gc_Kill(command::amc_gc_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); amc_gc_Wait(parent); } @@ -8036,7 +8164,7 @@ algo::Fildes command::amc_StartRead(command::amc_proc& parent, algo_lib::FFildes // --- command.amc_proc.amc.Kill // Kill subprocess and wait void command::amc_Kill(command::amc_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); amc_Wait(parent); } @@ -8143,6 +8271,12 @@ void command::amc_ToArgv(command::amc_proc& parent, algo::StringAry& args) { bool_Print(parent.cmd.proto, *arg); } + if (parent.cmd.showcomment != true) { + cstring *arg = &ary_Alloc(args); + *arg << "-showcomment:"; + bool_Print(parent.cmd.showcomment, *arg); + } + if (parent.cmd.report != true) { cstring *arg = &ary_Alloc(args); *arg << "-report:"; @@ -8196,37 +8330,32 @@ bool command::amc_vis_ReadFieldMaybe(command::amc_vis& parent, algo::strptr fiel switch(field_id) { case command_FieldId_ctype: { retval = ctype_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_dot: { retval = algo::cstring_ReadStrptrMaybe(parent.dot, strval); - break; - } + } break; case command_FieldId_xref: { retval = bool_ReadStrptrMaybe(parent.xref, strval); - break; - } + } break; case command_FieldId_xns: { retval = bool_ReadStrptrMaybe(parent.xns, strval); - break; - } + } break; case command_FieldId_noinput: { retval = bool_ReadStrptrMaybe(parent.noinput, strval); - break; - } + } break; case command_FieldId_check: { retval = bool_ReadStrptrMaybe(parent.check, strval); - break; - } + } break; case command_FieldId_render: { retval = bool_ReadStrptrMaybe(parent.render, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8258,7 +8387,7 @@ void command::amc_vis_Init(command::amc_vis& parent) { parent.in = algo::strptr("data"); parent.dot = algo::strptr(""); parent.xref = bool(false); - parent.xns = bool(false); + parent.xns = bool(true); parent.noinput = bool(false); parent.check = bool(false); parent.render = bool(true); @@ -8310,7 +8439,7 @@ void command::amc_vis_PrintArgv(command::amc_vis& row, algo::cstring& str) { str << " -xref:"; strptr_PrintBash(temp,str); } - if (!(row.xns == false)) { + if (!(row.xns == true)) { ch_RemoveAll(temp); bool_Print(row.xns, temp); str << " -xns:"; @@ -8352,36 +8481,36 @@ algo::strptr command::amc_vis_GetAnon(command::amc_vis &parent, i32 idx) { i32 command::amc_vis_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_ctype: { // $comment + case command_FieldId_ctype: { // *out_anon = true; } break; - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_dot: { // $comment + case command_FieldId_dot: { // *out_anon = false; } break; - case command_FieldId_xref: { // $comment + case command_FieldId_xref: { // bool: no argument required but value may be specified as xref:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_xns: { // bool: no argument required but value may be specified as xref:Y + case command_FieldId_xns: { // bool: no argument required but value may be specified as xns:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_noinput: { // bool: no argument required but value may be specified as xns:Y + case command_FieldId_noinput: { // bool: no argument required but value may be specified as noinput:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_check: { // bool: no argument required but value may be specified as noinput:Y + case command_FieldId_check: { // bool: no argument required but value may be specified as check:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_render: { // bool: no argument required but value may be specified as check:Y + case command_FieldId_render: { // bool: no argument required but value may be specified as render:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -8447,7 +8576,7 @@ algo::Fildes command::amc_vis_StartRead(command::amc_vis_proc& parent, algo_lib: // --- command.amc_vis_proc.amc_vis.Kill // Kill subprocess and wait void command::amc_vis_Kill(command::amc_vis_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); amc_vis_Wait(parent); } @@ -8554,7 +8683,7 @@ void command::amc_vis_ToArgv(command::amc_vis_proc& parent, algo::StringAry& arg bool_Print(parent.cmd.xref, *arg); } - if (parent.cmd.xns != false) { + if (parent.cmd.xns != true) { cstring *arg = &ary_Alloc(args); *arg << "-xns:"; bool_Print(parent.cmd.xns, *arg); @@ -8590,17 +8719,73 @@ void command::amc_vis_proc_Uninit(command::amc_vis_proc& parent) { amc_vis_Kill(parent); // kill child, ensure forward progress } -// --- command.ams_cat..ReadFieldMaybe -bool command::ams_cat_ReadFieldMaybe(command::ams_cat& parent, algo::strptr field, algo::strptr strval) { +// --- command.ams_sendtest.trace.Print +// Print back to string +void command::trace_Print(command::ams_sendtest& parent, algo::cstring &out) { + Regx_Print(parent.trace, out); +} + +// --- command.ams_sendtest.trace.ReadStrptrMaybe +// Read Regx from string +// Convert string to field. Return success value +bool command::trace_ReadStrptrMaybe(command::ams_sendtest& parent, algo::strptr in) { + bool retval = true; + Regx_ReadSql(parent.trace, in, true); + return retval; +} + +// --- command.ams_sendtest..ReadFieldMaybe +bool command::ams_sendtest_ReadFieldMaybe(command::ams_sendtest& parent, algo::strptr field, algo::strptr strval) { bool retval = true; command::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - default: break; + } break; + case command_FieldId_id: { + retval = i32_ReadStrptrMaybe(parent.id, strval); + } break; + case command_FieldId_file_prefix: { + retval = algo::cstring_ReadStrptrMaybe(parent.file_prefix, strval); + } break; + case command_FieldId_nchild: { + retval = i32_ReadStrptrMaybe(parent.nchild, strval); + } break; + case command_FieldId_blocking: { + retval = bool_ReadStrptrMaybe(parent.blocking, strval); + } break; + case command_FieldId_nmsg: { + retval = i32_ReadStrptrMaybe(parent.nmsg, strval); + } break; + case command_FieldId_trace: { + retval = trace_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_timeout: { + retval = i32_ReadStrptrMaybe(parent.timeout, strval); + } break; + case command_FieldId_recvdelay_ns: { + retval = i64_ReadStrptrMaybe(parent.recvdelay_ns, strval); + } break; + case command_FieldId_senddelay_ns: { + retval = i64_ReadStrptrMaybe(parent.senddelay_ns, strval); + } break; + case command_FieldId_msgsize_min: { + retval = i32_ReadStrptrMaybe(parent.msgsize_min, strval); + } break; + case command_FieldId_msgsize_max: { + retval = i32_ReadStrptrMaybe(parent.msgsize_max, strval); + } break; + case command_FieldId_bufsize: { + retval = i32_ReadStrptrMaybe(parent.bufsize, strval); + } break; + case command_FieldId_recvdelay: { + retval = i64_ReadStrptrMaybe(parent.recvdelay, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8608,12 +8793,12 @@ bool command::ams_cat_ReadFieldMaybe(command::ams_cat& parent, algo::strptr fiel return retval; } -// --- command.ams_cat..ReadTupleMaybe -// Read fields of command::ams_cat from attributes of ascii tuple TUPLE -bool command::ams_cat_ReadTupleMaybe(command::ams_cat &parent, algo::Tuple &tuple) { +// --- command.ams_sendtest..ReadTupleMaybe +// Read fields of command::ams_sendtest from attributes of ascii tuple TUPLE +bool command::ams_sendtest_ReadTupleMaybe(command::ams_sendtest &parent, algo::Tuple &tuple) { bool retval = true; ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - retval = ams_cat_ReadFieldMaybe(parent, attr.name, attr.value); + retval = ams_sendtest_ReadFieldMaybe(parent, attr.name, attr.value); if (!retval) { break; } @@ -8621,13 +8806,32 @@ bool command::ams_cat_ReadTupleMaybe(command::ams_cat &parent, algo::Tuple &tupl return retval; } -// --- command.ams_cat..ToCmdline +// --- command.ams_sendtest..Init +// Set all fields to initial values. +void command::ams_sendtest_Init(command::ams_sendtest& parent) { + parent.in = algo::strptr("data"); + parent.id = i32(0); + parent.file_prefix = algo::strptr(""); + parent.nchild = i32(1); + parent.blocking = bool(false); + parent.nmsg = i32(1000); + Regx_ReadSql(parent.trace, "", true); + parent.timeout = i32(30); + parent.recvdelay_ns = i64(0); + parent.senddelay_ns = i64(0); + parent.msgsize_min = i32(64); + parent.msgsize_max = i32(1024); + parent.bufsize = i32(32768); + parent.recvdelay = i64(0); +} + +// --- command.ams_sendtest..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::ams_cat_ToCmdline(command::ams_cat& row) { +tempstr command::ams_sendtest_ToCmdline(command::ams_sendtest& row) { tempstr ret; - ret << "bin/ams_cat "; - ams_cat_PrintArgv(row, ret); + ret << "bin/ams_sendtest "; + ams_sendtest_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -8638,10 +8842,10 @@ tempstr command::ams_cat_ToCmdline(command::ams_cat& row) { return ret; } -// --- command.ams_cat..PrintArgv +// --- command.ams_sendtest..PrintArgv // print string representation of ROW to string STR -// cfmt:command.ams_cat.Argv printfmt:Tuple -void command::ams_cat_PrintArgv(command::ams_cat& row, algo::cstring& str) { +// cfmt:command.ams_sendtest.Argv printfmt:Tuple +void command::ams_sendtest_PrintArgv(command::ams_sendtest& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; @@ -8651,35 +8855,153 @@ void command::ams_cat_PrintArgv(command::ams_cat& row, algo::cstring& str) { str << " -in:"; strptr_PrintBash(temp,str); } -} - -// --- command.ams_cat..NArgs -// Used with command lines -// Return # of command-line arguments that must follow this argument + if (!(row.id == 0)) { + ch_RemoveAll(temp); + i32_Print(row.id, temp); + str << " -id:"; + strptr_PrintBash(temp,str); + } + if (!(row.file_prefix == "")) { + ch_RemoveAll(temp); + cstring_Print(row.file_prefix, temp); + str << " -file_prefix:"; + strptr_PrintBash(temp,str); + } + if (!(row.nchild == 1)) { + ch_RemoveAll(temp); + i32_Print(row.nchild, temp); + str << " -nchild:"; + strptr_PrintBash(temp,str); + } + if (!(row.blocking == false)) { + ch_RemoveAll(temp); + bool_Print(row.blocking, temp); + str << " -blocking:"; + strptr_PrintBash(temp,str); + } + if (!(row.nmsg == 1000)) { + ch_RemoveAll(temp); + i32_Print(row.nmsg, temp); + str << " -nmsg:"; + strptr_PrintBash(temp,str); + } + if (!(row.trace.expr == "")) { + ch_RemoveAll(temp); + command::trace_Print(const_cast(row), temp); + str << " -trace:"; + strptr_PrintBash(temp,str); + } + if (!(row.timeout == 30)) { + ch_RemoveAll(temp); + i32_Print(row.timeout, temp); + str << " -timeout:"; + strptr_PrintBash(temp,str); + } + if (!(row.recvdelay_ns == 0)) { + ch_RemoveAll(temp); + i64_Print(row.recvdelay_ns, temp); + str << " -recvdelay_ns:"; + strptr_PrintBash(temp,str); + } + if (!(row.senddelay_ns == 0)) { + ch_RemoveAll(temp); + i64_Print(row.senddelay_ns, temp); + str << " -senddelay_ns:"; + strptr_PrintBash(temp,str); + } + if (!(row.msgsize_min == 64)) { + ch_RemoveAll(temp); + i32_Print(row.msgsize_min, temp); + str << " -msgsize_min:"; + strptr_PrintBash(temp,str); + } + if (!(row.msgsize_max == 1024)) { + ch_RemoveAll(temp); + i32_Print(row.msgsize_max, temp); + str << " -msgsize_max:"; + strptr_PrintBash(temp,str); + } + if (!(row.bufsize == 32768)) { + ch_RemoveAll(temp); + i32_Print(row.bufsize, temp); + str << " -bufsize:"; + strptr_PrintBash(temp,str); + } + if (!(row.recvdelay == 0)) { + ch_RemoveAll(temp); + i64_Print(row.recvdelay, temp); + str << " -recvdelay:"; + strptr_PrintBash(temp,str); + } +} + +// --- command.ams_sendtest..NArgs +// Used with command lines +// Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::ams_cat_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::ams_sendtest_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // + *out_anon = false; + } break; + case command_FieldId_id: { // + *out_anon = false; + } break; + case command_FieldId_file_prefix: { // + *out_anon = false; + } break; + case command_FieldId_nchild: { // + *out_anon = false; + } break; + case command_FieldId_blocking: { // bool: no argument required but value may be specified as blocking:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_nmsg: { // + *out_anon = false; + } break; + case command_FieldId_trace: { // + *out_anon = false; + } break; + case command_FieldId_timeout: { // + *out_anon = false; + } break; + case command_FieldId_recvdelay_ns: { // + *out_anon = false; + } break; + case command_FieldId_senddelay_ns: { // + *out_anon = false; + } break; + case command_FieldId_msgsize_min: { // + *out_anon = false; + } break; + case command_FieldId_msgsize_max: { // + *out_anon = false; + } break; + case command_FieldId_bufsize: { // + *out_anon = false; + } break; + case command_FieldId_recvdelay: { // *out_anon = false; } break; default: retval=-1; // unrecognized } - (void)out_dflt;//only to avoid -Wunused-parameter return retval; } -// --- command.ams_cat_proc.ams_cat.Start +// --- command.ams_sendtest_proc.ams_sendtest.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::ams_cat_Start(command::ams_cat_proc& parent) { +int command::ams_sendtest_Start(command::ams_sendtest_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(ams_cat_ToCmdline(parent)); // maybe print command + verblog(ams_sendtest_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(ams_cat_ToCmdline(parent)); + tempstr cmdline(ams_sendtest_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -8691,10 +9013,10 @@ int command::ams_cat_Start(command::ams_cat_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= ams_cat_Execv(parent); + if (retval==0) retval= ams_sendtest_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.ams_cat_execv" + prerr("command.ams_sendtest_execv" <&" << pipefd[1]; - ams_cat_Start(parent); + ams_sendtest_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.ams_cat_proc.ams_cat.Kill +// --- command.ams_sendtest_proc.ams_sendtest.Kill // Kill subprocess and wait -void command::ams_cat_Kill(command::ams_cat_proc& parent) { - if (parent.pid != 0) { +void command::ams_sendtest_Kill(command::ams_sendtest_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - ams_cat_Wait(parent); + ams_sendtest_Wait(parent); } } -// --- command.ams_cat_proc.ams_cat.Wait +// --- command.ams_sendtest_proc.ams_sendtest.Wait // Wait for subprocess to return -void command::ams_cat_Wait(command::ams_cat_proc& parent) { +void command::ams_sendtest_Wait(command::ams_sendtest_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -8749,31 +9071,31 @@ void command::ams_cat_Wait(command::ams_cat_proc& parent) { } } -// --- command.ams_cat_proc.ams_cat.Exec +// --- command.ams_sendtest_proc.ams_sendtest.Exec // Start + Wait // Execute subprocess and return exit code -int command::ams_cat_Exec(command::ams_cat_proc& parent) { - ams_cat_Start(parent); - ams_cat_Wait(parent); +int command::ams_sendtest_Exec(command::ams_sendtest_proc& parent) { + ams_sendtest_Start(parent); + ams_sendtest_Wait(parent); return parent.status; } -// --- command.ams_cat_proc.ams_cat.ExecX +// --- command.ams_sendtest_proc.ams_sendtest.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::ams_cat_ExecX(command::ams_cat_proc& parent) { - int rc = ams_cat_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",ams_cat_ToCmdline(parent)) +void command::ams_sendtest_ExecX(command::ams_sendtest_proc& parent) { + int rc = ams_sendtest_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",ams_sendtest_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.ams_cat_proc.ams_cat.Execv +// --- command.ams_sendtest_proc.ams_sendtest.Execv // Call execv() // Call execv with specified parameters -int command::ams_cat_Execv(command::ams_cat_proc& parent) { +int command::ams_sendtest_Execv(command::ams_sendtest_proc& parent) { int ret = 0; algo::StringAry args; - ams_cat_ToArgv(parent, args); + ams_sendtest_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -8785,11 +9107,11 @@ int command::ams_cat_Execv(command::ams_cat_proc& parent) { return ret; } -// --- command.ams_cat_proc.ams_cat.ToCmdline -algo::tempstr command::ams_cat_ToCmdline(command::ams_cat_proc& parent) { +// --- command.ams_sendtest_proc.ams_sendtest.ToCmdline +algo::tempstr command::ams_sendtest_ToCmdline(command::ams_sendtest_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::ams_cat_PrintArgv(parent.cmd,retval); + command::ams_sendtest_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -8802,9 +9124,9 @@ algo::tempstr command::ams_cat_ToCmdline(command::ams_cat_proc& parent) { return retval; } -// --- command.ams_cat_proc.ams_cat.ToArgv +// --- command.ams_sendtest_proc.ams_sendtest.ToArgv // Form array from the command line -void command::ams_cat_ToArgv(command::ams_cat_proc& parent, algo::StringAry& args) { +void command::ams_sendtest_ToArgv(command::ams_sendtest_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; @@ -8813,97 +9135,215 @@ void command::ams_cat_ToArgv(command::ams_cat_proc& parent, algo::StringAry& arg *arg << "-in:"; cstring_Print(parent.cmd.in, *arg); } + + if (parent.cmd.id != 0) { + cstring *arg = &ary_Alloc(args); + *arg << "-id:"; + i32_Print(parent.cmd.id, *arg); + } + + if (parent.cmd.file_prefix != "") { + cstring *arg = &ary_Alloc(args); + *arg << "-file_prefix:"; + cstring_Print(parent.cmd.file_prefix, *arg); + } + + if (parent.cmd.nchild != 1) { + cstring *arg = &ary_Alloc(args); + *arg << "-nchild:"; + i32_Print(parent.cmd.nchild, *arg); + } + + if (parent.cmd.blocking != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-blocking:"; + bool_Print(parent.cmd.blocking, *arg); + } + + if (parent.cmd.nmsg != 1000) { + cstring *arg = &ary_Alloc(args); + *arg << "-nmsg:"; + i32_Print(parent.cmd.nmsg, *arg); + } + + if (parent.cmd.trace.expr != "") { + cstring *arg = &ary_Alloc(args); + *arg << "-trace:"; + command::trace_Print(parent.cmd, *arg); + } + + if (parent.cmd.timeout != 30) { + cstring *arg = &ary_Alloc(args); + *arg << "-timeout:"; + i32_Print(parent.cmd.timeout, *arg); + } + + if (parent.cmd.recvdelay_ns != 0) { + cstring *arg = &ary_Alloc(args); + *arg << "-recvdelay_ns:"; + i64_Print(parent.cmd.recvdelay_ns, *arg); + } + + if (parent.cmd.senddelay_ns != 0) { + cstring *arg = &ary_Alloc(args); + *arg << "-senddelay_ns:"; + i64_Print(parent.cmd.senddelay_ns, *arg); + } + + if (parent.cmd.msgsize_min != 64) { + cstring *arg = &ary_Alloc(args); + *arg << "-msgsize_min:"; + i32_Print(parent.cmd.msgsize_min, *arg); + } + + if (parent.cmd.msgsize_max != 1024) { + cstring *arg = &ary_Alloc(args); + *arg << "-msgsize_max:"; + i32_Print(parent.cmd.msgsize_max, *arg); + } + + if (parent.cmd.bufsize != 32768) { + cstring *arg = &ary_Alloc(args); + *arg << "-bufsize:"; + i32_Print(parent.cmd.bufsize, *arg); + } + + if (parent.cmd.recvdelay != 0) { + cstring *arg = &ary_Alloc(args); + *arg << "-recvdelay:"; + i64_Print(parent.cmd.recvdelay, *arg); + } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } } -// --- command.ams_cat_proc..Uninit -void command::ams_cat_proc_Uninit(command::ams_cat_proc& parent) { - command::ams_cat_proc &row = parent; (void)row; +// --- command.ams_sendtest_proc..Uninit +void command::ams_sendtest_proc_Uninit(command::ams_sendtest_proc& parent) { + command::ams_sendtest_proc &row = parent; (void)row; - // command.ams_cat_proc.ams_cat.Uninit (Exec) // - ams_cat_Kill(parent); // kill child, ensure forward progress + // command.ams_sendtest_proc.ams_sendtest.Uninit (Exec) // + ams_sendtest_Kill(parent); // kill child, ensure forward progress } -// --- command.ams_sendtest.trace.Print +// --- command.apm.package.Print // Print back to string -void command::trace_Print(command::ams_sendtest& parent, algo::cstring &out) { - Regx_Print(parent.trace, out); +void command::package_Print(command::apm& parent, algo::cstring &out) { + Regx_Print(parent.package, out); } -// --- command.ams_sendtest.trace.ReadStrptrMaybe +// --- command.apm.package.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::trace_ReadStrptrMaybe(command::ams_sendtest& parent, algo::strptr in) { +bool command::package_ReadStrptrMaybe(command::apm& parent, algo::strptr in) { bool retval = true; - Regx_ReadSql(parent.trace, in, true); + Regx_ReadSql(parent.package, in, true); return retval; } -// --- command.ams_sendtest..ReadFieldMaybe -bool command::ams_sendtest_ReadFieldMaybe(command::ams_sendtest& parent, algo::strptr field, algo::strptr strval) { +// --- command.apm.ns.Print +// Print back to string +void command::ns_Print(command::apm& parent, algo::cstring &out) { + Regx_Print(parent.ns, out); +} + +// --- command.apm.ns.ReadStrptrMaybe +// Read Regx from string +// Convert string to field. Return success value +bool command::ns_ReadStrptrMaybe(command::apm& parent, algo::strptr in) { bool retval = true; - command::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case command_FieldId_in: { - retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_id: { - retval = i32_ReadStrptrMaybe(parent.id, strval); - break; - } - case command_FieldId_file_prefix: { - retval = algo::cstring_ReadStrptrMaybe(parent.file_prefix, strval); - break; - } - case command_FieldId_nchild: { - retval = i32_ReadStrptrMaybe(parent.nchild, strval); - break; - } - case command_FieldId_blocking: { - retval = bool_ReadStrptrMaybe(parent.blocking, strval); - break; - } - case command_FieldId_nmsg: { - retval = i32_ReadStrptrMaybe(parent.nmsg, strval); - break; - } - case command_FieldId_trace: { - retval = trace_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_timeout: { - retval = i32_ReadStrptrMaybe(parent.timeout, strval); - break; - } - case command_FieldId_recvdelay_ns: { - retval = i64_ReadStrptrMaybe(parent.recvdelay_ns, strval); - break; - } - case command_FieldId_senddelay_ns: { - retval = i64_ReadStrptrMaybe(parent.senddelay_ns, strval); - break; - } - case command_FieldId_msgsize_min: { - retval = i32_ReadStrptrMaybe(parent.msgsize_min, strval); - break; - } - case command_FieldId_msgsize_max: { - retval = i32_ReadStrptrMaybe(parent.msgsize_max, strval); - break; - } - case command_FieldId_bufsize: { - retval = i32_ReadStrptrMaybe(parent.bufsize, strval); - break; - } - case command_FieldId_recvdelay: { - retval = i64_ReadStrptrMaybe(parent.recvdelay, strval); - break; - } - default: break; + Regx_ReadSql(parent.ns, in, true); + return retval; +} + +// --- command.apm..ReadFieldMaybe +bool command::apm_ReadFieldMaybe(command::apm& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + command::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case command_FieldId_in: { + retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); + } break; + case command_FieldId_pkgdata: { + retval = algo::cstring_ReadStrptrMaybe(parent.pkgdata, strval); + } break; + case command_FieldId_package: { + retval = package_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_ns: { + retval = ns_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_install: { + retval = bool_ReadStrptrMaybe(parent.install, strval); + } break; + case command_FieldId_update: { + retval = bool_ReadStrptrMaybe(parent.update, strval); + } break; + case command_FieldId_list: { + retval = bool_ReadStrptrMaybe(parent.list, strval); + } break; + case command_FieldId_diff: { + retval = bool_ReadStrptrMaybe(parent.diff, strval); + } break; + case command_FieldId_push: { + retval = bool_ReadStrptrMaybe(parent.push, strval); + } break; + case command_FieldId_check: { + retval = bool_ReadStrptrMaybe(parent.check, strval); + } break; + case command_FieldId_remove: { + retval = bool_ReadStrptrMaybe(parent.remove, strval); + } break; + case command_FieldId_origin: { + retval = algo::Smallstr200_ReadStrptrMaybe(parent.origin, strval); + } break; + case command_FieldId_ref: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.ref, strval); + } break; + case command_FieldId_dry_run: { + retval = bool_ReadStrptrMaybe(parent.dry_run, strval); + } break; + case command_FieldId_showrec: { + retval = bool_ReadStrptrMaybe(parent.showrec, strval); + } break; + case command_FieldId_showfile: { + retval = bool_ReadStrptrMaybe(parent.showfile, strval); + } break; + case command_FieldId_R: { + retval = bool_ReadStrptrMaybe(parent.R, strval); + } break; + case command_FieldId_l: { + retval = bool_ReadStrptrMaybe(parent.l, strval); + } break; + case command_FieldId_reset: { + retval = bool_ReadStrptrMaybe(parent.reset, strval); + } break; + case command_FieldId_checkclean: { + retval = bool_ReadStrptrMaybe(parent.checkclean, strval); + } break; + case command_FieldId_t: { + retval = bool_ReadStrptrMaybe(parent.t, strval); + } break; + case command_FieldId_stat: { + retval = bool_ReadStrptrMaybe(parent.stat, strval); + } break; + case command_FieldId_annotate: { + retval = algo::cstring_ReadStrptrMaybe(parent.annotate, strval); + } break; + case command_FieldId_data_in: { + retval = algo::cstring_ReadStrptrMaybe(parent.data_in, strval); + } break; + case command_FieldId_e: { + retval = bool_ReadStrptrMaybe(parent.e, strval); + } break; + case command_FieldId_binpath: { + retval = algo::cstring_ReadStrptrMaybe(parent.binpath, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8911,12 +9351,16 @@ bool command::ams_sendtest_ReadFieldMaybe(command::ams_sendtest& parent, algo::s return retval; } -// --- command.ams_sendtest..ReadTupleMaybe -// Read fields of command::ams_sendtest from attributes of ascii tuple TUPLE -bool command::ams_sendtest_ReadTupleMaybe(command::ams_sendtest &parent, algo::Tuple &tuple) { +// --- command.apm..ReadTupleMaybe +// Read fields of command::apm from attributes of ascii tuple TUPLE +bool command::apm_ReadTupleMaybe(command::apm &parent, algo::Tuple &tuple) { bool retval = true; + int anon_idx = 0; ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - retval = ams_sendtest_ReadFieldMaybe(parent, attr.name, attr.value); + if (ch_N(attr.name) == 0) { + attr.name = apm_GetAnon(parent, anon_idx++); + } + retval = apm_ReadFieldMaybe(parent, attr.name, attr.value); if (!retval) { break; } @@ -8924,32 +9368,44 @@ bool command::ams_sendtest_ReadTupleMaybe(command::ams_sendtest &parent, algo::T return retval; } -// --- command.ams_sendtest..Init +// --- command.apm..Init // Set all fields to initial values. -void command::ams_sendtest_Init(command::ams_sendtest& parent) { +void command::apm_Init(command::apm& parent) { parent.in = algo::strptr("data"); - parent.id = i32(0); - parent.file_prefix = algo::strptr(""); - parent.nchild = i32(1); - parent.blocking = bool(false); - parent.nmsg = i32(1000); - Regx_ReadSql(parent.trace, "", true); - parent.timeout = i32(30); - parent.recvdelay_ns = i64(0); - parent.senddelay_ns = i64(0); - parent.msgsize_min = i32(64); - parent.msgsize_max = i32(1024); - parent.bufsize = i32(32768); - parent.recvdelay = i64(0); + parent.pkgdata = algo::strptr(""); + Regx_ReadSql(parent.package, "", true); + Regx_ReadSql(parent.ns, "", true); + parent.install = bool(false); + parent.update = bool(false); + parent.list = bool(false); + parent.diff = bool(false); + parent.push = bool(false); + parent.check = bool(false); + parent.remove = bool(false); + parent.origin = algo::strptr(""); + parent.ref = algo::strptr(""); + parent.dry_run = bool(false); + parent.showrec = bool(false); + parent.showfile = bool(false); + parent.R = bool(false); + parent.l = bool(false); + parent.reset = bool(false); + parent.checkclean = bool(true); + parent.t = bool(false); + parent.stat = bool(false); + parent.annotate = algo::strptr(""); + parent.data_in = algo::strptr("data"); + parent.e = bool(false); + parent.binpath = algo::strptr("bin"); } -// --- command.ams_sendtest..ToCmdline +// --- command.apm..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::ams_sendtest_ToCmdline(command::ams_sendtest& row) { +tempstr command::apm_ToCmdline(command::apm& row) { tempstr ret; - ret << "bin/ams_sendtest "; - ams_sendtest_PrintArgv(row, ret); + ret << "bin/apm "; + apm_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -8960,10 +9416,10 @@ tempstr command::ams_sendtest_ToCmdline(command::ams_sendtest& row) { return ret; } -// --- command.ams_sendtest..PrintArgv +// --- command.apm..PrintArgv // print string representation of ROW to string STR -// cfmt:command.ams_sendtest.Argv printfmt:Tuple -void command::ams_sendtest_PrintArgv(command::ams_sendtest& row, algo::cstring& str) { +// cfmt:command.apm.Argv printfmt:Tuple +void command::apm_PrintArgv(command::apm& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; @@ -8973,135 +9429,282 @@ void command::ams_sendtest_PrintArgv(command::ams_sendtest& row, algo::cstring& str << " -in:"; strptr_PrintBash(temp,str); } - if (!(row.id == 0)) { + if (!(row.pkgdata == "")) { ch_RemoveAll(temp); - i32_Print(row.id, temp); - str << " -id:"; + cstring_Print(row.pkgdata, temp); + str << " -pkgdata:"; strptr_PrintBash(temp,str); } - if (!(row.file_prefix == "")) { + ch_RemoveAll(temp); + command::package_Print(const_cast(row), temp); + str << " -package:"; + strptr_PrintBash(temp,str); + if (!(row.ns.expr == "")) { ch_RemoveAll(temp); - cstring_Print(row.file_prefix, temp); - str << " -file_prefix:"; + command::ns_Print(const_cast(row), temp); + str << " -ns:"; strptr_PrintBash(temp,str); } - if (!(row.nchild == 1)) { + if (!(row.install == false)) { ch_RemoveAll(temp); - i32_Print(row.nchild, temp); - str << " -nchild:"; + bool_Print(row.install, temp); + str << " -install:"; strptr_PrintBash(temp,str); } - if (!(row.blocking == false)) { + if (!(row.update == false)) { ch_RemoveAll(temp); - bool_Print(row.blocking, temp); - str << " -blocking:"; + bool_Print(row.update, temp); + str << " -update:"; strptr_PrintBash(temp,str); } - if (!(row.nmsg == 1000)) { + if (!(row.list == false)) { ch_RemoveAll(temp); - i32_Print(row.nmsg, temp); - str << " -nmsg:"; + bool_Print(row.list, temp); + str << " -list:"; strptr_PrintBash(temp,str); } - if (!(row.trace.expr == "")) { + if (!(row.diff == false)) { ch_RemoveAll(temp); - command::trace_Print(const_cast(row), temp); - str << " -trace:"; + bool_Print(row.diff, temp); + str << " -diff:"; strptr_PrintBash(temp,str); } - if (!(row.timeout == 30)) { + if (!(row.push == false)) { ch_RemoveAll(temp); - i32_Print(row.timeout, temp); - str << " -timeout:"; - strptr_PrintBash(temp,str); + bool_Print(row.push, temp); + str << " -push:"; + strptr_PrintBash(temp,str); } - if (!(row.recvdelay_ns == 0)) { + if (!(row.check == false)) { ch_RemoveAll(temp); - i64_Print(row.recvdelay_ns, temp); - str << " -recvdelay_ns:"; + bool_Print(row.check, temp); + str << " -check:"; strptr_PrintBash(temp,str); } - if (!(row.senddelay_ns == 0)) { + if (!(row.remove == false)) { ch_RemoveAll(temp); - i64_Print(row.senddelay_ns, temp); - str << " -senddelay_ns:"; + bool_Print(row.remove, temp); + str << " -remove:"; strptr_PrintBash(temp,str); } - if (!(row.msgsize_min == 64)) { + if (!(row.origin == "")) { ch_RemoveAll(temp); - i32_Print(row.msgsize_min, temp); - str << " -msgsize_min:"; + Smallstr200_Print(row.origin, temp); + str << " -origin:"; strptr_PrintBash(temp,str); } - if (!(row.msgsize_max == 1024)) { + if (!(row.ref == "")) { ch_RemoveAll(temp); - i32_Print(row.msgsize_max, temp); - str << " -msgsize_max:"; + Smallstr50_Print(row.ref, temp); + str << " -ref:"; strptr_PrintBash(temp,str); } - if (!(row.bufsize == 32768)) { + if (!(row.dry_run == false)) { ch_RemoveAll(temp); - i32_Print(row.bufsize, temp); - str << " -bufsize:"; + bool_Print(row.dry_run, temp); + str << " -dry_run:"; strptr_PrintBash(temp,str); } - if (!(row.recvdelay == 0)) { + if (!(row.showrec == false)) { ch_RemoveAll(temp); - i64_Print(row.recvdelay, temp); - str << " -recvdelay:"; + bool_Print(row.showrec, temp); + str << " -showrec:"; + strptr_PrintBash(temp,str); + } + if (!(row.showfile == false)) { + ch_RemoveAll(temp); + bool_Print(row.showfile, temp); + str << " -showfile:"; + strptr_PrintBash(temp,str); + } + if (!(row.R == false)) { + ch_RemoveAll(temp); + bool_Print(row.R, temp); + str << " -R:"; + strptr_PrintBash(temp,str); + } + if (!(row.l == false)) { + ch_RemoveAll(temp); + bool_Print(row.l, temp); + str << " -l:"; + strptr_PrintBash(temp,str); + } + if (!(row.reset == false)) { + ch_RemoveAll(temp); + bool_Print(row.reset, temp); + str << " -reset:"; + strptr_PrintBash(temp,str); + } + if (!(row.checkclean == true)) { + ch_RemoveAll(temp); + bool_Print(row.checkclean, temp); + str << " -checkclean:"; + strptr_PrintBash(temp,str); + } + if (!(row.t == false)) { + ch_RemoveAll(temp); + bool_Print(row.t, temp); + str << " -t:"; + strptr_PrintBash(temp,str); + } + if (!(row.stat == false)) { + ch_RemoveAll(temp); + bool_Print(row.stat, temp); + str << " -stat:"; + strptr_PrintBash(temp,str); + } + if (!(row.annotate == "")) { + ch_RemoveAll(temp); + cstring_Print(row.annotate, temp); + str << " -annotate:"; + strptr_PrintBash(temp,str); + } + if (!(row.data_in == "data")) { + ch_RemoveAll(temp); + cstring_Print(row.data_in, temp); + str << " -data_in:"; + strptr_PrintBash(temp,str); + } + if (!(row.e == false)) { + ch_RemoveAll(temp); + bool_Print(row.e, temp); + str << " -e:"; + strptr_PrintBash(temp,str); + } + if (!(row.binpath == "bin")) { + ch_RemoveAll(temp); + cstring_Print(row.binpath, temp); + str << " -binpath:"; strptr_PrintBash(temp,str); } } -// --- command.ams_sendtest..NArgs +// --- command.apm..GetAnon +algo::strptr command::apm_GetAnon(command::apm &parent, i32 idx) { + (void)parent;//only to avoid -Wunused-parameter + switch(idx) { + case(0): return strptr("package", 7); + default: return algo::strptr(); + } +} + +// --- command.apm..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::ams_sendtest_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::apm_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // + *out_anon = false; + } break; + case command_FieldId_pkgdata: { // + *out_anon = false; + } break; + case command_FieldId_package: { // + *out_anon = true; + } break; + case command_FieldId_ns: { // + *out_anon = false; + } break; + case command_FieldId_install: { // bool: no argument required but value may be specified as install:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_update: { // bool: no argument required but value may be specified as update:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_list: { // bool: no argument required but value may be specified as list:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_diff: { // bool: no argument required but value may be specified as diff:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_push: { // bool: no argument required but value may be specified as push:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_check: { // bool: no argument required but value may be specified as check:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_remove: { // bool: no argument required but value may be specified as remove:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_origin: { // + *out_anon = false; + } break; + case command_FieldId_ref: { // *out_anon = false; } break; - case command_FieldId_id: { // $comment + case command_FieldId_dry_run: { // bool: no argument required but value may be specified as dry_run:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_file_prefix: { // $comment + case command_FieldId_showrec: { // bool: no argument required but value may be specified as showrec:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_nchild: { // $comment + case command_FieldId_showfile: { // bool: no argument required but value may be specified as showfile:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_blocking: { // $comment + case command_FieldId_R: { // bool: no argument required but value may be specified as R:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_nmsg: { // bool: no argument required but value may be specified as blocking:Y + case command_FieldId_l: { // bool: no argument required but value may be specified as l:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_trace: { // bool: no argument required but value may be specified as blocking:Y + case command_FieldId_reset: { // bool: no argument required but value may be specified as reset:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_timeout: { // bool: no argument required but value may be specified as blocking:Y + case command_FieldId_checkclean: { // bool: no argument required but value may be specified as checkclean:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_recvdelay_ns: { // bool: no argument required but value may be specified as blocking:Y + case command_FieldId_t: { // bool: no argument required but value may be specified as t:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_senddelay_ns: { // bool: no argument required but value may be specified as blocking:Y + case command_FieldId_stat: { // bool: no argument required but value may be specified as stat:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_msgsize_min: { // bool: no argument required but value may be specified as blocking:Y + case command_FieldId_annotate: { // *out_anon = false; } break; - case command_FieldId_msgsize_max: { // bool: no argument required but value may be specified as blocking:Y + case command_FieldId_data_in: { // *out_anon = false; } break; - case command_FieldId_bufsize: { // bool: no argument required but value may be specified as blocking:Y + case command_FieldId_e: { // bool: no argument required but value may be specified as e:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_recvdelay: { // bool: no argument required but value may be specified as blocking:Y + case command_FieldId_binpath: { // *out_anon = false; } break; default: @@ -9110,16 +9713,16 @@ i32 command::ams_sendtest_NArgs(command::FieldId field, algo::strptr& out_dflt, return retval; } -// --- command.ams_sendtest_proc.ams_sendtest.Start +// --- command.apm_proc.apm.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::ams_sendtest_Start(command::ams_sendtest_proc& parent) { +int command::apm_Start(command::apm_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(ams_sendtest_ToCmdline(parent)); // maybe print command + verblog(apm_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(ams_sendtest_ToCmdline(parent)); + tempstr cmdline(apm_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -9131,10 +9734,10 @@ int command::ams_sendtest_Start(command::ams_sendtest_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= ams_sendtest_Execv(parent); + if (retval==0) retval= apm_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.ams_sendtest_execv" + prerr("command.apm_execv" <&" << pipefd[1]; - ams_sendtest_Start(parent); + apm_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.ams_sendtest_proc.ams_sendtest.Kill +// --- command.apm_proc.apm.Kill // Kill subprocess and wait -void command::ams_sendtest_Kill(command::ams_sendtest_proc& parent) { - if (parent.pid != 0) { +void command::apm_Kill(command::apm_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - ams_sendtest_Wait(parent); + apm_Wait(parent); } } -// --- command.ams_sendtest_proc.ams_sendtest.Wait +// --- command.apm_proc.apm.Wait // Wait for subprocess to return -void command::ams_sendtest_Wait(command::ams_sendtest_proc& parent) { +void command::apm_Wait(command::apm_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -9189,31 +9792,31 @@ void command::ams_sendtest_Wait(command::ams_sendtest_proc& parent) { } } -// --- command.ams_sendtest_proc.ams_sendtest.Exec +// --- command.apm_proc.apm.Exec // Start + Wait // Execute subprocess and return exit code -int command::ams_sendtest_Exec(command::ams_sendtest_proc& parent) { - ams_sendtest_Start(parent); - ams_sendtest_Wait(parent); +int command::apm_Exec(command::apm_proc& parent) { + apm_Start(parent); + apm_Wait(parent); return parent.status; } -// --- command.ams_sendtest_proc.ams_sendtest.ExecX +// --- command.apm_proc.apm.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::ams_sendtest_ExecX(command::ams_sendtest_proc& parent) { - int rc = ams_sendtest_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",ams_sendtest_ToCmdline(parent)) +void command::apm_ExecX(command::apm_proc& parent) { + int rc = apm_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",apm_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.ams_sendtest_proc.ams_sendtest.Execv +// --- command.apm_proc.apm.Execv // Call execv() // Call execv with specified parameters -int command::ams_sendtest_Execv(command::ams_sendtest_proc& parent) { +int command::apm_Execv(command::apm_proc& parent) { int ret = 0; algo::StringAry args; - ams_sendtest_ToArgv(parent, args); + apm_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -9225,11 +9828,11 @@ int command::ams_sendtest_Execv(command::ams_sendtest_proc& parent) { return ret; } -// --- command.ams_sendtest_proc.ams_sendtest.ToCmdline -algo::tempstr command::ams_sendtest_ToCmdline(command::ams_sendtest_proc& parent) { +// --- command.apm_proc.apm.ToCmdline +algo::tempstr command::apm_ToCmdline(command::apm_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::ams_sendtest_PrintArgv(parent.cmd,retval); + command::apm_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -9242,9 +9845,9 @@ algo::tempstr command::ams_sendtest_ToCmdline(command::ams_sendtest_proc& parent return retval; } -// --- command.ams_sendtest_proc.ams_sendtest.ToArgv +// --- command.apm_proc.apm.ToArgv // Form array from the command line -void command::ams_sendtest_ToArgv(command::ams_sendtest_proc& parent, algo::StringAry& args) { +void command::apm_ToArgv(command::apm_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; @@ -9254,299 +9857,244 @@ void command::ams_sendtest_ToArgv(command::ams_sendtest_proc& parent, algo::Stri cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.id != 0) { + if (parent.cmd.pkgdata != "") { cstring *arg = &ary_Alloc(args); - *arg << "-id:"; - i32_Print(parent.cmd.id, *arg); + *arg << "-pkgdata:"; + cstring_Print(parent.cmd.pkgdata, *arg); } - if (parent.cmd.file_prefix != "") { + if (parent.cmd.package.expr != "") { cstring *arg = &ary_Alloc(args); - *arg << "-file_prefix:"; - cstring_Print(parent.cmd.file_prefix, *arg); + *arg << "-package:"; + command::package_Print(parent.cmd, *arg); } - if (parent.cmd.nchild != 1) { + if (parent.cmd.ns.expr != "") { cstring *arg = &ary_Alloc(args); - *arg << "-nchild:"; - i32_Print(parent.cmd.nchild, *arg); + *arg << "-ns:"; + command::ns_Print(parent.cmd, *arg); } - if (parent.cmd.blocking != false) { + if (parent.cmd.install != false) { cstring *arg = &ary_Alloc(args); - *arg << "-blocking:"; - bool_Print(parent.cmd.blocking, *arg); + *arg << "-install:"; + bool_Print(parent.cmd.install, *arg); } - if (parent.cmd.nmsg != 1000) { + if (parent.cmd.update != false) { cstring *arg = &ary_Alloc(args); - *arg << "-nmsg:"; - i32_Print(parent.cmd.nmsg, *arg); + *arg << "-update:"; + bool_Print(parent.cmd.update, *arg); } - if (parent.cmd.trace.expr != "") { + if (parent.cmd.list != false) { cstring *arg = &ary_Alloc(args); - *arg << "-trace:"; - command::trace_Print(parent.cmd, *arg); + *arg << "-list:"; + bool_Print(parent.cmd.list, *arg); } - if (parent.cmd.timeout != 30) { + if (parent.cmd.diff != false) { cstring *arg = &ary_Alloc(args); - *arg << "-timeout:"; - i32_Print(parent.cmd.timeout, *arg); + *arg << "-diff:"; + bool_Print(parent.cmd.diff, *arg); } - if (parent.cmd.recvdelay_ns != 0) { + if (parent.cmd.push != false) { cstring *arg = &ary_Alloc(args); - *arg << "-recvdelay_ns:"; - i64_Print(parent.cmd.recvdelay_ns, *arg); + *arg << "-push:"; + bool_Print(parent.cmd.push, *arg); } - if (parent.cmd.senddelay_ns != 0) { + if (parent.cmd.check != false) { cstring *arg = &ary_Alloc(args); - *arg << "-senddelay_ns:"; - i64_Print(parent.cmd.senddelay_ns, *arg); + *arg << "-check:"; + bool_Print(parent.cmd.check, *arg); } - if (parent.cmd.msgsize_min != 64) { + if (parent.cmd.remove != false) { cstring *arg = &ary_Alloc(args); - *arg << "-msgsize_min:"; - i32_Print(parent.cmd.msgsize_min, *arg); + *arg << "-remove:"; + bool_Print(parent.cmd.remove, *arg); } - if (parent.cmd.msgsize_max != 1024) { + if (parent.cmd.origin != "") { cstring *arg = &ary_Alloc(args); - *arg << "-msgsize_max:"; - i32_Print(parent.cmd.msgsize_max, *arg); + *arg << "-origin:"; + Smallstr200_Print(parent.cmd.origin, *arg); } - if (parent.cmd.bufsize != 32768) { + if (parent.cmd.ref != "") { cstring *arg = &ary_Alloc(args); - *arg << "-bufsize:"; - i32_Print(parent.cmd.bufsize, *arg); + *arg << "-ref:"; + Smallstr50_Print(parent.cmd.ref, *arg); } - if (parent.cmd.recvdelay != 0) { + if (parent.cmd.dry_run != false) { cstring *arg = &ary_Alloc(args); - *arg << "-recvdelay:"; - i64_Print(parent.cmd.recvdelay, *arg); + *arg << "-dry_run:"; + bool_Print(parent.cmd.dry_run, *arg); } - for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { - ary_Alloc(args) << "-verbose"; + + if (parent.cmd.showrec != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-showrec:"; + bool_Print(parent.cmd.showrec, *arg); } -} -// --- command.ams_sendtest_proc..Uninit -void command::ams_sendtest_proc_Uninit(command::ams_sendtest_proc& parent) { - command::ams_sendtest_proc &row = parent; (void)row; + if (parent.cmd.showfile != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-showfile:"; + bool_Print(parent.cmd.showfile, *arg); + } - // command.ams_sendtest_proc.ams_sendtest.Uninit (Exec) // - ams_sendtest_Kill(parent); // kill child, ensure forward progress -} + if (parent.cmd.R != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-R:"; + bool_Print(parent.cmd.R, *arg); + } -// --- command.apm.package.Print -// Print back to string -void command::package_Print(command::apm& parent, algo::cstring &out) { - Regx_Print(parent.package, out); + if (parent.cmd.l != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-l:"; + bool_Print(parent.cmd.l, *arg); + } + + if (parent.cmd.reset != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-reset:"; + bool_Print(parent.cmd.reset, *arg); + } + + if (parent.cmd.checkclean != true) { + cstring *arg = &ary_Alloc(args); + *arg << "-checkclean:"; + bool_Print(parent.cmd.checkclean, *arg); + } + + if (parent.cmd.t != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-t:"; + bool_Print(parent.cmd.t, *arg); + } + + if (parent.cmd.stat != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-stat:"; + bool_Print(parent.cmd.stat, *arg); + } + + if (parent.cmd.annotate != "") { + cstring *arg = &ary_Alloc(args); + *arg << "-annotate:"; + cstring_Print(parent.cmd.annotate, *arg); + } + + if (parent.cmd.data_in != "data") { + cstring *arg = &ary_Alloc(args); + *arg << "-data_in:"; + cstring_Print(parent.cmd.data_in, *arg); + } + + if (parent.cmd.e != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-e:"; + bool_Print(parent.cmd.e, *arg); + } + + if (parent.cmd.binpath != "bin") { + cstring *arg = &ary_Alloc(args); + *arg << "-binpath:"; + cstring_Print(parent.cmd.binpath, *arg); + } + for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { + ary_Alloc(args) << "-verbose"; + } } -// --- command.apm.package.ReadStrptrMaybe -// Read Regx from string -// Convert string to field. Return success value -bool command::package_ReadStrptrMaybe(command::apm& parent, algo::strptr in) { - bool retval = true; - Regx_ReadSql(parent.package, in, true); - return retval; +// --- command.apm_proc..Uninit +void command::apm_proc_Uninit(command::apm_proc& parent) { + command::apm_proc &row = parent; (void)row; + + // command.apm_proc.apm.Uninit (Exec) // + apm_Kill(parent); // kill child, ensure forward progress } -// --- command.apm.ns.Print +// --- command.aqlite.ns.Print // Print back to string -void command::ns_Print(command::apm& parent, algo::cstring &out) { +void command::ns_Print(command::aqlite& parent, algo::cstring &out) { Regx_Print(parent.ns, out); } -// --- command.apm.ns.ReadStrptrMaybe +// --- command.aqlite.ns.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::ns_ReadStrptrMaybe(command::apm& parent, algo::strptr in) { +bool command::ns_ReadStrptrMaybe(command::aqlite& parent, algo::strptr in) { bool retval = true; Regx_ReadSql(parent.ns, in, true); return retval; } -// --- command.apm..ReadFieldMaybe -bool command::apm_ReadFieldMaybe(command::apm& parent, algo::strptr field, algo::strptr strval) { +// --- command.aqlite..ReadFieldMaybe +bool command::aqlite_ReadFieldMaybe(command::aqlite& parent, algo::strptr field, algo::strptr strval) { bool retval = true; command::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_pkgdata: { - retval = algo::cstring_ReadStrptrMaybe(parent.pkgdata, strval); - break; - } - case command_FieldId_package: { - retval = package_ReadStrptrMaybe(parent, strval); - break; - } + } break; + case command_FieldId_schema: { + retval = algo::cstring_ReadStrptrMaybe(parent.schema, strval); + } break; + case command_FieldId_cmd: { + retval = algo::cstring_ReadStrptrMaybe(parent.cmd, strval); + } break; case command_FieldId_ns: { retval = ns_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_install: { - retval = bool_ReadStrptrMaybe(parent.install, strval); - break; - } - case command_FieldId_update: { - retval = bool_ReadStrptrMaybe(parent.update, strval); - break; - } - case command_FieldId_list: { - retval = bool_ReadStrptrMaybe(parent.list, strval); - break; - } - case command_FieldId_diff: { - retval = bool_ReadStrptrMaybe(parent.diff, strval); - break; - } - case command_FieldId_push: { - retval = bool_ReadStrptrMaybe(parent.push, strval); - break; - } - case command_FieldId_check: { - retval = bool_ReadStrptrMaybe(parent.check, strval); - break; - } - case command_FieldId_remove: { - retval = bool_ReadStrptrMaybe(parent.remove, strval); - break; - } - case command_FieldId_origin: { - retval = algo::Smallstr200_ReadStrptrMaybe(parent.origin, strval); - break; - } - case command_FieldId_ref: { - retval = algo::Smallstr50_ReadStrptrMaybe(parent.ref, strval); - break; - } - case command_FieldId_dry_run: { - retval = bool_ReadStrptrMaybe(parent.dry_run, strval); - break; - } - case command_FieldId_showrec: { - retval = bool_ReadStrptrMaybe(parent.showrec, strval); - break; - } - case command_FieldId_showfile: { - retval = bool_ReadStrptrMaybe(parent.showfile, strval); - break; - } - case command_FieldId_R: { - retval = bool_ReadStrptrMaybe(parent.R, strval); - break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- command.aqlite..ReadTupleMaybe +// Read fields of command::aqlite from attributes of ascii tuple TUPLE +bool command::aqlite_ReadTupleMaybe(command::aqlite &parent, algo::Tuple &tuple) { + bool retval = true; + int anon_idx = 0; + ind_beg(algo::Tuple_attrs_curs,attr,tuple) { + if (ch_N(attr.name) == 0) { + attr.name = aqlite_GetAnon(parent, anon_idx++); } - case command_FieldId_l: { - retval = bool_ReadStrptrMaybe(parent.l, strval); - break; - } - case command_FieldId_reset: { - retval = bool_ReadStrptrMaybe(parent.reset, strval); - break; - } - case command_FieldId_checkclean: { - retval = bool_ReadStrptrMaybe(parent.checkclean, strval); - break; - } - case command_FieldId_t: { - retval = bool_ReadStrptrMaybe(parent.t, strval); - break; - } - case command_FieldId_stat: { - retval = bool_ReadStrptrMaybe(parent.stat, strval); - break; - } - case command_FieldId_annotate: { - retval = algo::cstring_ReadStrptrMaybe(parent.annotate, strval); - break; - } - case command_FieldId_data_in: { - retval = algo::cstring_ReadStrptrMaybe(parent.data_in, strval); - break; - } - case command_FieldId_e: { - retval = bool_ReadStrptrMaybe(parent.e, strval); - break; - } - case command_FieldId_binpath: { - retval = algo::cstring_ReadStrptrMaybe(parent.binpath, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- command.apm..ReadTupleMaybe -// Read fields of command::apm from attributes of ascii tuple TUPLE -bool command::apm_ReadTupleMaybe(command::apm &parent, algo::Tuple &tuple) { - bool retval = true; - int anon_idx = 0; - ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - if (ch_N(attr.name) == 0) { - attr.name = apm_GetAnon(parent, anon_idx++); - } - retval = apm_ReadFieldMaybe(parent, attr.name, attr.value); - if (!retval) { + retval = aqlite_ReadFieldMaybe(parent, attr.name, attr.value); + if (!retval) { break; } }ind_end; return retval; } -// --- command.apm..Init +// --- command.aqlite..Init // Set all fields to initial values. -void command::apm_Init(command::apm& parent) { +void command::aqlite_Init(command::aqlite& parent) { parent.in = algo::strptr("data"); - parent.pkgdata = algo::strptr(""); - Regx_ReadSql(parent.package, "", true); - Regx_ReadSql(parent.ns, "", true); - parent.install = bool(false); - parent.update = bool(false); - parent.list = bool(false); - parent.diff = bool(false); - parent.push = bool(false); - parent.check = bool(false); - parent.remove = bool(false); - parent.origin = algo::strptr(""); - parent.ref = algo::strptr(""); - parent.dry_run = bool(false); - parent.showrec = bool(false); - parent.showfile = bool(false); - parent.R = bool(false); - parent.l = bool(false); - parent.reset = bool(false); - parent.checkclean = bool(true); - parent.t = bool(false); - parent.stat = bool(false); - parent.annotate = algo::strptr(""); - parent.data_in = algo::strptr("data"); - parent.e = bool(false); - parent.binpath = algo::strptr("bin"); + parent.schema = algo::strptr("data"); + Regx_ReadSql(parent.ns, "dmmeta", true); } -// --- command.apm..ToCmdline +// --- command.aqlite..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::apm_ToCmdline(command::apm& row) { +tempstr command::aqlite_ToCmdline(command::aqlite& row) { tempstr ret; - ret << "bin/apm "; - apm_PrintArgv(row, ret); + ret << "bin/aqlite "; + aqlite_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -9557,10 +10105,10 @@ tempstr command::apm_ToCmdline(command::apm& row) { return ret; } -// --- command.apm..PrintArgv +// --- command.aqlite..PrintArgv // print string representation of ROW to string STR -// cfmt:command.apm.Argv printfmt:Tuple -void command::apm_PrintArgv(command::apm& row, algo::cstring& str) { +// cfmt:command.aqlite.Argv printfmt:Tuple +void command::aqlite_PrintArgv(command::aqlite& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; @@ -9570,300 +10118,69 @@ void command::apm_PrintArgv(command::apm& row, algo::cstring& str) { str << " -in:"; strptr_PrintBash(temp,str); } - if (!(row.pkgdata == "")) { + if (!(row.schema == "data")) { ch_RemoveAll(temp); - cstring_Print(row.pkgdata, temp); - str << " -pkgdata:"; + cstring_Print(row.schema, temp); + str << " -schema:"; strptr_PrintBash(temp,str); } ch_RemoveAll(temp); - command::package_Print(const_cast(row), temp); - str << " -package:"; + cstring_Print(row.cmd, temp); + str << " -cmd:"; strptr_PrintBash(temp,str); - if (!(row.ns.expr == "")) { + if (!(row.ns.expr == "dmmeta")) { ch_RemoveAll(temp); - command::ns_Print(const_cast(row), temp); + command::ns_Print(const_cast(row), temp); str << " -ns:"; strptr_PrintBash(temp,str); } - if (!(row.install == false)) { - ch_RemoveAll(temp); - bool_Print(row.install, temp); - str << " -install:"; - strptr_PrintBash(temp,str); - } - if (!(row.update == false)) { - ch_RemoveAll(temp); - bool_Print(row.update, temp); - str << " -update:"; - strptr_PrintBash(temp,str); - } - if (!(row.list == false)) { - ch_RemoveAll(temp); - bool_Print(row.list, temp); - str << " -list:"; - strptr_PrintBash(temp,str); - } - if (!(row.diff == false)) { - ch_RemoveAll(temp); - bool_Print(row.diff, temp); - str << " -diff:"; - strptr_PrintBash(temp,str); - } - if (!(row.push == false)) { - ch_RemoveAll(temp); - bool_Print(row.push, temp); - str << " -push:"; - strptr_PrintBash(temp,str); - } - if (!(row.check == false)) { - ch_RemoveAll(temp); - bool_Print(row.check, temp); - str << " -check:"; - strptr_PrintBash(temp,str); - } - if (!(row.remove == false)) { - ch_RemoveAll(temp); - bool_Print(row.remove, temp); - str << " -remove:"; - strptr_PrintBash(temp,str); - } - if (!(row.origin == "")) { - ch_RemoveAll(temp); - Smallstr200_Print(row.origin, temp); - str << " -origin:"; - strptr_PrintBash(temp,str); - } - if (!(row.ref == "")) { - ch_RemoveAll(temp); - Smallstr50_Print(row.ref, temp); - str << " -ref:"; - strptr_PrintBash(temp,str); - } - if (!(row.dry_run == false)) { - ch_RemoveAll(temp); - bool_Print(row.dry_run, temp); - str << " -dry_run:"; - strptr_PrintBash(temp,str); - } - if (!(row.showrec == false)) { - ch_RemoveAll(temp); - bool_Print(row.showrec, temp); - str << " -showrec:"; - strptr_PrintBash(temp,str); - } - if (!(row.showfile == false)) { - ch_RemoveAll(temp); - bool_Print(row.showfile, temp); - str << " -showfile:"; - strptr_PrintBash(temp,str); - } - if (!(row.R == false)) { - ch_RemoveAll(temp); - bool_Print(row.R, temp); - str << " -R:"; - strptr_PrintBash(temp,str); - } - if (!(row.l == false)) { - ch_RemoveAll(temp); - bool_Print(row.l, temp); - str << " -l:"; - strptr_PrintBash(temp,str); - } - if (!(row.reset == false)) { - ch_RemoveAll(temp); - bool_Print(row.reset, temp); - str << " -reset:"; - strptr_PrintBash(temp,str); - } - if (!(row.checkclean == true)) { - ch_RemoveAll(temp); - bool_Print(row.checkclean, temp); - str << " -checkclean:"; - strptr_PrintBash(temp,str); - } - if (!(row.t == false)) { - ch_RemoveAll(temp); - bool_Print(row.t, temp); - str << " -t:"; - strptr_PrintBash(temp,str); - } - if (!(row.stat == false)) { - ch_RemoveAll(temp); - bool_Print(row.stat, temp); - str << " -stat:"; - strptr_PrintBash(temp,str); - } - if (!(row.annotate == "")) { - ch_RemoveAll(temp); - cstring_Print(row.annotate, temp); - str << " -annotate:"; - strptr_PrintBash(temp,str); - } - if (!(row.data_in == "data")) { - ch_RemoveAll(temp); - cstring_Print(row.data_in, temp); - str << " -data_in:"; - strptr_PrintBash(temp,str); - } - if (!(row.e == false)) { - ch_RemoveAll(temp); - bool_Print(row.e, temp); - str << " -e:"; - strptr_PrintBash(temp,str); - } - if (!(row.binpath == "bin")) { - ch_RemoveAll(temp); - cstring_Print(row.binpath, temp); - str << " -binpath:"; - strptr_PrintBash(temp,str); - } } -// --- command.apm..GetAnon -algo::strptr command::apm_GetAnon(command::apm &parent, i32 idx) { +// --- command.aqlite..GetAnon +algo::strptr command::aqlite_GetAnon(command::aqlite &parent, i32 idx) { (void)parent;//only to avoid -Wunused-parameter switch(idx) { - case(0): return strptr("package", 7); + case(0): return strptr("cmd", 3); default: return algo::strptr(); } } -// --- command.apm..NArgs +// --- command.aqlite..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::apm_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::aqlite_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_pkgdata: { // $comment + case command_FieldId_schema: { // *out_anon = false; } break; - case command_FieldId_package: { // $comment + case command_FieldId_cmd: { // *out_anon = true; } break; - case command_FieldId_ns: { // $comment - *out_anon = false; - } break; - case command_FieldId_install: { // $comment - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_update: { // bool: no argument required but value may be specified as install:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_list: { // bool: no argument required but value may be specified as update:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_diff: { // bool: no argument required but value may be specified as list:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_push: { // bool: no argument required but value may be specified as diff:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_check: { // bool: no argument required but value may be specified as push:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_remove: { // bool: no argument required but value may be specified as check:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_origin: { // bool: no argument required but value may be specified as remove:Y - *out_anon = false; - } break; - case command_FieldId_ref: { // bool: no argument required but value may be specified as remove:Y - *out_anon = false; - } break; - case command_FieldId_dry_run: { // bool: no argument required but value may be specified as remove:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_showrec: { // bool: no argument required but value may be specified as dry_run:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_showfile: { // bool: no argument required but value may be specified as showrec:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_R: { // bool: no argument required but value may be specified as showfile:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_l: { // bool: no argument required but value may be specified as R:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_reset: { // bool: no argument required but value may be specified as l:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_checkclean: { // bool: no argument required but value may be specified as reset:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_t: { // bool: no argument required but value may be specified as checkclean:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_stat: { // bool: no argument required but value may be specified as t:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_annotate: { // bool: no argument required but value may be specified as stat:Y - *out_anon = false; - } break; - case command_FieldId_data_in: { // bool: no argument required but value may be specified as stat:Y - *out_anon = false; - } break; - case command_FieldId_e: { // bool: no argument required but value may be specified as stat:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_binpath: { // bool: no argument required but value may be specified as e:Y + case command_FieldId_ns: { // *out_anon = false; } break; default: retval=-1; // unrecognized } + (void)out_dflt;//only to avoid -Wunused-parameter return retval; } -// --- command.apm_proc.apm.Start +// --- command.aqlite_proc.aqlite.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::apm_Start(command::apm_proc& parent) { +int command::aqlite_Start(command::aqlite_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(apm_ToCmdline(parent)); // maybe print command + verblog(aqlite_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(apm_ToCmdline(parent)); + tempstr cmdline(aqlite_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -9875,10 +10192,10 @@ int command::apm_Start(command::apm_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= apm_Execv(parent); + if (retval==0) retval= aqlite_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.apm_execv" + prerr("command.aqlite_execv" <&" << pipefd[1]; - apm_Start(parent); + aqlite_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.apm_proc.apm.Kill +// --- command.aqlite_proc.aqlite.Kill // Kill subprocess and wait -void command::apm_Kill(command::apm_proc& parent) { - if (parent.pid != 0) { +void command::aqlite_Kill(command::aqlite_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - apm_Wait(parent); + aqlite_Wait(parent); } } -// --- command.apm_proc.apm.Wait +// --- command.aqlite_proc.aqlite.Wait // Wait for subprocess to return -void command::apm_Wait(command::apm_proc& parent) { +void command::aqlite_Wait(command::aqlite_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -9933,31 +10250,31 @@ void command::apm_Wait(command::apm_proc& parent) { } } -// --- command.apm_proc.apm.Exec +// --- command.aqlite_proc.aqlite.Exec // Start + Wait // Execute subprocess and return exit code -int command::apm_Exec(command::apm_proc& parent) { - apm_Start(parent); - apm_Wait(parent); +int command::aqlite_Exec(command::aqlite_proc& parent) { + aqlite_Start(parent); + aqlite_Wait(parent); return parent.status; } -// --- command.apm_proc.apm.ExecX +// --- command.aqlite_proc.aqlite.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::apm_ExecX(command::apm_proc& parent) { - int rc = apm_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",apm_ToCmdline(parent)) +void command::aqlite_ExecX(command::aqlite_proc& parent) { + int rc = aqlite_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",aqlite_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.apm_proc.apm.Execv +// --- command.aqlite_proc.aqlite.Execv // Call execv() // Call execv with specified parameters -int command::apm_Execv(command::apm_proc& parent) { +int command::aqlite_Execv(command::aqlite_proc& parent) { int ret = 0; algo::StringAry args; - apm_ToArgv(parent, args); + aqlite_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -9969,11 +10286,11 @@ int command::apm_Execv(command::apm_proc& parent) { return ret; } -// --- command.apm_proc.apm.ToCmdline -algo::tempstr command::apm_ToCmdline(command::apm_proc& parent) { +// --- command.aqlite_proc.aqlite.ToCmdline +algo::tempstr command::aqlite_ToCmdline(command::aqlite_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::apm_PrintArgv(parent.cmd,retval); + command::aqlite_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -9986,9 +10303,9 @@ algo::tempstr command::apm_ToCmdline(command::apm_proc& parent) { return retval; } -// --- command.apm_proc.apm.ToArgv +// --- command.aqlite_proc.aqlite.ToArgv // Form array from the command line -void command::apm_ToArgv(command::apm_proc& parent, algo::StringAry& args) { +void command::aqlite_ToArgv(command::aqlite_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; @@ -9998,218 +10315,113 @@ void command::apm_ToArgv(command::apm_proc& parent, algo::StringAry& args) { cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.pkgdata != "") { + if (parent.cmd.schema != "data") { cstring *arg = &ary_Alloc(args); - *arg << "-pkgdata:"; - cstring_Print(parent.cmd.pkgdata, *arg); + *arg << "-schema:"; + cstring_Print(parent.cmd.schema, *arg); } - if (parent.cmd.package.expr != "") { + if (true) { cstring *arg = &ary_Alloc(args); - *arg << "-package:"; - command::package_Print(parent.cmd, *arg); + *arg << "-cmd:"; + cstring_Print(parent.cmd.cmd, *arg); } - if (parent.cmd.ns.expr != "") { + if (parent.cmd.ns.expr != "dmmeta") { cstring *arg = &ary_Alloc(args); *arg << "-ns:"; command::ns_Print(parent.cmd, *arg); } - - if (parent.cmd.install != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-install:"; - bool_Print(parent.cmd.install, *arg); + for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { + ary_Alloc(args) << "-verbose"; } +} - if (parent.cmd.update != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-update:"; - bool_Print(parent.cmd.update, *arg); - } +// --- command.aqlite_proc..Uninit +void command::aqlite_proc_Uninit(command::aqlite_proc& parent) { + command::aqlite_proc &row = parent; (void)row; - if (parent.cmd.list != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-list:"; - bool_Print(parent.cmd.list, *arg); - } + // command.aqlite_proc.aqlite.Uninit (Exec) // + aqlite_Kill(parent); // kill child, ensure forward progress +} - if (parent.cmd.diff != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-diff:"; - bool_Print(parent.cmd.diff, *arg); - } +// --- command.atf_amc.amctest.Print +// Print back to string +void command::amctest_Print(command::atf_amc& parent, algo::cstring &out) { + Regx_Print(parent.amctest, out); +} - if (parent.cmd.push != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-push:"; - bool_Print(parent.cmd.push, *arg); - } +// --- command.atf_amc.amctest.ReadStrptrMaybe +// Read Regx from string +// Convert string to field. Return success value +bool command::amctest_ReadStrptrMaybe(command::atf_amc& parent, algo::strptr in) { + bool retval = true; + Regx_ReadSql(parent.amctest, in, true); + return retval; +} - if (parent.cmd.check != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-check:"; - bool_Print(parent.cmd.check, *arg); +// --- command.atf_amc..ReadFieldMaybe +bool command::atf_amc_ReadFieldMaybe(command::atf_amc& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + command::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case command_FieldId_in: { + retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); + } break; + case command_FieldId_amctest: { + retval = amctest_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_dofork: { + retval = bool_ReadStrptrMaybe(parent.dofork, strval); + } break; + case command_FieldId_q: { + retval = bool_ReadStrptrMaybe(parent.q, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } - - if (parent.cmd.remove != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-remove:"; - bool_Print(parent.cmd.remove, *arg); + if (!retval) { + algo_lib::AppendErrtext("attr",field); } + return retval; +} - if (parent.cmd.origin != "") { - cstring *arg = &ary_Alloc(args); - *arg << "-origin:"; - Smallstr200_Print(parent.cmd.origin, *arg); - } +// --- command.atf_amc..ReadTupleMaybe +// Read fields of command::atf_amc from attributes of ascii tuple TUPLE +bool command::atf_amc_ReadTupleMaybe(command::atf_amc &parent, algo::Tuple &tuple) { + bool retval = true; + int anon_idx = 0; + ind_beg(algo::Tuple_attrs_curs,attr,tuple) { + if (ch_N(attr.name) == 0) { + attr.name = atf_amc_GetAnon(parent, anon_idx++); + } + retval = atf_amc_ReadFieldMaybe(parent, attr.name, attr.value); + if (!retval) { + break; + } + }ind_end; + return retval; +} - if (parent.cmd.ref != "") { - cstring *arg = &ary_Alloc(args); - *arg << "-ref:"; - Smallstr50_Print(parent.cmd.ref, *arg); - } +// --- command.atf_amc..Init +// Set all fields to initial values. +void command::atf_amc_Init(command::atf_amc& parent) { + parent.in = algo::strptr("data"); + Regx_ReadSql(parent.amctest, "%", true); + parent.dofork = bool(true); + parent.q = bool(false); +} - if (parent.cmd.dry_run != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-dry_run:"; - bool_Print(parent.cmd.dry_run, *arg); - } - - if (parent.cmd.showrec != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-showrec:"; - bool_Print(parent.cmd.showrec, *arg); - } - - if (parent.cmd.showfile != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-showfile:"; - bool_Print(parent.cmd.showfile, *arg); - } - - if (parent.cmd.R != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-R:"; - bool_Print(parent.cmd.R, *arg); - } - - if (parent.cmd.l != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-l:"; - bool_Print(parent.cmd.l, *arg); - } - - if (parent.cmd.reset != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-reset:"; - bool_Print(parent.cmd.reset, *arg); - } - - if (parent.cmd.checkclean != true) { - cstring *arg = &ary_Alloc(args); - *arg << "-checkclean:"; - bool_Print(parent.cmd.checkclean, *arg); - } - - if (parent.cmd.t != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-t:"; - bool_Print(parent.cmd.t, *arg); - } - - if (parent.cmd.stat != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-stat:"; - bool_Print(parent.cmd.stat, *arg); - } - - if (parent.cmd.annotate != "") { - cstring *arg = &ary_Alloc(args); - *arg << "-annotate:"; - cstring_Print(parent.cmd.annotate, *arg); - } - - if (parent.cmd.data_in != "data") { - cstring *arg = &ary_Alloc(args); - *arg << "-data_in:"; - cstring_Print(parent.cmd.data_in, *arg); - } - - if (parent.cmd.e != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-e:"; - bool_Print(parent.cmd.e, *arg); - } - - if (parent.cmd.binpath != "bin") { - cstring *arg = &ary_Alloc(args); - *arg << "-binpath:"; - cstring_Print(parent.cmd.binpath, *arg); - } - for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { - ary_Alloc(args) << "-verbose"; - } -} - -// --- command.apm_proc..Uninit -void command::apm_proc_Uninit(command::apm_proc& parent) { - command::apm_proc &row = parent; (void)row; - - // command.apm_proc.apm.Uninit (Exec) // - apm_Kill(parent); // kill child, ensure forward progress -} - -// --- command.aqlite..ReadFieldMaybe -bool command::aqlite_ReadFieldMaybe(command::aqlite& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - command::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case command_FieldId_in: { - retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_schema: { - retval = algo::cstring_ReadStrptrMaybe(parent.schema, strval); - break; - } - case command_FieldId_cmd: { - retval = algo::cstring_ReadStrptrMaybe(parent.cmd, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- command.aqlite..ReadTupleMaybe -// Read fields of command::aqlite from attributes of ascii tuple TUPLE -bool command::aqlite_ReadTupleMaybe(command::aqlite &parent, algo::Tuple &tuple) { - bool retval = true; - int anon_idx = 0; - ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - if (ch_N(attr.name) == 0) { - attr.name = aqlite_GetAnon(parent, anon_idx++); - } - retval = aqlite_ReadFieldMaybe(parent, attr.name, attr.value); - if (!retval) { - break; - } - }ind_end; - return retval; -} - -// --- command.aqlite..ToCmdline +// --- command.atf_amc..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::aqlite_ToCmdline(command::aqlite& row) { +tempstr command::atf_amc_ToCmdline(command::atf_amc& row) { tempstr ret; - ret << "bin/aqlite "; - aqlite_PrintArgv(row, ret); + ret << "bin/atf_amc "; + atf_amc_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -10220,10 +10432,10 @@ tempstr command::aqlite_ToCmdline(command::aqlite& row) { return ret; } -// --- command.aqlite..PrintArgv +// --- command.atf_amc..PrintArgv // print string representation of ROW to string STR -// cfmt:command.aqlite.Argv printfmt:Tuple -void command::aqlite_PrintArgv(command::aqlite& row, algo::cstring& str) { +// cfmt:command.atf_amc.Argv printfmt:Tuple +void command::atf_amc_PrintArgv(command::atf_amc& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; @@ -10233,60 +10445,72 @@ void command::aqlite_PrintArgv(command::aqlite& row, algo::cstring& str) { str << " -in:"; strptr_PrintBash(temp,str); } - if (!(row.schema == "data")) { + ch_RemoveAll(temp); + command::amctest_Print(const_cast(row), temp); + str << " -amctest:"; + strptr_PrintBash(temp,str); + if (!(row.dofork == true)) { ch_RemoveAll(temp); - cstring_Print(row.schema, temp); - str << " -schema:"; + bool_Print(row.dofork, temp); + str << " -dofork:"; + strptr_PrintBash(temp,str); + } + if (!(row.q == false)) { + ch_RemoveAll(temp); + bool_Print(row.q, temp); + str << " -q:"; strptr_PrintBash(temp,str); } - ch_RemoveAll(temp); - cstring_Print(row.cmd, temp); - str << " -cmd:"; - strptr_PrintBash(temp,str); } -// --- command.aqlite..GetAnon -algo::strptr command::aqlite_GetAnon(command::aqlite &parent, i32 idx) { +// --- command.atf_amc..GetAnon +algo::strptr command::atf_amc_GetAnon(command::atf_amc &parent, i32 idx) { (void)parent;//only to avoid -Wunused-parameter switch(idx) { - case(0): return strptr("cmd", 3); + case(0): return strptr("amctest", 7); default: return algo::strptr(); } } -// --- command.aqlite..NArgs +// --- command.atf_amc..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::aqlite_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::atf_amc_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_schema: { // $comment + case command_FieldId_amctest: { // + *out_anon = true; + } break; + case command_FieldId_dofork: { // bool: no argument required but value may be specified as dofork:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_cmd: { // $comment - *out_anon = true; + case command_FieldId_q: { // bool: no argument required but value may be specified as q:Y + *out_anon = false; + retval=0; + out_dflt="Y"; } break; default: retval=-1; // unrecognized } - (void)out_dflt;//only to avoid -Wunused-parameter return retval; } -// --- command.aqlite_proc.aqlite.Start +// --- command.atf_amc_proc.atf_amc.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::aqlite_Start(command::aqlite_proc& parent) { +int command::atf_amc_Start(command::atf_amc_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(aqlite_ToCmdline(parent)); // maybe print command + verblog(atf_amc_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(aqlite_ToCmdline(parent)); + tempstr cmdline(atf_amc_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -10298,10 +10522,10 @@ int command::aqlite_Start(command::aqlite_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= aqlite_Execv(parent); + if (retval==0) retval= atf_amc_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.aqlite_execv" + prerr("command.atf_amc_execv" <&" << pipefd[1]; - aqlite_Start(parent); + atf_amc_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.aqlite_proc.aqlite.Kill +// --- command.atf_amc_proc.atf_amc.Kill // Kill subprocess and wait -void command::aqlite_Kill(command::aqlite_proc& parent) { - if (parent.pid != 0) { +void command::atf_amc_Kill(command::atf_amc_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - aqlite_Wait(parent); + atf_amc_Wait(parent); } } -// --- command.aqlite_proc.aqlite.Wait +// --- command.atf_amc_proc.atf_amc.Wait // Wait for subprocess to return -void command::aqlite_Wait(command::aqlite_proc& parent) { +void command::atf_amc_Wait(command::atf_amc_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -10356,31 +10580,31 @@ void command::aqlite_Wait(command::aqlite_proc& parent) { } } -// --- command.aqlite_proc.aqlite.Exec +// --- command.atf_amc_proc.atf_amc.Exec // Start + Wait // Execute subprocess and return exit code -int command::aqlite_Exec(command::aqlite_proc& parent) { - aqlite_Start(parent); - aqlite_Wait(parent); +int command::atf_amc_Exec(command::atf_amc_proc& parent) { + atf_amc_Start(parent); + atf_amc_Wait(parent); return parent.status; } -// --- command.aqlite_proc.aqlite.ExecX +// --- command.atf_amc_proc.atf_amc.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::aqlite_ExecX(command::aqlite_proc& parent) { - int rc = aqlite_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",aqlite_ToCmdline(parent)) +void command::atf_amc_ExecX(command::atf_amc_proc& parent) { + int rc = atf_amc_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_amc_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.aqlite_proc.aqlite.Execv +// --- command.atf_amc_proc.atf_amc.Execv // Call execv() // Call execv with specified parameters -int command::aqlite_Execv(command::aqlite_proc& parent) { +int command::atf_amc_Execv(command::atf_amc_proc& parent) { int ret = 0; algo::StringAry args; - aqlite_ToArgv(parent, args); + atf_amc_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -10392,11 +10616,11 @@ int command::aqlite_Execv(command::aqlite_proc& parent) { return ret; } -// --- command.aqlite_proc.aqlite.ToCmdline -algo::tempstr command::aqlite_ToCmdline(command::aqlite_proc& parent) { +// --- command.atf_amc_proc.atf_amc.ToCmdline +algo::tempstr command::atf_amc_ToCmdline(command::atf_amc_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::aqlite_PrintArgv(parent.cmd,retval); + command::atf_amc_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -10409,9 +10633,9 @@ algo::tempstr command::aqlite_ToCmdline(command::aqlite_proc& parent) { return retval; } -// --- command.aqlite_proc.aqlite.ToArgv +// --- command.atf_amc_proc.atf_amc.ToArgv // Form array from the command line -void command::aqlite_ToArgv(command::aqlite_proc& parent, algo::StringAry& args) { +void command::atf_amc_ToArgv(command::atf_amc_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; @@ -10421,68 +10645,94 @@ void command::aqlite_ToArgv(command::aqlite_proc& parent, algo::StringAry& args) cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.schema != "data") { + if (parent.cmd.amctest.expr != "%") { cstring *arg = &ary_Alloc(args); - *arg << "-schema:"; - cstring_Print(parent.cmd.schema, *arg); + *arg << "-amctest:"; + command::amctest_Print(parent.cmd, *arg); } - if (true) { + if (parent.cmd.dofork != true) { cstring *arg = &ary_Alloc(args); - *arg << "-cmd:"; - cstring_Print(parent.cmd.cmd, *arg); - } + *arg << "-dofork:"; + bool_Print(parent.cmd.dofork, *arg); + } + + if (parent.cmd.q != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-q:"; + bool_Print(parent.cmd.q, *arg); + } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } } -// --- command.aqlite_proc..Uninit -void command::aqlite_proc_Uninit(command::aqlite_proc& parent) { - command::aqlite_proc &row = parent; (void)row; +// --- command.atf_amc_proc..Uninit +void command::atf_amc_proc_Uninit(command::atf_amc_proc& parent) { + command::atf_amc_proc &row = parent; (void)row; - // command.aqlite_proc.aqlite.Uninit (Exec) // - aqlite_Kill(parent); // kill child, ensure forward progress + // command.atf_amc_proc.atf_amc.Uninit (Exec) // + atf_amc_Kill(parent); // kill child, ensure forward progress } -// --- command.atf_amc.amctest.Print +// --- command.atf_ci.citest.Print // Print back to string -void command::amctest_Print(command::atf_amc& parent, algo::cstring &out) { - Regx_Print(parent.amctest, out); +void command::citest_Print(command::atf_ci& parent, algo::cstring &out) { + Regx_Print(parent.citest, out); } -// --- command.atf_amc.amctest.ReadStrptrMaybe +// --- command.atf_ci.citest.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::amctest_ReadStrptrMaybe(command::atf_amc& parent, algo::strptr in) { +bool command::citest_ReadStrptrMaybe(command::atf_ci& parent, algo::strptr in) { bool retval = true; - Regx_ReadSql(parent.amctest, in, true); + Regx_ReadSql(parent.citest, in, true); return retval; } -// --- command.atf_amc..ReadFieldMaybe -bool command::atf_amc_ReadFieldMaybe(command::atf_amc& parent, algo::strptr field, algo::strptr strval) { +// --- command.atf_ci.cijob.Print +// Print back to string +void command::cijob_Print(command::atf_ci& parent, algo::cstring &out) { + Regx_Print(parent.cijob, out); +} + +// --- command.atf_ci.cijob.ReadStrptrMaybe +// Read Regx from string +// Convert string to field. Return success value +bool command::cijob_ReadStrptrMaybe(command::atf_ci& parent, algo::strptr in) { + bool retval = true; + Regx_ReadSql(parent.cijob, in, true); + return retval; +} + +// --- command.atf_ci..ReadFieldMaybe +bool command::atf_ci_ReadFieldMaybe(command::atf_ci& parent, algo::strptr field, algo::strptr strval) { bool retval = true; command::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_amctest: { - retval = amctest_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_dofork: { - retval = bool_ReadStrptrMaybe(parent.dofork, strval); - break; - } - case command_FieldId_q: { - retval = bool_ReadStrptrMaybe(parent.q, strval); - break; - } - default: break; + } break; + case command_FieldId_citest: { + retval = citest_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_maxerr: { + retval = i32_ReadStrptrMaybe(parent.maxerr, strval); + } break; + case command_FieldId_cijob: { + retval = cijob_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_capture: { + retval = bool_ReadStrptrMaybe(parent.capture, strval); + } break; + case command_FieldId_check_clean: { + retval = bool_ReadStrptrMaybe(parent.check_clean, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -10490,16 +10740,16 @@ bool command::atf_amc_ReadFieldMaybe(command::atf_amc& parent, algo::strptr fiel return retval; } -// --- command.atf_amc..ReadTupleMaybe -// Read fields of command::atf_amc from attributes of ascii tuple TUPLE -bool command::atf_amc_ReadTupleMaybe(command::atf_amc &parent, algo::Tuple &tuple) { +// --- command.atf_ci..ReadTupleMaybe +// Read fields of command::atf_ci from attributes of ascii tuple TUPLE +bool command::atf_ci_ReadTupleMaybe(command::atf_ci &parent, algo::Tuple &tuple) { bool retval = true; int anon_idx = 0; ind_beg(algo::Tuple_attrs_curs,attr,tuple) { if (ch_N(attr.name) == 0) { - attr.name = atf_amc_GetAnon(parent, anon_idx++); + attr.name = atf_ci_GetAnon(parent, anon_idx++); } - retval = atf_amc_ReadFieldMaybe(parent, attr.name, attr.value); + retval = atf_ci_ReadFieldMaybe(parent, attr.name, attr.value); if (!retval) { break; } @@ -10507,22 +10757,24 @@ bool command::atf_amc_ReadTupleMaybe(command::atf_amc &parent, algo::Tuple &tupl return retval; } -// --- command.atf_amc..Init +// --- command.atf_ci..Init // Set all fields to initial values. -void command::atf_amc_Init(command::atf_amc& parent) { +void command::atf_ci_Init(command::atf_ci& parent) { parent.in = algo::strptr("data"); - Regx_ReadSql(parent.amctest, "%", true); - parent.dofork = bool(true); - parent.q = bool(false); + Regx_ReadSql(parent.citest, "%", true); + parent.maxerr = i32(0); + Regx_ReadSql(parent.cijob, "%", true); + parent.capture = bool(false); + parent.check_clean = bool(true); } -// --- command.atf_amc..ToCmdline +// --- command.atf_ci..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::atf_amc_ToCmdline(command::atf_amc& row) { +tempstr command::atf_ci_ToCmdline(command::atf_ci& row) { tempstr ret; - ret << "bin/atf_amc "; - atf_amc_PrintArgv(row, ret); + ret << "bin/atf_ci "; + atf_ci_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -10533,10 +10785,10 @@ tempstr command::atf_amc_ToCmdline(command::atf_amc& row) { return ret; } -// --- command.atf_amc..PrintArgv +// --- command.atf_ci..PrintArgv // print string representation of ROW to string STR -// cfmt:command.atf_amc.Argv printfmt:Tuple -void command::atf_amc_PrintArgv(command::atf_amc& row, algo::cstring& str) { +// cfmt:command.atf_ci.Argv printfmt:Tuple +void command::atf_ci_PrintArgv(command::atf_ci& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; @@ -10547,51 +10799,69 @@ void command::atf_amc_PrintArgv(command::atf_amc& row, algo::cstring& str) { strptr_PrintBash(temp,str); } ch_RemoveAll(temp); - command::amctest_Print(const_cast(row), temp); - str << " -amctest:"; + command::citest_Print(const_cast(row), temp); + str << " -citest:"; strptr_PrintBash(temp,str); - if (!(row.dofork == true)) { + if (!(row.maxerr == 0)) { ch_RemoveAll(temp); - bool_Print(row.dofork, temp); - str << " -dofork:"; + i32_Print(row.maxerr, temp); + str << " -maxerr:"; strptr_PrintBash(temp,str); } - if (!(row.q == false)) { + if (!(row.cijob.expr == "%")) { ch_RemoveAll(temp); - bool_Print(row.q, temp); - str << " -q:"; + command::cijob_Print(const_cast(row), temp); + str << " -cijob:"; + strptr_PrintBash(temp,str); + } + if (!(row.capture == false)) { + ch_RemoveAll(temp); + bool_Print(row.capture, temp); + str << " -capture:"; + strptr_PrintBash(temp,str); + } + if (!(row.check_clean == true)) { + ch_RemoveAll(temp); + bool_Print(row.check_clean, temp); + str << " -check_clean:"; strptr_PrintBash(temp,str); } } -// --- command.atf_amc..GetAnon -algo::strptr command::atf_amc_GetAnon(command::atf_amc &parent, i32 idx) { +// --- command.atf_ci..GetAnon +algo::strptr command::atf_ci_GetAnon(command::atf_ci &parent, i32 idx) { (void)parent;//only to avoid -Wunused-parameter switch(idx) { - case(0): return strptr("amctest", 7); + case(0): return strptr("citest", 6); default: return algo::strptr(); } } -// --- command.atf_amc..NArgs +// --- command.atf_ci..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::atf_amc_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::atf_ci_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_amctest: { // $comment + case command_FieldId_citest: { // *out_anon = true; } break; - case command_FieldId_dofork: { // $comment + case command_FieldId_maxerr: { // + *out_anon = false; + } break; + case command_FieldId_cijob: { // + *out_anon = false; + } break; + case command_FieldId_capture: { // bool: no argument required but value may be specified as capture:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_q: { // bool: no argument required but value may be specified as dofork:Y + case command_FieldId_check_clean: { // bool: no argument required but value may be specified as check_clean:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -10602,16 +10872,16 @@ i32 command::atf_amc_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* return retval; } -// --- command.atf_amc_proc.atf_amc.Start +// --- command.atf_ci_proc.atf_ci.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::atf_amc_Start(command::atf_amc_proc& parent) { +int command::atf_ci_Start(command::atf_ci_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(atf_amc_ToCmdline(parent)); // maybe print command + verblog(atf_ci_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(atf_amc_ToCmdline(parent)); + tempstr cmdline(atf_ci_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -10623,10 +10893,10 @@ int command::atf_amc_Start(command::atf_amc_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= atf_amc_Execv(parent); + if (retval==0) retval= atf_ci_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.atf_amc_execv" + prerr("command.atf_ci_execv" <&" << pipefd[1]; - atf_amc_Start(parent); + atf_ci_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.atf_amc_proc.atf_amc.Kill +// --- command.atf_ci_proc.atf_ci.Kill // Kill subprocess and wait -void command::atf_amc_Kill(command::atf_amc_proc& parent) { - if (parent.pid != 0) { +void command::atf_ci_Kill(command::atf_ci_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - atf_amc_Wait(parent); + atf_ci_Wait(parent); } } -// --- command.atf_amc_proc.atf_amc.Wait +// --- command.atf_ci_proc.atf_ci.Wait // Wait for subprocess to return -void command::atf_amc_Wait(command::atf_amc_proc& parent) { +void command::atf_ci_Wait(command::atf_ci_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -10681,31 +10951,31 @@ void command::atf_amc_Wait(command::atf_amc_proc& parent) { } } -// --- command.atf_amc_proc.atf_amc.Exec +// --- command.atf_ci_proc.atf_ci.Exec // Start + Wait // Execute subprocess and return exit code -int command::atf_amc_Exec(command::atf_amc_proc& parent) { - atf_amc_Start(parent); - atf_amc_Wait(parent); +int command::atf_ci_Exec(command::atf_ci_proc& parent) { + atf_ci_Start(parent); + atf_ci_Wait(parent); return parent.status; } -// --- command.atf_amc_proc.atf_amc.ExecX +// --- command.atf_ci_proc.atf_ci.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::atf_amc_ExecX(command::atf_amc_proc& parent) { - int rc = atf_amc_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_amc_ToCmdline(parent)) +void command::atf_ci_ExecX(command::atf_ci_proc& parent) { + int rc = atf_ci_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_ci_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.atf_amc_proc.atf_amc.Execv +// --- command.atf_ci_proc.atf_ci.Execv // Call execv() // Call execv with specified parameters -int command::atf_amc_Execv(command::atf_amc_proc& parent) { +int command::atf_ci_Execv(command::atf_ci_proc& parent) { int ret = 0; algo::StringAry args; - atf_amc_ToArgv(parent, args); + atf_ci_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -10717,11 +10987,11 @@ int command::atf_amc_Execv(command::atf_amc_proc& parent) { return ret; } -// --- command.atf_amc_proc.atf_amc.ToCmdline -algo::tempstr command::atf_amc_ToCmdline(command::atf_amc_proc& parent) { +// --- command.atf_ci_proc.atf_ci.ToCmdline +algo::tempstr command::atf_ci_ToCmdline(command::atf_ci_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::atf_amc_PrintArgv(parent.cmd,retval); + command::atf_ci_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -10734,9 +11004,9 @@ algo::tempstr command::atf_amc_ToCmdline(command::atf_amc_proc& parent) { return retval; } -// --- command.atf_amc_proc.atf_amc.ToArgv +// --- command.atf_ci_proc.atf_ci.ToArgv // Form array from the command line -void command::atf_amc_ToArgv(command::atf_amc_proc& parent, algo::StringAry& args) { +void command::atf_ci_ToArgv(command::atf_ci_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; @@ -10746,616 +11016,326 @@ void command::atf_amc_ToArgv(command::atf_amc_proc& parent, algo::StringAry& arg cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.amctest.expr != "%") { + if (parent.cmd.citest.expr != "%") { cstring *arg = &ary_Alloc(args); - *arg << "-amctest:"; - command::amctest_Print(parent.cmd, *arg); + *arg << "-citest:"; + command::citest_Print(parent.cmd, *arg); } - if (parent.cmd.dofork != true) { + if (parent.cmd.maxerr != 0) { cstring *arg = &ary_Alloc(args); - *arg << "-dofork:"; - bool_Print(parent.cmd.dofork, *arg); + *arg << "-maxerr:"; + i32_Print(parent.cmd.maxerr, *arg); } - if (parent.cmd.q != false) { + if (parent.cmd.cijob.expr != "%") { cstring *arg = &ary_Alloc(args); - *arg << "-q:"; - bool_Print(parent.cmd.q, *arg); + *arg << "-cijob:"; + command::cijob_Print(parent.cmd, *arg); + } + + if (parent.cmd.capture != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-capture:"; + bool_Print(parent.cmd.capture, *arg); + } + + if (parent.cmd.check_clean != true) { + cstring *arg = &ary_Alloc(args); + *arg << "-check_clean:"; + bool_Print(parent.cmd.check_clean, *arg); } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } } -// --- command.atf_amc_proc..Uninit -void command::atf_amc_proc_Uninit(command::atf_amc_proc& parent) { - command::atf_amc_proc &row = parent; (void)row; +// --- command.atf_ci_proc..Uninit +void command::atf_ci_proc_Uninit(command::atf_ci_proc& parent) { + command::atf_ci_proc &row = parent; (void)row; - // command.atf_amc_proc.atf_amc.Uninit (Exec) // - atf_amc_Kill(parent); // kill child, ensure forward progress + // command.atf_ci_proc.atf_ci.Uninit (Exec) // + atf_ci_Kill(parent); // kill child, ensure forward progress } -// --- command.atf_ci.citest.Print -// Print back to string -void command::citest_Print(command::atf_ci& parent, algo::cstring &out) { - Regx_Print(parent.citest, out); -} - -// --- command.atf_ci.citest.ReadStrptrMaybe -// Read Regx from string -// Convert string to field. Return success value -bool command::citest_ReadStrptrMaybe(command::atf_ci& parent, algo::strptr in) { - bool retval = true; - Regx_ReadSql(parent.citest, in, true); - return retval; +// --- command.atf_cmdline.mstr.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr command::mstr_Addary(command::atf_cmdline& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.mstr_elems && rhs.elems < parent.mstr_elems + parent.mstr_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.atf_cmdline.mstr comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + mstr_Reserve(parent, nnew); // reserve space + int at = parent.mstr_n; + for (int i = 0; i < nnew; i++) { + new (parent.mstr_elems + at + i) algo::cstring(rhs[i]); + parent.mstr_n++; + } + return algo::aryptr(parent.mstr_elems + at, nnew); } -// --- command.atf_ci.cijob.Print -// Print back to string -void command::cijob_Print(command::atf_ci& parent, algo::cstring &out) { - Regx_Print(parent.cijob, out); +// --- command.atf_cmdline.mstr.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +algo::cstring& command::mstr_Alloc(command::atf_cmdline& parent) { + mstr_Reserve(parent, 1); + int n = parent.mstr_n; + int at = n; + algo::cstring *elems = parent.mstr_elems; + new (elems + at) algo::cstring(); // construct new element, default initializer + parent.mstr_n = n+1; + return elems[at]; } -// --- command.atf_ci.cijob.ReadStrptrMaybe -// Read Regx from string -// Convert string to field. Return success value -bool command::cijob_ReadStrptrMaybe(command::atf_ci& parent, algo::strptr in) { - bool retval = true; - Regx_ReadSql(parent.cijob, in, true); - return retval; +// --- command.atf_cmdline.mstr.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::cstring& command::mstr_AllocAt(command::atf_cmdline& parent, int at) { + mstr_Reserve(parent, 1); + int n = parent.mstr_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("command.bad_alloc_at field:command.atf_cmdline.mstr comment:'index out of range'"); + } + algo::cstring *elems = parent.mstr_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(algo::cstring)); + new (elems + at) algo::cstring(); // construct element, default initializer + parent.mstr_n = n+1; + return elems[at]; } -// --- command.atf_ci..ReadFieldMaybe -bool command::atf_ci_ReadFieldMaybe(command::atf_ci& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - command::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case command_FieldId_in: { - retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_citest: { - retval = citest_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_maxerr: { - retval = i32_ReadStrptrMaybe(parent.maxerr, strval); - break; - } - case command_FieldId_cijob: { - retval = cijob_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_capture: { - retval = bool_ReadStrptrMaybe(parent.capture, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); +// --- command.atf_cmdline.mstr.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr command::mstr_AllocN(command::atf_cmdline& parent, int n_elems) { + mstr_Reserve(parent, n_elems); + int old_n = parent.mstr_n; + int new_n = old_n + n_elems; + algo::cstring *elems = parent.mstr_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo::cstring(); // construct new element, default initialize } - return retval; + parent.mstr_n = new_n; + return algo::aryptr(elems + old_n, n_elems); } -// --- command.atf_ci..ReadTupleMaybe -// Read fields of command::atf_ci from attributes of ascii tuple TUPLE -bool command::atf_ci_ReadTupleMaybe(command::atf_ci &parent, algo::Tuple &tuple) { - bool retval = true; - int anon_idx = 0; - ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - if (ch_N(attr.name) == 0) { - attr.name = atf_ci_GetAnon(parent, anon_idx++); - } - retval = atf_ci_ReadFieldMaybe(parent, attr.name, attr.value); - if (!retval) { - break; - } - }ind_end; - return retval; +// --- command.atf_cmdline.mstr.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::mstr_AllocNAt(command::atf_cmdline& parent, int n_elems, int at) { + mstr_Reserve(parent, n_elems); + int n = parent.mstr_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.atf_cmdline.mstr comment:'index out of range'"); + } + algo::cstring *elems = parent.mstr_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.mstr_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); } -// --- command.atf_ci..Init -// Set all fields to initial values. -void command::atf_ci_Init(command::atf_ci& parent) { - parent.in = algo::strptr("data"); - Regx_ReadSql(parent.citest, "%", true); - parent.maxerr = i32(0); - Regx_ReadSql(parent.cijob, "%", true); - parent.capture = bool(false); +// --- command.atf_cmdline.mstr.Remove +// Remove item by index. If index outside of range, do nothing. +void command::mstr_Remove(command::atf_cmdline& parent, u32 i) { + u32 lim = parent.mstr_n; + algo::cstring *elems = parent.mstr_elems; + if (i < lim) { + elems[i].~cstring(); // destroy element + memmove(elems + i, elems + (i + 1), sizeof(algo::cstring) * (lim - (i + 1))); + parent.mstr_n = lim - 1; + } } -// --- command.atf_ci..ToCmdline -// Convenience function that returns a full command line -// Assume command is in a directory called bin -tempstr command::atf_ci_ToCmdline(command::atf_ci& row) { - tempstr ret; - ret << "bin/atf_ci "; - atf_ci_PrintArgv(row, ret); - // inherit less intense verbose, debug options - for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { - ret << " -verbose"; - } - for (int i = 1; i < algo_lib::_db.cmdline.debug; i++) { - ret << " -debug"; +// --- command.atf_cmdline.mstr.RemoveAll +void command::mstr_RemoveAll(command::atf_cmdline& parent) { + u32 n = parent.mstr_n; + while (n > 0) { + n -= 1; + parent.mstr_elems[n].~cstring(); + parent.mstr_n = n; } - return ret; } -// --- command.atf_ci..PrintArgv -// print string representation of ROW to string STR -// cfmt:command.atf_ci.Argv printfmt:Tuple -void command::atf_ci_PrintArgv(command::atf_ci& row, algo::cstring& str) { - algo::tempstr temp; - (void)temp; - (void)str; - if (!(row.in == "data")) { - ch_RemoveAll(temp); - cstring_Print(row.in, temp); - str << " -in:"; - strptr_PrintBash(temp,str); - } - ch_RemoveAll(temp); - command::citest_Print(const_cast(row), temp); - str << " -citest:"; - strptr_PrintBash(temp,str); - if (!(row.maxerr == 0)) { - ch_RemoveAll(temp); - i32_Print(row.maxerr, temp); - str << " -maxerr:"; - strptr_PrintBash(temp,str); - } - if (!(row.cijob.expr == "%")) { - ch_RemoveAll(temp); - command::cijob_Print(const_cast(row), temp); - str << " -cijob:"; - strptr_PrintBash(temp,str); - } - if (!(row.capture == false)) { - ch_RemoveAll(temp); - bool_Print(row.capture, temp); - str << " -capture:"; - strptr_PrintBash(temp,str); +// --- command.atf_cmdline.mstr.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void command::mstr_RemoveLast(command::atf_cmdline& parent) { + u64 n = parent.mstr_n; + if (n > 0) { + n -= 1; + mstr_qFind(parent, u64(n)).~cstring(); + parent.mstr_n = n; } } -// --- command.atf_ci..GetAnon -algo::strptr command::atf_ci_GetAnon(command::atf_ci &parent, i32 idx) { - (void)parent;//only to avoid -Wunused-parameter - switch(idx) { - case(0): return strptr("citest", 6); - default: return algo::strptr(); +// --- command.atf_cmdline.mstr.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void command::mstr_AbsReserve(command::atf_cmdline& parent, int n) { + u32 old_max = parent.mstr_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.mstr_elems, old_max * sizeof(algo::cstring), new_max * sizeof(algo::cstring)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("command.tary_nomem field:command.atf_cmdline.mstr comment:'out of memory'"); + } + parent.mstr_elems = (algo::cstring*)new_mem; + parent.mstr_max = new_max; } } -// --- command.atf_ci..NArgs -// Used with command lines -// Return # of command-line arguments that must follow this argument -// If FIELD is invalid, return -1 -i32 command::atf_ci_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { - i32 retval = 1; - switch (field) { - case command_FieldId_in: { // $comment - *out_anon = false; - } break; - case command_FieldId_citest: { // $comment - *out_anon = true; - } break; - case command_FieldId_maxerr: { // $comment - *out_anon = false; - } break; - case command_FieldId_cijob: { // $comment - *out_anon = false; - } break; - case command_FieldId_capture: { // $comment - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - default: - retval=-1; // unrecognized +// --- command.atf_cmdline.mstr.Setary +// Copy contents of RHS to PARENT. +void command::mstr_Setary(command::atf_cmdline& parent, command::atf_cmdline &rhs) { + mstr_RemoveAll(parent); + int nnew = rhs.mstr_n; + mstr_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.mstr_elems + i) algo::cstring(mstr_qFind(rhs, i)); + parent.mstr_n = i + 1; } - return retval; } -// --- command.atf_ci_proc.atf_ci.Start -// Start subprocess -// If subprocess already running, do nothing. Otherwise, start it -int command::atf_ci_Start(command::atf_ci_proc& parent) { - int retval = 0; - if (parent.pid == 0) { - verblog(atf_ci_ToCmdline(parent)); // maybe print command -#ifdef WIN32 - algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(atf_ci_ToCmdline(parent)); - parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); -#else - parent.pid = fork(); - if (parent.pid == 0) { // child - algo_lib::DieWithParent(); - if (parent.timeout > 0) { - alarm(parent.timeout); - } - if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); - if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); - if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= atf_ci_Execv(parent); - if (retval != 0) { // if start fails, print error - int err=errno; - prerr("command.atf_ci_execv" - < 0 ? 0 : -1; // if didn't start, set error status - return retval; -} - -// --- command.atf_ci_proc.atf_ci.StartRead -// Start subprocess & Read output -algo::Fildes command::atf_ci_StartRead(command::atf_ci_proc& parent, algo_lib::FFildes &read) { - int pipefd[2]; - int rc=pipe(pipefd); - (void)rc; - read.fd.value = pipefd[0]; - parent.fstdout << ">&" << pipefd[1]; - atf_ci_Start(parent); - (void)close(pipefd[1]); - return read.fd; -} - -// --- command.atf_ci_proc.atf_ci.Kill -// Kill subprocess and wait -void command::atf_ci_Kill(command::atf_ci_proc& parent) { - if (parent.pid != 0) { - kill(parent.pid,9); - atf_ci_Wait(parent); - } +// --- command.atf_cmdline.mstr.Setary2 +// Copy specified array into mstr, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void command::mstr_Setary(command::atf_cmdline& parent, const algo::aryptr &rhs) { + mstr_RemoveAll(parent); + mstr_Addary(parent, rhs); } -// --- command.atf_ci_proc.atf_ci.Wait -// Wait for subprocess to return -void command::atf_ci_Wait(command::atf_ci_proc& parent) { - if (parent.pid > 0) { - int wait_flags = 0; - int wait_status = 0; - int rc = -1; - do { - // really wait for subprocess to exit - rc = waitpid(parent.pid,&wait_status,wait_flags); - } while (rc==-1 && errno==EINTR); - if (rc == parent.pid) { - parent.status = wait_status; - parent.pid = 0; - } +// --- command.atf_cmdline.mstr.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr command::mstr_AllocNVal(command::atf_cmdline& parent, int n_elems, const algo::cstring& val) { + mstr_Reserve(parent, n_elems); + int old_n = parent.mstr_n; + int new_n = old_n + n_elems; + algo::cstring *elems = parent.mstr_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo::cstring(val); } + parent.mstr_n = new_n; + return algo::aryptr(elems + old_n, n_elems); } -// --- command.atf_ci_proc.atf_ci.Exec -// Start + Wait -// Execute subprocess and return exit code -int command::atf_ci_Exec(command::atf_ci_proc& parent) { - atf_ci_Start(parent); - atf_ci_Wait(parent); - return parent.status; -} - -// --- command.atf_ci_proc.atf_ci.ExecX -// Start + Wait, throw exception on error -// Execute subprocess; throw human-readable exception on error -void command::atf_ci_ExecX(command::atf_ci_proc& parent) { - int rc = atf_ci_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_ci_ToCmdline(parent)) - << Keyval("comment",algo::DescribeWaitStatus(parent.status))); -} - -// --- command.atf_ci_proc.atf_ci.Execv -// Call execv() -// Call execv with specified parameters -int command::atf_ci_Execv(command::atf_ci_proc& parent) { - int ret = 0; - algo::StringAry args; - atf_ci_ToArgv(parent, args); - char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); - ind_beg(algo::StringAry_ary_curs,arg,args) { - argv[ind_curs(arg).index] = Zeroterm(arg); - }ind_end; - argv[ary_N(args)] = NULL; - // if parent.path is relative, search for it in PATH - algo_lib::ResolveExecFname(parent.path); - ret = execv(Zeroterm(parent.path),argv); - return ret; -} - -// --- command.atf_ci_proc.atf_ci.ToCmdline -algo::tempstr command::atf_ci_ToCmdline(command::atf_ci_proc& parent) { - algo::tempstr retval; - retval << parent.path << " "; - command::atf_ci_PrintArgv(parent.cmd,retval); - if (ch_N(parent.fstdin)) { - retval << " " << parent.fstdin; - } - if (ch_N(parent.fstdout)) { - retval << " " << parent.fstdout; - } - if (ch_N(parent.fstderr)) { - retval << " 2" << parent.fstderr; +// --- command.atf_cmdline.mstr.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool command::mstr_ReadStrptrMaybe(command::atf_cmdline& parent, algo::strptr in_str) { + bool retval = true; + algo::cstring &elem = mstr_Alloc(parent); + retval = algo::cstring_ReadStrptrMaybe(elem, in_str); + if (!retval) { + mstr_RemoveLast(parent); } return retval; } -// --- command.atf_ci_proc.atf_ci.ToArgv -// Form array from the command line -void command::atf_ci_ToArgv(command::atf_ci_proc& parent, algo::StringAry& args) { - ary_RemoveAll(args); - ary_Alloc(args) << parent.path; - - if (parent.cmd.in != "data") { - cstring *arg = &ary_Alloc(args); - *arg << "-in:"; - cstring_Print(parent.cmd.in, *arg); - } - - if (parent.cmd.citest.expr != "%") { - cstring *arg = &ary_Alloc(args); - *arg << "-citest:"; - command::citest_Print(parent.cmd, *arg); - } - - if (parent.cmd.maxerr != 0) { - cstring *arg = &ary_Alloc(args); - *arg << "-maxerr:"; - i32_Print(parent.cmd.maxerr, *arg); +// --- command.atf_cmdline.mstr.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::mstr_Insary(command::atf_cmdline& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.mstr_elems && rhs.elems < parent.mstr_elems + parent.mstr_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.atf_cmdline.mstr comment:'alias error: sub-array is being appended to the whole'"); } - - if (parent.cmd.cijob.expr != "%") { - cstring *arg = &ary_Alloc(args); - *arg << "-cijob:"; - command::cijob_Print(parent.cmd, *arg); + if (UNLIKELY(u64(at) >= u64(parent.mstr_elems+1))) { + FatalErrorExit("command.bad_insary field:command.atf_cmdline.mstr comment:'index out of range'"); } - - if (parent.cmd.capture != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-capture:"; - bool_Print(parent.cmd.capture, *arg); + int nnew = rhs.n_elems; + int nmove = parent.mstr_n - at; + mstr_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.mstr_elems + at + nnew + i) algo::cstring(parent.mstr_elems[at + i]); + parent.mstr_elems[at + i].~cstring(); // destroy element } - for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { - ary_Alloc(args) << "-verbose"; + for (int i = 0; i < nnew; ++i) { + new (parent.mstr_elems + at + i) algo::cstring(rhs[i]); } + parent.mstr_n += nnew; } -// --- command.atf_ci_proc..Uninit -void command::atf_ci_proc_Uninit(command::atf_ci_proc& parent) { - command::atf_ci_proc &row = parent; (void)row; - - // command.atf_ci_proc.atf_ci.Uninit (Exec) // - atf_ci_Kill(parent); // kill child, ensure forward progress -} - -// --- command.atf_cmdline.mstr.Addary +// --- command.atf_cmdline.mnum.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. // If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -algo::aryptr command::mstr_Addary(command::atf_cmdline& parent, algo::aryptr rhs) { - bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.mstr_elems && rhs.elems < parent.mstr_elems + parent.mstr_max; +algo::aryptr command::mnum_Addary(command::atf_cmdline& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.mnum_elems && rhs.elems < parent.mnum_elems + parent.mnum_max; if (UNLIKELY(overlaps)) { - FatalErrorExit("command.tary_alias field:command.atf_cmdline.mstr comment:'alias error: sub-array is being appended to the whole'"); + FatalErrorExit("command.tary_alias field:command.atf_cmdline.mnum comment:'alias error: sub-array is being appended to the whole'"); } int nnew = rhs.n_elems; - mstr_Reserve(parent, nnew); // reserve space - int at = parent.mstr_n; - for (int i = 0; i < nnew; i++) { - new (parent.mstr_elems + at + i) algo::cstring(rhs[i]); - parent.mstr_n++; - } - return algo::aryptr(parent.mstr_elems + at, nnew); + mnum_Reserve(parent, nnew); // reserve space + int at = parent.mnum_n; + memcpy(parent.mnum_elems + at, rhs.elems, nnew * sizeof(i32)); + parent.mnum_n += nnew; + return algo::aryptr(parent.mnum_elems + at, nnew); } -// --- command.atf_cmdline.mstr.Alloc +// --- command.atf_cmdline.mnum.Alloc // Reserve space. Insert element at the end // The new element is initialized to a default value -algo::cstring& command::mstr_Alloc(command::atf_cmdline& parent) { - mstr_Reserve(parent, 1); - int n = parent.mstr_n; +i32& command::mnum_Alloc(command::atf_cmdline& parent) { + mnum_Reserve(parent, 1); + int n = parent.mnum_n; int at = n; - algo::cstring *elems = parent.mstr_elems; - new (elems + at) algo::cstring(); // construct new element, default initializer - parent.mstr_n = n+1; + i32 *elems = parent.mnum_elems; + new (elems + at) i32(0); // construct new element, default initializer + parent.mnum_n = n+1; return elems[at]; } -// --- command.atf_cmdline.mstr.AllocAt +// --- command.atf_cmdline.mnum.AllocAt // Reserve space for new element, reallocating the array if necessary // Insert new element at specified index. Index must be in range or a fatal error occurs. -algo::cstring& command::mstr_AllocAt(command::atf_cmdline& parent, int at) { - mstr_Reserve(parent, 1); - int n = parent.mstr_n; +i32& command::mnum_AllocAt(command::atf_cmdline& parent, int at) { + mnum_Reserve(parent, 1); + int n = parent.mnum_n; if (UNLIKELY(u64(at) >= u64(n+1))) { - FatalErrorExit("command.bad_alloc_at field:command.atf_cmdline.mstr comment:'index out of range'"); + FatalErrorExit("command.bad_alloc_at field:command.atf_cmdline.mnum comment:'index out of range'"); } - algo::cstring *elems = parent.mstr_elems; - memmove(elems + at + 1, elems + at, (n - at) * sizeof(algo::cstring)); - new (elems + at) algo::cstring(); // construct element, default initializer - parent.mstr_n = n+1; + i32 *elems = parent.mnum_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(i32)); + new (elems + at) i32(0); // construct element, default initializer + parent.mnum_n = n+1; return elems[at]; } -// --- command.atf_cmdline.mstr.AllocN +// --- command.atf_cmdline.mnum.AllocN // Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr command::mstr_AllocN(command::atf_cmdline& parent, int n_elems) { - mstr_Reserve(parent, n_elems); - int old_n = parent.mstr_n; +algo::aryptr command::mnum_AllocN(command::atf_cmdline& parent, int n_elems) { + mnum_Reserve(parent, n_elems); + int old_n = parent.mnum_n; int new_n = old_n + n_elems; - algo::cstring *elems = parent.mstr_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) algo::cstring(); // construct new element, default initialize - } - parent.mstr_n = new_n; - return algo::aryptr(elems + old_n, n_elems); -} - -// --- command.atf_cmdline.mstr.Remove -// Remove item by index. If index outside of range, do nothing. -void command::mstr_Remove(command::atf_cmdline& parent, u32 i) { - u32 lim = parent.mstr_n; - algo::cstring *elems = parent.mstr_elems; - if (i < lim) { - elems[i].~cstring(); // destroy element - memmove(elems + i, elems + (i + 1), sizeof(algo::cstring) * (lim - (i + 1))); - parent.mstr_n = lim - 1; - } -} - -// --- command.atf_cmdline.mstr.RemoveAll -void command::mstr_RemoveAll(command::atf_cmdline& parent) { - u32 n = parent.mstr_n; - while (n > 0) { - n -= 1; - parent.mstr_elems[n].~cstring(); - parent.mstr_n = n; - } -} - -// --- command.atf_cmdline.mstr.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void command::mstr_RemoveLast(command::atf_cmdline& parent) { - u64 n = parent.mstr_n; - if (n > 0) { - n -= 1; - mstr_qFind(parent, u64(n)).~cstring(); - parent.mstr_n = n; - } -} - -// --- command.atf_cmdline.mstr.AbsReserve -// Make sure N elements fit in array. Process dies if out of memory -void command::mstr_AbsReserve(command::atf_cmdline& parent, int n) { - u32 old_max = parent.mstr_max; - if (n > i32(old_max)) { - u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); - void *new_mem = algo_lib::malloc_ReallocMem(parent.mstr_elems, old_max * sizeof(algo::cstring), new_max * sizeof(algo::cstring)); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("command.tary_nomem field:command.atf_cmdline.mstr comment:'out of memory'"); - } - parent.mstr_elems = (algo::cstring*)new_mem; - parent.mstr_max = new_max; - } -} - -// --- command.atf_cmdline.mstr.Setary -// Copy contents of RHS to PARENT. -void command::mstr_Setary(command::atf_cmdline& parent, command::atf_cmdline &rhs) { - mstr_RemoveAll(parent); - int nnew = rhs.mstr_n; - mstr_Reserve(parent, nnew); // reserve space - for (int i = 0; i < nnew; i++) { // copy elements over - new (parent.mstr_elems + i) algo::cstring(mstr_qFind(rhs, i)); - parent.mstr_n = i + 1; - } -} - -// --- command.atf_cmdline.mstr.Setary2 -// Copy specified array into mstr, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -void command::mstr_Setary(command::atf_cmdline& parent, const algo::aryptr &rhs) { - mstr_RemoveAll(parent); - mstr_Addary(parent, rhs); -} - -// --- command.atf_cmdline.mstr.AllocNVal -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr command::mstr_AllocNVal(command::atf_cmdline& parent, int n_elems, const algo::cstring& val) { - mstr_Reserve(parent, n_elems); - int old_n = parent.mstr_n; - int new_n = old_n + n_elems; - algo::cstring *elems = parent.mstr_elems; + i32 *elems = parent.mnum_elems; for (int i = old_n; i < new_n; i++) { - new (elems + i) algo::cstring(val); - } - parent.mstr_n = new_n; - return algo::aryptr(elems + old_n, n_elems); -} - -// --- command.atf_cmdline.mstr.ReadStrptrMaybe -// A single element is read from input string and appended to the array. -// If the string contains an error, the array is untouched. -// Function returns success value. -bool command::mstr_ReadStrptrMaybe(command::atf_cmdline& parent, algo::strptr in_str) { - bool retval = true; - algo::cstring &elem = mstr_Alloc(parent); - retval = algo::cstring_ReadStrptrMaybe(elem, in_str); - if (!retval) { - mstr_RemoveLast(parent); - } - return retval; -} - -// --- command.atf_cmdline.mnum.Addary -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -algo::aryptr command::mnum_Addary(command::atf_cmdline& parent, algo::aryptr rhs) { - bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.mnum_elems && rhs.elems < parent.mnum_elems + parent.mnum_max; - if (UNLIKELY(overlaps)) { - FatalErrorExit("command.tary_alias field:command.atf_cmdline.mnum comment:'alias error: sub-array is being appended to the whole'"); + new (elems + i) i32(0); // construct new element, default initialize } - int nnew = rhs.n_elems; - mnum_Reserve(parent, nnew); // reserve space - int at = parent.mnum_n; - memcpy(parent.mnum_elems + at, rhs.elems, nnew * sizeof(i32)); - parent.mnum_n += nnew; - return algo::aryptr(parent.mnum_elems + at, nnew); -} - -// --- command.atf_cmdline.mnum.Alloc -// Reserve space. Insert element at the end -// The new element is initialized to a default value -i32& command::mnum_Alloc(command::atf_cmdline& parent) { - mnum_Reserve(parent, 1); - int n = parent.mnum_n; - int at = n; - i32 *elems = parent.mnum_elems; - new (elems + at) i32(0); // construct new element, default initializer - parent.mnum_n = n+1; - return elems[at]; + parent.mnum_n = new_n; + return algo::aryptr(elems + old_n, n_elems); } -// --- command.atf_cmdline.mnum.AllocAt +// --- command.atf_cmdline.mnum.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements // Reserve space for new element, reallocating the array if necessary // Insert new element at specified index. Index must be in range or a fatal error occurs. -i32& command::mnum_AllocAt(command::atf_cmdline& parent, int at) { - mnum_Reserve(parent, 1); +algo::aryptr command::mnum_AllocNAt(command::atf_cmdline& parent, int n_elems, int at) { + mnum_Reserve(parent, n_elems); int n = parent.mnum_n; - if (UNLIKELY(u64(at) >= u64(n+1))) { - FatalErrorExit("command.bad_alloc_at field:command.atf_cmdline.mnum comment:'index out of range'"); + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.atf_cmdline.mnum comment:'index out of range'"); } i32 *elems = parent.mnum_elems; - memmove(elems + at + 1, elems + at, (n - at) * sizeof(i32)); - new (elems + at) i32(0); // construct element, default initializer - parent.mnum_n = n+1; - return elems[at]; -} - -// --- command.atf_cmdline.mnum.AllocN -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr command::mnum_AllocN(command::atf_cmdline& parent, int n_elems) { - mnum_Reserve(parent, n_elems); - int old_n = parent.mnum_n; - int new_n = old_n + n_elems; - i32 *elems = parent.mnum_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) i32(0); // construct new element, default initialize + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(i32)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) i32(0); // construct new element, default initialize } - parent.mnum_n = new_n; - return algo::aryptr(elems + old_n, n_elems); + parent.mnum_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); } // --- command.atf_cmdline.mnum.Remove @@ -11442,6 +11422,25 @@ bool command::mnum_ReadStrptrMaybe(command::atf_cmdline& parent, algo::strptr in return retval; } +// --- command.atf_cmdline.mnum.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::mnum_Insary(command::atf_cmdline& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.mnum_elems && rhs.elems < parent.mnum_elems + parent.mnum_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.atf_cmdline.mnum comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.mnum_elems+1))) { + FatalErrorExit("command.bad_insary field:command.atf_cmdline.mnum comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.mnum_n - at; + mnum_Reserve(parent, nnew); // reserve space + memmove(parent.mnum_elems + at + nnew, parent.mnum_elems + at, nmove * sizeof(i32)); + memcpy(parent.mnum_elems + at, rhs.elems, nnew * sizeof(i32)); + parent.mnum_n += nnew; +} + // --- command.atf_cmdline.mdbl.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -11502,6 +11501,25 @@ algo::aryptr command::mdbl_AllocN(command::atf_cmdline& parent, int n_el return algo::aryptr(elems + old_n, n_elems); } +// --- command.atf_cmdline.mdbl.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::mdbl_AllocNAt(command::atf_cmdline& parent, int n_elems, int at) { + mdbl_Reserve(parent, n_elems); + int n = parent.mdbl_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.atf_cmdline.mdbl comment:'index out of range'"); + } + double *elems = parent.mdbl_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(double)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) double(0.0); // construct new element, default initialize + } + parent.mdbl_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- command.atf_cmdline.mdbl.Remove // Remove item by index. If index outside of range, do nothing. void command::mdbl_Remove(command::atf_cmdline& parent, u32 i) { @@ -11586,6 +11604,25 @@ bool command::mdbl_ReadStrptrMaybe(command::atf_cmdline& parent, algo::strptr in return retval; } +// --- command.atf_cmdline.mdbl.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::mdbl_Insary(command::atf_cmdline& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.mdbl_elems && rhs.elems < parent.mdbl_elems + parent.mdbl_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.atf_cmdline.mdbl comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.mdbl_elems+1))) { + FatalErrorExit("command.bad_insary field:command.atf_cmdline.mdbl comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.mdbl_n - at; + mdbl_Reserve(parent, nnew); // reserve space + memmove(parent.mdbl_elems + at + nnew, parent.mdbl_elems + at, nmove * sizeof(double)); + memcpy(parent.mdbl_elems + at, rhs.elems, nnew * sizeof(double)); + parent.mdbl_n += nnew; +} + // --- command.atf_cmdline.amnum.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -11646,6 +11683,25 @@ algo::aryptr command::amnum_AllocN(command::atf_cmdline& parent, int n_elem return algo::aryptr(elems + old_n, n_elems); } +// --- command.atf_cmdline.amnum.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::amnum_AllocNAt(command::atf_cmdline& parent, int n_elems, int at) { + amnum_Reserve(parent, n_elems); + int n = parent.amnum_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.atf_cmdline.amnum comment:'index out of range'"); + } + i32 *elems = parent.amnum_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(i32)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) i32(0); // construct new element, default initialize + } + parent.amnum_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- command.atf_cmdline.amnum.Remove // Remove item by index. If index outside of range, do nothing. void command::amnum_Remove(command::atf_cmdline& parent, u32 i) { @@ -11730,6 +11786,25 @@ bool command::amnum_ReadStrptrMaybe(command::atf_cmdline& parent, algo::strptr i return retval; } +// --- command.atf_cmdline.amnum.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::amnum_Insary(command::atf_cmdline& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.amnum_elems && rhs.elems < parent.amnum_elems + parent.amnum_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.atf_cmdline.amnum comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.amnum_elems+1))) { + FatalErrorExit("command.bad_insary field:command.atf_cmdline.amnum comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.amnum_n - at; + amnum_Reserve(parent, nnew); // reserve space + memmove(parent.amnum_elems + at + nnew, parent.amnum_elems + at, nmove * sizeof(i32)); + memcpy(parent.amnum_elems + at, rhs.elems, nnew * sizeof(i32)); + parent.amnum_n += nnew; +} + // --- command.atf_cmdline.fconst.ToCstr // Convert numeric value of field to one of predefined string constants. // If string is found, return a static C string. Otherwise, return NULL. @@ -11831,93 +11906,74 @@ bool command::atf_cmdline_ReadFieldMaybe(command::atf_cmdline& parent, algo::str switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_exec: { retval = bool_ReadStrptrMaybe(parent.exec, strval); - break; - } + } break; case command_FieldId_astr: { retval = algo::cstring_ReadStrptrMaybe(parent.astr, strval); - break; - } + } break; case command_FieldId_anum: { retval = i32_ReadStrptrMaybe(parent.anum, strval); - break; - } + } break; case command_FieldId_adbl: { retval = double_ReadStrptrMaybe(parent.adbl, strval); - break; - } + } break; case command_FieldId_aflag: { retval = bool_ReadStrptrMaybe(parent.aflag, strval); - break; - } + } break; case command_FieldId_str: { retval = algo::cstring_ReadStrptrMaybe(parent.str, strval); - break; - } + } break; case command_FieldId_num: { retval = i32_ReadStrptrMaybe(parent.num, strval); - break; - } + } break; case command_FieldId_dbl: { retval = double_ReadStrptrMaybe(parent.dbl, strval); - break; - } + } break; case command_FieldId_flag: { retval = bool_ReadStrptrMaybe(parent.flag, strval); - break; - } + } break; case command_FieldId_dstr: { retval = algo::cstring_ReadStrptrMaybe(parent.dstr, strval); - break; - } + } break; case command_FieldId_dnum: { retval = i32_ReadStrptrMaybe(parent.dnum, strval); - break; - } + } break; case command_FieldId_ddbl: { retval = double_ReadStrptrMaybe(parent.ddbl, strval); - break; - } + } break; case command_FieldId_dflag: { retval = bool_ReadStrptrMaybe(parent.dflag, strval); - break; - } + } break; case command_FieldId_mstr: { retval = mstr_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_mnum: { retval = mnum_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_mdbl: { retval = mdbl_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_amnum: { retval = amnum_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_fconst: { retval = fconst_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_cconst: { retval = algo::Month_ReadStrptrMaybe(parent.cconst, strval); - break; - } + } break; case command_FieldId_dregx: { retval = dregx_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_dpkey: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.dpkey, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -11970,7 +12026,6 @@ void command::atf_cmdline_Init(command::atf_cmdline& parent) { parent.amnum_n = 0; // (command.atf_cmdline.amnum) parent.amnum_max = 0; // (command.atf_cmdline.amnum) parent.fconst = u8(0); - parent.cconst = algo_MonthEnum(0); Regx_ReadSql(parent.dregx, "%", true); parent.dpkey = algo::strptr(""); } @@ -12132,12 +12187,10 @@ void command::atf_cmdline_PrintArgv(command::atf_cmdline& row, algo::cstring& st str << " -fconst:"; strptr_PrintBash(temp,str); } - if (!(row.cconst == 0)) { - ch_RemoveAll(temp); - Month_Print(row.cconst, temp); - str << " -cconst:"; - strptr_PrintBash(temp,str); - } + ch_RemoveAll(temp); + Month_Print(row.cconst, temp); + str << " -cconst:"; + strptr_PrintBash(temp,str); if (!(row.dregx.expr == "%")) { ch_RemoveAll(temp); command::dregx_Print(const_cast(row), temp); @@ -12171,78 +12224,78 @@ algo::strptr command::atf_cmdline_GetAnon(command::atf_cmdline &parent, i32 idx) i32 command::atf_cmdline_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_exec: { // $comment + case command_FieldId_exec: { // bool: no argument required but value may be specified as exec:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_astr: { // bool: no argument required but value may be specified as exec:Y + case command_FieldId_astr: { // *out_anon = true; } break; - case command_FieldId_anum: { // bool: no argument required but value may be specified as exec:Y + case command_FieldId_anum: { // *out_anon = true; } break; - case command_FieldId_adbl: { // bool: no argument required but value may be specified as exec:Y + case command_FieldId_adbl: { // *out_anon = true; } break; - case command_FieldId_aflag: { // bool: no argument required but value may be specified as exec:Y + case command_FieldId_aflag: { // bool: no argument required but value may be specified as aflag:Y *out_anon = true; retval=0; out_dflt="Y"; } break; - case command_FieldId_str: { // bool: no argument required but value may be specified as aflag:Y + case command_FieldId_str: { // *out_anon = false; } break; - case command_FieldId_num: { // bool: no argument required but value may be specified as aflag:Y + case command_FieldId_num: { // *out_anon = false; } break; - case command_FieldId_dbl: { // bool: no argument required but value may be specified as aflag:Y + case command_FieldId_dbl: { // *out_anon = false; } break; - case command_FieldId_flag: { // bool: no argument required but value may be specified as aflag:Y + case command_FieldId_flag: { // bool: no argument required but value may be specified as flag:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_dstr: { // bool: no argument required but value may be specified as flag:Y + case command_FieldId_dstr: { // *out_anon = false; } break; - case command_FieldId_dnum: { // bool: no argument required but value may be specified as flag:Y + case command_FieldId_dnum: { // *out_anon = false; } break; - case command_FieldId_ddbl: { // bool: no argument required but value may be specified as flag:Y + case command_FieldId_ddbl: { // *out_anon = false; } break; - case command_FieldId_dflag: { // bool: no argument required but value may be specified as flag:Y + case command_FieldId_dflag: { // bool: no argument required but value may be specified as dflag:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_mstr: { // bool: no argument required but value may be specified as dflag:Y + case command_FieldId_mstr: { // *out_anon = false; } break; - case command_FieldId_mnum: { // bool: no argument required but value may be specified as dflag:Y + case command_FieldId_mnum: { // *out_anon = false; } break; - case command_FieldId_mdbl: { // bool: no argument required but value may be specified as dflag:Y + case command_FieldId_mdbl: { // *out_anon = false; } break; - case command_FieldId_amnum: { // bool: no argument required but value may be specified as dflag:Y + case command_FieldId_amnum: { // *out_anon = true; } break; - case command_FieldId_fconst: { // bool: no argument required but value may be specified as dflag:Y + case command_FieldId_fconst: { // *out_anon = false; } break; - case command_FieldId_cconst: { // bool: no argument required but value may be specified as dflag:Y + case command_FieldId_cconst: { // *out_anon = false; } break; - case command_FieldId_dregx: { // bool: no argument required but value may be specified as dflag:Y + case command_FieldId_dregx: { // *out_anon = false; } break; - case command_FieldId_dpkey: { // bool: no argument required but value may be specified as dflag:Y + case command_FieldId_dpkey: { // *out_anon = false; } break; default: @@ -12372,7 +12425,7 @@ algo::Fildes command::atf_cmdline_StartRead(command::atf_cmdline_proc& parent, a // --- command.atf_cmdline_proc.atf_cmdline.Kill // Kill subprocess and wait void command::atf_cmdline_Kill(command::atf_cmdline_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); atf_cmdline_Wait(parent); } @@ -12565,7 +12618,7 @@ void command::atf_cmdline_ToArgv(command::atf_cmdline_proc& parent, algo::String command::fconst_Print(parent.cmd, *arg); } - if (parent.cmd.cconst != 0) { + if (true) { cstring *arg = &ary_Alloc(args); *arg << "-cconst:"; Month_Print(parent.cmd.cconst, *arg); @@ -12618,109 +12671,92 @@ bool command::atf_comp_ReadFieldMaybe(command::atf_comp& parent, algo::strptr fi switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_comptest: { retval = comptest_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_mdbg: { retval = bool_ReadStrptrMaybe(parent.mdbg, strval); - break; - } + } break; case command_FieldId_run: { retval = bool_ReadStrptrMaybe(parent.run, strval); - break; - } + } break; case command_FieldId_capture: { retval = bool_ReadStrptrMaybe(parent.capture, strval); - break; - } + } break; case command_FieldId_print: { retval = bool_ReadStrptrMaybe(parent.print, strval); - break; - } + } break; case command_FieldId_printinput: { retval = bool_ReadStrptrMaybe(parent.printinput, strval); - break; - } + } break; case command_FieldId_e: { retval = bool_ReadStrptrMaybe(parent.e, strval); - break; - } + } break; case command_FieldId_normalize: { retval = bool_ReadStrptrMaybe(parent.normalize, strval); - break; - } + } break; case command_FieldId_covcapture: { retval = bool_ReadStrptrMaybe(parent.covcapture, strval); - break; - } + } break; case command_FieldId_covcheck: { retval = bool_ReadStrptrMaybe(parent.covcheck, strval); - break; - } - case command_FieldId_compdir: { - retval = algo::cstring_ReadStrptrMaybe(parent.compdir, strval); - break; - } + } break; + case command_FieldId_bindir: { + retval = algo::cstring_ReadStrptrMaybe(parent.bindir, strval); + } break; case command_FieldId_cfg: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.cfg, strval); - break; - } + } break; case command_FieldId_check_untracked: { retval = bool_ReadStrptrMaybe(parent.check_untracked, strval); - break; - } + } break; case command_FieldId_maxerr: { retval = i32_ReadStrptrMaybe(parent.maxerr, strval); - break; - } + } break; case command_FieldId_build: { retval = bool_ReadStrptrMaybe(parent.build, strval); - break; - } - case command_FieldId_ood: { - retval = bool_ReadStrptrMaybe(parent.ood, strval); - break; - } + } break; case command_FieldId_memcheck: { retval = bool_ReadStrptrMaybe(parent.memcheck, strval); - break; - } + } break; case command_FieldId_force: { retval = bool_ReadStrptrMaybe(parent.force, strval); - break; - } + } break; case command_FieldId_callgrind: { retval = bool_ReadStrptrMaybe(parent.callgrind, strval); - break; - } + } break; case command_FieldId_maxjobs: { retval = i32_ReadStrptrMaybe(parent.maxjobs, strval); - break; - } + } break; case command_FieldId_stream: { retval = bool_ReadStrptrMaybe(parent.stream, strval); - break; - } + } break; case command_FieldId_i: { retval = bool_ReadStrptrMaybe(parent.i, strval); - break; - } + } break; case command_FieldId_write: { retval = bool_ReadStrptrMaybe(parent.write, strval); - break; - } + } break; case command_FieldId_report: { retval = bool_ReadStrptrMaybe(parent.report, strval); - break; - } + } break; case command_FieldId_b: { retval = algo::cstring_ReadStrptrMaybe(parent.b, strval); - break; - } - default: break; + } break; + case command_FieldId_covfast: { + retval = bool_ReadStrptrMaybe(parent.covfast, strval); + } break; + case command_FieldId_minrepeat: { + retval = i32_ReadStrptrMaybe(parent.minrepeat, strval); + } break; + case command_FieldId_maxrepeat: { + retval = i32_ReadStrptrMaybe(parent.maxrepeat, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -12759,12 +12795,11 @@ void command::atf_comp_Init(command::atf_comp& parent) { parent.normalize = bool(false); parent.covcapture = bool(false); parent.covcheck = bool(false); - parent.compdir = algo::strptr(""); + parent.bindir = algo::strptr(""); parent.cfg = algo::strptr("release"); parent.check_untracked = bool(true); - parent.maxerr = i32(1); + parent.maxerr = i32(3); parent.build = bool(false); - parent.ood = bool(false); parent.memcheck = bool(false); parent.force = bool(false); parent.callgrind = bool(false); @@ -12772,8 +12807,11 @@ void command::atf_comp_Init(command::atf_comp& parent) { parent.stream = bool(false); parent.i = bool(false); parent.write = bool(true); - parent.report = bool(false); + parent.report = bool(true); parent.b = algo::strptr(""); + parent.covfast = bool(true); + parent.minrepeat = i32(0); + parent.maxrepeat = i32(1); } // --- command.atf_comp..ToCmdline @@ -12864,10 +12902,10 @@ void command::atf_comp_PrintArgv(command::atf_comp& row, algo::cstring& str) { str << " -covcheck:"; strptr_PrintBash(temp,str); } - if (!(row.compdir == "")) { + if (!(row.bindir == "")) { ch_RemoveAll(temp); - cstring_Print(row.compdir, temp); - str << " -compdir:"; + cstring_Print(row.bindir, temp); + str << " -bindir:"; strptr_PrintBash(temp,str); } if (!(row.cfg == "release")) { @@ -12882,7 +12920,7 @@ void command::atf_comp_PrintArgv(command::atf_comp& row, algo::cstring& str) { str << " -check_untracked:"; strptr_PrintBash(temp,str); } - if (!(row.maxerr == 1)) { + if (!(row.maxerr == 3)) { ch_RemoveAll(temp); i32_Print(row.maxerr, temp); str << " -maxerr:"; @@ -12894,12 +12932,6 @@ void command::atf_comp_PrintArgv(command::atf_comp& row, algo::cstring& str) { str << " -build:"; strptr_PrintBash(temp,str); } - if (!(row.ood == false)) { - ch_RemoveAll(temp); - bool_Print(row.ood, temp); - str << " -ood:"; - strptr_PrintBash(temp,str); - } if (!(row.memcheck == false)) { ch_RemoveAll(temp); bool_Print(row.memcheck, temp); @@ -12942,7 +12974,7 @@ void command::atf_comp_PrintArgv(command::atf_comp& row, algo::cstring& str) { str << " -write:"; strptr_PrintBash(temp,str); } - if (!(row.report == false)) { + if (!(row.report == true)) { ch_RemoveAll(temp); bool_Print(row.report, temp); str << " -report:"; @@ -12954,6 +12986,24 @@ void command::atf_comp_PrintArgv(command::atf_comp& row, algo::cstring& str) { str << " -b:"; strptr_PrintBash(temp,str); } + if (!(row.covfast == true)) { + ch_RemoveAll(temp); + bool_Print(row.covfast, temp); + str << " -covfast:"; + strptr_PrintBash(temp,str); + } + if (!(row.minrepeat == 0)) { + ch_RemoveAll(temp); + i32_Print(row.minrepeat, temp); + str << " -minrepeat:"; + strptr_PrintBash(temp,str); + } + if (!(row.maxrepeat == 1)) { + ch_RemoveAll(temp); + i32_Print(row.maxrepeat, temp); + str << " -maxrepeat:"; + strptr_PrintBash(temp,str); + } } // --- command.atf_comp..GetAnon @@ -12972,120 +13022,126 @@ algo::strptr command::atf_comp_GetAnon(command::atf_comp &parent, i32 idx) { i32 command::atf_comp_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_comptest: { // $comment + case command_FieldId_comptest: { // *out_anon = true; } break; - case command_FieldId_mdbg: { // $comment + case command_FieldId_mdbg: { // bool: no argument required but value may be specified as mdbg:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_run: { // bool: no argument required but value may be specified as mdbg:Y + case command_FieldId_run: { // bool: no argument required but value may be specified as run:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_capture: { // bool: no argument required but value may be specified as run:Y + case command_FieldId_capture: { // bool: no argument required but value may be specified as capture:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_print: { // bool: no argument required but value may be specified as capture:Y + case command_FieldId_print: { // bool: no argument required but value may be specified as print:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_printinput: { // bool: no argument required but value may be specified as print:Y + case command_FieldId_printinput: { // bool: no argument required but value may be specified as printinput:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_e: { // bool: no argument required but value may be specified as printinput:Y + case command_FieldId_e: { // bool: no argument required but value may be specified as e:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_normalize: { // bool: no argument required but value may be specified as e:Y + case command_FieldId_normalize: { // bool: no argument required but value may be specified as normalize:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_covcapture: { // bool: no argument required but value may be specified as normalize:Y + case command_FieldId_covcapture: { // bool: no argument required but value may be specified as covcapture:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_covcheck: { // bool: no argument required but value may be specified as covcapture:Y + case command_FieldId_covcheck: { // bool: no argument required but value may be specified as covcheck:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_compdir: { // bool: no argument required but value may be specified as covcheck:Y + case command_FieldId_bindir: { // *out_anon = false; } break; - case command_FieldId_cfg: { // bool: no argument required but value may be specified as covcheck:Y + case command_FieldId_cfg: { // *out_anon = false; } break; - case command_FieldId_check_untracked: { // bool: no argument required but value may be specified as covcheck:Y + case command_FieldId_check_untracked: { // bool: no argument required but value may be specified as check_untracked:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_maxerr: { // bool: no argument required but value may be specified as check_untracked:Y + case command_FieldId_maxerr: { // *out_anon = false; } break; - case command_FieldId_build: { // bool: no argument required but value may be specified as check_untracked:Y + case command_FieldId_build: { // bool: no argument required but value may be specified as build:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_ood: { // bool: no argument required but value may be specified as build:Y + case command_FieldId_memcheck: { // bool: no argument required but value may be specified as memcheck:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_memcheck: { // bool: no argument required but value may be specified as ood:Y + case command_FieldId_force: { // bool: no argument required but value may be specified as force:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_force: { // bool: no argument required but value may be specified as memcheck:Y + case command_FieldId_callgrind: { // bool: no argument required but value may be specified as callgrind:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_callgrind: { // bool: no argument required but value may be specified as force:Y + case command_FieldId_maxjobs: { // *out_anon = false; - retval=0; - out_dflt="Y"; } break; - case command_FieldId_maxjobs: { // bool: no argument required but value may be specified as callgrind:Y + case command_FieldId_stream: { // bool: no argument required but value may be specified as stream:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_stream: { // bool: no argument required but value may be specified as callgrind:Y + case command_FieldId_i: { // bool: no argument required but value may be specified as i:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_i: { // bool: no argument required but value may be specified as stream:Y + case command_FieldId_write: { // bool: no argument required but value may be specified as write:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_write: { // bool: no argument required but value may be specified as i:Y + case command_FieldId_report: { // bool: no argument required but value may be specified as report:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_report: { // bool: no argument required but value may be specified as write:Y + case command_FieldId_b: { // + *out_anon = false; + } break; + case command_FieldId_covfast: { // bool: no argument required but value may be specified as covfast:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_b: { // bool: no argument required but value may be specified as report:Y + case command_FieldId_minrepeat: { // + *out_anon = false; + } break; + case command_FieldId_maxrepeat: { // *out_anon = false; } break; default: @@ -13149,7 +13205,7 @@ algo::Fildes command::atf_comp_StartRead(command::atf_comp_proc& parent, algo_li // --- command.atf_comp_proc.atf_comp.Kill // Kill subprocess and wait void command::atf_comp_Kill(command::atf_comp_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); atf_comp_Wait(parent); } @@ -13298,10 +13354,10 @@ void command::atf_comp_ToArgv(command::atf_comp_proc& parent, algo::StringAry& a bool_Print(parent.cmd.covcheck, *arg); } - if (parent.cmd.compdir != "") { + if (parent.cmd.bindir != "") { cstring *arg = &ary_Alloc(args); - *arg << "-compdir:"; - cstring_Print(parent.cmd.compdir, *arg); + *arg << "-bindir:"; + cstring_Print(parent.cmd.bindir, *arg); } if (parent.cmd.cfg != "release") { @@ -13316,7 +13372,7 @@ void command::atf_comp_ToArgv(command::atf_comp_proc& parent, algo::StringAry& a bool_Print(parent.cmd.check_untracked, *arg); } - if (parent.cmd.maxerr != 1) { + if (parent.cmd.maxerr != 3) { cstring *arg = &ary_Alloc(args); *arg << "-maxerr:"; i32_Print(parent.cmd.maxerr, *arg); @@ -13328,12 +13384,6 @@ void command::atf_comp_ToArgv(command::atf_comp_proc& parent, algo::StringAry& a bool_Print(parent.cmd.build, *arg); } - if (parent.cmd.ood != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-ood:"; - bool_Print(parent.cmd.ood, *arg); - } - if (parent.cmd.memcheck != false) { cstring *arg = &ary_Alloc(args); *arg << "-memcheck:"; @@ -13376,7 +13426,7 @@ void command::atf_comp_ToArgv(command::atf_comp_proc& parent, algo::StringAry& a bool_Print(parent.cmd.write, *arg); } - if (parent.cmd.report != false) { + if (parent.cmd.report != true) { cstring *arg = &ary_Alloc(args); *arg << "-report:"; bool_Print(parent.cmd.report, *arg); @@ -13387,6 +13437,24 @@ void command::atf_comp_ToArgv(command::atf_comp_proc& parent, algo::StringAry& a *arg << "-b:"; cstring_Print(parent.cmd.b, *arg); } + + if (parent.cmd.covfast != true) { + cstring *arg = &ary_Alloc(args); + *arg << "-covfast:"; + bool_Print(parent.cmd.covfast, *arg); + } + + if (parent.cmd.minrepeat != 0) { + cstring *arg = &ary_Alloc(args); + *arg << "-minrepeat:"; + i32_Print(parent.cmd.minrepeat, *arg); + } + + if (parent.cmd.maxrepeat != 1) { + cstring *arg = &ary_Alloc(args); + *arg << "-maxrepeat:"; + i32_Print(parent.cmd.maxrepeat, *arg); + } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } @@ -13423,57 +13491,50 @@ bool command::atf_cov_ReadFieldMaybe(command::atf_cov& parent, algo::strptr fiel switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_covdir: { retval = algo::cstring_ReadStrptrMaybe(parent.covdir, strval); - break; - } + } break; case command_FieldId_logfile: { retval = algo::cstring_ReadStrptrMaybe(parent.logfile, strval); - break; - } + } break; case command_FieldId_runcmd: { retval = algo::cstring_ReadStrptrMaybe(parent.runcmd, strval); - break; - } + } break; case command_FieldId_exclude: { retval = exclude_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_mergepath: { retval = algo::cstring_ReadStrptrMaybe(parent.mergepath, strval); - break; - } + } break; case command_FieldId_gcov: { retval = bool_ReadStrptrMaybe(parent.gcov, strval); - break; - } + } break; case command_FieldId_ssim: { retval = bool_ReadStrptrMaybe(parent.ssim, strval); - break; - } + } break; case command_FieldId_report: { retval = bool_ReadStrptrMaybe(parent.report, strval); - break; - } + } break; case command_FieldId_capture: { retval = bool_ReadStrptrMaybe(parent.capture, strval); - break; - } + } break; case command_FieldId_xmlpretty: { retval = bool_ReadStrptrMaybe(parent.xmlpretty, strval); - break; - } + } break; case command_FieldId_summary: { retval = bool_ReadStrptrMaybe(parent.summary, strval); - break; - } + } break; case command_FieldId_check: { retval = bool_ReadStrptrMaybe(parent.check, strval); - break; - } - default: break; + } break; + case command_FieldId_incremental: { + retval = bool_ReadStrptrMaybe(parent.incremental, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -13510,6 +13571,7 @@ void command::atf_cov_Init(command::atf_cov& parent) { parent.xmlpretty = bool(false); parent.summary = bool(true); parent.check = bool(false); + parent.incremental = bool(false); } // --- command.atf_cov..ToCmdline @@ -13614,6 +13676,12 @@ void command::atf_cov_PrintArgv(command::atf_cov& row, algo::cstring& str) { str << " -check:"; strptr_PrintBash(temp,str); } + if (!(row.incremental == false)) { + ch_RemoveAll(temp); + bool_Print(row.incremental, temp); + str << " -incremental:"; + strptr_PrintBash(temp,str); + } } // --- command.atf_cov..NArgs @@ -13623,55 +13691,60 @@ void command::atf_cov_PrintArgv(command::atf_cov& row, algo::cstring& str) { i32 command::atf_cov_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // + *out_anon = false; + } break; + case command_FieldId_covdir: { // *out_anon = false; } break; - case command_FieldId_covdir: { // $comment + case command_FieldId_logfile: { // *out_anon = false; } break; - case command_FieldId_logfile: { // $comment + case command_FieldId_runcmd: { // *out_anon = false; } break; - case command_FieldId_runcmd: { // $comment + case command_FieldId_exclude: { // *out_anon = false; } break; - case command_FieldId_exclude: { // $comment + case command_FieldId_mergepath: { // *out_anon = false; } break; - case command_FieldId_mergepath: { // $comment + case command_FieldId_gcov: { // bool: no argument required but value may be specified as gcov:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_gcov: { // $comment + case command_FieldId_ssim: { // bool: no argument required but value may be specified as ssim:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_ssim: { // bool: no argument required but value may be specified as gcov:Y + case command_FieldId_report: { // bool: no argument required but value may be specified as report:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_report: { // bool: no argument required but value may be specified as ssim:Y + case command_FieldId_capture: { // bool: no argument required but value may be specified as capture:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_capture: { // bool: no argument required but value may be specified as report:Y + case command_FieldId_xmlpretty: { // bool: no argument required but value may be specified as xmlpretty:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_xmlpretty: { // bool: no argument required but value may be specified as capture:Y + case command_FieldId_summary: { // bool: no argument required but value may be specified as summary:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_summary: { // bool: no argument required but value may be specified as xmlpretty:Y + case command_FieldId_check: { // bool: no argument required but value may be specified as check:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_check: { // bool: no argument required but value may be specified as summary:Y + case command_FieldId_incremental: { // bool: no argument required but value may be specified as incremental:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -13737,7 +13810,7 @@ algo::Fildes command::atf_cov_StartRead(command::atf_cov_proc& parent, algo_lib: // --- command.atf_cov_proc.atf_cov.Kill // Kill subprocess and wait void command::atf_cov_Kill(command::atf_cov_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); atf_cov_Wait(parent); } @@ -13897,6 +13970,12 @@ void command::atf_cov_ToArgv(command::atf_cov_proc& parent, algo::StringAry& arg *arg << "-check:"; bool_Print(parent.cmd.check, *arg); } + + if (parent.cmd.incremental != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-incremental:"; + bool_Print(parent.cmd.incremental, *arg); + } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } @@ -13910,104 +13989,64 @@ void command::atf_cov_proc_Uninit(command::atf_cov_proc& parent) { atf_cov_Kill(parent); // kill child, ensure forward progress } -// --- command.atf_fuzz.fuzzstrat.Print -// Print back to string -void command::fuzzstrat_Print(command::atf_fuzz& parent, algo::cstring &out) { - Regx_Print(parent.fuzzstrat, out); -} - -// --- command.atf_fuzz.fuzzstrat.ReadStrptrMaybe -// Read Regx from string -// Convert string to field. Return success value -bool command::fuzzstrat_ReadStrptrMaybe(command::atf_fuzz& parent, algo::strptr in) { +// --- command.atf_exp..ReadFieldMaybe +bool command::atf_exp_ReadFieldMaybe(command::atf_exp& parent, algo::strptr field, algo::strptr strval) { bool retval = true; - Regx_ReadSql(parent.fuzzstrat, in, true); + command::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case command_FieldId_in: { + retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); + } break; + case command_FieldId_trace: { + retval = algo::cstring_ReadStrptrMaybe(parent.trace, strval); + } break; + case command_FieldId_bindir: { + retval = algo::cstring_ReadStrptrMaybe(parent.bindir, strval); + } break; + case command_FieldId_comptest: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.comptest, strval); + } break; + case command_FieldId_tempdir: { + retval = algo::cstring_ReadStrptrMaybe(parent.tempdir, strval); + } break; + case command_FieldId_timeout: { + retval = double_ReadStrptrMaybe(parent.timeout, strval); + } break; + case command_FieldId_dbgshell: { + retval = bool_ReadStrptrMaybe(parent.dbgshell, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } return retval; } -// --- command.atf_fuzz..ReadFieldMaybe -bool command::atf_fuzz_ReadFieldMaybe(command::atf_fuzz& parent, algo::strptr field, algo::strptr strval) { +// --- command.atf_exp..ReadTupleMaybe +// Read fields of command::atf_exp from attributes of ascii tuple TUPLE +bool command::atf_exp_ReadTupleMaybe(command::atf_exp &parent, algo::Tuple &tuple) { bool retval = true; - command::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case command_FieldId_reprofile: { - retval = algo::cstring_ReadStrptrMaybe(parent.reprofile, strval); - break; - } - case command_FieldId_target: { - retval = algo::Smallstr16_ReadStrptrMaybe(parent.target, strval); - break; - } - case command_FieldId_args: { - retval = algo::cstring_ReadStrptrMaybe(parent.args, strval); - break; - } - case command_FieldId_inputfile: { - retval = algo::cstring_ReadStrptrMaybe(parent.inputfile, strval); - break; - } - case command_FieldId_fuzzstrat: { - retval = fuzzstrat_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_in: { - retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_seed: { - retval = i32_ReadStrptrMaybe(parent.seed, strval); - break; - } - case command_FieldId_testprob: { - retval = double_ReadStrptrMaybe(parent.testprob, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- command.atf_fuzz..ReadTupleMaybe -// Read fields of command::atf_fuzz from attributes of ascii tuple TUPLE -bool command::atf_fuzz_ReadTupleMaybe(command::atf_fuzz &parent, algo::Tuple &tuple) { - bool retval = true; - int anon_idx = 0; - ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - if (ch_N(attr.name) == 0) { - attr.name = atf_fuzz_GetAnon(parent, anon_idx++); - } - retval = atf_fuzz_ReadFieldMaybe(parent, attr.name, attr.value); - if (!retval) { + ind_beg(algo::Tuple_attrs_curs,attr,tuple) { + retval = atf_exp_ReadFieldMaybe(parent, attr.name, attr.value); + if (!retval) { break; } }ind_end; return retval; } -// --- command.atf_fuzz..Init -// Set all fields to initial values. -void command::atf_fuzz_Init(command::atf_fuzz& parent) { - parent.reprofile = algo::strptr("temp/atf_fuzz.repro"); - parent.target = algo::strptr(""); - parent.args = algo::strptr(""); - parent.inputfile = algo::strptr(""); - Regx_ReadSql(parent.fuzzstrat, "%", true); - parent.in = algo::strptr("data"); - parent.seed = i32(0); - parent.testprob = double(1); -} - -// --- command.atf_fuzz..ToCmdline +// --- command.atf_exp..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::atf_fuzz_ToCmdline(command::atf_fuzz& row) { +tempstr command::atf_exp_ToCmdline(command::atf_exp& row) { tempstr ret; - ret << "bin/atf_fuzz "; - atf_fuzz_PrintArgv(row, ret); + ret << "bin/atf_exp "; + atf_exp_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -14018,117 +14057,103 @@ tempstr command::atf_fuzz_ToCmdline(command::atf_fuzz& row) { return ret; } -// --- command.atf_fuzz..PrintArgv +// --- command.atf_exp..PrintArgv // print string representation of ROW to string STR -// cfmt:command.atf_fuzz.Argv printfmt:Tuple -void command::atf_fuzz_PrintArgv(command::atf_fuzz& row, algo::cstring& str) { +// cfmt:command.atf_exp.Argv printfmt:Tuple +void command::atf_exp_PrintArgv(command::atf_exp& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; - if (!(row.reprofile == "temp/atf_fuzz.repro")) { + if (!(row.in == "data")) { ch_RemoveAll(temp); - cstring_Print(row.reprofile, temp); - str << " -reprofile:"; + cstring_Print(row.in, temp); + str << " -in:"; strptr_PrintBash(temp,str); } - ch_RemoveAll(temp); - Smallstr16_Print(row.target, temp); - str << " -target:"; - strptr_PrintBash(temp,str); - ch_RemoveAll(temp); - cstring_Print(row.args, temp); - str << " -args:"; - strptr_PrintBash(temp,str); - if (!(row.inputfile == "")) { + if (!(row.trace == "")) { ch_RemoveAll(temp); - cstring_Print(row.inputfile, temp); - str << " -inputfile:"; + cstring_Print(row.trace, temp); + str << " -trace:"; strptr_PrintBash(temp,str); } - if (!(row.fuzzstrat.expr == "%")) { + if (!(row.bindir == "bin")) { ch_RemoveAll(temp); - command::fuzzstrat_Print(const_cast(row), temp); - str << " -fuzzstrat:"; + cstring_Print(row.bindir, temp); + str << " -bindir:"; strptr_PrintBash(temp,str); } - if (!(row.in == "data")) { + if (!(row.comptest == "")) { ch_RemoveAll(temp); - cstring_Print(row.in, temp); - str << " -in:"; + Smallstr50_Print(row.comptest, temp); + str << " -comptest:"; strptr_PrintBash(temp,str); } - if (!(row.seed == 0)) { + if (!(row.tempdir == "")) { ch_RemoveAll(temp); - i32_Print(row.seed, temp); - str << " -seed:"; + cstring_Print(row.tempdir, temp); + str << " -tempdir:"; strptr_PrintBash(temp,str); } - if (!(row.testprob == 1)) { + if (!(row.timeout == 8.0)) { ch_RemoveAll(temp); - double_Print(row.testprob, temp); - str << " -testprob:"; + double_Print(row.timeout, temp); + str << " -timeout:"; strptr_PrintBash(temp,str); } -} - -// --- command.atf_fuzz..GetAnon -algo::strptr command::atf_fuzz_GetAnon(command::atf_fuzz &parent, i32 idx) { - (void)parent;//only to avoid -Wunused-parameter - switch(idx) { - case(0): return strptr("target", 6); - case(1): return strptr("args", 4); - default: return algo::strptr(); + if (!(row.dbgshell == false)) { + ch_RemoveAll(temp); + bool_Print(row.dbgshell, temp); + str << " -dbgshell:"; + strptr_PrintBash(temp,str); } } -// --- command.atf_fuzz..NArgs +// --- command.atf_exp..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::atf_fuzz_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::atf_exp_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_reprofile: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_target: { // $comment - *out_anon = true; - } break; - case command_FieldId_args: { // $comment - *out_anon = true; + case command_FieldId_trace: { // + *out_anon = false; } break; - case command_FieldId_inputfile: { // $comment + case command_FieldId_bindir: { // *out_anon = false; } break; - case command_FieldId_fuzzstrat: { // $comment + case command_FieldId_comptest: { // *out_anon = false; } break; - case command_FieldId_in: { // $comment + case command_FieldId_tempdir: { // *out_anon = false; } break; - case command_FieldId_seed: { // $comment + case command_FieldId_timeout: { // *out_anon = false; } break; - case command_FieldId_testprob: { // $comment + case command_FieldId_dbgshell: { // bool: no argument required but value may be specified as dbgshell:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; default: retval=-1; // unrecognized } - (void)out_dflt;//only to avoid -Wunused-parameter return retval; } -// --- command.atf_fuzz_proc.atf_fuzz.Start +// --- command.atf_exp_proc.atf_exp.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::atf_fuzz_Start(command::atf_fuzz_proc& parent) { +int command::atf_exp_Start(command::atf_exp_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(atf_fuzz_ToCmdline(parent)); // maybe print command + verblog(atf_exp_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(atf_fuzz_ToCmdline(parent)); + tempstr cmdline(atf_exp_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -14140,10 +14165,10 @@ int command::atf_fuzz_Start(command::atf_fuzz_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= atf_fuzz_Execv(parent); + if (retval==0) retval= atf_exp_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.atf_fuzz_execv" + prerr("command.atf_exp_execv" <&" << pipefd[1]; - atf_fuzz_Start(parent); + atf_exp_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.atf_fuzz_proc.atf_fuzz.Kill +// --- command.atf_exp_proc.atf_exp.Kill // Kill subprocess and wait -void command::atf_fuzz_Kill(command::atf_fuzz_proc& parent) { - if (parent.pid != 0) { +void command::atf_exp_Kill(command::atf_exp_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - atf_fuzz_Wait(parent); + atf_exp_Wait(parent); } } -// --- command.atf_fuzz_proc.atf_fuzz.Wait +// --- command.atf_exp_proc.atf_exp.Wait // Wait for subprocess to return -void command::atf_fuzz_Wait(command::atf_fuzz_proc& parent) { +void command::atf_exp_Wait(command::atf_exp_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -14198,31 +14223,31 @@ void command::atf_fuzz_Wait(command::atf_fuzz_proc& parent) { } } -// --- command.atf_fuzz_proc.atf_fuzz.Exec +// --- command.atf_exp_proc.atf_exp.Exec // Start + Wait // Execute subprocess and return exit code -int command::atf_fuzz_Exec(command::atf_fuzz_proc& parent) { - atf_fuzz_Start(parent); - atf_fuzz_Wait(parent); +int command::atf_exp_Exec(command::atf_exp_proc& parent) { + atf_exp_Start(parent); + atf_exp_Wait(parent); return parent.status; } -// --- command.atf_fuzz_proc.atf_fuzz.ExecX +// --- command.atf_exp_proc.atf_exp.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::atf_fuzz_ExecX(command::atf_fuzz_proc& parent) { - int rc = atf_fuzz_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_fuzz_ToCmdline(parent)) +void command::atf_exp_ExecX(command::atf_exp_proc& parent) { + int rc = atf_exp_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_exp_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.atf_fuzz_proc.atf_fuzz.Execv +// --- command.atf_exp_proc.atf_exp.Execv // Call execv() // Call execv with specified parameters -int command::atf_fuzz_Execv(command::atf_fuzz_proc& parent) { +int command::atf_exp_Execv(command::atf_exp_proc& parent) { int ret = 0; algo::StringAry args; - atf_fuzz_ToArgv(parent, args); + atf_exp_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -14234,11 +14259,11 @@ int command::atf_fuzz_Execv(command::atf_fuzz_proc& parent) { return ret; } -// --- command.atf_fuzz_proc.atf_fuzz.ToCmdline -algo::tempstr command::atf_fuzz_ToCmdline(command::atf_fuzz_proc& parent) { +// --- command.atf_exp_proc.atf_exp.ToCmdline +algo::tempstr command::atf_exp_ToCmdline(command::atf_exp_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::atf_fuzz_PrintArgv(parent.cmd,retval); + command::atf_exp_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -14251,130 +14276,115 @@ algo::tempstr command::atf_fuzz_ToCmdline(command::atf_fuzz_proc& parent) { return retval; } -// --- command.atf_fuzz_proc.atf_fuzz.ToArgv +// --- command.atf_exp_proc.atf_exp.ToArgv // Form array from the command line -void command::atf_fuzz_ToArgv(command::atf_fuzz_proc& parent, algo::StringAry& args) { +void command::atf_exp_ToArgv(command::atf_exp_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; - if (parent.cmd.reprofile != "temp/atf_fuzz.repro") { - cstring *arg = &ary_Alloc(args); - *arg << "-reprofile:"; - cstring_Print(parent.cmd.reprofile, *arg); - } - - if (parent.cmd.target != "") { + if (parent.cmd.in != "data") { cstring *arg = &ary_Alloc(args); - *arg << "-target:"; - Smallstr16_Print(parent.cmd.target, *arg); + *arg << "-in:"; + cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.args != "") { + if (parent.cmd.trace != "") { cstring *arg = &ary_Alloc(args); - *arg << "-args:"; - cstring_Print(parent.cmd.args, *arg); + *arg << "-trace:"; + cstring_Print(parent.cmd.trace, *arg); } - if (parent.cmd.inputfile != "") { + if (parent.cmd.bindir != "bin") { cstring *arg = &ary_Alloc(args); - *arg << "-inputfile:"; - cstring_Print(parent.cmd.inputfile, *arg); + *arg << "-bindir:"; + cstring_Print(parent.cmd.bindir, *arg); } - if (parent.cmd.fuzzstrat.expr != "%") { + if (parent.cmd.comptest != "") { cstring *arg = &ary_Alloc(args); - *arg << "-fuzzstrat:"; - command::fuzzstrat_Print(parent.cmd, *arg); + *arg << "-comptest:"; + Smallstr50_Print(parent.cmd.comptest, *arg); } - if (parent.cmd.in != "data") { + if (parent.cmd.tempdir != "") { cstring *arg = &ary_Alloc(args); - *arg << "-in:"; - cstring_Print(parent.cmd.in, *arg); + *arg << "-tempdir:"; + cstring_Print(parent.cmd.tempdir, *arg); } - if (parent.cmd.seed != 0) { + if (parent.cmd.timeout != 8.0) { cstring *arg = &ary_Alloc(args); - *arg << "-seed:"; - i32_Print(parent.cmd.seed, *arg); + *arg << "-timeout:"; + double_Print(parent.cmd.timeout, *arg); } - if (parent.cmd.testprob != 1) { + if (parent.cmd.dbgshell != false) { cstring *arg = &ary_Alloc(args); - *arg << "-testprob:"; - double_Print(parent.cmd.testprob, *arg); + *arg << "-dbgshell:"; + bool_Print(parent.cmd.dbgshell, *arg); } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } } -// --- command.atf_fuzz_proc..Uninit -void command::atf_fuzz_proc_Uninit(command::atf_fuzz_proc& parent) { - command::atf_fuzz_proc &row = parent; (void)row; +// --- command.atf_exp_proc..Uninit +void command::atf_exp_proc_Uninit(command::atf_exp_proc& parent) { + command::atf_exp_proc &row = parent; (void)row; - // command.atf_fuzz_proc.atf_fuzz.Uninit (Exec) // - atf_fuzz_Kill(parent); // kill child, ensure forward progress + // command.atf_exp_proc.atf_exp.Uninit (Exec) // + atf_exp_Kill(parent); // kill child, ensure forward progress } -// --- command.atf_gcli.gtblacttst.Print +// --- command.atf_fuzz.fuzzstrat.Print // Print back to string -void command::gtblacttst_Print(command::atf_gcli& parent, algo::cstring &out) { - Regx_Print(parent.gtblacttst, out); +void command::fuzzstrat_Print(command::atf_fuzz& parent, algo::cstring &out) { + Regx_Print(parent.fuzzstrat, out); } -// --- command.atf_gcli.gtblacttst.ReadStrptrMaybe +// --- command.atf_fuzz.fuzzstrat.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::gtblacttst_ReadStrptrMaybe(command::atf_gcli& parent, algo::strptr in) { +bool command::fuzzstrat_ReadStrptrMaybe(command::atf_fuzz& parent, algo::strptr in) { bool retval = true; - Regx_ReadSql(parent.gtblacttst, in, true); + Regx_ReadSql(parent.fuzzstrat, in, true); return retval; } -// --- command.atf_gcli..ReadFieldMaybe -bool command::atf_gcli_ReadFieldMaybe(command::atf_gcli& parent, algo::strptr field, algo::strptr strval) { +// --- command.atf_fuzz..ReadFieldMaybe +bool command::atf_fuzz_ReadFieldMaybe(command::atf_fuzz& parent, algo::strptr field, algo::strptr strval) { bool retval = true; command::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { + case command_FieldId_reprofile: { + retval = algo::cstring_ReadStrptrMaybe(parent.reprofile, strval); + } break; + case command_FieldId_target: { + retval = algo::Smallstr16_ReadStrptrMaybe(parent.target, strval); + } break; + case command_FieldId_args: { + retval = algo::cstring_ReadStrptrMaybe(parent.args, strval); + } break; + case command_FieldId_inputfile: { + retval = algo::cstring_ReadStrptrMaybe(parent.inputfile, strval); + } break; + case command_FieldId_fuzzstrat: { + retval = fuzzstrat_ReadStrptrMaybe(parent, strval); + } break; case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_gtblacttst: { - retval = gtblacttst_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_id: { - retval = algo::cstring_ReadStrptrMaybe(parent.id, strval); - break; - } - case command_FieldId_mr: { - retval = algo::cstring_ReadStrptrMaybe(parent.mr, strval); - break; - } - case command_FieldId_note: { - retval = algo::cstring_ReadStrptrMaybe(parent.note, strval); - break; - } - case command_FieldId_capture: { - retval = bool_ReadStrptrMaybe(parent.capture, strval); - break; - } - case command_FieldId_skip_init: { - retval = bool_ReadStrptrMaybe(parent.skip_init, strval); - break; - } - case command_FieldId_skip_git_init: { - retval = bool_ReadStrptrMaybe(parent.skip_git_init, strval); - break; - } - case command_FieldId_dry_run: { - retval = bool_ReadStrptrMaybe(parent.dry_run, strval); - break; - } - default: break; + } break; + case command_FieldId_seed: { + retval = i32_ReadStrptrMaybe(parent.seed, strval); + } break; + case command_FieldId_testprob: { + retval = double_ReadStrptrMaybe(parent.testprob, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -14382,12 +14392,16 @@ bool command::atf_gcli_ReadFieldMaybe(command::atf_gcli& parent, algo::strptr fi return retval; } -// --- command.atf_gcli..ReadTupleMaybe -// Read fields of command::atf_gcli from attributes of ascii tuple TUPLE -bool command::atf_gcli_ReadTupleMaybe(command::atf_gcli &parent, algo::Tuple &tuple) { - bool retval = true; - ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - retval = atf_gcli_ReadFieldMaybe(parent, attr.name, attr.value); +// --- command.atf_fuzz..ReadTupleMaybe +// Read fields of command::atf_fuzz from attributes of ascii tuple TUPLE +bool command::atf_fuzz_ReadTupleMaybe(command::atf_fuzz &parent, algo::Tuple &tuple) { + bool retval = true; + int anon_idx = 0; + ind_beg(algo::Tuple_attrs_curs,attr,tuple) { + if (ch_N(attr.name) == 0) { + attr.name = atf_fuzz_GetAnon(parent, anon_idx++); + } + retval = atf_fuzz_ReadFieldMaybe(parent, attr.name, attr.value); if (!retval) { break; } @@ -14395,27 +14409,26 @@ bool command::atf_gcli_ReadTupleMaybe(command::atf_gcli &parent, algo::Tuple &tu return retval; } -// --- command.atf_gcli..Init +// --- command.atf_fuzz..Init // Set all fields to initial values. -void command::atf_gcli_Init(command::atf_gcli& parent) { +void command::atf_fuzz_Init(command::atf_fuzz& parent) { + parent.reprofile = algo::strptr("temp/atf_fuzz.repro"); + parent.target = algo::strptr(""); + parent.args = algo::strptr(""); + parent.inputfile = algo::strptr(""); + Regx_ReadSql(parent.fuzzstrat, "%", true); parent.in = algo::strptr("data"); - Regx_ReadSql(parent.gtblacttst, "%", true); - parent.id = algo::strptr(""); - parent.mr = algo::strptr(""); - parent.note = algo::strptr(""); - parent.capture = bool(false); - parent.skip_init = bool(false); - parent.skip_git_init = bool(false); - parent.dry_run = bool(false); + parent.seed = i32(0); + parent.testprob = double(1); } -// --- command.atf_gcli..ToCmdline +// --- command.atf_fuzz..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::atf_gcli_ToCmdline(command::atf_gcli& row) { +tempstr command::atf_fuzz_ToCmdline(command::atf_fuzz& row) { tempstr ret; - ret << "bin/atf_gcli "; - atf_gcli_PrintArgv(row, ret); + ret << "bin/atf_fuzz "; + atf_fuzz_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -14426,127 +14439,117 @@ tempstr command::atf_gcli_ToCmdline(command::atf_gcli& row) { return ret; } -// --- command.atf_gcli..PrintArgv +// --- command.atf_fuzz..PrintArgv // print string representation of ROW to string STR -// cfmt:command.atf_gcli.Argv printfmt:Tuple -void command::atf_gcli_PrintArgv(command::atf_gcli& row, algo::cstring& str) { +// cfmt:command.atf_fuzz.Argv printfmt:Tuple +void command::atf_fuzz_PrintArgv(command::atf_fuzz& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; - if (!(row.in == "data")) { - ch_RemoveAll(temp); - cstring_Print(row.in, temp); - str << " -in:"; - strptr_PrintBash(temp,str); - } - if (!(row.gtblacttst.expr == "%")) { - ch_RemoveAll(temp); - command::gtblacttst_Print(const_cast(row), temp); - str << " -gtblacttst:"; - strptr_PrintBash(temp,str); - } - if (!(row.id == "")) { + if (!(row.reprofile == "temp/atf_fuzz.repro")) { ch_RemoveAll(temp); - cstring_Print(row.id, temp); - str << " -id:"; + cstring_Print(row.reprofile, temp); + str << " -reprofile:"; strptr_PrintBash(temp,str); } - if (!(row.mr == "")) { + ch_RemoveAll(temp); + Smallstr16_Print(row.target, temp); + str << " -target:"; + strptr_PrintBash(temp,str); + ch_RemoveAll(temp); + cstring_Print(row.args, temp); + str << " -args:"; + strptr_PrintBash(temp,str); + if (!(row.inputfile == "")) { ch_RemoveAll(temp); - cstring_Print(row.mr, temp); - str << " -mr:"; + cstring_Print(row.inputfile, temp); + str << " -inputfile:"; strptr_PrintBash(temp,str); } - if (!(row.note == "")) { + if (!(row.fuzzstrat.expr == "%")) { ch_RemoveAll(temp); - cstring_Print(row.note, temp); - str << " -note:"; + command::fuzzstrat_Print(const_cast(row), temp); + str << " -fuzzstrat:"; strptr_PrintBash(temp,str); } - if (!(row.capture == false)) { + if (!(row.in == "data")) { ch_RemoveAll(temp); - bool_Print(row.capture, temp); - str << " -capture:"; + cstring_Print(row.in, temp); + str << " -in:"; strptr_PrintBash(temp,str); } - if (!(row.skip_init == false)) { + if (!(row.seed == 0)) { ch_RemoveAll(temp); - bool_Print(row.skip_init, temp); - str << " -skip_init:"; + i32_Print(row.seed, temp); + str << " -seed:"; strptr_PrintBash(temp,str); } - if (!(row.skip_git_init == false)) { + if (!(row.testprob == 1)) { ch_RemoveAll(temp); - bool_Print(row.skip_git_init, temp); - str << " -skip_git_init:"; + double_Print(row.testprob, temp); + str << " -testprob:"; strptr_PrintBash(temp,str); } - if (!(row.dry_run == false)) { - ch_RemoveAll(temp); - bool_Print(row.dry_run, temp); - str << " -dry_run:"; - strptr_PrintBash(temp,str); +} + +// --- command.atf_fuzz..GetAnon +algo::strptr command::atf_fuzz_GetAnon(command::atf_fuzz &parent, i32 idx) { + (void)parent;//only to avoid -Wunused-parameter + switch(idx) { + case(0): return strptr("target", 6); + case(1): return strptr("args", 4); + default: return algo::strptr(); } } -// --- command.atf_gcli..NArgs +// --- command.atf_fuzz..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::atf_gcli_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::atf_fuzz_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment - *out_anon = false; - } break; - case command_FieldId_gtblacttst: { // $comment + case command_FieldId_reprofile: { // *out_anon = false; } break; - case command_FieldId_id: { // $comment - *out_anon = false; + case command_FieldId_target: { // + *out_anon = true; } break; - case command_FieldId_mr: { // $comment - *out_anon = false; + case command_FieldId_args: { // + *out_anon = true; } break; - case command_FieldId_note: { // $comment + case command_FieldId_inputfile: { // *out_anon = false; } break; - case command_FieldId_capture: { // $comment + case command_FieldId_fuzzstrat: { // *out_anon = false; - retval=0; - out_dflt="Y"; } break; - case command_FieldId_skip_init: { // bool: no argument required but value may be specified as capture:Y + case command_FieldId_in: { // *out_anon = false; - retval=0; - out_dflt="Y"; } break; - case command_FieldId_skip_git_init: { // bool: no argument required but value may be specified as skip_init:Y + case command_FieldId_seed: { // *out_anon = false; - retval=0; - out_dflt="Y"; } break; - case command_FieldId_dry_run: { // bool: no argument required but value may be specified as skip_git_init:Y + case command_FieldId_testprob: { // *out_anon = false; - retval=0; - out_dflt="Y"; } break; default: retval=-1; // unrecognized } + (void)out_dflt;//only to avoid -Wunused-parameter return retval; } -// --- command.atf_gcli_proc.atf_gcli.Start +// --- command.atf_fuzz_proc.atf_fuzz.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::atf_gcli_Start(command::atf_gcli_proc& parent) { +int command::atf_fuzz_Start(command::atf_fuzz_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(atf_gcli_ToCmdline(parent)); // maybe print command + verblog(atf_fuzz_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(atf_gcli_ToCmdline(parent)); + tempstr cmdline(atf_fuzz_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -14558,10 +14561,10 @@ int command::atf_gcli_Start(command::atf_gcli_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= atf_gcli_Execv(parent); + if (retval==0) retval= atf_fuzz_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.atf_gcli_execv" + prerr("command.atf_fuzz_execv" <&" << pipefd[1]; - atf_gcli_Start(parent); + atf_fuzz_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.atf_gcli_proc.atf_gcli.Kill +// --- command.atf_fuzz_proc.atf_fuzz.Kill // Kill subprocess and wait -void command::atf_gcli_Kill(command::atf_gcli_proc& parent) { - if (parent.pid != 0) { +void command::atf_fuzz_Kill(command::atf_fuzz_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - atf_gcli_Wait(parent); + atf_fuzz_Wait(parent); } } -// --- command.atf_gcli_proc.atf_gcli.Wait +// --- command.atf_fuzz_proc.atf_fuzz.Wait // Wait for subprocess to return -void command::atf_gcli_Wait(command::atf_gcli_proc& parent) { +void command::atf_fuzz_Wait(command::atf_fuzz_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -14616,31 +14619,31 @@ void command::atf_gcli_Wait(command::atf_gcli_proc& parent) { } } -// --- command.atf_gcli_proc.atf_gcli.Exec +// --- command.atf_fuzz_proc.atf_fuzz.Exec // Start + Wait // Execute subprocess and return exit code -int command::atf_gcli_Exec(command::atf_gcli_proc& parent) { - atf_gcli_Start(parent); - atf_gcli_Wait(parent); +int command::atf_fuzz_Exec(command::atf_fuzz_proc& parent) { + atf_fuzz_Start(parent); + atf_fuzz_Wait(parent); return parent.status; } -// --- command.atf_gcli_proc.atf_gcli.ExecX +// --- command.atf_fuzz_proc.atf_fuzz.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::atf_gcli_ExecX(command::atf_gcli_proc& parent) { - int rc = atf_gcli_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_gcli_ToCmdline(parent)) +void command::atf_fuzz_ExecX(command::atf_fuzz_proc& parent) { + int rc = atf_fuzz_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_fuzz_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.atf_gcli_proc.atf_gcli.Execv +// --- command.atf_fuzz_proc.atf_fuzz.Execv // Call execv() // Call execv with specified parameters -int command::atf_gcli_Execv(command::atf_gcli_proc& parent) { +int command::atf_fuzz_Execv(command::atf_fuzz_proc& parent) { int ret = 0; algo::StringAry args; - atf_gcli_ToArgv(parent, args); + atf_fuzz_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -14652,11 +14655,11 @@ int command::atf_gcli_Execv(command::atf_gcli_proc& parent) { return ret; } -// --- command.atf_gcli_proc.atf_gcli.ToCmdline -algo::tempstr command::atf_gcli_ToCmdline(command::atf_gcli_proc& parent) { +// --- command.atf_fuzz_proc.atf_fuzz.ToCmdline +algo::tempstr command::atf_fuzz_ToCmdline(command::atf_fuzz_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::atf_gcli_PrintArgv(parent.cmd,retval); + command::atf_fuzz_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -14669,97 +14672,124 @@ algo::tempstr command::atf_gcli_ToCmdline(command::atf_gcli_proc& parent) { return retval; } -// --- command.atf_gcli_proc.atf_gcli.ToArgv +// --- command.atf_fuzz_proc.atf_fuzz.ToArgv // Form array from the command line -void command::atf_gcli_ToArgv(command::atf_gcli_proc& parent, algo::StringAry& args) { +void command::atf_fuzz_ToArgv(command::atf_fuzz_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; - if (parent.cmd.in != "data") { - cstring *arg = &ary_Alloc(args); - *arg << "-in:"; - cstring_Print(parent.cmd.in, *arg); - } - - if (parent.cmd.gtblacttst.expr != "%") { + if (parent.cmd.reprofile != "temp/atf_fuzz.repro") { cstring *arg = &ary_Alloc(args); - *arg << "-gtblacttst:"; - command::gtblacttst_Print(parent.cmd, *arg); + *arg << "-reprofile:"; + cstring_Print(parent.cmd.reprofile, *arg); } - if (parent.cmd.id != "") { + if (parent.cmd.target != "") { cstring *arg = &ary_Alloc(args); - *arg << "-id:"; - cstring_Print(parent.cmd.id, *arg); + *arg << "-target:"; + Smallstr16_Print(parent.cmd.target, *arg); } - if (parent.cmd.mr != "") { + if (parent.cmd.args != "") { cstring *arg = &ary_Alloc(args); - *arg << "-mr:"; - cstring_Print(parent.cmd.mr, *arg); + *arg << "-args:"; + cstring_Print(parent.cmd.args, *arg); } - if (parent.cmd.note != "") { + if (parent.cmd.inputfile != "") { cstring *arg = &ary_Alloc(args); - *arg << "-note:"; - cstring_Print(parent.cmd.note, *arg); + *arg << "-inputfile:"; + cstring_Print(parent.cmd.inputfile, *arg); } - if (parent.cmd.capture != false) { + if (parent.cmd.fuzzstrat.expr != "%") { cstring *arg = &ary_Alloc(args); - *arg << "-capture:"; - bool_Print(parent.cmd.capture, *arg); + *arg << "-fuzzstrat:"; + command::fuzzstrat_Print(parent.cmd, *arg); } - if (parent.cmd.skip_init != false) { + if (parent.cmd.in != "data") { cstring *arg = &ary_Alloc(args); - *arg << "-skip_init:"; - bool_Print(parent.cmd.skip_init, *arg); + *arg << "-in:"; + cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.skip_git_init != false) { + if (parent.cmd.seed != 0) { cstring *arg = &ary_Alloc(args); - *arg << "-skip_git_init:"; - bool_Print(parent.cmd.skip_git_init, *arg); + *arg << "-seed:"; + i32_Print(parent.cmd.seed, *arg); } - if (parent.cmd.dry_run != false) { + if (parent.cmd.testprob != 1) { cstring *arg = &ary_Alloc(args); - *arg << "-dry_run:"; - bool_Print(parent.cmd.dry_run, *arg); + *arg << "-testprob:"; + double_Print(parent.cmd.testprob, *arg); } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } } -// --- command.atf_gcli_proc..Uninit -void command::atf_gcli_proc_Uninit(command::atf_gcli_proc& parent) { - command::atf_gcli_proc &row = parent; (void)row; +// --- command.atf_fuzz_proc..Uninit +void command::atf_fuzz_proc_Uninit(command::atf_fuzz_proc& parent) { + command::atf_fuzz_proc &row = parent; (void)row; - // command.atf_gcli_proc.atf_gcli.Uninit (Exec) // - atf_gcli_Kill(parent); // kill child, ensure forward progress + // command.atf_fuzz_proc.atf_fuzz.Uninit (Exec) // + atf_fuzz_Kill(parent); // kill child, ensure forward progress } -// --- command.atf_nrun..ReadFieldMaybe -bool command::atf_nrun_ReadFieldMaybe(command::atf_nrun& parent, algo::strptr field, algo::strptr strval) { +// --- command.atf_gcli.gtblacttst.Print +// Print back to string +void command::gtblacttst_Print(command::atf_gcli& parent, algo::cstring &out) { + Regx_Print(parent.gtblacttst, out); +} + +// --- command.atf_gcli.gtblacttst.ReadStrptrMaybe +// Read Regx from string +// Convert string to field. Return success value +bool command::gtblacttst_ReadStrptrMaybe(command::atf_gcli& parent, algo::strptr in) { + bool retval = true; + Regx_ReadSql(parent.gtblacttst, in, true); + return retval; +} + +// --- command.atf_gcli..ReadFieldMaybe +bool command::atf_gcli_ReadFieldMaybe(command::atf_gcli& parent, algo::strptr field, algo::strptr strval) { bool retval = true; command::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_maxjobs: { - retval = i32_ReadStrptrMaybe(parent.maxjobs, strval); - break; - } - case command_FieldId_ncmd: { - retval = i32_ReadStrptrMaybe(parent.ncmd, strval); - break; - } - default: break; + } break; + case command_FieldId_gtblacttst: { + retval = gtblacttst_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_id: { + retval = algo::cstring_ReadStrptrMaybe(parent.id, strval); + } break; + case command_FieldId_mr: { + retval = algo::cstring_ReadStrptrMaybe(parent.mr, strval); + } break; + case command_FieldId_note: { + retval = algo::cstring_ReadStrptrMaybe(parent.note, strval); + } break; + case command_FieldId_capture: { + retval = bool_ReadStrptrMaybe(parent.capture, strval); + } break; + case command_FieldId_skip_init: { + retval = bool_ReadStrptrMaybe(parent.skip_init, strval); + } break; + case command_FieldId_skip_git_init: { + retval = bool_ReadStrptrMaybe(parent.skip_git_init, strval); + } break; + case command_FieldId_dry_run: { + retval = bool_ReadStrptrMaybe(parent.dry_run, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -14767,16 +14797,12 @@ bool command::atf_nrun_ReadFieldMaybe(command::atf_nrun& parent, algo::strptr fi return retval; } -// --- command.atf_nrun..ReadTupleMaybe -// Read fields of command::atf_nrun from attributes of ascii tuple TUPLE -bool command::atf_nrun_ReadTupleMaybe(command::atf_nrun &parent, algo::Tuple &tuple) { +// --- command.atf_gcli..ReadTupleMaybe +// Read fields of command::atf_gcli from attributes of ascii tuple TUPLE +bool command::atf_gcli_ReadTupleMaybe(command::atf_gcli &parent, algo::Tuple &tuple) { bool retval = true; - int anon_idx = 0; ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - if (ch_N(attr.name) == 0) { - attr.name = atf_nrun_GetAnon(parent, anon_idx++); - } - retval = atf_nrun_ReadFieldMaybe(parent, attr.name, attr.value); + retval = atf_gcli_ReadFieldMaybe(parent, attr.name, attr.value); if (!retval) { break; } @@ -14784,13 +14810,27 @@ bool command::atf_nrun_ReadTupleMaybe(command::atf_nrun &parent, algo::Tuple &tu return retval; } -// --- command.atf_nrun..ToCmdline +// --- command.atf_gcli..Init +// Set all fields to initial values. +void command::atf_gcli_Init(command::atf_gcli& parent) { + parent.in = algo::strptr("data"); + Regx_ReadSql(parent.gtblacttst, "%", true); + parent.id = algo::strptr(""); + parent.mr = algo::strptr(""); + parent.note = algo::strptr(""); + parent.capture = bool(false); + parent.skip_init = bool(false); + parent.skip_git_init = bool(false); + parent.dry_run = bool(false); +} + +// --- command.atf_gcli..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::atf_nrun_ToCmdline(command::atf_nrun& row) { +tempstr command::atf_gcli_ToCmdline(command::atf_gcli& row) { tempstr ret; - ret << "bin/atf_nrun "; - atf_nrun_PrintArgv(row, ret); + ret << "bin/atf_gcli "; + atf_gcli_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -14801,10 +14841,10 @@ tempstr command::atf_nrun_ToCmdline(command::atf_nrun& row) { return ret; } -// --- command.atf_nrun..PrintArgv +// --- command.atf_gcli..PrintArgv // print string representation of ROW to string STR -// cfmt:command.atf_nrun.Argv printfmt:Tuple -void command::atf_nrun_PrintArgv(command::atf_nrun& row, algo::cstring& str) { +// cfmt:command.atf_gcli.Argv printfmt:Tuple +void command::atf_gcli_PrintArgv(command::atf_gcli& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; @@ -14814,60 +14854,114 @@ void command::atf_nrun_PrintArgv(command::atf_nrun& row, algo::cstring& str) { str << " -in:"; strptr_PrintBash(temp,str); } - if (!(row.maxjobs == 2)) { + if (!(row.gtblacttst.expr == "%")) { ch_RemoveAll(temp); - i32_Print(row.maxjobs, temp); - str << " -maxjobs:"; + command::gtblacttst_Print(const_cast(row), temp); + str << " -gtblacttst:"; strptr_PrintBash(temp,str); } - ch_RemoveAll(temp); - i32_Print(row.ncmd, temp); - str << " -ncmd:"; - strptr_PrintBash(temp,str); -} - -// --- command.atf_nrun..GetAnon -algo::strptr command::atf_nrun_GetAnon(command::atf_nrun &parent, i32 idx) { - (void)parent;//only to avoid -Wunused-parameter - switch(idx) { - case(0): return strptr("ncmd", 4); - default: return algo::strptr(); + if (!(row.id == "")) { + ch_RemoveAll(temp); + cstring_Print(row.id, temp); + str << " -id:"; + strptr_PrintBash(temp,str); + } + if (!(row.mr == "")) { + ch_RemoveAll(temp); + cstring_Print(row.mr, temp); + str << " -mr:"; + strptr_PrintBash(temp,str); + } + if (!(row.note == "")) { + ch_RemoveAll(temp); + cstring_Print(row.note, temp); + str << " -note:"; + strptr_PrintBash(temp,str); + } + if (!(row.capture == false)) { + ch_RemoveAll(temp); + bool_Print(row.capture, temp); + str << " -capture:"; + strptr_PrintBash(temp,str); + } + if (!(row.skip_init == false)) { + ch_RemoveAll(temp); + bool_Print(row.skip_init, temp); + str << " -skip_init:"; + strptr_PrintBash(temp,str); + } + if (!(row.skip_git_init == false)) { + ch_RemoveAll(temp); + bool_Print(row.skip_git_init, temp); + str << " -skip_git_init:"; + strptr_PrintBash(temp,str); + } + if (!(row.dry_run == false)) { + ch_RemoveAll(temp); + bool_Print(row.dry_run, temp); + str << " -dry_run:"; + strptr_PrintBash(temp,str); } } -// --- command.atf_nrun..NArgs +// --- command.atf_gcli..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::atf_nrun_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::atf_gcli_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_maxjobs: { // $comment + case command_FieldId_gtblacttst: { // *out_anon = false; } break; - case command_FieldId_ncmd: { // $comment - *out_anon = true; + case command_FieldId_id: { // + *out_anon = false; + } break; + case command_FieldId_mr: { // + *out_anon = false; + } break; + case command_FieldId_note: { // + *out_anon = false; + } break; + case command_FieldId_capture: { // bool: no argument required but value may be specified as capture:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_skip_init: { // bool: no argument required but value may be specified as skip_init:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_skip_git_init: { // bool: no argument required but value may be specified as skip_git_init:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_dry_run: { // bool: no argument required but value may be specified as dry_run:Y + *out_anon = false; + retval=0; + out_dflt="Y"; } break; default: retval=-1; // unrecognized } - (void)out_dflt;//only to avoid -Wunused-parameter return retval; } -// --- command.atf_nrun_proc.atf_nrun.Start +// --- command.atf_gcli_proc.atf_gcli.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::atf_nrun_Start(command::atf_nrun_proc& parent) { +int command::atf_gcli_Start(command::atf_gcli_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(atf_nrun_ToCmdline(parent)); // maybe print command + verblog(atf_gcli_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(atf_nrun_ToCmdline(parent)); + tempstr cmdline(atf_gcli_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -14879,10 +14973,10 @@ int command::atf_nrun_Start(command::atf_nrun_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= atf_nrun_Execv(parent); + if (retval==0) retval= atf_gcli_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.atf_nrun_execv" + prerr("command.atf_gcli_execv" <&" << pipefd[1]; - atf_nrun_Start(parent); + atf_gcli_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.atf_nrun_proc.atf_nrun.Kill +// --- command.atf_gcli_proc.atf_gcli.Kill // Kill subprocess and wait -void command::atf_nrun_Kill(command::atf_nrun_proc& parent) { - if (parent.pid != 0) { +void command::atf_gcli_Kill(command::atf_gcli_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - atf_nrun_Wait(parent); + atf_gcli_Wait(parent); } } -// --- command.atf_nrun_proc.atf_nrun.Wait +// --- command.atf_gcli_proc.atf_gcli.Wait // Wait for subprocess to return -void command::atf_nrun_Wait(command::atf_nrun_proc& parent) { +void command::atf_gcli_Wait(command::atf_gcli_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -14937,31 +15031,31 @@ void command::atf_nrun_Wait(command::atf_nrun_proc& parent) { } } -// --- command.atf_nrun_proc.atf_nrun.Exec +// --- command.atf_gcli_proc.atf_gcli.Exec // Start + Wait // Execute subprocess and return exit code -int command::atf_nrun_Exec(command::atf_nrun_proc& parent) { - atf_nrun_Start(parent); - atf_nrun_Wait(parent); +int command::atf_gcli_Exec(command::atf_gcli_proc& parent) { + atf_gcli_Start(parent); + atf_gcli_Wait(parent); return parent.status; } -// --- command.atf_nrun_proc.atf_nrun.ExecX +// --- command.atf_gcli_proc.atf_gcli.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::atf_nrun_ExecX(command::atf_nrun_proc& parent) { - int rc = atf_nrun_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_nrun_ToCmdline(parent)) +void command::atf_gcli_ExecX(command::atf_gcli_proc& parent) { + int rc = atf_gcli_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_gcli_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.atf_nrun_proc.atf_nrun.Execv +// --- command.atf_gcli_proc.atf_gcli.Execv // Call execv() // Call execv with specified parameters -int command::atf_nrun_Execv(command::atf_nrun_proc& parent) { +int command::atf_gcli_Execv(command::atf_gcli_proc& parent) { int ret = 0; algo::StringAry args; - atf_nrun_ToArgv(parent, args); + atf_gcli_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -14973,11 +15067,11 @@ int command::atf_nrun_Execv(command::atf_nrun_proc& parent) { return ret; } -// --- command.atf_nrun_proc.atf_nrun.ToCmdline -algo::tempstr command::atf_nrun_ToCmdline(command::atf_nrun_proc& parent) { +// --- command.atf_gcli_proc.atf_gcli.ToCmdline +algo::tempstr command::atf_gcli_ToCmdline(command::atf_gcli_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::atf_nrun_PrintArgv(parent.cmd,retval); + command::atf_gcli_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -14990,9 +15084,9 @@ algo::tempstr command::atf_nrun_ToCmdline(command::atf_nrun_proc& parent) { return retval; } -// --- command.atf_nrun_proc.atf_nrun.ToArgv +// --- command.atf_gcli_proc.atf_gcli.ToArgv // Form array from the command line -void command::atf_nrun_ToArgv(command::atf_nrun_proc& parent, algo::StringAry& args) { +void command::atf_gcli_ToArgv(command::atf_gcli_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; @@ -15002,92 +15096,85 @@ void command::atf_nrun_ToArgv(command::atf_nrun_proc& parent, algo::StringAry& a cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.maxjobs != 2) { + if (parent.cmd.gtblacttst.expr != "%") { cstring *arg = &ary_Alloc(args); - *arg << "-maxjobs:"; - i32_Print(parent.cmd.maxjobs, *arg); + *arg << "-gtblacttst:"; + command::gtblacttst_Print(parent.cmd, *arg); } - if (parent.cmd.ncmd != 6) { + if (parent.cmd.id != "") { cstring *arg = &ary_Alloc(args); - *arg << "-ncmd:"; - i32_Print(parent.cmd.ncmd, *arg); + *arg << "-id:"; + cstring_Print(parent.cmd.id, *arg); } - for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { - ary_Alloc(args) << "-verbose"; + + if (parent.cmd.mr != "") { + cstring *arg = &ary_Alloc(args); + *arg << "-mr:"; + cstring_Print(parent.cmd.mr, *arg); } -} -// --- command.atf_nrun_proc..Uninit -void command::atf_nrun_proc_Uninit(command::atf_nrun_proc& parent) { - command::atf_nrun_proc &row = parent; (void)row; + if (parent.cmd.note != "") { + cstring *arg = &ary_Alloc(args); + *arg << "-note:"; + cstring_Print(parent.cmd.note, *arg); + } - // command.atf_nrun_proc.atf_nrun.Uninit (Exec) // - atf_nrun_Kill(parent); // kill child, ensure forward progress -} + if (parent.cmd.capture != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-capture:"; + bool_Print(parent.cmd.capture, *arg); + } -// --- command.atf_unit.unittest.Print -// Print back to string -void command::unittest_Print(command::atf_unit& parent, algo::cstring &out) { - Regx_Print(parent.unittest, out); + if (parent.cmd.skip_init != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-skip_init:"; + bool_Print(parent.cmd.skip_init, *arg); + } + + if (parent.cmd.skip_git_init != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-skip_git_init:"; + bool_Print(parent.cmd.skip_git_init, *arg); + } + + if (parent.cmd.dry_run != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-dry_run:"; + bool_Print(parent.cmd.dry_run, *arg); + } + for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { + ary_Alloc(args) << "-verbose"; + } } -// --- command.atf_unit.unittest.ReadStrptrMaybe -// Read Regx from string -// Convert string to field. Return success value -bool command::unittest_ReadStrptrMaybe(command::atf_unit& parent, algo::strptr in) { - bool retval = true; - Regx_ReadSql(parent.unittest, in, true); - return retval; +// --- command.atf_gcli_proc..Uninit +void command::atf_gcli_proc_Uninit(command::atf_gcli_proc& parent) { + command::atf_gcli_proc &row = parent; (void)row; + + // command.atf_gcli_proc.atf_gcli.Uninit (Exec) // + atf_gcli_Kill(parent); // kill child, ensure forward progress } -// --- command.atf_unit..ReadFieldMaybe -bool command::atf_unit_ReadFieldMaybe(command::atf_unit& parent, algo::strptr field, algo::strptr strval) { +// --- command.atf_nrun..ReadFieldMaybe +bool command::atf_nrun_ReadFieldMaybe(command::atf_nrun& parent, algo::strptr field, algo::strptr strval) { bool retval = true; command::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case command_FieldId_unittest: { - retval = unittest_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_nofork: { - retval = bool_ReadStrptrMaybe(parent.nofork, strval); - break; - } - case command_FieldId_arg: { - retval = algo::cstring_ReadStrptrMaybe(parent.arg, strval); - break; - } - case command_FieldId_data_dir: { - retval = algo::cstring_ReadStrptrMaybe(parent.data_dir, strval); - break; - } - case command_FieldId_mdbg: { - retval = bool_ReadStrptrMaybe(parent.mdbg, strval); - break; - } - case command_FieldId_perf_secs: { - retval = double_ReadStrptrMaybe(parent.perf_secs, strval); - break; - } - case command_FieldId_pertest_timeout: { - retval = u32_ReadStrptrMaybe(parent.pertest_timeout, strval); - break; - } - case command_FieldId_report: { - retval = bool_ReadStrptrMaybe(parent.report, strval); - break; - } - case command_FieldId_capture: { - retval = bool_ReadStrptrMaybe(parent.capture, strval); - break; - } - case command_FieldId_check_untracked: { - retval = bool_ReadStrptrMaybe(parent.check_untracked, strval); - break; - } - default: break; + case command_FieldId_in: { + retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); + } break; + case command_FieldId_maxjobs: { + retval = i32_ReadStrptrMaybe(parent.maxjobs, strval); + } break; + case command_FieldId_ncmd: { + retval = i32_ReadStrptrMaybe(parent.ncmd, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -15095,16 +15182,16 @@ bool command::atf_unit_ReadFieldMaybe(command::atf_unit& parent, algo::strptr fi return retval; } -// --- command.atf_unit..ReadTupleMaybe -// Read fields of command::atf_unit from attributes of ascii tuple TUPLE -bool command::atf_unit_ReadTupleMaybe(command::atf_unit &parent, algo::Tuple &tuple) { +// --- command.atf_nrun..ReadTupleMaybe +// Read fields of command::atf_nrun from attributes of ascii tuple TUPLE +bool command::atf_nrun_ReadTupleMaybe(command::atf_nrun &parent, algo::Tuple &tuple) { bool retval = true; int anon_idx = 0; ind_beg(algo::Tuple_attrs_curs,attr,tuple) { if (ch_N(attr.name) == 0) { - attr.name = atf_unit_GetAnon(parent, anon_idx++); + attr.name = atf_nrun_GetAnon(parent, anon_idx++); } - retval = atf_unit_ReadFieldMaybe(parent, attr.name, attr.value); + retval = atf_nrun_ReadFieldMaybe(parent, attr.name, attr.value); if (!retval) { break; } @@ -15112,28 +15199,13 @@ bool command::atf_unit_ReadTupleMaybe(command::atf_unit &parent, algo::Tuple &tu return retval; } -// --- command.atf_unit..Init -// Set all fields to initial values. -void command::atf_unit_Init(command::atf_unit& parent) { - Regx_ReadSql(parent.unittest, "%", true); - parent.nofork = bool(false); - parent.arg = algo::strptr(""); - parent.data_dir = algo::strptr("data"); - parent.mdbg = bool(0); - parent.perf_secs = double(1.0); - parent.pertest_timeout = u32(900); - parent.report = bool(true); - parent.capture = bool(false); - parent.check_untracked = bool(true); -} - -// --- command.atf_unit..ToCmdline +// --- command.atf_nrun..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::atf_unit_ToCmdline(command::atf_unit& row) { +tempstr command::atf_nrun_ToCmdline(command::atf_nrun& row) { tempstr ret; - ret << "bin/atf_unit "; - atf_unit_PrintArgv(row, ret); + ret << "bin/atf_nrun "; + atf_nrun_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -15144,145 +15216,73 @@ tempstr command::atf_unit_ToCmdline(command::atf_unit& row) { return ret; } -// --- command.atf_unit..PrintArgv +// --- command.atf_nrun..PrintArgv // print string representation of ROW to string STR -// cfmt:command.atf_unit.Argv printfmt:Auto -void command::atf_unit_PrintArgv(command::atf_unit& row, algo::cstring& str) { +// cfmt:command.atf_nrun.Argv printfmt:Tuple +void command::atf_nrun_PrintArgv(command::atf_nrun& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; - ch_RemoveAll(temp); - command::unittest_Print(const_cast(row), temp); - str << " -unittest:"; - strptr_PrintBash(temp,str); - if (!(row.nofork == false)) { - ch_RemoveAll(temp); - bool_Print(row.nofork, temp); - str << " -nofork:"; - strptr_PrintBash(temp,str); - } - if (!(row.arg == "")) { - ch_RemoveAll(temp); - cstring_Print(row.arg, temp); - str << " -arg:"; - strptr_PrintBash(temp,str); - } - if (!(row.data_dir == "data")) { - ch_RemoveAll(temp); - cstring_Print(row.data_dir, temp); - str << " -data_dir:"; - strptr_PrintBash(temp,str); - } - if (!(row.mdbg == 0)) { - ch_RemoveAll(temp); - bool_Print(row.mdbg, temp); - str << " -mdbg:"; - strptr_PrintBash(temp,str); - } - if (!(row.perf_secs == 1.0)) { - ch_RemoveAll(temp); - double_Print(row.perf_secs, temp); - str << " -perf_secs:"; - strptr_PrintBash(temp,str); - } - if (!(row.pertest_timeout == 900)) { - ch_RemoveAll(temp); - u32_Print(row.pertest_timeout, temp); - str << " -pertest_timeout:"; - strptr_PrintBash(temp,str); - } - if (!(row.report == true)) { - ch_RemoveAll(temp); - bool_Print(row.report, temp); - str << " -report:"; - strptr_PrintBash(temp,str); - } - if (!(row.capture == false)) { + if (!(row.in == "data")) { ch_RemoveAll(temp); - bool_Print(row.capture, temp); - str << " -capture:"; + cstring_Print(row.in, temp); + str << " -in:"; strptr_PrintBash(temp,str); } - if (!(row.check_untracked == true)) { + if (!(row.maxjobs == 2)) { ch_RemoveAll(temp); - bool_Print(row.check_untracked, temp); - str << " -check_untracked:"; + i32_Print(row.maxjobs, temp); + str << " -maxjobs:"; strptr_PrintBash(temp,str); } + ch_RemoveAll(temp); + i32_Print(row.ncmd, temp); + str << " -ncmd:"; + strptr_PrintBash(temp,str); } -// --- command.atf_unit..GetAnon -algo::strptr command::atf_unit_GetAnon(command::atf_unit &parent, i32 idx) { +// --- command.atf_nrun..GetAnon +algo::strptr command::atf_nrun_GetAnon(command::atf_nrun &parent, i32 idx) { (void)parent;//only to avoid -Wunused-parameter switch(idx) { - case(0): return strptr("unittest", 8); + case(0): return strptr("ncmd", 4); default: return algo::strptr(); } } -// --- command.atf_unit..NArgs +// --- command.atf_nrun..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::atf_unit_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::atf_nrun_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_unittest: { // $comment - *out_anon = true; - } break; - case command_FieldId_nofork: { // $comment - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_arg: { // bool: no argument required but value may be specified as nofork:Y - *out_anon = false; - } break; - case command_FieldId_data_dir: { // bool: no argument required but value may be specified as nofork:Y - *out_anon = false; - } break; - case command_FieldId_mdbg: { // bool: no argument required but value may be specified as nofork:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_perf_secs: { // bool: no argument required but value may be specified as mdbg:Y + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_pertest_timeout: { // bool: no argument required but value may be specified as mdbg:Y + case command_FieldId_maxjobs: { // *out_anon = false; } break; - case command_FieldId_report: { // bool: no argument required but value may be specified as mdbg:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_capture: { // bool: no argument required but value may be specified as report:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_check_untracked: { // bool: no argument required but value may be specified as capture:Y - *out_anon = false; - retval=0; - out_dflt="Y"; + case command_FieldId_ncmd: { // + *out_anon = true; } break; default: retval=-1; // unrecognized } + (void)out_dflt;//only to avoid -Wunused-parameter return retval; } -// --- command.atf_unit_proc.atf_unit.Start +// --- command.atf_nrun_proc.atf_nrun.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::atf_unit_Start(command::atf_unit_proc& parent) { +int command::atf_nrun_Start(command::atf_nrun_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(atf_unit_ToCmdline(parent)); // maybe print command + verblog(atf_nrun_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(atf_unit_ToCmdline(parent)); + tempstr cmdline(atf_nrun_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -15294,10 +15294,10 @@ int command::atf_unit_Start(command::atf_unit_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= atf_unit_Execv(parent); + if (retval==0) retval= atf_nrun_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.atf_unit_execv" + prerr("command.atf_nrun_execv" <&" << pipefd[1]; - atf_unit_Start(parent); + atf_nrun_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.atf_unit_proc.atf_unit.Kill +// --- command.atf_nrun_proc.atf_nrun.Kill // Kill subprocess and wait -void command::atf_unit_Kill(command::atf_unit_proc& parent) { - if (parent.pid != 0) { +void command::atf_nrun_Kill(command::atf_nrun_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - atf_unit_Wait(parent); + atf_nrun_Wait(parent); } } -// --- command.atf_unit_proc.atf_unit.Wait +// --- command.atf_nrun_proc.atf_nrun.Wait // Wait for subprocess to return -void command::atf_unit_Wait(command::atf_unit_proc& parent) { +void command::atf_nrun_Wait(command::atf_nrun_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -15352,31 +15352,31 @@ void command::atf_unit_Wait(command::atf_unit_proc& parent) { } } -// --- command.atf_unit_proc.atf_unit.Exec +// --- command.atf_nrun_proc.atf_nrun.Exec // Start + Wait // Execute subprocess and return exit code -int command::atf_unit_Exec(command::atf_unit_proc& parent) { - atf_unit_Start(parent); - atf_unit_Wait(parent); +int command::atf_nrun_Exec(command::atf_nrun_proc& parent) { + atf_nrun_Start(parent); + atf_nrun_Wait(parent); return parent.status; } -// --- command.atf_unit_proc.atf_unit.ExecX +// --- command.atf_nrun_proc.atf_nrun.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::atf_unit_ExecX(command::atf_unit_proc& parent) { - int rc = atf_unit_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_unit_ToCmdline(parent)) +void command::atf_nrun_ExecX(command::atf_nrun_proc& parent) { + int rc = atf_nrun_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_nrun_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.atf_unit_proc.atf_unit.Execv +// --- command.atf_nrun_proc.atf_nrun.Execv // Call execv() // Call execv with specified parameters -int command::atf_unit_Execv(command::atf_unit_proc& parent) { +int command::atf_nrun_Execv(command::atf_nrun_proc& parent) { int ret = 0; algo::StringAry args; - atf_unit_ToArgv(parent, args); + atf_nrun_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -15388,11 +15388,11 @@ int command::atf_unit_Execv(command::atf_unit_proc& parent) { return ret; } -// --- command.atf_unit_proc.atf_unit.ToCmdline -algo::tempstr command::atf_unit_ToCmdline(command::atf_unit_proc& parent) { +// --- command.atf_nrun_proc.atf_nrun.ToCmdline +algo::tempstr command::atf_nrun_ToCmdline(command::atf_nrun_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::atf_unit_PrintArgv(parent.cmd,retval); + command::atf_nrun_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -15405,114 +15405,97 @@ algo::tempstr command::atf_unit_ToCmdline(command::atf_unit_proc& parent) { return retval; } -// --- command.atf_unit_proc.atf_unit.ToArgv +// --- command.atf_nrun_proc.atf_nrun.ToArgv // Form array from the command line -void command::atf_unit_ToArgv(command::atf_unit_proc& parent, algo::StringAry& args) { +void command::atf_nrun_ToArgv(command::atf_nrun_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; - if (parent.cmd.unittest.expr != "%") { - cstring *arg = &ary_Alloc(args); - *arg << "-unittest:"; - command::unittest_Print(parent.cmd, *arg); - } - - if (parent.cmd.nofork != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-nofork:"; - bool_Print(parent.cmd.nofork, *arg); - } - - if (parent.cmd.arg != "") { - cstring *arg = &ary_Alloc(args); - *arg << "-arg:"; - cstring_Print(parent.cmd.arg, *arg); - } - - if (parent.cmd.data_dir != "data") { - cstring *arg = &ary_Alloc(args); - *arg << "-data_dir:"; - cstring_Print(parent.cmd.data_dir, *arg); - } - - if (parent.cmd.mdbg != 0) { - cstring *arg = &ary_Alloc(args); - *arg << "-mdbg:"; - bool_Print(parent.cmd.mdbg, *arg); - } - - if (parent.cmd.perf_secs != 1.0) { - cstring *arg = &ary_Alloc(args); - *arg << "-perf_secs:"; - double_Print(parent.cmd.perf_secs, *arg); - } - - if (parent.cmd.pertest_timeout != 900) { - cstring *arg = &ary_Alloc(args); - *arg << "-pertest_timeout:"; - u32_Print(parent.cmd.pertest_timeout, *arg); - } - - if (parent.cmd.report != true) { + if (parent.cmd.in != "data") { cstring *arg = &ary_Alloc(args); - *arg << "-report:"; - bool_Print(parent.cmd.report, *arg); + *arg << "-in:"; + cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.capture != false) { + if (parent.cmd.maxjobs != 2) { cstring *arg = &ary_Alloc(args); - *arg << "-capture:"; - bool_Print(parent.cmd.capture, *arg); + *arg << "-maxjobs:"; + i32_Print(parent.cmd.maxjobs, *arg); } - if (parent.cmd.check_untracked != true) { + if (parent.cmd.ncmd != 6) { cstring *arg = &ary_Alloc(args); - *arg << "-check_untracked:"; - bool_Print(parent.cmd.check_untracked, *arg); + *arg << "-ncmd:"; + i32_Print(parent.cmd.ncmd, *arg); } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } } -// --- command.atf_unit_proc..Uninit -void command::atf_unit_proc_Uninit(command::atf_unit_proc& parent) { - command::atf_unit_proc &row = parent; (void)row; +// --- command.atf_nrun_proc..Uninit +void command::atf_nrun_proc_Uninit(command::atf_nrun_proc& parent) { + command::atf_nrun_proc &row = parent; (void)row; - // command.atf_unit_proc.atf_unit.Uninit (Exec) // - atf_unit_Kill(parent); // kill child, ensure forward progress + // command.atf_nrun_proc.atf_nrun.Uninit (Exec) // + atf_nrun_Kill(parent); // kill child, ensure forward progress } -// --- command.bash..PrintArgv -// print string representation of ROW to string STR -// cfmt:command.bash.ArgvGnu printfmt:Auto -void command::bash_PrintArgv(command::bash& row, algo::cstring& str) { - algo::tempstr temp; - (void)temp; - (void)str; - if (!(row.c == "")) { - ch_RemoveAll(temp); - cstring_Print(row.c, temp); - str << " -c "; - strptr_PrintBash(temp,str); - } +// --- command.atf_unit.unittest.Print +// Print back to string +void command::unittest_Print(command::atf_unit& parent, algo::cstring &out) { + Regx_Print(parent.unittest, out); } -// --- command.bash2html..ReadFieldMaybe -bool command::bash2html_ReadFieldMaybe(command::bash2html& parent, algo::strptr field, algo::strptr strval) { +// --- command.atf_unit.unittest.ReadStrptrMaybe +// Read Regx from string +// Convert string to field. Return success value +bool command::unittest_ReadStrptrMaybe(command::atf_unit& parent, algo::strptr in) { + bool retval = true; + Regx_ReadSql(parent.unittest, in, true); + return retval; +} + +// --- command.atf_unit..ReadFieldMaybe +bool command::atf_unit_ReadFieldMaybe(command::atf_unit& parent, algo::strptr field, algo::strptr strval) { bool retval = true; command::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case command_FieldId_in: { - retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_test: { - retval = bool_ReadStrptrMaybe(parent.test, strval); - break; - } - default: break; + case command_FieldId_unittest: { + retval = unittest_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_nofork: { + retval = bool_ReadStrptrMaybe(parent.nofork, strval); + } break; + case command_FieldId_arg: { + retval = algo::cstring_ReadStrptrMaybe(parent.arg, strval); + } break; + case command_FieldId_data_dir: { + retval = algo::cstring_ReadStrptrMaybe(parent.data_dir, strval); + } break; + case command_FieldId_mdbg: { + retval = bool_ReadStrptrMaybe(parent.mdbg, strval); + } break; + case command_FieldId_perf_secs: { + retval = double_ReadStrptrMaybe(parent.perf_secs, strval); + } break; + case command_FieldId_pertest_timeout: { + retval = u32_ReadStrptrMaybe(parent.pertest_timeout, strval); + } break; + case command_FieldId_report: { + retval = bool_ReadStrptrMaybe(parent.report, strval); + } break; + case command_FieldId_capture: { + retval = bool_ReadStrptrMaybe(parent.capture, strval); + } break; + case command_FieldId_check_untracked: { + retval = bool_ReadStrptrMaybe(parent.check_untracked, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -15520,12 +15503,16 @@ bool command::bash2html_ReadFieldMaybe(command::bash2html& parent, algo::strptr return retval; } -// --- command.bash2html..ReadTupleMaybe -// Read fields of command::bash2html from attributes of ascii tuple TUPLE -bool command::bash2html_ReadTupleMaybe(command::bash2html &parent, algo::Tuple &tuple) { +// --- command.atf_unit..ReadTupleMaybe +// Read fields of command::atf_unit from attributes of ascii tuple TUPLE +bool command::atf_unit_ReadTupleMaybe(command::atf_unit &parent, algo::Tuple &tuple) { bool retval = true; + int anon_idx = 0; ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - retval = bash2html_ReadFieldMaybe(parent, attr.name, attr.value); + if (ch_N(attr.name) == 0) { + attr.name = atf_unit_GetAnon(parent, anon_idx++); + } + retval = atf_unit_ReadFieldMaybe(parent, attr.name, attr.value); if (!retval) { break; } @@ -15533,13 +15520,28 @@ bool command::bash2html_ReadTupleMaybe(command::bash2html &parent, algo::Tuple & return retval; } -// --- command.bash2html..ToCmdline +// --- command.atf_unit..Init +// Set all fields to initial values. +void command::atf_unit_Init(command::atf_unit& parent) { + Regx_ReadSql(parent.unittest, "%", true); + parent.nofork = bool(false); + parent.arg = algo::strptr(""); + parent.data_dir = algo::strptr("data"); + parent.mdbg = bool(0); + parent.perf_secs = double(1.0); + parent.pertest_timeout = u32(900); + parent.report = bool(true); + parent.capture = bool(false); + parent.check_untracked = bool(true); +} + +// --- command.atf_unit..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::bash2html_ToCmdline(command::bash2html& row) { +tempstr command::atf_unit_ToCmdline(command::atf_unit& row) { tempstr ret; - ret << "bin/bash2html "; - bash2html_PrintArgv(row, ret); + ret << "bin/atf_unit "; + atf_unit_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -15550,38 +15552,125 @@ tempstr command::bash2html_ToCmdline(command::bash2html& row) { return ret; } -// --- command.bash2html..PrintArgv +// --- command.atf_unit..PrintArgv // print string representation of ROW to string STR -// cfmt:command.bash2html.Argv printfmt:Tuple -void command::bash2html_PrintArgv(command::bash2html& row, algo::cstring& str) { +// cfmt:command.atf_unit.Argv printfmt:Auto +void command::atf_unit_PrintArgv(command::atf_unit& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; - if (!(row.in == "data")) { + ch_RemoveAll(temp); + command::unittest_Print(const_cast(row), temp); + str << " -unittest:"; + strptr_PrintBash(temp,str); + if (!(row.nofork == false)) { ch_RemoveAll(temp); - cstring_Print(row.in, temp); - str << " -in:"; + bool_Print(row.nofork, temp); + str << " -nofork:"; strptr_PrintBash(temp,str); } - if (!(row.test == false)) { + if (!(row.arg == "")) { ch_RemoveAll(temp); - bool_Print(row.test, temp); - str << " -test:"; + cstring_Print(row.arg, temp); + str << " -arg:"; strptr_PrintBash(temp,str); } -} - -// --- command.bash2html..NArgs + if (!(row.data_dir == "data")) { + ch_RemoveAll(temp); + cstring_Print(row.data_dir, temp); + str << " -data_dir:"; + strptr_PrintBash(temp,str); + } + if (!(row.mdbg == 0)) { + ch_RemoveAll(temp); + bool_Print(row.mdbg, temp); + str << " -mdbg:"; + strptr_PrintBash(temp,str); + } + if (!(row.perf_secs == 1.0)) { + ch_RemoveAll(temp); + double_Print(row.perf_secs, temp); + str << " -perf_secs:"; + strptr_PrintBash(temp,str); + } + if (!(row.pertest_timeout == 900)) { + ch_RemoveAll(temp); + u32_Print(row.pertest_timeout, temp); + str << " -pertest_timeout:"; + strptr_PrintBash(temp,str); + } + if (!(row.report == true)) { + ch_RemoveAll(temp); + bool_Print(row.report, temp); + str << " -report:"; + strptr_PrintBash(temp,str); + } + if (!(row.capture == false)) { + ch_RemoveAll(temp); + bool_Print(row.capture, temp); + str << " -capture:"; + strptr_PrintBash(temp,str); + } + if (!(row.check_untracked == true)) { + ch_RemoveAll(temp); + bool_Print(row.check_untracked, temp); + str << " -check_untracked:"; + strptr_PrintBash(temp,str); + } +} + +// --- command.atf_unit..GetAnon +algo::strptr command::atf_unit_GetAnon(command::atf_unit &parent, i32 idx) { + (void)parent;//only to avoid -Wunused-parameter + switch(idx) { + case(0): return strptr("unittest", 8); + default: return algo::strptr(); + } +} + +// --- command.atf_unit..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::bash2html_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::atf_unit_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_unittest: { // + *out_anon = true; + } break; + case command_FieldId_nofork: { // bool: no argument required but value may be specified as nofork:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_arg: { // + *out_anon = false; + } break; + case command_FieldId_data_dir: { // + *out_anon = false; + } break; + case command_FieldId_mdbg: { // bool: no argument required but value may be specified as mdbg:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_perf_secs: { // + *out_anon = false; + } break; + case command_FieldId_pertest_timeout: { // + *out_anon = false; + } break; + case command_FieldId_report: { // bool: no argument required but value may be specified as report:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_capture: { // bool: no argument required but value may be specified as capture:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_test: { // $comment + case command_FieldId_check_untracked: { // bool: no argument required but value may be specified as check_untracked:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -15592,16 +15681,16 @@ i32 command::bash2html_NArgs(command::FieldId field, algo::strptr& out_dflt, boo return retval; } -// --- command.bash2html_proc.bash2html.Start +// --- command.atf_unit_proc.atf_unit.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::bash2html_Start(command::bash2html_proc& parent) { +int command::atf_unit_Start(command::atf_unit_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(bash2html_ToCmdline(parent)); // maybe print command + verblog(atf_unit_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(bash2html_ToCmdline(parent)); + tempstr cmdline(atf_unit_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -15613,10 +15702,10 @@ int command::bash2html_Start(command::bash2html_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= bash2html_Execv(parent); + if (retval==0) retval= atf_unit_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.bash2html_execv" + prerr("command.atf_unit_execv" <&" << pipefd[1]; - bash2html_Start(parent); + atf_unit_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.bash2html_proc.bash2html.Kill +// --- command.atf_unit_proc.atf_unit.Kill // Kill subprocess and wait -void command::bash2html_Kill(command::bash2html_proc& parent) { - if (parent.pid != 0) { +void command::atf_unit_Kill(command::atf_unit_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - bash2html_Wait(parent); + atf_unit_Wait(parent); } } -// --- command.bash2html_proc.bash2html.Wait +// --- command.atf_unit_proc.atf_unit.Wait // Wait for subprocess to return -void command::bash2html_Wait(command::bash2html_proc& parent) { +void command::atf_unit_Wait(command::atf_unit_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -15671,31 +15760,31 @@ void command::bash2html_Wait(command::bash2html_proc& parent) { } } -// --- command.bash2html_proc.bash2html.Exec +// --- command.atf_unit_proc.atf_unit.Exec // Start + Wait // Execute subprocess and return exit code -int command::bash2html_Exec(command::bash2html_proc& parent) { - bash2html_Start(parent); - bash2html_Wait(parent); +int command::atf_unit_Exec(command::atf_unit_proc& parent) { + atf_unit_Start(parent); + atf_unit_Wait(parent); return parent.status; } -// --- command.bash2html_proc.bash2html.ExecX +// --- command.atf_unit_proc.atf_unit.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::bash2html_ExecX(command::bash2html_proc& parent) { - int rc = bash2html_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",bash2html_ToCmdline(parent)) +void command::atf_unit_ExecX(command::atf_unit_proc& parent) { + int rc = atf_unit_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",atf_unit_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.bash2html_proc.bash2html.Execv +// --- command.atf_unit_proc.atf_unit.Execv // Call execv() // Call execv with specified parameters -int command::bash2html_Execv(command::bash2html_proc& parent) { +int command::atf_unit_Execv(command::atf_unit_proc& parent) { int ret = 0; algo::StringAry args; - bash2html_ToArgv(parent, args); + atf_unit_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -15707,11 +15796,11 @@ int command::bash2html_Execv(command::bash2html_proc& parent) { return ret; } -// --- command.bash2html_proc.bash2html.ToCmdline -algo::tempstr command::bash2html_ToCmdline(command::bash2html_proc& parent) { +// --- command.atf_unit_proc.atf_unit.ToCmdline +algo::tempstr command::atf_unit_ToCmdline(command::atf_unit_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::bash2html_PrintArgv(parent.cmd,retval); + command::atf_unit_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -15724,107 +15813,265 @@ algo::tempstr command::bash2html_ToCmdline(command::bash2html_proc& parent) { return retval; } -// --- command.bash2html_proc.bash2html.ToArgv +// --- command.atf_unit_proc.atf_unit.ToArgv // Form array from the command line -void command::bash2html_ToArgv(command::bash2html_proc& parent, algo::StringAry& args) { +void command::atf_unit_ToArgv(command::atf_unit_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; - if (parent.cmd.in != "data") { + if (parent.cmd.unittest.expr != "%") { cstring *arg = &ary_Alloc(args); - *arg << "-in:"; - cstring_Print(parent.cmd.in, *arg); + *arg << "-unittest:"; + command::unittest_Print(parent.cmd, *arg); } - if (parent.cmd.test != false) { + if (parent.cmd.nofork != false) { cstring *arg = &ary_Alloc(args); - *arg << "-test:"; - bool_Print(parent.cmd.test, *arg); + *arg << "-nofork:"; + bool_Print(parent.cmd.nofork, *arg); } - for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { - ary_Alloc(args) << "-verbose"; + + if (parent.cmd.arg != "") { + cstring *arg = &ary_Alloc(args); + *arg << "-arg:"; + cstring_Print(parent.cmd.arg, *arg); } -} -// --- command.bash2html_proc..Uninit -void command::bash2html_proc_Uninit(command::bash2html_proc& parent) { - command::bash2html_proc &row = parent; (void)row; + if (parent.cmd.data_dir != "data") { + cstring *arg = &ary_Alloc(args); + *arg << "-data_dir:"; + cstring_Print(parent.cmd.data_dir, *arg); + } - // command.bash2html_proc.bash2html.Uninit (Exec) // - bash2html_Kill(parent); // kill child, ensure forward progress -} + if (parent.cmd.mdbg != 0) { + cstring *arg = &ary_Alloc(args); + *arg << "-mdbg:"; + bool_Print(parent.cmd.mdbg, *arg); + } -// --- command.bash_proc.bash.Start -// Start subprocess -// If subprocess already running, do nothing. Otherwise, start it -int command::bash_Start(command::bash_proc& parent) { - int retval = 0; - if (parent.pid == 0) { - verblog(bash_ToCmdline(parent)); // maybe print command -#ifdef WIN32 - algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(bash_ToCmdline(parent)); - parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); -#else - parent.pid = fork(); - if (parent.pid == 0) { // child - algo_lib::DieWithParent(); - if (parent.timeout > 0) { - alarm(parent.timeout); - } - if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); - if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); - if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= bash_Execv(parent); - if (retval != 0) { // if start fails, print error - int err=errno; - prerr("command.bash_execv" - < 0 ? 0 : -1; // if didn't start, set error status - return retval; -} -// --- command.bash_proc.bash.StartRead -// Start subprocess & Read output -algo::Fildes command::bash_StartRead(command::bash_proc& parent, algo_lib::FFildes &read) { - int pipefd[2]; - int rc=pipe(pipefd); - (void)rc; - read.fd.value = pipefd[0]; - parent.fstdout << ">&" << pipefd[1]; - bash_Start(parent); - (void)close(pipefd[1]); - return read.fd; -} + if (parent.cmd.pertest_timeout != 900) { + cstring *arg = &ary_Alloc(args); + *arg << "-pertest_timeout:"; + u32_Print(parent.cmd.pertest_timeout, *arg); + } -// --- command.bash_proc.bash.Kill -// Kill subprocess and wait -void command::bash_Kill(command::bash_proc& parent) { - if (parent.pid != 0) { - kill(parent.pid,9); - bash_Wait(parent); + if (parent.cmd.report != true) { + cstring *arg = &ary_Alloc(args); + *arg << "-report:"; + bool_Print(parent.cmd.report, *arg); } -} -// --- command.bash_proc.bash.Wait -// Wait for subprocess to return -void command::bash_Wait(command::bash_proc& parent) { - if (parent.pid > 0) { - int wait_flags = 0; - int wait_status = 0; - int rc = -1; - do { - // really wait for subprocess to exit - rc = waitpid(parent.pid,&wait_status,wait_flags); + if (parent.cmd.capture != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-capture:"; + bool_Print(parent.cmd.capture, *arg); + } + + if (parent.cmd.check_untracked != true) { + cstring *arg = &ary_Alloc(args); + *arg << "-check_untracked:"; + bool_Print(parent.cmd.check_untracked, *arg); + } + for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { + ary_Alloc(args) << "-verbose"; + } +} + +// --- command.atf_unit_proc..Uninit +void command::atf_unit_proc_Uninit(command::atf_unit_proc& parent) { + command::atf_unit_proc &row = parent; (void)row; + + // command.atf_unit_proc.atf_unit.Uninit (Exec) // + atf_unit_Kill(parent); // kill child, ensure forward progress +} + +// --- command.bash..PrintArgv +// print string representation of ROW to string STR +// cfmt:command.bash.ArgvGnu printfmt:Auto +void command::bash_PrintArgv(command::bash& row, algo::cstring& str) { + algo::tempstr temp; + (void)temp; + (void)str; + if (!(row.c == "")) { + ch_RemoveAll(temp); + cstring_Print(row.c, temp); + str << " -c "; + strptr_PrintBash(temp,str); + } +} + +// --- command.bash2html..ReadFieldMaybe +bool command::bash2html_ReadFieldMaybe(command::bash2html& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + command::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case command_FieldId_in: { + retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); + } break; + case command_FieldId_test: { + retval = bool_ReadStrptrMaybe(parent.test, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- command.bash2html..ReadTupleMaybe +// Read fields of command::bash2html from attributes of ascii tuple TUPLE +bool command::bash2html_ReadTupleMaybe(command::bash2html &parent, algo::Tuple &tuple) { + bool retval = true; + ind_beg(algo::Tuple_attrs_curs,attr,tuple) { + retval = bash2html_ReadFieldMaybe(parent, attr.name, attr.value); + if (!retval) { + break; + } + }ind_end; + return retval; +} + +// --- command.bash2html..ToCmdline +// Convenience function that returns a full command line +// Assume command is in a directory called bin +tempstr command::bash2html_ToCmdline(command::bash2html& row) { + tempstr ret; + ret << "bin/bash2html "; + bash2html_PrintArgv(row, ret); + // inherit less intense verbose, debug options + for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { + ret << " -verbose"; + } + for (int i = 1; i < algo_lib::_db.cmdline.debug; i++) { + ret << " -debug"; + } + return ret; +} + +// --- command.bash2html..PrintArgv +// print string representation of ROW to string STR +// cfmt:command.bash2html.Argv printfmt:Tuple +void command::bash2html_PrintArgv(command::bash2html& row, algo::cstring& str) { + algo::tempstr temp; + (void)temp; + (void)str; + if (!(row.in == "data")) { + ch_RemoveAll(temp); + cstring_Print(row.in, temp); + str << " -in:"; + strptr_PrintBash(temp,str); + } + if (!(row.test == false)) { + ch_RemoveAll(temp); + bool_Print(row.test, temp); + str << " -test:"; + strptr_PrintBash(temp,str); + } +} + +// --- command.bash2html..NArgs +// Used with command lines +// Return # of command-line arguments that must follow this argument +// If FIELD is invalid, return -1 +i32 command::bash2html_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { + i32 retval = 1; + switch (field) { + case command_FieldId_in: { // + *out_anon = false; + } break; + case command_FieldId_test: { // bool: no argument required but value may be specified as test:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + default: + retval=-1; // unrecognized + } + return retval; +} + +// --- command.bash2html_proc.bash2html.Start +// Start subprocess +// If subprocess already running, do nothing. Otherwise, start it +int command::bash2html_Start(command::bash2html_proc& parent) { + int retval = 0; + if (parent.pid == 0) { + verblog(bash2html_ToCmdline(parent)); // maybe print command +#ifdef WIN32 + algo_lib::ResolveExecFname(parent.path); + tempstr cmdline(bash2html_ToCmdline(parent)); + parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); +#else + parent.pid = fork(); + if (parent.pid == 0) { // child + algo_lib::DieWithParent(); + if (parent.timeout > 0) { + alarm(parent.timeout); + } + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); + if (retval==0) retval= bash2html_Execv(parent); + if (retval != 0) { // if start fails, print error + int err=errno; + prerr("command.bash2html_execv" + < 0 ? 0 : -1; // if didn't start, set error status + return retval; +} + +// --- command.bash2html_proc.bash2html.StartRead +// Start subprocess & Read output +algo::Fildes command::bash2html_StartRead(command::bash2html_proc& parent, algo_lib::FFildes &read) { + int pipefd[2]; + int rc=pipe(pipefd); + (void)rc; + read.fd.value = pipefd[0]; + parent.fstdout << ">&" << pipefd[1]; + bash2html_Start(parent); + (void)close(pipefd[1]); + return read.fd; +} + +// --- command.bash2html_proc.bash2html.Kill +// Kill subprocess and wait +void command::bash2html_Kill(command::bash2html_proc& parent) { + if (parent.pid > 0) { + kill(parent.pid,9); + bash2html_Wait(parent); + } +} + +// --- command.bash2html_proc.bash2html.Wait +// Wait for subprocess to return +void command::bash2html_Wait(command::bash2html_proc& parent) { + if (parent.pid > 0) { + int wait_flags = 0; + int wait_status = 0; + int rc = -1; + do { + // really wait for subprocess to exit + rc = waitpid(parent.pid,&wait_status,wait_flags); } while (rc==-1 && errno==EINTR); if (rc == parent.pid) { parent.status = wait_status; @@ -15833,31 +16080,31 @@ void command::bash_Wait(command::bash_proc& parent) { } } -// --- command.bash_proc.bash.Exec +// --- command.bash2html_proc.bash2html.Exec // Start + Wait // Execute subprocess and return exit code -int command::bash_Exec(command::bash_proc& parent) { - bash_Start(parent); - bash_Wait(parent); +int command::bash2html_Exec(command::bash2html_proc& parent) { + bash2html_Start(parent); + bash2html_Wait(parent); return parent.status; } -// --- command.bash_proc.bash.ExecX +// --- command.bash2html_proc.bash2html.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::bash_ExecX(command::bash_proc& parent) { - int rc = bash_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",bash_ToCmdline(parent)) +void command::bash2html_ExecX(command::bash2html_proc& parent) { + int rc = bash2html_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",bash2html_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.bash_proc.bash.Execv +// --- command.bash2html_proc.bash2html.Execv // Call execv() // Call execv with specified parameters -int command::bash_Execv(command::bash_proc& parent) { +int command::bash2html_Execv(command::bash2html_proc& parent) { int ret = 0; algo::StringAry args; - bash_ToArgv(parent, args); + bash2html_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -15869,11 +16116,11 @@ int command::bash_Execv(command::bash_proc& parent) { return ret; } -// --- command.bash_proc.bash.ToCmdline -algo::tempstr command::bash_ToCmdline(command::bash_proc& parent) { +// --- command.bash2html_proc.bash2html.ToCmdline +algo::tempstr command::bash2html_ToCmdline(command::bash2html_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::bash_PrintArgv(parent.cmd,retval); + command::bash2html_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -15886,30 +16133,192 @@ algo::tempstr command::bash_ToCmdline(command::bash_proc& parent) { return retval; } -// --- command.bash_proc.bash.ToArgv +// --- command.bash2html_proc.bash2html.ToArgv // Form array from the command line -void command::bash_ToArgv(command::bash_proc& parent, algo::StringAry& args) { +void command::bash2html_ToArgv(command::bash2html_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; - if (parent.cmd.c != "") { - ary_Alloc(args) << "-c"; + if (parent.cmd.in != "data") { cstring *arg = &ary_Alloc(args); - cstring_Print(parent.cmd.c, *arg); + *arg << "-in:"; + cstring_Print(parent.cmd.in, *arg); } -} - -// --- command.bash_proc..Uninit -void command::bash_proc_Uninit(command::bash_proc& parent) { - command::bash_proc &row = parent; (void)row; - // command.bash_proc.bash.Uninit (Exec) //Must be bash to support $'' for string quoting - bash_Kill(parent); // kill child, ensure forward progress + if (parent.cmd.test != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-test:"; + bool_Print(parent.cmd.test, *arg); + } + for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { + ary_Alloc(args) << "-verbose"; + } } -// --- command.gcache.cmd.Addary -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. +// --- command.bash2html_proc..Uninit +void command::bash2html_proc_Uninit(command::bash2html_proc& parent) { + command::bash2html_proc &row = parent; (void)row; + + // command.bash2html_proc.bash2html.Uninit (Exec) // + bash2html_Kill(parent); // kill child, ensure forward progress +} + +// --- command.bash_proc.bash.Start +// Start subprocess +// If subprocess already running, do nothing. Otherwise, start it +int command::bash_Start(command::bash_proc& parent) { + int retval = 0; + if (parent.pid == 0) { + verblog(bash_ToCmdline(parent)); // maybe print command +#ifdef WIN32 + algo_lib::ResolveExecFname(parent.path); + tempstr cmdline(bash_ToCmdline(parent)); + parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); +#else + parent.pid = fork(); + if (parent.pid == 0) { // child + algo_lib::DieWithParent(); + if (parent.timeout > 0) { + alarm(parent.timeout); + } + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); + if (retval==0) retval= bash_Execv(parent); + if (retval != 0) { // if start fails, print error + int err=errno; + prerr("command.bash_execv" + < 0 ? 0 : -1; // if didn't start, set error status + return retval; +} + +// --- command.bash_proc.bash.StartRead +// Start subprocess & Read output +algo::Fildes command::bash_StartRead(command::bash_proc& parent, algo_lib::FFildes &read) { + int pipefd[2]; + int rc=pipe(pipefd); + (void)rc; + read.fd.value = pipefd[0]; + parent.fstdout << ">&" << pipefd[1]; + bash_Start(parent); + (void)close(pipefd[1]); + return read.fd; +} + +// --- command.bash_proc.bash.Kill +// Kill subprocess and wait +void command::bash_Kill(command::bash_proc& parent) { + if (parent.pid > 0) { + kill(parent.pid,9); + bash_Wait(parent); + } +} + +// --- command.bash_proc.bash.Wait +// Wait for subprocess to return +void command::bash_Wait(command::bash_proc& parent) { + if (parent.pid > 0) { + int wait_flags = 0; + int wait_status = 0; + int rc = -1; + do { + // really wait for subprocess to exit + rc = waitpid(parent.pid,&wait_status,wait_flags); + } while (rc==-1 && errno==EINTR); + if (rc == parent.pid) { + parent.status = wait_status; + parent.pid = 0; + } + } +} + +// --- command.bash_proc.bash.Exec +// Start + Wait +// Execute subprocess and return exit code +int command::bash_Exec(command::bash_proc& parent) { + bash_Start(parent); + bash_Wait(parent); + return parent.status; +} + +// --- command.bash_proc.bash.ExecX +// Start + Wait, throw exception on error +// Execute subprocess; throw human-readable exception on error +void command::bash_ExecX(command::bash_proc& parent) { + int rc = bash_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",bash_ToCmdline(parent)) + << Keyval("comment",algo::DescribeWaitStatus(parent.status))); +} + +// --- command.bash_proc.bash.Execv +// Call execv() +// Call execv with specified parameters +int command::bash_Execv(command::bash_proc& parent) { + int ret = 0; + algo::StringAry args; + bash_ToArgv(parent, args); + char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); + ind_beg(algo::StringAry_ary_curs,arg,args) { + argv[ind_curs(arg).index] = Zeroterm(arg); + }ind_end; + argv[ary_N(args)] = NULL; + // if parent.path is relative, search for it in PATH + algo_lib::ResolveExecFname(parent.path); + ret = execv(Zeroterm(parent.path),argv); + return ret; +} + +// --- command.bash_proc.bash.ToCmdline +algo::tempstr command::bash_ToCmdline(command::bash_proc& parent) { + algo::tempstr retval; + retval << parent.path << " "; + command::bash_PrintArgv(parent.cmd,retval); + if (ch_N(parent.fstdin)) { + retval << " " << parent.fstdin; + } + if (ch_N(parent.fstdout)) { + retval << " " << parent.fstdout; + } + if (ch_N(parent.fstderr)) { + retval << " 2" << parent.fstderr; + } + return retval; +} + +// --- command.bash_proc.bash.ToArgv +// Form array from the command line +void command::bash_ToArgv(command::bash_proc& parent, algo::StringAry& args) { + ary_RemoveAll(args); + ary_Alloc(args) << parent.path; + + if (parent.cmd.c != "") { + ary_Alloc(args) << "-c"; + cstring *arg = &ary_Alloc(args); + cstring_Print(parent.cmd.c, *arg); + } +} + +// --- command.bash_proc..Uninit +void command::bash_proc_Uninit(command::bash_proc& parent) { + command::bash_proc &row = parent; (void)row; + + // command.bash_proc.bash.Uninit (Exec) //Must be bash to support $'' for string quoting + bash_Kill(parent); // kill child, ensure forward progress +} + +// --- command.gcache.cmd.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. // If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. algo::aryptr command::cmd_Addary(command::gcache& parent, algo::aryptr rhs) { bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.cmd_elems && rhs.elems < parent.cmd_elems + parent.cmd_max; @@ -15969,6 +16378,25 @@ algo::aryptr command::cmd_AllocN(command::gcache& parent, int n_e return algo::aryptr(elems + old_n, n_elems); } +// --- command.gcache.cmd.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::cmd_AllocNAt(command::gcache& parent, int n_elems, int at) { + cmd_Reserve(parent, n_elems); + int n = parent.cmd_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.gcache.cmd comment:'index out of range'"); + } + algo::cstring *elems = parent.cmd_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.cmd_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- command.gcache.cmd.Remove // Remove item by index. If index outside of range, do nothing. void command::cmd_Remove(command::gcache& parent, u32 i) { @@ -16065,6 +16493,30 @@ bool command::cmd_ReadStrptrMaybe(command::gcache& parent, algo::strptr in_str) return retval; } +// --- command.gcache.cmd.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::cmd_Insary(command::gcache& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.cmd_elems && rhs.elems < parent.cmd_elems + parent.cmd_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.gcache.cmd comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.cmd_elems+1))) { + FatalErrorExit("command.bad_insary field:command.gcache.cmd comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.cmd_n - at; + cmd_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.cmd_elems + at + nnew + i) algo::cstring(parent.cmd_elems[at + i]); + parent.cmd_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.cmd_elems + at + i) algo::cstring(rhs[i]); + } + parent.cmd_n += nnew; +} + // --- command.gcache..ReadFieldMaybe bool command::gcache_ReadFieldMaybe(command::gcache& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -16073,57 +16525,47 @@ bool command::gcache_ReadFieldMaybe(command::gcache& parent, algo::strptr field, switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_cmd: { retval = cmd_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_install: { retval = bool_ReadStrptrMaybe(parent.install, strval); - break; - } + } break; case command_FieldId_stats: { retval = bool_ReadStrptrMaybe(parent.stats, strval); - break; - } + } break; case command_FieldId_enable: { retval = bool_ReadStrptrMaybe(parent.enable, strval); - break; - } + } break; case command_FieldId_disable: { retval = bool_ReadStrptrMaybe(parent.disable, strval); - break; - } + } break; case command_FieldId_gc: { retval = bool_ReadStrptrMaybe(parent.gc, strval); - break; - } + } break; case command_FieldId_clean: { retval = bool_ReadStrptrMaybe(parent.clean, strval); - break; - } + } break; case command_FieldId_dir: { retval = algo::cstring_ReadStrptrMaybe(parent.dir, strval); - break; - } + } break; case command_FieldId_hitrate: { retval = bool_ReadStrptrMaybe(parent.hitrate, strval); - break; - } + } break; case command_FieldId_after: { retval = algo::UnTime_ReadStrptrMaybe(parent.after, strval); - break; - } + } break; case command_FieldId_report: { retval = bool_ReadStrptrMaybe(parent.report, strval); - break; - } + } break; case command_FieldId_force: { retval = bool_ReadStrptrMaybe(parent.force, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -16349,59 +16791,59 @@ algo::strptr command::gcache_GetAnon(command::gcache &parent, i32 idx) { i32 command::gcache_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_cmd: { // $comment + case command_FieldId_cmd: { // *out_anon = true; } break; - case command_FieldId_install: { // $comment + case command_FieldId_install: { // bool: no argument required but value may be specified as install:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_stats: { // bool: no argument required but value may be specified as install:Y + case command_FieldId_stats: { // bool: no argument required but value may be specified as stats:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_enable: { // bool: no argument required but value may be specified as stats:Y + case command_FieldId_enable: { // bool: no argument required but value may be specified as enable:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_disable: { // bool: no argument required but value may be specified as enable:Y + case command_FieldId_disable: { // bool: no argument required but value may be specified as disable:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_gc: { // bool: no argument required but value may be specified as disable:Y + case command_FieldId_gc: { // bool: no argument required but value may be specified as gc:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_clean: { // bool: no argument required but value may be specified as gc:Y + case command_FieldId_clean: { // bool: no argument required but value may be specified as clean:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_dir: { // bool: no argument required but value may be specified as clean:Y + case command_FieldId_dir: { // *out_anon = false; } break; - case command_FieldId_hitrate: { // bool: no argument required but value may be specified as clean:Y + case command_FieldId_hitrate: { // bool: no argument required but value may be specified as hitrate:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_after: { // bool: no argument required but value may be specified as hitrate:Y + case command_FieldId_after: { // *out_anon = false; } break; - case command_FieldId_report: { // bool: no argument required but value may be specified as hitrate:Y + case command_FieldId_report: { // bool: no argument required but value may be specified as report:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_force: { // bool: no argument required but value may be specified as report:Y + case command_FieldId_force: { // bool: no argument required but value may be specified as force:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -16506,7 +16948,7 @@ algo::Fildes command::gcache_StartRead(command::gcache_proc& parent, algo_lib::F // --- command.gcache_proc.gcache.Kill // Kill subprocess and wait void command::gcache_Kill(command::gcache_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); gcache_Wait(parent); } @@ -16740,6 +17182,25 @@ algo::aryptr command::fields_AllocN(command::gcli& parent, int n_ return algo::aryptr(elems + old_n, n_elems); } +// --- command.gcli.fields.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::fields_AllocNAt(command::gcli& parent, int n_elems, int at) { + fields_Reserve(parent, n_elems); + int n = parent.fields_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.gcli.fields comment:'index out of range'"); + } + algo::cstring *elems = parent.fields_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(""); // construct new element, default initialize + } + parent.fields_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- command.gcli.fields.Remove // Remove item by index. If index outside of range, do nothing. void command::fields_Remove(command::gcli& parent, u32 i) { @@ -16836,6 +17297,30 @@ bool command::fields_ReadStrptrMaybe(command::gcli& parent, algo::strptr in_str) return retval; } +// --- command.gcli.fields.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::fields_Insary(command::gcli& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.fields_elems && rhs.elems < parent.fields_elems + parent.fields_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.gcli.fields comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.fields_elems+1))) { + FatalErrorExit("command.bad_insary field:command.gcli.fields comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.fields_n - at; + fields_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.fields_elems + at + nnew + i) algo::cstring(parent.fields_elems[at + i]); + parent.fields_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.fields_elems + at + i) algo::cstring(rhs[i]); + } + parent.fields_n += nnew; +} + // --- command.gcli..ReadFieldMaybe bool command::gcli_ReadFieldMaybe(command::gcli& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -16844,73 +17329,59 @@ bool command::gcli_ReadFieldMaybe(command::gcli& parent, algo::strptr field, alg switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_selector: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.selector, strval); - break; - } + } break; case command_FieldId_fields: { retval = fields_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_accept: { retval = bool_ReadStrptrMaybe(parent.accept, strval); - break; - } + } break; case command_FieldId_start: { retval = bool_ReadStrptrMaybe(parent.start, strval); - break; - } + } break; case command_FieldId_list: { retval = bool_ReadStrptrMaybe(parent.list, strval); - break; - } + } break; case command_FieldId_create: { retval = bool_ReadStrptrMaybe(parent.create, strval); - break; - } + } break; case command_FieldId_update: { retval = bool_ReadStrptrMaybe(parent.update, strval); - break; - } + } break; case command_FieldId_approve: { retval = bool_ReadStrptrMaybe(parent.approve, strval); - break; - } + } break; case command_FieldId_needs_work: { retval = bool_ReadStrptrMaybe(parent.needs_work, strval); - break; - } + } break; case command_FieldId_stop: { retval = bool_ReadStrptrMaybe(parent.stop, strval); - break; - } + } break; case command_FieldId_t: { retval = bool_ReadStrptrMaybe(parent.t, strval); - break; - } + } break; case command_FieldId_e: { retval = bool_ReadStrptrMaybe(parent.e, strval); - break; - } + } break; case command_FieldId_authdir: { retval = algo::cstring_ReadStrptrMaybe(parent.authdir, strval); - break; - } + } break; case command_FieldId_dry_run: { retval = bool_ReadStrptrMaybe(parent.dry_run, strval); - break; - } + } break; case command_FieldId_gitdir: { retval = algo::cstring_ReadStrptrMaybe(parent.gitdir, strval); - break; - } + } break; case command_FieldId_show_gitlab_system_notes: { retval = bool_ReadStrptrMaybe(parent.show_gitlab_system_notes, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -17112,77 +17583,77 @@ algo::strptr command::gcli_GetAnon(command::gcli &parent, i32 idx) { i32 command::gcli_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_selector: { // $comment + case command_FieldId_selector: { // *out_anon = true; } break; - case command_FieldId_fields: { // $comment + case command_FieldId_fields: { // *out_anon = true; } break; - case command_FieldId_accept: { // $comment + case command_FieldId_accept: { // bool: no argument required but value may be specified as accept:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_start: { // bool: no argument required but value may be specified as accept:Y + case command_FieldId_start: { // bool: no argument required but value may be specified as start:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_list: { // bool: no argument required but value may be specified as start:Y + case command_FieldId_list: { // bool: no argument required but value may be specified as list:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_create: { // bool: no argument required but value may be specified as list:Y + case command_FieldId_create: { // bool: no argument required but value may be specified as create:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_update: { // bool: no argument required but value may be specified as create:Y + case command_FieldId_update: { // bool: no argument required but value may be specified as update:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_approve: { // bool: no argument required but value may be specified as update:Y + case command_FieldId_approve: { // bool: no argument required but value may be specified as approve:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_needs_work: { // bool: no argument required but value may be specified as approve:Y + case command_FieldId_needs_work: { // bool: no argument required but value may be specified as needs_work:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_stop: { // bool: no argument required but value may be specified as needs_work:Y + case command_FieldId_stop: { // bool: no argument required but value may be specified as stop:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_t: { // bool: no argument required but value may be specified as stop:Y + case command_FieldId_t: { // bool: no argument required but value may be specified as t:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_e: { // bool: no argument required but value may be specified as t:Y + case command_FieldId_e: { // bool: no argument required but value may be specified as e:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_authdir: { // bool: no argument required but value may be specified as e:Y + case command_FieldId_authdir: { // *out_anon = false; } break; - case command_FieldId_dry_run: { // bool: no argument required but value may be specified as e:Y + case command_FieldId_dry_run: { // bool: no argument required but value may be specified as dry_run:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_gitdir: { // bool: no argument required but value may be specified as dry_run:Y + case command_FieldId_gitdir: { // *out_anon = false; } break; - case command_FieldId_show_gitlab_system_notes: { // bool: no argument required but value may be specified as dry_run:Y + case command_FieldId_show_gitlab_system_notes: { // bool: no argument required but value may be specified as show_gitlab_system_notes:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -17295,7 +17766,7 @@ algo::Fildes command::gcli_StartRead(command::gcli_proc& parent, algo_lib::FFild // --- command.gcli_proc.gcli.Kill // Kill subprocess and wait void command::gcli_Kill(command::gcli_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); gcli_Wait(parent); } @@ -17491,389 +17962,1916 @@ void command::gcli_proc_Uninit(command::gcli_proc& parent) { gcli_Kill(parent); // kill child, ensure forward progress } -// --- command.mdbg.args.Addary +// --- command.generic..PrintArgv +// print string representation of ROW to string STR +// cfmt:command.generic.ArgvGnu printfmt:Auto +void command::generic_PrintArgv(command::generic& row, algo::cstring& str) { + algo::tempstr temp; + (void)temp; + (void)str; + (void)row;//only to avoid -Wunused-parameter +} + +// --- command.generic_proc.name.Start +// Start subprocess +// If subprocess already running, do nothing. Otherwise, start it +int command::name_Start(command::generic_proc& parent) { + int retval = 0; + if (parent.pid == 0) { + verblog(name_ToCmdline(parent)); // maybe print command +#ifdef WIN32 + algo_lib::ResolveExecFname(parent.path); + tempstr cmdline(name_ToCmdline(parent)); + parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); +#else + parent.pid = fork(); + if (parent.pid == 0) { // child + algo_lib::DieWithParent(); + if (parent.timeout > 0) { + alarm(parent.timeout); + } + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); + if (retval==0) retval= name_Execv(parent); + if (retval != 0) { // if start fails, print error + int err=errno; + prerr("command.name_execv" + < 0 ? 0 : -1; // if didn't start, set error status + return retval; +} + +// --- command.generic_proc.name.StartRead +// Start subprocess & Read output +algo::Fildes command::name_StartRead(command::generic_proc& parent, algo_lib::FFildes &read) { + int pipefd[2]; + int rc=pipe(pipefd); + (void)rc; + read.fd.value = pipefd[0]; + parent.fstdout << ">&" << pipefd[1]; + name_Start(parent); + (void)close(pipefd[1]); + return read.fd; +} + +// --- command.generic_proc.name.Kill +// Kill subprocess and wait +void command::name_Kill(command::generic_proc& parent) { + if (parent.pid > 0) { + kill(parent.pid,9); + name_Wait(parent); + } +} + +// --- command.generic_proc.name.Wait +// Wait for subprocess to return +void command::name_Wait(command::generic_proc& parent) { + if (parent.pid > 0) { + int wait_flags = 0; + int wait_status = 0; + int rc = -1; + do { + // really wait for subprocess to exit + rc = waitpid(parent.pid,&wait_status,wait_flags); + } while (rc==-1 && errno==EINTR); + if (rc == parent.pid) { + parent.status = wait_status; + parent.pid = 0; + } + } +} + +// --- command.generic_proc.name.Exec +// Start + Wait +// Execute subprocess and return exit code +int command::name_Exec(command::generic_proc& parent) { + name_Start(parent); + name_Wait(parent); + return parent.status; +} + +// --- command.generic_proc.name.ExecX +// Start + Wait, throw exception on error +// Execute subprocess; throw human-readable exception on error +void command::name_ExecX(command::generic_proc& parent) { + int rc = name_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",name_ToCmdline(parent)) + << Keyval("comment",algo::DescribeWaitStatus(parent.status))); +} + +// --- command.generic_proc.name.Execv +// Call execv() +// Call execv with specified parameters +int command::name_Execv(command::generic_proc& parent) { + int ret = 0; + algo::StringAry args; + name_ToArgv(parent, args); + char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); + ind_beg(algo::StringAry_ary_curs,arg,args) { + argv[ind_curs(arg).index] = Zeroterm(arg); + }ind_end; + argv[ary_N(args)] = NULL; + // if parent.path is relative, search for it in PATH + algo_lib::ResolveExecFname(parent.path); + ret = execv(Zeroterm(parent.path),argv); + return ret; +} + +// --- command.generic_proc.name.ToCmdline +algo::tempstr command::name_ToCmdline(command::generic_proc& parent) { + algo::tempstr retval; + retval << parent.path << " "; + command::generic_PrintArgv(parent.cmd,retval); + if (ch_N(parent.fstdin)) { + retval << " " << parent.fstdin; + } + if (ch_N(parent.fstdout)) { + retval << " " << parent.fstdout; + } + if (ch_N(parent.fstderr)) { + retval << " 2" << parent.fstderr; + } + return retval; +} + +// --- command.generic_proc.name.ToArgv +// Form array from the command line +void command::name_ToArgv(command::generic_proc& parent, algo::StringAry& args) { + ary_RemoveAll(args); + ary_Alloc(args) << parent.path; +} + +// --- command.generic_proc..Uninit +void command::generic_proc_Uninit(command::generic_proc& parent) { + command::generic_proc &row = parent; (void)row; + + // command.generic_proc.name.Uninit (Exec) // + name_Kill(parent); // kill child, ensure forward progress +} + +// --- command.jkv.kv.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. // If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -algo::aryptr command::args_Addary(command::mdbg& parent, algo::aryptr rhs) { - bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.args_elems && rhs.elems < parent.args_elems + parent.args_max; +algo::aryptr command::kv_Addary(command::jkv& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.kv_elems && rhs.elems < parent.kv_elems + parent.kv_max; if (UNLIKELY(overlaps)) { - FatalErrorExit("command.tary_alias field:command.mdbg.args comment:'alias error: sub-array is being appended to the whole'"); + FatalErrorExit("command.tary_alias field:command.jkv.kv comment:'alias error: sub-array is being appended to the whole'"); } int nnew = rhs.n_elems; - args_Reserve(parent, nnew); // reserve space - int at = parent.args_n; + kv_Reserve(parent, nnew); // reserve space + int at = parent.kv_n; for (int i = 0; i < nnew; i++) { - new (parent.args_elems + at + i) algo::cstring(rhs[i]); - parent.args_n++; + new (parent.kv_elems + at + i) algo::cstring(rhs[i]); + parent.kv_n++; + } + return algo::aryptr(parent.kv_elems + at, nnew); +} + +// --- command.jkv.kv.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +algo::cstring& command::kv_Alloc(command::jkv& parent) { + kv_Reserve(parent, 1); + int n = parent.kv_n; + int at = n; + algo::cstring *elems = parent.kv_elems; + new (elems + at) algo::cstring(); // construct new element, default initializer + parent.kv_n = n+1; + return elems[at]; +} + +// --- command.jkv.kv.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::cstring& command::kv_AllocAt(command::jkv& parent, int at) { + kv_Reserve(parent, 1); + int n = parent.kv_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("command.bad_alloc_at field:command.jkv.kv comment:'index out of range'"); + } + algo::cstring *elems = parent.kv_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(algo::cstring)); + new (elems + at) algo::cstring(); // construct element, default initializer + parent.kv_n = n+1; + return elems[at]; +} + +// --- command.jkv.kv.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr command::kv_AllocN(command::jkv& parent, int n_elems) { + kv_Reserve(parent, n_elems); + int old_n = parent.kv_n; + int new_n = old_n + n_elems; + algo::cstring *elems = parent.kv_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo::cstring(); // construct new element, default initialize + } + parent.kv_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- command.jkv.kv.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::kv_AllocNAt(command::jkv& parent, int n_elems, int at) { + kv_Reserve(parent, n_elems); + int n = parent.kv_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.jkv.kv comment:'index out of range'"); + } + algo::cstring *elems = parent.kv_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.kv_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- command.jkv.kv.Remove +// Remove item by index. If index outside of range, do nothing. +void command::kv_Remove(command::jkv& parent, u32 i) { + u32 lim = parent.kv_n; + algo::cstring *elems = parent.kv_elems; + if (i < lim) { + elems[i].~cstring(); // destroy element + memmove(elems + i, elems + (i + 1), sizeof(algo::cstring) * (lim - (i + 1))); + parent.kv_n = lim - 1; + } +} + +// --- command.jkv.kv.RemoveAll +void command::kv_RemoveAll(command::jkv& parent) { + u32 n = parent.kv_n; + while (n > 0) { + n -= 1; + parent.kv_elems[n].~cstring(); + parent.kv_n = n; + } +} + +// --- command.jkv.kv.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void command::kv_RemoveLast(command::jkv& parent) { + u64 n = parent.kv_n; + if (n > 0) { + n -= 1; + kv_qFind(parent, u64(n)).~cstring(); + parent.kv_n = n; + } +} + +// --- command.jkv.kv.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void command::kv_AbsReserve(command::jkv& parent, int n) { + u32 old_max = parent.kv_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.kv_elems, old_max * sizeof(algo::cstring), new_max * sizeof(algo::cstring)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("command.tary_nomem field:command.jkv.kv comment:'out of memory'"); + } + parent.kv_elems = (algo::cstring*)new_mem; + parent.kv_max = new_max; + } +} + +// --- command.jkv.kv.Setary +// Copy contents of RHS to PARENT. +void command::kv_Setary(command::jkv& parent, command::jkv &rhs) { + kv_RemoveAll(parent); + int nnew = rhs.kv_n; + kv_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.kv_elems + i) algo::cstring(kv_qFind(rhs, i)); + parent.kv_n = i + 1; + } +} + +// --- command.jkv.kv.Setary2 +// Copy specified array into kv, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void command::kv_Setary(command::jkv& parent, const algo::aryptr &rhs) { + kv_RemoveAll(parent); + kv_Addary(parent, rhs); +} + +// --- command.jkv.kv.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr command::kv_AllocNVal(command::jkv& parent, int n_elems, const algo::cstring& val) { + kv_Reserve(parent, n_elems); + int old_n = parent.kv_n; + int new_n = old_n + n_elems; + algo::cstring *elems = parent.kv_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo::cstring(val); + } + parent.kv_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- command.jkv.kv.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool command::kv_ReadStrptrMaybe(command::jkv& parent, algo::strptr in_str) { + bool retval = true; + algo::cstring &elem = kv_Alloc(parent); + retval = algo::cstring_ReadStrptrMaybe(elem, in_str); + if (!retval) { + kv_RemoveLast(parent); + } + return retval; +} + +// --- command.jkv.kv.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::kv_Insary(command::jkv& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.kv_elems && rhs.elems < parent.kv_elems + parent.kv_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.jkv.kv comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.kv_elems+1))) { + FatalErrorExit("command.bad_insary field:command.jkv.kv comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.kv_n - at; + kv_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.kv_elems + at + nnew + i) algo::cstring(parent.kv_elems[at + i]); + parent.kv_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.kv_elems + at + i) algo::cstring(rhs[i]); + } + parent.kv_n += nnew; +} + +// --- command.jkv.output.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* command::output_ToCstr(const command::jkv& parent) { + const char *ret = NULL; + switch(output_GetEnum(parent)) { + case command_jkv_output_auto : ret = "auto"; break; + case command_jkv_output_json : ret = "json"; break; + case command_jkv_output_kv : ret = "kv"; break; + } + return ret; +} + +// --- command.jkv.output.Print +// Convert output to a string. First, attempt conversion to a known string. +// If no string matches, print output as a numeric value. +void command::output_Print(const command::jkv& parent, algo::cstring &lhs) { + const char *strval = output_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.output; + } +} + +// --- command.jkv.output.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool command::output_SetStrptrMaybe(command::jkv& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 2: { + switch (u64(algo::ReadLE16(rhs.elems))) { + case LE_STR2('k','v'): { + output_SetEnum(parent,command_jkv_output_kv); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('a','u','t','o'): { + output_SetEnum(parent,command_jkv_output_auto); ret = true; break; + } + case LE_STR4('j','s','o','n'): { + output_SetEnum(parent,command_jkv_output_json); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- command.jkv.output.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void command::output_SetStrptr(command::jkv& parent, algo::strptr rhs, command_jkv_output_Enum dflt) { + if (!output_SetStrptrMaybe(parent,rhs)) output_SetEnum(parent,dflt); +} + +// --- command.jkv.output.ReadStrptrMaybe +// Convert string to field. Return success value +bool command::output_ReadStrptrMaybe(command::jkv& parent, algo::strptr rhs) { + bool retval = false; + retval = output_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.output,rhs); + } + return retval; +} + +// --- command.jkv..ReadFieldMaybe +bool command::jkv_ReadFieldMaybe(command::jkv& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + command::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case command_FieldId_in: { + retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); + } break; + case command_FieldId_file: { + retval = algo::cstring_ReadStrptrMaybe(parent.file, strval); + } break; + case command_FieldId_kv: { + retval = kv_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_r: { + retval = bool_ReadStrptrMaybe(parent.r, strval); + } break; + case command_FieldId_write: { + retval = bool_ReadStrptrMaybe(parent.write, strval); + } break; + case command_FieldId_output: { + retval = output_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_pretty: { + retval = u32_ReadStrptrMaybe(parent.pretty, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- command.jkv..ReadTupleMaybe +// Read fields of command::jkv from attributes of ascii tuple TUPLE +bool command::jkv_ReadTupleMaybe(command::jkv &parent, algo::Tuple &tuple) { + bool retval = true; + int anon_idx = 0; + ind_beg(algo::Tuple_attrs_curs,attr,tuple) { + if (ch_N(attr.name) == 0) { + attr.name = jkv_GetAnon(parent, anon_idx++); + } + retval = jkv_ReadFieldMaybe(parent, attr.name, attr.value); + if (!retval) { + break; + } + }ind_end; + return retval; +} + +// --- command.jkv..Uninit +void command::jkv_Uninit(command::jkv& parent) { + command::jkv &row = parent; (void)row; + + // command.jkv.kv.Uninit (Tary) //JSON Keyvals + // remove all elements from command.jkv.kv + kv_RemoveAll(parent); + // free memory for Tary command.jkv.kv + algo_lib::malloc_FreeMem(parent.kv_elems, sizeof(algo::cstring)*parent.kv_max); // (command.jkv.kv) +} + +// --- command.jkv..ToCmdline +// Convenience function that returns a full command line +// Assume command is in a directory called bin +tempstr command::jkv_ToCmdline(command::jkv& row) { + tempstr ret; + ret << "bin/jkv "; + jkv_PrintArgv(row, ret); + // inherit less intense verbose, debug options + for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { + ret << " -verbose"; + } + for (int i = 1; i < algo_lib::_db.cmdline.debug; i++) { + ret << " -debug"; + } + return ret; +} + +// --- command.jkv..PrintArgv +// print string representation of ROW to string STR +// cfmt:command.jkv.Argv printfmt:Tuple +void command::jkv_PrintArgv(command::jkv& row, algo::cstring& str) { + algo::tempstr temp; + (void)temp; + (void)str; + if (!(row.in == "data")) { + ch_RemoveAll(temp); + cstring_Print(row.in, temp); + str << " -in:"; + strptr_PrintBash(temp,str); + } + ch_RemoveAll(temp); + cstring_Print(row.file, temp); + str << " -file:"; + strptr_PrintBash(temp,str); + ind_beg(jkv_kv_curs,value,row) { + ch_RemoveAll(temp); + cstring_Print(value, temp); + str << " -kv:"; + strptr_PrintBash(temp,str); + }ind_end; + if (!(row.r == false)) { + ch_RemoveAll(temp); + bool_Print(row.r, temp); + str << " -r:"; + strptr_PrintBash(temp,str); + } + if (!(row.write == false)) { + ch_RemoveAll(temp); + bool_Print(row.write, temp); + str << " -write:"; + strptr_PrintBash(temp,str); + } + if (!(row.output == 0)) { + ch_RemoveAll(temp); + command::output_Print(const_cast(row), temp); + str << " -output:"; + strptr_PrintBash(temp,str); + } + if (!(row.pretty == 2)) { + ch_RemoveAll(temp); + u32_Print(row.pretty, temp); + str << " -pretty:"; + strptr_PrintBash(temp,str); + } +} + +// --- command.jkv..GetAnon +algo::strptr command::jkv_GetAnon(command::jkv &parent, i32 idx) { + (void)parent;//only to avoid -Wunused-parameter + switch(idx) { + case(0): return strptr("file", 4); + default: return strptr("kv", 2); + } +} + +// --- command.jkv..NArgs +// Used with command lines +// Return # of command-line arguments that must follow this argument +// If FIELD is invalid, return -1 +i32 command::jkv_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { + i32 retval = 1; + switch (field) { + case command_FieldId_in: { // + *out_anon = false; + } break; + case command_FieldId_file: { // + *out_anon = true; + } break; + case command_FieldId_kv: { // + *out_anon = true; + } break; + case command_FieldId_r: { // bool: no argument required but value may be specified as r:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_write: { // bool: no argument required but value may be specified as write:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_output: { // + *out_anon = false; + } break; + case command_FieldId_pretty: { // + *out_anon = false; + } break; + default: + retval=-1; // unrecognized + } + return retval; +} + +// --- command.jkv..AssignOp +command::jkv& command::jkv::operator =(const command::jkv &rhs) { + in = rhs.in; + file = rhs.file; + kv_Setary(*this, kv_Getary(const_cast(rhs))); + r = rhs.r; + write = rhs.write; + output = rhs.output; + pretty = rhs.pretty; + return *this; +} + +// --- command.jkv..CopyCtor + command::jkv::jkv(const command::jkv &rhs) + : in(rhs.in) + , file(rhs.file) + , r(rhs.r) + , write(rhs.write) + , output(rhs.output) + , pretty(rhs.pretty) + { + kv_elems = 0; // (command.jkv.kv) + kv_n = 0; // (command.jkv.kv) + kv_max = 0; // (command.jkv.kv) + kv_Setary(*this, kv_Getary(const_cast(rhs))); +} + +// --- command.jkv_proc.jkv.Start +// Start subprocess +// If subprocess already running, do nothing. Otherwise, start it +int command::jkv_Start(command::jkv_proc& parent) { + int retval = 0; + if (parent.pid == 0) { + verblog(jkv_ToCmdline(parent)); // maybe print command +#ifdef WIN32 + algo_lib::ResolveExecFname(parent.path); + tempstr cmdline(jkv_ToCmdline(parent)); + parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); +#else + parent.pid = fork(); + if (parent.pid == 0) { // child + algo_lib::DieWithParent(); + if (parent.timeout > 0) { + alarm(parent.timeout); + } + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); + if (retval==0) retval= jkv_Execv(parent); + if (retval != 0) { // if start fails, print error + int err=errno; + prerr("command.jkv_execv" + < 0 ? 0 : -1; // if didn't start, set error status + return retval; +} + +// --- command.jkv_proc.jkv.StartRead +// Start subprocess & Read output +algo::Fildes command::jkv_StartRead(command::jkv_proc& parent, algo_lib::FFildes &read) { + int pipefd[2]; + int rc=pipe(pipefd); + (void)rc; + read.fd.value = pipefd[0]; + parent.fstdout << ">&" << pipefd[1]; + jkv_Start(parent); + (void)close(pipefd[1]); + return read.fd; +} + +// --- command.jkv_proc.jkv.Kill +// Kill subprocess and wait +void command::jkv_Kill(command::jkv_proc& parent) { + if (parent.pid > 0) { + kill(parent.pid,9); + jkv_Wait(parent); + } +} + +// --- command.jkv_proc.jkv.Wait +// Wait for subprocess to return +void command::jkv_Wait(command::jkv_proc& parent) { + if (parent.pid > 0) { + int wait_flags = 0; + int wait_status = 0; + int rc = -1; + do { + // really wait for subprocess to exit + rc = waitpid(parent.pid,&wait_status,wait_flags); + } while (rc==-1 && errno==EINTR); + if (rc == parent.pid) { + parent.status = wait_status; + parent.pid = 0; + } + } +} + +// --- command.jkv_proc.jkv.Exec +// Start + Wait +// Execute subprocess and return exit code +int command::jkv_Exec(command::jkv_proc& parent) { + jkv_Start(parent); + jkv_Wait(parent); + return parent.status; +} + +// --- command.jkv_proc.jkv.ExecX +// Start + Wait, throw exception on error +// Execute subprocess; throw human-readable exception on error +void command::jkv_ExecX(command::jkv_proc& parent) { + int rc = jkv_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",jkv_ToCmdline(parent)) + << Keyval("comment",algo::DescribeWaitStatus(parent.status))); +} + +// --- command.jkv_proc.jkv.Execv +// Call execv() +// Call execv with specified parameters +int command::jkv_Execv(command::jkv_proc& parent) { + int ret = 0; + algo::StringAry args; + jkv_ToArgv(parent, args); + char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); + ind_beg(algo::StringAry_ary_curs,arg,args) { + argv[ind_curs(arg).index] = Zeroterm(arg); + }ind_end; + argv[ary_N(args)] = NULL; + // if parent.path is relative, search for it in PATH + algo_lib::ResolveExecFname(parent.path); + ret = execv(Zeroterm(parent.path),argv); + return ret; +} + +// --- command.jkv_proc.jkv.ToCmdline +algo::tempstr command::jkv_ToCmdline(command::jkv_proc& parent) { + algo::tempstr retval; + retval << parent.path << " "; + command::jkv_PrintArgv(parent.cmd,retval); + if (ch_N(parent.fstdin)) { + retval << " " << parent.fstdin; + } + if (ch_N(parent.fstdout)) { + retval << " " << parent.fstdout; + } + if (ch_N(parent.fstderr)) { + retval << " 2" << parent.fstderr; + } + return retval; +} + +// --- command.jkv_proc.jkv.ToArgv +// Form array from the command line +void command::jkv_ToArgv(command::jkv_proc& parent, algo::StringAry& args) { + ary_RemoveAll(args); + ary_Alloc(args) << parent.path; + + if (parent.cmd.in != "data") { + cstring *arg = &ary_Alloc(args); + *arg << "-in:"; + cstring_Print(parent.cmd.in, *arg); + } + + if (true) { + cstring *arg = &ary_Alloc(args); + *arg << "-file:"; + cstring_Print(parent.cmd.file, *arg); + } + ind_beg(command::jkv_kv_curs,value,parent.cmd) { + cstring *arg = &ary_Alloc(args); + *arg << "-kv:"; + cstring_Print(value, *arg); + }ind_end; + + if (parent.cmd.r != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-r:"; + bool_Print(parent.cmd.r, *arg); + } + + if (parent.cmd.write != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-write:"; + bool_Print(parent.cmd.write, *arg); + } + + if (parent.cmd.output != 0) { + cstring *arg = &ary_Alloc(args); + *arg << "-output:"; + command::output_Print(parent.cmd, *arg); + } + + if (parent.cmd.pretty != 2) { + cstring *arg = &ary_Alloc(args); + *arg << "-pretty:"; + u32_Print(parent.cmd.pretty, *arg); + } + for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { + ary_Alloc(args) << "-verbose"; + } +} + +// --- command.jkv_proc..Uninit +void command::jkv_proc_Uninit(command::jkv_proc& parent) { + command::jkv_proc &row = parent; (void)row; + + // command.jkv_proc.jkv.Uninit (Exec) // + jkv_Kill(parent); // kill child, ensure forward progress +} + +// --- command.mdbg.args.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr command::args_Addary(command::mdbg& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.args_elems && rhs.elems < parent.args_elems + parent.args_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.mdbg.args comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + args_Reserve(parent, nnew); // reserve space + int at = parent.args_n; + for (int i = 0; i < nnew; i++) { + new (parent.args_elems + at + i) algo::cstring(rhs[i]); + parent.args_n++; + } + return algo::aryptr(parent.args_elems + at, nnew); +} + +// --- command.mdbg.args.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +algo::cstring& command::args_Alloc(command::mdbg& parent) { + args_Reserve(parent, 1); + int n = parent.args_n; + int at = n; + algo::cstring *elems = parent.args_elems; + new (elems + at) algo::cstring(""); // construct new element, default initializer + parent.args_n = n+1; + return elems[at]; +} + +// --- command.mdbg.args.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::cstring& command::args_AllocAt(command::mdbg& parent, int at) { + args_Reserve(parent, 1); + int n = parent.args_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("command.bad_alloc_at field:command.mdbg.args comment:'index out of range'"); + } + algo::cstring *elems = parent.args_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(algo::cstring)); + new (elems + at) algo::cstring(""); // construct element, default initializer + parent.args_n = n+1; + return elems[at]; +} + +// --- command.mdbg.args.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr command::args_AllocN(command::mdbg& parent, int n_elems) { + args_Reserve(parent, n_elems); + int old_n = parent.args_n; + int new_n = old_n + n_elems; + algo::cstring *elems = parent.args_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo::cstring(""); // construct new element, default initialize + } + parent.args_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- command.mdbg.args.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::args_AllocNAt(command::mdbg& parent, int n_elems, int at) { + args_Reserve(parent, n_elems); + int n = parent.args_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.mdbg.args comment:'index out of range'"); + } + algo::cstring *elems = parent.args_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(""); // construct new element, default initialize + } + parent.args_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- command.mdbg.args.Remove +// Remove item by index. If index outside of range, do nothing. +void command::args_Remove(command::mdbg& parent, u32 i) { + u32 lim = parent.args_n; + algo::cstring *elems = parent.args_elems; + if (i < lim) { + elems[i].~cstring(); // destroy element + memmove(elems + i, elems + (i + 1), sizeof(algo::cstring) * (lim - (i + 1))); + parent.args_n = lim - 1; + } +} + +// --- command.mdbg.args.RemoveAll +void command::args_RemoveAll(command::mdbg& parent) { + u32 n = parent.args_n; + while (n > 0) { + n -= 1; + parent.args_elems[n].~cstring(); + parent.args_n = n; + } +} + +// --- command.mdbg.args.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void command::args_RemoveLast(command::mdbg& parent) { + u64 n = parent.args_n; + if (n > 0) { + n -= 1; + args_qFind(parent, u64(n)).~cstring(); + parent.args_n = n; + } +} + +// --- command.mdbg.args.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void command::args_AbsReserve(command::mdbg& parent, int n) { + u32 old_max = parent.args_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.args_elems, old_max * sizeof(algo::cstring), new_max * sizeof(algo::cstring)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("command.tary_nomem field:command.mdbg.args comment:'out of memory'"); + } + parent.args_elems = (algo::cstring*)new_mem; + parent.args_max = new_max; + } +} + +// --- command.mdbg.args.Setary +// Copy contents of RHS to PARENT. +void command::args_Setary(command::mdbg& parent, command::mdbg &rhs) { + args_RemoveAll(parent); + int nnew = rhs.args_n; + args_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.args_elems + i) algo::cstring(args_qFind(rhs, i)); + parent.args_n = i + 1; + } +} + +// --- command.mdbg.args.Setary2 +// Copy specified array into args, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void command::args_Setary(command::mdbg& parent, const algo::aryptr &rhs) { + args_RemoveAll(parent); + args_Addary(parent, rhs); +} + +// --- command.mdbg.args.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr command::args_AllocNVal(command::mdbg& parent, int n_elems, const algo::cstring& val) { + args_Reserve(parent, n_elems); + int old_n = parent.args_n; + int new_n = old_n + n_elems; + algo::cstring *elems = parent.args_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo::cstring(val); + } + parent.args_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- command.mdbg.args.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool command::args_ReadStrptrMaybe(command::mdbg& parent, algo::strptr in_str) { + bool retval = true; + algo::cstring &elem = args_Alloc(parent); + retval = algo::cstring_ReadStrptrMaybe(elem, in_str); + if (!retval) { + args_RemoveLast(parent); + } + return retval; +} + +// --- command.mdbg.args.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::args_Insary(command::mdbg& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.args_elems && rhs.elems < parent.args_elems + parent.args_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.mdbg.args comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.args_elems+1))) { + FatalErrorExit("command.bad_insary field:command.mdbg.args comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.args_n - at; + args_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.args_elems + at + nnew + i) algo::cstring(parent.args_elems[at + i]); + parent.args_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.args_elems + at + i) algo::cstring(rhs[i]); + } + parent.args_n += nnew; +} + +// --- command.mdbg.b.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr command::b_Addary(command::mdbg& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.b_elems && rhs.elems < parent.b_elems + parent.b_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.mdbg.b comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + b_Reserve(parent, nnew); // reserve space + int at = parent.b_n; + for (int i = 0; i < nnew; i++) { + new (parent.b_elems + at + i) algo::cstring(rhs[i]); + parent.b_n++; + } + return algo::aryptr(parent.b_elems + at, nnew); +} + +// --- command.mdbg.b.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +algo::cstring& command::b_Alloc(command::mdbg& parent) { + b_Reserve(parent, 1); + int n = parent.b_n; + int at = n; + algo::cstring *elems = parent.b_elems; + new (elems + at) algo::cstring(""); // construct new element, default initializer + parent.b_n = n+1; + return elems[at]; +} + +// --- command.mdbg.b.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::cstring& command::b_AllocAt(command::mdbg& parent, int at) { + b_Reserve(parent, 1); + int n = parent.b_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("command.bad_alloc_at field:command.mdbg.b comment:'index out of range'"); + } + algo::cstring *elems = parent.b_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(algo::cstring)); + new (elems + at) algo::cstring(""); // construct element, default initializer + parent.b_n = n+1; + return elems[at]; +} + +// --- command.mdbg.b.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr command::b_AllocN(command::mdbg& parent, int n_elems) { + b_Reserve(parent, n_elems); + int old_n = parent.b_n; + int new_n = old_n + n_elems; + algo::cstring *elems = parent.b_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo::cstring(""); // construct new element, default initialize + } + parent.b_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- command.mdbg.b.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::b_AllocNAt(command::mdbg& parent, int n_elems, int at) { + b_Reserve(parent, n_elems); + int n = parent.b_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.mdbg.b comment:'index out of range'"); + } + algo::cstring *elems = parent.b_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(""); // construct new element, default initialize + } + parent.b_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- command.mdbg.b.Remove +// Remove item by index. If index outside of range, do nothing. +void command::b_Remove(command::mdbg& parent, u32 i) { + u32 lim = parent.b_n; + algo::cstring *elems = parent.b_elems; + if (i < lim) { + elems[i].~cstring(); // destroy element + memmove(elems + i, elems + (i + 1), sizeof(algo::cstring) * (lim - (i + 1))); + parent.b_n = lim - 1; + } +} + +// --- command.mdbg.b.RemoveAll +void command::b_RemoveAll(command::mdbg& parent) { + u32 n = parent.b_n; + while (n > 0) { + n -= 1; + parent.b_elems[n].~cstring(); + parent.b_n = n; + } +} + +// --- command.mdbg.b.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void command::b_RemoveLast(command::mdbg& parent) { + u64 n = parent.b_n; + if (n > 0) { + n -= 1; + b_qFind(parent, u64(n)).~cstring(); + parent.b_n = n; + } +} + +// --- command.mdbg.b.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void command::b_AbsReserve(command::mdbg& parent, int n) { + u32 old_max = parent.b_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.b_elems, old_max * sizeof(algo::cstring), new_max * sizeof(algo::cstring)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("command.tary_nomem field:command.mdbg.b comment:'out of memory'"); + } + parent.b_elems = (algo::cstring*)new_mem; + parent.b_max = new_max; + } +} + +// --- command.mdbg.b.Setary +// Copy contents of RHS to PARENT. +void command::b_Setary(command::mdbg& parent, command::mdbg &rhs) { + b_RemoveAll(parent); + int nnew = rhs.b_n; + b_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.b_elems + i) algo::cstring(b_qFind(rhs, i)); + parent.b_n = i + 1; + } +} + +// --- command.mdbg.b.Setary2 +// Copy specified array into b, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void command::b_Setary(command::mdbg& parent, const algo::aryptr &rhs) { + b_RemoveAll(parent); + b_Addary(parent, rhs); +} + +// --- command.mdbg.b.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr command::b_AllocNVal(command::mdbg& parent, int n_elems, const algo::cstring& val) { + b_Reserve(parent, n_elems); + int old_n = parent.b_n; + int new_n = old_n + n_elems; + algo::cstring *elems = parent.b_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) algo::cstring(val); + } + parent.b_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- command.mdbg.b.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool command::b_ReadStrptrMaybe(command::mdbg& parent, algo::strptr in_str) { + bool retval = true; + algo::cstring &elem = b_Alloc(parent); + retval = algo::cstring_ReadStrptrMaybe(elem, in_str); + if (!retval) { + b_RemoveLast(parent); + } + return retval; +} + +// --- command.mdbg.b.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::b_Insary(command::mdbg& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.b_elems && rhs.elems < parent.b_elems + parent.b_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.mdbg.b comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.b_elems+1))) { + FatalErrorExit("command.bad_insary field:command.mdbg.b comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.b_n - at; + b_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.b_elems + at + nnew + i) algo::cstring(parent.b_elems[at + i]); + parent.b_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.b_elems + at + i) algo::cstring(rhs[i]); + } + parent.b_n += nnew; +} + +// --- command.mdbg..ReadFieldMaybe +bool command::mdbg_ReadFieldMaybe(command::mdbg& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + command::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case command_FieldId_target: { + retval = algo::Smallstr16_ReadStrptrMaybe(parent.target, strval); + } break; + case command_FieldId_in: { + retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); + } break; + case command_FieldId_args: { + retval = args_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_cfg: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.cfg, strval); + } break; + case command_FieldId_disas: { + retval = bool_ReadStrptrMaybe(parent.disas, strval); + } break; + case command_FieldId_attach: { + retval = bool_ReadStrptrMaybe(parent.attach, strval); + } break; + case command_FieldId_pid: { + retval = i32_ReadStrptrMaybe(parent.pid, strval); + } break; + case command_FieldId_b: { + retval = b_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_catchthrow: { + retval = bool_ReadStrptrMaybe(parent.catchthrow, strval); + } break; + case command_FieldId_tui: { + retval = bool_ReadStrptrMaybe(parent.tui, strval); + } break; + case command_FieldId_bcmd: { + retval = algo::cstring_ReadStrptrMaybe(parent.bcmd, strval); + } break; + case command_FieldId_emacs: { + retval = bool_ReadStrptrMaybe(parent.emacs, strval); + } break; + case command_FieldId_manywin: { + retval = bool_ReadStrptrMaybe(parent.manywin, strval); + } break; + case command_FieldId_follow_child: { + retval = bool_ReadStrptrMaybe(parent.follow_child, strval); + } break; + case command_FieldId_py: { + retval = bool_ReadStrptrMaybe(parent.py, strval); + } break; + case command_FieldId_dry_run: { + retval = bool_ReadStrptrMaybe(parent.dry_run, strval); + } break; + case command_FieldId_mp: { + retval = bool_ReadStrptrMaybe(parent.mp, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- command.mdbg..ReadTupleMaybe +// Read fields of command::mdbg from attributes of ascii tuple TUPLE +bool command::mdbg_ReadTupleMaybe(command::mdbg &parent, algo::Tuple &tuple) { + bool retval = true; + int anon_idx = 0; + ind_beg(algo::Tuple_attrs_curs,attr,tuple) { + if (ch_N(attr.name) == 0) { + attr.name = mdbg_GetAnon(parent, anon_idx++); + } + retval = mdbg_ReadFieldMaybe(parent, attr.name, attr.value); + if (!retval) { + break; + } + }ind_end; + return retval; +} + +// --- command.mdbg..Init +// Set all fields to initial values. +void command::mdbg_Init(command::mdbg& parent) { + parent.in = algo::strptr("data"); + parent.args_elems = 0; // (command.mdbg.args) + parent.args_n = 0; // (command.mdbg.args) + parent.args_max = 0; // (command.mdbg.args) + parent.cfg = algo::strptr("debug"); + parent.disas = bool(false); + parent.attach = bool(false); + parent.pid = i32(0); + parent.b_elems = 0; // (command.mdbg.b) + parent.b_n = 0; // (command.mdbg.b) + parent.b_max = 0; // (command.mdbg.b) + parent.catchthrow = bool(true); + parent.tui = bool(false); + parent.bcmd = algo::strptr(""); + parent.emacs = bool(true); + parent.manywin = bool(false); + parent.follow_child = bool(false); + parent.py = bool(false); + parent.dry_run = bool(false); + parent.mp = bool(false); +} + +// --- command.mdbg..Uninit +void command::mdbg_Uninit(command::mdbg& parent) { + command::mdbg &row = parent; (void)row; + + // command.mdbg.b.Uninit (Tary) //Set breakpoint, e.g. 'a.cpp:123 if cond1', 'func#3' + // remove all elements from command.mdbg.b + b_RemoveAll(parent); + // free memory for Tary command.mdbg.b + algo_lib::malloc_FreeMem(parent.b_elems, sizeof(algo::cstring)*parent.b_max); // (command.mdbg.b) + + // command.mdbg.args.Uninit (Tary) //Additional module args + // remove all elements from command.mdbg.args + args_RemoveAll(parent); + // free memory for Tary command.mdbg.args + algo_lib::malloc_FreeMem(parent.args_elems, sizeof(algo::cstring)*parent.args_max); // (command.mdbg.args) +} + +// --- command.mdbg..ToCmdline +// Convenience function that returns a full command line +// Assume command is in a directory called bin +tempstr command::mdbg_ToCmdline(command::mdbg& row) { + tempstr ret; + ret << "bin/mdbg "; + mdbg_PrintArgv(row, ret); + // inherit less intense verbose, debug options + for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { + ret << " -verbose"; + } + for (int i = 1; i < algo_lib::_db.cmdline.debug; i++) { + ret << " -debug"; + } + return ret; +} + +// --- command.mdbg..PrintArgv +// print string representation of ROW to string STR +// cfmt:command.mdbg.Argv printfmt:Auto +void command::mdbg_PrintArgv(command::mdbg& row, algo::cstring& str) { + algo::tempstr temp; + (void)temp; + (void)str; + ch_RemoveAll(temp); + Smallstr16_Print(row.target, temp); + str << " -target:"; + strptr_PrintBash(temp,str); + if (!(row.in == "data")) { + ch_RemoveAll(temp); + cstring_Print(row.in, temp); + str << " -in:"; + strptr_PrintBash(temp,str); + } + ind_beg(mdbg_args_curs,value,row) { + ch_RemoveAll(temp); + cstring_Print(value, temp); + str << " -args:"; + strptr_PrintBash(temp,str); + }ind_end; + if (!(row.cfg == "debug")) { + ch_RemoveAll(temp); + Smallstr50_Print(row.cfg, temp); + str << " -cfg:"; + strptr_PrintBash(temp,str); + } + if (!(row.disas == false)) { + ch_RemoveAll(temp); + bool_Print(row.disas, temp); + str << " -disas:"; + strptr_PrintBash(temp,str); + } + if (!(row.attach == false)) { + ch_RemoveAll(temp); + bool_Print(row.attach, temp); + str << " -attach:"; + strptr_PrintBash(temp,str); + } + if (!(row.pid == 0)) { + ch_RemoveAll(temp); + i32_Print(row.pid, temp); + str << " -pid:"; + strptr_PrintBash(temp,str); + } + ind_beg(mdbg_b_curs,value,row) { + ch_RemoveAll(temp); + cstring_Print(value, temp); + str << " -b:"; + strptr_PrintBash(temp,str); + }ind_end; + if (!(row.catchthrow == true)) { + ch_RemoveAll(temp); + bool_Print(row.catchthrow, temp); + str << " -catchthrow:"; + strptr_PrintBash(temp,str); + } + if (!(row.tui == false)) { + ch_RemoveAll(temp); + bool_Print(row.tui, temp); + str << " -tui:"; + strptr_PrintBash(temp,str); + } + if (!(row.bcmd == "")) { + ch_RemoveAll(temp); + cstring_Print(row.bcmd, temp); + str << " -bcmd:"; + strptr_PrintBash(temp,str); + } + if (!(row.emacs == true)) { + ch_RemoveAll(temp); + bool_Print(row.emacs, temp); + str << " -emacs:"; + strptr_PrintBash(temp,str); + } + if (!(row.manywin == false)) { + ch_RemoveAll(temp); + bool_Print(row.manywin, temp); + str << " -manywin:"; + strptr_PrintBash(temp,str); + } + if (!(row.follow_child == false)) { + ch_RemoveAll(temp); + bool_Print(row.follow_child, temp); + str << " -follow_child:"; + strptr_PrintBash(temp,str); + } + if (!(row.py == false)) { + ch_RemoveAll(temp); + bool_Print(row.py, temp); + str << " -py:"; + strptr_PrintBash(temp,str); + } + if (!(row.dry_run == false)) { + ch_RemoveAll(temp); + bool_Print(row.dry_run, temp); + str << " -dry_run:"; + strptr_PrintBash(temp,str); + } + if (!(row.mp == false)) { + ch_RemoveAll(temp); + bool_Print(row.mp, temp); + str << " -mp:"; + strptr_PrintBash(temp,str); + } +} + +// --- command.mdbg..GetAnon +algo::strptr command::mdbg_GetAnon(command::mdbg &parent, i32 idx) { + (void)parent;//only to avoid -Wunused-parameter + switch(idx) { + case(0): return strptr("target", 6); + default: return strptr("args", 4); + } +} + +// --- command.mdbg..NArgs +// Used with command lines +// Return # of command-line arguments that must follow this argument +// If FIELD is invalid, return -1 +i32 command::mdbg_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { + i32 retval = 1; + switch (field) { + case command_FieldId_target: { // + *out_anon = true; + } break; + case command_FieldId_in: { // + *out_anon = false; + } break; + case command_FieldId_args: { // + *out_anon = true; + } break; + case command_FieldId_cfg: { // + *out_anon = false; + } break; + case command_FieldId_disas: { // bool: no argument required but value may be specified as disas:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_attach: { // bool: no argument required but value may be specified as attach:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_pid: { // + *out_anon = false; + } break; + case command_FieldId_b: { // + *out_anon = false; + } break; + case command_FieldId_catchthrow: { // bool: no argument required but value may be specified as catchthrow:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_tui: { // bool: no argument required but value may be specified as tui:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_bcmd: { // + *out_anon = false; + } break; + case command_FieldId_emacs: { // bool: no argument required but value may be specified as emacs:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_manywin: { // bool: no argument required but value may be specified as manywin:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_follow_child: { // bool: no argument required but value may be specified as follow_child:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_py: { // bool: no argument required but value may be specified as py:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_dry_run: { // bool: no argument required but value may be specified as dry_run:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_mp: { // bool: no argument required but value may be specified as mp:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + default: + retval=-1; // unrecognized + } + return retval; +} + +// --- command.mdbg..AssignOp +command::mdbg& command::mdbg::operator =(const command::mdbg &rhs) { + target = rhs.target; + in = rhs.in; + args_Setary(*this, args_Getary(const_cast(rhs))); + cfg = rhs.cfg; + disas = rhs.disas; + attach = rhs.attach; + pid = rhs.pid; + b_Setary(*this, b_Getary(const_cast(rhs))); + catchthrow = rhs.catchthrow; + tui = rhs.tui; + bcmd = rhs.bcmd; + emacs = rhs.emacs; + manywin = rhs.manywin; + follow_child = rhs.follow_child; + py = rhs.py; + dry_run = rhs.dry_run; + mp = rhs.mp; + return *this; +} + +// --- command.mdbg..CopyCtor + command::mdbg::mdbg(const command::mdbg &rhs) + : target(rhs.target) + , in(rhs.in) + , cfg(rhs.cfg) + , disas(rhs.disas) + , attach(rhs.attach) + , pid(rhs.pid) + , catchthrow(rhs.catchthrow) + , tui(rhs.tui) + , bcmd(rhs.bcmd) + , emacs(rhs.emacs) + , manywin(rhs.manywin) + , follow_child(rhs.follow_child) + , py(rhs.py) + , dry_run(rhs.dry_run) + , mp(rhs.mp) + { + args_elems = 0; // (command.mdbg.args) + args_n = 0; // (command.mdbg.args) + args_max = 0; // (command.mdbg.args) + args_Setary(*this, args_Getary(const_cast(rhs))); + b_elems = 0; // (command.mdbg.b) + b_n = 0; // (command.mdbg.b) + b_max = 0; // (command.mdbg.b) + b_Setary(*this, b_Getary(const_cast(rhs))); +} + +// --- command.mdbg_proc.mdbg.Start +// Start subprocess +// If subprocess already running, do nothing. Otherwise, start it +int command::mdbg_Start(command::mdbg_proc& parent) { + int retval = 0; + if (parent.pid == 0) { + verblog(mdbg_ToCmdline(parent)); // maybe print command +#ifdef WIN32 + algo_lib::ResolveExecFname(parent.path); + tempstr cmdline(mdbg_ToCmdline(parent)); + parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); +#else + parent.pid = fork(); + if (parent.pid == 0) { // child + algo_lib::DieWithParent(); + if (parent.timeout > 0) { + alarm(parent.timeout); + } + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); + if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); + if (retval==0) retval= mdbg_Execv(parent); + if (retval != 0) { // if start fails, print error + int err=errno; + prerr("command.mdbg_execv" + <(parent.args_elems + at, nnew); + parent.status = parent.pid > 0 ? 0 : -1; // if didn't start, set error status + return retval; } -// --- command.mdbg.args.Alloc -// Reserve space. Insert element at the end -// The new element is initialized to a default value -algo::cstring& command::args_Alloc(command::mdbg& parent) { - args_Reserve(parent, 1); - int n = parent.args_n; - int at = n; - algo::cstring *elems = parent.args_elems; - new (elems + at) algo::cstring(""); // construct new element, default initializer - parent.args_n = n+1; - return elems[at]; +// --- command.mdbg_proc.mdbg.StartRead +// Start subprocess & Read output +algo::Fildes command::mdbg_StartRead(command::mdbg_proc& parent, algo_lib::FFildes &read) { + int pipefd[2]; + int rc=pipe(pipefd); + (void)rc; + read.fd.value = pipefd[0]; + parent.fstdout << ">&" << pipefd[1]; + mdbg_Start(parent); + (void)close(pipefd[1]); + return read.fd; } -// --- command.mdbg.args.AllocAt -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -algo::cstring& command::args_AllocAt(command::mdbg& parent, int at) { - args_Reserve(parent, 1); - int n = parent.args_n; - if (UNLIKELY(u64(at) >= u64(n+1))) { - FatalErrorExit("command.bad_alloc_at field:command.mdbg.args comment:'index out of range'"); +// --- command.mdbg_proc.mdbg.Kill +// Kill subprocess and wait +void command::mdbg_Kill(command::mdbg_proc& parent) { + if (parent.pid > 0) { + kill(parent.pid,9); + mdbg_Wait(parent); } - algo::cstring *elems = parent.args_elems; - memmove(elems + at + 1, elems + at, (n - at) * sizeof(algo::cstring)); - new (elems + at) algo::cstring(""); // construct element, default initializer - parent.args_n = n+1; - return elems[at]; } -// --- command.mdbg.args.AllocN -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr command::args_AllocN(command::mdbg& parent, int n_elems) { - args_Reserve(parent, n_elems); - int old_n = parent.args_n; - int new_n = old_n + n_elems; - algo::cstring *elems = parent.args_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) algo::cstring(""); // construct new element, default initialize +// --- command.mdbg_proc.mdbg.Wait +// Wait for subprocess to return +void command::mdbg_Wait(command::mdbg_proc& parent) { + if (parent.pid > 0) { + int wait_flags = 0; + int wait_status = 0; + int rc = -1; + do { + // really wait for subprocess to exit + rc = waitpid(parent.pid,&wait_status,wait_flags); + } while (rc==-1 && errno==EINTR); + if (rc == parent.pid) { + parent.status = wait_status; + parent.pid = 0; + } } - parent.args_n = new_n; - return algo::aryptr(elems + old_n, n_elems); } -// --- command.mdbg.args.Remove -// Remove item by index. If index outside of range, do nothing. -void command::args_Remove(command::mdbg& parent, u32 i) { - u32 lim = parent.args_n; - algo::cstring *elems = parent.args_elems; - if (i < lim) { - elems[i].~cstring(); // destroy element - memmove(elems + i, elems + (i + 1), sizeof(algo::cstring) * (lim - (i + 1))); - parent.args_n = lim - 1; - } +// --- command.mdbg_proc.mdbg.Exec +// Start + Wait +// Execute subprocess and return exit code +int command::mdbg_Exec(command::mdbg_proc& parent) { + mdbg_Start(parent); + mdbg_Wait(parent); + return parent.status; } -// --- command.mdbg.args.RemoveAll -void command::args_RemoveAll(command::mdbg& parent) { - u32 n = parent.args_n; - while (n > 0) { - n -= 1; - parent.args_elems[n].~cstring(); - parent.args_n = n; - } +// --- command.mdbg_proc.mdbg.ExecX +// Start + Wait, throw exception on error +// Execute subprocess; throw human-readable exception on error +void command::mdbg_ExecX(command::mdbg_proc& parent) { + int rc = mdbg_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",mdbg_ToCmdline(parent)) + << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.mdbg.args.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void command::args_RemoveLast(command::mdbg& parent) { - u64 n = parent.args_n; - if (n > 0) { - n -= 1; - args_qFind(parent, u64(n)).~cstring(); - parent.args_n = n; - } +// --- command.mdbg_proc.mdbg.Execv +// Call execv() +// Call execv with specified parameters +int command::mdbg_Execv(command::mdbg_proc& parent) { + int ret = 0; + algo::StringAry args; + mdbg_ToArgv(parent, args); + char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); + ind_beg(algo::StringAry_ary_curs,arg,args) { + argv[ind_curs(arg).index] = Zeroterm(arg); + }ind_end; + argv[ary_N(args)] = NULL; + // if parent.path is relative, search for it in PATH + algo_lib::ResolveExecFname(parent.path); + ret = execv(Zeroterm(parent.path),argv); + return ret; } -// --- command.mdbg.args.AbsReserve -// Make sure N elements fit in array. Process dies if out of memory -void command::args_AbsReserve(command::mdbg& parent, int n) { - u32 old_max = parent.args_max; - if (n > i32(old_max)) { - u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); - void *new_mem = algo_lib::malloc_ReallocMem(parent.args_elems, old_max * sizeof(algo::cstring), new_max * sizeof(algo::cstring)); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("command.tary_nomem field:command.mdbg.args comment:'out of memory'"); - } - parent.args_elems = (algo::cstring*)new_mem; - parent.args_max = new_max; +// --- command.mdbg_proc.mdbg.ToCmdline +algo::tempstr command::mdbg_ToCmdline(command::mdbg_proc& parent) { + algo::tempstr retval; + retval << parent.path << " "; + command::mdbg_PrintArgv(parent.cmd,retval); + if (ch_N(parent.fstdin)) { + retval << " " << parent.fstdin; } -} - -// --- command.mdbg.args.Setary -// Copy contents of RHS to PARENT. -void command::args_Setary(command::mdbg& parent, command::mdbg &rhs) { - args_RemoveAll(parent); - int nnew = rhs.args_n; - args_Reserve(parent, nnew); // reserve space - for (int i = 0; i < nnew; i++) { // copy elements over - new (parent.args_elems + i) algo::cstring(args_qFind(rhs, i)); - parent.args_n = i + 1; + if (ch_N(parent.fstdout)) { + retval << " " << parent.fstdout; + } + if (ch_N(parent.fstderr)) { + retval << " 2" << parent.fstderr; } + return retval; } -// --- command.mdbg.args.Setary2 -// Copy specified array into args, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -void command::args_Setary(command::mdbg& parent, const algo::aryptr &rhs) { - args_RemoveAll(parent); - args_Addary(parent, rhs); -} +// --- command.mdbg_proc.mdbg.ToArgv +// Form array from the command line +void command::mdbg_ToArgv(command::mdbg_proc& parent, algo::StringAry& args) { + ary_RemoveAll(args); + ary_Alloc(args) << parent.path; -// --- command.mdbg.args.AllocNVal -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr command::args_AllocNVal(command::mdbg& parent, int n_elems, const algo::cstring& val) { - args_Reserve(parent, n_elems); - int old_n = parent.args_n; - int new_n = old_n + n_elems; - algo::cstring *elems = parent.args_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) algo::cstring(val); + if (true) { + cstring *arg = &ary_Alloc(args); + *arg << "-target:"; + Smallstr16_Print(parent.cmd.target, *arg); } - parent.args_n = new_n; - return algo::aryptr(elems + old_n, n_elems); -} -// --- command.mdbg.args.ReadStrptrMaybe -// A single element is read from input string and appended to the array. -// If the string contains an error, the array is untouched. -// Function returns success value. -bool command::args_ReadStrptrMaybe(command::mdbg& parent, algo::strptr in_str) { - bool retval = true; - algo::cstring &elem = args_Alloc(parent); - retval = algo::cstring_ReadStrptrMaybe(elem, in_str); - if (!retval) { - args_RemoveLast(parent); + if (parent.cmd.in != "data") { + cstring *arg = &ary_Alloc(args); + *arg << "-in:"; + cstring_Print(parent.cmd.in, *arg); } - return retval; -} + ind_beg(command::mdbg_args_curs,value,parent.cmd) { + cstring *arg = &ary_Alloc(args); + *arg << "-args:"; + cstring_Print(value, *arg); + }ind_end; -// --- command.mdbg.b.Addary -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -algo::aryptr command::b_Addary(command::mdbg& parent, algo::aryptr rhs) { - bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.b_elems && rhs.elems < parent.b_elems + parent.b_max; - if (UNLIKELY(overlaps)) { - FatalErrorExit("command.tary_alias field:command.mdbg.b comment:'alias error: sub-array is being appended to the whole'"); + if (parent.cmd.cfg != "debug") { + cstring *arg = &ary_Alloc(args); + *arg << "-cfg:"; + Smallstr50_Print(parent.cmd.cfg, *arg); } - int nnew = rhs.n_elems; - b_Reserve(parent, nnew); // reserve space - int at = parent.b_n; - for (int i = 0; i < nnew; i++) { - new (parent.b_elems + at + i) algo::cstring(rhs[i]); - parent.b_n++; + + if (parent.cmd.disas != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-disas:"; + bool_Print(parent.cmd.disas, *arg); + } + + if (parent.cmd.attach != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-attach:"; + bool_Print(parent.cmd.attach, *arg); } - return algo::aryptr(parent.b_elems + at, nnew); -} -// --- command.mdbg.b.Alloc -// Reserve space. Insert element at the end -// The new element is initialized to a default value -algo::cstring& command::b_Alloc(command::mdbg& parent) { - b_Reserve(parent, 1); - int n = parent.b_n; - int at = n; - algo::cstring *elems = parent.b_elems; - new (elems + at) algo::cstring(""); // construct new element, default initializer - parent.b_n = n+1; - return elems[at]; -} + if (parent.cmd.pid != 0) { + cstring *arg = &ary_Alloc(args); + *arg << "-pid:"; + i32_Print(parent.cmd.pid, *arg); + } + ind_beg(command::mdbg_b_curs,value,parent.cmd) { + cstring *arg = &ary_Alloc(args); + *arg << "-b:"; + cstring_Print(value, *arg); + }ind_end; -// --- command.mdbg.b.AllocAt -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -algo::cstring& command::b_AllocAt(command::mdbg& parent, int at) { - b_Reserve(parent, 1); - int n = parent.b_n; - if (UNLIKELY(u64(at) >= u64(n+1))) { - FatalErrorExit("command.bad_alloc_at field:command.mdbg.b comment:'index out of range'"); + if (parent.cmd.catchthrow != true) { + cstring *arg = &ary_Alloc(args); + *arg << "-catchthrow:"; + bool_Print(parent.cmd.catchthrow, *arg); } - algo::cstring *elems = parent.b_elems; - memmove(elems + at + 1, elems + at, (n - at) * sizeof(algo::cstring)); - new (elems + at) algo::cstring(""); // construct element, default initializer - parent.b_n = n+1; - return elems[at]; -} -// --- command.mdbg.b.AllocN -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr command::b_AllocN(command::mdbg& parent, int n_elems) { - b_Reserve(parent, n_elems); - int old_n = parent.b_n; - int new_n = old_n + n_elems; - algo::cstring *elems = parent.b_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) algo::cstring(""); // construct new element, default initialize + if (parent.cmd.tui != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-tui:"; + bool_Print(parent.cmd.tui, *arg); } - parent.b_n = new_n; - return algo::aryptr(elems + old_n, n_elems); -} -// --- command.mdbg.b.Remove -// Remove item by index. If index outside of range, do nothing. -void command::b_Remove(command::mdbg& parent, u32 i) { - u32 lim = parent.b_n; - algo::cstring *elems = parent.b_elems; - if (i < lim) { - elems[i].~cstring(); // destroy element - memmove(elems + i, elems + (i + 1), sizeof(algo::cstring) * (lim - (i + 1))); - parent.b_n = lim - 1; + if (parent.cmd.bcmd != "") { + cstring *arg = &ary_Alloc(args); + *arg << "-bcmd:"; + cstring_Print(parent.cmd.bcmd, *arg); } -} -// --- command.mdbg.b.RemoveAll -void command::b_RemoveAll(command::mdbg& parent) { - u32 n = parent.b_n; - while (n > 0) { - n -= 1; - parent.b_elems[n].~cstring(); - parent.b_n = n; + if (parent.cmd.emacs != true) { + cstring *arg = &ary_Alloc(args); + *arg << "-emacs:"; + bool_Print(parent.cmd.emacs, *arg); } -} -// --- command.mdbg.b.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void command::b_RemoveLast(command::mdbg& parent) { - u64 n = parent.b_n; - if (n > 0) { - n -= 1; - b_qFind(parent, u64(n)).~cstring(); - parent.b_n = n; + if (parent.cmd.manywin != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-manywin:"; + bool_Print(parent.cmd.manywin, *arg); } -} -// --- command.mdbg.b.AbsReserve -// Make sure N elements fit in array. Process dies if out of memory -void command::b_AbsReserve(command::mdbg& parent, int n) { - u32 old_max = parent.b_max; - if (n > i32(old_max)) { - u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); - void *new_mem = algo_lib::malloc_ReallocMem(parent.b_elems, old_max * sizeof(algo::cstring), new_max * sizeof(algo::cstring)); - if (UNLIKELY(!new_mem)) { - FatalErrorExit("command.tary_nomem field:command.mdbg.b comment:'out of memory'"); - } - parent.b_elems = (algo::cstring*)new_mem; - parent.b_max = new_max; + if (parent.cmd.follow_child != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-follow_child:"; + bool_Print(parent.cmd.follow_child, *arg); } -} -// --- command.mdbg.b.Setary -// Copy contents of RHS to PARENT. -void command::b_Setary(command::mdbg& parent, command::mdbg &rhs) { - b_RemoveAll(parent); - int nnew = rhs.b_n; - b_Reserve(parent, nnew); // reserve space - for (int i = 0; i < nnew; i++) { // copy elements over - new (parent.b_elems + i) algo::cstring(b_qFind(rhs, i)); - parent.b_n = i + 1; + if (parent.cmd.py != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-py:"; + bool_Print(parent.cmd.py, *arg); } -} -// --- command.mdbg.b.Setary2 -// Copy specified array into b, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -void command::b_Setary(command::mdbg& parent, const algo::aryptr &rhs) { - b_RemoveAll(parent); - b_Addary(parent, rhs); -} + if (parent.cmd.dry_run != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-dry_run:"; + bool_Print(parent.cmd.dry_run, *arg); + } -// --- command.mdbg.b.AllocNVal -// Reserve space. Insert N elements at the end of the array, return pointer to array -algo::aryptr command::b_AllocNVal(command::mdbg& parent, int n_elems, const algo::cstring& val) { - b_Reserve(parent, n_elems); - int old_n = parent.b_n; - int new_n = old_n + n_elems; - algo::cstring *elems = parent.b_elems; - for (int i = old_n; i < new_n; i++) { - new (elems + i) algo::cstring(val); + if (parent.cmd.mp != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-mp:"; + bool_Print(parent.cmd.mp, *arg); + } + for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { + ary_Alloc(args) << "-verbose"; } - parent.b_n = new_n; - return algo::aryptr(elems + old_n, n_elems); } -// --- command.mdbg.b.ReadStrptrMaybe -// A single element is read from input string and appended to the array. -// If the string contains an error, the array is untouched. -// Function returns success value. -bool command::b_ReadStrptrMaybe(command::mdbg& parent, algo::strptr in_str) { - bool retval = true; - algo::cstring &elem = b_Alloc(parent); - retval = algo::cstring_ReadStrptrMaybe(elem, in_str); - if (!retval) { - b_RemoveLast(parent); - } - return retval; +// --- command.mdbg_proc..Uninit +void command::mdbg_proc_Uninit(command::mdbg_proc& parent) { + command::mdbg_proc &row = parent; (void)row; + + // command.mdbg_proc.mdbg.Uninit (Exec) // + mdbg_Kill(parent); // kill child, ensure forward progress } -// --- command.mdbg..ReadFieldMaybe -bool command::mdbg_ReadFieldMaybe(command::mdbg& parent, algo::strptr field, algo::strptr strval) { +// --- command.mysql2ssim..ReadFieldMaybe +bool command::mysql2ssim_ReadFieldMaybe(command::mysql2ssim& parent, algo::strptr field, algo::strptr strval) { bool retval = true; command::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case command_FieldId_target: { - retval = algo::Smallstr16_ReadStrptrMaybe(parent.target, strval); - break; - } + case command_FieldId_writessimfile: { + retval = bool_ReadStrptrMaybe(parent.writessimfile, strval); + } break; + case command_FieldId_url: { + retval = algo::cstring_ReadStrptrMaybe(parent.url, strval); + } break; + case command_FieldId_tables: { + retval = algo::cstring_ReadStrptrMaybe(parent.tables, strval); + } break; + case command_FieldId_schema: { + retval = bool_ReadStrptrMaybe(parent.schema, strval); + } break; case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_args: { - retval = args_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_cfg: { - retval = algo::Smallstr50_ReadStrptrMaybe(parent.cfg, strval); - break; - } - case command_FieldId_disas: { - retval = bool_ReadStrptrMaybe(parent.disas, strval); - break; - } - case command_FieldId_attach: { - retval = bool_ReadStrptrMaybe(parent.attach, strval); - break; - } - case command_FieldId_b: { - retval = b_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_catchthrow: { - retval = bool_ReadStrptrMaybe(parent.catchthrow, strval); - break; - } - case command_FieldId_tui: { - retval = bool_ReadStrptrMaybe(parent.tui, strval); - break; - } - case command_FieldId_bcmd: { - retval = algo::cstring_ReadStrptrMaybe(parent.bcmd, strval); - break; - } - case command_FieldId_emacs: { - retval = bool_ReadStrptrMaybe(parent.emacs, strval); - break; - } - case command_FieldId_manywin: { - retval = bool_ReadStrptrMaybe(parent.manywin, strval); - break; - } - case command_FieldId_follow_child: { - retval = bool_ReadStrptrMaybe(parent.follow_child, strval); - break; - } - case command_FieldId_py: { - retval = bool_ReadStrptrMaybe(parent.py, strval); - break; - } - case command_FieldId_dry_run: { - retval = bool_ReadStrptrMaybe(parent.dry_run, strval); - break; - } - default: break; + } break; + case command_FieldId_pretty: { + retval = bool_ReadStrptrMaybe(parent.pretty, strval); + } break; + case command_FieldId_nologo: { + retval = bool_ReadStrptrMaybe(parent.nologo, strval); + } break; + case command_FieldId_baddbok: { + retval = bool_ReadStrptrMaybe(parent.baddbok, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -17881,16 +19879,16 @@ bool command::mdbg_ReadFieldMaybe(command::mdbg& parent, algo::strptr field, alg return retval; } -// --- command.mdbg..ReadTupleMaybe -// Read fields of command::mdbg from attributes of ascii tuple TUPLE -bool command::mdbg_ReadTupleMaybe(command::mdbg &parent, algo::Tuple &tuple) { +// --- command.mysql2ssim..ReadTupleMaybe +// Read fields of command::mysql2ssim from attributes of ascii tuple TUPLE +bool command::mysql2ssim_ReadTupleMaybe(command::mysql2ssim &parent, algo::Tuple &tuple) { bool retval = true; int anon_idx = 0; ind_beg(algo::Tuple_attrs_curs,attr,tuple) { if (ch_N(attr.name) == 0) { - attr.name = mdbg_GetAnon(parent, anon_idx++); + attr.name = mysql2ssim_GetAnon(parent, anon_idx++); } - retval = mdbg_ReadFieldMaybe(parent, attr.name, attr.value); + retval = mysql2ssim_ReadFieldMaybe(parent, attr.name, attr.value); if (!retval) { break; } @@ -17898,53 +19896,13 @@ bool command::mdbg_ReadTupleMaybe(command::mdbg &parent, algo::Tuple &tuple) { return retval; } -// --- command.mdbg..Init -// Set all fields to initial values. -void command::mdbg_Init(command::mdbg& parent) { - parent.in = algo::strptr("data"); - parent.args_elems = 0; // (command.mdbg.args) - parent.args_n = 0; // (command.mdbg.args) - parent.args_max = 0; // (command.mdbg.args) - parent.cfg = algo::strptr("debug"); - parent.disas = bool(false); - parent.attach = bool(false); - parent.b_elems = 0; // (command.mdbg.b) - parent.b_n = 0; // (command.mdbg.b) - parent.b_max = 0; // (command.mdbg.b) - parent.catchthrow = bool(true); - parent.tui = bool(false); - parent.bcmd = algo::strptr(""); - parent.emacs = bool(true); - parent.manywin = bool(false); - parent.follow_child = bool(false); - parent.py = bool(false); - parent.dry_run = bool(false); -} - -// --- command.mdbg..Uninit -void command::mdbg_Uninit(command::mdbg& parent) { - command::mdbg &row = parent; (void)row; - - // command.mdbg.b.Uninit (Tary) //Set breakpoint, e.g. 'a.cpp:123 if cond1', 'func#3' - // remove all elements from command.mdbg.b - b_RemoveAll(parent); - // free memory for Tary command.mdbg.b - algo_lib::malloc_FreeMem(parent.b_elems, sizeof(algo::cstring)*parent.b_max); // (command.mdbg.b) - - // command.mdbg.args.Uninit (Tary) //Additional module args - // remove all elements from command.mdbg.args - args_RemoveAll(parent); - // free memory for Tary command.mdbg.args - algo_lib::malloc_FreeMem(parent.args_elems, sizeof(algo::cstring)*parent.args_max); // (command.mdbg.args) -} - -// --- command.mdbg..ToCmdline +// --- command.mysql2ssim..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::mdbg_ToCmdline(command::mdbg& row) { +tempstr command::mysql2ssim_ToCmdline(command::mysql2ssim& row) { tempstr ret; - ret << "bin/mdbg "; - mdbg_PrintArgv(row, ret); + ret << "bin/mysql2ssim "; + mysql2ssim_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -17955,178 +19913,106 @@ tempstr command::mdbg_ToCmdline(command::mdbg& row) { return ret; } -// --- command.mdbg..PrintArgv +// --- command.mysql2ssim..PrintArgv // print string representation of ROW to string STR -// cfmt:command.mdbg.Argv printfmt:Auto -void command::mdbg_PrintArgv(command::mdbg& row, algo::cstring& str) { +// cfmt:command.mysql2ssim.Argv printfmt:Auto +void command::mysql2ssim_PrintArgv(command::mysql2ssim& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; - ch_RemoveAll(temp); - Smallstr16_Print(row.target, temp); - str << " -target:"; - strptr_PrintBash(temp,str); - if (!(row.in == "data")) { - ch_RemoveAll(temp); - cstring_Print(row.in, temp); - str << " -in:"; - strptr_PrintBash(temp,str); - } - ind_beg(mdbg_args_curs,value,row) { - ch_RemoveAll(temp); - cstring_Print(value, temp); - str << " -args:"; - strptr_PrintBash(temp,str); - }ind_end; - if (!(row.cfg == "debug")) { - ch_RemoveAll(temp); - Smallstr50_Print(row.cfg, temp); - str << " -cfg:"; - strptr_PrintBash(temp,str); - } - if (!(row.disas == false)) { - ch_RemoveAll(temp); - bool_Print(row.disas, temp); - str << " -disas:"; - strptr_PrintBash(temp,str); - } - if (!(row.attach == false)) { - ch_RemoveAll(temp); - bool_Print(row.attach, temp); - str << " -attach:"; - strptr_PrintBash(temp,str); - } - ind_beg(mdbg_b_curs,value,row) { - ch_RemoveAll(temp); - cstring_Print(value, temp); - str << " -b:"; - strptr_PrintBash(temp,str); - }ind_end; - if (!(row.catchthrow == true)) { - ch_RemoveAll(temp); - bool_Print(row.catchthrow, temp); - str << " -catchthrow:"; - strptr_PrintBash(temp,str); - } - if (!(row.tui == false)) { - ch_RemoveAll(temp); - bool_Print(row.tui, temp); - str << " -tui:"; - strptr_PrintBash(temp,str); - } - if (!(row.bcmd == "")) { + if (!(row.writessimfile == false)) { ch_RemoveAll(temp); - cstring_Print(row.bcmd, temp); - str << " -bcmd:"; + bool_Print(row.writessimfile, temp); + str << " -writessimfile:"; strptr_PrintBash(temp,str); } - if (!(row.emacs == true)) { + ch_RemoveAll(temp); + cstring_Print(row.url, temp); + str << " -url:"; + strptr_PrintBash(temp,str); + ch_RemoveAll(temp); + cstring_Print(row.tables, temp); + str << " -tables:"; + strptr_PrintBash(temp,str); + if (!(row.schema == false)) { ch_RemoveAll(temp); - bool_Print(row.emacs, temp); - str << " -emacs:"; + bool_Print(row.schema, temp); + str << " -schema:"; strptr_PrintBash(temp,str); } - if (!(row.manywin == false)) { + if (!(row.in == "data")) { ch_RemoveAll(temp); - bool_Print(row.manywin, temp); - str << " -manywin:"; + cstring_Print(row.in, temp); + str << " -in:"; strptr_PrintBash(temp,str); } - if (!(row.follow_child == false)) { + if (!(row.pretty == false)) { ch_RemoveAll(temp); - bool_Print(row.follow_child, temp); - str << " -follow_child:"; + bool_Print(row.pretty, temp); + str << " -pretty:"; strptr_PrintBash(temp,str); } - if (!(row.py == false)) { + if (!(row.nologo == false)) { ch_RemoveAll(temp); - bool_Print(row.py, temp); - str << " -py:"; + bool_Print(row.nologo, temp); + str << " -nologo:"; strptr_PrintBash(temp,str); } - if (!(row.dry_run == false)) { + if (!(row.baddbok == false)) { ch_RemoveAll(temp); - bool_Print(row.dry_run, temp); - str << " -dry_run:"; + bool_Print(row.baddbok, temp); + str << " -baddbok:"; strptr_PrintBash(temp,str); } } -// --- command.mdbg..GetAnon -algo::strptr command::mdbg_GetAnon(command::mdbg &parent, i32 idx) { +// --- command.mysql2ssim..GetAnon +algo::strptr command::mysql2ssim_GetAnon(command::mysql2ssim &parent, i32 idx) { (void)parent;//only to avoid -Wunused-parameter switch(idx) { - case(0): return strptr("target", 6); - default: return strptr("args", 4); + case(0): return strptr("url", 3); + case(1): return strptr("tables", 6); + default: return algo::strptr(); } } -// --- command.mdbg..NArgs +// --- command.mysql2ssim..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::mdbg_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::mysql2ssim_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_target: { // $comment - *out_anon = true; - } break; - case command_FieldId_in: { // $comment - *out_anon = false; - } break; - case command_FieldId_args: { // $comment - *out_anon = true; - } break; - case command_FieldId_cfg: { // $comment - *out_anon = false; - } break; - case command_FieldId_disas: { // $comment - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_attach: { // bool: no argument required but value may be specified as disas:Y - *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_b: { // bool: no argument required but value may be specified as attach:Y - *out_anon = false; - } break; - case command_FieldId_catchthrow: { // bool: no argument required but value may be specified as attach:Y + case command_FieldId_writessimfile: { // bool: no argument required but value may be specified as writessimfile:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_tui: { // bool: no argument required but value may be specified as catchthrow:Y - *out_anon = false; - retval=0; - out_dflt="Y"; + case command_FieldId_url: { // + *out_anon = true; } break; - case command_FieldId_bcmd: { // bool: no argument required but value may be specified as tui:Y - *out_anon = false; + case command_FieldId_tables: { // + *out_anon = true; } break; - case command_FieldId_emacs: { // bool: no argument required but value may be specified as tui:Y + case command_FieldId_schema: { // bool: no argument required but value may be specified as schema:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_manywin: { // bool: no argument required but value may be specified as emacs:Y + case command_FieldId_in: { // *out_anon = false; - retval=0; - out_dflt="Y"; } break; - case command_FieldId_follow_child: { // bool: no argument required but value may be specified as manywin:Y + case command_FieldId_pretty: { // bool: no argument required but value may be specified as pretty:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_py: { // bool: no argument required but value may be specified as follow_child:Y + case command_FieldId_nologo: { // bool: no argument required but value may be specified as nologo:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_dry_run: { // bool: no argument required but value may be specified as py:Y + case command_FieldId_baddbok: { // bool: no argument required but value may be specified as baddbok:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -18137,62 +20023,16 @@ i32 command::mdbg_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* ou return retval; } -// --- command.mdbg..AssignOp -command::mdbg& command::mdbg::operator =(const command::mdbg &rhs) { - target = rhs.target; - in = rhs.in; - args_Setary(*this, args_Getary(const_cast(rhs))); - cfg = rhs.cfg; - disas = rhs.disas; - attach = rhs.attach; - b_Setary(*this, b_Getary(const_cast(rhs))); - catchthrow = rhs.catchthrow; - tui = rhs.tui; - bcmd = rhs.bcmd; - emacs = rhs.emacs; - manywin = rhs.manywin; - follow_child = rhs.follow_child; - py = rhs.py; - dry_run = rhs.dry_run; - return *this; -} - -// --- command.mdbg..CopyCtor - command::mdbg::mdbg(const command::mdbg &rhs) - : target(rhs.target) - , in(rhs.in) - , cfg(rhs.cfg) - , disas(rhs.disas) - , attach(rhs.attach) - , catchthrow(rhs.catchthrow) - , tui(rhs.tui) - , bcmd(rhs.bcmd) - , emacs(rhs.emacs) - , manywin(rhs.manywin) - , follow_child(rhs.follow_child) - , py(rhs.py) - , dry_run(rhs.dry_run) - { - args_elems = 0; // (command.mdbg.args) - args_n = 0; // (command.mdbg.args) - args_max = 0; // (command.mdbg.args) - args_Setary(*this, args_Getary(const_cast(rhs))); - b_elems = 0; // (command.mdbg.b) - b_n = 0; // (command.mdbg.b) - b_max = 0; // (command.mdbg.b) - b_Setary(*this, b_Getary(const_cast(rhs))); -} - -// --- command.mdbg_proc.mdbg.Start +// --- command.mysql2ssim_proc.mysql2ssim.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::mdbg_Start(command::mdbg_proc& parent) { +int command::mysql2ssim_Start(command::mysql2ssim_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(mdbg_ToCmdline(parent)); // maybe print command + verblog(mysql2ssim_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(mdbg_ToCmdline(parent)); + tempstr cmdline(mysql2ssim_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -18204,10 +20044,10 @@ int command::mdbg_Start(command::mdbg_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= mdbg_Execv(parent); + if (retval==0) retval= mysql2ssim_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.mdbg_execv" + prerr("command.mysql2ssim_execv" <&" << pipefd[1]; - mdbg_Start(parent); + mysql2ssim_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.mdbg_proc.mdbg.Kill +// --- command.mysql2ssim_proc.mysql2ssim.Kill // Kill subprocess and wait -void command::mdbg_Kill(command::mdbg_proc& parent) { - if (parent.pid != 0) { +void command::mysql2ssim_Kill(command::mysql2ssim_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - mdbg_Wait(parent); + mysql2ssim_Wait(parent); } } -// --- command.mdbg_proc.mdbg.Wait +// --- command.mysql2ssim_proc.mysql2ssim.Wait // Wait for subprocess to return -void command::mdbg_Wait(command::mdbg_proc& parent) { +void command::mysql2ssim_Wait(command::mysql2ssim_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -18262,31 +20102,31 @@ void command::mdbg_Wait(command::mdbg_proc& parent) { } } -// --- command.mdbg_proc.mdbg.Exec +// --- command.mysql2ssim_proc.mysql2ssim.Exec // Start + Wait // Execute subprocess and return exit code -int command::mdbg_Exec(command::mdbg_proc& parent) { - mdbg_Start(parent); - mdbg_Wait(parent); +int command::mysql2ssim_Exec(command::mysql2ssim_proc& parent) { + mysql2ssim_Start(parent); + mysql2ssim_Wait(parent); return parent.status; } -// --- command.mdbg_proc.mdbg.ExecX +// --- command.mysql2ssim_proc.mysql2ssim.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::mdbg_ExecX(command::mdbg_proc& parent) { - int rc = mdbg_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",mdbg_ToCmdline(parent)) +void command::mysql2ssim_ExecX(command::mysql2ssim_proc& parent) { + int rc = mysql2ssim_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",mysql2ssim_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.mdbg_proc.mdbg.Execv +// --- command.mysql2ssim_proc.mysql2ssim.Execv // Call execv() // Call execv with specified parameters -int command::mdbg_Execv(command::mdbg_proc& parent) { +int command::mysql2ssim_Execv(command::mysql2ssim_proc& parent) { int ret = 0; algo::StringAry args; - mdbg_ToArgv(parent, args); + mysql2ssim_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -18298,11 +20138,11 @@ int command::mdbg_Execv(command::mdbg_proc& parent) { return ret; } -// --- command.mdbg_proc.mdbg.ToCmdline -algo::tempstr command::mdbg_ToCmdline(command::mdbg_proc& parent) { +// --- command.mysql2ssim_proc.mysql2ssim.ToCmdline +algo::tempstr command::mysql2ssim_ToCmdline(command::mysql2ssim_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::mdbg_PrintArgv(parent.cmd,retval); + command::mysql2ssim_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -18315,151 +20155,115 @@ algo::tempstr command::mdbg_ToCmdline(command::mdbg_proc& parent) { return retval; } -// --- command.mdbg_proc.mdbg.ToArgv +// --- command.mysql2ssim_proc.mysql2ssim.ToArgv // Form array from the command line -void command::mdbg_ToArgv(command::mdbg_proc& parent, algo::StringAry& args) { +void command::mysql2ssim_ToArgv(command::mysql2ssim_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; - if (true) { - cstring *arg = &ary_Alloc(args); - *arg << "-target:"; - Smallstr16_Print(parent.cmd.target, *arg); - } - - if (parent.cmd.in != "data") { - cstring *arg = &ary_Alloc(args); - *arg << "-in:"; - cstring_Print(parent.cmd.in, *arg); - } - ind_beg(command::mdbg_args_curs,value,parent.cmd) { - cstring *arg = &ary_Alloc(args); - *arg << "-args:"; - cstring_Print(value, *arg); - }ind_end; - - if (parent.cmd.cfg != "debug") { - cstring *arg = &ary_Alloc(args); - *arg << "-cfg:"; - Smallstr50_Print(parent.cmd.cfg, *arg); - } - - if (parent.cmd.disas != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-disas:"; - bool_Print(parent.cmd.disas, *arg); - } - - if (parent.cmd.attach != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-attach:"; - bool_Print(parent.cmd.attach, *arg); - } - ind_beg(command::mdbg_b_curs,value,parent.cmd) { - cstring *arg = &ary_Alloc(args); - *arg << "-b:"; - cstring_Print(value, *arg); - }ind_end; - - if (parent.cmd.catchthrow != true) { + if (parent.cmd.writessimfile != false) { cstring *arg = &ary_Alloc(args); - *arg << "-catchthrow:"; - bool_Print(parent.cmd.catchthrow, *arg); + *arg << "-writessimfile:"; + bool_Print(parent.cmd.writessimfile, *arg); } - if (parent.cmd.tui != false) { + if (true) { cstring *arg = &ary_Alloc(args); - *arg << "-tui:"; - bool_Print(parent.cmd.tui, *arg); + *arg << "-url:"; + cstring_Print(parent.cmd.url, *arg); } - if (parent.cmd.bcmd != "") { + if (parent.cmd.tables != "") { cstring *arg = &ary_Alloc(args); - *arg << "-bcmd:"; - cstring_Print(parent.cmd.bcmd, *arg); + *arg << "-tables:"; + cstring_Print(parent.cmd.tables, *arg); } - if (parent.cmd.emacs != true) { + if (parent.cmd.schema != false) { cstring *arg = &ary_Alloc(args); - *arg << "-emacs:"; - bool_Print(parent.cmd.emacs, *arg); + *arg << "-schema:"; + bool_Print(parent.cmd.schema, *arg); } - if (parent.cmd.manywin != false) { + if (parent.cmd.in != "data") { cstring *arg = &ary_Alloc(args); - *arg << "-manywin:"; - bool_Print(parent.cmd.manywin, *arg); + *arg << "-in:"; + cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.follow_child != false) { + if (parent.cmd.pretty != false) { cstring *arg = &ary_Alloc(args); - *arg << "-follow_child:"; - bool_Print(parent.cmd.follow_child, *arg); + *arg << "-pretty:"; + bool_Print(parent.cmd.pretty, *arg); } - if (parent.cmd.py != false) { + if (parent.cmd.nologo != false) { cstring *arg = &ary_Alloc(args); - *arg << "-py:"; - bool_Print(parent.cmd.py, *arg); + *arg << "-nologo:"; + bool_Print(parent.cmd.nologo, *arg); } - if (parent.cmd.dry_run != false) { + if (parent.cmd.baddbok != false) { cstring *arg = &ary_Alloc(args); - *arg << "-dry_run:"; - bool_Print(parent.cmd.dry_run, *arg); + *arg << "-baddbok:"; + bool_Print(parent.cmd.baddbok, *arg); } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } } -// --- command.mdbg_proc..Uninit -void command::mdbg_proc_Uninit(command::mdbg_proc& parent) { - command::mdbg_proc &row = parent; (void)row; +// --- command.mysql2ssim_proc..Uninit +void command::mysql2ssim_proc_Uninit(command::mysql2ssim_proc& parent) { + command::mysql2ssim_proc &row = parent; (void)row; - // command.mdbg_proc.mdbg.Uninit (Exec) // - mdbg_Kill(parent); // kill child, ensure forward progress + // command.mysql2ssim_proc.mysql2ssim.Uninit (Exec) // + mysql2ssim_Kill(parent); // kill child, ensure forward progress } -// --- command.mysql2ssim..ReadFieldMaybe -bool command::mysql2ssim_ReadFieldMaybe(command::mysql2ssim& parent, algo::strptr field, algo::strptr strval) { +// --- command.orgfile.dedup.Print +// Print back to string +void command::dedup_Print(command::orgfile& parent, algo::cstring &out) { + Regx_Print(parent.dedup, out); +} + +// --- command.orgfile.dedup.ReadStrptrMaybe +// Read Regx from string +// Convert string to field. Return success value +bool command::dedup_ReadStrptrMaybe(command::orgfile& parent, algo::strptr in) { + bool retval = true; + Regx_ReadSql(parent.dedup, in, true); + return retval; +} + +// --- command.orgfile..ReadFieldMaybe +bool command::orgfile_ReadFieldMaybe(command::orgfile& parent, algo::strptr field, algo::strptr strval) { bool retval = true; command::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case command_FieldId_writessimfile: { - retval = bool_ReadStrptrMaybe(parent.writessimfile, strval); - break; - } - case command_FieldId_url: { - retval = algo::cstring_ReadStrptrMaybe(parent.url, strval); - break; - } - case command_FieldId_tables: { - retval = algo::cstring_ReadStrptrMaybe(parent.tables, strval); - break; - } - case command_FieldId_schema: { - retval = bool_ReadStrptrMaybe(parent.schema, strval); - break; - } case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_pretty: { - retval = bool_ReadStrptrMaybe(parent.pretty, strval); - break; - } - case command_FieldId_nologo: { - retval = bool_ReadStrptrMaybe(parent.nologo, strval); - break; - } - case command_FieldId_baddbok: { - retval = bool_ReadStrptrMaybe(parent.baddbok, strval); - break; - } - default: break; + } break; + case command_FieldId_move: { + retval = algo::cstring_ReadStrptrMaybe(parent.move, strval); + } break; + case command_FieldId_dedup: { + retval = dedup_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_commit: { + retval = bool_ReadStrptrMaybe(parent.commit, strval); + } break; + case command_FieldId_undo: { + retval = bool_ReadStrptrMaybe(parent.undo, strval); + } break; + case command_FieldId_hash: { + retval = algo::cstring_ReadStrptrMaybe(parent.hash, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -18467,16 +20271,12 @@ bool command::mysql2ssim_ReadFieldMaybe(command::mysql2ssim& parent, algo::strpt return retval; } -// --- command.mysql2ssim..ReadTupleMaybe -// Read fields of command::mysql2ssim from attributes of ascii tuple TUPLE -bool command::mysql2ssim_ReadTupleMaybe(command::mysql2ssim &parent, algo::Tuple &tuple) { +// --- command.orgfile..ReadTupleMaybe +// Read fields of command::orgfile from attributes of ascii tuple TUPLE +bool command::orgfile_ReadTupleMaybe(command::orgfile &parent, algo::Tuple &tuple) { bool retval = true; - int anon_idx = 0; ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - if (ch_N(attr.name) == 0) { - attr.name = mysql2ssim_GetAnon(parent, anon_idx++); - } - retval = mysql2ssim_ReadFieldMaybe(parent, attr.name, attr.value); + retval = orgfile_ReadFieldMaybe(parent, attr.name, attr.value); if (!retval) { break; } @@ -18484,13 +20284,24 @@ bool command::mysql2ssim_ReadTupleMaybe(command::mysql2ssim &parent, algo::Tuple return retval; } -// --- command.mysql2ssim..ToCmdline +// --- command.orgfile..Init +// Set all fields to initial values. +void command::orgfile_Init(command::orgfile& parent) { + parent.in = algo::strptr("data"); + parent.move = algo::strptr(""); + Regx_ReadSql(parent.dedup, "", true); + parent.commit = bool(false); + parent.undo = bool(false); + parent.hash = algo::strptr("sha1"); +} + +// --- command.orgfile..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::mysql2ssim_ToCmdline(command::mysql2ssim& row) { +tempstr command::orgfile_ToCmdline(command::orgfile& row) { tempstr ret; - ret << "bin/mysql2ssim "; - mysql2ssim_PrintArgv(row, ret); + ret << "bin/orgfile "; + orgfile_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -18501,109 +20312,79 @@ tempstr command::mysql2ssim_ToCmdline(command::mysql2ssim& row) { return ret; } -// --- command.mysql2ssim..PrintArgv +// --- command.orgfile..PrintArgv // print string representation of ROW to string STR -// cfmt:command.mysql2ssim.Argv printfmt:Auto -void command::mysql2ssim_PrintArgv(command::mysql2ssim& row, algo::cstring& str) { +// cfmt:command.orgfile.Argv printfmt:Tuple +void command::orgfile_PrintArgv(command::orgfile& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; - if (!(row.writessimfile == false)) { + if (!(row.in == "data")) { ch_RemoveAll(temp); - bool_Print(row.writessimfile, temp); - str << " -writessimfile:"; + cstring_Print(row.in, temp); + str << " -in:"; strptr_PrintBash(temp,str); } - ch_RemoveAll(temp); - cstring_Print(row.url, temp); - str << " -url:"; - strptr_PrintBash(temp,str); - ch_RemoveAll(temp); - cstring_Print(row.tables, temp); - str << " -tables:"; - strptr_PrintBash(temp,str); - if (!(row.schema == false)) { + if (!(row.move == "")) { ch_RemoveAll(temp); - bool_Print(row.schema, temp); - str << " -schema:"; + cstring_Print(row.move, temp); + str << " -move:"; strptr_PrintBash(temp,str); } - if (!(row.in == "data")) { + if (!(row.dedup.expr == "")) { ch_RemoveAll(temp); - cstring_Print(row.in, temp); - str << " -in:"; + command::dedup_Print(const_cast(row), temp); + str << " -dedup:"; strptr_PrintBash(temp,str); } - if (!(row.pretty == false)) { + if (!(row.commit == false)) { ch_RemoveAll(temp); - bool_Print(row.pretty, temp); - str << " -pretty:"; + bool_Print(row.commit, temp); + str << " -commit:"; strptr_PrintBash(temp,str); } - if (!(row.nologo == false)) { + if (!(row.undo == false)) { ch_RemoveAll(temp); - bool_Print(row.nologo, temp); - str << " -nologo:"; + bool_Print(row.undo, temp); + str << " -undo:"; strptr_PrintBash(temp,str); } - if (!(row.baddbok == false)) { + if (!(row.hash == "sha1")) { ch_RemoveAll(temp); - bool_Print(row.baddbok, temp); - str << " -baddbok:"; + cstring_Print(row.hash, temp); + str << " -hash:"; strptr_PrintBash(temp,str); } } -// --- command.mysql2ssim..GetAnon -algo::strptr command::mysql2ssim_GetAnon(command::mysql2ssim &parent, i32 idx) { - (void)parent;//only to avoid -Wunused-parameter - switch(idx) { - case(0): return strptr("url", 3); - case(1): return strptr("tables", 6); - default: return algo::strptr(); - } -} - -// --- command.mysql2ssim..NArgs +// --- command.orgfile..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::mysql2ssim_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::orgfile_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_writessimfile: { // $comment + case command_FieldId_in: { // *out_anon = false; - retval=0; - out_dflt="Y"; - } break; - case command_FieldId_url: { // bool: no argument required but value may be specified as writessimfile:Y - *out_anon = true; - } break; - case command_FieldId_tables: { // bool: no argument required but value may be specified as writessimfile:Y - *out_anon = true; } break; - case command_FieldId_schema: { // bool: no argument required but value may be specified as writessimfile:Y + case command_FieldId_move: { // *out_anon = false; - retval=0; - out_dflt="Y"; } break; - case command_FieldId_in: { // bool: no argument required but value may be specified as schema:Y + case command_FieldId_dedup: { // *out_anon = false; } break; - case command_FieldId_pretty: { // bool: no argument required but value may be specified as schema:Y + case command_FieldId_commit: { // bool: no argument required but value may be specified as commit:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_nologo: { // bool: no argument required but value may be specified as pretty:Y + case command_FieldId_undo: { // bool: no argument required but value may be specified as undo:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_baddbok: { // bool: no argument required but value may be specified as nologo:Y + case command_FieldId_hash: { // *out_anon = false; - retval=0; - out_dflt="Y"; } break; default: retval=-1; // unrecognized @@ -18611,16 +20392,16 @@ i32 command::mysql2ssim_NArgs(command::FieldId field, algo::strptr& out_dflt, bo return retval; } -// --- command.mysql2ssim_proc.mysql2ssim.Start +// --- command.orgfile_proc.orgfile.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::mysql2ssim_Start(command::mysql2ssim_proc& parent) { +int command::orgfile_Start(command::orgfile_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(mysql2ssim_ToCmdline(parent)); // maybe print command + verblog(orgfile_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(mysql2ssim_ToCmdline(parent)); + tempstr cmdline(orgfile_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -18632,10 +20413,10 @@ int command::mysql2ssim_Start(command::mysql2ssim_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= mysql2ssim_Execv(parent); + if (retval==0) retval= orgfile_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.mysql2ssim_execv" + prerr("command.orgfile_execv" <&" << pipefd[1]; - mysql2ssim_Start(parent); + orgfile_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.mysql2ssim_proc.mysql2ssim.Kill +// --- command.orgfile_proc.orgfile.Kill // Kill subprocess and wait -void command::mysql2ssim_Kill(command::mysql2ssim_proc& parent) { - if (parent.pid != 0) { +void command::orgfile_Kill(command::orgfile_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - mysql2ssim_Wait(parent); + orgfile_Wait(parent); } } -// --- command.mysql2ssim_proc.mysql2ssim.Wait +// --- command.orgfile_proc.orgfile.Wait // Wait for subprocess to return -void command::mysql2ssim_Wait(command::mysql2ssim_proc& parent) { +void command::orgfile_Wait(command::orgfile_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -18690,31 +20471,31 @@ void command::mysql2ssim_Wait(command::mysql2ssim_proc& parent) { } } -// --- command.mysql2ssim_proc.mysql2ssim.Exec +// --- command.orgfile_proc.orgfile.Exec // Start + Wait // Execute subprocess and return exit code -int command::mysql2ssim_Exec(command::mysql2ssim_proc& parent) { - mysql2ssim_Start(parent); - mysql2ssim_Wait(parent); +int command::orgfile_Exec(command::orgfile_proc& parent) { + orgfile_Start(parent); + orgfile_Wait(parent); return parent.status; } -// --- command.mysql2ssim_proc.mysql2ssim.ExecX +// --- command.orgfile_proc.orgfile.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::mysql2ssim_ExecX(command::mysql2ssim_proc& parent) { - int rc = mysql2ssim_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",mysql2ssim_ToCmdline(parent)) +void command::orgfile_ExecX(command::orgfile_proc& parent) { + int rc = orgfile_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",orgfile_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.mysql2ssim_proc.mysql2ssim.Execv +// --- command.orgfile_proc.orgfile.Execv // Call execv() // Call execv with specified parameters -int command::mysql2ssim_Execv(command::mysql2ssim_proc& parent) { +int command::orgfile_Execv(command::orgfile_proc& parent) { int ret = 0; algo::StringAry args; - mysql2ssim_ToArgv(parent, args); + orgfile_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -18726,11 +20507,11 @@ int command::mysql2ssim_Execv(command::mysql2ssim_proc& parent) { return ret; } -// --- command.mysql2ssim_proc.mysql2ssim.ToCmdline -algo::tempstr command::mysql2ssim_ToCmdline(command::mysql2ssim_proc& parent) { +// --- command.orgfile_proc.orgfile.ToCmdline +algo::tempstr command::orgfile_ToCmdline(command::orgfile_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::mysql2ssim_PrintArgv(parent.cmd,retval); + command::orgfile_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -18743,118 +20524,100 @@ algo::tempstr command::mysql2ssim_ToCmdline(command::mysql2ssim_proc& parent) { return retval; } -// --- command.mysql2ssim_proc.mysql2ssim.ToArgv +// --- command.orgfile_proc.orgfile.ToArgv // Form array from the command line -void command::mysql2ssim_ToArgv(command::mysql2ssim_proc& parent, algo::StringAry& args) { +void command::orgfile_ToArgv(command::orgfile_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; - if (parent.cmd.writessimfile != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-writessimfile:"; - bool_Print(parent.cmd.writessimfile, *arg); - } - - if (true) { - cstring *arg = &ary_Alloc(args); - *arg << "-url:"; - cstring_Print(parent.cmd.url, *arg); - } - - if (parent.cmd.tables != "") { + if (parent.cmd.in != "data") { cstring *arg = &ary_Alloc(args); - *arg << "-tables:"; - cstring_Print(parent.cmd.tables, *arg); + *arg << "-in:"; + cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.schema != false) { + if (parent.cmd.move != "") { cstring *arg = &ary_Alloc(args); - *arg << "-schema:"; - bool_Print(parent.cmd.schema, *arg); + *arg << "-move:"; + cstring_Print(parent.cmd.move, *arg); } - if (parent.cmd.in != "data") { + if (parent.cmd.dedup.expr != "") { cstring *arg = &ary_Alloc(args); - *arg << "-in:"; - cstring_Print(parent.cmd.in, *arg); + *arg << "-dedup:"; + command::dedup_Print(parent.cmd, *arg); } - if (parent.cmd.pretty != false) { + if (parent.cmd.commit != false) { cstring *arg = &ary_Alloc(args); - *arg << "-pretty:"; - bool_Print(parent.cmd.pretty, *arg); + *arg << "-commit:"; + bool_Print(parent.cmd.commit, *arg); } - if (parent.cmd.nologo != false) { + if (parent.cmd.undo != false) { cstring *arg = &ary_Alloc(args); - *arg << "-nologo:"; - bool_Print(parent.cmd.nologo, *arg); + *arg << "-undo:"; + bool_Print(parent.cmd.undo, *arg); } - if (parent.cmd.baddbok != false) { + if (parent.cmd.hash != "sha1") { cstring *arg = &ary_Alloc(args); - *arg << "-baddbok:"; - bool_Print(parent.cmd.baddbok, *arg); + *arg << "-hash:"; + cstring_Print(parent.cmd.hash, *arg); } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } } -// --- command.mysql2ssim_proc..Uninit -void command::mysql2ssim_proc_Uninit(command::mysql2ssim_proc& parent) { - command::mysql2ssim_proc &row = parent; (void)row; +// --- command.orgfile_proc..Uninit +void command::orgfile_proc_Uninit(command::orgfile_proc& parent) { + command::orgfile_proc &row = parent; (void)row; - // command.mysql2ssim_proc.mysql2ssim.Uninit (Exec) // - mysql2ssim_Kill(parent); // kill child, ensure forward progress + // command.orgfile_proc.orgfile.Uninit (Exec) // + orgfile_Kill(parent); // kill child, ensure forward progress } -// --- command.orgfile.dedup.Print +// --- command.samp_make.target.Print // Print back to string -void command::dedup_Print(command::orgfile& parent, algo::cstring &out) { - Regx_Print(parent.dedup, out); +void command::target_Print(command::samp_make& parent, algo::cstring &out) { + Regx_Print(parent.target, out); } -// --- command.orgfile.dedup.ReadStrptrMaybe +// --- command.samp_make.target.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::dedup_ReadStrptrMaybe(command::orgfile& parent, algo::strptr in) { +bool command::target_ReadStrptrMaybe(command::samp_make& parent, algo::strptr in) { bool retval = true; - Regx_ReadSql(parent.dedup, in, true); + Regx_ReadSql(parent.target, in, true); return retval; } -// --- command.orgfile..ReadFieldMaybe -bool command::orgfile_ReadFieldMaybe(command::orgfile& parent, algo::strptr field, algo::strptr strval) { +// --- command.samp_make..ReadFieldMaybe +bool command::samp_make_ReadFieldMaybe(command::samp_make& parent, algo::strptr field, algo::strptr strval) { bool retval = true; command::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_move: { - retval = algo::cstring_ReadStrptrMaybe(parent.move, strval); - break; - } - case command_FieldId_dedup: { - retval = dedup_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_commit: { - retval = bool_ReadStrptrMaybe(parent.commit, strval); - break; - } - case command_FieldId_undo: { - retval = bool_ReadStrptrMaybe(parent.undo, strval); - break; - } - case command_FieldId_hash: { - retval = algo::cstring_ReadStrptrMaybe(parent.hash, strval); - break; - } - default: break; + } break; + case command_FieldId_target: { + retval = target_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_parse_make: { + retval = bool_ReadStrptrMaybe(parent.parse_make, strval); + } break; + case command_FieldId_makefile: { + retval = algo::cstring_ReadStrptrMaybe(parent.makefile, strval); + } break; + case command_FieldId_write: { + retval = bool_ReadStrptrMaybe(parent.write, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -18862,12 +20625,12 @@ bool command::orgfile_ReadFieldMaybe(command::orgfile& parent, algo::strptr fiel return retval; } -// --- command.orgfile..ReadTupleMaybe -// Read fields of command::orgfile from attributes of ascii tuple TUPLE -bool command::orgfile_ReadTupleMaybe(command::orgfile &parent, algo::Tuple &tuple) { +// --- command.samp_make..ReadTupleMaybe +// Read fields of command::samp_make from attributes of ascii tuple TUPLE +bool command::samp_make_ReadTupleMaybe(command::samp_make &parent, algo::Tuple &tuple) { bool retval = true; ind_beg(algo::Tuple_attrs_curs,attr,tuple) { - retval = orgfile_ReadFieldMaybe(parent, attr.name, attr.value); + retval = samp_make_ReadFieldMaybe(parent, attr.name, attr.value); if (!retval) { break; } @@ -18875,24 +20638,23 @@ bool command::orgfile_ReadTupleMaybe(command::orgfile &parent, algo::Tuple &tupl return retval; } -// --- command.orgfile..Init +// --- command.samp_make..Init // Set all fields to initial values. -void command::orgfile_Init(command::orgfile& parent) { +void command::samp_make_Init(command::samp_make& parent) { parent.in = algo::strptr("data"); - parent.move = algo::strptr(""); - Regx_ReadSql(parent.dedup, "", true); - parent.commit = bool(false); - parent.undo = bool(false); - parent.hash = algo::strptr("sha1"); + Regx_ReadSql(parent.target, "%", true); + parent.parse_make = bool(false); + parent.makefile = algo::strptr("extern/gnumake/Simple-Makefile"); + parent.write = bool(false); } -// --- command.orgfile..ToCmdline +// --- command.samp_make..ToCmdline // Convenience function that returns a full command line // Assume command is in a directory called bin -tempstr command::orgfile_ToCmdline(command::orgfile& row) { +tempstr command::samp_make_ToCmdline(command::samp_make& row) { tempstr ret; - ret << "bin/orgfile "; - orgfile_PrintArgv(row, ret); + ret << "bin/samp_make "; + samp_make_PrintArgv(row, ret); // inherit less intense verbose, debug options for (int i = 1; i < algo_lib::_db.cmdline.verbose; i++) { ret << " -verbose"; @@ -18903,10 +20665,10 @@ tempstr command::orgfile_ToCmdline(command::orgfile& row) { return ret; } -// --- command.orgfile..PrintArgv +// --- command.samp_make..PrintArgv // print string representation of ROW to string STR -// cfmt:command.orgfile.Argv printfmt:Tuple -void command::orgfile_PrintArgv(command::orgfile& row, algo::cstring& str) { +// cfmt:command.samp_make.Argv printfmt:Tuple +void command::samp_make_PrintArgv(command::samp_make& row, algo::cstring& str) { algo::tempstr temp; (void)temp; (void)str; @@ -18916,66 +20678,57 @@ void command::orgfile_PrintArgv(command::orgfile& row, algo::cstring& str) { str << " -in:"; strptr_PrintBash(temp,str); } - if (!(row.move == "")) { - ch_RemoveAll(temp); - cstring_Print(row.move, temp); - str << " -move:"; - strptr_PrintBash(temp,str); - } - if (!(row.dedup.expr == "")) { + if (!(row.target.expr == "%")) { ch_RemoveAll(temp); - command::dedup_Print(const_cast(row), temp); - str << " -dedup:"; + command::target_Print(const_cast(row), temp); + str << " -target:"; strptr_PrintBash(temp,str); } - if (!(row.commit == false)) { + if (!(row.parse_make == false)) { ch_RemoveAll(temp); - bool_Print(row.commit, temp); - str << " -commit:"; + bool_Print(row.parse_make, temp); + str << " -parse_make:"; strptr_PrintBash(temp,str); } - if (!(row.undo == false)) { + if (!(row.makefile == "extern/gnumake/Simple-Makefile")) { ch_RemoveAll(temp); - bool_Print(row.undo, temp); - str << " -undo:"; + cstring_Print(row.makefile, temp); + str << " -makefile:"; strptr_PrintBash(temp,str); } - if (!(row.hash == "sha1")) { + if (!(row.write == false)) { ch_RemoveAll(temp); - cstring_Print(row.hash, temp); - str << " -hash:"; + bool_Print(row.write, temp); + str << " -write:"; strptr_PrintBash(temp,str); } } -// --- command.orgfile..NArgs +// --- command.samp_make..NArgs // Used with command lines // Return # of command-line arguments that must follow this argument // If FIELD is invalid, return -1 -i32 command::orgfile_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { +i32 command::samp_make_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment - *out_anon = false; - } break; - case command_FieldId_move: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_dedup: { // $comment + case command_FieldId_target: { // *out_anon = false; } break; - case command_FieldId_commit: { // $comment + case command_FieldId_parse_make: { // bool: no argument required but value may be specified as parse_make:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_undo: { // bool: no argument required but value may be specified as commit:Y + case command_FieldId_makefile: { // *out_anon = false; - retval=0; - out_dflt="Y"; } break; - case command_FieldId_hash: { // bool: no argument required but value may be specified as undo:Y + case command_FieldId_write: { // bool: no argument required but value may be specified as write:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; default: retval=-1; // unrecognized @@ -18983,16 +20736,16 @@ i32 command::orgfile_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* return retval; } -// --- command.orgfile_proc.orgfile.Start +// --- command.samp_make_proc.samp_make.Start // Start subprocess // If subprocess already running, do nothing. Otherwise, start it -int command::orgfile_Start(command::orgfile_proc& parent) { +int command::samp_make_Start(command::samp_make_proc& parent) { int retval = 0; if (parent.pid == 0) { - verblog(orgfile_ToCmdline(parent)); // maybe print command + verblog(samp_make_ToCmdline(parent)); // maybe print command #ifdef WIN32 algo_lib::ResolveExecFname(parent.path); - tempstr cmdline(orgfile_ToCmdline(parent)); + tempstr cmdline(samp_make_ToCmdline(parent)); parent.pid = dospawn(Zeroterm(parent.path),Zeroterm(cmdline),parent.timeout,parent.fstdin,parent.fstdout,parent.fstderr); #else parent.pid = fork(); @@ -19004,10 +20757,10 @@ int command::orgfile_Start(command::orgfile_proc& parent) { if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdin , 0); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstdout, 1); if (retval==0) retval=algo_lib::ApplyRedirect(parent.fstderr, 2); - if (retval==0) retval= orgfile_Execv(parent); + if (retval==0) retval= samp_make_Execv(parent); if (retval != 0) { // if start fails, print error int err=errno; - prerr("command.orgfile_execv" + prerr("command.samp_make_execv" <&" << pipefd[1]; - orgfile_Start(parent); + samp_make_Start(parent); (void)close(pipefd[1]); return read.fd; } -// --- command.orgfile_proc.orgfile.Kill +// --- command.samp_make_proc.samp_make.Kill // Kill subprocess and wait -void command::orgfile_Kill(command::orgfile_proc& parent) { - if (parent.pid != 0) { +void command::samp_make_Kill(command::samp_make_proc& parent) { + if (parent.pid > 0) { kill(parent.pid,9); - orgfile_Wait(parent); + samp_make_Wait(parent); } } -// --- command.orgfile_proc.orgfile.Wait +// --- command.samp_make_proc.samp_make.Wait // Wait for subprocess to return -void command::orgfile_Wait(command::orgfile_proc& parent) { +void command::samp_make_Wait(command::samp_make_proc& parent) { if (parent.pid > 0) { int wait_flags = 0; int wait_status = 0; @@ -19062,31 +20815,31 @@ void command::orgfile_Wait(command::orgfile_proc& parent) { } } -// --- command.orgfile_proc.orgfile.Exec +// --- command.samp_make_proc.samp_make.Exec // Start + Wait // Execute subprocess and return exit code -int command::orgfile_Exec(command::orgfile_proc& parent) { - orgfile_Start(parent); - orgfile_Wait(parent); +int command::samp_make_Exec(command::samp_make_proc& parent) { + samp_make_Start(parent); + samp_make_Wait(parent); return parent.status; } -// --- command.orgfile_proc.orgfile.ExecX +// --- command.samp_make_proc.samp_make.ExecX // Start + Wait, throw exception on error // Execute subprocess; throw human-readable exception on error -void command::orgfile_ExecX(command::orgfile_proc& parent) { - int rc = orgfile_Exec(parent); - vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",orgfile_ToCmdline(parent)) +void command::samp_make_ExecX(command::samp_make_proc& parent) { + int rc = samp_make_Exec(parent); + vrfy(rc==0, tempstr() << "algo_lib.exec" << Keyval("cmd",samp_make_ToCmdline(parent)) << Keyval("comment",algo::DescribeWaitStatus(parent.status))); } -// --- command.orgfile_proc.orgfile.Execv +// --- command.samp_make_proc.samp_make.Execv // Call execv() // Call execv with specified parameters -int command::orgfile_Execv(command::orgfile_proc& parent) { +int command::samp_make_Execv(command::samp_make_proc& parent) { int ret = 0; algo::StringAry args; - orgfile_ToArgv(parent, args); + samp_make_ToArgv(parent, args); char **argv = (char**)alloca((ary_N(args)+1)*sizeof(*argv)); ind_beg(algo::StringAry_ary_curs,arg,args) { argv[ind_curs(arg).index] = Zeroterm(arg); @@ -19098,11 +20851,11 @@ int command::orgfile_Execv(command::orgfile_proc& parent) { return ret; } -// --- command.orgfile_proc.orgfile.ToCmdline -algo::tempstr command::orgfile_ToCmdline(command::orgfile_proc& parent) { +// --- command.samp_make_proc.samp_make.ToCmdline +algo::tempstr command::samp_make_ToCmdline(command::samp_make_proc& parent) { algo::tempstr retval; retval << parent.path << " "; - command::orgfile_PrintArgv(parent.cmd,retval); + command::samp_make_PrintArgv(parent.cmd,retval); if (ch_N(parent.fstdin)) { retval << " " << parent.fstdin; } @@ -19115,9 +20868,9 @@ algo::tempstr command::orgfile_ToCmdline(command::orgfile_proc& parent) { return retval; } -// --- command.orgfile_proc.orgfile.ToArgv +// --- command.samp_make_proc.samp_make.ToArgv // Form array from the command line -void command::orgfile_ToArgv(command::orgfile_proc& parent, algo::StringAry& args) { +void command::samp_make_ToArgv(command::samp_make_proc& parent, algo::StringAry& args) { ary_RemoveAll(args); ary_Alloc(args) << parent.path; @@ -19127,46 +20880,40 @@ void command::orgfile_ToArgv(command::orgfile_proc& parent, algo::StringAry& arg cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.move != "") { - cstring *arg = &ary_Alloc(args); - *arg << "-move:"; - cstring_Print(parent.cmd.move, *arg); - } - - if (parent.cmd.dedup.expr != "") { + if (parent.cmd.target.expr != "%") { cstring *arg = &ary_Alloc(args); - *arg << "-dedup:"; - command::dedup_Print(parent.cmd, *arg); + *arg << "-target:"; + command::target_Print(parent.cmd, *arg); } - if (parent.cmd.commit != false) { + if (parent.cmd.parse_make != false) { cstring *arg = &ary_Alloc(args); - *arg << "-commit:"; - bool_Print(parent.cmd.commit, *arg); + *arg << "-parse_make:"; + bool_Print(parent.cmd.parse_make, *arg); } - if (parent.cmd.undo != false) { + if (parent.cmd.makefile != "extern/gnumake/Simple-Makefile") { cstring *arg = &ary_Alloc(args); - *arg << "-undo:"; - bool_Print(parent.cmd.undo, *arg); + *arg << "-makefile:"; + cstring_Print(parent.cmd.makefile, *arg); } - if (parent.cmd.hash != "sha1") { + if (parent.cmd.write != false) { cstring *arg = &ary_Alloc(args); - *arg << "-hash:"; - cstring_Print(parent.cmd.hash, *arg); + *arg << "-write:"; + bool_Print(parent.cmd.write, *arg); } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } } -// --- command.orgfile_proc..Uninit -void command::orgfile_proc_Uninit(command::orgfile_proc& parent) { - command::orgfile_proc &row = parent; (void)row; +// --- command.samp_make_proc..Uninit +void command::samp_make_proc_Uninit(command::samp_make_proc& parent) { + command::samp_make_proc &row = parent; (void)row; - // command.orgfile_proc.orgfile.Uninit (Exec) // - orgfile_Kill(parent); // kill child, ensure forward progress + // command.samp_make_proc.samp_make.Uninit (Exec) // + samp_make_Kill(parent); // kill child, ensure forward progress } // --- command.samp_meng..ReadFieldMaybe @@ -19177,9 +20924,11 @@ bool command::samp_meng_ReadFieldMaybe(command::samp_meng& parent, algo::strptr switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -19239,7 +20988,7 @@ void command::samp_meng_PrintArgv(command::samp_meng& row, algo::cstring& str) { i32 command::samp_meng_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; default: @@ -19304,7 +21053,7 @@ algo::Fildes command::samp_meng_StartRead(command::samp_meng_proc& parent, algo_ // --- command.samp_meng_proc.samp_meng.Kill // Kill subprocess and wait void command::samp_meng_Kill(command::samp_meng_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); samp_meng_Wait(parent); } @@ -19405,88 +21154,6 @@ void command::samp_meng_proc_Uninit(command::samp_meng_proc& parent) { samp_meng_Kill(parent); // kill child, ensure forward progress } -// --- command.samp_regx.style.ToCstr -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -const char* command::style_ToCstr(const command::samp_regx& parent) { - const char *ret = NULL; - switch(style_GetEnum(parent)) { - case command_samp_regx_style_acr : ret = "acr"; break; - case command_samp_regx_style_shell : ret = "shell"; break; - case command_samp_regx_style_classic: ret = "classic"; break; - case command_samp_regx_style_literal: ret = "literal"; break; - } - return ret; -} - -// --- command.samp_regx.style.Print -// Convert style to a string. First, attempt conversion to a known string. -// If no string matches, print style as a numeric value. -void command::style_Print(const command::samp_regx& parent, algo::cstring &lhs) { - const char *strval = style_ToCstr(parent); - if (strval) { - lhs << strval; - } else { - lhs << parent.style; - } -} - -// --- command.samp_regx.style.SetStrptrMaybe -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -bool command::style_SetStrptrMaybe(command::samp_regx& parent, algo::strptr rhs) { - bool ret = false; - switch (elems_N(rhs)) { - case 3: { - switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { - case LE_STR3('a','c','r'): { - style_SetEnum(parent,command_samp_regx_style_acr); ret = true; break; - } - } - break; - } - case 5: { - switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { - case LE_STR5('s','h','e','l','l'): { - style_SetEnum(parent,command_samp_regx_style_shell); ret = true; break; - } - } - break; - } - case 7: { - switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { - case LE_STR7('c','l','a','s','s','i','c'): { - style_SetEnum(parent,command_samp_regx_style_classic); ret = true; break; - } - case LE_STR7('l','i','t','e','r','a','l'): { - style_SetEnum(parent,command_samp_regx_style_literal); ret = true; break; - } - } - break; - } - } - return ret; -} - -// --- command.samp_regx.style.SetStrptr -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -void command::style_SetStrptr(command::samp_regx& parent, algo::strptr rhs, command_samp_regx_style_Enum dflt) { - if (!style_SetStrptrMaybe(parent,rhs)) style_SetEnum(parent,dflt); -} - -// --- command.samp_regx.style.ReadStrptrMaybe -// Convert string to field. Return success value -bool command::style_ReadStrptrMaybe(command::samp_regx& parent, algo::strptr rhs) { - bool retval = false; - retval = style_SetStrptrMaybe(parent,rhs); // try symbol conversion - if (!retval) { // didn't work? try reading as underlying type - retval = u8_ReadStrptrMaybe(parent.style,rhs); - } - return retval; -} - // --- command.samp_regx..ReadFieldMaybe bool command::samp_regx_ReadFieldMaybe(command::samp_regx& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -19495,29 +21162,35 @@ bool command::samp_regx_ReadFieldMaybe(command::samp_regx& parent, algo::strptr switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_expr: { retval = algo::cstring_ReadStrptrMaybe(parent.expr, strval); - break; - } + } break; case command_FieldId_style: { - retval = style_ReadStrptrMaybe(parent, strval); - break; - } + retval = algo_lib::RegxStyle_ReadStrptrMaybe(parent.style, strval); + } break; + case command_FieldId_trace: { + retval = bool_ReadStrptrMaybe(parent.trace, strval); + } break; + case command_FieldId_capture: { + retval = bool_ReadStrptrMaybe(parent.capture, strval); + } break; + case command_FieldId_full: { + retval = bool_ReadStrptrMaybe(parent.full, strval); + } break; + case command_FieldId_f: { + retval = bool_ReadStrptrMaybe(parent.f, strval); + } break; case command_FieldId_match: { retval = bool_ReadStrptrMaybe(parent.match, strval); - break; - } + } break; case command_FieldId_string: { retval = algo::cstring_ReadStrptrMaybe(parent.string, strval); - break; - } - case command_FieldId_show: { - retval = bool_ReadStrptrMaybe(parent.show, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -19576,12 +21249,36 @@ void command::samp_regx_PrintArgv(command::samp_regx& row, algo::cstring& str) { cstring_Print(row.expr, temp); str << " -expr:"; strptr_PrintBash(temp,str); - if (!(row.style == 0)) { + if (!(row.style == 2)) { ch_RemoveAll(temp); - command::style_Print(const_cast(row), temp); + RegxStyle_Print(row.style, temp); str << " -style:"; strptr_PrintBash(temp,str); } + if (!(row.trace == false)) { + ch_RemoveAll(temp); + bool_Print(row.trace, temp); + str << " -trace:"; + strptr_PrintBash(temp,str); + } + if (!(row.capture == false)) { + ch_RemoveAll(temp); + bool_Print(row.capture, temp); + str << " -capture:"; + strptr_PrintBash(temp,str); + } + if (!(row.full == true)) { + ch_RemoveAll(temp); + bool_Print(row.full, temp); + str << " -full:"; + strptr_PrintBash(temp,str); + } + if (!(row.f == false)) { + ch_RemoveAll(temp); + bool_Print(row.f, temp); + str << " -f:"; + strptr_PrintBash(temp,str); + } if (!(row.match == false)) { ch_RemoveAll(temp); bool_Print(row.match, temp); @@ -19592,12 +21289,6 @@ void command::samp_regx_PrintArgv(command::samp_regx& row, algo::cstring& str) { cstring_Print(row.string, temp); str << " -string:"; strptr_PrintBash(temp,str); - if (!(row.show == false)) { - ch_RemoveAll(temp); - bool_Print(row.show, temp); - str << " -show:"; - strptr_PrintBash(temp,str); - } } // --- command.samp_regx..GetAnon @@ -19617,28 +21308,43 @@ algo::strptr command::samp_regx_GetAnon(command::samp_regx &parent, i32 idx) { i32 command::samp_regx_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_expr: { // $comment + case command_FieldId_expr: { // *out_anon = true; } break; - case command_FieldId_style: { // $comment + case command_FieldId_style: { // *out_anon = false; } break; - case command_FieldId_match: { // $comment + case command_FieldId_trace: { // bool: no argument required but value may be specified as trace:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_string: { // bool: no argument required but value may be specified as match:Y - *out_anon = true; + case command_FieldId_capture: { // bool: no argument required but value may be specified as capture:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_full: { // bool: no argument required but value may be specified as full:Y + *out_anon = false; + retval=0; + out_dflt="Y"; + } break; + case command_FieldId_f: { // bool: no argument required but value may be specified as f:Y + *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_show: { // bool: no argument required but value may be specified as match:Y + case command_FieldId_match: { // bool: no argument required but value may be specified as match:Y *out_anon = false; retval=0; out_dflt="Y"; } break; + case command_FieldId_string: { // + *out_anon = true; + } break; default: retval=-1; // unrecognized } @@ -19700,7 +21406,7 @@ algo::Fildes command::samp_regx_StartRead(command::samp_regx_proc& parent, algo_ // --- command.samp_regx_proc.samp_regx.Kill // Kill subprocess and wait void command::samp_regx_Kill(command::samp_regx_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); samp_regx_Wait(parent); } @@ -19795,10 +21501,34 @@ void command::samp_regx_ToArgv(command::samp_regx_proc& parent, algo::StringAry& cstring_Print(parent.cmd.expr, *arg); } - if (parent.cmd.style != 0) { + if (parent.cmd.style != 2) { cstring *arg = &ary_Alloc(args); *arg << "-style:"; - command::style_Print(parent.cmd, *arg); + RegxStyle_Print(parent.cmd.style, *arg); + } + + if (parent.cmd.trace != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-trace:"; + bool_Print(parent.cmd.trace, *arg); + } + + if (parent.cmd.capture != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-capture:"; + bool_Print(parent.cmd.capture, *arg); + } + + if (parent.cmd.full != true) { + cstring *arg = &ary_Alloc(args); + *arg << "-full:"; + bool_Print(parent.cmd.full, *arg); + } + + if (parent.cmd.f != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-f:"; + bool_Print(parent.cmd.f, *arg); } if (parent.cmd.match != false) { @@ -19812,12 +21542,6 @@ void command::samp_regx_ToArgv(command::samp_regx_proc& parent, algo::StringAry& *arg << "-string:"; cstring_Print(parent.cmd.string, *arg); } - - if (parent.cmd.show != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-show:"; - bool_Print(parent.cmd.show, *arg); - } for (int i=1; i < algo_lib::_db.cmdline.verbose; ++i) { ary_Alloc(args) << "-verbose"; } @@ -19908,6 +21632,25 @@ algo::aryptr command::cmd_AllocN(command::sandbox& parent, int n_ return algo::aryptr(elems + old_n, n_elems); } +// --- command.sandbox.cmd.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::cmd_AllocNAt(command::sandbox& parent, int n_elems, int at) { + cmd_Reserve(parent, n_elems); + int n = parent.cmd_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.sandbox.cmd comment:'index out of range'"); + } + algo::cstring *elems = parent.cmd_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.cmd_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- command.sandbox.cmd.Remove // Remove item by index. If index outside of range, do nothing. void command::cmd_Remove(command::sandbox& parent, u32 i) { @@ -20004,6 +21747,30 @@ bool command::cmd_ReadStrptrMaybe(command::sandbox& parent, algo::strptr in_str) return retval; } +// --- command.sandbox.cmd.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::cmd_Insary(command::sandbox& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.cmd_elems && rhs.elems < parent.cmd_elems + parent.cmd_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.sandbox.cmd comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.cmd_elems+1))) { + FatalErrorExit("command.bad_insary field:command.sandbox.cmd comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.cmd_n - at; + cmd_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.cmd_elems + at + nnew + i) algo::cstring(parent.cmd_elems[at + i]); + parent.cmd_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.cmd_elems + at + i) algo::cstring(rhs[i]); + } + parent.cmd_n += nnew; +} + // --- command.sandbox.files.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -20066,6 +21833,25 @@ algo::aryptr command::files_AllocN(command::sandbox& parent, int return algo::aryptr(elems + old_n, n_elems); } +// --- command.sandbox.files.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::files_AllocNAt(command::sandbox& parent, int n_elems, int at) { + files_Reserve(parent, n_elems); + int n = parent.files_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.sandbox.files comment:'index out of range'"); + } + algo::cstring *elems = parent.files_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.files_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- command.sandbox.files.Remove // Remove item by index. If index outside of range, do nothing. void command::files_Remove(command::sandbox& parent, u32 i) { @@ -20159,7 +21945,31 @@ bool command::files_ReadStrptrMaybe(command::sandbox& parent, algo::strptr in_st if (!retval) { files_RemoveLast(parent); } - return retval; + return retval; +} + +// --- command.sandbox.files.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::files_Insary(command::sandbox& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.files_elems && rhs.elems < parent.files_elems + parent.files_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.sandbox.files comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.files_elems+1))) { + FatalErrorExit("command.bad_insary field:command.sandbox.files comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.files_n - at; + files_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.files_elems + at + nnew + i) algo::cstring(parent.files_elems[at + i]); + parent.files_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.files_elems + at + i) algo::cstring(rhs[i]); + } + parent.files_n += nnew; } // --- command.sandbox..ReadFieldMaybe @@ -20170,61 +21980,53 @@ bool command::sandbox_ReadFieldMaybe(command::sandbox& parent, algo::strptr fiel switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_name: { retval = name_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_create: { retval = bool_ReadStrptrMaybe(parent.create, strval); - break; - } + } break; case command_FieldId_list: { retval = bool_ReadStrptrMaybe(parent.list, strval); - break; - } + } break; case command_FieldId_reset: { retval = bool_ReadStrptrMaybe(parent.reset, strval); - break; - } + } break; case command_FieldId_clean: { retval = bool_ReadStrptrMaybe(parent.clean, strval); - break; - } + } break; case command_FieldId_shell: { retval = bool_ReadStrptrMaybe(parent.shell, strval); - break; - } + } break; case command_FieldId_del: { retval = bool_ReadStrptrMaybe(parent.del, strval); - break; - } + } break; case command_FieldId_gc: { retval = bool_ReadStrptrMaybe(parent.gc, strval); - break; - } + } break; case command_FieldId_cmd: { retval = cmd_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_diff: { retval = bool_ReadStrptrMaybe(parent.diff, strval); - break; - } + } break; case command_FieldId_files: { retval = files_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_refs: { retval = algo::cstring_ReadStrptrMaybe(parent.refs, strval); - break; - } + } break; + case command_FieldId_ref: { + retval = algo::cstring_ReadStrptrMaybe(parent.ref, strval); + } break; case command_FieldId_q: { retval = bool_ReadStrptrMaybe(parent.q, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -20268,6 +22070,7 @@ void command::sandbox_Init(command::sandbox& parent) { parent.files_n = 0; // (command.sandbox.files) parent.files_max = 0; // (command.sandbox.files) parent.refs = algo::strptr("HEAD"); + parent.ref = algo::strptr("HEAD"); parent.q = bool(false); } @@ -20388,6 +22191,12 @@ void command::sandbox_PrintArgv(command::sandbox& row, algo::cstring& str) { str << " -refs:"; strptr_PrintBash(temp,str); } + if (!(row.ref == "HEAD")) { + ch_RemoveAll(temp); + cstring_Print(row.ref, temp); + str << " -ref:"; + strptr_PrintBash(temp,str); + } if (!(row.q == false)) { ch_RemoveAll(temp); bool_Print(row.q, temp); @@ -20412,62 +22221,65 @@ algo::strptr command::sandbox_GetAnon(command::sandbox &parent, i32 idx) { i32 command::sandbox_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_name: { // $comment + case command_FieldId_name: { // *out_anon = true; } break; - case command_FieldId_create: { // $comment + case command_FieldId_create: { // bool: no argument required but value may be specified as create:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_list: { // bool: no argument required but value may be specified as create:Y + case command_FieldId_list: { // bool: no argument required but value may be specified as list:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_reset: { // bool: no argument required but value may be specified as list:Y + case command_FieldId_reset: { // bool: no argument required but value may be specified as reset:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_clean: { // bool: no argument required but value may be specified as reset:Y + case command_FieldId_clean: { // bool: no argument required but value may be specified as clean:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_shell: { // bool: no argument required but value may be specified as clean:Y + case command_FieldId_shell: { // bool: no argument required but value may be specified as shell:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_del: { // bool: no argument required but value may be specified as shell:Y + case command_FieldId_del: { // bool: no argument required but value may be specified as del:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_gc: { // bool: no argument required but value may be specified as del:Y + case command_FieldId_gc: { // bool: no argument required but value may be specified as gc:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_cmd: { // bool: no argument required but value may be specified as gc:Y + case command_FieldId_cmd: { // *out_anon = true; } break; - case command_FieldId_diff: { // bool: no argument required but value may be specified as gc:Y + case command_FieldId_diff: { // bool: no argument required but value may be specified as diff:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_files: { // bool: no argument required but value may be specified as diff:Y + case command_FieldId_files: { // + *out_anon = false; + } break; + case command_FieldId_refs: { // *out_anon = false; } break; - case command_FieldId_refs: { // bool: no argument required but value may be specified as diff:Y + case command_FieldId_ref: { // *out_anon = false; } break; - case command_FieldId_q: { // bool: no argument required but value may be specified as diff:Y + case command_FieldId_q: { // bool: no argument required but value may be specified as q:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -20493,6 +22305,7 @@ command::sandbox& command::sandbox::operator =(const command::sandbox &rhs) { diff = rhs.diff; files_Setary(*this, files_Getary(const_cast(rhs))); refs = rhs.refs; + ref = rhs.ref; q = rhs.q; return *this; } @@ -20510,6 +22323,7 @@ command::sandbox& command::sandbox::operator =(const command::sandbox &rhs) { , gc(rhs.gc) , diff(rhs.diff) , refs(rhs.refs) + , ref(rhs.ref) , q(rhs.q) { cmd_elems = 0; // (command.sandbox.cmd) @@ -20577,7 +22391,7 @@ algo::Fildes command::sandbox_StartRead(command::sandbox_proc& parent, algo_lib: // --- command.sandbox_proc.sandbox.Kill // Kill subprocess and wait void command::sandbox_Kill(command::sandbox_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); sandbox_Wait(parent); } @@ -20736,6 +22550,12 @@ void command::sandbox_ToArgv(command::sandbox_proc& parent, algo::StringAry& arg cstring_Print(parent.cmd.refs, *arg); } + if (parent.cmd.ref != "HEAD") { + cstring *arg = &ary_Alloc(args); + *arg << "-ref:"; + cstring_Print(parent.cmd.ref, *arg); + } + if (parent.cmd.q != false) { cstring *arg = &ary_Alloc(args); *arg << "-q:"; @@ -20754,93 +22574,93 @@ void command::sandbox_proc_Uninit(command::sandbox_proc& parent) { sandbox_Kill(parent); // kill child, ensure forward progress } -// --- command.src_func.target.Print +// --- command.src_func.targsrc.Print // Print back to string -void command::target_Print(command::src_func& parent, algo::cstring &out) { - Regx_Print(parent.target, out); +void command::targsrc_Print(command::src_func& parent, algo::cstring &out) { + Regx_Print(parent.targsrc, out); } -// --- command.src_func.target.ReadStrptrMaybe +// --- command.src_func.targsrc.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::target_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { +bool command::targsrc_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { bool retval = true; - Regx_ReadSql(parent.target, in, true); + Regx_ReadSql(parent.targsrc, in, true); return retval; } -// --- command.src_func.name.Print +// --- command.src_func.acrkey.Print // Print back to string -void command::name_Print(command::src_func& parent, algo::cstring &out) { - Regx_Print(parent.name, out); +void command::acrkey_Print(command::src_func& parent, algo::cstring &out) { + Regx_Print(parent.acrkey, out); } -// --- command.src_func.name.ReadStrptrMaybe +// --- command.src_func.acrkey.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::name_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { +bool command::acrkey_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { bool retval = true; - Regx_ReadSql(parent.name, in, true); + Regx_ReadSql(parent.acrkey, in, true); return retval; } -// --- command.src_func.body.Print +// --- command.src_func.func.Print // Print back to string -void command::body_Print(command::src_func& parent, algo::cstring &out) { - Regx_Print(parent.body, out); +void command::func_Print(command::src_func& parent, algo::cstring &out) { + Regx_Print(parent.func, out); } -// --- command.src_func.body.ReadStrptrMaybe +// --- command.src_func.func.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::body_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { +bool command::func_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { bool retval = true; - Regx_ReadSql(parent.body, in, true); + Regx_ReadSql(parent.func, in, true); return retval; } -// --- command.src_func.targsrc.Print +// --- command.src_func.matchproto.Print // Print back to string -void command::targsrc_Print(command::src_func& parent, algo::cstring &out) { - Regx_Print(parent.targsrc, out); +void command::matchproto_Print(command::src_func& parent, algo::cstring &out) { + Regx_Print(parent.matchproto, out); } -// --- command.src_func.targsrc.ReadStrptrMaybe +// --- command.src_func.matchproto.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::targsrc_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { +bool command::matchproto_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { bool retval = true; - Regx_ReadSql(parent.targsrc, in, true); + Regx_ReadSql(parent.matchproto, in, true); return retval; } -// --- command.src_func.func.Print +// --- command.src_func.matchbody.Print // Print back to string -void command::func_Print(command::src_func& parent, algo::cstring &out) { - Regx_Print(parent.func, out); +void command::matchbody_Print(command::src_func& parent, algo::cstring &out) { + Regx_Print(parent.matchbody, out); } -// --- command.src_func.func.ReadStrptrMaybe +// --- command.src_func.matchbody.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::func_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { +bool command::matchbody_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { bool retval = true; - Regx_ReadSql(parent.func, in, true); + Regx_ReadSql(parent.matchbody, in, true); return retval; } -// --- command.src_func.comment.Print +// --- command.src_func.matchcomment.Print // Print back to string -void command::comment_Print(command::src_func& parent, algo::cstring &out) { - Regx_Print(parent.comment, out); +void command::matchcomment_Print(command::src_func& parent, algo::cstring &out) { + Regx_Print(parent.matchcomment, out); } -// --- command.src_func.comment.ReadStrptrMaybe +// --- command.src_func.matchcomment.ReadStrptrMaybe // Read Regx from string // Convert string to field. Return success value -bool command::comment_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { +bool command::matchcomment_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) { bool retval = true; - Regx_ReadSql(parent.comment, in, true); + Regx_ReadSql(parent.matchcomment, in, true); return retval; } @@ -20852,89 +22672,83 @@ bool command::src_func_ReadFieldMaybe(command::src_func& parent, algo::strptr fi switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - case command_FieldId_target: { - retval = target_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_name: { - retval = name_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_body: { - retval = body_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_targsrc: { retval = targsrc_ReadStrptrMaybe(parent, strval); - break; - } + } break; + case command_FieldId_acrkey: { + retval = acrkey_ReadStrptrMaybe(parent, strval); + } break; case command_FieldId_func: { retval = func_ReadStrptrMaybe(parent, strval); - break; - } - case command_FieldId_comment: { - retval = comment_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_nextfile: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.nextfile, strval); - break; - } + } break; case command_FieldId_other: { retval = bool_ReadStrptrMaybe(parent.other, strval); - break; - } + } break; + case command_FieldId_list: { + retval = bool_ReadStrptrMaybe(parent.list, strval); + } break; case command_FieldId_updateproto: { retval = bool_ReadStrptrMaybe(parent.updateproto, strval); - break; - } - case command_FieldId_listfunc: { - retval = bool_ReadStrptrMaybe(parent.listfunc, strval); - break; - } + } break; + case command_FieldId_createmissing: { + retval = bool_ReadStrptrMaybe(parent.createmissing, strval); + } break; case command_FieldId_iffy: { retval = bool_ReadStrptrMaybe(parent.iffy, strval); - break; - } - case command_FieldId_proto: { - retval = bool_ReadStrptrMaybe(parent.proto, strval); - break; - } + } break; case command_FieldId_gen: { retval = bool_ReadStrptrMaybe(parent.gen, strval); - break; - } + } break; case command_FieldId_showloc: { retval = bool_ReadStrptrMaybe(parent.showloc, strval); - break; - } + } break; + case command_FieldId_f: { + retval = bool_ReadStrptrMaybe(parent.f, strval); + } break; case command_FieldId_showstatic: { retval = bool_ReadStrptrMaybe(parent.showstatic, strval); - break; - } + } break; + case command_FieldId_matchproto: { + retval = matchproto_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_matchbody: { + retval = matchbody_ReadStrptrMaybe(parent, strval); + } break; + case command_FieldId_matchcomment: { + retval = matchcomment_ReadStrptrMaybe(parent, strval); + } break; case command_FieldId_showsortkey: { retval = bool_ReadStrptrMaybe(parent.showsortkey, strval); - break; - } + } break; + case command_FieldId_showcomment: { + retval = bool_ReadStrptrMaybe(parent.showcomment, strval); + } break; + case command_FieldId_showbody: { + retval = bool_ReadStrptrMaybe(parent.showbody, strval); + } break; case command_FieldId_sortname: { retval = bool_ReadStrptrMaybe(parent.sortname, strval); - break; - } + } break; + case command_FieldId_printssim: { + retval = bool_ReadStrptrMaybe(parent.printssim, strval); + } break; case command_FieldId_e: { retval = bool_ReadStrptrMaybe(parent.e, strval); - break; - } + } break; case command_FieldId_baddecl: { retval = bool_ReadStrptrMaybe(parent.baddecl, strval); - break; - } + } break; case command_FieldId_report: { retval = bool_ReadStrptrMaybe(parent.report, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -20963,23 +22777,27 @@ bool command::src_func_ReadTupleMaybe(command::src_func &parent, algo::Tuple &tu // Set all fields to initial values. void command::src_func_Init(command::src_func& parent) { parent.in = algo::strptr("data"); - Regx_ReadSql(parent.target, "%", true); - Regx_ReadSql(parent.name, "%", true); - Regx_ReadSql(parent.body, "%", true); - Regx_ReadSql(parent.targsrc, "", true); + Regx_ReadSql(parent.targsrc, "%", true); + Regx_ReadSql(parent.acrkey, "%", true); Regx_ReadSql(parent.func, "%", true); - Regx_ReadSql(parent.comment, "%", true); parent.nextfile = algo::strptr(""); parent.other = bool(false); + parent.list = bool(false); parent.updateproto = bool(false); - parent.listfunc = bool(false); + parent.createmissing = bool(false); parent.iffy = bool(false); - parent.proto = bool(false); parent.gen = bool(false); - parent.showloc = bool(true); + parent.showloc = bool(false); + parent.f = bool(false); parent.showstatic = bool(true); + Regx_ReadSql(parent.matchproto, "%", true); + Regx_ReadSql(parent.matchbody, "%", true); + Regx_ReadSql(parent.matchcomment, "%", true); parent.showsortkey = bool(false); + parent.showcomment = bool(false); + parent.showbody = bool(false); parent.sortname = bool(false); + parent.printssim = bool(false); parent.e = bool(false); parent.baddecl = bool(false); parent.report = bool(false); @@ -21015,36 +22833,22 @@ void command::src_func_PrintArgv(command::src_func& row, algo::cstring& str) { str << " -in:"; strptr_PrintBash(temp,str); } - ch_RemoveAll(temp); - command::target_Print(const_cast(row), temp); - str << " -target:"; - strptr_PrintBash(temp,str); - ch_RemoveAll(temp); - command::name_Print(const_cast(row), temp); - str << " -name:"; - strptr_PrintBash(temp,str); - ch_RemoveAll(temp); - command::body_Print(const_cast(row), temp); - str << " -body:"; - strptr_PrintBash(temp,str); - if (!(row.targsrc.expr == "")) { + if (!(row.targsrc.expr == "%")) { ch_RemoveAll(temp); command::targsrc_Print(const_cast(row), temp); str << " -targsrc:"; strptr_PrintBash(temp,str); } - if (!(row.func.expr == "%")) { - ch_RemoveAll(temp); - command::func_Print(const_cast(row), temp); - str << " -func:"; - strptr_PrintBash(temp,str); - } - if (!(row.comment.expr == "%")) { + if (!(row.acrkey.expr == "%")) { ch_RemoveAll(temp); - command::comment_Print(const_cast(row), temp); - str << " -comment:"; + command::acrkey_Print(const_cast(row), temp); + str << " -acrkey:"; strptr_PrintBash(temp,str); } + ch_RemoveAll(temp); + command::func_Print(const_cast(row), temp); + str << " -func:"; + strptr_PrintBash(temp,str); if (!(row.nextfile == "")) { ch_RemoveAll(temp); Smallstr200_Print(row.nextfile, temp); @@ -21057,16 +22861,22 @@ void command::src_func_PrintArgv(command::src_func& row, algo::cstring& str) { str << " -other:"; strptr_PrintBash(temp,str); } + if (!(row.list == false)) { + ch_RemoveAll(temp); + bool_Print(row.list, temp); + str << " -list:"; + strptr_PrintBash(temp,str); + } if (!(row.updateproto == false)) { ch_RemoveAll(temp); bool_Print(row.updateproto, temp); str << " -updateproto:"; strptr_PrintBash(temp,str); } - if (!(row.listfunc == false)) { + if (!(row.createmissing == false)) { ch_RemoveAll(temp); - bool_Print(row.listfunc, temp); - str << " -listfunc:"; + bool_Print(row.createmissing, temp); + str << " -createmissing:"; strptr_PrintBash(temp,str); } if (!(row.iffy == false)) { @@ -21075,42 +22885,78 @@ void command::src_func_PrintArgv(command::src_func& row, algo::cstring& str) { str << " -iffy:"; strptr_PrintBash(temp,str); } - if (!(row.proto == false)) { - ch_RemoveAll(temp); - bool_Print(row.proto, temp); - str << " -proto:"; - strptr_PrintBash(temp,str); - } if (!(row.gen == false)) { ch_RemoveAll(temp); bool_Print(row.gen, temp); str << " -gen:"; strptr_PrintBash(temp,str); } - if (!(row.showloc == true)) { + if (!(row.showloc == false)) { ch_RemoveAll(temp); bool_Print(row.showloc, temp); str << " -showloc:"; strptr_PrintBash(temp,str); } + if (!(row.f == false)) { + ch_RemoveAll(temp); + bool_Print(row.f, temp); + str << " -f:"; + strptr_PrintBash(temp,str); + } if (!(row.showstatic == true)) { ch_RemoveAll(temp); bool_Print(row.showstatic, temp); str << " -showstatic:"; strptr_PrintBash(temp,str); } + if (!(row.matchproto.expr == "%")) { + ch_RemoveAll(temp); + command::matchproto_Print(const_cast(row), temp); + str << " -matchproto:"; + strptr_PrintBash(temp,str); + } + if (!(row.matchbody.expr == "%")) { + ch_RemoveAll(temp); + command::matchbody_Print(const_cast(row), temp); + str << " -matchbody:"; + strptr_PrintBash(temp,str); + } + if (!(row.matchcomment.expr == "%")) { + ch_RemoveAll(temp); + command::matchcomment_Print(const_cast(row), temp); + str << " -matchcomment:"; + strptr_PrintBash(temp,str); + } if (!(row.showsortkey == false)) { ch_RemoveAll(temp); bool_Print(row.showsortkey, temp); str << " -showsortkey:"; strptr_PrintBash(temp,str); } + if (!(row.showcomment == false)) { + ch_RemoveAll(temp); + bool_Print(row.showcomment, temp); + str << " -showcomment:"; + strptr_PrintBash(temp,str); + } + if (!(row.showbody == false)) { + ch_RemoveAll(temp); + bool_Print(row.showbody, temp); + str << " -showbody:"; + strptr_PrintBash(temp,str); + } if (!(row.sortname == false)) { ch_RemoveAll(temp); bool_Print(row.sortname, temp); str << " -sortname:"; strptr_PrintBash(temp,str); } + if (!(row.printssim == false)) { + ch_RemoveAll(temp); + bool_Print(row.printssim, temp); + str << " -printssim:"; + strptr_PrintBash(temp,str); + } if (!(row.e == false)) { ch_RemoveAll(temp); bool_Print(row.e, temp); @@ -21135,9 +22981,7 @@ void command::src_func_PrintArgv(command::src_func& row, algo::cstring& str) { algo::strptr command::src_func_GetAnon(command::src_func &parent, i32 idx) { (void)parent;//only to avoid -Wunused-parameter switch(idx) { - case(0): return strptr("target", 6); - case(1): return strptr("name", 4); - case(2): return strptr("body", 4); + case(0): return strptr("func", 4); default: return algo::strptr(); } } @@ -21149,91 +22993,111 @@ algo::strptr command::src_func_GetAnon(command::src_func &parent, i32 idx) { i32 command::src_func_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_target: { // $comment - *out_anon = true; + case command_FieldId_targsrc: { // + *out_anon = false; } break; - case command_FieldId_name: { // $comment - *out_anon = true; + case command_FieldId_acrkey: { // + *out_anon = false; } break; - case command_FieldId_body: { // $comment + case command_FieldId_func: { // *out_anon = true; } break; - case command_FieldId_targsrc: { // $comment + case command_FieldId_nextfile: { // + *out_anon = false; + } break; + case command_FieldId_other: { // bool: no argument required but value may be specified as other:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_func: { // $comment + case command_FieldId_list: { // bool: no argument required but value may be specified as list:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_comment: { // $comment + case command_FieldId_updateproto: { // bool: no argument required but value may be specified as updateproto:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_nextfile: { // $comment + case command_FieldId_createmissing: { // bool: no argument required but value may be specified as createmissing:Y *out_anon = false; + retval=0; + out_dflt="Y"; } break; - case command_FieldId_other: { // $comment + case command_FieldId_iffy: { // bool: no argument required but value may be specified as iffy:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_updateproto: { // bool: no argument required but value may be specified as other:Y + case command_FieldId_gen: { // bool: no argument required but value may be specified as gen:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_listfunc: { // bool: no argument required but value may be specified as updateproto:Y + case command_FieldId_showloc: { // bool: no argument required but value may be specified as showloc:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_iffy: { // bool: no argument required but value may be specified as listfunc:Y + case command_FieldId_f: { // bool: no argument required but value may be specified as f:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_proto: { // bool: no argument required but value may be specified as iffy:Y + case command_FieldId_showstatic: { // bool: no argument required but value may be specified as showstatic:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_gen: { // bool: no argument required but value may be specified as proto:Y + case command_FieldId_matchproto: { // + *out_anon = false; + } break; + case command_FieldId_matchbody: { // + *out_anon = false; + } break; + case command_FieldId_matchcomment: { // + *out_anon = false; + } break; + case command_FieldId_showsortkey: { // bool: no argument required but value may be specified as showsortkey:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_showloc: { // bool: no argument required but value may be specified as gen:Y + case command_FieldId_showcomment: { // bool: no argument required but value may be specified as showcomment:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_showstatic: { // bool: no argument required but value may be specified as showloc:Y + case command_FieldId_showbody: { // bool: no argument required but value may be specified as showbody:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_showsortkey: { // bool: no argument required but value may be specified as showstatic:Y + case command_FieldId_sortname: { // bool: no argument required but value may be specified as sortname:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_sortname: { // bool: no argument required but value may be specified as showsortkey:Y + case command_FieldId_printssim: { // bool: no argument required but value may be specified as printssim:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_e: { // bool: no argument required but value may be specified as sortname:Y + case command_FieldId_e: { // bool: no argument required but value may be specified as e:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_baddecl: { // bool: no argument required but value may be specified as e:Y + case command_FieldId_baddecl: { // bool: no argument required but value may be specified as baddecl:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_report: { // bool: no argument required but value may be specified as baddecl:Y + case command_FieldId_report: { // bool: no argument required but value may be specified as report:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -21299,7 +23163,7 @@ algo::Fildes command::src_func_StartRead(command::src_func_proc& parent, algo_li // --- command.src_func_proc.src_func.Kill // Kill subprocess and wait void command::src_func_Kill(command::src_func_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); src_func_Wait(parent); } @@ -21382,34 +23246,22 @@ void command::src_func_ToArgv(command::src_func_proc& parent, algo::StringAry& a ary_RemoveAll(args); ary_Alloc(args) << parent.path; - if (parent.cmd.in != "data") { - cstring *arg = &ary_Alloc(args); - *arg << "-in:"; - cstring_Print(parent.cmd.in, *arg); - } - - if (parent.cmd.target.expr != "%") { - cstring *arg = &ary_Alloc(args); - *arg << "-target:"; - command::target_Print(parent.cmd, *arg); - } - - if (parent.cmd.name.expr != "%") { + if (parent.cmd.in != "data") { cstring *arg = &ary_Alloc(args); - *arg << "-name:"; - command::name_Print(parent.cmd, *arg); + *arg << "-in:"; + cstring_Print(parent.cmd.in, *arg); } - if (parent.cmd.body.expr != "%") { + if (parent.cmd.targsrc.expr != "%") { cstring *arg = &ary_Alloc(args); - *arg << "-body:"; - command::body_Print(parent.cmd, *arg); + *arg << "-targsrc:"; + command::targsrc_Print(parent.cmd, *arg); } - if (parent.cmd.targsrc.expr != "") { + if (parent.cmd.acrkey.expr != "%") { cstring *arg = &ary_Alloc(args); - *arg << "-targsrc:"; - command::targsrc_Print(parent.cmd, *arg); + *arg << "-acrkey:"; + command::acrkey_Print(parent.cmd, *arg); } if (parent.cmd.func.expr != "%") { @@ -21418,12 +23270,6 @@ void command::src_func_ToArgv(command::src_func_proc& parent, algo::StringAry& a command::func_Print(parent.cmd, *arg); } - if (parent.cmd.comment.expr != "%") { - cstring *arg = &ary_Alloc(args); - *arg << "-comment:"; - command::comment_Print(parent.cmd, *arg); - } - if (parent.cmd.nextfile != "") { cstring *arg = &ary_Alloc(args); *arg << "-nextfile:"; @@ -21436,16 +23282,22 @@ void command::src_func_ToArgv(command::src_func_proc& parent, algo::StringAry& a bool_Print(parent.cmd.other, *arg); } + if (parent.cmd.list != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-list:"; + bool_Print(parent.cmd.list, *arg); + } + if (parent.cmd.updateproto != false) { cstring *arg = &ary_Alloc(args); *arg << "-updateproto:"; bool_Print(parent.cmd.updateproto, *arg); } - if (parent.cmd.listfunc != false) { + if (parent.cmd.createmissing != false) { cstring *arg = &ary_Alloc(args); - *arg << "-listfunc:"; - bool_Print(parent.cmd.listfunc, *arg); + *arg << "-createmissing:"; + bool_Print(parent.cmd.createmissing, *arg); } if (parent.cmd.iffy != false) { @@ -21454,42 +23306,78 @@ void command::src_func_ToArgv(command::src_func_proc& parent, algo::StringAry& a bool_Print(parent.cmd.iffy, *arg); } - if (parent.cmd.proto != false) { - cstring *arg = &ary_Alloc(args); - *arg << "-proto:"; - bool_Print(parent.cmd.proto, *arg); - } - if (parent.cmd.gen != false) { cstring *arg = &ary_Alloc(args); *arg << "-gen:"; bool_Print(parent.cmd.gen, *arg); } - if (parent.cmd.showloc != true) { + if (parent.cmd.showloc != false) { cstring *arg = &ary_Alloc(args); *arg << "-showloc:"; bool_Print(parent.cmd.showloc, *arg); } + if (parent.cmd.f != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-f:"; + bool_Print(parent.cmd.f, *arg); + } + if (parent.cmd.showstatic != true) { cstring *arg = &ary_Alloc(args); *arg << "-showstatic:"; bool_Print(parent.cmd.showstatic, *arg); } + if (parent.cmd.matchproto.expr != "%") { + cstring *arg = &ary_Alloc(args); + *arg << "-matchproto:"; + command::matchproto_Print(parent.cmd, *arg); + } + + if (parent.cmd.matchbody.expr != "%") { + cstring *arg = &ary_Alloc(args); + *arg << "-matchbody:"; + command::matchbody_Print(parent.cmd, *arg); + } + + if (parent.cmd.matchcomment.expr != "%") { + cstring *arg = &ary_Alloc(args); + *arg << "-matchcomment:"; + command::matchcomment_Print(parent.cmd, *arg); + } + if (parent.cmd.showsortkey != false) { cstring *arg = &ary_Alloc(args); *arg << "-showsortkey:"; bool_Print(parent.cmd.showsortkey, *arg); } + if (parent.cmd.showcomment != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-showcomment:"; + bool_Print(parent.cmd.showcomment, *arg); + } + + if (parent.cmd.showbody != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-showbody:"; + bool_Print(parent.cmd.showbody, *arg); + } + if (parent.cmd.sortname != false) { cstring *arg = &ary_Alloc(args); *arg << "-sortname:"; bool_Print(parent.cmd.sortname, *arg); } + if (parent.cmd.printssim != false) { + cstring *arg = &ary_Alloc(args); + *arg << "-printssim:"; + bool_Print(parent.cmd.printssim, *arg); + } + if (parent.cmd.e != false) { cstring *arg = &ary_Alloc(args); *arg << "-e:"; @@ -21558,29 +23446,26 @@ bool command::src_hdr_ReadFieldMaybe(command::src_hdr& parent, algo::strptr fiel switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_targsrc: { retval = targsrc_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_write: { retval = bool_ReadStrptrMaybe(parent.write, strval); - break; - } + } break; case command_FieldId_indent: { retval = bool_ReadStrptrMaybe(parent.indent, strval); - break; - } + } break; case command_FieldId_update_copyright: { retval = bool_ReadStrptrMaybe(parent.update_copyright, strval); - break; - } + } break; case command_FieldId_scriptfile: { retval = scriptfile_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -21681,28 +23566,28 @@ void command::src_hdr_PrintArgv(command::src_hdr& row, algo::cstring& str) { i32 command::src_hdr_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_targsrc: { // $comment + case command_FieldId_targsrc: { // *out_anon = false; } break; - case command_FieldId_write: { // $comment + case command_FieldId_write: { // bool: no argument required but value may be specified as write:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_indent: { // bool: no argument required but value may be specified as write:Y + case command_FieldId_indent: { // bool: no argument required but value may be specified as indent:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_update_copyright: { // bool: no argument required but value may be specified as indent:Y + case command_FieldId_update_copyright: { // bool: no argument required but value may be specified as update_copyright:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_scriptfile: { // bool: no argument required but value may be specified as update_copyright:Y + case command_FieldId_scriptfile: { // *out_anon = false; } break; default: @@ -21766,7 +23651,7 @@ algo::Fildes command::src_hdr_StartRead(command::src_hdr_proc& parent, algo_lib: // --- command.src_hdr_proc.src_hdr.Kill // Kill subprocess and wait void command::src_hdr_Kill(command::src_hdr_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); src_hdr_Wait(parent); } @@ -21935,37 +23820,32 @@ bool command::src_lim_ReadFieldMaybe(command::src_lim& parent, algo::strptr fiel switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_linelim: { retval = bool_ReadStrptrMaybe(parent.linelim, strval); - break; - } + } break; case command_FieldId_srcfile: { retval = srcfile_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_strayfile: { retval = bool_ReadStrptrMaybe(parent.strayfile, strval); - break; - } + } break; case command_FieldId_capture: { retval = bool_ReadStrptrMaybe(parent.capture, strval); - break; - } + } break; case command_FieldId_write: { retval = bool_ReadStrptrMaybe(parent.write, strval); - break; - } + } break; case command_FieldId_badchar: { retval = bool_ReadStrptrMaybe(parent.badchar, strval); - break; - } + } break; case command_FieldId_badline: { retval = badline_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -22080,38 +23960,38 @@ void command::src_lim_PrintArgv(command::src_lim& row, algo::cstring& str) { i32 command::src_lim_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_linelim: { // $comment + case command_FieldId_linelim: { // bool: no argument required but value may be specified as linelim:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_srcfile: { // bool: no argument required but value may be specified as linelim:Y + case command_FieldId_srcfile: { // *out_anon = false; } break; - case command_FieldId_strayfile: { // bool: no argument required but value may be specified as linelim:Y + case command_FieldId_strayfile: { // bool: no argument required but value may be specified as strayfile:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_capture: { // bool: no argument required but value may be specified as strayfile:Y + case command_FieldId_capture: { // bool: no argument required but value may be specified as capture:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_write: { // bool: no argument required but value may be specified as capture:Y + case command_FieldId_write: { // bool: no argument required but value may be specified as write:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_badchar: { // bool: no argument required but value may be specified as write:Y + case command_FieldId_badchar: { // bool: no argument required but value may be specified as badchar:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_badline: { // bool: no argument required but value may be specified as badchar:Y + case command_FieldId_badline: { // *out_anon = false; } break; default: @@ -22175,7 +24055,7 @@ algo::Fildes command::src_lim_StartRead(command::src_lim_proc& parent, algo_lib: // --- command.src_lim_proc.src_lim.Kill // Kill subprocess and wait void command::src_lim_Kill(command::src_lim_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); src_lim_Wait(parent); } @@ -22326,13 +24206,14 @@ bool command::ssim2csv_ReadFieldMaybe(command::ssim2csv& parent, algo::strptr fi switch(field_id) { case command_FieldId_expand: { retval = algo::cstring_ReadStrptrMaybe(parent.expand, strval); - break; - } + } break; case command_FieldId_ignoreQuote: { retval = bool_ReadStrptrMaybe(parent.ignoreQuote, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -22398,10 +24279,10 @@ void command::ssim2csv_PrintArgv(command::ssim2csv& row, algo::cstring& str) { i32 command::ssim2csv_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_expand: { // $comment + case command_FieldId_expand: { // *out_anon = false; } break; - case command_FieldId_ignoreQuote: { // $comment + case command_FieldId_ignoreQuote: { // bool: no argument required but value may be specified as ignoreQuote:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -22467,7 +24348,7 @@ algo::Fildes command::ssim2csv_StartRead(command::ssim2csv_proc& parent, algo_li // --- command.ssim2csv_proc.ssim2csv.Kill // Kill subprocess and wait void command::ssim2csv_Kill(command::ssim2csv_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); ssim2csv_Wait(parent); } @@ -22582,49 +24463,41 @@ bool command::ssim2mysql_ReadFieldMaybe(command::ssim2mysql& parent, algo::strpt switch(field_id) { case command_FieldId_url: { retval = algo::cstring_ReadStrptrMaybe(parent.url, strval); - break; - } + } break; case command_FieldId_data_dir: { retval = algo::cstring_ReadStrptrMaybe(parent.data_dir, strval); - break; - } + } break; case command_FieldId_maxpacket: { retval = i32_ReadStrptrMaybe(parent.maxpacket, strval); - break; - } + } break; case command_FieldId_replace: { retval = bool_ReadStrptrMaybe(parent.replace, strval); - break; - } + } break; case command_FieldId_trunc: { retval = bool_ReadStrptrMaybe(parent.trunc, strval); - break; - } + } break; case command_FieldId_dry_run: { retval = bool_ReadStrptrMaybe(parent.dry_run, strval); - break; - } + } break; case command_FieldId_fldfunc: { retval = bool_ReadStrptrMaybe(parent.fldfunc, strval); - break; - } + } break; case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_db: { retval = algo::cstring_ReadStrptrMaybe(parent.db, strval); - break; - } + } break; case command_FieldId_createdb: { retval = bool_ReadStrptrMaybe(parent.createdb, strval); - break; - } + } break; case command_FieldId_fkey: { retval = bool_ReadStrptrMaybe(parent.fkey, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -22760,47 +24633,47 @@ void command::ssim2mysql_PrintArgv(command::ssim2mysql& row, algo::cstring& str) i32 command::ssim2mysql_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_url: { // $comment + case command_FieldId_url: { // *out_anon = false; } break; - case command_FieldId_data_dir: { // $comment + case command_FieldId_data_dir: { // *out_anon = false; } break; - case command_FieldId_maxpacket: { // $comment + case command_FieldId_maxpacket: { // *out_anon = false; } break; - case command_FieldId_replace: { // $comment + case command_FieldId_replace: { // bool: no argument required but value may be specified as replace:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_trunc: { // bool: no argument required but value may be specified as replace:Y + case command_FieldId_trunc: { // bool: no argument required but value may be specified as trunc:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_dry_run: { // bool: no argument required but value may be specified as trunc:Y + case command_FieldId_dry_run: { // bool: no argument required but value may be specified as dry_run:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_fldfunc: { // bool: no argument required but value may be specified as dry_run:Y + case command_FieldId_fldfunc: { // bool: no argument required but value may be specified as fldfunc:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_in: { // bool: no argument required but value may be specified as fldfunc:Y + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_db: { // bool: no argument required but value may be specified as fldfunc:Y + case command_FieldId_db: { // *out_anon = false; } break; - case command_FieldId_createdb: { // bool: no argument required but value may be specified as fldfunc:Y + case command_FieldId_createdb: { // bool: no argument required but value may be specified as createdb:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_fkey: { // bool: no argument required but value may be specified as createdb:Y + case command_FieldId_fkey: { // bool: no argument required but value may be specified as fkey:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -22866,7 +24739,7 @@ algo::Fildes command::ssim2mysql_StartRead(command::ssim2mysql_proc& parent, alg // --- command.ssim2mysql_proc.ssim2mysql.Kill // Kill subprocess and wait void command::ssim2mysql_Kill(command::ssim2mysql_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); ssim2mysql_Wait(parent); } @@ -23104,6 +24977,25 @@ algo::aryptr command::match_AllocN(command::ssimfilt& parent, int return algo::aryptr(elems + old_n, n_elems); } +// --- command.ssimfilt.match.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::match_AllocNAt(command::ssimfilt& parent, int n_elems, int at) { + match_Reserve(parent, n_elems); + int n = parent.match_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.ssimfilt.match comment:'index out of range'"); + } + algo::cstring *elems = parent.match_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.match_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- command.ssimfilt.match.Remove // Remove item by index. If index outside of range, do nothing. void command::match_Remove(command::ssimfilt& parent, u32 i) { @@ -23200,6 +25092,30 @@ bool command::match_ReadStrptrMaybe(command::ssimfilt& parent, algo::strptr in_s return retval; } +// --- command.ssimfilt.match.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::match_Insary(command::ssimfilt& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.match_elems && rhs.elems < parent.match_elems + parent.match_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.ssimfilt.match comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.match_elems+1))) { + FatalErrorExit("command.bad_insary field:command.ssimfilt.match comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.match_n - at; + match_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.match_elems + at + nnew + i) algo::cstring(parent.match_elems[at + i]); + parent.match_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.match_elems + at + i) algo::cstring(rhs[i]); + } + parent.match_n += nnew; +} + // --- command.ssimfilt.field.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -23262,6 +25178,25 @@ algo::aryptr command::field_AllocN(command::ssimfilt& parent, int return algo::aryptr(elems + old_n, n_elems); } +// --- command.ssimfilt.field.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr command::field_AllocNAt(command::ssimfilt& parent, int n_elems, int at) { + field_Reserve(parent, n_elems); + int n = parent.field_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("command.bad_alloc_n_at field:command.ssimfilt.field comment:'index out of range'"); + } + algo::cstring *elems = parent.field_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.field_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- command.ssimfilt.field.Remove // Remove item by index. If index outside of range, do nothing. void command::field_Remove(command::ssimfilt& parent, u32 i) { @@ -23358,6 +25293,30 @@ bool command::field_ReadStrptrMaybe(command::ssimfilt& parent, algo::strptr in_s return retval; } +// --- command.ssimfilt.field.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void command::field_Insary(command::ssimfilt& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.field_elems && rhs.elems < parent.field_elems + parent.field_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("command.tary_alias field:command.ssimfilt.field comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.field_elems+1))) { + FatalErrorExit("command.bad_insary field:command.ssimfilt.field comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.field_n - at; + field_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.field_elems + at + nnew + i) algo::cstring(parent.field_elems[at + i]); + parent.field_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.field_elems + at + i) algo::cstring(rhs[i]); + } + parent.field_n += nnew; +} + // --- command.ssimfilt.format.ToCstr // Convert numeric value of field to one of predefined string constants. // If string is found, return a static C string. Otherwise, return NULL. @@ -23475,33 +25434,29 @@ bool command::ssimfilt_ReadFieldMaybe(command::ssimfilt& parent, algo::strptr fi switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_typetag: { retval = typetag_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_match: { retval = match_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_field: { retval = field_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_format: { retval = format_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_t: { retval = bool_ReadStrptrMaybe(parent.t, strval); - break; - } + } break; case command_FieldId_cmd: { retval = algo::cstring_ReadStrptrMaybe(parent.cmd, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -23641,27 +25596,27 @@ algo::strptr command::ssimfilt_GetAnon(command::ssimfilt &parent, i32 idx) { i32 command::ssimfilt_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_typetag: { // $comment + case command_FieldId_typetag: { // *out_anon = true; } break; - case command_FieldId_match: { // $comment + case command_FieldId_match: { // *out_anon = true; } break; - case command_FieldId_field: { // $comment + case command_FieldId_field: { // *out_anon = false; } break; - case command_FieldId_format: { // $comment + case command_FieldId_format: { // *out_anon = false; } break; - case command_FieldId_t: { // $comment + case command_FieldId_t: { // bool: no argument required but value may be specified as t:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_cmd: { // bool: no argument required but value may be specified as t:Y + case command_FieldId_cmd: { // *out_anon = false; } break; default: @@ -23755,7 +25710,7 @@ algo::Fildes command::ssimfilt_StartRead(command::ssimfilt_proc& parent, algo_li // --- command.ssimfilt_proc.ssimfilt.Kill // Kill subprocess and wait void command::ssimfilt_Kill(command::ssimfilt_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); ssimfilt_Wait(parent); } @@ -23898,25 +25853,23 @@ bool command::strconv_ReadFieldMaybe(command::strconv& parent, algo::strptr fiel switch(field_id) { case command_FieldId_str: { retval = algo::cstring_ReadStrptrMaybe(parent.str, strval); - break; - } + } break; case command_FieldId_tocamelcase: { retval = bool_ReadStrptrMaybe(parent.tocamelcase, strval); - break; - } + } break; case command_FieldId_tolowerunder: { retval = bool_ReadStrptrMaybe(parent.tolowerunder, strval); - break; - } + } break; case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_pathcomp: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.pathcomp, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -24011,23 +25964,23 @@ algo::strptr command::strconv_GetAnon(command::strconv &parent, i32 idx) { i32 command::strconv_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_str: { // $comment + case command_FieldId_str: { // *out_anon = true; } break; - case command_FieldId_tocamelcase: { // $comment + case command_FieldId_tocamelcase: { // bool: no argument required but value may be specified as tocamelcase:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_tolowerunder: { // bool: no argument required but value may be specified as tocamelcase:Y + case command_FieldId_tolowerunder: { // bool: no argument required but value may be specified as tolowerunder:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_in: { // bool: no argument required but value may be specified as tolowerunder:Y + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_pathcomp: { // bool: no argument required but value may be specified as tolowerunder:Y + case command_FieldId_pathcomp: { // *out_anon = false; } break; default: @@ -24091,7 +26044,7 @@ algo::Fildes command::strconv_StartRead(command::strconv_proc& parent, algo_lib: // --- command.strconv_proc.strconv.Kill // Kill subprocess and wait void command::strconv_Kill(command::strconv_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); strconv_Wait(parent); } @@ -24239,53 +26192,44 @@ bool command::sv2ssim_ReadFieldMaybe(command::sv2ssim& parent, algo::strptr fiel switch(field_id) { case command_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } + } break; case command_FieldId_fname: { retval = algo::cstring_ReadStrptrMaybe(parent.fname, strval); - break; - } + } break; case command_FieldId_separator: { retval = char_ReadStrptrMaybe(parent.separator, strval); - break; - } + } break; case command_FieldId_outseparator: { retval = algo::cstring_ReadStrptrMaybe(parent.outseparator, strval); - break; - } + } break; case command_FieldId_header: { retval = bool_ReadStrptrMaybe(parent.header, strval); - break; - } + } break; case command_FieldId_ctype: { retval = algo::cstring_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case command_FieldId_ssimfile: { retval = algo::cstring_ReadStrptrMaybe(parent.ssimfile, strval); - break; - } + } break; case command_FieldId_schema: { retval = bool_ReadStrptrMaybe(parent.schema, strval); - break; - } + } break; case command_FieldId_field: { retval = field_ReadStrptrMaybe(parent, strval); - break; - } + } break; case command_FieldId_data: { retval = bool_ReadStrptrMaybe(parent.data, strval); - break; - } + } break; case command_FieldId_report: { retval = bool_ReadStrptrMaybe(parent.report, strval); - break; - } + } break; case command_FieldId_prefer_signed: { retval = bool_ReadStrptrMaybe(parent.prefer_signed, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -24438,48 +26382,48 @@ algo::strptr command::sv2ssim_GetAnon(command::sv2ssim &parent, i32 idx) { i32 command::sv2ssim_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case command_FieldId_in: { // $comment + case command_FieldId_in: { // *out_anon = false; } break; - case command_FieldId_fname: { // $comment + case command_FieldId_fname: { // *out_anon = true; } break; - case command_FieldId_separator: { // $comment + case command_FieldId_separator: { // *out_anon = false; } break; - case command_FieldId_outseparator: { // $comment + case command_FieldId_outseparator: { // *out_anon = false; } break; - case command_FieldId_header: { // $comment + case command_FieldId_header: { // bool: no argument required but value may be specified as header:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_ctype: { // bool: no argument required but value may be specified as header:Y + case command_FieldId_ctype: { // *out_anon = false; } break; - case command_FieldId_ssimfile: { // bool: no argument required but value may be specified as header:Y + case command_FieldId_ssimfile: { // *out_anon = false; } break; - case command_FieldId_schema: { // bool: no argument required but value may be specified as header:Y + case command_FieldId_schema: { // bool: no argument required but value may be specified as schema:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_field: { // bool: no argument required but value may be specified as schema:Y + case command_FieldId_field: { // *out_anon = false; } break; - case command_FieldId_data: { // bool: no argument required but value may be specified as schema:Y + case command_FieldId_data: { // bool: no argument required but value may be specified as data:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_report: { // bool: no argument required but value may be specified as data:Y + case command_FieldId_report: { // bool: no argument required but value may be specified as report:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case command_FieldId_prefer_signed: { // bool: no argument required but value may be specified as report:Y + case command_FieldId_prefer_signed: { // bool: no argument required but value may be specified as prefer_signed:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -24545,7 +26489,7 @@ algo::Fildes command::sv2ssim_StartRead(command::sv2ssim_proc& parent, algo_lib: // --- command.sv2ssim_proc.sv2ssim.Kill // Kill subprocess and wait void command::sv2ssim_Kill(command::sv2ssim_proc& parent) { - if (parent.pid != 0) { + if (parent.pid > 0) { kill(parent.pid,9); sv2ssim_Wait(parent); } diff --git a/cpp/gen/dev_gen.cpp b/cpp/gen/dev_gen.cpp index 1ef24bb4..a26d70a5 100644 --- a/cpp/gen/dev_gen.cpp +++ b/cpp/gen/dev_gen.cpp @@ -84,6 +84,12 @@ const char *dev_Mdmark_state_END = "END"; const char *dev_Mdmark_state_BEG_AUTO = "BEG_AUTO"; const char *dev_Mdmark_state_END_AUTO = "END_AUTO"; +// compile-time string constants for dev.Netproto.netproto +const char *dev_Netproto_netproto_http = "http"; +const char *dev_Netproto_netproto_https = "https"; +const char *dev_Netproto_netproto_smtp = "smtp"; +const char *dev_Netproto_netproto_ssh = "ssh"; + // compile-time string constants for dev.Sandbox.sandbox const char *dev_Sandbox_sandbox_abt_md = "abt_md"; @@ -110,13 +116,14 @@ bool dev::Arch_ReadFieldMaybe(dev::Arch& parent, algo::strptr field, algo::strpt switch(field_id) { case dev_FieldId_arch: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.arch, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -158,21 +165,20 @@ bool dev::Badline_ReadFieldMaybe(dev::Badline& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_badline: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.badline, strval); - break; - } + } break; case dev_FieldId_expr: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.expr, strval); - break; - } + } break; case dev_FieldId_targsrc_regx: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.targsrc_regx, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -273,29 +279,26 @@ bool dev::Builddir_ReadFieldMaybe(dev::Builddir& parent, algo::strptr field, alg switch(field_id) { case dev_FieldId_builddir: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.builddir, strval); - break; - } + } break; case dev_FieldId_uname: { retval = false; - break; - } + } break; case dev_FieldId_compiler: { retval = false; - break; - } + } break; case dev_FieldId_cfg: { retval = false; - break; - } + } break; case dev_FieldId_arch: { retval = false; - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -337,17 +340,17 @@ bool dev::Cfg_ReadFieldMaybe(dev::Cfg& parent, algo::strptr field, algo::strptr switch(field_id) { case dev_FieldId_cfg: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.cfg, strval); - break; - } + } break; case dev_FieldId_suffix: { retval = algo::Smallstr5_ReadStrptrMaybe(parent.suffix, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -392,45 +395,38 @@ bool dev::Compiler_ReadFieldMaybe(dev::Compiler& parent, algo::strptr field, alg switch(field_id) { case dev_FieldId_compiler: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.compiler, strval); - break; - } + } break; case dev_FieldId_ranlib: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.ranlib, strval); - break; - } + } break; case dev_FieldId_ar: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.ar, strval); - break; - } + } break; case dev_FieldId_link: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.link, strval); - break; - } + } break; case dev_FieldId_libext: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.libext, strval); - break; - } + } break; case dev_FieldId_exeext: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.exeext, strval); - break; - } + } break; case dev_FieldId_pchext: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.pchext, strval); - break; - } + } break; case dev_FieldId_objext: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.objext, strval); - break; - } + } break; case dev_FieldId_rc: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.rc, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -496,17 +492,17 @@ bool dev::Copyright_ReadFieldMaybe(dev::Copyright& parent, algo::strptr field, a switch(field_id) { case dev_FieldId_copyright: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.copyright, strval); - break; - } + } break; case dev_FieldId_dflt: { retval = bool_ReadStrptrMaybe(parent.dflt, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -551,33 +547,29 @@ bool dev::Covfile_ReadFieldMaybe(dev::Covfile& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_covfile: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.covfile, strval); - break; - } + } break; case dev_FieldId_total: { retval = u32_ReadStrptrMaybe(parent.total, strval); - break; - } + } break; case dev_FieldId_nonexe: { retval = u32_ReadStrptrMaybe(parent.nonexe, strval); - break; - } + } break; case dev_FieldId_exe: { retval = u32_ReadStrptrMaybe(parent.exe, strval); - break; - } + } break; case dev_FieldId_exer: { retval = algo::U32Dec2_ReadStrptrMaybe(parent.exer, strval); - break; - } + } break; case dev_FieldId_hit: { retval = u32_ReadStrptrMaybe(parent.hit, strval); - break; - } + } break; case dev_FieldId_cov: { retval = algo::U32Dec2_ReadStrptrMaybe(parent.cov, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -734,30 +726,27 @@ bool dev::Covline_ReadFieldMaybe(dev::Covline& parent, algo::strptr field, algo: (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case dev_FieldId_covline: { - retval = algo::Smallstr200_ReadStrptrMaybe(parent.covline, strval); - break; - } + retval = algo::cstring_ReadStrptrMaybe(parent.covline, strval); + } break; case dev_FieldId_src: { retval = false; - break; - } + } break; case dev_FieldId_line: { retval = false; - break; - } + } break; case dev_FieldId_flag: { retval = flag_ReadStrptrMaybe(parent, strval); - break; - } + } break; case dev_FieldId_hit: { retval = u32_ReadStrptrMaybe(parent.hit, strval); - break; - } + } break; case dev_FieldId_text: { retval = algo::cstring_ReadStrptrMaybe(parent.text, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -784,7 +773,7 @@ void dev::Covline_Print(dev::Covline& row, algo::cstring& str) { algo::tempstr temp; str << "dev.covline"; - algo::Smallstr200_Print(row.covline, temp); + algo::cstring_Print(row.covline, temp); PrintAttrSpaceReset(str,"covline", temp); dev::flag_Print(row, temp); @@ -805,33 +794,29 @@ bool dev::Covtarget_ReadFieldMaybe(dev::Covtarget& parent, algo::strptr field, a switch(field_id) { case dev_FieldId_covtarget: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.covtarget, strval); - break; - } + } break; case dev_FieldId_total: { retval = u32_ReadStrptrMaybe(parent.total, strval); - break; - } + } break; case dev_FieldId_nonexe: { retval = u32_ReadStrptrMaybe(parent.nonexe, strval); - break; - } + } break; case dev_FieldId_exe: { retval = u32_ReadStrptrMaybe(parent.exe, strval); - break; - } + } break; case dev_FieldId_exer: { retval = algo::U32Dec2_ReadStrptrMaybe(parent.exer, strval); - break; - } + } break; case dev_FieldId_hit: { retval = u32_ReadStrptrMaybe(parent.hit, strval); - break; - } + } break; case dev_FieldId_cov: { retval = algo::U32Dec2_ReadStrptrMaybe(parent.cov, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -917,25 +902,23 @@ bool dev::Edaction_ReadFieldMaybe(dev::Edaction& parent, algo::strptr field, alg switch(field_id) { case dev_FieldId_edaction: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.edaction, strval); - break; - } + } break; case dev_FieldId_edacttype: { retval = false; - break; - } + } break; case dev_FieldId_name: { retval = false; - break; - } + } break; case dev_FieldId_needamc: { retval = bool_ReadStrptrMaybe(parent.needamc, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -980,13 +963,14 @@ bool dev::Edacttype_ReadFieldMaybe(dev::Edacttype& parent, algo::strptr field, a switch(field_id) { case dev_FieldId_edacttype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.edacttype, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1094,6 +1078,8 @@ const char* dev::value_ToCstr(const dev::FieldId& parent) { case dev_FieldId_path : ret = "path"; break; case dev_FieldId_genlist : ret = "genlist"; break; case dev_FieldId_strict : ret = "strict"; break; + case dev_FieldId_netproto : ret = "netproto"; break; + case dev_FieldId_tls : ret = "tls"; break; case dev_FieldId_opt_type : ret = "opt_type"; break; case dev_FieldId_sep : ret = "sep"; break; case dev_FieldId_baseref : ret = "baseref"; break; @@ -1103,10 +1089,13 @@ const char* dev::value_ToCstr(const dev::FieldId& parent) { case dev_FieldId_soft : ret = "soft"; break; case dev_FieldId_pkgkey : ret = "pkgkey"; break; case dev_FieldId_key : ret = "key"; break; + case dev_FieldId_prototransport : ret = "prototransport"; break; + case dev_FieldId_transport : ret = "transport"; break; case dev_FieldId_inl : ret = "inl"; break; case dev_FieldId_sandbox : ret = "sandbox"; break; case dev_FieldId_filter : ret = "filter"; break; case dev_FieldId_readmesort : ret = "readmesort"; break; + case dev_FieldId_rpm : ret = "rpm"; break; case dev_FieldId_sbpath : ret = "sbpath"; break; case dev_FieldId_syscmd : ret = "syscmd"; break; case dev_FieldId_execkey : ret = "execkey"; break; @@ -1117,13 +1106,13 @@ const char* dev::value_ToCstr(const dev::FieldId& parent) { case dev_FieldId_fail_prereq : ret = "fail_prereq"; break; case dev_FieldId_completed : ret = "completed"; break; case dev_FieldId_maxtime : ret = "maxtime"; break; - case dev_FieldId_syscmddep : ret = "syscmddep"; break; case dev_FieldId_child : ret = "child"; break; case dev_FieldId_syslib : ret = "syslib"; break; case dev_FieldId_targdep : ret = "targdep"; break; case dev_FieldId_target : ret = "target"; break; case dev_FieldId_targsrc : ret = "targsrc"; break; case dev_FieldId_targsyslib : ret = "targsyslib"; break; + case dev_FieldId_prefix : ret = "prefix"; break; case dev_FieldId_cov_min : ret = "cov_min"; break; case dev_FieldId_maxerr : ret = "maxerr"; break; case dev_FieldId_timefmt : ret = "timefmt"; break; @@ -1131,6 +1120,7 @@ const char* dev::value_ToCstr(const dev::FieldId& parent) { case dev_FieldId_tool_opt : ret = "tool_opt"; break; case dev_FieldId_opt : ret = "opt"; break; case dev_FieldId_sortfld : ret = "sortfld"; break; + case dev_FieldId_ip : ret = "ip"; break; case dev_FieldId_field : ret = "field"; break; case dev_FieldId_value : ret = "value"; break; } @@ -1161,6 +1151,9 @@ bool dev::value_SetStrptrMaybe(dev::FieldId& parent, algo::strptr rhs) { case LE_STR2('a','r'): { value_SetEnum(parent,dev_FieldId_ar); ret = true; break; } + case LE_STR2('i','p'): { + value_SetEnum(parent,dev_FieldId_ip); ret = true; break; + } case LE_STR2('r','c'): { value_SetEnum(parent,dev_FieldId_rc); ret = true; break; } @@ -1196,6 +1189,9 @@ bool dev::value_SetStrptrMaybe(dev::FieldId& parent, algo::strptr rhs) { case LE_STR3('p','i','d'): { value_SetEnum(parent,dev_FieldId_pid); ret = true; break; } + case LE_STR3('r','p','m'): { + value_SetEnum(parent,dev_FieldId_rpm); ret = true; break; + } case LE_STR3('s','e','p'): { value_SetEnum(parent,dev_FieldId_sep); ret = true; break; } @@ -1205,6 +1201,9 @@ bool dev::value_SetStrptrMaybe(dev::FieldId& parent, algo::strptr rhs) { case LE_STR3('s','y','s'): { value_SetEnum(parent,dev_FieldId_sys); ret = true; break; } + case LE_STR3('t','l','s'): { + value_SetEnum(parent,dev_FieldId_tls); ret = true; break; + } } break; } @@ -1331,6 +1330,9 @@ bool dev::value_SetStrptrMaybe(dev::FieldId& parent, algo::strptr rhs) { case LE_STR6('p','k','g','k','e','y'): { value_SetEnum(parent,dev_FieldId_pkgkey); ret = true; break; } + case LE_STR6('p','r','e','f','i','x'): { + value_SetEnum(parent,dev_FieldId_prefix); ret = true; break; + } case LE_STR6('r','a','n','l','i','b'): { value_SetEnum(parent,dev_FieldId_ranlib); ret = true; break; } @@ -1455,6 +1457,9 @@ bool dev::value_SetStrptrMaybe(dev::FieldId& parent, algo::strptr rhs) { case LE_STR8('f','i','l','e','n','a','m','e'): { value_SetEnum(parent,dev_FieldId_filename); ret = true; break; } + case LE_STR8('n','e','t','p','r','o','t','o'): { + value_SetEnum(parent,dev_FieldId_netproto); ret = true; break; + } case LE_STR8('o','p','t','_','t','y','p','e'): { value_SetEnum(parent,dev_FieldId_opt_type); ret = true; break; } @@ -1494,8 +1499,8 @@ bool dev::value_SetStrptrMaybe(dev::FieldId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"e",1)==0) { value_SetEnum(parent,dev_FieldId_nlongline); ret = true; break; } break; } - case LE_STR8('s','y','s','c','m','d','d','e'): { - if (memcmp(rhs.elems+8,"p",1)==0) { value_SetEnum(parent,dev_FieldId_syscmddep); ret = true; break; } + case LE_STR8('t','r','a','n','s','p','o','r'): { + if (memcmp(rhs.elems+8,"t",1)==0) { value_SetEnum(parent,dev_FieldId_transport); ret = true; break; } break; } } @@ -1548,6 +1553,15 @@ bool dev::value_SetStrptrMaybe(dev::FieldId& parent, algo::strptr rhs) { } break; } + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('p','r','o','t','o','t','r','a'): { + if (memcmp(rhs.elems+8,"nsport",6)==0) { value_SetEnum(parent,dev_FieldId_prototransport); ret = true; break; } + break; + } + } + break; + } } return ret; } @@ -1606,13 +1620,14 @@ bool dev::Gitfile_ReadFieldMaybe(dev::Gitfile& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_gitfile: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.gitfile, strval); - break; - } + } break; case dev_FieldId_ext: { retval = false; - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1651,29 +1666,26 @@ bool dev::Gitinfo_ReadFieldMaybe(dev::Gitinfo& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_gitinfo: { retval = algo::Smallstr40_ReadStrptrMaybe(parent.gitinfo, strval); - break; - } + } break; case dev_FieldId_author: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.author, strval); - break; - } + } break; case dev_FieldId_cfg: { retval = algo::Smallstr40_ReadStrptrMaybe(parent.cfg, strval); - break; - } + } break; case dev_FieldId_compver: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.compver, strval); - break; - } + } break; case dev_FieldId_package: { retval = algo::Smallstr40_ReadStrptrMaybe(parent.package, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1727,17 +1739,17 @@ bool dev::Hilite_ReadFieldMaybe(dev::Hilite& parent, algo::strptr field, algo::s switch(field_id) { case dev_FieldId_hilite: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.hilite, strval); - break; - } + } break; case dev_FieldId_color: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.color, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1782,17 +1794,17 @@ bool dev::Htmlentity_ReadFieldMaybe(dev::Htmlentity& parent, algo::strptr field, switch(field_id) { case dev_FieldId_htmlentity: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.htmlentity, strval); - break; - } + } break; case dev_FieldId_code: { retval = i32_ReadStrptrMaybe(parent.code, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1866,25 +1878,23 @@ bool dev::Include_ReadFieldMaybe(dev::Include& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_include: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.include, strval); - break; - } + } break; case dev_FieldId_srcfile: { retval = false; - break; - } + } break; case dev_FieldId_filename: { retval = false; - break; - } + } break; case dev_FieldId_sys: { retval = bool_ReadStrptrMaybe(parent.sys, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1929,13 +1939,14 @@ bool dev::License_ReadFieldMaybe(dev::License& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_license: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.license, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1977,41 +1988,35 @@ bool dev::Linelim_ReadFieldMaybe(dev::Linelim& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_gitfile: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.gitfile, strval); - break; - } + } break; case dev_FieldId_nlongline: { retval = u32_ReadStrptrMaybe(parent.nlongline, strval); - break; - } + } break; case dev_FieldId_longestline: { retval = u32_ReadStrptrMaybe(parent.longestline, strval); - break; - } + } break; case dev_FieldId_nbadws: { retval = u32_ReadStrptrMaybe(parent.nbadws, strval); - break; - } + } break; case dev_FieldId_maxws: { retval = u32_ReadStrptrMaybe(parent.maxws, strval); - break; - } + } break; case dev_FieldId_nlongfunc: { retval = u32_ReadStrptrMaybe(parent.nlongfunc, strval); - break; - } + } break; case dev_FieldId_longestfunc: { retval = u32_ReadStrptrMaybe(parent.longestfunc, strval); - break; - } + } break; case dev_FieldId_nmysteryfunc: { retval = u32_ReadStrptrMaybe(parent.nmysteryfunc, strval); - break; - } + } break; case dev_FieldId_badness: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.badness, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2074,17 +2079,17 @@ bool dev::Mdmark_ReadFieldMaybe(dev::Mdmark& parent, algo::strptr field, algo::s switch(field_id) { case dev_FieldId_mdmark: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.mdmark, strval); - break; - } + } break; case dev_FieldId_state: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.state, strval); - break; - } + } break; case dev_FieldId_param: { retval = algo::cstring_ReadStrptrMaybe(parent.param, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2192,25 +2197,23 @@ bool dev::Mdsection_ReadFieldMaybe(dev::Mdsection& parent, algo::strptr field, a switch(field_id) { case dev_FieldId_mdsection: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.mdsection, strval); - break; - } + } break; case dev_FieldId_match: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.match, strval); - break; - } + } break; case dev_FieldId_path: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.path, strval); - break; - } + } break; case dev_FieldId_genlist: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.genlist, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2261,17 +2264,17 @@ bool dev::Msgfile_ReadFieldMaybe(dev::Msgfile& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_gitfile: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.gitfile, strval); - break; - } + } break; case dev_FieldId_strict: { retval = bool_ReadStrptrMaybe(parent.strict, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2308,21 +2311,25 @@ void dev::Msgfile_Print(dev::Msgfile& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } -// --- dev.Noindent..ReadFieldMaybe -bool dev::Noindent_ReadFieldMaybe(dev::Noindent& parent, algo::strptr field, algo::strptr strval) { +// --- dev.Netproto..ReadFieldMaybe +bool dev::Netproto_ReadFieldMaybe(dev::Netproto& parent, algo::strptr field, algo::strptr strval) { bool retval = true; dev::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case dev_FieldId_gitfile: { - retval = algo::Smallstr200_ReadStrptrMaybe(parent.gitfile, strval); - break; - } + case dev_FieldId_netproto: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.netproto, strval); + } break; + case dev_FieldId_tls: { + retval = bool_ReadStrptrMaybe(parent.tls, strval); + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2330,51 +2337,103 @@ bool dev::Noindent_ReadFieldMaybe(dev::Noindent& parent, algo::strptr field, alg return retval; } -// --- dev.Noindent..ReadStrptrMaybe -// Read fields of dev::Noindent from an ascii string. +// --- dev.Netproto..ReadStrptrMaybe +// Read fields of dev::Netproto from an ascii string. // The format of the string is an ssim Tuple -bool dev::Noindent_ReadStrptrMaybe(dev::Noindent &parent, algo::strptr in_str) { +bool dev::Netproto_ReadStrptrMaybe(dev::Netproto &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "dev.noindent") || algo::StripTypeTag(in_str, "dev.Noindent"); + retval = algo::StripTypeTag(in_str, "dev.netproto") || algo::StripTypeTag(in_str, "dev.Netproto"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && Noindent_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && Netproto_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- dev.Noindent..Print +// --- dev.Netproto..Print // print string representation of ROW to string STR -// cfmt:dev.Noindent.String printfmt:Tuple -void dev::Noindent_Print(dev::Noindent& row, algo::cstring& str) { +// cfmt:dev.Netproto.String printfmt:Tuple +void dev::Netproto_Print(dev::Netproto& row, algo::cstring& str) { algo::tempstr temp; - str << "dev.noindent"; + str << "dev.netproto"; - algo::Smallstr200_Print(row.gitfile, temp); - PrintAttrSpaceReset(str,"gitfile", temp); + algo::Smallstr50_Print(row.netproto, temp); + PrintAttrSpaceReset(str,"netproto", temp); + + bool_Print(row.tls, temp); + PrintAttrSpaceReset(str,"tls", temp); algo::Comment_Print(row.comment, temp); PrintAttrSpaceReset(str,"comment", temp); } -// --- dev.OptType..ReadFieldMaybe -bool dev::OptType_ReadFieldMaybe(dev::OptType& parent, algo::strptr field, algo::strptr strval) { +// --- dev.Noindent..ReadFieldMaybe +bool dev::Noindent_ReadFieldMaybe(dev::Noindent& parent, algo::strptr field, algo::strptr strval) { bool retval = true; dev::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case dev_FieldId_opt_type: { - retval = algo::Smallstr50_ReadStrptrMaybe(parent.opt_type, strval); - break; - } - case dev_FieldId_sep: { - retval = algo::RspaceStr4_ReadStrptrMaybe(parent.sep, strval); - break; - } + case dev_FieldId_gitfile: { + retval = algo::Smallstr200_ReadStrptrMaybe(parent.gitfile, strval); + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- dev.Noindent..ReadStrptrMaybe +// Read fields of dev::Noindent from an ascii string. +// The format of the string is an ssim Tuple +bool dev::Noindent_ReadStrptrMaybe(dev::Noindent &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "dev.noindent") || algo::StripTypeTag(in_str, "dev.Noindent"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Noindent_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- dev.Noindent..Print +// print string representation of ROW to string STR +// cfmt:dev.Noindent.String printfmt:Tuple +void dev::Noindent_Print(dev::Noindent& row, algo::cstring& str) { + algo::tempstr temp; + str << "dev.noindent"; + + algo::Smallstr200_Print(row.gitfile, temp); + PrintAttrSpaceReset(str,"gitfile", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- dev.OptType..ReadFieldMaybe +bool dev::OptType_ReadFieldMaybe(dev::OptType& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + dev::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case dev_FieldId_opt_type: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.opt_type, strval); + } break; + case dev_FieldId_sep: { + retval = algo::RspaceStr4_ReadStrptrMaybe(parent.sep, strval); + } break; + case dev_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2419,21 +2478,20 @@ bool dev::Package_ReadFieldMaybe(dev::Package& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_package: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.package, strval); - break; - } + } break; case dev_FieldId_baseref: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.baseref, strval); - break; - } + } break; case dev_FieldId_origin: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.origin, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2510,25 +2568,23 @@ bool dev::Pkgdep_ReadFieldMaybe(dev::Pkgdep& parent, algo::strptr field, algo::s switch(field_id) { case dev_FieldId_pkgdep: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.pkgdep, strval); - break; - } + } break; case dev_FieldId_package: { retval = false; - break; - } + } break; case dev_FieldId_parent: { retval = false; - break; - } + } break; case dev_FieldId_soft: { retval = bool_ReadStrptrMaybe(parent.soft, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2602,21 +2658,20 @@ bool dev::Pkgkey_ReadFieldMaybe(dev::Pkgkey& parent, algo::strptr field, algo::s switch(field_id) { case dev_FieldId_pkgkey: { retval = algo::Smallstr150_ReadStrptrMaybe(parent.pkgkey, strval); - break; - } + } break; case dev_FieldId_package: { retval = false; - break; - } + } break; case dev_FieldId_key: { retval = false; - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2650,33 +2705,115 @@ void dev::Pkgkey_Print(dev::Pkgkey& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } -// --- dev.Readme..ReadFieldMaybe -bool dev::Readme_ReadFieldMaybe(dev::Readme& parent, algo::strptr field, algo::strptr strval) { +// --- dev.Prototransport.netproto.Get +algo::Smallstr50 dev::netproto_Get(dev::Prototransport& parent) { + algo::Smallstr50 ret(algo::Pathcomp(parent.prototransport, "/RL")); + return ret; +} + +// --- dev.Prototransport.netproto.Get2 +algo::Smallstr50 dev::Prototransport_netproto_Get(algo::strptr arg) { + algo::Smallstr50 ret(algo::Pathcomp(arg, "/RL")); + return ret; +} + +// --- dev.Prototransport.transport.Get +algo::Smallstr50 dev::transport_Get(dev::Prototransport& parent) { + algo::Smallstr50 ret(algo::Pathcomp(parent.prototransport, "/RR")); + return ret; +} + +// --- dev.Prototransport.transport.Get2 +algo::Smallstr50 dev::Prototransport_transport_Get(algo::strptr arg) { + algo::Smallstr50 ret(algo::Pathcomp(arg, "/RR")); + return ret; +} + +// --- dev.Prototransport..Concat_netproto_transport +tempstr dev::Prototransport_Concat_netproto_transport( const algo::strptr& netproto ,const algo::strptr& transport ) { + return tempstr() << netproto <<'/'<< transport ; +} + +// --- dev.Prototransport..ReadFieldMaybe +bool dev::Prototransport_ReadFieldMaybe(dev::Prototransport& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + dev::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case dev_FieldId_prototransport: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.prototransport, strval); + } break; + case dev_FieldId_netproto: { + retval = false; + } break; + case dev_FieldId_transport: { + retval = false; + } break; + case dev_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- dev.Prototransport..ReadStrptrMaybe +// Read fields of dev::Prototransport from an ascii string. +// The format of the string is an ssim Tuple +bool dev::Prototransport_ReadStrptrMaybe(dev::Prototransport &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "dev.prototransport") || algo::StripTypeTag(in_str, "dev.Prototransport"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Prototransport_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- dev.Prototransport..Print +// print string representation of ROW to string STR +// cfmt:dev.Prototransport.String printfmt:Tuple +void dev::Prototransport_Print(dev::Prototransport& row, algo::cstring& str) { + algo::tempstr temp; + str << "dev.prototransport"; + + algo::Smallstr50_Print(row.prototransport, temp); + PrintAttrSpaceReset(str,"prototransport", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- dev.Readmefile..ReadFieldMaybe +bool dev::Readmefile_ReadFieldMaybe(dev::Readmefile& parent, algo::strptr field, algo::strptr strval) { bool retval = true; dev::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case dev_FieldId_gitfile: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.gitfile, strval); - break; - } + } break; case dev_FieldId_inl: { retval = bool_ReadStrptrMaybe(parent.inl, strval); - break; - } + } break; case dev_FieldId_sandbox: { retval = bool_ReadStrptrMaybe(parent.sandbox, strval); - break; - } + } break; case dev_FieldId_filter: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.filter, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2684,24 +2821,24 @@ bool dev::Readme_ReadFieldMaybe(dev::Readme& parent, algo::strptr field, algo::s return retval; } -// --- dev.Readme..ReadStrptrMaybe -// Read fields of dev::Readme from an ascii string. +// --- dev.Readmefile..ReadStrptrMaybe +// Read fields of dev::Readmefile from an ascii string. // The format of the string is an ssim Tuple -bool dev::Readme_ReadStrptrMaybe(dev::Readme &parent, algo::strptr in_str) { +bool dev::Readmefile_ReadStrptrMaybe(dev::Readmefile &parent, algo::strptr in_str) { bool retval = true; - retval = algo::StripTypeTag(in_str, "dev.readme") || algo::StripTypeTag(in_str, "dev.Readme"); + retval = algo::StripTypeTag(in_str, "dev.readmefile") || algo::StripTypeTag(in_str, "dev.Readmefile"); ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && Readme_ReadFieldMaybe(parent, attr.name, attr.value); + retval = retval && Readmefile_ReadFieldMaybe(parent, attr.name, attr.value); }ind_end; return retval; } -// --- dev.Readme..Print +// --- dev.Readmefile..Print // print string representation of ROW to string STR -// cfmt:dev.Readme.String printfmt:Tuple -void dev::Readme_Print(dev::Readme& row, algo::cstring& str) { +// cfmt:dev.Readmefile.String printfmt:Tuple +void dev::Readmefile_Print(dev::Readmefile& row, algo::cstring& str) { algo::tempstr temp; - str << "dev.readme"; + str << "dev.readmefile"; algo::Smallstr200_Print(row.gitfile, temp); PrintAttrSpaceReset(str,"gitfile", temp); @@ -2727,13 +2864,14 @@ bool dev::Readmesort_ReadFieldMaybe(dev::Readmesort& parent, algo::strptr field, switch(field_id) { case dev_FieldId_readmesort: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.readmesort, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2767,6 +2905,55 @@ void dev::Readmesort_Print(dev::Readmesort& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } +// --- dev.Rpm..ReadFieldMaybe +bool dev::Rpm_ReadFieldMaybe(dev::Rpm& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + dev::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case dev_FieldId_rpm: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.rpm, strval); + } break; + case dev_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- dev.Rpm..ReadStrptrMaybe +// Read fields of dev::Rpm from an ascii string. +// The format of the string is an ssim Tuple +bool dev::Rpm_ReadStrptrMaybe(dev::Rpm &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "dev.rpm") || algo::StripTypeTag(in_str, "dev.Rpm"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Rpm_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- dev.Rpm..Print +// print string representation of ROW to string STR +// cfmt:dev.Rpm.String printfmt:Tuple +void dev::Rpm_Print(dev::Rpm& row, algo::cstring& str) { + algo::tempstr temp; + str << "dev.rpm"; + + algo::Smallstr50_Print(row.rpm, temp); + PrintAttrSpaceReset(str,"rpm", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + // --- dev.Sandbox..ReadFieldMaybe bool dev::Sandbox_ReadFieldMaybe(dev::Sandbox& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -2775,13 +2962,14 @@ bool dev::Sandbox_ReadFieldMaybe(dev::Sandbox& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_sandbox: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.sandbox, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2823,13 +3011,14 @@ bool dev::Sbpath_ReadFieldMaybe(dev::Sbpath& parent, algo::strptr field, algo::s switch(field_id) { case dev_FieldId_sbpath: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.sbpath, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2883,21 +3072,20 @@ bool dev::Scriptfile_ReadFieldMaybe(dev::Scriptfile& parent, algo::strptr field, switch(field_id) { case dev_FieldId_gitfile: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.gitfile, strval); - break; - } + } break; case dev_FieldId_name: { retval = false; - break; - } + } break; case dev_FieldId_license: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.license, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2954,13 +3142,14 @@ bool dev::Srcfile_ReadFieldMaybe(dev::Srcfile& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_srcfile: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.srcfile, strval); - break; - } + } break; case dev_FieldId_ext: { retval = false; - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2999,41 +3188,35 @@ bool dev::Syscmd_ReadFieldMaybe(dev::Syscmd& parent, algo::strptr field, algo::s switch(field_id) { case dev_FieldId_syscmd: { retval = i64_ReadStrptrMaybe(parent.syscmd, strval); - break; - } + } break; case dev_FieldId_execkey: { retval = false; - break; - } + } break; case dev_FieldId_command: { retval = algo::cstring_ReadStrptrMaybe(parent.command, strval); - break; - } + } break; case dev_FieldId_pid: { retval = i32_ReadStrptrMaybe(parent.pid, strval); - break; - } + } break; case dev_FieldId_status: { retval = i32_ReadStrptrMaybe(parent.status, strval); - break; - } + } break; case dev_FieldId_nprereq: { retval = i32_ReadStrptrMaybe(parent.nprereq, strval); - break; - } + } break; case dev_FieldId_fail_prereq: { retval = bool_ReadStrptrMaybe(parent.fail_prereq, strval); - break; - } + } break; case dev_FieldId_completed: { retval = bool_ReadStrptrMaybe(parent.completed, strval); - break; - } + } break; case dev_FieldId_maxtime: { retval = i32_ReadStrptrMaybe(parent.maxtime, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3091,19 +3274,16 @@ bool dev::Syscmddep_ReadFieldMaybe(dev::Syscmddep& parent, algo::strptr field, a dev::FieldId field_id; (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { - case dev_FieldId_syscmddep: { - retval = false; - break; - } case dev_FieldId_child: { retval = i64_ReadStrptrMaybe(parent.child, strval); - break; - } + } break; case dev_FieldId_parent: { retval = i64_ReadStrptrMaybe(parent.parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3145,13 +3325,14 @@ bool dev::Syslib_ReadFieldMaybe(dev::Syslib& parent, algo::strptr field, algo::s switch(field_id) { case dev_FieldId_syslib: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.syslib, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3222,21 +3403,20 @@ bool dev::Targdep_ReadFieldMaybe(dev::Targdep& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_targdep: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.targdep, strval); - break; - } + } break; case dev_FieldId_target: { retval = false; - break; - } + } break; case dev_FieldId_parent: { retval = false; - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3278,9 +3458,11 @@ bool dev::Target_ReadFieldMaybe(dev::Target& parent, algo::strptr field, algo::s switch(field_id) { case dev_FieldId_target: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.target, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3360,25 +3542,23 @@ bool dev::Targsrc_ReadFieldMaybe(dev::Targsrc& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_targsrc: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.targsrc, strval); - break; - } + } break; case dev_FieldId_target: { retval = false; - break; - } + } break; case dev_FieldId_src: { retval = false; - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } + } break; case dev_FieldId_ext: { retval = false; - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3448,6 +3628,18 @@ algo::Smallstr50 dev::Targsyslib_uname_Get(algo::strptr arg) { return ret; } +// --- dev.Targsyslib.prefix.Get +algo::Smallstr50 dev::prefix_Get(dev::Targsyslib& parent) { + algo::Smallstr50 ret(algo::Pathcomp(parent.targsyslib, ".RL")); + return ret; +} + +// --- dev.Targsyslib.prefix.Get2 +algo::Smallstr50 dev::Targsyslib_prefix_Get(algo::strptr arg) { + algo::Smallstr50 ret(algo::Pathcomp(arg, ".RL")); + return ret; +} + // --- dev.Targsyslib..Concat_uname_target_syslib tempstr dev::Targsyslib_Concat_uname_target_syslib( const algo::strptr& uname ,const algo::strptr& target ,const algo::strptr& syslib ) { return tempstr() << uname <<'/'<< target <<'.'<< syslib ; @@ -3461,25 +3653,26 @@ bool dev::Targsyslib_ReadFieldMaybe(dev::Targsyslib& parent, algo::strptr field, switch(field_id) { case dev_FieldId_targsyslib: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.targsyslib, strval); - break; - } + } break; case dev_FieldId_target: { retval = false; - break; - } + } break; case dev_FieldId_syslib: { retval = false; - break; - } + } break; case dev_FieldId_uname: { retval = false; - break; - } + } break; + case dev_FieldId_prefix: { + retval = false; + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3521,21 +3714,20 @@ bool dev::Tgtcov_ReadFieldMaybe(dev::Tgtcov& parent, algo::strptr field, algo::s switch(field_id) { case dev_FieldId_target: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.target, strval); - break; - } + } break; case dev_FieldId_cov_min: { retval = algo::U32Dec2_ReadStrptrMaybe(parent.cov_min, strval); - break; - } + } break; case dev_FieldId_maxerr: { retval = algo::U32Dec2_ReadStrptrMaybe(parent.maxerr, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3583,17 +3775,17 @@ bool dev::Timefmt_ReadFieldMaybe(dev::Timefmt& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_timefmt: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.timefmt, strval); - break; - } + } break; case dev_FieldId_dirname: { retval = bool_ReadStrptrMaybe(parent.dirname, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3739,45 +3931,38 @@ bool dev::ToolOpt_ReadFieldMaybe(dev::ToolOpt& parent, algo::strptr field, algo: switch(field_id) { case dev_FieldId_tool_opt: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.tool_opt, strval); - break; - } + } break; case dev_FieldId_uname: { retval = false; - break; - } + } break; case dev_FieldId_compiler: { retval = false; - break; - } + } break; case dev_FieldId_cfg: { retval = false; - break; - } + } break; case dev_FieldId_arch: { retval = false; - break; - } + } break; case dev_FieldId_target: { retval = false; - break; - } + } break; case dev_FieldId_opt_type: { retval = false; - break; - } + } break; case dev_FieldId_opt: { retval = false; - break; - } + } break; case dev_FieldId_sortfld: { retval = false; - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3811,6 +3996,61 @@ void dev::ToolOpt_Print(dev::ToolOpt& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } +// --- dev.Transport..ReadFieldMaybe +bool dev::Transport_ReadFieldMaybe(dev::Transport& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + dev::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case dev_FieldId_transport: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.transport, strval); + } break; + case dev_FieldId_ip: { + retval = bool_ReadStrptrMaybe(parent.ip, strval); + } break; + case dev_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- dev.Transport..ReadStrptrMaybe +// Read fields of dev::Transport from an ascii string. +// The format of the string is an ssim Tuple +bool dev::Transport_ReadStrptrMaybe(dev::Transport &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "dev.transport") || algo::StripTypeTag(in_str, "dev.Transport"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Transport_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- dev.Transport..Print +// print string representation of ROW to string STR +// cfmt:dev.Transport.String printfmt:Tuple +void dev::Transport_Print(dev::Transport& row, algo::cstring& str) { + algo::tempstr temp; + str << "dev.transport"; + + algo::Smallstr50_Print(row.transport, temp); + PrintAttrSpaceReset(str,"transport", temp); + + bool_Print(row.ip, temp); + PrintAttrSpaceReset(str,"ip", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + // --- dev.Uname..ReadFieldMaybe bool dev::Uname_ReadFieldMaybe(dev::Uname& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -3819,13 +4059,14 @@ bool dev::Uname_ReadFieldMaybe(dev::Uname& parent, algo::strptr field, algo::str switch(field_id) { case dev_FieldId_uname: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.uname, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3867,13 +4108,14 @@ bool dev::Unstablefld_ReadFieldMaybe(dev::Unstablefld& parent, algo::strptr fiel switch(field_id) { case dev_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dev_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); diff --git a/cpp/gen/dmmeta_gen.cpp b/cpp/gen/dmmeta_gen.cpp index 31d171d7..f15630a7 100644 --- a/cpp/gen/dmmeta_gen.cpp +++ b/cpp/gen/dmmeta_gen.cpp @@ -29,12 +29,12 @@ #include "include/gen/algo_gen.inl.h" //#pragma endinclude // compile-time string constants for dmmeta.Buftype.pnewtype -const char *dmmeta_Buftype_pnewtype_Memptr = "Memptr"; -const char *dmmeta_Buftype_pnewtype_AmsStream = "AmsStream"; -const char *dmmeta_Buftype_pnewtype_Fixed = "Fixed"; -const char *dmmeta_Buftype_pnewtype_Dynamic = "Dynamic"; -const char *dmmeta_Buftype_pnewtype_ByteAry = "ByteAry"; -const char *dmmeta_Buftype_pnewtype_Append = "Append"; +const char *dmmeta_Buftype_pnewtype_Memptr = "Memptr"; +const char *dmmeta_Buftype_pnewtype_Shm = "Shm"; +const char *dmmeta_Buftype_pnewtype_Fixed = "Fixed"; +const char *dmmeta_Buftype_pnewtype_Dynamic = "Dynamic"; +const char *dmmeta_Buftype_pnewtype_ByteAry = "ByteAry"; +const char *dmmeta_Buftype_pnewtype_Append = "Append"; // compile-time string constants for dmmeta.Fastenc.fastenc const char *dmmeta_Fastenc_fastenc_byteVector = "byteVector"; @@ -75,6 +75,7 @@ const char *dmmeta_Fbuftype_fbuftype_Msgbuf = "Msgbuf"; // compile-time string constants for dmmeta.Hashtype.hashtype const char *dmmeta_Hashtype_hashtype_Extern = "Extern"; const char *dmmeta_Hashtype_hashtype_CRC32 = "CRC32"; +const char *dmmeta_Hashtype_hashtype_Linear = "Linear"; // compile-time string constants for dmmeta.Ns.ns const char *dmmeta_Ns_ns_ = ""; @@ -94,7 +95,6 @@ const char *dmmeta_Ns_ns_amc_vis = "amc_vis"; const char *dmmeta_Ns_ns_amcdb = "amcdb"; const char *dmmeta_Ns_ns_ams = "ams"; -const char *dmmeta_Ns_ns_ams_cat = "ams_cat"; const char *dmmeta_Ns_ns_ams_sendtest = "ams_sendtest"; const char *dmmeta_Ns_ns_amsdb = "amsdb"; const char *dmmeta_Ns_ns_apm = "apm"; @@ -105,6 +105,7 @@ const char *dmmeta_Ns_ns_atf_ci = "atf_ci"; const char *dmmeta_Ns_ns_atf_cmdline = "atf_cmdline"; const char *dmmeta_Ns_ns_atf_comp = "atf_comp"; const char *dmmeta_Ns_ns_atf_cov = "atf_cov"; +const char *dmmeta_Ns_ns_atf_exp = "atf_exp"; const char *dmmeta_Ns_ns_atf_fuzz = "atf_fuzz"; const char *dmmeta_Ns_ns_atf_gcli = "atf_gcli"; const char *dmmeta_Ns_ns_atf_nrun = "atf_nrun"; @@ -120,25 +121,37 @@ const char *dmmeta_Ns_ns_gcache = "gcache"; const char *dmmeta_Ns_ns_gcli = "gcli"; const char *dmmeta_Ns_ns_gclidb = "gclidb"; +const char *dmmeta_Ns_ns_http = "http"; +const char *dmmeta_Ns_ns_httpdb = "httpdb"; const char *dmmeta_Ns_ns_ietf = "ietf"; +const char *dmmeta_Ns_ns_jkv = "jkv"; +const char *dmmeta_Ns_ns_js = "js"; +const char *dmmeta_Ns_ns_kafka = "kafka"; const char *dmmeta_Ns_ns_lib_amcdb = "lib_amcdb"; const char *dmmeta_Ns_ns_lib_ams = "lib_ams"; const char *dmmeta_Ns_ns_lib_ctype = "lib_ctype"; +const char *dmmeta_Ns_ns_lib_curl = "lib_curl"; const char *dmmeta_Ns_ns_lib_exec = "lib_exec"; const char *dmmeta_Ns_ns_lib_fm = "lib_fm"; const char *dmmeta_Ns_ns_lib_git = "lib_git"; +const char *dmmeta_Ns_ns_lib_http = "lib_http"; const char *dmmeta_Ns_ns_lib_iconv = "lib_iconv"; const char *dmmeta_Ns_ns_lib_json = "lib_json"; const char *dmmeta_Ns_ns_lib_mysql = "lib_mysql"; +const char *dmmeta_Ns_ns_lib_netio = "lib_netio"; const char *dmmeta_Ns_ns_lib_prot = "lib_prot"; +const char *dmmeta_Ns_ns_lib_rl = "lib_rl"; const char *dmmeta_Ns_ns_lib_sql = "lib_sql"; const char *dmmeta_Ns_ns_lib_sqlite = "lib_sqlite"; +const char *dmmeta_Ns_ns_lib_ws = "lib_ws"; const char *dmmeta_Ns_ns_mdbg = "mdbg"; const char *dmmeta_Ns_ns_mysql2ssim = "mysql2ssim"; const char *dmmeta_Ns_ns_orgfile = "orgfile"; const char *dmmeta_Ns_ns_report = "report"; +const char *dmmeta_Ns_ns_samp_make = "samp_make"; const char *dmmeta_Ns_ns_samp_meng = "samp_meng"; const char *dmmeta_Ns_ns_samp_regx = "samp_regx"; +const char *dmmeta_Ns_ns_sampdb = "sampdb"; const char *dmmeta_Ns_ns_sandbox = "sandbox"; const char *dmmeta_Ns_ns_src_func = "src_func"; const char *dmmeta_Ns_ns_src_hdr = "src_hdr"; @@ -151,6 +164,9 @@ const char *dmmeta_Ns_ns_ssimfilt = "ssimfilt"; const char *dmmeta_Ns_ns_strconv = "strconv"; const char *dmmeta_Ns_ns_sv2ssim = "sv2ssim"; +const char *dmmeta_Ns_ns_ws = "ws"; +const char *dmmeta_Ns_ns_wsdb = "wsdb"; + // compile-time string constants for dmmeta.Nstype.nstype const char *dmmeta_Nstype_nstype_exe = "exe"; const char *dmmeta_Nstype_nstype_lib = "lib"; @@ -220,13 +236,13 @@ const char *dmmeta_Ssimfile_ssimfile_amcdb_curstype = "amcdb.curstype"; const char *dmmeta_Ssimfile_ssimfile_amcdb_gen = "amcdb.gen"; const char *dmmeta_Ssimfile_ssimfile_amcdb_regxtype = "amcdb.regxtype"; -const char *dmmeta_Ssimfile_ssimfile_amcdb_tclass = "amcdb.tclass"; -const char *dmmeta_Ssimfile_ssimfile_amcdb_tcurs = "amcdb.tcurs"; -const char *dmmeta_Ssimfile_ssimfile_amcdb_tfunc = "amcdb.tfunc"; -const char *dmmeta_Ssimfile_ssimfile_amsdb_proctype = "amsdb.proctype"; -const char *dmmeta_Ssimfile_ssimfile_amsdb_streamtype = "amsdb.streamtype"; -const char *dmmeta_Ssimfile_ssimfile_atfdb_amctest = "atfdb.amctest"; -const char *dmmeta_Ssimfile_ssimfile_atfdb_cijob = "atfdb.cijob"; +const char *dmmeta_Ssimfile_ssimfile_amcdb_tclass = "amcdb.tclass"; +const char *dmmeta_Ssimfile_ssimfile_amcdb_tcurs = "amcdb.tcurs"; +const char *dmmeta_Ssimfile_ssimfile_amcdb_tfunc = "amcdb.tfunc"; +const char *dmmeta_Ssimfile_ssimfile_amsdb_proctype = "amsdb.proctype"; +const char *dmmeta_Ssimfile_ssimfile_amsdb_shmtype = "amsdb.shmtype"; +const char *dmmeta_Ssimfile_ssimfile_atfdb_amctest = "atfdb.amctest"; +const char *dmmeta_Ssimfile_ssimfile_atfdb_cijob = "atfdb.cijob"; const char *dmmeta_Ssimfile_ssimfile_atfdb_cipackage = "atfdb.cipackage"; const char *dmmeta_Ssimfile_ssimfile_atfdb_citest = "atfdb.citest"; @@ -241,6 +257,7 @@ const char *dmmeta_Ssimfile_ssimfile_atfdb_test_gsymbol_strptr = "atfdb.test_g const char *dmmeta_Ssimfile_ssimfile_atfdb_tfilt = "atfdb.tfilt"; const char *dmmeta_Ssimfile_ssimfile_atfdb_tmsg = "atfdb.tmsg"; const char *dmmeta_Ssimfile_ssimfile_atfdb_unittest = "atfdb.unittest"; +const char *dmmeta_Ssimfile_ssimfile_atfdb_var = "atfdb.var"; const char *dmmeta_Ssimfile_ssimfile_dev_arch = "dev.arch"; const char *dmmeta_Ssimfile_ssimfile_dev_badline = "dev.badline"; const char *dmmeta_Ssimfile_ssimfile_dev_builddir = "dev.builddir"; @@ -262,14 +279,18 @@ const char *dmmeta_Ssimfile_ssimfile_dev_linelim = "dev.linelim" const char *dmmeta_Ssimfile_ssimfile_dev_mdmark = "dev.mdmark"; const char *dmmeta_Ssimfile_ssimfile_dev_mdsection = "dev.mdsection"; const char *dmmeta_Ssimfile_ssimfile_dev_msgfile = "dev.msgfile"; -const char *dmmeta_Ssimfile_ssimfile_dev_noindent = "dev.noindent"; -const char *dmmeta_Ssimfile_ssimfile_dev_opt_type = "dev.opt_type"; -const char *dmmeta_Ssimfile_ssimfile_dev_package = "dev.package"; -const char *dmmeta_Ssimfile_ssimfile_dev_pkgdep = "dev.pkgdep"; -const char *dmmeta_Ssimfile_ssimfile_dev_pkgkey = "dev.pkgkey"; -const char *dmmeta_Ssimfile_ssimfile_dev_readme = "dev.readme"; -const char *dmmeta_Ssimfile_ssimfile_dev_readmesort = "dev.readmesort"; -const char *dmmeta_Ssimfile_ssimfile_dev_sandbox = "dev.sandbox"; +const char *dmmeta_Ssimfile_ssimfile_dev_netproto = "dev.netproto"; + +const char *dmmeta_Ssimfile_ssimfile_dev_noindent = "dev.noindent"; +const char *dmmeta_Ssimfile_ssimfile_dev_opt_type = "dev.opt_type"; +const char *dmmeta_Ssimfile_ssimfile_dev_package = "dev.package"; +const char *dmmeta_Ssimfile_ssimfile_dev_pkgdep = "dev.pkgdep"; +const char *dmmeta_Ssimfile_ssimfile_dev_pkgkey = "dev.pkgkey"; +const char *dmmeta_Ssimfile_ssimfile_dev_prototransport = "dev.prototransport"; +const char *dmmeta_Ssimfile_ssimfile_dev_readmefile = "dev.readmefile"; +const char *dmmeta_Ssimfile_ssimfile_dev_readmesort = "dev.readmesort"; +const char *dmmeta_Ssimfile_ssimfile_dev_rpm = "dev.rpm"; +const char *dmmeta_Ssimfile_ssimfile_dev_sandbox = "dev.sandbox"; const char *dmmeta_Ssimfile_ssimfile_dev_sbpath = "dev.sbpath"; const char *dmmeta_Ssimfile_ssimfile_dev_scriptfile = "dev.scriptfile"; @@ -284,6 +305,7 @@ const char *dmmeta_Ssimfile_ssimfile_dev_targsyslib = "dev.targsyslib"; const char *dmmeta_Ssimfile_ssimfile_dev_tgtcov = "dev.tgtcov"; const char *dmmeta_Ssimfile_ssimfile_dev_timefmt = "dev.timefmt"; const char *dmmeta_Ssimfile_ssimfile_dev_tool_opt = "dev.tool_opt"; +const char *dmmeta_Ssimfile_ssimfile_dev_transport = "dev.transport"; const char *dmmeta_Ssimfile_ssimfile_dev_uname = "dev.uname"; const char *dmmeta_Ssimfile_ssimfile_dev_unstablefld = "dev.unstablefld"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_anonfld = "dmmeta.anonfld"; @@ -300,6 +322,7 @@ const char *dmmeta_Ssimfile_ssimfile_dmmeta_cfmt = "dmmeta.cfmt"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_cget = "dmmeta.cget"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_charset = "dmmeta.charset"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_chash = "dmmeta.chash"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_ckafka = "dmmeta.ckafka"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_cppfunc = "dmmeta.cppfunc"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_cppkeyword = "dmmeta.cppkeyword"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_cpptype = "dmmeta.cpptype"; @@ -326,11 +349,12 @@ const char *dmmeta_Ssimfile_ssimfile_dmmeta_fbitset = "dmmeta.fbitset"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_fbuf = "dmmeta.fbuf"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_fbufdir = "dmmeta.fbufdir"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fbuftype = "dmmeta.fbuftype"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fcast = "dmmeta.fcast"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fcleanup = "dmmeta.fcleanup"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fcmap = "dmmeta.fcmap"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fcmdline = "dmmeta.fcmdline"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fbufiotype = "dmmeta.fbufiotype"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fbuftype = "dmmeta.fbuftype"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fcast = "dmmeta.fcast"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fcleanup = "dmmeta.fcleanup"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fcmap = "dmmeta.fcmap"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fcmdline = "dmmeta.fcmdline"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_fcmp = "dmmeta.fcmp"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_fcompact = "dmmeta.fcompact"; @@ -340,45 +364,49 @@ const char *dmmeta_Ssimfile_ssimfile_dmmeta_fdec = "dmmeta.fdec"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_fdelay = "dmmeta.fdelay"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_ffast = "dmmeta.ffast"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fflag = "dmmeta.fflag"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_field = "dmmeta.field"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_findrem = "dmmeta.findrem"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_finput = "dmmeta.finput"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fldoffset = "dmmeta.fldoffset"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_floadtuples = "dmmeta.floadtuples"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fnoremove = "dmmeta.fnoremove"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_foutput = "dmmeta.foutput"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fprefix = "dmmeta.fprefix"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fregx = "dmmeta.fregx"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fsort = "dmmeta.fsort"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fstep = "dmmeta.fstep"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_ftrace = "dmmeta.ftrace"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_ftuple = "dmmeta.ftuple"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_func = "dmmeta.func"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_funique = "dmmeta.funique"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fuserinit = "dmmeta.fuserinit"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_fwddecl = "dmmeta.fwddecl"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_gconst = "dmmeta.gconst"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_gstatic = "dmmeta.gstatic"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_gsymbol = "dmmeta.gsymbol"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_hashtype = "dmmeta.hashtype"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_hook = "dmmeta.hook"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_inlary = "dmmeta.inlary"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_lenfld = "dmmeta.lenfld"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_listtype = "dmmeta.listtype"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_llist = "dmmeta.llist"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_logcat = "dmmeta.logcat"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_main = "dmmeta.main"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_msgtype = "dmmeta.msgtype"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_nocascdel = "dmmeta.nocascdel"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_nossimfile = "dmmeta.nossimfile"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_noxref = "dmmeta.noxref"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_ns = "dmmeta.ns"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_nscpp = "dmmeta.nscpp"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_nsdb = "dmmeta.nsdb"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_nsfast = "dmmeta.nsfast"; -const char *dmmeta_Ssimfile_ssimfile_dmmeta_nsinclude = "dmmeta.nsinclude"; - +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fflag = "dmmeta.fflag"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_field = "dmmeta.field"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_findrem = "dmmeta.findrem"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_finput = "dmmeta.finput"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fkafka = "dmmeta.fkafka"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fldoffset = "dmmeta.fldoffset"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_floadtuples = "dmmeta.floadtuples"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fnoremove = "dmmeta.fnoremove"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_foutput = "dmmeta.foutput"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fprefix = "dmmeta.fprefix"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fregx = "dmmeta.fregx"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fsort = "dmmeta.fsort"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fstep = "dmmeta.fstep"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_ftrace = "dmmeta.ftrace"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_ftuple = "dmmeta.ftuple"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_func = "dmmeta.func"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_funique = "dmmeta.funique"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fuserinit = "dmmeta.fuserinit"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_fwddecl = "dmmeta.fwddecl"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_gconst = "dmmeta.gconst"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_gstatic = "dmmeta.gstatic"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_gsymbol = "dmmeta.gsymbol"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_hashtype = "dmmeta.hashtype"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_hook = "dmmeta.hook"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_inlary = "dmmeta.inlary"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_jstype = "dmmeta.jstype"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_kafka_type_kind = "dmmeta.kafka_type_kind"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_lenfld = "dmmeta.lenfld"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_listtype = "dmmeta.listtype"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_llist = "dmmeta.llist"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_logcat = "dmmeta.logcat"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_main = "dmmeta.main"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_msgtype = "dmmeta.msgtype"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_nocascdel = "dmmeta.nocascdel"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_nossimfile = "dmmeta.nossimfile"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_noxref = "dmmeta.noxref"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_ns = "dmmeta.ns"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_nscpp = "dmmeta.nscpp"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_nsdb = "dmmeta.nsdb"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_nsfast = "dmmeta.nsfast"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_nsinclude = "dmmeta.nsinclude"; + +const char *dmmeta_Ssimfile_ssimfile_dmmeta_nsjs = "dmmeta.nsjs"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_nsproto = "dmmeta.nsproto"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_nstype = "dmmeta.nstype"; @@ -414,6 +442,7 @@ const char *dmmeta_Ssimfile_ssimfile_dmmeta_thash = "dmmeta.thash"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_tracefld = "dmmeta.tracefld"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_tracerec = "dmmeta.tracerec"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_typefld = "dmmeta.typefld"; +const char *dmmeta_Ssimfile_ssimfile_dmmeta_userfunc = "dmmeta.userfunc"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_usertracefld = "dmmeta.usertracefld"; const char *dmmeta_Ssimfile_ssimfile_dmmeta_xref = "dmmeta.xref"; const char *dmmeta_Ssimfile_ssimfile_fmdb_alarm = "fmdb.alarm"; @@ -434,8 +463,6 @@ const char *dmmeta_Ssimfile_ssimfile_gclidb_gfld = "gclidb.gfld"; const char *dmmeta_Ssimfile_ssimfile_gclidb_githost = "gclidb.githost"; const char *dmmeta_Ssimfile_ssimfile_gclidb_gmethod = "gclidb.gmethod"; const char *dmmeta_Ssimfile_ssimfile_gclidb_grepo = "gclidb.grepo"; -const char *dmmeta_Ssimfile_ssimfile_gclidb_grepogitport = "gclidb.grepogitport"; -const char *dmmeta_Ssimfile_ssimfile_gclidb_grepossh = "gclidb.grepossh"; const char *dmmeta_Ssimfile_ssimfile_gclidb_gstate = "gclidb.gstate"; const char *dmmeta_Ssimfile_ssimfile_gclidb_gstatet = "gclidb.gstatet"; const char *dmmeta_Ssimfile_ssimfile_gclidb_gtbl = "gclidb.gtbl"; @@ -457,13 +484,26 @@ const char *dmmeta_Ssimfile_ssimfile_gclidb_mrjob = "gclidb.mrjob"; const char *dmmeta_Ssimfile_ssimfile_gclidb_mrnote = "gclidb.mrnote"; const char *dmmeta_Ssimfile_ssimfile_gclidb_project = "gclidb.project"; const char *dmmeta_Ssimfile_ssimfile_gclidb_user = "gclidb.user"; +const char *dmmeta_Ssimfile_ssimfile_httpdb_content = "httpdb.content"; +const char *dmmeta_Ssimfile_ssimfile_httpdb_header = "httpdb.header"; +const char *dmmeta_Ssimfile_ssimfile_httpdb_method = "httpdb.method"; +const char *dmmeta_Ssimfile_ssimfile_httpdb_status = "httpdb.status"; +const char *dmmeta_Ssimfile_ssimfile_httpdb_version = "httpdb.version"; +const char *dmmeta_Ssimfile_ssimfile_sampdb_gitfile = "sampdb.gitfile"; +const char *dmmeta_Ssimfile_ssimfile_sampdb_targdep = "sampdb.targdep"; +const char *dmmeta_Ssimfile_ssimfile_sampdb_target = "sampdb.target"; +const char *dmmeta_Ssimfile_ssimfile_sampdb_targrec = "sampdb.targrec"; +const char *dmmeta_Ssimfile_ssimfile_sampdb_targsrc = "sampdb.targsrc"; +const char *dmmeta_Ssimfile_ssimfile_wsdb_status = "wsdb.status"; // compile-time string constants for dmmeta.Steptype.steptype -const char *dmmeta_Steptype_steptype_Callback = "Callback"; -const char *dmmeta_Steptype_steptype_Extern = "Extern"; -const char *dmmeta_Steptype_steptype_Inline = "Inline"; -const char *dmmeta_Steptype_steptype_InlineOnce = "InlineOnce"; -const char *dmmeta_Steptype_steptype_InlineRecur = "InlineRecur"; +const char *dmmeta_Steptype_steptype_Callback = "Callback"; +const char *dmmeta_Steptype_steptype_Extern = "Extern"; +const char *dmmeta_Steptype_steptype_Inline = "Inline"; +const char *dmmeta_Steptype_steptype_InlineOnce = "InlineOnce"; +const char *dmmeta_Steptype_steptype_InlineRecur = "InlineRecur"; +const char *dmmeta_Steptype_steptype_TimeHookOnce = "TimeHookOnce"; + const char *dmmeta_Steptype_steptype_TimeHookRecur = "TimeHookRecur"; // compile-time string constants for dmmeta.Strfmt.strfmt @@ -491,13 +531,14 @@ bool dmmeta::Anonfld_ReadFieldMaybe(dmmeta::Anonfld& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -539,17 +580,17 @@ bool dmmeta::Argvtype_ReadFieldMaybe(dmmeta::Argvtype& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_argvtype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.argvtype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -594,13 +635,14 @@ bool dmmeta::Basepool_ReadFieldMaybe(dmmeta::Basepool& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_base: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.base, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -654,29 +696,26 @@ bool dmmeta::Bitfld_ReadFieldMaybe(dmmeta::Bitfld& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_offset: { retval = i32_ReadStrptrMaybe(parent.offset, strval); - break; - } + } break; case dmmeta_FieldId_width: { retval = i32_ReadStrptrMaybe(parent.width, strval); - break; - } + } break; case dmmeta_FieldId_srcfield: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.srcfield, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -727,13 +766,14 @@ bool dmmeta::Buftype_ReadFieldMaybe(dmmeta::Buftype& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_pnewtype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.pnewtype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -804,21 +844,20 @@ bool dmmeta::Cafter_ReadFieldMaybe(dmmeta::Cafter& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_cafter: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.cafter, strval); - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_after: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -860,13 +899,14 @@ bool dmmeta::Cascdel_ReadFieldMaybe(dmmeta::Cascdel& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -908,29 +948,26 @@ bool dmmeta::Ccmp_ReadFieldMaybe(dmmeta::Ccmp& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_extrn: { retval = bool_ReadStrptrMaybe(parent.extrn, strval); - break; - } + } break; case dmmeta_FieldId_genop: { retval = bool_ReadStrptrMaybe(parent.genop, strval); - break; - } + } break; case dmmeta_FieldId_order: { retval = bool_ReadStrptrMaybe(parent.order, strval); - break; - } + } break; case dmmeta_FieldId_minmax: { retval = bool_ReadStrptrMaybe(parent.minmax, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -984,29 +1021,26 @@ bool dmmeta::Cdflt_ReadFieldMaybe(dmmeta::Cdflt& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_dflt: { retval = algo::CppExpr_ReadStrptrMaybe(parent.dflt, strval); - break; - } + } break; case dmmeta_FieldId_cppdflt: { retval = algo::CppExpr_ReadStrptrMaybe(parent.cppdflt, strval); - break; - } + } break; case dmmeta_FieldId_ssimdflt: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.ssimdflt, strval); - break; - } + } break; case dmmeta_FieldId_jsdflt: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.jsdflt, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1060,21 +1094,20 @@ bool dmmeta::Cextern_ReadFieldMaybe(dmmeta::Cextern& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_initmemset: { retval = bool_ReadStrptrMaybe(parent.initmemset, strval); - break; - } + } break; case dmmeta_FieldId_isstruct: { retval = bool_ReadStrptrMaybe(parent.isstruct, strval); - break; - } + } break; case dmmeta_FieldId_plaindata: { retval = bool_ReadStrptrMaybe(parent.plaindata, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1122,25 +1155,23 @@ bool dmmeta::Cfast_ReadFieldMaybe(dmmeta::Cfast& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_id: { retval = u32_ReadStrptrMaybe(parent.id, strval); - break; - } + } break; case dmmeta_FieldId_encoding: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.encoding, strval); - break; - } + } break; case dmmeta_FieldId_reset: { retval = bool_ReadStrptrMaybe(parent.reset, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1220,41 +1251,35 @@ bool dmmeta::Cfmt_ReadFieldMaybe(dmmeta::Cfmt& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_cfmt: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.cfmt, strval); - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_strfmt: { retval = false; - break; - } + } break; case dmmeta_FieldId_printfmt: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.printfmt, strval); - break; - } + } break; case dmmeta_FieldId_read: { retval = bool_ReadStrptrMaybe(parent.read, strval); - break; - } + } break; case dmmeta_FieldId_print: { retval = bool_ReadStrptrMaybe(parent.print, strval); - break; - } + } break; case dmmeta_FieldId_sep: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.sep, strval); - break; - } + } break; case dmmeta_FieldId_genop: { retval = bool_ReadStrptrMaybe(parent.genop, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1311,13 +1336,14 @@ bool dmmeta::Cget_ReadFieldMaybe(dmmeta::Cget& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1359,25 +1385,23 @@ bool dmmeta::Charset_ReadFieldMaybe(dmmeta::Charset& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_expr: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.expr, strval); - break; - } + } break; case dmmeta_FieldId_charrange: { retval = bool_ReadStrptrMaybe(parent.charrange, strval); - break; - } + } break; case dmmeta_FieldId_calc: { retval = bool_ReadStrptrMaybe(parent.calc, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1428,17 +1452,17 @@ bool dmmeta::Chash_ReadFieldMaybe(dmmeta::Chash& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_hashtype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.hashtype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1475,6 +1499,79 @@ void dmmeta::Chash_Print(dmmeta::Chash& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } +// --- dmmeta.Ckafka..ReadFieldMaybe +bool dmmeta::Ckafka_ReadFieldMaybe(dmmeta::Ckafka& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + dmmeta::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case dmmeta_FieldId_ctype: { + retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); + } break; + case dmmeta_FieldId_kind: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.kind, strval); + } break; + case dmmeta_FieldId_root: { + retval = algo::cstring_ReadStrptrMaybe(parent.root, strval); + } break; + case dmmeta_FieldId_valid_versions: { + retval = algo::Smallstr10_ReadStrptrMaybe(parent.valid_versions, strval); + } break; + case dmmeta_FieldId_flexible_versions: { + retval = algo::Smallstr10_ReadStrptrMaybe(parent.flexible_versions, strval); + } break; + case dmmeta_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- dmmeta.Ckafka..ReadStrptrMaybe +// Read fields of dmmeta::Ckafka from an ascii string. +// The format of the string is an ssim Tuple +bool dmmeta::Ckafka_ReadStrptrMaybe(dmmeta::Ckafka &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "dmmeta.ckafka") || algo::StripTypeTag(in_str, "dmmeta.Ckafka"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Ckafka_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- dmmeta.Ckafka..Print +// print string representation of ROW to string STR +// cfmt:dmmeta.Ckafka.String printfmt:Tuple +void dmmeta::Ckafka_Print(dmmeta::Ckafka& row, algo::cstring& str) { + algo::tempstr temp; + str << "dmmeta.ckafka"; + + algo::Smallstr100_Print(row.ctype, temp); + PrintAttrSpaceReset(str,"ctype", temp); + + algo::Smallstr50_Print(row.kind, temp); + PrintAttrSpaceReset(str,"kind", temp); + + algo::cstring_Print(row.root, temp); + PrintAttrSpaceReset(str,"root", temp); + + algo::Smallstr10_Print(row.valid_versions, temp); + PrintAttrSpaceReset(str,"valid_versions", temp); + + algo::Smallstr10_Print(row.flexible_versions, temp); + PrintAttrSpaceReset(str,"flexible_versions", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + // --- dmmeta.Cppfunc..ReadFieldMaybe bool dmmeta::Cppfunc_ReadFieldMaybe(dmmeta::Cppfunc& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -1483,21 +1580,20 @@ bool dmmeta::Cppfunc_ReadFieldMaybe(dmmeta::Cppfunc& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_expr: { retval = algo::CppExpr_ReadStrptrMaybe(parent.expr, strval); - break; - } + } break; case dmmeta_FieldId_print: { retval = bool_ReadStrptrMaybe(parent.print, strval); - break; - } + } break; case dmmeta_FieldId_set: { retval = bool_ReadStrptrMaybe(parent.set, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1545,9 +1641,11 @@ bool dmmeta::Cppkeyword_ReadFieldMaybe(dmmeta::Cppkeyword& parent, algo::strptr switch(field_id) { case dmmeta_FieldId_cppkeyword: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.cppkeyword, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1586,21 +1684,20 @@ bool dmmeta::Cpptype_ReadFieldMaybe(dmmeta::Cpptype& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_ctor: { retval = bool_ReadStrptrMaybe(parent.ctor, strval); - break; - } + } break; case dmmeta_FieldId_dtor: { retval = bool_ReadStrptrMaybe(parent.dtor, strval); - break; - } + } break; case dmmeta_FieldId_cheap_copy: { retval = bool_ReadStrptrMaybe(parent.cheap_copy, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1648,21 +1745,20 @@ bool dmmeta::Csize_ReadFieldMaybe(dmmeta::Csize& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_size: { retval = u32_ReadStrptrMaybe(parent.size, strval); - break; - } + } break; case dmmeta_FieldId_alignment: { retval = u32_ReadStrptrMaybe(parent.alignment, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1710,17 +1806,17 @@ bool dmmeta::Cstr_ReadFieldMaybe(dmmeta::Cstr& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_strequiv: { retval = bool_ReadStrptrMaybe(parent.strequiv, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1794,21 +1890,20 @@ bool dmmeta::Ctype_ReadFieldMaybe(dmmeta::Ctype& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1850,25 +1945,23 @@ bool dmmeta::Ctypelen_ReadFieldMaybe(dmmeta::Ctypelen& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_len: { retval = u32_ReadStrptrMaybe(parent.len, strval); - break; - } + } break; case dmmeta_FieldId_alignment: { retval = i32_ReadStrptrMaybe(parent.alignment, strval); - break; - } + } break; case dmmeta_FieldId_padbytes: { retval = i32_ReadStrptrMaybe(parent.padbytes, strval); - break; - } + } break; case dmmeta_FieldId_plaindata: { retval = bool_ReadStrptrMaybe(parent.plaindata, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1948,45 +2041,44 @@ bool dmmeta::Dispatch_ReadFieldMaybe(dmmeta::Dispatch& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_dispatch: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.dispatch, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_unk: { retval = bool_ReadStrptrMaybe(parent.unk, strval); - break; - } + } break; case dmmeta_FieldId_read: { retval = bool_ReadStrptrMaybe(parent.read, strval); - break; - } + } break; case dmmeta_FieldId_print: { retval = bool_ReadStrptrMaybe(parent.print, strval); - break; - } + } break; case dmmeta_FieldId_haslen: { retval = bool_ReadStrptrMaybe(parent.haslen, strval); - break; - } + } break; case dmmeta_FieldId_call: { retval = bool_ReadStrptrMaybe(parent.call, strval); - break; - } + } break; case dmmeta_FieldId_strict: { retval = bool_ReadStrptrMaybe(parent.strict, strval); - break; - } + } break; + case dmmeta_FieldId_dyn: { + retval = bool_ReadStrptrMaybe(parent.dyn, strval); + } break; + case dmmeta_FieldId_kafka: { + retval = bool_ReadStrptrMaybe(parent.kafka, strval); + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2015,6 +2107,8 @@ void dmmeta::Dispatch_Init(dmmeta::Dispatch& parent) { parent.haslen = bool(false); parent.call = bool(false); parent.strict = bool(false); + parent.dyn = bool(false); + parent.kafka = bool(false); } // --- dmmeta.Dispatch..Print @@ -2045,7 +2139,13 @@ void dmmeta::Dispatch_Print(dmmeta::Dispatch& row, algo::cstring& str) { bool_Print(row.strict, temp); PrintAttrSpaceReset(str,"strict", temp); - algo::Comment_Print(row.comment, temp); + bool_Print(row.dyn, temp); + PrintAttrSpaceReset(str,"dyn", temp); + + bool_Print(row.kafka, temp); + PrintAttrSpaceReset(str,"kafka", temp); + + algo::Comment_Print(row.comment, temp); PrintAttrSpaceReset(str,"comment", temp); } @@ -2086,21 +2186,20 @@ bool dmmeta::DispatchMsg_ReadFieldMaybe(dmmeta::DispatchMsg& parent, algo::strpt switch(field_id) { case dmmeta_FieldId_dispatch_msg: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.dispatch_msg, strval); - break; - } + } break; case dmmeta_FieldId_dispatch: { retval = false; - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2142,17 +2241,17 @@ bool dmmeta::Dispctx_ReadFieldMaybe(dmmeta::Dispctx& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_dispatch: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.dispatch, strval); - break; - } + } break; case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2197,17 +2296,17 @@ bool dmmeta::Dispfilter_ReadFieldMaybe(dmmeta::Dispfilter& parent, algo::strptr switch(field_id) { case dmmeta_FieldId_dispatch: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.dispatch, strval); - break; - } + } break; case dmmeta_FieldId_match_all: { retval = bool_ReadStrptrMaybe(parent.match_all, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2281,21 +2380,20 @@ bool dmmeta::Dispsig_ReadFieldMaybe(dmmeta::Dispsig& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_dispsig: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.dispsig, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_signature: { retval = algo::Sha1sig_ReadStrptrMaybe(parent.signature, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2337,13 +2435,14 @@ bool dmmeta::Dispsigcheck_ReadFieldMaybe(dmmeta::Dispsigcheck& parent, algo::str switch(field_id) { case dmmeta_FieldId_dispsig: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.dispsig, strval); - break; - } + } break; case dmmeta_FieldId_signature: { retval = algo::Sha1sig_ReadStrptrMaybe(parent.signature, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2385,17 +2484,17 @@ bool dmmeta::Disptrace_ReadFieldMaybe(dmmeta::Disptrace& parent, algo::strptr fi switch(field_id) { case dmmeta_FieldId_dispatch: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.dispatch, strval); - break; - } + } break; case dmmeta_FieldId_cycle: { retval = bool_ReadStrptrMaybe(parent.cycle, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2440,17 +2539,17 @@ bool dmmeta::Falias_ReadFieldMaybe(dmmeta::Falias& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_srcfield: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.srcfield, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2495,13 +2594,14 @@ bool dmmeta::Fastenc_ReadFieldMaybe(dmmeta::Fastenc& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_fastenc: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.fastenc, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2645,13 +2745,14 @@ bool dmmeta::Fastinstr_ReadFieldMaybe(dmmeta::Fastinstr& parent, algo::strptr fi switch(field_id) { case dmmeta_FieldId_fastinstr: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.fastinstr, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2760,13 +2861,14 @@ bool dmmeta::Fastop_ReadFieldMaybe(dmmeta::Fastop& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_fastop: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.fastop, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2902,17 +3004,17 @@ bool dmmeta::Fbase_ReadFieldMaybe(dmmeta::Fbase& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_stripcomment: { retval = bool_ReadStrptrMaybe(parent.stripcomment, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2957,13 +3059,14 @@ bool dmmeta::Fbigend_ReadFieldMaybe(dmmeta::Fbigend& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3005,13 +3108,14 @@ bool dmmeta::Fbitset_ReadFieldMaybe(dmmeta::Fbitset& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3065,33 +3169,32 @@ bool dmmeta::Fbuf_ReadFieldMaybe(dmmeta::Fbuf& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_fbufdir: { retval = false; - break; - } + } break; case dmmeta_FieldId_max: { retval = u32_ReadStrptrMaybe(parent.max, strval); - break; - } + } break; case dmmeta_FieldId_fbuftype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.fbuftype, strval); - break; - } + } break; case dmmeta_FieldId_insready: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.insready, strval); - break; - } + } break; case dmmeta_FieldId_inseof: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.inseof, strval); - break; - } + } break; + case dmmeta_FieldId_iotype: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.iotype, strval); + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3133,6 +3236,9 @@ void dmmeta::Fbuf_Print(dmmeta::Fbuf& row, algo::cstring& str) { algo::Smallstr100_Print(row.inseof, temp); PrintAttrSpaceReset(str,"inseof", temp); + algo::Smallstr50_Print(row.iotype, temp); + PrintAttrSpaceReset(str,"iotype", temp); + algo::Comment_Print(row.comment, temp); PrintAttrSpaceReset(str,"comment", temp); } @@ -3145,17 +3251,17 @@ bool dmmeta::Fbufdir_ReadFieldMaybe(dmmeta::Fbufdir& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_fbufdir: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.fbufdir, strval); - break; - } + } break; case dmmeta_FieldId_read: { retval = bool_ReadStrptrMaybe(parent.read, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3192,6 +3298,55 @@ void dmmeta::Fbufdir_Print(dmmeta::Fbufdir& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } +// --- dmmeta.Fbufiotype..ReadFieldMaybe +bool dmmeta::Fbufiotype_ReadFieldMaybe(dmmeta::Fbufiotype& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + dmmeta::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case dmmeta_FieldId_fbufiotype: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.fbufiotype, strval); + } break; + case dmmeta_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- dmmeta.Fbufiotype..ReadStrptrMaybe +// Read fields of dmmeta::Fbufiotype from an ascii string. +// The format of the string is an ssim Tuple +bool dmmeta::Fbufiotype_ReadStrptrMaybe(dmmeta::Fbufiotype &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "dmmeta.fbufiotype") || algo::StripTypeTag(in_str, "dmmeta.Fbufiotype"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Fbufiotype_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- dmmeta.Fbufiotype..Print +// print string representation of ROW to string STR +// cfmt:dmmeta.Fbufiotype.String printfmt:Tuple +void dmmeta::Fbufiotype_Print(dmmeta::Fbufiotype& row, algo::cstring& str) { + algo::tempstr temp; + str << "dmmeta.fbufiotype"; + + algo::Smallstr50_Print(row.fbufiotype, temp); + PrintAttrSpaceReset(str,"fbufiotype", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + // --- dmmeta.Fbuftype..ReadFieldMaybe bool dmmeta::Fbuftype_ReadFieldMaybe(dmmeta::Fbuftype& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -3200,17 +3355,17 @@ bool dmmeta::Fbuftype_ReadFieldMaybe(dmmeta::Fbuftype& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_fbuftype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.fbuftype, strval); - break; - } + } break; case dmmeta_FieldId_skipbytes: { retval = bool_ReadStrptrMaybe(parent.skipbytes, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3255,17 +3410,17 @@ bool dmmeta::Fcast_ReadFieldMaybe(dmmeta::Fcast& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_expr: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.expr, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3310,13 +3465,14 @@ bool dmmeta::Fcleanup_ReadFieldMaybe(dmmeta::Fcleanup& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3411,33 +3567,29 @@ bool dmmeta::Fcmap_ReadFieldMaybe(dmmeta::Fcmap& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_fcmap: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.fcmap, strval); - break; - } + } break; case dmmeta_FieldId_leftField: { retval = false; - break; - } + } break; case dmmeta_FieldId_leftVal: { retval = false; - break; - } + } break; case dmmeta_FieldId_rightVal: { retval = false; - break; - } + } break; case dmmeta_FieldId_rightField: { retval = false; - break; - } + } break; case dmmeta_FieldId_bidir: { retval = bool_ReadStrptrMaybe(parent.bidir, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3494,25 +3646,23 @@ bool dmmeta::Fcmdline_ReadFieldMaybe(dmmeta::Fcmdline& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_read: { retval = bool_ReadStrptrMaybe(parent.read, strval); - break; - } + } break; case dmmeta_FieldId_basecmdline: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.basecmdline, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3560,25 +3710,23 @@ bool dmmeta::Fcmp_ReadFieldMaybe(dmmeta::Fcmp& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_versionsort: { retval = bool_ReadStrptrMaybe(parent.versionsort, strval); - break; - } + } break; case dmmeta_FieldId_casesens: { retval = bool_ReadStrptrMaybe(parent.casesens, strval); - break; - } + } break; case dmmeta_FieldId_extrn: { retval = bool_ReadStrptrMaybe(parent.extrn, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3629,13 +3777,14 @@ bool dmmeta::Fcompact_ReadFieldMaybe(dmmeta::Fcompact& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3706,25 +3855,23 @@ bool dmmeta::Fconst_ReadFieldMaybe(dmmeta::Fconst& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_fconst: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.fconst, strval); - break; - } + } break; case dmmeta_FieldId_field: { retval = false; - break; - } + } break; case dmmeta_FieldId_value: { retval = algo::CppExpr_ReadStrptrMaybe(parent.value, strval); - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3810,25 +3957,23 @@ bool dmmeta::Fcurs_ReadFieldMaybe(dmmeta::Fcurs& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_fcurs: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.fcurs, strval); - break; - } + } break; case dmmeta_FieldId_field: { retval = false; - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_curstype: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3870,21 +4015,20 @@ bool dmmeta::Fdec_ReadFieldMaybe(dmmeta::Fdec& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_nplace: { retval = i32_ReadStrptrMaybe(parent.nplace, strval); - break; - } + } break; case dmmeta_FieldId_fixedfmt: { retval = bool_ReadStrptrMaybe(parent.fixedfmt, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3932,21 +4076,20 @@ bool dmmeta::Fdelay_ReadFieldMaybe(dmmeta::Fdelay& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_fstep: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.fstep, strval); - break; - } + } break; case dmmeta_FieldId_delay: { retval = algo::I64Dec9_ReadStrptrMaybe(parent.delay, strval); - break; - } + } break; case dmmeta_FieldId_scale: { retval = bool_ReadStrptrMaybe(parent.scale, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -4035,53 +4178,44 @@ bool dmmeta::Ffast_ReadFieldMaybe(dmmeta::Ffast& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_ffast: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ffast, strval); - break; - } + } break; case dmmeta_FieldId_field: { retval = false; - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_fastinstr: { retval = false; - break; - } + } break; case dmmeta_FieldId_name: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.name, strval); - break; - } + } break; case dmmeta_FieldId_id: { retval = u32_ReadStrptrMaybe(parent.id, strval); - break; - } + } break; case dmmeta_FieldId_pos: { retval = u32_ReadStrptrMaybe(parent.pos, strval); - break; - } + } break; case dmmeta_FieldId_optional: { retval = bool_ReadStrptrMaybe(parent.optional, strval); - break; - } + } break; case dmmeta_FieldId_encoding: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.encoding, strval); - break; - } + } break; case dmmeta_FieldId_op: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.op, strval); - break; - } + } break; case dmmeta_FieldId_value: { retval = algo::CppExpr_ReadStrptrMaybe(parent.value, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -4152,21 +4286,20 @@ bool dmmeta::Fflag_ReadFieldMaybe(dmmeta::Fflag& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_cumulative: { retval = bool_ReadStrptrMaybe(parent.cumulative, strval); - break; - } + } break; case dmmeta_FieldId_emptyval: { retval = algo::cstring_ReadStrptrMaybe(parent.emptyval, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -4255,37 +4388,32 @@ bool dmmeta::Field_ReadFieldMaybe(dmmeta::Field& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_arg: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.arg, strval); - break; - } + } break; case dmmeta_FieldId_reftype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.reftype, strval); - break; - } + } break; case dmmeta_FieldId_dflt: { retval = algo::CppExpr_ReadStrptrMaybe(parent.dflt, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -4370,6 +4498,10 @@ const char* dmmeta::value_ToCstr(const dmmeta::FieldId& parent) { case dmmeta_FieldId_charrange : ret = "charrange"; break; case dmmeta_FieldId_calc : ret = "calc"; break; case dmmeta_FieldId_hashtype : ret = "hashtype"; break; + case dmmeta_FieldId_kind : ret = "kind"; break; + case dmmeta_FieldId_root : ret = "root"; break; + case dmmeta_FieldId_valid_versions : ret = "valid_versions"; break; + case dmmeta_FieldId_flexible_versions: ret = "flexible_versions"; break; case dmmeta_FieldId_set : ret = "set"; break; case dmmeta_FieldId_cppkeyword : ret = "cppkeyword"; break; case dmmeta_FieldId_ctor : ret = "ctor"; break; @@ -4386,6 +4518,8 @@ const char* dmmeta::value_ToCstr(const dmmeta::FieldId& parent) { case dmmeta_FieldId_haslen : ret = "haslen"; break; case dmmeta_FieldId_call : ret = "call"; break; case dmmeta_FieldId_strict : ret = "strict"; break; + case dmmeta_FieldId_dyn : ret = "dyn"; break; + case dmmeta_FieldId_kafka : ret = "kafka"; break; case dmmeta_FieldId_dispatch_msg : ret = "dispatch_msg"; break; case dmmeta_FieldId_match_all : ret = "match_all"; break; case dmmeta_FieldId_dispsig : ret = "dispsig"; break; @@ -4400,6 +4534,8 @@ const char* dmmeta::value_ToCstr(const dmmeta::FieldId& parent) { case dmmeta_FieldId_fbuftype : ret = "fbuftype"; break; case dmmeta_FieldId_insready : ret = "insready"; break; case dmmeta_FieldId_inseof : ret = "inseof"; break; + case dmmeta_FieldId_iotype : ret = "iotype"; break; + case dmmeta_FieldId_fbufiotype : ret = "fbufiotype"; break; case dmmeta_FieldId_skipbytes : ret = "skipbytes"; break; case dmmeta_FieldId_fcmap : ret = "fcmap"; break; case dmmeta_FieldId_leftField : ret = "leftField"; break; @@ -4428,6 +4564,10 @@ const char* dmmeta::value_ToCstr(const dmmeta::FieldId& parent) { case dmmeta_FieldId_arg : ret = "arg"; break; case dmmeta_FieldId_reftype : ret = "reftype"; break; case dmmeta_FieldId_update : ret = "update"; break; + case dmmeta_FieldId_versions : ret = "versions"; break; + case dmmeta_FieldId_nullable_versions: ret = "nullable_versions"; break; + case dmmeta_FieldId_tagged_versions: ret = "tagged_versions"; break; + case dmmeta_FieldId_tag : ret = "tag"; break; case dmmeta_FieldId_fprefix : ret = "fprefix"; break; case dmmeta_FieldId_partial : ret = "partial"; break; case dmmeta_FieldId_regxtype : ret = "regxtype"; break; @@ -4445,6 +4585,7 @@ const char* dmmeta::value_ToCstr(const dmmeta::FieldId& parent) { case dmmeta_FieldId_inc : ret = "inc"; break; case dmmeta_FieldId_symboltype : ret = "symboltype"; break; case dmmeta_FieldId_min : ret = "min"; break; + case dmmeta_FieldId_kafka_type_kind: ret = "kafka_type_kind"; break; case dmmeta_FieldId_extra : ret = "extra"; break; case dmmeta_FieldId_listtype : ret = "listtype"; break; case dmmeta_FieldId_circular : ret = "circular"; break; @@ -4455,6 +4596,9 @@ const char* dmmeta::value_ToCstr(const dmmeta::FieldId& parent) { case dmmeta_FieldId_logcat : ret = "logcat"; break; case dmmeta_FieldId_enabled : ret = "enabled"; break; case dmmeta_FieldId_builtin : ret = "builtin"; break; + case dmmeta_FieldId_stdout : ret = "stdout"; break; + case dmmeta_FieldId_maxmsg : ret = "maxmsg"; break; + case dmmeta_FieldId_window : ret = "window"; break; case dmmeta_FieldId_ismodule : ret = "ismodule"; break; case dmmeta_FieldId_type : ret = "type"; break; case dmmeta_FieldId_xref : ret = "xref"; break; @@ -4462,6 +4606,8 @@ const char* dmmeta::value_ToCstr(const dmmeta::FieldId& parent) { case dmmeta_FieldId_license : ret = "license"; break; case dmmeta_FieldId_nsinclude : ret = "nsinclude"; break; case dmmeta_FieldId_sys : ret = "sys"; break; + case dmmeta_FieldId_typescript : ret = "typescript"; break; + case dmmeta_FieldId_gensel : ret = "gensel"; break; case dmmeta_FieldId_version : ret = "version"; break; case dmmeta_FieldId_genthrow : ret = "genthrow"; break; case dmmeta_FieldId_correct_getorcreate: ret = "correct_getorcreate"; break; @@ -4476,6 +4622,7 @@ const char* dmmeta::value_ToCstr(const dmmeta::FieldId& parent) { case dmmeta_FieldId_pnew : ret = "pnew"; break; case dmmeta_FieldId_buftype : ret = "buftype"; break; case dmmeta_FieldId_unique : ret = "unique"; break; + case dmmeta_FieldId_heaplike : ret = "heaplike"; break; case dmmeta_FieldId_isval : ret = "isval"; break; case dmmeta_FieldId_cascins : ret = "cascins"; break; case dmmeta_FieldId_usebasepool : ret = "usebasepool"; break; @@ -4505,6 +4652,9 @@ const char* dmmeta::value_ToCstr(const dmmeta::FieldId& parent) { case dmmeta_FieldId_hashfld : ret = "hashfld"; break; case dmmeta_FieldId_tracefld : ret = "tracefld"; break; case dmmeta_FieldId_tracerec : ret = "tracerec"; break; + case dmmeta_FieldId_userfunc : ret = "userfunc"; break; + case dmmeta_FieldId_acrkey : ret = "acrkey"; break; + case dmmeta_FieldId_cppname : ret = "cppname"; break; case dmmeta_FieldId_inscond : ret = "inscond"; break; case dmmeta_FieldId_via : ret = "via"; break; case dmmeta_FieldId_viafld : ret = "viafld"; break; @@ -4557,6 +4707,9 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR3('d','e','l'): { value_SetEnum(parent,dmmeta_FieldId_del); ret = true; break; } + case LE_STR3('d','y','n'): { + value_SetEnum(parent,dmmeta_FieldId_dyn); ret = true; break; + } case LE_STR3('i','n','c'): { value_SetEnum(parent,dmmeta_FieldId_inc); ret = true; break; } @@ -4584,6 +4737,9 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR3('s','y','s'): { value_SetEnum(parent,dmmeta_FieldId_sys); ret = true; break; } + case LE_STR3('t','a','g'): { + value_SetEnum(parent,dmmeta_FieldId_tag); ret = true; break; + } case LE_STR3('u','n','k'): { value_SetEnum(parent,dmmeta_FieldId_unk); ret = true; break; } @@ -4625,6 +4781,9 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR4('i','n','s','t'): { value_SetEnum(parent,dmmeta_FieldId_inst); ret = true; break; } + case LE_STR4('k','i','n','d'): { + value_SetEnum(parent,dmmeta_FieldId_kind); ret = true; break; + } case LE_STR4('n','a','m','e'): { value_SetEnum(parent,dmmeta_FieldId_name); ret = true; break; } @@ -4640,6 +4799,9 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR4('r','e','a','d'): { value_SetEnum(parent,dmmeta_FieldId_read); ret = true; break; } + case LE_STR4('r','o','o','t'): { + value_SetEnum(parent,dmmeta_FieldId_root); ret = true; break; + } case LE_STR4('s','i','z','e'): { value_SetEnum(parent,dmmeta_FieldId_size); ret = true; break; } @@ -4702,6 +4864,9 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR5('i','s','v','a','l'): { value_SetEnum(parent,dmmeta_FieldId_isval); ret = true; break; } + case LE_STR5('k','a','f','k','a'): { + value_SetEnum(parent,dmmeta_FieldId_kafka); ret = true; break; + } case LE_STR5('o','r','d','e','r'): { value_SetEnum(parent,dmmeta_FieldId_order); ret = true; break; } @@ -4725,6 +4890,9 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { } case 6: { switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('a','c','r','k','e','y'): { + value_SetEnum(parent,dmmeta_FieldId_acrkey); ret = true; break; + } case LE_STR6('c','a','f','t','e','r'): { value_SetEnum(parent,dmmeta_FieldId_cafter); ret = true; break; } @@ -4734,12 +4902,18 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR6('f','c','o','n','s','t'): { value_SetEnum(parent,dmmeta_FieldId_fconst); ret = true; break; } + case LE_STR6('g','e','n','s','e','l'): { + value_SetEnum(parent,dmmeta_FieldId_gensel); ret = true; break; + } case LE_STR6('h','a','s','l','e','n'): { value_SetEnum(parent,dmmeta_FieldId_haslen); ret = true; break; } case LE_STR6('i','n','s','e','o','f'): { value_SetEnum(parent,dmmeta_FieldId_inseof); ret = true; break; } + case LE_STR6('i','o','t','y','p','e'): { + value_SetEnum(parent,dmmeta_FieldId_iotype); ret = true; break; + } case LE_STR6('i','s','x','r','e','f'): { value_SetEnum(parent,dmmeta_FieldId_isxref); ret = true; break; } @@ -4755,6 +4929,9 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR6('l','o','g','c','a','t'): { value_SetEnum(parent,dmmeta_FieldId_logcat); ret = true; break; } + case LE_STR6('m','a','x','m','s','g'): { + value_SetEnum(parent,dmmeta_FieldId_maxmsg); ret = true; break; + } case LE_STR6('m','a','x','w','i','d'): { value_SetEnum(parent,dmmeta_FieldId_maxwid); ret = true; break; } @@ -4776,6 +4953,9 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR6('s','s','i','m','n','s'): { value_SetEnum(parent,dmmeta_FieldId_ssimns); ret = true; break; } + case LE_STR6('s','t','d','o','u','t'): { + value_SetEnum(parent,dmmeta_FieldId_stdout); ret = true; break; + } case LE_STR6('s','t','r','f','m','t'): { value_SetEnum(parent,dmmeta_FieldId_strfmt); ret = true; break; } @@ -4794,6 +4974,9 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR6('v','i','a','f','l','d'): { value_SetEnum(parent,dmmeta_FieldId_viafld); ret = true; break; } + case LE_STR6('w','i','n','d','o','w'): { + value_SetEnum(parent,dmmeta_FieldId_window); ret = true; break; + } } break; } @@ -4820,6 +5003,9 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR7('c','p','p','d','f','l','t'): { value_SetEnum(parent,dmmeta_FieldId_cppdflt); ret = true; break; } + case LE_STR7('c','p','p','n','a','m','e'): { + value_SetEnum(parent,dmmeta_FieldId_cppname); ret = true; break; + } case LE_STR7('d','i','s','p','s','i','g'): { value_SetEnum(parent,dmmeta_FieldId_dispsig); ret = true; break; } @@ -4930,6 +5116,9 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR8('h','a','v','e','t','a','i','l'): { value_SetEnum(parent,dmmeta_FieldId_havetail); ret = true; break; } + case LE_STR8('h','e','a','p','l','i','k','e'): { + value_SetEnum(parent,dmmeta_FieldId_heaplike); ret = true; break; + } case LE_STR8('i','n','s','r','e','a','d','y'): { value_SetEnum(parent,dmmeta_FieldId_insready); ret = true; break; } @@ -4993,6 +5182,12 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { case LE_STR8('t','r','a','c','e','r','e','c'): { value_SetEnum(parent,dmmeta_FieldId_tracerec); ret = true; break; } + case LE_STR8('u','s','e','r','f','u','n','c'): { + value_SetEnum(parent,dmmeta_FieldId_userfunc); ret = true; break; + } + case LE_STR8('v','e','r','s','i','o','n','s'): { + value_SetEnum(parent,dmmeta_FieldId_versions); ret = true; break; + } case LE_STR8('w','a','n','t','e','n','u','m'): { value_SetEnum(parent,dmmeta_FieldId_wantenum); ret = true; break; } @@ -5067,6 +5262,10 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"ve",2)==0) { value_SetEnum(parent,dmmeta_FieldId_cumulative); ret = true; break; } break; } + case LE_STR8('f','b','u','f','i','o','t','y'): { + if (memcmp(rhs.elems+8,"pe",2)==0) { value_SetEnum(parent,dmmeta_FieldId_fbufiotype); ret = true; break; } + break; + } case LE_STR8('i','n','i','t','m','e','m','s'): { if (memcmp(rhs.elems+8,"et",2)==0) { value_SetEnum(parent,dmmeta_FieldId_initmemset); ret = true; break; } break; @@ -5079,6 +5278,10 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"pe",2)==0) { value_SetEnum(parent,dmmeta_FieldId_symboltype); ret = true; break; } break; } + case LE_STR8('t','y','p','e','s','c','r','i'): { + if (memcmp(rhs.elems+8,"pt",2)==0) { value_SetEnum(parent,dmmeta_FieldId_typescript); ret = true; break; } + break; + } } break; } @@ -5134,15 +5337,40 @@ bool dmmeta::value_SetStrptrMaybe(dmmeta::FieldId& parent, algo::strptr rhs) { if (memcmp(rhs.elems+8,"imfile",6)==0) { value_SetEnum(parent,dmmeta_FieldId_child_ssimfile); ret = true; break; } break; } + case LE_STR8('v','a','l','i','d','_','v','e'): { + if (memcmp(rhs.elems+8,"rsions",6)==0) { value_SetEnum(parent,dmmeta_FieldId_valid_versions); ret = true; break; } + break; + } } break; } case 15: { switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('k','a','f','k','a','_','t','y'): { + if (memcmp(rhs.elems+8,"pe_kind",7)==0) { value_SetEnum(parent,dmmeta_FieldId_kafka_type_kind); ret = true; break; } + break; + } case LE_STR8('p','m','a','s','k','f','l','d'): { if (memcmp(rhs.elems+8,"_member",7)==0) { value_SetEnum(parent,dmmeta_FieldId_pmaskfld_member); ret = true; break; } break; } + case LE_STR8('t','a','g','g','e','d','_','v'): { + if (memcmp(rhs.elems+8,"ersions",7)==0) { value_SetEnum(parent,dmmeta_FieldId_tagged_versions); ret = true; break; } + break; + } + } + break; + } + case 17: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('f','l','e','x','i','b','l','e'): { + if (memcmp(rhs.elems+8,"_versions",9)==0) { value_SetEnum(parent,dmmeta_FieldId_flexible_versions); ret = true; break; } + break; + } + case LE_STR8('n','u','l','l','a','b','l','e'): { + if (memcmp(rhs.elems+8,"_versions",9)==0) { value_SetEnum(parent,dmmeta_FieldId_nullable_versions); ret = true; break; } + break; + } } break; } @@ -5201,13 +5429,14 @@ bool dmmeta::Findrem_ReadFieldMaybe(dmmeta::Findrem& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5261,29 +5490,26 @@ bool dmmeta::Finput_ReadFieldMaybe(dmmeta::Finput& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_extrn: { retval = bool_ReadStrptrMaybe(parent.extrn, strval); - break; - } + } break; case dmmeta_FieldId_update: { retval = bool_ReadStrptrMaybe(parent.update, strval); - break; - } + } break; case dmmeta_FieldId_strict: { retval = bool_ReadStrptrMaybe(parent.strict, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5326,6 +5552,79 @@ void dmmeta::Finput_Print(dmmeta::Finput& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } +// --- dmmeta.Fkafka..ReadFieldMaybe +bool dmmeta::Fkafka_ReadFieldMaybe(dmmeta::Fkafka& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + dmmeta::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case dmmeta_FieldId_field: { + retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); + } break; + case dmmeta_FieldId_versions: { + retval = algo::Smallstr10_ReadStrptrMaybe(parent.versions, strval); + } break; + case dmmeta_FieldId_nullable_versions: { + retval = algo::Smallstr10_ReadStrptrMaybe(parent.nullable_versions, strval); + } break; + case dmmeta_FieldId_tagged_versions: { + retval = algo::Smallstr10_ReadStrptrMaybe(parent.tagged_versions, strval); + } break; + case dmmeta_FieldId_tag: { + retval = u64_ReadStrptrMaybe(parent.tag, strval); + } break; + case dmmeta_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- dmmeta.Fkafka..ReadStrptrMaybe +// Read fields of dmmeta::Fkafka from an ascii string. +// The format of the string is an ssim Tuple +bool dmmeta::Fkafka_ReadStrptrMaybe(dmmeta::Fkafka &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "dmmeta.fkafka") || algo::StripTypeTag(in_str, "dmmeta.Fkafka"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Fkafka_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- dmmeta.Fkafka..Print +// print string representation of ROW to string STR +// cfmt:dmmeta.Fkafka.String printfmt:Tuple +void dmmeta::Fkafka_Print(dmmeta::Fkafka& row, algo::cstring& str) { + algo::tempstr temp; + str << "dmmeta.fkafka"; + + algo::Smallstr100_Print(row.field, temp); + PrintAttrSpaceReset(str,"field", temp); + + algo::Smallstr10_Print(row.versions, temp); + PrintAttrSpaceReset(str,"versions", temp); + + algo::Smallstr10_Print(row.nullable_versions, temp); + PrintAttrSpaceReset(str,"nullable_versions", temp); + + algo::Smallstr10_Print(row.tagged_versions, temp); + PrintAttrSpaceReset(str,"tagged_versions", temp); + + u64_Print(row.tag, temp); + PrintAttrSpaceReset(str,"tag", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + // --- dmmeta.Fldoffset..ReadFieldMaybe bool dmmeta::Fldoffset_ReadFieldMaybe(dmmeta::Fldoffset& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -5334,13 +5633,14 @@ bool dmmeta::Fldoffset_ReadFieldMaybe(dmmeta::Fldoffset& parent, algo::strptr fi switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_offset: { retval = i32_ReadStrptrMaybe(parent.offset, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5394,17 +5694,17 @@ bool dmmeta::Floadtuples_ReadFieldMaybe(dmmeta::Floadtuples& parent, algo::strpt switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5446,13 +5746,14 @@ bool dmmeta::Fnoremove_ReadFieldMaybe(dmmeta::Fnoremove& parent, algo::strptr fi switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5506,17 +5807,17 @@ bool dmmeta::Foutput_ReadFieldMaybe(dmmeta::Foutput& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5558,17 +5859,17 @@ bool dmmeta::Fprefix_ReadFieldMaybe(dmmeta::Fprefix& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_fprefix: { retval = algo::Smallstr5_ReadStrptrMaybe(parent.fprefix, strval); - break; - } + } break; case dmmeta_FieldId_reftype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.reftype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5613,21 +5914,20 @@ bool dmmeta::Fregx_ReadFieldMaybe(dmmeta::Fregx& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_partial: { retval = bool_ReadStrptrMaybe(parent.partial, strval); - break; - } + } break; case dmmeta_FieldId_regxtype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.regxtype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5675,21 +5975,20 @@ bool dmmeta::Fsort_ReadFieldMaybe(dmmeta::Fsort& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_sorttype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.sorttype, strval); - break; - } + } break; case dmmeta_FieldId_sortfld: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.sortfld, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5778,29 +6077,26 @@ bool dmmeta::Fstep_ReadFieldMaybe(dmmeta::Fstep& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_fstep: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.fstep, strval); - break; - } + } break; case dmmeta_FieldId_field: { retval = false; - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_steptype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.steptype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5845,13 +6141,14 @@ bool dmmeta::Ftrace_ReadFieldMaybe(dmmeta::Ftrace& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5893,13 +6190,14 @@ bool dmmeta::Ftuple_ReadFieldMaybe(dmmeta::Ftuple& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -5994,33 +6292,29 @@ bool dmmeta::Func_ReadFieldMaybe(dmmeta::Func& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_func: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.func, strval); - break; - } + } break; case dmmeta_FieldId_field: { retval = false; - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_extrn: { retval = bool_ReadStrptrMaybe(parent.extrn, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::cstring_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6065,13 +6359,14 @@ bool dmmeta::Funique_ReadFieldMaybe(dmmeta::Funique& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6113,13 +6408,14 @@ bool dmmeta::Fuserinit_ReadFieldMaybe(dmmeta::Fuserinit& parent, algo::strptr fi switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6190,21 +6486,20 @@ bool dmmeta::Fwddecl_ReadFieldMaybe(dmmeta::Fwddecl& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_fwddecl: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.fwddecl, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6258,25 +6553,23 @@ bool dmmeta::Gconst_ReadFieldMaybe(dmmeta::Gconst& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_namefld: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.namefld, strval); - break; - } + } break; case dmmeta_FieldId_idfld: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.idfld, strval); - break; - } + } break; case dmmeta_FieldId_wantenum: { retval = bool_ReadStrptrMaybe(parent.wantenum, strval); - break; - } + } break; case dmmeta_FieldId_namefldctyp: { retval = false; - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6336,17 +6629,17 @@ bool dmmeta::Gstatic_ReadFieldMaybe(dmmeta::Gstatic& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6417,29 +6710,26 @@ bool dmmeta::Gsymbol_ReadFieldMaybe(dmmeta::Gsymbol& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_gsymbol: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gsymbol, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_ssimfile: { retval = false; - break; - } + } break; case dmmeta_FieldId_inc: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.inc, strval); - break; - } + } break; case dmmeta_FieldId_symboltype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.symboltype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6487,13 +6777,14 @@ bool dmmeta::Hashtype_ReadFieldMaybe(dmmeta::Hashtype& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_hashtype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.hashtype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6535,13 +6826,11 @@ bool dmmeta::Hook_ReadFieldMaybe(dmmeta::Hook& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } - case dmmeta_FieldId_comment: { - retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6570,9 +6859,6 @@ void dmmeta::Hook_Print(dmmeta::Hook& row, algo::cstring& str) { algo::Smallstr100_Print(row.field, temp); PrintAttrSpaceReset(str,"field", temp); - - algo::Comment_Print(row.comment, temp); - PrintAttrSpaceReset(str,"comment", temp); } // --- dmmeta.Inlary..ReadFieldMaybe @@ -6583,21 +6869,20 @@ bool dmmeta::Inlary_ReadFieldMaybe(dmmeta::Inlary& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_min: { retval = i32_ReadStrptrMaybe(parent.min, strval); - break; - } + } break; case dmmeta_FieldId_max: { retval = i32_ReadStrptrMaybe(parent.max, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6637,6 +6922,104 @@ void dmmeta::Inlary_Print(dmmeta::Inlary& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } +// --- dmmeta.Jstype..ReadFieldMaybe +bool dmmeta::Jstype_ReadFieldMaybe(dmmeta::Jstype& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + dmmeta::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case dmmeta_FieldId_ctype: { + retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); + } break; + case dmmeta_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- dmmeta.Jstype..ReadStrptrMaybe +// Read fields of dmmeta::Jstype from an ascii string. +// The format of the string is an ssim Tuple +bool dmmeta::Jstype_ReadStrptrMaybe(dmmeta::Jstype &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "dmmeta.jstype") || algo::StripTypeTag(in_str, "dmmeta.Jstype"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Jstype_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- dmmeta.Jstype..Print +// print string representation of ROW to string STR +// cfmt:dmmeta.Jstype.String printfmt:Tuple +void dmmeta::Jstype_Print(dmmeta::Jstype& row, algo::cstring& str) { + algo::tempstr temp; + str << "dmmeta.jstype"; + + algo::Smallstr100_Print(row.ctype, temp); + PrintAttrSpaceReset(str,"ctype", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- dmmeta.KafkaTypeKind..ReadFieldMaybe +bool dmmeta::KafkaTypeKind_ReadFieldMaybe(dmmeta::KafkaTypeKind& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + dmmeta::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case dmmeta_FieldId_kafka_type_kind: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.kafka_type_kind, strval); + } break; + case dmmeta_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- dmmeta.KafkaTypeKind..ReadStrptrMaybe +// Read fields of dmmeta::KafkaTypeKind from an ascii string. +// The format of the string is an ssim Tuple +bool dmmeta::KafkaTypeKind_ReadStrptrMaybe(dmmeta::KafkaTypeKind &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "dmmeta.kafka_type_kind") || algo::StripTypeTag(in_str, "dmmeta.KafkaTypeKind"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && KafkaTypeKind_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- dmmeta.KafkaTypeKind..Print +// print string representation of ROW to string STR +// cfmt:dmmeta.KafkaTypeKind.String printfmt:Tuple +void dmmeta::KafkaTypeKind_Print(dmmeta::KafkaTypeKind& row, algo::cstring& str) { + algo::tempstr temp; + str << "dmmeta.kafka_type_kind"; + + algo::Smallstr50_Print(row.kafka_type_kind, temp); + PrintAttrSpaceReset(str,"kafka_type_kind", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + // --- dmmeta.Lenfld.ctype.Get algo::Smallstr100 dmmeta::ctype_Get(dmmeta::Lenfld& parent) { algo::Smallstr100 ret(algo::Pathcomp(parent.field, ".RL")); @@ -6657,17 +7040,17 @@ bool dmmeta::Lenfld_ReadFieldMaybe(dmmeta::Lenfld& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_extra: { retval = i32_ReadStrptrMaybe(parent.extra, strval); - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6709,25 +7092,23 @@ bool dmmeta::Listtype_ReadFieldMaybe(dmmeta::Listtype& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_listtype: { retval = algo::Smallstr5_ReadStrptrMaybe(parent.listtype, strval); - break; - } + } break; case dmmeta_FieldId_circular: { retval = bool_ReadStrptrMaybe(parent.circular, strval); - break; - } + } break; case dmmeta_FieldId_haveprev: { retval = bool_ReadStrptrMaybe(parent.haveprev, strval); - break; - } + } break; case dmmeta_FieldId_instail: { retval = bool_ReadStrptrMaybe(parent.instail, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6790,25 +7171,23 @@ bool dmmeta::Llist_ReadFieldMaybe(dmmeta::Llist& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_havetail: { retval = bool_ReadStrptrMaybe(parent.havetail, strval); - break; - } + } break; case dmmeta_FieldId_havecount: { retval = bool_ReadStrptrMaybe(parent.havecount, strval); - break; - } + } break; case dmmeta_FieldId_listtype: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6856,21 +7235,29 @@ bool dmmeta::Logcat_ReadFieldMaybe(dmmeta::Logcat& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_logcat: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.logcat, strval); - break; - } + } break; case dmmeta_FieldId_enabled: { retval = bool_ReadStrptrMaybe(parent.enabled, strval); - break; - } + } break; case dmmeta_FieldId_builtin: { retval = bool_ReadStrptrMaybe(parent.builtin, strval); - break; - } + } break; + case dmmeta_FieldId_stdout: { + retval = bool_ReadStrptrMaybe(parent.stdout, strval); + } break; + case dmmeta_FieldId_maxmsg: { + retval = i32_ReadStrptrMaybe(parent.maxmsg, strval); + } break; + case dmmeta_FieldId_window: { + retval = i32_ReadStrptrMaybe(parent.window, strval); + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6906,6 +7293,15 @@ void dmmeta::Logcat_Print(dmmeta::Logcat& row, algo::cstring& str) { bool_Print(row.builtin, temp); PrintAttrSpaceReset(str,"builtin", temp); + bool_Print(row.stdout, temp); + PrintAttrSpaceReset(str,"stdout", temp); + + i32_Print(row.maxmsg, temp); + PrintAttrSpaceReset(str,"maxmsg", temp); + + i32_Print(row.window, temp); + PrintAttrSpaceReset(str,"window", temp); + algo::Comment_Print(row.comment, temp); PrintAttrSpaceReset(str,"comment", temp); } @@ -6918,13 +7314,14 @@ bool dmmeta::Main_ReadFieldMaybe(dmmeta::Main& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_ns: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.ns, strval); - break; - } + } break; case dmmeta_FieldId_ismodule: { retval = bool_ReadStrptrMaybe(parent.ismodule, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -6966,13 +7363,14 @@ bool dmmeta::Msgtype_ReadFieldMaybe(dmmeta::Msgtype& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_type: { retval = algo::CppExpr_ReadStrptrMaybe(parent.type, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7014,13 +7412,14 @@ bool dmmeta::Nocascdel_ReadFieldMaybe(dmmeta::Nocascdel& parent, algo::strptr fi switch(field_id) { case dmmeta_FieldId_xref: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.xref, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7062,13 +7461,14 @@ bool dmmeta::Nossimfile_ReadFieldMaybe(dmmeta::Nossimfile& parent, algo::strptr switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7110,13 +7510,14 @@ bool dmmeta::Noxref_ReadFieldMaybe(dmmeta::Noxref& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7158,21 +7559,20 @@ bool dmmeta::Ns_ReadFieldMaybe(dmmeta::Ns& parent, algo::strptr field, algo::str switch(field_id) { case dmmeta_FieldId_ns: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.ns, strval); - break; - } + } break; case dmmeta_FieldId_nstype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.nstype, strval); - break; - } + } break; case dmmeta_FieldId_license: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.license, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7220,13 +7620,14 @@ bool dmmeta::Nscpp_ReadFieldMaybe(dmmeta::Nscpp& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_ns: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.ns, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7268,13 +7669,14 @@ bool dmmeta::Nsdb_ReadFieldMaybe(dmmeta::Nsdb& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_ns: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.ns, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7316,13 +7718,14 @@ bool dmmeta::Nsfast_ReadFieldMaybe(dmmeta::Nsfast& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_ns: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.ns, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7393,25 +7796,23 @@ bool dmmeta::Nsinclude_ReadFieldMaybe(dmmeta::Nsinclude& parent, algo::strptr fi switch(field_id) { case dmmeta_FieldId_nsinclude: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.nsinclude, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_sys: { retval = bool_ReadStrptrMaybe(parent.sys, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7448,6 +7849,67 @@ void dmmeta::Nsinclude_Print(dmmeta::Nsinclude& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } +// --- dmmeta.Nsjs..ReadFieldMaybe +bool dmmeta::Nsjs_ReadFieldMaybe(dmmeta::Nsjs& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + dmmeta::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case dmmeta_FieldId_ns: { + retval = algo::Smallstr16_ReadStrptrMaybe(parent.ns, strval); + } break; + case dmmeta_FieldId_typescript: { + retval = bool_ReadStrptrMaybe(parent.typescript, strval); + } break; + case dmmeta_FieldId_gensel: { + retval = bool_ReadStrptrMaybe(parent.gensel, strval); + } break; + case dmmeta_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- dmmeta.Nsjs..ReadStrptrMaybe +// Read fields of dmmeta::Nsjs from an ascii string. +// The format of the string is an ssim Tuple +bool dmmeta::Nsjs_ReadStrptrMaybe(dmmeta::Nsjs &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "dmmeta.nsjs") || algo::StripTypeTag(in_str, "dmmeta.Nsjs"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Nsjs_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- dmmeta.Nsjs..Print +// print string representation of ROW to string STR +// cfmt:dmmeta.Nsjs.String printfmt:Tuple +void dmmeta::Nsjs_Print(dmmeta::Nsjs& row, algo::cstring& str) { + algo::tempstr temp; + str << "dmmeta.nsjs"; + + algo::Smallstr16_Print(row.ns, temp); + PrintAttrSpaceReset(str,"ns", temp); + + bool_Print(row.typescript, temp); + PrintAttrSpaceReset(str,"typescript", temp); + + bool_Print(row.gensel, temp); + PrintAttrSpaceReset(str,"gensel", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + // --- dmmeta.Nsproto..ReadFieldMaybe bool dmmeta::Nsproto_ReadFieldMaybe(dmmeta::Nsproto& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -7456,13 +7918,14 @@ bool dmmeta::Nsproto_ReadFieldMaybe(dmmeta::Nsproto& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_ns: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.ns, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7504,13 +7967,14 @@ bool dmmeta::Nstype_ReadFieldMaybe(dmmeta::Nstype& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_nstype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.nstype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7552,17 +8016,17 @@ bool dmmeta::Nsversion_ReadFieldMaybe(dmmeta::Nsversion& parent, algo::strptr fi switch(field_id) { case dmmeta_FieldId_ns: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.ns, strval); - break; - } + } break; case dmmeta_FieldId_version: { retval = algo::Smallstr10_ReadStrptrMaybe(parent.version, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7607,33 +8071,29 @@ bool dmmeta::Nsx_ReadFieldMaybe(dmmeta::Nsx& parent, algo::strptr field, algo::s switch(field_id) { case dmmeta_FieldId_ns: { retval = algo::Smallstr16_ReadStrptrMaybe(parent.ns, strval); - break; - } + } break; case dmmeta_FieldId_genthrow: { retval = bool_ReadStrptrMaybe(parent.genthrow, strval); - break; - } + } break; case dmmeta_FieldId_correct_getorcreate: { retval = bool_ReadStrptrMaybe(parent.correct_getorcreate, strval); - break; - } + } break; case dmmeta_FieldId_pool: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.pool, strval); - break; - } + } break; case dmmeta_FieldId_sortxref: { retval = bool_ReadStrptrMaybe(parent.sortxref, strval); - break; - } + } break; case dmmeta_FieldId_pack: { retval = bool_ReadStrptrMaybe(parent.pack, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7690,21 +8150,20 @@ bool dmmeta::Numstr_ReadFieldMaybe(dmmeta::Numstr& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_numtype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.numtype, strval); - break; - } + } break; case dmmeta_FieldId_base: { retval = i32_ReadStrptrMaybe(parent.base, strval); - break; - } + } break; case dmmeta_FieldId_min_len: { retval = i32_ReadStrptrMaybe(parent.min_len, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7752,13 +8211,14 @@ bool dmmeta::Pack_ReadFieldMaybe(dmmeta::Pack& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7812,21 +8272,20 @@ bool dmmeta::Pmaskfld_ReadFieldMaybe(dmmeta::Pmaskfld& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_filter_print: { retval = bool_ReadStrptrMaybe(parent.filter_print, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7899,22 +8358,21 @@ bool dmmeta::PmaskfldMember_ReadFieldMaybe(dmmeta::PmaskfldMember& parent, algo: (void)value_SetStrptrMaybe(field_id,field); switch(field_id) { case dmmeta_FieldId_pmaskfld_member: { - retval = algo::Smallstr100_ReadStrptrMaybe(parent.pmaskfld_member, strval); - break; - } + retval = algo::Smallstr200_ReadStrptrMaybe(parent.pmaskfld_member, strval); + } break; case dmmeta_FieldId_pmaskfld: { retval = false; - break; - } + } break; case dmmeta_FieldId_field: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -7941,7 +8399,7 @@ void dmmeta::PmaskfldMember_Print(dmmeta::PmaskfldMember& row, algo::cstring& st algo::tempstr temp; str << "dmmeta.pmaskfld_member"; - algo::Smallstr100_Print(row.pmaskfld_member, temp); + algo::Smallstr200_Print(row.pmaskfld_member, temp); PrintAttrSpaceReset(str,"pmaskfld_member", temp); algo::Comment_Print(row.comment, temp); @@ -7997,25 +8455,23 @@ bool dmmeta::Pnew_ReadFieldMaybe(dmmeta::Pnew& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_pnew: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.pnew, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_buftype: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8057,13 +8513,14 @@ bool dmmeta::Printfmt_ReadFieldMaybe(dmmeta::Printfmt& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_printfmt: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.printfmt, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8105,13 +8562,17 @@ bool dmmeta::Ptrary_ReadFieldMaybe(dmmeta::Ptrary& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_unique: { retval = bool_ReadStrptrMaybe(parent.unique, strval); - break; - } - default: break; + } break; + case dmmeta_FieldId_heaplike: { + retval = bool_ReadStrptrMaybe(parent.heaplike, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8143,6 +8604,9 @@ void dmmeta::Ptrary_Print(dmmeta::Ptrary& row, algo::cstring& str) { bool_Print(row.unique, temp); PrintAttrSpaceReset(str,"unique", temp); + + bool_Print(row.heaplike, temp); + PrintAttrSpaceReset(str,"heaplike", temp); } // --- dmmeta.Reftype..ReadFieldMaybe @@ -8153,53 +8617,44 @@ bool dmmeta::Reftype_ReadFieldMaybe(dmmeta::Reftype& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_reftype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.reftype, strval); - break; - } + } break; case dmmeta_FieldId_isval: { retval = bool_ReadStrptrMaybe(parent.isval, strval); - break; - } + } break; case dmmeta_FieldId_cascins: { retval = bool_ReadStrptrMaybe(parent.cascins, strval); - break; - } + } break; case dmmeta_FieldId_usebasepool: { retval = bool_ReadStrptrMaybe(parent.usebasepool, strval); - break; - } + } break; case dmmeta_FieldId_cancopy: { retval = bool_ReadStrptrMaybe(parent.cancopy, strval); - break; - } + } break; case dmmeta_FieldId_isxref: { retval = bool_ReadStrptrMaybe(parent.isxref, strval); - break; - } + } break; case dmmeta_FieldId_del: { retval = bool_ReadStrptrMaybe(parent.del, strval); - break; - } + } break; case dmmeta_FieldId_up: { retval = bool_ReadStrptrMaybe(parent.up, strval); - break; - } + } break; case dmmeta_FieldId_isnew: { retval = bool_ReadStrptrMaybe(parent.isnew, strval); - break; - } + } break; case dmmeta_FieldId_hasalloc: { retval = bool_ReadStrptrMaybe(parent.hasalloc, strval); - break; - } + } break; case dmmeta_FieldId_inst: { retval = bool_ReadStrptrMaybe(parent.inst, strval); - break; - } + } break; case dmmeta_FieldId_varlen: { retval = bool_ReadStrptrMaybe(parent.varlen, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8498,13 +8953,14 @@ bool dmmeta::Rowid_ReadFieldMaybe(dmmeta::Rowid& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8558,29 +9014,26 @@ bool dmmeta::Smallstr_ReadFieldMaybe(dmmeta::Smallstr& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_length: { retval = i32_ReadStrptrMaybe(parent.length, strval); - break; - } + } break; case dmmeta_FieldId_strtype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.strtype, strval); - break; - } + } break; case dmmeta_FieldId_pad: { retval = algo::CppExpr_ReadStrptrMaybe(parent.pad, strval); - break; - } + } break; case dmmeta_FieldId_strict: { retval = bool_ReadStrptrMaybe(parent.strict, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8631,13 +9084,14 @@ bool dmmeta::Sortfld_ReadFieldMaybe(dmmeta::Sortfld& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_sortfld: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.sortfld, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8679,13 +9133,14 @@ bool dmmeta::Sorttype_ReadFieldMaybe(dmmeta::Sorttype& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_sorttype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.sorttype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8727,17 +9182,17 @@ bool dmmeta::Sqltype_ReadFieldMaybe(dmmeta::Sqltype& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_expr: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.expr, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8818,25 +9273,23 @@ bool dmmeta::Ssimfile_ReadFieldMaybe(dmmeta::Ssimfile& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_ssimfile: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.ssimfile, strval); - break; - } + } break; case dmmeta_FieldId_ssimns: { retval = false; - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -8943,45 +9396,38 @@ bool dmmeta::Ssimreq_ReadFieldMaybe(dmmeta::Ssimreq& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_ssimreq: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ssimreq, strval); - break; - } + } break; case dmmeta_FieldId_parent: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.parent, strval); - break; - } + } break; case dmmeta_FieldId_parent_field: { retval = false; - break; - } + } break; case dmmeta_FieldId_parent_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_value: { retval = false; - break; - } + } break; case dmmeta_FieldId_child_ssimfile: { retval = false; - break; - } + } break; case dmmeta_FieldId_child_key: { retval = false; - break; - } + } break; case dmmeta_FieldId_reqchild: { retval = bool_ReadStrptrMaybe(parent.reqchild, strval); - break; - } + } break; case dmmeta_FieldId_bidir: { retval = bool_ReadStrptrMaybe(parent.bidir, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9039,17 +9485,17 @@ bool dmmeta::Ssimsort_ReadFieldMaybe(dmmeta::Ssimsort& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_ssimfile: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.ssimfile, strval); - break; - } + } break; case dmmeta_FieldId_sortfld: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.sortfld, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9094,13 +9540,14 @@ bool dmmeta::Ssimvolatile_ReadFieldMaybe(dmmeta::Ssimvolatile& parent, algo::str switch(field_id) { case dmmeta_FieldId_ssimfile: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.ssimfile, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9142,13 +9589,14 @@ bool dmmeta::Steptype_ReadFieldMaybe(dmmeta::Steptype& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_steptype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.steptype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9190,13 +9638,14 @@ bool dmmeta::Strtype_ReadFieldMaybe(dmmeta::Strtype& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_strtype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.strtype, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9238,17 +9687,17 @@ bool dmmeta::Substr_ReadFieldMaybe(dmmeta::Substr& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_expr: { retval = algo::CppExpr_ReadStrptrMaybe(parent.expr, strval); - break; - } + } break; case dmmeta_FieldId_srcfield: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.srcfield, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9293,25 +9742,23 @@ bool dmmeta::Svtype_ReadFieldMaybe(dmmeta::Svtype& parent, algo::strptr field, a switch(field_id) { case dmmeta_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case dmmeta_FieldId_maxwid: { retval = i32_ReadStrptrMaybe(parent.maxwid, strval); - break; - } + } break; case dmmeta_FieldId_fixedwid1: { retval = i32_ReadStrptrMaybe(parent.fixedwid1, strval); - break; - } + } break; case dmmeta_FieldId_fixedwid2: { retval = i32_ReadStrptrMaybe(parent.fixedwid2, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9362,17 +9809,17 @@ bool dmmeta::Tary_ReadFieldMaybe(dmmeta::Tary& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_aliased: { retval = bool_ReadStrptrMaybe(parent.aliased, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9417,21 +9864,20 @@ bool dmmeta::Thash_ReadFieldMaybe(dmmeta::Thash& parent, algo::strptr field, alg switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_hashfld: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.hashfld, strval); - break; - } + } break; case dmmeta_FieldId_unique: { retval = bool_ReadStrptrMaybe(parent.unique, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9508,21 +9954,20 @@ bool dmmeta::Tracefld_ReadFieldMaybe(dmmeta::Tracefld& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_tracefld: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.tracefld, strval); - break; - } + } break; case dmmeta_FieldId_tracerec: { retval = false; - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9593,21 +10038,20 @@ bool dmmeta::Tracerec_ReadFieldMaybe(dmmeta::Tracerec& parent, algo::strptr fiel switch(field_id) { case dmmeta_FieldId_tracerec: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.tracerec, strval); - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9661,17 +10105,17 @@ bool dmmeta::Typefld_ReadFieldMaybe(dmmeta::Typefld& parent, algo::strptr field, switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_ctype: { retval = false; - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9705,6 +10149,67 @@ void dmmeta::Typefld_Print(dmmeta::Typefld& row, algo::cstring& str) { PrintAttrSpaceReset(str,"comment", temp); } +// --- dmmeta.Userfunc..ReadFieldMaybe +bool dmmeta::Userfunc_ReadFieldMaybe(dmmeta::Userfunc& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + dmmeta::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case dmmeta_FieldId_userfunc: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.userfunc, strval); + } break; + case dmmeta_FieldId_acrkey: { + retval = algo::Smallstr200_ReadStrptrMaybe(parent.acrkey, strval); + } break; + case dmmeta_FieldId_cppname: { + retval = algo::Smallstr100_ReadStrptrMaybe(parent.cppname, strval); + } break; + case dmmeta_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- dmmeta.Userfunc..ReadStrptrMaybe +// Read fields of dmmeta::Userfunc from an ascii string. +// The format of the string is an ssim Tuple +bool dmmeta::Userfunc_ReadStrptrMaybe(dmmeta::Userfunc &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "dmmeta.userfunc") || algo::StripTypeTag(in_str, "dmmeta.Userfunc"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Userfunc_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- dmmeta.Userfunc..Print +// print string representation of ROW to string STR +// cfmt:dmmeta.Userfunc.String printfmt:Tuple +void dmmeta::Userfunc_Print(dmmeta::Userfunc& row, algo::cstring& str) { + algo::tempstr temp; + str << "dmmeta.userfunc"; + + algo::Smallstr50_Print(row.userfunc, temp); + PrintAttrSpaceReset(str,"userfunc", temp); + + algo::Smallstr200_Print(row.acrkey, temp); + PrintAttrSpaceReset(str,"acrkey", temp); + + algo::Smallstr100_Print(row.cppname, temp); + PrintAttrSpaceReset(str,"cppname", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + // --- dmmeta.Usertracefld..ReadFieldMaybe bool dmmeta::Usertracefld_ReadFieldMaybe(dmmeta::Usertracefld& parent, algo::strptr field, algo::strptr strval) { bool retval = true; @@ -9713,13 +10218,14 @@ bool dmmeta::Usertracefld_ReadFieldMaybe(dmmeta::Usertracefld& parent, algo::str switch(field_id) { case dmmeta_FieldId_tracefld: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.tracefld, strval); - break; - } + } break; case dmmeta_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -9809,33 +10315,29 @@ bool dmmeta::Xref_ReadFieldMaybe(dmmeta::Xref& parent, algo::strptr field, algo: switch(field_id) { case dmmeta_FieldId_field: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.field, strval); - break; - } + } break; case dmmeta_FieldId_name: { retval = false; - break; - } + } break; case dmmeta_FieldId_inscond: { retval = algo::CppExpr_ReadStrptrMaybe(parent.inscond, strval); - break; - } + } break; case dmmeta_FieldId_ns: { retval = false; - break; - } + } break; case dmmeta_FieldId_via: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.via, strval); - break; - } + } break; case dmmeta_FieldId_viafld: { retval = false; - break; - } + } break; case dmmeta_FieldId_keyfld: { retval = false; - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); diff --git a/cpp/gen/fm_gen.cpp b/cpp/gen/fm_gen.cpp index 0f08abfd..3ec1e66d 100644 --- a/cpp/gen/fm_gen.cpp +++ b/cpp/gen/fm_gen.cpp @@ -48,7 +48,7 @@ bool fm::ch_ReadStrptrMaybe(fm::Code& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 32"); + algo_lib::AppendErrtext("comment","text too long, limit 32"); } return retval; } @@ -106,7 +106,7 @@ bool fm::ch_ReadStrptrMaybe(fm::Objtype& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 15"); + algo_lib::AppendErrtext("comment","text too long, limit 15"); } return retval; } @@ -164,7 +164,7 @@ bool fm::ch_ReadStrptrMaybe(fm::Objinst& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 79"); + algo_lib::AppendErrtext("comment","text too long, limit 79"); } return retval; } @@ -396,7 +396,7 @@ bool fm::ch_ReadStrptrMaybe(fm::Summary& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 64"); + algo_lib::AppendErrtext("comment","text too long, limit 64"); } return retval; } @@ -454,7 +454,7 @@ bool fm::ch_ReadStrptrMaybe(fm::Description& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 128"); + algo_lib::AppendErrtext("comment","text too long, limit 128"); } return retval; } @@ -512,7 +512,7 @@ bool fm::ch_ReadStrptrMaybe(fm::Source& parent, algo::strptr rhs) { ch_SetStrptr(parent, rhs); retval = true; } else { - algo_lib::SaveBadTag("comment","text too long, limit 32"); + algo_lib::AppendErrtext("comment","text too long, limit 32"); } return retval; } @@ -574,73 +574,59 @@ bool fm::AlarmMsg_ReadFieldMaybe(fm::AlarmMsg& parent, algo::strptr field, algo: switch(field_id) { case fm_FieldId_base: { retval = false; - break; - } + } break; case fm_FieldId_type: { retval = false; - break; - } + } break; case fm_FieldId_length: { retval = false; - break; - } + } break; case fm_FieldId_code: { retval = fm::Code_ReadStrptrMaybe(parent.code, strval); - break; - } + } break; case fm_FieldId_objtype: { retval = fm::Objtype_ReadStrptrMaybe(parent.objtype, strval); - break; - } + } break; case fm_FieldId_objinst: { retval = fm::Objinst_ReadStrptrMaybe(parent.objinst, strval); - break; - } + } break; case fm_FieldId_flag: { retval = fm::Flag_ReadStrptrMaybe(parent.flag, strval); - break; - } + } break; case fm_FieldId_severity: { retval = fm::Severity_ReadStrptrMaybe(parent.severity, strval); - break; - } + } break; case fm_FieldId_n_occurred: { retval = i32_ReadStrptrMaybe(parent.n_occurred, strval); - break; - } + } break; case fm_FieldId_first_time: { retval = algo::UnTime_ReadStrptrMaybe(parent.first_time, strval); - break; - } + } break; case fm_FieldId_last_time: { retval = algo::UnTime_ReadStrptrMaybe(parent.last_time, strval); - break; - } + } break; case fm_FieldId_clear_time: { retval = algo::UnTime_ReadStrptrMaybe(parent.clear_time, strval); - break; - } + } break; case fm_FieldId_update_time: { retval = algo::UnTime_ReadStrptrMaybe(parent.update_time, strval); - break; - } + } break; case fm_FieldId_objtype_summary: { retval = fm::Summary_ReadStrptrMaybe(parent.objtype_summary, strval); - break; - } + } break; case fm_FieldId_summary: { retval = fm::Summary_ReadStrptrMaybe(parent.summary, strval); - break; - } + } break; case fm_FieldId_description: { retval = fm::Description_ReadStrptrMaybe(parent.description, strval); - break; - } + } break; case fm_FieldId_source: { retval = fm::Source_ReadStrptrMaybe(parent.source, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); diff --git a/cpp/gen/fmdb_gen.cpp b/cpp/gen/fmdb_gen.cpp index 2ea3412f..5ff4d5e6 100644 --- a/cpp/gen/fmdb_gen.cpp +++ b/cpp/gen/fmdb_gen.cpp @@ -113,73 +113,59 @@ bool fmdb::Alarm_ReadFieldMaybe(fmdb::Alarm& parent, algo::strptr field, algo::s switch(field_id) { case fmdb_FieldId_alarm: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.alarm, strval); - break; - } + } break; case fmdb_FieldId_code: { retval = false; - break; - } + } break; case fmdb_FieldId_object: { retval = false; - break; - } + } break; case fmdb_FieldId_objtype: { retval = false; - break; - } + } break; case fmdb_FieldId_objinst: { retval = false; - break; - } + } break; case fmdb_FieldId_objprefix: { retval = false; - break; - } + } break; case fmdb_FieldId_flag: { retval = fm::Flag_ReadStrptrMaybe(parent.flag, strval); - break; - } + } break; case fmdb_FieldId_severity: { retval = fm::Severity_ReadStrptrMaybe(parent.severity, strval); - break; - } + } break; case fmdb_FieldId_n_occurred: { retval = i32_ReadStrptrMaybe(parent.n_occurred, strval); - break; - } + } break; case fmdb_FieldId_first_time: { retval = algo::UnTime_ReadStrptrMaybe(parent.first_time, strval); - break; - } + } break; case fmdb_FieldId_last_time: { retval = algo::UnTime_ReadStrptrMaybe(parent.last_time, strval); - break; - } + } break; case fmdb_FieldId_clear_time: { retval = algo::UnTime_ReadStrptrMaybe(parent.clear_time, strval); - break; - } + } break; case fmdb_FieldId_update_time: { retval = algo::UnTime_ReadStrptrMaybe(parent.update_time, strval); - break; - } + } break; case fmdb_FieldId_objtype_summary: { retval = fm::Summary_ReadStrptrMaybe(parent.objtype_summary, strval); - break; - } + } break; case fmdb_FieldId_summary: { retval = fm::Summary_ReadStrptrMaybe(parent.summary, strval); - break; - } + } break; case fmdb_FieldId_description: { retval = fm::Description_ReadStrptrMaybe(parent.description, strval); - break; - } + } break; case fmdb_FieldId_source: { retval = fm::Source_ReadStrptrMaybe(parent.source, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -257,21 +243,20 @@ bool fmdb::AlmCode_ReadFieldMaybe(fmdb::AlmCode& parent, algo::strptr field, alg switch(field_id) { case fmdb_FieldId_alm_code: { retval = fm::Code_ReadStrptrMaybe(parent.alm_code, strval); - break; - } + } break; case fmdb_FieldId_severity: { retval = fm::Severity_ReadStrptrMaybe(parent.severity, strval); - break; - } + } break; case fmdb_FieldId_source: { retval = fm::Source_ReadStrptrMaybe(parent.source, strval); - break; - } + } break; case fmdb_FieldId_summary: { retval = fm::Summary_ReadStrptrMaybe(parent.summary, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -319,13 +304,14 @@ bool fmdb::AlmObjtype_ReadFieldMaybe(fmdb::AlmObjtype& parent, algo::strptr fiel switch(field_id) { case fmdb_FieldId_alm_objtype: { retval = fm::Objtype_ReadStrptrMaybe(parent.alm_objtype, strval); - break; - } + } break; case fmdb_FieldId_summary: { retval = fm::Summary_ReadStrptrMaybe(parent.summary, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -367,13 +353,14 @@ bool fmdb::AlmSource_ReadFieldMaybe(fmdb::AlmSource& parent, algo::strptr field, switch(field_id) { case fmdb_FieldId_alm_source: { retval = fm::Source_ReadStrptrMaybe(parent.alm_source, strval); - break; - } + } break; case fmdb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); diff --git a/cpp/gen/gcache_gen.cpp b/cpp/gen/gcache_gen.cpp index b7332f78..b0d5aaba 100644 --- a/cpp/gen/gcache_gen.cpp +++ b/cpp/gen/gcache_gen.cpp @@ -33,10 +33,13 @@ #include "include/gen/algo_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep gcache::FDb gcache::_db; // dependency found via dev.targdep @@ -58,8 +61,8 @@ const char *gcache_help = " -after string Start time for reporting\n" " -report Show end-of-run report\n" " -force Force recompile and update cache\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -89,29 +92,26 @@ bool gcache::cleanreport_ReadFieldMaybe(gcache::cleanreport& parent, algo::strpt switch(field_id) { case gcache_FieldId_n_cachefile: { retval = i32_ReadStrptrMaybe(parent.n_cachefile, strval); - break; - } + } break; case gcache_FieldId_n_cachefile_del: { retval = i32_ReadStrptrMaybe(parent.n_cachefile_del, strval); - break; - } + } break; case gcache_FieldId_n_cachefile_recent: { retval = i32_ReadStrptrMaybe(parent.n_cachefile_recent, strval); - break; - } + } break; case gcache_FieldId_n_logline: { retval = i32_ReadStrptrMaybe(parent.n_logline, strval); - break; - } + } break; case gcache_FieldId_n_logline_del: { retval = i32_ReadStrptrMaybe(parent.n_logline_del, strval); - break; - } + } break; case gcache_FieldId_new_cachesize_mb: { retval = i64_ReadStrptrMaybe(parent.new_cachesize_mb, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -252,9 +252,8 @@ void gcache::ReadArgv() { } if (ch_N(attrname) == 0) { err << "gcache: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:gcache.FDb.cmdline @@ -308,7 +310,7 @@ void gcache::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -375,8 +377,8 @@ bool gcache::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && gcache::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -735,11 +737,13 @@ void gcache::StaticCheck() { // --- gcache...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); gcache::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock gcache::ReadArgv(); // dmmeta.main:gcache gcache::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -752,6 +756,7 @@ int main(int argc, char **argv) { try { gcache::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/gcli_gen.cpp b/cpp/gen/gcli_gen.cpp index a391889a..dc810e73 100644 --- a/cpp/gen/gcli_gen.cpp +++ b/cpp/gen/gcli_gen.cpp @@ -41,8 +41,8 @@ // Instantiate all libraries linked into this executable, // in dependency order -algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_json::FDb lib_json::_db; // dependency found via dev.targdep +algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep gcli::FDb gcli::_db; // dependency found via dev.targdep namespace gcli { @@ -53,7 +53,7 @@ const char *gcli_help = " -in string \"data\" Input directory or filename, - for stdin\n" " [selector] string \"issue:%\" table:key, where table is issue,repo,mr, etc. and key is a regex.\n" " [fields]... string additional key:value pairs for use with -create, -list, -update\n" -" -accept (action) accept a slected merge request\n" +" -accept (action) accept a selected merge request\n" " -start (action) start working on a selected issue\n" " -list (action) show selected table\n" " -create (action) create a table record(s)\n" @@ -67,8 +67,8 @@ const char *gcli_help = " -dry_run Print actions, do not perform\n" " -gitdir string \"\" (setup) Change directory of git repository\n" " -show_gitlab_system_notes (misc) Show issue and mr notes created by gitlab\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -82,10 +82,6 @@ namespace gcli { // gen:ns_print_proto static void InitReflection(); // func:gcli.FDb.gtype.InputMaybe static bool gtype_InputMaybe(gclidb::Gtype &elem) __attribute__((nothrow)); - // func:gcli.FDb.grepossh.InputMaybe - static bool grepossh_InputMaybe(gclidb::Grepossh &elem) __attribute__((nothrow)); - // func:gcli.FDb.grepogitport.InputMaybe - static bool grepogitport_InputMaybe(gclidb::Grepogitport &elem) __attribute__((nothrow)); // func:gcli.FDb.gstatet.InputMaybe static bool gstatet_InputMaybe(gclidb::Gstatet &elem) __attribute__((nothrow)); // func:gcli.FDb.gmethod.InputMaybe @@ -217,9 +213,8 @@ void gcli::ReadArgv() { } if (ch_N(attrname) == 0) { err << "gcli: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:gcli.FDb.cmdline @@ -273,7 +271,7 @@ void gcli::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -318,7 +316,7 @@ static void gcli::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'gcli.Input' signature:'11a9aa9a5e538f546927ef1802bd464c4e5842b9'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'gcli.Input' signature:'582f69151ea05d2c1b5eb2e745d7211a5c87c417'"); } // --- gcli.FDb._db.InsertStrptrMaybe @@ -335,18 +333,6 @@ bool gcli::InsertStrptrMaybe(algo::strptr str) { retval = retval && gtype_InputMaybe(elem); break; } - case gcli_TableId_gclidb_Grepossh: { // finput:gcli.FDb.grepossh - gclidb::Grepossh elem; - retval = gclidb::Grepossh_ReadStrptrMaybe(elem, str); - retval = retval && grepossh_InputMaybe(elem); - break; - } - case gcli_TableId_gclidb_Grepogitport: { // finput:gcli.FDb.grepogitport - gclidb::Grepogitport elem; - retval = gclidb::Grepogitport_ReadStrptrMaybe(elem, str); - retval = retval && grepogitport_InputMaybe(elem); - break; - } case gcli_TableId_gclidb_Gstatet: { // finput:gcli.FDb.gstatet gclidb::Gstatet elem; retval = gclidb::Gstatet_ReadStrptrMaybe(elem, str); @@ -439,16 +425,14 @@ bool gcli::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && gcli::LoadTuplesFile(algo::SsimFname(root,"gclidb.gfld"),recursive); retval = retval && gcli::LoadTuplesFile(algo::SsimFname(root,"gclidb.gtblactfld"),recursive); retval = retval && gcli::LoadTuplesFile(algo::SsimFname(root,"gclidb.gstatet"),recursive); - retval = retval && gcli::LoadTuplesFile(algo::SsimFname(root,"gclidb.grepossh"),recursive); - retval = retval && gcli::LoadTuplesFile(algo::SsimFname(root,"gclidb.grepogitport"),recursive); retval = retval && gcli::LoadTuplesFile(algo::SsimFname(root,"gclidb.grepo"),recursive); retval = retval && gcli::LoadTuplesFile(algo::SsimFname(root,"gclidb.gmethod"),recursive); retval = retval && gcli::LoadTuplesFile(algo::SsimFname(root,"gclidb.gclicmdt"),recursive); retval = retval && gcli::LoadTuplesFile(algo::SsimFname(root,"gclidb.gclicmdf2j"),recursive); retval = retval && gcli::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -623,220 +607,6 @@ bool gcli::gtype_XrefMaybe(gcli::FGtype &row) { return retval; } -// --- gcli.FDb.grepossh.Alloc -// Allocate memory for new default row. -// If out of memory, process is killed. -gcli::FGrepossh& gcli::grepossh_Alloc() { - gcli::FGrepossh* row = grepossh_AllocMaybe(); - if (UNLIKELY(row == NULL)) { - FatalErrorExit("gcli.out_of_mem field:gcli.FDb.grepossh comment:'Alloc failed'"); - } - return *row; -} - -// --- gcli.FDb.grepossh.AllocMaybe -// Allocate memory for new element. If out of memory, return NULL. -gcli::FGrepossh* gcli::grepossh_AllocMaybe() { - gcli::FGrepossh *row = (gcli::FGrepossh*)grepossh_AllocMem(); - if (row) { - new (row) gcli::FGrepossh; // call constructor - } - return row; -} - -// --- gcli.FDb.grepossh.InsertMaybe -// Create new row from struct. -// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -gcli::FGrepossh* gcli::grepossh_InsertMaybe(const gclidb::Grepossh &value) { - gcli::FGrepossh *row = &grepossh_Alloc(); // if out of memory, process dies. if input error, return NULL. - grepossh_CopyIn(*row,const_cast(value)); - bool ok = grepossh_XrefMaybe(*row); // this may return false - if (!ok) { - grepossh_RemoveLast(); // delete offending row, any existing xrefs are cleared - row = NULL; // forget this ever happened - } - return row; -} - -// --- gcli.FDb.grepossh.AllocMem -// Allocate space for one element. If no memory available, return NULL. -void* gcli::grepossh_AllocMem() { - u64 new_nelems = _db.grepossh_n+1; - // compute level and index on level - u64 bsr = algo::u64_BitScanReverse(new_nelems); - u64 base = u64(1)<0; ) { - n--; - grepossh_qFind(u64(n)).~FGrepossh(); // destroy last element - _db.grepossh_n = i32(n); - } -} - -// --- gcli.FDb.grepossh.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void gcli::grepossh_RemoveLast() { - u64 n = _db.grepossh_n; - if (n > 0) { - n -= 1; - grepossh_qFind(u64(n)).~FGrepossh(); - _db.grepossh_n = i32(n); - } -} - -// --- gcli.FDb.grepossh.InputMaybe -static bool gcli::grepossh_InputMaybe(gclidb::Grepossh &elem) { - bool retval = true; - retval = grepossh_InsertMaybe(elem) != nullptr; - return retval; -} - -// --- gcli.FDb.grepossh.XrefMaybe -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool gcli::grepossh_XrefMaybe(gcli::FGrepossh &row) { - bool retval = true; - (void)row; - // insert grepossh into index ind_grepossh - if (true) { // user-defined insert condition - bool success = ind_grepossh_InsertMaybe(row); - if (UNLIKELY(!success)) { - ch_RemoveAll(algo_lib::_db.errtext); - algo_lib::_db.errtext << "gcli.duplicate_key xref:gcli.FDb.ind_grepossh"; // check for duplicate key - return false; - } - } - return retval; -} - -// --- gcli.FDb.grepogitport.Alloc -// Allocate memory for new default row. -// If out of memory, process is killed. -gcli::FGrepogitport& gcli::grepogitport_Alloc() { - gcli::FGrepogitport* row = grepogitport_AllocMaybe(); - if (UNLIKELY(row == NULL)) { - FatalErrorExit("gcli.out_of_mem field:gcli.FDb.grepogitport comment:'Alloc failed'"); - } - return *row; -} - -// --- gcli.FDb.grepogitport.AllocMaybe -// Allocate memory for new element. If out of memory, return NULL. -gcli::FGrepogitport* gcli::grepogitport_AllocMaybe() { - gcli::FGrepogitport *row = (gcli::FGrepogitport*)grepogitport_AllocMem(); - if (row) { - new (row) gcli::FGrepogitport; // call constructor - } - return row; -} - -// --- gcli.FDb.grepogitport.InsertMaybe -// Create new row from struct. -// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -gcli::FGrepogitport* gcli::grepogitport_InsertMaybe(const gclidb::Grepogitport &value) { - gcli::FGrepogitport *row = &grepogitport_Alloc(); // if out of memory, process dies. if input error, return NULL. - grepogitport_CopyIn(*row,const_cast(value)); - bool ok = grepogitport_XrefMaybe(*row); // this may return false - if (!ok) { - grepogitport_RemoveLast(); // delete offending row, any existing xrefs are cleared - row = NULL; // forget this ever happened - } - return row; -} - -// --- gcli.FDb.grepogitport.AllocMem -// Allocate space for one element. If no memory available, return NULL. -void* gcli::grepogitport_AllocMem() { - u64 new_nelems = _db.grepogitport_n+1; - // compute level and index on level - u64 bsr = algo::u64_BitScanReverse(new_nelems); - u64 base = u64(1)<0; ) { - n--; - grepogitport_qFind(u64(n)).~FGrepogitport(); // destroy last element - _db.grepogitport_n = i32(n); - } -} - -// --- gcli.FDb.grepogitport.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void gcli::grepogitport_RemoveLast() { - u64 n = _db.grepogitport_n; - if (n > 0) { - n -= 1; - grepogitport_qFind(u64(n)).~FGrepogitport(); - _db.grepogitport_n = i32(n); - } -} - -// --- gcli.FDb.grepogitport.InputMaybe -static bool gcli::grepogitport_InputMaybe(gclidb::Grepogitport &elem) { - bool retval = true; - retval = grepogitport_InsertMaybe(elem) != nullptr; - return retval; -} - -// --- gcli.FDb.grepogitport.XrefMaybe -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool gcli::grepogitport_XrefMaybe(gcli::FGrepogitport &row) { - bool retval = true; - (void)row; - // insert grepogitport into index ind_grepogitport - if (true) { // user-defined insert condition - bool success = ind_grepogitport_InsertMaybe(row); - if (UNLIKELY(!success)) { - ch_RemoveAll(algo_lib::_db.errtext); - algo_lib::_db.errtext << "gcli.duplicate_key xref:gcli.FDb.ind_grepogitport"; // check for duplicate key - return false; - } - } - return retval; -} - // --- gcli.FDb.githost.Alloc // Allocate memory for new default row. // If out of memory, process is killed. @@ -1716,14 +1486,9 @@ bool gcli::gtypeh_XrefMaybe(gcli::FGtypeh &row) { // Find row by key. Return NULL if not found. gcli::FGclicmd* gcli::ind_gclicmd_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_gclicmd_buckets_n - 1); - gcli::FGclicmd* *e = &_db.ind_gclicmd_buckets_elems[index]; - gcli::FGclicmd* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gclicmd == key; - if (done) break; - e = &ret->ind_gclicmd_next; - } while (true); + gcli::FGclicmd *ret = _db.ind_gclicmd_buckets_elems[index]; + for (; ret && !((*ret).gclicmd == key); ret = ret->ind_gclicmd_next) { + } return ret; } @@ -1755,10 +1520,11 @@ gcli::FGclicmd& gcli::ind_gclicmd_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gclicmd.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gclicmd_InsertMaybe(gcli::FGclicmd& row) { - ind_gclicmd_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gclicmd_next == (gcli::FGclicmd*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmd) & (_db.ind_gclicmd_buckets_n - 1); + row.ind_gclicmd_hashval = algo::Smallstr250_Hash(0, row.gclicmd); + ind_gclicmd_Reserve(1); + u32 index = row.ind_gclicmd_hashval & (_db.ind_gclicmd_buckets_n - 1); gcli::FGclicmd* *prev = &_db.ind_gclicmd_buckets_elems[index]; do { gcli::FGclicmd* ret = *prev; @@ -1784,7 +1550,7 @@ bool gcli::ind_gclicmd_InsertMaybe(gcli::FGclicmd& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gclicmd_Remove(gcli::FGclicmd& row) { if (LIKELY(row.ind_gclicmd_next != (gcli::FGclicmd*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmd) & (_db.ind_gclicmd_buckets_n - 1); + u32 index = row.ind_gclicmd_hashval & (_db.ind_gclicmd_buckets_n - 1); gcli::FGclicmd* *prev = &_db.ind_gclicmd_buckets_elems[index]; // addr of pointer to current element while (gcli::FGclicmd *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1801,8 +1567,14 @@ void gcli::ind_gclicmd_Remove(gcli::FGclicmd& row) { // --- gcli.FDb.ind_gclicmd.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gclicmd_Reserve(int n) { + ind_gclicmd_AbsReserve(_db.ind_gclicmd_n + n); +} + +// --- gcli.FDb.ind_gclicmd.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gclicmd_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gclicmd_buckets_n; - u32 new_nelems = _db.ind_gclicmd_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1821,7 +1593,7 @@ void gcli::ind_gclicmd_Reserve(int n) { while (elem) { gcli::FGclicmd &row = *elem; gcli::FGclicmd* next = row.ind_gclicmd_next; - u32 index = algo::Smallstr250_Hash(0, row.gclicmd) & (new_nbuckets-1); + u32 index = row.ind_gclicmd_hashval & (new_nbuckets-1); row.ind_gclicmd_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1838,14 +1610,9 @@ void gcli::ind_gclicmd_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FGclicmdf* gcli::ind_gclicmdf_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_gclicmdf_buckets_n - 1); - gcli::FGclicmdf* *e = &_db.ind_gclicmdf_buckets_elems[index]; - gcli::FGclicmdf* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gclicmdf == key; - if (done) break; - e = &ret->ind_gclicmdf_next; - } while (true); + gcli::FGclicmdf *ret = _db.ind_gclicmdf_buckets_elems[index]; + for (; ret && !((*ret).gclicmdf == key); ret = ret->ind_gclicmdf_next) { + } return ret; } @@ -1877,10 +1644,11 @@ gcli::FGclicmdf& gcli::ind_gclicmdf_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gclicmdf.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gclicmdf_InsertMaybe(gcli::FGclicmdf& row) { - ind_gclicmdf_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gclicmdf_next == (gcli::FGclicmdf*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmdf) & (_db.ind_gclicmdf_buckets_n - 1); + row.ind_gclicmdf_hashval = algo::Smallstr250_Hash(0, row.gclicmdf); + ind_gclicmdf_Reserve(1); + u32 index = row.ind_gclicmdf_hashval & (_db.ind_gclicmdf_buckets_n - 1); gcli::FGclicmdf* *prev = &_db.ind_gclicmdf_buckets_elems[index]; do { gcli::FGclicmdf* ret = *prev; @@ -1906,7 +1674,7 @@ bool gcli::ind_gclicmdf_InsertMaybe(gcli::FGclicmdf& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gclicmdf_Remove(gcli::FGclicmdf& row) { if (LIKELY(row.ind_gclicmdf_next != (gcli::FGclicmdf*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmdf) & (_db.ind_gclicmdf_buckets_n - 1); + u32 index = row.ind_gclicmdf_hashval & (_db.ind_gclicmdf_buckets_n - 1); gcli::FGclicmdf* *prev = &_db.ind_gclicmdf_buckets_elems[index]; // addr of pointer to current element while (gcli::FGclicmdf *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1923,8 +1691,14 @@ void gcli::ind_gclicmdf_Remove(gcli::FGclicmdf& row) { // --- gcli.FDb.ind_gclicmdf.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gclicmdf_Reserve(int n) { + ind_gclicmdf_AbsReserve(_db.ind_gclicmdf_n + n); +} + +// --- gcli.FDb.ind_gclicmdf.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gclicmdf_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gclicmdf_buckets_n; - u32 new_nelems = _db.ind_gclicmdf_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1943,7 +1717,7 @@ void gcli::ind_gclicmdf_Reserve(int n) { while (elem) { gcli::FGclicmdf &row = *elem; gcli::FGclicmdf* next = row.ind_gclicmdf_next; - u32 index = algo::Smallstr250_Hash(0, row.gclicmdf) & (new_nbuckets-1); + u32 index = row.ind_gclicmdf_hashval & (new_nbuckets-1); row.ind_gclicmdf_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1960,14 +1734,9 @@ void gcli::ind_gclicmdf_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FGclicmdt* gcli::ind_gclicmdt_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_gclicmdt_buckets_n - 1); - gcli::FGclicmdt* *e = &_db.ind_gclicmdt_buckets_elems[index]; - gcli::FGclicmdt* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gclicmdt == key; - if (done) break; - e = &ret->ind_gclicmdt_next; - } while (true); + gcli::FGclicmdt *ret = _db.ind_gclicmdt_buckets_elems[index]; + for (; ret && !((*ret).gclicmdt == key); ret = ret->ind_gclicmdt_next) { + } return ret; } @@ -1982,10 +1751,11 @@ gcli::FGclicmdt& gcli::ind_gclicmdt_FindX(const algo::strptr& key) { // --- gcli.FDb.ind_gclicmdt.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gclicmdt_InsertMaybe(gcli::FGclicmdt& row) { - ind_gclicmdt_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gclicmdt_next == (gcli::FGclicmdt*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmdt) & (_db.ind_gclicmdt_buckets_n - 1); + row.ind_gclicmdt_hashval = algo::Smallstr250_Hash(0, row.gclicmdt); + ind_gclicmdt_Reserve(1); + u32 index = row.ind_gclicmdt_hashval & (_db.ind_gclicmdt_buckets_n - 1); gcli::FGclicmdt* *prev = &_db.ind_gclicmdt_buckets_elems[index]; do { gcli::FGclicmdt* ret = *prev; @@ -2011,7 +1781,7 @@ bool gcli::ind_gclicmdt_InsertMaybe(gcli::FGclicmdt& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gclicmdt_Remove(gcli::FGclicmdt& row) { if (LIKELY(row.ind_gclicmdt_next != (gcli::FGclicmdt*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmdt) & (_db.ind_gclicmdt_buckets_n - 1); + u32 index = row.ind_gclicmdt_hashval & (_db.ind_gclicmdt_buckets_n - 1); gcli::FGclicmdt* *prev = &_db.ind_gclicmdt_buckets_elems[index]; // addr of pointer to current element while (gcli::FGclicmdt *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2028,8 +1798,14 @@ void gcli::ind_gclicmdt_Remove(gcli::FGclicmdt& row) { // --- gcli.FDb.ind_gclicmdt.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gclicmdt_Reserve(int n) { + ind_gclicmdt_AbsReserve(_db.ind_gclicmdt_n + n); +} + +// --- gcli.FDb.ind_gclicmdt.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gclicmdt_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gclicmdt_buckets_n; - u32 new_nelems = _db.ind_gclicmdt_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2048,7 +1824,7 @@ void gcli::ind_gclicmdt_Reserve(int n) { while (elem) { gcli::FGclicmdt &row = *elem; gcli::FGclicmdt* next = row.ind_gclicmdt_next; - u32 index = algo::Smallstr250_Hash(0, row.gclicmdt) & (new_nbuckets-1); + u32 index = row.ind_gclicmdt_hashval & (new_nbuckets-1); row.ind_gclicmdt_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2065,14 +1841,9 @@ void gcli::ind_gclicmdt_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FGmethod* gcli::ind_gmethod_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_gmethod_buckets_n - 1); - gcli::FGmethod* *e = &_db.ind_gmethod_buckets_elems[index]; - gcli::FGmethod* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gmethod == key; - if (done) break; - e = &ret->ind_gmethod_next; - } while (true); + gcli::FGmethod *ret = _db.ind_gmethod_buckets_elems[index]; + for (; ret && !((*ret).gmethod == key); ret = ret->ind_gmethod_next) { + } return ret; } @@ -2104,10 +1875,11 @@ gcli::FGmethod& gcli::ind_gmethod_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gmethod.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gmethod_InsertMaybe(gcli::FGmethod& row) { - ind_gmethod_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gmethod_next == (gcli::FGmethod*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gmethod) & (_db.ind_gmethod_buckets_n - 1); + row.ind_gmethod_hashval = algo::Smallstr50_Hash(0, row.gmethod); + ind_gmethod_Reserve(1); + u32 index = row.ind_gmethod_hashval & (_db.ind_gmethod_buckets_n - 1); gcli::FGmethod* *prev = &_db.ind_gmethod_buckets_elems[index]; do { gcli::FGmethod* ret = *prev; @@ -2133,7 +1905,7 @@ bool gcli::ind_gmethod_InsertMaybe(gcli::FGmethod& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gmethod_Remove(gcli::FGmethod& row) { if (LIKELY(row.ind_gmethod_next != (gcli::FGmethod*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gmethod) & (_db.ind_gmethod_buckets_n - 1); + u32 index = row.ind_gmethod_hashval & (_db.ind_gmethod_buckets_n - 1); gcli::FGmethod* *prev = &_db.ind_gmethod_buckets_elems[index]; // addr of pointer to current element while (gcli::FGmethod *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2150,8 +1922,14 @@ void gcli::ind_gmethod_Remove(gcli::FGmethod& row) { // --- gcli.FDb.ind_gmethod.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gmethod_Reserve(int n) { + ind_gmethod_AbsReserve(_db.ind_gmethod_n + n); +} + +// --- gcli.FDb.ind_gmethod.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gmethod_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gmethod_buckets_n; - u32 new_nelems = _db.ind_gmethod_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2170,7 +1948,7 @@ void gcli::ind_gmethod_Reserve(int n) { while (elem) { gcli::FGmethod &row = *elem; gcli::FGmethod* next = row.ind_gmethod_next; - u32 index = algo::Smallstr50_Hash(0, row.gmethod) & (new_nbuckets-1); + u32 index = row.ind_gmethod_hashval & (new_nbuckets-1); row.ind_gmethod_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2187,14 +1965,9 @@ void gcli::ind_gmethod_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FGrepo* gcli::ind_grepo_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_grepo_buckets_n - 1); - gcli::FGrepo* *e = &_db.ind_grepo_buckets_elems[index]; - gcli::FGrepo* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).grepo == key; - if (done) break; - e = &ret->ind_grepo_next; - } while (true); + gcli::FGrepo *ret = _db.ind_grepo_buckets_elems[index]; + for (; ret && !((*ret).grepo == key); ret = ret->ind_grepo_next) { + } return ret; } @@ -2226,10 +1999,11 @@ gcli::FGrepo& gcli::ind_grepo_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_grepo.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_grepo_InsertMaybe(gcli::FGrepo& row) { - ind_grepo_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_grepo_next == (gcli::FGrepo*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.grepo) & (_db.ind_grepo_buckets_n - 1); + row.ind_grepo_hashval = algo::Smallstr250_Hash(0, row.grepo); + ind_grepo_Reserve(1); + u32 index = row.ind_grepo_hashval & (_db.ind_grepo_buckets_n - 1); gcli::FGrepo* *prev = &_db.ind_grepo_buckets_elems[index]; do { gcli::FGrepo* ret = *prev; @@ -2255,7 +2029,7 @@ bool gcli::ind_grepo_InsertMaybe(gcli::FGrepo& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_grepo_Remove(gcli::FGrepo& row) { if (LIKELY(row.ind_grepo_next != (gcli::FGrepo*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.grepo) & (_db.ind_grepo_buckets_n - 1); + u32 index = row.ind_grepo_hashval & (_db.ind_grepo_buckets_n - 1); gcli::FGrepo* *prev = &_db.ind_grepo_buckets_elems[index]; // addr of pointer to current element while (gcli::FGrepo *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2272,8 +2046,14 @@ void gcli::ind_grepo_Remove(gcli::FGrepo& row) { // --- gcli.FDb.ind_grepo.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_grepo_Reserve(int n) { + ind_grepo_AbsReserve(_db.ind_grepo_n + n); +} + +// --- gcli.FDb.ind_grepo.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_grepo_AbsReserve(int n) { u32 old_nbuckets = _db.ind_grepo_buckets_n; - u32 new_nelems = _db.ind_grepo_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2292,7 +2072,7 @@ void gcli::ind_grepo_Reserve(int n) { while (elem) { gcli::FGrepo &row = *elem; gcli::FGrepo* next = row.ind_grepo_next; - u32 index = algo::Smallstr250_Hash(0, row.grepo) & (new_nbuckets-1); + u32 index = row.ind_grepo_hashval & (new_nbuckets-1); row.ind_grepo_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2309,14 +2089,9 @@ void gcli::ind_grepo_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FIssue* gcli::ind_issue_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_issue_buckets_n - 1); - gcli::FIssue* *e = &_db.ind_issue_buckets_elems[index]; - gcli::FIssue* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).issue == key; - if (done) break; - e = &ret->ind_issue_next; - } while (true); + gcli::FIssue *ret = _db.ind_issue_buckets_elems[index]; + for (; ret && !((*ret).issue == key); ret = ret->ind_issue_next) { + } return ret; } @@ -2348,10 +2123,11 @@ gcli::FIssue& gcli::ind_issue_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_issue.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_issue_InsertMaybe(gcli::FIssue& row) { - ind_issue_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_issue_next == (gcli::FIssue*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.issue) & (_db.ind_issue_buckets_n - 1); + row.ind_issue_hashval = algo::Smallstr50_Hash(0, row.issue); + ind_issue_Reserve(1); + u32 index = row.ind_issue_hashval & (_db.ind_issue_buckets_n - 1); gcli::FIssue* *prev = &_db.ind_issue_buckets_elems[index]; do { gcli::FIssue* ret = *prev; @@ -2377,7 +2153,7 @@ bool gcli::ind_issue_InsertMaybe(gcli::FIssue& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_issue_Remove(gcli::FIssue& row) { if (LIKELY(row.ind_issue_next != (gcli::FIssue*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.issue) & (_db.ind_issue_buckets_n - 1); + u32 index = row.ind_issue_hashval & (_db.ind_issue_buckets_n - 1); gcli::FIssue* *prev = &_db.ind_issue_buckets_elems[index]; // addr of pointer to current element while (gcli::FIssue *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2394,8 +2170,14 @@ void gcli::ind_issue_Remove(gcli::FIssue& row) { // --- gcli.FDb.ind_issue.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_issue_Reserve(int n) { + ind_issue_AbsReserve(_db.ind_issue_n + n); +} + +// --- gcli.FDb.ind_issue.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_issue_AbsReserve(int n) { u32 old_nbuckets = _db.ind_issue_buckets_n; - u32 new_nelems = _db.ind_issue_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2414,7 +2196,7 @@ void gcli::ind_issue_Reserve(int n) { while (elem) { gcli::FIssue &row = *elem; gcli::FIssue* next = row.ind_issue_next; - u32 index = algo::Smallstr50_Hash(0, row.issue) & (new_nbuckets-1); + u32 index = row.ind_issue_hashval & (new_nbuckets-1); row.ind_issue_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2437,14 +2219,9 @@ void gcli::regx_repo_Print(algo::cstring &out) { // Find row by key. Return NULL if not found. gcli::FGstatet* gcli::ind_gstatet_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_gstatet_buckets_n - 1); - gcli::FGstatet* *e = &_db.ind_gstatet_buckets_elems[index]; - gcli::FGstatet* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gstatet == key; - if (done) break; - e = &ret->ind_gstatet_next; - } while (true); + gcli::FGstatet *ret = _db.ind_gstatet_buckets_elems[index]; + for (; ret && !((*ret).gstatet == key); ret = ret->ind_gstatet_next) { + } return ret; } @@ -2476,10 +2253,11 @@ gcli::FGstatet& gcli::ind_gstatet_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gstatet.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gstatet_InsertMaybe(gcli::FGstatet& row) { - ind_gstatet_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gstatet_next == (gcli::FGstatet*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gstatet) & (_db.ind_gstatet_buckets_n - 1); + row.ind_gstatet_hashval = algo::Smallstr50_Hash(0, row.gstatet); + ind_gstatet_Reserve(1); + u32 index = row.ind_gstatet_hashval & (_db.ind_gstatet_buckets_n - 1); gcli::FGstatet* *prev = &_db.ind_gstatet_buckets_elems[index]; do { gcli::FGstatet* ret = *prev; @@ -2505,7 +2283,7 @@ bool gcli::ind_gstatet_InsertMaybe(gcli::FGstatet& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gstatet_Remove(gcli::FGstatet& row) { if (LIKELY(row.ind_gstatet_next != (gcli::FGstatet*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gstatet) & (_db.ind_gstatet_buckets_n - 1); + u32 index = row.ind_gstatet_hashval & (_db.ind_gstatet_buckets_n - 1); gcli::FGstatet* *prev = &_db.ind_gstatet_buckets_elems[index]; // addr of pointer to current element while (gcli::FGstatet *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2522,8 +2300,14 @@ void gcli::ind_gstatet_Remove(gcli::FGstatet& row) { // --- gcli.FDb.ind_gstatet.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gstatet_Reserve(int n) { + ind_gstatet_AbsReserve(_db.ind_gstatet_n + n); +} + +// --- gcli.FDb.ind_gstatet.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gstatet_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gstatet_buckets_n; - u32 new_nelems = _db.ind_gstatet_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2542,7 +2326,7 @@ void gcli::ind_gstatet_Reserve(int n) { while (elem) { gcli::FGstatet &row = *elem; gcli::FGstatet* next = row.ind_gstatet_next; - u32 index = algo::Smallstr50_Hash(0, row.gstatet) & (new_nbuckets-1); + u32 index = row.ind_gstatet_hashval & (new_nbuckets-1); row.ind_gstatet_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2559,14 +2343,9 @@ void gcli::ind_gstatet_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FGithost* gcli::ind_githost_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_githost_buckets_n - 1); - gcli::FGithost* *e = &_db.ind_githost_buckets_elems[index]; - gcli::FGithost* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).githost == key; - if (done) break; - e = &ret->ind_githost_next; - } while (true); + gcli::FGithost *ret = _db.ind_githost_buckets_elems[index]; + for (; ret && !((*ret).githost == key); ret = ret->ind_githost_next) { + } return ret; } @@ -2598,10 +2377,11 @@ gcli::FGithost& gcli::ind_githost_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_githost.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_githost_InsertMaybe(gcli::FGithost& row) { - ind_githost_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_githost_next == (gcli::FGithost*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.githost) & (_db.ind_githost_buckets_n - 1); + row.ind_githost_hashval = algo::Smallstr250_Hash(0, row.githost); + ind_githost_Reserve(1); + u32 index = row.ind_githost_hashval & (_db.ind_githost_buckets_n - 1); gcli::FGithost* *prev = &_db.ind_githost_buckets_elems[index]; do { gcli::FGithost* ret = *prev; @@ -2627,7 +2407,7 @@ bool gcli::ind_githost_InsertMaybe(gcli::FGithost& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_githost_Remove(gcli::FGithost& row) { if (LIKELY(row.ind_githost_next != (gcli::FGithost*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.githost) & (_db.ind_githost_buckets_n - 1); + u32 index = row.ind_githost_hashval & (_db.ind_githost_buckets_n - 1); gcli::FGithost* *prev = &_db.ind_githost_buckets_elems[index]; // addr of pointer to current element while (gcli::FGithost *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2644,8 +2424,14 @@ void gcli::ind_githost_Remove(gcli::FGithost& row) { // --- gcli.FDb.ind_githost.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_githost_Reserve(int n) { + ind_githost_AbsReserve(_db.ind_githost_n + n); +} + +// --- gcli.FDb.ind_githost.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_githost_AbsReserve(int n) { u32 old_nbuckets = _db.ind_githost_buckets_n; - u32 new_nelems = _db.ind_githost_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2664,7 +2450,7 @@ void gcli::ind_githost_Reserve(int n) { while (elem) { gcli::FGithost &row = *elem; gcli::FGithost* next = row.ind_githost_next; - u32 index = algo::Smallstr250_Hash(0, row.githost) & (new_nbuckets-1); + u32 index = row.ind_githost_hashval & (new_nbuckets-1); row.ind_githost_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2677,262 +2463,13 @@ void gcli::ind_githost_Reserve(int n) { } } -// --- gcli.FDb.ind_grepogitport.Find -// Find row by key. Return NULL if not found. -gcli::FGrepogitport* gcli::ind_grepogitport_Find(const algo::strptr& key) { - u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_grepogitport_buckets_n - 1); - gcli::FGrepogitport* *e = &_db.ind_grepogitport_buckets_elems[index]; - gcli::FGrepogitport* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).grepogitport == key; - if (done) break; - e = &ret->ind_grepogitport_next; - } while (true); - return ret; -} - -// --- gcli.FDb.ind_grepogitport.FindX -// Look up row by key and return reference. Throw exception if not found -gcli::FGrepogitport& gcli::ind_grepogitport_FindX(const algo::strptr& key) { - gcli::FGrepogitport* ret = ind_grepogitport_Find(key); - vrfy(ret, tempstr() << "gcli.key_error table:ind_grepogitport key:'"<ind_grepogitport_next; - } while (true); - if (retval) { - row.ind_grepogitport_next = *prev; - _db.ind_grepogitport_n++; - *prev = &row; - } - } - return retval; -} - -// --- gcli.FDb.ind_grepogitport.Remove -// Remove reference to element from hash index. If element is not in hash, do nothing -void gcli::ind_grepogitport_Remove(gcli::FGrepogitport& row) { - if (LIKELY(row.ind_grepogitport_next != (gcli::FGrepogitport*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.grepogitport) & (_db.ind_grepogitport_buckets_n - 1); - gcli::FGrepogitport* *prev = &_db.ind_grepogitport_buckets_elems[index]; // addr of pointer to current element - while (gcli::FGrepogitport *next = *prev) { // scan the collision chain for our element - if (next == &row) { // found it? - *prev = next->ind_grepogitport_next; // unlink (singly linked list) - _db.ind_grepogitport_n--; - row.ind_grepogitport_next = (gcli::FGrepogitport*)-1;// not-in-hash - break; - } - prev = &next->ind_grepogitport_next; - } - } -} - -// --- gcli.FDb.ind_grepogitport.Reserve -// Reserve enough room in the hash for N more elements. Return success code. -void gcli::ind_grepogitport_Reserve(int n) { - u32 old_nbuckets = _db.ind_grepogitport_buckets_n; - u32 new_nelems = _db.ind_grepogitport_n + n; - // # of elements has to be roughly equal to the number of buckets - if (new_nelems > old_nbuckets) { - int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); - u32 old_size = old_nbuckets * sizeof(gcli::FGrepogitport*); - u32 new_size = new_nbuckets * sizeof(gcli::FGrepogitport*); - // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably - // means new memory will have to be allocated anyway - gcli::FGrepogitport* *new_buckets = (gcli::FGrepogitport**)algo_lib::malloc_AllocMem(new_size); - if (UNLIKELY(!new_buckets)) { - FatalErrorExit("gcli.out_of_memory field:gcli.FDb.ind_grepogitport"); - } - memset(new_buckets, 0, new_size); // clear pointers - // rehash all entries - for (int i = 0; i < _db.ind_grepogitport_buckets_n; i++) { - gcli::FGrepogitport* elem = _db.ind_grepogitport_buckets_elems[i]; - while (elem) { - gcli::FGrepogitport &row = *elem; - gcli::FGrepogitport* next = row.ind_grepogitport_next; - u32 index = algo::Smallstr50_Hash(0, row.grepogitport) & (new_nbuckets-1); - row.ind_grepogitport_next = new_buckets[index]; - new_buckets[index] = &row; - elem = next; - } - } - // free old array - algo_lib::malloc_FreeMem(_db.ind_grepogitport_buckets_elems, old_size); - _db.ind_grepogitport_buckets_elems = new_buckets; - _db.ind_grepogitport_buckets_n = new_nbuckets; - } -} - -// --- gcli.FDb.ind_grepossh.Find -// Find row by key. Return NULL if not found. -gcli::FGrepossh* gcli::ind_grepossh_Find(const algo::strptr& key) { - u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_grepossh_buckets_n - 1); - gcli::FGrepossh* *e = &_db.ind_grepossh_buckets_elems[index]; - gcli::FGrepossh* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).grepossh == key; - if (done) break; - e = &ret->ind_grepossh_next; - } while (true); - return ret; -} - -// --- gcli.FDb.ind_grepossh.FindX -// Look up row by key and return reference. Throw exception if not found -gcli::FGrepossh& gcli::ind_grepossh_FindX(const algo::strptr& key) { - gcli::FGrepossh* ret = ind_grepossh_Find(key); - vrfy(ret, tempstr() << "gcli.key_error table:ind_grepossh key:'"<ind_grepossh_next; - } while (true); - if (retval) { - row.ind_grepossh_next = *prev; - _db.ind_grepossh_n++; - *prev = &row; - } - } - return retval; -} - -// --- gcli.FDb.ind_grepossh.Remove -// Remove reference to element from hash index. If element is not in hash, do nothing -void gcli::ind_grepossh_Remove(gcli::FGrepossh& row) { - if (LIKELY(row.ind_grepossh_next != (gcli::FGrepossh*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.grepossh) & (_db.ind_grepossh_buckets_n - 1); - gcli::FGrepossh* *prev = &_db.ind_grepossh_buckets_elems[index]; // addr of pointer to current element - while (gcli::FGrepossh *next = *prev) { // scan the collision chain for our element - if (next == &row) { // found it? - *prev = next->ind_grepossh_next; // unlink (singly linked list) - _db.ind_grepossh_n--; - row.ind_grepossh_next = (gcli::FGrepossh*)-1;// not-in-hash - break; - } - prev = &next->ind_grepossh_next; - } - } -} - -// --- gcli.FDb.ind_grepossh.Reserve -// Reserve enough room in the hash for N more elements. Return success code. -void gcli::ind_grepossh_Reserve(int n) { - u32 old_nbuckets = _db.ind_grepossh_buckets_n; - u32 new_nelems = _db.ind_grepossh_n + n; - // # of elements has to be roughly equal to the number of buckets - if (new_nelems > old_nbuckets) { - int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); - u32 old_size = old_nbuckets * sizeof(gcli::FGrepossh*); - u32 new_size = new_nbuckets * sizeof(gcli::FGrepossh*); - // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably - // means new memory will have to be allocated anyway - gcli::FGrepossh* *new_buckets = (gcli::FGrepossh**)algo_lib::malloc_AllocMem(new_size); - if (UNLIKELY(!new_buckets)) { - FatalErrorExit("gcli.out_of_memory field:gcli.FDb.ind_grepossh"); - } - memset(new_buckets, 0, new_size); // clear pointers - // rehash all entries - for (int i = 0; i < _db.ind_grepossh_buckets_n; i++) { - gcli::FGrepossh* elem = _db.ind_grepossh_buckets_elems[i]; - while (elem) { - gcli::FGrepossh &row = *elem; - gcli::FGrepossh* next = row.ind_grepossh_next; - u32 index = algo::Smallstr50_Hash(0, row.grepossh) & (new_nbuckets-1); - row.ind_grepossh_next = new_buckets[index]; - new_buckets[index] = &row; - elem = next; - } - } - // free old array - algo_lib::malloc_FreeMem(_db.ind_grepossh_buckets_elems, old_size); - _db.ind_grepossh_buckets_elems = new_buckets; - _db.ind_grepossh_buckets_n = new_nbuckets; - } -} - // --- gcli.FDb.ind_gtype.Find // Find row by key. Return NULL if not found. gcli::FGtype* gcli::ind_gtype_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_gtype_buckets_n - 1); - gcli::FGtype* *e = &_db.ind_gtype_buckets_elems[index]; - gcli::FGtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gtype == key; - if (done) break; - e = &ret->ind_gtype_next; - } while (true); + gcli::FGtype *ret = _db.ind_gtype_buckets_elems[index]; + for (; ret && !((*ret).gtype == key); ret = ret->ind_gtype_next) { + } return ret; } @@ -2964,10 +2501,11 @@ gcli::FGtype& gcli::ind_gtype_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gtype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gtype_InsertMaybe(gcli::FGtype& row) { - ind_gtype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gtype_next == (gcli::FGtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gtype) & (_db.ind_gtype_buckets_n - 1); + row.ind_gtype_hashval = algo::Smallstr50_Hash(0, row.gtype); + ind_gtype_Reserve(1); + u32 index = row.ind_gtype_hashval & (_db.ind_gtype_buckets_n - 1); gcli::FGtype* *prev = &_db.ind_gtype_buckets_elems[index]; do { gcli::FGtype* ret = *prev; @@ -2993,7 +2531,7 @@ bool gcli::ind_gtype_InsertMaybe(gcli::FGtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gtype_Remove(gcli::FGtype& row) { if (LIKELY(row.ind_gtype_next != (gcli::FGtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gtype) & (_db.ind_gtype_buckets_n - 1); + u32 index = row.ind_gtype_hashval & (_db.ind_gtype_buckets_n - 1); gcli::FGtype* *prev = &_db.ind_gtype_buckets_elems[index]; // addr of pointer to current element while (gcli::FGtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3010,8 +2548,14 @@ void gcli::ind_gtype_Remove(gcli::FGtype& row) { // --- gcli.FDb.ind_gtype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gtype_Reserve(int n) { + ind_gtype_AbsReserve(_db.ind_gtype_n + n); +} + +// --- gcli.FDb.ind_gtype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gtype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gtype_buckets_n; - u32 new_nelems = _db.ind_gtype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3030,7 +2574,7 @@ void gcli::ind_gtype_Reserve(int n) { while (elem) { gcli::FGtype &row = *elem; gcli::FGtype* next = row.ind_gtype_next; - u32 index = algo::Smallstr50_Hash(0, row.gtype) & (new_nbuckets-1); + u32 index = row.ind_gtype_hashval & (new_nbuckets-1); row.ind_gtype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3047,15 +2591,11 @@ void gcli::ind_gtype_Reserve(int n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_gclicmd_Insert(gcli::FGclicmd& row) { - if (bool_Update(row._db_c_gclicmd_in_ary,true)) { - // reserve space + if (!row.c_gclicmd_in_ary) { c_gclicmd_Reserve(1); - u32 n = _db.c_gclicmd_n; - u32 at = n; - gcli::FGclicmd* *elems = _db.c_gclicmd_elems; - elems[at] = &row; - _db.c_gclicmd_n = n+1; - + u32 n = _db.c_gclicmd_n++; + _db.c_gclicmd_elems[n] = &row; + row.c_gclicmd_in_ary = true; } } @@ -3064,7 +2604,7 @@ void gcli::c_gclicmd_Insert(gcli::FGclicmd& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_gclicmd_InsertMaybe(gcli::FGclicmd& row) { - bool retval = !row._db_c_gclicmd_in_ary; + bool retval = !c_gclicmd_InAryQ(row); c_gclicmd_Insert(row); // check is performed in _Insert again return retval; } @@ -3072,18 +2612,18 @@ bool gcli::c_gclicmd_InsertMaybe(gcli::FGclicmd& row) { // --- gcli.FDb.c_gclicmd.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_gclicmd_Remove(gcli::FGclicmd& row) { - if (bool_Update(row._db_c_gclicmd_in_ary,false)) { - int lim = _db.c_gclicmd_n; + int n = _db.c_gclicmd_n; + if (bool_Update(row.c_gclicmd_in_ary,false)) { gcli::FGclicmd* *elems = _db.c_gclicmd_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FGclicmd* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FGclicmd*) * (lim - j); + size_t nbytes = sizeof(gcli::FGclicmd*) * (n - j); memmove(elems + i, elems + j, nbytes); - _db.c_gclicmd_n = lim - 1; + _db.c_gclicmd_n = n - 1; break; } } @@ -3369,14 +2909,9 @@ bool gcli::gclicmdarg_XrefMaybe(gcli::FGclicmdarg &row) { // Find row by key. Return NULL if not found. gcli::FGclicmdj2f* gcli::ind_gclicmdj2f_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_gclicmdj2f_buckets_n - 1); - gcli::FGclicmdj2f* *e = &_db.ind_gclicmdj2f_buckets_elems[index]; - gcli::FGclicmdj2f* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gclicmdj2f == key; - if (done) break; - e = &ret->ind_gclicmdj2f_next; - } while (true); + gcli::FGclicmdj2f *ret = _db.ind_gclicmdj2f_buckets_elems[index]; + for (; ret && !((*ret).gclicmdj2f == key); ret = ret->ind_gclicmdj2f_next) { + } return ret; } @@ -3408,10 +2943,11 @@ gcli::FGclicmdj2f& gcli::ind_gclicmdj2f_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gclicmdj2f.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gclicmdj2f_InsertMaybe(gcli::FGclicmdj2f& row) { - ind_gclicmdj2f_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gclicmdj2f_next == (gcli::FGclicmdj2f*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmdj2f) & (_db.ind_gclicmdj2f_buckets_n - 1); + row.ind_gclicmdj2f_hashval = algo::Smallstr250_Hash(0, row.gclicmdj2f); + ind_gclicmdj2f_Reserve(1); + u32 index = row.ind_gclicmdj2f_hashval & (_db.ind_gclicmdj2f_buckets_n - 1); gcli::FGclicmdj2f* *prev = &_db.ind_gclicmdj2f_buckets_elems[index]; do { gcli::FGclicmdj2f* ret = *prev; @@ -3437,7 +2973,7 @@ bool gcli::ind_gclicmdj2f_InsertMaybe(gcli::FGclicmdj2f& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gclicmdj2f_Remove(gcli::FGclicmdj2f& row) { if (LIKELY(row.ind_gclicmdj2f_next != (gcli::FGclicmdj2f*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmdj2f) & (_db.ind_gclicmdj2f_buckets_n - 1); + u32 index = row.ind_gclicmdj2f_hashval & (_db.ind_gclicmdj2f_buckets_n - 1); gcli::FGclicmdj2f* *prev = &_db.ind_gclicmdj2f_buckets_elems[index]; // addr of pointer to current element while (gcli::FGclicmdj2f *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3454,8 +2990,14 @@ void gcli::ind_gclicmdj2f_Remove(gcli::FGclicmdj2f& row) { // --- gcli.FDb.ind_gclicmdj2f.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gclicmdj2f_Reserve(int n) { + ind_gclicmdj2f_AbsReserve(_db.ind_gclicmdj2f_n + n); +} + +// --- gcli.FDb.ind_gclicmdj2f.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gclicmdj2f_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gclicmdj2f_buckets_n; - u32 new_nelems = _db.ind_gclicmdj2f_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3474,7 +3016,7 @@ void gcli::ind_gclicmdj2f_Reserve(int n) { while (elem) { gcli::FGclicmdj2f &row = *elem; gcli::FGclicmdj2f* next = row.ind_gclicmdj2f_next; - u32 index = algo::Smallstr250_Hash(0, row.gclicmdj2f) & (new_nbuckets-1); + u32 index = row.ind_gclicmdj2f_hashval & (new_nbuckets-1); row.ind_gclicmdj2f_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3491,14 +3033,9 @@ void gcli::ind_gclicmdj2f_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FGclicmdarg* gcli::ind_gclicmdarg_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_gclicmdarg_buckets_n - 1); - gcli::FGclicmdarg* *e = &_db.ind_gclicmdarg_buckets_elems[index]; - gcli::FGclicmdarg* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gclicmdarg == key; - if (done) break; - e = &ret->ind_gclicmdarg_next; - } while (true); + gcli::FGclicmdarg *ret = _db.ind_gclicmdarg_buckets_elems[index]; + for (; ret && !((*ret).gclicmdarg == key); ret = ret->ind_gclicmdarg_next) { + } return ret; } @@ -3530,10 +3067,11 @@ gcli::FGclicmdarg& gcli::ind_gclicmdarg_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gclicmdarg.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gclicmdarg_InsertMaybe(gcli::FGclicmdarg& row) { - ind_gclicmdarg_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gclicmdarg_next == (gcli::FGclicmdarg*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmdarg) & (_db.ind_gclicmdarg_buckets_n - 1); + row.ind_gclicmdarg_hashval = algo::Smallstr250_Hash(0, row.gclicmdarg); + ind_gclicmdarg_Reserve(1); + u32 index = row.ind_gclicmdarg_hashval & (_db.ind_gclicmdarg_buckets_n - 1); gcli::FGclicmdarg* *prev = &_db.ind_gclicmdarg_buckets_elems[index]; do { gcli::FGclicmdarg* ret = *prev; @@ -3559,7 +3097,7 @@ bool gcli::ind_gclicmdarg_InsertMaybe(gcli::FGclicmdarg& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gclicmdarg_Remove(gcli::FGclicmdarg& row) { if (LIKELY(row.ind_gclicmdarg_next != (gcli::FGclicmdarg*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmdarg) & (_db.ind_gclicmdarg_buckets_n - 1); + u32 index = row.ind_gclicmdarg_hashval & (_db.ind_gclicmdarg_buckets_n - 1); gcli::FGclicmdarg* *prev = &_db.ind_gclicmdarg_buckets_elems[index]; // addr of pointer to current element while (gcli::FGclicmdarg *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3576,8 +3114,14 @@ void gcli::ind_gclicmdarg_Remove(gcli::FGclicmdarg& row) { // --- gcli.FDb.ind_gclicmdarg.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gclicmdarg_Reserve(int n) { + ind_gclicmdarg_AbsReserve(_db.ind_gclicmdarg_n + n); +} + +// --- gcli.FDb.ind_gclicmdarg.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gclicmdarg_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gclicmdarg_buckets_n; - u32 new_nelems = _db.ind_gclicmdarg_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3596,7 +3140,7 @@ void gcli::ind_gclicmdarg_Reserve(int n) { while (elem) { gcli::FGclicmdarg &row = *elem; gcli::FGclicmdarg* next = row.ind_gclicmdarg_next; - u32 index = algo::Smallstr250_Hash(0, row.gclicmdarg) & (new_nbuckets-1); + u32 index = row.ind_gclicmdarg_hashval & (new_nbuckets-1); row.ind_gclicmdarg_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3613,14 +3157,9 @@ void gcli::ind_gclicmdarg_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FGclicmdc* gcli::ind_gclicmdc_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_gclicmdc_buckets_n - 1); - gcli::FGclicmdc* *e = &_db.ind_gclicmdc_buckets_elems[index]; - gcli::FGclicmdc* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gclicmdc == key; - if (done) break; - e = &ret->ind_gclicmdc_next; - } while (true); + gcli::FGclicmdc *ret = _db.ind_gclicmdc_buckets_elems[index]; + for (; ret && !((*ret).gclicmdc == key); ret = ret->ind_gclicmdc_next) { + } return ret; } @@ -3652,10 +3191,11 @@ gcli::FGclicmdc& gcli::ind_gclicmdc_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gclicmdc.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gclicmdc_InsertMaybe(gcli::FGclicmdc& row) { - ind_gclicmdc_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gclicmdc_next == (gcli::FGclicmdc*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmdc) & (_db.ind_gclicmdc_buckets_n - 1); + row.ind_gclicmdc_hashval = algo::Smallstr250_Hash(0, row.gclicmdc); + ind_gclicmdc_Reserve(1); + u32 index = row.ind_gclicmdc_hashval & (_db.ind_gclicmdc_buckets_n - 1); gcli::FGclicmdc* *prev = &_db.ind_gclicmdc_buckets_elems[index]; do { gcli::FGclicmdc* ret = *prev; @@ -3681,7 +3221,7 @@ bool gcli::ind_gclicmdc_InsertMaybe(gcli::FGclicmdc& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gclicmdc_Remove(gcli::FGclicmdc& row) { if (LIKELY(row.ind_gclicmdc_next != (gcli::FGclicmdc*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gclicmdc) & (_db.ind_gclicmdc_buckets_n - 1); + u32 index = row.ind_gclicmdc_hashval & (_db.ind_gclicmdc_buckets_n - 1); gcli::FGclicmdc* *prev = &_db.ind_gclicmdc_buckets_elems[index]; // addr of pointer to current element while (gcli::FGclicmdc *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -3698,8 +3238,14 @@ void gcli::ind_gclicmdc_Remove(gcli::FGclicmdc& row) { // --- gcli.FDb.ind_gclicmdc.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gclicmdc_Reserve(int n) { + ind_gclicmdc_AbsReserve(_db.ind_gclicmdc_n + n); +} + +// --- gcli.FDb.ind_gclicmdc.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gclicmdc_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gclicmdc_buckets_n; - u32 new_nelems = _db.ind_gclicmdc_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -3718,7 +3264,7 @@ void gcli::ind_gclicmdc_Reserve(int n) { while (elem) { gcli::FGclicmdc &row = *elem; gcli::FGclicmdc* next = row.ind_gclicmdc_next; - u32 index = algo::Smallstr250_Hash(0, row.gclicmdc) & (new_nbuckets-1); + u32 index = row.ind_gclicmdc_hashval & (new_nbuckets-1); row.ind_gclicmdc_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4346,14 +3892,9 @@ bool gcli::mrnote_XrefMaybe(gcli::FMrnote &row) { // Find row by key. Return NULL if not found. gcli::FMrnote* gcli::ind_mrnote_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_mrnote_buckets_n - 1); - gcli::FMrnote* *e = &_db.ind_mrnote_buckets_elems[index]; - gcli::FMrnote* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).mrnote == key; - if (done) break; - e = &ret->ind_mrnote_next; - } while (true); + gcli::FMrnote *ret = _db.ind_mrnote_buckets_elems[index]; + for (; ret && !((*ret).mrnote == key); ret = ret->ind_mrnote_next) { + } return ret; } @@ -4368,10 +3909,11 @@ gcli::FMrnote& gcli::ind_mrnote_FindX(const algo::strptr& key) { // --- gcli.FDb.ind_mrnote.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_mrnote_InsertMaybe(gcli::FMrnote& row) { - ind_mrnote_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_mrnote_next == (gcli::FMrnote*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.mrnote) & (_db.ind_mrnote_buckets_n - 1); + row.ind_mrnote_hashval = algo::Smallstr250_Hash(0, row.mrnote); + ind_mrnote_Reserve(1); + u32 index = row.ind_mrnote_hashval & (_db.ind_mrnote_buckets_n - 1); gcli::FMrnote* *prev = &_db.ind_mrnote_buckets_elems[index]; do { gcli::FMrnote* ret = *prev; @@ -4397,7 +3939,7 @@ bool gcli::ind_mrnote_InsertMaybe(gcli::FMrnote& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_mrnote_Remove(gcli::FMrnote& row) { if (LIKELY(row.ind_mrnote_next != (gcli::FMrnote*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.mrnote) & (_db.ind_mrnote_buckets_n - 1); + u32 index = row.ind_mrnote_hashval & (_db.ind_mrnote_buckets_n - 1); gcli::FMrnote* *prev = &_db.ind_mrnote_buckets_elems[index]; // addr of pointer to current element while (gcli::FMrnote *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4414,8 +3956,14 @@ void gcli::ind_mrnote_Remove(gcli::FMrnote& row) { // --- gcli.FDb.ind_mrnote.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_mrnote_Reserve(int n) { + ind_mrnote_AbsReserve(_db.ind_mrnote_n + n); +} + +// --- gcli.FDb.ind_mrnote.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_mrnote_AbsReserve(int n) { u32 old_nbuckets = _db.ind_mrnote_buckets_n; - u32 new_nelems = _db.ind_mrnote_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4434,7 +3982,7 @@ void gcli::ind_mrnote_Reserve(int n) { while (elem) { gcli::FMrnote &row = *elem; gcli::FMrnote* next = row.ind_mrnote_next; - u32 index = algo::Smallstr250_Hash(0, row.mrnote) & (new_nbuckets-1); + u32 index = row.ind_mrnote_hashval & (new_nbuckets-1); row.ind_mrnote_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4451,14 +3999,9 @@ void gcli::ind_mrnote_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FIssuenote* gcli::ind_issuenote_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_issuenote_buckets_n - 1); - gcli::FIssuenote* *e = &_db.ind_issuenote_buckets_elems[index]; - gcli::FIssuenote* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).issuenote == key; - if (done) break; - e = &ret->ind_issuenote_next; - } while (true); + gcli::FIssuenote *ret = _db.ind_issuenote_buckets_elems[index]; + for (; ret && !((*ret).issuenote == key); ret = ret->ind_issuenote_next) { + } return ret; } @@ -4473,10 +4016,11 @@ gcli::FIssuenote& gcli::ind_issuenote_FindX(const algo::strptr& key) { // --- gcli.FDb.ind_issuenote.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_issuenote_InsertMaybe(gcli::FIssuenote& row) { - ind_issuenote_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_issuenote_next == (gcli::FIssuenote*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.issuenote) & (_db.ind_issuenote_buckets_n - 1); + row.ind_issuenote_hashval = algo::Smallstr250_Hash(0, row.issuenote); + ind_issuenote_Reserve(1); + u32 index = row.ind_issuenote_hashval & (_db.ind_issuenote_buckets_n - 1); gcli::FIssuenote* *prev = &_db.ind_issuenote_buckets_elems[index]; do { gcli::FIssuenote* ret = *prev; @@ -4502,7 +4046,7 @@ bool gcli::ind_issuenote_InsertMaybe(gcli::FIssuenote& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_issuenote_Remove(gcli::FIssuenote& row) { if (LIKELY(row.ind_issuenote_next != (gcli::FIssuenote*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.issuenote) & (_db.ind_issuenote_buckets_n - 1); + u32 index = row.ind_issuenote_hashval & (_db.ind_issuenote_buckets_n - 1); gcli::FIssuenote* *prev = &_db.ind_issuenote_buckets_elems[index]; // addr of pointer to current element while (gcli::FIssuenote *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4519,8 +4063,14 @@ void gcli::ind_issuenote_Remove(gcli::FIssuenote& row) { // --- gcli.FDb.ind_issuenote.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_issuenote_Reserve(int n) { + ind_issuenote_AbsReserve(_db.ind_issuenote_n + n); +} + +// --- gcli.FDb.ind_issuenote.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_issuenote_AbsReserve(int n) { u32 old_nbuckets = _db.ind_issuenote_buckets_n; - u32 new_nelems = _db.ind_issuenote_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4539,7 +4089,7 @@ void gcli::ind_issuenote_Reserve(int n) { while (elem) { gcli::FIssuenote &row = *elem; gcli::FIssuenote* next = row.ind_issuenote_next; - u32 index = algo::Smallstr250_Hash(0, row.issuenote) & (new_nbuckets-1); + u32 index = row.ind_issuenote_hashval & (new_nbuckets-1); row.ind_issuenote_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4556,14 +4106,9 @@ void gcli::ind_issuenote_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FMrjob* gcli::ind_mrjob_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_mrjob_buckets_n - 1); - gcli::FMrjob* *e = &_db.ind_mrjob_buckets_elems[index]; - gcli::FMrjob* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).mrjob == key; - if (done) break; - e = &ret->ind_mrjob_next; - } while (true); + gcli::FMrjob *ret = _db.ind_mrjob_buckets_elems[index]; + for (; ret && !((*ret).mrjob == key); ret = ret->ind_mrjob_next) { + } return ret; } @@ -4578,10 +4123,11 @@ gcli::FMrjob& gcli::ind_mrjob_FindX(const algo::strptr& key) { // --- gcli.FDb.ind_mrjob.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_mrjob_InsertMaybe(gcli::FMrjob& row) { - ind_mrjob_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_mrjob_next == (gcli::FMrjob*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.mrjob) & (_db.ind_mrjob_buckets_n - 1); + row.ind_mrjob_hashval = algo::Smallstr250_Hash(0, row.mrjob); + ind_mrjob_Reserve(1); + u32 index = row.ind_mrjob_hashval & (_db.ind_mrjob_buckets_n - 1); gcli::FMrjob* *prev = &_db.ind_mrjob_buckets_elems[index]; do { gcli::FMrjob* ret = *prev; @@ -4607,7 +4153,7 @@ bool gcli::ind_mrjob_InsertMaybe(gcli::FMrjob& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_mrjob_Remove(gcli::FMrjob& row) { if (LIKELY(row.ind_mrjob_next != (gcli::FMrjob*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.mrjob) & (_db.ind_mrjob_buckets_n - 1); + u32 index = row.ind_mrjob_hashval & (_db.ind_mrjob_buckets_n - 1); gcli::FMrjob* *prev = &_db.ind_mrjob_buckets_elems[index]; // addr of pointer to current element while (gcli::FMrjob *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4624,8 +4170,14 @@ void gcli::ind_mrjob_Remove(gcli::FMrjob& row) { // --- gcli.FDb.ind_mrjob.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_mrjob_Reserve(int n) { + ind_mrjob_AbsReserve(_db.ind_mrjob_n + n); +} + +// --- gcli.FDb.ind_mrjob.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_mrjob_AbsReserve(int n) { u32 old_nbuckets = _db.ind_mrjob_buckets_n; - u32 new_nelems = _db.ind_mrjob_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4644,7 +4196,7 @@ void gcli::ind_mrjob_Reserve(int n) { while (elem) { gcli::FMrjob &row = *elem; gcli::FMrjob* next = row.ind_mrjob_next; - u32 index = algo::Smallstr250_Hash(0, row.mrjob) & (new_nbuckets-1); + u32 index = row.ind_mrjob_hashval & (new_nbuckets-1); row.ind_mrjob_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4761,14 +4313,9 @@ bool gcli::user_XrefMaybe(gcli::FUser &row) { // Find row by key. Return NULL if not found. gcli::FUser* gcli::ind_user_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_user_buckets_n - 1); - gcli::FUser* *e = &_db.ind_user_buckets_elems[index]; - gcli::FUser* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).user == key; - if (done) break; - e = &ret->ind_user_next; - } while (true); + gcli::FUser *ret = _db.ind_user_buckets_elems[index]; + for (; ret && !((*ret).user == key); ret = ret->ind_user_next) { + } return ret; } @@ -4800,10 +4347,11 @@ gcli::FUser& gcli::ind_user_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_user.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_user_InsertMaybe(gcli::FUser& row) { - ind_user_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_user_next == (gcli::FUser*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.user) & (_db.ind_user_buckets_n - 1); + row.ind_user_hashval = algo::Smallstr50_Hash(0, row.user); + ind_user_Reserve(1); + u32 index = row.ind_user_hashval & (_db.ind_user_buckets_n - 1); gcli::FUser* *prev = &_db.ind_user_buckets_elems[index]; do { gcli::FUser* ret = *prev; @@ -4829,7 +4377,7 @@ bool gcli::ind_user_InsertMaybe(gcli::FUser& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_user_Remove(gcli::FUser& row) { if (LIKELY(row.ind_user_next != (gcli::FUser*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.user) & (_db.ind_user_buckets_n - 1); + u32 index = row.ind_user_hashval & (_db.ind_user_buckets_n - 1); gcli::FUser* *prev = &_db.ind_user_buckets_elems[index]; // addr of pointer to current element while (gcli::FUser *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4846,8 +4394,14 @@ void gcli::ind_user_Remove(gcli::FUser& row) { // --- gcli.FDb.ind_user.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_user_Reserve(int n) { + ind_user_AbsReserve(_db.ind_user_n + n); +} + +// --- gcli.FDb.ind_user.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_user_AbsReserve(int n) { u32 old_nbuckets = _db.ind_user_buckets_n; - u32 new_nelems = _db.ind_user_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4866,7 +4420,7 @@ void gcli::ind_user_Reserve(int n) { while (elem) { gcli::FUser &row = *elem; gcli::FUser* next = row.ind_user_next; - u32 index = algo::Smallstr50_Hash(0, row.user) & (new_nbuckets-1); + u32 index = row.ind_user_hashval & (new_nbuckets-1); row.ind_user_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -4883,14 +4437,9 @@ void gcli::ind_user_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FMr* gcli::ind_mr_Find(const algo::strptr& key) { u32 index = algo::Smallstr150_Hash(0, key) & (_db.ind_mr_buckets_n - 1); - gcli::FMr* *e = &_db.ind_mr_buckets_elems[index]; - gcli::FMr* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).mr == key; - if (done) break; - e = &ret->ind_mr_next; - } while (true); + gcli::FMr *ret = _db.ind_mr_buckets_elems[index]; + for (; ret && !((*ret).mr == key); ret = ret->ind_mr_next) { + } return ret; } @@ -4922,10 +4471,11 @@ gcli::FMr& gcli::ind_mr_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_mr.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_mr_InsertMaybe(gcli::FMr& row) { - ind_mr_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_mr_next == (gcli::FMr*)-1)) {// check if in hash already - u32 index = algo::Smallstr150_Hash(0, row.mr) & (_db.ind_mr_buckets_n - 1); + row.ind_mr_hashval = algo::Smallstr150_Hash(0, row.mr); + ind_mr_Reserve(1); + u32 index = row.ind_mr_hashval & (_db.ind_mr_buckets_n - 1); gcli::FMr* *prev = &_db.ind_mr_buckets_elems[index]; do { gcli::FMr* ret = *prev; @@ -4951,7 +4501,7 @@ bool gcli::ind_mr_InsertMaybe(gcli::FMr& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_mr_Remove(gcli::FMr& row) { if (LIKELY(row.ind_mr_next != (gcli::FMr*)-1)) {// check if in hash already - u32 index = algo::Smallstr150_Hash(0, row.mr) & (_db.ind_mr_buckets_n - 1); + u32 index = row.ind_mr_hashval & (_db.ind_mr_buckets_n - 1); gcli::FMr* *prev = &_db.ind_mr_buckets_elems[index]; // addr of pointer to current element while (gcli::FMr *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -4968,8 +4518,14 @@ void gcli::ind_mr_Remove(gcli::FMr& row) { // --- gcli.FDb.ind_mr.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_mr_Reserve(int n) { + ind_mr_AbsReserve(_db.ind_mr_n + n); +} + +// --- gcli.FDb.ind_mr.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_mr_AbsReserve(int n) { u32 old_nbuckets = _db.ind_mr_buckets_n; - u32 new_nelems = _db.ind_mr_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -4988,7 +4544,7 @@ void gcli::ind_mr_Reserve(int n) { while (elem) { gcli::FMr &row = *elem; gcli::FMr* next = row.ind_mr_next; - u32 index = algo::Smallstr150_Hash(0, row.mr) & (new_nbuckets-1); + u32 index = row.ind_mr_hashval & (new_nbuckets-1); row.ind_mr_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -5005,14 +4561,9 @@ void gcli::ind_mr_Reserve(int n) { // Find row by key. Return NULL if not found. gcli::FMilestone* gcli::ind_milestone_Find(const algo::strptr& key) { u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_milestone_buckets_n - 1); - gcli::FMilestone* *e = &_db.ind_milestone_buckets_elems[index]; - gcli::FMilestone* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).milestone == key; - if (done) break; - e = &ret->ind_milestone_next; - } while (true); + gcli::FMilestone *ret = _db.ind_milestone_buckets_elems[index]; + for (; ret && !((*ret).milestone == key); ret = ret->ind_milestone_next) { + } return ret; } @@ -5044,10 +4595,11 @@ gcli::FMilestone& gcli::ind_milestone_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_milestone.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_milestone_InsertMaybe(gcli::FMilestone& row) { - ind_milestone_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_milestone_next == (gcli::FMilestone*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.milestone) & (_db.ind_milestone_buckets_n - 1); + row.ind_milestone_hashval = algo::Smallstr200_Hash(0, row.milestone); + ind_milestone_Reserve(1); + u32 index = row.ind_milestone_hashval & (_db.ind_milestone_buckets_n - 1); gcli::FMilestone* *prev = &_db.ind_milestone_buckets_elems[index]; do { gcli::FMilestone* ret = *prev; @@ -5073,7 +4625,7 @@ bool gcli::ind_milestone_InsertMaybe(gcli::FMilestone& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_milestone_Remove(gcli::FMilestone& row) { if (LIKELY(row.ind_milestone_next != (gcli::FMilestone*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.milestone) & (_db.ind_milestone_buckets_n - 1); + u32 index = row.ind_milestone_hashval & (_db.ind_milestone_buckets_n - 1); gcli::FMilestone* *prev = &_db.ind_milestone_buckets_elems[index]; // addr of pointer to current element while (gcli::FMilestone *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -5090,8 +4642,14 @@ void gcli::ind_milestone_Remove(gcli::FMilestone& row) { // --- gcli.FDb.ind_milestone.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_milestone_Reserve(int n) { + ind_milestone_AbsReserve(_db.ind_milestone_n + n); +} + +// --- gcli.FDb.ind_milestone.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_milestone_AbsReserve(int n) { u32 old_nbuckets = _db.ind_milestone_buckets_n; - u32 new_nelems = _db.ind_milestone_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -5110,7 +4668,7 @@ void gcli::ind_milestone_Reserve(int n) { while (elem) { gcli::FMilestone &row = *elem; gcli::FMilestone* next = row.ind_milestone_next; - u32 index = algo::Smallstr200_Hash(0, row.milestone) & (new_nbuckets-1); + u32 index = row.ind_milestone_hashval & (new_nbuckets-1); row.ind_milestone_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -5717,14 +5275,9 @@ bool gcli::gtblactfld_XrefMaybe(gcli::FGtblactfld &row) { // Find row by key. Return NULL if not found. gcli::FGtblact* gcli::ind_gtblact_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_gtblact_buckets_n - 1); - gcli::FGtblact* *e = &_db.ind_gtblact_buckets_elems[index]; - gcli::FGtblact* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gtblact == key; - if (done) break; - e = &ret->ind_gtblact_next; - } while (true); + gcli::FGtblact *ret = _db.ind_gtblact_buckets_elems[index]; + for (; ret && !((*ret).gtblact == key); ret = ret->ind_gtblact_next) { + } return ret; } @@ -5756,10 +5309,11 @@ gcli::FGtblact& gcli::ind_gtblact_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gtblact.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gtblact_InsertMaybe(gcli::FGtblact& row) { - ind_gtblact_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gtblact_next == (gcli::FGtblact*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gtblact) & (_db.ind_gtblact_buckets_n - 1); + row.ind_gtblact_hashval = algo::Smallstr50_Hash(0, row.gtblact); + ind_gtblact_Reserve(1); + u32 index = row.ind_gtblact_hashval & (_db.ind_gtblact_buckets_n - 1); gcli::FGtblact* *prev = &_db.ind_gtblact_buckets_elems[index]; do { gcli::FGtblact* ret = *prev; @@ -5785,7 +5339,7 @@ bool gcli::ind_gtblact_InsertMaybe(gcli::FGtblact& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gtblact_Remove(gcli::FGtblact& row) { if (LIKELY(row.ind_gtblact_next != (gcli::FGtblact*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gtblact) & (_db.ind_gtblact_buckets_n - 1); + u32 index = row.ind_gtblact_hashval & (_db.ind_gtblact_buckets_n - 1); gcli::FGtblact* *prev = &_db.ind_gtblact_buckets_elems[index]; // addr of pointer to current element while (gcli::FGtblact *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -5802,8 +5356,14 @@ void gcli::ind_gtblact_Remove(gcli::FGtblact& row) { // --- gcli.FDb.ind_gtblact.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gtblact_Reserve(int n) { + ind_gtblact_AbsReserve(_db.ind_gtblact_n + n); +} + +// --- gcli.FDb.ind_gtblact.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gtblact_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gtblact_buckets_n; - u32 new_nelems = _db.ind_gtblact_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -5822,7 +5382,7 @@ void gcli::ind_gtblact_Reserve(int n) { while (elem) { gcli::FGtblact &row = *elem; gcli::FGtblact* next = row.ind_gtblact_next; - u32 index = algo::Smallstr50_Hash(0, row.gtblact) & (new_nbuckets-1); + u32 index = row.ind_gtblact_hashval & (new_nbuckets-1); row.ind_gtblact_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -5911,14 +5471,9 @@ gcli::FGtblact* gcli::zd_gtblact_RemoveFirst() { // Find row by key. Return NULL if not found. gcli::FGtblactfld* gcli::ind_gtblactfld_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_gtblactfld_buckets_n - 1); - gcli::FGtblactfld* *e = &_db.ind_gtblactfld_buckets_elems[index]; - gcli::FGtblactfld* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gtblactfld == key; - if (done) break; - e = &ret->ind_gtblactfld_next; - } while (true); + gcli::FGtblactfld *ret = _db.ind_gtblactfld_buckets_elems[index]; + for (; ret && !((*ret).gtblactfld == key); ret = ret->ind_gtblactfld_next) { + } return ret; } @@ -5933,10 +5488,11 @@ gcli::FGtblactfld& gcli::ind_gtblactfld_FindX(const algo::strptr& key) { // --- gcli.FDb.ind_gtblactfld.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gtblactfld_InsertMaybe(gcli::FGtblactfld& row) { - ind_gtblactfld_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gtblactfld_next == (gcli::FGtblactfld*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gtblactfld) & (_db.ind_gtblactfld_buckets_n - 1); + row.ind_gtblactfld_hashval = algo::Smallstr50_Hash(0, row.gtblactfld); + ind_gtblactfld_Reserve(1); + u32 index = row.ind_gtblactfld_hashval & (_db.ind_gtblactfld_buckets_n - 1); gcli::FGtblactfld* *prev = &_db.ind_gtblactfld_buckets_elems[index]; do { gcli::FGtblactfld* ret = *prev; @@ -5962,7 +5518,7 @@ bool gcli::ind_gtblactfld_InsertMaybe(gcli::FGtblactfld& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gtblactfld_Remove(gcli::FGtblactfld& row) { if (LIKELY(row.ind_gtblactfld_next != (gcli::FGtblactfld*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gtblactfld) & (_db.ind_gtblactfld_buckets_n - 1); + u32 index = row.ind_gtblactfld_hashval & (_db.ind_gtblactfld_buckets_n - 1); gcli::FGtblactfld* *prev = &_db.ind_gtblactfld_buckets_elems[index]; // addr of pointer to current element while (gcli::FGtblactfld *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -5979,8 +5535,14 @@ void gcli::ind_gtblactfld_Remove(gcli::FGtblactfld& row) { // --- gcli.FDb.ind_gtblactfld.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gtblactfld_Reserve(int n) { + ind_gtblactfld_AbsReserve(_db.ind_gtblactfld_n + n); +} + +// --- gcli.FDb.ind_gtblactfld.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gtblactfld_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gtblactfld_buckets_n; - u32 new_nelems = _db.ind_gtblactfld_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -5999,7 +5561,7 @@ void gcli::ind_gtblactfld_Reserve(int n) { while (elem) { gcli::FGtblactfld &row = *elem; gcli::FGtblactfld* next = row.ind_gtblactfld_next; - u32 index = algo::Smallstr50_Hash(0, row.gtblactfld) & (new_nbuckets-1); + u32 index = row.ind_gtblactfld_hashval & (new_nbuckets-1); row.ind_gtblactfld_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -6123,14 +5685,9 @@ bool gcli::gfld_XrefMaybe(gcli::FGfld &row) { // Find row by key. Return NULL if not found. gcli::FGfld* gcli::ind_gfld_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_gfld_buckets_n - 1); - gcli::FGfld* *e = &_db.ind_gfld_buckets_elems[index]; - gcli::FGfld* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gfld == key; - if (done) break; - e = &ret->ind_gfld_next; - } while (true); + gcli::FGfld *ret = _db.ind_gfld_buckets_elems[index]; + for (; ret && !((*ret).gfld == key); ret = ret->ind_gfld_next) { + } return ret; } @@ -6162,10 +5719,11 @@ gcli::FGfld& gcli::ind_gfld_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gfld.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gfld_InsertMaybe(gcli::FGfld& row) { - ind_gfld_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gfld_next == (gcli::FGfld*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gfld) & (_db.ind_gfld_buckets_n - 1); + row.ind_gfld_hashval = algo::Smallstr50_Hash(0, row.gfld); + ind_gfld_Reserve(1); + u32 index = row.ind_gfld_hashval & (_db.ind_gfld_buckets_n - 1); gcli::FGfld* *prev = &_db.ind_gfld_buckets_elems[index]; do { gcli::FGfld* ret = *prev; @@ -6191,7 +5749,7 @@ bool gcli::ind_gfld_InsertMaybe(gcli::FGfld& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gfld_Remove(gcli::FGfld& row) { if (LIKELY(row.ind_gfld_next != (gcli::FGfld*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gfld) & (_db.ind_gfld_buckets_n - 1); + u32 index = row.ind_gfld_hashval & (_db.ind_gfld_buckets_n - 1); gcli::FGfld* *prev = &_db.ind_gfld_buckets_elems[index]; // addr of pointer to current element while (gcli::FGfld *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -6208,8 +5766,14 @@ void gcli::ind_gfld_Remove(gcli::FGfld& row) { // --- gcli.FDb.ind_gfld.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gfld_Reserve(int n) { + ind_gfld_AbsReserve(_db.ind_gfld_n + n); +} + +// --- gcli.FDb.ind_gfld.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gfld_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gfld_buckets_n; - u32 new_nelems = _db.ind_gfld_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -6228,7 +5792,7 @@ void gcli::ind_gfld_Reserve(int n) { while (elem) { gcli::FGfld &row = *elem; gcli::FGfld* next = row.ind_gfld_next; - u32 index = algo::Smallstr50_Hash(0, row.gfld) & (new_nbuckets-1); + u32 index = row.ind_gfld_hashval & (new_nbuckets-1); row.ind_gfld_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -6245,15 +5809,11 @@ void gcli::ind_gfld_Reserve(int n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_gfld_Insert(gcli::FGfld& row) { - if (bool_Update(row._db_c_gfld_in_ary,true)) { - // reserve space + if (!row.c_gfld_in_ary) { c_gfld_Reserve(1); - u32 n = _db.c_gfld_n; - u32 at = n; - gcli::FGfld* *elems = _db.c_gfld_elems; - elems[at] = &row; - _db.c_gfld_n = n+1; - + u32 n = _db.c_gfld_n++; + _db.c_gfld_elems[n] = &row; + row.c_gfld_in_ary = true; } } @@ -6262,7 +5822,7 @@ void gcli::c_gfld_Insert(gcli::FGfld& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_gfld_InsertMaybe(gcli::FGfld& row) { - bool retval = !row._db_c_gfld_in_ary; + bool retval = !c_gfld_InAryQ(row); c_gfld_Insert(row); // check is performed in _Insert again return retval; } @@ -6270,18 +5830,18 @@ bool gcli::c_gfld_InsertMaybe(gcli::FGfld& row) { // --- gcli.FDb.c_gfld.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_gfld_Remove(gcli::FGfld& row) { - if (bool_Update(row._db_c_gfld_in_ary,false)) { - int lim = _db.c_gfld_n; + int n = _db.c_gfld_n; + if (bool_Update(row.c_gfld_in_ary,false)) { gcli::FGfld* *elems = _db.c_gfld_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FGfld* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FGfld*) * (lim - j); + size_t nbytes = sizeof(gcli::FGfld*) * (n - j); memmove(elems + i, elems + j, nbytes); - _db.c_gfld_n = lim - 1; + _db.c_gfld_n = n - 1; break; } } @@ -6416,14 +5976,9 @@ bool gcli::gtbl_XrefMaybe(gcli::FGtbl &row) { // Find row by key. Return NULL if not found. gcli::FGtbl* gcli::ind_gtbl_Find(const algo::strptr& key) { u32 index = algo::Smallstr250_Hash(0, key) & (_db.ind_gtbl_buckets_n - 1); - gcli::FGtbl* *e = &_db.ind_gtbl_buckets_elems[index]; - gcli::FGtbl* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gtbl == key; - if (done) break; - e = &ret->ind_gtbl_next; - } while (true); + gcli::FGtbl *ret = _db.ind_gtbl_buckets_elems[index]; + for (; ret && !((*ret).gtbl == key); ret = ret->ind_gtbl_next) { + } return ret; } @@ -6455,10 +6010,11 @@ gcli::FGtbl& gcli::ind_gtbl_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gtbl.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gtbl_InsertMaybe(gcli::FGtbl& row) { - ind_gtbl_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gtbl_next == (gcli::FGtbl*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gtbl) & (_db.ind_gtbl_buckets_n - 1); + row.ind_gtbl_hashval = algo::Smallstr250_Hash(0, row.gtbl); + ind_gtbl_Reserve(1); + u32 index = row.ind_gtbl_hashval & (_db.ind_gtbl_buckets_n - 1); gcli::FGtbl* *prev = &_db.ind_gtbl_buckets_elems[index]; do { gcli::FGtbl* ret = *prev; @@ -6484,7 +6040,7 @@ bool gcli::ind_gtbl_InsertMaybe(gcli::FGtbl& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gtbl_Remove(gcli::FGtbl& row) { if (LIKELY(row.ind_gtbl_next != (gcli::FGtbl*)-1)) {// check if in hash already - u32 index = algo::Smallstr250_Hash(0, row.gtbl) & (_db.ind_gtbl_buckets_n - 1); + u32 index = row.ind_gtbl_hashval & (_db.ind_gtbl_buckets_n - 1); gcli::FGtbl* *prev = &_db.ind_gtbl_buckets_elems[index]; // addr of pointer to current element while (gcli::FGtbl *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -6501,8 +6057,14 @@ void gcli::ind_gtbl_Remove(gcli::FGtbl& row) { // --- gcli.FDb.ind_gtbl.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gtbl_Reserve(int n) { + ind_gtbl_AbsReserve(_db.ind_gtbl_n + n); +} + +// --- gcli.FDb.ind_gtbl.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gtbl_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gtbl_buckets_n; - u32 new_nelems = _db.ind_gtbl_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -6521,7 +6083,7 @@ void gcli::ind_gtbl_Reserve(int n) { while (elem) { gcli::FGtbl &row = *elem; gcli::FGtbl* next = row.ind_gtbl_next; - u32 index = algo::Smallstr250_Hash(0, row.gtbl) & (new_nbuckets-1); + u32 index = row.ind_gtbl_hashval & (new_nbuckets-1); row.ind_gtbl_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -6645,14 +6207,9 @@ bool gcli::gact_XrefMaybe(gcli::FGact &row) { // Find row by key. Return NULL if not found. gcli::FGact* gcli::ind_gact_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_gact_buckets_n - 1); - gcli::FGact* *e = &_db.ind_gact_buckets_elems[index]; - gcli::FGact* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gact == key; - if (done) break; - e = &ret->ind_gact_next; - } while (true); + gcli::FGact *ret = _db.ind_gact_buckets_elems[index]; + for (; ret && !((*ret).gact == key); ret = ret->ind_gact_next) { + } return ret; } @@ -6684,10 +6241,11 @@ gcli::FGact& gcli::ind_gact_GetOrCreate(const algo::strptr& key) { // --- gcli.FDb.ind_gact.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool gcli::ind_gact_InsertMaybe(gcli::FGact& row) { - ind_gact_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gact_next == (gcli::FGact*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gact) & (_db.ind_gact_buckets_n - 1); + row.ind_gact_hashval = algo::Smallstr50_Hash(0, row.gact); + ind_gact_Reserve(1); + u32 index = row.ind_gact_hashval & (_db.ind_gact_buckets_n - 1); gcli::FGact* *prev = &_db.ind_gact_buckets_elems[index]; do { gcli::FGact* ret = *prev; @@ -6713,7 +6271,7 @@ bool gcli::ind_gact_InsertMaybe(gcli::FGact& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void gcli::ind_gact_Remove(gcli::FGact& row) { if (LIKELY(row.ind_gact_next != (gcli::FGact*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.gact) & (_db.ind_gact_buckets_n - 1); + u32 index = row.ind_gact_hashval & (_db.ind_gact_buckets_n - 1); gcli::FGact* *prev = &_db.ind_gact_buckets_elems[index]; // addr of pointer to current element while (gcli::FGact *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -6730,8 +6288,14 @@ void gcli::ind_gact_Remove(gcli::FGact& row) { // --- gcli.FDb.ind_gact.Reserve // Reserve enough room in the hash for N more elements. Return success code. void gcli::ind_gact_Reserve(int n) { + ind_gact_AbsReserve(_db.ind_gact_n + n); +} + +// --- gcli.FDb.ind_gact.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void gcli::ind_gact_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gact_buckets_n; - u32 new_nelems = _db.ind_gact_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -6750,7 +6314,7 @@ void gcli::ind_gact_Reserve(int n) { while (elem) { gcli::FGact &row = *elem; gcli::FGact* next = row.ind_gact_next; - u32 index = algo::Smallstr50_Hash(0, row.gact) & (new_nbuckets-1); + u32 index = row.ind_gact_hashval & (new_nbuckets-1); row.ind_gact_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -6789,28 +6353,6 @@ void gcli::FDb_Init() { _db.gtype_lary[i] = gtype_first; gtype_first += 1ULL<=0; i--) { - gcli::FTuples* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(gcli::FTuples*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - gclicmd.c_tuples_n = lim - 1; - break; + int n = gclicmd.c_tuples_n; + int j=0; + for (int i=0; i=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FGclicmdarg* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FGclicmdarg*) * (lim - j); + size_t nbytes = sizeof(gcli::FGclicmdarg*) * (n - j); memmove(elems + i, elems + j, nbytes); - gclicmd.c_gclicmdarg_n = lim - 1; + gclicmd.c_gclicmdarg_n = n - 1; break; } } @@ -7666,15 +7169,11 @@ void gcli::c_gclicmdarg_Reserve(gcli::FGclicmd& gclicmd, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_gclicmdc_Insert(gcli::FGclicmd& gclicmd, gcli::FGclicmdc& row) { - if (bool_Update(row.gclicmd_c_gclicmdc_in_ary,true)) { - // reserve space + if (!row.gclicmd_c_gclicmdc_in_ary) { c_gclicmdc_Reserve(gclicmd, 1); - u32 n = gclicmd.c_gclicmdc_n; - u32 at = n; - gcli::FGclicmdc* *elems = gclicmd.c_gclicmdc_elems; - elems[at] = &row; - gclicmd.c_gclicmdc_n = n+1; - + u32 n = gclicmd.c_gclicmdc_n++; + gclicmd.c_gclicmdc_elems[n] = &row; + row.gclicmd_c_gclicmdc_in_ary = true; } } @@ -7683,7 +7182,7 @@ void gcli::c_gclicmdc_Insert(gcli::FGclicmd& gclicmd, gcli::FGclicmdc& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_gclicmdc_InsertMaybe(gcli::FGclicmd& gclicmd, gcli::FGclicmdc& row) { - bool retval = !row.gclicmd_c_gclicmdc_in_ary; + bool retval = !gclicmd_c_gclicmdc_InAryQ(row); c_gclicmdc_Insert(gclicmd,row); // check is performed in _Insert again return retval; } @@ -7691,18 +7190,18 @@ bool gcli::c_gclicmdc_InsertMaybe(gcli::FGclicmd& gclicmd, gcli::FGclicmdc& row) // --- gcli.FGclicmd.c_gclicmdc.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_gclicmdc_Remove(gcli::FGclicmd& gclicmd, gcli::FGclicmdc& row) { + int n = gclicmd.c_gclicmdc_n; if (bool_Update(row.gclicmd_c_gclicmdc_in_ary,false)) { - int lim = gclicmd.c_gclicmdc_n; gcli::FGclicmdc* *elems = gclicmd.c_gclicmdc_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FGclicmdc* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FGclicmdc*) * (lim - j); + size_t nbytes = sizeof(gcli::FGclicmdc*) * (n - j); memmove(elems + i, elems + j, nbytes); - gclicmd.c_gclicmdc_n = lim - 1; + gclicmd.c_gclicmdc_n = n - 1; break; } } @@ -7730,15 +7229,11 @@ void gcli::c_gclicmdc_Reserve(gcli::FGclicmd& gclicmd, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_gclicmdf2j_Insert(gcli::FGclicmd& gclicmd, gcli::FGclicmdf2j& row) { - if (bool_Update(row.gclicmd_c_gclicmdf2j_in_ary,true)) { - // reserve space + if (!row.gclicmd_c_gclicmdf2j_in_ary) { c_gclicmdf2j_Reserve(gclicmd, 1); - u32 n = gclicmd.c_gclicmdf2j_n; - u32 at = n; - gcli::FGclicmdf2j* *elems = gclicmd.c_gclicmdf2j_elems; - elems[at] = &row; - gclicmd.c_gclicmdf2j_n = n+1; - + u32 n = gclicmd.c_gclicmdf2j_n++; + gclicmd.c_gclicmdf2j_elems[n] = &row; + row.gclicmd_c_gclicmdf2j_in_ary = true; } } @@ -7747,7 +7242,7 @@ void gcli::c_gclicmdf2j_Insert(gcli::FGclicmd& gclicmd, gcli::FGclicmdf2j& row) // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_gclicmdf2j_InsertMaybe(gcli::FGclicmd& gclicmd, gcli::FGclicmdf2j& row) { - bool retval = !row.gclicmd_c_gclicmdf2j_in_ary; + bool retval = !gclicmd_c_gclicmdf2j_InAryQ(row); c_gclicmdf2j_Insert(gclicmd,row); // check is performed in _Insert again return retval; } @@ -7755,18 +7250,18 @@ bool gcli::c_gclicmdf2j_InsertMaybe(gcli::FGclicmd& gclicmd, gcli::FGclicmdf2j& // --- gcli.FGclicmd.c_gclicmdf2j.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_gclicmdf2j_Remove(gcli::FGclicmd& gclicmd, gcli::FGclicmdf2j& row) { + int n = gclicmd.c_gclicmdf2j_n; if (bool_Update(row.gclicmd_c_gclicmdf2j_in_ary,false)) { - int lim = gclicmd.c_gclicmdf2j_n; gcli::FGclicmdf2j* *elems = gclicmd.c_gclicmdf2j_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FGclicmdf2j* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FGclicmdf2j*) * (lim - j); + size_t nbytes = sizeof(gcli::FGclicmdf2j*) * (n - j); memmove(elems + i, elems + j, nbytes); - gclicmd.c_gclicmdf2j_n = lim - 1; + gclicmd.c_gclicmdf2j_n = n - 1; break; } } @@ -7812,8 +7307,9 @@ void gcli::FGclicmd_Init(gcli::FGclicmd& gclicmd) { gclicmd.c_gclicmdf2j_n = 0; // (gcli.FGclicmd.c_gclicmdf2j) gclicmd.c_gclicmdf2j_max = 0; // (gcli.FGclicmd.c_gclicmdf2j) gclicmd.p_gclicmd = NULL; - gclicmd._db_c_gclicmd_in_ary = bool(false); + gclicmd.c_gclicmd_in_ary = bool(false); gclicmd.ind_gclicmd_next = (gcli::FGclicmd*)-1; // (gcli.FDb.ind_gclicmd) not-in-hash + gclicmd.ind_gclicmd_hashval = 0; // stored hash value gclicmd.step = NULL; } @@ -7874,15 +7370,11 @@ algo::cstring gcli::ctype_Get(gcli::FGclicmdc& gclicmdc) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_gclicmdf_Insert(gcli::FGclicmdc& gclicmdc, gcli::FGclicmdf& row) { - if (bool_Update(row.gclicmdc_c_gclicmdf_in_ary,true)) { - // reserve space + if (!row.gclicmdc_c_gclicmdf_in_ary) { c_gclicmdf_Reserve(gclicmdc, 1); - u32 n = gclicmdc.c_gclicmdf_n; - u32 at = n; - gcli::FGclicmdf* *elems = gclicmdc.c_gclicmdf_elems; - elems[at] = &row; - gclicmdc.c_gclicmdf_n = n+1; - + u32 n = gclicmdc.c_gclicmdf_n++; + gclicmdc.c_gclicmdf_elems[n] = &row; + row.gclicmdc_c_gclicmdf_in_ary = true; } } @@ -7891,7 +7383,7 @@ void gcli::c_gclicmdf_Insert(gcli::FGclicmdc& gclicmdc, gcli::FGclicmdf& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_gclicmdf_InsertMaybe(gcli::FGclicmdc& gclicmdc, gcli::FGclicmdf& row) { - bool retval = !row.gclicmdc_c_gclicmdf_in_ary; + bool retval = !gclicmdc_c_gclicmdf_InAryQ(row); c_gclicmdf_Insert(gclicmdc,row); // check is performed in _Insert again return retval; } @@ -7899,18 +7391,18 @@ bool gcli::c_gclicmdf_InsertMaybe(gcli::FGclicmdc& gclicmdc, gcli::FGclicmdf& ro // --- gcli.FGclicmdc.c_gclicmdf.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_gclicmdf_Remove(gcli::FGclicmdc& gclicmdc, gcli::FGclicmdf& row) { + int n = gclicmdc.c_gclicmdf_n; if (bool_Update(row.gclicmdc_c_gclicmdf_in_ary,false)) { - int lim = gclicmdc.c_gclicmdf_n; gcli::FGclicmdf* *elems = gclicmdc.c_gclicmdf_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FGclicmdf* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FGclicmdf*) * (lim - j); + size_t nbytes = sizeof(gcli::FGclicmdf*) * (n - j); memmove(elems + i, elems + j, nbytes); - gclicmdc.c_gclicmdf_n = lim - 1; + gclicmdc.c_gclicmdf_n = n - 1; break; } } @@ -8053,14 +7545,9 @@ algo::cstring gcli::jkey_Get(gcli::FGclicmdj2f& gclicmdj2f) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_gclicmdf_Insert(gcli::FGclicmdj2f& gclicmdj2f, gcli::FGclicmdf& row) { - // reserve space c_gclicmdf_Reserve(gclicmdj2f, 1); - u32 n = gclicmdj2f.c_gclicmdf_n; - u32 at = n; - gcli::FGclicmdf* *elems = gclicmdj2f.c_gclicmdf_elems; - elems[at] = &row; - gclicmdj2f.c_gclicmdf_n = n+1; - + u32 n = gclicmdj2f.c_gclicmdf_n++; + gclicmdj2f.c_gclicmdf_elems[n] = &row; } // --- gcli.FGclicmdj2f.c_gclicmdf.ScanInsertMaybe @@ -8089,20 +7576,18 @@ bool gcli::c_gclicmdf_ScanInsertMaybe(gcli::FGclicmdj2f& gclicmdj2f, gcli::FGcli // --- gcli.FGclicmdj2f.c_gclicmdf.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_gclicmdf_Remove(gcli::FGclicmdj2f& gclicmdj2f, gcli::FGclicmdf& row) { - int lim = gclicmdj2f.c_gclicmdf_n; - gcli::FGclicmdf* *elems = gclicmdj2f.c_gclicmdf_elems; - // search backward, so that most recently added element is found first. - // if found, shift array. - for (int i = lim-1; i>=0; i--) { - gcli::FGclicmdf* elem = elems[i]; // fetch element - if (elem == &row) { - int j = i + 1; - size_t nbytes = sizeof(gcli::FGclicmdf*) * (lim - j); - memmove(elems + i, elems + j, nbytes); - gclicmdj2f.c_gclicmdf_n = lim - 1; - break; + int n = gclicmdj2f.c_gclicmdf_n; + int j=0; + for (int i=0; i=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FGtblactfld* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FGtblactfld*) * (lim - j); + size_t nbytes = sizeof(gcli::FGtblactfld*) * (n - j); memmove(elems + i, elems + j, nbytes); - gfld.c_gtblactfld_n = lim - 1; + gfld.c_gtblactfld_n = n - 1; break; } } @@ -8336,6 +7817,7 @@ void gcli::FGrepo_Init(gcli::FGrepo& grepo) { grepo.active = bool(true); grepo.select = bool(false); grepo.ind_grepo_next = (gcli::FGrepo*)-1; // (gcli.FDb.ind_grepo) not-in-hash + grepo.ind_grepo_hashval = 0; // stored hash value } // --- gcli.FGrepo..Uninit @@ -8344,56 +7826,6 @@ void gcli::FGrepo_Uninit(gcli::FGrepo& grepo) { ind_grepo_Remove(row); // remove grepo from index ind_grepo } -// --- gcli.FGrepogitport.base.CopyOut -// Copy fields out of row -void gcli::grepogitport_CopyOut(gcli::FGrepogitport &row, gclidb::Grepogitport &out) { - out.grepogitport = row.grepogitport; - out.port = row.port; - out.comment = row.comment; -} - -// --- gcli.FGrepogitport.base.CopyIn -// Copy fields in to row -void gcli::grepogitport_CopyIn(gcli::FGrepogitport &row, gclidb::Grepogitport &in) { - row.grepogitport = in.grepogitport; - row.port = in.port; - row.comment = in.comment; -} - -// --- gcli.FGrepogitport..Uninit -void gcli::FGrepogitport_Uninit(gcli::FGrepogitport& grepogitport) { - gcli::FGrepogitport &row = grepogitport; (void)row; - ind_grepogitport_Remove(row); // remove grepogitport from index ind_grepogitport -} - -// --- gcli.FGrepossh.base.CopyOut -// Copy fields out of row -void gcli::grepossh_CopyOut(gcli::FGrepossh &row, gclidb::Grepossh &out) { - out.grepossh = row.grepossh; - out.sshid = row.sshid; - out.comment = row.comment; -} - -// --- gcli.FGrepossh.base.CopyIn -// Copy fields in to row -void gcli::grepossh_CopyIn(gcli::FGrepossh &row, gclidb::Grepossh &in) { - row.grepossh = in.grepossh; - row.sshid = in.sshid; - row.comment = in.comment; -} - -// --- gcli.FGrepossh.name.Get -algo::cstring gcli::name_Get(gcli::FGrepossh& grepossh) { - algo::cstring ret(algo::Pathcomp(grepossh.sshid, "/RR")); - return ret; -} - -// --- gcli.FGrepossh..Uninit -void gcli::FGrepossh_Uninit(gcli::FGrepossh& grepossh) { - gcli::FGrepossh &row = grepossh; (void)row; - ind_grepossh_Remove(row); // remove grepossh from index ind_grepossh -} - // --- gcli.FGstatet.base.CopyOut // Copy fields out of row void gcli::gstatet_CopyOut(gcli::FGstatet &row, gclidb::Gstatet &out) { @@ -8444,15 +7876,11 @@ void gcli::gtbl_CopyIn(gcli::FGtbl &row, gclidb::Gtbl &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_gtblact_Insert(gcli::FGtbl& gtbl, gcli::FGtblact& row) { - if (bool_Update(row.gtbl_c_gtblact_in_ary,true)) { - // reserve space + if (!row.gtbl_c_gtblact_in_ary) { c_gtblact_Reserve(gtbl, 1); - u32 n = gtbl.c_gtblact_n; - u32 at = n; - gcli::FGtblact* *elems = gtbl.c_gtblact_elems; - elems[at] = &row; - gtbl.c_gtblact_n = n+1; - + u32 n = gtbl.c_gtblact_n++; + gtbl.c_gtblact_elems[n] = &row; + row.gtbl_c_gtblact_in_ary = true; } } @@ -8461,7 +7889,7 @@ void gcli::c_gtblact_Insert(gcli::FGtbl& gtbl, gcli::FGtblact& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_gtblact_InsertMaybe(gcli::FGtbl& gtbl, gcli::FGtblact& row) { - bool retval = !row.gtbl_c_gtblact_in_ary; + bool retval = !gtbl_c_gtblact_InAryQ(row); c_gtblact_Insert(gtbl,row); // check is performed in _Insert again return retval; } @@ -8469,18 +7897,18 @@ bool gcli::c_gtblact_InsertMaybe(gcli::FGtbl& gtbl, gcli::FGtblact& row) { // --- gcli.FGtbl.c_gtblact.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_gtblact_Remove(gcli::FGtbl& gtbl, gcli::FGtblact& row) { + int n = gtbl.c_gtblact_n; if (bool_Update(row.gtbl_c_gtblact_in_ary,false)) { - int lim = gtbl.c_gtblact_n; gcli::FGtblact* *elems = gtbl.c_gtblact_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FGtblact* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FGtblact*) * (lim - j); + size_t nbytes = sizeof(gcli::FGtblact*) * (n - j); memmove(elems + i, elems + j, nbytes); - gtbl.c_gtblact_n = lim - 1; + gtbl.c_gtblact_n = n - 1; break; } } @@ -8547,15 +7975,11 @@ algo::Smallstr50 gcli::gact_Get(gcli::FGtblact& gtblact) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_gtblactfld_Insert(gcli::FGtblact& gtblact, gcli::FGtblactfld& row) { - if (bool_Update(row.gtblact_c_gtblactfld_in_ary,true)) { - // reserve space + if (!row.gtblact_c_gtblactfld_in_ary) { c_gtblactfld_Reserve(gtblact, 1); - u32 n = gtblact.c_gtblactfld_n; - u32 at = n; - gcli::FGtblactfld* *elems = gtblact.c_gtblactfld_elems; - elems[at] = &row; - gtblact.c_gtblactfld_n = n+1; - + u32 n = gtblact.c_gtblactfld_n++; + gtblact.c_gtblactfld_elems[n] = &row; + row.gtblact_c_gtblactfld_in_ary = true; } } @@ -8564,7 +7988,7 @@ void gcli::c_gtblactfld_Insert(gcli::FGtblact& gtblact, gcli::FGtblactfld& row) // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_gtblactfld_InsertMaybe(gcli::FGtblact& gtblact, gcli::FGtblactfld& row) { - bool retval = !row.gtblact_c_gtblactfld_in_ary; + bool retval = !gtblact_c_gtblactfld_InAryQ(row); c_gtblactfld_Insert(gtblact,row); // check is performed in _Insert again return retval; } @@ -8572,18 +7996,18 @@ bool gcli::c_gtblactfld_InsertMaybe(gcli::FGtblact& gtblact, gcli::FGtblactfld& // --- gcli.FGtblact.c_gtblactfld.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_gtblactfld_Remove(gcli::FGtblact& gtblact, gcli::FGtblactfld& row) { + int n = gtblact.c_gtblactfld_n; if (bool_Update(row.gtblact_c_gtblactfld_in_ary,false)) { - int lim = gtblact.c_gtblactfld_n; gcli::FGtblactfld* *elems = gtblact.c_gtblactfld_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FGtblactfld* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FGtblactfld*) * (lim - j); + size_t nbytes = sizeof(gcli::FGtblactfld*) * (n - j); memmove(elems + i, elems + j, nbytes); - gtblact.c_gtblactfld_n = lim - 1; + gtblact.c_gtblactfld_n = n - 1; break; } } @@ -8619,6 +8043,7 @@ void gcli::FGtblact_Init(gcli::FGtblact& gtblact) { gtblact.select = bool(false); gtblact.gtbl_c_gtblact_in_ary = bool(false); gtblact.ind_gtblact_next = (gcli::FGtblact*)-1; // (gcli.FDb.ind_gtblact) not-in-hash + gtblact.ind_gtblact_hashval = 0; // stored hash value gtblact.zd_gtblact_next = (gcli::FGtblact*)-1; // (gcli.FDb.zd_gtblact) not-in-list gtblact.zd_gtblact_prev = NULL; // (gcli.FDb.zd_gtblact) gtblact.step = NULL; @@ -8681,6 +8106,7 @@ void gcli::FGtblactfld_Init(gcli::FGtblactfld& gtblactfld) { gtblactfld.gfld_c_gtblactfld_in_ary = bool(false); gtblactfld.gtblact_c_gtblactfld_in_ary = bool(false); gtblactfld.ind_gtblactfld_next = (gcli::FGtblactfld*)-1; // (gcli.FDb.ind_gtblactfld) not-in-hash + gtblactfld.ind_gtblactfld_hashval = 0; // stored hash value } // --- gcli.FGtblactfld..Uninit @@ -8717,15 +8143,11 @@ void gcli::gtype_CopyIn(gcli::FGtype &row, gclidb::Gtype &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_gtypeh_Insert(gcli::FGtype& gtype, gcli::FGtypeh& row) { - if (bool_Update(row.gtype_c_gtypeh_in_ary,true)) { - // reserve space + if (!row.gtype_c_gtypeh_in_ary) { c_gtypeh_Reserve(gtype, 1); - u32 n = gtype.c_gtypeh_n; - u32 at = n; - gcli::FGtypeh* *elems = gtype.c_gtypeh_elems; - elems[at] = &row; - gtype.c_gtypeh_n = n+1; - + u32 n = gtype.c_gtypeh_n++; + gtype.c_gtypeh_elems[n] = &row; + row.gtype_c_gtypeh_in_ary = true; } } @@ -8734,7 +8156,7 @@ void gcli::c_gtypeh_Insert(gcli::FGtype& gtype, gcli::FGtypeh& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_gtypeh_InsertMaybe(gcli::FGtype& gtype, gcli::FGtypeh& row) { - bool retval = !row.gtype_c_gtypeh_in_ary; + bool retval = !gtype_c_gtypeh_InAryQ(row); c_gtypeh_Insert(gtype,row); // check is performed in _Insert again return retval; } @@ -8742,18 +8164,18 @@ bool gcli::c_gtypeh_InsertMaybe(gcli::FGtype& gtype, gcli::FGtypeh& row) { // --- gcli.FGtype.c_gtypeh.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_gtypeh_Remove(gcli::FGtype& gtype, gcli::FGtypeh& row) { + int n = gtype.c_gtypeh_n; if (bool_Update(row.gtype_c_gtypeh_in_ary,false)) { - int lim = gtype.c_gtypeh_n; gcli::FGtypeh* *elems = gtype.c_gtypeh_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FGtypeh* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FGtypeh*) * (lim - j); + size_t nbytes = sizeof(gcli::FGtypeh*) * (n - j); memmove(elems + i, elems + j, nbytes); - gtype.c_gtypeh_n = lim - 1; + gtype.c_gtypeh_n = n - 1; break; } } @@ -8781,15 +8203,11 @@ void gcli::c_gtypeh_Reserve(gcli::FGtype& gtype, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_gtypeprefix_Insert(gcli::FGtype& gtype, gcli::FGtypeprefix& row) { - if (bool_Update(row.gtype_c_gtypeprefix_in_ary,true)) { - // reserve space + if (!row.gtype_c_gtypeprefix_in_ary) { c_gtypeprefix_Reserve(gtype, 1); - u32 n = gtype.c_gtypeprefix_n; - u32 at = n; - gcli::FGtypeprefix* *elems = gtype.c_gtypeprefix_elems; - elems[at] = &row; - gtype.c_gtypeprefix_n = n+1; - + u32 n = gtype.c_gtypeprefix_n++; + gtype.c_gtypeprefix_elems[n] = &row; + row.gtype_c_gtypeprefix_in_ary = true; } } @@ -8798,7 +8216,7 @@ void gcli::c_gtypeprefix_Insert(gcli::FGtype& gtype, gcli::FGtypeprefix& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_gtypeprefix_InsertMaybe(gcli::FGtype& gtype, gcli::FGtypeprefix& row) { - bool retval = !row.gtype_c_gtypeprefix_in_ary; + bool retval = !gtype_c_gtypeprefix_InAryQ(row); c_gtypeprefix_Insert(gtype,row); // check is performed in _Insert again return retval; } @@ -8806,18 +8224,18 @@ bool gcli::c_gtypeprefix_InsertMaybe(gcli::FGtype& gtype, gcli::FGtypeprefix& ro // --- gcli.FGtype.c_gtypeprefix.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_gtypeprefix_Remove(gcli::FGtype& gtype, gcli::FGtypeprefix& row) { + int n = gtype.c_gtypeprefix_n; if (bool_Update(row.gtype_c_gtypeprefix_in_ary,false)) { - int lim = gtype.c_gtypeprefix_n; gcli::FGtypeprefix* *elems = gtype.c_gtypeprefix_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FGtypeprefix* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FGtypeprefix*) * (lim - j); + size_t nbytes = sizeof(gcli::FGtypeprefix*) * (n - j); memmove(elems + i, elems + j, nbytes); - gtype.c_gtypeprefix_n = lim - 1; + gtype.c_gtypeprefix_n = n - 1; break; } } @@ -9065,6 +8483,25 @@ algo::aryptr gcli::response_header_AllocN(gcli::FHttp& parent, in return algo::aryptr(elems + old_n, n_elems); } +// --- gcli.FHttp.response_header.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr gcli::response_header_AllocNAt(gcli::FHttp& parent, int n_elems, int at) { + response_header_Reserve(parent, n_elems); + int n = parent.response_header_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("gcli.bad_alloc_n_at field:gcli.FHttp.response_header comment:'index out of range'"); + } + algo::cstring *elems = parent.response_header_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.response_header_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- gcli.FHttp.response_header.Remove // Remove item by index. If index outside of range, do nothing. void gcli::response_header_Remove(gcli::FHttp& parent, u32 i) { @@ -9161,6 +8598,30 @@ bool gcli::response_header_ReadStrptrMaybe(gcli::FHttp& parent, algo::strptr in_ return retval; } +// --- gcli.FHttp.response_header.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void gcli::response_header_Insary(gcli::FHttp& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.response_header_elems && rhs.elems < parent.response_header_elems + parent.response_header_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("gcli.tary_alias field:gcli.FHttp.response_header comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.response_header_elems+1))) { + FatalErrorExit("gcli.bad_insary field:gcli.FHttp.response_header comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.response_header_n - at; + response_header_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.response_header_elems + at + nnew + i) algo::cstring(parent.response_header_elems[at + i]); + parent.response_header_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.response_header_elems + at + i) algo::cstring(rhs[i]); + } + parent.response_header_n += nnew; +} + // --- gcli.FHttp..Init // Set all fields to initial values. void gcli::FHttp_Init(gcli::FHttp& parent) { @@ -9284,15 +8745,11 @@ algo::cstring gcli::iid_Get(gcli::FIssue& issue) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_mrjob_Insert(gcli::FIssue& issue, gcli::FMrjob& row) { - if (bool_Update(row.issue_c_mrjob_in_ary,true)) { - // reserve space + if (!row.issue_c_mrjob_in_ary) { c_mrjob_Reserve(issue, 1); - u32 n = issue.c_mrjob_n; - u32 at = n; - gcli::FMrjob* *elems = issue.c_mrjob_elems; - elems[at] = &row; - issue.c_mrjob_n = n+1; - + u32 n = issue.c_mrjob_n++; + issue.c_mrjob_elems[n] = &row; + row.issue_c_mrjob_in_ary = true; } } @@ -9301,7 +8758,7 @@ void gcli::c_mrjob_Insert(gcli::FIssue& issue, gcli::FMrjob& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_mrjob_InsertMaybe(gcli::FIssue& issue, gcli::FMrjob& row) { - bool retval = !row.issue_c_mrjob_in_ary; + bool retval = !issue_c_mrjob_InAryQ(row); c_mrjob_Insert(issue,row); // check is performed in _Insert again return retval; } @@ -9309,18 +8766,18 @@ bool gcli::c_mrjob_InsertMaybe(gcli::FIssue& issue, gcli::FMrjob& row) { // --- gcli.FIssue.c_mrjob.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_mrjob_Remove(gcli::FIssue& issue, gcli::FMrjob& row) { + int n = issue.c_mrjob_n; if (bool_Update(row.issue_c_mrjob_in_ary,false)) { - int lim = issue.c_mrjob_n; gcli::FMrjob* *elems = issue.c_mrjob_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FMrjob* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FMrjob*) * (lim - j); + size_t nbytes = sizeof(gcli::FMrjob*) * (n - j); memmove(elems + i, elems + j, nbytes); - issue.c_mrjob_n = lim - 1; + issue.c_mrjob_n = n - 1; break; } } @@ -9348,15 +8805,11 @@ void gcli::c_mrjob_Reserve(gcli::FIssue& issue, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_issuenote_Insert(gcli::FIssue& issue, gcli::FIssuenote& row) { - if (bool_Update(row.issue_c_issuenote_in_ary,true)) { - // reserve space + if (!row.issue_c_issuenote_in_ary) { c_issuenote_Reserve(issue, 1); - u32 n = issue.c_issuenote_n; - u32 at = n; - gcli::FIssuenote* *elems = issue.c_issuenote_elems; - elems[at] = &row; - issue.c_issuenote_n = n+1; - + u32 n = issue.c_issuenote_n++; + issue.c_issuenote_elems[n] = &row; + row.issue_c_issuenote_in_ary = true; } } @@ -9365,7 +8818,7 @@ void gcli::c_issuenote_Insert(gcli::FIssue& issue, gcli::FIssuenote& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_issuenote_InsertMaybe(gcli::FIssue& issue, gcli::FIssuenote& row) { - bool retval = !row.issue_c_issuenote_in_ary; + bool retval = !issue_c_issuenote_InAryQ(row); c_issuenote_Insert(issue,row); // check is performed in _Insert again return retval; } @@ -9373,18 +8826,18 @@ bool gcli::c_issuenote_InsertMaybe(gcli::FIssue& issue, gcli::FIssuenote& row) { // --- gcli.FIssue.c_issuenote.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_issuenote_Remove(gcli::FIssue& issue, gcli::FIssuenote& row) { + int n = issue.c_issuenote_n; if (bool_Update(row.issue_c_issuenote_in_ary,false)) { - int lim = issue.c_issuenote_n; gcli::FIssuenote* *elems = issue.c_issuenote_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FIssuenote* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FIssuenote*) * (lim - j); + size_t nbytes = sizeof(gcli::FIssuenote*) * (n - j); memmove(elems + i, elems + j, nbytes); - issue.c_issuenote_n = lim - 1; + issue.c_issuenote_n = n - 1; break; } } @@ -9420,6 +8873,7 @@ void gcli::FIssue_Init(gcli::FIssue& issue) { issue.c_issuenote_n = 0; // (gcli.FIssue.c_issuenote) issue.c_issuenote_max = 0; // (gcli.FIssue.c_issuenote) issue.ind_issue_next = (gcli::FIssue*)-1; // (gcli.FDb.ind_issue) not-in-hash + issue.ind_issue_hashval = 0; // stored hash value } // --- gcli.FIssue..Uninit @@ -9578,15 +9032,11 @@ algo::cstring gcli::iid_Get(gcli::FMr& mr) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_mrnote_Insert(gcli::FMr& mr, gcli::FMrnote& row) { - if (bool_Update(row.mr_c_mrnote_in_ary,true)) { - // reserve space + if (!row.mr_c_mrnote_in_ary) { c_mrnote_Reserve(mr, 1); - u32 n = mr.c_mrnote_n; - u32 at = n; - gcli::FMrnote* *elems = mr.c_mrnote_elems; - elems[at] = &row; - mr.c_mrnote_n = n+1; - + u32 n = mr.c_mrnote_n++; + mr.c_mrnote_elems[n] = &row; + row.mr_c_mrnote_in_ary = true; } } @@ -9595,7 +9045,7 @@ void gcli::c_mrnote_Insert(gcli::FMr& mr, gcli::FMrnote& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_mrnote_InsertMaybe(gcli::FMr& mr, gcli::FMrnote& row) { - bool retval = !row.mr_c_mrnote_in_ary; + bool retval = !mr_c_mrnote_InAryQ(row); c_mrnote_Insert(mr,row); // check is performed in _Insert again return retval; } @@ -9603,18 +9053,18 @@ bool gcli::c_mrnote_InsertMaybe(gcli::FMr& mr, gcli::FMrnote& row) { // --- gcli.FMr.c_mrnote.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_mrnote_Remove(gcli::FMr& mr, gcli::FMrnote& row) { + int n = mr.c_mrnote_n; if (bool_Update(row.mr_c_mrnote_in_ary,false)) { - int lim = mr.c_mrnote_n; gcli::FMrnote* *elems = mr.c_mrnote_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FMrnote* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FMrnote*) * (lim - j); + size_t nbytes = sizeof(gcli::FMrnote*) * (n - j); memmove(elems + i, elems + j, nbytes); - mr.c_mrnote_n = lim - 1; + mr.c_mrnote_n = n - 1; break; } } @@ -9642,15 +9092,11 @@ void gcli::c_mrnote_Reserve(gcli::FMr& mr, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void gcli::c_mrjob_Insert(gcli::FMr& mr, gcli::FMrjob& row) { - if (bool_Update(row.mr_c_mrjob_in_ary,true)) { - // reserve space + if (!row.mr_c_mrjob_in_ary) { c_mrjob_Reserve(mr, 1); - u32 n = mr.c_mrjob_n; - u32 at = n; - gcli::FMrjob* *elems = mr.c_mrjob_elems; - elems[at] = &row; - mr.c_mrjob_n = n+1; - + u32 n = mr.c_mrjob_n++; + mr.c_mrjob_elems[n] = &row; + row.mr_c_mrjob_in_ary = true; } } @@ -9659,7 +9105,7 @@ void gcli::c_mrjob_Insert(gcli::FMr& mr, gcli::FMrjob& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool gcli::c_mrjob_InsertMaybe(gcli::FMr& mr, gcli::FMrjob& row) { - bool retval = !row.mr_c_mrjob_in_ary; + bool retval = !mr_c_mrjob_InAryQ(row); c_mrjob_Insert(mr,row); // check is performed in _Insert again return retval; } @@ -9667,18 +9113,18 @@ bool gcli::c_mrjob_InsertMaybe(gcli::FMr& mr, gcli::FMrjob& row) { // --- gcli.FMr.c_mrjob.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void gcli::c_mrjob_Remove(gcli::FMr& mr, gcli::FMrjob& row) { + int n = mr.c_mrjob_n; if (bool_Update(row.mr_c_mrjob_in_ary,false)) { - int lim = mr.c_mrjob_n; gcli::FMrjob* *elems = mr.c_mrjob_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { gcli::FMrjob* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(gcli::FMrjob*) * (lim - j); + size_t nbytes = sizeof(gcli::FMrjob*) * (n - j); memmove(elems + i, elems + j, nbytes); - mr.c_mrjob_n = lim - 1; + mr.c_mrjob_n = n - 1; break; } } @@ -9713,6 +9159,7 @@ void gcli::FMr_Init(gcli::FMr& mr) { mr.c_mrjob_max = 0; // (gcli.FMr.c_mrjob) mr.select = bool(false); mr.ind_mr_next = (gcli::FMr*)-1; // (gcli.FDb.ind_mr) not-in-hash + mr.ind_mr_hashval = 0; // stored hash value } // --- gcli.FMr..Uninit @@ -9817,6 +9264,7 @@ void gcli::FMrjob_Init(gcli::FMrjob& mrjob) { mrjob.issue_c_mrjob_in_ary = bool(false); mrjob.mr_c_mrjob_in_ary = bool(false); mrjob.ind_mrjob_next = (gcli::FMrjob*)-1; // (gcli.FDb.ind_mrjob) not-in-hash + mrjob.ind_mrjob_hashval = 0; // stored hash value } // --- gcli.FMrjob..Uninit @@ -9979,8 +9427,6 @@ const char* gcli::value_ToCstr(const gcli::TableId& parent) { case gcli_TableId_gclidb_Gfld : ret = "gclidb.Gfld"; break; case gcli_TableId_gclidb_Gmethod : ret = "gclidb.Gmethod"; break; case gcli_TableId_gclidb_Grepo : ret = "gclidb.Grepo"; break; - case gcli_TableId_gclidb_Grepogitport: ret = "gclidb.Grepogitport"; break; - case gcli_TableId_gclidb_Grepossh : ret = "gclidb.Grepossh"; break; case gcli_TableId_gclidb_Gstatet : ret = "gclidb.Gstatet"; break; case gcli_TableId_gclidb_Gtbl : ret = "gclidb.Gtbl"; break; case gcli_TableId_gclidb_Gtblactfld: ret = "gclidb.Gtblactfld"; break; @@ -10074,12 +9520,10 @@ bool gcli::value_SetStrptrMaybe(gcli::TableId& parent, algo::strptr rhs) { switch (algo::ReadLE64(rhs.elems)) { case LE_STR8('g','c','l','i','d','b','.','G'): { if (memcmp(rhs.elems+8,"clicmdt",7)==0) { value_SetEnum(parent,gcli_TableId_gclidb_Gclicmdt); ret = true; break; } - if (memcmp(rhs.elems+8,"repossh",7)==0) { value_SetEnum(parent,gcli_TableId_gclidb_Grepossh); ret = true; break; } break; } case LE_STR8('g','c','l','i','d','b','.','g'): { if (memcmp(rhs.elems+8,"clicmdt",7)==0) { value_SetEnum(parent,gcli_TableId_gclidb_gclicmdt); ret = true; break; } - if (memcmp(rhs.elems+8,"repossh",7)==0) { value_SetEnum(parent,gcli_TableId_gclidb_grepossh); ret = true; break; } break; } } @@ -10113,19 +9557,6 @@ bool gcli::value_SetStrptrMaybe(gcli::TableId& parent, algo::strptr rhs) { } break; } - case 19: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('g','c','l','i','d','b','.','G'): { - if (memcmp(rhs.elems+8,"repogitport",11)==0) { value_SetEnum(parent,gcli_TableId_gclidb_Grepogitport); ret = true; break; } - break; - } - case LE_STR8('g','c','l','i','d','b','.','g'): { - if (memcmp(rhs.elems+8,"repogitport",11)==0) { value_SetEnum(parent,gcli_TableId_gclidb_grepogitport); ret = true; break; } - break; - } - } - break; - } } return ret; } @@ -10178,12 +9609,13 @@ void gcli::StaticCheck() { // --- gcli...main int main(int argc, char **argv) { try { - algo_lib::FDb_Init(); lib_json::FDb_Init(); + algo_lib::FDb_Init(); gcli::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock gcli::ReadArgv(); // dmmeta.main:gcli gcli::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -10195,8 +9627,8 @@ int main(int argc, char **argv) { } try { gcli::FDb_Uninit(); - lib_json::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/gclidb_gen.cpp b/cpp/gen/gclidb_gen.cpp index a81ed0c0..1b996873 100644 --- a/cpp/gen/gclidb_gen.cpp +++ b/cpp/gen/gclidb_gen.cpp @@ -77,6 +77,7 @@ const char *gclidb_Gclienv_gclienv_glab = "glab"; // compile-time string constants for gclidb.Gclisub.gclisub const char *gclidb_Gclisub_gclisub__GITDIR = "$GITDIR"; const char *gclidb_Gclisub_gclisub__HOST = "$HOST"; +const char *gclidb_Gclisub_gclisub__ID_RSA = "$ID_RSA"; const char *gclidb_Gclisub_gclisub__IN_AUTH = "$IN_AUTH"; const char *gclidb_Gclisub_gclisub__ISSUE = "$ISSUE"; const char *gclidb_Gclisub_gclisub__ISSUE_ = "$ISSUE#"; @@ -109,15 +110,6 @@ const char *gclidb_Gfld_gfld_title = "title"; const char *gclidb_Gfld_gfld_token = "token"; const char *gclidb_Gfld_gfld_user = "user"; -// compile-time string constants for gclidb.Grepogitport.grepogitport -const char *gclidb_Grepogitport_grepogitport_default = "default"; -const char *gclidb_Grepogitport_grepogitport_github_com = "github.com"; -const char *gclidb_Grepogitport_grepogitport_gitlab_vovaco_com = "gitlab.vovaco.com"; - -// compile-time string constants for gclidb.Grepossh.grepossh -const char *gclidb_Grepossh_grepossh_glpat = "glpat"; -const char *gclidb_Grepossh_grepossh_vparizhs_ghp = "vparizhs/ghp"; - // compile-time string constants for gclidb.Gstate.gstate const char *gclidb_Gstate_gstate_state_all = "state_all"; const char *gclidb_Gstate_gstate_state_close = "state_close"; @@ -247,10 +239,6 @@ const char* gclidb::value_ToCstr(const gclidb::FieldId& parent) { case gclidb_FieldId_descr : ret = "descr"; break; case gclidb_FieldId_active : ret = "active"; break; case gclidb_FieldId_priv : ret = "priv"; break; - case gclidb_FieldId_grepogitport : ret = "grepogitport"; break; - case gclidb_FieldId_port : ret = "port"; break; - case gclidb_FieldId_grepossh : ret = "grepossh"; break; - case gclidb_FieldId_sshid : ret = "sshid"; break; case gclidb_FieldId_gstate : ret = "gstate"; break; case gclidb_FieldId_st : ret = "st"; break; case gclidb_FieldId_state : ret = "state"; break; @@ -433,9 +421,6 @@ bool gclidb::value_SetStrptrMaybe(gclidb::FieldId& parent, algo::strptr rhs) { case LE_STR4('n','o','t','e'): { value_SetEnum(parent,gclidb_FieldId_note); ret = true; break; } - case LE_STR4('p','o','r','t'): { - value_SetEnum(parent,gclidb_FieldId_port); ret = true; break; - } case LE_STR4('p','r','i','v'): { value_SetEnum(parent,gclidb_FieldId_priv); ret = true; break; } @@ -495,9 +480,6 @@ bool gclidb::value_SetStrptrMaybe(gclidb::FieldId& parent, algo::strptr rhs) { case LE_STR5('m','r','j','o','b'): { value_SetEnum(parent,gclidb_FieldId_mrjob); ret = true; break; } - case LE_STR5('s','s','h','i','d'): { - value_SetEnum(parent,gclidb_FieldId_sshid); ret = true; break; - } case LE_STR5('s','t','a','t','e'): { value_SetEnum(parent,gclidb_FieldId_state); ret = true; break; } @@ -600,9 +582,6 @@ bool gclidb::value_SetStrptrMaybe(gclidb::FieldId& parent, algo::strptr rhs) { case LE_STR8('g','c','l','i','c','m','d','t'): { value_SetEnum(parent,gclidb_FieldId_gclicmdt); ret = true; break; } - case LE_STR8('g','r','e','p','o','s','s','h'): { - value_SetEnum(parent,gclidb_FieldId_grepossh); ret = true; break; - } case LE_STR8('o','p','t','i','o','n','a','l'): { value_SetEnum(parent,gclidb_FieldId_optional); ret = true; break; } @@ -674,15 +653,6 @@ bool gclidb::value_SetStrptrMaybe(gclidb::FieldId& parent, algo::strptr rhs) { } break; } - case 12: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('g','r','e','p','o','g','i','t'): { - if (memcmp(rhs.elems+8,"port",4)==0) { value_SetEnum(parent,gclidb_FieldId_grepogitport); ret = true; break; } - break; - } - } - break; - } case 13: { switch (algo::ReadLE64(rhs.elems)) { case LE_STR8('g','t','b','l','a','c','t','t'): { @@ -773,13 +743,14 @@ bool gclidb::Gact_ReadFieldMaybe(gclidb::Gact& parent, algo::strptr field, algo: switch(field_id) { case gclidb_FieldId_gact: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gact, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -821,13 +792,14 @@ bool gclidb::Gatv_ReadFieldMaybe(gclidb::Gatv& parent, algo::strptr field, algo: switch(field_id) { case gclidb_FieldId_gatv: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gatv, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -869,17 +841,17 @@ bool gclidb::Gclicmd_ReadFieldMaybe(gclidb::Gclicmd& parent, algo::strptr field, switch(field_id) { case gclidb_FieldId_gclicmd: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.gclicmd, strval); - break; - } + } break; case gclidb_FieldId_gclicmdf2j: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.gclicmdf2j, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -977,33 +949,29 @@ bool gclidb::Gclicmdf2j_ReadFieldMaybe(gclidb::Gclicmdf2j& parent, algo::strptr switch(field_id) { case gclidb_FieldId_gclicmdf2j: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.gclicmdf2j, strval); - break; - } + } break; case gclidb_FieldId_gclicmdf: { retval = false; - break; - } + } break; case gclidb_FieldId_gclicmd: { retval = false; - break; - } + } break; case gclidb_FieldId_field: { retval = false; - break; - } + } break; case gclidb_FieldId_jkey: { retval = false; - break; - } + } break; case gclidb_FieldId_dup: { retval = bool_ReadStrptrMaybe(parent.dup, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1077,29 +1045,26 @@ bool gclidb::Gclicmdt_ReadFieldMaybe(gclidb::Gclicmdt& parent, algo::strptr fiel switch(field_id) { case gclidb_FieldId_gclicmdt: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.gclicmdt, strval); - break; - } + } break; case gclidb_FieldId_gmethod: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gmethod, strval); - break; - } + } break; case gclidb_FieldId_gclicmd: { retval = false; - break; - } + } break; case gclidb_FieldId_gtype: { retval = false; - break; - } + } break; case gclidb_FieldId_uri: { retval = algo::Comment_ReadStrptrMaybe(parent.uri, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1147,17 +1112,17 @@ bool gclidb::Gclienv_ReadFieldMaybe(gclidb::Gclienv& parent, algo::strptr field, switch(field_id) { case gclidb_FieldId_gclienv: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gclienv, strval); - break; - } + } break; case gclidb_FieldId_addon: { retval = algo::cstring_ReadStrptrMaybe(parent.addon, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1231,29 +1196,26 @@ bool gclidb::Gclienvsub_ReadFieldMaybe(gclidb::Gclienvsub& parent, algo::strptr switch(field_id) { case gclidb_FieldId_gclienvsub: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gclienvsub, strval); - break; - } + } break; case gclidb_FieldId_gclienv: { retval = false; - break; - } + } break; case gclidb_FieldId_sub: { retval = false; - break; - } + } break; case gclidb_FieldId_fwd: { retval = bool_ReadStrptrMaybe(parent.fwd, strval); - break; - } + } break; case gclidb_FieldId_rev: { retval = bool_ReadStrptrMaybe(parent.rev, strval); - break; - } + } break; case gclidb_FieldId_uval: { retval = algo::cstring_ReadStrptrMaybe(parent.uval, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1301,13 +1263,14 @@ bool gclidb::Gclisub_ReadFieldMaybe(gclidb::Gclisub& parent, algo::strptr field, switch(field_id) { case gclidb_FieldId_gclisub: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gclisub, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1349,13 +1312,14 @@ bool gclidb::Gfld_ReadFieldMaybe(gclidb::Gfld& parent, algo::strptr field, algo: switch(field_id) { case gclidb_FieldId_gfld: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gfld, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1438,17 +1402,17 @@ bool gclidb::Gmethod_ReadFieldMaybe(gclidb::Gmethod& parent, algo::strptr field, switch(field_id) { case gclidb_FieldId_gmethod: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gmethod, strval); - break; - } + } break; case gclidb_FieldId_val: { retval = u32_ReadStrptrMaybe(parent.val, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1522,53 +1486,44 @@ bool gclidb::Grepo_ReadFieldMaybe(gclidb::Grepo& parent, algo::strptr field, alg switch(field_id) { case gclidb_FieldId_grepo: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.grepo, strval); - break; - } + } break; case gclidb_FieldId_host: { retval = false; - break; - } + } break; case gclidb_FieldId_fname: { retval = false; - break; - } + } break; case gclidb_FieldId_name: { retval = algo::cstring_ReadStrptrMaybe(parent.name, strval); - break; - } + } break; case gclidb_FieldId_token: { retval = algo::cstring_ReadStrptrMaybe(parent.token, strval); - break; - } + } break; case gclidb_FieldId_default_branch: { retval = algo::cstring_ReadStrptrMaybe(parent.default_branch, strval); - break; - } + } break; case gclidb_FieldId_keyid: { retval = algo::cstring_ReadStrptrMaybe(parent.keyid, strval); - break; - } + } break; case gclidb_FieldId_ssh_repo: { retval = algo::cstring_ReadStrptrMaybe(parent.ssh_repo, strval); - break; - } + } break; case gclidb_FieldId_web_url: { retval = algo::cstring_ReadStrptrMaybe(parent.web_url, strval); - break; - } + } break; case gclidb_FieldId_descr: { retval = algo::cstring_ReadStrptrMaybe(parent.descr, strval); - break; - } + } break; case gclidb_FieldId_active: { retval = bool_ReadStrptrMaybe(parent.active, strval); - break; - } + } break; case gclidb_FieldId_priv: { retval = algo::cstring_ReadStrptrMaybe(parent.priv, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1633,132 +1588,6 @@ void gclidb::Grepo_Print(gclidb::Grepo& row, algo::cstring& str) { PrintAttrSpaceReset(str,"priv", temp); } -// --- gclidb.Grepogitport..ReadFieldMaybe -bool gclidb::Grepogitport_ReadFieldMaybe(gclidb::Grepogitport& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - gclidb::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case gclidb_FieldId_grepogitport: { - retval = algo::Smallstr50_ReadStrptrMaybe(parent.grepogitport, strval); - break; - } - case gclidb_FieldId_port: { - retval = algo::cstring_ReadStrptrMaybe(parent.port, strval); - break; - } - case gclidb_FieldId_comment: { - retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- gclidb.Grepogitport..ReadStrptrMaybe -// Read fields of gclidb::Grepogitport from an ascii string. -// The format of the string is an ssim Tuple -bool gclidb::Grepogitport_ReadStrptrMaybe(gclidb::Grepogitport &parent, algo::strptr in_str) { - bool retval = true; - retval = algo::StripTypeTag(in_str, "gclidb.grepogitport") || algo::StripTypeTag(in_str, "gclidb.Grepogitport"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && Grepogitport_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; -} - -// --- gclidb.Grepogitport..Print -// print string representation of ROW to string STR -// cfmt:gclidb.Grepogitport.String printfmt:Tuple -void gclidb::Grepogitport_Print(gclidb::Grepogitport& row, algo::cstring& str) { - algo::tempstr temp; - str << "gclidb.grepogitport"; - - algo::Smallstr50_Print(row.grepogitport, temp); - PrintAttrSpaceReset(str,"grepogitport", temp); - - algo::cstring_Print(row.port, temp); - PrintAttrSpaceReset(str,"port", temp); - - algo::Comment_Print(row.comment, temp); - PrintAttrSpaceReset(str,"comment", temp); -} - -// --- gclidb.Grepossh.name.Get -algo::cstring gclidb::name_Get(gclidb::Grepossh& parent) { - algo::cstring ret(algo::Pathcomp(parent.sshid, "/RR")); - return ret; -} - -// --- gclidb.Grepossh.name.Get2 -algo::cstring gclidb::Grepossh_name_Get(algo::strptr arg) { - algo::cstring ret(algo::Pathcomp(arg, "/RR")); - return ret; -} - -// --- gclidb.Grepossh..ReadFieldMaybe -bool gclidb::Grepossh_ReadFieldMaybe(gclidb::Grepossh& parent, algo::strptr field, algo::strptr strval) { - bool retval = true; - gclidb::FieldId field_id; - (void)value_SetStrptrMaybe(field_id,field); - switch(field_id) { - case gclidb_FieldId_grepossh: { - retval = algo::Smallstr50_ReadStrptrMaybe(parent.grepossh, strval); - break; - } - case gclidb_FieldId_sshid: { - retval = algo::Smallstr200_ReadStrptrMaybe(parent.sshid, strval); - break; - } - case gclidb_FieldId_name: { - retval = false; - break; - } - case gclidb_FieldId_comment: { - retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; - } - if (!retval) { - algo_lib::AppendErrtext("attr",field); - } - return retval; -} - -// --- gclidb.Grepossh..ReadStrptrMaybe -// Read fields of gclidb::Grepossh from an ascii string. -// The format of the string is an ssim Tuple -bool gclidb::Grepossh_ReadStrptrMaybe(gclidb::Grepossh &parent, algo::strptr in_str) { - bool retval = true; - retval = algo::StripTypeTag(in_str, "gclidb.grepossh") || algo::StripTypeTag(in_str, "gclidb.Grepossh"); - ind_beg(algo::Attr_curs, attr, in_str) { - retval = retval && Grepossh_ReadFieldMaybe(parent, attr.name, attr.value); - }ind_end; - return retval; -} - -// --- gclidb.Grepossh..Print -// print string representation of ROW to string STR -// cfmt:gclidb.Grepossh.String printfmt:Tuple -void gclidb::Grepossh_Print(gclidb::Grepossh& row, algo::cstring& str) { - algo::tempstr temp; - str << "gclidb.grepossh"; - - algo::Smallstr50_Print(row.grepossh, temp); - PrintAttrSpaceReset(str,"grepossh", temp); - - algo::Smallstr200_Print(row.sshid, temp); - PrintAttrSpaceReset(str,"sshid", temp); - - algo::Comment_Print(row.comment, temp); - PrintAttrSpaceReset(str,"comment", temp); -} - // --- gclidb.Gstate.st.Get algo::cstring gclidb::st_Get(gclidb::Gstate& parent) { algo::cstring ret(algo::Pathcomp(parent.gstate, "_LL")); @@ -1796,21 +1625,20 @@ bool gclidb::Gstate_ReadFieldMaybe(gclidb::Gstate& parent, algo::strptr field, a switch(field_id) { case gclidb_FieldId_gstate: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gstate, strval); - break; - } + } break; case gclidb_FieldId_st: { retval = false; - break; - } + } break; case gclidb_FieldId_state: { retval = false; - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1881,21 +1709,20 @@ bool gclidb::Gstatet_ReadFieldMaybe(gclidb::Gstatet& parent, algo::strptr field, switch(field_id) { case gclidb_FieldId_gstatet: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gstatet, strval); - break; - } + } break; case gclidb_FieldId_gtype: { retval = false; - break; - } + } break; case gclidb_FieldId_gstate: { retval = false; - break; - } + } break; case gclidb_FieldId_state: { retval = algo::cstring_ReadStrptrMaybe(parent.state, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1937,13 +1764,14 @@ bool gclidb::Gtbl_ReadFieldMaybe(gclidb::Gtbl& parent, algo::strptr field, algo: switch(field_id) { case gclidb_FieldId_gtbl: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.gtbl, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2014,29 +1842,26 @@ bool gclidb::Gtblact_ReadFieldMaybe(gclidb::Gtblact& parent, algo::strptr field, switch(field_id) { case gclidb_FieldId_gtblact: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gtblact, strval); - break; - } + } break; case gclidb_FieldId_gtbl: { retval = false; - break; - } + } break; case gclidb_FieldId_gact: { retval = false; - break; - } + } break; case gclidb_FieldId_t: { retval = bool_ReadStrptrMaybe(parent.t, strval); - break; - } + } break; case gclidb_FieldId_e: { retval = bool_ReadStrptrMaybe(parent.e, strval); - break; - } + } break; case gclidb_FieldId_auth: { retval = bool_ReadStrptrMaybe(parent.auth, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2113,37 +1938,32 @@ bool gclidb::Gtblactfld_ReadFieldMaybe(gclidb::Gtblactfld& parent, algo::strptr switch(field_id) { case gclidb_FieldId_gtblactfld: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gtblactfld, strval); - break; - } + } break; case gclidb_FieldId_gtblact: { retval = false; - break; - } + } break; case gclidb_FieldId_field: { retval = false; - break; - } + } break; case gclidb_FieldId_dflt: { retval = algo::cstring_ReadStrptrMaybe(parent.dflt, strval); - break; - } + } break; case gclidb_FieldId_field_name_dflt: { retval = bool_ReadStrptrMaybe(parent.field_name_dflt, strval); - break; - } + } break; case gclidb_FieldId_optional: { retval = bool_ReadStrptrMaybe(parent.optional, strval); - break; - } + } break; case gclidb_FieldId_regx: { retval = bool_ReadStrptrMaybe(parent.regx, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2233,33 +2053,29 @@ bool gclidb::Gtblacttst_ReadFieldMaybe(gclidb::Gtblacttst& parent, algo::strptr switch(field_id) { case gclidb_FieldId_gtblacttst: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.gtblacttst, strval); - break; - } + } break; case gclidb_FieldId_gtblact: { retval = false; - break; - } + } break; case gclidb_FieldId_gclienv: { retval = false; - break; - } + } break; case gclidb_FieldId_working: { retval = bool_ReadStrptrMaybe(parent.working, strval); - break; - } + } break; case gclidb_FieldId_t: { retval = false; - break; - } + } break; case gclidb_FieldId_cmd: { retval = algo::cstring_ReadStrptrMaybe(parent.cmd, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2336,21 +2152,20 @@ bool gclidb::Gtblacttstout_ReadFieldMaybe(gclidb::Gtblacttstout& parent, algo::s switch(field_id) { case gclidb_FieldId_gtblacttstout: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.gtblacttstout, strval); - break; - } + } break; case gclidb_FieldId_gtblacttst: { retval = false; - break; - } + } break; case gclidb_FieldId_out: { retval = false; - break; - } + } break; case gclidb_FieldId_text: { retval = algo::cstring_ReadStrptrMaybe(parent.text, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2392,17 +2207,17 @@ bool gclidb::Gtype_ReadFieldMaybe(gclidb::Gtype& parent, algo::strptr field, alg switch(field_id) { case gclidb_FieldId_gtype: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gtype, strval); - break; - } + } break; case gclidb_FieldId_default_url: { retval = algo::cstring_ReadStrptrMaybe(parent.default_url, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2476,21 +2291,20 @@ bool gclidb::Gtypeh_ReadFieldMaybe(gclidb::Gtypeh& parent, algo::strptr field, a switch(field_id) { case gclidb_FieldId_gtypeh: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.gtypeh, strval); - break; - } + } break; case gclidb_FieldId_gtype: { retval = false; - break; - } + } break; case gclidb_FieldId_name: { retval = false; - break; - } + } break; case gclidb_FieldId_header: { retval = algo::cstring_ReadStrptrMaybe(parent.header, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2561,21 +2375,20 @@ bool gclidb::Gtypeprefix_ReadFieldMaybe(gclidb::Gtypeprefix& parent, algo::strpt switch(field_id) { case gclidb_FieldId_gtypeprefix: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.gtypeprefix, strval); - break; - } + } break; case gclidb_FieldId_gtype: { retval = false; - break; - } + } break; case gclidb_FieldId_prefix: { retval = false; - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2646,57 +2459,47 @@ bool gclidb::Issue_ReadFieldMaybe(gclidb::Issue& parent, algo::strptr field, alg switch(field_id) { case gclidb_FieldId_issue: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.issue, strval); - break; - } + } break; case gclidb_FieldId_project: { retval = false; - break; - } + } break; case gclidb_FieldId_iid: { retval = false; - break; - } + } break; case gclidb_FieldId_assignee: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.assignee, strval); - break; - } + } break; case gclidb_FieldId_labels: { retval = algo::cstring_ReadStrptrMaybe(parent.labels, strval); - break; - } + } break; case gclidb_FieldId_milestone_iid: { retval = algo::cstring_ReadStrptrMaybe(parent.milestone_iid, strval); - break; - } + } break; case gclidb_FieldId_milestone_num: { retval = algo::cstring_ReadStrptrMaybe(parent.milestone_num, strval); - break; - } + } break; case gclidb_FieldId_milestone: { retval = algo::cstring_ReadStrptrMaybe(parent.milestone, strval); - break; - } + } break; case gclidb_FieldId_title: { retval = algo::cstring_ReadStrptrMaybe(parent.title, strval); - break; - } + } break; case gclidb_FieldId_author: { retval = algo::cstring_ReadStrptrMaybe(parent.author, strval); - break; - } + } break; case gclidb_FieldId_state: { retval = algo::cstring_ReadStrptrMaybe(parent.state, strval); - break; - } + } break; case gclidb_FieldId_mr: { retval = algo::cstring_ReadStrptrMaybe(parent.mr, strval); - break; - } + } break; case gclidb_FieldId_description: { retval = algo::cstring_ReadStrptrMaybe(parent.description, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2794,29 +2597,26 @@ bool gclidb::Issuenote_ReadFieldMaybe(gclidb::Issuenote& parent, algo::strptr fi switch(field_id) { case gclidb_FieldId_issuenote: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.issuenote, strval); - break; - } + } break; case gclidb_FieldId_issue: { retval = false; - break; - } + } break; case gclidb_FieldId_nid: { retval = false; - break; - } + } break; case gclidb_FieldId_note: { retval = algo::cstring_ReadStrptrMaybe(parent.note, strval); - break; - } + } break; case gclidb_FieldId_system: { retval = algo::cstring_ReadStrptrMaybe(parent.system, strval); - break; - } + } break; case gclidb_FieldId_author: { retval = algo::cstring_ReadStrptrMaybe(parent.author, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2893,25 +2693,23 @@ bool gclidb::Issuepipeline_ReadFieldMaybe(gclidb::Issuepipeline& parent, algo::s switch(field_id) { case gclidb_FieldId_issuepipeline: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.issuepipeline, strval); - break; - } + } break; case gclidb_FieldId_issue: { retval = false; - break; - } + } break; case gclidb_FieldId_id: { retval = false; - break; - } + } break; case gclidb_FieldId_id_in: { retval = algo::cstring_ReadStrptrMaybe(parent.id_in, strval); - break; - } + } break; case gclidb_FieldId_status: { retval = algo::cstring_ReadStrptrMaybe(parent.status, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2956,13 +2754,14 @@ bool gclidb::Label_ReadFieldMaybe(gclidb::Label& parent, algo::strptr field, alg switch(field_id) { case gclidb_FieldId_label: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.label, strval); - break; - } + } break; case gclidb_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3033,25 +2832,23 @@ bool gclidb::Milestone_ReadFieldMaybe(gclidb::Milestone& parent, algo::strptr fi switch(field_id) { case gclidb_FieldId_milestone: { retval = algo::Smallstr200_ReadStrptrMaybe(parent.milestone, strval); - break; - } + } break; case gclidb_FieldId_project: { retval = false; - break; - } + } break; case gclidb_FieldId_iid: { retval = false; - break; - } + } break; case gclidb_FieldId_description: { retval = algo::cstring_ReadStrptrMaybe(parent.description, strval); - break; - } + } break; case gclidb_FieldId_title: { retval = algo::cstring_ReadStrptrMaybe(parent.title, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3125,61 +2922,50 @@ bool gclidb::Mr_ReadFieldMaybe(gclidb::Mr& parent, algo::strptr field, algo::str switch(field_id) { case gclidb_FieldId_mr: { retval = algo::Smallstr150_ReadStrptrMaybe(parent.mr, strval); - break; - } + } break; case gclidb_FieldId_proj: { retval = false; - break; - } + } break; case gclidb_FieldId_iid: { retval = false; - break; - } + } break; case gclidb_FieldId_state: { retval = algo::cstring_ReadStrptrMaybe(parent.state, strval); - break; - } + } break; case gclidb_FieldId_title: { retval = algo::cstring_ReadStrptrMaybe(parent.title, strval); - break; - } + } break; case gclidb_FieldId_description: { retval = algo::cstring_ReadStrptrMaybe(parent.description, strval); - break; - } + } break; case gclidb_FieldId_source_branch: { retval = algo::cstring_ReadStrptrMaybe(parent.source_branch, strval); - break; - } + } break; case gclidb_FieldId_source_repo: { retval = algo::cstring_ReadStrptrMaybe(parent.source_repo, strval); - break; - } + } break; case gclidb_FieldId_reviewer: { retval = algo::cstring_ReadStrptrMaybe(parent.reviewer, strval); - break; - } + } break; case gclidb_FieldId_author: { retval = algo::cstring_ReadStrptrMaybe(parent.author, strval); - break; - } + } break; case gclidb_FieldId_pipeline_status: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.pipeline_status, strval); - break; - } + } break; case gclidb_FieldId_pipeline_id: { retval = algo::cstring_ReadStrptrMaybe(parent.pipeline_id, strval); - break; - } + } break; case gclidb_FieldId_draft: { retval = algo::cstring_ReadStrptrMaybe(parent.draft, strval); - break; - } + } break; case gclidb_FieldId_node_id: { retval = algo::cstring_ReadStrptrMaybe(parent.node_id, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3280,41 +3066,35 @@ bool gclidb::Mrjob_ReadFieldMaybe(gclidb::Mrjob& parent, algo::strptr field, alg switch(field_id) { case gclidb_FieldId_mrjob: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.mrjob, strval); - break; - } + } break; case gclidb_FieldId_mr: { retval = false; - break; - } + } break; case gclidb_FieldId_job: { retval = false; - break; - } + } break; case gclidb_FieldId_ref: { retval = algo::Smallstr150_ReadStrptrMaybe(parent.ref, strval); - break; - } + } break; case gclidb_FieldId_id: { retval = algo::cstring_ReadStrptrMaybe(parent.id, strval); - break; - } + } break; case gclidb_FieldId_name: { retval = algo::cstring_ReadStrptrMaybe(parent.name, strval); - break; - } + } break; case gclidb_FieldId_pipeline_id: { retval = algo::cstring_ReadStrptrMaybe(parent.pipeline_id, strval); - break; - } + } break; case gclidb_FieldId_status: { retval = algo::cstring_ReadStrptrMaybe(parent.status, strval); - break; - } + } break; case gclidb_FieldId_runner: { retval = algo::cstring_ReadStrptrMaybe(parent.runner, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3400,29 +3180,26 @@ bool gclidb::Mrnote_ReadFieldMaybe(gclidb::Mrnote& parent, algo::strptr field, a switch(field_id) { case gclidb_FieldId_system: { retval = algo::cstring_ReadStrptrMaybe(parent.system, strval); - break; - } + } break; case gclidb_FieldId_mrnote: { retval = algo::Smallstr250_ReadStrptrMaybe(parent.mrnote, strval); - break; - } + } break; case gclidb_FieldId_nid: { retval = false; - break; - } + } break; case gclidb_FieldId_note: { retval = algo::cstring_ReadStrptrMaybe(parent.note, strval); - break; - } + } break; case gclidb_FieldId_author: { retval = algo::cstring_ReadStrptrMaybe(parent.author, strval); - break; - } + } break; case gclidb_FieldId_mr: { retval = false; - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3470,17 +3247,17 @@ bool gclidb::User_ReadFieldMaybe(gclidb::User& parent, algo::strptr field, algo: switch(field_id) { case gclidb_FieldId_user: { retval = algo::Smallstr50_ReadStrptrMaybe(parent.user, strval); - break; - } + } break; case gclidb_FieldId_id: { retval = u32_ReadStrptrMaybe(parent.id, strval); - break; - } + } break; case gclidb_FieldId_name: { retval = algo::cstring_ReadStrptrMaybe(parent.name, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); diff --git a/cpp/gen/http_gen.cpp b/cpp/gen/http_gen.cpp new file mode 100644 index 00000000..97f0b64f --- /dev/null +++ b/cpp/gen/http_gen.cpp @@ -0,0 +1,2302 @@ +// +// cpp/gen/http_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/http_gen.h" +#include "include/gen/http_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude +namespace http { // gen:ns_gsymbol + const algo::strptr httpdb_version_HTTP_0_9("HTTP/0.9"); + const algo::strptr httpdb_version_HTTP_1_0("HTTP/1.0"); + const algo::strptr httpdb_version_HTTP_1_1("HTTP/1.1"); + const algo::strptr httpdb_version_HTTP_2_0("HTTP/2.0"); + const algo::strptr httpdb_version_HTTP_3_0("HTTP/3.0"); +} // gen:ns_gsymbol +namespace http { // gen:ns_print_proto + // func:http...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- http.ExtensionHeader..ReadFieldMaybe +bool http::ExtensionHeader_ReadFieldMaybe(http::ExtensionHeader& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + http::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case http_FieldId_name: { + retval = algo::cstring_ReadStrptrMaybe(parent.name, strval); + } break; + case http_FieldId_value: { + retval = algo::cstring_ReadStrptrMaybe(parent.value, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- http.ExtensionHeader..ReadStrptrMaybe +// Read fields of http::ExtensionHeader from an ascii string. +// The format of the string is an ssim Tuple +bool http::ExtensionHeader_ReadStrptrMaybe(http::ExtensionHeader &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "http.ExtensionHeader"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && ExtensionHeader_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- http.ExtensionHeader..Print +// print string representation of ROW to string STR +// cfmt:http.ExtensionHeader.String printfmt:Tuple +void http::ExtensionHeader_Print(http::ExtensionHeader& row, algo::cstring& str) { + algo::tempstr temp; + str << "http.ExtensionHeader"; + + algo::cstring_Print(row.name, temp); + PrintAttrSpaceReset(str,"name", temp); + + algo::cstring_Print(row.value, temp); + PrintAttrSpaceReset(str,"value", temp); +} + +// --- http.FieldId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* http::value_ToCstr(const http::FieldId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case http_FieldId_name : ret = "name"; break; + case http_FieldId_value : ret = "value"; break; + case http_FieldId_method : ret = "method"; break; + case http_FieldId_extension_method : ret = "extension_method"; break; + case http_FieldId_uri : ret = "uri"; break; + case http_FieldId_version : ret = "version"; break; + case http_FieldId_cache_control : ret = "cache_control"; break; + case http_FieldId_connection : ret = "connection"; break; + case http_FieldId_date : ret = "date"; break; + case http_FieldId_pragma : ret = "pragma"; break; + case http_FieldId_trailer : ret = "trailer"; break; + case http_FieldId_transfer_encoding: ret = "transfer_encoding"; break; + case http_FieldId_upgrade : ret = "upgrade"; break; + case http_FieldId_via : ret = "via"; break; + case http_FieldId_warning : ret = "warning"; break; + case http_FieldId_accept : ret = "accept"; break; + case http_FieldId_accept_charset : ret = "accept_charset"; break; + case http_FieldId_accept_encoding : ret = "accept_encoding"; break; + case http_FieldId_accept_language : ret = "accept_language"; break; + case http_FieldId_authorization : ret = "authorization"; break; + case http_FieldId_expect : ret = "expect"; break; + case http_FieldId_from : ret = "from"; break; + case http_FieldId_host : ret = "host"; break; + case http_FieldId_if_match : ret = "if_match"; break; + case http_FieldId_if_modified_since: ret = "if_modified_since"; break; + case http_FieldId_if_none_match : ret = "if_none_match"; break; + case http_FieldId_if_range : ret = "if_range"; break; + case http_FieldId_if_unmodified_since: ret = "if_unmodified_since"; break; + case http_FieldId_max_forwards : ret = "max_forwards"; break; + case http_FieldId_proxy_authorization: ret = "proxy_authorization"; break; + case http_FieldId_range : ret = "range"; break; + case http_FieldId_referer : ret = "referer"; break; + case http_FieldId_te : ret = "te"; break; + case http_FieldId_user_agent : ret = "user_agent"; break; + case http_FieldId_allow : ret = "allow"; break; + case http_FieldId_content_encoding : ret = "content_encoding"; break; + case http_FieldId_content_language : ret = "content_language"; break; + case http_FieldId_content_length : ret = "content_length"; break; + case http_FieldId_content_location : ret = "content_location"; break; + case http_FieldId_content_md5 : ret = "content_md5"; break; + case http_FieldId_content_range : ret = "content_range"; break; + case http_FieldId_content_type : ret = "content_type"; break; + case http_FieldId_expires : ret = "expires"; break; + case http_FieldId_last_modified : ret = "last_modified"; break; + case http_FieldId_sec_websocket_key: ret = "sec_websocket_key"; break; + case http_FieldId_sec_websocket_extensions: ret = "sec_websocket_extensions"; break; + case http_FieldId_sec_websocket_protocol: ret = "sec_websocket_protocol"; break; + case http_FieldId_sec_websocket_version: ret = "sec_websocket_version"; break; + case http_FieldId_extension_header : ret = "extension_header"; break; + case http_FieldId_body : ret = "body"; break; + case http_FieldId_status : ret = "status"; break; + case http_FieldId_accept_ranges : ret = "accept_ranges"; break; + case http_FieldId_age : ret = "age"; break; + case http_FieldId_etag : ret = "etag"; break; + case http_FieldId_location : ret = "location"; break; + case http_FieldId_proxy_authenticate: ret = "proxy_authenticate"; break; + case http_FieldId_retry_after : ret = "retry_after"; break; + case http_FieldId_server : ret = "server"; break; + case http_FieldId_vary : ret = "vary"; break; + case http_FieldId_www_authenticate : ret = "www_authenticate"; break; + case http_FieldId_sec_websocket_accept: ret = "sec_websocket_accept"; break; + } + return ret; +} + +// --- http.FieldId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void http::value_Print(const http::FieldId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- http.FieldId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool http::value_SetStrptrMaybe(http::FieldId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 2: { + switch (u64(algo::ReadLE16(rhs.elems))) { + case LE_STR2('t','e'): { + value_SetEnum(parent,http_FieldId_te); ret = true; break; + } + } + break; + } + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('a','g','e'): { + value_SetEnum(parent,http_FieldId_age); ret = true; break; + } + case LE_STR3('u','r','i'): { + value_SetEnum(parent,http_FieldId_uri); ret = true; break; + } + case LE_STR3('v','i','a'): { + value_SetEnum(parent,http_FieldId_via); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('b','o','d','y'): { + value_SetEnum(parent,http_FieldId_body); ret = true; break; + } + case LE_STR4('d','a','t','e'): { + value_SetEnum(parent,http_FieldId_date); ret = true; break; + } + case LE_STR4('e','t','a','g'): { + value_SetEnum(parent,http_FieldId_etag); ret = true; break; + } + case LE_STR4('f','r','o','m'): { + value_SetEnum(parent,http_FieldId_from); ret = true; break; + } + case LE_STR4('h','o','s','t'): { + value_SetEnum(parent,http_FieldId_host); ret = true; break; + } + case LE_STR4('n','a','m','e'): { + value_SetEnum(parent,http_FieldId_name); ret = true; break; + } + case LE_STR4('v','a','r','y'): { + value_SetEnum(parent,http_FieldId_vary); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('a','l','l','o','w'): { + value_SetEnum(parent,http_FieldId_allow); ret = true; break; + } + case LE_STR5('r','a','n','g','e'): { + value_SetEnum(parent,http_FieldId_range); ret = true; break; + } + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,http_FieldId_value); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('a','c','c','e','p','t'): { + value_SetEnum(parent,http_FieldId_accept); ret = true; break; + } + case LE_STR6('e','x','p','e','c','t'): { + value_SetEnum(parent,http_FieldId_expect); ret = true; break; + } + case LE_STR6('m','e','t','h','o','d'): { + value_SetEnum(parent,http_FieldId_method); ret = true; break; + } + case LE_STR6('p','r','a','g','m','a'): { + value_SetEnum(parent,http_FieldId_pragma); ret = true; break; + } + case LE_STR6('s','e','r','v','e','r'): { + value_SetEnum(parent,http_FieldId_server); ret = true; break; + } + case LE_STR6('s','t','a','t','u','s'): { + value_SetEnum(parent,http_FieldId_status); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('e','x','p','i','r','e','s'): { + value_SetEnum(parent,http_FieldId_expires); ret = true; break; + } + case LE_STR7('r','e','f','e','r','e','r'): { + value_SetEnum(parent,http_FieldId_referer); ret = true; break; + } + case LE_STR7('t','r','a','i','l','e','r'): { + value_SetEnum(parent,http_FieldId_trailer); ret = true; break; + } + case LE_STR7('u','p','g','r','a','d','e'): { + value_SetEnum(parent,http_FieldId_upgrade); ret = true; break; + } + case LE_STR7('v','e','r','s','i','o','n'): { + value_SetEnum(parent,http_FieldId_version); ret = true; break; + } + case LE_STR7('w','a','r','n','i','n','g'): { + value_SetEnum(parent,http_FieldId_warning); ret = true; break; + } + } + break; + } + case 8: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('i','f','_','m','a','t','c','h'): { + value_SetEnum(parent,http_FieldId_if_match); ret = true; break; + } + case LE_STR8('i','f','_','r','a','n','g','e'): { + value_SetEnum(parent,http_FieldId_if_range); ret = true; break; + } + case LE_STR8('l','o','c','a','t','i','o','n'): { + value_SetEnum(parent,http_FieldId_location); ret = true; break; + } + } + break; + } + case 10: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','o','n','n','e','c','t','i'): { + if (memcmp(rhs.elems+8,"on",2)==0) { value_SetEnum(parent,http_FieldId_connection); ret = true; break; } + break; + } + case LE_STR8('u','s','e','r','_','a','g','e'): { + if (memcmp(rhs.elems+8,"nt",2)==0) { value_SetEnum(parent,http_FieldId_user_agent); ret = true; break; } + break; + } + } + break; + } + case 11: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','o','n','t','e','n','t','_'): { + if (memcmp(rhs.elems+8,"md5",3)==0) { value_SetEnum(parent,http_FieldId_content_md5); ret = true; break; } + break; + } + case LE_STR8('r','e','t','r','y','_','a','f'): { + if (memcmp(rhs.elems+8,"ter",3)==0) { value_SetEnum(parent,http_FieldId_retry_after); ret = true; break; } + break; + } + } + break; + } + case 12: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','o','n','t','e','n','t','_'): { + if (memcmp(rhs.elems+8,"type",4)==0) { value_SetEnum(parent,http_FieldId_content_type); ret = true; break; } + break; + } + case LE_STR8('m','a','x','_','f','o','r','w'): { + if (memcmp(rhs.elems+8,"ards",4)==0) { value_SetEnum(parent,http_FieldId_max_forwards); ret = true; break; } + break; + } + } + break; + } + case 13: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','c','c','e','p','t','_','r'): { + if (memcmp(rhs.elems+8,"anges",5)==0) { value_SetEnum(parent,http_FieldId_accept_ranges); ret = true; break; } + break; + } + case LE_STR8('a','u','t','h','o','r','i','z'): { + if (memcmp(rhs.elems+8,"ation",5)==0) { value_SetEnum(parent,http_FieldId_authorization); ret = true; break; } + break; + } + case LE_STR8('c','a','c','h','e','_','c','o'): { + if (memcmp(rhs.elems+8,"ntrol",5)==0) { value_SetEnum(parent,http_FieldId_cache_control); ret = true; break; } + break; + } + case LE_STR8('c','o','n','t','e','n','t','_'): { + if (memcmp(rhs.elems+8,"range",5)==0) { value_SetEnum(parent,http_FieldId_content_range); ret = true; break; } + break; + } + case LE_STR8('i','f','_','n','o','n','e','_'): { + if (memcmp(rhs.elems+8,"match",5)==0) { value_SetEnum(parent,http_FieldId_if_none_match); ret = true; break; } + break; + } + case LE_STR8('l','a','s','t','_','m','o','d'): { + if (memcmp(rhs.elems+8,"ified",5)==0) { value_SetEnum(parent,http_FieldId_last_modified); ret = true; break; } + break; + } + } + break; + } + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','c','c','e','p','t','_','c'): { + if (memcmp(rhs.elems+8,"harset",6)==0) { value_SetEnum(parent,http_FieldId_accept_charset); ret = true; break; } + break; + } + case LE_STR8('c','o','n','t','e','n','t','_'): { + if (memcmp(rhs.elems+8,"length",6)==0) { value_SetEnum(parent,http_FieldId_content_length); ret = true; break; } + break; + } + } + break; + } + case 15: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','c','c','e','p','t','_','e'): { + if (memcmp(rhs.elems+8,"ncoding",7)==0) { value_SetEnum(parent,http_FieldId_accept_encoding); ret = true; break; } + break; + } + case LE_STR8('a','c','c','e','p','t','_','l'): { + if (memcmp(rhs.elems+8,"anguage",7)==0) { value_SetEnum(parent,http_FieldId_accept_language); ret = true; break; } + break; + } + } + break; + } + case 16: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','o','n','t','e','n','t','_'): { + if (memcmp(rhs.elems+8,"encoding",8)==0) { value_SetEnum(parent,http_FieldId_content_encoding); ret = true; break; } + if (memcmp(rhs.elems+8,"language",8)==0) { value_SetEnum(parent,http_FieldId_content_language); ret = true; break; } + if (memcmp(rhs.elems+8,"location",8)==0) { value_SetEnum(parent,http_FieldId_content_location); ret = true; break; } + break; + } + case LE_STR8('e','x','t','e','n','s','i','o'): { + if (memcmp(rhs.elems+8,"n_method",8)==0) { value_SetEnum(parent,http_FieldId_extension_method); ret = true; break; } + if (memcmp(rhs.elems+8,"n_header",8)==0) { value_SetEnum(parent,http_FieldId_extension_header); ret = true; break; } + break; + } + case LE_STR8('w','w','w','_','a','u','t','h'): { + if (memcmp(rhs.elems+8,"enticate",8)==0) { value_SetEnum(parent,http_FieldId_www_authenticate); ret = true; break; } + break; + } + } + break; + } + case 17: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('i','f','_','m','o','d','i','f'): { + if (memcmp(rhs.elems+8,"ied_since",9)==0) { value_SetEnum(parent,http_FieldId_if_modified_since); ret = true; break; } + break; + } + case LE_STR8('s','e','c','_','w','e','b','s'): { + if (memcmp(rhs.elems+8,"ocket_key",9)==0) { value_SetEnum(parent,http_FieldId_sec_websocket_key); ret = true; break; } + break; + } + case LE_STR8('t','r','a','n','s','f','e','r'): { + if (memcmp(rhs.elems+8,"_encoding",9)==0) { value_SetEnum(parent,http_FieldId_transfer_encoding); ret = true; break; } + break; + } + } + break; + } + case 18: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('p','r','o','x','y','_','a','u'): { + if (memcmp(rhs.elems+8,"thenticate",10)==0) { value_SetEnum(parent,http_FieldId_proxy_authenticate); ret = true; break; } + break; + } + } + break; + } + case 19: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('i','f','_','u','n','m','o','d'): { + if (memcmp(rhs.elems+8,"ified_since",11)==0) { value_SetEnum(parent,http_FieldId_if_unmodified_since); ret = true; break; } + break; + } + case LE_STR8('p','r','o','x','y','_','a','u'): { + if (memcmp(rhs.elems+8,"thorization",11)==0) { value_SetEnum(parent,http_FieldId_proxy_authorization); ret = true; break; } + break; + } + } + break; + } + case 20: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('s','e','c','_','w','e','b','s'): { + if (memcmp(rhs.elems+8,"ocket_accept",12)==0) { value_SetEnum(parent,http_FieldId_sec_websocket_accept); ret = true; break; } + break; + } + } + break; + } + case 21: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('s','e','c','_','w','e','b','s'): { + if (memcmp(rhs.elems+8,"ocket_version",13)==0) { value_SetEnum(parent,http_FieldId_sec_websocket_version); ret = true; break; } + break; + } + } + break; + } + case 22: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('s','e','c','_','w','e','b','s'): { + if (memcmp(rhs.elems+8,"ocket_protocol",14)==0) { value_SetEnum(parent,http_FieldId_sec_websocket_protocol); ret = true; break; } + break; + } + } + break; + } + case 24: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('s','e','c','_','w','e','b','s'): { + if (memcmp(rhs.elems+8,"ocket_extensions",16)==0) { value_SetEnum(parent,http_FieldId_sec_websocket_extensions); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- http.FieldId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void http::value_SetStrptr(http::FieldId& parent, algo::strptr rhs, http_FieldIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- http.FieldId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool http::value_ReadStrptrMaybe(http::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- http.FieldId..ReadStrptrMaybe +// Read fields of http::FieldId from an ascii string. +// The format of the string is the format of the http::FieldId's only field +bool http::FieldId_ReadStrptrMaybe(http::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- http.FieldId..Print +// print string representation of ROW to string STR +// cfmt:http.FieldId.String printfmt:Raw +void http::FieldId_Print(http::FieldId& row, algo::cstring& str) { + http::value_Print(row, str); +} + +// --- http.HeaderType.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* http::value_ToCstr(const http::HeaderType& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case http_HeaderType_accept : ret = "accept"; break; + case http_HeaderType_accept_charset: ret = "accept-charset"; break; + case http_HeaderType_accept_encoding: ret = "accept-encoding"; break; + case http_HeaderType_accept_language: ret = "accept-language"; break; + case http_HeaderType_accept_ranges : ret = "accept-ranges"; break; + case http_HeaderType_age : ret = "age"; break; + case http_HeaderType_allow : ret = "allow"; break; + case http_HeaderType_authorization : ret = "authorization"; break; + case http_HeaderType_cache_control : ret = "cache-control"; break; + case http_HeaderType_connection : ret = "connection"; break; + case http_HeaderType_content_encoding: ret = "content-encoding"; break; + case http_HeaderType_content_language: ret = "content-language"; break; + case http_HeaderType_content_length: ret = "content-length"; break; + case http_HeaderType_content_location: ret = "content-location"; break; + case http_HeaderType_content_md5 : ret = "content-md5"; break; + case http_HeaderType_content_range : ret = "content-range"; break; + case http_HeaderType_content_type : ret = "content-type"; break; + case http_HeaderType_date : ret = "date"; break; + case http_HeaderType_etag : ret = "etag"; break; + case http_HeaderType_expect : ret = "expect"; break; + case http_HeaderType_expires : ret = "expires"; break; + case http_HeaderType_from : ret = "from"; break; + case http_HeaderType_host : ret = "host"; break; + case http_HeaderType_if_match : ret = "if-match"; break; + case http_HeaderType_if_modified_since: ret = "if-modified-since"; break; + case http_HeaderType_if_none_match : ret = "if-none-match"; break; + case http_HeaderType_if_range : ret = "if-range"; break; + case http_HeaderType_if_unmodified_since: ret = "if-unmodified-since"; break; + case http_HeaderType_last_modified : ret = "last-modified"; break; + case http_HeaderType_location : ret = "location"; break; + case http_HeaderType_max_forwards : ret = "max-forwards"; break; + case http_HeaderType_pragma : ret = "pragma"; break; + case http_HeaderType_proxy_authenticate: ret = "proxy-authenticate"; break; + case http_HeaderType_proxy_authorization: ret = "proxy-authorization"; break; + case http_HeaderType_range : ret = "range"; break; + case http_HeaderType_referer : ret = "referer"; break; + case http_HeaderType_retry_after : ret = "retry-after"; break; + case http_HeaderType_sec_websocket_accept: ret = "sec-websocket-accept"; break; + case http_HeaderType_sec_websocket_extensions: ret = "sec-websocket-extensions"; break; + case http_HeaderType_sec_websocket_key: ret = "sec-websocket-key"; break; + case http_HeaderType_sec_websocket_protocol: ret = "sec-websocket-protocol"; break; + case http_HeaderType_sec_websocket_version: ret = "sec-websocket-version"; break; + case http_HeaderType_server : ret = "server"; break; + case http_HeaderType_te : ret = "te"; break; + case http_HeaderType_trailer : ret = "trailer"; break; + case http_HeaderType_transfer_encoding: ret = "transfer-encoding"; break; + case http_HeaderType_upgrade : ret = "upgrade"; break; + case http_HeaderType_user_agent : ret = "user-agent"; break; + case http_HeaderType_vary : ret = "vary"; break; + case http_HeaderType_via : ret = "via"; break; + case http_HeaderType_warning : ret = "warning"; break; + case http_HeaderType_www_authenticate: ret = "www-authenticate"; break; + } + return ret; +} + +// --- http.HeaderType.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void http::value_Print(const http::HeaderType& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- http.HeaderType.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool http::value_SetStrptrMaybe(http::HeaderType& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 2: { + switch (u64(algo::ReadLE16(rhs.elems))) { + case LE_STR2('t','e'): { + value_SetEnum(parent,http_HeaderType_te); ret = true; break; + } + } + break; + } + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('a','g','e'): { + value_SetEnum(parent,http_HeaderType_age); ret = true; break; + } + case LE_STR3('v','i','a'): { + value_SetEnum(parent,http_HeaderType_via); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('d','a','t','e'): { + value_SetEnum(parent,http_HeaderType_date); ret = true; break; + } + case LE_STR4('e','t','a','g'): { + value_SetEnum(parent,http_HeaderType_etag); ret = true; break; + } + case LE_STR4('f','r','o','m'): { + value_SetEnum(parent,http_HeaderType_from); ret = true; break; + } + case LE_STR4('h','o','s','t'): { + value_SetEnum(parent,http_HeaderType_host); ret = true; break; + } + case LE_STR4('v','a','r','y'): { + value_SetEnum(parent,http_HeaderType_vary); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('a','l','l','o','w'): { + value_SetEnum(parent,http_HeaderType_allow); ret = true; break; + } + case LE_STR5('r','a','n','g','e'): { + value_SetEnum(parent,http_HeaderType_range); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('a','c','c','e','p','t'): { + value_SetEnum(parent,http_HeaderType_accept); ret = true; break; + } + case LE_STR6('e','x','p','e','c','t'): { + value_SetEnum(parent,http_HeaderType_expect); ret = true; break; + } + case LE_STR6('p','r','a','g','m','a'): { + value_SetEnum(parent,http_HeaderType_pragma); ret = true; break; + } + case LE_STR6('s','e','r','v','e','r'): { + value_SetEnum(parent,http_HeaderType_server); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('e','x','p','i','r','e','s'): { + value_SetEnum(parent,http_HeaderType_expires); ret = true; break; + } + case LE_STR7('r','e','f','e','r','e','r'): { + value_SetEnum(parent,http_HeaderType_referer); ret = true; break; + } + case LE_STR7('t','r','a','i','l','e','r'): { + value_SetEnum(parent,http_HeaderType_trailer); ret = true; break; + } + case LE_STR7('u','p','g','r','a','d','e'): { + value_SetEnum(parent,http_HeaderType_upgrade); ret = true; break; + } + case LE_STR7('w','a','r','n','i','n','g'): { + value_SetEnum(parent,http_HeaderType_warning); ret = true; break; + } + } + break; + } + case 8: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('i','f','-','m','a','t','c','h'): { + value_SetEnum(parent,http_HeaderType_if_match); ret = true; break; + } + case LE_STR8('i','f','-','r','a','n','g','e'): { + value_SetEnum(parent,http_HeaderType_if_range); ret = true; break; + } + case LE_STR8('l','o','c','a','t','i','o','n'): { + value_SetEnum(parent,http_HeaderType_location); ret = true; break; + } + } + break; + } + case 10: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','o','n','n','e','c','t','i'): { + if (memcmp(rhs.elems+8,"on",2)==0) { value_SetEnum(parent,http_HeaderType_connection); ret = true; break; } + break; + } + case LE_STR8('u','s','e','r','-','a','g','e'): { + if (memcmp(rhs.elems+8,"nt",2)==0) { value_SetEnum(parent,http_HeaderType_user_agent); ret = true; break; } + break; + } + } + break; + } + case 11: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','o','n','t','e','n','t','-'): { + if (memcmp(rhs.elems+8,"md5",3)==0) { value_SetEnum(parent,http_HeaderType_content_md5); ret = true; break; } + break; + } + case LE_STR8('r','e','t','r','y','-','a','f'): { + if (memcmp(rhs.elems+8,"ter",3)==0) { value_SetEnum(parent,http_HeaderType_retry_after); ret = true; break; } + break; + } + } + break; + } + case 12: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','o','n','t','e','n','t','-'): { + if (memcmp(rhs.elems+8,"type",4)==0) { value_SetEnum(parent,http_HeaderType_content_type); ret = true; break; } + break; + } + case LE_STR8('m','a','x','-','f','o','r','w'): { + if (memcmp(rhs.elems+8,"ards",4)==0) { value_SetEnum(parent,http_HeaderType_max_forwards); ret = true; break; } + break; + } + } + break; + } + case 13: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','c','c','e','p','t','-','r'): { + if (memcmp(rhs.elems+8,"anges",5)==0) { value_SetEnum(parent,http_HeaderType_accept_ranges); ret = true; break; } + break; + } + case LE_STR8('a','u','t','h','o','r','i','z'): { + if (memcmp(rhs.elems+8,"ation",5)==0) { value_SetEnum(parent,http_HeaderType_authorization); ret = true; break; } + break; + } + case LE_STR8('c','a','c','h','e','-','c','o'): { + if (memcmp(rhs.elems+8,"ntrol",5)==0) { value_SetEnum(parent,http_HeaderType_cache_control); ret = true; break; } + break; + } + case LE_STR8('c','o','n','t','e','n','t','-'): { + if (memcmp(rhs.elems+8,"range",5)==0) { value_SetEnum(parent,http_HeaderType_content_range); ret = true; break; } + break; + } + case LE_STR8('i','f','-','n','o','n','e','-'): { + if (memcmp(rhs.elems+8,"match",5)==0) { value_SetEnum(parent,http_HeaderType_if_none_match); ret = true; break; } + break; + } + case LE_STR8('l','a','s','t','-','m','o','d'): { + if (memcmp(rhs.elems+8,"ified",5)==0) { value_SetEnum(parent,http_HeaderType_last_modified); ret = true; break; } + break; + } + } + break; + } + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','c','c','e','p','t','-','c'): { + if (memcmp(rhs.elems+8,"harset",6)==0) { value_SetEnum(parent,http_HeaderType_accept_charset); ret = true; break; } + break; + } + case LE_STR8('c','o','n','t','e','n','t','-'): { + if (memcmp(rhs.elems+8,"length",6)==0) { value_SetEnum(parent,http_HeaderType_content_length); ret = true; break; } + break; + } + } + break; + } + case 15: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','c','c','e','p','t','-','e'): { + if (memcmp(rhs.elems+8,"ncoding",7)==0) { value_SetEnum(parent,http_HeaderType_accept_encoding); ret = true; break; } + break; + } + case LE_STR8('a','c','c','e','p','t','-','l'): { + if (memcmp(rhs.elems+8,"anguage",7)==0) { value_SetEnum(parent,http_HeaderType_accept_language); ret = true; break; } + break; + } + } + break; + } + case 16: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','o','n','t','e','n','t','-'): { + if (memcmp(rhs.elems+8,"encoding",8)==0) { value_SetEnum(parent,http_HeaderType_content_encoding); ret = true; break; } + if (memcmp(rhs.elems+8,"language",8)==0) { value_SetEnum(parent,http_HeaderType_content_language); ret = true; break; } + if (memcmp(rhs.elems+8,"location",8)==0) { value_SetEnum(parent,http_HeaderType_content_location); ret = true; break; } + break; + } + case LE_STR8('w','w','w','-','a','u','t','h'): { + if (memcmp(rhs.elems+8,"enticate",8)==0) { value_SetEnum(parent,http_HeaderType_www_authenticate); ret = true; break; } + break; + } + } + break; + } + case 17: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('i','f','-','m','o','d','i','f'): { + if (memcmp(rhs.elems+8,"ied-since",9)==0) { value_SetEnum(parent,http_HeaderType_if_modified_since); ret = true; break; } + break; + } + case LE_STR8('s','e','c','-','w','e','b','s'): { + if (memcmp(rhs.elems+8,"ocket-key",9)==0) { value_SetEnum(parent,http_HeaderType_sec_websocket_key); ret = true; break; } + break; + } + case LE_STR8('t','r','a','n','s','f','e','r'): { + if (memcmp(rhs.elems+8,"-encoding",9)==0) { value_SetEnum(parent,http_HeaderType_transfer_encoding); ret = true; break; } + break; + } + } + break; + } + case 18: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('p','r','o','x','y','-','a','u'): { + if (memcmp(rhs.elems+8,"thenticate",10)==0) { value_SetEnum(parent,http_HeaderType_proxy_authenticate); ret = true; break; } + break; + } + } + break; + } + case 19: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('i','f','-','u','n','m','o','d'): { + if (memcmp(rhs.elems+8,"ified-since",11)==0) { value_SetEnum(parent,http_HeaderType_if_unmodified_since); ret = true; break; } + break; + } + case LE_STR8('p','r','o','x','y','-','a','u'): { + if (memcmp(rhs.elems+8,"thorization",11)==0) { value_SetEnum(parent,http_HeaderType_proxy_authorization); ret = true; break; } + break; + } + } + break; + } + case 20: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('s','e','c','-','w','e','b','s'): { + if (memcmp(rhs.elems+8,"ocket-accept",12)==0) { value_SetEnum(parent,http_HeaderType_sec_websocket_accept); ret = true; break; } + break; + } + } + break; + } + case 21: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('s','e','c','-','w','e','b','s'): { + if (memcmp(rhs.elems+8,"ocket-version",13)==0) { value_SetEnum(parent,http_HeaderType_sec_websocket_version); ret = true; break; } + break; + } + } + break; + } + case 22: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('s','e','c','-','w','e','b','s'): { + if (memcmp(rhs.elems+8,"ocket-protocol",14)==0) { value_SetEnum(parent,http_HeaderType_sec_websocket_protocol); ret = true; break; } + break; + } + } + break; + } + case 24: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('s','e','c','-','w','e','b','s'): { + if (memcmp(rhs.elems+8,"ocket-extensions",16)==0) { value_SetEnum(parent,http_HeaderType_sec_websocket_extensions); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- http.HeaderType.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void http::value_SetStrptr(http::HeaderType& parent, algo::strptr rhs, http_HeaderTypeEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- http.HeaderType.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool http::value_ReadStrptrMaybe(http::HeaderType& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u16_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- http.HeaderType..ReadStrptrMaybe +// Read fields of http::HeaderType from an ascii string. +// The format of the string is the format of the http::HeaderType's only field +bool http::HeaderType_ReadStrptrMaybe(http::HeaderType &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- http.HeaderType..Print +// print string representation of ROW to string STR +// cfmt:http.HeaderType.String printfmt:Raw +void http::HeaderType_Print(http::HeaderType& row, algo::cstring& str) { + http::value_Print(row, str); +} + +// --- http.Method.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* http::value_ToCstr(const http::Method& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case http_Method_extension_method : ret = "extension_method"; break; + case http_Method_GET : ret = "GET"; break; + case http_Method_HEAD : ret = "HEAD"; break; + case http_Method_POST : ret = "POST"; break; + case http_Method_PUT : ret = "PUT"; break; + case http_Method_DELETE : ret = "DELETE"; break; + case http_Method_CONNECT : ret = "CONNECT"; break; + case http_Method_OPTIONS : ret = "OPTIONS"; break; + case http_Method_TRACE : ret = "TRACE"; break; + } + return ret; +} + +// --- http.Method.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void http::value_Print(const http::Method& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- http.Method.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool http::value_SetStrptrMaybe(http::Method& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('G','E','T'): { + value_SetEnum(parent,http_Method_GET); ret = true; break; + } + case LE_STR3('P','U','T'): { + value_SetEnum(parent,http_Method_PUT); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('H','E','A','D'): { + value_SetEnum(parent,http_Method_HEAD); ret = true; break; + } + case LE_STR4('P','O','S','T'): { + value_SetEnum(parent,http_Method_POST); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('T','R','A','C','E'): { + value_SetEnum(parent,http_Method_TRACE); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('D','E','L','E','T','E'): { + value_SetEnum(parent,http_Method_DELETE); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('C','O','N','N','E','C','T'): { + value_SetEnum(parent,http_Method_CONNECT); ret = true; break; + } + case LE_STR7('O','P','T','I','O','N','S'): { + value_SetEnum(parent,http_Method_OPTIONS); ret = true; break; + } + } + break; + } + case 16: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('e','x','t','e','n','s','i','o'): { + if (memcmp(rhs.elems+8,"n_method",8)==0) { value_SetEnum(parent,http_Method_extension_method); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- http.Method.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void http::value_SetStrptr(http::Method& parent, algo::strptr rhs, http_MethodEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- http.Method.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool http::value_ReadStrptrMaybe(http::Method& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- http.Method..ReadStrptrMaybe +// Read fields of http::Method from an ascii string. +// The format of the string is the format of the http::Method's only field +bool http::Method_ReadStrptrMaybe(http::Method &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- http.Method..Print +// print string representation of ROW to string STR +// cfmt:http.Method.String printfmt:Raw +void http::Method_Print(http::Method& row, algo::cstring& str) { + http::value_Print(row, str); +} + +// --- http.Request.extension_header.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr http::extension_header_Addary(http::Request& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.extension_header_elems && rhs.elems < parent.extension_header_elems + parent.extension_header_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("http.tary_alias field:http.Request.extension_header comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + extension_header_Reserve(parent, nnew); // reserve space + int at = parent.extension_header_n; + for (int i = 0; i < nnew; i++) { + new (parent.extension_header_elems + at + i) http::ExtensionHeader(rhs[i]); + parent.extension_header_n++; + } + return algo::aryptr(parent.extension_header_elems + at, nnew); +} + +// --- http.Request.extension_header.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +http::ExtensionHeader& http::extension_header_Alloc(http::Request& parent) { + extension_header_Reserve(parent, 1); + int n = parent.extension_header_n; + int at = n; + http::ExtensionHeader *elems = parent.extension_header_elems; + new (elems + at) http::ExtensionHeader(); // construct new element, default initializer + parent.extension_header_n = n+1; + return elems[at]; +} + +// --- http.Request.extension_header.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +http::ExtensionHeader& http::extension_header_AllocAt(http::Request& parent, int at) { + extension_header_Reserve(parent, 1); + int n = parent.extension_header_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("http.bad_alloc_at field:http.Request.extension_header comment:'index out of range'"); + } + http::ExtensionHeader *elems = parent.extension_header_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(http::ExtensionHeader)); + new (elems + at) http::ExtensionHeader(); // construct element, default initializer + parent.extension_header_n = n+1; + return elems[at]; +} + +// --- http.Request.extension_header.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr http::extension_header_AllocN(http::Request& parent, int n_elems) { + extension_header_Reserve(parent, n_elems); + int old_n = parent.extension_header_n; + int new_n = old_n + n_elems; + http::ExtensionHeader *elems = parent.extension_header_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) http::ExtensionHeader(); // construct new element, default initialize + } + parent.extension_header_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- http.Request.extension_header.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr http::extension_header_AllocNAt(http::Request& parent, int n_elems, int at) { + extension_header_Reserve(parent, n_elems); + int n = parent.extension_header_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("http.bad_alloc_n_at field:http.Request.extension_header comment:'index out of range'"); + } + http::ExtensionHeader *elems = parent.extension_header_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(http::ExtensionHeader)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) http::ExtensionHeader(); // construct new element, default initialize + } + parent.extension_header_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- http.Request.extension_header.Remove +// Remove item by index. If index outside of range, do nothing. +void http::extension_header_Remove(http::Request& parent, u32 i) { + u32 lim = parent.extension_header_n; + http::ExtensionHeader *elems = parent.extension_header_elems; + if (i < lim) { + elems[i].~ExtensionHeader(); // destroy element + memmove(elems + i, elems + (i + 1), sizeof(http::ExtensionHeader) * (lim - (i + 1))); + parent.extension_header_n = lim - 1; + } +} + +// --- http.Request.extension_header.RemoveAll +void http::extension_header_RemoveAll(http::Request& parent) { + u32 n = parent.extension_header_n; + while (n > 0) { + n -= 1; + parent.extension_header_elems[n].~ExtensionHeader(); + parent.extension_header_n = n; + } +} + +// --- http.Request.extension_header.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void http::extension_header_RemoveLast(http::Request& parent) { + u64 n = parent.extension_header_n; + if (n > 0) { + n -= 1; + extension_header_qFind(parent, u64(n)).~ExtensionHeader(); + parent.extension_header_n = n; + } +} + +// --- http.Request.extension_header.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void http::extension_header_AbsReserve(http::Request& parent, int n) { + u32 old_max = parent.extension_header_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.extension_header_elems, old_max * sizeof(http::ExtensionHeader), new_max * sizeof(http::ExtensionHeader)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("http.tary_nomem field:http.Request.extension_header comment:'out of memory'"); + } + parent.extension_header_elems = (http::ExtensionHeader*)new_mem; + parent.extension_header_max = new_max; + } +} + +// --- http.Request.extension_header.Setary +// Copy contents of RHS to PARENT. +void http::extension_header_Setary(http::Request& parent, http::Request &rhs) { + extension_header_RemoveAll(parent); + int nnew = rhs.extension_header_n; + extension_header_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.extension_header_elems + i) http::ExtensionHeader(extension_header_qFind(rhs, i)); + parent.extension_header_n = i + 1; + } +} + +// --- http.Request.extension_header.Setary2 +// Copy specified array into extension_header, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void http::extension_header_Setary(http::Request& parent, const algo::aryptr &rhs) { + extension_header_RemoveAll(parent); + extension_header_Addary(parent, rhs); +} + +// --- http.Request.extension_header.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr http::extension_header_AllocNVal(http::Request& parent, int n_elems, const http::ExtensionHeader& val) { + extension_header_Reserve(parent, n_elems); + int old_n = parent.extension_header_n; + int new_n = old_n + n_elems; + http::ExtensionHeader *elems = parent.extension_header_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) http::ExtensionHeader(val); + } + parent.extension_header_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- http.Request.extension_header.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool http::extension_header_ReadStrptrMaybe(http::Request& parent, algo::strptr in_str) { + bool retval = true; + http::ExtensionHeader &elem = extension_header_Alloc(parent); + retval = http::ExtensionHeader_ReadStrptrMaybe(elem, in_str); + if (!retval) { + extension_header_RemoveLast(parent); + } + return retval; +} + +// --- http.Request.extension_header.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void http::extension_header_Insary(http::Request& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.extension_header_elems && rhs.elems < parent.extension_header_elems + parent.extension_header_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("http.tary_alias field:http.Request.extension_header comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.extension_header_elems+1))) { + FatalErrorExit("http.bad_insary field:http.Request.extension_header comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.extension_header_n - at; + extension_header_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.extension_header_elems + at + nnew + i) http::ExtensionHeader(parent.extension_header_elems[at + i]); + parent.extension_header_elems[at + i].~ExtensionHeader(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.extension_header_elems + at + i) http::ExtensionHeader(rhs[i]); + } + parent.extension_header_n += nnew; +} + +// --- http.Request..ReadFieldMaybe +bool http::Request_ReadFieldMaybe(http::Request& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + http::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case http_FieldId_method: { + retval = http::Method_ReadStrptrMaybe(parent.method, strval); + } break; + case http_FieldId_extension_method: { + retval = algo::cstring_ReadStrptrMaybe(parent.extension_method, strval); + } break; + case http_FieldId_uri: { + retval = algo::cstring_ReadStrptrMaybe(parent.uri, strval); + } break; + case http_FieldId_version: { + retval = algo::cstring_ReadStrptrMaybe(parent.version, strval); + } break; + case http_FieldId_cache_control: { + retval = algo::cstring_ReadStrptrMaybe(parent.cache_control, strval); + } break; + case http_FieldId_connection: { + retval = algo::cstring_ReadStrptrMaybe(parent.connection, strval); + } break; + case http_FieldId_date: { + retval = algo::cstring_ReadStrptrMaybe(parent.date, strval); + } break; + case http_FieldId_pragma: { + retval = algo::cstring_ReadStrptrMaybe(parent.pragma, strval); + } break; + case http_FieldId_trailer: { + retval = algo::cstring_ReadStrptrMaybe(parent.trailer, strval); + } break; + case http_FieldId_transfer_encoding: { + retval = algo::cstring_ReadStrptrMaybe(parent.transfer_encoding, strval); + } break; + case http_FieldId_upgrade: { + retval = algo::cstring_ReadStrptrMaybe(parent.upgrade, strval); + } break; + case http_FieldId_via: { + retval = algo::cstring_ReadStrptrMaybe(parent.via, strval); + } break; + case http_FieldId_warning: { + retval = algo::cstring_ReadStrptrMaybe(parent.warning, strval); + } break; + case http_FieldId_accept: { + retval = algo::cstring_ReadStrptrMaybe(parent.accept, strval); + } break; + case http_FieldId_accept_charset: { + retval = algo::cstring_ReadStrptrMaybe(parent.accept_charset, strval); + } break; + case http_FieldId_accept_encoding: { + retval = algo::cstring_ReadStrptrMaybe(parent.accept_encoding, strval); + } break; + case http_FieldId_accept_language: { + retval = algo::cstring_ReadStrptrMaybe(parent.accept_language, strval); + } break; + case http_FieldId_authorization: { + retval = algo::cstring_ReadStrptrMaybe(parent.authorization, strval); + } break; + case http_FieldId_expect: { + retval = algo::cstring_ReadStrptrMaybe(parent.expect, strval); + } break; + case http_FieldId_from: { + retval = algo::cstring_ReadStrptrMaybe(parent.from, strval); + } break; + case http_FieldId_host: { + retval = algo::cstring_ReadStrptrMaybe(parent.host, strval); + } break; + case http_FieldId_if_match: { + retval = algo::cstring_ReadStrptrMaybe(parent.if_match, strval); + } break; + case http_FieldId_if_modified_since: { + retval = algo::cstring_ReadStrptrMaybe(parent.if_modified_since, strval); + } break; + case http_FieldId_if_none_match: { + retval = algo::cstring_ReadStrptrMaybe(parent.if_none_match, strval); + } break; + case http_FieldId_if_range: { + retval = algo::cstring_ReadStrptrMaybe(parent.if_range, strval); + } break; + case http_FieldId_if_unmodified_since: { + retval = algo::cstring_ReadStrptrMaybe(parent.if_unmodified_since, strval); + } break; + case http_FieldId_max_forwards: { + retval = algo::cstring_ReadStrptrMaybe(parent.max_forwards, strval); + } break; + case http_FieldId_proxy_authorization: { + retval = algo::cstring_ReadStrptrMaybe(parent.proxy_authorization, strval); + } break; + case http_FieldId_range: { + retval = algo::cstring_ReadStrptrMaybe(parent.range, strval); + } break; + case http_FieldId_referer: { + retval = algo::cstring_ReadStrptrMaybe(parent.referer, strval); + } break; + case http_FieldId_te: { + retval = algo::cstring_ReadStrptrMaybe(parent.te, strval); + } break; + case http_FieldId_user_agent: { + retval = algo::cstring_ReadStrptrMaybe(parent.user_agent, strval); + } break; + case http_FieldId_allow: { + retval = algo::cstring_ReadStrptrMaybe(parent.allow, strval); + } break; + case http_FieldId_content_encoding: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_encoding, strval); + } break; + case http_FieldId_content_language: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_language, strval); + } break; + case http_FieldId_content_length: { + retval = i32_ReadStrptrMaybe(parent.content_length, strval); + } break; + case http_FieldId_content_location: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_location, strval); + } break; + case http_FieldId_content_md5: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_md5, strval); + } break; + case http_FieldId_content_range: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_range, strval); + } break; + case http_FieldId_content_type: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_type, strval); + } break; + case http_FieldId_expires: { + retval = algo::cstring_ReadStrptrMaybe(parent.expires, strval); + } break; + case http_FieldId_last_modified: { + retval = algo::cstring_ReadStrptrMaybe(parent.last_modified, strval); + } break; + case http_FieldId_sec_websocket_key: { + retval = algo::cstring_ReadStrptrMaybe(parent.sec_websocket_key, strval); + } break; + case http_FieldId_sec_websocket_extensions: { + retval = algo::cstring_ReadStrptrMaybe(parent.sec_websocket_extensions, strval); + } break; + case http_FieldId_sec_websocket_protocol: { + retval = algo::cstring_ReadStrptrMaybe(parent.sec_websocket_protocol, strval); + } break; + case http_FieldId_sec_websocket_version: { + retval = algo::cstring_ReadStrptrMaybe(parent.sec_websocket_version, strval); + } break; + case http_FieldId_extension_header: { + retval = extension_header_ReadStrptrMaybe(parent, strval); + } break; + case http_FieldId_body: { + retval = algo::cstring_ReadStrptrMaybe(parent.body, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- http.Request..ReadStrptrMaybe +// Read fields of http::Request from an ascii string. +// The format of the string is an ssim Tuple +bool http::Request_ReadStrptrMaybe(http::Request &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "http.Request"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Request_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- http.Request..Init +// Set all fields to initial values. +void http::Request_Init(http::Request& parent) { + parent.content_length = i32(0); + parent.extension_header_elems = 0; // (http.Request.extension_header) + parent.extension_header_n = 0; // (http.Request.extension_header) + parent.extension_header_max = 0; // (http.Request.extension_header) +} + +// --- http.Request..Uninit +void http::Request_Uninit(http::Request& parent) { + http::Request &row = parent; (void)row; + + // http.Request.extension_header.Uninit (Tary) // + // remove all elements from http.Request.extension_header + extension_header_RemoveAll(parent); + // free memory for Tary http.Request.extension_header + algo_lib::malloc_FreeMem(parent.extension_header_elems, sizeof(http::ExtensionHeader)*parent.extension_header_max); // (http.Request.extension_header) +} + +// --- http.Request..Print +// print string representation of ROW to string STR +// cfmt:http.Request.String printfmt:Tuple +void http::Request_Print(http::Request& row, algo::cstring& str) { + algo::tempstr temp; + str << "http.Request"; + + http::Method_Print(row.method, temp); + PrintAttrSpaceReset(str,"method", temp); + + algo::cstring_Print(row.extension_method, temp); + PrintAttrSpaceReset(str,"extension_method", temp); + + algo::cstring_Print(row.uri, temp); + PrintAttrSpaceReset(str,"uri", temp); + + algo::cstring_Print(row.version, temp); + PrintAttrSpaceReset(str,"version", temp); + + algo::cstring_Print(row.cache_control, temp); + PrintAttrSpaceReset(str,"cache_control", temp); + + algo::cstring_Print(row.connection, temp); + PrintAttrSpaceReset(str,"connection", temp); + + algo::cstring_Print(row.date, temp); + PrintAttrSpaceReset(str,"date", temp); + + algo::cstring_Print(row.pragma, temp); + PrintAttrSpaceReset(str,"pragma", temp); + + algo::cstring_Print(row.trailer, temp); + PrintAttrSpaceReset(str,"trailer", temp); + + algo::cstring_Print(row.transfer_encoding, temp); + PrintAttrSpaceReset(str,"transfer_encoding", temp); + + algo::cstring_Print(row.upgrade, temp); + PrintAttrSpaceReset(str,"upgrade", temp); + + algo::cstring_Print(row.via, temp); + PrintAttrSpaceReset(str,"via", temp); + + algo::cstring_Print(row.warning, temp); + PrintAttrSpaceReset(str,"warning", temp); + + algo::cstring_Print(row.accept, temp); + PrintAttrSpaceReset(str,"accept", temp); + + algo::cstring_Print(row.accept_charset, temp); + PrintAttrSpaceReset(str,"accept_charset", temp); + + algo::cstring_Print(row.accept_encoding, temp); + PrintAttrSpaceReset(str,"accept_encoding", temp); + + algo::cstring_Print(row.accept_language, temp); + PrintAttrSpaceReset(str,"accept_language", temp); + + algo::cstring_Print(row.authorization, temp); + PrintAttrSpaceReset(str,"authorization", temp); + + algo::cstring_Print(row.expect, temp); + PrintAttrSpaceReset(str,"expect", temp); + + algo::cstring_Print(row.from, temp); + PrintAttrSpaceReset(str,"from", temp); + + algo::cstring_Print(row.host, temp); + PrintAttrSpaceReset(str,"host", temp); + + algo::cstring_Print(row.if_match, temp); + PrintAttrSpaceReset(str,"if_match", temp); + + algo::cstring_Print(row.if_modified_since, temp); + PrintAttrSpaceReset(str,"if_modified_since", temp); + + algo::cstring_Print(row.if_none_match, temp); + PrintAttrSpaceReset(str,"if_none_match", temp); + + algo::cstring_Print(row.if_range, temp); + PrintAttrSpaceReset(str,"if_range", temp); + + algo::cstring_Print(row.if_unmodified_since, temp); + PrintAttrSpaceReset(str,"if_unmodified_since", temp); + + algo::cstring_Print(row.max_forwards, temp); + PrintAttrSpaceReset(str,"max_forwards", temp); + + algo::cstring_Print(row.proxy_authorization, temp); + PrintAttrSpaceReset(str,"proxy_authorization", temp); + + algo::cstring_Print(row.range, temp); + PrintAttrSpaceReset(str,"range", temp); + + algo::cstring_Print(row.referer, temp); + PrintAttrSpaceReset(str,"referer", temp); + + algo::cstring_Print(row.te, temp); + PrintAttrSpaceReset(str,"te", temp); + + algo::cstring_Print(row.user_agent, temp); + PrintAttrSpaceReset(str,"user_agent", temp); + + algo::cstring_Print(row.allow, temp); + PrintAttrSpaceReset(str,"allow", temp); + + algo::cstring_Print(row.content_encoding, temp); + PrintAttrSpaceReset(str,"content_encoding", temp); + + algo::cstring_Print(row.content_language, temp); + PrintAttrSpaceReset(str,"content_language", temp); + + i32_Print(row.content_length, temp); + PrintAttrSpaceReset(str,"content_length", temp); + + algo::cstring_Print(row.content_location, temp); + PrintAttrSpaceReset(str,"content_location", temp); + + algo::cstring_Print(row.content_md5, temp); + PrintAttrSpaceReset(str,"content_md5", temp); + + algo::cstring_Print(row.content_range, temp); + PrintAttrSpaceReset(str,"content_range", temp); + + algo::cstring_Print(row.content_type, temp); + PrintAttrSpaceReset(str,"content_type", temp); + + algo::cstring_Print(row.expires, temp); + PrintAttrSpaceReset(str,"expires", temp); + + algo::cstring_Print(row.last_modified, temp); + PrintAttrSpaceReset(str,"last_modified", temp); + + algo::cstring_Print(row.sec_websocket_key, temp); + PrintAttrSpaceReset(str,"sec_websocket_key", temp); + + algo::cstring_Print(row.sec_websocket_extensions, temp); + PrintAttrSpaceReset(str,"sec_websocket_extensions", temp); + + algo::cstring_Print(row.sec_websocket_protocol, temp); + PrintAttrSpaceReset(str,"sec_websocket_protocol", temp); + + algo::cstring_Print(row.sec_websocket_version, temp); + PrintAttrSpaceReset(str,"sec_websocket_version", temp); + + ind_beg(Request_extension_header_curs,extension_header,row) { + http::ExtensionHeader_Print(extension_header, temp); + tempstr name; + name << "extension_header."; + name << ind_curs(extension_header).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; + + algo::cstring_Print(row.body, temp); + PrintAttrSpaceReset(str,"body", temp); +} + +// --- http.Request..AssignOp +http::Request& http::Request::operator =(const http::Request &rhs) { + method = rhs.method; + extension_method = rhs.extension_method; + uri = rhs.uri; + version = rhs.version; + cache_control = rhs.cache_control; + connection = rhs.connection; + date = rhs.date; + pragma = rhs.pragma; + trailer = rhs.trailer; + transfer_encoding = rhs.transfer_encoding; + upgrade = rhs.upgrade; + via = rhs.via; + warning = rhs.warning; + accept = rhs.accept; + accept_charset = rhs.accept_charset; + accept_encoding = rhs.accept_encoding; + accept_language = rhs.accept_language; + authorization = rhs.authorization; + expect = rhs.expect; + from = rhs.from; + host = rhs.host; + if_match = rhs.if_match; + if_modified_since = rhs.if_modified_since; + if_none_match = rhs.if_none_match; + if_range = rhs.if_range; + if_unmodified_since = rhs.if_unmodified_since; + max_forwards = rhs.max_forwards; + proxy_authorization = rhs.proxy_authorization; + range = rhs.range; + referer = rhs.referer; + te = rhs.te; + user_agent = rhs.user_agent; + allow = rhs.allow; + content_encoding = rhs.content_encoding; + content_language = rhs.content_language; + content_length = rhs.content_length; + content_location = rhs.content_location; + content_md5 = rhs.content_md5; + content_range = rhs.content_range; + content_type = rhs.content_type; + expires = rhs.expires; + last_modified = rhs.last_modified; + sec_websocket_key = rhs.sec_websocket_key; + sec_websocket_extensions = rhs.sec_websocket_extensions; + sec_websocket_protocol = rhs.sec_websocket_protocol; + sec_websocket_version = rhs.sec_websocket_version; + extension_header_Setary(*this, extension_header_Getary(const_cast(rhs))); + body = rhs.body; + return *this; +} + +// --- http.Request..CopyCtor + http::Request::Request(const http::Request &rhs) + : method(rhs.method) + , extension_method(rhs.extension_method) + , uri(rhs.uri) + , version(rhs.version) + , cache_control(rhs.cache_control) + , connection(rhs.connection) + , date(rhs.date) + , pragma(rhs.pragma) + , trailer(rhs.trailer) + , transfer_encoding(rhs.transfer_encoding) + , upgrade(rhs.upgrade) + , via(rhs.via) + , warning(rhs.warning) + , accept(rhs.accept) + , accept_charset(rhs.accept_charset) + , accept_encoding(rhs.accept_encoding) + , accept_language(rhs.accept_language) + , authorization(rhs.authorization) + , expect(rhs.expect) + , from(rhs.from) + , host(rhs.host) + , if_match(rhs.if_match) + , if_modified_since(rhs.if_modified_since) + , if_none_match(rhs.if_none_match) + , if_range(rhs.if_range) + , if_unmodified_since(rhs.if_unmodified_since) + , max_forwards(rhs.max_forwards) + , proxy_authorization(rhs.proxy_authorization) + , range(rhs.range) + , referer(rhs.referer) + , te(rhs.te) + , user_agent(rhs.user_agent) + , allow(rhs.allow) + , content_encoding(rhs.content_encoding) + , content_language(rhs.content_language) + , content_length(rhs.content_length) + , content_location(rhs.content_location) + , content_md5(rhs.content_md5) + , content_range(rhs.content_range) + , content_type(rhs.content_type) + , expires(rhs.expires) + , last_modified(rhs.last_modified) + , sec_websocket_key(rhs.sec_websocket_key) + , sec_websocket_extensions(rhs.sec_websocket_extensions) + , sec_websocket_protocol(rhs.sec_websocket_protocol) + , sec_websocket_version(rhs.sec_websocket_version) + , body(rhs.body) + { + extension_header_elems = 0; // (http.Request.extension_header) + extension_header_n = 0; // (http.Request.extension_header) + extension_header_max = 0; // (http.Request.extension_header) + extension_header_Setary(*this, extension_header_Getary(const_cast(rhs))); +} + +// --- http.Response.extension_header.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr http::extension_header_Addary(http::Response& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.extension_header_elems && rhs.elems < parent.extension_header_elems + parent.extension_header_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("http.tary_alias field:http.Response.extension_header comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + extension_header_Reserve(parent, nnew); // reserve space + int at = parent.extension_header_n; + for (int i = 0; i < nnew; i++) { + new (parent.extension_header_elems + at + i) http::ExtensionHeader(rhs[i]); + parent.extension_header_n++; + } + return algo::aryptr(parent.extension_header_elems + at, nnew); +} + +// --- http.Response.extension_header.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +http::ExtensionHeader& http::extension_header_Alloc(http::Response& parent) { + extension_header_Reserve(parent, 1); + int n = parent.extension_header_n; + int at = n; + http::ExtensionHeader *elems = parent.extension_header_elems; + new (elems + at) http::ExtensionHeader(); // construct new element, default initializer + parent.extension_header_n = n+1; + return elems[at]; +} + +// --- http.Response.extension_header.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +http::ExtensionHeader& http::extension_header_AllocAt(http::Response& parent, int at) { + extension_header_Reserve(parent, 1); + int n = parent.extension_header_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("http.bad_alloc_at field:http.Response.extension_header comment:'index out of range'"); + } + http::ExtensionHeader *elems = parent.extension_header_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(http::ExtensionHeader)); + new (elems + at) http::ExtensionHeader(); // construct element, default initializer + parent.extension_header_n = n+1; + return elems[at]; +} + +// --- http.Response.extension_header.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr http::extension_header_AllocN(http::Response& parent, int n_elems) { + extension_header_Reserve(parent, n_elems); + int old_n = parent.extension_header_n; + int new_n = old_n + n_elems; + http::ExtensionHeader *elems = parent.extension_header_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) http::ExtensionHeader(); // construct new element, default initialize + } + parent.extension_header_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- http.Response.extension_header.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr http::extension_header_AllocNAt(http::Response& parent, int n_elems, int at) { + extension_header_Reserve(parent, n_elems); + int n = parent.extension_header_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("http.bad_alloc_n_at field:http.Response.extension_header comment:'index out of range'"); + } + http::ExtensionHeader *elems = parent.extension_header_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(http::ExtensionHeader)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) http::ExtensionHeader(); // construct new element, default initialize + } + parent.extension_header_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- http.Response.extension_header.Remove +// Remove item by index. If index outside of range, do nothing. +void http::extension_header_Remove(http::Response& parent, u32 i) { + u32 lim = parent.extension_header_n; + http::ExtensionHeader *elems = parent.extension_header_elems; + if (i < lim) { + elems[i].~ExtensionHeader(); // destroy element + memmove(elems + i, elems + (i + 1), sizeof(http::ExtensionHeader) * (lim - (i + 1))); + parent.extension_header_n = lim - 1; + } +} + +// --- http.Response.extension_header.RemoveAll +void http::extension_header_RemoveAll(http::Response& parent) { + u32 n = parent.extension_header_n; + while (n > 0) { + n -= 1; + parent.extension_header_elems[n].~ExtensionHeader(); + parent.extension_header_n = n; + } +} + +// --- http.Response.extension_header.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void http::extension_header_RemoveLast(http::Response& parent) { + u64 n = parent.extension_header_n; + if (n > 0) { + n -= 1; + extension_header_qFind(parent, u64(n)).~ExtensionHeader(); + parent.extension_header_n = n; + } +} + +// --- http.Response.extension_header.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void http::extension_header_AbsReserve(http::Response& parent, int n) { + u32 old_max = parent.extension_header_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.extension_header_elems, old_max * sizeof(http::ExtensionHeader), new_max * sizeof(http::ExtensionHeader)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("http.tary_nomem field:http.Response.extension_header comment:'out of memory'"); + } + parent.extension_header_elems = (http::ExtensionHeader*)new_mem; + parent.extension_header_max = new_max; + } +} + +// --- http.Response.extension_header.Setary +// Copy contents of RHS to PARENT. +void http::extension_header_Setary(http::Response& parent, http::Response &rhs) { + extension_header_RemoveAll(parent); + int nnew = rhs.extension_header_n; + extension_header_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.extension_header_elems + i) http::ExtensionHeader(extension_header_qFind(rhs, i)); + parent.extension_header_n = i + 1; + } +} + +// --- http.Response.extension_header.Setary2 +// Copy specified array into extension_header, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void http::extension_header_Setary(http::Response& parent, const algo::aryptr &rhs) { + extension_header_RemoveAll(parent); + extension_header_Addary(parent, rhs); +} + +// --- http.Response.extension_header.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr http::extension_header_AllocNVal(http::Response& parent, int n_elems, const http::ExtensionHeader& val) { + extension_header_Reserve(parent, n_elems); + int old_n = parent.extension_header_n; + int new_n = old_n + n_elems; + http::ExtensionHeader *elems = parent.extension_header_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) http::ExtensionHeader(val); + } + parent.extension_header_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- http.Response.extension_header.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool http::extension_header_ReadStrptrMaybe(http::Response& parent, algo::strptr in_str) { + bool retval = true; + http::ExtensionHeader &elem = extension_header_Alloc(parent); + retval = http::ExtensionHeader_ReadStrptrMaybe(elem, in_str); + if (!retval) { + extension_header_RemoveLast(parent); + } + return retval; +} + +// --- http.Response.extension_header.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void http::extension_header_Insary(http::Response& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.extension_header_elems && rhs.elems < parent.extension_header_elems + parent.extension_header_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("http.tary_alias field:http.Response.extension_header comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.extension_header_elems+1))) { + FatalErrorExit("http.bad_insary field:http.Response.extension_header comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.extension_header_n - at; + extension_header_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.extension_header_elems + at + nnew + i) http::ExtensionHeader(parent.extension_header_elems[at + i]); + parent.extension_header_elems[at + i].~ExtensionHeader(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.extension_header_elems + at + i) http::ExtensionHeader(rhs[i]); + } + parent.extension_header_n += nnew; +} + +// --- http.Response..ReadFieldMaybe +bool http::Response_ReadFieldMaybe(http::Response& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + http::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case http_FieldId_version: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.version, strval); + } break; + case http_FieldId_status: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.status, strval); + } break; + case http_FieldId_cache_control: { + retval = algo::cstring_ReadStrptrMaybe(parent.cache_control, strval); + } break; + case http_FieldId_connection: { + retval = algo::cstring_ReadStrptrMaybe(parent.connection, strval); + } break; + case http_FieldId_date: { + retval = algo::cstring_ReadStrptrMaybe(parent.date, strval); + } break; + case http_FieldId_pragma: { + retval = algo::cstring_ReadStrptrMaybe(parent.pragma, strval); + } break; + case http_FieldId_trailer: { + retval = algo::cstring_ReadStrptrMaybe(parent.trailer, strval); + } break; + case http_FieldId_transfer_encoding: { + retval = algo::cstring_ReadStrptrMaybe(parent.transfer_encoding, strval); + } break; + case http_FieldId_upgrade: { + retval = algo::cstring_ReadStrptrMaybe(parent.upgrade, strval); + } break; + case http_FieldId_via: { + retval = algo::cstring_ReadStrptrMaybe(parent.via, strval); + } break; + case http_FieldId_warning: { + retval = algo::cstring_ReadStrptrMaybe(parent.warning, strval); + } break; + case http_FieldId_accept_ranges: { + retval = algo::cstring_ReadStrptrMaybe(parent.accept_ranges, strval); + } break; + case http_FieldId_age: { + retval = algo::cstring_ReadStrptrMaybe(parent.age, strval); + } break; + case http_FieldId_etag: { + retval = algo::cstring_ReadStrptrMaybe(parent.etag, strval); + } break; + case http_FieldId_location: { + retval = algo::cstring_ReadStrptrMaybe(parent.location, strval); + } break; + case http_FieldId_proxy_authenticate: { + retval = algo::cstring_ReadStrptrMaybe(parent.proxy_authenticate, strval); + } break; + case http_FieldId_retry_after: { + retval = algo::cstring_ReadStrptrMaybe(parent.retry_after, strval); + } break; + case http_FieldId_server: { + retval = algo::cstring_ReadStrptrMaybe(parent.server, strval); + } break; + case http_FieldId_vary: { + retval = algo::cstring_ReadStrptrMaybe(parent.vary, strval); + } break; + case http_FieldId_www_authenticate: { + retval = algo::cstring_ReadStrptrMaybe(parent.www_authenticate, strval); + } break; + case http_FieldId_allow: { + retval = algo::cstring_ReadStrptrMaybe(parent.allow, strval); + } break; + case http_FieldId_content_encoding: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_encoding, strval); + } break; + case http_FieldId_content_language: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_language, strval); + } break; + case http_FieldId_content_length: { + retval = i32_ReadStrptrMaybe(parent.content_length, strval); + } break; + case http_FieldId_content_location: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_location, strval); + } break; + case http_FieldId_content_md5: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_md5, strval); + } break; + case http_FieldId_content_range: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_range, strval); + } break; + case http_FieldId_content_type: { + retval = algo::cstring_ReadStrptrMaybe(parent.content_type, strval); + } break; + case http_FieldId_expires: { + retval = algo::cstring_ReadStrptrMaybe(parent.expires, strval); + } break; + case http_FieldId_last_modified: { + retval = algo::cstring_ReadStrptrMaybe(parent.last_modified, strval); + } break; + case http_FieldId_sec_websocket_accept: { + retval = algo::cstring_ReadStrptrMaybe(parent.sec_websocket_accept, strval); + } break; + case http_FieldId_sec_websocket_extensions: { + retval = algo::cstring_ReadStrptrMaybe(parent.sec_websocket_extensions, strval); + } break; + case http_FieldId_sec_websocket_protocol: { + retval = algo::cstring_ReadStrptrMaybe(parent.sec_websocket_protocol, strval); + } break; + case http_FieldId_sec_websocket_version: { + retval = algo::cstring_ReadStrptrMaybe(parent.sec_websocket_version, strval); + } break; + case http_FieldId_extension_header: { + retval = extension_header_ReadStrptrMaybe(parent, strval); + } break; + case http_FieldId_body: { + retval = algo::cstring_ReadStrptrMaybe(parent.body, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- http.Response..ReadStrptrMaybe +// Read fields of http::Response from an ascii string. +// The format of the string is an ssim Tuple +bool http::Response_ReadStrptrMaybe(http::Response &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "http.Response"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Response_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- http.Response..Init +// Set all fields to initial values. +void http::Response_Init(http::Response& parent) { + parent.version = algo::strptr("HTTP/1.0"); + parent.status = algo::strptr("200 OK"); + parent.content_length = i32(0); + parent.extension_header_elems = 0; // (http.Response.extension_header) + parent.extension_header_n = 0; // (http.Response.extension_header) + parent.extension_header_max = 0; // (http.Response.extension_header) +} + +// --- http.Response..Uninit +void http::Response_Uninit(http::Response& parent) { + http::Response &row = parent; (void)row; + + // http.Response.extension_header.Uninit (Tary) // + // remove all elements from http.Response.extension_header + extension_header_RemoveAll(parent); + // free memory for Tary http.Response.extension_header + algo_lib::malloc_FreeMem(parent.extension_header_elems, sizeof(http::ExtensionHeader)*parent.extension_header_max); // (http.Response.extension_header) +} + +// --- http.Response..Print +// print string representation of ROW to string STR +// cfmt:http.Response.String printfmt:Tuple +void http::Response_Print(http::Response& row, algo::cstring& str) { + algo::tempstr temp; + str << "http.Response"; + + algo::Smallstr50_Print(row.version, temp); + PrintAttrSpaceReset(str,"version", temp); + + algo::Smallstr50_Print(row.status, temp); + PrintAttrSpaceReset(str,"status", temp); + + algo::cstring_Print(row.cache_control, temp); + PrintAttrSpaceReset(str,"cache_control", temp); + + algo::cstring_Print(row.connection, temp); + PrintAttrSpaceReset(str,"connection", temp); + + algo::cstring_Print(row.date, temp); + PrintAttrSpaceReset(str,"date", temp); + + algo::cstring_Print(row.pragma, temp); + PrintAttrSpaceReset(str,"pragma", temp); + + algo::cstring_Print(row.trailer, temp); + PrintAttrSpaceReset(str,"trailer", temp); + + algo::cstring_Print(row.transfer_encoding, temp); + PrintAttrSpaceReset(str,"transfer_encoding", temp); + + algo::cstring_Print(row.upgrade, temp); + PrintAttrSpaceReset(str,"upgrade", temp); + + algo::cstring_Print(row.via, temp); + PrintAttrSpaceReset(str,"via", temp); + + algo::cstring_Print(row.warning, temp); + PrintAttrSpaceReset(str,"warning", temp); + + algo::cstring_Print(row.accept_ranges, temp); + PrintAttrSpaceReset(str,"accept_ranges", temp); + + algo::cstring_Print(row.age, temp); + PrintAttrSpaceReset(str,"age", temp); + + algo::cstring_Print(row.etag, temp); + PrintAttrSpaceReset(str,"etag", temp); + + algo::cstring_Print(row.location, temp); + PrintAttrSpaceReset(str,"location", temp); + + algo::cstring_Print(row.proxy_authenticate, temp); + PrintAttrSpaceReset(str,"proxy_authenticate", temp); + + algo::cstring_Print(row.retry_after, temp); + PrintAttrSpaceReset(str,"retry_after", temp); + + algo::cstring_Print(row.server, temp); + PrintAttrSpaceReset(str,"server", temp); + + algo::cstring_Print(row.vary, temp); + PrintAttrSpaceReset(str,"vary", temp); + + algo::cstring_Print(row.www_authenticate, temp); + PrintAttrSpaceReset(str,"www_authenticate", temp); + + algo::cstring_Print(row.allow, temp); + PrintAttrSpaceReset(str,"allow", temp); + + algo::cstring_Print(row.content_encoding, temp); + PrintAttrSpaceReset(str,"content_encoding", temp); + + algo::cstring_Print(row.content_language, temp); + PrintAttrSpaceReset(str,"content_language", temp); + + i32_Print(row.content_length, temp); + PrintAttrSpaceReset(str,"content_length", temp); + + algo::cstring_Print(row.content_location, temp); + PrintAttrSpaceReset(str,"content_location", temp); + + algo::cstring_Print(row.content_md5, temp); + PrintAttrSpaceReset(str,"content_md5", temp); + + algo::cstring_Print(row.content_range, temp); + PrintAttrSpaceReset(str,"content_range", temp); + + algo::cstring_Print(row.content_type, temp); + PrintAttrSpaceReset(str,"content_type", temp); + + algo::cstring_Print(row.expires, temp); + PrintAttrSpaceReset(str,"expires", temp); + + algo::cstring_Print(row.last_modified, temp); + PrintAttrSpaceReset(str,"last_modified", temp); + + algo::cstring_Print(row.sec_websocket_accept, temp); + PrintAttrSpaceReset(str,"sec_websocket_accept", temp); + + algo::cstring_Print(row.sec_websocket_extensions, temp); + PrintAttrSpaceReset(str,"sec_websocket_extensions", temp); + + algo::cstring_Print(row.sec_websocket_protocol, temp); + PrintAttrSpaceReset(str,"sec_websocket_protocol", temp); + + algo::cstring_Print(row.sec_websocket_version, temp); + PrintAttrSpaceReset(str,"sec_websocket_version", temp); + + ind_beg(Response_extension_header_curs,extension_header,row) { + http::ExtensionHeader_Print(extension_header, temp); + tempstr name; + name << "extension_header."; + name << ind_curs(extension_header).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; + + algo::cstring_Print(row.body, temp); + PrintAttrSpaceReset(str,"body", temp); +} + +// --- http.Response..AssignOp +http::Response& http::Response::operator =(const http::Response &rhs) { + version = rhs.version; + status = rhs.status; + cache_control = rhs.cache_control; + connection = rhs.connection; + date = rhs.date; + pragma = rhs.pragma; + trailer = rhs.trailer; + transfer_encoding = rhs.transfer_encoding; + upgrade = rhs.upgrade; + via = rhs.via; + warning = rhs.warning; + accept_ranges = rhs.accept_ranges; + age = rhs.age; + etag = rhs.etag; + location = rhs.location; + proxy_authenticate = rhs.proxy_authenticate; + retry_after = rhs.retry_after; + server = rhs.server; + vary = rhs.vary; + www_authenticate = rhs.www_authenticate; + allow = rhs.allow; + content_encoding = rhs.content_encoding; + content_language = rhs.content_language; + content_length = rhs.content_length; + content_location = rhs.content_location; + content_md5 = rhs.content_md5; + content_range = rhs.content_range; + content_type = rhs.content_type; + expires = rhs.expires; + last_modified = rhs.last_modified; + sec_websocket_accept = rhs.sec_websocket_accept; + sec_websocket_extensions = rhs.sec_websocket_extensions; + sec_websocket_protocol = rhs.sec_websocket_protocol; + sec_websocket_version = rhs.sec_websocket_version; + extension_header_Setary(*this, extension_header_Getary(const_cast(rhs))); + body = rhs.body; + return *this; +} + +// --- http.Response..CopyCtor + http::Response::Response(const http::Response &rhs) + : version(rhs.version) + , status(rhs.status) + , cache_control(rhs.cache_control) + , connection(rhs.connection) + , date(rhs.date) + , pragma(rhs.pragma) + , trailer(rhs.trailer) + , transfer_encoding(rhs.transfer_encoding) + , upgrade(rhs.upgrade) + , via(rhs.via) + , warning(rhs.warning) + , accept_ranges(rhs.accept_ranges) + , age(rhs.age) + , etag(rhs.etag) + , location(rhs.location) + , proxy_authenticate(rhs.proxy_authenticate) + , retry_after(rhs.retry_after) + , server(rhs.server) + , vary(rhs.vary) + , www_authenticate(rhs.www_authenticate) + , allow(rhs.allow) + , content_encoding(rhs.content_encoding) + , content_language(rhs.content_language) + , content_length(rhs.content_length) + , content_location(rhs.content_location) + , content_md5(rhs.content_md5) + , content_range(rhs.content_range) + , content_type(rhs.content_type) + , expires(rhs.expires) + , last_modified(rhs.last_modified) + , sec_websocket_accept(rhs.sec_websocket_accept) + , sec_websocket_extensions(rhs.sec_websocket_extensions) + , sec_websocket_protocol(rhs.sec_websocket_protocol) + , sec_websocket_version(rhs.sec_websocket_version) + , body(rhs.body) + { + extension_header_elems = 0; // (http.Response.extension_header) + extension_header_n = 0; // (http.Response.extension_header) + extension_header_max = 0; // (http.Response.extension_header) + extension_header_Setary(*this, extension_header_Getary(const_cast(rhs))); +} + +// --- http...SizeCheck +inline static void http::SizeCheck() { +} + +// --- http...StaticCheck +void http::StaticCheck() { + algo_assert(_offset_of(http::FieldId, value) + sizeof(((http::FieldId*)0)->value) == sizeof(http::FieldId)); +} diff --git a/cpp/gen/httpdb_gen.cpp b/cpp/gen/httpdb_gen.cpp new file mode 100644 index 00000000..7c2c2ce3 --- /dev/null +++ b/cpp/gen/httpdb_gen.cpp @@ -0,0 +1,464 @@ +// +// cpp/gen/httpdb_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/httpdb_gen.h" +#include "include/gen/httpdb_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude +namespace httpdb { // gen:ns_print_proto + // func:httpdb...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- httpdb.Content..ReadFieldMaybe +bool httpdb::Content_ReadFieldMaybe(httpdb::Content& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + httpdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case httpdb_FieldId_content: { + retval = algo::Smallstr250_ReadStrptrMaybe(parent.content, strval); + } break; + case httpdb_FieldId_description: { + retval = algo::cstring_ReadStrptrMaybe(parent.description, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- httpdb.Content..ReadStrptrMaybe +// Read fields of httpdb::Content from an ascii string. +// The format of the string is an ssim Tuple +bool httpdb::Content_ReadStrptrMaybe(httpdb::Content &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "httpdb.content") || algo::StripTypeTag(in_str, "httpdb.Content"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Content_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- httpdb.Content..Print +// print string representation of ROW to string STR +// cfmt:httpdb.Content.String printfmt:Tuple +void httpdb::Content_Print(httpdb::Content& row, algo::cstring& str) { + algo::tempstr temp; + str << "httpdb.content"; + + algo::Smallstr250_Print(row.content, temp); + PrintAttrSpaceReset(str,"content", temp); + + algo::cstring_Print(row.description, temp); + PrintAttrSpaceReset(str,"description", temp); +} + +// --- httpdb.FieldId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* httpdb::value_ToCstr(const httpdb::FieldId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case httpdb_FieldId_content : ret = "content"; break; + case httpdb_FieldId_description : ret = "description"; break; + case httpdb_FieldId_header : ret = "header"; break; + case httpdb_FieldId_comment : ret = "comment"; break; + case httpdb_FieldId_method : ret = "method"; break; + case httpdb_FieldId_id : ret = "id"; break; + case httpdb_FieldId_status : ret = "status"; break; + case httpdb_FieldId_code : ret = "code"; break; + case httpdb_FieldId_reason : ret = "reason"; break; + case httpdb_FieldId_version : ret = "version"; break; + case httpdb_FieldId_value : ret = "value"; break; + } + return ret; +} + +// --- httpdb.FieldId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void httpdb::value_Print(const httpdb::FieldId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- httpdb.FieldId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool httpdb::value_SetStrptrMaybe(httpdb::FieldId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 2: { + switch (u64(algo::ReadLE16(rhs.elems))) { + case LE_STR2('i','d'): { + value_SetEnum(parent,httpdb_FieldId_id); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('c','o','d','e'): { + value_SetEnum(parent,httpdb_FieldId_code); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,httpdb_FieldId_value); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('h','e','a','d','e','r'): { + value_SetEnum(parent,httpdb_FieldId_header); ret = true; break; + } + case LE_STR6('m','e','t','h','o','d'): { + value_SetEnum(parent,httpdb_FieldId_method); ret = true; break; + } + case LE_STR6('r','e','a','s','o','n'): { + value_SetEnum(parent,httpdb_FieldId_reason); ret = true; break; + } + case LE_STR6('s','t','a','t','u','s'): { + value_SetEnum(parent,httpdb_FieldId_status); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('c','o','m','m','e','n','t'): { + value_SetEnum(parent,httpdb_FieldId_comment); ret = true; break; + } + case LE_STR7('c','o','n','t','e','n','t'): { + value_SetEnum(parent,httpdb_FieldId_content); ret = true; break; + } + case LE_STR7('v','e','r','s','i','o','n'): { + value_SetEnum(parent,httpdb_FieldId_version); ret = true; break; + } + } + break; + } + case 11: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('d','e','s','c','r','i','p','t'): { + if (memcmp(rhs.elems+8,"ion",3)==0) { value_SetEnum(parent,httpdb_FieldId_description); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- httpdb.FieldId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void httpdb::value_SetStrptr(httpdb::FieldId& parent, algo::strptr rhs, httpdb_FieldIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- httpdb.FieldId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool httpdb::value_ReadStrptrMaybe(httpdb::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- httpdb.FieldId..ReadStrptrMaybe +// Read fields of httpdb::FieldId from an ascii string. +// The format of the string is the format of the httpdb::FieldId's only field +bool httpdb::FieldId_ReadStrptrMaybe(httpdb::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- httpdb.FieldId..Print +// print string representation of ROW to string STR +// cfmt:httpdb.FieldId.String printfmt:Raw +void httpdb::FieldId_Print(httpdb::FieldId& row, algo::cstring& str) { + httpdb::value_Print(row, str); +} + +// --- httpdb.Header..ReadFieldMaybe +bool httpdb::Header_ReadFieldMaybe(httpdb::Header& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + httpdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case httpdb_FieldId_header: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.header, strval); + } break; + case httpdb_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- httpdb.Header..ReadStrptrMaybe +// Read fields of httpdb::Header from an ascii string. +// The format of the string is an ssim Tuple +bool httpdb::Header_ReadStrptrMaybe(httpdb::Header &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "httpdb.header") || algo::StripTypeTag(in_str, "httpdb.Header"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Header_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- httpdb.Header..Print +// print string representation of ROW to string STR +// cfmt:httpdb.Header.String printfmt:Tuple +void httpdb::Header_Print(httpdb::Header& row, algo::cstring& str) { + algo::tempstr temp; + str << "httpdb.header"; + + algo::Smallstr50_Print(row.header, temp); + PrintAttrSpaceReset(str,"header", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- httpdb.Method..ReadFieldMaybe +bool httpdb::Method_ReadFieldMaybe(httpdb::Method& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + httpdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case httpdb_FieldId_method: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.method, strval); + } break; + case httpdb_FieldId_id: { + retval = u8_ReadStrptrMaybe(parent.id, strval); + } break; + case httpdb_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- httpdb.Method..ReadStrptrMaybe +// Read fields of httpdb::Method from an ascii string. +// The format of the string is an ssim Tuple +bool httpdb::Method_ReadStrptrMaybe(httpdb::Method &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "httpdb.method") || algo::StripTypeTag(in_str, "httpdb.Method"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Method_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- httpdb.Method..Print +// print string representation of ROW to string STR +// cfmt:httpdb.Method.String printfmt:Tuple +void httpdb::Method_Print(httpdb::Method& row, algo::cstring& str) { + algo::tempstr temp; + str << "httpdb.method"; + + algo::Smallstr50_Print(row.method, temp); + PrintAttrSpaceReset(str,"method", temp); + + u8_Print(row.id, temp); + PrintAttrSpaceReset(str,"id", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- httpdb.Status.code.Get +u16 httpdb::code_Get(httpdb::Status& parent) { + u16 ret; + ret = 0; // default value + (void)u16_ReadStrptrMaybe(ret, algo::Pathcomp(parent.status, " LL")); + return ret; +} + +// --- httpdb.Status.code.Get2 +u16 httpdb::Status_code_Get(algo::strptr arg) { + u16 ret; + ret = 0; // default value + (void)u16_ReadStrptrMaybe(ret, algo::Pathcomp(arg, " LL")); + return ret; +} + +// --- httpdb.Status.reason.Get +algo::Smallstr50 httpdb::reason_Get(httpdb::Status& parent) { + algo::Smallstr50 ret(algo::Pathcomp(parent.status, " LR")); + return ret; +} + +// --- httpdb.Status.reason.Get2 +algo::Smallstr50 httpdb::Status_reason_Get(algo::strptr arg) { + algo::Smallstr50 ret(algo::Pathcomp(arg, " LR")); + return ret; +} + +// --- httpdb.Status..Concat_code_reason +tempstr httpdb::Status_Concat_code_reason( u16 code ,const algo::strptr& reason ) { + return tempstr() << code <<' '<< reason ; +} + +// --- httpdb.Status..ReadFieldMaybe +bool httpdb::Status_ReadFieldMaybe(httpdb::Status& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + httpdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case httpdb_FieldId_status: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.status, strval); + } break; + case httpdb_FieldId_code: { + retval = false; + } break; + case httpdb_FieldId_reason: { + retval = false; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- httpdb.Status..ReadStrptrMaybe +// Read fields of httpdb::Status from an ascii string. +// The format of the string is an ssim Tuple +bool httpdb::Status_ReadStrptrMaybe(httpdb::Status &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "httpdb.status") || algo::StripTypeTag(in_str, "httpdb.Status"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Status_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- httpdb.Status..Print +// print string representation of ROW to string STR +// cfmt:httpdb.Status.String printfmt:Tuple +void httpdb::Status_Print(httpdb::Status& row, algo::cstring& str) { + algo::tempstr temp; + str << "httpdb.status"; + + algo::Smallstr50_Print(row.status, temp); + PrintAttrSpaceReset(str,"status", temp); +} + +// --- httpdb.Version..ReadFieldMaybe +bool httpdb::Version_ReadFieldMaybe(httpdb::Version& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + httpdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case httpdb_FieldId_version: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.version, strval); + } break; + case httpdb_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- httpdb.Version..ReadStrptrMaybe +// Read fields of httpdb::Version from an ascii string. +// The format of the string is an ssim Tuple +bool httpdb::Version_ReadStrptrMaybe(httpdb::Version &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "httpdb.version") || algo::StripTypeTag(in_str, "httpdb.Version"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Version_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- httpdb.Version..Print +// print string representation of ROW to string STR +// cfmt:httpdb.Version.String printfmt:Tuple +void httpdb::Version_Print(httpdb::Version& row, algo::cstring& str) { + algo::tempstr temp; + str << "httpdb.version"; + + algo::Smallstr50_Print(row.version, temp); + PrintAttrSpaceReset(str,"version", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- httpdb...SizeCheck +inline static void httpdb::SizeCheck() { +} diff --git a/cpp/gen/ams_cat_gen.cpp b/cpp/gen/jkv_gen.cpp similarity index 63% rename from cpp/gen/ams_cat_gen.cpp rename to cpp/gen/jkv_gen.cpp index decbc840..921fe30a 100644 --- a/cpp/gen/ams_cat_gen.cpp +++ b/cpp/gen/jkv_gen.cpp @@ -1,5 +1,5 @@ // -// cpp/gen/ams_cat_gen.cpp +// cpp/gen/jkv_gen.cpp // Generated by AMC // // Copyright (C) 2008-2013 AlgoEngineering LLC @@ -23,75 +23,85 @@ #include "include/algo.h" // hard-coded include -#include "include/gen/ams_cat_gen.h" -#include "include/gen/ams_cat_gen.inl.h" +#include "include/gen/jkv_gen.h" +#include "include/gen/jkv_gen.inl.h" #include "include/gen/command_gen.h" #include "include/gen/command_gen.inl.h" -#include "include/gen/algo_lib_gen.h" -#include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" #include "include/gen/lib_json_gen.h" #include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" -#include "include/gen/lib_ams_gen.h" -#include "include/gen/lib_ams_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order -algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_json::FDb lib_json::_db; // dependency found via dev.targdep -lib_ams::FDb lib_ams::_db; // dependency found via dev.targdep -ams_cat::FDb ams_cat::_db; // dependency found via dev.targdep +algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep +jkv::FDb jkv::_db; // dependency found via dev.targdep -namespace ams_cat { -const char *ams_cat_help = -"ams_cat: Algo Messaging System sample tool\n" -"Usage: ams_cat [options]\n" +namespace jkv { +const char *jkv_help = +"jkv: JSON <-> key-value mapping tool\n" +"Usage: jkv [-file:] [[-kv:]] [options]\n" " OPTION TYPE DFLT COMMENT\n" " -in string \"data\" Input directory or filename, - for stdin\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" [file] string Filename (use - for stdin)\n" +" [kv]... string JSON Keyvals\n" +" -r Reverse (json keyvals -> JSON) mapping\n" +" -write Write the modified file back\n" +" -output enum auto Output format (auto|json|kv)\n" +" auto Automatic\n" +" json Json only\n" +" kv Key-value only\n" +" -pretty int 2 Pretty-printer (0-compact; 1=algo style; 2=jq style)\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" ; -} // namespace ams_cat -namespace ams_cat { // gen:ns_print_proto +} // namespace jkv +namespace jkv { // gen:ns_print_proto // Load statically available data into tables, register tables and database. - // func:ams_cat.FDb._db.InitReflection + // func:jkv.FDb._db.InitReflection static void InitReflection(); // find trace by row id (used to implement reflection) - // func:ams_cat.FDb.trace.RowidFind + // func:jkv.FDb.trace.RowidFind static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); // Function return 1 - // func:ams_cat.FDb.trace.N + // func:jkv.FDb.trace.N inline static i32 trace_N() __attribute__((__warn_unused_result__, nothrow, pure)); - // func:ams_cat...SizeCheck + // func:jkv...SizeCheck inline static void SizeCheck(); } // gen:ns_print_proto -// --- ams_cat.trace..Print +// --- jkv.trace..Print // print string representation of ROW to string STR -// cfmt:ams_cat.trace.String printfmt:Tuple -void ams_cat::trace_Print(ams_cat::trace& row, algo::cstring& str) { +// cfmt:jkv.trace.String printfmt:Tuple +void jkv::trace_Print(jkv::trace& row, algo::cstring& str) { algo::tempstr temp; - str << "ams_cat.trace"; + str << "jkv.trace"; (void)row;//only to avoid -Wunused-parameter } -// --- ams_cat.FDb._db.ReadArgv +// --- jkv.FDb._db.ReadArgv // Read argc,argv directly into the fields of the command line(s) // The following fields are updated: -// ams_cat.FDb.cmdline +// jkv.FDb.cmdline // algo_lib.FDb.cmdline -void ams_cat::ReadArgv() { - command::ams_cat &cmd = ams_cat::_db.cmdline; +void jkv::ReadArgv() { + command::jkv &cmd = jkv::_db.cmdline; algo_lib::Cmdline &base = algo_lib::_db.cmdline; int needarg=-1;// unknown int argidx=1;// skip process name + int anonidx=0; + algo::strptr nextanon = command::jkv_GetAnon(cmd, anonidx); tempstr err; algo::strptr attrname; bool isanon=false; // true if attrname is anonfld (positional) @@ -99,6 +109,7 @@ void ams_cat::ReadArgv() { command::FieldId attrid; bool endopt=false; int whichns=0;// which namespace does the current attribute belong to + bool file_present = false; for (; argidx < algo_lib::_db.argc; argidx++) { algo::strptr arg = algo_lib::_db.argv[argidx]; algo::strptr attrval; @@ -137,7 +148,7 @@ void ams_cat::ReadArgv() { whichns=1; // look up parameter information in this namespace (needarg will be -1 if lookup fails) if (command::FieldId_ReadStrptrMaybe(attrid,attrname)) { - needarg = command::ams_cat_NArgs(attrid,dfltval,&isanon); + needarg = command::jkv_NArgs(attrid,dfltval,&isanon); } } if (attrval == "" && dfltval != "") { @@ -145,15 +156,29 @@ void ams_cat::ReadArgv() { haveval=true; } if (needarg<0) { - err<<"ams_cat: unknown option "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { + if (!file_present) { + err << "jkv: Missing value for required argument -file (see -help)" << eol; + doexit = true; + } } - // dmmeta.floadtuples:ams_cat.FDb.cmdline + // dmmeta.floadtuples:jkv.FDb.cmdline if (!dohelp && err=="") { algo_lib::ResetErrtext(); - if (!ams_cat::LoadTuplesMaybe(cmd.in,true)) { - err << "ams_cat.load_input "<value) == sizeof(ams_cat::FieldId)); +// --- jkv...StaticCheck +void jkv::StaticCheck() { + algo_assert(_offset_of(jkv::FieldId, value) + sizeof(((jkv::FieldId*)0)->value) == sizeof(jkv::FieldId)); } -// --- ams_cat...main +// --- jkv...main int main(int argc, char **argv) { try { - algo_lib::FDb_Init(); lib_json::FDb_Init(); - lib_ams::FDb_Init(); - ams_cat::FDb_Init(); + algo_lib::FDb_Init(); + jkv::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); - ams_cat::ReadArgv(); // dmmeta.main:ams_cat - ams_cat::Main(); // user-defined main + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock + jkv::ReadArgv(); // dmmeta.main:jkv + jkv::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { - prerr("ams_cat.error " << x); // there may be additional hints in DetachBadTags + prerr("jkv.error " << x); // there may be additional hints in DetachBadTags algo_lib::_db.exit_code = 1; } if (algo_lib::_db.last_signal) { algo_lib::_db.exit_code = 1; } try { - ams_cat::FDb_Uninit(); - lib_ams::FDb_Uninit(); - lib_json::FDb_Uninit(); + jkv::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; @@ -480,7 +511,7 @@ int main(int argc, char **argv) { return algo_lib::_db.exit_code; } -// --- ams_cat...WinMain +// --- jkv...WinMain #if defined(WIN32) int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int) { return main(__argc,__argv); diff --git a/cpp/gen/kafka_gen.cpp b/cpp/gen/kafka_gen.cpp new file mode 100644 index 00000000..407bf9bd --- /dev/null +++ b/cpp/gen/kafka_gen.cpp @@ -0,0 +1,3205 @@ +// +// cpp/gen/kafka_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/kafka_gen.h" +#include "include/gen/kafka_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude +namespace kafka { // gen:ns_print_proto + // func:kafka.AclOperations.UNKNOWN.ReadStrptrMaybe + inline static bool UNKNOWN_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.ANY.ReadStrptrMaybe + inline static bool ANY_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.ALL.ReadStrptrMaybe + inline static bool ALL_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.READ.ReadStrptrMaybe + inline static bool READ_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.WRITE.ReadStrptrMaybe + inline static bool WRITE_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.CREATE.ReadStrptrMaybe + inline static bool CREATE_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.DELETE.ReadStrptrMaybe + inline static bool DELETE_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.ALTER.ReadStrptrMaybe + inline static bool ALTER_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.DESCRIBE.ReadStrptrMaybe + inline static bool DESCRIBE_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.CLUSTER_ACTION.ReadStrptrMaybe + inline static bool CLUSTER_ACTION_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.DESCRIBE_CONFIGS.ReadStrptrMaybe + inline static bool DESCRIBE_CONFIGS_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.ALTER_CONFIGS.ReadStrptrMaybe + inline static bool ALTER_CONFIGS_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.IDEMPOTENT_WRITE.ReadStrptrMaybe + inline static bool IDEMPOTENT_WRITE_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.CREATE_TOKENS.ReadStrptrMaybe + inline static bool CREATE_TOKENS_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.DESCRIBE_TOKENS.ReadStrptrMaybe + inline static bool DESCRIBE_TOKENS_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.AclOperations.OMITTED.ReadStrptrMaybe + inline static bool OMITTED_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka.Record.key.ReadStrptrMaybe + inline static bool key_ReadStrptrMaybe(kafka::Record &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:kafka...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- kafka.AclOperationType.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::AclOperationType& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_AclOperationType_UNKNOWN: ret = "UNKNOWN"; break; + case kafka_AclOperationType_ANY : ret = "ANY"; break; + case kafka_AclOperationType_ALL : ret = "ALL"; break; + case kafka_AclOperationType_READ : ret = "READ"; break; + case kafka_AclOperationType_WRITE : ret = "WRITE"; break; + case kafka_AclOperationType_CREATE : ret = "CREATE"; break; + case kafka_AclOperationType_DELETE : ret = "DELETE"; break; + case kafka_AclOperationType_ALTER : ret = "ALTER"; break; + case kafka_AclOperationType_DESCRIBE: ret = "DESCRIBE"; break; + case kafka_AclOperationType_CLUSTER_ACTION: ret = "CLUSTER_ACTION"; break; + case kafka_AclOperationType_DESCRIBE_CONFIGS: ret = "DESCRIBE_CONFIGS"; break; + case kafka_AclOperationType_ALTER_CONFIGS: ret = "ALTER_CONFIGS"; break; + case kafka_AclOperationType_IDEMPOTENT_WRITE: ret = "IDEMPOTENT_WRITE"; break; + case kafka_AclOperationType_CREATE_TOKENS: ret = "CREATE_TOKENS"; break; + case kafka_AclOperationType_DESCRIBE_TOKENS: ret = "DESCRIBE_TOKENS"; break; + } + return ret; +} + +// --- kafka.AclOperationType.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::AclOperationType& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.AclOperationType.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::AclOperationType& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('A','L','L'): { + value_SetEnum(parent,kafka_AclOperationType_ALL); ret = true; break; + } + case LE_STR3('A','N','Y'): { + value_SetEnum(parent,kafka_AclOperationType_ANY); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('R','E','A','D'): { + value_SetEnum(parent,kafka_AclOperationType_READ); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('A','L','T','E','R'): { + value_SetEnum(parent,kafka_AclOperationType_ALTER); ret = true; break; + } + case LE_STR5('W','R','I','T','E'): { + value_SetEnum(parent,kafka_AclOperationType_WRITE); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('C','R','E','A','T','E'): { + value_SetEnum(parent,kafka_AclOperationType_CREATE); ret = true; break; + } + case LE_STR6('D','E','L','E','T','E'): { + value_SetEnum(parent,kafka_AclOperationType_DELETE); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('U','N','K','N','O','W','N'): { + value_SetEnum(parent,kafka_AclOperationType_UNKNOWN); ret = true; break; + } + } + break; + } + case 8: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('D','E','S','C','R','I','B','E'): { + value_SetEnum(parent,kafka_AclOperationType_DESCRIBE); ret = true; break; + } + } + break; + } + case 13: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('A','L','T','E','R','_','C','O'): { + if (memcmp(rhs.elems+8,"NFIGS",5)==0) { value_SetEnum(parent,kafka_AclOperationType_ALTER_CONFIGS); ret = true; break; } + break; + } + case LE_STR8('C','R','E','A','T','E','_','T'): { + if (memcmp(rhs.elems+8,"OKENS",5)==0) { value_SetEnum(parent,kafka_AclOperationType_CREATE_TOKENS); ret = true; break; } + break; + } + } + break; + } + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('C','L','U','S','T','E','R','_'): { + if (memcmp(rhs.elems+8,"ACTION",6)==0) { value_SetEnum(parent,kafka_AclOperationType_CLUSTER_ACTION); ret = true; break; } + break; + } + } + break; + } + case 15: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('D','E','S','C','R','I','B','E'): { + if (memcmp(rhs.elems+8,"_TOKENS",7)==0) { value_SetEnum(parent,kafka_AclOperationType_DESCRIBE_TOKENS); ret = true; break; } + break; + } + } + break; + } + case 16: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('D','E','S','C','R','I','B','E'): { + if (memcmp(rhs.elems+8,"_CONFIGS",8)==0) { value_SetEnum(parent,kafka_AclOperationType_DESCRIBE_CONFIGS); ret = true; break; } + break; + } + case LE_STR8('I','D','E','M','P','O','T','E'): { + if (memcmp(rhs.elems+8,"NT_WRITE",8)==0) { value_SetEnum(parent,kafka_AclOperationType_IDEMPOTENT_WRITE); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- kafka.AclOperationType.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::AclOperationType& parent, algo::strptr rhs, kafka_AclOperationTypeEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.AclOperationType.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::AclOperationType& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.AclOperationType..ReadStrptrMaybe +// Read fields of kafka::AclOperationType from an ascii string. +// The format of the string is the format of the kafka::AclOperationType's only field +bool kafka::AclOperationType_ReadStrptrMaybe(kafka::AclOperationType &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.AclOperationType..Print +// print string representation of ROW to string STR +// cfmt:kafka.AclOperationType.String printfmt:Raw +void kafka::AclOperationType_Print(kafka::AclOperationType& row, algo::cstring& str) { + kafka::value_Print(row, str); +} + +// --- kafka.AclOperations.UNKNOWN.ReadStrptrMaybe +inline static bool kafka::UNKNOWN_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool UNKNOWN_tmp; + retval = bool_ReadStrptrMaybe(UNKNOWN_tmp, in_str); + if (retval) { + UNKNOWN_Set(parent, UNKNOWN_tmp); + } + return retval; +} + +// --- kafka.AclOperations.ANY.ReadStrptrMaybe +inline static bool kafka::ANY_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool ANY_tmp; + retval = bool_ReadStrptrMaybe(ANY_tmp, in_str); + if (retval) { + ANY_Set(parent, ANY_tmp); + } + return retval; +} + +// --- kafka.AclOperations.ALL.ReadStrptrMaybe +inline static bool kafka::ALL_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool ALL_tmp; + retval = bool_ReadStrptrMaybe(ALL_tmp, in_str); + if (retval) { + ALL_Set(parent, ALL_tmp); + } + return retval; +} + +// --- kafka.AclOperations.READ.ReadStrptrMaybe +inline static bool kafka::READ_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool READ_tmp; + retval = bool_ReadStrptrMaybe(READ_tmp, in_str); + if (retval) { + READ_Set(parent, READ_tmp); + } + return retval; +} + +// --- kafka.AclOperations.WRITE.ReadStrptrMaybe +inline static bool kafka::WRITE_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool WRITE_tmp; + retval = bool_ReadStrptrMaybe(WRITE_tmp, in_str); + if (retval) { + WRITE_Set(parent, WRITE_tmp); + } + return retval; +} + +// --- kafka.AclOperations.CREATE.ReadStrptrMaybe +inline static bool kafka::CREATE_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool CREATE_tmp; + retval = bool_ReadStrptrMaybe(CREATE_tmp, in_str); + if (retval) { + CREATE_Set(parent, CREATE_tmp); + } + return retval; +} + +// --- kafka.AclOperations.DELETE.ReadStrptrMaybe +inline static bool kafka::DELETE_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool DELETE_tmp; + retval = bool_ReadStrptrMaybe(DELETE_tmp, in_str); + if (retval) { + DELETE_Set(parent, DELETE_tmp); + } + return retval; +} + +// --- kafka.AclOperations.ALTER.ReadStrptrMaybe +inline static bool kafka::ALTER_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool ALTER_tmp; + retval = bool_ReadStrptrMaybe(ALTER_tmp, in_str); + if (retval) { + ALTER_Set(parent, ALTER_tmp); + } + return retval; +} + +// --- kafka.AclOperations.DESCRIBE.ReadStrptrMaybe +inline static bool kafka::DESCRIBE_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool DESCRIBE_tmp; + retval = bool_ReadStrptrMaybe(DESCRIBE_tmp, in_str); + if (retval) { + DESCRIBE_Set(parent, DESCRIBE_tmp); + } + return retval; +} + +// --- kafka.AclOperations.CLUSTER_ACTION.ReadStrptrMaybe +inline static bool kafka::CLUSTER_ACTION_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool CLUSTER_ACTION_tmp; + retval = bool_ReadStrptrMaybe(CLUSTER_ACTION_tmp, in_str); + if (retval) { + CLUSTER_ACTION_Set(parent, CLUSTER_ACTION_tmp); + } + return retval; +} + +// --- kafka.AclOperations.DESCRIBE_CONFIGS.ReadStrptrMaybe +inline static bool kafka::DESCRIBE_CONFIGS_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool DESCRIBE_CONFIGS_tmp; + retval = bool_ReadStrptrMaybe(DESCRIBE_CONFIGS_tmp, in_str); + if (retval) { + DESCRIBE_CONFIGS_Set(parent, DESCRIBE_CONFIGS_tmp); + } + return retval; +} + +// --- kafka.AclOperations.ALTER_CONFIGS.ReadStrptrMaybe +inline static bool kafka::ALTER_CONFIGS_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool ALTER_CONFIGS_tmp; + retval = bool_ReadStrptrMaybe(ALTER_CONFIGS_tmp, in_str); + if (retval) { + ALTER_CONFIGS_Set(parent, ALTER_CONFIGS_tmp); + } + return retval; +} + +// --- kafka.AclOperations.IDEMPOTENT_WRITE.ReadStrptrMaybe +inline static bool kafka::IDEMPOTENT_WRITE_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool IDEMPOTENT_WRITE_tmp; + retval = bool_ReadStrptrMaybe(IDEMPOTENT_WRITE_tmp, in_str); + if (retval) { + IDEMPOTENT_WRITE_Set(parent, IDEMPOTENT_WRITE_tmp); + } + return retval; +} + +// --- kafka.AclOperations.CREATE_TOKENS.ReadStrptrMaybe +inline static bool kafka::CREATE_TOKENS_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool CREATE_TOKENS_tmp; + retval = bool_ReadStrptrMaybe(CREATE_TOKENS_tmp, in_str); + if (retval) { + CREATE_TOKENS_Set(parent, CREATE_TOKENS_tmp); + } + return retval; +} + +// --- kafka.AclOperations.DESCRIBE_TOKENS.ReadStrptrMaybe +inline static bool kafka::DESCRIBE_TOKENS_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool DESCRIBE_TOKENS_tmp; + retval = bool_ReadStrptrMaybe(DESCRIBE_TOKENS_tmp, in_str); + if (retval) { + DESCRIBE_TOKENS_Set(parent, DESCRIBE_TOKENS_tmp); + } + return retval; +} + +// --- kafka.AclOperations.OMITTED.ReadStrptrMaybe +inline static bool kafka::OMITTED_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + bool OMITTED_tmp; + retval = bool_ReadStrptrMaybe(OMITTED_tmp, in_str); + if (retval) { + OMITTED_Set(parent, OMITTED_tmp); + } + return retval; +} + +// --- kafka.AclOperations..ReadFieldMaybe +bool kafka::AclOperations_ReadFieldMaybe(kafka::AclOperations& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + kafka::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case kafka_FieldId_value: { + retval = i32_ReadStrptrMaybe(parent.value, strval); + } break; + case kafka_FieldId_UNKNOWN: { + retval = UNKNOWN_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_ANY: { + retval = ANY_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_ALL: { + retval = ALL_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_READ: { + retval = READ_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_WRITE: { + retval = WRITE_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_CREATE: { + retval = CREATE_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_DELETE: { + retval = DELETE_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_ALTER: { + retval = ALTER_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_DESCRIBE: { + retval = DESCRIBE_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_CLUSTER_ACTION: { + retval = CLUSTER_ACTION_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_DESCRIBE_CONFIGS: { + retval = DESCRIBE_CONFIGS_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_ALTER_CONFIGS: { + retval = ALTER_CONFIGS_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_IDEMPOTENT_WRITE: { + retval = IDEMPOTENT_WRITE_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_CREATE_TOKENS: { + retval = CREATE_TOKENS_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_DESCRIBE_TOKENS: { + retval = DESCRIBE_TOKENS_ReadStrptrMaybe(parent, strval); + } break; + case kafka_FieldId_OMITTED: { + retval = OMITTED_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- kafka.AclOperations..ReadStrptrMaybe +// Read fields of kafka::AclOperations from an ascii string. +bool kafka::AclOperations_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) { + bool retval = true; + // Clear affected bits first) + UNKNOWN_Set(parent, false); + ANY_Set(parent, false); + ALL_Set(parent, false); + READ_Set(parent, false); + WRITE_Set(parent, false); + CREATE_Set(parent, false); + DELETE_Set(parent, false); + ALTER_Set(parent, false); + DESCRIBE_Set(parent, false); + CLUSTER_ACTION_Set(parent, false); + DESCRIBE_CONFIGS_Set(parent, false); + ALTER_CONFIGS_Set(parent, false); + IDEMPOTENT_WRITE_Set(parent, false); + CREATE_TOKENS_Set(parent, false); + DESCRIBE_TOKENS_Set(parent, false); + OMITTED_Set(parent, false); + // Read ','-separated list of bools + while (ch_N(in_str)) { + strptr field_name; + algo::NextSep(in_str,',',field_name); + field_name = algo::Trimmed(field_name); + if (ch_N(field_name)) { + kafka::FieldId field_id; + bool ok = kafka::value_SetStrptrMaybe(field_id,field_name); + if (ok) { + switch (field_id) { + case kafka_FieldId_UNKNOWN: { + UNKNOWN_Set(parent, true); + } break; + case kafka_FieldId_ANY: { + ANY_Set(parent, true); + } break; + case kafka_FieldId_ALL: { + ALL_Set(parent, true); + } break; + case kafka_FieldId_READ: { + READ_Set(parent, true); + } break; + case kafka_FieldId_WRITE: { + WRITE_Set(parent, true); + } break; + case kafka_FieldId_CREATE: { + CREATE_Set(parent, true); + } break; + case kafka_FieldId_DELETE: { + DELETE_Set(parent, true); + } break; + case kafka_FieldId_ALTER: { + ALTER_Set(parent, true); + } break; + case kafka_FieldId_DESCRIBE: { + DESCRIBE_Set(parent, true); + } break; + case kafka_FieldId_CLUSTER_ACTION: { + CLUSTER_ACTION_Set(parent, true); + } break; + case kafka_FieldId_DESCRIBE_CONFIGS: { + DESCRIBE_CONFIGS_Set(parent, true); + } break; + case kafka_FieldId_ALTER_CONFIGS: { + ALTER_CONFIGS_Set(parent, true); + } break; + case kafka_FieldId_IDEMPOTENT_WRITE: { + IDEMPOTENT_WRITE_Set(parent, true); + } break; + case kafka_FieldId_CREATE_TOKENS: { + CREATE_TOKENS_Set(parent, true); + } break; + case kafka_FieldId_DESCRIBE_TOKENS: { + DESCRIBE_TOKENS_Set(parent, true); + } break; + case kafka_FieldId_OMITTED: { + OMITTED_Set(parent, true); + } break; + default: ok = false; break; + } + } + if (!ok) { + algo_lib::AppendErrtext("bitfld",field_name); + retval = false; + } + } + } + return retval; +} + +// --- kafka.AclOperations..Init +// Set all fields to initial values. +void kafka::AclOperations_Init(kafka::AclOperations& parent) { + parent.value = i32(0); +} + +// --- kafka.AclOperations..Print +// print string representation of ROW to string STR +// cfmt:kafka.AclOperations.String printfmt:Bitset +void kafka::AclOperations_Print(kafka::AclOperations row, algo::cstring& str) { + algo::ListSep ls(","); + if (UNKNOWN_Get(row)) { + str << ls << "UNKNOWN"; + } + if (ANY_Get(row)) { + str << ls << "ANY"; + } + if (ALL_Get(row)) { + str << ls << "ALL"; + } + if (READ_Get(row)) { + str << ls << "READ"; + } + if (WRITE_Get(row)) { + str << ls << "WRITE"; + } + if (CREATE_Get(row)) { + str << ls << "CREATE"; + } + if (DELETE_Get(row)) { + str << ls << "DELETE"; + } + if (ALTER_Get(row)) { + str << ls << "ALTER"; + } + if (DESCRIBE_Get(row)) { + str << ls << "DESCRIBE"; + } + if (CLUSTER_ACTION_Get(row)) { + str << ls << "CLUSTER_ACTION"; + } + if (DESCRIBE_CONFIGS_Get(row)) { + str << ls << "DESCRIBE_CONFIGS"; + } + if (ALTER_CONFIGS_Get(row)) { + str << ls << "ALTER_CONFIGS"; + } + if (IDEMPOTENT_WRITE_Get(row)) { + str << ls << "IDEMPOTENT_WRITE"; + } + if (CREATE_TOKENS_Get(row)) { + str << ls << "CREATE_TOKENS"; + } + if (DESCRIBE_TOKENS_Get(row)) { + str << ls << "DESCRIBE_TOKENS"; + } + if (OMITTED_Get(row)) { + str << ls << "OMITTED"; + } +} + +// --- kafka.AclOperations..GetAnon +algo::strptr kafka::AclOperations_GetAnon(kafka::AclOperations &parent, i32 idx) { + (void)parent;//only to avoid -Wunused-parameter + switch(idx) { + case(0): return strptr("value", 5); + default: return algo::strptr(); + } +} + +// --- kafka.AclPermissionType.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::AclPermissionType& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_AclPermissionType_UNKNOWN: ret = "UNKNOWN"; break; + case kafka_AclPermissionType_ANY : ret = "ANY"; break; + case kafka_AclPermissionType_DENY : ret = "DENY"; break; + case kafka_AclPermissionType_ALLOW : ret = "ALLOW"; break; + } + return ret; +} + +// --- kafka.AclPermissionType.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::AclPermissionType& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.AclPermissionType.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::AclPermissionType& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('A','N','Y'): { + value_SetEnum(parent,kafka_AclPermissionType_ANY); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('D','E','N','Y'): { + value_SetEnum(parent,kafka_AclPermissionType_DENY); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('A','L','L','O','W'): { + value_SetEnum(parent,kafka_AclPermissionType_ALLOW); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('U','N','K','N','O','W','N'): { + value_SetEnum(parent,kafka_AclPermissionType_UNKNOWN); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- kafka.AclPermissionType.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::AclPermissionType& parent, algo::strptr rhs, kafka_AclPermissionTypeEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.AclPermissionType.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::AclPermissionType& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.AclPermissionType..ReadStrptrMaybe +// Read fields of kafka::AclPermissionType from an ascii string. +// The format of the string is the format of the kafka::AclPermissionType's only field +bool kafka::AclPermissionType_ReadStrptrMaybe(kafka::AclPermissionType &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.AclPermissionType..Print +// print string representation of ROW to string STR +// cfmt:kafka.AclPermissionType.String printfmt:Raw +void kafka::AclPermissionType_Print(kafka::AclPermissionType& row, algo::cstring& str) { + kafka::value_Print(row, str); +} + +// --- kafka.CompressionType.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::CompressionType& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_CompressionType_no_compression: ret = "no_compression"; break; + case kafka_CompressionType_gzip : ret = "gzip"; break; + case kafka_CompressionType_snappy : ret = "snappy"; break; + case kafka_CompressionType_lz4 : ret = "lz4"; break; + case kafka_CompressionType_zstd : ret = "zstd"; break; + } + return ret; +} + +// --- kafka.CompressionType.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::CompressionType& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.CompressionType.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::CompressionType& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('l','z','4'): { + value_SetEnum(parent,kafka_CompressionType_lz4); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('g','z','i','p'): { + value_SetEnum(parent,kafka_CompressionType_gzip); ret = true; break; + } + case LE_STR4('z','s','t','d'): { + value_SetEnum(parent,kafka_CompressionType_zstd); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('s','n','a','p','p','y'): { + value_SetEnum(parent,kafka_CompressionType_snappy); ret = true; break; + } + } + break; + } + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('n','o','_','c','o','m','p','r'): { + if (memcmp(rhs.elems+8,"ession",6)==0) { value_SetEnum(parent,kafka_CompressionType_no_compression); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- kafka.CompressionType.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::CompressionType& parent, algo::strptr rhs, kafka_CompressionTypeEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.CompressionType.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::CompressionType& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.CompressionType..ReadStrptrMaybe +// Read fields of kafka::CompressionType from an ascii string. +// The format of the string is the format of the kafka::CompressionType's only field +bool kafka::CompressionType_ReadStrptrMaybe(kafka::CompressionType &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.CompressionType..Print +// print string representation of ROW to string STR +// cfmt:kafka.CompressionType.String printfmt:Raw +void kafka::CompressionType_Print(kafka::CompressionType& row, algo::cstring& str) { + kafka::value_Print(row, str); +} + +// --- kafka.ConfigSource.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::ConfigSource& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_ConfigSource_UNKNOWN : ret = "UNKNOWN"; break; + case kafka_ConfigSource_TOPIC_CONFIG: ret = "TOPIC_CONFIG"; break; + case kafka_ConfigSource_DYNAMIC_BROKER_CONFIG: ret = "DYNAMIC_BROKER_CONFIG"; break; + case kafka_ConfigSource_DYNAMIC_DEFAULT_BROKER_CONFIG: ret = "DYNAMIC_DEFAULT_BROKER_CONFIG"; break; + case kafka_ConfigSource_STATIC_BROKER_CONFIG: ret = "STATIC_BROKER_CONFIG"; break; + case kafka_ConfigSource_DEFAULT_CONFIG: ret = "DEFAULT_CONFIG"; break; + case kafka_ConfigSource_DYNAMIC_BROKER_LOGGER_CONFIG: ret = "DYNAMIC_BROKER_LOGGER_CONFIG"; break; + case kafka_ConfigSource_CLIENT_METRICS_CONFIG: ret = "CLIENT_METRICS_CONFIG"; break; + case kafka_ConfigSource_GROUP_CONFIG: ret = "GROUP_CONFIG"; break; + } + return ret; +} + +// --- kafka.ConfigSource.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::ConfigSource& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.ConfigSource.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::ConfigSource& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('U','N','K','N','O','W','N'): { + value_SetEnum(parent,kafka_ConfigSource_UNKNOWN); ret = true; break; + } + } + break; + } + case 12: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('G','R','O','U','P','_','C','O'): { + if (memcmp(rhs.elems+8,"NFIG",4)==0) { value_SetEnum(parent,kafka_ConfigSource_GROUP_CONFIG); ret = true; break; } + break; + } + case LE_STR8('T','O','P','I','C','_','C','O'): { + if (memcmp(rhs.elems+8,"NFIG",4)==0) { value_SetEnum(parent,kafka_ConfigSource_TOPIC_CONFIG); ret = true; break; } + break; + } + } + break; + } + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('D','E','F','A','U','L','T','_'): { + if (memcmp(rhs.elems+8,"CONFIG",6)==0) { value_SetEnum(parent,kafka_ConfigSource_DEFAULT_CONFIG); ret = true; break; } + break; + } + } + break; + } + case 20: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('S','T','A','T','I','C','_','B'): { + if (memcmp(rhs.elems+8,"ROKER_CONFIG",12)==0) { value_SetEnum(parent,kafka_ConfigSource_STATIC_BROKER_CONFIG); ret = true; break; } + break; + } + } + break; + } + case 21: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('C','L','I','E','N','T','_','M'): { + if (memcmp(rhs.elems+8,"ETRICS_CONFIG",13)==0) { value_SetEnum(parent,kafka_ConfigSource_CLIENT_METRICS_CONFIG); ret = true; break; } + break; + } + case LE_STR8('D','Y','N','A','M','I','C','_'): { + if (memcmp(rhs.elems+8,"BROKER_CONFIG",13)==0) { value_SetEnum(parent,kafka_ConfigSource_DYNAMIC_BROKER_CONFIG); ret = true; break; } + break; + } + } + break; + } + case 28: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('D','Y','N','A','M','I','C','_'): { + if (memcmp(rhs.elems+8,"BROKER_LOGGER_CONFIG",20)==0) { value_SetEnum(parent,kafka_ConfigSource_DYNAMIC_BROKER_LOGGER_CONFIG); ret = true; break; } + break; + } + } + break; + } + case 29: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('D','Y','N','A','M','I','C','_'): { + if (memcmp(rhs.elems+8,"DEFAULT_BROKER_CONFIG",21)==0) { value_SetEnum(parent,kafka_ConfigSource_DYNAMIC_DEFAULT_BROKER_CONFIG); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- kafka.ConfigSource.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::ConfigSource& parent, algo::strptr rhs, kafka_ConfigSourceEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.ConfigSource.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::ConfigSource& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.ConfigSource..ReadStrptrMaybe +// Read fields of kafka::ConfigSource from an ascii string. +// The format of the string is the format of the kafka::ConfigSource's only field +bool kafka::ConfigSource_ReadStrptrMaybe(kafka::ConfigSource &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.ConfigSource..Print +// print string representation of ROW to string STR +// cfmt:kafka.ConfigSource.String printfmt:Raw +void kafka::ConfigSource_Print(kafka::ConfigSource& row, algo::cstring& str) { + kafka::value_Print(row, str); +} + +// --- kafka.ConfigType.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::ConfigType& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_ConfigType_UNKNOWN : ret = "UNKNOWN"; break; + case kafka_ConfigType_BOOLEAN : ret = "BOOLEAN"; break; + case kafka_ConfigType_STRING : ret = "STRING"; break; + case kafka_ConfigType_INT : ret = "INT"; break; + case kafka_ConfigType_SHORT : ret = "SHORT"; break; + case kafka_ConfigType_LONG : ret = "LONG"; break; + case kafka_ConfigType_DOUBLE : ret = "DOUBLE"; break; + case kafka_ConfigType_LIST : ret = "LIST"; break; + case kafka_ConfigType_CLASS : ret = "CLASS"; break; + case kafka_ConfigType_PASSWORD : ret = "PASSWORD"; break; + } + return ret; +} + +// --- kafka.ConfigType.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::ConfigType& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.ConfigType.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::ConfigType& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('I','N','T'): { + value_SetEnum(parent,kafka_ConfigType_INT); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('L','I','S','T'): { + value_SetEnum(parent,kafka_ConfigType_LIST); ret = true; break; + } + case LE_STR4('L','O','N','G'): { + value_SetEnum(parent,kafka_ConfigType_LONG); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('C','L','A','S','S'): { + value_SetEnum(parent,kafka_ConfigType_CLASS); ret = true; break; + } + case LE_STR5('S','H','O','R','T'): { + value_SetEnum(parent,kafka_ConfigType_SHORT); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('D','O','U','B','L','E'): { + value_SetEnum(parent,kafka_ConfigType_DOUBLE); ret = true; break; + } + case LE_STR6('S','T','R','I','N','G'): { + value_SetEnum(parent,kafka_ConfigType_STRING); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('B','O','O','L','E','A','N'): { + value_SetEnum(parent,kafka_ConfigType_BOOLEAN); ret = true; break; + } + case LE_STR7('U','N','K','N','O','W','N'): { + value_SetEnum(parent,kafka_ConfigType_UNKNOWN); ret = true; break; + } + } + break; + } + case 8: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('P','A','S','S','W','O','R','D'): { + value_SetEnum(parent,kafka_ConfigType_PASSWORD); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- kafka.ConfigType.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::ConfigType& parent, algo::strptr rhs, kafka_ConfigTypeEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.ConfigType.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::ConfigType& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.ConfigType..ReadStrptrMaybe +// Read fields of kafka::ConfigType from an ascii string. +// The format of the string is the format of the kafka::ConfigType's only field +bool kafka::ConfigType_ReadStrptrMaybe(kafka::ConfigType &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.ConfigType..Print +// print string representation of ROW to string STR +// cfmt:kafka.ConfigType.String printfmt:Raw +void kafka::ConfigType_Print(kafka::ConfigType& row, algo::cstring& str) { + kafka::value_Print(row, str); +} + +// --- kafka.Error..ReadStrptrMaybe +// Read fields of kafka::Error from an ascii string. +// The format of the string is the format of the kafka::Error's only field +bool kafka::Error_ReadStrptrMaybe(kafka::Error &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && i16_ReadStrptrMaybe(parent.value, in_str); + return retval; +} + +// --- kafka.Error..Print +// print string representation of ROW to string STR +// cfmt:kafka.Error.String printfmt:Raw +void kafka::Error_Print(kafka::Error& row, algo::cstring& str) { + i16_Print(row.value, str); +} + +// --- kafka.FieldId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::FieldId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_FieldId_value : ret = "value"; break; + case kafka_FieldId_UNKNOWN : ret = "UNKNOWN"; break; + case kafka_FieldId_ANY : ret = "ANY"; break; + case kafka_FieldId_ALL : ret = "ALL"; break; + case kafka_FieldId_READ : ret = "READ"; break; + case kafka_FieldId_WRITE : ret = "WRITE"; break; + case kafka_FieldId_CREATE : ret = "CREATE"; break; + case kafka_FieldId_DELETE : ret = "DELETE"; break; + case kafka_FieldId_ALTER : ret = "ALTER"; break; + case kafka_FieldId_DESCRIBE : ret = "DESCRIBE"; break; + case kafka_FieldId_CLUSTER_ACTION : ret = "CLUSTER_ACTION"; break; + case kafka_FieldId_DESCRIBE_CONFIGS: ret = "DESCRIBE_CONFIGS"; break; + case kafka_FieldId_ALTER_CONFIGS : ret = "ALTER_CONFIGS"; break; + case kafka_FieldId_IDEMPOTENT_WRITE: ret = "IDEMPOTENT_WRITE"; break; + case kafka_FieldId_CREATE_TOKENS : ret = "CREATE_TOKENS"; break; + case kafka_FieldId_DESCRIBE_TOKENS : ret = "DESCRIBE_TOKENS"; break; + case kafka_FieldId_OMITTED : ret = "OMITTED"; break; + case kafka_FieldId_key : ret = "key"; break; + case kafka_FieldId_base : ret = "base"; break; + case kafka_FieldId_type : ret = "type"; break; + case kafka_FieldId_version : ret = "version"; break; + case kafka_FieldId_group : ret = "group"; break; + case kafka_FieldId_topic : ret = "topic"; break; + case kafka_FieldId_partition : ret = "partition"; break; + case kafka_FieldId_attributes : ret = "attributes"; break; + case kafka_FieldId_pmask : ret = "pmask"; break; + case kafka_FieldId_timestamp_delta : ret = "timestamp_delta"; break; + case kafka_FieldId_offset_delta : ret = "offset_delta"; break; + case kafka_FieldId_headers : ret = "headers"; break; + case kafka_FieldId_base_offset : ret = "base_offset"; break; + case kafka_FieldId_partition_leader_epoch: ret = "partition_leader_epoch"; break; + case kafka_FieldId_magic : ret = "magic"; break; + case kafka_FieldId_crc : ret = "crc"; break; + case kafka_FieldId_last_offset_delta: ret = "last_offset_delta"; break; + case kafka_FieldId_base_timestamp : ret = "base_timestamp"; break; + case kafka_FieldId_max_timestamp : ret = "max_timestamp"; break; + case kafka_FieldId_producer_id : ret = "producer_id"; break; + case kafka_FieldId_producer_epoch : ret = "producer_epoch"; break; + case kafka_FieldId_base_sequence : ret = "base_sequence"; break; + case kafka_FieldId_records : ret = "records"; break; + } + return ret; +} + +// --- kafka.FieldId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::FieldId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.FieldId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::FieldId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('A','L','L'): { + value_SetEnum(parent,kafka_FieldId_ALL); ret = true; break; + } + case LE_STR3('A','N','Y'): { + value_SetEnum(parent,kafka_FieldId_ANY); ret = true; break; + } + case LE_STR3('c','r','c'): { + value_SetEnum(parent,kafka_FieldId_crc); ret = true; break; + } + case LE_STR3('k','e','y'): { + value_SetEnum(parent,kafka_FieldId_key); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('R','E','A','D'): { + value_SetEnum(parent,kafka_FieldId_READ); ret = true; break; + } + case LE_STR4('b','a','s','e'): { + value_SetEnum(parent,kafka_FieldId_base); ret = true; break; + } + case LE_STR4('t','y','p','e'): { + value_SetEnum(parent,kafka_FieldId_type); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('A','L','T','E','R'): { + value_SetEnum(parent,kafka_FieldId_ALTER); ret = true; break; + } + case LE_STR5('W','R','I','T','E'): { + value_SetEnum(parent,kafka_FieldId_WRITE); ret = true; break; + } + case LE_STR5('g','r','o','u','p'): { + value_SetEnum(parent,kafka_FieldId_group); ret = true; break; + } + case LE_STR5('m','a','g','i','c'): { + value_SetEnum(parent,kafka_FieldId_magic); ret = true; break; + } + case LE_STR5('p','m','a','s','k'): { + value_SetEnum(parent,kafka_FieldId_pmask); ret = true; break; + } + case LE_STR5('t','o','p','i','c'): { + value_SetEnum(parent,kafka_FieldId_topic); ret = true; break; + } + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,kafka_FieldId_value); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('C','R','E','A','T','E'): { + value_SetEnum(parent,kafka_FieldId_CREATE); ret = true; break; + } + case LE_STR6('D','E','L','E','T','E'): { + value_SetEnum(parent,kafka_FieldId_DELETE); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('O','M','I','T','T','E','D'): { + value_SetEnum(parent,kafka_FieldId_OMITTED); ret = true; break; + } + case LE_STR7('U','N','K','N','O','W','N'): { + value_SetEnum(parent,kafka_FieldId_UNKNOWN); ret = true; break; + } + case LE_STR7('h','e','a','d','e','r','s'): { + value_SetEnum(parent,kafka_FieldId_headers); ret = true; break; + } + case LE_STR7('r','e','c','o','r','d','s'): { + value_SetEnum(parent,kafka_FieldId_records); ret = true; break; + } + case LE_STR7('v','e','r','s','i','o','n'): { + value_SetEnum(parent,kafka_FieldId_version); ret = true; break; + } + } + break; + } + case 8: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('D','E','S','C','R','I','B','E'): { + value_SetEnum(parent,kafka_FieldId_DESCRIBE); ret = true; break; + } + } + break; + } + case 9: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('p','a','r','t','i','t','i','o'): { + if (memcmp(rhs.elems+8,"n",1)==0) { value_SetEnum(parent,kafka_FieldId_partition); ret = true; break; } + break; + } + } + break; + } + case 10: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('a','t','t','r','i','b','u','t'): { + if (memcmp(rhs.elems+8,"es",2)==0) { value_SetEnum(parent,kafka_FieldId_attributes); ret = true; break; } + break; + } + } + break; + } + case 11: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('b','a','s','e','_','o','f','f'): { + if (memcmp(rhs.elems+8,"set",3)==0) { value_SetEnum(parent,kafka_FieldId_base_offset); ret = true; break; } + break; + } + case LE_STR8('p','r','o','d','u','c','e','r'): { + if (memcmp(rhs.elems+8,"_id",3)==0) { value_SetEnum(parent,kafka_FieldId_producer_id); ret = true; break; } + break; + } + } + break; + } + case 12: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('o','f','f','s','e','t','_','d'): { + if (memcmp(rhs.elems+8,"elta",4)==0) { value_SetEnum(parent,kafka_FieldId_offset_delta); ret = true; break; } + break; + } + } + break; + } + case 13: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('A','L','T','E','R','_','C','O'): { + if (memcmp(rhs.elems+8,"NFIGS",5)==0) { value_SetEnum(parent,kafka_FieldId_ALTER_CONFIGS); ret = true; break; } + break; + } + case LE_STR8('C','R','E','A','T','E','_','T'): { + if (memcmp(rhs.elems+8,"OKENS",5)==0) { value_SetEnum(parent,kafka_FieldId_CREATE_TOKENS); ret = true; break; } + break; + } + case LE_STR8('b','a','s','e','_','s','e','q'): { + if (memcmp(rhs.elems+8,"uence",5)==0) { value_SetEnum(parent,kafka_FieldId_base_sequence); ret = true; break; } + break; + } + case LE_STR8('m','a','x','_','t','i','m','e'): { + if (memcmp(rhs.elems+8,"stamp",5)==0) { value_SetEnum(parent,kafka_FieldId_max_timestamp); ret = true; break; } + break; + } + } + break; + } + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('C','L','U','S','T','E','R','_'): { + if (memcmp(rhs.elems+8,"ACTION",6)==0) { value_SetEnum(parent,kafka_FieldId_CLUSTER_ACTION); ret = true; break; } + break; + } + case LE_STR8('b','a','s','e','_','t','i','m'): { + if (memcmp(rhs.elems+8,"estamp",6)==0) { value_SetEnum(parent,kafka_FieldId_base_timestamp); ret = true; break; } + break; + } + case LE_STR8('p','r','o','d','u','c','e','r'): { + if (memcmp(rhs.elems+8,"_epoch",6)==0) { value_SetEnum(parent,kafka_FieldId_producer_epoch); ret = true; break; } + break; + } + } + break; + } + case 15: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('D','E','S','C','R','I','B','E'): { + if (memcmp(rhs.elems+8,"_TOKENS",7)==0) { value_SetEnum(parent,kafka_FieldId_DESCRIBE_TOKENS); ret = true; break; } + break; + } + case LE_STR8('t','i','m','e','s','t','a','m'): { + if (memcmp(rhs.elems+8,"p_delta",7)==0) { value_SetEnum(parent,kafka_FieldId_timestamp_delta); ret = true; break; } + break; + } + } + break; + } + case 16: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('D','E','S','C','R','I','B','E'): { + if (memcmp(rhs.elems+8,"_CONFIGS",8)==0) { value_SetEnum(parent,kafka_FieldId_DESCRIBE_CONFIGS); ret = true; break; } + break; + } + case LE_STR8('I','D','E','M','P','O','T','E'): { + if (memcmp(rhs.elems+8,"NT_WRITE",8)==0) { value_SetEnum(parent,kafka_FieldId_IDEMPOTENT_WRITE); ret = true; break; } + break; + } + } + break; + } + case 17: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('l','a','s','t','_','o','f','f'): { + if (memcmp(rhs.elems+8,"set_delta",9)==0) { value_SetEnum(parent,kafka_FieldId_last_offset_delta); ret = true; break; } + break; + } + } + break; + } + case 22: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('p','a','r','t','i','t','i','o'): { + if (memcmp(rhs.elems+8,"n_leader_epoch",14)==0) { value_SetEnum(parent,kafka_FieldId_partition_leader_epoch); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- kafka.FieldId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::FieldId& parent, algo::strptr rhs, kafka_FieldIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.FieldId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.FieldId..ReadStrptrMaybe +// Read fields of kafka::FieldId from an ascii string. +// The format of the string is the format of the kafka::FieldId's only field +bool kafka::FieldId_ReadStrptrMaybe(kafka::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.FieldId..Print +// print string representation of ROW to string STR +// cfmt:kafka.FieldId.String printfmt:Raw +void kafka::FieldId_Print(kafka::FieldId& row, algo::cstring& str) { + kafka::value_Print(row, str); +} + +// --- kafka.Frame.payload.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr kafka::payload_Getary(kafka::Frame& parent) { + return algo::aryptr(payload_Addr(parent), payload_N(parent)); +} + +// --- kafka.Frame.payload.Addr +u8* kafka::payload_Addr(kafka::Frame& parent) { + return (u8*)((u8*)&parent + sizeof(kafka::Frame)); // address of varlen portion +} + +// --- kafka.Frame.payload.Print +// Convert payload to a string. +// Array is printed as a regular string. +void kafka::payload_Print(kafka::Frame& parent, algo::cstring &rhs) { + rhs << algo::memptr_ToStrptr(payload_Getary(parent)); +} + +// --- kafka.GroupRecordKeyHeader.type.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::type_ToCstr(const kafka::GroupRecordKeyHeader& parent) { + const char *ret = NULL; + switch(type_GetEnum(parent)) { + case kafka_GroupRecordKeyHeader_type_kafka_OffsetCommitKey: ret = "kafka.OffsetCommitKey"; break; + } + return ret; +} + +// --- kafka.GroupRecordKeyHeader.type.Print +// Convert type to a string. First, attempt conversion to a known string. +// If no string matches, print type as a numeric value. +void kafka::type_Print(const kafka::GroupRecordKeyHeader& parent, algo::cstring &lhs) { + const char *strval = type_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.type; + } +} + +// --- kafka.GroupRecordKeyHeader.type.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::type_SetStrptrMaybe(kafka::GroupRecordKeyHeader& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 21: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('k','a','f','k','a','.','O','f'): { + if (memcmp(rhs.elems+8,"fsetCommitKey",13)==0) { type_SetEnum(parent,kafka_GroupRecordKeyHeader_type_kafka_OffsetCommitKey); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- kafka.GroupRecordKeyHeader.type.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::type_SetStrptr(kafka::GroupRecordKeyHeader& parent, algo::strptr rhs, kafka_GroupRecordKeyHeader_type_Enum dflt) { + if (!type_SetStrptrMaybe(parent,rhs)) type_SetEnum(parent,dflt); +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::GroupRecordKeyHeaderMsgsCase& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_GroupRecordKeyHeaderMsgsCase_kafka_OffsetCommitKey: ret = "kafka.OffsetCommitKey"; break; + } + return ret; +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::GroupRecordKeyHeaderMsgsCase& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::GroupRecordKeyHeaderMsgsCase& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 21: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('k','a','f','k','a','.','O','f'): { + if (memcmp(rhs.elems+8,"fsetCommitKey",13)==0) { value_SetEnum(parent,kafka_GroupRecordKeyHeaderMsgsCase_kafka_OffsetCommitKey); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::GroupRecordKeyHeaderMsgsCase& parent, algo::strptr rhs, kafka_GroupRecordKeyHeaderMsgsCaseEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::GroupRecordKeyHeaderMsgsCase& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase..ReadStrptrMaybe +// Read fields of kafka::GroupRecordKeyHeaderMsgsCase from an ascii string. +// The format of the string is the format of the kafka::GroupRecordKeyHeaderMsgsCase's only field +bool kafka::GroupRecordKeyHeaderMsgsCase_ReadStrptrMaybe(kafka::GroupRecordKeyHeaderMsgsCase &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.GroupRecordValueHeader.type.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::type_ToCstr(const kafka::GroupRecordValueHeader& parent) { + const char *ret = NULL; + switch(type_GetEnum(parent)) { + case kafka_GroupRecordValueHeader_type_kafka_OffsetCommitValue: ret = "kafka.OffsetCommitValue"; break; + } + return ret; +} + +// --- kafka.GroupRecordValueHeader.type.Print +// Convert type to a string. First, attempt conversion to a known string. +// If no string matches, print type as a numeric value. +void kafka::type_Print(const kafka::GroupRecordValueHeader& parent, algo::cstring &lhs) { + const char *strval = type_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.type; + } +} + +// --- kafka.GroupRecordValueHeader.type.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::type_SetStrptrMaybe(kafka::GroupRecordValueHeader& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 23: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('k','a','f','k','a','.','O','f'): { + if (memcmp(rhs.elems+8,"fsetCommitValue",15)==0) { type_SetEnum(parent,kafka_GroupRecordValueHeader_type_kafka_OffsetCommitValue); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- kafka.GroupRecordValueHeader.type.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::type_SetStrptr(kafka::GroupRecordValueHeader& parent, algo::strptr rhs, kafka_GroupRecordValueHeader_type_Enum dflt) { + if (!type_SetStrptrMaybe(parent,rhs)) type_SetEnum(parent,dflt); +} + +// --- kafka.GroupRecordValueHeaderMsgsCase.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::GroupRecordValueHeaderMsgsCase& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_GroupRecordValueHeaderMsgsCase_kafka_OffsetCommitValue: ret = "kafka.OffsetCommitValue"; break; + } + return ret; +} + +// --- kafka.GroupRecordValueHeaderMsgsCase.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::GroupRecordValueHeaderMsgsCase& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.GroupRecordValueHeaderMsgsCase.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::GroupRecordValueHeaderMsgsCase& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 23: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('k','a','f','k','a','.','O','f'): { + if (memcmp(rhs.elems+8,"fsetCommitValue",15)==0) { value_SetEnum(parent,kafka_GroupRecordValueHeaderMsgsCase_kafka_OffsetCommitValue); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- kafka.GroupRecordValueHeaderMsgsCase.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::GroupRecordValueHeaderMsgsCase& parent, algo::strptr rhs, kafka_GroupRecordValueHeaderMsgsCaseEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.GroupRecordValueHeaderMsgsCase.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::GroupRecordValueHeaderMsgsCase& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.GroupRecordValueHeaderMsgsCase..ReadStrptrMaybe +// Read fields of kafka::GroupRecordValueHeaderMsgsCase from an ascii string. +// The format of the string is the format of the kafka::GroupRecordValueHeaderMsgsCase's only field +bool kafka::GroupRecordValueHeaderMsgsCase_ReadStrptrMaybe(kafka::GroupRecordValueHeaderMsgsCase &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.GroupState.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::GroupState& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_GroupState_Unknown : ret = "Unknown"; break; + case kafka_GroupState_PreparingRebalance: ret = "PreparingRebalance"; break; + case kafka_GroupState_CompletingRebalance: ret = "CompletingRebalance"; break; + case kafka_GroupState_Stable : ret = "Stable"; break; + case kafka_GroupState_Dead : ret = "Dead"; break; + case kafka_GroupState_Empty : ret = "Empty"; break; + case kafka_GroupState_Assigning : ret = "Assigning"; break; + case kafka_GroupState_Reconciling : ret = "Reconciling"; break; + case kafka_GroupState_NotReady : ret = "NotReady"; break; + } + return ret; +} + +// --- kafka.GroupState.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::GroupState& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.GroupState.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::GroupState& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('D','e','a','d'): { + value_SetEnum(parent,kafka_GroupState_Dead); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('E','m','p','t','y'): { + value_SetEnum(parent,kafka_GroupState_Empty); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('S','t','a','b','l','e'): { + value_SetEnum(parent,kafka_GroupState_Stable); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('U','n','k','n','o','w','n'): { + value_SetEnum(parent,kafka_GroupState_Unknown); ret = true; break; + } + } + break; + } + case 8: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('N','o','t','R','e','a','d','y'): { + value_SetEnum(parent,kafka_GroupState_NotReady); ret = true; break; + } + } + break; + } + case 9: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('A','s','s','i','g','n','i','n'): { + if (memcmp(rhs.elems+8,"g",1)==0) { value_SetEnum(parent,kafka_GroupState_Assigning); ret = true; break; } + break; + } + } + break; + } + case 11: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('R','e','c','o','n','c','i','l'): { + if (memcmp(rhs.elems+8,"ing",3)==0) { value_SetEnum(parent,kafka_GroupState_Reconciling); ret = true; break; } + break; + } + } + break; + } + case 18: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('P','r','e','p','a','r','i','n'): { + if (memcmp(rhs.elems+8,"gRebalance",10)==0) { value_SetEnum(parent,kafka_GroupState_PreparingRebalance); ret = true; break; } + break; + } + } + break; + } + case 19: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('C','o','m','p','l','e','t','i'): { + if (memcmp(rhs.elems+8,"ngRebalance",11)==0) { value_SetEnum(parent,kafka_GroupState_CompletingRebalance); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- kafka.GroupState.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::GroupState& parent, algo::strptr rhs, kafka_GroupStateEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.GroupState.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::GroupState& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.GroupState..ReadStrptrMaybe +// Read fields of kafka::GroupState from an ascii string. +// The format of the string is the format of the kafka::GroupState's only field +bool kafka::GroupState_ReadStrptrMaybe(kafka::GroupState &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.GroupState..Print +// print string representation of ROW to string STR +// cfmt:kafka.GroupState.String printfmt:Raw +void kafka::GroupState_Print(kafka::GroupState& row, algo::cstring& str) { + kafka::value_Print(row, str); +} + +// --- kafka.Header..ReadFieldMaybe +bool kafka::Header_ReadFieldMaybe(kafka::Header& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + kafka::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case kafka_FieldId_key: { + retval = algo::cstring_ReadStrptrMaybe(parent.key, strval); + } break; + case kafka_FieldId_value: { + retval = algo::cstring_ReadStrptrMaybe(parent.value, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- kafka.Header..ReadStrptrMaybe +// Read fields of kafka::Header from an ascii string. +// The format of the string is an ssim Tuple +bool kafka::Header_ReadStrptrMaybe(kafka::Header &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "kafka.Header"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Header_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- kafka.Header..Print +// print string representation of ROW to string STR +// cfmt:kafka.Header.String printfmt:Tuple +void kafka::Header_Print(kafka::Header& row, algo::cstring& str) { + algo::tempstr temp; + str << "kafka.Header"; + + algo::cstring_Print(row.key, temp); + PrintAttrSpaceReset(str,"key", temp); + + algo::cstring_Print(row.value, temp); + PrintAttrSpaceReset(str,"value", temp); +} + +// --- kafka.OffsetCommitKey.base.CopyOut +// Copy fields out of row +void kafka::parent_CopyOut(kafka::OffsetCommitKey &row, kafka::GroupRecordKeyHeader &out) { + // type: field value is computed + out.version = row.version; +} + +// --- kafka.OffsetCommitKey..ReadFieldMaybe +bool kafka::OffsetCommitKey_ReadFieldMaybe(kafka::OffsetCommitKey& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + kafka::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case kafka_FieldId_base: { + retval = false; + } break; + case kafka_FieldId_type: { + retval = false; + } break; + case kafka_FieldId_version: { + retval = i16_ReadStrptrMaybe(parent.version, strval); + } break; + case kafka_FieldId_group: { + retval = algo::cstring_ReadStrptrMaybe(parent.group, strval); + } break; + case kafka_FieldId_topic: { + retval = algo::cstring_ReadStrptrMaybe(parent.topic, strval); + } break; + case kafka_FieldId_partition: { + retval = i32_ReadStrptrMaybe(parent.partition, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- kafka.OffsetCommitKey..ReadStrptrMaybe +// Read fields of kafka::OffsetCommitKey from an ascii string. +// The format of the string is an ssim Tuple +bool kafka::OffsetCommitKey_ReadStrptrMaybe(kafka::OffsetCommitKey &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "kafka.OffsetCommitKey"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && OffsetCommitKey_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- kafka.OffsetCommitKey..Print +// print string representation of ROW to string STR +// cfmt:kafka.OffsetCommitKey.String printfmt:Tuple +void kafka::OffsetCommitKey_Print(kafka::OffsetCommitKey& row, algo::cstring& str) { + algo::tempstr temp; + str << "kafka.OffsetCommitKey"; + + i16_Print(row.version, temp); + PrintAttrSpaceReset(str,"version", temp); + + algo::cstring_Print(row.group, temp); + PrintAttrSpaceReset(str,"group", temp); + + algo::cstring_Print(row.topic, temp); + PrintAttrSpaceReset(str,"topic", temp); + + i32_Print(row.partition, temp); + PrintAttrSpaceReset(str,"partition", temp); +} + +// --- kafka.OffsetCommitValue.base.CopyOut +// Copy fields out of row +void kafka::parent_CopyOut(kafka::OffsetCommitValue &row, kafka::GroupRecordValueHeader &out) { + // type: field value is computed + out.version = row.version; +} + +// --- kafka.OffsetCommitValue..Print +// print string representation of ROW to string STR +// cfmt:kafka.OffsetCommitValue.String printfmt:Tuple +void kafka::OffsetCommitValue_Print(kafka::OffsetCommitValue& row, algo::cstring& str) { + algo::tempstr temp; + str << "kafka.OffsetCommitValue"; + + i16_Print(row.version, temp); + PrintAttrSpaceReset(str,"version", temp); + + i64_Print(row.offset, temp); + PrintAttrSpaceReset(str,"offset", temp); + + i32_Print(row.leader_epoch, temp); + PrintAttrSpaceReset(str,"leader_epoch", temp); + + algo::cstring_Print(row.metadata, temp); + PrintAttrSpaceReset(str,"metadata", temp); + + i64_Print(row.commit_timestamp, temp); + PrintAttrSpaceReset(str,"commit_timestamp", temp); + + i64_Print(row.expire_timestamp, temp); + PrintAttrSpaceReset(str,"expire_timestamp", temp); +} + +// --- kafka.PatternType.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::PatternType& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_PatternType_UNKNOWN : ret = "UNKNOWN"; break; + case kafka_PatternType_ANY : ret = "ANY"; break; + case kafka_PatternType_MATCH : ret = "MATCH"; break; + case kafka_PatternType_LITERAL : ret = "LITERAL"; break; + case kafka_PatternType_PREFIXED : ret = "PREFIXED"; break; + } + return ret; +} + +// --- kafka.PatternType.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::PatternType& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.PatternType.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::PatternType& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('A','N','Y'): { + value_SetEnum(parent,kafka_PatternType_ANY); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('M','A','T','C','H'): { + value_SetEnum(parent,kafka_PatternType_MATCH); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('L','I','T','E','R','A','L'): { + value_SetEnum(parent,kafka_PatternType_LITERAL); ret = true; break; + } + case LE_STR7('U','N','K','N','O','W','N'): { + value_SetEnum(parent,kafka_PatternType_UNKNOWN); ret = true; break; + } + } + break; + } + case 8: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('P','R','E','F','I','X','E','D'): { + value_SetEnum(parent,kafka_PatternType_PREFIXED); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- kafka.PatternType.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::PatternType& parent, algo::strptr rhs, kafka_PatternTypeEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.PatternType.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::PatternType& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.PatternType..ReadStrptrMaybe +// Read fields of kafka::PatternType from an ascii string. +// The format of the string is the format of the kafka::PatternType's only field +bool kafka::PatternType_ReadStrptrMaybe(kafka::PatternType &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.PatternType..Print +// print string representation of ROW to string STR +// cfmt:kafka.PatternType.String printfmt:Raw +void kafka::PatternType_Print(kafka::PatternType& row, algo::cstring& str) { + kafka::value_Print(row, str); +} + +// --- kafka.Record.key.ReadStrptrMaybe +inline static bool kafka::key_ReadStrptrMaybe(kafka::Record &parent, algo::strptr in_str) { + bool retval = true; + algo::cstring key_tmp; + retval = algo::cstring_ReadStrptrMaybe(key_tmp, in_str); + if (retval) { + key_Set(parent, key_tmp); + } + return retval; +} + +// --- kafka.Record.headers.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr kafka::headers_Addary(kafka::Record& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.headers_elems && rhs.elems < parent.headers_elems + parent.headers_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("kafka.tary_alias field:kafka.Record.headers comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + headers_Reserve(parent, nnew); // reserve space + int at = parent.headers_n; + for (int i = 0; i < nnew; i++) { + new (parent.headers_elems + at + i) kafka::Header(rhs[i]); + parent.headers_n++; + } + return algo::aryptr(parent.headers_elems + at, nnew); +} + +// --- kafka.Record.headers.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +kafka::Header& kafka::headers_Alloc(kafka::Record& parent) { + headers_Reserve(parent, 1); + int n = parent.headers_n; + int at = n; + kafka::Header *elems = parent.headers_elems; + new (elems + at) kafka::Header(); // construct new element, default initializer + parent.headers_n = n+1; + return elems[at]; +} + +// --- kafka.Record.headers.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +kafka::Header& kafka::headers_AllocAt(kafka::Record& parent, int at) { + headers_Reserve(parent, 1); + int n = parent.headers_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("kafka.bad_alloc_at field:kafka.Record.headers comment:'index out of range'"); + } + kafka::Header *elems = parent.headers_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(kafka::Header)); + new (elems + at) kafka::Header(); // construct element, default initializer + parent.headers_n = n+1; + return elems[at]; +} + +// --- kafka.Record.headers.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr kafka::headers_AllocN(kafka::Record& parent, int n_elems) { + headers_Reserve(parent, n_elems); + int old_n = parent.headers_n; + int new_n = old_n + n_elems; + kafka::Header *elems = parent.headers_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) kafka::Header(); // construct new element, default initialize + } + parent.headers_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- kafka.Record.headers.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr kafka::headers_AllocNAt(kafka::Record& parent, int n_elems, int at) { + headers_Reserve(parent, n_elems); + int n = parent.headers_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("kafka.bad_alloc_n_at field:kafka.Record.headers comment:'index out of range'"); + } + kafka::Header *elems = parent.headers_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(kafka::Header)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) kafka::Header(); // construct new element, default initialize + } + parent.headers_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- kafka.Record.headers.Remove +// Remove item by index. If index outside of range, do nothing. +void kafka::headers_Remove(kafka::Record& parent, u32 i) { + u32 lim = parent.headers_n; + kafka::Header *elems = parent.headers_elems; + if (i < lim) { + elems[i].~Header(); // destroy element + memmove(elems + i, elems + (i + 1), sizeof(kafka::Header) * (lim - (i + 1))); + parent.headers_n = lim - 1; + } +} + +// --- kafka.Record.headers.RemoveAll +void kafka::headers_RemoveAll(kafka::Record& parent) { + u32 n = parent.headers_n; + while (n > 0) { + n -= 1; + parent.headers_elems[n].~Header(); + parent.headers_n = n; + } +} + +// --- kafka.Record.headers.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void kafka::headers_RemoveLast(kafka::Record& parent) { + u64 n = parent.headers_n; + if (n > 0) { + n -= 1; + headers_qFind(parent, u64(n)).~Header(); + parent.headers_n = n; + } +} + +// --- kafka.Record.headers.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void kafka::headers_AbsReserve(kafka::Record& parent, int n) { + u32 old_max = parent.headers_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.headers_elems, old_max * sizeof(kafka::Header), new_max * sizeof(kafka::Header)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("kafka.tary_nomem field:kafka.Record.headers comment:'out of memory'"); + } + parent.headers_elems = (kafka::Header*)new_mem; + parent.headers_max = new_max; + } +} + +// --- kafka.Record.headers.Setary +// Copy contents of RHS to PARENT. +void kafka::headers_Setary(kafka::Record& parent, kafka::Record &rhs) { + headers_RemoveAll(parent); + int nnew = rhs.headers_n; + headers_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.headers_elems + i) kafka::Header(headers_qFind(rhs, i)); + parent.headers_n = i + 1; + } +} + +// --- kafka.Record.headers.Setary2 +// Copy specified array into headers, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void kafka::headers_Setary(kafka::Record& parent, const algo::aryptr &rhs) { + headers_RemoveAll(parent); + headers_Addary(parent, rhs); +} + +// --- kafka.Record.headers.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr kafka::headers_AllocNVal(kafka::Record& parent, int n_elems, const kafka::Header& val) { + headers_Reserve(parent, n_elems); + int old_n = parent.headers_n; + int new_n = old_n + n_elems; + kafka::Header *elems = parent.headers_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) kafka::Header(val); + } + parent.headers_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- kafka.Record.headers.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool kafka::headers_ReadStrptrMaybe(kafka::Record& parent, algo::strptr in_str) { + bool retval = true; + kafka::Header &elem = headers_Alloc(parent); + retval = kafka::Header_ReadStrptrMaybe(elem, in_str); + if (!retval) { + headers_RemoveLast(parent); + } + return retval; +} + +// --- kafka.Record.headers.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void kafka::headers_Insary(kafka::Record& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.headers_elems && rhs.elems < parent.headers_elems + parent.headers_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("kafka.tary_alias field:kafka.Record.headers comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.headers_elems+1))) { + FatalErrorExit("kafka.bad_insary field:kafka.Record.headers comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.headers_n - at; + headers_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.headers_elems + at + nnew + i) kafka::Header(parent.headers_elems[at + i]); + parent.headers_elems[at + i].~Header(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.headers_elems + at + i) kafka::Header(rhs[i]); + } + parent.headers_n += nnew; +} + +// --- kafka.Record..ReadFieldMaybe +bool kafka::Record_ReadFieldMaybe(kafka::Record& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + kafka::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case kafka_FieldId_attributes: { + retval = u8_ReadStrptrMaybe(parent.attributes, strval); + } break; + case kafka_FieldId_pmask: { + retval = false; + } break; + case kafka_FieldId_timestamp_delta: { + retval = i64_ReadStrptrMaybe(parent.timestamp_delta, strval); + } break; + case kafka_FieldId_offset_delta: { + retval = i32_ReadStrptrMaybe(parent.offset_delta, strval); + } break; + case kafka_FieldId_key: { + retval = key_ReadStrptrMaybe(parent, strval); + if (retval) { + pmask_qSetBit(parent, 0); + } + } break; + case kafka_FieldId_value: { + retval = algo::cstring_ReadStrptrMaybe(parent.value, strval); + } break; + case kafka_FieldId_headers: { + retval = headers_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- kafka.Record..ReadStrptrMaybe +// Read fields of kafka::Record from an ascii string. +// The format of the string is an ssim Tuple +bool kafka::Record_ReadStrptrMaybe(kafka::Record &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "kafka.Record"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Record_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- kafka.Record..Uninit +void kafka::Record_Uninit(kafka::Record& parent) { + kafka::Record &row = parent; (void)row; + + // kafka.Record.headers.Uninit (Tary) // + // remove all elements from kafka.Record.headers + headers_RemoveAll(parent); + // free memory for Tary kafka.Record.headers + algo_lib::malloc_FreeMem(parent.headers_elems, sizeof(kafka::Header)*parent.headers_max); // (kafka.Record.headers) +} + +// --- kafka.Record..Print +// print string representation of ROW to string STR +// cfmt:kafka.Record.String printfmt:Tuple +void kafka::Record_Print(kafka::Record& row, algo::cstring& str) { + algo::tempstr temp; + str << "kafka.Record"; + + u8_Print(row.attributes, temp); + PrintAttrSpaceReset(str,"attributes", temp); + + i64_Print(row.timestamp_delta, temp); + PrintAttrSpaceReset(str,"timestamp_delta", temp); + + i32_Print(row.offset_delta, temp); + PrintAttrSpaceReset(str,"offset_delta", temp); + + if (key_PresentQ(row)) { + algo::cstring_Print(row.key, temp); + PrintAttrSpaceReset(str,"key", temp); + } + + algo::cstring_Print(row.value, temp); + PrintAttrSpaceReset(str,"value", temp); + + ind_beg(Record_headers_curs,headers,row) { + kafka::Header_Print(headers, temp); + tempstr name; + name << "headers."; + name << ind_curs(headers).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; +} + +// --- kafka.Record..AssignOp +kafka::Record& kafka::Record::operator =(const kafka::Record &rhs) { + attributes = rhs.attributes; + pmask = rhs.pmask; + timestamp_delta = rhs.timestamp_delta; + offset_delta = rhs.offset_delta; + key = rhs.key; + value = rhs.value; + headers_Setary(*this, headers_Getary(const_cast(rhs))); + return *this; +} + +// --- kafka.Record..CopyCtor + kafka::Record::Record(const kafka::Record &rhs) + : attributes(rhs.attributes) + , pmask(rhs.pmask) + , timestamp_delta(rhs.timestamp_delta) + , offset_delta(rhs.offset_delta) + , key(rhs.key) + , value(rhs.value) + { + headers_elems = 0; // (kafka.Record.headers) + headers_n = 0; // (kafka.Record.headers) + headers_max = 0; // (kafka.Record.headers) + headers_Setary(*this, headers_Getary(const_cast(rhs))); +} + +// --- kafka.RecordBatch.records.Addary +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +algo::aryptr kafka::records_Addary(kafka::RecordBatch& parent, algo::aryptr rhs) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.records_elems && rhs.elems < parent.records_elems + parent.records_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("kafka.tary_alias field:kafka.RecordBatch.records comment:'alias error: sub-array is being appended to the whole'"); + } + int nnew = rhs.n_elems; + records_Reserve(parent, nnew); // reserve space + int at = parent.records_n; + for (int i = 0; i < nnew; i++) { + new (parent.records_elems + at + i) kafka::Record(rhs[i]); + parent.records_n++; + } + return algo::aryptr(parent.records_elems + at, nnew); +} + +// --- kafka.RecordBatch.records.Alloc +// Reserve space. Insert element at the end +// The new element is initialized to a default value +kafka::Record& kafka::records_Alloc(kafka::RecordBatch& parent) { + records_Reserve(parent, 1); + int n = parent.records_n; + int at = n; + kafka::Record *elems = parent.records_elems; + new (elems + at) kafka::Record(); // construct new element, default initializer + parent.records_n = n+1; + return elems[at]; +} + +// --- kafka.RecordBatch.records.AllocAt +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +kafka::Record& kafka::records_AllocAt(kafka::RecordBatch& parent, int at) { + records_Reserve(parent, 1); + int n = parent.records_n; + if (UNLIKELY(u64(at) >= u64(n+1))) { + FatalErrorExit("kafka.bad_alloc_at field:kafka.RecordBatch.records comment:'index out of range'"); + } + kafka::Record *elems = parent.records_elems; + memmove(elems + at + 1, elems + at, (n - at) * sizeof(kafka::Record)); + new (elems + at) kafka::Record(); // construct element, default initializer + parent.records_n = n+1; + return elems[at]; +} + +// --- kafka.RecordBatch.records.AllocN +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr kafka::records_AllocN(kafka::RecordBatch& parent, int n_elems) { + records_Reserve(parent, n_elems); + int old_n = parent.records_n; + int new_n = old_n + n_elems; + kafka::Record *elems = parent.records_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) kafka::Record(); // construct new element, default initialize + } + parent.records_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- kafka.RecordBatch.records.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr kafka::records_AllocNAt(kafka::RecordBatch& parent, int n_elems, int at) { + records_Reserve(parent, n_elems); + int n = parent.records_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("kafka.bad_alloc_n_at field:kafka.RecordBatch.records comment:'index out of range'"); + } + kafka::Record *elems = parent.records_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(kafka::Record)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) kafka::Record(); // construct new element, default initialize + } + parent.records_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + +// --- kafka.RecordBatch.records.Remove +// Remove item by index. If index outside of range, do nothing. +void kafka::records_Remove(kafka::RecordBatch& parent, u32 i) { + u32 lim = parent.records_n; + kafka::Record *elems = parent.records_elems; + if (i < lim) { + elems[i].~Record(); // destroy element + memmove(elems + i, elems + (i + 1), sizeof(kafka::Record) * (lim - (i + 1))); + parent.records_n = lim - 1; + } +} + +// --- kafka.RecordBatch.records.RemoveAll +void kafka::records_RemoveAll(kafka::RecordBatch& parent) { + u32 n = parent.records_n; + while (n > 0) { + n -= 1; + parent.records_elems[n].~Record(); + parent.records_n = n; + } +} + +// --- kafka.RecordBatch.records.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void kafka::records_RemoveLast(kafka::RecordBatch& parent) { + u64 n = parent.records_n; + if (n > 0) { + n -= 1; + records_qFind(parent, u64(n)).~Record(); + parent.records_n = n; + } +} + +// --- kafka.RecordBatch.records.AbsReserve +// Make sure N elements fit in array. Process dies if out of memory +void kafka::records_AbsReserve(kafka::RecordBatch& parent, int n) { + u32 old_max = parent.records_max; + if (n > i32(old_max)) { + u32 new_max = i32_Max(i32_Max(old_max * 2, n), 4); + void *new_mem = algo_lib::malloc_ReallocMem(parent.records_elems, old_max * sizeof(kafka::Record), new_max * sizeof(kafka::Record)); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("kafka.tary_nomem field:kafka.RecordBatch.records comment:'out of memory'"); + } + parent.records_elems = (kafka::Record*)new_mem; + parent.records_max = new_max; + } +} + +// --- kafka.RecordBatch.records.Setary +// Copy contents of RHS to PARENT. +void kafka::records_Setary(kafka::RecordBatch& parent, kafka::RecordBatch &rhs) { + records_RemoveAll(parent); + int nnew = rhs.records_n; + records_Reserve(parent, nnew); // reserve space + for (int i = 0; i < nnew; i++) { // copy elements over + new (parent.records_elems + i) kafka::Record(records_qFind(rhs, i)); + parent.records_n = i + 1; + } +} + +// --- kafka.RecordBatch.records.Setary2 +// Copy specified array into records, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +void kafka::records_Setary(kafka::RecordBatch& parent, const algo::aryptr &rhs) { + records_RemoveAll(parent); + records_Addary(parent, rhs); +} + +// --- kafka.RecordBatch.records.AllocNVal +// Reserve space. Insert N elements at the end of the array, return pointer to array +algo::aryptr kafka::records_AllocNVal(kafka::RecordBatch& parent, int n_elems, const kafka::Record& val) { + records_Reserve(parent, n_elems); + int old_n = parent.records_n; + int new_n = old_n + n_elems; + kafka::Record *elems = parent.records_elems; + for (int i = old_n; i < new_n; i++) { + new (elems + i) kafka::Record(val); + } + parent.records_n = new_n; + return algo::aryptr(elems + old_n, n_elems); +} + +// --- kafka.RecordBatch.records.ReadStrptrMaybe +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +bool kafka::records_ReadStrptrMaybe(kafka::RecordBatch& parent, algo::strptr in_str) { + bool retval = true; + kafka::Record &elem = records_Alloc(parent); + retval = kafka::Record_ReadStrptrMaybe(elem, in_str); + if (!retval) { + records_RemoveLast(parent); + } + return retval; +} + +// --- kafka.RecordBatch.records.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void kafka::records_Insary(kafka::RecordBatch& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.records_elems && rhs.elems < parent.records_elems + parent.records_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("kafka.tary_alias field:kafka.RecordBatch.records comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.records_elems+1))) { + FatalErrorExit("kafka.bad_insary field:kafka.RecordBatch.records comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.records_n - at; + records_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.records_elems + at + nnew + i) kafka::Record(parent.records_elems[at + i]); + parent.records_elems[at + i].~Record(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.records_elems + at + i) kafka::Record(rhs[i]); + } + parent.records_n += nnew; +} + +// --- kafka.RecordBatch..ReadFieldMaybe +bool kafka::RecordBatch_ReadFieldMaybe(kafka::RecordBatch& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + kafka::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case kafka_FieldId_base_offset: { + retval = i64_ReadStrptrMaybe(parent.base_offset, strval); + } break; + case kafka_FieldId_partition_leader_epoch: { + retval = i32_ReadStrptrMaybe(parent.partition_leader_epoch, strval); + } break; + case kafka_FieldId_magic: { + retval = i8_ReadStrptrMaybe(parent.magic, strval); + } break; + case kafka_FieldId_crc: { + retval = u32_ReadStrptrMaybe(parent.crc, strval); + } break; + case kafka_FieldId_attributes: { + retval = i16_ReadStrptrMaybe(parent.attributes, strval); + } break; + case kafka_FieldId_last_offset_delta: { + retval = i32_ReadStrptrMaybe(parent.last_offset_delta, strval); + } break; + case kafka_FieldId_base_timestamp: { + retval = i64_ReadStrptrMaybe(parent.base_timestamp, strval); + } break; + case kafka_FieldId_max_timestamp: { + retval = i64_ReadStrptrMaybe(parent.max_timestamp, strval); + } break; + case kafka_FieldId_producer_id: { + retval = i64_ReadStrptrMaybe(parent.producer_id, strval); + } break; + case kafka_FieldId_producer_epoch: { + retval = i16_ReadStrptrMaybe(parent.producer_epoch, strval); + } break; + case kafka_FieldId_base_sequence: { + retval = i32_ReadStrptrMaybe(parent.base_sequence, strval); + } break; + case kafka_FieldId_records: { + retval = records_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- kafka.RecordBatch..ReadStrptrMaybe +// Read fields of kafka::RecordBatch from an ascii string. +// The format of the string is an ssim Tuple +bool kafka::RecordBatch_ReadStrptrMaybe(kafka::RecordBatch &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "kafka.RecordBatch"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && RecordBatch_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- kafka.RecordBatch..Init +// Set all fields to initial values. +void kafka::RecordBatch_Init(kafka::RecordBatch& parent) { + parent.base_offset = i64(0); + parent.partition_leader_epoch = i32(0); + parent.magic = i8(2); + parent.crc = u32(0); + parent.attributes = i16(0); + parent.last_offset_delta = i32(0); + parent.base_timestamp = i64(0); + parent.max_timestamp = i64(0); + parent.producer_id = i64(-1); + parent.producer_epoch = i16(-1); + parent.base_sequence = i32(-1); + parent.records_elems = 0; // (kafka.RecordBatch.records) + parent.records_n = 0; // (kafka.RecordBatch.records) + parent.records_max = 0; // (kafka.RecordBatch.records) +} + +// --- kafka.RecordBatch..Uninit +void kafka::RecordBatch_Uninit(kafka::RecordBatch& parent) { + kafka::RecordBatch &row = parent; (void)row; + + // kafka.RecordBatch.records.Uninit (Tary) // + // remove all elements from kafka.RecordBatch.records + records_RemoveAll(parent); + // free memory for Tary kafka.RecordBatch.records + algo_lib::malloc_FreeMem(parent.records_elems, sizeof(kafka::Record)*parent.records_max); // (kafka.RecordBatch.records) +} + +// --- kafka.RecordBatch..Print +// print string representation of ROW to string STR +// cfmt:kafka.RecordBatch.String printfmt:Tuple +void kafka::RecordBatch_Print(kafka::RecordBatch& row, algo::cstring& str) { + algo::tempstr temp; + str << "kafka.RecordBatch"; + + i64_Print(row.base_offset, temp); + PrintAttrSpaceReset(str,"base_offset", temp); + + i32_Print(row.partition_leader_epoch, temp); + PrintAttrSpaceReset(str,"partition_leader_epoch", temp); + + i8_Print(row.magic, temp); + PrintAttrSpaceReset(str,"magic", temp); + + u32_Print(row.crc, temp); + PrintAttrSpaceReset(str,"crc", temp); + + i16_Print(row.attributes, temp); + PrintAttrSpaceReset(str,"attributes", temp); + + i32_Print(row.last_offset_delta, temp); + PrintAttrSpaceReset(str,"last_offset_delta", temp); + + i64_Print(row.base_timestamp, temp); + PrintAttrSpaceReset(str,"base_timestamp", temp); + + i64_Print(row.max_timestamp, temp); + PrintAttrSpaceReset(str,"max_timestamp", temp); + + i64_Print(row.producer_id, temp); + PrintAttrSpaceReset(str,"producer_id", temp); + + i16_Print(row.producer_epoch, temp); + PrintAttrSpaceReset(str,"producer_epoch", temp); + + i32_Print(row.base_sequence, temp); + PrintAttrSpaceReset(str,"base_sequence", temp); + + ind_beg(RecordBatch_records_curs,records,row) { + kafka::Record_Print(records, temp); + tempstr name; + name << "records."; + name << ind_curs(records).index; + PrintAttrSpaceReset(str, name, temp); + }ind_end; +} + +// --- kafka.RecordBatch..AssignOp +kafka::RecordBatch& kafka::RecordBatch::operator =(const kafka::RecordBatch &rhs) { + base_offset = rhs.base_offset; + partition_leader_epoch = rhs.partition_leader_epoch; + magic = rhs.magic; + crc = rhs.crc; + attributes = rhs.attributes; + last_offset_delta = rhs.last_offset_delta; + base_timestamp = rhs.base_timestamp; + max_timestamp = rhs.max_timestamp; + producer_id = rhs.producer_id; + producer_epoch = rhs.producer_epoch; + base_sequence = rhs.base_sequence; + records_Setary(*this, records_Getary(const_cast(rhs))); + return *this; +} + +// --- kafka.RecordBatch..CopyCtor + kafka::RecordBatch::RecordBatch(const kafka::RecordBatch &rhs) + : base_offset(rhs.base_offset) + , partition_leader_epoch(rhs.partition_leader_epoch) + , magic(rhs.magic) + , crc(rhs.crc) + , attributes(rhs.attributes) + , last_offset_delta(rhs.last_offset_delta) + , base_timestamp(rhs.base_timestamp) + , max_timestamp(rhs.max_timestamp) + , producer_id(rhs.producer_id) + , producer_epoch(rhs.producer_epoch) + , base_sequence(rhs.base_sequence) + { + records_elems = 0; // (kafka.RecordBatch.records) + records_n = 0; // (kafka.RecordBatch.records) + records_max = 0; // (kafka.RecordBatch.records) + records_Setary(*this, records_Getary(const_cast(rhs))); +} + +// --- kafka.ResourceType.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::ResourceType& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_ResourceType_UNKNOWN : ret = "UNKNOWN"; break; + case kafka_ResourceType_ANY : ret = "ANY"; break; + case kafka_ResourceType_TOPIC : ret = "TOPIC"; break; + case kafka_ResourceType_GROUP : ret = "GROUP"; break; + case kafka_ResourceType_CLUSTER : ret = "CLUSTER"; break; + case kafka_ResourceType_TRANSACTIONAL_ID: ret = "TRANSACTIONAL_ID"; break; + case kafka_ResourceType_DELEGATION_TOKEN: ret = "DELEGATION_TOKEN"; break; + case kafka_ResourceType_USER : ret = "USER"; break; + } + return ret; +} + +// --- kafka.ResourceType.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::ResourceType& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.ResourceType.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::ResourceType& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('A','N','Y'): { + value_SetEnum(parent,kafka_ResourceType_ANY); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('U','S','E','R'): { + value_SetEnum(parent,kafka_ResourceType_USER); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('G','R','O','U','P'): { + value_SetEnum(parent,kafka_ResourceType_GROUP); ret = true; break; + } + case LE_STR5('T','O','P','I','C'): { + value_SetEnum(parent,kafka_ResourceType_TOPIC); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('C','L','U','S','T','E','R'): { + value_SetEnum(parent,kafka_ResourceType_CLUSTER); ret = true; break; + } + case LE_STR7('U','N','K','N','O','W','N'): { + value_SetEnum(parent,kafka_ResourceType_UNKNOWN); ret = true; break; + } + } + break; + } + case 16: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('D','E','L','E','G','A','T','I'): { + if (memcmp(rhs.elems+8,"ON_TOKEN",8)==0) { value_SetEnum(parent,kafka_ResourceType_DELEGATION_TOKEN); ret = true; break; } + break; + } + case LE_STR8('T','R','A','N','S','A','C','T'): { + if (memcmp(rhs.elems+8,"IONAL_ID",8)==0) { value_SetEnum(parent,kafka_ResourceType_TRANSACTIONAL_ID); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- kafka.ResourceType.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::ResourceType& parent, algo::strptr rhs, kafka_ResourceTypeEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.ResourceType.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::ResourceType& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.ResourceType..ReadStrptrMaybe +// Read fields of kafka::ResourceType from an ascii string. +// The format of the string is the format of the kafka::ResourceType's only field +bool kafka::ResourceType_ReadStrptrMaybe(kafka::ResourceType &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.ResourceType..Print +// print string representation of ROW to string STR +// cfmt:kafka.ResourceType.String printfmt:Raw +void kafka::ResourceType_Print(kafka::ResourceType& row, algo::cstring& str) { + kafka::value_Print(row, str); +} + +// --- kafka.TimestampType.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* kafka::value_ToCstr(const kafka::TimestampType& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case kafka_TimestampType_create_time: ret = "create_time"; break; + case kafka_TimestampType_log_append_time: ret = "log_append_time"; break; + } + return ret; +} + +// --- kafka.TimestampType.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void kafka::value_Print(const kafka::TimestampType& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- kafka.TimestampType.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool kafka::value_SetStrptrMaybe(kafka::TimestampType& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 11: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('c','r','e','a','t','e','_','t'): { + if (memcmp(rhs.elems+8,"ime",3)==0) { value_SetEnum(parent,kafka_TimestampType_create_time); ret = true; break; } + break; + } + } + break; + } + case 15: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('l','o','g','_','a','p','p','e'): { + if (memcmp(rhs.elems+8,"nd_time",7)==0) { value_SetEnum(parent,kafka_TimestampType_log_append_time); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- kafka.TimestampType.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void kafka::value_SetStrptr(kafka::TimestampType& parent, algo::strptr rhs, kafka_TimestampTypeEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- kafka.TimestampType.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool kafka::value_ReadStrptrMaybe(kafka::TimestampType& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- kafka.TimestampType..ReadStrptrMaybe +// Read fields of kafka::TimestampType from an ascii string. +// The format of the string is the format of the kafka::TimestampType's only field +bool kafka::TimestampType_ReadStrptrMaybe(kafka::TimestampType &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- kafka.TimestampType..Print +// print string representation of ROW to string STR +// cfmt:kafka.TimestampType.String printfmt:Raw +void kafka::TimestampType_Print(kafka::TimestampType& row, algo::cstring& str) { + kafka::value_Print(row, str); +} + +// --- kafka...SizeCheck +inline static void kafka::SizeCheck() { +} + +// --- kafka...StaticCheck +void kafka::StaticCheck() { + algo_assert(_offset_of(kafka::AclOperationType, value) + sizeof(((kafka::AclOperationType*)0)->value) == sizeof(kafka::AclOperationType)); + // check that bitfield fits width + algo_assert(sizeof(((kafka::AclOperations*)0)->value)*8 >= 32); + algo_assert(_offset_of(kafka::AclPermissionType, value) + sizeof(((kafka::AclPermissionType*)0)->value) == sizeof(kafka::AclPermissionType)); + algo_assert(_offset_of(kafka::ConfigSource, value) + sizeof(((kafka::ConfigSource*)0)->value) == sizeof(kafka::ConfigSource)); + algo_assert(_offset_of(kafka::ConfigType, value) + sizeof(((kafka::ConfigType*)0)->value) == sizeof(kafka::ConfigType)); + algo_assert(_offset_of(kafka::FieldId, value) + sizeof(((kafka::FieldId*)0)->value) == sizeof(kafka::FieldId)); + algo_assert(_offset_of(kafka::Frame_curs, msglen) + sizeof(((kafka::Frame_curs*)0)->msglen) == sizeof(kafka::Frame_curs)); + algo_assert(_offset_of(kafka::GroupRecordKeyHeaderMsgsCase, value) + sizeof(((kafka::GroupRecordKeyHeaderMsgsCase*)0)->value) == sizeof(kafka::GroupRecordKeyHeaderMsgsCase)); + algo_assert(_offset_of(kafka::GroupRecordValueHeaderMsgsCase, value) + sizeof(((kafka::GroupRecordValueHeaderMsgsCase*)0)->value) == sizeof(kafka::GroupRecordValueHeaderMsgsCase)); + algo_assert(_offset_of(kafka::GroupState, value) + sizeof(((kafka::GroupState*)0)->value) == sizeof(kafka::GroupState)); + algo_assert(_offset_of(kafka::PatternType, value) + sizeof(((kafka::PatternType*)0)->value) == sizeof(kafka::PatternType)); + algo_assert(_offset_of(kafka::ResourceType, value) + sizeof(((kafka::ResourceType*)0)->value) == sizeof(kafka::ResourceType)); +} + +// --- kafka.GroupRecordKeyHeaderMsgs..Print +// Print message to STR. If message is too short for MSG_LEN, print nothing. +// MSG.LENGTH must have already been validated against msg_len. +// This function will additionally validate that sizeof(Msg) <= msg_len +bool kafka::GroupRecordKeyHeaderMsgs_Print(algo::cstring &str, kafka::GroupRecordKeyHeader &msg, u32 msg_len) { + switch(msg.type) { + case 1: { + if (sizeof(kafka::OffsetCommitKey) > msg_len) { return false; } + OffsetCommitKey_Print((kafka::OffsetCommitKey&)(msg), str); + return true; + } + default: + + return false; + } +} + +// --- kafka.GroupRecordValueHeaderMsgs..Print +// Print message to STR. If message is too short for MSG_LEN, print nothing. +// MSG.LENGTH must have already been validated against msg_len. +// This function will additionally validate that sizeof(Msg) <= msg_len +bool kafka::GroupRecordValueHeaderMsgs_Print(algo::cstring &str, kafka::GroupRecordValueHeader &msg, u32 msg_len) { + switch(msg.type) { + case 1: { + if (sizeof(kafka::OffsetCommitValue) > msg_len) { return false; } + OffsetCommitValue_Print((kafka::OffsetCommitValue&)(msg), str); + return true; + } + default: + + return false; + } +} + +// --- kafka.GroupRecordKeyHeaderMsgs..ReadStrptr +// Parse ascii representation of message into binary, appending new data to BUF. +kafka::GroupRecordKeyHeaderMsgsCase kafka::GroupRecordKeyHeaderMsgs_ReadStrptr(algo::strptr str, algo::ByteAry &buf) { + bool ok = false; + tempstr msgtype_str; + algo::StringIter iter(str); + cstring_ReadCmdarg(msgtype_str, iter, false); // read first word + kafka::GroupRecordKeyHeaderMsgsCase msgtype; + value_SetStrptrMaybe(msgtype, msgtype_str); // map string -> enum + switch (value_GetEnum(msgtype)) { // what message is it? + case kafka_GroupRecordKeyHeaderMsgsCase_kafka_OffsetCommitKey: { + int len = sizeof(kafka::OffsetCommitKey); + kafka::OffsetCommitKey *ctype = new(ary_AllocN(buf, len).elems) kafka::OffsetCommitKey; // default values + ok = OffsetCommitKey_ReadStrptrMaybe(*ctype, str); // now read attributes + } break; // kafka::OffsetCommitKey case + + default: break; + } + return ok ? msgtype : kafka::GroupRecordKeyHeaderMsgsCase(); +} + +// --- kafka.GroupRecordKeyHeaderMsgs..ReadStrptrMaybe +// Parse ascii representation of message into binary, appending new data to BUF. +bool kafka::GroupRecordKeyHeaderMsgs_ReadStrptrMaybe(algo::strptr str, algo::ByteAry &buf) { + kafka::GroupRecordKeyHeaderMsgsCase msgtype = GroupRecordKeyHeaderMsgs_ReadStrptr(str,buf); + return !(msgtype == kafka::GroupRecordKeyHeaderMsgsCase()); +} + +// --- kafka.GroupRecordValueHeaderMsgs..ReadStrptr +// Parse ascii representation of message into binary, appending new data to BUF. +kafka::GroupRecordValueHeaderMsgsCase kafka::GroupRecordValueHeaderMsgs_ReadStrptr(algo::strptr str, algo::ByteAry &buf) { + bool ok = false; + tempstr msgtype_str; + algo::StringIter iter(str); + cstring_ReadCmdarg(msgtype_str, iter, false); // read first word + kafka::GroupRecordValueHeaderMsgsCase msgtype; + value_SetStrptrMaybe(msgtype, msgtype_str); // map string -> enum + switch (value_GetEnum(msgtype)) { // what message is it? + case kafka_GroupRecordValueHeaderMsgsCase_kafka_OffsetCommitValue: { + // no cfmt read:Y found -- cannot read + } break; // kafka::OffsetCommitValue case + + default: break; + } + (void)buf;//only to avoid -Wunused-parameter + return ok ? msgtype : kafka::GroupRecordValueHeaderMsgsCase(); +} + +// --- kafka.GroupRecordValueHeaderMsgs..ReadStrptrMaybe +// Parse ascii representation of message into binary, appending new data to BUF. +bool kafka::GroupRecordValueHeaderMsgs_ReadStrptrMaybe(algo::strptr str, algo::ByteAry &buf) { + kafka::GroupRecordValueHeaderMsgsCase msgtype = GroupRecordValueHeaderMsgs_ReadStrptr(str,buf); + return !(msgtype == kafka::GroupRecordValueHeaderMsgsCase()); +} diff --git a/cpp/gen/lib_amcdb_gen.cpp b/cpp/gen/lib_amcdb_gen.cpp index 7ac61a95..bc62ef8e 100644 --- a/cpp/gen/lib_amcdb_gen.cpp +++ b/cpp/gen/lib_amcdb_gen.cpp @@ -25,6 +25,8 @@ #include "include/algo.h" // hard-coded include #include "include/gen/lib_amcdb_gen.h" #include "include/gen/lib_amcdb_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude diff --git a/cpp/gen/lib_ams_gen.cpp b/cpp/gen/lib_ams_gen.cpp index 9f197ff4..051f9514 100644 --- a/cpp/gen/lib_ams_gen.cpp +++ b/cpp/gen/lib_ams_gen.cpp @@ -42,16 +42,19 @@ #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" //#pragma endinclude +lib_ams::_db_bh_shmember_read_curs::~_db_bh_shmember_read_curs() { + algo_lib::malloc_FreeMem(temp_elems, sizeof(void*) * temp_max); + +} + namespace lib_ams { // gen:ns_gsymbol - const char* amsdb_proctype_0("0"); - const char* amsdb_proctype_amstest("amstest"); + const char* amsdb_proctype_(""); + const char* amsdb_proctype_ams_sendtest("ams_sendtest"); } // gen:ns_gsymbol namespace lib_ams { // gen:ns_gsymbol - const char* amsdb_streamtype_0("0"); - const char* amsdb_streamtype_ctl("ctl"); - const char* amsdb_streamtype_io("io"); - const char* amsdb_streamtype_out("out"); - const char* amsdb_streamtype_trace("trace"); + const char* amsdb_shmtype_ctl("ctl"); + const char* amsdb_shmtype_log("log"); + const char* amsdb_shmtype_out("out"); } // gen:ns_gsymbol namespace lib_ams { // gen:ns_print_proto // First element of index changed. @@ -79,10 +82,10 @@ namespace lib_ams { // gen:ns_print_proto // func:lib_ams.FDb.zd_flush.Call inline static void zd_flush_Call() __attribute__((nothrow)); // Update cycles count from previous clock capture - // func:lib_ams.FDb.cd_stream_hb.UpdateCycles - inline static void cd_stream_hb_UpdateCycles() __attribute__((nothrow)); - // func:lib_ams.FDb.cd_stream_hb.Call - inline static void cd_stream_hb_Call() __attribute__((nothrow)); + // func:lib_ams.FDb.cd_hb.UpdateCycles + inline static void cd_hb_UpdateCycles() __attribute__((nothrow)); + // func:lib_ams.FDb.cd_hb.Call + inline static void cd_hb_Call() __attribute__((nothrow)); // First element of index changed. // func:lib_ams.FDb.cd_poll_read.FirstChanged static void cd_poll_read_FirstChanged() __attribute__((nothrow)); @@ -91,8 +94,33 @@ namespace lib_ams { // gen:ns_print_proto inline static void cd_poll_read_UpdateCycles() __attribute__((nothrow)); // func:lib_ams.FDb.cd_poll_read.Call inline static void cd_poll_read_Call() __attribute__((nothrow)); - // func:lib_ams.FDb.streamtype.LoadStatic - static void streamtype_LoadStatic() __attribute__((nothrow)); + // Update cycles count from previous clock capture + // func:lib_ams.FDb.cd_slow_poll_read.UpdateCycles + inline static void cd_slow_poll_read_UpdateCycles() __attribute__((nothrow)); + // func:lib_ams.FDb.cd_slow_poll_read.Call + inline static void cd_slow_poll_read_Call() __attribute__((nothrow)); + // func:lib_ams.FDb.shmtype.LoadStatic + static void shmtype_LoadStatic() __attribute__((nothrow)); + // Find new location for ROW starting at IDX + // NOTE: Rest of heap is rearranged, but pointer to ROW is NOT stored in array. + // func:lib_ams.FDb.bh_shmember_read.Downheap + static int bh_shmember_read_Downheap(lib_ams::FShmember& row, int idx) __attribute__((nothrow)); + // Find and return index of new location for element ROW in the heap, starting at index IDX. + // Move any elements along the way but do not modify ROW. + // func:lib_ams.FDb.bh_shmember_read.Upheap + static int bh_shmember_read_Upheap(lib_ams::FShmember& row, int idx) __attribute__((nothrow)); + // func:lib_ams.FDb.bh_shmember_read.ElemLt + inline static bool bh_shmember_read_ElemLt(lib_ams::FShmember &a, lib_ams::FShmember &b) __attribute__((nothrow)); + // func:lib_ams.FDb.bh_shmember_read_curs.Add + static void _db_bh_shmember_read_curs_Add(_db_bh_shmember_read_curs &curs, lib_ams::FShmember& row); + // First element of index changed. + // func:lib_ams.FDb.bh_shmember_read.FirstChanged + static void bh_shmember_read_FirstChanged() __attribute__((nothrow)); + // Update cycles count from previous clock capture + // func:lib_ams.FDb.bh_shmember_read.UpdateCycles + inline static void bh_shmember_read_UpdateCycles() __attribute__((nothrow)); + // func:lib_ams.FDb.bh_shmember_read.Call + inline static void bh_shmember_read_Call() __attribute__((nothrow)); // find trace by row id (used to implement reflection) // func:lib_ams.FDb.trace.RowidFind static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); @@ -117,8 +145,6 @@ namespace lib_ams { // gen:ns_print_proto const char* lib_ams::value_ToCstr(const lib_ams::CtlConnCase& parent) { const char *ret = NULL; switch(value_GetEnum(parent)) { - case lib_ams_CtlConnCase_ams_AlarmSyncMsg: ret = "ams.AlarmSyncMsg"; break; - case lib_ams_CtlConnCase_ams_HeartbeatMsg: ret = "ams.HeartbeatMsg"; break; case lib_ams_CtlConnCase_fm_AlarmMsg: ret = "fm.AlarmMsg"; break; } return ret; @@ -152,19 +178,6 @@ bool lib_ams::value_SetStrptrMaybe(lib_ams::CtlConnCase& parent, algo::strptr rh } break; } - case 16: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','A','l','a','r'): { - if (memcmp(rhs.elems+8,"mSyncMsg",8)==0) { value_SetEnum(parent,lib_ams_CtlConnCase_ams_AlarmSyncMsg); ret = true; break; } - break; - } - case LE_STR8('a','m','s','.','H','e','a','r'): { - if (memcmp(rhs.elems+8,"tbeatMsg",8)==0) { value_SetEnum(parent,lib_ams_CtlConnCase_ams_HeartbeatMsg); ret = true; break; } - break; - } - } - break; - } } return ret; } @@ -202,10 +215,7 @@ bool lib_ams::CtlConnCase_ReadStrptrMaybe(lib_ams::CtlConnCase &parent, algo::st const char* lib_ams::value_ToCstr(const lib_ams::CtlMsgCase& parent) { const char *ret = NULL; switch(value_GetEnum(parent)) { - case lib_ams_CtlMsgCase_ams_DumpStreamTableMsg: ret = "ams.DumpStreamTableMsg"; break; - case lib_ams_CtlMsgCase_ams_ProcAddMsg: ret = "ams.ProcAddMsg"; break; - case lib_ams_CtlMsgCase_ams_ProcRemoveMsg: ret = "ams.ProcRemoveMsg"; break; - case lib_ams_CtlMsgCase_ams_StreamHbMsg: ret = "ams.StreamHbMsg"; break; + case lib_ams_CtlMsgCase_ams_ShmHbMsg: ret = "ams.ShmHbMsg"; break; } return ret; } @@ -229,37 +239,10 @@ void lib_ams::value_Print(const lib_ams::CtlMsgCase& parent, algo::cstring &lhs) bool lib_ams::value_SetStrptrMaybe(lib_ams::CtlMsgCase& parent, algo::strptr rhs) { bool ret = false; switch (elems_N(rhs)) { - case 14: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','P','r','o','c'): { - if (memcmp(rhs.elems+8,"AddMsg",6)==0) { value_SetEnum(parent,lib_ams_CtlMsgCase_ams_ProcAddMsg); ret = true; break; } - break; - } - } - break; - } - case 15: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','S','t','r','e'): { - if (memcmp(rhs.elems+8,"amHbMsg",7)==0) { value_SetEnum(parent,lib_ams_CtlMsgCase_ams_StreamHbMsg); ret = true; break; } - break; - } - } - break; - } - case 17: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','P','r','o','c'): { - if (memcmp(rhs.elems+8,"RemoveMsg",9)==0) { value_SetEnum(parent,lib_ams_CtlMsgCase_ams_ProcRemoveMsg); ret = true; break; } - break; - } - } - break; - } - case 22: { + case 12: { switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('a','m','s','.','D','u','m','p'): { - if (memcmp(rhs.elems+8,"StreamTableMsg",14)==0) { value_SetEnum(parent,lib_ams_CtlMsgCase_ams_DumpStreamTableMsg); ret = true; break; } + case LE_STR8('a','m','s','.','S','h','m','H'): { + if (memcmp(rhs.elems+8,"bMsg",4)==0) { value_SetEnum(parent,lib_ams_CtlMsgCase_ams_ShmHbMsg); ret = true; break; } break; } } @@ -296,6 +279,39 @@ bool lib_ams::CtlMsgCase_ReadStrptrMaybe(lib_ams::CtlMsgCase &parent, algo::strp return retval; } +// --- lib_ams.trace..Init +// Set all fields to initial values. +void lib_ams::trace_Init(lib_ams::trace& parent) { + parent.n_fdin_drop_notgt = u64(0); + parent.n_fdin_posted = u64(0); + parent.n_fdin_pushback = u64(0); + parent.n_write_block_spin = u64(0); + parent.step_cd_fdin_eof = u64(0); + parent.step_cd_fdin_eof_cycles = u64(0); + parent.step_cd_fdin_read = u64(0); + parent.step_cd_fdin_read_cycles = u64(0); + parent.step_cd_hb = u64(0); + parent.step_cd_hb_cycles = u64(0); + parent.step_zd_flush = u64(0); + parent.step_zd_flush_cycles = u64(0); + parent.step_cd_poll_read = u64(0); + parent.step_cd_poll_read_cycles = u64(0); + parent.step_cd_slow_poll_read = u64(0); + parent.step_cd_slow_poll_read_cycles = u64(0); + parent.step_bh_shmember_read = u64(0); + parent.step_bh_shmember_read_cycles = u64(0); + parent.alloc__db_fdin = u64(0); + parent.del__db_fdin = u64(0); + parent.alloc__db_shm = u64(0); + parent.del__db_shm = u64(0); + parent.alloc__db_proc = u64(0); + parent.del__db_proc = u64(0); + parent.alloc__db_shmember = u64(0); + parent.del__db_shmember = u64(0); + parent.alloc__db_shmtype = u64(0); + parent.del__db_shmtype = u64(0); +} + // --- lib_ams.trace..Print // print string representation of ROW to string STR // cfmt:lib_ams.trace.String printfmt:Tuple @@ -314,6 +330,78 @@ void lib_ams::trace_Print(lib_ams::trace& row, algo::cstring& str) { u64_Print(row.n_write_block_spin, temp); PrintAttrSpaceReset(str,"n_write_block_spin", temp); + + u64_Print(row.step_cd_fdin_eof, temp); + PrintAttrSpaceReset(str,"step_cd_fdin_eof", temp); + + u64_Print(row.step_cd_fdin_eof_cycles, temp); + PrintAttrSpaceReset(str,"step_cd_fdin_eof_cycles", temp); + + u64_Print(row.step_cd_fdin_read, temp); + PrintAttrSpaceReset(str,"step_cd_fdin_read", temp); + + u64_Print(row.step_cd_fdin_read_cycles, temp); + PrintAttrSpaceReset(str,"step_cd_fdin_read_cycles", temp); + + u64_Print(row.step_cd_hb, temp); + PrintAttrSpaceReset(str,"step_cd_hb", temp); + + u64_Print(row.step_cd_hb_cycles, temp); + PrintAttrSpaceReset(str,"step_cd_hb_cycles", temp); + + u64_Print(row.step_zd_flush, temp); + PrintAttrSpaceReset(str,"step_zd_flush", temp); + + u64_Print(row.step_zd_flush_cycles, temp); + PrintAttrSpaceReset(str,"step_zd_flush_cycles", temp); + + u64_Print(row.step_cd_poll_read, temp); + PrintAttrSpaceReset(str,"step_cd_poll_read", temp); + + u64_Print(row.step_cd_poll_read_cycles, temp); + PrintAttrSpaceReset(str,"step_cd_poll_read_cycles", temp); + + u64_Print(row.step_cd_slow_poll_read, temp); + PrintAttrSpaceReset(str,"step_cd_slow_poll_read", temp); + + u64_Print(row.step_cd_slow_poll_read_cycles, temp); + PrintAttrSpaceReset(str,"step_cd_slow_poll_read_cycles", temp); + + u64_Print(row.step_bh_shmember_read, temp); + PrintAttrSpaceReset(str,"step_bh_shmember_read", temp); + + u64_Print(row.step_bh_shmember_read_cycles, temp); + PrintAttrSpaceReset(str,"step_bh_shmember_read_cycles", temp); + + u64_Print(row.alloc__db_fdin, temp); + PrintAttrSpaceReset(str,"alloc__db_fdin", temp); + + u64_Print(row.del__db_fdin, temp); + PrintAttrSpaceReset(str,"del__db_fdin", temp); + + u64_Print(row.alloc__db_shm, temp); + PrintAttrSpaceReset(str,"alloc__db_shm", temp); + + u64_Print(row.del__db_shm, temp); + PrintAttrSpaceReset(str,"del__db_shm", temp); + + u64_Print(row.alloc__db_proc, temp); + PrintAttrSpaceReset(str,"alloc__db_proc", temp); + + u64_Print(row.del__db_proc, temp); + PrintAttrSpaceReset(str,"del__db_proc", temp); + + u64_Print(row.alloc__db_shmember, temp); + PrintAttrSpaceReset(str,"alloc__db_shmember", temp); + + u64_Print(row.del__db_shmember, temp); + PrintAttrSpaceReset(str,"del__db_shmember", temp); + + u64_Print(row.alloc__db_shmtype, temp); + PrintAttrSpaceReset(str,"alloc__db_shmtype", temp); + + u64_Print(row.del__db_shmtype, temp); + PrintAttrSpaceReset(str,"del__db_shmtype", temp); } // --- lib_ams.FDb.fdin.Alloc @@ -333,6 +421,7 @@ lib_ams::FFdin* lib_ams::fdin_AllocMaybe() { lib_ams::FFdin *row = (lib_ams::FFdin*)fdin_AllocMem(); if (row) { new (row) lib_ams::FFdin; // call constructor + ++lib_ams::_db.trace.alloc__db_fdin; } return row; } @@ -366,6 +455,7 @@ void* lib_ams::fdin_AllocMem() { // --- lib_ams.FDb.fdin.RemoveAll // Remove all elements from Lary void lib_ams::fdin_RemoveAll() { + lib_ams::_db.trace.del__db_fdin += _db.fdin_n; for (u64 n = _db.fdin_n; n>0; ) { n--; fdin_qFind(u64(n)).~FFdin(); // destroy last element @@ -380,6 +470,7 @@ void lib_ams::fdin_RemoveLast() { if (n > 0) { n -= 1; fdin_qFind(u64(n)).~FFdin(); + ++lib_ams::_db.trace.del__db_fdin; _db.fdin_n = i32(n); } } @@ -495,6 +586,9 @@ static void lib_ams::cd_fdin_eof_FirstChanged() { // Update cycles count from previous clock capture inline static void lib_ams::cd_fdin_eof_UpdateCycles() { u64 cur_cycles = algo::get_cycles(); + u64 prev_cycles = algo_lib::_db.clock.value; + ++lib_ams::_db.trace.step_cd_fdin_eof; + lib_ams::_db.trace.step_cd_fdin_eof_cycles += cur_cycles - prev_cycles; algo_lib::_db.clock = algo::SchedTime(cur_cycles); } @@ -609,6 +703,9 @@ static void lib_ams::cd_fdin_read_FirstChanged() { // Update cycles count from previous clock capture inline static void lib_ams::cd_fdin_read_UpdateCycles() { u64 cur_cycles = algo::get_cycles(); + u64 prev_cycles = algo_lib::_db.clock.value; + ++lib_ams::_db.trace.step_cd_fdin_read; + lib_ams::_db.trace.step_cd_fdin_read_cycles += cur_cycles - prev_cycles; algo_lib::_db.clock = algo::SchedTime(cur_cycles); } @@ -626,9 +723,11 @@ inline static void lib_ams::cd_fdin_read_Call() { void lib_ams::Step() { cd_fdin_eof_Call(); cd_fdin_read_Call(); - cd_stream_hb_Call(); + cd_hb_Call(); zd_flush_Call(); cd_poll_read_Call(); + cd_slow_poll_read_Call(); + bh_shmember_read_Call(); } // --- lib_ams.FDb._db.InitReflection @@ -648,8 +747,8 @@ static void lib_ams::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'lib_ams.CtlConn' signature:'a97117f47887d9e386b0b46863db70bcc5ee1d43'"); - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'lib_ams.CtlMsg' signature:'90f280b1d0ea224349fab6afa67209c80742b8f4'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'lib_ams.CtlConn' signature:'83624960d9b39fa4bb8b968922178ca988f4bf18'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'lib_ams.CtlMsg' signature:'ed438eec919efe449c056873abddbc2332d54b53'"); } // --- lib_ams.FDb._db.InsertStrptrMaybe @@ -672,8 +771,8 @@ bool lib_ams::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && lib_ams::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -847,6 +946,9 @@ void lib_ams::zd_flush_FirstChanged() { // Update cycles count from previous clock capture inline static void lib_ams::zd_flush_UpdateCycles() { u64 cur_cycles = algo::get_cycles(); + u64 prev_cycles = algo_lib::_db.clock.value; + ++lib_ams::_db.trace.step_zd_flush; + lib_ams::_db.trace.step_zd_flush_cycles += cur_cycles - prev_cycles; algo_lib::_db.clock = algo::SchedTime(cur_cycles); } @@ -876,340 +978,357 @@ void lib_ams::zd_flush_SetDelay(algo::SchedTime delay) { } } -// --- lib_ams.FDb.stream.Alloc +// --- lib_ams.FDb.shm.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -lib_ams::FStream& lib_ams::stream_Alloc() { - lib_ams::FStream* row = stream_AllocMaybe(); +lib_ams::FShm& lib_ams::shm_Alloc() { + lib_ams::FShm* row = shm_AllocMaybe(); if (UNLIKELY(row == NULL)) { - FatalErrorExit("lib_ams.out_of_mem field:lib_ams.FDb.stream comment:'Alloc failed'"); + FatalErrorExit("lib_ams.out_of_mem field:lib_ams.FDb.shm comment:'Alloc failed'"); } return *row; } -// --- lib_ams.FDb.stream.AllocMaybe +// --- lib_ams.FDb.shm.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -lib_ams::FStream* lib_ams::stream_AllocMaybe() { - lib_ams::FStream *row = (lib_ams::FStream*)stream_AllocMem(); +lib_ams::FShm* lib_ams::shm_AllocMaybe() { + lib_ams::FShm *row = (lib_ams::FShm*)shm_AllocMem(); if (row) { - new (row) lib_ams::FStream; // call constructor + new (row) lib_ams::FShm; // call constructor + ++lib_ams::_db.trace.alloc__db_shm; } return row; } -// --- lib_ams.FDb.stream.AllocMem +// --- lib_ams.FDb.shm.AllocMem // Allocate space for one element. If no memory available, return NULL. -void* lib_ams::stream_AllocMem() { - u64 new_nelems = _db.stream_n+1; +void* lib_ams::shm_AllocMem() { + u64 new_nelems = _db.shm_n+1; // compute level and index on level u64 bsr = algo::u64_BitScanReverse(new_nelems); u64 base = u64(1)<0; ) { +void lib_ams::shm_RemoveAll() { + lib_ams::_db.trace.del__db_shm += _db.shm_n; + for (u64 n = _db.shm_n; n>0; ) { n--; - stream_qFind(u64(n)).~FStream(); // destroy last element - _db.stream_n = i32(n); + shm_qFind(u64(n)).~FShm(); // destroy last element + _db.shm_n = i32(n); } } -// --- lib_ams.FDb.stream.RemoveLast +// --- lib_ams.FDb.shm.RemoveLast // Delete last element of array. Do nothing if array is empty. -void lib_ams::stream_RemoveLast() { - u64 n = _db.stream_n; +void lib_ams::shm_RemoveLast() { + u64 n = _db.shm_n; if (n > 0) { n -= 1; - stream_qFind(u64(n)).~FStream(); - _db.stream_n = i32(n); + shm_qFind(u64(n)).~FShm(); + ++lib_ams::_db.trace.del__db_shm; + _db.shm_n = i32(n); } } -// --- lib_ams.FDb.stream.XrefMaybe +// --- lib_ams.FDb.shm.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool lib_ams::stream_XrefMaybe(lib_ams::FStream &row) { +bool lib_ams::shm_XrefMaybe(lib_ams::FShm &row) { bool retval = true; (void)row; - lib_ams::FStreamType* p_stream_type = lib_ams::ind_streamtype_Find(row.stream_id.stream_type); - if (UNLIKELY(!p_stream_type)) { - algo_lib::ResetErrtext() << "lib_ams.bad_xref index:lib_ams.FDb.ind_streamtype" << Keyval("key", row.stream_id.stream_type); + lib_ams::FShmtype* p_shmtype = lib_ams::ind_shmtype_Find(row.shm_id.shmtype); + if (UNLIKELY(!p_shmtype)) { + algo_lib::ResetErrtext() << "lib_ams.bad_xref index:lib_ams.FDb.ind_shmtype" << Keyval("key", row.shm_id.shmtype); return false; } - // stream: save pointer to stream_type + // shm: save pointer to shmtype if (true) { // user-defined insert condition - row.p_streamtype = p_stream_type; + row.p_shmtype = p_shmtype; } - // insert stream into index ind_stream + // insert shm into index ind_shm if (true) { // user-defined insert condition - bool success = ind_stream_InsertMaybe(row); + bool success = ind_shm_InsertMaybe(row); if (UNLIKELY(!success)) { ch_RemoveAll(algo_lib::_db.errtext); - algo_lib::_db.errtext << "lib_ams.duplicate_key xref:lib_ams.FDb.ind_stream"; // check for duplicate key + algo_lib::_db.errtext << "lib_ams.duplicate_key xref:lib_ams.FDb.ind_shm"; // check for duplicate key return false; } } + lib_ams::FProc* p_proc_id = lib_ams::ind_proc_Find(row.shm_id.proc_id); + if (UNLIKELY(!p_proc_id)) { + algo_lib::ResetErrtext() << "lib_ams.bad_xref index:lib_ams.FDb.ind_proc" << Keyval("key", row.shm_id.proc_id); + return false; + } + // insert shm into index c_shm + if (true) { // user-defined insert condition + c_shm_Insert(*p_proc_id, row); + } return retval; } -// --- lib_ams.FDb.ind_stream.Find +// --- lib_ams.FDb.ind_shm.Find // Find row by key. Return NULL if not found. -lib_ams::FStream* lib_ams::ind_stream_Find(ams::StreamId key) { - u32 index = ams::StreamId_Hash(0, key) & (_db.ind_stream_buckets_n - 1); - lib_ams::FStream* *e = &_db.ind_stream_buckets_elems[index]; - lib_ams::FStream* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).stream_id == key; - if (done) break; - e = &ret->ind_stream_next; - } while (true); +lib_ams::FShm* lib_ams::ind_shm_Find(ams::ShmId key) { + u32 index = ams::ShmId_Hash(0, key) & (_db.ind_shm_buckets_n - 1); + lib_ams::FShm *ret = _db.ind_shm_buckets_elems[index]; + for (; ret && !((*ret).shm_id == key); ret = ret->ind_shm_next) { + } return ret; } -// --- lib_ams.FDb.ind_stream.FindX +// --- lib_ams.FDb.ind_shm.FindX // Look up row by key and return reference. Throw exception if not found -lib_ams::FStream& lib_ams::ind_stream_FindX(ams::StreamId key) { - lib_ams::FStream* ret = ind_stream_Find(key); - vrfy(ret, tempstr() << "lib_ams.key_error table:ind_stream key:'"<ind_stream_next; + prev = &ret->ind_shm_next; } while (true); if (retval) { - row.ind_stream_next = *prev; - _db.ind_stream_n++; + row.ind_shm_next = *prev; + _db.ind_shm_n++; *prev = &row; } } return retval; } -// --- lib_ams.FDb.ind_stream.Remove +// --- lib_ams.FDb.ind_shm.Remove // Remove reference to element from hash index. If element is not in hash, do nothing -void lib_ams::ind_stream_Remove(lib_ams::FStream& row) { - if (LIKELY(row.ind_stream_next != (lib_ams::FStream*)-1)) {// check if in hash already - u32 index = ams::StreamId_Hash(0, row.stream_id) & (_db.ind_stream_buckets_n - 1); - lib_ams::FStream* *prev = &_db.ind_stream_buckets_elems[index]; // addr of pointer to current element - while (lib_ams::FStream *next = *prev) { // scan the collision chain for our element +void lib_ams::ind_shm_Remove(lib_ams::FShm& row) { + if (LIKELY(row.ind_shm_next != (lib_ams::FShm*)-1)) {// check if in hash already + u32 index = row.ind_shm_hashval & (_db.ind_shm_buckets_n - 1); + lib_ams::FShm* *prev = &_db.ind_shm_buckets_elems[index]; // addr of pointer to current element + while (lib_ams::FShm *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_stream_next; // unlink (singly linked list) - _db.ind_stream_n--; - row.ind_stream_next = (lib_ams::FStream*)-1;// not-in-hash + *prev = next->ind_shm_next; // unlink (singly linked list) + _db.ind_shm_n--; + row.ind_shm_next = (lib_ams::FShm*)-1;// not-in-hash break; } - prev = &next->ind_stream_next; + prev = &next->ind_shm_next; } } } -// --- lib_ams.FDb.ind_stream.Reserve +// --- lib_ams.FDb.ind_shm.Reserve // Reserve enough room in the hash for N more elements. Return success code. -void lib_ams::ind_stream_Reserve(int n) { - u32 old_nbuckets = _db.ind_stream_buckets_n; - u32 new_nelems = _db.ind_stream_n + n; +void lib_ams::ind_shm_Reserve(int n) { + ind_shm_AbsReserve(_db.ind_shm_n + n); +} + +// --- lib_ams.FDb.ind_shm.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_ams::ind_shm_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_shm_buckets_n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); - u32 old_size = old_nbuckets * sizeof(lib_ams::FStream*); - u32 new_size = new_nbuckets * sizeof(lib_ams::FStream*); + u32 old_size = old_nbuckets * sizeof(lib_ams::FShm*); + u32 new_size = new_nbuckets * sizeof(lib_ams::FShm*); // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably // means new memory will have to be allocated anyway - lib_ams::FStream* *new_buckets = (lib_ams::FStream**)algo_lib::malloc_AllocMem(new_size); + lib_ams::FShm* *new_buckets = (lib_ams::FShm**)algo_lib::malloc_AllocMem(new_size); if (UNLIKELY(!new_buckets)) { - FatalErrorExit("lib_ams.out_of_memory field:lib_ams.FDb.ind_stream"); + FatalErrorExit("lib_ams.out_of_memory field:lib_ams.FDb.ind_shm"); } memset(new_buckets, 0, new_size); // clear pointers // rehash all entries - for (int i = 0; i < _db.ind_stream_buckets_n; i++) { - lib_ams::FStream* elem = _db.ind_stream_buckets_elems[i]; + for (int i = 0; i < _db.ind_shm_buckets_n; i++) { + lib_ams::FShm* elem = _db.ind_shm_buckets_elems[i]; while (elem) { - lib_ams::FStream &row = *elem; - lib_ams::FStream* next = row.ind_stream_next; - u32 index = ams::StreamId_Hash(0, row.stream_id) & (new_nbuckets-1); - row.ind_stream_next = new_buckets[index]; + lib_ams::FShm &row = *elem; + lib_ams::FShm* next = row.ind_shm_next; + u32 index = row.ind_shm_hashval & (new_nbuckets-1); + row.ind_shm_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } } // free old array - algo_lib::malloc_FreeMem(_db.ind_stream_buckets_elems, old_size); - _db.ind_stream_buckets_elems = new_buckets; - _db.ind_stream_buckets_n = new_nbuckets; + algo_lib::malloc_FreeMem(_db.ind_shm_buckets_elems, old_size); + _db.ind_shm_buckets_elems = new_buckets; + _db.ind_shm_buckets_n = new_nbuckets; } } -// --- lib_ams.FDb.cd_stream_hb.Insert +// --- lib_ams.FDb.cd_hb.Insert // Insert row into linked list. If row is already in linked list, do nothing. -void lib_ams::cd_stream_hb_Insert(lib_ams::FStream& row) { - if (!cd_stream_hb_InLlistQ(row)) { - if (_db.cd_stream_hb_head) { - row.cd_stream_hb_next = _db.cd_stream_hb_head; - row.cd_stream_hb_prev = _db.cd_stream_hb_head->cd_stream_hb_prev; - row.cd_stream_hb_prev->cd_stream_hb_next = &row; - row.cd_stream_hb_next->cd_stream_hb_prev = &row; +void lib_ams::cd_hb_Insert(lib_ams::FShmember& row) { + if (!cd_hb_InLlistQ(row)) { + if (_db.cd_hb_head) { + row.cd_hb_next = _db.cd_hb_head; + row.cd_hb_prev = _db.cd_hb_head->cd_hb_prev; + row.cd_hb_prev->cd_hb_next = &row; + row.cd_hb_next->cd_hb_prev = &row; } else { - row.cd_stream_hb_next = &row; - row.cd_stream_hb_prev = &row; - _db.cd_stream_hb_head = &row; + row.cd_hb_next = &row; + row.cd_hb_prev = &row; + _db.cd_hb_head = &row; } - _db.cd_stream_hb_n++; - if (_db.cd_stream_hb_head == &row) { - cd_stream_hb_FirstChanged(); + _db.cd_hb_n++; + if (_db.cd_hb_head == &row) { + cd_hb_FirstChanged(); } } } -// --- lib_ams.FDb.cd_stream_hb.Remove +// --- lib_ams.FDb.cd_hb.Remove // Remove element from index. If element is not in index, do nothing. -void lib_ams::cd_stream_hb_Remove(lib_ams::FStream& row) { - if (cd_stream_hb_InLlistQ(row)) { - lib_ams::FStream* old_head = _db.cd_stream_hb_head; +void lib_ams::cd_hb_Remove(lib_ams::FShmember& row) { + if (cd_hb_InLlistQ(row)) { + lib_ams::FShmember* old_head = _db.cd_hb_head; (void)old_head; // in case it's not used - lib_ams::FStream *oldnext = row.cd_stream_hb_next; - lib_ams::FStream *oldprev = row.cd_stream_hb_prev; - oldnext->cd_stream_hb_prev = oldprev; // remove element from list - oldprev->cd_stream_hb_next = oldnext; - _db.cd_stream_hb_n--; // adjust count - if (&row == _db.cd_stream_hb_head) { - _db.cd_stream_hb_head = oldnext==&row ? NULL : oldnext; // adjust list head + lib_ams::FShmember *oldnext = row.cd_hb_next; + lib_ams::FShmember *oldprev = row.cd_hb_prev; + oldnext->cd_hb_prev = oldprev; // remove element from list + oldprev->cd_hb_next = oldnext; + _db.cd_hb_n--; // adjust count + if (&row == _db.cd_hb_head) { + _db.cd_hb_head = oldnext==&row ? NULL : oldnext; // adjust list head } - row.cd_stream_hb_next = (lib_ams::FStream*)-1; // mark element as not-in-list); - row.cd_stream_hb_prev = NULL; // clear back-pointer - if (old_head != _db.cd_stream_hb_head) { - cd_stream_hb_FirstChanged(); + row.cd_hb_next = (lib_ams::FShmember*)-1; // mark element as not-in-list); + row.cd_hb_prev = NULL; // clear back-pointer + if (old_head != _db.cd_hb_head) { + cd_hb_FirstChanged(); } } } -// --- lib_ams.FDb.cd_stream_hb.RemoveAll +// --- lib_ams.FDb.cd_hb.RemoveAll // Empty the index. (The rows are not deleted) -void lib_ams::cd_stream_hb_RemoveAll() { - lib_ams::FStream* row = _db.cd_stream_hb_head; - lib_ams::FStream* head = _db.cd_stream_hb_head; - _db.cd_stream_hb_head = NULL; - _db.cd_stream_hb_n = 0; +void lib_ams::cd_hb_RemoveAll() { + lib_ams::FShmember* row = _db.cd_hb_head; + lib_ams::FShmember* head = _db.cd_hb_head; + _db.cd_hb_head = NULL; + _db.cd_hb_n = 0; bool do_fire = (NULL != row); while (row) { - lib_ams::FStream* row_next = row->cd_stream_hb_next; - row->cd_stream_hb_next = (lib_ams::FStream*)-1; - row->cd_stream_hb_prev = NULL; + lib_ams::FShmember* row_next = row->cd_hb_next; + row->cd_hb_next = (lib_ams::FShmember*)-1; + row->cd_hb_prev = NULL; row = row_next != head ? row_next : NULL; } if (do_fire) { - cd_stream_hb_FirstChanged(); + cd_hb_FirstChanged(); } } -// --- lib_ams.FDb.cd_stream_hb.RemoveFirst +// --- lib_ams.FDb.cd_hb.RemoveFirst // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. // Call FirstChanged trigger. -lib_ams::FStream* lib_ams::cd_stream_hb_RemoveFirst() { - lib_ams::FStream *row = NULL; - row = _db.cd_stream_hb_head; +lib_ams::FShmember* lib_ams::cd_hb_RemoveFirst() { + lib_ams::FShmember *row = NULL; + row = _db.cd_hb_head; if (row) { - bool hasmore = row!=row->cd_stream_hb_next; - _db.cd_stream_hb_head = hasmore ? row->cd_stream_hb_next : NULL; - row->cd_stream_hb_next->cd_stream_hb_prev = row->cd_stream_hb_prev; - row->cd_stream_hb_prev->cd_stream_hb_next = row->cd_stream_hb_next; - row->cd_stream_hb_prev = NULL; - _db.cd_stream_hb_n--; - row->cd_stream_hb_next = (lib_ams::FStream*)-1; // mark as not-in-list - cd_stream_hb_FirstChanged(); + bool hasmore = row!=row->cd_hb_next; + _db.cd_hb_head = hasmore ? row->cd_hb_next : NULL; + row->cd_hb_next->cd_hb_prev = row->cd_hb_prev; + row->cd_hb_prev->cd_hb_next = row->cd_hb_next; + row->cd_hb_prev = NULL; + _db.cd_hb_n--; + row->cd_hb_next = (lib_ams::FShmember*)-1; // mark as not-in-list + cd_hb_FirstChanged(); } return row; } -// --- lib_ams.FDb.cd_stream_hb.RotateFirst +// --- lib_ams.FDb.cd_hb.RotateFirst // If linked list is empty, return NULL. // Otherwise return head item and advance head to the next item. -lib_ams::FStream* lib_ams::cd_stream_hb_RotateFirst() { - lib_ams::FStream *row = NULL; - row = _db.cd_stream_hb_head; +lib_ams::FShmember* lib_ams::cd_hb_RotateFirst() { + lib_ams::FShmember *row = NULL; + row = _db.cd_hb_head; if (row) { - _db.cd_stream_hb_head = row->cd_stream_hb_next; + _db.cd_hb_head = row->cd_hb_next; } return row; } -// --- lib_ams.FDb.cd_stream_hb.FirstChanged +// --- lib_ams.FDb.cd_hb.FirstChanged // First element of index changed. -void lib_ams::cd_stream_hb_FirstChanged() { +void lib_ams::cd_hb_FirstChanged() { } -// --- lib_ams.FDb.cd_stream_hb.UpdateCycles +// --- lib_ams.FDb.cd_hb.UpdateCycles // Update cycles count from previous clock capture -inline static void lib_ams::cd_stream_hb_UpdateCycles() { +inline static void lib_ams::cd_hb_UpdateCycles() { u64 cur_cycles = algo::get_cycles(); + u64 prev_cycles = algo_lib::_db.clock.value; + ++lib_ams::_db.trace.step_cd_hb; + lib_ams::_db.trace.step_cd_hb_cycles += cur_cycles - prev_cycles; algo_lib::_db.clock = algo::SchedTime(cur_cycles); } -// --- lib_ams.FDb.cd_stream_hb.Call -inline static void lib_ams::cd_stream_hb_Call() { - if (!lib_ams::cd_stream_hb_EmptyQ()) { // fstep:lib_ams.FDb.cd_stream_hb - if (lib_ams::_db.cd_stream_hb_next < algo_lib::_db.clock) { - u64 effective_delay = lib_ams::_db.cd_stream_hb_delay / u64_Max(1,lib_ams::cd_stream_hb_N()); - lib_ams::_db.cd_stream_hb_next = algo_lib::_db.clock + algo::SchedTime(effective_delay); - lib_ams::cd_stream_hb_Step(); // steptype:InlineRecur: call function every N clock cycles - cd_stream_hb_UpdateCycles(); +// --- lib_ams.FDb.cd_hb.Call +inline static void lib_ams::cd_hb_Call() { + if (!lib_ams::cd_hb_EmptyQ()) { // fstep:lib_ams.FDb.cd_hb + if (lib_ams::_db.cd_hb_next < algo_lib::_db.clock) { + u64 effective_delay = lib_ams::_db.cd_hb_delay / u64_Max(1,lib_ams::cd_hb_N()); + lib_ams::_db.cd_hb_next = algo_lib::_db.clock + algo::SchedTime(effective_delay); + lib_ams::cd_hb_Step(); // steptype:InlineRecur: call function every N clock cycles + cd_hb_UpdateCycles(); } - algo_lib::_db.next_loop.value = u64_Min(lib_ams::_db.cd_stream_hb_next, algo_lib::_db.next_loop); + algo_lib::_db.next_loop.value = u64_Min(lib_ams::_db.cd_hb_next, algo_lib::_db.next_loop); } } -// --- lib_ams.FDb.cd_stream_hb.SetDelay +// --- lib_ams.FDb.cd_hb.SetDelay // Set inter-step delay to specified value. // The difference between new delay and current delay is added to the next scheduled time. -void lib_ams::cd_stream_hb_SetDelay(algo::SchedTime delay) { - i64 diff = delay.value - lib_ams::_db.cd_stream_hb_delay.value; - lib_ams::_db.cd_stream_hb_delay = delay; +void lib_ams::cd_hb_SetDelay(algo::SchedTime delay) { + i64 diff = delay.value - lib_ams::_db.cd_hb_delay.value; + lib_ams::_db.cd_hb_delay = delay; if (diff > 0) { - lib_ams::_db.cd_stream_hb_next.value += diff; + lib_ams::_db.cd_hb_next.value += diff; } else { - lib_ams::_db.cd_stream_hb_next.value = algo::u64_SubClip(lib_ams::_db.cd_stream_hb_next.value,-diff); + lib_ams::_db.cd_hb_next.value = algo::u64_SubClip(lib_ams::_db.cd_hb_next.value,-diff); } } // --- lib_ams.FDb.cd_poll_read.Insert // Insert row into linked list. If row is already in linked list, do nothing. -void lib_ams::cd_poll_read_Insert(lib_ams::FStream& row) { +void lib_ams::cd_poll_read_Insert(lib_ams::FShmember& row) { if (!cd_poll_read_InLlistQ(row)) { if (_db.cd_poll_read_head) { row.cd_poll_read_next = _db.cd_poll_read_head; @@ -1230,19 +1349,19 @@ void lib_ams::cd_poll_read_Insert(lib_ams::FStream& row) { // --- lib_ams.FDb.cd_poll_read.Remove // Remove element from index. If element is not in index, do nothing. -void lib_ams::cd_poll_read_Remove(lib_ams::FStream& row) { +void lib_ams::cd_poll_read_Remove(lib_ams::FShmember& row) { if (cd_poll_read_InLlistQ(row)) { - lib_ams::FStream* old_head = _db.cd_poll_read_head; + lib_ams::FShmember* old_head = _db.cd_poll_read_head; (void)old_head; // in case it's not used - lib_ams::FStream *oldnext = row.cd_poll_read_next; - lib_ams::FStream *oldprev = row.cd_poll_read_prev; + lib_ams::FShmember *oldnext = row.cd_poll_read_next; + lib_ams::FShmember *oldprev = row.cd_poll_read_prev; oldnext->cd_poll_read_prev = oldprev; // remove element from list oldprev->cd_poll_read_next = oldnext; _db.cd_poll_read_n--; // adjust count if (&row == _db.cd_poll_read_head) { _db.cd_poll_read_head = oldnext==&row ? NULL : oldnext; // adjust list head } - row.cd_poll_read_next = (lib_ams::FStream*)-1; // mark element as not-in-list); + row.cd_poll_read_next = (lib_ams::FShmember*)-1; // mark element as not-in-list); row.cd_poll_read_prev = NULL; // clear back-pointer if (old_head != _db.cd_poll_read_head) { cd_poll_read_FirstChanged(); @@ -1253,14 +1372,14 @@ void lib_ams::cd_poll_read_Remove(lib_ams::FStream& row) { // --- lib_ams.FDb.cd_poll_read.RemoveAll // Empty the index. (The rows are not deleted) void lib_ams::cd_poll_read_RemoveAll() { - lib_ams::FStream* row = _db.cd_poll_read_head; - lib_ams::FStream* head = _db.cd_poll_read_head; + lib_ams::FShmember* row = _db.cd_poll_read_head; + lib_ams::FShmember* head = _db.cd_poll_read_head; _db.cd_poll_read_head = NULL; _db.cd_poll_read_n = 0; bool do_fire = (NULL != row); while (row) { - lib_ams::FStream* row_next = row->cd_poll_read_next; - row->cd_poll_read_next = (lib_ams::FStream*)-1; + lib_ams::FShmember* row_next = row->cd_poll_read_next; + row->cd_poll_read_next = (lib_ams::FShmember*)-1; row->cd_poll_read_prev = NULL; row = row_next != head ? row_next : NULL; } @@ -1272,8 +1391,8 @@ void lib_ams::cd_poll_read_RemoveAll() { // --- lib_ams.FDb.cd_poll_read.RemoveFirst // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. // Call FirstChanged trigger. -lib_ams::FStream* lib_ams::cd_poll_read_RemoveFirst() { - lib_ams::FStream *row = NULL; +lib_ams::FShmember* lib_ams::cd_poll_read_RemoveFirst() { + lib_ams::FShmember *row = NULL; row = _db.cd_poll_read_head; if (row) { bool hasmore = row!=row->cd_poll_read_next; @@ -1282,7 +1401,7 @@ lib_ams::FStream* lib_ams::cd_poll_read_RemoveFirst() { row->cd_poll_read_prev->cd_poll_read_next = row->cd_poll_read_next; row->cd_poll_read_prev = NULL; _db.cd_poll_read_n--; - row->cd_poll_read_next = (lib_ams::FStream*)-1; // mark as not-in-list + row->cd_poll_read_next = (lib_ams::FShmember*)-1; // mark as not-in-list cd_poll_read_FirstChanged(); } return row; @@ -1291,8 +1410,8 @@ lib_ams::FStream* lib_ams::cd_poll_read_RemoveFirst() { // --- lib_ams.FDb.cd_poll_read.RotateFirst // If linked list is empty, return NULL. // Otherwise return head item and advance head to the next item. -lib_ams::FStream* lib_ams::cd_poll_read_RotateFirst() { - lib_ams::FStream *row = NULL; +lib_ams::FShmember* lib_ams::cd_poll_read_RotateFirst() { + lib_ams::FShmember *row = NULL; row = _db.cd_poll_read_head; if (row) { _db.cd_poll_read_head = row->cd_poll_read_next; @@ -1309,6 +1428,9 @@ static void lib_ams::cd_poll_read_FirstChanged() { // Update cycles count from previous clock capture inline static void lib_ams::cd_poll_read_UpdateCycles() { u64 cur_cycles = algo::get_cycles(); + u64 prev_cycles = algo_lib::_db.clock.value; + ++lib_ams::_db.trace.step_cd_poll_read; + lib_ams::_db.trace.step_cd_poll_read_cycles += cur_cycles - prev_cycles; algo_lib::_db.clock = algo::SchedTime(cur_cycles); } @@ -1321,6 +1443,139 @@ inline static void lib_ams::cd_poll_read_Call() { } } +// --- lib_ams.FDb.cd_slow_poll_read.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void lib_ams::cd_slow_poll_read_Insert(lib_ams::FShmember& row) { + if (!cd_slow_poll_read_InLlistQ(row)) { + if (_db.cd_slow_poll_read_head) { + row.cd_slow_poll_read_next = _db.cd_slow_poll_read_head; + row.cd_slow_poll_read_prev = _db.cd_slow_poll_read_head->cd_slow_poll_read_prev; + row.cd_slow_poll_read_prev->cd_slow_poll_read_next = &row; + row.cd_slow_poll_read_next->cd_slow_poll_read_prev = &row; + } else { + row.cd_slow_poll_read_next = &row; + row.cd_slow_poll_read_prev = &row; + _db.cd_slow_poll_read_head = &row; + } + _db.cd_slow_poll_read_n++; + if (_db.cd_slow_poll_read_head == &row) { + cd_slow_poll_read_FirstChanged(); + } + } +} + +// --- lib_ams.FDb.cd_slow_poll_read.Remove +// Remove element from index. If element is not in index, do nothing. +void lib_ams::cd_slow_poll_read_Remove(lib_ams::FShmember& row) { + if (cd_slow_poll_read_InLlistQ(row)) { + lib_ams::FShmember* old_head = _db.cd_slow_poll_read_head; + (void)old_head; // in case it's not used + lib_ams::FShmember *oldnext = row.cd_slow_poll_read_next; + lib_ams::FShmember *oldprev = row.cd_slow_poll_read_prev; + oldnext->cd_slow_poll_read_prev = oldprev; // remove element from list + oldprev->cd_slow_poll_read_next = oldnext; + _db.cd_slow_poll_read_n--; // adjust count + if (&row == _db.cd_slow_poll_read_head) { + _db.cd_slow_poll_read_head = oldnext==&row ? NULL : oldnext; // adjust list head + } + row.cd_slow_poll_read_next = (lib_ams::FShmember*)-1; // mark element as not-in-list); + row.cd_slow_poll_read_prev = NULL; // clear back-pointer + if (old_head != _db.cd_slow_poll_read_head) { + cd_slow_poll_read_FirstChanged(); + } + } +} + +// --- lib_ams.FDb.cd_slow_poll_read.RemoveAll +// Empty the index. (The rows are not deleted) +void lib_ams::cd_slow_poll_read_RemoveAll() { + lib_ams::FShmember* row = _db.cd_slow_poll_read_head; + lib_ams::FShmember* head = _db.cd_slow_poll_read_head; + _db.cd_slow_poll_read_head = NULL; + _db.cd_slow_poll_read_n = 0; + bool do_fire = (NULL != row); + while (row) { + lib_ams::FShmember* row_next = row->cd_slow_poll_read_next; + row->cd_slow_poll_read_next = (lib_ams::FShmember*)-1; + row->cd_slow_poll_read_prev = NULL; + row = row_next != head ? row_next : NULL; + } + if (do_fire) { + cd_slow_poll_read_FirstChanged(); + } +} + +// --- lib_ams.FDb.cd_slow_poll_read.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// Call FirstChanged trigger. +lib_ams::FShmember* lib_ams::cd_slow_poll_read_RemoveFirst() { + lib_ams::FShmember *row = NULL; + row = _db.cd_slow_poll_read_head; + if (row) { + bool hasmore = row!=row->cd_slow_poll_read_next; + _db.cd_slow_poll_read_head = hasmore ? row->cd_slow_poll_read_next : NULL; + row->cd_slow_poll_read_next->cd_slow_poll_read_prev = row->cd_slow_poll_read_prev; + row->cd_slow_poll_read_prev->cd_slow_poll_read_next = row->cd_slow_poll_read_next; + row->cd_slow_poll_read_prev = NULL; + _db.cd_slow_poll_read_n--; + row->cd_slow_poll_read_next = (lib_ams::FShmember*)-1; // mark as not-in-list + cd_slow_poll_read_FirstChanged(); + } + return row; +} + +// --- lib_ams.FDb.cd_slow_poll_read.RotateFirst +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +lib_ams::FShmember* lib_ams::cd_slow_poll_read_RotateFirst() { + lib_ams::FShmember *row = NULL; + row = _db.cd_slow_poll_read_head; + if (row) { + _db.cd_slow_poll_read_head = row->cd_slow_poll_read_next; + } + return row; +} + +// --- lib_ams.FDb.cd_slow_poll_read.FirstChanged +// First element of index changed. +void lib_ams::cd_slow_poll_read_FirstChanged() { +} + +// --- lib_ams.FDb.cd_slow_poll_read.UpdateCycles +// Update cycles count from previous clock capture +inline static void lib_ams::cd_slow_poll_read_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + u64 prev_cycles = algo_lib::_db.clock.value; + ++lib_ams::_db.trace.step_cd_slow_poll_read; + lib_ams::_db.trace.step_cd_slow_poll_read_cycles += cur_cycles - prev_cycles; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- lib_ams.FDb.cd_slow_poll_read.Call +inline static void lib_ams::cd_slow_poll_read_Call() { + if (!lib_ams::cd_slow_poll_read_EmptyQ()) { // fstep:lib_ams.FDb.cd_slow_poll_read + if (lib_ams::_db.cd_slow_poll_read_next < algo_lib::_db.clock) { + lib_ams::_db.cd_slow_poll_read_next = algo_lib::_db.clock + lib_ams::_db.cd_slow_poll_read_delay; + lib_ams::cd_slow_poll_read_Step(); // steptype:InlineRecur: call function every N clock cycles + cd_slow_poll_read_UpdateCycles(); + } + algo_lib::_db.next_loop.value = u64_Min(lib_ams::_db.cd_slow_poll_read_next, algo_lib::_db.next_loop); + } +} + +// --- lib_ams.FDb.cd_slow_poll_read.SetDelay +// Set inter-step delay to specified value. +// The difference between new delay and current delay is added to the next scheduled time. +void lib_ams::cd_slow_poll_read_SetDelay(algo::SchedTime delay) { + i64 diff = delay.value - lib_ams::_db.cd_slow_poll_read_delay.value; + lib_ams::_db.cd_slow_poll_read_delay = delay; + if (diff > 0) { + lib_ams::_db.cd_slow_poll_read_next.value += diff; + } else { + lib_ams::_db.cd_slow_poll_read_next.value = algo::u64_SubClip(lib_ams::_db.cd_slow_poll_read_next.value,-diff); + } +} + // --- lib_ams.FDb.proc.Alloc // Allocate memory for new default row. // If out of memory, process is killed. @@ -1338,6 +1593,7 @@ lib_ams::FProc* lib_ams::proc_AllocMaybe() { lib_ams::FProc *row = (lib_ams::FProc*)proc_AllocMem(); if (row) { new (row) lib_ams::FProc; // call constructor + ++lib_ams::_db.trace.alloc__db_proc; } return row; } @@ -1347,6 +1603,7 @@ lib_ams::FProc* lib_ams::proc_AllocMaybe() { void lib_ams::proc_Delete(lib_ams::FProc &row) { row.~FProc(); proc_FreeMem(row); + ++lib_ams::_db.trace.del__db_proc; } // --- lib_ams.FDb.proc.AllocMem @@ -1433,14 +1690,9 @@ bool lib_ams::proc_XrefMaybe(lib_ams::FProc &row) { // Find row by key. Return NULL if not found. lib_ams::FProc* lib_ams::ind_proc_Find(ams::ProcId key) { u32 index = ams::ProcId_Hash(0, key) & (_db.ind_proc_buckets_n - 1); - lib_ams::FProc* *e = &_db.ind_proc_buckets_elems[index]; - lib_ams::FProc* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).proc_id == key; - if (done) break; - e = &ret->ind_proc_next; - } while (true); + lib_ams::FProc *ret = _db.ind_proc_buckets_elems[index]; + for (; ret && !((*ret).proc_id == key); ret = ret->ind_proc_next) { + } return ret; } @@ -1472,10 +1724,11 @@ lib_ams::FProc& lib_ams::ind_proc_GetOrCreate(ams::ProcId key) { // --- lib_ams.FDb.ind_proc.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_ams::ind_proc_InsertMaybe(lib_ams::FProc& row) { - ind_proc_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_proc_next == (lib_ams::FProc*)-1)) {// check if in hash already - u32 index = ams::ProcId_Hash(0, row.proc_id) & (_db.ind_proc_buckets_n - 1); + row.ind_proc_hashval = ams::ProcId_Hash(0, row.proc_id); + ind_proc_Reserve(1); + u32 index = row.ind_proc_hashval & (_db.ind_proc_buckets_n - 1); lib_ams::FProc* *prev = &_db.ind_proc_buckets_elems[index]; do { lib_ams::FProc* ret = *prev; @@ -1501,7 +1754,7 @@ bool lib_ams::ind_proc_InsertMaybe(lib_ams::FProc& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_ams::ind_proc_Remove(lib_ams::FProc& row) { if (LIKELY(row.ind_proc_next != (lib_ams::FProc*)-1)) {// check if in hash already - u32 index = ams::ProcId_Hash(0, row.proc_id) & (_db.ind_proc_buckets_n - 1); + u32 index = row.ind_proc_hashval & (_db.ind_proc_buckets_n - 1); lib_ams::FProc* *prev = &_db.ind_proc_buckets_elems[index]; // addr of pointer to current element while (lib_ams::FProc *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1518,8 +1771,14 @@ void lib_ams::ind_proc_Remove(lib_ams::FProc& row) { // --- lib_ams.FDb.ind_proc.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_ams::ind_proc_Reserve(int n) { + ind_proc_AbsReserve(_db.ind_proc_n + n); +} + +// --- lib_ams.FDb.ind_proc.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_ams::ind_proc_AbsReserve(int n) { u32 old_nbuckets = _db.ind_proc_buckets_n; - u32 new_nelems = _db.ind_proc_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1538,7 +1797,7 @@ void lib_ams::ind_proc_Reserve(int n) { while (elem) { lib_ams::FProc &row = *elem; lib_ams::FProc* next = row.ind_proc_next; - u32 index = ams::ProcId_Hash(0, row.proc_id) & (new_nbuckets-1); + u32 index = row.ind_proc_hashval & (new_nbuckets-1); row.ind_proc_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1551,67 +1810,69 @@ void lib_ams::ind_proc_Reserve(int n) { } } -// --- lib_ams.FDb.member.Alloc +// --- lib_ams.FDb.shmember.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -lib_ams::FMember& lib_ams::member_Alloc() { - lib_ams::FMember* row = member_AllocMaybe(); +lib_ams::FShmember& lib_ams::shmember_Alloc() { + lib_ams::FShmember* row = shmember_AllocMaybe(); if (UNLIKELY(row == NULL)) { - FatalErrorExit("lib_ams.out_of_mem field:lib_ams.FDb.member comment:'Alloc failed'"); + FatalErrorExit("lib_ams.out_of_mem field:lib_ams.FDb.shmember comment:'Alloc failed'"); } return *row; } -// --- lib_ams.FDb.member.AllocMaybe +// --- lib_ams.FDb.shmember.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -lib_ams::FMember* lib_ams::member_AllocMaybe() { - lib_ams::FMember *row = (lib_ams::FMember*)member_AllocMem(); +lib_ams::FShmember* lib_ams::shmember_AllocMaybe() { + lib_ams::FShmember *row = (lib_ams::FShmember*)shmember_AllocMem(); if (row) { - new (row) lib_ams::FMember; // call constructor + new (row) lib_ams::FShmember; // call constructor + ++lib_ams::_db.trace.alloc__db_shmember; } return row; } -// --- lib_ams.FDb.member.Delete +// --- lib_ams.FDb.shmember.Delete // Remove row from all global and cross indices, then deallocate row -void lib_ams::member_Delete(lib_ams::FMember &row) { - row.~FMember(); - member_FreeMem(row); +void lib_ams::shmember_Delete(lib_ams::FShmember &row) { + row.~FShmember(); + shmember_FreeMem(row); + ++lib_ams::_db.trace.del__db_shmember; } -// --- lib_ams.FDb.member.AllocMem +// --- lib_ams.FDb.shmember.AllocMem // Allocate space for one element // If no memory available, return NULL. -void* lib_ams::member_AllocMem() { - lib_ams::FMember *row = _db.member_free; +void* lib_ams::shmember_AllocMem() { + lib_ams::FShmember *row = _db.shmember_free; if (UNLIKELY(!row)) { - member_Reserve(1); - row = _db.member_free; + shmember_Reserve(1); + row = _db.shmember_free; } if (row) { - _db.member_free = row->member_next; + _db.shmember_free = row->shmember_next; } return row; } -// --- lib_ams.FDb.member.FreeMem +// --- lib_ams.FDb.shmember.FreeMem // Remove mem from all global and cross indices, then deallocate mem -void lib_ams::member_FreeMem(lib_ams::FMember &row) { - if (UNLIKELY(row.member_next != (lib_ams::FMember*)-1)) { - FatalErrorExit("lib_ams.tpool_double_delete pool:lib_ams.FDb.member comment:'double deletion caught'"); +void lib_ams::shmember_FreeMem(lib_ams::FShmember &row) { + if (UNLIKELY(row.shmember_next != (lib_ams::FShmember*)-1)) { + FatalErrorExit("lib_ams.tpool_double_delete pool:lib_ams.FDb.shmember comment:'double deletion caught'"); } - row.member_next = _db.member_free; // insert into free list - _db.member_free = &row; + row.shmember_next = _db.shmember_free; // insert into free list + _db.shmember_free = &row; } -// --- lib_ams.FDb.member.Reserve +// --- lib_ams.FDb.shmember.Reserve // Preallocate memory for N more elements // Return number of elements actually reserved. -u64 lib_ams::member_Reserve(u64 n_elems) { +u64 lib_ams::shmember_Reserve(u64 n_elems) { u64 ret = 0; while (ret < n_elems) { - u64 size = _db.member_blocksize; // underlying allocator is probably Lpool - u64 reserved = member_ReserveMem(size); + u64 size = _db.shmember_blocksize; // underlying allocator is probably Lpool + u64 reserved = shmember_ReserveMem(size); ret += reserved; if (reserved == 0) { break; @@ -1620,472 +1881,488 @@ u64 lib_ams::member_Reserve(u64 n_elems) { return ret; } -// --- lib_ams.FDb.member.ReserveMem +// --- lib_ams.FDb.shmember.ReserveMem // Allocate block of given size, break up into small elements and append to free list. // Return number of elements reserved. -u64 lib_ams::member_ReserveMem(u64 size) { +u64 lib_ams::shmember_ReserveMem(u64 size) { u64 ret = 0; - if (size >= sizeof(lib_ams::FMember)) { - lib_ams::FMember *mem = (lib_ams::FMember*)algo_lib::malloc_AllocMem(size); - ret = mem ? size / sizeof(lib_ams::FMember) : 0; + if (size >= sizeof(lib_ams::FShmember)) { + lib_ams::FShmember *mem = (lib_ams::FShmember*)algo_lib::malloc_AllocMem(size); + ret = mem ? size / sizeof(lib_ams::FShmember) : 0; // add newly allocated elements to the free list; for (u64 i=0; i < ret; i++) { - mem[i].member_next = _db.member_free; - _db.member_free = mem+i; + mem[i].shmember_next = _db.shmember_free; + _db.shmember_free = mem+i; } } return ret; } -// --- lib_ams.FDb.member.XrefMaybe +// --- lib_ams.FDb.shmember.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool lib_ams::member_XrefMaybe(lib_ams::FMember &row) { +bool lib_ams::shmember_XrefMaybe(lib_ams::FShmember &row) { bool retval = true; (void)row; - lib_ams::FStream* p_stream_id = lib_ams::ind_stream_Find(row.member.stream_id); - if (UNLIKELY(!p_stream_id)) { - algo_lib::ResetErrtext() << "lib_ams.bad_xref index:lib_ams.FDb.ind_stream" << Keyval("key", row.member.stream_id); + lib_ams::FShm* p_shm_id = lib_ams::ind_shm_Find(row.shmember.shm_id); + if (UNLIKELY(!p_shm_id)) { + algo_lib::ResetErrtext() << "lib_ams.bad_xref index:lib_ams.FDb.ind_shm" << Keyval("key", row.shmember.shm_id); return false; } - // member: save pointer to stream_id + // shmember: save pointer to shm_id if (true) { // user-defined insert condition - row.p_stream = p_stream_id; + row.p_shm = p_shm_id; } - lib_ams::FProc* p_proc_id = lib_ams::ind_proc_Find(row.member.proc_id); + lib_ams::FProc* p_proc_id = lib_ams::ind_proc_Find(row.shmember.proc_id); if (UNLIKELY(!p_proc_id)) { - algo_lib::ResetErrtext() << "lib_ams.bad_xref index:lib_ams.FDb.ind_proc" << Keyval("key", row.member.proc_id); + algo_lib::ResetErrtext() << "lib_ams.bad_xref index:lib_ams.FDb.ind_proc" << Keyval("key", row.shmember.proc_id); return false; } - // member: save pointer to proc_id + // shmember: save pointer to proc_id if (true) { // user-defined insert condition row.p_proc = p_proc_id; } - // insert member into index ind_member + // insert shmember into index c_shmember if (true) { // user-defined insert condition - bool success = ind_member_InsertMaybe(row); - if (UNLIKELY(!success)) { - ch_RemoveAll(algo_lib::_db.errtext); - algo_lib::_db.errtext << "lib_ams.duplicate_key xref:lib_ams.FDb.ind_member"; // check for duplicate key - return false; - } + c_shmember_Insert(*p_proc_id, row); } - // insert member into index zd_member_bystream + // insert shmember into index c_shmember if (true) { // user-defined insert condition - zd_member_bystream_Insert(*p_stream_id, row); + c_shmember_Insert(*p_shm_id, row); } - // insert member into index zd_member_byproc + // insert shmember into index ind_shmember if (true) { // user-defined insert condition - zd_member_byproc_Insert(*p_proc_id, row); + bool success = ind_shmember_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "lib_ams.duplicate_key xref:lib_ams.FDb.ind_shmember"; // check for duplicate key + return false; + } } return retval; } -// --- lib_ams.FDb.ind_member.Find +// --- lib_ams.FDb.ind_shmember.Find // Find row by key. Return NULL if not found. -lib_ams::FMember* lib_ams::ind_member_Find(ams::Member key) { - u32 index = ams::Member_Hash(0, key) & (_db.ind_member_buckets_n - 1); - lib_ams::FMember* *e = &_db.ind_member_buckets_elems[index]; - lib_ams::FMember* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).member == key; - if (done) break; - e = &ret->ind_member_next; - } while (true); +lib_ams::FShmember* lib_ams::ind_shmember_Find(ams::ShmemberId key) { + u32 index = ams::ShmemberId_Hash(0, key) & (_db.ind_shmember_buckets_n - 1); + lib_ams::FShmember *ret = _db.ind_shmember_buckets_elems[index]; + for (; ret && !((*ret).shmember == key); ret = ret->ind_shmember_next) { + } return ret; } -// --- lib_ams.FDb.ind_member.FindX +// --- lib_ams.FDb.ind_shmember.FindX // Look up row by key and return reference. Throw exception if not found -lib_ams::FMember& lib_ams::ind_member_FindX(ams::Member key) { - lib_ams::FMember* ret = ind_member_Find(key); - vrfy(ret, tempstr() << "lib_ams.key_error table:ind_member key:'"<ind_member_next; + prev = &ret->ind_shmember_next; } while (true); if (retval) { - row.ind_member_next = *prev; - _db.ind_member_n++; + row.ind_shmember_next = *prev; + _db.ind_shmember_n++; *prev = &row; } } return retval; } -// --- lib_ams.FDb.ind_member.Remove +// --- lib_ams.FDb.ind_shmember.Remove // Remove reference to element from hash index. If element is not in hash, do nothing -void lib_ams::ind_member_Remove(lib_ams::FMember& row) { - if (LIKELY(row.ind_member_next != (lib_ams::FMember*)-1)) {// check if in hash already - u32 index = ams::Member_Hash(0, row.member) & (_db.ind_member_buckets_n - 1); - lib_ams::FMember* *prev = &_db.ind_member_buckets_elems[index]; // addr of pointer to current element - while (lib_ams::FMember *next = *prev) { // scan the collision chain for our element +void lib_ams::ind_shmember_Remove(lib_ams::FShmember& row) { + if (LIKELY(row.ind_shmember_next != (lib_ams::FShmember*)-1)) {// check if in hash already + u32 index = row.ind_shmember_hashval & (_db.ind_shmember_buckets_n - 1); + lib_ams::FShmember* *prev = &_db.ind_shmember_buckets_elems[index]; // addr of pointer to current element + while (lib_ams::FShmember *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_member_next; // unlink (singly linked list) - _db.ind_member_n--; - row.ind_member_next = (lib_ams::FMember*)-1;// not-in-hash + *prev = next->ind_shmember_next; // unlink (singly linked list) + _db.ind_shmember_n--; + row.ind_shmember_next = (lib_ams::FShmember*)-1;// not-in-hash break; } - prev = &next->ind_member_next; + prev = &next->ind_shmember_next; } } } -// --- lib_ams.FDb.ind_member.Reserve +// --- lib_ams.FDb.ind_shmember.Reserve // Reserve enough room in the hash for N more elements. Return success code. -void lib_ams::ind_member_Reserve(int n) { - u32 old_nbuckets = _db.ind_member_buckets_n; - u32 new_nelems = _db.ind_member_n + n; +void lib_ams::ind_shmember_Reserve(int n) { + ind_shmember_AbsReserve(_db.ind_shmember_n + n); +} + +// --- lib_ams.FDb.ind_shmember.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_ams::ind_shmember_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_shmember_buckets_n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); - u32 old_size = old_nbuckets * sizeof(lib_ams::FMember*); - u32 new_size = new_nbuckets * sizeof(lib_ams::FMember*); + u32 old_size = old_nbuckets * sizeof(lib_ams::FShmember*); + u32 new_size = new_nbuckets * sizeof(lib_ams::FShmember*); // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably // means new memory will have to be allocated anyway - lib_ams::FMember* *new_buckets = (lib_ams::FMember**)algo_lib::malloc_AllocMem(new_size); + lib_ams::FShmember* *new_buckets = (lib_ams::FShmember**)algo_lib::malloc_AllocMem(new_size); if (UNLIKELY(!new_buckets)) { - FatalErrorExit("lib_ams.out_of_memory field:lib_ams.FDb.ind_member"); + FatalErrorExit("lib_ams.out_of_memory field:lib_ams.FDb.ind_shmember"); } memset(new_buckets, 0, new_size); // clear pointers // rehash all entries - for (int i = 0; i < _db.ind_member_buckets_n; i++) { - lib_ams::FMember* elem = _db.ind_member_buckets_elems[i]; + for (int i = 0; i < _db.ind_shmember_buckets_n; i++) { + lib_ams::FShmember* elem = _db.ind_shmember_buckets_elems[i]; while (elem) { - lib_ams::FMember &row = *elem; - lib_ams::FMember* next = row.ind_member_next; - u32 index = ams::Member_Hash(0, row.member) & (new_nbuckets-1); - row.ind_member_next = new_buckets[index]; + lib_ams::FShmember &row = *elem; + lib_ams::FShmember* next = row.ind_shmember_next; + u32 index = row.ind_shmember_hashval & (new_nbuckets-1); + row.ind_shmember_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } } // free old array - algo_lib::malloc_FreeMem(_db.ind_member_buckets_elems, old_size); - _db.ind_member_buckets_elems = new_buckets; - _db.ind_member_buckets_n = new_nbuckets; + algo_lib::malloc_FreeMem(_db.ind_shmember_buckets_elems, old_size); + _db.ind_shmember_buckets_elems = new_buckets; + _db.ind_shmember_buckets_n = new_nbuckets; } } -// --- lib_ams.FDb.streamtype.Alloc +// --- lib_ams.FDb.shmtype.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -lib_ams::FStreamType& lib_ams::streamtype_Alloc() { - lib_ams::FStreamType* row = streamtype_AllocMaybe(); +lib_ams::FShmtype& lib_ams::shmtype_Alloc() { + lib_ams::FShmtype* row = shmtype_AllocMaybe(); if (UNLIKELY(row == NULL)) { - FatalErrorExit("lib_ams.out_of_mem field:lib_ams.FDb.streamtype comment:'Alloc failed'"); + FatalErrorExit("lib_ams.out_of_mem field:lib_ams.FDb.shmtype comment:'Alloc failed'"); } return *row; } -// --- lib_ams.FDb.streamtype.AllocMaybe +// --- lib_ams.FDb.shmtype.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -lib_ams::FStreamType* lib_ams::streamtype_AllocMaybe() { - lib_ams::FStreamType *row = (lib_ams::FStreamType*)streamtype_AllocMem(); +lib_ams::FShmtype* lib_ams::shmtype_AllocMaybe() { + lib_ams::FShmtype *row = (lib_ams::FShmtype*)shmtype_AllocMem(); if (row) { - new (row) lib_ams::FStreamType; // call constructor + new (row) lib_ams::FShmtype; // call constructor + ++lib_ams::_db.trace.alloc__db_shmtype; } return row; } -// --- lib_ams.FDb.streamtype.InsertMaybe +// --- lib_ams.FDb.shmtype.InsertMaybe // Create new row from struct. // Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -lib_ams::FStreamType* lib_ams::streamtype_InsertMaybe(const amsdb::StreamType &value) { - lib_ams::FStreamType *row = &streamtype_Alloc(); // if out of memory, process dies. if input error, return NULL. - streamtype_CopyIn(*row,const_cast(value)); - bool ok = streamtype_XrefMaybe(*row); // this may return false +lib_ams::FShmtype* lib_ams::shmtype_InsertMaybe(const amsdb::Shmtype &value) { + lib_ams::FShmtype *row = &shmtype_Alloc(); // if out of memory, process dies. if input error, return NULL. + shmtype_CopyIn(*row,const_cast(value)); + bool ok = shmtype_XrefMaybe(*row); // this may return false if (!ok) { - streamtype_RemoveLast(); // delete offending row, any existing xrefs are cleared + shmtype_RemoveLast(); // delete offending row, any existing xrefs are cleared row = NULL; // forget this ever happened } return row; } -// --- lib_ams.FDb.streamtype.AllocMem +// --- lib_ams.FDb.shmtype.AllocMem // Allocate space for one element. If no memory available, return NULL. -void* lib_ams::streamtype_AllocMem() { - u64 new_nelems = _db.streamtype_n+1; +void* lib_ams::shmtype_AllocMem() { + u64 new_nelems = _db.shmtype_n+1; // compute level and index on level u64 bsr = algo::u64_BitScanReverse(new_nelems); u64 base = u64(1)<0; ) { +void lib_ams::shmtype_RemoveAll() { + lib_ams::_db.trace.del__db_shmtype += _db.shmtype_n; + for (u64 n = _db.shmtype_n; n>0; ) { n--; - streamtype_qFind(u64(n)).~FStreamType(); // destroy last element - _db.streamtype_n = i32(n); + shmtype_qFind(u64(n)).~FShmtype(); // destroy last element + _db.shmtype_n = i32(n); } } -// --- lib_ams.FDb.streamtype.RemoveLast +// --- lib_ams.FDb.shmtype.RemoveLast // Delete last element of array. Do nothing if array is empty. -void lib_ams::streamtype_RemoveLast() { - u64 n = _db.streamtype_n; +void lib_ams::shmtype_RemoveLast() { + u64 n = _db.shmtype_n; if (n > 0) { n -= 1; - streamtype_qFind(u64(n)).~FStreamType(); - _db.streamtype_n = i32(n); + shmtype_qFind(u64(n)).~FShmtype(); + ++lib_ams::_db.trace.del__db_shmtype; + _db.shmtype_n = i32(n); } } -// --- lib_ams.FDb.streamtype.LoadStatic -static void lib_ams::streamtype_LoadStatic() { +// --- lib_ams.FDb.shmtype.LoadStatic +static void lib_ams::shmtype_LoadStatic() { static struct _t { const char *s; } data[] = { - { "amsdb.streamtype streamtype:0 id:0 comment:\"No stream\"" } - ,{ "amsdb.streamtype streamtype:ctl id:1 comment:\"AMS control messages\"" } - ,{ "amsdb.streamtype streamtype:io id:5 comment:\"Messages intended for file output\"" } - ,{ "amsdb.streamtype streamtype:out id:2 comment:\"Log messages, alarms\"" } - ,{ "amsdb.streamtype streamtype:trace id:6 comment:\"Trace messages\"" } + { "amsdb.shmtype shmtype:ctl id:1 nonblock:Y comment:\"AMS control messages\"" } + ,{ "amsdb.shmtype shmtype:log id:9 nonblock:N comment:\"Log messages\"" } + ,{ "amsdb.shmtype shmtype:out id:2 nonblock:N comment:\"Log messages, alarms\"" } ,{NULL} }; (void)data; - amsdb::StreamType streamtype; + amsdb::Shmtype shmtype; for (int i=0; data[i].s; i++) { - (void)amsdb::StreamType_ReadStrptrMaybe(streamtype, algo::strptr(data[i].s)); - lib_ams::FStreamType *elem = streamtype_InsertMaybe(streamtype); + (void)amsdb::Shmtype_ReadStrptrMaybe(shmtype, algo::strptr(data[i].s)); + lib_ams::FShmtype *elem = shmtype_InsertMaybe(shmtype); (void)elem; } } -// --- lib_ams.FDb.streamtype.XrefMaybe +// --- lib_ams.FDb.shmtype.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool lib_ams::streamtype_XrefMaybe(lib_ams::FStreamType &row) { +bool lib_ams::shmtype_XrefMaybe(lib_ams::FShmtype &row) { bool retval = true; (void)row; - // insert streamtype into index ind_streamtype + // insert shmtype into index ind_shmtype if (true) { // user-defined insert condition - bool success = ind_streamtype_InsertMaybe(row); + bool success = ind_shmtype_InsertMaybe(row); if (UNLIKELY(!success)) { ch_RemoveAll(algo_lib::_db.errtext); - algo_lib::_db.errtext << "lib_ams.duplicate_key xref:lib_ams.FDb.ind_streamtype"; // check for duplicate key + algo_lib::_db.errtext << "lib_ams.duplicate_key xref:lib_ams.FDb.ind_shmtype"; // check for duplicate key return false; } } return retval; } -// --- lib_ams.FDb.ind_streamtype.Find +// --- lib_ams.FDb.ind_shmtype.Find // Find row by key. Return NULL if not found. -lib_ams::FStreamType* lib_ams::ind_streamtype_Find(ams::StreamType key) { - u32 index = ams::StreamType_Hash(0, key) & (_db.ind_streamtype_buckets_n - 1); - lib_ams::FStreamType* *e = &_db.ind_streamtype_buckets_elems[index]; - lib_ams::FStreamType* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).id == key; - if (done) break; - e = &ret->ind_streamtype_next; - } while (true); +lib_ams::FShmtype* lib_ams::ind_shmtype_Find(ams::Shmtype key) { + u32 index = ams::Shmtype_Hash(0, key) & (_db.ind_shmtype_buckets_n - 1); + lib_ams::FShmtype *ret = _db.ind_shmtype_buckets_elems[index]; + for (; ret && !((*ret).id == key); ret = ret->ind_shmtype_next) { + } return ret; } -// --- lib_ams.FDb.ind_streamtype.FindX +// --- lib_ams.FDb.ind_shmtype.FindX // Look up row by key and return reference. Throw exception if not found -lib_ams::FStreamType& lib_ams::ind_streamtype_FindX(ams::StreamType key) { - lib_ams::FStreamType* ret = ind_streamtype_Find(key); - vrfy(ret, tempstr() << "lib_ams.key_error table:ind_streamtype key:'"<ind_streamtype_next; // unlink (singly linked list) - _db.ind_streamtype_n--; - row.ind_streamtype_next = (lib_ams::FStreamType*)-1;// not-in-hash + *prev = next->ind_shmtype_next; // unlink (singly linked list) + _db.ind_shmtype_n--; + row.ind_shmtype_next = (lib_ams::FShmtype*)-1;// not-in-hash break; } - prev = &next->ind_streamtype_next; + prev = &next->ind_shmtype_next; } } } -// --- lib_ams.FDb.ind_streamtype.Reserve +// --- lib_ams.FDb.ind_shmtype.Reserve // Reserve enough room in the hash for N more elements. Return success code. -void lib_ams::ind_streamtype_Reserve(int n) { - u32 old_nbuckets = _db.ind_streamtype_buckets_n; - u32 new_nelems = _db.ind_streamtype_n + n; +void lib_ams::ind_shmtype_Reserve(int n) { + ind_shmtype_AbsReserve(_db.ind_shmtype_n + n); +} + +// --- lib_ams.FDb.ind_shmtype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_ams::ind_shmtype_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_shmtype_buckets_n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); - u32 old_size = old_nbuckets * sizeof(lib_ams::FStreamType*); - u32 new_size = new_nbuckets * sizeof(lib_ams::FStreamType*); + u32 old_size = old_nbuckets * sizeof(lib_ams::FShmtype*); + u32 new_size = new_nbuckets * sizeof(lib_ams::FShmtype*); // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably // means new memory will have to be allocated anyway - lib_ams::FStreamType* *new_buckets = (lib_ams::FStreamType**)algo_lib::malloc_AllocMem(new_size); + lib_ams::FShmtype* *new_buckets = (lib_ams::FShmtype**)algo_lib::malloc_AllocMem(new_size); if (UNLIKELY(!new_buckets)) { - FatalErrorExit("lib_ams.out_of_memory field:lib_ams.FDb.ind_streamtype"); + FatalErrorExit("lib_ams.out_of_memory field:lib_ams.FDb.ind_shmtype"); } memset(new_buckets, 0, new_size); // clear pointers // rehash all entries - for (int i = 0; i < _db.ind_streamtype_buckets_n; i++) { - lib_ams::FStreamType* elem = _db.ind_streamtype_buckets_elems[i]; + for (int i = 0; i < _db.ind_shmtype_buckets_n; i++) { + lib_ams::FShmtype* elem = _db.ind_shmtype_buckets_elems[i]; while (elem) { - lib_ams::FStreamType &row = *elem; - lib_ams::FStreamType* next = row.ind_streamtype_next; - u32 index = ams::StreamType_Hash(0, row.id) & (new_nbuckets-1); - row.ind_streamtype_next = new_buckets[index]; + lib_ams::FShmtype &row = *elem; + lib_ams::FShmtype* next = row.ind_shmtype_next; + u32 index = row.ind_shmtype_hashval & (new_nbuckets-1); + row.ind_shmtype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } } // free old array - algo_lib::malloc_FreeMem(_db.ind_streamtype_buckets_elems, old_size); - _db.ind_streamtype_buckets_elems = new_buckets; - _db.ind_streamtype_buckets_n = new_nbuckets; + algo_lib::malloc_FreeMem(_db.ind_shmtype_buckets_elems, old_size); + _db.ind_shmtype_buckets_elems = new_buckets; + _db.ind_shmtype_buckets_n = new_nbuckets; } } -// --- lib_ams.FDb.zd_ctlin.Insert -// Insert row into linked list. If row is already in linked list, do nothing. -void lib_ams::zd_ctlin_Insert(lib_ams::FStream& row) { - if (!zd_ctlin_InLlistQ(row)) { - lib_ams::FStream* old_tail = _db.zd_ctlin_tail; - row.zd_ctlin_next = NULL; - row.zd_ctlin_prev = old_tail; - _db.zd_ctlin_tail = &row; - lib_ams::FStream **new_row_a = &old_tail->zd_ctlin_next; - lib_ams::FStream **new_row_b = &_db.zd_ctlin_head; - lib_ams::FStream **new_row = old_tail ? new_row_a : new_row_b; - *new_row = &row; - _db.zd_ctlin_n++; +// --- lib_ams.FDb.c_ctlin.Insert +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +void lib_ams::c_ctlin_Insert(lib_ams::FShmember& row) { + if (row.c_ctlin_idx == -1) { + c_ctlin_Reserve(1); + u32 n = _db.c_ctlin_n++; + _db.c_ctlin_elems[n] = &row; + row.c_ctlin_idx = n; } } -// --- lib_ams.FDb.zd_ctlin.Remove -// Remove element from index. If element is not in index, do nothing. -void lib_ams::zd_ctlin_Remove(lib_ams::FStream& row) { - if (zd_ctlin_InLlistQ(row)) { - lib_ams::FStream* old_head = _db.zd_ctlin_head; - (void)old_head; // in case it's not used - lib_ams::FStream* prev = row.zd_ctlin_prev; - lib_ams::FStream* next = row.zd_ctlin_next; - // if element is first, adjust list head; otherwise, adjust previous element's next - lib_ams::FStream **new_next_a = &prev->zd_ctlin_next; - lib_ams::FStream **new_next_b = &_db.zd_ctlin_head; - lib_ams::FStream **new_next = prev ? new_next_a : new_next_b; - *new_next = next; - // if element is last, adjust list tail; otherwise, adjust next element's prev - lib_ams::FStream **new_prev_a = &next->zd_ctlin_prev; - lib_ams::FStream **new_prev_b = &_db.zd_ctlin_tail; - lib_ams::FStream **new_prev = next ? new_prev_a : new_prev_b; - *new_prev = prev; - _db.zd_ctlin_n--; - row.zd_ctlin_next=(lib_ams::FStream*)-1; // not-in-list +// --- lib_ams.FDb.c_ctlin.InsertMaybe +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +bool lib_ams::c_ctlin_InsertMaybe(lib_ams::FShmember& row) { + bool retval = !c_ctlin_InAryQ(row); + c_ctlin_Insert(row); // check is performed in _Insert again + return retval; +} + +// --- lib_ams.FDb.c_ctlin.Remove +// Find element using linear scan. If element is in array, remove, otherwise do nothing +void lib_ams::c_ctlin_Remove(lib_ams::FShmember& row) { + int n = _db.c_ctlin_n; + int idx = row.c_ctlin_idx; + if (idx != -1) { + lib_ams::FShmember *last = _db.c_ctlin_elems[n-1]; + last->c_ctlin_idx = idx; + _db.c_ctlin_elems[idx] = last; + row.c_ctlin_idx = -1; + _db.c_ctlin_n = n - 1; + } +} + +// --- lib_ams.FDb.c_ctlin.Reserve +// Reserve space in index for N more elements; +void lib_ams::c_ctlin_Reserve(u32 n) { + u32 old_max = _db.c_ctlin_max; + if (UNLIKELY(_db.c_ctlin_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(lib_ams::FShmember*); + u32 new_size = new_max * sizeof(lib_ams::FShmember*); + void *new_mem = algo_lib::malloc_ReallocMem(_db.c_ctlin_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("lib_ams.out_of_memory field:lib_ams.FDb.c_ctlin"); + } + _db.c_ctlin_elems = (lib_ams::FShmember**)new_mem; + _db.c_ctlin_max = new_max; } } -// --- lib_ams.FDb.zd_ctlin.RemoveAll -// Empty the index. (The rows are not deleted) -void lib_ams::zd_ctlin_RemoveAll() { - lib_ams::FStream* row = _db.zd_ctlin_head; - _db.zd_ctlin_head = NULL; - _db.zd_ctlin_tail = NULL; - _db.zd_ctlin_n = 0; - while (row) { - lib_ams::FStream* row_next = row->zd_ctlin_next; - row->zd_ctlin_next = (lib_ams::FStream*)-1; - row->zd_ctlin_prev = NULL; - row = row_next; +// --- lib_ams.FDb.c_ctlin.RemoveFirst +// Heap-like Ptrary: remove first element +// If index is empty, return NULL. Otherwise remove and return first element in index. +lib_ams::FShmember* lib_ams::c_ctlin_RemoveFirst() { + lib_ams::FShmember *row = NULL; + int n = _db.c_ctlin_n; + if (n > 0) { + row = _db.c_ctlin_elems[0]; + row->c_ctlin_idx=-1; + _db.c_ctlin_elems[n-1]->c_ctlin_idx=0; + _db.c_ctlin_elems[0]=_db.c_ctlin_elems[n-1]; + _db.c_ctlin_n = n-1; } + return row; } -// --- lib_ams.FDb.zd_ctlin.RemoveFirst -// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -lib_ams::FStream* lib_ams::zd_ctlin_RemoveFirst() { - lib_ams::FStream *row = NULL; - row = _db.zd_ctlin_head; - if (row) { - lib_ams::FStream *next = row->zd_ctlin_next; - _db.zd_ctlin_head = next; - lib_ams::FStream **new_end_a = &next->zd_ctlin_prev; - lib_ams::FStream **new_end_b = &_db.zd_ctlin_tail; - lib_ams::FStream **new_end = next ? new_end_a : new_end_b; - *new_end = NULL; - _db.zd_ctlin_n--; - row->zd_ctlin_next = (lib_ams::FStream*)-1; // mark as not-in-list +// --- lib_ams.FDb.c_ctlin.RemoveLast +// Ptrary: remove last element +// If index is empty, return NULL. Otherwise remove and return last element in index. +lib_ams::FShmember* lib_ams::c_ctlin_RemoveLast() { + lib_ams::FShmember *row = NULL; + int n = _db.c_ctlin_n; + if (n > 0) { + row = _db.c_ctlin_elems[n-1]; + row->c_ctlin_idx=-1; + _db.c_ctlin_n = n-1; } return row; } @@ -2162,10 +2439,222 @@ lib_ams::FProc* lib_ams::zd_proc_RemoveFirst() { return row; } -// --- lib_ams.FDb.regx_trace.Print -// Print back to string -void lib_ams::regx_trace_Print(algo::cstring &out) { - Regx_Print(_db.regx_trace, out); +// --- lib_ams.FDb.bh_shmember_read.Dealloc +// Remove all elements from heap and free memory used by the array. +void lib_ams::bh_shmember_read_Dealloc() { + bh_shmember_read_RemoveAll(); + algo_lib::malloc_FreeMem(_db.bh_shmember_read_elems, sizeof(lib_ams::FShmember*)*_db.bh_shmember_read_max); + _db.bh_shmember_read_max = 0; + _db.bh_shmember_read_elems = NULL; +} + +// --- lib_ams.FDb.bh_shmember_read.Downheap +// Find new location for ROW starting at IDX +// NOTE: Rest of heap is rearranged, but pointer to ROW is NOT stored in array. +static int lib_ams::bh_shmember_read_Downheap(lib_ams::FShmember& row, int idx) { + lib_ams::FShmember* *elems = _db.bh_shmember_read_elems; + int n = _db.bh_shmember_read_n; + int child = idx*2+1; + while (child < n) { + lib_ams::FShmember* p = elems[child]; // left child + int rchild = child+1; + if (rchild < n) { + lib_ams::FShmember* q = elems[rchild]; // right child + if (bh_shmember_read_ElemLt(*q,*p)) { + child = rchild; + p = q; + } + } + if (!bh_shmember_read_ElemLt(*p,row)) { + break; + } + p->bh_shmember_read_idx = idx; + elems[idx] = p; + idx = child; + child = idx*2+1; + } + return idx; +} + +// --- lib_ams.FDb.bh_shmember_read.Insert +// Insert row. Row must not already be in index. If row is already in index, do nothing. +void lib_ams::bh_shmember_read_Insert(lib_ams::FShmember& row) { + if (LIKELY(row.bh_shmember_read_idx == -1)) { + bh_shmember_read_Reserve(1); + int n = _db.bh_shmember_read_n; + _db.bh_shmember_read_n = n + 1; + int new_idx = bh_shmember_read_Upheap(row, n); + row.bh_shmember_read_idx = new_idx; + _db.bh_shmember_read_elems[new_idx] = &row; + if (new_idx==0) { + bh_shmember_read_FirstChanged(); + } + } +} + +// --- lib_ams.FDb.bh_shmember_read.Reheap +// If row is in heap, update its position. If row is not in heap, insert it. +// Return new position of item in the heap (0=top) +// If first item of the is changed, update fstep:lib_ams.FDb.bh_shmember_read +i32 lib_ams::bh_shmember_read_Reheap(lib_ams::FShmember& row) { + int old_idx = row.bh_shmember_read_idx; + bool isnew = old_idx == -1; + if (isnew) { + bh_shmember_read_Reserve(1); + old_idx = _db.bh_shmember_read_n++; + } + int new_idx = bh_shmember_read_Upheap(row, old_idx); + if (!isnew && new_idx == old_idx) { + new_idx = bh_shmember_read_Downheap(row, old_idx); + } + row.bh_shmember_read_idx = new_idx; + _db.bh_shmember_read_elems[new_idx] = &row; + bool changed = new_idx==0 || old_idx==0; + if (changed) { + bh_shmember_read_FirstChanged(); + } + return new_idx; +} + +// --- lib_ams.FDb.bh_shmember_read.ReheapFirst +// Key of first element in the heap changed. Move it. +// This function does not check the insert condition. +// Return new position of item in the heap (0=top). +// Heap must be non-empty or behavior is undefined. +// Update fstep:lib_ams.FDb.bh_shmember_read +i32 lib_ams::bh_shmember_read_ReheapFirst() { + lib_ams::FShmember &row = *_db.bh_shmember_read_elems[0]; + i32 new_idx = bh_shmember_read_Downheap(row, 0); + row.bh_shmember_read_idx = new_idx; + _db.bh_shmember_read_elems[new_idx] = &row; + if (new_idx != 0) { + bh_shmember_read_FirstChanged(); + } + return new_idx; +} + +// --- lib_ams.FDb.bh_shmember_read.Remove +// Remove element from index. If element is not in index, do nothing. +void lib_ams::bh_shmember_read_Remove(lib_ams::FShmember& row) { + if (bh_shmember_read_InBheapQ(row)) { + int old_idx = row.bh_shmember_read_idx; + if (_db.bh_shmember_read_elems[old_idx] == &row) { // sanity check: heap points back to row + row.bh_shmember_read_idx = -1; // mark not in heap + i32 n = _db.bh_shmember_read_n - 1; // index of last element in heap + _db.bh_shmember_read_n = n; // decrease count + if (old_idx != n) { + lib_ams::FShmember *elem = _db.bh_shmember_read_elems[n]; + int new_idx = bh_shmember_read_Upheap(*elem, old_idx); + if (new_idx == old_idx) { + new_idx = bh_shmember_read_Downheap(*elem, old_idx); + } + elem->bh_shmember_read_idx = new_idx; + _db.bh_shmember_read_elems[new_idx] = elem; + } + if (old_idx == 0) { + bh_shmember_read_FirstChanged(); + } + } + } +} + +// --- lib_ams.FDb.bh_shmember_read.RemoveAll +// Remove all elements from binary heap +void lib_ams::bh_shmember_read_RemoveAll() { + int n = _db.bh_shmember_read_n; + for (int i = n - 1; i>=0; i--) { + _db.bh_shmember_read_elems[i]->bh_shmember_read_idx = -1; // mark not-in-heap + } + _db.bh_shmember_read_n = 0; + if (n > 0) { + bh_shmember_read_FirstChanged(); + } +} + +// --- lib_ams.FDb.bh_shmember_read.RemoveFirst +// If index is empty, return NULL. Otherwise remove and return first key in index. +// Call 'head changed' trigger. +lib_ams::FShmember* lib_ams::bh_shmember_read_RemoveFirst() { + lib_ams::FShmember *row = NULL; + if (_db.bh_shmember_read_n > 0) { + row = _db.bh_shmember_read_elems[0]; + row->bh_shmember_read_idx = -1; // mark not in heap + i32 n = _db.bh_shmember_read_n - 1; // index of last element in heap + _db.bh_shmember_read_n = n; // decrease count + if (n) { + lib_ams::FShmember &elem = *_db.bh_shmember_read_elems[n]; + int new_idx = bh_shmember_read_Downheap(elem, 0); + elem.bh_shmember_read_idx = new_idx; + _db.bh_shmember_read_elems[new_idx] = &elem; + } + bh_shmember_read_FirstChanged(); + } + return row; +} + +// --- lib_ams.FDb.bh_shmember_read.Reserve +// Reserve space in index for N more elements +void lib_ams::bh_shmember_read_Reserve(int n) { + i32 old_max = _db.bh_shmember_read_max; + if (UNLIKELY(_db.bh_shmember_read_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(lib_ams::FShmember*); + u32 new_size = new_max * sizeof(lib_ams::FShmember*); + void *new_mem = algo_lib::malloc_ReallocMem(_db.bh_shmember_read_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("lib_ams.out_of_memory field:lib_ams.FDb.bh_shmember_read"); + } + _db.bh_shmember_read_elems = (lib_ams::FShmember**)new_mem; + _db.bh_shmember_read_max = new_max; + } +} + +// --- lib_ams.FDb.bh_shmember_read.Upheap +// Find and return index of new location for element ROW in the heap, starting at index IDX. +// Move any elements along the way but do not modify ROW. +static int lib_ams::bh_shmember_read_Upheap(lib_ams::FShmember& row, int idx) { + lib_ams::FShmember* *elems = _db.bh_shmember_read_elems; + while (idx>0) { + int j = (idx-1)/2; + lib_ams::FShmember* p = elems[j]; + if (!bh_shmember_read_ElemLt(row, *p)) { + break; + } + p->bh_shmember_read_idx = idx; + elems[idx] = p; + idx = j; + } + return idx; +} + +// --- lib_ams.FDb.bh_shmember_read.ElemLt +inline static bool lib_ams::bh_shmember_read_ElemLt(lib_ams::FShmember &a, lib_ams::FShmember &b) { + (void)_db; + return a.sortkey < b.sortkey; +} + +// --- lib_ams.FDb.bh_shmember_read.FirstChanged +// First element of index changed. +static void lib_ams::bh_shmember_read_FirstChanged() { +} + +// --- lib_ams.FDb.bh_shmember_read.UpdateCycles +// Update cycles count from previous clock capture +inline static void lib_ams::bh_shmember_read_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + u64 prev_cycles = algo_lib::_db.clock.value; + ++lib_ams::_db.trace.step_bh_shmember_read; + lib_ams::_db.trace.step_bh_shmember_read_cycles += cur_cycles - prev_cycles; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- lib_ams.FDb.bh_shmember_read.Call +inline static void lib_ams::bh_shmember_read_Call() { + if (!lib_ams::bh_shmember_read_EmptyQ()) { // fstep:lib_ams.FDb.bh_shmember_read + lib_ams::bh_shmember_read_Step(); // steptype:Inline: call function on every step + bh_shmember_read_UpdateCycles(); + algo_lib::_db.next_loop = algo_lib::_db.clock; + } } // --- lib_ams.FDb.trace.RowidFind @@ -2180,6 +2669,106 @@ inline static i32 lib_ams::trace_N() { return 1; } +// --- lib_ams.FDb.ind_shmember_curs.Reset +void lib_ams::_db_ind_shmember_curs_Reset(_db_ind_shmember_curs &curs, lib_ams::FDb &parent) { + curs.bucket = 0; + curs.parent = &parent; + curs.prow = &parent.ind_shmember_buckets_elems[0]; // hash never has zero buckets + while (!*curs.prow) { + curs.bucket += 1; + if (curs.bucket == parent.ind_shmember_buckets_n) break; + curs.prow = &parent.ind_shmember_buckets_elems[curs.bucket]; + } +} + +// --- lib_ams.FDb.bh_shmember_read_curs.Add +static void lib_ams::_db_bh_shmember_read_curs_Add(_db_bh_shmember_read_curs &curs, lib_ams::FShmember& row) { + u32 n = curs.temp_n; + int i = n; + curs.temp_n = n+1; + lib_ams::FShmember* *elems = curs.temp_elems; + while (i>0) { + int j = (i-1)/2; + lib_ams::FShmember* p = elems[j]; + if (!bh_shmember_read_ElemLt(row,*p)) { + break; + } + elems[i]=p; + i=j; + } + elems[i]=&row; +} + +// --- lib_ams.FDb.bh_shmember_read_curs.Reserve +void lib_ams::_db_bh_shmember_read_curs_Reserve(_db_bh_shmember_read_curs &curs, int n) { + if (n > curs.temp_max) { + size_t old_size = sizeof(void*) * curs.temp_max; + size_t new_size = sizeof(void*) * bh_shmember_read_N(); + curs.temp_elems = (lib_ams::FShmember**)algo_lib::malloc_ReallocMem(curs.temp_elems, old_size, new_size); + if (!curs.temp_elems) { + algo::FatalErrorExit("lib_ams.cursor_out_of_memory func:lib_ams.FDb.bh_shmember_read_curs.Reserve"); + } + curs.temp_max = bh_shmember_read_N(); + } +} + +// --- lib_ams.FDb.bh_shmember_read_curs.Reset +// Reset cursor. If HEAP is non-empty, add its top element to CURS. +void lib_ams::_db_bh_shmember_read_curs_Reset(_db_bh_shmember_read_curs &curs, lib_ams::FDb &parent) { + curs.parent = &parent; + _db_bh_shmember_read_curs_Reserve(curs, bh_shmember_read_N()); + curs.temp_n = 0; + if (parent.bh_shmember_read_n > 0) { + lib_ams::FShmember &first = *parent.bh_shmember_read_elems[0]; + curs.temp_elems[0] = &first; // insert first element in heap + curs.temp_n = 1; + } +} + +// --- lib_ams.FDb.bh_shmember_read_curs.Next +// Advance cursor. +void lib_ams::_db_bh_shmember_read_curs_Next(_db_bh_shmember_read_curs &curs) { + lib_ams::FShmember* *elems = curs.temp_elems; + int n = curs.temp_n; + if (n > 0) { + // remove top element from heap + lib_ams::FShmember* dead = elems[0]; + int i = 0; + lib_ams::FShmember* last = curs.temp_elems[n-1]; + // downheap last elem + do { + lib_ams::FShmember* choose = last; + int l = i*2+1; + if (lbh_shmember_read_idx; + i = (index*2+1); + if (i < bh_shmember_read_N()) { + lib_ams::FShmember &elem = *curs.parent->bh_shmember_read_elems[i]; + _db_bh_shmember_read_curs_Add(curs, elem); + } + if (i+1 < bh_shmember_read_N()) { + lib_ams::FShmember &elem = *curs.parent->bh_shmember_read_elems[i + 1]; + _db_bh_shmember_read_curs_Add(curs, elem); + } + } +} + // --- lib_ams.FDb..Init // Set all fields to initial values. void lib_ams::FDb_Init() { @@ -2202,32 +2791,35 @@ void lib_ams::FDb_Init() { _db.zd_flush_n = 0; // (lib_ams.FDb.zd_flush) _db.zd_flush_tail = NULL; // (lib_ams.FDb.zd_flush) lib_ams::_db.zd_flush_delay = algo::ToSchedTime(0.1); // initialize fstep delay (lib_ams.FDb.zd_flush) - // initialize LAry stream (lib_ams.FDb.stream) - _db.stream_n = 0; - memset(_db.stream_lary, 0, sizeof(_db.stream_lary)); // zero out all level pointers - lib_ams::FStream* stream_first = (lib_ams::FStream*)algo_lib::malloc_AllocMem(sizeof(lib_ams::FStream) * (u64(1)<<4)); - if (!stream_first) { + // initialize LAry shm (lib_ams.FDb.shm) + _db.shm_n = 0; + memset(_db.shm_lary, 0, sizeof(_db.shm_lary)); // zero out all level pointers + lib_ams::FShm* shm_first = (lib_ams::FShm*)algo_lib::malloc_AllocMem(sizeof(lib_ams::FShm) * (u64(1)<<4)); + if (!shm_first) { FatalErrorExit("out of memory"); } for (int i = 0; i < 4; i++) { - _db.stream_lary[i] = stream_first; - stream_first += 1ULL< lib_ams::in_GetMsg(lib_ams::FFdin& fdin) { return ret; } +// --- lib_ams.FFdin.in.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void lib_ams::in_Realloc(lib_ams::FFdin& fdin, int new_max) { + new_max = i32_Max(new_max, fdin.in_end); + u8 *new_mem = fdin.in_elems + ? (u8*)algo_lib::malloc_ReallocMem(fdin.in_elems, fdin.in_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("lib_ams.fbuf_nomem field:lib_ams.FFdin.in comment:'out of memory'"); + } + fdin.in_elems = new_mem; + fdin.in_max = new_max; +} + // --- lib_ams.FFdin.in.Refill // Refill buffer. Return false if no further refill possible (input buffer exhausted) bool lib_ams::in_Refill(lib_ams::FFdin& fdin) { @@ -2479,7 +3099,7 @@ void lib_ams::in_SkipMsg(lib_ams::FFdin& fdin) { } // --- lib_ams.FFdin.in.WriteAll -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. @@ -2493,22 +3113,39 @@ bool lib_ams::in_WriteAll(lib_ams::FFdin& fdin, u8 *in, i32 in_n) { // now try to write the message. i32 end = fdin.in_end; bool fits = end + in_n <= max; - if (fits && in_n > 0) { - memcpy(fdin.in_elems + end, in, in_n); - fdin.in_end = end + in_n; + if (fits) { + if (in_n > 0) { + memcpy(fdin.in_elems + end, in, in_n); + fdin.in_end = end + in_n; + } } return fits; } +// --- lib_ams.FFdin.in.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void lib_ams::in_WriteReserve(lib_ams::FFdin& fdin, u8 *in, i32 in_n) { + if (!in_WriteAll(fdin, in, in_n)) { + in_Realloc(fdin, fdin.in_max*2); + if (!in_WriteAll(fdin, in, in_n)) { + FatalErrorExit("in: out of memory"); + } + } +} + // --- lib_ams.FFdin..Init // Set all fields to initial values. void lib_ams::FFdin_Init(lib_ams::FFdin& fdin) { + fdin.in_elems = NULL; // in: initialize + fdin.in_max = 0; // in: initialize fdin.in_end = 0; // in: initialize fdin.in_start = 0; // in: initialize fdin.in_eof = false; // in: initialize fdin.in_msgvalid = false; // in: initialize fdin.in_msglen = 0; // in: initialize fdin.in_epoll_enable = true; // in: initialize + in_Realloc(fdin, 8192); fdin.cd_fdin_eof_next = (lib_ams::FFdin*)-1; // (lib_ams.FDb.cd_fdin_eof) not-in-list fdin.cd_fdin_eof_prev = NULL; // (lib_ams.FDb.cd_fdin_eof) fdin.cd_fdin_read_next = (lib_ams::FFdin*)-1; // (lib_ams.FDb.cd_fdin_read) not-in-list @@ -2520,98 +3157,177 @@ void lib_ams::FFdin_Uninit(lib_ams::FFdin& fdin) { lib_ams::FFdin &row = fdin; (void)row; cd_fdin_eof_Remove(row); // remove fdin from index cd_fdin_eof cd_fdin_read_Remove(row); // remove fdin from index cd_fdin_read -} -// --- lib_ams.FMember..Uninit -void lib_ams::FMember_Uninit(lib_ams::FMember& member) { - lib_ams::FMember &row = member; (void)row; - ind_member_Remove(row); // remove member from index ind_member - lib_ams::FStream* p_stream_id = lib_ams::ind_stream_Find(row.member.stream_id); - if (p_stream_id) { - zd_member_bystream_Remove(*p_stream_id, row);// remove member from index zd_member_bystream - } - lib_ams::FProc* p_proc_id = lib_ams::ind_proc_Find(row.member.proc_id); - if (p_proc_id) { - zd_member_byproc_Remove(*p_proc_id, row);// remove member from index zd_member_byproc + // lib_ams.FFdin.in.Uninit (Fbuf) // + if (fdin.in_elems) { + algo_lib::malloc_FreeMem(fdin.in_elems, sizeof(char)*fdin.in_max); // (lib_ams.FFdin.in) } + fdin.in_elems = NULL; + fdin.in_max = 0; } -// --- lib_ams.FProc.zd_member_byproc.Cascdel -// Delete all elements in the linked list. -void lib_ams::zd_member_byproc_Cascdel(lib_ams::FProc& proc) { - while (lib_ams::FMember *zd_member_byproc_first = zd_member_byproc_First(proc)) { - member_Delete(*zd_member_byproc_first); +// --- lib_ams.FProc.c_shm.Insert +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +void lib_ams::c_shm_Insert(lib_ams::FProc& proc, lib_ams::FShm& row) { + if (row.proc_c_shm_idx == -1) { + c_shm_Reserve(proc, 1); + u32 n = proc.c_shm_n++; + proc.c_shm_elems[n] = &row; + row.proc_c_shm_idx = n; } } -// --- lib_ams.FProc.zd_member_byproc.Insert -// Insert row into linked list. If row is already in linked list, do nothing. -void lib_ams::zd_member_byproc_Insert(lib_ams::FProc& proc, lib_ams::FMember& row) { - if (!zd_member_byproc_InLlistQ(row)) { - lib_ams::FMember* old_tail = proc.zd_member_byproc_tail; - row.zd_member_byproc_next = NULL; - row.zd_member_byproc_prev = old_tail; - proc.zd_member_byproc_tail = &row; - lib_ams::FMember **new_row_a = &old_tail->zd_member_byproc_next; - lib_ams::FMember **new_row_b = &proc.zd_member_byproc_head; - lib_ams::FMember **new_row = old_tail ? new_row_a : new_row_b; - *new_row = &row; - proc.zd_member_byproc_n++; - } +// --- lib_ams.FProc.c_shm.InsertMaybe +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +bool lib_ams::c_shm_InsertMaybe(lib_ams::FProc& proc, lib_ams::FShm& row) { + bool retval = !proc_c_shm_InAryQ(row); + c_shm_Insert(proc,row); // check is performed in _Insert again + return retval; } -// --- lib_ams.FProc.zd_member_byproc.Remove -// Remove element from index. If element is not in index, do nothing. -void lib_ams::zd_member_byproc_Remove(lib_ams::FProc& proc, lib_ams::FMember& row) { - if (zd_member_byproc_InLlistQ(row)) { - lib_ams::FMember* old_head = proc.zd_member_byproc_head; - (void)old_head; // in case it's not used - lib_ams::FMember* prev = row.zd_member_byproc_prev; - lib_ams::FMember* next = row.zd_member_byproc_next; - // if element is first, adjust list head; otherwise, adjust previous element's next - lib_ams::FMember **new_next_a = &prev->zd_member_byproc_next; - lib_ams::FMember **new_next_b = &proc.zd_member_byproc_head; - lib_ams::FMember **new_next = prev ? new_next_a : new_next_b; - *new_next = next; - // if element is last, adjust list tail; otherwise, adjust next element's prev - lib_ams::FMember **new_prev_a = &next->zd_member_byproc_prev; - lib_ams::FMember **new_prev_b = &proc.zd_member_byproc_tail; - lib_ams::FMember **new_prev = next ? new_prev_a : new_prev_b; - *new_prev = prev; - proc.zd_member_byproc_n--; - row.zd_member_byproc_next=(lib_ams::FMember*)-1; // not-in-list +// --- lib_ams.FProc.c_shm.Remove +// Find element using linear scan. If element is in array, remove, otherwise do nothing +void lib_ams::c_shm_Remove(lib_ams::FProc& proc, lib_ams::FShm& row) { + int n = proc.c_shm_n; + int idx = row.proc_c_shm_idx; + if (idx != -1) { + lib_ams::FShm *last = proc.c_shm_elems[n-1]; + last->proc_c_shm_idx = idx; + proc.c_shm_elems[idx] = last; + row.proc_c_shm_idx = -1; + proc.c_shm_n = n - 1; + } +} + +// --- lib_ams.FProc.c_shm.Reserve +// Reserve space in index for N more elements; +void lib_ams::c_shm_Reserve(lib_ams::FProc& proc, u32 n) { + u32 old_max = proc.c_shm_max; + if (UNLIKELY(proc.c_shm_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(lib_ams::FShm*); + u32 new_size = new_max * sizeof(lib_ams::FShm*); + void *new_mem = algo_lib::malloc_ReallocMem(proc.c_shm_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("lib_ams.out_of_memory field:lib_ams.FProc.c_shm"); + } + proc.c_shm_elems = (lib_ams::FShm**)new_mem; + proc.c_shm_max = new_max; } } -// --- lib_ams.FProc.zd_member_byproc.RemoveAll -// Empty the index. (The rows are not deleted) -void lib_ams::zd_member_byproc_RemoveAll(lib_ams::FProc& proc) { - lib_ams::FMember* row = proc.zd_member_byproc_head; - proc.zd_member_byproc_head = NULL; - proc.zd_member_byproc_tail = NULL; - proc.zd_member_byproc_n = 0; - while (row) { - lib_ams::FMember* row_next = row->zd_member_byproc_next; - row->zd_member_byproc_next = (lib_ams::FMember*)-1; - row->zd_member_byproc_prev = NULL; - row = row_next; +// --- lib_ams.FProc.c_shm.RemoveFirst +// Heap-like Ptrary: remove first element +// If index is empty, return NULL. Otherwise remove and return first element in index. +lib_ams::FShm* lib_ams::c_shm_RemoveFirst(lib_ams::FProc& proc) { + lib_ams::FShm *row = NULL; + int n = proc.c_shm_n; + if (n > 0) { + row = proc.c_shm_elems[0]; + row->proc_c_shm_idx=-1; + proc.c_shm_elems[n-1]->proc_c_shm_idx=0; + proc.c_shm_elems[0]=proc.c_shm_elems[n-1]; + proc.c_shm_n = n-1; } + return row; } -// --- lib_ams.FProc.zd_member_byproc.RemoveFirst -// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -lib_ams::FMember* lib_ams::zd_member_byproc_RemoveFirst(lib_ams::FProc& proc) { - lib_ams::FMember *row = NULL; - row = proc.zd_member_byproc_head; - if (row) { - lib_ams::FMember *next = row->zd_member_byproc_next; - proc.zd_member_byproc_head = next; - lib_ams::FMember **new_end_a = &next->zd_member_byproc_prev; - lib_ams::FMember **new_end_b = &proc.zd_member_byproc_tail; - lib_ams::FMember **new_end = next ? new_end_a : new_end_b; - *new_end = NULL; - proc.zd_member_byproc_n--; - row->zd_member_byproc_next = (lib_ams::FMember*)-1; // mark as not-in-list +// --- lib_ams.FProc.c_shm.RemoveLast +// Ptrary: remove last element +// If index is empty, return NULL. Otherwise remove and return last element in index. +lib_ams::FShm* lib_ams::c_shm_RemoveLast(lib_ams::FProc& proc) { + lib_ams::FShm *row = NULL; + int n = proc.c_shm_n; + if (n > 0) { + row = proc.c_shm_elems[n-1]; + row->proc_c_shm_idx=-1; + proc.c_shm_n = n-1; + } + return row; +} + +// --- lib_ams.FProc.c_shmember.Insert +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +void lib_ams::c_shmember_Insert(lib_ams::FProc& proc, lib_ams::FShmember& row) { + if (row.proc_c_shmember_idx == -1) { + c_shmember_Reserve(proc, 1); + u32 n = proc.c_shmember_n++; + proc.c_shmember_elems[n] = &row; + row.proc_c_shmember_idx = n; + } +} + +// --- lib_ams.FProc.c_shmember.InsertMaybe +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +bool lib_ams::c_shmember_InsertMaybe(lib_ams::FProc& proc, lib_ams::FShmember& row) { + bool retval = !proc_c_shmember_InAryQ(row); + c_shmember_Insert(proc,row); // check is performed in _Insert again + return retval; +} + +// --- lib_ams.FProc.c_shmember.Remove +// Find element using linear scan. If element is in array, remove, otherwise do nothing +void lib_ams::c_shmember_Remove(lib_ams::FProc& proc, lib_ams::FShmember& row) { + int n = proc.c_shmember_n; + int idx = row.proc_c_shmember_idx; + if (idx != -1) { + lib_ams::FShmember *last = proc.c_shmember_elems[n-1]; + last->proc_c_shmember_idx = idx; + proc.c_shmember_elems[idx] = last; + row.proc_c_shmember_idx = -1; + proc.c_shmember_n = n - 1; + } +} + +// --- lib_ams.FProc.c_shmember.Reserve +// Reserve space in index for N more elements; +void lib_ams::c_shmember_Reserve(lib_ams::FProc& proc, u32 n) { + u32 old_max = proc.c_shmember_max; + if (UNLIKELY(proc.c_shmember_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(lib_ams::FShmember*); + u32 new_size = new_max * sizeof(lib_ams::FShmember*); + void *new_mem = algo_lib::malloc_ReallocMem(proc.c_shmember_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("lib_ams.out_of_memory field:lib_ams.FProc.c_shmember"); + } + proc.c_shmember_elems = (lib_ams::FShmember**)new_mem; + proc.c_shmember_max = new_max; + } +} + +// --- lib_ams.FProc.c_shmember.RemoveFirst +// Heap-like Ptrary: remove first element +// If index is empty, return NULL. Otherwise remove and return first element in index. +lib_ams::FShmember* lib_ams::c_shmember_RemoveFirst(lib_ams::FProc& proc) { + lib_ams::FShmember *row = NULL; + int n = proc.c_shmember_n; + if (n > 0) { + row = proc.c_shmember_elems[0]; + row->proc_c_shmember_idx=-1; + proc.c_shmember_elems[n-1]->proc_c_shmember_idx=0; + proc.c_shmember_elems[0]=proc.c_shmember_elems[n-1]; + proc.c_shmember_n = n-1; + } + return row; +} + +// --- lib_ams.FProc.c_shmember.RemoveLast +// Ptrary: remove last element +// If index is empty, return NULL. Otherwise remove and return last element in index. +lib_ams::FShmember* lib_ams::c_shmember_RemoveLast(lib_ams::FProc& proc) { + lib_ams::FShmember *row = NULL; + int n = proc.c_shmember_n; + if (n > 0) { + row = proc.c_shmember_elems[n-1]; + row->proc_c_shmember_idx=-1; + proc.c_shmember_n = n-1; } return row; } @@ -2619,9 +3335,14 @@ lib_ams::FMember* lib_ams::zd_member_byproc_RemoveFirst(lib_ams::FProc& proc) { // --- lib_ams.FProc..Uninit void lib_ams::FProc_Uninit(lib_ams::FProc& proc) { lib_ams::FProc &row = proc; (void)row; - zd_member_byproc_Cascdel(proc); // dmmeta.cascdel:lib_ams.FProc.zd_member_byproc ind_proc_Remove(row); // remove proc from index ind_proc zd_proc_Remove(row); // remove proc from index zd_proc + + // lib_ams.FProc.c_shmember.Uninit (Ptrary) //List of AMS shm readers/writers at this proc + algo_lib::malloc_FreeMem(proc.c_shmember_elems, sizeof(lib_ams::FShmember*)*proc.c_shmember_max); // (lib_ams.FProc.c_shmember) + + // lib_ams.FProc.c_shm.Uninit (Ptrary) // + algo_lib::malloc_FreeMem(proc.c_shm_elems, sizeof(lib_ams::FShm*)*proc.c_shm_max); // (lib_ams.FProc.c_shm) } // --- lib_ams.FReadfile.buf.Addary @@ -2682,6 +3403,23 @@ algo::aryptr lib_ams::buf_AllocN(lib_ams::FReadfile& parent, int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- lib_ams.FReadfile.buf.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr lib_ams::buf_AllocNAt(lib_ams::FReadfile& parent, int n_elems, int at) { + buf_Reserve(parent, n_elems); + int n = parent.buf_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("lib_ams.bad_alloc_n_at field:lib_ams.FReadfile.buf comment:'index out of range'"); + } + u8 *elems = parent.buf_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u8)); + memset(elems + at, 0, n_elems); // initialize new space + parent.buf_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- lib_ams.FReadfile.buf.Remove // Remove item by index. If index outside of range, do nothing. void lib_ams::buf_Remove(lib_ams::FReadfile& parent, u32 i) { @@ -2764,6 +3502,25 @@ bool lib_ams::buf_ReadStrptrMaybe(lib_ams::FReadfile& parent, algo::strptr in_st return retval; } +// --- lib_ams.FReadfile.buf.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void lib_ams::buf_Insary(lib_ams::FReadfile& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.buf_elems && rhs.elems < parent.buf_elems + parent.buf_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("lib_ams.tary_alias field:lib_ams.FReadfile.buf comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.buf_elems+1))) { + FatalErrorExit("lib_ams.bad_insary field:lib_ams.FReadfile.buf comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.buf_n - at; + buf_Reserve(parent, nnew); // reserve space + memmove(parent.buf_elems + at + nnew, parent.buf_elems + at, nmove * sizeof(u8)); + memcpy(parent.buf_elems + at, rhs.elems, nnew * sizeof(u8)); + parent.buf_n += nnew; +} + // --- lib_ams.FReadfile.cbuf.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -2822,6 +3579,23 @@ algo::aryptr lib_ams::cbuf_AllocN(lib_ams::FReadfile& parent, int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- lib_ams.FReadfile.cbuf.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr lib_ams::cbuf_AllocNAt(lib_ams::FReadfile& parent, int n_elems, int at) { + cbuf_Reserve(parent, n_elems); + int n = parent.cbuf_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("lib_ams.bad_alloc_n_at field:lib_ams.FReadfile.cbuf comment:'index out of range'"); + } + u8 *elems = parent.cbuf_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u8)); + memset(elems + at, 0, n_elems); // initialize new space + parent.cbuf_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- lib_ams.FReadfile.cbuf.Remove // Remove item by index. If index outside of range, do nothing. void lib_ams::cbuf_Remove(lib_ams::FReadfile& parent, u32 i) { @@ -2904,6 +3678,25 @@ bool lib_ams::cbuf_ReadStrptrMaybe(lib_ams::FReadfile& parent, algo::strptr in_s return retval; } +// --- lib_ams.FReadfile.cbuf.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void lib_ams::cbuf_Insary(lib_ams::FReadfile& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.cbuf_elems && rhs.elems < parent.cbuf_elems + parent.cbuf_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("lib_ams.tary_alias field:lib_ams.FReadfile.cbuf comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.cbuf_elems+1))) { + FatalErrorExit("lib_ams.bad_insary field:lib_ams.FReadfile.cbuf comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.cbuf_n - at; + cbuf_Reserve(parent, nnew); // reserve space + memmove(parent.cbuf_elems + at + nnew, parent.cbuf_elems + at, nmove * sizeof(u8)); + memcpy(parent.cbuf_elems + at, rhs.elems, nnew * sizeof(u8)); + parent.cbuf_n += nnew; +} + // --- lib_ams.FReadfile.offset.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -2964,6 +3757,25 @@ algo::aryptr lib_ams::offset_AllocN(lib_ams::FReadfile& parent, int n_elems return algo::aryptr(elems + old_n, n_elems); } +// --- lib_ams.FReadfile.offset.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr lib_ams::offset_AllocNAt(lib_ams::FReadfile& parent, int n_elems, int at) { + offset_Reserve(parent, n_elems); + int n = parent.offset_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("lib_ams.bad_alloc_n_at field:lib_ams.FReadfile.offset comment:'index out of range'"); + } + u32 *elems = parent.offset_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u32)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) u32(0); // construct new element, default initialize + } + parent.offset_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- lib_ams.FReadfile.offset.Remove // Remove item by index. If index outside of range, do nothing. void lib_ams::offset_Remove(lib_ams::FReadfile& parent, u32 i) { @@ -3048,6 +3860,25 @@ bool lib_ams::offset_ReadStrptrMaybe(lib_ams::FReadfile& parent, algo::strptr in return retval; } +// --- lib_ams.FReadfile.offset.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void lib_ams::offset_Insary(lib_ams::FReadfile& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.offset_elems && rhs.elems < parent.offset_elems + parent.offset_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("lib_ams.tary_alias field:lib_ams.FReadfile.offset comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.offset_elems+1))) { + FatalErrorExit("lib_ams.bad_insary field:lib_ams.FReadfile.offset comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.offset_n - at; + offset_Reserve(parent, nnew); // reserve space + memmove(parent.offset_elems + at + nnew, parent.offset_elems + at, nmove * sizeof(u32)); + memcpy(parent.offset_elems + at, rhs.elems, nnew * sizeof(u32)); + parent.offset_n += nnew; +} + // --- lib_ams.FReadfile..Uninit void lib_ams::FReadfile_Uninit(lib_ams::FReadfile& parent) { lib_ams::FReadfile &row = parent; (void)row; @@ -3144,137 +3975,194 @@ lib_ams::FReadfile& lib_ams::FReadfile::operator =(const lib_ams::FReadfile &rhs offset_Setary(*this, offset_Getary(const_cast(rhs))); } -// --- lib_ams.FStream.zd_member_bystream.Insert -// Insert row into linked list. If row is already in linked list, do nothing. -void lib_ams::zd_member_bystream_Insert(lib_ams::FStream& stream, lib_ams::FMember& row) { - if (!zd_member_bystream_InLlistQ(row)) { - lib_ams::FMember* old_tail = stream.zd_member_bystream_tail; - row.zd_member_bystream_next = NULL; - row.zd_member_bystream_prev = old_tail; - stream.zd_member_bystream_tail = &row; - lib_ams::FMember **new_row_a = &old_tail->zd_member_bystream_next; - lib_ams::FMember **new_row_b = &stream.zd_member_bystream_head; - lib_ams::FMember **new_row = old_tail ? new_row_a : new_row_b; - *new_row = &row; - stream.zd_member_bystream_n++; +// --- lib_ams.FShm.c_shmember.Insert +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +void lib_ams::c_shmember_Insert(lib_ams::FShm& shm, lib_ams::FShmember& row) { + if (row.shm_c_shmember_idx == -1) { + c_shmember_Reserve(shm, 1); + u32 n = shm.c_shmember_n++; + shm.c_shmember_elems[n] = &row; + row.shm_c_shmember_idx = n; } } -// --- lib_ams.FStream.zd_member_bystream.Remove -// Remove element from index. If element is not in index, do nothing. -void lib_ams::zd_member_bystream_Remove(lib_ams::FStream& stream, lib_ams::FMember& row) { - if (zd_member_bystream_InLlistQ(row)) { - lib_ams::FMember* old_head = stream.zd_member_bystream_head; - (void)old_head; // in case it's not used - lib_ams::FMember* prev = row.zd_member_bystream_prev; - lib_ams::FMember* next = row.zd_member_bystream_next; - // if element is first, adjust list head; otherwise, adjust previous element's next - lib_ams::FMember **new_next_a = &prev->zd_member_bystream_next; - lib_ams::FMember **new_next_b = &stream.zd_member_bystream_head; - lib_ams::FMember **new_next = prev ? new_next_a : new_next_b; - *new_next = next; - // if element is last, adjust list tail; otherwise, adjust next element's prev - lib_ams::FMember **new_prev_a = &next->zd_member_bystream_prev; - lib_ams::FMember **new_prev_b = &stream.zd_member_bystream_tail; - lib_ams::FMember **new_prev = next ? new_prev_a : new_prev_b; - *new_prev = prev; - stream.zd_member_bystream_n--; - row.zd_member_bystream_next=(lib_ams::FMember*)-1; // not-in-list +// --- lib_ams.FShm.c_shmember.InsertMaybe +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +bool lib_ams::c_shmember_InsertMaybe(lib_ams::FShm& shm, lib_ams::FShmember& row) { + bool retval = !shm_c_shmember_InAryQ(row); + c_shmember_Insert(shm,row); // check is performed in _Insert again + return retval; +} + +// --- lib_ams.FShm.c_shmember.Remove +// Find element using linear scan. If element is in array, remove, otherwise do nothing +void lib_ams::c_shmember_Remove(lib_ams::FShm& shm, lib_ams::FShmember& row) { + int n = shm.c_shmember_n; + int idx = row.shm_c_shmember_idx; + if (idx != -1) { + lib_ams::FShmember *last = shm.c_shmember_elems[n-1]; + last->shm_c_shmember_idx = idx; + shm.c_shmember_elems[idx] = last; + row.shm_c_shmember_idx = -1; + shm.c_shmember_n = n - 1; + } +} + +// --- lib_ams.FShm.c_shmember.Reserve +// Reserve space in index for N more elements; +void lib_ams::c_shmember_Reserve(lib_ams::FShm& shm, u32 n) { + u32 old_max = shm.c_shmember_max; + if (UNLIKELY(shm.c_shmember_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(lib_ams::FShmember*); + u32 new_size = new_max * sizeof(lib_ams::FShmember*); + void *new_mem = algo_lib::malloc_ReallocMem(shm.c_shmember_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("lib_ams.out_of_memory field:lib_ams.FShm.c_shmember"); + } + shm.c_shmember_elems = (lib_ams::FShmember**)new_mem; + shm.c_shmember_max = new_max; } } -// --- lib_ams.FStream.zd_member_bystream.RemoveAll -// Empty the index. (The rows are not deleted) -void lib_ams::zd_member_bystream_RemoveAll(lib_ams::FStream& stream) { - lib_ams::FMember* row = stream.zd_member_bystream_head; - stream.zd_member_bystream_head = NULL; - stream.zd_member_bystream_tail = NULL; - stream.zd_member_bystream_n = 0; - while (row) { - lib_ams::FMember* row_next = row->zd_member_bystream_next; - row->zd_member_bystream_next = (lib_ams::FMember*)-1; - row->zd_member_bystream_prev = NULL; - row = row_next; +// --- lib_ams.FShm.c_shmember.RemoveFirst +// Heap-like Ptrary: remove first element +// If index is empty, return NULL. Otherwise remove and return first element in index. +lib_ams::FShmember* lib_ams::c_shmember_RemoveFirst(lib_ams::FShm& shm) { + lib_ams::FShmember *row = NULL; + int n = shm.c_shmember_n; + if (n > 0) { + row = shm.c_shmember_elems[0]; + row->shm_c_shmember_idx=-1; + shm.c_shmember_elems[n-1]->shm_c_shmember_idx=0; + shm.c_shmember_elems[0]=shm.c_shmember_elems[n-1]; + shm.c_shmember_n = n-1; } + return row; } -// --- lib_ams.FStream.zd_member_bystream.RemoveFirst -// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -lib_ams::FMember* lib_ams::zd_member_bystream_RemoveFirst(lib_ams::FStream& stream) { - lib_ams::FMember *row = NULL; - row = stream.zd_member_bystream_head; - if (row) { - lib_ams::FMember *next = row->zd_member_bystream_next; - stream.zd_member_bystream_head = next; - lib_ams::FMember **new_end_a = &next->zd_member_bystream_prev; - lib_ams::FMember **new_end_b = &stream.zd_member_bystream_tail; - lib_ams::FMember **new_end = next ? new_end_a : new_end_b; - *new_end = NULL; - stream.zd_member_bystream_n--; - row->zd_member_bystream_next = (lib_ams::FMember*)-1; // mark as not-in-list +// --- lib_ams.FShm.c_shmember.RemoveLast +// Ptrary: remove last element +// If index is empty, return NULL. Otherwise remove and return last element in index. +lib_ams::FShmember* lib_ams::c_shmember_RemoveLast(lib_ams::FShm& shm) { + lib_ams::FShmember *row = NULL; + int n = shm.c_shmember_n; + if (n > 0) { + row = shm.c_shmember_elems[n-1]; + row->shm_c_shmember_idx=-1; + shm.c_shmember_n = n-1; } return row; } -// --- lib_ams.FStream..Init +// --- lib_ams.FShm..Init // Set all fields to initial values. -void lib_ams::FStream_Init(lib_ams::FStream& stream) { - stream.shm_handle = NULL; - stream.limit = u64(0); - stream.offset_mask = u64(0); - stream.cur_msg = NULL; - stream.zd_member_bystream_head = NULL; // (lib_ams.FStream.zd_member_bystream) - stream.zd_member_bystream_n = 0; // (lib_ams.FStream.zd_member_bystream) - stream.zd_member_bystream_tail = NULL; // (lib_ams.FStream.zd_member_bystream) - stream.next_ackoff = u64(1023); - stream.p_streamtype = NULL; - stream.n_write_block = u32(0); - stream.burst = i32(20); - stream.writer_error = bool(false); - stream.ind_stream_next = (lib_ams::FStream*)-1; // (lib_ams.FDb.ind_stream) not-in-hash - stream.cd_stream_hb_next = (lib_ams::FStream*)-1; // (lib_ams.FDb.cd_stream_hb) not-in-list - stream.cd_stream_hb_prev = NULL; // (lib_ams.FDb.cd_stream_hb) - stream.cd_poll_read_next = (lib_ams::FStream*)-1; // (lib_ams.FDb.cd_poll_read) not-in-list - stream.cd_poll_read_prev = NULL; // (lib_ams.FDb.cd_poll_read) - stream.zd_ctlin_next = (lib_ams::FStream*)-1; // (lib_ams.FDb.zd_ctlin) not-in-list - stream.zd_ctlin_prev = NULL; // (lib_ams.FDb.zd_ctlin) - stream.h_msg = NULL; - stream.h_msg_ctx = 0; - stream.h_msg_orig = NULL; - stream.h_msg_orig_ctx = 0; -} - -// --- lib_ams.FStream..Uninit -void lib_ams::FStream_Uninit(lib_ams::FStream& stream) { - lib_ams::FStream &row = stream; (void)row; - ind_stream_Remove(row); // remove stream from index ind_stream - cd_stream_hb_Remove(row); // remove stream from index cd_stream_hb - cd_poll_read_Remove(row); // remove stream from index cd_poll_read - zd_ctlin_Remove(row); // remove stream from index zd_ctlin - shm_handle_Cleanup(stream); // dmmeta.fcleanup:lib_ams.FStream.shm_handle - shm_file_Cleanup(stream); // dmmeta.fcleanup:lib_ams.FStream.shm_file -} - -// --- lib_ams.FStreamType.base.CopyOut +void lib_ams::FShm_Init(lib_ams::FShm& shm) { + shm.c_shmember_elems = NULL; // (lib_ams.FShm.c_shmember) + shm.c_shmember_n = 0; // (lib_ams.FShm.c_shmember) + shm.c_shmember_max = 0; // (lib_ams.FShm.c_shmember) + shm.shm_handle = NULL; + shm.c_read = NULL; + shm.c_write = NULL; + shm.writelimit = u64(0); + shm.offset_mask = u64(0); + shm.next_ackoff = u64(1023); + shm.p_shmtype = NULL; + shm.n_write_block = u32(0); + shm.error = bool(false); + shm.created = bool(false); + shm.schedbias = i64(0); + shm.proc_c_shm_idx = i32(-1); + shm.ind_shm_next = (lib_ams::FShm*)-1; // (lib_ams.FDb.ind_shm) not-in-hash + shm.ind_shm_hashval = 0; // stored hash value + shm.h_amsmsg = NULL; + shm.h_amsmsg_ctx = 0; + shm.h_msg_orig = NULL; + shm.h_msg_orig_ctx = 0; +} + +// --- lib_ams.FShm..Uninit +void lib_ams::FShm_Uninit(lib_ams::FShm& shm) { + lib_ams::FShm &row = shm; (void)row; + shm_file_Cleanup(shm); // dmmeta.fcleanup:lib_ams.FShm.shm_file + ind_shm_Remove(row); // remove shm from index ind_shm + lib_ams::FProc* p_proc_id = lib_ams::ind_proc_Find(row.shm_id.proc_id); + if (p_proc_id) { + c_shm_Remove(*p_proc_id, row);// remove shm from index c_shm + } + + // lib_ams.FShm.c_shmember.Uninit (Ptrary) //List of all read/write members + algo_lib::malloc_FreeMem(shm.c_shmember_elems, sizeof(lib_ams::FShmember*)*shm.c_shmember_max); // (lib_ams.FShm.c_shmember) +} + +// --- lib_ams.FShmember..Init +// Set all fields to initial values. +void lib_ams::FShmember_Init(lib_ams::FShmember& shmember) { + shmember.off = u64(0); + shmember.sortkey = u64(0); + shmember.budget = u64(0); + shmember.p_shm = NULL; + shmember.c_cur_msg = NULL; + shmember.p_proc = NULL; + shmember.c_ctlin_idx = i32(-1); + shmember.proc_c_shmember_idx = i32(-1); + shmember.shm_c_shmember_idx = i32(-1); + shmember.cd_hb_next = (lib_ams::FShmember*)-1; // (lib_ams.FDb.cd_hb) not-in-list + shmember.cd_hb_prev = NULL; // (lib_ams.FDb.cd_hb) + shmember.cd_poll_read_next = (lib_ams::FShmember*)-1; // (lib_ams.FDb.cd_poll_read) not-in-list + shmember.cd_poll_read_prev = NULL; // (lib_ams.FDb.cd_poll_read) + shmember.cd_slow_poll_read_next = (lib_ams::FShmember*)-1; // (lib_ams.FDb.cd_slow_poll_read) not-in-list + shmember.cd_slow_poll_read_prev = NULL; // (lib_ams.FDb.cd_slow_poll_read) + shmember.shmember_next = (lib_ams::FShmember*)-1; // (lib_ams.FDb.shmember) not-in-tpool's freelist + shmember.ind_shmember_next = (lib_ams::FShmember*)-1; // (lib_ams.FDb.ind_shmember) not-in-hash + shmember.ind_shmember_hashval = 0; // stored hash value + shmember.bh_shmember_read_idx = -1; // (lib_ams.FDb.bh_shmember_read) not-in-heap +} + +// --- lib_ams.FShmember..Uninit +void lib_ams::FShmember_Uninit(lib_ams::FShmember& shmember) { + lib_ams::FShmember &row = shmember; (void)row; + lib_ams::FProc* p_proc_id = lib_ams::ind_proc_Find(row.shmember.proc_id); + if (p_proc_id) { + c_shmember_Remove(*p_proc_id, row);// remove shmember from index c_shmember + } + lib_ams::FShm* p_shm_id = lib_ams::ind_shm_Find(row.shmember.shm_id); + if (p_shm_id) { + c_shmember_Remove(*p_shm_id, row);// remove shmember from index c_shmember + } + cd_hb_Remove(row); // remove shmember from index cd_hb + cd_poll_read_Remove(row); // remove shmember from index cd_poll_read + cd_slow_poll_read_Remove(row); // remove shmember from index cd_slow_poll_read + ind_shmember_Remove(row); // remove shmember from index ind_shmember + c_ctlin_Remove(row); // remove shmember from index c_ctlin + bh_shmember_read_Remove(row); // remove shmember from index bh_shmember_read +} + +// --- lib_ams.FShmtype.base.CopyOut // Copy fields out of row -void lib_ams::streamtype_CopyOut(lib_ams::FStreamType &row, amsdb::StreamType &out) { - out.streamtype = row.streamtype; +void lib_ams::shmtype_CopyOut(lib_ams::FShmtype &row, amsdb::Shmtype &out) { + out.shmtype = row.shmtype; out.id = row.id; + out.nonblock = row.nonblock; out.comment = row.comment; } -// --- lib_ams.FStreamType.base.CopyIn +// --- lib_ams.FShmtype.base.CopyIn // Copy fields in to row -void lib_ams::streamtype_CopyIn(lib_ams::FStreamType &row, amsdb::StreamType &in) { - row.streamtype = in.streamtype; +void lib_ams::shmtype_CopyIn(lib_ams::FShmtype &row, amsdb::Shmtype &in) { + row.shmtype = in.shmtype; row.id = in.id; + row.nonblock = in.nonblock; row.comment = in.comment; } -// --- lib_ams.FStreamType..Uninit -void lib_ams::FStreamType_Uninit(lib_ams::FStreamType& streamtype) { - lib_ams::FStreamType &row = streamtype; (void)row; - ind_streamtype_Remove(row); // remove streamtype from index ind_streamtype +// --- lib_ams.FShmtype..Uninit +void lib_ams::FShmtype_Uninit(lib_ams::FShmtype& shmtype) { + lib_ams::FShmtype &row = shmtype; (void)row; + ind_shmtype_Remove(row); // remove shmtype from index ind_shmtype } // --- lib_ams.FWritefile.buf.Addary @@ -3335,6 +4223,23 @@ algo::aryptr lib_ams::buf_AllocN(lib_ams::FWritefile& writefile, int n_elems return algo::aryptr(elems + old_n, n_elems); } +// --- lib_ams.FWritefile.buf.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr lib_ams::buf_AllocNAt(lib_ams::FWritefile& writefile, int n_elems, int at) { + buf_Reserve(writefile, n_elems); + int n = writefile.buf_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("lib_ams.bad_alloc_n_at field:lib_ams.FWritefile.buf comment:'index out of range'"); + } + u8 *elems = writefile.buf_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u8)); + memset(elems + at, 0, n_elems); // initialize new space + writefile.buf_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- lib_ams.FWritefile.buf.Remove // Remove item by index. If index outside of range, do nothing. void lib_ams::buf_Remove(lib_ams::FWritefile& writefile, u32 i) { @@ -3417,6 +4322,25 @@ bool lib_ams::buf_ReadStrptrMaybe(lib_ams::FWritefile& writefile, algo::strptr i return retval; } +// --- lib_ams.FWritefile.buf.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void lib_ams::buf_Insary(lib_ams::FWritefile& writefile, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= writefile.buf_elems && rhs.elems < writefile.buf_elems + writefile.buf_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("lib_ams.tary_alias field:lib_ams.FWritefile.buf comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(writefile.buf_elems+1))) { + FatalErrorExit("lib_ams.bad_insary field:lib_ams.FWritefile.buf comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = writefile.buf_n - at; + buf_Reserve(writefile, nnew); // reserve space + memmove(writefile.buf_elems + at + nnew, writefile.buf_elems + at, nmove * sizeof(u8)); + memcpy(writefile.buf_elems + at, rhs.elems, nnew * sizeof(u8)); + writefile.buf_n += nnew; +} + // --- lib_ams.FWritefile.cbuf.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -3475,6 +4399,23 @@ algo::aryptr lib_ams::cbuf_AllocN(lib_ams::FWritefile& writefile, int n_elem return algo::aryptr(elems + old_n, n_elems); } +// --- lib_ams.FWritefile.cbuf.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr lib_ams::cbuf_AllocNAt(lib_ams::FWritefile& writefile, int n_elems, int at) { + cbuf_Reserve(writefile, n_elems); + int n = writefile.cbuf_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("lib_ams.bad_alloc_n_at field:lib_ams.FWritefile.cbuf comment:'index out of range'"); + } + u8 *elems = writefile.cbuf_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(u8)); + memset(elems + at, 0, n_elems); // initialize new space + writefile.cbuf_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- lib_ams.FWritefile.cbuf.Remove // Remove item by index. If index outside of range, do nothing. void lib_ams::cbuf_Remove(lib_ams::FWritefile& writefile, u32 i) { @@ -3557,11 +4498,30 @@ bool lib_ams::cbuf_ReadStrptrMaybe(lib_ams::FWritefile& writefile, algo::strptr return retval; } +// --- lib_ams.FWritefile.cbuf.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void lib_ams::cbuf_Insary(lib_ams::FWritefile& writefile, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= writefile.cbuf_elems && rhs.elems < writefile.cbuf_elems + writefile.cbuf_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("lib_ams.tary_alias field:lib_ams.FWritefile.cbuf comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(writefile.cbuf_elems+1))) { + FatalErrorExit("lib_ams.bad_insary field:lib_ams.FWritefile.cbuf comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = writefile.cbuf_n - at; + cbuf_Reserve(writefile, nnew); // reserve space + memmove(writefile.cbuf_elems + at + nnew, writefile.cbuf_elems + at, nmove * sizeof(u8)); + memcpy(writefile.cbuf_elems + at, rhs.elems, nnew * sizeof(u8)); + writefile.cbuf_n += nnew; +} + // --- lib_ams.FWritefile..Uninit void lib_ams::FWritefile_Uninit(lib_ams::FWritefile& writefile) { lib_ams::FWritefile &row = writefile; (void)row; - zd_flush_Remove(row); // remove writefile from index zd_flush fd_Cleanup(writefile); // dmmeta.fcleanup:lib_ams.FWritefile.fd + zd_flush_Remove(row); // remove writefile from index zd_flush // lib_ams.FWritefile.cbuf.Uninit (Tary) //Compressed buffer // remove all elements from lib_ams.FWritefile.cbuf @@ -3681,17 +4641,76 @@ void lib_ams::FieldId_Print(lib_ams::FieldId& row, algo::cstring& str) { lib_ams::value_Print(row, str); } +// --- lib_ams.MsgFmt.format.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* lib_ams::format_ToCstr(const lib_ams::MsgFmt& parent) { + const char *ret = NULL; + switch(format_GetEnum(parent)) { + case lib_ams_MsgFmt_format_ssim : ret = "ssim"; break; + case lib_ams_MsgFmt_format_bin : ret = "bin"; break; + } + return ret; +} + +// --- lib_ams.MsgFmt.format.Print +// Convert format to a string. First, attempt conversion to a known string. +// If no string matches, print format as a numeric value. +void lib_ams::format_Print(const lib_ams::MsgFmt& parent, algo::cstring &lhs) { + const char *strval = format_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.format; + } +} + +// --- lib_ams.MsgFmt.format.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool lib_ams::format_SetStrptrMaybe(lib_ams::MsgFmt& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('b','i','n'): { + format_SetEnum(parent,lib_ams_MsgFmt_format_bin); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('s','s','i','m'): { + format_SetEnum(parent,lib_ams_MsgFmt_format_ssim); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- lib_ams.MsgFmt.format.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void lib_ams::format_SetStrptr(lib_ams::MsgFmt& parent, algo::strptr rhs, lib_ams_MsgFmt_format_Enum dflt) { + if (!format_SetStrptrMaybe(parent,rhs)) format_SetEnum(parent,dflt); +} + // --- lib_ams...SizeCheck inline static void lib_ams::SizeCheck() { } // --- lib_ams...StaticCheck void lib_ams::StaticCheck() { - algo_assert(sizeof(lib_ams::stream_h_msg_hook) == 8); // csize:lib_ams.stream_h_msg_hook - algo_assert(sizeof(lib_ams::stream_h_msg_orig_hook) == 8); // csize:lib_ams.stream_h_msg_orig_hook + algo_assert(sizeof(lib_ams::parent_h_convert_hook) == 8); // csize:lib_ams.parent_h_convert_hook + algo_assert(sizeof(lib_ams::shm_h_amsmsg_hook) == 8); // csize:lib_ams.shm_h_amsmsg_hook + algo_assert(sizeof(lib_ams::shm_h_msg_orig_hook) == 8); // csize:lib_ams.shm_h_msg_orig_hook algo_assert(_offset_of(lib_ams::CtlConnCase, value) + sizeof(((lib_ams::CtlConnCase*)0)->value) == sizeof(lib_ams::CtlConnCase)); algo_assert(_offset_of(lib_ams::CtlMsgCase, value) + sizeof(((lib_ams::CtlMsgCase*)0)->value) == sizeof(lib_ams::CtlMsgCase)); - algo_assert(_offset_of(lib_ams::trace, n_write_block_spin) + sizeof(((lib_ams::trace*)0)->n_write_block_spin) == sizeof(lib_ams::trace)); + algo_assert(_offset_of(lib_ams::trace, del__db_shmtype) + sizeof(((lib_ams::trace*)0)->del__db_shmtype) == sizeof(lib_ams::trace)); algo_assert(_offset_of(lib_ams::FieldId, value) + sizeof(((lib_ams::FieldId*)0)->value) == sizeof(lib_ams::FieldId)); } @@ -3699,21 +4718,9 @@ void lib_ams::StaticCheck() { int lib_ams::CtlMsgDispatchRaw(lib_ams::CtlMsgCase type, u8 *msg, u32 len) { int ret = 0; switch(type) { - case 12: if (sizeof(ams::DumpStreamTableMsg) <= len) { - lib_ams::CtlMsg_DumpStreamTableMsg((ams::DumpStreamTableMsg&)*msg); - ret = (int)sizeof(ams::DumpStreamTableMsg); - } break; - case 4: if (sizeof(ams::ProcAddMsg) <= len) { - lib_ams::CtlMsg_ProcAddMsg((ams::ProcAddMsg&)*msg); - ret = (int)sizeof(ams::ProcAddMsg); - } break; - case 5: if (sizeof(ams::ProcRemoveMsg) <= len) { - lib_ams::CtlMsg_ProcRemoveMsg((ams::ProcRemoveMsg&)*msg); - ret = (int)sizeof(ams::ProcRemoveMsg); - } break; - case 3: if (sizeof(ams::StreamHbMsg) <= len) { - lib_ams::CtlMsg_StreamHbMsg((ams::StreamHbMsg&)*msg); - ret = (int)sizeof(ams::StreamHbMsg); + case 3: if (sizeof(ams::ShmHbMsg) <= len) { + lib_ams::CtlMsg_ShmHbMsg((ams::ShmHbMsg&)*msg); + ret = (int)sizeof(ams::ShmHbMsg); } break; default: break; @@ -3735,49 +4742,54 @@ void lib_ams::vCtlMsgDispatch(ams::MsgHeader& msg) { // --- lib_ams...InputLineMsg_FmtByteAry // Construct a new ams::InputLineMsg in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -ams::InputLineMsg * lib_ams::InputLineMsg_FmtByteAry(algo::ByteAry &buf, algo::aryptr payload) { +ams::InputLineMsg * lib_ams::InputLineMsg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc_id, algo::aryptr payload) { ams::InputLineMsg *msg = NULL; size_t len = sizeof(ams::InputLineMsg); - u32 ary_len = elems_N(payload) * sizeof(char); - len += ary_len; + u32 payload_ary_len = elems_N(payload) * sizeof(char); + len += payload_ary_len; ary_RemoveAll(buf); msg = (ams::InputLineMsg*)ary_AllocN(buf,len).elems; msg->type = u32(22); msg->length = u32(len + (0)); - memcpy(payload_Addr(*msg), payload.elems, ary_len); + msg->proc_id = proc_id; + memcpy(payload_Addr(*msg), payload.elems, payload_ary_len); return msg; } -// --- lib_ams...LogMsg_FmtAmsStream +// --- lib_ams...LogMsg_FmtShm // Construct a new ams::LogMsg in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -ams::LogMsg * lib_ams::LogMsg_FmtAmsStream(lib_ams::FStream &stream, const algo::strptr& logcat, algo::SchedTime tstamp, algo::aryptr text) { +ams::LogMsg * lib_ams::LogMsg_FmtShm(lib_ams::FShm &shm, ams::ProcId proc_id, algo::SchedTime tstamp, algo::aryptr logcat, algo::aryptr text) { ams::LogMsg *msg = NULL; size_t len = sizeof(ams::LogMsg); - u32 ary_len = elems_N(text) * sizeof(char); - len += ary_len; - msg = (ams::LogMsg*)lib_ams::BeginWrite(stream,int(len)); + u32 logcat_ary_len = elems_N(logcat) * sizeof(char); + len += logcat_ary_len; + u32 text_ary_len = elems_N(text) * sizeof(char); + len += text_ary_len; + msg = (ams::LogMsg*)lib_ams::BeginWrite(shm,int(len)); if (!msg) { return NULL; // no room. } msg->type = u32(6); msg->length = u32(len + (0)); - msg->logcat = logcat; + msg->proc_id = proc_id; msg->tstamp = tstamp; - memcpy(text_Addr(*msg), text.elems, ary_len); - lib_ams::EndWrite(stream,msg,int(len)); + memcpy(logcat_Addr(*msg), logcat.elems, logcat_ary_len); + (*msg).logcat_end = u32(logcat_ary_len); + memcpy(text_Addr(*msg), text.elems, text_ary_len); + lib_ams::EndWrite(shm,msg,int(len)); return msg; } -// --- lib_ams...MsgBlock_FmtAmsStream +// --- lib_ams...MsgBlock_FmtShm // Construct a new ams::MsgBlock in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -ams::MsgBlock * lib_ams::MsgBlock_FmtAmsStream(lib_ams::FStream &stream, u64 first_seqno, u32 n_messages, u32 original_length, algo::aryptr messages) { +ams::MsgBlock * lib_ams::MsgBlock_FmtShm(lib_ams::FShm &shm, u64 first_seqno, u32 n_messages, u32 original_length, algo::aryptr messages) { ams::MsgBlock *msg = NULL; size_t len = sizeof(ams::MsgBlock); - u32 ary_len = elems_N(messages) * sizeof(u8); - len += ary_len; - msg = (ams::MsgBlock*)lib_ams::BeginWrite(stream,int(len)); + u32 messages_ary_len = elems_N(messages) * sizeof(u8); + len += messages_ary_len; + msg = (ams::MsgBlock*)lib_ams::BeginWrite(shm,int(len)); if (!msg) { return NULL; // no room. } @@ -3786,202 +4798,55 @@ ams::MsgBlock * lib_ams::MsgBlock_FmtAmsStream(lib_ams::FStream &stream, u64 fir msg->first_seqno = first_seqno; msg->n_messages = n_messages; msg->original_length = original_length; - memcpy(messages_Addr(*msg), messages.elems, ary_len); - lib_ams::EndWrite(stream,msg,int(len)); - return msg; -} - -// --- lib_ams...OpenMsg_FmtAmsStream -// Construct a new ams::OpenMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::OpenMsg * lib_ams::OpenMsg_FmtAmsStream(lib_ams::FStream &stream, ams::Member member, ams::StreamPos pos) { - ams::OpenMsg *msg = NULL; - size_t len = sizeof(ams::OpenMsg); - msg = (ams::OpenMsg*)lib_ams::BeginWrite(stream,int(len)); - if (!msg) { - return NULL; // no room. - } - msg->type = u32(7); - msg->length = u32(len + (0)); - msg->member = member; - msg->pos = pos; - lib_ams::EndWrite(stream,msg,int(len)); - return msg; -} - -// --- lib_ams...PrlogMsg_FmtAmsStream -// Construct a new ams::PrlogMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::PrlogMsg * lib_ams::PrlogMsg_FmtAmsStream(lib_ams::FStream &stream, const algo::strptr& logcat, algo::SchedTime tstamp, ams::MsgHeader* data) { - ams::PrlogMsg *msg = NULL; - size_t len = sizeof(ams::PrlogMsg); - int opt_len = data ? i32(data[0].length) : 0; - len += opt_len; - msg = (ams::PrlogMsg*)lib_ams::BeginWrite(stream,int(len)); - if (!msg) { - return NULL; // no room. - } - msg->type = u32(229); - msg->length = u32(len + (0)); - msg->logcat = logcat; - msg->tstamp = tstamp; - if (data) { - memcpy((u8*)msg + sizeof(ams::PrlogMsg), data, opt_len); - } - lib_ams::EndWrite(stream,msg,int(len)); - return msg; -} - -// --- lib_ams...ProcAddMsg_FmtAmsStream -// Construct a new ams::ProcAddMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::ProcAddMsg * lib_ams::ProcAddMsg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc_id) { - ams::ProcAddMsg *msg = NULL; - size_t len = sizeof(ams::ProcAddMsg); - msg = (ams::ProcAddMsg*)lib_ams::BeginWrite(stream,int(len)); - if (!msg) { - return NULL; // no room. - } - msg->type = u32(4); - msg->length = u32(len + (0)); - msg->proc_id = proc_id; - lib_ams::EndWrite(stream,msg,int(len)); - return msg; -} - -// --- lib_ams...ProcRemoveMsg_FmtAmsStream -// Construct a new ams::ProcRemoveMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::ProcRemoveMsg * lib_ams::ProcRemoveMsg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc_id) { - ams::ProcRemoveMsg *msg = NULL; - size_t len = sizeof(ams::ProcRemoveMsg); - msg = (ams::ProcRemoveMsg*)lib_ams::BeginWrite(stream,int(len)); - if (!msg) { - return NULL; // no room. - } - msg->type = u32(5); - msg->length = u32(len + (0)); - msg->proc_id = proc_id; - lib_ams::EndWrite(stream,msg,int(len)); + memcpy(messages_Addr(*msg), messages.elems, messages_ary_len); + lib_ams::EndWrite(shm,msg,int(len)); return msg; } -// --- lib_ams...StreamHbMsg_FmtAmsStream -// Construct a new ams::StreamHbMsg in the space provided by BUF. +// --- lib_ams...ShmHbMsg_FmtShm +// Construct a new ams::ShmHbMsg in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -ams::StreamHbMsg * lib_ams::StreamHbMsg_FmtAmsStream(lib_ams::FStream &stream, ams::Member member, ams::StreamPos pos, u32 wbudget) { - ams::StreamHbMsg *msg = NULL; - size_t len = sizeof(ams::StreamHbMsg); - msg = (ams::StreamHbMsg*)lib_ams::BeginWrite(stream,int(len)); +ams::ShmHbMsg * lib_ams::ShmHbMsg_FmtShm(lib_ams::FShm &shm, ams::ShmemberId shmember, u64 off, u32 wbudget) { + ams::ShmHbMsg *msg = NULL; + size_t len = sizeof(ams::ShmHbMsg); + msg = (ams::ShmHbMsg*)lib_ams::BeginWrite(shm,int(len)); if (!msg) { return NULL; // no room. } msg->type = u32(3); msg->length = u32(len + (0)); - msg->member = member; - msg->pos = pos; + msg->shmember = shmember; + msg->off = off; msg->wbudget = wbudget; - lib_ams::EndWrite(stream,msg,int(len)); - return msg; -} - -// --- lib_ams...Trace2Msg_FmtAmsStream -// Construct a new ams::Trace2Msg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::Trace2Msg * lib_ams::Trace2Msg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc, u8 trace, algo::UnTime tstamp, algo::aryptr data) { - ams::Trace2Msg *msg = NULL; - size_t len = sizeof(ams::Trace2Msg); - u32 ary_len = elems_N(data) * sizeof(u64); - len += ary_len; - msg = (ams::Trace2Msg*)lib_ams::BeginWrite(stream,int(len)); - if (!msg) { - return NULL; // no room. - } - msg->type = u32(108); - msg->length = u32(len + (0)); - msg->proc = proc; - msg->trace = trace; - msg->tstamp = tstamp; - memcpy(data_Addr(*msg), data.elems, ary_len); - lib_ams::EndWrite(stream,msg,int(len)); - return msg; -} - -// --- lib_ams...TraceInfo2Msg_FmtAmsStream -// Construct a new ams::TraceInfo2Msg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::TraceInfo2Msg * lib_ams::TraceInfo2Msg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc, u8 trace, algo::UnTime tstamp, u8 part, algo::aryptr data) { - ams::TraceInfo2Msg *msg = NULL; - size_t len = sizeof(ams::TraceInfo2Msg); - u32 ary_len = elems_N(data) * sizeof(char); - len += ary_len; - msg = (ams::TraceInfo2Msg*)lib_ams::BeginWrite(stream,int(len)); - if (!msg) { - return NULL; // no room. - } - msg->type = u32(109); - msg->length = u32(len + (0)); - msg->proc = proc; - msg->trace = trace; - msg->tstamp = tstamp; - msg->part = part; - memcpy(data_Addr(*msg), data.elems, ary_len); - lib_ams::EndWrite(stream,msg,int(len)); + lib_ams::EndWrite(shm,msg,int(len)); return msg; } -// --- lib_ams...TraceInfoMsg_FmtAmsStream -// Construct a new ams::TraceInfoMsg in the space provided by BUF. +// --- lib_ams...TerminateMsg_FmtShm +// Construct a new ams::TerminateMsg in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -ams::TraceInfoMsg * lib_ams::TraceInfoMsg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc, algo::UnTime tstamp, u8 part, algo::aryptr data) { - ams::TraceInfoMsg *msg = NULL; - size_t len = sizeof(ams::TraceInfoMsg); - u32 ary_len = elems_N(data) * sizeof(char); - len += ary_len; - msg = (ams::TraceInfoMsg*)lib_ams::BeginWrite(stream,int(len)); +ams::TerminateMsg * lib_ams::TerminateMsg_FmtShm(lib_ams::FShm &shm) { + ams::TerminateMsg *msg = NULL; + size_t len = sizeof(ams::TerminateMsg); + msg = (ams::TerminateMsg*)lib_ams::BeginWrite(shm,int(len)); if (!msg) { return NULL; // no room. } - msg->type = u32(9); + msg->type = u32(352); msg->length = u32(len + (0)); - msg->proc = proc; - msg->tstamp = tstamp; - msg->part = part; - memcpy(data_Addr(*msg), data.elems, ary_len); - lib_ams::EndWrite(stream,msg,int(len)); - return msg; -} - -// --- lib_ams...TraceMsg_FmtAmsStream -// Construct a new ams::TraceMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -ams::TraceMsg * lib_ams::TraceMsg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc, algo::UnTime tstamp, algo::aryptr data) { - ams::TraceMsg *msg = NULL; - size_t len = sizeof(ams::TraceMsg); - u32 ary_len = elems_N(data) * sizeof(u64); - len += ary_len; - msg = (ams::TraceMsg*)lib_ams::BeginWrite(stream,int(len)); - if (!msg) { - return NULL; // no room. - } - msg->type = u32(8); - msg->length = u32(len + (0)); - msg->proc = proc; - msg->tstamp = tstamp; - memcpy(data_Addr(*msg), data.elems, ary_len); - lib_ams::EndWrite(stream,msg,int(len)); + lib_ams::EndWrite(shm,msg,int(len)); return msg; } -// --- lib_ams...UdpFrame_FmtAmsStream +// --- lib_ams...UdpFrame_FmtShm // Construct a new ams::UdpFrame in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -ams::UdpFrame * lib_ams::UdpFrame_FmtAmsStream(lib_ams::FStream &stream, algo::UnTime timestamp, ietf::Ipv4 src_ip, ietf::Ipv4 dst_ip, u16 src_port, u16 dst_port, algo::aryptr payload) { +ams::UdpFrame * lib_ams::UdpFrame_FmtShm(lib_ams::FShm &shm, algo::UnTime timestamp, ietf::Ipv4 src_ip, ietf::Ipv4 dst_ip, u16 src_port, u16 dst_port, algo::aryptr payload) { ams::UdpFrame *msg = NULL; size_t len = sizeof(ams::UdpFrame); - u32 ary_len = elems_N(payload) * sizeof(u8); - len += ary_len; - msg = (ams::UdpFrame*)lib_ams::BeginWrite(stream,int(len)); + u32 payload_ary_len = elems_N(payload) * sizeof(u8); + len += payload_ary_len; + msg = (ams::UdpFrame*)lib_ams::BeginWrite(shm,int(len)); if (!msg) { return NULL; // no room. } @@ -3992,7 +4857,7 @@ ams::UdpFrame * lib_ams::UdpFrame_FmtAmsStream(lib_ams::FStream &stream, algo::U msg->dst_ip = dst_ip; msg->src_port = src_port; msg->dst_port = dst_port; - memcpy(payload_Addr(*msg), payload.elems, ary_len); - lib_ams::EndWrite(stream,msg,int(len)); + memcpy(payload_Addr(*msg), payload.elems, payload_ary_len); + lib_ams::EndWrite(shm,msg,int(len)); return msg; } diff --git a/cpp/gen/lib_ctype_gen.cpp b/cpp/gen/lib_ctype_gen.cpp index e289a3c6..83fa4be4 100644 --- a/cpp/gen/lib_ctype_gen.cpp +++ b/cpp/gen/lib_ctype_gen.cpp @@ -33,6 +33,8 @@ #include "include/gen/dmmeta_gen.inl.h" #include "include/gen/dev_gen.h" #include "include/gen/dev_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_amcdb_gen.h" @@ -84,9 +86,11 @@ bool lib_ctype::Cmdline_ReadFieldMaybe(lib_ctype::Cmdline& parent, algo::strptr switch(field_id) { case lib_ctype_FieldId_in: { retval = algo::cstring_ReadStrptrMaybe(parent.in, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -146,7 +150,7 @@ void lib_ctype::Cmdline_PrintArgv(lib_ctype::Cmdline& row, algo::cstring& str) { i32 lib_ctype::Cmdline_NArgs(lib_ctype::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case lib_ctype_FieldId_in: { // $comment + case lib_ctype_FieldId_in: { // *out_anon = false; } break; default: @@ -260,6 +264,7 @@ void lib_ctype::FCfmt_Init(lib_ctype::FCfmt& cfmt) { cfmt.genop = bool(false); cfmt.ctype_c_cfmt_in_ary = bool(false); cfmt.ind_cfmt_next = (lib_ctype::FCfmt*)-1; // (lib_ctype.FDb.ind_cfmt) not-in-hash + cfmt.ind_cfmt_hashval = 0; // stored hash value } // --- lib_ctype.FCfmt..Uninit @@ -361,15 +366,11 @@ algo::Smallstr100 lib_ctype::name_Get(lib_ctype::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void lib_ctype::c_field_Insert(lib_ctype::FCtype& ctype, lib_ctype::FField& row) { - if (bool_Update(row.ctype_c_field_in_ary,true)) { - // reserve space + if (!row.ctype_c_field_in_ary) { c_field_Reserve(ctype, 1); - u32 n = ctype.c_field_n; - u32 at = n; - lib_ctype::FField* *elems = ctype.c_field_elems; - elems[at] = &row; - ctype.c_field_n = n+1; - + u32 n = ctype.c_field_n++; + ctype.c_field_elems[n] = &row; + row.ctype_c_field_in_ary = true; } } @@ -378,7 +379,7 @@ void lib_ctype::c_field_Insert(lib_ctype::FCtype& ctype, lib_ctype::FField& row) // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool lib_ctype::c_field_InsertMaybe(lib_ctype::FCtype& ctype, lib_ctype::FField& row) { - bool retval = !row.ctype_c_field_in_ary; + bool retval = !ctype_c_field_InAryQ(row); c_field_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -386,18 +387,18 @@ bool lib_ctype::c_field_InsertMaybe(lib_ctype::FCtype& ctype, lib_ctype::FField& // --- lib_ctype.FCtype.c_field.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void lib_ctype::c_field_Remove(lib_ctype::FCtype& ctype, lib_ctype::FField& row) { + int n = ctype.c_field_n; if (bool_Update(row.ctype_c_field_in_ary,false)) { - int lim = ctype.c_field_n; lib_ctype::FField* *elems = ctype.c_field_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { lib_ctype::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(lib_ctype::FField*) * (lim - j); + size_t nbytes = sizeof(lib_ctype::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_field_n = lim - 1; + ctype.c_field_n = n - 1; break; } } @@ -425,15 +426,11 @@ void lib_ctype::c_field_Reserve(lib_ctype::FCtype& ctype, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void lib_ctype::c_cfmt_Insert(lib_ctype::FCtype& ctype, lib_ctype::FCfmt& row) { - if (bool_Update(row.ctype_c_cfmt_in_ary,true)) { - // reserve space + if (!row.ctype_c_cfmt_in_ary) { c_cfmt_Reserve(ctype, 1); - u32 n = ctype.c_cfmt_n; - u32 at = n; - lib_ctype::FCfmt* *elems = ctype.c_cfmt_elems; - elems[at] = &row; - ctype.c_cfmt_n = n+1; - + u32 n = ctype.c_cfmt_n++; + ctype.c_cfmt_elems[n] = &row; + row.ctype_c_cfmt_in_ary = true; } } @@ -442,7 +439,7 @@ void lib_ctype::c_cfmt_Insert(lib_ctype::FCtype& ctype, lib_ctype::FCfmt& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool lib_ctype::c_cfmt_InsertMaybe(lib_ctype::FCtype& ctype, lib_ctype::FCfmt& row) { - bool retval = !row.ctype_c_cfmt_in_ary; + bool retval = !ctype_c_cfmt_InAryQ(row); c_cfmt_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -450,18 +447,18 @@ bool lib_ctype::c_cfmt_InsertMaybe(lib_ctype::FCtype& ctype, lib_ctype::FCfmt& r // --- lib_ctype.FCtype.c_cfmt.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void lib_ctype::c_cfmt_Remove(lib_ctype::FCtype& ctype, lib_ctype::FCfmt& row) { + int n = ctype.c_cfmt_n; if (bool_Update(row.ctype_c_cfmt_in_ary,false)) { - int lim = ctype.c_cfmt_n; lib_ctype::FCfmt* *elems = ctype.c_cfmt_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { lib_ctype::FCfmt* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(lib_ctype::FCfmt*) * (lim - j); + size_t nbytes = sizeof(lib_ctype::FCfmt*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_cfmt_n = lim - 1; + ctype.c_cfmt_n = n - 1; break; } } @@ -498,6 +495,7 @@ void lib_ctype::FCtype_Init(lib_ctype::FCtype& ctype) { ctype.c_bltin = NULL; ctype.c_sqltype = NULL; ctype.ind_ctype_next = (lib_ctype::FCtype*)-1; // (lib_ctype.FDb.ind_ctype) not-in-hash + ctype.ind_ctype_hashval = 0; // stored hash value } // --- lib_ctype.FCtype..Uninit @@ -631,14 +629,9 @@ bool lib_ctype::fconst_XrefMaybe(lib_ctype::FFconst &row) { // Find row by key. Return NULL if not found. lib_ctype::FFconst* lib_ctype::ind_fconst_key_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_fconst_key_buckets_n - 1); - lib_ctype::FFconst* *e = &_db.ind_fconst_key_buckets_elems[index]; - lib_ctype::FFconst* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).key == key; - if (done) break; - e = &ret->ind_fconst_key_next; - } while (true); + lib_ctype::FFconst *ret = _db.ind_fconst_key_buckets_elems[index]; + for (; ret && !((*ret).key == key); ret = ret->ind_fconst_key_next) { + } return ret; } @@ -653,10 +646,11 @@ lib_ctype::FFconst& lib_ctype::ind_fconst_key_FindX(const algo::strptr& key) { // --- lib_ctype.FDb.ind_fconst_key.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_ctype::ind_fconst_key_InsertMaybe(lib_ctype::FFconst& row) { - ind_fconst_key_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fconst_key_next == (lib_ctype::FFconst*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.key) & (_db.ind_fconst_key_buckets_n - 1); + row.ind_fconst_key_hashval = algo::cstring_Hash(0, row.key); + ind_fconst_key_Reserve(1); + u32 index = row.ind_fconst_key_hashval & (_db.ind_fconst_key_buckets_n - 1); lib_ctype::FFconst* *prev = &_db.ind_fconst_key_buckets_elems[index]; do { lib_ctype::FFconst* ret = *prev; @@ -682,7 +676,7 @@ bool lib_ctype::ind_fconst_key_InsertMaybe(lib_ctype::FFconst& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_ctype::ind_fconst_key_Remove(lib_ctype::FFconst& row) { if (LIKELY(row.ind_fconst_key_next != (lib_ctype::FFconst*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.key) & (_db.ind_fconst_key_buckets_n - 1); + u32 index = row.ind_fconst_key_hashval & (_db.ind_fconst_key_buckets_n - 1); lib_ctype::FFconst* *prev = &_db.ind_fconst_key_buckets_elems[index]; // addr of pointer to current element while (lib_ctype::FFconst *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -699,8 +693,14 @@ void lib_ctype::ind_fconst_key_Remove(lib_ctype::FFconst& row) { // --- lib_ctype.FDb.ind_fconst_key.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_ctype::ind_fconst_key_Reserve(int n) { + ind_fconst_key_AbsReserve(_db.ind_fconst_key_n + n); +} + +// --- lib_ctype.FDb.ind_fconst_key.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_ctype::ind_fconst_key_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fconst_key_buckets_n; - u32 new_nelems = _db.ind_fconst_key_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -719,7 +719,7 @@ void lib_ctype::ind_fconst_key_Reserve(int n) { while (elem) { lib_ctype::FFconst &row = *elem; lib_ctype::FFconst* next = row.ind_fconst_key_next; - u32 index = algo::cstring_Hash(0, row.key) & (new_nbuckets-1); + u32 index = row.ind_fconst_key_hashval & (new_nbuckets-1); row.ind_fconst_key_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -736,14 +736,9 @@ void lib_ctype::ind_fconst_key_Reserve(int n) { // Find row by key. Return NULL if not found. lib_ctype::FFconst* lib_ctype::ind_fconst_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_fconst_buckets_n - 1); - lib_ctype::FFconst* *e = &_db.ind_fconst_buckets_elems[index]; - lib_ctype::FFconst* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).fconst == key; - if (done) break; - e = &ret->ind_fconst_next; - } while (true); + lib_ctype::FFconst *ret = _db.ind_fconst_buckets_elems[index]; + for (; ret && !((*ret).fconst == key); ret = ret->ind_fconst_next) { + } return ret; } @@ -758,10 +753,11 @@ lib_ctype::FFconst& lib_ctype::ind_fconst_FindX(const algo::strptr& key) { // --- lib_ctype.FDb.ind_fconst.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_ctype::ind_fconst_InsertMaybe(lib_ctype::FFconst& row) { - ind_fconst_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fconst_next == (lib_ctype::FFconst*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.fconst) & (_db.ind_fconst_buckets_n - 1); + row.ind_fconst_hashval = algo::Smallstr100_Hash(0, row.fconst); + ind_fconst_Reserve(1); + u32 index = row.ind_fconst_hashval & (_db.ind_fconst_buckets_n - 1); lib_ctype::FFconst* *prev = &_db.ind_fconst_buckets_elems[index]; do { lib_ctype::FFconst* ret = *prev; @@ -787,7 +783,7 @@ bool lib_ctype::ind_fconst_InsertMaybe(lib_ctype::FFconst& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_ctype::ind_fconst_Remove(lib_ctype::FFconst& row) { if (LIKELY(row.ind_fconst_next != (lib_ctype::FFconst*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.fconst) & (_db.ind_fconst_buckets_n - 1); + u32 index = row.ind_fconst_hashval & (_db.ind_fconst_buckets_n - 1); lib_ctype::FFconst* *prev = &_db.ind_fconst_buckets_elems[index]; // addr of pointer to current element while (lib_ctype::FFconst *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -804,8 +800,14 @@ void lib_ctype::ind_fconst_Remove(lib_ctype::FFconst& row) { // --- lib_ctype.FDb.ind_fconst.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_ctype::ind_fconst_Reserve(int n) { + ind_fconst_AbsReserve(_db.ind_fconst_n + n); +} + +// --- lib_ctype.FDb.ind_fconst.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_ctype::ind_fconst_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fconst_buckets_n; - u32 new_nelems = _db.ind_fconst_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -824,7 +826,7 @@ void lib_ctype::ind_fconst_Reserve(int n) { while (elem) { lib_ctype::FFconst &row = *elem; lib_ctype::FFconst* next = row.ind_fconst_next; - u32 index = algo::Smallstr100_Hash(0, row.fconst) & (new_nbuckets-1); + u32 index = row.ind_fconst_hashval & (new_nbuckets-1); row.ind_fconst_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -947,14 +949,9 @@ bool lib_ctype::ssimfile_XrefMaybe(lib_ctype::FSsimfile &row) { // Find row by key. Return NULL if not found. lib_ctype::FSsimfile* lib_ctype::ind_ssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimfile_buckets_n - 1); - lib_ctype::FSsimfile* *e = &_db.ind_ssimfile_buckets_elems[index]; - lib_ctype::FSsimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimfile_next; - } while (true); + lib_ctype::FSsimfile *ret = _db.ind_ssimfile_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimfile_next) { + } return ret; } @@ -969,10 +966,11 @@ lib_ctype::FSsimfile& lib_ctype::ind_ssimfile_FindX(const algo::strptr& key) { // --- lib_ctype.FDb.ind_ssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_ctype::ind_ssimfile_InsertMaybe(lib_ctype::FSsimfile& row) { - ind_ssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimfile_next == (lib_ctype::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + row.ind_ssimfile_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimfile_Reserve(1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); lib_ctype::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; do { lib_ctype::FSsimfile* ret = *prev; @@ -998,7 +996,7 @@ bool lib_ctype::ind_ssimfile_InsertMaybe(lib_ctype::FSsimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_ctype::ind_ssimfile_Remove(lib_ctype::FSsimfile& row) { if (LIKELY(row.ind_ssimfile_next != (lib_ctype::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); lib_ctype::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; // addr of pointer to current element while (lib_ctype::FSsimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1015,8 +1013,14 @@ void lib_ctype::ind_ssimfile_Remove(lib_ctype::FSsimfile& row) { // --- lib_ctype.FDb.ind_ssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_ctype::ind_ssimfile_Reserve(int n) { + ind_ssimfile_AbsReserve(_db.ind_ssimfile_n + n); +} + +// --- lib_ctype.FDb.ind_ssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_ctype::ind_ssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimfile_buckets_n; - u32 new_nelems = _db.ind_ssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1035,7 +1039,7 @@ void lib_ctype::ind_ssimfile_Reserve(int n) { while (elem) { lib_ctype::FSsimfile &row = *elem; lib_ctype::FSsimfile* next = row.ind_ssimfile_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimfile_hashval & (new_nbuckets-1); row.ind_ssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1251,14 +1255,9 @@ bool lib_ctype::ctype_XrefMaybe(lib_ctype::FCtype &row) { // Find row by key. Return NULL if not found. lib_ctype::FCtype* lib_ctype::ind_ctype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctype_buckets_n - 1); - lib_ctype::FCtype* *e = &_db.ind_ctype_buckets_elems[index]; - lib_ctype::FCtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctype_next; - } while (true); + lib_ctype::FCtype *ret = _db.ind_ctype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctype_next) { + } return ret; } @@ -1290,10 +1289,11 @@ lib_ctype::FCtype& lib_ctype::ind_ctype_GetOrCreate(const algo::strptr& key) { // --- lib_ctype.FDb.ind_ctype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_ctype::ind_ctype_InsertMaybe(lib_ctype::FCtype& row) { - ind_ctype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ctype_next == (lib_ctype::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + row.ind_ctype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctype_Reserve(1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); lib_ctype::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; do { lib_ctype::FCtype* ret = *prev; @@ -1319,7 +1319,7 @@ bool lib_ctype::ind_ctype_InsertMaybe(lib_ctype::FCtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_ctype::ind_ctype_Remove(lib_ctype::FCtype& row) { if (LIKELY(row.ind_ctype_next != (lib_ctype::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); lib_ctype::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; // addr of pointer to current element while (lib_ctype::FCtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1336,8 +1336,14 @@ void lib_ctype::ind_ctype_Remove(lib_ctype::FCtype& row) { // --- lib_ctype.FDb.ind_ctype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_ctype::ind_ctype_Reserve(int n) { + ind_ctype_AbsReserve(_db.ind_ctype_n + n); +} + +// --- lib_ctype.FDb.ind_ctype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_ctype::ind_ctype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ctype_buckets_n; - u32 new_nelems = _db.ind_ctype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1356,7 +1362,7 @@ void lib_ctype::ind_ctype_Reserve(int n) { while (elem) { lib_ctype::FCtype &row = *elem; lib_ctype::FCtype* next = row.ind_ctype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ctype_hashval & (new_nbuckets-1); row.ind_ctype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1488,14 +1494,9 @@ bool lib_ctype::field_XrefMaybe(lib_ctype::FField &row) { // Find row by key. Return NULL if not found. lib_ctype::FField* lib_ctype::ind_field_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_field_buckets_n - 1); - lib_ctype::FField* *e = &_db.ind_field_buckets_elems[index]; - lib_ctype::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + lib_ctype::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_field_next) { + } return ret; } @@ -1510,10 +1511,11 @@ lib_ctype::FField& lib_ctype::ind_field_FindX(const algo::strptr& key) { // --- lib_ctype.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_ctype::ind_field_InsertMaybe(lib_ctype::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (lib_ctype::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::Smallstr100_Hash(0, row.field); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); lib_ctype::FField* *prev = &_db.ind_field_buckets_elems[index]; do { lib_ctype::FField* ret = *prev; @@ -1539,7 +1541,7 @@ bool lib_ctype::ind_field_InsertMaybe(lib_ctype::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_ctype::ind_field_Remove(lib_ctype::FField& row) { if (LIKELY(row.ind_field_next != (lib_ctype::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); lib_ctype::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (lib_ctype::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1556,8 +1558,14 @@ void lib_ctype::ind_field_Remove(lib_ctype::FField& row) { // --- lib_ctype.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_ctype::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- lib_ctype.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_ctype::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1576,7 +1584,7 @@ void lib_ctype::ind_field_Reserve(int n) { while (elem) { lib_ctype::FField &row = *elem; lib_ctype::FField* next = row.ind_field_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1823,8 +1831,8 @@ bool lib_ctype::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && lib_ctype::LoadTuplesFile(algo::SsimFname(root,"dev.unstablefld"),recursive); retval = retval && lib_ctype::LoadTuplesFile(algo::SsimFname(root,"amcdb.bltin"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -2002,14 +2010,9 @@ bool lib_ctype::cfmt_XrefMaybe(lib_ctype::FCfmt &row) { // Find row by key. Return NULL if not found. lib_ctype::FCfmt* lib_ctype::ind_cfmt_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_cfmt_buckets_n - 1); - lib_ctype::FCfmt* *e = &_db.ind_cfmt_buckets_elems[index]; - lib_ctype::FCfmt* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).cfmt == key; - if (done) break; - e = &ret->ind_cfmt_next; - } while (true); + lib_ctype::FCfmt *ret = _db.ind_cfmt_buckets_elems[index]; + for (; ret && !((*ret).cfmt == key); ret = ret->ind_cfmt_next) { + } return ret; } @@ -2024,10 +2027,11 @@ lib_ctype::FCfmt& lib_ctype::ind_cfmt_FindX(const algo::strptr& key) { // --- lib_ctype.FDb.ind_cfmt.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_ctype::ind_cfmt_InsertMaybe(lib_ctype::FCfmt& row) { - ind_cfmt_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_cfmt_next == (lib_ctype::FCfmt*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.cfmt) & (_db.ind_cfmt_buckets_n - 1); + row.ind_cfmt_hashval = algo::Smallstr100_Hash(0, row.cfmt); + ind_cfmt_Reserve(1); + u32 index = row.ind_cfmt_hashval & (_db.ind_cfmt_buckets_n - 1); lib_ctype::FCfmt* *prev = &_db.ind_cfmt_buckets_elems[index]; do { lib_ctype::FCfmt* ret = *prev; @@ -2053,7 +2057,7 @@ bool lib_ctype::ind_cfmt_InsertMaybe(lib_ctype::FCfmt& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_ctype::ind_cfmt_Remove(lib_ctype::FCfmt& row) { if (LIKELY(row.ind_cfmt_next != (lib_ctype::FCfmt*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.cfmt) & (_db.ind_cfmt_buckets_n - 1); + u32 index = row.ind_cfmt_hashval & (_db.ind_cfmt_buckets_n - 1); lib_ctype::FCfmt* *prev = &_db.ind_cfmt_buckets_elems[index]; // addr of pointer to current element while (lib_ctype::FCfmt *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2070,8 +2074,14 @@ void lib_ctype::ind_cfmt_Remove(lib_ctype::FCfmt& row) { // --- lib_ctype.FDb.ind_cfmt.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_ctype::ind_cfmt_Reserve(int n) { + ind_cfmt_AbsReserve(_db.ind_cfmt_n + n); +} + +// --- lib_ctype.FDb.ind_cfmt.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_ctype::ind_cfmt_AbsReserve(int n) { u32 old_nbuckets = _db.ind_cfmt_buckets_n; - u32 new_nelems = _db.ind_cfmt_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2090,7 +2100,7 @@ void lib_ctype::ind_cfmt_Reserve(int n) { while (elem) { lib_ctype::FCfmt &row = *elem; lib_ctype::FCfmt* next = row.ind_cfmt_next; - u32 index = algo::Smallstr100_Hash(0, row.cfmt) & (new_nbuckets-1); + u32 index = row.ind_cfmt_hashval & (new_nbuckets-1); row.ind_cfmt_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -3037,12 +3047,12 @@ algo::Smallstr50 lib_ctype::name_Get(lib_ctype::FField& field) { // --- lib_ctype.FField.zd_fconst.Insert // Insert row into linked list. If row is already in linked list, do nothing. void lib_ctype::zd_fconst_Insert(lib_ctype::FField& field, lib_ctype::FFconst& row) { - if (!zd_fconst_InLlistQ(row)) { + if (!field_zd_fconst_InLlistQ(row)) { lib_ctype::FFconst* old_tail = field.zd_fconst_tail; - row.zd_fconst_next = NULL; - row.zd_fconst_prev = old_tail; + row.field_zd_fconst_next = NULL; + row.field_zd_fconst_prev = old_tail; field.zd_fconst_tail = &row; - lib_ctype::FFconst **new_row_a = &old_tail->zd_fconst_next; + lib_ctype::FFconst **new_row_a = &old_tail->field_zd_fconst_next; lib_ctype::FFconst **new_row_b = &field.zd_fconst_head; lib_ctype::FFconst **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -3053,23 +3063,23 @@ void lib_ctype::zd_fconst_Insert(lib_ctype::FField& field, lib_ctype::FFconst& r // --- lib_ctype.FField.zd_fconst.Remove // Remove element from index. If element is not in index, do nothing. void lib_ctype::zd_fconst_Remove(lib_ctype::FField& field, lib_ctype::FFconst& row) { - if (zd_fconst_InLlistQ(row)) { + if (field_zd_fconst_InLlistQ(row)) { lib_ctype::FFconst* old_head = field.zd_fconst_head; (void)old_head; // in case it's not used - lib_ctype::FFconst* prev = row.zd_fconst_prev; - lib_ctype::FFconst* next = row.zd_fconst_next; + lib_ctype::FFconst* prev = row.field_zd_fconst_prev; + lib_ctype::FFconst* next = row.field_zd_fconst_next; // if element is first, adjust list head; otherwise, adjust previous element's next - lib_ctype::FFconst **new_next_a = &prev->zd_fconst_next; + lib_ctype::FFconst **new_next_a = &prev->field_zd_fconst_next; lib_ctype::FFconst **new_next_b = &field.zd_fconst_head; lib_ctype::FFconst **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - lib_ctype::FFconst **new_prev_a = &next->zd_fconst_prev; + lib_ctype::FFconst **new_prev_a = &next->field_zd_fconst_prev; lib_ctype::FFconst **new_prev_b = &field.zd_fconst_tail; lib_ctype::FFconst **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; field.zd_fconst_n--; - row.zd_fconst_next=(lib_ctype::FFconst*)-1; // not-in-list + row.field_zd_fconst_next=(lib_ctype::FFconst*)-1; // not-in-list } } @@ -3081,9 +3091,9 @@ void lib_ctype::zd_fconst_RemoveAll(lib_ctype::FField& field) { field.zd_fconst_tail = NULL; field.zd_fconst_n = 0; while (row) { - lib_ctype::FFconst* row_next = row->zd_fconst_next; - row->zd_fconst_next = (lib_ctype::FFconst*)-1; - row->zd_fconst_prev = NULL; + lib_ctype::FFconst* row_next = row->field_zd_fconst_next; + row->field_zd_fconst_next = (lib_ctype::FFconst*)-1; + row->field_zd_fconst_prev = NULL; row = row_next; } } @@ -3094,14 +3104,14 @@ lib_ctype::FFconst* lib_ctype::zd_fconst_RemoveFirst(lib_ctype::FField& field) { lib_ctype::FFconst *row = NULL; row = field.zd_fconst_head; if (row) { - lib_ctype::FFconst *next = row->zd_fconst_next; + lib_ctype::FFconst *next = row->field_zd_fconst_next; field.zd_fconst_head = next; - lib_ctype::FFconst **new_end_a = &next->zd_fconst_prev; + lib_ctype::FFconst **new_end_a = &next->field_zd_fconst_prev; lib_ctype::FFconst **new_end_b = &field.zd_fconst_tail; lib_ctype::FFconst **new_end = next ? new_end_a : new_end_b; *new_end = NULL; field.zd_fconst_n--; - row->zd_fconst_next = (lib_ctype::FFconst*)-1; // mark as not-in-list + row->field_zd_fconst_next = (lib_ctype::FFconst*)-1; // mark as not-in-list } return row; } @@ -3110,15 +3120,11 @@ lib_ctype::FFconst* lib_ctype::zd_fconst_RemoveFirst(lib_ctype::FField& field) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void lib_ctype::c_substr_srcfield_Insert(lib_ctype::FField& field, lib_ctype::FSubstr& row) { - if (bool_Update(row.field_c_substr_srcfield_in_ary,true)) { - // reserve space + if (!row.field_c_substr_srcfield_in_ary) { c_substr_srcfield_Reserve(field, 1); - u32 n = field.c_substr_srcfield_n; - u32 at = n; - lib_ctype::FSubstr* *elems = field.c_substr_srcfield_elems; - elems[at] = &row; - field.c_substr_srcfield_n = n+1; - + u32 n = field.c_substr_srcfield_n++; + field.c_substr_srcfield_elems[n] = &row; + row.field_c_substr_srcfield_in_ary = true; } } @@ -3127,7 +3133,7 @@ void lib_ctype::c_substr_srcfield_Insert(lib_ctype::FField& field, lib_ctype::FS // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool lib_ctype::c_substr_srcfield_InsertMaybe(lib_ctype::FField& field, lib_ctype::FSubstr& row) { - bool retval = !row.field_c_substr_srcfield_in_ary; + bool retval = !field_c_substr_srcfield_InAryQ(row); c_substr_srcfield_Insert(field,row); // check is performed in _Insert again return retval; } @@ -3135,18 +3141,18 @@ bool lib_ctype::c_substr_srcfield_InsertMaybe(lib_ctype::FField& field, lib_ctyp // --- lib_ctype.FField.c_substr_srcfield.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void lib_ctype::c_substr_srcfield_Remove(lib_ctype::FField& field, lib_ctype::FSubstr& row) { + int n = field.c_substr_srcfield_n; if (bool_Update(row.field_c_substr_srcfield_in_ary,false)) { - int lim = field.c_substr_srcfield_n; lib_ctype::FSubstr* *elems = field.c_substr_srcfield_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { lib_ctype::FSubstr* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(lib_ctype::FSubstr*) * (lim - j); + size_t nbytes = sizeof(lib_ctype::FSubstr*) * (n - j); memmove(elems + i, elems + j, nbytes); - field.c_substr_srcfield_n = lim - 1; + field.c_substr_srcfield_n = n - 1; break; } } @@ -3190,6 +3196,7 @@ void lib_ctype::FField_Init(lib_ctype::FField& field) { field.c_substr_srcfield_max = 0; // (lib_ctype.FField.c_substr_srcfield) field.ctype_c_field_in_ary = bool(false); field.ind_field_next = (lib_ctype::FField*)-1; // (lib_ctype.FDb.ind_field) not-in-hash + field.ind_field_hashval = 0; // stored hash value } // --- lib_ctype.FField..Uninit diff --git a/cpp/gen/lib_curl_gen.cpp b/cpp/gen/lib_curl_gen.cpp new file mode 100644 index 00000000..fcbc3f0f --- /dev/null +++ b/cpp/gen/lib_curl_gen.cpp @@ -0,0 +1,671 @@ +// +// cpp/gen/lib_curl_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/lib_curl_gen.h" +#include "include/gen/lib_curl_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/lib_prot_gen.h" +#include "include/gen/lib_prot_gen.inl.h" +//#pragma endinclude +namespace lib_curl { // gen:ns_print_proto + // Load statically available data into tables, register tables and database. + // func:lib_curl.FDb._db.InitReflection + static void InitReflection(); + // find trace by row id (used to implement reflection) + // func:lib_curl.FDb.trace.RowidFind + static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); + // Function return 1 + // func:lib_curl.FDb.trace.N + inline static i32 trace_N() __attribute__((__warn_unused_result__, nothrow, pure)); + // func:lib_curl...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- lib_curl.trace..Print +// print string representation of ROW to string STR +// cfmt:lib_curl.trace.String printfmt:Tuple +void lib_curl::trace_Print(lib_curl::trace& row, algo::cstring& str) { + algo::tempstr temp; + str << "lib_curl.trace"; + (void)row;//only to avoid -Wunused-parameter +} + +// --- lib_curl.FDb._db.InitReflection +// Load statically available data into tables, register tables and database. +static void lib_curl::InitReflection() { + algo_lib::imdb_InsertMaybe(algo::Imdb("lib_curl", NULL, NULL, NULL, NULL, algo::Comment())); + + algo::Imtable t_trace; + t_trace.imtable = "lib_curl.trace"; + t_trace.ssimfile = ""; + t_trace.size = sizeof(lib_curl::trace); + t_trace.comment.value = ""; + t_trace.c_RowidFind = trace_RowidFind; + t_trace.NItems = trace_N; + t_trace.Print = (algo::ImrowPrintFcn)lib_curl::trace_Print; + algo_lib::imtable_InsertMaybe(t_trace); + + + // -- load signatures of existing dispatches -- +} + +// --- lib_curl.FDb._db.InsertStrptrMaybe +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +bool lib_curl::InsertStrptrMaybe(algo::strptr str) { + bool retval = true; + (void)str;//only to avoid -Wunused-parameter + return retval; +} + +// --- lib_curl.FDb._db.LoadTuplesMaybe +// Load all finputs from given directory. +bool lib_curl::LoadTuplesMaybe(algo::strptr root, bool recursive) { + bool retval = true; + if (FileQ(root)) { + retval = lib_curl::LoadTuplesFile(root, recursive); + } else if (root == "-") { + retval = lib_curl::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); + } else if (DirectoryQ(root)) { + retval = retval && lib_curl::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); + } else { + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); + retval = false; + } + return retval; +} + +// --- lib_curl.FDb._db.LoadTuplesFile +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +bool lib_curl::LoadTuplesFile(algo::strptr fname, bool recursive) { + bool retval = true; + algo_lib::FFildes fildes; + // missing files are not an error + fildes.fd = OpenRead(fname,algo::FileFlags()); + if (ValidQ(fildes.fd)) { + retval = LoadTuplesFd(fildes.fd, fname, recursive); + } + return retval; +} + +// --- lib_curl.FDb._db.LoadTuplesFd +// Load all finputs from given file descriptor. +bool lib_curl::LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) { + bool retval = true; + ind_beg(algo::FileLine_curs,line,fd) { + if (recursive) { + retval = retval && algo_lib::InsertStrptrMaybe(line); + } + if (!retval) { + algo_lib::_db.errtext << eol + << fname << ":" + << (ind_curs(line).i+1) + << ": " << line << eol; + break; + } + }ind_end; + return retval; +} + +// --- lib_curl.FDb._db.LoadSsimfileMaybe +// Load specified ssimfile. +bool lib_curl::LoadSsimfileMaybe(algo::strptr fname, bool recursive) { + bool retval = true; + if (FileQ(fname)) { + retval = lib_curl::LoadTuplesFile(fname, recursive); + } + return retval; +} + +// --- lib_curl.FDb._db.Steps +// Calls Step function of dependencies +void lib_curl::Steps() { + algo_lib::Step(); // dependent namespace specified via (dev.targdep) +} + +// --- lib_curl.FDb._db.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool lib_curl::_db_XrefMaybe() { + bool retval = true; + return retval; +} + +// --- lib_curl.FDb.request.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +lib_curl::FRequest& lib_curl::request_Alloc() { + lib_curl::FRequest* row = request_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("lib_curl.out_of_mem field:lib_curl.FDb.request comment:'Alloc failed'"); + } + return *row; +} + +// --- lib_curl.FDb.request.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +lib_curl::FRequest* lib_curl::request_AllocMaybe() { + lib_curl::FRequest *row = (lib_curl::FRequest*)request_AllocMem(); + if (row) { + new (row) lib_curl::FRequest; // call constructor + } + return row; +} + +// --- lib_curl.FDb.request.Delete +// Remove row from all global and cross indices, then deallocate row +void lib_curl::request_Delete(lib_curl::FRequest &row) { + row.~FRequest(); + request_FreeMem(row); +} + +// --- lib_curl.FDb.request.AllocMem +// Allocate space for one element +// If no memory available, return NULL. +void* lib_curl::request_AllocMem() { + lib_curl::FRequest *row = _db.request_free; + if (UNLIKELY(!row)) { + request_Reserve(1); + row = _db.request_free; + } + if (row) { + _db.request_free = row->request_next; + } + return row; +} + +// --- lib_curl.FDb.request.FreeMem +// Remove mem from all global and cross indices, then deallocate mem +void lib_curl::request_FreeMem(lib_curl::FRequest &row) { + if (UNLIKELY(row.request_next != (lib_curl::FRequest*)-1)) { + FatalErrorExit("lib_curl.tpool_double_delete pool:lib_curl.FDb.request comment:'double deletion caught'"); + } + row.request_next = _db.request_free; // insert into free list + _db.request_free = &row; +} + +// --- lib_curl.FDb.request.Reserve +// Preallocate memory for N more elements +// Return number of elements actually reserved. +u64 lib_curl::request_Reserve(u64 n_elems) { + u64 ret = 0; + while (ret < n_elems) { + u64 size = _db.request_blocksize; // underlying allocator is probably Lpool + u64 reserved = request_ReserveMem(size); + ret += reserved; + if (reserved == 0) { + break; + } + } + return ret; +} + +// --- lib_curl.FDb.request.ReserveMem +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +u64 lib_curl::request_ReserveMem(u64 size) { + u64 ret = 0; + if (size >= sizeof(lib_curl::FRequest)) { + lib_curl::FRequest *mem = (lib_curl::FRequest*)algo_lib::malloc_AllocMem(size); + ret = mem ? size / sizeof(lib_curl::FRequest) : 0; + // add newly allocated elements to the free list; + for (u64 i=0; i < ret; i++) { + mem[i].request_next = _db.request_free; + _db.request_free = mem+i; + } + } + return ret; +} + +// --- lib_curl.FDb.request.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool lib_curl::request_XrefMaybe(lib_curl::FRequest &row) { + bool retval = true; + (void)row; + return retval; +} + +// --- lib_curl.FDb.response.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +lib_curl::FResponse& lib_curl::response_Alloc() { + lib_curl::FResponse* row = response_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("lib_curl.out_of_mem field:lib_curl.FDb.response comment:'Alloc failed'"); + } + return *row; +} + +// --- lib_curl.FDb.response.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +lib_curl::FResponse* lib_curl::response_AllocMaybe() { + lib_curl::FResponse *row = (lib_curl::FResponse*)response_AllocMem(); + if (row) { + new (row) lib_curl::FResponse; // call constructor + } + return row; +} + +// --- lib_curl.FDb.response.Delete +// Remove row from all global and cross indices, then deallocate row +void lib_curl::response_Delete(lib_curl::FResponse &row) { + row.~FResponse(); + response_FreeMem(row); +} + +// --- lib_curl.FDb.response.AllocMem +// Allocate space for one element +// If no memory available, return NULL. +void* lib_curl::response_AllocMem() { + lib_curl::FResponse *row = _db.response_free; + if (UNLIKELY(!row)) { + response_Reserve(1); + row = _db.response_free; + } + if (row) { + _db.response_free = row->response_next; + } + return row; +} + +// --- lib_curl.FDb.response.FreeMem +// Remove mem from all global and cross indices, then deallocate mem +void lib_curl::response_FreeMem(lib_curl::FResponse &row) { + if (UNLIKELY(row.response_next != (lib_curl::FResponse*)-1)) { + FatalErrorExit("lib_curl.tpool_double_delete pool:lib_curl.FDb.response comment:'double deletion caught'"); + } + row.response_next = _db.response_free; // insert into free list + _db.response_free = &row; +} + +// --- lib_curl.FDb.response.Reserve +// Preallocate memory for N more elements +// Return number of elements actually reserved. +u64 lib_curl::response_Reserve(u64 n_elems) { + u64 ret = 0; + while (ret < n_elems) { + u64 size = _db.response_blocksize; // underlying allocator is probably Lpool + u64 reserved = response_ReserveMem(size); + ret += reserved; + if (reserved == 0) { + break; + } + } + return ret; +} + +// --- lib_curl.FDb.response.ReserveMem +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +u64 lib_curl::response_ReserveMem(u64 size) { + u64 ret = 0; + if (size >= sizeof(lib_curl::FResponse)) { + lib_curl::FResponse *mem = (lib_curl::FResponse*)algo_lib::malloc_AllocMem(size); + ret = mem ? size / sizeof(lib_curl::FResponse) : 0; + // add newly allocated elements to the free list; + for (u64 i=0; i < ret; i++) { + mem[i].response_next = _db.response_free; + _db.response_free = mem+i; + } + } + return ret; +} + +// --- lib_curl.FDb.response.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool lib_curl::response_XrefMaybe(lib_curl::FResponse &row) { + bool retval = true; + (void)row; + return retval; +} + +// --- lib_curl.FDb.trace.RowidFind +// find trace by row id (used to implement reflection) +static algo::ImrowPtr lib_curl::trace_RowidFind(int t) { + return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +} + +// --- lib_curl.FDb.trace.N +// Function return 1 +inline static i32 lib_curl::trace_N() { + return 1; +} + +// --- lib_curl.FDb..Init +// Set all fields to initial values. +void lib_curl::FDb_Init() { + // request: initialize Tpool + _db.request_free = NULL; + _db.request_blocksize = algo::BumpToPow2(64 * sizeof(lib_curl::FRequest)); // allocate 64-127 elements at a time + // response: initialize Tpool + _db.response_free = NULL; + _db.response_blocksize = algo::BumpToPow2(64 * sizeof(lib_curl::FResponse)); // allocate 64-127 elements at a time + + lib_curl::InitReflection(); +} + +// --- lib_curl.FRequest.headers.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +algo::cstring& lib_curl::headers_Alloc(lib_curl::FRequest& request) { + algo::cstring* row = headers_AllocMaybe(request); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("lib_curl.out_of_mem field:lib_curl.FRequest.headers comment:'Alloc failed'"); + } + return *row; +} + +// --- lib_curl.FRequest.headers.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +algo::cstring* lib_curl::headers_AllocMaybe(lib_curl::FRequest& request) { + algo::cstring *row = (algo::cstring*)headers_AllocMem(request); + if (row) { + new (row) algo::cstring; // call constructor + } + return row; +} + +// --- lib_curl.FRequest.headers.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* lib_curl::headers_AllocMem(lib_curl::FRequest& request) { + u64 new_nelems = request.headers_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + headers_qFind(request, u64(n)).~cstring(); // destroy last element + request.headers_n = i32(n); + } +} + +// --- lib_curl.FRequest.headers.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void lib_curl::headers_RemoveLast(lib_curl::FRequest& request) { + u64 n = request.headers_n; + if (n > 0) { + n -= 1; + headers_qFind(request, u64(n)).~cstring(); + request.headers_n = i32(n); + } +} + +// --- lib_curl.FRequest..Init +// Set all fields to initial values. +void lib_curl::FRequest_Init(lib_curl::FRequest& request) { + request.method = algo::strptr("GET"); + request.curlrc_only = bool(false); + // initialize LAry headers (lib_curl.FRequest.headers) + request.headers_n = 0; + memset(request.headers_lary, 0, sizeof(request.headers_lary)); // zero out all level pointers + algo::cstring* headers_first = (algo::cstring*)algo_lib::malloc_AllocMem(sizeof(algo::cstring) * (u64(1)<<4)); + if (!headers_first) { + FatalErrorExit("out of memory"); + } + for (int i = 0; i < 4; i++) { + request.headers_lary[i] = headers_first; + headers_first += 1ULL<0; ) { + n--; + headers_qFind(response, u64(n)).~cstring(); // destroy last element + response.headers_n = i32(n); + } +} + +// --- lib_curl.FResponse.headers.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void lib_curl::headers_RemoveLast(lib_curl::FResponse& response) { + u64 n = response.headers_n; + if (n > 0) { + n -= 1; + headers_qFind(response, u64(n)).~cstring(); + response.headers_n = i32(n); + } +} + +// --- lib_curl.FResponse..Init +// Set all fields to initial values. +void lib_curl::FResponse_Init(lib_curl::FResponse& response) { + response.code = u16(0); + // initialize LAry headers (lib_curl.FResponse.headers) + response.headers_n = 0; + memset(response.headers_lary, 0, sizeof(response.headers_lary)); // zero out all level pointers + algo::cstring* headers_first = (algo::cstring*)algo_lib::malloc_AllocMem(sizeof(algo::cstring) * (u64(1)<<4)); + if (!headers_first) { + FatalErrorExit("out of memory"); + } + for (int i = 0; i < 4; i++) { + response.headers_lary[i] = headers_first; + headers_first += 1ULL<value) == sizeof(lib_curl::FieldId)); +} diff --git a/cpp/gen/lib_exec_gen.cpp b/cpp/gen/lib_exec_gen.cpp index 21e9aaea..a0e2e98b 100644 --- a/cpp/gen/lib_exec_gen.cpp +++ b/cpp/gen/lib_exec_gen.cpp @@ -31,6 +31,8 @@ #include "include/gen/algo_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" //#pragma endinclude lib_exec::_db_bh_syscmd_curs::~_db_bh_syscmd_curs() { algo_lib::malloc_FreeMem(temp_elems, sizeof(void*) * temp_max); @@ -71,25 +73,23 @@ bool lib_exec::Cmdline_ReadFieldMaybe(lib_exec::Cmdline& parent, algo::strptr fi switch(field_id) { case lib_exec_FieldId_dry_run: { retval = bool_ReadStrptrMaybe(parent.dry_run, strval); - break; - } + } break; case lib_exec_FieldId_q: { retval = bool_ReadStrptrMaybe(parent.q, strval); - break; - } + } break; case lib_exec_FieldId_maxjobs: { retval = i32_ReadStrptrMaybe(parent.maxjobs, strval); - break; - } + } break; case lib_exec_FieldId_complooo: { retval = bool_ReadStrptrMaybe(parent.complooo, strval); - break; - } + } break; case lib_exec_FieldId_merge_output: { retval = bool_ReadStrptrMaybe(parent.merge_output, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -173,25 +173,25 @@ void lib_exec::Cmdline_PrintArgv(lib_exec::Cmdline& row, algo::cstring& str) { i32 lib_exec::Cmdline_NArgs(lib_exec::FieldId field, algo::strptr& out_dflt, bool* out_anon) { i32 retval = 1; switch (field) { - case lib_exec_FieldId_dry_run: { // $comment + case lib_exec_FieldId_dry_run: { // bool: no argument required but value may be specified as dry_run:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case lib_exec_FieldId_q: { // bool: no argument required but value may be specified as dry_run:Y + case lib_exec_FieldId_q: { // bool: no argument required but value may be specified as q:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case lib_exec_FieldId_maxjobs: { // bool: no argument required but value may be specified as q:Y + case lib_exec_FieldId_maxjobs: { // *out_anon = false; } break; - case lib_exec_FieldId_complooo: { // bool: no argument required but value may be specified as q:Y + case lib_exec_FieldId_complooo: { // bool: no argument required but value may be specified as complooo:Y *out_anon = false; retval=0; out_dflt="Y"; } break; - case lib_exec_FieldId_merge_output: { // bool: no argument required but value may be specified as complooo:Y + case lib_exec_FieldId_merge_output: { // bool: no argument required but value may be specified as merge_output:Y *out_anon = false; retval=0; out_dflt="Y"; @@ -250,8 +250,8 @@ bool lib_exec::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && lib_exec::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -540,14 +540,9 @@ bool lib_exec::syscmd_XrefMaybe(lib_exec::FSyscmd &row) { // Find row by key. Return NULL if not found. lib_exec::FSyscmd* lib_exec::ind_running_Find(i32 key) { u32 index = ::i32_Hash(0, key) & (_db.ind_running_buckets_n - 1); - lib_exec::FSyscmd* *e = &_db.ind_running_buckets_elems[index]; - lib_exec::FSyscmd* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).pid == key; - if (done) break; - e = &ret->ind_running_next; - } while (true); + lib_exec::FSyscmd *ret = _db.ind_running_buckets_elems[index]; + for (; ret && !((*ret).pid == key); ret = ret->ind_running_next) { + } return ret; } @@ -571,10 +566,11 @@ lib_exec::FSyscmd& lib_exec::ind_running_GetOrCreate(i32 key) { // --- lib_exec.FDb.ind_running.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_exec::ind_running_InsertMaybe(lib_exec::FSyscmd& row) { - ind_running_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_running_next == (lib_exec::FSyscmd*)-1)) {// check if in hash already - u32 index = ::i32_Hash(0, row.pid) & (_db.ind_running_buckets_n - 1); + row.ind_running_hashval = ::i32_Hash(0, row.pid); + ind_running_Reserve(1); + u32 index = row.ind_running_hashval & (_db.ind_running_buckets_n - 1); lib_exec::FSyscmd* *prev = &_db.ind_running_buckets_elems[index]; do { lib_exec::FSyscmd* ret = *prev; @@ -600,7 +596,7 @@ bool lib_exec::ind_running_InsertMaybe(lib_exec::FSyscmd& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_exec::ind_running_Remove(lib_exec::FSyscmd& row) { if (LIKELY(row.ind_running_next != (lib_exec::FSyscmd*)-1)) {// check if in hash already - u32 index = ::i32_Hash(0, row.pid) & (_db.ind_running_buckets_n - 1); + u32 index = row.ind_running_hashval & (_db.ind_running_buckets_n - 1); lib_exec::FSyscmd* *prev = &_db.ind_running_buckets_elems[index]; // addr of pointer to current element while (lib_exec::FSyscmd *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -617,8 +613,14 @@ void lib_exec::ind_running_Remove(lib_exec::FSyscmd& row) { // --- lib_exec.FDb.ind_running.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_exec::ind_running_Reserve(int n) { + ind_running_AbsReserve(_db.ind_running_n + n); +} + +// --- lib_exec.FDb.ind_running.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_exec::ind_running_AbsReserve(int n) { u32 old_nbuckets = _db.ind_running_buckets_n; - u32 new_nelems = _db.ind_running_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -637,7 +639,7 @@ void lib_exec::ind_running_Reserve(int n) { while (elem) { lib_exec::FSyscmd &row = *elem; lib_exec::FSyscmd* next = row.ind_running_next; - u32 index = ::i32_Hash(0, row.pid) & (new_nbuckets-1); + u32 index = row.ind_running_hashval & (new_nbuckets-1); row.ind_running_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1088,15 +1090,11 @@ void lib_exec::syscmd_CopyIn(lib_exec::FSyscmd &row, dev::Syscmd &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void lib_exec::c_prior_Insert(lib_exec::FSyscmd& syscmd, lib_exec::FSyscmddep& row) { - if (bool_Update(row.syscmd_c_prior_in_ary,true)) { - // reserve space + if (!row.syscmd_c_prior_in_ary) { c_prior_Reserve(syscmd, 1); - u32 n = syscmd.c_prior_n; - u32 at = n; - lib_exec::FSyscmddep* *elems = syscmd.c_prior_elems; - elems[at] = &row; - syscmd.c_prior_n = n+1; - + u32 n = syscmd.c_prior_n++; + syscmd.c_prior_elems[n] = &row; + row.syscmd_c_prior_in_ary = true; } } @@ -1105,7 +1103,7 @@ void lib_exec::c_prior_Insert(lib_exec::FSyscmd& syscmd, lib_exec::FSyscmddep& r // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool lib_exec::c_prior_InsertMaybe(lib_exec::FSyscmd& syscmd, lib_exec::FSyscmddep& row) { - bool retval = !row.syscmd_c_prior_in_ary; + bool retval = !syscmd_c_prior_InAryQ(row); c_prior_Insert(syscmd,row); // check is performed in _Insert again return retval; } @@ -1113,18 +1111,18 @@ bool lib_exec::c_prior_InsertMaybe(lib_exec::FSyscmd& syscmd, lib_exec::FSyscmdd // --- lib_exec.FSyscmd.c_prior.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void lib_exec::c_prior_Remove(lib_exec::FSyscmd& syscmd, lib_exec::FSyscmddep& row) { + int n = syscmd.c_prior_n; if (bool_Update(row.syscmd_c_prior_in_ary,false)) { - int lim = syscmd.c_prior_n; lib_exec::FSyscmddep* *elems = syscmd.c_prior_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { lib_exec::FSyscmddep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(lib_exec::FSyscmddep*) * (lim - j); + size_t nbytes = sizeof(lib_exec::FSyscmddep*) * (n - j); memmove(elems + i, elems + j, nbytes); - syscmd.c_prior_n = lim - 1; + syscmd.c_prior_n = n - 1; break; } } @@ -1152,15 +1150,11 @@ void lib_exec::c_prior_Reserve(lib_exec::FSyscmd& syscmd, u32 n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void lib_exec::c_next_Insert(lib_exec::FSyscmd& syscmd, lib_exec::FSyscmddep& row) { - if (bool_Update(row.syscmd_c_next_in_ary,true)) { - // reserve space + if (!row.syscmd_c_next_in_ary) { c_next_Reserve(syscmd, 1); - u32 n = syscmd.c_next_n; - u32 at = n; - lib_exec::FSyscmddep* *elems = syscmd.c_next_elems; - elems[at] = &row; - syscmd.c_next_n = n+1; - + u32 n = syscmd.c_next_n++; + syscmd.c_next_elems[n] = &row; + row.syscmd_c_next_in_ary = true; } } @@ -1169,7 +1163,7 @@ void lib_exec::c_next_Insert(lib_exec::FSyscmd& syscmd, lib_exec::FSyscmddep& ro // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool lib_exec::c_next_InsertMaybe(lib_exec::FSyscmd& syscmd, lib_exec::FSyscmddep& row) { - bool retval = !row.syscmd_c_next_in_ary; + bool retval = !syscmd_c_next_InAryQ(row); c_next_Insert(syscmd,row); // check is performed in _Insert again return retval; } @@ -1177,18 +1171,18 @@ bool lib_exec::c_next_InsertMaybe(lib_exec::FSyscmd& syscmd, lib_exec::FSyscmdde // --- lib_exec.FSyscmd.c_next.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void lib_exec::c_next_Remove(lib_exec::FSyscmd& syscmd, lib_exec::FSyscmddep& row) { + int n = syscmd.c_next_n; if (bool_Update(row.syscmd_c_next_in_ary,false)) { - int lim = syscmd.c_next_n; lib_exec::FSyscmddep* *elems = syscmd.c_next_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { lib_exec::FSyscmddep* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(lib_exec::FSyscmddep*) * (lim - j); + size_t nbytes = sizeof(lib_exec::FSyscmddep*) * (n - j); memmove(elems + i, elems + j, nbytes); - syscmd.c_next_n = lim - 1; + syscmd.c_next_n = n - 1; break; } } @@ -1233,6 +1227,7 @@ void lib_exec::FSyscmd_Init(lib_exec::FSyscmd& syscmd) { syscmd.show_out = bool(true); syscmd.signal = i32(0); syscmd.ind_running_next = (lib_exec::FSyscmd*)-1; // (lib_exec.FDb.ind_running) not-in-hash + syscmd.ind_running_hashval = 0; // stored hash value syscmd.bh_syscmd_idx = -1; // (lib_exec.FDb.bh_syscmd) not-in-heap syscmd.zd_started_next = (lib_exec::FSyscmd*)-1; // (lib_exec.FDb.zd_started) not-in-list syscmd.zd_started_prev = NULL; // (lib_exec.FDb.zd_started) diff --git a/cpp/gen/lib_fm_gen.cpp b/cpp/gen/lib_fm_gen.cpp index af2eef81..d75b6c60 100644 --- a/cpp/gen/lib_fm_gen.cpp +++ b/cpp/gen/lib_fm_gen.cpp @@ -31,10 +31,10 @@ #include "include/gen/algo_gen.inl.h" #include "include/gen/fm_gen.h" #include "include/gen/fm_gen.inl.h" -#include "include/gen/algo_lib_gen.h" -#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_json_gen.h" #include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" //#pragma endinclude @@ -134,6 +134,7 @@ algo::Smallstr50 lib_fm::objprefix_Get(lib_fm::FAlarm& alarm) { void lib_fm::FAlarm_Init(lib_fm::FAlarm& alarm) { alarm.n_occurred = i32(0); alarm.ind_alarm_next = (lib_fm::FAlarm*)-1; // (lib_fm.FDb.ind_alarm) not-in-hash + alarm.ind_alarm_hashval = 0; // stored hash value } // --- lib_fm.FAlarm..Uninit @@ -257,8 +258,8 @@ bool lib_fm::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && lib_fm::LoadTuplesFile(algo::SsimFname(root,"fmdb.alm_code"),recursive); retval = retval && lib_fm::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -455,14 +456,9 @@ bool lib_fm::alarm_XrefMaybe(lib_fm::FAlarm &row) { // Find row by key. Return NULL if not found. lib_fm::FAlarm* lib_fm::ind_alarm_Find(const algo::strptr& key) { u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_alarm_buckets_n - 1); - lib_fm::FAlarm* *e = &_db.ind_alarm_buckets_elems[index]; - lib_fm::FAlarm* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).alarm == key; - if (done) break; - e = &ret->ind_alarm_next; - } while (true); + lib_fm::FAlarm *ret = _db.ind_alarm_buckets_elems[index]; + for (; ret && !((*ret).alarm == key); ret = ret->ind_alarm_next) { + } return ret; } @@ -494,10 +490,11 @@ lib_fm::FAlarm& lib_fm::ind_alarm_GetOrCreate(const algo::strptr& key) { // --- lib_fm.FDb.ind_alarm.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_fm::ind_alarm_InsertMaybe(lib_fm::FAlarm& row) { - ind_alarm_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_alarm_next == (lib_fm::FAlarm*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.alarm) & (_db.ind_alarm_buckets_n - 1); + row.ind_alarm_hashval = algo::Smallstr200_Hash(0, row.alarm); + ind_alarm_Reserve(1); + u32 index = row.ind_alarm_hashval & (_db.ind_alarm_buckets_n - 1); lib_fm::FAlarm* *prev = &_db.ind_alarm_buckets_elems[index]; do { lib_fm::FAlarm* ret = *prev; @@ -523,7 +520,7 @@ bool lib_fm::ind_alarm_InsertMaybe(lib_fm::FAlarm& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_fm::ind_alarm_Remove(lib_fm::FAlarm& row) { if (LIKELY(row.ind_alarm_next != (lib_fm::FAlarm*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.alarm) & (_db.ind_alarm_buckets_n - 1); + u32 index = row.ind_alarm_hashval & (_db.ind_alarm_buckets_n - 1); lib_fm::FAlarm* *prev = &_db.ind_alarm_buckets_elems[index]; // addr of pointer to current element while (lib_fm::FAlarm *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -540,8 +537,14 @@ void lib_fm::ind_alarm_Remove(lib_fm::FAlarm& row) { // --- lib_fm.FDb.ind_alarm.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_fm::ind_alarm_Reserve(int n) { + ind_alarm_AbsReserve(_db.ind_alarm_n + n); +} + +// --- lib_fm.FDb.ind_alarm.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_fm::ind_alarm_AbsReserve(int n) { u32 old_nbuckets = _db.ind_alarm_buckets_n; - u32 new_nelems = _db.ind_alarm_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -560,7 +563,7 @@ void lib_fm::ind_alarm_Reserve(int n) { while (elem) { lib_fm::FAlarm &row = *elem; lib_fm::FAlarm* next = row.ind_alarm_next; - u32 index = algo::Smallstr200_Hash(0, row.alarm) & (new_nbuckets-1); + u32 index = row.ind_alarm_hashval & (new_nbuckets-1); row.ind_alarm_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -684,14 +687,9 @@ bool lib_fm::alm_code_XrefMaybe(lib_fm::FAlmCode &row) { // Find row by key. Return NULL if not found. lib_fm::FAlmCode* lib_fm::ind_alm_code_Find(const algo::strptr& key) { u32 index = fm::Code_Hash(0, key) & (_db.ind_alm_code_buckets_n - 1); - lib_fm::FAlmCode* *e = &_db.ind_alm_code_buckets_elems[index]; - lib_fm::FAlmCode* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).alm_code == key; - if (done) break; - e = &ret->ind_alm_code_next; - } while (true); + lib_fm::FAlmCode *ret = _db.ind_alm_code_buckets_elems[index]; + for (; ret && !((*ret).alm_code == key); ret = ret->ind_alm_code_next) { + } return ret; } @@ -723,10 +721,11 @@ lib_fm::FAlmCode& lib_fm::ind_alm_code_GetOrCreate(const algo::strptr& key) { // --- lib_fm.FDb.ind_alm_code.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_fm::ind_alm_code_InsertMaybe(lib_fm::FAlmCode& row) { - ind_alm_code_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_alm_code_next == (lib_fm::FAlmCode*)-1)) {// check if in hash already - u32 index = fm::Code_Hash(0, row.alm_code) & (_db.ind_alm_code_buckets_n - 1); + row.ind_alm_code_hashval = fm::Code_Hash(0, row.alm_code); + ind_alm_code_Reserve(1); + u32 index = row.ind_alm_code_hashval & (_db.ind_alm_code_buckets_n - 1); lib_fm::FAlmCode* *prev = &_db.ind_alm_code_buckets_elems[index]; do { lib_fm::FAlmCode* ret = *prev; @@ -752,7 +751,7 @@ bool lib_fm::ind_alm_code_InsertMaybe(lib_fm::FAlmCode& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_fm::ind_alm_code_Remove(lib_fm::FAlmCode& row) { if (LIKELY(row.ind_alm_code_next != (lib_fm::FAlmCode*)-1)) {// check if in hash already - u32 index = fm::Code_Hash(0, row.alm_code) & (_db.ind_alm_code_buckets_n - 1); + u32 index = row.ind_alm_code_hashval & (_db.ind_alm_code_buckets_n - 1); lib_fm::FAlmCode* *prev = &_db.ind_alm_code_buckets_elems[index]; // addr of pointer to current element while (lib_fm::FAlmCode *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -769,8 +768,14 @@ void lib_fm::ind_alm_code_Remove(lib_fm::FAlmCode& row) { // --- lib_fm.FDb.ind_alm_code.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_fm::ind_alm_code_Reserve(int n) { + ind_alm_code_AbsReserve(_db.ind_alm_code_n + n); +} + +// --- lib_fm.FDb.ind_alm_code.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_fm::ind_alm_code_AbsReserve(int n) { u32 old_nbuckets = _db.ind_alm_code_buckets_n; - u32 new_nelems = _db.ind_alm_code_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -789,7 +794,7 @@ void lib_fm::ind_alm_code_Reserve(int n) { while (elem) { lib_fm::FAlmCode &row = *elem; lib_fm::FAlmCode* next = row.ind_alm_code_next; - u32 index = fm::Code_Hash(0, row.alm_code) & (new_nbuckets-1); + u32 index = row.ind_alm_code_hashval & (new_nbuckets-1); row.ind_alm_code_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -913,14 +918,9 @@ bool lib_fm::alm_objtype_XrefMaybe(lib_fm::FAlmObjtype &row) { // Find row by key. Return NULL if not found. lib_fm::FAlmObjtype* lib_fm::ind_alm_objtype_Find(const algo::strptr& key) { u32 index = fm::Objtype_Hash(0, key) & (_db.ind_alm_objtype_buckets_n - 1); - lib_fm::FAlmObjtype* *e = &_db.ind_alm_objtype_buckets_elems[index]; - lib_fm::FAlmObjtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).alm_objtype == key; - if (done) break; - e = &ret->ind_alm_objtype_next; - } while (true); + lib_fm::FAlmObjtype *ret = _db.ind_alm_objtype_buckets_elems[index]; + for (; ret && !((*ret).alm_objtype == key); ret = ret->ind_alm_objtype_next) { + } return ret; } @@ -952,10 +952,11 @@ lib_fm::FAlmObjtype& lib_fm::ind_alm_objtype_GetOrCreate(const algo::strptr& key // --- lib_fm.FDb.ind_alm_objtype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_fm::ind_alm_objtype_InsertMaybe(lib_fm::FAlmObjtype& row) { - ind_alm_objtype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_alm_objtype_next == (lib_fm::FAlmObjtype*)-1)) {// check if in hash already - u32 index = fm::Objtype_Hash(0, row.alm_objtype) & (_db.ind_alm_objtype_buckets_n - 1); + row.ind_alm_objtype_hashval = fm::Objtype_Hash(0, row.alm_objtype); + ind_alm_objtype_Reserve(1); + u32 index = row.ind_alm_objtype_hashval & (_db.ind_alm_objtype_buckets_n - 1); lib_fm::FAlmObjtype* *prev = &_db.ind_alm_objtype_buckets_elems[index]; do { lib_fm::FAlmObjtype* ret = *prev; @@ -981,7 +982,7 @@ bool lib_fm::ind_alm_objtype_InsertMaybe(lib_fm::FAlmObjtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_fm::ind_alm_objtype_Remove(lib_fm::FAlmObjtype& row) { if (LIKELY(row.ind_alm_objtype_next != (lib_fm::FAlmObjtype*)-1)) {// check if in hash already - u32 index = fm::Objtype_Hash(0, row.alm_objtype) & (_db.ind_alm_objtype_buckets_n - 1); + u32 index = row.ind_alm_objtype_hashval & (_db.ind_alm_objtype_buckets_n - 1); lib_fm::FAlmObjtype* *prev = &_db.ind_alm_objtype_buckets_elems[index]; // addr of pointer to current element while (lib_fm::FAlmObjtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -998,8 +999,14 @@ void lib_fm::ind_alm_objtype_Remove(lib_fm::FAlmObjtype& row) { // --- lib_fm.FDb.ind_alm_objtype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_fm::ind_alm_objtype_Reserve(int n) { + ind_alm_objtype_AbsReserve(_db.ind_alm_objtype_n + n); +} + +// --- lib_fm.FDb.ind_alm_objtype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_fm::ind_alm_objtype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_alm_objtype_buckets_n; - u32 new_nelems = _db.ind_alm_objtype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1018,7 +1025,7 @@ void lib_fm::ind_alm_objtype_Reserve(int n) { while (elem) { lib_fm::FAlmObjtype &row = *elem; lib_fm::FAlmObjtype* next = row.ind_alm_objtype_next; - u32 index = fm::Objtype_Hash(0, row.alm_objtype) & (new_nbuckets-1); + u32 index = row.ind_alm_objtype_hashval & (new_nbuckets-1); row.ind_alm_objtype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; diff --git a/cpp/gen/lib_git_gen.cpp b/cpp/gen/lib_git_gen.cpp index 19ff31f3..d097dc6c 100644 --- a/cpp/gen/lib_git_gen.cpp +++ b/cpp/gen/lib_git_gen.cpp @@ -25,6 +25,8 @@ #include "include/algo.h" // hard-coded include #include "include/gen/lib_git_gen.h" #include "include/gen/lib_git_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude @@ -90,8 +92,8 @@ bool lib_git::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && lib_git::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; diff --git a/cpp/gen/lib_http_gen.cpp b/cpp/gen/lib_http_gen.cpp new file mode 100644 index 00000000..4c266c9e --- /dev/null +++ b/cpp/gen/lib_http_gen.cpp @@ -0,0 +1,432 @@ +// +// cpp/gen/lib_http_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/lib_http_gen.h" +#include "include/gen/lib_http_gen.inl.h" +#include "include/gen/httpdb_gen.h" +#include "include/gen/httpdb_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/lib_prot_gen.h" +#include "include/gen/lib_prot_gen.inl.h" +//#pragma endinclude +namespace lib_http { // gen:ns_print_proto + // Load statically available data into tables, register tables and database. + // func:lib_http.FDb._db.InitReflection + static void InitReflection(); + // func:lib_http.FDb.status.LoadStatic + static void status_LoadStatic() __attribute__((nothrow)); + // find trace by row id (used to implement reflection) + // func:lib_http.FDb.trace.RowidFind + static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); + // Function return 1 + // func:lib_http.FDb.trace.N + inline static i32 trace_N() __attribute__((__warn_unused_result__, nothrow, pure)); + // func:lib_http...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- lib_http.FStatus.base.CopyOut +// Copy fields out of row +void lib_http::status_CopyOut(lib_http::FStatus &row, httpdb::Status &out) { + out.status = row.status; +} + +// --- lib_http.FStatus.base.CopyIn +// Copy fields in to row +void lib_http::status_CopyIn(lib_http::FStatus &row, httpdb::Status &in) { + row.status = in.status; +} + +// --- lib_http.FStatus.code.Get +u16 lib_http::code_Get(lib_http::FStatus& status) { + u16 ret; + ret = 0; // default value + (void)u16_ReadStrptrMaybe(ret, algo::Pathcomp(status.status, " LL")); + return ret; +} + +// --- lib_http.FStatus.reason.Get +algo::Smallstr50 lib_http::reason_Get(lib_http::FStatus& status) { + algo::Smallstr50 ret(algo::Pathcomp(status.status, " LR")); + return ret; +} + +// --- lib_http.trace..Print +// print string representation of ROW to string STR +// cfmt:lib_http.trace.String printfmt:Tuple +void lib_http::trace_Print(lib_http::trace& row, algo::cstring& str) { + algo::tempstr temp; + str << "lib_http.trace"; + (void)row;//only to avoid -Wunused-parameter +} + +// --- lib_http.FDb._db.InitReflection +// Load statically available data into tables, register tables and database. +static void lib_http::InitReflection() { + algo_lib::imdb_InsertMaybe(algo::Imdb("lib_http", NULL, NULL, NULL, NULL, algo::Comment())); + + algo::Imtable t_trace; + t_trace.imtable = "lib_http.trace"; + t_trace.ssimfile = ""; + t_trace.size = sizeof(lib_http::trace); + t_trace.comment.value = ""; + t_trace.c_RowidFind = trace_RowidFind; + t_trace.NItems = trace_N; + t_trace.Print = (algo::ImrowPrintFcn)lib_http::trace_Print; + algo_lib::imtable_InsertMaybe(t_trace); + + + // -- load signatures of existing dispatches -- +} + +// --- lib_http.FDb._db.InsertStrptrMaybe +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +bool lib_http::InsertStrptrMaybe(algo::strptr str) { + bool retval = true; + (void)str;//only to avoid -Wunused-parameter + return retval; +} + +// --- lib_http.FDb._db.LoadTuplesMaybe +// Load all finputs from given directory. +bool lib_http::LoadTuplesMaybe(algo::strptr root, bool recursive) { + bool retval = true; + if (FileQ(root)) { + retval = lib_http::LoadTuplesFile(root, recursive); + } else if (root == "-") { + retval = lib_http::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); + } else if (DirectoryQ(root)) { + retval = retval && lib_http::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); + } else { + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); + retval = false; + } + return retval; +} + +// --- lib_http.FDb._db.LoadTuplesFile +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +bool lib_http::LoadTuplesFile(algo::strptr fname, bool recursive) { + bool retval = true; + algo_lib::FFildes fildes; + // missing files are not an error + fildes.fd = OpenRead(fname,algo::FileFlags()); + if (ValidQ(fildes.fd)) { + retval = LoadTuplesFd(fildes.fd, fname, recursive); + } + return retval; +} + +// --- lib_http.FDb._db.LoadTuplesFd +// Load all finputs from given file descriptor. +bool lib_http::LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) { + bool retval = true; + ind_beg(algo::FileLine_curs,line,fd) { + if (recursive) { + retval = retval && algo_lib::InsertStrptrMaybe(line); + } + if (!retval) { + algo_lib::_db.errtext << eol + << fname << ":" + << (ind_curs(line).i+1) + << ": " << line << eol; + break; + } + }ind_end; + return retval; +} + +// --- lib_http.FDb._db.LoadSsimfileMaybe +// Load specified ssimfile. +bool lib_http::LoadSsimfileMaybe(algo::strptr fname, bool recursive) { + bool retval = true; + if (FileQ(fname)) { + retval = lib_http::LoadTuplesFile(fname, recursive); + } + return retval; +} + +// --- lib_http.FDb._db.Steps +// Calls Step function of dependencies +void lib_http::Steps() { + algo_lib::Step(); // dependent namespace specified via (dev.targdep) +} + +// --- lib_http.FDb._db.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool lib_http::_db_XrefMaybe() { + bool retval = true; + return retval; +} + +// --- lib_http.FDb.status.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +lib_http::FStatus& lib_http::status_Alloc() { + lib_http::FStatus* row = status_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("lib_http.out_of_mem field:lib_http.FDb.status comment:'Alloc failed'"); + } + return *row; +} + +// --- lib_http.FDb.status.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +lib_http::FStatus* lib_http::status_AllocMaybe() { + lib_http::FStatus *row = (lib_http::FStatus*)status_AllocMem(); + if (row) { + new (row) lib_http::FStatus; // call constructor + } + return row; +} + +// --- lib_http.FDb.status.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +lib_http::FStatus* lib_http::status_InsertMaybe(const httpdb::Status &value) { + lib_http::FStatus *row = &status_Alloc(); // if out of memory, process dies. if input error, return NULL. + status_CopyIn(*row,const_cast(value)); + bool ok = status_XrefMaybe(*row); // this may return false + if (!ok) { + status_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- lib_http.FDb.status.RemoveAll +// Destroy all elements of Inlary +void lib_http::status_RemoveAll() { + for (u64 n = _db.status_n; n>0; ) { + n--; + reinterpret_cast(_db.status_data)[n].~FStatus(); // destroy last element + _db.status_n=n; + } +} + +// --- lib_http.FDb.status.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void lib_http::status_RemoveLast() { + u64 n = _db.status_n; + if (n > 0) { + n -= 1; + reinterpret_cast(_db.status_data)[n].~FStatus(); + _db.status_n = n; + } +} + +// --- lib_http.FDb.status.LoadStatic +static void lib_http::status_LoadStatic() { + static struct _t { + const char *s; + } data[] = { + { "httpdb.status status:\"100 Continue\"" } + ,{ "httpdb.status status:\"101 Switching Protocols\"" } + ,{ "httpdb.status status:\"200 OK\"" } + ,{ "httpdb.status status:\"201 Created\"" } + ,{ "httpdb.status status:\"202 Accepted\"" } + ,{ "httpdb.status status:\"203 Non-Authoritative Information\"" } + ,{ "httpdb.status status:\"204 No Content\"" } + ,{ "httpdb.status status:\"205 Reset Content\"" } + ,{ "httpdb.status status:\"206 Partial Content\"" } + ,{ "httpdb.status status:\"300 Multiple Choices\"" } + ,{ "httpdb.status status:\"301 Moved Permanently\"" } + ,{ "httpdb.status status:\"302 Found\"" } + ,{ "httpdb.status status:\"303 See Other\"" } + ,{ "httpdb.status status:\"304 Not Modified\"" } + ,{ "httpdb.status status:\"305 Use Proxy\"" } + ,{ "httpdb.status status:\"307 Temporary Redirect\"" } + ,{ "httpdb.status status:\"400 Bad Request\"" } + ,{ "httpdb.status status:\"401 Unauthorized\"" } + ,{ "httpdb.status status:\"402 Payment Required\"" } + ,{ "httpdb.status status:\"403 Forbidden\"" } + ,{ "httpdb.status status:\"404 Not Found\"" } + ,{ "httpdb.status status:\"405 Method Not Allowed\"" } + ,{ "httpdb.status status:\"406 Not Acceptable\"" } + ,{ "httpdb.status status:\"407 Proxy Authentication Required\"" } + ,{ "httpdb.status status:\"408 Request Time-out\"" } + ,{ "httpdb.status status:\"409 Conflict\"" } + ,{ "httpdb.status status:\"410 Gone\"" } + ,{ "httpdb.status status:\"411 Length Required\"" } + ,{ "httpdb.status status:\"412 Precondition Failed\"" } + ,{ "httpdb.status status:\"413 Request Entity Too Large\"" } + ,{ "httpdb.status status:\"414 Request-URI Too Large\"" } + ,{ "httpdb.status status:\"415 Unsupported Media Type\"" } + ,{ "httpdb.status status:\"416 Requested range not satisfiable\"" } + ,{ "httpdb.status status:\"417 Expectation Failed\"" } + ,{ "httpdb.status status:\"500 Internal Server Error\"" } + ,{ "httpdb.status status:\"501 Not Implemented\"" } + ,{ "httpdb.status status:\"502 Bad Gateway\"" } + ,{ "httpdb.status status:\"503 Service Unavailable\"" } + ,{ "httpdb.status status:\"504 Gateway Time-out\"" } + ,{ "httpdb.status status:\"505 HTTP Version not supported\"" } + ,{NULL} + }; + (void)data; + httpdb::Status status; + for (int i=0; data[i].s; i++) { + (void)httpdb::Status_ReadStrptrMaybe(status, algo::strptr(data[i].s)); + lib_http::FStatus *elem = status_InsertMaybe(status); + vrfy(elem, tempstr("lib_http.static_insert_fatal_error") + << Keyval("tuple",algo::strptr(data[i].s)) + << Keyval("comment",algo_lib::DetachBadTags())); + } +} + +// --- lib_http.FDb.status.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool lib_http::status_XrefMaybe(lib_http::FStatus &row) { + bool retval = true; + (void)row; + return retval; +} + +// --- lib_http.FDb.trace.RowidFind +// find trace by row id (used to implement reflection) +static algo::ImrowPtr lib_http::trace_RowidFind(int t) { + return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +} + +// --- lib_http.FDb.trace.N +// Function return 1 +inline static i32 lib_http::trace_N() { + return 1; +} + +// --- lib_http.FDb..Init +// Set all fields to initial values. +void lib_http::FDb_Init() { + _db.status_n = 0; // status: initialize count + + lib_http::InitReflection(); + status_LoadStatic(); // gen:ns_gstatic gstatic:lib_http.FDb.status load lib_http.FStatus records +} + +// --- lib_http.FDb..Uninit +void lib_http::FDb_Uninit() { + lib_http::FDb &row = _db; (void)row; + + // lib_http.FDb.status.Uninit (Inlary) // + // skip destruction in global scope +} + +// --- lib_http.FieldId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* lib_http::value_ToCstr(const lib_http::FieldId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case lib_http_FieldId_value : ret = "value"; break; + } + return ret; +} + +// --- lib_http.FieldId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void lib_http::value_Print(const lib_http::FieldId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- lib_http.FieldId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool lib_http::value_SetStrptrMaybe(lib_http::FieldId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,lib_http_FieldId_value); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- lib_http.FieldId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void lib_http::value_SetStrptr(lib_http::FieldId& parent, algo::strptr rhs, lib_http_FieldIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- lib_http.FieldId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool lib_http::value_ReadStrptrMaybe(lib_http::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- lib_http.FieldId..ReadStrptrMaybe +// Read fields of lib_http::FieldId from an ascii string. +// The format of the string is the format of the lib_http::FieldId's only field +bool lib_http::FieldId_ReadStrptrMaybe(lib_http::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- lib_http.FieldId..Print +// print string representation of ROW to string STR +// cfmt:lib_http.FieldId.String printfmt:Raw +void lib_http::FieldId_Print(lib_http::FieldId& row, algo::cstring& str) { + lib_http::value_Print(row, str); +} + +// --- lib_http...SizeCheck +inline static void lib_http::SizeCheck() { +} + +// --- lib_http...StaticCheck +void lib_http::StaticCheck() { + algo_assert(_offset_of(lib_http::FieldId, value) + sizeof(((lib_http::FieldId*)0)->value) == sizeof(lib_http::FieldId)); +} diff --git a/cpp/gen/lib_iconv_gen.cpp b/cpp/gen/lib_iconv_gen.cpp index 63b204b4..f79c8295 100644 --- a/cpp/gen/lib_iconv_gen.cpp +++ b/cpp/gen/lib_iconv_gen.cpp @@ -25,8 +25,6 @@ #include "include/algo.h" // hard-coded include #include "include/gen/lib_iconv_gen.h" #include "include/gen/lib_iconv_gen.inl.h" -#include "include/gen/algo_lib_gen.h" -#include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude namespace lib_iconv { // gen:ns_print_proto // Load statically available data into tables, register tables and database. @@ -88,10 +86,9 @@ bool lib_iconv::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (root == "-") { retval = lib_iconv::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); } else if (DirectoryQ(root)) { - retval = retval && lib_iconv::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -121,7 +118,6 @@ bool lib_iconv::LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive bool retval = true; ind_beg(algo::FileLine_curs,line,fd) { if (recursive) { - retval = retval && algo_lib::InsertStrptrMaybe(line); } if (!retval) { algo_lib::_db.errtext << eol @@ -147,7 +143,6 @@ bool lib_iconv::LoadSsimfileMaybe(algo::strptr fname, bool recursive) { // --- lib_iconv.FDb._db.Steps // Calls Step function of dependencies void lib_iconv::Steps() { - algo_lib::Step(); // dependent namespace specified via (dev.targdep) } // --- lib_iconv.FDb._db.XrefMaybe diff --git a/cpp/gen/lib_json_gen.cpp b/cpp/gen/lib_json_gen.cpp index faf7380e..f363cc82 100644 --- a/cpp/gen/lib_json_gen.cpp +++ b/cpp/gen/lib_json_gen.cpp @@ -27,8 +27,6 @@ #include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_gen.h" #include "include/gen/algo_gen.inl.h" -#include "include/gen/algo_lib_gen.h" -#include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude namespace lib_json { // gen:ns_print_proto // Load statically available data into tables, register tables and database. @@ -217,10 +215,9 @@ bool lib_json::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (root == "-") { retval = lib_json::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); } else if (DirectoryQ(root)) { - retval = retval && lib_json::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -250,7 +247,6 @@ bool lib_json::LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) bool retval = true; ind_beg(algo::FileLine_curs,line,fd) { if (recursive) { - retval = retval && algo_lib::InsertStrptrMaybe(line); } if (!retval) { algo_lib::_db.errtext << eol @@ -276,7 +272,6 @@ bool lib_json::LoadSsimfileMaybe(algo::strptr fname, bool recursive) { // --- lib_json.FDb._db.Steps // Calls Step function of dependencies void lib_json::Steps() { - algo_lib::Step(); // dependent namespace specified via (dev.targdep) } // --- lib_json.FDb._db.XrefMaybe @@ -382,7 +377,7 @@ bool lib_json::node_XrefMaybe(lib_json::FNode &row) { bool retval = true; (void)row; // insert node into index ind_objfld - if ((NULL!=fldkey_Get(row).object)) { // user-defined insert condition + if (fldkey_Get(row).p_object) { // user-defined insert condition bool success = ind_objfld_InsertMaybe(row); if (UNLIKELY(!success)) { ch_RemoveAll(algo_lib::_db.errtext); @@ -406,24 +401,20 @@ bool lib_json::node_XrefMaybe(lib_json::FNode &row) { // Find row by key. Return NULL if not found. lib_json::FNode* lib_json::ind_objfld_Find(const lib_json::FldKey& key) { u32 index = lib_json::FldKey_Hash(0, key) & (_db.ind_objfld_buckets_n - 1); - lib_json::FNode* *e = &_db.ind_objfld_buckets_elems[index]; - lib_json::FNode* ret=NULL; - do { - ret = *e; - bool done = !ret || fldkey_Get((*ret)) == key; - if (done) break; - e = &ret->ind_objfld_next; - } while (true); + lib_json::FNode *ret = _db.ind_objfld_buckets_elems[index]; + for (; ret && !(fldkey_Get((*ret)) == key); ret = ret->ind_objfld_next) { + } return ret; } // --- lib_json.FDb.ind_objfld.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_json::ind_objfld_InsertMaybe(lib_json::FNode& row) { - ind_objfld_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_objfld_next == (lib_json::FNode*)-1)) {// check if in hash already - u32 index = lib_json::FldKey_Hash(0, fldkey_Get(row)) & (_db.ind_objfld_buckets_n - 1); + row.ind_objfld_hashval = lib_json::FldKey_Hash(0, fldkey_Get(row)); + ind_objfld_Reserve(1); + u32 index = row.ind_objfld_hashval & (_db.ind_objfld_buckets_n - 1); lib_json::FNode* *prev = &_db.ind_objfld_buckets_elems[index]; do { lib_json::FNode* ret = *prev; @@ -449,7 +440,7 @@ bool lib_json::ind_objfld_InsertMaybe(lib_json::FNode& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_json::ind_objfld_Remove(lib_json::FNode& row) { if (LIKELY(row.ind_objfld_next != (lib_json::FNode*)-1)) {// check if in hash already - u32 index = lib_json::FldKey_Hash(0, fldkey_Get(row)) & (_db.ind_objfld_buckets_n - 1); + u32 index = row.ind_objfld_hashval & (_db.ind_objfld_buckets_n - 1); lib_json::FNode* *prev = &_db.ind_objfld_buckets_elems[index]; // addr of pointer to current element while (lib_json::FNode *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -466,8 +457,14 @@ void lib_json::ind_objfld_Remove(lib_json::FNode& row) { // --- lib_json.FDb.ind_objfld.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_json::ind_objfld_Reserve(int n) { + ind_objfld_AbsReserve(_db.ind_objfld_n + n); +} + +// --- lib_json.FDb.ind_objfld.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_json::ind_objfld_AbsReserve(int n) { u32 old_nbuckets = _db.ind_objfld_buckets_n; - u32 new_nelems = _db.ind_objfld_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -486,7 +483,7 @@ void lib_json::ind_objfld_Reserve(int n) { while (elem) { lib_json::FNode &row = *elem; lib_json::FNode* next = row.ind_objfld_next; - u32 index = lib_json::FldKey_Hash(0, fldkey_Get(row)) & (new_nbuckets-1); + u32 index = row.ind_objfld_hashval & (new_nbuckets-1); row.ind_objfld_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -545,9 +542,6 @@ void lib_json::FldKey_Print(lib_json::FldKey& row, algo::cstring& str) { algo::tempstr temp; str << "lib_json.FldKey"; - u64_PrintHex(u64(row.object), temp, 8, true); - PrintAttrSpaceReset(str,"object", temp); - algo::strptr_Print(row.field, temp); PrintAttrSpaceReset(str,"field", temp); } @@ -571,15 +565,11 @@ void lib_json::c_child_Cascdel(lib_json::FNode& node) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void lib_json::c_child_Insert(lib_json::FNode& node, lib_json::FNode& row) { - if (bool_Update(row.node_c_child_in_ary,true)) { - // reserve space + if (!row.node_c_child_in_ary) { c_child_Reserve(node, 1); - u32 n = node.c_child_n; - u32 at = n; - lib_json::FNode* *elems = node.c_child_elems; - elems[at] = &row; - node.c_child_n = n+1; - + u32 n = node.c_child_n++; + node.c_child_elems[n] = &row; + row.node_c_child_in_ary = true; } } @@ -588,7 +578,7 @@ void lib_json::c_child_Insert(lib_json::FNode& node, lib_json::FNode& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool lib_json::c_child_InsertMaybe(lib_json::FNode& node, lib_json::FNode& row) { - bool retval = !row.node_c_child_in_ary; + bool retval = !node_c_child_InAryQ(row); c_child_Insert(node,row); // check is performed in _Insert again return retval; } @@ -596,18 +586,18 @@ bool lib_json::c_child_InsertMaybe(lib_json::FNode& node, lib_json::FNode& row) // --- lib_json.FNode.c_child.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void lib_json::c_child_Remove(lib_json::FNode& node, lib_json::FNode& row) { + int n = node.c_child_n; if (bool_Update(row.node_c_child_in_ary,false)) { - int lim = node.c_child_n; lib_json::FNode* *elems = node.c_child_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { lib_json::FNode* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(lib_json::FNode*) * (lim - j); + size_t nbytes = sizeof(lib_json::FNode*) * (n - j); memmove(elems + i, elems + j, nbytes); - node.c_child_n = lim - 1; + node.c_child_n = n - 1; break; } } diff --git a/cpp/gen/lib_mysql_gen.cpp b/cpp/gen/lib_mysql_gen.cpp index 1fbf6291..3874241e 100644 --- a/cpp/gen/lib_mysql_gen.cpp +++ b/cpp/gen/lib_mysql_gen.cpp @@ -25,8 +25,6 @@ #include "include/algo.h" // hard-coded include #include "include/gen/lib_mysql_gen.h" #include "include/gen/lib_mysql_gen.inl.h" -#include "include/gen/algo_lib_gen.h" -#include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude namespace lib_mysql { // gen:ns_print_proto // Load statically available data into tables, register tables and database. @@ -97,10 +95,9 @@ bool lib_mysql::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (root == "-") { retval = lib_mysql::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); } else if (DirectoryQ(root)) { - retval = retval && lib_mysql::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -130,7 +127,6 @@ bool lib_mysql::LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive bool retval = true; ind_beg(algo::FileLine_curs,line,fd) { if (recursive) { - retval = retval && algo_lib::InsertStrptrMaybe(line); } if (!retval) { algo_lib::_db.errtext << eol @@ -156,7 +152,6 @@ bool lib_mysql::LoadSsimfileMaybe(algo::strptr fname, bool recursive) { // --- lib_mysql.FDb._db.Steps // Calls Step function of dependencies void lib_mysql::Steps() { - algo_lib::Step(); // dependent namespace specified via (dev.targdep) } // --- lib_mysql.FDb._db.XrefMaybe diff --git a/cpp/gen/lib_netio_gen.cpp b/cpp/gen/lib_netio_gen.cpp new file mode 100644 index 00000000..ca61c534 --- /dev/null +++ b/cpp/gen/lib_netio_gen.cpp @@ -0,0 +1,513 @@ +// +// cpp/gen/lib_netio_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/lib_netio_gen.h" +#include "include/gen/lib_netio_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" +//#pragma endinclude +namespace lib_netio { // gen:ns_print_proto + // Load statically available data into tables, register tables and database. + // func:lib_netio.FDb._db.InitReflection + static void InitReflection(); + // find trace by row id (used to implement reflection) + // func:lib_netio.FDb.trace.RowidFind + static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); + // Function return 1 + // func:lib_netio.FDb.trace.N + inline static i32 trace_N() __attribute__((__warn_unused_result__, nothrow, pure)); + // func:lib_netio...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- lib_netio.trace..Print +// print string representation of ROW to string STR +// cfmt:lib_netio.trace.String printfmt:Tuple +void lib_netio::trace_Print(lib_netio::trace& row, algo::cstring& str) { + algo::tempstr temp; + str << "lib_netio.trace"; + (void)row;//only to avoid -Wunused-parameter +} + +// --- lib_netio.FDb._db.InitReflection +// Load statically available data into tables, register tables and database. +static void lib_netio::InitReflection() { + algo_lib::imdb_InsertMaybe(algo::Imdb("lib_netio", NULL, NULL, NULL, NULL, algo::Comment())); + + algo::Imtable t_trace; + t_trace.imtable = "lib_netio.trace"; + t_trace.ssimfile = ""; + t_trace.size = sizeof(lib_netio::trace); + t_trace.comment.value = ""; + t_trace.c_RowidFind = trace_RowidFind; + t_trace.NItems = trace_N; + t_trace.Print = (algo::ImrowPrintFcn)lib_netio::trace_Print; + algo_lib::imtable_InsertMaybe(t_trace); + + + // -- load signatures of existing dispatches -- +} + +// --- lib_netio.FDb._db.InsertStrptrMaybe +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +bool lib_netio::InsertStrptrMaybe(algo::strptr str) { + bool retval = true; + (void)str;//only to avoid -Wunused-parameter + return retval; +} + +// --- lib_netio.FDb._db.LoadTuplesMaybe +// Load all finputs from given directory. +bool lib_netio::LoadTuplesMaybe(algo::strptr root, bool recursive) { + bool retval = true; + if (FileQ(root)) { + retval = lib_netio::LoadTuplesFile(root, recursive); + } else if (root == "-") { + retval = lib_netio::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); + } else if (DirectoryQ(root)) { + retval = retval && lib_netio::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); + } else { + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); + retval = false; + } + return retval; +} + +// --- lib_netio.FDb._db.LoadTuplesFile +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +bool lib_netio::LoadTuplesFile(algo::strptr fname, bool recursive) { + bool retval = true; + algo_lib::FFildes fildes; + // missing files are not an error + fildes.fd = OpenRead(fname,algo::FileFlags()); + if (ValidQ(fildes.fd)) { + retval = LoadTuplesFd(fildes.fd, fname, recursive); + } + return retval; +} + +// --- lib_netio.FDb._db.LoadTuplesFd +// Load all finputs from given file descriptor. +bool lib_netio::LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) { + bool retval = true; + ind_beg(algo::FileLine_curs,line,fd) { + if (recursive) { + retval = retval && algo_lib::InsertStrptrMaybe(line); + } + if (!retval) { + algo_lib::_db.errtext << eol + << fname << ":" + << (ind_curs(line).i+1) + << ": " << line << eol; + break; + } + }ind_end; + return retval; +} + +// --- lib_netio.FDb._db.LoadSsimfileMaybe +// Load specified ssimfile. +bool lib_netio::LoadSsimfileMaybe(algo::strptr fname, bool recursive) { + bool retval = true; + if (FileQ(fname)) { + retval = lib_netio::LoadTuplesFile(fname, recursive); + } + return retval; +} + +// --- lib_netio.FDb._db.Steps +// Calls Step function of dependencies +void lib_netio::Steps() { + algo_lib::Step(); // dependent namespace specified via (dev.targdep) +} + +// --- lib_netio.FDb._db.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool lib_netio::_db_XrefMaybe() { + bool retval = true; + return retval; +} + +// --- lib_netio.FDb.var.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +lib_netio::FVar& lib_netio::var_Alloc() { + lib_netio::FVar* row = var_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("lib_netio.out_of_mem field:lib_netio.FDb.var comment:'Alloc failed'"); + } + return *row; +} + +// --- lib_netio.FDb.var.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +lib_netio::FVar* lib_netio::var_AllocMaybe() { + lib_netio::FVar *row = (lib_netio::FVar*)var_AllocMem(); + if (row) { + new (row) lib_netio::FVar; // call constructor + } + return row; +} + +// --- lib_netio.FDb.var.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* lib_netio::var_AllocMem() { + u64 new_nelems = _db.var_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + var_qFind(u64(n)).~FVar(); // destroy last element + _db.var_n = i32(n); + } +} + +// --- lib_netio.FDb.var.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void lib_netio::var_RemoveLast() { + u64 n = _db.var_n; + if (n > 0) { + n -= 1; + var_qFind(u64(n)).~FVar(); + _db.var_n = i32(n); + } +} + +// --- lib_netio.FDb.var.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool lib_netio::var_XrefMaybe(lib_netio::FVar &row) { + bool retval = true; + (void)row; + // insert var into index ind_var + if (true) { // user-defined insert condition + bool success = ind_var_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "lib_netio.duplicate_key xref:lib_netio.FDb.ind_var"; // check for duplicate key + return false; + } + } + return retval; +} + +// --- lib_netio.FDb.ind_var.Find +// Find row by key. Return NULL if not found. +lib_netio::FVar* lib_netio::ind_var_Find(const algo::strptr& key) { + u32 index = algo::cstring_Hash(0, key) & (_db.ind_var_buckets_n - 1); + lib_netio::FVar *ret = _db.ind_var_buckets_elems[index]; + for (; ret && !((*ret).var == key); ret = ret->ind_var_next) { + } + return ret; +} + +// --- lib_netio.FDb.ind_var.FindX +// Look up row by key and return reference. Throw exception if not found +lib_netio::FVar& lib_netio::ind_var_FindX(const algo::strptr& key) { + lib_netio::FVar* ret = ind_var_Find(key); + vrfy(ret, tempstr() << "lib_netio.key_error table:ind_var key:'"<ind_var_next; + } while (true); + if (retval) { + row.ind_var_next = *prev; + _db.ind_var_n++; + *prev = &row; + } + } + return retval; +} + +// --- lib_netio.FDb.ind_var.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void lib_netio::ind_var_Remove(lib_netio::FVar& row) { + if (LIKELY(row.ind_var_next != (lib_netio::FVar*)-1)) {// check if in hash already + u32 index = row.ind_var_hashval & (_db.ind_var_buckets_n - 1); + lib_netio::FVar* *prev = &_db.ind_var_buckets_elems[index]; // addr of pointer to current element + while (lib_netio::FVar *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_var_next; // unlink (singly linked list) + _db.ind_var_n--; + row.ind_var_next = (lib_netio::FVar*)-1;// not-in-hash + break; + } + prev = &next->ind_var_next; + } + } +} + +// --- lib_netio.FDb.ind_var.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void lib_netio::ind_var_Reserve(int n) { + ind_var_AbsReserve(_db.ind_var_n + n); +} + +// --- lib_netio.FDb.ind_var.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_netio::ind_var_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_var_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(lib_netio::FVar*); + u32 new_size = new_nbuckets * sizeof(lib_netio::FVar*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + lib_netio::FVar* *new_buckets = (lib_netio::FVar**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("lib_netio.out_of_memory field:lib_netio.FDb.ind_var"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_var_buckets_n; i++) { + lib_netio::FVar* elem = _db.ind_var_buckets_elems[i]; + while (elem) { + lib_netio::FVar &row = *elem; + lib_netio::FVar* next = row.ind_var_next; + u32 index = row.ind_var_hashval & (new_nbuckets-1); + row.ind_var_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_var_buckets_elems, old_size); + _db.ind_var_buckets_elems = new_buckets; + _db.ind_var_buckets_n = new_nbuckets; + } +} + +// --- lib_netio.FDb.trace.RowidFind +// find trace by row id (used to implement reflection) +static algo::ImrowPtr lib_netio::trace_RowidFind(int t) { + return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +} + +// --- lib_netio.FDb.trace.N +// Function return 1 +inline static i32 lib_netio::trace_N() { + return 1; +} + +// --- lib_netio.FDb..Init +// Set all fields to initial values. +void lib_netio::FDb_Init() { + // initialize LAry var (lib_netio.FDb.var) + _db.var_n = 0; + memset(_db.var_lary, 0, sizeof(_db.var_lary)); // zero out all level pointers + lib_netio::FVar* var_first = (lib_netio::FVar*)algo_lib::malloc_AllocMem(sizeof(lib_netio::FVar) * (u64(1)<<4)); + if (!var_first) { + FatalErrorExit("out of memory"); + } + for (int i = 0; i < 4; i++) { + _db.var_lary[i] = var_first; + var_first += 1ULL<value) == sizeof(lib_netio::FieldId)); +} diff --git a/cpp/gen/lib_prot_gen.cpp b/cpp/gen/lib_prot_gen.cpp index a7aae9aa..a04bf649 100644 --- a/cpp/gen/lib_prot_gen.cpp +++ b/cpp/gen/lib_prot_gen.cpp @@ -25,10 +25,6 @@ #include "include/algo.h" // hard-coded include #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" -#include "include/gen/algo_lib_gen.h" -#include "include/gen/algo_lib_gen.inl.h" -#include "include/gen/lib_json_gen.h" -#include "include/gen/lib_json_gen.inl.h" //#pragma endinclude namespace lib_prot { // gen:ns_print_proto // func:lib_prot...SizeCheck diff --git a/cpp/gen/lib_rl_gen.cpp b/cpp/gen/lib_rl_gen.cpp new file mode 100644 index 00000000..25c42253 --- /dev/null +++ b/cpp/gen/lib_rl_gen.cpp @@ -0,0 +1,279 @@ +// +// cpp/gen/lib_rl_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/lib_rl_gen.h" +#include "include/gen/lib_rl_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" +#include "include/gen/lib_prot_gen.h" +#include "include/gen/lib_prot_gen.inl.h" +//#pragma endinclude +namespace lib_rl { // gen:ns_print_proto + // Load statically available data into tables, register tables and database. + // func:lib_rl.FDb._db.InitReflection + static void InitReflection(); + // find trace by row id (used to implement reflection) + // func:lib_rl.FDb.trace.RowidFind + static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); + // Function return 1 + // func:lib_rl.FDb.trace.N + inline static i32 trace_N() __attribute__((__warn_unused_result__, nothrow, pure)); + // func:lib_rl...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- lib_rl.trace..Print +// print string representation of ROW to string STR +// cfmt:lib_rl.trace.String printfmt:Tuple +void lib_rl::trace_Print(lib_rl::trace& row, algo::cstring& str) { + algo::tempstr temp; + str << "lib_rl.trace"; + (void)row;//only to avoid -Wunused-parameter +} + +// --- lib_rl.FDb._db.InitReflection +// Load statically available data into tables, register tables and database. +static void lib_rl::InitReflection() { + algo_lib::imdb_InsertMaybe(algo::Imdb("lib_rl", NULL, NULL, NULL, NULL, algo::Comment())); + + algo::Imtable t_trace; + t_trace.imtable = "lib_rl.trace"; + t_trace.ssimfile = ""; + t_trace.size = sizeof(lib_rl::trace); + t_trace.comment.value = ""; + t_trace.c_RowidFind = trace_RowidFind; + t_trace.NItems = trace_N; + t_trace.Print = (algo::ImrowPrintFcn)lib_rl::trace_Print; + algo_lib::imtable_InsertMaybe(t_trace); + + + // -- load signatures of existing dispatches -- +} + +// --- lib_rl.FDb._db.InsertStrptrMaybe +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +bool lib_rl::InsertStrptrMaybe(algo::strptr str) { + bool retval = true; + (void)str;//only to avoid -Wunused-parameter + return retval; +} + +// --- lib_rl.FDb._db.LoadTuplesMaybe +// Load all finputs from given directory. +bool lib_rl::LoadTuplesMaybe(algo::strptr root, bool recursive) { + bool retval = true; + if (FileQ(root)) { + retval = lib_rl::LoadTuplesFile(root, recursive); + } else if (root == "-") { + retval = lib_rl::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); + } else if (DirectoryQ(root)) { + retval = retval && lib_rl::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); + } else { + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); + retval = false; + } + return retval; +} + +// --- lib_rl.FDb._db.LoadTuplesFile +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +bool lib_rl::LoadTuplesFile(algo::strptr fname, bool recursive) { + bool retval = true; + algo_lib::FFildes fildes; + // missing files are not an error + fildes.fd = OpenRead(fname,algo::FileFlags()); + if (ValidQ(fildes.fd)) { + retval = LoadTuplesFd(fildes.fd, fname, recursive); + } + return retval; +} + +// --- lib_rl.FDb._db.LoadTuplesFd +// Load all finputs from given file descriptor. +bool lib_rl::LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) { + bool retval = true; + ind_beg(algo::FileLine_curs,line,fd) { + if (recursive) { + retval = retval && algo_lib::InsertStrptrMaybe(line); + } + if (!retval) { + algo_lib::_db.errtext << eol + << fname << ":" + << (ind_curs(line).i+1) + << ": " << line << eol; + break; + } + }ind_end; + return retval; +} + +// --- lib_rl.FDb._db.LoadSsimfileMaybe +// Load specified ssimfile. +bool lib_rl::LoadSsimfileMaybe(algo::strptr fname, bool recursive) { + bool retval = true; + if (FileQ(fname)) { + retval = lib_rl::LoadTuplesFile(fname, recursive); + } + return retval; +} + +// --- lib_rl.FDb._db.Steps +// Calls Step function of dependencies +void lib_rl::Steps() { + algo_lib::Step(); // dependent namespace specified via (dev.targdep) +} + +// --- lib_rl.FDb._db.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool lib_rl::_db_XrefMaybe() { + bool retval = true; + return retval; +} + +// --- lib_rl.FDb.trace.RowidFind +// find trace by row id (used to implement reflection) +static algo::ImrowPtr lib_rl::trace_RowidFind(int t) { + return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +} + +// --- lib_rl.FDb.trace.N +// Function return 1 +inline static i32 lib_rl::trace_N() { + return 1; +} + +// --- lib_rl.FDb..Init +// Set all fields to initial values. +void lib_rl::FDb_Init() { + _db.line_valid = bool(false); + _db.eof = bool(false); + _db.err = i32(0); + _db.isatty = bool(false); + + lib_rl::InitReflection(); +} + +// --- lib_rl.FDb..Uninit +void lib_rl::FDb_Uninit() { + lib_rl::FDb &row = _db; (void)row; + iohook_Cleanup(); // dmmeta.fcleanup:lib_rl.FDb.iohook +} + +// --- lib_rl.FieldId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* lib_rl::value_ToCstr(const lib_rl::FieldId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case lib_rl_FieldId_value : ret = "value"; break; + } + return ret; +} + +// --- lib_rl.FieldId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void lib_rl::value_Print(const lib_rl::FieldId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- lib_rl.FieldId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool lib_rl::value_SetStrptrMaybe(lib_rl::FieldId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,lib_rl_FieldId_value); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- lib_rl.FieldId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void lib_rl::value_SetStrptr(lib_rl::FieldId& parent, algo::strptr rhs, lib_rl_FieldIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- lib_rl.FieldId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool lib_rl::value_ReadStrptrMaybe(lib_rl::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- lib_rl.FieldId..ReadStrptrMaybe +// Read fields of lib_rl::FieldId from an ascii string. +// The format of the string is the format of the lib_rl::FieldId's only field +bool lib_rl::FieldId_ReadStrptrMaybe(lib_rl::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- lib_rl.FieldId..Print +// print string representation of ROW to string STR +// cfmt:lib_rl.FieldId.String printfmt:Raw +void lib_rl::FieldId_Print(lib_rl::FieldId& row, algo::cstring& str) { + lib_rl::value_Print(row, str); +} + +// --- lib_rl...SizeCheck +inline static void lib_rl::SizeCheck() { +} + +// --- lib_rl...StaticCheck +void lib_rl::StaticCheck() { + algo_assert(_offset_of(lib_rl::FieldId, value) + sizeof(((lib_rl::FieldId*)0)->value) == sizeof(lib_rl::FieldId)); +} diff --git a/cpp/gen/lib_sql_gen.cpp b/cpp/gen/lib_sql_gen.cpp index 80444c5e..bad18e91 100644 --- a/cpp/gen/lib_sql_gen.cpp +++ b/cpp/gen/lib_sql_gen.cpp @@ -27,6 +27,8 @@ #include "include/gen/lib_sql_gen.inl.h" #include "include/gen/algo_gen.h" #include "include/gen/algo_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude @@ -98,8 +100,8 @@ bool lib_sql::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && lib_sql::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -256,14 +258,9 @@ bool lib_sql::attr_XrefMaybe(lib_sql::FAttr &row) { // Find row by key. Return NULL if not found. lib_sql::FAttr* lib_sql::ind_attr_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_attr_buckets_n - 1); - lib_sql::FAttr* *e = &_db.ind_attr_buckets_elems[index]; - lib_sql::FAttr* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).attr == key; - if (done) break; - e = &ret->ind_attr_next; - } while (true); + lib_sql::FAttr *ret = _db.ind_attr_buckets_elems[index]; + for (; ret && !((*ret).attr == key); ret = ret->ind_attr_next) { + } return ret; } @@ -295,10 +292,11 @@ lib_sql::FAttr& lib_sql::ind_attr_GetOrCreate(const algo::strptr& key) { // --- lib_sql.FDb.ind_attr.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_sql::ind_attr_InsertMaybe(lib_sql::FAttr& row) { - ind_attr_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_attr_next == (lib_sql::FAttr*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.attr) & (_db.ind_attr_buckets_n - 1); + row.ind_attr_hashval = algo::cstring_Hash(0, row.attr); + ind_attr_Reserve(1); + u32 index = row.ind_attr_hashval & (_db.ind_attr_buckets_n - 1); lib_sql::FAttr* *prev = &_db.ind_attr_buckets_elems[index]; do { lib_sql::FAttr* ret = *prev; @@ -324,7 +322,7 @@ bool lib_sql::ind_attr_InsertMaybe(lib_sql::FAttr& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_sql::ind_attr_Remove(lib_sql::FAttr& row) { if (LIKELY(row.ind_attr_next != (lib_sql::FAttr*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.attr) & (_db.ind_attr_buckets_n - 1); + u32 index = row.ind_attr_hashval & (_db.ind_attr_buckets_n - 1); lib_sql::FAttr* *prev = &_db.ind_attr_buckets_elems[index]; // addr of pointer to current element while (lib_sql::FAttr *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -341,8 +339,14 @@ void lib_sql::ind_attr_Remove(lib_sql::FAttr& row) { // --- lib_sql.FDb.ind_attr.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_sql::ind_attr_Reserve(int n) { + ind_attr_AbsReserve(_db.ind_attr_n + n); +} + +// --- lib_sql.FDb.ind_attr.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_sql::ind_attr_AbsReserve(int n) { u32 old_nbuckets = _db.ind_attr_buckets_n; - u32 new_nelems = _db.ind_attr_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -361,7 +365,7 @@ void lib_sql::ind_attr_Reserve(int n) { while (elem) { lib_sql::FAttr &row = *elem; lib_sql::FAttr* next = row.ind_attr_next; - u32 index = algo::cstring_Hash(0, row.attr) & (new_nbuckets-1); + u32 index = row.ind_attr_hashval & (new_nbuckets-1); row.ind_attr_next = new_buckets[index]; new_buckets[index] = &row; elem = next; diff --git a/cpp/gen/lib_sqlite_gen.cpp b/cpp/gen/lib_sqlite_gen.cpp index d11df52b..6fc514f7 100644 --- a/cpp/gen/lib_sqlite_gen.cpp +++ b/cpp/gen/lib_sqlite_gen.cpp @@ -29,10 +29,10 @@ #include "include/gen/algo_gen.inl.h" #include "include/gen/dmmeta_gen.h" #include "include/gen/dmmeta_gen.inl.h" -#include "include/gen/algo_lib_gen.h" -#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_json_gen.h" #include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_prot_gen.h" #include "include/gen/lib_prot_gen.inl.h" //#pragma endinclude @@ -65,8 +65,8 @@ namespace lib_sqlite { // gen:ns_print_proto // --- lib_sqlite.FConn..Uninit void lib_sqlite::FConn_Uninit(lib_sqlite::FConn& conn) { lib_sqlite::FConn &row = conn; (void)row; - ind_conn_Remove(row); // remove conn from index ind_conn db_Cleanup(conn); // dmmeta.fcleanup:lib_sqlite.FConn.db + ind_conn_Remove(row); // remove conn from index ind_conn } // --- lib_sqlite.FCtype.base.CopyOut @@ -99,15 +99,11 @@ algo::Smallstr100 lib_sqlite::name_Get(lib_sqlite::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void lib_sqlite::c_field_Insert(lib_sqlite::FCtype& ctype, lib_sqlite::FField& row) { - if (bool_Update(row.ctype_c_field_in_ary,true)) { - // reserve space + if (!row.ctype_c_field_in_ary) { c_field_Reserve(ctype, 1); - u32 n = ctype.c_field_n; - u32 at = n; - lib_sqlite::FField* *elems = ctype.c_field_elems; - elems[at] = &row; - ctype.c_field_n = n+1; - + u32 n = ctype.c_field_n++; + ctype.c_field_elems[n] = &row; + row.ctype_c_field_in_ary = true; } } @@ -116,7 +112,7 @@ void lib_sqlite::c_field_Insert(lib_sqlite::FCtype& ctype, lib_sqlite::FField& r // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool lib_sqlite::c_field_InsertMaybe(lib_sqlite::FCtype& ctype, lib_sqlite::FField& row) { - bool retval = !row.ctype_c_field_in_ary; + bool retval = !ctype_c_field_InAryQ(row); c_field_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -124,18 +120,18 @@ bool lib_sqlite::c_field_InsertMaybe(lib_sqlite::FCtype& ctype, lib_sqlite::FFie // --- lib_sqlite.FCtype.c_field.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void lib_sqlite::c_field_Remove(lib_sqlite::FCtype& ctype, lib_sqlite::FField& row) { + int n = ctype.c_field_n; if (bool_Update(row.ctype_c_field_in_ary,false)) { - int lim = ctype.c_field_n; lib_sqlite::FField* *elems = ctype.c_field_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { lib_sqlite::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(lib_sqlite::FField*) * (lim - j); + size_t nbytes = sizeof(lib_sqlite::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_field_n = lim - 1; + ctype.c_field_n = n - 1; break; } } @@ -163,14 +159,9 @@ void lib_sqlite::c_field_Reserve(lib_sqlite::FCtype& ctype, u32 n) { // Find row by key. Return NULL if not found. lib_sqlite::FField* lib_sqlite::ind_field_name_Find(lib_sqlite::FCtype& ctype, const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (ctype.ind_field_name_buckets_n - 1); - lib_sqlite::FField* *e = &ctype.ind_field_name_buckets_elems[index]; - lib_sqlite::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || name_Get((*ret)) == key; - if (done) break; - e = &ret->ind_field_name_next; - } while (true); + lib_sqlite::FField *ret = ctype.ind_field_name_buckets_elems[index]; + for (; ret && !(name_Get((*ret)) == key); ret = ret->ctype_ind_field_name_next) { + } return ret; } @@ -185,10 +176,11 @@ lib_sqlite::FField& lib_sqlite::ind_field_name_FindX(lib_sqlite::FCtype& ctype, // --- lib_sqlite.FCtype.ind_field_name.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_sqlite::ind_field_name_InsertMaybe(lib_sqlite::FCtype& ctype, lib_sqlite::FField& row) { - ind_field_name_Reserve(ctype, 1); bool retval = true; // if already in hash, InsertMaybe returns true - if (LIKELY(row.ind_field_name_next == (lib_sqlite::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, name_Get(row)) & (ctype.ind_field_name_buckets_n - 1); + if (LIKELY(row.ctype_ind_field_name_next == (lib_sqlite::FField*)-1)) {// check if in hash already + row.ctype_ind_field_name_hashval = algo::Smallstr50_Hash(0, name_Get(row)); + ind_field_name_Reserve(ctype, 1); + u32 index = row.ctype_ind_field_name_hashval & (ctype.ind_field_name_buckets_n - 1); lib_sqlite::FField* *prev = &ctype.ind_field_name_buckets_elems[index]; do { lib_sqlite::FField* ret = *prev; @@ -199,10 +191,10 @@ bool lib_sqlite::ind_field_name_InsertMaybe(lib_sqlite::FCtype& ctype, lib_sqlit retval = false; break; } - prev = &ret->ind_field_name_next; + prev = &ret->ctype_ind_field_name_next; } while (true); if (retval) { - row.ind_field_name_next = *prev; + row.ctype_ind_field_name_next = *prev; ctype.ind_field_name_n++; *prev = &row; } @@ -213,17 +205,17 @@ bool lib_sqlite::ind_field_name_InsertMaybe(lib_sqlite::FCtype& ctype, lib_sqlit // --- lib_sqlite.FCtype.ind_field_name.Remove // Remove reference to element from hash index. If element is not in hash, do nothing void lib_sqlite::ind_field_name_Remove(lib_sqlite::FCtype& ctype, lib_sqlite::FField& row) { - if (LIKELY(row.ind_field_name_next != (lib_sqlite::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, name_Get(row)) & (ctype.ind_field_name_buckets_n - 1); + if (LIKELY(row.ctype_ind_field_name_next != (lib_sqlite::FField*)-1)) {// check if in hash already + u32 index = row.ctype_ind_field_name_hashval & (ctype.ind_field_name_buckets_n - 1); lib_sqlite::FField* *prev = &ctype.ind_field_name_buckets_elems[index]; // addr of pointer to current element while (lib_sqlite::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_field_name_next; // unlink (singly linked list) + *prev = next->ctype_ind_field_name_next; // unlink (singly linked list) ctype.ind_field_name_n--; - row.ind_field_name_next = (lib_sqlite::FField*)-1;// not-in-hash + row.ctype_ind_field_name_next = (lib_sqlite::FField*)-1;// not-in-hash break; } - prev = &next->ind_field_name_next; + prev = &next->ctype_ind_field_name_next; } } } @@ -231,8 +223,14 @@ void lib_sqlite::ind_field_name_Remove(lib_sqlite::FCtype& ctype, lib_sqlite::FF // --- lib_sqlite.FCtype.ind_field_name.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_sqlite::ind_field_name_Reserve(lib_sqlite::FCtype& ctype, int n) { + ind_field_name_AbsReserve(ctype,ctype.ind_field_name_n + n); +} + +// --- lib_sqlite.FCtype.ind_field_name.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_sqlite::ind_field_name_AbsReserve(lib_sqlite::FCtype& ctype, int n) { u32 old_nbuckets = ctype.ind_field_name_buckets_n; - u32 new_nelems = ctype.ind_field_name_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -250,9 +248,9 @@ void lib_sqlite::ind_field_name_Reserve(lib_sqlite::FCtype& ctype, int n) { lib_sqlite::FField* elem = ctype.ind_field_name_buckets_elems[i]; while (elem) { lib_sqlite::FField &row = *elem; - lib_sqlite::FField* next = row.ind_field_name_next; - u32 index = algo::Smallstr50_Hash(0, name_Get(row)) & (new_nbuckets-1); - row.ind_field_name_next = new_buckets[index]; + lib_sqlite::FField* next = row.ctype_ind_field_name_next; + u32 index = row.ctype_ind_field_name_hashval & (new_nbuckets-1); + row.ctype_ind_field_name_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } @@ -267,12 +265,12 @@ void lib_sqlite::ind_field_name_Reserve(lib_sqlite::FCtype& ctype, int n) { // --- lib_sqlite.FCtype.zd_row.Insert // Insert row into linked list. If row is already in linked list, do nothing. void lib_sqlite::zd_row_Insert(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& row) { - if (!zd_row_InLlistQ(row)) { + if (!ctype_zd_row_InLlistQ(row)) { lib_sqlite::FRow* old_tail = ctype.zd_row_tail; - row.zd_row_next = NULL; - row.zd_row_prev = old_tail; + row.ctype_zd_row_next = NULL; + row.ctype_zd_row_prev = old_tail; ctype.zd_row_tail = &row; - lib_sqlite::FRow **new_row_a = &old_tail->zd_row_next; + lib_sqlite::FRow **new_row_a = &old_tail->ctype_zd_row_next; lib_sqlite::FRow **new_row_b = &ctype.zd_row_head; lib_sqlite::FRow **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -283,23 +281,23 @@ void lib_sqlite::zd_row_Insert(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& row) // --- lib_sqlite.FCtype.zd_row.Remove // Remove element from index. If element is not in index, do nothing. void lib_sqlite::zd_row_Remove(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& row) { - if (zd_row_InLlistQ(row)) { + if (ctype_zd_row_InLlistQ(row)) { lib_sqlite::FRow* old_head = ctype.zd_row_head; (void)old_head; // in case it's not used - lib_sqlite::FRow* prev = row.zd_row_prev; - lib_sqlite::FRow* next = row.zd_row_next; + lib_sqlite::FRow* prev = row.ctype_zd_row_prev; + lib_sqlite::FRow* next = row.ctype_zd_row_next; // if element is first, adjust list head; otherwise, adjust previous element's next - lib_sqlite::FRow **new_next_a = &prev->zd_row_next; + lib_sqlite::FRow **new_next_a = &prev->ctype_zd_row_next; lib_sqlite::FRow **new_next_b = &ctype.zd_row_head; lib_sqlite::FRow **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - lib_sqlite::FRow **new_prev_a = &next->zd_row_prev; + lib_sqlite::FRow **new_prev_a = &next->ctype_zd_row_prev; lib_sqlite::FRow **new_prev_b = &ctype.zd_row_tail; lib_sqlite::FRow **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; ctype.zd_row_n--; - row.zd_row_next=(lib_sqlite::FRow*)-1; // not-in-list + row.ctype_zd_row_next=(lib_sqlite::FRow*)-1; // not-in-list } } @@ -311,9 +309,9 @@ void lib_sqlite::zd_row_RemoveAll(lib_sqlite::FCtype& ctype) { ctype.zd_row_tail = NULL; ctype.zd_row_n = 0; while (row) { - lib_sqlite::FRow* row_next = row->zd_row_next; - row->zd_row_next = (lib_sqlite::FRow*)-1; - row->zd_row_prev = NULL; + lib_sqlite::FRow* row_next = row->ctype_zd_row_next; + row->ctype_zd_row_next = (lib_sqlite::FRow*)-1; + row->ctype_zd_row_prev = NULL; row = row_next; } } @@ -324,14 +322,14 @@ lib_sqlite::FRow* lib_sqlite::zd_row_RemoveFirst(lib_sqlite::FCtype& ctype) { lib_sqlite::FRow *row = NULL; row = ctype.zd_row_head; if (row) { - lib_sqlite::FRow *next = row->zd_row_next; + lib_sqlite::FRow *next = row->ctype_zd_row_next; ctype.zd_row_head = next; - lib_sqlite::FRow **new_end_a = &next->zd_row_prev; + lib_sqlite::FRow **new_end_a = &next->ctype_zd_row_prev; lib_sqlite::FRow **new_end_b = &ctype.zd_row_tail; lib_sqlite::FRow **new_end = next ? new_end_a : new_end_b; *new_end = NULL; ctype.zd_row_n--; - row->zd_row_next = (lib_sqlite::FRow*)-1; // mark as not-in-list + row->ctype_zd_row_next = (lib_sqlite::FRow*)-1; // mark as not-in-list } return row; } @@ -340,14 +338,9 @@ lib_sqlite::FRow* lib_sqlite::zd_row_RemoveFirst(lib_sqlite::FCtype& ctype) { // Find row by key. Return NULL if not found. lib_sqlite::FRow* lib_sqlite::ind_pkey_Find(lib_sqlite::FCtype& ctype, const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (ctype.ind_pkey_buckets_n - 1); - lib_sqlite::FRow* *e = &ctype.ind_pkey_buckets_elems[index]; - lib_sqlite::FRow* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).pkey == key; - if (done) break; - e = &ret->ind_pkey_next; - } while (true); + lib_sqlite::FRow *ret = ctype.ind_pkey_buckets_elems[index]; + for (; ret && !((*ret).pkey == key); ret = ret->ctype_ind_pkey_next) { + } return ret; } @@ -362,10 +355,11 @@ lib_sqlite::FRow& lib_sqlite::ind_pkey_FindX(lib_sqlite::FCtype& ctype, const al // --- lib_sqlite.FCtype.ind_pkey.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_sqlite::ind_pkey_InsertMaybe(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& row) { - ind_pkey_Reserve(ctype, 1); bool retval = true; // if already in hash, InsertMaybe returns true - if (LIKELY(row.ind_pkey_next == (lib_sqlite::FRow*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.pkey) & (ctype.ind_pkey_buckets_n - 1); + if (LIKELY(row.ctype_ind_pkey_next == (lib_sqlite::FRow*)-1)) {// check if in hash already + row.ctype_ind_pkey_hashval = algo::cstring_Hash(0, row.pkey); + ind_pkey_Reserve(ctype, 1); + u32 index = row.ctype_ind_pkey_hashval & (ctype.ind_pkey_buckets_n - 1); lib_sqlite::FRow* *prev = &ctype.ind_pkey_buckets_elems[index]; do { lib_sqlite::FRow* ret = *prev; @@ -376,10 +370,10 @@ bool lib_sqlite::ind_pkey_InsertMaybe(lib_sqlite::FCtype& ctype, lib_sqlite::FRo retval = false; break; } - prev = &ret->ind_pkey_next; + prev = &ret->ctype_ind_pkey_next; } while (true); if (retval) { - row.ind_pkey_next = *prev; + row.ctype_ind_pkey_next = *prev; ctype.ind_pkey_n++; *prev = &row; } @@ -390,17 +384,17 @@ bool lib_sqlite::ind_pkey_InsertMaybe(lib_sqlite::FCtype& ctype, lib_sqlite::FRo // --- lib_sqlite.FCtype.ind_pkey.Remove // Remove reference to element from hash index. If element is not in hash, do nothing void lib_sqlite::ind_pkey_Remove(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& row) { - if (LIKELY(row.ind_pkey_next != (lib_sqlite::FRow*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.pkey) & (ctype.ind_pkey_buckets_n - 1); + if (LIKELY(row.ctype_ind_pkey_next != (lib_sqlite::FRow*)-1)) {// check if in hash already + u32 index = row.ctype_ind_pkey_hashval & (ctype.ind_pkey_buckets_n - 1); lib_sqlite::FRow* *prev = &ctype.ind_pkey_buckets_elems[index]; // addr of pointer to current element while (lib_sqlite::FRow *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_pkey_next; // unlink (singly linked list) + *prev = next->ctype_ind_pkey_next; // unlink (singly linked list) ctype.ind_pkey_n--; - row.ind_pkey_next = (lib_sqlite::FRow*)-1;// not-in-hash + row.ctype_ind_pkey_next = (lib_sqlite::FRow*)-1;// not-in-hash break; } - prev = &next->ind_pkey_next; + prev = &next->ctype_ind_pkey_next; } } } @@ -408,8 +402,14 @@ void lib_sqlite::ind_pkey_Remove(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& ro // --- lib_sqlite.FCtype.ind_pkey.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_sqlite::ind_pkey_Reserve(lib_sqlite::FCtype& ctype, int n) { + ind_pkey_AbsReserve(ctype,ctype.ind_pkey_n + n); +} + +// --- lib_sqlite.FCtype.ind_pkey.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_sqlite::ind_pkey_AbsReserve(lib_sqlite::FCtype& ctype, int n) { u32 old_nbuckets = ctype.ind_pkey_buckets_n; - u32 new_nelems = ctype.ind_pkey_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -427,9 +427,9 @@ void lib_sqlite::ind_pkey_Reserve(lib_sqlite::FCtype& ctype, int n) { lib_sqlite::FRow* elem = ctype.ind_pkey_buckets_elems[i]; while (elem) { lib_sqlite::FRow &row = *elem; - lib_sqlite::FRow* next = row.ind_pkey_next; - u32 index = algo::cstring_Hash(0, row.pkey) & (new_nbuckets-1); - row.ind_pkey_next = new_buckets[index]; + lib_sqlite::FRow* next = row.ctype_ind_pkey_next; + u32 index = row.ctype_ind_pkey_hashval & (new_nbuckets-1); + row.ctype_ind_pkey_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } @@ -445,15 +445,11 @@ void lib_sqlite::ind_pkey_Reserve(lib_sqlite::FCtype& ctype, int n) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void lib_sqlite::c_row_Insert(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& row) { - if (bool_Update(row.ctype_c_row_in_ary,true)) { - // reserve space + if (!row.ctype_c_row_in_ary) { c_row_Reserve(ctype, 1); - u32 n = ctype.c_row_n; - u32 at = n; - lib_sqlite::FRow* *elems = ctype.c_row_elems; - elems[at] = &row; - ctype.c_row_n = n+1; - + u32 n = ctype.c_row_n++; + ctype.c_row_elems[n] = &row; + row.ctype_c_row_in_ary = true; } } @@ -462,7 +458,7 @@ void lib_sqlite::c_row_Insert(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& row) // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool lib_sqlite::c_row_InsertMaybe(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& row) { - bool retval = !row.ctype_c_row_in_ary; + bool retval = !ctype_c_row_InAryQ(row); c_row_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -470,18 +466,18 @@ bool lib_sqlite::c_row_InsertMaybe(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& // --- lib_sqlite.FCtype.c_row.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void lib_sqlite::c_row_Remove(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& row) { + int n = ctype.c_row_n; if (bool_Update(row.ctype_c_row_in_ary,false)) { - int lim = ctype.c_row_n; lib_sqlite::FRow* *elems = ctype.c_row_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { lib_sqlite::FRow* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(lib_sqlite::FRow*) * (lim - j); + size_t nbytes = sizeof(lib_sqlite::FRow*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_row_n = lim - 1; + ctype.c_row_n = n - 1; break; } } @@ -536,6 +532,7 @@ void lib_sqlite::FCtype_Init(lib_sqlite::FCtype& ctype) { ctype.c_row_n = 0; // (lib_sqlite.FCtype.c_row) ctype.c_row_max = 0; // (lib_sqlite.FCtype.c_row) ctype.ind_ctype_next = (lib_sqlite::FCtype*)-1; // (lib_sqlite.FDb.ind_ctype) not-in-hash + ctype.ind_ctype_hashval = 0; // stored hash value } // --- lib_sqlite.FCtype..Uninit @@ -655,8 +652,8 @@ bool lib_sqlite::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && lib_sqlite::LoadTuplesFile(algo::SsimFname(root,"dmmeta.sqltype"),recursive); retval = retval && lib_sqlite::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -832,14 +829,9 @@ bool lib_sqlite::conn_XrefMaybe(lib_sqlite::FConn &row) { // Find row by key. Return NULL if not found. lib_sqlite::FConn* lib_sqlite::ind_conn_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_conn_buckets_n - 1); - lib_sqlite::FConn* *e = &_db.ind_conn_buckets_elems[index]; - lib_sqlite::FConn* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).name == key; - if (done) break; - e = &ret->ind_conn_next; - } while (true); + lib_sqlite::FConn *ret = _db.ind_conn_buckets_elems[index]; + for (; ret && !((*ret).name == key); ret = ret->ind_conn_next) { + } return ret; } @@ -871,10 +863,11 @@ lib_sqlite::FConn& lib_sqlite::ind_conn_GetOrCreate(const algo::strptr& key) { // --- lib_sqlite.FDb.ind_conn.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_sqlite::ind_conn_InsertMaybe(lib_sqlite::FConn& row) { - ind_conn_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_conn_next == (lib_sqlite::FConn*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.name) & (_db.ind_conn_buckets_n - 1); + row.ind_conn_hashval = algo::cstring_Hash(0, row.name); + ind_conn_Reserve(1); + u32 index = row.ind_conn_hashval & (_db.ind_conn_buckets_n - 1); lib_sqlite::FConn* *prev = &_db.ind_conn_buckets_elems[index]; do { lib_sqlite::FConn* ret = *prev; @@ -900,7 +893,7 @@ bool lib_sqlite::ind_conn_InsertMaybe(lib_sqlite::FConn& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_sqlite::ind_conn_Remove(lib_sqlite::FConn& row) { if (LIKELY(row.ind_conn_next != (lib_sqlite::FConn*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.name) & (_db.ind_conn_buckets_n - 1); + u32 index = row.ind_conn_hashval & (_db.ind_conn_buckets_n - 1); lib_sqlite::FConn* *prev = &_db.ind_conn_buckets_elems[index]; // addr of pointer to current element while (lib_sqlite::FConn *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -917,8 +910,14 @@ void lib_sqlite::ind_conn_Remove(lib_sqlite::FConn& row) { // --- lib_sqlite.FDb.ind_conn.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_sqlite::ind_conn_Reserve(int n) { + ind_conn_AbsReserve(_db.ind_conn_n + n); +} + +// --- lib_sqlite.FDb.ind_conn.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_sqlite::ind_conn_AbsReserve(int n) { u32 old_nbuckets = _db.ind_conn_buckets_n; - u32 new_nelems = _db.ind_conn_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -937,7 +936,7 @@ void lib_sqlite::ind_conn_Reserve(int n) { while (elem) { lib_sqlite::FConn &row = *elem; lib_sqlite::FConn* next = row.ind_conn_next; - u32 index = algo::cstring_Hash(0, row.name) & (new_nbuckets-1); + u32 index = row.ind_conn_hashval & (new_nbuckets-1); row.ind_conn_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1213,14 +1212,9 @@ bool lib_sqlite::field_XrefMaybe(lib_sqlite::FField &row) { // Find row by key. Return NULL if not found. lib_sqlite::FField* lib_sqlite::ind_field_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_field_buckets_n - 1); - lib_sqlite::FField* *e = &_db.ind_field_buckets_elems[index]; - lib_sqlite::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + lib_sqlite::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_field_next) { + } return ret; } @@ -1235,10 +1229,11 @@ lib_sqlite::FField& lib_sqlite::ind_field_FindX(const algo::strptr& key) { // --- lib_sqlite.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_sqlite::ind_field_InsertMaybe(lib_sqlite::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (lib_sqlite::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::Smallstr100_Hash(0, row.field); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); lib_sqlite::FField* *prev = &_db.ind_field_buckets_elems[index]; do { lib_sqlite::FField* ret = *prev; @@ -1264,7 +1259,7 @@ bool lib_sqlite::ind_field_InsertMaybe(lib_sqlite::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_sqlite::ind_field_Remove(lib_sqlite::FField& row) { if (LIKELY(row.ind_field_next != (lib_sqlite::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); lib_sqlite::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (lib_sqlite::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1281,8 +1276,14 @@ void lib_sqlite::ind_field_Remove(lib_sqlite::FField& row) { // --- lib_sqlite.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_sqlite::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- lib_sqlite.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_sqlite::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1301,7 +1302,7 @@ void lib_sqlite::ind_field_Reserve(int n) { while (elem) { lib_sqlite::FField &row = *elem; lib_sqlite::FField* next = row.ind_field_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1425,14 +1426,9 @@ bool lib_sqlite::ctype_XrefMaybe(lib_sqlite::FCtype &row) { // Find row by key. Return NULL if not found. lib_sqlite::FCtype* lib_sqlite::ind_ctype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctype_buckets_n - 1); - lib_sqlite::FCtype* *e = &_db.ind_ctype_buckets_elems[index]; - lib_sqlite::FCtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctype_next; - } while (true); + lib_sqlite::FCtype *ret = _db.ind_ctype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctype_next) { + } return ret; } @@ -1464,10 +1460,11 @@ lib_sqlite::FCtype& lib_sqlite::ind_ctype_GetOrCreate(const algo::strptr& key) { // --- lib_sqlite.FDb.ind_ctype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_sqlite::ind_ctype_InsertMaybe(lib_sqlite::FCtype& row) { - ind_ctype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ctype_next == (lib_sqlite::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + row.ind_ctype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctype_Reserve(1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); lib_sqlite::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; do { lib_sqlite::FCtype* ret = *prev; @@ -1493,7 +1490,7 @@ bool lib_sqlite::ind_ctype_InsertMaybe(lib_sqlite::FCtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_sqlite::ind_ctype_Remove(lib_sqlite::FCtype& row) { if (LIKELY(row.ind_ctype_next != (lib_sqlite::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); lib_sqlite::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; // addr of pointer to current element while (lib_sqlite::FCtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1510,8 +1507,14 @@ void lib_sqlite::ind_ctype_Remove(lib_sqlite::FCtype& row) { // --- lib_sqlite.FDb.ind_ctype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_sqlite::ind_ctype_Reserve(int n) { + ind_ctype_AbsReserve(_db.ind_ctype_n + n); +} + +// --- lib_sqlite.FDb.ind_ctype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_sqlite::ind_ctype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ctype_buckets_n; - u32 new_nelems = _db.ind_ctype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1530,7 +1533,7 @@ void lib_sqlite::ind_ctype_Reserve(int n) { while (elem) { lib_sqlite::FCtype &row = *elem; lib_sqlite::FCtype* next = row.ind_ctype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ctype_hashval & (new_nbuckets-1); row.ind_ctype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1685,14 +1688,9 @@ bool lib_sqlite::ssimfile_XrefMaybe(lib_sqlite::FSsimfile &row) { // Find row by key. Return NULL if not found. lib_sqlite::FSsimfile* lib_sqlite::ind_ssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimfile_buckets_n - 1); - lib_sqlite::FSsimfile* *e = &_db.ind_ssimfile_buckets_elems[index]; - lib_sqlite::FSsimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimfile_next; - } while (true); + lib_sqlite::FSsimfile *ret = _db.ind_ssimfile_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimfile_next) { + } return ret; } @@ -1707,10 +1705,11 @@ lib_sqlite::FSsimfile& lib_sqlite::ind_ssimfile_FindX(const algo::strptr& key) { // --- lib_sqlite.FDb.ind_ssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_sqlite::ind_ssimfile_InsertMaybe(lib_sqlite::FSsimfile& row) { - ind_ssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimfile_next == (lib_sqlite::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + row.ind_ssimfile_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimfile_Reserve(1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); lib_sqlite::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; do { lib_sqlite::FSsimfile* ret = *prev; @@ -1736,7 +1735,7 @@ bool lib_sqlite::ind_ssimfile_InsertMaybe(lib_sqlite::FSsimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_sqlite::ind_ssimfile_Remove(lib_sqlite::FSsimfile& row) { if (LIKELY(row.ind_ssimfile_next != (lib_sqlite::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); lib_sqlite::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; // addr of pointer to current element while (lib_sqlite::FSsimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1753,8 +1752,14 @@ void lib_sqlite::ind_ssimfile_Remove(lib_sqlite::FSsimfile& row) { // --- lib_sqlite.FDb.ind_ssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_sqlite::ind_ssimfile_Reserve(int n) { + ind_ssimfile_AbsReserve(_db.ind_ssimfile_n + n); +} + +// --- lib_sqlite.FDb.ind_ssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_sqlite::ind_ssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimfile_buckets_n; - u32 new_nelems = _db.ind_ssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1773,7 +1778,7 @@ void lib_sqlite::ind_ssimfile_Reserve(int n) { while (elem) { lib_sqlite::FSsimfile &row = *elem; lib_sqlite::FSsimfile* next = row.ind_ssimfile_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimfile_hashval & (new_nbuckets-1); row.ind_ssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1960,6 +1965,25 @@ algo::aryptr lib_sqlite::bestidx_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- lib_sqlite.FDb.bestidx.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr lib_sqlite::bestidx_AllocNAt(int n_elems, int at) { + bestidx_Reserve(n_elems); + int n = _db.bestidx_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("lib_sqlite.bad_alloc_n_at field:lib_sqlite.FDb.bestidx comment:'index out of range'"); + } + lib_sqlite::FIdx *elems = _db.bestidx_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(lib_sqlite::FIdx)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) lib_sqlite::FIdx(); // construct new element, default initialize + } + _db.bestidx_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- lib_sqlite.FDb.bestidx.Remove // Remove item by index. If index outside of range, do nothing. void lib_sqlite::bestidx_Remove(u32 i) { @@ -2022,6 +2046,30 @@ algo::aryptr lib_sqlite::bestidx_AllocNVal(int n_elems, const return algo::aryptr(elems + old_n, n_elems); } +// --- lib_sqlite.FDb.bestidx.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void lib_sqlite::bestidx_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.bestidx_elems && rhs.elems < _db.bestidx_elems + _db.bestidx_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("lib_sqlite.tary_alias field:lib_sqlite.FDb.bestidx comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.bestidx_elems+1))) { + FatalErrorExit("lib_sqlite.bad_insary field:lib_sqlite.FDb.bestidx comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.bestidx_n - at; + bestidx_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.bestidx_elems + at + nnew + i) lib_sqlite::FIdx(_db.bestidx_elems[at + i]); + _db.bestidx_elems[at + i].~FIdx(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.bestidx_elems + at + i) lib_sqlite::FIdx(rhs[i]); + } + _db.bestidx_n += nnew; +} + // --- lib_sqlite.FDb.trow.Alloc // Allocate memory for new default row. // If out of memory, process is killed. @@ -2232,14 +2280,9 @@ bool lib_sqlite::ns_XrefMaybe(lib_sqlite::FNs &row) { // Find row by key. Return NULL if not found. lib_sqlite::FNs* lib_sqlite::ind_ns_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_ns_buckets_n - 1); - lib_sqlite::FNs* *e = &_db.ind_ns_buckets_elems[index]; - lib_sqlite::FNs* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ns == key; - if (done) break; - e = &ret->ind_ns_next; - } while (true); + lib_sqlite::FNs *ret = _db.ind_ns_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_ns_next) { + } return ret; } @@ -2271,10 +2314,11 @@ lib_sqlite::FNs& lib_sqlite::ind_ns_GetOrCreate(const algo::strptr& key) { // --- lib_sqlite.FDb.ind_ns.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool lib_sqlite::ind_ns_InsertMaybe(lib_sqlite::FNs& row) { - ind_ns_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ns_next == (lib_sqlite::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + row.ind_ns_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_ns_Reserve(1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); lib_sqlite::FNs* *prev = &_db.ind_ns_buckets_elems[index]; do { lib_sqlite::FNs* ret = *prev; @@ -2300,7 +2344,7 @@ bool lib_sqlite::ind_ns_InsertMaybe(lib_sqlite::FNs& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void lib_sqlite::ind_ns_Remove(lib_sqlite::FNs& row) { if (LIKELY(row.ind_ns_next != (lib_sqlite::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); lib_sqlite::FNs* *prev = &_db.ind_ns_buckets_elems[index]; // addr of pointer to current element while (lib_sqlite::FNs *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2317,8 +2361,14 @@ void lib_sqlite::ind_ns_Remove(lib_sqlite::FNs& row) { // --- lib_sqlite.FDb.ind_ns.Reserve // Reserve enough room in the hash for N more elements. Return success code. void lib_sqlite::ind_ns_Reserve(int n) { + ind_ns_AbsReserve(_db.ind_ns_n + n); +} + +// --- lib_sqlite.FDb.ind_ns.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void lib_sqlite::ind_ns_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ns_buckets_n; - u32 new_nelems = _db.ind_ns_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2337,7 +2387,7 @@ void lib_sqlite::ind_ns_Reserve(int n) { while (elem) { lib_sqlite::FNs &row = *elem; lib_sqlite::FNs* next = row.ind_ns_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_ns_hashval & (new_nbuckets-1); row.ind_ns_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2586,8 +2636,10 @@ void lib_sqlite::FField_Init(lib_sqlite::FField& field) { field.p_ctype = NULL; field.id = u32(0); field.ctype_c_field_in_ary = bool(false); - field.ind_field_name_next = (lib_sqlite::FField*)-1; // (lib_sqlite.FCtype.ind_field_name) not-in-hash + field.ctype_ind_field_name_next = (lib_sqlite::FField*)-1; // (lib_sqlite.FCtype.ind_field_name) not-in-hash + field.ctype_ind_field_name_hashval = 0; // stored hash value field.ind_field_next = (lib_sqlite::FField*)-1; // (lib_sqlite.FDb.ind_field) not-in-hash + field.ind_field_hashval = 0; // stored hash value } // --- lib_sqlite.FField..Uninit @@ -2665,6 +2717,25 @@ algo::aryptr lib_sqlite::cons_AllocN(lib_sqlite::FIdx& parent, return algo::aryptr(elems + old_n, n_elems); } +// --- lib_sqlite.FIdx.cons.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr lib_sqlite::cons_AllocNAt(lib_sqlite::FIdx& parent, int n_elems, int at) { + cons_Reserve(parent, n_elems); + int n = parent.cons_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("lib_sqlite.bad_alloc_n_at field:lib_sqlite.FIdx.cons comment:'index out of range'"); + } + lib_sqlite::Cons *elems = parent.cons_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(lib_sqlite::Cons)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) lib_sqlite::Cons(); // construct new element, default initialize + } + parent.cons_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- lib_sqlite.FIdx.cons.Remove // Remove item by index. If index outside of range, do nothing. void lib_sqlite::cons_Remove(lib_sqlite::FIdx& parent, u32 i) { @@ -2747,6 +2818,30 @@ algo::aryptr lib_sqlite::cons_AllocNVal(lib_sqlite::FIdx& pare return algo::aryptr(elems + old_n, n_elems); } +// --- lib_sqlite.FIdx.cons.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void lib_sqlite::cons_Insary(lib_sqlite::FIdx& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.cons_elems && rhs.elems < parent.cons_elems + parent.cons_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("lib_sqlite.tary_alias field:lib_sqlite.FIdx.cons comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.cons_elems+1))) { + FatalErrorExit("lib_sqlite.bad_insary field:lib_sqlite.FIdx.cons comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.cons_n - at; + cons_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.cons_elems + at + nnew + i) lib_sqlite::Cons(parent.cons_elems[at + i]); + parent.cons_elems[at + i].~Cons(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.cons_elems + at + i) lib_sqlite::Cons(rhs[i]); + } + parent.cons_n += nnew; +} + // --- lib_sqlite.FIdx..Uninit void lib_sqlite::FIdx_Uninit(lib_sqlite::FIdx& parent) { lib_sqlite::FIdx &row = parent; (void)row; @@ -2797,15 +2892,11 @@ void lib_sqlite::ns_CopyIn(lib_sqlite::FNs &row, dmmeta::Ns &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void lib_sqlite::c_ssimfile_Insert(lib_sqlite::FNs& ns, lib_sqlite::FSsimfile& row) { - if (bool_Update(row.ns_c_ssimfile_in_ary,true)) { - // reserve space + if (!row.ns_c_ssimfile_in_ary) { c_ssimfile_Reserve(ns, 1); - u32 n = ns.c_ssimfile_n; - u32 at = n; - lib_sqlite::FSsimfile* *elems = ns.c_ssimfile_elems; - elems[at] = &row; - ns.c_ssimfile_n = n+1; - + u32 n = ns.c_ssimfile_n++; + ns.c_ssimfile_elems[n] = &row; + row.ns_c_ssimfile_in_ary = true; } } @@ -2814,7 +2905,7 @@ void lib_sqlite::c_ssimfile_Insert(lib_sqlite::FNs& ns, lib_sqlite::FSsimfile& r // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool lib_sqlite::c_ssimfile_InsertMaybe(lib_sqlite::FNs& ns, lib_sqlite::FSsimfile& row) { - bool retval = !row.ns_c_ssimfile_in_ary; + bool retval = !ns_c_ssimfile_InAryQ(row); c_ssimfile_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -2822,18 +2913,18 @@ bool lib_sqlite::c_ssimfile_InsertMaybe(lib_sqlite::FNs& ns, lib_sqlite::FSsimfi // --- lib_sqlite.FNs.c_ssimfile.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void lib_sqlite::c_ssimfile_Remove(lib_sqlite::FNs& ns, lib_sqlite::FSsimfile& row) { + int n = ns.c_ssimfile_n; if (bool_Update(row.ns_c_ssimfile_in_ary,false)) { - int lim = ns.c_ssimfile_n; lib_sqlite::FSsimfile* *elems = ns.c_ssimfile_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { lib_sqlite::FSsimfile* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(lib_sqlite::FSsimfile*) * (lim - j); + size_t nbytes = sizeof(lib_sqlite::FSsimfile*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_ssimfile_n = lim - 1; + ns.c_ssimfile_n = n - 1; break; } } @@ -3203,15 +3294,11 @@ void lib_sqlite::TableId_Print(lib_sqlite::TableId& row, algo::cstring& str) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void lib_sqlite::c_curs_Insert(lib_sqlite::Vtab& parent, lib_sqlite::VtabCurs& row) { - if (bool_Update(row.parent_c_curs_in_ary,true)) { - // reserve space + if (!row.parent_c_curs_in_ary) { c_curs_Reserve(parent, 1); - u32 n = parent.c_curs_n; - u32 at = n; - lib_sqlite::VtabCurs* *elems = parent.c_curs_elems; - elems[at] = &row; - parent.c_curs_n = n+1; - + u32 n = parent.c_curs_n++; + parent.c_curs_elems[n] = &row; + row.parent_c_curs_in_ary = true; } } @@ -3220,7 +3307,7 @@ void lib_sqlite::c_curs_Insert(lib_sqlite::Vtab& parent, lib_sqlite::VtabCurs& r // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool lib_sqlite::c_curs_InsertMaybe(lib_sqlite::Vtab& parent, lib_sqlite::VtabCurs& row) { - bool retval = !row.parent_c_curs_in_ary; + bool retval = !parent_c_curs_InAryQ(row); c_curs_Insert(parent,row); // check is performed in _Insert again return retval; } @@ -3228,18 +3315,18 @@ bool lib_sqlite::c_curs_InsertMaybe(lib_sqlite::Vtab& parent, lib_sqlite::VtabCu // --- lib_sqlite.Vtab.c_curs.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void lib_sqlite::c_curs_Remove(lib_sqlite::Vtab& parent, lib_sqlite::VtabCurs& row) { + int n = parent.c_curs_n; if (bool_Update(row.parent_c_curs_in_ary,false)) { - int lim = parent.c_curs_n; lib_sqlite::VtabCurs* *elems = parent.c_curs_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { lib_sqlite::VtabCurs* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(lib_sqlite::VtabCurs*) * (lim - j); + size_t nbytes = sizeof(lib_sqlite::VtabCurs*) * (n - j); memmove(elems + i, elems + j, nbytes); - parent.c_curs_n = lim - 1; + parent.c_curs_n = n - 1; break; } } @@ -3333,6 +3420,25 @@ algo::aryptr lib_sqlite::attrs_AllocN(lib_sqlite::VtabCurs& paren return algo::aryptr(elems + old_n, n_elems); } +// --- lib_sqlite.VtabCurs.attrs.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr lib_sqlite::attrs_AllocNAt(lib_sqlite::VtabCurs& parent, int n_elems, int at) { + attrs_Reserve(parent, n_elems); + int n = parent.attrs_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("lib_sqlite.bad_alloc_n_at field:lib_sqlite.VtabCurs.attrs comment:'index out of range'"); + } + algo::cstring *elems = parent.attrs_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.attrs_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- lib_sqlite.VtabCurs.attrs.Remove // Remove item by index. If index outside of range, do nothing. void lib_sqlite::attrs_Remove(lib_sqlite::VtabCurs& parent, u32 i) { @@ -3429,6 +3535,30 @@ bool lib_sqlite::attrs_ReadStrptrMaybe(lib_sqlite::VtabCurs& parent, algo::strpt return retval; } +// --- lib_sqlite.VtabCurs.attrs.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void lib_sqlite::attrs_Insary(lib_sqlite::VtabCurs& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.attrs_elems && rhs.elems < parent.attrs_elems + parent.attrs_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("lib_sqlite.tary_alias field:lib_sqlite.VtabCurs.attrs comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.attrs_elems+1))) { + FatalErrorExit("lib_sqlite.bad_insary field:lib_sqlite.VtabCurs.attrs comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.attrs_n - at; + attrs_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.attrs_elems + at + nnew + i) algo::cstring(parent.attrs_elems[at + i]); + parent.attrs_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.attrs_elems + at + i) algo::cstring(rhs[i]); + } + parent.attrs_n += nnew; +} + // --- lib_sqlite.VtabCurs..Init // Set all fields to initial values. void lib_sqlite::VtabCurs_Init(lib_sqlite::VtabCurs& parent) { diff --git a/cpp/gen/lib_ws_gen.cpp b/cpp/gen/lib_ws_gen.cpp new file mode 100644 index 00000000..106f3d72 --- /dev/null +++ b/cpp/gen/lib_ws_gen.cpp @@ -0,0 +1,620 @@ +// +// cpp/gen/lib_ws_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/lib_ws_gen.h" +#include "include/gen/lib_ws_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +#include "include/gen/ws_gen.h" +#include "include/gen/ws_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/lib_prot_gen.h" +#include "include/gen/lib_prot_gen.inl.h" +//#pragma endinclude +namespace lib_ws { // gen:ns_print_proto + // Load statically available data into tables, register tables and database. + // func:lib_ws.FDb._db.InitReflection + static void InitReflection(); + // find trace by row id (used to implement reflection) + // func:lib_ws.FDb.trace.RowidFind + static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); + // Function return 1 + // func:lib_ws.FDb.trace.N + inline static i32 trace_N() __attribute__((__warn_unused_result__, nothrow, pure)); + // func:lib_ws...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- lib_ws.trace..Print +// print string representation of ROW to string STR +// cfmt:lib_ws.trace.String printfmt:Tuple +void lib_ws::trace_Print(lib_ws::trace& row, algo::cstring& str) { + algo::tempstr temp; + str << "lib_ws.trace"; + (void)row;//only to avoid -Wunused-parameter +} + +// --- lib_ws.FDb._db.InitReflection +// Load statically available data into tables, register tables and database. +static void lib_ws::InitReflection() { + algo_lib::imdb_InsertMaybe(algo::Imdb("lib_ws", NULL, NULL, NULL, NULL, algo::Comment())); + + algo::Imtable t_trace; + t_trace.imtable = "lib_ws.trace"; + t_trace.ssimfile = ""; + t_trace.size = sizeof(lib_ws::trace); + t_trace.comment.value = ""; + t_trace.c_RowidFind = trace_RowidFind; + t_trace.NItems = trace_N; + t_trace.Print = (algo::ImrowPrintFcn)lib_ws::trace_Print; + algo_lib::imtable_InsertMaybe(t_trace); + + + // -- load signatures of existing dispatches -- + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'lib_ws.FrameIdx' signature:'16e074d027eb2e98445e4bdbaad025f92c98e679'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'lib_ws.FrameLen' signature:'16e074d027eb2e98445e4bdbaad025f92c98e679'"); +} + +// --- lib_ws.FDb._db.InsertStrptrMaybe +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +bool lib_ws::InsertStrptrMaybe(algo::strptr str) { + bool retval = true; + (void)str;//only to avoid -Wunused-parameter + return retval; +} + +// --- lib_ws.FDb._db.LoadTuplesMaybe +// Load all finputs from given directory. +bool lib_ws::LoadTuplesMaybe(algo::strptr root, bool recursive) { + bool retval = true; + if (FileQ(root)) { + retval = lib_ws::LoadTuplesFile(root, recursive); + } else if (root == "-") { + retval = lib_ws::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); + } else if (DirectoryQ(root)) { + retval = retval && lib_ws::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); + } else { + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); + retval = false; + } + return retval; +} + +// --- lib_ws.FDb._db.LoadTuplesFile +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +bool lib_ws::LoadTuplesFile(algo::strptr fname, bool recursive) { + bool retval = true; + algo_lib::FFildes fildes; + // missing files are not an error + fildes.fd = OpenRead(fname,algo::FileFlags()); + if (ValidQ(fildes.fd)) { + retval = LoadTuplesFd(fildes.fd, fname, recursive); + } + return retval; +} + +// --- lib_ws.FDb._db.LoadTuplesFd +// Load all finputs from given file descriptor. +bool lib_ws::LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) { + bool retval = true; + ind_beg(algo::FileLine_curs,line,fd) { + if (recursive) { + retval = retval && algo_lib::InsertStrptrMaybe(line); + } + if (!retval) { + algo_lib::_db.errtext << eol + << fname << ":" + << (ind_curs(line).i+1) + << ": " << line << eol; + break; + } + }ind_end; + return retval; +} + +// --- lib_ws.FDb._db.LoadSsimfileMaybe +// Load specified ssimfile. +bool lib_ws::LoadSsimfileMaybe(algo::strptr fname, bool recursive) { + bool retval = true; + if (FileQ(fname)) { + retval = lib_ws::LoadTuplesFile(fname, recursive); + } + return retval; +} + +// --- lib_ws.FDb._db.Steps +// Calls Step function of dependencies +void lib_ws::Steps() { + algo_lib::Step(); // dependent namespace specified via (dev.targdep) +} + +// --- lib_ws.FDb._db.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool lib_ws::_db_XrefMaybe() { + bool retval = true; + return retval; +} + +// --- lib_ws.FDb.trace.RowidFind +// find trace by row id (used to implement reflection) +static algo::ImrowPtr lib_ws::trace_RowidFind(int t) { + return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +} + +// --- lib_ws.FDb.trace.N +// Function return 1 +inline static i32 lib_ws::trace_N() { + return 1; +} + +// --- lib_ws.FDb..Init +// Set all fields to initial values. +void lib_ws::FDb_Init() { + + lib_ws::InitReflection(); +} + +// --- lib_ws.FieldId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* lib_ws::value_ToCstr(const lib_ws::FieldId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case lib_ws_FieldId_value : ret = "value"; break; + } + return ret; +} + +// --- lib_ws.FieldId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void lib_ws::value_Print(const lib_ws::FieldId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- lib_ws.FieldId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool lib_ws::value_SetStrptrMaybe(lib_ws::FieldId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,lib_ws_FieldId_value); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- lib_ws.FieldId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void lib_ws::value_SetStrptr(lib_ws::FieldId& parent, algo::strptr rhs, lib_ws_FieldIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- lib_ws.FieldId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool lib_ws::value_ReadStrptrMaybe(lib_ws::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- lib_ws.FieldId..ReadStrptrMaybe +// Read fields of lib_ws::FieldId from an ascii string. +// The format of the string is the format of the lib_ws::FieldId's only field +bool lib_ws::FieldId_ReadStrptrMaybe(lib_ws::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- lib_ws.FieldId..Print +// print string representation of ROW to string STR +// cfmt:lib_ws.FieldId.String printfmt:Raw +void lib_ws::FieldId_Print(lib_ws::FieldId& row, algo::cstring& str) { + lib_ws::value_Print(row, str); +} + +// --- lib_ws.FrameIdx..DispatchRaw +int lib_ws::FrameIdxDispatchRaw(lib_ws::FrameIdx &ctx, lib_ws::FrameIdxCase type, u8 *msg, u32 len) { + int ret = 0; + switch(type) { + case 126: if (sizeof(ws::Frame16) <= len) { + lib_ws::FrameIdx_Frame16(ctx, (ws::Frame16&)*msg, len); + ret = (int)sizeof(ws::Frame16); + } break; + case 127: if (sizeof(ws::Frame64) <= len) { + lib_ws::FrameIdx_Frame64(ctx, (ws::Frame64&)*msg, len); + ret = (int)sizeof(ws::Frame64); + } break; + case 254: if (sizeof(ws::FrameMasked16) <= len) { + lib_ws::FrameIdx_FrameMasked16(ctx, (ws::FrameMasked16&)*msg, len); + ret = (int)sizeof(ws::FrameMasked16); + } break; + case 255: if (sizeof(ws::FrameMasked64) <= len) { + lib_ws::FrameIdx_FrameMasked64(ctx, (ws::FrameMasked64&)*msg, len); + ret = (int)sizeof(ws::FrameMasked64); + } break; + default: + ret = lib_ws::FrameIdx_Unkmsg(ctx, *(ws::FrameHeader*)msg, len); + } + return ret; +} + +// --- lib_ws.FrameIdx..Dispatch +int lib_ws::FrameIdxDispatch(lib_ws::FrameIdx &ctx, ws::FrameHeader& msg, u32 msg_len) { + return FrameIdxDispatchRaw(ctx, lib_ws::FrameIdxCase(msg.byte1), (u8*)&msg, msg_len); +} + +// --- lib_ws.FrameIdx..Dispatch2 +// void rettype useful for hooks +void lib_ws::vFrameIdxDispatch(lib_ws::FrameIdx &ctx, ws::FrameHeader& msg, u32 msg_len) { + FrameIdxDispatch(ctx, msg, msg_len); +} + +// --- lib_ws.FrameIdxCase.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* lib_ws::value_ToCstr(const lib_ws::FrameIdxCase& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case lib_ws_FrameIdxCase_ws_Frame16: ret = "ws.Frame16"; break; + case lib_ws_FrameIdxCase_ws_Frame64: ret = "ws.Frame64"; break; + case lib_ws_FrameIdxCase_ws_FrameMasked16: ret = "ws.FrameMasked16"; break; + case lib_ws_FrameIdxCase_ws_FrameMasked64: ret = "ws.FrameMasked64"; break; + } + return ret; +} + +// --- lib_ws.FrameIdxCase.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void lib_ws::value_Print(const lib_ws::FrameIdxCase& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- lib_ws.FrameIdxCase.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool lib_ws::value_SetStrptrMaybe(lib_ws::FrameIdxCase& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 10: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('w','s','.','F','r','a','m','e'): { + if (memcmp(rhs.elems+8,"16",2)==0) { value_SetEnum(parent,lib_ws_FrameIdxCase_ws_Frame16); ret = true; break; } + if (memcmp(rhs.elems+8,"64",2)==0) { value_SetEnum(parent,lib_ws_FrameIdxCase_ws_Frame64); ret = true; break; } + break; + } + } + break; + } + case 16: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('w','s','.','F','r','a','m','e'): { + if (memcmp(rhs.elems+8,"Masked16",8)==0) { value_SetEnum(parent,lib_ws_FrameIdxCase_ws_FrameMasked16); ret = true; break; } + if (memcmp(rhs.elems+8,"Masked64",8)==0) { value_SetEnum(parent,lib_ws_FrameIdxCase_ws_FrameMasked64); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- lib_ws.FrameIdxCase.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void lib_ws::value_SetStrptr(lib_ws::FrameIdxCase& parent, algo::strptr rhs, lib_ws_FrameIdxCaseEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- lib_ws.FrameIdxCase.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool lib_ws::value_ReadStrptrMaybe(lib_ws::FrameIdxCase& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- lib_ws.FrameIdxCase..ReadStrptrMaybe +// Read fields of lib_ws::FrameIdxCase from an ascii string. +// The format of the string is the format of the lib_ws::FrameIdxCase's only field +bool lib_ws::FrameIdxCase_ReadStrptrMaybe(lib_ws::FrameIdxCase &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- lib_ws.FrameLenCase.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* lib_ws::value_ToCstr(const lib_ws::FrameLenCase& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case lib_ws_FrameLenCase_ws_Frame16: ret = "ws.Frame16"; break; + case lib_ws_FrameLenCase_ws_Frame64: ret = "ws.Frame64"; break; + case lib_ws_FrameLenCase_ws_FrameMasked16: ret = "ws.FrameMasked16"; break; + case lib_ws_FrameLenCase_ws_FrameMasked64: ret = "ws.FrameMasked64"; break; + } + return ret; +} + +// --- lib_ws.FrameLenCase.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void lib_ws::value_Print(const lib_ws::FrameLenCase& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- lib_ws.FrameLenCase.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool lib_ws::value_SetStrptrMaybe(lib_ws::FrameLenCase& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 10: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('w','s','.','F','r','a','m','e'): { + if (memcmp(rhs.elems+8,"16",2)==0) { value_SetEnum(parent,lib_ws_FrameLenCase_ws_Frame16); ret = true; break; } + if (memcmp(rhs.elems+8,"64",2)==0) { value_SetEnum(parent,lib_ws_FrameLenCase_ws_Frame64); ret = true; break; } + break; + } + } + break; + } + case 16: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('w','s','.','F','r','a','m','e'): { + if (memcmp(rhs.elems+8,"Masked16",8)==0) { value_SetEnum(parent,lib_ws_FrameLenCase_ws_FrameMasked16); ret = true; break; } + if (memcmp(rhs.elems+8,"Masked64",8)==0) { value_SetEnum(parent,lib_ws_FrameLenCase_ws_FrameMasked64); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- lib_ws.FrameLenCase.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void lib_ws::value_SetStrptr(lib_ws::FrameLenCase& parent, algo::strptr rhs, lib_ws_FrameLenCaseEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- lib_ws.FrameLenCase.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool lib_ws::value_ReadStrptrMaybe(lib_ws::FrameLenCase& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- lib_ws.FrameLenCase..ReadStrptrMaybe +// Read fields of lib_ws::FrameLenCase from an ascii string. +// The format of the string is the format of the lib_ws::FrameLenCase's only field +bool lib_ws::FrameLenCase_ReadStrptrMaybe(lib_ws::FrameLenCase &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- lib_ws...SizeCheck +inline static void lib_ws::SizeCheck() { +} + +// --- lib_ws...StaticCheck +void lib_ws::StaticCheck() { + algo_assert(_offset_of(lib_ws::FieldId, value) + sizeof(((lib_ws::FieldId*)0)->value) == sizeof(lib_ws::FieldId)); + algo_assert(_offset_of(lib_ws::FrameIdxCase, value) + sizeof(((lib_ws::FrameIdxCase*)0)->value) == sizeof(lib_ws::FrameIdxCase)); + algo_assert(_offset_of(lib_ws::FrameLenCase, value) + sizeof(((lib_ws::FrameLenCase*)0)->value) == sizeof(lib_ws::FrameLenCase)); +} + +// --- lib_ws.FrameLen..DispatchRaw +int lib_ws::FrameLenDispatchRaw(i32 &ctx, lib_ws::FrameLenCase type, u8 *msg, u32 len) { + int ret = 0; + switch(type) { + case 126: if (sizeof(ws::Frame16) <= len) { + lib_ws::FrameLen_Frame16(ctx, (ws::Frame16&)*msg, len); + ret = (int)sizeof(ws::Frame16); + } break; + case 127: if (sizeof(ws::Frame64) <= len) { + lib_ws::FrameLen_Frame64(ctx, (ws::Frame64&)*msg, len); + ret = (int)sizeof(ws::Frame64); + } break; + case 254: if (sizeof(ws::FrameMasked16) <= len) { + lib_ws::FrameLen_FrameMasked16(ctx, (ws::FrameMasked16&)*msg, len); + ret = (int)sizeof(ws::FrameMasked16); + } break; + case 255: if (sizeof(ws::FrameMasked64) <= len) { + lib_ws::FrameLen_FrameMasked64(ctx, (ws::FrameMasked64&)*msg, len); + ret = (int)sizeof(ws::FrameMasked64); + } break; + default: + ret = lib_ws::FrameLen_Unkmsg(ctx, *(ws::FrameHeader*)msg, len); + } + return ret; +} + +// --- lib_ws.FrameLen..Dispatch +int lib_ws::FrameLenDispatch(i32 &ctx, ws::FrameHeader& msg, u32 msg_len) { + return FrameLenDispatchRaw(ctx, lib_ws::FrameLenCase(msg.byte1), (u8*)&msg, msg_len); +} + +// --- lib_ws.FrameLen..Dispatch2 +// void rettype useful for hooks +void lib_ws::vFrameLenDispatch(i32 &ctx, ws::FrameHeader& msg, u32 msg_len) { + FrameLenDispatch(ctx, msg, msg_len); +} + +// --- lib_ws...Frame_FmtByteAry +// Construct a new ws::Frame in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +ws::Frame * lib_ws::Frame_FmtByteAry(algo::ByteAry &buf, u8 byte0, u8 byte1, algo::aryptr payload) { + ws::Frame *msg = NULL; + size_t len = sizeof(ws::Frame); + u32 payload_ary_len = elems_N(payload) * sizeof(char); + len += payload_ary_len; + ary_RemoveAll(buf); + msg = (ws::Frame*)ary_AllocN(buf,len).elems; + msg->byte0 = byte0; + msg->byte1 = byte1; + memcpy(payload_Addr(*msg), payload.elems, payload_ary_len); + return msg; +} + +// --- lib_ws...Frame16_FmtByteAry +// Construct a new ws::Frame16 in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +ws::Frame16 * lib_ws::Frame16_FmtByteAry(algo::ByteAry &buf, u8 byte0, algo::aryptr payload) { + ws::Frame16 *msg = NULL; + size_t len = sizeof(ws::Frame16); + u32 payload_ary_len = elems_N(payload) * sizeof(char); + len += payload_ary_len; + ary_RemoveAll(buf); + msg = (ws::Frame16*)ary_AllocN(buf,len).elems; + msg->byte0 = byte0; + msg->byte1 = u8(126); + ext_payload_len_Set(*msg, u16(len + (-4))); + memcpy(payload_Addr(*msg), payload.elems, payload_ary_len); + return msg; +} + +// --- lib_ws...Frame64_FmtByteAry +// Construct a new ws::Frame64 in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +ws::Frame64 * lib_ws::Frame64_FmtByteAry(algo::ByteAry &buf, u8 byte0, algo::aryptr payload) { + ws::Frame64 *msg = NULL; + size_t len = sizeof(ws::Frame64); + u32 payload_ary_len = elems_N(payload) * sizeof(char); + len += payload_ary_len; + ary_RemoveAll(buf); + msg = (ws::Frame64*)ary_AllocN(buf,len).elems; + msg->byte0 = byte0; + msg->byte1 = u8(127); + ext_payload_len_Set(*msg, u64(len + (-10))); + memcpy(payload_Addr(*msg), payload.elems, payload_ary_len); + return msg; +} + +// --- lib_ws...FrameMasked_FmtByteAry +// Construct a new ws::FrameMasked in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +ws::FrameMasked * lib_ws::FrameMasked_FmtByteAry(algo::ByteAry &buf, u8 byte0, u8 byte1, u32 masking_key, algo::aryptr payload) { + ws::FrameMasked *msg = NULL; + size_t len = sizeof(ws::FrameMasked); + u32 payload_ary_len = elems_N(payload) * sizeof(char); + len += payload_ary_len; + ary_RemoveAll(buf); + msg = (ws::FrameMasked*)ary_AllocN(buf,len).elems; + msg->byte0 = byte0; + msg->byte1 = byte1; + msg->masking_key = masking_key; + memcpy(payload_Addr(*msg), payload.elems, payload_ary_len); + return msg; +} + +// --- lib_ws...FrameMasked16_FmtByteAry +// Construct a new ws::FrameMasked16 in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +ws::FrameMasked16 * lib_ws::FrameMasked16_FmtByteAry(algo::ByteAry &buf, u8 byte0, u32 masking_key, algo::aryptr payload) { + ws::FrameMasked16 *msg = NULL; + size_t len = sizeof(ws::FrameMasked16); + u32 payload_ary_len = elems_N(payload) * sizeof(char); + len += payload_ary_len; + ary_RemoveAll(buf); + msg = (ws::FrameMasked16*)ary_AllocN(buf,len).elems; + msg->byte0 = byte0; + msg->byte1 = u8(254); + ext_payload_len_Set(*msg, u16(len + (-8))); + msg->masking_key = masking_key; + memcpy(payload_Addr(*msg), payload.elems, payload_ary_len); + return msg; +} + +// --- lib_ws...FrameMasked64_FmtByteAry +// Construct a new ws::FrameMasked64 in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +ws::FrameMasked64 * lib_ws::FrameMasked64_FmtByteAry(algo::ByteAry &buf, u8 byte0, u32 masking_key, algo::aryptr payload) { + ws::FrameMasked64 *msg = NULL; + size_t len = sizeof(ws::FrameMasked64); + u32 payload_ary_len = elems_N(payload) * sizeof(char); + len += payload_ary_len; + ary_RemoveAll(buf); + msg = (ws::FrameMasked64*)ary_AllocN(buf,len).elems; + msg->byte0 = byte0; + msg->byte1 = u8(255); + ext_payload_len_Set(*msg, u64(len + (-14))); + msg->masking_key = masking_key; + memcpy(payload_Addr(*msg), payload.elems, payload_ary_len); + return msg; +} diff --git a/cpp/gen/mdbg_gen.cpp b/cpp/gen/mdbg_gen.cpp index 5086acb5..3d95164e 100644 --- a/cpp/gen/mdbg_gen.cpp +++ b/cpp/gen/mdbg_gen.cpp @@ -31,12 +31,15 @@ #include "include/gen/algo_gen.inl.h" #include "include/gen/command_gen.h" #include "include/gen/command_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep mdbg::FDb mdbg::_db; // dependency found via dev.targdep @@ -51,17 +54,19 @@ const char *mdbg_help = " -cfg string \"debug\" Configuration to use\n" " -disas Show disassembly (use F12)\n" " -attach Attach to a running process\n" +" -pid int 0 (with -attach) Pid, if omitted mdbg will guess\n" " -b... string Set breakpoint, e.g. 'a.cpp:123 if cond1', 'func#3'\n" " -catchthrow Y Stop on exceptions\n" " -tui Use gdb -tui as the debugger\n" " -bcmd string \"\" Evaluate command at breakpoint\n" " -emacs Y Use emacs environment as the debugger\n" " -manywin Use gdb-many-windows emacs mode\n" -" -follow_child\n" +" -follow_child When forking, follow child (default is parent)\n" " -py Enable python scripting\n" " -dry_run Print commands but don't execute\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -mp Multi-process debugging\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -154,15 +159,11 @@ void mdbg::cfg_CopyIn(mdbg::FCfg &row, dev::Cfg &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void mdbg::c_builddir_Insert(mdbg::FCfg& cfg, mdbg::FBuilddir& row) { - if (bool_Update(row.cfg_c_builddir_in_ary,true)) { - // reserve space + if (!row.cfg_c_builddir_in_ary) { c_builddir_Reserve(cfg, 1); - u32 n = cfg.c_builddir_n; - u32 at = n; - mdbg::FBuilddir* *elems = cfg.c_builddir_elems; - elems[at] = &row; - cfg.c_builddir_n = n+1; - + u32 n = cfg.c_builddir_n++; + cfg.c_builddir_elems[n] = &row; + row.cfg_c_builddir_in_ary = true; } } @@ -171,7 +172,7 @@ void mdbg::c_builddir_Insert(mdbg::FCfg& cfg, mdbg::FBuilddir& row) { // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool mdbg::c_builddir_InsertMaybe(mdbg::FCfg& cfg, mdbg::FBuilddir& row) { - bool retval = !row.cfg_c_builddir_in_ary; + bool retval = !cfg_c_builddir_InAryQ(row); c_builddir_Insert(cfg,row); // check is performed in _Insert again return retval; } @@ -179,18 +180,18 @@ bool mdbg::c_builddir_InsertMaybe(mdbg::FCfg& cfg, mdbg::FBuilddir& row) { // --- mdbg.FCfg.c_builddir.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void mdbg::c_builddir_Remove(mdbg::FCfg& cfg, mdbg::FBuilddir& row) { + int n = cfg.c_builddir_n; if (bool_Update(row.cfg_c_builddir_in_ary,false)) { - int lim = cfg.c_builddir_n; mdbg::FBuilddir* *elems = cfg.c_builddir_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { mdbg::FBuilddir* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(mdbg::FBuilddir*) * (lim - j); + size_t nbytes = sizeof(mdbg::FBuilddir*) * (n - j); memmove(elems + i, elems + j, nbytes); - cfg.c_builddir_n = lim - 1; + cfg.c_builddir_n = n - 1; break; } } @@ -441,9 +442,8 @@ void mdbg::ReadArgv() { } if (ch_N(attrname) == 0) { err << "mdbg: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { if (!target_present) { err << "mdbg: Missing value for required argument -target (see -help)" << eol; @@ -502,7 +505,7 @@ void mdbg::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -592,8 +595,8 @@ bool mdbg::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && mdbg::LoadTuplesFile(algo::SsimFname(root,"dev.cfg"),recursive); retval = retval && mdbg::LoadTuplesFile(algo::SsimFname(root,"dev.builddir"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -772,14 +775,9 @@ bool mdbg::cfg_XrefMaybe(mdbg::FCfg &row) { // Find row by key. Return NULL if not found. mdbg::FCfg* mdbg::ind_cfg_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_cfg_buckets_n - 1); - mdbg::FCfg* *e = &_db.ind_cfg_buckets_elems[index]; - mdbg::FCfg* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).cfg == key; - if (done) break; - e = &ret->ind_cfg_next; - } while (true); + mdbg::FCfg *ret = _db.ind_cfg_buckets_elems[index]; + for (; ret && !((*ret).cfg == key); ret = ret->ind_cfg_next) { + } return ret; } @@ -803,10 +801,11 @@ mdbg::FCfg& mdbg::ind_cfg_GetOrCreate(const algo::strptr& key) { // --- mdbg.FDb.ind_cfg.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool mdbg::ind_cfg_InsertMaybe(mdbg::FCfg& row) { - ind_cfg_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_cfg_next == (mdbg::FCfg*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.cfg) & (_db.ind_cfg_buckets_n - 1); + row.ind_cfg_hashval = algo::Smallstr50_Hash(0, row.cfg); + ind_cfg_Reserve(1); + u32 index = row.ind_cfg_hashval & (_db.ind_cfg_buckets_n - 1); mdbg::FCfg* *prev = &_db.ind_cfg_buckets_elems[index]; do { mdbg::FCfg* ret = *prev; @@ -832,7 +831,7 @@ bool mdbg::ind_cfg_InsertMaybe(mdbg::FCfg& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void mdbg::ind_cfg_Remove(mdbg::FCfg& row) { if (LIKELY(row.ind_cfg_next != (mdbg::FCfg*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.cfg) & (_db.ind_cfg_buckets_n - 1); + u32 index = row.ind_cfg_hashval & (_db.ind_cfg_buckets_n - 1); mdbg::FCfg* *prev = &_db.ind_cfg_buckets_elems[index]; // addr of pointer to current element while (mdbg::FCfg *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -849,8 +848,14 @@ void mdbg::ind_cfg_Remove(mdbg::FCfg& row) { // --- mdbg.FDb.ind_cfg.Reserve // Reserve enough room in the hash for N more elements. Return success code. void mdbg::ind_cfg_Reserve(int n) { + ind_cfg_AbsReserve(_db.ind_cfg_n + n); +} + +// --- mdbg.FDb.ind_cfg.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void mdbg::ind_cfg_AbsReserve(int n) { u32 old_nbuckets = _db.ind_cfg_buckets_n; - u32 new_nelems = _db.ind_cfg_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -869,7 +874,7 @@ void mdbg::ind_cfg_Reserve(int n) { while (elem) { mdbg::FCfg &row = *elem; mdbg::FCfg* next = row.ind_cfg_next; - u32 index = algo::Smallstr50_Hash(0, row.cfg) & (new_nbuckets-1); + u32 index = row.ind_cfg_hashval & (new_nbuckets-1); row.ind_cfg_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1236,11 +1241,13 @@ void mdbg::StaticCheck() { // --- mdbg...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); mdbg::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock mdbg::ReadArgv(); // dmmeta.main:mdbg mdbg::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -1253,6 +1260,7 @@ int main(int argc, char **argv) { try { mdbg::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/mysql2ssim_gen.cpp b/cpp/gen/mysql2ssim_gen.cpp index 758671fa..6f3bf825 100644 --- a/cpp/gen/mysql2ssim_gen.cpp +++ b/cpp/gen/mysql2ssim_gen.cpp @@ -29,12 +29,15 @@ #include "include/gen/command_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/lib_mysql_gen.h" #include "include/gen/lib_mysql_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_mysql::FDb lib_mysql::_db; // dependency found via dev.targdep mysql2ssim::FDb mysql2ssim::_db; // dependency found via dev.targdep @@ -52,8 +55,8 @@ const char *mysql2ssim_help = " -pretty Format output for the screen\n" " -nologo Don't show copyright notice\n" " -baddbok Don't claim if bad database\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -171,9 +174,8 @@ void mysql2ssim::ReadArgv() { } if (ch_N(attrname) == 0) { err << "mysql2ssim: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { if (!url_present) { err << "mysql2ssim: Missing value for required argument -url (see -help)" << eol; @@ -225,7 +230,7 @@ void mysql2ssim::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -292,8 +297,8 @@ bool mysql2ssim::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && mysql2ssim::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -422,6 +427,25 @@ algo::aryptr mysql2ssim::table_names_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- mysql2ssim.FDb.table_names.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr mysql2ssim::table_names_AllocNAt(int n_elems, int at) { + table_names_Reserve(n_elems); + int n = _db.table_names_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("mysql2ssim.bad_alloc_n_at field:mysql2ssim.FDb.table_names comment:'index out of range'"); + } + algo::cstring *elems = _db.table_names_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + _db.table_names_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- mysql2ssim.FDb.table_names.Remove // Remove item by index. If index outside of range, do nothing. void mysql2ssim::table_names_Remove(u32 i) { @@ -498,6 +522,30 @@ bool mysql2ssim::table_names_ReadStrptrMaybe(algo::strptr in_str) { return retval; } +// --- mysql2ssim.FDb.table_names.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void mysql2ssim::table_names_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.table_names_elems && rhs.elems < _db.table_names_elems + _db.table_names_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("mysql2ssim.tary_alias field:mysql2ssim.FDb.table_names comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.table_names_elems+1))) { + FatalErrorExit("mysql2ssim.bad_insary field:mysql2ssim.FDb.table_names comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.table_names_n - at; + table_names_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.table_names_elems + at + nnew + i) algo::cstring(_db.table_names_elems[at + i]); + _db.table_names_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.table_names_elems + at + i) algo::cstring(rhs[i]); + } + _db.table_names_n += nnew; +} + // --- mysql2ssim.FDb.in_tables.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -560,6 +608,25 @@ algo::aryptr mysql2ssim::in_tables_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- mysql2ssim.FDb.in_tables.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr mysql2ssim::in_tables_AllocNAt(int n_elems, int at) { + in_tables_Reserve(n_elems); + int n = _db.in_tables_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("mysql2ssim.bad_alloc_n_at field:mysql2ssim.FDb.in_tables comment:'index out of range'"); + } + algo::cstring *elems = _db.in_tables_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + _db.in_tables_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- mysql2ssim.FDb.in_tables.Remove // Remove item by index. If index outside of range, do nothing. void mysql2ssim::in_tables_Remove(u32 i) { @@ -636,6 +703,30 @@ bool mysql2ssim::in_tables_ReadStrptrMaybe(algo::strptr in_str) { return retval; } +// --- mysql2ssim.FDb.in_tables.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void mysql2ssim::in_tables_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.in_tables_elems && rhs.elems < _db.in_tables_elems + _db.in_tables_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("mysql2ssim.tary_alias field:mysql2ssim.FDb.in_tables comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.in_tables_elems+1))) { + FatalErrorExit("mysql2ssim.bad_insary field:mysql2ssim.FDb.in_tables comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.in_tables_n - at; + in_tables_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.in_tables_elems + at + nnew + i) algo::cstring(_db.in_tables_elems[at + i]); + _db.in_tables_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.in_tables_elems + at + i) algo::cstring(rhs[i]); + } + _db.in_tables_n += nnew; +} + // --- mysql2ssim.FDb.trace.RowidFind // find trace by row id (used to implement reflection) static algo::ImrowPtr mysql2ssim::trace_RowidFind(int t) { @@ -740,6 +831,25 @@ algo::aryptr mysql2ssim::vals_AllocN(mysql2ssim::FTobltin& parent return algo::aryptr(elems + old_n, n_elems); } +// --- mysql2ssim.FTobltin.vals.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr mysql2ssim::vals_AllocNAt(mysql2ssim::FTobltin& parent, int n_elems, int at) { + vals_Reserve(parent, n_elems); + int n = parent.vals_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("mysql2ssim.bad_alloc_n_at field:mysql2ssim.FTobltin.vals comment:'index out of range'"); + } + algo::cstring *elems = parent.vals_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + parent.vals_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- mysql2ssim.FTobltin.vals.Remove // Remove item by index. If index outside of range, do nothing. void mysql2ssim::vals_Remove(mysql2ssim::FTobltin& parent, u32 i) { @@ -836,6 +946,30 @@ bool mysql2ssim::vals_ReadStrptrMaybe(mysql2ssim::FTobltin& parent, algo::strptr return retval; } +// --- mysql2ssim.FTobltin.vals.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void mysql2ssim::vals_Insary(mysql2ssim::FTobltin& parent, algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= parent.vals_elems && rhs.elems < parent.vals_elems + parent.vals_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("mysql2ssim.tary_alias field:mysql2ssim.FTobltin.vals comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(parent.vals_elems+1))) { + FatalErrorExit("mysql2ssim.bad_insary field:mysql2ssim.FTobltin.vals comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = parent.vals_n - at; + vals_Reserve(parent, nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (parent.vals_elems + at + nnew + i) algo::cstring(parent.vals_elems[at + i]); + parent.vals_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (parent.vals_elems + at + i) algo::cstring(rhs[i]); + } + parent.vals_n += nnew; +} + // --- mysql2ssim.FTobltin..Uninit void mysql2ssim::FTobltin_Uninit(mysql2ssim::FTobltin& parent) { mysql2ssim::FTobltin &row = parent; (void)row; @@ -954,12 +1088,14 @@ void mysql2ssim::StaticCheck() { // --- mysql2ssim...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); lib_mysql::FDb_Init(); mysql2ssim::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock mysql2ssim::ReadArgv(); // dmmeta.main:mysql2ssim mysql2ssim::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -973,6 +1109,7 @@ int main(int argc, char **argv) { mysql2ssim::FDb_Uninit(); lib_mysql::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/orgfile_gen.cpp b/cpp/gen/orgfile_gen.cpp index 4c775749..b481d529 100644 --- a/cpp/gen/orgfile_gen.cpp +++ b/cpp/gen/orgfile_gen.cpp @@ -31,12 +31,15 @@ #include "include/gen/algo_gen.inl.h" #include "include/gen/dev_gen.h" #include "include/gen/dev_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep orgfile::FDb orgfile::_db; // dependency found via dev.targdep @@ -51,8 +54,8 @@ const char *orgfile_help = " -commit Apply changes\n" " -undo Read previous orgfile output, undoing movement\n" " -hash string \"sha1\" Hash command to use for deduplication\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -154,9 +157,8 @@ void orgfile::ReadArgv() { } if (ch_N(attrname) == 0) { err << "orgfile: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:orgfile.FDb.cmdline @@ -210,7 +215,7 @@ void orgfile::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -293,8 +298,8 @@ bool orgfile::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && orgfile::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); retval = retval && orgfile::LoadTuplesFile(algo::SsimFname(root,"dev.timefmt"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -483,14 +488,9 @@ bool orgfile::filename_XrefMaybe(orgfile::FFilename &row) { // Find row by key. Return NULL if not found. orgfile::FFilename* orgfile::ind_filename_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_filename_buckets_n - 1); - orgfile::FFilename* *e = &_db.ind_filename_buckets_elems[index]; - orgfile::FFilename* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).filename == key; - if (done) break; - e = &ret->ind_filename_next; - } while (true); + orgfile::FFilename *ret = _db.ind_filename_buckets_elems[index]; + for (; ret && !((*ret).filename == key); ret = ret->ind_filename_next) { + } return ret; } @@ -505,10 +505,11 @@ orgfile::FFilename& orgfile::ind_filename_FindX(const algo::strptr& key) { // --- orgfile.FDb.ind_filename.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool orgfile::ind_filename_InsertMaybe(orgfile::FFilename& row) { - ind_filename_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_filename_next == (orgfile::FFilename*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.filename) & (_db.ind_filename_buckets_n - 1); + row.ind_filename_hashval = algo::cstring_Hash(0, row.filename); + ind_filename_Reserve(1); + u32 index = row.ind_filename_hashval & (_db.ind_filename_buckets_n - 1); orgfile::FFilename* *prev = &_db.ind_filename_buckets_elems[index]; do { orgfile::FFilename* ret = *prev; @@ -534,7 +535,7 @@ bool orgfile::ind_filename_InsertMaybe(orgfile::FFilename& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void orgfile::ind_filename_Remove(orgfile::FFilename& row) { if (LIKELY(row.ind_filename_next != (orgfile::FFilename*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.filename) & (_db.ind_filename_buckets_n - 1); + u32 index = row.ind_filename_hashval & (_db.ind_filename_buckets_n - 1); orgfile::FFilename* *prev = &_db.ind_filename_buckets_elems[index]; // addr of pointer to current element while (orgfile::FFilename *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -551,8 +552,14 @@ void orgfile::ind_filename_Remove(orgfile::FFilename& row) { // --- orgfile.FDb.ind_filename.Reserve // Reserve enough room in the hash for N more elements. Return success code. void orgfile::ind_filename_Reserve(int n) { + ind_filename_AbsReserve(_db.ind_filename_n + n); +} + +// --- orgfile.FDb.ind_filename.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void orgfile::ind_filename_AbsReserve(int n) { u32 old_nbuckets = _db.ind_filename_buckets_n; - u32 new_nelems = _db.ind_filename_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -571,7 +578,7 @@ void orgfile::ind_filename_Reserve(int n) { while (elem) { orgfile::FFilename &row = *elem; orgfile::FFilename* next = row.ind_filename_next; - u32 index = algo::cstring_Hash(0, row.filename) & (new_nbuckets-1); + u32 index = row.ind_filename_hashval & (new_nbuckets-1); row.ind_filename_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -674,14 +681,9 @@ bool orgfile::filehash_XrefMaybe(orgfile::FFilehash &row) { // Find row by key. Return NULL if not found. orgfile::FFilehash* orgfile::ind_filehash_Find(const algo::strptr& key) { u32 index = algo::Smallstr40_Hash(0, key) & (_db.ind_filehash_buckets_n - 1); - orgfile::FFilehash* *e = &_db.ind_filehash_buckets_elems[index]; - orgfile::FFilehash* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).filehash == key; - if (done) break; - e = &ret->ind_filehash_next; - } while (true); + orgfile::FFilehash *ret = _db.ind_filehash_buckets_elems[index]; + for (; ret && !((*ret).filehash == key); ret = ret->ind_filehash_next) { + } return ret; } @@ -713,10 +715,11 @@ orgfile::FFilehash& orgfile::ind_filehash_GetOrCreate(const algo::strptr& key) { // --- orgfile.FDb.ind_filehash.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool orgfile::ind_filehash_InsertMaybe(orgfile::FFilehash& row) { - ind_filehash_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_filehash_next == (orgfile::FFilehash*)-1)) {// check if in hash already - u32 index = algo::Smallstr40_Hash(0, row.filehash) & (_db.ind_filehash_buckets_n - 1); + row.ind_filehash_hashval = algo::Smallstr40_Hash(0, row.filehash); + ind_filehash_Reserve(1); + u32 index = row.ind_filehash_hashval & (_db.ind_filehash_buckets_n - 1); orgfile::FFilehash* *prev = &_db.ind_filehash_buckets_elems[index]; do { orgfile::FFilehash* ret = *prev; @@ -742,7 +745,7 @@ bool orgfile::ind_filehash_InsertMaybe(orgfile::FFilehash& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void orgfile::ind_filehash_Remove(orgfile::FFilehash& row) { if (LIKELY(row.ind_filehash_next != (orgfile::FFilehash*)-1)) {// check if in hash already - u32 index = algo::Smallstr40_Hash(0, row.filehash) & (_db.ind_filehash_buckets_n - 1); + u32 index = row.ind_filehash_hashval & (_db.ind_filehash_buckets_n - 1); orgfile::FFilehash* *prev = &_db.ind_filehash_buckets_elems[index]; // addr of pointer to current element while (orgfile::FFilehash *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -759,8 +762,14 @@ void orgfile::ind_filehash_Remove(orgfile::FFilehash& row) { // --- orgfile.FDb.ind_filehash.Reserve // Reserve enough room in the hash for N more elements. Return success code. void orgfile::ind_filehash_Reserve(int n) { + ind_filehash_AbsReserve(_db.ind_filehash_n + n); +} + +// --- orgfile.FDb.ind_filehash.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void orgfile::ind_filehash_AbsReserve(int n) { u32 old_nbuckets = _db.ind_filehash_buckets_n; - u32 new_nelems = _db.ind_filehash_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -779,7 +788,7 @@ void orgfile::ind_filehash_Reserve(int n) { while (elem) { orgfile::FFilehash &row = *elem; orgfile::FFilehash* next = row.ind_filehash_next; - u32 index = algo::Smallstr40_Hash(0, row.filehash) & (new_nbuckets-1); + u32 index = row.ind_filehash_hashval & (new_nbuckets-1); row.ind_filehash_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -971,15 +980,11 @@ void orgfile::FDb_Uninit() { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void orgfile::c_filename_Insert(orgfile::FFilehash& filehash, orgfile::FFilename& row) { - if (bool_Update(row.filehash_c_filename_in_ary,true)) { - // reserve space + if (!row.filehash_c_filename_in_ary) { c_filename_Reserve(filehash, 1); - u32 n = filehash.c_filename_n; - u32 at = n; - orgfile::FFilename* *elems = filehash.c_filename_elems; - elems[at] = &row; - filehash.c_filename_n = n+1; - + u32 n = filehash.c_filename_n++; + filehash.c_filename_elems[n] = &row; + row.filehash_c_filename_in_ary = true; } } @@ -988,7 +993,7 @@ void orgfile::c_filename_Insert(orgfile::FFilehash& filehash, orgfile::FFilename // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool orgfile::c_filename_InsertMaybe(orgfile::FFilehash& filehash, orgfile::FFilename& row) { - bool retval = !row.filehash_c_filename_in_ary; + bool retval = !filehash_c_filename_InAryQ(row); c_filename_Insert(filehash,row); // check is performed in _Insert again return retval; } @@ -996,18 +1001,18 @@ bool orgfile::c_filename_InsertMaybe(orgfile::FFilehash& filehash, orgfile::FFil // --- orgfile.FFilehash.c_filename.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void orgfile::c_filename_Remove(orgfile::FFilehash& filehash, orgfile::FFilename& row) { + int n = filehash.c_filename_n; if (bool_Update(row.filehash_c_filename_in_ary,false)) { - int lim = filehash.c_filename_n; orgfile::FFilename* *elems = filehash.c_filename_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { orgfile::FFilename* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(orgfile::FFilename*) * (lim - j); + size_t nbytes = sizeof(orgfile::FFilename*) * (n - j); memmove(elems + i, elems + j, nbytes); - filehash.c_filename_n = lim - 1; + filehash.c_filename_n = n - 1; break; } } @@ -1267,17 +1272,17 @@ bool orgfile::dedup_ReadFieldMaybe(orgfile::dedup& parent, algo::strptr field, a switch(field_id) { case orgfile_FieldId_original: { retval = algo::cstring_ReadStrptrMaybe(parent.original, strval); - break; - } + } break; case orgfile_FieldId_duplicate: { retval = algo::cstring_ReadStrptrMaybe(parent.duplicate, strval); - break; - } + } break; case orgfile_FieldId_comment: { retval = algo::cstring_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1322,17 +1327,17 @@ bool orgfile::move_ReadFieldMaybe(orgfile::move& parent, algo::strptr field, alg switch(field_id) { case orgfile_FieldId_pathname: { retval = algo::cstring_ReadStrptrMaybe(parent.pathname, strval); - break; - } + } break; case orgfile_FieldId_tgtfile: { retval = algo::cstring_ReadStrptrMaybe(parent.tgtfile, strval); - break; - } + } break; case orgfile_FieldId_comment: { retval = algo::cstring_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1381,11 +1386,13 @@ void orgfile::StaticCheck() { // --- orgfile...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); orgfile::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock orgfile::ReadArgv(); // dmmeta.main:orgfile orgfile::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -1398,6 +1405,7 @@ int main(int argc, char **argv) { try { orgfile::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/report_gen.cpp b/cpp/gen/report_gen.cpp index 356b0839..630b38c8 100644 --- a/cpp/gen/report_gen.cpp +++ b/cpp/gen/report_gen.cpp @@ -380,33 +380,29 @@ bool report::abt_ReadFieldMaybe(report::abt& parent, algo::strptr field, algo::s switch(field_id) { case report_FieldId_n_target: { retval = u16_ReadStrptrMaybe(parent.n_target, strval); - break; - } + } break; case report_FieldId_time: { retval = algo::UnDiff_ReadStrptrMaybe(parent.time, strval); - break; - } + } break; case report_FieldId_hitrate: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.hitrate, strval); - break; - } + } break; case report_FieldId_pch_hitrate: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.pch_hitrate, strval); - break; - } + } break; case report_FieldId_n_warn: { retval = u32_ReadStrptrMaybe(parent.n_warn, strval); - break; - } + } break; case report_FieldId_n_err: { retval = u32_ReadStrptrMaybe(parent.n_err, strval); - break; - } + } break; case report_FieldId_n_install: { retval = u16_ReadStrptrMaybe(parent.n_install, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -463,29 +459,26 @@ bool report::acr_ReadFieldMaybe(report::acr& parent, algo::strptr field, algo::s switch(field_id) { case report_FieldId_n_select: { retval = u32_ReadStrptrMaybe(parent.n_select, strval); - break; - } + } break; case report_FieldId_n_insert: { retval = u32_ReadStrptrMaybe(parent.n_insert, strval); - break; - } + } break; case report_FieldId_n_delete: { retval = u32_ReadStrptrMaybe(parent.n_delete, strval); - break; - } + } break; case report_FieldId_n_ignore: { retval = u32_ReadStrptrMaybe(parent.n_ignore, strval); - break; - } + } break; case report_FieldId_n_update: { retval = u32_ReadStrptrMaybe(parent.n_update, strval); - break; - } + } break; case report_FieldId_n_file_mod: { retval = u32_ReadStrptrMaybe(parent.n_file_mod, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -539,13 +532,14 @@ bool report::acr_check_ReadFieldMaybe(report::acr_check& parent, algo::strptr fi switch(field_id) { case report_FieldId_records: { retval = u32_ReadStrptrMaybe(parent.records, strval); - break; - } + } break; case report_FieldId_errors: { retval = u32_ReadStrptrMaybe(parent.errors, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -587,29 +581,26 @@ bool report::amc_ReadFieldMaybe(report::amc& parent, algo::strptr field, algo::s switch(field_id) { case report_FieldId_n_cppfile: { retval = u32_ReadStrptrMaybe(parent.n_cppfile, strval); - break; - } + } break; case report_FieldId_n_cppline: { retval = u32_ReadStrptrMaybe(parent.n_cppline, strval); - break; - } + } break; case report_FieldId_n_ctype: { retval = u32_ReadStrptrMaybe(parent.n_ctype, strval); - break; - } + } break; case report_FieldId_n_func: { retval = u32_ReadStrptrMaybe(parent.n_func, strval); - break; - } + } break; case report_FieldId_n_xref: { retval = u32_ReadStrptrMaybe(parent.n_xref, strval); - break; - } + } break; case report_FieldId_n_filemod: { retval = u32_ReadStrptrMaybe(parent.n_filemod, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -663,41 +654,35 @@ bool report::atf_comp_ReadFieldMaybe(report::atf_comp& parent, algo::strptr fiel switch(field_id) { case report_FieldId_ntest: { retval = i32_ReadStrptrMaybe(parent.ntest, strval); - break; - } + } break; case report_FieldId_nselect: { retval = i32_ReadStrptrMaybe(parent.nselect, strval); - break; - } + } break; case report_FieldId_npass: { retval = i32_ReadStrptrMaybe(parent.npass, strval); - break; - } + } break; case report_FieldId_nskip: { retval = i32_ReadStrptrMaybe(parent.nskip, strval); - break; - } + } break; case report_FieldId_nrun: { retval = i32_ReadStrptrMaybe(parent.nrun, strval); - break; - } + } break; case report_FieldId_nwrite: { retval = i32_ReadStrptrMaybe(parent.nwrite, strval); - break; - } + } break; case report_FieldId_nerr: { retval = i32_ReadStrptrMaybe(parent.nerr, strval); - break; - } + } break; case report_FieldId_ninsert: { retval = i32_ReadStrptrMaybe(parent.ninsert, strval); - break; - } + } break; case report_FieldId_success: { retval = bool_ReadStrptrMaybe(parent.success, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -760,21 +745,20 @@ bool report::atf_unit_ReadFieldMaybe(report::atf_unit& parent, algo::strptr fiel switch(field_id) { case report_FieldId_n_test_total: { retval = u32_ReadStrptrMaybe(parent.n_test_total, strval); - break; - } + } break; case report_FieldId_success: { retval = bool_ReadStrptrMaybe(parent.success, strval); - break; - } + } break; case report_FieldId_n_test_run: { retval = u64_ReadStrptrMaybe(parent.n_test_run, strval); - break; - } + } break; case report_FieldId_n_err: { retval = u64_ReadStrptrMaybe(parent.n_err, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -822,45 +806,38 @@ bool report::gcache_ReadFieldMaybe(report::gcache& parent, algo::strptr field, a switch(field_id) { case report_FieldId_starttime: { retval = algo::UnTime_ReadStrptrMaybe(parent.starttime, strval); - break; - } + } break; case report_FieldId_elapsed_sec: { retval = double_ReadStrptrMaybe(parent.elapsed_sec, strval); - break; - } + } break; case report_FieldId_preproc_size: { retval = i32_ReadStrptrMaybe(parent.preproc_size, strval); - break; - } + } break; case report_FieldId_hit: { retval = bool_ReadStrptrMaybe(parent.hit, strval); - break; - } + } break; case report_FieldId_cached_file: { retval = algo::cstring_ReadStrptrMaybe(parent.cached_file, strval); - break; - } + } break; case report_FieldId_copy_file_range: { retval = bool_ReadStrptrMaybe(parent.copy_file_range, strval); - break; - } + } break; case report_FieldId_pch_hit: { retval = bool_ReadStrptrMaybe(parent.pch_hit, strval); - break; - } + } break; case report_FieldId_pch_file: { retval = algo::cstring_ReadStrptrMaybe(parent.pch_file, strval); - break; - } + } break; case report_FieldId_source: { retval = algo::cstring_ReadStrptrMaybe(parent.source, strval); - break; - } + } break; case report_FieldId_pch_source: { retval = algo::cstring_ReadStrptrMaybe(parent.pch_source, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -936,13 +913,14 @@ bool report::gcache_hitrate_ReadFieldMaybe(report::gcache_hitrate& parent, algo: switch(field_id) { case report_FieldId_hitrate: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.hitrate, strval); - break; - } + } break; case report_FieldId_pch_hitrate: { retval = algo::Smallstr20_ReadStrptrMaybe(parent.pch_hitrate, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -984,37 +962,32 @@ bool report::src_func_ReadFieldMaybe(report::src_func& parent, algo::strptr fiel switch(field_id) { case report_FieldId_n_func: { retval = u32_ReadStrptrMaybe(parent.n_func, strval); - break; - } + } break; case report_FieldId_n_line: { retval = u32_ReadStrptrMaybe(parent.n_line, strval); - break; - } + } break; case report_FieldId_n_static: { retval = u32_ReadStrptrMaybe(parent.n_static, strval); - break; - } + } break; case report_FieldId_n_inline: { retval = u32_ReadStrptrMaybe(parent.n_inline, strval); - break; - } + } break; case report_FieldId_n_mysteryfunc: { retval = u32_ReadStrptrMaybe(parent.n_mysteryfunc, strval); - break; - } + } break; case report_FieldId_n_filemod: { retval = u32_ReadStrptrMaybe(parent.n_filemod, strval); - break; - } + } break; case report_FieldId_n_baddecl: { retval = u32_ReadStrptrMaybe(parent.n_baddecl, strval); - break; - } + } break; case report_FieldId_comment: { retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); diff --git a/cpp/gen/samp_make_gen.cpp b/cpp/gen/samp_make_gen.cpp new file mode 100644 index 00000000..563bc90b --- /dev/null +++ b/cpp/gen/samp_make_gen.cpp @@ -0,0 +1,2287 @@ +// +// cpp/gen/samp_make_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/samp_make_gen.h" +#include "include/gen/samp_make_gen.inl.h" +#include "include/gen/command_gen.h" +#include "include/gen/command_gen.inl.h" +#include "include/gen/sampdb_gen.h" +#include "include/gen/sampdb_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/lib_prot_gen.h" +#include "include/gen/lib_prot_gen.inl.h" +//#pragma endinclude + +// Instantiate all libraries linked into this executable, +// in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep +algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep +samp_make::FDb samp_make::_db; // dependency found via dev.targdep + +namespace samp_make { +const char *samp_make_help = +"samp_make: sample program for Makefile management\n" +"Usage: samp_make [options]\n" +" OPTION TYPE DFLT COMMENT\n" +" -in string \"data\" Input directory or filename, - for stdin\n" +" -target regx \"%\" Create Makefile for selected targets\n" +" -parse_make Parse extern/gnumake/Simple-Makefile\n" +" -makefile string \"extern/gnumake/Simple-Makefile\" (with parse_make) makefile to parse\n" +" -write P(with parse_make) write ssimfiles, otherwise print them\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" +" -help Print help and exit; alias -h\n" +" -version Print version and exit\n" +" -signature Show signatures and exit; alias -sig\n" +; + + +} // namespace samp_make +namespace samp_make { // gen:ns_print_proto + // Load statically available data into tables, register tables and database. + // func:samp_make.FDb._db.InitReflection + static void InitReflection(); + // func:samp_make.FDb.gitfile.InputMaybe + static bool gitfile_InputMaybe(sampdb::Gitfile &elem) __attribute__((nothrow)); + // func:samp_make.FDb.target.InputMaybe + static bool target_InputMaybe(sampdb::Target &elem) __attribute__((nothrow)); + // func:samp_make.FDb.targdep.InputMaybe + static bool targdep_InputMaybe(sampdb::Targdep &elem) __attribute__((nothrow)); + // func:samp_make.FDb.targsrc.InputMaybe + static bool targsrc_InputMaybe(sampdb::Targsrc &elem) __attribute__((nothrow)); + // func:samp_make.FDb.targrec.InputMaybe + static bool targrec_InputMaybe(sampdb::Targrec &elem) __attribute__((nothrow)); + // find trace by row id (used to implement reflection) + // func:samp_make.FDb.trace.RowidFind + static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); + // Function return 1 + // func:samp_make.FDb.trace.N + inline static i32 trace_N() __attribute__((__warn_unused_result__, nothrow, pure)); + // func:samp_make...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- samp_make.trace..Print +// print string representation of ROW to string STR +// cfmt:samp_make.trace.String printfmt:Tuple +void samp_make::trace_Print(samp_make::trace& row, algo::cstring& str) { + algo::tempstr temp; + str << "samp_make.trace"; + (void)row;//only to avoid -Wunused-parameter +} + +// --- samp_make.FDb._db.ReadArgv +// Read argc,argv directly into the fields of the command line(s) +// The following fields are updated: +// samp_make.FDb.cmdline +// algo_lib.FDb.cmdline +void samp_make::ReadArgv() { + command::samp_make &cmd = samp_make::_db.cmdline; + algo_lib::Cmdline &base = algo_lib::_db.cmdline; + int needarg=-1;// unknown + int argidx=1;// skip process name + tempstr err; + algo::strptr attrname; + bool isanon=false; // true if attrname is anonfld (positional) + algo_lib::FieldId baseattrid; + command::FieldId attrid; + bool endopt=false; + int whichns=0;// which namespace does the current attribute belong to + for (; argidx < algo_lib::_db.argc; argidx++) { + algo::strptr arg = algo_lib::_db.argv[argidx]; + algo::strptr attrval; + algo::strptr dfltval; + bool haveval=false; + bool dash=elems_N(arg)>1 && arg.elems[0]=='-'; // a single dash is not an option + // this attribute is a value + if (endopt || needarg>0 || !dash) { + attrval=arg; + haveval=true; + } else { + // this attribute is a field name (with - or --) + // or a -- by itself + bool dashdash = elems_N(arg) >= 2 && arg.elems[1]=='-'; + int skip = int(dash) + dashdash; + attrname=ch_RestFrom(arg,skip); + if (skip==2 && elems_N(arg)==2) { + endopt=true; + continue;// nothing else to do here + } + // parse "-a:B" arg into attrname,attrvalue + algo::i32_Range colon = TFind(attrname,':'); + if (colon.beg < colon.end) { + attrval=ch_RestFrom(attrname,colon.end); + attrname=ch_FirstN(attrname,colon.beg); + haveval=true; + } + // look up which command (this one or the base) contains the field + whichns=0; + needarg=-1; + // look up parameter information in base namespace (needarg will be -1 if lookup fails) + if (algo_lib::FieldId_ReadStrptrMaybe(baseattrid,attrname)) { + needarg = algo_lib::Cmdline_NArgs(baseattrid,dfltval,&isanon); + } + if (needarg<0) { + whichns=1; + // look up parameter information in this namespace (needarg will be -1 if lookup fails) + if (command::FieldId_ReadStrptrMaybe(attrid,attrname)) { + needarg = command::samp_make_NArgs(attrid,dfltval,&isanon); + } + } + if (attrval == "" && dfltval != "") { + attrval=dfltval; + haveval=true; + } + if (needarg<0) { + err<<"samp_make: unknown option "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; + if (!dohelp) { + } + if (err != "") { + algo_lib::_db.exit_code=1; + prerr_(err); // already has eol + doexit=true; + } + if (dohelp) { + prlog(samp_make_help); + } + if (doexit) { + _exit(algo_lib::_db.exit_code); + } + algo_lib::ResetErrtext(); +} + +// --- samp_make.FDb._db.MainLoop +// Main loop. +void samp_make::MainLoop() { + algo::SchedTime time(algo::get_cycles()); + algo_lib::_db.clock = time; + do { + algo_lib::_db.next_loop.value = algo_lib::_db.limit; + samp_make::Steps(); + } while (algo_lib::_db.next_loop < algo_lib::_db.limit); +} + +// --- samp_make.FDb._db.Step +// Main step +void samp_make::Step() { +} + +// --- samp_make.FDb._db.InitReflection +// Load statically available data into tables, register tables and database. +static void samp_make::InitReflection() { + algo_lib::imdb_InsertMaybe(algo::Imdb("samp_make", samp_make::InsertStrptrMaybe, NULL, samp_make::MainLoop, NULL, algo::Comment())); + + algo::Imtable t_trace; + t_trace.imtable = "samp_make.trace"; + t_trace.ssimfile = ""; + t_trace.size = sizeof(samp_make::trace); + t_trace.comment.value = ""; + t_trace.c_RowidFind = trace_RowidFind; + t_trace.NItems = trace_N; + t_trace.Print = (algo::ImrowPrintFcn)samp_make::trace_Print; + algo_lib::imtable_InsertMaybe(t_trace); + + + // -- load signatures of existing dispatches -- + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'samp_make.Input' signature:'4e9da3ce15f985cf3fee1f50564951a827262ab0'"); +} + +// --- samp_make.FDb._db.InsertStrptrMaybe +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +bool samp_make::InsertStrptrMaybe(algo::strptr str) { + bool retval = true; + samp_make::TableId table_id(-1); + value_SetStrptrMaybe(table_id, algo::GetTypeTag(str)); + switch (value_GetEnum(table_id)) { + case samp_make_TableId_sampdb_Gitfile: { // finput:samp_make.FDb.gitfile + sampdb::Gitfile elem; + retval = sampdb::Gitfile_ReadStrptrMaybe(elem, str); + retval = retval && gitfile_InputMaybe(elem); + break; + } + case samp_make_TableId_sampdb_Target: { // finput:samp_make.FDb.target + sampdb::Target elem; + retval = sampdb::Target_ReadStrptrMaybe(elem, str); + retval = retval && target_InputMaybe(elem); + break; + } + case samp_make_TableId_sampdb_Targdep: { // finput:samp_make.FDb.targdep + sampdb::Targdep elem; + retval = sampdb::Targdep_ReadStrptrMaybe(elem, str); + retval = retval && targdep_InputMaybe(elem); + break; + } + case samp_make_TableId_sampdb_Targsrc: { // finput:samp_make.FDb.targsrc + sampdb::Targsrc elem; + retval = sampdb::Targsrc_ReadStrptrMaybe(elem, str); + retval = retval && targsrc_InputMaybe(elem); + break; + } + case samp_make_TableId_sampdb_Targrec: { // finput:samp_make.FDb.targrec + sampdb::Targrec elem; + retval = sampdb::Targrec_ReadStrptrMaybe(elem, str); + retval = retval && targrec_InputMaybe(elem); + break; + } + default: + break; + } //switch + if (!retval) { + algo_lib::NoteInsertErr(str); // increment error counter + } + return retval; +} + +// --- samp_make.FDb._db.LoadTuplesMaybe +// Load all finputs from given directory. +bool samp_make::LoadTuplesMaybe(algo::strptr root, bool recursive) { + bool retval = true; + if (FileQ(root)) { + retval = samp_make::LoadTuplesFile(root, recursive); + } else if (root == "-") { + retval = samp_make::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); + } else if (DirectoryQ(root)) { + retval = retval && samp_make::LoadTuplesFile(algo::SsimFname(root,"sampdb.gitfile"),recursive); + retval = retval && samp_make::LoadTuplesFile(algo::SsimFname(root,"sampdb.target"),recursive); + retval = retval && samp_make::LoadTuplesFile(algo::SsimFname(root,"sampdb.targsrc"),recursive); + retval = retval && samp_make::LoadTuplesFile(algo::SsimFname(root,"sampdb.targrec"),recursive); + retval = retval && samp_make::LoadTuplesFile(algo::SsimFname(root,"sampdb.targdep"),recursive); + retval = retval && samp_make::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); + } else { + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); + retval = false; + } + return retval; +} + +// --- samp_make.FDb._db.LoadTuplesFile +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +bool samp_make::LoadTuplesFile(algo::strptr fname, bool recursive) { + bool retval = true; + algo_lib::FFildes fildes; + // missing files are not an error + fildes.fd = OpenRead(fname,algo::FileFlags()); + if (ValidQ(fildes.fd)) { + retval = LoadTuplesFd(fildes.fd, fname, recursive); + } + return retval; +} + +// --- samp_make.FDb._db.LoadTuplesFd +// Load all finputs from given file descriptor. +bool samp_make::LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) { + bool retval = true; + ind_beg(algo::FileLine_curs,line,fd) { + if (recursive) { + retval = retval && algo_lib::InsertStrptrMaybe(line); + } + retval = retval && samp_make::InsertStrptrMaybe(line); + if (!retval) { + algo_lib::_db.errtext << eol + << fname << ":" + << (ind_curs(line).i+1) + << ": " << line << eol; + break; + } + }ind_end; + return retval; +} + +// --- samp_make.FDb._db.LoadSsimfileMaybe +// Load specified ssimfile. +bool samp_make::LoadSsimfileMaybe(algo::strptr fname, bool recursive) { + bool retval = true; + if (FileQ(fname)) { + retval = samp_make::LoadTuplesFile(fname, recursive); + } + return retval; +} + +// --- samp_make.FDb._db.Steps +// Calls Step function of dependencies +void samp_make::Steps() { + algo_lib::Step(); // dependent namespace specified via (dev.targdep) +} + +// --- samp_make.FDb._db.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool samp_make::_db_XrefMaybe() { + bool retval = true; + return retval; +} + +// --- samp_make.FDb.gitfile.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +samp_make::FGitfile& samp_make::gitfile_Alloc() { + samp_make::FGitfile* row = gitfile_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("samp_make.out_of_mem field:samp_make.FDb.gitfile comment:'Alloc failed'"); + } + return *row; +} + +// --- samp_make.FDb.gitfile.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +samp_make::FGitfile* samp_make::gitfile_AllocMaybe() { + samp_make::FGitfile *row = (samp_make::FGitfile*)gitfile_AllocMem(); + if (row) { + new (row) samp_make::FGitfile; // call constructor + } + return row; +} + +// --- samp_make.FDb.gitfile.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +samp_make::FGitfile* samp_make::gitfile_InsertMaybe(const sampdb::Gitfile &value) { + samp_make::FGitfile *row = &gitfile_Alloc(); // if out of memory, process dies. if input error, return NULL. + gitfile_CopyIn(*row,const_cast(value)); + bool ok = gitfile_XrefMaybe(*row); // this may return false + if (!ok) { + gitfile_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- samp_make.FDb.gitfile.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* samp_make::gitfile_AllocMem() { + u64 new_nelems = _db.gitfile_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + gitfile_qFind(u64(n)).~FGitfile(); // destroy last element + _db.gitfile_n = i32(n); + } +} + +// --- samp_make.FDb.gitfile.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void samp_make::gitfile_RemoveLast() { + u64 n = _db.gitfile_n; + if (n > 0) { + n -= 1; + gitfile_qFind(u64(n)).~FGitfile(); + _db.gitfile_n = i32(n); + } +} + +// --- samp_make.FDb.gitfile.InputMaybe +static bool samp_make::gitfile_InputMaybe(sampdb::Gitfile &elem) { + bool retval = true; + retval = gitfile_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- samp_make.FDb.gitfile.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool samp_make::gitfile_XrefMaybe(samp_make::FGitfile &row) { + bool retval = true; + (void)row; + // insert gitfile into index ind_gitfile + if (true) { // user-defined insert condition + bool success = ind_gitfile_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "samp_make.duplicate_key xref:samp_make.FDb.ind_gitfile"; // check for duplicate key + return false; + } + } + return retval; +} + +// --- samp_make.FDb.ind_gitfile.Find +// Find row by key. Return NULL if not found. +samp_make::FGitfile* samp_make::ind_gitfile_Find(const algo::strptr& key) { + u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_gitfile_buckets_n - 1); + samp_make::FGitfile *ret = _db.ind_gitfile_buckets_elems[index]; + for (; ret && !((*ret).gitfile == key); ret = ret->ind_gitfile_next) { + } + return ret; +} + +// --- samp_make.FDb.ind_gitfile.FindX +// Look up row by key and return reference. Throw exception if not found +samp_make::FGitfile& samp_make::ind_gitfile_FindX(const algo::strptr& key) { + samp_make::FGitfile* ret = ind_gitfile_Find(key); + vrfy(ret, tempstr() << "samp_make.key_error table:ind_gitfile key:'"<ind_gitfile_next; + } while (true); + if (retval) { + row.ind_gitfile_next = *prev; + _db.ind_gitfile_n++; + *prev = &row; + } + } + return retval; +} + +// --- samp_make.FDb.ind_gitfile.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void samp_make::ind_gitfile_Remove(samp_make::FGitfile& row) { + if (LIKELY(row.ind_gitfile_next != (samp_make::FGitfile*)-1)) {// check if in hash already + u32 index = row.ind_gitfile_hashval & (_db.ind_gitfile_buckets_n - 1); + samp_make::FGitfile* *prev = &_db.ind_gitfile_buckets_elems[index]; // addr of pointer to current element + while (samp_make::FGitfile *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_gitfile_next; // unlink (singly linked list) + _db.ind_gitfile_n--; + row.ind_gitfile_next = (samp_make::FGitfile*)-1;// not-in-hash + break; + } + prev = &next->ind_gitfile_next; + } + } +} + +// --- samp_make.FDb.ind_gitfile.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void samp_make::ind_gitfile_Reserve(int n) { + ind_gitfile_AbsReserve(_db.ind_gitfile_n + n); +} + +// --- samp_make.FDb.ind_gitfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void samp_make::ind_gitfile_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_gitfile_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(samp_make::FGitfile*); + u32 new_size = new_nbuckets * sizeof(samp_make::FGitfile*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + samp_make::FGitfile* *new_buckets = (samp_make::FGitfile**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("samp_make.out_of_memory field:samp_make.FDb.ind_gitfile"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_gitfile_buckets_n; i++) { + samp_make::FGitfile* elem = _db.ind_gitfile_buckets_elems[i]; + while (elem) { + samp_make::FGitfile &row = *elem; + samp_make::FGitfile* next = row.ind_gitfile_next; + u32 index = row.ind_gitfile_hashval & (new_nbuckets-1); + row.ind_gitfile_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_gitfile_buckets_elems, old_size); + _db.ind_gitfile_buckets_elems = new_buckets; + _db.ind_gitfile_buckets_n = new_nbuckets; + } +} + +// --- samp_make.FDb.target.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +samp_make::FTarget& samp_make::target_Alloc() { + samp_make::FTarget* row = target_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("samp_make.out_of_mem field:samp_make.FDb.target comment:'Alloc failed'"); + } + return *row; +} + +// --- samp_make.FDb.target.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +samp_make::FTarget* samp_make::target_AllocMaybe() { + samp_make::FTarget *row = (samp_make::FTarget*)target_AllocMem(); + if (row) { + new (row) samp_make::FTarget; // call constructor + } + return row; +} + +// --- samp_make.FDb.target.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +samp_make::FTarget* samp_make::target_InsertMaybe(const sampdb::Target &value) { + samp_make::FTarget *row = &target_Alloc(); // if out of memory, process dies. if input error, return NULL. + target_CopyIn(*row,const_cast(value)); + bool ok = target_XrefMaybe(*row); // this may return false + if (!ok) { + target_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- samp_make.FDb.target.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* samp_make::target_AllocMem() { + u64 new_nelems = _db.target_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + target_qFind(u64(n)).~FTarget(); // destroy last element + _db.target_n = i32(n); + } +} + +// --- samp_make.FDb.target.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void samp_make::target_RemoveLast() { + u64 n = _db.target_n; + if (n > 0) { + n -= 1; + target_qFind(u64(n)).~FTarget(); + _db.target_n = i32(n); + } +} + +// --- samp_make.FDb.target.InputMaybe +static bool samp_make::target_InputMaybe(sampdb::Target &elem) { + bool retval = true; + retval = target_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- samp_make.FDb.target.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool samp_make::target_XrefMaybe(samp_make::FTarget &row) { + bool retval = true; + (void)row; + // insert target into index ind_target + if (true) { // user-defined insert condition + bool success = ind_target_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "samp_make.duplicate_key xref:samp_make.FDb.ind_target"; // check for duplicate key + return false; + } + } + return retval; +} + +// --- samp_make.FDb.ind_target.Find +// Find row by key. Return NULL if not found. +samp_make::FTarget* samp_make::ind_target_Find(const algo::strptr& key) { + u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_target_buckets_n - 1); + samp_make::FTarget *ret = _db.ind_target_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_target_next) { + } + return ret; +} + +// --- samp_make.FDb.ind_target.FindX +// Look up row by key and return reference. Throw exception if not found +samp_make::FTarget& samp_make::ind_target_FindX(const algo::strptr& key) { + samp_make::FTarget* ret = ind_target_Find(key); + vrfy(ret, tempstr() << "samp_make.key_error table:ind_target key:'"<ind_target_next; + } while (true); + if (retval) { + row.ind_target_next = *prev; + _db.ind_target_n++; + *prev = &row; + } + } + return retval; +} + +// --- samp_make.FDb.ind_target.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void samp_make::ind_target_Remove(samp_make::FTarget& row) { + if (LIKELY(row.ind_target_next != (samp_make::FTarget*)-1)) {// check if in hash already + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); + samp_make::FTarget* *prev = &_db.ind_target_buckets_elems[index]; // addr of pointer to current element + while (samp_make::FTarget *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_target_next; // unlink (singly linked list) + _db.ind_target_n--; + row.ind_target_next = (samp_make::FTarget*)-1;// not-in-hash + break; + } + prev = &next->ind_target_next; + } + } +} + +// --- samp_make.FDb.ind_target.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void samp_make::ind_target_Reserve(int n) { + ind_target_AbsReserve(_db.ind_target_n + n); +} + +// --- samp_make.FDb.ind_target.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void samp_make::ind_target_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_target_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(samp_make::FTarget*); + u32 new_size = new_nbuckets * sizeof(samp_make::FTarget*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + samp_make::FTarget* *new_buckets = (samp_make::FTarget**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("samp_make.out_of_memory field:samp_make.FDb.ind_target"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_target_buckets_n; i++) { + samp_make::FTarget* elem = _db.ind_target_buckets_elems[i]; + while (elem) { + samp_make::FTarget &row = *elem; + samp_make::FTarget* next = row.ind_target_next; + u32 index = row.ind_target_hashval & (new_nbuckets-1); + row.ind_target_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_target_buckets_elems, old_size); + _db.ind_target_buckets_elems = new_buckets; + _db.ind_target_buckets_n = new_nbuckets; + } +} + +// --- samp_make.FDb.targdep.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +samp_make::FTargdep& samp_make::targdep_Alloc() { + samp_make::FTargdep* row = targdep_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("samp_make.out_of_mem field:samp_make.FDb.targdep comment:'Alloc failed'"); + } + return *row; +} + +// --- samp_make.FDb.targdep.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +samp_make::FTargdep* samp_make::targdep_AllocMaybe() { + samp_make::FTargdep *row = (samp_make::FTargdep*)targdep_AllocMem(); + if (row) { + new (row) samp_make::FTargdep; // call constructor + } + return row; +} + +// --- samp_make.FDb.targdep.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +samp_make::FTargdep* samp_make::targdep_InsertMaybe(const sampdb::Targdep &value) { + samp_make::FTargdep *row = &targdep_Alloc(); // if out of memory, process dies. if input error, return NULL. + targdep_CopyIn(*row,const_cast(value)); + bool ok = targdep_XrefMaybe(*row); // this may return false + if (!ok) { + targdep_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- samp_make.FDb.targdep.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* samp_make::targdep_AllocMem() { + u64 new_nelems = _db.targdep_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + targdep_qFind(u64(n)).~FTargdep(); // destroy last element + _db.targdep_n = i32(n); + } +} + +// --- samp_make.FDb.targdep.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void samp_make::targdep_RemoveLast() { + u64 n = _db.targdep_n; + if (n > 0) { + n -= 1; + targdep_qFind(u64(n)).~FTargdep(); + _db.targdep_n = i32(n); + } +} + +// --- samp_make.FDb.targdep.InputMaybe +static bool samp_make::targdep_InputMaybe(sampdb::Targdep &elem) { + bool retval = true; + retval = targdep_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- samp_make.FDb.targdep.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool samp_make::targdep_XrefMaybe(samp_make::FTargdep &row) { + bool retval = true; + (void)row; + samp_make::FTarget* p_parent = samp_make::ind_target_Find(parent_Get(row)); + if (UNLIKELY(!p_parent)) { + algo_lib::ResetErrtext() << "samp_make.bad_xref index:samp_make.FDb.ind_target" << Keyval("key", parent_Get(row)); + return false; + } + // targdep: save pointer to parent + if (true) { // user-defined insert condition + row.p_parent = p_parent; + } + samp_make::FTarget* p_target = samp_make::ind_target_Find(target_Get(row)); + if (UNLIKELY(!p_target)) { + algo_lib::ResetErrtext() << "samp_make.bad_xref index:samp_make.FDb.ind_target" << Keyval("key", target_Get(row)); + return false; + } + // targdep: save pointer to target + if (true) { // user-defined insert condition + row.p_target = p_target; + } + // insert targdep into index ind_targdep + if (true) { // user-defined insert condition + bool success = ind_targdep_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "samp_make.duplicate_key xref:samp_make.FDb.ind_targdep"; // check for duplicate key + return false; + } + } + // insert targdep into index c_targdep + if (true) { // user-defined insert condition + c_targdep_Insert(*p_target, row); + } + return retval; +} + +// --- samp_make.FDb.ind_targdep.Find +// Find row by key. Return NULL if not found. +samp_make::FTargdep* samp_make::ind_targdep_Find(const algo::strptr& key) { + u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_targdep_buckets_n - 1); + samp_make::FTargdep *ret = _db.ind_targdep_buckets_elems[index]; + for (; ret && !((*ret).targdep == key); ret = ret->ind_targdep_next) { + } + return ret; +} + +// --- samp_make.FDb.ind_targdep.FindX +// Look up row by key and return reference. Throw exception if not found +samp_make::FTargdep& samp_make::ind_targdep_FindX(const algo::strptr& key) { + samp_make::FTargdep* ret = ind_targdep_Find(key); + vrfy(ret, tempstr() << "samp_make.key_error table:ind_targdep key:'"<ind_targdep_next; + } while (true); + if (retval) { + row.ind_targdep_next = *prev; + _db.ind_targdep_n++; + *prev = &row; + } + } + return retval; +} + +// --- samp_make.FDb.ind_targdep.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void samp_make::ind_targdep_Remove(samp_make::FTargdep& row) { + if (LIKELY(row.ind_targdep_next != (samp_make::FTargdep*)-1)) {// check if in hash already + u32 index = row.ind_targdep_hashval & (_db.ind_targdep_buckets_n - 1); + samp_make::FTargdep* *prev = &_db.ind_targdep_buckets_elems[index]; // addr of pointer to current element + while (samp_make::FTargdep *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_targdep_next; // unlink (singly linked list) + _db.ind_targdep_n--; + row.ind_targdep_next = (samp_make::FTargdep*)-1;// not-in-hash + break; + } + prev = &next->ind_targdep_next; + } + } +} + +// --- samp_make.FDb.ind_targdep.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void samp_make::ind_targdep_Reserve(int n) { + ind_targdep_AbsReserve(_db.ind_targdep_n + n); +} + +// --- samp_make.FDb.ind_targdep.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void samp_make::ind_targdep_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_targdep_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(samp_make::FTargdep*); + u32 new_size = new_nbuckets * sizeof(samp_make::FTargdep*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + samp_make::FTargdep* *new_buckets = (samp_make::FTargdep**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("samp_make.out_of_memory field:samp_make.FDb.ind_targdep"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_targdep_buckets_n; i++) { + samp_make::FTargdep* elem = _db.ind_targdep_buckets_elems[i]; + while (elem) { + samp_make::FTargdep &row = *elem; + samp_make::FTargdep* next = row.ind_targdep_next; + u32 index = row.ind_targdep_hashval & (new_nbuckets-1); + row.ind_targdep_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_targdep_buckets_elems, old_size); + _db.ind_targdep_buckets_elems = new_buckets; + _db.ind_targdep_buckets_n = new_nbuckets; + } +} + +// --- samp_make.FDb.targsrc.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +samp_make::FTargsrc& samp_make::targsrc_Alloc() { + samp_make::FTargsrc* row = targsrc_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("samp_make.out_of_mem field:samp_make.FDb.targsrc comment:'Alloc failed'"); + } + return *row; +} + +// --- samp_make.FDb.targsrc.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +samp_make::FTargsrc* samp_make::targsrc_AllocMaybe() { + samp_make::FTargsrc *row = (samp_make::FTargsrc*)targsrc_AllocMem(); + if (row) { + new (row) samp_make::FTargsrc; // call constructor + } + return row; +} + +// --- samp_make.FDb.targsrc.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +samp_make::FTargsrc* samp_make::targsrc_InsertMaybe(const sampdb::Targsrc &value) { + samp_make::FTargsrc *row = &targsrc_Alloc(); // if out of memory, process dies. if input error, return NULL. + targsrc_CopyIn(*row,const_cast(value)); + bool ok = targsrc_XrefMaybe(*row); // this may return false + if (!ok) { + targsrc_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- samp_make.FDb.targsrc.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* samp_make::targsrc_AllocMem() { + u64 new_nelems = _db.targsrc_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + targsrc_qFind(u64(n)).~FTargsrc(); // destroy last element + _db.targsrc_n = i32(n); + } +} + +// --- samp_make.FDb.targsrc.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void samp_make::targsrc_RemoveLast() { + u64 n = _db.targsrc_n; + if (n > 0) { + n -= 1; + targsrc_qFind(u64(n)).~FTargsrc(); + _db.targsrc_n = i32(n); + } +} + +// --- samp_make.FDb.targsrc.InputMaybe +static bool samp_make::targsrc_InputMaybe(sampdb::Targsrc &elem) { + bool retval = true; + retval = targsrc_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- samp_make.FDb.targsrc.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool samp_make::targsrc_XrefMaybe(samp_make::FTargsrc &row) { + bool retval = true; + (void)row; + // insert targsrc into index ind_targsrc + if (true) { // user-defined insert condition + bool success = ind_targsrc_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "samp_make.duplicate_key xref:samp_make.FDb.ind_targsrc"; // check for duplicate key + return false; + } + } + samp_make::FTarget* p_target = samp_make::ind_target_Find(target_Get(row)); + if (UNLIKELY(!p_target)) { + algo_lib::ResetErrtext() << "samp_make.bad_xref index:samp_make.FDb.ind_target" << Keyval("key", target_Get(row)); + return false; + } + // insert targsrc into index c_targsrc + if (true) { // user-defined insert condition + c_targsrc_Insert(*p_target, row); + } + return retval; +} + +// --- samp_make.FDb.ind_targsrc.Find +// Find row by key. Return NULL if not found. +samp_make::FTargsrc* samp_make::ind_targsrc_Find(const algo::strptr& key) { + u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_targsrc_buckets_n - 1); + samp_make::FTargsrc *ret = _db.ind_targsrc_buckets_elems[index]; + for (; ret && !((*ret).targsrc == key); ret = ret->ind_targsrc_next) { + } + return ret; +} + +// --- samp_make.FDb.ind_targsrc.FindX +// Look up row by key and return reference. Throw exception if not found +samp_make::FTargsrc& samp_make::ind_targsrc_FindX(const algo::strptr& key) { + samp_make::FTargsrc* ret = ind_targsrc_Find(key); + vrfy(ret, tempstr() << "samp_make.key_error table:ind_targsrc key:'"<ind_targsrc_next; + } while (true); + if (retval) { + row.ind_targsrc_next = *prev; + _db.ind_targsrc_n++; + *prev = &row; + } + } + return retval; +} + +// --- samp_make.FDb.ind_targsrc.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void samp_make::ind_targsrc_Remove(samp_make::FTargsrc& row) { + if (LIKELY(row.ind_targsrc_next != (samp_make::FTargsrc*)-1)) {// check if in hash already + u32 index = row.ind_targsrc_hashval & (_db.ind_targsrc_buckets_n - 1); + samp_make::FTargsrc* *prev = &_db.ind_targsrc_buckets_elems[index]; // addr of pointer to current element + while (samp_make::FTargsrc *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_targsrc_next; // unlink (singly linked list) + _db.ind_targsrc_n--; + row.ind_targsrc_next = (samp_make::FTargsrc*)-1;// not-in-hash + break; + } + prev = &next->ind_targsrc_next; + } + } +} + +// --- samp_make.FDb.ind_targsrc.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void samp_make::ind_targsrc_Reserve(int n) { + ind_targsrc_AbsReserve(_db.ind_targsrc_n + n); +} + +// --- samp_make.FDb.ind_targsrc.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void samp_make::ind_targsrc_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_targsrc_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(samp_make::FTargsrc*); + u32 new_size = new_nbuckets * sizeof(samp_make::FTargsrc*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + samp_make::FTargsrc* *new_buckets = (samp_make::FTargsrc**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("samp_make.out_of_memory field:samp_make.FDb.ind_targsrc"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_targsrc_buckets_n; i++) { + samp_make::FTargsrc* elem = _db.ind_targsrc_buckets_elems[i]; + while (elem) { + samp_make::FTargsrc &row = *elem; + samp_make::FTargsrc* next = row.ind_targsrc_next; + u32 index = row.ind_targsrc_hashval & (new_nbuckets-1); + row.ind_targsrc_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_targsrc_buckets_elems, old_size); + _db.ind_targsrc_buckets_elems = new_buckets; + _db.ind_targsrc_buckets_n = new_nbuckets; + } +} + +// --- samp_make.FDb.targrec.Alloc +// Allocate memory for new default row. +// If out of memory, process is killed. +samp_make::FTargrec& samp_make::targrec_Alloc() { + samp_make::FTargrec* row = targrec_AllocMaybe(); + if (UNLIKELY(row == NULL)) { + FatalErrorExit("samp_make.out_of_mem field:samp_make.FDb.targrec comment:'Alloc failed'"); + } + return *row; +} + +// --- samp_make.FDb.targrec.AllocMaybe +// Allocate memory for new element. If out of memory, return NULL. +samp_make::FTargrec* samp_make::targrec_AllocMaybe() { + samp_make::FTargrec *row = (samp_make::FTargrec*)targrec_AllocMem(); + if (row) { + new (row) samp_make::FTargrec; // call constructor + } + return row; +} + +// --- samp_make.FDb.targrec.InsertMaybe +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +samp_make::FTargrec* samp_make::targrec_InsertMaybe(const sampdb::Targrec &value) { + samp_make::FTargrec *row = &targrec_Alloc(); // if out of memory, process dies. if input error, return NULL. + targrec_CopyIn(*row,const_cast(value)); + bool ok = targrec_XrefMaybe(*row); // this may return false + if (!ok) { + targrec_RemoveLast(); // delete offending row, any existing xrefs are cleared + row = NULL; // forget this ever happened + } + return row; +} + +// --- samp_make.FDb.targrec.AllocMem +// Allocate space for one element. If no memory available, return NULL. +void* samp_make::targrec_AllocMem() { + u64 new_nelems = _db.targrec_n+1; + // compute level and index on level + u64 bsr = algo::u64_BitScanReverse(new_nelems); + u64 base = u64(1)<0; ) { + n--; + targrec_qFind(u64(n)).~FTargrec(); // destroy last element + _db.targrec_n = i32(n); + } +} + +// --- samp_make.FDb.targrec.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void samp_make::targrec_RemoveLast() { + u64 n = _db.targrec_n; + if (n > 0) { + n -= 1; + targrec_qFind(u64(n)).~FTargrec(); + _db.targrec_n = i32(n); + } +} + +// --- samp_make.FDb.targrec.InputMaybe +static bool samp_make::targrec_InputMaybe(sampdb::Targrec &elem) { + bool retval = true; + retval = targrec_InsertMaybe(elem) != nullptr; + return retval; +} + +// --- samp_make.FDb.targrec.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool samp_make::targrec_XrefMaybe(samp_make::FTargrec &row) { + bool retval = true; + (void)row; + // insert targrec into index ind_targrec + if (true) { // user-defined insert condition + bool success = ind_targrec_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "samp_make.duplicate_key xref:samp_make.FDb.ind_targrec"; // check for duplicate key + return false; + } + } + samp_make::FTarget* p_target = samp_make::ind_target_Find(row.target); + if (UNLIKELY(!p_target)) { + algo_lib::ResetErrtext() << "samp_make.bad_xref index:samp_make.FDb.ind_target" << Keyval("key", row.target); + return false; + } + // insert targrec into index c_targrec + if (true) { // user-defined insert condition + bool success = c_targrec_InsertMaybe(*p_target, row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "samp_make.duplicate_key xref:samp_make.FTarget.c_targrec"; // check for duplicate key + return false; + } + } + return retval; +} + +// --- samp_make.FDb.ind_targrec.Find +// Find row by key. Return NULL if not found. +samp_make::FTargrec* samp_make::ind_targrec_Find(const algo::strptr& key) { + u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_targrec_buckets_n - 1); + samp_make::FTargrec *ret = _db.ind_targrec_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_targrec_next) { + } + return ret; +} + +// --- samp_make.FDb.ind_targrec.FindX +// Look up row by key and return reference. Throw exception if not found +samp_make::FTargrec& samp_make::ind_targrec_FindX(const algo::strptr& key) { + samp_make::FTargrec* ret = ind_targrec_Find(key); + vrfy(ret, tempstr() << "samp_make.key_error table:ind_targrec key:'"<ind_targrec_next; + } while (true); + if (retval) { + row.ind_targrec_next = *prev; + _db.ind_targrec_n++; + *prev = &row; + } + } + return retval; +} + +// --- samp_make.FDb.ind_targrec.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void samp_make::ind_targrec_Remove(samp_make::FTargrec& row) { + if (LIKELY(row.ind_targrec_next != (samp_make::FTargrec*)-1)) {// check if in hash already + u32 index = row.ind_targrec_hashval & (_db.ind_targrec_buckets_n - 1); + samp_make::FTargrec* *prev = &_db.ind_targrec_buckets_elems[index]; // addr of pointer to current element + while (samp_make::FTargrec *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_targrec_next; // unlink (singly linked list) + _db.ind_targrec_n--; + row.ind_targrec_next = (samp_make::FTargrec*)-1;// not-in-hash + break; + } + prev = &next->ind_targrec_next; + } + } +} + +// --- samp_make.FDb.ind_targrec.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void samp_make::ind_targrec_Reserve(int n) { + ind_targrec_AbsReserve(_db.ind_targrec_n + n); +} + +// --- samp_make.FDb.ind_targrec.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void samp_make::ind_targrec_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_targrec_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(samp_make::FTargrec*); + u32 new_size = new_nbuckets * sizeof(samp_make::FTargrec*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + samp_make::FTargrec* *new_buckets = (samp_make::FTargrec**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("samp_make.out_of_memory field:samp_make.FDb.ind_targrec"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_targrec_buckets_n; i++) { + samp_make::FTargrec* elem = _db.ind_targrec_buckets_elems[i]; + while (elem) { + samp_make::FTargrec &row = *elem; + samp_make::FTargrec* next = row.ind_targrec_next; + u32 index = row.ind_targrec_hashval & (new_nbuckets-1); + row.ind_targrec_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_targrec_buckets_elems, old_size); + _db.ind_targrec_buckets_elems = new_buckets; + _db.ind_targrec_buckets_n = new_nbuckets; + } +} + +// --- samp_make.FDb.c_target.Insert +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +void samp_make::c_target_Insert(samp_make::FTarget& row) { + if (!row.c_target_in_ary) { + c_target_Reserve(1); + u32 n = _db.c_target_n++; + _db.c_target_elems[n] = &row; + row.c_target_in_ary = true; + } +} + +// --- samp_make.FDb.c_target.InsertMaybe +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +bool samp_make::c_target_InsertMaybe(samp_make::FTarget& row) { + bool retval = !c_target_InAryQ(row); + c_target_Insert(row); // check is performed in _Insert again + return retval; +} + +// --- samp_make.FDb.c_target.Remove +// Find element using linear scan. If element is in array, remove, otherwise do nothing +void samp_make::c_target_Remove(samp_make::FTarget& row) { + int n = _db.c_target_n; + if (bool_Update(row.c_target_in_ary,false)) { + samp_make::FTarget* *elems = _db.c_target_elems; + // search backward, so that most recently added element is found first. + // if found, shift array. + for (int i = n-1; i>=0; i--) { + samp_make::FTarget* elem = elems[i]; // fetch element + if (elem == &row) { + int j = i + 1; + size_t nbytes = sizeof(samp_make::FTarget*) * (n - j); + memmove(elems + i, elems + j, nbytes); + _db.c_target_n = n - 1; + break; + } + } + } +} + +// --- samp_make.FDb.c_target.Reserve +// Reserve space in index for N more elements; +void samp_make::c_target_Reserve(u32 n) { + u32 old_max = _db.c_target_max; + if (UNLIKELY(_db.c_target_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(samp_make::FTarget*); + u32 new_size = new_max * sizeof(samp_make::FTarget*); + void *new_mem = algo_lib::malloc_ReallocMem(_db.c_target_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("samp_make.out_of_memory field:samp_make.FDb.c_target"); + } + _db.c_target_elems = (samp_make::FTarget**)new_mem; + _db.c_target_max = new_max; + } +} + +// --- samp_make.FDb.trace.RowidFind +// find trace by row id (used to implement reflection) +static algo::ImrowPtr samp_make::trace_RowidFind(int t) { + return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0)); +} + +// --- samp_make.FDb.trace.N +// Function return 1 +inline static i32 samp_make::trace_N() { + return 1; +} + +// --- samp_make.FDb..Init +// Set all fields to initial values. +void samp_make::FDb_Init() { + // initialize LAry gitfile (samp_make.FDb.gitfile) + _db.gitfile_n = 0; + memset(_db.gitfile_lary, 0, sizeof(_db.gitfile_lary)); // zero out all level pointers + samp_make::FGitfile* gitfile_first = (samp_make::FGitfile*)algo_lib::malloc_AllocMem(sizeof(samp_make::FGitfile) * (u64(1)<<4)); + if (!gitfile_first) { + FatalErrorExit("out of memory"); + } + for (int i = 0; i < 4; i++) { + _db.gitfile_lary[i] = gitfile_first; + gitfile_first += 1ULL<=0; i--) { + samp_make::FTargsrc* elem = elems[i]; // fetch element + if (elem == &row) { + int j = i + 1; + size_t nbytes = sizeof(samp_make::FTargsrc*) * (n - j); + memmove(elems + i, elems + j, nbytes); + target.c_targsrc_n = n - 1; + break; + } + } + } +} + +// --- samp_make.FTarget.c_targsrc.Reserve +// Reserve space in index for N more elements; +void samp_make::c_targsrc_Reserve(samp_make::FTarget& target, u32 n) { + u32 old_max = target.c_targsrc_max; + if (UNLIKELY(target.c_targsrc_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(samp_make::FTargsrc*); + u32 new_size = new_max * sizeof(samp_make::FTargsrc*); + void *new_mem = algo_lib::malloc_ReallocMem(target.c_targsrc_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("samp_make.out_of_memory field:samp_make.FTarget.c_targsrc"); + } + target.c_targsrc_elems = (samp_make::FTargsrc**)new_mem; + target.c_targsrc_max = new_max; + } +} + +// --- samp_make.FTarget.c_targdep.Insert +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +void samp_make::c_targdep_Insert(samp_make::FTarget& target, samp_make::FTargdep& row) { + if (!row.target_c_targdep_in_ary) { + c_targdep_Reserve(target, 1); + u32 n = target.c_targdep_n++; + target.c_targdep_elems[n] = &row; + row.target_c_targdep_in_ary = true; + } +} + +// --- samp_make.FTarget.c_targdep.InsertMaybe +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +bool samp_make::c_targdep_InsertMaybe(samp_make::FTarget& target, samp_make::FTargdep& row) { + bool retval = !target_c_targdep_InAryQ(row); + c_targdep_Insert(target,row); // check is performed in _Insert again + return retval; +} + +// --- samp_make.FTarget.c_targdep.Remove +// Find element using linear scan. If element is in array, remove, otherwise do nothing +void samp_make::c_targdep_Remove(samp_make::FTarget& target, samp_make::FTargdep& row) { + int n = target.c_targdep_n; + if (bool_Update(row.target_c_targdep_in_ary,false)) { + samp_make::FTargdep* *elems = target.c_targdep_elems; + // search backward, so that most recently added element is found first. + // if found, shift array. + for (int i = n-1; i>=0; i--) { + samp_make::FTargdep* elem = elems[i]; // fetch element + if (elem == &row) { + int j = i + 1; + size_t nbytes = sizeof(samp_make::FTargdep*) * (n - j); + memmove(elems + i, elems + j, nbytes); + target.c_targdep_n = n - 1; + break; + } + } + } +} + +// --- samp_make.FTarget.c_targdep.Reserve +// Reserve space in index for N more elements; +void samp_make::c_targdep_Reserve(samp_make::FTarget& target, u32 n) { + u32 old_max = target.c_targdep_max; + if (UNLIKELY(target.c_targdep_n + n > old_max)) { + u32 new_max = u32_Max(4, old_max * 2); + u32 old_size = old_max * sizeof(samp_make::FTargdep*); + u32 new_size = new_max * sizeof(samp_make::FTargdep*); + void *new_mem = algo_lib::malloc_ReallocMem(target.c_targdep_elems, old_size, new_size); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("samp_make.out_of_memory field:samp_make.FTarget.c_targdep"); + } + target.c_targdep_elems = (samp_make::FTargdep**)new_mem; + target.c_targdep_max = new_max; + } +} + +// --- samp_make.FTarget..Init +// Set all fields to initial values. +void samp_make::FTarget_Init(samp_make::FTarget& target) { + target.dflt = bool(false); + target.select = bool(false); + target.c_targsrc_elems = NULL; // (samp_make.FTarget.c_targsrc) + target.c_targsrc_n = 0; // (samp_make.FTarget.c_targsrc) + target.c_targsrc_max = 0; // (samp_make.FTarget.c_targsrc) + target.c_targdep_elems = NULL; // (samp_make.FTarget.c_targdep) + target.c_targdep_n = 0; // (samp_make.FTarget.c_targdep) + target.c_targdep_max = 0; // (samp_make.FTarget.c_targdep) + target.c_targrec = NULL; + target.c_target_in_ary = bool(false); + target.ind_target_next = (samp_make::FTarget*)-1; // (samp_make.FDb.ind_target) not-in-hash + target.ind_target_hashval = 0; // stored hash value +} + +// --- samp_make.FTarget..Uninit +void samp_make::FTarget_Uninit(samp_make::FTarget& target) { + samp_make::FTarget &row = target; (void)row; + ind_target_Remove(row); // remove target from index ind_target + + // samp_make.FTarget.c_targdep.Uninit (Ptrary) // + algo_lib::malloc_FreeMem(target.c_targdep_elems, sizeof(samp_make::FTargdep*)*target.c_targdep_max); // (samp_make.FTarget.c_targdep) + + // samp_make.FTarget.c_targsrc.Uninit (Ptrary) // + algo_lib::malloc_FreeMem(target.c_targsrc_elems, sizeof(samp_make::FTargsrc*)*target.c_targsrc_max); // (samp_make.FTarget.c_targsrc) +} + +// --- samp_make.FTargrec.base.CopyOut +// Copy fields out of row +void samp_make::targrec_CopyOut(samp_make::FTargrec &row, sampdb::Targrec &out) { + out.target = row.target; + out.recipe = row.recipe; + out.comment = row.comment; +} + +// --- samp_make.FTargrec.base.CopyIn +// Copy fields in to row +void samp_make::targrec_CopyIn(samp_make::FTargrec &row, sampdb::Targrec &in) { + row.target = in.target; + row.recipe = in.recipe; + row.comment = in.comment; +} + +// --- samp_make.FTargrec..Uninit +void samp_make::FTargrec_Uninit(samp_make::FTargrec& targrec) { + samp_make::FTargrec &row = targrec; (void)row; + ind_targrec_Remove(row); // remove targrec from index ind_targrec + samp_make::FTarget* p_target = samp_make::ind_target_Find(row.target); + if (p_target) { + c_targrec_Remove(*p_target, row);// remove targrec from index c_targrec + } +} + +// --- samp_make.FTargsrc.base.CopyOut +// Copy fields out of row +void samp_make::targsrc_CopyOut(samp_make::FTargsrc &row, sampdb::Targsrc &out) { + out.targsrc = row.targsrc; + out.pre = row.pre; + out.rec = row.rec; + out.comment = row.comment; +} + +// --- samp_make.FTargsrc.base.CopyIn +// Copy fields in to row +void samp_make::targsrc_CopyIn(samp_make::FTargsrc &row, sampdb::Targsrc &in) { + row.targsrc = in.targsrc; + row.pre = in.pre; + row.rec = in.rec; + row.comment = in.comment; +} + +// --- samp_make.FTargsrc.target.Get +algo::Smallstr50 samp_make::target_Get(samp_make::FTargsrc& targsrc) { + algo::Smallstr50 ret(algo::Pathcomp(targsrc.targsrc, "/LL")); + return ret; +} + +// --- samp_make.FTargsrc.src.Get +algo::Smallstr50 samp_make::src_Get(samp_make::FTargsrc& targsrc) { + algo::Smallstr50 ret(algo::Pathcomp(targsrc.targsrc, "/LR")); + return ret; +} + +// --- samp_make.FTargsrc..Uninit +void samp_make::FTargsrc_Uninit(samp_make::FTargsrc& targsrc) { + samp_make::FTargsrc &row = targsrc; (void)row; + ind_targsrc_Remove(row); // remove targsrc from index ind_targsrc + samp_make::FTarget* p_target = samp_make::ind_target_Find(target_Get(row)); + if (p_target) { + c_targsrc_Remove(*p_target, row);// remove targsrc from index c_targsrc + } +} + +// --- samp_make.FieldId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* samp_make::value_ToCstr(const samp_make::FieldId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case samp_make_FieldId_value : ret = "value"; break; + } + return ret; +} + +// --- samp_make.FieldId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void samp_make::value_Print(const samp_make::FieldId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- samp_make.FieldId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool samp_make::value_SetStrptrMaybe(samp_make::FieldId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,samp_make_FieldId_value); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- samp_make.FieldId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void samp_make::value_SetStrptr(samp_make::FieldId& parent, algo::strptr rhs, samp_make_FieldIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- samp_make.FieldId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool samp_make::value_ReadStrptrMaybe(samp_make::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- samp_make.FieldId..ReadStrptrMaybe +// Read fields of samp_make::FieldId from an ascii string. +// The format of the string is the format of the samp_make::FieldId's only field +bool samp_make::FieldId_ReadStrptrMaybe(samp_make::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- samp_make.FieldId..Print +// print string representation of ROW to string STR +// cfmt:samp_make.FieldId.String printfmt:Raw +void samp_make::FieldId_Print(samp_make::FieldId& row, algo::cstring& str) { + samp_make::value_Print(row, str); +} + +// --- samp_make.TableId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* samp_make::value_ToCstr(const samp_make::TableId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case samp_make_TableId_sampdb_Gitfile: ret = "sampdb.Gitfile"; break; + case samp_make_TableId_sampdb_Targdep: ret = "sampdb.Targdep"; break; + case samp_make_TableId_sampdb_Target: ret = "sampdb.Target"; break; + case samp_make_TableId_sampdb_Targrec: ret = "sampdb.Targrec"; break; + case samp_make_TableId_sampdb_Targsrc: ret = "sampdb.Targsrc"; break; + } + return ret; +} + +// --- samp_make.TableId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void samp_make::value_Print(const samp_make::TableId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- samp_make.TableId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool samp_make::value_SetStrptrMaybe(samp_make::TableId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 13: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('s','a','m','p','d','b','.','T'): { + if (memcmp(rhs.elems+8,"arget",5)==0) { value_SetEnum(parent,samp_make_TableId_sampdb_Target); ret = true; break; } + break; + } + case LE_STR8('s','a','m','p','d','b','.','t'): { + if (memcmp(rhs.elems+8,"arget",5)==0) { value_SetEnum(parent,samp_make_TableId_sampdb_target); ret = true; break; } + break; + } + } + break; + } + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('s','a','m','p','d','b','.','G'): { + if (memcmp(rhs.elems+8,"itfile",6)==0) { value_SetEnum(parent,samp_make_TableId_sampdb_Gitfile); ret = true; break; } + break; + } + case LE_STR8('s','a','m','p','d','b','.','T'): { + if (memcmp(rhs.elems+8,"argdep",6)==0) { value_SetEnum(parent,samp_make_TableId_sampdb_Targdep); ret = true; break; } + if (memcmp(rhs.elems+8,"argrec",6)==0) { value_SetEnum(parent,samp_make_TableId_sampdb_Targrec); ret = true; break; } + if (memcmp(rhs.elems+8,"argsrc",6)==0) { value_SetEnum(parent,samp_make_TableId_sampdb_Targsrc); ret = true; break; } + break; + } + case LE_STR8('s','a','m','p','d','b','.','g'): { + if (memcmp(rhs.elems+8,"itfile",6)==0) { value_SetEnum(parent,samp_make_TableId_sampdb_gitfile); ret = true; break; } + break; + } + case LE_STR8('s','a','m','p','d','b','.','t'): { + if (memcmp(rhs.elems+8,"argdep",6)==0) { value_SetEnum(parent,samp_make_TableId_sampdb_targdep); ret = true; break; } + if (memcmp(rhs.elems+8,"argrec",6)==0) { value_SetEnum(parent,samp_make_TableId_sampdb_targrec); ret = true; break; } + if (memcmp(rhs.elems+8,"argsrc",6)==0) { value_SetEnum(parent,samp_make_TableId_sampdb_targsrc); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- samp_make.TableId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void samp_make::value_SetStrptr(samp_make::TableId& parent, algo::strptr rhs, samp_make_TableIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- samp_make.TableId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool samp_make::value_ReadStrptrMaybe(samp_make::TableId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- samp_make.TableId..ReadStrptrMaybe +// Read fields of samp_make::TableId from an ascii string. +// The format of the string is the format of the samp_make::TableId's only field +bool samp_make::TableId_ReadStrptrMaybe(samp_make::TableId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- samp_make.TableId..Print +// print string representation of ROW to string STR +// cfmt:samp_make.TableId.String printfmt:Raw +void samp_make::TableId_Print(samp_make::TableId& row, algo::cstring& str) { + samp_make::value_Print(row, str); +} + +// --- samp_make...SizeCheck +inline static void samp_make::SizeCheck() { +} + +// --- samp_make...StaticCheck +void samp_make::StaticCheck() { + algo_assert(_offset_of(samp_make::FieldId, value) + sizeof(((samp_make::FieldId*)0)->value) == sizeof(samp_make::FieldId)); +} + +// --- samp_make...main +int main(int argc, char **argv) { + try { + lib_json::FDb_Init(); + algo_lib::FDb_Init(); + samp_make::FDb_Init(); + algo_lib::_db.argc = argc; + algo_lib::_db.argv = argv; + algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock + samp_make::ReadArgv(); // dmmeta.main:samp_make + samp_make::Main(); // user-defined main + } catch(algo_lib::ErrorX &x) { + prerr("samp_make.error " << x); // there may be additional hints in DetachBadTags + algo_lib::_db.exit_code = 1; + } + if (algo_lib::_db.last_signal) { + algo_lib::_db.exit_code = 1; + } + try { + samp_make::FDb_Uninit(); + algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); + } catch(algo_lib::ErrorX &) { + // don't print anything, might crash + algo_lib::_db.exit_code = 1; + } + // only the lower 1 byte makes it to the outside world + (void)i32_UpdateMin(algo_lib::_db.exit_code,255); + return algo_lib::_db.exit_code; +} + +// --- samp_make...WinMain +#if defined(WIN32) +int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int) { + return main(__argc,__argv); +} +#endif diff --git a/cpp/gen/samp_meng_gen.cpp b/cpp/gen/samp_meng_gen.cpp index 720f42d8..bd3b9243 100644 --- a/cpp/gen/samp_meng_gen.cpp +++ b/cpp/gen/samp_meng_gen.cpp @@ -39,17 +39,18 @@ // Instantiate all libraries linked into this executable, // in dependency order -algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_json::FDb lib_json::_db; // dependency found via dev.targdep +algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep samp_meng::FDb samp_meng::_db; // dependency found via dev.targdep namespace samp_meng { const char *samp_meng_help = +"samp_meng: Sample matching engine\n" "Usage: samp_meng [options]\n" " OPTION TYPE DFLT COMMENT\n" " -in string \"data\" Input directory or filename, - for stdin\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -110,6 +111,18 @@ namespace samp_meng { // gen:ns_print_proto static void ordq_bh_order_curs_Add(ordq_bh_order_curs &curs, samp_meng::FOrder& row); // func:samp_meng...SizeCheck inline static void SizeCheck(); + // func:samp_meng.In.CancelReqMsg.UpdateCycles + static void In_CancelReqMsg_UpdateCycles(); + // func:samp_meng.In.MassCancelReqMsg.UpdateCycles + static void In_MassCancelReqMsg_UpdateCycles(); + // func:samp_meng.In.NewOrderReqMsg.UpdateCycles + static void In_NewOrderReqMsg_UpdateCycles(); + // func:samp_meng.In.NewSymbolReqMsg.UpdateCycles + static void In_NewSymbolReqMsg_UpdateCycles(); + // func:samp_meng.In.NewUserReqMsg.UpdateCycles + static void In_NewUserReqMsg_UpdateCycles(); + // func:samp_meng.In.TextMsg.UpdateCycles + static void In_TextMsg_UpdateCycles(); } // gen:ns_print_proto // --- samp_meng.CancelOrderMsg.base.CopyOut @@ -129,21 +142,20 @@ bool samp_meng::CancelOrderMsg_ReadFieldMaybe(samp_meng::CancelOrderMsg& parent, switch(field_id) { case samp_meng_FieldId_base: { retval = false; - break; - } + } break; case samp_meng_FieldId_type: { retval = false; - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } + } break; case samp_meng_FieldId_order: { retval = u64_ReadStrptrMaybe(parent.order, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -191,21 +203,20 @@ bool samp_meng::CancelReqMsg_ReadFieldMaybe(samp_meng::CancelReqMsg& parent, alg switch(field_id) { case samp_meng_FieldId_base: { retval = false; - break; - } + } break; case samp_meng_FieldId_type: { retval = false; - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } + } break; case samp_meng_FieldId_order: { retval = u64_ReadStrptrMaybe(parent.order, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -236,13 +247,73 @@ void samp_meng::CancelReqMsg_Print(samp_meng::CancelReqMsg& row, algo::cstring& PrintAttrSpaceReset(str,"order", temp); } +// --- samp_meng.trace..Init +// Set all fields to initial values. +void samp_meng::trace_Init(samp_meng::trace& parent) { + parent.dispatch_In_CancelReqMsg = u64(0); + parent.dispatch_In_CancelReqMsg_cycles = u64(0); + parent.dispatch_In_MassCancelReqMsg = u64(0); + parent.dispatch_In_MassCancelReqMsg_cycles = u64(0); + parent.dispatch_In_NewOrderReqMsg = u64(0); + parent.dispatch_In_NewOrderReqMsg_cycles = u64(0); + parent.dispatch_In_NewSymbolReqMsg = u64(0); + parent.dispatch_In_NewSymbolReqMsg_cycles = u64(0); + parent.dispatch_In_NewUserReqMsg = u64(0); + parent.dispatch_In_NewUserReqMsg_cycles = u64(0); + parent.dispatch_In_TextMsg = u64(0); + parent.dispatch_In_TextMsg_cycles = u64(0); + parent.dispatch_In_Unkmsg = u64(0); + parent.dispatch_In_Unkmsg_cycles = u64(0); +} + // --- samp_meng.trace..Print // print string representation of ROW to string STR // cfmt:samp_meng.trace.String printfmt:Tuple void samp_meng::trace_Print(samp_meng::trace& row, algo::cstring& str) { algo::tempstr temp; str << "samp_meng.trace"; - (void)row;//only to avoid -Wunused-parameter + + u64_Print(row.dispatch_In_CancelReqMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_CancelReqMsg", temp); + + u64_Print(row.dispatch_In_CancelReqMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_CancelReqMsg_cycles", temp); + + u64_Print(row.dispatch_In_MassCancelReqMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_MassCancelReqMsg", temp); + + u64_Print(row.dispatch_In_MassCancelReqMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_MassCancelReqMsg_cycles", temp); + + u64_Print(row.dispatch_In_NewOrderReqMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_NewOrderReqMsg", temp); + + u64_Print(row.dispatch_In_NewOrderReqMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_NewOrderReqMsg_cycles", temp); + + u64_Print(row.dispatch_In_NewSymbolReqMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_NewSymbolReqMsg", temp); + + u64_Print(row.dispatch_In_NewSymbolReqMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_NewSymbolReqMsg_cycles", temp); + + u64_Print(row.dispatch_In_NewUserReqMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_NewUserReqMsg", temp); + + u64_Print(row.dispatch_In_NewUserReqMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_NewUserReqMsg_cycles", temp); + + u64_Print(row.dispatch_In_TextMsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_TextMsg", temp); + + u64_Print(row.dispatch_In_TextMsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_TextMsg_cycles", temp); + + u64_Print(row.dispatch_In_Unkmsg, temp); + PrintAttrSpaceReset(str,"dispatch_In_Unkmsg", temp); + + u64_Print(row.dispatch_In_Unkmsg_cycles, temp); + PrintAttrSpaceReset(str,"dispatch_In_Unkmsg_cycles", temp); } // --- samp_meng.FDb._db.ReadArgv @@ -314,9 +385,8 @@ void samp_meng::ReadArgv() { } if (ch_N(attrname) == 0) { err << "samp_meng: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:samp_meng.FDb.cmdline @@ -370,7 +443,7 @@ void samp_meng::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -440,8 +513,8 @@ bool samp_meng::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && samp_meng::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -904,14 +977,9 @@ inline static void samp_meng::cd_fdin_read_Call() { // Find row by key. Return NULL if not found. samp_meng::FSymbol* samp_meng::ind_symbol_Find(const samp_meng::Symbol& key) { u32 index = samp_meng::Symbol_Hash(0, key) & (_db.ind_symbol_buckets_n - 1); - samp_meng::FSymbol* *e = &_db.ind_symbol_buckets_elems[index]; - samp_meng::FSymbol* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).symbol == key; - if (done) break; - e = &ret->ind_symbol_next; - } while (true); + samp_meng::FSymbol *ret = _db.ind_symbol_buckets_elems[index]; + for (; ret && !((*ret).symbol == key); ret = ret->ind_symbol_next) { + } return ret; } @@ -943,10 +1011,11 @@ samp_meng::FSymbol& samp_meng::ind_symbol_GetOrCreate(const samp_meng::Symbol& k // --- samp_meng.FDb.ind_symbol.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool samp_meng::ind_symbol_InsertMaybe(samp_meng::FSymbol& row) { - ind_symbol_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_symbol_next == (samp_meng::FSymbol*)-1)) {// check if in hash already - u32 index = samp_meng::Symbol_Hash(0, row.symbol) & (_db.ind_symbol_buckets_n - 1); + row.ind_symbol_hashval = samp_meng::Symbol_Hash(0, row.symbol); + ind_symbol_Reserve(1); + u32 index = row.ind_symbol_hashval & (_db.ind_symbol_buckets_n - 1); samp_meng::FSymbol* *prev = &_db.ind_symbol_buckets_elems[index]; do { samp_meng::FSymbol* ret = *prev; @@ -972,7 +1041,7 @@ bool samp_meng::ind_symbol_InsertMaybe(samp_meng::FSymbol& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void samp_meng::ind_symbol_Remove(samp_meng::FSymbol& row) { if (LIKELY(row.ind_symbol_next != (samp_meng::FSymbol*)-1)) {// check if in hash already - u32 index = samp_meng::Symbol_Hash(0, row.symbol) & (_db.ind_symbol_buckets_n - 1); + u32 index = row.ind_symbol_hashval & (_db.ind_symbol_buckets_n - 1); samp_meng::FSymbol* *prev = &_db.ind_symbol_buckets_elems[index]; // addr of pointer to current element while (samp_meng::FSymbol *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -989,8 +1058,14 @@ void samp_meng::ind_symbol_Remove(samp_meng::FSymbol& row) { // --- samp_meng.FDb.ind_symbol.Reserve // Reserve enough room in the hash for N more elements. Return success code. void samp_meng::ind_symbol_Reserve(int n) { + ind_symbol_AbsReserve(_db.ind_symbol_n + n); +} + +// --- samp_meng.FDb.ind_symbol.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void samp_meng::ind_symbol_AbsReserve(int n) { u32 old_nbuckets = _db.ind_symbol_buckets_n; - u32 new_nelems = _db.ind_symbol_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1009,7 +1084,7 @@ void samp_meng::ind_symbol_Reserve(int n) { while (elem) { samp_meng::FSymbol &row = *elem; samp_meng::FSymbol* next = row.ind_symbol_next; - u32 index = samp_meng::Symbol_Hash(0, row.symbol) & (new_nbuckets-1); + u32 index = row.ind_symbol_hashval & (new_nbuckets-1); row.ind_symbol_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1148,14 +1223,9 @@ bool samp_meng::order_XrefMaybe(samp_meng::FOrder &row) { // Find row by key. Return NULL if not found. samp_meng::FOrder* samp_meng::ind_order_Find(i64 key) { u32 index = ::i64_Hash(0, key) & (_db.ind_order_buckets_n - 1); - samp_meng::FOrder* *e = &_db.ind_order_buckets_elems[index]; - samp_meng::FOrder* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).order == key; - if (done) break; - e = &ret->ind_order_next; - } while (true); + samp_meng::FOrder *ret = _db.ind_order_buckets_elems[index]; + for (; ret && !((*ret).order == key); ret = ret->ind_order_next) { + } return ret; } @@ -1170,10 +1240,11 @@ samp_meng::FOrder& samp_meng::ind_order_FindX(i64 key) { // --- samp_meng.FDb.ind_order.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool samp_meng::ind_order_InsertMaybe(samp_meng::FOrder& row) { - ind_order_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_order_next == (samp_meng::FOrder*)-1)) {// check if in hash already - u32 index = ::i64_Hash(0, row.order) & (_db.ind_order_buckets_n - 1); + row.ind_order_hashval = ::i64_Hash(0, row.order); + ind_order_Reserve(1); + u32 index = row.ind_order_hashval & (_db.ind_order_buckets_n - 1); samp_meng::FOrder* *prev = &_db.ind_order_buckets_elems[index]; do { samp_meng::FOrder* ret = *prev; @@ -1199,7 +1270,7 @@ bool samp_meng::ind_order_InsertMaybe(samp_meng::FOrder& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void samp_meng::ind_order_Remove(samp_meng::FOrder& row) { if (LIKELY(row.ind_order_next != (samp_meng::FOrder*)-1)) {// check if in hash already - u32 index = ::i64_Hash(0, row.order) & (_db.ind_order_buckets_n - 1); + u32 index = row.ind_order_hashval & (_db.ind_order_buckets_n - 1); samp_meng::FOrder* *prev = &_db.ind_order_buckets_elems[index]; // addr of pointer to current element while (samp_meng::FOrder *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1216,8 +1287,14 @@ void samp_meng::ind_order_Remove(samp_meng::FOrder& row) { // --- samp_meng.FDb.ind_order.Reserve // Reserve enough room in the hash for N more elements. Return success code. void samp_meng::ind_order_Reserve(int n) { + ind_order_AbsReserve(_db.ind_order_n + n); +} + +// --- samp_meng.FDb.ind_order.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void samp_meng::ind_order_AbsReserve(int n) { u32 old_nbuckets = _db.ind_order_buckets_n; - u32 new_nelems = _db.ind_order_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1236,7 +1313,7 @@ void samp_meng::ind_order_Reserve(int n) { while (elem) { samp_meng::FOrder &row = *elem; samp_meng::FOrder* next = row.ind_order_next; - u32 index = ::i64_Hash(0, row.order) & (new_nbuckets-1); + u32 index = row.ind_order_hashval & (new_nbuckets-1); row.ind_order_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1443,14 +1520,9 @@ bool samp_meng::user_XrefMaybe(samp_meng::FUser &row) { // Find row by key. Return NULL if not found. samp_meng::FUser* samp_meng::ind_user_Find(i32 key) { u32 index = ::i32_Hash(0, key) & (_db.ind_user_buckets_n - 1); - samp_meng::FUser* *e = &_db.ind_user_buckets_elems[index]; - samp_meng::FUser* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).user == key; - if (done) break; - e = &ret->ind_user_next; - } while (true); + samp_meng::FUser *ret = _db.ind_user_buckets_elems[index]; + for (; ret && !((*ret).user == key); ret = ret->ind_user_next) { + } return ret; } @@ -1482,10 +1554,11 @@ samp_meng::FUser& samp_meng::ind_user_GetOrCreate(i32 key) { // --- samp_meng.FDb.ind_user.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool samp_meng::ind_user_InsertMaybe(samp_meng::FUser& row) { - ind_user_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_user_next == (samp_meng::FUser*)-1)) {// check if in hash already - u32 index = ::i32_Hash(0, row.user) & (_db.ind_user_buckets_n - 1); + row.ind_user_hashval = ::i32_Hash(0, row.user); + ind_user_Reserve(1); + u32 index = row.ind_user_hashval & (_db.ind_user_buckets_n - 1); samp_meng::FUser* *prev = &_db.ind_user_buckets_elems[index]; do { samp_meng::FUser* ret = *prev; @@ -1511,7 +1584,7 @@ bool samp_meng::ind_user_InsertMaybe(samp_meng::FUser& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void samp_meng::ind_user_Remove(samp_meng::FUser& row) { if (LIKELY(row.ind_user_next != (samp_meng::FUser*)-1)) {// check if in hash already - u32 index = ::i32_Hash(0, row.user) & (_db.ind_user_buckets_n - 1); + u32 index = row.ind_user_hashval & (_db.ind_user_buckets_n - 1); samp_meng::FUser* *prev = &_db.ind_user_buckets_elems[index]; // addr of pointer to current element while (samp_meng::FUser *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1528,8 +1601,14 @@ void samp_meng::ind_user_Remove(samp_meng::FUser& row) { // --- samp_meng.FDb.ind_user.Reserve // Reserve enough room in the hash for N more elements. Return success code. void samp_meng::ind_user_Reserve(int n) { + ind_user_AbsReserve(_db.ind_user_n + n); +} + +// --- samp_meng.FDb.ind_user.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void samp_meng::ind_user_AbsReserve(int n) { u32 old_nbuckets = _db.ind_user_buckets_n; - u32 new_nelems = _db.ind_user_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1548,7 +1627,7 @@ void samp_meng::ind_user_Reserve(int n) { while (elem) { samp_meng::FUser &row = *elem; samp_meng::FUser* next = row.ind_user_next; - u32 index = ::i32_Hash(0, row.user) & (new_nbuckets-1); + u32 index = row.ind_user_hashval & (new_nbuckets-1); row.ind_user_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1677,8 +1756,8 @@ void samp_meng::FDb_Uninit() { // File descriptor becomes owned by samp_meng::FFdin.in via FIohook field. // Whenever the file descriptor becomes readable, insert fdin into cd_fdin_read. void samp_meng::in_BeginRead(samp_meng::FFdin& fdin, algo::Fildes fd) { - callback_Set1(fdin.in_iohook, fdin, samp_meng::cd_fdin_read_Insert); fdin.in_iohook.fildes = fd; + callback_Set1(fdin.in_iohook, fdin, samp_meng::cd_fdin_read_Insert); IOEvtFlags flags; read_Set(flags, true); if (fdin.in_epoll_enable) { @@ -1731,6 +1810,23 @@ algo::aryptr samp_meng::in_GetMsg(samp_meng::FFdin& fdin) { return ret; } +// --- samp_meng.FFdin.in.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void samp_meng::in_Realloc(samp_meng::FFdin& fdin, int new_max) { + new_max = i32_Max(new_max, fdin.in_end); + u8 *new_mem = fdin.in_elems + ? (u8*)algo_lib::malloc_ReallocMem(fdin.in_elems, fdin.in_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("samp_meng.fbuf_nomem field:samp_meng.FFdin.in comment:'out of memory'"); + } + fdin.in_elems = new_mem; + fdin.in_max = new_max; +} + // --- samp_meng.FFdin.in.Refill // Refill buffer. Return false if no further refill possible (input buffer exhausted) bool samp_meng::in_Refill(samp_meng::FFdin& fdin) { @@ -1837,7 +1933,7 @@ void samp_meng::in_SkipMsg(samp_meng::FFdin& fdin) { } // --- samp_meng.FFdin.in.WriteAll -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. @@ -1851,22 +1947,39 @@ bool samp_meng::in_WriteAll(samp_meng::FFdin& fdin, u8 *in, i32 in_n) { // now try to write the message. i32 end = fdin.in_end; bool fits = end + in_n <= max; - if (fits && in_n > 0) { - memcpy(fdin.in_elems + end, in, in_n); - fdin.in_end = end + in_n; + if (fits) { + if (in_n > 0) { + memcpy(fdin.in_elems + end, in, in_n); + fdin.in_end = end + in_n; + } } return fits; } +// --- samp_meng.FFdin.in.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void samp_meng::in_WriteReserve(samp_meng::FFdin& fdin, u8 *in, i32 in_n) { + if (!in_WriteAll(fdin, in, in_n)) { + in_Realloc(fdin, fdin.in_max*2); + if (!in_WriteAll(fdin, in, in_n)) { + FatalErrorExit("in: out of memory"); + } + } +} + // --- samp_meng.FFdin..Init // Set all fields to initial values. void samp_meng::FFdin_Init(samp_meng::FFdin& fdin) { + fdin.in_elems = NULL; // in: initialize + fdin.in_max = 0; // in: initialize fdin.in_end = 0; // in: initialize fdin.in_start = 0; // in: initialize fdin.in_eof = false; // in: initialize fdin.in_msgvalid = false; // in: initialize fdin.in_msglen = 0; // in: initialize fdin.in_epoll_enable = true; // in: initialize + in_Realloc(fdin, 8192); fdin.cd_fdin_eof_next = (samp_meng::FFdin*)-1; // (samp_meng.FDb.cd_fdin_eof) not-in-list fdin.cd_fdin_eof_prev = NULL; // (samp_meng.FDb.cd_fdin_eof) fdin.cd_fdin_read_next = (samp_meng::FFdin*)-1; // (samp_meng.FDb.cd_fdin_read) not-in-list @@ -1878,6 +1991,13 @@ void samp_meng::FFdin_Uninit(samp_meng::FFdin& fdin) { samp_meng::FFdin &row = fdin; (void)row; cd_fdin_eof_Remove(row); // remove fdin from index cd_fdin_eof cd_fdin_read_Remove(row); // remove fdin from index cd_fdin_read + + // samp_meng.FFdin.in.Uninit (Fbuf) // + if (fdin.in_elems) { + algo_lib::malloc_FreeMem(fdin.in_elems, sizeof(char)*fdin.in_max); // (samp_meng.FFdin.in) + } + fdin.in_elems = NULL; + fdin.in_max = 0; } // --- samp_meng.I64Price8.value.SetDoubleMaybe @@ -1994,7 +2114,7 @@ void samp_meng::bh_order_Cascdel(samp_meng::FOrdq& ordq) { while (n > 0) { n--; samp_meng::FOrder &elem = *ordq.bh_order_elems[n]; // pick cheapest element to remove - elem.bh_order_idx = -1; // mark not-in-heap + elem.ordq_bh_order_idx = -1; // mark not-in-heap ordq.bh_order_n = n; order_Delete(elem); } @@ -2029,7 +2149,7 @@ static int samp_meng::bh_order_Downheap(samp_meng::FOrdq& ordq, samp_meng::FOrde if (!bh_order_ElemLt(ordq, *p,row)) { break; } - p->bh_order_idx = idx; + p->ordq_bh_order_idx = idx; elems[idx] = p; idx = child; child = idx*2+1; @@ -2040,12 +2160,12 @@ static int samp_meng::bh_order_Downheap(samp_meng::FOrdq& ordq, samp_meng::FOrde // --- samp_meng.FOrdq.bh_order.Insert // Insert row. Row must not already be in index. If row is already in index, do nothing. void samp_meng::bh_order_Insert(samp_meng::FOrdq& ordq, samp_meng::FOrder& row) { - if (LIKELY(row.bh_order_idx == -1)) { + if (LIKELY(row.ordq_bh_order_idx == -1)) { bh_order_Reserve(ordq, 1); int n = ordq.bh_order_n; ordq.bh_order_n = n + 1; int new_idx = bh_order_Upheap(ordq, row, n); - row.bh_order_idx = new_idx; + row.ordq_bh_order_idx = new_idx; ordq.bh_order_elems[new_idx] = &row; } } @@ -2054,7 +2174,7 @@ void samp_meng::bh_order_Insert(samp_meng::FOrdq& ordq, samp_meng::FOrder& row) // If row is in heap, update its position. If row is not in heap, insert it. // Return new position of item in the heap (0=top) i32 samp_meng::bh_order_Reheap(samp_meng::FOrdq& ordq, samp_meng::FOrder& row) { - int old_idx = row.bh_order_idx; + int old_idx = row.ordq_bh_order_idx; bool isnew = old_idx == -1; if (isnew) { bh_order_Reserve(ordq, 1); @@ -2064,7 +2184,7 @@ i32 samp_meng::bh_order_Reheap(samp_meng::FOrdq& ordq, samp_meng::FOrder& row) { if (!isnew && new_idx == old_idx) { new_idx = bh_order_Downheap(ordq, row, old_idx); } - row.bh_order_idx = new_idx; + row.ordq_bh_order_idx = new_idx; ordq.bh_order_elems[new_idx] = &row; return new_idx; } @@ -2077,7 +2197,7 @@ i32 samp_meng::bh_order_Reheap(samp_meng::FOrdq& ordq, samp_meng::FOrder& row) { i32 samp_meng::bh_order_ReheapFirst(samp_meng::FOrdq& ordq) { samp_meng::FOrder &row = *ordq.bh_order_elems[0]; i32 new_idx = bh_order_Downheap(ordq, row, 0); - row.bh_order_idx = new_idx; + row.ordq_bh_order_idx = new_idx; ordq.bh_order_elems[new_idx] = &row; return new_idx; } @@ -2086,9 +2206,9 @@ i32 samp_meng::bh_order_ReheapFirst(samp_meng::FOrdq& ordq) { // Remove element from index. If element is not in index, do nothing. void samp_meng::bh_order_Remove(samp_meng::FOrdq& ordq, samp_meng::FOrder& row) { if (bh_order_InBheapQ(row)) { - int old_idx = row.bh_order_idx; + int old_idx = row.ordq_bh_order_idx; if (ordq.bh_order_elems[old_idx] == &row) { // sanity check: heap points back to row - row.bh_order_idx = -1; // mark not in heap + row.ordq_bh_order_idx = -1; // mark not in heap i32 n = ordq.bh_order_n - 1; // index of last element in heap ordq.bh_order_n = n; // decrease count if (old_idx != n) { @@ -2097,7 +2217,7 @@ void samp_meng::bh_order_Remove(samp_meng::FOrdq& ordq, samp_meng::FOrder& row) if (new_idx == old_idx) { new_idx = bh_order_Downheap(ordq, *elem, old_idx); } - elem->bh_order_idx = new_idx; + elem->ordq_bh_order_idx = new_idx; ordq.bh_order_elems[new_idx] = elem; } } @@ -2109,7 +2229,7 @@ void samp_meng::bh_order_Remove(samp_meng::FOrdq& ordq, samp_meng::FOrder& row) void samp_meng::bh_order_RemoveAll(samp_meng::FOrdq& ordq) { int n = ordq.bh_order_n; for (int i = n - 1; i>=0; i--) { - ordq.bh_order_elems[i]->bh_order_idx = -1; // mark not-in-heap + ordq.bh_order_elems[i]->ordq_bh_order_idx = -1; // mark not-in-heap } ordq.bh_order_n = 0; } @@ -2121,13 +2241,13 @@ samp_meng::FOrder* samp_meng::bh_order_RemoveFirst(samp_meng::FOrdq& ordq) { samp_meng::FOrder *row = NULL; if (ordq.bh_order_n > 0) { row = ordq.bh_order_elems[0]; - row->bh_order_idx = -1; // mark not in heap + row->ordq_bh_order_idx = -1; // mark not in heap i32 n = ordq.bh_order_n - 1; // index of last element in heap ordq.bh_order_n = n; // decrease count if (n) { samp_meng::FOrder &elem = *ordq.bh_order_elems[n]; int new_idx = bh_order_Downheap(ordq, elem, 0); - elem.bh_order_idx = new_idx; + elem.ordq_bh_order_idx = new_idx; ordq.bh_order_elems[new_idx] = &elem; } } @@ -2162,7 +2282,7 @@ static int samp_meng::bh_order_Upheap(samp_meng::FOrdq& ordq, samp_meng::FOrder& if (!bh_order_ElemLt(ordq, row, *p)) { break; } - p->bh_order_idx = idx; + p->ordq_bh_order_idx = idx; elems[idx] = p; idx = j; } @@ -2250,7 +2370,7 @@ void samp_meng::ordq_bh_order_curs_Next(ordq_bh_order_curs &curs) { i = l; } while (i < n); curs.temp_n = n-1; - int index = dead->bh_order_idx; + int index = dead->ordq_bh_order_idx; i = (index*2+1); if (i < bh_order_N((*curs.parent))) { samp_meng::FOrder &elem = *curs.parent->bh_order_elems[i]; @@ -2296,15 +2416,11 @@ void samp_meng::Symbol_Print(samp_meng::Symbol& row, algo::cstring& str) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void samp_meng::c_ordq_Insert(samp_meng::FSymbol& symbol, samp_meng::FOrdq& row) { - if (bool_Update(row.symbol_c_ordq_in_ary,true)) { - // reserve space + if (!row.symbol_c_ordq_in_ary) { c_ordq_Reserve(symbol, 1); - u32 n = symbol.c_ordq_n; - u32 at = n; - samp_meng::FOrdq* *elems = symbol.c_ordq_elems; - elems[at] = &row; - symbol.c_ordq_n = n+1; - + u32 n = symbol.c_ordq_n++; + symbol.c_ordq_elems[n] = &row; + row.symbol_c_ordq_in_ary = true; } } @@ -2313,7 +2429,7 @@ void samp_meng::c_ordq_Insert(samp_meng::FSymbol& symbol, samp_meng::FOrdq& row) // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool samp_meng::c_ordq_InsertMaybe(samp_meng::FSymbol& symbol, samp_meng::FOrdq& row) { - bool retval = !row.symbol_c_ordq_in_ary; + bool retval = !symbol_c_ordq_InAryQ(row); c_ordq_Insert(symbol,row); // check is performed in _Insert again return retval; } @@ -2321,18 +2437,18 @@ bool samp_meng::c_ordq_InsertMaybe(samp_meng::FSymbol& symbol, samp_meng::FOrdq& // --- samp_meng.FSymbol.c_ordq.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void samp_meng::c_ordq_Remove(samp_meng::FSymbol& symbol, samp_meng::FOrdq& row) { + int n = symbol.c_ordq_n; if (bool_Update(row.symbol_c_ordq_in_ary,false)) { - int lim = symbol.c_ordq_n; samp_meng::FOrdq* *elems = symbol.c_ordq_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { samp_meng::FOrdq* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(samp_meng::FOrdq*) * (lim - j); + size_t nbytes = sizeof(samp_meng::FOrdq*) * (n - j); memmove(elems + i, elems + j, nbytes); - symbol.c_ordq_n = lim - 1; + symbol.c_ordq_n = n - 1; break; } } @@ -2368,12 +2484,12 @@ void samp_meng::FSymbol_Uninit(samp_meng::FSymbol& symbol) { // --- samp_meng.FUser.zd_order.Insert // Insert row into linked list. If row is already in linked list, do nothing. void samp_meng::zd_order_Insert(samp_meng::FUser& user, samp_meng::FOrder& row) { - if (!zd_order_InLlistQ(row)) { + if (!user_zd_order_InLlistQ(row)) { samp_meng::FOrder* old_tail = user.zd_order_tail; - row.zd_order_next = NULL; - row.zd_order_prev = old_tail; + row.user_zd_order_next = NULL; + row.user_zd_order_prev = old_tail; user.zd_order_tail = &row; - samp_meng::FOrder **new_row_a = &old_tail->zd_order_next; + samp_meng::FOrder **new_row_a = &old_tail->user_zd_order_next; samp_meng::FOrder **new_row_b = &user.zd_order_head; samp_meng::FOrder **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -2384,23 +2500,23 @@ void samp_meng::zd_order_Insert(samp_meng::FUser& user, samp_meng::FOrder& row) // --- samp_meng.FUser.zd_order.Remove // Remove element from index. If element is not in index, do nothing. void samp_meng::zd_order_Remove(samp_meng::FUser& user, samp_meng::FOrder& row) { - if (zd_order_InLlistQ(row)) { + if (user_zd_order_InLlistQ(row)) { samp_meng::FOrder* old_head = user.zd_order_head; (void)old_head; // in case it's not used - samp_meng::FOrder* prev = row.zd_order_prev; - samp_meng::FOrder* next = row.zd_order_next; + samp_meng::FOrder* prev = row.user_zd_order_prev; + samp_meng::FOrder* next = row.user_zd_order_next; // if element is first, adjust list head; otherwise, adjust previous element's next - samp_meng::FOrder **new_next_a = &prev->zd_order_next; + samp_meng::FOrder **new_next_a = &prev->user_zd_order_next; samp_meng::FOrder **new_next_b = &user.zd_order_head; samp_meng::FOrder **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - samp_meng::FOrder **new_prev_a = &next->zd_order_prev; + samp_meng::FOrder **new_prev_a = &next->user_zd_order_prev; samp_meng::FOrder **new_prev_b = &user.zd_order_tail; samp_meng::FOrder **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; user.zd_order_n--; - row.zd_order_next=(samp_meng::FOrder*)-1; // not-in-list + row.user_zd_order_next=(samp_meng::FOrder*)-1; // not-in-list } } @@ -2412,9 +2528,9 @@ void samp_meng::zd_order_RemoveAll(samp_meng::FUser& user) { user.zd_order_tail = NULL; user.zd_order_n = 0; while (row) { - samp_meng::FOrder* row_next = row->zd_order_next; - row->zd_order_next = (samp_meng::FOrder*)-1; - row->zd_order_prev = NULL; + samp_meng::FOrder* row_next = row->user_zd_order_next; + row->user_zd_order_next = (samp_meng::FOrder*)-1; + row->user_zd_order_prev = NULL; row = row_next; } } @@ -2425,14 +2541,14 @@ samp_meng::FOrder* samp_meng::zd_order_RemoveFirst(samp_meng::FUser& user) { samp_meng::FOrder *row = NULL; row = user.zd_order_head; if (row) { - samp_meng::FOrder *next = row->zd_order_next; + samp_meng::FOrder *next = row->user_zd_order_next; user.zd_order_head = next; - samp_meng::FOrder **new_end_a = &next->zd_order_prev; + samp_meng::FOrder **new_end_a = &next->user_zd_order_prev; samp_meng::FOrder **new_end_b = &user.zd_order_tail; samp_meng::FOrder **new_end = next ? new_end_a : new_end_b; *new_end = NULL; user.zd_order_n--; - row->zd_order_next = (samp_meng::FOrder*)-1; // mark as not-in-list + row->user_zd_order_next = (samp_meng::FOrder*)-1; // mark as not-in-list } return row; } @@ -2715,21 +2831,20 @@ bool samp_meng::MassCancelReqMsg_ReadFieldMaybe(samp_meng::MassCancelReqMsg& par switch(field_id) { case samp_meng_FieldId_base: { retval = false; - break; - } + } break; case samp_meng_FieldId_type: { retval = false; - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } + } break; case samp_meng_FieldId_user: { retval = u32_ReadStrptrMaybe(parent.user, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -2905,13 +3020,14 @@ bool samp_meng::MsgHeader_ReadFieldMaybe(samp_meng::MsgHeader& parent, algo::str switch(field_id) { case samp_meng_FieldId_type: { retval = type_ReadStrptrMaybe(parent, strval); - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3103,37 +3219,32 @@ bool samp_meng::NewOrderMsg_ReadFieldMaybe(samp_meng::NewOrderMsg& parent, algo: switch(field_id) { case samp_meng_FieldId_base: { retval = false; - break; - } + } break; case samp_meng_FieldId_type: { retval = false; - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } + } break; case samp_meng_FieldId_time: { retval = algo::UnTime_ReadStrptrMaybe(parent.time, strval); - break; - } + } break; case samp_meng_FieldId_price: { retval = samp_meng::I64Price8_ReadStrptrMaybe(parent.price, strval); - break; - } + } break; case samp_meng_FieldId_order: { retval = u64_ReadStrptrMaybe(parent.order, strval); - break; - } + } break; case samp_meng_FieldId_symbol: { retval = samp_meng::Symbol_ReadStrptrMaybe(parent.symbol, strval); - break; - } + } break; case samp_meng_FieldId_qty: { retval = u32_ReadStrptrMaybe(parent.qty, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3193,37 +3304,32 @@ bool samp_meng::NewOrderReqMsg_ReadFieldMaybe(samp_meng::NewOrderReqMsg& parent, switch(field_id) { case samp_meng_FieldId_base: { retval = false; - break; - } + } break; case samp_meng_FieldId_type: { retval = false; - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } + } break; case samp_meng_FieldId_ioc: { retval = bool_ReadStrptrMaybe(parent.ioc, strval); - break; - } + } break; case samp_meng_FieldId_qty: { retval = i32_ReadStrptrMaybe(parent.qty, strval); - break; - } + } break; case samp_meng_FieldId_price: { retval = samp_meng::I64Price8_ReadStrptrMaybe(parent.price, strval); - break; - } + } break; case samp_meng_FieldId_symbol: { retval = samp_meng::Symbol_ReadStrptrMaybe(parent.symbol, strval); - break; - } + } break; case samp_meng_FieldId_user: { retval = u32_ReadStrptrMaybe(parent.user, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3283,21 +3389,20 @@ bool samp_meng::NewSymbolMsg_ReadFieldMaybe(samp_meng::NewSymbolMsg& parent, alg switch(field_id) { case samp_meng_FieldId_base: { retval = false; - break; - } + } break; case samp_meng_FieldId_type: { retval = false; - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } + } break; case samp_meng_FieldId_symbol: { retval = samp_meng::Symbol_ReadStrptrMaybe(parent.symbol, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3345,21 +3450,20 @@ bool samp_meng::NewSymbolReqMsg_ReadFieldMaybe(samp_meng::NewSymbolReqMsg& paren switch(field_id) { case samp_meng_FieldId_base: { retval = false; - break; - } + } break; case samp_meng_FieldId_type: { retval = false; - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } + } break; case samp_meng_FieldId_symbol: { retval = samp_meng::Symbol_ReadStrptrMaybe(parent.symbol, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3407,21 +3511,20 @@ bool samp_meng::NewUserMsg_ReadFieldMaybe(samp_meng::NewUserMsg& parent, algo::s switch(field_id) { case samp_meng_FieldId_base: { retval = false; - break; - } + } break; case samp_meng_FieldId_type: { retval = false; - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } + } break; case samp_meng_FieldId_user: { retval = u32_ReadStrptrMaybe(parent.user, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3469,21 +3572,20 @@ bool samp_meng::NewUserReqMsg_ReadFieldMaybe(samp_meng::NewUserReqMsg& parent, a switch(field_id) { case samp_meng_FieldId_base: { retval = false; - break; - } + } break; case samp_meng_FieldId_type: { retval = false; - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } + } break; case samp_meng_FieldId_user: { retval = u32_ReadStrptrMaybe(parent.user, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3531,29 +3633,26 @@ bool samp_meng::OrderTradeMsg_ReadFieldMaybe(samp_meng::OrderTradeMsg& parent, a switch(field_id) { case samp_meng_FieldId_base: { retval = false; - break; - } + } break; case samp_meng_FieldId_type: { retval = false; - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } + } break; case samp_meng_FieldId_order: { retval = u64_ReadStrptrMaybe(parent.order, strval); - break; - } + } break; case samp_meng_FieldId_qty: { retval = u32_ReadStrptrMaybe(parent.qty, strval); - break; - } + } break; case samp_meng_FieldId_price: { retval = samp_meng::I64Price8_ReadStrptrMaybe(parent.price, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3636,21 +3735,20 @@ bool samp_meng::TextMsg_ReadFieldMaybe(samp_meng::TextMsg& parent, algo::strptr switch(field_id) { case samp_meng_FieldId_base: { retval = false; - break; - } + } break; case samp_meng_FieldId_type: { retval = false; - break; - } + } break; case samp_meng_FieldId_length: { retval = false; - break; - } + } break; case samp_meng_FieldId_text: { retval = text_ReadStrptrMaybe(parent, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -3690,6 +3788,7 @@ inline static void samp_meng::SizeCheck() { void samp_meng::StaticCheck() { algo_assert(_offset_of(samp_meng::CancelOrderMsg, order) + sizeof(((samp_meng::CancelOrderMsg*)0)->order) == sizeof(samp_meng::CancelOrderMsg)); algo_assert(_offset_of(samp_meng::CancelReqMsg, order) + sizeof(((samp_meng::CancelReqMsg*)0)->order) == sizeof(samp_meng::CancelReqMsg)); + algo_assert(_offset_of(samp_meng::trace, dispatch_In_Unkmsg_cycles) + sizeof(((samp_meng::trace*)0)->dispatch_In_Unkmsg_cycles) == sizeof(samp_meng::trace)); algo_assert(_offset_of(samp_meng::I64Price8, value) + sizeof(((samp_meng::I64Price8*)0)->value) == sizeof(samp_meng::I64Price8)); algo_assert(_offset_of(samp_meng::Symbol, symbol) + sizeof(((samp_meng::Symbol*)0)->symbol) == sizeof(samp_meng::Symbol)); algo_assert(_offset_of(samp_meng::FieldId, value) + sizeof(((samp_meng::FieldId*)0)->value) == sizeof(samp_meng::FieldId)); @@ -3707,35 +3806,90 @@ void samp_meng::StaticCheck() { algo_assert(_offset_of(samp_meng::OrderTradeMsg, price) + sizeof(((samp_meng::OrderTradeMsg*)0)->price) == sizeof(samp_meng::OrderTradeMsg)); } +// --- samp_meng.In.CancelReqMsg.UpdateCycles +void samp_meng::In_CancelReqMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + samp_meng::_db.trace.dispatch_In_CancelReqMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- samp_meng.In.MassCancelReqMsg.UpdateCycles +void samp_meng::In_MassCancelReqMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + samp_meng::_db.trace.dispatch_In_MassCancelReqMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- samp_meng.In.NewOrderReqMsg.UpdateCycles +void samp_meng::In_NewOrderReqMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + samp_meng::_db.trace.dispatch_In_NewOrderReqMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- samp_meng.In.NewSymbolReqMsg.UpdateCycles +void samp_meng::In_NewSymbolReqMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + samp_meng::_db.trace.dispatch_In_NewSymbolReqMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- samp_meng.In.NewUserReqMsg.UpdateCycles +void samp_meng::In_NewUserReqMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + samp_meng::_db.trace.dispatch_In_NewUserReqMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + +// --- samp_meng.In.TextMsg.UpdateCycles +void samp_meng::In_TextMsg_UpdateCycles() { + u64 cur_cycles = algo::get_cycles(); + samp_meng::_db.trace.dispatch_In_TextMsg_cycles += cur_cycles - algo_lib::_db.clock; + algo_lib::_db.clock = algo::SchedTime(cur_cycles); +} + // --- samp_meng.In..DispatchRaw int samp_meng::InDispatchRaw(samp_meng::InCase type, u8 *msg, u32 len) { int ret = 0; switch(type) { case 11: if (sizeof(samp_meng::CancelReqMsg) <= len) { + ++samp_meng::_db.trace.dispatch_In_CancelReqMsg; samp_meng::In_CancelReqMsg((samp_meng::CancelReqMsg&)*msg); + samp_meng::In_CancelReqMsg_UpdateCycles(); ret = (int)sizeof(samp_meng::CancelReqMsg); } break; case 12: if (sizeof(samp_meng::MassCancelReqMsg) <= len) { + ++samp_meng::_db.trace.dispatch_In_MassCancelReqMsg; samp_meng::In_MassCancelReqMsg((samp_meng::MassCancelReqMsg&)*msg); + samp_meng::In_MassCancelReqMsg_UpdateCycles(); ret = (int)sizeof(samp_meng::MassCancelReqMsg); } break; case 10: if (sizeof(samp_meng::NewOrderReqMsg) <= len) { + ++samp_meng::_db.trace.dispatch_In_NewOrderReqMsg; samp_meng::In_NewOrderReqMsg((samp_meng::NewOrderReqMsg&)*msg); + samp_meng::In_NewOrderReqMsg_UpdateCycles(); ret = (int)sizeof(samp_meng::NewOrderReqMsg); } break; case 13: if (sizeof(samp_meng::NewSymbolReqMsg) <= len) { + ++samp_meng::_db.trace.dispatch_In_NewSymbolReqMsg; samp_meng::In_NewSymbolReqMsg((samp_meng::NewSymbolReqMsg&)*msg); + samp_meng::In_NewSymbolReqMsg_UpdateCycles(); ret = (int)sizeof(samp_meng::NewSymbolReqMsg); } break; case 14: if (sizeof(samp_meng::NewUserReqMsg) <= len) { + ++samp_meng::_db.trace.dispatch_In_NewUserReqMsg; samp_meng::In_NewUserReqMsg((samp_meng::NewUserReqMsg&)*msg); + samp_meng::In_NewUserReqMsg_UpdateCycles(); ret = (int)sizeof(samp_meng::NewUserReqMsg); } break; case 7: if (sizeof(samp_meng::TextMsg) <= len) { + ++samp_meng::_db.trace.dispatch_In_TextMsg; samp_meng::In_TextMsg((samp_meng::TextMsg&)*msg); + samp_meng::In_TextMsg_UpdateCycles(); ret = (int)sizeof(samp_meng::TextMsg); } break; default: + ++samp_meng::_db.trace.dispatch_In_Unkmsg; break; } return ret; @@ -4024,12 +4178,13 @@ bool samp_meng::MsgHeaderMsgs_ReadStrptrMaybe(algo::strptr str, algo::ByteAry &b // --- samp_meng...main int main(int argc, char **argv) { try { - algo_lib::FDb_Init(); lib_json::FDb_Init(); + algo_lib::FDb_Init(); samp_meng::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock samp_meng::ReadArgv(); // dmmeta.main:samp_meng samp_meng::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -4041,8 +4196,8 @@ int main(int argc, char **argv) { } try { samp_meng::FDb_Uninit(); - lib_json::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/samp_regx_gen.cpp b/cpp/gen/samp_regx_gen.cpp index cb0f1654..1bffc6cf 100644 --- a/cpp/gen/samp_regx_gen.cpp +++ b/cpp/gen/samp_regx_gen.cpp @@ -27,12 +27,15 @@ #include "include/gen/samp_regx_gen.inl.h" #include "include/gen/command_gen.h" #include "include/gen/command_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep samp_regx::FDb samp_regx::_db; // dependency found via dev.targdep @@ -43,16 +46,15 @@ const char *samp_regx_help = " OPTION TYPE DFLT COMMENT\n" " -in string \"data\" Input directory or filename, - for stdin\n" " [expr] string Expression\n" -" -style int acr Regx style (acr|shell|classic|literal)\n" -" acr ACR-style regx\n" -" shell Shell-style regx\n" -" classic Classic regx\n" -" literal Literal string\n" -" -match Match a string\n" +" -style enum acr Regx style (default|sql|acr|shell|literal)\n" +" -trace Trace regx innards\n" +" -capture Use capture groups\n" +" -full Y Match full string\n" +" -f is a filename, grep the lines\n" +" -match Match a string, exit code represnts success\n" " [string] string \"\" String to match\n" -" -show Show regx innards\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -170,9 +172,8 @@ void samp_regx::ReadArgv() { } if (ch_N(attrname) == 0) { err << "samp_regx: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { if (!expr_present) { err << "samp_regx: Missing value for required argument -expr (see -help)" << eol; @@ -231,7 +235,7 @@ void samp_regx::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -298,8 +302,8 @@ bool samp_regx::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && samp_regx::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -473,11 +477,13 @@ void samp_regx::StaticCheck() { // --- samp_regx...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); samp_regx::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock samp_regx::ReadArgv(); // dmmeta.main:samp_regx samp_regx::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -490,6 +496,7 @@ int main(int argc, char **argv) { try { samp_regx::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/sampdb_gen.cpp b/cpp/gen/sampdb_gen.cpp new file mode 100644 index 00000000..880fabc3 --- /dev/null +++ b/cpp/gen/sampdb_gen.cpp @@ -0,0 +1,529 @@ +// +// cpp/gen/sampdb_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/sampdb_gen.h" +#include "include/gen/sampdb_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude +namespace sampdb { // gen:ns_print_proto + // func:sampdb...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- sampdb.FieldId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* sampdb::value_ToCstr(const sampdb::FieldId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case sampdb_FieldId_gitfile : ret = "gitfile"; break; + case sampdb_FieldId_comment : ret = "comment"; break; + case sampdb_FieldId_targdep : ret = "targdep"; break; + case sampdb_FieldId_target : ret = "target"; break; + case sampdb_FieldId_parent : ret = "parent"; break; + case sampdb_FieldId_rec : ret = "rec"; break; + case sampdb_FieldId_pre : ret = "pre"; break; + case sampdb_FieldId_dflt : ret = "dflt"; break; + case sampdb_FieldId_recipe : ret = "recipe"; break; + case sampdb_FieldId_targsrc : ret = "targsrc"; break; + case sampdb_FieldId_src : ret = "src"; break; + case sampdb_FieldId_value : ret = "value"; break; + } + return ret; +} + +// --- sampdb.FieldId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void sampdb::value_Print(const sampdb::FieldId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- sampdb.FieldId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool sampdb::value_SetStrptrMaybe(sampdb::FieldId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('p','r','e'): { + value_SetEnum(parent,sampdb_FieldId_pre); ret = true; break; + } + case LE_STR3('r','e','c'): { + value_SetEnum(parent,sampdb_FieldId_rec); ret = true; break; + } + case LE_STR3('s','r','c'): { + value_SetEnum(parent,sampdb_FieldId_src); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('d','f','l','t'): { + value_SetEnum(parent,sampdb_FieldId_dflt); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,sampdb_FieldId_value); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('p','a','r','e','n','t'): { + value_SetEnum(parent,sampdb_FieldId_parent); ret = true; break; + } + case LE_STR6('r','e','c','i','p','e'): { + value_SetEnum(parent,sampdb_FieldId_recipe); ret = true; break; + } + case LE_STR6('t','a','r','g','e','t'): { + value_SetEnum(parent,sampdb_FieldId_target); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('c','o','m','m','e','n','t'): { + value_SetEnum(parent,sampdb_FieldId_comment); ret = true; break; + } + case LE_STR7('g','i','t','f','i','l','e'): { + value_SetEnum(parent,sampdb_FieldId_gitfile); ret = true; break; + } + case LE_STR7('t','a','r','g','d','e','p'): { + value_SetEnum(parent,sampdb_FieldId_targdep); ret = true; break; + } + case LE_STR7('t','a','r','g','s','r','c'): { + value_SetEnum(parent,sampdb_FieldId_targsrc); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- sampdb.FieldId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void sampdb::value_SetStrptr(sampdb::FieldId& parent, algo::strptr rhs, sampdb_FieldIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- sampdb.FieldId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool sampdb::value_ReadStrptrMaybe(sampdb::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- sampdb.FieldId..ReadStrptrMaybe +// Read fields of sampdb::FieldId from an ascii string. +// The format of the string is the format of the sampdb::FieldId's only field +bool sampdb::FieldId_ReadStrptrMaybe(sampdb::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- sampdb.FieldId..Print +// print string representation of ROW to string STR +// cfmt:sampdb.FieldId.String printfmt:Raw +void sampdb::FieldId_Print(sampdb::FieldId& row, algo::cstring& str) { + sampdb::value_Print(row, str); +} + +// --- sampdb.Gitfile..ReadFieldMaybe +bool sampdb::Gitfile_ReadFieldMaybe(sampdb::Gitfile& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + sampdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case sampdb_FieldId_gitfile: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.gitfile, strval); + } break; + case sampdb_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- sampdb.Gitfile..ReadStrptrMaybe +// Read fields of sampdb::Gitfile from an ascii string. +// The format of the string is an ssim Tuple +bool sampdb::Gitfile_ReadStrptrMaybe(sampdb::Gitfile &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "sampdb.gitfile") || algo::StripTypeTag(in_str, "sampdb.Gitfile"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Gitfile_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- sampdb.Gitfile..Print +// print string representation of ROW to string STR +// cfmt:sampdb.Gitfile.String printfmt:Tuple +void sampdb::Gitfile_Print(sampdb::Gitfile& row, algo::cstring& str) { + algo::tempstr temp; + str << "sampdb.gitfile"; + + algo::Smallstr50_Print(row.gitfile, temp); + PrintAttrSpaceReset(str,"gitfile", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- sampdb.Targdep.target.Get +algo::Smallstr50 sampdb::target_Get(sampdb::Targdep& parent) { + algo::Smallstr50 ret(algo::Pathcomp(parent.targdep, ".LL")); + return ret; +} + +// --- sampdb.Targdep.target.Get2 +algo::Smallstr50 sampdb::Targdep_target_Get(algo::strptr arg) { + algo::Smallstr50 ret(algo::Pathcomp(arg, ".LL")); + return ret; +} + +// --- sampdb.Targdep.parent.Get +algo::Smallstr50 sampdb::parent_Get(sampdb::Targdep& parent) { + algo::Smallstr50 ret(algo::Pathcomp(parent.targdep, ".LR")); + return ret; +} + +// --- sampdb.Targdep.parent.Get2 +algo::Smallstr50 sampdb::Targdep_parent_Get(algo::strptr arg) { + algo::Smallstr50 ret(algo::Pathcomp(arg, ".LR")); + return ret; +} + +// --- sampdb.Targdep..Concat_target_parent +tempstr sampdb::Targdep_Concat_target_parent( const algo::strptr& target ,const algo::strptr& parent ) { + return tempstr() << target <<'.'<< parent ; +} + +// --- sampdb.Targdep..ReadFieldMaybe +bool sampdb::Targdep_ReadFieldMaybe(sampdb::Targdep& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + sampdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case sampdb_FieldId_targdep: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.targdep, strval); + } break; + case sampdb_FieldId_target: { + retval = false; + } break; + case sampdb_FieldId_parent: { + retval = false; + } break; + case sampdb_FieldId_rec: { + retval = bool_ReadStrptrMaybe(parent.rec, strval); + } break; + case sampdb_FieldId_pre: { + retval = bool_ReadStrptrMaybe(parent.pre, strval); + } break; + case sampdb_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- sampdb.Targdep..ReadStrptrMaybe +// Read fields of sampdb::Targdep from an ascii string. +// The format of the string is an ssim Tuple +bool sampdb::Targdep_ReadStrptrMaybe(sampdb::Targdep &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "sampdb.targdep") || algo::StripTypeTag(in_str, "sampdb.Targdep"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Targdep_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- sampdb.Targdep..Print +// print string representation of ROW to string STR +// cfmt:sampdb.Targdep.String printfmt:Tuple +void sampdb::Targdep_Print(sampdb::Targdep& row, algo::cstring& str) { + algo::tempstr temp; + str << "sampdb.targdep"; + + algo::Smallstr50_Print(row.targdep, temp); + PrintAttrSpaceReset(str,"targdep", temp); + + bool_Print(row.rec, temp); + PrintAttrSpaceReset(str,"rec", temp); + + bool_Print(row.pre, temp); + PrintAttrSpaceReset(str,"pre", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- sampdb.Target..ReadFieldMaybe +bool sampdb::Target_ReadFieldMaybe(sampdb::Target& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + sampdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case sampdb_FieldId_target: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.target, strval); + } break; + case sampdb_FieldId_dflt: { + retval = bool_ReadStrptrMaybe(parent.dflt, strval); + } break; + case sampdb_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- sampdb.Target..ReadStrptrMaybe +// Read fields of sampdb::Target from an ascii string. +// The format of the string is an ssim Tuple +bool sampdb::Target_ReadStrptrMaybe(sampdb::Target &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "sampdb.target") || algo::StripTypeTag(in_str, "sampdb.Target"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Target_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- sampdb.Target..Print +// print string representation of ROW to string STR +// cfmt:sampdb.Target.String printfmt:Tuple +void sampdb::Target_Print(sampdb::Target& row, algo::cstring& str) { + algo::tempstr temp; + str << "sampdb.target"; + + algo::Smallstr50_Print(row.target, temp); + PrintAttrSpaceReset(str,"target", temp); + + bool_Print(row.dflt, temp); + PrintAttrSpaceReset(str,"dflt", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- sampdb.Targrec..ReadFieldMaybe +bool sampdb::Targrec_ReadFieldMaybe(sampdb::Targrec& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + sampdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case sampdb_FieldId_target: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.target, strval); + } break; + case sampdb_FieldId_recipe: { + retval = algo::cstring_ReadStrptrMaybe(parent.recipe, strval); + } break; + case sampdb_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- sampdb.Targrec..ReadStrptrMaybe +// Read fields of sampdb::Targrec from an ascii string. +// The format of the string is an ssim Tuple +bool sampdb::Targrec_ReadStrptrMaybe(sampdb::Targrec &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "sampdb.targrec") || algo::StripTypeTag(in_str, "sampdb.Targrec"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Targrec_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- sampdb.Targrec..Print +// print string representation of ROW to string STR +// cfmt:sampdb.Targrec.String printfmt:Tuple +void sampdb::Targrec_Print(sampdb::Targrec& row, algo::cstring& str) { + algo::tempstr temp; + str << "sampdb.targrec"; + + algo::Smallstr50_Print(row.target, temp); + PrintAttrSpaceReset(str,"target", temp); + + algo::cstring_Print(row.recipe, temp); + PrintAttrSpaceReset(str,"recipe", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- sampdb.Targsrc.target.Get +algo::Smallstr50 sampdb::target_Get(sampdb::Targsrc& parent) { + algo::Smallstr50 ret(algo::Pathcomp(parent.targsrc, "/LL")); + return ret; +} + +// --- sampdb.Targsrc.target.Get2 +algo::Smallstr50 sampdb::Targsrc_target_Get(algo::strptr arg) { + algo::Smallstr50 ret(algo::Pathcomp(arg, "/LL")); + return ret; +} + +// --- sampdb.Targsrc.src.Get +algo::Smallstr50 sampdb::src_Get(sampdb::Targsrc& parent) { + algo::Smallstr50 ret(algo::Pathcomp(parent.targsrc, "/LR")); + return ret; +} + +// --- sampdb.Targsrc.src.Get2 +algo::Smallstr50 sampdb::Targsrc_src_Get(algo::strptr arg) { + algo::Smallstr50 ret(algo::Pathcomp(arg, "/LR")); + return ret; +} + +// --- sampdb.Targsrc..Concat_target_src +tempstr sampdb::Targsrc_Concat_target_src( const algo::strptr& target ,const algo::strptr& src ) { + return tempstr() << target <<'/'<< src ; +} + +// --- sampdb.Targsrc..ReadFieldMaybe +bool sampdb::Targsrc_ReadFieldMaybe(sampdb::Targsrc& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + sampdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case sampdb_FieldId_targsrc: { + retval = algo::Smallstr50_ReadStrptrMaybe(parent.targsrc, strval); + } break; + case sampdb_FieldId_pre: { + retval = bool_ReadStrptrMaybe(parent.pre, strval); + } break; + case sampdb_FieldId_target: { + retval = false; + } break; + case sampdb_FieldId_src: { + retval = false; + } break; + case sampdb_FieldId_rec: { + retval = bool_ReadStrptrMaybe(parent.rec, strval); + } break; + case sampdb_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- sampdb.Targsrc..ReadStrptrMaybe +// Read fields of sampdb::Targsrc from an ascii string. +// The format of the string is an ssim Tuple +bool sampdb::Targsrc_ReadStrptrMaybe(sampdb::Targsrc &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "sampdb.targsrc") || algo::StripTypeTag(in_str, "sampdb.Targsrc"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Targsrc_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- sampdb.Targsrc..Print +// print string representation of ROW to string STR +// cfmt:sampdb.Targsrc.String printfmt:Tuple +void sampdb::Targsrc_Print(sampdb::Targsrc& row, algo::cstring& str) { + algo::tempstr temp; + str << "sampdb.targsrc"; + + algo::Smallstr50_Print(row.targsrc, temp); + PrintAttrSpaceReset(str,"targsrc", temp); + + bool_Print(row.pre, temp); + PrintAttrSpaceReset(str,"pre", temp); + + bool_Print(row.rec, temp); + PrintAttrSpaceReset(str,"rec", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- sampdb...SizeCheck +inline static void sampdb::SizeCheck() { +} diff --git a/cpp/gen/sandbox_gen.cpp b/cpp/gen/sandbox_gen.cpp index 9f1e0d75..dbb30a3a 100644 --- a/cpp/gen/sandbox_gen.cpp +++ b/cpp/gen/sandbox_gen.cpp @@ -31,12 +31,15 @@ #include "include/gen/dev_gen.inl.h" #include "include/gen/algo_gen.h" #include "include/gen/algo_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep sandbox::FDb sandbox::_db; // dependency found via dev.targdep @@ -57,10 +60,11 @@ const char *sandbox_help = " [cmd]... string Command to execute in sandbox\n" " -diff Show diff after running command\n" " -files... string Shell regx to diff\n" -" -refs string \"HEAD\" Refs to fetch into sandbox\n" +" -refs string \"HEAD\" Additional list of refs to fetch into sandbox\n" +" -ref string \"HEAD\" Reset to this ref\n" " -q Quiet mode\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -182,9 +186,8 @@ void sandbox::ReadArgv() { } if (ch_N(attrname) == 0) { err << "sandbox: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { if (!name_present) { err << "sandbox: Missing value for required argument -name (see -help)" << eol; @@ -243,7 +249,7 @@ void sandbox::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -333,8 +339,8 @@ bool sandbox::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && sandbox::LoadTuplesFile(algo::SsimFname(root,"dev.sbpath"),recursive); retval = retval && sandbox::LoadTuplesFile(algo::SsimFname(root,"dev.sandbox"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -513,14 +519,9 @@ bool sandbox::sandbox_XrefMaybe(sandbox::FSandbox &row) { // Find row by key. Return NULL if not found. sandbox::FSandbox* sandbox::ind_sandbox_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_sandbox_buckets_n - 1); - sandbox::FSandbox* *e = &_db.ind_sandbox_buckets_elems[index]; - sandbox::FSandbox* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).sandbox == key; - if (done) break; - e = &ret->ind_sandbox_next; - } while (true); + sandbox::FSandbox *ret = _db.ind_sandbox_buckets_elems[index]; + for (; ret && !((*ret).sandbox == key); ret = ret->ind_sandbox_next) { + } return ret; } @@ -552,10 +553,11 @@ sandbox::FSandbox& sandbox::ind_sandbox_GetOrCreate(const algo::strptr& key) { // --- sandbox.FDb.ind_sandbox.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool sandbox::ind_sandbox_InsertMaybe(sandbox::FSandbox& row) { - ind_sandbox_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_sandbox_next == (sandbox::FSandbox*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.sandbox) & (_db.ind_sandbox_buckets_n - 1); + row.ind_sandbox_hashval = algo::Smallstr50_Hash(0, row.sandbox); + ind_sandbox_Reserve(1); + u32 index = row.ind_sandbox_hashval & (_db.ind_sandbox_buckets_n - 1); sandbox::FSandbox* *prev = &_db.ind_sandbox_buckets_elems[index]; do { sandbox::FSandbox* ret = *prev; @@ -581,7 +583,7 @@ bool sandbox::ind_sandbox_InsertMaybe(sandbox::FSandbox& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void sandbox::ind_sandbox_Remove(sandbox::FSandbox& row) { if (LIKELY(row.ind_sandbox_next != (sandbox::FSandbox*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.sandbox) & (_db.ind_sandbox_buckets_n - 1); + u32 index = row.ind_sandbox_hashval & (_db.ind_sandbox_buckets_n - 1); sandbox::FSandbox* *prev = &_db.ind_sandbox_buckets_elems[index]; // addr of pointer to current element while (sandbox::FSandbox *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -598,8 +600,14 @@ void sandbox::ind_sandbox_Remove(sandbox::FSandbox& row) { // --- sandbox.FDb.ind_sandbox.Reserve // Reserve enough room in the hash for N more elements. Return success code. void sandbox::ind_sandbox_Reserve(int n) { + ind_sandbox_AbsReserve(_db.ind_sandbox_n + n); +} + +// --- sandbox.FDb.ind_sandbox.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void sandbox::ind_sandbox_AbsReserve(int n) { u32 old_nbuckets = _db.ind_sandbox_buckets_n; - u32 new_nelems = _db.ind_sandbox_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -618,7 +626,7 @@ void sandbox::ind_sandbox_Reserve(int n) { while (elem) { sandbox::FSandbox &row = *elem; sandbox::FSandbox* next = row.ind_sandbox_next; - u32 index = algo::Smallstr50_Hash(0, row.sandbox) & (new_nbuckets-1); + u32 index = row.ind_sandbox_hashval & (new_nbuckets-1); row.ind_sandbox_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1009,11 +1017,13 @@ void sandbox::StaticCheck() { // --- sandbox...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); sandbox::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock sandbox::ReadArgv(); // dmmeta.main:sandbox sandbox::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -1026,6 +1036,7 @@ int main(int argc, char **argv) { try { sandbox::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/src_func_gen.cpp b/cpp/gen/src_func_gen.cpp index 91cfba7f..6dc48179 100644 --- a/cpp/gen/src_func_gen.cpp +++ b/cpp/gen/src_func_gen.cpp @@ -37,44 +37,51 @@ #include "include/gen/algo_lib_gen.inl.h" #include "include/gen/dev_gen.h" #include "include/gen/dev_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep src_func::FDb src_func::_db; // dependency found via dev.targdep namespace src_func { const char *src_func_help = "src_func: Access / edit functions\n" -"Usage: src_func [[-target:]] [[-name:]] [[-body:]] [options]\n" -" OPTION TYPE DFLT COMMENT\n" -" -in string \"data\" Input directory or filename, - for stdin\n" -" [target] regx \"%\" Visit these targets\n" -" [name] regx \"%\" Match function name\n" -" [body] regx \"%\" Match function body\n" -" -targsrc regx \"\" Visit these sources (optional)\n" -" -func regx \"%\" (with -listfunc) Match function prototype\n" -" -comment regx \"%\" (with -listfunc) Match function comment\n" -" -nextfile string \"\" Print name of next srcfile in targsrc list\n" -" -other (with -nextfile), name of previous file\n" -" -updateproto Update prototypes in headers\n" -" -listfunc Show functions in target\n" -" -iffy Select functions that may contain errors\n" -" -proto (with -listfunc) List prototypes only\n" -" -gen (with -listfunc) Visit generated files\n" -" -showloc Y (with -listfunc) Show file location\n" -" -showstatic Y (with -listfunc) Show static functions\n" -" -showsortkey (with -listfunc) Display function sortkey\n" -" -sortname (with -listfunc) Sort functions by name\n" -" -e (with -listfunc) Edit found functions\n" -" -baddecl Report and fail on bad declarations\n" -" -report\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" -" -help Print help and exit; alias -h\n" -" -version Print version and exit\n" -" -signature Show signatures and exit; alias -sig\n" +"Usage: src_func [[-func:]] [options]\n" +" OPTION TYPE DFLT COMMENT\n" +" -in string \"data\" Input directory or filename, - for stdin\n" +" -targsrc regx \"%\" (scan) Limit scanning to these sources only\n" +" -acrkey regx \"%\" Select function by acr key that caused it\n" +" [func] regx \"%\" Target.function regex\n" +" -nextfile string \"\" (action) Print name of next srcfile in targsrc list\n" +" -other (with -nextfile), name of previous file\n" +" -list (action) List matching functions\n" +" -updateproto (action) Update prototypes in headers\n" +" -createmissing (action) Create missing functions declared in userfunc table\n" +" -iffy (filter) Select functions that may contain errors\n" +" -gen (scan) Scan generated files\n" +" -showloc (output) Show file location\n" +" -f (output) -sortname -showcomment -showbody\n" +" -showstatic Y (filter) Allow static functions\n" +" -matchproto regx \"%\" (filter) Match function prototype\n" +" -matchbody regx \"%\" (filter) Match function body\n" +" -matchcomment regx \"%\" (filter) Match function comment\n" +" -showsortkey (output) Display function sortkey\n" +" -showcomment (output) Display function comment\n" +" -showbody (output) Print function body\n" +" -sortname (output) Sort functions by name\n" +" -printssim (output) Print ssim tuples\n" +" -e Edit found functions\n" +" -baddecl Report and fail on bad declarations\n" +" -report Print final report\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" +" -help Print help and exit; alias -h\n" +" -version Print version and exit\n" +" -signature Show signatures and exit; alias -sig\n" ; @@ -104,14 +111,10 @@ namespace src_func { // gen:ns_print_proto inline static bool bh_func_ElemLt(src_func::FFunc &a, src_func::FFunc &b) __attribute__((nothrow)); // func:src_func.FDb.bh_func_curs.Add static void _db_bh_func_curs_Add(_db_bh_func_curs &curs, src_func::FFunc& row); - // func:src_func.FDb.dispatch.InputMaybe - static bool dispatch_InputMaybe(dmmeta::Dispatch &elem) __attribute__((nothrow)); - // func:src_func.FDb.fstep.InputMaybe - static bool fstep_InputMaybe(dmmeta::Fstep &elem) __attribute__((nothrow)); - // func:src_func.FDb.gstatic.InputMaybe - static bool gstatic_InputMaybe(dmmeta::Gstatic &elem) __attribute__((nothrow)); // func:src_func.FDb.ctypelen.InputMaybe static bool ctypelen_InputMaybe(dmmeta::Ctypelen &elem) __attribute__((nothrow)); + // func:src_func.FDb.userfunc.InputMaybe + static bool userfunc_InputMaybe(dmmeta::Userfunc &elem) __attribute__((nothrow)); // find trace by row id (used to implement reflection) // func:src_func.FDb.trace.RowidFind static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow)); @@ -160,92 +163,6 @@ void src_func::trace_Print(src_func::trace& row, algo::cstring& str) { (void)row;//only to avoid -Wunused-parameter } -// --- src_func.FDb.genprefix.Alloc -// Allocate memory for new default row. -// If out of memory, process is killed. -src_func::FGenprefix& src_func::genprefix_Alloc() { - src_func::FGenprefix* row = genprefix_AllocMaybe(); - if (UNLIKELY(row == NULL)) { - FatalErrorExit("src_func.out_of_mem field:src_func.FDb.genprefix comment:'Alloc failed'"); - } - return *row; -} - -// --- src_func.FDb.genprefix.AllocMaybe -// Allocate memory for new element. If out of memory, return NULL. -src_func::FGenprefix* src_func::genprefix_AllocMaybe() { - src_func::FGenprefix *row = (src_func::FGenprefix*)genprefix_AllocMem(); - if (row) { - new (row) src_func::FGenprefix; // call constructor - } - return row; -} - -// --- src_func.FDb.genprefix.AllocMem -// Allocate space for one element. If no memory available, return NULL. -void* src_func::genprefix_AllocMem() { - u64 new_nelems = _db.genprefix_n+1; - // compute level and index on level - u64 bsr = algo::u64_BitScanReverse(new_nelems); - u64 base = u64(1)<0; ) { - n--; - genprefix_qFind(u64(n)).~FGenprefix(); // destroy last element - _db.genprefix_n = i32(n); - } -} - -// --- src_func.FDb.genprefix.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void src_func::genprefix_RemoveLast() { - u64 n = _db.genprefix_n; - if (n > 0) { - n -= 1; - genprefix_qFind(u64(n)).~FGenprefix(); - _db.genprefix_n = i32(n); - } -} - -// --- src_func.FDb.genprefix.XrefMaybe -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool src_func::genprefix_XrefMaybe(src_func::FGenprefix &row) { - bool retval = true; - (void)row; - // insert genprefix into index ind_genprefix - if (true) { // user-defined insert condition - bool success = ind_genprefix_InsertMaybe(row); - if (UNLIKELY(!success)) { - ch_RemoveAll(algo_lib::_db.errtext); - algo_lib::_db.errtext << "src_func.duplicate_key xref:src_func.FDb.ind_genprefix"; // check for duplicate key - return false; - } - } - return retval; -} - // --- src_func.FDb._db.ReadArgv // Read argc,argv directly into the fields of the command line(s) // The following fields are updated: @@ -332,9 +249,8 @@ void src_func::ReadArgv() { } if (ch_N(attrname) == 0) { err << "src_func: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:src_func.FDb.cmdline @@ -388,7 +307,7 @@ void src_func::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -433,7 +352,7 @@ static void src_func::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'src_func.Input' signature:'5d834e23d5da4b43a45249cf5cc36918b46802fa'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'src_func.Input' signature:'7eac979b98f561e842f8ee28e37732cad21f9ebe'"); } // --- src_func.FDb._db.InsertStrptrMaybe @@ -456,30 +375,18 @@ bool src_func::InsertStrptrMaybe(algo::strptr str) { retval = retval && target_InputMaybe(elem); break; } - case src_func_TableId_dmmeta_Dispatch: { // finput:src_func.FDb.dispatch - dmmeta::Dispatch elem; - retval = dmmeta::Dispatch_ReadStrptrMaybe(elem, str); - retval = retval && dispatch_InputMaybe(elem); - break; - } - case src_func_TableId_dmmeta_Fstep: { // finput:src_func.FDb.fstep - dmmeta::Fstep elem; - retval = dmmeta::Fstep_ReadStrptrMaybe(elem, str); - retval = retval && fstep_InputMaybe(elem); - break; - } - case src_func_TableId_dmmeta_Gstatic: { // finput:src_func.FDb.gstatic - dmmeta::Gstatic elem; - retval = dmmeta::Gstatic_ReadStrptrMaybe(elem, str); - retval = retval && gstatic_InputMaybe(elem); - break; - } case src_func_TableId_dmmeta_Ctypelen: { // finput:src_func.FDb.ctypelen dmmeta::Ctypelen elem; retval = dmmeta::Ctypelen_ReadStrptrMaybe(elem, str); retval = retval && ctypelen_InputMaybe(elem); break; } + case src_func_TableId_dmmeta_Userfunc: { // finput:src_func.FDb.userfunc + dmmeta::Userfunc elem; + retval = dmmeta::Userfunc_ReadStrptrMaybe(elem, str); + retval = retval && userfunc_InputMaybe(elem); + break; + } default: break; } //switch @@ -498,16 +405,14 @@ bool src_func::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (root == "-") { retval = src_func::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); } else if (DirectoryQ(root)) { - retval = retval && src_func::LoadTuplesFile(algo::SsimFname(root,"dmmeta.gstatic"),recursive); - retval = retval && src_func::LoadTuplesFile(algo::SsimFname(root,"dmmeta.fstep"),recursive); - retval = retval && src_func::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispatch"),recursive); + retval = retval && src_func::LoadTuplesFile(algo::SsimFname(root,"dmmeta.userfunc"),recursive); retval = retval && src_func::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); retval = retval && src_func::LoadTuplesFile(algo::SsimFname(root,"dmmeta.ctypelen"),recursive); retval = retval && src_func::LoadTuplesFile(algo::SsimFname(root,"dev.target"),recursive); retval = retval && src_func::LoadTuplesFile(algo::SsimFname(root,"dev.targsrc"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -777,14 +682,9 @@ bool src_func::target_XrefMaybe(src_func::FTarget &row) { // Find row by key. Return NULL if not found. src_func::FTarget* src_func::ind_target_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_target_buckets_n - 1); - src_func::FTarget* *e = &_db.ind_target_buckets_elems[index]; - src_func::FTarget* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).target == key; - if (done) break; - e = &ret->ind_target_next; - } while (true); + src_func::FTarget *ret = _db.ind_target_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_target_next) { + } return ret; } @@ -816,10 +716,11 @@ src_func::FTarget& src_func::ind_target_GetOrCreate(const algo::strptr& key) { // --- src_func.FDb.ind_target.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool src_func::ind_target_InsertMaybe(src_func::FTarget& row) { - ind_target_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_target_next == (src_func::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + row.ind_target_hashval = algo::Smallstr16_Hash(0, row.target); + ind_target_Reserve(1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); src_func::FTarget* *prev = &_db.ind_target_buckets_elems[index]; do { src_func::FTarget* ret = *prev; @@ -845,7 +746,7 @@ bool src_func::ind_target_InsertMaybe(src_func::FTarget& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void src_func::ind_target_Remove(src_func::FTarget& row) { if (LIKELY(row.ind_target_next != (src_func::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); src_func::FTarget* *prev = &_db.ind_target_buckets_elems[index]; // addr of pointer to current element while (src_func::FTarget *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -862,8 +763,14 @@ void src_func::ind_target_Remove(src_func::FTarget& row) { // --- src_func.FDb.ind_target.Reserve // Reserve enough room in the hash for N more elements. Return success code. void src_func::ind_target_Reserve(int n) { + ind_target_AbsReserve(_db.ind_target_n + n); +} + +// --- src_func.FDb.ind_target.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_func::ind_target_AbsReserve(int n) { u32 old_nbuckets = _db.ind_target_buckets_n; - u32 new_nelems = _db.ind_target_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -882,7 +789,7 @@ void src_func::ind_target_Reserve(int n) { while (elem) { src_func::FTarget &row = *elem; src_func::FTarget* next = row.ind_target_next; - u32 index = algo::Smallstr16_Hash(0, row.target) & (new_nbuckets-1); + u32 index = row.ind_target_hashval & (new_nbuckets-1); row.ind_target_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -998,14 +905,9 @@ bool src_func::func_XrefMaybe(src_func::FFunc &row) { // Find row by key. Return NULL if not found. src_func::FFunc* src_func::ind_func_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_func_buckets_n - 1); - src_func::FFunc* *e = &_db.ind_func_buckets_elems[index]; - src_func::FFunc* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).func == key; - if (done) break; - e = &ret->ind_func_next; - } while (true); + src_func::FFunc *ret = _db.ind_func_buckets_elems[index]; + for (; ret && !((*ret).func == key); ret = ret->ind_func_next) { + } return ret; } @@ -1020,10 +922,11 @@ src_func::FFunc& src_func::ind_func_FindX(const algo::strptr& key) { // --- src_func.FDb.ind_func.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool src_func::ind_func_InsertMaybe(src_func::FFunc& row) { - ind_func_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_func_next == (src_func::FFunc*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.func) & (_db.ind_func_buckets_n - 1); + row.ind_func_hashval = algo::cstring_Hash(0, row.func); + ind_func_Reserve(1); + u32 index = row.ind_func_hashval & (_db.ind_func_buckets_n - 1); src_func::FFunc* *prev = &_db.ind_func_buckets_elems[index]; do { src_func::FFunc* ret = *prev; @@ -1049,7 +952,7 @@ bool src_func::ind_func_InsertMaybe(src_func::FFunc& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void src_func::ind_func_Remove(src_func::FFunc& row) { if (LIKELY(row.ind_func_next != (src_func::FFunc*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.func) & (_db.ind_func_buckets_n - 1); + u32 index = row.ind_func_hashval & (_db.ind_func_buckets_n - 1); src_func::FFunc* *prev = &_db.ind_func_buckets_elems[index]; // addr of pointer to current element while (src_func::FFunc *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1066,8 +969,14 @@ void src_func::ind_func_Remove(src_func::FFunc& row) { // --- src_func.FDb.ind_func.Reserve // Reserve enough room in the hash for N more elements. Return success code. void src_func::ind_func_Reserve(int n) { + ind_func_AbsReserve(_db.ind_func_n + n); +} + +// --- src_func.FDb.ind_func.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_func::ind_func_AbsReserve(int n) { u32 old_nbuckets = _db.ind_func_buckets_n; - u32 new_nelems = _db.ind_func_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1086,7 +995,7 @@ void src_func::ind_func_Reserve(int n) { while (elem) { src_func::FFunc &row = *elem; src_func::FFunc* next = row.ind_func_next; - u32 index = algo::cstring_Hash(0, row.func) & (new_nbuckets-1); + u32 index = row.ind_func_hashval & (new_nbuckets-1); row.ind_func_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1274,648 +1183,763 @@ inline static bool src_func::bh_func_ElemLt(src_func::FFunc &a, src_func::FFunc return sortkey_Lt(a, b); } -// --- src_func.FDb.dispatch.Alloc +// --- src_func.FDb.ctypelen.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -src_func::FDispatch& src_func::dispatch_Alloc() { - src_func::FDispatch* row = dispatch_AllocMaybe(); +src_func::FCtypelen& src_func::ctypelen_Alloc() { + src_func::FCtypelen* row = ctypelen_AllocMaybe(); if (UNLIKELY(row == NULL)) { - FatalErrorExit("src_func.out_of_mem field:src_func.FDb.dispatch comment:'Alloc failed'"); + FatalErrorExit("src_func.out_of_mem field:src_func.FDb.ctypelen comment:'Alloc failed'"); } return *row; } -// --- src_func.FDb.dispatch.AllocMaybe +// --- src_func.FDb.ctypelen.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -src_func::FDispatch* src_func::dispatch_AllocMaybe() { - src_func::FDispatch *row = (src_func::FDispatch*)dispatch_AllocMem(); +src_func::FCtypelen* src_func::ctypelen_AllocMaybe() { + src_func::FCtypelen *row = (src_func::FCtypelen*)ctypelen_AllocMem(); if (row) { - new (row) src_func::FDispatch; // call constructor + new (row) src_func::FCtypelen; // call constructor } return row; } -// --- src_func.FDb.dispatch.InsertMaybe +// --- src_func.FDb.ctypelen.InsertMaybe // Create new row from struct. // Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -src_func::FDispatch* src_func::dispatch_InsertMaybe(const dmmeta::Dispatch &value) { - src_func::FDispatch *row = &dispatch_Alloc(); // if out of memory, process dies. if input error, return NULL. - dispatch_CopyIn(*row,const_cast(value)); - bool ok = dispatch_XrefMaybe(*row); // this may return false +src_func::FCtypelen* src_func::ctypelen_InsertMaybe(const dmmeta::Ctypelen &value) { + src_func::FCtypelen *row = &ctypelen_Alloc(); // if out of memory, process dies. if input error, return NULL. + ctypelen_CopyIn(*row,const_cast(value)); + bool ok = ctypelen_XrefMaybe(*row); // this may return false if (!ok) { - dispatch_RemoveLast(); // delete offending row, any existing xrefs are cleared + ctypelen_RemoveLast(); // delete offending row, any existing xrefs are cleared row = NULL; // forget this ever happened } return row; } -// --- src_func.FDb.dispatch.AllocMem +// --- src_func.FDb.ctypelen.AllocMem // Allocate space for one element. If no memory available, return NULL. -void* src_func::dispatch_AllocMem() { - u64 new_nelems = _db.dispatch_n+1; +void* src_func::ctypelen_AllocMem() { + u64 new_nelems = _db.ctypelen_n+1; // compute level and index on level u64 bsr = algo::u64_BitScanReverse(new_nelems); u64 base = u64(1)<0; ) { +void src_func::ctypelen_RemoveAll() { + for (u64 n = _db.ctypelen_n; n>0; ) { n--; - dispatch_qFind(u64(n)).~FDispatch(); // destroy last element - _db.dispatch_n = i32(n); + ctypelen_qFind(u64(n)).~FCtypelen(); // destroy last element + _db.ctypelen_n = i32(n); } } -// --- src_func.FDb.dispatch.RemoveLast +// --- src_func.FDb.ctypelen.RemoveLast // Delete last element of array. Do nothing if array is empty. -void src_func::dispatch_RemoveLast() { - u64 n = _db.dispatch_n; +void src_func::ctypelen_RemoveLast() { + u64 n = _db.ctypelen_n; if (n > 0) { n -= 1; - dispatch_qFind(u64(n)).~FDispatch(); - _db.dispatch_n = i32(n); + ctypelen_qFind(u64(n)).~FCtypelen(); + _db.ctypelen_n = i32(n); } } -// --- src_func.FDb.dispatch.InputMaybe -static bool src_func::dispatch_InputMaybe(dmmeta::Dispatch &elem) { +// --- src_func.FDb.ctypelen.InputMaybe +static bool src_func::ctypelen_InputMaybe(dmmeta::Ctypelen &elem) { bool retval = true; - retval = dispatch_InsertMaybe(elem) != nullptr; + retval = ctypelen_InsertMaybe(elem) != nullptr; return retval; } -// --- src_func.FDb.dispatch.XrefMaybe +// --- src_func.FDb.ctypelen.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool src_func::dispatch_XrefMaybe(src_func::FDispatch &row) { +bool src_func::ctypelen_XrefMaybe(src_func::FCtypelen &row) { bool retval = true; (void)row; - return retval; -} - -// --- src_func.FDb.fstep.Alloc -// Allocate memory for new default row. -// If out of memory, process is killed. -src_func::FFstep& src_func::fstep_Alloc() { - src_func::FFstep* row = fstep_AllocMaybe(); - if (UNLIKELY(row == NULL)) { - FatalErrorExit("src_func.out_of_mem field:src_func.FDb.fstep comment:'Alloc failed'"); + // insert ctypelen into index ind_ctypelen + if (true) { // user-defined insert condition + bool success = ind_ctypelen_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "src_func.duplicate_key xref:src_func.FDb.ind_ctypelen"; // check for duplicate key + return false; + } } - return *row; + return retval; } -// --- src_func.FDb.fstep.AllocMaybe -// Allocate memory for new element. If out of memory, return NULL. -src_func::FFstep* src_func::fstep_AllocMaybe() { - src_func::FFstep *row = (src_func::FFstep*)fstep_AllocMem(); - if (row) { - new (row) src_func::FFstep; // call constructor +// --- src_func.FDb.ind_ctypelen.Find +// Find row by key. Return NULL if not found. +src_func::FCtypelen* src_func::ind_ctypelen_Find(const algo::strptr& key) { + u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctypelen_buckets_n - 1); + src_func::FCtypelen *ret = _db.ind_ctypelen_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctypelen_next) { } - return row; + return ret; } -// --- src_func.FDb.fstep.InsertMaybe -// Create new row from struct. -// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -src_func::FFstep* src_func::fstep_InsertMaybe(const dmmeta::Fstep &value) { - src_func::FFstep *row = &fstep_Alloc(); // if out of memory, process dies. if input error, return NULL. - fstep_CopyIn(*row,const_cast(value)); - bool ok = fstep_XrefMaybe(*row); // this may return false - if (!ok) { - fstep_RemoveLast(); // delete offending row, any existing xrefs are cleared - row = NULL; // forget this ever happened - } - return row; +// --- src_func.FDb.ind_ctypelen.FindX +// Look up row by key and return reference. Throw exception if not found +src_func::FCtypelen& src_func::ind_ctypelen_FindX(const algo::strptr& key) { + src_func::FCtypelen* ret = ind_ctypelen_Find(key); + vrfy(ret, tempstr() << "src_func.key_error table:ind_ctypelen key:'"<0; ) { - n--; - fstep_qFind(u64(n)).~FFstep(); // destroy last element - _db.fstep_n = i32(n); +// --- src_func.FDb.ind_ctypelen.InsertMaybe +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +bool src_func::ind_ctypelen_InsertMaybe(src_func::FCtypelen& row) { + bool retval = true; // if already in hash, InsertMaybe returns true + if (LIKELY(row.ind_ctypelen_next == (src_func::FCtypelen*)-1)) {// check if in hash already + row.ind_ctypelen_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctypelen_Reserve(1); + u32 index = row.ind_ctypelen_hashval & (_db.ind_ctypelen_buckets_n - 1); + src_func::FCtypelen* *prev = &_db.ind_ctypelen_buckets_elems[index]; + do { + src_func::FCtypelen* ret = *prev; + if (!ret) { // exit condition 1: reached the end of the list + break; + } + if ((*ret).ctype == row.ctype) { // exit condition 2: found matching key + retval = false; + break; + } + prev = &ret->ind_ctypelen_next; + } while (true); + if (retval) { + row.ind_ctypelen_next = *prev; + _db.ind_ctypelen_n++; + *prev = &row; + } } + return retval; } -// --- src_func.FDb.fstep.RemoveLast -// Delete last element of array. Do nothing if array is empty. -void src_func::fstep_RemoveLast() { - u64 n = _db.fstep_n; - if (n > 0) { - n -= 1; - fstep_qFind(u64(n)).~FFstep(); - _db.fstep_n = i32(n); +// --- src_func.FDb.ind_ctypelen.Remove +// Remove reference to element from hash index. If element is not in hash, do nothing +void src_func::ind_ctypelen_Remove(src_func::FCtypelen& row) { + if (LIKELY(row.ind_ctypelen_next != (src_func::FCtypelen*)-1)) {// check if in hash already + u32 index = row.ind_ctypelen_hashval & (_db.ind_ctypelen_buckets_n - 1); + src_func::FCtypelen* *prev = &_db.ind_ctypelen_buckets_elems[index]; // addr of pointer to current element + while (src_func::FCtypelen *next = *prev) { // scan the collision chain for our element + if (next == &row) { // found it? + *prev = next->ind_ctypelen_next; // unlink (singly linked list) + _db.ind_ctypelen_n--; + row.ind_ctypelen_next = (src_func::FCtypelen*)-1;// not-in-hash + break; + } + prev = &next->ind_ctypelen_next; + } } } -// --- src_func.FDb.fstep.InputMaybe -static bool src_func::fstep_InputMaybe(dmmeta::Fstep &elem) { - bool retval = true; - retval = fstep_InsertMaybe(elem) != nullptr; - return retval; +// --- src_func.FDb.ind_ctypelen.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void src_func::ind_ctypelen_Reserve(int n) { + ind_ctypelen_AbsReserve(_db.ind_ctypelen_n + n); } -// --- src_func.FDb.fstep.XrefMaybe -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool src_func::fstep_XrefMaybe(src_func::FFstep &row) { - bool retval = true; - (void)row; - return retval; +// --- src_func.FDb.ind_ctypelen.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_func::ind_ctypelen_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_ctypelen_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(src_func::FCtypelen*); + u32 new_size = new_nbuckets * sizeof(src_func::FCtypelen*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + src_func::FCtypelen* *new_buckets = (src_func::FCtypelen**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("src_func.out_of_memory field:src_func.FDb.ind_ctypelen"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_ctypelen_buckets_n; i++) { + src_func::FCtypelen* elem = _db.ind_ctypelen_buckets_elems[i]; + while (elem) { + src_func::FCtypelen &row = *elem; + src_func::FCtypelen* next = row.ind_ctypelen_next; + u32 index = row.ind_ctypelen_hashval & (new_nbuckets-1); + row.ind_ctypelen_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_ctypelen_buckets_elems, old_size); + _db.ind_ctypelen_buckets_elems = new_buckets; + _db.ind_ctypelen_buckets_n = new_nbuckets; + } } -// --- src_func.FDb.gstatic.Alloc +// --- src_func.FDb.userfunc.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -src_func::FGstatic& src_func::gstatic_Alloc() { - src_func::FGstatic* row = gstatic_AllocMaybe(); +src_func::FUserfunc& src_func::userfunc_Alloc() { + src_func::FUserfunc* row = userfunc_AllocMaybe(); if (UNLIKELY(row == NULL)) { - FatalErrorExit("src_func.out_of_mem field:src_func.FDb.gstatic comment:'Alloc failed'"); + FatalErrorExit("src_func.out_of_mem field:src_func.FDb.userfunc comment:'Alloc failed'"); } return *row; } -// --- src_func.FDb.gstatic.AllocMaybe +// --- src_func.FDb.userfunc.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -src_func::FGstatic* src_func::gstatic_AllocMaybe() { - src_func::FGstatic *row = (src_func::FGstatic*)gstatic_AllocMem(); +src_func::FUserfunc* src_func::userfunc_AllocMaybe() { + src_func::FUserfunc *row = (src_func::FUserfunc*)userfunc_AllocMem(); if (row) { - new (row) src_func::FGstatic; // call constructor + new (row) src_func::FUserfunc; // call constructor } return row; } -// --- src_func.FDb.gstatic.InsertMaybe +// --- src_func.FDb.userfunc.InsertMaybe // Create new row from struct. // Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -src_func::FGstatic* src_func::gstatic_InsertMaybe(const dmmeta::Gstatic &value) { - src_func::FGstatic *row = &gstatic_Alloc(); // if out of memory, process dies. if input error, return NULL. - gstatic_CopyIn(*row,const_cast(value)); - bool ok = gstatic_XrefMaybe(*row); // this may return false +src_func::FUserfunc* src_func::userfunc_InsertMaybe(const dmmeta::Userfunc &value) { + src_func::FUserfunc *row = &userfunc_Alloc(); // if out of memory, process dies. if input error, return NULL. + userfunc_CopyIn(*row,const_cast(value)); + bool ok = userfunc_XrefMaybe(*row); // this may return false if (!ok) { - gstatic_RemoveLast(); // delete offending row, any existing xrefs are cleared + userfunc_RemoveLast(); // delete offending row, any existing xrefs are cleared row = NULL; // forget this ever happened } return row; } -// --- src_func.FDb.gstatic.AllocMem +// --- src_func.FDb.userfunc.AllocMem // Allocate space for one element. If no memory available, return NULL. -void* src_func::gstatic_AllocMem() { - u64 new_nelems = _db.gstatic_n+1; +void* src_func::userfunc_AllocMem() { + u64 new_nelems = _db.userfunc_n+1; // compute level and index on level u64 bsr = algo::u64_BitScanReverse(new_nelems); u64 base = u64(1)<0; ) { +void src_func::userfunc_RemoveAll() { + for (u64 n = _db.userfunc_n; n>0; ) { n--; - gstatic_qFind(u64(n)).~FGstatic(); // destroy last element - _db.gstatic_n = i32(n); + userfunc_qFind(u64(n)).~FUserfunc(); // destroy last element + _db.userfunc_n = i32(n); } } -// --- src_func.FDb.gstatic.RemoveLast +// --- src_func.FDb.userfunc.RemoveLast // Delete last element of array. Do nothing if array is empty. -void src_func::gstatic_RemoveLast() { - u64 n = _db.gstatic_n; +void src_func::userfunc_RemoveLast() { + u64 n = _db.userfunc_n; if (n > 0) { n -= 1; - gstatic_qFind(u64(n)).~FGstatic(); - _db.gstatic_n = i32(n); + userfunc_qFind(u64(n)).~FUserfunc(); + _db.userfunc_n = i32(n); } } -// --- src_func.FDb.gstatic.InputMaybe -static bool src_func::gstatic_InputMaybe(dmmeta::Gstatic &elem) { +// --- src_func.FDb.userfunc.InputMaybe +static bool src_func::userfunc_InputMaybe(dmmeta::Userfunc &elem) { bool retval = true; - retval = gstatic_InsertMaybe(elem) != nullptr; + retval = userfunc_InsertMaybe(elem) != nullptr; return retval; } -// --- src_func.FDb.gstatic.XrefMaybe +// --- src_func.FDb.userfunc.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool src_func::gstatic_XrefMaybe(src_func::FGstatic &row) { +bool src_func::userfunc_XrefMaybe(src_func::FUserfunc &row) { bool retval = true; (void)row; - return retval; -} - -// --- src_func.FDb.ind_genprefix.Find + // insert userfunc into index ind_userfunc + if (true) { // user-defined insert condition + bool success = ind_userfunc_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "src_func.duplicate_key xref:src_func.FDb.ind_userfunc"; // check for duplicate key + return false; + } + } + // insert userfunc into index ind_userfunc_cppname + if (true) { // user-defined insert condition + bool success = ind_userfunc_cppname_InsertMaybe(row); + if (UNLIKELY(!success)) { + ch_RemoveAll(algo_lib::_db.errtext); + algo_lib::_db.errtext << "src_func.duplicate_key xref:src_func.FDb.ind_userfunc_cppname"; // check for duplicate key + return false; + } + } + return retval; +} + +// --- src_func.FDb.ind_userfunc.Find // Find row by key. Return NULL if not found. -src_func::FGenprefix* src_func::ind_genprefix_Find(const algo::strptr& key) { - u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_genprefix_buckets_n - 1); - src_func::FGenprefix* *e = &_db.ind_genprefix_buckets_elems[index]; - src_func::FGenprefix* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).genprefix == key; - if (done) break; - e = &ret->ind_genprefix_next; - } while (true); +src_func::FUserfunc* src_func::ind_userfunc_Find(const algo::strptr& key) { + u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_userfunc_buckets_n - 1); + src_func::FUserfunc *ret = _db.ind_userfunc_buckets_elems[index]; + for (; ret && !((*ret).userfunc == key); ret = ret->ind_userfunc_next) { + } return ret; } -// --- src_func.FDb.ind_genprefix.FindX +// --- src_func.FDb.ind_userfunc.FindX // Look up row by key and return reference. Throw exception if not found -src_func::FGenprefix& src_func::ind_genprefix_FindX(const algo::strptr& key) { - src_func::FGenprefix* ret = ind_genprefix_Find(key); - vrfy(ret, tempstr() << "src_func.key_error table:ind_genprefix key:'"<ind_genprefix_next; + prev = &ret->ind_userfunc_next; } while (true); if (retval) { - row.ind_genprefix_next = *prev; - _db.ind_genprefix_n++; + row.ind_userfunc_next = *prev; + _db.ind_userfunc_n++; *prev = &row; } } return retval; } -// --- src_func.FDb.ind_genprefix.Remove +// --- src_func.FDb.ind_userfunc.Remove // Remove reference to element from hash index. If element is not in hash, do nothing -void src_func::ind_genprefix_Remove(src_func::FGenprefix& row) { - if (LIKELY(row.ind_genprefix_next != (src_func::FGenprefix*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.genprefix) & (_db.ind_genprefix_buckets_n - 1); - src_func::FGenprefix* *prev = &_db.ind_genprefix_buckets_elems[index]; // addr of pointer to current element - while (src_func::FGenprefix *next = *prev) { // scan the collision chain for our element +void src_func::ind_userfunc_Remove(src_func::FUserfunc& row) { + if (LIKELY(row.ind_userfunc_next != (src_func::FUserfunc*)-1)) {// check if in hash already + u32 index = row.ind_userfunc_hashval & (_db.ind_userfunc_buckets_n - 1); + src_func::FUserfunc* *prev = &_db.ind_userfunc_buckets_elems[index]; // addr of pointer to current element + while (src_func::FUserfunc *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_genprefix_next; // unlink (singly linked list) - _db.ind_genprefix_n--; - row.ind_genprefix_next = (src_func::FGenprefix*)-1;// not-in-hash + *prev = next->ind_userfunc_next; // unlink (singly linked list) + _db.ind_userfunc_n--; + row.ind_userfunc_next = (src_func::FUserfunc*)-1;// not-in-hash break; } - prev = &next->ind_genprefix_next; + prev = &next->ind_userfunc_next; } } } -// --- src_func.FDb.ind_genprefix.Reserve +// --- src_func.FDb.ind_userfunc.Reserve // Reserve enough room in the hash for N more elements. Return success code. -void src_func::ind_genprefix_Reserve(int n) { - u32 old_nbuckets = _db.ind_genprefix_buckets_n; - u32 new_nelems = _db.ind_genprefix_n + n; +void src_func::ind_userfunc_Reserve(int n) { + ind_userfunc_AbsReserve(_db.ind_userfunc_n + n); +} + +// --- src_func.FDb.ind_userfunc.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_func::ind_userfunc_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_userfunc_buckets_n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); - u32 old_size = old_nbuckets * sizeof(src_func::FGenprefix*); - u32 new_size = new_nbuckets * sizeof(src_func::FGenprefix*); + u32 old_size = old_nbuckets * sizeof(src_func::FUserfunc*); + u32 new_size = new_nbuckets * sizeof(src_func::FUserfunc*); // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably // means new memory will have to be allocated anyway - src_func::FGenprefix* *new_buckets = (src_func::FGenprefix**)algo_lib::malloc_AllocMem(new_size); + src_func::FUserfunc* *new_buckets = (src_func::FUserfunc**)algo_lib::malloc_AllocMem(new_size); if (UNLIKELY(!new_buckets)) { - FatalErrorExit("src_func.out_of_memory field:src_func.FDb.ind_genprefix"); + FatalErrorExit("src_func.out_of_memory field:src_func.FDb.ind_userfunc"); } memset(new_buckets, 0, new_size); // clear pointers // rehash all entries - for (int i = 0; i < _db.ind_genprefix_buckets_n; i++) { - src_func::FGenprefix* elem = _db.ind_genprefix_buckets_elems[i]; + for (int i = 0; i < _db.ind_userfunc_buckets_n; i++) { + src_func::FUserfunc* elem = _db.ind_userfunc_buckets_elems[i]; while (elem) { - src_func::FGenprefix &row = *elem; - src_func::FGenprefix* next = row.ind_genprefix_next; - u32 index = algo::Smallstr100_Hash(0, row.genprefix) & (new_nbuckets-1); - row.ind_genprefix_next = new_buckets[index]; + src_func::FUserfunc &row = *elem; + src_func::FUserfunc* next = row.ind_userfunc_next; + u32 index = row.ind_userfunc_hashval & (new_nbuckets-1); + row.ind_userfunc_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } } // free old array - algo_lib::malloc_FreeMem(_db.ind_genprefix_buckets_elems, old_size); - _db.ind_genprefix_buckets_elems = new_buckets; - _db.ind_genprefix_buckets_n = new_nbuckets; + algo_lib::malloc_FreeMem(_db.ind_userfunc_buckets_elems, old_size); + _db.ind_userfunc_buckets_elems = new_buckets; + _db.ind_userfunc_buckets_n = new_nbuckets; } } -// --- src_func.FDb.ctypelen.Alloc +// --- src_func.FDb.ind_userfunc_cppname.Find +// Find row by key. Return NULL if not found. +src_func::FUserfunc* src_func::ind_userfunc_cppname_Find(const algo::strptr& key) { + u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_userfunc_cppname_buckets_n - 1); + src_func::FUserfunc *ret = _db.ind_userfunc_cppname_buckets_elems[index]; + for (; ret && !((*ret).cppname == key); ret = ret->ind_userfunc_cppname_next) { + } + return ret; +} + +// --- src_func.FDb.ind_userfunc_cppname.FindX +// Look up row by key and return reference. Throw exception if not found +src_func::FUserfunc& src_func::ind_userfunc_cppname_FindX(const algo::strptr& key) { + src_func::FUserfunc* ret = ind_userfunc_cppname_Find(key); + vrfy(ret, tempstr() << "src_func.key_error table:ind_userfunc_cppname key:'"<ind_userfunc_cppname_next; // unlink (singly linked list) + _db.ind_userfunc_cppname_n--; + row.ind_userfunc_cppname_next = (src_func::FUserfunc*)-1;// not-in-hash + break; + } + prev = &next->ind_userfunc_cppname_next; + } + } +} + +// --- src_func.FDb.ind_userfunc_cppname.Reserve +// Reserve enough room in the hash for N more elements. Return success code. +void src_func::ind_userfunc_cppname_Reserve(int n) { + ind_userfunc_cppname_AbsReserve(_db.ind_userfunc_cppname_n + n); +} + +// --- src_func.FDb.ind_userfunc_cppname.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_func::ind_userfunc_cppname_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_userfunc_cppname_buckets_n; + u32 new_nelems = n; + // # of elements has to be roughly equal to the number of buckets + if (new_nelems > old_nbuckets) { + int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); + u32 old_size = old_nbuckets * sizeof(src_func::FUserfunc*); + u32 new_size = new_nbuckets * sizeof(src_func::FUserfunc*); + // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably + // means new memory will have to be allocated anyway + src_func::FUserfunc* *new_buckets = (src_func::FUserfunc**)algo_lib::malloc_AllocMem(new_size); + if (UNLIKELY(!new_buckets)) { + FatalErrorExit("src_func.out_of_memory field:src_func.FDb.ind_userfunc_cppname"); + } + memset(new_buckets, 0, new_size); // clear pointers + // rehash all entries + for (int i = 0; i < _db.ind_userfunc_cppname_buckets_n; i++) { + src_func::FUserfunc* elem = _db.ind_userfunc_cppname_buckets_elems[i]; + while (elem) { + src_func::FUserfunc &row = *elem; + src_func::FUserfunc* next = row.ind_userfunc_cppname_next; + u32 index = row.ind_userfunc_cppname_hashval & (new_nbuckets-1); + row.ind_userfunc_cppname_next = new_buckets[index]; + new_buckets[index] = &row; + elem = next; + } + } + // free old array + algo_lib::malloc_FreeMem(_db.ind_userfunc_cppname_buckets_elems, old_size); + _db.ind_userfunc_cppname_buckets_elems = new_buckets; + _db.ind_userfunc_cppname_buckets_n = new_nbuckets; + } +} + +// --- src_func.FDb.genaffix.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -src_func::FCtypelen& src_func::ctypelen_Alloc() { - src_func::FCtypelen* row = ctypelen_AllocMaybe(); +src_func::FGenaffix& src_func::genaffix_Alloc() { + src_func::FGenaffix* row = genaffix_AllocMaybe(); if (UNLIKELY(row == NULL)) { - FatalErrorExit("src_func.out_of_mem field:src_func.FDb.ctypelen comment:'Alloc failed'"); + FatalErrorExit("src_func.out_of_mem field:src_func.FDb.genaffix comment:'Alloc failed'"); } return *row; } -// --- src_func.FDb.ctypelen.AllocMaybe +// --- src_func.FDb.genaffix.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -src_func::FCtypelen* src_func::ctypelen_AllocMaybe() { - src_func::FCtypelen *row = (src_func::FCtypelen*)ctypelen_AllocMem(); +src_func::FGenaffix* src_func::genaffix_AllocMaybe() { + src_func::FGenaffix *row = (src_func::FGenaffix*)genaffix_AllocMem(); if (row) { - new (row) src_func::FCtypelen; // call constructor - } - return row; -} - -// --- src_func.FDb.ctypelen.InsertMaybe -// Create new row from struct. -// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -src_func::FCtypelen* src_func::ctypelen_InsertMaybe(const dmmeta::Ctypelen &value) { - src_func::FCtypelen *row = &ctypelen_Alloc(); // if out of memory, process dies. if input error, return NULL. - ctypelen_CopyIn(*row,const_cast(value)); - bool ok = ctypelen_XrefMaybe(*row); // this may return false - if (!ok) { - ctypelen_RemoveLast(); // delete offending row, any existing xrefs are cleared - row = NULL; // forget this ever happened + new (row) src_func::FGenaffix; // call constructor } return row; } -// --- src_func.FDb.ctypelen.AllocMem +// --- src_func.FDb.genaffix.AllocMem // Allocate space for one element. If no memory available, return NULL. -void* src_func::ctypelen_AllocMem() { - u64 new_nelems = _db.ctypelen_n+1; +void* src_func::genaffix_AllocMem() { + u64 new_nelems = _db.genaffix_n+1; // compute level and index on level u64 bsr = algo::u64_BitScanReverse(new_nelems); u64 base = u64(1)<0; ) { +void src_func::genaffix_RemoveAll() { + for (u64 n = _db.genaffix_n; n>0; ) { n--; - ctypelen_qFind(u64(n)).~FCtypelen(); // destroy last element - _db.ctypelen_n = i32(n); + genaffix_qFind(u64(n)).~FGenaffix(); // destroy last element + _db.genaffix_n = i32(n); } } -// --- src_func.FDb.ctypelen.RemoveLast +// --- src_func.FDb.genaffix.RemoveLast // Delete last element of array. Do nothing if array is empty. -void src_func::ctypelen_RemoveLast() { - u64 n = _db.ctypelen_n; +void src_func::genaffix_RemoveLast() { + u64 n = _db.genaffix_n; if (n > 0) { n -= 1; - ctypelen_qFind(u64(n)).~FCtypelen(); - _db.ctypelen_n = i32(n); + genaffix_qFind(u64(n)).~FGenaffix(); + _db.genaffix_n = i32(n); } } -// --- src_func.FDb.ctypelen.InputMaybe -static bool src_func::ctypelen_InputMaybe(dmmeta::Ctypelen &elem) { - bool retval = true; - retval = ctypelen_InsertMaybe(elem) != nullptr; - return retval; -} - -// --- src_func.FDb.ctypelen.XrefMaybe +// --- src_func.FDb.genaffix.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -bool src_func::ctypelen_XrefMaybe(src_func::FCtypelen &row) { +bool src_func::genaffix_XrefMaybe(src_func::FGenaffix &row) { bool retval = true; (void)row; - // insert ctypelen into index ind_ctypelen + // insert genaffix into index ind_genaffix if (true) { // user-defined insert condition - bool success = ind_ctypelen_InsertMaybe(row); + bool success = ind_genaffix_InsertMaybe(row); if (UNLIKELY(!success)) { ch_RemoveAll(algo_lib::_db.errtext); - algo_lib::_db.errtext << "src_func.duplicate_key xref:src_func.FDb.ind_ctypelen"; // check for duplicate key + algo_lib::_db.errtext << "src_func.duplicate_key xref:src_func.FDb.ind_genaffix"; // check for duplicate key return false; } } return retval; } -// --- src_func.FDb.ind_ctypelen.Find +// --- src_func.FDb.ind_genaffix.Find // Find row by key. Return NULL if not found. -src_func::FCtypelen* src_func::ind_ctypelen_Find(const algo::strptr& key) { - u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctypelen_buckets_n - 1); - src_func::FCtypelen* *e = &_db.ind_ctypelen_buckets_elems[index]; - src_func::FCtypelen* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctypelen_next; - } while (true); +src_func::FGenaffix* src_func::ind_genaffix_Find(const algo::strptr& key) { + u32 index = algo::cstring_Hash(0, key) & (_db.ind_genaffix_buckets_n - 1); + src_func::FGenaffix *ret = _db.ind_genaffix_buckets_elems[index]; + for (; ret && !((*ret).genaffix == key); ret = ret->ind_genaffix_next) { + } return ret; } -// --- src_func.FDb.ind_ctypelen.FindX +// --- src_func.FDb.ind_genaffix.FindX // Look up row by key and return reference. Throw exception if not found -src_func::FCtypelen& src_func::ind_ctypelen_FindX(const algo::strptr& key) { - src_func::FCtypelen* ret = ind_ctypelen_Find(key); - vrfy(ret, tempstr() << "src_func.key_error table:ind_ctypelen key:'"<ind_ctypelen_next; + prev = &ret->ind_genaffix_next; } while (true); if (retval) { - row.ind_ctypelen_next = *prev; - _db.ind_ctypelen_n++; + row.ind_genaffix_next = *prev; + _db.ind_genaffix_n++; *prev = &row; } } return retval; } -// --- src_func.FDb.ind_ctypelen.Remove +// --- src_func.FDb.ind_genaffix.Remove // Remove reference to element from hash index. If element is not in hash, do nothing -void src_func::ind_ctypelen_Remove(src_func::FCtypelen& row) { - if (LIKELY(row.ind_ctypelen_next != (src_func::FCtypelen*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctypelen_buckets_n - 1); - src_func::FCtypelen* *prev = &_db.ind_ctypelen_buckets_elems[index]; // addr of pointer to current element - while (src_func::FCtypelen *next = *prev) { // scan the collision chain for our element +void src_func::ind_genaffix_Remove(src_func::FGenaffix& row) { + if (LIKELY(row.ind_genaffix_next != (src_func::FGenaffix*)-1)) {// check if in hash already + u32 index = row.ind_genaffix_hashval & (_db.ind_genaffix_buckets_n - 1); + src_func::FGenaffix* *prev = &_db.ind_genaffix_buckets_elems[index]; // addr of pointer to current element + while (src_func::FGenaffix *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? - *prev = next->ind_ctypelen_next; // unlink (singly linked list) - _db.ind_ctypelen_n--; - row.ind_ctypelen_next = (src_func::FCtypelen*)-1;// not-in-hash + *prev = next->ind_genaffix_next; // unlink (singly linked list) + _db.ind_genaffix_n--; + row.ind_genaffix_next = (src_func::FGenaffix*)-1;// not-in-hash break; } - prev = &next->ind_ctypelen_next; + prev = &next->ind_genaffix_next; } } } -// --- src_func.FDb.ind_ctypelen.Reserve +// --- src_func.FDb.ind_genaffix.Reserve // Reserve enough room in the hash for N more elements. Return success code. -void src_func::ind_ctypelen_Reserve(int n) { - u32 old_nbuckets = _db.ind_ctypelen_buckets_n; - u32 new_nelems = _db.ind_ctypelen_n + n; +void src_func::ind_genaffix_Reserve(int n) { + ind_genaffix_AbsReserve(_db.ind_genaffix_n + n); +} + +// --- src_func.FDb.ind_genaffix.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_func::ind_genaffix_AbsReserve(int n) { + u32 old_nbuckets = _db.ind_genaffix_buckets_n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); - u32 old_size = old_nbuckets * sizeof(src_func::FCtypelen*); - u32 new_size = new_nbuckets * sizeof(src_func::FCtypelen*); + u32 old_size = old_nbuckets * sizeof(src_func::FGenaffix*); + u32 new_size = new_nbuckets * sizeof(src_func::FGenaffix*); // allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably // means new memory will have to be allocated anyway - src_func::FCtypelen* *new_buckets = (src_func::FCtypelen**)algo_lib::malloc_AllocMem(new_size); + src_func::FGenaffix* *new_buckets = (src_func::FGenaffix**)algo_lib::malloc_AllocMem(new_size); if (UNLIKELY(!new_buckets)) { - FatalErrorExit("src_func.out_of_memory field:src_func.FDb.ind_ctypelen"); + FatalErrorExit("src_func.out_of_memory field:src_func.FDb.ind_genaffix"); } memset(new_buckets, 0, new_size); // clear pointers // rehash all entries - for (int i = 0; i < _db.ind_ctypelen_buckets_n; i++) { - src_func::FCtypelen* elem = _db.ind_ctypelen_buckets_elems[i]; + for (int i = 0; i < _db.ind_genaffix_buckets_n; i++) { + src_func::FGenaffix* elem = _db.ind_genaffix_buckets_elems[i]; while (elem) { - src_func::FCtypelen &row = *elem; - src_func::FCtypelen* next = row.ind_ctypelen_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); - row.ind_ctypelen_next = new_buckets[index]; + src_func::FGenaffix &row = *elem; + src_func::FGenaffix* next = row.ind_genaffix_next; + u32 index = row.ind_genaffix_hashval & (new_nbuckets-1); + row.ind_genaffix_next = new_buckets[index]; new_buckets[index] = &row; elem = next; } } // free old array - algo_lib::malloc_FreeMem(_db.ind_ctypelen_buckets_elems, old_size); - _db.ind_ctypelen_buckets_elems = new_buckets; - _db.ind_ctypelen_buckets_n = new_nbuckets; + algo_lib::malloc_FreeMem(_db.ind_genaffix_buckets_elems, old_size); + _db.ind_genaffix_buckets_elems = new_buckets; + _db.ind_genaffix_buckets_n = new_nbuckets; } } @@ -2022,17 +2046,6 @@ void src_func::_db_bh_func_curs_Next(_db_bh_func_curs &curs) { // --- src_func.FDb..Init // Set all fields to initial values. void src_func::FDb_Init() { - // initialize LAry genprefix (src_func.FDb.genprefix) - _db.genprefix_n = 0; - memset(_db.genprefix_lary, 0, sizeof(_db.genprefix_lary)); // zero out all level pointers - src_func::FGenprefix* genprefix_first = (src_func::FGenprefix*)algo_lib::malloc_AllocMem(sizeof(src_func::FGenprefix) * (u64(1)<<4)); - if (!genprefix_first) { - FatalErrorExit("out of memory"); - } - for (int i = 0; i < 4; i++) { - _db.genprefix_lary[i] = genprefix_first; - genprefix_first += 1ULL<cd_targsrc_prev; - row.cd_targsrc_prev->cd_targsrc_next = &row; - row.cd_targsrc_next->cd_targsrc_prev = &row; + row.target_cd_targsrc_next = target.cd_targsrc_head; + row.target_cd_targsrc_prev = target.cd_targsrc_head->target_cd_targsrc_prev; + row.target_cd_targsrc_prev->target_cd_targsrc_next = &row; + row.target_cd_targsrc_next->target_cd_targsrc_prev = &row; } else { - row.cd_targsrc_next = &row; - row.cd_targsrc_prev = &row; + row.target_cd_targsrc_next = &row; + row.target_cd_targsrc_prev = &row; target.cd_targsrc_head = &row; } target.cd_targsrc_n++; @@ -2416,19 +2338,19 @@ void src_func::cd_targsrc_Insert(src_func::FTarget& target, src_func::FTargsrc& // --- src_func.FTarget.cd_targsrc.Remove // Remove element from index. If element is not in index, do nothing. void src_func::cd_targsrc_Remove(src_func::FTarget& target, src_func::FTargsrc& row) { - if (cd_targsrc_InLlistQ(row)) { + if (target_cd_targsrc_InLlistQ(row)) { src_func::FTargsrc* old_head = target.cd_targsrc_head; (void)old_head; // in case it's not used - src_func::FTargsrc *oldnext = row.cd_targsrc_next; - src_func::FTargsrc *oldprev = row.cd_targsrc_prev; - oldnext->cd_targsrc_prev = oldprev; // remove element from list - oldprev->cd_targsrc_next = oldnext; + src_func::FTargsrc *oldnext = row.target_cd_targsrc_next; + src_func::FTargsrc *oldprev = row.target_cd_targsrc_prev; + oldnext->target_cd_targsrc_prev = oldprev; // remove element from list + oldprev->target_cd_targsrc_next = oldnext; target.cd_targsrc_n--; // adjust count if (&row == target.cd_targsrc_head) { target.cd_targsrc_head = oldnext==&row ? NULL : oldnext; // adjust list head } - row.cd_targsrc_next = (src_func::FTargsrc*)-1; // mark element as not-in-list); - row.cd_targsrc_prev = NULL; // clear back-pointer + row.target_cd_targsrc_next = (src_func::FTargsrc*)-1; // mark element as not-in-list); + row.target_cd_targsrc_prev = NULL; // clear back-pointer } } @@ -2440,9 +2362,9 @@ void src_func::cd_targsrc_RemoveAll(src_func::FTarget& target) { target.cd_targsrc_head = NULL; target.cd_targsrc_n = 0; while (row) { - src_func::FTargsrc* row_next = row->cd_targsrc_next; - row->cd_targsrc_next = (src_func::FTargsrc*)-1; - row->cd_targsrc_prev = NULL; + src_func::FTargsrc* row_next = row->target_cd_targsrc_next; + row->target_cd_targsrc_next = (src_func::FTargsrc*)-1; + row->target_cd_targsrc_prev = NULL; row = row_next != head ? row_next : NULL; } } @@ -2453,13 +2375,13 @@ src_func::FTargsrc* src_func::cd_targsrc_RemoveFirst(src_func::FTarget& target) src_func::FTargsrc *row = NULL; row = target.cd_targsrc_head; if (row) { - bool hasmore = row!=row->cd_targsrc_next; - target.cd_targsrc_head = hasmore ? row->cd_targsrc_next : NULL; - row->cd_targsrc_next->cd_targsrc_prev = row->cd_targsrc_prev; - row->cd_targsrc_prev->cd_targsrc_next = row->cd_targsrc_next; - row->cd_targsrc_prev = NULL; + bool hasmore = row!=row->target_cd_targsrc_next; + target.cd_targsrc_head = hasmore ? row->target_cd_targsrc_next : NULL; + row->target_cd_targsrc_next->target_cd_targsrc_prev = row->target_cd_targsrc_prev; + row->target_cd_targsrc_prev->target_cd_targsrc_next = row->target_cd_targsrc_next; + row->target_cd_targsrc_prev = NULL; target.cd_targsrc_n--; - row->cd_targsrc_next = (src_func::FTargsrc*)-1; // mark as not-in-list + row->target_cd_targsrc_next = (src_func::FTargsrc*)-1; // mark as not-in-list } return row; } @@ -2471,7 +2393,7 @@ src_func::FTargsrc* src_func::cd_targsrc_RotateFirst(src_func::FTarget& target) src_func::FTargsrc *row = NULL; row = target.cd_targsrc_head; if (row) { - target.cd_targsrc_head = row->cd_targsrc_next; + target.cd_targsrc_head = row->target_cd_targsrc_next; } return row; } @@ -2517,12 +2439,12 @@ algo::Smallstr10 src_func::ext_Get(src_func::FTargsrc& targsrc) { // --- src_func.FTargsrc.zd_func.Insert // Insert row into linked list. If row is already in linked list, do nothing. void src_func::zd_func_Insert(src_func::FTargsrc& targsrc, src_func::FFunc& row) { - if (!zd_func_InLlistQ(row)) { + if (!targsrc_zd_func_InLlistQ(row)) { src_func::FFunc* old_tail = targsrc.zd_func_tail; - row.zd_func_next = NULL; - row.zd_func_prev = old_tail; + row.targsrc_zd_func_next = NULL; + row.targsrc_zd_func_prev = old_tail; targsrc.zd_func_tail = &row; - src_func::FFunc **new_row_a = &old_tail->zd_func_next; + src_func::FFunc **new_row_a = &old_tail->targsrc_zd_func_next; src_func::FFunc **new_row_b = &targsrc.zd_func_head; src_func::FFunc **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -2533,23 +2455,23 @@ void src_func::zd_func_Insert(src_func::FTargsrc& targsrc, src_func::FFunc& row) // --- src_func.FTargsrc.zd_func.Remove // Remove element from index. If element is not in index, do nothing. void src_func::zd_func_Remove(src_func::FTargsrc& targsrc, src_func::FFunc& row) { - if (zd_func_InLlistQ(row)) { + if (targsrc_zd_func_InLlistQ(row)) { src_func::FFunc* old_head = targsrc.zd_func_head; (void)old_head; // in case it's not used - src_func::FFunc* prev = row.zd_func_prev; - src_func::FFunc* next = row.zd_func_next; + src_func::FFunc* prev = row.targsrc_zd_func_prev; + src_func::FFunc* next = row.targsrc_zd_func_next; // if element is first, adjust list head; otherwise, adjust previous element's next - src_func::FFunc **new_next_a = &prev->zd_func_next; + src_func::FFunc **new_next_a = &prev->targsrc_zd_func_next; src_func::FFunc **new_next_b = &targsrc.zd_func_head; src_func::FFunc **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - src_func::FFunc **new_prev_a = &next->zd_func_prev; + src_func::FFunc **new_prev_a = &next->targsrc_zd_func_prev; src_func::FFunc **new_prev_b = &targsrc.zd_func_tail; src_func::FFunc **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; targsrc.zd_func_n--; - row.zd_func_next=(src_func::FFunc*)-1; // not-in-list + row.targsrc_zd_func_next=(src_func::FFunc*)-1; // not-in-list } } @@ -2561,9 +2483,9 @@ void src_func::zd_func_RemoveAll(src_func::FTargsrc& targsrc) { targsrc.zd_func_tail = NULL; targsrc.zd_func_n = 0; while (row) { - src_func::FFunc* row_next = row->zd_func_next; - row->zd_func_next = (src_func::FFunc*)-1; - row->zd_func_prev = NULL; + src_func::FFunc* row_next = row->targsrc_zd_func_next; + row->targsrc_zd_func_next = (src_func::FFunc*)-1; + row->targsrc_zd_func_prev = NULL; row = row_next; } } @@ -2574,14 +2496,14 @@ src_func::FFunc* src_func::zd_func_RemoveFirst(src_func::FTargsrc& targsrc) { src_func::FFunc *row = NULL; row = targsrc.zd_func_head; if (row) { - src_func::FFunc *next = row->zd_func_next; + src_func::FFunc *next = row->targsrc_zd_func_next; targsrc.zd_func_head = next; - src_func::FFunc **new_end_a = &next->zd_func_prev; + src_func::FFunc **new_end_a = &next->targsrc_zd_func_prev; src_func::FFunc **new_end_b = &targsrc.zd_func_tail; src_func::FFunc **new_end = next ? new_end_a : new_end_b; *new_end = NULL; targsrc.zd_func_n--; - row->zd_func_next = (src_func::FFunc*)-1; // mark as not-in-list + row->targsrc_zd_func_next = (src_func::FFunc*)-1; // mark as not-in-list } return row; } @@ -2595,6 +2517,103 @@ void src_func::FTargsrc_Uninit(src_func::FTargsrc& targsrc) { } } +// --- src_func.FUserfunc.base.CopyOut +// Copy fields out of row +void src_func::userfunc_CopyOut(src_func::FUserfunc &row, dmmeta::Userfunc &out) { + out.userfunc = row.userfunc; + out.acrkey = row.acrkey; + out.cppname = row.cppname; + out.comment = row.comment; +} + +// --- src_func.FUserfunc.base.CopyIn +// Copy fields in to row +void src_func::userfunc_CopyIn(src_func::FUserfunc &row, dmmeta::Userfunc &in) { + row.userfunc = in.userfunc; + row.acrkey = in.acrkey; + row.cppname = in.cppname; + row.comment = in.comment; +} + +// --- src_func.FUserfunc.zd_func.Insert +// Insert row into linked list. If row is already in linked list, do nothing. +void src_func::zd_func_Insert(src_func::FUserfunc& userfunc, src_func::FFunc& row) { + if (!userfunc_zd_func_InLlistQ(row)) { + src_func::FFunc* old_tail = userfunc.zd_func_tail; + row.userfunc_zd_func_next = NULL; + row.userfunc_zd_func_prev = old_tail; + userfunc.zd_func_tail = &row; + src_func::FFunc **new_row_a = &old_tail->userfunc_zd_func_next; + src_func::FFunc **new_row_b = &userfunc.zd_func_head; + src_func::FFunc **new_row = old_tail ? new_row_a : new_row_b; + *new_row = &row; + userfunc.zd_func_n++; + } +} + +// --- src_func.FUserfunc.zd_func.Remove +// Remove element from index. If element is not in index, do nothing. +void src_func::zd_func_Remove(src_func::FUserfunc& userfunc, src_func::FFunc& row) { + if (userfunc_zd_func_InLlistQ(row)) { + src_func::FFunc* old_head = userfunc.zd_func_head; + (void)old_head; // in case it's not used + src_func::FFunc* prev = row.userfunc_zd_func_prev; + src_func::FFunc* next = row.userfunc_zd_func_next; + // if element is first, adjust list head; otherwise, adjust previous element's next + src_func::FFunc **new_next_a = &prev->userfunc_zd_func_next; + src_func::FFunc **new_next_b = &userfunc.zd_func_head; + src_func::FFunc **new_next = prev ? new_next_a : new_next_b; + *new_next = next; + // if element is last, adjust list tail; otherwise, adjust next element's prev + src_func::FFunc **new_prev_a = &next->userfunc_zd_func_prev; + src_func::FFunc **new_prev_b = &userfunc.zd_func_tail; + src_func::FFunc **new_prev = next ? new_prev_a : new_prev_b; + *new_prev = prev; + userfunc.zd_func_n--; + row.userfunc_zd_func_next=(src_func::FFunc*)-1; // not-in-list + } +} + +// --- src_func.FUserfunc.zd_func.RemoveAll +// Empty the index. (The rows are not deleted) +void src_func::zd_func_RemoveAll(src_func::FUserfunc& userfunc) { + src_func::FFunc* row = userfunc.zd_func_head; + userfunc.zd_func_head = NULL; + userfunc.zd_func_tail = NULL; + userfunc.zd_func_n = 0; + while (row) { + src_func::FFunc* row_next = row->userfunc_zd_func_next; + row->userfunc_zd_func_next = (src_func::FFunc*)-1; + row->userfunc_zd_func_prev = NULL; + row = row_next; + } +} + +// --- src_func.FUserfunc.zd_func.RemoveFirst +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +src_func::FFunc* src_func::zd_func_RemoveFirst(src_func::FUserfunc& userfunc) { + src_func::FFunc *row = NULL; + row = userfunc.zd_func_head; + if (row) { + src_func::FFunc *next = row->userfunc_zd_func_next; + userfunc.zd_func_head = next; + src_func::FFunc **new_end_a = &next->userfunc_zd_func_prev; + src_func::FFunc **new_end_b = &userfunc.zd_func_tail; + src_func::FFunc **new_end = next ? new_end_a : new_end_b; + *new_end = NULL; + userfunc.zd_func_n--; + row->userfunc_zd_func_next = (src_func::FFunc*)-1; // mark as not-in-list + } + return row; +} + +// --- src_func.FUserfunc..Uninit +void src_func::FUserfunc_Uninit(src_func::FUserfunc& userfunc) { + src_func::FUserfunc &row = userfunc; (void)row; + ind_userfunc_Remove(row); // remove userfunc from index ind_userfunc + ind_userfunc_cppname_Remove(row); // remove userfunc from index ind_userfunc_cppname +} + // --- src_func.FieldId.value.ToCstr // Convert numeric value of field to one of predefined string constants. // If string is found, return a static C string. Otherwise, return NULL. @@ -2678,11 +2697,9 @@ const char* src_func::value_ToCstr(const src_func::TableId& parent) { const char *ret = NULL; switch(value_GetEnum(parent)) { case src_func_TableId_dmmeta_Ctypelen: ret = "dmmeta.Ctypelen"; break; - case src_func_TableId_dmmeta_Dispatch: ret = "dmmeta.Dispatch"; break; - case src_func_TableId_dmmeta_Fstep : ret = "dmmeta.Fstep"; break; - case src_func_TableId_dmmeta_Gstatic: ret = "dmmeta.Gstatic"; break; case src_func_TableId_dev_Target : ret = "dev.Target"; break; case src_func_TableId_dev_Targsrc : ret = "dev.Targsrc"; break; + case src_func_TableId_dmmeta_Userfunc: ret = "dmmeta.Userfunc"; break; } return ret; } @@ -2732,48 +2749,22 @@ bool src_func::value_SetStrptrMaybe(src_func::TableId& parent, algo::strptr rhs) } break; } - case 12: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('d','m','m','e','t','a','.','F'): { - if (memcmp(rhs.elems+8,"step",4)==0) { value_SetEnum(parent,src_func_TableId_dmmeta_Fstep); ret = true; break; } - break; - } - case LE_STR8('d','m','m','e','t','a','.','f'): { - if (memcmp(rhs.elems+8,"step",4)==0) { value_SetEnum(parent,src_func_TableId_dmmeta_fstep); ret = true; break; } - break; - } - } - break; - } - case 14: { - switch (algo::ReadLE64(rhs.elems)) { - case LE_STR8('d','m','m','e','t','a','.','G'): { - if (memcmp(rhs.elems+8,"static",6)==0) { value_SetEnum(parent,src_func_TableId_dmmeta_Gstatic); ret = true; break; } - break; - } - case LE_STR8('d','m','m','e','t','a','.','g'): { - if (memcmp(rhs.elems+8,"static",6)==0) { value_SetEnum(parent,src_func_TableId_dmmeta_gstatic); ret = true; break; } - break; - } - } - break; - } case 15: { switch (algo::ReadLE64(rhs.elems)) { case LE_STR8('d','m','m','e','t','a','.','C'): { if (memcmp(rhs.elems+8,"typelen",7)==0) { value_SetEnum(parent,src_func_TableId_dmmeta_Ctypelen); ret = true; break; } break; } - case LE_STR8('d','m','m','e','t','a','.','D'): { - if (memcmp(rhs.elems+8,"ispatch",7)==0) { value_SetEnum(parent,src_func_TableId_dmmeta_Dispatch); ret = true; break; } + case LE_STR8('d','m','m','e','t','a','.','U'): { + if (memcmp(rhs.elems+8,"serfunc",7)==0) { value_SetEnum(parent,src_func_TableId_dmmeta_Userfunc); ret = true; break; } break; } case LE_STR8('d','m','m','e','t','a','.','c'): { if (memcmp(rhs.elems+8,"typelen",7)==0) { value_SetEnum(parent,src_func_TableId_dmmeta_ctypelen); ret = true; break; } break; } - case LE_STR8('d','m','m','e','t','a','.','d'): { - if (memcmp(rhs.elems+8,"ispatch",7)==0) { value_SetEnum(parent,src_func_TableId_dmmeta_dispatch); ret = true; break; } + case LE_STR8('d','m','m','e','t','a','.','u'): { + if (memcmp(rhs.elems+8,"serfunc",7)==0) { value_SetEnum(parent,src_func_TableId_dmmeta_userfunc); ret = true; break; } break; } } @@ -2829,11 +2820,13 @@ void src_func::StaticCheck() { // --- src_func...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); src_func::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock src_func::ReadArgv(); // dmmeta.main:src_func src_func::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -2846,6 +2839,7 @@ int main(int argc, char **argv) { try { src_func::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/src_hdr_gen.cpp b/cpp/gen/src_hdr_gen.cpp index 3f1b9ca9..bca2ccdf 100644 --- a/cpp/gen/src_hdr_gen.cpp +++ b/cpp/gen/src_hdr_gen.cpp @@ -33,6 +33,8 @@ #include "include/gen/command_gen.inl.h" #include "include/gen/dmmeta_gen.h" #include "include/gen/dmmeta_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_git_gen.h" @@ -41,6 +43,7 @@ // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_git::FDb lib_git::_db; // dependency found via dev.targdep src_hdr::FDb src_hdr::_db; // dependency found via dev.targdep @@ -56,8 +59,8 @@ const char *src_hdr_help = " -indent Indent source files\n" " -update_copyright Update copyright year for current company\n" " -scriptfile regx \"\" Regx of scripts to update header\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -218,9 +221,8 @@ void src_hdr::ReadArgv() { } if (ch_N(attrname) == 0) { err << "src_hdr: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:src_hdr.FDb.cmdline @@ -274,7 +279,7 @@ void src_hdr::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -399,8 +404,8 @@ bool src_hdr::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && src_hdr::LoadTuplesFile(algo::SsimFname(root,"dev.scriptfile"),recursive); retval = retval && src_hdr::LoadTuplesFile(algo::SsimFname(root,"dev.copyright"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -679,14 +684,9 @@ bool src_hdr::ns_XrefMaybe(src_hdr::FNs &row) { // Find row by key. Return NULL if not found. src_hdr::FNs* src_hdr::ind_ns_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_ns_buckets_n - 1); - src_hdr::FNs* *e = &_db.ind_ns_buckets_elems[index]; - src_hdr::FNs* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ns == key; - if (done) break; - e = &ret->ind_ns_next; - } while (true); + src_hdr::FNs *ret = _db.ind_ns_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_ns_next) { + } return ret; } @@ -701,10 +701,11 @@ src_hdr::FNs& src_hdr::ind_ns_FindX(const algo::strptr& key) { // --- src_hdr.FDb.ind_ns.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool src_hdr::ind_ns_InsertMaybe(src_hdr::FNs& row) { - ind_ns_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ns_next == (src_hdr::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + row.ind_ns_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_ns_Reserve(1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); src_hdr::FNs* *prev = &_db.ind_ns_buckets_elems[index]; do { src_hdr::FNs* ret = *prev; @@ -730,7 +731,7 @@ bool src_hdr::ind_ns_InsertMaybe(src_hdr::FNs& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void src_hdr::ind_ns_Remove(src_hdr::FNs& row) { if (LIKELY(row.ind_ns_next != (src_hdr::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); src_hdr::FNs* *prev = &_db.ind_ns_buckets_elems[index]; // addr of pointer to current element while (src_hdr::FNs *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -747,8 +748,14 @@ void src_hdr::ind_ns_Remove(src_hdr::FNs& row) { // --- src_hdr.FDb.ind_ns.Reserve // Reserve enough room in the hash for N more elements. Return success code. void src_hdr::ind_ns_Reserve(int n) { + ind_ns_AbsReserve(_db.ind_ns_n + n); +} + +// --- src_hdr.FDb.ind_ns.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_hdr::ind_ns_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ns_buckets_n; - u32 new_nelems = _db.ind_ns_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -767,7 +774,7 @@ void src_hdr::ind_ns_Reserve(int n) { while (elem) { src_hdr::FNs &row = *elem; src_hdr::FNs* next = row.ind_ns_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_ns_hashval & (new_nbuckets-1); row.ind_ns_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -993,14 +1000,9 @@ bool src_hdr::license_XrefMaybe(src_hdr::FLicense &row) { // Find row by key. Return NULL if not found. src_hdr::FLicense* src_hdr::ind_license_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_license_buckets_n - 1); - src_hdr::FLicense* *e = &_db.ind_license_buckets_elems[index]; - src_hdr::FLicense* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).license == key; - if (done) break; - e = &ret->ind_license_next; - } while (true); + src_hdr::FLicense *ret = _db.ind_license_buckets_elems[index]; + for (; ret && !((*ret).license == key); ret = ret->ind_license_next) { + } return ret; } @@ -1032,10 +1034,11 @@ src_hdr::FLicense& src_hdr::ind_license_GetOrCreate(const algo::strptr& key) { // --- src_hdr.FDb.ind_license.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool src_hdr::ind_license_InsertMaybe(src_hdr::FLicense& row) { - ind_license_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_license_next == (src_hdr::FLicense*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.license) & (_db.ind_license_buckets_n - 1); + row.ind_license_hashval = algo::Smallstr50_Hash(0, row.license); + ind_license_Reserve(1); + u32 index = row.ind_license_hashval & (_db.ind_license_buckets_n - 1); src_hdr::FLicense* *prev = &_db.ind_license_buckets_elems[index]; do { src_hdr::FLicense* ret = *prev; @@ -1061,7 +1064,7 @@ bool src_hdr::ind_license_InsertMaybe(src_hdr::FLicense& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void src_hdr::ind_license_Remove(src_hdr::FLicense& row) { if (LIKELY(row.ind_license_next != (src_hdr::FLicense*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.license) & (_db.ind_license_buckets_n - 1); + u32 index = row.ind_license_hashval & (_db.ind_license_buckets_n - 1); src_hdr::FLicense* *prev = &_db.ind_license_buckets_elems[index]; // addr of pointer to current element while (src_hdr::FLicense *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1078,8 +1081,14 @@ void src_hdr::ind_license_Remove(src_hdr::FLicense& row) { // --- src_hdr.FDb.ind_license.Reserve // Reserve enough room in the hash for N more elements. Return success code. void src_hdr::ind_license_Reserve(int n) { + ind_license_AbsReserve(_db.ind_license_n + n); +} + +// --- src_hdr.FDb.ind_license.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_hdr::ind_license_AbsReserve(int n) { u32 old_nbuckets = _db.ind_license_buckets_n; - u32 new_nelems = _db.ind_license_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1098,7 +1107,7 @@ void src_hdr::ind_license_Reserve(int n) { while (elem) { src_hdr::FLicense &row = *elem; src_hdr::FLicense* next = row.ind_license_next; - u32 index = algo::Smallstr50_Hash(0, row.license) & (new_nbuckets-1); + u32 index = row.ind_license_hashval & (new_nbuckets-1); row.ind_license_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1231,14 +1240,9 @@ bool src_hdr::target_XrefMaybe(src_hdr::FTarget &row) { // Find row by key. Return NULL if not found. src_hdr::FTarget* src_hdr::ind_target_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_target_buckets_n - 1); - src_hdr::FTarget* *e = &_db.ind_target_buckets_elems[index]; - src_hdr::FTarget* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).target == key; - if (done) break; - e = &ret->ind_target_next; - } while (true); + src_hdr::FTarget *ret = _db.ind_target_buckets_elems[index]; + for (; ret && !((*ret).target == key); ret = ret->ind_target_next) { + } return ret; } @@ -1253,10 +1257,11 @@ src_hdr::FTarget& src_hdr::ind_target_FindX(const algo::strptr& key) { // --- src_hdr.FDb.ind_target.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool src_hdr::ind_target_InsertMaybe(src_hdr::FTarget& row) { - ind_target_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_target_next == (src_hdr::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + row.ind_target_hashval = algo::Smallstr16_Hash(0, row.target); + ind_target_Reserve(1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); src_hdr::FTarget* *prev = &_db.ind_target_buckets_elems[index]; do { src_hdr::FTarget* ret = *prev; @@ -1282,7 +1287,7 @@ bool src_hdr::ind_target_InsertMaybe(src_hdr::FTarget& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void src_hdr::ind_target_Remove(src_hdr::FTarget& row) { if (LIKELY(row.ind_target_next != (src_hdr::FTarget*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.target) & (_db.ind_target_buckets_n - 1); + u32 index = row.ind_target_hashval & (_db.ind_target_buckets_n - 1); src_hdr::FTarget* *prev = &_db.ind_target_buckets_elems[index]; // addr of pointer to current element while (src_hdr::FTarget *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1299,8 +1304,14 @@ void src_hdr::ind_target_Remove(src_hdr::FTarget& row) { // --- src_hdr.FDb.ind_target.Reserve // Reserve enough room in the hash for N more elements. Return success code. void src_hdr::ind_target_Reserve(int n) { + ind_target_AbsReserve(_db.ind_target_n + n); +} + +// --- src_hdr.FDb.ind_target.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_hdr::ind_target_AbsReserve(int n) { u32 old_nbuckets = _db.ind_target_buckets_n; - u32 new_nelems = _db.ind_target_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1319,7 +1330,7 @@ void src_hdr::ind_target_Reserve(int n) { while (elem) { src_hdr::FTarget &row = *elem; src_hdr::FTarget* next = row.ind_target_next; - u32 index = algo::Smallstr16_Hash(0, row.target) & (new_nbuckets-1); + u32 index = row.ind_target_hashval & (new_nbuckets-1); row.ind_target_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1547,14 +1558,9 @@ bool src_hdr::fcopyline_XrefMaybe(src_hdr::FCopyline &row) { // Find row by key. Return NULL if not found. src_hdr::FCopyline* src_hdr::ind_fcopyline_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_fcopyline_buckets_n - 1); - src_hdr::FCopyline* *e = &_db.ind_fcopyline_buckets_elems[index]; - src_hdr::FCopyline* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).fcopyline == key; - if (done) break; - e = &ret->ind_fcopyline_next; - } while (true); + src_hdr::FCopyline *ret = _db.ind_fcopyline_buckets_elems[index]; + for (; ret && !((*ret).fcopyline == key); ret = ret->ind_fcopyline_next) { + } return ret; } @@ -1586,10 +1592,11 @@ src_hdr::FCopyline& src_hdr::ind_fcopyline_GetOrCreate(const algo::strptr& key) // --- src_hdr.FDb.ind_fcopyline.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool src_hdr::ind_fcopyline_InsertMaybe(src_hdr::FCopyline& row) { - ind_fcopyline_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_fcopyline_next == (src_hdr::FCopyline*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.fcopyline) & (_db.ind_fcopyline_buckets_n - 1); + row.ind_fcopyline_hashval = algo::cstring_Hash(0, row.fcopyline); + ind_fcopyline_Reserve(1); + u32 index = row.ind_fcopyline_hashval & (_db.ind_fcopyline_buckets_n - 1); src_hdr::FCopyline* *prev = &_db.ind_fcopyline_buckets_elems[index]; do { src_hdr::FCopyline* ret = *prev; @@ -1615,7 +1622,7 @@ bool src_hdr::ind_fcopyline_InsertMaybe(src_hdr::FCopyline& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void src_hdr::ind_fcopyline_Remove(src_hdr::FCopyline& row) { if (LIKELY(row.ind_fcopyline_next != (src_hdr::FCopyline*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.fcopyline) & (_db.ind_fcopyline_buckets_n - 1); + u32 index = row.ind_fcopyline_hashval & (_db.ind_fcopyline_buckets_n - 1); src_hdr::FCopyline* *prev = &_db.ind_fcopyline_buckets_elems[index]; // addr of pointer to current element while (src_hdr::FCopyline *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1632,8 +1639,14 @@ void src_hdr::ind_fcopyline_Remove(src_hdr::FCopyline& row) { // --- src_hdr.FDb.ind_fcopyline.Reserve // Reserve enough room in the hash for N more elements. Return success code. void src_hdr::ind_fcopyline_Reserve(int n) { + ind_fcopyline_AbsReserve(_db.ind_fcopyline_n + n); +} + +// --- src_hdr.FDb.ind_fcopyline.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_hdr::ind_fcopyline_AbsReserve(int n) { u32 old_nbuckets = _db.ind_fcopyline_buckets_n; - u32 new_nelems = _db.ind_fcopyline_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1652,7 +1665,7 @@ void src_hdr::ind_fcopyline_Reserve(int n) { while (elem) { src_hdr::FCopyline &row = *elem; src_hdr::FCopyline* next = row.ind_fcopyline_next; - u32 index = algo::cstring_Hash(0, row.fcopyline) & (new_nbuckets-1); + u32 index = row.ind_fcopyline_hashval & (new_nbuckets-1); row.ind_fcopyline_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1789,14 +1802,9 @@ bool src_hdr::copyright_XrefMaybe(src_hdr::FCopyright &row) { // Find row by key. Return NULL if not found. src_hdr::FCopyright* src_hdr::ind_copyright_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_copyright_buckets_n - 1); - src_hdr::FCopyright* *e = &_db.ind_copyright_buckets_elems[index]; - src_hdr::FCopyright* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).copyright == key; - if (done) break; - e = &ret->ind_copyright_next; - } while (true); + src_hdr::FCopyright *ret = _db.ind_copyright_buckets_elems[index]; + for (; ret && !((*ret).copyright == key); ret = ret->ind_copyright_next) { + } return ret; } @@ -1811,10 +1819,11 @@ src_hdr::FCopyright& src_hdr::ind_copyright_FindX(const algo::strptr& key) { // --- src_hdr.FDb.ind_copyright.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool src_hdr::ind_copyright_InsertMaybe(src_hdr::FCopyright& row) { - ind_copyright_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_copyright_next == (src_hdr::FCopyright*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.copyright) & (_db.ind_copyright_buckets_n - 1); + row.ind_copyright_hashval = algo::Smallstr50_Hash(0, row.copyright); + ind_copyright_Reserve(1); + u32 index = row.ind_copyright_hashval & (_db.ind_copyright_buckets_n - 1); src_hdr::FCopyright* *prev = &_db.ind_copyright_buckets_elems[index]; do { src_hdr::FCopyright* ret = *prev; @@ -1840,7 +1849,7 @@ bool src_hdr::ind_copyright_InsertMaybe(src_hdr::FCopyright& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void src_hdr::ind_copyright_Remove(src_hdr::FCopyright& row) { if (LIKELY(row.ind_copyright_next != (src_hdr::FCopyright*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.copyright) & (_db.ind_copyright_buckets_n - 1); + u32 index = row.ind_copyright_hashval & (_db.ind_copyright_buckets_n - 1); src_hdr::FCopyright* *prev = &_db.ind_copyright_buckets_elems[index]; // addr of pointer to current element while (src_hdr::FCopyright *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1857,8 +1866,14 @@ void src_hdr::ind_copyright_Remove(src_hdr::FCopyright& row) { // --- src_hdr.FDb.ind_copyright.Reserve // Reserve enough room in the hash for N more elements. Return success code. void src_hdr::ind_copyright_Reserve(int n) { + ind_copyright_AbsReserve(_db.ind_copyright_n + n); +} + +// --- src_hdr.FDb.ind_copyright.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_hdr::ind_copyright_AbsReserve(int n) { u32 old_nbuckets = _db.ind_copyright_buckets_n; - u32 new_nelems = _db.ind_copyright_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1877,7 +1892,7 @@ void src_hdr::ind_copyright_Reserve(int n) { while (elem) { src_hdr::FCopyright &row = *elem; src_hdr::FCopyright* next = row.ind_copyright_next; - u32 index = algo::Smallstr50_Hash(0, row.copyright) & (new_nbuckets-1); + u32 index = row.ind_copyright_hashval & (new_nbuckets-1); row.ind_copyright_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2463,15 +2478,11 @@ void src_hdr::target_CopyIn(src_hdr::FTarget &row, dev::Target &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void src_hdr::c_targsrc_Insert(src_hdr::FTarget& target, src_hdr::FTargsrc& row) { - if (bool_Update(row.target_c_targsrc_in_ary,true)) { - // reserve space + if (!row.target_c_targsrc_in_ary) { c_targsrc_Reserve(target, 1); - u32 n = target.c_targsrc_n; - u32 at = n; - src_hdr::FTargsrc* *elems = target.c_targsrc_elems; - elems[at] = &row; - target.c_targsrc_n = n+1; - + u32 n = target.c_targsrc_n++; + target.c_targsrc_elems[n] = &row; + row.target_c_targsrc_in_ary = true; } } @@ -2480,7 +2491,7 @@ void src_hdr::c_targsrc_Insert(src_hdr::FTarget& target, src_hdr::FTargsrc& row) // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool src_hdr::c_targsrc_InsertMaybe(src_hdr::FTarget& target, src_hdr::FTargsrc& row) { - bool retval = !row.target_c_targsrc_in_ary; + bool retval = !target_c_targsrc_InAryQ(row); c_targsrc_Insert(target,row); // check is performed in _Insert again return retval; } @@ -2488,18 +2499,18 @@ bool src_hdr::c_targsrc_InsertMaybe(src_hdr::FTarget& target, src_hdr::FTargsrc& // --- src_hdr.FTarget.c_targsrc.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void src_hdr::c_targsrc_Remove(src_hdr::FTarget& target, src_hdr::FTargsrc& row) { + int n = target.c_targsrc_n; if (bool_Update(row.target_c_targsrc_in_ary,false)) { - int lim = target.c_targsrc_n; src_hdr::FTargsrc* *elems = target.c_targsrc_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { src_hdr::FTargsrc* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(src_hdr::FTargsrc*) * (lim - j); + size_t nbytes = sizeof(src_hdr::FTargsrc*) * (n - j); memmove(elems + i, elems + j, nbytes); - target.c_targsrc_n = lim - 1; + target.c_targsrc_n = n - 1; break; } } @@ -2816,12 +2827,14 @@ void src_hdr::StaticCheck() { // --- src_hdr...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); lib_git::FDb_Init(); src_hdr::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock src_hdr::ReadArgv(); // dmmeta.main:src_hdr src_hdr::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -2835,6 +2848,7 @@ int main(int argc, char **argv) { src_hdr::FDb_Uninit(); lib_git::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/src_lim_gen.cpp b/cpp/gen/src_lim_gen.cpp index f00c54cf..966c78dd 100644 --- a/cpp/gen/src_lim_gen.cpp +++ b/cpp/gen/src_lim_gen.cpp @@ -33,10 +33,13 @@ #include "include/gen/algo_lib_gen.inl.h" #include "include/gen/command_gen.h" #include "include/gen/command_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep src_lim::FDb src_lim::_db; // dependency found via dev.targdep @@ -53,8 +56,8 @@ const char *src_lim_help = " -write Update ssim database (with -capture)\n" " -badchar Check for bad chars in source files\n" " -badline regx \"\" Check badline (acr badline)\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -372,9 +375,8 @@ void src_lim::ReadArgv() { } if (ch_N(attrname) == 0) { err << "src_lim: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:src_lim.FDb.cmdline @@ -428,7 +433,7 @@ void src_lim::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -473,7 +478,7 @@ static void src_lim::InitReflection() { // -- load signatures of existing dispatches -- - algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'src_lim.Input' signature:'00ee14baa7bb10e798a9968848e5501b1eba3043'"); + algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'src_lim.Input' signature:'224e271405f3446891ae5d77a84627cf985aff9f'"); } // --- src_lim.FDb._db.InsertStrptrMaybe @@ -536,15 +541,15 @@ bool src_lim::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (root == "-") { retval = src_lim::LoadTuplesFd(algo::Fildes(0),"(stdin)",recursive); } else if (DirectoryQ(root)) { - retval = retval && src_lim::LoadTuplesFile(algo::SsimFname(root,"dev.gitfile"),recursive); retval = retval && src_lim::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); + retval = retval && src_lim::LoadTuplesFile(algo::SsimFname(root,"dev.gitfile"),recursive); retval = retval && src_lim::LoadTuplesFile(algo::SsimFname(root,"dev.targsrc"),recursive); retval = retval && src_lim::LoadTuplesFile(algo::SsimFname(root,"dev.linelim"),recursive); retval = retval && src_lim::LoadTuplesFile(algo::SsimFname(root,"dev.include"),recursive); retval = retval && src_lim::LoadTuplesFile(algo::SsimFname(root,"dev.badline"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -819,14 +824,9 @@ bool src_lim::gitfile_XrefMaybe(src_lim::FGitfile &row) { // Find row by key. Return NULL if not found. src_lim::FGitfile* src_lim::ind_gitfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_gitfile_buckets_n - 1); - src_lim::FGitfile* *e = &_db.ind_gitfile_buckets_elems[index]; - src_lim::FGitfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).gitfile == key; - if (done) break; - e = &ret->ind_gitfile_next; - } while (true); + src_lim::FGitfile *ret = _db.ind_gitfile_buckets_elems[index]; + for (; ret && !((*ret).gitfile == key); ret = ret->ind_gitfile_next) { + } return ret; } @@ -858,10 +858,11 @@ src_lim::FGitfile& src_lim::ind_gitfile_GetOrCreate(const algo::strptr& key) { // --- src_lim.FDb.ind_gitfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool src_lim::ind_gitfile_InsertMaybe(src_lim::FGitfile& row) { - ind_gitfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_gitfile_next == (src_lim::FGitfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (_db.ind_gitfile_buckets_n - 1); + row.ind_gitfile_hashval = algo::Smallstr200_Hash(0, row.gitfile); + ind_gitfile_Reserve(1); + u32 index = row.ind_gitfile_hashval & (_db.ind_gitfile_buckets_n - 1); src_lim::FGitfile* *prev = &_db.ind_gitfile_buckets_elems[index]; do { src_lim::FGitfile* ret = *prev; @@ -887,7 +888,7 @@ bool src_lim::ind_gitfile_InsertMaybe(src_lim::FGitfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void src_lim::ind_gitfile_Remove(src_lim::FGitfile& row) { if (LIKELY(row.ind_gitfile_next != (src_lim::FGitfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (_db.ind_gitfile_buckets_n - 1); + u32 index = row.ind_gitfile_hashval & (_db.ind_gitfile_buckets_n - 1); src_lim::FGitfile* *prev = &_db.ind_gitfile_buckets_elems[index]; // addr of pointer to current element while (src_lim::FGitfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -904,8 +905,14 @@ void src_lim::ind_gitfile_Remove(src_lim::FGitfile& row) { // --- src_lim.FDb.ind_gitfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void src_lim::ind_gitfile_Reserve(int n) { + ind_gitfile_AbsReserve(_db.ind_gitfile_n + n); +} + +// --- src_lim.FDb.ind_gitfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void src_lim::ind_gitfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_gitfile_buckets_n; - u32 new_nelems = _db.ind_gitfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -924,7 +931,7 @@ void src_lim::ind_gitfile_Reserve(int n) { while (elem) { src_lim::FGitfile &row = *elem; src_lim::FGitfile* next = row.ind_gitfile_next; - u32 index = algo::Smallstr200_Hash(0, row.gitfile) & (new_nbuckets-1); + u32 index = row.ind_gitfile_hashval & (new_nbuckets-1); row.ind_gitfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1161,12 +1168,12 @@ algo::Smallstr50 src_lim::ext_Get(src_lim::FGitfile& gitfile) { // --- src_lim.FGitfile.zd_include.Insert // Insert row into linked list. If row is already in linked list, do nothing. void src_lim::zd_include_Insert(src_lim::FGitfile& gitfile, src_lim::FInclude& row) { - if (!zd_include_InLlistQ(row)) { + if (!gitfile_zd_include_InLlistQ(row)) { src_lim::FInclude* old_tail = gitfile.zd_include_tail; - row.zd_include_next = NULL; - row.zd_include_prev = old_tail; + row.gitfile_zd_include_next = NULL; + row.gitfile_zd_include_prev = old_tail; gitfile.zd_include_tail = &row; - src_lim::FInclude **new_row_a = &old_tail->zd_include_next; + src_lim::FInclude **new_row_a = &old_tail->gitfile_zd_include_next; src_lim::FInclude **new_row_b = &gitfile.zd_include_head; src_lim::FInclude **new_row = old_tail ? new_row_a : new_row_b; *new_row = &row; @@ -1177,23 +1184,23 @@ void src_lim::zd_include_Insert(src_lim::FGitfile& gitfile, src_lim::FInclude& r // --- src_lim.FGitfile.zd_include.Remove // Remove element from index. If element is not in index, do nothing. void src_lim::zd_include_Remove(src_lim::FGitfile& gitfile, src_lim::FInclude& row) { - if (zd_include_InLlistQ(row)) { + if (gitfile_zd_include_InLlistQ(row)) { src_lim::FInclude* old_head = gitfile.zd_include_head; (void)old_head; // in case it's not used - src_lim::FInclude* prev = row.zd_include_prev; - src_lim::FInclude* next = row.zd_include_next; + src_lim::FInclude* prev = row.gitfile_zd_include_prev; + src_lim::FInclude* next = row.gitfile_zd_include_next; // if element is first, adjust list head; otherwise, adjust previous element's next - src_lim::FInclude **new_next_a = &prev->zd_include_next; + src_lim::FInclude **new_next_a = &prev->gitfile_zd_include_next; src_lim::FInclude **new_next_b = &gitfile.zd_include_head; src_lim::FInclude **new_next = prev ? new_next_a : new_next_b; *new_next = next; // if element is last, adjust list tail; otherwise, adjust next element's prev - src_lim::FInclude **new_prev_a = &next->zd_include_prev; + src_lim::FInclude **new_prev_a = &next->gitfile_zd_include_prev; src_lim::FInclude **new_prev_b = &gitfile.zd_include_tail; src_lim::FInclude **new_prev = next ? new_prev_a : new_prev_b; *new_prev = prev; gitfile.zd_include_n--; - row.zd_include_next=(src_lim::FInclude*)-1; // not-in-list + row.gitfile_zd_include_next=(src_lim::FInclude*)-1; // not-in-list } } @@ -1205,9 +1212,9 @@ void src_lim::zd_include_RemoveAll(src_lim::FGitfile& gitfile) { gitfile.zd_include_tail = NULL; gitfile.zd_include_n = 0; while (row) { - src_lim::FInclude* row_next = row->zd_include_next; - row->zd_include_next = (src_lim::FInclude*)-1; - row->zd_include_prev = NULL; + src_lim::FInclude* row_next = row->gitfile_zd_include_next; + row->gitfile_zd_include_next = (src_lim::FInclude*)-1; + row->gitfile_zd_include_prev = NULL; row = row_next; } } @@ -1218,14 +1225,14 @@ src_lim::FInclude* src_lim::zd_include_RemoveFirst(src_lim::FGitfile& gitfile) { src_lim::FInclude *row = NULL; row = gitfile.zd_include_head; if (row) { - src_lim::FInclude *next = row->zd_include_next; + src_lim::FInclude *next = row->gitfile_zd_include_next; gitfile.zd_include_head = next; - src_lim::FInclude **new_end_a = &next->zd_include_prev; + src_lim::FInclude **new_end_a = &next->gitfile_zd_include_prev; src_lim::FInclude **new_end_b = &gitfile.zd_include_tail; src_lim::FInclude **new_end = next ? new_end_a : new_end_b; *new_end = NULL; gitfile.zd_include_n--; - row->zd_include_next = (src_lim::FInclude*)-1; // mark as not-in-list + row->gitfile_zd_include_next = (src_lim::FInclude*)-1; // mark as not-in-list } return row; } @@ -1556,11 +1563,13 @@ void src_lim::StaticCheck() { // --- src_lim...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); src_lim::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock src_lim::ReadArgv(); // dmmeta.main:src_lim src_lim::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -1573,6 +1582,7 @@ int main(int argc, char **argv) { try { src_lim::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/ssim2csv_gen.cpp b/cpp/gen/ssim2csv_gen.cpp index 615db4af..0fdc1be6 100644 --- a/cpp/gen/ssim2csv_gen.cpp +++ b/cpp/gen/ssim2csv_gen.cpp @@ -31,10 +31,13 @@ #include "include/gen/algo_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep ssim2csv::FDb ssim2csv::_db; // dependency found via dev.targdep @@ -45,8 +48,8 @@ const char *ssim2csv_help = " OPTION TYPE DFLT COMMENT\n" " -expand string \"\"\n" " -ignoreQuote\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -146,9 +149,8 @@ void ssim2csv::ReadArgv() { } if (ch_N(attrname) == 0) { err << "ssim2csv: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -262,8 +267,8 @@ bool ssim2csv::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && ssim2csv::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -420,14 +425,9 @@ bool ssim2csv::expand_XrefMaybe(ssim2csv::FExpand &row) { // Find row by key. Return NULL if not found. ssim2csv::FExpand* ssim2csv::ind_expand_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_expand_buckets_n - 1); - ssim2csv::FExpand* *e = &_db.ind_expand_buckets_elems[index]; - ssim2csv::FExpand* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).expand == key; - if (done) break; - e = &ret->ind_expand_next; - } while (true); + ssim2csv::FExpand *ret = _db.ind_expand_buckets_elems[index]; + for (; ret && !((*ret).expand == key); ret = ret->ind_expand_next) { + } return ret; } @@ -459,10 +459,11 @@ ssim2csv::FExpand& ssim2csv::ind_expand_GetOrCreate(const algo::strptr& key) { // --- ssim2csv.FDb.ind_expand.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool ssim2csv::ind_expand_InsertMaybe(ssim2csv::FExpand& row) { - ind_expand_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_expand_next == (ssim2csv::FExpand*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.expand) & (_db.ind_expand_buckets_n - 1); + row.ind_expand_hashval = algo::cstring_Hash(0, row.expand); + ind_expand_Reserve(1); + u32 index = row.ind_expand_hashval & (_db.ind_expand_buckets_n - 1); ssim2csv::FExpand* *prev = &_db.ind_expand_buckets_elems[index]; do { ssim2csv::FExpand* ret = *prev; @@ -488,7 +489,7 @@ bool ssim2csv::ind_expand_InsertMaybe(ssim2csv::FExpand& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void ssim2csv::ind_expand_Remove(ssim2csv::FExpand& row) { if (LIKELY(row.ind_expand_next != (ssim2csv::FExpand*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.expand) & (_db.ind_expand_buckets_n - 1); + u32 index = row.ind_expand_hashval & (_db.ind_expand_buckets_n - 1); ssim2csv::FExpand* *prev = &_db.ind_expand_buckets_elems[index]; // addr of pointer to current element while (ssim2csv::FExpand *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -505,8 +506,14 @@ void ssim2csv::ind_expand_Remove(ssim2csv::FExpand& row) { // --- ssim2csv.FDb.ind_expand.Reserve // Reserve enough room in the hash for N more elements. Return success code. void ssim2csv::ind_expand_Reserve(int n) { + ind_expand_AbsReserve(_db.ind_expand_n + n); +} + +// --- ssim2csv.FDb.ind_expand.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void ssim2csv::ind_expand_AbsReserve(int n) { u32 old_nbuckets = _db.ind_expand_buckets_n; - u32 new_nelems = _db.ind_expand_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -525,7 +532,7 @@ void ssim2csv::ind_expand_Reserve(int n) { while (elem) { ssim2csv::FExpand &row = *elem; ssim2csv::FExpand* next = row.ind_expand_next; - u32 index = algo::cstring_Hash(0, row.expand) & (new_nbuckets-1); + u32 index = row.ind_expand_hashval & (new_nbuckets-1); row.ind_expand_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -628,14 +635,9 @@ bool ssim2csv::outfile_XrefMaybe(ssim2csv::FOutfile &row) { // Find row by key. Return NULL if not found. ssim2csv::FOutfile* ssim2csv::ind_outfile_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_outfile_buckets_n - 1); - ssim2csv::FOutfile* *e = &_db.ind_outfile_buckets_elems[index]; - ssim2csv::FOutfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).outfile == key; - if (done) break; - e = &ret->ind_outfile_next; - } while (true); + ssim2csv::FOutfile *ret = _db.ind_outfile_buckets_elems[index]; + for (; ret && !((*ret).outfile == key); ret = ret->ind_outfile_next) { + } return ret; } @@ -667,10 +669,11 @@ ssim2csv::FOutfile& ssim2csv::ind_outfile_GetOrCreate(const algo::strptr& key) { // --- ssim2csv.FDb.ind_outfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool ssim2csv::ind_outfile_InsertMaybe(ssim2csv::FOutfile& row) { - ind_outfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_outfile_next == (ssim2csv::FOutfile*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.outfile) & (_db.ind_outfile_buckets_n - 1); + row.ind_outfile_hashval = algo::cstring_Hash(0, row.outfile); + ind_outfile_Reserve(1); + u32 index = row.ind_outfile_hashval & (_db.ind_outfile_buckets_n - 1); ssim2csv::FOutfile* *prev = &_db.ind_outfile_buckets_elems[index]; do { ssim2csv::FOutfile* ret = *prev; @@ -696,7 +699,7 @@ bool ssim2csv::ind_outfile_InsertMaybe(ssim2csv::FOutfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void ssim2csv::ind_outfile_Remove(ssim2csv::FOutfile& row) { if (LIKELY(row.ind_outfile_next != (ssim2csv::FOutfile*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.outfile) & (_db.ind_outfile_buckets_n - 1); + u32 index = row.ind_outfile_hashval & (_db.ind_outfile_buckets_n - 1); ssim2csv::FOutfile* *prev = &_db.ind_outfile_buckets_elems[index]; // addr of pointer to current element while (ssim2csv::FOutfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -713,8 +716,14 @@ void ssim2csv::ind_outfile_Remove(ssim2csv::FOutfile& row) { // --- ssim2csv.FDb.ind_outfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void ssim2csv::ind_outfile_Reserve(int n) { + ind_outfile_AbsReserve(_db.ind_outfile_n + n); +} + +// --- ssim2csv.FDb.ind_outfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void ssim2csv::ind_outfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_outfile_buckets_n; - u32 new_nelems = _db.ind_outfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -733,7 +742,7 @@ void ssim2csv::ind_outfile_Reserve(int n) { while (elem) { ssim2csv::FOutfile &row = *elem; ssim2csv::FOutfile* next = row.ind_outfile_next; - u32 index = algo::cstring_Hash(0, row.outfile) & (new_nbuckets-1); + u32 index = row.ind_outfile_hashval & (new_nbuckets-1); row.ind_outfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -808,6 +817,25 @@ algo::aryptr ssim2csv::name_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- ssim2csv.FDb.name.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr ssim2csv::name_AllocNAt(int n_elems, int at) { + name_Reserve(n_elems); + int n = _db.name_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("ssim2csv.bad_alloc_n_at field:ssim2csv.FDb.name comment:'index out of range'"); + } + algo::cstring *elems = _db.name_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + _db.name_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- ssim2csv.FDb.name.Remove // Remove item by index. If index outside of range, do nothing. void ssim2csv::name_Remove(u32 i) { @@ -884,6 +912,30 @@ bool ssim2csv::name_ReadStrptrMaybe(algo::strptr in_str) { return retval; } +// --- ssim2csv.FDb.name.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void ssim2csv::name_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.name_elems && rhs.elems < _db.name_elems + _db.name_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("ssim2csv.tary_alias field:ssim2csv.FDb.name comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.name_elems+1))) { + FatalErrorExit("ssim2csv.bad_insary field:ssim2csv.FDb.name comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.name_n - at; + name_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.name_elems + at + nnew + i) algo::cstring(_db.name_elems[at + i]); + _db.name_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.name_elems + at + i) algo::cstring(rhs[i]); + } + _db.name_n += nnew; +} + // --- ssim2csv.FDb.value.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -946,6 +998,25 @@ algo::aryptr ssim2csv::value_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- ssim2csv.FDb.value.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr ssim2csv::value_AllocNAt(int n_elems, int at) { + value_Reserve(n_elems); + int n = _db.value_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("ssim2csv.bad_alloc_n_at field:ssim2csv.FDb.value comment:'index out of range'"); + } + algo::cstring *elems = _db.value_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + _db.value_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- ssim2csv.FDb.value.Remove // Remove item by index. If index outside of range, do nothing. void ssim2csv::value_Remove(u32 i) { @@ -1022,6 +1093,30 @@ bool ssim2csv::value_ReadStrptrMaybe(algo::strptr in_str) { return retval; } +// --- ssim2csv.FDb.value.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void ssim2csv::value_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.value_elems && rhs.elems < _db.value_elems + _db.value_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("ssim2csv.tary_alias field:ssim2csv.FDb.value comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.value_elems+1))) { + FatalErrorExit("ssim2csv.bad_insary field:ssim2csv.FDb.value comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.value_n - at; + value_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.value_elems + at + nnew + i) algo::cstring(_db.value_elems[at + i]); + _db.value_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.value_elems + at + i) algo::cstring(rhs[i]); + } + _db.value_n += nnew; +} + // --- ssim2csv.FDb.flatten.Addary // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -1084,6 +1179,25 @@ algo::aryptr ssim2csv::flatten_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- ssim2csv.FDb.flatten.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr ssim2csv::flatten_AllocNAt(int n_elems, int at) { + flatten_Reserve(n_elems); + int n = _db.flatten_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("ssim2csv.bad_alloc_n_at field:ssim2csv.FDb.flatten comment:'index out of range'"); + } + ssim2csv::FFlatten *elems = _db.flatten_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(ssim2csv::FFlatten)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) ssim2csv::FFlatten(); // construct new element, default initialize + } + _db.flatten_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- ssim2csv.FDb.flatten.Remove // Remove item by index. If index outside of range, do nothing. void ssim2csv::flatten_Remove(u32 i) { @@ -1146,6 +1260,30 @@ algo::aryptr ssim2csv::flatten_AllocNVal(int n_elems, const return algo::aryptr(elems + old_n, n_elems); } +// --- ssim2csv.FDb.flatten.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void ssim2csv::flatten_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.flatten_elems && rhs.elems < _db.flatten_elems + _db.flatten_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("ssim2csv.tary_alias field:ssim2csv.FDb.flatten comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.flatten_elems+1))) { + FatalErrorExit("ssim2csv.bad_insary field:ssim2csv.FDb.flatten comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.flatten_n - at; + flatten_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.flatten_elems + at + nnew + i) ssim2csv::FFlatten(_db.flatten_elems[at + i]); + _db.flatten_elems[at + i].~FFlatten(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.flatten_elems + at + i) ssim2csv::FFlatten(rhs[i]); + } + _db.flatten_n += nnew; +} + // --- ssim2csv.FDb.trace.RowidFind // find trace by row id (used to implement reflection) static algo::ImrowPtr ssim2csv::trace_RowidFind(int t) { @@ -1385,11 +1523,13 @@ void ssim2csv::StaticCheck() { // --- ssim2csv...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); ssim2csv::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock ssim2csv::ReadArgv(); // dmmeta.main:ssim2csv ssim2csv::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -1402,6 +1542,7 @@ int main(int argc, char **argv) { try { ssim2csv::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/ssim2mysql_gen.cpp b/cpp/gen/ssim2mysql_gen.cpp index 08508dfd..568117cd 100644 --- a/cpp/gen/ssim2mysql_gen.cpp +++ b/cpp/gen/ssim2mysql_gen.cpp @@ -31,6 +31,8 @@ #include "include/gen/dmmeta_gen.inl.h" #include "include/gen/command_gen.h" #include "include/gen/command_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_mysql_gen.h" @@ -39,6 +41,7 @@ // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_mysql::FDb lib_mysql::_db; // dependency found via dev.targdep ssim2mysql::FDb ssim2mysql::_db; // dependency found via dev.targdep @@ -59,8 +62,8 @@ const char *ssim2mysql_help = " -db string \"\" Optional database name\n" " -createdb Emit CREATE DATABASE code for namespace specified with \n" " -fkey Enable foreign key constraints (uses InnoDB storage engine)\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -211,15 +214,11 @@ algo::Smallstr100 ssim2mysql::name_Get(ssim2mysql::FCtype& ctype) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void ssim2mysql::c_field_Insert(ssim2mysql::FCtype& ctype, ssim2mysql::FField& row) { - if (bool_Update(row.ctype_c_field_in_ary,true)) { - // reserve space + if (!row.ctype_c_field_in_ary) { c_field_Reserve(ctype, 1); - u32 n = ctype.c_field_n; - u32 at = n; - ssim2mysql::FField* *elems = ctype.c_field_elems; - elems[at] = &row; - ctype.c_field_n = n+1; - + u32 n = ctype.c_field_n++; + ctype.c_field_elems[n] = &row; + row.ctype_c_field_in_ary = true; } } @@ -228,7 +227,7 @@ void ssim2mysql::c_field_Insert(ssim2mysql::FCtype& ctype, ssim2mysql::FField& r // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool ssim2mysql::c_field_InsertMaybe(ssim2mysql::FCtype& ctype, ssim2mysql::FField& row) { - bool retval = !row.ctype_c_field_in_ary; + bool retval = !ctype_c_field_InAryQ(row); c_field_Insert(ctype,row); // check is performed in _Insert again return retval; } @@ -236,18 +235,18 @@ bool ssim2mysql::c_field_InsertMaybe(ssim2mysql::FCtype& ctype, ssim2mysql::FFie // --- ssim2mysql.FCtype.c_field.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void ssim2mysql::c_field_Remove(ssim2mysql::FCtype& ctype, ssim2mysql::FField& row) { + int n = ctype.c_field_n; if (bool_Update(row.ctype_c_field_in_ary,false)) { - int lim = ctype.c_field_n; ssim2mysql::FField* *elems = ctype.c_field_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { ssim2mysql::FField* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(ssim2mysql::FField*) * (lim - j); + size_t nbytes = sizeof(ssim2mysql::FField*) * (n - j); memmove(elems + i, elems + j, nbytes); - ctype.c_field_n = lim - 1; + ctype.c_field_n = n - 1; break; } } @@ -324,14 +323,9 @@ void ssim2mysql::trace_Print(ssim2mysql::trace& row, algo::cstring& str) { // Find row by key. Return NULL if not found. ssim2mysql::FColumn* ssim2mysql::ind_column_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_column_buckets_n - 1); - ssim2mysql::FColumn* *e = &_db.ind_column_buckets_elems[index]; - ssim2mysql::FColumn* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).column == key; - if (done) break; - e = &ret->ind_column_next; - } while (true); + ssim2mysql::FColumn *ret = _db.ind_column_buckets_elems[index]; + for (; ret && !((*ret).column == key); ret = ret->ind_column_next) { + } return ret; } @@ -363,10 +357,11 @@ ssim2mysql::FColumn& ssim2mysql::ind_column_GetOrCreate(const algo::strptr& key) // --- ssim2mysql.FDb.ind_column.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool ssim2mysql::ind_column_InsertMaybe(ssim2mysql::FColumn& row) { - ind_column_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_column_next == (ssim2mysql::FColumn*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.column) & (_db.ind_column_buckets_n - 1); + row.ind_column_hashval = algo::Smallstr100_Hash(0, row.column); + ind_column_Reserve(1); + u32 index = row.ind_column_hashval & (_db.ind_column_buckets_n - 1); ssim2mysql::FColumn* *prev = &_db.ind_column_buckets_elems[index]; do { ssim2mysql::FColumn* ret = *prev; @@ -392,7 +387,7 @@ bool ssim2mysql::ind_column_InsertMaybe(ssim2mysql::FColumn& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void ssim2mysql::ind_column_Remove(ssim2mysql::FColumn& row) { if (LIKELY(row.ind_column_next != (ssim2mysql::FColumn*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.column) & (_db.ind_column_buckets_n - 1); + u32 index = row.ind_column_hashval & (_db.ind_column_buckets_n - 1); ssim2mysql::FColumn* *prev = &_db.ind_column_buckets_elems[index]; // addr of pointer to current element while (ssim2mysql::FColumn *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -409,8 +404,14 @@ void ssim2mysql::ind_column_Remove(ssim2mysql::FColumn& row) { // --- ssim2mysql.FDb.ind_column.Reserve // Reserve enough room in the hash for N more elements. Return success code. void ssim2mysql::ind_column_Reserve(int n) { + ind_column_AbsReserve(_db.ind_column_n + n); +} + +// --- ssim2mysql.FDb.ind_column.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void ssim2mysql::ind_column_AbsReserve(int n) { u32 old_nbuckets = _db.ind_column_buckets_n; - u32 new_nelems = _db.ind_column_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -429,7 +430,7 @@ void ssim2mysql::ind_column_Reserve(int n) { while (elem) { ssim2mysql::FColumn &row = *elem; ssim2mysql::FColumn* next = row.ind_column_next; - u32 index = algo::Smallstr100_Hash(0, row.column) & (new_nbuckets-1); + u32 index = row.ind_column_hashval & (new_nbuckets-1); row.ind_column_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1129,9 +1130,8 @@ void ssim2mysql::ReadArgv() { } if (ch_N(attrname) == 0) { err << "ssim2mysql: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:ssim2mysql.FDb.cmdline @@ -1185,7 +1188,7 @@ void ssim2mysql::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -1305,8 +1308,8 @@ bool ssim2mysql::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && ssim2mysql::LoadTuplesFile(algo::SsimFname(root,"dmmeta.sqltype"),recursive); retval = retval && ssim2mysql::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -1379,14 +1382,9 @@ bool ssim2mysql::_db_XrefMaybe() { // Find row by key. Return NULL if not found. ssim2mysql::FNs* ssim2mysql::ind_ns_Find(const algo::strptr& key) { u32 index = algo::Smallstr16_Hash(0, key) & (_db.ind_ns_buckets_n - 1); - ssim2mysql::FNs* *e = &_db.ind_ns_buckets_elems[index]; - ssim2mysql::FNs* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ns == key; - if (done) break; - e = &ret->ind_ns_next; - } while (true); + ssim2mysql::FNs *ret = _db.ind_ns_buckets_elems[index]; + for (; ret && !((*ret).ns == key); ret = ret->ind_ns_next) { + } return ret; } @@ -1418,10 +1416,11 @@ ssim2mysql::FNs& ssim2mysql::ind_ns_GetOrCreate(const algo::strptr& key) { // --- ssim2mysql.FDb.ind_ns.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool ssim2mysql::ind_ns_InsertMaybe(ssim2mysql::FNs& row) { - ind_ns_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ns_next == (ssim2mysql::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + row.ind_ns_hashval = algo::Smallstr16_Hash(0, row.ns); + ind_ns_Reserve(1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); ssim2mysql::FNs* *prev = &_db.ind_ns_buckets_elems[index]; do { ssim2mysql::FNs* ret = *prev; @@ -1447,7 +1446,7 @@ bool ssim2mysql::ind_ns_InsertMaybe(ssim2mysql::FNs& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void ssim2mysql::ind_ns_Remove(ssim2mysql::FNs& row) { if (LIKELY(row.ind_ns_next != (ssim2mysql::FNs*)-1)) {// check if in hash already - u32 index = algo::Smallstr16_Hash(0, row.ns) & (_db.ind_ns_buckets_n - 1); + u32 index = row.ind_ns_hashval & (_db.ind_ns_buckets_n - 1); ssim2mysql::FNs* *prev = &_db.ind_ns_buckets_elems[index]; // addr of pointer to current element while (ssim2mysql::FNs *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1464,8 +1463,14 @@ void ssim2mysql::ind_ns_Remove(ssim2mysql::FNs& row) { // --- ssim2mysql.FDb.ind_ns.Reserve // Reserve enough room in the hash for N more elements. Return success code. void ssim2mysql::ind_ns_Reserve(int n) { + ind_ns_AbsReserve(_db.ind_ns_n + n); +} + +// --- ssim2mysql.FDb.ind_ns.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void ssim2mysql::ind_ns_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ns_buckets_n; - u32 new_nelems = _db.ind_ns_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1484,7 +1489,7 @@ void ssim2mysql::ind_ns_Reserve(int n) { while (elem) { ssim2mysql::FNs &row = *elem; ssim2mysql::FNs* next = row.ind_ns_next; - u32 index = algo::Smallstr16_Hash(0, row.ns) & (new_nbuckets-1); + u32 index = row.ind_ns_hashval & (new_nbuckets-1); row.ind_ns_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1501,14 +1506,9 @@ void ssim2mysql::ind_ns_Reserve(int n) { // Find row by key. Return NULL if not found. ssim2mysql::FCtype* ssim2mysql::ind_ctype_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_ctype_buckets_n - 1); - ssim2mysql::FCtype* *e = &_db.ind_ctype_buckets_elems[index]; - ssim2mysql::FCtype* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_ctype_next; - } while (true); + ssim2mysql::FCtype *ret = _db.ind_ctype_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_ctype_next) { + } return ret; } @@ -1540,10 +1540,11 @@ ssim2mysql::FCtype& ssim2mysql::ind_ctype_GetOrCreate(const algo::strptr& key) { // --- ssim2mysql.FDb.ind_ctype.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool ssim2mysql::ind_ctype_InsertMaybe(ssim2mysql::FCtype& row) { - ind_ctype_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ctype_next == (ssim2mysql::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + row.ind_ctype_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_ctype_Reserve(1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); ssim2mysql::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; do { ssim2mysql::FCtype* ret = *prev; @@ -1569,7 +1570,7 @@ bool ssim2mysql::ind_ctype_InsertMaybe(ssim2mysql::FCtype& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void ssim2mysql::ind_ctype_Remove(ssim2mysql::FCtype& row) { if (LIKELY(row.ind_ctype_next != (ssim2mysql::FCtype*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_ctype_buckets_n - 1); + u32 index = row.ind_ctype_hashval & (_db.ind_ctype_buckets_n - 1); ssim2mysql::FCtype* *prev = &_db.ind_ctype_buckets_elems[index]; // addr of pointer to current element while (ssim2mysql::FCtype *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1586,8 +1587,14 @@ void ssim2mysql::ind_ctype_Remove(ssim2mysql::FCtype& row) { // --- ssim2mysql.FDb.ind_ctype.Reserve // Reserve enough room in the hash for N more elements. Return success code. void ssim2mysql::ind_ctype_Reserve(int n) { + ind_ctype_AbsReserve(_db.ind_ctype_n + n); +} + +// --- ssim2mysql.FDb.ind_ctype.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void ssim2mysql::ind_ctype_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ctype_buckets_n; - u32 new_nelems = _db.ind_ctype_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1606,7 +1613,7 @@ void ssim2mysql::ind_ctype_Reserve(int n) { while (elem) { ssim2mysql::FCtype &row = *elem; ssim2mysql::FCtype* next = row.ind_ctype_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_ctype_hashval & (new_nbuckets-1); row.ind_ctype_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1623,14 +1630,9 @@ void ssim2mysql::ind_ctype_Reserve(int n) { // Find row by key. Return NULL if not found. ssim2mysql::FField* ssim2mysql::ind_field_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_field_buckets_n - 1); - ssim2mysql::FField* *e = &_db.ind_field_buckets_elems[index]; - ssim2mysql::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + ssim2mysql::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_field_next) { + } return ret; } @@ -1662,10 +1664,11 @@ ssim2mysql::FField& ssim2mysql::ind_field_GetOrCreate(const algo::strptr& key) { // --- ssim2mysql.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool ssim2mysql::ind_field_InsertMaybe(ssim2mysql::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (ssim2mysql::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::Smallstr100_Hash(0, row.field); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); ssim2mysql::FField* *prev = &_db.ind_field_buckets_elems[index]; do { ssim2mysql::FField* ret = *prev; @@ -1691,7 +1694,7 @@ bool ssim2mysql::ind_field_InsertMaybe(ssim2mysql::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void ssim2mysql::ind_field_Remove(ssim2mysql::FField& row) { if (LIKELY(row.ind_field_next != (ssim2mysql::FField*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); ssim2mysql::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (ssim2mysql::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1708,8 +1711,14 @@ void ssim2mysql::ind_field_Remove(ssim2mysql::FField& row) { // --- ssim2mysql.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void ssim2mysql::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- ssim2mysql.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void ssim2mysql::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1728,7 +1737,7 @@ void ssim2mysql::ind_field_Reserve(int n) { while (elem) { ssim2mysql::FField &row = *elem; ssim2mysql::FField* next = row.ind_field_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1975,14 +1984,9 @@ bool ssim2mysql::ssimfile_XrefMaybe(ssim2mysql::FSsimfile &row) { // Find row by key. Return NULL if not found. ssim2mysql::FSsimfile* ssim2mysql::ind_ssimfile_Find(const algo::strptr& key) { u32 index = algo::Smallstr50_Hash(0, key) & (_db.ind_ssimfile_buckets_n - 1); - ssim2mysql::FSsimfile* *e = &_db.ind_ssimfile_buckets_elems[index]; - ssim2mysql::FSsimfile* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ssimfile == key; - if (done) break; - e = &ret->ind_ssimfile_next; - } while (true); + ssim2mysql::FSsimfile *ret = _db.ind_ssimfile_buckets_elems[index]; + for (; ret && !((*ret).ssimfile == key); ret = ret->ind_ssimfile_next) { + } return ret; } @@ -2014,10 +2018,11 @@ ssim2mysql::FSsimfile& ssim2mysql::ind_ssimfile_GetOrCreate(const algo::strptr& // --- ssim2mysql.FDb.ind_ssimfile.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool ssim2mysql::ind_ssimfile_InsertMaybe(ssim2mysql::FSsimfile& row) { - ind_ssimfile_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_ssimfile_next == (ssim2mysql::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + row.ind_ssimfile_hashval = algo::Smallstr50_Hash(0, row.ssimfile); + ind_ssimfile_Reserve(1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); ssim2mysql::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; do { ssim2mysql::FSsimfile* ret = *prev; @@ -2043,7 +2048,7 @@ bool ssim2mysql::ind_ssimfile_InsertMaybe(ssim2mysql::FSsimfile& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void ssim2mysql::ind_ssimfile_Remove(ssim2mysql::FSsimfile& row) { if (LIKELY(row.ind_ssimfile_next != (ssim2mysql::FSsimfile*)-1)) {// check if in hash already - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (_db.ind_ssimfile_buckets_n - 1); + u32 index = row.ind_ssimfile_hashval & (_db.ind_ssimfile_buckets_n - 1); ssim2mysql::FSsimfile* *prev = &_db.ind_ssimfile_buckets_elems[index]; // addr of pointer to current element while (ssim2mysql::FSsimfile *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -2060,8 +2065,14 @@ void ssim2mysql::ind_ssimfile_Remove(ssim2mysql::FSsimfile& row) { // --- ssim2mysql.FDb.ind_ssimfile.Reserve // Reserve enough room in the hash for N more elements. Return success code. void ssim2mysql::ind_ssimfile_Reserve(int n) { + ind_ssimfile_AbsReserve(_db.ind_ssimfile_n + n); +} + +// --- ssim2mysql.FDb.ind_ssimfile.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void ssim2mysql::ind_ssimfile_AbsReserve(int n) { u32 old_nbuckets = _db.ind_ssimfile_buckets_n; - u32 new_nelems = _db.ind_ssimfile_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -2080,7 +2091,7 @@ void ssim2mysql::ind_ssimfile_Reserve(int n) { while (elem) { ssim2mysql::FSsimfile &row = *elem; ssim2mysql::FSsimfile* next = row.ind_ssimfile_next; - u32 index = algo::Smallstr50_Hash(0, row.ssimfile) & (new_nbuckets-1); + u32 index = row.ind_ssimfile_hashval & (new_nbuckets-1); row.ind_ssimfile_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -2720,6 +2731,7 @@ void ssim2mysql::FField_Init(ssim2mysql::FField& field) { field.is_pkeyref = bool(false); field.ctype_c_field_in_ary = bool(false); field.ind_field_next = (ssim2mysql::FField*)-1; // (ssim2mysql.FDb.ind_field) not-in-hash + field.ind_field_hashval = 0; // stored hash value } // --- ssim2mysql.FField..Uninit @@ -2773,8 +2785,8 @@ void ssim2mysql::FField_Print(ssim2mysql::FField& row, algo::cstring& str) { // File descriptor becomes owned by ssim2mysql::FInput.in_buf via FIohook field. // Whenever the file descriptor becomes readable, insert input into cd_input_line. void ssim2mysql::in_buf_BeginRead(ssim2mysql::FInput& input, algo::Fildes fd) { - callback_Set1(input.in_buf_iohook, input, ssim2mysql::cd_input_line_Insert); input.in_buf_iohook.fildes = fd; + callback_Set1(input.in_buf_iohook, input, ssim2mysql::cd_input_line_Insert); IOEvtFlags flags; read_Set(flags, true); if (input.in_buf_epoll_enable) { @@ -2824,6 +2836,23 @@ algo::aryptr ssim2mysql::in_buf_GetMsg(ssim2mysql::FInput& input) { return ret; } +// --- ssim2mysql.FInput.in_buf.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void ssim2mysql::in_buf_Realloc(ssim2mysql::FInput& input, int new_max) { + new_max = i32_Max(new_max, input.in_buf_end); + u8 *new_mem = input.in_buf_elems + ? (u8*)algo_lib::malloc_ReallocMem(input.in_buf_elems, input.in_buf_max, new_max) + : (u8*)algo_lib::malloc_AllocMem(new_max); + if (UNLIKELY(!new_mem)) { + FatalErrorExit("ssim2mysql.fbuf_nomem field:ssim2mysql.FInput.in_buf comment:'out of memory'"); + } + input.in_buf_elems = new_mem; + input.in_buf_max = new_max; +} + // --- ssim2mysql.FInput.in_buf.Refill // Refill buffer. Return false if no further refill possible (input buffer exhausted) bool ssim2mysql::in_buf_Refill(ssim2mysql::FInput& input) { @@ -2930,7 +2959,7 @@ void ssim2mysql::in_buf_SkipMsg(ssim2mysql::FInput& input) { } // --- ssim2mysql.FInput.in_buf.WriteAll -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. @@ -2944,22 +2973,39 @@ bool ssim2mysql::in_buf_WriteAll(ssim2mysql::FInput& input, u8 *in, i32 in_n) { // now try to write the message. i32 end = input.in_buf_end; bool fits = end + in_n <= max; - if (fits && in_n > 0) { - memcpy(input.in_buf_elems + end, in, in_n); - input.in_buf_end = end + in_n; + if (fits) { + if (in_n > 0) { + memcpy(input.in_buf_elems + end, in, in_n); + input.in_buf_end = end + in_n; + } } return fits; } +// --- ssim2mysql.FInput.in_buf.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void ssim2mysql::in_buf_WriteReserve(ssim2mysql::FInput& input, u8 *in, i32 in_n) { + if (!in_buf_WriteAll(input, in, in_n)) { + in_buf_Realloc(input, input.in_buf_max*2); + if (!in_buf_WriteAll(input, in, in_n)) { + FatalErrorExit("in_buf: out of memory"); + } + } +} + // --- ssim2mysql.FInput..Init // Set all fields to initial values. void ssim2mysql::FInput_Init(ssim2mysql::FInput& input) { + input.in_buf_elems = NULL; // in_buf: initialize + input.in_buf_max = 0; // in_buf: initialize input.in_buf_end = 0; // in_buf: initialize input.in_buf_start = 0; // in_buf: initialize input.in_buf_eof = false; // in_buf: initialize input.in_buf_msgvalid = false; // in_buf: initialize input.in_buf_msglen = 0; // in_buf: initialize input.in_buf_epoll_enable = true; // in_buf: initialize + in_buf_Realloc(input, 65536); input.input_next = (ssim2mysql::FInput*)-1; // (ssim2mysql.FDb.input) not-in-tpool's freelist input.cd_input_line_next = (ssim2mysql::FInput*)-1; // (ssim2mysql.FDb.cd_input_line) not-in-list input.cd_input_line_prev = NULL; // (ssim2mysql.FDb.cd_input_line) @@ -2969,6 +3015,13 @@ void ssim2mysql::FInput_Init(ssim2mysql::FInput& input) { void ssim2mysql::FInput_Uninit(ssim2mysql::FInput& input) { ssim2mysql::FInput &row = input; (void)row; cd_input_line_Remove(row); // remove input from index cd_input_line + + // ssim2mysql.FInput.in_buf.Uninit (Fbuf) //Socket data comes here + if (input.in_buf_elems) { + algo_lib::malloc_FreeMem(input.in_buf_elems, sizeof(char)*input.in_buf_max); // (ssim2mysql.FInput.in_buf) + } + input.in_buf_elems = NULL; + input.in_buf_max = 0; } // --- ssim2mysql.FInput..Print @@ -3007,15 +3060,11 @@ void ssim2mysql::ns_CopyIn(ssim2mysql::FNs &row, dmmeta::Ns &in) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void ssim2mysql::c_ssimfile_Insert(ssim2mysql::FNs& ns, ssim2mysql::FSsimfile& row) { - if (bool_Update(row.ns_c_ssimfile_in_ary,true)) { - // reserve space + if (!row.ns_c_ssimfile_in_ary) { c_ssimfile_Reserve(ns, 1); - u32 n = ns.c_ssimfile_n; - u32 at = n; - ssim2mysql::FSsimfile* *elems = ns.c_ssimfile_elems; - elems[at] = &row; - ns.c_ssimfile_n = n+1; - + u32 n = ns.c_ssimfile_n++; + ns.c_ssimfile_elems[n] = &row; + row.ns_c_ssimfile_in_ary = true; } } @@ -3024,7 +3073,7 @@ void ssim2mysql::c_ssimfile_Insert(ssim2mysql::FNs& ns, ssim2mysql::FSsimfile& r // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool ssim2mysql::c_ssimfile_InsertMaybe(ssim2mysql::FNs& ns, ssim2mysql::FSsimfile& row) { - bool retval = !row.ns_c_ssimfile_in_ary; + bool retval = !ns_c_ssimfile_InAryQ(row); c_ssimfile_Insert(ns,row); // check is performed in _Insert again return retval; } @@ -3032,18 +3081,18 @@ bool ssim2mysql::c_ssimfile_InsertMaybe(ssim2mysql::FNs& ns, ssim2mysql::FSsimfi // --- ssim2mysql.FNs.c_ssimfile.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void ssim2mysql::c_ssimfile_Remove(ssim2mysql::FNs& ns, ssim2mysql::FSsimfile& row) { + int n = ns.c_ssimfile_n; if (bool_Update(row.ns_c_ssimfile_in_ary,false)) { - int lim = ns.c_ssimfile_n; ssim2mysql::FSsimfile* *elems = ns.c_ssimfile_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { ssim2mysql::FSsimfile* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(ssim2mysql::FSsimfile*) * (lim - j); + size_t nbytes = sizeof(ssim2mysql::FSsimfile*) * (n - j); memmove(elems + i, elems + j, nbytes); - ns.c_ssimfile_n = lim - 1; + ns.c_ssimfile_n = n - 1; break; } } @@ -3174,15 +3223,11 @@ algo::Smallstr50 ssim2mysql::name_Get(ssim2mysql::FSsimfile& ssimfile) { // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. void ssim2mysql::c_column_Insert(ssim2mysql::FSsimfile& ssimfile, ssim2mysql::FColumn& row) { - if (bool_Update(row.ssimfile_c_column_in_ary,true)) { - // reserve space + if (!row.ssimfile_c_column_in_ary) { c_column_Reserve(ssimfile, 1); - u32 n = ssimfile.c_column_n; - u32 at = n; - ssim2mysql::FColumn* *elems = ssimfile.c_column_elems; - elems[at] = &row; - ssimfile.c_column_n = n+1; - + u32 n = ssimfile.c_column_n++; + ssimfile.c_column_elems[n] = &row; + row.ssimfile_c_column_in_ary = true; } } @@ -3191,7 +3236,7 @@ void ssim2mysql::c_column_Insert(ssim2mysql::FSsimfile& ssimfile, ssim2mysql::FC // If row is already in the array, do nothing. // Return value: whether element was inserted into array. bool ssim2mysql::c_column_InsertMaybe(ssim2mysql::FSsimfile& ssimfile, ssim2mysql::FColumn& row) { - bool retval = !row.ssimfile_c_column_in_ary; + bool retval = !ssimfile_c_column_InAryQ(row); c_column_Insert(ssimfile,row); // check is performed in _Insert again return retval; } @@ -3199,18 +3244,18 @@ bool ssim2mysql::c_column_InsertMaybe(ssim2mysql::FSsimfile& ssimfile, ssim2mysq // --- ssim2mysql.FSsimfile.c_column.Remove // Find element using linear scan. If element is in array, remove, otherwise do nothing void ssim2mysql::c_column_Remove(ssim2mysql::FSsimfile& ssimfile, ssim2mysql::FColumn& row) { + int n = ssimfile.c_column_n; if (bool_Update(row.ssimfile_c_column_in_ary,false)) { - int lim = ssimfile.c_column_n; ssim2mysql::FColumn* *elems = ssimfile.c_column_elems; // search backward, so that most recently added element is found first. // if found, shift array. - for (int i = lim-1; i>=0; i--) { + for (int i = n-1; i>=0; i--) { ssim2mysql::FColumn* elem = elems[i]; // fetch element if (elem == &row) { int j = i + 1; - size_t nbytes = sizeof(ssim2mysql::FColumn*) * (lim - j); + size_t nbytes = sizeof(ssim2mysql::FColumn*) * (n - j); memmove(elems + i, elems + j, nbytes); - ssimfile.c_column_n = lim - 1; + ssimfile.c_column_n = n - 1; break; } } @@ -3245,6 +3290,7 @@ void ssim2mysql::FSsimfile_Init(ssim2mysql::FSsimfile& ssimfile) { ssimfile.c_column_max = 0; // (ssim2mysql.FSsimfile.c_column) ssimfile.ns_c_ssimfile_in_ary = bool(false); ssimfile.ind_ssimfile_next = (ssim2mysql::FSsimfile*)-1; // (ssim2mysql.FDb.ind_ssimfile) not-in-hash + ssimfile.ind_ssimfile_hashval = 0; // stored hash value ssimfile.zd_ssimfile_next = (ssim2mysql::FSsimfile*)-1; // (ssim2mysql.FDb.zd_ssimfile) not-in-list ssimfile.zd_ssimfile_prev = NULL; // (ssim2mysql.FDb.zd_ssimfile) } @@ -3567,12 +3613,14 @@ void ssim2mysql::StaticCheck() { // --- ssim2mysql...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); lib_mysql::FDb_Init(); ssim2mysql::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock ssim2mysql::ReadArgv(); // dmmeta.main:ssim2mysql ssim2mysql::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -3586,6 +3634,7 @@ int main(int argc, char **argv) { ssim2mysql::FDb_Uninit(); lib_mysql::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/ssimfilt_gen.cpp b/cpp/gen/ssimfilt_gen.cpp index 9277b2d2..55752341 100644 --- a/cpp/gen/ssimfilt_gen.cpp +++ b/cpp/gen/ssimfilt_gen.cpp @@ -33,19 +33,19 @@ #include "include/gen/dev_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/lib_amcdb_gen.h" #include "include/gen/lib_amcdb_gen.inl.h" #include "include/gen/lib_ctype_gen.h" #include "include/gen/lib_ctype_gen.inl.h" -#include "include/gen/lib_json_gen.h" -#include "include/gen/lib_json_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep lib_ctype::FDb lib_ctype::_db; // dependency found via dev.targdep -lib_json::FDb lib_json::_db; // dependency found via dev.targdep ssimfilt::FDb ssimfilt::_db; // dependency found via dev.targdep namespace ssimfilt { @@ -57,7 +57,7 @@ const char *ssimfilt_help = " [typetag] regx \"%\" (filter) Match typetag. ^=first encountered typetag\n" " [match]... string (filter) Select input tuple if value of key matches value (regx:regx)\n" " -field... string (project) Select fields for output (regx)\n" -" -format int ssim Output format for selected tuples (ssim|csv|field|cmd|json|stablefld|table|mdtable)\n" +" -format enum ssim Output format for selected tuples (ssim|csv|field|cmd|json|stablefld|table|mdtable)\n" " ssim Print selected/filtered tuples\n" " csv First tuple determines header. CSV quoting is used. Newlines are removed\n" " field Print selected fields, one per line\n" @@ -68,8 +68,8 @@ const char *ssimfilt_help = " mdtable ASCII Markdown table with | separators for each group of tuples\n" " -t Alias for -format:table\n" " -cmd string \"\" Command to output\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -188,9 +188,8 @@ void ssimfilt::ReadArgv() { } if (ch_N(attrname) == 0) { err << "ssimfilt: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { } // dmmeta.floadtuples:ssimfilt.FDb.cmdline @@ -244,7 +246,7 @@ void ssimfilt::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -338,8 +340,8 @@ bool ssimfilt::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && ssimfilt::LoadTuplesFile(algo::SsimFname(root,"dev.unstablefld"),recursive); retval = retval && ssimfilt::LoadTuplesFile(algo::SsimFname(root,"amcdb.bltin"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -732,14 +734,9 @@ bool ssimfilt::unstablefld_XrefMaybe(ssimfilt::FUnstablefld &row) { // Find row by key. Return NULL if not found. ssimfilt::FUnstablefld* ssimfilt::ind_unstablefld_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_unstablefld_buckets_n - 1); - ssimfilt::FUnstablefld* *e = &_db.ind_unstablefld_buckets_elems[index]; - ssimfilt::FUnstablefld* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).field == key; - if (done) break; - e = &ret->ind_unstablefld_next; - } while (true); + ssimfilt::FUnstablefld *ret = _db.ind_unstablefld_buckets_elems[index]; + for (; ret && !((*ret).field == key); ret = ret->ind_unstablefld_next) { + } return ret; } @@ -771,10 +768,11 @@ ssimfilt::FUnstablefld& ssimfilt::ind_unstablefld_GetOrCreate(const algo::strptr // --- ssimfilt.FDb.ind_unstablefld.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool ssimfilt::ind_unstablefld_InsertMaybe(ssimfilt::FUnstablefld& row) { - ind_unstablefld_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_unstablefld_next == (ssimfilt::FUnstablefld*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_unstablefld_buckets_n - 1); + row.ind_unstablefld_hashval = algo::Smallstr100_Hash(0, row.field); + ind_unstablefld_Reserve(1); + u32 index = row.ind_unstablefld_hashval & (_db.ind_unstablefld_buckets_n - 1); ssimfilt::FUnstablefld* *prev = &_db.ind_unstablefld_buckets_elems[index]; do { ssimfilt::FUnstablefld* ret = *prev; @@ -800,7 +798,7 @@ bool ssimfilt::ind_unstablefld_InsertMaybe(ssimfilt::FUnstablefld& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void ssimfilt::ind_unstablefld_Remove(ssimfilt::FUnstablefld& row) { if (LIKELY(row.ind_unstablefld_next != (ssimfilt::FUnstablefld*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.field) & (_db.ind_unstablefld_buckets_n - 1); + u32 index = row.ind_unstablefld_hashval & (_db.ind_unstablefld_buckets_n - 1); ssimfilt::FUnstablefld* *prev = &_db.ind_unstablefld_buckets_elems[index]; // addr of pointer to current element while (ssimfilt::FUnstablefld *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -817,8 +815,14 @@ void ssimfilt::ind_unstablefld_Remove(ssimfilt::FUnstablefld& row) { // --- ssimfilt.FDb.ind_unstablefld.Reserve // Reserve enough room in the hash for N more elements. Return success code. void ssimfilt::ind_unstablefld_Reserve(int n) { + ind_unstablefld_AbsReserve(_db.ind_unstablefld_n + n); +} + +// --- ssimfilt.FDb.ind_unstablefld.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void ssimfilt::ind_unstablefld_AbsReserve(int n) { u32 old_nbuckets = _db.ind_unstablefld_buckets_n; - u32 new_nelems = _db.ind_unstablefld_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -837,7 +841,7 @@ void ssimfilt::ind_unstablefld_Reserve(int n) { while (elem) { ssimfilt::FUnstablefld &row = *elem; ssimfilt::FUnstablefld* next = row.ind_unstablefld_next; - u32 index = algo::Smallstr100_Hash(0, row.field) & (new_nbuckets-1); + u32 index = row.ind_unstablefld_hashval & (new_nbuckets-1); row.ind_unstablefld_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1144,13 +1148,14 @@ void ssimfilt::StaticCheck() { // --- ssimfilt...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); lib_ctype::FDb_Init(); - lib_json::FDb_Init(); ssimfilt::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock ssimfilt::ReadArgv(); // dmmeta.main:ssimfilt ssimfilt::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -1162,9 +1167,9 @@ int main(int argc, char **argv) { } try { ssimfilt::FDb_Uninit(); - lib_json::FDb_Uninit(); lib_ctype::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/strconv_gen.cpp b/cpp/gen/strconv_gen.cpp index 6f7d94e7..417be14c 100644 --- a/cpp/gen/strconv_gen.cpp +++ b/cpp/gen/strconv_gen.cpp @@ -27,12 +27,15 @@ #include "include/gen/strconv_gen.inl.h" #include "include/gen/command_gen.h" #include "include/gen/command_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep strconv::FDb strconv::_db; // dependency found via dev.targdep @@ -46,8 +49,8 @@ const char *strconv_help = " -tolowerunder Convert string to lower-under\n" " -in string \"data\" Input directory or filename, - for stdin\n" " -pathcomp string \"\" Extract path component from string\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -165,9 +168,8 @@ void strconv::ReadArgv() { } if (ch_N(attrname) == 0) { err << "strconv: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { if (!str_present) { err << "strconv: Missing value for required argument -str (see -help)" << eol; @@ -226,7 +231,7 @@ void strconv::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -293,8 +298,8 @@ bool strconv::LoadTuplesMaybe(algo::strptr root, bool recursive) { } else if (DirectoryQ(root)) { retval = retval && strconv::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -468,11 +473,13 @@ void strconv::StaticCheck() { // --- strconv...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); strconv::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock strconv::ReadArgv(); // dmmeta.main:strconv strconv::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -485,6 +492,7 @@ int main(int argc, char **argv) { try { strconv::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/sv2ssim_gen.cpp b/cpp/gen/sv2ssim_gen.cpp index 6127c6fb..1d0c0152 100644 --- a/cpp/gen/sv2ssim_gen.cpp +++ b/cpp/gen/sv2ssim_gen.cpp @@ -33,6 +33,8 @@ #include "include/gen/command_gen.inl.h" #include "include/gen/dmmeta_gen.h" #include "include/gen/dmmeta_gen.inl.h" +#include "include/gen/lib_json_gen.h" +#include "include/gen/lib_json_gen.inl.h" #include "include/gen/algo_lib_gen.h" #include "include/gen/algo_lib_gen.inl.h" #include "include/gen/lib_amcdb_gen.h" @@ -41,6 +43,7 @@ // Instantiate all libraries linked into this executable, // in dependency order +lib_json::FDb lib_json::_db; // dependency found via dev.targdep algo_lib::FDb algo_lib::_db; // dependency found via dev.targdep sv2ssim::FDb sv2ssim::_db; // dependency found via dev.targdep @@ -61,8 +64,8 @@ const char *sv2ssim_help = " -data (output) Convert input file to ssim tuples\n" " -report Y Print final report\n" " -prefer_signed Prefer signed types when given a choice\n" -" -verbose int Verbosity level (0..255); alias -v; cumulative\n" -" -debug int Debug level (0..255); alias -d; cumulative\n" +" -verbose flag Verbosity level (0..255); alias -v; cumulative\n" +" -debug flag Debug level (0..255); alias -d; cumulative\n" " -help Print help and exit; alias -h\n" " -version Print version and exit\n" " -signature Show signatures and exit; alias -sig\n" @@ -210,9 +213,8 @@ void sv2ssim::ReadArgv() { } if (ch_N(attrname) == 0) { err << "sv2ssim: too many arguments. error at "< 0; + algo_lib_logcat_verbose2.enabled = algo_lib::_db.cmdline.verbose > 1; if (!dohelp) { if (!fname_present) { err << "sv2ssim: Missing value for required argument -fname (see -help)" << eol; @@ -271,7 +276,7 @@ void sv2ssim::ReadArgv() { } if (err != "") { algo_lib::_db.exit_code=1; - prerr(err); + prerr_(err); // already has eol doexit=true; } if (dohelp) { @@ -361,8 +366,8 @@ bool sv2ssim::LoadTuplesMaybe(algo::strptr root, bool recursive) { retval = retval && sv2ssim::LoadTuplesFile(algo::SsimFname(root,"dmmeta.dispsigcheck"),recursive); retval = retval && sv2ssim::LoadTuplesFile(algo::SsimFname(root,"amcdb.bltin"),recursive); } else { - algo_lib::SaveBadTag("path", root); - algo_lib::SaveBadTag("comment", "Wrong working directory?"); + algo_lib::AppendErrtext("path", root); + algo_lib::AppendErrtext("comment", "Wrong working directory?"); retval = false; } return retval; @@ -579,6 +584,25 @@ algo::aryptr sv2ssim::linetok_AllocN(int n_elems) { return algo::aryptr(elems + old_n, n_elems); } +// --- sv2ssim.FDb.linetok.AllocNAt +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +algo::aryptr sv2ssim::linetok_AllocNAt(int n_elems, int at) { + linetok_Reserve(n_elems); + int n = _db.linetok_n; + if (UNLIKELY(u64(at) > u64(n))) { + FatalErrorExit("sv2ssim.bad_alloc_n_at field:sv2ssim.FDb.linetok comment:'index out of range'"); + } + algo::cstring *elems = _db.linetok_elems; + memmove(elems + at + n_elems, elems + at, (n - at) * sizeof(algo::cstring)); + for (int i = 0; i < n_elems; i++) { + new (elems + at + i) algo::cstring(); // construct new element, default initialize + } + _db.linetok_n = n+n_elems; + return algo::aryptr(elems+at,n_elems); +} + // --- sv2ssim.FDb.linetok.Remove // Remove item by index. If index outside of range, do nothing. void sv2ssim::linetok_Remove(u32 i) { @@ -655,6 +679,30 @@ bool sv2ssim::linetok_ReadStrptrMaybe(algo::strptr in_str) { return retval; } +// --- sv2ssim.FDb.linetok.Insary +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +void sv2ssim::linetok_Insary(algo::aryptr rhs, int at) { + bool overlaps = rhs.n_elems>0 && rhs.elems >= _db.linetok_elems && rhs.elems < _db.linetok_elems + _db.linetok_max; + if (UNLIKELY(overlaps)) { + FatalErrorExit("sv2ssim.tary_alias field:sv2ssim.FDb.linetok comment:'alias error: sub-array is being appended to the whole'"); + } + if (UNLIKELY(u64(at) >= u64(_db.linetok_elems+1))) { + FatalErrorExit("sv2ssim.bad_insary field:sv2ssim.FDb.linetok comment:'index out of range'"); + } + int nnew = rhs.n_elems; + int nmove = _db.linetok_n - at; + linetok_Reserve(nnew); // reserve space + for (int i = nmove-1; i >=0 ; --i) { + new (_db.linetok_elems + at + nnew + i) algo::cstring(_db.linetok_elems[at + i]); + _db.linetok_elems[at + i].~cstring(); // destroy element + } + for (int i = 0; i < nnew; ++i) { + new (_db.linetok_elems + at + i) algo::cstring(rhs[i]); + } + _db.linetok_n += nnew; +} + // --- sv2ssim.FDb.svtype.Alloc // Allocate memory for new default row. // If out of memory, process is killed. @@ -757,14 +805,9 @@ bool sv2ssim::svtype_XrefMaybe(sv2ssim::FSvtype &row) { // Find row by key. Return NULL if not found. sv2ssim::FField* sv2ssim::ind_field_Find(const algo::strptr& key) { u32 index = algo::cstring_Hash(0, key) & (_db.ind_field_buckets_n - 1); - sv2ssim::FField* *e = &_db.ind_field_buckets_elems[index]; - sv2ssim::FField* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).name == key; - if (done) break; - e = &ret->ind_field_next; - } while (true); + sv2ssim::FField *ret = _db.ind_field_buckets_elems[index]; + for (; ret && !((*ret).name == key); ret = ret->ind_field_next) { + } return ret; } @@ -796,10 +839,11 @@ sv2ssim::FField& sv2ssim::ind_field_GetOrCreate(const algo::strptr& key) { // --- sv2ssim.FDb.ind_field.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool sv2ssim::ind_field_InsertMaybe(sv2ssim::FField& row) { - ind_field_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_field_next == (sv2ssim::FField*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.name) & (_db.ind_field_buckets_n - 1); + row.ind_field_hashval = algo::cstring_Hash(0, row.name); + ind_field_Reserve(1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); sv2ssim::FField* *prev = &_db.ind_field_buckets_elems[index]; do { sv2ssim::FField* ret = *prev; @@ -825,7 +869,7 @@ bool sv2ssim::ind_field_InsertMaybe(sv2ssim::FField& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void sv2ssim::ind_field_Remove(sv2ssim::FField& row) { if (LIKELY(row.ind_field_next != (sv2ssim::FField*)-1)) {// check if in hash already - u32 index = algo::cstring_Hash(0, row.name) & (_db.ind_field_buckets_n - 1); + u32 index = row.ind_field_hashval & (_db.ind_field_buckets_n - 1); sv2ssim::FField* *prev = &_db.ind_field_buckets_elems[index]; // addr of pointer to current element while (sv2ssim::FField *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -842,8 +886,14 @@ void sv2ssim::ind_field_Remove(sv2ssim::FField& row) { // --- sv2ssim.FDb.ind_field.Reserve // Reserve enough room in the hash for N more elements. Return success code. void sv2ssim::ind_field_Reserve(int n) { + ind_field_AbsReserve(_db.ind_field_n + n); +} + +// --- sv2ssim.FDb.ind_field.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void sv2ssim::ind_field_AbsReserve(int n) { u32 old_nbuckets = _db.ind_field_buckets_n; - u32 new_nelems = _db.ind_field_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -862,7 +912,7 @@ void sv2ssim::ind_field_Reserve(int n) { while (elem) { sv2ssim::FField &row = *elem; sv2ssim::FField* next = row.ind_field_next; - u32 index = algo::cstring_Hash(0, row.name) & (new_nbuckets-1); + u32 index = row.ind_field_hashval & (new_nbuckets-1); row.ind_field_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1058,14 +1108,9 @@ bool sv2ssim::bltin_XrefMaybe(sv2ssim::FBltin &row) { // Find row by key. Return NULL if not found. sv2ssim::FBltin* sv2ssim::ind_bltin_Find(const algo::strptr& key) { u32 index = algo::Smallstr100_Hash(0, key) & (_db.ind_bltin_buckets_n - 1); - sv2ssim::FBltin* *e = &_db.ind_bltin_buckets_elems[index]; - sv2ssim::FBltin* ret=NULL; - do { - ret = *e; - bool done = !ret || (*ret).ctype == key; - if (done) break; - e = &ret->ind_bltin_next; - } while (true); + sv2ssim::FBltin *ret = _db.ind_bltin_buckets_elems[index]; + for (; ret && !((*ret).ctype == key); ret = ret->ind_bltin_next) { + } return ret; } @@ -1097,10 +1142,11 @@ sv2ssim::FBltin& sv2ssim::ind_bltin_GetOrCreate(const algo::strptr& key) { // --- sv2ssim.FDb.ind_bltin.InsertMaybe // Insert row into hash table. Return true if row is reachable through the hash after the function completes. bool sv2ssim::ind_bltin_InsertMaybe(sv2ssim::FBltin& row) { - ind_bltin_Reserve(1); bool retval = true; // if already in hash, InsertMaybe returns true if (LIKELY(row.ind_bltin_next == (sv2ssim::FBltin*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_bltin_buckets_n - 1); + row.ind_bltin_hashval = algo::Smallstr100_Hash(0, row.ctype); + ind_bltin_Reserve(1); + u32 index = row.ind_bltin_hashval & (_db.ind_bltin_buckets_n - 1); sv2ssim::FBltin* *prev = &_db.ind_bltin_buckets_elems[index]; do { sv2ssim::FBltin* ret = *prev; @@ -1126,7 +1172,7 @@ bool sv2ssim::ind_bltin_InsertMaybe(sv2ssim::FBltin& row) { // Remove reference to element from hash index. If element is not in hash, do nothing void sv2ssim::ind_bltin_Remove(sv2ssim::FBltin& row) { if (LIKELY(row.ind_bltin_next != (sv2ssim::FBltin*)-1)) {// check if in hash already - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (_db.ind_bltin_buckets_n - 1); + u32 index = row.ind_bltin_hashval & (_db.ind_bltin_buckets_n - 1); sv2ssim::FBltin* *prev = &_db.ind_bltin_buckets_elems[index]; // addr of pointer to current element while (sv2ssim::FBltin *next = *prev) { // scan the collision chain for our element if (next == &row) { // found it? @@ -1143,8 +1189,14 @@ void sv2ssim::ind_bltin_Remove(sv2ssim::FBltin& row) { // --- sv2ssim.FDb.ind_bltin.Reserve // Reserve enough room in the hash for N more elements. Return success code. void sv2ssim::ind_bltin_Reserve(int n) { + ind_bltin_AbsReserve(_db.ind_bltin_n + n); +} + +// --- sv2ssim.FDb.ind_bltin.AbsReserve +// Reserve enough room for exacty N elements. Return success code. +void sv2ssim::ind_bltin_AbsReserve(int n) { u32 old_nbuckets = _db.ind_bltin_buckets_n; - u32 new_nelems = _db.ind_bltin_n + n; + u32 new_nelems = n; // # of elements has to be roughly equal to the number of buckets if (new_nelems > old_nbuckets) { int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4)); @@ -1163,7 +1215,7 @@ void sv2ssim::ind_bltin_Reserve(int n) { while (elem) { sv2ssim::FBltin &row = *elem; sv2ssim::FBltin* next = row.ind_bltin_next; - u32 index = algo::Smallstr100_Hash(0, row.ctype) & (new_nbuckets-1); + u32 index = row.ind_bltin_hashval & (new_nbuckets-1); row.ind_bltin_next = new_buckets[index]; new_buckets[index] = &row; elem = next; @@ -1294,6 +1346,7 @@ void sv2ssim::FField_Init(sv2ssim::FField& field) { field.couldbe_double = bool(true); field.rowid = i32(0); field.ind_field_next = (sv2ssim::FField*)-1; // (sv2ssim.FDb.ind_field) not-in-hash + field.ind_field_hashval = 0; // stored hash value field.zd_selfield_next = (sv2ssim::FField*)-1; // (sv2ssim.FDb.zd_selfield) not-in-list field.zd_selfield_prev = NULL; // (sv2ssim.FDb.zd_selfield) } @@ -1306,61 +1359,50 @@ bool sv2ssim::FField_ReadFieldMaybe(sv2ssim::FField& parent, algo::strptr field, switch(field_id) { case sv2ssim_FieldId_name: { retval = algo::cstring_ReadStrptrMaybe(parent.name, strval); - break; - } + } break; case sv2ssim_FieldId_ctype: { retval = algo::Smallstr100_ReadStrptrMaybe(parent.ctype, strval); - break; - } + } break; case sv2ssim_FieldId_maxwid: { retval = i32_ReadStrptrMaybe(parent.maxwid, strval); - break; - } + } break; case sv2ssim_FieldId_minval: { retval = double_ReadStrptrMaybe(parent.minval, strval); - break; - } + } break; case sv2ssim_FieldId_maxval: { retval = double_ReadStrptrMaybe(parent.maxval, strval); - break; - } + } break; case sv2ssim_FieldId_minwid_fix1: { retval = i32_ReadStrptrMaybe(parent.minwid_fix1, strval); - break; - } + } break; case sv2ssim_FieldId_maxwid_fix1: { retval = i32_ReadStrptrMaybe(parent.maxwid_fix1, strval); - break; - } + } break; case sv2ssim_FieldId_minwid_fix2: { retval = i32_ReadStrptrMaybe(parent.minwid_fix2, strval); - break; - } + } break; case sv2ssim_FieldId_maxwid_fix2: { retval = i32_ReadStrptrMaybe(parent.maxwid_fix2, strval); - break; - } + } break; case sv2ssim_FieldId_couldbe_int: { retval = bool_ReadStrptrMaybe(parent.couldbe_int, strval); - break; - } + } break; case sv2ssim_FieldId_couldbe_bool: { retval = bool_ReadStrptrMaybe(parent.couldbe_bool, strval); - break; - } + } break; case sv2ssim_FieldId_couldbe_fixwid: { retval = bool_ReadStrptrMaybe(parent.couldbe_fixwid, strval); - break; - } + } break; case sv2ssim_FieldId_couldbe_double: { retval = bool_ReadStrptrMaybe(parent.couldbe_double, strval); - break; - } + } break; case sv2ssim_FieldId_rowid: { retval = i32_ReadStrptrMaybe(parent.rowid, strval); - break; - } - default: break; + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; } if (!retval) { algo_lib::AppendErrtext("attr",field); @@ -1720,11 +1762,13 @@ void sv2ssim::StaticCheck() { // --- sv2ssim...main int main(int argc, char **argv) { try { + lib_json::FDb_Init(); algo_lib::FDb_Init(); sv2ssim::FDb_Init(); algo_lib::_db.argc = argc; algo_lib::_db.argv = argv; algo_lib::IohookInit(); + algo_lib::_db.clock = algo::CurrSchedTime(); // initialize clock sv2ssim::ReadArgv(); // dmmeta.main:sv2ssim sv2ssim::Main(); // user-defined main } catch(algo_lib::ErrorX &x) { @@ -1737,6 +1781,7 @@ int main(int argc, char **argv) { try { sv2ssim::FDb_Uninit(); algo_lib::FDb_Uninit(); + lib_json::FDb_Uninit(); } catch(algo_lib::ErrorX &) { // don't print anything, might crash algo_lib::_db.exit_code = 1; diff --git a/cpp/gen/ws_gen.cpp b/cpp/gen/ws_gen.cpp new file mode 100644 index 00000000..c459fbdf --- /dev/null +++ b/cpp/gen/ws_gen.cpp @@ -0,0 +1,2850 @@ +// +// cpp/gen/ws_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/ws_gen.h" +#include "include/gen/ws_gen.inl.h" +#include "include/gen/ams_gen.h" +#include "include/gen/ams_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude +namespace ws { // gen:ns_print_proto + // func:ws.Frame.fin.ReadStrptrMaybe + inline static bool fin_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame.rsv1.ReadStrptrMaybe + inline static bool rsv1_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame.rsv2.ReadStrptrMaybe + inline static bool rsv2_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame.rsv3.ReadStrptrMaybe + inline static bool rsv3_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame.opcode.ReadStrptrMaybe + inline static bool opcode_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame.mask.ReadStrptrMaybe + inline static bool mask_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame.payload_len.ReadStrptrMaybe + inline static bool payload_len_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame16.fin.ReadStrptrMaybe + inline static bool fin_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame16.rsv1.ReadStrptrMaybe + inline static bool rsv1_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame16.rsv2.ReadStrptrMaybe + inline static bool rsv2_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame16.rsv3.ReadStrptrMaybe + inline static bool rsv3_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame16.opcode.ReadStrptrMaybe + inline static bool opcode_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame16.mask.ReadStrptrMaybe + inline static bool mask_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame16.payload_len.ReadStrptrMaybe + inline static bool payload_len_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame64.fin.ReadStrptrMaybe + inline static bool fin_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame64.rsv1.ReadStrptrMaybe + inline static bool rsv1_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame64.rsv2.ReadStrptrMaybe + inline static bool rsv2_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame64.rsv3.ReadStrptrMaybe + inline static bool rsv3_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame64.opcode.ReadStrptrMaybe + inline static bool opcode_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame64.mask.ReadStrptrMaybe + inline static bool mask_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.Frame64.payload_len.ReadStrptrMaybe + inline static bool payload_len_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked.fin.ReadStrptrMaybe + inline static bool fin_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked.rsv1.ReadStrptrMaybe + inline static bool rsv1_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked.rsv2.ReadStrptrMaybe + inline static bool rsv2_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked.rsv3.ReadStrptrMaybe + inline static bool rsv3_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked.opcode.ReadStrptrMaybe + inline static bool opcode_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked.mask.ReadStrptrMaybe + inline static bool mask_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked.payload_len.ReadStrptrMaybe + inline static bool payload_len_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked16.fin.ReadStrptrMaybe + inline static bool fin_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked16.rsv1.ReadStrptrMaybe + inline static bool rsv1_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked16.rsv2.ReadStrptrMaybe + inline static bool rsv2_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked16.rsv3.ReadStrptrMaybe + inline static bool rsv3_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked16.opcode.ReadStrptrMaybe + inline static bool opcode_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked16.mask.ReadStrptrMaybe + inline static bool mask_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked16.payload_len.ReadStrptrMaybe + inline static bool payload_len_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked64.fin.ReadStrptrMaybe + inline static bool fin_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked64.rsv1.ReadStrptrMaybe + inline static bool rsv1_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked64.rsv2.ReadStrptrMaybe + inline static bool rsv2_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked64.rsv3.ReadStrptrMaybe + inline static bool rsv3_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked64.opcode.ReadStrptrMaybe + inline static bool opcode_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked64.mask.ReadStrptrMaybe + inline static bool mask_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws.FrameMasked64.payload_len.ReadStrptrMaybe + inline static bool payload_len_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) __attribute__((nothrow)); + // func:ws...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- ws.Side.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* ws::value_ToCstr(const ws::Side& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case ws_Side_server : ret = "server"; break; + case ws_Side_client : ret = "client"; break; + } + return ret; +} + +// --- ws.Side.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void ws::value_Print(const ws::Side& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- ws.Side.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool ws::value_SetStrptrMaybe(ws::Side& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('c','l','i','e','n','t'): { + value_SetEnum(parent,ws_Side_client); ret = true; break; + } + case LE_STR6('s','e','r','v','e','r'): { + value_SetEnum(parent,ws_Side_server); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- ws.Side.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void ws::value_SetStrptr(ws::Side& parent, algo::strptr rhs, ws_SideEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- ws.Side.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::value_ReadStrptrMaybe(ws::Side& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = char_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- ws.Side..ReadStrptrMaybe +// Read fields of ws::Side from an ascii string. +// The format of the string is the format of the ws::Side's only field +bool ws::Side_ReadStrptrMaybe(ws::Side &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- ws.Side..Print +// print string representation of ROW to string STR +// cfmt:ws.Side.String printfmt:Raw +void ws::Side_Print(ws::Side row, algo::cstring& str) { + ws::value_Print(row, str); +} + +// --- ws.StatusCode.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* ws::value_ToCstr(const ws::StatusCode& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case ws_StatusCode_Normal_closure : ret = "Normal closure"; break; + case ws_StatusCode_Going_away : ret = "Going away"; break; + case ws_StatusCode_Protocol_error : ret = "Protocol error"; break; + case ws_StatusCode_Unsupported_message_data_type: ret = "Unsupported message data type"; break; + case ws_StatusCode_No_status_code : ret = "No status code"; break; + case ws_StatusCode_Abnormal_closure: ret = "Abnormal closure"; break; + case ws_StatusCode_Invalid_message_data: ret = "Invalid message data"; break; + case ws_StatusCode_Policy_violation: ret = "Policy violation"; break; + case ws_StatusCode_Message_too_big : ret = "Message too big"; break; + case ws_StatusCode_Missing_extension: ret = "Missing extension"; break; + case ws_StatusCode_Internal_error : ret = "Internal error"; break; + case ws_StatusCode_TLS_Handshake : ret = "TLS Handshake"; break; + } + return ret; +} + +// --- ws.StatusCode.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void ws::value_Print(const ws::StatusCode& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- ws.StatusCode.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool ws::value_SetStrptrMaybe(ws::StatusCode& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 10: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('G','o','i','n','g',' ','a','w'): { + if (memcmp(rhs.elems+8,"ay",2)==0) { value_SetEnum(parent,ws_StatusCode_Going_away); ret = true; break; } + break; + } + } + break; + } + case 13: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('T','L','S',' ','H','a','n','d'): { + if (memcmp(rhs.elems+8,"shake",5)==0) { value_SetEnum(parent,ws_StatusCode_TLS_Handshake); ret = true; break; } + break; + } + } + break; + } + case 14: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('I','n','t','e','r','n','a','l'): { + if (memcmp(rhs.elems+8," error",6)==0) { value_SetEnum(parent,ws_StatusCode_Internal_error); ret = true; break; } + break; + } + case LE_STR8('N','o',' ','s','t','a','t','u'): { + if (memcmp(rhs.elems+8,"s code",6)==0) { value_SetEnum(parent,ws_StatusCode_No_status_code); ret = true; break; } + break; + } + case LE_STR8('N','o','r','m','a','l',' ','c'): { + if (memcmp(rhs.elems+8,"losure",6)==0) { value_SetEnum(parent,ws_StatusCode_Normal_closure); ret = true; break; } + break; + } + case LE_STR8('P','r','o','t','o','c','o','l'): { + if (memcmp(rhs.elems+8," error",6)==0) { value_SetEnum(parent,ws_StatusCode_Protocol_error); ret = true; break; } + break; + } + } + break; + } + case 15: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('M','e','s','s','a','g','e',' '): { + if (memcmp(rhs.elems+8,"too big",7)==0) { value_SetEnum(parent,ws_StatusCode_Message_too_big); ret = true; break; } + break; + } + } + break; + } + case 16: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('A','b','n','o','r','m','a','l'): { + if (memcmp(rhs.elems+8," closure",8)==0) { value_SetEnum(parent,ws_StatusCode_Abnormal_closure); ret = true; break; } + break; + } + case LE_STR8('P','o','l','i','c','y',' ','v'): { + if (memcmp(rhs.elems+8,"iolation",8)==0) { value_SetEnum(parent,ws_StatusCode_Policy_violation); ret = true; break; } + break; + } + } + break; + } + case 17: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('M','i','s','s','i','n','g',' '): { + if (memcmp(rhs.elems+8,"extension",9)==0) { value_SetEnum(parent,ws_StatusCode_Missing_extension); ret = true; break; } + break; + } + } + break; + } + case 20: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('I','n','v','a','l','i','d',' '): { + if (memcmp(rhs.elems+8,"message data",12)==0) { value_SetEnum(parent,ws_StatusCode_Invalid_message_data); ret = true; break; } + break; + } + } + break; + } + case 29: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('U','n','s','u','p','p','o','r'): { + if (memcmp(rhs.elems+8,"ted message data type",21)==0) { value_SetEnum(parent,ws_StatusCode_Unsupported_message_data_type); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- ws.StatusCode.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void ws::value_SetStrptr(ws::StatusCode& parent, algo::strptr rhs, ws_StatusCodeEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- ws.StatusCode.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::value_ReadStrptrMaybe(ws::StatusCode& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u16_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- ws.StatusCode..ReadStrptrMaybe +// Read fields of ws::StatusCode from an ascii string. +// The format of the string is the format of the ws::StatusCode's only field +bool ws::StatusCode_ReadStrptrMaybe(ws::StatusCode &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- ws.StatusCode..Print +// print string representation of ROW to string STR +// cfmt:ws.StatusCode.String printfmt:Raw +void ws::StatusCode_Print(ws::StatusCode row, algo::cstring& str) { + ws::value_Print(row, str); +} + +// --- ws.CloseMsg.base.CopyOut +// Copy fields out of row +void ws::parent_CopyOut(ws::CloseMsg &row, ams::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter +} + +// --- ws.CloseMsg.reason.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ws::reason_Getary(ws::CloseMsg& parent) { + return algo::aryptr(reason_Addr(parent), reason_N(parent)); +} + +// --- ws.CloseMsg.reason.Addr +char* ws::reason_Addr(ws::CloseMsg& parent) { + return (char*)((u8*)&parent + sizeof(ws::CloseMsg)); // address of varlen portion +} + +// --- ws.CloseMsg.reason.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::reason_ReadStrptrMaybe(ws::CloseMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- ws.CloseMsg.reason.Print +// Convert reason to a string. +// Array is printed as a regular string. +void ws::reason_Print(ws::CloseMsg& parent, algo::cstring &rhs) { + rhs << reason_Getary(parent); +} + +// --- ws.CloseMsg..ReadFieldMaybe +bool ws::CloseMsg_ReadFieldMaybe(ws::CloseMsg& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ws::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case ws_FieldId_base: { + retval = false; + } break; + case ws_FieldId_type: { + retval = false; + } break; + case ws_FieldId_length: { + retval = false; + } break; + case ws_FieldId_conn: { + retval = algo::RspaceStr50_ReadStrptrMaybe(parent.conn, strval); + } break; + case ws_FieldId_side: { + retval = ws::Side_ReadStrptrMaybe(parent.side, strval); + } break; + case ws_FieldId_code: { + retval = ws::StatusCode_ReadStrptrMaybe(parent.code, strval); + } break; + case ws_FieldId_reason: { + retval = reason_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ws.CloseMsg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::CloseMsg from an ascii string. +// The format of the string is an ssim Tuple +bool ws::CloseMsg_ReadStrptrMaybe(ws::CloseMsg &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "ws.CloseMsg"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && CloseMsg_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- ws.CloseMsg..Print +// print string representation of ROW to string STR +// cfmt:ws.CloseMsg.String printfmt:Tuple +void ws::CloseMsg_Print(ws::CloseMsg& row, algo::cstring& str) { + algo::tempstr temp; + str << "ws.CloseMsg"; + + algo::RspaceStr50_Print(row.conn, temp); + PrintAttrSpaceReset(str,"conn", temp); + + ws::Side_Print(row.side, temp); + PrintAttrSpaceReset(str,"side", temp); + + ws::StatusCode_Print(row.code, temp); + PrintAttrSpaceReset(str,"code", temp); + + ws::reason_Print(row, temp); + PrintAttrSpaceReset(str,"reason", temp); +} + +// --- ws.ConnectMsg.base.CopyOut +// Copy fields out of row +void ws::parent_CopyOut(ws::ConnectMsg &row, ams::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter +} + +// --- ws.ConnectMsg..ReadFieldMaybe +bool ws::ConnectMsg_ReadFieldMaybe(ws::ConnectMsg& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ws::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case ws_FieldId_base: { + retval = false; + } break; + case ws_FieldId_type: { + retval = false; + } break; + case ws_FieldId_length: { + retval = false; + } break; + case ws_FieldId_conn: { + retval = algo::RspaceStr50_ReadStrptrMaybe(parent.conn, strval); + } break; + case ws_FieldId_side: { + retval = ws::Side_ReadStrptrMaybe(parent.side, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ws.ConnectMsg..ReadStrptrMaybe +// Read fields of ws::ConnectMsg from an ascii string. +// The format of the string is an ssim Tuple +bool ws::ConnectMsg_ReadStrptrMaybe(ws::ConnectMsg &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "ws.ConnectMsg"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && ConnectMsg_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- ws.ConnectMsg..Print +// print string representation of ROW to string STR +// cfmt:ws.ConnectMsg.String printfmt:Tuple +void ws::ConnectMsg_Print(ws::ConnectMsg& row, algo::cstring& str) { + algo::tempstr temp; + str << "ws.ConnectMsg"; + + algo::RspaceStr50_Print(row.conn, temp); + PrintAttrSpaceReset(str,"conn", temp); + + ws::Side_Print(row.side, temp); + PrintAttrSpaceReset(str,"side", temp); +} + +// --- ws.Opcode.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* ws::value_ToCstr(const ws::Opcode& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case ws_Opcode_cont : ret = "cont"; break; + case ws_Opcode_text : ret = "text"; break; + case ws_Opcode_binary : ret = "binary"; break; + case ws_Opcode_close : ret = "close"; break; + case ws_Opcode_ping : ret = "ping"; break; + case ws_Opcode_pong : ret = "pong"; break; + } + return ret; +} + +// --- ws.Opcode.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void ws::value_Print(const ws::Opcode& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- ws.Opcode.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool ws::value_SetStrptrMaybe(ws::Opcode& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('c','o','n','t'): { + value_SetEnum(parent,ws_Opcode_cont); ret = true; break; + } + case LE_STR4('p','i','n','g'): { + value_SetEnum(parent,ws_Opcode_ping); ret = true; break; + } + case LE_STR4('p','o','n','g'): { + value_SetEnum(parent,ws_Opcode_pong); ret = true; break; + } + case LE_STR4('t','e','x','t'): { + value_SetEnum(parent,ws_Opcode_text); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('c','l','o','s','e'): { + value_SetEnum(parent,ws_Opcode_close); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('b','i','n','a','r','y'): { + value_SetEnum(parent,ws_Opcode_binary); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- ws.Opcode.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void ws::value_SetStrptr(ws::Opcode& parent, algo::strptr rhs, ws_OpcodeEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- ws.Opcode.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::value_ReadStrptrMaybe(ws::Opcode& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- ws.Opcode..ReadStrptrMaybe +// Read fields of ws::Opcode from an ascii string. +// The format of the string is the format of the ws::Opcode's only field +bool ws::Opcode_ReadStrptrMaybe(ws::Opcode &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- ws.Opcode..Print +// print string representation of ROW to string STR +// cfmt:ws.Opcode.String printfmt:Raw +void ws::Opcode_Print(ws::Opcode row, algo::cstring& str) { + ws::value_Print(row, str); +} + +// --- ws.DataMsg.base.CopyOut +// Copy fields out of row +void ws::parent_CopyOut(ws::DataMsg &row, ams::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter +} + +// --- ws.DataMsg.data.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ws::data_Getary(ws::DataMsg& parent) { + return algo::aryptr(data_Addr(parent), data_N(parent)); +} + +// --- ws.DataMsg.data.Addr +char* ws::data_Addr(ws::DataMsg& parent) { + return (char*)((u8*)&parent + sizeof(ws::DataMsg)); // address of varlen portion +} + +// --- ws.DataMsg.data.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::data_ReadStrptrMaybe(ws::DataMsg& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- ws.DataMsg.data.Print +// Convert data to a string. +// Array is printed as a regular string. +void ws::data_Print(ws::DataMsg& parent, algo::cstring &rhs) { + rhs << data_Getary(parent); +} + +// --- ws.DataMsg..ReadFieldMaybe +bool ws::DataMsg_ReadFieldMaybe(ws::DataMsg& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ws::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case ws_FieldId_base: { + retval = false; + } break; + case ws_FieldId_type: { + retval = false; + } break; + case ws_FieldId_length: { + retval = false; + } break; + case ws_FieldId_conn: { + retval = algo::RspaceStr50_ReadStrptrMaybe(parent.conn, strval); + } break; + case ws_FieldId_side: { + retval = ws::Side_ReadStrptrMaybe(parent.side, strval); + } break; + case ws_FieldId_opcode: { + retval = ws::Opcode_ReadStrptrMaybe(parent.opcode, strval); + } break; + case ws_FieldId_data: { + retval = data_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ws.DataMsg..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::DataMsg from an ascii string. +// The format of the string is an ssim Tuple +bool ws::DataMsg_ReadStrptrMaybe(ws::DataMsg &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "ws.DataMsg"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && DataMsg_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- ws.DataMsg..Print +// print string representation of ROW to string STR +// cfmt:ws.DataMsg.String printfmt:Tuple +void ws::DataMsg_Print(ws::DataMsg& row, algo::cstring& str) { + algo::tempstr temp; + str << "ws.DataMsg"; + + algo::RspaceStr50_Print(row.conn, temp); + PrintAttrSpaceReset(str,"conn", temp); + + ws::Side_Print(row.side, temp); + PrintAttrSpaceReset(str,"side", temp); + + ws::Opcode_Print(row.opcode, temp); + PrintAttrSpaceReset(str,"opcode", temp); + + ws::data_Print(row, temp); + PrintAttrSpaceReset(str,"data", temp); +} + +// --- ws.FieldId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* ws::value_ToCstr(const ws::FieldId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case ws_FieldId_base : ret = "base"; break; + case ws_FieldId_type : ret = "type"; break; + case ws_FieldId_length : ret = "length"; break; + case ws_FieldId_conn : ret = "conn"; break; + case ws_FieldId_side : ret = "side"; break; + case ws_FieldId_code : ret = "code"; break; + case ws_FieldId_reason : ret = "reason"; break; + case ws_FieldId_opcode : ret = "opcode"; break; + case ws_FieldId_data : ret = "data"; break; + case ws_FieldId_byte0 : ret = "byte0"; break; + case ws_FieldId_byte1 : ret = "byte1"; break; + case ws_FieldId_fin : ret = "fin"; break; + case ws_FieldId_rsv1 : ret = "rsv1"; break; + case ws_FieldId_rsv2 : ret = "rsv2"; break; + case ws_FieldId_rsv3 : ret = "rsv3"; break; + case ws_FieldId_mask : ret = "mask"; break; + case ws_FieldId_payload_len : ret = "payload_len"; break; + case ws_FieldId_payload : ret = "payload"; break; + case ws_FieldId_ext_payload_len : ret = "ext_payload_len"; break; + case ws_FieldId_masking_key : ret = "masking_key"; break; + case ws_FieldId_value : ret = "value"; break; + case ws_FieldId_server : ret = "server"; break; + } + return ret; +} + +// --- ws.FieldId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void ws::value_Print(const ws::FieldId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- ws.FieldId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool ws::value_SetStrptrMaybe(ws::FieldId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('f','i','n'): { + value_SetEnum(parent,ws_FieldId_fin); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('b','a','s','e'): { + value_SetEnum(parent,ws_FieldId_base); ret = true; break; + } + case LE_STR4('c','o','d','e'): { + value_SetEnum(parent,ws_FieldId_code); ret = true; break; + } + case LE_STR4('c','o','n','n'): { + value_SetEnum(parent,ws_FieldId_conn); ret = true; break; + } + case LE_STR4('d','a','t','a'): { + value_SetEnum(parent,ws_FieldId_data); ret = true; break; + } + case LE_STR4('m','a','s','k'): { + value_SetEnum(parent,ws_FieldId_mask); ret = true; break; + } + case LE_STR4('r','s','v','1'): { + value_SetEnum(parent,ws_FieldId_rsv1); ret = true; break; + } + case LE_STR4('r','s','v','2'): { + value_SetEnum(parent,ws_FieldId_rsv2); ret = true; break; + } + case LE_STR4('r','s','v','3'): { + value_SetEnum(parent,ws_FieldId_rsv3); ret = true; break; + } + case LE_STR4('s','i','d','e'): { + value_SetEnum(parent,ws_FieldId_side); ret = true; break; + } + case LE_STR4('t','y','p','e'): { + value_SetEnum(parent,ws_FieldId_type); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('b','y','t','e','0'): { + value_SetEnum(parent,ws_FieldId_byte0); ret = true; break; + } + case LE_STR5('b','y','t','e','1'): { + value_SetEnum(parent,ws_FieldId_byte1); ret = true; break; + } + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,ws_FieldId_value); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('l','e','n','g','t','h'): { + value_SetEnum(parent,ws_FieldId_length); ret = true; break; + } + case LE_STR6('o','p','c','o','d','e'): { + value_SetEnum(parent,ws_FieldId_opcode); ret = true; break; + } + case LE_STR6('r','e','a','s','o','n'): { + value_SetEnum(parent,ws_FieldId_reason); ret = true; break; + } + case LE_STR6('s','e','r','v','e','r'): { + value_SetEnum(parent,ws_FieldId_server); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('p','a','y','l','o','a','d'): { + value_SetEnum(parent,ws_FieldId_payload); ret = true; break; + } + } + break; + } + case 11: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('m','a','s','k','i','n','g','_'): { + if (memcmp(rhs.elems+8,"key",3)==0) { value_SetEnum(parent,ws_FieldId_masking_key); ret = true; break; } + break; + } + case LE_STR8('p','a','y','l','o','a','d','_'): { + if (memcmp(rhs.elems+8,"len",3)==0) { value_SetEnum(parent,ws_FieldId_payload_len); ret = true; break; } + break; + } + } + break; + } + case 15: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('e','x','t','_','p','a','y','l'): { + if (memcmp(rhs.elems+8,"oad_len",7)==0) { value_SetEnum(parent,ws_FieldId_ext_payload_len); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- ws.FieldId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void ws::value_SetStrptr(ws::FieldId& parent, algo::strptr rhs, ws_FieldIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- ws.FieldId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::value_ReadStrptrMaybe(ws::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- ws.FieldId..ReadStrptrMaybe +// Read fields of ws::FieldId from an ascii string. +// The format of the string is the format of the ws::FieldId's only field +bool ws::FieldId_ReadStrptrMaybe(ws::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- ws.FieldId..Print +// print string representation of ROW to string STR +// cfmt:ws.FieldId.String printfmt:Raw +void ws::FieldId_Print(ws::FieldId& row, algo::cstring& str) { + ws::value_Print(row, str); +} + +// --- ws.Frame.base.CopyOut +// Copy fields out of row +void ws::parent_CopyOut(ws::Frame &row, ws::FrameHeader &out) { + out.byte0 = row.byte0; + // byte1: field value is computed + // fin: unknown field type (Bitfld), skipped + // rsv1: unknown field type (Bitfld), skipped + // rsv2: unknown field type (Bitfld), skipped + // rsv3: unknown field type (Bitfld), skipped + // opcode: unknown field type (Bitfld), skipped + // mask: unknown field type (Bitfld), skipped + // payload_len: unknown field type (Bitfld), skipped +} + +// --- ws.Frame.fin.ReadStrptrMaybe +inline static bool ws::fin_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) { + bool retval = true; + bool fin_tmp; + retval = bool_ReadStrptrMaybe(fin_tmp, in_str); + if (retval) { + fin_Set(parent, fin_tmp); + } + return retval; +} + +// --- ws.Frame.rsv1.ReadStrptrMaybe +inline static bool ws::rsv1_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) { + bool retval = true; + bool rsv1_tmp; + retval = bool_ReadStrptrMaybe(rsv1_tmp, in_str); + if (retval) { + rsv1_Set(parent, rsv1_tmp); + } + return retval; +} + +// --- ws.Frame.rsv2.ReadStrptrMaybe +inline static bool ws::rsv2_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) { + bool retval = true; + bool rsv2_tmp; + retval = bool_ReadStrptrMaybe(rsv2_tmp, in_str); + if (retval) { + rsv2_Set(parent, rsv2_tmp); + } + return retval; +} + +// --- ws.Frame.rsv3.ReadStrptrMaybe +inline static bool ws::rsv3_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) { + bool retval = true; + bool rsv3_tmp; + retval = bool_ReadStrptrMaybe(rsv3_tmp, in_str); + if (retval) { + rsv3_Set(parent, rsv3_tmp); + } + return retval; +} + +// --- ws.Frame.opcode.ReadStrptrMaybe +inline static bool ws::opcode_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) { + bool retval = true; + ws::Opcode opcode_tmp; + retval = ws::Opcode_ReadStrptrMaybe(opcode_tmp, in_str); + if (retval) { + opcode_Set(parent, opcode_tmp); + } + return retval; +} + +// --- ws.Frame.mask.ReadStrptrMaybe +inline static bool ws::mask_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) { + bool retval = true; + bool mask_tmp; + retval = bool_ReadStrptrMaybe(mask_tmp, in_str); + if (retval) { + mask_Set(parent, mask_tmp); + } + return retval; +} + +// --- ws.Frame.payload_len.ReadStrptrMaybe +inline static bool ws::payload_len_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) { + bool retval = true; + u8 payload_len_tmp; + retval = u8_ReadStrptrMaybe(payload_len_tmp, in_str); + if (retval) { + payload_len_Set(parent, payload_len_tmp); + } + return retval; +} + +// --- ws.Frame.payload.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ws::payload_Getary(ws::Frame& parent) { + return algo::aryptr(payload_Addr(parent), payload_N(parent)); +} + +// --- ws.Frame.payload.Addr +char* ws::payload_Addr(ws::Frame& parent) { + return (char*)((u8*)&parent + sizeof(ws::Frame)); // address of varlen portion +} + +// --- ws.Frame.payload.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::payload_ReadStrptrMaybe(ws::Frame& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- ws.Frame.payload.Print +// Convert payload to a string. +// Array is printed as a regular string. +void ws::payload_Print(ws::Frame& parent, algo::cstring &rhs) { + rhs << payload_Getary(parent); +} + +// --- ws.Frame..ReadFieldMaybe +bool ws::Frame_ReadFieldMaybe(ws::Frame& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ws::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case ws_FieldId_base: { + retval = false; + } break; + case ws_FieldId_byte0: { + retval = u8_ReadStrptrMaybe(parent.byte0, strval); + } break; + case ws_FieldId_byte1: { + retval = false; + } break; + case ws_FieldId_fin: { + retval = fin_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv1: { + retval = rsv1_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv2: { + retval = rsv2_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv3: { + retval = rsv3_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_opcode: { + retval = opcode_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_mask: { + retval = mask_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_payload_len: { + retval = payload_len_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_payload: { + retval = payload_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ws.Frame..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::Frame from an ascii string. +// The format of the string is an ssim Tuple +bool ws::Frame_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "ws.Frame"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Frame_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- ws.Frame..Init +// Set all fields to initial values. +void ws::Frame_Init(ws::Frame& parent) { + parent.byte0 = u8(0); + parent.byte1 = u8(0); +} + +// --- ws.Frame..Print +// print string representation of ROW to string STR +// cfmt:ws.Frame.String printfmt:Tuple +void ws::Frame_Print(ws::Frame& row, algo::cstring& str) { + algo::tempstr temp; + str << "ws.Frame"; + + bool_Print(fin_Get(row), temp); + PrintAttrSpaceReset(str,"fin", temp); + + bool_Print(rsv1_Get(row), temp); + PrintAttrSpaceReset(str,"rsv1", temp); + + bool_Print(rsv2_Get(row), temp); + PrintAttrSpaceReset(str,"rsv2", temp); + + bool_Print(rsv3_Get(row), temp); + PrintAttrSpaceReset(str,"rsv3", temp); + + ws::Opcode_Print(opcode_Get(row), temp); + PrintAttrSpaceReset(str,"opcode", temp); + + bool_Print(mask_Get(row), temp); + PrintAttrSpaceReset(str,"mask", temp); + + u8_Print(payload_len_Get(row), temp); + PrintAttrSpaceReset(str,"payload_len", temp); + + ws::payload_Print(row, temp); + PrintAttrSpaceReset(str,"payload", temp); +} + +// --- ws.Frame16.base.CopyOut +// Copy fields out of row +void ws::parent_CopyOut(ws::Frame16 &row, ws::FrameHeader &out) { + out.byte0 = row.byte0; + // byte1: field value is computed + // fin: unknown field type (Bitfld), skipped + // rsv1: unknown field type (Bitfld), skipped + // rsv2: unknown field type (Bitfld), skipped + // rsv3: unknown field type (Bitfld), skipped + // opcode: unknown field type (Bitfld), skipped + // mask: unknown field type (Bitfld), skipped + // payload_len: unknown field type (Bitfld), skipped +} + +// --- ws.Frame16.fin.ReadStrptrMaybe +inline static bool ws::fin_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) { + bool retval = true; + bool fin_tmp; + retval = bool_ReadStrptrMaybe(fin_tmp, in_str); + if (retval) { + fin_Set(parent, fin_tmp); + } + return retval; +} + +// --- ws.Frame16.rsv1.ReadStrptrMaybe +inline static bool ws::rsv1_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv1_tmp; + retval = bool_ReadStrptrMaybe(rsv1_tmp, in_str); + if (retval) { + rsv1_Set(parent, rsv1_tmp); + } + return retval; +} + +// --- ws.Frame16.rsv2.ReadStrptrMaybe +inline static bool ws::rsv2_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv2_tmp; + retval = bool_ReadStrptrMaybe(rsv2_tmp, in_str); + if (retval) { + rsv2_Set(parent, rsv2_tmp); + } + return retval; +} + +// --- ws.Frame16.rsv3.ReadStrptrMaybe +inline static bool ws::rsv3_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv3_tmp; + retval = bool_ReadStrptrMaybe(rsv3_tmp, in_str); + if (retval) { + rsv3_Set(parent, rsv3_tmp); + } + return retval; +} + +// --- ws.Frame16.opcode.ReadStrptrMaybe +inline static bool ws::opcode_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) { + bool retval = true; + ws::Opcode opcode_tmp; + retval = ws::Opcode_ReadStrptrMaybe(opcode_tmp, in_str); + if (retval) { + opcode_Set(parent, opcode_tmp); + } + return retval; +} + +// --- ws.Frame16.mask.ReadStrptrMaybe +inline static bool ws::mask_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) { + bool retval = true; + bool mask_tmp; + retval = bool_ReadStrptrMaybe(mask_tmp, in_str); + if (retval) { + mask_Set(parent, mask_tmp); + } + return retval; +} + +// --- ws.Frame16.payload_len.ReadStrptrMaybe +inline static bool ws::payload_len_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) { + bool retval = true; + u8 payload_len_tmp; + retval = u8_ReadStrptrMaybe(payload_len_tmp, in_str); + if (retval) { + payload_len_Set(parent, payload_len_tmp); + } + return retval; +} + +// --- ws.Frame16.payload.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ws::payload_Getary(ws::Frame16& parent) { + return algo::aryptr(payload_Addr(parent), payload_N(parent)); +} + +// --- ws.Frame16.payload.Addr +char* ws::payload_Addr(ws::Frame16& parent) { + return (char*)((u8*)&parent + sizeof(ws::Frame16)); // address of varlen portion +} + +// --- ws.Frame16.payload.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::payload_ReadStrptrMaybe(ws::Frame16& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- ws.Frame16.payload.Print +// Convert payload to a string. +// Array is printed as a regular string. +void ws::payload_Print(ws::Frame16& parent, algo::cstring &rhs) { + rhs << payload_Getary(parent); +} + +// --- ws.Frame16..ReadFieldMaybe +bool ws::Frame16_ReadFieldMaybe(ws::Frame16& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ws::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case ws_FieldId_base: { + retval = false; + } break; + case ws_FieldId_byte0: { + retval = u8_ReadStrptrMaybe(parent.byte0, strval); + } break; + case ws_FieldId_byte1: { + retval = false; + } break; + case ws_FieldId_fin: { + retval = fin_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv1: { + retval = rsv1_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv2: { + retval = rsv2_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv3: { + retval = rsv3_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_opcode: { + retval = opcode_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_mask: { + retval = mask_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_payload_len: { + retval = payload_len_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_ext_payload_len: { + retval = false; + } break; + case ws_FieldId_payload: { + retval = payload_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ws.Frame16..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::Frame16 from an ascii string. +// The format of the string is an ssim Tuple +bool ws::Frame16_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "ws.Frame16"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Frame16_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- ws.Frame16..Init +// Set all fields to initial values. +void ws::Frame16_Init(ws::Frame16& parent) { + parent.byte0 = u8(0); + parent.byte1 = u8(126); + parent.ext_payload_len_be = htobe16(ssizeof(parent) + (-4)); // write big-endian value to memory +} + +// --- ws.Frame16..Print +// print string representation of ROW to string STR +// cfmt:ws.Frame16.String printfmt:Tuple +void ws::Frame16_Print(ws::Frame16& row, algo::cstring& str) { + algo::tempstr temp; + str << "ws.Frame16"; + + bool_Print(fin_Get(row), temp); + PrintAttrSpaceReset(str,"fin", temp); + + bool_Print(rsv1_Get(row), temp); + PrintAttrSpaceReset(str,"rsv1", temp); + + bool_Print(rsv2_Get(row), temp); + PrintAttrSpaceReset(str,"rsv2", temp); + + bool_Print(rsv3_Get(row), temp); + PrintAttrSpaceReset(str,"rsv3", temp); + + ws::Opcode_Print(opcode_Get(row), temp); + PrintAttrSpaceReset(str,"opcode", temp); + + bool_Print(mask_Get(row), temp); + PrintAttrSpaceReset(str,"mask", temp); + + u8_Print(payload_len_Get(row), temp); + PrintAttrSpaceReset(str,"payload_len", temp); + + ws::payload_Print(row, temp); + PrintAttrSpaceReset(str,"payload", temp); +} + +// --- ws.Frame64.base.CopyOut +// Copy fields out of row +void ws::parent_CopyOut(ws::Frame64 &row, ws::FrameHeader &out) { + out.byte0 = row.byte0; + // byte1: field value is computed + // fin: unknown field type (Bitfld), skipped + // rsv1: unknown field type (Bitfld), skipped + // rsv2: unknown field type (Bitfld), skipped + // rsv3: unknown field type (Bitfld), skipped + // opcode: unknown field type (Bitfld), skipped + // mask: unknown field type (Bitfld), skipped + // payload_len: unknown field type (Bitfld), skipped +} + +// --- ws.Frame64.fin.ReadStrptrMaybe +inline static bool ws::fin_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) { + bool retval = true; + bool fin_tmp; + retval = bool_ReadStrptrMaybe(fin_tmp, in_str); + if (retval) { + fin_Set(parent, fin_tmp); + } + return retval; +} + +// --- ws.Frame64.rsv1.ReadStrptrMaybe +inline static bool ws::rsv1_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv1_tmp; + retval = bool_ReadStrptrMaybe(rsv1_tmp, in_str); + if (retval) { + rsv1_Set(parent, rsv1_tmp); + } + return retval; +} + +// --- ws.Frame64.rsv2.ReadStrptrMaybe +inline static bool ws::rsv2_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv2_tmp; + retval = bool_ReadStrptrMaybe(rsv2_tmp, in_str); + if (retval) { + rsv2_Set(parent, rsv2_tmp); + } + return retval; +} + +// --- ws.Frame64.rsv3.ReadStrptrMaybe +inline static bool ws::rsv3_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv3_tmp; + retval = bool_ReadStrptrMaybe(rsv3_tmp, in_str); + if (retval) { + rsv3_Set(parent, rsv3_tmp); + } + return retval; +} + +// --- ws.Frame64.opcode.ReadStrptrMaybe +inline static bool ws::opcode_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) { + bool retval = true; + ws::Opcode opcode_tmp; + retval = ws::Opcode_ReadStrptrMaybe(opcode_tmp, in_str); + if (retval) { + opcode_Set(parent, opcode_tmp); + } + return retval; +} + +// --- ws.Frame64.mask.ReadStrptrMaybe +inline static bool ws::mask_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) { + bool retval = true; + bool mask_tmp; + retval = bool_ReadStrptrMaybe(mask_tmp, in_str); + if (retval) { + mask_Set(parent, mask_tmp); + } + return retval; +} + +// --- ws.Frame64.payload_len.ReadStrptrMaybe +inline static bool ws::payload_len_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) { + bool retval = true; + u8 payload_len_tmp; + retval = u8_ReadStrptrMaybe(payload_len_tmp, in_str); + if (retval) { + payload_len_Set(parent, payload_len_tmp); + } + return retval; +} + +// --- ws.Frame64.payload.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ws::payload_Getary(ws::Frame64& parent) { + return algo::aryptr(payload_Addr(parent), payload_N(parent)); +} + +// --- ws.Frame64.payload.Addr +char* ws::payload_Addr(ws::Frame64& parent) { + return (char*)((u8*)&parent + sizeof(ws::Frame64)); // address of varlen portion +} + +// --- ws.Frame64.payload.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::payload_ReadStrptrMaybe(ws::Frame64& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- ws.Frame64.payload.Print +// Convert payload to a string. +// Array is printed as a regular string. +void ws::payload_Print(ws::Frame64& parent, algo::cstring &rhs) { + rhs << payload_Getary(parent); +} + +// --- ws.Frame64..ReadFieldMaybe +bool ws::Frame64_ReadFieldMaybe(ws::Frame64& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ws::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case ws_FieldId_base: { + retval = false; + } break; + case ws_FieldId_byte0: { + retval = u8_ReadStrptrMaybe(parent.byte0, strval); + } break; + case ws_FieldId_byte1: { + retval = false; + } break; + case ws_FieldId_fin: { + retval = fin_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv1: { + retval = rsv1_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv2: { + retval = rsv2_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv3: { + retval = rsv3_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_opcode: { + retval = opcode_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_mask: { + retval = mask_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_payload_len: { + retval = payload_len_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_ext_payload_len: { + retval = false; + } break; + case ws_FieldId_payload: { + retval = payload_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ws.Frame64..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::Frame64 from an ascii string. +// The format of the string is an ssim Tuple +bool ws::Frame64_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "ws.Frame64"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Frame64_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- ws.Frame64..Init +// Set all fields to initial values. +void ws::Frame64_Init(ws::Frame64& parent) { + parent.byte0 = u8(0); + parent.byte1 = u8(127); + parent.ext_payload_len_be = htobe64(ssizeof(parent) + (-10)); // write big-endian value to memory +} + +// --- ws.Frame64..Print +// print string representation of ROW to string STR +// cfmt:ws.Frame64.String printfmt:Tuple +void ws::Frame64_Print(ws::Frame64& row, algo::cstring& str) { + algo::tempstr temp; + str << "ws.Frame64"; + + bool_Print(fin_Get(row), temp); + PrintAttrSpaceReset(str,"fin", temp); + + bool_Print(rsv1_Get(row), temp); + PrintAttrSpaceReset(str,"rsv1", temp); + + bool_Print(rsv2_Get(row), temp); + PrintAttrSpaceReset(str,"rsv2", temp); + + bool_Print(rsv3_Get(row), temp); + PrintAttrSpaceReset(str,"rsv3", temp); + + ws::Opcode_Print(opcode_Get(row), temp); + PrintAttrSpaceReset(str,"opcode", temp); + + bool_Print(mask_Get(row), temp); + PrintAttrSpaceReset(str,"mask", temp); + + u8_Print(payload_len_Get(row), temp); + PrintAttrSpaceReset(str,"payload_len", temp); + + ws::payload_Print(row, temp); + PrintAttrSpaceReset(str,"payload", temp); +} + +// --- ws.FrameHeaderMsgsCase.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* ws::value_ToCstr(const ws::FrameHeaderMsgsCase& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case ws_FrameHeaderMsgsCase_ws_Frame16: ret = "ws.Frame16"; break; + case ws_FrameHeaderMsgsCase_ws_Frame64: ret = "ws.Frame64"; break; + case ws_FrameHeaderMsgsCase_ws_FrameMasked16: ret = "ws.FrameMasked16"; break; + case ws_FrameHeaderMsgsCase_ws_FrameMasked64: ret = "ws.FrameMasked64"; break; + } + return ret; +} + +// --- ws.FrameHeaderMsgsCase.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void ws::value_Print(const ws::FrameHeaderMsgsCase& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- ws.FrameHeaderMsgsCase.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool ws::value_SetStrptrMaybe(ws::FrameHeaderMsgsCase& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 10: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('w','s','.','F','r','a','m','e'): { + if (memcmp(rhs.elems+8,"16",2)==0) { value_SetEnum(parent,ws_FrameHeaderMsgsCase_ws_Frame16); ret = true; break; } + if (memcmp(rhs.elems+8,"64",2)==0) { value_SetEnum(parent,ws_FrameHeaderMsgsCase_ws_Frame64); ret = true; break; } + break; + } + } + break; + } + case 16: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('w','s','.','F','r','a','m','e'): { + if (memcmp(rhs.elems+8,"Masked16",8)==0) { value_SetEnum(parent,ws_FrameHeaderMsgsCase_ws_FrameMasked16); ret = true; break; } + if (memcmp(rhs.elems+8,"Masked64",8)==0) { value_SetEnum(parent,ws_FrameHeaderMsgsCase_ws_FrameMasked64); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- ws.FrameHeaderMsgsCase.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void ws::value_SetStrptr(ws::FrameHeaderMsgsCase& parent, algo::strptr rhs, ws_FrameHeaderMsgsCaseEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- ws.FrameHeaderMsgsCase.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::value_ReadStrptrMaybe(ws::FrameHeaderMsgsCase& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- ws.FrameHeaderMsgsCase..ReadStrptrMaybe +// Read fields of ws::FrameHeaderMsgsCase from an ascii string. +// The format of the string is the format of the ws::FrameHeaderMsgsCase's only field +bool ws::FrameHeaderMsgsCase_ReadStrptrMaybe(ws::FrameHeaderMsgsCase &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- ws.FrameMasked.base.CopyOut +// Copy fields out of row +void ws::parent_CopyOut(ws::FrameMasked &row, ws::FrameHeader &out) { + out.byte0 = row.byte0; + // byte1: field value is computed + // fin: unknown field type (Bitfld), skipped + // rsv1: unknown field type (Bitfld), skipped + // rsv2: unknown field type (Bitfld), skipped + // rsv3: unknown field type (Bitfld), skipped + // opcode: unknown field type (Bitfld), skipped + // mask: unknown field type (Bitfld), skipped + // payload_len: unknown field type (Bitfld), skipped +} + +// --- ws.FrameMasked.fin.ReadStrptrMaybe +inline static bool ws::fin_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) { + bool retval = true; + bool fin_tmp; + retval = bool_ReadStrptrMaybe(fin_tmp, in_str); + if (retval) { + fin_Set(parent, fin_tmp); + } + return retval; +} + +// --- ws.FrameMasked.rsv1.ReadStrptrMaybe +inline static bool ws::rsv1_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) { + bool retval = true; + bool rsv1_tmp; + retval = bool_ReadStrptrMaybe(rsv1_tmp, in_str); + if (retval) { + rsv1_Set(parent, rsv1_tmp); + } + return retval; +} + +// --- ws.FrameMasked.rsv2.ReadStrptrMaybe +inline static bool ws::rsv2_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) { + bool retval = true; + bool rsv2_tmp; + retval = bool_ReadStrptrMaybe(rsv2_tmp, in_str); + if (retval) { + rsv2_Set(parent, rsv2_tmp); + } + return retval; +} + +// --- ws.FrameMasked.rsv3.ReadStrptrMaybe +inline static bool ws::rsv3_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) { + bool retval = true; + bool rsv3_tmp; + retval = bool_ReadStrptrMaybe(rsv3_tmp, in_str); + if (retval) { + rsv3_Set(parent, rsv3_tmp); + } + return retval; +} + +// --- ws.FrameMasked.opcode.ReadStrptrMaybe +inline static bool ws::opcode_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) { + bool retval = true; + ws::Opcode opcode_tmp; + retval = ws::Opcode_ReadStrptrMaybe(opcode_tmp, in_str); + if (retval) { + opcode_Set(parent, opcode_tmp); + } + return retval; +} + +// --- ws.FrameMasked.mask.ReadStrptrMaybe +inline static bool ws::mask_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) { + bool retval = true; + bool mask_tmp; + retval = bool_ReadStrptrMaybe(mask_tmp, in_str); + if (retval) { + mask_Set(parent, mask_tmp); + } + return retval; +} + +// --- ws.FrameMasked.payload_len.ReadStrptrMaybe +inline static bool ws::payload_len_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) { + bool retval = true; + u8 payload_len_tmp; + retval = u8_ReadStrptrMaybe(payload_len_tmp, in_str); + if (retval) { + payload_len_Set(parent, payload_len_tmp); + } + return retval; +} + +// --- ws.FrameMasked.payload.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ws::payload_Getary(ws::FrameMasked& parent) { + return algo::aryptr(payload_Addr(parent), payload_N(parent)); +} + +// --- ws.FrameMasked.payload.Addr +char* ws::payload_Addr(ws::FrameMasked& parent) { + return (char*)((u8*)&parent + sizeof(ws::FrameMasked)); // address of varlen portion +} + +// --- ws.FrameMasked.payload.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::payload_ReadStrptrMaybe(ws::FrameMasked& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- ws.FrameMasked.payload.Print +// Convert payload to a string. +// Array is printed as a regular string. +void ws::payload_Print(ws::FrameMasked& parent, algo::cstring &rhs) { + rhs << payload_Getary(parent); +} + +// --- ws.FrameMasked..ReadFieldMaybe +bool ws::FrameMasked_ReadFieldMaybe(ws::FrameMasked& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ws::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case ws_FieldId_base: { + retval = false; + } break; + case ws_FieldId_byte0: { + retval = u8_ReadStrptrMaybe(parent.byte0, strval); + } break; + case ws_FieldId_byte1: { + retval = false; + } break; + case ws_FieldId_fin: { + retval = fin_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv1: { + retval = rsv1_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv2: { + retval = rsv2_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv3: { + retval = rsv3_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_opcode: { + retval = opcode_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_mask: { + retval = mask_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_payload_len: { + retval = payload_len_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_masking_key: { + retval = u32_ReadStrptrMaybe(parent.masking_key, strval); + } break; + case ws_FieldId_payload: { + retval = payload_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ws.FrameMasked..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::FrameMasked from an ascii string. +// The format of the string is an ssim Tuple +bool ws::FrameMasked_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "ws.FrameMasked"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && FrameMasked_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- ws.FrameMasked..Init +// Set all fields to initial values. +void ws::FrameMasked_Init(ws::FrameMasked& parent) { + parent.byte0 = u8(0); + parent.byte1 = u8(0); + parent.masking_key = u32(0); +} + +// --- ws.FrameMasked..Print +// print string representation of ROW to string STR +// cfmt:ws.FrameMasked.String printfmt:Tuple +void ws::FrameMasked_Print(ws::FrameMasked& row, algo::cstring& str) { + algo::tempstr temp; + str << "ws.FrameMasked"; + + bool_Print(fin_Get(row), temp); + PrintAttrSpaceReset(str,"fin", temp); + + bool_Print(rsv1_Get(row), temp); + PrintAttrSpaceReset(str,"rsv1", temp); + + bool_Print(rsv2_Get(row), temp); + PrintAttrSpaceReset(str,"rsv2", temp); + + bool_Print(rsv3_Get(row), temp); + PrintAttrSpaceReset(str,"rsv3", temp); + + ws::Opcode_Print(opcode_Get(row), temp); + PrintAttrSpaceReset(str,"opcode", temp); + + bool_Print(mask_Get(row), temp); + PrintAttrSpaceReset(str,"mask", temp); + + u8_Print(payload_len_Get(row), temp); + PrintAttrSpaceReset(str,"payload_len", temp); + + u32_Print(row.masking_key, temp); + PrintAttrSpaceReset(str,"masking_key", temp); + + ws::payload_Print(row, temp); + PrintAttrSpaceReset(str,"payload", temp); +} + +// --- ws.FrameMasked16.base.CopyOut +// Copy fields out of row +void ws::parent_CopyOut(ws::FrameMasked16 &row, ws::FrameHeader &out) { + out.byte0 = row.byte0; + // byte1: field value is computed + // fin: unknown field type (Bitfld), skipped + // rsv1: unknown field type (Bitfld), skipped + // rsv2: unknown field type (Bitfld), skipped + // rsv3: unknown field type (Bitfld), skipped + // opcode: unknown field type (Bitfld), skipped + // mask: unknown field type (Bitfld), skipped + // payload_len: unknown field type (Bitfld), skipped +} + +// --- ws.FrameMasked16.fin.ReadStrptrMaybe +inline static bool ws::fin_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) { + bool retval = true; + bool fin_tmp; + retval = bool_ReadStrptrMaybe(fin_tmp, in_str); + if (retval) { + fin_Set(parent, fin_tmp); + } + return retval; +} + +// --- ws.FrameMasked16.rsv1.ReadStrptrMaybe +inline static bool ws::rsv1_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv1_tmp; + retval = bool_ReadStrptrMaybe(rsv1_tmp, in_str); + if (retval) { + rsv1_Set(parent, rsv1_tmp); + } + return retval; +} + +// --- ws.FrameMasked16.rsv2.ReadStrptrMaybe +inline static bool ws::rsv2_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv2_tmp; + retval = bool_ReadStrptrMaybe(rsv2_tmp, in_str); + if (retval) { + rsv2_Set(parent, rsv2_tmp); + } + return retval; +} + +// --- ws.FrameMasked16.rsv3.ReadStrptrMaybe +inline static bool ws::rsv3_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv3_tmp; + retval = bool_ReadStrptrMaybe(rsv3_tmp, in_str); + if (retval) { + rsv3_Set(parent, rsv3_tmp); + } + return retval; +} + +// --- ws.FrameMasked16.opcode.ReadStrptrMaybe +inline static bool ws::opcode_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) { + bool retval = true; + ws::Opcode opcode_tmp; + retval = ws::Opcode_ReadStrptrMaybe(opcode_tmp, in_str); + if (retval) { + opcode_Set(parent, opcode_tmp); + } + return retval; +} + +// --- ws.FrameMasked16.mask.ReadStrptrMaybe +inline static bool ws::mask_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) { + bool retval = true; + bool mask_tmp; + retval = bool_ReadStrptrMaybe(mask_tmp, in_str); + if (retval) { + mask_Set(parent, mask_tmp); + } + return retval; +} + +// --- ws.FrameMasked16.payload_len.ReadStrptrMaybe +inline static bool ws::payload_len_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) { + bool retval = true; + u8 payload_len_tmp; + retval = u8_ReadStrptrMaybe(payload_len_tmp, in_str); + if (retval) { + payload_len_Set(parent, payload_len_tmp); + } + return retval; +} + +// --- ws.FrameMasked16.payload.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ws::payload_Getary(ws::FrameMasked16& parent) { + return algo::aryptr(payload_Addr(parent), payload_N(parent)); +} + +// --- ws.FrameMasked16.payload.Addr +char* ws::payload_Addr(ws::FrameMasked16& parent) { + return (char*)((u8*)&parent + sizeof(ws::FrameMasked16)); // address of varlen portion +} + +// --- ws.FrameMasked16.payload.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::payload_ReadStrptrMaybe(ws::FrameMasked16& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- ws.FrameMasked16.payload.Print +// Convert payload to a string. +// Array is printed as a regular string. +void ws::payload_Print(ws::FrameMasked16& parent, algo::cstring &rhs) { + rhs << payload_Getary(parent); +} + +// --- ws.FrameMasked16..ReadFieldMaybe +bool ws::FrameMasked16_ReadFieldMaybe(ws::FrameMasked16& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ws::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case ws_FieldId_base: { + retval = false; + } break; + case ws_FieldId_byte0: { + retval = u8_ReadStrptrMaybe(parent.byte0, strval); + } break; + case ws_FieldId_byte1: { + retval = false; + } break; + case ws_FieldId_fin: { + retval = fin_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv1: { + retval = rsv1_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv2: { + retval = rsv2_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv3: { + retval = rsv3_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_opcode: { + retval = opcode_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_mask: { + retval = mask_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_payload_len: { + retval = payload_len_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_ext_payload_len: { + retval = false; + } break; + case ws_FieldId_masking_key: { + retval = u32_ReadStrptrMaybe(parent.masking_key, strval); + } break; + case ws_FieldId_payload: { + retval = payload_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ws.FrameMasked16..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::FrameMasked16 from an ascii string. +// The format of the string is an ssim Tuple +bool ws::FrameMasked16_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "ws.FrameMasked16"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && FrameMasked16_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- ws.FrameMasked16..Init +// Set all fields to initial values. +void ws::FrameMasked16_Init(ws::FrameMasked16& parent) { + parent.byte0 = u8(0); + parent.byte1 = u8(254); + parent.ext_payload_len_be = htobe16(ssizeof(parent) + (-8)); // write big-endian value to memory + parent.masking_key = u32(0); +} + +// --- ws.FrameMasked16..Print +// print string representation of ROW to string STR +// cfmt:ws.FrameMasked16.String printfmt:Tuple +void ws::FrameMasked16_Print(ws::FrameMasked16& row, algo::cstring& str) { + algo::tempstr temp; + str << "ws.FrameMasked16"; + + bool_Print(fin_Get(row), temp); + PrintAttrSpaceReset(str,"fin", temp); + + bool_Print(rsv1_Get(row), temp); + PrintAttrSpaceReset(str,"rsv1", temp); + + bool_Print(rsv2_Get(row), temp); + PrintAttrSpaceReset(str,"rsv2", temp); + + bool_Print(rsv3_Get(row), temp); + PrintAttrSpaceReset(str,"rsv3", temp); + + ws::Opcode_Print(opcode_Get(row), temp); + PrintAttrSpaceReset(str,"opcode", temp); + + bool_Print(mask_Get(row), temp); + PrintAttrSpaceReset(str,"mask", temp); + + u8_Print(payload_len_Get(row), temp); + PrintAttrSpaceReset(str,"payload_len", temp); + + u32_Print(row.masking_key, temp); + PrintAttrSpaceReset(str,"masking_key", temp); + + ws::payload_Print(row, temp); + PrintAttrSpaceReset(str,"payload", temp); +} + +// --- ws.FrameMasked64.base.CopyOut +// Copy fields out of row +void ws::parent_CopyOut(ws::FrameMasked64 &row, ws::FrameHeader &out) { + out.byte0 = row.byte0; + // byte1: field value is computed + // fin: unknown field type (Bitfld), skipped + // rsv1: unknown field type (Bitfld), skipped + // rsv2: unknown field type (Bitfld), skipped + // rsv3: unknown field type (Bitfld), skipped + // opcode: unknown field type (Bitfld), skipped + // mask: unknown field type (Bitfld), skipped + // payload_len: unknown field type (Bitfld), skipped +} + +// --- ws.FrameMasked64.fin.ReadStrptrMaybe +inline static bool ws::fin_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) { + bool retval = true; + bool fin_tmp; + retval = bool_ReadStrptrMaybe(fin_tmp, in_str); + if (retval) { + fin_Set(parent, fin_tmp); + } + return retval; +} + +// --- ws.FrameMasked64.rsv1.ReadStrptrMaybe +inline static bool ws::rsv1_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv1_tmp; + retval = bool_ReadStrptrMaybe(rsv1_tmp, in_str); + if (retval) { + rsv1_Set(parent, rsv1_tmp); + } + return retval; +} + +// --- ws.FrameMasked64.rsv2.ReadStrptrMaybe +inline static bool ws::rsv2_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv2_tmp; + retval = bool_ReadStrptrMaybe(rsv2_tmp, in_str); + if (retval) { + rsv2_Set(parent, rsv2_tmp); + } + return retval; +} + +// --- ws.FrameMasked64.rsv3.ReadStrptrMaybe +inline static bool ws::rsv3_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) { + bool retval = true; + bool rsv3_tmp; + retval = bool_ReadStrptrMaybe(rsv3_tmp, in_str); + if (retval) { + rsv3_Set(parent, rsv3_tmp); + } + return retval; +} + +// --- ws.FrameMasked64.opcode.ReadStrptrMaybe +inline static bool ws::opcode_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) { + bool retval = true; + ws::Opcode opcode_tmp; + retval = ws::Opcode_ReadStrptrMaybe(opcode_tmp, in_str); + if (retval) { + opcode_Set(parent, opcode_tmp); + } + return retval; +} + +// --- ws.FrameMasked64.mask.ReadStrptrMaybe +inline static bool ws::mask_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) { + bool retval = true; + bool mask_tmp; + retval = bool_ReadStrptrMaybe(mask_tmp, in_str); + if (retval) { + mask_Set(parent, mask_tmp); + } + return retval; +} + +// --- ws.FrameMasked64.payload_len.ReadStrptrMaybe +inline static bool ws::payload_len_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) { + bool retval = true; + u8 payload_len_tmp; + retval = u8_ReadStrptrMaybe(payload_len_tmp, in_str); + if (retval) { + payload_len_Set(parent, payload_len_tmp); + } + return retval; +} + +// --- ws.FrameMasked64.payload.Getary +// Access var-length portion as an aryptr. Length is determined from one of the fields. +algo::aryptr ws::payload_Getary(ws::FrameMasked64& parent) { + return algo::aryptr(payload_Addr(parent), payload_N(parent)); +} + +// --- ws.FrameMasked64.payload.Addr +char* ws::payload_Addr(ws::FrameMasked64& parent) { + return (char*)((u8*)&parent + sizeof(ws::FrameMasked64)); // address of varlen portion +} + +// --- ws.FrameMasked64.payload.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::payload_ReadStrptrMaybe(ws::FrameMasked64& parent, algo::strptr in_str) { + bool retval = true; + if (algo_lib::_db.varlenbuf) { + ary_Addary(*algo_lib::_db.varlenbuf, strptr_ToMemptr(in_str)); + } + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- ws.FrameMasked64.payload.Print +// Convert payload to a string. +// Array is printed as a regular string. +void ws::payload_Print(ws::FrameMasked64& parent, algo::cstring &rhs) { + rhs << payload_Getary(parent); +} + +// --- ws.FrameMasked64..ReadFieldMaybe +bool ws::FrameMasked64_ReadFieldMaybe(ws::FrameMasked64& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ws::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,algo::Pathcomp(field, ".LL")); + switch(field_id) { + case ws_FieldId_base: { + retval = false; + } break; + case ws_FieldId_byte0: { + retval = u8_ReadStrptrMaybe(parent.byte0, strval); + } break; + case ws_FieldId_byte1: { + retval = false; + } break; + case ws_FieldId_fin: { + retval = fin_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv1: { + retval = rsv1_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv2: { + retval = rsv2_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_rsv3: { + retval = rsv3_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_opcode: { + retval = opcode_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_mask: { + retval = mask_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_payload_len: { + retval = payload_len_ReadStrptrMaybe(parent, strval); + } break; + case ws_FieldId_ext_payload_len: { + retval = false; + } break; + case ws_FieldId_masking_key: { + retval = u32_ReadStrptrMaybe(parent.masking_key, strval); + } break; + case ws_FieldId_payload: { + retval = payload_ReadStrptrMaybe(parent, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ws.FrameMasked64..ReadStrptrMaybe +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::FrameMasked64 from an ascii string. +// The format of the string is an ssim Tuple +bool ws::FrameMasked64_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "ws.FrameMasked64"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && FrameMasked64_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- ws.FrameMasked64..Init +// Set all fields to initial values. +void ws::FrameMasked64_Init(ws::FrameMasked64& parent) { + parent.byte0 = u8(0); + parent.byte1 = u8(255); + parent.ext_payload_len_be = htobe64(ssizeof(parent) + (-14)); // write big-endian value to memory + parent.masking_key = u32(0); +} + +// --- ws.FrameMasked64..Print +// print string representation of ROW to string STR +// cfmt:ws.FrameMasked64.String printfmt:Tuple +void ws::FrameMasked64_Print(ws::FrameMasked64& row, algo::cstring& str) { + algo::tempstr temp; + str << "ws.FrameMasked64"; + + bool_Print(fin_Get(row), temp); + PrintAttrSpaceReset(str,"fin", temp); + + bool_Print(rsv1_Get(row), temp); + PrintAttrSpaceReset(str,"rsv1", temp); + + bool_Print(rsv2_Get(row), temp); + PrintAttrSpaceReset(str,"rsv2", temp); + + bool_Print(rsv3_Get(row), temp); + PrintAttrSpaceReset(str,"rsv3", temp); + + ws::Opcode_Print(opcode_Get(row), temp); + PrintAttrSpaceReset(str,"opcode", temp); + + bool_Print(mask_Get(row), temp); + PrintAttrSpaceReset(str,"mask", temp); + + u8_Print(payload_len_Get(row), temp); + PrintAttrSpaceReset(str,"payload_len", temp); + + u32_Print(row.masking_key, temp); + PrintAttrSpaceReset(str,"masking_key", temp); + + ws::payload_Print(row, temp); + PrintAttrSpaceReset(str,"payload", temp); +} + +// --- ws.HttpState.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* ws::value_ToCstr(const ws::HttpState& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case ws_HttpState_INIT : ret = "INIT"; break; + case ws_HttpState_REQLINE : ret = "REQLINE"; break; + case ws_HttpState_HEADER : ret = "HEADER"; break; + case ws_HttpState_BODY : ret = "BODY"; break; + case ws_HttpState_FIN : ret = "FIN"; break; + } + return ret; +} + +// --- ws.HttpState.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void ws::value_Print(const ws::HttpState& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- ws.HttpState.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool ws::value_SetStrptrMaybe(ws::HttpState& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 3: { + switch (u64(algo::ReadLE16(rhs.elems))|(u64(rhs[2])<<16)) { + case LE_STR3('F','I','N'): { + value_SetEnum(parent,ws_HttpState_FIN); ret = true; break; + } + } + break; + } + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('B','O','D','Y'): { + value_SetEnum(parent,ws_HttpState_BODY); ret = true; break; + } + case LE_STR4('I','N','I','T'): { + value_SetEnum(parent,ws_HttpState_INIT); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('H','E','A','D','E','R'): { + value_SetEnum(parent,ws_HttpState_HEADER); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('R','E','Q','L','I','N','E'): { + value_SetEnum(parent,ws_HttpState_REQLINE); ret = true; break; + } + } + break; + } + } + return ret; +} + +// --- ws.HttpState.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void ws::value_SetStrptr(ws::HttpState& parent, algo::strptr rhs, ws_HttpStateEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- ws.HttpState.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool ws::value_ReadStrptrMaybe(ws::HttpState& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = u8_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- ws.HttpState..ReadStrptrMaybe +// Read fields of ws::HttpState from an ascii string. +// The format of the string is the format of the ws::HttpState's only field +bool ws::HttpState_ReadStrptrMaybe(ws::HttpState &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- ws.HttpState..Print +// print string representation of ROW to string STR +// cfmt:ws.HttpState.String printfmt:Raw +void ws::HttpState_Print(ws::HttpState row, algo::cstring& str) { + ws::value_Print(row, str); +} + +// --- ws.ServerStartMsg.base.CopyOut +// Copy fields out of row +void ws::parent_CopyOut(ws::ServerStartMsg &row, ams::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter +} + +// --- ws.ServerStartMsg..ReadFieldMaybe +bool ws::ServerStartMsg_ReadFieldMaybe(ws::ServerStartMsg& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ws::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case ws_FieldId_base: { + retval = false; + } break; + case ws_FieldId_type: { + retval = false; + } break; + case ws_FieldId_length: { + retval = false; + } break; + case ws_FieldId_server: { + retval = algo::RspaceStr25_ReadStrptrMaybe(parent.server, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ws.ServerStartMsg..ReadStrptrMaybe +// Read fields of ws::ServerStartMsg from an ascii string. +// The format of the string is an ssim Tuple +bool ws::ServerStartMsg_ReadStrptrMaybe(ws::ServerStartMsg &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "ws.ServerStartMsg"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && ServerStartMsg_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- ws.ServerStartMsg..Print +// print string representation of ROW to string STR +// cfmt:ws.ServerStartMsg.String printfmt:Tuple +void ws::ServerStartMsg_Print(ws::ServerStartMsg& row, algo::cstring& str) { + algo::tempstr temp; + str << "ws.ServerStartMsg"; + + algo::RspaceStr25_Print(row.server, temp); + PrintAttrSpaceReset(str,"server", temp); +} + +// --- ws.ServerStopMsg.base.CopyOut +// Copy fields out of row +void ws::parent_CopyOut(ws::ServerStopMsg &row, ams::MsgHeader &out) { + // type: field value is computed + // length: field value is computed + (void)row;//only to avoid -Wunused-parameter + (void)out;//only to avoid -Wunused-parameter +} + +// --- ws.ServerStopMsg..ReadFieldMaybe +bool ws::ServerStopMsg_ReadFieldMaybe(ws::ServerStopMsg& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + ws::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case ws_FieldId_base: { + retval = false; + } break; + case ws_FieldId_type: { + retval = false; + } break; + case ws_FieldId_length: { + retval = false; + } break; + case ws_FieldId_server: { + retval = algo::RspaceStr25_ReadStrptrMaybe(parent.server, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- ws.ServerStopMsg..ReadStrptrMaybe +// Read fields of ws::ServerStopMsg from an ascii string. +// The format of the string is an ssim Tuple +bool ws::ServerStopMsg_ReadStrptrMaybe(ws::ServerStopMsg &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "ws.ServerStopMsg"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && ServerStopMsg_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- ws.ServerStopMsg..Print +// print string representation of ROW to string STR +// cfmt:ws.ServerStopMsg.String printfmt:Tuple +void ws::ServerStopMsg_Print(ws::ServerStopMsg& row, algo::cstring& str) { + algo::tempstr temp; + str << "ws.ServerStopMsg"; + + algo::RspaceStr25_Print(row.server, temp); + PrintAttrSpaceReset(str,"server", temp); +} + +// --- ws...SizeCheck +inline static void ws::SizeCheck() { + algo_assert(_offset_of(ws::Side,value) == 0); + algo_assert(sizeof(ws::Side) == 1); + algo_assert(_offset_of(ws::StatusCode,value) == 0); + algo_assert(sizeof(ws::StatusCode) == 2); + algo_assert(_offset_of(ws::CloseMsg,type) == 0); + algo_assert(_offset_of(ws::CloseMsg,length) == 4); + algo_assert(_offset_of(ws::CloseMsg,conn) == 8); + algo_assert(_offset_of(ws::CloseMsg,side) == 58); + algo_assert(_offset_of(ws::CloseMsg,code) == 59); + algo_assert(sizeof(ws::CloseMsg) == 61); + algo_assert(_offset_of(ws::ConnectMsg,type) == 0); + algo_assert(_offset_of(ws::ConnectMsg,length) == 4); + algo_assert(_offset_of(ws::ConnectMsg,conn) == 8); + algo_assert(_offset_of(ws::ConnectMsg,side) == 58); + algo_assert(sizeof(ws::ConnectMsg) == 59); + algo_assert(_offset_of(ws::Opcode,value) == 0); + algo_assert(sizeof(ws::Opcode) == 1); + algo_assert(_offset_of(ws::DataMsg,type) == 0); + algo_assert(_offset_of(ws::DataMsg,length) == 4); + algo_assert(_offset_of(ws::DataMsg,conn) == 8); + algo_assert(_offset_of(ws::DataMsg,side) == 58); + algo_assert(_offset_of(ws::DataMsg,opcode) == 59); + algo_assert(sizeof(ws::DataMsg) == 60); + algo_assert(_offset_of(ws::Frame,byte0) == 0); + algo_assert(_offset_of(ws::Frame,byte1) == 1); + algo_assert(sizeof(ws::Frame) == 2); + algo_assert(_offset_of(ws::Frame16,byte0) == 0); + algo_assert(_offset_of(ws::Frame16,byte1) == 1); + algo_assert(_offset_of(ws::Frame16,ext_payload_len_be) == 2); + algo_assert(sizeof(ws::Frame16) == 4); + algo_assert(_offset_of(ws::Frame64,byte0) == 0); + algo_assert(_offset_of(ws::Frame64,byte1) == 1); + algo_assert(_offset_of(ws::Frame64,ext_payload_len_be) == 2); + algo_assert(sizeof(ws::Frame64) == 10); + algo_assert(_offset_of(ws::FrameHeader,byte0) == 0); + algo_assert(_offset_of(ws::FrameHeader,byte1) == 1); + algo_assert(sizeof(ws::FrameHeader) == 2); + algo_assert(_offset_of(ws::FrameMasked,byte0) == 0); + algo_assert(_offset_of(ws::FrameMasked,byte1) == 1); + algo_assert(_offset_of(ws::FrameMasked,masking_key) == 2); + algo_assert(sizeof(ws::FrameMasked) == 6); + algo_assert(_offset_of(ws::FrameMasked16,byte0) == 0); + algo_assert(_offset_of(ws::FrameMasked16,byte1) == 1); + algo_assert(_offset_of(ws::FrameMasked16,ext_payload_len_be) == 2); + algo_assert(_offset_of(ws::FrameMasked16,masking_key) == 4); + algo_assert(sizeof(ws::FrameMasked16) == 8); + algo_assert(_offset_of(ws::FrameMasked64,byte0) == 0); + algo_assert(_offset_of(ws::FrameMasked64,byte1) == 1); + algo_assert(_offset_of(ws::FrameMasked64,ext_payload_len_be) == 2); + algo_assert(_offset_of(ws::FrameMasked64,masking_key) == 10); + algo_assert(sizeof(ws::FrameMasked64) == 14); + algo_assert(_offset_of(ws::HttpState,value) == 0); + algo_assert(sizeof(ws::HttpState) == 1); + algo_assert(_offset_of(ws::ServerStartMsg,type) == 0); + algo_assert(_offset_of(ws::ServerStartMsg,length) == 4); + algo_assert(_offset_of(ws::ServerStartMsg,server) == 8); + algo_assert(sizeof(ws::ServerStartMsg) == 33); + algo_assert(_offset_of(ws::ServerStopMsg,type) == 0); + algo_assert(_offset_of(ws::ServerStopMsg,length) == 4); + algo_assert(_offset_of(ws::ServerStopMsg,server) == 8); + algo_assert(sizeof(ws::ServerStopMsg) == 33); +} + +// --- ws...StaticCheck +void ws::StaticCheck() { + algo_assert(_offset_of(ws::Side, value) + sizeof(((ws::Side*)0)->value) == sizeof(ws::Side)); + algo_assert(_offset_of(ws::StatusCode, value) + sizeof(((ws::StatusCode*)0)->value) == sizeof(ws::StatusCode)); + algo_assert(_offset_of(ws::ConnectMsg, side) + sizeof(((ws::ConnectMsg*)0)->side) == sizeof(ws::ConnectMsg)); + algo_assert(_offset_of(ws::Opcode, value) + sizeof(((ws::Opcode*)0)->value) == sizeof(ws::Opcode)); + algo_assert(_offset_of(ws::FieldId, value) + sizeof(((ws::FieldId*)0)->value) == sizeof(ws::FieldId)); + // check that bitfield fits width + algo_assert(sizeof(((ws::Frame*)0)->byte0)*8 >= 8); + // check that bitfield fits width + algo_assert(sizeof(((ws::Frame*)0)->byte1)*8 >= 8); + // check that bitfield fits width + algo_assert(sizeof(((ws::Frame16*)0)->byte0)*8 >= 8); + // check that bitfield fits width + algo_assert(sizeof(((ws::Frame16*)0)->byte1)*8 >= 8); + algo_assert(_offset_of(ws::Frame16_curs, msglen) + sizeof(((ws::Frame16_curs*)0)->msglen) == sizeof(ws::Frame16_curs)); + // check that bitfield fits width + algo_assert(sizeof(((ws::Frame64*)0)->byte0)*8 >= 8); + // check that bitfield fits width + algo_assert(sizeof(((ws::Frame64*)0)->byte1)*8 >= 8); + algo_assert(_offset_of(ws::Frame64_curs, msglen) + sizeof(((ws::Frame64_curs*)0)->msglen) == sizeof(ws::Frame64_curs)); + // check that bitfield fits width + algo_assert(sizeof(((ws::FrameHeader*)0)->byte0)*8 >= 8); + // check that bitfield fits width + algo_assert(sizeof(((ws::FrameHeader*)0)->byte1)*8 >= 8); + algo_assert(_offset_of(ws::FrameHeader, byte1) + sizeof(((ws::FrameHeader*)0)->byte1) == sizeof(ws::FrameHeader)); + algo_assert(_offset_of(ws::FrameHeaderMsgsCase, value) + sizeof(((ws::FrameHeaderMsgsCase*)0)->value) == sizeof(ws::FrameHeaderMsgsCase)); + // check that bitfield fits width + algo_assert(sizeof(((ws::FrameMasked*)0)->byte0)*8 >= 8); + // check that bitfield fits width + algo_assert(sizeof(((ws::FrameMasked*)0)->byte1)*8 >= 8); + // check that bitfield fits width + algo_assert(sizeof(((ws::FrameMasked16*)0)->byte0)*8 >= 8); + // check that bitfield fits width + algo_assert(sizeof(((ws::FrameMasked16*)0)->byte1)*8 >= 8); + algo_assert(_offset_of(ws::FrameMasked16_curs, msglen) + sizeof(((ws::FrameMasked16_curs*)0)->msglen) == sizeof(ws::FrameMasked16_curs)); + // check that bitfield fits width + algo_assert(sizeof(((ws::FrameMasked64*)0)->byte0)*8 >= 8); + // check that bitfield fits width + algo_assert(sizeof(((ws::FrameMasked64*)0)->byte1)*8 >= 8); + algo_assert(_offset_of(ws::FrameMasked64_curs, msglen) + sizeof(((ws::FrameMasked64_curs*)0)->msglen) == sizeof(ws::FrameMasked64_curs)); + algo_assert(_offset_of(ws::HttpState, value) + sizeof(((ws::HttpState*)0)->value) == sizeof(ws::HttpState)); + algo_assert(_offset_of(ws::ServerStartMsg, server) + sizeof(((ws::ServerStartMsg*)0)->server) == sizeof(ws::ServerStartMsg)); + algo_assert(_offset_of(ws::ServerStopMsg, server) + sizeof(((ws::ServerStopMsg*)0)->server) == sizeof(ws::ServerStopMsg)); +} + +// --- ws.FrameHeaderMsgs..Print +// Print message to STR. If message is too short for MSG_LEN, print nothing. +// MSG.LENGTH must have already been validated against msg_len. +// This function will additionally validate that sizeof(Msg) <= msg_len +bool ws::FrameHeaderMsgs_Print(algo::cstring &str, ws::FrameHeader &msg, u32 msg_len) { + switch(msg.byte1) { + case 126: { + if (sizeof(ws::Frame16) > msg_len) { return false; } + Frame16_Print((ws::Frame16&)(msg), str); + return true; + } + case 127: { + if (sizeof(ws::Frame64) > msg_len) { return false; } + Frame64_Print((ws::Frame64&)(msg), str); + return true; + } + case 254: { + if (sizeof(ws::FrameMasked16) > msg_len) { return false; } + FrameMasked16_Print((ws::FrameMasked16&)(msg), str); + return true; + } + case 255: { + if (sizeof(ws::FrameMasked64) > msg_len) { return false; } + FrameMasked64_Print((ws::FrameMasked64&)(msg), str); + return true; + } + default: + + return false; + } +} + +// --- ws.FrameHeaderMsgs..ReadStrptr +// Parse ascii representation of message into binary, appending new data to BUF. +ws::FrameHeaderMsgsCase ws::FrameHeaderMsgs_ReadStrptr(algo::strptr str, algo::ByteAry &buf) { + bool ok = false; + tempstr msgtype_str; + algo::StringIter iter(str); + cstring_ReadCmdarg(msgtype_str, iter, false); // read first word + ws::FrameHeaderMsgsCase msgtype; + value_SetStrptrMaybe(msgtype, msgtype_str); // map string -> enum + switch (value_GetEnum(msgtype)) { // what message is it? + case ws_FrameHeaderMsgsCase_ws_Frame16: { + int len = sizeof(ws::Frame16); + ws::Frame16 *ctype = new(ary_AllocN(buf, len).elems) ws::Frame16; // default values + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + ok = Frame16_ReadStrptrMaybe(*ctype, str); // now read attributes + len += ary_N(varlenbuf); + ext_payload_len_Set(*ctype, u16(len-4)); + ary_Addary(buf, ary_Getary(varlenbuf)); + algo_lib::_db.varlenbuf = varlenbuf_save; + } break; // ws::Frame16 case + + case ws_FrameHeaderMsgsCase_ws_Frame64: { + int len = sizeof(ws::Frame64); + ws::Frame64 *ctype = new(ary_AllocN(buf, len).elems) ws::Frame64; // default values + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + ok = Frame64_ReadStrptrMaybe(*ctype, str); // now read attributes + len += ary_N(varlenbuf); + ext_payload_len_Set(*ctype, u64(len-10)); + ary_Addary(buf, ary_Getary(varlenbuf)); + algo_lib::_db.varlenbuf = varlenbuf_save; + } break; // ws::Frame64 case + + case ws_FrameHeaderMsgsCase_ws_FrameMasked16: { + int len = sizeof(ws::FrameMasked16); + ws::FrameMasked16 *ctype = new(ary_AllocN(buf, len).elems) ws::FrameMasked16; // default values + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + ok = FrameMasked16_ReadStrptrMaybe(*ctype, str); // now read attributes + len += ary_N(varlenbuf); + ext_payload_len_Set(*ctype, u16(len-8)); + ary_Addary(buf, ary_Getary(varlenbuf)); + algo_lib::_db.varlenbuf = varlenbuf_save; + } break; // ws::FrameMasked16 case + + case ws_FrameHeaderMsgsCase_ws_FrameMasked64: { + int len = sizeof(ws::FrameMasked64); + ws::FrameMasked64 *ctype = new(ary_AllocN(buf, len).elems) ws::FrameMasked64; // default values + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + ok = FrameMasked64_ReadStrptrMaybe(*ctype, str); // now read attributes + len += ary_N(varlenbuf); + ext_payload_len_Set(*ctype, u64(len-14)); + ary_Addary(buf, ary_Getary(varlenbuf)); + algo_lib::_db.varlenbuf = varlenbuf_save; + } break; // ws::FrameMasked64 case + + default: break; + } + return ok ? msgtype : ws::FrameHeaderMsgsCase(); +} + +// --- ws.FrameHeaderMsgs..ReadStrptrMaybe +// Parse ascii representation of message into binary, appending new data to BUF. +bool ws::FrameHeaderMsgs_ReadStrptrMaybe(algo::strptr str, algo::ByteAry &buf) { + ws::FrameHeaderMsgsCase msgtype = FrameHeaderMsgs_ReadStrptr(str,buf); + return !(msgtype == ws::FrameHeaderMsgsCase()); +} diff --git a/cpp/gen/wsdb_gen.cpp b/cpp/gen/wsdb_gen.cpp new file mode 100644 index 00000000..a4a86210 --- /dev/null +++ b/cpp/gen/wsdb_gen.cpp @@ -0,0 +1,212 @@ +// +// cpp/gen/wsdb_gen.cpp +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#include "include/algo.h" // hard-coded include +#include "include/gen/wsdb_gen.h" +#include "include/gen/wsdb_gen.inl.h" +#include "include/gen/algo_gen.h" +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude +namespace wsdb { // gen:ns_print_proto + // func:wsdb...SizeCheck + inline static void SizeCheck(); +} // gen:ns_print_proto + +// --- wsdb.FieldId.value.ToCstr +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +const char* wsdb::value_ToCstr(const wsdb::FieldId& parent) { + const char *ret = NULL; + switch(value_GetEnum(parent)) { + case wsdb_FieldId_code : ret = "code"; break; + case wsdb_FieldId_reason : ret = "reason"; break; + case wsdb_FieldId_local_only : ret = "local_only"; break; + case wsdb_FieldId_comment : ret = "comment"; break; + case wsdb_FieldId_value : ret = "value"; break; + } + return ret; +} + +// --- wsdb.FieldId.value.Print +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +void wsdb::value_Print(const wsdb::FieldId& parent, algo::cstring &lhs) { + const char *strval = value_ToCstr(parent); + if (strval) { + lhs << strval; + } else { + lhs << parent.value; + } +} + +// --- wsdb.FieldId.value.SetStrptrMaybe +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +bool wsdb::value_SetStrptrMaybe(wsdb::FieldId& parent, algo::strptr rhs) { + bool ret = false; + switch (elems_N(rhs)) { + case 4: { + switch (u64(algo::ReadLE32(rhs.elems))) { + case LE_STR4('c','o','d','e'): { + value_SetEnum(parent,wsdb_FieldId_code); ret = true; break; + } + } + break; + } + case 5: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) { + case LE_STR5('v','a','l','u','e'): { + value_SetEnum(parent,wsdb_FieldId_value); ret = true; break; + } + } + break; + } + case 6: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)) { + case LE_STR6('r','e','a','s','o','n'): { + value_SetEnum(parent,wsdb_FieldId_reason); ret = true; break; + } + } + break; + } + case 7: { + switch (u64(algo::ReadLE32(rhs.elems))|(u64(algo::ReadLE16(rhs.elems+4))<<32)|(u64(rhs[6])<<48)) { + case LE_STR7('c','o','m','m','e','n','t'): { + value_SetEnum(parent,wsdb_FieldId_comment); ret = true; break; + } + } + break; + } + case 10: { + switch (algo::ReadLE64(rhs.elems)) { + case LE_STR8('l','o','c','a','l','_','o','n'): { + if (memcmp(rhs.elems+8,"ly",2)==0) { value_SetEnum(parent,wsdb_FieldId_local_only); ret = true; break; } + break; + } + } + break; + } + } + return ret; +} + +// --- wsdb.FieldId.value.SetStrptr +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +void wsdb::value_SetStrptr(wsdb::FieldId& parent, algo::strptr rhs, wsdb_FieldIdEnum dflt) { + if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt); +} + +// --- wsdb.FieldId.value.ReadStrptrMaybe +// Convert string to field. Return success value +bool wsdb::value_ReadStrptrMaybe(wsdb::FieldId& parent, algo::strptr rhs) { + bool retval = false; + retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion + if (!retval) { // didn't work? try reading as underlying type + retval = i32_ReadStrptrMaybe(parent.value,rhs); + } + return retval; +} + +// --- wsdb.FieldId..ReadStrptrMaybe +// Read fields of wsdb::FieldId from an ascii string. +// The format of the string is the format of the wsdb::FieldId's only field +bool wsdb::FieldId_ReadStrptrMaybe(wsdb::FieldId &parent, algo::strptr in_str) { + bool retval = true; + retval = retval && value_ReadStrptrMaybe(parent, in_str); + return retval; +} + +// --- wsdb.FieldId..Print +// print string representation of ROW to string STR +// cfmt:wsdb.FieldId.String printfmt:Raw +void wsdb::FieldId_Print(wsdb::FieldId& row, algo::cstring& str) { + wsdb::value_Print(row, str); +} + +// --- wsdb.Status..ReadFieldMaybe +bool wsdb::Status_ReadFieldMaybe(wsdb::Status& parent, algo::strptr field, algo::strptr strval) { + bool retval = true; + wsdb::FieldId field_id; + (void)value_SetStrptrMaybe(field_id,field); + switch(field_id) { + case wsdb_FieldId_code: { + retval = u32_ReadStrptrMaybe(parent.code, strval); + } break; + case wsdb_FieldId_reason: { + retval = algo::Smallstr32_ReadStrptrMaybe(parent.reason, strval); + } break; + case wsdb_FieldId_local_only: { + retval = bool_ReadStrptrMaybe(parent.local_only, strval); + } break; + case wsdb_FieldId_comment: { + retval = algo::Comment_ReadStrptrMaybe(parent.comment, strval); + } break; + default: { + retval = false; + algo_lib::AppendErrtext("comment", "unrecognized attr"); + } break; + } + if (!retval) { + algo_lib::AppendErrtext("attr",field); + } + return retval; +} + +// --- wsdb.Status..ReadStrptrMaybe +// Read fields of wsdb::Status from an ascii string. +// The format of the string is an ssim Tuple +bool wsdb::Status_ReadStrptrMaybe(wsdb::Status &parent, algo::strptr in_str) { + bool retval = true; + retval = algo::StripTypeTag(in_str, "wsdb.status") || algo::StripTypeTag(in_str, "wsdb.Status"); + ind_beg(algo::Attr_curs, attr, in_str) { + retval = retval && Status_ReadFieldMaybe(parent, attr.name, attr.value); + }ind_end; + return retval; +} + +// --- wsdb.Status..Print +// print string representation of ROW to string STR +// cfmt:wsdb.Status.String printfmt:Tuple +void wsdb::Status_Print(wsdb::Status& row, algo::cstring& str) { + algo::tempstr temp; + str << "wsdb.status"; + + u32_Print(row.code, temp); + PrintAttrSpaceReset(str,"code", temp); + + algo::Smallstr32_Print(row.reason, temp); + PrintAttrSpaceReset(str,"reason", temp); + + bool_Print(row.local_only, temp); + PrintAttrSpaceReset(str,"local_only", temp); + + algo::Comment_Print(row.comment, temp); + PrintAttrSpaceReset(str,"comment", temp); +} + +// --- wsdb...SizeCheck +inline static void wsdb::SizeCheck() { +} diff --git a/cpp/jkv/jkv.cpp b/cpp/jkv/jkv.cpp new file mode 100644 index 00000000..b6946c6f --- /dev/null +++ b/cpp/jkv/jkv.cpp @@ -0,0 +1,209 @@ +// 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: jkv (exe) -- JSON <-> key-value mapping tool +// Exceptions: yes +// Source: cpp/jkv/jkv.cpp +// + +#include "include/algo.h" +#include "include/algo.h" +#include "include/jkv.h" +#include "include/lib_json.h" + +void jkv::PrintKv(lib_json::FNode &node, algo::strptr prefix, cstring &out) { + verblog("["< 0) { + ind_beg(lib_json::node_c_child_curs,child,node) { + tempstr new_prefix; + new_prefix << prefix << "-" << ind_curs(child).index; + PrintKv(child, new_prefix, out); + }ind_end; + } else { + out< 0) { + ind_beg(lib_json::node_c_child_curs,child,node) { + tempstr new_prefix(prefix); + if (new_prefix != "") { + new_prefix << "."; + } + new_prefix << child.value; + PrintKv(child, new_prefix, out); + }ind_end; + } else { + out<type = lib_json_FNode_type_object; + algo::i32_Range dot=ch_FindFirst(key,'.'); + algo::strptr fieldname=ch_FirstN(key,dot.beg); + key=ch_RestFrom(key,dot.end); + algo::i32_Range dash = ch_FindFirst(fieldname,'-'); + algo::strptr num; + if (dash.end > dash.beg) { + num=ch_RestFrom(fieldname,dash.end); + fieldname=ch_FirstN(fieldname,dash.beg); + } + if (fieldname != "") {// disallow empty field names + // find or create field with name 'fieldname' + lib_json::FNode* fieldnode = lib_json::ind_objfld_Find(lib_json::FldKey(node,fieldname)); + node = fieldnode ? fieldnode : &NewFieldVal(node, lib_json_FNode_type_null, fieldname); + } + // handle array index + if (num != "") { + node->type = lib_json_FNode_type_array; + u32 index=0; + u32_ReadStrptrMaybe(index,num);// read array index + while (u32(c_child_N(*node)) <= index) { + lib_json::NewNode(node,lib_json_FNode_type_null); + } + node = c_child_Find(*node,index); + } + } + c_child_Cascdel(*node);// delete any children + // store value + node->type = val->type; + node->value = val->value; + node_Delete(*val); +} + +// ----------------------------------------------------------------------------- + +void jkv::ApplyKv(lib_json::FNode &node, algo::strptr kv) { + tempstr key(Pathcomp(kv,":LL")); + strptr val=Pathcomp(kv,":LR"); + if (StartsWithQ(key,".")) {// .blah:val -> start from last key + key = tempstr() << Pathcomp(_db.last_kv,".RL") << key; + } else if (StartsWithQ(key,"-")) {// -blah:val -> use last prefix key + key = tempstr() << Pathcomp(_db.last_kv,"-RL") << key; + } else if (key == "") {// empty key = last key + 1 + int num=0; + i32_ReadStrptrMaybe(num,Pathcomp(_db.last_kv,"-RR")); + strptr prefix = Pathcomp(_db.last_kv,"-RL"); + if (prefix != "") { + num = num+1; + } else { + prefix = _db.last_kv; + } + key = tempstr() << prefix << "-" << num; + } + lib_json::FParser parser; + if (StartsWithQ(val,":")) { + JsonParse(parser,tempstr() << '"' << ch_RestFrom(val,1) << '"'); + } else { + JsonParse(parser,val); + } + JsonParse(parser,""); + bool good = parser.root_node != NULL; + verblog("apply " + <p_parent = NULL; + vrfy_(c_child_N(*valnode)==0); + SetPath(&node,key,valnode); + } + _db.last_kv=key; +} + +// ----------------------------------------------------------------------------- + +void jkv::Main() { + // in-memory object + lib_json::FParser parser; + // read input + cstring input; + if (_db.cmdline.file == "-") { + ind_beg(algo::FileLine_curs,line,algo::Fildes(0)) { + input << line << eol; + }ind_end; + } else { + input = FileToString(_db.cmdline.file); + } + // input -> object + if (_db.cmdline.r) { + parser.root_node = &lib_json::NewNode(NULL,lib_json_FNode_type_object);// start with empty object + ind_beg(algo::Line_curs,line,input) { + ApplyKv(*parser.root_node,line); + }ind_end; + } else { + lib_json::JsonParse(parser,input); + lib_json::JsonParse(parser,"");// finalize + if (!parser.root_node) { + parser.root_node = &lib_json::NewNode(NULL,lib_json_FNode_type_object);// recover from failure + } + } + // apply kvs + ind_beg(command::jkv_kv_curs,kv,_db.cmdline) { + ApplyKv(*parser.root_node,kv); + }ind_end; + if (_db.cmdline.output == command_jkv_output_auto) { + _db.cmdline.output = _db.cmdline.write + ? (_db.cmdline.r ? command_jkv_output_kv : command_jkv_output_json) + : (_db.cmdline.r ? command_jkv_output_json : command_jkv_output_kv); + } + cstring out; + if (_db.cmdline.output == command_jkv_output_json) { + lib_json::JsonSerialize(parser.root_node, out, _db.cmdline.pretty); + out << eol; + } else if (_db.cmdline.output == command_jkv_output_kv) { + PrintKv(*parser.root_node, "", out); + } + if (_db.cmdline.write && _db.cmdline.file != "-") { + SafeStringToFile(out,_db.cmdline.file); + } else { + prlog_(out); + } +} diff --git a/cpp/lib/algo/arg.cpp b/cpp/lib/algo/arg.cpp index 2978394a..aed33311 100644 --- a/cpp/lib/algo/arg.cpp +++ b/cpp/lib/algo/arg.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 // diff --git a/cpp/lib/algo/backtrace.cpp b/cpp/lib/algo/backtrace.cpp index f69f53c0..38f652bf 100644 --- a/cpp/lib/algo/backtrace.cpp +++ b/cpp/lib/algo/backtrace.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-2013 AlgoEngineering LLC diff --git a/cpp/lib/algo/base64.cpp b/cpp/lib/algo/base64.cpp index 0692c5e7..2906402d 100644 --- a/cpp/lib/algo/base64.cpp +++ b/cpp/lib/algo/base64.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/lib/algo/bin_decode.cpp b/cpp/lib/algo/bin_decode.cpp new file mode 100644 index 00000000..27a1d234 --- /dev/null +++ b/cpp/lib/algo/bin_decode.cpp @@ -0,0 +1,296 @@ +// Copyright (C) 2024-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: algo_lib (lib) -- Support library for all executables +// Exceptions: NO +// Source: cpp/lib/algo/bin_decode.cpp +// + +#include "include/algo.h" + +//////////////////////////////////////////////////////////////////////////////// +// FIXED-LENGTH INTEGERS // +//////////////////////////////////////////////////////////////////////////////// + +// single byte +bool algo::DecodeU8(algo::memptr &buf, u8 &result) { + result = 0; + bool ok = elems_N(buf) >= 1; + if (ok) { + result = buf.elems[0]; + buf = RestFrom(buf,1); + } + return ok; +} + +//------------------------------------------------------------------------------ + +// single byte, signed +bool algo::DecodeI8(algo::memptr &buf, i8 &result) { + u8 tmp(0); + bool ok = algo::DecodeU8(buf,tmp); + result = tmp; + return ok; +} + +//------------------------------------------------------------------------------ + +// single byte, boolean +bool algo::DecodeBoolean(algo::memptr &buf, bool &result) { + u8 tmp(0); + bool ok = algo::DecodeU8(buf,tmp); + result = tmp; + return ok; +} + +//------------------------------------------------------------------------------ + +// two-byte, big-endian +bool algo::DecodeBEU16(algo::memptr &buf, u16 &result) { + constexpr int len = sizeof result; + result = 0; + bool ok = buf.n_elems >= len; + if (ok) { + result = be16toh(*(u16*)buf.elems); + buf = RestFrom(buf,len); + } + return ok; +} + +//------------------------------------------------------------------------------ + +// two-byte, big endian, signed +bool algo::DecodeBEI16(algo::memptr &buf, i16 &result) { + u16 tmp; + bool ok = algo::DecodeBEU16(buf,tmp); + result = tmp; + return ok; +} + +//------------------------------------------------------------------------------ + +// four-byte, big-endian +bool algo::DecodeBEU32(algo::memptr &buf, u32 &result) { + constexpr int len = sizeof result; + result = 0; + bool ok = buf.n_elems >= len; + if (ok) { + result = be32toh(*(u32*)buf.elems); + buf = RestFrom(buf,len); + } + return ok; +} + +//------------------------------------------------------------------------------ + +// four-byte, big-endian signed +bool algo::DecodeBEI32(algo::memptr &buf, i32 &result) { + u32 tmp; + bool ok = algo::DecodeBEU32(buf,tmp); + result = tmp; + return ok; +} + +//------------------------------------------------------------------------------ + +// eight-byte, big-endian +bool algo::DecodeBEU64(algo::memptr &buf, u64 &result) { + constexpr int len = sizeof result; + result = 0; + bool ok = buf.n_elems >= len; + if (ok) { + result = be64toh(*(u64*)buf.elems); + buf = RestFrom(buf,len); + } + return ok; +} + +//------------------------------------------------------------------------------ + +// eight-byte, big-endian signed +bool algo::DecodeBEI64(algo::memptr &buf, i64 &result) { + u64 tmp; + bool ok = algo::DecodeBEU64(buf,tmp); + result = tmp; + return ok; +} + +//////////////////////////////////////////////////////////////////////////////// +// FLOAT // +//////////////////////////////////////////////////////////////////////////////// + +bool algo::DecodeBEF64(algo::memptr &buf, double &result) { +#ifdef __STDC_IEC_559__ + u64 tmp; + bool ok = algo::DecodeBEU64(buf,tmp); + char *ptr = (char*)&tmp; + result = *(double*)ptr; + return ok; +#else +#error "Unconformant float representation format" +#endif +} + +//////////////////////////////////////////////////////////////////////////////// +// VARIABLE-LENGTH INTEGERS // +//////////////////////////////////////////////////////////////////////////////// + +// continuation bit (bit 7 of each byte), little-endian, u32 +bool algo::DecodeVLCLEU32(algo::memptr &buf, u32 &result) { + result = 0; + u32 value(0); + u32 overflow(0); + int pos(0); + bool stop(false); + int shift = 0; + for (; !stop && !overflow && pos> shift; + shift += 7; + } + bool ret = stop && !overflow; + if (ret) { + result = value; + buf = RestFrom(buf,pos); + } + return ret; +} + +//------------------------------------------------------------------------------ + +// continuation bit (bit 7 of each byte), little-endian, u32, signed zigzag +// sign - bit 0 (lsb) +// unsigned mantissa - bits 1..N (msb) +bool algo::DecodeVLCLEI32Z(algo::memptr &buf, i32 &result) { + result = 0; + u32 tmp; + bool ok = DecodeVLCLEU32(buf,tmp); + if (ok) { + result = (tmp >> 1) ^ (-(tmp & 1)); + } + return ok; +} + +//------------------------------------------------------------------------------ + +// continuation bit (bit 7 of each byte), little-endian, u64 +bool algo::DecodeVLCLEU64(algo::memptr &buf, u64 &result) { + result = 0; + u64 value(0); + u64 overflow(0); + int pos(0); + bool stop(false); + int shift = 0; + for (; !stop && !overflow && pos> shift; + shift += 7; + } + bool ret = stop && !overflow; + if (ret) { + result = value; + buf = RestFrom(buf,pos); + } + return ret; +} + +//------------------------------------------------------------------------------ + +// continuation - bit 7 (msb) of each byte, little-endian, signed zigzag: +// sign - bit 0 (lsb) +// unsigned mantissa - bits 1..N (msb) +bool algo::DecodeVLCLEI64Z(algo::memptr &buf, i64 &result) { + result = 0; + u64 tmp; + bool ok = DecodeVLCLEU64(buf,tmp); + if (ok) { + result = (tmp >> 1) ^ (-(tmp & 1)); + } + return ok; +} + +//////////////////////////////////////////////////////////////////////////////// +// RAW BYTES // +//////////////////////////////////////////////////////////////////////////////// + +// N bytes, raw +bool algo::DecodeNBytes(algo::memptr &buf, int n, algo::memptr &result) { + result = algo::memptr(); + bool ok = elems_N(buf) >= n; + if (ok) { + result = FirstN(buf,n); + buf = RestFrom(buf,n); + } + return ok; +} + +//////////////////////////////////////////////////////////////////////////////// +// STRINGS // +//////////////////////////////////////////////////////////////////////////////// + +// N bytes as chars +bool algo::DecodeNChars(algo::memptr &buf, int n, strptr &result) { + result = strptr(); + bool ok = elems_N(buf) >= n; + if (ok) { + result = ToStrPtr(FirstN(buf,n)); + buf = RestFrom(buf,n); + } + return ok; +} + +//////////////////////////////////////////////////////////////////////////////// + +// zero-terminated string +bool algo::DecodeZeroterm(algo::strptr &buf, strptr &result) { + result = strptr(); + int end = FindChar(buf,'\0'); + bool ok = end>=0; + if (ok) { + result = FirstN(buf,end); + buf = RestFrom(buf,end+1); + } + return ok; +} + +// zero-terminated string +bool algo::DecodeZeroterm(algo::memptr &buf, strptr &result) { + strptr tmp = memptr_ToStrptr(buf); + bool ok = DecodeZeroterm(tmp,result); + buf = strptr_ToMemptr(tmp); + return ok; +} + +//////////////////////////////////////////////////////////////////////////////// +// SPECIFIC TYPES // +//////////////////////////////////////////////////////////////////////////////// + +// UUID - raw bytes +bool algo::DecodeUuid(algo::memptr &buf, algo::Uuid &result) { + constexpr int len = sizeof result; + algo::memptr tmp; + bool ok = DecodeNBytes(buf, len, tmp); + if (ok) { + memcpy(&result, tmp.elems, len); + } + return ok; +} diff --git a/cpp/lib/algo/bin_encode.cpp b/cpp/lib/algo/bin_encode.cpp new file mode 100644 index 00000000..7e37fa55 --- /dev/null +++ b/cpp/lib/algo/bin_encode.cpp @@ -0,0 +1,121 @@ +// Copyright (C) 2024-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: algo_lib (lib) -- Support library for all executables +// Exceptions: NO +// Source: cpp/lib/algo/bin_encode.cpp +// + +#include "include/algo.h" + +//////////////////////////////////////////////////////////////////////////////// +// FIXED-LENGTH INTEGERS // +//////////////////////////////////////////////////////////////////////////////// + +void algo::EncodeBoolean(algo::ByteAry &buf, bool value) { + ary_Alloc(buf) = value; +} + +void algo::EncodeU8(algo::ByteAry &buf, u8 value) { + ary_Alloc(buf) = value; +} + +void algo::EncodeI8(algo::ByteAry &buf, i8 value) { + ary_Alloc(buf) = value; +} + +void algo::EncodeBEU16(algo::ByteAry &buf, u16 value) { + *(u16*)ary_AllocN(buf,sizeof value).elems = htobe16(value); +} + +void algo::EncodeBEI16(algo::ByteAry &buf, i16 value) { + EncodeBEU16(buf,value); +} + +void algo::EncodeBEU32(algo::ByteAry &buf, u32 value) { + *(u32*)ary_AllocN(buf,sizeof value).elems = htobe32(value); +} + +void algo::EncodeBEI32(algo::ByteAry &buf, i32 value) { + EncodeBEU32(buf,value); +} + +void algo::EncodeBEU64(algo::ByteAry &buf, u64 value) { + *(u64*)ary_AllocN(buf,sizeof value).elems = htobe64(value); +} + +void algo::EncodeBEI64(algo::ByteAry &buf, i64 value) { + EncodeBEU64(buf,value); +} + +//////////////////////////////////////////////////////////////////////////////// +// FLOAT // +//////////////////////////////////////////////////////////////////////////////// + +void algo::EncodeBEF64(algo::ByteAry &buf, double value) { +#ifdef __STDC_IEC_559__ + char *ptr = (char*)&value; + EncodeBEU64(buf,*(u64*)ptr); +#else +#error "Unconformant float representation format" +#endif +} + +//////////////////////////////////////////////////////////////////////////////// +// VARIABLE-LENGTH INTEGERS // +//////////////////////////////////////////////////////////////////////////////// + +// variable-length, continuation bit, u32 +void algo::EncodeVLCLEU32(algo::ByteAry &buf, u32 value) { + algo::EncodeVLCLEU64(buf,value); +} + +// variable-length, continuation bit, i32, zigzag +void algo::EncodeVLCLEI32Z(algo::ByteAry &buf, i32 value) { + EncodeVLCLEI64Z(buf,value); +} + +// variable-length, continuation bit, u64 +void algo::EncodeVLCLEU64(algo::ByteAry &buf, u64 value) { + if (value) { + int n_bits = algo::u64_BitScanReverse(value) + 1; + int n_bytes = (n_bits + 6) / 7; + algo::memptr bytes = ary_AllocN(buf,n_bytes); + frep_(i,n_bytes) { + bytes[i] = (value & 0x7f) | 0x80; + value = value >> 7; + } + bytes[n_bytes-1] &= 0x7f; + } else { + ary_AllocN(buf,1).elems[0] = 0; + } +} + +// variable-length, continuation bit, i64, zigzag +void algo::EncodeVLCLEI64Z(algo::ByteAry &buf, i64 value) { + u64 tmp = (value << 1) ^ (value >> 63); + EncodeVLCLEU64(buf,tmp); +} + +//////////////////////////////////////////////////////////////////////////////// +// SPECIFIC TYPES // +//////////////////////////////////////////////////////////////////////////////// + +// UUID - raw bytes +void algo::EncodeUuid(algo::ByteAry &buf, algo::Uuid &value) { + algo::memptr tmp((u8*)&value,sizeof value); + ary_Addary(buf,tmp); +} diff --git a/cpp/lib/algo/cpu_hz.cpp b/cpp/lib/algo/cpu_hz.cpp index c1473a64..5eb2c81c 100644 --- a/cpp/lib/algo/cpu_hz.cpp +++ b/cpp/lib/algo/cpu_hz.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 // diff --git a/cpp/lib/algo/crc32.cpp b/cpp/lib/algo/crc32.cpp index 6574b92e..38cb320c 100644 --- a/cpp/lib/algo/crc32.cpp +++ b/cpp/lib/algo/crc32.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 // @@ -28,8 +28,7 @@ #define UPDC32(octet, crc) (crc_32_tab[((crc) ^ (octet)) & 0xff] ^ ((crc) >> 8)) /* CRC polynomial 0xedb88320 */ -static u32 crc_32_tab[] -= { +static u32 crc_32_tab[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, diff --git a/cpp/lib/algo/decimal.cpp b/cpp/lib/algo/decimal.cpp index 53ee7ea2..4a1c3904 100644 --- a/cpp/lib/algo/decimal.cpp +++ b/cpp/lib/algo/decimal.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/lib/algo/errtext.cpp b/cpp/lib/algo/errtext.cpp index d4237235..eca840bf 100644 --- a/cpp/lib/algo/errtext.cpp +++ b/cpp/lib/algo/errtext.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2017-2019 NYSE | Intercontinental Exchange // // License: GPL @@ -23,16 +23,6 @@ #include "include/algo.h" -// ----------------------------------------------------------------------------- - -void algo_lib::SaveBadField(strptr name, strptr value) { - SaveBadTag("attr",name); - (void)name; - (void)value; -} - -// ----------------------------------------------------------------------------- - // Reset value of algo_lib::_db.errtext and return it for further editing // Usage: // algo_lib::ResetBadTags() << ...errors... @@ -45,24 +35,17 @@ algo::cstring &algo_lib::ResetErrtext() { // Add key-value pair to algo_lib::_db.errtext // Error text beyond a reasonable limit is discarded -- keep errors short! -void algo_lib::SaveBadTag(const strptr &name, const strptr &value) { - if (ch_N(algo_lib::_db.errtext) < 256) { +void algo_lib::AppendErrtext(const strptr &name, const strptr &value) { + if (ch_N(algo_lib::_db.errtext) < 1024) { PrintAttrSpace(algo_lib::_db.errtext, name, value); } } // ----------------------------------------------------------------------------- -// Better name than SaveBadTAg -void algo_lib::AppendErrtext(const strptr &name, const strptr &value) { - SaveBadTag(name,value); -} - -// ----------------------------------------------------------------------------- - -// Retrieve whatever bad tags were saved with SaveBadTag, +// Retrieve whatever bad tags were saved with AppendErrtext, // and clear the state. -// SaveBadTag is typically called by string read functions that encounter +// AppendErrtext is typically called by string read functions that encounter // something unreadable. This is the only way to retrieve that // additional information tempstr algo_lib::DetachBadTags() { @@ -76,21 +59,9 @@ tempstr algo_lib::DetachBadTags() { // Increment algo_lib::_db.trace.tot_insert_err // And print accumulated 'bad tags' using prerr. // if SetShowInsertErrLim was previously called. -// Note: printing is disabled by default, and must be explicitly enabled. void algo_lib::NoteInsertErr(strptr tuple) { - // show first few errors (default: 0) - if (algo_lib::_db.trace.tot_insert_err < algo_lib::_db.show_insert_err_lim) { - prerr("algo_lib.insert_err" - <decode) { + decode_Call(*errns,code); + str<outstr; + } else { + str<0 ? extra - : txtcell.justify<0 ? 0 - : extra/2; - char_PrintNTimes(' ', str, l); - algo::TermStyle style = use_style ? txtcell.style : algo::TermStyle(algo_TermStyle_default); - if (style != algo_TermStyle_default) { - if (style & algo_TermStyle_bold) { - // do it - } - if (style & algo_TermStyle_red) { - str << "\033[91m"; - } - if (style & algo_TermStyle_green) { - str << "\033[92m"; - } - if (style & algo_TermStyle_blue) { - str << "\033[94m"; - } - } - str << txtcell.text; - if (style) { - strptr_Print("\033[0m", str); - } - char_PrintNTimes(' ', str, extra-l); - str << txtcell.rsep; - }ind_end; - // trim whitespace on the right - while (ch_N(str) && ch_qLast(str) == ' ') { - str.ch_n--; - } - str << eol; -} - -static void Normalize(algo_lib::FTxttbl &txttbl) { - algo::U64Ary norm; - ary_Alloc(norm) = 0; - int maxspan = 0; - ind_beg(algo_lib::txttbl_c_txtrow_curs,txtrow,txttbl) if (txtrow.select) { - ind_beg(algo_lib::txtrow_c_txtcell_curs, txtcell, txtrow) { - maxspan = i32_Max(maxspan, txtcell.span); - }ind_end; - }ind_end; - frep_(span,maxspan+1) { - ind_beg(algo_lib::txttbl_c_txtrow_curs,txtrow,txttbl) if (txtrow.select) { - int i = 0; - ind_beg(algo_lib::txtrow_c_txtcell_curs, txtcell, txtrow) { - if (txtcell.span == span) { - int w = i32_Max(ch_N(txtcell.text) + ch_N(txtcell.rsep), txtcell.width); - // apply width - int r = i + txtcell.span; - while (r >= ary_N(norm)) { - int last = ary_qLast(norm); - ary_Alloc(norm) = last; - } - int extra = w - (ary_qFind(norm, r) - ary_qFind(norm, i)); - if (extra > 0) { - for (int j = r; j < ary_N(norm); j++) { - ary_qFind(norm, j) += extra; - } - } - } - i += txtcell.span; - }ind_end; - }ind_end; - } - ind_beg(algo_lib::txttbl_c_txtrow_curs,txtrow,txttbl) if (txtrow.select) { - int i = 0; - ind_beg(algo_lib::txtrow_c_txtcell_curs, txtcell, txtrow) { - txtcell.width = ary_qFind(norm, i+txtcell.span) - ary_qFind(norm, i); - i += txtcell.span; - }ind_end;; - }ind_end;; -} - -void algo_lib::FTxttbl_Print(algo_lib::FTxttbl &T_, algo::cstring &str) { - algo_lib::FTxttbl &txttbl = const_cast(T_); - bool use_style = algo::SaneTerminalQ(); - if (bool_Update(txttbl.normalized,true)) { - Normalize(txttbl); - } - ind_beg(algo_lib::txttbl_c_txtrow_curs,txtrow,txttbl) if (txtrow.select) { - PrintRow(str,txtrow,use_style); - }ind_end; -} - -static tempstr NewlineToBr(strptr s) { - tempstr ret(s); - Replace(ret,"\n","
"); - return ret; -} - -void algo_lib::FTxttbl_Markdown(algo_lib::FTxttbl &T_, algo::cstring &str) { - algo_lib::FTxttbl &txttbl = const_cast(T_); - // First row of the table is always the header - // Second row have to be inserted as |---| for markdown - ind_beg(algo_lib::txttbl_c_txtrow_curs,txtrow,txttbl) if (txtrow.select && c_txtcell_N(txtrow)) { - str<<"|"; - ind_beg(algo_lib::txtrow_c_txtcell_curs, txtcell, txtrow) { - // markdown is thrown away by \n in the cells, so it has to be replaced with
- str<=2 && ParseHex1(str[pos],hi) && ParseHex1(str[pos+1],lo); + if (ok) { + parent.value_elems[index] = (hi << 4) + lo; + pos += 2; + left -=2; + ++index; + } + } + } + ok = ok && index == value_N(parent) && !left; + if (!ok) { + algo::Refurbish(parent); + } + return ok; +} + +// print bytes in hex e.g: 00 01 ff +void algo::memptr_Print(algo::memptr parent, algo::cstring &str) { + algo::ListSep ls(" "); + frep_(i,elems_N(parent)) { + MaybeSpace(str); + u64_PrintHex(parent[i],str,2,false,false); + } +} + +void algo::ByteAry_Print(algo::ByteAry &parent, algo::cstring &str) { + str << ary_Getary(parent); +} + +// read bytes in hex e.g: 00 01 ff +bool algo::ByteAry_ReadStrptrMaybe(algo::ByteAry &parent, strptr str) { + ary_RemoveAll(parent); + bool cont(false); + frep_(i,ch_N(str)) { + u8 digit; + if (algo::ParseHex1(str[i],digit)) { + if (cont) { + u8 &val = *ary_Last(parent); + val = val << 4 | digit; + } else { + ary_Alloc(parent) = digit; + } + cont = !cont; + } else { + // allow non-hex chars, just drop continuation flag + cont = false; + } + } + return true; +} diff --git a/cpp/lib/algo/iohook.cpp b/cpp/lib/algo/iohook.cpp index 51662611..a20f5168 100644 --- a/cpp/lib/algo/iohook.cpp +++ b/cpp/lib/algo/iohook.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 // @@ -197,15 +197,22 @@ static inline void IohookWaitClocks_Kqueue(u64 wait_clocks) { #ifdef __linux__ static inline void IohookWaitClocks_Epoll(u64 wait_clocks) { - i32 wait_ms = i32(i64_Min(wait_clocks * algo_lib::_db.clocks_to_ms, 60000)); - // For non-realtime processes, - // avoid taking 100% cpu when wait is < 1 msec. - // Convert all sub-millisecond waits to 1-millisecond waits - if (UNLIKELY(algo_lib::_db.sleep_roundup)) { - wait_ms += wait_clocks > 0 && wait_ms == 0; - } epoll_event events[20]; - int n = epoll_wait(algo_lib::_db.epoll_fd, events, _array_count(events), wait_ms); + int n = 0; + if (algo_lib::_db.use_epoll_pwait2) { + // #AL# if epoll_pwait2 is not available, then sleep time might need + // to be updated to at least 1 msec to avoid taking up 100% cpu for any process + // operating at >1KHz. for now assuming that epoll_pwait2 is always there. + struct timespec twait; + u64 sleep_nsec = i64_Min(wait_clocks * algo_lib::_db.clocks_to_ns, 60*algo::UNTIME_PER_SEC); + twait.tv_sec = sleep_nsec / algo::UNTIME_PER_SEC; + twait.tv_nsec = sleep_nsec % algo::UNTIME_PER_SEC; + n = epoll_pwait2(algo_lib::_db.epoll_fd, events, _array_count(events), &twait, NULL); + } else { + i32 wait_ms = i32(i64_Min(wait_clocks * algo_lib::_db.clocks_to_ms, 60000)); + // WARNING: Any sleep under 1 msec will cause hot-spinning in the process. + n = epoll_wait(algo_lib::_db.epoll_fd, events, _array_count(events), wait_ms); + } for (int i=0; i and code VAL +// The namespace should have a decoder function (decode_Call(*errns_Find(ns), val)) +Errcode algo::MakeErrcode(algo::Errns ns, i64 val) { Errcode ret; + type_Set(ret, ns); code_Set(ret, val); - type_Set(ret, algo_Errns_win); return ret; } @@ -373,28 +387,14 @@ void algo::SetupExitSignals(bool sigint DFLTVAL(true)) { } void algo_lib::bh_timehook_Step() { - // execute all expired time hooks (but no time hook gets executed twice in this loop) algo_lib::FTimehook *timehook = algo_lib::bh_timehook_First(); - u64 clock_thresh = algo_lib::_db.clock;// process all expired timehooks; no timehook gets 2 callbacks - while (timehook && timehook->time < clock_thresh) { - // advance timehook to the future (even if is non-recurrent). - // this means that before the next time it's scheduled with bh_timehook_Reheap, - // it will wait at least DELAY clocks. + if (timehook->recurrent) { timehook->time.value = algo_lib::_db.clock + timehook->delay; - if (timehook->recurrent) { - algo_lib::bh_timehook_ReheapFirst(); - } else { - algo_lib::bh_timehook_RemoveFirst(); - } - hook_Call(*timehook,*timehook); - algo_lib::_db.next_loop = algo_lib::_db.clock; // callback may have created work to do - algo_lib::bh_timehook_UpdateCycles(); - timehook = algo_lib::bh_timehook_First(); - clock_thresh = u64_Max(clock_thresh,3000)-3000;// lower threshold by 1 microsecond to avoid timehook pileup - } - if (timehook) { - algo_lib::_db.next_loop.value = u64_Min(timehook->time.value, algo_lib::_db.next_loop); + algo_lib::bh_timehook_ReheapFirst(); + } else { + algo_lib::bh_timehook_RemoveFirst(); } + hook_Call(*timehook,*timehook); } // ----------------------------------------------------------------------------- @@ -452,18 +452,33 @@ void algo_lib::DieWithParent() { // Anything exec()'ed on top won't work. #else prctl(PR_SET_PDEATHSIG, SIGKILL); + prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); // produce dump as a child #endif } +// Return name of temp directory. +// If it's not already initialized, it is set to the default value: +// temp/ where is taken from argv[0]. +// The directory is created as needed. +algo::strptr algo_lib::GetTempDir() { + if (_db.tempdir == "") { + algo::strptr procname = algo::Pathcomp(algo::strptr(algo_lib::_db.argv[0]), "/RR"); + _db.tempdir << "temp/" << procname; + mkdir("temp",0755); + mkdir(Zeroterm(_db.tempdir),0755);// process-specific subdirectory + } + return _db.tempdir; +} + // Create temporary file // tempfile.fildes points to the new temp file after this -// temp file is created under temp/ +// temp file is created under _db.tempdir // prefix is a namespace-unique name, such as "amc.xyz" -// Actual file that's created becomes "temp/amc.xyz.XXXXXX" +// Actual file that's created becomes "temp/amc/xyz.XXXXXX" // Computed filename is saved to tempfile.filename void algo_lib::TempfileInitX(algo_lib::FTempfile &tempfile, strptr prefix) { if (tempfile.fildes.fd == algo::Fildes()) { - tempfile.filename << "temp/"<builtin)) { + algo::Fildes fildes(logcat->stdout ? 1:2); + if (!LogcatFilterQ(*logcat,str)) { + // filtered out + } else if (algo_lib::_db.show_tstamp || (logcat && !logcat->builtin)) { // rich and slow case + tempstr out; algo::UnTime time = algo::CurrUnTime() - algo::UnDiffSecs(double(get_cycles() - tstamp) / get_cpu_hz()); i32 pos(0); i32 start(0); @@ -46,12 +49,11 @@ void algo::Prlog(algo_lib::FLogcat *logcat, algo::SchedTime tstamp, strptr str) strptr line = ch_GetRegion(str,start,pos-start); start = pos; // advance to next line if (algo_lib::_db.pending_eol) { - WriteFile(fildes,(u8*)line.elems,line.n_elems); + out << line; algo_lib::_db.pending_eol = false; } else { // format log line // time logcat: text - tempstr out; if (algo_lib::_db.show_tstamp) { UnTime_PrintSpec(time,out,algo_lib::_db.tstamp_fmt); } @@ -59,11 +61,12 @@ void algo::Prlog(algo_lib::FLogcat *logcat, algo::SchedTime tstamp, strptr str) out << logcat->logcat <<": "; } out << line; - WriteFile(fildes,(u8*)out.ch_elems,out.ch_n); } } } algo_lib::_db.pending_eol = start != pos; + // write out the temp string with additional annotations + WriteFile(fildes,(u8*)out.ch_elems,out.ch_n); } else { // simple and fast case WriteFile(fildes, (u8*)str.elems, i32(str.n_elems)); @@ -73,3 +76,137 @@ void algo::Prlog(algo_lib::FLogcat *logcat, algo::SchedTime tstamp, strptr str) // do not allow this function to throw exception. } } + +// ----------------------------------------------------------------------------- + +// Enable or disable logcat tracing based on traace expression WHAT +// WHAT is a comma-separated list of logcat regexes, e.g. a,b,c +// Each component can be prefixed with + or -, e.g. +a,-b etc. +// Finally, each component can be a key-value pair, e.g. +a:,-b,+c +// is an optional regex; Regex can be prefixed with ! to indicate a negative match. +// Timestamps can be enabled with 'timestamps', disabled with '-timestamps' +// Verbose can be enabled with 'verbose', disabled with '-verbose' +// Debug can be enabled with 'debug', disabled with '-debug' +int algo_lib::ApplyTrace(algo::strptr what) { + int nmatch=0; + for (; what != ""; what=Pathcomp(what, ",LR")) { + algo::strptr expr=Pathcomp(what,",LL"); + algo::strptr name=Pathcomp(expr,":LL"); + algo::strptr filter=Pathcomp(expr,":LR"); + nmatch += algo_lib::ApplyTrace(name,filter); + } + return nmatch; +} + +// Enable/disable log category NAME with filter FILTER. +// If NAME is prefixed with +, logging is enabled +// If NAME is prefixed with -, logging is disabled +// If NAME is an empty string. current state is printed +// FILTER is a regex +// If FILTER starts with !, it is a negative filter (any matching lines are omitted) +// Return number of logcats affected. +int algo_lib::ApplyTrace(algo::strptr name, algo::strptr filter) { + int change=0; + int nmatch=0; + if (StartsWithQ(name,"+")) { + change=1; + name=ch_RestFrom(name,1); + } else if (StartsWithQ(name,"-")) { + change=-1; + name=ch_RestFrom(name,1); + } else { + change = name != ""; + } + algo::strptr negfilter; + if (StartsWithQ(filter,"!")) { + negfilter=RestFrom(filter,1); + filter=""; + } + if (change<=0 && name=="") { + name="%";// show all, or disable all + } + algo_lib::Regx name_regx; + Regx_ReadSql(name_regx,name,true); + ind_beg(algo_lib::_db_logcat_curs,logcat,algo_lib::_db) { + if (!logcat.builtin && algo_lib::Regx_Match(name_regx, logcat.logcat)) { + nmatch++; + if (change>0) { + logcat.enabled=true; + logcat.nmsg=0;// reset message counter + if (filter!="") { + Regx_ReadSql(logcat.filter,filter,false); + } + if (negfilter!="") { + Regx_ReadSql(logcat.negfilter,negfilter,false); + } + } else if (change<0) { + logcat.enabled=false; + logcat.nmsg=0; + algo::Refurbish(logcat.filter); + algo::Refurbish(logcat.negfilter); + } + if (change) { + // update various internal flags based on logcats being enabled/disabled + // this allows selecting debug / verbose tracing at runtime, + // with regex filters + if (&logcat == &algo_lib_logcat_debug) { + algo_lib::_db.cmdline.debug = logcat.enabled; + } else if (&logcat == &algo_lib_logcat_verbose2) { + u8_UpdateMax(algo_lib::_db.cmdline.verbose, logcat.enabled*2); + } else if (&logcat == &algo_lib_logcat_verbose) { + u8_UpdateMax(algo_lib::_db.cmdline.verbose, logcat.enabled); + } else if (&logcat == &algo_lib_logcat_timestamps) { + algo_lib::_db.show_tstamp = logcat.enabled; + } + } + } + }ind_end; + return nmatch; +} + +void algo_lib::ShowTrace() { + ind_beg(algo_lib::_db_logcat_curs,logcat,algo_lib::_db) if (!logcat.builtin) { + if (logcat.enabled) { + prlog("trace" + << Keyval("target",logcat.logcat) + << Keyval("filter",logcat.filter.expr)); + } + }ind_end; +} + +static void LogcatThrottleCheck(algo_lib::FLogcat &logcat) { + int extra=logcat.nmsg - logcat.maxmsg; + logcat.enabled=logcat.nmsg>0;// re-enable if the message counter was non-zero + logcat.nmsg=0; + if (extra > 0) { + prlog_cat(logcat,extra<<" more messages suppressed"); + } +} + +// Filter string STR for output on LOGCAT. +// The string must match FILTER and not match NEGFILTER. +// The initial state is that filter is empty (uninitialized), so empty filter +// is interpreted as "match all" +// Filter and negfilter are configured with ApplyTrace which parses a trace expression +// In addition, if throttling is enabled on LOGCAT, block message +// if more than MAXMSG are being printed within WINDOW secs. The counter +// is reset every WINDOW secs. +bool algo_lib::LogcatFilterQ(algo_lib::FLogcat &logcat, algo::strptr str) { + bool ret = logcat.enabled + && (logcat.filter.expr.ch_n==0 || algo_lib::Regx_Match(logcat.filter,str)) + && !algo_lib::Regx_Match(logcat.negfilter,str); + if (ret && logcat.maxmsg>0) { + if (logcat.nmsg==0) { + // schedule throttle reset + hook_Set1(logcat.th_throttle, logcat, LogcatThrottleCheck); + algo_lib::ThScheduleIn(logcat.th_throttle, algo::ToSchedTime(double(logcat.window))); + } + logcat.nmsg++;// count number of messages printed + // check throttle + if (logcat.nmsg >= logcat.maxmsg) { + logcat.enabled=false; + ret=false; + } + } + return ret; +} diff --git a/cpp/lib/algo/regx.cpp b/cpp/lib/algo/regx.cpp index 14a4888e..8d7c5b93 100644 --- a/cpp/lib/algo/regx.cpp +++ b/cpp/lib/algo/regx.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 @@ -23,121 +23,335 @@ // Source: cpp/lib/algo/regx.cpp -- Sql Regx implementation // // Regx parser / matcher. -// Supports parentheses, char ranges, ?, *, + (full list of macros below) -// escaped char -> cranges +// Runs "breadth first" instead of the "depth first" (like PRCE / perl), so +// avoids any exponential blowups that come from backtracking. +// There is no backtracking because it matches simultaneously on all paths. +// The main idea: we next state we evaluate is not the most advanced (along the string) state, +// but the least advanced. With .* expressions, this results in minimal matches (usually with regx +// you see maximal matches). +// Supports char ranges, wildcards, anchors, capture groups (LIMITED) +// Has some optimizations, such as matching "a.*" against an infinite string will exit as soon as +// 'a' is matched. +// The idea is described in depth in this article +// https://swtch.com/~rsc/regexp/regexp1.html +// and is called "Thompson NFA" +// Main types: +// Regx - Compiled expression, used to evaluate. +// RegxStyle - One of supported syntax styles: default, shell, sql, acr, literal +// RegxState - an NFA state with assertion bitset, a set of char ranges to match, and a set of output states +// RegxOp - instruction executed by the NFA +// During parsing: +// RegxExpr - Used during parsing; describes an expression as a single input state (in) and a set of output states (out) +// RegxParse - Used during parsing, holds expression stack and other temporary structures #include "include/algo.h" +#include -static algo::RegxMacro _macro[] = { - { 'n' ,"\n"} - ,{'r' ,"\r"} - ,{'t' ,"\t"} - ,{'a' ,"\a"} - ,{'e' ,"\x1b"} // standard way to indicate \e - ,{'v' ,"\v"} - ,{'f' ,"\f"} - ,{'[' ,"[" } - ,{']' ,"]" } - ,{'\\',"\\"} - ,{'$' ,"$" } - ,{'.' ,"." } - ,{'|' ,"|" } - ,{'?' ,"?" } - ,{'*' ,"*" } - ,{'+' ,"+" } - ,{'(' ,"(" } - ,{')' ,")" } - ,{'{' ,"{" } - ,{'}' ,"}" } - ,{'d' ,"0-9" } - ,{'D' ,"^0-9" } - ,{'w' ,"a-zA-Z0-9_"} - ,{'W' ,"^a-zA-Z0-9_"} - ,{'s' ,"\n\r\t\v \f"} - ,{'S' ,"^\n\r\t\v \f"} -}; - -static int RegxState_ReadStrptrChClass(algo_lib::RegxState &state, strptr str); +static int RegxState_ReadStrptrChClass(algo_lib::RegxState &state, strptr str, int i); +static void RewriteRegx(algo::strptr input, algo_lib::RegxStyle style, algo::cstring &out); +static int SingleOutput(algo_lib::Bitset &bitset); // ----------------------------------------------------------------------------- -// Return true if state has a total (all chars allowed) transition. -static bool TotalQ(algo_lib::RegxState &state) { - bool ret=false; - ind_beg(algo_lib::RegxState_ch_class_curs,ch_class,state) { - if (ch_class == algo::i32_Range(0,INT_MAX)) { - ret=true; - break; - } - }ind_end; +static inline u16 ChRange(u16 beg, u16 end) { + return (beg<<8) | (end-1); +} +static inline u16 ChRangeBeg(u16 ch_range) { + return (ch_range>>8)&0xff; +} +static inline u16 ChRangeEnd(u16 ch_range) { + return (ch_range & 0xff)+1; +} +static inline bool ChRangeContains(u16 ch_range, u16 ch) { + return ch >= ChRangeBeg(ch_range) && ch < ChRangeEnd(ch_range); +} + +static void ary_AllocSetBit(algo_lib::Bitset &bitset, int n) { + ary_AllocBit(bitset, n); + ary_qSetBit(bitset, n); +} +static void TraceParse(algo_lib::RegxParse ®xparse, int i, int phase) { + if (phase==0) { //parse + prlog("parse: " + <out, regx.accept) && TotalQ(*state); - if (ret) { - break; - } - } - }ind_end; + // for each state, calculate if reaching this state means reaching accept state. + // this is true IF: + // - state has a true arc to another state that has a true arc to accept, and back to this state. between the two states, 1 character is consumed + if (state_N(regx)>0) { + int nchange=0; + do { + nchange=0; + ind_beg(algo_lib::regx_state_curs,state,regx) if (!AcceptAllQ(state.op) && (state.op.op == algo_lib_RegxOp_true)) { + ind_beg(algo_lib::Bitset_ary_bitcurs,id,state.next) { + algo_lib::RegxState &other = state_qFind(regx, id); + bool x2 = AcceptAllQ(other.op) || + ((other.op.op == algo_lib_RegxOp_true) + && (state.op.consume + other.op.consume == 1) + && NextAcceptQ(regx,other) + && ary_GetBit(other.next, ind_curs(state).index)); + if (x2) { + state.op=algo_lib::RegxOp(algo_lib_RegxOp_accept,1,1); + other.op=algo_lib::RegxOp(algo_lib_RegxOp_accept,1,1); + nchange++; + break; + } + }ind_end; + }ind_end; + } while (nchange>0); + accepts_all_Set(regx.flags,AcceptAllQ(state_qFind(regx,0).op)); } - regx.accepts_all=ret; +} + +// ----------------------------------------------------------------------------- - // see if reaching some state implies inevitably reaching accept state - // Need a local cycle plus an arc to accept. - // (just an arc to accept would mean the string must end here). +// if state STATE leads to state OTHER +// which is a TRUE op consuming zero chars, then +// skip the OTHER state +static void RemoveBranches(algo_lib::Regx ®x) { + algo_lib::Bitset next; + ary_ExpandBits(next,state_N(regx)); ind_beg(algo_lib::regx_state_curs,state,regx) { - state.accept_all = ary_GetBit(state.out, regx.accept) - && ary_GetBit(state.out, ind_curs(state).index) - && TotalQ(state); + int nmatch=0; + do { + ary_Setary(next,state.next); + nmatch=0; + ind_beg(algo_lib::Bitset_ary_bitcurs,id,state.next) { + algo_lib::RegxState &other = state_qFind(regx, id); + if (other.op.op == algo_lib_RegxOp_true && other.op.consume == 0) { + ary_OrBits(next, other.next); + ary_ClearBit(next, id); + nmatch++; + } + }ind_end; + if (nmatch) { + ary_Setary(state.next,next); + } + }while(nmatch>0); }ind_end; } // ----------------------------------------------------------------------------- +// Negate the character ranges matched by STATE.CH_CLASS +// For instance, if CH_CLASS matches a..z, then after this function +// it will match anything BUT a..z +static void Negate(algo::U16Ary &ch_class) { + // replace list of ranges with a complementary one over 0..255 + // this may add or remove a state. + int k = 0; + int L = 0; + frep_(idx, ary_N(ch_class)) { + u16 R = ary_qFind(ch_class, idx); + if (L < ChRangeBeg(R)) { + ary_qFind(ch_class, k) = ChRange(L,ChRangeBeg(R)); + k++; + } + L = ChRangeEnd(R); + } + if (L < 256) { + ary_Alloc(ch_class) = ChRange(L,256); + k++; + } + ch_class.ary_n = k; // trim +} + +// ----------------------------------------------------------------------------- + +static void OptimizeChClass(algo_lib::RegxState &state) { + // sort list of ranges + // remove overlaps + // coalesce touching ranges + if (state.op.op == algo_lib_RegxOp_charrange) { + std::sort(state.ch_class.ary_elems, state.ch_class.ary_elems + state.ch_class.ary_n); + //ary_QuickSort(ch_class); + int prev = -1; + int end = 0; + frep_(idx,ary_N(state.ch_class)) { + u16 R = ary_qFind(state.ch_class, idx); + u16 Rbeg = ChRangeBeg(R); + u16 Rend = ChRangeEnd(R); + Rbeg = i32_Max(Rbeg, end); // remove overlap + int new_end = i32_Max(end, Rend); + if (prev>=0 && Rbeg == end) { // coalesce + u16 &Rprev=ary_qFind(state.ch_class, prev); + Rprev=ChRange(ChRangeBeg(Rprev), new_end); + Rend = 0; + } + end = new_end; + if (Rend > Rbeg) { + prev++; + ary_qFind(state.ch_class, prev) = ChRange(Rbeg,Rend); + } + } + state.ch_class.ary_n = prev + 1; + // rewrite single-character ranges as a simpler test + // rewrite a full char range range as true + if (ary_N(state.ch_class)==1) { + u16 R=ary_qFind(state.ch_class,0); + u16 Rbeg =ChRangeBeg(R); + u16 Rend =ChRangeEnd(R); + if (Rend==Rbeg+1) { + ary_RemoveAll(state.ch_class); + state.op.op=algo_lib_RegxOp_char; + state.op.imm=Rbeg; + } else if (Rbeg==0 && Rend==256) { + ary_RemoveAll(state.ch_class); + state.op.op=algo_lib_RegxOp_true; + state.op.imm=0; + } + } + } +} + +// ----------------------------------------------------------------------------- + +// Add character range BEG..END (INCLUSIVE!) +// to STATE. +static void AddCharRange(algo::U16Ary &ch_class, int beg, int end=0) { + // this range is EXCLUSIVE + if (end==0) { + end=beg; + } + ary_Alloc(ch_class) = ChRange(beg,end+1); +} + // C escaped character // STATE out char class. -// Parses escaped chars such as d->digit, w->word, s->space, $->$ -static bool RegxState_ReadChar(algo_lib::RegxState &state, char c) { - bool retval = false; - algo::aryptr _g_macro(_macro,sizeof(_macro)/sizeof(_macro[0])); - ind_beg_aryptr(algo::RegxMacro,macro,_g_macro) { - if (c == macro.c) { - RegxState_ReadStrptrChClass(state, macro.crange); - retval = true; - break; - } - }ind_end_aryptr; - return retval; +// Parses escaped chars such as +// n->newline +// d->digit +// w->word +// s->space etc. +// Non-macro characters are read verbatim (i.e. the leading backslash is ignored). +static bool RegxState_ReadMacro(algo_lib::RegxState &state, char c) { + algo::U16Ary temp; + bool neg=false; + switch (c) { + case 'n': AddCharRange(temp,'\n'); break; + case 'r': AddCharRange(temp,'\r'); break; + case 't': AddCharRange(temp,'\t'); break; + case 'a': AddCharRange(temp,'\a'); break; + case 'e': AddCharRange(temp,'\x1b'); break; + case 'v': AddCharRange(temp,'\v'); break; + case 'f': AddCharRange(temp,'\f'); break; + case 'D': + neg=true; + AddCharRange(temp,'0','9'); + break; + case 'd': + AddCharRange(temp,'0','9'); + break; + case 'W': + neg=true; + AddCharRange(temp,'a','z'); + AddCharRange(temp,'A','Z'); + AddCharRange(temp,'0','9'); + AddCharRange(temp,'_'); + break; + case 'w': + AddCharRange(temp,'a','z'); + AddCharRange(temp,'A','Z'); + AddCharRange(temp,'0','9'); + AddCharRange(temp,'_'); + break; + case 'S': + neg=true; + AddCharRange(temp,'\n'); + AddCharRange(temp,'\r'); + AddCharRange(temp,'\t'); + AddCharRange(temp,'\v'); + AddCharRange(temp,' '); + AddCharRange(temp,'\f'); + break; + case 's': + AddCharRange(temp,'\n'); + AddCharRange(temp,'\r'); + AddCharRange(temp,'\t'); + AddCharRange(temp,'\v'); + AddCharRange(temp,' '); + AddCharRange(temp,'\f'); + break; + default: + AddCharRange(temp,c); + } + if (neg) { + Negate(temp); + } + ary_Addary(state.ch_class,ary_Getary(temp)); + return true; } // ----------------------------------------------------------------------------- // STR char range string in the form \^?(A(-B)?)+ // STATE output char class -// RETURN number of chars processed. -// function stops at ] (doesn't skip) or end of string -static int RegxState_ReadStrptrChClass(algo_lib::RegxState &state, strptr str) { - int i=0; - bool neg = elems_N(str) && str[0]=='^'; - i += neg; +// I starting char index +// RETURN ending char index +// function stops at ] (DOESN'T SKIP) or end of string +static int RegxState_ReadStrptrChClass(algo_lib::RegxState &state, strptr str, int i) { + bool neg = false; + if (i0 && c==']') { + if (c==']') { break; } - if (next && c=='\\' && RegxState_ReadChar(state, (char)next)) { + if (next && c=='\\' && RegxState_ReadMacro(state, (char)next)) { i++; continue; } @@ -145,85 +359,30 @@ static int RegxState_ReadStrptrChClass(algo_lib::RegxState &state, strptr str) { c2=u8(str[i+2])+1; i+=2; } - ch_class_Alloc(state) = algo::i32_Range(c,u32_Max(c2,c+1)); + c2=u32_Max(c2,c+1); + ary_Alloc(ch_class) = ChRange(c,c2); } - - // - // normalize - // sort list of ranges - // remove overlaps - // coalesce touching ranges - // - ch_class_QuickSort(state); - int prev = -1; - int end = 0; - frep_(idx,ch_class_N(state)) { - algo::i32_Range R = ch_class_qFind(state, idx); - R.beg = i32_Max(R.beg, end); // remove overlap - int new_end = i32_Max(end, R.end); - if (prev>=0 && R.beg == end) { // coalesce - ch_class_qFind(state, prev).end = new_end; - R.end = 0; - } - end = new_end; - if (R.end > R.beg) { - prev++; - ch_class_qFind(state, prev) = R; - } - } - // trim - state.ch_class_n = prev + 1; - - // negate if (neg) { - // replace list of ranges with a complementary one - // (over 0..INT_MAX) - // this may add or remove a state. - // - int k = 0; - int L = 0; - frep_(idx, ch_class_N(state)) { - algo::i32_Range R = ch_class_qFind(state, idx); - if (L < R.beg) { - ch_class_qFind(state, k) = algo::i32_Range(L,R.beg); - k++; - } - L = R.end; - } - if (L < INT_MAX) { - ch_class_Alloc(state) = algo::i32_Range(L,INT_MAX); - k++; - } - state.ch_class_n = k; // trim + Negate(ch_class); } return i; } // ----------------------------------------------------------------------------- -static algo_lib::RegxState& NewState(algo_lib::RegxParse ®xparse) { - algo_lib::RegxExpr &E = ary_expr_Alloc(regxparse); - type_SetEnum(E.type, algo_lib_RegxToken_type_expr); - int s = state_N(*regxparse.p_regx); - E.in = s; - algo_lib::RegxState &S = state_Alloc(*regxparse.p_regx); - ary_AllocBit(E.out, s); - ary_qSetBit(E.out, s); - return S; -} - -// ----------------------------------------------------------------------------- - -static void AddOut(algo_lib::Regx ®x, algo_lib::RegxExpr &E, int out) { - ind_beg(algo_lib::Bitset_ary_bitcurs,id,E.out) { +// Add TO as a next for all of E's next states. +static void Connect(algo_lib::Regx ®x, algo_lib::RegxExpr &E, int to) { + ind_beg(algo_lib::Bitset_ary_bitcurs,id,E.last) { algo_lib::RegxState &state = state_qFind(regx, id); - ary_AllocBit(state.out, out); - ary_qSetBit(state.out, out); + ary_AllocSetBit(state.next, to); }ind_end; } // ----------------------------------------------------------------------------- +// Look at the expression stack. +// If the last iten is an expression with precedence <= type, return the top expression. +// Otherwise return NULL static algo_lib::RegxExpr *RegxExpr_Last(algo_lib::RegxParse ®xparse, algo_lib::RegxToken type) { algo_lib::RegxExpr *retval = NULL; if (ary_expr_N(regxparse) > 0) { @@ -240,7 +399,8 @@ static algo_lib::RegxExpr *RegxExpr_Last(algo_lib::RegxParse ®xparse, algo_li // stack precedence action // A B >=EXPR concat // A|B >=OR alternate -static void Reduce(algo_lib::RegxParse ®xparse, algo_lib::Regx ®x, int prec) { +static void Reduce(algo_lib::RegxParse ®xparse, int prec) { + algo_lib::Regx ®x = *regxparse.p_regx; int n; bool reduce; do { @@ -248,83 +408,57 @@ static void Reduce(algo_lib::RegxParse ®xparse, algo_lib::Regx ®x, int pre if (n<2) { break; } + ary_expr_Reserve(regxparse,1);// prevent crash later algo_lib::RegxExpr &A = ary_expr_qFind(regxparse, n-2); algo_lib::RegxExpr &B = ary_expr_qFind(regxparse, n-1); - algo_lib::RegxToken t1 = A.type; - algo_lib::RegxToken t2 = B.type; reduce = false; - if (prec >= algo_lib_RegxToken_type_expr && t1 == algo_lib_RegxToken_type_expr && t2 == algo_lib_RegxToken_type_expr) { - AddOut(regx, A, B.in);// concat - algo::TSwap(A.out,B.out); + if ((prec >= algo_lib_RegxToken_type_start && A.type == algo_lib_RegxToken_type_start && B.type == algo_lib_RegxToken_type_expr) + || (prec >= algo_lib_RegxToken_type_expr && A.type == algo_lib_RegxToken_type_expr && B.type == algo_lib_RegxToken_type_expr)) { + Connect(regx, A, B.first);// connect A->B + algo::TSwap(A.last,B.last);// B's outputs are new expression's outputs + ary_expr_RemoveLast(regxparse);// delete B reduce=true; - } - if (prec >= algo_lib_RegxToken_type_or && t1 == algo_lib_RegxToken_type_or && t2 == algo_lib_RegxToken_type_expr) { - int s = state_N(regx); - algo_lib::RegxState &S = state_Alloc(regx); - ary_AllocBit(S.out, A.in); - ary_qSetBit(S.out, A.in); - ary_AllocBit(S.out, B.in); - ary_qSetBit(S.out, B.in); - - - // copy B to A. - // first stretch A. - while (ary_N(A.out) < ary_N(B.out)) { - ary_Alloc(A.out) = 0; - } - ary_OrBits(A.out,B.out); - - A.in = s; - type_SetEnum(A.type, algo_lib_RegxToken_type_expr); + } else if (prec >= algo_lib_RegxToken_type_or && A.type == algo_lib_RegxToken_type_or && B.type == algo_lib_RegxToken_type_expr) { + // A=expression to the left of | + // B=expression to the right of | + // new state branching into A and B + algo_lib::RegxState &state=NewState(regx,algo_lib::RegxOp(algo_lib_RegxOp_true,0,0)); + // branch + ary_AllocSetBit(state.next, A.first); + ary_AllocSetBit(state.next, B.first); + A.first=state_N(regx)-1; + A.type = algo_lib_RegxToken_type_expr; + ary_ExpandBits(A.last,state_N(regx)); + ary_OrBits(A.last,B.last); + ary_expr_Remove(regxparse,n-1);// delete B reduce=true; } - if (!reduce) { - break; - } - ary_expr_RemoveLast(regxparse); - } while (true); -} - -// ----------------------------------------------------------------------------- - -// eliminate states with empty char classes, -// adding their outputs to their predecessors' inputs. -static void ClearBubbles(algo_lib::Regx ®x) { - algo_lib::Bitset &clear = regx.front; - algo_lib::Bitset &set = regx.next_front; - bool changed; - do { - changed = false; - ind_beg_aryptr(algo_lib::RegxState,S,state_Getary(regx)) { - ary_ClearBitsAll(clear); - ary_ClearBitsAll(set ); - ind_beg(algo_lib::Bitset_ary_bitcurs,out,S.out) { - algo_lib::RegxState &next = state_qFind(regx, out); - if (ary_qGetBit(S.out, out) && !ch_class_N(next)) { - ary_qSetBit (clear, out); - ary_OrBits(set , next.out); - changed = true; - } - }ind_end; - ary_OrBits (S.out, set); - ary_ClearBits(S.out, clear); - }ind_end_aryptr; - } while (changed); + } while (reduce); } // ----------------------------------------------------------------------------- -static bool ZeroOrMore(algo_lib::RegxParse ®xparse, algo_lib::Regx ®x) { +static bool ZeroOrMore(algo_lib::RegxParse ®xparse) { + algo_lib::Regx ®x = *regxparse.p_regx; bool processed = false; if (algo_lib::RegxExpr *regx_expr = RegxExpr_Last(regxparse, algo_lib_RegxToken_type_expr)) { int n = state_N(regx); - algo_lib::RegxState &state = state_Alloc(regx); - ary_AllocBit(state.out, regx_expr->in); - ary_qSetBit(state.out, regx_expr->in); - AddOut(regx, *regx_expr, n); - ary_AllocBit(regx_expr->out,n); - ary_qSetBit(regx_expr->out,n); - regx_expr->in = n; + algo_lib::RegxState &state = NewState(regx,algo_lib::RegxOp(algo_lib_RegxOp_true,0,0)); + ary_AllocSetBit(state.next, regx_expr->first);// leads to expression + Connect(regx, *regx_expr, n);// expr goes back here + + ary_AllocSetBit(regx_expr->last,n); + regx_expr->first = n; + processed = true; + } + return processed; +} + +static bool OneOrMore(algo_lib::RegxParse ®xparse) { + bool processed=false; + algo_lib::Regx ®x = *regxparse.p_regx; + if (algo_lib::RegxExpr *regx_expr = RegxExpr_Last(regxparse, algo_lib_RegxToken_type_expr)) { + Connect(regx, *regx_expr, regx_expr->first);// jump to beginning processed = true; } return processed; @@ -332,42 +466,65 @@ static bool ZeroOrMore(algo_lib::RegxParse ®xparse, algo_lib::Regx ®x) { // ----------------------------------------------------------------------------- -static bool LeftParen(algo_lib::RegxParse ®xparse, algo_lib::Regx ®x) { - Reduce(regxparse,regx,algo_lib_RegxToken_type_expr); - algo_lib::RegxExpr ®x_expr = ary_expr_Alloc(regxparse); - regx_expr.type = algo_lib_RegxToken_type_lparen; +// Push left paren to the parsing stack +static bool LeftParen(algo_lib::RegxParse ®xparse) { + NewExprState(regxparse,algo_lib::RegxOp(algo_lib_RegxOp_lparen,0,regxparse.nextgroup++)); + ary_expr_qLast(regxparse).type = algo_lib_RegxToken_type_lparen; return true; } // ----------------------------------------------------------------------------- -static bool RightParen(algo_lib::RegxParse ®xparse, algo_lib::Regx ®x) { - bool processed = false; - Reduce(regxparse,regx,algo_lib_RegxToken_type_or); - int n = ary_expr_N(regxparse); - if (n >= 2) { - algo_lib::RegxExpr &A = ary_expr_qFind(regxparse, n-2); - algo_lib::RegxExpr &B = ary_expr_qFind(regxparse, n-1); - if (A.type==algo_lib_RegxToken_type_lparen && B.type==algo_lib_RegxToken_type_expr) { - ary_expr_Remove(regxparse, n-2); - processed = true; - } +static bool RightParen(algo_lib::RegxParse ®xparse) { + algo_lib::Regx ®x=*regxparse.p_regx; + bool processed=false; + algo_lib::RegxExpr *A = ary_expr_Find(regxparse, ary_expr_N(regxparse)-2); + algo_lib::RegxExpr *B = ary_expr_Find(regxparse, ary_expr_N(regxparse)-1); + if (B && B->type == algo_lib_RegxToken_type_lparen) { + // empty parentheses + int n=state_N(regx); + algo_lib::RegxState &state=NewState(regx,algo_lib::RegxOp(algo_lib_RegxOp_rparen,0,0)); + state.op.imm=state_qFind(regx,A->first).op.imm;// copy capture group + Connect(regx, *B, n); + B->type = algo_lib_RegxToken_type_expr; + ary_ClearBitsAll(B->last); + ary_AllocSetBit(B->last, n); + processed=true; + } else if (A && B && A->type == algo_lib_RegxToken_type_lparen && B->type == algo_lib_RegxToken_type_expr) { + // create rparen state, needed for the capturegroup + int n=state_N(regx); + algo_lib::RegxState &state=NewState(regx,algo_lib::RegxOp(algo_lib_RegxOp_rparen,0,0)); + state.op.imm=state_qFind(regx,A->first).op.imm;// copy capture group + Connect(regx, *A, B->first); + Connect(regx, *B, n); + A->type = algo_lib_RegxToken_type_expr; + ary_ClearBitsAll(A->last); + ary_AllocSetBit(A->last, n); + ary_expr_RemoveLast(regxparse); + processed=true; } return processed; } // ----------------------------------------------------------------------------- -static bool ZeroOrOne(algo_lib::RegxParse ®xparse, algo_lib::Regx ®x) { +static bool ZeroOrOne(algo_lib::RegxParse ®xparse) { + algo_lib::Regx ®x = *regxparse.p_regx; bool processed = false; + // find expression on the top of the stack + // it has a single "first" state and multiple "last" (exit) states. + // these are all the states that lead to a match if (algo_lib::RegxExpr *regx_expr = RegxExpr_Last(regxparse, algo_lib_RegxToken_type_expr)) { - int n = state_N(regx); - algo_lib::RegxState &state = state_Alloc(regx); - ary_AllocBit(state.out, regx_expr->in); - ary_qSetBit(state.out, regx_expr->in); - ary_AllocBit(regx_expr->out,n); - ary_qSetBit(regx_expr->out,n); - regx_expr->in=n; + // create a new state, this will fork into + // the existing expression and straight through to exit + // set the entry point of the expression to the new state + int n = state_N(regx); + algo_lib::RegxState &state=NewState(regx,algo_lib::RegxOp(algo_lib_RegxOp_true,0,0)); + // new state -> existing expression + ary_AllocSetBit(state.next,regx_expr->first); + regx_expr->first = n; + // add new state to the list of exit states + ary_AllocSetBit(regx_expr->last,n); processed = true; } return processed; @@ -375,24 +532,24 @@ static bool ZeroOrOne(algo_lib::RegxParse ®xparse, algo_lib::Regx ®x) { // ----------------------------------------------------------------------------- -static bool LeftBracket(algo_lib::RegxParse ®xparse, algo_lib::Regx ®x, int &i) { - Reduce(regxparse,regx,algo_lib_RegxToken_type_expr); - algo_lib::RegxState &state = NewState(regxparse); - int j = RegxState_ReadStrptrChClass(state, regxparse.input); +static bool LeftBracket(algo_lib::RegxParse ®xparse, int &i) { + algo_lib::RegxState &state = NewExprState(regxparse); + int j = RegxState_ReadStrptrChClass(state, regxparse.input, i+1); if (jtype = algo_lib_RegxToken_type_or; processed = true; @@ -402,11 +559,11 @@ static bool Or(algo_lib::RegxParse ®xparse, algo_lib::Regx ®x) { // ----------------------------------------------------------------------------- -static bool Backslash(algo_lib::RegxParse ®xparse, algo_lib::Regx ®x, int &i) { +static bool Backslash(algo_lib::RegxParse ®xparse, int &i) { bool processed = false; - Reduce(regxparse,regx,algo_lib_RegxToken_type_expr); - algo_lib::RegxState &state = NewState(regxparse); - if (i < elems_N(regxparse.input)-1 && RegxState_ReadChar(state, regxparse.input[i+1])) { + algo_lib::RegxState &state = NewExprState(regxparse); + if (i < elems_N(regxparse.input)-1 && RegxState_ReadMacro(state, regxparse.input[i+1])) { + if(trace_Get(regxparse.p_regx->flags)) prlog("processed escape character... result: "<0) { + tempstr newstr; + while (i!=-1) { + algo_lib::RegxState &state=state_qFind(regx,i); + if (state.op.op == algo_lib_RegxOp_char) { + newstr << char(state.op.imm); + } else if (state.op.op==algo_lib_RegxOp_true && state.op.consume==0) { + // allow -- simple branch + } else if (state.op.op==algo_lib_RegxOp_accept && state.op.imm==0) {// end-of-string accept + // expr could be "[a]" but we don't want to rewrite it + literal_Set(regx.flags, newstr==regx.expr); + break; + } else { + return;// not literal -- char range etc. + } + i = SingleOutput(state.next); + } + } } // ----------------------------------------------------------------------------- // parse regex string -static void RunRegxParse(algo_lib::RegxParse ®xparse) { +static void Parse(algo_lib::RegxParse ®xparse) { algo_lib::Regx ®x = *regxparse.p_regx; - RegxReset(regx); + // create start state, #0 by convention + NewExprState(regxparse,algo_lib::RegxOp(algo_lib_RegxOp_true,0,0)); + ary_expr_qFind(regxparse,0).type = algo_lib_RegxToken_type_start; for (int i=0; iin); - processed = true; - } + processed = OneOrMore(regxparse); break; case '?': - processed = ZeroOrOne(regxparse,regx); + processed = ZeroOrOne(regxparse); break; case '|': - processed = Or(regxparse,regx); + Reduce(regxparse,algo_lib_RegxToken_type_expr); + processed = Or(regxparse); break; case '(': - processed = LeftParen(regxparse,regx); + Reduce(regxparse,algo_lib_RegxToken_type_expr); + processed = LeftParen(regxparse); break; case ')': - processed = RightParen(regxparse,regx); + Reduce(regxparse,algo_lib_RegxToken_type_or); + processed = RightParen(regxparse); break; case '\\': - processed = Backslash(regxparse,regx,i); + Reduce(regxparse,algo_lib_RegxToken_type_expr); + processed = Backslash(regxparse,i); break; case '.': { - Reduce(regxparse,regx,algo_lib_RegxToken_type_expr); - algo_lib::RegxState &state = NewState(regxparse); - ch_class_Alloc(state) = algo::i32_Range(0,INT_MAX); + Reduce(regxparse,algo_lib_RegxToken_type_expr); + NewExprState(regxparse,algo_lib::RegxOp(algo_lib_RegxOp_true,1,0)); processed = true; } break; + case '^': + { + Reduce(regxparse,algo_lib_RegxToken_type_expr); + NewExprState(regxparse,algo_lib::RegxOp(algo_lib_RegxOp_stringbeg,0,0)); + processed=true; + } + break; + case '$': + { + Reduce(regxparse,algo_lib_RegxToken_type_expr); + NewExprState(regxparse,algo_lib::RegxOp(algo_lib_RegxOp_stringend,0,0)); + processed=true; + } + break; case '[': - processed=LeftBracket(regxparse,regx,i); + Reduce(regxparse,algo_lib_RegxToken_type_expr); + processed=LeftBracket(regxparse,i);// adjusts i break; case ']': + // real right bracket was eaten by LeftBracket + // this is a sole character break; default: - { // take char as-is - Reduce(regxparse,regx,algo_lib_RegxToken_type_expr); - algo_lib::RegxState &state = NewState(regxparse); - ch_class_Alloc(state) = algo::i32_Range(u8(c),u8(c+1)); - processed = true; - } break; } if (!processed) {// don't know what to do with this char -- take it verbatim - regx.parseerror = true;// non-fatal - Reduce(regxparse,regx,algo_lib_RegxToken_type_expr); - algo_lib::RegxState &state = NewState(regxparse); - ch_class_Alloc(state) = algo::i32_Range(u8(c),u8(c+1)); + Reduce(regxparse,algo_lib_RegxToken_type_expr); + NewExprState(regxparse,algo_lib::RegxOp(algo_lib_RegxOp_char,1,c)); } - } - Reduce(regxparse,regx,algo_lib_RegxToken_type_or); - if (ary_expr_N(regxparse)>=1) { - algo_lib::RegxExpr ®x_expr = ary_expr_qFind(regxparse, 0); - ary_AllocBit(regx.front , state_N(regx)); - ary_AllocBit(regx.next_front, state_N(regx)); - ary_AllocBit(regx.start , state_N(regx)); - int acc = state_N(regx); - ch_class_Alloc(state_Alloc(regx)) = algo::i32_Range(0,INT_MAX); - AddOut(regx, regx_expr, acc); - int start = regx_expr.in; - ClearBubbles(regx); - if (ch_class_N(state_qFind(regx, start)) > 0) { - ary_qSetBit(regx.start, start); - } else { - ary_OrBits(regx.start, state_qFind(regx, start).out); + if (trace_Get(regx.flags)) { + TraceParse(regxparse,i,0); } - regx.accept = acc; - } else { - regx.parseerror=true;// non-fatal } + Reduce(regxparse,algo_lib_RegxToken_type_or); + NewExprState(regxparse,algo_lib::RegxOp(algo_lib_RegxOp_accept,0,0)); + Reduce(regxparse,algo_lib_RegxToken_type_start);// ultimate reduce + if (ary_expr_N(regxparse)>1) { + // couldn't reduce expression stack. + // probably unmatched parenthesis... + valid_Set(regx.flags,false); + } + ind_beg(algo_lib::regx_state_curs,state,regx) { + OptimizeChClass(state); + }ind_end; + CalcLiteral(regx); CalcAcceptsAllQ(regx); + RemoveBranches(regx); + if (trace_Get(regx.flags)) { + TraceParse(regxparse,0,1); + } } // ----------------------------------------------------------------------------- @@ -522,238 +721,417 @@ void algo_lib::Regx_Print(algo_lib::Regx ®x, algo::cstring &lhs) { lhs << regx.expr; } +void algo_lib::RegxState_Print(algo_lib::RegxState &state, algo::cstring &lhs) { + lhs << ToDbgString(state,-1); +} + // ----------------------------------------------------------------------------- static bool ScanString(algo_lib::Regx ®x, const algo::strptr &text) { - ary_ClearBitsAll(regx.next_front); - ary_Setary(regx.front, regx.start); - ind_beg_aryptr(char,c,text) {// scan the string - u32 match = 0; - ind_beg(algo_lib::Bitset_ary_bitcurs,idx,regx.front) { + algo_lib::RegxM ®xm = algo_lib::_db.regxm;// temporary matching context + ary_RemoveAll(regxm.matchrange); + ary_RemoveAll(regxm.front); + ary_RemoveAll(regxm.next_char); + ary_RemoveAll(regxm.this_char); + ary_ExpandBits(regxm.front,regx.state_n); + ary_ExpandBits(regxm.next_char,regx.state_n); + ary_ExpandBits(regxm.this_char,regx.state_n); + ary_qSetBit(regxm.front, 0); + int ch_index=0; + while (true) { + int nthis=0; + u16 ch=ch_index < text.n_elems ? u8(text.elems[ch_index]) : 0xffff; + if (trace_Get(regx.flags)) { + prlog("scanning" + <= r.beg && u8(c) < r.end) { - match++; - ary_OrBits(regx.next_front, state.out); - break; + if (test) { + // carry lparen memory forward... + if (capture_Get(regx.flags)) { + ind_beg(algo_lib::Bitset_ary_bitcurs,next,state.next) { + state_qFind(regx,next).lparen=state.lparen; + }ind_end; } - }ind_end_aryptr; + if (state.op.consume) { + ary_OrBits(regxm.next_char, state.next); + } else { + ary_OrBits(regxm.this_char, state.next); + nthis++; + } + } }ind_end; - ary_ClearBitsAll(regx.front); - // is swapping arrays like this legal? - algo::TSwap(regx.front,regx.next_front); - if (!match) { + if (ntest==0) {// empty front -> exit break; } - }ind_end_aryptr; - return ary_qGetBit(regx.front,regx.accept); + if (trace_Get(regx.flags)) { + prlog(" result" + <0) { + ary_ClearBitsAll(regxm.front); + algo::TSwap(regxm.front,regxm.this_char); + } else { + if (ch_index >= text.n_elems) { + break; + } + ary_ClearBitsAll(regxm.front); + algo::TSwap(regxm.front,regxm.next_char); + ch_index++; + // keep processing non-consuming states... + } + } + return false; } // ----------------------------------------------------------------------------- -// Check if REGX matches S, return result +// Check if REGX matches TEXT, return result bool algo_lib::Regx_Match(algo_lib::Regx ®x, algo::strptr text) { bool ret = false; - if (regx.accepts_all) { - ret = true;// matches all strings - } else if (regx.literal) { + if (literal_Get(regx.flags)) { ret = regx.expr == text;// matches literally - } else if (ary_N(regx.front) == 0) { - ret = text.n_elems == 0; // matches empty string only + } else if (accepts_all_Get(regx.flags)) { + ret = true; + } else if (regx.state_n==0) { + ret = text.n_elems==0;// can only match empty stringh } else { ret = ScanString(regx,text); } - //prerr(regx.expr<<" // "<< text << " // "<0) { + ret=ary_qFind(_db.regxm.matchrange,0); + ret.beg += start; + ret.end += start; + } + } + return ret; } // ----------------------------------------------------------------------------- -// Parse bash-style regx: -// * -> .* -// ? -> .? -// All other regx chars are escaped away -// if FULL is set to false, input is treated as ".*input.*" -void algo_lib::Regx_ReadShell(algo_lib::Regx ®x, algo::strptr input, bool full) { +void algo_lib::Regx_ReadStyle(algo_lib::Regx ®x, algo::strptr input, algo_lib::RegxStyle style, bool full) { + valid_Set(regx.flags,true); + literal_Set(regx.flags,false); + accepts_all_Set(regx.flags,false); + fullmatch_Set(regx.flags,full); + state_RemoveAll(regx); + regx.style = style; regx.expr = input; - regx.literal=true; - tempstr regx_str; - if (!full) { - regx.literal=false; - regx_str << ".*"; - } - frep_(i,elems_N(input)) { - switch(input[i]) { - case '*': - regx_str<<".*"; - regx.literal=false; - break; - case '?': - regx_str<<".?"; - regx.literal=false; - break; - case '.': - case '\\': - case '[': - case ']': - case '(': - case ')': - regx.literal=false; - regx_str<<'\\'< % - case '_' : regx_str<<"_" ; break; // \_ -> _ - case '\\': regx_str<<'\\'< \\ ... - case '(' : regx_str<<'\\'< \( - case ')' : regx_str<<'\\'< \) - case '|' : regx_str<<'\\'< \| - default : regx_str<<'\\'< \$X - } - } else { - switch(input[i]) { - case '\\': escape = true ; regx.literal=false; break; // - case '%' : regx_str<<".*" ; regx.literal=false; break; // % -> .* - case '_' : regx_str<<"." ; regx.literal=false; break; // _ -> . - case '.' : - case '*' : - case '?' : - case '+' : regx_str<<'\\'< \+, etc. - case '|' : - case '(' : - case ')' : - case '[' : - case ']' : regx_str< \+ - default : regx_str< $X - } - } - } - if (!full) { - regx_str << ".*"; - } - algo_lib::RegxParse regxparse; - regxparse.input = regx_str; - regxparse.p_regx = ®x; - ::RunRegxParse(regxparse); + Regx_ReadStyle(regx,input,algo_lib_RegxStyle_sql,full); +} +void algo_lib::Regx_ReadAcr(algo_lib::Regx ®x, algo::strptr input, bool full) { + Regx_ReadStyle(regx,input,algo_lib_RegxStyle_acr,full); +} +// Set REGX to match string INPUT literally +void algo_lib::Regx_ReadLiteral(algo_lib::Regx ®x, algo::strptr input) { + Regx_ReadStyle(regx,input,algo_lib_RegxStyle_literal,true); +} +bool algo_lib::Regx_ReadStrptrMaybe(algo_lib::Regx ®x, algo::strptr input) { + Regx_ReadSql(regx,input,true); + return true; } // ----------------------------------------------------------------------------- -// Parse ACR-style regx: -// % is rewritten as .* -// (, ), [, ], _ are passed through -// ., *, ?, + are escaped -// if FULL is set to false, input is treated as ".*input.*" -// If the input expression can be matched as a string, set REGX.LITERAL to true -void algo_lib::Regx_ReadAcr(algo_lib::Regx ®x, algo::strptr input, bool full) { - regx.expr = input; - regx.literal=true; - tempstr regx_str; - if (!full) { - regx.literal=false; - regx_str << ".*"; +algo::tempstr algo_lib::ToDbgString(algo_lib::Bitset &bitset) { + algo::tempstr ret; + algo::ListSep ls(","); + ind_beg(algo_lib::Bitset_ary_bitcurs,state,bitset) { + ret< % - case '\\': - case '(' : - case ')' : - case '|' : - default : regx_str<<'\\'< \$X + if (state.op.op==algo_lib_RegxOp_char) { + ShowChar(state.op.imm,out); + } else if (state.op.op==algo_lib_RegxOp_charrange) { + algo::ListSep ls(", "); + ind_beg(algo::U16Ary_ary_curs,R,state.ch_class) { + int beg=ChRangeBeg(R); + int end=ChRangeEnd(R)-1;// inclusive + out<beg) { + out<<".."; + ShowChar(end,out); } - } else { - switch(input[i]) { - case '\\': escape = true ; regx.literal=false; break; // - case '%' : regx_str<<".*" ; regx.literal=false; break; // % -> .* - case '.' : - case '*' : - case '?' : - case '+' : regx_str<<'\\'< \+, etc. - case '|' : - case '(' : - case ')' : - case '[' : - case ']' : regx_str< \+ - default : regx_str< $X - } - } - } - if (!full) { - regx_str << ".*"; + }ind_end; } - algo_lib::RegxParse regxparse; - regxparse.input = regx_str; - regxparse.p_regx = ®x; - ::RunRegxParse(regxparse); + out << Keyval("op",state.op); + out << Keyval("next",ToDbgString(state.next)); + return out; } -// ----------------------------------------------------------------------------- +algo::tempstr algo_lib::ToDbgString(algo_lib::Regx ®x) { + return tempstr("Regx") + <type) + <first) + <last)); + } else { + ret << ""; + } + return ret; +} + +tempstr algo_lib::ToDbgString(algo_lib::RegxParse ®xparse) { + algo_lib::Regx ®x=*regxparse.p_regx; + tempstr out; + out<<"regx:"< % + case '\\': + case '(' : + case ')' : + case '|' : + default : out<<'\\'< \$X + } + } else { + switch(input[i]) { + case '\\': escape = true ; break; // + case '%' : out<<".*" ; break; // % -> .* + case '.' : + case '*' : + case '?' : + case '^' : + case '$' : + case '+' : out<<'\\'< \+, etc. + case '|' : + case '(' : + case ')' : + case '[' : + case ']' : out< \+ + default : out< $X + } + } + } + }break; + case algo_lib_RegxStyle_sql: { + // % is rewritten as .* + // _ is rewritten as . + // (, ), [, ] are passed through + // ., *, ?, + are escaped + bool escape = false; + frep_(i,elems_N(input)) { + if (escape) { + escape = false; + switch(input[i]) { + case '%' : out<<"%" ; break; // \% -> % + case '_' : out<<"_" ; break; // \_ -> _ + case '\\': out<<'\\'< \\ ... + case '(' : out<<'\\'< \( + case ')' : out<<'\\'< \) + case '|' : out<<'\\'< \| + default : out<<'\\'< \$X + } + } else { + switch(input[i]) { + case '\\': escape = true ; break; // + case '%' : out<<".*" ; break; // % -> .* + case '_' : out<<"." ; break; // _ -> . + case '.' : + case '*' : + case '?' : + case '^' : + case '$' : + case '+' : out<<'\\'< \+, etc. + case '|' : + case '(' : + case ')' : + case '[' : + case ']' : out< \+ + default : out< $X + } + } + } + }break; + case algo_lib_RegxStyle_shell: { + // * -> .* + // ? -> .? + // All other regx chars are escaped away + frep_(i,elems_N(input)) { + switch(input[i]) { + case '*': + out<<".*"; + break; + case '?': + out<<".?"; + break; + case '.': + case '\\': + case '[': + case ']': + case '(': + case ')': + case '^':// anchors + case '$': + out<<'\\'<. +// +// Target: algo_lib (lib) -- Support library for all executables +// Exceptions: NO +// Source: cpp/lib/algo/replscope.cpp +// + +#include "include/algo.h" + +// ----------------------------------------------------------------------------- + +static void ReplscopeError(algo_lib::Replscope &scope, algo::strptr err) { + if (scope.strict) { + prerr(err); + } + vrfy(scope.strict<2, err); +} + +// ----------------------------------------------------------------------------- + +// Add all prefixes of FROM as partial Replvars to R +// (For warnings) +static void AddPrefixes(algo_lib::Replscope &R, algo::strptr from) { + for (int i=from.n_elems-1; i>1; i--) { + algo::strptr prefix=ch_FirstN(from,i); + algo_lib::FReplvar *oldvar = algo_lib::ind_replvar_Find(R,prefix); + if (oldvar) { + if (!oldvar->partial && R.strict) { + tempstr msg = tempstr()<<"Replscope: existing variable "<p_replscope = &R; + replvar->key = from; + (void)replvar_XrefMaybe(*replvar); + } else { + // Check if FROM is a prefix of another variable + // If so, it can intercept substitutions ment for the other variable + if (replvar->partial && R.strict) { + tempstr msg = tempstr()<<"Replscope: new variable "<partial = false; // no longer partial + } + replvar->value = to; + if (R.strict && isnew) { + AddPrefixes(R,from); + } +} + +// ----------------------------------------------------------------------------- + +// Set value of key KEY value VALUE +// KEY string to replace +// VALUE value to replace it with +// SUBST If set, $-expand the VALUE parameter +// NOTES +// With 'strict' Replscope, avoid expressions like this: +// Set(R, "$var", field.comment); +// This will trigger an error when field.comment contains a $ sign and the substitution fails. +// Use +// Set(R, "$var", field.comment, false); +// +void algo_lib::Set(algo_lib::Replscope &scope, strptr from, strptr to, bool subst DFLTVAL(true)) { + if (subst) { + tempstr temp; + Ins(&scope, temp, to, false); + SetVar(scope,from,temp); + } else { + SetVar(scope,from,to); + } +} + +// ----------------------------------------------------------------------------- + +// +// An empty substitution followed by +static int EatComma(strptr text, int j) { + if (j < text.n_elems && (text.elems[j] == ',' || text.elems[j] == '.')) { + j++; + } + if (j < text.n_elems && algo_lib::WhiteCharQ(text.elems[j])) { + j++; + } + return j; +} + +// Scan TEXT starting at position I for a variable that is defined in R +// If the variable is found, I is set to the character position right after +// the variable, and the variable value is returned. +// Initially I points to the '$' character. +// If the variable is not found because end-of-string is found the substitution fails, +// and the scanner advances one character. +// In this case, if R.FATAL is set, an exception is thrown; otherwise +// I is advanced 1 character and that character is returned as the substitution, +// leaving the original string untouched. +// If one variable is a prefix another (e.g. $field, $fieldval), then +// one must use ${fieldval} to avoid the shortest substitution being used +static strptr ScanVar(algo_lib::Replscope &R, strptr text, int &i) { + strptr ret; + int j=i+1;// right after the $ + algo_lib::FReplvar *replvar=NULL; + if (jpartial) { + j++;// skip '}' + break; + } + } else if (text.elems[j]=='$') { + break;// exit on start of next substitution + } + } + } else { // scan character-by-character + for (; j<=text.n_elems; j++) { + replvar = algo_lib::ind_replvar_Find(R,strptr(text.elems+i, j-i)); + if (replvar && !replvar->partial) { + break; + } + } + if (j > text.n_elems) { + j=i+1; + } + } + if (replvar && !replvar->partial) { + ret=replvar->value; + if (ret.n_elems==0 && R.eatcomma) { + j = EatComma(text,j); + } + } else { + if (R.strict) { + tempstr defined; + algo::ListSep ls; + ind_beg(algo_lib::replscope_ind_replvar_curs,var,R) if (!var.partial) { + defined< start) { + out << qGetRegion(text,start,i-start); + } + if (eol) { + out << '\n'; + } +} + +// ----------------------------------------------------------------------------- + +// Enable comma-eating (default true) +void algo_lib::eatcomma_Set(algo_lib::Replscope &scope, bool enable) { + scope.eatcomma=enable; +} + +// ----------------------------------------------------------------------------- + +// Perform $-substitutions in TEXT and return new value. +tempstr algo_lib::Subst(algo_lib::Replscope &scope, strptr text) { + tempstr retval; + Ins(&scope, retval, text, false); + return retval; +} diff --git a/cpp/lib/algo/string.cpp b/cpp/lib/algo/string.cpp index de51945e..29204f59 100644 --- a/cpp/lib/algo/string.cpp +++ b/cpp/lib/algo/string.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 // @@ -220,7 +220,7 @@ int algo::FindFrom(strptr s, strptr t, int from, bool case_sensitive) { } if (case_sensitive) { for (int i=from, lim=s.n_elems-n+1; ip_replscope = &scope; - replvar->key = from; - (void)replvar_XrefMaybe(*replvar); - } - replvar->value = to; -} - -// ----------------------------------------------------------------------------- - -// Set value of key KEY value VALUE -// KEY string to replace -// VALUE value to replace it with -// SUBST If set, $-expand the VALUE parameter -void algo_lib::Set(algo_lib::Replscope &scope, strptr from, strptr to, bool subst DFLTVAL(true)) { - if (subst) { - tempstr temp; - Ins(&scope, temp, to, false); - SetVar(scope,from,temp); - } else { - SetVar(scope,from,to); - } -} - -// ----------------------------------------------------------------------------- - -// -// An empty substitution followed by -static int EatComma(strptr text, int j) { - if (j < text.n_elems && (text.elems[j] == ',' || text.elems[j] == '.')) { - j++; - } - if (j < text.n_elems && algo_lib::WhiteCharQ(text.elems[j])) { - j++; - } - return j; -} - -// Scan TEXT starting at position I for a variable that is defined in R -// If the variable is found, I is set to the character position right after -// the variable, and the variable value is returned. -// Initially I points to the '$' character. -// If the variable is not found because end-of-string is found the substitution fails, -// and the scanner advances one character. -// In this case, if R.FATAL is set, the program is killed; otherwise -// I is advanced 1 character and that character is returned as the substitution, -// leaving the original string untouched. -// If one variable is a prefix another (e.g. $field, $fieldval), then -// one must use ${fieldval} to avoid the shortest substitution being used -static strptr ScanVar(algo_lib::Replscope &R, strptr text, int &i) { - strptr ret; - int j=i+1;// right after the $ - algo_lib::FReplvar *replvar=NULL; - if (j text.n_elems) { - j=i+1; - } - } - if (replvar) { - ret=replvar->value; - if (ret.n_elems==0 && R.eatcomma) { - j = EatComma(text,j); - } - } else { - if (R.fatal) { - tempstr msg; - msg<<"algo_lib.badreplace" - < start) { - out << qGetRegion(text,start,i-start); - } - if (eol) { - out << '\n'; - } -} - -// ----------------------------------------------------------------------------- - -// Enable comma-eating (default true) -void algo_lib::eatcomma_Set(algo_lib::Replscope &scope, bool enable) { - scope.eatcomma=enable; -} - -// Enable strict mode (default true -- any failed substitution kills process) -// If strict mode is off, failed substitution acts as if there was no substitution -void algo_lib::fatal_Set(algo_lib::Replscope &scope, bool enable) { - scope.fatal=enable; -} - -// ----------------------------------------------------------------------------- - -// Perform $-substitutions in TEXT and return new value. -tempstr algo_lib::Subst(algo_lib::Replscope &scope, strptr text) { - tempstr retval; - Ins(&scope, retval, text, false); - return retval; -} - // read TEXT into a tuple. // perform variable substitution on key-value pairs. // write tuple back. @@ -1616,6 +1456,35 @@ u64 &algo::u64_Ranges_curs_Access(algo::u64_Ranges_curs &curs) { return curs.cur; } +// ----------------------------------------------------------------------------- + +void algo::Append(algo::u64_RangesList &p, u64 item) { + if (!p.pending) { + p.start = item; + p.end = item; + p.pending = true; + } else if (item == p.end+1) { + ++p.end; + } else { + Yield(p); + } +} + +strptr algo::Yield(algo::u64_RangesList &p) { + if (p.pending) { + p.pending = false; + if (p.start == p.end) { + p.result << p.ls << p.start ; + } else { + p.result << p.ls << p.start << "-" << p.end; + } + } + return p.result; +} + + +// ----------------------------------------------------------------------------- + void algo::Sep_curs_Reset(algo::Sep_curs &curs, strptr line, char sep) { curs.rest = line; curs.sep = sep; diff --git a/cpp/lib/algo/time.cpp b/cpp/lib/algo/time.cpp index 7bd7764e..b10983df 100644 --- a/cpp/lib/algo/time.cpp +++ b/cpp/lib/algo/time.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 // diff --git a/cpp/lib/algo/timehook.cpp b/cpp/lib/algo/timehook.cpp index 47f7e121..64b4cf62 100644 --- a/cpp/lib/algo/timehook.cpp +++ b/cpp/lib/algo/timehook.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2018-2019 NYSE | Intercontinental Exchange // // License: GPL @@ -23,21 +23,31 @@ #include "include/algo.h" -// Initialize time hook TH as non-recurrent, with delay DELAY. -// Usage: -// ThInit(th, SchedTime()); // schedule at current time -// hook_Set0(th, myfunction); // set callback -// bh_timehook_Reheap(th); // insert into timehook heap -// ... eventually algo_lib::Step() will call the hook -void algo_lib::ThInit(algo_lib::FTimehook& th, algo::SchedTime delay) NOTHROW { - th.recurrent = false; +// Initialize a recurrent time hook TH to execute on the next scheduling cycle, +// and after that, every DELAY clocks +// NOTE: 'delay' field of a recurrent timehook is used when automatically rescheduling it. +void algo_lib::ThInitRecur(algo_lib::FTimehook& th, algo::SchedTime delay) NOTHROW { + th.recurrent = true; th.delay = delay; th.time = algo_lib::_db.clock; } -// Similar to the above, but recurrent. -void algo_lib::ThInitRecur(algo_lib::FTimehook& th, algo::SchedTime delay) NOTHROW { +// Schedule a time hook TH to execute on the next scheduling cycle, +// and after that, every DELAY clocks +void algo_lib::ThScheduleRecur(algo_lib::FTimehook& th, algo::SchedTime delay) NOTHROW { th.recurrent = true; th.delay = delay; th.time = algo_lib::_db.clock; + bh_timehook_Reheap(th); +} + +// Initialize a non-recurrent time hook TH to execute after DELAY clock cycles with +// respect to current time +// NOTE: 'delay' field of non-recurrent timehook is ignored +// NOTE: this function updates scheduling clock to the most current value +void algo_lib::ThScheduleIn(algo_lib::FTimehook& th, algo::SchedTime delay) NOTHROW { + algo_lib::_db.clock = algo::CurrSchedTime(); + th.recurrent = false; + th.time = algo_lib::_db.clock + delay; + bh_timehook_Reheap(th); } diff --git a/cpp/lib/algo/tstamp.cpp b/cpp/lib/algo/tstamp.cpp index be72d420..523ab3f0 100644 --- a/cpp/lib/algo/tstamp.cpp +++ b/cpp/lib/algo/tstamp.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2020-2021 Astra // Copyright (C) 2017-2019 NYSE | Intercontinental Exchange // diff --git a/cpp/lib/algo/txttbl.cpp b/cpp/lib/algo/txttbl.cpp index 663ff1d3..41a71652 100644 --- a/cpp/lib/algo/txttbl.cpp +++ b/cpp/lib/algo/txttbl.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 // @@ -24,35 +24,44 @@ #include "include/algo.h" -static algo_TextJustEnum DefaultJust(algo_lib::FTxttbl &txttbl, u32 col) { - algo_TextJustEnum retval = algo_TextJust_j_left; - u32 row = txttbl.hdr_row; +// Look up cell with specific coordinates. +algo_lib::FTxtcell *algo_lib::FindCell(algo_lib::FTxttbl &txttbl, int row, int col) { + algo_lib::FTxtcell *retval=NULL; if (algo_lib::FTxtrow *txtrow = c_txtrow_Find(txttbl, row)) { - u32 ncols = c_txtcell_N(*txtrow); - if (col < ncols) { - retval = c_txtcell_Find(*txtrow, col)->justify; - } + retval = c_txtcell_Find(*txtrow, col); } return retval; } +algo_TextJustEnum algo_lib::EvalJust(algo_lib::FTxttbl &txttbl, u32 col, algo_TextJustEnum just) { + algo_TextJustEnum ret = just; + if (just == algo_TextJust_j_auto) { + if (algo_lib::FTxtcell *cell = FindCell(txttbl, 0, col)) { + ret = cell->justify; + } else { + ret = algo_TextJust_j_left; + } + } + return ret; +} + // Add new cell to the given row. -algo_lib::FTxtcell &algo_lib::AddCell(algo_lib::FTxtrow &txtrow, algo::strptr title, algo_TextJustEnum justify, int span) { +// TEXT specifies the text for the cell +algo_lib::FTxtcell &algo_lib::AddCell(algo_lib::FTxtrow &txtrow, algo::strptr text, algo_TextJustEnum justify DFLTVAL(algo_TextJust_j_auto)) { algo_lib::FTxtcell &txtcell = algo_lib::txtcell_Alloc(); txtcell.p_txtrow = &txtrow; - txtcell.justify = justify; - txtcell.text = title; - txtcell.span = span; + txtcell.justify = EvalJust(*txtrow.p_txttbl, c_txtcell_N(txtrow)-1, justify); + txtcell.text = text; txtcell.rsep = " "; (void)txtcell_XrefMaybe(txtcell); return txtcell; } -algo_lib::FTxtcell &algo_lib::AddCell(algo_lib::FTxtrow &txtrow, algo::strptr title, algo_TextJustEnum justify) { - return AddCell(txtrow, title, justify, 1); +algo::cstring &algo_lib::AddCell(algo_lib::FTxttbl &txttbl) { + return AddCellEx(txttbl).text; } -// Add new cell to the last row of of table and return references to its text +// Add new row to the table and return a reference to it algo_lib::FTxtrow &algo_lib::AddRow(algo_lib::FTxttbl &txttbl) { algo_lib::FTxtrow &txtrow = txtrow_Alloc(); txtrow.p_txttbl = &txttbl; @@ -61,6 +70,7 @@ algo_lib::FTxtrow &algo_lib::AddRow(algo_lib::FTxttbl &txttbl) { } // Add column to the last row of table and return reference to it +// The justification for the column is copied from the header row algo_lib::FTxtcell &algo_lib::AddCellEx(algo_lib::FTxttbl &txttbl) { if (!c_txtrow_N(txttbl)) { AddRow(txttbl); @@ -68,7 +78,7 @@ algo_lib::FTxtcell &algo_lib::AddCellEx(algo_lib::FTxttbl &txttbl) { algo_lib::FTxtrow &txtrow = *c_txtrow_Find(txttbl, c_txtrow_N(txttbl)-1); algo_lib::FTxtcell &txtcell = algo_lib::txtcell_Alloc(); txtcell.p_txtrow = &txtrow; - txtcell.justify = DefaultJust(txttbl, c_txtcell_N(txtrow) - 1); + txtcell.justify = EvalJust(txttbl, c_txtcell_N(txtrow) - 1, algo_TextJust_j_auto); tempstr t; char_PrintNTimes(' ', t, txttbl.col_space); txtcell.rsep = t; @@ -76,50 +86,142 @@ algo_lib::FTxtcell &algo_lib::AddCellEx(algo_lib::FTxttbl &txttbl) { return txtcell; } -// Text table. -// Text table is a table with rows; Each row has an array of cells. -// Each call has text, col span, text justification, and optional style (color). -// Add column to the last row of table. -void algo_lib::AddCol(algo_lib::FTxttbl &txttbl, algo::strptr col, algo_TextJustEnum justify) { +// Add a column with specified text TEXT to the last row of the table +// If optional JUSTIFY is provided, the justification is set. Otherwise, justification is automatically +// determined from the header cell. +void algo_lib::AddCol(algo_lib::FTxttbl &txttbl, algo::strptr text, algo_TextJustEnum justify DFLTVAL(algo_TextJust_j_auto)) { algo_lib::FTxtcell &txtcell = AddCellEx(txttbl); - txtcell.text = col; - txtcell.justify = justify; -} - -void algo_lib::AddCol(algo_lib::FTxttbl &txttbl, algo::strptr col) { - AddCol(txttbl, col, algo_TextJust_j_left); + txtcell.text = text; + txtcell.justify = EvalJust(txttbl, c_txtcell_N(*txtcell.p_txtrow)-1, justify); } -void algo_lib::AddCols(algo_lib::FTxttbl &txttbl, algo::strptr csv, algo_TextJustEnum justify) { +// Add a comma-separated list of columns to the table +void algo_lib::AddCols(algo_lib::FTxttbl &txttbl, algo::strptr csv, algo_TextJustEnum justify DFLTVAL(algo_TextJust_j_left)) { ind_beg(algo::Sep_curs,token,csv,','){ - AddCol(txttbl,token,justify); + AddCol(txttbl, token, justify); }ind_end; } -void algo_lib::AddCols(algo_lib::FTxttbl &txttbl, algo::strptr csv) { - ind_beg(algo::Sep_curs,token,csv,','){ - AddCols(txttbl,token, algo_TextJust_j_left); - }ind_end; +bool algo::SaneTerminalQ() { + strptr termtype = getenv("TERM"); + return isatty(STDOUT_FILENO) && termtype != strptr("dumb"); } -algo::cstring &algo_lib::AddCell(algo_lib::FTxttbl &txttbl) { - return AddCellEx(txttbl).text; -} +// ----------------------------------------------------------------------------- -// Use prlog(txttbl) to print. -void algo_lib::TxttblCsv(algo_lib::FTxttbl &tbl) { - ind_beg(algo_lib::txttbl_c_txtrow_curs, tblrow, tbl) { - u32 n = c_txtcell_N(tblrow); - u32 i=0; - ind_beg(algo_lib::txtrow_c_txtcell_curs, cell, tblrow) { - if (++i < n) { - cell.text << ", "; +static void PrintRow(cstring &str, algo_lib::FTxtrow &row, bool use_style) { + ind_beg(algo_lib::txtrow_c_txtcell_curs, txtcell, row) { + int extra = txtcell.width - ch_N(txtcell.rsep) - ch_N(txtcell.text); + int l = txtcell.justify>0 ? extra + : txtcell.justify<0 ? 0 + : extra/2; + char_PrintNTimes(' ', str, l); + algo::TermStyle style = use_style ? txtcell.style : algo::TermStyle(algo_TermStyle_default); + if (style != algo_TermStyle_default) { + if (style & algo_TermStyle_bold) { + // do it + } + if (style & algo_TermStyle_red) { + str << "\033[91m"; + } + if (style & algo_TermStyle_green) { + str << "\033[92m"; } + if (style & algo_TermStyle_blue) { + str << "\033[94m"; + } + } + str << txtcell.text; + if (style) { + strptr_Print("\033[0m", str); + } + char_PrintNTimes(' ', str, extra-l); + str << txtcell.rsep; + }ind_end; + // trim whitespace on the right + while (ch_N(str) && ch_qLast(str) == ' ') { + str.ch_n--; + } + str << eol; +} + +static void Normalize(algo_lib::FTxttbl &txttbl) { + algo::U64Ary norm; + ary_Alloc(norm) = 0; + int maxspan = 0; + ind_beg(algo_lib::txttbl_c_txtrow_curs,txtrow,txttbl) if (txtrow.select) { + ind_beg(algo_lib::txtrow_c_txtcell_curs, txtcell, txtrow) { + maxspan = i32_Max(maxspan, txtcell.span); }ind_end; }ind_end; + frep_(span,maxspan+1) { + ind_beg(algo_lib::txttbl_c_txtrow_curs,txtrow,txttbl) if (txtrow.select) { + int i = 0; + ind_beg(algo_lib::txtrow_c_txtcell_curs, txtcell, txtrow) { + if (txtcell.span == span) { + int w = i32_Max(ch_N(txtcell.text) + ch_N(txtcell.rsep), txtcell.width); + // apply width + int r = i + txtcell.span; + while (r >= ary_N(norm)) { + int last = ary_qLast(norm); + ary_Alloc(norm) = last; + } + int extra = w - (ary_qFind(norm, r) - ary_qFind(norm, i)); + if (extra > 0) { + for (int j = r; j < ary_N(norm); j++) { + ary_qFind(norm, j) += extra; + } + } + } + i += txtcell.span; + }ind_end; + }ind_end; + } + ind_beg(algo_lib::txttbl_c_txtrow_curs,txtrow,txttbl) if (txtrow.select) { + int i = 0; + ind_beg(algo_lib::txtrow_c_txtcell_curs, txtcell, txtrow) { + txtcell.width = ary_qFind(norm, i+txtcell.span) - ary_qFind(norm, i); + i += txtcell.span; + }ind_end;; + }ind_end;; } -bool algo::SaneTerminalQ() { - strptr termtype = getenv("TERM"); - return isatty(STDOUT_FILENO) && termtype != strptr("dumb"); +// ----------------------------------------------------------------------------- + +void algo_lib::FTxttbl_Print(algo_lib::FTxttbl &txttbl, algo::cstring &str) { + bool use_style = algo::SaneTerminalQ(); + if (bool_Update(txttbl.normalized,true)) { + Normalize(txttbl); + } + ind_beg(algo_lib::txttbl_c_txtrow_curs,txtrow,txttbl) if (txtrow.select) { + PrintRow(str,txtrow,use_style); + }ind_end; +} + +static tempstr NewlineToBr(strptr s) { + tempstr ret(s); + Replace(ret,"\n","
"); + return ret; +} + +// ----------------------------------------------------------------------------- + +// Print table TXTTBL using markdown, appending to string STR. +// First row of the table is assumed to be the header. +// Newlines in cells are converted to '
'. +void algo_lib::FTxttbl_Markdown(algo_lib::FTxttbl &txttbl, algo::cstring &str) { + ind_beg(algo_lib::txttbl_c_txtrow_curs,txtrow,txttbl) if (txtrow.select && c_txtcell_N(txtrow)) { + str<<"|"; + ind_beg(algo_lib::txtrow_c_txtcell_curs, txtcell, txtrow) { + // markdown is thrown away by \n in the cells, so it has to be replaced with
+ str<. +// +// Target: algo_lib (lib) -- Support library for all executables +// Exceptions: NO +// Source: cpp/lib/algo/url.cpp +// + +#include "include/algo.h" + +// perform standard url percent decoding (for raw url, path), +// and optionally translate '+' to space (for application/x-www-form-urlencoded) +tempstr algo::UrlDecode(strptr in, bool plus) { + tempstr out; + ch_Reserve(out,ch_N(in)); + u8 hi,lo; + frep_(i,ch_N(in)) { + if (in[i]=='%' && i+2=0 ? ind : ch_N(buf); + strptr ret = ch_FirstN(buf,ind); + buf = ch_RestFrom(buf,ind+1); + return ret; +} + +// Parses HTTP URL +// Place path part as value of first attr, +// other attrs are key-value pairs in order as the appear +void algo::ParseUrl(algo::Tuple &out, strptr in) { + attrs_RemoveAll(out); + strptr path = UrlDecode(ParseSep(in,'?'),false); + if (ch_N(path)) { + attrs_Alloc(out).value = path; + while (ch_N(in)) { + strptr arg = ParseSep(in,'&'); + algo::Attr &attr = attrs_Alloc(out); + attr.name = UrlDecode(ParseSep(arg,'='),true); + attr.value = UrlDecode(arg,true); + } + } +} diff --git a/cpp/lib/algo/uuid.cpp b/cpp/lib/algo/uuid.cpp new file mode 100644 index 00000000..3fbf095a --- /dev/null +++ b/cpp/lib/algo/uuid.cpp @@ -0,0 +1,37 @@ +// 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: algo_lib (lib) -- Support library for all executables +// Exceptions: NO +// Source: cpp/lib/algo/uuid.cpp +// + +#include "include/algo.h" +#include + +void algo::GenerateRandomUuid(algo::Uuid &uuid) { + uuid_generate_random(uuid.value_elems); +} + +algo::Uuid algo::GenerateRandomUuid() { + algo::Uuid ret; + GenerateRandomUuid(ret); + return ret; +} + +bool algo::NullUuidQ(const algo::Uuid &uuid) { + return uuid_is_null(uuid.value_elems); +} diff --git a/cpp/lib/algo/win32.cpp b/cpp/lib/algo/win32.cpp index b5dcea3e..0ba5f2bd 100644 --- a/cpp/lib/algo/win32.cpp +++ b/cpp/lib/algo/win32.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2020-2021 Astra // // License: GPL diff --git a/cpp/lib/lib_ctype.cpp b/cpp/lib/lib_ctype.cpp index cadb7240..468fca44 100644 --- a/cpp/lib/lib_ctype.cpp +++ b/cpp/lib/lib_ctype.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2023 Astra // Copyright (C) 2016-2019 NYSE | Intercontinental Exchange // diff --git a/cpp/lib/lib_curl.cpp b/cpp/lib/lib_curl.cpp new file mode 100644 index 00000000..ced3025c --- /dev/null +++ b/cpp/lib/lib_curl.cpp @@ -0,0 +1,185 @@ +// 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: lib_curl (lib) -- covers curl_easy +// Exceptions: yes +// Source: cpp/lib/lib_curl.cpp +// + +#include "include/algo.h" +#include "include/algo.h" +#include "include/lib_curl.h" +#include + +// ----------------------------------------------------------------------------- +#define curl_vrfy_(res) \ + do { \ + CURLcode res_copy(res); \ + vrfy(res_copy==CURLE_OK,tempstr()<<(#res)<<": "<(userdata); + // out->append(ptr, size * nmemb); + // return size * nmemb; + vrfy_(userdata); + lib_curl::FResponse &resp = *(lib_curl::FResponse *)userdata; + strptr chunk(ptr,size*nmemb); + resp.body << chunk; + return size*nmemb; +} +// ----------------------------------------------------------------------------- +// Curl header calback function, also called for status line +static size_t HeaderCb(char *ptr, size_t size, size_t nmemb, void *userdata) { + vrfy_(userdata); + lib_curl::FResponse &resp = *(lib_curl::FResponse *)userdata; + strptr chunk(ptr,size*nmemb); + tempstr header(chunk); + header = tempstr()< ) + headers_Alloc(resp)=header; + + if (algo::StartsWithQ(header, "HTTP/")){ + resp.status_line=header; + u16_ReadStrptrMaybe(resp.code,Trimmed(Pathcomp(header," LR LL"))); + resp.reason = algo::Trimmed(Pathcomp(header," LR LR")); + } else if (algo::StartsWithQ(header, "Content-Type")){ // Parse Content-Type: ; + resp.content_type=Trimmed(Pathcomp(header,":LR;LL")); + } + } + return size*nmemb; +} + +// ----------------------------------------------------------------------------- +// Internal: non-throwing attempt that returns CURLcode in out param. +// We keep this internal so HttpJson can still throw on transport errors, +// while retry wrapper can inspect and retry on transport failures. +static CURLcode HttpJsonAttempt(lib_curl::FRequest &req, lib_curl::FResponse &out_resp){ + CURLcode out_cc(CURLE_OK); + + CURL *curl; + vrfy(curl = curl_easy_init(),"curl_easy_init failed"); + + // Set Headers + struct curl_slist* hdrs=NULL; + tempstr data_brkt("\""); + ind_beg(lib_curl::request_headers_curs,header,req){ + if (header=="Content-Type: application/json"){ + data_brkt=""; + } + hdrs = curl_slist_append(hdrs, Zeroterm(header)); + out_resp.curlrc<<"header = \""<type == lib_json_FNode_type_object; vrfy(is_obj == !!elems_N(field),"wrong use of field name"); if (is_obj) { @@ -89,25 +93,36 @@ lib_json::FNode &lib_json::NewFieldNode(lib_json::FNode *parent, strptr field) { } lib_json::FNode &lib_json::NewObjectNode(lib_json::FNode *parent, strptr field DFLTVAL(strptr())) { - return NewNodeSmart(parent, lib_json_FNode_type_object, field); + return NewFieldVal(parent, lib_json_FNode_type_object, field); } lib_json::FNode &lib_json::NewArrayNode(lib_json::FNode *parent, strptr field DFLTVAL(strptr())) { - return NewNodeSmart(parent, lib_json_FNode_type_array, field); + return NewFieldVal(parent, lib_json_FNode_type_array, field); } lib_json::FNode &lib_json::NewStringNode(lib_json::FNode *parent, strptr field DFLTVAL(strptr()), strptr value DFLTVAL(strptr())) { - lib_json::FNode &node = NewNodeSmart(parent, lib_json_FNode_type_string, field); + lib_json::FNode &node = NewFieldVal(parent, lib_json_FNode_type_string, field); node.value = value; return node; } lib_json::FNode &lib_json::NewNumberNode(lib_json::FNode *parent, strptr field DFLTVAL(strptr()), strptr value DFLTVAL(strptr("0"))) { - lib_json::FNode &node = NewNodeSmart(parent, lib_json_FNode_type_number, field); + lib_json::FNode &node = NewFieldVal(parent, lib_json_FNode_type_number, field); node.value = value; return node; } +lib_json::FNode &lib_json::NewBoolNode(lib_json::FNode *parent, strptr field DFLTVAL(strptr()), bool value DFLTVAL(true)) { + lib_json::FNode *node(NULL); + if (value){ + node = &NewFieldVal(parent, lib_json_FNode_type_true, field); + } else { + node = &NewFieldVal(parent, lib_json_FNode_type_false, field); + } + return *node; +} + + // add new node as child of current node (or as root node) // NULL on error static lib_json::FNode *JsonNodeAdd(lib_json::FParser &parser, lib_json_FNode_type_Enum type, strptr value=strptr()) { @@ -554,77 +569,92 @@ void lib_json::root_node_Cleanup(lib_json::FParser& parent) { // quotation mark, reverse solidus, and the control characters (U+0000 // through U+001F)." // -- this says that solidus need not be escaped when printing -- only when parsing! -void lib_json::JsonSerializeString(algo::strptr str, algo::cstring &lhs) { - lhs << '"'; +void lib_json::JsonSerializeString(algo::strptr str, algo::cstring &out) { + out << '"'; frep_(i,elems_N(str)) { switch (str[i]) { - case '"' : lhs << '\\' << str[i]; break; - case '\\': lhs << '\\' << str[i]; break; - case '\b': lhs << "\\b"; break; - case '\f': lhs << "\\f"; break; - case '\n': lhs << "\\n"; break; - case '\r': lhs << "\\r"; break; - case '\t': lhs << "\\t"; break; + case '"' : out << '\\' << str[i]; break; + case '\\': out << '\\' << str[i]; break; + case '\b': out << "\\b"; break; + case '\f': out << "\\f"; break; + case '\n': out << "\\n"; break; + case '\r': out << "\\r"; break; + case '\t': out << "\\t"; break; default : if (str[i] & ~0x1f) { - lhs << str[i]; + out << str[i]; } else { // escape control chars - lhs << "\\u"; - u64_PrintHex(str[i],lhs,4,false,true); + out << "\\u"; + u64_PrintHex(str[i],out,4,false,true); } break; } } - lhs << '"'; + out << '"'; } // Serialize to string // Serialize to JSON tree to text // NODE root node to start from -// LHS target string -// PRETTY whether or not pretty-format +// OUT target string +// PRETTY pretty printer setting: +// 0 = no pretty printer (compact output) +// 1 = algo style pretty printer +// 2 = standard (jq) style) pretty printer // INDENT level of indenting (for pretty-formatting) -void lib_json::JsonSerialize(lib_json::FNode* node, cstring &lhs, bool pretty, u32 indent) { +void lib_json::JsonSerialize(lib_json::FNode* node, cstring &out, u32 pretty DFLTVAL(0), u32 indent DFLTVAL(0)) { if (node) { switch (node->type) { - case lib_json_FNode_type_null : lhs<<"null"; break; - case lib_json_FNode_type_true : lhs<<"true"; break; - case lib_json_FNode_type_false : lhs<<"false"; break; - case lib_json_FNode_type_number: lhs<value; break; + case lib_json_FNode_type_null : out<<"null"; break; + case lib_json_FNode_type_true : out<<"true"; break; + case lib_json_FNode_type_false : out<<"false"; break; + case lib_json_FNode_type_number: out<value; break; case lib_json_FNode_type_string: { - JsonSerializeString(node->value,lhs); + JsonSerializeString(node->value,out); break; } case lib_json_FNode_type_field : { // silently omit malformed fields if (c_child_N(*node)==1) { - JsonSerializeString(node->value,lhs); - lhs<<':'; - lib_json::JsonSerialize(c_child_Find(*node,0),lhs,pretty,indent); + JsonSerializeString(node->value,out); + out<<':'; + // jq style: space after: + if (pretty==2) { + out<<' '; + } + lib_json::JsonSerialize(c_child_Find(*node,0),out,pretty,indent); } } break; case lib_json_FNode_type_array: case lib_json_FNode_type_object: { - lhs<< (node->type == lib_json_FNode_type_object ? '{' : '['); + out<< (node->type == lib_json_FNode_type_object ? '{' : '['); indent++; - algo::ListSep ls(","); ind_beg(lib_json::node_c_child_curs, child, *node) { if (pretty) { - lhs<< '\n'; - char_PrintNTimes(' ',lhs,indent*4); + out<< '\n'; + char_PrintNTimes(' ',out,indent*4); + } + // algo style: comma before element + if (pretty!=2 && ind_curs(child).index > 0) { + out<<","; + } + lib_json::JsonSerialize(&child,out,pretty,indent); + // jq style: comma after element + if (pretty==2 && ind_curs(child).index < u32(c_child_N(*node)-1)) { + out<<","; } - lhs<0 : pretty>0) { + out<<'\n'; + char_PrintNTimes(' ',out,indent*4); } - lhs<< (node->type == lib_json_FNode_type_object ? '}' : ']'); + out<< (node->type == lib_json_FNode_type_object ? '}' : ']'); } break; default: @@ -633,14 +663,6 @@ void lib_json::JsonSerialize(lib_json::FNode* node, cstring &lhs, bool pretty, u } } -void lib_json::JsonSerialize(lib_json::FNode* node, cstring &lhs, bool pretty) { - lib_json::JsonSerialize(node,lhs,pretty,0); -} - -void lib_json::JsonSerialize(lib_json::FNode* node, cstring &lhs) { - lib_json::JsonSerialize(node,lhs,false,0); -} - // Find node in object chain // PARENT node to start from // PATH dot-separated list of field keys @@ -713,6 +735,63 @@ u32 lib_json::u32_Get(lib_json::FNode* parent, strptr path, int dflt DFLTVAL(0)) return ret; } +// Get node value as u32 +// If the path is not found, or the value is malformatted, DFLT is returned. +// true/false is converted to 0/1 +// +// PARENT node to start from +// PATH dot-separated list of field keys +u32 lib_json::i32_Get(lib_json::FNode* parent, strptr path, int dflt DFLTVAL(0)) { + lib_json::FNode* node = lib_json::node_Find(parent,path); + i32 ret=dflt; + if (node) { + switch (node->type) { + case lib_json_FNode_type_true: + ret = 1; + break; + case lib_json_FNode_type_false: + ret = 0; + break; + case lib_json_FNode_type_number: + i32_ReadStrptrMaybe(ret,node->value); + break; + default: break; + } + } + return ret; +} + +// Get node value as bool +// number is converted: zero - false, nonzero true +// empty string - false, non-empty string true +// On any error, DFLT is returned. +// +// PARENT node to start from +// PATH dot-separated list of field keys +u32 lib_json::bool_Get(lib_json::FNode* parent, strptr path, int dflt DFLTVAL(false)) { + lib_json::FNode* node = lib_json::node_Find(parent,path); + bool ret=dflt; + u32 num(0); + if (node) { + switch (node->type) { + case lib_json_FNode_type_true: + ret = true; + break; + case lib_json_FNode_type_false: + ret = false; + break; + case lib_json_FNode_type_number: + ret = u32_ReadStrptrMaybe(num,node->value) && num; + break; + case lib_json_FNode_type_string: + ret = ch_N(node->value); + break; + default: break; + } + } + return ret; +} + // // predefined conversion functions // @@ -804,12 +883,17 @@ lib_json::FNode *algo::cstring_FmtJson(algo::cstring &value, lib_json::FNode *pa return strptr_FmtJson(value,parent); } +// TODO generate with amc +lib_json::FNode *algo::Smallstr50_FmtJson(algo::Smallstr50 &value, lib_json::FNode *parent) { + return strptr_FmtJson(value,parent); +} + // ----------------------------------------------------------------------------- lib_json::FldKey lib_json::fldkey_Get(lib_json::FNode &node) { lib_json::FldKey ret; if (node.p_parent && node.p_parent->type==lib_json_FNode_type_field) { - ret.object = node.p_parent->p_parent; + ret.p_object = node.p_parent->p_parent; ret.field = node.p_parent->value; } return ret; diff --git a/cpp/lib/lib_mysql.cpp b/cpp/lib/lib_mysql.cpp index 2f31d55f..91391022 100644 --- a/cpp/lib/lib_mysql.cpp +++ b/cpp/lib/lib_mysql.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 @@ -25,6 +25,7 @@ // Helper functions for mysql #include "include/lib_mysql.h" +#include "include/lib_iconv.h" // LHS output buffer // CONN mysql context (includes collation info) diff --git a/cpp/lib/lib_sql.cpp b/cpp/lib/lib_sql.cpp index 04a5cf0b..9429a742 100644 --- a/cpp/lib/lib_sql.cpp +++ b/cpp/lib/lib_sql.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/lib_amcdb/lib_amcdb.cpp b/cpp/lib_amcdb/lib_amcdb.cpp index 1a697c44..5ee06518 100644 --- a/cpp/lib_amcdb/lib_amcdb.cpp +++ b/cpp/lib_amcdb/lib_amcdb.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 diff --git a/cpp/lib_ams/dump.cpp b/cpp/lib_ams/dump.cpp new file mode 100644 index 00000000..c2f7a8d5 --- /dev/null +++ b/cpp/lib_ams/dump.cpp @@ -0,0 +1,227 @@ +// 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: lib_ams (lib) -- Library for AMS middleware, supporting file format & messaging +// Exceptions: yes +// Source: cpp/lib_ams/dump.cpp +// + +#include "include/algo.h" +#include "include/lib_ams.h" + +// Return string STR limited to ~LIM chars +// Either the original string is returned, or a string in the form +// abcabcabcabc [CRC:12345678] xyzxyzxyzxyz +// original characters are unquoted -- result must be passed through Keyval or strptr_ToSsim +// the final string may be longer than lim chars by about ~20 bytes. +static tempstr LimitLengthCRC(algo::strptr str, int lim) { + tempstr ret; + if (str.n_elems > lim) { + int ncut = str.n_elems - lim; + int cut1 = (str.n_elems - ncut) / 2; + int cut2 = (str.n_elems + ncut) / 2; + vrfy_(cut1 >= 0 && cut1 <= str.n_elems && cut2 >= 0 && cut2 <= str.n_elems); + if (cut1 > 0) { + ret << ch_FirstN(str,cut1) << " ["; + } + ret << "CRC:"<off : 0)) + <off : 0)) + <off; + last_hb = read_shmember->last_hb; + cell.text << ls<<"R"; + double hbbehind = algo::ElapsedSecs(last_hb, algo_lib::_db.clock); + bool online = hbbehind < 2.0; + cell.style = online ? algo_TermStyle_green : algo_TermStyle_red; + } + if (write_shmember) { + woff = write_shmember->off; + cell.text <<"W"; + cell.style = algo_TermStyle_blue; + if (shm.shm_id == lib_ams::_db.dflt_shm_id) { + cell.text << "*"; + } + } + if (read_shmember) { + u64 behind = algo::u64_SubClip(woff,roff); + if (behind>10) { + cell.text << " "< 0, strip this many outer "layers"; +// if FMT.BIN, the message is printed as pure binary; otherwise, convert to text +// if FMT.PRETTY, every next layer / payload is printed on a new line with indent +// for readability. +// FMT.PAYLOAD_LEN limits maximum printed payload length, allowing to fit one messge per +// screen even if payload is 10MB +// Finally, if FMT.SHOWLEN is true, message length is included in output. +void lib_ams::PrintMsg(lib_ams::MsgFmt &fmt, ams::MsgHeader &msg, cstring &out) { + bool printed=false; + if (fmt.strip>0) { + // strip headers + } else if (fmt.format==lib_ams_MsgFmt_format_bin) { + // just dump the binary part + out << algo::strptr((char*)&msg,msg.length); + printed=true; + } + if (!printed && fmt.pretty) { + algo::char_PrintNTimes(' ', out, fmt.indent*2); + if (ams::LogMsg *logmsg = ams::LogMsg_Castdown(msg)) { + if (fmt.strip == 0) { + out << "ams.LogMsg"; + Showlen(fmt,msg,out); + out << Keyval("proc_id",logmsg->proc_id) + << Keyval("tstamp",logmsg->tstamp) + << Keyval("logcat",logcat_Getary(*logmsg)); + out << " text:\\" << eol; + char_PrintNTimes(' ', out, (fmt.indent+1)*2); + out << LimitLengthCRC(text_Getary(*logmsg), fmt.payload_lim); + } else { + out << logmsg->proc_id + <<" "<type == ams_MsgHeader_type_ams_ShmHbMsg); + if (trace) { + tempstr out; + ams::MsgHeader &what=msg ? Castbase(*msg) : *payload; + lib_ams::MsgFmt fmt; + lib_ams::PrintMsg(fmt, what, out); + if (algo_lib::LogcatFilterQ(algo_lib_logcat_ams,out)) { + prlog(lib_ams::_db.proc_id<<" "<. -// -// Target: lib_ams (lib) -- Library for AMS middleware, supporting file format & messaging -// Exceptions: yes -// Source: cpp/lib_ams/expect.cpp -- Expect implementation -// - -#include "include/lib_ams.h" - -// ----------------------------------------------------------------------------- - -// In-process `expect` implementation allows pausing reading of inputs until -// a certain prlog output is produced -// Motivating example: -// InputMsg1 -// InputMsg2 -// Expect text:blah -// InputMsg3 -// InputMsg3 is not processed until blah is printed. -// Implementation: -// When reading an input message: -// clear output buffer -// if read an ExpectMsg: -// set expect string to the input data -// check output buffer (match any outputs since last input against expect string) -// set expect timeout -// Expect timeout: -// exit process with error -// When printing: -// add to output buffer (limit: 100K). -// if expect mode, check output buffer -void lib_ams::ExpectEnable(strptr str) { - _db.expect_str=str; - hook_Set0(_db.th_expect, ExpectTimeout); - _db.th_expect.delay = algo::ToSchedTime(_db.expect_timeout); - _db.th_expect.time = algo_lib::_db.clock + _db.th_expect.delay; - bh_timehook_Insert(_db.th_expect); - lib_ams::cd_fdin_read_RemoveAll(); - prlog_cat(algo_lib_logcat_expect - ,"lib_ams.expect_begin" - <= 0) { - // resume reading messages from all inputs - ind_beg(_db_fdin_curs,fdin,_db) { - lib_ams::cd_fdin_read_Insert(fdin); - }ind_end; - // resume reading messages from stream - if (lib_ams::FStream *dflt_stream = lib_ams::ind_stream_Find(lib_ams::_db.dflt_stream_id)) { - prlog_cat(algo_lib_logcat_expect - ,"lib_ams.expect_end" - < maxbuf) { - int skip = maxbuf / 2; - memmove(_db.expect_buf.ch_elems, _db.expect_buf.ch_elems + skip, buf_len-skip); - _db.expect_buf.ch_n -= skip; - _db.expect_pos = i32_Max(_db.expect_pos-skip,0); - } -} diff --git a/cpp/lib_ams/file.cpp b/cpp/lib_ams/file.cpp index 2f9480dc..2a00c8fd 100644 --- a/cpp/lib_ams/file.cpp +++ b/cpp/lib_ams/file.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 @@ -219,9 +219,7 @@ ams::MsgHeader *lib_ams::ReadMsg(lib_ams::FReadfile &rf, u64 seqno) { if (OkQ(rf) && rf.block.first_seqno <= seqno && seqno < rf.block.first_seqno + rf.block.n_messages) { u32 *offset = offset_Find(rf,seqno - rf.block.first_seqno); if (offset) { - //prlog(*offset); msg = (ams::MsgHeader*)(rf.buf_elems + *offset); - //prlog("msg type " << msg->type << " length:" << msg->length); } } return msg; diff --git a/cpp/lib_ams/shm.cpp b/cpp/lib_ams/shm.cpp new file mode 100644 index 00000000..72d8b16b --- /dev/null +++ b/cpp/lib_ams/shm.cpp @@ -0,0 +1,619 @@ +// Copyright (C) 2023-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: lib_ams (lib) -- Library for AMS middleware, supporting file format & messaging +// Exceptions: yes +// Source: cpp/lib_ams/shm.cpp +// + +#include "include/lib_ams.h" + +#ifdef WIN32 +#include +#endif + +// ----------------------------------------------------------------------------- + +// Scan /dev/shm for stale shm files and delete them +// A file is stale if it's flockable (i.e. no process has locked it for writing) +// and it's at least 15 seconds old +void lib_ams::CleanOldShmFiles() { +#ifndef WIN32 // not needed on Windows as named shm segments are not persistent + ind_beg(algo::Dir_curs,entry,"/dev/shm/*.ams") { + ams::ShmId shm_id; + int fd=open(Zeroterm(entry.pathname), O_RDONLY); + if (fd != -1 && algo::ModTime(entry.pathname).value + algo::UNTIME_PER_SEC*15 < algo::CurrUnTime().value) { + if (flock(fd,LOCK_EX|LOCK_NB)!=0) { + } else { + (void)unlink(Zeroterm(entry.pathname)); + } + } + if (fd!=-1) { + close(fd); + } + }ind_end; +#endif +} + +// ----------------------------------------------------------------------------- + +// return TRUE if shared memory region is attached to shm SHM. +bool lib_ams::ShmemFdOpenQ(lib_ams::FShm &shm) { +#ifdef WIN32 + bool ret = shm.shm_handle; +#else + bool ret = ValidQ(shm.shm_file.fd); +#endif + return ret; +} + +// ----------------------------------------------------------------------------- + +// Open shared memory for reading/writing (as specified in FLAGS) +// and return success status +// Fields initialized: +// - shm.filename +// - shm.shm_handle (windows) +// - shm.shm_file (linux) +// - shm.shm_region, if mapped successfully +// If the segment is opened for writing, it is flocked. +bool lib_ams::ShmemOpenFile(lib_ams::FShm &shm, ams::ShmFlags flags) { + i64 size = 0; + bool ok = false; +#ifdef WIN32 + // create or open named shared memory segment + shm.filename = tempstr() << "Global\\" << _db.file_prefix << "-" << shm.shm_id <<".ams"; + int access = write_Get(flags) ? FILE_MAP_ALL_ACCESS : FILE_MAP_READ; + bool inherit = false; + // try opening first + shm.shm_handle = (u8*)OpenFileMapping(access,inherit,Zeroterm(shm.filename)); + // in write mode, try creating if needed + if (!shm.shm_handle && write_Get(flags)) { + shm.shm_handle = (u8*)CreateFileMapping( + INVALID_HANDLE_VALUE, // use paging file + NULL, // default security + PAGE_READWRITE, // read/write access + 0, // maximum object size (high-order DWORD) + lib_ams::_db.shmem_size, // maximum object size (low-order DWORD) + Zeroterm(shm.filename)); // name of mapping object (section name, not a file) + } + // if the object has been already created CreateFileMapping() returns existing handle + // and does not change size, GetLastError() indicates ERROR_ALREADY_EXISTS. + // This helps us to avoid locks. + ok = bool(shm.shm_handle) && (!write_Get(flags) || !GetLastError()); + // map section to virtual memory region + if (ok) { + shm.shm_region.elems = (u8*)MapViewOfFile(shm.shm_handle, // handle of shm section + access, // read/write permission + 0, // file offset high + 0, // file offset low + 0); // length - 0 means up to end of file + ok = shm.shm_region.elems != NULL; + } + // determine region size + if (ok) { + MEMORY_BASIC_INFORMATION mbi; + if (VirtualQuery(shm.shm_region.elems,&mbi,sizeof mbi)==sizeof mbi) { + size = mbi.RegionSize; + } + } + // TODO move duplicate code somewhere + // create a 'working area mask' + // 1<= lib_ams::_db.max_msg_size*2; + // cleanup in case of error - TBD needed? + if (!ok && shm.shm_region.elems) { + UnmapViewOfFile(shm.shm_region.elems); + shm.shm_region.elems = NULL; + } + if (!ok && shm.shm_handle) { + CloseHandle(shm.shm_handle); + shm.shm_handle = NULL; + } +#else // linux + int create_flags = (write_Get(flags) ? (O_RDWR|O_CREAT) : O_RDONLY); + int mode = write_Get(flags) ? S_IRUSR | S_IWUSR : S_IRUSR; + nonblock_Set(shm.flags,nonblock_Get(flags)); + // POSIX says / character in argument to shm_open is implementation-defined + // Practically, shm_open fails on Linux if / is used. + shm.filename = tempstr() << _db.file_prefix << (_db.file_prefix=="" ? "" : "-") << shm.shm_id << ".ams"; + if (_db.file_prefix == "") { + size = lib_ams::_db.shmem_size; + shm.shm_region = algo::memptr((u8*)algo_lib::lpool_AllocMem(lib_ams::_db.shmem_size),size); + shm.created=true; + } else { + // create file + shm.shm_file.fd.value = shm_open(Zeroterm(shm.filename), create_flags, mode); + ok = ValidQ(shm.shm_file.fd); + // determine shm size + if (ok) { + size = algo::GetFileSize(shm.shm_file.fd); + if (size == 0) { + shm.created=true; + size = lib_ams::_db.shmem_size; + ok = ok && ftruncate(shm.shm_file.fd.value, size)==0; + } + } + ok = ok && i32(size) >= lib_ams::_db.max_msg_size*2; + // map the region + if (ok) { + int prot = write_Get(flags) ? PROT_READ | PROT_WRITE : PROT_READ; + shm.shm_region = algo::memptr((u8*)mmap(NULL, size, prot, MAP_SHARED, shm.shm_file.fd.value, 0), size); + } + } + if (shm.created) { + memset(shm.shm_region.elems,0,size);// touch all bytes + } + // 1<off) + <shm_id) + <off) + <type) + <length) + <off < shm.writelimit; + if (!ret && !nonblock_Get(shm.flags)) { + do { + lib_ams::_db.trace.n_write_block_spin++; + lib_ams::PollCtlIn(); + ret = shm.c_write->off < shm.writelimit; + shm.n_write_block++; + if (algo_lib_logcat_slowness.enabled) { + if ((shm.n_write_block & ((1<<20)-1))==0) { + prcat(slowness, lib_ams::_db.proc_id + <<": writing to "<off); + ret = seqmsg+1; + } + } + return ret; +} + +// Finish writing message of length LENGTH, +// and send the result. +void lib_ams::EndWrite(lib_ams::FShm &shm, void *ptr, int len) { + ams::Shmmsg *shmmsg = (ams::Shmmsg*)((u8*)ptr - ssizeof(ams::Shmmsg)); + int L = ssizeof(ams::Shmmsg) + len; + shmmsg->shm_id = shm.shm_id; + shmmsg->off = shm.c_write->off; + shmmsg->tstamp = algo::CurrSchedTime().value; + shmmsg->type = ams_MsgHeader_type_ams_Shmmsg; + shm.c_write->off = AddOffset(shm.c_write->off, L); + ams::Shmmsg *next = MsgAtOffset(shm,shm.c_write->off); + next->length = 0;// length 0 means the message isn't ready + sfence(); + shmmsg->length = L;// mark message as ready! + // if shm is being both written and read by this process + // trigger reading + if (shm.c_read) { + cd_poll_read_Insert(*shm.c_read); + } +} + +// If the shm is attached to a writable shared memory segment, +// write sequenced message to shm SHM, and increment sequence number +// and shm offset. +// Message must be within max. message size +// If the shm is not configured for writingIf an output fd is associated with the shm, hthe shm, write +bool lib_ams::WriteMsg(lib_ams::FShm &shm, ams::MsgHeader &msg) { + bool ret=false; + int len = msg.length; + if (void *ptr = lib_ams::BeginWrite(shm,msg.length)) { + memcpy(ptr, &msg, msg.length); + lib_ams::EndWrite(shm,ptr,len); + ret=true; + } else if (algo_lib_logcat_slowness.enabled) { + lib_ams::FShmember *slowest=NULL; + ind_beg(shm_c_shmember_curs,shmember,shm) { + if (slowest==NULL || shmember.off < slowest->off) { + slowest=&shmember; + } + }ind_end; + prcat(slowness,lib_ams::_db.proc_id<<": writing to "<shmember : ams::ShmemberId())) + <off-slowest->off : 0) + <<" msg "<.- -- enough to identify any number of processes within +// a cluster. +// If the variable _db.shm_files_cleaned is FALSE (which is the default), +// clean any stale (unlocked) shm files in /dev/shm/*.ams +// In SHMEM mode, all current and future memory is locked using mlockall. +bool lib_ams::Init(algo::strptr file_prefix, ams::ProcId proc_id) { + bool shmem_mode = file_prefix != ""; + lib_ams::_db.file_prefix = file_prefix; + lib_ams::_db.proc_id = proc_id; + _db.c_thisproc = &lib_ams::ind_proc_GetOrCreate(lib_ams::_db.proc_id);// so it exists + if (shmem_mode && bool_Update(lib_ams::_db.shm_files_cleaned,true)) { + lib_ams::CleanOldShmFiles(); + } + lib_ams::_db.shmem_mode = shmem_mode; + if (shmem_mode) { + } else { + BeginReadStdin(); + } + bool ok = true; + //bool lock_ok = mlockall(MCL_CURRENT | MCL_FUTURE)==0; + // if (!lock_ok) { + // prlog(lib_ams::_db.proc_id<<" WARNING mlockall failed; expect high latency"); + // } + return ok; +} + +void lib_ams::Uninit() { + lib_ams::_db.c_shm_ctl=NULL; + shm_RemoveAll(); +} + +void lib_ams::shm_file_Cleanup(lib_ams::FShm &shm) {// fcleanup:lib_ams.FShm.shm_file +#ifdef WIN32 + // unmap section from process address space for reader and writer as well + if (shm.shm_region.elems) { + UnmapViewOfFile(shm.shm_region.elems); + Refurbish(shm.shm_region); + } + // close named section + // note that section will be actually removed along with last reference to it + if (shm.shm_handle) { + CloseHandle(shm.shm_handle); + shm.shm_handle = NULL; + } +#else + if (shm.created) { + if (ShmemFdOpenQ(shm)) { + (void)flock(shm.shm_file.fd.value, LOCK_UN); + } + if (shm.filename != "") { + shm_unlink(Zeroterm(shm.filename)); + shm.filename = ""; + } + } +#endif +} + +// ----------------------------------------------------------------------------- + +void lib_ams::CtlMsg_ShmHbMsg(ams::ShmHbMsg &msg) { + lib_ams::FShmember *shmember = lib_ams::ind_shmember_Find(msg.shmember); + if (!shmember) { + lib_ams::ind_proc_GetOrCreate(msg.shmember.proc_id); + lib_ams::ind_proc_GetOrCreate(msg.shmember.shm_id.proc_id); + lib_ams::ind_shm_GetOrCreate(msg.shmember.shm_id); + shmember=&lib_ams::shmember_Alloc(); + shmember->shmember=msg.shmember; + if (!shmember_XrefMaybe(*shmember)) { + shmember_Delete(*shmember); + shmember=NULL; + } + } + if (shmember) { + shmember->off = msg.off; + shmember->budget = msg.wbudget; + shmember->last_hb = algo_lib::_db.clock; + if (UpdateWriteLimit(*shmember->p_shm)) { + ind_beg(_db_fdin_curs,fdin,lib_ams::_db) { + if (!cd_fdin_read_InLlistQ(fdin) && ch_N(_db.expect_str)==0) { + cd_fdin_read_Insert(fdin); + } + }ind_end; + } + } +} + +void lib_ams::ReadCtlMsg(lib_ams::FShm &, ams::MsgHeader &msg) { + if (!lib_ams::CtlMsgDispatch(msg)) { + } +} + +// Read next input line from stdin +// The line is parsed as an AMS message. It could be a Shmmsg or any other msg. +// If the line doesn't look like anything, it is converted to ams.InputLineMsg +// Then, look up a shm where to post the message. +// If we see a Shmmsg, find shm where this message is intended to go and write the message there. +// Otherwise, post the message to the default shm (lib_ams::_db.dflt_shm_id) +// If the shm where we are posting the message is full (won't accept the message) +// then reading of fdin is stopped and will resume after the shm has room. +// If there is nowhere to post the message because no target shm is found, the counter +// trace.n_fdin_drop_notgt is incremented and a message is printed in verbose mode. +void lib_ams::cd_fdin_read_Step() { + lib_ams::FFdin &fdin = *cd_fdin_read_RotateFirst(); + algo::strptr msgstr = in_GetMsg(fdin); + if (msgstr.elems) { + bool processed=true; + lib_ams::FShm *tgt_shm = NULL; + ams::MsgHeader *tgt_msg = NULL; + ary_RemoveAll(_db.fdin_buf); + (void)ams::MsgHeaderMsgs_ReadStrptr(msgstr, _db.fdin_buf); + if (!_db.fdin_buf.ary_n) { + lib_ams::InputLineMsg_FmtByteAry(_db.fdin_buf, lib_ams::_db.proc_id, msgstr); + } + ams::Shmmsg *shmmsg = ams::Shmmsg_Castdown(*(ams::MsgHeader*)_db.fdin_buf.ary_elems); + if (shmmsg) { + tgt_shm = lib_ams::ind_shm_Find(shmmsg->shm_id); + if (tgt_shm) { + if (shmmsg->off == 0) {// allow user not to guess + shmmsg->off = tgt_shm->c_write->off; + } + if (shmmsg->off == tgt_shm->c_write->off) { + tgt_msg = payload_Get(*shmmsg); + } + } + } else { + tgt_shm = lib_ams::ind_shm_Find(lib_ams::_db.dflt_shm_id); + tgt_msg = (ams::MsgHeader*)_db.fdin_buf.ary_elems; + } + if (!tgt_msg) { + // message wasn't parsed + } else if (!tgt_shm) { + // no target shm found + } else if (!(tgt_shm->c_write && tgt_shm->c_read)) { + // must be readable & writable + } else if (WriteMsg(*tgt_shm,*tgt_msg)) { + // success + _db.trace.n_fdin_posted++; + } else { + // stop reading stdin - no progress is possible + _db.trace.n_fdin_pushback++; + verblog(lib_ams::_db.proc_id<<" shmblocked "<shm_id<<", write budget "< u64(budget); + return ret; +} diff --git a/cpp/lib_ams/shmember.cpp b/cpp/lib_ams/shmember.cpp new file mode 100644 index 00000000..2805fdb7 --- /dev/null +++ b/cpp/lib_ams/shmember.cpp @@ -0,0 +1,242 @@ +// 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: lib_ams (lib) -- Library for AMS middleware, supporting file format & messaging +// Exceptions: yes +// Source: cpp/lib_ams/shmember.cpp +// + +#include "include/algo.h" +#include "include/lib_ams.h" + +// If the shm is open for reading, check to see if a message +// is available. If it is available, return pointer to message. +ams::Shmmsg *lib_ams::PeekMsg(lib_ams::FShmember &shmember) { + lib_ams::FShm &shm = *shmember.p_shm; + ams::Shmmsg *msg = MsgAtOffset(shm,shmember.off); + ams::Shmmsg *ret = NULL; + int L = msg->length; + if (L >= ssizeof(ams::Shmmsg)) { + lfence(); + if (msg->type == ams_MsgHeader_type_ams_Shmmsg && msg->shm_id == shm.shm_id && msg->off == shmember.off) { + ret = msg; + } else { + ShmError(shm,msg,"unexpected message id"); + } + } else if (L > 0) { + ShmError(shm,msg,"message too short"); + } + return ret; +} + +// Called by the client +// to avoid reading current message +void lib_ams::StopReading(lib_ams::FShm &shm) { + UnreadMsg(); + if (shm.c_read) { + cd_poll_read_Remove(*shm.c_read); + } +} + +// ----------------------------------------------------------------------------- + +// Read up to N messages from the message heap +// Messages are processed in the order in which they were posted to the shms. +void lib_ams::bh_shmember_read_Step() { + for (int i=0; i<20 && bh_shmember_read_N()>0; i++) { + lib_ams::FShmember *shmember = bh_shmember_read_First(); + lib_ams::FShm *shm=shmember->p_shm; + _db.c_cur_shmember=shmember; + if (ams::Shmmsg *shmmsg = shmember->c_cur_msg) { + if (ams::MsgHeader *payload = payload_Get(*shmmsg)) { + if (algo_lib_logcat_ams.enabled) { + TraceMsg(shmmsg,payload); + } + h_amsmsg_Call(*shm,*payload); + } + } + if (shmember->c_cur_msg) { + SkipMsg(*shmember);// sets c_curmsg back to NULL + ams::Shmmsg *shmmsg = PeekMsg(*shmember); + shmember->c_cur_msg = shmmsg; + if (shmmsg) { + shmember->sortkey=shmmsg->tstamp + shm->schedbias; + bh_shmember_read_Reheap(*shmember); + } else { + bh_shmember_read_Remove(*shmember); + if (!write_Get(shm->flags)) { + cd_poll_read_Insert(*shmember); + } + } + } else { + // message was not processed. + // stop reading and go back to polling + // is there a better method? + bh_shmember_read_Remove(*shmember); + cd_poll_read_Insert(*shmember); + } + } + _db.c_cur_shmember = NULL; +} + +// ----------------------------------------------------------------------------- + +// Check all shms (that are not already readable) for readability and +// transfer readable shms to the read heap with correct sort key. +// If powersave is enabled, then non-readable shms +// are transferred to the slow_poll_read list where they are polled less frequently +void lib_ams::cd_poll_read_Step() { + int n = cd_poll_read_N(); + for (int i=0; ic_cur_msg = shmmsg; + if (shmmsg) { + shmember->sortkey=shmmsg->tstamp; + bh_shmember_read_Reheap(*shmember); + cd_poll_read_Remove(*shmember); + } else if (write_Get(shmember->p_shm->flags)) { + // remove reader from poll loop if this process is the writer, i.e. + // an unsolicited message cannot show up + cd_poll_read_Remove(*shmember); + } else if (lib_ams::_db.powersave) { + cd_poll_read_Remove(*shmember); + cd_slow_poll_read_Insert(*shmember); + } else { + cd_poll_read_RotateFirst(); + } + } +} + +// ----------------------------------------------------------------------------- + +void lib_ams::cd_slow_poll_read_Step() { + int n = cd_slow_poll_read_N(); + for (int i=0; i0 ? 0 : algo_lib::_db.cpu_hz/1024; +} + +// ----------------------------------------------------------------------------- + +// Mark current message as read and move to the next message. +void lib_ams::SkipMsg(lib_ams::FShmember &shmember) { + lib_ams::FShm &shm=*shmember.p_shm; + if (ams::Shmmsg *msg = shmember.c_cur_msg) { + shmember.off = AddOffset(shmember.off, msg->length); + shmember.c_cur_msg = NULL; + // Force a report (ShmHb) every N messages + if (shmember.off >= shm.next_ackoff) { + UpdateAckOffset(shm,shmember); + SendHb(shmember); + } + } +} + +// ----------------------------------------------------------------------------- + +// Send heartbeat to control shm +void lib_ams::SendHb(lib_ams::FShmember &shmember) { + if (lib_ams::_db.c_shm_ctl && lib_ams::_db.shmem_mode) { + lib_ams::FShm &shm = *shmember.p_shm; + if (w_Get(shmember.shmember.flags)) { + shmember.budget = algo::u64_SubClip(shm.writelimit, shmember.off); + } + shmember.last_hb = algo_lib::_db.clock; + lib_ams::ShmHbMsg_FmtShm(*lib_ams::_db.c_shm_ctl,shmember.shmember,shmember.off,shmember.budget); + } +} + +// Publish shm heartbeats to c_shm_ctl shm +void lib_ams::cd_hb_Step() { + lib_ams::FShmember &shmember = *cd_hb_RotateFirst(); + SendHb(shmember); +} + +// ----------------------------------------------------------------------------- + +// Create a read shmember for shm SHM +// Begin hot-polling the shm +bool lib_ams::OpenRead(lib_ams::FShm &shm, u64 off) { + bool ok = true; + if (!shm.c_read) { + ams::ShmemberId key(shm.shm_id,lib_ams::_db.proc_id,ams_ShmemberFlags_r); + //prlog(lib_ams::_db.proc_id<<": begin read "<shmember=key; + if (!shmember_XrefMaybe(*shm.c_read)) { + ok=false; + } + } + shm.c_read->off = off; + shm.c_read->last_hb=algo_lib::_db.clock; + UpdateAckOffset(shm,*shm.c_read); + read_Set(shm.flags,true); + cd_poll_read_Insert(*shm.c_read); + cd_hb_Insert(*shm.c_read); + } + return ok; +} + +// ----------------------------------------------------------------------------- + +// Create a write shmember for shm SHM +bool lib_ams::OpenWrite(lib_ams::FShm &shm, u64 off) { + bool ok = true; + // lock file. + // the file may already exist and be locked -- this is OK, AMS root + // process usually pre-creates all shm segments and locks them. + if (!shm.c_write) { + if (ShmemFdOpenQ(shm)) { + ok = flock(shm.shm_file.fd.value, LOCK_EX|LOCK_NB)==0; + if (!ok) { + prerr(lib_ams::_db.proc_id<<": opening "<shmember=key; + if (!shmember_XrefMaybe(*shm.c_write)) { + ok=false; + } + } + shm.c_write->last_hb=algo_lib::_db.clock; + shm.c_write->off = off; + write_Set(shm.flags,true); + cd_hb_Insert(*shm.c_write); + UpdateWriteLimit(shm); + } + } + return ok; +} + +void lib_ams::UnreadMsg() { + if (_db.c_cur_shmember) { + _db.c_cur_shmember->c_cur_msg = NULL; + } +} diff --git a/cpp/lib_ams/stream.cpp b/cpp/lib_ams/stream.cpp deleted file mode 100644 index 9550d910..00000000 --- a/cpp/lib_ams/stream.cpp +++ /dev/null @@ -1,1056 +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: lib_ams (lib) -- Library for AMS middleware, supporting file format & messaging -// Exceptions: yes -// Source: cpp/lib_ams/stream.cpp -// -// TODOs: -// - Define procedure to: -// spawn a child process -// Child process can be handed an argument, where to start (stream id + seqno + offset). -// register child process as a reading member -// have the child process subscribe to main ctl stream -// have child process open its own ctl stream for writing -// subscribe to child process's ctl stream -// have child process open output file -// subscribe to output file -// After that, we can publish messages to our own CTL stream that cause appropriate effects -// Have the child process subscribe to output. Subscribe to child process's output. -// - Describe message layout in shared memory region -// --- -// WINDOWS NOTE: -// On windows in multi-threaded mode, lib_ams must be accessed from the main thread only. - -#include "include/lib_ams.h" - -#ifdef WIN32 -#include -#endif - -// ----------------------------------------------------------------------------- - -// The length field of a message must reside entirely within one cache line, -// or the sfence/lfence instructions won't behave as expected. -// So, we force each message to start at an address that'a a multiple of machine -// cache line size. -inline u64 AddOffset(u64 offset, int n) { - return (offset + n + 63) & ~63; -} - -inline ams::Seqmsg *MsgAtOffset(lib_ams::FStream &stream, u64 offset) { - offset = offset & stream.offset_mask; - return (ams::Seqmsg*)(stream.shm_region.elems + offset); -} - -inline void UpdateAckOffset(lib_ams::FStream &stream) { - stream.next_ackoff = stream.rpos.off + stream.offset_mask / 8; -} - -// ----------------------------------------------------------------------------- - -// Scan /dev/shm for stale stream files and delete them -// A file is stale if it's flockable (i.e. no process has locked it for writing) -// and it's at least 1 hour old -void lib_ams::CleanOldStreamFiles() { -#ifndef WIN32 // not needed on Windows as named shm segments are not persistent - ind_beg(algo::Dir_curs,entry,"/dev/shm/*.ams") { - ams::StreamId stream_id; - int fd=open(Zeroterm(entry.pathname), O_RDONLY); - if (fd != -1 && algo::ModTime(entry.pathname).value + algo::UNTIME_PER_SEC*3600 < algo::CurrUnTime().value) { - if (flock(fd,LOCK_EX|LOCK_NB)!=0) { - } else { - (void)unlink(Zeroterm(entry.pathname)); - } - } - if (fd!=-1) { - close(fd); - } - }ind_end; -#endif -} - -// ----------------------------------------------------------------------------- - -// return TRUE if shared memory region is attached to stream STREAM. -bool lib_ams::ShmemOpenQ(lib_ams::FStream &stream) { -#ifdef WIN32 - bool ret = stream.shm_handle; -#else - bool ret = ValidQ(stream.shm_file.fd); -#endif - return ret; -} - -// ----------------------------------------------------------------------------- - -// Open shared memory for reading/writing (as specified in FLAGS) -// and return resulting shared memory region size. -// Fields initialized: -// - stream.filename -// - stream.shm_handle (windows) -// - stream.shm_file (linux) -// - stream.shm_region, if mapped successfully -i64 lib_ams::OpenShmem(lib_ams::FStream &stream, ams::StreamFlags flags) { - i64 size = 0; -#ifdef WIN32 - // create or open named shared memory segment - stream.filename = tempstr() << "Global\\" << _db.file_prefix << "-" << stream.stream_id <<".ams"; - int access = write_Get(flags) ? FILE_MAP_ALL_ACCESS : FILE_MAP_READ; - bool inherit = false; - // try opening first - stream.shm_handle = (u8*)OpenFileMapping(access,inherit,Zeroterm(stream.filename)); - // in write mode, try creating if needed - if (!stream.shm_handle && write_Get(flags)) { - stream.shm_handle = (u8*)CreateFileMapping( - INVALID_HANDLE_VALUE, // use paging file - NULL, // default security - PAGE_READWRITE, // read/write access - 0, // maximum object size (high-order DWORD) - lib_ams::_db.shmem_size, // maximum object size (low-order DWORD) - Zeroterm(stream.filename)); // name of mapping object (section name, not a file) - } - // if the object has been already created CreateFileMapping() returns existing handle - // and does not change size, GetLastError() indicates ERROR_ALREADY_EXISTS. - // This helps us to avoid locks. - bool ok = bool(stream.shm_handle) && (!write_Get(flags) || !GetLastError()); - // map section to virtual memory region - if (ok) { - stream.shm_region.elems = (u8*)MapViewOfFile(stream.shm_handle, // handle of shm section - access, // read/write permission - 0, // file offset high - 0, // file offset low - 0); // length - 0 means up to end of file - ok = stream.shm_region.elems != NULL; - } - // determine region size - if (ok) { - MEMORY_BASIC_INFORMATION mbi; - if (VirtualQuery(stream.shm_region.elems,&mbi,sizeof mbi)==sizeof mbi) { - size = mbi.RegionSize; - } - } - // TODO move duplicate code somewhere - // create a 'working area mask' - // 1<= lib_ams::_db.max_msg_size*2; - // cleanup in case of error - TBD needed? - if (!ok && stream.shm_region.elems) { - UnmapViewOfFile(stream.shm_region.elems); - stream.shm_region.elems = NULL; - } - if (!ok && stream.shm_handle) { - CloseHandle(stream.shm_handle); - stream.shm_handle = NULL; - } -#else // linux - int create_flags = (write_Get(flags) ? (O_RDWR|O_CREAT) : O_RDONLY); - int mode = write_Get(flags) ? S_IRUSR | S_IWUSR : S_IRUSR; - // compute filename - // POSIX says / character in argument to shm_open is implementation-defined - // Practically, shm_open fails on Linux if / is used. - // So we treat it as a prefix - stream.filename = tempstr() << _db.file_prefix << "-" << stream.stream_id <<".ams"; - // create file - stream.shm_file.fd.value = shm_open(Zeroterm(stream.filename), create_flags, mode); - bool ok = ValidQ(stream.shm_file.fd); - // determine stream size - if (ok) { - size = algo::GetFileSize(stream.shm_file.fd); - if (size == 0) { - size = lib_ams::_db.shmem_size; - ok = ok && ftruncate(stream.shm_file.fd.value, size)==0; - } - } - if (ok && write_Get(flags)) { - ok = ok && flock(stream.shm_file.fd.value, LOCK_EX)==0; - } - // create a 'working area mask' - // 1<= lib_ams::_db.max_msg_size*2; - // map the region - if (ok) { - int prot = write_Get(flags) ? PROT_READ | PROT_WRITE : PROT_READ; - stream.shm_region.elems = (u8*)mmap(NULL, size, prot, MAP_SHARED, stream.shm_file.fd.value, 0); - ok = stream.shm_region.elems != NULL; - } -#endif // win/linux - return ok ? size : 0; -} - -// ----------------------------------------------------------------------------- - -// Open stream for reading or writing (but not both) -// If shared memory mode (lib_ams::_db.shmem_mode) is set, -// The file creator sets stream size. -// Writer creates & locks the file. -// Reader determines file from file size -// If shared memory mode is not set (stdio mode), -// the stream is attached to a private memory block of default size. -// When opening for writing: -// The next message written to the stream will have sequence SEQ and offset OFFSET. -// Default is to use sequence 1, offset 0. -// (However a newly spawned child process can be provided a known sequence & offset by the parent.) -// When opening for reading: -// begin hot-polling for new messages on the stream -bool lib_ams::OpenStream(lib_ams::FStream &stream, ams::StreamFlags flags, ams::StreamPos pos) { - // code formatters and scripts do not like flow control interrupted with ifdefs - if (!ShmemOpenQ(stream)) { - u64 size = lib_ams::_db.shmem_mode ? OpenShmem(stream,flags) : lib_ams::_db.shmem_size; - // create a substitute so that messages can always be written - if (!stream.shm_region.elems) { - int nadd = size - stream.byteary.ary_n; - if (nadd) { - memset(ary_AllocN(stream.byteary, nadd).elems, 0, nadd); - } - stream.shm_region.elems = stream.byteary.ary_elems; - } - stream.offset_mask = (1 << algo::FloorLog2(size - lib_ams::_db.max_msg_size*2)) - 1; - stream.shm_region.n_elems = size; - // ensure the acks are sent frequently enough - UpdateAckOffset(stream); - if (size) { - stream.flags = flags; - stream.rpos = pos; - stream.wpos = pos; - } - if (read_Get(stream.flags) || write_Get(stream.flags)) { - cd_stream_hb_Insert(stream); // begin publishing heartbeats for stream - } - UpdateBudget(stream); - if (read_Get(stream.flags) && lib_ams::_db.dflt_stream_id == ams::StreamId()) { - lib_ams::_db.dflt_stream_id = stream.stream_id; - } - if (read_Get(stream.flags)) { - cd_poll_read_Insert(stream); - } - if (ch_N(lib_ams::_db.regx_trace.expr)) { - ApplyTrace(stream,lib_ams::_db.regx_trace,true); - } - } - verblog(lib_ams::_db.proc_id - <<" openstream" - <seqmsg_id) - <type) - <length) - <length; - if (L >= ssizeof(ams::Seqmsg)) { - lfence(); - if (msg->type == ams_MsgHeader_type_ams_Seqmsg && msg->seqmsg_id.stream_id == stream.stream_id && msg->seqmsg_id.seq == stream.rpos.seq) { - stream.cur_msg = msg; - } else { - WriterError(stream,msg); - } - } else if (L > 0) { - WriterError(stream,msg); - } - } - return stream.cur_msg; -} - -// Called by the client -// to aoivd reading current message -void lib_ams::StopReading(lib_ams::FStream &stream) { - stream.cur_msg=NULL; - cd_poll_read_Remove(stream); -} - -// Mark current message as read and move to the next message. -void lib_ams::SkipMsg(lib_ams::FStream &stream) { - if (ams::Seqmsg *msg=stream.cur_msg) { - stream.rpos.seq++; - stream.rpos.off = AddOffset(stream.rpos.off, stream.cur_msg->length); - stream.cur_msg = NULL; - // #AL# NOTE: tracing of read messages occurs after any outputs - // generated by those messages. - // Moving TraceMsg to pre-dispatch will break expect (since it will match its - // own trace). - if (UNLIKELY(trace_read_Get(stream.flags))) { - lib_ams::TraceMsg(stream,Castbase(*msg),true); - } - // Force a report (StreamHb) every N messages - if (stream.rpos.off >= stream.next_ackoff) { - UpdateAckOffset(stream); - SendHb(stream); - } - } -} - -int lib_ams::WriteBudget(lib_ams::FStream &stream) { - return u64_Max(stream.limit, stream.wpos.off) - stream.wpos.off; -} - -// Send heartbeat to control stream -// Update -void lib_ams::SendHb(lib_ams::FStream &stream) { - if (lib_ams::_db.c_stream_ctl && lib_ams::_db.shmem_mode) { - // report on this stream's reading progress - if (read_Get(stream.flags)) { - lib_ams::StreamHbMsg_FmtAmsStream(*lib_ams::_db.c_stream_ctl,ams::Member(_db.proc_id,stream.stream_id,ams_Member_mode_r),stream.rpos,0); - } - // report on this stream's writing progress - if (write_Get(stream.flags)) { - lib_ams::StreamHbMsg_FmtAmsStream(*lib_ams::_db.c_stream_ctl,ams::Member(_db.proc_id,stream.stream_id,ams_Member_mode_w),stream.wpos,WriteBudget(stream)); - } - } -} - -// Publish stream heartbeats to c_stream_ctl stream -void lib_ams::cd_stream_hb_Step() { - lib_ams::FStream &stream = *cd_stream_hb_RotateFirst(); - SendHb(stream); -} - -// Check all streams (that are not already readable) for readability. -// If readable, call h_msg hook. -void lib_ams::cd_poll_read_Step() { - int n=cd_poll_read_N(); - for (int i=0; iburst; ++j) { - if (ams::Seqmsg *seqmsg = PeekMsg(*stream)) { - if (ams::MsgHeader *payload = payload_Get(*seqmsg)) { - h_msg_Call(*stream,*payload); - } - if (stream->cur_msg) { - SkipMsg(*stream); - } else { - break;// user called StopReading, finish burst early - } - } else { - if (!lib_ams::_db.shmem_mode) { - // private (stdio) mode: stop polling stream - cd_poll_read_Remove(*stream); - } - break; - } - } - } -} - -// If STREAM is out of write space, and stream is set to blocking mode, -// poll indefinitely all control streams (zd_ctlin list) for heartbeats -// that indicate that the stream write space is finally available -// (This happens when all stream readers read enough data so that some can be discarded, -// or all readers are eliminated.) -// Return TRUE if writing can proceed -inline static bool WaitBudget(lib_ams::FStream &stream) { - bool ret = stream.wpos.off < stream.limit; - if (!ret && !nonblock_Get(stream.flags)) { - stream.n_write_block++; - do { - lib_ams::_db.trace.n_write_block_spin++; - lib_ams::PollCtlIn(); - ret = stream.wpos.off < stream.limit; - } while (!ret); - } - return ret; -} - -void lib_ams::PollCtlIn() { - ind_beg(lib_ams::_db_zd_ctlin_curs,ctlin,lib_ams::_db) { - if (ams::Seqmsg *seqmsg = PeekMsg(ctlin)) { - if (ams::MsgHeader *payload = payload_Get(*seqmsg)) { - h_msg_Call(ctlin,*payload); - } - SkipMsg(ctlin); - } - }ind_end; -} - -// Begin writing message of length LENGTH -// Used by WriteMsg and with amc's pnew (acr pnew) for zero-copy sends. -// If successful, return pointer to region of size LENGTH whre the mssage can be written, -// otherwise return NULL. -void *lib_ams::BeginWrite(lib_ams::FStream &stream, int length) { - void *ret = NULL; - int L = ssizeof(ams::Seqmsg) + length; - if (L <= _db.max_msg_size) { - if (WaitBudget(stream)) { - ams::Seqmsg *seqmsg = MsgAtOffset(stream,stream.wpos.off); - ret = seqmsg+1; - } - } - return ret; -} - -// Finish writing message of length LENGTH, -// and send the result. -void lib_ams::EndWrite(lib_ams::FStream &stream, void *ptr, int len) { - ams::Seqmsg *seqmsg = (ams::Seqmsg*)((u8*)ptr - ssizeof(ams::Seqmsg)); - int L = ssizeof(ams::Seqmsg) + len; - seqmsg->seqmsg_id.stream_id = stream.stream_id; - seqmsg->seqmsg_id.seq = stream.wpos.seq; - seqmsg->seqmsg_id.off = stream.wpos.off; - seqmsg->type = ams_MsgHeader_type_ams_Seqmsg; - seqmsg->tsc = algo::get_cycles(); - stream.wpos.seq++; - stream.wpos.off = AddOffset(stream.wpos.off, L); - ams::Seqmsg *next = MsgAtOffset(stream,stream.wpos.off); - next->length = 0;// length 0 means the message isn't ready - sfence(); - seqmsg->length = L;// mark message as ready! - // copy message to output stream - if (trace_write_Get(stream.flags)) { - TraceMsg(stream,Castbase(*seqmsg),false); - } - // if stream is being both written and read by this process - // trigger reading - if (read_Get(stream.flags)) { - cd_poll_read_Insert(stream); - } -} - -// If the stream is attached to a writable shared memory segment, -// write sequenced message to stream STREAM, and increment sequence number -// and stream offset. -// Message must be within max. message size -// If the stream is not configured for writingIf an output fd is associated with the stream, hthe stream, write -bool lib_ams::WriteMsg(lib_ams::FStream &stream, ams::MsgHeader &msg) { - bool ret=false; - int len = msg.length; - if (void *ptr = lib_ams::BeginWrite(stream,msg.length)) { - memcpy(ptr, &msg, msg.length); - lib_ams::EndWrite(stream,ptr,len); - ret=true; - } - return ret; -} - -// Write message MSG to output, either in binary or text mode. -// Return success status -// If ISREAD flag is set, this is a copy of a message that has just been read -// from another stream. Otherwise, it's a copy of a message that's just been written. -// In stdin mode, where messages are read from ascii input and posted to the -void lib_ams::TraceMsg(lib_ams::FStream &stream, ams::MsgHeader &msg, bool isread) { - if (!write_err_Get(stream.flags)) { - if (trace_text_Get(stream.flags)) {// write as text - ams::Seqmsg *seqmsg = ams::Seqmsg_Castdown(msg); - ams::MsgHeader *printmsg = &msg; - if (seqmsg) { - ams::SeqmsgTrace *msgtrace - = ams::SeqmsgTrace_FmtByteAry(_db.fmt_buf - ,lib_ams::_db.proc_id - ,(isread?ams_SeqmsgTrace_mode_r:ams_SeqmsgTrace_mode_w) - ,seqmsg->seqmsg_id - ,seqmsg->tsc - ,payload_Get(*seqmsg)); - printmsg = &ams::Castbase(*msgtrace); - } - tempstr out; - ams::MsgHeaderMsgs_Print(out,*printmsg,printmsg->length); - out << "\n"; - (void)algo::WriteFile(algo::Fildes(1), (u8*)out.ch_elems, out.ch_n); - // make sure input messages are not scanned for output strings... - if (!isread) { - lib_ams::ExpectSaveOutput(out); - } - } else {// write as binary - (void)algo::WriteFile(algo::Fildes(1), (u8*)&msg, msg.length); - } - } -} - -// Initialize stream library -// FILE_PREFIX: unique filesystem prefix for all subsequently created streams -// Also clean any stale (unlocked) stream files. -// (this can be disabled by setting _db.stream_files_cleaned to true) -bool lib_ams::Init(algo::strptr file_prefix, ams::ProcId proc_id) { - bool shmem_mode = file_prefix != ""; - lib_ams::_db.file_prefix = file_prefix; - lib_ams::_db.proc_id = proc_id; - if (shmem_mode && bool_Update(lib_ams::_db.stream_files_cleaned,true)) { - lib_ams::CleanOldStreamFiles(); - } - lib_ams::_db.shmem_mode = shmem_mode; - if (shmem_mode) { - } else { - BeginReadStdin(); - } - bool ok = true; - // in text mode, enable tracing on all streams unless customized by user - if (!shmem_mode && _db.regx_trace.expr == "") { - Regx_ReadSql(_db.regx_trace, "%", true); - } - // not strictly speaking required but latency will not be good - // without this succeeding - // #AL# TODO -- add a flag to allow this - // bool lock_ok = mlockall(MCL_CURRENT | MCL_FUTURE)==0; - // if (!lock_ok) { - // prlog(lib_ams::_db.proc_id<<" WARNING mlockall failed; expect high latency"); - // } - return ok; -} - -void lib_ams::Uninit() { - lib_ams::_db.c_stream_ctl=NULL; - stream_RemoveAll(); -} - -void lib_ams::shm_handle_Cleanup(lib_ams::FStream &stream) {// fcleanup:lib_ams.FStream.handle_file -#ifdef WIN32 - // unmap section from process address space for reader and writer as well - if (stream.shm_region.elems) { - UnmapViewOfFile(stream.shm_region.elems); - Refurbish(stream.shm_region); - } - // close named section - // note that section will be actually removed along with last reference to it - if (stream.shm_handle) { - CloseHandle(stream.shm_handle); - stream.shm_handle = NULL; - } -#else - (void)stream; -#endif -} - -void lib_ams::shm_file_Cleanup(lib_ams::FStream &stream) {// fcleanup:lib_ams.FStream.shm_file -#ifndef WIN32 - if (write_Get(stream.flags)) { - if (ValidQ(stream.shm_file.fd)) { - (void)flock(stream.shm_file.fd.value, LOCK_UN); - } - if (stream.filename != "") { - shm_unlink(Zeroterm(stream.filename)); - stream.filename = ""; - } - } -#else - (void)stream; -#endif -} - -// ----------------------------------------------------------------------------- - -// Process joined the group -void lib_ams::CtlMsg_ProcAddMsg(ams::ProcAddMsg &msg) { - lib_ams::FProc &proc = ind_proc_GetOrCreate(msg.proc_id); - (void)proc; -} - -// A process has exited -// Remove any read/write members contributed by the process and -// potentially unblock some write streams -void lib_ams::CtlMsg_ProcRemoveMsg(ams::ProcRemoveMsg &msg) { - lib_ams::FProc *proc = ind_proc_Find(msg.proc_id); - if (proc) { - proc_Delete(*proc);// this deletes all members - UpdateBudgets(); - } -} - -void lib_ams::CtlMsg_DumpStreamTableMsg(ams::DumpStreamTableMsg &msg) { - if (msg.proc_id == ams::ProcId() || msg.proc_id == lib_ams::_db.proc_id) { - lib_ams::DumpStreamTable(); - } -} - -void lib_ams::CtlMsg_StreamHbMsg(ams::StreamHbMsg &msg) { - lib_ams::FMember *member = lib_ams::ind_member_Find(msg.member); - if (!member) { - // TODO: require ProcAdd or create procs implicitly? - // create pre-requisites - lib_ams::ind_proc_GetOrCreate(msg.member.proc_id); - lib_ams::ind_stream_GetOrCreate(msg.member.stream_id); - member=&lib_ams::member_Alloc(); - member->member=msg.member; - if (!member_XrefMaybe(*member)) { - member_Delete(*member); - member=NULL; - } - } - if (member) { - member->pos = msg.pos; - member->budget = msg.wbudget; - member->last_hb = algo::CurrUnTime(); - if (UpdateBudget(*member->p_stream)) { - ind_beg(_db_fdin_curs,fdin,lib_ams::_db) { - if (!cd_fdin_read_InLlistQ(fdin) && ch_N(_db.expect_str)==0) { - cd_fdin_read_Insert(fdin); - } - }ind_end; - } - } -} - -void lib_ams::ReadCtlMsg(lib_ams::FStream &, ams::MsgHeader &msg) { - lib_ams::CtlMsgDispatch(msg); -} - -// Read next input line from stdin -void lib_ams::cd_fdin_read_Step() { - lib_ams::FFdin &fdin = *cd_fdin_read_RotateFirst(); - algo::strptr msgstr = in_GetMsg(fdin); - if (msgstr.elems) { - bool processed=true; - lib_ams::FStream *tgt_stream = NULL; - ams::MsgHeader *tgt_msg = NULL; - ary_RemoveAll(_db.fdin_buf); - (void)ams::MsgHeaderMsgs_ReadStrptr(msgstr, _db.fdin_buf); - // Save input line verbatim if it doesn't correspond to any message - // TODO: check length - if (!_db.fdin_buf.ary_n) { - lib_ams::InputLineMsg_FmtByteAry(_db.fdin_buf, msgstr); - } - // figure out what kind of messages was provided on input - // it could be an explicit Seqmsg - // or, for any other message, we post it to dflt_stream_id - // (previously set with DfltStream message) - ams::Seqmsg *seqmsg = ams::Seqmsg_Castdown(*(ams::MsgHeader*)_db.fdin_buf.ary_elems); - if (seqmsg) { - tgt_stream = lib_ams::ind_stream_Find(seqmsg->seqmsg_id.stream_id); - if (tgt_stream) { - if (seqmsg->seqmsg_id.seq == 0) {// allow user not to guess - seqmsg->seqmsg_id.seq = tgt_stream->wpos.seq; - } - if (seqmsg->seqmsg_id.seq == tgt_stream->wpos.seq) { - tgt_msg = payload_Get(*seqmsg); - } - } - } else { - tgt_stream = lib_ams::ind_stream_Find(lib_ams::_db.dflt_stream_id); - tgt_msg = (ams::MsgHeader*)_db.fdin_buf.ary_elems; - } - if (tgt_msg && tgt_stream && read_Get(tgt_stream->flags)) { - if (WriteMsg(*tgt_stream,*tgt_msg)) { - _db.trace.n_fdin_posted++; - } else { - // stop reading stdin - no progress is possible - _db.trace.n_fdin_pushback++; - verblog(lib_ams::_db.proc_id<<" streamblocked "<stream_id); - cd_fdin_read_Remove(fdin); - processed=false; - } - } - // #AL# if input message has been dropped, help debug this situation - if (!tgt_stream) { - _db.trace.n_fdin_drop_notgt++; - verblog("# lib_ams.drop_msg" - <<" "<stream_id) : (tempstr()))); - prlog("out:" <<(_db.c_stream_out ? (tempstr()<<_db.c_stream_out->stream_id) : (tempstr()))); - prlog("dflt:" <<_db.dflt_stream_id); - AddCols(tbl,"stream,size,eof,budget"); - ind_beg(lib_ams::_db_zd_proc_curs,proc,lib_ams::_db) { - AddCol(tbl,tempstr()<pos; - last_hb = read_member->last_hb; - } - if (write_member) { - wpos = write_member->pos; - } - } - if (read_member) { - cell.text << ls<<"R"; - } - if (write_member) { - cell.text <<"W"; - } - if (read_Get(stream.flags) && read_member) { - algo::UnDiff hbbehind = algo::CurrUnTime() - last_hb; - bool online = ToSecs(hbbehind) < 2.0; - cell.style = online ? algo_TermStyle_green : algo_TermStyle_red; - } - algo_lib::FTxtcell &gapcell = algo_lib::AddCell(row,"",algo_TextJust_j_left,1); - if (read_Get(stream.flags) && read_member) { - u64 msgbehind = algo::u64_SubClip(eof,rpos.seq); - if (msgbehind>10) { - gapcell.text << " "< breakat) { - out << eol; - breakat = ch_N(out) + 80; - } - }ind_end; - ind_beg(lib_ams::_db_stream_curs,stream,lib_ams::_db) { - out << ls << stream.stream_id; - }ind_end; - prlog(out); - } -} - -// prlog hook for ams application, could be used for sending log messages to output stream -void lib_ams::Prlog(algo_lib::FLogcat *logcat, algo::SchedTime tstamp, strptr str) { - i32 max_payload_size = lib_ams::_db.max_msg_size - sizeof(ams::Seqmsg) - sizeof(ams::LogMsg); - if (UNLIKELY(logcat == &algo_lib_logcat_expect || !lib_ams::_db.c_stream_out)) { - // force output to stdout to avoid interaction between expect implementation - // and its output - algo::Prlog(logcat,tstamp,str); - } else { - while (ch_N(str)) { - lib_ams::LogMsg_FmtAmsStream(*lib_ams::_db.c_stream_out - , logcat->logcat - , tstamp - , ch_FirstN(str,max_payload_size)); - str = ch_RestFrom(str,max_payload_size); - } - } -} diff --git a/cpp/lib_http/lib_http.cpp b/cpp/lib_http/lib_http.cpp new file mode 100644 index 00000000..d1ca9bf7 --- /dev/null +++ b/cpp/lib_http/lib_http.cpp @@ -0,0 +1,319 @@ +// Copyright (C) 2024,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: lib_http (lib) -- Library for HTTP support +// Exceptions: yes +// Source: cpp/lib_http/lib_http.cpp +// +// This source code constitutes confidential information and trade secrets +// of AlgoRND. Unauthorized copying, distribution or sharing of this file, +// via any medium, is strictly prohibited. + +#include "include/algo.h" +#include "include/lib_http.h" + +void lib_http::List_curs_Next(List_curs &curs) { + do { + int pos = FindChar(curs.rest,','); + curs.elem = Trimmed(pos < 0 ? curs.rest : FirstN(curs.rest,pos)); + curs.rest = pos < 0 ? strptr() : RestFrom(curs.rest,pos+1); + } while(!ch_N(curs.elem) && ch_N(curs.rest)); +} + +void lib_http::List_curs_Reset(List_curs &curs, strptr list) { + curs.rest = list; + List_curs_Next(curs); +} + +bool lib_http::List_curs_ValidQ(List_curs &curs) { + return ch_N(curs.elem); +} + +strptr &lib_http::List_curs_Access(List_curs &curs) { + return curs.elem; +} + +// Whether http list contains token +bool lib_http::ListContainsQ(strptr list, strptr token) { + bool ret(false); + ind_beg(lib_http::List_curs, elem, list) { + ret = elem == token; + if (ret) { + break; + } + }ind_end; + return ret; +} + +// Get single line of HTTP ptotocol +bool lib_http::DecodeLine(strptr &buf, strptr &result) { + i32 ind = FindChar(buf,'\n'); + bool ok = ind >= 0; + if (ok) { + result = TrimmedRight(FirstN(buf,ind)); + buf = RestFrom(buf,ind+1); + } + return ok; +} + +// decode HTTP request +bool lib_http::DecodeRequest(strptr &buf, http::Request &request) { + strptr line; + bool ok = lib_http::DecodeLine(buf,line); + ok = ok && ch_N(line); + if (ok) { + algo::StringIter it(line); + strptr method = GetWordCharf(it); + if (!http::Method_ReadStrptrMaybe(request.method,method)) { + request.method = http_Method_extension_method; + request.extension_method = method; + } + if (ok) { + request.uri = GetWordCharf(it); + request.version = GetWordCharf(it); + } + } + ok = ok && (request.version == "HTTP/1.0" || request.version == "HTTP/1.1"); + while ((ok = ok && DecodeLine(buf,line)) && ch_N(line)) { + i32 ind = FindChar(line,':'); + ok = ind > 0; + if (ok) { + strptr name = Trimmed(FirstN(line,ind)); + strptr value = Trimmed(RestFrom(line,ind+1)); + ok = SetRequestHeader(request,name,value); + } + } + ok = ok && !ch_N(buf); + return ok; +} + +// Add request header +bool lib_http::SetRequestHeader(http::Request &request, strptr name, strptr value) { + MakeLower(name); + http::HeaderType h; + bool ok = true; + bool known = HeaderType_ReadStrptrMaybe(h,name); + if (known) { + switch (value_GetEnum(h)) { + // general + case http_HeaderType_cache_control: request.cache_control = value; break; + case http_HeaderType_connection: request.connection = value; break; + case http_HeaderType_date: request.date = value; break; + case http_HeaderType_pragma: request.pragma = value; break; + case http_HeaderType_trailer: request.trailer = value; break; + case http_HeaderType_transfer_encoding: request.transfer_encoding = value; break; + case http_HeaderType_upgrade: request.upgrade = value; break; + case http_HeaderType_via: request.via = value; break; + case http_HeaderType_warning: request.warning = value; break; + // request + case http_HeaderType_accept: request.accept = value; break; + case http_HeaderType_accept_charset: request.accept_charset = value; break; + case http_HeaderType_accept_encoding: request.accept_encoding = value; break; + case http_HeaderType_accept_language: request.accept_language = value; break; + case http_HeaderType_authorization: request.authorization = value; break; + case http_HeaderType_expect: request.expect = value; break; + case http_HeaderType_from: request.from = value; break; + case http_HeaderType_host: request.host = value; break; + case http_HeaderType_if_match: request.if_match = value; break; + case http_HeaderType_if_modified_since: request.if_modified_since = value; break; + case http_HeaderType_if_none_match: request.if_none_match = value; break; + case http_HeaderType_if_range: request.if_range = value; break; + case http_HeaderType_if_unmodified_since: request.if_unmodified_since = value; break; + case http_HeaderType_max_forwards: request.max_forwards = value; break; + case http_HeaderType_proxy_authorization: request.proxy_authorization = value; break; + case http_HeaderType_range: request.range = value; break; + case http_HeaderType_referer: request.referer = value; break; + case http_HeaderType_te: request.te = value; break; + case http_HeaderType_user_agent: request.user_agent = value; break; + // entity + case http_HeaderType_allow: request.allow = value; break; + case http_HeaderType_content_encoding: request.content_encoding = value; break; + case http_HeaderType_content_language: request.content_language = value; break; + case http_HeaderType_content_length: ok = i32_ReadStrptrMaybe(request.content_length,value); break; + case http_HeaderType_content_location: request.content_location = value; break; + case http_HeaderType_content_md5: request.content_md5 = value; break; + case http_HeaderType_content_range: request.content_range = value; break; + case http_HeaderType_content_type: request.content_type = value; break; + case http_HeaderType_expires: request.expires = value; break; + case http_HeaderType_last_modified: request.last_modified = value; break; + // websocket + case http_HeaderType_sec_websocket_key: request.sec_websocket_key = value; break; + case http_HeaderType_sec_websocket_extensions: request.sec_websocket_extensions = value; break; + case http_HeaderType_sec_websocket_protocol: request.sec_websocket_protocol = value; break; + case http_HeaderType_sec_websocket_version: request.sec_websocket_version = value; break; + default: ok = false; break; + } + } + if (!known) { + http::ExtensionHeader &eh = extension_header_Alloc(request); + eh.name = name; + eh.value = value; + } + return ok; +} + +// Encode HTTP response +void lib_http::EncodeResponse(cstring &buf, http::Response &response) { + buf << response.version << " " << response.status; + buf << "\r\n"; + + bool no_body = StartsWithQ(response.status,"1") + || StartsWithQ(response.status,"204") + || StartsWithQ(response.status,"304"); + + // GENERAL HEADERS + + if (ch_N(response.cache_control)) { + buf << "Cache-Control: " << response.cache_control << "\r\n"; + } + if (ch_N(response.connection)) { + buf << "Connection: " << response.connection << "\r\n"; + } + if (ch_N(response.date)) { + buf << "Date: " << response.date << "\r\n"; + } + if (ch_N(response.pragma)) { + buf << "Pragma: " << response.pragma << "\r\n"; + } + if (ch_N(response.trailer)) { + buf << "Trailer: " << response.trailer << "\r\n"; + } + if (ch_N(response.transfer_encoding)) { + buf << "Transfer-Encoding: " << response.transfer_encoding << "\r\n"; + } + if (ch_N(response.upgrade)) { + buf << "Upgrade: " << response.upgrade << "\r\n"; + } + if (ch_N(response.via)) { + buf << "Via: " << response.via << "\r\n"; + } + if (ch_N(response.warning)) { + buf << "Warning: " << response.warning << "\r\n"; + } + + // RESPONSE HEADERS + + if (ch_N(response.accept_ranges)) { + buf << "Accept-Ranges: " << response.accept_ranges << "\r\n"; + } + if (ch_N(response.age)) { + buf << "Age: " << response.age << "\r\n"; + } + if (ch_N(response.etag)) { + buf << "ETag: " << response.etag << "\r\n"; + } + if (ch_N(response.location)) { + buf << "Location: " << response.location << "\r\n"; + } + if (ch_N(response.proxy_authenticate)) { + buf << "Proxy-Authenticate: " << response.proxy_authenticate << "\r\n"; + } + if (ch_N(response.retry_after)) { + buf << "Retry-After: " << response.retry_after << "\r\n"; + } + if (ch_N(response.server)) { + buf << "Server: " << response.server << "\r\n"; + } + if (ch_N(response.vary)) { + buf << "Vary: " << response.vary << "\r\n"; + } + if (ch_N(response.www_authenticate)) { + buf << "WWW-Authenticate: " << response.www_authenticate << "\r\n"; + } + + // ENTITY HEADERS + + if (ch_N(response.allow)) { + buf << "Allow: " << response.allow << "\r\n"; + } + if (ch_N(response.content_encoding)) { + buf << "Content-Encoding: " << response.content_encoding << "\r\n"; + } + if (ch_N(response.content_language)) { + buf << "Content-Language: " << response.content_language << "\r\n"; + } + if (!no_body) { + if (response.content_length) { + buf << "Content-Length: " << response.content_length << "\r\n"; + } else { + buf << "Content-Length: " << ch_N(response.body) << "\r\n"; + } + } + if (ch_N(response.content_location)) { + buf << "Content-Location: " << response.content_location << "\r\n"; + } + if (ch_N(response.content_md5)) { + buf << "Content-MD5: " << response.content_md5 << "\r\n"; + } + if (ch_N(response.content_range)) { + buf << "Content-Range: " << response.content_range << "\r\n"; + } + if (ch_N(response.content_type)) { + buf << "Content-Type: " << response.content_type << "\r\n"; + } + if (ch_N(response.expires)) { + buf << "Expires: " << response.expires << "\r\n"; + } + if (ch_N(response.last_modified)) { + buf << "Last-Modified: " << response.last_modified << "\r\n"; + } + + // WEBSOCKET HEADERS + + if (ch_N(response.sec_websocket_accept)) { + buf << "Sec-WebSocket-Accept: " << response.sec_websocket_accept << "\r\n"; + } + if (ch_N(response.sec_websocket_extensions)) { + buf << "Sec-WebSocket-Extensions: " << response.sec_websocket_extensions << "\r\n"; + } + if (ch_N(response.sec_websocket_protocol)) { + buf << "Sec-WebSocket-Protocol: " << response.sec_websocket_protocol << "\r\n"; + } + if (ch_N(response.sec_websocket_version)) { + buf << "Sec-WebSocket-Version: " << response.sec_websocket_version << "\r\n"; + } + + // OTHER EXTENSION HEADERS + + ind_beg(http::Response_extension_header_curs,h,response) { + buf << h.name << ": " << h.value << "\r\n"; + }ind_end; + buf << "\r\n"; + + // BODY + + if (!no_body) { + buf << response.body; + } +} + +// Get HTTP message length +// TODO content-length, chunked +i32 lib_http::GetMsgLen(strptr buf) { + i32 len(0); + i32 prev(0); + frep_(i,ch_N(buf)) { + if (buf[i] == '\n') { + strptr line(buf.elems+prev, i-prev); + prev = i + 1; + if (!ch_N(line) || line == "\r") { + len = prev; + break; + } + } + } + return len; +} diff --git a/cpp/lib_netio/socket.cpp b/cpp/lib_netio/socket.cpp new file mode 100644 index 00000000..86b0b05e --- /dev/null +++ b/cpp/lib_netio/socket.cpp @@ -0,0 +1,382 @@ +// Copyright (C) 2024,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: lib_netio (lib) -- Network I/O library +// Exceptions: yes +// Source: cpp/lib_netio/socket.cpp +// +// This source code constitutes confidential information and trade secrets +// of AlgoRND. Unauthorized copying, distribution or sharing of this file, +// via any medium, is strictly prohibited. + +#include "include/algo.h" +#include "include/lib_netio.h" +#include "include/lib_netio.inl.h" +#include "include/gen/command_gen.h" +#include "include/gen/command_gen.inl.h" + +#include +#include + +//------------------------------------------------------------------------------ + +// Create TCP socket +algo::Fildes lib_netio::CreateTcpSocket() { + return algo::Fildes(socket(AF_INET, SOCK_STREAM, 0)); +} + +//------------------------------------------------------------------------------ + +// Create UDP socket +algo::Fildes lib_netio::CreateUdpSocket() { + return algo::Fildes(socket(AF_INET, SOCK_DGRAM, 0)); +} + +//------------------------------------------------------------------------------ + +// Create Netlink socket +algo::Fildes lib_netio::CreateNetlinkSocket() { + return algo::Fildes(socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE)); +} + +//------------------------------------------------------------------------------ + +// Wrapper for bind() -- Ipport +bool lib_netio::Bind(algo::Fildes sock, ietf::Ipport ipport) { + sockaddr_in sa; + algo::ZeroBytes(sa); + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = htonl(ipport.ip.ipv4); + sa.sin_port = htons(ipport.port); + return bind(sock.value, (sockaddr *)&sa, sizeof sa) == 0; +} + +//------------------------------------------------------------------------------ + +// Wrapper for bind() -- strptr +bool lib_netio::Bind(algo::Fildes sock, strptr addr) { + int ret(false); + ietf::Ipport ipport; + if (ietf::Ipport_ReadStrptrMaybe(ipport, addr)) { + ret = Bind(sock, ipport); + } else { + errno = EINVAL; + } + return ret; +} + +//------------------------------------------------------------------------------ + +// Wrapper for bind to netlink +bool lib_netio::BindNetlink(algo::Fildes sock) { + sockaddr_nl sa; + algo::ZeroBytes(sa); + sa.nl_family = AF_NETLINK; + sa.nl_groups = RTMGRP_LINK; + return bind(sock.value, (sockaddr *)&sa, sizeof sa) == 0; +}; + +// send GETLINK netlink request +bool lib_netio::RequestLinkDump(algo::Fildes sock) { + // address + sockaddr_nl sa; + algo::ZeroBytes(sa); + sa.nl_family = AF_NETLINK; + // data + u8 buf[NLMSG_SPACE(sizeof(ifinfomsg))]; // with alignment padding + algo::ZeroBytes(buf); + struct Msg { + nlmsghdr nlh; + ifinfomsg ifm; + } &req = *(Msg*)buf; + req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof req.ifm); + req.nlh.nlmsg_type = RTM_GETLINK; + req.nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + req.ifm.ifi_family = AF_UNSPEC; + return sendto(sock.value, buf, sizeof buf, 0, (sockaddr*)&sa, sizeof sa) == sizeof buf; +} + +//------------------------------------------------------------------------------ + +// Wrapper for listen() -- strptr +bool lib_netio::Listen(algo::Fildes sock, int backlog) { + return listen(sock.value,backlog) == 0; +} + +//------------------------------------------------------------------------------ + +// Wrapper for connect() -- ipport +bool lib_netio::Connect(algo::Fildes sock, ietf::Ipport ipport) { + sockaddr_in sa; + algo::ZeroBytes(sa); + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = htonl(ipport.ip.ipv4); + sa.sin_port = htons(ipport.port); + return connect(sock.value, (sockaddr *)&sa, sizeof(sa)) == 0; +} + +//------------------------------------------------------------------------------ + +// Wrapper for connect() -- strptr +int lib_netio::Connect(algo::Fildes sock, strptr addr) { + int ret(false); + ietf::Ipport ipport; + if (ietf::Ipport_ReadStrptrMaybe(ipport, addr)) { + ret = Connect(sock, ipport); + } else { + errno = EINVAL; + } + return ret; +} + +//------------------------------------------------------------------------------ + +// accept remote connection: +// return connection socket and fills ipport with client address/port +algo::Fildes lib_netio::Accept(algo::Fildes listen_sock, ietf::Ipport &ipport) { + algo::Fildes sock; + sockaddr_in client_addr; + socklen_t client_addr_len = sizeof client_addr; + algo::ZeroBytes(client_addr); + sock.value = accept(listen_sock.value, (sockaddr *)&client_addr, &client_addr_len); + ipport.ip.ipv4 = ntohl(client_addr.sin_addr.s_addr); + ipport.port = ntohs(client_addr.sin_port); + return sock; +} + +//------------------------------------------------------------------------------ + +// Get socket error -- getsockopt(SO_ERROR); +// in case of getsockopt failure, return errno +int lib_netio::GetSocketError(algo::Fildes sock) { + int err(0); + socklen_t errlen = sizeof(err); + if (getsockopt(sock.value, SOL_SOCKET, SO_ERROR, &err, &errlen) != 0) { + err = errno; + } + return err; +} + +//------------------------------------------------------------------------------ + +// Wrapper for setsockopt(SO_REUSEADDR) +bool lib_netio::SetReuseAddress(algo::Fildes sock, bool value DFLTVAL(true)) { + return SetSocketOption(sock, SOL_SOCKET, SO_REUSEADDR, value); +} + +//------------------------------------------------------------------------------ + +// Wrapper for setsockopt(TCP_NODELAY) +bool lib_netio::SetTcpNoDelay(algo::Fildes sock, bool value DFLTVAL(true)) { + return SetSocketOption(sock, IPPROTO_TCP, TCP_NODELAY, value); +} + +//------------------------------------------------------------------------------ + +// Wrapper for setsockopt(SO_LINGER) - timeout in seconds to drain output buffers before close(). +// set 0 to drop connection with RST. +bool lib_netio::SetLinger(algo::Fildes sock, algo::UnixDiff timeout DFLTVAL(algo::UnixDiff())) { + linger arg; + algo::ZeroBytes(arg); + arg.l_linger = timeout.value; + arg.l_onoff = 1; + return SetSocketOption(sock, SOL_SOCKET, SO_LINGER, arg) == 0; +} + +//------------------------------------------------------------------------------ + +// Set TCP keepalive +bool lib_netio::SetTcpKeepalive(algo::Fildes sock, bool on DFLTVAL(true), algo::UnixDiff idle DFLTVAL(algo::UnixDiff(2)), algo::UnixDiff interval DFLTVAL(algo::UnixDiff(2)), int max_probes DFLTVAL(5)) { + return SetSocketOption(sock, SOL_SOCKET, SO_KEEPALIVE, on) + && SetSocketOption(sock, IPPROTO_TCP, TCP_KEEPIDLE, idle.value) + && SetSocketOption(sock, IPPROTO_TCP, TCP_KEEPINTVL, interval.value) + && SetSocketOption(sock, IPPROTO_TCP, TCP_KEEPCNT, max_probes); +} + +//------------------------------------------------------------------------------ + +// Set send buffer size -- setsockopt(SO_SNDBUF) +bool lib_netio::SetSendBufferSize(algo::Fildes sock, int size) { + return SetSocketOption(sock, SOL_SOCKET, SO_SNDBUF, size); +} + +//------------------------------------------------------------------------------ + +// Set receive buffer size -- setsockopt(SO_RCVBUF) +bool lib_netio::SetReceiveBufferSize(algo::Fildes sock, int size) { + return SetSocketOption(sock, SOL_SOCKET, SO_RCVBUF, size); +} + +//------------------------------------------------------------------------------ + +// Set multicast loop (enabled by defult) +bool lib_netio::SetMulticastLoop(algo::Fildes sock, bool loop) { + return SetSocketOption(sock, IPPROTO_IP, IP_MULTICAST_LOOP, loop); +} + +//------------------------------------------------------------------------------ + +// Set multicast TTL +// TTL Scope +// 0 Restricted to the same host. Won't be output by any interface. +// 1 Restricted to the same subnet. Won't be forwarded by a router. This is the default. +// <32 Restricted to the same site, organization or department. +// <64 Restricted to the same region. +// <128 Restricted to the same continent. +// <255 Unrestricted in scope. Global. +bool lib_netio::SetMulticastTtl(algo::Fildes sock, u8 ttl) { + return SetSocketOption(sock, IPPROTO_IP, IP_MULTICAST_TTL, ttl); +} + +//------------------------------------------------------------------------------ + +// Join or leave multicast group (on the interface basis!) +bool lib_netio::SetMulticastMembership(algo::Fildes sock, ietf::Ipv4 group, ietf::Ipv4 interface, bool membership) { + ip_mreq mreq; + algo::ZeroBytes(mreq); + mreq.imr_multiaddr.s_addr = htonl(group.ipv4); + mreq.imr_interface.s_addr = htonl(interface.ipv4); + int option = membership ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP; + return SetSocketOption(sock, IPPROTO_IP, option, mreq); +} + +//------------------------------------------------------------------------------ + +// Set multicast send interface (default specified by system administrator) +bool lib_netio::SetMulticastInterface(algo::Fildes sock, ietf::Ipv4 interface) { + in_addr addr; + algo::ZeroBytes(addr); + addr.s_addr = htonl(interface.ipv4); + return SetSocketOption(sock, IPPROTO_IP, IP_MULTICAST_IF, addr); +} + +//------------------------------------------------------------------------------ + +// Get local ip/port -- getsockname() +bool lib_netio::GetIpportLocal(algo::Fildes sock, ietf::Ipport &ipport) { + sockaddr_in addr; + algo::ZeroBytes(addr); + socklen_t addr_len = sizeof addr; + bool ok = getsockname(sock.value, (sockaddr *)&addr, &addr_len) == 0; + ipport.ip.ipv4 = ntohl(addr.sin_addr.s_addr); + ipport.port = ntohs(addr.sin_port); + return ok; +} + +//------------------------------------------------------------------------------ + +// Get remote ip/port -- getpeername() +bool lib_netio::GetIpportRemote(algo::Fildes sock, ietf::Ipport &ipport) { + sockaddr_in addr; + algo::ZeroBytes(addr); + socklen_t addr_len = sizeof addr; + bool ok = getpeername(sock.value, (sockaddr *)&addr, &addr_len) == 0; + ipport.ip.ipv4 = ntohl(addr.sin_addr.s_addr); + ipport.port = ntohs(addr.sin_port); + return ok; +} + +//------------------------------------------------------------------------------ + +// get list of interface names as space-separated string +tempstr lib_netio::GetInterfaces(algo::Fildes sock) { + tempstr ret; + algo::ListSep ls(" "); + char buf[4096]; // FIXME + ifconf ifc; + ifc.ifc_len = sizeof buf; + ifc.ifc_buf = buf; + bool ok = ioctl(sock.value, SIOCGIFCONF, &ifc)==0; + if (ok) { + frep_(i, ifc.ifc_len / sizeof(ifreq)) { + ret << ls << ifc.ifc_req[i].ifr_name; + } + } + return ret; +} + +// get list of ips for a give hostname as space-separated string +//------------------------------------------------------------------------------ +tempstr lib_netio::GetHostAddr(strptr hostname) { + tempstr ret; + tempstr host(hostname); + addrinfo hints{}, *res; + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; // Force TCP protocol + int ret_code=getaddrinfo(Zeroterm(host), nullptr, &hints, &res); + if (!ret_code){ + algo::ListSep ls(" "); + for (auto p = res; p; p = p->ai_next) { + char ip[INET_ADDRSTRLEN]; + if (inet_ntop(AF_INET, &((sockaddr_in*)p->ai_addr)->sin_addr, ip, sizeof(ip))){ + ret << ls << ip; + } + } + freeaddrinfo(res); + } else { + gai_strerror(ret_code); + } + return tempstr()<sin_addr.s_addr : 0)); + return ok; +} + +// find interface name for known ip +tempstr lib_netio::FindInterfaceByIpv4(algo::Fildes sock, ietf::Ipv4 &ip) { + tempstr name; + cstring interfaces = lib_netio::GetInterfaces(sock); + ind_beg(Word_curs,intf,interfaces) { + ietf::Ipv4 intf_ip; + if (GetIpv4(sock,intf,intf_ip) && intf_ip == ip) { + name = intf; + break; + } + }ind_end; + return name; +} + +// ----------------------------------------------------------------------------- + +// Resolve ip:port or : to an Ipport struct +ietf::Ipport lib_netio::Resolve(algo::strptr addr) { + tempstr host(lib_netio::GetHostAddr(Pathcomp(addr,":RL"))); + tempstr port(Pathcomp(addr,":RR")); + ietf::Ipport ret; + ietf::Ipport_ReadStrptrMaybe(ret,tempstr()<. +// +// Target: lib_rl (lib) -- GNU readline support library +// Exceptions: yes +// Source: cpp/lib_rl/lib_rl.cpp +// + +#include "include/algo.h" +#include "include/lib_rl.h" +#include +#include + +//////////////////////////////////////////////////////////////////////////////// +// +// HISTORY +// +//////////////////////////////////////////////////////////////////////////////// + +// compose history file name +tempstr lib_rl::HistoryFile(strptr app) { + tempstr ret; + char *home = getenv("HOME"); + if (home && home[0]) { + ret << home; + } else { + ret << algo::GetCurDir(); + } + MaybeDirSep(ret); + ret << "."; + if (ch_N(app)) { + ret << app << "_"; + } + ret << "history"; + return ret; +} + +//------------------------------------------------------------------------------ + +// initialize history from file +// TODO lock +void lib_rl::InitHistory() { + if (_db.isatty) { + _db.history_file = HistoryFile(_db.cmdline.app); + history_truncate_file(Zeroterm(_db.history_file),_db.cmdline.max_history); + read_history(Zeroterm(_db.history_file)); + stifle_history(_db.cmdline.max_history); + } +} + +//------------------------------------------------------------------------------ + +// get last history line, empty if none +strptr lib_rl::LastHistory() { + strptr ret; + if (history_length > 0) { + if (HIST_ENTRY *last = history_get(::history_length)) { + ret = last->line; + } + } + return ret; +} + +//------------------------------------------------------------------------------ + +// add line to history +void lib_rl::AddHistory(strptr line) { + if (ch_N(line) && line != LastHistory() && _db.isatty) { + tempstr tmp(line); + add_history(Zeroterm(tmp)); + // todo lock + append_history(1,Zeroterm(_db.history_file)); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// +// SAFE PRLOG +// +//////////////////////////////////////////////////////////////////////////////// + +// prlog handler - safe print when redline is active +void lib_rl::Prlog(algo_lib::FLogcat *logcat, algo::SchedTime time, strptr str) { + rl_clear_visible_line(); + fflush(rl_outstream); + _db.Prlog(logcat,time,str); + rl_forced_update_display(); +} + +//------------------------------------------------------------------------------ + +// setup own prlog function +void lib_rl::RedirectPrlog() { + if (algo_lib::_db.Prlog != lib_rl::Prlog) { + lib_rl::_db.Prlog = algo_lib::_db.Prlog; + algo_lib::_db.Prlog = lib_rl::Prlog; + } +} + +//------------------------------------------------------------------------------ + +// restore prlog function +void lib_rl::RestorePrlog() { + if (algo_lib::_db.Prlog == lib_rl::Prlog) { + algo_lib::_db.Prlog = lib_rl::_db.Prlog; + } +} + +//////////////////////////////////////////////////////////////////////////////// +// +// ENGINE +// +//////////////////////////////////////////////////////////////////////////////// + +// whether the line is valid +bool lib_rl::LineValidQ() { + return _db.line_valid; +} + +//------------------------------------------------------------------------------ + +// whether EOF +bool lib_rl::EofQ() { + return !LineValidQ() && _db.eof; +} + +//------------------------------------------------------------------------------ + +// stream error +int lib_rl::Error() { + return !LineValidQ() ? _db.err : 0; +} + +//------------------------------------------------------------------------------ + +// whether realine in substate - not bare chars +bool lib_rl::SubstateQ() { + constexpr int substate_mask = RL_STATE_ISEARCH // + | RL_STATE_NSEARCH // + | RL_STATE_SEARCH // search modes + | RL_STATE_COMPLETING // a completion is running + | RL_STATE_METANEXT // after ESC; building a key sequence + | RL_STATE_NUMERICARG // collecting numeric arg + | RL_STATE_MACROINPUT // + | RL_STATE_MACRODEF // keybord macros + | RL_STATE_VIMOTION // + | RL_STATE_MULTIKEY // vi/multi-key commands + | RL_STATE_DISPATCHING // + | RL_STATE_MOREINPUT; // command in progress + return RL_ISSTATE(substate_mask); +} + +//------------------------------------------------------------------------------ + +// whether mode is readline or normal +bool lib_rl::ReadlineQ() { + return RL_ISSTATE(RL_STATE_CALLBACK); +} + +// ----------------------------------------------------------------------------- + +void lib_rl::SetPrompt(algo::strptr prompt) { + _db.cmdline.prompt=prompt; + if (ReadlineQ()) { + rl_callback_handler_install(Zeroterm(_db.cmdline.prompt),OnLine); + } +} + +//------------------------------------------------------------------------------ + +// switch mode 0 - normal, 1 - readline +void lib_rl::SwitchMode(int mode) { + if (_db.isatty) { + if (mode) { + if (!ReadlineQ()) { + rl_callback_handler_install(Zeroterm(_db.cmdline.prompt),OnLine); + RedirectPrlog(); + } + } else { + if (ReadlineQ()) { + rl_clear_visible_line(); + rl_callback_handler_remove(); + RestorePrlog(); + } + } + } +} + +//------------------------------------------------------------------------------ + +// get line +strptr lib_rl::GetLine() { + if (!LineValidQ() && !EofQ()) { + SwitchMode(1); + } + while (!LineValidQ() && !EofQ()) { + // read input stream + int c = getc(rl_instream); + // check for eof and errors + if (c==EOF) { + _db.err = errno != EAGAIN && errno != EINTR ? errno : 0; + _db.eof = feof(rl_instream) || _db.err; + break; + } + // catch ^D for EOF + if (_db.isatty && c == CTRL('D') && !rl_point && !rl_end && !SubstateQ()) { + _db.eof = true; + break; + } + if (_db.isatty) { + rl_stuff_char(c); + rl_callback_read_char(); // calls lib_rl::OnLine() + } else if (c == '\n') { + _db.line_valid = true; + } else { + ch_Alloc(_db.line) = c; + } + } + if (LineValidQ() || EofQ()) { + SwitchMode(0); + } + return LineValidQ() ? _db.line : strptr(); +} + +//------------------------------------------------------------------------------ + +// called inside rl_callback_read_char() when new input line entered +void lib_rl::OnLine(char *zline) { + strptr line(zline); + _db.line = line; + _db.line_valid = true; + if (_db.cmdline.add_history) { + AddHistory(line); + } +} + +//------------------------------------------------------------------------------ + +// Skip current line +void lib_rl::SkipLine() { + _db.line_valid = false; + ch_RemoveAll(_db.line); +} + +//------------------------------------------------------------------------------ + +// Kill entire buffer +void lib_rl::KillBuffer() { + SkipLine(); + rl_replace_line("", 0); + if (ReadlineQ()) { + rl_clear_visible_line(); + rl_forced_update_display(); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// +// SETUP/TEARDOWN +// +//////////////////////////////////////////////////////////////////////////////// + +// begin readline, user shall add own iohook function +void lib_rl::BeginReadline(strptr app, strptr prompt) { + if (!ValidQ(_db.iohook.fildes)) { + _db.cmdline.app = app; + rl_readline_name = Zeroterm(_db.cmdline.app); // ponter - do not modify + rl_initialize(); + _db.isatty = isatty(fileno(rl_instream)); + InitHistory(); + _db.cmdline.prompt = prompt; + _db.iohook.fildes = algo::Fildes(fileno(rl_instream)); + algo::SetBlockingMode(_db.iohook.fildes,false); + IOEvtFlags flags; + read_Set(flags, true); + algo_lib::IohookAdd(_db.iohook, flags); + SwitchMode(1); + } +} + +//------------------------------------------------------------------------------ + +// stop reading readline +void lib_rl::EndReadline() { + if (ValidQ(_db.iohook.fildes)) { + SwitchMode(0); + algo::Refurbish(_db.iohook); + } +} + +//------------------------------------------------------------------------------ + +// restore terminal settings +void lib_rl::iohook_Cleanup() { + EndReadline(); +} diff --git a/cpp/lib_sqlite/lib_sqlite.cpp b/cpp/lib_sqlite/lib_sqlite.cpp index bfbb29c5..07134b52 100644 --- a/cpp/lib_sqlite/lib_sqlite.cpp +++ b/cpp/lib_sqlite/lib_sqlite.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026 AlgoRND // Copyright (C) 2023 Astra // // License: GPL diff --git a/cpp/lib_sqlite/vtab.cpp b/cpp/lib_sqlite/vtab.cpp index 4d8cf1cb..dbc63a0b 100644 --- a/cpp/lib_sqlite/vtab.cpp +++ b/cpp/lib_sqlite/vtab.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026 AlgoRND // Copyright (C) 2023 Astra // // License: GPL @@ -104,13 +105,13 @@ static void SsimCursor_Next(VtabCurs& curs) { if (!curs.c_row) { curs.c_row = zd_row_First(ctype); } else { - curs.c_row = zd_row_Next(*curs.c_row); + curs.c_row = ctype_zd_row_Next(*curs.c_row); } while (curs.c_row) { if (CheckRow(curs, *curs.c_row)) { break; } - curs.c_row = zd_row_Next(*curs.c_row); + curs.c_row = ctype_zd_row_Next(*curs.c_row); } } curs.eof = curs.c_row == nullptr; @@ -469,8 +470,8 @@ sqlite3_module lib_sqlite::SsimModule = { // Scalar function to initialize virtual tables with given data path void lib_sqlite::VtabInitFunc(sqlite3_context *context, int argc, sqlite3_value **argv) { - if (argc != 1) { - sqlite3_result_error(context, "init_ssim() requires exactly one argument (data path)", -1); + if (argc != 2) { + sqlite3_result_error(context, "init_ssim() requires 2 args : data and ns", -1); return; } @@ -479,19 +480,29 @@ void lib_sqlite::VtabInitFunc(sqlite3_context *context, int argc, sqlite3_value sqlite3_result_error(context, "data path cannot be null", -1); return; } + const char* ns_c = (const char*)sqlite3_value_text(argv[1]); + if (!data_path) { + sqlite3_result_error(context, "ns cannot be null", -1); + return; + } + tempstr ns_str(ns_c); + algo_lib::Regx ns_regex; + algo_lib::Regx_ReadSql(ns_regex, ns_str, true); sqlite3* db = sqlite3_context_db_handle(context); auto create = cstring(); algo_lib::Replscope R; ind_beg(lib_sqlite::_db_ns_curs,ns,lib_sqlite::_db) if (ns.nstype == dmmeta_Nstype_nstype_ssimdb) { - Set(R,"$ns",ns.ns); - Ins(&R,create, "attach ':memory:' as $ns;"); - ind_beg(lib_sqlite::ns_c_ssimfile_curs,ssimfile,ns) { - Set(R,"$data",data_path); - Set(R,"$ssimfile",ssimfile.ssimfile); - Ins(&R,create, "create virtual table $ssimfile using ssimdb( $data , $ssimfile );"); - }ind_end; + if (Regx_Match(ns_regex, ns.ns)) { + Set(R,"$ns",ns.ns); + Ins(&R,create, "attach ':memory:' as $ns;"); + ind_beg(lib_sqlite::ns_c_ssimfile_curs,ssimfile,ns) { + Set(R,"$data",data_path); + Set(R,"$ssimfile",ssimfile.ssimfile); + Ins(&R,create, "create virtual table $ssimfile using ssimdb( $data , $ssimfile );"); + }ind_end; + } }ind_end; int rc = sqlite3_exec(db, algo::Zeroterm(create), nullptr, nullptr, nullptr); @@ -509,7 +520,7 @@ int lib_sqlite::VtabInitExt(sqlite3 *db, char **pzErrMsg, const sqlite3_api_rout lib_sqlite::Init(); // Register scalar function for initializing virtual tables - auto rc = sqlite3_create_function(db, "init_ssim", 1, SQLITE_UTF8, nullptr, + auto rc = sqlite3_create_function(db, "init_ssim", 2, SQLITE_UTF8, nullptr, VtabInitFunc, nullptr, nullptr); if (rc == SQLITE_OK) { rc = sqlite3_create_module(db, "ssimdb", &lib_sqlite::SsimModule, 0); diff --git a/cpp/lib_ws/lib_ws.cpp b/cpp/lib_ws/lib_ws.cpp new file mode 100644 index 00000000..93b95520 --- /dev/null +++ b/cpp/lib_ws/lib_ws.cpp @@ -0,0 +1,248 @@ +// Copyright (C) 2023-2024,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: lib_ws (lib) -- WebSocket library +// Exceptions: yes +// Source: cpp/lib_ws/lib_ws.cpp +// +// This source code constitutes confidential information and trade secrets +// of AlgoRND. Unauthorized copying, distribution or sharing of this file, +// via any medium, is strictly prohibited. + +#include "include/algo.h" +#include "include/lib_ws.h" +#include "include/sha.h" + +cstring &ws::operator<<(cstring &lhs, const ws::FrameHeader &rhs) { + ws::FrameHeaderMsgs_Print2(lhs,const_cast(rhs)); + return lhs; +} + +// safe cast for cppcheck +template ws::FrameHeader *CastbasePtr(T *ptr) { + ws::FrameHeader *ret = NULL; + if (ptr) { + ret = &Castbase(*ptr); + } + return ret; +} + +u32 ws::payload_N(const ws::Frame& parent) { + return payload_len_Get(parent); +} + +u32 ws::payload_N(const ws::FrameMasked& parent) { + return payload_len_Get(parent); +} + +ws::FrameHeader *lib_ws::FrameHeader_FmtByteAry(algo::ByteAry &buf, bool fin, bool rsv1, bool rsv2, bool rsv3, ws::Opcode opcode, bool mask, u32 masking_key, strptr payload) { + ws::FrameHeader header; + fin_Set(header,fin); + rsv1_Set(header,rsv1); + rsv2_Set(header,rsv2); + rsv3_Set(header,rsv3); + opcode_Set(header,opcode); + ws::FrameHeader *frame(NULL); + if (ch_N(payload) > UINT16_MAX) { + if (mask) { + frame = CastbasePtr(FrameMasked64_FmtByteAry(buf,header.byte0,masking_key,payload)); + ToggleMasking(*frame,false); + } else { + frame = CastbasePtr(Frame64_FmtByteAry(buf,header.byte0,payload)); + } + } else if (ch_N(payload) > 125) { + if (mask) { + frame = CastbasePtr(FrameMasked16_FmtByteAry(buf,header.byte0,masking_key,payload)); + ToggleMasking(*frame,false); + } else { + frame = CastbasePtr(Frame16_FmtByteAry(buf,header.byte0,payload)); + } + } else { + mask_Set(header,mask); + payload_len_Set(header,ch_N(payload)); + if (mask) { + frame = CastbasePtr(FrameMasked_FmtByteAry(buf,header.byte0,header.byte1,masking_key,payload)); + ToggleMasking(*frame,false); + } else { + frame = CastbasePtr(Frame_FmtByteAry(buf,header.byte0,header.byte1,payload)); + } + } + return frame; +} + +void lib_ws::FrameLen_Frame16(i32 &len, ws::Frame16 &frame, u32 msg_len) { + len = GetMsgLength(frame); + len = msg_len >= u32(len) ? len : 0; +} + +void lib_ws::FrameLen_FrameMasked16(i32 &len, ws::FrameMasked16 &frame, u32 msg_len) { + len = GetMsgLength(frame); + len = msg_len >= u32(len) ? len : 0; +} + +void lib_ws::FrameLen_Frame64(i32 &len, ws::Frame64 &frame, u32 msg_len) { + len = GetMsgLength(frame); + len = msg_len >= u32(len) ? len : 0; +} + +void lib_ws::FrameLen_FrameMasked64(i32 &len, ws::FrameMasked64 &frame, u32 msg_len) { + len = GetMsgLength(frame); + len = msg_len >= u32(len) ? len : 0; +} + +ws::Frame *ws::Frame_Castdown(ws::FrameHeader &hdr) { + return !mask_Get(hdr) && payload_len_Get(hdr) <= 125 ? (ws::Frame*)&hdr : NULL; +} + +ws::FrameMasked *ws::FrameMasked_Castdown(ws::FrameHeader &hdr) { + return mask_Get(hdr) && payload_len_Get(hdr) <= 125 ? (ws::FrameMasked*)&hdr : NULL; +} + +int lib_ws::FrameLen_Unkmsg(i32 &len, ws::FrameHeader &hdr, u32 msg_len) { + ws::Frame *frame(NULL); + ws::FrameMasked *frame_masked(NULL); + u32 needlen = 0; + if (msg_len >= sizeof(ws::Frame) && (frame = ws::Frame_Castdown(hdr))) { + needlen = sizeof(ws::Frame) + payload_len_Get(*frame); + } else if (msg_len >= sizeof(ws::FrameMasked) && (frame_masked = ws::FrameMasked_Castdown(hdr))) { + needlen = sizeof(ws::FrameMasked) + payload_len_Get(*frame_masked); + } + len = msg_len >= u32(needlen) ? needlen : 0; + return len; +} + +i32 lib_ws::GetMsgLen(algo::memptr buf) { + ws::FrameHeader &hdr = *(ws::FrameHeader*)buf.elems; + i32 len = 0; + if (ch_N(buf) >= ssizeof(ws::FrameHeader)) { + FrameLenDispatch(len,hdr,ch_N(buf)); + } + return len; +} + +bool ws::FrameHeaderMsgs_ReadStrptrMaybe2(algo::strptr str, algo::ByteAry &buf) { + bool ok = ws::FrameHeaderMsgs_ReadStrptrMaybe(str, buf); + if (!ok) { + tempstr msgtype_str; + algo::StringIter iter(str); + cstring_ReadCmdarg(msgtype_str, iter, false); + algo::ByteAry varlenbuf; + algo::ByteAry *varlenbuf_save = algo_lib::_db.varlenbuf; + algo_lib::_db.varlenbuf = &varlenbuf; + if (msgtype_str == "ws.Frame") { + int len = sizeof(ws::Frame); + ws::Frame *ctype = new(ary_AllocN(buf, len).elems) ws::Frame; // default values + ok = Frame_ReadStrptrMaybe(*ctype, str); // now read attributes + varlenbuf.ary_n = varlenbuf.ary_n > 125 ? 125 : varlenbuf.ary_n; + len += ary_N(varlenbuf); + payload_len_Set(*ctype, u8(len-2)); + mask_Set(*ctype,false); + ary_Addary(buf, ary_Getary(varlenbuf)); + } else if (msgtype_str == "ws.FrameMasked") { + int len = sizeof(ws::FrameMasked); + ws::FrameMasked *ctype = new(ary_AllocN(buf, len).elems) ws::FrameMasked; // default values + ok = FrameMasked_ReadStrptrMaybe(*ctype, str); // now read attributes + varlenbuf.ary_n = varlenbuf.ary_n > 125 ? 125 : varlenbuf.ary_n; + len += ary_N(varlenbuf); + payload_len_Set(*ctype, u8(len-6)); + mask_Set(*ctype,true); + ary_Addary(buf, ary_Getary(varlenbuf)); + } else { + FrameHeaderMsgs_ReadStrptrMaybe(str,buf); + } + algo_lib::_db.varlenbuf = varlenbuf_save; + } + return ok; +} + +void ws::FrameHeaderMsgs_Print2(algo::cstring &str, ws::FrameHeader &msg) { + if (!ws::FrameHeaderMsgs_Print(str,msg,UINT32_MAX)) { + if (ws::Frame *frame = Frame_Castdown(msg)) { + Frame_Print(*frame,str); + } else if (ws::FrameMasked *masked = FrameMasked_Castdown(msg)) { + FrameMasked_Print(*masked,str); + } + } +} + +void lib_ws::ToggleMasking(strptr payload, u32 masking_key) { + if (masking_key) { + char *key_bytes = (char*)&masking_key; + frep_(i,ch_N(payload)) { + payload[i] ^= key_bytes[i%4]; + } + } +} + +void lib_ws::FrameIdx_Frame16(lib_ws::FrameIdx &idx, ws::Frame16 &frame, u32) { + idx.masking_key = NULL; + idx.payload = payload_Getary(frame); +} + +void lib_ws::FrameIdx_FrameMasked16(lib_ws::FrameIdx &idx, ws::FrameMasked16 &frame, u32) { + idx.masking_key = &frame.masking_key; + idx.payload = payload_Getary(frame); +} + +void lib_ws::FrameIdx_Frame64(lib_ws::FrameIdx &idx, ws::Frame64 &frame, u32) { + idx.masking_key = NULL; + idx.payload = payload_Getary(frame); +} + +void lib_ws::FrameIdx_FrameMasked64(lib_ws::FrameIdx &idx, ws::FrameMasked64 &frame, u32) { + idx.masking_key = &frame.masking_key; + idx.payload = payload_Getary(frame); +} + +int lib_ws::FrameIdx_Unkmsg(lib_ws::FrameIdx &idx, ws::FrameHeader &hdr, u32) { + if (ws::Frame *frame = Frame_Castdown(hdr)) { + idx.masking_key = NULL; + idx.payload = payload_Getary(*frame); + } else if (ws::FrameMasked *masked = FrameMasked_Castdown(hdr)) { + idx.masking_key = &masked->masking_key; + idx.payload = payload_Getary(*masked); + } + return 0; +} + +void lib_ws::ToggleMasking(ws::FrameHeader &frame, bool reset_key) { + FrameIdx idx; + FrameIdxDispatch(idx,frame,UINT32_MAX); + if (idx.masking_key) { + ToggleMasking(idx.payload,*idx.masking_key); + if (reset_key) { + *idx.masking_key = 0; + } + } +} + +strptr lib_ws::payload_Getary(ws::FrameHeader &frame) { + FrameIdx idx; + FrameIdxDispatch(idx,frame,UINT32_MAX); + return idx.payload; +} + +// Compute Sec-WebSocket-Accept from Sec-WebSocket-Key +tempstr lib_ws::ComputeSecWebSocketAccept(strptr sec_websocket_key) { + tempstr out; + Sha1Ctx sha1; + Update(sha1,algo::strptr_ToMemptr(sec_websocket_key)); + Update(sha1,algo::strptr_ToMemptr("258EAFA5-E914-47DA-95CA-C5AB0DC85B11")); + Finish(sha1); + algo::Sha1sig sig = GetDigest(sha1); + strptr_PrintBase64(algo::memptr_ToStrptr(sha1sig_Getary(sig)),out); + return out; +} diff --git a/cpp/mdbg/mdbg.cpp b/cpp/mdbg/mdbg.cpp index 65033e4c..364bf95e 100644 --- a/cpp/mdbg/mdbg.cpp +++ b/cpp/mdbg/mdbg.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2020-2024 Astra // Copyright (C) 2013-2019 NYSE | Intercontinental Exchange // Copyright (C) 2008-2013 AlgoEngineering LLC @@ -23,7 +23,7 @@ // Source: cpp/mdbg/mdbg.cpp // -#include "include/algo.h" +#include "include/mdbg.h" #include "include/gen/mdbg_gen.h" #include "include/gen/mdbg_gen.inl.h" #include "include/gen/command_gen.h" @@ -56,14 +56,16 @@ static void GenBreakpoints() { // Find pid of existing target process in case we want to debug it static u32 Find_Pid(algo_lib::Replscope &R) { - tempstr pid_str; - pid_str << Trimmed(SysEval(Subst(R, "pidof $tgtfname"), FailokQ(true), 1024)); - u32 pid; - algo::StringIter iter(pid_str); - if (!TryParseU32(iter, pid)) { // if pid is a valid value - prlog(Subst(R, "Could not find the pid of the process:$tgtfname to attach!")); - prlog("Make sure process is running and use sudo option is enabled..."); - pid = 0; + u32 pid = mdbg::_db.cmdline.pid; + if (pid==0) { + tempstr pid_str; + pid_str << Trimmed(SysEval(Subst(R, "pidof $tgtfname"), FailokQ(true), 1024)); + algo::StringIter iter(pid_str); + if (!TryParseU32(iter, pid)) { // if pid is a valid value + prlog(Subst(R, "Could not find the pid of the process:$tgtfname to attach!")); + prlog("Make sure process is running and use sudo option is enabled..."); + pid = 0; + } } return pid; } @@ -96,7 +98,7 @@ static void AddEmacsFunctions(algo_lib::Replscope &R) { Ins(&R, mdbg::_db.script, " ))"); Ins(&R, mdbg::_db.script, "(defun mdbg-recompile () (interactive)"); - Ins(&R, mdbg::_db.script, " (gdb-send-input-ui \"!abt $target -cfg $cfg\")"); + Ins(&R, mdbg::_db.script, " (gdb-send-input-ui \"!abt $buildtarget -cfg $cfg\")"); Ins(&R, mdbg::_db.script, " (gdb-send-input-ui \"run\"))"); Ins(&R, mdbg::_db.script, "(defun mdbg-step () (interactive) (gdb-send-input-ui \"step\"))"); @@ -137,6 +139,8 @@ static void AddEmacsFunctions(algo_lib::Replscope &R) { Ins(&R, mdbg::_db.script, "(global-set-key (kbd \"\") 'other-window)"); Ins(&R, mdbg::_db.script, "(global-set-key (kbd \"\") 'gdb-restore-windows-full)"); + + Ins(&R, mdbg::_db.script, "(setq gdb-debuginfod-enable-setting \"set debuginfod enabled off\")"); } // ----------------------------------------------------------------------------- @@ -220,7 +224,7 @@ static void Main_NoEmacs(algo_lib::Replscope &R) { // ----------------------------------------------------------------------------- // Generate gdb script // -static void Main_Gdb(algo_lib::Replscope &R) { +void mdbg::Main_Gdb(algo_lib::Replscope &R) { Ins(&R, mdbg::_db.gdbscript, "# This file was generated by mdbg"); //Ins(&R, mdbg::_db.gdbscript, "set trace-commands on"); @@ -231,31 +235,19 @@ static void Main_Gdb(algo_lib::Replscope &R) { // in dry run, GetCurDir() is a full path that differs in CI Ins(&R, mdbg::_db.gdbscript, tempstr()<<"cd "<< algo::GetCurDir()); } - Ins(&R, mdbg::_db.gdbscript, "file $localexe"); - - // join argrs and show final command line - mdbg::_db.gdbscript << "set args"; - ind_beg(command::mdbg_args_curs,arg,mdbg::_db.cmdline) { - mdbg::_db.gdbscript << " " << strptr_ToBash(arg); - }ind_end; - mdbg::_db.gdbscript << eol; - - if (mdbg::_db.cmdline.attach) { - u32 pid = Find_Pid(R); - if (pid != 0) { - Set(R, "$pid", tempstr() << pid); - Ins(&R, mdbg::_db.gdbscript, "attach $pid"); - } - } else { - Ins(&R, mdbg::_db.gdbscript, "start"); - } Ins(&R, mdbg::_db.gdbscript, "set history filename temp/gdb.history"); Ins(&R, mdbg::_db.gdbscript, "set history save on"); + // disable debug info daemon, we don't use it + Ins(&R, mdbg::_db.gdbscript, "set debuginfod enabled off"); + + // it's not running until record btrace is executed Ins(&R, mdbg::_db.gdbscript, "set record instruction-history-size 1000000");// for record btrace - 1M Ins(&R, mdbg::_db.gdbscript, "set record function-call-history-size 100000");// for record btrace -- 100k Ins(&R, mdbg::_db.gdbscript, "set record function-call-history 1000");// show this many at a time + Ins(&R, mdbg::_db.gdbscript, "set confirm off"); - Ins(&R, mdbg::_db.gdbscript, "handle SIGPIPE nostop"); + Ins(&R, mdbg::_db.gdbscript, "handle all nostop noprint pass"); + Ins(&R, mdbg::_db.gdbscript, "handle SIGSEGV SIGBUS stop print nopass"); Ins(&R, mdbg::_db.gdbscript, "set pagination off"); if (mdbg::_db.cmdline.catchthrow) { Ins(&R, mdbg::_db.gdbscript, "catch throw"); @@ -268,20 +260,48 @@ static void Main_Gdb(algo_lib::Replscope &R) { Ins(&R, mdbg::_db.gdbscript, "python"); Ins(&R, mdbg::_db.gdbscript, "sys.path.insert(0, 'py')"); Ins(&R, mdbg::_db.gdbscript, "end"); + Ins(&R, mdbg::_db.gdbscript, "source conf/gdb.py"); + } + // Configure convenient multi-process debugging + // We must keep all spawned processes under debugging, and allow them to run as much as possible. + if (mdbg::_db.cmdline.mp) { + Ins(&R, mdbg::_db.gdbscript, "set schedule-multiple on"); + Ins(&R, mdbg::_db.gdbscript, "set detach-on-fork off"); + Ins(&R, mdbg::_db.gdbscript, "set non-stop on"); + Ins(&R, mdbg::_db.gdbscript, "set mi-async"); // alias for 'target-async on', but newer + } + + // load symbols + Ins(&R, mdbg::_db.gdbscript, "file $localexe"); + if (mdbg::_db.cmdline.attach) { + u32 pid = Find_Pid(R); + if (pid != 0) { + Set(R, "$pid", tempstr() << pid); + Ins(&R, mdbg::_db.gdbscript, "attach $pid"); + } + } else { + // join argrs and show final command line + mdbg::_db.gdbscript << "set args"; + ind_beg(command::mdbg_args_curs,arg,mdbg::_db.cmdline) { + mdbg::_db.gdbscript << " " << strptr_ToBash(arg); + }ind_end; + mdbg::_db.gdbscript << eol; + Ins(&R, mdbg::_db.gdbscript, "start"); } // set up main breakpoint GenBreakpoints(); - if (ch_N(mdbg::_db.cmdline.bcmd) > 0) { Ins(&R, mdbg::_db.gdbscript, "commands"); Ins(&R, mdbg::_db.gdbscript, "silent"); Ins(&R, mdbg::_db.gdbscript, mdbg::_db.cmdline.bcmd); Ins(&R, mdbg::_db.gdbscript, "end"); } - + // break right before our panic function Ins(&R, mdbg::_db.gdbscript, "break algo::FatalErrorExit"); + mdbg::_db.bnum++; + if (!mdbg::_db.cmdline.attach && !mdbg::_db.break_main) { Ins(&R, mdbg::_db.gdbscript, "cont"); } @@ -307,19 +327,26 @@ void mdbg::Main() { Set(R, "$target", mdbg::_db.cmdline.target, false); Set(R, "$tgtfname", mdbg::_db.cmdline.target, false); Set(R, "$cfg", mdbg::_db.cmdline.cfg, false); + Set(R, "$builddir", FindBuildDir(), false); Set(R, "$localexe", DirFileJoin(FindBuildDir(),mdbg::_db.cmdline.target)); + tempstr buildtarget(_db.cmdline.target); + if (_db.cmdline.tui) { _db.cmdline.emacs=false; } - if (b_N(_db.cmdline)==0) { + if (b_N(_db.cmdline)==0 && !_db.cmdline.mp) { b_Alloc(_db.cmdline) = "main"; } + if (_db.cmdline.mp) { + // setup buildtarget as appropriate + } + Set(R, "$buildtarget", buildtarget, false);// what to rebuild // compile executable first to avoid embarrassment command::abt_proc abt; abt.cmd.cfg.expr = mdbg::_db.cmdline.cfg; - abt.cmd.target.expr = mdbg::_db.cmdline.target; + abt.cmd.target.expr = buildtarget; if (_db.cmdline.dry_run) { prlog(abt_ToCmdline(abt.cmd)); } else { diff --git a/cpp/mysql2ssim.cpp b/cpp/mysql2ssim.cpp index 010c41c9..971e9799 100644 --- a/cpp/mysql2ssim.cpp +++ b/cpp/mysql2ssim.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/orgfile.cpp b/cpp/orgfile.cpp index 982b4805..3a332031 100644 --- a/cpp/orgfile.cpp +++ b/cpp/orgfile.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2020-2021 Astra // // License: GPL diff --git a/cpp/samp_make/samp_make.cpp b/cpp/samp_make/samp_make.cpp new file mode 100644 index 00000000..696da898 --- /dev/null +++ b/cpp/samp_make/samp_make.cpp @@ -0,0 +1,259 @@ +// Copyright (C) 2023-2024,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: samp_make (exe) -- sample program for Makefile management +// Exceptions: yes +// Source: cpp/samp_make/samp_make.cpp +// + +#include "include/algo.h" +#include "include/algo.h" +#include "include/samp_make.h" + +// ----------------------------------------------------------------------------- +static samp_make::FTargdep& ind_targdep_GetOrCreate(strptr targdep_key){ + samp_make::FTargdep *targdep=samp_make::ind_targdep_Find(targdep_key); + if (!targdep){ + targdep=&samp_make::targdep_Alloc(); + targdep->targdep=targdep_key; + vrfy(targdep_XrefMaybe(*targdep),algo_lib::_db.errtext); + } + return *targdep; +} +// ----------------------------------------------------------------------------- +static samp_make::FTargsrc& ind_targsrc_GetOrCreate(strptr targsrc_key){ + samp_make::FTargsrc *targsrc=samp_make::ind_targsrc_Find(targsrc_key); + if (!targsrc){ + targsrc=&samp_make::targsrc_Alloc(); + targsrc->targsrc=targsrc_key; + vrfy(targsrc_XrefMaybe(*targsrc),algo_lib::_db.errtext); + } + return *targsrc; +} +// ----------------------------------------------------------------------------- +static samp_make::FTargrec& ind_targrec_GetOrCreate(strptr targrec_key){ + samp_make::FTargrec *targrec=samp_make::ind_targrec_Find(targrec_key); + if (!targrec){ + targrec=&samp_make::targrec_Alloc(); + targrec->target=targrec_key; + vrfy(targrec_XrefMaybe(*targrec),algo_lib::_db.errtext); + } + return *targrec; +} +// ----------------------------------------------------------------------------- +// Parse recipies +// targets and targsrc can be found by index +// so all that is left in the line are the recipe +static void ParseRecipies(){ + ind_beg(samp_make::_db_target_curs,target,samp_make::_db){ + tempstr recipe; + algo::ListSep ls_sp(" "); + ind_beg(algo::Sep_curs,token,target.recipe,' ') if (token!=""){ + if (samp_make::FTarget *parent=samp_make::ind_target_Find(token)){ + if (parent->target!=target.target){ + ind_targdep_GetOrCreate(sampdb::Targdep_Concat_target_parent(target.target,token)).rec=true; + } else { + recipe<dflt=dflt; + dflt=false; + } + if (StartsWithQ(target_in," ")){ + target->recipe=line_in; + } else { + target->prereq=Pathcomp(line_in,":LR"); + } + line_in=""; + }ind_end; + ParsePrereq(); + ParseRecipies(); +} +// Parse specific make file, extract content, write it out as ssims +// ----------------------------------------------------------------------------- +static void Main_ParseMake(strptr makefile){ + ParseTargets(makefile); + + cstring out; + ind_beg(samp_make::_db_target_curs,target,samp_make::_db){ + sampdb::Target target_out; + target_CopyOut(target,target_out); + out<recipe + <<" " + <select){ + prlog(PrintTarget(*targdep.p_parent)); + } + }ind_end; + } +} +// ----------------------------------------------------------------------------- +void samp_make::Main() { + if (samp_make::_db.cmdline.parse_make){ + Main_ParseMake(samp_make::_db.cmdline.makefile); + } else { + // Print From.I of make + samp_make::LoadTuplesMaybe(samp_make::_db.cmdline.in,true); + // Build default target + // followed by all targets that pount to it + // followed by the rest + + // Put default target upfront + ind_beg(samp_make::_db_target_curs,target,samp_make::_db) if (target.dflt) { + c_target_InsertMaybe(target); + }ind_end; + ind_beg(samp_make::_db_target_curs,target,samp_make::_db) if (!target.dflt) { + c_target_InsertMaybe(target); + }ind_end; + ind_beg(_db_c_target_curs, target,_db) if (algo_lib::Regx_Match(_db.cmdline.target,target.target)){ + PrintTargets(target); + }ind_end; + } +} diff --git a/cpp/samp_meng/samp_meng.cpp b/cpp/samp_meng/samp_meng.cpp index 3be9dd6a..da7cef45 100644 --- a/cpp/samp_meng/samp_meng.cpp +++ b/cpp/samp_meng/samp_meng.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 @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . // -// Target: samp_meng (exe) +// Target: samp_meng (exe) -- Sample matching engine // Exceptions: yes -// Source: cpp/samp_meng/samp_meng.cpp +// Source: cpp/samp_meng/samp_meng.cpp -- Main source // #include "include/algo.h" diff --git a/cpp/samp_regx/samp_regx.cpp b/cpp/samp_regx/samp_regx.cpp index afd7246d..e1790fd1 100644 --- a/cpp/samp_regx/samp_regx.cpp +++ b/cpp/samp_regx/samp_regx.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,34 +24,40 @@ void samp_regx::Main() { algo_lib::Regx regx; - switch (_db.cmdline.style) { - case command_samp_regx_style_acr: Regx_ReadAcr(regx,_db.cmdline.expr,true); break; - case command_samp_regx_style_shell: Regx_ReadShell(regx,_db.cmdline.expr,true); break; - case command_samp_regx_style_classic: Regx_ReadDflt(regx,_db.cmdline.expr); break; - case command_samp_regx_style_literal: Regx_ReadLiteral(regx,_db.cmdline.expr); break; + trace_Set(regx.flags,_db.cmdline.trace); + capture_Set(regx.flags,_db.cmdline.capture); + if (_db.cmdline.f) { + vrfy(!_db.cmdline.trace, "-show only works with a single string"); } - if (_db.cmdline.show) { + algo_lib::Regx_ReadStyle(regx,_db.cmdline.expr,_db.cmdline.style,_db.cmdline.full); + if (_db.cmdline.trace) { prlog("expr: "<0)); + } + if (_db.cmdline.capture) { + algo::ListSep ls(", "); + cstring out("match range: "); + ind_beg(algo::I32RangeAry_ary_curs,range,algo_lib::_db.regxm.matchrange) { + out<0 ? 0:1; } } diff --git a/cpp/sandbox.cpp b/cpp/sandbox.cpp index 3960776b..4dc84573 100644 --- a/cpp/sandbox.cpp +++ b/cpp/sandbox.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 @@ -36,15 +36,18 @@ void sandbox::ResetSandbox(sandbox::FSandbox &sandbox) { SysCmd(tempstr()<<"git clone "<<(shallow ? "" : "--local")<<" . "</dev/null"); } tempstr curdir=algo::GetCurDir(); + tempstr main_ref(algo::Trimmed(algo::SysEval(tempstr()<<"git rev-parse "<<_db.cmdline.ref,FailokQ(true),1024*1024)));// ref to fetch + tempstr addl_refs(algo::Trimmed(algo::SysEval(tempstr()<<"git rev-parse "<<_db.cmdline.refs,FailokQ(true),1024*1024)));// additional refs + Replace(addl_refs,"\n"," "); int rc=SysCmd(tempstr() - <<"git -C "<bestsrc->counter) { + bestsrc=&targsrc; + } + }ind_end; + if (!bestsrc) { + bestsrc=cd_targsrc_First(*target); + } + } + // step 3: write missing function to the file + if (bestsrc) { + tempstr text = tempstr() << eol << Trimmed(SysEval(tempstr()<<"amc -showcomment:N -report:N "<0) { algo::Refurbish(file); - verblog2("src_func.update" - <genaffix<acrkey != "") { + result << " // "<acrkey; + } + result << eol; // see define.h for meaning of this Replace(result,"NOTHROW","__attribute__((nothrow))"); Replace(result,"NORETURN","__attribute__((noreturn))"); @@ -111,7 +118,7 @@ void src_func::PrintGlobalProtos(src_func::FTarget &target, strptr ns, strptr sr if (Regx_Match(regx,src_Get(targsrc))) { tempstr funcs; ind_beg(src_func::targsrc_zd_func_curs,func,targsrc) { - if (!func.isstatic && GetFuncNs(func.func) == ns) { + if (!func.isstatic && src_func::GetFuncNs(func) == ns) { func.p_written_to = &targsrc; // save it PrintGlobalProtos_Decl(func,funcs,ns); } @@ -133,29 +140,37 @@ void src_func::Main_ListFunc() { ind_beg(src_func::_db_bh_func_curs,func,src_func::_db) { if (func.select) { tempstr out; - verblog("# src_func.func" - <acrkey) : strptr()) + < r.beg) { - ret = FirstN(line,r.beg); + ret = Trimmed(FirstN(line,r.beg)); } return ret; } @@ -82,12 +82,14 @@ tempstr src_func::GetProto(src_func::FFunc &func) { // Check if line contains function start // Criteria are: // - first character nonblank +// - has parentheses // - last nonblank character is { // - it's not namespace, enum or struct bool src_func::FuncstartQ(strptr line, strptr trimmedline) { bool funcstart = line.n_elems>0 && !algo_lib::WhiteCharQ(line.elems[0]) && !Regx_Match(src_func::_db.ignore_funcstart,line) + && FindStr(line,"(") !=-1 && trimmedline.n_elems>0 && trimmedline.elems[0] != '}' && qLast(trimmedline)!= ';'; @@ -110,16 +112,10 @@ bool src_func::FuncstartQ(strptr line, strptr trimmedline) { // ----------------------------------------------------------------------------- -// Extract function name for a global function, stripping arguments and namespace -static strptr GetFuncname(strptr funcname) { - return Pathcomp(funcname,"(LL RR:RR"); -} - -// ----------------------------------------------------------------------------- - // Extract function namespace name // void *ns::blah(arg1, arg2) -> ns -strptr src_func::GetFuncNs(strptr funcname) { +tempstr src_func::GetFuncNs(src_func::FFunc &func) { + strptr funcname = func.func; strptr s = Pathcomp(funcname,"(LL RR"); // void *ns::blah algo::i32_Range r = substr_FindLast(s,"::"); // 8..10 s = FirstN(s,r.beg);// void *ns @@ -127,20 +123,31 @@ strptr src_func::GetFuncNs(strptr funcname) { while (idx>0 && algo_lib::IdentCharQ(s[idx-1])) { idx--; } - return RestFrom(s,idx);// ns + tempstr ret(RestFrom(s,idx));// ns + return ret; +} + +static strptr GetAcrkey(src_func::FFunc &func) { + algo::strptr ret; + if (func.p_userfunc) { + // for keys like X/Y, leave only the Y + ret = Pathcomp(func.p_userfunc->acrkey,"/RR"); + } + return ret; } // ----------------------------------------------------------------------------- // Filter functions based on parameters provided on command line. -static bool MatchFuncQ(src_func::FFunc &func) { +bool src_func::MatchFuncQ(src_func::FFunc &func) { bool show=true && !(func.isstatic && !src_func::_db.cmdline.showstatic) // match raw function name (no namespace) - && Regx_Match(src_func::_db.cmdline.name,GetFuncname(func.func)) - && Regx_Match(src_func::_db.cmdline.body,func.body) - && Regx_Match(src_func::_db.cmdline.func,func.func) - && Regx_Match(src_func::_db.cmdline.comment, func.precomment); + && Regx_Match(src_func::_db.cmdline.func,func.name) + && Regx_Match(src_func::_db.cmdline.matchbody,func.body) + && Regx_Match(src_func::_db.cmdline.matchproto,func.func) + && Regx_Match(src_func::_db.cmdline.acrkey,GetAcrkey(func)) + && Regx_Match(src_func::_db.cmdline.matchcomment, func.precomment); return show; } @@ -184,24 +191,8 @@ strptr src_func::Nsline_GetNamespace(strptr str) { // ----------------------------------------------------------------------------- static void SelectTarget() { - // select target, and any targsrc under it - ind_beg(src_func::_db_target_curs,target,src_func::_db) { - target.select = Regx_Match(src_func::_db.cmdline.target, target.target); - if (target.select) { - ind_beg(src_func::target_cd_targsrc_curs,targsrc,target) { - targsrc.select=true; - }ind_end; - } - }ind_end; - // select targsrc, and any target above it ind_beg(src_func::_db_targsrc_curs,targsrc,src_func::_db) { - targsrc.select = targsrc.select || Regx_Match(src_func::_db.cmdline.targsrc, targsrc.targsrc); - if (targsrc.select) { - targsrc.p_target->select=true; - } - }ind_end; - ind_beg(src_func::_db_target_curs,target,src_func::_db) if (target.select) { - verblog("# select "< affix ns_tuneparam_ + // this is the most important class + affix << ns << "."< affix someproc.In_ + affix << Pathcomp(userfunc.acrkey,":LR/LL") << "_"; + } else if (StartsWithQ(userfunc.acrkey,"fstep:") || StartsWithQ(userfunc.acrkey,"fbuf:")) { + // acrkey:fstep:% + // userfunc:ns.FDb.cd_intfmc_read.Step + // -> affix ns._Step + // or + // acrkey:fbuf:ns.Msgbuf.in_custom + // userfunc:ns.Msgbuf.in_custom.ScanMsg + // -> affix ns._ScanMsg + affix << ns << "._" << Pathcomp(userfunc.userfunc,".RR"); + } + if (affix != "") { + src_func::ind_genaffix_GetOrCreate(affix); + } + }ind_end; + ind_beg(_db_genaffix_curs,genaffix,_db) { + verblog("src_func.genaffix" + <isinline = FindStr(funcline,"inline")!=-1; func->sortkey=Sortkey(targsrc,funcline,src_func::_db.cur_line); - func->amcprot = AmcProtQ(func->func); + tempstr key(Pathcomp(func->func, "(LL RR*RR&RR")); + Replace(key,"::","."); + func->p_userfunc = src_func::ind_userfunc_cppname_Find(key); func->p_targsrc = &targsrc; func->precomment = precomment; func->mystery = ch_N(func->precomment)<20 && !func->isstatic && !func->isinline; func->line = src_func::_db.cur_line; + // Compute a key-looking string, e.g. ns.blah + // for a function "void *ns::blah(arg1, arg2)" + // For a static function where ns is not part of the definition, + // grab ns name from the target + tempstr ns = src_func::GetFuncNs(*func); + if (ns == "") { + ns = func->p_targsrc->p_target->target; + } + func->name << ns << "." << Pathcomp(func->func,"(LL RR:RR"); + // function may fail to xref (and that's ok) bool xrefok=func_XrefMaybe(*func); if (!xrefok) { verblog(Location(*func,0)<<": src_func can't parse declaration: "<func<<" (failed to xref)"); } + if (func->p_userfunc) { + zd_func_Insert(*func->p_userfunc,*func); + } src_func::_db.report.n_func++; src_func::_db.report.n_static += func->isstatic; src_func::_db.report.n_inline += func->isinline; @@ -126,8 +118,8 @@ static src_func::FFunc *CreateFunc(src_func::FTargsrc &targsrc, strptr funcline, // Scan contents of FNAME and create function records static void ScanFile(src_func::FTargsrc &targsrc) { algo_lib::MmapFile file; - verblog2("src_func.scanfile" - <select; - } else { - ret &= - Regx_Match(src_func::_db.cmdline.targsrc, targsrc.targsrc) - || targsrc.p_target->select; - } - ret &= (src_func::_db.cmdline.gen || !GeneratedQ(targsrc)); + bool ret = (issrc || inlhdr) && targsrc.select; + ret = ret && (src_func::_db.cmdline.gen || !GeneratedQ(targsrc)); return ret; } // ----------------------------------------------------------------------------- -static void CreatePrefix(strptr ns, strptr name) { - src_func::ind_genprefix_GetOrCreate(tempstr() << ns << "::" << name); -} - -// ----------------------------------------------------------------------------- - -// Compute a table of function name prefixes that correspond to generated functions. -// We should not emit prototypes for these since this will allow dead code -// to exist. -static void PrepGenprefix() { - ind_beg(src_func::_db_gstatic_curs,gstatic,src_func::_db) { - CreatePrefix(ns_Get(gstatic), dmmeta::Field_name_Get(gstatic.field)); - }ind_end; - ind_beg(src_func::_db_dispatch_curs,dispatch,src_func::_db) { - CreatePrefix(ns_Get(dispatch), name_Get(dispatch)); - }ind_end; - - ind_beg(src_func::_db_fstep_curs,fstep,src_func::_db) { - CreatePrefix(ns_Get(fstep), name_Get(fstep)); - }ind_end; - ind_beg(src_func::_db_genprefix_curs,genprefix,src_func::_db) { - verblog2("src_func.prefix" - < static void Save(src_hdr::FSrc &src) { cstring out; - ind_beg(algo::Line_curs,line,src.shebang) { - out << "#" << line << eol; - }ind_end; - InsertComment(src,src.copyright,out); - InsertComment(src,"\n",out); - + verblog("src_hdr.file" + <text) + <text; if (license != "") { @@ -106,7 +114,6 @@ static void Save(src_hdr::FSrc &src) { out<0) { - if (tuple_qFind(0).head != tuple.head) { + auto& header = tuple_qFind(0); + auto flush = header.head.name == "" + ? header.head.value != tuple.head.value + : header.head.name != tuple.head.name; + flush |= attrs_N(tuple) != attrs_N(header); + if (flush) { Table_Flush(); } } @@ -320,7 +324,9 @@ void ssimfilt::Main() { // Populate output select ind_beg(command::ssimfilt_field_curs,match,_db.cmdline) { KVRegx &kvregx=selfield_Alloc(); - Regx_ReadSql(kvregx.key,match,true); + tempstr expr(match); + Replace(expr,",","|");// field1,field2 -> field1|field2 + Regx_ReadSql(kvregx.key,expr,true); }ind_end; if (_db.cmdline.t) { diff --git a/cpp/strconv/strconv.cpp b/cpp/strconv/strconv.cpp index e7f7fbad..d2667a5c 100644 --- a/cpp/strconv/strconv.cpp +++ b/cpp/strconv/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 // diff --git a/cpp/sv2ssim.cpp b/cpp/sv2ssim.cpp index 521a0f93..56b4d63d 100644 --- a/cpp/sv2ssim.cpp +++ b/cpp/sv2ssim.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 @@ -185,6 +185,8 @@ void sv2ssim::OutputSchema() { bool match=false; if (svtype.ctype == "bool") { match=field.couldbe_bool; + } else if (svtype.ctype == "char") { + match=!fldnumeric && field.maxwid<=1; } else if (numeric) { u64 maxval = u64(1)<, etc." amcdb.gen gen:ns_check_lim perns:Y comment:"Check that no functions/fields were added after function lock" +amcdb.gen gen:create_userfunc perns:N comment:"Create userfunc table (table of user-defined functions)" +amcdb.gen gen:nsjs_field perns:N comment:"" +amcdb.gen gen:nsjs_ctype perns:N comment:"" +amcdb.gen gen:nsjs_ns perns:N comment:"" +amcdb.gen gen:nsjs_module perns:Y comment:"Create js module" amcdb.gen gen:ns_write perns:Y comment:"Output namespace data" +amcdb.gen gen:table_write perns:N comment:"Output table data" diff --git a/data/amcdb/tcurs.ssim b/data/amcdb/tcurs.ssim index d77030e7..21f0e1fe 100644 --- a/data/amcdb/tcurs.ssim +++ b/data/amcdb/tcurs.ssim @@ -1,7 +1,7 @@ amcdb.tcurs tfunc:Atree.curs dflt:Y comment:"" amcdb.tcurs tfunc:Bheap.curs dflt:Y comment:"" amcdb.tcurs tfunc:Bheap.unordcurs dflt:N comment:"" -amcdb.tcurs tfunc:Bitset.bitcurs dflt:Y comment:"" +amcdb.tcurs tfunc:Bitset.bitcurs dflt:N comment:"" amcdb.tcurs tfunc:Inlary.curs dflt:Y comment:"" amcdb.tcurs tfunc:Lary.curs dflt:Y comment:"" amcdb.tcurs tfunc:Llist.curs dflt:Y comment:"" diff --git a/data/amcdb/tfunc.ssim b/data/amcdb/tfunc.ssim index cc010e24..1711242a 100644 --- a/data/amcdb/tfunc.ssim +++ b/data/amcdb/tfunc.ssim @@ -127,6 +127,8 @@ amcdb.tfunc tfunc:Ctype.GetAnon hasthrow:N leaf:Y poolfunc:N inl:N wur:N amcdb.tfunc tfunc:Ctype.NArgs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Used with command lines" amcdb.tfunc tfunc:Ctype.FastEncode hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Ctype.FastDecode hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" +amcdb.tfunc tfunc:Ctype.KafkaEncode hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" +amcdb.tfunc tfunc:Ctype.KafkaDecode hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Ctype.AssignOp hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Ctype.FixEncode hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Ctype2.Ctor hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" @@ -172,7 +174,8 @@ amcdb.tfunc tfunc:Fbuf.ScanMsg hasthrow:N leaf:Y poolfunc:N inl:N wur:N p amcdb.tfunc tfunc:Fbuf.Shift hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Internal function to shift data left" amcdb.tfunc tfunc:Fbuf.SkipBytes hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Skip N bytes when reading" amcdb.tfunc tfunc:Fbuf.SkipMsg hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Skip current message, if any" -amcdb.tfunc tfunc:Fbuf.WriteAll hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Attempt to write buffer contents to fd" +amcdb.tfunc tfunc:Fbuf.WriteAll hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Attempt to write buffer contents to fbuf, return success" +amcdb.tfunc tfunc:Fbuf.WriteReserve hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Write buffer contents to fbuf, reallocate as needed" amcdb.tfunc tfunc:Fbuf.WriteMsg hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Write message to buffer. If the entire message is written, return true, otherwise false." amcdb.tfunc tfunc:Fbuf.Uninit hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:"Free memory" amcdb.tfunc tfunc:Fcast.Cast hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" @@ -302,6 +305,8 @@ amcdb.tfunc tfunc:Ptrary.EmptyQ hasthrow:N leaf:Y poolfunc:N inl:Y wur:N amcdb.tfunc tfunc:Ptrary.Find hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:"Look up row by row id. Return NULL if out of range" amcdb.tfunc tfunc:Ptrary.Getary hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:"Return array of pointers" amcdb.tfunc tfunc:Ptrary.Init hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:"" +amcdb.tfunc tfunc:Ptrary.First hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure:Y ismacro:N comment:"" +amcdb.tfunc tfunc:Ptrary.Last hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure:Y ismacro:N comment:"" amcdb.tfunc tfunc:Ptrary.Insert hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Ptrary.InsertMaybe hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Ptrary.ScanInsertMaybe hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" @@ -311,7 +316,9 @@ amcdb.tfunc tfunc:Ptrary.RemoveAll hasthrow:N leaf:Y poolfunc:N inl:N wur: amcdb.tfunc tfunc:Ptrary.Reserve hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Reserve space in index for N more elements;" amcdb.tfunc tfunc:Ptrary.Uninit hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:"" amcdb.tfunc tfunc:Ptrary.curs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" +amcdb.tfunc tfunc:Ptrary.RemoveFirst hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Heap-like Ptrary: remove first element" amcdb.tfunc tfunc:Ptrary.oncecurs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" +amcdb.tfunc tfunc:Ptrary.RemoveLast hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Ptrary: remove last element" amcdb.tfunc tfunc:Ptrary.qFind hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:"Return reference without bounds checking" amcdb.tfunc tfunc:Ptrary.InAryQ hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:"True if row is in any ptrary instance" amcdb.tfunc tfunc:Ptrary.qLast hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:"Reference to last element without bounds checking" @@ -327,7 +334,6 @@ amcdb.tfunc tfunc:Sbrk.Init hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure amcdb.tfunc tfunc:Smallstr.Add hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Smallstr.AddStrptr hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Smallstr.Getary hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:"" -amcdb.tfunc tfunc:Smallstr.HashStrptr hasthrow:N leaf:N poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Smallstr.Init hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:Y comment:"" amcdb.tfunc tfunc:Smallstr.Max hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Smallstr.N hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure:Y ismacro:N comment:"" @@ -360,6 +366,7 @@ amcdb.tfunc tfunc:Tary.Addary hasthrow:N leaf:Y poolfunc:N inl:N wur:N pu amcdb.tfunc tfunc:Tary.Alloc hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Tary.AllocAt hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Tary.AllocN hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:"Reserve space. Insert N elements at the end of the array, return pointer to array" +amcdb.tfunc tfunc:Tary.AllocNAt hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:"Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements" amcdb.tfunc tfunc:Tary.EmptyQ hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:"Return true if index is empty" amcdb.tfunc tfunc:Tary.Find hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure:N ismacro:N comment:"Look up row by row id. Return NULL if out of range" amcdb.tfunc tfunc:Tary.Getary hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:"Return array pointer by value" @@ -385,6 +392,7 @@ amcdb.tfunc tfunc:Tary.rowid_Get hasthrow:N leaf:Y poolfunc:N inl:Y wur:N amcdb.tfunc tfunc:Tary.curs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Tary.AllocNVal hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Reserve space. Insert N elements at the end of the array, return pointer to array" amcdb.tfunc tfunc:Tary.ReadStrptrMaybe hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" +amcdb.tfunc tfunc:Tary.Insary hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Insert array at specific position" amcdb.tfunc tfunc:Thash.Cascdel hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Delete all rows reachable through the hash index" amcdb.tfunc tfunc:Thash.EmptyQ hasthrow:N leaf:Y poolfunc:N inl:Y wur:N pure:N ismacro:N comment:"Return true if hash is empty" amcdb.tfunc tfunc:Thash.Find hasthrow:N leaf:Y poolfunc:N inl:N wur:Y pure:N ismacro:N comment:"Find row by key. Return NULL if not found." @@ -395,6 +403,7 @@ amcdb.tfunc tfunc:Thash.N hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure:Y amcdb.tfunc tfunc:Thash.InsertMaybe hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Thash.Remove hasthrow:N leaf:Y poolfunc:Y inl:N wur:N pure:N ismacro:N comment:"Remove reference to element from hash index. If element is not in hash, do nothing" amcdb.tfunc tfunc:Thash.Reserve hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Reserve enough room in the hash for N more elements. Return success code." +amcdb.tfunc tfunc:Thash.AbsReserve hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"Reserve enough room for exacty N elements. Return success code." amcdb.tfunc tfunc:Thash.FindRemove hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Thash.Uninit hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:"" amcdb.tfunc tfunc:Thash.curs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" @@ -415,6 +424,7 @@ amcdb.tfunc tfunc:Varlen.N hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure: amcdb.tfunc tfunc:Varlen.ReadStrptrMaybe hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Varlen.curs hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:Varlen.Print hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" +amcdb.tfunc tfunc:Varlen.Init hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:"" amcdb.tfunc tfunc:ZSListMT.DestructiveFirst hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:N comment:"" amcdb.tfunc tfunc:ZSListMT.InLlistQ hasthrow:N leaf:Y poolfunc:N inl:Y wur:Y pure:N ismacro:N comment:"Return true if row is in index, false otherwise. Row must be non-NULL." amcdb.tfunc tfunc:ZSListMT.Init hasthrow:N leaf:Y poolfunc:N inl:N wur:N pure:N ismacro:Y comment:"" diff --git a/data/amsdb/proctype.ssim b/data/amsdb/proctype.ssim index abe600ce..51f86f50 100644 --- a/data/amsdb/proctype.ssim +++ b/data/amsdb/proctype.ssim @@ -1,2 +1,2 @@ -amsdb.proctype proctype:0 id:0 ns:"" comment:"No process" -amsdb.proctype proctype:amstest id:5 ns:ams_sendtest comment:"Ams testing" +amsdb.proctype proctype:"" id:0 ns:"" comment:"No process" +amsdb.proctype proctype:ams_sendtest id:5 ns:ams_sendtest comment:"Ams testing" diff --git a/data/amsdb/shmtype.ssim b/data/amsdb/shmtype.ssim new file mode 100644 index 00000000..9fd87330 --- /dev/null +++ b/data/amsdb/shmtype.ssim @@ -0,0 +1,3 @@ +amsdb.shmtype shmtype:ctl id:1 nonblock:Y comment:"AMS control messages" +amsdb.shmtype shmtype:log id:9 nonblock:N comment:"Log messages" +amsdb.shmtype shmtype:out id:2 nonblock:N comment:"Log messages, alarms" diff --git a/data/amsdb/streamtype.ssim b/data/amsdb/streamtype.ssim deleted file mode 100644 index e14dcc6f..00000000 --- a/data/amsdb/streamtype.ssim +++ /dev/null @@ -1,5 +0,0 @@ -amsdb.streamtype streamtype:0 id:0 comment:"No stream" -amsdb.streamtype streamtype:ctl id:1 comment:"AMS control messages" -amsdb.streamtype streamtype:io id:5 comment:"Messages intended for file output" -amsdb.streamtype streamtype:out id:2 comment:"Log messages, alarms" -amsdb.streamtype streamtype:trace id:6 comment:"Trace messages" diff --git a/data/atfdb/amctest.ssim b/data/atfdb/amctest.ssim index 6259c281..617eddce 100644 --- a/data/atfdb/amctest.ssim +++ b/data/atfdb/amctest.ssim @@ -110,7 +110,9 @@ atfdb.amctest amctest:PmaskMultiple comment:"Check Pmask Multiple" atfdb.amctest amctest:PrintBase36 comment:"" atfdb.amctest amctest:PrintRawGconst comment:"Check that gconst field within tuple is printed as raw" atfdb.amctest amctest:PtraryCursor comment:"Test Ptrary cursor" +atfdb.amctest amctest:PtraryHeaplike comment:"Test heap-like Ptrary" atfdb.amctest amctest:PtraryInsert comment:"Insert/Remove invariants for Ptrary" +atfdb.amctest amctest:PtraryNonUnique comment:"Test non-unique heap-like" atfdb.amctest amctest:ReadProc comment:"Read from subprocess" atfdb.amctest amctest:ReadTuple1 comment:"A single field is printed without field name" atfdb.amctest amctest:ReadTuple2 comment:"Two fields are printed as name-value pairs." @@ -121,10 +123,13 @@ atfdb.amctest amctest:ReadTuple5 comment:"Attr_curs -- quoted strings" atfdb.amctest amctest:Scratch comment:"Scratch area for new test development" atfdb.amctest amctest:SetGetnumBase10 comment:"" atfdb.amctest amctest:SubstrDfltval comment:"" +atfdb.amctest amctest:TaryAllocNAt comment:"" +atfdb.amctest amctest:TaryHash comment:"" atfdb.amctest amctest:TaryInit comment:"u32: Add element to Tary, check that it's initialized" atfdb.amctest amctest:TaryInit2 comment:"u32: Add N elements to Tary, check that they're initialized" atfdb.amctest amctest:TaryInit3 comment:"u8: Add element to Tary, check that it's initialized" atfdb.amctest amctest:TaryInit4 comment:"u8: Add N elements to Tary, check that they're initialized" +atfdb.amctest amctest:TaryInsary comment:"" atfdb.amctest amctest:TaryReserve comment:"" atfdb.amctest amctest:TestBitfld comment:"U16 bitfields: Set values, check that they were set" atfdb.amctest amctest:TestBitfld2 comment:"U128 bitfields: Set values, check that they were set" @@ -152,9 +157,15 @@ atfdb.amctest amctest:ThashEmpty comment:"" atfdb.amctest amctest:ThashFindRemove comment:"" atfdb.amctest amctest:ThashGetOrCreate comment:"" atfdb.amctest amctest:ThashInsertMaybe comment:"" +atfdb.amctest amctest:ThashLinear comment:"" atfdb.amctest amctest:ThashRemove comment:"" +atfdb.amctest amctest:ThashStrkey comment:"" atfdb.amctest amctest:ThashXref comment:"" atfdb.amctest amctest:Typetag comment:"" +atfdb.amctest amctest:Varlen2 comment:"" +atfdb.amctest amctest:Varlen2a comment:"" +atfdb.amctest amctest:Varlen2m comment:"" +atfdb.amctest amctest:Varlen2v comment:"" atfdb.amctest amctest:VarlenAlloc comment:"" atfdb.amctest amctest:VarlenExternLength comment:"" atfdb.amctest amctest:VarlenMsgs comment:"Variable-length messages (Opt+Varlen)" @@ -203,6 +214,7 @@ atfdb.amctest amctest:bytebuf_test2 comment:"Write some bytes, read back" atfdb.amctest amctest:fstep_Inline comment:"Check step type" atfdb.amctest amctest:fstep_InlineOnce comment:"Check step type" atfdb.amctest amctest:fstep_InlineRecur comment:"Check step type" +atfdb.amctest amctest:fstep_TimeHookOnce comment:"Check step type" atfdb.amctest amctest:fstep_TimeHookRecur comment:"Check step type" atfdb.amctest amctest:linebuf_test1 comment:"Initial state -- no line" atfdb.amctest amctest:linebuf_test2 comment:"write a line, read line back" @@ -220,7 +232,7 @@ atfdb.amctest amctest:msgbuf_test2 comment:"good message, then not enough data atfdb.amctest amctest:msgbuf_test3 comment:"good message, then not enough data" atfdb.amctest amctest:msgbuf_test4 comment:"message, read partial message, supply new data, read message" atfdb.amctest amctest:msgbuf_test5 comment:"If GetMsg returns NULL, buffer is removed from read list" -atfdb.amctest amctest:msgbuf_test6 comment:"Write runt message to buffer, check that eof and error flags are set" -atfdb.amctest amctest:msgbuf_test7 comment:"Write HUGE message to buffer, check that error flag is set" +atfdb.amctest amctest:msgbuf_test6 comment:"Write runt message to buffer, check that eof and err flags are set" +atfdb.amctest amctest:msgbuf_test7 comment:"Write HUGE message to buffer, check that err flag is set" atfdb.amctest amctest:msgbuf_test8 comment:"Write message to pipe, read it" atfdb.amctest amctest:msgbuf_test9 comment:"Write 2 messages to temp buffer. Feed them 1 by one through buffer" diff --git a/data/atfdb/cijob.ssim b/data/atfdb/cijob.ssim index 97453935..d3797894 100644 --- a/data/atfdb/cijob.ssim +++ b/data/atfdb/cijob.ssim @@ -1,4 +1,4 @@ -atfdb.cijob cijob:comp comment:"Component test" -atfdb.cijob cijob:cov comment:"Coverage test" +atfdb.cijob cijob:comp comment:"Coverage and component test" +atfdb.cijob cijob:coverage comment:"compute coverage" atfdb.cijob cijob:memcheck comment:"Component tests in memcheck mode" atfdb.cijob cijob:normalize comment:"Default job, fast normalization & unit tests" diff --git a/data/atfdb/cipackage.ssim b/data/atfdb/cipackage.ssim index e69de29b..955191a0 100644 --- a/data/atfdb/cipackage.ssim +++ b/data/atfdb/cipackage.ssim @@ -0,0 +1,2 @@ +atfdb.cipackage package:gcli remove:Y build:N reinstall:"gcli|gmv" comment:"" +atfdb.cipackage package:samp_make remove:Y build:N reinstall:samp_make comment:"" diff --git a/data/atfdb/citest.ssim b/data/atfdb/citest.ssim index 5da7ca52..3c4893fb 100644 --- a/data/atfdb/citest.ssim +++ b/data/atfdb/citest.ssim @@ -1,7 +1,8 @@ atfdb.citest citest:checkclean cijob:normalize sandbox:N comment:"Check that no files are modified" -atfdb.citest citest:atf_amc cijob:comp sandbox:N comment:"Test amc (run atf_amc)" +atfdb.citest citest:cleantemp cijob:normalize sandbox:N comment:"Clean out temp directory every once in a while" atfdb.citest citest:gitfile cijob:normalize sandbox:N comment:"Update gitfile tables by scanning filesystem" atfdb.citest citest:scanreadme cijob:normalize sandbox:N comment:"Update readme tables by scanning filesystem" +atfdb.citest citest:quickreadme cijob:normalize sandbox:N comment:"Quick re-generate of readmes (without evaluation)" atfdb.citest citest:ssimfile cijob:normalize sandbox:N comment:"Check for .ssim files with no corresponding ssimfile entry" atfdb.citest citest:normalize_acr cijob:normalize sandbox:N comment:"Read ssim databases into memory and write back" atfdb.citest citest:src_lim cijob:normalize sandbox:N comment:"Source code police" @@ -9,27 +10,31 @@ atfdb.citest citest:amc cijob:normalize sandbox:N comment:"Run amc" atfdb.citest citest:bootstrap cijob:normalize sandbox:N comment:"Re-generate bootstrap files" atfdb.citest citest:shebang cijob:normalize sandbox:N comment:"" atfdb.citest citest:encoding cijob:normalize sandbox:N comment:"Check Encoding of h/cpp files" -atfdb.citest citest:readme cijob:normalize sandbox:N comment:"Re-generate readme files" atfdb.citest citest:file_header cijob:normalize sandbox:N comment:"Update headers in source files" atfdb.citest citest:non-copyrighted cijob:normalize sandbox:N comment:"Find non-copyrighted files" atfdb.citest citest:iffy_src cijob:normalize sandbox:N comment:"Check for iffy source constructs with src_func" atfdb.citest citest:stray_gen cijob:normalize sandbox:N comment:"*/gen/* file that doesn't appear to be generated by amc" atfdb.citest citest:tempcode cijob:normalize sandbox:N comment:"Check for temp code inserted for testing only" atfdb.citest citest:lineendings cijob:normalize sandbox:N comment:"Correct windows-style line endings in known text files" +atfdb.citest citest:update_script cijob:normalize sandbox:N comment:"Update scriptfile table" atfdb.citest citest:indent_script cijob:normalize sandbox:N comment:"Indent any bash script file" -atfdb.citest citest:comptest cijob:comp sandbox:N comment:"Rewrite/normalize component tests" -atfdb.citest citest:cppcheck cijob:comp sandbox:N comment:"Cppcheck static code analysis" -atfdb.citest citest:bintests cijob:comp sandbox:N comment:"Run bin/test-* scripts" +atfdb.citest citest:cppcheck cijob:normalize sandbox:N comment:"Cppcheck static code analysis" atfdb.citest citest:indent_srcfile cijob:normalize sandbox:N comment:"Indent any source files modified in last commit" +atfdb.citest citest:readme cijob:normalize sandbox:N comment:"Re-generate readme files" atfdb.citest citest:normalize_amc_vis cijob:normalize sandbox:N comment:"Check that amc_vis doesn't see any circular dependencies" atfdb.citest citest:normalize_acr_my cijob:normalize sandbox:N comment:"Round trip ssim databases through MariaDB and back" atfdb.citest citest:apm_check cijob:normalize sandbox:N comment:"" +atfdb.citest citest:atf_amc cijob:comp sandbox:N comment:"Test amc (run atf_amc)" +atfdb.citest citest:comptest cijob:comp sandbox:N comment:"Rewrite/normalize component tests" +atfdb.citest citest:bintests cijob:comp sandbox:N comment:"Run bin/test-* scripts" atfdb.citest citest:atf_unit cijob:comp sandbox:N comment:"Run unit tests" atfdb.citest citest:atf_comp cijob:comp sandbox:N comment:"Run component tests" -atfdb.citest citest:atf_comp_cov cijob:cov sandbox:N comment:"Check component test coverage" -atfdb.citest citest:apm cijob:comp sandbox:Y comment:"Test APM" -atfdb.citest citest:atf_comp_mem cijob:memcheck sandbox:N comment:"Run component tests in memcheck mode (slow)" +atfdb.citest citest:atf_comp_cov cijob:coverage sandbox:N comment:"Check component test coverage" atfdb.citest citest:acr_ed_ssimfile cijob:comp sandbox:Y comment:"Create a new ssimfile" atfdb.citest citest:acr_ed_ssimdb cijob:comp sandbox:Y comment:"Create a new ssimdb" -atfdb.citest citest:apm_reinstall cijob:comp sandbox:Y comment:"Check that packages are removable" +atfdb.citest citest:acr_ed_unittest cijob:comp sandbox:Y comment:"Create a new unit test" atfdb.citest citest:acr_ed_target cijob:comp sandbox:Y comment:"Takes a while - do it last" +atfdb.citest citest:apm cijob:comp sandbox:Y comment:"Test APM" +atfdb.citest citest:apm_reinstall cijob:comp sandbox:Y comment:"Check that packages are removable" +atfdb.citest citest:abt_md_after_ssimfile_is_added cijob:comp sandbox:Y comment:"Test that directory README.md is updated with all new .md files" +atfdb.citest citest:atf_comp_mem cijob:memcheck sandbox:N comment:"Run component tests in memcheck mode (slow)" diff --git a/data/atfdb/comptest.ssim b/data/atfdb/comptest.ssim index 9e67b352..1271cecd 100644 --- a/data/atfdb/comptest.ssim +++ b/data/atfdb/comptest.ssim @@ -1,206 +1,213 @@ -atfdb.comptest comptest:acr.BadInsert timeout:10 memcheck:Y exit_code:0 comment:"Duplicate insert is ignored" -atfdb.comptest comptest:acr.BadNs timeout:10 memcheck:Y exit_code:1 comment:"Insert a bad record and check that it's detected" -atfdb.comptest comptest:acr.BadPkey timeout:10 memcheck:Y exit_code:0 comment:"Warning about missing pkey - not error" -atfdb.comptest comptest:acr.BadReftype timeout:10 memcheck:Y exit_code:1 comment:"Invalid reftype detected" -atfdb.comptest comptest:acr.CascDel timeout:10 memcheck:Y exit_code:0 comment:"-del recursively deletes dependent records" -atfdb.comptest comptest:acr.CascDel2 timeout:10 memcheck:Y exit_code:0 comment:"Insert records & cascade delete them -- no change" -atfdb.comptest comptest:acr.DelField timeout:10 memcheck:Y exit_code:0 comment:"A field is deleted" -atfdb.comptest comptest:acr.DelRecord timeout:10 memcheck:Y exit_code:0 comment:"A record is deleted" -atfdb.comptest comptest:acr.DeleteReinsert timeout:10 memcheck:Y exit_code:0 comment:"A record is deleted and re-inserted" -atfdb.comptest comptest:acr.Fields timeout:10 memcheck:Y exit_code:0 comment:"Select fields" -atfdb.comptest comptest:acr.FieldsComma timeout:10 memcheck:Y exit_code:0 comment:"Select fields with comma separator" -atfdb.comptest comptest:acr.GitTrigger1 timeout:10 memcheck:Y exit_code:0 comment:"Test -g option" -atfdb.comptest comptest:acr.Insert timeout:10 memcheck:Y exit_code:0 comment:"Insert a few records" -atfdb.comptest comptest:acr.InsertDelete timeout:10 memcheck:Y exit_code:0 comment:"Insert & delete record, nothing happens" -atfdb.comptest comptest:acr.Merge timeout:10 memcheck:Y exit_code:0 comment:Merging -atfdb.comptest comptest:acr.Meta1 timeout:10 memcheck:Y exit_code:0 comment:"Select meta-information" -atfdb.comptest comptest:acr.Meta2 timeout:10 memcheck:Y exit_code:0 comment:"Select meta-information" -atfdb.comptest comptest:acr.Meta3 timeout:10 memcheck:Y exit_code:0 comment:"Select meta-information" -atfdb.comptest comptest:acr.NullTrunc timeout:10 memcheck:Y exit_code:0 comment:"Trunc with reinsertion has no effect" -atfdb.comptest comptest:acr.QueryCtype timeout:10 memcheck:Y exit_code:0 comment:"Select one record" -atfdb.comptest comptest:acr.RenameCollision timeout:10 memcheck:Y exit_code:0 comment:"Rename with collision" -atfdb.comptest comptest:acr.RenameField timeout:10 memcheck:Y exit_code:0 comment:"-rename -field renames affected attributes in dataset" -atfdb.comptest comptest:acr.RenameRecord timeout:10 memcheck:Y exit_code:0 comment:"Rename field and propagate recursively through structured keys" -atfdb.comptest comptest:acr.Replace timeout:10 memcheck:Y exit_code:0 comment:"A record is replaced" -atfdb.comptest comptest:acr.Select timeout:10 memcheck:Y exit_code:0 comment:"A record is selected" -atfdb.comptest comptest:acr.SelectStdin timeout:10 memcheck:Y exit_code:0 comment:"A record is selected by reading stdin" -atfdb.comptest comptest:acr.SelectTree timeout:10 memcheck:Y exit_code:0 comment:"Tree selection" -atfdb.comptest comptest:acr.TooManyArgs timeout:10 memcheck:Y exit_code:1 comment:"Acr command line input error" -atfdb.comptest comptest:acr.Trunc timeout:10 memcheck:Y exit_code:0 comment:"Truncate table" -atfdb.comptest comptest:acr.UpdateBad timeout:10 memcheck:Y exit_code:0 comment:"Update fails" -atfdb.comptest comptest:acr.UpdateGood timeout:10 memcheck:Y exit_code:0 comment:"Update succeeds" -atfdb.comptest comptest:acr.Where timeout:10 memcheck:Y exit_code:0 comment:"Test -where option" -atfdb.comptest comptest:acr_compl.A01a timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A01b timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A01c timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A02a timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A02b timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A02c timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A03a timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A03b timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A03c timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A04a timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A04b timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A04c timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A05a timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A05b timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A05c timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A06a timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A06b timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A06c timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A07a timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A07b timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.A07c timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr01 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr02 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr03 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr04 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr05 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr06 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr07 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr08 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr09 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr10 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr11 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr12 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Acr13 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.BadExe timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.BadOpt timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.BadOptColon timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.BadOptColonSpace timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.BadOptSpace timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Bare timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.DblColon timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.DblColonList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.DblSpace timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.DblSpaceList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.EnumCtypeColon timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.EnumCtypeColonList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.EnumCtypeSpace timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.EnumCtypeSpaceList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.EnumFieldColon timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.EnumFieldColonList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.EnumFieldSpace timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.EnumFieldSpaceList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.FlagColon timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.FlagColonList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.FlagSpace timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.FlagSpaceList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.Install timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.NumColon timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.NumColonList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.NumSpace timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.NumSpaceList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptCumul timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptCumulAlias timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptD timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptDList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptH timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptHList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptNonCumul timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptNonCumulAlias timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeyColon timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeyColonFull timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeyColonFullList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeyColonList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeyColonPrefix timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeyColonPrefixList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeyColonSubstr timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeyColonSubstrList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeySpace timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeySpaceFull timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeySpaceFullList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeySpaceList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeySpacePrefix timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeySpacePrefixList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeySpaceSubstr timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptPkeySpaceSubstrList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxColon timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxColonFull timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxColonFullList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxColonList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxColonPrefix timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxColonPrefixList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxColonSubstr timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxColonSubstrList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxSpace timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxSpaceFull timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxSpaceFullList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxSpaceList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxSpacePrefix timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxSpacePrefixList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxSpaceSubstr timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptRegxSpaceSubstrList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptSig timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptSigList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptV timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.OptVList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.R01a timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.R01b timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.R01c timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.R01d timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.R02a timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.R02b timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.R02c timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.R02d timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.StrColon timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.StrColonList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.StrSpace timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.StrSpaceList timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.T01 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.T02 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.T03 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.T04 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.T05 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.T06 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.T07 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.T08 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.T09 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_compl.T10 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_dm.Conflict timeout:10 memcheck:Y exit_code:1 comment:"" -atfdb.comptest comptest:acr_dm.Merge timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_dm.RenameTuple timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_ed.CreateCtype timeout:10 memcheck:Y exit_code:0 comment:"Create a regular ctype" -atfdb.comptest comptest:acr_ed.CreateSrcfileTarget timeout:10 memcheck:Y exit_code:0 comment:"Create a source file in a non-standard location for its target" -atfdb.comptest comptest:acr_ed.CreateSsimfileBadNs timeout:10 memcheck:Y exit_code:1 comment:"Create a ssimfile for a non-existence namespace" -atfdb.comptest comptest:acr_in.Reverse timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_in.Simple timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:acr_in.Tree timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:aqlite.CompileOptions timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:aqlite.Constraints timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:aqlite.ErrorHandling timeout:10 memcheck:Y exit_code:1 comment:"" -atfdb.comptest comptest:aqlite.Joins timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:aqlite.Number timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:aqlite.PatternMatching timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:aqlite.Performance timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:aqlite.Smoke timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:atf_cmdline.Bare timeout:10 memcheck:Y exit_code:1 comment:"" -atfdb.comptest comptest:atf_cmdline.Debug timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:atf_cmdline.Help timeout:10 memcheck:Y exit_code:1 comment:"" -atfdb.comptest comptest:atf_cmdline.Minimal timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:atf_cmdline.MinimalExec timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:atf_cmdline.Rich timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:atf_cmdline.RichExec timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:atf_cmdline.Sig timeout:10 memcheck:Y exit_code:1 comment:"" -atfdb.comptest comptest:atf_cmdline.Verbose timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:atf_cmdline.Version timeout:10 memcheck:Y exit_code:1 comment:"" -atfdb.comptest comptest:mdbg.OutOfOrderArgs timeout:10 memcheck:Y exit_code:1 comment:"" -atfdb.comptest comptest:mdbg.Smoke timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:mdbg.SmokeBreak timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:mdbg.SmokeBreak2 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:samp_meng.Smoke timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:ssimfilt.Csv timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:ssimfilt.CsvField timeout:10 memcheck:Y exit_code:0 comment:"CSV + field selection" -atfdb.comptest comptest:ssimfilt.FirstTag timeout:10 memcheck:Y exit_code:0 comment:"Lock typetag to first input tuple" -atfdb.comptest comptest:ssimfilt.Json timeout:10 memcheck:Y exit_code:0 comment:"Convert test data to json" -atfdb.comptest comptest:ssimfilt.JsonRecursive timeout:10 memcheck:Y exit_code:0 comment:"Print Recursive json object" -atfdb.comptest comptest:ssimfilt.MatchField timeout:10 memcheck:Y exit_code:0 comment:"Select fields by value" -atfdb.comptest comptest:ssimfilt.MatchTag timeout:10 memcheck:Y exit_code:0 comment:"Match typetag" -atfdb.comptest comptest:ssimfilt.SelectField timeout:10 memcheck:Y exit_code:0 comment:"Select several fields" -atfdb.comptest comptest:ssimfilt.Stable timeout:10 memcheck:Y exit_code:0 comment:"Filter unstable fields" -atfdb.comptest comptest:ssimfilt.Table timeout:10 memcheck:Y exit_code:0 comment:"Tabular output" -atfdb.comptest comptest:sv2ssim.Convert1 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:sv2ssim.Convert1Signed timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:sv2ssim.Convert2 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:sv2ssim.Convert2Tsv timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:sv2ssim.UniqueFieldName timeout:10 memcheck:Y exit_code:0 comment:"" +atfdb.comptest comptest:acr.BadInsert timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Duplicate insert is ignored" +atfdb.comptest comptest:acr.BadNs timeout:10 memcheck:Y coverage:Y exit_code:1 ncore:1 repeat:1 comment:"Insert a bad record and check that it's detected" +atfdb.comptest comptest:acr.BadPkey timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Warning about missing pkey - not error" +atfdb.comptest comptest:acr.BadReftype timeout:10 memcheck:Y coverage:Y exit_code:1 ncore:1 repeat:1 comment:"Invalid reftype detected" +atfdb.comptest comptest:acr.CascDel timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"-del recursively deletes dependent records" +atfdb.comptest comptest:acr.CascDel2 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Insert records & cascade delete them -- no change" +atfdb.comptest comptest:acr.CascDel3 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"acr.delete cascade deletes" +atfdb.comptest comptest:acr.DelField timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"A field is deleted" +atfdb.comptest comptest:acr.DelRecord timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"A record is deleted" +atfdb.comptest comptest:acr.DeleteReinsert timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"A record is deleted and re-inserted" +atfdb.comptest comptest:acr.Fields timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Select fields" +atfdb.comptest comptest:acr.FieldsComma timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Select fields with comma separator" +atfdb.comptest comptest:acr.GitTrigger1 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Test -g option" +atfdb.comptest comptest:acr.Insert timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Insert a few records" +atfdb.comptest comptest:acr.InsertDelete timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Insert & delete record, nothing happens" +atfdb.comptest comptest:acr.Merge timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:Merging +atfdb.comptest comptest:acr.Meta1 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Select meta-information" +atfdb.comptest comptest:acr.Meta2 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Select meta-information" +atfdb.comptest comptest:acr.Meta3 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Select meta-information" +atfdb.comptest comptest:acr.NullTrunc timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Trunc with reinsertion has no effect" +atfdb.comptest comptest:acr.QueryCtype timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Select one record" +atfdb.comptest comptest:acr.RenameCollision timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Rename with collision" +atfdb.comptest comptest:acr.RenameField timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"-rename -field renames affected attributes in dataset" +atfdb.comptest comptest:acr.RenameRecord timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Rename field and propagate recursively through structured keys" +atfdb.comptest comptest:acr.Replace timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"A record is replaced" +atfdb.comptest comptest:acr.Select timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"A record is selected" +atfdb.comptest comptest:acr.SelectStdin timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"A record is selected by reading stdin" +atfdb.comptest comptest:acr.SelectTree timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Tree selection" +atfdb.comptest comptest:acr.TooManyArgs timeout:10 memcheck:Y coverage:Y exit_code:1 ncore:1 repeat:1 comment:"Acr command line input error" +atfdb.comptest comptest:acr.Trunc timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Truncate table" +atfdb.comptest comptest:acr.UpdateBad timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Update fails" +atfdb.comptest comptest:acr.UpdateGood timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Update succeeds" +atfdb.comptest comptest:acr.Where timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Test -where option" +atfdb.comptest comptest:acr_compl.A01a timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A01b timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A01c timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A02a timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A02b timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A02c timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A03a timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A03b timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A03c timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A04a timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A04b timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A04c timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A05a timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A05b timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A05c timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A06a timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A06b timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A06c timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A07a timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A07b timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.A07c timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr01 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr02 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr03 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr04 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr05 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr06 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr07 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr08 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr09 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr10 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr11 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr12 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Acr13 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.BadExe timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.BadOpt timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.BadOptColon timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.BadOptColonSpace timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.BadOptSpace timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Bare timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.DblColon timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.DblColonList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.DblSpace timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.DblSpaceList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.EnumCtypeColon timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.EnumCtypeColonList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.EnumCtypeSpace timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.EnumCtypeSpaceList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.EnumFieldColon timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.EnumFieldColonList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.EnumFieldSpace timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.EnumFieldSpaceList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.FlagColon timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.FlagColonList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.FlagSpace timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.FlagSpaceList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.Install timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.NumColon timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.NumColonList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.NumSpace timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.NumSpaceList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptCumul timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptCumulAlias timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptD timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptDList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptH timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptHList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptNonCumul timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptNonCumulAlias timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeyColon timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeyColonFull timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeyColonFullList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeyColonList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeyColonPrefix timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeyColonPrefixList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeyColonSubstr timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeyColonSubstrList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeySpace timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeySpaceFull timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeySpaceFullList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeySpaceList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeySpacePrefix timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeySpacePrefixList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeySpaceSubstr timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptPkeySpaceSubstrList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxColon timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxColonFull timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxColonFullList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxColonList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxColonPrefix timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxColonPrefixList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxColonSubstr timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxColonSubstrList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxSpace timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxSpaceFull timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxSpaceFullList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxSpaceList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxSpacePrefix timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxSpacePrefixList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxSpaceSubstr timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptRegxSpaceSubstrList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptSig timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptSigList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptV timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.OptVList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.R01a timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.R01b timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.R01c timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.R01d timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.R02a timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.R02b timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.R02c timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.R02d timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.StrColon timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.StrColonList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.StrSpace timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.StrSpaceList timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.T01 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.T02 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.T03 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.T04 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.T05 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.T06 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.T07 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.T08 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.T09 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_compl.T10 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_dm.Conflict timeout:10 memcheck:Y coverage:Y exit_code:1 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_dm.Merge timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_dm.RenameTuple timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_ed.CreateCtype timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Create a regular ctype" +atfdb.comptest comptest:acr_ed.CreateMsg timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Create a message" +atfdb.comptest comptest:acr_ed.CreateSrcfileTarget timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Create a source file in a non-standard location for its target" +atfdb.comptest comptest:acr_ed.CreateSsimfile timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Script to create a new ssimfile" +atfdb.comptest comptest:acr_ed.CreateSsimfileBadNs timeout:10 memcheck:Y coverage:Y exit_code:1 ncore:1 repeat:1 comment:"Create a ssimfile for a non-existence namespace" +atfdb.comptest comptest:acr_ed.CreateTarget timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Script to create a new target" +atfdb.comptest comptest:acr_in.Reverse timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_in.Simple timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:acr_in.Tree timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:aqlite.CompileOptions timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:aqlite.Constraints timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:aqlite.ErrorHandling timeout:10 memcheck:Y coverage:Y exit_code:1 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:aqlite.Joins timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:aqlite.Number timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:aqlite.PatternMatching timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:aqlite.Performance timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:aqlite.Smoke timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:atf_cmdline.Bare timeout:10 memcheck:Y coverage:Y exit_code:1 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:atf_cmdline.Debug timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:atf_cmdline.Help timeout:10 memcheck:Y coverage:Y exit_code:1 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:atf_cmdline.Minimal timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:atf_cmdline.MinimalExec timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:atf_cmdline.Rich timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:atf_cmdline.RichExec timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:atf_cmdline.Sig timeout:10 memcheck:Y coverage:Y exit_code:1 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:atf_cmdline.Verbose timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:atf_cmdline.Version timeout:10 memcheck:Y coverage:Y exit_code:1 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:jkv.ArrayFill timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:jkv.ReverseSmoke timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:jkv.Smoke timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:mdbg.OutOfOrderArgs timeout:10 memcheck:Y coverage:Y exit_code:1 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:mdbg.Smoke timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:mdbg.SmokeBreak timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:mdbg.SmokeBreak2 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:samp_meng.Smoke timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:ssimfilt.Csv timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:ssimfilt.CsvField timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"CSV + field selection" +atfdb.comptest comptest:ssimfilt.FirstTag timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Lock typetag to first input tuple" +atfdb.comptest comptest:ssimfilt.Json timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Convert test data to json" +atfdb.comptest comptest:ssimfilt.JsonRecursive timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Print Recursive json object" +atfdb.comptest comptest:ssimfilt.MatchField timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Select fields by value" +atfdb.comptest comptest:ssimfilt.MatchTag timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Match typetag" +atfdb.comptest comptest:ssimfilt.SelectField timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Select several fields" +atfdb.comptest comptest:ssimfilt.Stable timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Filter unstable fields" +atfdb.comptest comptest:ssimfilt.Table timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"Tabular output" +atfdb.comptest comptest:sv2ssim.Convert1 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:sv2ssim.Convert1Signed timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:sv2ssim.Convert2 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:sv2ssim.Convert2Tsv timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:sv2ssim.UniqueFieldName timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" diff --git a/data/atfdb/targs.ssim b/data/atfdb/targs.ssim index c8282fe9..45913e62 100644 --- a/data/atfdb/targs.ssim +++ b/data/atfdb/targs.ssim @@ -4,6 +4,7 @@ atfdb.targs comptest:acr.BadPkey args:"-insert -check" atfdb.targs comptest:acr.BadReftype args:"-insert -check" atfdb.targs comptest:acr.CascDel args:"-in:- ns:ns1 -del" atfdb.targs comptest:acr.CascDel2 args:-insert +atfdb.targs comptest:acr.CascDel3 args:-replace atfdb.targs comptest:acr.DelField args:"field:dmmeta.Ns.license -del" atfdb.targs comptest:acr.DelRecord args:"-in:- target:samp -del" atfdb.targs comptest:acr.DeleteReinsert args:-insert @@ -161,12 +162,15 @@ atfdb.targs comptest:acr_dm.Conflict args:"test/acr_dm/file1.ssim test/acr_dm/ atfdb.targs comptest:acr_dm.Merge args:"test/acr_dm/file1.ssim test/acr_dm/file2.ssim test/acr_dm/file3.ssim" atfdb.targs comptest:acr_dm.RenameTuple args:"test/acr_dm/renametuple1.ssim test/acr_dm/renametuple2.ssim test/acr_dm/renametuple3.ssim" atfdb.targs comptest:acr_ed.CreateCtype args:"-create -ctype ams.ChildTypeMsg -subset ams.MsgHeader -msgtype:400 -reftype:Base" +atfdb.targs comptest:acr_ed.CreateMsg args:"-create -ctype ams.AbcMsg -subset ams.MsgHeader" atfdb.targs comptest:acr_ed.CreateSrcfileTarget args:"-create -srcfile:cpp/acr_ed/blah.cpp -target:algo_lib" +atfdb.targs comptest:acr_ed.CreateSsimfile args:"-create -ssimfile dmmeta.xyz" atfdb.targs comptest:acr_ed.CreateSsimfileBadNs args:"--create -ssimfile ams.test -subset algo.Smallstr10" +atfdb.targs comptest:acr_ed.CreateTarget args:"-create -target xyz" atfdb.targs comptest:acr_in.Reverse args:"-r dev.targdep" atfdb.targs comptest:acr_in.Simple args:acr_in atfdb.targs comptest:acr_in.Tree args:"acr_in -t" -atfdb.targs comptest:aqlite.CompileOptions args:'-in:- "PRAGMA compile_options;" | grep -v COMPILER' +atfdb.targs comptest:aqlite.CompileOptions args:'-in:- "PRAGMA compile_options;"' atfdb.targs comptest:aqlite.Constraints args:"-in:- \"select count(*) as or_test from field where ns = 'dmmeta' OR arg like 'algo.cstr%'; select count(*) as and_test from field where ns = 'dmmeta' AND reftype = 'Val'\"" atfdb.targs comptest:aqlite.ErrorHandling args:"-in:- \"select count(*) from field where nonexistent_field = 'test'\"" atfdb.targs comptest:aqlite.Joins args:"-in:- \"select count(*) as basic_join from field f join ctype c using (ctype) where f.ns = 'dmmeta'; select count(*) as self_join from field f1 join field f2 on f1.ctype = f2.ctype where f1.ns = 'dmmeta' and f1.field <> f2.field\"" @@ -184,6 +188,9 @@ atfdb.targs comptest:atf_cmdline.RichExec args:"-exec -verbose -verbose -verbo atfdb.targs comptest:atf_cmdline.Sig args:-sig atfdb.targs comptest:atf_cmdline.Verbose args:"-verbose -verbose blah -str blah" atfdb.targs comptest:atf_cmdline.Version args:-version +atfdb.targs comptest:jkv.ArrayFill args:"/dev/null -r -- a.b.c-0:true -10:false" +atfdb.targs comptest:jkv.ReverseSmoke args:"- -r" +atfdb.targs comptest:jkv.Smoke args:- atfdb.targs comptest:mdbg.OutOfOrderArgs args:"-args:x y" atfdb.targs comptest:mdbg.Smoke args:"-dry_run mdbg mdbg" atfdb.targs comptest:mdbg.SmokeBreak args:"-dry_run -tui mdbg mdbg -b a,b,c,d,e" diff --git a/data/atfdb/tfilt.ssim b/data/atfdb/tfilt.ssim index 96632904..68039485 100644 --- a/data/atfdb/tfilt.ssim +++ b/data/atfdb/tfilt.ssim @@ -19,6 +19,7 @@ atfdb.tfilt comptest:acr_compl.OptRegxColon filter:cat comment:"" atfdb.tfilt comptest:acr_compl.OptRegxColonList filter:cat comment:"" atfdb.tfilt comptest:acr_compl.OptRegxSpace filter:cat comment:"" atfdb.tfilt comptest:acr_compl.OptRegxSpaceList filter:cat comment:"" +atfdb.tfilt comptest:aqlite.CompileOptions filter:"grep -v COMPILER" comment:"" atfdb.tfilt comptest:aqlite.Smoke filter:"ssimfilt -t" comment:"" atfdb.tfilt comptest:atf_cmdline.Sig filter:"sed -E -f test/filt.sed" comment:"" atfdb.tfilt comptest:samp_meng.Smoke filter:"ssimfilt -format stablefld" comment:"" diff --git a/data/atfdb/tmsg.ssim b/data/atfdb/tmsg.ssim index c389e251..e245e47f 100644 --- a/data/atfdb/tmsg.ssim +++ b/data/atfdb/tmsg.ssim @@ -10,6 +10,7 @@ atfdb.tmsg tmsg:acr.CascDel2/100000.in istuple:N msg:'dmmeta.ns ns:ns1 atfdb.tmsg tmsg:acr.CascDel2/100010.in istuple:N msg:'dmmeta.ctype ctype:ns1.c comment:"Will be deleted as well"' atfdb.tmsg tmsg:acr.CascDel2/100020.in istuple:N msg:'dmmeta.field field:ns1.c.d arg:i32 reftype:Val comment:"Will be deleted as well"' atfdb.tmsg tmsg:acr.CascDel2/100030.in istuple:N msg:"acr.delete dmmeta.ns ns:ns1" +atfdb.tmsg tmsg:acr.CascDel3/100000.in istuple:N msg:"acr.delete dmmeta.field field:acr.FBltin.base" atfdb.tmsg tmsg:acr.DelRecord/100000.in istuple:N msg:'dmmeta.ns ns:samp nstype:exe license:GPL comment:""' atfdb.tmsg tmsg:acr.DelRecord/100010.in istuple:N msg:"dev.target target:samp license:GPL compat:%-%g%.%-%" atfdb.tmsg tmsg:acr.DelRecord/100020.in istuple:N msg:'dev.targdep targdep:samp.algo_lib comment:""' @@ -121,6 +122,16 @@ atfdb.tmsg tmsg:aqlite.Smoke/100010.in istuple:N msg:'dmmeta.ctype ctype:i32 atfdb.tmsg tmsg:aqlite.Smoke/100020.in istuple:N msg:'dmmeta.field field:abt.FArch.msghdr arg:dev.Arch reftype:Base dflt:"" comment:""' atfdb.tmsg tmsg:aqlite.Smoke/100030.in istuple:N msg:'dmmeta.field field:abt.FCfg.msghdr arg:dev.Cfg reftype:Base dflt:"" comment:""' atfdb.tmsg tmsg:aqlite.Smoke/100040.in istuple:N msg:'dmmeta.field field:abt.FCompiler.msghdr arg:dev.Compiler reftype:Base dflt:"" comment:""' +atfdb.tmsg tmsg:jkv.ReverseSmoke/100000.in istuple:N msg:A.B::C +atfdb.tmsg tmsg:jkv.ReverseSmoke/100010.in istuple:N msg:A.D:true +atfdb.tmsg tmsg:jkv.ReverseSmoke/100020.in istuple:N msg:A.E:false +atfdb.tmsg tmsg:jkv.ReverseSmoke/100030.in istuple:N msg:A.F:null +atfdb.tmsg tmsg:jkv.ReverseSmoke/100040.in istuple:N msg:A.G-0:0.1 +atfdb.tmsg tmsg:jkv.ReverseSmoke/100050.in istuple:N msg:A.G-1:0.2 +atfdb.tmsg tmsg:jkv.ReverseSmoke/100060.in istuple:N msg:A.G-2:0.3 +atfdb.tmsg tmsg:jkv.ReverseSmoke/100070.in istuple:N msg:"A.H:{}" +atfdb.tmsg tmsg:jkv.ReverseSmoke/100080.in istuple:N msg:A.I:0.33 +atfdb.tmsg tmsg:jkv.Smoke/100000.in istuple:N msg:'{ "A": { "B": "C", "D": true, "E": false, "F": null, "G": [0.1, 0.2, 0.3], "H": {}, "I": 0.33 } }' atfdb.tmsg tmsg:samp_meng.Smoke/100000.in istuple:N msg:'samp_meng.TextMsg text:"configure"' atfdb.tmsg tmsg:samp_meng.Smoke/100010.in istuple:N msg:"samp_meng.NewSymbolReqMsg symbol:A" atfdb.tmsg tmsg:samp_meng.Smoke/100020.in istuple:N msg:"samp_meng.NewSymbolReqMsg symbol:B" diff --git a/data/atfdb/unittest.ssim b/data/atfdb/unittest.ssim index f67bee52..9e38bb32 100644 --- a/data/atfdb/unittest.ssim +++ b/data/atfdb/unittest.ssim @@ -39,6 +39,7 @@ atfdb.unittest unittest:algo_lib.DirBeg comment:"Test Dir_curs" atfdb.unittest unittest:algo_lib.DoTestRounding comment:"" atfdb.unittest unittest:algo_lib.ExitCode comment:"" atfdb.unittest unittest:algo_lib.FTruncate comment:"" +atfdb.unittest unittest:algo_lib.FileAppend comment:"" atfdb.unittest unittest:algo_lib.FileLine_curs comment:"" atfdb.unittest unittest:algo_lib.FileQ comment:"" atfdb.unittest unittest:algo_lib.FileToString comment:"" @@ -80,15 +81,18 @@ atfdb.unittest unittest:algo_lib.PrintMemptr comment:"" atfdb.unittest unittest:algo_lib.PrintPad comment:"" atfdb.unittest unittest:algo_lib.PrintSsim comment:"" atfdb.unittest unittest:algo_lib.PrintUnTime comment:"" +atfdb.unittest unittest:algo_lib.PrintUuid comment:"" atfdb.unittest unittest:algo_lib.PrintWithCommas comment:"" atfdb.unittest unittest:algo_lib.ReadLine comment:"" atfdb.unittest unittest:algo_lib.ReadModuleId comment:"" +atfdb.unittest unittest:algo_lib.ReadUuid comment:"" atfdb.unittest unittest:algo_lib.Regx comment:"" atfdb.unittest unittest:algo_lib.RegxReadTwice comment:"" atfdb.unittest unittest:algo_lib.RegxReadTwice2 comment:"" atfdb.unittest unittest:algo_lib.RegxShortCircuit comment:"" atfdb.unittest unittest:algo_lib.RemDirRecurse comment:"Test RemDirRecurse functions" atfdb.unittest unittest:algo_lib.Replscope comment:"" +atfdb.unittest unittest:algo_lib.ReplscopeSharedPrefix comment:"" atfdb.unittest unittest:algo_lib.ReverseBits comment:"" atfdb.unittest unittest:algo_lib.SchedTime comment:"" atfdb.unittest unittest:algo_lib.Sleep comment:"" @@ -120,6 +124,8 @@ atfdb.unittest unittest:algo_lib.Tuple2 comment:"" atfdb.unittest unittest:algo_lib.Txttbl comment:"" atfdb.unittest unittest:algo_lib.U128PrintHex comment:"" atfdb.unittest unittest:algo_lib.UnescapeC comment:"" +atfdb.unittest unittest:algo_lib.Url comment:"" +atfdb.unittest unittest:algo_lib.Zigzag comment:"" atfdb.unittest unittest:algo_lib.flock comment:"" atfdb.unittest unittest:algo_lib.strptr_Eq comment:"" atfdb.unittest unittest:algo_lib.test_strptr comment:"" @@ -130,6 +136,10 @@ atfdb.unittest unittest:ams_sendtest comment:"" atfdb.unittest unittest:atf_unit.Outfile comment:"" atfdb.unittest unittest:fm comment:"" atfdb.unittest unittest:lib_ams.Test1 comment:WIP +atfdb.unittest unittest:lib_curl.GET_Echo comment:"GET /echo" +atfdb.unittest unittest:lib_curl.POST_JSON comment:"POST /echo with JSON + header" +atfdb.unittest unittest:lib_curl.PUT_PLAINTEXT comment:"PUT /echo with plain text" +atfdb.unittest unittest:lib_curl.STATUS_200 comment:"GET status 200" atfdb.unittest unittest:lib_exec.Dependency comment:"" atfdb.unittest unittest:lib_exec.Parallel1 comment:"" atfdb.unittest unittest:lib_exec.Timeout comment:"" @@ -240,4 +250,5 @@ atfdb.unittest unittest:lib_json.TokenFalse comment:"Single false token" atfdb.unittest unittest:lib_json.TokenNull comment:"Single null token" atfdb.unittest unittest:lib_json.TokenTrue comment:"Single true token" atfdb.unittest unittest:lib_json.Typical comment:"Normal case similar to typical usage" +atfdb.unittest unittest:lib_netio_GetHostAddr comment:"resolve hostname to ips" atfdb.unittest unittest:lib_sql.Main comment:"" diff --git a/data/atfdb/var.ssim b/data/atfdb/var.ssim new file mode 100644 index 00000000..e69de29b diff --git a/data/dev/badline.ssim b/data/dev/badline.ssim index 3ecd9cad..035fdd9c 100644 --- a/data/dev/badline.ssim +++ b/data/dev/badline.ssim @@ -5,6 +5,7 @@ dev.badline badline:bool_byval expr:".*const bool ?&.*" targsrc_regx:% comme dev.badline badline:double_byval expr:".*const double ?&.*" targsrc_regx:% comment:"built-in type by reference" dev.badline badline:float_byval expr:".*const float ?&.*" targsrc_regx:% comment:"built-in type by reference" dev.badline badline:hanging_else expr:"\\s+else.*" targsrc_regx:% comment:"Hanging else" +dev.badline badline:hanging_if expr:"\\s+} if.*" targsrc_regx:% comment:"Hanging if" dev.badline badline:i32_byval expr:".*const (i|u)(8|16|32|64) ?&.*" targsrc_regx:% comment:"built-in type by reference" dev.badline badline:include_dots expr:"#include .*\\.\\./.*" targsrc_regx:% comment:"../ in #includes are not allowed" dev.badline badline:int_byval expr:".*const int ?&.*" targsrc_regx:% comment:"built-in type by reference" diff --git a/data/dev/gitfile.ssim b/data/dev/gitfile.ssim index da7b207e..ee1824eb 100644 --- a/data/dev/gitfile.ssim +++ b/data/dev/gitfile.ssim @@ -4,6 +4,10 @@ dev.gitfile gitfile:.github/actions/setup-deps/action.yml dev.gitfile gitfile:.github/workflows/main.yml dev.gitfile gitfile:.gitignore dev.gitfile gitfile:.gitlab-ci.yml +dev.gitfile gitfile:.vscode/c_cpp_properties.json +dev.gitfile gitfile:.vscode/launch.json +dev.gitfile gitfile:.vscode/settings.json +dev.gitfile gitfile:.vscode/tasks.json dev.gitfile gitfile:LICENSE dev.gitfile gitfile:Makefile dev.gitfile gitfile:README.md @@ -21,7 +25,6 @@ dev.gitfile gitfile:bin/alexei-setup-soft-links dev.gitfile gitfile:bin/amc dev.gitfile gitfile:bin/amc_gc dev.gitfile gitfile:bin/amc_vis -dev.gitfile gitfile:bin/ams_cat dev.gitfile gitfile:bin/ams_sendtest dev.gitfile gitfile:bin/apm dev.gitfile gitfile:bin/aqlite @@ -30,17 +33,21 @@ dev.gitfile gitfile:bin/atf_ci dev.gitfile gitfile:bin/atf_cmdline dev.gitfile gitfile:bin/atf_comp dev.gitfile gitfile:bin/atf_cov +dev.gitfile gitfile:bin/atf_exp dev.gitfile gitfile:bin/atf_fuzz dev.gitfile gitfile:bin/atf_gcli dev.gitfile gitfile:bin/atf_nrun dev.gitfile gitfile:bin/atf_unit +dev.gitfile gitfile:bin/bash-indent dev.gitfile gitfile:bin/bash2html dev.gitfile gitfile:bin/bootstrap/Darwin-clang++.release-x86_64 dev.gitfile gitfile:bin/bootstrap/FreeBSD-clang++.release-amd64 dev.gitfile gitfile:bin/bootstrap/Linux-clang++.release-x86_64 dev.gitfile gitfile:bin/bootstrap/Linux-g++.release-x86_64 dev.gitfile gitfile:bin/break-long-lines +dev.gitfile gitfile:bin/check-json.mjs dev.gitfile gitfile:bin/ci-show-log +dev.gitfile gitfile:bin/core-decode dev.gitfile gitfile:bin/cpp-indent dev.gitfile gitfile:bin/delete-duplicate-lines dev.gitfile gitfile:bin/diff-to-errlist @@ -48,12 +55,15 @@ dev.gitfile gitfile:bin/edit-conflicts dev.gitfile gitfile:bin/em dev.gitfile gitfile:bin/errlist dev.gitfile gitfile:bin/ff +dev.gitfile gitfile:bin/filt-gc dev.gitfile gitfile:bin/find-non-copyrighted dev.gitfile gitfile:bin/fix-gen-conflicts dev.gitfile gitfile:bin/gcache dev.gitfile gitfile:bin/gcli +dev.gitfile gitfile:bin/gdb_pretty_print.py dev.gitfile gitfile:bin/git-add-to-last-commit dev.gitfile gitfile:bin/git-branch-gc +dev.gitfile gitfile:bin/git-checkout-master dev.gitfile gitfile:bin/git-clean-branches dev.gitfile gitfile:bin/git-commits-per-user dev.gitfile gitfile:bin/git-conflicts @@ -74,6 +84,7 @@ dev.gitfile gitfile:bin/grephunk dev.gitfile gitfile:bin/hilite dev.gitfile gitfile:bin/hilite-error dev.gitfile gitfile:bin/indent-recent +dev.gitfile gitfile:bin/jkv dev.gitfile gitfile:bin/limit-output dev.gitfile gitfile:bin/lines-to-dots dev.gitfile gitfile:bin/lsfunc @@ -82,13 +93,18 @@ dev.gitfile gitfile:bin/msloc.pl dev.gitfile gitfile:bin/mysql2ssim dev.gitfile gitfile:bin/nogen dev.gitfile gitfile:bin/normalize +dev.gitfile gitfile:bin/normalize_loop +dev.gitfile gitfile:bin/open-link dev.gitfile gitfile:bin/orgfile +dev.gitfile gitfile:bin/revert-executable +dev.gitfile gitfile:bin/samp_make dev.gitfile gitfile:bin/samp_meng dev.gitfile gitfile:bin/samp_regx dev.gitfile gitfile:bin/sandbox dev.gitfile gitfile:bin/select-bootstrap dev.gitfile gitfile:bin/sha1 dev.gitfile gitfile:bin/sloc.pl +dev.gitfile gitfile:bin/sortwrap dev.gitfile gitfile:bin/sources-of dev.gitfile gitfile:bin/src_func dev.gitfile gitfile:bin/src_hdr @@ -96,6 +112,7 @@ dev.gitfile gitfile:bin/src_lim dev.gitfile gitfile:bin/ssim2csv dev.gitfile gitfile:bin/ssim2mysql dev.gitfile gitfile:bin/ssimfilt +dev.gitfile gitfile:bin/stepper dev.gitfile gitfile:bin/strconv dev.gitfile gitfile:bin/sv2ssim dev.gitfile gitfile:bin/tags @@ -108,6 +125,7 @@ dev.gitfile gitfile:bin/update-gitfile dev.gitfile gitfile:bin/update-hdr dev.gitfile gitfile:bin/update-linelim dev.gitfile gitfile:bin/update-scriptfile +dev.gitfile gitfile:bin/vscode-select-debug-target dev.gitfile gitfile:bin/zfs_snapshot.pl dev.gitfile gitfile:build/.ffskip dev.gitfile gitfile:conf/.license.txt @@ -119,6 +137,7 @@ dev.gitfile gitfile:conf/copyright.txt dev.gitfile gitfile:conf/elisp/Emacs dev.gitfile gitfile:conf/elisp/markdown-mode.el dev.gitfile gitfile:conf/emacs.el +dev.gitfile gitfile:conf/gdb.py dev.gitfile gitfile:conf/license.txt dev.gitfile gitfile:conf/samp_tut1.txt dev.gitfile gitfile:conf/samp_tut3.txt @@ -181,7 +200,10 @@ dev.gitfile gitfile:cpp/amc/delptr.cpp dev.gitfile gitfile:cpp/amc/dflt.cpp dev.gitfile gitfile:cpp/amc/disp/call.cpp dev.gitfile gitfile:cpp/amc/disp/casetype.cpp +dev.gitfile gitfile:cpp/amc/disp/del.cpp dev.gitfile gitfile:cpp/amc/disp/filter.cpp +dev.gitfile gitfile:cpp/amc/disp/kafka_decode.cpp +dev.gitfile gitfile:cpp/amc/disp/kafka_encode.cpp dev.gitfile gitfile:cpp/amc/disp/main.cpp dev.gitfile gitfile:cpp/amc/disp/msg.cpp dev.gitfile gitfile:cpp/amc/disp/print.cpp @@ -204,6 +226,8 @@ dev.gitfile gitfile:cpp/amc/hook.cpp dev.gitfile gitfile:cpp/amc/include.cpp dev.gitfile gitfile:cpp/amc/inlary.cpp dev.gitfile gitfile:cpp/amc/io.cpp +dev.gitfile gitfile:cpp/amc/js.cpp +dev.gitfile gitfile:cpp/amc/kafka.cpp dev.gitfile gitfile:cpp/amc/lary.cpp dev.gitfile gitfile:cpp/amc/llist.cpp dev.gitfile gitfile:cpp/amc/lpool.cpp @@ -241,7 +265,6 @@ dev.gitfile gitfile:cpp/amc/trace.cpp dev.gitfile gitfile:cpp/amc/upptr.cpp dev.gitfile gitfile:cpp/amc/val.cpp dev.gitfile gitfile:cpp/amc/varlen.cpp -dev.gitfile gitfile:cpp/ams/ams_cat.cpp dev.gitfile gitfile:cpp/ams_sendtest.cpp dev.gitfile gitfile:cpp/apm/annotate.cpp dev.gitfile gitfile:cpp/apm/check.cpp @@ -255,7 +278,6 @@ dev.gitfile gitfile:cpp/apm/reset.cpp dev.gitfile gitfile:cpp/apm/show.cpp dev.gitfile gitfile:cpp/apm/update.cpp dev.gitfile gitfile:cpp/aqlite/aqlite.cpp -dev.gitfile gitfile:cpp/atf/atf_gcli.cpp dev.gitfile gitfile:cpp/atf_amc/atree.cpp dev.gitfile gitfile:cpp/atf_amc/bheap.cpp dev.gitfile gitfile:cpp/atf_amc/bigend.cpp @@ -292,6 +314,7 @@ dev.gitfile gitfile:cpp/atf_amc/thash.cpp dev.gitfile gitfile:cpp/atf_amc/varlen.cpp dev.gitfile gitfile:cpp/atf_amc/zdlist.cpp dev.gitfile gitfile:cpp/atf_amc/zslist.cpp +dev.gitfile gitfile:cpp/atf_ci/abt_md.cpp dev.gitfile gitfile:cpp/atf_ci/acr_ed.cpp dev.gitfile gitfile:cpp/atf_ci/apm.cpp dev.gitfile gitfile:cpp/atf_ci/bootstrap.cpp @@ -304,7 +327,9 @@ dev.gitfile gitfile:cpp/atf_comp/edit.cpp dev.gitfile gitfile:cpp/atf_comp/main.cpp dev.gitfile gitfile:cpp/atf_comp/read.cpp dev.gitfile gitfile:cpp/atf_cov/atf_cov.cpp +dev.gitfile gitfile:cpp/atf_exp/atf_exp.cpp dev.gitfile gitfile:cpp/atf_fuzz/atf_fuzz.cpp +dev.gitfile gitfile:cpp/atf_gcli/atf_gcli.cpp dev.gitfile gitfile:cpp/atf_nrun/atf_nrun.cpp dev.gitfile gitfile:cpp/atf_unit/acr.cpp dev.gitfile gitfile:cpp/atf_unit/algo_fmt.cpp @@ -316,8 +341,10 @@ dev.gitfile gitfile:cpp/atf_unit/charset.cpp dev.gitfile gitfile:cpp/atf_unit/decimal.cpp dev.gitfile gitfile:cpp/atf_unit/fm.cpp dev.gitfile gitfile:cpp/atf_unit/lib_ams.cpp +dev.gitfile gitfile:cpp/atf_unit/lib_curl.cpp dev.gitfile gitfile:cpp/atf_unit/lib_exec.cpp dev.gitfile gitfile:cpp/atf_unit/lib_json.cpp +dev.gitfile gitfile:cpp/atf_unit/lib_netio.cpp dev.gitfile gitfile:cpp/atf_unit/lib_sql.cpp dev.gitfile gitfile:cpp/atf_unit/line.cpp dev.gitfile gitfile:cpp/atf_unit/lockfile.cpp @@ -356,7 +383,6 @@ dev.gitfile gitfile:cpp/gen/amc_gc_gen.cpp dev.gitfile gitfile:cpp/gen/amc_gen.cpp dev.gitfile gitfile:cpp/gen/amc_vis_gen.cpp dev.gitfile gitfile:cpp/gen/amcdb_gen.cpp -dev.gitfile gitfile:cpp/gen/ams_cat_gen.cpp dev.gitfile gitfile:cpp/gen/ams_gen.cpp dev.gitfile gitfile:cpp/gen/ams_sendtest_gen.cpp dev.gitfile gitfile:cpp/gen/amsdb_gen.cpp @@ -367,6 +393,7 @@ dev.gitfile gitfile:cpp/gen/atf_ci_gen.cpp dev.gitfile gitfile:cpp/gen/atf_cmdline_gen.cpp dev.gitfile gitfile:cpp/gen/atf_comp_gen.cpp dev.gitfile gitfile:cpp/gen/atf_cov_gen.cpp +dev.gitfile gitfile:cpp/gen/atf_exp_gen.cpp dev.gitfile gitfile:cpp/gen/atf_fuzz_gen.cpp dev.gitfile gitfile:cpp/gen/atf_gcli_gen.cpp dev.gitfile gitfile:cpp/gen/atf_gen.cpp @@ -382,25 +409,36 @@ dev.gitfile gitfile:cpp/gen/fmdb_gen.cpp dev.gitfile gitfile:cpp/gen/gcache_gen.cpp dev.gitfile gitfile:cpp/gen/gcli_gen.cpp dev.gitfile gitfile:cpp/gen/gclidb_gen.cpp +dev.gitfile gitfile:cpp/gen/http_gen.cpp +dev.gitfile gitfile:cpp/gen/httpdb_gen.cpp dev.gitfile gitfile:cpp/gen/ietf_gen.cpp +dev.gitfile gitfile:cpp/gen/jkv_gen.cpp +dev.gitfile gitfile:cpp/gen/kafka_gen.cpp dev.gitfile gitfile:cpp/gen/lib_amcdb_gen.cpp dev.gitfile gitfile:cpp/gen/lib_ams_gen.cpp dev.gitfile gitfile:cpp/gen/lib_ctype_gen.cpp +dev.gitfile gitfile:cpp/gen/lib_curl_gen.cpp dev.gitfile gitfile:cpp/gen/lib_exec_gen.cpp dev.gitfile gitfile:cpp/gen/lib_fm_gen.cpp dev.gitfile gitfile:cpp/gen/lib_git_gen.cpp +dev.gitfile gitfile:cpp/gen/lib_http_gen.cpp dev.gitfile gitfile:cpp/gen/lib_iconv_gen.cpp dev.gitfile gitfile:cpp/gen/lib_json_gen.cpp dev.gitfile gitfile:cpp/gen/lib_mysql_gen.cpp +dev.gitfile gitfile:cpp/gen/lib_netio_gen.cpp dev.gitfile gitfile:cpp/gen/lib_prot_gen.cpp +dev.gitfile gitfile:cpp/gen/lib_rl_gen.cpp dev.gitfile gitfile:cpp/gen/lib_sql_gen.cpp dev.gitfile gitfile:cpp/gen/lib_sqlite_gen.cpp +dev.gitfile gitfile:cpp/gen/lib_ws_gen.cpp dev.gitfile gitfile:cpp/gen/mdbg_gen.cpp dev.gitfile gitfile:cpp/gen/mysql2ssim_gen.cpp dev.gitfile gitfile:cpp/gen/orgfile_gen.cpp dev.gitfile gitfile:cpp/gen/report_gen.cpp +dev.gitfile gitfile:cpp/gen/samp_make_gen.cpp dev.gitfile gitfile:cpp/gen/samp_meng_gen.cpp dev.gitfile gitfile:cpp/gen/samp_regx_gen.cpp +dev.gitfile gitfile:cpp/gen/sampdb_gen.cpp dev.gitfile gitfile:cpp/gen/sandbox_gen.cpp dev.gitfile gitfile:cpp/gen/src_func_gen.cpp dev.gitfile gitfile:cpp/gen/src_hdr_gen.cpp @@ -410,9 +448,14 @@ dev.gitfile gitfile:cpp/gen/ssim2mysql_gen.cpp dev.gitfile gitfile:cpp/gen/ssimfilt_gen.cpp dev.gitfile gitfile:cpp/gen/strconv_gen.cpp dev.gitfile gitfile:cpp/gen/sv2ssim_gen.cpp +dev.gitfile gitfile:cpp/gen/ws_gen.cpp +dev.gitfile gitfile:cpp/gen/wsdb_gen.cpp +dev.gitfile gitfile:cpp/jkv/jkv.cpp dev.gitfile gitfile:cpp/lib/algo/arg.cpp dev.gitfile gitfile:cpp/lib/algo/backtrace.cpp dev.gitfile gitfile:cpp/lib/algo/base64.cpp +dev.gitfile gitfile:cpp/lib/algo/bin_decode.cpp +dev.gitfile gitfile:cpp/lib/algo/bin_encode.cpp dev.gitfile gitfile:cpp/lib/algo/cpu_hz.cpp dev.gitfile gitfile:cpp/lib/algo/crc32.cpp dev.gitfile gitfile:cpp/lib/algo/decimal.cpp @@ -426,14 +469,18 @@ dev.gitfile gitfile:cpp/lib/algo/lockfile.cpp dev.gitfile gitfile:cpp/lib/algo/mmap.cpp dev.gitfile gitfile:cpp/lib/algo/prlog.cpp dev.gitfile gitfile:cpp/lib/algo/regx.cpp +dev.gitfile gitfile:cpp/lib/algo/replscope.cpp dev.gitfile gitfile:cpp/lib/algo/string.cpp dev.gitfile gitfile:cpp/lib/algo/time.cpp dev.gitfile gitfile:cpp/lib/algo/timehook.cpp dev.gitfile gitfile:cpp/lib/algo/tstamp.cpp dev.gitfile gitfile:cpp/lib/algo/txttbl.cpp dev.gitfile gitfile:cpp/lib/algo/u128.cpp +dev.gitfile gitfile:cpp/lib/algo/url.cpp +dev.gitfile gitfile:cpp/lib/algo/uuid.cpp dev.gitfile gitfile:cpp/lib/algo/win32.cpp dev.gitfile gitfile:cpp/lib/lib_ctype.cpp +dev.gitfile gitfile:cpp/lib/lib_curl.cpp dev.gitfile gitfile:cpp/lib/lib_exec.cpp dev.gitfile gitfile:cpp/lib/lib_fm.cpp dev.gitfile gitfile:cpp/lib/lib_git.cpp @@ -442,14 +489,20 @@ dev.gitfile gitfile:cpp/lib/lib_json.cpp dev.gitfile gitfile:cpp/lib/lib_mysql.cpp dev.gitfile gitfile:cpp/lib/lib_sql.cpp dev.gitfile gitfile:cpp/lib_amcdb/lib_amcdb.cpp -dev.gitfile gitfile:cpp/lib_ams/expect.cpp +dev.gitfile gitfile:cpp/lib_ams/dump.cpp dev.gitfile gitfile:cpp/lib_ams/file.cpp -dev.gitfile gitfile:cpp/lib_ams/stream.cpp +dev.gitfile gitfile:cpp/lib_ams/shm.cpp +dev.gitfile gitfile:cpp/lib_ams/shmember.cpp +dev.gitfile gitfile:cpp/lib_http/lib_http.cpp +dev.gitfile gitfile:cpp/lib_netio/socket.cpp +dev.gitfile gitfile:cpp/lib_rl/lib_rl.cpp dev.gitfile gitfile:cpp/lib_sqlite/lib_sqlite.cpp dev.gitfile gitfile:cpp/lib_sqlite/vtab.cpp +dev.gitfile gitfile:cpp/lib_ws/lib_ws.cpp dev.gitfile gitfile:cpp/mdbg/mdbg.cpp dev.gitfile gitfile:cpp/mysql2ssim.cpp dev.gitfile gitfile:cpp/orgfile.cpp +dev.gitfile gitfile:cpp/samp_make/samp_make.cpp dev.gitfile gitfile:cpp/samp_meng/samp_meng.cpp dev.gitfile gitfile:cpp/samp_regx/samp_regx.cpp dev.gitfile gitfile:cpp/sandbox.cpp @@ -476,7 +529,7 @@ dev.gitfile gitfile:data/amcdb/tclass.ssim dev.gitfile gitfile:data/amcdb/tcurs.ssim dev.gitfile gitfile:data/amcdb/tfunc.ssim dev.gitfile gitfile:data/amsdb/proctype.ssim -dev.gitfile gitfile:data/amsdb/streamtype.ssim +dev.gitfile gitfile:data/amsdb/shmtype.ssim dev.gitfile gitfile:data/atfdb/amctest.ssim dev.gitfile gitfile:data/atfdb/cijob.ssim dev.gitfile gitfile:data/atfdb/cipackage.ssim @@ -491,6 +544,7 @@ dev.gitfile gitfile:data/atfdb/test_gsymbol_strptr.ssim dev.gitfile gitfile:data/atfdb/tfilt.ssim dev.gitfile gitfile:data/atfdb/tmsg.ssim dev.gitfile gitfile:data/atfdb/unittest.ssim +dev.gitfile gitfile:data/atfdb/var.ssim dev.gitfile gitfile:data/dev/arch.ssim dev.gitfile gitfile:data/dev/badline.ssim dev.gitfile gitfile:data/dev/builddir.ssim @@ -512,13 +566,16 @@ dev.gitfile gitfile:data/dev/linelim.ssim dev.gitfile gitfile:data/dev/mdmark.ssim dev.gitfile gitfile:data/dev/mdsection.ssim dev.gitfile gitfile:data/dev/msgfile.ssim +dev.gitfile gitfile:data/dev/netproto.ssim dev.gitfile gitfile:data/dev/noindent.ssim dev.gitfile gitfile:data/dev/opt_type.ssim dev.gitfile gitfile:data/dev/package.ssim dev.gitfile gitfile:data/dev/pkgdep.ssim dev.gitfile gitfile:data/dev/pkgkey.ssim -dev.gitfile gitfile:data/dev/readme.ssim +dev.gitfile gitfile:data/dev/prototransport.ssim +dev.gitfile gitfile:data/dev/readmefile.ssim dev.gitfile gitfile:data/dev/readmesort.ssim +dev.gitfile gitfile:data/dev/rpm.ssim dev.gitfile gitfile:data/dev/sandbox.ssim dev.gitfile gitfile:data/dev/sbpath.ssim dev.gitfile gitfile:data/dev/scriptfile.ssim @@ -533,6 +590,7 @@ dev.gitfile gitfile:data/dev/targsyslib.ssim dev.gitfile gitfile:data/dev/tgtcov.ssim dev.gitfile gitfile:data/dev/timefmt.ssim dev.gitfile gitfile:data/dev/tool_opt.ssim +dev.gitfile gitfile:data/dev/transport.ssim dev.gitfile gitfile:data/dev/uname.ssim dev.gitfile gitfile:data/dev/unstablefld.ssim dev.gitfile gitfile:data/dmmeta/anonfld.ssim @@ -549,6 +607,7 @@ dev.gitfile gitfile:data/dmmeta/cfmt.ssim dev.gitfile gitfile:data/dmmeta/cget.ssim dev.gitfile gitfile:data/dmmeta/charset.ssim dev.gitfile gitfile:data/dmmeta/chash.ssim +dev.gitfile gitfile:data/dmmeta/ckafka.ssim dev.gitfile gitfile:data/dmmeta/cppfunc.ssim dev.gitfile gitfile:data/dmmeta/cppkeyword.ssim dev.gitfile gitfile:data/dmmeta/cpptype.ssim @@ -572,6 +631,7 @@ dev.gitfile gitfile:data/dmmeta/fbigend.ssim dev.gitfile gitfile:data/dmmeta/fbitset.ssim dev.gitfile gitfile:data/dmmeta/fbuf.ssim dev.gitfile gitfile:data/dmmeta/fbufdir.ssim +dev.gitfile gitfile:data/dmmeta/fbufiotype.ssim dev.gitfile gitfile:data/dmmeta/fbuftype.ssim dev.gitfile gitfile:data/dmmeta/fcast.ssim dev.gitfile gitfile:data/dmmeta/fcleanup.ssim @@ -588,6 +648,7 @@ dev.gitfile gitfile:data/dmmeta/fflag.ssim dev.gitfile gitfile:data/dmmeta/field.ssim dev.gitfile gitfile:data/dmmeta/findrem.ssim dev.gitfile gitfile:data/dmmeta/finput.ssim +dev.gitfile gitfile:data/dmmeta/fkafka.ssim dev.gitfile gitfile:data/dmmeta/fldoffset.ssim dev.gitfile gitfile:data/dmmeta/floadtuples.ssim dev.gitfile gitfile:data/dmmeta/fnoremove.ssim @@ -608,6 +669,8 @@ dev.gitfile gitfile:data/dmmeta/gsymbol.ssim dev.gitfile gitfile:data/dmmeta/hashtype.ssim dev.gitfile gitfile:data/dmmeta/hook.ssim dev.gitfile gitfile:data/dmmeta/inlary.ssim +dev.gitfile gitfile:data/dmmeta/jstype.ssim +dev.gitfile gitfile:data/dmmeta/kafka_type_kind.ssim dev.gitfile gitfile:data/dmmeta/lenfld.ssim dev.gitfile gitfile:data/dmmeta/listtype.ssim dev.gitfile gitfile:data/dmmeta/llist.ssim @@ -622,6 +685,7 @@ dev.gitfile gitfile:data/dmmeta/nscpp.ssim dev.gitfile gitfile:data/dmmeta/nsdb.ssim dev.gitfile gitfile:data/dmmeta/nsfast.ssim dev.gitfile gitfile:data/dmmeta/nsinclude.ssim +dev.gitfile gitfile:data/dmmeta/nsjs.ssim dev.gitfile gitfile:data/dmmeta/nsproto.ssim dev.gitfile gitfile:data/dmmeta/nstype.ssim dev.gitfile gitfile:data/dmmeta/nsversion.ssim @@ -654,6 +718,7 @@ dev.gitfile gitfile:data/dmmeta/thash.ssim dev.gitfile gitfile:data/dmmeta/tracefld.ssim dev.gitfile gitfile:data/dmmeta/tracerec.ssim dev.gitfile gitfile:data/dmmeta/typefld.ssim +dev.gitfile gitfile:data/dmmeta/userfunc.ssim dev.gitfile gitfile:data/dmmeta/usertracefld.ssim dev.gitfile gitfile:data/dmmeta/xref.ssim dev.gitfile gitfile:data/fmdb/alarm.ssim @@ -672,8 +737,6 @@ dev.gitfile gitfile:data/gclidb/gfld.ssim dev.gitfile gitfile:data/gclidb/githost.ssim dev.gitfile gitfile:data/gclidb/gmethod.ssim dev.gitfile gitfile:data/gclidb/grepo.ssim -dev.gitfile gitfile:data/gclidb/grepogitport.ssim -dev.gitfile gitfile:data/gclidb/grepossh.ssim dev.gitfile gitfile:data/gclidb/gstate.ssim dev.gitfile gitfile:data/gclidb/gstatet.ssim dev.gitfile gitfile:data/gclidb/gtbl.ssim @@ -694,8 +757,19 @@ dev.gitfile gitfile:data/gclidb/mrjob.ssim dev.gitfile gitfile:data/gclidb/mrnote.ssim dev.gitfile gitfile:data/gclidb/project.ssim dev.gitfile gitfile:data/gclidb/user.ssim +dev.gitfile gitfile:data/httpdb/content.ssim +dev.gitfile gitfile:data/httpdb/header.ssim +dev.gitfile gitfile:data/httpdb/method.ssim +dev.gitfile gitfile:data/httpdb/status.ssim +dev.gitfile gitfile:data/httpdb/version.ssim +dev.gitfile gitfile:data/sampdb/gitfile.ssim +dev.gitfile gitfile:data/sampdb/targdep.ssim +dev.gitfile gitfile:data/sampdb/target.ssim +dev.gitfile gitfile:data/sampdb/targrec.ssim +dev.gitfile gitfile:data/sampdb/targsrc.ssim +dev.gitfile gitfile:data/wsdb/status.ssim dev.gitfile gitfile:extern/.empty -dev.gitfile gitfile:extern/gclitest/id_rsa_gclisvc +dev.gitfile gitfile:extern/gnumake/Simple-Makefile dev.gitfile gitfile:extern/sqlite-3500400/shell.c dev.gitfile gitfile:extern/sqlite-3500400/sqlite3.c dev.gitfile gitfile:extern/sqlite-3500400/sqlite3.h @@ -710,7 +784,6 @@ dev.gitfile gitfile:include/acr_in.h dev.gitfile gitfile:include/algo.h dev.gitfile gitfile:include/algo.inl.h dev.gitfile gitfile:include/amc.h -dev.gitfile gitfile:include/ams_cat.h dev.gitfile gitfile:include/ams_sendtest.h dev.gitfile gitfile:include/apm.h dev.gitfile gitfile:include/aqlite.h @@ -719,6 +792,7 @@ dev.gitfile gitfile:include/atf_ci.h dev.gitfile gitfile:include/atf_cmdline.h dev.gitfile gitfile:include/atf_comp.h dev.gitfile gitfile:include/atf_cov.h +dev.gitfile gitfile:include/atf_exp.h dev.gitfile gitfile:include/atf_fuzz.h dev.gitfile gitfile:include/atf_gcli.h dev.gitfile gitfile:include/atf_nrun.h @@ -757,8 +831,6 @@ dev.gitfile gitfile:include/gen/amc_vis_gen.h dev.gitfile gitfile:include/gen/amc_vis_gen.inl.h dev.gitfile gitfile:include/gen/amcdb_gen.h dev.gitfile gitfile:include/gen/amcdb_gen.inl.h -dev.gitfile gitfile:include/gen/ams_cat_gen.h -dev.gitfile gitfile:include/gen/ams_cat_gen.inl.h dev.gitfile gitfile:include/gen/ams_gen.h dev.gitfile gitfile:include/gen/ams_gen.inl.h dev.gitfile gitfile:include/gen/ams_sendtest_gen.h @@ -779,6 +851,8 @@ dev.gitfile gitfile:include/gen/atf_comp_gen.h dev.gitfile gitfile:include/gen/atf_comp_gen.inl.h dev.gitfile gitfile:include/gen/atf_cov_gen.h dev.gitfile gitfile:include/gen/atf_cov_gen.inl.h +dev.gitfile gitfile:include/gen/atf_exp_gen.h +dev.gitfile gitfile:include/gen/atf_exp_gen.inl.h dev.gitfile gitfile:include/gen/atf_fuzz_gen.h dev.gitfile gitfile:include/gen/atf_fuzz_gen.inl.h dev.gitfile gitfile:include/gen/atf_gcli_gen.h @@ -809,32 +883,50 @@ dev.gitfile gitfile:include/gen/gcli_gen.h dev.gitfile gitfile:include/gen/gcli_gen.inl.h dev.gitfile gitfile:include/gen/gclidb_gen.h dev.gitfile gitfile:include/gen/gclidb_gen.inl.h +dev.gitfile gitfile:include/gen/http_gen.h +dev.gitfile gitfile:include/gen/http_gen.inl.h +dev.gitfile gitfile:include/gen/httpdb_gen.h +dev.gitfile gitfile:include/gen/httpdb_gen.inl.h dev.gitfile gitfile:include/gen/ietf_gen.h dev.gitfile gitfile:include/gen/ietf_gen.inl.h +dev.gitfile gitfile:include/gen/jkv_gen.h +dev.gitfile gitfile:include/gen/jkv_gen.inl.h +dev.gitfile gitfile:include/gen/kafka_gen.h +dev.gitfile gitfile:include/gen/kafka_gen.inl.h dev.gitfile gitfile:include/gen/lib_amcdb_gen.h dev.gitfile gitfile:include/gen/lib_amcdb_gen.inl.h dev.gitfile gitfile:include/gen/lib_ams_gen.h dev.gitfile gitfile:include/gen/lib_ams_gen.inl.h dev.gitfile gitfile:include/gen/lib_ctype_gen.h dev.gitfile gitfile:include/gen/lib_ctype_gen.inl.h +dev.gitfile gitfile:include/gen/lib_curl_gen.h +dev.gitfile gitfile:include/gen/lib_curl_gen.inl.h dev.gitfile gitfile:include/gen/lib_exec_gen.h dev.gitfile gitfile:include/gen/lib_exec_gen.inl.h dev.gitfile gitfile:include/gen/lib_fm_gen.h dev.gitfile gitfile:include/gen/lib_fm_gen.inl.h dev.gitfile gitfile:include/gen/lib_git_gen.h dev.gitfile gitfile:include/gen/lib_git_gen.inl.h +dev.gitfile gitfile:include/gen/lib_http_gen.h +dev.gitfile gitfile:include/gen/lib_http_gen.inl.h dev.gitfile gitfile:include/gen/lib_iconv_gen.h dev.gitfile gitfile:include/gen/lib_iconv_gen.inl.h dev.gitfile gitfile:include/gen/lib_json_gen.h dev.gitfile gitfile:include/gen/lib_json_gen.inl.h dev.gitfile gitfile:include/gen/lib_mysql_gen.h dev.gitfile gitfile:include/gen/lib_mysql_gen.inl.h +dev.gitfile gitfile:include/gen/lib_netio_gen.h +dev.gitfile gitfile:include/gen/lib_netio_gen.inl.h dev.gitfile gitfile:include/gen/lib_prot_gen.h dev.gitfile gitfile:include/gen/lib_prot_gen.inl.h +dev.gitfile gitfile:include/gen/lib_rl_gen.h +dev.gitfile gitfile:include/gen/lib_rl_gen.inl.h dev.gitfile gitfile:include/gen/lib_sql_gen.h dev.gitfile gitfile:include/gen/lib_sql_gen.inl.h dev.gitfile gitfile:include/gen/lib_sqlite_gen.h dev.gitfile gitfile:include/gen/lib_sqlite_gen.inl.h +dev.gitfile gitfile:include/gen/lib_ws_gen.h +dev.gitfile gitfile:include/gen/lib_ws_gen.inl.h dev.gitfile gitfile:include/gen/mdbg_gen.h dev.gitfile gitfile:include/gen/mdbg_gen.inl.h dev.gitfile gitfile:include/gen/mysql2ssim_gen.h @@ -843,10 +935,14 @@ dev.gitfile gitfile:include/gen/orgfile_gen.h dev.gitfile gitfile:include/gen/orgfile_gen.inl.h dev.gitfile gitfile:include/gen/report_gen.h dev.gitfile gitfile:include/gen/report_gen.inl.h +dev.gitfile gitfile:include/gen/samp_make_gen.h +dev.gitfile gitfile:include/gen/samp_make_gen.inl.h dev.gitfile gitfile:include/gen/samp_meng_gen.h dev.gitfile gitfile:include/gen/samp_meng_gen.inl.h dev.gitfile gitfile:include/gen/samp_regx_gen.h dev.gitfile gitfile:include/gen/samp_regx_gen.inl.h +dev.gitfile gitfile:include/gen/sampdb_gen.h +dev.gitfile gitfile:include/gen/sampdb_gen.inl.h dev.gitfile gitfile:include/gen/sandbox_gen.h dev.gitfile gitfile:include/gen/sandbox_gen.inl.h dev.gitfile gitfile:include/gen/src_func_gen.h @@ -865,19 +961,33 @@ dev.gitfile gitfile:include/gen/strconv_gen.h dev.gitfile gitfile:include/gen/strconv_gen.inl.h dev.gitfile gitfile:include/gen/sv2ssim_gen.h dev.gitfile gitfile:include/gen/sv2ssim_gen.inl.h +dev.gitfile gitfile:include/gen/ws_gen.h +dev.gitfile gitfile:include/gen/ws_gen.inl.h +dev.gitfile gitfile:include/gen/wsdb_gen.h +dev.gitfile gitfile:include/gen/wsdb_gen.inl.h +dev.gitfile gitfile:include/jkv.h dev.gitfile gitfile:include/lib_amcdb.h dev.gitfile gitfile:include/lib_ams.h +dev.gitfile gitfile:include/lib_ams.inl.h dev.gitfile gitfile:include/lib_ctype.h +dev.gitfile gitfile:include/lib_curl.h dev.gitfile gitfile:include/lib_exec.h dev.gitfile gitfile:include/lib_fm.h dev.gitfile gitfile:include/lib_git.h +dev.gitfile gitfile:include/lib_http.h dev.gitfile gitfile:include/lib_iconv.h dev.gitfile gitfile:include/lib_json.h dev.gitfile gitfile:include/lib_json.inl.h dev.gitfile gitfile:include/lib_mysql.h +dev.gitfile gitfile:include/lib_netio.h +dev.gitfile gitfile:include/lib_netio.inl.h +dev.gitfile gitfile:include/lib_rl.h dev.gitfile gitfile:include/lib_sql.h dev.gitfile gitfile:include/lib_sqlite.h +dev.gitfile gitfile:include/lib_ws.h +dev.gitfile gitfile:include/mdbg.h dev.gitfile gitfile:include/orgfile.h +dev.gitfile gitfile:include/samp_make.h dev.gitfile gitfile:include/samp_meng.h dev.gitfile gitfile:include/samp_regx.h dev.gitfile gitfile:include/sandbox.h @@ -909,6 +1019,7 @@ dev.gitfile gitfile:test/atf_comp/acr.BadPkey dev.gitfile gitfile:test/atf_comp/acr.BadReftype dev.gitfile gitfile:test/atf_comp/acr.CascDel dev.gitfile gitfile:test/atf_comp/acr.CascDel2 +dev.gitfile gitfile:test/atf_comp/acr.CascDel3 dev.gitfile gitfile:test/atf_comp/acr.DelField dev.gitfile gitfile:test/atf_comp/acr.DelRecord dev.gitfile gitfile:test/atf_comp/acr.DeleteReinsert @@ -1066,8 +1177,11 @@ dev.gitfile gitfile:test/atf_comp/acr_dm.Conflict dev.gitfile gitfile:test/atf_comp/acr_dm.Merge dev.gitfile gitfile:test/atf_comp/acr_dm.RenameTuple dev.gitfile gitfile:test/atf_comp/acr_ed.CreateCtype +dev.gitfile gitfile:test/atf_comp/acr_ed.CreateMsg dev.gitfile gitfile:test/atf_comp/acr_ed.CreateSrcfileTarget +dev.gitfile gitfile:test/atf_comp/acr_ed.CreateSsimfile dev.gitfile gitfile:test/atf_comp/acr_ed.CreateSsimfileBadNs +dev.gitfile gitfile:test/atf_comp/acr_ed.CreateTarget dev.gitfile gitfile:test/atf_comp/acr_in.Reverse dev.gitfile gitfile:test/atf_comp/acr_in.Simple dev.gitfile gitfile:test/atf_comp/acr_in.Tree @@ -1089,6 +1203,9 @@ dev.gitfile gitfile:test/atf_comp/atf_cmdline.RichExec dev.gitfile gitfile:test/atf_comp/atf_cmdline.Sig dev.gitfile gitfile:test/atf_comp/atf_cmdline.Verbose dev.gitfile gitfile:test/atf_comp/atf_cmdline.Version +dev.gitfile gitfile:test/atf_comp/jkv.ArrayFill +dev.gitfile gitfile:test/atf_comp/jkv.ReverseSmoke +dev.gitfile gitfile:test/atf_comp/jkv.Smoke dev.gitfile gitfile:test/atf_comp/mdbg.OutOfOrderArgs dev.gitfile gitfile:test/atf_comp/mdbg.Smoke dev.gitfile gitfile:test/atf_comp/mdbg.SmokeBreak @@ -1109,6 +1226,10 @@ dev.gitfile gitfile:test/atf_comp/sv2ssim.Convert1Signed dev.gitfile gitfile:test/atf_comp/sv2ssim.Convert2 dev.gitfile gitfile:test/atf_comp/sv2ssim.Convert2Tsv dev.gitfile gitfile:test/atf_comp/sv2ssim.UniqueFieldName +dev.gitfile gitfile:test/atf_unit/lib_curl.GET_Echo +dev.gitfile gitfile:test/atf_unit/lib_curl.POST_JSON +dev.gitfile gitfile:test/atf_unit/lib_curl.PUT_PLAINTEXT +dev.gitfile gitfile:test/atf_unit/lib_curl.STATUS_200 dev.gitfile gitfile:test/cppcheck-suppressions.txt dev.gitfile gitfile:test/csv/1.csv dev.gitfile gitfile:test/csv/2.csv @@ -1160,8 +1281,6 @@ dev.gitfile gitfile:txt/exe/amc_gc/README.md dev.gitfile gitfile:txt/exe/amc_gc/internals.md dev.gitfile gitfile:txt/exe/amc_vis/README.md dev.gitfile gitfile:txt/exe/amc_vis/internals.md -dev.gitfile gitfile:txt/exe/ams_cat/README.md -dev.gitfile gitfile:txt/exe/ams_cat/internals.md dev.gitfile gitfile:txt/exe/ams_sendtest/README.md dev.gitfile gitfile:txt/exe/ams_sendtest/internals.md dev.gitfile gitfile:txt/exe/apm/README.md @@ -1178,6 +1297,8 @@ dev.gitfile gitfile:txt/exe/atf_comp/README.md dev.gitfile gitfile:txt/exe/atf_comp/internals.md dev.gitfile gitfile:txt/exe/atf_cov/README.md dev.gitfile gitfile:txt/exe/atf_cov/internals.md +dev.gitfile gitfile:txt/exe/atf_exp/README.md +dev.gitfile gitfile:txt/exe/atf_exp/internals.md dev.gitfile gitfile:txt/exe/atf_fuzz/README.md dev.gitfile gitfile:txt/exe/atf_fuzz/internals.md dev.gitfile gitfile:txt/exe/atf_gcli/README.md @@ -1193,12 +1314,16 @@ dev.gitfile gitfile:txt/exe/gcache/README.md dev.gitfile gitfile:txt/exe/gcache/internals.md dev.gitfile gitfile:txt/exe/gcli/README.md dev.gitfile gitfile:txt/exe/gcli/internals.md +dev.gitfile gitfile:txt/exe/jkv/README.md +dev.gitfile gitfile:txt/exe/jkv/internals.md dev.gitfile gitfile:txt/exe/mdbg/README.md dev.gitfile gitfile:txt/exe/mdbg/internals.md dev.gitfile gitfile:txt/exe/mysql2ssim/README.md dev.gitfile gitfile:txt/exe/mysql2ssim/internals.md dev.gitfile gitfile:txt/exe/orgfile/README.md dev.gitfile gitfile:txt/exe/orgfile/internals.md +dev.gitfile gitfile:txt/exe/samp_make/README.md +dev.gitfile gitfile:txt/exe/samp_make/internals.md dev.gitfile gitfile:txt/exe/samp_meng/README.md dev.gitfile gitfile:txt/exe/samp_meng/internals.md dev.gitfile gitfile:txt/exe/samp_regx/README.md @@ -1226,15 +1351,20 @@ dev.gitfile gitfile:txt/lib/algo_lib/README.md dev.gitfile gitfile:txt/lib/lib_amcdb/README.md dev.gitfile gitfile:txt/lib/lib_ams/README.md dev.gitfile gitfile:txt/lib/lib_ctype/README.md +dev.gitfile gitfile:txt/lib/lib_curl/README.md dev.gitfile gitfile:txt/lib/lib_exec/README.md dev.gitfile gitfile:txt/lib/lib_fm/README.md dev.gitfile gitfile:txt/lib/lib_git/README.md +dev.gitfile gitfile:txt/lib/lib_http/README.md dev.gitfile gitfile:txt/lib/lib_iconv/README.md dev.gitfile gitfile:txt/lib/lib_json/README.md dev.gitfile gitfile:txt/lib/lib_mysql/README.md +dev.gitfile gitfile:txt/lib/lib_netio/README.md dev.gitfile gitfile:txt/lib/lib_prot/README.md +dev.gitfile gitfile:txt/lib/lib_rl/README.md dev.gitfile gitfile:txt/lib/lib_sql/README.md dev.gitfile gitfile:txt/lib/lib_sqlite/README.md +dev.gitfile gitfile:txt/lib/lib_ws/README.md dev.gitfile gitfile:txt/protocol/README.md dev.gitfile gitfile:txt/protocol/algo/Attr.md dev.gitfile gitfile:txt/protocol/algo/Bool.md @@ -1274,49 +1404,34 @@ dev.gitfile gitfile:txt/protocol/algo/UnixTime.md dev.gitfile gitfile:txt/protocol/algo/cstring.md dev.gitfile gitfile:txt/protocol/algo/memptr.md dev.gitfile gitfile:txt/protocol/algo/strptr.md -dev.gitfile gitfile:txt/protocol/ams/AlarmSyncMsg.md -dev.gitfile gitfile:txt/protocol/ams/DfltStream.md -dev.gitfile gitfile:txt/protocol/ams/DumpStreamTableMsg.md dev.gitfile gitfile:txt/protocol/ams/ExpectMsg.md -dev.gitfile gitfile:txt/protocol/ams/HeartbeatMsg.md dev.gitfile gitfile:txt/protocol/ams/InputLineMsg.md dev.gitfile gitfile:txt/protocol/ams/LogMsg.md -dev.gitfile gitfile:txt/protocol/ams/Member.md dev.gitfile gitfile:txt/protocol/ams/MsgBlock.md dev.gitfile gitfile:txt/protocol/ams/MsgHeader.md -dev.gitfile gitfile:txt/protocol/ams/OpenMsg.md -dev.gitfile gitfile:txt/protocol/ams/PrlogMsg.md -dev.gitfile gitfile:txt/protocol/ams/ProcAddMsg.md dev.gitfile gitfile:txt/protocol/ams/ProcId.md -dev.gitfile gitfile:txt/protocol/ams/ProcRemoveMsg.md -dev.gitfile gitfile:txt/protocol/ams/ProcType.md dev.gitfile gitfile:txt/protocol/ams/README.md -dev.gitfile gitfile:txt/protocol/ams/Seqmsg.md -dev.gitfile gitfile:txt/protocol/ams/SeqmsgId.md -dev.gitfile gitfile:txt/protocol/ams/SeqmsgTrace.md -dev.gitfile gitfile:txt/protocol/ams/StreamFlags.md -dev.gitfile gitfile:txt/protocol/ams/StreamHbMsg.md -dev.gitfile gitfile:txt/protocol/ams/StreamId.md -dev.gitfile gitfile:txt/protocol/ams/StreamPos.md -dev.gitfile gitfile:txt/protocol/ams/StreamType.md dev.gitfile gitfile:txt/protocol/ams/TerminateMsg.md -dev.gitfile gitfile:txt/protocol/ams/Trace2Msg.md -dev.gitfile gitfile:txt/protocol/ams/TraceInfo2Msg.md -dev.gitfile gitfile:txt/protocol/ams/TraceInfoMsg.md -dev.gitfile gitfile:txt/protocol/ams/TraceMsg.md dev.gitfile gitfile:txt/protocol/ams/UdpFrame.md dev.gitfile gitfile:txt/protocol/atf/README.md dev.gitfile gitfile:txt/protocol/command/README.md dev.gitfile gitfile:txt/protocol/fm/README.md +dev.gitfile gitfile:txt/protocol/http/README.md dev.gitfile gitfile:txt/protocol/ietf/README.md +dev.gitfile gitfile:txt/protocol/js/README.md +dev.gitfile gitfile:txt/protocol/kafka/README.md dev.gitfile gitfile:txt/protocol/report/README.md +dev.gitfile gitfile:txt/protocol/ws/README.md dev.gitfile gitfile:txt/recipe/README.md dev.gitfile gitfile:txt/script/README.md dev.gitfile gitfile:txt/script/abt_md_filt.md dev.gitfile gitfile:txt/script/ai.md dev.gitfile gitfile:txt/script/alexei-setup-soft-links.md +dev.gitfile gitfile:txt/script/bash-indent.md dev.gitfile gitfile:txt/script/break-long-lines.md +dev.gitfile gitfile:txt/script/check-json.mjs.md dev.gitfile gitfile:txt/script/ci-show-log.md +dev.gitfile gitfile:txt/script/core-decode.md dev.gitfile gitfile:txt/script/cpp-indent.md dev.gitfile gitfile:txt/script/delete-duplicate-lines.md dev.gitfile gitfile:txt/script/diff-to-errlist.md @@ -1324,10 +1439,12 @@ dev.gitfile gitfile:txt/script/edit-conflicts.md dev.gitfile gitfile:txt/script/em.md dev.gitfile gitfile:txt/script/errlist.md dev.gitfile gitfile:txt/script/ff.md +dev.gitfile gitfile:txt/script/filt-gc.md dev.gitfile gitfile:txt/script/find-non-copyrighted.md dev.gitfile gitfile:txt/script/fix-gen-conflicts.md dev.gitfile gitfile:txt/script/git-add-to-last-commit.md dev.gitfile gitfile:txt/script/git-branch-gc.md +dev.gitfile gitfile:txt/script/git-checkout-master.md dev.gitfile gitfile:txt/script/git-clean-branches.md dev.gitfile gitfile:txt/script/git-commits-per-user.md dev.gitfile gitfile:txt/script/git-current-ref.md @@ -1350,9 +1467,14 @@ dev.gitfile gitfile:txt/script/lines-to-dots.md dev.gitfile gitfile:txt/script/lsfunc.md dev.gitfile gitfile:txt/script/msloc.pl.md dev.gitfile gitfile:txt/script/normalize.md +dev.gitfile gitfile:txt/script/normalize_loop.md +dev.gitfile gitfile:txt/script/open-link.md +dev.gitfile gitfile:txt/script/revert-executable.md dev.gitfile gitfile:txt/script/select-bootstrap.md dev.gitfile gitfile:txt/script/sha1.md dev.gitfile gitfile:txt/script/sloc.pl.md +dev.gitfile gitfile:txt/script/sortwrap.md +dev.gitfile gitfile:txt/script/stepper.md dev.gitfile gitfile:txt/script/tags.md dev.gitfile gitfile:txt/script/targ-diff.md dev.gitfile gitfile:txt/script/test-orgfile.md @@ -1362,6 +1484,7 @@ dev.gitfile gitfile:txt/script/todo.md dev.gitfile gitfile:txt/script/update-gitfile.md dev.gitfile gitfile:txt/script/update-hdr.md dev.gitfile gitfile:txt/script/update-scriptfile.md +dev.gitfile gitfile:txt/script/vscode-select-debug-target.md dev.gitfile gitfile:txt/script/zfs_snapshot.pl.md dev.gitfile gitfile:txt/setup.md dev.gitfile gitfile:txt/ssim.md @@ -1376,7 +1499,7 @@ dev.gitfile gitfile:txt/ssimdb/amcdb/tcurs.md dev.gitfile gitfile:txt/ssimdb/amcdb/tfunc.md dev.gitfile gitfile:txt/ssimdb/amsdb/README.md dev.gitfile gitfile:txt/ssimdb/amsdb/proctype.md -dev.gitfile gitfile:txt/ssimdb/amsdb/streamtype.md +dev.gitfile gitfile:txt/ssimdb/amsdb/shmtype.md dev.gitfile gitfile:txt/ssimdb/atfdb/README.md dev.gitfile gitfile:txt/ssimdb/atfdb/amctest.md dev.gitfile gitfile:txt/ssimdb/atfdb/cijob.md @@ -1392,6 +1515,7 @@ dev.gitfile gitfile:txt/ssimdb/atfdb/test_gsymbol_strptr.md dev.gitfile gitfile:txt/ssimdb/atfdb/tfilt.md dev.gitfile gitfile:txt/ssimdb/atfdb/tmsg.md dev.gitfile gitfile:txt/ssimdb/atfdb/unittest.md +dev.gitfile gitfile:txt/ssimdb/atfdb/var.md dev.gitfile gitfile:txt/ssimdb/dev/README.md dev.gitfile gitfile:txt/ssimdb/dev/arch.md dev.gitfile gitfile:txt/ssimdb/dev/badline.md @@ -1414,13 +1538,16 @@ dev.gitfile gitfile:txt/ssimdb/dev/linelim.md dev.gitfile gitfile:txt/ssimdb/dev/mdmark.md dev.gitfile gitfile:txt/ssimdb/dev/mdsection.md dev.gitfile gitfile:txt/ssimdb/dev/msgfile.md +dev.gitfile gitfile:txt/ssimdb/dev/netproto.md dev.gitfile gitfile:txt/ssimdb/dev/noindent.md dev.gitfile gitfile:txt/ssimdb/dev/opt_type.md dev.gitfile gitfile:txt/ssimdb/dev/package.md dev.gitfile gitfile:txt/ssimdb/dev/pkgdep.md dev.gitfile gitfile:txt/ssimdb/dev/pkgkey.md -dev.gitfile gitfile:txt/ssimdb/dev/readme.md +dev.gitfile gitfile:txt/ssimdb/dev/prototransport.md +dev.gitfile gitfile:txt/ssimdb/dev/readmefile.md dev.gitfile gitfile:txt/ssimdb/dev/readmesort.md +dev.gitfile gitfile:txt/ssimdb/dev/rpm.md dev.gitfile gitfile:txt/ssimdb/dev/sandbox.md dev.gitfile gitfile:txt/ssimdb/dev/sbpath.md dev.gitfile gitfile:txt/ssimdb/dev/scriptfile.md @@ -1435,6 +1562,7 @@ dev.gitfile gitfile:txt/ssimdb/dev/targsyslib.md dev.gitfile gitfile:txt/ssimdb/dev/tgtcov.md dev.gitfile gitfile:txt/ssimdb/dev/timefmt.md dev.gitfile gitfile:txt/ssimdb/dev/tool_opt.md +dev.gitfile gitfile:txt/ssimdb/dev/transport.md dev.gitfile gitfile:txt/ssimdb/dev/uname.md dev.gitfile gitfile:txt/ssimdb/dev/unstablefld.md dev.gitfile gitfile:txt/ssimdb/dmmeta/README.md @@ -1452,6 +1580,7 @@ dev.gitfile gitfile:txt/ssimdb/dmmeta/cfmt.md dev.gitfile gitfile:txt/ssimdb/dmmeta/cget.md dev.gitfile gitfile:txt/ssimdb/dmmeta/charset.md dev.gitfile gitfile:txt/ssimdb/dmmeta/chash.md +dev.gitfile gitfile:txt/ssimdb/dmmeta/ckafka.md dev.gitfile gitfile:txt/ssimdb/dmmeta/cppfunc.md dev.gitfile gitfile:txt/ssimdb/dmmeta/cppkeyword.md dev.gitfile gitfile:txt/ssimdb/dmmeta/cpptype.md @@ -1475,6 +1604,7 @@ dev.gitfile gitfile:txt/ssimdb/dmmeta/fbigend.md dev.gitfile gitfile:txt/ssimdb/dmmeta/fbitset.md dev.gitfile gitfile:txt/ssimdb/dmmeta/fbuf.md dev.gitfile gitfile:txt/ssimdb/dmmeta/fbufdir.md +dev.gitfile gitfile:txt/ssimdb/dmmeta/fbufiotype.md dev.gitfile gitfile:txt/ssimdb/dmmeta/fbuftype.md dev.gitfile gitfile:txt/ssimdb/dmmeta/fcast.md dev.gitfile gitfile:txt/ssimdb/dmmeta/fcleanup.md @@ -1491,6 +1621,7 @@ dev.gitfile gitfile:txt/ssimdb/dmmeta/fflag.md dev.gitfile gitfile:txt/ssimdb/dmmeta/field.md dev.gitfile gitfile:txt/ssimdb/dmmeta/findrem.md dev.gitfile gitfile:txt/ssimdb/dmmeta/finput.md +dev.gitfile gitfile:txt/ssimdb/dmmeta/fkafka.md dev.gitfile gitfile:txt/ssimdb/dmmeta/fldoffset.md dev.gitfile gitfile:txt/ssimdb/dmmeta/floadtuples.md dev.gitfile gitfile:txt/ssimdb/dmmeta/fnoremove.md @@ -1511,6 +1642,8 @@ dev.gitfile gitfile:txt/ssimdb/dmmeta/gsymbol.md dev.gitfile gitfile:txt/ssimdb/dmmeta/hashtype.md dev.gitfile gitfile:txt/ssimdb/dmmeta/hook.md dev.gitfile gitfile:txt/ssimdb/dmmeta/inlary.md +dev.gitfile gitfile:txt/ssimdb/dmmeta/jstype.md +dev.gitfile gitfile:txt/ssimdb/dmmeta/kafka_type_kind.md dev.gitfile gitfile:txt/ssimdb/dmmeta/lenfld.md dev.gitfile gitfile:txt/ssimdb/dmmeta/listtype.md dev.gitfile gitfile:txt/ssimdb/dmmeta/llist.md @@ -1525,6 +1658,7 @@ dev.gitfile gitfile:txt/ssimdb/dmmeta/nscpp.md dev.gitfile gitfile:txt/ssimdb/dmmeta/nsdb.md dev.gitfile gitfile:txt/ssimdb/dmmeta/nsfast.md dev.gitfile gitfile:txt/ssimdb/dmmeta/nsinclude.md +dev.gitfile gitfile:txt/ssimdb/dmmeta/nsjs.md dev.gitfile gitfile:txt/ssimdb/dmmeta/nsproto.md dev.gitfile gitfile:txt/ssimdb/dmmeta/nstype.md dev.gitfile gitfile:txt/ssimdb/dmmeta/nsversion.md @@ -1557,6 +1691,7 @@ dev.gitfile gitfile:txt/ssimdb/dmmeta/thash.md dev.gitfile gitfile:txt/ssimdb/dmmeta/tracefld.md dev.gitfile gitfile:txt/ssimdb/dmmeta/tracerec.md dev.gitfile gitfile:txt/ssimdb/dmmeta/typefld.md +dev.gitfile gitfile:txt/ssimdb/dmmeta/userfunc.md dev.gitfile gitfile:txt/ssimdb/dmmeta/usertracefld.md dev.gitfile gitfile:txt/ssimdb/dmmeta/xref.md dev.gitfile gitfile:txt/ssimdb/fmdb/README.md @@ -1577,8 +1712,6 @@ dev.gitfile gitfile:txt/ssimdb/gclidb/gfld.md dev.gitfile gitfile:txt/ssimdb/gclidb/githost.md dev.gitfile gitfile:txt/ssimdb/gclidb/gmethod.md dev.gitfile gitfile:txt/ssimdb/gclidb/grepo.md -dev.gitfile gitfile:txt/ssimdb/gclidb/grepogitport.md -dev.gitfile gitfile:txt/ssimdb/gclidb/grepossh.md dev.gitfile gitfile:txt/ssimdb/gclidb/gstate.md dev.gitfile gitfile:txt/ssimdb/gclidb/gstatet.md dev.gitfile gitfile:txt/ssimdb/gclidb/gtbl.md @@ -1599,6 +1732,20 @@ dev.gitfile gitfile:txt/ssimdb/gclidb/mrjob.md dev.gitfile gitfile:txt/ssimdb/gclidb/mrnote.md dev.gitfile gitfile:txt/ssimdb/gclidb/project.md dev.gitfile gitfile:txt/ssimdb/gclidb/user.md +dev.gitfile gitfile:txt/ssimdb/httpdb/README.md +dev.gitfile gitfile:txt/ssimdb/httpdb/content.md +dev.gitfile gitfile:txt/ssimdb/httpdb/header.md +dev.gitfile gitfile:txt/ssimdb/httpdb/method.md +dev.gitfile gitfile:txt/ssimdb/httpdb/status.md +dev.gitfile gitfile:txt/ssimdb/httpdb/version.md +dev.gitfile gitfile:txt/ssimdb/sampdb/README.md +dev.gitfile gitfile:txt/ssimdb/sampdb/gitfile.md +dev.gitfile gitfile:txt/ssimdb/sampdb/targdep.md +dev.gitfile gitfile:txt/ssimdb/sampdb/target.md +dev.gitfile gitfile:txt/ssimdb/sampdb/targrec.md +dev.gitfile gitfile:txt/ssimdb/sampdb/targsrc.md +dev.gitfile gitfile:txt/ssimdb/wsdb/README.md +dev.gitfile gitfile:txt/ssimdb/wsdb/status.md dev.gitfile gitfile:txt/tut/README.md dev.gitfile gitfile:txt/tut/tut1.md dev.gitfile gitfile:txt/tut/tut2.md @@ -1608,3 +1755,4 @@ dev.gitfile gitfile:txt/tut/tut5.md dev.gitfile gitfile:txt/tut/tut6.md dev.gitfile gitfile:txt/tut/tut7.md dev.gitfile gitfile:txt/tut/tut8.md +dev.gitfile gitfile:txt/tut/tut9_make.md diff --git a/data/dev/linelim.ssim b/data/dev/linelim.ssim index 5bd0f4d9..7bdba777 100644 --- a/data/dev/linelim.ssim +++ b/data/dev/linelim.ssim @@ -1,9 +1,9 @@ dev.linelim gitfile:cpp/abt/disas.cpp nlongline:2 longestline:124 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:"" dev.linelim gitfile:cpp/abt/main.cpp nlongline:4 longestline:140 nbadws:4 maxws:20 nlongfunc:2 longestfunc:96 nmysteryfunc:5 badness:**************** dev.linelim gitfile:cpp/abt/opt.cpp nlongline:1 longestline:138 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:2 badness:.......... -dev.linelim gitfile:cpp/abt_md/file_section.cpp nlongline:2 longestline:135 nbadws:11 maxws:24 nlongfunc:2 longestfunc:85 nmysteryfunc:2 badness:......................... -dev.linelim gitfile:cpp/abt_md/main.cpp nlongline:2 longestline:129 nbadws:0 maxws:16 nlongfunc:2 longestfunc:95 nmysteryfunc:6 badness:***************** -dev.linelim gitfile:cpp/abt_md/mdsection.cpp nlongline:3 longestline:145 nbadws:9 maxws:24 nlongfunc:1 longestfunc:81 nmysteryfunc:15 badness:****************************** +dev.linelim gitfile:cpp/abt_md/file_section.cpp nlongline:2 longestline:135 nbadws:11 maxws:24 nlongfunc:2 longestfunc:64 nmysteryfunc:3 badness:.............................. +dev.linelim gitfile:cpp/abt_md/main.cpp nlongline:2 longestline:129 nbadws:0 maxws:16 nlongfunc:2 longestfunc:95 nmysteryfunc:11 badness:***************************** +dev.linelim gitfile:cpp/abt_md/mdsection.cpp nlongline:4 longestline:145 nbadws:9 maxws:24 nlongfunc:2 longestfunc:86 nmysteryfunc:16 badness:****************************** dev.linelim gitfile:cpp/acr/check.cpp nlongline:2 longestline:125 nbadws:3 maxws:20 nlongfunc:0 longestfunc:60 nmysteryfunc:1 badness:........ dev.linelim gitfile:cpp/acr/createrec.cpp nlongline:1 longestline:133 nbadws:0 maxws:16 nlongfunc:1 longestfunc:77 nmysteryfunc:0 badness:.. dev.linelim gitfile:cpp/acr/eval.cpp nlongline:0 longestline:120 nbadws:2 maxws:20 nlongfunc:1 longestfunc:73 nmysteryfunc:1 badness:......... @@ -11,16 +11,16 @@ dev.linelim gitfile:cpp/acr/load.cpp nlongline:0 longestline:120 nbadws:1 m dev.linelim gitfile:cpp/acr/main.cpp nlongline:1 longestline:145 nbadws:0 maxws:16 nlongfunc:2 longestfunc:75 nmysteryfunc:4 badness:........................ dev.linelim gitfile:cpp/acr/query.cpp nlongline:1 longestline:132 nbadws:6 maxws:24 nlongfunc:3 longestfunc:94 nmysteryfunc:1 badness:................. dev.linelim gitfile:cpp/acr/verb.cpp nlongline:1 longestline:128 nbadws:5 maxws:24 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:......................... -dev.linelim gitfile:cpp/acr_compl/main.cpp nlongline:1 longestline:121 nbadws:5 maxws:20 nlongfunc:2 longestfunc:310 nmysteryfunc:3 badness:........................ +dev.linelim gitfile:cpp/acr_compl/main.cpp nlongline:1 longestline:121 nbadws:5 maxws:20 nlongfunc:3 longestfunc:311 nmysteryfunc:3 badness:.......................... dev.linelim gitfile:cpp/acr_compl/shell.cpp nlongline:0 longestline:120 nbadws:2 maxws:20 nlongfunc:2 longestfunc:139 nmysteryfunc:4 badness:.......................... dev.linelim gitfile:cpp/acr_dm/acr_dm.cpp nlongline:0 longestline:120 nbadws:3 maxws:20 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:... dev.linelim gitfile:cpp/acr_ed/ctype.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:140 nmysteryfunc:0 badness:.. dev.linelim gitfile:cpp/acr_ed/field.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:169 nmysteryfunc:3 badness:................. dev.linelim gitfile:cpp/acr_ed/finput.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:78 nmysteryfunc:0 badness:.. dev.linelim gitfile:cpp/acr_ed/main.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:5 badness:......................... -dev.linelim gitfile:cpp/acr_ed/srcfile.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:66 nmysteryfunc:0 badness:.. +dev.linelim gitfile:cpp/acr_ed/srcfile.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:80 nmysteryfunc:0 badness:.. dev.linelim gitfile:cpp/acr_ed/ssimfile.cpp nlongline:1 longestline:126 nbadws:0 maxws:16 nlongfunc:1 longestfunc:77 nmysteryfunc:3 badness:................. -dev.linelim gitfile:cpp/acr_ed/target.cpp nlongline:5 longestline:160 nbadws:0 maxws:16 nlongfunc:2 longestfunc:199 nmysteryfunc:3 badness:.................... +dev.linelim gitfile:cpp/acr_ed/target.cpp nlongline:5 longestline:160 nbadws:0 maxws:16 nlongfunc:2 longestfunc:200 nmysteryfunc:3 badness:.................... dev.linelim gitfile:cpp/acr_in/acr_in.cpp nlongline:2 longestline:127 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:1 badness:..... dev.linelim gitfile:cpp/acr_in/data.cpp nlongline:1 longestline:121 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:"" dev.linelim gitfile:cpp/amc/alias.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:.................... @@ -34,7 +34,7 @@ dev.linelim gitfile:cpp/amc/blkpool.cpp nlongline:3 longestline:125 nbadws:0 dev.linelim gitfile:cpp/amc/cmp.cpp nlongline:2 longestline:154 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:"" dev.linelim gitfile:cpp/amc/count.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:.................... dev.linelim gitfile:cpp/amc/cppfunc.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:.................... -dev.linelim gitfile:cpp/amc/ctype.cpp nlongline:18 longestline:145 nbadws:21 maxws:32 nlongfunc:2 longestfunc:130 nmysteryfunc:30 badness:****************************** +dev.linelim gitfile:cpp/amc/ctype.cpp nlongline:20 longestline:145 nbadws:28 maxws:32 nlongfunc:3 longestfunc:130 nmysteryfunc:30 badness:****************************** dev.linelim gitfile:cpp/amc/delptr.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:5 badness:......................... dev.linelim gitfile:cpp/amc/dflt.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:3 badness:............... dev.linelim gitfile:cpp/amc/disp/filter.cpp nlongline:3 longestline:124 nbadws:4 maxws:20 nlongfunc:1 longestfunc:62 nmysteryfunc:1 badness:........... @@ -42,13 +42,13 @@ dev.linelim gitfile:cpp/amc/disp/print.cpp nlongline:1 longestline:132 nbadw dev.linelim gitfile:cpp/amc/disp/read.cpp nlongline:2 longestline:123 nbadws:0 maxws:16 nlongfunc:1 longestfunc:82 nmysteryfunc:1 badness:....... dev.linelim gitfile:cpp/amc/exec.cpp nlongline:1 longestline:123 nbadws:0 maxws:16 nlongfunc:1 longestfunc:73 nmysteryfunc:13 badness:****************************** dev.linelim gitfile:cpp/amc/fast.cpp nlongline:13 longestline:141 nbadws:11 maxws:24 nlongfunc:6 longestfunc:178 nmysteryfunc:1 badness:.............................. -dev.linelim gitfile:cpp/amc/fbuf.cpp nlongline:15 longestline:146 nbadws:0 maxws:16 nlongfunc:1 longestfunc:75 nmysteryfunc:19 badness:****************************** +dev.linelim gitfile:cpp/amc/fbuf.cpp nlongline:17 longestline:171 nbadws:0 maxws:16 nlongfunc:2 longestfunc:70 nmysteryfunc:19 badness:****************************** dev.linelim gitfile:cpp/amc/fcmap.cpp nlongline:1 longestline:124 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:"" dev.linelim gitfile:cpp/amc/fconst.cpp nlongline:2 longestline:155 nbadws:6 maxws:28 nlongfunc:1 longestfunc:67 nmysteryfunc:8 badness:************************ dev.linelim gitfile:cpp/amc/fdec.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:76 nmysteryfunc:8 badness:********************* dev.linelim gitfile:cpp/amc/field.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:64 nmysteryfunc:7 badness:****************** dev.linelim gitfile:cpp/amc/func.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:5 badness:......................... -dev.linelim gitfile:cpp/amc/gen.cpp nlongline:8 longestline:141 nbadws:2 maxws:20 nlongfunc:0 longestfunc:60 nmysteryfunc:48 badness:****************************** +dev.linelim gitfile:cpp/amc/gen.cpp nlongline:8 longestline:146 nbadws:2 maxws:20 nlongfunc:0 longestfunc:60 nmysteryfunc:48 badness:****************************** dev.linelim gitfile:cpp/amc/global.cpp nlongline:19 longestline:157 nbadws:3 maxws:24 nlongfunc:4 longestfunc:226 nmysteryfunc:17 badness:****************************** dev.linelim gitfile:cpp/amc/hook.cpp nlongline:1 longestline:123 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:6 badness:.............................. dev.linelim gitfile:cpp/amc/include.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:69 nmysteryfunc:0 badness:.. @@ -57,14 +57,13 @@ dev.linelim gitfile:cpp/amc/io.cpp nlongline:1 longestline:126 nbadws:0 max dev.linelim gitfile:cpp/amc/lary.cpp nlongline:1 longestline:121 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:14 badness:****************************** dev.linelim gitfile:cpp/amc/llist.cpp nlongline:8 longestline:132 nbadws:2 maxws:20 nlongfunc:3 longestfunc:106 nmysteryfunc:26 badness:****************************** dev.linelim gitfile:cpp/amc/lpool.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:7 badness:***************** -dev.linelim gitfile:cpp/amc/main.cpp nlongline:5 longestline:169 nbadws:0 maxws:16 nlongfunc:1 longestfunc:72 nmysteryfunc:50 badness:****************************** +dev.linelim gitfile:cpp/amc/main.cpp nlongline:5 longestline:169 nbadws:0 maxws:16 nlongfunc:1 longestfunc:76 nmysteryfunc:50 badness:****************************** dev.linelim gitfile:cpp/amc/malloc.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:.................... -dev.linelim gitfile:cpp/amc/numstr.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:3 longestfunc:106 nmysteryfunc:7 badness:******************** +dev.linelim gitfile:cpp/amc/numstr.cpp nlongline:1 longestline:129 nbadws:0 maxws:16 nlongfunc:3 longestfunc:105 nmysteryfunc:7 badness:******************** dev.linelim gitfile:cpp/amc/opt.cpp nlongline:3 longestline:138 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:5 badness:......................... dev.linelim gitfile:cpp/amc/pmask.cpp nlongline:1 longestline:123 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:2 badness:.......... dev.linelim gitfile:cpp/amc/pool.cpp nlongline:6 longestline:140 nbadws:0 maxws:16 nlongfunc:1 longestfunc:69 nmysteryfunc:7 badness:******************* -dev.linelim gitfile:cpp/amc/print.cpp nlongline:7 longestline:162 nbadws:1 maxws:20 nlongfunc:0 longestfunc:60 nmysteryfunc:3 badness:................. -dev.linelim gitfile:cpp/amc/protocol.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:3 badness:............... +dev.linelim gitfile:cpp/amc/print.cpp nlongline:7 longestline:162 nbadws:1 maxws:20 nlongfunc:1 longestfunc:63 nmysteryfunc:3 badness:................... dev.linelim gitfile:cpp/amc/ptr.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:5 badness:......................... dev.linelim gitfile:cpp/amc/ptrary.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:20 badness:****************************** dev.linelim gitfile:cpp/amc/read.cpp nlongline:2 longestline:143 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:1 badness:..... @@ -72,25 +71,26 @@ dev.linelim gitfile:cpp/amc/regx.cpp nlongline:0 longestline:120 nbadws:0 m dev.linelim gitfile:cpp/amc/sbrk.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:.................... dev.linelim gitfile:cpp/amc/signature.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:83 nmysteryfunc:1 badness:....... dev.linelim gitfile:cpp/amc/size.cpp nlongline:0 longestline:120 nbadws:1 maxws:20 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:. -dev.linelim gitfile:cpp/amc/smallstr.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:8 badness:******************** +dev.linelim gitfile:cpp/amc/smallstr.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:7 badness:***************** dev.linelim gitfile:cpp/amc/sort.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:63 nmysteryfunc:11 badness:**************************** dev.linelim gitfile:cpp/amc/step.cpp nlongline:2 longestline:122 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:7 badness:***************** dev.linelim gitfile:cpp/amc/struct.cpp nlongline:1 longestline:148 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:1 badness:..... dev.linelim gitfile:cpp/amc/substr.cpp nlongline:3 longestline:141 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:3 badness:............... dev.linelim gitfile:cpp/amc/tableid.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:.................... -dev.linelim gitfile:cpp/amc/tary.cpp nlongline:7 longestline:161 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:29 badness:****************************** +dev.linelim gitfile:cpp/amc/tary.cpp nlongline:16 longestline:161 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:31 badness:****************************** dev.linelim gitfile:cpp/amc/tclass.cpp nlongline:1 longestline:138 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:2 badness:.......... dev.linelim gitfile:cpp/amc/thash.cpp nlongline:14 longestline:163 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:14 badness:****************************** dev.linelim gitfile:cpp/amc/tpool.cpp nlongline:2 longestline:133 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:6 badness:.............................. dev.linelim gitfile:cpp/amc/trace.cpp nlongline:3 longestline:145 nbadws:0 maxws:16 nlongfunc:1 longestfunc:82 nmysteryfunc:1 badness:....... dev.linelim gitfile:cpp/amc/val.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:6 badness:.............................. -dev.linelim gitfile:cpp/amc/varlen.cpp nlongline:4 longestline:144 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:7 badness:***************** +dev.linelim gitfile:cpp/amc/varlen.cpp nlongline:8 longestline:160 nbadws:2 maxws:20 nlongfunc:2 longestfunc:76 nmysteryfunc:14 badness:****************************** dev.linelim gitfile:cpp/ams_sendtest.cpp nlongline:4 longestline:159 nbadws:0 maxws:16 nlongfunc:1 longestfunc:135 nmysteryfunc:1 badness:....... -dev.linelim gitfile:cpp/apm/main.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:94 nmysteryfunc:4 badness:...................... -dev.linelim gitfile:cpp/apm/rec.cpp nlongline:1 longestline:123 nbadws:1 maxws:20 nlongfunc:1 longestfunc:62 nmysteryfunc:0 badness:... -dev.linelim gitfile:cpp/apm/update.cpp nlongline:2 longestline:126 nbadws:0 maxws:16 nlongfunc:1 longestfunc:114 nmysteryfunc:0 badness:.. +dev.linelim gitfile:cpp/apm/diff.cpp nlongline:1 longestline:125 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:"" +dev.linelim gitfile:cpp/apm/main.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:115 nmysteryfunc:3 badness:................. +dev.linelim gitfile:cpp/apm/push.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:88 nmysteryfunc:0 badness:.. +dev.linelim gitfile:cpp/apm/rec.cpp nlongline:2 longestline:124 nbadws:1 maxws:20 nlongfunc:1 longestfunc:69 nmysteryfunc:0 badness:... +dev.linelim gitfile:cpp/apm/update.cpp nlongline:4 longestline:128 nbadws:0 maxws:16 nlongfunc:1 longestfunc:108 nmysteryfunc:0 badness:.. dev.linelim gitfile:cpp/aqlite/aqlite.cpp nlongline:1 longestline:124 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:2 badness:.......... -dev.linelim gitfile:cpp/atf/atf_gcli.cpp nlongline:10 longestline:199 nbadws:0 maxws:16 nlongfunc:1 longestfunc:76 nmysteryfunc:2 badness:.............. dev.linelim gitfile:cpp/atf_amc/atree.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:3 badness:............... dev.linelim gitfile:cpp/atf_amc/bheap.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:64 nmysteryfunc:5 badness:........................... dev.linelim gitfile:cpp/atf_amc/bigend.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:221 nmysteryfunc:2 badness:............ @@ -101,7 +101,7 @@ dev.linelim gitfile:cpp/atf_amc/cleanup.cpp nlongline:0 longestline:120 nbad dev.linelim gitfile:cpp/atf_amc/cslist.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:5 badness:......................... dev.linelim gitfile:cpp/atf_amc/dispatch.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:8 badness:******************** dev.linelim gitfile:cpp/atf_amc/exec.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:.................... -dev.linelim gitfile:cpp/atf_amc/fbuf.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:72 nmysteryfunc:23 badness:****************************** +dev.linelim gitfile:cpp/atf_amc/fbuf.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:72 nmysteryfunc:24 badness:****************************** dev.linelim gitfile:cpp/atf_amc/fconst.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:128 nmysteryfunc:0 badness:.. dev.linelim gitfile:cpp/atf_amc/fstep.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:.................... dev.linelim gitfile:cpp/atf_amc/hook.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:5 badness:......................... @@ -113,20 +113,21 @@ dev.linelim gitfile:cpp/atf_amc/pmask.cpp nlongline:0 longestline:120 nbadws dev.linelim gitfile:cpp/atf_amc/readstr.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:6 badness:.............................. dev.linelim gitfile:cpp/atf_amc/sort.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:144 nmysteryfunc:2 badness:............ dev.linelim gitfile:cpp/atf_amc/strconv.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:99 nmysteryfunc:1 badness:....... -dev.linelim gitfile:cpp/atf_amc/tary.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:5 badness:......................... +dev.linelim gitfile:cpp/atf_amc/tary.cpp nlongline:1 longestline:131 nbadws:0 maxws:16 nlongfunc:1 longestfunc:62 nmysteryfunc:11 badness:**************************** dev.linelim gitfile:cpp/atf_amc/thash.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:7 badness:***************** -dev.linelim gitfile:cpp/atf_amc/varlen.cpp nlongline:2 longestline:138 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:6 badness:.............................. +dev.linelim gitfile:cpp/atf_amc/varlen.cpp nlongline:4 longestline:138 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:12 badness:****************************** dev.linelim gitfile:cpp/atf_amc/zdlist.cpp nlongline:0 longestline:120 nbadws:8 maxws:24 nlongfunc:2 longestfunc:65 nmysteryfunc:1 badness:................. dev.linelim gitfile:cpp/atf_amc/zslist.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:.................... dev.linelim gitfile:cpp/atf_ci/acr_ed.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:65 nmysteryfunc:0 badness:.. dev.linelim gitfile:cpp/atf_ci/apm.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:201 nmysteryfunc:3 badness:................. dev.linelim gitfile:cpp/atf_ci/bootstrap.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:81 nmysteryfunc:0 badness:.. dev.linelim gitfile:cpp/atf_ci/main.cpp nlongline:1 longestline:134 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:12 badness:****************************** -dev.linelim gitfile:cpp/atf_ci/src.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:5 badness:......................... +dev.linelim gitfile:cpp/atf_ci/src.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:6 badness:.............................. dev.linelim gitfile:cpp/atf_ci/ssim.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:3 badness:............... dev.linelim gitfile:cpp/atf_comp/main.cpp nlongline:1 longestline:129 nbadws:0 maxws:16 nlongfunc:1 longestfunc:62 nmysteryfunc:4 badness:...................... dev.linelim gitfile:cpp/atf_cov/atf_cov.cpp nlongline:0 longestline:120 nbadws:2 maxws:24 nlongfunc:2 longestfunc:74 nmysteryfunc:13 badness:****************************** dev.linelim gitfile:cpp/atf_fuzz/atf_fuzz.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:65 nmysteryfunc:2 badness:............ +dev.linelim gitfile:cpp/atf_gcli/atf_gcli.cpp nlongline:10 longestline:187 nbadws:0 maxws:16 nlongfunc:1 longestfunc:78 nmysteryfunc:1 badness:......... dev.linelim gitfile:cpp/atf_unit/algo_fmt.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:.................... dev.linelim gitfile:cpp/atf_unit/algo_lib.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:9 longestfunc:92 nmysteryfunc:73 badness:****************************** dev.linelim gitfile:cpp/atf_unit/decimal.cpp nlongline:5 longestline:138 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:1 badness:...... @@ -151,24 +152,29 @@ dev.linelim gitfile:cpp/gcli/mr.cpp nlongline:8 longestline:140 nbadws:0 ma dev.linelim gitfile:cpp/gcli/repo.cpp nlongline:3 longestline:131 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:"" dev.linelim gitfile:cpp/gcli/rest.cpp nlongline:0 longestline:120 nbadws:3 maxws:20 nlongfunc:1 longestfunc:115 nmysteryfunc:0 badness:..... dev.linelim gitfile:cpp/lib/algo/backtrace.cpp nlongline:6 longestline:150 nbadws:1 maxws:20 nlongfunc:0 longestfunc:60 nmysteryfunc:2 badness:............ +dev.linelim gitfile:cpp/lib/algo/bin_encode.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:9 badness:********************** dev.linelim gitfile:cpp/lib/algo/decimal.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:67 nmysteryfunc:0 badness:.. -dev.linelim gitfile:cpp/lib/algo/file.cpp nlongline:1 longestline:152 nbadws:1 maxws:20 nlongfunc:0 longestfunc:60 nmysteryfunc:11 badness:**************************** -dev.linelim gitfile:cpp/lib/algo/fmt.cpp nlongline:2 longestline:124 nbadws:3 maxws:24 nlongfunc:1 longestfunc:92 nmysteryfunc:49 badness:****************************** -dev.linelim gitfile:cpp/lib/algo/lib.cpp nlongline:1 longestline:145 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:17 badness:****************************** +dev.linelim gitfile:cpp/lib/algo/file.cpp nlongline:1 longestline:152 nbadws:1 maxws:20 nlongfunc:0 longestfunc:60 nmysteryfunc:7 badness:****************** +dev.linelim gitfile:cpp/lib/algo/fmt.cpp nlongline:2 longestline:124 nbadws:0 maxws:16 nlongfunc:1 longestfunc:92 nmysteryfunc:47 badness:****************************** +dev.linelim gitfile:cpp/lib/algo/lib.cpp nlongline:1 longestline:145 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:15 badness:****************************** dev.linelim gitfile:cpp/lib/algo/line.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:.................... dev.linelim gitfile:cpp/lib/algo/lockfile.cpp nlongline:1 longestline:123 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:"" dev.linelim gitfile:cpp/lib/algo/prlog.cpp nlongline:0 longestline:120 nbadws:4 maxws:24 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:.... dev.linelim gitfile:cpp/lib/algo/regx.cpp nlongline:2 longestline:127 nbadws:0 maxws:16 nlongfunc:2 longestfunc:81 nmysteryfunc:1 badness:......... dev.linelim gitfile:cpp/lib/algo/string.cpp nlongline:2 longestline:140 nbadws:5 maxws:24 nlongfunc:2 longestfunc:108 nmysteryfunc:45 badness:****************************** dev.linelim gitfile:cpp/lib/algo/time.cpp nlongline:2 longestline:160 nbadws:8 maxws:24 nlongfunc:1 longestfunc:155 nmysteryfunc:20 badness:****************************** -dev.linelim gitfile:cpp/lib/algo/txttbl.cpp nlongline:1 longestline:123 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:6 badness:.............................. +dev.linelim gitfile:cpp/lib/algo/txttbl.cpp nlongline:3 longestline:142 nbadws:3 maxws:24 nlongfunc:0 longestfunc:60 nmysteryfunc:4 badness:....................... dev.linelim gitfile:cpp/lib/algo/win32.cpp nlongline:1 longestline:121 nbadws:0 maxws:16 nlongfunc:1 longestfunc:68 nmysteryfunc:0 badness:.. dev.linelim gitfile:cpp/lib/lib_ctype.cpp nlongline:0 longestline:120 nbadws:1 maxws:20 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:. dev.linelim gitfile:cpp/lib/lib_exec.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:1 longestfunc:73 nmysteryfunc:1 badness:....... dev.linelim gitfile:cpp/lib/lib_fm.cpp nlongline:1 longestline:150 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:"" dev.linelim gitfile:cpp/lib/lib_json.cpp nlongline:2 longestline:134 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:10 badness:************************* -dev.linelim gitfile:cpp/lib_ams/stream.cpp nlongline:8 longestline:154 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:13 badness:****************************** +dev.linelim gitfile:cpp/lib_ams/dump.cpp nlongline:2 longestline:126 nbadws:1 maxws:20 nlongfunc:0 longestfunc:60 nmysteryfunc:1 badness:...... +dev.linelim gitfile:cpp/lib_ams/shm.cpp nlongline:5 longestline:149 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:12 badness:****************************** +dev.linelim gitfile:cpp/lib_ams/shmember.cpp nlongline:1 longestline:145 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:"" +dev.linelim gitfile:cpp/lib_netio/socket.cpp nlongline:1 longestline:202 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:0 badness:"" dev.linelim gitfile:cpp/lib_sqlite/lib_sqlite.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:3 badness:............... +dev.linelim gitfile:cpp/lib_ws/lib_ws.cpp nlongline:1 longestline:176 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:26 badness:****************************** dev.linelim gitfile:cpp/mdbg/mdbg.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:2 longestfunc:72 nmysteryfunc:1 badness:......... dev.linelim gitfile:cpp/mysql2ssim.cpp nlongline:1 longestline:122 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:1 badness:..... dev.linelim gitfile:cpp/orgfile.cpp nlongline:0 longestline:120 nbadws:0 maxws:16 nlongfunc:0 longestfunc:60 nmysteryfunc:3 badness:............... diff --git a/data/dev/mdsection.ssim b/data/dev/mdsection.ssim index dabd5a71..5e16ba06 100644 --- a/data/dev/mdsection.ssim +++ b/data/dev/mdsection.ssim @@ -7,7 +7,7 @@ dev.mdsection mdsection:Description match:"### Description" path:%README.md dev.mdsection mdsection:Limitations match:"### Limitations" path:"" genlist:"" comment:"Tool limitations" dev.mdsection mdsection:Content match:"### ---" path:"" genlist:"" comment:"Any other content (hard-coded)" dev.mdsection mdsection:Example match:"### Example%" path:"" genlist:"" comment:"User-provided example" -dev.mdsection mdsection:Attributes match:"### Attributes" path:"txt/ssimdb/%.md|txt/internals/(lib|protocol)/%/README.md" genlist:"" comment:"" +dev.mdsection mdsection:Attributes match:"### Attributes" path:txt/ssimdb/%.md genlist:"" comment:"" dev.mdsection mdsection:Ctypes match:"### Ctypes" path:txt/protocol/%/README.md genlist:"" comment:"" dev.mdsection mdsection:Functions match:"### Functions" path:"txt/(protocol|lib)/%/README.md" genlist:"" comment:"" dev.mdsection mdsection:Tables match:"### Tables" path:txt/ssimdb/%/README.md genlist:"" comment:NULL @@ -17,6 +17,7 @@ dev.mdsection mdsection:Constants match:"### Constants" path:txt/ssimdb/%.md dev.mdsection mdsection:CmdlineUses match:"### Used In Commands" path:txt/ssimdb/%.md genlist:"" comment:"" dev.mdsection mdsection:Options match:"### Options" path:txt/exe/%/README.md genlist:"####" comment:"(semi-gen) List of command-line options" dev.mdsection mdsection:Inputs match:"### Inputs" path:"txt/(exe|lib)/%/README.md" genlist:"" comment:"(gen) list of command inputs" +dev.mdsection mdsection:InputMessages match:"### Input Messages" path:txt/exe/%/README.md genlist:"" comment:"(gen) list of input messages" dev.mdsection mdsection:Sources match:"### Sources" path:"txt/(exe/%/internals.md|lib/%/README.md)" genlist:"" comment:"(build) Build information" dev.mdsection mdsection:Dependencies match:"### Dependencies" path:"txt/(exe/%/internals.md|lib/%/README.md)" genlist:"" comment:"(build) Dependency information" dev.mdsection mdsection:Imdb match:"### In Memory DB" path:"txt/(exe/%/internals.md|lib/%/README.md)" genlist:"" comment:"(gen) list of structs, access paths etc" diff --git a/data/dev/netproto.ssim b/data/dev/netproto.ssim new file mode 100644 index 00000000..dabc0109 --- /dev/null +++ b/data/dev/netproto.ssim @@ -0,0 +1,4 @@ +dev.netproto netproto:http tls:N comment:https://datatracker.ietf.org/doc/html/rfc2616 +dev.netproto netproto:https tls:Y comment:"" +dev.netproto netproto:smtp tls:N comment:"" +dev.netproto netproto:ssh tls:Y comment:https://www.rfc-editor.org/rfc/rfc4253 diff --git a/data/dev/package.ssim b/data/dev/package.ssim index e0ccf69d..e6babf59 100644 --- a/data/dev/package.ssim +++ b/data/dev/package.ssim @@ -1,5 +1,5 @@ -dev.package package:amc baseref:HEAD origin:../openacr comment:"Algo model compiler" -dev.package package:ams baseref:HEAD origin:. comment:"Algo Messaging System middleware" -dev.package package:apm baseref:HEAD origin:../openacr comment:"Algo Package Manager" +dev.package package:amc_js baseref:HEAD origin:. comment:"AMC javascript support" +dev.package package:apm baseref:HEAD origin:. comment:"Algo Package Manager" dev.package package:gcli baseref:HEAD origin:. comment:"Gcli tool" -dev.package package:openacr baseref:HEAD origin:../openacr comment:"OpenACR distribution (includes other packages)" +dev.package package:openacr baseref:HEAD origin:. comment:"OpenACR distribution (includes other packages)" +dev.package package:samp_make baseref:HEAD origin:. comment:"Samp_make tool for a tutorial" diff --git a/data/dev/pkgdep.ssim b/data/dev/pkgdep.ssim index 8fa175ab..0d025ff1 100644 --- a/data/dev/pkgdep.ssim +++ b/data/dev/pkgdep.ssim @@ -1,4 +1,3 @@ -dev.pkgdep pkgdep:amc.openacr soft:Y comment:"" -dev.pkgdep pkgdep:ams.openacr soft:Y comment:"" +dev.pkgdep pkgdep:amc_js.openacr soft:Y comment:"" dev.pkgdep pkgdep:apm.openacr soft:Y comment:"" dev.pkgdep pkgdep:gcli.openacr soft:Y comment:"" diff --git a/data/dev/pkgkey.ssim b/data/dev/pkgkey.ssim index 94a539c7..13d463ac 100644 --- a/data/dev/pkgkey.ssim +++ b/data/dev/pkgkey.ssim @@ -1,12 +1,6 @@ -dev.pkgkey pkgkey:amc/amcdb.%:% comment:"" -dev.pkgkey pkgkey:amc/dev.package:amc comment:"" -dev.pkgkey pkgkey:amc/dmmeta.ctype:dmmeta.Cextern comment:"" -dev.pkgkey pkgkey:amc/dmmeta.ctype:dmmeta.Ctypelen comment:"" -dev.pkgkey pkgkey:amc/dmmeta.ns:amc comment:"" -dev.pkgkey pkgkey:ams/dev.package:ams comment:"" -dev.pkgkey pkgkey:ams/dmmeta.ns:ams comment:"" -dev.pkgkey pkgkey:ams/dmmeta.ns:ams_sendtest comment:"" -dev.pkgkey pkgkey:ams/dmmeta.ns:lib_ams comment:"" +dev.pkgkey pkgkey:amc_js/dev.package:amc_js comment:"" +dev.pkgkey pkgkey:amc_js/dmmeta.ctype:dmmeta.Nsjs comment:"" +dev.pkgkey pkgkey:amc_js/dmmeta.ns:amc_js comment:"" dev.pkgkey pkgkey:apm/atfdb.citest:apm comment:"" dev.pkgkey pkgkey:apm/atfdb.citest:apm_check comment:"" dev.pkgkey pkgkey:apm/atfdb.citest:apm_reinstall comment:"" @@ -18,8 +12,6 @@ dev.pkgkey pkgkey:apm/dmmeta.ctype:dev.Package comment:"" dev.pkgkey pkgkey:apm/dmmeta.ctype:dev.Pkgkey comment:"" dev.pkgkey pkgkey:apm/dmmeta.ns:apm comment:"" dev.pkgkey pkgkey:gcli/dev.gitfile:data/gclidb/% comment:"" -dev.pkgkey pkgkey:gcli/dev.gitfile:extern/gclitest/id_rsa_gclisvc comment:"" -dev.pkgkey pkgkey:gcli/dev.gitfile:gclitest/id_rsa_gclisvc.pub comment:"" dev.pkgkey pkgkey:gcli/dev.package:gcli comment:"" dev.pkgkey pkgkey:gcli/dmmeta.ns:atf_gcli comment:"" dev.pkgkey pkgkey:gcli/dmmeta.ns:gcli comment:"" @@ -123,3 +115,10 @@ dev.pkgkey pkgkey:openacr/dmmeta.ns:ssimfilt comment:"" dev.pkgkey pkgkey:openacr/dmmeta.ns:strconv comment:"" dev.pkgkey pkgkey:openacr/dmmeta.ns:sv2ssim comment:"" dev.pkgkey pkgkey:openacr/fmdb.%:% comment:"" +dev.pkgkey pkgkey:samp_make/dev.gitfile:extern/gnumake/Simple-Makefile comment:"" +dev.pkgkey pkgkey:samp_make/dev.gitfile:txt/tut/tut9_make.md comment:"" +dev.pkgkey pkgkey:samp_make/dev.package:samp_make comment:"" +dev.pkgkey pkgkey:samp_make/dev.readmefile:txt/tut/tut9_make.md comment:"" +dev.pkgkey pkgkey:samp_make/dmmeta.ns:samp_make comment:"" +dev.pkgkey pkgkey:samp_make/dmmeta.ns:sampdb comment:"" +dev.pkgkey pkgkey:samp_make/sampdb.%:% comment:"" diff --git a/data/dev/prototransport.ssim b/data/dev/prototransport.ssim new file mode 100644 index 00000000..e69de29b diff --git a/data/dev/readme.ssim b/data/dev/readme.ssim deleted file mode 100644 index dcbf6b1f..00000000 --- a/data/dev/readme.ssim +++ /dev/null @@ -1,486 +0,0 @@ -dev.readme gitfile:txt/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/abt/README.md inl:N sandbox:N filter:abt_md_filt comment:"" -dev.readme gitfile:txt/exe/abt/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/abt_md/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/abt_md/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr/relnotes.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr_compl/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr_compl/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr_dm/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr_dm/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr_ed/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr_ed/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr_in/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr_in/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr_my/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/acr_my/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/enum.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/exec.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/fbuf.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/intro.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/pmask.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/pools.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/proto.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/reflection.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/reftypes.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/relnotes.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/runtime.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/strings.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc/xref.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc_gc/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc_gc/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc_vis/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/amc_vis/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/ams_cat/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/ams_cat/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/ams_sendtest/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/ams_sendtest/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/apm/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/apm/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/aqlite/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/aqlite/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_amc/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_amc/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_ci/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_ci/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_cmdline/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_cmdline/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_comp/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_comp/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_cov/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_cov/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_fuzz/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_fuzz/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_gcli/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_gcli/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_nrun/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_nrun/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_unit/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/atf_unit/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/bash2html/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/bash2html/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/coding-style.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/gcache/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/gcache/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/gcli/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/gcli/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/mdbg/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/mdbg/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/mysql2ssim/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/mysql2ssim/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/orgfile/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/orgfile/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/samp_meng/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/samp_meng/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/samp_regx/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/samp_regx/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/sandbox/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/sandbox/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/src_func/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/src_func/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/src_hdr/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/src_hdr/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/src_lim/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/src_lim/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/ssim2csv/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/ssim2csv/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/ssim2mysql/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/ssim2mysql/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/ssimfilt/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/ssimfilt/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/strconv/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/strconv/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/sv2ssim/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/exe/sv2ssim/internals.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/algo_lib/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_amcdb/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_ams/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_ctype/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_exec/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_fm/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_git/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_iconv/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_json/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_mysql/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_prot/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_sql/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/lib/lib_sqlite/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Attr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Bool.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Charset.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Comment.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/CppExpr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/DateCache.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Decimal.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/DirEntry.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Errcode.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Errns.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Fildes.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/FileFlags.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/IOEvtFlags.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/IPoint.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Imtable.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Ipmask.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/LineBuf.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Md5Digest.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Month.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/NumParseFlags.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/PrlogFcn.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/SchedTime.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/SeqType.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Sha1sig.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/TFNNtTestAlert.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/TermStyle.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/TextJust.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/TstampCache.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/Tuple.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/URL.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/UnDiff.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/UnTime.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/UnixDiff.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/UnixTime.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/cstring.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/memptr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/algo/strptr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/AlarmSyncMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/DfltStream.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/DumpStreamTableMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/ExpectMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/HeartbeatMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/InputLineMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/LogMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/Member.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/MsgBlock.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/MsgHeader.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/OpenMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/PrlogMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/ProcAddMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/ProcId.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/ProcRemoveMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/ProcType.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/Seqmsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/SeqmsgId.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/SeqmsgTrace.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/StreamFlags.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/StreamHbMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/StreamId.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/StreamPos.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/StreamType.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/TerminateMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/Trace2Msg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/TraceInfo2Msg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/TraceInfoMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/TraceMsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ams/UdpFrame.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/atf/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/command/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/fm/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/ietf/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/protocol/report/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/recipe/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/abt_md_filt.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/ai.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/alexei-setup-soft-links.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/break-long-lines.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/ci-show-log.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/cpp-indent.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/delete-duplicate-lines.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/diff-to-errlist.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/edit-conflicts.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/em.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/errlist.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/ff.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/find-non-copyrighted.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/fix-gen-conflicts.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-add-to-last-commit.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-branch-gc.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-clean-branches.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-commits-per-user.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-current-ref.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-diff-annotate.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-grep-reflog.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-mdiff.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-mod-plot.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-praise.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-rebase-origin.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-rebase-remote.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-recent-branches.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-rollback-file.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/git-update-config.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/gitconfig-setup.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/grephunk.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/hilite-error.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/hilite.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/limit-output.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/lines-to-dots.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/lsfunc.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/msloc.pl.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/normalize.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/select-bootstrap.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/sha1.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/sloc.pl.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/tags.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/targ-diff.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/test-orgfile.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/timestamps.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/toamc.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/todo.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/update-gitfile.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/update-hdr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/update-scriptfile.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/script/zfs_snapshot.pl.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/setup.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssim.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/amcdb/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/amcdb/bltin.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/amcdb/curstype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/amcdb/gen.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/amcdb/regxtype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/amcdb/tclass.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/amcdb/tcurs.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/amcdb/tfunc.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/amsdb/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/amsdb/proctype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/amsdb/streamtype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/amctest.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/cijob.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/cipackage.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/citest.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/comptest.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/fuzzstrat.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/msgdir.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/targs.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/test_gsymbol_char.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/test_gsymbol_pkey.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/test_gsymbol_strptr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/tfilt.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/tmsg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/atfdb/unittest.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/arch.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/badline.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/builddir.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/cfg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/compiler.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/copyright.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/covfile.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/covline.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/covtarget.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/edaction.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/edacttype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/gitfile.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/gitinfo.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/hilite.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/htmlentity.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/include.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/license.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/linelim.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/mdmark.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/mdsection.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/msgfile.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/noindent.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/opt_type.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/package.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/pkgdep.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/pkgkey.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/readme.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/readmesort.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/sandbox.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/sbpath.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/scriptfile.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/srcfile.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/syscmd.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/syscmddep.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/syslib.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/targdep.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/target.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/targsrc.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/targsyslib.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/tgtcov.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/timefmt.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/tool_opt.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/uname.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dev/unstablefld.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/anonfld.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/argvtype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/basepool.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/bitfld.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/cafter.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/cascdel.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ccmp.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/cdflt.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/cextern.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/cfast.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/cfmt.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/cget.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/charset.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/chash.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/cppfunc.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/cppkeyword.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/cpptype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/csize.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/cstr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ctype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ctypelen.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/dispatch.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/dispatch_msg.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/dispctx.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/dispfilter.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/dispsig.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/dispsigcheck.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/disptrace.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/falias.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fastenc.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fastinstr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fastop.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fbase.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fbigend.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fbitset.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fbuf.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fbufdir.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fbuftype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fcast.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fcleanup.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fcmap.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fcmdline.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fcmp.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fcompact.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fconst.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fcurs.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fdec.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fdelay.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ffast.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fflag.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/field.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/findrem.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/finput.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fldoffset.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/floadtuples.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fnoremove.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/foutput.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fprefix.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fregx.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fsort.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fstep.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ftrace.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ftuple.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/func.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/funique.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fuserinit.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/fwddecl.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/gconst.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/gstatic.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/gsymbol.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/hashtype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/hook.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/inlary.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/lenfld.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/listtype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/llist.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/logcat.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/main.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/msgtype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/nocascdel.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/nossimfile.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/noxref.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ns.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/nscpp.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/nsdb.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/nsfast.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/nsinclude.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/nsproto.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/nstype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/nsversion.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/nsx.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/numstr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/pack.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/pmaskfld.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/pmaskfld_member.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/pnew.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/pnewtype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/printfmt.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ptrary.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/reftype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/rowid.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/smallstr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/sortfld.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/sorttype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/sqltype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ssimfile.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ssimreq.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ssimsort.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/ssimvolatile.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/steptype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/strfmt.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/strtype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/substr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/svtype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/tary.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/thash.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/tracefld.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/tracerec.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/typefld.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/usertracefld.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/dmmeta/xref.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/fmdb/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/fmdb/alarm.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/fmdb/alm_code.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/fmdb/alm_objtype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/fmdb/alm_source.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gact.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gatv.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gclicmd.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gclicmdf2j.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gclicmdt.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gclienv.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gclienvsub.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gclisub.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gfld.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/githost.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gmethod.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/grepo.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/grepogitport.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/grepossh.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gstate.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gstatet.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gtbl.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gtblact.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gtblactfld.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gtblacttst.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gtblacttstout.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gtype.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gtypeh.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/gtypeprefix.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/issue.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/issuenote.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/issuepipeline.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/label.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/milestone.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/mr.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/mrjob.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/mrnote.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/project.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/ssimdb/gclidb/user.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/tut/README.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/tut/tut1.md inl:N sandbox:Y filter:bin/abt_md_filt comment:"" -dev.readme gitfile:txt/tut/tut2.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/tut/tut3.md inl:N sandbox:Y filter:bin/abt_md_filt comment:"" -dev.readme gitfile:txt/tut/tut4.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/tut/tut5.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/tut/tut6.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/tut/tut7.md inl:N sandbox:N filter:"" comment:"" -dev.readme gitfile:txt/tut/tut8.md inl:N sandbox:Y filter:bin/abt_md_filt comment:"" diff --git a/data/dev/readmefile.ssim b/data/dev/readmefile.ssim new file mode 100644 index 00000000..0487cafb --- /dev/null +++ b/data/dev/readmefile.ssim @@ -0,0 +1,513 @@ +dev.readmefile gitfile:txt/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/abt/README.md inl:N sandbox:N filter:abt_md_filt comment:"" +dev.readmefile gitfile:txt/exe/abt/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/abt_md/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/abt_md/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr/relnotes.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr_compl/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr_compl/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr_dm/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr_dm/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr_ed/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr_ed/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr_in/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr_in/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr_my/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/acr_my/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/enum.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/exec.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/fbuf.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/intro.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/pmask.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/pools.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/proto.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/reflection.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/reftypes.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/relnotes.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/runtime.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/strings.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc/xref.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc_gc/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc_gc/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc_vis/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/amc_vis/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/ams_sendtest/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/ams_sendtest/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/apm/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/apm/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/aqlite/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/aqlite/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_amc/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_amc/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_ci/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_ci/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_cmdline/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_cmdline/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_comp/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_comp/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_cov/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_cov/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_exp/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_exp/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_fuzz/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_fuzz/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_gcli/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_gcli/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_nrun/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_nrun/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_unit/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/atf_unit/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/bash2html/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/bash2html/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/coding-style.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/gcache/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/gcache/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/gcli/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/gcli/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/jkv/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/jkv/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/mdbg/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/mdbg/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/mysql2ssim/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/mysql2ssim/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/orgfile/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/orgfile/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/samp_make/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/samp_make/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/samp_meng/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/samp_meng/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/samp_regx/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/samp_regx/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/sandbox/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/sandbox/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/src_func/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/src_func/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/src_hdr/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/src_hdr/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/src_lim/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/src_lim/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/ssim2csv/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/ssim2csv/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/ssim2mysql/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/ssim2mysql/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/ssimfilt/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/ssimfilt/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/strconv/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/strconv/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/sv2ssim/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/exe/sv2ssim/internals.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/algo_lib/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_amcdb/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_ams/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_ctype/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_curl/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_exec/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_fm/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_git/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_http/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_iconv/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_json/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_mysql/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_netio/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_prot/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_rl/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_sql/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_sqlite/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/lib/lib_ws/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Attr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Bool.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Charset.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Comment.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/CppExpr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/DateCache.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Decimal.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/DirEntry.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Errcode.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Errns.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Fildes.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/FileFlags.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/IOEvtFlags.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/IPoint.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Imtable.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Ipmask.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/LineBuf.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Md5Digest.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Month.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/NumParseFlags.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/PrlogFcn.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/SchedTime.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/SeqType.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Sha1sig.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/TFNNtTestAlert.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/TermStyle.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/TextJust.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/TstampCache.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/Tuple.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/URL.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/UnDiff.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/UnTime.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/UnixDiff.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/UnixTime.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/cstring.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/memptr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/algo/strptr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/ams/ExpectMsg.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/ams/InputLineMsg.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/ams/LogMsg.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/ams/MsgBlock.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/ams/MsgHeader.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/ams/ProcId.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/ams/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/ams/TerminateMsg.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/ams/UdpFrame.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/atf/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/command/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/fm/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/http/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/ietf/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/js/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/kafka/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/report/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/protocol/ws/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/recipe/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/abt_md_filt.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/ai.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/alexei-setup-soft-links.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/bash-indent.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/break-long-lines.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/check-json.mjs.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/ci-show-log.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/core-decode.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/cpp-indent.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/delete-duplicate-lines.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/diff-to-errlist.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/edit-conflicts.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/em.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/errlist.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/ff.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/filt-gc.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/find-non-copyrighted.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/fix-gen-conflicts.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-add-to-last-commit.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-branch-gc.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-checkout-master.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-clean-branches.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-commits-per-user.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-current-ref.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-diff-annotate.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-grep-reflog.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-mdiff.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-mod-plot.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-praise.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-rebase-origin.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-rebase-remote.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-recent-branches.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-rollback-file.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/git-update-config.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/gitconfig-setup.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/grephunk.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/hilite-error.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/hilite.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/limit-output.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/lines-to-dots.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/lsfunc.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/msloc.pl.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/normalize.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/normalize_loop.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/open-link.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/revert-executable.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/select-bootstrap.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/sha1.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/sloc.pl.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/sortwrap.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/stepper.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/tags.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/targ-diff.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/test-orgfile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/timestamps.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/toamc.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/todo.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/update-gitfile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/update-hdr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/update-scriptfile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/vscode-select-debug-target.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/script/zfs_snapshot.pl.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/setup.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssim.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/amcdb/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/amcdb/bltin.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/amcdb/curstype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/amcdb/gen.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/amcdb/regxtype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/amcdb/tclass.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/amcdb/tcurs.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/amcdb/tfunc.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/amsdb/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/amsdb/proctype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/amsdb/shmtype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/amctest.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/cijob.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/cipackage.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/citest.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/comptest.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/fuzzstrat.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/msgdir.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/targs.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/test_gsymbol_char.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/test_gsymbol_pkey.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/test_gsymbol_strptr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/tfilt.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/tmsg.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/unittest.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/atfdb/var.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/arch.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/badline.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/builddir.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/cfg.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/compiler.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/copyright.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/covfile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/covline.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/covtarget.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/edaction.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/edacttype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/gitfile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/gitinfo.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/hilite.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/htmlentity.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/include.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/license.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/linelim.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/mdmark.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/mdsection.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/msgfile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/netproto.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/noindent.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/opt_type.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/package.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/pkgdep.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/pkgkey.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/prototransport.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/readmefile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/readmesort.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/rpm.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/sandbox.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/sbpath.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/scriptfile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/srcfile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/syscmd.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/syscmddep.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/syslib.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/targdep.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/target.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/targsrc.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/targsyslib.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/tgtcov.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/timefmt.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/tool_opt.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/transport.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/uname.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dev/unstablefld.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/anonfld.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/argvtype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/basepool.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/bitfld.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/cafter.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/cascdel.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ccmp.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/cdflt.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/cextern.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/cfast.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/cfmt.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/cget.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/charset.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/chash.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ckafka.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/cppfunc.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/cppkeyword.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/cpptype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/csize.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/cstr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ctype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ctypelen.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/dispatch.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/dispatch_msg.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/dispctx.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/dispfilter.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/dispsig.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/dispsigcheck.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/disptrace.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/falias.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fastenc.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fastinstr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fastop.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fbase.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fbigend.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fbitset.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fbuf.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fbufdir.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fbufiotype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fbuftype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fcast.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fcleanup.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fcmap.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fcmdline.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fcmp.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fcompact.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fconst.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fcurs.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fdec.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fdelay.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ffast.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fflag.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/field.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/findrem.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/finput.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fkafka.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fldoffset.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/floadtuples.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fnoremove.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/foutput.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fprefix.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fregx.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fsort.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fstep.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ftrace.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ftuple.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/func.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/funique.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fuserinit.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/fwddecl.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/gconst.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/gstatic.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/gsymbol.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/hashtype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/hook.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/inlary.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/jstype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/kafka_type_kind.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/lenfld.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/listtype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/llist.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/logcat.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/main.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/msgtype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/nocascdel.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/nossimfile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/noxref.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ns.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/nscpp.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/nsdb.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/nsfast.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/nsinclude.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/nsjs.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/nsproto.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/nstype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/nsversion.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/nsx.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/numstr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/pack.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/pmaskfld.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/pmaskfld_member.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/pnew.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/pnewtype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/printfmt.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ptrary.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/reftype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/rowid.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/smallstr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/sortfld.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/sorttype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/sqltype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ssimfile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ssimreq.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ssimsort.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/ssimvolatile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/steptype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/strfmt.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/strtype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/substr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/svtype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/tary.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/thash.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/tracefld.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/tracerec.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/typefld.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/userfunc.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/usertracefld.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/dmmeta/xref.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/fmdb/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/fmdb/alarm.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/fmdb/alm_code.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/fmdb/alm_objtype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/fmdb/alm_source.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gact.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gatv.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gclicmd.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gclicmdf2j.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gclicmdt.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gclienv.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gclienvsub.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gclisub.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gfld.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/githost.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gmethod.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/grepo.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gstate.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gstatet.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gtbl.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gtblact.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gtblactfld.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gtblacttst.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gtblacttstout.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gtype.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gtypeh.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/gtypeprefix.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/issue.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/issuenote.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/issuepipeline.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/label.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/milestone.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/mr.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/mrjob.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/mrnote.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/project.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/gclidb/user.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/httpdb/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/httpdb/content.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/httpdb/header.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/httpdb/method.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/httpdb/status.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/httpdb/version.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/sampdb/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/sampdb/gitfile.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/sampdb/targdep.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/sampdb/target.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/sampdb/targrec.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/sampdb/targsrc.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/wsdb/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/ssimdb/wsdb/status.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/tut/README.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/tut/tut1.md inl:N sandbox:Y filter:bin/abt_md_filt comment:"" +dev.readmefile gitfile:txt/tut/tut2.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/tut/tut3.md inl:N sandbox:Y filter:bin/abt_md_filt comment:"" +dev.readmefile gitfile:txt/tut/tut4.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/tut/tut5.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/tut/tut6.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/tut/tut7.md inl:N sandbox:N filter:"" comment:"" +dev.readmefile gitfile:txt/tut/tut8.md inl:N sandbox:Y filter:bin/abt_md_filt comment:"" +dev.readmefile gitfile:txt/tut/tut9_make.md inl:N sandbox:Y filter:"" comment:"" diff --git a/data/dev/readmesort.ssim b/data/dev/readmesort.ssim index 0a84ac3a..7878bca1 100644 --- a/data/dev/readmesort.ssim +++ b/data/dev/readmesort.ssim @@ -10,3 +10,5 @@ dev.readmesort readmesort:txt/exe comment:"" dev.readmesort readmesort:txt/lib comment:"" dev.readmesort readmesort:txt/protocol comment:"" dev.readmesort readmesort:txt/script comment:"" +dev.readmesort readmesort:txt/ts comment:"" +dev.readmesort readmesort:txt/www comment:"" diff --git a/data/dev/rpm.ssim b/data/dev/rpm.ssim new file mode 100644 index 00000000..2d0ebe2d --- /dev/null +++ b/data/dev/rpm.ssim @@ -0,0 +1,11 @@ +dev.rpm rpm:cppcheck comment:"Used by CI" +dev.rpm rpm:libcurl4-openssl-dev comment:"" +dev.rpm rpm:liblz4-dev comment:"" +dev.rpm rpm:libmariadb-dev comment:"" +dev.rpm rpm:libmariadbd-dev comment:"" +dev.rpm rpm:libssl-dev comment:"" +dev.rpm rpm:llvm comment:"only needed if LLVM is used" +dev.rpm rpm:llvm-dev comment:"" +dev.rpm rpm:mariadb-client comment:"" +dev.rpm rpm:mariadb-server comment:"" +dev.rpm rpm:uuid-dev comment:"" diff --git a/data/dev/scriptfile.ssim b/data/dev/scriptfile.ssim index cc71e06f..a3381b84 100644 --- a/data/dev/scriptfile.ssim +++ b/data/dev/scriptfile.ssim @@ -1,8 +1,11 @@ dev.scriptfile gitfile:bin/abt_md_filt license:GPL comment:"Eliminate unstable fields from inline-command output" dev.scriptfile gitfile:bin/ai license:GPL comment:"Bootstrapped compilation script" dev.scriptfile gitfile:bin/alexei-setup-soft-links license:GPL comment:"" +dev.scriptfile gitfile:bin/bash-indent license:GPL comment:"bash formatting with shfmt" dev.scriptfile gitfile:bin/break-long-lines license:GPL comment:"Read input and break long lines into multiple lines" -dev.scriptfile gitfile:bin/ci-show-log license:GPL comment:"Fetch gitlab runner output for current issue" +dev.scriptfile gitfile:bin/check-json.mjs license:"" comment:"" +dev.scriptfile gitfile:bin/ci-show-log license:GPL comment:"Fetch gitlab-runner output for current issue" +dev.scriptfile gitfile:bin/core-decode license:"" comment:"" dev.scriptfile gitfile:bin/cpp-indent license:GPL comment:"Indent specified files using emacs" dev.scriptfile gitfile:bin/delete-duplicate-lines license:GPL comment:"Read input and eliminate duplicate lines" dev.scriptfile gitfile:bin/diff-to-errlist license:GPL comment:"Read standard diff format on input and produce output suitable for errlist" @@ -10,10 +13,12 @@ dev.scriptfile gitfile:bin/edit-conflicts license:GPL comment:"Open any files dev.scriptfile gitfile:bin/em license:GPL comment:"Alias for 'emacs -nw'" dev.scriptfile gitfile:bin/errlist license:GPL comment:"Open error list in editor" dev.scriptfile gitfile:bin/ff license:GPL comment:"Find files and inside files" +dev.scriptfile gitfile:bin/filt-gc license:"" comment:"" dev.scriptfile gitfile:bin/find-non-copyrighted license:GPL comment:"Find any files with missing copyrights" dev.scriptfile gitfile:bin/fix-gen-conflicts license:GPL comment:"Auto-fix for git merge- or rebase-related conflicts by re-running generator" dev.scriptfile gitfile:bin/git-add-to-last-commit license:GPL comment:"Add any currently modified changes to the most recent commit" dev.scriptfile gitfile:bin/git-branch-gc license:GPL comment:"Attempt to rebase all branches and delete branches merged into HEAD" +dev.scriptfile gitfile:bin/git-checkout-master license:GPL comment:"" dev.scriptfile gitfile:bin/git-clean-branches license:GPL comment:"" dev.scriptfile gitfile:bin/git-commits-per-user license:GPL comment:"" dev.scriptfile gitfile:bin/git-current-ref license:GPL comment:"Print gitref of current HEAD" @@ -36,16 +41,22 @@ dev.scriptfile gitfile:bin/lines-to-dots license:GPL comment:"Read input and dev.scriptfile gitfile:bin/lsfunc license:GPL comment:"List all functions from all source files" dev.scriptfile gitfile:bin/msloc.pl license:GPL comment:"Word count statistics for non-generated source files" dev.scriptfile gitfile:bin/normalize license:GPL comment:"Run standard normalization tests" +dev.scriptfile gitfile:bin/normalize_loop license:"" comment:"" +dev.scriptfile gitfile:bin/open-link license:"" comment:"" +dev.scriptfile gitfile:bin/revert-executable license:"" comment:"" dev.scriptfile gitfile:bin/select-bootstrap license:GPL comment:"" dev.scriptfile gitfile:bin/sha1 license:GPL comment:"" dev.scriptfile gitfile:bin/sloc.pl license:GPL comment:"Word count statistics for specified list of source files" +dev.scriptfile gitfile:bin/sortwrap license:GPL comment:"run a command and its stdout using sort(1)" +dev.scriptfile gitfile:bin/stepper license:"" comment:"Allow user to interactively edit each line from stdin before sending to stdout" dev.scriptfile gitfile:bin/tags license:GPL comment:"" dev.scriptfile gitfile:bin/targ-diff license:GPL comment:"Show changes in TARG's source code between this branch and REF" dev.scriptfile gitfile:bin/test-orgfile license:GPL comment:"" dev.scriptfile gitfile:bin/timestamps license:GPL comment:"Read input and timestamp each line" dev.scriptfile gitfile:bin/toamc license:GPL comment:"Try to extract amc schema from specified C++ file" dev.scriptfile gitfile:bin/todo license:GPL comment:"" -dev.scriptfile gitfile:bin/update-gitfile license:GPL comment:"" -dev.scriptfile gitfile:bin/update-hdr license:GPL comment:"" -dev.scriptfile gitfile:bin/update-scriptfile license:GPL comment:"" +dev.scriptfile gitfile:bin/update-gitfile license:GPL comment:"Update dev.gitfile table" +dev.scriptfile gitfile:bin/update-hdr license:GPL comment:"Update copyright headers in all sources" +dev.scriptfile gitfile:bin/update-scriptfile license:GPL comment:"Update dev.scriptfile table from git" +dev.scriptfile gitfile:bin/vscode-select-debug-target license:"" comment:"" dev.scriptfile gitfile:bin/zfs_snapshot.pl license:GPL comment:"" diff --git a/data/dev/syslib.ssim b/data/dev/syslib.ssim index 148efad4..776de012 100644 --- a/data/dev/syslib.ssim +++ b/data/dev/syslib.ssim @@ -1,14 +1,18 @@ dev.syslib syslib:GL comment:"Mesa libGL development package" dev.syslib syslib:GLU comment:"Development files for mesa-libGLU" +dev.syslib syslib:aio comment:"" dev.syslib syslib:crypt comment:"Object files for development using standard C libraries." dev.syslib syslib:crypto comment:"Files for development of applications which will use OpenSSL" dev.syslib syslib:curl comment:"Files needed for building applications with libcurl" dev.syslib syslib:dl comment:"Object files for development using standard C libraries." dev.syslib syslib:execinfo comment:"FreeBSD library providing backtrace()" +dev.syslib syslib:fuse3 comment:"" dev.syslib syslib:glut comment:"Freeglut developmental libraries and header files" dev.syslib syslib:history comment:"Files needed to develop programs which use the readline library" +dev.syslib syslib:ibverbs comment:"Infiniband verbs API" +dev.syslib syslib:keyutils comment:"" dev.syslib syslib:lz4 comment:"LZ4 - Extremely fast compression library" -dev.syslib syslib:m comment:"Object files for development using standard C libraries." +dev.syslib syslib:m comment:"" dev.syslib syslib:mariadb comment:"" dev.syslib syslib:mysqlclient comment:"" dev.syslib syslib:nl comment:"Libraries and headers for using libnl" @@ -18,9 +22,15 @@ dev.syslib syslib:nsl comment:"Object files for development using standard C l dev.syslib syslib:numa comment:"Development package for building Applications that use numa" dev.syslib syslib:odbc comment:"A complete ODBC driver manager for Linux" dev.syslib syslib:pthread comment:"Object files for development using standard C libraries." -dev.syslib syslib:rdmacm comment:"Development files for the librdmacm library" +dev.syslib syslib:rdmacm comment:"RDMA CM API" dev.syslib syslib:readline comment:"Files needed to develop programs which use the readline library" dev.syslib syslib:rt comment:"Object files for development using standard C libraries." +dev.syslib syslib:rte_bus_pci comment:"" +dev.syslib syslib:rte_eal comment:"" +dev.syslib syslib:rte_mempool comment:"" +dev.syslib syslib:rte_ring comment:"" +dev.syslib syslib:sqlite3 comment:"" dev.syslib syslib:ssl comment:"Files for development of applications which will use OpenSSL" +dev.syslib syslib:stdc++ comment:"" dev.syslib syslib:tinyxml2 comment:"XML toolkit" dev.syslib syslib:uuid comment:"Universally unique ID library" diff --git a/data/dev/targdep.ssim b/data/dev/targdep.ssim index 11e08eb2..633038af 100644 --- a/data/dev/targdep.ssim +++ b/data/dev/targdep.ssim @@ -10,12 +10,11 @@ dev.targdep targdep:acr_ed.algo_lib comment:"" dev.targdep targdep:acr_ed.lib_prot comment:"" dev.targdep targdep:acr_in.algo_lib comment:"" dev.targdep targdep:acr_my.algo_lib comment:"" +dev.targdep targdep:algo_lib.lib_json comment:"" dev.targdep targdep:amc.algo_lib comment:"" dev.targdep targdep:amc.lib_amcdb comment:"" dev.targdep targdep:amc_gc.algo_lib comment:"" dev.targdep targdep:amc_vis.algo_lib comment:"" -dev.targdep targdep:ams_cat.algo_lib comment:"" -dev.targdep targdep:ams_cat.lib_ams comment:"" dev.targdep targdep:ams_sendtest.algo_lib comment:"" dev.targdep targdep:ams_sendtest.lib_ams comment:"" dev.targdep targdep:apm.algo_lib comment:"" @@ -38,41 +37,55 @@ dev.targdep targdep:atf_comp.algo_lib comment:"" dev.targdep targdep:atf_comp.lib_ctype comment:"" dev.targdep targdep:atf_comp.lib_prot comment:"" dev.targdep targdep:atf_cov.algo_lib comment:"" +dev.targdep targdep:atf_exp.algo_lib comment:"" +dev.targdep targdep:atf_exp.lib_prot comment:"" dev.targdep targdep:atf_fuzz.algo_lib comment:"" dev.targdep targdep:atf_fuzz.lib_prot comment:"" dev.targdep targdep:atf_gcli.algo_lib comment:"" dev.targdep targdep:atf_gcli.lib_prot comment:"" dev.targdep targdep:atf_nrun.algo_lib comment:"" dev.targdep targdep:atf_unit.lib_ams comment:"" +dev.targdep targdep:atf_unit.lib_curl comment:"" dev.targdep targdep:atf_unit.lib_exec comment:"" dev.targdep targdep:atf_unit.lib_fm comment:"" dev.targdep targdep:atf_unit.lib_json comment:"" +dev.targdep targdep:atf_unit.lib_netio comment:"" dev.targdep targdep:atf_unit.lib_sql comment:"" dev.targdep targdep:bash2html.algo_lib comment:"" dev.targdep targdep:gcache.algo_lib comment:"" dev.targdep targdep:gcli.algo_lib comment:"" dev.targdep targdep:gcli.lib_json comment:"" dev.targdep targdep:gcli.lib_prot comment:"" +dev.targdep targdep:jkv.algo_lib comment:"" +dev.targdep targdep:jkv.lib_json comment:"" +dev.targdep targdep:jkv.lib_prot comment:"" dev.targdep targdep:lib_amcdb.algo_lib comment:"" dev.targdep targdep:lib_ams.algo_lib comment:"" dev.targdep targdep:lib_ams.lib_prot comment:"" dev.targdep targdep:lib_ctype.algo_lib comment:"" dev.targdep targdep:lib_ctype.lib_amcdb comment:"" +dev.targdep targdep:lib_curl.algo_lib comment:"" +dev.targdep targdep:lib_curl.lib_prot comment:"" dev.targdep targdep:lib_exec.algo_lib comment:"" dev.targdep targdep:lib_fm.algo_lib comment:"" dev.targdep targdep:lib_fm.lib_prot comment:"" dev.targdep targdep:lib_git.algo_lib comment:"" -dev.targdep targdep:lib_iconv.algo_lib comment:"" -dev.targdep targdep:lib_json.algo_lib comment:"" -dev.targdep targdep:lib_mysql.algo_lib comment:"" -dev.targdep targdep:lib_prot.lib_json comment:"" +dev.targdep targdep:lib_http.algo_lib comment:"" +dev.targdep targdep:lib_http.lib_prot comment:"" +dev.targdep targdep:lib_netio.algo_lib comment:"" +dev.targdep targdep:lib_rl.algo_lib comment:"" +dev.targdep targdep:lib_rl.lib_prot comment:"" dev.targdep targdep:lib_sql.algo_lib comment:"" dev.targdep targdep:lib_sqlite.algo_lib comment:"" dev.targdep targdep:lib_sqlite.lib_prot comment:"" +dev.targdep targdep:lib_ws.algo_lib comment:"" +dev.targdep targdep:lib_ws.lib_prot comment:"" dev.targdep targdep:mdbg.algo_lib comment:"" dev.targdep targdep:mysql2ssim.algo_lib comment:"" dev.targdep targdep:mysql2ssim.lib_mysql comment:"" dev.targdep targdep:orgfile.algo_lib comment:"" +dev.targdep targdep:samp_make.algo_lib comment:"" +dev.targdep targdep:samp_make.lib_prot comment:"" dev.targdep targdep:samp_meng.algo_lib comment:"" dev.targdep targdep:samp_meng.lib_prot comment:"" dev.targdep targdep:samp_regx.algo_lib comment:"" diff --git a/data/dev/target.ssim b/data/dev/target.ssim index 1b31f4d4..949f6f84 100644 --- a/data/dev/target.ssim +++ b/data/dev/target.ssim @@ -11,7 +11,6 @@ dev.target target:algo_lib dev.target target:amc dev.target target:amc_gc dev.target target:amc_vis -dev.target target:ams_cat dev.target target:ams_sendtest dev.target target:apm dev.target target:aqlite @@ -20,6 +19,7 @@ dev.target target:atf_ci dev.target target:atf_cmdline dev.target target:atf_comp dev.target target:atf_cov +dev.target target:atf_exp dev.target target:atf_fuzz dev.target target:atf_gcli dev.target target:atf_nrun @@ -27,21 +27,30 @@ dev.target target:atf_unit dev.target target:bash2html dev.target target:gcache dev.target target:gcli +dev.target target:http +dev.target target:jkv +dev.target target:kafka dev.target target:lib_amcdb dev.target target:lib_ams dev.target target:lib_ctype +dev.target target:lib_curl dev.target target:lib_exec dev.target target:lib_fm dev.target target:lib_git +dev.target target:lib_http dev.target target:lib_iconv dev.target target:lib_json dev.target target:lib_mysql +dev.target target:lib_netio dev.target target:lib_prot +dev.target target:lib_rl dev.target target:lib_sql dev.target target:lib_sqlite +dev.target target:lib_ws dev.target target:mdbg dev.target target:mysql2ssim dev.target target:orgfile +dev.target target:samp_make dev.target target:samp_meng dev.target target:samp_regx dev.target target:sandbox diff --git a/data/dev/targsrc.ssim b/data/dev/targsrc.ssim index fd7cc31c..52859d6b 100644 --- a/data/dev/targsrc.ssim +++ b/data/dev/targsrc.ssim @@ -74,6 +74,8 @@ dev.targsrc targsrc:algo_lib/cpp/gen/report_gen.cpp comment:"" dev.targsrc targsrc:algo_lib/cpp/lib/algo/arg.cpp comment:"Parse command-line" dev.targsrc targsrc:algo_lib/cpp/lib/algo/backtrace.cpp comment:"Print stack trace in case of crash" dev.targsrc targsrc:algo_lib/cpp/lib/algo/base64.cpp comment:"base64 encoding" +dev.targsrc targsrc:algo_lib/cpp/lib/algo/bin_decode.cpp comment:"" +dev.targsrc targsrc:algo_lib/cpp/lib/algo/bin_encode.cpp comment:"" dev.targsrc targsrc:algo_lib/cpp/lib/algo/cpu_hz.cpp comment:"Grab cpu_hz from OS" dev.targsrc targsrc:algo_lib/cpp/lib/algo/crc32.cpp comment:"Software-based CRC32" dev.targsrc targsrc:algo_lib/cpp/lib/algo/decimal.cpp comment:"" @@ -87,12 +89,15 @@ dev.targsrc targsrc:algo_lib/cpp/lib/algo/lockfile.cpp comment:"Lock file" dev.targsrc targsrc:algo_lib/cpp/lib/algo/mmap.cpp comment:"Mmap wrapper" dev.targsrc targsrc:algo_lib/cpp/lib/algo/prlog.cpp comment:"prlog macro" dev.targsrc targsrc:algo_lib/cpp/lib/algo/regx.cpp comment:"Sql Regx implementation" +dev.targsrc targsrc:algo_lib/cpp/lib/algo/replscope.cpp comment:"" dev.targsrc targsrc:algo_lib/cpp/lib/algo/string.cpp comment:"cstring functions" dev.targsrc targsrc:algo_lib/cpp/lib/algo/time.cpp comment:"UnTime / UnDiff functions" dev.targsrc targsrc:algo_lib/cpp/lib/algo/timehook.cpp comment:"" dev.targsrc targsrc:algo_lib/cpp/lib/algo/tstamp.cpp comment:"timestamp cache" dev.targsrc targsrc:algo_lib/cpp/lib/algo/txttbl.cpp comment:"Ascii table" dev.targsrc targsrc:algo_lib/cpp/lib/algo/u128.cpp comment:"" +dev.targsrc targsrc:algo_lib/cpp/lib/algo/url.cpp comment:"" +dev.targsrc targsrc:algo_lib/cpp/lib/algo/uuid.cpp comment:"" dev.targsrc targsrc:algo_lib/cpp/lib/algo/win32.cpp comment:"" dev.targsrc targsrc:algo_lib/include/algo.h comment:"Main header" dev.targsrc targsrc:algo_lib/include/algo.inl.h comment:"Inline functions" @@ -107,10 +112,6 @@ dev.targsrc targsrc:algo_lib/include/gen/command_gen.h comment:"" dev.targsrc targsrc:algo_lib/include/gen/command_gen.inl.h comment:"" dev.targsrc targsrc:algo_lib/include/gen/dev_gen.h comment:"" dev.targsrc targsrc:algo_lib/include/gen/dev_gen.inl.h comment:"" -dev.targsrc targsrc:algo_lib/include/gen/dmmeta_gen.h comment:"" -dev.targsrc targsrc:algo_lib/include/gen/dmmeta_gen.inl.h comment:"" -dev.targsrc targsrc:algo_lib/include/gen/ietf_gen.h comment:"" -dev.targsrc targsrc:algo_lib/include/gen/ietf_gen.inl.h comment:"" dev.targsrc targsrc:algo_lib/include/gen/report_gen.h comment:"" dev.targsrc targsrc:algo_lib/include/gen/report_gen.inl.h comment:"" dev.targsrc targsrc:algo_lib/include/sha.h comment:"" @@ -137,7 +138,10 @@ dev.targsrc targsrc:amc/cpp/amc/delptr.cpp comment:"Delptr reftype" dev.targsrc targsrc:amc/cpp/amc/dflt.cpp comment:"Field default" dev.targsrc targsrc:amc/cpp/amc/disp/call.cpp comment:"Dispatch call" dev.targsrc targsrc:amc/cpp/amc/disp/casetype.cpp comment:"Dispatch casetype generator" +dev.targsrc targsrc:amc/cpp/amc/disp/del.cpp comment:"" dev.targsrc targsrc:amc/cpp/amc/disp/filter.cpp comment:"Dispatch filter" +dev.targsrc targsrc:amc/cpp/amc/disp/kafka_decode.cpp comment:"" +dev.targsrc targsrc:amc/cpp/amc/disp/kafka_encode.cpp comment:"" dev.targsrc targsrc:amc/cpp/amc/disp/main.cpp comment:"Dispatch main" dev.targsrc targsrc:amc/cpp/amc/disp/msg.cpp comment:"Dispatch on message" dev.targsrc targsrc:amc/cpp/amc/disp/print.cpp comment:"Dispatch print" @@ -160,6 +164,8 @@ dev.targsrc targsrc:amc/cpp/amc/hook.cpp comment:"Hook (function pointer)" dev.targsrc targsrc:amc/cpp/amc/include.cpp comment:"Manage includes for generated files" dev.targsrc targsrc:amc/cpp/amc/inlary.cpp comment:"Inline array" dev.targsrc targsrc:amc/cpp/amc/io.cpp comment:"I/O functions" +dev.targsrc targsrc:amc/cpp/amc/js.cpp comment:"" +dev.targsrc targsrc:amc/cpp/amc/kafka.cpp comment:"" dev.targsrc targsrc:amc/cpp/amc/lary.cpp comment:"Level array with permanent pointers" dev.targsrc targsrc:amc/cpp/amc/llist.cpp comment:"Linked lists" dev.targsrc targsrc:amc/cpp/amc/lpool.cpp comment:"Variable-length free pool" @@ -209,11 +215,6 @@ dev.targsrc targsrc:amc_vis/cpp/amc/amc_vis.cpp comment:"" dev.targsrc targsrc:amc_vis/cpp/gen/amc_vis_gen.cpp comment:"" dev.targsrc targsrc:amc_vis/include/gen/amc_vis_gen.h comment:"" dev.targsrc targsrc:amc_vis/include/gen/amc_vis_gen.inl.h comment:"" -dev.targsrc targsrc:ams_cat/cpp/ams/ams_cat.cpp comment:"" -dev.targsrc targsrc:ams_cat/cpp/gen/ams_cat_gen.cpp comment:"" -dev.targsrc targsrc:ams_cat/include/ams_cat.h comment:"" -dev.targsrc targsrc:ams_cat/include/gen/ams_cat_gen.h comment:"" -dev.targsrc targsrc:ams_cat/include/gen/ams_cat_gen.inl.h comment:"" dev.targsrc targsrc:ams_sendtest/cpp/ams_sendtest.cpp comment:"" dev.targsrc targsrc:ams_sendtest/cpp/gen/ams_sendtest_gen.cpp comment:"" dev.targsrc targsrc:ams_sendtest/include/ams_sendtest.h comment:"" @@ -279,6 +280,7 @@ dev.targsrc targsrc:atf_amc/cpp/gen/atf_amc_gen.cpp comment:"" dev.targsrc targsrc:atf_amc/include/atf_amc.h comment:"" dev.targsrc targsrc:atf_amc/include/gen/atf_amc_gen.h comment:"" dev.targsrc targsrc:atf_amc/include/gen/atf_amc_gen.inl.h comment:"" +dev.targsrc targsrc:atf_ci/cpp/atf_ci/abt_md.cpp comment:"" dev.targsrc targsrc:atf_ci/cpp/atf_ci/acr_ed.cpp comment:"" dev.targsrc targsrc:atf_ci/cpp/atf_ci/apm.cpp comment:"" dev.targsrc targsrc:atf_ci/cpp/atf_ci/bootstrap.cpp comment:"" @@ -307,12 +309,17 @@ dev.targsrc targsrc:atf_cov/cpp/gen/atf_cov_gen.cpp comment:"" dev.targsrc targsrc:atf_cov/include/atf_cov.h comment:"" dev.targsrc targsrc:atf_cov/include/gen/atf_cov_gen.h comment:"" dev.targsrc targsrc:atf_cov/include/gen/atf_cov_gen.inl.h comment:"" +dev.targsrc targsrc:atf_exp/cpp/atf_exp/atf_exp.cpp comment:"" +dev.targsrc targsrc:atf_exp/cpp/gen/atf_exp_gen.cpp comment:"" +dev.targsrc targsrc:atf_exp/include/atf_exp.h comment:"" +dev.targsrc targsrc:atf_exp/include/gen/atf_exp_gen.h comment:"" +dev.targsrc targsrc:atf_exp/include/gen/atf_exp_gen.inl.h comment:"" dev.targsrc targsrc:atf_fuzz/cpp/atf_fuzz/atf_fuzz.cpp comment:"" dev.targsrc targsrc:atf_fuzz/cpp/gen/atf_fuzz_gen.cpp comment:"" dev.targsrc targsrc:atf_fuzz/include/atf_fuzz.h comment:"" dev.targsrc targsrc:atf_fuzz/include/gen/atf_fuzz_gen.h comment:"" dev.targsrc targsrc:atf_fuzz/include/gen/atf_fuzz_gen.inl.h comment:"" -dev.targsrc targsrc:atf_gcli/cpp/atf/atf_gcli.cpp comment:"" +dev.targsrc targsrc:atf_gcli/cpp/atf_gcli/atf_gcli.cpp comment:"" dev.targsrc targsrc:atf_gcli/cpp/gen/atf_gcli_gen.cpp comment:"" dev.targsrc targsrc:atf_gcli/include/atf_gcli.h comment:"" dev.targsrc targsrc:atf_gcli/include/gen/atf_gcli_gen.h comment:"" @@ -332,8 +339,10 @@ dev.targsrc targsrc:atf_unit/cpp/atf_unit/charset.cpp comment:"" dev.targsrc targsrc:atf_unit/cpp/atf_unit/decimal.cpp comment:"" dev.targsrc targsrc:atf_unit/cpp/atf_unit/fm.cpp comment:"" dev.targsrc targsrc:atf_unit/cpp/atf_unit/lib_ams.cpp comment:"" +dev.targsrc targsrc:atf_unit/cpp/atf_unit/lib_curl.cpp comment:"" dev.targsrc targsrc:atf_unit/cpp/atf_unit/lib_exec.cpp comment:"" dev.targsrc targsrc:atf_unit/cpp/atf_unit/lib_json.cpp comment:"" +dev.targsrc targsrc:atf_unit/cpp/atf_unit/lib_netio.cpp comment:"" dev.targsrc targsrc:atf_unit/cpp/atf_unit/lib_sql.cpp comment:"" dev.targsrc targsrc:atf_unit/cpp/atf_unit/line.cpp comment:"" dev.targsrc targsrc:atf_unit/cpp/atf_unit/lockfile.cpp comment:"" @@ -373,6 +382,11 @@ dev.targsrc targsrc:gcli/cpp/gen/gcli_gen.cpp comment:"" dev.targsrc targsrc:gcli/include/gcli.h comment:"" dev.targsrc targsrc:gcli/include/gen/gcli_gen.h comment:"" dev.targsrc targsrc:gcli/include/gen/gcli_gen.inl.h comment:"" +dev.targsrc targsrc:jkv/cpp/gen/jkv_gen.cpp comment:"" +dev.targsrc targsrc:jkv/cpp/jkv/jkv.cpp comment:"" +dev.targsrc targsrc:jkv/include/gen/jkv_gen.h comment:"" +dev.targsrc targsrc:jkv/include/gen/jkv_gen.inl.h comment:"" +dev.targsrc targsrc:jkv/include/jkv.h comment:"" dev.targsrc targsrc:lib_amcdb/cpp/gen/amcdb_gen.cpp comment:"" dev.targsrc targsrc:lib_amcdb/cpp/gen/lib_amcdb_gen.cpp comment:"" dev.targsrc targsrc:lib_amcdb/cpp/lib_amcdb/lib_amcdb.cpp comment:"" @@ -382,17 +396,24 @@ dev.targsrc targsrc:lib_amcdb/include/gen/lib_amcdb_gen.h comment:"" dev.targsrc targsrc:lib_amcdb/include/gen/lib_amcdb_gen.inl.h comment:"" dev.targsrc targsrc:lib_amcdb/include/lib_amcdb.h comment:"" dev.targsrc targsrc:lib_ams/cpp/gen/lib_ams_gen.cpp comment:"" -dev.targsrc targsrc:lib_ams/cpp/lib_ams/expect.cpp comment:"Expect implementation" +dev.targsrc targsrc:lib_ams/cpp/lib_ams/dump.cpp comment:"" dev.targsrc targsrc:lib_ams/cpp/lib_ams/file.cpp comment:"" -dev.targsrc targsrc:lib_ams/cpp/lib_ams/stream.cpp comment:"" +dev.targsrc targsrc:lib_ams/cpp/lib_ams/shm.cpp comment:"" +dev.targsrc targsrc:lib_ams/cpp/lib_ams/shmember.cpp comment:"" dev.targsrc targsrc:lib_ams/include/gen/lib_ams_gen.h comment:"" dev.targsrc targsrc:lib_ams/include/gen/lib_ams_gen.inl.h comment:"" dev.targsrc targsrc:lib_ams/include/lib_ams.h comment:"" +dev.targsrc targsrc:lib_ams/include/lib_ams.inl.h comment:"" dev.targsrc targsrc:lib_ctype/cpp/gen/lib_ctype_gen.cpp comment:"" dev.targsrc targsrc:lib_ctype/cpp/lib/lib_ctype.cpp comment:"" dev.targsrc targsrc:lib_ctype/include/gen/lib_ctype_gen.h comment:"" dev.targsrc targsrc:lib_ctype/include/gen/lib_ctype_gen.inl.h comment:"" dev.targsrc targsrc:lib_ctype/include/lib_ctype.h comment:"" +dev.targsrc targsrc:lib_curl/cpp/gen/lib_curl_gen.cpp comment:"" +dev.targsrc targsrc:lib_curl/cpp/lib/lib_curl.cpp comment:"" +dev.targsrc targsrc:lib_curl/include/gen/lib_curl_gen.h comment:"" +dev.targsrc targsrc:lib_curl/include/gen/lib_curl_gen.inl.h comment:"" +dev.targsrc targsrc:lib_curl/include/lib_curl.h comment:"" dev.targsrc targsrc:lib_exec/cpp/gen/lib_exec_gen.cpp comment:"" dev.targsrc targsrc:lib_exec/cpp/lib/lib_exec.cpp comment:"" dev.targsrc targsrc:lib_exec/include/gen/lib_exec_gen.h comment:"" @@ -408,6 +429,11 @@ dev.targsrc targsrc:lib_git/cpp/lib/lib_git.cpp comment:"" dev.targsrc targsrc:lib_git/include/gen/lib_git_gen.h comment:"" dev.targsrc targsrc:lib_git/include/gen/lib_git_gen.inl.h comment:"" dev.targsrc targsrc:lib_git/include/lib_git.h comment:"" +dev.targsrc targsrc:lib_http/cpp/gen/lib_http_gen.cpp comment:"" +dev.targsrc targsrc:lib_http/cpp/lib_http/lib_http.cpp comment:"" +dev.targsrc targsrc:lib_http/include/gen/lib_http_gen.h comment:"" +dev.targsrc targsrc:lib_http/include/gen/lib_http_gen.inl.h comment:"" +dev.targsrc targsrc:lib_http/include/lib_http.h comment:"" dev.targsrc targsrc:lib_iconv/cpp/gen/lib_iconv_gen.cpp comment:"" dev.targsrc targsrc:lib_iconv/cpp/lib/lib_iconv.cpp comment:"" dev.targsrc targsrc:lib_iconv/include/gen/lib_iconv_gen.h comment:"" @@ -424,6 +450,12 @@ dev.targsrc targsrc:lib_mysql/cpp/lib/lib_mysql.cpp comment:"" dev.targsrc targsrc:lib_mysql/include/gen/lib_mysql_gen.h comment:"" dev.targsrc targsrc:lib_mysql/include/gen/lib_mysql_gen.inl.h comment:"" dev.targsrc targsrc:lib_mysql/include/lib_mysql.h comment:"" +dev.targsrc targsrc:lib_netio/cpp/gen/lib_netio_gen.cpp comment:"" +dev.targsrc targsrc:lib_netio/cpp/lib_netio/socket.cpp comment:"" +dev.targsrc targsrc:lib_netio/include/gen/lib_netio_gen.h comment:"" +dev.targsrc targsrc:lib_netio/include/gen/lib_netio_gen.inl.h comment:"" +dev.targsrc targsrc:lib_netio/include/lib_netio.h comment:"" +dev.targsrc targsrc:lib_netio/include/lib_netio.inl.h comment:"" dev.targsrc targsrc:lib_prot/cpp/gen/ams_gen.cpp comment:"" dev.targsrc targsrc:lib_prot/cpp/gen/amsdb_gen.cpp comment:"" dev.targsrc targsrc:lib_prot/cpp/gen/atf_gen.cpp comment:"" @@ -431,8 +463,14 @@ dev.targsrc targsrc:lib_prot/cpp/gen/atfdb_gen.cpp comment:"" dev.targsrc targsrc:lib_prot/cpp/gen/fm_gen.cpp comment:"" dev.targsrc targsrc:lib_prot/cpp/gen/fmdb_gen.cpp comment:"" dev.targsrc targsrc:lib_prot/cpp/gen/gclidb_gen.cpp comment:"" +dev.targsrc targsrc:lib_prot/cpp/gen/http_gen.cpp comment:"" +dev.targsrc targsrc:lib_prot/cpp/gen/httpdb_gen.cpp comment:"" dev.targsrc targsrc:lib_prot/cpp/gen/ietf_gen.cpp comment:"" +dev.targsrc targsrc:lib_prot/cpp/gen/kafka_gen.cpp comment:"" dev.targsrc targsrc:lib_prot/cpp/gen/lib_prot_gen.cpp comment:"" +dev.targsrc targsrc:lib_prot/cpp/gen/sampdb_gen.cpp comment:"" +dev.targsrc targsrc:lib_prot/cpp/gen/ws_gen.cpp comment:"" +dev.targsrc targsrc:lib_prot/cpp/gen/wsdb_gen.cpp comment:"" dev.targsrc targsrc:lib_prot/include/gen/ams_gen.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/ams_gen.inl.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/amsdb_gen.h comment:"" @@ -441,14 +479,33 @@ dev.targsrc targsrc:lib_prot/include/gen/atf_gen.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/atf_gen.inl.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/atfdb_gen.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/atfdb_gen.inl.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/dmmeta_gen.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/dmmeta_gen.inl.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/fm_gen.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/fm_gen.inl.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/fmdb_gen.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/fmdb_gen.inl.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/gclidb_gen.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/gclidb_gen.inl.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/http_gen.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/http_gen.inl.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/httpdb_gen.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/httpdb_gen.inl.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/ietf_gen.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/ietf_gen.inl.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/lib_prot_gen.h comment:"" dev.targsrc targsrc:lib_prot/include/gen/lib_prot_gen.inl.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/sampdb_gen.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/sampdb_gen.inl.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/ws_gen.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/ws_gen.inl.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/wsdb_gen.h comment:"" +dev.targsrc targsrc:lib_prot/include/gen/wsdb_gen.inl.h comment:"" +dev.targsrc targsrc:lib_rl/cpp/gen/lib_rl_gen.cpp comment:"" +dev.targsrc targsrc:lib_rl/cpp/lib_rl/lib_rl.cpp comment:"" +dev.targsrc targsrc:lib_rl/include/gen/lib_rl_gen.h comment:"" +dev.targsrc targsrc:lib_rl/include/gen/lib_rl_gen.inl.h comment:"" +dev.targsrc targsrc:lib_rl/include/lib_rl.h comment:"" dev.targsrc targsrc:lib_sql/cpp/gen/lib_sql_gen.cpp comment:"" dev.targsrc targsrc:lib_sql/cpp/lib/lib_sql.cpp comment:"" dev.targsrc targsrc:lib_sql/include/gen/lib_sql_gen.h comment:"" @@ -462,10 +519,16 @@ dev.targsrc targsrc:lib_sqlite/extern/sqlite-3500400/sqlite3.h comment:"" dev.targsrc targsrc:lib_sqlite/include/gen/lib_sqlite_gen.h comment:"" dev.targsrc targsrc:lib_sqlite/include/gen/lib_sqlite_gen.inl.h comment:"" dev.targsrc targsrc:lib_sqlite/include/lib_sqlite.h comment:"" +dev.targsrc targsrc:lib_ws/cpp/gen/lib_ws_gen.cpp comment:"" +dev.targsrc targsrc:lib_ws/cpp/lib_ws/lib_ws.cpp comment:"" +dev.targsrc targsrc:lib_ws/include/gen/lib_ws_gen.h comment:"" +dev.targsrc targsrc:lib_ws/include/gen/lib_ws_gen.inl.h comment:"" +dev.targsrc targsrc:lib_ws/include/lib_ws.h comment:"" dev.targsrc targsrc:mdbg/cpp/gen/mdbg_gen.cpp comment:"" dev.targsrc targsrc:mdbg/cpp/mdbg/mdbg.cpp comment:"" dev.targsrc targsrc:mdbg/include/gen/mdbg_gen.h comment:"" dev.targsrc targsrc:mdbg/include/gen/mdbg_gen.inl.h comment:"" +dev.targsrc targsrc:mdbg/include/mdbg.h comment:"" dev.targsrc targsrc:mysql2ssim/cpp/gen/mysql2ssim_gen.cpp comment:"" dev.targsrc targsrc:mysql2ssim/cpp/mysql2ssim.cpp comment:"" dev.targsrc targsrc:mysql2ssim/include/gen/mysql2ssim_gen.h comment:"" @@ -475,11 +538,16 @@ dev.targsrc targsrc:orgfile/cpp/orgfile.cpp comment:"" dev.targsrc targsrc:orgfile/include/gen/orgfile_gen.h comment:"" dev.targsrc targsrc:orgfile/include/gen/orgfile_gen.inl.h comment:"" dev.targsrc targsrc:orgfile/include/orgfile.h comment:"" +dev.targsrc targsrc:samp_make/cpp/gen/samp_make_gen.cpp comment:"" +dev.targsrc targsrc:samp_make/cpp/samp_make/samp_make.cpp comment:"" +dev.targsrc targsrc:samp_make/include/gen/samp_make_gen.h comment:"" +dev.targsrc targsrc:samp_make/include/gen/samp_make_gen.inl.h comment:"" +dev.targsrc targsrc:samp_make/include/samp_make.h comment:"" dev.targsrc targsrc:samp_meng/cpp/gen/samp_meng_gen.cpp comment:"" -dev.targsrc targsrc:samp_meng/cpp/samp_meng/samp_meng.cpp comment:"" +dev.targsrc targsrc:samp_meng/cpp/samp_meng/samp_meng.cpp comment:"Main source" dev.targsrc targsrc:samp_meng/include/gen/samp_meng_gen.h comment:"" dev.targsrc targsrc:samp_meng/include/gen/samp_meng_gen.inl.h comment:"" -dev.targsrc targsrc:samp_meng/include/samp_meng.h comment:"" +dev.targsrc targsrc:samp_meng/include/samp_meng.h comment:"Main header" dev.targsrc targsrc:samp_regx/cpp/gen/samp_regx_gen.cpp comment:"" dev.targsrc targsrc:samp_regx/cpp/samp_regx/samp_regx.cpp comment:"" dev.targsrc targsrc:samp_regx/include/gen/samp_regx_gen.h comment:"" diff --git a/data/dev/targsyslib.ssim b/data/dev/targsyslib.ssim index 138e3cb2..ab78c409 100644 --- a/data/dev/targsyslib.ssim +++ b/data/dev/targsyslib.ssim @@ -1,19 +1,29 @@ +dev.targsyslib targsyslib:Darwin/algo_lib.stdc++ comment:"" dev.targsyslib targsyslib:Darwin/amc.crypto comment:"" dev.targsyslib targsyslib:Darwin/amc.ssl comment:"" dev.targsyslib targsyslib:Darwin/gcache.crypto comment:"" dev.targsyslib targsyslib:Darwin/gcli.curl comment:"" +dev.targsyslib targsyslib:Darwin/lib_curl.curl comment:"" dev.targsyslib targsyslib:Darwin/lib_mysql.mysqlclient comment:"" +dev.targsyslib targsyslib:Darwin/lib_ws.crypto comment:"" dev.targsyslib targsyslib:FreeBSD/algo_lib.execinfo comment:"" dev.targsyslib targsyslib:FreeBSD/amc.crypto comment:"" dev.targsyslib targsyslib:FreeBSD/gcache.crypto comment:"" dev.targsyslib targsyslib:FreeBSD/gcli.curl comment:"" +dev.targsyslib targsyslib:FreeBSD/lib_curl.curl comment:"" dev.targsyslib targsyslib:FreeBSD/lib_mysql.mysqlclient comment:"" +dev.targsyslib targsyslib:FreeBSD/lib_ws.crypto comment:"" dev.targsyslib targsyslib:Linux/algo_lib.dl comment:"" dev.targsyslib targsyslib:Linux/algo_lib.m comment:"" +dev.targsyslib targsyslib:Linux/algo_lib.stdc++ comment:"" dev.targsyslib targsyslib:Linux/amc.crypto comment:"" dev.targsyslib targsyslib:Linux/amc.ssl comment:"" dev.targsyslib targsyslib:Linux/gcache.crypto comment:"" dev.targsyslib targsyslib:Linux/gcli.curl comment:"" dev.targsyslib targsyslib:Linux/lib_ams.lz4 comment:"" dev.targsyslib targsyslib:Linux/lib_ams.rt comment:"" +dev.targsyslib targsyslib:Linux/lib_curl.curl comment:"" dev.targsyslib targsyslib:Linux/lib_mysql.mariadb comment:"" +dev.targsyslib targsyslib:Linux/lib_rl.readline comment:"" +dev.targsyslib targsyslib:Linux/lib_sqlite.sqlite3 comment:"" +dev.targsyslib targsyslib:Linux/lib_ws.crypto comment:"" diff --git a/data/dev/tgtcov.ssim b/data/dev/tgtcov.ssim index dc32a28e..3460e481 100644 --- a/data/dev/tgtcov.ssim +++ b/data/dev/tgtcov.ssim @@ -1,55 +1,64 @@ -dev.tgtcov target:"" cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:abt cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:abt_md cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:acr cov_min:72.27 maxerr:1.00 comment:"" -dev.tgtcov target:acr_compl cov_min:79.12 maxerr:1.00 comment:"" -dev.tgtcov target:acr_dm cov_min:82.17 maxerr:1.00 comment:"" -dev.tgtcov target:acr_ed cov_min:17.88 maxerr:1.00 comment:"" -dev.tgtcov target:acr_in cov_min:53.47 maxerr:1.00 comment:"" -dev.tgtcov target:acr_my cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:algo_lib cov_min:41.91 maxerr:1.00 comment:"" -dev.tgtcov target:amc cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:amc_gc cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:amc_vis cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:ams_cat cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:ams_sendtest cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:apm cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:aqlite cov_min:97.22 maxerr:1.00 comment:"" -dev.tgtcov target:atf_amc cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:atf_ci cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:atf_cmdline cov_min:96.97 maxerr:1.00 comment:"" -dev.tgtcov target:atf_comp cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:atf_cov cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:atf_fuzz cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:atf_gcli cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:atf_nrun cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:atf_unit cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:bash2html cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:gcache cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:gcli cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:lib_amcdb cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:lib_ams cov_min:0.00 maxerr:2.00 comment:"" -dev.tgtcov target:lib_ctype cov_min:26.79 maxerr:1.00 comment:"" -dev.tgtcov target:lib_exec cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:lib_fm cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:lib_git cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:lib_iconv cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:lib_json cov_min:1.80 maxerr:1.00 comment:"" -dev.tgtcov target:lib_mysql cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:lib_prot cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:lib_sql cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:lib_sqlite cov_min:82.00 maxerr:1.00 comment:"" -dev.tgtcov target:mdbg cov_min:82.63 maxerr:1.00 comment:"" -dev.tgtcov target:mysql2ssim cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:orgfile cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:samp_meng cov_min:94.74 maxerr:0.00 comment:"" -dev.tgtcov target:samp_regx cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:sandbox cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:src_func cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:src_hdr cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:src_lim cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:ssim2csv cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:ssim2mysql cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:ssimfilt cov_min:86.38 maxerr:1.00 comment:"" -dev.tgtcov target:strconv cov_min:0.00 maxerr:1.00 comment:"" -dev.tgtcov target:sv2ssim cov_min:87.15 maxerr:1.00 comment:"" +dev.tgtcov target:"" cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:abt cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:abt_md cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:acr cov_min:72.90 maxerr:5.00 comment:"" +dev.tgtcov target:acr_compl cov_min:79.12 maxerr:5.00 comment:"" +dev.tgtcov target:acr_dm cov_min:82.17 maxerr:5.00 comment:"" +dev.tgtcov target:acr_ed cov_min:34.30 maxerr:5.00 comment:"" +dev.tgtcov target:acr_in cov_min:53.47 maxerr:5.00 comment:"" +dev.tgtcov target:acr_my cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:algo_lib cov_min:40.89 maxerr:5.00 comment:"" +dev.tgtcov target:amc cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:amc_gc cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:amc_vis cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:ams_sendtest cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:apm cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:aqlite cov_min:100.00 maxerr:5.00 comment:"" +dev.tgtcov target:atf_amc cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:atf_ci cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:atf_cmdline cov_min:96.97 maxerr:5.00 comment:"" +dev.tgtcov target:atf_comp cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:atf_cov cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:atf_exp cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:atf_fuzz cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:atf_gcli cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:atf_nrun cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:atf_unit cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:bash2html cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:gcache cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:gcli cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:http cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:jkv cov_min:90.70 maxerr:5.00 comment:"" +dev.tgtcov target:kafka cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_amcdb cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_ams cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_ctype cov_min:26.79 maxerr:5.00 comment:"" +dev.tgtcov target:lib_curl cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_exec cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_fm cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_git cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_http cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_iconv cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_json cov_min:45.86 maxerr:5.00 comment:"" +dev.tgtcov target:lib_mysql cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_netio cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_prot cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_rl cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_sql cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:lib_sqlite cov_min:82.33 maxerr:5.00 comment:"" +dev.tgtcov target:lib_ws cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:mdbg cov_min:80.49 maxerr:5.00 comment:"" +dev.tgtcov target:mysql2ssim cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:orgfile cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:samp_make cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:samp_meng cov_min:94.74 maxerr:5.00 comment:"" +dev.tgtcov target:samp_regx cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:sandbox cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:src_func cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:src_hdr cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:src_lim cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:ssim2csv cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:ssim2mysql cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:ssimfilt cov_min:86.43 maxerr:5.00 comment:"" +dev.tgtcov target:strconv cov_min:0.00 maxerr:5.00 comment:"" +dev.tgtcov target:sv2ssim cov_min:87.29 maxerr:5.00 comment:"" diff --git a/data/dev/tool_opt.ssim b/data/dev/tool_opt.ssim index bc5609ad..6dc40c47 100644 --- a/data/dev/tool_opt.ssim +++ b/data/dev/tool_opt.ssim @@ -1,16 +1,15 @@ -dev.tool_opt tool_opt:"%-%.%-%/lib_sqlite-CC:-DSQLITE_DQS=0" comment:"" -dev.tool_opt tool_opt:"%-%.%-%/lib_sqlite-CC:-DSQLITE_THREADSAFE=0" comment:"" dev.tool_opt tool_opt:"%-%.%-%/lib_sqlite-CC:-DSQLITE_MAX_ATTACHED=30" comment:"" dev.tool_opt tool_opt:%-%.%-%/lib_sqlite-CC:-Iextern/sqlite-3500400 comment:"" +dev.tool_opt tool_opt:"%-%.%-%/lib_sqlite-CC:-DSQLITE_DQS=0" comment:"" +dev.tool_opt tool_opt:"%-%.%-%/lib_sqlite-CC:-DSQLITE_THREADSAFE=0" comment:"" dev.tool_opt tool_opt:%-%.%-%/lib_sqlite-CC:-Wno-implicit-fallthrough comment:"" dev.tool_opt tool_opt:"%-cl.%-x86_64/%-CC:/D AOS_SSE42" comment:"" dev.tool_opt tool_opt:"%-clang++.%-%/%-C:-x c" comment:"" +dev.tool_opt tool_opt:"%-clang++.%-%/%-CPP:-x c++" comment:"" dev.tool_opt tool_opt:%-clang++.%-%/%-CPP:-Wno-invalid-offsetof comment:"" -dev.tool_opt tool_opt:%-clang++.%-%/%-CC:-Wno-implicit-exception-spec-mismatch comment:"" dev.tool_opt tool_opt:%-clang++.%-%/%-HPP:-Wno-invalid-offsetof comment:"" dev.tool_opt tool_opt:%-clang++.%-%/%-CC:-ffunction-sections comment:"" dev.tool_opt tool_opt:%-clang++.%-%/%-CC:-Wsequence-point comment:"" -dev.tool_opt tool_opt:"%-clang++.%-%/%-CPP:-std=c++11" comment:"" dev.tool_opt tool_opt:%-clang++.%-%/%-CC:-Wno-multichar comment:"" dev.tool_opt tool_opt:%-clang++.%-%/%-CC:-Wshadow comment:"" dev.tool_opt tool_opt:%-clang++.%-%/%-CC:-pipe comment:"" @@ -24,6 +23,7 @@ dev.tool_opt tool_opt:%-clang++.%-%/algo_pch-CC:-Wno-error comment:"" dev.tool_opt tool_opt:%-clang++.%-%/%-CC:-Wno-missing-exception-spec comment:"" dev.tool_opt tool_opt:"%-clang++.%-%/%-CC:-iquote ." comment:"" dev.tool_opt tool_opt:%-clang++.%-%/%-CC:-Wno-vla comment:"" +dev.tool_opt tool_opt:%-clang++.%-%/%-CC:-fpch-preprocess comment:"" dev.tool_opt tool_opt:"%-clang++.%-%/%-CC:-c $srcfile" comment:"" dev.tool_opt tool_opt:"%-clang++.%-%/%-CC:-o $objpath" comment:"" dev.tool_opt tool_opt:"%-clang++.%-%/%-LINK:-o $outfile" comment:"" @@ -42,6 +42,7 @@ dev.tool_opt tool_opt:%-clang++.release-%/%-C:-Werror comment:"" dev.tool_opt tool_opt:%-clang++.release-%/%-HPP:-Werror comment:"" dev.tool_opt tool_opt:%-clang++.%-%/%-CC:-Wreinterpret-base-class comment:"Do not allow reinterpret_cast<> on base" dev.tool_opt tool_opt:"%-g++.%-%/%-C:-x c" comment:"" +dev.tool_opt tool_opt:"%-g++.%-%/%-CPP:-x c++" comment:"" dev.tool_opt tool_opt:%-g++.%-%/%-CPP:-Wno-invalid-offsetof comment:"" dev.tool_opt tool_opt:%-g++.%-%/%-HPP:-Wno-invalid-offsetof comment:"" dev.tool_opt tool_opt:%-g++.%-%/%-CC:-ffunction-sections comment:"" @@ -54,6 +55,8 @@ dev.tool_opt tool_opt:%-g++.%-%/%-CC:-pipe comment:"" dev.tool_opt tool_opt:%-g++.%-%/%-CC:-Wextra comment:"" dev.tool_opt tool_opt:%-g++.%-%/%-CC:-Winit-self comment:"" dev.tool_opt tool_opt:%-g++.%-%/%-CC:-Wmissing-include-dirs comment:"" +dev.tool_opt tool_opt:%-g++.%-%/%-CC:-Wno-missing-field-initializers comment:"" +dev.tool_opt tool_opt:%-g++.%-%/%-CC:-Wno-stringop-overflow comment:"" dev.tool_opt tool_opt:%-g++.%-%/%-CC:-Wmissing-declarations comment:"" dev.tool_opt tool_opt:%-g++.%-%/%-CC:-Winvalid-pch comment:"" dev.tool_opt tool_opt:"%-g++.%-%/%-CC:-iquote ." comment:"" @@ -79,6 +82,8 @@ dev.tool_opt tool_opt:%-g++.profile-%/%-LINK:-pg comment:"" dev.tool_opt tool_opt:%-g++.release-%/%-CC:-O3 comment:"" dev.tool_opt tool_opt:%-g++.%-%/%-CPP:-Werror comment:"" dev.tool_opt tool_opt:%-g++.%-%/%-C:-Werror comment:"" +dev.tool_opt tool_opt:%-g++.release-%/lib_kafka-CC:-O1 comment:"" +dev.tool_opt tool_opt:%-g++.release-%/lib_kafka-CC:-fno-ipa-icf comment:"" dev.tool_opt tool_opt:%-g++.%-%/%-HPP:-Werror comment:"" dev.tool_opt tool_opt:"Darwin-%.%-%/%-LINK:-L /usr/local/lib" comment:"" dev.tool_opt tool_opt:Darwin-g++.%-%/%-CC:-Wno-cast-function-type comment:"" @@ -100,4 +105,3 @@ dev.tool_opt tool_opt:Linux-g++.%-%/%-CC:-Wno-long-long comment:"" dev.tool_opt tool_opt:Linux-g++.%-%/%-CC:-Wno-cast-function-type comment:"" dev.tool_opt tool_opt:Linux-g++.coverage-%/%-LINK:--coverage comment:"" dev.tool_opt tool_opt:Linux-g++.%-%/%-LINK:-pthread comment:"" -dev.tool_opt tool_opt:Linux-g++.%-%/algo_lib-CC:-Wno-stringop-overflow comment:"" diff --git a/data/dev/transport.ssim b/data/dev/transport.ssim new file mode 100644 index 00000000..ef5e03ac --- /dev/null +++ b/data/dev/transport.ssim @@ -0,0 +1,4 @@ +dev.transport transport:ib_rc ip:N comment:"" +dev.transport transport:ib_ud ip:N comment:"" +dev.transport transport:tcp ip:Y comment:"" +dev.transport transport:udp ip:Y comment:"" diff --git a/data/dev/unstablefld.ssim b/data/dev/unstablefld.ssim index 311659db..e227e3da 100644 --- a/data/dev/unstablefld.ssim +++ b/data/dev/unstablefld.ssim @@ -1,8 +1,6 @@ -dev.unstablefld field:abt.config.builddir comment:"Compiler builddir" dev.unstablefld field:abt.config.cache comment:"" dev.unstablefld field:abt.config.ood_src comment:"" dev.unstablefld field:abt.config.ood_target comment:"" -dev.unstablefld field:ams.TraceInfo2Msg.tstamp comment:"" dev.unstablefld field:report.abt.hitrate comment:"Compiler cache hit rate" dev.unstablefld field:report.abt.n_install comment:"Number of executabes linked to bin/" dev.unstablefld field:report.abt.n_target comment:"Number of build targets considered" diff --git a/data/dmmeta/anonfld.ssim b/data/dmmeta/anonfld.ssim index e8e5d430..02f8210b 100644 --- a/data/dmmeta/anonfld.ssim +++ b/data/dmmeta/anonfld.ssim @@ -45,19 +45,23 @@ dmmeta.anonfld field:algo.U64Dec6.value comment:"" dmmeta.anonfld field:algo.U64Dec7.value comment:"" dmmeta.anonfld field:algo.U64Dec8.value comment:"" dmmeta.anonfld field:algo.U64Dec9.value comment:"" +dmmeta.anonfld field:algo_lib.RegxFlags.value comment:"" +dmmeta.anonfld field:algo_lib.RegxOp.op comment:"" +dmmeta.anonfld field:algo_lib.RegxStyle.value comment:"" dmmeta.anonfld field:amc.BltinId.value comment:"" dmmeta.anonfld field:amc.CppkeywordId.id comment:"" dmmeta.anonfld field:amc.Pnewtype.value comment:"" -dmmeta.anonfld field:ams.ProcType.value comment:"" -dmmeta.anonfld field:ams.StreamFlags.value comment:"" -dmmeta.anonfld field:ams.StreamType.value comment:"" +dmmeta.anonfld field:ams.Proctype.value comment:"" +dmmeta.anonfld field:ams.ShmFlags.value comment:"" +dmmeta.anonfld field:ams.ShmemberFlags.value comment:"" +dmmeta.anonfld field:ams.Shmtype.value comment:"" dmmeta.anonfld field:atf.Testresult.value comment:"" dmmeta.anonfld field:atf_amc.Ctype2AttrAnon.attr1 comment:"" dmmeta.anonfld field:atf_amc.Ctype2AttrAnon.attr2 comment:"" dmmeta.anonfld field:atf_amc.MsgLength.value comment:"" dmmeta.anonfld field:atf_amc.MsgType.value comment:"" dmmeta.anonfld field:command.abt.target comment:"" -dmmeta.anonfld field:command.abt_md.readme comment:"" +dmmeta.anonfld field:command.abt_md.readmefile comment:"" dmmeta.anonfld field:command.abt_md.section comment:"" dmmeta.anonfld field:command.acr.query comment:"" dmmeta.anonfld field:command.acr_dm.arg comment:"" @@ -83,6 +87,9 @@ dmmeta.anonfld field:command.bash_proc.bash comment:"" dmmeta.anonfld field:command.gcache.cmd comment:"Command to execute" dmmeta.anonfld field:command.gcli.fields comment:"" dmmeta.anonfld field:command.gcli.selector comment:"" +dmmeta.anonfld field:command.generic_proc.name comment:"" +dmmeta.anonfld field:command.jkv.file comment:"Filename (use - for stdin)" +dmmeta.anonfld field:command.jkv.kv comment:"" dmmeta.anonfld field:command.mdbg.args comment:"" dmmeta.anonfld field:command.mdbg.target comment:"" dmmeta.anonfld field:command.mysql2ssim.tables comment:"" @@ -91,11 +98,26 @@ dmmeta.anonfld field:command.samp_regx.expr comment:"Regx style" dmmeta.anonfld field:command.samp_regx.string comment:"" dmmeta.anonfld field:command.sandbox.cmd comment:"Command to execute in sandbox" dmmeta.anonfld field:command.sandbox.name comment:"" -dmmeta.anonfld field:command.src_func.body comment:"" -dmmeta.anonfld field:command.src_func.name comment:"" -dmmeta.anonfld field:command.src_func.target comment:"" +dmmeta.anonfld field:command.src_func.func comment:"" dmmeta.anonfld field:command.ssimfilt.match comment:"" dmmeta.anonfld field:command.ssimfilt.typetag comment:"" dmmeta.anonfld field:command.strconv.str comment:"String parameter" dmmeta.anonfld field:command.sv2ssim.fname comment:"" +dmmeta.anonfld field:http.HeaderType.value comment:"" +dmmeta.anonfld field:http.Method.value comment:"" +dmmeta.anonfld field:kafka.AclOperationType.value comment:"" +dmmeta.anonfld field:kafka.AclOperations.value comment:"" +dmmeta.anonfld field:kafka.AclPermissionType.value comment:"" +dmmeta.anonfld field:kafka.CompressionType.value comment:"" +dmmeta.anonfld field:kafka.ConfigSource.value comment:"" +dmmeta.anonfld field:kafka.ConfigType.value comment:"" +dmmeta.anonfld field:kafka.Error.value comment:"" +dmmeta.anonfld field:kafka.GroupState.value comment:"" +dmmeta.anonfld field:kafka.PatternType.value comment:"" +dmmeta.anonfld field:kafka.ResourceType.value comment:"" +dmmeta.anonfld field:kafka.TimestampType.value comment:"" dmmeta.anonfld field:samp_meng.I64Price8.value comment:"" +dmmeta.anonfld field:ws.HttpState.value comment:"" +dmmeta.anonfld field:ws.Opcode.value comment:"" +dmmeta.anonfld field:ws.Side.value comment:"" +dmmeta.anonfld field:ws.StatusCode.value comment:"" diff --git a/data/dmmeta/bitfld.ssim b/data/dmmeta/bitfld.ssim index 0bf9e955..855bbafb 100644 --- a/data/dmmeta/bitfld.ssim +++ b/data/dmmeta/bitfld.ssim @@ -17,13 +17,21 @@ dmmeta.bitfld field:algo.NumParseFlags.hex offset:4 width:1 srcfield:algo.Nu dmmeta.bitfld field:algo.NumParseFlags.neg offset:2 width:1 srcfield:algo.NumParseFlags.value comment:"" dmmeta.bitfld field:algo.NumParseFlags.ok offset:1 width:1 srcfield:algo.NumParseFlags.value comment:"" dmmeta.bitfld field:algo.NumParseFlags.overflow offset:3 width:1 srcfield:algo.NumParseFlags.value comment:"" -dmmeta.bitfld field:ams.StreamFlags.nonblock offset:3 width:1 srcfield:ams.StreamFlags.value comment:"" -dmmeta.bitfld field:ams.StreamFlags.read offset:2 width:1 srcfield:ams.StreamFlags.value comment:"" -dmmeta.bitfld field:ams.StreamFlags.trace_read offset:4 width:1 srcfield:ams.StreamFlags.value comment:"" -dmmeta.bitfld field:ams.StreamFlags.trace_text offset:7 width:1 srcfield:ams.StreamFlags.value comment:"" -dmmeta.bitfld field:ams.StreamFlags.trace_write offset:5 width:1 srcfield:ams.StreamFlags.value comment:"" -dmmeta.bitfld field:ams.StreamFlags.write offset:1 width:1 srcfield:ams.StreamFlags.value comment:"" -dmmeta.bitfld field:ams.StreamFlags.write_err offset:6 width:1 srcfield:ams.StreamFlags.value comment:"" +dmmeta.bitfld field:algo_lib.RegxFlags.accepts_all offset:4 width:1 srcfield:algo_lib.RegxFlags.value comment:"" +dmmeta.bitfld field:algo_lib.RegxFlags.capture offset:1 width:1 srcfield:algo_lib.RegxFlags.value comment:"" +dmmeta.bitfld field:algo_lib.RegxFlags.fullmatch offset:5 width:1 srcfield:algo_lib.RegxFlags.value comment:"" +dmmeta.bitfld field:algo_lib.RegxFlags.literal offset:3 width:1 srcfield:algo_lib.RegxFlags.value comment:"" +dmmeta.bitfld field:algo_lib.RegxFlags.trace offset:0 width:1 srcfield:algo_lib.RegxFlags.value comment:"" +dmmeta.bitfld field:algo_lib.RegxFlags.valid offset:2 width:1 srcfield:algo_lib.RegxFlags.value comment:"" +dmmeta.bitfld field:ams.ProcId.nodeidx offset:8 width:8 srcfield:ams.ProcId.value comment:"" +dmmeta.bitfld field:ams.ProcId.procidx offset:0 width:4 srcfield:ams.ProcId.value comment:"" +dmmeta.bitfld field:ams.ProcId.proctype offset:24 width:8 srcfield:ams.ProcId.value comment:"" +dmmeta.bitfld field:ams.ShmFlags.nonblock offset:3 width:1 srcfield:ams.ShmFlags.value comment:"" +dmmeta.bitfld field:ams.ShmFlags.read offset:2 width:1 srcfield:ams.ShmFlags.value comment:"" +dmmeta.bitfld field:ams.ShmFlags.write offset:1 width:1 srcfield:ams.ShmFlags.value comment:"" +dmmeta.bitfld field:ams.ShmFlags.write_err offset:6 width:1 srcfield:ams.ShmFlags.value comment:"" +dmmeta.bitfld field:ams.ShmemberFlags.r offset:0 width:1 srcfield:ams.ShmemberFlags.value comment:"" +dmmeta.bitfld field:ams.ShmemberFlags.w offset:1 width:1 srcfield:ams.ShmemberFlags.value comment:"" dmmeta.bitfld field:atf_amc.BitfldType1.bit1 offset:1 width:1 srcfield:atf_amc.BitfldType1.value comment:"" dmmeta.bitfld field:atf_amc.BitfldType1.bits5 offset:5 width:10 srcfield:atf_amc.BitfldType1.value comment:"" dmmeta.bitfld field:atf_amc.BitfldType2.bit0 offset:0 width:1 srcfield:atf_amc.BitfldType2.value comment:"" @@ -42,3 +50,26 @@ dmmeta.bitfld field:atf_amc.TypeBE64sf.bits52_45 offset:45 width:8 srcfield: dmmeta.bitfld field:atf_amc.TypeBE64sf.bits57_53 offset:53 width:5 srcfield:atf_amc.TypeBE64sf.value comment:"" dmmeta.bitfld field:atf_amc.TypeBE64sf.bits60_58 offset:58 width:3 srcfield:atf_amc.TypeBE64sf.value comment:"" dmmeta.bitfld field:atf_amc.TypeBE64sf.bits62_61 offset:61 width:2 srcfield:atf_amc.TypeBE64sf.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.ALL offset:2 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.ALTER offset:7 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.ALTER_CONFIGS offset:11 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.ANY offset:1 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.CLUSTER_ACTION offset:9 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.CREATE offset:5 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.CREATE_TOKENS offset:13 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.DELETE offset:6 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.DESCRIBE offset:8 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.DESCRIBE_CONFIGS offset:10 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.DESCRIBE_TOKENS offset:14 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.IDEMPOTENT_WRITE offset:12 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.OMITTED offset:31 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.READ offset:3 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.UNKNOWN offset:0 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:kafka.AclOperations.WRITE offset:4 width:1 srcfield:kafka.AclOperations.value comment:"" +dmmeta.bitfld field:ws.FrameHeader.fin offset:7 width:1 srcfield:ws.FrameHeader.byte0 comment:"" +dmmeta.bitfld field:ws.FrameHeader.mask offset:7 width:1 srcfield:ws.FrameHeader.byte1 comment:"" +dmmeta.bitfld field:ws.FrameHeader.opcode offset:0 width:4 srcfield:ws.FrameHeader.byte0 comment:"" +dmmeta.bitfld field:ws.FrameHeader.payload_len offset:0 width:7 srcfield:ws.FrameHeader.byte1 comment:"" +dmmeta.bitfld field:ws.FrameHeader.rsv1 offset:6 width:1 srcfield:ws.FrameHeader.byte0 comment:"" +dmmeta.bitfld field:ws.FrameHeader.rsv2 offset:5 width:1 srcfield:ws.FrameHeader.byte0 comment:"" +dmmeta.bitfld field:ws.FrameHeader.rsv3 offset:4 width:1 srcfield:ws.FrameHeader.byte0 comment:"" diff --git a/data/dmmeta/cascdel.ssim b/data/dmmeta/cascdel.ssim index 6b035231..ef2e6851 100644 --- a/data/dmmeta/cascdel.ssim +++ b/data/dmmeta/cascdel.ssim @@ -18,6 +18,5 @@ dmmeta.cascdel field:atf_amc.FTypeA.zdl_typeb comment:"" dmmeta.cascdel field:atf_comp.FComptest.c_targs comment:"" dmmeta.cascdel field:atf_comp.FComptest.c_tfilt comment:"" dmmeta.cascdel field:atf_comp.FComptest.zd_tmsg comment:"" -dmmeta.cascdel field:lib_ams.FProc.zd_member_byproc comment:"" dmmeta.cascdel field:lib_json.FNode.c_child comment:"" dmmeta.cascdel field:samp_meng.FOrdq.bh_order comment:"" diff --git a/data/dmmeta/ccmp.ssim b/data/dmmeta/ccmp.ssim index dca0544b..d53e3a12 100644 --- a/data/dmmeta/ccmp.ssim +++ b/data/dmmeta/ccmp.ssim @@ -7,6 +7,7 @@ dmmeta.ccmp ctype:acr_dm.Rowid extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:algo.Attr extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Comment extrn:N genop:N order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Decimal extrn:N genop:Y order:N minmax:N comment:"Exponent and mantissa exact match" +dmmeta.ccmp ctype:algo.Errcode extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Fildes extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:algo.LnumStr10_U64 extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.LnumStr11_U64 extrn:N genop:Y order:N minmax:N comment:"" @@ -126,14 +127,16 @@ dmmeta.ccmp ctype:algo.SeqType extrn:N genop:N order:Y minmax:N comment:"" dmmeta.ccmp ctype:algo.Sha1sig extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr1 extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr10 extrn:N genop:Y order:N minmax:N comment:"" -dmmeta.ccmp ctype:algo.Smallstr100 extrn:N genop:N order:N minmax:N comment:"" +dmmeta.ccmp ctype:algo.Smallstr100 extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr150 extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr16 extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr2 extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr20 extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr200 extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:algo.Smallstr249 extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr25 extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr250 extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:algo.Smallstr255 extrn:N genop:N order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr3 extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr30 extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr32 extrn:N genop:Y order:N minmax:N comment:"" @@ -142,6 +145,10 @@ dmmeta.ccmp ctype:algo.Smallstr40 extrn:N genop:Y order:N minmax:N comment dmmeta.ccmp ctype:algo.Smallstr5 extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.Smallstr50 extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:algo.Tuple extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:algo.U16Ary extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:algo.U32Ary extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:algo.U32LinearKey extrn:N genop:Y order:Y minmax:N comment:"" +dmmeta.ccmp ctype:algo.U64Ary extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:algo.UnDiff extrn:N genop:Y order:Y minmax:Y comment:"" dmmeta.ccmp ctype:algo.UnTime extrn:N genop:Y order:Y minmax:Y comment:"" dmmeta.ccmp ctype:algo.UnixDiff extrn:N genop:Y order:Y minmax:Y comment:"" @@ -155,11 +162,12 @@ dmmeta.ccmp ctype:algo.strptr extrn:Y genop:N order:Y minmax:N comment:"" dmmeta.ccmp ctype:amc.Enumstr extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:amc_vis.Linkkey extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:amc_vis.Nodekey extrn:N genop:Y order:Y minmax:N comment:"" -dmmeta.ccmp ctype:ams.Member extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:ams.ProcId extrn:N genop:Y order:N minmax:N comment:"" -dmmeta.ccmp ctype:ams.ProcType extrn:N genop:Y order:N minmax:N comment:"" -dmmeta.ccmp ctype:ams.StreamId extrn:N genop:Y order:N minmax:N comment:"" -dmmeta.ccmp ctype:ams.StreamType extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:ams.Proctype extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:ams.ShmId extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:ams.ShmemberFlags extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:ams.ShmemberId extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:ams.Shmtype extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:atf_amc.Cstr extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:atf_amc.Ctype1Attr extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:atf_amc.Ctype2Attr extrn:N genop:Y order:Y minmax:N comment:"" @@ -181,10 +189,10 @@ dmmeta.ccmp ctype:atf_unit.Cstr extrn:N genop:N order:Y minmax:N comment:" dmmeta.ccmp ctype:atf_unit.Dbl extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:atf_unit.TypeA extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:atf_unit.TypeB extrn:N genop:Y order:Y minmax:N comment:"" -dmmeta.ccmp ctype:bool extrn:Y genop:N order:Y minmax:N comment:"" -dmmeta.ccmp ctype:char extrn:Y genop:N order:Y minmax:N comment:"" -dmmeta.ccmp ctype:double extrn:Y genop:N order:Y minmax:Y comment:"" -dmmeta.ccmp ctype:float extrn:Y genop:N order:Y minmax:Y comment:"" +dmmeta.ccmp ctype:bool extrn:N genop:N order:Y minmax:N comment:"" +dmmeta.ccmp ctype:char extrn:N genop:N order:Y minmax:N comment:"" +dmmeta.ccmp ctype:double extrn:N genop:N order:Y minmax:Y comment:"" +dmmeta.ccmp ctype:float extrn:N genop:N order:Y minmax:Y comment:"" dmmeta.ccmp ctype:fm.Code extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:fm.Description extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:fm.Objinst extrn:N genop:Y order:N minmax:N comment:"" @@ -192,19 +200,24 @@ dmmeta.ccmp ctype:fm.Objtype extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:fm.Severity extrn:N genop:Y order:Y minmax:Y comment:"" dmmeta.ccmp ctype:fm.Source extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:fm.Summary extrn:N genop:Y order:N minmax:N comment:"" -dmmeta.ccmp ctype:i16 extrn:Y genop:N order:Y minmax:Y comment:"" -dmmeta.ccmp ctype:i32 extrn:Y genop:N order:Y minmax:Y comment:"" -dmmeta.ccmp ctype:i64 extrn:Y genop:N order:Y minmax:Y comment:"" -dmmeta.ccmp ctype:i8 extrn:Y genop:N order:Y minmax:Y comment:"" +dmmeta.ccmp ctype:i16 extrn:N genop:N order:Y minmax:Y comment:"" +dmmeta.ccmp ctype:i32 extrn:N genop:N order:Y minmax:Y comment:"" +dmmeta.ccmp ctype:i64 extrn:N genop:N order:Y minmax:Y comment:"" +dmmeta.ccmp ctype:i8 extrn:N genop:N order:Y minmax:Y comment:"" dmmeta.ccmp ctype:ietf.Ipport extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:ietf.Ipv4 extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:ietf.Ipv4Addr extrn:N genop:Y order:Y minmax:N comment:"" +dmmeta.ccmp ctype:kafka.ConfigSource extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:kafka.ConfigType extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:kafka.GroupState extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:kafka.PatternType extrn:N genop:Y order:N minmax:N comment:"" +dmmeta.ccmp ctype:kafka.ResourceType extrn:N genop:Y order:N minmax:N comment:"" dmmeta.ccmp ctype:lib_json.FldKey extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:samp_meng.I64Price8 extrn:N genop:Y order:Y minmax:Y comment:"" dmmeta.ccmp ctype:samp_meng.Ordkey extrn:N genop:Y order:Y minmax:N comment:"" dmmeta.ccmp ctype:samp_meng.Symbol extrn:N genop:Y order:N minmax:N comment:"" -dmmeta.ccmp ctype:u128 extrn:Y genop:N order:Y minmax:Y comment:"" -dmmeta.ccmp ctype:u16 extrn:Y genop:N order:Y minmax:Y comment:"" -dmmeta.ccmp ctype:u32 extrn:Y genop:N order:Y minmax:Y comment:"" -dmmeta.ccmp ctype:u64 extrn:Y genop:N order:Y minmax:Y comment:"" -dmmeta.ccmp ctype:u8 extrn:Y genop:N order:Y minmax:Y comment:"" +dmmeta.ccmp ctype:u128 extrn:N genop:N order:Y minmax:Y comment:"" +dmmeta.ccmp ctype:u16 extrn:N genop:N order:Y minmax:Y comment:"" +dmmeta.ccmp ctype:u32 extrn:N genop:N order:Y minmax:Y comment:"" +dmmeta.ccmp ctype:u64 extrn:N genop:N order:Y minmax:Y comment:"" +dmmeta.ccmp ctype:u8 extrn:N genop:N order:Y minmax:Y comment:"" diff --git a/data/dmmeta/cdflt.ssim b/data/dmmeta/cdflt.ssim index d5d6fbb6..4915053c 100644 --- a/data/dmmeta/cdflt.ssim +++ b/data/dmmeta/cdflt.ssim @@ -4,8 +4,16 @@ dmmeta.cdflt ctype:double dflt:0.0 cppdflt:0.0 ssimdflt:0.0 jsdflt:0 comme dmmeta.cdflt ctype:float dflt:0.f cppdflt:0.f ssimdflt:0.0 jsdflt:0 comment:"" dmmeta.cdflt ctype:i16 dflt:0 cppdflt:0 ssimdflt:0 jsdflt:0 comment:"" dmmeta.cdflt ctype:i32 dflt:0 cppdflt:0 ssimdflt:0 jsdflt:0 comment:"" -dmmeta.cdflt ctype:i64 dflt:0 cppdflt:0 ssimdflt:0 jsdflt:0 comment:"" +dmmeta.cdflt ctype:i64 dflt:0 cppdflt:0 ssimdflt:0 jsdflt:0n comment:"" dmmeta.cdflt ctype:i8 dflt:0 cppdflt:0 ssimdflt:0 jsdflt:0 comment:"" +dmmeta.cdflt ctype:js.Array dflt:"" cppdflt:"" ssimdflt:"" jsdflt:"[]" comment:"" +dmmeta.cdflt ctype:js.BigInt dflt:0 cppdflt:0 ssimdflt:0 jsdflt:0n comment:"" +dmmeta.cdflt ctype:js.Boolean dflt:false cppdflt:false ssimdflt:N jsdflt:false comment:"" +dmmeta.cdflt ctype:js.Null dflt:"" cppdflt:"" ssimdflt:"" jsdflt:null comment:"" +dmmeta.cdflt ctype:js.Number dflt:0 cppdflt:0 ssimdflt:0 jsdflt:0 comment:"" +dmmeta.cdflt ctype:js.Object dflt:"" cppdflt:"" ssimdflt:"" jsdflt:"" comment:"" +dmmeta.cdflt ctype:js.String dflt:"" cppdflt:"" ssimdflt:"" jsdflt:'""' comment:"" +dmmeta.cdflt ctype:js.Undefined dflt:"" cppdflt:"" ssimdflt:"" jsdflt:undefined comment:"" dmmeta.cdflt ctype:pid_t dflt:0 cppdflt:0 ssimdflt:0 jsdflt:0 comment:"" dmmeta.cdflt ctype:u128 dflt:0 cppdflt:0 ssimdflt:0 jsdflt:0n comment:"" dmmeta.cdflt ctype:u16 dflt:0 cppdflt:0 ssimdflt:0 jsdflt:0 comment:"" diff --git a/data/dmmeta/cextern.ssim b/data/dmmeta/cextern.ssim index cd6aa8e5..b9027f2f 100644 --- a/data/dmmeta/cextern.ssim +++ b/data/dmmeta/cextern.ssim @@ -1,12 +1,15 @@ dmmeta.cextern ctype:"" initmemset:N isstruct:N plaindata:N dmmeta.cextern ctype:DIR initmemset:N isstruct:N plaindata:Y dmmeta.cextern ctype:HANDLE initmemset:Y isstruct:N plaindata:Y +dmmeta.cextern ctype:LEVELDB initmemset:N isstruct:N plaindata:Y dmmeta.cextern ctype:MYSQL initmemset:N isstruct:N plaindata:Y dmmeta.cextern ctype:MYSQL_RES initmemset:N isstruct:N plaindata:Y dmmeta.cextern ctype:SQLHANDLE initmemset:N isstruct:N plaindata:Y dmmeta.cextern ctype:SQLINTEGER initmemset:N isstruct:N plaindata:Y dmmeta.cextern ctype:SQLLEN initmemset:N isstruct:N plaindata:Y dmmeta.cextern ctype:SQLUINTEGER initmemset:N isstruct:N plaindata:Y +dmmeta.cextern ctype:SSL initmemset:N isstruct:N plaindata:N +dmmeta.cextern ctype:SSL_CTX initmemset:N isstruct:N plaindata:N dmmeta.cextern ctype:ShStream initmemset:N isstruct:N plaindata:N dmmeta.cextern ctype:algo.ImdbGetTraceFcn initmemset:Y isstruct:N plaindata:Y dmmeta.cextern ctype:algo.ImdbInsertStrptrMaybeFcn initmemset:Y isstruct:N plaindata:Y @@ -29,8 +32,20 @@ dmmeta.cextern ctype:i16 initmemset:N isstruct:N plaindata:Y dmmeta.cextern ctype:i32 initmemset:N isstruct:N plaindata:Y dmmeta.cextern ctype:i64 initmemset:N isstruct:N plaindata:Y dmmeta.cextern ctype:i8 initmemset:N isstruct:N plaindata:Y +dmmeta.cextern ctype:ibv_ah initmemset:N isstruct:N plaindata:N +dmmeta.cextern ctype:ibv_context initmemset:N isstruct:N plaindata:N +dmmeta.cextern ctype:ibv_cq_ex initmemset:N isstruct:N plaindata:N +dmmeta.cextern ctype:ibv_device initmemset:N isstruct:N plaindata:N +dmmeta.cextern ctype:ibv_flow initmemset:N isstruct:N plaindata:N +dmmeta.cextern ctype:ibv_mr initmemset:N isstruct:N plaindata:N +dmmeta.cextern ctype:ibv_pd initmemset:N isstruct:N plaindata:N +dmmeta.cextern ctype:ibv_qp initmemset:N isstruct:N plaindata:N +dmmeta.cextern ctype:ibv_recv_wr initmemset:N isstruct:N plaindata:N +dmmeta.cextern ctype:ibv_sge initmemset:N isstruct:N plaindata:N dmmeta.cextern ctype:iconv_t initmemset:N isstruct:N plaindata:Y dmmeta.cextern ctype:pid_t initmemset:N isstruct:N plaindata:Y +dmmeta.cextern ctype:rdma_cm_id initmemset:N isstruct:N plaindata:N +dmmeta.cextern ctype:rdma_event_channel initmemset:N isstruct:N plaindata:N dmmeta.cextern ctype:sqlite3 initmemset:N isstruct:Y plaindata:N dmmeta.cextern ctype:sqlite3_vtab initmemset:N isstruct:Y plaindata:N dmmeta.cextern ctype:sqlite3_vtab_cursor initmemset:N isstruct:Y plaindata:N diff --git a/data/dmmeta/cfmt.ssim b/data/dmmeta/cfmt.ssim index e60950d3..13fc7961 100644 --- a/data/dmmeta/cfmt.ssim +++ b/data/dmmeta/cfmt.ssim @@ -19,6 +19,7 @@ dmmeta.cfmt cfmt:acr_compl.Shellqtype.String printfmt:Raw read:Y print:Y se dmmeta.cfmt cfmt:acr_dm.Rowid.String printfmt:Sep read:Y print:Y sep:.. genop:Y comment:"" dmmeta.cfmt cfmt:algo.Attr.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Bool.String printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo.ByteAry.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Charset.String printfmt:Extern read:Y print:N sep:, genop:Y comment:"Xa-j0-9- -> characters X,a,b,c,d,e,f,g,h,i,j,0,1,2,3,4,5,6,7,8,9,-" dmmeta.cfmt cfmt:algo.Comment.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.CppExpr.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" @@ -34,6 +35,7 @@ dmmeta.cfmt cfmt:algo.I32Dec2.String printfmt:Raw read:Y print:Y sep:"" ge dmmeta.cfmt cfmt:algo.I32Dec3.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.I32Dec4.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.I32Dec5.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo.I32RangeAry.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.I64Dec1.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.I64Dec10.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.I64Dec2.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" @@ -177,25 +179,32 @@ dmmeta.cfmt cfmt:algo.Smallstr16.String printfmt:Raw read:Y print:Y sep:"" dmmeta.cfmt cfmt:algo.Smallstr2.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Smallstr20.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Smallstr200.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo.Smallstr249.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Smallstr25.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Smallstr250.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo.Smallstr255.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Smallstr3.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Smallstr30.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Smallstr32.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Smallstr4.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Smallstr40.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Smallstr5.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo.Smallstr50.Json printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Smallstr50.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.StringAry.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.TermStyle.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.TextJust.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.Tuple.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo.U16Ary.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.U16Dec2.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo.U32Ary.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.U32Dec1.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.U32Dec2.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.U32Dec3.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.U32Dec4.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.U32Dec5.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo.U32LinearKey.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo.U64Ary.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.U64Dec10.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.U64Dec2.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.U64Dec4.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" @@ -215,6 +224,7 @@ dmmeta.cfmt cfmt:algo.WTime.String printfmt:Extern read:Y print:Y sep:"" g dmmeta.cfmt cfmt:algo.cstring.Json printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.cstring.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.i32_Range.String printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo.memptr.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo.strptr.Json printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo_lib.Bitset.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo_lib.Cmdline.Argv printfmt:Auto read:Y print:N sep:"" genop:N comment:"" @@ -227,19 +237,22 @@ dmmeta.cfmt cfmt:algo_lib.FTimehook.String printfmt:Tuple read:Y print:Y se dmmeta.cfmt cfmt:algo_lib.FTxttbl.String printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo_lib.Regx.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo_lib.RegxExpr.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo_lib.RegxFlags.String printfmt:Bitset read:Y print:Y sep:, genop:Y comment:"" +dmmeta.cfmt cfmt:algo_lib.RegxOp.String printfmt:Sep read:Y print:Y sep:,, genop:Y comment:"" dmmeta.cfmt cfmt:algo_lib.RegxParse.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo_lib.RegxState.String printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:algo_lib.RegxStyle.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo_lib.RegxToken.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo_lib.Replscope.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:algo_lib.Tabulate.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:amc.BltinId.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:amc.Enumstr.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:amc.Pnewtype.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:amc_vis.Link.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:amc_vis.Linkdep.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:amc_vis.FLink.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:amc_vis.FLinkdep.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:amc_vis.FOutrow.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:amc_vis.Linkkey.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:amc_vis.Nodekey.String printfmt:Sep read:N print:Y sep:.. genop:Y comment:"" -dmmeta.cfmt cfmt:amc_vis.Outrow.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:amcdb.Bltin.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:amcdb.Curstype.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:amcdb.Gen.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" @@ -247,39 +260,32 @@ dmmeta.cfmt cfmt:amcdb.Regxtype.String printfmt:Tuple read:Y print:Y sep:"" dmmeta.cfmt cfmt:amcdb.Tclass.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:amcdb.Tcurs.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:amcdb.Tfunc.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" -dmmeta.cfmt cfmt:ams.AlarmSyncMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.DfltStream.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.DumpStreamTableMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:ams.ExpectMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.HeartbeatMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:ams.InputLineMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.LogMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" -dmmeta.cfmt cfmt:ams.Member.String printfmt:Sep read:Y print:Y sep:/, genop:Y comment:"" +dmmeta.cfmt cfmt:ams.LogMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:ams.MsgBlock.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:ams.MsgHeader.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.OpenMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.PrlogMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.ProcAddMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.ProcId.String printfmt:Sep read:Y print:Y sep:- genop:Y comment:"" -dmmeta.cfmt cfmt:ams.ProcRemoveMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.ProcType.String printfmt:Raw read:Y print:Y sep:"" genop:N comment:"" -dmmeta.cfmt cfmt:ams.Seqmsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.SeqmsgId.String printfmt:Sep read:Y print:Y sep:@, genop:Y comment:"" -dmmeta.cfmt cfmt:ams.SeqmsgTrace.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.StreamFlags.String printfmt:Bitset read:Y print:Y sep:, genop:Y comment:"" -dmmeta.cfmt cfmt:ams.StreamHbMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:ams.StreamId.String printfmt:Sep read:Y print:Y sep:.- genop:Y comment:"" -dmmeta.cfmt cfmt:ams.StreamPos.String printfmt:Sep read:Y print:Y sep:, genop:Y comment:"" -dmmeta.cfmt cfmt:ams.StreamType.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ams.ProcEofMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ams.ProcId.String printfmt:Sep read:Y print:Y sep:-- genop:Y comment:"" +dmmeta.cfmt cfmt:ams.ProcKillMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ams.ProcMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ams.ProcReadMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ams.ProcStartMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ams.ProcStatusMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ams.Proctype.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ams.RemDirRecurseMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" +dmmeta.cfmt cfmt:ams.ShmFlags.String printfmt:Bitset read:Y print:Y sep:, genop:Y comment:"" +dmmeta.cfmt cfmt:ams.ShmHbMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ams.ShmId.String printfmt:Sep read:Y print:Y sep:.- genop:Y comment:"" +dmmeta.cfmt cfmt:ams.ShmemberFlags.String printfmt:Bitset read:Y print:Y sep:, genop:Y comment:"" +dmmeta.cfmt cfmt:ams.ShmemberId.String printfmt:Sep read:Y print:Y sep:/, genop:Y comment:"" +dmmeta.cfmt cfmt:ams.Shmmsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ams.Shmtype.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:ams.TerminateMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" -dmmeta.cfmt cfmt:ams.Trace2Msg.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" -dmmeta.cfmt cfmt:ams.TraceInfo2Msg.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" -dmmeta.cfmt cfmt:ams.TraceInfoMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" -dmmeta.cfmt cfmt:ams.TraceMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:ams.UdpFrame.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:ams_sendtest.AmsSendTest.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:amsdb.ProcType.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:amsdb.StreamType.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:amsdb.Proctype.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:amsdb.Shmtype.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:apm.FMergefile.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:atf.Testresult.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:atf.Testrun.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" @@ -345,6 +351,10 @@ dmmeta.cfmt cfmt:atf_amc.TypeT.String printfmt:Tuple read:Y print:Y sep:"" dmmeta.cfmt cfmt:atf_amc.TypeTVal.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:atf_amc.Typefconst.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:atf_amc.Typefconst.Tuple printfmt:Auto read:Y print:N sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:atf_amc.Varlen2Msg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:atf_amc.Varlen2aMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:atf_amc.Varlen2mMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:atf_amc.Varlen2vMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:atf_amc.VarlenK.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:atf_amc.VarlenMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:atf_cov.FCovline.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" @@ -375,6 +385,7 @@ dmmeta.cfmt cfmt:atfdb.Tfilt.String printfmt:Tuple read:Y print:Y sep:"" g dmmeta.cfmt cfmt:atfdb.Tmsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:atfdb.Unittest.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:atfdb.Unittest.Tuple printfmt:Auto read:Y print:N sep:"" genop:N comment:"" +dmmeta.cfmt cfmt:atfdb.Var.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:bool.Json printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:bool.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:char.Json printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" @@ -391,7 +402,6 @@ dmmeta.cfmt cfmt:command.acr_my.Argv printfmt:Tuple read:Y print:Y sep:"" dmmeta.cfmt cfmt:command.amc.Argv printfmt:Auto read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:command.amc_gc.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:command.amc_vis.Argv printfmt:Auto read:Y print:Y sep:"" genop:N comment:"" -dmmeta.cfmt cfmt:command.ams_cat.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:command.ams_sendtest.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:command.apm.Argv printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:command.aqlite.Argv printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" @@ -400,6 +410,7 @@ dmmeta.cfmt cfmt:command.atf_ci.Argv printfmt:Tuple read:Y print:Y sep:"" dmmeta.cfmt cfmt:command.atf_cmdline.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:command.atf_comp.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:command.atf_cov.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" +dmmeta.cfmt cfmt:command.atf_exp.Argv printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:command.atf_fuzz.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:command.atf_gcli.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:command.atf_nrun.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" @@ -409,9 +420,12 @@ dmmeta.cfmt cfmt:command.bash2html.Argv printfmt:Tuple read:Y print:Y sep:" dmmeta.cfmt cfmt:command.gcache.Argv printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:command.gcache.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:command.gcli.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" +dmmeta.cfmt cfmt:command.generic.ArgvGnu printfmt:Auto read:N print:Y sep:"" genop:N comment:"" +dmmeta.cfmt cfmt:command.jkv.Argv printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:command.mdbg.Argv printfmt:Auto read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:command.mysql2ssim.Argv printfmt:Auto read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:command.orgfile.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" +dmmeta.cfmt cfmt:command.samp_make.Argv printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:command.samp_meng.Argv printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:command.samp_regx.Argv printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:command.sandbox.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" @@ -446,13 +460,16 @@ dmmeta.cfmt cfmt:dev.Linelim.String printfmt:Tuple read:Y print:Y sep:"" g dmmeta.cfmt cfmt:dev.Mdmark.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Mdsection.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Msgfile.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dev.Netproto.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Noindent.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.OptType.String printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" dmmeta.cfmt cfmt:dev.Package.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Pkgdep.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Pkgkey.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:dev.Readme.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dev.Prototransport.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dev.Readmefile.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Readmesort.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dev.Rpm.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Sandbox.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Sbpath.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Scriptfile.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" @@ -467,6 +484,7 @@ dmmeta.cfmt cfmt:dev.Targsyslib.String printfmt:Tuple read:Y print:Y sep:"" dmmeta.cfmt cfmt:dev.Tgtcov.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Timefmt.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.ToolOpt.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dev.Transport.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Uname.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dev.Unstablefld.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Anonfld.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" @@ -484,6 +502,7 @@ dmmeta.cfmt cfmt:dmmeta.Cfmt.String printfmt:Tuple read:Y print:Y sep:"" g dmmeta.cfmt cfmt:dmmeta.Cget.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Charset.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Chash.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dmmeta.Ckafka.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Cppfunc.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Cppkeyword.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Cpptype.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" @@ -507,6 +526,7 @@ dmmeta.cfmt cfmt:dmmeta.Fbigend.String printfmt:Tuple read:Y print:Y sep:"" dmmeta.cfmt cfmt:dmmeta.Fbitset.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Fbuf.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Fbufdir.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dmmeta.Fbufiotype.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Fbuftype.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Fcast.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Fcleanup.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" @@ -523,6 +543,7 @@ dmmeta.cfmt cfmt:dmmeta.Fflag.String printfmt:Tuple read:Y print:Y sep:"" dmmeta.cfmt cfmt:dmmeta.Field.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Findrem.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Finput.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dmmeta.Fkafka.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Fldoffset.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Floadtuples.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Fnoremove.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" @@ -543,6 +564,8 @@ dmmeta.cfmt cfmt:dmmeta.Gsymbol.String printfmt:Tuple read:Y print:Y sep:"" dmmeta.cfmt cfmt:dmmeta.Hashtype.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Hook.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Inlary.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dmmeta.Jstype.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dmmeta.KafkaTypeKind.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Lenfld.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Listtype.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Llist.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" @@ -557,6 +580,7 @@ dmmeta.cfmt cfmt:dmmeta.Nscpp.String printfmt:Tuple read:Y print:Y sep:"" dmmeta.cfmt cfmt:dmmeta.Nsdb.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Nsfast.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Nsinclude.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dmmeta.Nsjs.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Nsproto.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Nstype.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Nsversion.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" @@ -587,6 +611,7 @@ dmmeta.cfmt cfmt:dmmeta.Thash.String printfmt:Tuple read:Y print:Y sep:"" dmmeta.cfmt cfmt:dmmeta.Tracefld.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Tracerec.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Typefld.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:dmmeta.Userfunc.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Usertracefld.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:dmmeta.Xref.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:double.Json printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" @@ -622,8 +647,6 @@ dmmeta.cfmt cfmt:gclidb.Gclisub.String printfmt:Tuple read:Y print:Y sep:"" dmmeta.cfmt cfmt:gclidb.Gfld.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:gclidb.Gmethod.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:gclidb.Grepo.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:gclidb.Grepogitport.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" -dmmeta.cfmt cfmt:gclidb.Grepossh.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:gclidb.Gstate.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:gclidb.Gstatet.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:gclidb.Gtbl.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" @@ -643,6 +666,16 @@ dmmeta.cfmt cfmt:gclidb.Mr.String printfmt:Tuple read:Y print:Y sep:"" gen dmmeta.cfmt cfmt:gclidb.Mrjob.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:gclidb.Mrnote.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:gclidb.User.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:http.ExtensionHeader.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:http.HeaderType.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:http.Method.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:http.Request.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:http.Response.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:httpdb.Content.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:httpdb.Header.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:httpdb.Method.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:httpdb.Status.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:httpdb.Version.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:i16.Json printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:i16.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:i32.Json printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" @@ -654,6 +687,22 @@ dmmeta.cfmt cfmt:i8.String printfmt:Extern read:Y print:Y sep:"" genop:Y dmmeta.cfmt cfmt:ietf.Ipport.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:ietf.Ipv4.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:ietf.Ipv4Addr.String printfmt:Extern read:Y print:Y sep:"" genop:N comment:"" +dmmeta.cfmt cfmt:kafka.AclOperationType.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.AclOperations.String printfmt:Bitset read:Y print:Y sep:, genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.AclPermissionType.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.CompressionType.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.ConfigSource.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.ConfigType.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.Error.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.GroupState.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.Header.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.OffsetCommitKey.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.OffsetCommitValue.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.PatternType.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.Record.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.RecordBatch.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.ResourceType.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:kafka.TimestampType.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:lib_ams.FReadfile.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:lib_ams.FWritefile.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:lib_ctype.Cmdline.Argv printfmt:Tuple read:Y print:Y sep:"" genop:N comment:"" @@ -692,6 +741,11 @@ dmmeta.cfmt cfmt:samp_meng.NewUserReqMsg.String printfmt:Tuple read:Y print: dmmeta.cfmt cfmt:samp_meng.OrderTradeMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:samp_meng.Symbol.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:samp_meng.TextMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:sampdb.Gitfile.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:sampdb.Targdep.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:sampdb.Target.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:sampdb.Targrec.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:sampdb.Targsrc.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:ssim2csv.FExpand.String printfmt:Raw read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:ssim2csv.FFlatten.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:ssim2csv.FOutfile.String printfmt:Tuple read:N print:Y sep:"" genop:Y comment:"" @@ -714,3 +768,19 @@ dmmeta.cfmt cfmt:u64.Json printfmt:Extern read:N print:Y sep:"" genop:Y c dmmeta.cfmt cfmt:u64.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:u8.Json printfmt:Extern read:N print:Y sep:"" genop:Y comment:"" dmmeta.cfmt cfmt:u8.String printfmt:Extern read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.CloseMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.ConnectMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.DataMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.Frame.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.Frame16.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.Frame64.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.FrameMasked.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.FrameMasked16.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.FrameMasked64.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.HttpState.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.Opcode.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.ServerStartMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.ServerStopMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.Side.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:ws.StatusCode.String printfmt:Raw read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.cfmt cfmt:wsdb.Status.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" diff --git a/data/dmmeta/chash.ssim b/data/dmmeta/chash.ssim index c2e4f99c..f96df79f 100644 --- a/data/dmmeta/chash.ssim +++ b/data/dmmeta/chash.ssim @@ -139,8 +139,10 @@ dmmeta.chash ctype:algo.Smallstr16 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Smallstr2 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Smallstr20 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Smallstr200 hashtype:CRC32 comment:"" +dmmeta.chash ctype:algo.Smallstr249 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Smallstr25 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Smallstr250 hashtype:CRC32 comment:"" +dmmeta.chash ctype:algo.Smallstr255 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Smallstr3 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Smallstr30 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Smallstr32 hashtype:CRC32 comment:"" @@ -148,12 +150,16 @@ dmmeta.chash ctype:algo.Smallstr4 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Smallstr40 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Smallstr5 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Smallstr50 hashtype:CRC32 comment:"" +dmmeta.chash ctype:algo.U16Ary hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.U16Dec2 hashtype:CRC32 comment:"" +dmmeta.chash ctype:algo.U32Ary hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.U32Dec1 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.U32Dec2 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.U32Dec3 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.U32Dec4 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.U32Dec5 hashtype:CRC32 comment:"" +dmmeta.chash ctype:algo.U32LinearKey hashtype:Linear comment:"" +dmmeta.chash ctype:algo.U64Ary hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.U64Dec10 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.U64Dec2 hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.U64Dec4 hashtype:CRC32 comment:"" @@ -169,17 +175,18 @@ dmmeta.chash ctype:algo.UnixTime hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.Uuid hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.WDiff hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.WTime hashtype:CRC32 comment:"" -dmmeta.chash ctype:algo.cstring hashtype:Extern comment:"" +dmmeta.chash ctype:algo.cstring hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.i32_Range hashtype:CRC32 comment:"" dmmeta.chash ctype:algo.strptr hashtype:Extern comment:"" dmmeta.chash ctype:amc.Enumstr hashtype:CRC32 comment:"" dmmeta.chash ctype:amc_vis.Linkkey hashtype:CRC32 comment:"" dmmeta.chash ctype:amc_vis.Nodekey hashtype:CRC32 comment:"" -dmmeta.chash ctype:ams.Member hashtype:CRC32 comment:"" dmmeta.chash ctype:ams.ProcId hashtype:CRC32 comment:"" -dmmeta.chash ctype:ams.ProcType hashtype:CRC32 comment:"" -dmmeta.chash ctype:ams.StreamId hashtype:CRC32 comment:"" -dmmeta.chash ctype:ams.StreamType hashtype:CRC32 comment:"" +dmmeta.chash ctype:ams.Proctype hashtype:CRC32 comment:"" +dmmeta.chash ctype:ams.ShmId hashtype:CRC32 comment:"" +dmmeta.chash ctype:ams.ShmemberFlags hashtype:CRC32 comment:"" +dmmeta.chash ctype:ams.ShmemberId hashtype:CRC32 comment:"" +dmmeta.chash ctype:ams.Shmtype hashtype:CRC32 comment:"" dmmeta.chash ctype:atf_amc.Cstr hashtype:CRC32 comment:"" dmmeta.chash ctype:atf_amc.Ctype1Attr hashtype:CRC32 comment:"" dmmeta.chash ctype:atf_amc.Ctype2Attr hashtype:CRC32 comment:"" @@ -201,28 +208,33 @@ dmmeta.chash ctype:atf_unit.Cstr hashtype:CRC32 comment:"" dmmeta.chash ctype:atf_unit.Dbl hashtype:CRC32 comment:"" dmmeta.chash ctype:atf_unit.TypeA hashtype:CRC32 comment:"" dmmeta.chash ctype:atf_unit.TypeB hashtype:CRC32 comment:"" -dmmeta.chash ctype:bool hashtype:Extern comment:"" -dmmeta.chash ctype:char hashtype:Extern comment:"" -dmmeta.chash ctype:double hashtype:Extern comment:"" -dmmeta.chash ctype:float hashtype:Extern comment:"" +dmmeta.chash ctype:bool hashtype:CRC32 comment:"" +dmmeta.chash ctype:char hashtype:CRC32 comment:"" +dmmeta.chash ctype:double hashtype:CRC32 comment:"" +dmmeta.chash ctype:float hashtype:CRC32 comment:"" dmmeta.chash ctype:fm.Code hashtype:CRC32 comment:"" dmmeta.chash ctype:fm.Description hashtype:CRC32 comment:"" dmmeta.chash ctype:fm.Objinst hashtype:CRC32 comment:"" dmmeta.chash ctype:fm.Objtype hashtype:CRC32 comment:"" dmmeta.chash ctype:fm.Source hashtype:CRC32 comment:"" dmmeta.chash ctype:fm.Summary hashtype:CRC32 comment:"" -dmmeta.chash ctype:i16 hashtype:Extern comment:"" -dmmeta.chash ctype:i32 hashtype:Extern comment:"" -dmmeta.chash ctype:i64 hashtype:Extern comment:"" -dmmeta.chash ctype:i8 hashtype:Extern comment:"" +dmmeta.chash ctype:i16 hashtype:CRC32 comment:"" +dmmeta.chash ctype:i32 hashtype:CRC32 comment:"" +dmmeta.chash ctype:i64 hashtype:CRC32 comment:"" +dmmeta.chash ctype:i8 hashtype:CRC32 comment:"" dmmeta.chash ctype:ietf.Ipport hashtype:CRC32 comment:"" dmmeta.chash ctype:ietf.Ipv4 hashtype:CRC32 comment:"" dmmeta.chash ctype:ietf.Ipv4Addr hashtype:CRC32 comment:"" +dmmeta.chash ctype:kafka.ConfigSource hashtype:CRC32 comment:"" +dmmeta.chash ctype:kafka.ConfigType hashtype:CRC32 comment:"" +dmmeta.chash ctype:kafka.GroupState hashtype:CRC32 comment:"" +dmmeta.chash ctype:kafka.PatternType hashtype:CRC32 comment:"" +dmmeta.chash ctype:kafka.ResourceType hashtype:CRC32 comment:"" dmmeta.chash ctype:lib_json.FldKey hashtype:CRC32 comment:"" dmmeta.chash ctype:samp_meng.I64Price8 hashtype:CRC32 comment:"" dmmeta.chash ctype:samp_meng.Symbol hashtype:CRC32 comment:"" -dmmeta.chash ctype:u128 hashtype:Extern comment:"" -dmmeta.chash ctype:u16 hashtype:Extern comment:"" -dmmeta.chash ctype:u32 hashtype:Extern comment:"" -dmmeta.chash ctype:u64 hashtype:Extern comment:"" -dmmeta.chash ctype:u8 hashtype:Extern comment:"" +dmmeta.chash ctype:u128 hashtype:CRC32 comment:"" +dmmeta.chash ctype:u16 hashtype:CRC32 comment:"" +dmmeta.chash ctype:u32 hashtype:CRC32 comment:"" +dmmeta.chash ctype:u64 hashtype:CRC32 comment:"" +dmmeta.chash ctype:u8 hashtype:CRC32 comment:"" diff --git a/data/dmmeta/ckafka.ssim b/data/dmmeta/ckafka.ssim new file mode 100644 index 00000000..e69de29b diff --git a/data/dmmeta/cppfunc.ssim b/data/dmmeta/cppfunc.ssim index 1a965a4d..8e2ca680 100644 --- a/data/dmmeta/cppfunc.ssim +++ b/data/dmmeta/cppfunc.ssim @@ -1,4 +1,3 @@ dmmeta.cppfunc field:atf_amc.VarlenExtern.length expr:"" print:N set:Y dmmeta.cppfunc field:dev.Syscmd.execkey expr:"" print:N set:N -dmmeta.cppfunc field:dev.Syscmddep.syscmddep expr:"" print:N set:N dmmeta.cppfunc field:lib_json.FNode.fldkey expr:"" print:N set:N diff --git a/data/dmmeta/cpptype.ssim b/data/dmmeta/cpptype.ssim index bd073b98..e0ce6c9e 100644 --- a/data/dmmeta/cpptype.ssim +++ b/data/dmmeta/cpptype.ssim @@ -1,7 +1,10 @@ +dmmeta.cpptype ctype:LEVELDB ctor:N dtor:Y cheap_copy:N dmmeta.cpptype ctype:MYSQL ctor:N dtor:Y cheap_copy:N dmmeta.cpptype ctype:MYSQL_RES ctor:N dtor:Y cheap_copy:N dmmeta.cpptype ctype:SQLHANDLE ctor:N dtor:Y cheap_copy:N dmmeta.cpptype ctype:SQLLEN ctor:N dtor:Y cheap_copy:N +dmmeta.cpptype ctype:SSL ctor:N dtor:Y cheap_copy:N +dmmeta.cpptype ctype:SSL_CTX ctor:N dtor:Y cheap_copy:N dmmeta.cpptype ctype:ShStream ctor:N dtor:Y cheap_copy:N dmmeta.cpptype ctype:abt.config ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:acr.FEvalattr ctor:Y dtor:Y cheap_copy:N @@ -19,6 +22,7 @@ dmmeta.cpptype ctype:algo.DayRange ctor:Y dtor:N cheap_copy:N dmmeta.cpptype ctype:algo.Decimal ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.DryrunQ ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.EchoQ ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:algo.Errcode ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:algo.Errns ctor:Y dtor:N cheap_copy:N dmmeta.cpptype ctype:algo.FailokQ ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.Fildes ctor:Y dtor:N cheap_copy:N @@ -121,6 +125,7 @@ dmmeta.cpptype ctype:algo.RspaceStr16 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.RspaceStr18 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.RspaceStr2 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.RspaceStr20 ctor:N dtor:N cheap_copy:Y +dmmeta.cpptype ctype:algo.RspaceStr200 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.RspaceStr24 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.RspaceStr25 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.RspaceStr3 ctor:N dtor:N cheap_copy:Y @@ -141,8 +146,10 @@ dmmeta.cpptype ctype:algo.Smallstr100 ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:algo.Smallstr16 ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:algo.Smallstr20 ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:algo.Smallstr200 ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:algo.Smallstr249 ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:algo.Smallstr25 ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:algo.Smallstr250 ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:algo.Smallstr255 ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:algo.Smallstr3 ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:algo.Smallstr30 ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:algo.Smallstr32 ctor:N dtor:N cheap_copy:N @@ -157,6 +164,7 @@ dmmeta.cpptype ctype:algo.U32Dec2 ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.U32Dec3 ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.U32Dec4 ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.U32Dec5 ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:algo.U32LinearKey ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.U64Dec10 ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.U64Dec2 ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:algo.U64Dec4 ctor:Y dtor:N cheap_copy:Y @@ -182,43 +190,39 @@ dmmeta.cpptype ctype:algo_lib.ErrorX ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:algo_lib.FTxtcell ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:algo_lib.Mmap ctor:N dtor:Y cheap_copy:N dmmeta.cpptype ctype:algo_lib.MmapFile ctor:N dtor:Y cheap_copy:N +dmmeta.cpptype ctype:algo_lib.RegxFlags ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:algo_lib.RegxOp ctor:Y dtor:Y cheap_copy:N +dmmeta.cpptype ctype:algo_lib.RegxStyle ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:algo_lib.RegxToken ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:amc.BltinId ctor:Y dtor:Y cheap_copy:Y dmmeta.cpptype ctype:amc.Enumstr ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:amc.Pnewtype ctor:Y dtor:Y cheap_copy:Y +dmmeta.cpptype ctype:amc_vis.FLinkdep ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:amc_vis.FNodedep ctor:Y dtor:Y cheap_copy:N -dmmeta.cpptype ctype:amc_vis.Linkdep ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:amc_vis.Linkkey ctor:Y dtor:Y cheap_copy:Y dmmeta.cpptype ctype:amc_vis.Nodekey ctor:Y dtor:Y cheap_copy:Y dmmeta.cpptype ctype:amcdb.Bltin ctor:Y dtor:Y cheap_copy:N -dmmeta.cpptype ctype:ams.AlarmSyncMsg ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.DfltStream ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.DumpStreamTableMsg ctor:Y dtor:N cheap_copy:N dmmeta.cpptype ctype:ams.ExpectMsg ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.HeartbeatMsg ctor:Y dtor:N cheap_copy:N dmmeta.cpptype ctype:ams.InputLineMsg ctor:Y dtor:N cheap_copy:N dmmeta.cpptype ctype:ams.LogMsg ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.Member ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:ams.MsgHeader ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.OpenMsg ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.PrlogMsg ctor:N dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.ProcAddMsg ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:ams.ProcEofMsg ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:ams.ProcId ctor:Y dtor:N cheap_copy:Y -dmmeta.cpptype ctype:ams.ProcRemoveMsg ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.ProcType ctor:Y dtor:N cheap_copy:Y -dmmeta.cpptype ctype:ams.Seqmsg ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.SeqmsgId ctor:Y dtor:N cheap_copy:Y -dmmeta.cpptype ctype:ams.SeqmsgTrace ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.StreamFlags ctor:Y dtor:N cheap_copy:Y -dmmeta.cpptype ctype:ams.StreamHbMsg ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.StreamId ctor:Y dtor:N cheap_copy:Y -dmmeta.cpptype ctype:ams.StreamPos ctor:Y dtor:N cheap_copy:Y -dmmeta.cpptype ctype:ams.StreamType ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:ams.ProcKillMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:ams.ProcMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:ams.ProcReadMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:ams.ProcStartMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:ams.ProcStatusMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:ams.Proctype ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:ams.RemDirRecurseMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:ams.ShmFlags ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:ams.ShmHbMsg ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:ams.ShmId ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:ams.ShmemberFlags ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:ams.ShmemberId ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:ams.Shmmsg ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:ams.Shmtype ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:ams.TerminateMsg ctor:N dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.Trace2Msg ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.TraceInfo2Msg ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.TraceInfoMsg ctor:Y dtor:N cheap_copy:N -dmmeta.cpptype ctype:ams.TraceMsg ctor:Y dtor:N cheap_copy:N dmmeta.cpptype ctype:atf.Testresult ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:atf.Testrun ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:atf_amc.Cstr ctor:Y dtor:Y cheap_copy:N @@ -240,6 +244,10 @@ dmmeta.cpptype ctype:atf_amc.TypeBE32en ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:atf_amc.TypeBE64 ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:atf_amc.TypeBE64dflt ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:atf_amc.Typefconst ctor:Y dtor:Y cheap_copy:N +dmmeta.cpptype ctype:atf_amc.Varlen2Msg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:atf_amc.Varlen2aMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:atf_amc.Varlen2mMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:atf_amc.Varlen2vMsg ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:atf_amc.VarlenK ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:atf_amc.VarlenMsg ctor:N dtor:N cheap_copy:N dmmeta.cpptype ctype:atf_cov.Phase ctor:N dtor:N cheap_copy:Y @@ -256,7 +264,7 @@ dmmeta.cpptype ctype:dev.OptType ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:dev.Package ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:dev.Pkgdep ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:dev.Pkgkey ctor:Y dtor:Y cheap_copy:N -dmmeta.cpptype ctype:dev.Readme ctor:Y dtor:Y cheap_copy:N +dmmeta.cpptype ctype:dev.Readmefile ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:dev.Syscmd ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:dev.Syscmddep ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:dev.Targdep ctor:Y dtor:Y cheap_copy:N @@ -333,13 +341,34 @@ dmmeta.cpptype ctype:i16 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:i32 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:i64 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:i8 ctor:N dtor:N cheap_copy:Y +dmmeta.cpptype ctype:ibv_ah ctor:N dtor:Y cheap_copy:N +dmmeta.cpptype ctype:ibv_context ctor:N dtor:Y cheap_copy:N +dmmeta.cpptype ctype:ibv_cq_ex ctor:N dtor:Y cheap_copy:N +dmmeta.cpptype ctype:ibv_device ctor:N dtor:Y cheap_copy:N +dmmeta.cpptype ctype:ibv_flow ctor:N dtor:Y cheap_copy:N +dmmeta.cpptype ctype:ibv_mr ctor:N dtor:Y cheap_copy:N +dmmeta.cpptype ctype:ibv_pd ctor:N dtor:Y cheap_copy:N +dmmeta.cpptype ctype:ibv_qp ctor:N dtor:Y cheap_copy:N dmmeta.cpptype ctype:ietf.Ipport ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:ietf.Ipv4 ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:ietf.Ipv4Addr ctor:Y dtor:Y cheap_copy:Y +dmmeta.cpptype ctype:kafka.AclOperationType ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:kafka.AclOperations ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:kafka.AclPermissionType ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:kafka.CompressionType ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:kafka.ConfigSource ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:kafka.ConfigType ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:kafka.Error ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:kafka.GroupState ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:kafka.PatternType ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:kafka.ResourceType ctor:Y dtor:N cheap_copy:N +dmmeta.cpptype ctype:kafka.TimestampType ctor:Y dtor:N cheap_copy:N dmmeta.cpptype ctype:lib_ctype.Match ctor:N dtor:Y cheap_copy:N dmmeta.cpptype ctype:lib_json.FldKey ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:pad_byte ctor:Y dtor:N cheap_copy:Y dmmeta.cpptype ctype:pid_t ctor:N dtor:Y cheap_copy:Y +dmmeta.cpptype ctype:rdma_cm_id ctor:N dtor:Y cheap_copy:N +dmmeta.cpptype ctype:rdma_event_channel ctor:N dtor:Y cheap_copy:N dmmeta.cpptype ctype:report.abt ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:report.acr_check ctor:Y dtor:Y cheap_copy:N dmmeta.cpptype ctype:report.gcache ctor:Y dtor:Y cheap_copy:N @@ -363,3 +392,12 @@ dmmeta.cpptype ctype:u16 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:u32 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:u64 ctor:N dtor:N cheap_copy:Y dmmeta.cpptype ctype:u8 ctor:N dtor:N cheap_copy:Y +dmmeta.cpptype ctype:ws.CloseMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:ws.ConnectMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:ws.DataMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:ws.HttpState ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:ws.Opcode ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:ws.ServerStartMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:ws.ServerStopMsg ctor:N dtor:N cheap_copy:N +dmmeta.cpptype ctype:ws.Side ctor:Y dtor:N cheap_copy:Y +dmmeta.cpptype ctype:ws.StatusCode ctor:Y dtor:N cheap_copy:Y diff --git a/data/dmmeta/csize.ssim b/data/dmmeta/csize.ssim index 5387bb6f..524f3f18 100644 --- a/data/dmmeta/csize.ssim +++ b/data/dmmeta/csize.ssim @@ -8,6 +8,9 @@ dmmeta.csize ctype:algo.ImrowPrintFcn size:8 alignment:8 comment:"" dmmeta.csize ctype:algo.ImrowRowidFindFcn size:8 alignment:8 comment:"" dmmeta.csize ctype:algo.ImrowXrefXFcn size:8 alignment:8 comment:"" dmmeta.csize ctype:algo.PrlogFcn size:8 alignment:8 comment:"" +dmmeta.csize ctype:algo.RspaceStr8 size:8 alignment:1 comment:"" +dmmeta.csize ctype:algo.RspaceStr9 size:9 alignment:1 comment:"" +dmmeta.csize ctype:algo.Smallstr10 size:12 alignment:1 comment:"data + nul byte + length" dmmeta.csize ctype:algo.memptr size:16 alignment:8 comment:"" dmmeta.csize ctype:algo.strptr size:16 alignment:8 comment:"" dmmeta.csize ctype:bool size:1 alignment:1 comment:"" diff --git a/data/dmmeta/cstr.ssim b/data/dmmeta/cstr.ssim index 95eddb41..e8ffb265 100644 --- a/data/dmmeta/cstr.ssim +++ b/data/dmmeta/cstr.ssim @@ -118,8 +118,10 @@ dmmeta.cstr ctype:algo.Smallstr16 strequiv:Y comment:"" dmmeta.cstr ctype:algo.Smallstr2 strequiv:Y comment:"" dmmeta.cstr ctype:algo.Smallstr20 strequiv:Y comment:"" dmmeta.cstr ctype:algo.Smallstr200 strequiv:Y comment:"" +dmmeta.cstr ctype:algo.Smallstr249 strequiv:Y comment:"" dmmeta.cstr ctype:algo.Smallstr25 strequiv:Y comment:"" dmmeta.cstr ctype:algo.Smallstr250 strequiv:Y comment:"" +dmmeta.cstr ctype:algo.Smallstr255 strequiv:Y comment:"" dmmeta.cstr ctype:algo.Smallstr3 strequiv:Y comment:"" dmmeta.cstr ctype:algo.Smallstr30 strequiv:Y comment:"" dmmeta.cstr ctype:algo.Smallstr32 strequiv:Y comment:"" diff --git a/data/dmmeta/ctype.ssim b/data/dmmeta/ctype.ssim index 6cf81af8..c0b48338 100644 --- a/data/dmmeta/ctype.ssim +++ b/data/dmmeta/ctype.ssim @@ -1,13 +1,15 @@ dmmeta.ctype ctype:"" comment:"" dmmeta.ctype ctype:DIR comment:"" dmmeta.ctype ctype:HANDLE comment:"" +dmmeta.ctype ctype:LEVELDB comment:"" dmmeta.ctype ctype:MYSQL comment:"" dmmeta.ctype ctype:MYSQL_RES comment:"" -dmmeta.ctype ctype:ResponseHeader comment:"" dmmeta.ctype ctype:SQLHANDLE comment:"" dmmeta.ctype ctype:SQLINTEGER comment:"" dmmeta.ctype ctype:SQLLEN comment:"" dmmeta.ctype ctype:SQLUINTEGER comment:"" +dmmeta.ctype ctype:SSL comment:"TLS connection" +dmmeta.ctype ctype:SSL_CTX comment:"TLS connection factory" dmmeta.ctype ctype:ShStream comment:"" dmmeta.ctype ctype:abt.FArch comment:"Machine architecture" dmmeta.ctype ctype:abt.FBuilddir comment:"" @@ -34,9 +36,12 @@ dmmeta.ctype ctype:abt_md.FCtype comment:"" dmmeta.ctype ctype:abt_md.FDb comment:"In-memory database for abt_md" dmmeta.ctype ctype:abt_md.FDirent comment:"" dmmeta.ctype ctype:abt_md.FDirscan comment:"" +dmmeta.ctype ctype:abt_md.FDispatch comment:"" +dmmeta.ctype ctype:abt_md.FDispatchMsg comment:"" dmmeta.ctype ctype:abt_md.FFconst comment:"" dmmeta.ctype ctype:abt_md.FField comment:"" dmmeta.ctype ctype:abt_md.FFileSection comment:"" +dmmeta.ctype ctype:abt_md.FFinput comment:"" dmmeta.ctype ctype:abt_md.FGconst comment:"" dmmeta.ctype ctype:abt_md.FGstatic comment:"" dmmeta.ctype ctype:abt_md.FHumanText comment:"" @@ -44,7 +49,7 @@ dmmeta.ctype ctype:abt_md.FLink comment:"" dmmeta.ctype ctype:abt_md.FMdsection comment:"" dmmeta.ctype ctype:abt_md.FNs comment:"" dmmeta.ctype ctype:abt_md.FNstype comment:"" -dmmeta.ctype ctype:abt_md.FReadme comment:"" +dmmeta.ctype ctype:abt_md.FReadmefile comment:"" dmmeta.ctype ctype:abt_md.FReadmesort comment:"" dmmeta.ctype ctype:abt_md.FReftype comment:"" dmmeta.ctype ctype:abt_md.FScriptfile comment:"" @@ -120,6 +125,7 @@ dmmeta.ctype ctype:acr_ed.FField comment:"" dmmeta.ctype ctype:acr_ed.FFprefix comment:"" dmmeta.ctype ctype:acr_ed.FGitfile comment:"" dmmeta.ctype ctype:acr_ed.FListtype comment:"" +dmmeta.ctype ctype:acr_ed.FMsgtype comment:"" dmmeta.ctype ctype:acr_ed.FNs comment:"" dmmeta.ctype ctype:acr_ed.FNsdb comment:"" dmmeta.ctype ctype:acr_ed.FPack comment:"" @@ -165,6 +171,7 @@ dmmeta.ctype ctype:algo.I32Dec2 comment:"signed i32, scale 1e2" dmmeta.ctype ctype:algo.I32Dec3 comment:"signed i32, scale 1e3" dmmeta.ctype ctype:algo.I32Dec4 comment:"signed i32, scale 1e4" dmmeta.ctype ctype:algo.I32Dec5 comment:"signed i32, scale 1e5" +dmmeta.ctype ctype:algo.I32RangeAry comment:"Byte array" dmmeta.ctype ctype:algo.I64Dec1 comment:"signed i64, scale 1e1" dmmeta.ctype ctype:algo.I64Dec10 comment:"signed i64, scale 1e10" dmmeta.ctype ctype:algo.I64Dec2 comment:"signed i64, scale 1e2" @@ -175,6 +182,7 @@ dmmeta.ctype ctype:algo.I64Dec6 comment:"signed i64, scale 1e6" dmmeta.ctype ctype:algo.I64Dec7 comment:"signed i64, scale 1e7" dmmeta.ctype ctype:algo.I64Dec8 comment:"signed i64, scale 1e8" dmmeta.ctype ctype:algo.I64Dec9 comment:"signed i64, scale 1e9" +dmmeta.ctype ctype:algo.I64Rate comment:"" dmmeta.ctype ctype:algo.IOEvtFlags comment:"IO event flags, used in IOHook" dmmeta.ctype ctype:algo.IPoint comment:"i32 - x,y" dmmeta.ctype ctype:algo.Imdb comment:"In-memory database descriptor (reflection)" @@ -318,8 +326,10 @@ dmmeta.ctype ctype:algo.Smallstr16 comment:"inline string with length field" dmmeta.ctype ctype:algo.Smallstr2 comment:"inline string with length field" dmmeta.ctype ctype:algo.Smallstr20 comment:"inline string with length field" dmmeta.ctype ctype:algo.Smallstr200 comment:"inline string with length field" +dmmeta.ctype ctype:algo.Smallstr249 comment:"inline string with length field" dmmeta.ctype ctype:algo.Smallstr25 comment:"inline string with length field" dmmeta.ctype ctype:algo.Smallstr250 comment:"inline string with length field" +dmmeta.ctype ctype:algo.Smallstr255 comment:"inline string with length field" dmmeta.ctype ctype:algo.Smallstr3 comment:"inline string with length field" dmmeta.ctype ctype:algo.Smallstr30 comment:"inline string with length field" dmmeta.ctype ctype:algo.Smallstr32 comment:"inline string with length field" @@ -333,12 +343,15 @@ dmmeta.ctype ctype:algo.TermStyle comment:"terminal style" dmmeta.ctype ctype:algo.TextJust comment:"terminal justification" dmmeta.ctype ctype:algo.TstampCache comment:"timestamp cache, for fast date to string conversion" dmmeta.ctype ctype:algo.Tuple comment:"Describes a ssim tuple" +dmmeta.ctype ctype:algo.U16Ary comment:"Array of u16" dmmeta.ctype ctype:algo.U16Dec2 comment:"u16, scale 1e2" +dmmeta.ctype ctype:algo.U32Ary comment:"Array of u16" dmmeta.ctype ctype:algo.U32Dec1 comment:"u32, scale 1e1" dmmeta.ctype ctype:algo.U32Dec2 comment:"u32, scale 1e2" dmmeta.ctype ctype:algo.U32Dec3 comment:"u32, scale 1e3" dmmeta.ctype ctype:algo.U32Dec4 comment:"u32, scale 1e4" dmmeta.ctype ctype:algo.U32Dec5 comment:"u32, scale 1e5" +dmmeta.ctype ctype:algo.U32LinearKey comment:"" dmmeta.ctype ctype:algo.U64Ary comment:"Array of u64" dmmeta.ctype ctype:algo.U64Dec10 comment:"unsigned u64, scale 1e10" dmmeta.ctype ctype:algo.U64Dec2 comment:"u64, scale 1e2" @@ -366,6 +379,7 @@ dmmeta.ctype ctype:algo_lib.CsvParse comment:"" dmmeta.ctype ctype:algo_lib.ErrorX comment:"" dmmeta.ctype ctype:algo_lib.FDb comment:"In-memory database for algo_lib" dmmeta.ctype ctype:algo_lib.FDispsigcheck comment:"" +dmmeta.ctype ctype:algo_lib.FErrns comment:"" dmmeta.ctype ctype:algo_lib.FFildes comment:"Wrapper for unix file descritor, call close() on Uninit" dmmeta.ctype ctype:algo_lib.FImdb comment:"" dmmeta.ctype ctype:algo_lib.FImtable comment:"" @@ -382,10 +396,14 @@ dmmeta.ctype ctype:algo_lib.InTextFile comment:"" dmmeta.ctype ctype:algo_lib.Mmap comment:"" dmmeta.ctype ctype:algo_lib.MmapFile comment:"" dmmeta.ctype ctype:algo_lib.Regx comment:"Parsed regular expression" -dmmeta.ctype ctype:algo_lib.RegxExpr comment:"" +dmmeta.ctype ctype:algo_lib.RegxExpr comment:"Expression during parsing" +dmmeta.ctype ctype:algo_lib.RegxFlags comment:"" +dmmeta.ctype ctype:algo_lib.RegxM comment:"Matching context for regex" +dmmeta.ctype ctype:algo_lib.RegxOp comment:"A single instruction for Regex NFA" dmmeta.ctype ctype:algo_lib.RegxParse comment:"Function to parse regx" -dmmeta.ctype ctype:algo_lib.RegxState comment:"" -dmmeta.ctype ctype:algo_lib.RegxToken comment:"" +dmmeta.ctype ctype:algo_lib.RegxState comment:"Instruction + jumps" +dmmeta.ctype ctype:algo_lib.RegxStyle comment:"Regex encoding style (Acr, Sql, Classic, Shell etc)" +dmmeta.ctype ctype:algo_lib.RegxToken comment:"Used when parsing" dmmeta.ctype ctype:algo_lib.Replscope comment:"" dmmeta.ctype ctype:algo_lib.ShHdr comment:"" dmmeta.ctype ctype:algo_lib.Srng comment:"Command function, a single word" @@ -408,6 +426,7 @@ dmmeta.ctype ctype:amc.FCfmt comment:"" dmmeta.ctype ctype:amc.FCget comment:"" dmmeta.ctype ctype:amc.FCharset comment:"" dmmeta.ctype ctype:amc.FChash comment:"" +dmmeta.ctype ctype:amc.FCkafka comment:"" dmmeta.ctype ctype:amc.FCppfunc comment:"" dmmeta.ctype ctype:amc.FCpptype comment:"" dmmeta.ctype ctype:amc.FCsize comment:"" @@ -444,6 +463,7 @@ dmmeta.ctype ctype:amc.FFflag comment:"" dmmeta.ctype ctype:amc.FField comment:"" dmmeta.ctype ctype:amc.FFindrem comment:"" dmmeta.ctype ctype:amc.FFinput comment:"" +dmmeta.ctype ctype:amc.FFkafka comment:"" dmmeta.ctype ctype:amc.FFldoffset comment:"" dmmeta.ctype ctype:amc.FFloadtuples comment:"" dmmeta.ctype ctype:amc.FFnoremove comment:"" @@ -465,6 +485,7 @@ dmmeta.ctype ctype:amc.FGstatic comment:"" dmmeta.ctype ctype:amc.FGsymbol comment:"" dmmeta.ctype ctype:amc.FHook comment:"" dmmeta.ctype ctype:amc.FInlary comment:"" +dmmeta.ctype ctype:amc.FJstype comment:"" dmmeta.ctype ctype:amc.FLenfld comment:"" dmmeta.ctype ctype:amc.FLicense comment:"" dmmeta.ctype ctype:amc.FListtype comment:"" @@ -478,6 +499,7 @@ dmmeta.ctype ctype:amc.FNs comment:"" dmmeta.ctype ctype:amc.FNscpp comment:"" dmmeta.ctype ctype:amc.FNsdb comment:"" dmmeta.ctype ctype:amc.FNsinclude comment:"" +dmmeta.ctype ctype:amc.FNsjs comment:"" dmmeta.ctype ctype:amc.FNsproto comment:"" dmmeta.ctype ctype:amc.FNsx comment:"" dmmeta.ctype ctype:amc.FNumstr comment:"" @@ -495,6 +517,7 @@ dmmeta.ctype ctype:amc.FSsimfile comment:"" dmmeta.ctype ctype:amc.FSsimsort comment:"" dmmeta.ctype ctype:amc.FSsimvolatile comment:"" dmmeta.ctype ctype:amc.FStatictuple comment:"" +dmmeta.ctype ctype:amc.FSteptype comment:"" dmmeta.ctype ctype:amc.FSubstr comment:"" dmmeta.ctype ctype:amc.FTargdep comment:"" dmmeta.ctype ctype:amc.FTarget comment:"" @@ -506,25 +529,28 @@ dmmeta.ctype ctype:amc.FThash comment:"" dmmeta.ctype ctype:amc.FTracefld comment:"" dmmeta.ctype ctype:amc.FTracerec comment:"" dmmeta.ctype ctype:amc.FTypefld comment:"" +dmmeta.ctype ctype:amc.FUserfunc comment:"" dmmeta.ctype ctype:amc.FUsertracefld comment:"" dmmeta.ctype ctype:amc.FXref comment:"" dmmeta.ctype ctype:amc.Funcarg comment:"" dmmeta.ctype ctype:amc.Genctx comment:"" dmmeta.ctype ctype:amc.Genpnew comment:"" +dmmeta.ctype ctype:amc.JsCtype comment:"" +dmmeta.ctype ctype:amc.JsNs comment:"" dmmeta.ctype ctype:amc.Pnewtype comment:"" dmmeta.ctype ctype:amc_gc.FDb comment:"In-memory database for amc_gc" dmmeta.ctype ctype:amc_vis.FCtype comment:"" dmmeta.ctype ctype:amc_vis.FDb comment:"In-memory database for amc_vis" dmmeta.ctype ctype:amc_vis.FField comment:"" dmmeta.ctype ctype:amc_vis.FFinput comment:"" +dmmeta.ctype ctype:amc_vis.FLink comment:"Correspodns to a ctype" +dmmeta.ctype ctype:amc_vis.FLinkdep comment:"Corresponds to a field" dmmeta.ctype ctype:amc_vis.FNode comment:"Corresponds to a ctype" dmmeta.ctype ctype:amc_vis.FNodedep comment:"Edge for computing node dependencies" +dmmeta.ctype ctype:amc_vis.FOutrow comment:"One line of text" dmmeta.ctype ctype:amc_vis.FReftype comment:"" -dmmeta.ctype ctype:amc_vis.Link comment:"Correspodns to a ctype" -dmmeta.ctype ctype:amc_vis.Linkdep comment:"Corresponds to a field" -dmmeta.ctype ctype:amc_vis.Linkkey comment:"Correspodns to a ctype" +dmmeta.ctype ctype:amc_vis.Linkkey comment:"Heap key for selecting next link to render - fields quantify selection criteria" dmmeta.ctype ctype:amc_vis.Nodekey comment:"Correspodns to a ctype" -dmmeta.ctype ctype:amc_vis.Outrow comment:"One line of text" dmmeta.ctype ctype:amcdb.Bltin comment:"Specify properties of a C built-in type" dmmeta.ctype ctype:amcdb.Curstype comment:"Cursor type" dmmeta.ctype ctype:amcdb.Gen comment:"" @@ -532,42 +558,34 @@ dmmeta.ctype ctype:amcdb.Regxtype comment:"" dmmeta.ctype ctype:amcdb.Tclass comment:"AMC template class" dmmeta.ctype ctype:amcdb.Tcurs comment:"Cursor template" dmmeta.ctype ctype:amcdb.Tfunc comment:"AMC template function" -dmmeta.ctype ctype:ams.AlarmSyncMsg comment:"" -dmmeta.ctype ctype:ams.DfltStream comment:"Set default stream for subsequent messages" -dmmeta.ctype ctype:ams.DumpStreamTableMsg comment:"Remove process from process group" dmmeta.ctype ctype:ams.ExpectMsg comment:"Pause reading until some output is produced" -dmmeta.ctype ctype:ams.HeartbeatMsg comment:"" dmmeta.ctype ctype:ams.InputLineMsg comment:"Unrecognized input line" dmmeta.ctype ctype:ams.LogMsg comment:"Log message" -dmmeta.ctype ctype:ams.Member comment:"Process/Stream/Mode - primary key for reader/writer of stream" dmmeta.ctype ctype:ams.MsgBlock comment:"A block of messages from ams commit file" dmmeta.ctype ctype:ams.MsgHeader comment:"" -dmmeta.ctype ctype:ams.OpenMsg comment:"Open stream for reading" -dmmeta.ctype ctype:ams.PrlogMsg comment:"" -dmmeta.ctype ctype:ams.ProcAddMsg comment:"Add process to process group" -dmmeta.ctype ctype:ams.ProcId comment:"Local process id, such as proc1-0, proc2-1 etc" -dmmeta.ctype ctype:ams.ProcRemoveMsg comment:"Remove process from process group" -dmmeta.ctype ctype:ams.ProcType comment:"StreamID + Sequence number" -dmmeta.ctype ctype:ams.Seqmsg comment:"Sequenced stream message" -dmmeta.ctype ctype:ams.SeqmsgId comment:"StreamID + Sequence number, e.g. proc1-0.out-0@1" -dmmeta.ctype ctype:ams.SeqmsgTrace comment:"Message used to trace reading/writing seqmsgs" -dmmeta.ctype ctype:ams.StreamFlags comment:"" -dmmeta.ctype ctype:ams.StreamHbMsg comment:"Stream heartbeat" -dmmeta.ctype ctype:ams.StreamId comment:"Host-unique stream ID. E.g. proc1-0.out-0" -dmmeta.ctype ctype:ams.StreamPos comment:Sequence,Offset -dmmeta.ctype ctype:ams.StreamType comment:"StreamID + Sequence number" +dmmeta.ctype ctype:ams.ProcEofMsg comment:"EOF from/to a process" +dmmeta.ctype ctype:ams.ProcId comment:"Process ID within topology: type, node index, process index, e.g. proc-0-0" +dmmeta.ctype ctype:ams.ProcKillMsg comment:"Kill process" +dmmeta.ctype ctype:ams.ProcMsg comment:"Message from/to a process" +dmmeta.ctype ctype:ams.ProcReadMsg comment:"Read process output" +dmmeta.ctype ctype:ams.ProcStartMsg comment:"Start process" +dmmeta.ctype ctype:ams.ProcStatusMsg comment:"Process status" +dmmeta.ctype ctype:ams.Proctype comment:"" +dmmeta.ctype ctype:ams.RemDirRecurseMsg comment:"Message sent to process to terminate it" +dmmeta.ctype ctype:ams.ShmFlags comment:"" +dmmeta.ctype ctype:ams.ShmHbMsg comment:"Shm heartbeat" +dmmeta.ctype ctype:ams.ShmId comment:"Host-unique stream ID. E.g. proc1-0.out-0" +dmmeta.ctype ctype:ams.ShmemberFlags comment:"Shm member flags" +dmmeta.ctype ctype:ams.ShmemberId comment:"Shm/Process - member ID for AMS SHM" +dmmeta.ctype ctype:ams.Shmmsg comment:"Sequenced message on a shm" +dmmeta.ctype ctype:ams.Shmtype comment:"" dmmeta.ctype ctype:ams.TerminateMsg comment:"Message sent to process to terminate it" -dmmeta.ctype ctype:ams.Trace2Msg comment:"Trace2 message" -dmmeta.ctype ctype:ams.TraceInfo2Msg comment:"Trace info message" -dmmeta.ctype ctype:ams.TraceInfoMsg comment:"Trace info message" -dmmeta.ctype ctype:ams.TraceMsg comment:"Trace message" dmmeta.ctype ctype:ams.UdpFrame comment:"sniffer-captured ethernet frame" -dmmeta.ctype ctype:ams_cat.FDb comment:"In-memory database for ams_cat" dmmeta.ctype ctype:ams_sendtest.AmsSendTest comment:"" dmmeta.ctype ctype:ams_sendtest.FChild comment:"" dmmeta.ctype ctype:ams_sendtest.FDb comment:"In-memory database for ams_sendtest" -dmmeta.ctype ctype:amsdb.ProcType comment:"" -dmmeta.ctype ctype:amsdb.StreamType comment:"" +dmmeta.ctype ctype:amsdb.Proctype comment:"" +dmmeta.ctype ctype:amsdb.Shmtype comment:"" dmmeta.ctype ctype:apm.FCtype comment:"" dmmeta.ctype ctype:apm.FDb comment:"In-memory database for apm" dmmeta.ctype ctype:apm.FField comment:"" @@ -608,18 +626,23 @@ dmmeta.ctype ctype:atf_amc.FAvl comment:"" dmmeta.ctype ctype:atf_amc.FCascdel comment:"Test type for cascade delete" dmmeta.ctype ctype:atf_amc.FCstring comment:"" dmmeta.ctype ctype:atf_amc.FDb comment:"In-memory database for atf_amc" +dmmeta.ctype ctype:atf_amc.FHashableLinear comment:"" dmmeta.ctype ctype:atf_amc.FListtype comment:"" dmmeta.ctype ctype:atf_amc.FOptG comment:"Something derived from OptG" dmmeta.ctype ctype:atf_amc.FPerfSortString comment:"Function to test string sorting" dmmeta.ctype ctype:atf_amc.FThashElem comment:"" +dmmeta.ctype ctype:atf_amc.FTimeEntry comment:"" dmmeta.ctype ctype:atf_amc.FTypeA comment:"" dmmeta.ctype ctype:atf_amc.FTypeB comment:"" dmmeta.ctype ctype:atf_amc.FTypeC comment:"" dmmeta.ctype ctype:atf_amc.FTypeD comment:"" -dmmeta.ctype ctype:atf_amc.FTypeK comment:"" +dmmeta.ctype ctype:atf_amc.FTypeK comment:"Test element for Ptrary" +dmmeta.ctype ctype:atf_amc.FTypeL comment:"Test element for heap-like Ptrary" +dmmeta.ctype ctype:atf_amc.FTypeM comment:"Test element for non-unique Ptrary" dmmeta.ctype ctype:atf_amc.FTypeS comment:"" dmmeta.ctype ctype:atf_amc.FTypeT comment:"" dmmeta.ctype ctype:atf_amc.FUnitSort comment:"" +dmmeta.ctype ctype:atf_amc.Hashable comment:"" dmmeta.ctype ctype:atf_amc.Hooktype comment:"" dmmeta.ctype ctype:atf_amc.InlaryPrint comment:"" dmmeta.ctype ctype:atf_amc.Lary32 comment:"" @@ -647,6 +670,7 @@ dmmeta.ctype ctype:atf_amc.RpasU32Str6 comment:"number stored as ascii digits, dmmeta.ctype ctype:atf_amc.Sep1 comment:"Check printing/reading of types with separators" dmmeta.ctype ctype:atf_amc.Seqmsg comment:"Sequenced message for stream" dmmeta.ctype ctype:atf_amc.SortedStr comment:"" +dmmeta.ctype ctype:atf_amc.Strkey comment:"" dmmeta.ctype ctype:atf_amc.TaryU32 comment:"" dmmeta.ctype ctype:atf_amc.TaryU8 comment:"" dmmeta.ctype ctype:atf_amc.TestRegx1 comment:"Test automatic reading of Regx" @@ -667,6 +691,10 @@ dmmeta.ctype ctype:atf_amc.TypeS comment:"" dmmeta.ctype ctype:atf_amc.TypeT comment:"Refers to TypeS" dmmeta.ctype ctype:atf_amc.TypeTVal comment:"Refers to TypeS as Val" dmmeta.ctype ctype:atf_amc.Typefconst comment:"" +dmmeta.ctype ctype:atf_amc.Varlen2Msg comment:"" +dmmeta.ctype ctype:atf_amc.Varlen2aMsg comment:"" +dmmeta.ctype ctype:atf_amc.Varlen2mMsg comment:"" +dmmeta.ctype ctype:atf_amc.Varlen2vMsg comment:"" dmmeta.ctype ctype:atf_amc.VarlenAlloc comment:"An optional instance of atf_unit.A" dmmeta.ctype ctype:atf_amc.VarlenExtern comment:"A varlen array at the end of a struct, but lenfld is external" dmmeta.ctype ctype:atf_amc.VarlenH comment:"" @@ -682,13 +710,14 @@ dmmeta.ctype ctype:atf_ci.FGitfile comment:"" dmmeta.ctype ctype:atf_ci.FMsgfile comment:"" dmmeta.ctype ctype:atf_ci.FNoindent comment:"" dmmeta.ctype ctype:atf_ci.FNs comment:"" -dmmeta.ctype ctype:atf_ci.FReadme comment:"" +dmmeta.ctype ctype:atf_ci.FReadmefile comment:"" dmmeta.ctype ctype:atf_ci.FScriptfile comment:"" dmmeta.ctype ctype:atf_ci.FSsimfile comment:"" dmmeta.ctype ctype:atf_ci.FTargsrc comment:"" dmmeta.ctype ctype:atf_ci.File comment:"" dmmeta.ctype ctype:atf_cmdline.FDb comment:"In-memory database for atf_cmdline" dmmeta.ctype ctype:atf_comp.FComptest comment:"" +dmmeta.ctype ctype:atf_comp.FCovdir comment:"" dmmeta.ctype ctype:atf_comp.FDb comment:"In-memory database for atf_comp" dmmeta.ctype ctype:atf_comp.FTargs comment:"" dmmeta.ctype ctype:atf_comp.FTfilt comment:"" @@ -702,6 +731,10 @@ dmmeta.ctype ctype:atf_cov.FTarget comment:"" dmmeta.ctype ctype:atf_cov.FTargsrc comment:"" dmmeta.ctype ctype:atf_cov.FTgtcov comment:"" dmmeta.ctype ctype:atf_cov.Phase comment:"" +dmmeta.ctype ctype:atf_exp.FDb comment:"" +dmmeta.ctype ctype:atf_exp.FFdin comment:"FD input (normally stdin)" +dmmeta.ctype ctype:atf_exp.FProc comment:"" +dmmeta.ctype ctype:atf_exp.Proc comment:"" dmmeta.ctype ctype:atf_fuzz.FDb comment:"In-memory database for atf_fuzz" dmmeta.ctype ctype:atf_fuzz.FFuzzstrat comment:"" dmmeta.ctype ctype:atf_fuzz.FTarget comment:"" @@ -736,6 +769,7 @@ dmmeta.ctype ctype:atfdb.TestGsymbolStrptr comment:"" dmmeta.ctype ctype:atfdb.Tfilt comment:"" dmmeta.ctype ctype:atfdb.Tmsg comment:"" dmmeta.ctype ctype:atfdb.Unittest comment:"" +dmmeta.ctype ctype:atfdb.Var comment:"" dmmeta.ctype ctype:bash2html.FDb comment:"In-memory database for bash2html" dmmeta.ctype ctype:bool comment:"1-byte bool, c++ type." dmmeta.ctype ctype:char comment:"" @@ -751,7 +785,6 @@ dmmeta.ctype ctype:command.acr_my comment:"" dmmeta.ctype ctype:command.amc comment:"" dmmeta.ctype ctype:command.amc_gc comment:"" dmmeta.ctype ctype:command.amc_vis comment:"" -dmmeta.ctype ctype:command.ams_cat comment:"" dmmeta.ctype ctype:command.ams_sendtest comment:"" dmmeta.ctype ctype:command.apm comment:"" dmmeta.ctype ctype:command.aqlite comment:"" @@ -760,6 +793,7 @@ dmmeta.ctype ctype:command.atf_ci comment:"" dmmeta.ctype ctype:command.atf_cmdline comment:"" dmmeta.ctype ctype:command.atf_comp comment:"" dmmeta.ctype ctype:command.atf_cov comment:"" +dmmeta.ctype ctype:command.atf_exp comment:"" dmmeta.ctype ctype:command.atf_fuzz comment:"" dmmeta.ctype ctype:command.atf_gcli comment:"" dmmeta.ctype ctype:command.atf_nrun comment:"" @@ -769,9 +803,13 @@ dmmeta.ctype ctype:command.bash2html comment:"" dmmeta.ctype ctype:command.bash_proc comment:"" dmmeta.ctype ctype:command.gcache comment:"" dmmeta.ctype ctype:command.gcli comment:"" +dmmeta.ctype ctype:command.generic comment:"Any generic subprocess" +dmmeta.ctype ctype:command.generic_proc comment:"" +dmmeta.ctype ctype:command.jkv comment:"" dmmeta.ctype ctype:command.mdbg comment:"" dmmeta.ctype ctype:command.mysql2ssim comment:"" dmmeta.ctype ctype:command.orgfile comment:"" +dmmeta.ctype ctype:command.samp_make comment:"" dmmeta.ctype ctype:command.samp_meng comment:"" dmmeta.ctype ctype:command.samp_regx comment:"" dmmeta.ctype ctype:command.sandbox comment:"" @@ -804,13 +842,16 @@ dmmeta.ctype ctype:dev.Linelim comment:"" dmmeta.ctype ctype:dev.Mdmark comment:"invisible markers for markdown files" dmmeta.ctype ctype:dev.Mdsection comment:"Template for updating a markdown file" dmmeta.ctype ctype:dev.Msgfile comment:"File in repo containing messages that should be normalized during CI" +dmmeta.ctype ctype:dev.Netproto comment:"Network protocol: add all levels here" dmmeta.ctype ctype:dev.Noindent comment:"Indicates that a file should not be automatically indented" dmmeta.ctype ctype:dev.OptType comment:"Type of option (used in tool_opt)" dmmeta.ctype ctype:dev.Package comment:"OpenACR package" dmmeta.ctype ctype:dev.Pkgdep comment:"OpenACR Package dependency" dmmeta.ctype ctype:dev.Pkgkey comment:"Keys belonging to the OpenACR package" -dmmeta.ctype ctype:dev.Readme comment:"File containing documentation" +dmmeta.ctype ctype:dev.Prototransport comment:"Protocol/transport binding" +dmmeta.ctype ctype:dev.Readmefile comment:"File containing documentation" dmmeta.ctype ctype:dev.Readmesort comment:"sorted categories of txt/ *.md files presented in dev.readme" +dmmeta.ctype ctype:dev.Rpm comment:"" dmmeta.ctype ctype:dev.Sandbox comment:"Registered sandbox" dmmeta.ctype ctype:dev.Sbpath comment:"Extra files to copy into the sandbox" dmmeta.ctype ctype:dev.Scriptfile comment:"Known script file" @@ -825,6 +866,7 @@ dmmeta.ctype ctype:dev.Targsyslib comment:"Use of system library by target" dmmeta.ctype ctype:dev.Tgtcov comment:"Captured line coverate information by target" dmmeta.ctype ctype:dev.Timefmt comment:"Time formats supported by orgfile" dmmeta.ctype ctype:dev.ToolOpt comment:"Compiler/linker options to use" +dmmeta.ctype ctype:dev.Transport comment:"Transport layer" dmmeta.ctype ctype:dev.Uname comment:"List of known unames" dmmeta.ctype ctype:dev.Unstablefld comment:"Fields that should be stripped from component test output because they contain timestamps etc." dmmeta.ctype ctype:dmmeta.Anonfld comment:"Omit field name where possible (command line, enums, constants)" @@ -842,6 +884,7 @@ dmmeta.ctype ctype:dmmeta.Cfmt comment:"Specify options for printing/reading c dmmeta.ctype ctype:dmmeta.Cget comment:"Generate state functions for these ctypes" dmmeta.ctype ctype:dmmeta.Charset comment:"Generate functions to determine if a character is a member of a set" dmmeta.ctype ctype:dmmeta.Chash comment:"Generate hash function" +dmmeta.ctype ctype:dmmeta.Ckafka comment:"" dmmeta.ctype ctype:dmmeta.Cppfunc comment:"Value of field provided by this expression" dmmeta.ctype ctype:dmmeta.Cppkeyword comment:"Built-in C++ keyword" dmmeta.ctype ctype:dmmeta.Cpptype comment:"Specify whether a ctype can be passed by value, and other c++ options" @@ -865,6 +908,7 @@ dmmeta.ctype ctype:dmmeta.Fbigend comment:"Annotate field as having big-endian dmmeta.ctype ctype:dmmeta.Fbitset comment:"Generate bitset functions over integer field or array" dmmeta.ctype ctype:dmmeta.Fbuf comment:"Buffer for reading/writing messages, works with Iohook" dmmeta.ctype ctype:dmmeta.Fbufdir comment:"Buffer direction (in,out)" +dmmeta.ctype ctype:dmmeta.Fbufiotype comment:"Underlying IO type" dmmeta.ctype ctype:dmmeta.Fbuftype comment:"Buffer type" dmmeta.ctype ctype:dmmeta.Fcast comment:"Generate implicit conversion from field to c++ expression" dmmeta.ctype ctype:dmmeta.Fcleanup comment:"Request user-implemented function to be called at Uninit time for a field" @@ -881,6 +925,7 @@ dmmeta.ctype ctype:dmmeta.Fflag comment:"Options for command-line flags" dmmeta.ctype ctype:dmmeta.Field comment:"Specify field of a struct" dmmeta.ctype ctype:dmmeta.Findrem comment:"Request generation of FindRemove function" dmmeta.ctype ctype:dmmeta.Finput comment:"Describe input table of a program" +dmmeta.ctype ctype:dmmeta.Fkafka comment:"" dmmeta.ctype ctype:dmmeta.Fldoffset comment:"Assert field offset - will result in compile-time error if violated" dmmeta.ctype ctype:dmmeta.Floadtuples comment:"Request that process automatically load any input tables on startup" dmmeta.ctype ctype:dmmeta.Fnoremove comment:"Omit any functions for removing elements from table; Table is append-only" @@ -901,6 +946,8 @@ dmmeta.ctype ctype:dmmeta.Gsymbol comment:"Create C++ symbols from entries in dmmeta.ctype ctype:dmmeta.Hashtype comment:"Hash function type" dmmeta.ctype ctype:dmmeta.Hook comment:"Required on Hook fields" dmmeta.ctype ctype:dmmeta.Inlary comment:"Generate inline array of fixed or variable length (all entries fit within parent struct)" +dmmeta.ctype ctype:dmmeta.Jstype comment:"" +dmmeta.ctype ctype:dmmeta.KafkaTypeKind comment:"" dmmeta.ctype ctype:dmmeta.Lenfld comment:"Specify which gives length of varlen portion in bytes" dmmeta.ctype ctype:dmmeta.Listtype comment:"Specify structure of linked list based on field prefix" dmmeta.ctype ctype:dmmeta.Llist comment:"Options for Llist field" @@ -915,6 +962,7 @@ dmmeta.ctype ctype:dmmeta.Nscpp comment:"Generate C++ code for this namespace" dmmeta.ctype ctype:dmmeta.Nsdb comment:"Annotate ssimdb namespaces" dmmeta.ctype ctype:dmmeta.Nsfast comment:"Whether namespace is FAST" dmmeta.ctype ctype:dmmeta.Nsinclude comment:"Explicitly specify a C++ include file for namespace" +dmmeta.ctype ctype:dmmeta.Nsjs comment:"Generate JavaScript code for this namespace" dmmeta.ctype ctype:dmmeta.Nsproto comment:"Annotate protocol namespace (collection of types, no state)" dmmeta.ctype ctype:dmmeta.Nstype comment:"Namespace type" dmmeta.ctype ctype:dmmeta.Nsversion comment:"Namespace version" @@ -946,6 +994,7 @@ dmmeta.ctype ctype:dmmeta.Thash comment:"Hash index, required for fields with dmmeta.ctype ctype:dmmeta.Tracefld comment:"Trace fields" dmmeta.ctype ctype:dmmeta.Tracerec comment:"Trace record" dmmeta.ctype ctype:dmmeta.Typefld comment:"Specifies which field of a message carries the type" +dmmeta.ctype ctype:dmmeta.Userfunc comment:"" dmmeta.ctype ctype:dmmeta.Usertracefld comment:"Add custom user trace fields to process's trace struct" dmmeta.ctype ctype:dmmeta.Xref comment:"Specify how to cross-reference (i.e. project, or group-by) one record with another" dmmeta.ctype ctype:double comment:"" @@ -979,8 +1028,6 @@ dmmeta.ctype ctype:gcli.FGfld comment:"" dmmeta.ctype ctype:gcli.FGithost comment:"" dmmeta.ctype ctype:gcli.FGmethod comment:"" dmmeta.ctype ctype:gcli.FGrepo comment:"" -dmmeta.ctype ctype:gcli.FGrepogitport comment:"" -dmmeta.ctype ctype:gcli.FGrepossh comment:"" dmmeta.ctype ctype:gcli.FGstatet comment:"" dmmeta.ctype ctype:gcli.FGtbl comment:"" dmmeta.ctype ctype:gcli.FGtblact comment:"" @@ -999,7 +1046,7 @@ dmmeta.ctype ctype:gcli.FTuples comment:"" dmmeta.ctype ctype:gcli.FUser comment:"" dmmeta.ctype ctype:gclidb.Gact comment:"Action that may be performed on a table" dmmeta.ctype ctype:gclidb.Gatv comment:"" -dmmeta.ctype ctype:gclidb.Gclicmd comment:"" +dmmeta.ctype ctype:gclidb.Gclicmd comment:"table of static gcli commands" dmmeta.ctype ctype:gclidb.Gclicmdf2j comment:"Mapping of internal fields to JSON fields for gitlab/github" dmmeta.ctype ctype:gclidb.Gclicmdt comment:"Internal test" dmmeta.ctype ctype:gclidb.Gclienv comment:"" @@ -1009,12 +1056,10 @@ dmmeta.ctype ctype:gclidb.Gfld comment:"Gitlab/github field name" dmmeta.ctype ctype:gclidb.Githost comment:"" dmmeta.ctype ctype:gclidb.Gmethod comment:"HTTP method list" dmmeta.ctype ctype:gclidb.Grepo comment:"Repo table (acr grepo -in ~/.ssim)" -dmmeta.ctype ctype:gclidb.Grepogitport comment:"Default ports for repositories" -dmmeta.ctype ctype:gclidb.Grepossh comment:"Ssh key table" dmmeta.ctype ctype:gclidb.Gstate comment:"Issue/MR state list" dmmeta.ctype ctype:gclidb.Gstatet comment:Internal dmmeta.ctype ctype:gclidb.Gtbl comment:"Supported gcli tables" -dmmeta.ctype ctype:gclidb.Gtblact comment:"" +dmmeta.ctype ctype:gclidb.Gtblact comment:"static combination of gcli tables and actions" dmmeta.ctype ctype:gclidb.Gtblactfld comment:"List of available for each table & action combination" dmmeta.ctype ctype:gclidb.Gtblacttst comment:"" dmmeta.ctype ctype:gclidb.Gtblacttstout comment:"" @@ -1031,22 +1076,101 @@ dmmeta.ctype ctype:gclidb.Mrjob comment:"Mr job" dmmeta.ctype ctype:gclidb.Mrnote comment:"Issue note" dmmeta.ctype ctype:gclidb.Project comment:"Gitlab project mr" dmmeta.ctype ctype:gclidb.User comment:"" +dmmeta.ctype ctype:http.ExtensionHeader comment:"" +dmmeta.ctype ctype:http.HeaderType comment:"" +dmmeta.ctype ctype:http.Method comment:"" +dmmeta.ctype ctype:http.Request comment:"" +dmmeta.ctype ctype:http.Response comment:"" +dmmeta.ctype ctype:httpdb.Content comment:"core/common Content-Type values" +dmmeta.ctype ctype:httpdb.Header comment:"" +dmmeta.ctype ctype:httpdb.Method comment:"" +dmmeta.ctype ctype:httpdb.Status comment:"" +dmmeta.ctype ctype:httpdb.Version comment:"" dmmeta.ctype ctype:i16 comment:"" dmmeta.ctype ctype:i32 comment:"" dmmeta.ctype ctype:i64 comment:"" dmmeta.ctype ctype:i8 comment:"" +dmmeta.ctype ctype:ibv_ah comment:"ibverbs address handle" +dmmeta.ctype ctype:ibv_context comment:"ibverbs device context" +dmmeta.ctype ctype:ibv_cq_ex comment:"ibverbs Completion Queue" +dmmeta.ctype ctype:ibv_device comment:"ibverbs device struct" +dmmeta.ctype ctype:ibv_flow comment:"ibverbs qp flow" +dmmeta.ctype ctype:ibv_mr comment:"ibverbs memory registration handle" +dmmeta.ctype ctype:ibv_pd comment:"ibverbs device protected domain" +dmmeta.ctype ctype:ibv_qp comment:"ibverbs Queue Pair" +dmmeta.ctype ctype:ibv_recv_wr comment:"ibverbs receive work request handle" +dmmeta.ctype ctype:ibv_sge comment:"ibverbs scatter/gather handle" dmmeta.ctype ctype:iconv_t comment:"" dmmeta.ctype ctype:ietf.Ipport comment:"IP+Port: host format" dmmeta.ctype ctype:ietf.Ipv4 comment:"" dmmeta.ctype ctype:ietf.Ipv4Addr comment:"" +dmmeta.ctype ctype:jkv.FDb comment:"" +dmmeta.ctype ctype:js.AggregateError comment:"Multiple error instances wrapped into one object" +dmmeta.ctype ctype:js.Array comment:"Array: property name is an array index (+0..2^32-1)" +dmmeta.ctype ctype:js.ArrayBuffer comment:"Generic raw binary data buffer" +dmmeta.ctype ctype:js.BigInt comment:"Arbitrary-precision integer" +dmmeta.ctype ctype:js.BigInt64Array comment:"TypedArray: 64-bit two's complement signed integer" +dmmeta.ctype ctype:js.BigUint64Array comment:"TypedArray: 64-bit unsigned integer" +dmmeta.ctype ctype:js.Boolean comment:"Boolean value - `true` and `false`" +dmmeta.ctype ctype:js.DataView comment:"Reading and writing multiple number types in a binary ArrayBuffer" +dmmeta.ctype ctype:js.Date comment:"Number - UTC time in milliseconds since start of 1-Jan-1970" +dmmeta.ctype ctype:js.Error comment:"Thrown when runtime errors occurs" +dmmeta.ctype ctype:js.EvalError comment:"Native error type: (obsolete)" +dmmeta.ctype ctype:js.Float32Array comment:"TypedArray: IEEE floating point" +dmmeta.ctype ctype:js.Float64Array comment:"TypedArray: 64-bit IEEE floating point" +dmmeta.ctype ctype:js.Int16Array comment:"TypedArray: 16-bit two's complement signed integer" +dmmeta.ctype ctype:js.Int32Array comment:"TypedArray: 32-bit two's complement signed integer" +dmmeta.ctype ctype:js.Int8Array comment:"TypedArray: 8-bit two's complement signed integer" +dmmeta.ctype ctype:js.Map comment:"Map: collection of key/value pairs" +dmmeta.ctype ctype:js.Null comment:"Intentional absence of any value, sole value `null`" +dmmeta.ctype ctype:js.Number comment:"IEEE 754-2019 double-precision 64-bit binary" +dmmeta.ctype ctype:js.Object comment:"logically a collection of properties" +dmmeta.ctype ctype:js.RangeError comment:"Native error type: value is out of range" +dmmeta.ctype ctype:js.ReferenceError comment:"Native error type: invalid reference" +dmmeta.ctype ctype:js.RegExp comment:"Regular expression" +dmmeta.ctype ctype:js.Set comment:"Set: collection of distinct values" +dmmeta.ctype ctype:js.SharedArrayBuffer comment:"shared raw binary data buffer" +dmmeta.ctype ctype:js.String comment:"Zero or more 16-bit unsigned integer values" +dmmeta.ctype ctype:js.Symbol comment:"Unique, non-String Object property key" +dmmeta.ctype ctype:js.SyntaxError comment:"Native error type: parsing error" +dmmeta.ctype ctype:js.TypeError comment:"Native error type: unsuccessful operation" +dmmeta.ctype ctype:js.TypedArray comment:"Array-like view of an underlying binary data buffer" +dmmeta.ctype ctype:js.URIError comment:"Native error type: URI encode/decode error" +dmmeta.ctype ctype:js.Uint16Array comment:"TypedArray: 16-bit unsigned integer" +dmmeta.ctype ctype:js.Uint32Array comment:"TypedArray: 32-bit unsigned integer" +dmmeta.ctype ctype:js.Uint8Array comment:"TypedArray: 8-bit unsigned integer" +dmmeta.ctype ctype:js.Uint8ClampedArray comment:"TypedArray: 8-bit unsigned integer (clamped conversion)" +dmmeta.ctype ctype:js.Undefined comment:"A variable has not been assigned a value, sole value `undefined`" +dmmeta.ctype ctype:js.WeakMap comment:"Weak map" +dmmeta.ctype ctype:js.WeakSet comment:"Weak set" +dmmeta.ctype ctype:kafka.AclOperationType comment:"AclOperation type" +dmmeta.ctype ctype:kafka.AclOperations comment:"ACL operations" +dmmeta.ctype ctype:kafka.AclPermissionType comment:"AclPermission type" +dmmeta.ctype ctype:kafka.CompressionType comment:"" +dmmeta.ctype ctype:kafka.ConfigSource comment:"Config type" +dmmeta.ctype ctype:kafka.ConfigType comment:"Config type" +dmmeta.ctype ctype:kafka.Error comment:"" +dmmeta.ctype ctype:kafka.Frame comment:"Frame of binary Kafka protocol" +dmmeta.ctype ctype:kafka.GroupRecordKeyHeader comment:"" +dmmeta.ctype ctype:kafka.GroupRecordValueHeader comment:"" +dmmeta.ctype ctype:kafka.GroupState comment:"Group state" +dmmeta.ctype ctype:kafka.Header comment:"" +dmmeta.ctype ctype:kafka.OffsetCommitKey comment:"" +dmmeta.ctype ctype:kafka.OffsetCommitValue comment:"" +dmmeta.ctype ctype:kafka.PatternType comment:"Pattern type" +dmmeta.ctype ctype:kafka.Record comment:"" +dmmeta.ctype ctype:kafka.RecordBatch comment:"" +dmmeta.ctype ctype:kafka.ResourceType comment:"Resource type" +dmmeta.ctype ctype:kafka.TimestampType comment:"" dmmeta.ctype ctype:lib_ams.FDb comment:"In-memory database for lib_ams" dmmeta.ctype ctype:lib_ams.FFdin comment:"FD input (normally stdin)" -dmmeta.ctype ctype:lib_ams.FMember comment:"" dmmeta.ctype ctype:lib_ams.FProc comment:"" dmmeta.ctype ctype:lib_ams.FReadfile comment:"" -dmmeta.ctype ctype:lib_ams.FStream comment:"Stream record" -dmmeta.ctype ctype:lib_ams.FStreamType comment:"" +dmmeta.ctype ctype:lib_ams.FShm comment:"Shm record" +dmmeta.ctype ctype:lib_ams.FShmember comment:"" +dmmeta.ctype ctype:lib_ams.FShmtype comment:"" dmmeta.ctype ctype:lib_ams.FWritefile comment:"" +dmmeta.ctype ctype:lib_ams.MsgFmt comment:"" dmmeta.ctype ctype:lib_ctype.Cmdline comment:"" dmmeta.ctype ctype:lib_ctype.FBltin comment:"" dmmeta.ctype ctype:lib_ctype.FCdflt comment:"" @@ -1062,6 +1186,9 @@ dmmeta.ctype ctype:lib_ctype.FSsimfile comment:"" dmmeta.ctype ctype:lib_ctype.FSubstr comment:"" dmmeta.ctype ctype:lib_ctype.FUnstablefld comment:"" dmmeta.ctype ctype:lib_ctype.Match comment:"" +dmmeta.ctype ctype:lib_curl.FDb comment:"" +dmmeta.ctype ctype:lib_curl.FRequest comment:"curl request structure" +dmmeta.ctype ctype:lib_curl.FResponse comment:"curl response structure" dmmeta.ctype ctype:lib_exec.Cmdline comment:"" dmmeta.ctype ctype:lib_exec.FDb comment:"" dmmeta.ctype ctype:lib_exec.FSyscmd comment:"" @@ -1071,6 +1198,8 @@ dmmeta.ctype ctype:lib_fm.FAlmCode comment:"" dmmeta.ctype ctype:lib_fm.FAlmObjtype comment:"" dmmeta.ctype ctype:lib_fm.FDb comment:"In-memory database for lib_fm" dmmeta.ctype ctype:lib_git.FDb comment:"In-memory database for lib_git" +dmmeta.ctype ctype:lib_http.FDb comment:"" +dmmeta.ctype ctype:lib_http.FStatus comment:"" dmmeta.ctype ctype:lib_iconv.FDb comment:"In-memory database for lib_iconv" dmmeta.ctype ctype:lib_iconv.Icd comment:"" dmmeta.ctype ctype:lib_json.FDb comment:"In-memory database for lib_json" @@ -1079,6 +1208,10 @@ dmmeta.ctype ctype:lib_json.FParser comment:"" dmmeta.ctype ctype:lib_json.FldKey comment:"" dmmeta.ctype ctype:lib_mysql.FDb comment:"In-memory database for lib_mysql" dmmeta.ctype ctype:lib_mysql.Res comment:"" +dmmeta.ctype ctype:lib_netio.FDb comment:"" +dmmeta.ctype ctype:lib_netio.FVar comment:"" +dmmeta.ctype ctype:lib_rl.Cmdline comment:"" +dmmeta.ctype ctype:lib_rl.FDb comment:"" dmmeta.ctype ctype:lib_sql.FAttr comment:"" dmmeta.ctype ctype:lib_sql.FDb comment:"In-memory database for lib_sql" dmmeta.ctype ctype:lib_sqlite.Cons comment:"" @@ -1094,6 +1227,8 @@ dmmeta.ctype ctype:lib_sqlite.FSsimfile comment:"" dmmeta.ctype ctype:lib_sqlite.FSubstr comment:"" dmmeta.ctype ctype:lib_sqlite.Vtab comment:"An instance of the virtual table" dmmeta.ctype ctype:lib_sqlite.VtabCurs comment:"A cursor for the virtual table" +dmmeta.ctype ctype:lib_ws.FDb comment:"In-memory database for lib_ws" +dmmeta.ctype ctype:lib_ws.FrameIdx comment:"" dmmeta.ctype ctype:mdbg.FBuilddir comment:"" dmmeta.ctype ctype:mdbg.FCfg comment:"" dmmeta.ctype ctype:mdbg.FDb comment:"In-memory database for mdbg" @@ -1107,6 +1242,8 @@ dmmeta.ctype ctype:orgfile.dedup comment:"" dmmeta.ctype ctype:orgfile.move comment:"" dmmeta.ctype ctype:pad_byte comment:"" dmmeta.ctype ctype:pid_t comment:"" +dmmeta.ctype ctype:rdma_cm_id comment:"RDMA CM id" +dmmeta.ctype ctype:rdma_event_channel comment:"RDMA event channel" dmmeta.ctype ctype:report.abt comment:"" dmmeta.ctype ctype:report.acr comment:"" dmmeta.ctype ctype:report.acr_check comment:"" @@ -1116,17 +1253,23 @@ dmmeta.ctype ctype:report.atf_unit comment:"" dmmeta.ctype ctype:report.gcache comment:"" dmmeta.ctype ctype:report.gcache_hitrate comment:"" dmmeta.ctype ctype:report.src_func comment:"" +dmmeta.ctype ctype:samp_make.FDb comment:"" +dmmeta.ctype ctype:samp_make.FGitfile comment:"" +dmmeta.ctype ctype:samp_make.FTargdep comment:"" +dmmeta.ctype ctype:samp_make.FTarget comment:"" +dmmeta.ctype ctype:samp_make.FTargrec comment:"" +dmmeta.ctype ctype:samp_make.FTargsrc comment:"" dmmeta.ctype ctype:samp_meng.CancelOrderMsg comment:"From matching engine: cancel order" dmmeta.ctype ctype:samp_meng.CancelReqMsg comment:"From user: cancel request" -dmmeta.ctype ctype:samp_meng.FDb comment:"" -dmmeta.ctype ctype:samp_meng.FFdin comment:"FD input" -dmmeta.ctype ctype:samp_meng.FOrder comment:"" -dmmeta.ctype ctype:samp_meng.FOrdq comment:"" -dmmeta.ctype ctype:samp_meng.FSymbol comment:"" -dmmeta.ctype ctype:samp_meng.FUser comment:"" -dmmeta.ctype ctype:samp_meng.I64Price8 comment:"" +dmmeta.ctype ctype:samp_meng.FDb comment:"In-memory database" +dmmeta.ctype ctype:samp_meng.FFdin comment:"File descriptor input" +dmmeta.ctype ctype:samp_meng.FOrder comment:"Order record" +dmmeta.ctype ctype:samp_meng.FOrdq comment:"Order queue record" +dmmeta.ctype ctype:samp_meng.FSymbol comment:"Symbol record" +dmmeta.ctype ctype:samp_meng.FUser comment:"User record" +dmmeta.ctype ctype:samp_meng.I64Price8 comment:"Price type (8 implied decimal places)" dmmeta.ctype ctype:samp_meng.MassCancelReqMsg comment:"From user: cancel mass request" -dmmeta.ctype ctype:samp_meng.MsgHeader comment:"" +dmmeta.ctype ctype:samp_meng.MsgHeader comment:"Message header" dmmeta.ctype ctype:samp_meng.NewOrderMsg comment:"From matching engine: new order" dmmeta.ctype ctype:samp_meng.NewOrderReqMsg comment:"From user: new order request" dmmeta.ctype ctype:samp_meng.NewSymbolMsg comment:"From matching engine: new symbol" @@ -1134,10 +1277,15 @@ dmmeta.ctype ctype:samp_meng.NewSymbolReqMsg comment:"To matching engine: new dmmeta.ctype ctype:samp_meng.NewUserMsg comment:"From matching engine: new user" dmmeta.ctype ctype:samp_meng.NewUserReqMsg comment:"To matching engine: new user request" dmmeta.ctype ctype:samp_meng.OrderTradeMsg comment:"From matching engine: trade order" -dmmeta.ctype ctype:samp_meng.Ordkey comment:"" -dmmeta.ctype ctype:samp_meng.Symbol comment:"" -dmmeta.ctype ctype:samp_meng.TextMsg comment:"debug message" +dmmeta.ctype ctype:samp_meng.Ordkey comment:"Order key" +dmmeta.ctype ctype:samp_meng.Symbol comment:"Symbol name" +dmmeta.ctype ctype:samp_meng.TextMsg comment:"Debug message" dmmeta.ctype ctype:samp_regx.FDb comment:"In-memory database for samp_regx" +dmmeta.ctype ctype:sampdb.Gitfile comment:"samp_make list of gitfile sources" +dmmeta.ctype ctype:sampdb.Targdep comment:"samp_make targets dependencies" +dmmeta.ctype ctype:sampdb.Target comment:"samp_make targets list" +dmmeta.ctype ctype:sampdb.Targrec comment:"samp_make recipe for a target" +dmmeta.ctype ctype:sampdb.Targsrc comment:"samp_make targets source dependencies" dmmeta.ctype ctype:sandbox.FDb comment:"In-memory database for sandbox" dmmeta.ctype ctype:sandbox.FSandbox comment:"" dmmeta.ctype ctype:sandbox.FSbpath comment:"" @@ -1146,13 +1294,11 @@ dmmeta.ctype ctype:sqlite3_vtab comment:"" dmmeta.ctype ctype:sqlite3_vtab_cursor comment:"" dmmeta.ctype ctype:src_func.FCtypelen comment:"" dmmeta.ctype ctype:src_func.FDb comment:"In-memory database for src_func" -dmmeta.ctype ctype:src_func.FDispatch comment:"" -dmmeta.ctype ctype:src_func.FFstep comment:"" dmmeta.ctype ctype:src_func.FFunc comment:"" -dmmeta.ctype ctype:src_func.FGenprefix comment:"Prefixes of generated functions, skip generating prototypes for those" -dmmeta.ctype ctype:src_func.FGstatic comment:"" +dmmeta.ctype ctype:src_func.FGenaffix comment:"Prefix or suffix of a generated function -- skip generating prototype" dmmeta.ctype ctype:src_func.FTarget comment:"" dmmeta.ctype ctype:src_func.FTargsrc comment:"" +dmmeta.ctype ctype:src_func.FUserfunc comment:"" dmmeta.ctype ctype:src_hdr.FCopyline comment:"" dmmeta.ctype ctype:src_hdr.FCopyright comment:"" dmmeta.ctype ctype:src_hdr.FDb comment:"In-memory database for src_hdr" @@ -1196,3 +1342,20 @@ dmmeta.ctype ctype:u16 comment:"" dmmeta.ctype ctype:u32 comment:"" dmmeta.ctype ctype:u64 comment:"" dmmeta.ctype ctype:u8 comment:"" +dmmeta.ctype ctype:ws.CloseMsg comment:"" +dmmeta.ctype ctype:ws.ConnectMsg comment:"" +dmmeta.ctype ctype:ws.DataMsg comment:"" +dmmeta.ctype ctype:ws.Frame comment:"" +dmmeta.ctype ctype:ws.Frame16 comment:"" +dmmeta.ctype ctype:ws.Frame64 comment:"" +dmmeta.ctype ctype:ws.FrameHeader comment:"" +dmmeta.ctype ctype:ws.FrameMasked comment:"" +dmmeta.ctype ctype:ws.FrameMasked16 comment:"" +dmmeta.ctype ctype:ws.FrameMasked64 comment:"" +dmmeta.ctype ctype:ws.HttpState comment:"" +dmmeta.ctype ctype:ws.Opcode comment:"" +dmmeta.ctype ctype:ws.ServerStartMsg comment:"" +dmmeta.ctype ctype:ws.ServerStopMsg comment:"" +dmmeta.ctype ctype:ws.Side comment:"" +dmmeta.ctype ctype:ws.StatusCode comment:"" +dmmeta.ctype ctype:wsdb.Status comment:"" diff --git a/data/dmmeta/ctypelen.ssim b/data/dmmeta/ctypelen.ssim index 7a072820..3c3b2c53 100644 --- a/data/dmmeta/ctypelen.ssim +++ b/data/dmmeta/ctypelen.ssim @@ -1,49 +1,52 @@ -dmmeta.ctypelen ctype:abt.FArch len:216 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:abt.FBuilddir len:288 alignment:8 padbytes:3 plaindata:N -dmmeta.ctypelen ctype:abt.FCfg len:224 alignment:8 padbytes:5 plaindata:N -dmmeta.ctypelen ctype:abt.FCompiler len:544 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:abt.FDb len:5816 alignment:8 padbytes:92 plaindata:N -dmmeta.ctypelen ctype:abt.FFilestat len:48 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:abt.FInclude len:400 alignment:8 padbytes:12 plaindata:N -dmmeta.ctypelen ctype:abt.FNs len:288 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:abt.FSrcfile len:336 alignment:8 padbytes:30 plaindata:N -dmmeta.ctypelen ctype:abt.FSyscmd len:184 alignment:8 padbytes:21 plaindata:N +dmmeta.ctypelen ctype:abt.FArch len:224 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:abt.FBuilddir len:296 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:abt.FCfg len:232 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:abt.FCompiler len:552 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:abt.FDb len:5624 alignment:8 padbytes:92 plaindata:N +dmmeta.ctypelen ctype:abt.FFilestat len:56 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:abt.FInclude len:400 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:abt.FNs len:288 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:abt.FSrcfile len:344 alignment:8 padbytes:34 plaindata:N +dmmeta.ctypelen ctype:abt.FSyscmd len:192 alignment:8 padbytes:21 plaindata:N dmmeta.ctypelen ctype:abt.FSyscmddep len:40 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:abt.FSyslib len:216 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:abt.FSyslib len:216 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:abt.FTargdep len:224 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:abt.FTarget len:200 alignment:8 padbytes:18 plaindata:N -dmmeta.ctypelen ctype:abt.FTargsrc len:280 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:abt.FTarget len:208 alignment:8 padbytes:22 plaindata:N +dmmeta.ctypelen ctype:abt.FTargsrc len:288 alignment:8 padbytes:13 plaindata:N dmmeta.ctypelen ctype:abt.FTargsyslib len:224 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:abt.FToolOpt len:432 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:abt.FUname len:216 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:abt.FToolOpt len:336 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:abt.FUname len:216 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:abt.config len:84 alignment:4 padbytes:2 plaindata:Y -dmmeta.ctypelen ctype:abt_md.FAnchor len:24 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:abt_md.FComptest len:212 alignment:4 padbytes:1 plaindata:Y -dmmeta.ctypelen ctype:abt_md.FCtype len:320 alignment:8 padbytes:9 plaindata:N -dmmeta.ctypelen ctype:abt_md.FDb len:25536 alignment:16 padbytes:103 plaindata:N +dmmeta.ctypelen ctype:abt_md.FAnchor len:32 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:abt_md.FComptest len:224 alignment:4 padbytes:4 plaindata:Y +dmmeta.ctypelen ctype:abt_md.FCtype len:328 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:abt_md.FDb len:24496 alignment:16 padbytes:119 plaindata:N dmmeta.ctypelen ctype:abt_md.FDirent len:72 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:abt_md.FDirscan len:280 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:abt_md.FDispatch len:248 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:abt_md.FDispatchMsg len:272 alignment:8 padbytes:9 plaindata:N dmmeta.ctypelen ctype:abt_md.FFconst len:507 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:abt_md.FField len:752 alignment:8 padbytes:17 plaindata:N +dmmeta.ctypelen ctype:abt_md.FField len:752 alignment:8 padbytes:13 plaindata:N dmmeta.ctypelen ctype:abt_md.FFileSection len:80 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:abt_md.FFinput len:288 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:abt_md.FGconst len:307 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:abt_md.FGstatic len:264 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:abt_md.FHumanText len:56 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:abt_md.FGstatic len:272 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:abt_md.FHumanText len:64 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:abt_md.FLink len:48 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:abt_md.FMdsection len:776 alignment:8 padbytes:8 plaindata:N -dmmeta.ctypelen ctype:abt_md.FNs len:352 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:abt_md.FNstype len:216 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:abt_md.FReadme len:512 alignment:8 padbytes:13 plaindata:N -dmmeta.ctypelen ctype:abt_md.FReadmesort len:432 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:abt_md.FMdsection len:680 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:abt_md.FNs len:416 alignment:8 padbytes:14 plaindata:N +dmmeta.ctypelen ctype:abt_md.FNstype len:216 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:abt_md.FReadmefile len:512 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:abt_md.FReadmesort len:432 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:abt_md.FReftype len:72 alignment:8 padbytes:1 plaindata:N -dmmeta.ctypelen ctype:abt_md.FScriptfile len:416 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:abt_md.FSsimfile len:176 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:abt_md.FScriptfile len:424 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:abt_md.FSsimfile len:176 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:abt_md.FSubstr len:464 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:abt_md.FTargdep len:224 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:abt_md.FTarget len:56 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:abt_md.FTarget len:56 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:abt_md.FTargsrc len:255 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:abt_md.FTclass len:216 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:acr.AttrRegx len:176 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:abt_md.FTclass len:216 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:acr.AttrRegx len:80 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:acr.CtypeTopoKey len:8 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr.Err len:48 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:acr.FAnonfld len:102 alignment:1 padbytes:0 plaindata:Y @@ -51,27 +54,27 @@ dmmeta.ctypelen ctype:acr.FBltin len:105 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr.FCdflt len:710 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr.FCheck len:40 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:acr.FCppfunc len:356 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:acr.FCtype len:488 alignment:8 padbytes:33 plaindata:N +dmmeta.ctypelen ctype:acr.FCtype len:496 alignment:8 padbytes:37 plaindata:N dmmeta.ctypelen ctype:acr.FDb len:4616 alignment:8 padbytes:80 plaindata:N dmmeta.ctypelen ctype:acr.FErr len:72 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:acr.FEvalattr len:48 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:acr.FField len:728 alignment:8 padbytes:8 plaindata:N -dmmeta.ctypelen ctype:acr.FFile len:80 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:acr.FField len:728 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:acr.FFile len:88 alignment:8 padbytes:13 plaindata:N dmmeta.ctypelen ctype:acr.FFunique len:102 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr.FPdep len:64 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:acr.FPline len:208 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:acr.FPrint len:80 alignment:8 padbytes:8 plaindata:N -dmmeta.ctypelen ctype:acr.FPrintAttr len:128 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:acr.FQuery len:400 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:acr.FRec len:336 alignment:8 padbytes:3 plaindata:N +dmmeta.ctypelen ctype:acr.FPrintAttr len:136 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:acr.FQuery len:256 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:acr.FRec len:352 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:acr.FSmallstr len:416 alignment:4 padbytes:5 plaindata:Y -dmmeta.ctypelen ctype:acr.FSortkey len:152 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:acr.FSsimfile len:192 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:acr.FSsimreq len:480 alignment:8 padbytes:9 plaindata:N -dmmeta.ctypelen ctype:acr.FSsimsort len:168 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:acr.FSortkey len:160 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:acr.FSsimfile len:192 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:acr.FSsimreq len:432 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:acr.FSsimsort len:168 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:acr.FSubstr len:456 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:acr.FTempkey len:24 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:acr.FUniqueattr len:32 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:acr.FTempkey len:32 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:acr.FUniqueattr len:40 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:acr.FWrite len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:acr.PlineKey len:152 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:acr.Queryop len:1 alignment:1 padbytes:0 plaindata:Y @@ -83,53 +86,54 @@ dmmeta.ctypelen ctype:acr_compl.FAnonfld len:254 alignment:1 padbytes:0 pla dmmeta.ctypelen ctype:acr_compl.FArgvtype len:306 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr_compl.FCompletion len:64 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:acr_compl.FComplsource len:48 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:acr_compl.FCtype len:296 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:acr_compl.FCtype len:304 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:acr_compl.FDb len:3480 alignment:8 padbytes:63 plaindata:N dmmeta.ctypelen ctype:acr_compl.FFalias len:376 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:acr_compl.FFcmdline len:376 alignment:8 padbytes:3 plaindata:N dmmeta.ctypelen ctype:acr_compl.FFconst len:507 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr_compl.FFflag len:272 alignment:8 padbytes:1 plaindata:N -dmmeta.ctypelen ctype:acr_compl.FField len:784 alignment:8 padbytes:18 plaindata:N -dmmeta.ctypelen ctype:acr_compl.FNs len:296 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:acr_compl.FSsimfile len:176 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:acr_compl.FField len:792 alignment:8 padbytes:18 plaindata:N +dmmeta.ctypelen ctype:acr_compl.FNs len:296 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:acr_compl.FSsimfile len:176 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:acr_compl.Shellqtype len:1 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr_dm.FAttr len:56 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:acr_dm.FDb len:872 alignment:8 padbytes:19 plaindata:N -dmmeta.ctypelen ctype:acr_dm.FTuple len:80 alignment:8 padbytes:19 plaindata:N +dmmeta.ctypelen ctype:acr_dm.FTuple len:80 alignment:8 padbytes:15 plaindata:N dmmeta.ctypelen ctype:acr_dm.FValue len:40 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:acr_dm.Rowid len:12 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr_dm.Source len:1 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr_ed.FCfmt len:331 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr_ed.FCpptype len:105 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr_ed.FCstr len:255 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:acr_ed.FCtype len:344 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:acr_ed.FDb len:11136 alignment:16 padbytes:89 plaindata:N -dmmeta.ctypelen ctype:acr_ed.FEdaction len:232 alignment:8 padbytes:10 plaindata:N -dmmeta.ctypelen ctype:acr_ed.FField len:704 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:acr_ed.FFprefix len:224 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:acr_ed.FCtype len:352 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:acr_ed.FDb len:11360 alignment:16 padbytes:101 plaindata:N +dmmeta.ctypelen ctype:acr_ed.FEdaction len:240 alignment:8 padbytes:14 plaindata:N +dmmeta.ctypelen ctype:acr_ed.FField len:704 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:acr_ed.FFprefix len:224 alignment:8 padbytes:1 plaindata:N dmmeta.ctypelen ctype:acr_ed.FGitfile len:202 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:acr_ed.FListtype len:176 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:acr_ed.FNs len:288 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:acr_ed.FNsdb len:184 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:acr_ed.FListtype len:176 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:acr_ed.FMsgtype len:354 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:acr_ed.FNs len:288 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:acr_ed.FNsdb len:184 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:acr_ed.FPack len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr_ed.FSbpath len:204 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:acr_ed.FSsimfile len:184 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:acr_ed.FTarget len:64 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:acr_ed.FSsimfile len:184 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:acr_ed.FTarget len:72 alignment:8 padbytes:10 plaindata:N dmmeta.ctypelen ctype:acr_ed.FTargsrc len:280 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:acr_ed.FTypefld len:254 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:acr_in.FCtype len:360 alignment:8 padbytes:14 plaindata:N -dmmeta.ctypelen ctype:acr_in.FDb len:3528 alignment:8 padbytes:75 plaindata:N -dmmeta.ctypelen ctype:acr_in.FDispsig len:88 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:acr_in.FField len:704 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:acr_in.FFinput len:288 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:acr_in.FNs len:320 alignment:8 padbytes:9 plaindata:N -dmmeta.ctypelen ctype:acr_in.FNsssimfile len:264 alignment:8 padbytes:5 plaindata:N -dmmeta.ctypelen ctype:acr_in.FSsimfile len:224 alignment:8 padbytes:17 plaindata:N +dmmeta.ctypelen ctype:acr_in.FCtype len:368 alignment:8 padbytes:18 plaindata:N +dmmeta.ctypelen ctype:acr_in.FDb len:3384 alignment:8 padbytes:75 plaindata:N +dmmeta.ctypelen ctype:acr_in.FDispsig len:96 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:acr_in.FField len:704 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:acr_in.FFinput len:288 alignment:8 padbytes:3 plaindata:N +dmmeta.ctypelen ctype:acr_in.FNs len:320 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:acr_in.FNsssimfile len:272 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:acr_in.FSsimfile len:224 alignment:8 padbytes:13 plaindata:N dmmeta.ctypelen ctype:acr_in.FSubstr len:456 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr_in.FTargdep len:224 alignment:8 padbytes:10 plaindata:N -dmmeta.ctypelen ctype:acr_in.FTarget len:88 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:acr_in.FTuple len:120 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:acr_my.FDb len:736 alignment:8 padbytes:14 plaindata:N +dmmeta.ctypelen ctype:acr_in.FTarget len:96 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:acr_in.FTuple len:128 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:acr_my.FDb len:688 alignment:8 padbytes:14 plaindata:N dmmeta.ctypelen ctype:acr_my.FNsdb len:171 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:acr_my.FSsimfile len:154 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.Attr len:32 alignment:8 padbytes:0 plaindata:N @@ -154,6 +158,7 @@ dmmeta.ctypelen ctype:algo.I32Dec2 len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.I32Dec3 len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.I32Dec4 len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.I32Dec5 len:4 alignment:4 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:algo.I32RangeAry len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:algo.I64Dec1 len:8 alignment:8 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.I64Dec10 len:8 alignment:8 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.I64Dec2 len:8 alignment:8 padbytes:0 plaindata:Y @@ -164,6 +169,7 @@ dmmeta.ctypelen ctype:algo.I64Dec6 len:8 alignment:8 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.I64Dec7 len:8 alignment:8 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.I64Dec8 len:8 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.I64Dec9 len:8 alignment:8 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:algo.I64Rate len:16 alignment:8 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.IOEvtFlags len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.IPoint len:8 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.Imdb len:240 alignment:8 padbytes:4 plaindata:Y @@ -307,8 +313,10 @@ dmmeta.ctypelen ctype:algo.Smallstr16 len:18 alignment:1 padbytes:0 plainda dmmeta.ctypelen ctype:algo.Smallstr2 len:4 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.Smallstr20 len:22 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.Smallstr200 len:202 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:algo.Smallstr249 len:251 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.Smallstr25 len:27 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.Smallstr250 len:252 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:algo.Smallstr255 len:257 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.Smallstr3 len:5 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.Smallstr30 len:32 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.Smallstr32 len:34 alignment:1 padbytes:0 plaindata:Y @@ -321,12 +329,15 @@ dmmeta.ctypelen ctype:algo.TermStyle len:4 alignment:4 padbytes:0 plaindata dmmeta.ctypelen ctype:algo.TextJust len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.TstampCache len:56 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:algo.Tuple len:48 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:algo.U16Ary len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:algo.U16Dec2 len:2 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:algo.U32Ary len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:algo.U32Dec1 len:4 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.U32Dec2 len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.U32Dec3 len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.U32Dec4 len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.U32Dec5 len:4 alignment:4 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:algo.U32LinearKey len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.U64Ary len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:algo.U64Dec10 len:8 alignment:8 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo.U64Dec2 len:8 alignment:1 padbytes:0 plaindata:Y @@ -352,27 +363,32 @@ dmmeta.ctypelen ctype:algo_lib.Bitset len:16 alignment:8 padbytes:0 plainda dmmeta.ctypelen ctype:algo_lib.Cmdline len:5 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:algo_lib.CsvParse len:48 alignment:8 padbytes:12 plaindata:N dmmeta.ctypelen ctype:algo_lib.ErrorX len:16 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:algo_lib.FDb len:10704 alignment:16 padbytes:93 plaindata:N -dmmeta.ctypelen ctype:algo_lib.FDispsigcheck len:80 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:algo_lib.FDb len:14256 alignment:16 padbytes:58 plaindata:N +dmmeta.ctypelen ctype:algo_lib.FDispsigcheck len:88 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:algo_lib.FErrns len:40 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:algo_lib.FFildes len:4 alignment:4 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:algo_lib.FImdb len:248 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:algo_lib.FImtable len:408 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:algo_lib.FImdb len:256 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:algo_lib.FImtable len:408 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:algo_lib.FIohook len:32 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:algo_lib.FLockfile len:24 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:algo_lib.FLogcat len:216 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:algo_lib.FReplvar len:64 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:algo_lib.FLogcat len:360 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:algo_lib.FReplvar len:72 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:algo_lib.FTempfile len:24 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:algo_lib.FTimehook len:40 alignment:8 padbytes:3 plaindata:N dmmeta.ctypelen ctype:algo_lib.FTxtcell len:72 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:algo_lib.FTxtrow len:64 alignment:8 padbytes:13 plaindata:N -dmmeta.ctypelen ctype:algo_lib.FTxttbl len:32 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:algo_lib.FTxttbl len:24 alignment:8 padbytes:3 plaindata:N dmmeta.ctypelen ctype:algo_lib.InTextFile len:8248 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:algo_lib.Mmap len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:algo_lib.MmapFile len:40 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:algo_lib.Regx len:88 alignment:8 padbytes:1 plaindata:N +dmmeta.ctypelen ctype:algo_lib.Regx len:40 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:algo_lib.RegxExpr len:24 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:algo_lib.RegxParse len:40 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:algo_lib.RegxState len:40 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:algo_lib.RegxFlags len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:algo_lib.RegxM len:64 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:algo_lib.RegxOp len:4 alignment:2 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:algo_lib.RegxParse len:48 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:algo_lib.RegxState len:40 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:algo_lib.RegxStyle len:1 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo_lib.RegxToken len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:algo_lib.Replscope len:24 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:algo_lib.ShHdr len:80 alignment:8 padbytes:4 plaindata:Y @@ -385,134 +401,142 @@ dmmeta.ctypelen ctype:amc.FAnonfld len:108 alignment:4 padbytes:2 plaindata dmmeta.ctypelen ctype:amc.FArgvtype len:306 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FBasepool len:224 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:amc.FBitfld len:240 alignment:8 padbytes:8 plaindata:N -dmmeta.ctypelen ctype:amc.FBltin len:120 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:amc.FBltin len:128 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:amc.FCafter len:80 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:amc.FCascdel len:112 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:amc.FCcmp len:120 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:amc.FCcmp len:128 alignment:8 padbytes:10 plaindata:N dmmeta.ctypelen ctype:amc.FCdflt len:862 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FCextern len:105 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FCfast len:316 alignment:4 padbytes:5 plaindata:Y -dmmeta.ctypelen ctype:amc.FCfmt len:200 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:amc.FCfmt len:208 alignment:8 padbytes:9 plaindata:N dmmeta.ctypelen ctype:amc.FCget len:264 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:amc.FCharset len:424 alignment:8 padbytes:2 plaindata:Y -dmmeta.ctypelen ctype:amc.FChash len:168 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:amc.FChash len:176 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:amc.FCkafka len:352 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:amc.FCppfunc len:356 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc.FCpptype len:128 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:amc.FCpptype len:136 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:amc.FCsize len:112 alignment:4 padbytes:2 plaindata:Y dmmeta.ctypelen ctype:amc.FCstr len:103 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc.FCtype len:840 alignment:8 padbytes:35 plaindata:N -dmmeta.ctypelen ctype:amc.FCtypelen len:120 alignment:4 padbytes:4 plaindata:Y -dmmeta.ctypelen ctype:amc.FDb len:35216 alignment:16 padbytes:474 plaindata:N -dmmeta.ctypelen ctype:amc.FDispatch len:168 alignment:8 padbytes:17 plaindata:N +dmmeta.ctypelen ctype:amc.FCtype len:936 alignment:8 padbytes:53 plaindata:N +dmmeta.ctypelen ctype:amc.FCtypelen len:120 alignment:4 padbytes:5 plaindata:Y +dmmeta.ctypelen ctype:amc.FDb len:37136 alignment:16 padbytes:498 plaindata:N +dmmeta.ctypelen ctype:amc.FDispatch len:168 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:amc.FDispatchmsg len:144 alignment:8 padbytes:9 plaindata:N dmmeta.ctypelen ctype:amc.FDispctx len:168 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:amc.FDispfilter len:53 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc.FDispsig len:74 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:amc.FDispsig len:73 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FDisptrace len:216 alignment:8 padbytes:3 plaindata:N -dmmeta.ctypelen ctype:amc.FEnumstr len:48 alignment:8 padbytes:8 plaindata:N -dmmeta.ctypelen ctype:amc.FEnumstrLen len:40 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:amc.FEnumstr len:48 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:amc.FEnumstrLen len:40 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:amc.FFalias len:368 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:amc.FFbase len:255 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FFbigend len:264 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:amc.FFbitset len:120 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:amc.FFbuf len:400 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:amc.FFbuftype len:216 alignment:8 padbytes:3 plaindata:N +dmmeta.ctypelen ctype:amc.FFbitset len:128 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:amc.FFbuf len:456 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:amc.FFbuftype len:224 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:amc.FFcast len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FFcleanup len:112 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:amc.FFcmap len:448 alignment:8 padbytes:3 plaindata:N +dmmeta.ctypelen ctype:amc.FFcmap len:456 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:amc.FFcmdline len:384 alignment:8 padbytes:3 plaindata:N dmmeta.ctypelen ctype:amc.FFcmp len:257 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FFcompact len:254 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc.FFconst len:584 alignment:8 padbytes:13 plaindata:N -dmmeta.ctypelen ctype:amc.FFcurs len:232 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:amc.FFdec len:128 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:amc.FFconst len:592 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:amc.FFcurs len:232 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:amc.FFdec len:136 alignment:8 padbytes:9 plaindata:N dmmeta.ctypelen ctype:amc.FFdelay len:120 alignment:8 padbytes:9 plaindata:Y dmmeta.ctypelen ctype:amc.FFfast len:696 alignment:8 padbytes:15 plaindata:N -dmmeta.ctypelen ctype:amc.FFflag len:280 alignment:8 padbytes:1 plaindata:N -dmmeta.ctypelen ctype:amc.FField len:1288 alignment:8 padbytes:14 plaindata:N +dmmeta.ctypelen ctype:amc.FFflag len:288 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:amc.FField len:1328 alignment:8 padbytes:19 plaindata:N dmmeta.ctypelen ctype:amc.FFindrem len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FFinput len:120 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:amc.FFkafka len:304 alignment:8 padbytes:6 plaindata:Y dmmeta.ctypelen ctype:amc.FFldoffset len:120 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:amc.FFloadtuples len:264 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:amc.FFnoremove len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FFoutput len:103 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc.FFprefix len:232 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:amc.FFprefix len:232 alignment:8 padbytes:1 plaindata:N dmmeta.ctypelen ctype:amc.FFregx len:307 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FFsort len:272 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:amc.FFstep len:344 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:amc.FFstep len:352 alignment:8 padbytes:9 plaindata:N dmmeta.ctypelen ctype:amc.FFtrace len:254 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc.FFunc len:320 alignment:8 padbytes:35 plaindata:N +dmmeta.ctypelen ctype:amc.FFunc len:312 alignment:8 padbytes:8 plaindata:N dmmeta.ctypelen ctype:amc.FFunique len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FFuserinit len:254 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc.FFwddecl len:112 alignment:8 padbytes:1 plaindata:N +dmmeta.ctypelen ctype:amc.FFwddecl len:120 alignment:8 padbytes:5 plaindata:N dmmeta.ctypelen ctype:amc.FGconst len:328 alignment:8 padbytes:5 plaindata:N dmmeta.ctypelen ctype:amc.FGen len:232 alignment:8 padbytes:3 plaindata:N dmmeta.ctypelen ctype:amc.FGenXref len:280 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:amc.FGenXrefSeen len:232 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:amc.FGenXrefSeen len:240 alignment:8 padbytes:8 plaindata:N dmmeta.ctypelen ctype:amc.FGstatic len:120 alignment:8 padbytes:5 plaindata:N dmmeta.ctypelen ctype:amc.FGsymbol len:432 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:amc.FHook len:272 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:amc.FInlary len:272 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:amc.FHook len:120 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:amc.FInlary len:280 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:amc.FJstype len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FLenfld len:120 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:amc.FLicense len:232 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:amc.FListtype len:24 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:amc.FLicense len:232 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:amc.FListtype len:24 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:amc.FLlist len:112 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:amc.FMain len:32 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:amc.FMain len:32 alignment:8 padbytes:1 plaindata:N dmmeta.ctypelen ctype:amc.FMsgtype len:368 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:amc.FNocascdel len:102 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FNossimfile len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FNoxref len:102 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc.FNs len:704 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:amc.FNs len:760 alignment:8 padbytes:13 plaindata:N dmmeta.ctypelen ctype:amc.FNscpp len:170 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FNsdb len:170 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FNsinclude len:206 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:amc.FNsjs len:172 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FNsproto len:170 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FNsx len:288 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:amc.FNumstr len:248 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:amc.FOutfile len:272 alignment:8 padbytes:5 plaindata:N -dmmeta.ctypelen ctype:amc.FPack len:120 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:amc.FPmaskfld len:352 alignment:8 padbytes:8 plaindata:N -dmmeta.ctypelen ctype:amc.FPmaskfldMember len:288 alignment:8 padbytes:12 plaindata:N -dmmeta.ctypelen ctype:amc.FPnew len:136 alignment:8 padbytes:9 plaindata:N -dmmeta.ctypelen ctype:amc.FPtrary len:112 alignment:8 padbytes:1 plaindata:N -dmmeta.ctypelen ctype:amc.FReftype len:104 alignment:8 padbytes:5 plaindata:N -dmmeta.ctypelen ctype:amc.FRowid len:264 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:amc.FSmallstr len:440 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:amc.FPack len:128 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:amc.FPmaskfld len:360 alignment:8 padbytes:12 plaindata:N +dmmeta.ctypelen ctype:amc.FPmaskfldMember len:384 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:amc.FPnew len:144 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:amc.FPtrary len:112 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:amc.FReftype len:104 alignment:8 padbytes:1 plaindata:N +dmmeta.ctypelen ctype:amc.FRowid len:272 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:amc.FSmallstr len:448 alignment:8 padbytes:9 plaindata:N dmmeta.ctypelen ctype:amc.FSortfld len:216 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:amc.FSsimfile len:232 alignment:8 padbytes:15 plaindata:N +dmmeta.ctypelen ctype:amc.FSsimfile len:240 alignment:8 padbytes:19 plaindata:N dmmeta.ctypelen ctype:amc.FSsimsort len:328 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:amc.FSsimvolatile len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FStatictuple len:176 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:amc.FSteptype len:216 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:amc.FSubstr len:504 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:amc.FTargdep len:80 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:amc.FTarget len:56 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:amc.FTary len:120 alignment:8 padbytes:1 plaindata:N -dmmeta.ctypelen ctype:amc.FTclass len:88 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:amc.FTarget len:56 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:amc.FTary len:128 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:amc.FTclass len:96 alignment:8 padbytes:8 plaindata:N dmmeta.ctypelen ctype:amc.FTcurs len:205 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc.FTfunc len:248 alignment:8 padbytes:12 plaindata:N +dmmeta.ctypelen ctype:amc.FTfunc len:248 alignment:8 padbytes:8 plaindata:N dmmeta.ctypelen ctype:amc.FThash len:224 alignment:8 padbytes:3 plaindata:N dmmeta.ctypelen ctype:amc.FTracefld len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FTracerec len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FTypefld len:272 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:amc.FUserfunc len:508 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amc.FUsertracefld len:254 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc.FXref len:632 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:amc.FXref len:640 alignment:8 padbytes:8 plaindata:N dmmeta.ctypelen ctype:amc.Funcarg len:56 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:amc.Genctx len:56 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:amc.Genpnew len:104 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:amc.JsCtype len:64 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:amc.JsNs len:40 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:amc.Pnewtype len:1 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc_gc.FDb len:240 alignment:8 padbytes:3 plaindata:N -dmmeta.ctypelen ctype:amc_vis.FCtype len:328 alignment:8 padbytes:5 plaindata:N -dmmeta.ctypelen ctype:amc_vis.FDb len:2944 alignment:8 padbytes:39 plaindata:N -dmmeta.ctypelen ctype:amc_vis.FField len:712 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:amc_gc.FDb len:144 alignment:8 padbytes:3 plaindata:N +dmmeta.ctypelen ctype:amc_vis.FCtype len:336 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:amc_vis.FDb len:2904 alignment:8 padbytes:37 plaindata:N +dmmeta.ctypelen ctype:amc_vis.FField len:712 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:amc_vis.FFinput len:257 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:amc_vis.FLink len:176 alignment:8 padbytes:14 plaindata:N +dmmeta.ctypelen ctype:amc_vis.FLinkdep len:64 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:amc_vis.FNode len:464 alignment:8 padbytes:26 plaindata:N dmmeta.ctypelen ctype:amc_vis.FNodedep len:168 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:amc_vis.FReftype len:72 alignment:8 padbytes:1 plaindata:N -dmmeta.ctypelen ctype:amc_vis.Link len:440 alignment:8 padbytes:20 plaindata:N -dmmeta.ctypelen ctype:amc_vis.Linkdep len:64 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:amc_vis.Linkkey len:16 alignment:4 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc_vis.Nodekey len:12 alignment:4 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:amc_vis.Outrow len:24 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:amc_vis.FOutrow len:24 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:amc_vis.FReftype len:80 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:amc_vis.Linkkey len:12 alignment:4 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:amc_vis.Nodekey len:8 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amcdb.Bltin len:257 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amcdb.Curstype len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amcdb.Gen len:205 alignment:1 padbytes:0 plaindata:Y @@ -520,57 +544,49 @@ dmmeta.ctypelen ctype:amcdb.Regxtype len:204 alignment:1 padbytes:0 plainda dmmeta.ctypelen ctype:amcdb.Tclass len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amcdb.Tcurs len:205 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:amcdb.Tfunc len:211 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.AlarmSyncMsg len:16 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.DfltStream len:12 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.DumpStreamTableMsg len:10 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:ams.ExpectMsg len:8 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ams.HeartbeatMsg len:16 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.InputLineMsg len:8 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ams.LogMsg len:66 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ams.Member len:7 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.InputLineMsg len:12 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ams.LogMsg len:24 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:ams.MsgBlock len:24 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:ams.MsgHeader len:8 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.OpenMsg len:31 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.PrlogMsg len:66 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ams.ProcAddMsg len:10 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.ProcId len:2 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.ProcRemoveMsg len:10 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.ProcType len:1 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.Seqmsg len:32 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ams.SeqmsgId len:16 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.SeqmsgTrace len:35 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ams.StreamFlags len:1 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.StreamHbMsg len:35 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.StreamId len:4 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.StreamPos len:16 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.StreamType len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.ProcEofMsg len:58 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.ProcId len:4 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.ProcKillMsg len:62 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.ProcMsg len:58 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ams.ProcReadMsg len:58 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ams.ProcStartMsg len:59 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ams.ProcStatusMsg len:108 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.Proctype len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.RemDirRecurseMsg len:9 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ams.ShmFlags len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.ShmHbMsg len:32 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.ShmId len:6 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.ShmemberFlags len:2 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.ShmemberId len:12 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ams.Shmmsg len:30 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ams.Shmtype len:1 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:ams.TerminateMsg len:8 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ams.Trace2Msg len:19 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ams.TraceInfo2Msg len:20 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ams.TraceInfoMsg len:19 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ams.TraceMsg len:18 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:ams.UdpFrame len:28 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ams_cat.FDb len:24 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:ams_sendtest.AmsSendTest len:80 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ams_sendtest.FChild len:272 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:ams_sendtest.FDb len:544 alignment:8 padbytes:3 plaindata:N -dmmeta.ctypelen ctype:amsdb.ProcType len:228 alignment:4 padbytes:2 plaindata:Y -dmmeta.ctypelen ctype:amsdb.StreamType len:205 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:apm.FCtype len:304 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:apm.FDb len:3872 alignment:8 padbytes:71 plaindata:N -dmmeta.ctypelen ctype:apm.FField len:704 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:apm.FMergefile len:96 alignment:8 padbytes:12 plaindata:N -dmmeta.ctypelen ctype:apm.FMkdir len:24 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ams_sendtest.AmsSendTest len:96 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ams_sendtest.FChild len:224 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ams_sendtest.FDb len:512 alignment:8 padbytes:3 plaindata:N +dmmeta.ctypelen ctype:amsdb.Proctype len:196 alignment:4 padbytes:4 plaindata:Y +dmmeta.ctypelen ctype:amsdb.Shmtype len:206 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:apm.FCtype len:312 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:apm.FDb len:3776 alignment:8 padbytes:71 plaindata:N +dmmeta.ctypelen ctype:apm.FField len:704 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:apm.FMergefile len:104 alignment:8 padbytes:16 plaindata:N +dmmeta.ctypelen ctype:apm.FMkdir len:32 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:apm.FNs len:274 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:apm.FPackage len:592 alignment:8 padbytes:21 plaindata:N +dmmeta.ctypelen ctype:apm.FPackage len:600 alignment:8 padbytes:25 plaindata:N dmmeta.ctypelen ctype:apm.FPkgdep len:280 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:apm.FPkgkey len:344 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:apm.FPkgkey len:352 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:apm.FPkgrec len:72 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:apm.FRec len:200 alignment:8 padbytes:8 plaindata:N -dmmeta.ctypelen ctype:apm.FSsimfile len:200 alignment:8 padbytes:10 plaindata:N -dmmeta.ctypelen ctype:apm.FSsimreq len:480 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:apm.FRec len:208 alignment:8 padbytes:12 plaindata:N +dmmeta.ctypelen ctype:apm.FSsimfile len:200 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:apm.FSsimreq len:432 alignment:8 padbytes:8 plaindata:N dmmeta.ctypelen ctype:apm.FSubstr len:464 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:aqlite.FDb len:104 alignment:8 padbytes:3 plaindata:N +dmmeta.ctypelen ctype:aqlite.FDb len:144 alignment:8 padbytes:3 plaindata:N dmmeta.ctypelen ctype:atf.Testresult len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf.Testrun len:88 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.AmcCleanup2 len:8 alignment:4 padbytes:0 plaindata:N @@ -580,8 +596,8 @@ dmmeta.ctypelen ctype:atf_amc.BitfldType2 len:16 alignment:8 padbytes:7 pla dmmeta.ctypelen ctype:atf_amc.BitfldU128 len:16 alignment:16 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_amc.BitfldU16 len:2 alignment:2 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_amc.Bitset len:48 alignment:16 padbytes:15 plaindata:Y -dmmeta.ctypelen ctype:atf_amc.Bytebuf len:104 alignment:8 padbytes:17 plaindata:N -dmmeta.ctypelen ctype:atf_amc.BytebufDyn len:48 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:atf_amc.Bytebuf len:40 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:atf_amc.BytebufDyn len:40 alignment:8 padbytes:5 plaindata:N dmmeta.ctypelen ctype:atf_amc.Cstr len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.Cstring len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.Ctype1Attr len:4 alignment:4 padbytes:0 plaindata:Y @@ -593,25 +609,30 @@ dmmeta.ctypelen ctype:atf_amc.DispType2 len:4 alignment:4 padbytes:0 plaind dmmeta.ctypelen ctype:atf_amc.DispType3 len:28 alignment:4 padbytes:2 plaindata:Y dmmeta.ctypelen ctype:atf_amc.FAmctest len:224 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:atf_amc.FAvl len:40 alignment:8 padbytes:8 plaindata:N -dmmeta.ctypelen ctype:atf_amc.FCascdel len:184 alignment:8 padbytes:15 plaindata:N -dmmeta.ctypelen ctype:atf_amc.FCstring len:24 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:atf_amc.FDb len:5600 alignment:16 padbytes:95 plaindata:N +dmmeta.ctypelen ctype:atf_amc.FCascdel len:192 alignment:8 padbytes:19 plaindata:N +dmmeta.ctypelen ctype:atf_amc.FCstring len:32 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:atf_amc.FDb len:5776 alignment:16 padbytes:103 plaindata:N +dmmeta.ctypelen ctype:atf_amc.FHashableLinear len:32 alignment:8 padbytes:8 plaindata:N dmmeta.ctypelen ctype:atf_amc.FListtype len:184 alignment:8 padbytes:13 plaindata:N dmmeta.ctypelen ctype:atf_amc.FOptG len:4 alignment:4 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.FPerfSortString len:32 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:atf_amc.FThashElem len:16 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:atf_amc.FTypeA len:1440 alignment:16 padbytes:24 plaindata:N +dmmeta.ctypelen ctype:atf_amc.FThashElem len:24 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:atf_amc.FTimeEntry len:24 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:atf_amc.FTypeA len:1440 alignment:16 padbytes:20 plaindata:N dmmeta.ctypelen ctype:atf_amc.FTypeB len:40 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:atf_amc.FTypeC len:136 alignment:8 padbytes:8 plaindata:N dmmeta.ctypelen ctype:atf_amc.FTypeD len:56 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:atf_amc.FTypeK len:8 alignment:4 padbytes:3 plaindata:Y -dmmeta.ctypelen ctype:atf_amc.FTypeS len:192 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:atf_amc.FTypeL len:8 alignment:4 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:atf_amc.FTypeM len:4 alignment:4 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:atf_amc.FTypeS len:192 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:atf_amc.FTypeT len:24 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.FUnitSort len:432 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:atf_amc.Hashable len:40 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.Hooktype len:24 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:atf_amc.InlaryPrint len:80 alignment:16 padbytes:16 plaindata:Y dmmeta.ctypelen ctype:atf_amc.Lary32 len:264 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:atf_amc.Linebuf len:104 alignment:8 padbytes:17 plaindata:N +dmmeta.ctypelen ctype:atf_amc.Linebuf len:40 alignment:8 padbytes:5 plaindata:N dmmeta.ctypelen ctype:atf_amc.MsgHdrLT len:2 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_amc.MsgHeader len:4 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_amc.MsgLTA len:6 alignment:1 padbytes:0 plaindata:Y @@ -620,7 +641,7 @@ dmmeta.ctypelen ctype:atf_amc.MsgLTO len:2 alignment:1 padbytes:0 plaindata dmmeta.ctypelen ctype:atf_amc.MsgLTV len:2 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.MsgLength len:2 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_amc.MsgType len:2 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:atf_amc.Msgbuf len:472 alignment:8 padbytes:44 plaindata:N +dmmeta.ctypelen ctype:atf_amc.Msgbuf len:240 alignment:8 padbytes:20 plaindata:N dmmeta.ctypelen ctype:atf_amc.NetBitfld1 len:2 alignment:2 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_amc.OptAlloc len:4 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.OptG len:4 alignment:1 padbytes:0 plaindata:N @@ -635,9 +656,10 @@ dmmeta.ctypelen ctype:atf_amc.RpasU32Str6 len:8 alignment:1 padbytes:0 plai dmmeta.ctypelen ctype:atf_amc.Sep1 len:12 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_amc.Seqmsg len:4 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.SortedStr len:32 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:atf_amc.Strkey len:40 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:atf_amc.TaryU32 len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.TaryU8 len:16 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:atf_amc.TestRegx1 len:88 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:atf_amc.TestRegx1 len:40 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.Text len:4 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.TypeA len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_amc.TypeB len:8 alignment:4 padbytes:0 plaindata:Y @@ -654,57 +676,66 @@ dmmeta.ctypelen ctype:atf_amc.TypeS len:156 alignment:4 padbytes:0 plaindat dmmeta.ctypelen ctype:atf_amc.TypeT len:8 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_amc.TypeTVal len:160 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_amc.Typefconst len:4 alignment:4 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:atf_amc.Varlen2Msg len:8 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:atf_amc.Varlen2aMsg len:8 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:atf_amc.Varlen2mMsg len:8 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:atf_amc.Varlen2vMsg len:8 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.VarlenAlloc len:4 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.VarlenExtern len:4 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.VarlenH len:4 alignment:4 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.VarlenK len:4 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_amc.VarlenMsg len:4 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:atf_ci.FBuilddir len:216 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:atf_ci.FBuilddir len:224 alignment:8 padbytes:8 plaindata:N dmmeta.ctypelen ctype:atf_ci.FCfg len:211 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_ci.FCipackage len:308 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:atf_ci.FCitest len:280 alignment:8 padbytes:3 plaindata:N -dmmeta.ctypelen ctype:atf_ci.FDb len:3768 alignment:8 padbytes:58 plaindata:N -dmmeta.ctypelen ctype:atf_ci.FGitfile len:240 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:atf_ci.FCitest len:288 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:atf_ci.FDb len:3672 alignment:8 padbytes:57 plaindata:N +dmmeta.ctypelen ctype:atf_ci.FGitfile len:240 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:atf_ci.FMsgfile len:355 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_ci.FNoindent len:354 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:atf_ci.FNs len:288 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:atf_ci.FReadme len:458 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:atf_ci.FScriptfile len:416 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:atf_ci.FSsimfile len:168 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:atf_ci.FNs len:288 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:atf_ci.FReadmefile len:458 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:atf_ci.FScriptfile len:424 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:atf_ci.FSsimfile len:168 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:atf_ci.FTargsrc len:254 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:atf_ci.File len:32 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:atf_cmdline.FDb len:416 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:atf_comp.FComptest len:624 alignment:8 padbytes:28 plaindata:N -dmmeta.ctypelen ctype:atf_comp.FDb len:808 alignment:8 padbytes:43 plaindata:N +dmmeta.ctypelen ctype:atf_ci.File len:40 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:atf_cmdline.FDb len:368 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:atf_comp.FComptest len:648 alignment:8 padbytes:27 plaindata:N +dmmeta.ctypelen ctype:atf_comp.FCovdir len:32 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:atf_comp.FDb len:1120 alignment:8 padbytes:55 plaindata:N dmmeta.ctypelen ctype:atf_comp.FTargs len:96 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:atf_comp.FTfilt len:248 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:atf_comp.FTfilt len:256 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_comp.FTmsg len:112 alignment:8 padbytes:3 plaindata:N dmmeta.ctypelen ctype:atf_cov.FCovfile len:228 alignment:4 padbytes:2 plaindata:Y -dmmeta.ctypelen ctype:atf_cov.FCovline len:248 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:atf_cov.FCovline len:72 alignment:8 padbytes:14 plaindata:N dmmeta.ctypelen ctype:atf_cov.FCovtarget len:44 alignment:4 padbytes:2 plaindata:Y -dmmeta.ctypelen ctype:atf_cov.FDb len:2256 alignment:8 padbytes:35 plaindata:N -dmmeta.ctypelen ctype:atf_cov.FGitfile len:248 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:atf_cov.FTarget len:64 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:atf_cov.FTargsrc len:288 alignment:8 padbytes:9 plaindata:N -dmmeta.ctypelen ctype:atf_cov.FTgtcov len:192 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:atf_cov.FDb len:2208 alignment:8 padbytes:35 plaindata:N +dmmeta.ctypelen ctype:atf_cov.FGitfile len:248 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:atf_cov.FTarget len:64 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:atf_cov.FTargsrc len:296 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:atf_cov.FTgtcov len:192 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:atf_cov.Phase len:1 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:atf_fuzz.FDb len:752 alignment:8 padbytes:15 plaindata:N +dmmeta.ctypelen ctype:atf_exp.FDb len:544 alignment:8 padbytes:28 plaindata:N +dmmeta.ctypelen ctype:atf_exp.FFdin len:128 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:atf_exp.FProc len:416 alignment:8 padbytes:23 plaindata:N +dmmeta.ctypelen ctype:atf_exp.Proc len:52 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:atf_fuzz.FDb len:704 alignment:8 padbytes:15 plaindata:N dmmeta.ctypelen ctype:atf_fuzz.FFuzzstrat len:216 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:atf_fuzz.FTarget len:32 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:atf_gcli.FDb len:1608 alignment:8 padbytes:27 plaindata:N -dmmeta.ctypelen ctype:atf_gcli.FGclienv len:248 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:atf_gcli.FGclienvsub len:88 alignment:8 padbytes:9 plaindata:N -dmmeta.ctypelen ctype:atf_gcli.FGtblact len:80 alignment:8 padbytes:1 plaindata:N -dmmeta.ctypelen ctype:atf_gcli.FGtblacttst len:488 alignment:8 padbytes:24 plaindata:N -dmmeta.ctypelen ctype:atf_gcli.FGtblacttstout len:304 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:atf_fuzz.FTarget len:32 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:atf_gcli.FDb len:1560 alignment:8 padbytes:27 plaindata:N +dmmeta.ctypelen ctype:atf_gcli.FGclienv len:248 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:atf_gcli.FGclienvsub len:96 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:atf_gcli.FGtblact len:88 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:atf_gcli.FGtblacttst len:496 alignment:8 padbytes:28 plaindata:N +dmmeta.ctypelen ctype:atf_gcli.FGtblacttstout len:304 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:atf_nrun.FDb len:368 alignment:8 padbytes:15 plaindata:N -dmmeta.ctypelen ctype:atf_nrun.FEntry len:144 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:atf_nrun.FEntry len:152 alignment:8 padbytes:12 plaindata:N dmmeta.ctypelen ctype:atf_unit.Cstr len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_unit.Dbl len:8 alignment:8 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:atf_unit.FDb len:2336 alignment:8 padbytes:21 plaindata:N +dmmeta.ctypelen ctype:atf_unit.FDb len:2288 alignment:8 padbytes:21 plaindata:N dmmeta.ctypelen ctype:atf_unit.FNumber len:40 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:atf_unit.FPerfSort len:48 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:atf_unit.FUnittest len:256 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:atf_unit.FUnittest len:264 alignment:8 padbytes:14 plaindata:N dmmeta.ctypelen ctype:atf_unit.TestJson len:128 alignment:8 padbytes:16 plaindata:N dmmeta.ctypelen ctype:atf_unit.TypeA len:4 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atf_unit.TypeB len:8 alignment:4 padbytes:0 plaindata:Y @@ -712,7 +743,7 @@ dmmeta.ctypelen ctype:atfdb.Amctest len:204 alignment:1 padbytes:0 plaindat dmmeta.ctypelen ctype:atfdb.Cijob len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atfdb.Cipackage len:308 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atfdb.Citest len:257 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:atfdb.Comptest len:212 alignment:4 padbytes:2 plaindata:Y +dmmeta.ctypelen ctype:atfdb.Comptest len:220 alignment:4 padbytes:1 plaindata:Y dmmeta.ctypelen ctype:atfdb.Fuzzstrat len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atfdb.Msgdir len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:atfdb.Targs len:72 alignment:8 padbytes:4 plaindata:N @@ -722,50 +753,54 @@ dmmeta.ctypelen ctype:atfdb.TestGsymbolStrptr len:204 alignment:1 padbytes:0 dmmeta.ctypelen ctype:atfdb.Tfilt len:224 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:atfdb.Tmsg len:72 alignment:8 padbytes:3 plaindata:N dmmeta.ctypelen ctype:atfdb.Unittest len:204 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:atfdb.Var len:306 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:bash2html.FDb len:32 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:command.abt len:608 alignment:8 padbytes:30 plaindata:N -dmmeta.ctypelen ctype:command.abt_md len:288 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:command.abt len:416 alignment:8 padbytes:30 plaindata:N +dmmeta.ctypelen ctype:command.abt_md len:144 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:command.acr len:192 alignment:8 padbytes:21 plaindata:N dmmeta.ctypelen ctype:command.acr_compl len:104 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:command.acr_dm len:40 alignment:8 padbytes:5 plaindata:N -dmmeta.ctypelen ctype:command.acr_ed len:1608 alignment:8 padbytes:51 plaindata:N -dmmeta.ctypelen ctype:command.acr_in len:328 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:command.acr_my len:128 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:command.amc len:144 alignment:8 padbytes:5 plaindata:N -dmmeta.ctypelen ctype:command.amc_gc len:200 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:command.amc_vis len:128 alignment:8 padbytes:3 plaindata:N -dmmeta.ctypelen ctype:command.ams_cat len:16 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:command.ams_sendtest len:192 alignment:8 padbytes:19 plaindata:N -dmmeta.ctypelen ctype:command.apm len:536 alignment:8 padbytes:9 plaindata:N -dmmeta.ctypelen ctype:command.aqlite len:48 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:command.atf_amc len:112 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:command.atf_ci len:208 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:command.atf_cmdline len:408 alignment:8 padbytes:45 plaindata:N -dmmeta.ctypelen ctype:command.atf_comp len:232 alignment:8 padbytes:17 plaindata:N -dmmeta.ctypelen ctype:command.atf_cov len:176 alignment:8 padbytes:1 plaindata:N -dmmeta.ctypelen ctype:command.atf_fuzz len:192 alignment:8 padbytes:10 plaindata:N -dmmeta.ctypelen ctype:command.atf_gcli len:160 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:command.acr_ed len:1608 alignment:8 padbytes:50 plaindata:N +dmmeta.ctypelen ctype:command.acr_in len:184 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:command.acr_my len:80 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:command.amc len:96 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:command.amc_gc len:104 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:command.amc_vis len:80 alignment:8 padbytes:3 plaindata:N +dmmeta.ctypelen ctype:command.ams_sendtest len:144 alignment:8 padbytes:19 plaindata:N +dmmeta.ctypelen ctype:command.apm len:440 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:command.aqlite len:88 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:command.atf_amc len:64 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:command.atf_ci len:112 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:command.atf_cmdline len:360 alignment:8 padbytes:45 plaindata:N +dmmeta.ctypelen ctype:command.atf_comp len:192 alignment:8 padbytes:17 plaindata:N +dmmeta.ctypelen ctype:command.atf_cov len:128 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:command.atf_exp len:136 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:command.atf_fuzz len:144 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:command.atf_gcli len:112 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:command.atf_nrun len:24 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:command.atf_unit len:152 alignment:8 padbytes:15 plaindata:N +dmmeta.ctypelen ctype:command.atf_unit len:104 alignment:8 padbytes:15 plaindata:N dmmeta.ctypelen ctype:command.bash len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:command.bash2html len:24 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:command.bash_proc len:96 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:command.gcache len:72 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:command.gcli len:352 alignment:8 padbytes:24 plaindata:N -dmmeta.ctypelen ctype:command.mdbg len:160 alignment:8 padbytes:17 plaindata:N +dmmeta.ctypelen ctype:command.generic_proc len:88 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:command.jkv len:56 alignment:8 padbytes:1 plaindata:N +dmmeta.ctypelen ctype:command.mdbg len:168 alignment:8 padbytes:20 plaindata:N dmmeta.ctypelen ctype:command.mysql2ssim len:72 alignment:8 padbytes:19 plaindata:N -dmmeta.ctypelen ctype:command.orgfile len:144 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:command.orgfile len:96 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:command.samp_make len:88 alignment:8 padbytes:14 plaindata:N dmmeta.ctypelen ctype:command.samp_meng len:16 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:command.samp_regx len:64 alignment:8 padbytes:13 plaindata:N -dmmeta.ctypelen ctype:command.sandbox len:176 alignment:8 padbytes:15 plaindata:N -dmmeta.ctypelen ctype:command.src_func len:760 alignment:8 padbytes:1 plaindata:N -dmmeta.ctypelen ctype:command.src_hdr len:200 alignment:8 padbytes:5 plaindata:N -dmmeta.ctypelen ctype:command.src_lim len:208 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:command.samp_regx len:56 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:command.sandbox len:144 alignment:8 padbytes:15 plaindata:N +dmmeta.ctypelen ctype:command.src_func len:480 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:command.src_hdr len:104 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:command.src_lim len:112 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:command.ssim2csv len:24 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:command.ssim2mysql len:80 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:command.ssimfilt len:160 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:command.ssimfilt len:112 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:command.strconv len:144 alignment:8 padbytes:8 plaindata:N -dmmeta.ctypelen ctype:command.sv2ssim len:200 alignment:8 padbytes:26 plaindata:N +dmmeta.ctypelen ctype:command.sv2ssim len:152 alignment:8 padbytes:26 plaindata:N dmmeta.ctypelen ctype:dev.Arch len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Badline len:458 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Builddir len:204 alignment:1 padbytes:0 plaindata:Y @@ -773,7 +808,7 @@ dmmeta.ctypelen ctype:dev.Cfg len:211 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Compiler len:530 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Copyright len:205 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Covfile len:228 alignment:4 padbytes:2 plaindata:Y -dmmeta.ctypelen ctype:dev.Covline len:224 alignment:8 padbytes:1 plaindata:N +dmmeta.ctypelen ctype:dev.Covline len:40 alignment:8 padbytes:3 plaindata:N dmmeta.ctypelen ctype:dev.Covtarget len:44 alignment:4 padbytes:2 plaindata:Y dmmeta.ctypelen ctype:dev.Edaction len:205 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Edacttype len:204 alignment:1 padbytes:0 plaindata:Y @@ -787,13 +822,16 @@ dmmeta.ctypelen ctype:dev.Linelim len:284 alignment:4 padbytes:2 plaindata: dmmeta.ctypelen ctype:dev.Mdmark len:120 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:dev.Mdsection len:560 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Msgfile len:355 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dev.Netproto len:205 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Noindent len:354 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.OptType len:208 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Package len:458 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Pkgdep len:255 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Pkgkey len:304 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:dev.Readme len:458 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dev.Prototransport len:204 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dev.Readmefile len:458 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Readmesort len:404 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dev.Rpm len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Sandbox len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Sbpath len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Scriptfile len:406 alignment:1 padbytes:0 plaindata:Y @@ -808,6 +846,7 @@ dmmeta.ctypelen ctype:dev.Targsyslib len:204 alignment:1 padbytes:0 plainda dmmeta.ctypelen ctype:dev.Tgtcov len:180 alignment:4 padbytes:2 plaindata:Y dmmeta.ctypelen ctype:dev.Timefmt len:255 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.ToolOpt len:254 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dev.Transport len:205 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Uname len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dev.Unstablefld len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Anonfld len:254 alignment:1 padbytes:0 plaindata:Y @@ -825,6 +864,7 @@ dmmeta.ctypelen ctype:dmmeta.Cfmt len:331 alignment:1 padbytes:0 plaindata: dmmeta.ctypelen ctype:dmmeta.Cget len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Charset len:358 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Chash len:306 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.Ckafka len:352 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:dmmeta.Cppfunc len:356 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Cppkeyword len:22 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Cpptype len:105 alignment:1 padbytes:0 plaindata:Y @@ -832,7 +872,7 @@ dmmeta.ctypelen ctype:dmmeta.Csize len:264 alignment:4 padbytes:2 plaindata dmmeta.ctypelen ctype:dmmeta.Cstr len:255 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Ctype len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Ctypelen len:120 alignment:4 padbytes:5 plaindata:Y -dmmeta.ctypelen ctype:dmmeta.Dispatch len:210 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.Dispatch len:212 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.DispatchMsg len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Dispctx len:306 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Dispfilter len:205 alignment:1 padbytes:0 plaindata:Y @@ -846,8 +886,9 @@ dmmeta.ctypelen ctype:dmmeta.Fastop len:204 alignment:1 padbytes:0 plaindat dmmeta.ctypelen ctype:dmmeta.Fbase len:255 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Fbigend len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Fbitset len:254 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:dmmeta.Fbuf len:516 alignment:4 padbytes:2 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.Fbuf len:568 alignment:4 padbytes:2 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Fbufdir len:205 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.Fbufiotype len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Fbuftype len:205 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Fcast len:356 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Fcleanup len:254 alignment:1 padbytes:0 plaindata:Y @@ -864,6 +905,7 @@ dmmeta.ctypelen ctype:dmmeta.Fflag len:272 alignment:8 padbytes:1 plaindata dmmeta.ctypelen ctype:dmmeta.Field len:660 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Findrem len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Finput len:257 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.Fkafka len:304 alignment:8 padbytes:6 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Fldoffset len:108 alignment:4 padbytes:2 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Floadtuples len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Fnoremove len:254 alignment:1 padbytes:0 plaindata:Y @@ -882,12 +924,14 @@ dmmeta.ctypelen ctype:dmmeta.Gconst len:307 alignment:1 padbytes:0 plaindat dmmeta.ctypelen ctype:dmmeta.Gstatic len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Gsymbol len:408 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Hashtype len:204 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:dmmeta.Hook len:254 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.Hook len:102 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Inlary len:264 alignment:4 padbytes:2 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.Jstype len:254 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.KafkaTypeKind len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Lenfld len:108 alignment:4 padbytes:2 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Listtype len:162 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Llist len:256 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:dmmeta.Logcat len:206 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.Logcat len:216 alignment:4 padbytes:1 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Main len:19 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Msgtype len:354 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Nocascdel len:254 alignment:1 padbytes:0 plaindata:Y @@ -898,6 +942,7 @@ dmmeta.ctypelen ctype:dmmeta.Nscpp len:170 alignment:1 padbytes:0 plaindata dmmeta.ctypelen ctype:dmmeta.Nsdb len:170 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Nsfast len:170 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Nsinclude len:205 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.Nsjs len:172 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Nsproto len:170 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Nstype len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Nsversion len:182 alignment:1 padbytes:0 plaindata:Y @@ -905,10 +950,10 @@ dmmeta.ctypelen ctype:dmmeta.Nsx len:276 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Numstr len:212 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Pack len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Pmaskfld len:255 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:dmmeta.PmaskfldMember len:254 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.PmaskfldMember len:354 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Pnew len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Printfmt len:204 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:dmmeta.Ptrary len:103 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.Ptrary len:104 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Reftype len:63 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Rowid len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Smallstr len:416 alignment:4 padbytes:5 plaindata:Y @@ -929,6 +974,7 @@ dmmeta.ctypelen ctype:dmmeta.Thash len:357 alignment:1 padbytes:0 plaindata dmmeta.ctypelen ctype:dmmeta.Tracefld len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Tracerec len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Typefld len:254 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:dmmeta.Userfunc len:508 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Usertracefld len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:dmmeta.Xref len:556 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:fm.AlarmMsg len:460 alignment:1 padbytes:0 plaindata:Y @@ -947,37 +993,35 @@ dmmeta.ctypelen ctype:fmdb.AlmSource len:184 alignment:1 padbytes:0 plainda dmmeta.ctypelen ctype:gcache.FDb len:576 alignment:8 padbytes:12 plaindata:N dmmeta.ctypelen ctype:gcache.FHeader len:40 alignment:8 padbytes:3 plaindata:N dmmeta.ctypelen ctype:gcache.cleanreport len:32 alignment:8 padbytes:4 plaindata:Y -dmmeta.ctypelen ctype:gcli.FDb len:9048 alignment:8 padbytes:126 plaindata:N -dmmeta.ctypelen ctype:gcli.FGact len:216 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:gcli.FGclicmd len:944 alignment:8 padbytes:16 plaindata:N -dmmeta.ctypelen ctype:gcli.FGclicmdarg len:264 alignment:8 padbytes:3 plaindata:N -dmmeta.ctypelen ctype:gcli.FGclicmdc len:288 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:gcli.FGclicmdf len:288 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:gcli.FDb len:8440 alignment:8 padbytes:118 plaindata:N +dmmeta.ctypelen ctype:gcli.FGact len:216 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:gcli.FGclicmd len:952 alignment:8 padbytes:20 plaindata:N +dmmeta.ctypelen ctype:gcli.FGclicmdarg len:272 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:gcli.FGclicmdc len:288 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:gcli.FGclicmdf len:288 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:gcli.FGclicmdf2j len:424 alignment:8 padbytes:10 plaindata:N -dmmeta.ctypelen ctype:gcli.FGclicmdj2f len:280 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:gcli.FGclicmdt len:632 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:gcli.FGfld len:240 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:gcli.FGithost len:376 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:gcli.FGmethod len:216 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:gcli.FGrepo len:424 alignment:8 padbytes:18 plaindata:N -dmmeta.ctypelen ctype:gcli.FGrepogitport len:232 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:gcli.FGrepossh len:416 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:gcli.FGstatet len:80 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:gcli.FGtbl len:456 alignment:8 padbytes:10 plaindata:N -dmmeta.ctypelen ctype:gcli.FGtblact len:152 alignment:8 padbytes:15 plaindata:N -dmmeta.ctypelen ctype:gcli.FGtblactfld len:296 alignment:8 padbytes:20 plaindata:N -dmmeta.ctypelen ctype:gcli.FGtype len:264 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:gcli.FGclicmdj2f len:288 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:gcli.FGclicmdt len:640 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:gcli.FGfld len:240 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:gcli.FGithost len:376 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:gcli.FGmethod len:224 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:gcli.FGrepo len:424 alignment:8 padbytes:14 plaindata:N +dmmeta.ctypelen ctype:gcli.FGstatet len:80 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:gcli.FGtbl len:456 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:gcli.FGtblact len:160 alignment:8 padbytes:19 plaindata:N +dmmeta.ctypelen ctype:gcli.FGtblactfld len:296 alignment:8 padbytes:16 plaindata:N +dmmeta.ctypelen ctype:gcli.FGtype len:264 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:gcli.FGtypeh len:280 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:gcli.FGtypeprefix len:224 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:gcli.FHttp len:248 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:gcli.FIssue len:304 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:gcli.FIssuenote len:320 alignment:8 padbytes:10 plaindata:N -dmmeta.ctypelen ctype:gcli.FMilestone len:256 alignment:8 padbytes:13 plaindata:N -dmmeta.ctypelen ctype:gcli.FMr len:384 alignment:8 padbytes:9 plaindata:N -dmmeta.ctypelen ctype:gcli.FMrjob len:504 alignment:8 padbytes:9 plaindata:N -dmmeta.ctypelen ctype:gcli.FMrnote len:320 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:gcli.FIssue len:312 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:gcli.FIssuenote len:320 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:gcli.FMilestone len:256 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:gcli.FMr len:392 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:gcli.FMrjob len:504 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:gcli.FMrnote len:328 alignment:8 padbytes:14 plaindata:N dmmeta.ctypelen ctype:gcli.FTuples len:16 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:gcli.FUser len:88 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:gcli.FUser len:96 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:gclidb.Gact len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:gclidb.Gatv len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:gclidb.Gclicmd len:656 alignment:1 padbytes:0 plaindata:Y @@ -990,8 +1034,6 @@ dmmeta.ctypelen ctype:gclidb.Gfld len:204 alignment:1 padbytes:0 plaindata: dmmeta.ctypelen ctype:gclidb.Githost len:252 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:gclidb.Gmethod len:208 alignment:4 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:gclidb.Grepo len:392 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:gclidb.Grepogitport len:224 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:gclidb.Grepossh len:406 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:gclidb.Gstate len:204 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:gclidb.Gstatet len:72 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:gclidb.Gtbl len:404 alignment:1 padbytes:0 plaindata:Y @@ -1012,72 +1054,114 @@ dmmeta.ctypelen ctype:gclidb.Mrjob len:488 alignment:8 padbytes:4 plaindata dmmeta.ctypelen ctype:gclidb.Mrnote len:304 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:gclidb.Project len:52 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:gclidb.User len:72 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:http.ExtensionHeader len:32 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:http.HeaderType len:2 alignment:2 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:http.Method len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:http.Request len:752 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:http.Response len:640 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:httpdb.Content len:272 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:httpdb.Header len:204 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:httpdb.Method len:205 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:httpdb.Status len:52 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:httpdb.Version len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:ietf.Ipport len:6 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:ietf.Ipv4 len:4 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:ietf.Ipv4Addr len:4 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:lib_ams.FDb len:1352 alignment:8 padbytes:52 plaindata:N -dmmeta.ctypelen ctype:lib_ams.FFdin len:8328 alignment:8 padbytes:17 plaindata:N -dmmeta.ctypelen ctype:lib_ams.FMember len:104 alignment:8 padbytes:5 plaindata:N -dmmeta.ctypelen ctype:lib_ams.FProc len:96 alignment:8 padbytes:12 plaindata:N +dmmeta.ctypelen ctype:jkv.FDb len:80 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:kafka.AclOperationType len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.AclOperations len:4 alignment:4 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.AclPermissionType len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.CompressionType len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.ConfigSource len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.ConfigType len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.Error len:2 alignment:2 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.Frame len:4 alignment:4 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:kafka.GroupRecordKeyHeader len:4 alignment:2 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.GroupRecordValueHeader len:4 alignment:2 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.GroupState len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.Header len:32 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:kafka.OffsetCommitKey len:48 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:kafka.OffsetCommitValue len:56 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:kafka.PatternType len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.Record len:72 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:kafka.RecordBatch len:80 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:kafka.ResourceType len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:kafka.TimestampType len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:lib_ams.FDb len:1472 alignment:8 padbytes:55 plaindata:N +dmmeta.ctypelen ctype:lib_ams.FFdin len:136 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:lib_ams.FProc len:96 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:lib_ams.FReadfile len:96 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:lib_ams.FStream len:272 alignment:8 padbytes:18 plaindata:N -dmmeta.ctypelen ctype:lib_ams.FStreamType len:216 alignment:8 padbytes:3 plaindata:N +dmmeta.ctypelen ctype:lib_ams.FShm len:192 alignment:8 padbytes:15 plaindata:N +dmmeta.ctypelen ctype:lib_ams.FShmember len:176 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:lib_ams.FShmtype len:224 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:lib_ams.FWritefile len:104 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:lib_ams.MsgFmt len:72 alignment:8 padbytes:9 plaindata:N dmmeta.ctypelen ctype:lib_ctype.Cmdline len:16 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:lib_ctype.FBltin len:257 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:lib_ctype.FCdflt len:862 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:lib_ctype.FCfmt len:344 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:lib_ctype.FCfmt len:352 alignment:8 padbytes:8 plaindata:N dmmeta.ctypelen ctype:lib_ctype.FCppfunc len:356 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:lib_ctype.FCtype len:376 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:lib_ctype.FCtype len:384 alignment:8 padbytes:10 plaindata:N dmmeta.ctypelen ctype:lib_ctype.FDb len:3288 alignment:8 padbytes:47 plaindata:N -dmmeta.ctypelen ctype:lib_ctype.FFconst len:560 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:lib_ctype.FField len:768 alignment:8 padbytes:20 plaindata:N +dmmeta.ctypelen ctype:lib_ctype.FFconst len:568 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:lib_ctype.FField len:776 alignment:8 padbytes:24 plaindata:N dmmeta.ctypelen ctype:lib_ctype.FFtuple len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:lib_ctype.FSqltype len:356 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:lib_ctype.FSsimfile len:176 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:lib_ctype.FSsimfile len:176 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:lib_ctype.FSubstr len:472 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:lib_ctype.FUnstablefld len:254 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:lib_ctype.Match len:72 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:lib_curl.FDb len:40 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:lib_curl.FRequest len:376 alignment:8 padbytes:14 plaindata:N +dmmeta.ctypelen ctype:lib_curl.FResponse len:360 alignment:8 padbytes:10 plaindata:N dmmeta.ctypelen ctype:lib_exec.Cmdline len:12 alignment:4 padbytes:4 plaindata:Y dmmeta.ctypelen ctype:lib_exec.FDb len:616 alignment:8 padbytes:23 plaindata:N -dmmeta.ctypelen ctype:lib_exec.FSyscmd len:168 alignment:8 padbytes:16 plaindata:N +dmmeta.ctypelen ctype:lib_exec.FSyscmd len:168 alignment:8 padbytes:12 plaindata:N dmmeta.ctypelen ctype:lib_exec.FSyscmddep len:40 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:lib_fm.FAlarm len:536 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:lib_fm.FAlmCode len:144 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:lib_fm.FAlmObjtype len:88 alignment:8 padbytes:1 plaindata:N +dmmeta.ctypelen ctype:lib_fm.FAlarm len:544 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:lib_fm.FAlmCode len:152 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:lib_fm.FAlmObjtype len:96 alignment:8 padbytes:5 plaindata:N dmmeta.ctypelen ctype:lib_fm.FDb len:880 alignment:8 padbytes:19 plaindata:N dmmeta.ctypelen ctype:lib_git.FDb len:1 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:lib_http.FDb len:2096 alignment:16 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:lib_http.FStatus len:52 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:lib_iconv.FDb len:1 alignment:1 padbytes:0 plaindata:N dmmeta.ctypelen ctype:lib_iconv.Icd len:8 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:lib_json.FDb len:336 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:lib_json.FNode len:72 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:lib_json.FNode len:80 alignment:8 padbytes:15 plaindata:N dmmeta.ctypelen ctype:lib_json.FParser len:96 alignment:8 padbytes:8 plaindata:N dmmeta.ctypelen ctype:lib_json.FldKey len:24 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:lib_mysql.FDb len:16 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:lib_mysql.Res len:8 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:lib_sql.FAttr len:32 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:lib_netio.FDb len:288 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:lib_netio.FVar len:48 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:lib_rl.Cmdline len:40 alignment:8 padbytes:3 plaindata:N +dmmeta.ctypelen ctype:lib_rl.FDb len:128 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:lib_sql.FAttr len:40 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:lib_sql.FDb len:288 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:lib_sqlite.Cons len:32 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:lib_sqlite.FConn len:40 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:lib_sqlite.FCtype len:368 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:lib_sqlite.FConn len:48 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:lib_sqlite.FCtype len:376 alignment:8 padbytes:10 plaindata:N dmmeta.ctypelen ctype:lib_sqlite.FDb len:1968 alignment:8 padbytes:35 plaindata:N -dmmeta.ctypelen ctype:lib_sqlite.FField len:712 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:lib_sqlite.FField len:720 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:lib_sqlite.FIdx len:24 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:lib_sqlite.FNs len:304 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:lib_sqlite.FRow len:112 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:lib_sqlite.FNs len:304 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:lib_sqlite.FRow len:120 alignment:8 padbytes:11 plaindata:N dmmeta.ctypelen ctype:lib_sqlite.FSqltype len:356 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:lib_sqlite.FSsimfile len:192 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:lib_sqlite.FSsimfile len:192 alignment:8 padbytes:9 plaindata:N dmmeta.ctypelen ctype:lib_sqlite.FSubstr len:464 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:lib_sqlite.Vtab len:72 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:lib_sqlite.VtabCurs len:88 alignment:8 padbytes:18 plaindata:N +dmmeta.ctypelen ctype:lib_ws.FDb len:1 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:lib_ws.FrameIdx len:24 alignment:8 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:mdbg.FBuilddir len:205 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:mdbg.FCfg len:240 alignment:8 padbytes:5 plaindata:N -dmmeta.ctypelen ctype:mdbg.FDb len:1032 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:mdbg.FCfg len:248 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:mdbg.FDb len:1040 alignment:8 padbytes:10 plaindata:N dmmeta.ctypelen ctype:mysql2ssim.FDb len:136 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:mysql2ssim.FTobltin len:24 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:orgfile.FDb len:720 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:orgfile.FFilehash len:72 alignment:8 padbytes:6 plaindata:N -dmmeta.ctypelen ctype:orgfile.FFilename len:96 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:orgfile.FDb len:672 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:orgfile.FFilehash len:72 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:orgfile.FFilename len:104 alignment:8 padbytes:17 plaindata:N dmmeta.ctypelen ctype:orgfile.FTimefmt len:255 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:orgfile.dedup len:48 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:orgfile.move len:48 alignment:8 padbytes:0 plaindata:N @@ -1090,14 +1174,20 @@ dmmeta.ctypelen ctype:report.atf_unit len:24 alignment:8 padbytes:3 plainda dmmeta.ctypelen ctype:report.gcache len:96 alignment:8 padbytes:9 plaindata:N dmmeta.ctypelen ctype:report.gcache_hitrate len:44 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:report.src_func len:180 alignment:4 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:samp_make.FDb len:1512 alignment:8 padbytes:27 plaindata:N +dmmeta.ctypelen ctype:samp_make.FGitfile len:216 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:samp_make.FTargdep len:248 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:samp_make.FTarget len:312 alignment:8 padbytes:21 plaindata:N +dmmeta.ctypelen ctype:samp_make.FTargrec len:232 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:samp_make.FTargsrc len:224 alignment:8 padbytes:5 plaindata:N dmmeta.ctypelen ctype:samp_meng.CancelOrderMsg len:10 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:samp_meng.CancelReqMsg len:10 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:samp_meng.FDb len:936 alignment:8 padbytes:27 plaindata:N -dmmeta.ctypelen ctype:samp_meng.FFdin len:8328 alignment:8 padbytes:17 plaindata:N -dmmeta.ctypelen ctype:samp_meng.FOrder len:104 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:samp_meng.FDb len:1040 alignment:8 padbytes:20 plaindata:N +dmmeta.ctypelen ctype:samp_meng.FFdin len:136 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:samp_meng.FOrder len:112 alignment:8 padbytes:12 plaindata:N dmmeta.ctypelen ctype:samp_meng.FOrdq len:48 alignment:8 padbytes:14 plaindata:N -dmmeta.ctypelen ctype:samp_meng.FSymbol len:40 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:samp_meng.FUser len:40 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:samp_meng.FSymbol len:40 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:samp_meng.FUser len:40 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:samp_meng.I64Price8 len:8 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:samp_meng.MassCancelReqMsg len:6 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:samp_meng.MsgHeader len:2 alignment:1 padbytes:0 plaindata:Y @@ -1111,54 +1201,74 @@ dmmeta.ctypelen ctype:samp_meng.OrderTradeMsg len:22 alignment:1 padbytes:0 dmmeta.ctypelen ctype:samp_meng.Ordkey len:16 alignment:8 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:samp_meng.Symbol len:8 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:samp_meng.TextMsg len:2 alignment:1 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:samp_regx.FDb len:72 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:sandbox.FDb len:720 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:sandbox.FSandbox len:240 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:samp_regx.FDb len:64 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:sampdb.Gitfile len:204 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:sampdb.Targdep len:206 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:sampdb.Target len:205 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:sampdb.Targrec len:224 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:sampdb.Targsrc len:206 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:sandbox.FDb len:688 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:sandbox.FSandbox len:240 alignment:8 padbytes:7 plaindata:N dmmeta.ctypelen ctype:sandbox.FSbpath len:204 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:src_func.FCtypelen len:128 alignment:8 padbytes:5 plaindata:N -dmmeta.ctypelen ctype:src_func.FDb len:3248 alignment:8 padbytes:46 plaindata:N -dmmeta.ctypelen ctype:src_func.FDispatch len:210 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:src_func.FFstep len:306 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:src_func.FFunc len:144 alignment:8 padbytes:10 plaindata:N -dmmeta.ctypelen ctype:src_func.FGenprefix len:112 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:src_func.FGstatic len:254 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:src_func.FTarget len:48 alignment:8 padbytes:9 plaindata:N -dmmeta.ctypelen ctype:src_func.FTargsrc len:312 alignment:8 padbytes:13 plaindata:N -dmmeta.ctypelen ctype:src_hdr.FCopyline len:32 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:src_hdr.FCopyright len:248 alignment:8 padbytes:11 plaindata:N -dmmeta.ctypelen ctype:src_hdr.FDb len:2176 alignment:8 padbytes:35 plaindata:N -dmmeta.ctypelen ctype:src_hdr.FLicense len:232 alignment:8 padbytes:4 plaindata:N -dmmeta.ctypelen ctype:src_hdr.FNs len:304 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:src_func.FCtypelen len:136 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:src_func.FDb len:2448 alignment:8 padbytes:46 plaindata:N +dmmeta.ctypelen ctype:src_func.FFunc len:184 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:src_func.FGenaffix len:32 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:src_func.FTarget len:48 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:src_func.FTargsrc len:312 alignment:8 padbytes:9 plaindata:N +dmmeta.ctypelen ctype:src_func.FUserfunc len:560 alignment:8 padbytes:8 plaindata:N +dmmeta.ctypelen ctype:src_hdr.FCopyline len:40 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:src_hdr.FCopyright len:248 alignment:8 padbytes:7 plaindata:N +dmmeta.ctypelen ctype:src_hdr.FDb len:2080 alignment:8 padbytes:35 plaindata:N +dmmeta.ctypelen ctype:src_hdr.FLicense len:232 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:src_hdr.FNs len:304 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:src_hdr.FNsx len:276 alignment:1 padbytes:0 plaindata:Y dmmeta.ctypelen ctype:src_hdr.FScriptfile len:416 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:src_hdr.FSrc len:152 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:src_hdr.FTarget len:56 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:src_hdr.FTarget len:56 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:src_hdr.FTargsrc len:272 alignment:8 padbytes:8 plaindata:N -dmmeta.ctypelen ctype:src_lim.FBadline len:648 alignment:8 padbytes:13 plaindata:N -dmmeta.ctypelen ctype:src_lim.FDb len:1560 alignment:8 padbytes:19 plaindata:N -dmmeta.ctypelen ctype:src_lim.FGitfile len:256 alignment:8 padbytes:10 plaindata:N +dmmeta.ctypelen ctype:src_lim.FBadline len:552 alignment:8 padbytes:13 plaindata:N +dmmeta.ctypelen ctype:src_lim.FDb len:1464 alignment:8 padbytes:19 plaindata:N +dmmeta.ctypelen ctype:src_lim.FGitfile len:256 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:src_lim.FInclude len:376 alignment:8 padbytes:5 plaindata:N dmmeta.ctypelen ctype:src_lim.FLinelim len:284 alignment:4 padbytes:2 plaindata:Y dmmeta.ctypelen ctype:src_lim.FTargsrc len:272 alignment:8 padbytes:9 plaindata:N dmmeta.ctypelen ctype:ssim2csv.FDb len:640 alignment:8 padbytes:15 plaindata:N -dmmeta.ctypelen ctype:ssim2csv.FExpand len:24 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ssim2csv.FExpand len:32 alignment:8 padbytes:4 plaindata:N dmmeta.ctypelen ctype:ssim2csv.FFlatten len:32 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ssim2csv.FOutfile len:48 alignment:8 padbytes:4 plaindata:N +dmmeta.ctypelen ctype:ssim2csv.FOutfile len:48 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:ssim2mysql.FCmd len:32 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ssim2mysql.FColumn len:144 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:ssim2mysql.FCtype len:304 alignment:8 padbytes:2 plaindata:N +dmmeta.ctypelen ctype:ssim2mysql.FColumn len:152 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:ssim2mysql.FCtype len:312 alignment:8 padbytes:6 plaindata:N dmmeta.ctypelen ctype:ssim2mysql.FDb len:2136 alignment:8 padbytes:32 plaindata:N -dmmeta.ctypelen ctype:ssim2mysql.FField len:704 alignment:8 padbytes:9 plaindata:N -dmmeta.ctypelen ctype:ssim2mysql.FInput len:65696 alignment:8 padbytes:17 plaindata:N -dmmeta.ctypelen ctype:ssim2mysql.FNs len:304 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:ssim2mysql.FField len:704 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:ssim2mysql.FInput len:160 alignment:8 padbytes:5 plaindata:N +dmmeta.ctypelen ctype:ssim2mysql.FNs len:304 alignment:8 padbytes:2 plaindata:N dmmeta.ctypelen ctype:ssim2mysql.FSqltype len:356 alignment:1 padbytes:0 plaindata:Y -dmmeta.ctypelen ctype:ssim2mysql.FSsimfile len:224 alignment:8 padbytes:19 plaindata:N +dmmeta.ctypelen ctype:ssim2mysql.FSsimfile len:232 alignment:8 padbytes:23 plaindata:N dmmeta.ctypelen ctype:ssim2mysql.FSubstr len:464 alignment:8 padbytes:0 plaindata:N -dmmeta.ctypelen ctype:ssimfilt.FDb len:1240 alignment:8 padbytes:21 plaindata:N -dmmeta.ctypelen ctype:ssimfilt.FUnstablefld len:264 alignment:8 padbytes:2 plaindata:N -dmmeta.ctypelen ctype:ssimfilt.KVRegx len:176 alignment:8 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ssimfilt.FDb len:1192 alignment:8 padbytes:21 plaindata:N +dmmeta.ctypelen ctype:ssimfilt.FUnstablefld len:272 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:ssimfilt.KVRegx len:80 alignment:8 padbytes:0 plaindata:N dmmeta.ctypelen ctype:strconv.FDb len:152 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:sv2ssim.FBltin len:272 alignment:8 padbytes:7 plaindata:N -dmmeta.ctypelen ctype:sv2ssim.FDb len:1080 alignment:8 padbytes:26 plaindata:N -dmmeta.ctypelen ctype:sv2ssim.FField len:192 alignment:8 padbytes:6 plaindata:N +dmmeta.ctypelen ctype:sv2ssim.FBltin len:280 alignment:8 padbytes:11 plaindata:N +dmmeta.ctypelen ctype:sv2ssim.FDb len:1032 alignment:8 padbytes:26 plaindata:N +dmmeta.ctypelen ctype:sv2ssim.FField len:200 alignment:8 padbytes:10 plaindata:N dmmeta.ctypelen ctype:sv2ssim.FSvtype len:268 alignment:4 padbytes:2 plaindata:Y +dmmeta.ctypelen ctype:ws.CloseMsg len:61 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ws.ConnectMsg len:59 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ws.DataMsg len:60 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ws.Frame len:2 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ws.Frame16 len:4 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ws.Frame64 len:10 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ws.FrameHeader len:2 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ws.FrameMasked len:6 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ws.FrameMasked16 len:8 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ws.FrameMasked64 len:14 alignment:1 padbytes:0 plaindata:N +dmmeta.ctypelen ctype:ws.HttpState len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ws.Opcode len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ws.ServerStartMsg len:33 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ws.ServerStopMsg len:33 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ws.Side len:1 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:ws.StatusCode len:2 alignment:1 padbytes:0 plaindata:Y +dmmeta.ctypelen ctype:wsdb.Status len:192 alignment:4 padbytes:1 plaindata:Y diff --git a/data/dmmeta/dispatch.ssim b/data/dmmeta/dispatch.ssim index 60268b20..46965f7a 100644 --- a/data/dmmeta/dispatch.ssim +++ b/data/dmmeta/dispatch.ssim @@ -1,6 +1,9 @@ -dmmeta.dispatch dispatch:atf_amc.Disp unk:N read:N print:N haslen:N call:N strict:N comment:"" -dmmeta.dispatch dispatch:atf_amc.Msgs unk:N read:Y print:N haslen:N call:N strict:N comment:"" -dmmeta.dispatch dispatch:atf_amc.Ssimfiles unk:N read:Y print:N haslen:N call:N strict:N comment:"" -dmmeta.dispatch dispatch:lib_ams.CtlConn unk:N read:N print:N haslen:N call:N strict:Y comment:"" -dmmeta.dispatch dispatch:lib_ams.CtlMsg unk:N read:N print:N haslen:N call:Y strict:N comment:"" -dmmeta.dispatch dispatch:samp_meng.In unk:N read:Y print:Y haslen:N call:Y strict:N comment:"" +dmmeta.dispatch dispatch:atf_amc.Disp unk:N read:N print:N haslen:N call:N strict:N dyn:N kafka:N comment:"" +dmmeta.dispatch dispatch:atf_amc.Msgs unk:N read:Y print:N haslen:N call:N strict:N dyn:N kafka:N comment:"" +dmmeta.dispatch dispatch:atf_amc.Ssimfiles unk:N read:Y print:N haslen:N call:N strict:N dyn:N kafka:N comment:"" +dmmeta.dispatch dispatch:atf_exp.In unk:N read:N print:N haslen:N call:Y strict:N dyn:N kafka:N comment:"" +dmmeta.dispatch dispatch:lib_ams.CtlConn unk:N read:N print:N haslen:N call:N strict:Y dyn:N kafka:N comment:"" +dmmeta.dispatch dispatch:lib_ams.CtlMsg unk:N read:N print:N haslen:N call:Y strict:N dyn:N kafka:N comment:"" +dmmeta.dispatch dispatch:lib_ws.FrameIdx unk:Y read:N print:N haslen:Y call:Y strict:N dyn:N kafka:N comment:"" +dmmeta.dispatch dispatch:lib_ws.FrameLen unk:Y read:N print:N haslen:Y call:Y strict:N dyn:N kafka:N comment:"" +dmmeta.dispatch dispatch:samp_meng.In unk:N read:Y print:Y haslen:N call:Y strict:N dyn:N kafka:N comment:"" diff --git a/data/dmmeta/dispatch_msg.ssim b/data/dmmeta/dispatch_msg.ssim index 36f29a68..892ed940 100644 --- a/data/dmmeta/dispatch_msg.ssim +++ b/data/dmmeta/dispatch_msg.ssim @@ -3,13 +3,23 @@ dmmeta.dispatch_msg dispatch_msg:atf_amc.Disp/atf_amc.DispType2 comment:"" dmmeta.dispatch_msg dispatch_msg:atf_amc.Disp/atf_amc.DispType3 comment:"" dmmeta.dispatch_msg dispatch_msg:atf_amc.Msgs/atf_amc.VarlenK comment:"" dmmeta.dispatch_msg dispatch_msg:atf_amc.Ssimfiles/dmmeta.Ctype comment:"" -dmmeta.dispatch_msg dispatch_msg:lib_ams.CtlConn/ams.AlarmSyncMsg comment:"" -dmmeta.dispatch_msg dispatch_msg:lib_ams.CtlConn/ams.HeartbeatMsg comment:"" +dmmeta.dispatch_msg dispatch_msg:atf_exp.In/ams.ProcEofMsg comment:"" +dmmeta.dispatch_msg dispatch_msg:atf_exp.In/ams.ProcKillMsg comment:"" +dmmeta.dispatch_msg dispatch_msg:atf_exp.In/ams.ProcMsg comment:"" +dmmeta.dispatch_msg dispatch_msg:atf_exp.In/ams.ProcReadMsg comment:"" +dmmeta.dispatch_msg dispatch_msg:atf_exp.In/ams.ProcStartMsg comment:"" +dmmeta.dispatch_msg dispatch_msg:atf_exp.In/ams.RemDirRecurseMsg comment:"" +dmmeta.dispatch_msg dispatch_msg:atf_exp.In/ams.TerminateMsg comment:"" dmmeta.dispatch_msg dispatch_msg:lib_ams.CtlConn/fm.AlarmMsg comment:"" -dmmeta.dispatch_msg dispatch_msg:lib_ams.CtlMsg/ams.DumpStreamTableMsg comment:"" -dmmeta.dispatch_msg dispatch_msg:lib_ams.CtlMsg/ams.ProcAddMsg comment:"" -dmmeta.dispatch_msg dispatch_msg:lib_ams.CtlMsg/ams.ProcRemoveMsg comment:"" -dmmeta.dispatch_msg dispatch_msg:lib_ams.CtlMsg/ams.StreamHbMsg comment:"" +dmmeta.dispatch_msg dispatch_msg:lib_ams.CtlMsg/ams.ShmHbMsg comment:"" +dmmeta.dispatch_msg dispatch_msg:lib_ws.FrameIdx/ws.Frame16 comment:"" +dmmeta.dispatch_msg dispatch_msg:lib_ws.FrameIdx/ws.Frame64 comment:"" +dmmeta.dispatch_msg dispatch_msg:lib_ws.FrameIdx/ws.FrameMasked16 comment:"" +dmmeta.dispatch_msg dispatch_msg:lib_ws.FrameIdx/ws.FrameMasked64 comment:"" +dmmeta.dispatch_msg dispatch_msg:lib_ws.FrameLen/ws.Frame16 comment:"" +dmmeta.dispatch_msg dispatch_msg:lib_ws.FrameLen/ws.Frame64 comment:"" +dmmeta.dispatch_msg dispatch_msg:lib_ws.FrameLen/ws.FrameMasked16 comment:"" +dmmeta.dispatch_msg dispatch_msg:lib_ws.FrameLen/ws.FrameMasked64 comment:"" dmmeta.dispatch_msg dispatch_msg:samp_meng.In/samp_meng.CancelReqMsg comment:"" dmmeta.dispatch_msg dispatch_msg:samp_meng.In/samp_meng.MassCancelReqMsg comment:"" dmmeta.dispatch_msg dispatch_msg:samp_meng.In/samp_meng.NewOrderReqMsg comment:"" diff --git a/data/dmmeta/dispctx.ssim b/data/dmmeta/dispctx.ssim index e69de29b..00abde93 100644 --- a/data/dmmeta/dispctx.ssim +++ b/data/dmmeta/dispctx.ssim @@ -0,0 +1,2 @@ +dmmeta.dispctx dispatch:lib_ws.FrameIdx ctype:lib_ws.FrameIdx comment:"" +dmmeta.dispctx dispatch:lib_ws.FrameLen ctype:i32 comment:"" diff --git a/data/dmmeta/dispsig.ssim b/data/dmmeta/dispsig.ssim index d10a0cde..2663a736 100644 --- a/data/dmmeta/dispsig.ssim +++ b/data/dmmeta/dispsig.ssim @@ -1,36 +1,40 @@ -dmmeta.dispsig dispsig:abt.Input signature:e6410c40f922d321b99d2a6d7a62d27f1d49a5ac -dmmeta.dispsig dispsig:abt_md.Input signature:f2418f59a8d671bde387788c12ed2748090ae825 -dmmeta.dispsig dispsig:acr.Input signature:a69d341ad2eab159ab4ccafa9c9a1d991af5589c +dmmeta.dispsig dispsig:abt.Input signature:a3467e9a802a9e293d88ca8cb2cead5a09c85dcf +dmmeta.dispsig dispsig:abt_md.Input signature:1d64073c67d090b1a9ec75e09f0de10c7c1bc7d2 +dmmeta.dispsig dispsig:acr.Input signature:bb2ab492247f7dd389e5b120d6369aafe91d87da dmmeta.dispsig dispsig:acr_compl.Input signature:af49159b85d99a9b207d2eacdc5453c1f73d8e4b -dmmeta.dispsig dispsig:acr_ed.Input signature:042948d5ec028115be9d280cd8fe64e20bae7485 +dmmeta.dispsig dispsig:acr_ed.Input signature:c33981549fb661085a0bfba14529630cc4312242 dmmeta.dispsig dispsig:acr_in.Input signature:d48a6dc1b049c2717480bd82d5da16a9d765c724 dmmeta.dispsig dispsig:acr_my.Input signature:4af1104b912fd0ce532858d685766efe3c9836a6 dmmeta.dispsig dispsig:algo_lib.Input signature:ddc07e859e7056e1a824df1ad0e6d08e12e89849 -dmmeta.dispsig dispsig:amc.Input signature:1028c706dfd39d2aeb9bcab5542184a9d2642574 -dmmeta.dispsig dispsig:amc_vis.Input signature:533c01b711e8b6ff9e6268d40b3b5c11331f68b5 -dmmeta.dispsig dispsig:apm.Input signature:6cd9ce149ee2dcf2150fc77eec6ace0504e98b5a +dmmeta.dispsig dispsig:amc.Input signature:e9d5953ed69a710a66a2fe892cfbeee717f873b3 +dmmeta.dispsig dispsig:amc_vis.Input signature:3fd9f00c5d7a2ad359db59975e0c5ca517daced4 +dmmeta.dispsig dispsig:apm.Input signature:8e39e16efc1a10730e148e6d4ccba5b97e895ab6 dmmeta.dispsig dispsig:atf_amc.Disp signature:d11df8e45dfabb45e515398cd71d30a184879014 dmmeta.dispsig dispsig:atf_amc.Input signature:3b9943558be9b03e79fade60297ec50f1d4702a3 dmmeta.dispsig dispsig:atf_amc.Msgs signature:f80a13e46fff2c18de1f4dbbbb11703d07c170d2 dmmeta.dispsig dispsig:atf_amc.Ssimfiles signature:f2409fade5c9373dc13379fe888df9435e3c0987 -dmmeta.dispsig dispsig:atf_ci.Input signature:7a8e5cb51bc025925f1aa7f6a12998146ebda21c -dmmeta.dispsig dispsig:atf_comp.Input signature:b05bbcc62beda39e9afa4145fceb830147523bd6 -dmmeta.dispsig dispsig:atf_cov.Input signature:bae3d22d101a439927195b2697d7d68f8ee4bff5 +dmmeta.dispsig dispsig:atf_ci.Input signature:572ca634bbac62d53a8602668fbaa85db3b791f8 +dmmeta.dispsig dispsig:atf_comp.Input signature:a1f857af527d388c20fb27796f5f322b4bd1e42f +dmmeta.dispsig dispsig:atf_cov.Input signature:d66d21a3b569781c26e5ede79240bebe11ae80c4 +dmmeta.dispsig dispsig:atf_exp.In signature:fd4b4ce25976a60f5880564b2d24879add6a27d0 dmmeta.dispsig dispsig:atf_fuzz.Input signature:9ba6a4d39f12eb6e4056fa626a272e08de588888 dmmeta.dispsig dispsig:atf_gcli.Input signature:4389b15ab01b092474cb6ac758fa336bd012f965 -dmmeta.dispsig dispsig:gcli.Input signature:11a9aa9a5e538f546927ef1802bd464c4e5842b9 -dmmeta.dispsig dispsig:lib_ams.CtlConn signature:a97117f47887d9e386b0b46863db70bcc5ee1d43 -dmmeta.dispsig dispsig:lib_ams.CtlMsg signature:90f280b1d0ea224349fab6afa67209c80742b8f4 +dmmeta.dispsig dispsig:gcli.Input signature:582f69151ea05d2c1b5eb2e745d7211a5c87c417 +dmmeta.dispsig dispsig:lib_ams.CtlConn signature:83624960d9b39fa4bb8b968922178ca988f4bf18 +dmmeta.dispsig dispsig:lib_ams.CtlMsg signature:ed438eec919efe449c056873abddbc2332d54b53 dmmeta.dispsig dispsig:lib_ctype.Input signature:9f2e90c5e54c166080039493e7b06fd0cc60d63e dmmeta.dispsig dispsig:lib_fm.Input signature:31fbf0507fb2ed9da38949e132b768cb72b6de2b dmmeta.dispsig dispsig:lib_sqlite.Input signature:e7e2e83db2db50f346988c3c118af552e9a8d444 +dmmeta.dispsig dispsig:lib_ws.FrameIdx signature:16e074d027eb2e98445e4bdbaad025f92c98e679 +dmmeta.dispsig dispsig:lib_ws.FrameLen signature:16e074d027eb2e98445e4bdbaad025f92c98e679 dmmeta.dispsig dispsig:mdbg.Input signature:a39a7508119d6dc51451d2cda9f120fd888b1184 dmmeta.dispsig dispsig:orgfile.Input signature:dadfcf8accbcc44f5e5443f439ac4024afc89edf +dmmeta.dispsig dispsig:samp_make.Input signature:4e9da3ce15f985cf3fee1f50564951a827262ab0 dmmeta.dispsig dispsig:samp_meng.In signature:8ccb978398f8888f2ca1f6a371e62ad802b54032 dmmeta.dispsig dispsig:sandbox.Input signature:cc12803fdb112312e03adeccfcb9535fc5825f85 -dmmeta.dispsig dispsig:src_func.Input signature:5d834e23d5da4b43a45249cf5cc36918b46802fa +dmmeta.dispsig dispsig:src_func.Input signature:7eac979b98f561e842f8ee28e37732cad21f9ebe dmmeta.dispsig dispsig:src_hdr.Input signature:eedf70958929d3625b0910fd6de7b646dce50d54 -dmmeta.dispsig dispsig:src_lim.Input signature:00ee14baa7bb10e798a9968848e5501b1eba3043 +dmmeta.dispsig dispsig:src_lim.Input signature:224e271405f3446891ae5d77a84627cf985aff9f dmmeta.dispsig dispsig:ssim2mysql.Input signature:d41a6705fe7e51637203614b4b01fcef04566513 dmmeta.dispsig dispsig:ssimfilt.Input signature:b976bb282360112c9b3d35b51259c1977faae6ff dmmeta.dispsig dispsig:sv2ssim.Input signature:af79eaf9b4ed5338f63e526d8cc7f32e470fe2ad diff --git a/data/dmmeta/disptrace.ssim b/data/dmmeta/disptrace.ssim index e69de29b..f2a1da04 100644 --- a/data/dmmeta/disptrace.ssim +++ b/data/dmmeta/disptrace.ssim @@ -0,0 +1,2 @@ +dmmeta.disptrace dispatch:atf_exp.In cycle:Y comment:"" +dmmeta.disptrace dispatch:samp_meng.In cycle:Y comment:"" diff --git a/data/dmmeta/fbigend.ssim b/data/dmmeta/fbigend.ssim index bdcc59bf..2975c738 100644 --- a/data/dmmeta/fbigend.ssim +++ b/data/dmmeta/fbigend.ssim @@ -7,3 +7,8 @@ dmmeta.fbigend field:atf_amc.TypeBE64.value comment:"" dmmeta.fbigend field:atf_amc.TypeBE64dflt.value comment:"" dmmeta.fbigend field:atf_amc.TypeBE64sf.value comment:"" dmmeta.fbigend field:ietf.Ipv4Addr.addr comment:"" +dmmeta.fbigend field:kafka.Frame.size comment:"" +dmmeta.fbigend field:ws.Frame16.ext_payload_len comment:"" +dmmeta.fbigend field:ws.Frame64.ext_payload_len comment:"" +dmmeta.fbigend field:ws.FrameMasked16.ext_payload_len comment:"" +dmmeta.fbigend field:ws.FrameMasked64.ext_payload_len comment:"" diff --git a/data/dmmeta/fbuf.ssim b/data/dmmeta/fbuf.ssim index d2c639c2..8b2afa96 100644 --- a/data/dmmeta/fbuf.ssim +++ b/data/dmmeta/fbuf.ssim @@ -1,10 +1,13 @@ -dmmeta.fbuf field:atf_amc.Bytebuf.in max:64 fbuftype:Bytebuf insready:atf_amc.Bytebuf.in inseof:atf_amc.Bytebuf.in comment:"" -dmmeta.fbuf field:atf_amc.BytebufDyn.in max:0 fbuftype:Bytebuf insready:atf_amc.BytebufDyn.in inseof:atf_amc.BytebufDyn.in comment:"" -dmmeta.fbuf field:atf_amc.Linebuf.in max:64 fbuftype:Linebuf insready:atf_amc.Linebuf.in inseof:atf_amc.Linebuf.in comment:"" -dmmeta.fbuf field:atf_amc.Msgbuf.in_buf max:64 fbuftype:Msgbuf insready:atf_amc.FDb.cd_in_msg inseof:atf_amc.Msgbuf.in_buf comment:"" -dmmeta.fbuf field:atf_amc.Msgbuf.in_custom max:64 fbuftype:BytebufExtern insready:atf_amc.FDb.cd_in_msg inseof:atf_amc.Msgbuf.in_custom comment:"" -dmmeta.fbuf field:atf_amc.Msgbuf.in_extra max:64 fbuftype:Msgbuf insready:atf_amc.Msgbuf.in_extra inseof:atf_amc.Msgbuf.in_extra comment:"" -dmmeta.fbuf field:atf_amc.Msgbuf.out_extra max:64 fbuftype:Msgbuf insready:atf_amc.Msgbuf.out_extra inseof:atf_amc.Msgbuf.out_extra comment:"" -dmmeta.fbuf field:lib_ams.FFdin.in max:8192 fbuftype:Linebuf insready:lib_ams.FDb.cd_fdin_read inseof:lib_ams.FDb.cd_fdin_eof comment:"" -dmmeta.fbuf field:samp_meng.FFdin.in max:8192 fbuftype:Linebuf insready:samp_meng.FDb.cd_fdin_read inseof:samp_meng.FDb.cd_fdin_eof comment:"" -dmmeta.fbuf field:ssim2mysql.FInput.in_buf max:65536 fbuftype:Linebuf insready:ssim2mysql.FDb.cd_input_line inseof:ssim2mysql.FInput.in_buf comment:"" +dmmeta.fbuf field:atf_amc.Bytebuf.in max:64 fbuftype:Bytebuf insready:"" inseof:"" iotype:nofd comment:"" +dmmeta.fbuf field:atf_amc.BytebufDyn.in max:0 fbuftype:Bytebuf insready:"" inseof:"" iotype:nofd comment:"" +dmmeta.fbuf field:atf_amc.Linebuf.in max:64 fbuftype:Linebuf insready:"" inseof:"" iotype:nofd comment:"" +dmmeta.fbuf field:atf_amc.Msgbuf.in_buf max:64 fbuftype:Msgbuf insready:atf_amc.FDb.cd_in_msg inseof:"" iotype:standard comment:"" +dmmeta.fbuf field:atf_amc.Msgbuf.in_custom max:64 fbuftype:BytebufExtern insready:atf_amc.FDb.cd_in_msg inseof:"" iotype:standard comment:"" +dmmeta.fbuf field:atf_amc.Msgbuf.in_extra max:64 fbuftype:Msgbuf insready:"" inseof:"" iotype:nofd comment:"" +dmmeta.fbuf field:atf_amc.Msgbuf.out_extra max:64 fbuftype:Msgbuf insready:"" inseof:"" iotype:nofd comment:"" +dmmeta.fbuf field:atf_exp.FFdin.in max:8192 fbuftype:Linebuf insready:atf_exp.FDb.cd_fdin_read inseof:"" iotype:standard comment:"" +dmmeta.fbuf field:atf_exp.FProc.in max:1048576 fbuftype:Linebuf insready:atf_exp.FDb.cd_proc_read inseof:"" iotype:standard comment:"" +dmmeta.fbuf field:atf_exp.FProc.out max:1048576 fbuftype:Linebuf insready:atf_exp.FDb.cd_proc_outflow inseof:"" iotype:standard comment:"" +dmmeta.fbuf field:lib_ams.FFdin.in max:8192 fbuftype:Linebuf insready:lib_ams.FDb.cd_fdin_read inseof:lib_ams.FDb.cd_fdin_eof iotype:standard comment:"" +dmmeta.fbuf field:samp_meng.FFdin.in max:8192 fbuftype:Linebuf insready:samp_meng.FDb.cd_fdin_read inseof:samp_meng.FDb.cd_fdin_eof iotype:standard comment:"" +dmmeta.fbuf field:ssim2mysql.FInput.in_buf max:65536 fbuftype:Linebuf insready:ssim2mysql.FDb.cd_input_line inseof:"" iotype:standard comment:"" diff --git a/data/dmmeta/fbufiotype.ssim b/data/dmmeta/fbufiotype.ssim new file mode 100644 index 00000000..d2a1d9ee --- /dev/null +++ b/data/dmmeta/fbufiotype.ssim @@ -0,0 +1,3 @@ +dmmeta.fbufiotype fbufiotype:nofd comment:"no iohook" +dmmeta.fbufiotype fbufiotype:openssl comment:"standard + SSL_read, SSL_write" +dmmeta.fbufiotype fbufiotype:standard comment:"unix standard: read, write" diff --git a/data/dmmeta/fcast.ssim b/data/dmmeta/fcast.ssim index 46273ef7..9b20a537 100644 --- a/data/dmmeta/fcast.ssim +++ b/data/dmmeta/fcast.ssim @@ -14,6 +14,7 @@ dmmeta.fcast field:algo.I32Dec2.value expr:"" comment:"" dmmeta.fcast field:algo.I32Dec3.value expr:"" comment:"" dmmeta.fcast field:algo.I32Dec4.value expr:"" comment:"" dmmeta.fcast field:algo.I32Dec5.value expr:"" comment:"" +dmmeta.fcast field:algo.I32RangeAry.ary expr:"" comment:"" dmmeta.fcast field:algo.I64Dec1.value expr:"" comment:"" dmmeta.fcast field:algo.I64Dec10.value expr:"" comment:"" dmmeta.fcast field:algo.I64Dec2.value expr:"" comment:"" @@ -151,8 +152,10 @@ dmmeta.fcast field:algo.Smallstr16.ch expr:algo::strptr comment:"" dmmeta.fcast field:algo.Smallstr2.ch expr:algo::strptr comment:"" dmmeta.fcast field:algo.Smallstr20.ch expr:algo::strptr comment:"" dmmeta.fcast field:algo.Smallstr200.ch expr:algo::strptr comment:"" +dmmeta.fcast field:algo.Smallstr249.ch expr:algo::strptr comment:"" dmmeta.fcast field:algo.Smallstr25.ch expr:algo::strptr comment:"" dmmeta.fcast field:algo.Smallstr250.ch expr:algo::strptr comment:"" +dmmeta.fcast field:algo.Smallstr255.ch expr:algo::strptr comment:"" dmmeta.fcast field:algo.Smallstr3.ch expr:algo::strptr comment:"" dmmeta.fcast field:algo.Smallstr30.ch expr:algo::strptr comment:"" dmmeta.fcast field:algo.Smallstr32.ch expr:algo::strptr comment:"" @@ -169,6 +172,7 @@ dmmeta.fcast field:algo.U32Dec2.value expr:"" comment:"" dmmeta.fcast field:algo.U32Dec3.value expr:"" comment:"" dmmeta.fcast field:algo.U32Dec4.value expr:"" comment:"" dmmeta.fcast field:algo.U32Dec5.value expr:"" comment:"" +dmmeta.fcast field:algo.U32LinearKey.value expr:"" comment:"" dmmeta.fcast field:algo.U64Dec10.value expr:"" comment:"" dmmeta.fcast field:algo.U64Dec2.value expr:"" comment:"" dmmeta.fcast field:algo.U64Dec4.value expr:"" comment:"" @@ -177,6 +181,7 @@ dmmeta.fcast field:algo.U64Dec6.value expr:"" comment:"" dmmeta.fcast field:algo.U64Dec7.value expr:"" comment:"" dmmeta.fcast field:algo.U64Dec9.value expr:"" comment:"" dmmeta.fcast field:algo.cstring.ch expr:algo::strptr comment:"" +dmmeta.fcast field:algo_lib.RegxStyle.value expr:"" comment:"" dmmeta.fcast field:algo_lib.RegxToken.type expr:"" comment:"" dmmeta.fcast field:amc.BltinId.value expr:"" comment:"" dmmeta.fcast field:amc.Pnewtype.value expr:"" comment:"" @@ -198,3 +203,7 @@ dmmeta.fcast field:fm.Objinst.ch expr:algo::strptr comment:"" dmmeta.fcast field:fm.Objtype.ch expr:algo::strptr comment:"" dmmeta.fcast field:fm.Source.ch expr:algo::strptr comment:"" dmmeta.fcast field:fm.Summary.ch expr:algo::strptr comment:"" +dmmeta.fcast field:kafka.AclOperations.value expr:"" comment:"" +dmmeta.fcast field:kafka.Error.value expr:"" comment:"" +dmmeta.fcast field:ws.Side.value expr:"" comment:"" +dmmeta.fcast field:ws.StatusCode.value expr:"" comment:"" diff --git a/data/dmmeta/fcleanup.ssim b/data/dmmeta/fcleanup.ssim index 0bb8cf8d..54ab8581 100644 --- a/data/dmmeta/fcleanup.ssim +++ b/data/dmmeta/fcleanup.ssim @@ -5,16 +5,15 @@ dmmeta.fcleanup field:algo_lib.FLockfile.fildes comment:"" dmmeta.fcleanup field:algo_lib.FTempfile.fildes comment:"" dmmeta.fcleanup field:algo_lib.InTextFile.file comment:"" dmmeta.fcleanup field:algo_lib.Mmap.mem comment:"" -dmmeta.fcleanup field:algo_lib.Replscope.ind_replvar comment:"" dmmeta.fcleanup field:atf_amc.AmcCleanup2.field1 comment:"" dmmeta.fcleanup field:atf_amc.AmcCleanup2.field2 comment:"" dmmeta.fcleanup field:atf_amc.FCascdel.key comment:"" dmmeta.fcleanup field:lib_ams.FReadfile.fd comment:"" -dmmeta.fcleanup field:lib_ams.FStream.shm_file comment:"" -dmmeta.fcleanup field:lib_ams.FStream.shm_handle comment:"" +dmmeta.fcleanup field:lib_ams.FShm.shm_file comment:"" dmmeta.fcleanup field:lib_ams.FWritefile.fd comment:"" dmmeta.fcleanup field:lib_iconv.Icd.icd comment:"" dmmeta.fcleanup field:lib_json.FParser.root_node comment:"" dmmeta.fcleanup field:lib_mysql.FDb.mysql comment:"" dmmeta.fcleanup field:lib_mysql.Res.res comment:"" +dmmeta.fcleanup field:lib_rl.FDb.iohook comment:"" dmmeta.fcleanup field:lib_sqlite.FConn.db comment:"" diff --git a/data/dmmeta/fcmdline.ssim b/data/dmmeta/fcmdline.ssim index dc783311..d0146702 100644 --- a/data/dmmeta/fcmdline.ssim +++ b/data/dmmeta/fcmdline.ssim @@ -10,7 +10,6 @@ dmmeta.fcmdline field:algo_lib.FDb.cmdline read:Y basecmdline:"" comment:"" dmmeta.fcmdline field:amc.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:amc_gc.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:amc_vis.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" -dmmeta.fcmdline field:ams_cat.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:ams_sendtest.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:apm.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:aqlite.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" @@ -19,6 +18,7 @@ dmmeta.fcmdline field:atf_ci.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdl dmmeta.fcmdline field:atf_cmdline.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:atf_comp.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:atf_cov.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" +dmmeta.fcmdline field:atf_exp.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:atf_fuzz.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:atf_gcli.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:atf_nrun.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" @@ -26,10 +26,12 @@ dmmeta.fcmdline field:atf_unit.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cm dmmeta.fcmdline field:bash2html.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:gcache.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:gcli.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" +dmmeta.fcmdline field:jkv.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:lib_exec.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:mdbg.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:mysql2ssim.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:orgfile.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" +dmmeta.fcmdline field:samp_make.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:samp_meng.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:samp_regx.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" dmmeta.fcmdline field:sandbox.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" diff --git a/data/dmmeta/fconst.ssim b/data/dmmeta/fconst.ssim index 38b8baca..70375e0e 100644 --- a/data/dmmeta/fconst.ssim +++ b/data/dmmeta/fconst.ssim @@ -30,8 +30,9 @@ dmmeta.fconst fconst:algo.Bool.value/no value:0 comment:"" dmmeta.fconst fconst:algo.Bool.value/yes value:1 comment:"" dmmeta.fconst fconst:algo.EchoQ.value/true value:1 comment:"" dmmeta.fconst fconst:algo.EchoQ.value/false value:0 comment:"" -dmmeta.fconst fconst:algo.Errns.value/unix value:0 comment:"" -dmmeta.fconst fconst:algo.Errns.value/win value:1 comment:"" +dmmeta.fconst fconst:algo.Errns.value/unix value:0 comment:"Unix error code (use strerror)" +dmmeta.fconst fconst:algo.Errns.value/win value:1 comment:"Windows error code" +dmmeta.fconst fconst:algo.Errns.value/ssl value:2 comment:"SSL error code" dmmeta.fconst fconst:algo.FailokQ.value/true value:1 comment:"" dmmeta.fconst fconst:algo.FailokQ.value/false value:0 comment:"" dmmeta.fconst fconst:algo.Month.value/January value:1 comment:"" @@ -55,13 +56,26 @@ dmmeta.fconst fconst:algo.TermStyle.value/bold value:"1<<3" comment:"" dmmeta.fconst fconst:algo.TextJust.value/j_right value:1 comment:"" dmmeta.fconst fconst:algo.TextJust.value/j_left value:-1 comment:"" dmmeta.fconst fconst:algo.TextJust.value/j_center value:0 comment:"" +dmmeta.fconst fconst:algo.TextJust.value/j_auto value:2 comment:"" +dmmeta.fconst fconst:algo_lib.RegxOp.op/charrange value:0 comment:"Always evaluates to true" +dmmeta.fconst fconst:algo_lib.RegxOp.op/char value:1 comment:"Compare 1 character" +dmmeta.fconst fconst:algo_lib.RegxOp.op/true value:2 comment:"Test against a character range" +dmmeta.fconst fconst:algo_lib.RegxOp.op/stringbeg value:3 comment:"True at left edge of the string" +dmmeta.fconst fconst:algo_lib.RegxOp.op/lparen value:4 comment:"True; Captures start of group. Imm=group #" +dmmeta.fconst fconst:algo_lib.RegxOp.op/rparen value:5 comment:"True; Captures end of group. Imm=group #" +dmmeta.fconst fconst:algo_lib.RegxOp.op/stringend value:6 comment:"True at right edge of the string" +dmmeta.fconst fconst:algo_lib.RegxOp.op/accept value:7 comment:"True at the end of string" +dmmeta.fconst fconst:algo_lib.RegxOp.op/noop value:8 comment:False +dmmeta.fconst fconst:algo_lib.RegxStyle.value/default value:0 comment:"" +dmmeta.fconst fconst:algo_lib.RegxStyle.value/sql value:1 comment:"" +dmmeta.fconst fconst:algo_lib.RegxStyle.value/acr value:2 comment:"" +dmmeta.fconst fconst:algo_lib.RegxStyle.value/shell value:3 comment:"" +dmmeta.fconst fconst:algo_lib.RegxStyle.value/literal value:4 comment:"" dmmeta.fconst fconst:algo_lib.RegxToken.type/expr value:0 comment:"" +dmmeta.fconst fconst:algo_lib.RegxToken.type/start value:4 comment:"" dmmeta.fconst fconst:algo_lib.RegxToken.type/or value:1 comment:"" dmmeta.fconst fconst:algo_lib.RegxToken.type/lparen value:2 comment:"" -dmmeta.fconst fconst:ams.Member.mode/r value:0 comment:"" -dmmeta.fconst fconst:ams.Member.mode/w value:1 comment:"" -dmmeta.fconst fconst:ams.SeqmsgTrace.mode/r value:0 comment:"" -dmmeta.fconst fconst:ams.SeqmsgTrace.mode/w value:1 comment:"" +dmmeta.fconst fconst:algo_lib.RegxToken.type/rparen value:3 comment:"" dmmeta.fconst fconst:atf.Testresult.value/UNTESTED value:0 comment:"Test has not been run" dmmeta.fconst fconst:atf.Testresult.value/UNTESTED_PREPERROR value:4 comment:"Test has not been run, error in definition" dmmeta.fconst fconst:atf.Testresult.value/UNRESOLVED value:1 comment:"Test has been run, verdict unresolved" @@ -93,10 +107,9 @@ dmmeta.fconst fconst:command.abt.cache/ccache value:4 comment:"Select ccache dmmeta.fconst fconst:command.atf_cmdline.fconst/high value:0 comment:Cool dmmeta.fconst fconst:command.atf_cmdline.fconst/medium value:1 comment:So-so dmmeta.fconst fconst:command.atf_cmdline.fconst/low value:2 comment:Bad -dmmeta.fconst fconst:command.samp_regx.style/acr value:0 comment:"ACR-style regx" -dmmeta.fconst fconst:command.samp_regx.style/shell value:1 comment:"Shell-style regx" -dmmeta.fconst fconst:command.samp_regx.style/classic value:2 comment:"Classic regx" -dmmeta.fconst fconst:command.samp_regx.style/literal value:3 comment:"Literal string" +dmmeta.fconst fconst:command.jkv.output/auto value:0 comment:Automatic +dmmeta.fconst fconst:command.jkv.output/json value:1 comment:"Json only" +dmmeta.fconst fconst:command.jkv.output/kv value:2 comment:"Key-value only" dmmeta.fconst fconst:command.ssimfilt.format/ssim value:0 comment:"Print selected/filtered tuples" dmmeta.fconst fconst:command.ssimfilt.format/csv value:1 comment:"First tuple determines header. CSV quoting is used. Newlines are removed" dmmeta.fconst fconst:command.ssimfilt.format/field value:2 comment:"Print selected fields, one per line" @@ -125,6 +138,76 @@ dmmeta.fconst fconst:gcli.FHttp.request_method/POST value:1 comment:POST dmmeta.fconst fconst:gcli.FHttp.request_method/PUT value:2 comment:PUT dmmeta.fconst fconst:gcli.FHttp.request_method/PATCH value:3 comment:PATCH dmmeta.fconst fconst:gcli.FHttp.request_method/DELETE value:4 comment:DELETE +dmmeta.fconst fconst:http.Method.value/extension_method value:255 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/UNKNOWN value:0 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/ANY value:1 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/ALL value:2 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/READ value:3 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/WRITE value:4 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/CREATE value:5 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/DELETE value:6 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/ALTER value:7 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/DESCRIBE value:8 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/CLUSTER_ACTION value:9 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/DESCRIBE_CONFIGS value:10 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/ALTER_CONFIGS value:11 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/IDEMPOTENT_WRITE value:12 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/CREATE_TOKENS value:13 comment:"" +dmmeta.fconst fconst:kafka.AclOperationType.value/DESCRIBE_TOKENS value:14 comment:"" +dmmeta.fconst fconst:kafka.AclPermissionType.value/UNKNOWN value:0 comment:"" +dmmeta.fconst fconst:kafka.AclPermissionType.value/ANY value:1 comment:"" +dmmeta.fconst fconst:kafka.AclPermissionType.value/DENY value:2 comment:"" +dmmeta.fconst fconst:kafka.AclPermissionType.value/ALLOW value:3 comment:"" +dmmeta.fconst fconst:kafka.CompressionType.value/no_compression value:0 comment:"" +dmmeta.fconst fconst:kafka.CompressionType.value/gzip value:1 comment:"" +dmmeta.fconst fconst:kafka.CompressionType.value/snappy value:2 comment:"" +dmmeta.fconst fconst:kafka.CompressionType.value/lz4 value:3 comment:"" +dmmeta.fconst fconst:kafka.CompressionType.value/zstd value:4 comment:"" +dmmeta.fconst fconst:kafka.ConfigSource.value/UNKNOWN value:0 comment:"" +dmmeta.fconst fconst:kafka.ConfigSource.value/TOPIC_CONFIG value:1 comment:"" +dmmeta.fconst fconst:kafka.ConfigSource.value/DYNAMIC_BROKER_CONFIG value:2 comment:"" +dmmeta.fconst fconst:kafka.ConfigSource.value/DYNAMIC_DEFAULT_BROKER_CONFIG value:3 comment:"" +dmmeta.fconst fconst:kafka.ConfigSource.value/STATIC_BROKER_CONFIG value:4 comment:"" +dmmeta.fconst fconst:kafka.ConfigSource.value/DEFAULT_CONFIG value:5 comment:"" +dmmeta.fconst fconst:kafka.ConfigSource.value/DYNAMIC_BROKER_LOGGER_CONFIG value:6 comment:"" +dmmeta.fconst fconst:kafka.ConfigSource.value/CLIENT_METRICS_CONFIG value:7 comment:"" +dmmeta.fconst fconst:kafka.ConfigSource.value/GROUP_CONFIG value:8 comment:"" +dmmeta.fconst fconst:kafka.ConfigType.value/UNKNOWN value:0 comment:"" +dmmeta.fconst fconst:kafka.ConfigType.value/BOOLEAN value:1 comment:"" +dmmeta.fconst fconst:kafka.ConfigType.value/STRING value:2 comment:"" +dmmeta.fconst fconst:kafka.ConfigType.value/INT value:3 comment:"" +dmmeta.fconst fconst:kafka.ConfigType.value/SHORT value:4 comment:"" +dmmeta.fconst fconst:kafka.ConfigType.value/LONG value:5 comment:"" +dmmeta.fconst fconst:kafka.ConfigType.value/DOUBLE value:6 comment:"" +dmmeta.fconst fconst:kafka.ConfigType.value/LIST value:7 comment:"" +dmmeta.fconst fconst:kafka.ConfigType.value/CLASS value:8 comment:"" +dmmeta.fconst fconst:kafka.ConfigType.value/PASSWORD value:9 comment:"" +dmmeta.fconst fconst:kafka.GroupState.value/Unknown value:0 comment:"" +dmmeta.fconst fconst:kafka.GroupState.value/PreparingRebalance value:1 comment:"" +dmmeta.fconst fconst:kafka.GroupState.value/CompletingRebalance value:2 comment:"" +dmmeta.fconst fconst:kafka.GroupState.value/Stable value:3 comment:"" +dmmeta.fconst fconst:kafka.GroupState.value/Dead value:4 comment:"" +dmmeta.fconst fconst:kafka.GroupState.value/Empty value:5 comment:"" +dmmeta.fconst fconst:kafka.GroupState.value/Assigning value:6 comment:"" +dmmeta.fconst fconst:kafka.GroupState.value/Reconciling value:7 comment:"" +dmmeta.fconst fconst:kafka.GroupState.value/NotReady value:8 comment:"" +dmmeta.fconst fconst:kafka.PatternType.value/UNKNOWN value:0 comment:"Client is too old" +dmmeta.fconst fconst:kafka.PatternType.value/ANY value:1 comment:"In a filter, matches any resource pattern type" +dmmeta.fconst fconst:kafka.PatternType.value/MATCH value:2 comment:"In a filter, pattern matching" +dmmeta.fconst fconst:kafka.PatternType.value/LITERAL value:3 comment:"Literal resource name, or * for any" +dmmeta.fconst fconst:kafka.PatternType.value/PREFIXED value:4 comment:"Prefix for a resource" +dmmeta.fconst fconst:kafka.ResourceType.value/UNKNOWN value:0 comment:"" +dmmeta.fconst fconst:kafka.ResourceType.value/ANY value:1 comment:"" +dmmeta.fconst fconst:kafka.ResourceType.value/TOPIC value:2 comment:"" +dmmeta.fconst fconst:kafka.ResourceType.value/GROUP value:3 comment:"" +dmmeta.fconst fconst:kafka.ResourceType.value/CLUSTER value:4 comment:"" +dmmeta.fconst fconst:kafka.ResourceType.value/TRANSACTIONAL_ID value:5 comment:"" +dmmeta.fconst fconst:kafka.ResourceType.value/DELEGATION_TOKEN value:6 comment:"" +dmmeta.fconst fconst:kafka.ResourceType.value/USER value:7 comment:"" +dmmeta.fconst fconst:kafka.TimestampType.value/create_time value:0 comment:"" +dmmeta.fconst fconst:kafka.TimestampType.value/log_append_time value:1 comment:"" +dmmeta.fconst fconst:lib_ams.MsgFmt.format/ssim value:0 comment:"Each output message is an ssim tuple" +dmmeta.fconst fconst:lib_ams.MsgFmt.format/bin value:1 comment:"Each output message is bin" dmmeta.fconst fconst:lib_json.FNode.type/null value:0 comment:"" dmmeta.fconst fconst:lib_json.FNode.type/false value:1 comment:"" dmmeta.fconst fconst:lib_json.FNode.type/true value:2 comment:"" @@ -144,3 +227,16 @@ dmmeta.fconst fconst:lib_json.FParser.state/str_usurr2 value:7 comment:"" dmmeta.fconst fconst:lib_json.FParser.state/token value:8 comment:"" dmmeta.fconst fconst:lib_json.FParser.state/sec_line value:9 comment:"JSON security line" dmmeta.fconst fconst:lib_json.FParser.state/err value:99 comment:"parser error" +dmmeta.fconst fconst:ws.HttpState.value/INIT value:0 comment:"created connection, waiting request-line" +dmmeta.fconst fconst:ws.HttpState.value/REQLINE value:1 comment:"request-line received, waiting first header" +dmmeta.fconst fconst:ws.HttpState.value/HEADER value:2 comment:"waiting next header" +dmmeta.fconst fconst:ws.HttpState.value/BODY value:3 comment:"headers received, waiting body" +dmmeta.fconst fconst:ws.HttpState.value/FIN value:4 comment:"connection closed, to be deleted" +dmmeta.fconst fconst:ws.Opcode.value/cont value:0 comment:"continuation frame" +dmmeta.fconst fconst:ws.Opcode.value/text value:1 comment:"text frame" +dmmeta.fconst fconst:ws.Opcode.value/binary value:2 comment:"binary frame" +dmmeta.fconst fconst:ws.Opcode.value/close value:8 comment:"connection close" +dmmeta.fconst fconst:ws.Opcode.value/ping value:9 comment:ping +dmmeta.fconst fconst:ws.Opcode.value/pong value:10 comment:pong +dmmeta.fconst fconst:ws.Side.value/server value:0 comment:"" +dmmeta.fconst fconst:ws.Side.value/client value:1 comment:"" diff --git a/data/dmmeta/fcurs.ssim b/data/dmmeta/fcurs.ssim index b1e673e0..1c4b521f 100644 --- a/data/dmmeta/fcurs.ssim +++ b/data/dmmeta/fcurs.ssim @@ -1,9 +1,16 @@ dmmeta.fcurs fcurs:abt_md.FDb.ind_human_text/curs comment:"" dmmeta.fcurs fcurs:acr.FCtype.ind_ctype_rec/curs comment:"" dmmeta.fcurs fcurs:acr.FDb.zd_all_selrec/delcurs comment:"" +dmmeta.fcurs fcurs:algo_lib.Bitset.ary/bitcurs comment:"" dmmeta.fcurs fcurs:algo_lib.Replscope.ind_replvar/curs comment:"" dmmeta.fcurs fcurs:apm.FDb.zd_chooserec/delcurs comment:"" +dmmeta.fcurs fcurs:atf_amc.Bitset.fld1/bitcurs comment:"" +dmmeta.fcurs fcurs:atf_amc.Bitset.fld128/bitcurs comment:"" +dmmeta.fcurs fcurs:atf_amc.Bitset.fld64/bitcurs comment:"" +dmmeta.fcurs fcurs:atf_amc.Bitset.fld8/bitcurs comment:"" dmmeta.fcurs fcurs:atf_amc.FDb.c_typek/oncecurs comment:"" dmmeta.fcurs fcurs:atf_amc.FDb.cd_typed/delcurs comment:"" +dmmeta.fcurs fcurs:atf_amc.FDb.ind_linear/curs comment:"" dmmeta.fcurs fcurs:atf_amc.FDb.zd_typed/delcurs comment:"" dmmeta.fcurs fcurs:atf_amc.FDb.zs_t_typed/delcurs comment:"" +dmmeta.fcurs fcurs:lib_ams.FDb.ind_shmember/curs comment:"" diff --git a/data/dmmeta/fdelay.ssim b/data/dmmeta/fdelay.ssim index 1ac4ccab..1f669049 100644 --- a/data/dmmeta/fdelay.ssim +++ b/data/dmmeta/fdelay.ssim @@ -1,2 +1,4 @@ -dmmeta.fdelay fstep:lib_ams.FDb.cd_stream_hb delay:1.000000000 scale:Y comment:"" +dmmeta.fdelay fstep:atf_exp.FDb.ind_proc_pid delay:60.000000000 scale:N comment:"" +dmmeta.fdelay fstep:lib_ams.FDb.cd_hb delay:1.000000000 scale:Y comment:"" +dmmeta.fdelay fstep:lib_ams.FDb.cd_slow_poll_read delay:0.000500000 scale:N comment:"" dmmeta.fdelay fstep:lib_ams.FDb.zd_flush delay:0.100000000 scale:Y comment:"" diff --git a/data/dmmeta/field.ssim b/data/dmmeta/field.ssim index 82641a9f..6ce7b3e1 100644 --- a/data/dmmeta/field.ssim +++ b/data/dmmeta/field.ssim @@ -128,12 +128,12 @@ dmmeta.field field:abt_md.FCtype.p_ns arg:abt_md.FNs reftype:Upptr dflt:"" dmmeta.field field:abt_md.FCtype.c_field_arg arg:abt_md.FField reftype:Ptrary dflt:"" comment:"" dmmeta.field field:abt_md.FDb._db arg:abt_md.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:abt_md.FDb.cmdline arg:command.abt_md reftype:Val dflt:"" comment:"" -dmmeta.field field:abt_md.FDb.readme arg:abt_md.FReadme reftype:Lary dflt:"" comment:"" -dmmeta.field field:abt_md.FDb.ind_readme arg:abt_md.FReadme reftype:Thash dflt:"" comment:"" +dmmeta.field field:abt_md.FDb.readmefile arg:abt_md.FReadmefile reftype:Lary dflt:"" comment:"" +dmmeta.field field:abt_md.FDb.ind_readmefile arg:abt_md.FReadmefile reftype:Thash dflt:"" comment:"" dmmeta.field field:abt_md.FDb.mdsection arg:abt_md.FMdsection reftype:Inlary dflt:"" comment:"" dmmeta.field field:abt_md.FDb.file_section arg:abt_md.FFileSection reftype:Lary dflt:"" comment:"" dmmeta.field field:abt_md.FDb.bh_file_section arg:abt_md.FFileSection reftype:Bheap dflt:"" comment:"" -dmmeta.field field:abt_md.FDb.c_readme arg:abt_md.FReadme reftype:Ptr dflt:"" comment:"" +dmmeta.field field:abt_md.FDb.c_readmefile arg:abt_md.FReadmefile reftype:Ptr dflt:"" comment:"" dmmeta.field field:abt_md.FDb.ns arg:abt_md.FNs reftype:Lary dflt:"" comment:"" dmmeta.field field:abt_md.FDb.ind_ns arg:abt_md.FNs reftype:Thash dflt:"" comment:"" dmmeta.field field:abt_md.FDb.R arg:algo_lib.Replscope reftype:Val dflt:"" comment:"" @@ -167,6 +167,11 @@ dmmeta.field field:abt_md.FDb.ind_gstatic arg:abt_md.FGstatic reftype:Thash dmmeta.field field:abt_md.FDb.target arg:abt_md.FTarget reftype:Lary dflt:"" comment:"" dmmeta.field field:abt_md.FDb.targdep arg:abt_md.FTargdep reftype:Lary dflt:"" comment:"" dmmeta.field field:abt_md.FDb.ind_target arg:abt_md.FTarget reftype:Thash dflt:"" comment:"" +dmmeta.field field:abt_md.FDb.finput arg:abt_md.FFinput reftype:Lary dflt:"" comment:"" +dmmeta.field field:abt_md.FDb.zd_scanns arg:abt_md.FNs reftype:Llist dflt:"" comment:"" +dmmeta.field field:abt_md.FDb.dispatch arg:abt_md.FDispatch reftype:Lary dflt:"" comment:"" +dmmeta.field field:abt_md.FDb.ind_dispatch arg:abt_md.FDispatch reftype:Thash dflt:"" comment:"" +dmmeta.field field:abt_md.FDb.dispatch_msg arg:abt_md.FDispatchMsg reftype:Lary dflt:"" comment:"" dmmeta.field field:abt_md.FDirent.is_dir arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:abt_md.FDirent.p_dirscan arg:abt_md.FDirscan reftype:Upptr dflt:"" comment:"" dmmeta.field field:abt_md.FDirent.filename arg:algo.cstring reftype:Val dflt:"" comment:"" @@ -174,6 +179,10 @@ dmmeta.field field:abt_md.FDirent.sortfld arg:algo.cstring reftype:Val dflt: dmmeta.field field:abt_md.FDirent.pathname arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:abt_md.FDirscan.bh_dirent arg:abt_md.FDirent reftype:Bheap dflt:"" comment:"" dmmeta.field field:abt_md.FDirscan.dirent arg:abt_md.FDirent reftype:Lary dflt:"" comment:"" +dmmeta.field field:abt_md.FDispatch.base arg:dmmeta.Dispatch reftype:Base dflt:"" comment:"" +dmmeta.field field:abt_md.FDispatch.c_dispatch_msg arg:abt_md.FDispatchMsg reftype:Ptrary dflt:"" comment:"" +dmmeta.field field:abt_md.FDispatchMsg.base arg:dmmeta.DispatchMsg reftype:Base dflt:"" comment:"" +dmmeta.field field:abt_md.FDispatchMsg.p_ctype arg:abt_md.FCtype reftype:Upptr dflt:"" comment:"" dmmeta.field field:abt_md.FFconst.base arg:dmmeta.Fconst reftype:Base dflt:"" comment:"" dmmeta.field field:abt_md.FField.base arg:dmmeta.Field reftype:Base dflt:"" comment:"" dmmeta.field field:abt_md.FField.text arg:algo.cstring reftype:Val dflt:"" comment:"" @@ -189,6 +198,8 @@ dmmeta.field field:abt_md.FFileSection.sortkey arg:i32 reftype:Val dflt:"" dmmeta.field field:abt_md.FFileSection.select arg:bool reftype:Val dflt:true comment:"Selected for processing" dmmeta.field field:abt_md.FFileSection.firstline arg:i32 reftype:Val dflt:"" comment:"Line in file where section starts" dmmeta.field field:abt_md.FFileSection.p_mdsection arg:abt_md.FMdsection reftype:Upptr dflt:"" comment:"" +dmmeta.field field:abt_md.FFinput.base arg:dmmeta.Finput reftype:Base dflt:"" comment:"" +dmmeta.field field:abt_md.FFinput.p_field arg:abt_md.FField reftype:Upptr dflt:"" comment:"" dmmeta.field field:abt_md.FGconst.base arg:dmmeta.Gconst reftype:Base dflt:"" comment:"" dmmeta.field field:abt_md.FGstatic.base arg:dmmeta.Gstatic reftype:Base dflt:"" comment:"" dmmeta.field field:abt_md.FHumanText.key arg:algo.cstring reftype:Val dflt:"" comment:"" @@ -204,18 +215,20 @@ dmmeta.field field:abt_md.FMdsection.regx_path arg:algo.cstring reftype:RegxS dmmeta.field field:abt_md.FMdsection.rowid arg:i32 reftype:Val dflt:"" comment:"" dmmeta.field field:abt_md.FMdsection.zd_file_section arg:abt_md.FFileSection reftype:Llist dflt:"" comment:"" dmmeta.field field:abt_md.FNs.base arg:dmmeta.Ns reftype:Base dflt:"" comment:"" -dmmeta.field field:abt_md.FNs.c_readme arg:abt_md.FReadme reftype:Ptr dflt:"" comment:"" +dmmeta.field field:abt_md.FNs.c_readmefile arg:abt_md.FReadmefile reftype:Ptr dflt:"" comment:"" dmmeta.field field:abt_md.FNs.c_targsrc arg:abt_md.FTargsrc reftype:Ptrary dflt:"" comment:"" dmmeta.field field:abt_md.FNs.c_ctype arg:abt_md.FCtype reftype:Ptrary dflt:"" comment:"" dmmeta.field field:abt_md.FNs.c_comptest arg:abt_md.FComptest reftype:Ptrary dflt:"" comment:"" dmmeta.field field:abt_md.FNs.c_target arg:abt_md.FTarget reftype:Ptr dflt:"" comment:"" +dmmeta.field field:abt_md.FNs.zd_finput arg:abt_md.FFinput reftype:Llist dflt:"" comment:"" +dmmeta.field field:abt_md.FNs.c_dispatch arg:abt_md.FDispatch reftype:Ptrary dflt:"" comment:"" dmmeta.field field:abt_md.FNstype.base arg:dmmeta.Nstype reftype:Base dflt:"" comment:"" -dmmeta.field field:abt_md.FReadme.base arg:dev.Readme reftype:Base dflt:"" comment:"" -dmmeta.field field:abt_md.FReadme.p_ns arg:abt_md.FNs reftype:Upptr dflt:"" comment:"Optional Associated namespace" -dmmeta.field field:abt_md.FReadme.p_ssimfile arg:abt_md.FSsimfile reftype:Upptr dflt:"" comment:"Optional Associated ssimfile" -dmmeta.field field:abt_md.FReadme.p_ctype arg:abt_md.FCtype reftype:Upptr dflt:"" comment:"Optional Associated ctype" -dmmeta.field field:abt_md.FReadme.p_scriptfile arg:abt_md.FScriptfile reftype:Upptr dflt:"" comment:"Optional Associated scriptfile" -dmmeta.field field:abt_md.FReadme.select arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:abt_md.FReadmefile.base arg:dev.Readmefile reftype:Base dflt:"" comment:"" +dmmeta.field field:abt_md.FReadmefile.p_ns arg:abt_md.FNs reftype:Upptr dflt:"" comment:"Optional Associated namespace" +dmmeta.field field:abt_md.FReadmefile.p_ssimfile arg:abt_md.FSsimfile reftype:Upptr dflt:"" comment:"Optional Associated ssimfile" +dmmeta.field field:abt_md.FReadmefile.p_ctype arg:abt_md.FCtype reftype:Upptr dflt:"" comment:"Optional Associated ctype" +dmmeta.field field:abt_md.FReadmefile.p_scriptfile arg:abt_md.FScriptfile reftype:Upptr dflt:"" comment:"Optional Associated scriptfile" +dmmeta.field field:abt_md.FReadmefile.select arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:abt_md.FReadmesort.base arg:dev.Readmesort reftype:Base dflt:"" comment:"" dmmeta.field field:abt_md.FReadmesort.sortfld arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:abt_md.FReftype.base arg:dmmeta.Reftype reftype:Base dflt:"" comment:"" @@ -253,9 +266,9 @@ dmmeta.field field:acr.FCtype.base arg:dmmeta.Ctype reftype:Base dflt:"" co dmmeta.field field:acr.FCtype.c_field arg:acr.FField reftype:Ptrary dflt:"" comment:"" dmmeta.field field:acr.FCtype.c_cdflt arg:acr.FCdflt reftype:Ptr dflt:"" comment:"" dmmeta.field field:acr.FCtype.c_ssimfile arg:acr.FSsimfile reftype:Ptr dflt:"" comment:"" -dmmeta.field field:acr.FCtype.zd_ctype_rec arg:acr.FRec reftype:Llist dflt:"" comment:"List of all records with this ctype" +dmmeta.field field:acr.FCtype.zd_rec arg:acr.FRec reftype:Llist dflt:"" comment:"List of all records with this ctype" dmmeta.field field:acr.FCtype.ind_ctype_rec arg:acr.FRec reftype:Thash dflt:"" comment:"Index of records by primary key" -dmmeta.field field:acr.FCtype.zd_ctype_selrec arg:acr.FRec reftype:Llist dflt:"" comment:"List of selected records" +dmmeta.field field:acr.FCtype.zd_selrec arg:acr.FRec reftype:Llist dflt:"" comment:"List of selected records" dmmeta.field field:acr.FCtype.n_insert arg:i32 reftype:Val dflt:0 comment:"Number of tuples inserted" dmmeta.field field:acr.FCtype.rank arg:i32 reftype:Val dflt:false comment:"Topological sort rank" dmmeta.field field:acr.FCtype.c_child arg:acr.FCtype reftype:Ptrary dflt:"" comment:"all tables that reference this table" @@ -387,6 +400,7 @@ dmmeta.field field:acr.FQuery.n_visit_ctype arg:i32 reftype:Val dflt:"" com dmmeta.field field:acr.FQuery.n_mod_rec arg:i32 reftype:Val dflt:"" comment:"Number of records modified" dmmeta.field field:acr.FRec.pkey arg:algo.cstring reftype:Val dflt:"" comment:"Record key (arbitrary string)" dmmeta.field field:acr.FRec.oldpkey arg:algo.cstring reftype:Delptr dflt:"" comment:"Old pkey (if renamed)" +dmmeta.field field:acr.FRec.oldhead arg:algo.cstring reftype:Delptr dflt:"" comment:"Old tuple head (if renamed)" dmmeta.field field:acr.FRec.tuple arg:algo.Tuple reftype:Val dflt:"" comment:"Data item" dmmeta.field field:acr.FRec.del arg:bool reftype:Val dflt:false comment:"Delete?" dmmeta.field field:acr.FRec.mod arg:bool reftype:Val dflt:false comment:"Record was modified?" @@ -563,6 +577,7 @@ dmmeta.field field:acr_ed.FDb.could_be_ptr arg:bool reftype:Val dflt:"" com dmmeta.field field:acr_ed.FDb.edaction arg:acr_ed.FEdaction reftype:Inlary dflt:"" comment:"" dmmeta.field field:acr_ed.FDb.ind_edaction arg:acr_ed.FEdaction reftype:Thash dflt:"" comment:"" dmmeta.field field:acr_ed.FDb.gitfile arg:acr_ed.FGitfile reftype:Lary dflt:"" comment:"" +dmmeta.field field:acr_ed.FDb.msgtype arg:acr_ed.FMsgtype reftype:Lary dflt:"" comment:"" dmmeta.field field:acr_ed.FEdaction.base arg:dev.Edaction reftype:Base dflt:"" comment:"" dmmeta.field field:acr_ed.FEdaction.step arg:"" reftype:Hook dflt:"" comment:"" dmmeta.field field:acr_ed.FEdaction.select arg:bool reftype:Val dflt:"" comment:"" @@ -573,6 +588,7 @@ dmmeta.field field:acr_ed.FField.p_ns arg:acr_ed.FNs reftype:Upptr dflt:"" dmmeta.field field:acr_ed.FFprefix.base arg:dmmeta.Fprefix reftype:Base dflt:"" comment:"" dmmeta.field field:acr_ed.FGitfile.base arg:dev.Gitfile reftype:Base dflt:"" comment:"" dmmeta.field field:acr_ed.FListtype.msghdr arg:dmmeta.Listtype reftype:Base dflt:"" comment:"" +dmmeta.field field:acr_ed.FMsgtype.base arg:dmmeta.Msgtype reftype:Base dflt:"" comment:"" dmmeta.field field:acr_ed.FNs.msghdr arg:dmmeta.Ns reftype:Base dflt:"" comment:"" dmmeta.field field:acr_ed.FNsdb.base arg:dmmeta.Nsdb reftype:Base dflt:"" comment:"" dmmeta.field field:acr_ed.FPack.base arg:dmmeta.Pack reftype:Base dflt:"" comment:"" @@ -719,6 +735,7 @@ dmmeta.field field:algo.I32Dec2.value arg:i32 reftype:Val dflt:"" comment:" dmmeta.field field:algo.I32Dec3.value arg:i32 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.I32Dec4.value arg:i32 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.I32Dec5.value arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:algo.I32RangeAry.ary arg:algo.i32_Range reftype:Tary dflt:"" comment:"" dmmeta.field field:algo.I64Dec1.value arg:i64 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.I64Dec10.value arg:i64 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.I64Dec2.value arg:i64 reftype:Val dflt:"" comment:"" @@ -729,6 +746,8 @@ dmmeta.field field:algo.I64Dec6.value arg:i64 reftype:Val dflt:"" comment:" dmmeta.field field:algo.I64Dec7.value arg:i64 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.I64Dec8.value arg:i64 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.I64Dec9.value arg:i64 reftype:Val dflt:"" comment:"" +dmmeta.field field:algo.I64Rate.last arg:i64 reftype:Val dflt:"" comment:"Last value" +dmmeta.field field:algo.I64Rate.delta arg:i64 reftype:Val dflt:"" comment:"Delta of last value" dmmeta.field field:algo.IOEvtFlags.value arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.IOEvtFlags.read arg:bool reftype:Bitfld dflt:"" comment:"" dmmeta.field field:algo.IOEvtFlags.write arg:bool reftype:Bitfld dflt:"" comment:"" @@ -890,8 +909,10 @@ dmmeta.field field:algo.Smallstr16.ch arg:char reftype:Smallstr dflt:"" com dmmeta.field field:algo.Smallstr2.ch arg:char reftype:Smallstr dflt:"" comment:"" dmmeta.field field:algo.Smallstr20.ch arg:char reftype:Smallstr dflt:"" comment:"" dmmeta.field field:algo.Smallstr200.ch arg:char reftype:Smallstr dflt:"" comment:"" +dmmeta.field field:algo.Smallstr249.ch arg:char reftype:Smallstr dflt:"" comment:"" dmmeta.field field:algo.Smallstr25.ch arg:char reftype:Smallstr dflt:"" comment:"" dmmeta.field field:algo.Smallstr250.ch arg:char reftype:Smallstr dflt:"" comment:"" +dmmeta.field field:algo.Smallstr255.ch arg:char reftype:Smallstr dflt:"" comment:"" dmmeta.field field:algo.Smallstr3.ch arg:char reftype:Smallstr dflt:"" comment:"" dmmeta.field field:algo.Smallstr30.ch arg:char reftype:Smallstr dflt:"" comment:"" dmmeta.field field:algo.Smallstr32.ch arg:char reftype:Smallstr dflt:"" comment:"" @@ -914,12 +935,15 @@ dmmeta.field field:algo.TstampCache.cacheable arg:bool reftype:Val dflt:"" dmmeta.field field:algo.TstampCache.gmtQ arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:algo.Tuple.attrs arg:algo.Attr reftype:Tary dflt:"" comment:"Array of attributes" dmmeta.field field:algo.Tuple.head arg:algo.Attr reftype:Val dflt:"" comment:"Type tag" +dmmeta.field field:algo.U16Ary.ary arg:u16 reftype:Tary dflt:"" comment:"Array of u16 values" dmmeta.field field:algo.U16Dec2.value arg:u16 reftype:Val dflt:"" comment:"" +dmmeta.field field:algo.U32Ary.ary arg:u32 reftype:Tary dflt:"" comment:"Array of u16 values" dmmeta.field field:algo.U32Dec1.value arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.U32Dec2.value arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.U32Dec3.value arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.U32Dec4.value arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.U32Dec5.value arg:u32 reftype:Val dflt:"" comment:"" +dmmeta.field field:algo.U32LinearKey.value arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.U64Ary.ary arg:u64 reftype:Tary dflt:"" comment:"Array of u64 values" dmmeta.field field:algo.U64Dec10.value arg:u64 reftype:Val dflt:"" comment:"" dmmeta.field field:algo.U64Dec2.value arg:u64 reftype:Val dflt:"" comment:"" @@ -968,22 +992,21 @@ dmmeta.field field:algo_lib.FDb.cstring arg:algo.cstring reftype:Cppstack df dmmeta.field field:algo_lib.FDb.sbrk arg:u8 reftype:Sbrk dflt:"" comment:"Base allocator for everything" dmmeta.field field:algo_lib.FDb.lpool arg:u8 reftype:Lpool dflt:"" comment:"private memory pool" dmmeta.field field:algo_lib.FDb.next_loop arg:algo.SchedTime reftype:Val dflt:"" comment:"" -dmmeta.field field:algo_lib.FDb.limit arg:algo.SchedTime reftype:Val dflt:0x7fffffffffffffff comment:"" +dmmeta.field field:algo_lib.FDb.limit arg:algo.SchedTime reftype:Val dflt:0x7fffffffffffffff comment:"Main loop clock limit" dmmeta.field field:algo_lib.FDb.clocks_to_ms arg:double reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.n_iohook arg:u32 reftype:Val dflt:0 comment:"Number of iohooks in epoll" -dmmeta.field field:algo_lib.FDb.clock arg:algo.SchedTime reftype:Val dflt:"" comment:"Current cpu clock value" -dmmeta.field field:algo_lib.FDb.mainloop_clock arg:algo.SchedTime reftype:Val dflt:"" comment:"Mainloop cpu clock value" +dmmeta.field field:algo_lib.FDb.clock arg:algo.SchedTime reftype:Val dflt:"" comment:"Most recent cpu clock value" +dmmeta.field field:algo_lib.FDb.step_limit arg:algo.SchedTime reftype:Val dflt:"" comment:"Execution limit for current step" dmmeta.field field:algo_lib.FDb.start_clock arg:algo.SchedTime reftype:Val dflt:"" comment:"cpu clock value at startup" dmmeta.field field:algo_lib.FDb.hz arg:double reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.t_last_signal arg:algo.SchedTime reftype:Val dflt:"" comment:"Time last async signal was processed" -dmmeta.field field:algo_lib.FDb.exit_code arg:i32 reftype:Val dflt:0 comment:"Exit code from main program. 0 = success (this is the unix exit code!)" +dmmeta.field field:algo_lib.FDb.exit_code arg:i32 reftype:Val dflt:0 comment:"Unix exit code from main program. 0 = success" dmmeta.field field:algo_lib.FDb.clocks_to_ns arg:double reftype:Val dflt:"" comment:"" -dmmeta.field field:algo_lib.FDb.n_temp arg:u32 reftype:Val dflt:0 comment:"* initialization order is important *" +dmmeta.field field:algo_lib.FDb.n_temp arg:u32 reftype:Val dflt:0 comment:"" dmmeta.field field:algo_lib.FDb.last_signal arg:u32 reftype:Val dflt:"" comment:"Value of last signal (used by SetupExitSignals)" -dmmeta.field field:algo_lib.FDb.eol arg:bool reftype:Val dflt:false comment:"" dmmeta.field field:algo_lib.FDb.cpu_hz arg:u64 reftype:Val dflt:"" comment:"Cpu HZ, determined at startup" dmmeta.field field:algo_lib.FDb.fildes arg:algo_lib.FFildes reftype:Cppstack dflt:"" comment:"Provides default name for variables of this type" -dmmeta.field field:algo_lib.FDb.temp_strings arg:algo.cstring reftype:Inlary dflt:"" comment:"* initialization order is important *" +dmmeta.field field:algo_lib.FDb.temp_strings arg:algo.cstring reftype:Inlary dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.ArgvIdent arg:algo.Charset reftype:Charset dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.BashQuotesafe arg:algo.Charset reftype:Charset dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.RegxSqlSpecial arg:algo.Charset reftype:Charset dflt:"" comment:"" @@ -1000,6 +1023,7 @@ dmmeta.field field:algo_lib.FDb.error arg:algo_lib.ErrorX reftype:Cppstack d dmmeta.field field:algo_lib.FDb.csvparse arg:algo_lib.CsvParse reftype:Cppstack dflt:"" comment:"Provides default name for variables of this type" dmmeta.field field:algo_lib.FDb.regxparse arg:algo_lib.RegxParse reftype:Cppstack dflt:"" comment:"Provides default name for variables of this type" dmmeta.field field:algo_lib.FDb.regx arg:algo_lib.Regx reftype:Cppstack dflt:"" comment:"Provides default name for variables of this type" +dmmeta.field field:algo_lib.FDb.regxm arg:algo_lib.RegxM reftype:Val dflt:"" comment:"Context for Regx matching" dmmeta.field field:algo_lib.FDb.tabulate arg:algo_lib.Tabulate reftype:Cppstack dflt:"" comment:"Provides default name for variables of this type" dmmeta.field field:algo_lib.FDb.log_str arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.bh_timehook arg:algo_lib.FTimehook reftype:Bheap dflt:"" comment:"Binary heap of time-based callbacks" @@ -1026,11 +1050,8 @@ dmmeta.field field:algo_lib.FDb.h_fatalerror arg:"" reftype:Hook dflt:"" co dmmeta.field field:algo_lib.FDb.giveup_count arg:u64 reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.fatalerr arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.stringtofile_nwrite arg:u32 reftype:Val dflt:"" comment:"Global counter of # of files written" -dmmeta.field field:algo_lib.FDb.giveup_time arg:bool reftype:Val dflt:true comment:"Trigger for giveup_time loop" -dmmeta.field field:algo_lib.FDb.sleep_roundup arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.last_sleep_clocks arg:u64 reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.msgtemp arg:algo.ByteAry reftype:Val dflt:"" comment:"" -dmmeta.field field:algo_lib.FDb.show_insert_err_lim arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.DigitChar arg:algo.Charset reftype:Charset dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.NewLineChar arg:algo.Charset reftype:Charset dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.WhiteChar arg:algo.Charset reftype:Charset dflt:"" comment:"" @@ -1049,14 +1070,19 @@ dmmeta.field field:algo_lib.FDb.winjob arg:u64 reftype:Val dflt:"" comment: dmmeta.field field:algo_lib.FDb.Prlog arg:algo.PrlogFcn reftype:Val dflt:algo::Prlog comment:"" dmmeta.field field:algo_lib.FDb.logcat arg:algo_lib.FLogcat reftype:Inlary dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.ind_logcat arg:algo_lib.FLogcat reftype:Thash dflt:"" comment:"" -dmmeta.field field:algo_lib.FDb.show_tstamp arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.tstamp_fmt arg:algo.cstring reftype:Val dflt:'"%Y/%m/%dT%H:%M:%S.%.6X "' comment:"" -dmmeta.field field:algo_lib.FDb.fildes_stdout arg:algo.Fildes reftype:Val dflt:1 comment:"" -dmmeta.field field:algo_lib.FDb.fildes_stderr arg:algo.Fildes reftype:Val dflt:2 comment:"" -dmmeta.field field:algo_lib.FDb.pending_eol arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.exec_args arg:algo.cstring reftype:Tary dflt:"" comment:"" dmmeta.field field:algo_lib.FDb.dirstack arg:algo.cstring reftype:Tary dflt:"" comment:"Directory stack for PushDir/PopDir" +dmmeta.field field:algo_lib.FDb.errns arg:algo_lib.FErrns reftype:Inlary dflt:"" comment:"Fixed table of errns decoders" +dmmeta.field field:algo_lib.FDb.tempdir arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:algo_lib.FDb.use_epoll_pwait2 arg:bool reftype:Val dflt:false comment:"Use epoll_pwait2 system call" +dmmeta.field field:algo_lib.FDb.pending_eol arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:algo_lib.FDb.giveup_time arg:bool reftype:Val dflt:true comment:"Trigger for giveup_time loop" +dmmeta.field field:algo_lib.FDb.show_tstamp arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FDispsigcheck.msghdr arg:dmmeta.Dispsigcheck reftype:Base dflt:"" comment:"" +dmmeta.field field:algo_lib.FErrns.errns arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:algo_lib.FErrns.decode arg:i32 reftype:Hook dflt:"" comment:"" +dmmeta.field field:algo_lib.FErrns.outstr arg:algo.cstring reftype:Val dflt:"" comment:"Output of decode operation" dmmeta.field field:algo_lib.FFildes.fd arg:algo.Fildes reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FImdb.msghdr arg:algo.Imdb reftype:Base dflt:"" comment:"" dmmeta.field field:algo_lib.FImtable.msghdr arg:algo.Imtable reftype:Base dflt:"" comment:"" @@ -1069,10 +1095,15 @@ dmmeta.field field:algo_lib.FIohook.nodelete arg:bool reftype:Val dflt:false dmmeta.field field:algo_lib.FLockfile.filename arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FLockfile.fildes arg:algo_lib.FFildes reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FLogcat.base arg:dmmeta.Logcat reftype:Base dflt:"" comment:"" +dmmeta.field field:algo_lib.FLogcat.filter arg:algo_lib.Regx reftype:Val dflt:"" comment:"Output filter" +dmmeta.field field:algo_lib.FLogcat.negfilter arg:algo_lib.Regx reftype:Val dflt:"" comment:"Negative output filter" +dmmeta.field field:algo_lib.FLogcat.nmsg arg:i64 reftype:Val dflt:"" comment:"Number of messages printed inside current window" +dmmeta.field field:algo_lib.FLogcat.th_throttle arg:algo_lib.FTimehook reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FReplvar.p_replscope arg:algo_lib.Replscope reftype:Upptr dflt:"" comment:Parent dmmeta.field field:algo_lib.FReplvar.key arg:algo.cstring reftype:Val dflt:"" comment:Key dmmeta.field field:algo_lib.FReplvar.value arg:algo.cstring reftype:Val dflt:"" comment:Value dmmeta.field field:algo_lib.FReplvar.nsubst arg:i32 reftype:Val dflt:"" comment:"Number of times variable accessed" +dmmeta.field field:algo_lib.FReplvar.partial arg:bool reftype:Val dflt:"" comment:"This is a partial match on another variable" dmmeta.field field:algo_lib.FTempfile.filename arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FTempfile.fildes arg:algo_lib.FFildes reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.FTimehook.time arg:algo.SchedTime reftype:Val dflt:"" comment:"Time the hook is scheduled to expire" @@ -1082,7 +1113,7 @@ dmmeta.field field:algo_lib.FTimehook.recurrent arg:bool reftype:Val dflt:"" dmmeta.field field:algo_lib.FTxtcell.p_txtrow arg:algo_lib.FTxtrow reftype:Upptr dflt:"" comment:"" dmmeta.field field:algo_lib.FTxtcell.justify arg:algo.TextJust reftype:Val dflt:algo_TextJust_j_left comment:"Justification of text within cell" dmmeta.field field:algo_lib.FTxtcell.style arg:algo.TermStyle reftype:Val dflt:"" comment:"Text style" -dmmeta.field field:algo_lib.FTxtcell.span arg:i32 reftype:Val dflt:1 comment:"Span in columns" +dmmeta.field field:algo_lib.FTxtcell.span arg:i32 reftype:Val dflt:1 comment:"Column span of this cell" dmmeta.field field:algo_lib.FTxtcell.width arg:i32 reftype:Val dflt:0 comment:"Width in chars" dmmeta.field field:algo_lib.FTxtcell.text arg:algo.cstring reftype:Val dflt:"" comment:"Cell contents" dmmeta.field field:algo_lib.FTxtcell.rsep arg:algo.cstring reftype:Val dflt:"" comment:"Right separator" @@ -1091,9 +1122,8 @@ dmmeta.field field:algo_lib.FTxtrow.select arg:bool reftype:Val dflt:true c dmmeta.field field:algo_lib.FTxtrow.ishdr arg:bool reftype:Val dflt:false comment:"Is header row" dmmeta.field field:algo_lib.FTxtrow.sortkey arg:algo.cstring reftype:Val dflt:"" comment:"Sort key" dmmeta.field field:algo_lib.FTxtrow.c_txtcell arg:algo_lib.FTxtcell reftype:Ptrary dflt:"" comment:"" -dmmeta.field field:algo_lib.FTxttbl.c_txtrow arg:algo_lib.FTxtrow reftype:Ptrary dflt:"" comment:"Array of cells" -dmmeta.field field:algo_lib.FTxttbl.col_space arg:i32 reftype:Val dflt:2 comment:"Extra space between columns" -dmmeta.field field:algo_lib.FTxttbl.hdr_row arg:i32 reftype:Val dflt:0 comment:"Index of header row (default -1)" +dmmeta.field field:algo_lib.FTxttbl.c_txtrow arg:algo_lib.FTxtrow reftype:Ptrary dflt:"" comment:"Array of rows" +dmmeta.field field:algo_lib.FTxttbl.col_space arg:i32 reftype:Val dflt:2 comment:"Default extra space between columns" dmmeta.field field:algo_lib.FTxttbl.normalized arg:bool reftype:Val dflt:"" comment:"Cell widths computed" dmmeta.field field:algo_lib.InTextFile.file arg:algo_lib.FFildes reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.InTextFile.own_fd arg:bool reftype:Val dflt:true comment:"" @@ -1103,27 +1133,39 @@ dmmeta.field field:algo_lib.Mmap.mem arg:algo.memptr reftype:Val dflt:"" co dmmeta.field field:algo_lib.MmapFile.map arg:algo_lib.Mmap reftype:Val dflt:"" comment:"Pointer to shared memory" dmmeta.field field:algo_lib.MmapFile.fd arg:algo_lib.FFildes reftype:Val dflt:"" comment:"Associated file descriptor" dmmeta.field field:algo_lib.MmapFile.text arg:algo.strptr reftype:Val dflt:"" comment:"Alias to map.mem, accessible as text" -dmmeta.field field:algo_lib.Regx.expr arg:algo.cstring reftype:Val dflt:"" comment:"Original string expression in some unspecified regx dialect" +dmmeta.field field:algo_lib.Regx.expr arg:algo.cstring reftype:Val dflt:"" comment:"Original string expression" dmmeta.field field:algo_lib.Regx.state arg:algo_lib.RegxState reftype:Tary dflt:"" comment:"Array of states" -dmmeta.field field:algo_lib.Regx.front arg:algo_lib.Bitset reftype:Val dflt:"" comment:"Temporary front (for matching)" -dmmeta.field field:algo_lib.Regx.next_front arg:algo_lib.Bitset reftype:Val dflt:"" comment:"Next front (for matching)" -dmmeta.field field:algo_lib.Regx.start arg:algo_lib.Bitset reftype:Val dflt:"" comment:"Set of starting states" -dmmeta.field field:algo_lib.Regx.accept arg:i32 reftype:Val dflt:"" comment:"Accept state" -dmmeta.field field:algo_lib.Regx.parseerror arg:bool reftype:Val dflt:"" comment:"Non-fatal error while parsing" -dmmeta.field field:algo_lib.Regx.accepts_all arg:bool reftype:Val dflt:"" comment:"True if this regx matches anything" -dmmeta.field field:algo_lib.Regx.literal arg:bool reftype:Val dflt:"" comment:"True if expr may be matched literally (set during translation)" +dmmeta.field field:algo_lib.Regx.flags arg:algo_lib.RegxFlags reftype:Val dflt:"" comment:"" +dmmeta.field field:algo_lib.Regx.style arg:algo_lib.RegxStyle reftype:Val dflt:"" comment:"Regx style according to which EXPR was parsed" dmmeta.field field:algo_lib.RegxExpr.type arg:algo_lib.RegxToken reftype:Val dflt:"" comment:"" -dmmeta.field field:algo_lib.RegxExpr.in arg:i32 reftype:Val dflt:"" comment:"Input state" -dmmeta.field field:algo_lib.RegxExpr.out arg:algo_lib.Bitset reftype:Val dflt:"" comment:"Output states" +dmmeta.field field:algo_lib.RegxExpr.first arg:i32 reftype:Val dflt:"" comment:"First character" +dmmeta.field field:algo_lib.RegxExpr.last arg:algo_lib.Bitset reftype:Val dflt:"" comment:"Last character(s)" +dmmeta.field field:algo_lib.RegxFlags.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:algo_lib.RegxFlags.trace arg:bool reftype:Bitfld dflt:"" comment:"Enable tracing" +dmmeta.field field:algo_lib.RegxFlags.capture arg:bool reftype:Bitfld dflt:"" comment:"Enable capture groups" +dmmeta.field field:algo_lib.RegxFlags.valid arg:bool reftype:Bitfld dflt:"" comment:"The regx parsed successfully" +dmmeta.field field:algo_lib.RegxFlags.literal arg:bool reftype:Bitfld dflt:"" comment:"The regx expression is a literal string" +dmmeta.field field:algo_lib.RegxFlags.accepts_all arg:bool reftype:Bitfld dflt:"" comment:"Compiled regx accepts all intputs" +dmmeta.field field:algo_lib.RegxFlags.fullmatch arg:bool reftype:Bitfld dflt:"" comment:"Regx expression is a substring" +dmmeta.field field:algo_lib.RegxM.front arg:algo_lib.Bitset reftype:Val dflt:"" comment:"Temporary front (for matching)" +dmmeta.field field:algo_lib.RegxM.this_char arg:algo_lib.Bitset reftype:Val dflt:"" comment:"States to test on this char" +dmmeta.field field:algo_lib.RegxM.next_char arg:algo_lib.Bitset reftype:Val dflt:"" comment:"States to test on next char" +dmmeta.field field:algo_lib.RegxM.matchrange arg:algo.I32RangeAry reftype:Val dflt:"" comment:"List of match char ranges" +dmmeta.field field:algo_lib.RegxOp.op arg:u8 reftype:Val dflt:0 comment:"What test to perform" +dmmeta.field field:algo_lib.RegxOp.consume arg:u8 reftype:Val dflt:1 comment:"Number of characters to consume" +dmmeta.field field:algo_lib.RegxOp.imm arg:u16 reftype:Val dflt:0 comment:"immediate value" dmmeta.field field:algo_lib.RegxParse.input arg:algo.strptr reftype:Val dflt:"" comment:"Input string" -dmmeta.field field:algo_lib.RegxParse.p_regx arg:algo_lib.Regx reftype:Upptr dflt:"" comment:"Output regx -- by reference" -dmmeta.field field:algo_lib.RegxParse.ary_expr arg:algo_lib.RegxExpr reftype:Tary dflt:"" comment:"Output expression array" -dmmeta.field field:algo_lib.RegxState.ch_class arg:algo.i32_Range reftype:Tary dflt:"" comment:"What to match" -dmmeta.field field:algo_lib.RegxState.out arg:algo_lib.Bitset reftype:Val dflt:"" comment:"Where to go on a match" -dmmeta.field field:algo_lib.RegxState.accept_all arg:bool reftype:Val dflt:"" comment:"Regx always succeeds from here" +dmmeta.field field:algo_lib.RegxParse.nextgroup arg:i32 reftype:Val dflt:"" comment:"Next capture group #" +dmmeta.field field:algo_lib.RegxParse.p_regx arg:algo_lib.Regx reftype:Upptr dflt:"" comment:"Regx being compiled" +dmmeta.field field:algo_lib.RegxParse.ary_expr arg:algo_lib.RegxExpr reftype:Tary dflt:"" comment:"Expression stack" +dmmeta.field field:algo_lib.RegxState.ch_class arg:algo.U16Ary reftype:Val dflt:"" comment:"What to match" +dmmeta.field field:algo_lib.RegxState.op arg:algo_lib.RegxOp reftype:Val dflt:"" comment:"Operation to perform" +dmmeta.field field:algo_lib.RegxState.lparen arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:algo_lib.RegxState.next arg:algo_lib.Bitset reftype:Val dflt:"" comment:"Where to go on a match" +dmmeta.field field:algo_lib.RegxStyle.value arg:u8 reftype:Val dflt:"" comment:"" dmmeta.field field:algo_lib.RegxToken.type arg:i32 reftype:Val dflt:"" comment:State -dmmeta.field field:algo_lib.Replscope.eatcomma arg:bool reftype:Val dflt:true comment:"" -dmmeta.field field:algo_lib.Replscope.fatal arg:bool reftype:Val dflt:"" comment:"Kill process on bad substitution" +dmmeta.field field:algo_lib.Replscope.eatcomma arg:bool reftype:Val dflt:true comment:"Delete comma+space after substitution" +dmmeta.field field:algo_lib.Replscope.strict arg:u8 reftype:Val dflt:"" comment:"1=warnings; 2=throw exception on error" dmmeta.field field:algo_lib.Replscope.ind_replvar arg:algo_lib.FReplvar reftype:Thash dflt:"" comment:"" dmmeta.field field:algo_lib.ShHdr.magic arg:u32 reftype:Val dflt:0x09202017 comment:Signature dmmeta.field field:algo_lib.ShHdr.name arg:algo.RspaceStr32 reftype:Val dflt:"" comment:"User defined name" @@ -1164,6 +1206,7 @@ dmmeta.field field:amc.FCget.p_ctype arg:amc.FCtype reftype:Upptr dflt:"" c dmmeta.field field:amc.FCharset.base arg:dmmeta.Charset reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FCharset.chars arg:algo.Charset reftype:Val dflt:"" comment:"" dmmeta.field field:amc.FChash.msghdr arg:dmmeta.Chash reftype:Base dflt:"" comment:"" +dmmeta.field field:amc.FCkafka.base arg:dmmeta.Ckafka reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FCppfunc.msghdr arg:dmmeta.Cppfunc reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FCpptype.msghdr arg:dmmeta.Cpptype reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FCpptype.p_ctype arg:amc.FCtype reftype:Upptr dflt:"" comment:"" @@ -1179,7 +1222,6 @@ dmmeta.field field:amc.FCtype.p_ns arg:amc.FNs reftype:Upptr dflt:"" commen dmmeta.field field:amc.FCtype.c_bltin arg:amc.FBltin reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FCtype.c_field arg:amc.FField reftype:Ptrary dflt:"" comment:"" dmmeta.field field:amc.FCtype.c_msgtype arg:amc.FMsgtype reftype:Ptr dflt:"" comment:"" -dmmeta.field field:amc.FCtype.c_varlenfld arg:amc.FField reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FCtype.c_optfld arg:amc.FField reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FCtype.c_static arg:amc.FStatictuple reftype:Ptrary dflt:"" comment:"" dmmeta.field field:amc.FCtype.c_cpptype arg:amc.FCpptype reftype:Ptr dflt:"" comment:"" @@ -1206,16 +1248,13 @@ dmmeta.field field:amc.FCtype.c_argvtype arg:amc.FArgvtype reftype:Ptr dflt: dmmeta.field field:amc.FCtype.c_floadtuples arg:amc.FFloadtuples reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FCtype.c_pkeyfield arg:amc.FField reftype:Ptr dflt:"" comment:"Field corresponding to pkey of this type" dmmeta.field field:amc.FCtype.c_fcurs arg:amc.FFcurs reftype:Ptrary dflt:"" comment:"" -dmmeta.field field:amc.FCtype.copy_priv_reason arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:amc.FCtype.c_ctypelen arg:amc.FCtypelen reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FCtype.size_unknown arg:bool reftype:Val dflt:"" comment:"" -dmmeta.field field:amc.FCtype.copy_priv_valid arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:amc.FCtype.size_locked arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:amc.FCtype.topo_visited arg:bool reftype:Val dflt:false comment:Temporary dmmeta.field field:amc.FCtype.enum_visited arg:bool reftype:Val dflt:false comment:Temporary dmmeta.field field:amc.FCtype.fields_cloned arg:bool reftype:Val dflt:"" comment:"True if fields from c_cbase have been cloned." dmmeta.field field:amc.FCtype.original arg:bool reftype:Val dflt:"" comment:"True if this ctype comes from disk" -dmmeta.field field:amc.FCtype.copy_priv arg:bool reftype:Val dflt:false comment:"disallow copy ctor / assign op" dmmeta.field field:amc.FCtype.plaindata arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:amc.FCtype.alignment arg:u32 reftype:Val dflt:1 comment:"" dmmeta.field field:amc.FCtype.n_padbytes arg:i32 reftype:Val dflt:"" comment:"" @@ -1227,6 +1266,10 @@ dmmeta.field field:amc.FCtype.topo_idx arg:i32 reftype:Val dflt:"" comment: dmmeta.field field:amc.FCtype.c_cfast arg:amc.FCfast reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FCtype.c_ffast arg:amc.FFfast reftype:Ptrary dflt:"" comment:"" dmmeta.field field:amc.FCtype.in_copy_priv arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:amc.FCtype.zd_varlenfld arg:amc.FField reftype:Llist dflt:"" comment:"" +dmmeta.field field:amc.FCtype.js arg:amc.JsCtype reftype:Val dflt:"" comment:"" +dmmeta.field field:amc.FCtype.c_jstype arg:amc.FJstype reftype:Ptr dflt:"" comment:"" +dmmeta.field field:amc.FCtype.c_ckafka arg:amc.FCkafka reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FCtypelen.base arg:dmmeta.Ctypelen reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FDb.lpool arg:u8 reftype:Lpool dflt:"" comment:"private memory pool" dmmeta.field field:amc.FDb.fsort arg:amc.FFsort reftype:Lary dflt:"" comment:"" @@ -1323,7 +1366,6 @@ dmmeta.field field:amc.FDb.ind_fstep arg:amc.FFstep reftype:Thash dflt:"" c dmmeta.field field:amc.FDb.tracefld arg:amc.FTracefld reftype:Lary dflt:"" comment:"Word trace is already taken..." dmmeta.field field:amc.FDb.tracerec arg:amc.FTracerec reftype:Lary dflt:"" comment:"Word trace is already taken..." dmmeta.field field:amc.FDb.dispsig arg:amc.FDispsig reftype:Lary dflt:"" comment:"" -dmmeta.field field:amc.FDb.c_dispsig_sorted arg:amc.FDispsig reftype:Ptrary dflt:"" comment:"" dmmeta.field field:amc.FDb.zs_sig_visit arg:amc.FCtype reftype:Llist dflt:"" comment:"" dmmeta.field field:amc.FDb.target arg:amc.FTarget reftype:Lary dflt:"" comment:"" dmmeta.field field:amc.FDb.ind_target arg:amc.FTarget reftype:Thash dflt:"" comment:"" @@ -1372,9 +1414,7 @@ dmmeta.field field:amc.FDb.c_ns arg:amc.FNs reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FDb.fnoremove arg:amc.FFnoremove reftype:Lary dflt:"" comment:"" dmmeta.field field:amc.FDb.c_substr_field arg:amc.FSubstr reftype:Ptrary dflt:"" comment:"" dmmeta.field field:amc.FDb.ctypelen arg:amc.FCtypelen reftype:Lary dflt:"" comment:"" -dmmeta.field field:amc.FDb.c_ctypelen arg:amc.FCtypelen reftype:Ptrary dflt:"" comment:"" dmmeta.field field:amc.FDb.c_u64 arg:amc.FCtype reftype:Ptr dflt:"" comment:"" -dmmeta.field field:amc.FDb.c_tempfield arg:amc.FField reftype:Ptrary dflt:"" comment:"" dmmeta.field field:amc.FDb.fbase arg:amc.FFbase reftype:Lary dflt:"" comment:"" dmmeta.field field:amc.FDb.ind_fcmap arg:amc.FFcmap reftype:Thash dflt:"" comment:"" dmmeta.field field:amc.FDb.nossimfile arg:amc.FNossimfile reftype:Lary dflt:"" comment:"" @@ -1410,6 +1450,13 @@ dmmeta.field field:amc.FDb.ind_pmaskfld arg:amc.FPmaskfld reftype:Thash dflt dmmeta.field field:amc.FDb.ssimsort arg:amc.FSsimsort reftype:Lary dflt:"" comment:"" dmmeta.field field:amc.FDb.fbuftype arg:amc.FFbuftype reftype:Lary dflt:"" comment:"" dmmeta.field field:amc.FDb.ind_fbuftype arg:amc.FFbuftype reftype:Thash dflt:"" comment:"" +dmmeta.field field:amc.FDb.nsjs arg:amc.FNsjs reftype:Lary dflt:"" comment:"" +dmmeta.field field:amc.FDb.jstype arg:amc.FJstype reftype:Lary dflt:"" comment:"" +dmmeta.field field:amc.FDb.ckafka arg:amc.FCkafka reftype:Lary dflt:"" comment:"" +dmmeta.field field:amc.FDb.fkafka arg:amc.FFkafka reftype:Lary dflt:"" comment:"" +dmmeta.field field:amc.FDb.userfunc arg:amc.FUserfunc reftype:Lary dflt:"" comment:"" +dmmeta.field field:amc.FDb.steptype arg:amc.FSteptype reftype:Lary dflt:"" comment:"" +dmmeta.field field:amc.FDb.ind_steptype arg:amc.FSteptype reftype:Thash dflt:"" comment:"" dmmeta.field field:amc.FDispatch.msghdr arg:dmmeta.Dispatch reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FDispatch.p_ctype_hdr arg:amc.FCtype reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc.FDispatch.p_casetype arg:amc.FCtype reftype:Upptr dflt:"" comment:"Optional casetype" @@ -1541,9 +1588,12 @@ dmmeta.field field:amc.FField.c_ffast_length arg:amc.FFfast reftype:Ptr dflt dmmeta.field field:amc.FField.c_ffast_mantissa arg:amc.FFfast reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FField.c_ffast arg:amc.FFfast reftype:Ptrary dflt:"" comment:"" dmmeta.field field:amc.FField.c_pmaskfld_member arg:amc.FPmaskfldMember reftype:Ptrary dflt:"" comment:"" +dmmeta.field field:amc.FField.c_lenfld arg:amc.FLenfld reftype:Ptr dflt:"" comment:"" +dmmeta.field field:amc.FField.c_fkafka arg:amc.FFkafka reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FFindrem.base arg:dmmeta.Findrem reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FFinput.msghdr arg:dmmeta.Finput reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FFinput.p_field arg:amc.FField reftype:Upptr dflt:"" comment:"" +dmmeta.field field:amc.FFkafka.base arg:dmmeta.Fkafka reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FFldoffset.msghdr arg:dmmeta.Fldoffset reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FFldoffset.p_field arg:amc.FField reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc.FFloadtuples.base arg:dmmeta.Floadtuples reftype:Base dflt:"" comment:"" @@ -1558,18 +1608,21 @@ dmmeta.field field:amc.FFsort.p_sortfld arg:amc.FField reftype:Upptr dflt:"" dmmeta.field field:amc.FFstep.msghdr arg:dmmeta.Fstep reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FFstep.c_fdelay arg:amc.FFdelay reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FFstep.p_field arg:amc.FField reftype:Upptr dflt:"" comment:"" +dmmeta.field field:amc.FFstep.p_steptype arg:amc.FSteptype reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc.FFtrace.base arg:dmmeta.Ftrace reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FFunc.msghdr arg:dmmeta.Func reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FFunc.p_ns arg:amc.FNs reftype:Upptr dflt:"" comment:"" -dmmeta.field field:amc.FFunc.inl arg:bool reftype:Val dflt:"" comment:"Make inline?" +dmmeta.field field:amc.FFunc.body arg:algo.cstring reftype:Val dflt:"" comment:"Body of function" +dmmeta.field field:amc.FFunc.prepcond arg:algo.cstring reftype:Val dflt:"" comment:"Preprocessor #if condition" +dmmeta.field field:amc.FFunc.proto arg:algo.cstring reftype:Val dflt:"" comment:Prototype dmmeta.field field:amc.FFunc.nonnull arg:algo.cstring reftype:Val dflt:"" comment:"List of non-null attributes" +dmmeta.field field:amc.FFunc.initializer arg:algo.StringAry reftype:Val dflt:"" comment:"Initializer list (constructors only)" +dmmeta.field field:amc.FFunc.ret arg:algo.cstring reftype:Val dflt:"" comment:"Return type (c++ expression)" +dmmeta.field field:amc.FFunc.acrkey arg:algo.cstring reftype:Val dflt:"" comment:"Acr key due to which function was created" dmmeta.field field:amc.FFunc.funcarg arg:amc.Funcarg reftype:Tary dflt:"" comment:"Array of declared function arguments" dmmeta.field field:amc.FFunc.printed arg:bool reftype:Val dflt:"" comment:"Already printed? (internal)" dmmeta.field field:amc.FFunc.throws arg:bool reftype:Val dflt:"" comment:"Throws exceptions" -dmmeta.field field:amc.FFunc.proto arg:algo.cstring reftype:Val dflt:"" comment:Prototype dmmeta.field field:amc.FFunc.nothrow arg:bool reftype:Val dflt:"" comment:"Definitely doesn't throw exception" -dmmeta.field field:amc.FFunc.oper arg:bool reftype:Val dflt:"" comment:"Is operator?" -dmmeta.field field:amc.FFunc.body arg:algo.cstring reftype:Val dflt:"" comment:"Body of function" dmmeta.field field:amc.FFunc.member arg:bool reftype:Val dflt:false comment:"Function is a member (print inside struct)" dmmeta.field field:amc.FFunc.disable arg:bool reftype:Val dflt:false comment:"Function is enabled (if not, don't print)" dmmeta.field field:amc.FFunc.deprecate arg:bool reftype:Val dflt:"" comment:"Make deprecated?" @@ -1580,15 +1633,13 @@ dmmeta.field field:amc.FFunc.isconst arg:bool reftype:Val dflt:"" comment:" dmmeta.field field:amc.FFunc.glob arg:bool reftype:Val dflt:"" comment:"Function is not attached to a field (EXPLAIN!!)" dmmeta.field field:amc.FFunc.wur arg:bool reftype:Val dflt:"" comment:"Warn on unused result" dmmeta.field field:amc.FFunc.priv arg:bool reftype:Val dflt:"" comment:"Private to translateion unit (static)" -dmmeta.field field:amc.FFunc.ret arg:algo.cstring reftype:Val dflt:"" comment:"Return type (c++ expression)" dmmeta.field field:amc.FFunc.pure arg:bool reftype:Val dflt:"" comment:"OK to call fewer times than specified in text" dmmeta.field field:amc.FFunc.isprivate arg:bool reftype:Val dflt:"" comment:"Applies to member functions only -- private" dmmeta.field field:amc.FFunc.finalized arg:bool reftype:Val dflt:"" comment:"Don't add any more code to me" dmmeta.field field:amc.FFunc.isexplicit arg:bool reftype:Val dflt:"" comment:"Is explicit constructor (add 'explicit')" dmmeta.field field:amc.FFunc.istmpl arg:bool reftype:Val dflt:"" comment:"Function is a template" dmmeta.field field:amc.FFunc.deleted arg:bool reftype:Val dflt:"" comment:"Function is marked as deleted" -dmmeta.field field:amc.FFunc.prepcond arg:algo.cstring reftype:Val dflt:"" comment:"Preprocessor #if condition" -dmmeta.field field:amc.FFunc.initializer arg:algo.StringAry reftype:Val dflt:"" comment:"Initializer list (constructors only)" +dmmeta.field field:amc.FFunc.inl arg:bool reftype:Val dflt:"" comment:"Make inline?" dmmeta.field field:amc.FFunique.base arg:dmmeta.Funique reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FFuserinit.base arg:dmmeta.Fuserinit reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FFwddecl.msghdr arg:dmmeta.Fwddecl reftype:Base dflt:"" comment:"" @@ -1613,6 +1664,7 @@ dmmeta.field field:amc.FHook.base arg:dmmeta.Hook reftype:Base dflt:"" comm dmmeta.field field:amc.FHook.p_funcptr arg:amc.FCtype reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc.FHook.p_field arg:amc.FField reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc.FInlary.msghdr arg:dmmeta.Inlary reftype:Base dflt:"" comment:"" +dmmeta.field field:amc.FJstype.base arg:dmmeta.Jstype reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FLenfld.msghdr arg:dmmeta.Lenfld reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FLenfld.p_field arg:amc.FField reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc.FLicense.base arg:dev.License reftype:Base dflt:"" comment:"" @@ -1660,9 +1712,12 @@ dmmeta.field field:amc.FNs.c_gsymbol arg:amc.FGsymbol reftype:Ptrary dflt:"" dmmeta.field field:amc.FNs.c_nsinclude arg:amc.FNsinclude reftype:Ptrary dflt:"" comment:"" dmmeta.field field:amc.FNs.c_nscpp arg:amc.FNscpp reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FNs.p_license arg:amc.FLicense reftype:Upptr dflt:"" comment:"" +dmmeta.field field:amc.FNs.js arg:amc.JsNs reftype:Val dflt:"" comment:"" +dmmeta.field field:amc.FNs.c_nsjs arg:amc.FNsjs reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc.FNscpp.base arg:dmmeta.Nscpp reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FNsdb.base arg:dmmeta.Nsdb reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FNsinclude.base arg:dmmeta.Nsinclude reftype:Base dflt:"" comment:"" +dmmeta.field field:amc.FNsjs.base arg:dmmeta.Nsjs reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FNsproto.base arg:dmmeta.Nsproto reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FNsx.base arg:dmmeta.Nsx reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FNsx.p_pool arg:amc.FField reftype:Upptr dflt:"" comment:"" @@ -1717,6 +1772,7 @@ dmmeta.field field:amc.FSsimvolatile.base arg:dmmeta.Ssimvolatile reftype:Bas dmmeta.field field:amc.FStatictuple.ctype arg:dmmeta.Ctype reftype:Pkey dflt:"" comment:"" dmmeta.field field:amc.FStatictuple.tuple arg:algo.Tuple reftype:Val dflt:"" comment:"" dmmeta.field field:amc.FStatictuple.cppident arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:amc.FSteptype.base arg:dmmeta.Steptype reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FSubstr.msghdr arg:dmmeta.Substr reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FSubstr.p_field arg:amc.FField reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc.FSubstr.p_srcfield arg:amc.FField reftype:Upptr dflt:"" comment:"" @@ -1744,6 +1800,7 @@ dmmeta.field field:amc.FTracerec.msghdr arg:dmmeta.Tracerec reftype:Base dfl dmmeta.field field:amc.FTypefld.msghdr arg:dmmeta.Typefld reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FTypefld.p_field arg:amc.FField reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc.FTypefld.p_ctype arg:amc.FCtype reftype:Upptr dflt:"" comment:"" +dmmeta.field field:amc.FUserfunc.base arg:dmmeta.Userfunc reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FUsertracefld.msghdr arg:dmmeta.Usertracefld reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FXref.msghdr arg:dmmeta.Xref reftype:Base dflt:"" comment:"" dmmeta.field field:amc.FXref.p_field arg:amc.FField reftype:Upptr dflt:"" comment:"Xref field" @@ -1773,6 +1830,13 @@ dmmeta.field field:amc.Genpnew.p_optfld arg:amc.FField reftype:Upptr dflt:"" dmmeta.field field:amc.Genpnew.p_varlenfld arg:amc.FField reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc.Genpnew.optnolen arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:amc.Genpnew.hasret arg:bool reftype:Val dflt:true comment:"" +dmmeta.field field:amc.JsCtype.body arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:amc.JsCtype.ctor arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:amc.JsCtype.args arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:amc.JsCtype.funcs arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:amc.JsNs.import arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:amc.JsNs.mdl arg:algo.cstring reftype:Ptr dflt:"" comment:"" +dmmeta.field field:amc.JsNs.body arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:amc.Pnewtype.value arg:u8 reftype:Val dflt:"" comment:"" dmmeta.field field:amc_gc.FDb._db arg:amc_gc.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:amc_gc.FDb.cmdline arg:command.amc_gc reftype:Val dflt:"" comment:"" @@ -1788,6 +1852,8 @@ dmmeta.field field:amc_vis.FCtype.p_base arg:amc_vis.FCtype reftype:Upptr df dmmeta.field field:amc_vis.FCtype.c_field arg:amc_vis.FField reftype:Ptrary dflt:"" comment:"" dmmeta.field field:amc_vis.FCtype.mm_id arg:i32 reftype:Val dflt:"" comment:"Model matrix ID" dmmeta.field field:amc_vis.FCtype.isinput arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:amc_vis.FCtype.userselect arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:amc_vis.FCtype.color arg:u16 reftype:Val dflt:"" comment:"" dmmeta.field field:amc_vis.FDb.lpool arg:u8 reftype:Lpool dflt:"" comment:"private memory pool" dmmeta.field field:amc_vis.FDb.cmdline arg:command.amc_vis reftype:Val dflt:"" comment:"" dmmeta.field field:amc_vis.FDb.ctype arg:amc_vis.FCtype reftype:Lary dflt:"" comment:"" @@ -1797,38 +1863,58 @@ dmmeta.field field:amc_vis.FDb.ind_ctype arg:amc_vis.FCtype reftype:Thash df dmmeta.field field:amc_vis.FDb.ind_field arg:amc_vis.FField reftype:Thash dflt:"" comment:"" dmmeta.field field:amc_vis.FDb.node arg:amc_vis.FNode reftype:Lary dflt:"" comment:"" dmmeta.field field:amc_vis.FDb.ind_node arg:amc_vis.FNode reftype:Thash dflt:"" comment:"" -dmmeta.field field:amc_vis.FDb.link arg:amc_vis.Link reftype:Lary dflt:"" comment:"" -dmmeta.field field:amc_vis.FDb.ind_link arg:amc_vis.Link reftype:Thash dflt:"" comment:"" -dmmeta.field field:amc_vis.FDb.linkdep arg:amc_vis.Linkdep reftype:Lary dflt:"" comment:"" -dmmeta.field field:amc_vis.FDb.c_linklist arg:amc_vis.Link reftype:Ptrary dflt:"" comment:"" +dmmeta.field field:amc_vis.FDb.link arg:amc_vis.FLink reftype:Lary dflt:"" comment:"" +dmmeta.field field:amc_vis.FDb.ind_link arg:amc_vis.FLink reftype:Thash dflt:"" comment:"" +dmmeta.field field:amc_vis.FDb.linkdep arg:amc_vis.FLinkdep reftype:Lary dflt:"" comment:"" +dmmeta.field field:amc_vis.FDb.c_linklist arg:amc_vis.FLink reftype:Ptrary dflt:"" comment:"" dmmeta.field field:amc_vis.FDb.bh_node arg:amc_vis.FNode reftype:Bheap dflt:"" comment:"Heap of ctypes, used to compute columns" -dmmeta.field field:amc_vis.FDb.bh_link arg:amc_vis.Link reftype:Bheap dflt:"" comment:"Heap of links, used to place links" +dmmeta.field field:amc_vis.FDb.bh_link arg:amc_vis.FLink reftype:Bheap dflt:"" comment:"Heap of links, used to place links" dmmeta.field field:amc_vis.FDb.reftype arg:amc_vis.FReftype reftype:Lary dflt:"" comment:"" dmmeta.field field:amc_vis.FDb.ind_reftype arg:amc_vis.FReftype reftype:Thash dflt:"" comment:"" dmmeta.field field:amc_vis.FDb.nodedep arg:amc_vis.FNodedep reftype:Lary dflt:"" comment:"" -dmmeta.field field:amc_vis.FDb.outrow arg:amc_vis.Outrow reftype:Lary dflt:"" comment:"" +dmmeta.field field:amc_vis.FDb.outrow arg:amc_vis.FOutrow reftype:Lary dflt:"" comment:"" dmmeta.field field:amc_vis.FDb.zd_select arg:amc_vis.FCtype reftype:Llist dflt:"" comment:"" dmmeta.field field:amc_vis.FDb.finput arg:amc_vis.FFinput reftype:Lary dflt:"" comment:"" +dmmeta.field field:amc_vis.FDb.term_hei arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:amc_vis.FDb.term_wid arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:amc_vis.FDb.usecolor arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:amc_vis.FDb.hastty arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:amc_vis.FField.msghdr arg:dmmeta.Field reftype:Base dflt:"" comment:"" dmmeta.field field:amc_vis.FField.p_ctype arg:amc_vis.FCtype reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc_vis.FField.p_arg arg:amc_vis.FCtype reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc_vis.FField.p_reftype arg:amc_vis.FReftype reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc_vis.FField.c_finput arg:amc_vis.FFinput reftype:Ptr dflt:"" comment:"" dmmeta.field field:amc_vis.FFinput.msghdr arg:dmmeta.Finput reftype:Base dflt:"" comment:"" +dmmeta.field field:amc_vis.FLink.link arg:algo.cstring reftype:Val dflt:"" comment:"Primary key" +dmmeta.field field:amc_vis.FLink.label1 arg:algo.cstring reftype:Val dflt:"" comment:"Label in column 1" +dmmeta.field field:amc_vis.FLink.label2 arg:algo.cstring reftype:Val dflt:"" comment:"Label in column 2" +dmmeta.field field:amc_vis.FLink.linkkey arg:amc_vis.Linkkey reftype:Val dflt:"" comment:"" +dmmeta.field field:amc_vis.FLink.outrow arg:i32 reftype:Val dflt:"" comment:"Outrow #" +dmmeta.field field:amc_vis.FLink.p_node1 arg:amc_vis.FNode reftype:Upptr dflt:"" comment:"" +dmmeta.field field:amc_vis.FLink.p_node2 arg:amc_vis.FNode reftype:Upptr dflt:"" comment:"" +dmmeta.field field:amc_vis.FLink.upptr arg:bool reftype:Val dflt:"" comment:"Up-arrow (not a constraint)" +dmmeta.field field:amc_vis.FLink.zd_linkdep_out arg:amc_vis.FLinkdep reftype:Llist dflt:"" comment:"Arrow from this ctype" +dmmeta.field field:amc_vis.FLink.zd_linkdep_in arg:amc_vis.FLinkdep reftype:Llist dflt:"" comment:"Arrows to this ctype" +dmmeta.field field:amc_vis.FLinkdep.row arg:amc_vis.FOutrow reftype:Pkey dflt:"" comment:"" +dmmeta.field field:amc_vis.FLinkdep.rowid arg:i32 reftype:Val dflt:"" comment:Id +dmmeta.field field:amc_vis.FLinkdep.up arg:bool reftype:Val dflt:"" comment:"Points up" +dmmeta.field field:amc_vis.FLinkdep.inst arg:bool reftype:Val dflt:"" comment:"Instance (vs. index)" +dmmeta.field field:amc_vis.FLinkdep.p_link_from arg:amc_vis.FLink reftype:Upptr dflt:"" comment:"Source ctype" +dmmeta.field field:amc_vis.FLinkdep.p_link_to arg:amc_vis.FLink reftype:Upptr dflt:"" comment:"Target ctype" dmmeta.field field:amc_vis.FNode.node arg:algo.Smallstr100 reftype:Val dflt:"" comment:"" dmmeta.field field:amc_vis.FNode.nodekey arg:amc_vis.Nodekey reftype:Val dflt:"" comment:"Sort key for columns" dmmeta.field field:amc_vis.FNode.label arg:algo.Smallstr100 reftype:Val dflt:"" comment:"Display label" -dmmeta.field field:amc_vis.FNode.xpos arg:i32 reftype:Val dflt:1 comment:"" +dmmeta.field field:amc_vis.FNode.xpos arg:i32 reftype:Val dflt:0 comment:"" dmmeta.field field:amc_vis.FNode.label2 arg:algo.Smallstr100 reftype:Val dflt:"" comment:"Display label" -dmmeta.field field:amc_vis.FNode.c_bottom arg:amc_vis.Link reftype:Ptr dflt:"" comment:Bottom -dmmeta.field field:amc_vis.FNode.c_top arg:amc_vis.Link reftype:Ptr dflt:"" comment:Top +dmmeta.field field:amc_vis.FNode.c_bottom arg:amc_vis.FLink reftype:Ptr dflt:"" comment:Bottom +dmmeta.field field:amc_vis.FNode.c_top arg:amc_vis.FLink reftype:Ptr dflt:"" comment:Top dmmeta.field field:amc_vis.FNode.p_ctype arg:amc_vis.FCtype reftype:Upptr dflt:"" comment:"" dmmeta.field field:amc_vis.FNode.rowid arg:i32 reftype:Val dflt:"" comment:"" dmmeta.field field:amc_vis.FNode.zd_nodedep_out arg:amc_vis.FNodedep reftype:Llist dflt:"" comment:"Arrow from this ctype" dmmeta.field field:amc_vis.FNode.zd_nodedep_in arg:amc_vis.FNodedep reftype:Llist dflt:"" comment:"Arrows to this ctype" -dmmeta.field field:amc_vis.FNode.zd_link_out arg:amc_vis.Link reftype:Llist dflt:"" comment:"Arrow from this ctype" -dmmeta.field field:amc_vis.FNode.zd_link_in arg:amc_vis.Link reftype:Llist dflt:"" comment:"Arrow from this ctype" -dmmeta.field field:amc_vis.FNodedep.row arg:amc_vis.Outrow reftype:Pkey dflt:"" comment:"" +dmmeta.field field:amc_vis.FNode.zd_link_out arg:amc_vis.FLink reftype:Llist dflt:"" comment:"Arrow from this ctype" +dmmeta.field field:amc_vis.FNode.zd_link_in arg:amc_vis.FLink reftype:Llist dflt:"" comment:"Arrow from this ctype" +dmmeta.field field:amc_vis.FNodedep.row arg:amc_vis.FOutrow reftype:Pkey dflt:"" comment:"" dmmeta.field field:amc_vis.FNodedep.rowid arg:i32 reftype:Val dflt:"" comment:Id dmmeta.field field:amc_vis.FNodedep.up arg:bool reftype:Val dflt:"" comment:"Points up" dmmeta.field field:amc_vis.FNodedep.inst arg:bool reftype:Val dflt:"" comment:"Instance (vs. index)" @@ -1836,32 +1922,14 @@ dmmeta.field field:amc_vis.FNodedep.p_node1 arg:amc_vis.FNode reftype:Upptr dmmeta.field field:amc_vis.FNodedep.p_node2 arg:amc_vis.FNode reftype:Upptr dflt:"" comment:"Target ctype" dmmeta.field field:amc_vis.FNodedep.name arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:amc_vis.FNodedep.reftype arg:dmmeta.Reftype reftype:Pkey dflt:"" comment:"" +dmmeta.field field:amc_vis.FOutrow.rowid arg:i32 reftype:Val dflt:"" comment:"FOutrow pkey" +dmmeta.field field:amc_vis.FOutrow.text arg:u16 reftype:Tary dflt:"" comment:"Lower byte=text; Upper byte=color" dmmeta.field field:amc_vis.FReftype.msghdr arg:dmmeta.Reftype reftype:Base dflt:"" comment:"" -dmmeta.field field:amc_vis.Link.link arg:algo.Smallstr100 reftype:Val dflt:"" comment:"Primary key" -dmmeta.field field:amc_vis.Link.label1 arg:algo.Smallstr100 reftype:Val dflt:"" comment:"Label in column 1" -dmmeta.field field:amc_vis.Link.label2 arg:algo.Smallstr100 reftype:Val dflt:"" comment:"Label in column 2" -dmmeta.field field:amc_vis.Link.linkkey arg:amc_vis.Linkkey reftype:Val dflt:"" comment:"" -dmmeta.field field:amc_vis.Link.outrow arg:i32 reftype:Val dflt:"" comment:"Outrow #" -dmmeta.field field:amc_vis.Link.p_node1 arg:amc_vis.FNode reftype:Upptr dflt:"" comment:"" -dmmeta.field field:amc_vis.Link.p_node2 arg:amc_vis.FNode reftype:Upptr dflt:"" comment:"" -dmmeta.field field:amc_vis.Link.upptr arg:bool reftype:Val dflt:"" comment:"Up-arrow (not a constraint)" -dmmeta.field field:amc_vis.Link.zd_linkdep_out arg:amc_vis.Linkdep reftype:Llist dflt:"" comment:"Arrow from this ctype" -dmmeta.field field:amc_vis.Link.zd_linkdep_in arg:amc_vis.Linkdep reftype:Llist dflt:"" comment:"Arrows to this ctype" -dmmeta.field field:amc_vis.Linkdep.row arg:amc_vis.Outrow reftype:Pkey dflt:"" comment:"" -dmmeta.field field:amc_vis.Linkdep.rowid arg:i32 reftype:Val dflt:"" comment:Id -dmmeta.field field:amc_vis.Linkdep.up arg:bool reftype:Val dflt:"" comment:"Points up" -dmmeta.field field:amc_vis.Linkdep.inst arg:bool reftype:Val dflt:"" comment:"Instance (vs. index)" -dmmeta.field field:amc_vis.Linkdep.p_link_from arg:amc_vis.Link reftype:Upptr dflt:"" comment:"Source ctype" -dmmeta.field field:amc_vis.Linkdep.p_link_to arg:amc_vis.Link reftype:Upptr dflt:"" comment:"Target ctype" dmmeta.field field:amc_vis.Linkkey.n_link_in arg:u32 reftype:Val dflt:"" comment:"Number of incoming dependencies" -dmmeta.field field:amc_vis.Linkkey.samecol arg:i32 reftype:Val dflt:"" comment:"Set on links that lead to the same col" -dmmeta.field field:amc_vis.Linkkey.colweight arg:i32 reftype:Val dflt:"" comment:"Smaller cols are scheduled first" -dmmeta.field field:amc_vis.Linkkey.topbot arg:i32 reftype:Val dflt:"" comment:"Set to -1 for bottoms and tops to schedule them sooner" +dmmeta.field field:amc_vis.Linkkey.samecol arg:i32 reftype:Val dflt:"" comment:"Set on links that lead to the same column" +dmmeta.field field:amc_vis.Linkkey.colweight arg:i32 reftype:Val dflt:"" comment:"Heavier columns are scheduled first" dmmeta.field field:amc_vis.Nodekey.n_ct_in arg:u32 reftype:Val dflt:"" comment:"Number of incoming dependencies" dmmeta.field field:amc_vis.Nodekey.idx arg:i32 reftype:Val dflt:"" comment:"Set to -rowid" -dmmeta.field field:amc_vis.Nodekey.prev_xpos arg:i32 reftype:Val dflt:99999999 comment:"" -dmmeta.field field:amc_vis.Outrow.rowid arg:i32 reftype:Val dflt:"" comment:"Outrow pkey" -dmmeta.field field:amc_vis.Outrow.text arg:u8 reftype:Tary dflt:"" comment:text dmmeta.field field:amcdb.Bltin.ctype arg:dmmeta.Ctype reftype:Pkey dflt:"" comment:"" dmmeta.field field:amcdb.Bltin.likeu64 arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:amcdb.Bltin.bigendok arg:bool reftype:Val dflt:"" comment:"" @@ -1891,25 +1959,16 @@ dmmeta.field field:amcdb.Tfunc.wur arg:bool reftype:Val dflt:"" comment:"Wa dmmeta.field field:amcdb.Tfunc.pure arg:bool reftype:Val dflt:"" comment:"OK to call fewer times than specified in text" dmmeta.field field:amcdb.Tfunc.ismacro arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:amcdb.Tfunc.comment arg:algo.Comment reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.AlarmSyncMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.AlarmSyncMsg.updated_after arg:algo.UnTime reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.DfltStream.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.DfltStream.stream_id arg:ams.StreamId reftype:Val dflt:"" comment:"Message ID" -dmmeta.field field:ams.DumpStreamTableMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.DumpStreamTableMsg.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"Target process" dmmeta.field field:ams.ExpectMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" dmmeta.field field:ams.ExpectMsg.text arg:char reftype:Varlen dflt:"" comment:"" -dmmeta.field field:ams.HeartbeatMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.HeartbeatMsg.time arg:algo.UnTime reftype:Val dflt:"" comment:"" dmmeta.field field:ams.InputLineMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ams.InputLineMsg.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"Target process" dmmeta.field field:ams.InputLineMsg.payload arg:char reftype:Varlen dflt:"" comment:"" dmmeta.field field:ams.LogMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.LogMsg.logcat arg:algo.RnullStr50 reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.LogMsg.tstamp arg:algo.SchedTime reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.LogMsg.text arg:char reftype:Varlen dflt:"" comment:Message -dmmeta.field field:ams.Member.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"Proces ID" -dmmeta.field field:ams.Member.stream_id arg:ams.StreamId reftype:Val dflt:"" comment:"Stream ID" -dmmeta.field field:ams.Member.mode arg:u8 reftype:Val dflt:0 comment:"0=read, 1=write (2 or more =read)" +dmmeta.field field:ams.LogMsg.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.LogMsg.tstamp arg:algo.SchedTime reftype:Val dflt:"" comment:"Local timestamp" +dmmeta.field field:ams.LogMsg.logcat arg:char reftype:Varlen dflt:"" comment:"Log category (as text)" +dmmeta.field field:ams.LogMsg.text arg:char reftype:Varlen dflt:"" comment:"Log message" dmmeta.field field:ams.MsgBlock.header arg:ams.MsgHeader reftype:Base dflt:"" comment:"" dmmeta.field field:ams.MsgBlock.first_seqno arg:u64 reftype:Val dflt:"" comment:"First sequence number " dmmeta.field field:ams.MsgBlock.n_messages arg:u32 reftype:Val dflt:"" comment:"Number of messages" @@ -1917,72 +1976,57 @@ dmmeta.field field:ams.MsgBlock.original_length arg:u32 reftype:Val dflt:"" dmmeta.field field:ams.MsgBlock.messages arg:u8 reftype:Varlen dflt:"" comment:"LZ4 compressed messages" dmmeta.field field:ams.MsgHeader.type arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:ams.MsgHeader.length arg:u32 reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.OpenMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.OpenMsg.member arg:ams.Member reftype:Val dflt:"" comment:"Target process_id and stream_id" -dmmeta.field field:ams.OpenMsg.pos arg:ams.StreamPos reftype:Val dflt:"" comment:"Start reading here" -dmmeta.field field:ams.PrlogMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.PrlogMsg.logcat arg:algo.RnullStr50 reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.PrlogMsg.tstamp arg:algo.SchedTime reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.PrlogMsg.data arg:ams.MsgHeader reftype:Opt dflt:"" comment:"" -dmmeta.field field:ams.ProcAddMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.ProcAddMsg.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"ID of process being added" -dmmeta.field field:ams.ProcId.proc_type arg:ams.ProcType reftype:Val dflt:"" comment:"Writer process ID" -dmmeta.field field:ams.ProcId.procidx arg:u8 reftype:Val dflt:"" comment:"Writer process index" -dmmeta.field field:ams.ProcRemoveMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.ProcRemoveMsg.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"ID of process being removed" -dmmeta.field field:ams.ProcType.value arg:u8 reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.Seqmsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.Seqmsg.seqmsg_id arg:ams.SeqmsgId reftype:Val dflt:"" comment:"Message ID" -dmmeta.field field:ams.Seqmsg.tsc arg:u64 reftype:Val dflt:"" comment:"TSC of sender" -dmmeta.field field:ams.Seqmsg.payload arg:ams.MsgHeader reftype:Opt dflt:"" comment:"Actual Payload" -dmmeta.field field:ams.SeqmsgId.stream_id arg:ams.StreamId reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.SeqmsgId.seq arg:u64 reftype:Val dflt:1 comment:"" -dmmeta.field field:ams.SeqmsgId.off arg:u32 reftype:Val dflt:0 comment:"" -dmmeta.field field:ams.SeqmsgTrace.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.SeqmsgTrace.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"Proces ID" -dmmeta.field field:ams.SeqmsgTrace.mode arg:u8 reftype:Val dflt:0 comment:"0=read, 1=write (2 or more =read)" -dmmeta.field field:ams.SeqmsgTrace.seqmsg_id arg:ams.SeqmsgId reftype:Val dflt:"" comment:"Message ID" -dmmeta.field field:ams.SeqmsgTrace.tsc arg:u64 reftype:Val dflt:"" comment:"TSC of sender" -dmmeta.field field:ams.SeqmsgTrace.payload arg:ams.MsgHeader reftype:Opt dflt:"" comment:"Actual Payload" -dmmeta.field field:ams.StreamFlags.value arg:u8 reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.StreamFlags.write arg:bool reftype:Bitfld dflt:"" comment:"" -dmmeta.field field:ams.StreamFlags.read arg:bool reftype:Bitfld dflt:"" comment:"" -dmmeta.field field:ams.StreamFlags.nonblock arg:bool reftype:Bitfld dflt:"" comment:"" -dmmeta.field field:ams.StreamFlags.trace_read arg:bool reftype:Bitfld dflt:"" comment:"" -dmmeta.field field:ams.StreamFlags.trace_write arg:bool reftype:Bitfld dflt:"" comment:"" -dmmeta.field field:ams.StreamFlags.write_err arg:bool reftype:Bitfld dflt:"" comment:"Error occurred during output" -dmmeta.field field:ams.StreamFlags.trace_text arg:bool reftype:Bitfld dflt:"" comment:"ASCII tracing mode" -dmmeta.field field:ams.StreamHbMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.StreamHbMsg.member arg:ams.Member reftype:Val dflt:"" comment:"Primary key" -dmmeta.field field:ams.StreamHbMsg.pos arg:ams.StreamPos reftype:Val dflt:"" comment:"Read/write position" -dmmeta.field field:ams.StreamHbMsg.wbudget arg:u32 reftype:Val dflt:"" comment:"Max. offset for writing" -dmmeta.field field:ams.StreamId.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"Writer process ID" -dmmeta.field field:ams.StreamId.stream_type arg:ams.StreamType reftype:Val dflt:"" comment:"Stream type ID" -dmmeta.field field:ams.StreamId.streamidx arg:u8 reftype:Val dflt:"" comment:"Stream index" -dmmeta.field field:ams.StreamPos.seq arg:u64 reftype:Val dflt:1 comment:"" -dmmeta.field field:ams.StreamPos.off arg:u64 reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.StreamType.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.ProcEofMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ams.ProcEofMsg.proc arg:algo.RnullStr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.ProcId.value arg:u32 reftype:Val dflt:"" comment:"Process type" +dmmeta.field field:ams.ProcId.proctype arg:ams.Proctype reftype:Bitfld dflt:"" comment:"Process type" +dmmeta.field field:ams.ProcId.nodeidx arg:u8 reftype:Bitfld dflt:"" comment:"Node index" +dmmeta.field field:ams.ProcId.procidx arg:u8 reftype:Bitfld dflt:"" comment:"0,1,2 etc" +dmmeta.field field:ams.ProcKillMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ams.ProcKillMsg.proc arg:algo.RnullStr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.ProcKillMsg.signal arg:i32 reftype:Val dflt:15 comment:"" +dmmeta.field field:ams.ProcMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ams.ProcMsg.proc arg:algo.RnullStr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.ProcMsg.payload arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ams.ProcReadMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ams.ProcReadMsg.proc arg:algo.RnullStr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.ProcReadMsg.until arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ams.ProcStartMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ams.ProcStartMsg.proc arg:algo.RnullStr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.ProcStartMsg.pty arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.ProcStartMsg.cmd arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ams.ProcStatusMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ams.ProcStatusMsg.proc arg:algo.RnullStr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.ProcStatusMsg.status arg:algo.RnullStr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.Proctype.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.RemDirRecurseMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ams.RemDirRecurseMsg.remove_topmost arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.RemDirRecurseMsg.pathname arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ams.ShmFlags.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.ShmFlags.write arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:ams.ShmFlags.read arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:ams.ShmFlags.nonblock arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:ams.ShmFlags.write_err arg:bool reftype:Bitfld dflt:"" comment:"Error occurred during output" +dmmeta.field field:ams.ShmHbMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ams.ShmHbMsg.shmember arg:ams.ShmemberId reftype:Val dflt:"" comment:"Primary key" +dmmeta.field field:ams.ShmHbMsg.off arg:u64 reftype:Val dflt:"" comment:"Read/write position" +dmmeta.field field:ams.ShmHbMsg.wbudget arg:u32 reftype:Val dflt:"" comment:"Max. offset for writing" +dmmeta.field field:ams.ShmId.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"Writer process ID" +dmmeta.field field:ams.ShmId.shmtype arg:ams.Shmtype reftype:Val dflt:"" comment:"Stream type ID" +dmmeta.field field:ams.ShmId.index arg:u8 reftype:Val dflt:"" comment:"Stream index" +dmmeta.field field:ams.ShmemberFlags.value arg:u16 reftype:Val dflt:0 comment:"Shm member flags" +dmmeta.field field:ams.ShmemberFlags.r arg:bool reftype:Bitfld dflt:0 comment:"" +dmmeta.field field:ams.ShmemberFlags.w arg:bool reftype:Bitfld dflt:0 comment:"" +dmmeta.field field:ams.ShmemberId.shm_id arg:ams.ShmId reftype:Val dflt:"" comment:"Stream ID" +dmmeta.field field:ams.ShmemberId.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"Process ID" +dmmeta.field field:ams.ShmemberId.flags arg:ams.ShmemberFlags reftype:Val dflt:0 comment:"" +dmmeta.field field:ams.Shmmsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ams.Shmmsg.shm_id arg:ams.ShmId reftype:Val dflt:"" comment:"" +dmmeta.field field:ams.Shmmsg.off arg:u64 reftype:Val dflt:0 comment:"" +dmmeta.field field:ams.Shmmsg.tstamp arg:u64 reftype:Val dflt:0 comment:"" +dmmeta.field field:ams.Shmmsg.payload arg:ams.MsgHeader reftype:Opt dflt:"" comment:"Actual Payload" +dmmeta.field field:ams.Shmtype.value arg:u8 reftype:Val dflt:"" comment:"" dmmeta.field field:ams.TerminateMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.Trace2Msg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.Trace2Msg.proc arg:ams.ProcId reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.Trace2Msg.trace arg:u8 reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.Trace2Msg.tstamp arg:algo.UnTime reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.Trace2Msg.data arg:u64 reftype:Varlen dflt:"" comment:"" -dmmeta.field field:ams.TraceInfo2Msg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.TraceInfo2Msg.proc arg:ams.ProcId reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.TraceInfo2Msg.trace arg:u8 reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.TraceInfo2Msg.tstamp arg:algo.UnTime reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.TraceInfo2Msg.part arg:u8 reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.TraceInfo2Msg.data arg:char reftype:Varlen dflt:"" comment:"" -dmmeta.field field:ams.TraceInfoMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.TraceInfoMsg.proc arg:ams.ProcId reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.TraceInfoMsg.tstamp arg:algo.UnTime reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.TraceInfoMsg.part arg:u8 reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.TraceInfoMsg.data arg:char reftype:Varlen dflt:"" comment:"" -dmmeta.field field:ams.TraceMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" -dmmeta.field field:ams.TraceMsg.proc arg:ams.ProcId reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.TraceMsg.tstamp arg:algo.UnTime reftype:Val dflt:"" comment:"" -dmmeta.field field:ams.TraceMsg.data arg:u64 reftype:Varlen dflt:"" comment:"" dmmeta.field field:ams.UdpFrame.header arg:ams.MsgHeader reftype:Base dflt:"" comment:"" dmmeta.field field:ams.UdpFrame.timestamp arg:algo.UnTime reftype:Val dflt:"" comment:Timestamp dmmeta.field field:ams.UdpFrame.src_ip arg:ietf.Ipv4 reftype:Val dflt:"" comment:"Source IP" @@ -1990,9 +2034,9 @@ dmmeta.field field:ams.UdpFrame.dst_ip arg:ietf.Ipv4 reftype:Val dflt:"" co dmmeta.field field:ams.UdpFrame.src_port arg:u16 reftype:Val dflt:"" comment:"Source UDP port" dmmeta.field field:ams.UdpFrame.dst_port arg:u16 reftype:Val dflt:"" comment:"Destination UDP port" dmmeta.field field:ams.UdpFrame.payload arg:u8 reftype:Varlen dflt:"" comment:Payload -dmmeta.field field:ams_cat.FDb._db arg:ams_cat.FDb reftype:Global dflt:"" comment:"" -dmmeta.field field:ams_cat.FDb.cmdline arg:command.ams_cat reftype:Val dflt:"" comment:"" dmmeta.field field:ams_sendtest.AmsSendTest.n_msg_send arg:u64 reftype:Val dflt:"" comment:"Number of messages sent" +dmmeta.field field:ams_sendtest.AmsSendTest.off_send arg:u64 reftype:Val dflt:"" comment:"Offset sent" +dmmeta.field field:ams_sendtest.AmsSendTest.off_recv arg:u64 reftype:Val dflt:"" comment:"Offset received" dmmeta.field field:ams_sendtest.AmsSendTest.n_msg_recv arg:u64 reftype:Val dflt:"" comment:"Number of messages received" dmmeta.field field:ams_sendtest.AmsSendTest.n_write_wait arg:u64 reftype:Val dflt:"" comment:"Number of waits by parent" dmmeta.field field:ams_sendtest.AmsSendTest.n_msg_limit arg:u64 reftype:Val dflt:1000000 comment:"Limit of messages to send" @@ -2000,18 +2044,19 @@ dmmeta.field field:ams_sendtest.AmsSendTest.h_write arg:algo_lib.FTimehook re dmmeta.field field:ams_sendtest.AmsSendTest.sum_recv_latency arg:u64 reftype:Val dflt:"" comment:"" dmmeta.field field:ams_sendtest.FChild.child arg:command.ams_sendtest reftype:Exec dflt:"" comment:"" dmmeta.field field:ams_sendtest.FChild.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"" -dmmeta.field field:ams_sendtest.FDb.c_out arg:lib_ams.FStream reftype:Ptr dflt:"" comment:"Output goes here" +dmmeta.field field:ams_sendtest.FDb.c_out arg:lib_ams.FShm reftype:Ptr dflt:"" comment:"Output goes here" dmmeta.field field:ams_sendtest.FDb._db arg:ams_sendtest.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:ams_sendtest.FDb.cmdline arg:command.ams_sendtest reftype:Val dflt:"" comment:"" dmmeta.field field:ams_sendtest.FDb.ams_send_test arg:ams_sendtest.AmsSendTest reftype:Val dflt:"" comment:"" dmmeta.field field:ams_sendtest.FDb.child arg:ams_sendtest.FChild reftype:Lary dflt:"" comment:"" -dmmeta.field field:amsdb.ProcType.proctype arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" -dmmeta.field field:amsdb.ProcType.id arg:u32 reftype:Val dflt:"" comment:"" -dmmeta.field field:amsdb.ProcType.ns arg:dmmeta.Ns reftype:Pkey dflt:"" comment:"" -dmmeta.field field:amsdb.ProcType.comment arg:algo.Comment reftype:Val dflt:"" comment:"" -dmmeta.field field:amsdb.StreamType.streamtype arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" -dmmeta.field field:amsdb.StreamType.id arg:ams.StreamType reftype:Val dflt:"" comment:"" -dmmeta.field field:amsdb.StreamType.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:amsdb.Proctype.proctype arg:dmmeta.Ns reftype:Pkey dflt:"" comment:"" +dmmeta.field field:amsdb.Proctype.id arg:u32 reftype:Val dflt:"" comment:"" +dmmeta.field field:amsdb.Proctype.ns arg:dmmeta.Ns reftype:Pkey dflt:"" comment:"" +dmmeta.field field:amsdb.Proctype.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:amsdb.Shmtype.shmtype arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:amsdb.Shmtype.id arg:ams.Shmtype reftype:Val dflt:"" comment:"" +dmmeta.field field:amsdb.Shmtype.nonblock arg:bool reftype:Val dflt:"" comment:"Non-blocking (lossy) stream" +dmmeta.field field:amsdb.Shmtype.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:apm.FCtype.base arg:dmmeta.Ctype reftype:Base dflt:"" comment:"" dmmeta.field field:apm.FCtype.c_ssimfile arg:apm.FSsimfile reftype:Ptr dflt:"" comment:"" dmmeta.field field:apm.FCtype.c_field arg:apm.FField reftype:Ptrary dflt:"" comment:"" @@ -2205,6 +2250,8 @@ dmmeta.field field:atf_amc.FDb.optalloc arg:atf_amc.OptAlloc reftype:Lpool d dmmeta.field field:atf_amc.FDb.varlenalloc arg:atf_amc.VarlenAlloc reftype:Lpool dflt:"" comment:"" dmmeta.field field:atf_amc.FDb.optg arg:atf_amc.FOptG reftype:Lpool dflt:"" comment:"" dmmeta.field field:atf_amc.FDb.c_typek arg:atf_amc.FTypeK reftype:Ptrary dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.c_typel arg:atf_amc.FTypeL reftype:Ptrary dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.c_typem arg:atf_amc.FTypeM reftype:Ptrary dflt:"" comment:"" dmmeta.field field:atf_amc.FDb.avl arg:atf_amc.FAvl reftype:Lary dflt:"" comment:"" dmmeta.field field:atf_amc.FDb.tr_avl arg:atf_amc.FAvl reftype:Atree dflt:"" comment:"" dmmeta.field field:atf_amc.FDb.listtype arg:atf_amc.FListtype reftype:Inlary dflt:"" comment:"" @@ -2213,6 +2260,17 @@ dmmeta.field field:atf_amc.FDb.typed arg:atf_amc.FTypeD reftype:Tpool dflt:" dmmeta.field field:atf_amc.FDb.bytebuf_dyn arg:atf_amc.BytebufDyn reftype:Cppstack dflt:"" comment:"Provides default name for variables of this type" dmmeta.field field:atf_amc.FDb.ind_thash_elem arg:atf_amc.FThashElem reftype:Thash dflt:"" comment:"" dmmeta.field field:atf_amc.FDb.thash_elem arg:atf_amc.FThashElem reftype:Lary dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.hashable arg:atf_amc.Hashable reftype:Tpool dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.ind_hashable arg:atf_amc.Hashable reftype:Thash dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.time_entry arg:atf_amc.FTimeEntry reftype:Tpool dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.bh_time_entry arg:atf_amc.FTimeEntry reftype:Bheap dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.timehook_recur_counter arg:u64 reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.timehook_once_counter arg:u64 reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.ind_linear arg:atf_amc.FHashableLinear reftype:Thash dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.hashable_linear arg:atf_amc.FHashableLinear reftype:Tpool dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.strkey arg:atf_amc.Strkey reftype:Tpool dflt:"" comment:"" +dmmeta.field field:atf_amc.FDb.ind_strkey arg:atf_amc.Strkey reftype:Thash dflt:"" comment:"" +dmmeta.field field:atf_amc.FHashableLinear.key arg:algo.U32LinearKey reftype:Val dflt:"" comment:"" dmmeta.field field:atf_amc.FListtype.base arg:dmmeta.Listtype reftype:Base dflt:"" comment:"" dmmeta.field field:atf_amc.FListtype.step arg:atf_amc.FListtype reftype:Hook dflt:"" comment:"" dmmeta.field field:atf_amc.FListtype.seen arg:bool reftype:Val dflt:"" comment:"" @@ -2220,6 +2278,7 @@ dmmeta.field field:atf_amc.FOptG.optg arg:atf_amc.OptG reftype:Base dflt:"" dmmeta.field field:atf_amc.FPerfSortString.orig arg:atf_amc.Cstr reftype:Tary dflt:"" comment:"" dmmeta.field field:atf_amc.FPerfSortString.sorted1 arg:atf_amc.Cstr reftype:Tary dflt:"" comment:"" dmmeta.field field:atf_amc.FThashElem.key arg:u64 reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_amc.FTimeEntry.time arg:algo.SchedTime reftype:Val dflt:"" comment:"" dmmeta.field field:atf_amc.FTypeA.msghdr arg:atf_amc.TypeA reftype:Base dflt:"" comment:"" dmmeta.field field:atf_amc.FTypeA.typec arg:atf_amc.FTypeC reftype:Inlary dflt:"" comment:"" dmmeta.field field:atf_amc.FTypeA.zdl_typeb arg:atf_amc.FTypeB reftype:Llist dflt:"" comment:"List of TypeBs" @@ -2229,12 +2288,16 @@ dmmeta.field field:atf_amc.FTypeB.msghdr arg:atf_amc.TypeB reftype:Base dflt dmmeta.field field:atf_amc.FTypeC.msghdr arg:atf_amc.TypeC reftype:Base dflt:"" comment:"" dmmeta.field field:atf_amc.FTypeD.msghdr arg:atf_amc.TypeC reftype:Base dflt:"" comment:"" dmmeta.field field:atf_amc.FTypeK.value arg:u32 reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_amc.FTypeL.value arg:u32 reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_amc.FTypeM.value arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:atf_amc.FTypeS.msghdr arg:atf_amc.TypeS reftype:Base dflt:"" comment:"" dmmeta.field field:atf_amc.FTypeS.zdl_typet arg:atf_amc.FTypeT reftype:Llist dflt:"" comment:"List of TypeTs" dmmeta.field field:atf_amc.FTypeT.msghdr arg:atf_amc.TypeT reftype:Base dflt:"" comment:"" dmmeta.field field:atf_amc.FUnitSort.tary arg:atf_amc.TypeA reftype:Tary dflt:"" comment:"" dmmeta.field field:atf_amc.FUnitSort.c_ptrary arg:atf_amc.TypeA reftype:Ptrary dflt:"" comment:"" dmmeta.field field:atf_amc.FUnitSort.fixary arg:atf_amc.TypeA reftype:Inlary dflt:"" comment:"" +dmmeta.field field:atf_amc.Hashable.hashable arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_amc.Hashable.key arg:algo.U64Ary reftype:Val dflt:"" comment:"" dmmeta.field field:atf_amc.Hooktype.callback arg:atf_amc.Hooktype reftype:Hook dflt:"" comment:"" dmmeta.field field:atf_amc.Hooktype.value arg:i32 reftype:Val dflt:"" comment:"" dmmeta.field field:atf_amc.InlaryPrint.fixary arg:u32 reftype:Inlary dflt:"" comment:"" @@ -2368,6 +2431,7 @@ dmmeta.field field:atf_amc.Seqmsg.msghdr arg:atf_amc.MsgHeader reftype:Base dmmeta.field field:atf_amc.Seqmsg.payload arg:atf_amc.MsgHeader reftype:Opt dflt:"" comment:"Message header for the payload" dmmeta.field field:atf_amc.SortedStr.novs arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:atf_amc.SortedStr.vs arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_amc.Strkey.strkey arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:atf_amc.TaryU32.tary_u32 arg:u32 reftype:Tary dflt:44 comment:"" dmmeta.field field:atf_amc.TaryU8.ary arg:u8 reftype:Tary dflt:44 comment:"" dmmeta.field field:atf_amc.TestRegx1.val arg:dev.Target reftype:RegxSql dflt:"" comment:"" @@ -2400,6 +2464,22 @@ dmmeta.field field:atf_amc.TypeT.j arg:i32 reftype:Val dflt:"" comment:"" dmmeta.field field:atf_amc.TypeTVal.types arg:atf_amc.TypeS reftype:Val dflt:"" comment:"" dmmeta.field field:atf_amc.TypeTVal.j arg:i32 reftype:Val dflt:"" comment:"" dmmeta.field field:atf_amc.Typefconst.value arg:u32 reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2Msg.base arg:atf_amc.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2Msg.s1 arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2Msg.s2 arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2Msg.s3 arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2aMsg.base arg:atf_amc.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2aMsg.u1 arg:u32 reftype:Varlen dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2aMsg.u2 arg:u32 reftype:Varlen dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2aMsg.u3 arg:u32 reftype:Varlen dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2mMsg.base arg:atf_amc.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2mMsg.m1 arg:atf_amc.MsgHeader reftype:Varlen dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2mMsg.m2 arg:atf_amc.MsgHeader reftype:Varlen dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2mMsg.m3 arg:atf_amc.MsgHeader reftype:Varlen dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2vMsg.base arg:atf_amc.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2vMsg.v1 arg:atf_amc.VarlenK reftype:Varlen dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2vMsg.v2 arg:atf_amc.VarlenK reftype:Varlen dflt:"" comment:"" +dmmeta.field field:atf_amc.Varlen2vMsg.v3 arg:atf_amc.VarlenK reftype:Varlen dflt:"" comment:"" dmmeta.field field:atf_amc.VarlenAlloc.length arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:atf_amc.VarlenAlloc.elem arg:i32 reftype:Varlen dflt:"" comment:"" dmmeta.field field:atf_amc.VarlenExtern.length arg:u32 reftype:Val dflt:"" comment:"" @@ -2427,7 +2507,7 @@ dmmeta.field field:atf_ci.FDb.scriptfile arg:atf_ci.FScriptfile reftype:Lary dmmeta.field field:atf_ci.FDb.ind_scriptfile arg:atf_ci.FScriptfile reftype:Thash dflt:"" comment:"" dmmeta.field field:atf_ci.FDb.ns arg:atf_ci.FNs reftype:Lary dflt:"" comment:"" dmmeta.field field:atf_ci.FDb.ind_ns arg:atf_ci.FNs reftype:Thash dflt:"" comment:"" -dmmeta.field field:atf_ci.FDb.readme arg:atf_ci.FReadme reftype:Lary dflt:"" comment:"" +dmmeta.field field:atf_ci.FDb.readmefile arg:atf_ci.FReadmefile reftype:Lary dflt:"" comment:"" dmmeta.field field:atf_ci.FDb.builddir arg:atf_ci.FBuilddir reftype:Lary dflt:"" comment:"" dmmeta.field field:atf_ci.FDb.cfg arg:atf_ci.FCfg reftype:Lary dflt:"" comment:"" dmmeta.field field:atf_ci.FDb.ind_builddir arg:atf_ci.FBuilddir reftype:Thash dflt:"" comment:"" @@ -2441,6 +2521,7 @@ dmmeta.field field:atf_ci.FDb.file arg:atf_ci.File reftype:Lary dflt:"" com dmmeta.field field:atf_ci.FDb.ind_file arg:atf_ci.File reftype:Thash dflt:"" comment:"" dmmeta.field field:atf_ci.FDb.sandbox_need_init arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:atf_ci.FDb.cipackage arg:atf_ci.FCipackage reftype:Lary dflt:"" comment:"" +dmmeta.field field:atf_ci.FDb.called_npm_install arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:atf_ci.FGitfile.base arg:dev.Gitfile reftype:Base dflt:"" comment:"" dmmeta.field field:atf_ci.FGitfile.c_noindent arg:atf_ci.FNoindent reftype:Ptr dflt:"" comment:"" dmmeta.field field:atf_ci.FGitfile.c_scriptfile arg:atf_ci.FScriptfile reftype:Ptr dflt:"" comment:"" @@ -2448,7 +2529,7 @@ dmmeta.field field:atf_ci.FGitfile.c_targsrc arg:atf_ci.FTargsrc reftype:Ptr dmmeta.field field:atf_ci.FMsgfile.base arg:dev.Msgfile reftype:Base dflt:"" comment:"" dmmeta.field field:atf_ci.FNoindent.base arg:dev.Noindent reftype:Base dflt:"" comment:"" dmmeta.field field:atf_ci.FNs.base arg:dmmeta.Ns reftype:Base dflt:"" comment:"" -dmmeta.field field:atf_ci.FReadme.base arg:dev.Readme reftype:Base dflt:"" comment:"" +dmmeta.field field:atf_ci.FReadmefile.base arg:dev.Readmefile reftype:Base dflt:"" comment:"" dmmeta.field field:atf_ci.FScriptfile.base arg:dev.Scriptfile reftype:Base dflt:"" comment:"" dmmeta.field field:atf_ci.FSsimfile.base arg:dmmeta.Ssimfile reftype:Base dflt:"" comment:"" dmmeta.field field:atf_ci.FTargsrc.base arg:dev.Targsrc reftype:Base dflt:"" comment:"" @@ -2468,21 +2549,24 @@ dmmeta.field field:atf_comp.FComptest.start arg:algo.SchedTime reftype:Val d dmmeta.field field:atf_comp.FComptest.finish arg:algo.SchedTime reftype:Val dflt:"" comment:"" dmmeta.field field:atf_comp.FComptest.elapsed arg:double reftype:Val dflt:"" comment:"" dmmeta.field field:atf_comp.FComptest.thook arg:algo_lib.FTimehook reftype:Val dflt:"" comment:"" -dmmeta.field field:atf_comp.FComptest.success arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_comp.FComptest.success arg:bool reftype:Val dflt:"" comment:"Success so far" +dmmeta.field field:atf_comp.FComptest.nrun arg:i32 reftype:Val dflt:"" comment:"Number of times the test ran" dmmeta.field field:atf_comp.FComptest.file_memcheck arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:atf_comp.FComptest.file_callgrind_log arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:atf_comp.FComptest.file_callgrind_out arg:algo.cstring reftype:Val dflt:"" comment:"" -dmmeta.field field:atf_comp.FComptest.covdir arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:atf_comp.FComptest.zd_tmsg arg:atf_comp.FTmsg reftype:Llist dflt:"" comment:"" dmmeta.field field:atf_comp.FComptest.need_write arg:bool reftype:Val dflt:"" comment:"Component test modified during runtime, needs to be written back" dmmeta.field field:atf_comp.FComptest.err arg:algo.cstring reftype:Val dflt:"" comment:"Error string" dmmeta.field field:atf_comp.FComptest.filter_command arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_comp.FComptest.c_covdir arg:atf_comp.FCovdir reftype:Ptr dflt:"" comment:"" +dmmeta.field field:atf_comp.FComptest.dir arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_comp.FCovdir.covdir arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:atf_comp.FDb._db arg:atf_comp.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:atf_comp.FDb.cmdline arg:command.atf_comp reftype:Val dflt:"" comment:"" dmmeta.field field:atf_comp.FDb.tempdir arg:algo.cstring reftype:Val dflt:'"temp/atf_comp"' comment:"" dmmeta.field field:atf_comp.FDb.comptest arg:atf_comp.FComptest reftype:Lary dflt:"" comment:"" dmmeta.field field:atf_comp.FDb.ind_comptest arg:atf_comp.FComptest reftype:Thash dflt:"" comment:"" -dmmeta.field field:atf_comp.FDb.compdir arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_comp.FDb.bindir arg:algo.cstring reftype:Val dflt:"" comment:"Directory with binaries" dmmeta.field field:atf_comp.FDb.report arg:report.atf_comp reftype:Val dflt:"" comment:"Final report" dmmeta.field field:atf_comp.FDb.zd_sel_comptest arg:atf_comp.FComptest reftype:Llist dflt:"" comment:"" dmmeta.field field:atf_comp.FDb.targs arg:atf_comp.FTargs reftype:Tpool dflt:"" comment:"" @@ -2494,6 +2578,11 @@ dmmeta.field field:atf_comp.FDb.zd_out_comptest arg:atf_comp.FComptest reftyp dmmeta.field field:atf_comp.FDb.nchange arg:i32 reftype:Val dflt:"" comment:"" dmmeta.field field:atf_comp.FDb.zd_out_tfilt arg:atf_comp.FTfilt reftype:Llist dflt:"" comment:"" dmmeta.field field:atf_comp.FDb.zd_out_targs arg:atf_comp.FTargs reftype:Llist dflt:"" comment:"" +dmmeta.field field:atf_comp.FDb.covdir arg:atf_comp.FCovdir reftype:Lary dflt:"" comment:"" +dmmeta.field field:atf_comp.FDb.zd_covdir_free arg:atf_comp.FCovdir reftype:Llist dflt:"" comment:"" +dmmeta.field field:atf_comp.FDb.ncore_used arg:i32 reftype:Val dflt:"" comment:"Number of cores 'used' by running child tests" +dmmeta.field field:atf_comp.FDb.ind_tfilt arg:atf_comp.FTfilt reftype:Thash dflt:"" comment:"" +dmmeta.field field:atf_comp.FDb.th_runtest arg:algo_lib.FTimehook reftype:Val dflt:"" comment:"" dmmeta.field field:atf_comp.FTargs.base arg:atfdb.Targs reftype:Base dflt:"" comment:"" dmmeta.field field:atf_comp.FTfilt.base arg:atfdb.Tfilt reftype:Base dflt:"" comment:"" dmmeta.field field:atf_comp.FTmsg.base arg:atfdb.Tmsg reftype:Base dflt:"" comment:"" @@ -2531,6 +2620,33 @@ dmmeta.field field:atf_cov.FTargsrc.p_gitfile arg:atf_cov.FGitfile reftype:Up dmmeta.field field:atf_cov.FTargsrc.p_target arg:atf_cov.FTarget reftype:Upptr dflt:"" comment:"" dmmeta.field field:atf_cov.FTgtcov.base arg:dev.Tgtcov reftype:Base dflt:"" comment:"" dmmeta.field field:atf_cov.Phase.value arg:u8 reftype:Val dflt:0 comment:"" +dmmeta.field field:atf_exp.FDb._db arg:atf_exp.FDb reftype:Global dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.cmdline arg:command.atf_exp reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.proc arg:atf_exp.FProc reftype:Tpool dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.ind_proc arg:atf_exp.FProc reftype:Thash dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.zd_proc arg:atf_exp.FProc reftype:Llist dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.cd_proc_read arg:atf_exp.FProc reftype:Llist dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.cd_proc_outflow arg:atf_exp.FProc reftype:Llist dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.R arg:algo_lib.Replscope reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.ind_proc_pid arg:atf_exp.FProc reftype:Thash dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.c_proc_read arg:atf_exp.FProc reftype:Ptr dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.proc_read_until arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.fdin arg:atf_exp.FFdin reftype:Tpool dflt:"" comment:input +dmmeta.field field:atf_exp.FDb.cd_fdin_eof arg:atf_exp.FFdin reftype:Llist dflt:"" comment:"End reading from stdin" +dmmeta.field field:atf_exp.FDb.cd_fdin_read arg:atf_exp.FFdin reftype:Llist dflt:"" comment:"Read next message from file descriptor" +dmmeta.field field:atf_exp.FDb.cd_fdin_suspend arg:atf_exp.FFdin reftype:Llist dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.timeout arg:algo_lib.FTimehook reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_exp.FDb.vars_file arg:algo_lib.FFildes reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_exp.FFdin.in arg:char reftype:Fbuf dflt:"'\\n'" comment:"" +dmmeta.field field:atf_exp.FProc.base arg:atf_exp.Proc reftype:Base dflt:"" comment:"" +dmmeta.field field:atf_exp.FProc.bash arg:command.bash_proc reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_exp.FProc.in arg:char reftype:Fbuf dflt:"'\\n'" comment:"" +dmmeta.field field:atf_exp.FProc.out arg:char reftype:Fbuf dflt:"'\\n'" comment:"" +dmmeta.field field:atf_exp.FProc.pid arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_exp.FProc.out_delay_close arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_exp.FProc.output arg:algo.ByteAry reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_exp.FProc.wait arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:atf_exp.Proc.proc arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:atf_fuzz.FDb._db arg:atf_fuzz.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:atf_fuzz.FDb.cmdline arg:command.atf_fuzz reftype:Val dflt:"" comment:"" dmmeta.field field:atf_fuzz.FDb.fuzzstrat arg:atf_fuzz.FFuzzstrat reftype:Lary dflt:"" comment:"" @@ -2642,7 +2758,10 @@ dmmeta.field field:atfdb.Comptest.target arg:dmmeta.Ns reftype:Pkey dflt:"" dmmeta.field field:atfdb.Comptest.testname arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:atfdb.Comptest.timeout arg:i32 reftype:Val dflt:10 comment:"" dmmeta.field field:atfdb.Comptest.memcheck arg:bool reftype:Val dflt:true comment:"" +dmmeta.field field:atfdb.Comptest.coverage arg:bool reftype:Val dflt:true comment:"" dmmeta.field field:atfdb.Comptest.exit_code arg:u8 reftype:Val dflt:"" comment:"Exit code to check" +dmmeta.field field:atfdb.Comptest.ncore arg:i32 reftype:Val dflt:1 comment:"" +dmmeta.field field:atfdb.Comptest.repeat arg:i32 reftype:Val dflt:1 comment:"Number of times to repeat the test" dmmeta.field field:atfdb.Comptest.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:atfdb.Fuzzstrat.fuzzstrat arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:atfdb.Fuzzstrat.comment arg:algo.Comment reftype:Val dflt:"" comment:"" @@ -2666,9 +2785,12 @@ dmmeta.field field:atfdb.Tmsg.dir arg:atfdb.Msgdir reftype:Pkey dflt:"" com dmmeta.field field:atfdb.Tmsg.istuple arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:atfdb.Tmsg.msg arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:atfdb.Unittest.unittest arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" -dmmeta.field field:atfdb.Unittest.target arg:dmmeta.Ns reftype:Pkey dflt:"" comment:"" +dmmeta.field field:atfdb.Unittest.ns arg:dmmeta.Ns reftype:Pkey dflt:"" comment:"" dmmeta.field field:atfdb.Unittest.testname arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:atfdb.Unittest.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:atfdb.Var.var arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:atfdb.Var.value arg:algo.Smallstr100 reftype:Val dflt:"" comment:"" +dmmeta.field field:atfdb.Var.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:bash2html.FDb._db arg:bash2html.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:bash2html.FDb.cmdline arg:command.bash2html reftype:Val dflt:"" comment:"" dmmeta.field field:command.abt.target arg:dev.Target reftype:RegxSql dflt:'""' comment:"Regx of target name" @@ -2698,7 +2820,7 @@ dmmeta.field field:command.abt.jcdb arg:algo.cstring reftype:Val dflt:'""' dmmeta.field field:command.abt.cache arg:u8 reftype:Val dflt:"" comment:"Cache mode" dmmeta.field field:command.abt.shortlink arg:bool reftype:Val dflt:"" comment:"Try to shorten sort link if possible" dmmeta.field field:command.abt_md.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" -dmmeta.field field:command.abt_md.readme arg:dev.Readme reftype:RegxSql dflt:'"%"' comment:"Regx of readme to process/show (empty=all)" +dmmeta.field field:command.abt_md.readmefile arg:dev.Readmefile reftype:RegxSql dflt:'"%"' comment:"Regx of readme to process/show (empty=all)" dmmeta.field field:command.abt_md.ns arg:dmmeta.Ns reftype:RegxSql dflt:'""' comment:"(overrides -readme) Process readmes for this namespace" dmmeta.field field:command.abt_md.section arg:algo.cstring reftype:RegxSql dflt:'"%"' comment:"Select specific section to process" dmmeta.field field:command.abt_md.update arg:bool reftype:Val dflt:true comment:"(action) Update mode: Re-generate mdfiles" @@ -2805,6 +2927,7 @@ dmmeta.field field:command.acr_ed.test arg:bool reftype:Val dflt:false comm dmmeta.field field:command.acr_ed.showcpp arg:bool reftype:Val dflt:"" comment:"(With -sandbox), show resulting diff" dmmeta.field field:command.acr_ed.msgtype arg:algo.cstring reftype:Val dflt:'""' comment:"(with -ctype) use this msgtype as type" dmmeta.field field:command.acr_ed.anonfld arg:bool reftype:Val dflt:"" comment:"Create anonfld" +dmmeta.field field:command.acr_ed.amc arg:bool reftype:Val dflt:true comment:"Run amc if needed" dmmeta.field field:command.acr_in.ns arg:dmmeta.Ns reftype:RegxSql dflt:'""' comment:"Regx of matching namespace" dmmeta.field field:command.acr_in.data arg:bool reftype:Val dflt:false comment:"List ssimfile contents" dmmeta.field field:command.acr_in.sigcheck arg:bool reftype:Val dflt:true comment:"Output sigcheck records for schema version mismatch detection" @@ -2831,6 +2954,7 @@ dmmeta.field field:command.amc.in_dir arg:algo.cstring reftype:Val dflt:'"da dmmeta.field field:command.amc.query arg:algo.cstring reftype:Val dflt:'""' comment:"Query mode: generate code for specified object" dmmeta.field field:command.amc.out_dir arg:algo.cstring reftype:Val dflt:'"."' comment:"Root of output cpp dir" dmmeta.field field:command.amc.proto arg:bool reftype:Val dflt:false comment:"Print prototype" +dmmeta.field field:command.amc.showcomment arg:bool reftype:Val dflt:true comment:"Show generated comments" dmmeta.field field:command.amc.report arg:bool reftype:Val dflt:true comment:"Final report" dmmeta.field field:command.amc.e arg:bool reftype:Val dflt:false comment:"Open matching records in editor" dmmeta.field field:command.amc.trace arg:algo.cstring reftype:RegxSql dflt:'""' comment:"Regx of something to trace code generation" @@ -2842,11 +2966,10 @@ dmmeta.field field:command.amc_vis.ctype arg:dmmeta.Ctype reftype:RegxSql df dmmeta.field field:command.amc_vis.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.amc_vis.dot arg:algo.cstring reftype:Val dflt:'""' comment:"Save dot file with specified filename" dmmeta.field field:command.amc_vis.xref arg:bool reftype:Val dflt:false comment:"Include all ctypes referenced by selected ones" -dmmeta.field field:command.amc_vis.xns arg:bool reftype:Val dflt:false comment:"Cross namespace boundaries" +dmmeta.field field:command.amc_vis.xns arg:bool reftype:Val dflt:true comment:"Cross namespace boundaries" dmmeta.field field:command.amc_vis.noinput arg:bool reftype:Val dflt:"" comment:"Deselect module inputs" dmmeta.field field:command.amc_vis.check arg:bool reftype:Val dflt:"" comment:"Check model for dependency problems" dmmeta.field field:command.amc_vis.render arg:bool reftype:Val dflt:true comment:"Produce an ascii drawing" -dmmeta.field field:command.ams_cat.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.ams_sendtest.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.ams_sendtest.id arg:i32 reftype:Val dflt:"" comment:"Process index (0=parent)" dmmeta.field field:command.ams_sendtest.file_prefix arg:algo.cstring reftype:Val dflt:'""' comment:"Use file_prefix" @@ -2890,6 +3013,7 @@ dmmeta.field field:command.apm.binpath arg:algo.cstring reftype:Val dflt:'"b dmmeta.field field:command.aqlite.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.aqlite.schema arg:algo.cstring reftype:Val dflt:'"data"' comment:"Schema dir" dmmeta.field field:command.aqlite.cmd arg:algo.cstring reftype:Val dflt:"" comment:"Sql Query to run" +dmmeta.field field:command.aqlite.ns arg:dmmeta.Ns reftype:RegxSql dflt:'"dmmeta"' comment:"Regx of databases to attach" dmmeta.field field:command.atf_amc.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.atf_amc.amctest arg:atfdb.Amctest reftype:RegxSql dflt:'"%"' comment:"SQL regex, selecting test to run" dmmeta.field field:command.atf_amc.dofork arg:bool reftype:Val dflt:true comment:"Use fork" @@ -2899,6 +3023,7 @@ dmmeta.field field:command.atf_ci.citest arg:atfdb.Citest reftype:RegxSql df dmmeta.field field:command.atf_ci.maxerr arg:i32 reftype:Val dflt:0 comment:"Exit after this many errors" dmmeta.field field:command.atf_ci.cijob arg:atfdb.Cijob reftype:RegxSql dflt:'"%"' comment:"" dmmeta.field field:command.atf_ci.capture arg:bool reftype:Val dflt:"" comment:"Capture the output of the test" +dmmeta.field field:command.atf_ci.check_clean arg:bool reftype:Val dflt:true comment:"Check for modifications after each test" dmmeta.field field:command.atf_cmdline.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.atf_cmdline.exec arg:bool reftype:Val dflt:"" comment:"Execv itself" dmmeta.field field:command.atf_cmdline.astr arg:algo.cstring reftype:Val dflt:"" comment:"Required anon string" @@ -2918,7 +3043,7 @@ dmmeta.field field:command.atf_cmdline.mnum arg:i32 reftype:Tary dflt:"" co dmmeta.field field:command.atf_cmdline.mdbl arg:double reftype:Tary dflt:"" comment:"Double array" dmmeta.field field:command.atf_cmdline.amnum arg:i32 reftype:Tary dflt:"" comment:"Anon number array" dmmeta.field field:command.atf_cmdline.fconst arg:u8 reftype:Val dflt:"" comment:"Fconst for field" -dmmeta.field field:command.atf_cmdline.cconst arg:algo.Month reftype:Val dflt:0 comment:"Fconst for arg ctype" +dmmeta.field field:command.atf_cmdline.cconst arg:algo.Month reftype:Val dflt:"" comment:"Fconst for arg ctype" dmmeta.field field:command.atf_cmdline.dregx arg:dmmeta.Ctype reftype:RegxSql dflt:'"%"' comment:"Predefined regx" dmmeta.field field:command.atf_cmdline.dpkey arg:dmmeta.Ctype reftype:Pkey dflt:'""' comment:"Predefined pkey" dmmeta.field field:command.atf_comp.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" @@ -2932,12 +3057,11 @@ dmmeta.field field:command.atf_comp.e arg:bool reftype:Val dflt:"" comment: dmmeta.field field:command.atf_comp.normalize arg:bool reftype:Val dflt:"" comment:"(action) Renumber and normalize tmsgs" dmmeta.field field:command.atf_comp.covcapture arg:bool reftype:Val dflt:"" comment:"(action) Capture new coverage percentages and save back" dmmeta.field field:command.atf_comp.covcheck arg:bool reftype:Val dflt:"" comment:"(action) Check coverage percentages against tgtcov table" -dmmeta.field field:command.atf_comp.compdir arg:algo.cstring reftype:Val dflt:'""' comment:"Component image directory (exe)" +dmmeta.field field:command.atf_comp.bindir arg:algo.cstring reftype:Val dflt:'""' comment:"Directory with binaries (default: build/cfg)" dmmeta.field field:command.atf_comp.cfg arg:dev.Cfg reftype:Pkey dflt:'"release"' comment:"Set config" dmmeta.field field:command.atf_comp.check_untracked arg:bool reftype:Val dflt:true comment:"Check for untracked file before allowing test to run" -dmmeta.field field:command.atf_comp.maxerr arg:i32 reftype:Val dflt:1 comment:"Exit after this many errors" +dmmeta.field field:command.atf_comp.maxerr arg:i32 reftype:Val dflt:3 comment:"Exit after this many errors" dmmeta.field field:command.atf_comp.build arg:bool reftype:Val dflt:false comment:"Build given cfg before test" -dmmeta.field field:command.atf_comp.ood arg:bool reftype:Val dflt:false comment:"Check given cfg for ood before test" dmmeta.field field:command.atf_comp.memcheck arg:bool reftype:Val dflt:"" comment:"Run under memory checker (valgrind)" dmmeta.field field:command.atf_comp.force arg:bool reftype:Val dflt:"" comment:"(With -memcheck) run suppressed memcheck" dmmeta.field field:command.atf_comp.callgrind arg:bool reftype:Val dflt:"" comment:"Run under callgrind profiler (valgrind)" @@ -2945,8 +3069,11 @@ dmmeta.field field:command.atf_comp.maxjobs arg:i32 reftype:Val dflt:0 comm dmmeta.field field:command.atf_comp.stream arg:bool reftype:Val dflt:"" comment:"prints component's output" dmmeta.field field:command.atf_comp.i arg:bool reftype:Val dflt:"" comment:"Read and execute testcase from stdin" dmmeta.field field:command.atf_comp.write arg:bool reftype:Val dflt:true comment:"(implied with -e) Write any changes back to ssim tables" -dmmeta.field field:command.atf_comp.report arg:bool reftype:Val dflt:"" comment:"Print final report" +dmmeta.field field:command.atf_comp.report arg:bool reftype:Val dflt:true comment:"Print final report" dmmeta.field field:command.atf_comp.b arg:algo.cstring reftype:Val dflt:'""' comment:"Breakpoint passed to mdbg as-is" +dmmeta.field field:command.atf_comp.covfast arg:bool reftype:Val dflt:true comment:"Speedup coverage processing" +dmmeta.field field:command.atf_comp.minrepeat arg:i32 reftype:Val dflt:0 comment:"Execute every comptest at least this many times" +dmmeta.field field:command.atf_comp.maxrepeat arg:i32 reftype:Val dflt:1 comment:"Don't repeat any individual comptest more than X times" dmmeta.field field:command.atf_cov.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.atf_cov.covdir arg:algo.cstring reftype:Val dflt:'"temp/covdata"' comment:"Output directory to save coverage data" dmmeta.field field:command.atf_cov.logfile arg:algo.cstring reftype:Val dflt:'""' comment:"Log file" @@ -2960,6 +3087,14 @@ dmmeta.field field:command.atf_cov.capture arg:bool reftype:Val dflt:"" com dmmeta.field field:command.atf_cov.xmlpretty arg:bool reftype:Val dflt:"" comment:"Generate pretty-formatted XML" dmmeta.field field:command.atf_cov.summary arg:bool reftype:Val dflt:true comment:"Show summary figures" dmmeta.field field:command.atf_cov.check arg:bool reftype:Val dflt:"" comment:"Check coverage information against tgtcov table" +dmmeta.field field:command.atf_cov.incremental arg:bool reftype:Val dflt:"" comment:"Keep *.gcda files from previous run" +dmmeta.field field:command.atf_exp.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" +dmmeta.field field:command.atf_exp.trace arg:algo.cstring reftype:Val dflt:'""' comment:"Regx of things to trace" +dmmeta.field field:command.atf_exp.bindir arg:algo.cstring reftype:Val dflt:'"bin"' comment:"Directory with binaries" +dmmeta.field field:command.atf_exp.comptest arg:atfdb.Comptest reftype:Pkey dflt:'""' comment:"Component test name" +dmmeta.field field:command.atf_exp.tempdir arg:algo.cstring reftype:Val dflt:'""' comment:"Temporary directory for the component test" +dmmeta.field field:command.atf_exp.timeout arg:double reftype:Val dflt:8.0 comment:"Timeout in seconds for a step" +dmmeta.field field:command.atf_exp.dbgshell arg:bool reftype:Val dflt:false comment:"Invoke bash with curr envs in case of timeout" dmmeta.field field:command.atf_fuzz.reprofile arg:algo.cstring reftype:Val dflt:'"temp/atf_fuzz.repro"' comment:"File where repros are stored" dmmeta.field field:command.atf_fuzz.target arg:dev.Target reftype:Pkey dflt:'""' comment:"Target to fuzz" dmmeta.field field:command.atf_fuzz.args arg:algo.cstring reftype:Val dflt:'""' comment:"Additional arguments to target" @@ -3010,7 +3145,7 @@ dmmeta.field field:command.gcache.force arg:bool reftype:Val dflt:"" commen dmmeta.field field:command.gcli.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.gcli.selector arg:gclidb.Gtbl reftype:Pkey dflt:'"issue:%"' comment:"table:key, where table is issue,repo,mr, etc. and key is a regex." dmmeta.field field:command.gcli.fields arg:algo.cstring reftype:Tary dflt:'""' comment:"additional key:value pairs for use with -create, -list, -update" -dmmeta.field field:command.gcli.accept arg:bool reftype:Val dflt:false comment:"(action) accept a slected merge request" +dmmeta.field field:command.gcli.accept arg:bool reftype:Val dflt:false comment:"(action) accept a selected merge request" dmmeta.field field:command.gcli.start arg:bool reftype:Val dflt:false comment:"(action) start working on a selected issue" dmmeta.field field:command.gcli.list arg:bool reftype:Val dflt:false comment:"(action) show selected table" dmmeta.field field:command.gcli.create arg:bool reftype:Val dflt:false comment:"(action) create a table record(s)" @@ -3024,21 +3159,31 @@ dmmeta.field field:command.gcli.authdir arg:algo.cstring reftype:Val dflt:'" dmmeta.field field:command.gcli.dry_run arg:bool reftype:Val dflt:"" comment:"Print actions, do not perform" dmmeta.field field:command.gcli.gitdir arg:algo.cstring reftype:Val dflt:'""' comment:"(setup) Change directory of git repository" dmmeta.field field:command.gcli.show_gitlab_system_notes arg:bool reftype:Val dflt:"" comment:"(misc) Show issue and mr notes created by gitlab" +dmmeta.field field:command.generic_proc.name arg:command.generic reftype:Exec dflt:'""' comment:"" +dmmeta.field field:command.jkv.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" +dmmeta.field field:command.jkv.file arg:algo.cstring reftype:Val dflt:"" comment:"Filename (use - for stdin)" +dmmeta.field field:command.jkv.kv arg:algo.cstring reftype:Tary dflt:"" comment:"JSON Keyvals" +dmmeta.field field:command.jkv.r arg:bool reftype:Val dflt:"" comment:"Reverse (json keyvals -> JSON) mapping" +dmmeta.field field:command.jkv.write arg:bool reftype:Val dflt:"" comment:"Write the modified file back" +dmmeta.field field:command.jkv.output arg:u8 reftype:Val dflt:0 comment:"Output format" +dmmeta.field field:command.jkv.pretty arg:u32 reftype:Val dflt:2 comment:"Pretty-printer (0-compact; 1=algo style; 2=jq style)" dmmeta.field field:command.mdbg.target arg:dev.Target reftype:Pkey dflt:"" comment:"Executable name" dmmeta.field field:command.mdbg.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.mdbg.args arg:algo.cstring reftype:Tary dflt:'""' comment:"Additional module args" dmmeta.field field:command.mdbg.cfg arg:dev.Cfg reftype:Pkey dflt:'"debug"' comment:"Configuration to use" dmmeta.field field:command.mdbg.disas arg:bool reftype:Val dflt:"" comment:"Show disassembly (use F12)" dmmeta.field field:command.mdbg.attach arg:bool reftype:Val dflt:false comment:"Attach to a running process" +dmmeta.field field:command.mdbg.pid arg:i32 reftype:Val dflt:0 comment:"(with -attach) Pid, if omitted mdbg will guess" dmmeta.field field:command.mdbg.b arg:algo.cstring reftype:Tary dflt:'""' comment:"Set breakpoint, e.g. 'a.cpp:123 if cond1', 'func#3'" dmmeta.field field:command.mdbg.catchthrow arg:bool reftype:Val dflt:true comment:"Stop on exceptions" dmmeta.field field:command.mdbg.tui arg:bool reftype:Val dflt:"" comment:"Use gdb -tui as the debugger" dmmeta.field field:command.mdbg.bcmd arg:algo.cstring reftype:Val dflt:'""' comment:"Evaluate command at breakpoint" dmmeta.field field:command.mdbg.emacs arg:bool reftype:Val dflt:true comment:"Use emacs environment as the debugger" dmmeta.field field:command.mdbg.manywin arg:bool reftype:Val dflt:false comment:"Use gdb-many-windows emacs mode" -dmmeta.field field:command.mdbg.follow_child arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:command.mdbg.follow_child arg:bool reftype:Val dflt:"" comment:"When forking, follow child (default is parent)" dmmeta.field field:command.mdbg.py arg:bool reftype:Val dflt:"" comment:"Enable python scripting" dmmeta.field field:command.mdbg.dry_run arg:bool reftype:Val dflt:"" comment:"Print commands but don't execute" +dmmeta.field field:command.mdbg.mp arg:bool reftype:Val dflt:"" comment:"Multi-process debugging" dmmeta.field field:command.mysql2ssim.writessimfile arg:bool reftype:Val dflt:"" comment:"Write to ssimfile directly" dmmeta.field field:command.mysql2ssim.url arg:algo.cstring reftype:Val dflt:"" comment:"user:pass@host/db or sock:///filename/db" dmmeta.field field:command.mysql2ssim.tables arg:algo.cstring reftype:Val dflt:'""' comment:"comma-separated list of tables. Default is all tables" @@ -3053,13 +3198,21 @@ dmmeta.field field:command.orgfile.dedup arg:algo.cstring reftype:RegxSql df dmmeta.field field:command.orgfile.commit arg:bool reftype:Val dflt:"" comment:"Apply changes" dmmeta.field field:command.orgfile.undo arg:bool reftype:Val dflt:"" comment:"Read previous orgfile output, undoing movement" dmmeta.field field:command.orgfile.hash arg:algo.cstring reftype:Val dflt:'"sha1"' comment:"Hash command to use for deduplication" +dmmeta.field field:command.samp_make.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" +dmmeta.field field:command.samp_make.target arg:sampdb.Target reftype:RegxSql dflt:'"%"' comment:"Create Makefile for selected targets" +dmmeta.field field:command.samp_make.parse_make arg:bool reftype:Val dflt:"" comment:"Parse extern/gnumake/Simple-Makefile" +dmmeta.field field:command.samp_make.makefile arg:algo.cstring reftype:Val dflt:'"extern/gnumake/Simple-Makefile"' comment:"(with parse_make) makefile to parse" +dmmeta.field field:command.samp_make.write arg:bool reftype:Val dflt:"" comment:"P(with parse_make) write ssimfiles, otherwise print them" dmmeta.field field:command.samp_meng.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.samp_regx.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.samp_regx.expr arg:algo.cstring reftype:Val dflt:"" comment:Expression -dmmeta.field field:command.samp_regx.style arg:u8 reftype:Val dflt:0 comment:"Regx style" -dmmeta.field field:command.samp_regx.match arg:bool reftype:Val dflt:"" comment:"Match a string" +dmmeta.field field:command.samp_regx.style arg:algo_lib.RegxStyle reftype:Val dflt:2 comment:"Regx style" +dmmeta.field field:command.samp_regx.trace arg:bool reftype:Val dflt:false comment:"Trace regx innards" +dmmeta.field field:command.samp_regx.capture arg:bool reftype:Val dflt:false comment:"Use capture groups" +dmmeta.field field:command.samp_regx.full arg:bool reftype:Val dflt:true comment:"Match full string" +dmmeta.field field:command.samp_regx.f arg:bool reftype:Val dflt:false comment:" is a filename, grep the lines" +dmmeta.field field:command.samp_regx.match arg:bool reftype:Val dflt:"" comment:"Match a string, exit code represnts success" dmmeta.field field:command.samp_regx.string arg:algo.cstring reftype:Val dflt:'""' comment:"String to match" -dmmeta.field field:command.samp_regx.show arg:bool reftype:Val dflt:false comment:"Show regx innards" dmmeta.field field:command.sandbox.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.sandbox.name arg:dev.Sandbox reftype:RegxSql dflt:"" comment:"Sandbox name" dmmeta.field field:command.sandbox.create arg:bool reftype:Val dflt:"" comment:"Create new sandbox and register in dev.sandbox" @@ -3072,29 +3225,34 @@ dmmeta.field field:command.sandbox.gc arg:bool reftype:Val dflt:"" comment: dmmeta.field field:command.sandbox.cmd arg:algo.cstring reftype:Tary dflt:"" comment:"Command to execute in sandbox" dmmeta.field field:command.sandbox.diff arg:bool reftype:Val dflt:"" comment:"Show diff after running command" dmmeta.field field:command.sandbox.files arg:algo.cstring reftype:Tary dflt:"" comment:"Shell regx to diff" -dmmeta.field field:command.sandbox.refs arg:algo.cstring reftype:Val dflt:'"HEAD"' comment:"Refs to fetch into sandbox" +dmmeta.field field:command.sandbox.refs arg:algo.cstring reftype:Val dflt:'"HEAD"' comment:"Additional list of refs to fetch into sandbox" +dmmeta.field field:command.sandbox.ref arg:algo.cstring reftype:Val dflt:'"HEAD"' comment:"Reset to this ref" dmmeta.field field:command.sandbox.q arg:bool reftype:Val dflt:"" comment:"Quiet mode" dmmeta.field field:command.src_func.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" -dmmeta.field field:command.src_func.target arg:dev.Target reftype:RegxSql dflt:'"%"' comment:"Visit these targets" -dmmeta.field field:command.src_func.name arg:algo.cstring reftype:RegxSql dflt:'"%"' comment:"Match function name" -dmmeta.field field:command.src_func.body arg:algo.cstring reftype:RegxSql dflt:'"%"' comment:"Match function body" -dmmeta.field field:command.src_func.targsrc arg:dev.Targsrc reftype:RegxSql dflt:'""' comment:"Visit these sources (optional)" -dmmeta.field field:command.src_func.func arg:algo.cstring reftype:RegxSql dflt:'"%"' comment:"(with -listfunc) Match function prototype" -dmmeta.field field:command.src_func.comment arg:algo.cstring reftype:RegxSql dflt:'"%"' comment:"(with -listfunc) Match function comment" -dmmeta.field field:command.src_func.nextfile arg:dev.Gitfile reftype:Pkey dflt:'""' comment:"Print name of next srcfile in targsrc list" -dmmeta.field field:command.src_func.other arg:bool reftype:Val dflt:false comment:"(with -nextfile), name of previous file" -dmmeta.field field:command.src_func.updateproto arg:bool reftype:Val dflt:false comment:"Update prototypes in headers" -dmmeta.field field:command.src_func.listfunc arg:bool reftype:Val dflt:false comment:"Show functions in target" -dmmeta.field field:command.src_func.iffy arg:bool reftype:Val dflt:false comment:"Select functions that may contain errors" -dmmeta.field field:command.src_func.proto arg:bool reftype:Val dflt:false comment:"(with -listfunc) List prototypes only" -dmmeta.field field:command.src_func.gen arg:bool reftype:Val dflt:false comment:"(with -listfunc) Visit generated files" -dmmeta.field field:command.src_func.showloc arg:bool reftype:Val dflt:true comment:"(with -listfunc) Show file location" -dmmeta.field field:command.src_func.showstatic arg:bool reftype:Val dflt:true comment:"(with -listfunc) Show static functions" -dmmeta.field field:command.src_func.showsortkey arg:bool reftype:Val dflt:false comment:"(with -listfunc) Display function sortkey" -dmmeta.field field:command.src_func.sortname arg:bool reftype:Val dflt:false comment:"(with -listfunc) Sort functions by name" -dmmeta.field field:command.src_func.e arg:bool reftype:Val dflt:false comment:"(with -listfunc) Edit found functions" +dmmeta.field field:command.src_func.targsrc arg:dev.Targsrc reftype:RegxSql dflt:'"%"' comment:"(scan) Limit scanning to these sources only" +dmmeta.field field:command.src_func.acrkey arg:algo.cstring reftype:RegxSql dflt:'"%"' comment:"Select function by acr key that caused it" +dmmeta.field field:command.src_func.func arg:dev.Target reftype:RegxSql dflt:'"%"' comment:"Target.function regex" +dmmeta.field field:command.src_func.nextfile arg:dev.Gitfile reftype:Pkey dflt:'""' comment:"(action) Print name of next srcfile in targsrc list" +dmmeta.field field:command.src_func.other arg:bool reftype:Val dflt:false comment:" (with -nextfile), name of previous file" +dmmeta.field field:command.src_func.list arg:bool reftype:Val dflt:false comment:"(action) List matching functions" +dmmeta.field field:command.src_func.updateproto arg:bool reftype:Val dflt:false comment:"(action) Update prototypes in headers" +dmmeta.field field:command.src_func.createmissing arg:bool reftype:Val dflt:"" comment:"(action) Create missing functions declared in userfunc table" +dmmeta.field field:command.src_func.iffy arg:bool reftype:Val dflt:false comment:"(filter) Select functions that may contain errors" +dmmeta.field field:command.src_func.gen arg:bool reftype:Val dflt:false comment:"(scan) Scan generated files" +dmmeta.field field:command.src_func.showloc arg:bool reftype:Val dflt:false comment:"(output) Show file location" +dmmeta.field field:command.src_func.f arg:bool reftype:Val dflt:false comment:"(output) -sortname -showcomment -showbody" +dmmeta.field field:command.src_func.showstatic arg:bool reftype:Val dflt:true comment:"(filter) Allow static functions" +dmmeta.field field:command.src_func.matchproto arg:algo.cstring reftype:RegxSql dflt:'"%"' comment:"(filter) Match function prototype" +dmmeta.field field:command.src_func.matchbody arg:algo.cstring reftype:RegxSql dflt:'"%"' comment:"(filter) Match function body" +dmmeta.field field:command.src_func.matchcomment arg:algo.cstring reftype:RegxSql dflt:'"%"' comment:"(filter) Match function comment" +dmmeta.field field:command.src_func.showsortkey arg:bool reftype:Val dflt:false comment:"(output) Display function sortkey" +dmmeta.field field:command.src_func.showcomment arg:bool reftype:Val dflt:false comment:"(output) Display function comment" +dmmeta.field field:command.src_func.showbody arg:bool reftype:Val dflt:false comment:"(output) Print function body" +dmmeta.field field:command.src_func.sortname arg:bool reftype:Val dflt:false comment:"(output) Sort functions by name" +dmmeta.field field:command.src_func.printssim arg:bool reftype:Val dflt:false comment:"(output) Print ssim tuples" +dmmeta.field field:command.src_func.e arg:bool reftype:Val dflt:false comment:"Edit found functions" dmmeta.field field:command.src_func.baddecl arg:bool reftype:Val dflt:"" comment:"Report and fail on bad declarations" -dmmeta.field field:command.src_func.report arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:command.src_func.report arg:bool reftype:Val dflt:"" comment:"Print final report" dmmeta.field field:command.src_hdr.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:command.src_hdr.targsrc arg:dev.Targsrc reftype:RegxSql dflt:'""' comment:"Regx of targsrc to update" dmmeta.field field:command.src_hdr.write arg:bool reftype:Val dflt:"" comment:"Update files in-place" @@ -3181,7 +3339,7 @@ dmmeta.field field:dev.Covfile.exe arg:u32 reftype:Val dflt:"" comment:"Exe dmmeta.field field:dev.Covfile.exer arg:algo.U32Dec2 reftype:Val dflt:"" comment:"Percentage of executable lines" dmmeta.field field:dev.Covfile.hit arg:u32 reftype:Val dflt:"" comment:"Exercised lines" dmmeta.field field:dev.Covfile.cov arg:algo.U32Dec2 reftype:Val dflt:"" comment:"Line coverage" -dmmeta.field field:dev.Covline.covline arg:algo.Smallstr200 reftype:Val dflt:"" comment:file:line +dmmeta.field field:dev.Covline.covline arg:algo.cstring reftype:Val dflt:"" comment:"Key: file:line" dmmeta.field field:dev.Covline.src arg:dev.Gitfile reftype:Pkey dflt:"" comment:"Source file" dmmeta.field field:dev.Covline.line arg:u32 reftype:Val dflt:"" comment:"Source line" dmmeta.field field:dev.Covline.flag arg:char reftype:Val dflt:"'N'" comment:Flag @@ -3242,6 +3400,9 @@ dmmeta.field field:dev.Mdsection.comment arg:algo.Comment reftype:Val dflt:" dmmeta.field field:dev.Msgfile.gitfile arg:dev.Gitfile reftype:Pkey dflt:"" comment:"Name of file containing messages" dmmeta.field field:dev.Msgfile.strict arg:bool reftype:Val dflt:"" comment:"Delete unrecognizable lines (except comments)" dmmeta.field field:dev.Msgfile.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Netproto.netproto arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Netproto.tls arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Netproto.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Noindent.gitfile arg:dev.Gitfile reftype:Pkey dflt:"" comment:"" dmmeta.field field:dev.Noindent.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dev.OptType.opt_type arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" @@ -3258,15 +3419,21 @@ dmmeta.field field:dev.Pkgdep.soft arg:bool reftype:Val dflt:"" comment:"So dmmeta.field field:dev.Pkgdep.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Pkgkey.pkgkey arg:algo.Smallstr150 reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Pkgkey.package arg:dev.Package reftype:Pkey dflt:"" comment:"Parent package" -dmmeta.field field:dev.Pkgkey.key arg:algo.Smallstr150 reftype:Val dflt:"" comment:"Acr query (regx)" +dmmeta.field field:dev.Pkgkey.key arg:algo.Smallstr150 reftype:Val dflt:"" comment:"Acr query (regx) - named key for clarity" dmmeta.field field:dev.Pkgkey.comment arg:algo.Comment reftype:Val dflt:"" comment:"" -dmmeta.field field:dev.Readme.gitfile arg:dev.Gitfile reftype:Pkey dflt:"" comment:"" -dmmeta.field field:dev.Readme.inl arg:bool reftype:Val dflt:"" comment:"" -dmmeta.field field:dev.Readme.sandbox arg:bool reftype:Val dflt:"" comment:"" -dmmeta.field field:dev.Readme.filter arg:algo.Smallstr100 reftype:Val dflt:"" comment:"" -dmmeta.field field:dev.Readme.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Prototransport.prototransport arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Prototransport.netproto arg:dev.Netproto reftype:Pkey dflt:"" comment:"" +dmmeta.field field:dev.Prototransport.transport arg:dev.Transport reftype:Pkey dflt:"" comment:"" +dmmeta.field field:dev.Prototransport.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Readmefile.gitfile arg:dev.Gitfile reftype:Pkey dflt:"" comment:"" +dmmeta.field field:dev.Readmefile.inl arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Readmefile.sandbox arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Readmefile.filter arg:algo.Smallstr100 reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Readmefile.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Readmesort.readmesort arg:algo.Smallstr250 reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Readmesort.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Rpm.rpm arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Rpm.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Sandbox.sandbox arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Sandbox.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Sbpath.sbpath arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" @@ -3286,7 +3453,6 @@ dmmeta.field field:dev.Syscmd.nprereq arg:i32 reftype:Val dflt:"" comment:" dmmeta.field field:dev.Syscmd.fail_prereq arg:bool reftype:Val dflt:"" comment:"Set if one of pre-requisites fails" dmmeta.field field:dev.Syscmd.completed arg:bool reftype:Val dflt:"" comment:"Completed?" dmmeta.field field:dev.Syscmd.maxtime arg:i32 reftype:Val dflt:0 comment:"Optional max running time (used to use SIGALRM)" -dmmeta.field field:dev.Syscmddep.syscmddep arg:algo.RspaceStr16 reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Syscmddep.child arg:dev.Syscmd reftype:Pkey dflt:"" comment:"" dmmeta.field field:dev.Syscmddep.parent arg:dev.Syscmd reftype:Pkey dflt:"" comment:"" dmmeta.field field:dev.Syslib.syslib arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" @@ -3305,6 +3471,7 @@ dmmeta.field field:dev.Targsyslib.targsyslib arg:algo.Smallstr50 reftype:Val dmmeta.field field:dev.Targsyslib.target arg:dev.Target reftype:Pkey dflt:"" comment:"" dmmeta.field field:dev.Targsyslib.syslib arg:dev.Syslib reftype:Pkey dflt:"" comment:"" dmmeta.field field:dev.Targsyslib.uname arg:dev.Uname reftype:Pkey dflt:"" comment:"" +dmmeta.field field:dev.Targsyslib.prefix arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Targsyslib.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Tgtcov.target arg:dev.Target reftype:Pkey dflt:"" comment:Target dmmeta.field field:dev.Tgtcov.cov_min arg:algo.U32Dec2 reftype:Val dflt:"" comment:"Minimal coverage limit" @@ -3323,6 +3490,9 @@ dmmeta.field field:dev.ToolOpt.opt_type arg:dev.OptType reftype:Pkey dflt:"" dmmeta.field field:dev.ToolOpt.opt arg:algo.Smallstr100 reftype:Val dflt:"" comment:"option value" dmmeta.field field:dev.ToolOpt.sortfld arg:algo.Smallstr50 reftype:Val dflt:"" comment:"uname-compiler - sort field" dmmeta.field field:dev.ToolOpt.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Transport.transport arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Transport.ip arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:dev.Transport.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Uname.uname arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Uname.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dev.Unstablefld.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" @@ -3388,6 +3558,12 @@ dmmeta.field field:dmmeta.Charset.comment arg:algo.Comment reftype:Val dflt: dmmeta.field field:dmmeta.Chash.ctype arg:dmmeta.Ctype reftype:Pkey dflt:"" comment:"Target ctype" dmmeta.field field:dmmeta.Chash.hashtype arg:dmmeta.Hashtype reftype:Pkey dflt:"" comment:"Hash type" dmmeta.field field:dmmeta.Chash.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Ckafka.ctype arg:dmmeta.Ctype reftype:Pkey dflt:"" comment:"" +dmmeta.field field:dmmeta.Ckafka.kind arg:dmmeta.KafkaTypeKind reftype:Pkey dflt:"" comment:"" +dmmeta.field field:dmmeta.Ckafka.root arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Ckafka.valid_versions arg:algo.Smallstr10 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Ckafka.flexible_versions arg:algo.Smallstr10 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Ckafka.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Cppfunc.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.Cppfunc.expr arg:algo.CppExpr reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Cppfunc.print arg:bool reftype:Val dflt:"" comment:"" @@ -3422,6 +3598,8 @@ dmmeta.field field:dmmeta.Dispatch.print arg:bool reftype:Val dflt:"" comme dmmeta.field field:dmmeta.Dispatch.haslen arg:bool reftype:Val dflt:"" comment:"Include length in dispatch function" dmmeta.field field:dmmeta.Dispatch.call arg:bool reftype:Val dflt:"" comment:"Generate call to user-defined function" dmmeta.field field:dmmeta.Dispatch.strict arg:bool reftype:Val dflt:"" comment:"Only dispatch if length matches exactly" +dmmeta.field field:dmmeta.Dispatch.dyn arg:bool reftype:Val dflt:"" comment:"Use dynamic memory allocation: new, delete instead of ByteAry" +dmmeta.field field:dmmeta.Dispatch.kafka arg:bool reftype:Val dflt:"" comment:"generate kafka codec" dmmeta.field field:dmmeta.Dispatch.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.DispatchMsg.dispatch_msg arg:algo.Smallstr100 reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.DispatchMsg.dispatch arg:dmmeta.Dispatch reftype:Pkey dflt:"" comment:"" @@ -3464,10 +3642,13 @@ dmmeta.field field:dmmeta.Fbuf.max arg:u32 reftype:Val dflt:"" comment:"Siz dmmeta.field field:dmmeta.Fbuf.fbuftype arg:dmmeta.Fbuftype reftype:Pkey dflt:"" comment:"Type of buffer" dmmeta.field field:dmmeta.Fbuf.insready arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.Fbuf.inseof arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" +dmmeta.field field:dmmeta.Fbuf.iotype arg:dmmeta.Fbufiotype reftype:Pkey dflt:'"standard"' comment:"" dmmeta.field field:dmmeta.Fbuf.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Fbufdir.fbufdir arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Fbufdir.read arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Fbufdir.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Fbufiotype.fbufiotype arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Fbufiotype.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Fbuftype.fbuftype arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Fbuftype.skipbytes arg:bool reftype:Val dflt:"" comment:"Has skipbytes function?" dmmeta.field field:dmmeta.Fbuftype.comment arg:algo.Comment reftype:Val dflt:"" comment:"" @@ -3545,6 +3726,12 @@ dmmeta.field field:dmmeta.Finput.extrn arg:bool reftype:Val dflt:"" comment dmmeta.field field:dmmeta.Finput.update arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Finput.strict arg:bool reftype:Val dflt:true comment:"Exist process if record contains error" dmmeta.field field:dmmeta.Finput.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Fkafka.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" +dmmeta.field field:dmmeta.Fkafka.versions arg:algo.Smallstr10 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Fkafka.nullable_versions arg:algo.Smallstr10 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Fkafka.tagged_versions arg:algo.Smallstr10 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Fkafka.tag arg:u64 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Fkafka.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Fldoffset.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.Fldoffset.offset arg:i32 reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Floadtuples.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" @@ -3608,11 +3795,14 @@ dmmeta.field field:dmmeta.Gsymbol.comment arg:algo.Comment reftype:Val dflt: dmmeta.field field:dmmeta.Hashtype.hashtype arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Hashtype.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Hook.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"The field" -dmmeta.field field:dmmeta.Hook.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Inlary.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.Inlary.min arg:i32 reftype:Val dflt:"" comment:"Min. elements to preallocate" dmmeta.field field:dmmeta.Inlary.max arg:i32 reftype:Val dflt:"" comment:"Max. elements" dmmeta.field field:dmmeta.Inlary.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Jstype.ctype arg:dmmeta.Ctype reftype:Pkey dflt:"" comment:"" +dmmeta.field field:dmmeta.Jstype.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.KafkaTypeKind.kafka_type_kind arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.KafkaTypeKind.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Lenfld.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"Name of length field" dmmeta.field field:dmmeta.Lenfld.extra arg:i32 reftype:Val dflt:"" comment:"Extra #bytes to add" dmmeta.field field:dmmeta.Lenfld.ctype arg:dmmeta.Ctype reftype:Pkey dflt:"" comment:"Name of length field" @@ -3629,6 +3819,9 @@ dmmeta.field field:dmmeta.Llist.comment arg:algo.Comment reftype:Val dflt:"" dmmeta.field field:dmmeta.Logcat.logcat arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Logcat.enabled arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Logcat.builtin arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Logcat.stdout arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Logcat.maxmsg arg:i32 reftype:Val dflt:0 comment:"" +dmmeta.field field:dmmeta.Logcat.window arg:i32 reftype:Val dflt:0 comment:"" dmmeta.field field:dmmeta.Logcat.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Main.ns arg:dmmeta.Ns reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.Main.ismodule arg:bool reftype:Val dflt:"" comment:"" @@ -3655,6 +3848,10 @@ dmmeta.field field:dmmeta.Nsinclude.ns arg:dmmeta.Ns reftype:Pkey dflt:"" c dmmeta.field field:dmmeta.Nsinclude.name arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Nsinclude.sys arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Nsinclude.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Nsjs.ns arg:dmmeta.Ns reftype:Pkey dflt:"" comment:"" +dmmeta.field field:dmmeta.Nsjs.typescript arg:bool reftype:Val dflt:"" comment:"Generate typescript" +dmmeta.field field:dmmeta.Nsjs.gensel arg:bool reftype:Val dflt:"" comment:"Generate selected, false-all" +dmmeta.field field:dmmeta.Nsjs.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Nsproto.ns arg:dmmeta.Ns reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.Nsproto.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Nstype.nstype arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" @@ -3679,7 +3876,7 @@ dmmeta.field field:dmmeta.Pmaskfld.field arg:dmmeta.Field reftype:Pkey dflt: dmmeta.field field:dmmeta.Pmaskfld.ctype arg:dmmeta.Ctype reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.Pmaskfld.filter_print arg:bool reftype:Val dflt:true comment:"Omit non-present fields when printing" dmmeta.field field:dmmeta.Pmaskfld.comment arg:algo.Comment reftype:Val dflt:"" comment:"" -dmmeta.field field:dmmeta.PmaskfldMember.pmaskfld_member arg:algo.Smallstr100 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.PmaskfldMember.pmaskfld_member arg:algo.Smallstr200 reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.PmaskfldMember.pmaskfld arg:dmmeta.Pmaskfld reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.PmaskfldMember.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.PmaskfldMember.comment arg:algo.Comment reftype:Val dflt:"" comment:"" @@ -3692,6 +3889,7 @@ dmmeta.field field:dmmeta.Printfmt.printfmt arg:algo.Smallstr50 reftype:Val dmmeta.field field:dmmeta.Printfmt.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Ptrary.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.Ptrary.unique arg:bool reftype:Val dflt:"" comment:"Search for and ignore duplicates" +dmmeta.field field:dmmeta.Ptrary.heaplike arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Reftype.reftype arg:amcdb.Tclass reftype:Pkey dflt:'"Val"' comment:"" dmmeta.field field:dmmeta.Reftype.isval arg:bool reftype:Val dflt:"" comment:"True if field makes values of target type" dmmeta.field field:dmmeta.Reftype.cascins arg:bool reftype:Val dflt:"" comment:"Field is cascade-insert" @@ -3771,6 +3969,10 @@ dmmeta.field field:dmmeta.Tracerec.comment arg:algo.Comment reftype:Val dflt dmmeta.field field:dmmeta.Typefld.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.Typefld.ctype arg:dmmeta.Ctype reftype:Pkey dflt:"" comment:"Name of length field" dmmeta.field field:dmmeta.Typefld.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Userfunc.userfunc arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Userfunc.acrkey arg:algo.Smallstr200 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Userfunc.cppname arg:algo.Smallstr100 reftype:Val dflt:"" comment:"" +dmmeta.field field:dmmeta.Userfunc.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Usertracefld.tracefld arg:dmmeta.Tracefld reftype:Pkey dflt:"" comment:"" dmmeta.field field:dmmeta.Usertracefld.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:dmmeta.Xref.field arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" @@ -3858,8 +4060,6 @@ dmmeta.field field:gcache.cleanreport.new_cachesize_mb arg:i64 reftype:Val d dmmeta.field field:gcli.FDb._db arg:gcli.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:gcli.FDb.cmdline arg:command.gcli reftype:Val dflt:"" comment:"" dmmeta.field field:gcli.FDb.gtype arg:gcli.FGtype reftype:Lary dflt:"" comment:"" -dmmeta.field field:gcli.FDb.grepossh arg:gcli.FGrepossh reftype:Lary dflt:"" comment:"" -dmmeta.field field:gcli.FDb.grepogitport arg:gcli.FGrepogitport reftype:Lary dflt:"" comment:"" dmmeta.field field:gcli.FDb.githost arg:gcli.FGithost reftype:Lary dflt:"" comment:"" dmmeta.field field:gcli.FDb.need_auth arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:gcli.FDb.gstatet arg:gcli.FGstatet reftype:Lary dflt:"" comment:"" @@ -3881,8 +4081,6 @@ dmmeta.field field:gcli.FDb.ind_issue arg:gcli.FIssue reftype:Thash dflt:"" dmmeta.field field:gcli.FDb.regx_repo arg:algo.cstring reftype:RegxSql dflt:'"%"' comment:"" dmmeta.field field:gcli.FDb.ind_gstatet arg:gcli.FGstatet reftype:Thash dflt:"" comment:"" dmmeta.field field:gcli.FDb.ind_githost arg:gcli.FGithost reftype:Thash dflt:"" comment:"" -dmmeta.field field:gcli.FDb.ind_grepogitport arg:gcli.FGrepogitport reftype:Thash dflt:"" comment:"" -dmmeta.field field:gcli.FDb.ind_grepossh arg:gcli.FGrepossh reftype:Thash dflt:"" comment:"" dmmeta.field field:gcli.FDb.ind_gtype arg:gcli.FGtype reftype:Thash dflt:"" comment:"" dmmeta.field field:gcli.FDb.home arg:algo.cstring reftype:Val dflt:"" comment:"User's HOME directory" dmmeta.field field:gcli.FDb.auth_file arg:algo.cstring reftype:Val dflt:"" comment:"" @@ -3986,8 +4184,6 @@ dmmeta.field field:gcli.FGmethod.base arg:gclidb.Gmethod reftype:Base dflt:" dmmeta.field field:gcli.FGrepo.base arg:gclidb.Grepo reftype:Base dflt:"" comment:"" dmmeta.field field:gcli.FGrepo.select arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:gcli.FGrepo.gitremote_cmd arg:algo.cstring reftype:Val dflt:"" comment:"" -dmmeta.field field:gcli.FGrepogitport.base arg:gclidb.Grepogitport reftype:Base dflt:"" comment:"" -dmmeta.field field:gcli.FGrepossh.base arg:gclidb.Grepossh reftype:Base dflt:"" comment:"" dmmeta.field field:gcli.FGstatet.base arg:gclidb.Gstatet reftype:Base dflt:"" comment:"" dmmeta.field field:gcli.FGtbl.base arg:gclidb.Gtbl reftype:Base dflt:"" comment:"" dmmeta.field field:gcli.FGtbl.id arg:algo.cstring reftype:Val dflt:"" comment:"" @@ -4050,7 +4246,7 @@ dmmeta.field field:gclidb.Gact.gact arg:algo.Smallstr50 reftype:Val dflt:"" dmmeta.field field:gclidb.Gact.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:gclidb.Gatv.gatv arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:gclidb.Gatv.comment arg:algo.Comment reftype:Val dflt:"" comment:"" -dmmeta.field field:gclidb.Gclicmd.gclicmd arg:algo.Smallstr250 reftype:Val dflt:"" comment:"" +dmmeta.field field:gclidb.Gclicmd.gclicmd arg:algo.Smallstr250 reftype:Val dflt:"" comment:"table of static commands" dmmeta.field field:gclidb.Gclicmd.gclicmdf2j arg:gclidb.Gclicmd reftype:Pkey dflt:"" comment:"Base for gclicmdf2j" dmmeta.field field:gclidb.Gclicmd.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:gclidb.Gclicmdf2j.gclicmdf2j arg:algo.Smallstr250 reftype:Val dflt:"" comment:"" @@ -4098,13 +4294,6 @@ dmmeta.field field:gclidb.Grepo.web_url arg:algo.cstring reftype:Val dflt:"" dmmeta.field field:gclidb.Grepo.descr arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:gclidb.Grepo.active arg:bool reftype:Val dflt:true comment:"set to false to ignore the line but keep it in the file" dmmeta.field field:gclidb.Grepo.priv arg:algo.cstring reftype:Val dflt:"" comment:"" -dmmeta.field field:gclidb.Grepogitport.grepogitport arg:algo.Smallstr50 reftype:Val dflt:"" comment:"grepo git host" -dmmeta.field field:gclidb.Grepogitport.port arg:algo.cstring reftype:Val dflt:"" comment:"ssh port for config" -dmmeta.field field:gclidb.Grepogitport.comment arg:algo.Comment reftype:Val dflt:"" comment:"" -dmmeta.field field:gclidb.Grepossh.grepossh arg:algo.Smallstr50 reftype:Val dflt:"" comment:"grepo project/repo name" -dmmeta.field field:gclidb.Grepossh.sshid arg:dev.Gitfile reftype:Pkey dflt:"" comment:"ssh id key name for ssh config" -dmmeta.field field:gclidb.Grepossh.name arg:algo.cstring reftype:Val dflt:"" comment:"ssh id key name for ssh config" -dmmeta.field field:gclidb.Grepossh.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:gclidb.Gstate.gstate arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:gclidb.Gstate.st arg:algo.cstring reftype:Val dflt:'"state"' comment:"" dmmeta.field field:gclidb.Gstate.state arg:algo.cstring reftype:Val dflt:"" comment:"" @@ -4215,61 +4404,223 @@ dmmeta.field field:gclidb.Project.project arg:algo.Smallstr50 reftype:Val df dmmeta.field field:gclidb.User.user arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:gclidb.User.id arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:gclidb.User.name arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.ExtensionHeader.name arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.ExtensionHeader.value arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.HeaderType.value arg:u16 reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Method.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.method arg:http.Method reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.extension_method arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.uri arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.version arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.cache_control arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.connection arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.date arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.pragma arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.trailer arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.transfer_encoding arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.upgrade arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.via arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.warning arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.accept arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.accept_charset arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.accept_encoding arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.accept_language arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.authorization arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.expect arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.from arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.host arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.if_match arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.if_modified_since arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.if_none_match arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.if_range arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.if_unmodified_since arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.max_forwards arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.proxy_authorization arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.range arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.referer arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.te arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.user_agent arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.allow arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.content_encoding arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.content_language arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.content_length arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.content_location arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.content_md5 arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.content_range arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.content_type arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.expires arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.last_modified arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.sec_websocket_key arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.sec_websocket_extensions arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.sec_websocket_protocol arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.sec_websocket_version arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Request.extension_header arg:http.ExtensionHeader reftype:Tary dflt:"" comment:"" +dmmeta.field field:http.Request.body arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.version arg:httpdb.Version reftype:Pkey dflt:'"HTTP/1.0"' comment:"" +dmmeta.field field:http.Response.status arg:httpdb.Status reftype:Pkey dflt:'"200 OK"' comment:"" +dmmeta.field field:http.Response.cache_control arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.connection arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.date arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.pragma arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.trailer arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.transfer_encoding arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.upgrade arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.via arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.warning arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.accept_ranges arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.age arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.etag arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.location arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.proxy_authenticate arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.retry_after arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.server arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.vary arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.www_authenticate arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.allow arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.content_encoding arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.content_language arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.content_length arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.content_location arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.content_md5 arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.content_range arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.content_type arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.expires arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.last_modified arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.sec_websocket_accept arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.sec_websocket_extensions arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.sec_websocket_protocol arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.sec_websocket_version arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:http.Response.extension_header arg:http.ExtensionHeader reftype:Tary dflt:"" comment:"" +dmmeta.field field:http.Response.body arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Content.content arg:algo.Smallstr250 reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Content.description arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Header.header arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Header.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Method.method arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Method.id arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Method.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Status.status arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Status.code arg:u16 reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Status.reason arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Version.version arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:httpdb.Version.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:ietf.Ipport.ip arg:ietf.Ipv4 reftype:Val dflt:"" comment:"" dmmeta.field field:ietf.Ipport.port arg:u16 reftype:Val dflt:"" comment:"" dmmeta.field field:ietf.Ipv4.ipv4 arg:u32 reftype:Val dflt:"" comment:"IP address. First octet in bits 24..32" dmmeta.field field:ietf.Ipv4Addr.addr arg:u32 reftype:Val dflt:"" comment:"" +dmmeta.field field:jkv.FDb._db arg:jkv.FDb reftype:Global dflt:"" comment:"" +dmmeta.field field:jkv.FDb.cmdline arg:command.jkv reftype:Val dflt:"" comment:"" +dmmeta.field field:jkv.FDb.last_kv arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.AclOperationType.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.value arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.UNKNOWN arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.ANY arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.ALL arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.READ arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.WRITE arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.CREATE arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.DELETE arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.ALTER arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.DESCRIBE arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.CLUSTER_ACTION arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.DESCRIBE_CONFIGS arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.ALTER_CONFIGS arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.IDEMPOTENT_WRITE arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.CREATE_TOKENS arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.DESCRIBE_TOKENS arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclOperations.OMITTED arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:kafka.AclPermissionType.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.CompressionType.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.ConfigSource.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.ConfigType.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.Error.value arg:i16 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.Frame.size arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.Frame.payload arg:u8 reftype:Varlen dflt:"" comment:"" +dmmeta.field field:kafka.GroupRecordKeyHeader.type arg:i16 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.GroupRecordKeyHeader.version arg:i16 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.GroupRecordValueHeader.type arg:i16 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.GroupRecordValueHeader.version arg:i16 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.GroupState.value arg:u8 reftype:Val dflt:5 comment:"" +dmmeta.field field:kafka.Header.key arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.Header.value arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.OffsetCommitKey.base arg:kafka.GroupRecordKeyHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:kafka.OffsetCommitKey.group arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.OffsetCommitKey.topic arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.OffsetCommitKey.partition arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.OffsetCommitValue.base arg:kafka.GroupRecordValueHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:kafka.OffsetCommitValue.offset arg:i64 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.OffsetCommitValue.leader_epoch arg:i32 reftype:Val dflt:-1 comment:"" +dmmeta.field field:kafka.OffsetCommitValue.metadata arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.OffsetCommitValue.commit_timestamp arg:i64 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.OffsetCommitValue.expire_timestamp arg:i64 reftype:Val dflt:-1 comment:"" +dmmeta.field field:kafka.PatternType.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.Record.attributes arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.Record.pmask arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.Record.timestamp_delta arg:i64 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.Record.offset_delta arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.Record.key arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.Record.value arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.Record.headers arg:kafka.Header reftype:Tary dflt:"" comment:"" +dmmeta.field field:kafka.RecordBatch.base_offset arg:i64 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.RecordBatch.partition_leader_epoch arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.RecordBatch.magic arg:i8 reftype:Val dflt:2 comment:"" +dmmeta.field field:kafka.RecordBatch.crc arg:u32 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.RecordBatch.attributes arg:i16 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.RecordBatch.last_offset_delta arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.RecordBatch.base_timestamp arg:i64 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.RecordBatch.max_timestamp arg:i64 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.RecordBatch.producer_id arg:i64 reftype:Val dflt:-1 comment:"" +dmmeta.field field:kafka.RecordBatch.producer_epoch arg:i16 reftype:Val dflt:-1 comment:"" +dmmeta.field field:kafka.RecordBatch.base_sequence arg:i32 reftype:Val dflt:-1 comment:"" +dmmeta.field field:kafka.RecordBatch.records arg:kafka.Record reftype:Tary dflt:"" comment:"" +dmmeta.field field:kafka.ResourceType.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:kafka.TimestampType.value arg:u8 reftype:Val dflt:"" comment:"" dmmeta.field field:lib_ams.FDb.fdin arg:lib_ams.FFdin reftype:Lary dflt:"" comment:"ams control messages on stdin" dmmeta.field field:lib_ams.FDb.cd_fdin_eof arg:lib_ams.FFdin reftype:Llist dflt:"" comment:"End reading from stdin" dmmeta.field field:lib_ams.FDb.cd_fdin_read arg:lib_ams.FFdin reftype:Llist dflt:"" comment:"Read next message from file descriptor" dmmeta.field field:lib_ams.FDb._db arg:lib_ams.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:lib_ams.FDb.writefile arg:lib_ams.FWritefile reftype:Cppstack dflt:"" comment:"Provides default name for variables of this type" dmmeta.field field:lib_ams.FDb.zd_flush arg:lib_ams.FWritefile reftype:Llist dflt:"" comment:"" -dmmeta.field field:lib_ams.FDb.stream arg:lib_ams.FStream reftype:Lary dflt:"" comment:"Table of streams" -dmmeta.field field:lib_ams.FDb.ind_stream arg:lib_ams.FStream reftype:Thash dflt:"" comment:"Index of streams by stream id" -dmmeta.field field:lib_ams.FDb.cd_stream_hb arg:lib_ams.FStream reftype:Llist dflt:"" comment:"" +dmmeta.field field:lib_ams.FDb.shm arg:lib_ams.FShm reftype:Lary dflt:"" comment:"Table of streams" +dmmeta.field field:lib_ams.FDb.ind_shm arg:lib_ams.FShm reftype:Thash dflt:"" comment:"Index of streams by stream id" +dmmeta.field field:lib_ams.FDb.cd_hb arg:lib_ams.FShmember reftype:Llist dflt:"" comment:"Send heartbeats (per-member)" dmmeta.field field:lib_ams.FDb.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"Process id, e.g. amstest-0" dmmeta.field field:lib_ams.FDb.shmem_size arg:i32 reftype:Val dflt:32768 comment:"Default stream shared memory size" -dmmeta.field field:lib_ams.FDb.max_msg_size arg:i32 reftype:Val dflt:4096 comment:"Maximum message size" -dmmeta.field field:lib_ams.FDb.cd_poll_read arg:lib_ams.FStream reftype:Llist dflt:"" comment:"Hot poll input stream for reading" +dmmeta.field field:lib_ams.FDb.max_msg_size arg:i32 reftype:Val dflt:4096 comment:"Max. size" +dmmeta.field field:lib_ams.FDb.cd_poll_read arg:lib_ams.FShmember reftype:Llist dflt:"" comment:"Hot poll input stream for reading" +dmmeta.field field:lib_ams.FDb.cd_slow_poll_read arg:lib_ams.FShmember reftype:Llist dflt:"" comment:"Cold poll input stream for reading" dmmeta.field field:lib_ams.FDb.file_prefix arg:algo.cstring reftype:Val dflt:'""' comment:"File prefix for all streams" dmmeta.field field:lib_ams.FDb.proc arg:lib_ams.FProc reftype:Tpool dflt:"" comment:"" dmmeta.field field:lib_ams.FDb.ind_proc arg:lib_ams.FProc reftype:Thash dflt:"" comment:"" -dmmeta.field field:lib_ams.FDb.member arg:lib_ams.FMember reftype:Tpool dflt:"" comment:"" -dmmeta.field field:lib_ams.FDb.ind_member arg:lib_ams.FMember reftype:Thash dflt:"" comment:"" -dmmeta.field field:lib_ams.FDb.streamtype arg:lib_ams.FStreamType reftype:Lary dflt:"" comment:"" -dmmeta.field field:lib_ams.FDb.ind_streamtype arg:lib_ams.FStreamType reftype:Thash dflt:"" comment:"" -dmmeta.field field:lib_ams.FDb.zd_ctlin arg:lib_ams.FStream reftype:Llist dflt:"" comment:"" -dmmeta.field field:lib_ams.FDb.stream_files_cleaned arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_ams.FDb.shmember arg:lib_ams.FShmember reftype:Tpool dflt:"" comment:"" +dmmeta.field field:lib_ams.FDb.ind_shmember arg:lib_ams.FShmember reftype:Thash dflt:"" comment:"" +dmmeta.field field:lib_ams.FDb.shmtype arg:lib_ams.FShmtype reftype:Lary dflt:"" comment:"" +dmmeta.field field:lib_ams.FDb.ind_shmtype arg:lib_ams.FShmtype reftype:Thash dflt:"" comment:"" +dmmeta.field field:lib_ams.FDb.c_ctlin arg:lib_ams.FShmember reftype:Ptrary dflt:"" comment:"" +dmmeta.field field:lib_ams.FDb.shm_files_cleaned arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:lib_ams.FDb.shmem_mode arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:lib_ams.FDb.fdin_buf arg:algo.ByteAry reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FDb.dflt_stream_id arg:ams.StreamId reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_ams.FDb.dflt_shm_id arg:ams.ShmId reftype:Val dflt:"" comment:"" dmmeta.field field:lib_ams.FDb.zd_proc arg:lib_ams.FProc reftype:Llist dflt:"" comment:"" -dmmeta.field field:lib_ams.FDb.c_stream_ctl arg:lib_ams.FStream reftype:Ptr dflt:"" comment:"Ctl output stream (process events)" +dmmeta.field field:lib_ams.FDb.c_shm_ctl arg:lib_ams.FShm reftype:Ptr dflt:"" comment:"Ctl output shm (process events)" dmmeta.field field:lib_ams.FDb.expect_buf arg:algo.cstring reftype:Val dflt:"" comment:"Buffer containing outputs produced since last input" dmmeta.field field:lib_ams.FDb.expect_str arg:algo.cstring reftype:Val dflt:"" comment:"If non-empty, pause reading inputs until this string is non-empty" -dmmeta.field field:lib_ams.FDb.th_expect arg:algo_lib.FTimehook reftype:Val dflt:"" comment:"Timeout for expect message" dmmeta.field field:lib_ams.FDb.expect_pos arg:i32 reftype:Val dflt:"" comment:"Match position within expect buf" dmmeta.field field:lib_ams.FDb.expect_timeout arg:double reftype:Val dflt:10.0 comment:"Default expect timeout" dmmeta.field field:lib_ams.FDb.fmt_buf arg:algo.ByteAry reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FDb.regx_trace arg:algo.cstring reftype:RegxSql dflt:"" comment:"Regx of streams to trace" -dmmeta.field field:lib_ams.FDb.c_stream_out arg:lib_ams.FStream reftype:Ptr dflt:"" comment:"Output stream" +dmmeta.field field:lib_ams.FDb.c_cur_shmember arg:lib_ams.FShmember reftype:Ptr dflt:"" comment:"lib_ams message read callback context" +dmmeta.field field:lib_ams.FDb.bh_shmember_read arg:lib_ams.FShmember reftype:Bheap dflt:"" comment:"" +dmmeta.field field:lib_ams.FDb.c_thisproc arg:lib_ams.FProc reftype:Ptr dflt:"" comment:"" +dmmeta.field field:lib_ams.FDb.powersave arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:lib_ams.FFdin.iohook arg:algo_lib.FIohook reftype:Val dflt:"" comment:"" dmmeta.field field:lib_ams.FFdin.in arg:char reftype:Fbuf dflt:"'\\n'" comment:"" -dmmeta.field field:lib_ams.FMember.member arg:ams.Member reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FMember.pos arg:ams.StreamPos reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FMember.last_hb arg:algo.UnTime reftype:Val dflt:"" comment:"Time last heartbeat received" -dmmeta.field field:lib_ams.FMember.budget arg:u32 reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FMember.p_stream arg:lib_ams.FStream reftype:Upptr dflt:"" comment:"" -dmmeta.field field:lib_ams.FMember.p_proc arg:lib_ams.FProc reftype:Upptr dflt:"" comment:"" -dmmeta.field field:lib_ams.FProc.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FProc.zd_member_byproc arg:lib_ams.FMember reftype:Llist dflt:"" comment:"" -dmmeta.field field:lib_ams.FProc.pid arg:i32 reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FProc.status arg:i32 reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FProc.logbuf arg:algo.cstring reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FProc.hbtimeout arg:u32 reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FProc.critical arg:bool reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FProc.realtime arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_ams.FProc.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"Unique ID" +dmmeta.field field:lib_ams.FProc.c_shm arg:lib_ams.FShm reftype:Ptrary dflt:"" comment:"" +dmmeta.field field:lib_ams.FProc.c_shmember arg:lib_ams.FShmember reftype:Ptrary dflt:"" comment:"List of AMS shm readers/writers at this proc" +dmmeta.field field:lib_ams.FProc.pid arg:i32 reftype:Val dflt:"" comment:"Current PID" +dmmeta.field field:lib_ams.FProc.status arg:i32 reftype:Val dflt:"" comment:"Exit status" +dmmeta.field field:lib_ams.FProc.hbtimeout arg:u32 reftype:Val dflt:"" comment:"Heartbeat timeout" +dmmeta.field field:lib_ams.FProc.critical arg:bool reftype:Val dflt:"" comment:"Exit if process dies?" dmmeta.field field:lib_ams.FReadfile.filename arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:lib_ams.FReadfile.fd arg:algo.Fildes reftype:Val dflt:"" comment:"" dmmeta.field field:lib_ams.FReadfile.eof arg:bool reftype:Val dflt:"" comment:"EOF flag" @@ -4278,27 +4629,35 @@ dmmeta.field field:lib_ams.FReadfile.buf arg:u8 reftype:Tary dflt:"" commen dmmeta.field field:lib_ams.FReadfile.cbuf arg:u8 reftype:Tary dflt:"" comment:"Compressed buffer" dmmeta.field field:lib_ams.FReadfile.block arg:ams.MsgBlock reftype:Val dflt:"" comment:"" dmmeta.field field:lib_ams.FReadfile.offset arg:u32 reftype:Tary dflt:"" comment:"" -dmmeta.field field:lib_ams.FStream.stream_id arg:ams.StreamId reftype:Val dflt:"" comment:"Stream ID (primary key)" -dmmeta.field field:lib_ams.FStream.filename arg:algo.cstring reftype:Val dflt:"" comment:"Name of the file (if opened)" -dmmeta.field field:lib_ams.FStream.shm_file arg:algo_lib.FFildes reftype:Val dflt:"" comment:"Associated file" -dmmeta.field field:lib_ams.FStream.flags arg:ams.StreamFlags reftype:Val dflt:"" comment:"Is stream open for writing" -dmmeta.field field:lib_ams.FStream.byteary arg:algo.ByteAry reftype:Val dflt:"" comment:"Substitute for shm_region" -dmmeta.field field:lib_ams.FStream.shm_handle arg:u8 reftype:Ptr dflt:"" comment:"Associated memory segment handle (windows only)" -dmmeta.field field:lib_ams.FStream.rpos arg:ams.StreamPos reftype:Val dflt:"" comment:"Read position" -dmmeta.field field:lib_ams.FStream.wpos arg:ams.StreamPos reftype:Val dflt:"" comment:"Write position" -dmmeta.field field:lib_ams.FStream.shm_region arg:algo.memptr reftype:Val dflt:"" comment:"Shared memory region" -dmmeta.field field:lib_ams.FStream.limit arg:u64 reftype:Val dflt:"" comment:"Updated with ackoff, limit for nextoff" -dmmeta.field field:lib_ams.FStream.offset_mask arg:u64 reftype:Val dflt:"" comment:"Mask for byte eof" -dmmeta.field field:lib_ams.FStream.cur_msg arg:ams.Seqmsg reftype:Ptr dflt:"" comment:"Current message" -dmmeta.field field:lib_ams.FStream.h_msg arg:ams.MsgHeader reftype:Hook dflt:"" comment:"Message processing hook" -dmmeta.field field:lib_ams.FStream.h_msg_orig arg:ams.MsgHeader reftype:Hook dflt:"" comment:"Saved message processing hook (EXPECT)" -dmmeta.field field:lib_ams.FStream.zd_member_bystream arg:lib_ams.FMember reftype:Llist dflt:"" comment:"" -dmmeta.field field:lib_ams.FStream.next_ackoff arg:u64 reftype:Val dflt:1023 comment:"Force StreamHb after reaching this offset" -dmmeta.field field:lib_ams.FStream.p_streamtype arg:lib_ams.FStreamType reftype:Upptr dflt:"" comment:"" -dmmeta.field field:lib_ams.FStream.n_write_block arg:u32 reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_ams.FStream.burst arg:i32 reftype:Val dflt:20 comment:"Max number of messages processed at once" -dmmeta.field field:lib_ams.FStream.writer_error arg:bool reftype:Val dflt:"" comment:"Writer error was detected" -dmmeta.field field:lib_ams.FStreamType.base arg:amsdb.StreamType reftype:Base dflt:"" comment:"" +dmmeta.field field:lib_ams.FShm.shm_id arg:ams.ShmId reftype:Val dflt:"" comment:"Stream ID (primary key)" +dmmeta.field field:lib_ams.FShm.c_shmember arg:lib_ams.FShmember reftype:Ptrary dflt:"" comment:"List of all read/write members" +dmmeta.field field:lib_ams.FShm.filename arg:algo.cstring reftype:Val dflt:"" comment:"Name of the file (if opened)" +dmmeta.field field:lib_ams.FShm.shm_file arg:algo_lib.FFildes reftype:Val dflt:"" comment:"Associated file" +dmmeta.field field:lib_ams.FShm.flags arg:ams.ShmFlags reftype:Val dflt:"" comment:"Is stream open for writing" +dmmeta.field field:lib_ams.FShm.shm_handle arg:u8 reftype:Ptr dflt:"" comment:"Associated memory segment handle (windows only)" +dmmeta.field field:lib_ams.FShm.c_read arg:lib_ams.FShmember reftype:Ptr dflt:"" comment:"This process" +dmmeta.field field:lib_ams.FShm.c_write arg:lib_ams.FShmember reftype:Ptr dflt:"" comment:"This process" +dmmeta.field field:lib_ams.FShm.shm_region arg:algo.memptr reftype:Val dflt:"" comment:"Shared memory region" +dmmeta.field field:lib_ams.FShm.writelimit arg:u64 reftype:Val dflt:"" comment:"Write limit, based on all read members" +dmmeta.field field:lib_ams.FShm.offset_mask arg:u64 reftype:Val dflt:"" comment:"Mask for byte eof" +dmmeta.field field:lib_ams.FShm.h_amsmsg arg:ams.MsgHeader reftype:Hook dflt:"" comment:"Message processing hook" +dmmeta.field field:lib_ams.FShm.h_msg_orig arg:ams.MsgHeader reftype:Hook dflt:"" comment:"Saved message processing hook (EXPECT)" +dmmeta.field field:lib_ams.FShm.next_ackoff arg:u64 reftype:Val dflt:1023 comment:"Force StreamHb after reaching this offset" +dmmeta.field field:lib_ams.FShm.p_shmtype arg:lib_ams.FShmtype reftype:Upptr dflt:"" comment:"" +dmmeta.field field:lib_ams.FShm.n_write_block arg:u32 reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_ams.FShm.error arg:bool reftype:Val dflt:"" comment:"Error was detected" +dmmeta.field field:lib_ams.FShm.created arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_ams.FShm.schedbias arg:i64 reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_ams.FShmember.shmember arg:ams.ShmemberId reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_ams.FShmember.off arg:u64 reftype:Val dflt:"" comment:"Current offset" +dmmeta.field field:lib_ams.FShmember.rate_off arg:algo.I64Rate reftype:Val dflt:"" comment:"Rate of change of offset" +dmmeta.field field:lib_ams.FShmember.sortkey arg:u64 reftype:Val dflt:"" comment:"Sort key for reading" +dmmeta.field field:lib_ams.FShmember.last_hb arg:algo.SchedTime reftype:Val dflt:"" comment:"Time last heartbeat received" +dmmeta.field field:lib_ams.FShmember.budget arg:u64 reftype:Val dflt:"" comment:"Write budget (if applicable)" +dmmeta.field field:lib_ams.FShmember.p_shm arg:lib_ams.FShm reftype:Upptr dflt:"" comment:"" +dmmeta.field field:lib_ams.FShmember.c_cur_msg arg:ams.Shmmsg reftype:Ptr dflt:"" comment:"Current message" +dmmeta.field field:lib_ams.FShmember.p_proc arg:lib_ams.FProc reftype:Upptr dflt:"" comment:"" +dmmeta.field field:lib_ams.FShmtype.base arg:amsdb.Shmtype reftype:Base dflt:"" comment:"" dmmeta.field field:lib_ams.FWritefile.filename arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:lib_ams.FWritefile.fd arg:algo.Fildes reftype:Val dflt:"" comment:"" dmmeta.field field:lib_ams.FWritefile.fail arg:bool reftype:Val dflt:"" comment:"Failure flag" @@ -4306,6 +4665,15 @@ dmmeta.field field:lib_ams.FWritefile.buf arg:u8 reftype:Tary dflt:"" comme dmmeta.field field:lib_ams.FWritefile.cbuf arg:u8 reftype:Tary dflt:"" comment:"Compressed buffer" dmmeta.field field:lib_ams.FWritefile.buf_thr arg:u32 reftype:Val dflt:1024*64 comment:"Buffer write threshold" dmmeta.field field:lib_ams.FWritefile.block arg:ams.MsgBlock reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_ams.MsgFmt.payload_lim arg:i32 reftype:Val dflt:1024000 comment:"Print up to this many chars from payload" +dmmeta.field field:lib_ams.MsgFmt.indent arg:i32 reftype:Val dflt:0 comment:"Print indentation (with -pretty)" +dmmeta.field field:lib_ams.MsgFmt.format arg:u8 reftype:Val dflt:0 comment:"Output format" +dmmeta.field field:lib_ams.MsgFmt.strip arg:i32 reftype:Val dflt:"" comment:"Number of headers to strip" +dmmeta.field field:lib_ams.MsgFmt.pretty arg:bool reftype:Val dflt:true comment:"Use structured and indented printing" +dmmeta.field field:lib_ams.MsgFmt.showlen arg:bool reftype:Val dflt:false comment:"Show message length" +dmmeta.field field:lib_ams.MsgFmt.h_convert arg:lib_ams.MsgFmt reftype:Hook dflt:"" comment:"" +dmmeta.field field:lib_ams.MsgFmt.convert_key arg:algo.cstring reftype:Val dflt:"" comment:"conversion key" +dmmeta.field field:lib_ams.MsgFmt.convert_val arg:algo.cstring reftype:Val dflt:"" comment:"conversion value - overwritten by the return" dmmeta.field field:lib_ctype.Cmdline.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" dmmeta.field field:lib_ctype.FBltin.base arg:amcdb.Bltin reftype:Base dflt:"" comment:"" dmmeta.field field:lib_ctype.FCdflt.base arg:dmmeta.Cdflt reftype:Base dflt:"" comment:"" @@ -4366,6 +4734,24 @@ dmmeta.field field:lib_ctype.Match.nattr arg:i32 reftype:Val dflt:0 comment dmmeta.field field:lib_ctype.Match.save_unmatched arg:bool reftype:Val dflt:false comment:"If set, accumulate match errors in 'err'" dmmeta.field field:lib_ctype.Match.n_unmatched arg:i32 reftype:Val dflt:"" comment:"Number of unmatched tuples found" dmmeta.field field:lib_ctype.Match.err arg:algo.Tuple reftype:Val dflt:"" comment:"List of errors (key:val format)" +dmmeta.field field:lib_curl.FDb._db arg:lib_curl.FDb reftype:Global dflt:"" comment:"" +dmmeta.field field:lib_curl.FDb.request arg:lib_curl.FRequest reftype:Tpool dflt:"" comment:"" +dmmeta.field field:lib_curl.FDb.response arg:lib_curl.FResponse reftype:Tpool dflt:"" comment:"" +dmmeta.field field:lib_curl.FRequest.method arg:httpdb.Method reftype:Pkey dflt:'"GET"' comment:"HTTP verb: GET, POST, PUT, PATCH, DELETE" +dmmeta.field field:lib_curl.FRequest.curlrc_only arg:bool reftype:Val dflt:"" comment:"Generate curlrc info, do not call curl" +dmmeta.field field:lib_curl.FRequest.url arg:algo.cstring reftype:Val dflt:"" comment:"Absolute URL (e.g., https://api.example.com/v1/data)" +dmmeta.field field:lib_curl.FRequest.headers arg:algo.cstring reftype:Lary dflt:"" comment:'Arbitrary headers: "Authorization: Bearer ...", "Content-Type: ..."' +dmmeta.field field:lib_curl.FRequest.body arg:algo.cstring reftype:Val dflt:"" comment:"Optional request body (sent as-is, often JSON string)" +dmmeta.field field:lib_curl.FRequest.insecure_tls arg:bool reftype:Val dflt:"" comment:"Skip TLS verification if true" +dmmeta.field field:lib_curl.FRequest.connect_timeout_sec arg:u32 reftype:Val dflt:5 comment:connect_timeout_sec +dmmeta.field field:lib_curl.FRequest.total_timeout_sec arg:u32 reftype:Val dflt:120 comment:"Total request timeout (s)" +dmmeta.field field:lib_curl.FResponse.code arg:u16 reftype:Val dflt:"" comment:"HTTP status code" +dmmeta.field field:lib_curl.FResponse.body arg:algo.cstring reftype:Val dflt:"" comment:"raw response body" +dmmeta.field field:lib_curl.FResponse.content_type arg:algo.cstring reftype:Val dflt:"" comment:"parsed Content-Type (no params)" +dmmeta.field field:lib_curl.FResponse.status_line arg:algo.cstring reftype:Val dflt:"" comment:"e.g., HTTP/1.1 200 OK" +dmmeta.field field:lib_curl.FResponse.reason arg:algo.cstring reftype:Val dflt:"" comment:"parsed reason phrase, if available" +dmmeta.field field:lib_curl.FResponse.headers arg:algo.cstring reftype:Lary dflt:"" comment:"raw header lines (trimmed)" +dmmeta.field field:lib_curl.FResponse.curlrc arg:algo.cstring reftype:Val dflt:"" comment:"curlrc content" dmmeta.field field:lib_exec.Cmdline.dry_run arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:lib_exec.Cmdline.q arg:bool reftype:Val dflt:true comment:"Do not print node name" dmmeta.field field:lib_exec.Cmdline.maxjobs arg:i32 reftype:Val dflt:8 comment:"Maximum number of parallel jobs" @@ -4406,6 +4792,9 @@ dmmeta.field field:lib_fm.FDb.alm_objtype arg:lib_fm.FAlmObjtype reftype:Lary dmmeta.field field:lib_fm.FDb.ind_alm_objtype arg:lib_fm.FAlmObjtype reftype:Thash dflt:"" comment:"" dmmeta.field field:lib_fm.FDb.h_alarm arg:lib_fm.FAlarm reftype:Hook dflt:"" comment:"" dmmeta.field field:lib_git.FDb._db arg:lib_git.FDb reftype:Global dflt:"" comment:"" +dmmeta.field field:lib_http.FDb._db arg:lib_http.FDb reftype:Global dflt:"" comment:"" +dmmeta.field field:lib_http.FDb.status arg:lib_http.FStatus reftype:Inlary dflt:"" comment:"" +dmmeta.field field:lib_http.FStatus.base arg:httpdb.Status reftype:Base dflt:"" comment:"" dmmeta.field field:lib_iconv.FDb._db arg:lib_iconv.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:lib_iconv.FDb.icd arg:lib_iconv.Icd reftype:Cppstack dflt:"" comment:"Provides default name for variables of this type" dmmeta.field field:lib_iconv.Icd.icd arg:iconv_t reftype:Val dflt:"((iconv_t)-1)" comment:"iconv descriptor" @@ -4434,12 +4823,31 @@ dmmeta.field field:lib_json.FParser.offset arg:i32 reftype:Val dflt:"" comm dmmeta.field field:lib_json.FParser.uesc_value arg:u32 reftype:Val dflt:"" comment:"" dmmeta.field field:lib_json.FParser.uesc_need arg:u8 reftype:Val dflt:"" comment:"" dmmeta.field field:lib_json.FParser.value arg:algo.cstring reftype:Val dflt:"" comment:"" -dmmeta.field field:lib_json.FldKey.object arg:lib_json.FNode reftype:Ptr dflt:"" comment:"" +dmmeta.field field:lib_json.FldKey.p_object arg:lib_json.FNode reftype:Upptr dflt:"" comment:"" dmmeta.field field:lib_json.FldKey.field arg:algo.strptr reftype:Val dflt:"" comment:"" dmmeta.field field:lib_mysql.FDb.res arg:lib_mysql.Res reftype:Cppstack dflt:"" comment:"Provides default name for variables of this type" dmmeta.field field:lib_mysql.FDb._db arg:lib_mysql.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:lib_mysql.FDb.mysql arg:MYSQL reftype:Ptr dflt:"" comment:"" dmmeta.field field:lib_mysql.Res.res arg:MYSQL_RES reftype:Ptr dflt:"" comment:"" +dmmeta.field field:lib_netio.FDb._db arg:lib_netio.FDb reftype:Global dflt:"" comment:"" +dmmeta.field field:lib_netio.FDb.var arg:lib_netio.FVar reftype:Lary dflt:"" comment:"" +dmmeta.field field:lib_netio.FDb.ind_var arg:lib_netio.FVar reftype:Thash dflt:"" comment:"" +dmmeta.field field:lib_netio.FVar.var arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_netio.FVar.value arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_rl.Cmdline.app arg:algo.cstring reftype:Val dflt:'""' comment:"Application name" +dmmeta.field field:lib_rl.Cmdline.prompt arg:algo.cstring reftype:Val dflt:'""' comment:"Application name" +dmmeta.field field:lib_rl.Cmdline.add_history arg:bool reftype:Val dflt:true comment:"Automatically add to history" +dmmeta.field field:lib_rl.Cmdline.max_history arg:i32 reftype:Val dflt:1000 comment:"Number to history entries to keep" +dmmeta.field field:lib_rl.FDb._db arg:lib_rl.FDb reftype:Global dflt:"" comment:"" +dmmeta.field field:lib_rl.FDb.cmdline arg:lib_rl.Cmdline reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_rl.FDb.Prlog arg:algo.PrlogFcn reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_rl.FDb.history_file arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_rl.FDb.iohook arg:algo_lib.FIohook reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_rl.FDb.line arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_rl.FDb.line_valid arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_rl.FDb.eof arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_rl.FDb.err arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:lib_rl.FDb.isatty arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:lib_sql.FAttr.attr arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:lib_sql.FAttr.isbool arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:lib_sql.FDb._db arg:lib_sql.FDb reftype:Global dflt:"" comment:"" @@ -4507,6 +4915,9 @@ dmmeta.field field:lib_sqlite.VtabCurs.c_pkey arg:lib_sqlite.Cons reftype:Ptr dmmeta.field field:lib_sqlite.VtabCurs.c_idx arg:lib_sqlite.FIdx reftype:Ptr dflt:"" comment:"" dmmeta.field field:lib_sqlite.VtabCurs.rowid arg:i32 reftype:Val dflt:"" comment:"" dmmeta.field field:lib_sqlite.VtabCurs.attrs arg:algo.cstring reftype:Tary dflt:"" comment:"" +dmmeta.field field:lib_ws.FDb._db arg:lib_ws.FDb reftype:Global dflt:"" comment:"" +dmmeta.field field:lib_ws.FrameIdx.masking_key arg:u32 reftype:Ptr dflt:"" comment:"" +dmmeta.field field:lib_ws.FrameIdx.payload arg:algo.strptr reftype:Val dflt:"" comment:"" dmmeta.field field:mdbg.FBuilddir.base arg:dev.Builddir reftype:Base dflt:"" comment:"" dmmeta.field field:mdbg.FCfg.base arg:dev.Cfg reftype:Base dflt:"" comment:"" dmmeta.field field:mdbg.FCfg.c_builddir arg:mdbg.FBuilddir reftype:Ptrary dflt:"" comment:"" @@ -4572,7 +4983,7 @@ dmmeta.field field:report.amc.n_filemod arg:u32 reftype:Val dflt:"" comment dmmeta.field field:report.atf_comp.ntest arg:i32 reftype:Val dflt:"" comment:"Total number of tests" dmmeta.field field:report.atf_comp.nselect arg:i32 reftype:Val dflt:"" comment:"Number of tests selected for execution" dmmeta.field field:report.atf_comp.npass arg:i32 reftype:Val dflt:"" comment:"Number of tests succeeded" -dmmeta.field field:report.atf_comp.nskip arg:i32 reftype:Val dflt:"" comment:"Number of tests failed" +dmmeta.field field:report.atf_comp.nskip arg:i32 reftype:Val dflt:"" comment:"Number of tests not selected" dmmeta.field field:report.atf_comp.nrun arg:i32 reftype:Val dflt:"" comment:"Number of tests run" dmmeta.field field:report.atf_comp.nwrite arg:i32 reftype:Val dflt:"" comment:"Number of files written" dmmeta.field field:report.atf_comp.nerr arg:i32 reftype:Val dflt:"" comment:"Number of errors" @@ -4602,6 +5013,32 @@ dmmeta.field field:report.src_func.n_mysteryfunc arg:u32 reftype:Val dflt:0 dmmeta.field field:report.src_func.n_filemod arg:u32 reftype:Val dflt:0 comment:"Number of files written" dmmeta.field field:report.src_func.n_baddecl arg:u32 reftype:Val dflt:0 comment:"Number of unparseable (by src_func) declarations" dmmeta.field field:report.src_func.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:samp_make.FDb._db arg:samp_make.FDb reftype:Global dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.cmdline arg:command.samp_make reftype:Val dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.gitfile arg:samp_make.FGitfile reftype:Lary dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.ind_gitfile arg:samp_make.FGitfile reftype:Thash dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.target arg:samp_make.FTarget reftype:Lary dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.ind_target arg:samp_make.FTarget reftype:Thash dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.targdep arg:samp_make.FTargdep reftype:Lary dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.ind_targdep arg:samp_make.FTargdep reftype:Thash dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.targsrc arg:samp_make.FTargsrc reftype:Lary dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.ind_targsrc arg:samp_make.FTargsrc reftype:Thash dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.targrec arg:samp_make.FTargrec reftype:Lary dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.ind_targrec arg:samp_make.FTargrec reftype:Thash dflt:"" comment:"" +dmmeta.field field:samp_make.FDb.c_target arg:samp_make.FTarget reftype:Ptrary dflt:"" comment:"" +dmmeta.field field:samp_make.FGitfile.base arg:sampdb.Gitfile reftype:Base dflt:"" comment:"" +dmmeta.field field:samp_make.FTargdep.base arg:sampdb.Targdep reftype:Base dflt:"" comment:"" +dmmeta.field field:samp_make.FTargdep.p_parent arg:samp_make.FTarget reftype:Upptr dflt:"" comment:"" +dmmeta.field field:samp_make.FTargdep.p_target arg:samp_make.FTarget reftype:Upptr dflt:"" comment:"" +dmmeta.field field:samp_make.FTarget.base arg:sampdb.Target reftype:Base dflt:"" comment:"" +dmmeta.field field:samp_make.FTarget.prereq arg:algo.cstring reftype:Val dflt:"" comment:"collection of make prereq lines" +dmmeta.field field:samp_make.FTarget.select arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:samp_make.FTarget.recipe arg:algo.cstring reftype:Val dflt:"" comment:"collection of make recipe lines" +dmmeta.field field:samp_make.FTarget.c_targsrc arg:samp_make.FTargsrc reftype:Ptrary dflt:"" comment:"" +dmmeta.field field:samp_make.FTarget.c_targdep arg:samp_make.FTargdep reftype:Ptrary dflt:"" comment:"" +dmmeta.field field:samp_make.FTarget.c_targrec arg:samp_make.FTargrec reftype:Ptr dflt:"" comment:"" +dmmeta.field field:samp_make.FTargrec.base arg:sampdb.Targrec reftype:Base dflt:"" comment:"" +dmmeta.field field:samp_make.FTargsrc.base arg:sampdb.Targsrc reftype:Base dflt:"" comment:"" dmmeta.field field:samp_meng.CancelOrderMsg.base arg:samp_meng.MsgHeader reftype:Base dflt:"" comment:"" dmmeta.field field:samp_meng.CancelOrderMsg.order arg:u64 reftype:Val dflt:"" comment:"" dmmeta.field field:samp_meng.CancelReqMsg.base arg:samp_meng.MsgHeader reftype:Base dflt:"" comment:"" @@ -4672,6 +5109,26 @@ dmmeta.field field:samp_meng.TextMsg.base arg:samp_meng.MsgHeader reftype:Bas dmmeta.field field:samp_meng.TextMsg.text arg:char reftype:Varlen dflt:"" comment:"" dmmeta.field field:samp_regx.FDb._db arg:samp_regx.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:samp_regx.FDb.cmdline arg:command.samp_regx reftype:Val dflt:"" comment:"" +dmmeta.field field:sampdb.Gitfile.gitfile arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:sampdb.Gitfile.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:sampdb.Targdep.targdep arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:sampdb.Targdep.target arg:sampdb.Target reftype:Pkey dflt:"" comment:"Child target" +dmmeta.field field:sampdb.Targdep.parent arg:sampdb.Target reftype:Pkey dflt:"" comment:"Parent target" +dmmeta.field field:sampdb.Targdep.rec arg:bool reftype:Val dflt:"" comment:"use in recipe" +dmmeta.field field:sampdb.Targdep.pre arg:bool reftype:Val dflt:"" comment:"use in prerequisite" +dmmeta.field field:sampdb.Targdep.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:sampdb.Target.target arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:sampdb.Target.dflt arg:bool reftype:Val dflt:"" comment:"make first target - default target" +dmmeta.field field:sampdb.Target.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:sampdb.Targrec.target arg:sampdb.Target reftype:Pkey dflt:"" comment:"" +dmmeta.field field:sampdb.Targrec.recipe arg:algo.cstring reftype:Val dflt:"" comment:"" +dmmeta.field field:sampdb.Targrec.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dmmeta.field field:sampdb.Targsrc.targsrc arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:sampdb.Targsrc.pre arg:bool reftype:Val dflt:"" comment:"use in prerequisite" +dmmeta.field field:sampdb.Targsrc.target arg:sampdb.Target reftype:Pkey dflt:"" comment:"" +dmmeta.field field:sampdb.Targsrc.src arg:sampdb.Gitfile reftype:Pkey dflt:"" comment:"" +dmmeta.field field:sampdb.Targsrc.rec arg:bool reftype:Val dflt:"" comment:"use in recipe" +dmmeta.field field:sampdb.Targsrc.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.field field:sandbox.FDb._db arg:sandbox.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:sandbox.FDb.cmdline arg:command.sandbox reftype:Val dflt:"" comment:"" dmmeta.field field:sandbox.FDb.sandbox arg:sandbox.FSandbox reftype:Lary dflt:"" comment:"" @@ -4683,7 +5140,6 @@ dmmeta.field field:sandbox.FSandbox.select arg:bool reftype:Val dflt:"" com dmmeta.field field:sandbox.FSbpath.base arg:dev.Sbpath reftype:Base dflt:"" comment:"" dmmeta.field field:src_func.FCtypelen.base arg:dmmeta.Ctypelen reftype:Base dflt:"" comment:"" dmmeta.field field:src_func.FDb.report arg:report.src_func reftype:Val dflt:"" comment:"Final report" -dmmeta.field field:src_func.FDb.genprefix arg:src_func.FGenprefix reftype:Lary dflt:"" comment:"" dmmeta.field field:src_func.FDb._db arg:src_func.FDb reftype:Global dflt:"" comment:"" dmmeta.field field:src_func.FDb.cmdline arg:command.src_func reftype:Val dflt:"" comment:"" dmmeta.field field:src_func.FDb.targsrc arg:src_func.FTargsrc reftype:Lary dflt:"" comment:"" @@ -4692,41 +5148,43 @@ dmmeta.field field:src_func.FDb.ind_target arg:src_func.FTarget reftype:Thash dmmeta.field field:src_func.FDb.func arg:src_func.FFunc reftype:Lary dflt:"" comment:"" dmmeta.field field:src_func.FDb.ind_func arg:src_func.FFunc reftype:Thash dflt:"" comment:"" dmmeta.field field:src_func.FDb.bh_func arg:src_func.FFunc reftype:Bheap dflt:"" comment:"" -dmmeta.field field:src_func.FDb.dispatch arg:src_func.FDispatch reftype:Lary dflt:"" comment:"" dmmeta.field field:src_func.FDb.c_cur_targsrc arg:src_func.FTargsrc reftype:Ptr dflt:"" comment:"" dmmeta.field field:src_func.FDb.cur_line arg:i32 reftype:Val dflt:"" comment:"" dmmeta.field field:src_func.FDb.ignore_funcstart arg:algo_lib.Regx reftype:Val dflt:"" comment:"" -dmmeta.field field:src_func.FDb.fstep arg:src_func.FFstep reftype:Lary dflt:"" comment:"" -dmmeta.field field:src_func.FDb.gstatic arg:src_func.FGstatic reftype:Lary dflt:"" comment:"" -dmmeta.field field:src_func.FDb.ind_genprefix arg:src_func.FGenprefix reftype:Thash dflt:"" comment:"" dmmeta.field field:src_func.FDb.ctypelen arg:src_func.FCtypelen reftype:Lary dflt:"" comment:"" dmmeta.field field:src_func.FDb.ind_ctypelen arg:src_func.FCtypelen reftype:Thash dflt:"" comment:"" dmmeta.field field:src_func.FDb.printed_user_impl_notice arg:bool reftype:Val dflt:"" comment:"" -dmmeta.field field:src_func.FDispatch.base arg:dmmeta.Dispatch reftype:Base dflt:"" comment:"" -dmmeta.field field:src_func.FFstep.base arg:dmmeta.Fstep reftype:Base dflt:"" comment:"" +dmmeta.field field:src_func.FDb.userfunc arg:src_func.FUserfunc reftype:Lary dflt:"" comment:"" +dmmeta.field field:src_func.FDb.ind_userfunc arg:src_func.FUserfunc reftype:Thash dflt:"" comment:"" +dmmeta.field field:src_func.FDb.ind_userfunc_cppname arg:src_func.FUserfunc reftype:Thash dflt:"" comment:"" +dmmeta.field field:src_func.FDb.editloc arg:algo.cstring reftype:Val dflt:"" comment:"List of locations to edit" +dmmeta.field field:src_func.FDb.genaffix arg:src_func.FGenaffix reftype:Lary dflt:"" comment:"" +dmmeta.field field:src_func.FDb.ind_genaffix arg:src_func.FGenaffix reftype:Thash dflt:"" comment:"" dmmeta.field field:src_func.FFunc.func arg:algo.cstring reftype:Val dflt:"" comment:"First line of function -- primary key" +dmmeta.field field:src_func.FFunc.name arg:algo.cstring reftype:Val dflt:"" comment:"Function name in the form ns.name" dmmeta.field field:src_func.FFunc.args arg:algo.cstring reftype:Val dflt:"" comment:"Argument list -- everything beyond first open parenthesis" dmmeta.field field:src_func.FFunc.sortkey arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:src_func.FFunc.body arg:algo.cstring reftype:Val dflt:"" comment:"Function body" -dmmeta.field field:src_func.FFunc.p_targsrc arg:src_func.FTargsrc reftype:Upptr dflt:"" comment:"" -dmmeta.field field:src_func.FFunc.line arg:i32 reftype:Val dflt:"" comment:"Line where function started" +dmmeta.field field:src_func.FFunc.p_targsrc arg:src_func.FTargsrc reftype:Upptr dflt:"" comment:"Pointer to source file" +dmmeta.field field:src_func.FFunc.line arg:i32 reftype:Val dflt:"" comment:"Line number where function started" dmmeta.field field:src_func.FFunc.precomment arg:algo.cstring reftype:Val dflt:"" comment:"Comments that appeare before function body" dmmeta.field field:src_func.FFunc.isstatic arg:bool reftype:Val dflt:"" comment:"Static?" dmmeta.field field:src_func.FFunc.isinline arg:bool reftype:Val dflt:"" comment:"Inline?" -dmmeta.field field:src_func.FFunc.amcprot arg:bool reftype:Val dflt:"" comment:"Looks like a function where amc has already provided prototype?" dmmeta.field field:src_func.FFunc.select arg:bool reftype:Val dflt:"" comment:"Select for further processing" -dmmeta.field field:src_func.FFunc.iffy arg:bool reftype:Val dflt:"" comment:"" -dmmeta.field field:src_func.FFunc.mystery arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:src_func.FFunc.iffy arg:bool reftype:Val dflt:"" comment:"Something wrong with the declaration" +dmmeta.field field:src_func.FFunc.mystery arg:bool reftype:Val dflt:"" comment:"Non-static and missing a comment" dmmeta.field field:src_func.FFunc.p_written_to arg:src_func.FTargsrc reftype:Upptr dflt:"" comment:"If non-NULL, header where this function is written" -dmmeta.field field:src_func.FGenprefix.genprefix arg:dmmeta.Field reftype:Pkey dflt:"" comment:"" -dmmeta.field field:src_func.FGstatic.base arg:dmmeta.Gstatic reftype:Base dflt:"" comment:"" +dmmeta.field field:src_func.FFunc.p_userfunc arg:src_func.FUserfunc reftype:Upptr dflt:"" comment:"" +dmmeta.field field:src_func.FGenaffix.genaffix arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:src_func.FTarget.base arg:dev.Target reftype:Base dflt:"" comment:"" dmmeta.field field:src_func.FTarget.cd_targsrc arg:src_func.FTargsrc reftype:Llist dflt:"" comment:"" -dmmeta.field field:src_func.FTarget.select arg:bool reftype:Val dflt:"" comment:"" dmmeta.field field:src_func.FTargsrc.base arg:dev.Targsrc reftype:Base dflt:"" comment:"" dmmeta.field field:src_func.FTargsrc.zd_func arg:src_func.FFunc reftype:Llist dflt:"" comment:"" dmmeta.field field:src_func.FTargsrc.p_target arg:src_func.FTarget reftype:Upptr dflt:"" comment:"" dmmeta.field field:src_func.FTargsrc.select arg:bool reftype:Val dflt:"" comment:"" +dmmeta.field field:src_func.FTargsrc.counter arg:i32 reftype:Val dflt:"" comment:"" +dmmeta.field field:src_func.FUserfunc.base arg:dmmeta.Userfunc reftype:Base dflt:"" comment:"" +dmmeta.field field:src_func.FUserfunc.zd_func arg:src_func.FFunc reftype:Llist dflt:"" comment:"" dmmeta.field field:src_hdr.FCopyline.fcopyline arg:algo.cstring reftype:Val dflt:"" comment:"" dmmeta.field field:src_hdr.FCopyright.base arg:dev.Copyright reftype:Base dflt:"" comment:"" dmmeta.field field:src_hdr.FCopyright.years arg:algo.cstring reftype:Val dflt:"" comment:"" @@ -4905,3 +5363,56 @@ dmmeta.field field:sv2ssim.FField.couldbe_fixwid arg:bool reftype:Val dflt:t dmmeta.field field:sv2ssim.FField.couldbe_double arg:bool reftype:Val dflt:true comment:"" dmmeta.field field:sv2ssim.FField.rowid arg:i32 reftype:Val dflt:0 comment:"" dmmeta.field field:sv2ssim.FSvtype.base arg:dmmeta.Svtype reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.CloseMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.CloseMsg.conn arg:algo.RspaceStr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.CloseMsg.side arg:ws.Side reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.CloseMsg.code arg:ws.StatusCode reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.CloseMsg.reason arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ws.ConnectMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.ConnectMsg.conn arg:algo.RspaceStr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.ConnectMsg.side arg:ws.Side reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.DataMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.DataMsg.conn arg:algo.RspaceStr50 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.DataMsg.side arg:ws.Side reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.DataMsg.opcode arg:ws.Opcode reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.DataMsg.data arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ws.Frame.base arg:ws.FrameHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.Frame.payload arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ws.Frame16.base arg:ws.FrameHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.Frame16.ext_payload_len arg:u16 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.Frame16.payload arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ws.Frame64.base arg:ws.FrameHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.Frame64.ext_payload_len arg:u64 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.Frame64.payload arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ws.FrameHeader.byte0 arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.FrameHeader.byte1 arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.FrameHeader.fin arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:ws.FrameHeader.rsv1 arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:ws.FrameHeader.rsv2 arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:ws.FrameHeader.rsv3 arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:ws.FrameHeader.opcode arg:ws.Opcode reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:ws.FrameHeader.mask arg:bool reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:ws.FrameHeader.payload_len arg:u8 reftype:Bitfld dflt:"" comment:"" +dmmeta.field field:ws.FrameMasked.base arg:ws.FrameHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.FrameMasked.masking_key arg:u32 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.FrameMasked.payload arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ws.FrameMasked16.base arg:ws.FrameHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.FrameMasked16.ext_payload_len arg:u16 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.FrameMasked16.masking_key arg:u32 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.FrameMasked16.payload arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ws.FrameMasked64.base arg:ws.FrameHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.FrameMasked64.ext_payload_len arg:u64 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.FrameMasked64.masking_key arg:u32 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.FrameMasked64.payload arg:char reftype:Varlen dflt:"" comment:"" +dmmeta.field field:ws.HttpState.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.Opcode.value arg:u8 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.ServerStartMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.ServerStartMsg.server arg:algo.RspaceStr25 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.ServerStopMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.field field:ws.ServerStopMsg.server arg:algo.RspaceStr25 reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.Side.value arg:char reftype:Val dflt:"" comment:"" +dmmeta.field field:ws.StatusCode.value arg:u16 reftype:Val dflt:"" comment:"" +dmmeta.field field:wsdb.Status.code arg:u32 reftype:Val dflt:"" comment:"Status code" +dmmeta.field field:wsdb.Status.reason arg:algo.Smallstr32 reftype:Val dflt:"" comment:"Status reason" +dmmeta.field field:wsdb.Status.local_only arg:bool reftype:Val dflt:"" comment:"Never sent on close frame, use locally" +dmmeta.field field:wsdb.Status.comment arg:algo.Comment reftype:Val dflt:"" comment:"" diff --git a/data/dmmeta/findrem.ssim b/data/dmmeta/findrem.ssim index 02ae7bdf..cadfb3c9 100644 --- a/data/dmmeta/findrem.ssim +++ b/data/dmmeta/findrem.ssim @@ -1 +1,2 @@ +dmmeta.findrem field:atf_amc.FDb.ind_linear comment:"" dmmeta.findrem field:atf_amc.FDb.ind_thash_elem comment:"" diff --git a/data/dmmeta/finput.ssim b/data/dmmeta/finput.ssim index c533dccb..21323c8e 100644 --- a/data/dmmeta/finput.ssim +++ b/data/dmmeta/finput.ssim @@ -15,13 +15,16 @@ dmmeta.finput field:abt.FDb.tool_opt extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt.FDb.uname extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt_md.FDb.comptest extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt_md.FDb.ctype extrn:N update:N strict:Y comment:"" +dmmeta.finput field:abt_md.FDb.dispatch extrn:N update:N strict:Y comment:"" +dmmeta.finput field:abt_md.FDb.dispatch_msg extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt_md.FDb.fconst extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt_md.FDb.field extrn:N update:N strict:Y comment:"" +dmmeta.finput field:abt_md.FDb.finput extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt_md.FDb.gconst extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt_md.FDb.gstatic extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt_md.FDb.ns extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt_md.FDb.nstype extrn:N update:N strict:Y comment:"" -dmmeta.finput field:abt_md.FDb.readme extrn:N update:N strict:Y comment:"" +dmmeta.finput field:abt_md.FDb.readmefile extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt_md.FDb.readmesort extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt_md.FDb.reftype extrn:N update:N strict:Y comment:"" dmmeta.finput field:abt_md.FDb.scriptfile extrn:N update:N strict:Y comment:"" @@ -61,6 +64,7 @@ dmmeta.finput field:acr_ed.FDb.field extrn:N update:N strict:Y comment:"" dmmeta.finput field:acr_ed.FDb.fprefix extrn:N update:N strict:Y comment:"" dmmeta.finput field:acr_ed.FDb.gitfile extrn:N update:N strict:Y comment:"" dmmeta.finput field:acr_ed.FDb.listtype extrn:N update:N strict:Y comment:"" +dmmeta.finput field:acr_ed.FDb.msgtype extrn:N update:N strict:Y comment:"" dmmeta.finput field:acr_ed.FDb.ns extrn:N update:N strict:Y comment:"" dmmeta.finput field:acr_ed.FDb.nsdb extrn:N update:N strict:Y comment:"" dmmeta.finput field:acr_ed.FDb.pack extrn:N update:N strict:Y comment:"" @@ -96,6 +100,7 @@ dmmeta.finput field:amc.FDb.cfmt extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.cget extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.charset extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.chash extrn:N update:N strict:Y comment:"" +dmmeta.finput field:amc.FDb.ckafka extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.cppfunc extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.cpptype extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.csize extrn:N update:N strict:Y comment:"" @@ -127,6 +132,7 @@ dmmeta.finput field:amc.FDb.fflag extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.field extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.findrem extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.finput extrn:N update:N strict:Y comment:"" +dmmeta.finput field:amc.FDb.fkafka extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.fldoffset extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.floadtuples extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.fnoremove extrn:N update:N strict:Y comment:"" @@ -145,6 +151,7 @@ dmmeta.finput field:amc.FDb.gstatic extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.gsymbol extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.hook extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.inlary extrn:N update:N strict:Y comment:"" +dmmeta.finput field:amc.FDb.jstype extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.lenfld extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.license extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.listtype extrn:N update:N strict:Y comment:"" @@ -158,6 +165,7 @@ dmmeta.finput field:amc.FDb.ns extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.nscpp extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.nsdb extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.nsinclude extrn:N update:N strict:Y comment:"" +dmmeta.finput field:amc.FDb.nsjs extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.nsproto extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.nsx extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.numstr extrn:N update:N strict:Y comment:"" @@ -172,6 +180,7 @@ dmmeta.finput field:amc.FDb.sortfld extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.ssimfile extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.ssimsort extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.ssimvolatile extrn:N update:N strict:Y comment:"" +dmmeta.finput field:amc.FDb.steptype extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.substr extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.targdep extrn:N update:N strict:Y comment:"" dmmeta.finput field:amc.FDb.target extrn:N update:N strict:Y comment:"" @@ -203,7 +212,7 @@ dmmeta.finput field:atf_ci.FDb.gitfile extrn:N update:N strict:Y comment:"" dmmeta.finput field:atf_ci.FDb.msgfile extrn:N update:N strict:Y comment:"" dmmeta.finput field:atf_ci.FDb.noindent extrn:N update:N strict:Y comment:"" dmmeta.finput field:atf_ci.FDb.ns extrn:N update:N strict:Y comment:"" -dmmeta.finput field:atf_ci.FDb.readme extrn:N update:N strict:Y comment:"" +dmmeta.finput field:atf_ci.FDb.readmefile extrn:N update:N strict:Y comment:"" dmmeta.finput field:atf_ci.FDb.scriptfile extrn:N update:N strict:Y comment:"" dmmeta.finput field:atf_ci.FDb.ssimfile extrn:N update:N strict:Y comment:"" dmmeta.finput field:atf_ci.FDb.targsrc extrn:N update:N strict:Y comment:"" @@ -230,8 +239,6 @@ dmmeta.finput field:gcli.FDb.gclicmdt extrn:N update:N strict:Y comment:"" dmmeta.finput field:gcli.FDb.gfld extrn:N update:N strict:Y comment:"" dmmeta.finput field:gcli.FDb.gmethod extrn:N update:N strict:Y comment:"" dmmeta.finput field:gcli.FDb.grepo extrn:N update:N strict:Y comment:"" -dmmeta.finput field:gcli.FDb.grepogitport extrn:N update:N strict:Y comment:"" -dmmeta.finput field:gcli.FDb.grepossh extrn:N update:N strict:Y comment:"" dmmeta.finput field:gcli.FDb.gstatet extrn:N update:N strict:Y comment:"" dmmeta.finput field:gcli.FDb.gtbl extrn:N update:N strict:Y comment:"" dmmeta.finput field:gcli.FDb.gtblactfld extrn:N update:N strict:Y comment:"" @@ -261,14 +268,17 @@ dmmeta.finput field:lib_sqlite.FDb.substr extrn:N update:N strict:Y comment dmmeta.finput field:mdbg.FDb.builddir extrn:N update:N strict:Y comment:"" dmmeta.finput field:mdbg.FDb.cfg extrn:N update:N strict:Y comment:"" dmmeta.finput field:orgfile.FDb.timefmt extrn:N update:N strict:Y comment:"" +dmmeta.finput field:samp_make.FDb.gitfile extrn:N update:N strict:Y comment:"" +dmmeta.finput field:samp_make.FDb.targdep extrn:N update:N strict:Y comment:"" +dmmeta.finput field:samp_make.FDb.target extrn:N update:N strict:Y comment:"" +dmmeta.finput field:samp_make.FDb.targrec extrn:N update:N strict:Y comment:"" +dmmeta.finput field:samp_make.FDb.targsrc extrn:N update:N strict:Y comment:"" dmmeta.finput field:sandbox.FDb.sandbox extrn:N update:N strict:Y comment:"" dmmeta.finput field:sandbox.FDb.sbpath extrn:N update:N strict:Y comment:"" dmmeta.finput field:src_func.FDb.ctypelen extrn:N update:N strict:Y comment:"" -dmmeta.finput field:src_func.FDb.dispatch extrn:N update:N strict:Y comment:"" -dmmeta.finput field:src_func.FDb.fstep extrn:N update:N strict:Y comment:"" -dmmeta.finput field:src_func.FDb.gstatic extrn:N update:N strict:Y comment:"" dmmeta.finput field:src_func.FDb.target extrn:N update:N strict:Y comment:"" dmmeta.finput field:src_func.FDb.targsrc extrn:N update:N strict:Y comment:"" +dmmeta.finput field:src_func.FDb.userfunc extrn:N update:N strict:Y comment:"" dmmeta.finput field:src_hdr.FDb.copyright extrn:N update:N strict:Y comment:"" dmmeta.finput field:src_hdr.FDb.license extrn:N update:N strict:Y comment:"" dmmeta.finput field:src_hdr.FDb.ns extrn:N update:N strict:Y comment:"" diff --git a/data/dmmeta/fkafka.ssim b/data/dmmeta/fkafka.ssim new file mode 100644 index 00000000..e69de29b diff --git a/data/dmmeta/floadtuples.ssim b/data/dmmeta/floadtuples.ssim index d1215592..a6a25814 100644 --- a/data/dmmeta/floadtuples.ssim +++ b/data/dmmeta/floadtuples.ssim @@ -7,7 +7,6 @@ dmmeta.floadtuples field:command.acr_in.schema comment:"" dmmeta.floadtuples field:command.acr_my.schema comment:"" dmmeta.floadtuples field:command.amc_gc.in comment:"" dmmeta.floadtuples field:command.amc_vis.in comment:"" -dmmeta.floadtuples field:command.ams_cat.in comment:"" dmmeta.floadtuples field:command.ams_sendtest.in comment:"" dmmeta.floadtuples field:command.apm.in comment:"" dmmeta.floadtuples field:command.aqlite.schema comment:"" @@ -16,6 +15,7 @@ dmmeta.floadtuples field:command.atf_ci.in comment:"" dmmeta.floadtuples field:command.atf_cmdline.in comment:"" dmmeta.floadtuples field:command.atf_comp.in comment:"" dmmeta.floadtuples field:command.atf_cov.in comment:"" +dmmeta.floadtuples field:command.atf_exp.in comment:"" dmmeta.floadtuples field:command.atf_fuzz.in comment:"" dmmeta.floadtuples field:command.atf_gcli.in comment:"" dmmeta.floadtuples field:command.atf_nrun.in comment:"" @@ -23,6 +23,7 @@ dmmeta.floadtuples field:command.atf_unit.data_dir comment:"" dmmeta.floadtuples field:command.bash2html.in comment:"" dmmeta.floadtuples field:command.gcache.in comment:"" dmmeta.floadtuples field:command.gcli.in comment:"" +dmmeta.floadtuples field:command.jkv.in comment:"" dmmeta.floadtuples field:command.mdbg.in comment:"" dmmeta.floadtuples field:command.orgfile.in comment:"" dmmeta.floadtuples field:command.samp_meng.in comment:"" diff --git a/data/dmmeta/fnoremove.ssim b/data/dmmeta/fnoremove.ssim index ada4e6f3..c1d0e6cb 100644 --- a/data/dmmeta/fnoremove.ssim +++ b/data/dmmeta/fnoremove.ssim @@ -132,6 +132,7 @@ dmmeta.fnoremove field:amc_vis.FDb.field comment:"" dmmeta.fnoremove field:amc_vis.FDb.finput comment:"" dmmeta.fnoremove field:amc_vis.FDb.reftype comment:"" dmmeta.fnoremove field:atf_ci.FDb.ssimfile comment:"" +dmmeta.fnoremove field:lib_ams.FDb.proc comment:"" dmmeta.fnoremove field:lib_ctype.FDb.cdflt comment:"" dmmeta.fnoremove field:lib_ctype.FDb.cfmt comment:"" dmmeta.fnoremove field:lib_ctype.FDb.ctype comment:"" diff --git a/data/dmmeta/foutput.ssim b/data/dmmeta/foutput.ssim index 82bfc631..40383a14 100644 --- a/data/dmmeta/foutput.ssim +++ b/data/dmmeta/foutput.ssim @@ -1,7 +1,3 @@ -dmmeta.foutput field:amc.FDb.c_ctypelen comment:"" -dmmeta.foutput field:amc.FDb.c_dispsig_sorted comment:"" -dmmeta.foutput field:amc.FDb.tracefld comment:"" -dmmeta.foutput field:amc.FDb.tracerec comment:"" dmmeta.foutput field:atf_comp.FDb.zd_out_comptest comment:"" dmmeta.foutput field:atf_comp.FDb.zd_out_targs comment:"" dmmeta.foutput field:atf_comp.FDb.zd_out_tfilt comment:"" diff --git a/data/dmmeta/fsort.ssim b/data/dmmeta/fsort.ssim index 04b9e2b7..8b8d529e 100644 --- a/data/dmmeta/fsort.ssim +++ b/data/dmmeta/fsort.ssim @@ -1,11 +1,9 @@ dmmeta.fsort field:acr.FWrite.c_cmtrec sorttype:QuickSort sortfld:acr.FRec.sortkey comment:"" +dmmeta.fsort field:algo.I32RangeAry.ary sorttype:QuickSort sortfld:algo.i32_Range.beg comment:"" dmmeta.fsort field:algo_lib.FTxttbl.c_txtrow sorttype:QuickSort sortfld:algo_lib.FTxtrow.sortkey comment:"" -dmmeta.fsort field:algo_lib.RegxState.ch_class sorttype:QuickSort sortfld:algo.i32_Range.beg comment:"" dmmeta.fsort field:amc.FCtype.c_ffast sorttype:QuickSort sortfld:dmmeta.Ffast.pos comment:"" dmmeta.fsort field:amc.FCtype.c_field sorttype:QuickSort sortfld:amc.FField.rowid comment:"" dmmeta.fsort field:amc.FDb.c_ctype_sorted sorttype:QuickSort sortfld:dmmeta.Ctype.ctype comment:"" -dmmeta.fsort field:amc.FDb.c_ctypelen sorttype:QuickSort sortfld:dmmeta.Ctypelen.ctype comment:"" -dmmeta.fsort field:amc.FDb.c_dispsig_sorted sorttype:QuickSort sortfld:dmmeta.Dispsig.dispsig comment:"" dmmeta.fsort field:amc.FDb.c_substr_field sorttype:QuickSort sortfld:amc.FSubstr.range comment:"" dmmeta.fsort field:atf_amc.FPerfSortString.sorted1 sorttype:QuickSort sortfld:atf_amc.Cstr.val comment:"" dmmeta.fsort field:atf_amc.FUnitSort.c_ptrary sorttype:QuickSort sortfld:atf_amc.TypeA.typea comment:"" diff --git a/data/dmmeta/fstep.ssim b/data/dmmeta/fstep.ssim index 46b71855..c3c44190 100644 --- a/data/dmmeta/fstep.ssim +++ b/data/dmmeta/fstep.ssim @@ -1,4 +1,4 @@ -dmmeta.fstep fstep:algo_lib.FDb.bh_timehook steptype:Callback comment:"" +dmmeta.fstep fstep:algo_lib.FDb.bh_timehook steptype:InlineOnce comment:"" dmmeta.fstep fstep:algo_lib.FDb.giveup_time steptype:Extern comment:"" dmmeta.fstep fstep:atf_amc.FDb.bh_typec steptype:Extern comment:"" dmmeta.fstep fstep:atf_amc.FDb.zsl_h_typec steptype:Extern comment:"" @@ -6,15 +6,22 @@ dmmeta.fstep fstep:atf_amc.FDb.zs_t_typec steptype:Extern comment:"" dmmeta.fstep fstep:atf_amc.FDb.csl_h_typec steptype:Extern comment:"" dmmeta.fstep fstep:atf_amc.FDb.cs_t_typec steptype:Extern comment:"" dmmeta.fstep fstep:atf_amc.FDb.cd_in_msg steptype:Inline comment:"" -dmmeta.fstep fstep:atf_comp.FDb.zd_sel_comptest steptype:Inline comment:"" +dmmeta.fstep fstep:atf_amc.FDb.bh_time_entry steptype:TimeHookOnce comment:"" dmmeta.fstep fstep:atf_comp.FDb.zd_run_comptest steptype:InlineRecur comment:"" +dmmeta.fstep fstep:atf_exp.FDb.ind_proc_pid steptype:InlineRecur comment:"" +dmmeta.fstep fstep:atf_exp.FDb.cd_proc_read steptype:Inline comment:"" +dmmeta.fstep fstep:atf_exp.FDb.cd_proc_outflow steptype:Inline comment:"" +dmmeta.fstep fstep:atf_exp.FDb.cd_fdin_eof steptype:Inline comment:"" +dmmeta.fstep fstep:atf_exp.FDb.cd_fdin_read steptype:Inline comment:"" dmmeta.fstep fstep:atf_nrun.FDb.ind_running steptype:InlineRecur comment:"" dmmeta.fstep fstep:atf_nrun.FDb.zd_todo steptype:InlineRecur comment:"" dmmeta.fstep fstep:lib_ams.FDb.cd_fdin_eof steptype:Inline comment:"" dmmeta.fstep fstep:lib_ams.FDb.cd_fdin_read steptype:Inline comment:"" -dmmeta.fstep fstep:lib_ams.FDb.cd_stream_hb steptype:InlineRecur comment:"" +dmmeta.fstep fstep:lib_ams.FDb.cd_hb steptype:InlineRecur comment:"" dmmeta.fstep fstep:lib_ams.FDb.zd_flush steptype:InlineRecur comment:"" dmmeta.fstep fstep:lib_ams.FDb.cd_poll_read steptype:Inline comment:"" +dmmeta.fstep fstep:lib_ams.FDb.cd_slow_poll_read steptype:InlineRecur comment:"" +dmmeta.fstep fstep:lib_ams.FDb.bh_shmember_read steptype:Inline comment:"" dmmeta.fstep fstep:samp_meng.FDb.cd_fdin_eof steptype:Inline comment:"" dmmeta.fstep fstep:samp_meng.FDb.cd_fdin_read steptype:Inline comment:"" dmmeta.fstep fstep:ssim2mysql.FDb.zs_cmd steptype:Inline comment:"" diff --git a/data/dmmeta/ftrace.ssim b/data/dmmeta/ftrace.ssim index 9faa5c09..21052691 100644 --- a/data/dmmeta/ftrace.ssim +++ b/data/dmmeta/ftrace.ssim @@ -9,6 +9,18 @@ dmmeta.ftrace field:atf_amc.FDb.cs_t_typec comment:"" dmmeta.ftrace field:atf_amc.FDb.csl_h_typec comment:"" dmmeta.ftrace field:atf_amc.FDb.zs_t_typec comment:"" dmmeta.ftrace field:atf_amc.FDb.zsl_h_typec comment:"" +dmmeta.ftrace field:lib_ams.FDb.bh_shmember_read comment:"" +dmmeta.ftrace field:lib_ams.FDb.cd_fdin_eof comment:"" +dmmeta.ftrace field:lib_ams.FDb.cd_fdin_read comment:"" +dmmeta.ftrace field:lib_ams.FDb.cd_hb comment:"" +dmmeta.ftrace field:lib_ams.FDb.cd_poll_read comment:"" +dmmeta.ftrace field:lib_ams.FDb.cd_slow_poll_read comment:"" +dmmeta.ftrace field:lib_ams.FDb.fdin comment:"" +dmmeta.ftrace field:lib_ams.FDb.proc comment:"" +dmmeta.ftrace field:lib_ams.FDb.shm comment:"" +dmmeta.ftrace field:lib_ams.FDb.shmember comment:"" +dmmeta.ftrace field:lib_ams.FDb.shmtype comment:"" +dmmeta.ftrace field:lib_ams.FDb.zd_flush comment:"" dmmeta.ftrace field:lib_json.FDb.node comment:"" dmmeta.ftrace field:ssim2mysql.FDb.cd_input_line comment:"" dmmeta.ftrace field:ssim2mysql.FDb.zs_cmd comment:"" diff --git a/data/dmmeta/funique.ssim b/data/dmmeta/funique.ssim index f4369e64..3fd0e1df 100644 --- a/data/dmmeta/funique.ssim +++ b/data/dmmeta/funique.ssim @@ -1,5 +1,5 @@ -dmmeta.funique field:amsdb.ProcType.id comment:"" -dmmeta.funique field:amsdb.StreamType.id comment:"" +dmmeta.funique field:amsdb.Proctype.id comment:"" +dmmeta.funique field:amsdb.Shmtype.id comment:"" dmmeta.funique field:dev.Htmlentity.code comment:"" dmmeta.funique field:dev.Syscmd.pid comment:"" dmmeta.funique field:dev.Targsrc.src comment:"" diff --git a/data/dmmeta/fuserinit.ssim b/data/dmmeta/fuserinit.ssim index e69de29b..3bef30ac 100644 --- a/data/dmmeta/fuserinit.ssim +++ b/data/dmmeta/fuserinit.ssim @@ -0,0 +1,2 @@ +dmmeta.fuserinit field:algo_lib.FDb._db comment:"" +dmmeta.fuserinit field:algo_lib.FDb.errns comment:"" diff --git a/data/dmmeta/gconst.ssim b/data/dmmeta/gconst.ssim index 2d4d0acb..f54b2faa 100644 --- a/data/dmmeta/gconst.ssim +++ b/data/dmmeta/gconst.ssim @@ -3,14 +3,15 @@ dmmeta.gconst field:amc.CppkeywordId.id namefld:dmmeta.Cppkeyword.cppkeyword dmmeta.gconst field:amc.Pnewtype.value namefld:dmmeta.Buftype.pnewtype idfld:"" wantenum:N dmmeta.gconst field:amcdb.Curstype.curstype namefld:amcdb.Curstype.curstype idfld:"" wantenum:N dmmeta.gconst field:amcdb.Tclass.tclass namefld:amcdb.Tclass.tclass idfld:amcdb.Tclass.tclass wantenum:N -dmmeta.gconst field:ams.ProcType.value namefld:amsdb.ProcType.proctype idfld:amsdb.ProcType.id wantenum:Y -dmmeta.gconst field:ams.StreamType.value namefld:amsdb.StreamType.streamtype idfld:amsdb.StreamType.id wantenum:Y +dmmeta.gconst field:ams.Proctype.value namefld:amsdb.Proctype.proctype idfld:amsdb.Proctype.id wantenum:Y +dmmeta.gconst field:ams.Shmtype.value namefld:amsdb.Shmtype.shmtype idfld:amsdb.Shmtype.id wantenum:Y dmmeta.gconst field:atfdb.Msgdir.msgdir namefld:atfdb.Msgdir.msgdir idfld:"" wantenum:N dmmeta.gconst field:dev.Arch.arch namefld:dev.Arch.arch idfld:"" wantenum:N dmmeta.gconst field:dev.Builddir.builddir namefld:dev.Builddir.builddir idfld:"" wantenum:N dmmeta.gconst field:dev.Cfg.cfg namefld:dev.Cfg.cfg idfld:"" wantenum:N dmmeta.gconst field:dev.Compiler.compiler namefld:dev.Compiler.compiler idfld:"" wantenum:N dmmeta.gconst field:dev.License.license namefld:dev.License.license idfld:"" wantenum:N +dmmeta.gconst field:dev.Netproto.netproto namefld:dev.Netproto.netproto idfld:"" wantenum:N dmmeta.gconst field:dev.Sandbox.sandbox namefld:dev.Sandbox.sandbox idfld:"" wantenum:N dmmeta.gconst field:dmmeta.Buftype.pnewtype namefld:dmmeta.Buftype.pnewtype idfld:"" wantenum:N dmmeta.gconst field:dmmeta.Fastenc.fastenc namefld:dmmeta.Fastenc.fastenc idfld:"" wantenum:Y @@ -33,10 +34,11 @@ dmmeta.gconst field:gclidb.Gclicmd.gclicmd namefld:gclidb.Gclicmd.gclicmd idf dmmeta.gconst field:gclidb.Gclienv.gclienv namefld:gclidb.Gclienv.gclienv idfld:"" wantenum:N dmmeta.gconst field:gclidb.Gclisub.gclisub namefld:gclidb.Gclisub.gclisub idfld:"" wantenum:N dmmeta.gconst field:gclidb.Gfld.gfld namefld:gclidb.Gfld.gfld idfld:"" wantenum:N -dmmeta.gconst field:gclidb.Grepogitport.grepogitport namefld:gclidb.Grepogitport.grepogitport idfld:"" wantenum:N -dmmeta.gconst field:gclidb.Grepossh.grepossh namefld:gclidb.Grepossh.grepossh idfld:"" wantenum:N dmmeta.gconst field:gclidb.Gstate.gstate namefld:gclidb.Gstate.gstate idfld:"" wantenum:N dmmeta.gconst field:gclidb.Gtbl.gtbl namefld:gclidb.Gtbl.gtbl idfld:"" wantenum:N dmmeta.gconst field:gclidb.Gtblact.gtblact namefld:gclidb.Gtblact.gtblact idfld:"" wantenum:N dmmeta.gconst field:gclidb.Gtype.gtype namefld:gclidb.Gtype.gtype idfld:"" wantenum:N dmmeta.gconst field:gclidb.Label.label namefld:gclidb.Label.label idfld:"" wantenum:N +dmmeta.gconst field:http.HeaderType.value namefld:httpdb.Header.header idfld:"" wantenum:Y +dmmeta.gconst field:http.Method.value namefld:httpdb.Method.method idfld:httpdb.Method.id wantenum:Y +dmmeta.gconst field:ws.StatusCode.value namefld:wsdb.Status.reason idfld:wsdb.Status.code wantenum:N diff --git a/data/dmmeta/gstatic.ssim b/data/dmmeta/gstatic.ssim index ff96e830..90bedbd0 100644 --- a/data/dmmeta/gstatic.ssim +++ b/data/dmmeta/gstatic.ssim @@ -12,4 +12,5 @@ dmmeta.gstatic field:atf_fuzz.FDb.fuzzstrat comment:"" dmmeta.gstatic field:atf_unit.FDb.unittest comment:"" dmmeta.gstatic field:gcli.FDb.gclicmd comment:"" dmmeta.gstatic field:gcli.FDb.gtblact comment:"" -dmmeta.gstatic field:lib_ams.FDb.streamtype comment:"" +dmmeta.gstatic field:lib_ams.FDb.shmtype comment:"" +dmmeta.gstatic field:lib_http.FDb.status comment:"" diff --git a/data/dmmeta/gsymbol.ssim b/data/dmmeta/gsymbol.ssim index 8d91d975..605f92cc 100644 --- a/data/dmmeta/gsymbol.ssim +++ b/data/dmmeta/gsymbol.ssim @@ -3,6 +3,8 @@ dmmeta.gsymbol gsymbol:acr_ed/atfdb.cijob inc:% symboltype:char* comment:"" dmmeta.gsymbol gsymbol:acr_ed/dev.package inc:openacr symboltype:algo.strptr comment:"" dmmeta.gsymbol gsymbol:amc/amcdb.regxtype inc:% symboltype:algo.strptr comment:"" dmmeta.gsymbol gsymbol:amc/dev.gitfile inc:conf/copyright.txt symboltype:algo.strptr comment:"" +dmmeta.gsymbol gsymbol:amc/dmmeta.fbufiotype inc:% symboltype:char* comment:"" +dmmeta.gsymbol gsymbol:amc/dmmeta.kafka_type_kind inc:% symboltype:"" comment:"" dmmeta.gsymbol gsymbol:apm/dev.package inc:openacr symboltype:algo.strptr comment:"" dmmeta.gsymbol gsymbol:atf_amc/atfdb.test_gsymbol_char inc:"" symboltype:char* comment:"" dmmeta.gsymbol gsymbol:atf_amc/atfdb.test_gsymbol_pkey inc:"" symboltype:"" comment:"" @@ -11,8 +13,9 @@ dmmeta.gsymbol gsymbol:atf_ci/atfdb.cijob inc:% symboltype:"" comment:"" dmmeta.gsymbol gsymbol:atf_ci/dev.gitfile inc:"(xml/%|conf/copyright.txt)" symboltype:"" comment:"" dmmeta.gsymbol gsymbol:atf_ci/dev.scriptfile inc:"(bin/update-%|bin/compute-%|bin/%-gen|bin/find-non-copyrighted)" symboltype:char* comment:"" dmmeta.gsymbol gsymbol:atf_ci/dmmeta.ssimfile inc:atfdb.cipackage symboltype:"" comment:"" +dmmeta.gsymbol gsymbol:http/httpdb.version inc:% symboltype:algo.strptr comment:"" dmmeta.gsymbol gsymbol:lib_ams/amsdb.proctype inc:% symboltype:char* comment:"" -dmmeta.gsymbol gsymbol:lib_ams/amsdb.streamtype inc:% symboltype:char* comment:"" +dmmeta.gsymbol gsymbol:lib_ams/amsdb.shmtype inc:% symboltype:char* comment:"" dmmeta.gsymbol gsymbol:lib_fm/fmdb.alm_code inc:% symboltype:char* comment:"" dmmeta.gsymbol gsymbol:lib_fm/fmdb.alm_objtype inc:% symboltype:char* comment:"" dmmeta.gsymbol gsymbol:lib_fm/fmdb.alm_source inc:% symboltype:char* comment:"" diff --git a/data/dmmeta/hashtype.ssim b/data/dmmeta/hashtype.ssim index f660a91d..25293378 100644 --- a/data/dmmeta/hashtype.ssim +++ b/data/dmmeta/hashtype.ssim @@ -1,2 +1,3 @@ -dmmeta.hashtype hashtype:Extern comment:"" -dmmeta.hashtype hashtype:CRC32 comment:"" +dmmeta.hashtype hashtype:Extern comment:"Implemened externally" +dmmeta.hashtype hashtype:CRC32 comment:"Variant of CRC32" +dmmeta.hashtype hashtype:Linear comment:"Identity hash used as direct index (no collisions)" diff --git a/data/dmmeta/hook.ssim b/data/dmmeta/hook.ssim index 6c1ec46b..4c2fd9d2 100644 --- a/data/dmmeta/hook.ssim +++ b/data/dmmeta/hook.ssim @@ -1,19 +1,21 @@ -dmmeta.hook field:abt_md.FMdsection.step comment:"" -dmmeta.hook field:acr_ed.FEdaction.step comment:"" -dmmeta.hook field:algo_lib.FDb.h_fatalerror comment:"" -dmmeta.hook field:algo_lib.FIohook.callback comment:"" -dmmeta.hook field:algo_lib.FTimehook.hook comment:"" -dmmeta.hook field:amc.FGen.step comment:"" -dmmeta.hook field:amc.FTclass.step comment:"" -dmmeta.hook field:amc.FTfunc.step comment:"" -dmmeta.hook field:atf_amc.FAmctest.step comment:"" -dmmeta.hook field:atf_amc.FListtype.step comment:"" -dmmeta.hook field:atf_amc.Hooktype.callback comment:"" -dmmeta.hook field:atf_ci.FCitest.step comment:"" -dmmeta.hook field:atf_fuzz.FFuzzstrat.step comment:"" -dmmeta.hook field:atf_unit.FUnittest.step comment:"" -dmmeta.hook field:gcli.FGclicmd.step comment:"" -dmmeta.hook field:gcli.FGtblact.step comment:"" -dmmeta.hook field:lib_ams.FStream.h_msg comment:"Message processing hook" -dmmeta.hook field:lib_ams.FStream.h_msg_orig comment:"Message processing hook" -dmmeta.hook field:lib_fm.FDb.h_alarm comment:"" +dmmeta.hook field:abt_md.FMdsection.step +dmmeta.hook field:acr_ed.FEdaction.step +dmmeta.hook field:algo_lib.FDb.h_fatalerror +dmmeta.hook field:algo_lib.FErrns.decode +dmmeta.hook field:algo_lib.FIohook.callback +dmmeta.hook field:algo_lib.FTimehook.hook +dmmeta.hook field:amc.FGen.step +dmmeta.hook field:amc.FTclass.step +dmmeta.hook field:amc.FTfunc.step +dmmeta.hook field:atf_amc.FAmctest.step +dmmeta.hook field:atf_amc.FListtype.step +dmmeta.hook field:atf_amc.Hooktype.callback +dmmeta.hook field:atf_ci.FCitest.step +dmmeta.hook field:atf_fuzz.FFuzzstrat.step +dmmeta.hook field:atf_unit.FUnittest.step +dmmeta.hook field:gcli.FGclicmd.step +dmmeta.hook field:gcli.FGtblact.step +dmmeta.hook field:lib_ams.FShm.h_amsmsg +dmmeta.hook field:lib_ams.FShm.h_msg_orig +dmmeta.hook field:lib_ams.MsgFmt.h_convert +dmmeta.hook field:lib_fm.FDb.h_alarm diff --git a/data/dmmeta/inlary.ssim b/data/dmmeta/inlary.ssim index 37e551cc..c0dfd893 100644 --- a/data/dmmeta/inlary.ssim +++ b/data/dmmeta/inlary.ssim @@ -4,6 +4,7 @@ dmmeta.inlary field:algo.Charset.ch min:8 max:8 comment:"" dmmeta.inlary field:algo.Md5Digest.value min:16 max:16 comment:"" dmmeta.inlary field:algo.Sha1sig.sha1sig min:20 max:20 comment:"" dmmeta.inlary field:algo.Uuid.value min:16 max:16 comment:"" +dmmeta.inlary field:algo_lib.FDb.errns min:8 max:8 comment:"" dmmeta.inlary field:algo_lib.FDb.imdb min:0 max:32 comment:"" dmmeta.inlary field:algo_lib.FDb.logcat min:0 max:1 comment:"" dmmeta.inlary field:algo_lib.FDb.temp_strings min:8 max:8 comment:"" @@ -16,3 +17,4 @@ dmmeta.inlary field:atf_amc.FUnitSort.fixary min:100 max:100 comment:"" dmmeta.inlary field:atf_amc.InlaryPrint.fixary min:3 max:3 comment:"" dmmeta.inlary field:atf_amc.InlaryPrint.inlary min:0 max:10 comment:"" dmmeta.inlary field:atf_amc.PmaskU555.pmask min:10 max:10 comment:"" +dmmeta.inlary field:lib_http.FDb.status min:0 max:1 comment:"" diff --git a/data/dmmeta/jstype.ssim b/data/dmmeta/jstype.ssim new file mode 100644 index 00000000..e3eb087b --- /dev/null +++ b/data/dmmeta/jstype.ssim @@ -0,0 +1,7 @@ +dmmeta.jstype ctype:algo.SeqType comment:"" +dmmeta.jstype ctype:algo.UnTime comment:"" +dmmeta.jstype ctype:algo.Uuid comment:"" +dmmeta.jstype ctype:algo_lib.RegxFlags comment:"" +dmmeta.jstype ctype:ams.MsgHeader comment:"" +dmmeta.jstype ctype:ams.ProcId comment:"" +dmmeta.jstype ctype:ams.Proctype comment:"" diff --git a/data/dmmeta/kafka_type_kind.ssim b/data/dmmeta/kafka_type_kind.ssim new file mode 100644 index 00000000..b7185833 --- /dev/null +++ b/data/dmmeta/kafka_type_kind.ssim @@ -0,0 +1,6 @@ +dmmeta.kafka_type_kind kafka_type_kind:common comment:"Struct scoped to single root type" +dmmeta.kafka_type_kind kafka_type_kind:data comment:"Global data structure" +dmmeta.kafka_type_kind kafka_type_kind:field comment:"Struct scoped to single field" +dmmeta.kafka_type_kind kafka_type_kind:header comment:"Global header" +dmmeta.kafka_type_kind kafka_type_kind:request comment:"Request message" +dmmeta.kafka_type_kind kafka_type_kind:response comment:"Response message" diff --git a/data/dmmeta/lenfld.ssim b/data/dmmeta/lenfld.ssim index b104330c..da543930 100644 --- a/data/dmmeta/lenfld.ssim +++ b/data/dmmeta/lenfld.ssim @@ -8,4 +8,9 @@ dmmeta.lenfld field:atf_amc.VarlenAlloc.length extra:0 dmmeta.lenfld field:atf_amc.VarlenExtern.length extra:0 dmmeta.lenfld field:atf_amc.VarlenH.length extra:0 dmmeta.lenfld field:atf_amc.VarlenK.length extra:0 +dmmeta.lenfld field:kafka.Frame.size extra:-4 dmmeta.lenfld field:samp_meng.MsgHeader.length extra:0 +dmmeta.lenfld field:ws.Frame16.ext_payload_len extra:-4 +dmmeta.lenfld field:ws.Frame64.ext_payload_len extra:-10 +dmmeta.lenfld field:ws.FrameMasked16.ext_payload_len extra:-8 +dmmeta.lenfld field:ws.FrameMasked64.ext_payload_len extra:-14 diff --git a/data/dmmeta/llist.ssim b/data/dmmeta/llist.ssim index e7019985..6a1d27af 100644 --- a/data/dmmeta/llist.ssim +++ b/data/dmmeta/llist.ssim @@ -3,10 +3,12 @@ dmmeta.llist field:abt.FDb.zs_origsel_target havetail:Y havecount:N comment: dmmeta.llist field:abt.FDb.zs_sel_target havetail:Y havecount:Y comment:"" dmmeta.llist field:abt.FDb.zs_srcfile_read havetail:Y havecount:N comment:"" dmmeta.llist field:abt.FSrcfile.zd_include havetail:Y havecount:Y comment:"" +dmmeta.llist field:abt_md.FDb.zd_scanns havetail:Y havecount:Y comment:"" dmmeta.llist field:abt_md.FMdsection.zd_file_section havetail:Y havecount:Y comment:"" +dmmeta.llist field:abt_md.FNs.zd_finput havetail:Y havecount:Y comment:"" dmmeta.llist field:acr.FCtype.zd_arg havetail:Y havecount:Y comment:"" -dmmeta.llist field:acr.FCtype.zd_ctype_rec havetail:Y havecount:N comment:"" -dmmeta.llist field:acr.FCtype.zd_ctype_selrec havetail:Y havecount:N comment:"" +dmmeta.llist field:acr.FCtype.zd_rec havetail:Y havecount:N comment:"" +dmmeta.llist field:acr.FCtype.zd_selrec havetail:Y havecount:N comment:"" dmmeta.llist field:acr.FDb.zd_all_err havetail:Y havecount:Y comment:"" dmmeta.llist field:acr.FDb.zd_all_selrec havetail:Y havecount:Y comment:"" dmmeta.llist field:acr.FDb.zd_pdep havetail:Y havecount:N comment:"" @@ -30,6 +32,7 @@ dmmeta.llist field:acr_in.FSsimfile.zd_nsssimfile_ssimfile havetail:Y havecou dmmeta.llist field:amc.FCtype.zd_access havetail:Y havecount:Y comment:"" dmmeta.llist field:amc.FCtype.zd_cafter havetail:Y havecount:Y comment:"" dmmeta.llist field:amc.FCtype.zd_inst havetail:Y havecount:Y comment:"" +dmmeta.llist field:amc.FCtype.zd_varlenfld havetail:Y havecount:Y comment:"" dmmeta.llist field:amc.FCtype.zs_cfmt havetail:Y havecount:N comment:"" dmmeta.llist field:amc.FCtype.zs_xref havetail:Y havecount:Y comment:"" dmmeta.llist field:amc.FDb.cd_temp_func havetail:N havecount:Y comment:"" @@ -43,12 +46,12 @@ dmmeta.llist field:amc.FField.zd_xref_keyfld havetail:Y havecount:Y comment: dmmeta.llist field:amc.FField.zs_fcmap havetail:Y havecount:N comment:"" dmmeta.llist field:amc.FReftype.zs_fprefix havetail:Y havecount:N comment:"" dmmeta.llist field:amc_vis.FDb.zd_select havetail:Y havecount:Y comment:"" +dmmeta.llist field:amc_vis.FLink.zd_linkdep_in havetail:Y havecount:N comment:"" +dmmeta.llist field:amc_vis.FLink.zd_linkdep_out havetail:Y havecount:N comment:"" dmmeta.llist field:amc_vis.FNode.zd_link_in havetail:Y havecount:Y comment:"" dmmeta.llist field:amc_vis.FNode.zd_link_out havetail:Y havecount:Y comment:"" dmmeta.llist field:amc_vis.FNode.zd_nodedep_in havetail:Y havecount:Y comment:"" dmmeta.llist field:amc_vis.FNode.zd_nodedep_out havetail:Y havecount:N comment:"" -dmmeta.llist field:amc_vis.Link.zd_linkdep_in havetail:Y havecount:N comment:"" -dmmeta.llist field:amc_vis.Link.zd_linkdep_out havetail:Y havecount:N comment:"" dmmeta.llist field:apm.FDb.zd_chooserec havetail:Y havecount:Y comment:"" dmmeta.llist field:apm.FDb.zd_rec havetail:Y havecount:Y comment:"" dmmeta.llist field:apm.FDb.zd_sel_package havetail:Y havecount:Y comment:"" @@ -75,23 +78,28 @@ dmmeta.llist field:atf_amc.FDb.zsl_h_typec havetail:Y havecount:Y comment:"" dmmeta.llist field:atf_amc.FTypeA.zdl_typeb havetail:Y havecount:Y comment:"" dmmeta.llist field:atf_amc.FTypeS.zdl_typet havetail:Y havecount:Y comment:"" dmmeta.llist field:atf_comp.FComptest.zd_tmsg havetail:Y havecount:Y comment:"" +dmmeta.llist field:atf_comp.FDb.zd_covdir_free havetail:Y havecount:Y comment:"" dmmeta.llist field:atf_comp.FDb.zd_out_comptest havetail:Y havecount:Y comment:"" dmmeta.llist field:atf_comp.FDb.zd_out_targs havetail:Y havecount:Y comment:"" dmmeta.llist field:atf_comp.FDb.zd_out_tfilt havetail:Y havecount:Y comment:"" dmmeta.llist field:atf_comp.FDb.zd_out_tmsg havetail:Y havecount:Y comment:"" dmmeta.llist field:atf_comp.FDb.zd_run_comptest havetail:Y havecount:Y comment:"" dmmeta.llist field:atf_comp.FDb.zd_sel_comptest havetail:Y havecount:Y comment:"" +dmmeta.llist field:atf_exp.FDb.cd_fdin_eof havetail:N havecount:Y comment:"" +dmmeta.llist field:atf_exp.FDb.cd_fdin_read havetail:N havecount:Y comment:"" +dmmeta.llist field:atf_exp.FDb.cd_fdin_suspend havetail:N havecount:Y comment:"" +dmmeta.llist field:atf_exp.FDb.cd_proc_outflow havetail:N havecount:Y comment:"" +dmmeta.llist field:atf_exp.FDb.cd_proc_read havetail:N havecount:Y comment:"" +dmmeta.llist field:atf_exp.FDb.zd_proc havetail:Y havecount:Y comment:"" dmmeta.llist field:atf_nrun.FDb.zd_todo havetail:Y havecount:Y comment:"" dmmeta.llist field:gcli.FDb.zd_gtblact havetail:Y havecount:Y comment:"" dmmeta.llist field:lib_ams.FDb.cd_fdin_eof havetail:N havecount:Y comment:"" dmmeta.llist field:lib_ams.FDb.cd_fdin_read havetail:N havecount:Y comment:"" +dmmeta.llist field:lib_ams.FDb.cd_hb havetail:N havecount:Y comment:"" dmmeta.llist field:lib_ams.FDb.cd_poll_read havetail:N havecount:Y comment:"" -dmmeta.llist field:lib_ams.FDb.cd_stream_hb havetail:N havecount:Y comment:"" -dmmeta.llist field:lib_ams.FDb.zd_ctlin havetail:Y havecount:Y comment:"" +dmmeta.llist field:lib_ams.FDb.cd_slow_poll_read havetail:N havecount:Y comment:"" dmmeta.llist field:lib_ams.FDb.zd_flush havetail:Y havecount:Y comment:"" dmmeta.llist field:lib_ams.FDb.zd_proc havetail:Y havecount:Y comment:"" -dmmeta.llist field:lib_ams.FProc.zd_member_byproc havetail:Y havecount:Y comment:"" -dmmeta.llist field:lib_ams.FStream.zd_member_bystream havetail:Y havecount:Y comment:"" dmmeta.llist field:lib_ctype.FField.zd_fconst havetail:Y havecount:Y comment:"" dmmeta.llist field:lib_exec.FDb.zd_started havetail:Y havecount:Y comment:"" dmmeta.llist field:lib_sqlite.FCtype.zd_row havetail:Y havecount:Y comment:"" @@ -100,6 +108,7 @@ dmmeta.llist field:samp_meng.FDb.cd_fdin_read havetail:N havecount:Y comment dmmeta.llist field:samp_meng.FUser.zd_order havetail:Y havecount:Y comment:"" dmmeta.llist field:src_func.FTarget.cd_targsrc havetail:N havecount:Y comment:"" dmmeta.llist field:src_func.FTargsrc.zd_func havetail:Y havecount:Y comment:"" +dmmeta.llist field:src_func.FUserfunc.zd_func havetail:Y havecount:Y comment:"" dmmeta.llist field:src_lim.FGitfile.zd_include havetail:Y havecount:Y comment:"" dmmeta.llist field:ssim2mysql.FDb.cd_input_line havetail:N havecount:N comment:"" dmmeta.llist field:ssim2mysql.FDb.zd_ssimfile havetail:Y havecount:N comment:"" diff --git a/data/dmmeta/logcat.ssim b/data/dmmeta/logcat.ssim index 82961102..abc31237 100644 --- a/data/dmmeta/logcat.ssim +++ b/data/dmmeta/logcat.ssim @@ -1,3 +1,10 @@ -dmmeta.logcat logcat:expect enabled:N builtin:N comment:"lib_ams expect implementation" -dmmeta.logcat logcat:stderr enabled:Y builtin:Y comment:"Standard error (cannot be disabled)" -dmmeta.logcat logcat:stdout enabled:Y builtin:Y comment:"Standard output (cannot be disabled)" +dmmeta.logcat logcat:ams enabled:N builtin:N stdout:Y maxmsg:0 window:0 comment:"Trace ams bus" +dmmeta.logcat logcat:debug enabled:N builtin:N stdout:N maxmsg:0 window:0 comment:"Debug messages" +dmmeta.logcat logcat:inserr enabled:N builtin:Y stdout:N maxmsg:10 window:10 comment:"In-memory db insert error" +dmmeta.logcat logcat:slowness enabled:N builtin:N stdout:Y maxmsg:10 window:5 comment:"Debug slowness" +dmmeta.logcat logcat:stderr enabled:Y builtin:Y stdout:N maxmsg:0 window:0 comment:"Standard error (cannot be disabled)" +dmmeta.logcat logcat:stdout enabled:Y builtin:Y stdout:Y maxmsg:0 window:0 comment:"Standard output (cannot be disabled)" +dmmeta.logcat logcat:timestamps enabled:N builtin:N stdout:Y maxmsg:0 window:0 comment:"Show timestamps" +dmmeta.logcat logcat:verbose enabled:N builtin:N stdout:N maxmsg:0 window:0 comment:"Verbose messages go here" +dmmeta.logcat logcat:verbose2 enabled:N builtin:N stdout:N maxmsg:0 window:0 comment:"Extra verbose messages go here" +dmmeta.logcat logcat:warn enabled:Y builtin:N stdout:N maxmsg:100 window:5 comment:Warnings diff --git a/data/dmmeta/main.ssim b/data/dmmeta/main.ssim index 9270b3af..f37e8338 100644 --- a/data/dmmeta/main.ssim +++ b/data/dmmeta/main.ssim @@ -9,7 +9,6 @@ dmmeta.main ns:acr_my ismodule:N dmmeta.main ns:amc ismodule:N dmmeta.main ns:amc_gc ismodule:N dmmeta.main ns:amc_vis ismodule:N -dmmeta.main ns:ams_cat ismodule:N dmmeta.main ns:ams_sendtest ismodule:N dmmeta.main ns:apm ismodule:N dmmeta.main ns:aqlite ismodule:N @@ -18,6 +17,7 @@ dmmeta.main ns:atf_ci ismodule:N dmmeta.main ns:atf_cmdline ismodule:N dmmeta.main ns:atf_comp ismodule:N dmmeta.main ns:atf_cov ismodule:N +dmmeta.main ns:atf_exp ismodule:N dmmeta.main ns:atf_fuzz ismodule:N dmmeta.main ns:atf_gcli ismodule:N dmmeta.main ns:atf_nrun ismodule:N @@ -25,9 +25,11 @@ dmmeta.main ns:atf_unit ismodule:N dmmeta.main ns:bash2html ismodule:N dmmeta.main ns:gcache ismodule:N dmmeta.main ns:gcli ismodule:N +dmmeta.main ns:jkv ismodule:N dmmeta.main ns:mdbg ismodule:N dmmeta.main ns:mysql2ssim ismodule:N dmmeta.main ns:orgfile ismodule:N +dmmeta.main ns:samp_make ismodule:N dmmeta.main ns:samp_meng ismodule:N dmmeta.main ns:samp_regx ismodule:N dmmeta.main ns:sandbox ismodule:N diff --git a/data/dmmeta/msgtype.ssim b/data/dmmeta/msgtype.ssim index 244f1fc0..9d18d00f 100644 --- a/data/dmmeta/msgtype.ssim +++ b/data/dmmeta/msgtype.ssim @@ -1,23 +1,17 @@ -dmmeta.msgtype ctype:ams.AlarmSyncMsg type:18 -dmmeta.msgtype ctype:ams.DfltStream type:21 -dmmeta.msgtype ctype:ams.DumpStreamTableMsg type:12 dmmeta.msgtype ctype:ams.ExpectMsg type:395 -dmmeta.msgtype ctype:ams.HeartbeatMsg type:16 dmmeta.msgtype ctype:ams.InputLineMsg type:22 dmmeta.msgtype ctype:ams.LogMsg type:6 dmmeta.msgtype ctype:ams.MsgBlock type:1 -dmmeta.msgtype ctype:ams.OpenMsg type:7 -dmmeta.msgtype ctype:ams.PrlogMsg type:229 -dmmeta.msgtype ctype:ams.ProcAddMsg type:4 -dmmeta.msgtype ctype:ams.ProcRemoveMsg type:5 -dmmeta.msgtype ctype:ams.Seqmsg type:10 -dmmeta.msgtype ctype:ams.SeqmsgTrace type:11 -dmmeta.msgtype ctype:ams.StreamHbMsg type:3 +dmmeta.msgtype ctype:ams.ProcEofMsg type:703 +dmmeta.msgtype ctype:ams.ProcKillMsg type:704 +dmmeta.msgtype ctype:ams.ProcMsg type:701 +dmmeta.msgtype ctype:ams.ProcReadMsg type:702 +dmmeta.msgtype ctype:ams.ProcStartMsg type:700 +dmmeta.msgtype ctype:ams.ProcStatusMsg type:705 +dmmeta.msgtype ctype:ams.RemDirRecurseMsg type:633 +dmmeta.msgtype ctype:ams.ShmHbMsg type:3 +dmmeta.msgtype ctype:ams.Shmmsg type:10 dmmeta.msgtype ctype:ams.TerminateMsg type:352 -dmmeta.msgtype ctype:ams.Trace2Msg type:108 -dmmeta.msgtype ctype:ams.TraceInfo2Msg type:109 -dmmeta.msgtype ctype:ams.TraceInfoMsg type:9 -dmmeta.msgtype ctype:ams.TraceMsg type:8 dmmeta.msgtype ctype:ams.UdpFrame type:2 dmmeta.msgtype ctype:atf_amc.MsgLTA type:"'A'" dmmeta.msgtype ctype:atf_amc.MsgLTB type:"'B'" @@ -25,8 +19,14 @@ dmmeta.msgtype ctype:atf_amc.MsgLTO type:"'O'" dmmeta.msgtype ctype:atf_amc.MsgLTV type:"'V'" dmmeta.msgtype ctype:atf_amc.Seqmsg type:0x0905 dmmeta.msgtype ctype:atf_amc.Text type:0x0412 +dmmeta.msgtype ctype:atf_amc.Varlen2Msg type:0x1001 +dmmeta.msgtype ctype:atf_amc.Varlen2aMsg type:0x1002 +dmmeta.msgtype ctype:atf_amc.Varlen2mMsg type:0x1004 +dmmeta.msgtype ctype:atf_amc.Varlen2vMsg type:0x1003 dmmeta.msgtype ctype:atf_amc.VarlenMsg type:0x1000 dmmeta.msgtype ctype:fm.AlarmMsg type:17 +dmmeta.msgtype ctype:kafka.OffsetCommitKey type:1 +dmmeta.msgtype ctype:kafka.OffsetCommitValue type:1 dmmeta.msgtype ctype:samp_meng.CancelOrderMsg type:3 dmmeta.msgtype ctype:samp_meng.CancelReqMsg type:11 dmmeta.msgtype ctype:samp_meng.MassCancelReqMsg type:12 @@ -38,3 +38,12 @@ dmmeta.msgtype ctype:samp_meng.NewUserMsg type:6 dmmeta.msgtype ctype:samp_meng.NewUserReqMsg type:14 dmmeta.msgtype ctype:samp_meng.OrderTradeMsg type:4 dmmeta.msgtype ctype:samp_meng.TextMsg type:7 +dmmeta.msgtype ctype:ws.CloseMsg type:504 +dmmeta.msgtype ctype:ws.ConnectMsg type:502 +dmmeta.msgtype ctype:ws.DataMsg type:503 +dmmeta.msgtype ctype:ws.Frame16 type:126 +dmmeta.msgtype ctype:ws.Frame64 type:127 +dmmeta.msgtype ctype:ws.FrameMasked16 type:254 +dmmeta.msgtype ctype:ws.FrameMasked64 type:255 +dmmeta.msgtype ctype:ws.ServerStartMsg type:500 +dmmeta.msgtype ctype:ws.ServerStopMsg type:501 diff --git a/data/dmmeta/nocascdel.ssim b/data/dmmeta/nocascdel.ssim index d5b36f55..1c523e1d 100644 --- a/data/dmmeta/nocascdel.ssim +++ b/data/dmmeta/nocascdel.ssim @@ -1,6 +1,6 @@ dmmeta.nocascdel xref:acr.FCtype.ind_ctype_rec comment:"" -dmmeta.nocascdel xref:acr.FCtype.zd_ctype_rec comment:"" -dmmeta.nocascdel xref:acr.FCtype.zd_ctype_selrec comment:"" +dmmeta.nocascdel xref:acr.FCtype.zd_rec comment:"" +dmmeta.nocascdel xref:acr.FCtype.zd_selrec comment:"" dmmeta.nocascdel xref:acr.FFile.zd_frec comment:"" dmmeta.nocascdel xref:acr.FPline.zd_child comment:"" dmmeta.nocascdel xref:acr.FRec.c_pline comment:"" diff --git a/data/dmmeta/ns.ssim b/data/dmmeta/ns.ssim index af38fe0c..a86c1838 100644 --- a/data/dmmeta/ns.ssim +++ b/data/dmmeta/ns.ssim @@ -14,7 +14,6 @@ dmmeta.ns ns:amc_gc nstype:exe license:GPL comment:"Garbage collector for in dmmeta.ns ns:amc_vis nstype:exe license:GPL comment:"Draw access path diagrams" dmmeta.ns ns:amcdb nstype:ssimdb license:GPL comment:"Algo Model Compiler support tables" dmmeta.ns ns:ams nstype:protocol license:GPL comment:"Algo Messaging System protocol" -dmmeta.ns ns:ams_cat nstype:exe license:GPL comment:"Algo Messaging System sample tool" dmmeta.ns ns:ams_sendtest nstype:exe license:GPL comment:"Algo Messaging System test tool" dmmeta.ns ns:amsdb nstype:ssimdb license:GPL comment:"AMS configuration (ssim database)" dmmeta.ns ns:apm nstype:exe license:GPL comment:"Algo Package Manager" @@ -25,6 +24,7 @@ dmmeta.ns ns:atf_ci nstype:exe license:GPL comment:"Normalization tests (see dmmeta.ns ns:atf_cmdline nstype:exe license:GPL comment:"Test tool for command line parsing" dmmeta.ns ns:atf_comp nstype:exe license:GPL comment:"Algo Test Framework - Component test execution" dmmeta.ns ns:atf_cov nstype:exe license:GPL comment:"Line coverage" +dmmeta.ns ns:atf_exp nstype:exe license:GPL comment:"ATF expect" dmmeta.ns ns:atf_fuzz nstype:exe license:GPL comment:"Generator of bad inputs for targets" dmmeta.ns ns:atf_gcli nstype:exe license:GPL comment:"test harness for gcli" dmmeta.ns ns:atf_nrun nstype:exe license:GPL comment:"Run N subprocesses in parallel" @@ -39,25 +39,37 @@ dmmeta.ns ns:fmdb nstype:ssimdb license:GPL comment:"Fault management tables dmmeta.ns ns:gcache nstype:exe license:GPL comment:"Compiler cache" dmmeta.ns ns:gcli nstype:exe license:GPL comment:"Gcli - gitlab/github command-line client" dmmeta.ns ns:gclidb nstype:ssimdb license:GPL comment:"gcli db" +dmmeta.ns ns:http nstype:protocol license:GPL comment:"" +dmmeta.ns ns:httpdb nstype:ssimdb license:GPL comment:"" dmmeta.ns ns:ietf nstype:protocol license:GPL comment:"Some IETF structs" +dmmeta.ns ns:jkv nstype:exe license:GPL comment:"JSON <-> key-value mapping tool" +dmmeta.ns ns:js nstype:protocol license:GPL comment:"Reserved for JavaScript builtin types" +dmmeta.ns ns:kafka nstype:protocol license:GPL comment:"Kafka protocol" dmmeta.ns ns:lib_amcdb nstype:lib license:GPL comment:"Library used by amc" dmmeta.ns ns:lib_ams nstype:lib license:GPL comment:"Library for AMS middleware, supporting file format & messaging" dmmeta.ns ns:lib_ctype nstype:lib license:GPL comment:"Helpful library for reading/writing ctypes as text tuples" +dmmeta.ns ns:lib_curl nstype:lib license:GPL comment:"covers curl_easy" dmmeta.ns ns:lib_exec nstype:lib license:GPL comment:"Build and run a dag of subprocesses with N parallel jobs" dmmeta.ns ns:lib_fm nstype:lib license:GPL comment:"Library for dynamic alarm management" dmmeta.ns ns:lib_git nstype:lib license:GPL comment:"Helpful git wrappers" +dmmeta.ns ns:lib_http nstype:lib license:GPL comment:"Library for HTTP support" dmmeta.ns ns:lib_iconv nstype:lib license:GPL comment:"Iconv wrapper" dmmeta.ns ns:lib_json nstype:lib license:GPL comment:"Full json support library" dmmeta.ns ns:lib_mysql nstype:lib license:GPL comment:"Mysql adaptor" +dmmeta.ns ns:lib_netio nstype:lib license:GPL comment:"Network I/O library" dmmeta.ns ns:lib_prot nstype:lib license:GPL comment:"Library covering all protocols" +dmmeta.ns ns:lib_rl nstype:lib license:GPL comment:"GNU readline support library" dmmeta.ns ns:lib_sql nstype:lib license:GPL comment:"SQL formatting functions" dmmeta.ns ns:lib_sqlite nstype:lib license:GPL comment:"" +dmmeta.ns ns:lib_ws nstype:lib license:GPL comment:"WebSocket library" dmmeta.ns ns:mdbg nstype:exe license:GPL comment:"Gdb front-end" dmmeta.ns ns:mysql2ssim nstype:exe license:GPL comment:"mysql -> ssim conversion tool" dmmeta.ns ns:orgfile nstype:exe license:GPL comment:"Organize and deduplicate files by timestamp and by contents" dmmeta.ns ns:report nstype:protocol license:GPL comment:"Command reports" -dmmeta.ns ns:samp_meng nstype:exe license:GPL comment:"" +dmmeta.ns ns:samp_make nstype:exe license:GPL comment:"sample program for Makefile management" +dmmeta.ns ns:samp_meng nstype:exe license:GPL comment:"Sample matching engine" dmmeta.ns ns:samp_regx nstype:exe license:GPL comment:"Test tool for regular expressions" +dmmeta.ns ns:sampdb nstype:ssimdb license:GPL comment:"ssimdb for tutorials and recipes" dmmeta.ns ns:sandbox nstype:exe license:GPL comment:"Sandbox - sandbox management tool" dmmeta.ns ns:src_func nstype:exe license:GPL comment:"Access / edit functions" dmmeta.ns ns:src_hdr nstype:exe license:GPL comment:"Manage source copyright+license header in source files and scripts" @@ -67,3 +79,5 @@ dmmeta.ns ns:ssim2mysql nstype:exe license:GPL comment:"Ssim -> mysql" dmmeta.ns ns:ssimfilt nstype:exe license:GPL comment:"Tuple utility" dmmeta.ns ns:strconv nstype:exe license:GPL comment:"A simple string utility" dmmeta.ns ns:sv2ssim nstype:exe license:GPL comment:"sv2ssim - Separated Value file processor" +dmmeta.ns ns:ws nstype:protocol license:GPL comment:"WebSocket binary protocol" +dmmeta.ns ns:wsdb nstype:ssimdb license:GPL comment:"WebSocket db" diff --git a/data/dmmeta/nscpp.ssim b/data/dmmeta/nscpp.ssim index 89131cfc..4c08cf90 100644 --- a/data/dmmeta/nscpp.ssim +++ b/data/dmmeta/nscpp.ssim @@ -14,7 +14,6 @@ dmmeta.nscpp ns:amc_gc comment:"" dmmeta.nscpp ns:amc_vis comment:"" dmmeta.nscpp ns:amcdb comment:"" dmmeta.nscpp ns:ams comment:"" -dmmeta.nscpp ns:ams_cat comment:"" dmmeta.nscpp ns:ams_sendtest comment:"" dmmeta.nscpp ns:amsdb comment:"" dmmeta.nscpp ns:apm comment:"" @@ -25,6 +24,7 @@ dmmeta.nscpp ns:atf_ci comment:"" dmmeta.nscpp ns:atf_cmdline comment:"" dmmeta.nscpp ns:atf_comp comment:"" dmmeta.nscpp ns:atf_cov comment:"" +dmmeta.nscpp ns:atf_exp comment:"" dmmeta.nscpp ns:atf_fuzz comment:"" dmmeta.nscpp ns:atf_gcli comment:"" dmmeta.nscpp ns:atf_nrun comment:"" @@ -39,25 +39,36 @@ dmmeta.nscpp ns:fmdb comment:"" dmmeta.nscpp ns:gcache comment:"" dmmeta.nscpp ns:gcli comment:"" dmmeta.nscpp ns:gclidb comment:"" +dmmeta.nscpp ns:http comment:"" +dmmeta.nscpp ns:httpdb comment:"" dmmeta.nscpp ns:ietf comment:"" +dmmeta.nscpp ns:jkv comment:"" +dmmeta.nscpp ns:kafka comment:"" dmmeta.nscpp ns:lib_amcdb comment:"" dmmeta.nscpp ns:lib_ams comment:"" dmmeta.nscpp ns:lib_ctype comment:"" +dmmeta.nscpp ns:lib_curl comment:"" dmmeta.nscpp ns:lib_exec comment:"" dmmeta.nscpp ns:lib_fm comment:"" dmmeta.nscpp ns:lib_git comment:"" +dmmeta.nscpp ns:lib_http comment:"" dmmeta.nscpp ns:lib_iconv comment:"" dmmeta.nscpp ns:lib_json comment:"" dmmeta.nscpp ns:lib_mysql comment:"" +dmmeta.nscpp ns:lib_netio comment:"" dmmeta.nscpp ns:lib_prot comment:"" +dmmeta.nscpp ns:lib_rl comment:"" dmmeta.nscpp ns:lib_sql comment:"" dmmeta.nscpp ns:lib_sqlite comment:"" +dmmeta.nscpp ns:lib_ws comment:"" dmmeta.nscpp ns:mdbg comment:"" dmmeta.nscpp ns:mysql2ssim comment:"" dmmeta.nscpp ns:orgfile comment:"" dmmeta.nscpp ns:report comment:"" +dmmeta.nscpp ns:samp_make comment:"" dmmeta.nscpp ns:samp_meng comment:"" dmmeta.nscpp ns:samp_regx comment:"" +dmmeta.nscpp ns:sampdb comment:"" dmmeta.nscpp ns:sandbox comment:"" dmmeta.nscpp ns:src_func comment:"" dmmeta.nscpp ns:src_hdr comment:"" @@ -67,3 +78,5 @@ dmmeta.nscpp ns:ssim2mysql comment:"" dmmeta.nscpp ns:ssimfilt comment:"" dmmeta.nscpp ns:strconv comment:"" dmmeta.nscpp ns:sv2ssim comment:"" +dmmeta.nscpp ns:ws comment:"" +dmmeta.nscpp ns:wsdb comment:"" diff --git a/data/dmmeta/nsdb.ssim b/data/dmmeta/nsdb.ssim index e3b38efd..8457800d 100644 --- a/data/dmmeta/nsdb.ssim +++ b/data/dmmeta/nsdb.ssim @@ -6,3 +6,6 @@ dmmeta.nsdb ns:dev comment:"" dmmeta.nsdb ns:dmmeta comment:"" dmmeta.nsdb ns:fmdb comment:"" dmmeta.nsdb ns:gclidb comment:"" +dmmeta.nsdb ns:httpdb comment:"" +dmmeta.nsdb ns:sampdb comment:"" +dmmeta.nsdb ns:wsdb comment:"" diff --git a/data/dmmeta/nsinclude.ssim b/data/dmmeta/nsinclude.ssim index 38ce5350..d3ab29e2 100644 --- a/data/dmmeta/nsinclude.ssim +++ b/data/dmmeta/nsinclude.ssim @@ -1,5 +1,7 @@ +dmmeta.nsinclude nsinclude:"" sys:N comment:"" dmmeta.nsinclude nsinclude:aqlite/include/lib_sqlite.h sys:N comment:"typedef for HANDLE" dmmeta.nsinclude nsinclude:atf_amc/include/lib_json.h sys:N comment:"" dmmeta.nsinclude nsinclude:lib_iconv/iconv.h sys:Y comment:"" dmmeta.nsinclude nsinclude:lib_mysql/mariadb/mysql.h sys:Y comment:"" dmmeta.nsinclude nsinclude:lib_sqlite/extern/sqlite-3500400/sqlite3.h sys:N comment:"" +dmmeta.nsinclude nsinclude:lib_sqlite/sqlite3.h sys:Y comment:"" diff --git a/data/dmmeta/nsjs.ssim b/data/dmmeta/nsjs.ssim new file mode 100644 index 00000000..74a6d7f3 --- /dev/null +++ b/data/dmmeta/nsjs.ssim @@ -0,0 +1,2 @@ +dmmeta.nsjs ns:algo typescript:Y gensel:Y comment:"" +dmmeta.nsjs ns:ams typescript:Y gensel:Y comment:"" diff --git a/data/dmmeta/nsproto.ssim b/data/dmmeta/nsproto.ssim index 94fcf0f9..f59b2ec7 100644 --- a/data/dmmeta/nsproto.ssim +++ b/data/dmmeta/nsproto.ssim @@ -4,5 +4,9 @@ dmmeta.nsproto ns:ams comment:"" dmmeta.nsproto ns:atf comment:"" dmmeta.nsproto ns:command comment:"" dmmeta.nsproto ns:fm comment:"" +dmmeta.nsproto ns:http comment:"" dmmeta.nsproto ns:ietf comment:"" +dmmeta.nsproto ns:js comment:"" +dmmeta.nsproto ns:kafka comment:"" dmmeta.nsproto ns:report comment:"" +dmmeta.nsproto ns:ws comment:"" diff --git a/data/dmmeta/nsx.ssim b/data/dmmeta/nsx.ssim index 1b6b8e71..a2f627d5 100644 --- a/data/dmmeta/nsx.ssim +++ b/data/dmmeta/nsx.ssim @@ -12,15 +12,15 @@ dmmeta.nsx ns:algo_lib genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.lp dmmeta.nsx ns:amc genthrow:N correct_getorcreate:N pool:amc.FDb.lpool sortxref:Y pack:N comment:"" dmmeta.nsx ns:amc_gc genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:N comment:"" dmmeta.nsx ns:amc_vis genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:N comment:"" -dmmeta.nsx ns:ams_cat genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:ams_sendtest genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.lpool sortxref:Y pack:N comment:"" dmmeta.nsx ns:apm genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:aqlite genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" -dmmeta.nsx ns:atf_amc genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:N comment:"" +dmmeta.nsx ns:atf_amc genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:N comment:"" dmmeta.nsx ns:atf_ci genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:N comment:"" dmmeta.nsx ns:atf_cmdline genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:atf_comp genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:atf_cov genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" +dmmeta.nsx ns:atf_exp genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:atf_fuzz genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:atf_gcli genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:atf_nrun genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" @@ -30,22 +30,29 @@ dmmeta.nsx ns:command genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.mal dmmeta.nsx ns:gcache genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:gcli genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:ietf genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:Y comment:"" +dmmeta.nsx ns:jkv genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:lib_amcdb genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:lib_ams genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:lib_ctype genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" +dmmeta.nsx ns:lib_curl genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:lib_exec genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:N comment:"" dmmeta.nsx ns:lib_fm genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:lib_git genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" +dmmeta.nsx ns:lib_http genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:lib_iconv genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:N comment:"" dmmeta.nsx ns:lib_json genthrow:N correct_getorcreate:Y pool:lib_json.FDb.lpool sortxref:N pack:N comment:"" dmmeta.nsx ns:lib_mysql genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:N comment:"" +dmmeta.nsx ns:lib_netio genthrow:Y correct_getorcreate:N pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:lib_prot genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:N comment:"" +dmmeta.nsx ns:lib_rl genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:lib_sql genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:lib_sqlite genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" +dmmeta.nsx ns:lib_ws genthrow:Y correct_getorcreate:N pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:mdbg genthrow:N correct_getorcreate:Y pool:mdbg.FDb.lpool sortxref:N pack:N comment:"" dmmeta.nsx ns:mysql2ssim genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:N comment:"" dmmeta.nsx ns:orgfile genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:report genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:N comment:"" +dmmeta.nsx ns:samp_make genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:samp_meng genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:samp_regx genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:sandbox genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" @@ -57,3 +64,4 @@ dmmeta.nsx ns:ssim2mysql genthrow:Y correct_getorcreate:N pool:algo_lib.FDb. dmmeta.nsx ns:ssimfilt genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:strconv genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" dmmeta.nsx ns:sv2ssim genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" +dmmeta.nsx ns:ws genthrow:N correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:N pack:Y comment:"" diff --git a/data/dmmeta/pack.ssim b/data/dmmeta/pack.ssim index 3a367185..ba420276 100644 --- a/data/dmmeta/pack.ssim +++ b/data/dmmeta/pack.ssim @@ -113,6 +113,7 @@ dmmeta.pack ctype:algo.SeqType comment:"" dmmeta.pack ctype:algo.Smallstr10 comment:"" dmmeta.pack ctype:algo.Smallstr100 comment:"" dmmeta.pack ctype:algo.Smallstr20 comment:"" +dmmeta.pack ctype:algo.Smallstr255 comment:"" dmmeta.pack ctype:algo.Smallstr32 comment:"" dmmeta.pack ctype:algo.Smallstr50 comment:"" dmmeta.pack ctype:algo.U16Dec2 comment:"" @@ -126,35 +127,29 @@ dmmeta.pack ctype:algo.UnixTime comment:"" dmmeta.pack ctype:algo.Uuid comment:"" dmmeta.pack ctype:algo.WDiff comment:"" dmmeta.pack ctype:algo.WTime comment:"" -dmmeta.pack ctype:ams.AlarmSyncMsg comment:"" -dmmeta.pack ctype:ams.DfltStream comment:"" -dmmeta.pack ctype:ams.DumpStreamTableMsg comment:"" +dmmeta.pack ctype:algo_lib.RegxFlags comment:"" dmmeta.pack ctype:ams.ExpectMsg comment:"" -dmmeta.pack ctype:ams.HeartbeatMsg comment:"" dmmeta.pack ctype:ams.InputLineMsg comment:"" dmmeta.pack ctype:ams.LogMsg comment:"" -dmmeta.pack ctype:ams.Member comment:"" dmmeta.pack ctype:ams.MsgBlock comment:"" dmmeta.pack ctype:ams.MsgHeader comment:"" -dmmeta.pack ctype:ams.OpenMsg comment:"" -dmmeta.pack ctype:ams.PrlogMsg comment:"" -dmmeta.pack ctype:ams.ProcAddMsg comment:"" +dmmeta.pack ctype:ams.ProcEofMsg comment:"" dmmeta.pack ctype:ams.ProcId comment:"" -dmmeta.pack ctype:ams.ProcRemoveMsg comment:"" -dmmeta.pack ctype:ams.ProcType comment:"" -dmmeta.pack ctype:ams.Seqmsg comment:"" -dmmeta.pack ctype:ams.SeqmsgId comment:"" -dmmeta.pack ctype:ams.SeqmsgTrace comment:"" -dmmeta.pack ctype:ams.StreamFlags comment:"" -dmmeta.pack ctype:ams.StreamHbMsg comment:"" -dmmeta.pack ctype:ams.StreamId comment:"" -dmmeta.pack ctype:ams.StreamPos comment:"" -dmmeta.pack ctype:ams.StreamType comment:"" +dmmeta.pack ctype:ams.ProcKillMsg comment:"" +dmmeta.pack ctype:ams.ProcMsg comment:"" +dmmeta.pack ctype:ams.ProcReadMsg comment:"" +dmmeta.pack ctype:ams.ProcStartMsg comment:"" +dmmeta.pack ctype:ams.ProcStatusMsg comment:"" +dmmeta.pack ctype:ams.Proctype comment:"" +dmmeta.pack ctype:ams.RemDirRecurseMsg comment:"" +dmmeta.pack ctype:ams.ShmFlags comment:"" +dmmeta.pack ctype:ams.ShmHbMsg comment:"" +dmmeta.pack ctype:ams.ShmId comment:"" +dmmeta.pack ctype:ams.ShmemberFlags comment:"" +dmmeta.pack ctype:ams.ShmemberId comment:"" +dmmeta.pack ctype:ams.Shmmsg comment:"" +dmmeta.pack ctype:ams.Shmtype comment:"" dmmeta.pack ctype:ams.TerminateMsg comment:"" -dmmeta.pack ctype:ams.Trace2Msg comment:"" -dmmeta.pack ctype:ams.TraceInfo2Msg comment:"" -dmmeta.pack ctype:ams.TraceInfoMsg comment:"" -dmmeta.pack ctype:ams.TraceMsg comment:"" dmmeta.pack ctype:ams.UdpFrame comment:"" dmmeta.pack ctype:atf_amc.MsgHdrLT comment:"" dmmeta.pack ctype:atf_amc.MsgHeader comment:"" @@ -174,6 +169,10 @@ dmmeta.pack ctype:atf_amc.PmaskU555 comment:"" dmmeta.pack ctype:atf_amc.Seqmsg comment:"" dmmeta.pack ctype:atf_amc.Text comment:"" dmmeta.pack ctype:atf_amc.TypeG comment:"" +dmmeta.pack ctype:atf_amc.Varlen2Msg comment:"" +dmmeta.pack ctype:atf_amc.Varlen2aMsg comment:"" +dmmeta.pack ctype:atf_amc.Varlen2mMsg comment:"" +dmmeta.pack ctype:atf_amc.Varlen2vMsg comment:"" dmmeta.pack ctype:atf_amc.VarlenAlloc comment:"" dmmeta.pack ctype:atf_amc.VarlenExtern comment:"" dmmeta.pack ctype:atf_amc.VarlenK comment:"" @@ -192,6 +191,13 @@ dmmeta.pack ctype:fm.Summary comment:"" dmmeta.pack ctype:ietf.Ipport comment:"" dmmeta.pack ctype:ietf.Ipv4 comment:"" dmmeta.pack ctype:ietf.Ipv4Addr comment:"" +dmmeta.pack ctype:kafka.AclOperationType comment:"" +dmmeta.pack ctype:kafka.AclPermissionType comment:"" +dmmeta.pack ctype:kafka.ConfigSource comment:"" +dmmeta.pack ctype:kafka.ConfigType comment:"" +dmmeta.pack ctype:kafka.GroupState comment:"" +dmmeta.pack ctype:kafka.PatternType comment:"" +dmmeta.pack ctype:kafka.ResourceType comment:"" dmmeta.pack ctype:pad_byte comment:"" dmmeta.pack ctype:samp_meng.CancelOrderMsg comment:"" dmmeta.pack ctype:samp_meng.CancelReqMsg comment:"" @@ -208,3 +214,19 @@ dmmeta.pack ctype:samp_meng.OrderTradeMsg comment:"" dmmeta.pack ctype:samp_meng.Symbol comment:"" dmmeta.pack ctype:samp_meng.TextMsg comment:"" dmmeta.pack ctype:u8 comment:"" +dmmeta.pack ctype:ws.CloseMsg comment:"" +dmmeta.pack ctype:ws.ConnectMsg comment:"" +dmmeta.pack ctype:ws.DataMsg comment:"" +dmmeta.pack ctype:ws.Frame comment:"" +dmmeta.pack ctype:ws.Frame16 comment:"" +dmmeta.pack ctype:ws.Frame64 comment:"" +dmmeta.pack ctype:ws.FrameHeader comment:"" +dmmeta.pack ctype:ws.FrameMasked comment:"" +dmmeta.pack ctype:ws.FrameMasked16 comment:"" +dmmeta.pack ctype:ws.FrameMasked64 comment:"" +dmmeta.pack ctype:ws.HttpState comment:"" +dmmeta.pack ctype:ws.Opcode comment:"" +dmmeta.pack ctype:ws.ServerStartMsg comment:"" +dmmeta.pack ctype:ws.ServerStopMsg comment:"" +dmmeta.pack ctype:ws.Side comment:"" +dmmeta.pack ctype:ws.StatusCode comment:"" diff --git a/data/dmmeta/pmaskfld.ssim b/data/dmmeta/pmaskfld.ssim index 71db609b..80d9bdad 100644 --- a/data/dmmeta/pmaskfld.ssim +++ b/data/dmmeta/pmaskfld.ssim @@ -4,3 +4,4 @@ dmmeta.pmaskfld field:atf_amc.PmaskMultiple.present filter_print:N comment:"" dmmeta.pmaskfld field:atf_amc.PmaskU128.pmask filter_print:N comment:"" dmmeta.pmaskfld field:atf_amc.PmaskU32.pmask filter_print:N comment:"" dmmeta.pmaskfld field:atf_amc.PmaskU555.pmask filter_print:N comment:"" +dmmeta.pmaskfld field:kafka.Record.pmask filter_print:Y comment:"" diff --git a/data/dmmeta/pmaskfld_member.ssim b/data/dmmeta/pmaskfld_member.ssim index 7af2b79e..cab980fd 100644 --- a/data/dmmeta/pmaskfld_member.ssim +++ b/data/dmmeta/pmaskfld_member.ssim @@ -1,3 +1,4 @@ dmmeta.pmaskfld_member pmaskfld_member:atf_amc.PmaskMultiple.nullable/atf_amc.PmaskMultiple.value1 comment:"" dmmeta.pmaskfld_member pmaskfld_member:atf_amc.PmaskMultiple.nullable/atf_amc.PmaskMultiple.value3 comment:"" dmmeta.pmaskfld_member pmaskfld_member:atf_amc.PmaskMultiple.nullable/atf_amc.PmaskMultiple.value5 comment:"" +dmmeta.pmaskfld_member pmaskfld_member:kafka.Record.pmask/kafka.Record.key comment:"" diff --git a/data/dmmeta/pnew.ssim b/data/dmmeta/pnew.ssim index 514e029e..d1f9a426 100644 --- a/data/dmmeta/pnew.ssim +++ b/data/dmmeta/pnew.ssim @@ -1,11 +1,6 @@ dmmeta.pnew pnew:ams/ams.LogMsg.ByteAry comment:"" dmmeta.pnew pnew:ams/ams.MsgBlock.ByteAry comment:"" dmmeta.pnew pnew:ams/ams.MsgBlock.Memptr comment:"" -dmmeta.pnew pnew:ams/ams.SeqmsgTrace.ByteAry comment:"" -dmmeta.pnew pnew:ams/ams.Trace2Msg.ByteAry comment:"" -dmmeta.pnew pnew:ams/ams.TraceInfo2Msg.ByteAry comment:"" -dmmeta.pnew pnew:ams/ams.TraceInfoMsg.ByteAry comment:"" -dmmeta.pnew pnew:ams/ams.TraceMsg.ByteAry comment:"" dmmeta.pnew pnew:ams/ams.UdpFrame.ByteAry comment:"" dmmeta.pnew pnew:ams/ams.UdpFrame.Memptr comment:"" dmmeta.pnew pnew:atf_amc/atf_amc.MsgLTO.ByteAry comment:"" @@ -15,18 +10,23 @@ dmmeta.pnew pnew:atf_amc/atf_amc.OptG.Memptr comment:"" dmmeta.pnew pnew:atf_amc/atf_amc.OptOptG.ByteAry comment:"" dmmeta.pnew pnew:atf_amc/atf_amc.OptOptG.Memptr comment:"" dmmeta.pnew pnew:atf_amc/atf_amc.Text.ByteAry comment:"" +dmmeta.pnew pnew:atf_amc/atf_amc.Varlen2Msg.ByteAry comment:"" +dmmeta.pnew pnew:atf_amc/atf_amc.Varlen2aMsg.ByteAry comment:"" +dmmeta.pnew pnew:atf_amc/atf_amc.Varlen2mMsg.ByteAry comment:"" +dmmeta.pnew pnew:atf_amc/atf_amc.Varlen2vMsg.ByteAry comment:"" dmmeta.pnew pnew:atf_amc/atf_amc.VarlenK.ByteAry comment:"" dmmeta.pnew pnew:atf_amc/atf_amc.VarlenK.Memptr comment:"" +dmmeta.pnew pnew:atf_exp/ams.ProcMsg.Append comment:"" +dmmeta.pnew pnew:atf_exp/ams.ProcStatusMsg.Append comment:"" dmmeta.pnew pnew:lib_ams/ams.InputLineMsg.ByteAry comment:"" -dmmeta.pnew pnew:lib_ams/ams.LogMsg.AmsStream comment:"" -dmmeta.pnew pnew:lib_ams/ams.MsgBlock.AmsStream comment:"" -dmmeta.pnew pnew:lib_ams/ams.OpenMsg.AmsStream comment:"" -dmmeta.pnew pnew:lib_ams/ams.PrlogMsg.AmsStream comment:"" -dmmeta.pnew pnew:lib_ams/ams.ProcAddMsg.AmsStream comment:"" -dmmeta.pnew pnew:lib_ams/ams.ProcRemoveMsg.AmsStream comment:"" -dmmeta.pnew pnew:lib_ams/ams.StreamHbMsg.AmsStream comment:"" -dmmeta.pnew pnew:lib_ams/ams.Trace2Msg.AmsStream comment:"" -dmmeta.pnew pnew:lib_ams/ams.TraceInfo2Msg.AmsStream comment:"" -dmmeta.pnew pnew:lib_ams/ams.TraceInfoMsg.AmsStream comment:"" -dmmeta.pnew pnew:lib_ams/ams.TraceMsg.AmsStream comment:"" -dmmeta.pnew pnew:lib_ams/ams.UdpFrame.AmsStream comment:"" +dmmeta.pnew pnew:lib_ams/ams.LogMsg.Shm comment:"" +dmmeta.pnew pnew:lib_ams/ams.MsgBlock.Shm comment:"" +dmmeta.pnew pnew:lib_ams/ams.ShmHbMsg.Shm comment:"" +dmmeta.pnew pnew:lib_ams/ams.TerminateMsg.Shm comment:"" +dmmeta.pnew pnew:lib_ams/ams.UdpFrame.Shm comment:"" +dmmeta.pnew pnew:lib_ws/ws.Frame.ByteAry comment:"" +dmmeta.pnew pnew:lib_ws/ws.Frame16.ByteAry comment:"" +dmmeta.pnew pnew:lib_ws/ws.Frame64.ByteAry comment:"" +dmmeta.pnew pnew:lib_ws/ws.FrameMasked.ByteAry comment:"" +dmmeta.pnew pnew:lib_ws/ws.FrameMasked16.ByteAry comment:"" +dmmeta.pnew pnew:lib_ws/ws.FrameMasked64.ByteAry comment:"" diff --git a/data/dmmeta/pnewtype.ssim b/data/dmmeta/pnewtype.ssim index d5a1e21e..f0d15fc0 100644 --- a/data/dmmeta/pnewtype.ssim +++ b/data/dmmeta/pnewtype.ssim @@ -1,5 +1,5 @@ dmmeta.pnewtype pnewtype:Memptr comment:"Some region in memory" -dmmeta.pnewtype pnewtype:AmsStream comment:"Ams stream" +dmmeta.pnewtype pnewtype:Shm comment:"Ams stream" dmmeta.pnewtype pnewtype:Fixed comment:"Fixed buffer" dmmeta.pnewtype pnewtype:Dynamic comment:"Dynamic buffer" dmmeta.pnewtype pnewtype:ByteAry comment:ByteAry diff --git a/data/dmmeta/ptrary.ssim b/data/dmmeta/ptrary.ssim index 856e0b09..7cfb66db 100644 --- a/data/dmmeta/ptrary.ssim +++ b/data/dmmeta/ptrary.ssim @@ -1,127 +1,135 @@ -dmmeta.ptrary field:abt.FSyscmd.c_next unique:Y -dmmeta.ptrary field:abt.FSyscmd.c_prior unique:Y -dmmeta.ptrary field:abt.FTarget.c_alldep unique:N -dmmeta.ptrary field:abt.FTarget.c_srcfile unique:N -dmmeta.ptrary field:abt.FTarget.c_targdep unique:Y -dmmeta.ptrary field:abt.FTarget.c_targsrc unique:Y -dmmeta.ptrary field:abt.FTarget.c_targsyslib unique:Y -dmmeta.ptrary field:abt_md.FCtype.c_field unique:Y -dmmeta.ptrary field:abt_md.FCtype.c_field_arg unique:Y -dmmeta.ptrary field:abt_md.FField.c_fconst unique:Y -dmmeta.ptrary field:abt_md.FNs.c_comptest unique:Y -dmmeta.ptrary field:abt_md.FNs.c_ctype unique:Y -dmmeta.ptrary field:abt_md.FNs.c_targsrc unique:Y -dmmeta.ptrary field:abt_md.FTarget.c_targdep unique:Y -dmmeta.ptrary field:acr.FCheck.c_bad_rec unique:N -dmmeta.ptrary field:acr.FCtype.c_child unique:N -dmmeta.ptrary field:acr.FCtype.c_field unique:Y -dmmeta.ptrary field:acr.FCtype.c_ssimreq unique:Y -dmmeta.ptrary field:acr.FDb.c_ctype_front unique:Y -dmmeta.ptrary field:acr.FDb.c_ssimreq_rec unique:Y -dmmeta.ptrary field:acr.FPrint.c_pline unique:N -dmmeta.ptrary field:acr.FQuery.c_ctype unique:N -dmmeta.ptrary field:acr.FQuery.c_field unique:N -dmmeta.ptrary field:acr.FQuery.c_rec unique:N -dmmeta.ptrary field:acr.FWrite.c_cmtrec unique:N -dmmeta.ptrary field:acr_compl.FCtype.c_field unique:Y -dmmeta.ptrary field:acr_compl.FField.c_falias_srcfield unique:N -dmmeta.ptrary field:acr_compl.FField.c_fconst unique:Y -dmmeta.ptrary field:acr_ed.FCtype.c_cfmt unique:N -dmmeta.ptrary field:acr_ed.FCtype.c_field unique:Y -dmmeta.ptrary field:acr_in.FCtype.c_ctype unique:N -dmmeta.ptrary field:acr_in.FCtype.c_field unique:Y -dmmeta.ptrary field:acr_in.FTarget.c_targdep unique:Y -dmmeta.ptrary field:acr_in.FTarget.c_targdep_child unique:Y -dmmeta.ptrary field:acr_in.FTuple.c_child unique:N -dmmeta.ptrary field:acr_in.FTuple.c_parent unique:N -dmmeta.ptrary field:algo_lib.FTxtrow.c_txtcell unique:Y -dmmeta.ptrary field:algo_lib.FTxttbl.c_txtrow unique:Y -dmmeta.ptrary field:amc.FCtype.c_datafld unique:Y -dmmeta.ptrary field:amc.FCtype.c_fcurs unique:Y -dmmeta.ptrary field:amc.FCtype.c_ffast unique:Y -dmmeta.ptrary field:amc.FCtype.c_ffunc unique:N -dmmeta.ptrary field:amc.FCtype.c_field unique:N -dmmeta.ptrary field:amc.FCtype.c_parent unique:N -dmmeta.ptrary field:amc.FCtype.c_pmaskfld unique:Y -dmmeta.ptrary field:amc.FCtype.c_static unique:Y -dmmeta.ptrary field:amc.FDb.c_ctype_sorted unique:N -dmmeta.ptrary field:amc.FDb.c_ctypelen unique:Y -dmmeta.ptrary field:amc.FDb.c_dispsig_sorted unique:Y -dmmeta.ptrary field:amc.FDb.c_ns_sorted unique:N -dmmeta.ptrary field:amc.FDb.c_ssimfile_sorted unique:Y -dmmeta.ptrary field:amc.FDb.c_substr_field unique:Y -dmmeta.ptrary field:amc.FDb.c_tempfield unique:Y -dmmeta.ptrary field:amc.FDispatch.c_dispatch_msg unique:Y -dmmeta.ptrary field:amc.FEnumstr.c_fconst unique:N -dmmeta.ptrary field:amc.FField.c_fconst unique:Y -dmmeta.ptrary field:amc.FField.c_ffast unique:Y -dmmeta.ptrary field:amc.FField.c_ffunc unique:N -dmmeta.ptrary field:amc.FField.c_pmaskfld_member unique:Y -dmmeta.ptrary field:amc.FNs.c_cppincl unique:N -dmmeta.ptrary field:amc.FNs.c_ctype unique:Y -dmmeta.ptrary field:amc.FNs.c_dispatch unique:Y -dmmeta.ptrary field:amc.FNs.c_dispsig unique:Y -dmmeta.ptrary field:amc.FNs.c_foutput unique:Y -dmmeta.ptrary field:amc.FNs.c_fstep unique:Y -dmmeta.ptrary field:amc.FNs.c_func unique:Y -dmmeta.ptrary field:amc.FNs.c_fwddecl unique:Y -dmmeta.ptrary field:amc.FNs.c_gstatic unique:Y -dmmeta.ptrary field:amc.FNs.c_gsymbol unique:Y -dmmeta.ptrary field:amc.FNs.c_hdrincl unique:N -dmmeta.ptrary field:amc.FNs.c_nsinclude unique:Y -dmmeta.ptrary field:amc.FNs.c_outfile unique:Y -dmmeta.ptrary field:amc.FNs.c_parentns unique:N -dmmeta.ptrary field:amc.FNs.c_pnew unique:Y -dmmeta.ptrary field:amc.FPmaskfld.c_pmaskfld_member unique:Y -dmmeta.ptrary field:amc.FTarget.c_targdep unique:Y -dmmeta.ptrary field:amc.FTclass.c_tfunc unique:Y -dmmeta.ptrary field:amc_vis.FCtype.c_field unique:Y -dmmeta.ptrary field:amc_vis.FDb.c_linklist unique:Y -dmmeta.ptrary field:apm.FCtype.c_field unique:Y -dmmeta.ptrary field:apm.FCtype.c_ssimreq unique:Y -dmmeta.ptrary field:apm.FPackage.c_pkgdep unique:Y -dmmeta.ptrary field:apm.FPackage.c_pkgdep_parent unique:Y -dmmeta.ptrary field:apm.FPkgkey.c_pkgrec unique:Y -dmmeta.ptrary field:apm.FRec.c_child unique:N -dmmeta.ptrary field:atf_amc.FCascdel.c_child_ptrary unique:Y -dmmeta.ptrary field:atf_amc.FDb.c_typek unique:Y -dmmeta.ptrary field:atf_amc.FUnitSort.c_ptrary unique:N -dmmeta.ptrary field:atf_cov.FGitfile.c_covline unique:Y -dmmeta.ptrary field:atf_cov.FTarget.c_targsrc unique:Y -dmmeta.ptrary field:atf_gcli.FDb.c_gtblacttst unique:Y -dmmeta.ptrary field:atf_gcli.FGclienv.c_gclienvsub unique:Y -dmmeta.ptrary field:atf_gcli.FGtblacttst.c_gtblacttstout unique:Y -dmmeta.ptrary field:gcli.FDb.c_gclicmd unique:Y -dmmeta.ptrary field:gcli.FDb.c_gfld unique:Y -dmmeta.ptrary field:gcli.FGclicmd.c_gclicmdarg unique:Y -dmmeta.ptrary field:gcli.FGclicmd.c_gclicmdc unique:Y -dmmeta.ptrary field:gcli.FGclicmd.c_gclicmdf2j unique:Y -dmmeta.ptrary field:gcli.FGclicmd.c_tuples unique:N -dmmeta.ptrary field:gcli.FGclicmdc.c_gclicmdf unique:Y -dmmeta.ptrary field:gcli.FGclicmdj2f.c_gclicmdf unique:N -dmmeta.ptrary field:gcli.FGfld.c_gtblactfld unique:Y -dmmeta.ptrary field:gcli.FGtbl.c_gtblact unique:Y -dmmeta.ptrary field:gcli.FGtblact.c_gtblactfld unique:Y -dmmeta.ptrary field:gcli.FGtype.c_gtypeh unique:Y -dmmeta.ptrary field:gcli.FGtype.c_gtypeprefix unique:Y -dmmeta.ptrary field:gcli.FIssue.c_issuenote unique:Y -dmmeta.ptrary field:gcli.FIssue.c_mrjob unique:Y -dmmeta.ptrary field:gcli.FMr.c_mrjob unique:Y -dmmeta.ptrary field:gcli.FMr.c_mrnote unique:Y -dmmeta.ptrary field:lib_ctype.FCtype.c_cfmt unique:Y -dmmeta.ptrary field:lib_ctype.FCtype.c_field unique:Y -dmmeta.ptrary field:lib_ctype.FField.c_substr_srcfield unique:Y -dmmeta.ptrary field:lib_exec.FSyscmd.c_next unique:Y -dmmeta.ptrary field:lib_exec.FSyscmd.c_prior unique:Y -dmmeta.ptrary field:lib_json.FNode.c_child unique:Y -dmmeta.ptrary field:lib_sqlite.FCtype.c_field unique:Y -dmmeta.ptrary field:lib_sqlite.FCtype.c_row unique:Y -dmmeta.ptrary field:lib_sqlite.FNs.c_ssimfile unique:Y -dmmeta.ptrary field:lib_sqlite.Vtab.c_curs unique:Y -dmmeta.ptrary field:mdbg.FCfg.c_builddir unique:Y -dmmeta.ptrary field:orgfile.FFilehash.c_filename unique:Y -dmmeta.ptrary field:samp_meng.FSymbol.c_ordq unique:Y -dmmeta.ptrary field:src_hdr.FTarget.c_targsrc unique:Y -dmmeta.ptrary field:ssim2mysql.FCtype.c_field unique:Y -dmmeta.ptrary field:ssim2mysql.FNs.c_ssimfile unique:Y -dmmeta.ptrary field:ssim2mysql.FSsimfile.c_column unique:Y +dmmeta.ptrary field:abt.FSyscmd.c_next unique:Y heaplike:N +dmmeta.ptrary field:abt.FSyscmd.c_prior unique:Y heaplike:N +dmmeta.ptrary field:abt.FTarget.c_alldep unique:N heaplike:N +dmmeta.ptrary field:abt.FTarget.c_srcfile unique:N heaplike:N +dmmeta.ptrary field:abt.FTarget.c_targdep unique:Y heaplike:N +dmmeta.ptrary field:abt.FTarget.c_targsrc unique:Y heaplike:N +dmmeta.ptrary field:abt.FTarget.c_targsyslib unique:Y heaplike:N +dmmeta.ptrary field:abt_md.FCtype.c_field unique:Y heaplike:N +dmmeta.ptrary field:abt_md.FCtype.c_field_arg unique:Y heaplike:N +dmmeta.ptrary field:abt_md.FDispatch.c_dispatch_msg unique:Y heaplike:N +dmmeta.ptrary field:abt_md.FField.c_fconst unique:Y heaplike:N +dmmeta.ptrary field:abt_md.FNs.c_comptest unique:Y heaplike:N +dmmeta.ptrary field:abt_md.FNs.c_ctype unique:Y heaplike:N +dmmeta.ptrary field:abt_md.FNs.c_dispatch unique:Y heaplike:N +dmmeta.ptrary field:abt_md.FNs.c_targsrc unique:Y heaplike:N +dmmeta.ptrary field:abt_md.FTarget.c_targdep unique:Y heaplike:N +dmmeta.ptrary field:acr.FCheck.c_bad_rec unique:N heaplike:N +dmmeta.ptrary field:acr.FCtype.c_child unique:N heaplike:N +dmmeta.ptrary field:acr.FCtype.c_field unique:Y heaplike:N +dmmeta.ptrary field:acr.FCtype.c_ssimreq unique:Y heaplike:N +dmmeta.ptrary field:acr.FDb.c_ctype_front unique:Y heaplike:N +dmmeta.ptrary field:acr.FDb.c_ssimreq_rec unique:Y heaplike:N +dmmeta.ptrary field:acr.FPrint.c_pline unique:N heaplike:N +dmmeta.ptrary field:acr.FQuery.c_ctype unique:N heaplike:N +dmmeta.ptrary field:acr.FQuery.c_field unique:N heaplike:N +dmmeta.ptrary field:acr.FQuery.c_rec unique:N heaplike:N +dmmeta.ptrary field:acr.FWrite.c_cmtrec unique:N heaplike:N +dmmeta.ptrary field:acr_compl.FCtype.c_field unique:Y heaplike:N +dmmeta.ptrary field:acr_compl.FField.c_falias_srcfield unique:N heaplike:N +dmmeta.ptrary field:acr_compl.FField.c_fconst unique:Y heaplike:N +dmmeta.ptrary field:acr_ed.FCtype.c_cfmt unique:N heaplike:N +dmmeta.ptrary field:acr_ed.FCtype.c_field unique:Y heaplike:N +dmmeta.ptrary field:acr_in.FCtype.c_ctype unique:N heaplike:N +dmmeta.ptrary field:acr_in.FCtype.c_field unique:Y heaplike:N +dmmeta.ptrary field:acr_in.FTarget.c_targdep unique:Y heaplike:N +dmmeta.ptrary field:acr_in.FTarget.c_targdep_child unique:Y heaplike:N +dmmeta.ptrary field:acr_in.FTuple.c_child unique:N heaplike:N +dmmeta.ptrary field:acr_in.FTuple.c_parent unique:N heaplike:N +dmmeta.ptrary field:algo_lib.FTxtrow.c_txtcell unique:Y heaplike:N +dmmeta.ptrary field:algo_lib.FTxttbl.c_txtrow unique:Y heaplike:N +dmmeta.ptrary field:amc.FCtype.c_datafld unique:Y heaplike:N +dmmeta.ptrary field:amc.FCtype.c_fcurs unique:Y heaplike:N +dmmeta.ptrary field:amc.FCtype.c_ffast unique:Y heaplike:N +dmmeta.ptrary field:amc.FCtype.c_ffunc unique:N heaplike:N +dmmeta.ptrary field:amc.FCtype.c_field unique:N heaplike:N +dmmeta.ptrary field:amc.FCtype.c_parent unique:N heaplike:N +dmmeta.ptrary field:amc.FCtype.c_pmaskfld unique:Y heaplike:N +dmmeta.ptrary field:amc.FCtype.c_static unique:Y heaplike:N +dmmeta.ptrary field:amc.FDb.c_ctype_sorted unique:N heaplike:N +dmmeta.ptrary field:amc.FDb.c_ns_sorted unique:N heaplike:N +dmmeta.ptrary field:amc.FDb.c_ssimfile_sorted unique:Y heaplike:N +dmmeta.ptrary field:amc.FDb.c_substr_field unique:Y heaplike:N +dmmeta.ptrary field:amc.FDispatch.c_dispatch_msg unique:Y heaplike:N +dmmeta.ptrary field:amc.FEnumstr.c_fconst unique:N heaplike:N +dmmeta.ptrary field:amc.FField.c_fconst unique:Y heaplike:N +dmmeta.ptrary field:amc.FField.c_ffast unique:Y heaplike:N +dmmeta.ptrary field:amc.FField.c_ffunc unique:N heaplike:N +dmmeta.ptrary field:amc.FField.c_pmaskfld_member unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_cppincl unique:N heaplike:N +dmmeta.ptrary field:amc.FNs.c_ctype unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_dispatch unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_dispsig unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_foutput unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_fstep unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_func unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_fwddecl unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_gstatic unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_gsymbol unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_hdrincl unique:N heaplike:N +dmmeta.ptrary field:amc.FNs.c_nsinclude unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_outfile unique:Y heaplike:N +dmmeta.ptrary field:amc.FNs.c_parentns unique:N heaplike:N +dmmeta.ptrary field:amc.FNs.c_pnew unique:Y heaplike:N +dmmeta.ptrary field:amc.FPmaskfld.c_pmaskfld_member unique:Y heaplike:N +dmmeta.ptrary field:amc.FTarget.c_targdep unique:Y heaplike:N +dmmeta.ptrary field:amc.FTclass.c_tfunc unique:Y heaplike:N +dmmeta.ptrary field:amc_vis.FCtype.c_field unique:Y heaplike:N +dmmeta.ptrary field:amc_vis.FDb.c_linklist unique:Y heaplike:N +dmmeta.ptrary field:apm.FCtype.c_field unique:Y heaplike:N +dmmeta.ptrary field:apm.FCtype.c_ssimreq unique:Y heaplike:N +dmmeta.ptrary field:apm.FPackage.c_pkgdep unique:Y heaplike:N +dmmeta.ptrary field:apm.FPackage.c_pkgdep_parent unique:Y heaplike:N +dmmeta.ptrary field:apm.FPkgkey.c_pkgrec unique:Y heaplike:N +dmmeta.ptrary field:apm.FRec.c_child unique:N heaplike:N +dmmeta.ptrary field:atf_amc.FCascdel.c_child_ptrary unique:Y heaplike:N +dmmeta.ptrary field:atf_amc.FDb.c_typek unique:Y heaplike:N +dmmeta.ptrary field:atf_amc.FDb.c_typel unique:Y heaplike:Y +dmmeta.ptrary field:atf_amc.FDb.c_typem unique:N heaplike:N +dmmeta.ptrary field:atf_amc.FUnitSort.c_ptrary unique:N heaplike:N +dmmeta.ptrary field:atf_cov.FGitfile.c_covline unique:Y heaplike:N +dmmeta.ptrary field:atf_cov.FTarget.c_targsrc unique:Y heaplike:N +dmmeta.ptrary field:atf_gcli.FDb.c_gtblacttst unique:Y heaplike:N +dmmeta.ptrary field:atf_gcli.FGclienv.c_gclienvsub unique:Y heaplike:N +dmmeta.ptrary field:atf_gcli.FGtblacttst.c_gtblacttstout unique:Y heaplike:N +dmmeta.ptrary field:gcli.FDb.c_gclicmd unique:Y heaplike:N +dmmeta.ptrary field:gcli.FDb.c_gfld unique:Y heaplike:N +dmmeta.ptrary field:gcli.FGclicmd.c_gclicmdarg unique:Y heaplike:N +dmmeta.ptrary field:gcli.FGclicmd.c_gclicmdc unique:Y heaplike:N +dmmeta.ptrary field:gcli.FGclicmd.c_gclicmdf2j unique:Y heaplike:N +dmmeta.ptrary field:gcli.FGclicmd.c_tuples unique:N heaplike:N +dmmeta.ptrary field:gcli.FGclicmdc.c_gclicmdf unique:Y heaplike:N +dmmeta.ptrary field:gcli.FGclicmdj2f.c_gclicmdf unique:N heaplike:N +dmmeta.ptrary field:gcli.FGfld.c_gtblactfld unique:Y heaplike:N +dmmeta.ptrary field:gcli.FGtbl.c_gtblact unique:Y heaplike:N +dmmeta.ptrary field:gcli.FGtblact.c_gtblactfld unique:Y heaplike:N +dmmeta.ptrary field:gcli.FGtype.c_gtypeh unique:Y heaplike:N +dmmeta.ptrary field:gcli.FGtype.c_gtypeprefix unique:Y heaplike:N +dmmeta.ptrary field:gcli.FIssue.c_issuenote unique:Y heaplike:N +dmmeta.ptrary field:gcli.FIssue.c_mrjob unique:Y heaplike:N +dmmeta.ptrary field:gcli.FMr.c_mrjob unique:Y heaplike:N +dmmeta.ptrary field:gcli.FMr.c_mrnote unique:Y heaplike:N +dmmeta.ptrary field:lib_ams.FDb.c_ctlin unique:Y heaplike:Y +dmmeta.ptrary field:lib_ams.FProc.c_shm unique:Y heaplike:Y +dmmeta.ptrary field:lib_ams.FProc.c_shmember unique:Y heaplike:Y +dmmeta.ptrary field:lib_ams.FShm.c_shmember unique:Y heaplike:Y +dmmeta.ptrary field:lib_ctype.FCtype.c_cfmt unique:Y heaplike:N +dmmeta.ptrary field:lib_ctype.FCtype.c_field unique:Y heaplike:N +dmmeta.ptrary field:lib_ctype.FField.c_substr_srcfield unique:Y heaplike:N +dmmeta.ptrary field:lib_exec.FSyscmd.c_next unique:Y heaplike:N +dmmeta.ptrary field:lib_exec.FSyscmd.c_prior unique:Y heaplike:N +dmmeta.ptrary field:lib_json.FNode.c_child unique:Y heaplike:N +dmmeta.ptrary field:lib_sqlite.FCtype.c_field unique:Y heaplike:N +dmmeta.ptrary field:lib_sqlite.FCtype.c_row unique:Y heaplike:N +dmmeta.ptrary field:lib_sqlite.FNs.c_ssimfile unique:Y heaplike:N +dmmeta.ptrary field:lib_sqlite.Vtab.c_curs unique:Y heaplike:N +dmmeta.ptrary field:mdbg.FCfg.c_builddir unique:Y heaplike:N +dmmeta.ptrary field:orgfile.FFilehash.c_filename unique:Y heaplike:N +dmmeta.ptrary field:samp_make.FDb.c_target unique:Y heaplike:N +dmmeta.ptrary field:samp_make.FTarget.c_targdep unique:Y heaplike:N +dmmeta.ptrary field:samp_make.FTarget.c_targsrc unique:Y heaplike:N +dmmeta.ptrary field:samp_meng.FSymbol.c_ordq unique:Y heaplike:N +dmmeta.ptrary field:src_hdr.FTarget.c_targsrc unique:Y heaplike:N +dmmeta.ptrary field:ssim2mysql.FCtype.c_field unique:Y heaplike:N +dmmeta.ptrary field:ssim2mysql.FNs.c_ssimfile unique:Y heaplike:N +dmmeta.ptrary field:ssim2mysql.FSsimfile.c_column unique:Y heaplike:N diff --git a/data/dmmeta/rowid.ssim b/data/dmmeta/rowid.ssim index 4c4f6cea..c3c4c5a4 100644 --- a/data/dmmeta/rowid.ssim +++ b/data/dmmeta/rowid.ssim @@ -1,9 +1,10 @@ dmmeta.rowid field:abt.FSyscmd.rowid comment:"" +dmmeta.rowid field:algo_lib.FErrns.errns comment:"" dmmeta.rowid field:amc.FReftype.rowid comment:"" dmmeta.rowid field:amc.FField.rowid comment:"" -dmmeta.rowid field:amc_vis.Outrow.rowid comment:"" +dmmeta.rowid field:amc_vis.FOutrow.rowid comment:"" dmmeta.rowid field:amc_vis.FNode.rowid comment:"" -dmmeta.rowid field:amc_vis.Linkdep.rowid comment:"" +dmmeta.rowid field:amc_vis.FLinkdep.rowid comment:"" dmmeta.rowid field:amc_vis.FNodedep.rowid comment:"" dmmeta.rowid field:lib_exec.FSyscmd.rowid comment:"" dmmeta.rowid field:atf_amc.FTypeA.rowid comment:"" diff --git a/data/dmmeta/smallstr.ssim b/data/dmmeta/smallstr.ssim index 258e8ef9..05729314 100644 --- a/data/dmmeta/smallstr.ssim +++ b/data/dmmeta/smallstr.ssim @@ -119,8 +119,10 @@ dmmeta.smallstr field:algo.Smallstr16.ch length:16 strtype:rpascal pad:"" s dmmeta.smallstr field:algo.Smallstr2.ch length:2 strtype:rpascal pad:"" strict:Y dmmeta.smallstr field:algo.Smallstr20.ch length:20 strtype:rpascal pad:"" strict:Y dmmeta.smallstr field:algo.Smallstr200.ch length:200 strtype:rpascal pad:"" strict:Y +dmmeta.smallstr field:algo.Smallstr249.ch length:249 strtype:rpascal pad:"" strict:Y dmmeta.smallstr field:algo.Smallstr25.ch length:25 strtype:rpascal pad:"" strict:Y dmmeta.smallstr field:algo.Smallstr250.ch length:250 strtype:rpascal pad:"" strict:Y +dmmeta.smallstr field:algo.Smallstr255.ch length:255 strtype:rpascal pad:"" strict:Y dmmeta.smallstr field:algo.Smallstr3.ch length:3 strtype:rpascal pad:"" strict:Y dmmeta.smallstr field:algo.Smallstr30.ch length:30 strtype:rpascal pad:"" strict:Y dmmeta.smallstr field:algo.Smallstr32.ch length:32 strtype:rpascal pad:"" strict:Y diff --git a/data/dmmeta/sortfld.ssim b/data/dmmeta/sortfld.ssim index f9564fcf..6ad43f21 100644 --- a/data/dmmeta/sortfld.ssim +++ b/data/dmmeta/sortfld.ssim @@ -9,14 +9,16 @@ dmmeta.sortfld field:algo_lib.FDb.bh_timehook sortfld:algo_lib.FTimehook.time dmmeta.sortfld field:amc.FDb.bh_enumstr_len sortfld:amc.FEnumstrLen.len dmmeta.sortfld field:amc.FEnumstrLen.bh_enumstr sortfld:amc.Enumstr.str dmmeta.sortfld field:amc.FField.bh_bitfld sortfld:dmmeta.Bitfld.offset -dmmeta.sortfld field:amc_vis.FDb.bh_link sortfld:amc_vis.Link.linkkey +dmmeta.sortfld field:amc_vis.FDb.bh_link sortfld:amc_vis.FLink.linkkey dmmeta.sortfld field:amc_vis.FDb.bh_node sortfld:amc_vis.FNode.nodekey dmmeta.sortfld field:atf_amc.FCascdel.bh_child_bheap sortfld:atf_amc.FCascdel.key dmmeta.sortfld field:atf_amc.FCascdel.tr_child_atree sortfld:atf_amc.FCascdel.key +dmmeta.sortfld field:atf_amc.FDb.bh_time_entry sortfld:atf_amc.FTimeEntry.time dmmeta.sortfld field:atf_amc.FDb.bh_typec sortfld:atf_amc.TypeC.typec dmmeta.sortfld field:atf_amc.FDb.tr_avl sortfld:atf_amc.FAvl.n dmmeta.sortfld field:atf_amc.FTypeA.bh_typeb sortfld:atf_amc.TypeB.j dmmeta.sortfld field:atf_unit.FDb.tr_number sortfld:atf_unit.FNumber.num +dmmeta.sortfld field:lib_ams.FDb.bh_shmember_read sortfld:lib_ams.FShmember.sortkey dmmeta.sortfld field:lib_exec.FDb.bh_syscmd sortfld:dev.Syscmd.execkey dmmeta.sortfld field:samp_meng.FOrdq.bh_order sortfld:samp_meng.FOrder.ordkey dmmeta.sortfld field:src_func.FDb.bh_func sortfld:src_func.FFunc.sortkey diff --git a/data/dmmeta/sqltype.ssim b/data/dmmeta/sqltype.ssim index a82b1a5c..35723161 100644 --- a/data/dmmeta/sqltype.ssim +++ b/data/dmmeta/sqltype.ssim @@ -135,8 +135,10 @@ dmmeta.sqltype ctype:algo.Smallstr16 expr:"varchar(16)" comment:"" dmmeta.sqltype ctype:algo.Smallstr2 expr:"varchar(2)" comment:"" dmmeta.sqltype ctype:algo.Smallstr20 expr:"varchar(20)" comment:"" dmmeta.sqltype ctype:algo.Smallstr200 expr:"varchar(200)" comment:"" +dmmeta.sqltype ctype:algo.Smallstr249 expr:"varchar(249)" comment:"" dmmeta.sqltype ctype:algo.Smallstr25 expr:"varchar(25)" comment:"" dmmeta.sqltype ctype:algo.Smallstr250 expr:"varchar(250)" comment:"" +dmmeta.sqltype ctype:algo.Smallstr255 expr:"varchar(255)" comment:"" dmmeta.sqltype ctype:algo.Smallstr3 expr:"varchar(3)" comment:"" dmmeta.sqltype ctype:algo.Smallstr30 expr:"varchar(30)" comment:"" dmmeta.sqltype ctype:algo.Smallstr32 expr:"varchar(32)" comment:"" diff --git a/data/dmmeta/ssimfile.ssim b/data/dmmeta/ssimfile.ssim index ad0304aa..51158094 100644 --- a/data/dmmeta/ssimfile.ssim +++ b/data/dmmeta/ssimfile.ssim @@ -5,8 +5,8 @@ dmmeta.ssimfile ssimfile:amcdb.regxtype ctype:amcdb.Regxtype dmmeta.ssimfile ssimfile:amcdb.tclass ctype:amcdb.Tclass dmmeta.ssimfile ssimfile:amcdb.tcurs ctype:amcdb.Tcurs dmmeta.ssimfile ssimfile:amcdb.tfunc ctype:amcdb.Tfunc -dmmeta.ssimfile ssimfile:amsdb.proctype ctype:amsdb.ProcType -dmmeta.ssimfile ssimfile:amsdb.streamtype ctype:amsdb.StreamType +dmmeta.ssimfile ssimfile:amsdb.proctype ctype:amsdb.Proctype +dmmeta.ssimfile ssimfile:amsdb.shmtype ctype:amsdb.Shmtype dmmeta.ssimfile ssimfile:atfdb.amctest ctype:atfdb.Amctest dmmeta.ssimfile ssimfile:atfdb.cijob ctype:atfdb.Cijob dmmeta.ssimfile ssimfile:atfdb.cipackage ctype:atfdb.Cipackage @@ -21,6 +21,7 @@ dmmeta.ssimfile ssimfile:atfdb.test_gsymbol_strptr ctype:atfdb.TestGsymbolStrp dmmeta.ssimfile ssimfile:atfdb.tfilt ctype:atfdb.Tfilt dmmeta.ssimfile ssimfile:atfdb.tmsg ctype:atfdb.Tmsg dmmeta.ssimfile ssimfile:atfdb.unittest ctype:atfdb.Unittest +dmmeta.ssimfile ssimfile:atfdb.var ctype:atfdb.Var dmmeta.ssimfile ssimfile:dev.arch ctype:dev.Arch dmmeta.ssimfile ssimfile:dev.badline ctype:dev.Badline dmmeta.ssimfile ssimfile:dev.builddir ctype:dev.Builddir @@ -42,13 +43,16 @@ dmmeta.ssimfile ssimfile:dev.linelim ctype:dev.Linelim dmmeta.ssimfile ssimfile:dev.mdmark ctype:dev.Mdmark dmmeta.ssimfile ssimfile:dev.mdsection ctype:dev.Mdsection dmmeta.ssimfile ssimfile:dev.msgfile ctype:dev.Msgfile +dmmeta.ssimfile ssimfile:dev.netproto ctype:dev.Netproto dmmeta.ssimfile ssimfile:dev.noindent ctype:dev.Noindent dmmeta.ssimfile ssimfile:dev.opt_type ctype:dev.OptType dmmeta.ssimfile ssimfile:dev.package ctype:dev.Package dmmeta.ssimfile ssimfile:dev.pkgdep ctype:dev.Pkgdep dmmeta.ssimfile ssimfile:dev.pkgkey ctype:dev.Pkgkey -dmmeta.ssimfile ssimfile:dev.readme ctype:dev.Readme +dmmeta.ssimfile ssimfile:dev.prototransport ctype:dev.Prototransport +dmmeta.ssimfile ssimfile:dev.readmefile ctype:dev.Readmefile dmmeta.ssimfile ssimfile:dev.readmesort ctype:dev.Readmesort +dmmeta.ssimfile ssimfile:dev.rpm ctype:dev.Rpm dmmeta.ssimfile ssimfile:dev.sandbox ctype:dev.Sandbox dmmeta.ssimfile ssimfile:dev.sbpath ctype:dev.Sbpath dmmeta.ssimfile ssimfile:dev.scriptfile ctype:dev.Scriptfile @@ -63,6 +67,7 @@ dmmeta.ssimfile ssimfile:dev.targsyslib ctype:dev.Targsyslib dmmeta.ssimfile ssimfile:dev.tgtcov ctype:dev.Tgtcov dmmeta.ssimfile ssimfile:dev.timefmt ctype:dev.Timefmt dmmeta.ssimfile ssimfile:dev.tool_opt ctype:dev.ToolOpt +dmmeta.ssimfile ssimfile:dev.transport ctype:dev.Transport dmmeta.ssimfile ssimfile:dev.uname ctype:dev.Uname dmmeta.ssimfile ssimfile:dev.unstablefld ctype:dev.Unstablefld dmmeta.ssimfile ssimfile:dmmeta.anonfld ctype:dmmeta.Anonfld @@ -79,6 +84,7 @@ dmmeta.ssimfile ssimfile:dmmeta.cfmt ctype:dmmeta.Cfmt dmmeta.ssimfile ssimfile:dmmeta.cget ctype:dmmeta.Cget dmmeta.ssimfile ssimfile:dmmeta.charset ctype:dmmeta.Charset dmmeta.ssimfile ssimfile:dmmeta.chash ctype:dmmeta.Chash +dmmeta.ssimfile ssimfile:dmmeta.ckafka ctype:dmmeta.Ckafka dmmeta.ssimfile ssimfile:dmmeta.cppfunc ctype:dmmeta.Cppfunc dmmeta.ssimfile ssimfile:dmmeta.cppkeyword ctype:dmmeta.Cppkeyword dmmeta.ssimfile ssimfile:dmmeta.cpptype ctype:dmmeta.Cpptype @@ -102,6 +108,7 @@ dmmeta.ssimfile ssimfile:dmmeta.fbigend ctype:dmmeta.Fbigend dmmeta.ssimfile ssimfile:dmmeta.fbitset ctype:dmmeta.Fbitset dmmeta.ssimfile ssimfile:dmmeta.fbuf ctype:dmmeta.Fbuf dmmeta.ssimfile ssimfile:dmmeta.fbufdir ctype:dmmeta.Fbufdir +dmmeta.ssimfile ssimfile:dmmeta.fbufiotype ctype:dmmeta.Fbufiotype dmmeta.ssimfile ssimfile:dmmeta.fbuftype ctype:dmmeta.Fbuftype dmmeta.ssimfile ssimfile:dmmeta.fcast ctype:dmmeta.Fcast dmmeta.ssimfile ssimfile:dmmeta.fcleanup ctype:dmmeta.Fcleanup @@ -118,6 +125,7 @@ dmmeta.ssimfile ssimfile:dmmeta.fflag ctype:dmmeta.Fflag dmmeta.ssimfile ssimfile:dmmeta.field ctype:dmmeta.Field dmmeta.ssimfile ssimfile:dmmeta.findrem ctype:dmmeta.Findrem dmmeta.ssimfile ssimfile:dmmeta.finput ctype:dmmeta.Finput +dmmeta.ssimfile ssimfile:dmmeta.fkafka ctype:dmmeta.Fkafka dmmeta.ssimfile ssimfile:dmmeta.fldoffset ctype:dmmeta.Fldoffset dmmeta.ssimfile ssimfile:dmmeta.floadtuples ctype:dmmeta.Floadtuples dmmeta.ssimfile ssimfile:dmmeta.fnoremove ctype:dmmeta.Fnoremove @@ -138,6 +146,8 @@ dmmeta.ssimfile ssimfile:dmmeta.gsymbol ctype:dmmeta.Gsymbol dmmeta.ssimfile ssimfile:dmmeta.hashtype ctype:dmmeta.Hashtype dmmeta.ssimfile ssimfile:dmmeta.hook ctype:dmmeta.Hook dmmeta.ssimfile ssimfile:dmmeta.inlary ctype:dmmeta.Inlary +dmmeta.ssimfile ssimfile:dmmeta.jstype ctype:dmmeta.Jstype +dmmeta.ssimfile ssimfile:dmmeta.kafka_type_kind ctype:dmmeta.KafkaTypeKind dmmeta.ssimfile ssimfile:dmmeta.lenfld ctype:dmmeta.Lenfld dmmeta.ssimfile ssimfile:dmmeta.listtype ctype:dmmeta.Listtype dmmeta.ssimfile ssimfile:dmmeta.llist ctype:dmmeta.Llist @@ -152,6 +162,7 @@ dmmeta.ssimfile ssimfile:dmmeta.nscpp ctype:dmmeta.Nscpp dmmeta.ssimfile ssimfile:dmmeta.nsdb ctype:dmmeta.Nsdb dmmeta.ssimfile ssimfile:dmmeta.nsfast ctype:dmmeta.Nsfast dmmeta.ssimfile ssimfile:dmmeta.nsinclude ctype:dmmeta.Nsinclude +dmmeta.ssimfile ssimfile:dmmeta.nsjs ctype:dmmeta.Nsjs dmmeta.ssimfile ssimfile:dmmeta.nsproto ctype:dmmeta.Nsproto dmmeta.ssimfile ssimfile:dmmeta.nstype ctype:dmmeta.Nstype dmmeta.ssimfile ssimfile:dmmeta.nsversion ctype:dmmeta.Nsversion @@ -184,6 +195,7 @@ dmmeta.ssimfile ssimfile:dmmeta.thash ctype:dmmeta.Thash dmmeta.ssimfile ssimfile:dmmeta.tracefld ctype:dmmeta.Tracefld dmmeta.ssimfile ssimfile:dmmeta.tracerec ctype:dmmeta.Tracerec dmmeta.ssimfile ssimfile:dmmeta.typefld ctype:dmmeta.Typefld +dmmeta.ssimfile ssimfile:dmmeta.userfunc ctype:dmmeta.Userfunc dmmeta.ssimfile ssimfile:dmmeta.usertracefld ctype:dmmeta.Usertracefld dmmeta.ssimfile ssimfile:dmmeta.xref ctype:dmmeta.Xref dmmeta.ssimfile ssimfile:fmdb.alarm ctype:fmdb.Alarm @@ -202,8 +214,6 @@ dmmeta.ssimfile ssimfile:gclidb.gfld ctype:gclidb.Gfld dmmeta.ssimfile ssimfile:gclidb.githost ctype:gclidb.Githost dmmeta.ssimfile ssimfile:gclidb.gmethod ctype:gclidb.Gmethod dmmeta.ssimfile ssimfile:gclidb.grepo ctype:gclidb.Grepo -dmmeta.ssimfile ssimfile:gclidb.grepogitport ctype:gclidb.Grepogitport -dmmeta.ssimfile ssimfile:gclidb.grepossh ctype:gclidb.Grepossh dmmeta.ssimfile ssimfile:gclidb.gstate ctype:gclidb.Gstate dmmeta.ssimfile ssimfile:gclidb.gstatet ctype:gclidb.Gstatet dmmeta.ssimfile ssimfile:gclidb.gtbl ctype:gclidb.Gtbl @@ -224,3 +234,14 @@ dmmeta.ssimfile ssimfile:gclidb.mrjob ctype:gclidb.Mrjob dmmeta.ssimfile ssimfile:gclidb.mrnote ctype:gclidb.Mrnote dmmeta.ssimfile ssimfile:gclidb.project ctype:gclidb.Project dmmeta.ssimfile ssimfile:gclidb.user ctype:gclidb.User +dmmeta.ssimfile ssimfile:httpdb.content ctype:httpdb.Content +dmmeta.ssimfile ssimfile:httpdb.header ctype:httpdb.Header +dmmeta.ssimfile ssimfile:httpdb.method ctype:httpdb.Method +dmmeta.ssimfile ssimfile:httpdb.status ctype:httpdb.Status +dmmeta.ssimfile ssimfile:httpdb.version ctype:httpdb.Version +dmmeta.ssimfile ssimfile:sampdb.gitfile ctype:sampdb.Gitfile +dmmeta.ssimfile ssimfile:sampdb.targdep ctype:sampdb.Targdep +dmmeta.ssimfile ssimfile:sampdb.target ctype:sampdb.Target +dmmeta.ssimfile ssimfile:sampdb.targrec ctype:sampdb.Targrec +dmmeta.ssimfile ssimfile:sampdb.targsrc ctype:sampdb.Targsrc +dmmeta.ssimfile ssimfile:wsdb.status ctype:wsdb.Status diff --git a/data/dmmeta/ssimreq.ssim b/data/dmmeta/ssimreq.ssim index c619d05d..f1f837a7 100644 --- a/data/dmmeta/ssimreq.ssim +++ b/data/dmmeta/ssimreq.ssim @@ -12,7 +12,7 @@ dmmeta.ssimreq ssimreq:"dev.gitfile:txt/${nstype}/$ns/README.md" parent:"dmmet dmmeta.ssimreq ssimreq:"dev.gitfile:txt/${nstype}/$ns/internals.md" parent:dmmeta.Ns.nstype:exe reqchild:N bidir:N comment:"" dmmeta.ssimreq ssimreq:dev.gitfile:txt/script/$name.md parent:dev.Scriptfile.gitfile:% reqchild:Y bidir:N comment:"" dmmeta.ssimreq ssimreq:dev.gitfile:txt/ssimdb/$ns/$name.md parent:dmmeta.Ssimfile.ssimfile:% reqchild:Y bidir:N comment:"" -dmmeta.ssimreq ssimreq:dev.readme:$gitfile parent:dev.Gitfile.gitfile:txt/% reqchild:Y bidir:N comment:"All gitfiles under txt/ must have readmes" +dmmeta.ssimreq ssimreq:dev.readmefile:$gitfile parent:dev.Gitfile.gitfile:txt/% reqchild:Y bidir:N comment:"All gitfiles under txt/ must have readmes" dmmeta.ssimreq ssimreq:dmmeta.ctype:command.$ns parent:dmmeta.Ns.nstype:exe reqchild:Y bidir:N comment:"" dmmeta.ssimreq ssimreq:dmmeta.ctype:report.$ns parent:dmmeta.Ns.nstype:exe reqchild:N bidir:N comment:"" dmmeta.ssimreq ssimreq:dmmeta.fbuf:$field parent:dmmeta.Field.reftype:Fbuf reqchild:Y bidir:Y comment:"" diff --git a/data/dmmeta/ssimsort.ssim b/data/dmmeta/ssimsort.ssim index 3a5c46e1..42b63e21 100644 --- a/data/dmmeta/ssimsort.ssim +++ b/data/dmmeta/ssimsort.ssim @@ -4,8 +4,8 @@ dmmeta.ssimsort ssimfile:amcdb.regxtype sortfld:amcdb.Regxtype.regxtype comme dmmeta.ssimsort ssimfile:amcdb.tclass sortfld:amcdb.Tclass.tclass comment:"" dmmeta.ssimsort ssimfile:amcdb.tcurs sortfld:amcdb.Tcurs.tfunc comment:"" dmmeta.ssimsort ssimfile:amcdb.tfunc sortfld:amcdb.Tfunc.tclass comment:"" -dmmeta.ssimsort ssimfile:amsdb.proctype sortfld:amsdb.ProcType.proctype comment:"" -dmmeta.ssimsort ssimfile:amsdb.streamtype sortfld:amsdb.StreamType.streamtype comment:"" +dmmeta.ssimsort ssimfile:amsdb.proctype sortfld:amsdb.Proctype.proctype comment:"" +dmmeta.ssimsort ssimfile:amsdb.shmtype sortfld:amsdb.Shmtype.shmtype comment:"" dmmeta.ssimsort ssimfile:atfdb.amctest sortfld:atfdb.Amctest.amctest comment:"" dmmeta.ssimsort ssimfile:atfdb.cijob sortfld:atfdb.Cijob.cijob comment:"" dmmeta.ssimsort ssimfile:atfdb.cipackage sortfld:atfdb.Cipackage.package comment:"" @@ -17,8 +17,9 @@ dmmeta.ssimsort ssimfile:atfdb.test_gsymbol_char sortfld:atfdb.TestGsymbolChar dmmeta.ssimsort ssimfile:atfdb.test_gsymbol_pkey sortfld:atfdb.TestGsymbolPkey.test_gsymbol_pkey comment:"" dmmeta.ssimsort ssimfile:atfdb.test_gsymbol_strptr sortfld:atfdb.TestGsymbolStrptr.test_gsymbol_strptr comment:"" dmmeta.ssimsort ssimfile:atfdb.tfilt sortfld:atfdb.Tfilt.comptest comment:"" -dmmeta.ssimsort ssimfile:atfdb.tmsg sortfld:atfdb.Tmsg.comptest comment:"" +dmmeta.ssimsort ssimfile:atfdb.tmsg sortfld:atfdb.Tmsg.tmsg comment:"" dmmeta.ssimsort ssimfile:atfdb.unittest sortfld:atfdb.Unittest.unittest comment:"" +dmmeta.ssimsort ssimfile:atfdb.var sortfld:atfdb.Var.var comment:"" dmmeta.ssimsort ssimfile:dev.arch sortfld:dev.Arch.arch comment:"" dmmeta.ssimsort ssimfile:dev.badline sortfld:dev.Badline.badline comment:"" dmmeta.ssimsort ssimfile:dev.builddir sortfld:dev.Builddir.builddir comment:"" @@ -38,12 +39,15 @@ dmmeta.ssimsort ssimfile:dev.license sortfld:dev.License.license comment:"" dmmeta.ssimsort ssimfile:dev.linelim sortfld:dev.Linelim.gitfile comment:"" dmmeta.ssimsort ssimfile:dev.mdmark sortfld:dev.Mdmark.mdmark comment:"" dmmeta.ssimsort ssimfile:dev.msgfile sortfld:dev.Msgfile.gitfile comment:"" +dmmeta.ssimsort ssimfile:dev.netproto sortfld:dev.Netproto.netproto comment:"" dmmeta.ssimsort ssimfile:dev.noindent sortfld:dev.Noindent.gitfile comment:"" dmmeta.ssimsort ssimfile:dev.opt_type sortfld:dev.OptType.opt_type comment:"" dmmeta.ssimsort ssimfile:dev.package sortfld:dev.Package.package comment:"" dmmeta.ssimsort ssimfile:dev.pkgdep sortfld:dev.Pkgdep.pkgdep comment:"" dmmeta.ssimsort ssimfile:dev.pkgkey sortfld:dev.Pkgkey.pkgkey comment:"" -dmmeta.ssimsort ssimfile:dev.readme sortfld:dev.Readme.gitfile comment:"" +dmmeta.ssimsort ssimfile:dev.prototransport sortfld:dev.Prototransport.prototransport comment:"" +dmmeta.ssimsort ssimfile:dev.readmefile sortfld:dev.Readmefile.gitfile comment:"" +dmmeta.ssimsort ssimfile:dev.rpm sortfld:dev.Rpm.rpm comment:"" dmmeta.ssimsort ssimfile:dev.sandbox sortfld:dev.Sandbox.sandbox comment:"" dmmeta.ssimsort ssimfile:dev.sbpath sortfld:dev.Sbpath.sbpath comment:"" dmmeta.ssimsort ssimfile:dev.scriptfile sortfld:dev.Scriptfile.gitfile comment:"" @@ -53,7 +57,7 @@ dmmeta.ssimsort ssimfile:dev.target sortfld:dev.Target.target comment:"" dmmeta.ssimsort ssimfile:dev.targsrc sortfld:dev.Targsrc.targsrc comment:"" dmmeta.ssimsort ssimfile:dev.targsyslib sortfld:dev.Targsyslib.targsyslib comment:"" dmmeta.ssimsort ssimfile:dev.tgtcov sortfld:dev.Tgtcov.target comment:"" -dmmeta.ssimsort ssimfile:dev.tool_opt sortfld:dev.ToolOpt.sortfld comment:"" +dmmeta.ssimsort ssimfile:dev.transport sortfld:dev.Transport.transport comment:"" dmmeta.ssimsort ssimfile:dev.uname sortfld:dev.Uname.uname comment:"" dmmeta.ssimsort ssimfile:dev.unstablefld sortfld:dev.Unstablefld.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.anonfld sortfld:dmmeta.Anonfld.field comment:"" @@ -70,6 +74,7 @@ dmmeta.ssimsort ssimfile:dmmeta.cfmt sortfld:dmmeta.Cfmt.cfmt comment:"" dmmeta.ssimsort ssimfile:dmmeta.cget sortfld:dmmeta.Cget.ctype comment:"" dmmeta.ssimsort ssimfile:dmmeta.charset sortfld:dmmeta.Charset.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.chash sortfld:dmmeta.Chash.ctype comment:"" +dmmeta.ssimsort ssimfile:dmmeta.ckafka sortfld:dmmeta.Ckafka.ctype comment:"" dmmeta.ssimsort ssimfile:dmmeta.cppfunc sortfld:dmmeta.Cppfunc.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.cpptype sortfld:dmmeta.Cpptype.ctype comment:"" dmmeta.ssimsort ssimfile:dmmeta.csize sortfld:dmmeta.Csize.ctype comment:"" @@ -90,6 +95,7 @@ dmmeta.ssimsort ssimfile:dmmeta.fbase sortfld:dmmeta.Fbase.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.fbigend sortfld:dmmeta.Fbigend.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.fbuf sortfld:dmmeta.Fbuf.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.fbufdir sortfld:dmmeta.Fbufdir.fbufdir comment:"" +dmmeta.ssimsort ssimfile:dmmeta.fbufiotype sortfld:dmmeta.Fbufiotype.fbufiotype comment:"" dmmeta.ssimsort ssimfile:dmmeta.fbuftype sortfld:dmmeta.Fbuftype.fbuftype comment:"" dmmeta.ssimsort ssimfile:dmmeta.fcast sortfld:dmmeta.Fcast.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.fcleanup sortfld:dmmeta.Fcleanup.field comment:"" @@ -106,6 +112,7 @@ dmmeta.ssimsort ssimfile:dmmeta.fflag sortfld:dmmeta.Fflag.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.field sortfld:dmmeta.Field.ctype comment:"Sort by ctype only" dmmeta.ssimsort ssimfile:dmmeta.findrem sortfld:dmmeta.Findrem.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.finput sortfld:dmmeta.Finput.field comment:"" +dmmeta.ssimsort ssimfile:dmmeta.fkafka sortfld:dmmeta.Fkafka.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.fldoffset sortfld:dmmeta.Fldoffset.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.floadtuples sortfld:dmmeta.Floadtuples.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.fnoremove sortfld:dmmeta.Fnoremove.field comment:"" @@ -124,6 +131,8 @@ dmmeta.ssimsort ssimfile:dmmeta.gstatic sortfld:dmmeta.Gstatic.ns comment:"" dmmeta.ssimsort ssimfile:dmmeta.gsymbol sortfld:dmmeta.Gsymbol.gsymbol comment:"" dmmeta.ssimsort ssimfile:dmmeta.hook sortfld:dmmeta.Hook.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.inlary sortfld:dmmeta.Inlary.field comment:"" +dmmeta.ssimsort ssimfile:dmmeta.jstype sortfld:dmmeta.Jstype.ctype comment:"" +dmmeta.ssimsort ssimfile:dmmeta.kafka_type_kind sortfld:dmmeta.KafkaTypeKind.kafka_type_kind comment:"" dmmeta.ssimsort ssimfile:dmmeta.lenfld sortfld:dmmeta.Lenfld.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.listtype sortfld:dmmeta.Listtype.listtype comment:"" dmmeta.ssimsort ssimfile:dmmeta.llist sortfld:dmmeta.Llist.field comment:"" @@ -138,6 +147,7 @@ dmmeta.ssimsort ssimfile:dmmeta.nscpp sortfld:dmmeta.Nscpp.ns comment:"" dmmeta.ssimsort ssimfile:dmmeta.nsdb sortfld:dmmeta.Nsdb.ns comment:"" dmmeta.ssimsort ssimfile:dmmeta.nsfast sortfld:dmmeta.Nsfast.ns comment:"" dmmeta.ssimsort ssimfile:dmmeta.nsinclude sortfld:dmmeta.Nsinclude.ns comment:"" +dmmeta.ssimsort ssimfile:dmmeta.nsjs sortfld:dmmeta.Nsjs.ns comment:"" dmmeta.ssimsort ssimfile:dmmeta.nsproto sortfld:dmmeta.Nsproto.ns comment:"" dmmeta.ssimsort ssimfile:dmmeta.nstype sortfld:dmmeta.Nstype.nstype comment:"" dmmeta.ssimsort ssimfile:dmmeta.nsversion sortfld:dmmeta.Nsversion.ns comment:"" @@ -165,6 +175,7 @@ dmmeta.ssimsort ssimfile:dmmeta.tary sortfld:dmmeta.Tary.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.thash sortfld:dmmeta.Thash.field comment:"" dmmeta.ssimsort ssimfile:dmmeta.tracerec sortfld:dmmeta.Tracerec.tracerec comment:"" dmmeta.ssimsort ssimfile:dmmeta.typefld sortfld:dmmeta.Typefld.field comment:"" +dmmeta.ssimsort ssimfile:dmmeta.userfunc sortfld:dmmeta.Userfunc.userfunc comment:"" dmmeta.ssimsort ssimfile:dmmeta.usertracefld sortfld:dmmeta.Usertracefld.tracefld comment:"" dmmeta.ssimsort ssimfile:dmmeta.xref sortfld:dmmeta.Xref.ns comment:"" dmmeta.ssimsort ssimfile:fmdb.alarm sortfld:fmdb.Alarm.alarm comment:"" @@ -180,8 +191,6 @@ dmmeta.ssimsort ssimfile:gclidb.gclienv sortfld:gclidb.Gclienv.gclienv commen dmmeta.ssimsort ssimfile:gclidb.gclisub sortfld:gclidb.Gclisub.gclisub comment:"" dmmeta.ssimsort ssimfile:gclidb.gfld sortfld:gclidb.Gfld.gfld comment:"" dmmeta.ssimsort ssimfile:gclidb.gmethod sortfld:gclidb.Gmethod.gmethod comment:"" -dmmeta.ssimsort ssimfile:gclidb.grepogitport sortfld:gclidb.Grepogitport.grepogitport comment:"" -dmmeta.ssimsort ssimfile:gclidb.grepossh sortfld:gclidb.Grepossh.grepossh comment:"" dmmeta.ssimsort ssimfile:gclidb.gstate sortfld:gclidb.Gstate.gstate comment:"" dmmeta.ssimsort ssimfile:gclidb.gstatet sortfld:gclidb.Gstatet.gstatet comment:"" dmmeta.ssimsort ssimfile:gclidb.gtbl sortfld:gclidb.Gtbl.gtbl comment:"" @@ -191,3 +200,13 @@ dmmeta.ssimsort ssimfile:gclidb.gtype sortfld:gclidb.Gtype.gtype comment:"" dmmeta.ssimsort ssimfile:gclidb.gtypeh sortfld:gclidb.Gtypeh.gtypeh comment:"" dmmeta.ssimsort ssimfile:gclidb.gtypeprefix sortfld:gclidb.Gtypeprefix.gtypeprefix comment:"" dmmeta.ssimsort ssimfile:gclidb.label sortfld:gclidb.Label.label comment:"" +dmmeta.ssimsort ssimfile:httpdb.content sortfld:httpdb.Content.content comment:"" +dmmeta.ssimsort ssimfile:httpdb.header sortfld:httpdb.Header.header comment:"" +dmmeta.ssimsort ssimfile:httpdb.method sortfld:httpdb.Method.id comment:"" +dmmeta.ssimsort ssimfile:httpdb.version sortfld:httpdb.Version.version comment:"" +dmmeta.ssimsort ssimfile:sampdb.gitfile sortfld:sampdb.Gitfile.gitfile comment:"" +dmmeta.ssimsort ssimfile:sampdb.targdep sortfld:sampdb.Targdep.targdep comment:"" +dmmeta.ssimsort ssimfile:sampdb.target sortfld:sampdb.Target.target comment:"" +dmmeta.ssimsort ssimfile:sampdb.targrec sortfld:sampdb.Targrec.target comment:"" +dmmeta.ssimsort ssimfile:sampdb.targsrc sortfld:sampdb.Targsrc.targsrc comment:"" +dmmeta.ssimsort ssimfile:wsdb.status sortfld:wsdb.Status.code comment:"" diff --git a/data/dmmeta/steptype.ssim b/data/dmmeta/steptype.ssim index 0c247f18..18ebeb66 100644 --- a/data/dmmeta/steptype.ssim +++ b/data/dmmeta/steptype.ssim @@ -1,6 +1,7 @@ -dmmeta.steptype steptype:Callback comment:"Check field on every scheduler cycle; Does not update _db.next_loop" -dmmeta.steptype steptype:Extern comment:"" -dmmeta.steptype steptype:Inline comment:"Check field on every scheduler cycle" -dmmeta.steptype steptype:InlineOnce comment:"Check timeout field on every scheduler cycle; Do not reschedule" -dmmeta.steptype steptype:InlineRecur comment:"Check timeout field on every scheduler cycle; reschedule with delay" -dmmeta.steptype steptype:TimeHookRecur comment:"Bheap version of InlineRecur" +dmmeta.steptype steptype:Callback comment:"Inline, call step func always; Does not update _db.next_loop, does not affect hot polling" +dmmeta.steptype steptype:Extern comment:"User provides scheduling by implementing _FirstChanged." +dmmeta.steptype steptype:Inline comment:"Inline, call step func always" +dmmeta.steptype steptype:InlineOnce comment:"Inline, call step func at given time (time is given by first elemement of index)" +dmmeta.steptype steptype:InlineRecur comment:"Inline, call step func with given periodicity" +dmmeta.steptype steptype:TimeHookOnce comment:"TimeHook, call step func at given time (time is given by first elemement of index)" +dmmeta.steptype steptype:TimeHookRecur comment:"TimeHook, call step func with given periodicity" diff --git a/data/dmmeta/substr.ssim b/data/dmmeta/substr.ssim index 2d910044..42bdebdf 100644 --- a/data/dmmeta/substr.ssim +++ b/data/dmmeta/substr.ssim @@ -11,7 +11,7 @@ dmmeta.substr field:atfdb.Comptest.testname expr:.LR srcfield:atfdb.Comptest. dmmeta.substr field:atfdb.Tmsg.comptest expr:/LL srcfield:atfdb.Tmsg.tmsg dmmeta.substr field:atfdb.Tmsg.dir expr:/LR.LR srcfield:atfdb.Tmsg.tmsg dmmeta.substr field:atfdb.Tmsg.rank expr:/LR.LL srcfield:atfdb.Tmsg.tmsg -dmmeta.substr field:atfdb.Unittest.target expr:.RL srcfield:atfdb.Unittest.unittest +dmmeta.substr field:atfdb.Unittest.ns expr:.RL srcfield:atfdb.Unittest.unittest dmmeta.substr field:atfdb.Unittest.testname expr:.RR srcfield:atfdb.Unittest.unittest dmmeta.substr field:dev.Builddir.arch expr:.LR-LR srcfield:dev.Builddir.builddir dmmeta.substr field:dev.Builddir.cfg expr:.LR-LL srcfield:dev.Builddir.builddir @@ -28,6 +28,8 @@ dmmeta.substr field:dev.Pkgdep.package expr:.RL srcfield:dev.Pkgdep.pkgdep dmmeta.substr field:dev.Pkgdep.parent expr:.RR srcfield:dev.Pkgdep.pkgdep dmmeta.substr field:dev.Pkgkey.key expr:/LR srcfield:dev.Pkgkey.pkgkey dmmeta.substr field:dev.Pkgkey.package expr:/LL srcfield:dev.Pkgkey.pkgkey +dmmeta.substr field:dev.Prototransport.netproto expr:/RL srcfield:dev.Prototransport.prototransport +dmmeta.substr field:dev.Prototransport.transport expr:/RR srcfield:dev.Prototransport.prototransport dmmeta.substr field:dev.Scriptfile.name expr:/RR srcfield:dev.Scriptfile.gitfile dmmeta.substr field:dev.Srcfile.ext expr:.RR srcfield:dev.Srcfile.srcfile dmmeta.substr field:dev.Targdep.parent expr:.RR srcfield:dev.Targdep.targdep @@ -35,6 +37,7 @@ dmmeta.substr field:dev.Targdep.target expr:.RL srcfield:dev.Targdep.targdep dmmeta.substr field:dev.Targsrc.ext expr:.RR srcfield:dev.Targsrc.targsrc dmmeta.substr field:dev.Targsrc.src expr:/LR srcfield:dev.Targsrc.targsrc dmmeta.substr field:dev.Targsrc.target expr:/LL srcfield:dev.Targsrc.targsrc +dmmeta.substr field:dev.Targsyslib.prefix expr:.RL srcfield:dev.Targsyslib.targsyslib dmmeta.substr field:dev.Targsyslib.syslib expr:/LR.LR srcfield:dev.Targsyslib.targsyslib dmmeta.substr field:dev.Targsyslib.target expr:/LR.LL srcfield:dev.Targsyslib.targsyslib dmmeta.substr field:dev.Targsyslib.uname expr:/LL srcfield:dev.Targsyslib.targsyslib @@ -148,7 +151,6 @@ dmmeta.substr field:gclidb.Githost.gitrepo expr:@LR:LR srcfield:gclidb.Githos dmmeta.substr field:gclidb.Githost.host expr:@LR:LL srcfield:gclidb.Githost.githost dmmeta.substr field:gclidb.Grepo.fname expr:@LR srcfield:gclidb.Grepo.grepo dmmeta.substr field:gclidb.Grepo.host expr:@LL srcfield:gclidb.Grepo.grepo -dmmeta.substr field:gclidb.Grepossh.name expr:/RR srcfield:gclidb.Grepossh.sshid dmmeta.substr field:gclidb.Gstate.st expr:_LL srcfield:gclidb.Gstate.gstate dmmeta.substr field:gclidb.Gstate.state expr:_LR srcfield:gclidb.Gstate.gstate dmmeta.substr field:gclidb.Gstatet.gstate expr:.RL srcfield:gclidb.Gstatet.gstatet @@ -180,5 +182,11 @@ dmmeta.substr field:gclidb.Mrjob.job expr:/RR srcfield:gclidb.Mrjob.mrjob dmmeta.substr field:gclidb.Mrjob.mr expr:/RL srcfield:gclidb.Mrjob.mrjob dmmeta.substr field:gclidb.Mrnote.mr expr:.RL srcfield:gclidb.Mrnote.mrnote dmmeta.substr field:gclidb.Mrnote.nid expr:.RR srcfield:gclidb.Mrnote.mrnote +dmmeta.substr field:httpdb.Status.code expr:" LL" srcfield:httpdb.Status.status +dmmeta.substr field:httpdb.Status.reason expr:" LR" srcfield:httpdb.Status.status +dmmeta.substr field:sampdb.Targdep.parent expr:.LR srcfield:sampdb.Targdep.targdep +dmmeta.substr field:sampdb.Targdep.target expr:.LL srcfield:sampdb.Targdep.targdep +dmmeta.substr field:sampdb.Targsrc.src expr:/LR srcfield:sampdb.Targsrc.targsrc +dmmeta.substr field:sampdb.Targsrc.target expr:/LL srcfield:sampdb.Targsrc.targsrc dmmeta.substr field:ssim2mysql.FColumn.name expr:.RR srcfield:ssim2mysql.FColumn.column dmmeta.substr field:ssim2mysql.FColumn.ssimfile expr:.RL srcfield:ssim2mysql.FColumn.column diff --git a/data/dmmeta/svtype.ssim b/data/dmmeta/svtype.ssim index 51d3f749..403fe4a3 100644 --- a/data/dmmeta/svtype.ssim +++ b/data/dmmeta/svtype.ssim @@ -2,8 +2,10 @@ dmmeta.svtype ctype:algo.Smallstr10 maxwid:10 fixedwid1:0 fixedwid2:0 comme dmmeta.svtype ctype:algo.Smallstr100 maxwid:100 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.Smallstr150 maxwid:150 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.Smallstr200 maxwid:200 fixedwid1:0 fixedwid2:0 comment:"" +dmmeta.svtype ctype:algo.Smallstr249 maxwid:249 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.Smallstr25 maxwid:25 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.Smallstr250 maxwid:250 fixedwid1:0 fixedwid2:0 comment:"" +dmmeta.svtype ctype:algo.Smallstr255 maxwid:255 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.Smallstr50 maxwid:10 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.cstring maxwid:1000000000 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:bool maxwid:1 fixedwid1:0 fixedwid2:0 comment:"" diff --git a/data/dmmeta/tary.ssim b/data/dmmeta/tary.ssim index e44e8404..66badd94 100644 --- a/data/dmmeta/tary.ssim +++ b/data/dmmeta/tary.ssim @@ -5,9 +5,12 @@ dmmeta.tary field:acr_compl.FDb.word aliased:N comment:"" dmmeta.tary field:acr_ed.FDb.vis aliased:N comment:"" dmmeta.tary field:acr_my.FDb.ary_ns aliased:N comment:"" dmmeta.tary field:algo.ByteAry.ary aliased:Y comment:"" +dmmeta.tary field:algo.I32RangeAry.ary aliased:N comment:"" dmmeta.tary field:algo.LineBuf.buf aliased:Y comment:"" dmmeta.tary field:algo.StringAry.ary aliased:Y comment:"" dmmeta.tary field:algo.Tuple.attrs aliased:Y comment:"" +dmmeta.tary field:algo.U16Ary.ary aliased:Y comment:"" +dmmeta.tary field:algo.U32Ary.ary aliased:Y comment:"" dmmeta.tary field:algo.U64Ary.ary aliased:Y comment:"" dmmeta.tary field:algo.cstring.ch aliased:Y comment:"" dmmeta.tary field:algo_lib.Bitset.ary aliased:N comment:"" @@ -16,11 +19,10 @@ dmmeta.tary field:algo_lib.FDb.dirstack aliased:N comment:"Directory before s dmmeta.tary field:algo_lib.FDb.exec_args aliased:N comment:"" dmmeta.tary field:algo_lib.Regx.state aliased:N comment:"" dmmeta.tary field:algo_lib.RegxParse.ary_expr aliased:N comment:"" -dmmeta.tary field:algo_lib.RegxState.ch_class aliased:N comment:"" dmmeta.tary field:algo_lib.Tabulate.width aliased:N comment:"" dmmeta.tary field:amc.FFunc.funcarg aliased:N comment:"" dmmeta.tary field:amc.FNs.include aliased:N comment:"" -dmmeta.tary field:amc_vis.Outrow.text aliased:N comment:"" +dmmeta.tary field:amc_vis.FOutrow.text aliased:N comment:"" dmmeta.tary field:atf_amc.FPerfSortString.orig aliased:N comment:"" dmmeta.tary field:atf_amc.FPerfSortString.sorted1 aliased:Y comment:"" dmmeta.tary field:atf_amc.FUnitSort.tary aliased:N comment:"" @@ -38,6 +40,7 @@ dmmeta.tary field:command.atf_cmdline.mnum aliased:N comment:"Number array" dmmeta.tary field:command.atf_cmdline.mstr aliased:N comment:"String array" dmmeta.tary field:command.gcache.cmd aliased:N comment:"Command to execute" dmmeta.tary field:command.gcli.fields aliased:N comment:"String array" +dmmeta.tary field:command.jkv.kv aliased:N comment:"" dmmeta.tary field:command.mdbg.args aliased:N comment:"" dmmeta.tary field:command.mdbg.b aliased:N comment:"" dmmeta.tary field:command.sandbox.cmd aliased:N comment:"Command to execute in sandbox" @@ -45,6 +48,10 @@ dmmeta.tary field:command.sandbox.files aliased:N comment:"" dmmeta.tary field:command.ssimfilt.field aliased:N comment:"" dmmeta.tary field:command.ssimfilt.match aliased:N comment:"" dmmeta.tary field:gcli.FHttp.response_header aliased:N comment:"" +dmmeta.tary field:http.Request.extension_header aliased:N comment:"" +dmmeta.tary field:http.Response.extension_header aliased:N comment:"" +dmmeta.tary field:kafka.Record.headers aliased:N comment:"" +dmmeta.tary field:kafka.RecordBatch.records aliased:N comment:"" dmmeta.tary field:lib_ams.FReadfile.buf aliased:N comment:"" dmmeta.tary field:lib_ams.FReadfile.cbuf aliased:N comment:"" dmmeta.tary field:lib_ams.FReadfile.offset aliased:N comment:"" diff --git a/data/dmmeta/thash.ssim b/data/dmmeta/thash.ssim index 3b7a6084..70fee590 100644 --- a/data/dmmeta/thash.ssim +++ b/data/dmmeta/thash.ssim @@ -14,12 +14,13 @@ dmmeta.thash field:abt.FDb.ind_targsrc hashfld:dev.Targsrc.targsrc unique:Y dmmeta.thash field:abt.FDb.ind_uname hashfld:dev.Uname.uname unique:Y comment:"" dmmeta.thash field:abt_md.FDb.ind_anchor hashfld:abt_md.FAnchor.anchor unique:Y comment:"" dmmeta.thash field:abt_md.FDb.ind_ctype hashfld:dmmeta.Ctype.ctype unique:Y comment:"" +dmmeta.thash field:abt_md.FDb.ind_dispatch hashfld:dmmeta.Dispatch.dispatch unique:Y comment:"" dmmeta.thash field:abt_md.FDb.ind_field hashfld:dmmeta.Field.field unique:Y comment:"" dmmeta.thash field:abt_md.FDb.ind_gstatic hashfld:dmmeta.Gstatic.field unique:Y comment:"" dmmeta.thash field:abt_md.FDb.ind_human_text hashfld:abt_md.FHumanText.key unique:Y comment:"" dmmeta.thash field:abt_md.FDb.ind_ns hashfld:dmmeta.Ns.ns unique:Y comment:"" dmmeta.thash field:abt_md.FDb.ind_nstype hashfld:dmmeta.Nstype.nstype unique:Y comment:"" -dmmeta.thash field:abt_md.FDb.ind_readme hashfld:dev.Readme.gitfile unique:Y comment:"" +dmmeta.thash field:abt_md.FDb.ind_readmefile hashfld:dev.Readmefile.gitfile unique:Y comment:"" dmmeta.thash field:abt_md.FDb.ind_readmesort hashfld:dev.Readmesort.readmesort unique:Y comment:"" dmmeta.thash field:abt_md.FDb.ind_scriptfile hashfld:dev.Scriptfile.gitfile unique:Y comment:"" dmmeta.thash field:abt_md.FDb.ind_ssimfile hashfld:dmmeta.Ssimfile.ssimfile unique:Y comment:"" @@ -99,6 +100,7 @@ dmmeta.thash field:amc.FDb.ind_reftype hashfld:dmmeta.Reftype.reftype unique: dmmeta.thash field:amc.FDb.ind_rowid hashfld:dmmeta.Rowid.field unique:Y comment:"" dmmeta.thash field:amc.FDb.ind_smallstr hashfld:dmmeta.Smallstr.field unique:Y comment:"" dmmeta.thash field:amc.FDb.ind_ssimfile hashfld:dmmeta.Ssimfile.ssimfile unique:Y comment:"" +dmmeta.thash field:amc.FDb.ind_steptype hashfld:dmmeta.Steptype.steptype unique:Y comment:"" dmmeta.thash field:amc.FDb.ind_target hashfld:dev.Target.target unique:Y comment:"" dmmeta.thash field:amc.FDb.ind_tary hashfld:dmmeta.Tary.field unique:Y comment:"" dmmeta.thash field:amc.FDb.ind_tclass hashfld:amcdb.Tclass.tclass unique:Y comment:"" @@ -107,7 +109,7 @@ dmmeta.thash field:amc.FDb.ind_xref hashfld:dmmeta.Xref.field unique:Y comme dmmeta.thash field:amc.FGenXref.ind_seen hashfld:amc.FGenXrefSeen.value unique:Y comment:"" dmmeta.thash field:amc_vis.FDb.ind_ctype hashfld:dmmeta.Ctype.ctype unique:Y comment:"" dmmeta.thash field:amc_vis.FDb.ind_field hashfld:dmmeta.Field.field unique:Y comment:"" -dmmeta.thash field:amc_vis.FDb.ind_link hashfld:amc_vis.Link.link unique:Y comment:"" +dmmeta.thash field:amc_vis.FDb.ind_link hashfld:amc_vis.FLink.link unique:Y comment:"" dmmeta.thash field:amc_vis.FDb.ind_node hashfld:amc_vis.FNode.node unique:Y comment:"" dmmeta.thash field:amc_vis.FDb.ind_reftype hashfld:dmmeta.Reftype.reftype unique:Y comment:"" dmmeta.thash field:apm.FDb.ind_ctype hashfld:dmmeta.Ctype.ctype unique:Y comment:"" @@ -120,6 +122,9 @@ dmmeta.thash field:apm.FDb.ind_rec hashfld:apm.FRec.rec unique:Y comment:"" dmmeta.thash field:apm.FDb.ind_ssimfile hashfld:dmmeta.Ssimfile.ssimfile unique:Y comment:"" dmmeta.thash field:atf_amc.FCascdel.ind_child_thash hashfld:atf_amc.FCascdel.key unique:Y comment:"" dmmeta.thash field:atf_amc.FDb.ind_cstring hashfld:atf_amc.Cstring.str unique:Y comment:"" +dmmeta.thash field:atf_amc.FDb.ind_hashable hashfld:atf_amc.Hashable.key unique:Y comment:"" +dmmeta.thash field:atf_amc.FDb.ind_linear hashfld:atf_amc.FHashableLinear.key unique:Y comment:"" +dmmeta.thash field:atf_amc.FDb.ind_strkey hashfld:atf_amc.Strkey.strkey unique:Y comment:"" dmmeta.thash field:atf_amc.FDb.ind_thash_elem hashfld:atf_amc.FThashElem.key unique:Y comment:"" dmmeta.thash field:atf_amc.FDb.ind_typea hashfld:atf_amc.TypeA.typea unique:Y comment:"" dmmeta.thash field:atf_amc.FDb.ind_types hashfld:atf_amc.TypeS.types unique:Y comment:"" @@ -131,11 +136,14 @@ dmmeta.thash field:atf_ci.FDb.ind_ns hashfld:dmmeta.Ns.ns unique:Y comment:" dmmeta.thash field:atf_ci.FDb.ind_scriptfile hashfld:dev.Scriptfile.gitfile unique:Y comment:"" dmmeta.thash field:atf_ci.FDb.ind_ssimfile hashfld:dmmeta.Ssimfile.ssimfile unique:Y comment:"" dmmeta.thash field:atf_comp.FDb.ind_comptest hashfld:atfdb.Comptest.comptest unique:Y comment:"" +dmmeta.thash field:atf_comp.FDb.ind_tfilt hashfld:atfdb.Tfilt.comptest unique:Y comment:"" dmmeta.thash field:atf_cov.FDb.ind_covline hashfld:dev.Covline.covline unique:Y comment:"" dmmeta.thash field:atf_cov.FDb.ind_gitfile hashfld:dev.Gitfile.gitfile unique:Y comment:"" dmmeta.thash field:atf_cov.FDb.ind_target hashfld:dev.Target.target unique:Y comment:"" dmmeta.thash field:atf_cov.FDb.ind_targsrc hashfld:dev.Targsrc.targsrc unique:Y comment:"" dmmeta.thash field:atf_cov.FDb.ind_tgtcov hashfld:dev.Tgtcov.target unique:Y comment:"" +dmmeta.thash field:atf_exp.FDb.ind_proc hashfld:atf_exp.Proc.proc unique:Y comment:"" +dmmeta.thash field:atf_exp.FDb.ind_proc_pid hashfld:atf_exp.FProc.pid unique:Y comment:"" dmmeta.thash field:atf_fuzz.FDb.ind_target hashfld:dev.Target.target unique:Y comment:"" dmmeta.thash field:atf_gcli.FDb.ind_gclienv hashfld:gclidb.Gclienv.gclienv unique:Y comment:"" dmmeta.thash field:atf_gcli.FDb.ind_gclienvsub hashfld:gclidb.Gclienvsub.gclienvsub unique:Y comment:"" @@ -155,8 +163,6 @@ dmmeta.thash field:gcli.FDb.ind_gfld hashfld:gclidb.Gfld.gfld unique:Y comme dmmeta.thash field:gcli.FDb.ind_githost hashfld:gcli.FGithost.githost unique:Y comment:"" dmmeta.thash field:gcli.FDb.ind_gmethod hashfld:gclidb.Gmethod.gmethod unique:Y comment:"" dmmeta.thash field:gcli.FDb.ind_grepo hashfld:gclidb.Grepo.grepo unique:Y comment:"" -dmmeta.thash field:gcli.FDb.ind_grepogitport hashfld:gclidb.Grepogitport.grepogitport unique:Y comment:"" -dmmeta.thash field:gcli.FDb.ind_grepossh hashfld:gclidb.Grepossh.grepossh unique:Y comment:"" dmmeta.thash field:gcli.FDb.ind_gstatet hashfld:gclidb.Gstatet.gstatet unique:Y comment:"" dmmeta.thash field:gcli.FDb.ind_gtbl hashfld:gclidb.Gtbl.gtbl unique:Y comment:"" dmmeta.thash field:gcli.FDb.ind_gtblact hashfld:gclidb.Gtblact.gtblact unique:Y comment:"" @@ -169,10 +175,10 @@ dmmeta.thash field:gcli.FDb.ind_mr hashfld:gclidb.Mr.mr unique:Y comment:"" dmmeta.thash field:gcli.FDb.ind_mrjob hashfld:gclidb.Mrjob.mrjob unique:Y comment:"" dmmeta.thash field:gcli.FDb.ind_mrnote hashfld:gclidb.Mrnote.mrnote unique:Y comment:"" dmmeta.thash field:gcli.FDb.ind_user hashfld:gclidb.User.user unique:Y comment:"" -dmmeta.thash field:lib_ams.FDb.ind_member hashfld:lib_ams.FMember.member unique:Y comment:"" dmmeta.thash field:lib_ams.FDb.ind_proc hashfld:lib_ams.FProc.proc_id unique:Y comment:"" -dmmeta.thash field:lib_ams.FDb.ind_stream hashfld:lib_ams.FStream.stream_id unique:Y comment:"" -dmmeta.thash field:lib_ams.FDb.ind_streamtype hashfld:amsdb.StreamType.id unique:N comment:"" +dmmeta.thash field:lib_ams.FDb.ind_shm hashfld:lib_ams.FShm.shm_id unique:Y comment:"" +dmmeta.thash field:lib_ams.FDb.ind_shmember hashfld:lib_ams.FShmember.shmember unique:Y comment:"" +dmmeta.thash field:lib_ams.FDb.ind_shmtype hashfld:amsdb.Shmtype.id unique:N comment:"" dmmeta.thash field:lib_ctype.FDb.ind_cfmt hashfld:dmmeta.Cfmt.cfmt unique:Y comment:"" dmmeta.thash field:lib_ctype.FDb.ind_ctype hashfld:dmmeta.Ctype.ctype unique:Y comment:"" dmmeta.thash field:lib_ctype.FDb.ind_fconst hashfld:dmmeta.Fconst.fconst unique:Y comment:"" @@ -184,6 +190,7 @@ dmmeta.thash field:lib_fm.FDb.ind_alarm hashfld:fmdb.Alarm.alarm unique:Y co dmmeta.thash field:lib_fm.FDb.ind_alm_code hashfld:fmdb.AlmCode.alm_code unique:Y comment:"" dmmeta.thash field:lib_fm.FDb.ind_alm_objtype hashfld:fmdb.AlmObjtype.alm_objtype unique:Y comment:"" dmmeta.thash field:lib_json.FDb.ind_objfld hashfld:lib_json.FNode.fldkey unique:Y comment:"" +dmmeta.thash field:lib_netio.FDb.ind_var hashfld:lib_netio.FVar.var unique:Y comment:"" dmmeta.thash field:lib_sql.FDb.ind_attr hashfld:lib_sql.FAttr.attr unique:Y comment:"" dmmeta.thash field:lib_sqlite.FCtype.ind_field_name hashfld:dmmeta.Field.name unique:Y comment:"" dmmeta.thash field:lib_sqlite.FCtype.ind_pkey hashfld:lib_sqlite.FRow.pkey unique:Y comment:"" @@ -195,14 +202,21 @@ dmmeta.thash field:lib_sqlite.FDb.ind_ssimfile hashfld:dmmeta.Ssimfile.ssimfil dmmeta.thash field:mdbg.FDb.ind_cfg hashfld:dev.Cfg.cfg unique:Y comment:"" dmmeta.thash field:orgfile.FDb.ind_filehash hashfld:orgfile.FFilehash.filehash unique:Y comment:"" dmmeta.thash field:orgfile.FDb.ind_filename hashfld:orgfile.FFilename.filename unique:Y comment:"" +dmmeta.thash field:samp_make.FDb.ind_gitfile hashfld:sampdb.Gitfile.gitfile unique:Y comment:"" +dmmeta.thash field:samp_make.FDb.ind_targdep hashfld:sampdb.Targdep.targdep unique:Y comment:"" +dmmeta.thash field:samp_make.FDb.ind_target hashfld:sampdb.Target.target unique:Y comment:"" +dmmeta.thash field:samp_make.FDb.ind_targrec hashfld:sampdb.Targrec.target unique:Y comment:"" +dmmeta.thash field:samp_make.FDb.ind_targsrc hashfld:sampdb.Targsrc.targsrc unique:Y comment:"" dmmeta.thash field:samp_meng.FDb.ind_order hashfld:samp_meng.FOrder.order unique:Y comment:"" dmmeta.thash field:samp_meng.FDb.ind_symbol hashfld:samp_meng.FSymbol.symbol unique:Y comment:"" dmmeta.thash field:samp_meng.FDb.ind_user hashfld:samp_meng.FUser.user unique:Y comment:"" dmmeta.thash field:sandbox.FDb.ind_sandbox hashfld:dev.Sandbox.sandbox unique:Y comment:"" dmmeta.thash field:src_func.FDb.ind_ctypelen hashfld:dmmeta.Ctypelen.ctype unique:Y comment:"" dmmeta.thash field:src_func.FDb.ind_func hashfld:src_func.FFunc.func unique:Y comment:"" -dmmeta.thash field:src_func.FDb.ind_genprefix hashfld:src_func.FGenprefix.genprefix unique:Y comment:"" +dmmeta.thash field:src_func.FDb.ind_genaffix hashfld:src_func.FGenaffix.genaffix unique:Y comment:"" dmmeta.thash field:src_func.FDb.ind_target hashfld:dev.Target.target unique:Y comment:"" +dmmeta.thash field:src_func.FDb.ind_userfunc hashfld:dmmeta.Userfunc.userfunc unique:Y comment:"" +dmmeta.thash field:src_func.FDb.ind_userfunc_cppname hashfld:dmmeta.Userfunc.cppname unique:N comment:"" dmmeta.thash field:src_hdr.FDb.ind_copyright hashfld:dev.Copyright.copyright unique:Y comment:"" dmmeta.thash field:src_hdr.FDb.ind_fcopyline hashfld:src_hdr.FCopyline.fcopyline unique:Y comment:"" dmmeta.thash field:src_hdr.FDb.ind_license hashfld:dev.License.license unique:Y comment:"" diff --git a/data/dmmeta/tracefld.ssim b/data/dmmeta/tracefld.ssim index c4925738..8a62a862 100644 --- a/data/dmmeta/tracefld.ssim +++ b/data/dmmeta/tracefld.ssim @@ -1,12 +1,66 @@ dmmeta.tracefld tracefld:algo_lib.trace.n_mmap comment:"# times memory allocated with mmap() (huge or not)" dmmeta.tracefld tracefld:algo_lib.trace.n_sbrk comment:"# of calls to sbrk" +dmmeta.tracefld tracefld:lib_ams.trace.step_cd_slow_poll_read comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_cd_slow_poll_read_cycles comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.alloc__db_fdin comment:"FD input (normally stdin)" +dmmeta.tracefld tracefld:lib_ams.trace.del__db_fdin comment:"FD input (normally stdin)" +dmmeta.tracefld tracefld:lib_ams.trace.alloc__db_shm comment:"Shm record" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_Unkmsg_cycles comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.del__db_shm comment:"Shm record" +dmmeta.tracefld tracefld:lib_ams.trace.alloc__db_proc comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_cd_fdin_eof comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.del__db_proc comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.alloc__db_shmember comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.del__db_shmember comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.alloc__db_shmtype comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.del__db_shmtype comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_cd_fdin_eof_cycles comment:"" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_Unkmsg_cycles comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_cd_fdin_read comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_cd_fdin_read_cycles comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_cd_hb comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_cd_hb_cycles comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_zd_flush comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_zd_flush_cycles comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_cd_poll_read comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_cd_poll_read_cycles comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_bh_shmember_read comment:"" +dmmeta.tracefld tracefld:lib_ams.trace.step_bh_shmember_read_cycles comment:"" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_TerminateMsg comment:"Total number of TerminateMsg processed by atf_exp" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_TerminateMsg_cycles comment:"" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_ProcEofMsg comment:"Total number of ProcEofMsg processed by atf_exp" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_ProcEofMsg_cycles comment:"" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_ProcKillMsg comment:"Total number of ProcKillMsg processed by atf_exp" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_ProcKillMsg_cycles comment:"" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_ProcMsg comment:"Total number of ProcMsg processed by atf_exp" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_ProcMsg_cycles comment:"" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_ProcReadMsg comment:"Total number of ProcReadMsg processed by atf_exp" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_ProcReadMsg_cycles comment:"" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_ProcStartMsg comment:"Total number of ProcStartMsg processed by atf_exp" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_ProcStartMsg_cycles comment:"" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_RemDirRecurseMsg comment:"Total number of RemDirRecurseMsg processed by atf_exp" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_RemDirRecurseMsg_cycles comment:"" dmmeta.tracefld tracefld:algo_lib.trace.tot_insert_err comment:"" +dmmeta.tracefld tracefld:atf_exp.trace.dispatch_In_Unkmsg comment:"" dmmeta.tracefld tracefld:algo_lib.trace.tot_selfcheck_err comment:"" dmmeta.tracefld tracefld:algo_lib.trace.tot_update_err comment:"" dmmeta.tracefld tracefld:lib_ams.trace.n_fdin_drop_notgt comment:"# of fdin messages dropped because no target stream found" dmmeta.tracefld tracefld:lib_ams.trace.n_fdin_posted comment:"# of fdin messages posted to target stream" dmmeta.tracefld tracefld:lib_ams.trace.n_fdin_pushback comment:"# of fdin messages paused because target stream blocked" dmmeta.tracefld tracefld:lib_ams.trace.n_write_block_spin comment:"# Spin cycles spent waiting for write budget" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_CancelReqMsg comment:"Total number of CancelReqMsg processed by samp_meng" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_CancelReqMsg_cycles comment:"" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_MassCancelReqMsg comment:"Total number of MassCancelReqMsg processed by samp_meng" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_MassCancelReqMsg_cycles comment:"" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_NewOrderReqMsg comment:"Total number of NewOrderReqMsg processed by samp_meng" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_NewOrderReqMsg_cycles comment:"" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_NewSymbolReqMsg comment:"Total number of NewSymbolReqMsg processed by samp_meng" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_NewSymbolReqMsg_cycles comment:"" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_NewUserReqMsg comment:"Total number of NewUserReqMsg processed by samp_meng" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_NewUserReqMsg_cycles comment:"" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_TextMsg comment:"Total number of TextMsg processed by samp_meng" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_TextMsg_cycles comment:"" +dmmeta.tracefld tracefld:samp_meng.trace.dispatch_In_Unkmsg comment:"" dmmeta.tracefld tracefld:algo_lib.trace.step_bh_timehook comment:"" dmmeta.tracefld tracefld:algo_lib.trace.step_bh_timehook_cycles comment:"" dmmeta.tracefld tracefld:algo_lib.trace.step_giveup_time comment:"" diff --git a/data/dmmeta/tracerec.ssim b/data/dmmeta/tracerec.ssim index 955a9bff..abcf46e5 100644 --- a/data/dmmeta/tracerec.ssim +++ b/data/dmmeta/tracerec.ssim @@ -10,7 +10,6 @@ dmmeta.tracerec tracerec:algo_lib.trace comment:"" dmmeta.tracerec tracerec:amc.trace comment:"" dmmeta.tracerec tracerec:amc_gc.trace comment:"" dmmeta.tracerec tracerec:amc_vis.trace comment:"" -dmmeta.tracerec tracerec:ams_cat.trace comment:"" dmmeta.tracerec tracerec:ams_sendtest.trace comment:"" dmmeta.tracerec tracerec:apm.trace comment:"" dmmeta.tracerec tracerec:aqlite.trace comment:"" @@ -19,6 +18,7 @@ dmmeta.tracerec tracerec:atf_ci.trace comment:"" dmmeta.tracerec tracerec:atf_cmdline.trace comment:"" dmmeta.tracerec tracerec:atf_comp.trace comment:"" dmmeta.tracerec tracerec:atf_cov.trace comment:"" +dmmeta.tracerec tracerec:atf_exp.trace comment:"" dmmeta.tracerec tracerec:atf_fuzz.trace comment:"" dmmeta.tracerec tracerec:atf_gcli.trace comment:"" dmmeta.tracerec tracerec:atf_nrun.trace comment:"" @@ -26,19 +26,26 @@ dmmeta.tracerec tracerec:atf_unit.trace comment:"" dmmeta.tracerec tracerec:bash2html.trace comment:"" dmmeta.tracerec tracerec:gcache.trace comment:"" dmmeta.tracerec tracerec:gcli.trace comment:"" +dmmeta.tracerec tracerec:jkv.trace comment:"" dmmeta.tracerec tracerec:lib_ams.trace comment:"" dmmeta.tracerec tracerec:lib_ctype.trace comment:"" +dmmeta.tracerec tracerec:lib_curl.trace comment:"" dmmeta.tracerec tracerec:lib_exec.trace comment:"" dmmeta.tracerec tracerec:lib_fm.trace comment:"" dmmeta.tracerec tracerec:lib_git.trace comment:"" +dmmeta.tracerec tracerec:lib_http.trace comment:"" dmmeta.tracerec tracerec:lib_iconv.trace comment:"" dmmeta.tracerec tracerec:lib_json.trace comment:"" dmmeta.tracerec tracerec:lib_mysql.trace comment:"" +dmmeta.tracerec tracerec:lib_netio.trace comment:"" +dmmeta.tracerec tracerec:lib_rl.trace comment:"" dmmeta.tracerec tracerec:lib_sql.trace comment:"" dmmeta.tracerec tracerec:lib_sqlite.trace comment:"" +dmmeta.tracerec tracerec:lib_ws.trace comment:"" dmmeta.tracerec tracerec:mdbg.trace comment:"" dmmeta.tracerec tracerec:mysql2ssim.trace comment:"" dmmeta.tracerec tracerec:orgfile.trace comment:"" +dmmeta.tracerec tracerec:samp_make.trace comment:"" dmmeta.tracerec tracerec:samp_meng.trace comment:"" dmmeta.tracerec tracerec:samp_regx.trace comment:"" dmmeta.tracerec tracerec:sandbox.trace comment:"" diff --git a/data/dmmeta/typefld.ssim b/data/dmmeta/typefld.ssim index 1c8e4c74..22cc849e 100644 --- a/data/dmmeta/typefld.ssim +++ b/data/dmmeta/typefld.ssim @@ -1,4 +1,7 @@ dmmeta.typefld field:ams.MsgHeader.type comment:"" dmmeta.typefld field:atf_amc.MsgHdrLT.type comment:"" dmmeta.typefld field:atf_amc.MsgHeader.type comment:"" +dmmeta.typefld field:kafka.GroupRecordKeyHeader.type comment:"" +dmmeta.typefld field:kafka.GroupRecordValueHeader.type comment:"" dmmeta.typefld field:samp_meng.MsgHeader.type comment:"" +dmmeta.typefld field:ws.FrameHeader.byte1 comment:"" diff --git a/data/dmmeta/userfunc.ssim b/data/dmmeta/userfunc.ssim new file mode 100644 index 00000000..ac7d7cf6 --- /dev/null +++ b/data/dmmeta/userfunc.ssim @@ -0,0 +1,1431 @@ +dmmeta.userfunc userfunc:abt.FDb._db.Main acrkey:main:abt cppname:abt.Main comment:"" +dmmeta.userfunc userfunc:abt.FSyscmd.execkey.Get acrkey:"" cppname:abt.execkey_Get comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Attributes acrkey:gstatic/dev.mdsection:Attributes cppname:abt_md.mdsection_Attributes comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Chapters acrkey:gstatic/dev.mdsection:Chapters cppname:abt_md.mdsection_Chapters comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_CmdlineUses acrkey:gstatic/dev.mdsection:CmdlineUses cppname:abt_md.mdsection_CmdlineUses comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Constants acrkey:gstatic/dev.mdsection:Constants cppname:abt_md.mdsection_Constants comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Content acrkey:gstatic/dev.mdsection:Content cppname:abt_md.mdsection_Content comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Copyright acrkey:gstatic/dev.mdsection:Copyright cppname:abt_md.mdsection_Copyright comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Ctypes acrkey:gstatic/dev.mdsection:Ctypes cppname:abt_md.mdsection_Ctypes comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Dependencies acrkey:gstatic/dev.mdsection:Dependencies cppname:abt_md.mdsection_Dependencies comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Description acrkey:gstatic/dev.mdsection:Description cppname:abt_md.mdsection_Description comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Example acrkey:gstatic/dev.mdsection:Example cppname:abt_md.mdsection_Example comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Functions acrkey:gstatic/dev.mdsection:Functions cppname:abt_md.mdsection_Functions comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Imdb acrkey:gstatic/dev.mdsection:Imdb cppname:abt_md.mdsection_Imdb comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_ImdbUses acrkey:gstatic/dev.mdsection:ImdbUses cppname:abt_md.mdsection_ImdbUses comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_InputMessages acrkey:gstatic/dev.mdsection:InputMessages cppname:abt_md.mdsection_InputMessages comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Inputs acrkey:gstatic/dev.mdsection:Inputs cppname:abt_md.mdsection_Inputs comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Limitations acrkey:gstatic/dev.mdsection:Limitations cppname:abt_md.mdsection_Limitations comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Options acrkey:gstatic/dev.mdsection:Options cppname:abt_md.mdsection_Options comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Reftypes acrkey:gstatic/dev.mdsection:Reftypes cppname:abt_md.mdsection_Reftypes comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Related acrkey:gstatic/dev.mdsection:Related cppname:abt_md.mdsection_Related comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Sources acrkey:gstatic/dev.mdsection:Sources cppname:abt_md.mdsection_Sources comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Subsets acrkey:gstatic/dev.mdsection:Subsets cppname:abt_md.mdsection_Subsets comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Syntax acrkey:gstatic/dev.mdsection:Syntax cppname:abt_md.mdsection_Syntax comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Tables acrkey:gstatic/dev.mdsection:Tables cppname:abt_md.mdsection_Tables comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Tests acrkey:gstatic/dev.mdsection:Tests cppname:abt_md.mdsection_Tests comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Title acrkey:gstatic/dev.mdsection:Title cppname:abt_md.mdsection_Title comment:"" +dmmeta.userfunc userfunc:abt_md...mdsection_Toc acrkey:gstatic/dev.mdsection:Toc cppname:abt_md.mdsection_Toc comment:"" +dmmeta.userfunc userfunc:abt_md.FDb._db.Main acrkey:main:abt_md cppname:abt_md.Main comment:"" +dmmeta.userfunc userfunc:acr.FDb._db.Main acrkey:main:acr cppname:acr.Main comment:"" +dmmeta.userfunc userfunc:acr_compl.FDb._db.Main acrkey:main:acr_compl cppname:acr_compl.Main comment:"" +dmmeta.userfunc userfunc:acr_dm.FDb._db.Main acrkey:main:acr_dm cppname:acr_dm.Main comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Create_Citest acrkey:gstatic/dev.edaction:Create_Citest cppname:acr_ed.edaction_Create_Citest comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Create_Ctype acrkey:gstatic/dev.edaction:Create_Ctype cppname:acr_ed.edaction_Create_Ctype comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Create_Field acrkey:gstatic/dev.edaction:Create_Field cppname:acr_ed.edaction_Create_Field comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Create_Finput acrkey:gstatic/dev.edaction:Create_Finput cppname:acr_ed.edaction_Create_Finput comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Create_Srcfile acrkey:gstatic/dev.edaction:Create_Srcfile cppname:acr_ed.edaction_Create_Srcfile comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Create_Ssimfile acrkey:gstatic/dev.edaction:Create_Ssimfile cppname:acr_ed.edaction_Create_Ssimfile comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Create_Target acrkey:gstatic/dev.edaction:Create_Target cppname:acr_ed.edaction_Create_Target comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Create_Unittest acrkey:gstatic/dev.edaction:Create_Unittest cppname:acr_ed.edaction_Create_Unittest comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Delete_Ctype acrkey:gstatic/dev.edaction:Delete_Ctype cppname:acr_ed.edaction_Delete_Ctype comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Delete_Field acrkey:gstatic/dev.edaction:Delete_Field cppname:acr_ed.edaction_Delete_Field comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Delete_Srcfile acrkey:gstatic/dev.edaction:Delete_Srcfile cppname:acr_ed.edaction_Delete_Srcfile comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Delete_Ssimfile acrkey:gstatic/dev.edaction:Delete_Ssimfile cppname:acr_ed.edaction_Delete_Ssimfile comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Delete_Target acrkey:gstatic/dev.edaction:Delete_Target cppname:acr_ed.edaction_Delete_Target comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Rename_Ctype acrkey:gstatic/dev.edaction:Rename_Ctype cppname:acr_ed.edaction_Rename_Ctype comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Rename_Field acrkey:gstatic/dev.edaction:Rename_Field cppname:acr_ed.edaction_Rename_Field comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Rename_Srcfile acrkey:gstatic/dev.edaction:Rename_Srcfile cppname:acr_ed.edaction_Rename_Srcfile comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Rename_Ssimfile acrkey:gstatic/dev.edaction:Rename_Ssimfile cppname:acr_ed.edaction_Rename_Ssimfile comment:"" +dmmeta.userfunc userfunc:acr_ed...edaction_Rename_Target acrkey:gstatic/dev.edaction:Rename_Target cppname:acr_ed.edaction_Rename_Target comment:"" +dmmeta.userfunc userfunc:acr_ed.FDb._db.Main acrkey:main:acr_ed cppname:acr_ed.Main comment:"" +dmmeta.userfunc userfunc:acr_in.FDb._db.Main acrkey:main:acr_in cppname:acr_in.Main comment:"" +dmmeta.userfunc userfunc:acr_my.FDb._db.Main acrkey:main:acr_my cppname:acr_my.Main comment:"" +dmmeta.userfunc userfunc:algo.Attr..Print acrkey:cfmt:algo.Attr.String cppname:algo.Attr_Print comment:"" +dmmeta.userfunc userfunc:algo.Attr..ReadStrptrMaybe acrkey:cfmt:algo.Attr.String cppname:algo.Attr_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.Bool..Print acrkey:cfmt:algo.Bool.String cppname:algo.Bool_Print comment:"" +dmmeta.userfunc userfunc:algo.ByteAry..Print acrkey:cfmt:algo.ByteAry.String cppname:algo.ByteAry_Print comment:"" +dmmeta.userfunc userfunc:algo.ByteAry..ReadStrptrMaybe acrkey:cfmt:algo.ByteAry.String cppname:algo.ByteAry_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.Charset..ReadStrptrMaybe acrkey:cfmt:algo.Charset.String cppname:algo.Charset_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.Decimal..Print acrkey:cfmt:algo.Decimal.String cppname:algo.Decimal_Print comment:"" +dmmeta.userfunc userfunc:algo.Decimal..ReadStrptrMaybe acrkey:cfmt:algo.Decimal.String cppname:algo.Decimal_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.DirEntry.dir_handle.Cleanup acrkey:fcleanup:algo.DirEntry.dir_handle cppname:algo.dir_handle_Cleanup comment:"" +dmmeta.userfunc userfunc:algo.Errcode..Print acrkey:cfmt:algo.Errcode.String cppname:algo.Errcode_Print comment:"" +dmmeta.userfunc userfunc:algo.I32RangeAry..Print acrkey:cfmt:algo.I32RangeAry.String cppname:algo.I32RangeAry_Print comment:"" +dmmeta.userfunc userfunc:algo.I32RangeAry..ReadStrptrMaybe acrkey:cfmt:algo.I32RangeAry.String cppname:algo.I32RangeAry_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.Ipmask..Print acrkey:cfmt:algo.Ipmask.String cppname:algo.Ipmask_Print comment:"" +dmmeta.userfunc userfunc:algo.Ipmask..ReadStrptrMaybe acrkey:cfmt:algo.Ipmask.String cppname:algo.Ipmask_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.Sha1sig..Print acrkey:cfmt:algo.Sha1sig.String cppname:algo.Sha1sig_Print comment:"" +dmmeta.userfunc userfunc:algo.Sha1sig..ReadStrptrMaybe acrkey:cfmt:algo.Sha1sig.String cppname:algo.Sha1sig_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.Smallstr50..FmtJson acrkey:cfmt:algo.Smallstr50.Json cppname:algo.Smallstr50_FmtJson comment:"" +dmmeta.userfunc userfunc:algo.Tuple..Print acrkey:cfmt:algo.Tuple.String cppname:algo.Tuple_Print comment:"" +dmmeta.userfunc userfunc:algo.Tuple..ReadStrptrMaybe acrkey:cfmt:algo.Tuple.String cppname:algo.Tuple_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.URL..Print acrkey:cfmt:algo.URL.String cppname:algo.URL_Print comment:"" +dmmeta.userfunc userfunc:algo.URL..ReadStrptrMaybe acrkey:cfmt:algo.URL.String cppname:algo.URL_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.UnDiff..Print acrkey:cfmt:algo.UnDiff.String cppname:algo.UnDiff_Print comment:"" +dmmeta.userfunc userfunc:algo.UnDiff..ReadStrptrMaybe acrkey:cfmt:algo.UnDiff.String cppname:algo.UnDiff_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.UnTime..Print acrkey:cfmt:algo.UnTime.String cppname:algo.UnTime_Print comment:"" +dmmeta.userfunc userfunc:algo.UnTime..ReadStrptrMaybe acrkey:cfmt:algo.UnTime.String cppname:algo.UnTime_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.UnixDiff..Print acrkey:cfmt:algo.UnixDiff.String cppname:algo.UnixDiff_Print comment:"" +dmmeta.userfunc userfunc:algo.UnixDiff..ReadStrptrMaybe acrkey:cfmt:algo.UnixDiff.String cppname:algo.UnixDiff_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.UnixTime..Print acrkey:cfmt:algo.UnixTime.String cppname:algo.UnixTime_Print comment:"" +dmmeta.userfunc userfunc:algo.UnixTime..ReadStrptrMaybe acrkey:cfmt:algo.UnixTime.String cppname:algo.UnixTime_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.Uuid..Print acrkey:cfmt:algo.Uuid.String cppname:algo.Uuid_Print comment:"" +dmmeta.userfunc userfunc:algo.Uuid..ReadStrptrMaybe acrkey:cfmt:algo.Uuid.String cppname:algo.Uuid_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.WDiff..Print acrkey:cfmt:algo.WDiff.String cppname:algo.WDiff_Print comment:"" +dmmeta.userfunc userfunc:algo.WDiff..ReadStrptrMaybe acrkey:cfmt:algo.WDiff.String cppname:algo.WDiff_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.WTime..Print acrkey:cfmt:algo.WTime.String cppname:algo.WTime_Print comment:"" +dmmeta.userfunc userfunc:algo.WTime..ReadStrptrMaybe acrkey:cfmt:algo.WTime.String cppname:algo.WTime_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.cstring..FmtJson acrkey:cfmt:algo.cstring.Json cppname:algo.cstring_FmtJson comment:"" +dmmeta.userfunc userfunc:algo.cstring..Print acrkey:cfmt:algo.cstring.String cppname:algo.cstring_Print comment:"" +dmmeta.userfunc userfunc:algo.cstring..ReadStrptrMaybe acrkey:cfmt:algo.cstring.String cppname:algo.cstring_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.i32_Range..Print acrkey:cfmt:algo.i32_Range.String cppname:algo.i32_Range_Print comment:"" +dmmeta.userfunc userfunc:algo.memptr..Print acrkey:cfmt:algo.memptr.String cppname:algo.memptr_Print comment:"" +dmmeta.userfunc userfunc:algo.memptr..ReadStrptrMaybe acrkey:cfmt:algo.memptr.String cppname:algo.memptr_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo.strptr..Cmp acrkey:"" cppname:algo.strptr_Cmp comment:"" +dmmeta.userfunc userfunc:algo.strptr..Eq acrkey:"" cppname:algo.strptr_Eq comment:"" +dmmeta.userfunc userfunc:algo.strptr..FmtJson acrkey:cfmt:algo.strptr.Json cppname:algo.strptr_FmtJson comment:"" +dmmeta.userfunc userfunc:algo.strptr..Hash acrkey:"" cppname:algo.strptr_Hash comment:"" +dmmeta.userfunc userfunc:algo.strptr..Lt acrkey:"" cppname:algo.strptr_Lt comment:"" +dmmeta.userfunc userfunc:algo_lib.ErrorX..Print acrkey:cfmt:algo_lib.ErrorX.String cppname:algo_lib.ErrorX_Print comment:"" +dmmeta.userfunc userfunc:algo_lib.FDb._db.Userinit acrkey:fuserinit:algo_lib.FDb._db cppname:algo_lib.Userinit comment:"" +dmmeta.userfunc userfunc:algo_lib.FDb.bh_timehook.Step acrkey:fstep:algo_lib.FDb.bh_timehook cppname:algo_lib.bh_timehook_Step comment:"" +dmmeta.userfunc userfunc:algo_lib.FDb.dispsigcheck.InputMaybe acrkey:finput:algo_lib.FDb.dispsigcheck cppname:algo_lib.dispsigcheck_InputMaybe comment:"" +dmmeta.userfunc userfunc:algo_lib.FDb.errns.Userinit acrkey:fuserinit:algo_lib.FDb.errns cppname:algo_lib.errns_Userinit comment:"" +dmmeta.userfunc userfunc:algo_lib.FDb.giveup_time.Step acrkey:fstep:algo_lib.FDb.giveup_time cppname:algo_lib.giveup_time_Step comment:"" +dmmeta.userfunc userfunc:algo_lib.FFildes.fd.Cleanup acrkey:fcleanup:algo_lib.FFildes.fd cppname:algo_lib.fd_Cleanup comment:"" +dmmeta.userfunc userfunc:algo_lib.FIohook.fildes.Cleanup acrkey:fcleanup:algo_lib.FIohook.fildes cppname:algo_lib.fildes_Cleanup comment:"" +dmmeta.userfunc userfunc:algo_lib.FLockfile.fildes.Cleanup acrkey:fcleanup:algo_lib.FLockfile.fildes cppname:algo_lib.fildes_Cleanup comment:"" +dmmeta.userfunc userfunc:algo_lib.FTempfile.fildes.Cleanup acrkey:fcleanup:algo_lib.FTempfile.fildes cppname:algo_lib.fildes_Cleanup comment:"" +dmmeta.userfunc userfunc:algo_lib.FTxttbl..Print acrkey:cfmt:algo_lib.FTxttbl.String cppname:algo_lib.FTxttbl_Print comment:"" +dmmeta.userfunc userfunc:algo_lib.InTextFile.file.Cleanup acrkey:fcleanup:algo_lib.InTextFile.file cppname:algo_lib.file_Cleanup comment:"" +dmmeta.userfunc userfunc:algo_lib.Mmap.mem.Cleanup acrkey:fcleanup:algo_lib.Mmap.mem cppname:algo_lib.mem_Cleanup comment:"" +dmmeta.userfunc userfunc:algo_lib.Regx..Print acrkey:cfmt:algo_lib.Regx.String cppname:algo_lib.Regx_Print comment:"" +dmmeta.userfunc userfunc:algo_lib.Regx..ReadStrptrMaybe acrkey:cfmt:algo_lib.Regx.String cppname:algo_lib.Regx_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:algo_lib.RegxState..Print acrkey:cfmt:algo_lib.RegxState.String cppname:algo_lib.RegxState_Print comment:"" +dmmeta.userfunc userfunc:amc...gen_basepool acrkey:gstatic/amcdb.gen:basepool cppname:amc.gen_basepool comment:"" +dmmeta.userfunc userfunc:amc...gen_bitfldenum acrkey:gstatic/amcdb.gen:bitfldenum cppname:amc.gen_bitfldenum comment:"" +dmmeta.userfunc userfunc:amc...gen_cget acrkey:gstatic/amcdb.gen:cget cppname:amc.gen_cget comment:"" +dmmeta.userfunc userfunc:amc...gen_check_basefield acrkey:gstatic/amcdb.gen:check_basefield cppname:amc.gen_check_basefield comment:"" +dmmeta.userfunc userfunc:amc...gen_check_basepool acrkey:gstatic/amcdb.gen:check_basepool cppname:amc.gen_check_basepool comment:"" +dmmeta.userfunc userfunc:amc...gen_check_bigend acrkey:gstatic/amcdb.gen:check_bigend cppname:amc.gen_check_bigend comment:"" +dmmeta.userfunc userfunc:amc...gen_check_bitfld acrkey:gstatic/amcdb.gen:check_bitfld cppname:amc.gen_check_bitfld comment:"" +dmmeta.userfunc userfunc:amc...gen_check_cascdel acrkey:gstatic/amcdb.gen:check_cascdel cppname:amc.gen_check_cascdel comment:"" +dmmeta.userfunc userfunc:amc...gen_check_cheapcopy acrkey:gstatic/amcdb.gen:check_cheapcopy cppname:amc.gen_check_cheapcopy comment:"" +dmmeta.userfunc userfunc:amc...gen_check_cpptype acrkey:gstatic/amcdb.gen:check_cpptype cppname:amc.gen_check_cpptype comment:"" +dmmeta.userfunc userfunc:amc...gen_check_fcurs acrkey:gstatic/amcdb.gen:check_fcurs cppname:amc.gen_check_fcurs comment:"" +dmmeta.userfunc userfunc:amc...gen_check_prefix acrkey:gstatic/amcdb.gen:check_prefix cppname:amc.gen_check_prefix comment:"" +dmmeta.userfunc userfunc:amc...gen_check_reftype acrkey:gstatic/amcdb.gen:check_reftype cppname:amc.gen_check_reftype comment:"" +dmmeta.userfunc userfunc:amc...gen_check_ssimsort acrkey:gstatic/amcdb.gen:check_ssimsort cppname:amc.gen_check_ssimsort comment:"" +dmmeta.userfunc userfunc:amc...gen_check_static acrkey:gstatic/amcdb.gen:check_static cppname:amc.gen_check_static comment:"" +dmmeta.userfunc userfunc:amc...gen_check_varlen acrkey:gstatic/amcdb.gen:check_varlen cppname:amc.gen_check_varlen comment:"" +dmmeta.userfunc userfunc:amc...gen_check_xref acrkey:gstatic/amcdb.gen:check_xref cppname:amc.gen_check_xref comment:"" +dmmeta.userfunc userfunc:amc...gen_clonefconst acrkey:gstatic/amcdb.gen:clonefconst cppname:amc.gen_clonefconst comment:"" +dmmeta.userfunc userfunc:amc...gen_compute_size acrkey:gstatic/amcdb.gen:compute_size cppname:amc.gen_compute_size comment:"" +dmmeta.userfunc userfunc:amc...gen_countxref acrkey:gstatic/amcdb.gen:countxref cppname:amc.gen_countxref comment:"" +dmmeta.userfunc userfunc:amc...gen_create_userfunc acrkey:gstatic/amcdb.gen:create_userfunc cppname:amc.gen_create_userfunc comment:"" +dmmeta.userfunc userfunc:amc...gen_ctype_toposort acrkey:gstatic/amcdb.gen:ctype_toposort cppname:amc.gen_ctype_toposort comment:"" +dmmeta.userfunc userfunc:amc...gen_datafld acrkey:gstatic/amcdb.gen:datafld cppname:amc.gen_datafld comment:"" +dmmeta.userfunc userfunc:amc...gen_detectinst acrkey:gstatic/amcdb.gen:detectinst cppname:amc.gen_detectinst comment:"" +dmmeta.userfunc userfunc:amc...gen_dispenum acrkey:gstatic/amcdb.gen:dispenum cppname:amc.gen_dispenum comment:"" +dmmeta.userfunc userfunc:amc...gen_fast_presence acrkey:gstatic/amcdb.gen:fast_presence cppname:amc.gen_fast_presence comment:"" +dmmeta.userfunc userfunc:amc...gen_fcmap acrkey:gstatic/amcdb.gen:fcmap cppname:amc.gen_fcmap comment:"" +dmmeta.userfunc userfunc:amc...gen_fieldid acrkey:gstatic/amcdb.gen:fieldid cppname:amc.gen_fieldid comment:"" +dmmeta.userfunc userfunc:amc...gen_gconst acrkey:gstatic/amcdb.gen:gconst cppname:amc.gen_gconst comment:"" +dmmeta.userfunc userfunc:amc...gen_include acrkey:gstatic/amcdb.gen:include cppname:amc.gen_include comment:"" +dmmeta.userfunc userfunc:amc...gen_load_gstatic acrkey:gstatic/amcdb.gen:load_gstatic cppname:amc.gen_load_gstatic comment:"" +dmmeta.userfunc userfunc:amc...gen_lookuppkey acrkey:gstatic/amcdb.gen:lookuppkey cppname:amc.gen_lookuppkey comment:"" +dmmeta.userfunc userfunc:amc...gen_msgcurs acrkey:gstatic/amcdb.gen:msgcurs cppname:amc.gen_msgcurs comment:"" +dmmeta.userfunc userfunc:amc...gen_newfield_cbase acrkey:gstatic/amcdb.gen:newfield_cbase cppname:amc.gen_newfield_cbase comment:"" +dmmeta.userfunc userfunc:amc...gen_newfield_cfmt acrkey:gstatic/amcdb.gen:newfield_cfmt cppname:amc.gen_newfield_cfmt comment:"" +dmmeta.userfunc userfunc:amc...gen_newfield_charset acrkey:gstatic/amcdb.gen:newfield_charset cppname:amc.gen_newfield_charset comment:"" +dmmeta.userfunc userfunc:amc...gen_newfield_count acrkey:gstatic/amcdb.gen:newfield_count cppname:amc.gen_newfield_count comment:"" +dmmeta.userfunc userfunc:amc...gen_newfield_dispatch acrkey:gstatic/amcdb.gen:newfield_dispatch cppname:amc.gen_newfield_dispatch comment:"" +dmmeta.userfunc userfunc:amc...gen_newfield_exec acrkey:gstatic/amcdb.gen:newfield_exec cppname:amc.gen_newfield_exec comment:"" +dmmeta.userfunc userfunc:amc...gen_newfield_hook acrkey:gstatic/amcdb.gen:newfield_hook cppname:amc.gen_newfield_hook comment:"" +dmmeta.userfunc userfunc:amc...gen_newfield_ptrary acrkey:gstatic/amcdb.gen:newfield_ptrary cppname:amc.gen_newfield_ptrary comment:"" +dmmeta.userfunc userfunc:amc...gen_newfield_sortfld acrkey:gstatic/amcdb.gen:newfield_sortfld cppname:amc.gen_newfield_sortfld comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_check_lim acrkey:gstatic/amcdb.gen:ns_check_lim cppname:amc.gen_ns_check_lim comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_check_main acrkey:gstatic/amcdb.gen:ns_check_main cppname:amc.gen_ns_check_main comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_check_nstype acrkey:gstatic/amcdb.gen:ns_check_nstype cppname:amc.gen_ns_check_nstype comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_check_pack acrkey:gstatic/amcdb.gen:ns_check_pack cppname:amc.gen_ns_check_pack comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_check_path acrkey:gstatic/amcdb.gen:ns_check_path cppname:amc.gen_ns_check_path comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_curstext acrkey:gstatic/amcdb.gen:ns_curstext cppname:amc.gen_ns_curstext comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_dispatch acrkey:gstatic/amcdb.gen:ns_dispatch cppname:amc.gen_ns_dispatch comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_enums acrkey:gstatic/amcdb.gen:ns_enums cppname:amc.gen_ns_enums comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_fast acrkey:gstatic/amcdb.gen:ns_fast cppname:amc.gen_ns_fast comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_func acrkey:gstatic/amcdb.gen:ns_func cppname:amc.gen_ns_func comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_funcindex acrkey:gstatic/amcdb.gen:ns_funcindex cppname:amc.gen_ns_funcindex comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_fwddecl acrkey:gstatic/amcdb.gen:ns_fwddecl cppname:amc.gen_ns_fwddecl comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_fwddecl2 acrkey:gstatic/amcdb.gen:ns_fwddecl2 cppname:amc.gen_ns_fwddecl2 comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_gstatic acrkey:gstatic/amcdb.gen:ns_gstatic cppname:amc.gen_ns_gstatic comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_gsymbol acrkey:gstatic/amcdb.gen:ns_gsymbol cppname:amc.gen_ns_gsymbol comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_include acrkey:gstatic/amcdb.gen:ns_include cppname:amc.gen_ns_include comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_operators acrkey:gstatic/amcdb.gen:ns_operators cppname:amc.gen_ns_operators comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_pkeytypedef acrkey:gstatic/amcdb.gen:ns_pkeytypedef cppname:amc.gen_ns_pkeytypedef comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_pnew acrkey:gstatic/amcdb.gen:ns_pnew cppname:amc.gen_ns_pnew comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_print_proto acrkey:gstatic/amcdb.gen:ns_print_proto cppname:amc.gen_ns_print_proto comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_print_struct acrkey:gstatic/amcdb.gen:ns_print_struct cppname:amc.gen_ns_print_struct comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_size_enums acrkey:gstatic/amcdb.gen:ns_size_enums cppname:amc.gen_ns_size_enums comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_tclass_ctype acrkey:gstatic/amcdb.gen:ns_tclass_ctype cppname:amc.gen_ns_tclass_ctype comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_tclass_field acrkey:gstatic/amcdb.gen:ns_tclass_field cppname:amc.gen_ns_tclass_field comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_tclass_ns acrkey:gstatic/amcdb.gen:ns_tclass_ns cppname:amc.gen_ns_tclass_ns comment:"" +dmmeta.userfunc userfunc:amc...gen_ns_write acrkey:gstatic/amcdb.gen:ns_write cppname:amc.gen_ns_write comment:"" +dmmeta.userfunc userfunc:amc...gen_nsjs_ctype acrkey:gstatic/amcdb.gen:nsjs_ctype cppname:amc.gen_nsjs_ctype comment:"" +dmmeta.userfunc userfunc:amc...gen_nsjs_field acrkey:gstatic/amcdb.gen:nsjs_field cppname:amc.gen_nsjs_field comment:"" +dmmeta.userfunc userfunc:amc...gen_nsjs_module acrkey:gstatic/amcdb.gen:nsjs_module cppname:amc.gen_nsjs_module comment:"" +dmmeta.userfunc userfunc:amc...gen_nsjs_ns acrkey:gstatic/amcdb.gen:nsjs_ns cppname:amc.gen_nsjs_ns comment:"" +dmmeta.userfunc userfunc:amc...gen_parsenum acrkey:gstatic/amcdb.gen:parsenum cppname:amc.gen_parsenum comment:"" +dmmeta.userfunc userfunc:amc...gen_plaindata acrkey:gstatic/amcdb.gen:plaindata cppname:amc.gen_plaindata comment:"" +dmmeta.userfunc userfunc:amc...gen_pmask acrkey:gstatic/amcdb.gen:pmask cppname:amc.gen_pmask comment:"" +dmmeta.userfunc userfunc:amc...gen_prep_ctype acrkey:gstatic/amcdb.gen:prep_ctype cppname:amc.gen_prep_ctype comment:"" +dmmeta.userfunc userfunc:amc...gen_prep_fconst acrkey:gstatic/amcdb.gen:prep_fconst cppname:amc.gen_prep_fconst comment:"" +dmmeta.userfunc userfunc:amc...gen_prep_field acrkey:gstatic/amcdb.gen:prep_field cppname:amc.gen_prep_field comment:"" +dmmeta.userfunc userfunc:amc...gen_prep_signature acrkey:gstatic/amcdb.gen:prep_signature cppname:amc.gen_prep_signature comment:"" +dmmeta.userfunc userfunc:amc...gen_proc acrkey:gstatic/amcdb.gen:proc cppname:amc.gen_proc comment:"" +dmmeta.userfunc userfunc:amc...gen_rewrite_regx acrkey:gstatic/amcdb.gen:rewrite_regx cppname:amc.gen_rewrite_regx comment:"" +dmmeta.userfunc userfunc:amc...gen_select_ns acrkey:gstatic/amcdb.gen:select_ns cppname:amc.gen_select_ns comment:"" +dmmeta.userfunc userfunc:amc...gen_sortssimfile acrkey:gstatic/amcdb.gen:sortssimfile cppname:amc.gen_sortssimfile comment:"" +dmmeta.userfunc userfunc:amc...gen_ssimdb acrkey:gstatic/amcdb.gen:ssimdb cppname:amc.gen_ssimdb comment:"" +dmmeta.userfunc userfunc:amc...gen_table_write acrkey:gstatic/amcdb.gen:table_write cppname:amc.gen_table_write comment:"" +dmmeta.userfunc userfunc:amc...gen_tableenum acrkey:gstatic/amcdb.gen:tableenum cppname:amc.gen_tableenum comment:"" +dmmeta.userfunc userfunc:amc...gen_trace acrkey:gstatic/amcdb.gen:trace cppname:amc.gen_trace comment:"" +dmmeta.userfunc userfunc:amc...gen_usedns acrkey:gstatic/amcdb.gen:usedns cppname:amc.gen_usedns comment:"" +dmmeta.userfunc userfunc:amc...gen_xref2 acrkey:gstatic/amcdb.gen:xref2 cppname:amc.gen_xref2 comment:"" +dmmeta.userfunc userfunc:amc...gen_xref_parent acrkey:gstatic/amcdb.gen:xref_parent cppname:amc.gen_xref_parent comment:"" +dmmeta.userfunc userfunc:amc...tclass_Alias acrkey:gstatic/amcdb.tclass:Alias cppname:amc.tclass_Alias comment:"" +dmmeta.userfunc userfunc:amc...tclass_Atree acrkey:gstatic/amcdb.tclass:Atree cppname:amc.tclass_Atree comment:"" +dmmeta.userfunc userfunc:amc...tclass_Base acrkey:gstatic/amcdb.tclass:Base cppname:amc.tclass_Base comment:"" +dmmeta.userfunc userfunc:amc...tclass_Bheap acrkey:gstatic/amcdb.tclass:Bheap cppname:amc.tclass_Bheap comment:"" +dmmeta.userfunc userfunc:amc...tclass_Bitfld acrkey:gstatic/amcdb.tclass:Bitfld cppname:amc.tclass_Bitfld comment:"" +dmmeta.userfunc userfunc:amc...tclass_Bitset acrkey:gstatic/amcdb.tclass:Bitset cppname:amc.tclass_Bitset comment:"" +dmmeta.userfunc userfunc:amc...tclass_Blkpool acrkey:gstatic/amcdb.tclass:Blkpool cppname:amc.tclass_Blkpool comment:"" +dmmeta.userfunc userfunc:amc...tclass_Charset acrkey:gstatic/amcdb.tclass:Charset cppname:amc.tclass_Charset comment:"" +dmmeta.userfunc userfunc:amc...tclass_Cmp acrkey:gstatic/amcdb.tclass:Cmp cppname:amc.tclass_Cmp comment:"" +dmmeta.userfunc userfunc:amc...tclass_Count acrkey:gstatic/amcdb.tclass:Count cppname:amc.tclass_Count comment:"" +dmmeta.userfunc userfunc:amc...tclass_Cppfunc acrkey:gstatic/amcdb.tclass:Cppfunc cppname:amc.tclass_Cppfunc comment:"" +dmmeta.userfunc userfunc:amc...tclass_Cppstack acrkey:gstatic/amcdb.tclass:Cppstack cppname:amc.tclass_Cppstack comment:"" +dmmeta.userfunc userfunc:amc...tclass_Ctype acrkey:gstatic/amcdb.tclass:Ctype cppname:amc.tclass_Ctype comment:"" +dmmeta.userfunc userfunc:amc...tclass_Ctype2 acrkey:gstatic/amcdb.tclass:Ctype2 cppname:amc.tclass_Ctype2 comment:"" +dmmeta.userfunc userfunc:amc...tclass_Dec acrkey:gstatic/amcdb.tclass:Dec cppname:amc.tclass_Dec comment:"" +dmmeta.userfunc userfunc:amc...tclass_Delptr acrkey:gstatic/amcdb.tclass:Delptr cppname:amc.tclass_Delptr comment:"" +dmmeta.userfunc userfunc:amc...tclass_Exec acrkey:gstatic/amcdb.tclass:Exec cppname:amc.tclass_Exec comment:"" +dmmeta.userfunc userfunc:amc...tclass_Fbuf acrkey:gstatic/amcdb.tclass:Fbuf cppname:amc.tclass_Fbuf comment:"" +dmmeta.userfunc userfunc:amc...tclass_Fcast acrkey:gstatic/amcdb.tclass:Fcast cppname:amc.tclass_Fcast comment:"" +dmmeta.userfunc userfunc:amc...tclass_Fconst acrkey:gstatic/amcdb.tclass:Fconst cppname:amc.tclass_Fconst comment:"" +dmmeta.userfunc userfunc:amc...tclass_Field acrkey:gstatic/amcdb.tclass:Field cppname:amc.tclass_Field comment:"" +dmmeta.userfunc userfunc:amc...tclass_Field2 acrkey:gstatic/amcdb.tclass:Field2 cppname:amc.tclass_Field2 comment:"" +dmmeta.userfunc userfunc:amc...tclass_Global acrkey:gstatic/amcdb.tclass:Global cppname:amc.tclass_Global comment:"" +dmmeta.userfunc userfunc:amc...tclass_Hook acrkey:gstatic/amcdb.tclass:Hook cppname:amc.tclass_Hook comment:"" +dmmeta.userfunc userfunc:amc...tclass_Inlary acrkey:gstatic/amcdb.tclass:Inlary cppname:amc.tclass_Inlary comment:"" +dmmeta.userfunc userfunc:amc...tclass_Io acrkey:gstatic/amcdb.tclass:Io cppname:amc.tclass_Io comment:"" +dmmeta.userfunc userfunc:amc...tclass_Lary acrkey:gstatic/amcdb.tclass:Lary cppname:amc.tclass_Lary comment:"" +dmmeta.userfunc userfunc:amc...tclass_Llist acrkey:gstatic/amcdb.tclass:Llist cppname:amc.tclass_Llist comment:"" +dmmeta.userfunc userfunc:amc...tclass_Lpool acrkey:gstatic/amcdb.tclass:Lpool cppname:amc.tclass_Lpool comment:"" +dmmeta.userfunc userfunc:amc...tclass_Malloc acrkey:gstatic/amcdb.tclass:Malloc cppname:amc.tclass_Malloc comment:"" +dmmeta.userfunc userfunc:amc...tclass_Ns acrkey:gstatic/amcdb.tclass:Ns cppname:amc.tclass_Ns comment:"" +dmmeta.userfunc userfunc:amc...tclass_Numstr acrkey:gstatic/amcdb.tclass:Numstr cppname:amc.tclass_Numstr comment:"" +dmmeta.userfunc userfunc:amc...tclass_Opt acrkey:gstatic/amcdb.tclass:Opt cppname:amc.tclass_Opt comment:"" +dmmeta.userfunc userfunc:amc...tclass_Pkey acrkey:gstatic/amcdb.tclass:Pkey cppname:amc.tclass_Pkey comment:"" +dmmeta.userfunc userfunc:amc...tclass_Pmask acrkey:gstatic/amcdb.tclass:Pmask cppname:amc.tclass_Pmask comment:"" +dmmeta.userfunc userfunc:amc...tclass_Pool acrkey:gstatic/amcdb.tclass:Pool cppname:amc.tclass_Pool comment:"" +dmmeta.userfunc userfunc:amc...tclass_Ptr acrkey:gstatic/amcdb.tclass:Ptr cppname:amc.tclass_Ptr comment:"" +dmmeta.userfunc userfunc:amc...tclass_Ptrary acrkey:gstatic/amcdb.tclass:Ptrary cppname:amc.tclass_Ptrary comment:"" +dmmeta.userfunc userfunc:amc...tclass_Regx acrkey:gstatic/amcdb.tclass:Regx cppname:amc.tclass_Regx comment:"" +dmmeta.userfunc userfunc:amc...tclass_RegxSql acrkey:gstatic/amcdb.tclass:RegxSql cppname:amc.tclass_RegxSql comment:"" +dmmeta.userfunc userfunc:amc...tclass_Sbrk acrkey:gstatic/amcdb.tclass:Sbrk cppname:amc.tclass_Sbrk comment:"" +dmmeta.userfunc userfunc:amc...tclass_Smallstr acrkey:gstatic/amcdb.tclass:Smallstr cppname:amc.tclass_Smallstr comment:"" +dmmeta.userfunc userfunc:amc...tclass_Sort acrkey:gstatic/amcdb.tclass:Sort cppname:amc.tclass_Sort comment:"" +dmmeta.userfunc userfunc:amc...tclass_Step acrkey:gstatic/amcdb.tclass:Step cppname:amc.tclass_Step comment:"" +dmmeta.userfunc userfunc:amc...tclass_Substr acrkey:gstatic/amcdb.tclass:Substr cppname:amc.tclass_Substr comment:"" +dmmeta.userfunc userfunc:amc...tclass_Tary acrkey:gstatic/amcdb.tclass:Tary cppname:amc.tclass_Tary comment:"" +dmmeta.userfunc userfunc:amc...tclass_Thash acrkey:gstatic/amcdb.tclass:Thash cppname:amc.tclass_Thash comment:"" +dmmeta.userfunc userfunc:amc...tclass_Tpool acrkey:gstatic/amcdb.tclass:Tpool cppname:amc.tclass_Tpool comment:"" +dmmeta.userfunc userfunc:amc...tclass_Upptr acrkey:gstatic/amcdb.tclass:Upptr cppname:amc.tclass_Upptr comment:"" +dmmeta.userfunc userfunc:amc...tclass_Val acrkey:gstatic/amcdb.tclass:Val cppname:amc.tclass_Val comment:"" +dmmeta.userfunc userfunc:amc...tclass_Varlen acrkey:gstatic/amcdb.tclass:Varlen cppname:amc.tclass_Varlen comment:"" +dmmeta.userfunc userfunc:amc...tclass_ZSListMT acrkey:gstatic/amcdb.tclass:ZSListMT cppname:amc.tclass_ZSListMT comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Alias_Get acrkey:gstatic/amcdb.tfunc:Alias.Get cppname:amc.tfunc_Alias_Get comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Alias_ReadStrptrMaybe acrkey:gstatic/amcdb.tfunc:Alias.ReadStrptrMaybe cppname:amc.tfunc_Alias_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Alias_Set acrkey:gstatic/amcdb.tfunc:Alias.Set cppname:amc.tfunc_Alias_Set comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Balance acrkey:gstatic/amcdb.tfunc:Atree.Balance cppname:amc.tfunc_Atree_Balance comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Cascdel acrkey:gstatic/amcdb.tfunc:Atree.Cascdel cppname:amc.tfunc_Atree_Cascdel comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Connect acrkey:gstatic/amcdb.tfunc:Atree.Connect cppname:amc.tfunc_Atree_Connect comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Disconnect acrkey:gstatic/amcdb.tfunc:Atree.Disconnect cppname:amc.tfunc_Atree_Disconnect comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_ElemLt acrkey:gstatic/amcdb.tfunc:Atree.ElemLt cppname:amc.tfunc_Atree_ElemLt comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_EmptyQ acrkey:gstatic/amcdb.tfunc:Atree.EmptyQ cppname:amc.tfunc_Atree_EmptyQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_First acrkey:gstatic/amcdb.tfunc:Atree.First cppname:amc.tfunc_Atree_First comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_FirstGe acrkey:gstatic/amcdb.tfunc:Atree.FirstGe cppname:amc.tfunc_Atree_FirstGe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_FirstImpl acrkey:gstatic/amcdb.tfunc:Atree.FirstImpl cppname:amc.tfunc_Atree_FirstImpl comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_InTreeQ acrkey:gstatic/amcdb.tfunc:Atree.InTreeQ cppname:amc.tfunc_Atree_InTreeQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Init acrkey:gstatic/amcdb.tfunc:Atree.Init cppname:amc.tfunc_Atree_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Insert acrkey:gstatic/amcdb.tfunc:Atree.Insert cppname:amc.tfunc_Atree_Insert comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_InsertImpl acrkey:gstatic/amcdb.tfunc:Atree.InsertImpl cppname:amc.tfunc_Atree_InsertImpl comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Last acrkey:gstatic/amcdb.tfunc:Atree.Last cppname:amc.tfunc_Atree_Last comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_LastImpl acrkey:gstatic/amcdb.tfunc:Atree.LastImpl cppname:amc.tfunc_Atree_LastImpl comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_LastLt acrkey:gstatic/amcdb.tfunc:Atree.LastLt cppname:amc.tfunc_Atree_LastLt comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Next acrkey:gstatic/amcdb.tfunc:Atree.Next cppname:amc.tfunc_Atree_Next comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Prev acrkey:gstatic/amcdb.tfunc:Atree.Prev cppname:amc.tfunc_Atree_Prev comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Propagate acrkey:gstatic/amcdb.tfunc:Atree.Propagate cppname:amc.tfunc_Atree_Propagate comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Rebalance acrkey:gstatic/amcdb.tfunc:Atree.Rebalance cppname:amc.tfunc_Atree_Rebalance comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Reinsert acrkey:gstatic/amcdb.tfunc:Atree.Reinsert cppname:amc.tfunc_Atree_Reinsert comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Remove acrkey:gstatic/amcdb.tfunc:Atree.Remove cppname:amc.tfunc_Atree_Remove comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_RemoveAll acrkey:gstatic/amcdb.tfunc:Atree.RemoveAll cppname:amc.tfunc_Atree_RemoveAll comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_RemoveAllImpl acrkey:gstatic/amcdb.tfunc:Atree.RemoveAllImpl cppname:amc.tfunc_Atree_RemoveAllImpl comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_RemoveFirst acrkey:gstatic/amcdb.tfunc:Atree.RemoveFirst cppname:amc.tfunc_Atree_RemoveFirst comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_TallerChild acrkey:gstatic/amcdb.tfunc:Atree.TallerChild cppname:amc.tfunc_Atree_TallerChild comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_Turn acrkey:gstatic/amcdb.tfunc:Atree.Turn cppname:amc.tfunc_Atree_Turn comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_UpdateDepth acrkey:gstatic/amcdb.tfunc:Atree.UpdateDepth cppname:amc.tfunc_Atree_UpdateDepth comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Atree_curs acrkey:gstatic/amcdb.tfunc:Atree.curs cppname:amc.tfunc_Atree_curs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Base_Castbase acrkey:gstatic/amcdb.tfunc:Base.Castbase cppname:amc.tfunc_Base_Castbase comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Base_Castdown acrkey:gstatic/amcdb.tfunc:Base.Castdown cppname:amc.tfunc_Base_Castdown comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Base_CopyIn acrkey:gstatic/amcdb.tfunc:Base.CopyIn cppname:amc.tfunc_Base_CopyIn comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Base_CopyOut acrkey:gstatic/amcdb.tfunc:Base.CopyOut cppname:amc.tfunc_Base_CopyOut comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Cascdel acrkey:gstatic/amcdb.tfunc:Bheap.Cascdel cppname:amc.tfunc_Bheap_Cascdel comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Compact acrkey:gstatic/amcdb.tfunc:Bheap.Compact cppname:amc.tfunc_Bheap_Compact comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Dealloc acrkey:gstatic/amcdb.tfunc:Bheap.Dealloc cppname:amc.tfunc_Bheap_Dealloc comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Downheap acrkey:gstatic/amcdb.tfunc:Bheap.Downheap cppname:amc.tfunc_Bheap_Downheap comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_ElemLt acrkey:gstatic/amcdb.tfunc:Bheap.ElemLt cppname:amc.tfunc_Bheap_ElemLt comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_ElemLtval acrkey:gstatic/amcdb.tfunc:Bheap.ElemLtval cppname:amc.tfunc_Bheap_ElemLtval comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_EmptyQ acrkey:gstatic/amcdb.tfunc:Bheap.EmptyQ cppname:amc.tfunc_Bheap_EmptyQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_First acrkey:gstatic/amcdb.tfunc:Bheap.First cppname:amc.tfunc_Bheap_First comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_InBheapQ acrkey:gstatic/amcdb.tfunc:Bheap.InBheapQ cppname:amc.tfunc_Bheap_InBheapQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Init acrkey:gstatic/amcdb.tfunc:Bheap.Init cppname:amc.tfunc_Bheap_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Insert acrkey:gstatic/amcdb.tfunc:Bheap.Insert cppname:amc.tfunc_Bheap_Insert comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_N acrkey:gstatic/amcdb.tfunc:Bheap.N cppname:amc.tfunc_Bheap_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Reheap acrkey:gstatic/amcdb.tfunc:Bheap.Reheap cppname:amc.tfunc_Bheap_Reheap comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_ReheapFirst acrkey:gstatic/amcdb.tfunc:Bheap.ReheapFirst cppname:amc.tfunc_Bheap_ReheapFirst comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Remove acrkey:gstatic/amcdb.tfunc:Bheap.Remove cppname:amc.tfunc_Bheap_Remove comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_RemoveAll acrkey:gstatic/amcdb.tfunc:Bheap.RemoveAll cppname:amc.tfunc_Bheap_RemoveAll comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_RemoveFirst acrkey:gstatic/amcdb.tfunc:Bheap.RemoveFirst cppname:amc.tfunc_Bheap_RemoveFirst comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Reserve acrkey:gstatic/amcdb.tfunc:Bheap.Reserve cppname:amc.tfunc_Bheap_Reserve comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Set acrkey:gstatic/amcdb.tfunc:Bheap.Set cppname:amc.tfunc_Bheap_Set comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_SetIfBetter acrkey:gstatic/amcdb.tfunc:Bheap.SetIfBetter cppname:amc.tfunc_Bheap_SetIfBetter comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Uninit acrkey:gstatic/amcdb.tfunc:Bheap.Uninit cppname:amc.tfunc_Bheap_Uninit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_Upheap acrkey:gstatic/amcdb.tfunc:Bheap.Upheap cppname:amc.tfunc_Bheap_Upheap comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_curs acrkey:gstatic/amcdb.tfunc:Bheap.curs cppname:amc.tfunc_Bheap_curs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bheap_unordcurs acrkey:gstatic/amcdb.tfunc:Bheap.unordcurs cppname:amc.tfunc_Bheap_unordcurs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitfld_Get acrkey:gstatic/amcdb.tfunc:Bitfld.Get cppname:amc.tfunc_Bitfld_Get comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitfld_Init acrkey:gstatic/amcdb.tfunc:Bitfld.Init cppname:amc.tfunc_Bitfld_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitfld_Set acrkey:gstatic/amcdb.tfunc:Bitfld.Set cppname:amc.tfunc_Bitfld_Set comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_AllocBit acrkey:gstatic/amcdb.tfunc:Bitset.AllocBit cppname:amc.tfunc_Bitset_AllocBit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_BitsEmptyQ acrkey:gstatic/amcdb.tfunc:Bitset.BitsEmptyQ cppname:amc.tfunc_Bitset_BitsEmptyQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_ClearBit acrkey:gstatic/amcdb.tfunc:Bitset.ClearBit cppname:amc.tfunc_Bitset_ClearBit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_ClearBits acrkey:gstatic/amcdb.tfunc:Bitset.ClearBits cppname:amc.tfunc_Bitset_ClearBits comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_ClearBitsAll acrkey:gstatic/amcdb.tfunc:Bitset.ClearBitsAll cppname:amc.tfunc_Bitset_ClearBitsAll comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_ExpandBits acrkey:gstatic/amcdb.tfunc:Bitset.ExpandBits cppname:amc.tfunc_Bitset_ExpandBits comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_GetBit acrkey:gstatic/amcdb.tfunc:Bitset.GetBit cppname:amc.tfunc_Bitset_GetBit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_N acrkey:gstatic/amcdb.tfunc:Bitset.N cppname:amc.tfunc_Bitset_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_NBits acrkey:gstatic/amcdb.tfunc:Bitset.NBits cppname:amc.tfunc_Bitset_NBits comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_OrBits acrkey:gstatic/amcdb.tfunc:Bitset.OrBits cppname:amc.tfunc_Bitset_OrBits comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_SetBit acrkey:gstatic/amcdb.tfunc:Bitset.SetBit cppname:amc.tfunc_Bitset_SetBit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_Sum1s acrkey:gstatic/amcdb.tfunc:Bitset.Sum1s cppname:amc.tfunc_Bitset_Sum1s comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_Sup acrkey:gstatic/amcdb.tfunc:Bitset.Sup cppname:amc.tfunc_Bitset_Sup comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_bitcurs acrkey:gstatic/amcdb.tfunc:Bitset.bitcurs cppname:amc.tfunc_Bitset_bitcurs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_qClearBit acrkey:gstatic/amcdb.tfunc:Bitset.qClearBit cppname:amc.tfunc_Bitset_qClearBit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_qFind acrkey:gstatic/amcdb.tfunc:Bitset.qFind cppname:amc.tfunc_Bitset_qFind comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_qGetBit acrkey:gstatic/amcdb.tfunc:Bitset.qGetBit cppname:amc.tfunc_Bitset_qGetBit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_qOrBitVal acrkey:gstatic/amcdb.tfunc:Bitset.qOrBitVal cppname:amc.tfunc_Bitset_qOrBitVal comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_qSetBit acrkey:gstatic/amcdb.tfunc:Bitset.qSetBit cppname:amc.tfunc_Bitset_qSetBit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Bitset_qSetBitVal acrkey:gstatic/amcdb.tfunc:Bitset.qSetBitVal cppname:amc.tfunc_Bitset_qSetBitVal comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Blkpool_AllocMem acrkey:gstatic/amcdb.tfunc:Blkpool.AllocMem cppname:amc.tfunc_Blkpool_AllocMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Blkpool_FreeMem acrkey:gstatic/amcdb.tfunc:Blkpool.FreeMem cppname:amc.tfunc_Blkpool_FreeMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Blkpool_Init acrkey:gstatic/amcdb.tfunc:Blkpool.Init cppname:amc.tfunc_Blkpool_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Blkpool_ReserveBuffers acrkey:gstatic/amcdb.tfunc:Blkpool.ReserveBuffers cppname:amc.tfunc_Blkpool_ReserveBuffers comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Blkpool_SetBufferSize acrkey:gstatic/amcdb.tfunc:Blkpool.SetBufferSize cppname:amc.tfunc_Blkpool_SetBufferSize comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Charset_Match acrkey:gstatic/amcdb.tfunc:Charset.Match cppname:amc.tfunc_Charset_Match comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Cmp_Cmp acrkey:gstatic/amcdb.tfunc:Cmp.Cmp cppname:amc.tfunc_Cmp_Cmp comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Cmp_Lt acrkey:gstatic/amcdb.tfunc:Cmp.Lt cppname:amc.tfunc_Cmp_Lt comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Cmp_Nextchar acrkey:gstatic/amcdb.tfunc:Cmp.Nextchar cppname:amc.tfunc_Cmp_Nextchar comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Count_Insert acrkey:gstatic/amcdb.tfunc:Count.Insert cppname:amc.tfunc_Count_Insert comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Count_N acrkey:gstatic/amcdb.tfunc:Count.N cppname:amc.tfunc_Count_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Count_Remove acrkey:gstatic/amcdb.tfunc:Count.Remove cppname:amc.tfunc_Count_Remove comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Cppfunc_Get acrkey:gstatic/amcdb.tfunc:Cppfunc.Get cppname:amc.tfunc_Cppfunc_Get comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Cppfunc_Init acrkey:gstatic/amcdb.tfunc:Cppfunc.Init cppname:amc.tfunc_Cppfunc_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Cppfunc_Set acrkey:gstatic/amcdb.tfunc:Cppfunc.Set cppname:amc.tfunc_Cppfunc_Set comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype2_CopyCtor acrkey:gstatic/amcdb.tfunc:Ctype2.CopyCtor cppname:amc.tfunc_Ctype2_CopyCtor comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype2_Ctor acrkey:gstatic/amcdb.tfunc:Ctype2.Ctor cppname:amc.tfunc_Ctype2_Ctor comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype2_Dtor acrkey:gstatic/amcdb.tfunc:Ctype2.Dtor cppname:amc.tfunc_Ctype2_Dtor comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype2_EnumCtor acrkey:gstatic/amcdb.tfunc:Ctype2.EnumCtor cppname:amc.tfunc_Ctype2_EnumCtor comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype2_FieldwiseCtor acrkey:gstatic/amcdb.tfunc:Ctype2.FieldwiseCtor cppname:amc.tfunc_Ctype2_FieldwiseCtor comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_AssignOp acrkey:gstatic/amcdb.tfunc:Ctype.AssignOp cppname:amc.tfunc_Ctype_AssignOp comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Cmp acrkey:gstatic/amcdb.tfunc:Ctype.Cmp cppname:amc.tfunc_Ctype_Cmp comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Eq acrkey:gstatic/amcdb.tfunc:Ctype.Eq cppname:amc.tfunc_Ctype_Eq comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_EqEnum acrkey:gstatic/amcdb.tfunc:Ctype.EqEnum cppname:amc.tfunc_Ctype_EqEnum comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_EqOp acrkey:gstatic/amcdb.tfunc:Ctype.EqOp cppname:amc.tfunc_Ctype_EqOp comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_EqOpAryptr acrkey:gstatic/amcdb.tfunc:Ctype.EqOpAryptr cppname:amc.tfunc_Ctype_EqOpAryptr comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_FastDecode acrkey:gstatic/amcdb.tfunc:Ctype.FastDecode cppname:amc.tfunc_Ctype_FastDecode comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_FastEncode acrkey:gstatic/amcdb.tfunc:Ctype.FastEncode cppname:amc.tfunc_Ctype_FastEncode comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_FixEncode acrkey:gstatic/amcdb.tfunc:Ctype.FixEncode cppname:amc.tfunc_Ctype_FixEncode comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_GeOp acrkey:gstatic/amcdb.tfunc:Ctype.GeOp cppname:amc.tfunc_Ctype_GeOp comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_GetAnon acrkey:gstatic/amcdb.tfunc:Ctype.GetAnon cppname:amc.tfunc_Ctype_GetAnon comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_GetMsgLength acrkey:gstatic/amcdb.tfunc:Ctype.GetMsgLength cppname:amc.tfunc_Ctype_GetMsgLength comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_GetMsgMemptr acrkey:gstatic/amcdb.tfunc:Ctype.GetMsgMemptr cppname:amc.tfunc_Ctype_GetMsgMemptr comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_GtOp acrkey:gstatic/amcdb.tfunc:Ctype.GtOp cppname:amc.tfunc_Ctype_GtOp comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Hash acrkey:gstatic/amcdb.tfunc:Ctype.Hash cppname:amc.tfunc_Ctype_Hash comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Init acrkey:gstatic/amcdb.tfunc:Ctype.Init cppname:amc.tfunc_Ctype_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_KafkaDecode acrkey:gstatic/amcdb.tfunc:Ctype.KafkaDecode cppname:amc.tfunc_Ctype_KafkaDecode comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_KafkaEncode acrkey:gstatic/amcdb.tfunc:Ctype.KafkaEncode cppname:amc.tfunc_Ctype_KafkaEncode comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_LeOp acrkey:gstatic/amcdb.tfunc:Ctype.LeOp cppname:amc.tfunc_Ctype_LeOp comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Lt acrkey:gstatic/amcdb.tfunc:Ctype.Lt cppname:amc.tfunc_Ctype_Lt comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_LtOp acrkey:gstatic/amcdb.tfunc:Ctype.LtOp cppname:amc.tfunc_Ctype_LtOp comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Max acrkey:gstatic/amcdb.tfunc:Ctype.Max cppname:amc.tfunc_Ctype_Max comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Min acrkey:gstatic/amcdb.tfunc:Ctype.Min cppname:amc.tfunc_Ctype_Min comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_NArgs acrkey:gstatic/amcdb.tfunc:Ctype.NArgs cppname:amc.tfunc_Ctype_NArgs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_NeOp acrkey:gstatic/amcdb.tfunc:Ctype.NeOp cppname:amc.tfunc_Ctype_NeOp comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Print acrkey:gstatic/amcdb.tfunc:Ctype.Print cppname:amc.tfunc_Ctype_Print comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Read acrkey:gstatic/amcdb.tfunc:Ctype.Read cppname:amc.tfunc_Ctype_Read comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_ReadFieldMaybe acrkey:gstatic/amcdb.tfunc:Ctype.ReadFieldMaybe cppname:amc.tfunc_Ctype_ReadFieldMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_ToCmdline acrkey:gstatic/amcdb.tfunc:Ctype.ToCmdline cppname:amc.tfunc_Ctype_ToCmdline comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Uninit acrkey:gstatic/amcdb.tfunc:Ctype.Uninit cppname:amc.tfunc_Ctype_Uninit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Unref acrkey:gstatic/amcdb.tfunc:Ctype.Unref cppname:amc.tfunc_Ctype_Unref comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_Update acrkey:gstatic/amcdb.tfunc:Ctype.Update cppname:amc.tfunc_Ctype_Update comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_UpdateMax acrkey:gstatic/amcdb.tfunc:Ctype.UpdateMax cppname:amc.tfunc_Ctype_UpdateMax comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_UpdateMin acrkey:gstatic/amcdb.tfunc:Ctype.UpdateMin cppname:amc.tfunc_Ctype_UpdateMin comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ctype_XrefMaybe acrkey:gstatic/amcdb.tfunc:Ctype.XrefMaybe cppname:amc.tfunc_Ctype_XrefMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Dec_GetDouble acrkey:gstatic/amcdb.tfunc:Dec.GetDouble cppname:amc.tfunc_Dec_GetDouble comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Dec_GetInt acrkey:gstatic/amcdb.tfunc:Dec.GetInt cppname:amc.tfunc_Dec_GetInt comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Dec_GetScale acrkey:gstatic/amcdb.tfunc:Dec.GetScale cppname:amc.tfunc_Dec_GetScale comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Dec_Print acrkey:gstatic/amcdb.tfunc:Dec.Print cppname:amc.tfunc_Dec_Print comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Dec_ReadStrptrMaybe acrkey:gstatic/amcdb.tfunc:Dec.ReadStrptrMaybe cppname:amc.tfunc_Dec_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Dec_SetDoubleMaybe acrkey:gstatic/amcdb.tfunc:Dec.SetDoubleMaybe cppname:amc.tfunc_Dec_SetDoubleMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Dec_qSetDouble acrkey:gstatic/amcdb.tfunc:Dec.qSetDouble cppname:amc.tfunc_Dec_qSetDouble comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Delptr_Access acrkey:gstatic/amcdb.tfunc:Delptr.Access cppname:amc.tfunc_Delptr_Access comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Delptr_Delete acrkey:gstatic/amcdb.tfunc:Delptr.Delete cppname:amc.tfunc_Delptr_Delete comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Delptr_Init acrkey:gstatic/amcdb.tfunc:Delptr.Init cppname:amc.tfunc_Delptr_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Delptr_Uninit acrkey:gstatic/amcdb.tfunc:Delptr.Uninit cppname:amc.tfunc_Delptr_Uninit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Exec_Exec acrkey:gstatic/amcdb.tfunc:Exec.Exec cppname:amc.tfunc_Exec_Exec comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Exec_ExecX acrkey:gstatic/amcdb.tfunc:Exec.ExecX cppname:amc.tfunc_Exec_ExecX comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Exec_Execv acrkey:gstatic/amcdb.tfunc:Exec.Execv cppname:amc.tfunc_Exec_Execv comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Exec_Init acrkey:gstatic/amcdb.tfunc:Exec.Init cppname:amc.tfunc_Exec_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Exec_Kill acrkey:gstatic/amcdb.tfunc:Exec.Kill cppname:amc.tfunc_Exec_Kill comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Exec_Start acrkey:gstatic/amcdb.tfunc:Exec.Start cppname:amc.tfunc_Exec_Start comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Exec_StartRead acrkey:gstatic/amcdb.tfunc:Exec.StartRead cppname:amc.tfunc_Exec_StartRead comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Exec_ToArgv acrkey:gstatic/amcdb.tfunc:Exec.ToArgv cppname:amc.tfunc_Exec_ToArgv comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Exec_ToCmdline acrkey:gstatic/amcdb.tfunc:Exec.ToCmdline cppname:amc.tfunc_Exec_ToCmdline comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Exec_Uninit acrkey:gstatic/amcdb.tfunc:Exec.Uninit cppname:amc.tfunc_Exec_Uninit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Exec_Wait acrkey:gstatic/amcdb.tfunc:Exec.Wait cppname:amc.tfunc_Exec_Wait comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_BeginRead acrkey:gstatic/amcdb.tfunc:Fbuf.BeginRead cppname:amc.tfunc_Fbuf_BeginRead comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_BeginWrite acrkey:gstatic/amcdb.tfunc:Fbuf.BeginWrite cppname:amc.tfunc_Fbuf_BeginWrite comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_EndRead acrkey:gstatic/amcdb.tfunc:Fbuf.EndRead cppname:amc.tfunc_Fbuf_EndRead comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_EndWrite acrkey:gstatic/amcdb.tfunc:Fbuf.EndWrite cppname:amc.tfunc_Fbuf_EndWrite comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_GetMsg acrkey:gstatic/amcdb.tfunc:Fbuf.GetMsg cppname:amc.tfunc_Fbuf_GetMsg comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_Init acrkey:gstatic/amcdb.tfunc:Fbuf.Init cppname:amc.tfunc_Fbuf_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_Max acrkey:gstatic/amcdb.tfunc:Fbuf.Max cppname:amc.tfunc_Fbuf_Max comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_N acrkey:gstatic/amcdb.tfunc:Fbuf.N cppname:amc.tfunc_Fbuf_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_Outflow acrkey:gstatic/amcdb.tfunc:Fbuf.Outflow cppname:amc.tfunc_Fbuf_Outflow comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_Realloc acrkey:gstatic/amcdb.tfunc:Fbuf.Realloc cppname:amc.tfunc_Fbuf_Realloc comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_Refill acrkey:gstatic/amcdb.tfunc:Fbuf.Refill cppname:amc.tfunc_Fbuf_Refill comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_RemoveAll acrkey:gstatic/amcdb.tfunc:Fbuf.RemoveAll cppname:amc.tfunc_Fbuf_RemoveAll comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_ScanMsg acrkey:gstatic/amcdb.tfunc:Fbuf.ScanMsg cppname:amc.tfunc_Fbuf_ScanMsg comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_Shift acrkey:gstatic/amcdb.tfunc:Fbuf.Shift cppname:amc.tfunc_Fbuf_Shift comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_SkipBytes acrkey:gstatic/amcdb.tfunc:Fbuf.SkipBytes cppname:amc.tfunc_Fbuf_SkipBytes comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_SkipMsg acrkey:gstatic/amcdb.tfunc:Fbuf.SkipMsg cppname:amc.tfunc_Fbuf_SkipMsg comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_Uninit acrkey:gstatic/amcdb.tfunc:Fbuf.Uninit cppname:amc.tfunc_Fbuf_Uninit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_WriteAll acrkey:gstatic/amcdb.tfunc:Fbuf.WriteAll cppname:amc.tfunc_Fbuf_WriteAll comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_WriteMsg acrkey:gstatic/amcdb.tfunc:Fbuf.WriteMsg cppname:amc.tfunc_Fbuf_WriteMsg comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fbuf_WriteReserve acrkey:gstatic/amcdb.tfunc:Fbuf.WriteReserve cppname:amc.tfunc_Fbuf_WriteReserve comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fcast_Cast acrkey:gstatic/amcdb.tfunc:Fcast.Cast cppname:amc.tfunc_Fcast_Cast comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fconst_GetEnum acrkey:gstatic/amcdb.tfunc:Fconst.GetEnum cppname:amc.tfunc_Fconst_GetEnum comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fconst_Print acrkey:gstatic/amcdb.tfunc:Fconst.Print cppname:amc.tfunc_Fconst_Print comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fconst_ReadStrptrMaybe acrkey:gstatic/amcdb.tfunc:Fconst.ReadStrptrMaybe cppname:amc.tfunc_Fconst_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fconst_SetEnum acrkey:gstatic/amcdb.tfunc:Fconst.SetEnum cppname:amc.tfunc_Fconst_SetEnum comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fconst_SetStrptr acrkey:gstatic/amcdb.tfunc:Fconst.SetStrptr cppname:amc.tfunc_Fconst_SetStrptr comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fconst_SetStrptrMaybe acrkey:gstatic/amcdb.tfunc:Fconst.SetStrptrMaybe cppname:amc.tfunc_Fconst_SetStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Fconst_ToCstr acrkey:gstatic/amcdb.tfunc:Fconst.ToCstr cppname:amc.tfunc_Fconst_ToCstr comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Field2_ReadStrptrMaybe acrkey:gstatic/amcdb.tfunc:Field2.ReadStrptrMaybe cppname:amc.tfunc_Field2_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Field_Cascdel acrkey:gstatic/amcdb.tfunc:Field.Cascdel cppname:amc.tfunc_Field_Cascdel comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Field_Cleanup acrkey:gstatic/amcdb.tfunc:Field.Cleanup cppname:amc.tfunc_Field_Cleanup comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Field_Concat acrkey:gstatic/amcdb.tfunc:Field.Concat cppname:amc.tfunc_Field_Concat comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Field_Userinit acrkey:gstatic/amcdb.tfunc:Field.Userinit cppname:amc.tfunc_Field_Userinit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_Init acrkey:gstatic/amcdb.tfunc:Global.Init cppname:amc.tfunc_Global_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_InitReflection acrkey:gstatic/amcdb.tfunc:Global.InitReflection cppname:amc.tfunc_Global_InitReflection comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_InsertStrptrMaybe acrkey:gstatic/amcdb.tfunc:Global.InsertStrptrMaybe cppname:amc.tfunc_Global_InsertStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_LoadSsimfileMaybe acrkey:gstatic/amcdb.tfunc:Global.LoadSsimfileMaybe cppname:amc.tfunc_Global_LoadSsimfileMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_LoadTuplesFd acrkey:gstatic/amcdb.tfunc:Global.LoadTuplesFd cppname:amc.tfunc_Global_LoadTuplesFd comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_LoadTuplesFile acrkey:gstatic/amcdb.tfunc:Global.LoadTuplesFile cppname:amc.tfunc_Global_LoadTuplesFile comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_LoadTuplesMaybe acrkey:gstatic/amcdb.tfunc:Global.LoadTuplesMaybe cppname:amc.tfunc_Global_LoadTuplesMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_Main acrkey:gstatic/amcdb.tfunc:Global.Main cppname:amc.tfunc_Global_Main comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_MainLoop acrkey:gstatic/amcdb.tfunc:Global.MainLoop cppname:amc.tfunc_Global_MainLoop comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_ReadArgv acrkey:gstatic/amcdb.tfunc:Global.ReadArgv cppname:amc.tfunc_Global_ReadArgv comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_SaveTuples acrkey:gstatic/amcdb.tfunc:Global.SaveTuples cppname:amc.tfunc_Global_SaveTuples comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_Step acrkey:gstatic/amcdb.tfunc:Global.Step cppname:amc.tfunc_Global_Step comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_Steps acrkey:gstatic/amcdb.tfunc:Global.Steps cppname:amc.tfunc_Global_Steps comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_WinMain acrkey:gstatic/amcdb.tfunc:Global.WinMain cppname:amc.tfunc_Global_WinMain comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Global_main acrkey:gstatic/amcdb.tfunc:Global.main cppname:amc.tfunc_Global_main comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Hook_Call acrkey:gstatic/amcdb.tfunc:Hook.Call cppname:amc.tfunc_Hook_Call comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Hook_Set0 acrkey:gstatic/amcdb.tfunc:Hook.Set0 cppname:amc.tfunc_Hook_Set0 comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Hook_Set1 acrkey:gstatic/amcdb.tfunc:Hook.Set1 cppname:amc.tfunc_Hook_Set1 comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Hook_Set2 acrkey:gstatic/amcdb.tfunc:Hook.Set2 cppname:amc.tfunc_Hook_Set2 comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_AllocMem acrkey:gstatic/amcdb.tfunc:Inlary.AllocMem cppname:amc.tfunc_Inlary_AllocMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_Cmp acrkey:gstatic/amcdb.tfunc:Inlary.Cmp cppname:amc.tfunc_Inlary_Cmp comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_EmptyQ acrkey:gstatic/amcdb.tfunc:Inlary.EmptyQ cppname:amc.tfunc_Inlary_EmptyQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_Eq acrkey:gstatic/amcdb.tfunc:Inlary.Eq cppname:amc.tfunc_Inlary_Eq comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_Fill acrkey:gstatic/amcdb.tfunc:Inlary.Fill cppname:amc.tfunc_Inlary_Fill comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_Find acrkey:gstatic/amcdb.tfunc:Inlary.Find cppname:amc.tfunc_Inlary_Find comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_Getary acrkey:gstatic/amcdb.tfunc:Inlary.Getary cppname:amc.tfunc_Inlary_Getary comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_Init acrkey:gstatic/amcdb.tfunc:Inlary.Init cppname:amc.tfunc_Inlary_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_Max acrkey:gstatic/amcdb.tfunc:Inlary.Max cppname:amc.tfunc_Inlary_Max comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_N acrkey:gstatic/amcdb.tfunc:Inlary.N cppname:amc.tfunc_Inlary_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_Print acrkey:gstatic/amcdb.tfunc:Inlary.Print cppname:amc.tfunc_Inlary_Print comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_ReadStrptrMaybe acrkey:gstatic/amcdb.tfunc:Inlary.ReadStrptrMaybe cppname:amc.tfunc_Inlary_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_RemoveAll acrkey:gstatic/amcdb.tfunc:Inlary.RemoveAll cppname:amc.tfunc_Inlary_RemoveAll comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_RemoveLast acrkey:gstatic/amcdb.tfunc:Inlary.RemoveLast cppname:amc.tfunc_Inlary_RemoveLast comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_RowidFind acrkey:gstatic/amcdb.tfunc:Inlary.RowidFind cppname:amc.tfunc_Inlary_RowidFind comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_Setary acrkey:gstatic/amcdb.tfunc:Inlary.Setary cppname:amc.tfunc_Inlary_Setary comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_Uninit acrkey:gstatic/amcdb.tfunc:Inlary.Uninit cppname:amc.tfunc_Inlary_Uninit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_curs acrkey:gstatic/amcdb.tfunc:Inlary.curs cppname:amc.tfunc_Inlary_curs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_qFind acrkey:gstatic/amcdb.tfunc:Inlary.qFind cppname:amc.tfunc_Inlary_qFind comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Inlary_rowid_Get acrkey:gstatic/amcdb.tfunc:Inlary.rowid_Get cppname:amc.tfunc_Inlary_rowid_Get comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Io_Input acrkey:gstatic/amcdb.tfunc:Io.Input cppname:amc.tfunc_Io_Input comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Io_InputMaybe acrkey:gstatic/amcdb.tfunc:Io.InputMaybe cppname:amc.tfunc_Io_InputMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Io_LoadStatic acrkey:gstatic/amcdb.tfunc:Io.LoadStatic cppname:amc.tfunc_Io_LoadStatic comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Io_SaveSsimfile acrkey:gstatic/amcdb.tfunc:Io.SaveSsimfile cppname:amc.tfunc_Io_SaveSsimfile comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_AllocMem acrkey:gstatic/amcdb.tfunc:Lary.AllocMem cppname:amc.tfunc_Lary_AllocMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_EmptyQ acrkey:gstatic/amcdb.tfunc:Lary.EmptyQ cppname:amc.tfunc_Lary_EmptyQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_Find acrkey:gstatic/amcdb.tfunc:Lary.Find cppname:amc.tfunc_Lary_Find comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_Init acrkey:gstatic/amcdb.tfunc:Lary.Init cppname:amc.tfunc_Lary_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_Last acrkey:gstatic/amcdb.tfunc:Lary.Last cppname:amc.tfunc_Lary_Last comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_N acrkey:gstatic/amcdb.tfunc:Lary.N cppname:amc.tfunc_Lary_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_RemoveAll acrkey:gstatic/amcdb.tfunc:Lary.RemoveAll cppname:amc.tfunc_Lary_RemoveAll comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_RemoveLast acrkey:gstatic/amcdb.tfunc:Lary.RemoveLast cppname:amc.tfunc_Lary_RemoveLast comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_RowidFind acrkey:gstatic/amcdb.tfunc:Lary.RowidFind cppname:amc.tfunc_Lary_RowidFind comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_Uninit acrkey:gstatic/amcdb.tfunc:Lary.Uninit cppname:amc.tfunc_Lary_Uninit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_curs acrkey:gstatic/amcdb.tfunc:Lary.curs cppname:amc.tfunc_Lary_curs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_qFind acrkey:gstatic/amcdb.tfunc:Lary.qFind cppname:amc.tfunc_Lary_qFind comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lary_qLast acrkey:gstatic/amcdb.tfunc:Lary.qLast cppname:amc.tfunc_Lary_qLast comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_Cascdel acrkey:gstatic/amcdb.tfunc:Llist.Cascdel cppname:amc.tfunc_Llist_Cascdel comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_DestructiveFirst acrkey:gstatic/amcdb.tfunc:Llist.DestructiveFirst cppname:amc.tfunc_Llist_DestructiveFirst comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_EmptyQ acrkey:gstatic/amcdb.tfunc:Llist.EmptyQ cppname:amc.tfunc_Llist_EmptyQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_First acrkey:gstatic/amcdb.tfunc:Llist.First cppname:amc.tfunc_Llist_First comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_InLlistQ acrkey:gstatic/amcdb.tfunc:Llist.InLlistQ cppname:amc.tfunc_Llist_InLlistQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_Init acrkey:gstatic/amcdb.tfunc:Llist.Init cppname:amc.tfunc_Llist_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_Insert acrkey:gstatic/amcdb.tfunc:Llist.Insert cppname:amc.tfunc_Llist_Insert comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_Last acrkey:gstatic/amcdb.tfunc:Llist.Last cppname:amc.tfunc_Llist_Last comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_N acrkey:gstatic/amcdb.tfunc:Llist.N cppname:amc.tfunc_Llist_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_Next acrkey:gstatic/amcdb.tfunc:Llist.Next cppname:amc.tfunc_Llist_Next comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_Prev acrkey:gstatic/amcdb.tfunc:Llist.Prev cppname:amc.tfunc_Llist_Prev comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_Remove acrkey:gstatic/amcdb.tfunc:Llist.Remove cppname:amc.tfunc_Llist_Remove comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_RemoveAll acrkey:gstatic/amcdb.tfunc:Llist.RemoveAll cppname:amc.tfunc_Llist_RemoveAll comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_RemoveFirst acrkey:gstatic/amcdb.tfunc:Llist.RemoveFirst cppname:amc.tfunc_Llist_RemoveFirst comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_RotateFirst acrkey:gstatic/amcdb.tfunc:Llist.RotateFirst cppname:amc.tfunc_Llist_RotateFirst comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_curs acrkey:gstatic/amcdb.tfunc:Llist.curs cppname:amc.tfunc_Llist_curs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_delcurs acrkey:gstatic/amcdb.tfunc:Llist.delcurs cppname:amc.tfunc_Llist_delcurs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Llist_qLast acrkey:gstatic/amcdb.tfunc:Llist.qLast cppname:amc.tfunc_Llist_qLast comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lpool_AllocMem acrkey:gstatic/amcdb.tfunc:Lpool.AllocMem cppname:amc.tfunc_Lpool_AllocMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lpool_FreeMem acrkey:gstatic/amcdb.tfunc:Lpool.FreeMem cppname:amc.tfunc_Lpool_FreeMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lpool_Init acrkey:gstatic/amcdb.tfunc:Lpool.Init cppname:amc.tfunc_Lpool_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lpool_N acrkey:gstatic/amcdb.tfunc:Lpool.N cppname:amc.tfunc_Lpool_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lpool_ReallocMem acrkey:gstatic/amcdb.tfunc:Lpool.ReallocMem cppname:amc.tfunc_Lpool_ReallocMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Lpool_ReserveBuffers acrkey:gstatic/amcdb.tfunc:Lpool.ReserveBuffers cppname:amc.tfunc_Lpool_ReserveBuffers comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Malloc_AllocMem acrkey:gstatic/amcdb.tfunc:Malloc.AllocMem cppname:amc.tfunc_Malloc_AllocMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Malloc_FreeMem acrkey:gstatic/amcdb.tfunc:Malloc.FreeMem cppname:amc.tfunc_Malloc_FreeMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Malloc_ReallocMem acrkey:gstatic/amcdb.tfunc:Malloc.ReallocMem cppname:amc.tfunc_Malloc_ReallocMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ns_StaticCheck acrkey:gstatic/amcdb.tfunc:Ns.StaticCheck cppname:amc.tfunc_Ns_StaticCheck comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Numstr_ForAllStrings acrkey:gstatic/amcdb.tfunc:Numstr.ForAllStrings cppname:amc.tfunc_Numstr_ForAllStrings comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Numstr_Geti64 acrkey:gstatic/amcdb.tfunc:Numstr.Geti64 cppname:amc.tfunc_Numstr_Geti64 comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Numstr_Getnum acrkey:gstatic/amcdb.tfunc:Numstr.Getnum cppname:amc.tfunc_Numstr_Getnum comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Numstr_GetnumDflt acrkey:gstatic/amcdb.tfunc:Numstr.GetnumDflt cppname:amc.tfunc_Numstr_GetnumDflt comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Numstr_SetnumMaybe acrkey:gstatic/amcdb.tfunc:Numstr.SetnumMaybe cppname:amc.tfunc_Numstr_SetnumMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Opt_Get acrkey:gstatic/amcdb.tfunc:Opt.Get cppname:amc.tfunc_Opt_Get comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Opt_Getary acrkey:gstatic/amcdb.tfunc:Opt.Getary cppname:amc.tfunc_Opt_Getary comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Opt_Print acrkey:gstatic/amcdb.tfunc:Opt.Print cppname:amc.tfunc_Opt_Print comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Opt_ReadStrptrMaybe acrkey:gstatic/amcdb.tfunc:Opt.ReadStrptrMaybe cppname:amc.tfunc_Opt_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pmask_GetBit acrkey:gstatic/amcdb.tfunc:Pmask.GetBit cppname:amc.tfunc_Pmask_GetBit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pmask_PresentQ acrkey:gstatic/amcdb.tfunc:Pmask.PresentQ cppname:amc.tfunc_Pmask_PresentQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pmask_SetPresent acrkey:gstatic/amcdb.tfunc:Pmask.SetPresent cppname:amc.tfunc_Pmask_SetPresent comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pool_Alloc acrkey:gstatic/amcdb.tfunc:Pool.Alloc cppname:amc.tfunc_Pool_Alloc comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pool_AllocExtra acrkey:gstatic/amcdb.tfunc:Pool.AllocExtra cppname:amc.tfunc_Pool_AllocExtra comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pool_AllocExtraMaybe acrkey:gstatic/amcdb.tfunc:Pool.AllocExtraMaybe cppname:amc.tfunc_Pool_AllocExtraMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pool_AllocMaybe acrkey:gstatic/amcdb.tfunc:Pool.AllocMaybe cppname:amc.tfunc_Pool_AllocMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pool_AllocVarlen acrkey:gstatic/amcdb.tfunc:Pool.AllocVarlen cppname:amc.tfunc_Pool_AllocVarlen comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pool_AllocVarlenMaybe acrkey:gstatic/amcdb.tfunc:Pool.AllocVarlenMaybe cppname:amc.tfunc_Pool_AllocVarlenMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pool_Delete acrkey:gstatic/amcdb.tfunc:Pool.Delete cppname:amc.tfunc_Pool_Delete comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pool_InsertMaybe acrkey:gstatic/amcdb.tfunc:Pool.InsertMaybe cppname:amc.tfunc_Pool_InsertMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Pool_UpdateMaybe acrkey:gstatic/amcdb.tfunc:Pool.UpdateMaybe cppname:amc.tfunc_Pool_UpdateMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptr_Cascdel acrkey:gstatic/amcdb.tfunc:Ptr.Cascdel cppname:amc.tfunc_Ptr_Cascdel comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptr_Init acrkey:gstatic/amcdb.tfunc:Ptr.Init cppname:amc.tfunc_Ptr_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptr_InsertMaybe acrkey:gstatic/amcdb.tfunc:Ptr.InsertMaybe cppname:amc.tfunc_Ptr_InsertMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptr_Remove acrkey:gstatic/amcdb.tfunc:Ptr.Remove cppname:amc.tfunc_Ptr_Remove comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_Cascdel acrkey:gstatic/amcdb.tfunc:Ptrary.Cascdel cppname:amc.tfunc_Ptrary_Cascdel comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_EmptyQ acrkey:gstatic/amcdb.tfunc:Ptrary.EmptyQ cppname:amc.tfunc_Ptrary_EmptyQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_Find acrkey:gstatic/amcdb.tfunc:Ptrary.Find cppname:amc.tfunc_Ptrary_Find comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_First acrkey:gstatic/amcdb.tfunc:Ptrary.First cppname:amc.tfunc_Ptrary_First comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_Getary acrkey:gstatic/amcdb.tfunc:Ptrary.Getary cppname:amc.tfunc_Ptrary_Getary comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_InAryQ acrkey:gstatic/amcdb.tfunc:Ptrary.InAryQ cppname:amc.tfunc_Ptrary_InAryQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_Init acrkey:gstatic/amcdb.tfunc:Ptrary.Init cppname:amc.tfunc_Ptrary_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_Insert acrkey:gstatic/amcdb.tfunc:Ptrary.Insert cppname:amc.tfunc_Ptrary_Insert comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_InsertMaybe acrkey:gstatic/amcdb.tfunc:Ptrary.InsertMaybe cppname:amc.tfunc_Ptrary_InsertMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_Last acrkey:gstatic/amcdb.tfunc:Ptrary.Last cppname:amc.tfunc_Ptrary_Last comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_N acrkey:gstatic/amcdb.tfunc:Ptrary.N cppname:amc.tfunc_Ptrary_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_Remove acrkey:gstatic/amcdb.tfunc:Ptrary.Remove cppname:amc.tfunc_Ptrary_Remove comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_RemoveAll acrkey:gstatic/amcdb.tfunc:Ptrary.RemoveAll cppname:amc.tfunc_Ptrary_RemoveAll comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_RemoveFirst acrkey:gstatic/amcdb.tfunc:Ptrary.RemoveFirst cppname:amc.tfunc_Ptrary_RemoveFirst comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_RemoveLast acrkey:gstatic/amcdb.tfunc:Ptrary.RemoveLast cppname:amc.tfunc_Ptrary_RemoveLast comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_Reserve acrkey:gstatic/amcdb.tfunc:Ptrary.Reserve cppname:amc.tfunc_Ptrary_Reserve comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_ScanInsertMaybe acrkey:gstatic/amcdb.tfunc:Ptrary.ScanInsertMaybe cppname:amc.tfunc_Ptrary_ScanInsertMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_Uninit acrkey:gstatic/amcdb.tfunc:Ptrary.Uninit cppname:amc.tfunc_Ptrary_Uninit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_curs acrkey:gstatic/amcdb.tfunc:Ptrary.curs cppname:amc.tfunc_Ptrary_curs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_oncecurs acrkey:gstatic/amcdb.tfunc:Ptrary.oncecurs cppname:amc.tfunc_Ptrary_oncecurs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_qFind acrkey:gstatic/amcdb.tfunc:Ptrary.qFind cppname:amc.tfunc_Ptrary_qFind comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Ptrary_qLast acrkey:gstatic/amcdb.tfunc:Ptrary.qLast cppname:amc.tfunc_Ptrary_qLast comment:"" +dmmeta.userfunc userfunc:amc...tfunc_RegxSql_Init acrkey:gstatic/amcdb.tfunc:RegxSql.Init cppname:amc.tfunc_RegxSql_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_RegxSql_Print acrkey:gstatic/amcdb.tfunc:RegxSql.Print cppname:amc.tfunc_RegxSql_Print comment:"" +dmmeta.userfunc userfunc:amc...tfunc_RegxSql_ReadStrptrMaybe acrkey:gstatic/amcdb.tfunc:RegxSql.ReadStrptrMaybe cppname:amc.tfunc_RegxSql_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Regx_Init acrkey:gstatic/amcdb.tfunc:Regx.Init cppname:amc.tfunc_Regx_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Regx_Print acrkey:gstatic/amcdb.tfunc:Regx.Print cppname:amc.tfunc_Regx_Print comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Regx_ReadStrptrMaybe acrkey:gstatic/amcdb.tfunc:Regx.ReadStrptrMaybe cppname:amc.tfunc_Regx_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sbrk_AllocMem acrkey:gstatic/amcdb.tfunc:Sbrk.AllocMem cppname:amc.tfunc_Sbrk_AllocMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sbrk_FreeMem acrkey:gstatic/amcdb.tfunc:Sbrk.FreeMem cppname:amc.tfunc_Sbrk_FreeMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sbrk_Init acrkey:gstatic/amcdb.tfunc:Sbrk.Init cppname:amc.tfunc_Sbrk_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Smallstr_Add acrkey:gstatic/amcdb.tfunc:Smallstr.Add cppname:amc.tfunc_Smallstr_Add comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Smallstr_AddStrptr acrkey:gstatic/amcdb.tfunc:Smallstr.AddStrptr cppname:amc.tfunc_Smallstr_AddStrptr comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Smallstr_AssignStrptr acrkey:gstatic/amcdb.tfunc:Smallstr.AssignStrptr cppname:amc.tfunc_Smallstr_AssignStrptr comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Smallstr_CtorStrptr acrkey:gstatic/amcdb.tfunc:Smallstr.CtorStrptr cppname:amc.tfunc_Smallstr_CtorStrptr comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Smallstr_Getary acrkey:gstatic/amcdb.tfunc:Smallstr.Getary cppname:amc.tfunc_Smallstr_Getary comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Smallstr_Init acrkey:gstatic/amcdb.tfunc:Smallstr.Init cppname:amc.tfunc_Smallstr_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Smallstr_Max acrkey:gstatic/amcdb.tfunc:Smallstr.Max cppname:amc.tfunc_Smallstr_Max comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Smallstr_N acrkey:gstatic/amcdb.tfunc:Smallstr.N cppname:amc.tfunc_Smallstr_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Smallstr_Print acrkey:gstatic/amcdb.tfunc:Smallstr.Print cppname:amc.tfunc_Smallstr_Print comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Smallstr_ReadStrptrMaybe acrkey:gstatic/amcdb.tfunc:Smallstr.ReadStrptrMaybe cppname:amc.tfunc_Smallstr_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Smallstr_SetStrptr acrkey:gstatic/amcdb.tfunc:Smallstr.SetStrptr cppname:amc.tfunc_Smallstr_SetStrptr comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sort_HeapSort acrkey:gstatic/amcdb.tfunc:Sort.HeapSort cppname:amc.tfunc_Sort_HeapSort comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sort_InsertionSort acrkey:gstatic/amcdb.tfunc:Sort.InsertionSort cppname:amc.tfunc_Sort_InsertionSort comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sort_IntHeapSort acrkey:gstatic/amcdb.tfunc:Sort.IntHeapSort cppname:amc.tfunc_Sort_IntHeapSort comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sort_IntInsertionSort acrkey:gstatic/amcdb.tfunc:Sort.IntInsertionSort cppname:amc.tfunc_Sort_IntInsertionSort comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sort_IntQuickSort acrkey:gstatic/amcdb.tfunc:Sort.IntQuickSort cppname:amc.tfunc_Sort_IntQuickSort comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sort_Lt acrkey:gstatic/amcdb.tfunc:Sort.Lt cppname:amc.tfunc_Sort_Lt comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sort_QuickSort acrkey:gstatic/amcdb.tfunc:Sort.QuickSort cppname:amc.tfunc_Sort_QuickSort comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sort_Rotleft acrkey:gstatic/amcdb.tfunc:Sort.Rotleft cppname:amc.tfunc_Sort_Rotleft comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sort_SortedQ acrkey:gstatic/amcdb.tfunc:Sort.SortedQ cppname:amc.tfunc_Sort_SortedQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Sort_Swap acrkey:gstatic/amcdb.tfunc:Sort.Swap cppname:amc.tfunc_Sort_Swap comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Step_Call acrkey:gstatic/amcdb.tfunc:Step.Call cppname:amc.tfunc_Step_Call comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Step_FirstChanged acrkey:gstatic/amcdb.tfunc:Step.FirstChanged cppname:amc.tfunc_Step_FirstChanged comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Step_Init acrkey:gstatic/amcdb.tfunc:Step.Init cppname:amc.tfunc_Step_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Step_SetDelay acrkey:gstatic/amcdb.tfunc:Step.SetDelay cppname:amc.tfunc_Step_SetDelay comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Step_Step acrkey:gstatic/amcdb.tfunc:Step.Step cppname:amc.tfunc_Step_Step comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Step_UpdateCycles acrkey:gstatic/amcdb.tfunc:Step.UpdateCycles cppname:amc.tfunc_Step_UpdateCycles comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Substr_Get acrkey:gstatic/amcdb.tfunc:Substr.Get cppname:amc.tfunc_Substr_Get comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Substr_Get2 acrkey:gstatic/amcdb.tfunc:Substr.Get2 cppname:amc.tfunc_Substr_Get2 comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_AbsReserve acrkey:gstatic/amcdb.tfunc:Tary.AbsReserve cppname:amc.tfunc_Tary_AbsReserve comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Addary acrkey:gstatic/amcdb.tfunc:Tary.Addary cppname:amc.tfunc_Tary_Addary comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Alloc acrkey:gstatic/amcdb.tfunc:Tary.Alloc cppname:amc.tfunc_Tary_Alloc comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_AllocAt acrkey:gstatic/amcdb.tfunc:Tary.AllocAt cppname:amc.tfunc_Tary_AllocAt comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_AllocN acrkey:gstatic/amcdb.tfunc:Tary.AllocN cppname:amc.tfunc_Tary_AllocN comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_AllocNAt acrkey:gstatic/amcdb.tfunc:Tary.AllocNAt cppname:amc.tfunc_Tary_AllocNAt comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_AllocNVal acrkey:gstatic/amcdb.tfunc:Tary.AllocNVal cppname:amc.tfunc_Tary_AllocNVal comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_AssignAryptr acrkey:gstatic/amcdb.tfunc:Tary.AssignAryptr cppname:amc.tfunc_Tary_AssignAryptr comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Cmp acrkey:gstatic/amcdb.tfunc:Tary.Cmp cppname:amc.tfunc_Tary_Cmp comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_CtorAryptr acrkey:gstatic/amcdb.tfunc:Tary.CtorAryptr cppname:amc.tfunc_Tary_CtorAryptr comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_EmptyQ acrkey:gstatic/amcdb.tfunc:Tary.EmptyQ cppname:amc.tfunc_Tary_EmptyQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Eq acrkey:gstatic/amcdb.tfunc:Tary.Eq cppname:amc.tfunc_Tary_Eq comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Find acrkey:gstatic/amcdb.tfunc:Tary.Find cppname:amc.tfunc_Tary_Find comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Getary acrkey:gstatic/amcdb.tfunc:Tary.Getary cppname:amc.tfunc_Tary_Getary comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Init acrkey:gstatic/amcdb.tfunc:Tary.Init cppname:amc.tfunc_Tary_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Insary acrkey:gstatic/amcdb.tfunc:Tary.Insary cppname:amc.tfunc_Tary_Insary comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Last acrkey:gstatic/amcdb.tfunc:Tary.Last cppname:amc.tfunc_Tary_Last comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Max acrkey:gstatic/amcdb.tfunc:Tary.Max cppname:amc.tfunc_Tary_Max comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_N acrkey:gstatic/amcdb.tfunc:Tary.N cppname:amc.tfunc_Tary_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Print acrkey:gstatic/amcdb.tfunc:Tary.Print cppname:amc.tfunc_Tary_Print comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_ReadStrptrMaybe acrkey:gstatic/amcdb.tfunc:Tary.ReadStrptrMaybe cppname:amc.tfunc_Tary_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Remove acrkey:gstatic/amcdb.tfunc:Tary.Remove cppname:amc.tfunc_Tary_Remove comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_RemoveAll acrkey:gstatic/amcdb.tfunc:Tary.RemoveAll cppname:amc.tfunc_Tary_RemoveAll comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_RemoveLast acrkey:gstatic/amcdb.tfunc:Tary.RemoveLast cppname:amc.tfunc_Tary_RemoveLast comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Reserve acrkey:gstatic/amcdb.tfunc:Tary.Reserve cppname:amc.tfunc_Tary_Reserve comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_RowidFind acrkey:gstatic/amcdb.tfunc:Tary.RowidFind cppname:amc.tfunc_Tary_RowidFind comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Setary acrkey:gstatic/amcdb.tfunc:Tary.Setary cppname:amc.tfunc_Tary_Setary comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Setary2 acrkey:gstatic/amcdb.tfunc:Tary.Setary2 cppname:amc.tfunc_Tary_Setary2 comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_Uninit acrkey:gstatic/amcdb.tfunc:Tary.Uninit cppname:amc.tfunc_Tary_Uninit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_curs acrkey:gstatic/amcdb.tfunc:Tary.curs cppname:amc.tfunc_Tary_curs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_qFind acrkey:gstatic/amcdb.tfunc:Tary.qFind cppname:amc.tfunc_Tary_qFind comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_qLast acrkey:gstatic/amcdb.tfunc:Tary.qLast cppname:amc.tfunc_Tary_qLast comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tary_rowid_Get acrkey:gstatic/amcdb.tfunc:Tary.rowid_Get cppname:amc.tfunc_Tary_rowid_Get comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_AbsReserve acrkey:gstatic/amcdb.tfunc:Thash.AbsReserve cppname:amc.tfunc_Thash_AbsReserve comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_Cascdel acrkey:gstatic/amcdb.tfunc:Thash.Cascdel cppname:amc.tfunc_Thash_Cascdel comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_EmptyQ acrkey:gstatic/amcdb.tfunc:Thash.EmptyQ cppname:amc.tfunc_Thash_EmptyQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_Find acrkey:gstatic/amcdb.tfunc:Thash.Find cppname:amc.tfunc_Thash_Find comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_FindRemove acrkey:gstatic/amcdb.tfunc:Thash.FindRemove cppname:amc.tfunc_Thash_FindRemove comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_FindX acrkey:gstatic/amcdb.tfunc:Thash.FindX cppname:amc.tfunc_Thash_FindX comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_GetOrCreate acrkey:gstatic/amcdb.tfunc:Thash.GetOrCreate cppname:amc.tfunc_Thash_GetOrCreate comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_Init acrkey:gstatic/amcdb.tfunc:Thash.Init cppname:amc.tfunc_Thash_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_InsertMaybe acrkey:gstatic/amcdb.tfunc:Thash.InsertMaybe cppname:amc.tfunc_Thash_InsertMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_N acrkey:gstatic/amcdb.tfunc:Thash.N cppname:amc.tfunc_Thash_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_Remove acrkey:gstatic/amcdb.tfunc:Thash.Remove cppname:amc.tfunc_Thash_Remove comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_Reserve acrkey:gstatic/amcdb.tfunc:Thash.Reserve cppname:amc.tfunc_Thash_Reserve comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_Uninit acrkey:gstatic/amcdb.tfunc:Thash.Uninit cppname:amc.tfunc_Thash_Uninit comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Thash_curs acrkey:gstatic/amcdb.tfunc:Thash.curs cppname:amc.tfunc_Thash_curs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tpool_AllocMem acrkey:gstatic/amcdb.tfunc:Tpool.AllocMem cppname:amc.tfunc_Tpool_AllocMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tpool_FreeMem acrkey:gstatic/amcdb.tfunc:Tpool.FreeMem cppname:amc.tfunc_Tpool_FreeMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tpool_Init acrkey:gstatic/amcdb.tfunc:Tpool.Init cppname:amc.tfunc_Tpool_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tpool_Reserve acrkey:gstatic/amcdb.tfunc:Tpool.Reserve cppname:amc.tfunc_Tpool_Reserve comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Tpool_ReserveMem acrkey:gstatic/amcdb.tfunc:Tpool.ReserveMem cppname:amc.tfunc_Tpool_ReserveMem comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Upptr_Init acrkey:gstatic/amcdb.tfunc:Upptr.Init cppname:amc.tfunc_Upptr_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Val_Get acrkey:gstatic/amcdb.tfunc:Val.Get cppname:amc.tfunc_Val_Get comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Val_Init acrkey:gstatic/amcdb.tfunc:Val.Init cppname:amc.tfunc_Val_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Val_N acrkey:gstatic/amcdb.tfunc:Val.N cppname:amc.tfunc_Val_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Val_RowidFind acrkey:gstatic/amcdb.tfunc:Val.RowidFind cppname:amc.tfunc_Val_RowidFind comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Val_Set acrkey:gstatic/amcdb.tfunc:Val.Set cppname:amc.tfunc_Val_Set comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Varlen_Addr acrkey:gstatic/amcdb.tfunc:Varlen.Addr cppname:amc.tfunc_Varlen_Addr comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Varlen_Getary acrkey:gstatic/amcdb.tfunc:Varlen.Getary cppname:amc.tfunc_Varlen_Getary comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Varlen_Init acrkey:gstatic/amcdb.tfunc:Varlen.Init cppname:amc.tfunc_Varlen_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Varlen_N acrkey:gstatic/amcdb.tfunc:Varlen.N cppname:amc.tfunc_Varlen_N comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Varlen_Print acrkey:gstatic/amcdb.tfunc:Varlen.Print cppname:amc.tfunc_Varlen_Print comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Varlen_ReadStrptrMaybe acrkey:gstatic/amcdb.tfunc:Varlen.ReadStrptrMaybe cppname:amc.tfunc_Varlen_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:amc...tfunc_Varlen_curs acrkey:gstatic/amcdb.tfunc:Varlen.curs cppname:amc.tfunc_Varlen_curs comment:"" +dmmeta.userfunc userfunc:amc...tfunc_ZSListMT_DestructiveFirst acrkey:gstatic/amcdb.tfunc:ZSListMT.DestructiveFirst cppname:amc.tfunc_ZSListMT_DestructiveFirst comment:"" +dmmeta.userfunc userfunc:amc...tfunc_ZSListMT_InLlistQ acrkey:gstatic/amcdb.tfunc:ZSListMT.InLlistQ cppname:amc.tfunc_ZSListMT_InLlistQ comment:"" +dmmeta.userfunc userfunc:amc...tfunc_ZSListMT_Init acrkey:gstatic/amcdb.tfunc:ZSListMT.Init cppname:amc.tfunc_ZSListMT_Init comment:"" +dmmeta.userfunc userfunc:amc...tfunc_ZSListMT_Insert acrkey:gstatic/amcdb.tfunc:ZSListMT.Insert cppname:amc.tfunc_ZSListMT_Insert comment:"" +dmmeta.userfunc userfunc:amc...tfunc_ZSListMT_Remove acrkey:gstatic/amcdb.tfunc:ZSListMT.Remove cppname:amc.tfunc_ZSListMT_Remove comment:"" +dmmeta.userfunc userfunc:amc...tfunc_ZSListMT_RemoveFirst acrkey:gstatic/amcdb.tfunc:ZSListMT.RemoveFirst cppname:amc.tfunc_ZSListMT_RemoveFirst comment:"" +dmmeta.userfunc userfunc:amc.FDb._db.Main acrkey:main:amc cppname:amc.Main comment:"" +dmmeta.userfunc userfunc:amc_gc.FDb._db.Main acrkey:main:amc_gc cppname:amc_gc.Main comment:"" +dmmeta.userfunc userfunc:amc_vis.FDb._db.Main acrkey:main:amc_vis cppname:amc_vis.Main comment:"" +dmmeta.userfunc userfunc:ams_sendtest.FDb._db.Main acrkey:main:ams_sendtest cppname:ams_sendtest.Main comment:"" +dmmeta.userfunc userfunc:apm.FDb._db.Main acrkey:main:apm cppname:apm.Main comment:"" +dmmeta.userfunc userfunc:aqlite.FDb._db.Main acrkey:main:aqlite cppname:aqlite.Main comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_AmcSort acrkey:gstatic/atfdb.amctest:AmcSort cppname:atf_amc.amctest_AmcSort comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BhFirstChanged1 acrkey:gstatic/atfdb.amctest:BhFirstChanged1 cppname:atf_amc.amctest_BhFirstChanged1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BhFirstChanged2 acrkey:gstatic/atfdb.amctest:BhFirstChanged2 cppname:atf_amc.amctest_BhFirstChanged2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BhFirstChanged3 acrkey:gstatic/atfdb.amctest:BhFirstChanged3 cppname:atf_amc.amctest_BhFirstChanged3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BheapCursor acrkey:gstatic/atfdb.amctest:BheapCursor cppname:atf_amc.amctest_BheapCursor comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BheapInsert100 acrkey:gstatic/atfdb.amctest:BheapInsert100 cppname:atf_amc.amctest_BheapInsert100 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BigEndian acrkey:gstatic/atfdb.amctest:BigEndian cppname:atf_amc.amctest_BigEndian comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BigendFconst acrkey:gstatic/atfdb.amctest:BigendFconst cppname:atf_amc.amctest_BigendFconst comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BitfldBitset acrkey:gstatic/atfdb.amctest:BitfldBitset cppname:atf_amc.amctest_BitfldBitset comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BitfldNet acrkey:gstatic/atfdb.amctest:BitfldNet cppname:atf_amc.amctest_BitfldNet comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BitfldTuple acrkey:gstatic/atfdb.amctest:BitfldTuple cppname:atf_amc.amctest_BitfldTuple comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BitsetBitcurs acrkey:gstatic/atfdb.amctest:BitsetBitcurs cppname:atf_amc.amctest_BitsetBitcurs comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BitsetInlary16 acrkey:gstatic/atfdb.amctest:BitsetInlary16 cppname:atf_amc.amctest_BitsetInlary16 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BitsetTary64 acrkey:gstatic/atfdb.amctest:BitsetTary64 cppname:atf_amc.amctest_BitsetTary64 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BitsetVal128 acrkey:gstatic/atfdb.amctest:BitsetVal128 cppname:atf_amc.amctest_BitsetVal128 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BitsetVal64 acrkey:gstatic/atfdb.amctest:BitsetVal64 cppname:atf_amc.amctest_BitsetVal64 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_BitsetVal8 acrkey:gstatic/atfdb.amctest:BitsetVal8 cppname:atf_amc.amctest_BitsetVal8 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelAtree acrkey:gstatic/atfdb.amctest:CascdelAtree cppname:atf_amc.amctest_CascdelAtree comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelBheap acrkey:gstatic/atfdb.amctest:CascdelBheap cppname:atf_amc.amctest_CascdelBheap comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelBheapChain acrkey:gstatic/atfdb.amctest:CascdelBheapChain cppname:atf_amc.amctest_CascdelBheapChain comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelPtr acrkey:gstatic/atfdb.amctest:CascdelPtr cppname:atf_amc.amctest_CascdelPtr comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelPtrary acrkey:gstatic/atfdb.amctest:CascdelPtrary cppname:atf_amc.amctest_CascdelPtrary comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelPtraryChain acrkey:gstatic/atfdb.amctest:CascdelPtraryChain cppname:atf_amc.amctest_CascdelPtraryChain comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelThash acrkey:gstatic/atfdb.amctest:CascdelThash cppname:atf_amc.amctest_CascdelThash comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelThashChain acrkey:gstatic/atfdb.amctest:CascdelThashChain cppname:atf_amc.amctest_CascdelThashChain comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelZdlist acrkey:gstatic/atfdb.amctest:CascdelZdlist cppname:atf_amc.amctest_CascdelZdlist comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelZdlistChain acrkey:gstatic/atfdb.amctest:CascdelZdlistChain cppname:atf_amc.amctest_CascdelZdlistChain comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelZslist acrkey:gstatic/atfdb.amctest:CascdelZslist cppname:atf_amc.amctest_CascdelZslist comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CascdelZslistChain acrkey:gstatic/atfdb.amctest:CascdelZslistChain cppname:atf_amc.amctest_CascdelZslistChain comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CastDown acrkey:gstatic/atfdb.amctest:CastDown cppname:atf_amc.amctest_CastDown comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CastDownFail acrkey:gstatic/atfdb.amctest:CastDownFail cppname:atf_amc.amctest_CastDownFail comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CastDownTooShort acrkey:gstatic/atfdb.amctest:CastDownTooShort cppname:atf_amc.amctest_CastDownTooShort comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CastUp acrkey:gstatic/atfdb.amctest:CastUp cppname:atf_amc.amctest_CastUp comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistDfltCtor acrkey:gstatic/atfdb.amctest:CdlistDfltCtor cppname:atf_amc.amctest_CdlistDfltCtor comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistFlush100 acrkey:gstatic/atfdb.amctest:CdlistFlush100 cppname:atf_amc.amctest_CdlistFlush100 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistFlushEmpty acrkey:gstatic/atfdb.amctest:CdlistFlushEmpty cppname:atf_amc.amctest_CdlistFlushEmpty comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistInsert1 acrkey:gstatic/atfdb.amctest:CdlistInsert1 cppname:atf_amc.amctest_CdlistInsert1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistInsert2 acrkey:gstatic/atfdb.amctest:CdlistInsert2 cppname:atf_amc.amctest_CdlistInsert2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistInsert3 acrkey:gstatic/atfdb.amctest:CdlistInsert3 cppname:atf_amc.amctest_CdlistInsert3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistInsertHead1 acrkey:gstatic/atfdb.amctest:CdlistInsertHead1 cppname:atf_amc.amctest_CdlistInsertHead1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistInsertHead2 acrkey:gstatic/atfdb.amctest:CdlistInsertHead2 cppname:atf_amc.amctest_CdlistInsertHead2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistInsertHead3 acrkey:gstatic/atfdb.amctest:CdlistInsertHead3 cppname:atf_amc.amctest_CdlistInsertHead3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistInsertMaybe acrkey:gstatic/atfdb.amctest:CdlistInsertMaybe cppname:atf_amc.amctest_CdlistInsertMaybe comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistItemDfltCtor acrkey:gstatic/atfdb.amctest:CdlistItemDfltCtor cppname:atf_amc.amctest_CdlistItemDfltCtor comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistRemove acrkey:gstatic/atfdb.amctest:CdlistRemove cppname:atf_amc.amctest_CdlistRemove comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistRemoveFirst acrkey:gstatic/atfdb.amctest:CdlistRemoveFirst cppname:atf_amc.amctest_CdlistRemoveFirst comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CdlistRotateFirst acrkey:gstatic/atfdb.amctest:CdlistRotateFirst cppname:atf_amc.amctest_CdlistRotateFirst comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CleanupOrder acrkey:gstatic/atfdb.amctest:CleanupOrder cppname:atf_amc.amctest_CleanupOrder comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CopyOut1 acrkey:gstatic/atfdb.amctest:CopyOut1 cppname:atf_amc.amctest_CopyOut1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CopyOut2 acrkey:gstatic/atfdb.amctest:CopyOut2 cppname:atf_amc.amctest_CopyOut2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CopyOut3 acrkey:gstatic/atfdb.amctest:CopyOut3 cppname:atf_amc.amctest_CopyOut3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistFirstChangedFlush acrkey:gstatic/atfdb.amctest:CslistFirstChangedFlush cppname:atf_amc.amctest_CslistFirstChangedFlush comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistFirstChangedInsert acrkey:gstatic/atfdb.amctest:CslistFirstChangedInsert cppname:atf_amc.amctest_CslistFirstChangedInsert comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistFirstChangedRemove acrkey:gstatic/atfdb.amctest:CslistFirstChangedRemove cppname:atf_amc.amctest_CslistFirstChangedRemove comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistFirstChangedRemoveFirst acrkey:gstatic/atfdb.amctest:CslistFirstChangedRemoveFirst cppname:atf_amc.amctest_CslistFirstChangedRemoveFirst comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistHeadFirstChangedInsert acrkey:gstatic/atfdb.amctest:CslistHeadFirstChangedInsert cppname:atf_amc.amctest_CslistHeadFirstChangedInsert comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistInsert1 acrkey:gstatic/atfdb.amctest:CslistInsert1 cppname:atf_amc.amctest_CslistInsert1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistInsert2 acrkey:gstatic/atfdb.amctest:CslistInsert2 cppname:atf_amc.amctest_CslistInsert2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistInsert3 acrkey:gstatic/atfdb.amctest:CslistInsert3 cppname:atf_amc.amctest_CslistInsert3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistInsertHead1 acrkey:gstatic/atfdb.amctest:CslistInsertHead1 cppname:atf_amc.amctest_CslistInsertHead1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistInsertHead2 acrkey:gstatic/atfdb.amctest:CslistInsertHead2 cppname:atf_amc.amctest_CslistInsertHead2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistInsertHead3 acrkey:gstatic/atfdb.amctest:CslistInsertHead3 cppname:atf_amc.amctest_CslistInsertHead3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistRemove acrkey:gstatic/atfdb.amctest:CslistRemove cppname:atf_amc.amctest_CslistRemove comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistRemoveFirst acrkey:gstatic/atfdb.amctest:CslistRemoveFirst cppname:atf_amc.amctest_CslistRemoveFirst comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_CslistRotateFirst acrkey:gstatic/atfdb.amctest:CslistRotateFirst cppname:atf_amc.amctest_CslistRotateFirst comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Delptr acrkey:gstatic/atfdb.amctest:Delptr cppname:atf_amc.amctest_Delptr comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_DispRead1 acrkey:gstatic/atfdb.amctest:DispRead1 cppname:atf_amc.amctest_DispRead1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_DispRead2 acrkey:gstatic/atfdb.amctest:DispRead2 cppname:atf_amc.amctest_DispRead2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_DispRead3 acrkey:gstatic/atfdb.amctest:DispRead3 cppname:atf_amc.amctest_DispRead3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_DispRead4 acrkey:gstatic/atfdb.amctest:DispRead4 cppname:atf_amc.amctest_DispRead4 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_DispReadSsimfile acrkey:gstatic/atfdb.amctest:DispReadSsimfile cppname:atf_amc.amctest_DispReadSsimfile comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ExecSh acrkey:gstatic/atfdb.amctest:ExecSh cppname:atf_amc.amctest_ExecSh comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ExecVerbose acrkey:gstatic/atfdb.amctest:ExecVerbose cppname:atf_amc.amctest_ExecVerbose comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Exec_Status acrkey:gstatic/atfdb.amctest:Exec_Status cppname:atf_amc.amctest_Exec_Status comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Fcmp acrkey:gstatic/atfdb.amctest:Fcmp cppname:atf_amc.amctest_Fcmp comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Fconst acrkey:gstatic/atfdb.amctest:Fconst cppname:atf_amc.amctest_Fconst comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Gsymbol acrkey:gstatic/atfdb.amctest:Gsymbol cppname:atf_amc.amctest_Gsymbol comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Hook1 acrkey:gstatic/atfdb.amctest:Hook1 cppname:atf_amc.amctest_Hook1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Hook2 acrkey:gstatic/atfdb.amctest:Hook2 cppname:atf_amc.amctest_Hook2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ImdXref acrkey:gstatic/atfdb.amctest:ImdXref cppname:atf_amc.amctest_ImdXref comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Inlary_ReadPrint acrkey:gstatic/atfdb.amctest:Inlary_ReadPrint cppname:atf_amc.amctest_Inlary_ReadPrint comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_LaryFind acrkey:gstatic/atfdb.amctest:LaryFind cppname:atf_amc.amctest_LaryFind comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_LineIter acrkey:gstatic/atfdb.amctest:LineIter cppname:atf_amc.amctest_LineIter comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Lpool acrkey:gstatic/atfdb.amctest:Lpool cppname:atf_amc.amctest_Lpool comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_LpoolLockMem acrkey:gstatic/atfdb.amctest:LpoolLockMem cppname:atf_amc.amctest_LpoolLockMem comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Minmax acrkey:gstatic/atfdb.amctest:Minmax cppname:atf_amc.amctest_Minmax comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_MsgCurs acrkey:gstatic/atfdb.amctest:MsgCurs cppname:atf_amc.amctest_MsgCurs comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_MsgCurs2 acrkey:gstatic/atfdb.amctest:MsgCurs2 cppname:atf_amc.amctest_MsgCurs2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_MsgCurs3 acrkey:gstatic/atfdb.amctest:MsgCurs3 cppname:atf_amc.amctest_MsgCurs3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_MsgCurs4 acrkey:gstatic/atfdb.amctest:MsgCurs4 cppname:atf_amc.amctest_MsgCurs4 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_MsgLength acrkey:gstatic/atfdb.amctest:MsgLength cppname:atf_amc.amctest_MsgLength comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Numstr acrkey:gstatic/atfdb.amctest:Numstr cppname:atf_amc.amctest_Numstr comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_NumstrCorruption acrkey:gstatic/atfdb.amctest:NumstrCorruption cppname:atf_amc.amctest_NumstrCorruption comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptAlloc acrkey:gstatic/atfdb.amctest:OptAlloc cppname:atf_amc.amctest_OptAlloc comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptG acrkey:gstatic/atfdb.amctest:OptG cppname:atf_amc.amctest_OptG comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptG2 acrkey:gstatic/atfdb.amctest:OptG2 cppname:atf_amc.amctest_OptG2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptG8 acrkey:gstatic/atfdb.amctest:OptG8 cppname:atf_amc.amctest_OptG8 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptG9 acrkey:gstatic/atfdb.amctest:OptG9 cppname:atf_amc.amctest_OptG9 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptOptG10 acrkey:gstatic/atfdb.amctest:OptOptG10 cppname:atf_amc.amctest_OptOptG10 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptOptG3 acrkey:gstatic/atfdb.amctest:OptOptG3 cppname:atf_amc.amctest_OptOptG3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptOptG4 acrkey:gstatic/atfdb.amctest:OptOptG4 cppname:atf_amc.amctest_OptOptG4 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptOptG5 acrkey:gstatic/atfdb.amctest:OptOptG5 cppname:atf_amc.amctest_OptOptG5 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptOptG6 acrkey:gstatic/atfdb.amctest:OptOptG6 cppname:atf_amc.amctest_OptOptG6 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptOptG7 acrkey:gstatic/atfdb.amctest:OptOptG7 cppname:atf_amc.amctest_OptOptG7 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptOptG8 acrkey:gstatic/atfdb.amctest:OptOptG8 cppname:atf_amc.amctest_OptOptG8 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_OptOptG9 acrkey:gstatic/atfdb.amctest:OptOptG9 cppname:atf_amc.amctest_OptOptG9 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_PerfSortString acrkey:gstatic/atfdb.amctest:PerfSortString cppname:atf_amc.amctest_PerfSortString comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_PerfThashRemove acrkey:gstatic/atfdb.amctest:PerfThashRemove cppname:atf_amc.amctest_PerfThashRemove comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_PmaskMultiple acrkey:gstatic/atfdb.amctest:PmaskMultiple cppname:atf_amc.amctest_PmaskMultiple comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_PrintBase36 acrkey:gstatic/atfdb.amctest:PrintBase36 cppname:atf_amc.amctest_PrintBase36 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_PrintRawGconst acrkey:gstatic/atfdb.amctest:PrintRawGconst cppname:atf_amc.amctest_PrintRawGconst comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_PtraryCursor acrkey:gstatic/atfdb.amctest:PtraryCursor cppname:atf_amc.amctest_PtraryCursor comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_PtraryHeaplike acrkey:gstatic/atfdb.amctest:PtraryHeaplike cppname:atf_amc.amctest_PtraryHeaplike comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_PtraryInsert acrkey:gstatic/atfdb.amctest:PtraryInsert cppname:atf_amc.amctest_PtraryInsert comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_PtraryNonUnique acrkey:gstatic/atfdb.amctest:PtraryNonUnique cppname:atf_amc.amctest_PtraryNonUnique comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ReadProc acrkey:gstatic/atfdb.amctest:ReadProc cppname:atf_amc.amctest_ReadProc comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ReadTuple1 acrkey:gstatic/atfdb.amctest:ReadTuple1 cppname:atf_amc.amctest_ReadTuple1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ReadTuple2 acrkey:gstatic/atfdb.amctest:ReadTuple2 cppname:atf_amc.amctest_ReadTuple2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ReadTuple2a acrkey:gstatic/atfdb.amctest:ReadTuple2a cppname:atf_amc.amctest_ReadTuple2a comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ReadTuple3 acrkey:gstatic/atfdb.amctest:ReadTuple3 cppname:atf_amc.amctest_ReadTuple3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ReadTuple4 acrkey:gstatic/atfdb.amctest:ReadTuple4 cppname:atf_amc.amctest_ReadTuple4 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ReadTuple5 acrkey:gstatic/atfdb.amctest:ReadTuple5 cppname:atf_amc.amctest_ReadTuple5 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Scratch acrkey:gstatic/atfdb.amctest:Scratch cppname:atf_amc.amctest_Scratch comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_SetGetnumBase10 acrkey:gstatic/atfdb.amctest:SetGetnumBase10 cppname:atf_amc.amctest_SetGetnumBase10 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_SubstrDfltval acrkey:gstatic/atfdb.amctest:SubstrDfltval cppname:atf_amc.amctest_SubstrDfltval comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TaryAllocNAt acrkey:gstatic/atfdb.amctest:TaryAllocNAt cppname:atf_amc.amctest_TaryAllocNAt comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TaryHash acrkey:gstatic/atfdb.amctest:TaryHash cppname:atf_amc.amctest_TaryHash comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TaryInit acrkey:gstatic/atfdb.amctest:TaryInit cppname:atf_amc.amctest_TaryInit comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TaryInit2 acrkey:gstatic/atfdb.amctest:TaryInit2 cppname:atf_amc.amctest_TaryInit2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TaryInit3 acrkey:gstatic/atfdb.amctest:TaryInit3 cppname:atf_amc.amctest_TaryInit3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TaryInit4 acrkey:gstatic/atfdb.amctest:TaryInit4 cppname:atf_amc.amctest_TaryInit4 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TaryInsary acrkey:gstatic/atfdb.amctest:TaryInsary cppname:atf_amc.amctest_TaryInsary comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TaryReserve acrkey:gstatic/atfdb.amctest:TaryReserve cppname:atf_amc.amctest_TaryReserve comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestBitfld acrkey:gstatic/atfdb.amctest:TestBitfld cppname:atf_amc.amctest_TestBitfld comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestBitfld2 acrkey:gstatic/atfdb.amctest:TestBitfld2 cppname:atf_amc.amctest_TestBitfld2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestCstring1 acrkey:gstatic/atfdb.amctest:TestCstring1 cppname:atf_amc.amctest_TestCstring1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestCstring2 acrkey:gstatic/atfdb.amctest:TestCstring2 cppname:atf_amc.amctest_TestCstring2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestDispFilter acrkey:gstatic/atfdb.amctest:TestDispFilter cppname:atf_amc.amctest_TestDispFilter comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestDispFilter2 acrkey:gstatic/atfdb.amctest:TestDispFilter2 cppname:atf_amc.amctest_TestDispFilter2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestDispFilter3 acrkey:gstatic/atfdb.amctest:TestDispFilter3 cppname:atf_amc.amctest_TestDispFilter3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestDispFilter4 acrkey:gstatic/atfdb.amctest:TestDispFilter4 cppname:atf_amc.amctest_TestDispFilter4 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestInsertX2 acrkey:gstatic/atfdb.amctest:TestInsertX2 cppname:atf_amc.amctest_TestInsertX2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestInsertX3 acrkey:gstatic/atfdb.amctest:TestInsertX3 cppname:atf_amc.amctest_TestInsertX3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestPmask1 acrkey:gstatic/atfdb.amctest:TestPmask1 cppname:atf_amc.amctest_TestPmask1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestPmask2 acrkey:gstatic/atfdb.amctest:TestPmask2 cppname:atf_amc.amctest_TestPmask2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestPmask3 acrkey:gstatic/atfdb.amctest:TestPmask3 cppname:atf_amc.amctest_TestPmask3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestPmask4 acrkey:gstatic/atfdb.amctest:TestPmask4 cppname:atf_amc.amctest_TestPmask4 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestPmask5 acrkey:gstatic/atfdb.amctest:TestPmask5 cppname:atf_amc.amctest_TestPmask5 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestPmask6 acrkey:gstatic/atfdb.amctest:TestPmask6 cppname:atf_amc.amctest_TestPmask6 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestPmask7 acrkey:gstatic/atfdb.amctest:TestPmask7 cppname:atf_amc.amctest_TestPmask7 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestPmask8 acrkey:gstatic/atfdb.amctest:TestPmask8 cppname:atf_amc.amctest_TestPmask8 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestRegx1 acrkey:gstatic/atfdb.amctest:TestRegx1 cppname:atf_amc.amctest_TestRegx1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestSep1 acrkey:gstatic/atfdb.amctest:TestSep1 cppname:atf_amc.amctest_TestSep1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestSep2 acrkey:gstatic/atfdb.amctest:TestSep2 cppname:atf_amc.amctest_TestSep2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_TestString acrkey:gstatic/atfdb.amctest:TestString cppname:atf_amc.amctest_TestString comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ThashEmpty acrkey:gstatic/atfdb.amctest:ThashEmpty cppname:atf_amc.amctest_ThashEmpty comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ThashFindRemove acrkey:gstatic/atfdb.amctest:ThashFindRemove cppname:atf_amc.amctest_ThashFindRemove comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ThashGetOrCreate acrkey:gstatic/atfdb.amctest:ThashGetOrCreate cppname:atf_amc.amctest_ThashGetOrCreate comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ThashInsertMaybe acrkey:gstatic/atfdb.amctest:ThashInsertMaybe cppname:atf_amc.amctest_ThashInsertMaybe comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ThashLinear acrkey:gstatic/atfdb.amctest:ThashLinear cppname:atf_amc.amctest_ThashLinear comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ThashRemove acrkey:gstatic/atfdb.amctest:ThashRemove cppname:atf_amc.amctest_ThashRemove comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ThashStrkey acrkey:gstatic/atfdb.amctest:ThashStrkey cppname:atf_amc.amctest_ThashStrkey comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ThashXref acrkey:gstatic/atfdb.amctest:ThashXref cppname:atf_amc.amctest_ThashXref comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Typetag acrkey:gstatic/atfdb.amctest:Typetag cppname:atf_amc.amctest_Typetag comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Varlen2 acrkey:gstatic/atfdb.amctest:Varlen2 cppname:atf_amc.amctest_Varlen2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Varlen2a acrkey:gstatic/atfdb.amctest:Varlen2a cppname:atf_amc.amctest_Varlen2a comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Varlen2m acrkey:gstatic/atfdb.amctest:Varlen2m cppname:atf_amc.amctest_Varlen2m comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Varlen2v acrkey:gstatic/atfdb.amctest:Varlen2v cppname:atf_amc.amctest_Varlen2v comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_VarlenAlloc acrkey:gstatic/atfdb.amctest:VarlenAlloc cppname:atf_amc.amctest_VarlenAlloc comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_VarlenExternLength acrkey:gstatic/atfdb.amctest:VarlenExternLength cppname:atf_amc.amctest_VarlenExternLength comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_VarlenMsgs acrkey:gstatic/atfdb.amctest:VarlenMsgs cppname:atf_amc.amctest_VarlenMsgs comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_VarlenMsgsPnew acrkey:gstatic/atfdb.amctest:VarlenMsgsPnew cppname:atf_amc.amctest_VarlenMsgsPnew comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistDelCurs acrkey:gstatic/atfdb.amctest:ZdlistDelCurs cppname:atf_amc.amctest_ZdlistDelCurs comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistDfltCtor acrkey:gstatic/atfdb.amctest:ZdlistDfltCtor cppname:atf_amc.amctest_ZdlistDfltCtor comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistFlush100 acrkey:gstatic/atfdb.amctest:ZdlistFlush100 cppname:atf_amc.amctest_ZdlistFlush100 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistFlushEmpty acrkey:gstatic/atfdb.amctest:ZdlistFlushEmpty cppname:atf_amc.amctest_ZdlistFlushEmpty comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistInsert1 acrkey:gstatic/atfdb.amctest:ZdlistInsert1 cppname:atf_amc.amctest_ZdlistInsert1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistInsert2 acrkey:gstatic/atfdb.amctest:ZdlistInsert2 cppname:atf_amc.amctest_ZdlistInsert2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistInsert3 acrkey:gstatic/atfdb.amctest:ZdlistInsert3 cppname:atf_amc.amctest_ZdlistInsert3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistInsertHead1 acrkey:gstatic/atfdb.amctest:ZdlistInsertHead1 cppname:atf_amc.amctest_ZdlistInsertHead1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistInsertHead2 acrkey:gstatic/atfdb.amctest:ZdlistInsertHead2 cppname:atf_amc.amctest_ZdlistInsertHead2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistInsertHead3 acrkey:gstatic/atfdb.amctest:ZdlistInsertHead3 cppname:atf_amc.amctest_ZdlistInsertHead3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistInsertHeadNoTail1 acrkey:gstatic/atfdb.amctest:ZdlistInsertHeadNoTail1 cppname:atf_amc.amctest_ZdlistInsertHeadNoTail1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistInsertHeadNoTail2 acrkey:gstatic/atfdb.amctest:ZdlistInsertHeadNoTail2 cppname:atf_amc.amctest_ZdlistInsertHeadNoTail2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistInsertHeadNoTail3 acrkey:gstatic/atfdb.amctest:ZdlistInsertHeadNoTail3 cppname:atf_amc.amctest_ZdlistInsertHeadNoTail3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistInsertMaybe acrkey:gstatic/atfdb.amctest:ZdlistInsertMaybe cppname:atf_amc.amctest_ZdlistInsertMaybe comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistItemDfltCtor acrkey:gstatic/atfdb.amctest:ZdlistItemDfltCtor cppname:atf_amc.amctest_ZdlistItemDfltCtor comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistRemove acrkey:gstatic/atfdb.amctest:ZdlistRemove cppname:atf_amc.amctest_ZdlistRemove comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZdlistRemoveFirst acrkey:gstatic/atfdb.amctest:ZdlistRemoveFirst cppname:atf_amc.amctest_ZdlistRemoveFirst comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistFirstChangedFlush acrkey:gstatic/atfdb.amctest:ZslistFirstChangedFlush cppname:atf_amc.amctest_ZslistFirstChangedFlush comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistFirstChangedInsert acrkey:gstatic/atfdb.amctest:ZslistFirstChangedInsert cppname:atf_amc.amctest_ZslistFirstChangedInsert comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistFirstChangedRemove acrkey:gstatic/atfdb.amctest:ZslistFirstChangedRemove cppname:atf_amc.amctest_ZslistFirstChangedRemove comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistFirstChangedRemoveFirst acrkey:gstatic/atfdb.amctest:ZslistFirstChangedRemoveFirst cppname:atf_amc.amctest_ZslistFirstChangedRemoveFirst comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistHeadFirstChangedInsert acrkey:gstatic/atfdb.amctest:ZslistHeadFirstChangedInsert cppname:atf_amc.amctest_ZslistHeadFirstChangedInsert comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistInsert1 acrkey:gstatic/atfdb.amctest:ZslistInsert1 cppname:atf_amc.amctest_ZslistInsert1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistInsert2 acrkey:gstatic/atfdb.amctest:ZslistInsert2 cppname:atf_amc.amctest_ZslistInsert2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistInsert3 acrkey:gstatic/atfdb.amctest:ZslistInsert3 cppname:atf_amc.amctest_ZslistInsert3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistInsertHead1 acrkey:gstatic/atfdb.amctest:ZslistInsertHead1 cppname:atf_amc.amctest_ZslistInsertHead1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistInsertHead2 acrkey:gstatic/atfdb.amctest:ZslistInsertHead2 cppname:atf_amc.amctest_ZslistInsertHead2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistInsertHead3 acrkey:gstatic/atfdb.amctest:ZslistInsertHead3 cppname:atf_amc.amctest_ZslistInsertHead3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistRemove acrkey:gstatic/atfdb.amctest:ZslistRemove cppname:atf_amc.amctest_ZslistRemove comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistRemoveFirst acrkey:gstatic/atfdb.amctest:ZslistRemoveFirst cppname:atf_amc.amctest_ZslistRemoveFirst comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Zslistmt1 acrkey:gstatic/atfdb.amctest:Zslistmt1 cppname:atf_amc.amctest_Zslistmt1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Zslistmt2 acrkey:gstatic/atfdb.amctest:Zslistmt2 cppname:atf_amc.amctest_Zslistmt2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_Zslistmt3 acrkey:gstatic/atfdb.amctest:Zslistmt3 cppname:atf_amc.amctest_Zslistmt3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistmtDfltCtor acrkey:gstatic/atfdb.amctest:ZslistmtDfltCtor cppname:atf_amc.amctest_ZslistmtDfltCtor comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_ZslistmtItemDfltCtor acrkey:gstatic/atfdb.amctest:ZslistmtItemDfltCtor cppname:atf_amc.amctest_ZslistmtItemDfltCtor comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_atree_RangeSearch acrkey:gstatic/atfdb.amctest:atree_RangeSearch cppname:atf_amc.amctest_atree_RangeSearch comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_atree_test1 acrkey:gstatic/atfdb.amctest:atree_test1 cppname:atf_amc.amctest_atree_test1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_atree_test2 acrkey:gstatic/atfdb.amctest:atree_test2 cppname:atf_amc.amctest_atree_test2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_bytebuf_dyn_test1 acrkey:gstatic/atfdb.amctest:bytebuf_dyn_test1 cppname:atf_amc.amctest_bytebuf_dyn_test1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_bytebuf_test1 acrkey:gstatic/atfdb.amctest:bytebuf_test1 cppname:atf_amc.amctest_bytebuf_test1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_bytebuf_test2 acrkey:gstatic/atfdb.amctest:bytebuf_test2 cppname:atf_amc.amctest_bytebuf_test2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_fstep_Inline acrkey:gstatic/atfdb.amctest:fstep_Inline cppname:atf_amc.amctest_fstep_Inline comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_fstep_InlineOnce acrkey:gstatic/atfdb.amctest:fstep_InlineOnce cppname:atf_amc.amctest_fstep_InlineOnce comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_fstep_InlineRecur acrkey:gstatic/atfdb.amctest:fstep_InlineRecur cppname:atf_amc.amctest_fstep_InlineRecur comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_fstep_TimeHookOnce acrkey:gstatic/atfdb.amctest:fstep_TimeHookOnce cppname:atf_amc.amctest_fstep_TimeHookOnce comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_fstep_TimeHookRecur acrkey:gstatic/atfdb.amctest:fstep_TimeHookRecur cppname:atf_amc.amctest_fstep_TimeHookRecur comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_linebuf_test1 acrkey:gstatic/atfdb.amctest:linebuf_test1 cppname:atf_amc.amctest_linebuf_test1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_linebuf_test2 acrkey:gstatic/atfdb.amctest:linebuf_test2 cppname:atf_amc.amctest_linebuf_test2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_linebuf_test3 acrkey:gstatic/atfdb.amctest:linebuf_test3 cppname:atf_amc.amctest_linebuf_test3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_linebuf_test4 acrkey:gstatic/atfdb.amctest:linebuf_test4 cppname:atf_amc.amctest_linebuf_test4 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_linebuf_test5 acrkey:gstatic/atfdb.amctest:linebuf_test5 cppname:atf_amc.amctest_linebuf_test5 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_custom acrkey:gstatic/atfdb.amctest:msgbuf_custom cppname:atf_amc.amctest_msgbuf_custom comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_extra_test acrkey:gstatic/atfdb.amctest:msgbuf_extra_test cppname:atf_amc.amctest_msgbuf_extra_test comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test0 acrkey:gstatic/atfdb.amctest:msgbuf_test0 cppname:atf_amc.amctest_msgbuf_test0 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test1 acrkey:gstatic/atfdb.amctest:msgbuf_test1 cppname:atf_amc.amctest_msgbuf_test1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test10 acrkey:gstatic/atfdb.amctest:msgbuf_test10 cppname:atf_amc.amctest_msgbuf_test10 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test1_1 acrkey:gstatic/atfdb.amctest:msgbuf_test1_1 cppname:atf_amc.amctest_msgbuf_test1_1 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test1_2 acrkey:gstatic/atfdb.amctest:msgbuf_test1_2 cppname:atf_amc.amctest_msgbuf_test1_2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test2 acrkey:gstatic/atfdb.amctest:msgbuf_test2 cppname:atf_amc.amctest_msgbuf_test2 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test3 acrkey:gstatic/atfdb.amctest:msgbuf_test3 cppname:atf_amc.amctest_msgbuf_test3 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test4 acrkey:gstatic/atfdb.amctest:msgbuf_test4 cppname:atf_amc.amctest_msgbuf_test4 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test5 acrkey:gstatic/atfdb.amctest:msgbuf_test5 cppname:atf_amc.amctest_msgbuf_test5 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test6 acrkey:gstatic/atfdb.amctest:msgbuf_test6 cppname:atf_amc.amctest_msgbuf_test6 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test7 acrkey:gstatic/atfdb.amctest:msgbuf_test7 cppname:atf_amc.amctest_msgbuf_test7 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test8 acrkey:gstatic/atfdb.amctest:msgbuf_test8 cppname:atf_amc.amctest_msgbuf_test8 comment:"" +dmmeta.userfunc userfunc:atf_amc...amctest_msgbuf_test9 acrkey:gstatic/atfdb.amctest:msgbuf_test9 cppname:atf_amc.amctest_msgbuf_test9 comment:"" +dmmeta.userfunc userfunc:atf_amc...listtype_cd acrkey:gstatic/dmmeta.listtype:cd cppname:atf_amc.listtype_cd comment:"" +dmmeta.userfunc userfunc:atf_amc...listtype_cdl acrkey:gstatic/dmmeta.listtype:cdl cppname:atf_amc.listtype_cdl comment:"" +dmmeta.userfunc userfunc:atf_amc...listtype_cs acrkey:gstatic/dmmeta.listtype:cs cppname:atf_amc.listtype_cs comment:"" +dmmeta.userfunc userfunc:atf_amc...listtype_csl acrkey:gstatic/dmmeta.listtype:csl cppname:atf_amc.listtype_csl comment:"" +dmmeta.userfunc userfunc:atf_amc...listtype_zd acrkey:gstatic/dmmeta.listtype:zd cppname:atf_amc.listtype_zd comment:"" +dmmeta.userfunc userfunc:atf_amc...listtype_zdl acrkey:gstatic/dmmeta.listtype:zdl cppname:atf_amc.listtype_zdl comment:"" +dmmeta.userfunc userfunc:atf_amc...listtype_zs acrkey:gstatic/dmmeta.listtype:zs cppname:atf_amc.listtype_zs comment:"" +dmmeta.userfunc userfunc:atf_amc...listtype_zsl acrkey:gstatic/dmmeta.listtype:zsl cppname:atf_amc.listtype_zsl comment:"" +dmmeta.userfunc userfunc:atf_amc.AmcCleanup2.field1.Cleanup acrkey:fcleanup:atf_amc.AmcCleanup2.field1 cppname:atf_amc.field1_Cleanup comment:"" +dmmeta.userfunc userfunc:atf_amc.AmcCleanup2.field2.Cleanup acrkey:fcleanup:atf_amc.AmcCleanup2.field2 cppname:atf_amc.field2_Cleanup comment:"" +dmmeta.userfunc userfunc:atf_amc.FCascdel.key.Cleanup acrkey:fcleanup:atf_amc.FCascdel.key cppname:atf_amc.key_Cleanup comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb._db.Main acrkey:main:atf_amc cppname:atf_amc.Main comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.bh_time_entry.Step acrkey:fstep:atf_amc.FDb.bh_time_entry cppname:atf_amc.bh_time_entry_Step comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.bh_typec.FirstChanged acrkey:"" cppname:atf_amc.bh_typec_FirstChanged comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.bh_typec.Step acrkey:fstep:atf_amc.FDb.bh_typec cppname:atf_amc.bh_typec_Step comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.cd_in_msg.Step acrkey:fstep:atf_amc.FDb.cd_in_msg cppname:atf_amc.cd_in_msg_Step comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.cs_t_typec.FirstChanged acrkey:"" cppname:atf_amc.cs_t_typec_FirstChanged comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.cs_t_typec.Step acrkey:fstep:atf_amc.FDb.cs_t_typec cppname:atf_amc.cs_t_typec_Step comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.csl_h_typec.FirstChanged acrkey:"" cppname:atf_amc.csl_h_typec_FirstChanged comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.csl_h_typec.Step acrkey:fstep:atf_amc.FDb.csl_h_typec cppname:atf_amc.csl_h_typec_Step comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.zs_t_typec.FirstChanged acrkey:"" cppname:atf_amc.zs_t_typec_FirstChanged comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.zs_t_typec.Step acrkey:fstep:atf_amc.FDb.zs_t_typec cppname:atf_amc.zs_t_typec_Step comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.zsl_h_typec.FirstChanged acrkey:"" cppname:atf_amc.zsl_h_typec_FirstChanged comment:"" +dmmeta.userfunc userfunc:atf_amc.FDb.zsl_h_typec.Step acrkey:fstep:atf_amc.FDb.zsl_h_typec cppname:atf_amc.zsl_h_typec_Step comment:"" +dmmeta.userfunc userfunc:atf_amc.Msgbuf.in_custom.ScanMsg acrkey:fbuf:atf_amc.Msgbuf.in_custom cppname:atf_amc.in_custom_ScanMsg comment:"" +dmmeta.userfunc userfunc:atf_amc.VarlenExtern.length.Get acrkey:"" cppname:atf_amc.length_Get comment:"" +dmmeta.userfunc userfunc:atf_amc.VarlenExtern.length.Set acrkey:cppfunc:atf_amc.VarlenExtern.length cppname:atf_amc.length_Set comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_abt_md_after_ssimfile_is_added acrkey:gstatic/atfdb.citest:abt_md_after_ssimfile_is_added cppname:atf_ci.citest_abt_md_after_ssimfile_is_added comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_acr_ed_ssimdb acrkey:gstatic/atfdb.citest:acr_ed_ssimdb cppname:atf_ci.citest_acr_ed_ssimdb comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_acr_ed_ssimfile acrkey:gstatic/atfdb.citest:acr_ed_ssimfile cppname:atf_ci.citest_acr_ed_ssimfile comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_acr_ed_target acrkey:gstatic/atfdb.citest:acr_ed_target cppname:atf_ci.citest_acr_ed_target comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_acr_ed_unittest acrkey:gstatic/atfdb.citest:acr_ed_unittest cppname:atf_ci.citest_acr_ed_unittest comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_amc acrkey:gstatic/atfdb.citest:amc cppname:atf_ci.citest_amc comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_apm acrkey:gstatic/atfdb.citest:apm cppname:atf_ci.citest_apm comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_apm_check acrkey:gstatic/atfdb.citest:apm_check cppname:atf_ci.citest_apm_check comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_apm_reinstall acrkey:gstatic/atfdb.citest:apm_reinstall cppname:atf_ci.citest_apm_reinstall comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_atf_amc acrkey:gstatic/atfdb.citest:atf_amc cppname:atf_ci.citest_atf_amc comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_atf_comp acrkey:gstatic/atfdb.citest:atf_comp cppname:atf_ci.citest_atf_comp comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_atf_comp_cov acrkey:gstatic/atfdb.citest:atf_comp_cov cppname:atf_ci.citest_atf_comp_cov comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_atf_comp_mem acrkey:gstatic/atfdb.citest:atf_comp_mem cppname:atf_ci.citest_atf_comp_mem comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_atf_unit acrkey:gstatic/atfdb.citest:atf_unit cppname:atf_ci.citest_atf_unit comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_bintests acrkey:gstatic/atfdb.citest:bintests cppname:atf_ci.citest_bintests comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_bootstrap acrkey:gstatic/atfdb.citest:bootstrap cppname:atf_ci.citest_bootstrap comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_checkclean acrkey:gstatic/atfdb.citest:checkclean cppname:atf_ci.citest_checkclean comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_cleantemp acrkey:gstatic/atfdb.citest:cleantemp cppname:atf_ci.citest_cleantemp comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_comptest acrkey:gstatic/atfdb.citest:comptest cppname:atf_ci.citest_comptest comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_cppcheck acrkey:gstatic/atfdb.citest:cppcheck cppname:atf_ci.citest_cppcheck comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_encoding acrkey:gstatic/atfdb.citest:encoding cppname:atf_ci.citest_encoding comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_file_header acrkey:gstatic/atfdb.citest:file_header cppname:atf_ci.citest_file_header comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_gitfile acrkey:gstatic/atfdb.citest:gitfile cppname:atf_ci.citest_gitfile comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_iffy_src acrkey:gstatic/atfdb.citest:iffy_src cppname:atf_ci.citest_iffy_src comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_indent_script acrkey:gstatic/atfdb.citest:indent_script cppname:atf_ci.citest_indent_script comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_indent_srcfile acrkey:gstatic/atfdb.citest:indent_srcfile cppname:atf_ci.citest_indent_srcfile comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_lineendings acrkey:gstatic/atfdb.citest:lineendings cppname:atf_ci.citest_lineendings comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_non_copyrighted acrkey:gstatic/atfdb.citest:non-copyrighted cppname:atf_ci.citest_non_copyrighted comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_normalize_acr acrkey:gstatic/atfdb.citest:normalize_acr cppname:atf_ci.citest_normalize_acr comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_normalize_acr_my acrkey:gstatic/atfdb.citest:normalize_acr_my cppname:atf_ci.citest_normalize_acr_my comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_normalize_amc_vis acrkey:gstatic/atfdb.citest:normalize_amc_vis cppname:atf_ci.citest_normalize_amc_vis comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_quickreadme acrkey:gstatic/atfdb.citest:quickreadme cppname:atf_ci.citest_quickreadme comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_readme acrkey:gstatic/atfdb.citest:readme cppname:atf_ci.citest_readme comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_scanreadme acrkey:gstatic/atfdb.citest:scanreadme cppname:atf_ci.citest_scanreadme comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_shebang acrkey:gstatic/atfdb.citest:shebang cppname:atf_ci.citest_shebang comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_src_lim acrkey:gstatic/atfdb.citest:src_lim cppname:atf_ci.citest_src_lim comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_ssimfile acrkey:gstatic/atfdb.citest:ssimfile cppname:atf_ci.citest_ssimfile comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_stray_gen acrkey:gstatic/atfdb.citest:stray_gen cppname:atf_ci.citest_stray_gen comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_tempcode acrkey:gstatic/atfdb.citest:tempcode cppname:atf_ci.citest_tempcode comment:"" +dmmeta.userfunc userfunc:atf_ci...citest_update_script acrkey:gstatic/atfdb.citest:update_script cppname:atf_ci.citest_update_script comment:"" +dmmeta.userfunc userfunc:atf_ci.FDb._db.Main acrkey:main:atf_ci cppname:atf_ci.Main comment:"" +dmmeta.userfunc userfunc:atf_cmdline.FDb._db.Main acrkey:main:atf_cmdline cppname:atf_cmdline.Main comment:"" +dmmeta.userfunc userfunc:atf_comp.FDb._db.Main acrkey:main:atf_comp cppname:atf_comp.Main comment:"" +dmmeta.userfunc userfunc:atf_comp.FDb.zd_run_comptest.Step acrkey:fstep:atf_comp.FDb.zd_run_comptest cppname:atf_comp.zd_run_comptest_Step comment:"" +dmmeta.userfunc userfunc:atf_cov.FDb._db.Main acrkey:main:atf_cov cppname:atf_cov.Main comment:"" +dmmeta.userfunc userfunc:atf_exp.FDb._db.Main acrkey:main:atf_exp cppname:atf_exp.Main comment:"" +dmmeta.userfunc userfunc:atf_exp.FDb.cd_fdin_eof.Step acrkey:fstep:atf_exp.FDb.cd_fdin_eof cppname:atf_exp.cd_fdin_eof_Step comment:"" +dmmeta.userfunc userfunc:atf_exp.FDb.cd_fdin_read.Step acrkey:fstep:atf_exp.FDb.cd_fdin_read cppname:atf_exp.cd_fdin_read_Step comment:"" +dmmeta.userfunc userfunc:atf_exp.FDb.cd_proc_outflow.Step acrkey:fstep:atf_exp.FDb.cd_proc_outflow cppname:atf_exp.cd_proc_outflow_Step comment:"" +dmmeta.userfunc userfunc:atf_exp.FDb.cd_proc_read.Step acrkey:fstep:atf_exp.FDb.cd_proc_read cppname:atf_exp.cd_proc_read_Step comment:"" +dmmeta.userfunc userfunc:atf_exp.FDb.ind_proc_pid.Step acrkey:fstep:atf_exp.FDb.ind_proc_pid cppname:atf_exp.ind_proc_pid_Step comment:"" +dmmeta.userfunc userfunc:atf_exp.In.ams.ProcEofMsg acrkey:dispatch_msg:atf_exp.In/ams.ProcEofMsg cppname:atf_exp.In_ProcEofMsg comment:"" +dmmeta.userfunc userfunc:atf_exp.In.ams.ProcKillMsg acrkey:dispatch_msg:atf_exp.In/ams.ProcKillMsg cppname:atf_exp.In_ProcKillMsg comment:"" +dmmeta.userfunc userfunc:atf_exp.In.ams.ProcMsg acrkey:dispatch_msg:atf_exp.In/ams.ProcMsg cppname:atf_exp.In_ProcMsg comment:"" +dmmeta.userfunc userfunc:atf_exp.In.ams.ProcReadMsg acrkey:dispatch_msg:atf_exp.In/ams.ProcReadMsg cppname:atf_exp.In_ProcReadMsg comment:"" +dmmeta.userfunc userfunc:atf_exp.In.ams.ProcStartMsg acrkey:dispatch_msg:atf_exp.In/ams.ProcStartMsg cppname:atf_exp.In_ProcStartMsg comment:"" +dmmeta.userfunc userfunc:atf_exp.In.ams.RemDirRecurseMsg acrkey:dispatch_msg:atf_exp.In/ams.RemDirRecurseMsg cppname:atf_exp.In_RemDirRecurseMsg comment:"" +dmmeta.userfunc userfunc:atf_exp.In.ams.TerminateMsg acrkey:dispatch_msg:atf_exp.In/ams.TerminateMsg cppname:atf_exp.In_TerminateMsg comment:"" +dmmeta.userfunc userfunc:atf_fuzz...fuzzstrat_skip_inputs acrkey:gstatic/atfdb.fuzzstrat:skip_inputs cppname:atf_fuzz.fuzzstrat_skip_inputs comment:"" +dmmeta.userfunc userfunc:atf_fuzz.FDb._db.Main acrkey:main:atf_fuzz cppname:atf_fuzz.Main comment:"" +dmmeta.userfunc userfunc:atf_gcli.FDb._db.Main acrkey:main:atf_gcli cppname:atf_gcli.Main comment:"" +dmmeta.userfunc userfunc:atf_nrun.FDb._db.Main acrkey:main:atf_nrun cppname:atf_nrun.Main comment:"" +dmmeta.userfunc userfunc:atf_nrun.FDb.ind_running.Step acrkey:fstep:atf_nrun.FDb.ind_running cppname:atf_nrun.ind_running_Step comment:"" +dmmeta.userfunc userfunc:atf_nrun.FDb.zd_todo.Step acrkey:fstep:atf_nrun.FDb.zd_todo cppname:atf_nrun.zd_todo_Step comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Check1 acrkey:gstatic/atfdb.unittest:acr.Check1 cppname:atf_unit.unittest_acr_Check1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Del1 acrkey:gstatic/atfdb.unittest:acr.Del1 cppname:atf_unit.unittest_acr_Del1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Field1 acrkey:gstatic/atfdb.unittest:acr.Field1 cppname:atf_unit.unittest_acr_Field1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Fldfunc1 acrkey:gstatic/atfdb.unittest:acr.Fldfunc1 cppname:atf_unit.unittest_acr_Fldfunc1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Insert1 acrkey:gstatic/atfdb.unittest:acr.Insert1 cppname:atf_unit.unittest_acr_Insert1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Insert2 acrkey:gstatic/atfdb.unittest:acr.Insert2 cppname:atf_unit.unittest_acr_Insert2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Merge1 acrkey:gstatic/atfdb.unittest:acr.Merge1 cppname:atf_unit.unittest_acr_Merge1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Read1 acrkey:gstatic/atfdb.unittest:acr.Read1 cppname:atf_unit.unittest_acr_Read1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Read2 acrkey:gstatic/atfdb.unittest:acr.Read2 cppname:atf_unit.unittest_acr_Read2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Read3 acrkey:gstatic/atfdb.unittest:acr.Read3 cppname:atf_unit.unittest_acr_Read3 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Read5 acrkey:gstatic/atfdb.unittest:acr.Read5 cppname:atf_unit.unittest_acr_Read5 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Regx1 acrkey:gstatic/atfdb.unittest:acr.Regx1 cppname:atf_unit.unittest_acr_Regx1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Replace1 acrkey:gstatic/atfdb.unittest:acr.Replace1 cppname:atf_unit.unittest_acr_Replace1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Rowid1 acrkey:gstatic/atfdb.unittest:acr.Rowid1 cppname:atf_unit.unittest_acr_Rowid1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Unused1 acrkey:gstatic/atfdb.unittest:acr.Unused1 cppname:atf_unit.unittest_acr_Unused1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Write1 acrkey:gstatic/atfdb.unittest:acr.Write1 cppname:atf_unit.unittest_acr_Write1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Write2 acrkey:gstatic/atfdb.unittest:acr.Write2 cppname:atf_unit.unittest_acr_Write2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Xref1 acrkey:gstatic/atfdb.unittest:acr.Xref1 cppname:atf_unit.unittest_acr_Xref1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_acr_Xref2 acrkey:gstatic/atfdb.unittest:acr.Xref2 cppname:atf_unit.unittest_acr_Xref2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_Base64 acrkey:gstatic/atfdb.unittest:algo.Base64 cppname:atf_unit.unittest_algo_Base64 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_FileFlags acrkey:gstatic/atfdb.unittest:algo.FileFlags cppname:atf_unit.unittest_algo_FileFlags comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Abs acrkey:gstatic/atfdb.unittest:algo_lib.Abs cppname:atf_unit.unittest_algo_lib_Abs comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Aligned acrkey:gstatic/atfdb.unittest:algo_lib.Aligned cppname:atf_unit.unittest_algo_lib_Aligned comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_AvlvsMap acrkey:gstatic/atfdb.unittest:algo_lib.AvlvsMap cppname:atf_unit.unittest_algo_lib_AvlvsMap comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_CSVTokens acrkey:gstatic/atfdb.unittest:algo_lib.CSVTokens cppname:atf_unit.unittest_algo_lib_CSVTokens comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_CString acrkey:gstatic/atfdb.unittest:algo_lib.CString cppname:atf_unit.unittest_algo_lib_CString comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_CaseConversion acrkey:gstatic/atfdb.unittest:algo_lib.CaseConversion cppname:atf_unit.unittest_algo_lib_CaseConversion comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Ceiling acrkey:gstatic/atfdb.unittest:algo_lib.Ceiling cppname:atf_unit.unittest_algo_lib_Ceiling comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Charset acrkey:gstatic/atfdb.unittest:algo_lib.Charset cppname:atf_unit.unittest_algo_lib_Charset comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_CheckIpmask acrkey:gstatic/atfdb.unittest:algo_lib.CheckIpmask cppname:atf_unit.unittest_algo_lib_CheckIpmask comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_CheckShiftMask acrkey:gstatic/atfdb.unittest:algo_lib.CheckShiftMask cppname:atf_unit.unittest_algo_lib_CheckShiftMask comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Clipped acrkey:gstatic/atfdb.unittest:algo_lib.Clipped cppname:atf_unit.unittest_algo_lib_Clipped comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Cmp acrkey:gstatic/atfdb.unittest:algo_lib.Cmp cppname:atf_unit.unittest_algo_lib_Cmp comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_CurrentTime acrkey:gstatic/atfdb.unittest:algo_lib.CurrentTime cppname:atf_unit.unittest_algo_lib_CurrentTime comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Datecache acrkey:gstatic/atfdb.unittest:algo_lib.Datecache cppname:atf_unit.unittest_algo_lib_Datecache comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_DayName acrkey:gstatic/atfdb.unittest:algo_lib.DayName cppname:atf_unit.unittest_algo_lib_DayName comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Decimal acrkey:gstatic/atfdb.unittest:algo_lib.Decimal cppname:atf_unit.unittest_algo_lib_Decimal comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_DirBeg acrkey:gstatic/atfdb.unittest:algo_lib.DirBeg cppname:atf_unit.unittest_algo_lib_DirBeg comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_DoTestRounding acrkey:gstatic/atfdb.unittest:algo_lib.DoTestRounding cppname:atf_unit.unittest_algo_lib_DoTestRounding comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ExitCode acrkey:gstatic/atfdb.unittest:algo_lib.ExitCode cppname:atf_unit.unittest_algo_lib_ExitCode comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_FTruncate acrkey:gstatic/atfdb.unittest:algo_lib.FTruncate cppname:atf_unit.unittest_algo_lib_FTruncate comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_FileAppend acrkey:gstatic/atfdb.unittest:algo_lib.FileAppend cppname:atf_unit.unittest_algo_lib_FileAppend comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_FileLine_curs acrkey:gstatic/atfdb.unittest:algo_lib.FileLine_curs cppname:atf_unit.unittest_algo_lib_FileLine_curs comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_FileQ acrkey:gstatic/atfdb.unittest:algo_lib.FileQ cppname:atf_unit.unittest_algo_lib_FileQ comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_FileToString acrkey:gstatic/atfdb.unittest:algo_lib.FileToString cppname:atf_unit.unittest_algo_lib_FileToString comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_FmtBufDec acrkey:gstatic/atfdb.unittest:algo_lib.FmtBufDec cppname:atf_unit.unittest_algo_lib_FmtBufDec comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_GetCpuHz acrkey:gstatic/atfdb.unittest:algo_lib.GetCpuHz cppname:atf_unit.unittest_algo_lib_GetCpuHz comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_I32Dec3Fmt acrkey:gstatic/atfdb.unittest:algo_lib.I32Dec3Fmt cppname:atf_unit.unittest_algo_lib_I32Dec3Fmt comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_IntPrice acrkey:gstatic/atfdb.unittest:algo_lib.IntPrice cppname:atf_unit.unittest_algo_lib_IntPrice comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Keyval acrkey:gstatic/atfdb.unittest:algo_lib.Keyval cppname:atf_unit.unittest_algo_lib_Keyval comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_KillRecurse acrkey:gstatic/atfdb.unittest:algo_lib.KillRecurse cppname:atf_unit.unittest_algo_lib_KillRecurse comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Lockfile acrkey:gstatic/atfdb.unittest:algo_lib.Lockfile cppname:atf_unit.unittest_algo_lib_Lockfile comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_MinMax acrkey:gstatic/atfdb.unittest:algo_lib.MinMax cppname:atf_unit.unittest_algo_lib_MinMax comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Mmap acrkey:gstatic/atfdb.unittest:algo_lib.Mmap cppname:atf_unit.unittest_algo_lib_Mmap comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_NToh acrkey:gstatic/atfdb.unittest:algo_lib.NToh cppname:atf_unit.unittest_algo_lib_NToh comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_NextSep acrkey:gstatic/atfdb.unittest:algo_lib.NextSep cppname:atf_unit.unittest_algo_lib_NextSep comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_OrderID acrkey:gstatic/atfdb.unittest:algo_lib.OrderID cppname:atf_unit.unittest_algo_lib_OrderID comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ParseHex1 acrkey:gstatic/atfdb.unittest:algo_lib.ParseHex1 cppname:atf_unit.unittest_algo_lib_ParseHex1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ParseHex2 acrkey:gstatic/atfdb.unittest:algo_lib.ParseHex2 cppname:atf_unit.unittest_algo_lib_ParseHex2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ParseNumber acrkey:gstatic/atfdb.unittest:algo_lib.ParseNumber cppname:atf_unit.unittest_algo_lib_ParseNumber comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ParseNumber_Overflow1 acrkey:gstatic/atfdb.unittest:algo_lib.ParseNumber_Overflow1 cppname:atf_unit.unittest_algo_lib_ParseNumber_Overflow1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ParseNumber_Overflow2 acrkey:gstatic/atfdb.unittest:algo_lib.ParseNumber_Overflow2 cppname:atf_unit.unittest_algo_lib_ParseNumber_Overflow2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ParseNumber_Overflow3 acrkey:gstatic/atfdb.unittest:algo_lib.ParseNumber_Overflow3 cppname:atf_unit.unittest_algo_lib_ParseNumber_Overflow3 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ParseOct1 acrkey:gstatic/atfdb.unittest:algo_lib.ParseOct1 cppname:atf_unit.unittest_algo_lib_ParseOct1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ParseOct3 acrkey:gstatic/atfdb.unittest:algo_lib.ParseOct3 cppname:atf_unit.unittest_algo_lib_ParseOct3 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ParseURL1 acrkey:gstatic/atfdb.unittest:algo_lib.ParseURL1 cppname:atf_unit.unittest_algo_lib_ParseURL1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ParseUnTime acrkey:gstatic/atfdb.unittest:algo_lib.ParseUnTime cppname:atf_unit.unittest_algo_lib_ParseUnTime comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PerfIntrinsics acrkey:gstatic/atfdb.unittest:algo_lib.PerfIntrinsics cppname:atf_unit.unittest_algo_lib_PerfIntrinsics comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PerfMinMaxAvg acrkey:gstatic/atfdb.unittest:algo_lib.PerfMinMaxAvg cppname:atf_unit.unittest_algo_lib_PerfMinMaxAvg comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PerfParseDouble acrkey:gstatic/atfdb.unittest:algo_lib.PerfParseDouble cppname:atf_unit.unittest_algo_lib_PerfParseDouble comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PerfParseNum acrkey:gstatic/atfdb.unittest:algo_lib.PerfParseNum cppname:atf_unit.unittest_algo_lib_PerfParseNum comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PerfSort acrkey:gstatic/atfdb.unittest:algo_lib.PerfSort cppname:atf_unit.unittest_algo_lib_PerfSort comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PerfTruncVsFtol acrkey:gstatic/atfdb.unittest:algo_lib.PerfTruncVsFtol cppname:atf_unit.unittest_algo_lib_PerfTruncVsFtol comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PopCnt1 acrkey:gstatic/atfdb.unittest:algo_lib.PopCnt1 cppname:atf_unit.unittest_algo_lib_PopCnt1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PopCnt2 acrkey:gstatic/atfdb.unittest:algo_lib.PopCnt2 cppname:atf_unit.unittest_algo_lib_PopCnt2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PrintBash acrkey:gstatic/atfdb.unittest:algo_lib.PrintBash cppname:atf_unit.unittest_algo_lib_PrintBash comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PrintCppQuoted acrkey:gstatic/atfdb.unittest:algo_lib.PrintCppQuoted cppname:atf_unit.unittest_algo_lib_PrintCppQuoted comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PrintDoubleWithCommas acrkey:gstatic/atfdb.unittest:algo_lib.PrintDoubleWithCommas cppname:atf_unit.unittest_algo_lib_PrintDoubleWithCommas comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PrintHex acrkey:gstatic/atfdb.unittest:algo_lib.PrintHex cppname:atf_unit.unittest_algo_lib_PrintHex comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PrintMemptr acrkey:gstatic/atfdb.unittest:algo_lib.PrintMemptr cppname:atf_unit.unittest_algo_lib_PrintMemptr comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PrintPad acrkey:gstatic/atfdb.unittest:algo_lib.PrintPad cppname:atf_unit.unittest_algo_lib_PrintPad comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PrintSsim acrkey:gstatic/atfdb.unittest:algo_lib.PrintSsim cppname:atf_unit.unittest_algo_lib_PrintSsim comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PrintUnTime acrkey:gstatic/atfdb.unittest:algo_lib.PrintUnTime cppname:atf_unit.unittest_algo_lib_PrintUnTime comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PrintUuid acrkey:gstatic/atfdb.unittest:algo_lib.PrintUuid cppname:atf_unit.unittest_algo_lib_PrintUuid comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_PrintWithCommas acrkey:gstatic/atfdb.unittest:algo_lib.PrintWithCommas cppname:atf_unit.unittest_algo_lib_PrintWithCommas comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ReadLine acrkey:gstatic/atfdb.unittest:algo_lib.ReadLine cppname:atf_unit.unittest_algo_lib_ReadLine comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ReadModuleId acrkey:gstatic/atfdb.unittest:algo_lib.ReadModuleId cppname:atf_unit.unittest_algo_lib_ReadModuleId comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ReadUuid acrkey:gstatic/atfdb.unittest:algo_lib.ReadUuid cppname:atf_unit.unittest_algo_lib_ReadUuid comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Regx acrkey:gstatic/atfdb.unittest:algo_lib.Regx cppname:atf_unit.unittest_algo_lib_Regx comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_RegxReadTwice acrkey:gstatic/atfdb.unittest:algo_lib.RegxReadTwice cppname:atf_unit.unittest_algo_lib_RegxReadTwice comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_RegxReadTwice2 acrkey:gstatic/atfdb.unittest:algo_lib.RegxReadTwice2 cppname:atf_unit.unittest_algo_lib_RegxReadTwice2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_RegxShortCircuit acrkey:gstatic/atfdb.unittest:algo_lib.RegxShortCircuit cppname:atf_unit.unittest_algo_lib_RegxShortCircuit comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_RemDirRecurse acrkey:gstatic/atfdb.unittest:algo_lib.RemDirRecurse cppname:atf_unit.unittest_algo_lib_RemDirRecurse comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Replscope acrkey:gstatic/atfdb.unittest:algo_lib.Replscope cppname:atf_unit.unittest_algo_lib_Replscope comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ReplscopeSharedPrefix acrkey:gstatic/atfdb.unittest:algo_lib.ReplscopeSharedPrefix cppname:atf_unit.unittest_algo_lib_ReplscopeSharedPrefix comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_ReverseBits acrkey:gstatic/atfdb.unittest:algo_lib.ReverseBits cppname:atf_unit.unittest_algo_lib_ReverseBits comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_SchedTime acrkey:gstatic/atfdb.unittest:algo_lib.SchedTime cppname:atf_unit.unittest_algo_lib_SchedTime comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Sleep acrkey:gstatic/atfdb.unittest:algo_lib.Sleep cppname:atf_unit.unittest_algo_lib_Sleep comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Smallstr acrkey:gstatic/atfdb.unittest:algo_lib.Smallstr cppname:atf_unit.unittest_algo_lib_Smallstr comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_SmallstrEq acrkey:gstatic/atfdb.unittest:algo_lib.SmallstrEq cppname:atf_unit.unittest_algo_lib_SmallstrEq comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Strfind acrkey:gstatic/atfdb.unittest:algo_lib.Strfind cppname:atf_unit.unittest_algo_lib_Strfind comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_StringCase acrkey:gstatic/atfdb.unittest:algo_lib.StringCase cppname:atf_unit.unittest_algo_lib_StringCase comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_StringFind acrkey:gstatic/atfdb.unittest:algo_lib.StringFind cppname:atf_unit.unittest_algo_lib_StringFind comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_StringIter acrkey:gstatic/atfdb.unittest:algo_lib.StringIter cppname:atf_unit.unittest_algo_lib_StringIter comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_StringSepCurs acrkey:gstatic/atfdb.unittest:algo_lib.StringSepCurs cppname:atf_unit.unittest_algo_lib_StringSepCurs comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_StringSubrange acrkey:gstatic/atfdb.unittest:algo_lib.StringSubrange cppname:atf_unit.unittest_algo_lib_StringSubrange comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_StringToFile acrkey:gstatic/atfdb.unittest:algo_lib.StringToFile cppname:atf_unit.unittest_algo_lib_StringToFile comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_SubstringIndex acrkey:gstatic/atfdb.unittest:algo_lib.SubstringIndex cppname:atf_unit.unittest_algo_lib_SubstringIndex comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_SysEval acrkey:gstatic/atfdb.unittest:algo_lib.SysEval cppname:atf_unit.unittest_algo_lib_SysEval comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Tabulate acrkey:gstatic/atfdb.unittest:algo_lib.Tabulate cppname:atf_unit.unittest_algo_lib_Tabulate comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Tempfile acrkey:gstatic/atfdb.unittest:algo_lib.Tempfile cppname:atf_unit.unittest_algo_lib_Tempfile comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_TestString acrkey:gstatic/atfdb.unittest:algo_lib.TestString cppname:atf_unit.unittest_algo_lib_TestString comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_TestStringFmt acrkey:gstatic/atfdb.unittest:algo_lib.TestStringFmt cppname:atf_unit.unittest_algo_lib_TestStringFmt comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_TestStringFmt2 acrkey:gstatic/atfdb.unittest:algo_lib.TestStringFmt2 cppname:atf_unit.unittest_algo_lib_TestStringFmt2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_TestStringFmt3 acrkey:gstatic/atfdb.unittest:algo_lib.TestStringFmt3 cppname:atf_unit.unittest_algo_lib_TestStringFmt3 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_TimeConstants acrkey:gstatic/atfdb.unittest:algo_lib.TimeConstants cppname:atf_unit.unittest_algo_lib_TimeConstants comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_TimeConversion acrkey:gstatic/atfdb.unittest:algo_lib.TimeConversion cppname:atf_unit.unittest_algo_lib_TimeConversion comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_TimeConvert acrkey:gstatic/atfdb.unittest:algo_lib.TimeConvert cppname:atf_unit.unittest_algo_lib_TimeConvert comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_TrimZerosRight acrkey:gstatic/atfdb.unittest:algo_lib.TrimZerosRight cppname:atf_unit.unittest_algo_lib_TrimZerosRight comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_TstampCache acrkey:gstatic/atfdb.unittest:algo_lib.TstampCache cppname:atf_unit.unittest_algo_lib_TstampCache comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Tuple acrkey:gstatic/atfdb.unittest:algo_lib.Tuple cppname:atf_unit.unittest_algo_lib_Tuple comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Tuple1 acrkey:gstatic/atfdb.unittest:algo_lib.Tuple1 cppname:atf_unit.unittest_algo_lib_Tuple1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Tuple2 acrkey:gstatic/atfdb.unittest:algo_lib.Tuple2 cppname:atf_unit.unittest_algo_lib_Tuple2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Txttbl acrkey:gstatic/atfdb.unittest:algo_lib.Txttbl cppname:atf_unit.unittest_algo_lib_Txttbl comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_U128PrintHex acrkey:gstatic/atfdb.unittest:algo_lib.U128PrintHex cppname:atf_unit.unittest_algo_lib_U128PrintHex comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_UnescapeC acrkey:gstatic/atfdb.unittest:algo_lib.UnescapeC cppname:atf_unit.unittest_algo_lib_UnescapeC comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Url acrkey:gstatic/atfdb.unittest:algo_lib.Url cppname:atf_unit.unittest_algo_lib_Url comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_Zigzag acrkey:gstatic/atfdb.unittest:algo_lib.Zigzag cppname:atf_unit.unittest_algo_lib_Zigzag comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_flock acrkey:gstatic/atfdb.unittest:algo_lib.flock cppname:atf_unit.unittest_algo_lib_flock comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_strptr_Eq acrkey:gstatic/atfdb.unittest:algo_lib.strptr_Eq cppname:atf_unit.unittest_algo_lib_strptr_Eq comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_test_strptr acrkey:gstatic/atfdb.unittest:algo_lib.test_strptr cppname:atf_unit.unittest_algo_lib_test_strptr comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_algo_lib_u128 acrkey:gstatic/atfdb.unittest:algo_lib.u128 cppname:atf_unit.unittest_algo_lib_u128 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_amc_Unit acrkey:gstatic/atfdb.unittest:amc.Unit cppname:atf_unit.unittest_amc_Unit comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_ams_StreamId acrkey:gstatic/atfdb.unittest:ams.StreamId cppname:atf_unit.unittest_ams_StreamId comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_ams_sendtest acrkey:gstatic/atfdb.unittest:ams_sendtest cppname:atf_unit.unittest_ams_sendtest comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_atf_unit_Outfile acrkey:gstatic/atfdb.unittest:atf_unit.Outfile cppname:atf_unit.unittest_atf_unit_Outfile comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_fm acrkey:gstatic/atfdb.unittest:fm cppname:atf_unit.unittest_fm comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_ams_Test1 acrkey:gstatic/atfdb.unittest:lib_ams.Test1 cppname:atf_unit.unittest_lib_ams_Test1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_curl_GET_Echo acrkey:gstatic/atfdb.unittest:lib_curl.GET_Echo cppname:atf_unit.unittest_lib_curl_GET_Echo comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_curl_POST_JSON acrkey:gstatic/atfdb.unittest:lib_curl.POST_JSON cppname:atf_unit.unittest_lib_curl_POST_JSON comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_curl_PUT_PLAINTEXT acrkey:gstatic/atfdb.unittest:lib_curl.PUT_PLAINTEXT cppname:atf_unit.unittest_lib_curl_PUT_PLAINTEXT comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_curl_STATUS_200 acrkey:gstatic/atfdb.unittest:lib_curl.STATUS_200 cppname:atf_unit.unittest_lib_curl_STATUS_200 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_exec_Dependency acrkey:gstatic/atfdb.unittest:lib_exec.Dependency cppname:atf_unit.unittest_lib_exec_Dependency comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_exec_Parallel1 acrkey:gstatic/atfdb.unittest:lib_exec.Parallel1 cppname:atf_unit.unittest_lib_exec_Parallel1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_exec_Timeout acrkey:gstatic/atfdb.unittest:lib_exec.Timeout cppname:atf_unit.unittest_lib_exec_Timeout comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_exec_TooManyFds acrkey:gstatic/atfdb.unittest:lib_exec.TooManyFds cppname:atf_unit.unittest_lib_exec_TooManyFds comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ArrayAll acrkey:gstatic/atfdb.unittest:lib_json.ArrayAll cppname:atf_unit.unittest_lib_json_ArrayAll comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ArrayEmptyArray acrkey:gstatic/atfdb.unittest:lib_json.ArrayEmptyArray cppname:atf_unit.unittest_lib_json_ArrayEmptyArray comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ArrayEmptyObject acrkey:gstatic/atfdb.unittest:lib_json.ArrayEmptyObject cppname:atf_unit.unittest_lib_json_ArrayEmptyObject comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ArraySimpleNumber acrkey:gstatic/atfdb.unittest:lib_json.ArraySimpleNumber cppname:atf_unit.unittest_lib_json_ArraySimpleNumber comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ArraySimpleString acrkey:gstatic/atfdb.unittest:lib_json.ArraySimpleString cppname:atf_unit.unittest_lib_json_ArraySimpleString comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ArrayTokenFalse acrkey:gstatic/atfdb.unittest:lib_json.ArrayTokenFalse cppname:atf_unit.unittest_lib_json_ArrayTokenFalse comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ArrayTokenNull acrkey:gstatic/atfdb.unittest:lib_json.ArrayTokenNull cppname:atf_unit.unittest_lib_json_ArrayTokenNull comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ArrayTokenTrue acrkey:gstatic/atfdb.unittest:lib_json.ArrayTokenTrue cppname:atf_unit.unittest_lib_json_ArrayTokenTrue comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_CtrlCharEscape acrkey:gstatic/atfdb.unittest:lib_json.CtrlCharEscape cppname:atf_unit.unittest_lib_json_CtrlCharEscape comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_Empty acrkey:gstatic/atfdb.unittest:lib_json.Empty cppname:atf_unit.unittest_lib_json_Empty comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_EmptyArray acrkey:gstatic/atfdb.unittest:lib_json.EmptyArray cppname:atf_unit.unittest_lib_json_EmptyArray comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_Emptyobject acrkey:gstatic/atfdb.unittest:lib_json.Emptyobject cppname:atf_unit.unittest_lib_json_Emptyobject comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorArrayColon acrkey:gstatic/atfdb.unittest:lib_json.ErrorArrayColon cppname:atf_unit.unittest_lib_json_ErrorArrayColon comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorArrayComma1 acrkey:gstatic/atfdb.unittest:lib_json.ErrorArrayComma1 cppname:atf_unit.unittest_lib_json_ErrorArrayComma1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorArrayComma2 acrkey:gstatic/atfdb.unittest:lib_json.ErrorArrayComma2 cppname:atf_unit.unittest_lib_json_ErrorArrayComma2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorArrayComma3 acrkey:gstatic/atfdb.unittest:lib_json.ErrorArrayComma3 cppname:atf_unit.unittest_lib_json_ErrorArrayComma3 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorArrayComma4 acrkey:gstatic/atfdb.unittest:lib_json.ErrorArrayComma4 cppname:atf_unit.unittest_lib_json_ErrorArrayComma4 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadNumber acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadNumber cppname:atf_unit.unittest_lib_json_ErrorBadNumber comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadString1 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadString1 cppname:atf_unit.unittest_lib_json_ErrorBadString1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadString2 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadString2 cppname:atf_unit.unittest_lib_json_ErrorBadString2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadString3 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadString3 cppname:atf_unit.unittest_lib_json_ErrorBadString3 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadToken1 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadToken1 cppname:atf_unit.unittest_lib_json_ErrorBadToken1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadToken2 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadToken2 cppname:atf_unit.unittest_lib_json_ErrorBadToken2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadUString1 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadUString1 cppname:atf_unit.unittest_lib_json_ErrorBadUString1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadUString2 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadUString2 cppname:atf_unit.unittest_lib_json_ErrorBadUString2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadUString3 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadUString3 cppname:atf_unit.unittest_lib_json_ErrorBadUString3 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadUString4 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadUString4 cppname:atf_unit.unittest_lib_json_ErrorBadUString4 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadUString5 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadUString5 cppname:atf_unit.unittest_lib_json_ErrorBadUString5 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadUString6 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadUString6 cppname:atf_unit.unittest_lib_json_ErrorBadUString6 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBadUString7 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBadUString7 cppname:atf_unit.unittest_lib_json_ErrorBadUString7 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBareColon acrkey:gstatic/atfdb.unittest:lib_json.ErrorBareColon cppname:atf_unit.unittest_lib_json_ErrorBareColon comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBareComma acrkey:gstatic/atfdb.unittest:lib_json.ErrorBareComma cppname:atf_unit.unittest_lib_json_ErrorBareComma comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBareValuesWithCo acrkey:gstatic/atfdb.unittest:lib_json.ErrorBareValuesWithComma cppname:atf_unit.unittest_lib_json_ErrorBareValuesWithComma comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch1 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch1 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch10 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch10 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch10 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch11 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch11 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch11 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch12 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch12 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch12 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch13 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch13 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch13 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch14 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch14 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch14 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch2 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch2 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch3 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch3 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch3 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch4 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch4 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch4 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch5 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch5 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch5 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch6 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch6 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch6 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch7 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch7 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch7 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch8 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch8 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch8 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorBrMismatch9 acrkey:gstatic/atfdb.unittest:lib_json.ErrorBrMismatch9 cppname:atf_unit.unittest_lib_json_ErrorBrMismatch9 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorObjectColon1 acrkey:gstatic/atfdb.unittest:lib_json.ErrorObjectColon1 cppname:atf_unit.unittest_lib_json_ErrorObjectColon1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorObjectColon2 acrkey:gstatic/atfdb.unittest:lib_json.ErrorObjectColon2 cppname:atf_unit.unittest_lib_json_ErrorObjectColon2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorObjectColon3 acrkey:gstatic/atfdb.unittest:lib_json.ErrorObjectColon3 cppname:atf_unit.unittest_lib_json_ErrorObjectColon3 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorObjectColon4 acrkey:gstatic/atfdb.unittest:lib_json.ErrorObjectColon4 cppname:atf_unit.unittest_lib_json_ErrorObjectColon4 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorObjectColon5 acrkey:gstatic/atfdb.unittest:lib_json.ErrorObjectColon5 cppname:atf_unit.unittest_lib_json_ErrorObjectColon5 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorObjectComma1 acrkey:gstatic/atfdb.unittest:lib_json.ErrorObjectComma1 cppname:atf_unit.unittest_lib_json_ErrorObjectComma1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorObjectComma2 acrkey:gstatic/atfdb.unittest:lib_json.ErrorObjectComma2 cppname:atf_unit.unittest_lib_json_ErrorObjectComma2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorObjectComma3 acrkey:gstatic/atfdb.unittest:lib_json.ErrorObjectComma3 cppname:atf_unit.unittest_lib_json_ErrorObjectComma3 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorObjectComma4 acrkey:gstatic/atfdb.unittest:lib_json.ErrorObjectComma4 cppname:atf_unit.unittest_lib_json_ErrorObjectComma4 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorObjectDupField acrkey:gstatic/atfdb.unittest:lib_json.ErrorObjectDupField cppname:atf_unit.unittest_lib_json_ErrorObjectDupField comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ErrorObjectNoValue acrkey:gstatic/atfdb.unittest:lib_json.ErrorObjectNoValue cppname:atf_unit.unittest_lib_json_ErrorObjectNoValue comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_Object acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_Object cppname:atf_unit.unittest_lib_json_FmtJson_Object comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_TypeA acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_TypeA cppname:atf_unit.unittest_lib_json_FmtJson_TypeA comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_bool_false acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_bool_false cppname:atf_unit.unittest_lib_json_FmtJson_bool_false comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_bool_true acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_bool_true cppname:atf_unit.unittest_lib_json_FmtJson_bool_true comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_char acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_char cppname:atf_unit.unittest_lib_json_FmtJson_char comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_double_prec acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_double_prec cppname:atf_unit.unittest_lib_json_FmtJson_double_prec comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_float_prec acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_float_prec cppname:atf_unit.unittest_lib_json_FmtJson_float_prec comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_i16_max acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_i16_max cppname:atf_unit.unittest_lib_json_FmtJson_i16_max comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_i16_min acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_i16_min cppname:atf_unit.unittest_lib_json_FmtJson_i16_min comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_i32_max acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_i32_max cppname:atf_unit.unittest_lib_json_FmtJson_i32_max comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_i32_min acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_i32_min cppname:atf_unit.unittest_lib_json_FmtJson_i32_min comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_i64_max acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_i64_max cppname:atf_unit.unittest_lib_json_FmtJson_i64_max comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_i64_min acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_i64_min cppname:atf_unit.unittest_lib_json_FmtJson_i64_min comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_i8_max acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_i8_max cppname:atf_unit.unittest_lib_json_FmtJson_i8_max comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_i8_min acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_i8_min cppname:atf_unit.unittest_lib_json_FmtJson_i8_min comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_u16_0 acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_u16_0 cppname:atf_unit.unittest_lib_json_FmtJson_u16_0 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_u16_max acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_u16_max cppname:atf_unit.unittest_lib_json_FmtJson_u16_max comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_u32_0 acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_u32_0 cppname:atf_unit.unittest_lib_json_FmtJson_u32_0 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_u32_max acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_u32_max cppname:atf_unit.unittest_lib_json_FmtJson_u32_max comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_u64_0 acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_u64_0 cppname:atf_unit.unittest_lib_json_FmtJson_u64_0 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_u64_max acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_u64_max cppname:atf_unit.unittest_lib_json_FmtJson_u64_max comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_u8_0 acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_u8_0 cppname:atf_unit.unittest_lib_json_FmtJson_u8_0 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_FmtJson_u8_max acrkey:gstatic/atfdb.unittest:lib_json.FmtJson_u8_max cppname:atf_unit.unittest_lib_json_FmtJson_u8_max comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_NumberCombined1 acrkey:gstatic/atfdb.unittest:lib_json.NumberCombined1 cppname:atf_unit.unittest_lib_json_NumberCombined1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_NumberCombined2 acrkey:gstatic/atfdb.unittest:lib_json.NumberCombined2 cppname:atf_unit.unittest_lib_json_NumberCombined2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_NumberDecimal acrkey:gstatic/atfdb.unittest:lib_json.NumberDecimal cppname:atf_unit.unittest_lib_json_NumberDecimal comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_NumberExponent1 acrkey:gstatic/atfdb.unittest:lib_json.NumberExponent1 cppname:atf_unit.unittest_lib_json_NumberExponent1 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_NumberExponent2 acrkey:gstatic/atfdb.unittest:lib_json.NumberExponent2 cppname:atf_unit.unittest_lib_json_NumberExponent2 comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_NumberManyDigits acrkey:gstatic/atfdb.unittest:lib_json.NumberManyDigits cppname:atf_unit.unittest_lib_json_NumberManyDigits comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_NumberZero acrkey:gstatic/atfdb.unittest:lib_json.NumberZero cppname:atf_unit.unittest_lib_json_NumberZero comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ObjFieldAll acrkey:gstatic/atfdb.unittest:lib_json.ObjFieldAll cppname:atf_unit.unittest_lib_json_ObjFieldAll comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ObjFieldEmptyArray acrkey:gstatic/atfdb.unittest:lib_json.ObjFieldEmptyArray cppname:atf_unit.unittest_lib_json_ObjFieldEmptyArray comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ObjFieldEmptyObject acrkey:gstatic/atfdb.unittest:lib_json.ObjFieldEmptyObject cppname:atf_unit.unittest_lib_json_ObjFieldEmptyObject comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ObjFieldSimpleNumber acrkey:gstatic/atfdb.unittest:lib_json.ObjFieldSimpleNumber cppname:atf_unit.unittest_lib_json_ObjFieldSimpleNumber comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ObjFieldSimpleString acrkey:gstatic/atfdb.unittest:lib_json.ObjFieldSimpleString cppname:atf_unit.unittest_lib_json_ObjFieldSimpleString comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ObjFieldTokenFalse acrkey:gstatic/atfdb.unittest:lib_json.ObjFieldTokenFalse cppname:atf_unit.unittest_lib_json_ObjFieldTokenFalse comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ObjFieldTokenNull acrkey:gstatic/atfdb.unittest:lib_json.ObjFieldTokenNull cppname:atf_unit.unittest_lib_json_ObjFieldTokenNull comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_ObjFieldTokenTrue acrkey:gstatic/atfdb.unittest:lib_json.ObjFieldTokenTrue cppname:atf_unit.unittest_lib_json_ObjFieldTokenTrue comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_SecString acrkey:gstatic/atfdb.unittest:lib_json.SecString cppname:atf_unit.unittest_lib_json_SecString comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_SimpleNumber acrkey:gstatic/atfdb.unittest:lib_json.SimpleNumber cppname:atf_unit.unittest_lib_json_SimpleNumber comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_SimpleString acrkey:gstatic/atfdb.unittest:lib_json.SimpleString cppname:atf_unit.unittest_lib_json_SimpleString comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_StringEmpty acrkey:gstatic/atfdb.unittest:lib_json.StringEmpty cppname:atf_unit.unittest_lib_json_StringEmpty comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_StringWithEscapes acrkey:gstatic/atfdb.unittest:lib_json.StringWithEscapes cppname:atf_unit.unittest_lib_json_StringWithEscapes comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_TokenFalse acrkey:gstatic/atfdb.unittest:lib_json.TokenFalse cppname:atf_unit.unittest_lib_json_TokenFalse comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_TokenNull acrkey:gstatic/atfdb.unittest:lib_json.TokenNull cppname:atf_unit.unittest_lib_json_TokenNull comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_TokenTrue acrkey:gstatic/atfdb.unittest:lib_json.TokenTrue cppname:atf_unit.unittest_lib_json_TokenTrue comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_json_Typical acrkey:gstatic/atfdb.unittest:lib_json.Typical cppname:atf_unit.unittest_lib_json_Typical comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_netio_GetHostAddr acrkey:gstatic/atfdb.unittest:lib_netio_GetHostAddr cppname:atf_unit.unittest_lib_netio_GetHostAddr comment:"" +dmmeta.userfunc userfunc:atf_unit...unittest_lib_sql_Main acrkey:gstatic/atfdb.unittest:lib_sql.Main cppname:atf_unit.unittest_lib_sql_Main comment:"" +dmmeta.userfunc userfunc:atf_unit.FDb._db.Main acrkey:main:atf_unit cppname:atf_unit.Main comment:"" +dmmeta.userfunc userfunc:bash2html.FDb._db.Main acrkey:main:bash2html cppname:bash2html.Main comment:"" +dmmeta.userfunc userfunc:bool..FmtJson acrkey:cfmt:bool.Json cppname:.bool_FmtJson comment:"" +dmmeta.userfunc userfunc:bool..Print acrkey:cfmt:bool.String cppname:.bool_Print comment:"" +dmmeta.userfunc userfunc:bool..ReadStrptrMaybe acrkey:cfmt:bool.String cppname:.bool_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:char..FmtJson acrkey:cfmt:char.Json cppname:.char_FmtJson comment:"" +dmmeta.userfunc userfunc:char..Print acrkey:cfmt:char.String cppname:.char_Print comment:"" +dmmeta.userfunc userfunc:char..ReadStrptrMaybe acrkey:cfmt:char.String cppname:.char_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:dev.Syscmd.execkey.Get acrkey:"" cppname:dev.execkey_Get comment:"" +dmmeta.userfunc userfunc:double..FmtJson acrkey:cfmt:double.Json cppname:.double_FmtJson comment:"" +dmmeta.userfunc userfunc:double..Print acrkey:cfmt:double.String cppname:.double_Print comment:"" +dmmeta.userfunc userfunc:double..ReadStrptrMaybe acrkey:cfmt:double.String cppname:.double_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:float..FmtJson acrkey:cfmt:float.Json cppname:.float_FmtJson comment:"" +dmmeta.userfunc userfunc:float..Print acrkey:cfmt:float.String cppname:.float_Print comment:"" +dmmeta.userfunc userfunc:float..ReadStrptrMaybe acrkey:cfmt:float.String cppname:.float_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:gcache.FDb._db.Main acrkey:main:gcache cppname:gcache.Main comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_graphql acrkey:gstatic/gclidb.gclicmd:graphql cppname:gcli.gclicmd_graphql comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_issueadd acrkey:gstatic/gclidb.gclicmd:issueadd cppname:gcli.gclicmd_issueadd comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_issuelist acrkey:gstatic/gclidb.gclicmd:issuelist cppname:gcli.gclicmd_issuelist comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_issuemod acrkey:gstatic/gclidb.gclicmd:issuemod cppname:gcli.gclicmd_issuemod comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_issuenote acrkey:gstatic/gclidb.gclicmd:issuenote cppname:gcli.gclicmd_issuenote comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_issuesearch acrkey:gstatic/gclidb.gclicmd:issuesearch cppname:gcli.gclicmd_issuesearch comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mraccept acrkey:gstatic/gclidb.gclicmd:mraccept cppname:gcli.gclicmd_mraccept comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mrlist acrkey:gstatic/gclidb.gclicmd:mrlist cppname:gcli.gclicmd_mrlist comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mrlistdet acrkey:gstatic/gclidb.gclicmd:mrlistdet cppname:gcli.gclicmd_mrlistdet comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mrmod acrkey:gstatic/gclidb.gclicmd:mrmod cppname:gcli.gclicmd_mrmod comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mrnote acrkey:gstatic/gclidb.gclicmd:mrnote cppname:gcli.gclicmd_mrnote comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mrnoteadd acrkey:gstatic/gclidb.gclicmd:mrnoteadd cppname:gcli.gclicmd_mrnoteadd comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mrnotemod acrkey:gstatic/gclidb.gclicmd:mrnotemod cppname:gcli.gclicmd_mrnotemod comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mrreq acrkey:gstatic/gclidb.gclicmd:mrreq cppname:gcli.gclicmd_mrreq comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mrreview acrkey:gstatic/gclidb.gclicmd:mrreview cppname:gcli.gclicmd_mrreview comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mrreviewrm acrkey:gstatic/gclidb.gclicmd:mrreviewrm cppname:gcli.gclicmd_mrreviewrm comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mrsearch acrkey:gstatic/gclidb.gclicmd:mrsearch cppname:gcli.gclicmd_mrsearch comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_mslist acrkey:gstatic/gclidb.gclicmd:mslist cppname:gcli.gclicmd_mslist comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_noteadd acrkey:gstatic/gclidb.gclicmd:noteadd cppname:gcli.gclicmd_noteadd comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_notemod acrkey:gstatic/gclidb.gclicmd:notemod cppname:gcli.gclicmd_notemod comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_repojob acrkey:gstatic/gclidb.gclicmd:repojob cppname:gcli.gclicmd_repojob comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_repojobtrace acrkey:gstatic/gclidb.gclicmd:repojobtrace cppname:gcli.gclicmd_repojobtrace comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_token2repos acrkey:gstatic/gclidb.gclicmd:token2repos cppname:gcli.gclicmd_token2repos comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_user acrkey:gstatic/gclidb.gclicmd:user cppname:gcli.gclicmd_user comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_userdet acrkey:gstatic/gclidb.gclicmd:userdet cppname:gcli.gclicmd_userdet comment:"" +dmmeta.userfunc userfunc:gcli...gclicmd_userlist acrkey:gstatic/gclidb.gclicmd:userlist cppname:gcli.gclicmd_userlist comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_gitconfig_create acrkey:gstatic/gclidb.gtblact:gitconfig_create cppname:gcli.gtblact_gitconfig_create comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_gitconfig_list acrkey:gstatic/gclidb.gtblact:gitconfig_list cppname:gcli.gtblact_gitconfig_list comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_help_list acrkey:gstatic/gclidb.gtblact:help_list cppname:gcli.gtblact_help_list comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_issue_create acrkey:gstatic/gclidb.gtblact:issue_create cppname:gcli.gtblact_issue_create comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_issue_list acrkey:gstatic/gclidb.gtblact:issue_list cppname:gcli.gtblact_issue_list comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_issue_needs_work acrkey:gstatic/gclidb.gtblact:issue_needs_work cppname:gcli.gtblact_issue_needs_work comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_issue_start acrkey:gstatic/gclidb.gtblact:issue_start cppname:gcli.gtblact_issue_start comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_issue_stop acrkey:gstatic/gclidb.gtblact:issue_stop cppname:gcli.gtblact_issue_stop comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_issue_update acrkey:gstatic/gclidb.gtblact:issue_update cppname:gcli.gtblact_issue_update comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_issuenote_create acrkey:gstatic/gclidb.gtblact:issuenote_create cppname:gcli.gtblact_issuenote_create comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_issuenote_list acrkey:gstatic/gclidb.gtblact:issuenote_list cppname:gcli.gtblact_issuenote_list comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_issuenote_update acrkey:gstatic/gclidb.gtblact:issuenote_update cppname:gcli.gtblact_issuenote_update comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_milestone_list acrkey:gstatic/gclidb.gtblact:milestone_list cppname:gcli.gtblact_milestone_list comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mr_accept acrkey:gstatic/gclidb.gtblact:mr_accept cppname:gcli.gtblact_mr_accept comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mr_approve acrkey:gstatic/gclidb.gtblact:mr_approve cppname:gcli.gtblact_mr_approve comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mr_create acrkey:gstatic/gclidb.gtblact:mr_create cppname:gcli.gtblact_mr_create comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mr_list acrkey:gstatic/gclidb.gtblact:mr_list cppname:gcli.gtblact_mr_list comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mr_needs_work acrkey:gstatic/gclidb.gtblact:mr_needs_work cppname:gcli.gtblact_mr_needs_work comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mr_start acrkey:gstatic/gclidb.gtblact:mr_start cppname:gcli.gtblact_mr_start comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mr_stop acrkey:gstatic/gclidb.gtblact:mr_stop cppname:gcli.gtblact_mr_stop comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mr_update acrkey:gstatic/gclidb.gtblact:mr_update cppname:gcli.gtblact_mr_update comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mrjob_list acrkey:gstatic/gclidb.gtblact:mrjob_list cppname:gcli.gtblact_mrjob_list comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mrnote_create acrkey:gstatic/gclidb.gtblact:mrnote_create cppname:gcli.gtblact_mrnote_create comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mrnote_list acrkey:gstatic/gclidb.gtblact:mrnote_list cppname:gcli.gtblact_mrnote_list comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_mrnote_update acrkey:gstatic/gclidb.gtblact:mrnote_update cppname:gcli.gtblact_mrnote_update comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_repo_create acrkey:gstatic/gclidb.gtblact:repo_create cppname:gcli.gtblact_repo_create comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_repo_list acrkey:gstatic/gclidb.gtblact:repo_list cppname:gcli.gtblact_repo_list comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_repo_update acrkey:gstatic/gclidb.gtblact:repo_update cppname:gcli.gtblact_repo_update comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_reporemote_list acrkey:gstatic/gclidb.gtblact:reporemote_list cppname:gcli.gtblact_reporemote_list comment:"" +dmmeta.userfunc userfunc:gcli...gtblact_user_list acrkey:gstatic/gclidb.gtblact:user_list cppname:gcli.gtblact_user_list comment:"" +dmmeta.userfunc userfunc:gcli.FDb._db.Main acrkey:main:gcli cppname:gcli.Main comment:"" +dmmeta.userfunc userfunc:i16..FmtJson acrkey:cfmt:i16.Json cppname:.i16_FmtJson comment:"" +dmmeta.userfunc userfunc:i16..Print acrkey:cfmt:i16.String cppname:.i16_Print comment:"" +dmmeta.userfunc userfunc:i32..FmtJson acrkey:cfmt:i32.Json cppname:.i32_FmtJson comment:"" +dmmeta.userfunc userfunc:i32..Print acrkey:cfmt:i32.String cppname:.i32_Print comment:"" +dmmeta.userfunc userfunc:i64..FmtJson acrkey:cfmt:i64.Json cppname:.i64_FmtJson comment:"" +dmmeta.userfunc userfunc:i64..Print acrkey:cfmt:i64.String cppname:.i64_Print comment:"" +dmmeta.userfunc userfunc:i8..FmtJson acrkey:cfmt:i8.Json cppname:.i8_FmtJson comment:"" +dmmeta.userfunc userfunc:i8..Print acrkey:cfmt:i8.String cppname:.i8_Print comment:"" +dmmeta.userfunc userfunc:ietf.Ipport..Print acrkey:cfmt:ietf.Ipport.String cppname:ietf.Ipport_Print comment:"" +dmmeta.userfunc userfunc:ietf.Ipport..ReadStrptrMaybe acrkey:cfmt:ietf.Ipport.String cppname:ietf.Ipport_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:ietf.Ipv4..Print acrkey:cfmt:ietf.Ipv4.String cppname:ietf.Ipv4_Print comment:"" +dmmeta.userfunc userfunc:ietf.Ipv4..ReadStrptrMaybe acrkey:cfmt:ietf.Ipv4.String cppname:ietf.Ipv4_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:ietf.Ipv4Addr..Print acrkey:cfmt:ietf.Ipv4Addr.String cppname:ietf.Ipv4Addr_Print comment:"" +dmmeta.userfunc userfunc:ietf.Ipv4Addr..ReadStrptrMaybe acrkey:cfmt:ietf.Ipv4Addr.String cppname:ietf.Ipv4Addr_ReadStrptrMaybe comment:"" +dmmeta.userfunc userfunc:jkv.FDb._db.Main acrkey:main:jkv cppname:jkv.Main comment:"" +dmmeta.userfunc userfunc:lib_ams.CtlMsg.ams.ShmHbMsg acrkey:dispatch_msg:lib_ams.CtlMsg/ams.ShmHbMsg cppname:lib_ams.CtlMsg_ShmHbMsg comment:"" +dmmeta.userfunc userfunc:lib_ams.FDb.bh_shmember_read.Step acrkey:fstep:lib_ams.FDb.bh_shmember_read cppname:lib_ams.bh_shmember_read_Step comment:"" +dmmeta.userfunc userfunc:lib_ams.FDb.cd_fdin_eof.Step acrkey:fstep:lib_ams.FDb.cd_fdin_eof cppname:lib_ams.cd_fdin_eof_Step comment:"" +dmmeta.userfunc userfunc:lib_ams.FDb.cd_fdin_read.Step acrkey:fstep:lib_ams.FDb.cd_fdin_read cppname:lib_ams.cd_fdin_read_Step comment:"" +dmmeta.userfunc userfunc:lib_ams.FDb.cd_hb.Step acrkey:fstep:lib_ams.FDb.cd_hb cppname:lib_ams.cd_hb_Step comment:"" +dmmeta.userfunc userfunc:lib_ams.FDb.cd_poll_read.Step acrkey:fstep:lib_ams.FDb.cd_poll_read cppname:lib_ams.cd_poll_read_Step comment:"" +dmmeta.userfunc userfunc:lib_ams.FDb.cd_slow_poll_read.Step acrkey:fstep:lib_ams.FDb.cd_slow_poll_read cppname:lib_ams.cd_slow_poll_read_Step comment:"" +dmmeta.userfunc userfunc:lib_ams.FDb.zd_flush.Step acrkey:fstep:lib_ams.FDb.zd_flush cppname:lib_ams.zd_flush_Step comment:"" +dmmeta.userfunc userfunc:lib_ams.FReadfile.fd.Cleanup acrkey:fcleanup:lib_ams.FReadfile.fd cppname:lib_ams.fd_Cleanup comment:"" +dmmeta.userfunc userfunc:lib_ams.FShm.shm_file.Cleanup acrkey:fcleanup:lib_ams.FShm.shm_file cppname:lib_ams.shm_file_Cleanup comment:"" +dmmeta.userfunc userfunc:lib_ams.FWritefile.fd.Cleanup acrkey:fcleanup:lib_ams.FWritefile.fd cppname:lib_ams.fd_Cleanup comment:"" +dmmeta.userfunc userfunc:lib_exec.FSyscmd.execkey.Get acrkey:"" cppname:lib_exec.execkey_Get comment:"" +dmmeta.userfunc userfunc:lib_iconv.Icd.icd.Cleanup acrkey:fcleanup:lib_iconv.Icd.icd cppname:lib_iconv.icd_Cleanup comment:"" +dmmeta.userfunc userfunc:lib_json.FNode.fldkey.Get acrkey:"" cppname:lib_json.fldkey_Get comment:"" +dmmeta.userfunc userfunc:lib_json.FParser.root_node.Cleanup acrkey:fcleanup:lib_json.FParser.root_node cppname:lib_json.root_node_Cleanup comment:"" +dmmeta.userfunc userfunc:lib_mysql.FDb.mysql.Cleanup acrkey:fcleanup:lib_mysql.FDb.mysql cppname:lib_mysql.mysql_Cleanup comment:"" +dmmeta.userfunc userfunc:lib_mysql.Res.res.Cleanup acrkey:fcleanup:lib_mysql.Res.res cppname:lib_mysql.res_Cleanup comment:"" +dmmeta.userfunc userfunc:lib_rl.FDb.iohook.Cleanup acrkey:fcleanup:lib_rl.FDb.iohook cppname:lib_rl.iohook_Cleanup comment:"" +dmmeta.userfunc userfunc:lib_sqlite.FConn.db.Cleanup acrkey:fcleanup:lib_sqlite.FConn.db cppname:lib_sqlite.db_Cleanup comment:"" +dmmeta.userfunc userfunc:lib_ws.FrameIdx..Unkmsg acrkey:dispatch:lib_ws.FrameIdx cppname:lib_ws.FrameIdx_Unkmsg comment:"" +dmmeta.userfunc userfunc:lib_ws.FrameIdx.ws.Frame16 acrkey:dispatch_msg:lib_ws.FrameIdx/ws.Frame16 cppname:lib_ws.FrameIdx_Frame16 comment:"" +dmmeta.userfunc userfunc:lib_ws.FrameIdx.ws.Frame64 acrkey:dispatch_msg:lib_ws.FrameIdx/ws.Frame64 cppname:lib_ws.FrameIdx_Frame64 comment:"" +dmmeta.userfunc userfunc:lib_ws.FrameIdx.ws.FrameMasked16 acrkey:dispatch_msg:lib_ws.FrameIdx/ws.FrameMasked16 cppname:lib_ws.FrameIdx_FrameMasked16 comment:"" +dmmeta.userfunc userfunc:lib_ws.FrameIdx.ws.FrameMasked64 acrkey:dispatch_msg:lib_ws.FrameIdx/ws.FrameMasked64 cppname:lib_ws.FrameIdx_FrameMasked64 comment:"" +dmmeta.userfunc userfunc:lib_ws.FrameLen..Unkmsg acrkey:dispatch:lib_ws.FrameLen cppname:lib_ws.FrameLen_Unkmsg comment:"" +dmmeta.userfunc userfunc:lib_ws.FrameLen.ws.Frame16 acrkey:dispatch_msg:lib_ws.FrameLen/ws.Frame16 cppname:lib_ws.FrameLen_Frame16 comment:"" +dmmeta.userfunc userfunc:lib_ws.FrameLen.ws.Frame64 acrkey:dispatch_msg:lib_ws.FrameLen/ws.Frame64 cppname:lib_ws.FrameLen_Frame64 comment:"" +dmmeta.userfunc userfunc:lib_ws.FrameLen.ws.FrameMasked16 acrkey:dispatch_msg:lib_ws.FrameLen/ws.FrameMasked16 cppname:lib_ws.FrameLen_FrameMasked16 comment:"" +dmmeta.userfunc userfunc:lib_ws.FrameLen.ws.FrameMasked64 acrkey:dispatch_msg:lib_ws.FrameLen/ws.FrameMasked64 cppname:lib_ws.FrameLen_FrameMasked64 comment:"" +dmmeta.userfunc userfunc:mdbg.FDb._db.Main acrkey:main:mdbg cppname:mdbg.Main comment:"" +dmmeta.userfunc userfunc:mysql2ssim.FDb._db.Main acrkey:main:mysql2ssim cppname:mysql2ssim.Main comment:"" +dmmeta.userfunc userfunc:orgfile.FDb._db.Main acrkey:main:orgfile cppname:orgfile.Main comment:"" +dmmeta.userfunc userfunc:samp_make.FDb._db.Main acrkey:main:samp_make cppname:samp_make.Main comment:"" +dmmeta.userfunc userfunc:samp_meng.FDb._db.Main acrkey:main:samp_meng cppname:samp_meng.Main comment:"" +dmmeta.userfunc userfunc:samp_meng.FDb.cd_fdin_eof.Step acrkey:fstep:samp_meng.FDb.cd_fdin_eof cppname:samp_meng.cd_fdin_eof_Step comment:"" +dmmeta.userfunc userfunc:samp_meng.FDb.cd_fdin_read.Step acrkey:fstep:samp_meng.FDb.cd_fdin_read cppname:samp_meng.cd_fdin_read_Step comment:"" +dmmeta.userfunc userfunc:samp_meng.In.samp_meng.CancelReqMsg acrkey:dispatch_msg:samp_meng.In/samp_meng.CancelReqMsg cppname:samp_meng.In_CancelReqMsg comment:"" +dmmeta.userfunc userfunc:samp_meng.In.samp_meng.MassCancelReqMsg acrkey:dispatch_msg:samp_meng.In/samp_meng.MassCancelReqMsg cppname:samp_meng.In_MassCancelReqMsg comment:"" +dmmeta.userfunc userfunc:samp_meng.In.samp_meng.NewOrderReqMsg acrkey:dispatch_msg:samp_meng.In/samp_meng.NewOrderReqMsg cppname:samp_meng.In_NewOrderReqMsg comment:"" +dmmeta.userfunc userfunc:samp_meng.In.samp_meng.NewSymbolReqMsg acrkey:dispatch_msg:samp_meng.In/samp_meng.NewSymbolReqMsg cppname:samp_meng.In_NewSymbolReqMsg comment:"" +dmmeta.userfunc userfunc:samp_meng.In.samp_meng.NewUserReqMsg acrkey:dispatch_msg:samp_meng.In/samp_meng.NewUserReqMsg cppname:samp_meng.In_NewUserReqMsg comment:"" +dmmeta.userfunc userfunc:samp_meng.In.samp_meng.TextMsg acrkey:dispatch_msg:samp_meng.In/samp_meng.TextMsg cppname:samp_meng.In_TextMsg comment:"" +dmmeta.userfunc userfunc:samp_regx.FDb._db.Main acrkey:main:samp_regx cppname:samp_regx.Main comment:"" +dmmeta.userfunc userfunc:sandbox.FDb._db.Main acrkey:main:sandbox cppname:sandbox.Main comment:"" +dmmeta.userfunc userfunc:src_func.FDb._db.Main acrkey:main:src_func cppname:src_func.Main comment:"" +dmmeta.userfunc userfunc:src_hdr.FDb._db.Main acrkey:main:src_hdr cppname:src_hdr.Main comment:"" +dmmeta.userfunc userfunc:src_lim.FDb._db.Main acrkey:main:src_lim cppname:src_lim.Main comment:"" +dmmeta.userfunc userfunc:ssim2csv.FDb._db.Main acrkey:main:ssim2csv cppname:ssim2csv.Main comment:"" +dmmeta.userfunc userfunc:ssim2mysql.FDb._db.Main acrkey:main:ssim2mysql cppname:ssim2mysql.Main comment:"" +dmmeta.userfunc userfunc:ssim2mysql.FDb.cd_input_line.Step acrkey:fstep:ssim2mysql.FDb.cd_input_line cppname:ssim2mysql.cd_input_line_Step comment:"" +dmmeta.userfunc userfunc:ssim2mysql.FDb.zs_cmd.Step acrkey:fstep:ssim2mysql.FDb.zs_cmd cppname:ssim2mysql.zs_cmd_Step comment:"" +dmmeta.userfunc userfunc:ssimfilt.FDb._db.Main acrkey:main:ssimfilt cppname:ssimfilt.Main comment:"" +dmmeta.userfunc userfunc:strconv.FDb._db.Main acrkey:main:strconv cppname:strconv.Main comment:"" +dmmeta.userfunc userfunc:sv2ssim.FDb._db.Main acrkey:main:sv2ssim cppname:sv2ssim.Main comment:"" +dmmeta.userfunc userfunc:u128..Print acrkey:cfmt:u128.String cppname:.u128_Print comment:"" +dmmeta.userfunc userfunc:u16..FmtJson acrkey:cfmt:u16.Json cppname:.u16_FmtJson comment:"" +dmmeta.userfunc userfunc:u16..Print acrkey:cfmt:u16.String cppname:.u16_Print comment:"" +dmmeta.userfunc userfunc:u32..FmtJson acrkey:cfmt:u32.Json cppname:.u32_FmtJson comment:"" +dmmeta.userfunc userfunc:u32..Print acrkey:cfmt:u32.String cppname:.u32_Print comment:"" +dmmeta.userfunc userfunc:u64..FmtJson acrkey:cfmt:u64.Json cppname:.u64_FmtJson comment:"" +dmmeta.userfunc userfunc:u64..Print acrkey:cfmt:u64.String cppname:.u64_Print comment:"" +dmmeta.userfunc userfunc:u8..FmtJson acrkey:cfmt:u8.Json cppname:.u8_FmtJson comment:"" +dmmeta.userfunc userfunc:u8..Print acrkey:cfmt:u8.String cppname:.u8_Print comment:"" +dmmeta.userfunc userfunc:ws.Frame.payload.N acrkey:field:ws.Frame.payload cppname:ws.payload_N comment:"" +dmmeta.userfunc userfunc:ws.FrameMasked.payload.N acrkey:field:ws.FrameMasked.payload cppname:ws.payload_N comment:"" diff --git a/data/dmmeta/xref.ssim b/data/dmmeta/xref.ssim index a9cf25a3..c8c55d21 100644 --- a/data/dmmeta/xref.ssim +++ b/data/dmmeta/xref.ssim @@ -31,7 +31,7 @@ dmmeta.xref field:abt.FDb.ind_filestat inscond:true via:"" dmmeta.xref field:abt.FDb.zd_inclstack inscond:false via:"" dmmeta.xref field:abt.FDb.ind_builddir inscond:true via:"" dmmeta.xref field:abt.FBuilddir.p_compiler inscond:true via:abt.FDb.ind_compiler/dev.Builddir.compiler -dmmeta.xref field:abt_md.FDb.ind_readme inscond:true via:"" +dmmeta.xref field:abt_md.FDb.ind_readmefile inscond:true via:"" dmmeta.xref field:abt_md.FDb.bh_file_section inscond:true via:"" dmmeta.xref field:abt_md.FDb.ind_ns inscond:true via:"" dmmeta.xref field:abt_md.FDb.ind_ssimfile inscond:true via:"" @@ -66,6 +66,13 @@ dmmeta.xref field:abt_md.FDb.ind_target inscond:true via:"" dmmeta.xref field:abt_md.FTarget.c_targdep inscond:true via:abt_md.FDb.ind_target/dev.Targdep.target dmmeta.xref field:abt_md.FTarget.p_ns inscond:true via:abt_md.FDb.ind_ns/dev.Target.target dmmeta.xref field:abt_md.FTargdep.p_parent inscond:true via:abt_md.FDb.ind_target/dev.Targdep.parent +dmmeta.xref field:abt_md.FNs.zd_finput inscond:true via:abt_md.FDb.ind_ns/dmmeta.Finput.ns +dmmeta.xref field:abt_md.FFinput.p_field inscond:true via:abt_md.FDb.ind_field/dmmeta.Finput.field +dmmeta.xref field:abt_md.FDb.zd_scanns inscond:false via:"" +dmmeta.xref field:abt_md.FDb.ind_dispatch inscond:true via:"" +dmmeta.xref field:abt_md.FNs.c_dispatch inscond:true via:abt_md.FDb.ind_ns/dmmeta.Dispatch.ns +dmmeta.xref field:abt_md.FDispatch.c_dispatch_msg inscond:true via:abt_md.FDb.ind_dispatch/dmmeta.DispatchMsg.dispatch +dmmeta.xref field:abt_md.FDispatchMsg.p_ctype inscond:true via:abt_md.FDb.ind_ctype/dmmeta.DispatchMsg.ctype dmmeta.xref field:acr.FDb.zd_pline inscond:true via:"" dmmeta.xref field:acr.FDb.zd_pdep inscond:true via:"" dmmeta.xref field:acr.FPline.zd_child inscond:true via:acr.FPdep.p_parent @@ -84,8 +91,8 @@ dmmeta.xref field:acr.FFile.zd_frec inscond:true via:acr.FRec.p_outfile dmmeta.xref field:acr.FDb.bh_pline inscond:false via:"" dmmeta.xref field:acr.FSsimfile.p_ctype inscond:true via:acr.FDb.ind_ctype/dmmeta.Ssimfile.ctype dmmeta.xref field:acr.FCtype.ind_ctype_rec inscond:true via:acr.FRec.p_ctype -dmmeta.xref field:acr.FCtype.zd_ctype_selrec inscond:false via:acr.FRec.p_ctype -dmmeta.xref field:acr.FCtype.zd_ctype_rec inscond:true via:acr.FRec.p_ctype +dmmeta.xref field:acr.FCtype.zd_selrec inscond:false via:acr.FRec.p_ctype +dmmeta.xref field:acr.FCtype.zd_rec inscond:true via:acr.FRec.p_ctype dmmeta.xref field:acr.FCtype.c_ssimfile inscond:true via:acr.FDb.ind_ctype/dmmeta.Ssimfile.ctype dmmeta.xref field:acr.FDb.ind_ssimfile inscond:true via:"" dmmeta.xref field:acr.FDb.ind_tempkey inscond:true via:"" @@ -239,7 +246,6 @@ dmmeta.xref field:amc.FCtype.p_ns inscond:true via:amc.FDb.ind_ns/dmmeta.Ctyp dmmeta.xref field:amc.FCtype.c_bltin inscond:true via:amc.FDb.ind_ctype/amcdb.Bltin.ctype dmmeta.xref field:amc.FCtype.c_field inscond:true via:amc.FDb.ind_ctype/dmmeta.Field.ctype dmmeta.xref field:amc.FCtype.c_msgtype inscond:true via:amc.FDb.ind_ctype/dmmeta.Msgtype.ctype -dmmeta.xref field:amc.FCtype.c_varlenfld inscond:false via:amc.FDb.ind_ctype/dmmeta.Field.ctype dmmeta.xref field:amc.FCtype.c_optfld inscond:false via:amc.FDb.ind_ctype/dmmeta.Field.ctype dmmeta.xref field:amc.FCtype.c_static inscond:true via:amc.FDb.ind_ctype/amc.FStatictuple.ctype dmmeta.xref field:amc.FCtype.c_cpptype inscond:true via:amc.FDb.ind_ctype/dmmeta.Cpptype.ctype @@ -323,7 +329,6 @@ dmmeta.xref field:amc.FCtype.c_cextern inscond:true via:amc.FDb.ind_ctype/dmm dmmeta.xref field:amc.FFstep.c_fdelay inscond:true via:amc.FDb.ind_fstep/dmmeta.Fdelay.fstep dmmeta.xref field:amc.FDisptrace.p_dispatch inscond:true via:amc.FDb.ind_dispatch/dmmeta.Disptrace.dispatch dmmeta.xref field:amc.FDispatch.c_disptrace inscond:true via:amc.FDb.ind_dispatch/dmmeta.Disptrace.dispatch -dmmeta.xref field:amc.FDb.c_dispsig_sorted inscond:true via:"" dmmeta.xref field:amc.FNs.c_dispsig inscond:true via:amc.FDb.ind_ns/dmmeta.Dispsig.ns dmmeta.xref field:amc.FDb.ind_target inscond:true via:"" dmmeta.xref field:amc.FTargdep.p_target inscond:true via:amc.FDb.ind_target/dev.Targdep.target @@ -393,7 +398,6 @@ dmmeta.xref field:amc.FField.c_ftrace inscond:true via:amc.FDb.ind_field/dmme dmmeta.xref field:amc.FNs.c_outfile inscond:true via:amc.FOutfile.p_ns dmmeta.xref field:amc.FField.c_fnoremove inscond:true via:amc.FDb.ind_field/dmmeta.Fnoremove.field dmmeta.xref field:amc.FCtype.c_ctypelen inscond:true via:amc.FDb.ind_ctype/dmmeta.Ctypelen.ctype -dmmeta.xref field:amc.FDb.c_ctypelen inscond:true via:"" dmmeta.xref field:amc.FField.c_fbase inscond:true via:amc.FDb.ind_field/dmmeta.Fbase.field dmmeta.xref field:amc.FDb.ind_fcmap inscond:true via:"" dmmeta.xref field:amc.FCtype.c_nossimfile inscond:true via:amc.FDb.ind_ctype/dmmeta.Nossimfile.ctype @@ -443,6 +447,14 @@ dmmeta.xref field:amc.FSsimsort.p_ssimfile inscond:true via:amc.FDb.ind_ssimf dmmeta.xref field:amc.FSsimsort.p_sortfld inscond:true via:amc.FDb.ind_field/dmmeta.Ssimsort.sortfld dmmeta.xref field:amc.FDb.ind_fbuftype inscond:true via:"" dmmeta.xref field:amc.FFbuf.p_fbuftype inscond:true via:amc.FDb.ind_fbuftype/dmmeta.Fbuf.fbuftype +dmmeta.xref field:amc.FCtype.zd_varlenfld inscond:false via:amc.FDb.ind_ctype/dmmeta.Field.ctype +dmmeta.xref field:amc.FNs.c_nsjs inscond:true via:amc.FDb.ind_ns/dmmeta.Nsjs.ns +dmmeta.xref field:amc.FCtype.c_jstype inscond:true via:amc.FDb.ind_ctype/dmmeta.Jstype.ctype +dmmeta.xref field:amc.FField.c_lenfld inscond:true via:amc.FDb.ind_field/dmmeta.Lenfld.field +dmmeta.xref field:amc.FCtype.c_ckafka inscond:true via:amc.FDb.ind_ctype/dmmeta.Ckafka.ctype +dmmeta.xref field:amc.FField.c_fkafka inscond:true via:amc.FDb.ind_field/dmmeta.Fkafka.field +dmmeta.xref field:amc.FDb.ind_steptype inscond:true via:"" +dmmeta.xref field:amc.FFstep.p_steptype inscond:true via:amc.FDb.ind_steptype/dmmeta.Fstep.steptype dmmeta.xref field:amc_vis.FDb.ind_ctype inscond:true via:"" dmmeta.xref field:amc_vis.FDb.ind_field inscond:true via:"" dmmeta.xref field:amc_vis.FDb.ind_node inscond:true via:"" @@ -455,12 +467,12 @@ dmmeta.xref field:amc_vis.FCtype.c_field inscond:true via:amc_vis.FDb.ind_cty dmmeta.xref field:amc_vis.FField.p_ctype inscond:true via:amc_vis.FDb.ind_ctype/dmmeta.Field.ctype dmmeta.xref field:amc_vis.FField.p_arg inscond:true via:amc_vis.FDb.ind_ctype/dmmeta.Field.arg dmmeta.xref field:amc_vis.FField.p_reftype inscond:true via:amc_vis.FDb.ind_reftype/dmmeta.Field.reftype -dmmeta.xref field:amc_vis.Link.zd_linkdep_out inscond:true via:amc_vis.Linkdep.p_link_from -dmmeta.xref field:amc_vis.Link.zd_linkdep_in inscond:true via:amc_vis.Linkdep.p_link_to +dmmeta.xref field:amc_vis.FLink.zd_linkdep_out inscond:true via:amc_vis.FLinkdep.p_link_from +dmmeta.xref field:amc_vis.FLink.zd_linkdep_in inscond:true via:amc_vis.FLinkdep.p_link_to dmmeta.xref field:amc_vis.FNode.zd_nodedep_out inscond:true via:amc_vis.FNodedep.p_node1 dmmeta.xref field:amc_vis.FNode.zd_nodedep_in inscond:true via:amc_vis.FNodedep.p_node2 -dmmeta.xref field:amc_vis.FNode.zd_link_out inscond:true via:amc_vis.Link.p_node1 -dmmeta.xref field:amc_vis.FNode.zd_link_in inscond:true via:amc_vis.Link.p_node2 +dmmeta.xref field:amc_vis.FNode.zd_link_out inscond:true via:amc_vis.FLink.p_node1 +dmmeta.xref field:amc_vis.FNode.zd_link_in inscond:true via:amc_vis.FLink.p_node2 dmmeta.xref field:amc_vis.FDb.zd_select inscond:false via:"" dmmeta.xref field:amc_vis.FField.c_finput inscond:true via:amc_vis.FDb.ind_field/dmmeta.Finput.field dmmeta.xref field:apm.FDb.zd_sel_package inscond:false via:"" @@ -525,6 +537,10 @@ dmmeta.xref field:atf_amc.FCascdel.zd_childlist inscond:"row.p_parent != &row dmmeta.xref field:atf_amc.FDb.tr_avl inscond:false via:"" dmmeta.xref field:atf_amc.FCascdel.tr_child_atree inscond:"row.p_parent != &row && row.type==atf_amc_FCascdel_type_atree" via:atf_amc.FCascdel.p_parent dmmeta.xref field:atf_amc.FDb.ind_thash_elem inscond:true via:"" +dmmeta.xref field:atf_amc.FDb.ind_hashable inscond:true via:"" +dmmeta.xref field:atf_amc.FDb.bh_time_entry inscond:false via:"" +dmmeta.xref field:atf_amc.FDb.ind_linear inscond:true via:"" +dmmeta.xref field:atf_amc.FDb.ind_strkey inscond:true via:"" dmmeta.xref field:atf_ci.FDb.ind_ssimfile inscond:true via:"" dmmeta.xref field:atf_ci.FDb.ind_scriptfile inscond:true via:"" dmmeta.xref field:atf_ci.FDb.ind_ns inscond:true via:"" @@ -545,6 +561,8 @@ dmmeta.xref field:atf_comp.FDb.zd_out_tmsg inscond:true via:"" dmmeta.xref field:atf_comp.FDb.zd_out_comptest inscond:true via:"" dmmeta.xref field:atf_comp.FDb.zd_out_tfilt inscond:true via:"" dmmeta.xref field:atf_comp.FDb.zd_out_targs inscond:true via:"" +dmmeta.xref field:atf_comp.FDb.zd_covdir_free inscond:true via:"" +dmmeta.xref field:atf_comp.FDb.ind_tfilt inscond:true via:"" dmmeta.xref field:atf_cov.FDb.ind_covline inscond:true via:"" dmmeta.xref field:atf_cov.FDb.ind_target inscond:true via:"" dmmeta.xref field:atf_cov.FDb.ind_targsrc inscond:true via:"" @@ -559,6 +577,15 @@ dmmeta.xref field:atf_cov.FTarget.c_covtarget inscond:true via:atf_cov.FDb.in dmmeta.xref field:atf_cov.FGitfile.c_covfile inscond:true via:atf_cov.FDb.ind_gitfile/dev.Covfile.covfile dmmeta.xref field:atf_cov.FDb.ind_tgtcov inscond:true via:"" dmmeta.xref field:atf_cov.FTarget.c_tgtcov inscond:true via:atf_cov.FDb.ind_target/dev.Tgtcov.target +dmmeta.xref field:atf_exp.FDb.ind_proc inscond:true via:"" +dmmeta.xref field:atf_exp.FDb.zd_proc inscond:true via:"" +dmmeta.xref field:atf_exp.FDb.cd_proc_read inscond:false via:"" +dmmeta.xref field:atf_exp.FDb.cd_proc_outflow inscond:false via:"" +dmmeta.xref field:atf_exp.FDb.ind_proc_pid inscond:false via:"" +dmmeta.xref field:atf_exp.FDb.c_proc_read inscond:false via:"" +dmmeta.xref field:atf_exp.FDb.cd_fdin_eof inscond:false via:"" +dmmeta.xref field:atf_exp.FDb.cd_fdin_read inscond:false via:"" +dmmeta.xref field:atf_exp.FDb.cd_fdin_suspend inscond:false via:"" dmmeta.xref field:atf_fuzz.FDb.ind_target inscond:true via:"" dmmeta.xref field:atf_gcli.FDb.ind_gtblacttst inscond:true via:"" dmmeta.xref field:atf_gcli.FGtblacttst.c_gtblacttstout inscond:true via:atf_gcli.FDb.ind_gtblacttst/gclidb.Gtblacttstout.gtblacttst @@ -574,8 +601,6 @@ dmmeta.xref field:atf_nrun.FDb.zd_todo inscond:false via:"" dmmeta.xref field:atf_unit.FDb.tr_number inscond:true via:"" dmmeta.xref field:atf_unit.FDb.ind_unittest inscond:true via:"" dmmeta.xref field:gcli.FDb.ind_gtype inscond:true via:"" -dmmeta.xref field:gcli.FDb.ind_grepossh inscond:true via:"" -dmmeta.xref field:gcli.FDb.ind_grepogitport inscond:true via:"" dmmeta.xref field:gcli.FDb.ind_githost inscond:true via:"" dmmeta.xref field:gcli.FDb.ind_gstatet inscond:true via:"" dmmeta.xref field:gcli.FDb.ind_grepo inscond:true via:"" @@ -612,22 +637,25 @@ dmmeta.xref field:gcli.FGtblactfld.p_gfld inscond:true via:gcli.FDb.ind_gfld/ dmmeta.xref field:gcli.FDb.ind_gtbl inscond:true via:"" dmmeta.xref field:gcli.FDb.ind_gact inscond:true via:"" dmmeta.xref field:gcli.FGclicmd.c_gclicmdf2j inscond:true via:gcli.FDb.ind_gclicmd/gclidb.Gclicmdf2j.gclicmd +dmmeta.xref field:lib_ams.FProc.c_shmember inscond:true via:lib_ams.FDb.ind_proc/ams.ShmemberId.proc_id dmmeta.xref field:lib_ams.FDb.cd_fdin_eof inscond:false via:"" dmmeta.xref field:lib_ams.FDb.cd_fdin_read inscond:false via:"" +dmmeta.xref field:lib_ams.FShm.c_shmember inscond:true via:lib_ams.FDb.ind_shm/ams.ShmemberId.shm_id dmmeta.xref field:lib_ams.FDb.zd_flush inscond:true via:"" -dmmeta.xref field:lib_ams.FDb.ind_stream inscond:true via:"" -dmmeta.xref field:lib_ams.FDb.cd_stream_hb inscond:false via:"" +dmmeta.xref field:lib_ams.FDb.ind_shm inscond:true via:"" +dmmeta.xref field:lib_ams.FDb.cd_hb inscond:false via:"" dmmeta.xref field:lib_ams.FDb.cd_poll_read inscond:false via:"" +dmmeta.xref field:lib_ams.FDb.cd_slow_poll_read inscond:false via:"" dmmeta.xref field:lib_ams.FDb.ind_proc inscond:true via:"" -dmmeta.xref field:lib_ams.FDb.ind_member inscond:true via:"" -dmmeta.xref field:lib_ams.FStream.zd_member_bystream inscond:true via:lib_ams.FDb.ind_stream/ams.Member.stream_id -dmmeta.xref field:lib_ams.FMember.p_stream inscond:true via:lib_ams.FDb.ind_stream/ams.Member.stream_id -dmmeta.xref field:lib_ams.FProc.zd_member_byproc inscond:true via:lib_ams.FDb.ind_proc/ams.Member.proc_id -dmmeta.xref field:lib_ams.FDb.ind_streamtype inscond:true via:"" -dmmeta.xref field:lib_ams.FStream.p_streamtype inscond:true via:lib_ams.FDb.ind_streamtype/ams.StreamId.stream_type -dmmeta.xref field:lib_ams.FDb.zd_ctlin inscond:false via:"" +dmmeta.xref field:lib_ams.FDb.ind_shmember inscond:true via:"" +dmmeta.xref field:lib_ams.FShmember.p_shm inscond:true via:lib_ams.FDb.ind_shm/ams.ShmemberId.shm_id +dmmeta.xref field:lib_ams.FDb.ind_shmtype inscond:true via:"" +dmmeta.xref field:lib_ams.FShm.p_shmtype inscond:true via:lib_ams.FDb.ind_shmtype/ams.ShmId.shmtype +dmmeta.xref field:lib_ams.FDb.c_ctlin inscond:false via:"" dmmeta.xref field:lib_ams.FDb.zd_proc inscond:true via:"" -dmmeta.xref field:lib_ams.FMember.p_proc inscond:true via:lib_ams.FDb.ind_proc/ams.Member.proc_id +dmmeta.xref field:lib_ams.FShmember.p_proc inscond:true via:lib_ams.FDb.ind_proc/ams.ShmemberId.proc_id +dmmeta.xref field:lib_ams.FDb.bh_shmember_read inscond:false via:"" +dmmeta.xref field:lib_ams.FProc.c_shm inscond:true via:lib_ams.FDb.ind_proc/ams.ShmId.proc_id dmmeta.xref field:lib_ctype.FDb.ind_fconst inscond:true via:"" dmmeta.xref field:lib_ctype.FDb.ind_fconst_key inscond:false via:"" dmmeta.xref field:lib_ctype.FDb.ind_ssimfile inscond:true via:"" @@ -658,8 +686,9 @@ dmmeta.xref field:lib_exec.FDb.zd_started inscond:false via:"" dmmeta.xref field:lib_fm.FDb.ind_alarm inscond:true via:"" dmmeta.xref field:lib_fm.FDb.ind_alm_code inscond:true via:"" dmmeta.xref field:lib_fm.FDb.ind_alm_objtype inscond:true via:"" -dmmeta.xref field:lib_json.FDb.ind_objfld inscond:"(NULL!=fldkey_Get(row).object)" via:"" +dmmeta.xref field:lib_json.FDb.ind_objfld inscond:"fldkey_Get(row).p_object" via:"" dmmeta.xref field:lib_json.FNode.c_child inscond:"row.p_parent != &row" via:lib_json.FNode.p_parent +dmmeta.xref field:lib_netio.FDb.ind_var inscond:true via:"" dmmeta.xref field:lib_sql.FDb.ind_attr inscond:true via:"" dmmeta.xref field:lib_sqlite.FDb.ind_conn inscond:true via:"" dmmeta.xref field:lib_sqlite.FDb.ind_field inscond:true via:"" @@ -686,6 +715,16 @@ dmmeta.xref field:orgfile.FDb.ind_filename inscond:true via:"" dmmeta.xref field:orgfile.FDb.ind_filehash inscond:true via:"" dmmeta.xref field:orgfile.FFilehash.c_filename inscond:true via:orgfile.FDb.ind_filehash/orgfile.FFilename.filehash dmmeta.xref field:orgfile.FFilename.p_filehash inscond:true via:orgfile.FDb.ind_filehash/orgfile.FFilename.filehash +dmmeta.xref field:samp_make.FDb.ind_gitfile inscond:true via:"" +dmmeta.xref field:samp_make.FDb.ind_target inscond:true via:"" +dmmeta.xref field:samp_make.FDb.ind_targdep inscond:true via:"" +dmmeta.xref field:samp_make.FDb.ind_targsrc inscond:true via:"" +dmmeta.xref field:samp_make.FDb.ind_targrec inscond:true via:"" +dmmeta.xref field:samp_make.FTarget.c_targsrc inscond:true via:samp_make.FDb.ind_target/sampdb.Targsrc.target +dmmeta.xref field:samp_make.FTarget.c_targdep inscond:true via:samp_make.FDb.ind_target/sampdb.Targdep.target +dmmeta.xref field:samp_make.FTarget.c_targrec inscond:true via:samp_make.FDb.ind_target/sampdb.Targrec.target +dmmeta.xref field:samp_make.FTargdep.p_parent inscond:true via:samp_make.FDb.ind_target/sampdb.Targdep.parent +dmmeta.xref field:samp_make.FTargdep.p_target inscond:true via:samp_make.FDb.ind_target/sampdb.Targdep.target dmmeta.xref field:samp_meng.FDb.ind_symbol inscond:true via:"" dmmeta.xref field:samp_meng.FDb.cd_fdin_eof inscond:false via:"" dmmeta.xref field:samp_meng.FDb.cd_fdin_read inscond:false via:"" @@ -701,8 +740,11 @@ dmmeta.xref field:src_func.FDb.bh_func inscond:true via:"" dmmeta.xref field:src_func.FDb.ind_func inscond:true via:"" dmmeta.xref field:src_func.FTargsrc.zd_func inscond:true via:src_func.FFunc.p_targsrc dmmeta.xref field:src_func.FTargsrc.p_target inscond:true via:src_func.FDb.ind_target/dev.Targsrc.target -dmmeta.xref field:src_func.FDb.ind_genprefix inscond:true via:"" dmmeta.xref field:src_func.FDb.ind_ctypelen inscond:true via:"" +dmmeta.xref field:src_func.FDb.ind_userfunc inscond:true via:"" +dmmeta.xref field:src_func.FDb.ind_userfunc_cppname inscond:true via:"" +dmmeta.xref field:src_func.FUserfunc.zd_func inscond:false via:src_func.FFunc.p_userfunc +dmmeta.xref field:src_func.FDb.ind_genaffix inscond:true via:"" dmmeta.xref field:src_hdr.FDb.ind_ns inscond:true via:"" dmmeta.xref field:src_hdr.FTarget.c_targsrc inscond:true via:src_hdr.FDb.ind_target/dev.Targsrc.target dmmeta.xref field:src_hdr.FNs.c_nsx inscond:true via:src_hdr.FDb.ind_ns/dmmeta.Nsx.ns diff --git a/data/gclidb/gclienvsub.ssim b/data/gclidb/gclienvsub.ssim index 05ec1a98..57c4bafa 100644 --- a/data/gclidb/gclienvsub.ssim +++ b/data/gclidb/gclienvsub.ssim @@ -1,6 +1,7 @@ gclidb.gclienvsub gclienvsub:all.$REPO fwd:Y rev:N uval:"" gclidb.gclienvsub gclienvsub:ghub.$GITDIR fwd:Y rev:N uval:ghub_vparizhs_ghp -gclidb.gclienvsub gclienvsub:ghub.$TOKEN fwd:Y rev:Y uval:REDACTED +gclidb.gclienvsub gclienvsub:ghub.$TOKEN fwd:Y rev:Y uval:test/gcli/github_token.base64 +gclidb.gclienvsub gclienvsub:ghub.$ID_RSA fwd:N rev:N uval:test/gcli/id_rsa_gclisvc.base64 gclidb.gclienvsub gclienvsub:ghub.$HOST fwd:Y rev:Y uval:https://api.github.com gclidb.gclienvsub gclienvsub:ghub.$IN_AUTH fwd:Y rev:Y uval:temp/.ssim_ghub gclidb.gclienvsub gclienvsub:ghub.$ISSUE fwd:Y rev:Y uval:"" @@ -12,7 +13,8 @@ gclidb.gclienvsub gclienvsub:ghub.$NOTE fwd:Y rev:N uval:"" gclidb.gclienvsub gclienvsub:ghub.$REPO fwd:Y rev:Y uval:vparizhs/ghp gclidb.gclienvsub gclienvsub:ghub.$USER fwd:Y rev:Y uval:vparizhs gclidb.gclienvsub gclienvsub:glab.$GITDIR fwd:Y rev:N uval:glab_glpat -gclidb.gclienvsub gclienvsub:glab.$TOKEN fwd:Y rev:Y uval:glpat-Hf38RB2J9GUZRhc54FCs +gclidb.gclienvsub gclienvsub:glab.$TOKEN fwd:Y rev:Y uval:test/gcli/gitlab_token.base64 +gclidb.gclienvsub gclienvsub:glab.$ID_RSA fwd:N rev:N uval:test/gcli/id_rsa_gclisvc.base64 gclidb.gclienvsub gclienvsub:glab.$HOST fwd:Y rev:Y uval:https://gitlab.vovaco.com gclidb.gclienvsub gclienvsub:glab.$IN_AUTH fwd:Y rev:Y uval:temp/.ssim_glab gclidb.gclienvsub gclienvsub:glab.$ISSUE fwd:Y rev:Y uval:"" @@ -22,4 +24,4 @@ gclidb.gclienvsub gclienvsub:glab.$MR fwd:Y rev:Y uval:"" gclidb.gclienvsub gclienvsub:glab.$MR_ fwd:N rev:Y uval:"" gclidb.gclienvsub gclienvsub:glab.$NOTE fwd:Y rev:N uval:"" gclidb.gclienvsub gclienvsub:glab.$REPO fwd:Y rev:Y uval:algornd/glpat -gclidb.gclienvsub gclienvsub:glab.$USER fwd:Y rev:Y uval:project_7_bot_c2b9d6b53237c073b0df26fc148838bb +gclidb.gclienvsub gclienvsub:glab.$USER fwd:Y rev:Y uval:vparizhs diff --git a/data/gclidb/gclisub.ssim b/data/gclidb/gclisub.ssim index ed9246c2..62887831 100644 --- a/data/gclidb/gclisub.ssim +++ b/data/gclidb/gclisub.ssim @@ -1,5 +1,6 @@ gclidb.gclisub gclisub:$GITDIR comment:"" gclidb.gclisub gclisub:$HOST comment:"" +gclidb.gclisub gclisub:$ID_RSA comment:"" gclidb.gclisub gclisub:$IN_AUTH comment:"" gclidb.gclisub gclisub:$ISSUE comment:"" gclidb.gclisub gclisub:"$ISSUE#" comment:"" diff --git a/data/gclidb/grepogitport.ssim b/data/gclidb/grepogitport.ssim deleted file mode 100644 index f47aa41d..00000000 --- a/data/gclidb/grepogitport.ssim +++ /dev/null @@ -1,3 +0,0 @@ -gclidb.grepogitport grepogitport:default port:22 comment:"" -gclidb.grepogitport grepogitport:github.com port:22 comment:"" -gclidb.grepogitport grepogitport:gitlab.vovaco.com port:1008 comment:"" diff --git a/data/gclidb/grepossh.ssim b/data/gclidb/grepossh.ssim deleted file mode 100644 index 08085102..00000000 --- a/data/gclidb/grepossh.ssim +++ /dev/null @@ -1,2 +0,0 @@ -gclidb.grepossh grepossh:glpat sshid:extern/gclitest/id_rsa_gclisvc comment:"" -gclidb.grepossh grepossh:vparizhs/ghp sshid:extern/gclitest/id_rsa_gclisvc comment:"" diff --git a/data/gclidb/gtblacttstout.ssim b/data/gclidb/gtblacttstout.ssim index 80834f0d..ba2fe32f 100644 --- a/data/gclidb/gtblacttstout.ssim +++ b/data/gclidb/gtblacttstout.ssim @@ -1,47 +1,11 @@ -gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.01 text:"$REPO git@github.com_22_id_rsa_gclisvc:$REPO.git (fetch)" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.02 text:"$REPO git@github.com_22_id_rsa_gclisvc:$REPO.git (push)" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.03 text:"$HOME/.ssh/config/config.d settings" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.04 text:"# Generated by gcli" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.05 text:"Host github.com_22_id_rsa_gclisvc" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.06 text:"HostName github.com" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.07 text:"Port 22" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.08 text:"IdentityFile ~/.ssh/id_rsa_gclisvc" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.09 text:"StrictHostKeyChecking no" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.10 text:"UserKnownHostsFile=/dev/null" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.11 text:"LogLevel=QUIET" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.01 text:"$REPO git@gitlab.vovaco.com_1008_id_rsa:$REPO.git (fetch)" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.02 text:"$REPO git@gitlab.vovaco.com_1008_id_rsa:$REPO.git (push)" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.03 text:"$HOME/.ssh/config/config.d settings" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.04 text:"# Generated by gcli" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.05 text:"Host gitlab.vovaco.com_1008_id_rsa" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.06 text:"HostName gitlab.vovaco.com" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.07 text:"Port 1008" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.08 text:"IdentityFile ~/.ssh/id_rsa" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.09 text:"StrictHostKeyChecking no" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.10 text:"UserKnownHostsFile=/dev/null" -gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.11 text:"LogLevel=QUIET" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.01 text:"$REPO git@github.com_22_id_rsa_gclisvc:$REPO.git (fetch)" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.02 text:"$REPO git@github.com_22_id_rsa_gclisvc:$REPO.git (push)" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.03 text:"$HOME/.ssh/config/config.d settings" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.04 text:"# Generated by gcli" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.05 text:"Host github.com_22_id_rsa_gclisvc" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.06 text:"HostName github.com" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.07 text:"Port 22" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.08 text:"IdentityFile ~/.ssh/id_rsa_gclisvc" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.09 text:"StrictHostKeyChecking no" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.10 text:"UserKnownHostsFile=/dev/null" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.11 text:"LogLevel=QUIET" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.01 text:"$REPO git@gitlab.vovaco.com_1008_id_rsa:$REPO.git (fetch)" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.02 text:"$REPO git@gitlab.vovaco.com_1008_id_rsa:$REPO.git (push)" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.03 text:"$HOME/.ssh/config/config.d settings" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.04 text:"# Generated by gcli" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.05 text:"Host gitlab.vovaco.com_1008_id_rsa" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.06 text:"HostName gitlab.vovaco.com" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.07 text:"Port 1008" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.08 text:"IdentityFile ~/.ssh/id_rsa" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.09 text:"StrictHostKeyChecking no" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.10 text:"UserKnownHostsFile=/dev/null" -gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.11 text:"LogLevel=QUIET" +gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.01 text:"$REPO git@github.com:$REPO.git (fetch)" +gclidb.gtblacttstout gtblacttstout:gitconfig_create.ghub.ghub.02 text:"$REPO git@github.com:$REPO.git (push)" +gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.01 text:"$REPO ssh://git@gitlab.vovaco.com:1008/$REPO.git (fetch)" +gclidb.gtblacttstout gtblacttstout:gitconfig_create.glab.glab.02 text:"$REPO ssh://git@gitlab.vovaco.com:1008/$REPO.git (push)" +gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.01 text:"$REPO git@github.com:$REPO.git (fetch)" +gclidb.gtblacttstout gtblacttstout:gitconfig_list.ghub.01.02 text:"$REPO git@github.com:$REPO.git (push)" +gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.01 text:"$REPO ssh://git@gitlab.vovaco.com:1008/$REPO.git (fetch)" +gclidb.gtblacttstout gtblacttstout:gitconfig_list.glab.02.02 text:"$REPO ssh://git@gitlab.vovaco.com:1008/$REPO.git (push)" gclidb.gtblacttstout gtblacttstout:help_list.all.01.01 text:"TABLE USE/DFLT COMMENT" gclidb.gtblacttstout gtblacttstout:help_list.all.01.02 text:"gitconfig git remote configuration" gclidb.gtblacttstout gtblacttstout:help_list.all.01.03 text:"help this help screen" @@ -180,7 +144,7 @@ gclidb.gtblacttstout gtblacttstout:help_list.all.05.16 text:"[repo:regx value] gclidb.gtblacttstout gtblacttstout:help_list.all.05.17 text:" set token for repo" gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start.02 text:"$ISSUE $USER open create_start_test" -gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start.03 text:"Branch '$ISSUE' set up to track remote branch 'master' from '$REPO'." +gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start.03 text:"branch '$ISSUE' set up to track '$REPO/master'." gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start.04 text:"Issue $ISSUE# create_start_test" gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start.05 text:"closes $ISSUE#" gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start.06 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" @@ -188,7 +152,7 @@ gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start.07 text:"$IS gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start.08 text:DESCRIPTION gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start_stop.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start_stop.02 text:"$ISSUE $USER open create_start_test" -gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start_stop.03 text:"Branch '$ISSUE' set up to track remote branch 'master' from '$REPO'." +gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start_stop.03 text:"branch '$ISSUE' set up to track '$REPO/master'." gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start_stop.04 text:"Issue $ISSUE# create_start_test" gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start_stop.05 text:"closes $ISSUE#" gclidb.gtblacttstout gtblacttstout:issue_create.ghub.create_start_stop.06 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" @@ -198,7 +162,7 @@ gclidb.gtblacttstout gtblacttstout:issue_create.ghub.ghub.01 text:"ISSUE MR AU gclidb.gtblacttstout gtblacttstout:issue_create.ghub.ghub.02 text:"$ISSUE $USER label open issue_create_gcli" gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start.02 text:"$ISSUE $USER opened create_start_test" -gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start.03 text:"Branch '$ISSUE' set up to track remote branch 'master' from '$REPO'." +gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start.03 text:"branch '$ISSUE' set up to track '$REPO/master'." gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start.04 text:"Issue $ISSUE# create_start_test" gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start.05 text:"closes $ISSUE#" gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start.06 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" @@ -206,7 +170,7 @@ gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start.07 text:"$IS gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start.08 text:DESCRIPTION gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start_stop.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start_stop.02 text:"$ISSUE $USER opened create_start_test" -gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start_stop.03 text:"Branch '$ISSUE' set up to track remote branch 'master' from '$REPO'." +gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start_stop.03 text:"branch '$ISSUE' set up to track '$REPO/master'." gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start_stop.04 text:"Issue $ISSUE# create_start_test" gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start_stop.05 text:"closes $ISSUE#" gclidb.gtblacttstout gtblacttstout:issue_create.glab.create_start_stop.06 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" @@ -231,15 +195,15 @@ gclidb.gtblacttstout gtblacttstout:issue_list.ghub.issuenote_ghub.04 text:"ISS gclidb.gtblacttstout gtblacttstout:issue_list.ghub.issuenote_ghub.05 text:"$NOTE $USER" gclidb.gtblacttstout gtblacttstout:issue_list.ghub.issuenote_ghub.06 text:issuenote_create_gcli gclidb.gtblacttstout gtblacttstout:issue_list.glab.02.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" -gclidb.gtblacttstout gtblacttstout:issue_list.glab.02.02 text:"$ISSUE $USER opened issue_show_first" +gclidb.gtblacttstout gtblacttstout:issue_list.glab.02.02 text:"$ISSUE ghost opened issue_show_first" gclidb.gtblacttstout gtblacttstout:issue_list.glab.04.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" -gclidb.gtblacttstout gtblacttstout:issue_list.glab.04.02 text:"$ISSUE $USER opened issue_show_state" +gclidb.gtblacttstout gtblacttstout:issue_list.glab.04.02 text:"$ISSUE ghost opened issue_show_state" gclidb.gtblacttstout gtblacttstout:issue_list.glab.06.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" -gclidb.gtblacttstout gtblacttstout:issue_list.glab.06.02 text:"$ISSUE $USER closed issue_show_state" +gclidb.gtblacttstout gtblacttstout:issue_list.glab.06.02 text:"$ISSUE ghost closed issue_show_state" gclidb.gtblacttstout gtblacttstout:issue_list.glab.07.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" -gclidb.gtblacttstout gtblacttstout:issue_list.glab.07.02 text:"$ISSUE $USER opened issue_show_assigned" +gclidb.gtblacttstout gtblacttstout:issue_list.glab.07.02 text:"$ISSUE ghost opened issue_show_assigned" gclidb.gtblacttstout gtblacttstout:issue_list.glab.08.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" -gclidb.gtblacttstout gtblacttstout:issue_list.glab.08.02 text:"$ISSUE $USER vparizhs opened issue_show_assigned" +gclidb.gtblacttstout gtblacttstout:issue_list.glab.08.02 text:"$ISSUE ghost $USER opened issue_show_assigned" gclidb.gtblacttstout gtblacttstout:issue_list.glab.issuenote_glab.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" gclidb.gtblacttstout gtblacttstout:issue_list.glab.issuenote_glab.02 text:"$ISSUE $USER label opened issue_create_gcli" gclidb.gtblacttstout gtblacttstout:issue_list.glab.issuenote_glab.03 text:DESCRIPTION @@ -258,7 +222,7 @@ gclidb.gtblacttstout gtblacttstout:issue_needs_work.glab.03 text:DESCRIPTION gclidb.gtblacttstout gtblacttstout:issue_needs_work.glab.04 text:"ISSUENOTE AUTHOR" gclidb.gtblacttstout gtblacttstout:issue_needs_work.glab.05 text:"$NOTE $USER" gclidb.gtblacttstout gtblacttstout:issue_needs_work.glab.06 text:issuenote_create_gcli -gclidb.gtblacttstout gtblacttstout:issue_start.ghub.ghub.01 text:"Branch '$ISSUE' set up to track remote branch 'master' from '$REPO'." +gclidb.gtblacttstout gtblacttstout:issue_start.ghub.ghub.01 text:"branch '$ISSUE' set up to track '$REPO/master'." gclidb.gtblacttstout gtblacttstout:issue_start.ghub.ghub.02 text:"Issue $ISSUE# issue_create_gcli" gclidb.gtblacttstout gtblacttstout:issue_start.ghub.ghub.03 text:"closes $ISSUE#" gclidb.gtblacttstout gtblacttstout:issue_start.ghub.ghub.04 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" @@ -267,7 +231,7 @@ gclidb.gtblacttstout gtblacttstout:issue_start.ghub.ghub.06 text:DESCRIPTION gclidb.gtblacttstout gtblacttstout:issue_start.ghub.ghub.07 text:"ISSUENOTE AUTHOR" gclidb.gtblacttstout gtblacttstout:issue_start.ghub.ghub.08 text:"$NOTE $USER" gclidb.gtblacttstout gtblacttstout:issue_start.ghub.ghub.09 text:issuenote_update_gcli -gclidb.gtblacttstout gtblacttstout:issue_start.glab.glab.01 text:"Branch '$ISSUE' set up to track remote branch 'master' from '$REPO'." +gclidb.gtblacttstout gtblacttstout:issue_start.glab.glab.01 text:"branch '$ISSUE' set up to track '$REPO/master'." gclidb.gtblacttstout gtblacttstout:issue_start.glab.glab.02 text:"Issue $ISSUE# issue_create_gcli" gclidb.gtblacttstout gtblacttstout:issue_start.glab.glab.03 text:"closes $ISSUE#" gclidb.gtblacttstout gtblacttstout:issue_start.glab.glab.04 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" @@ -331,23 +295,24 @@ gclidb.gtblacttstout gtblacttstout:issue_update.glab.04.04 text:"ISSUENOTE AUT gclidb.gtblacttstout gtblacttstout:issue_update.glab.04.05 text:"$NOTE $USER" gclidb.gtblacttstout gtblacttstout:issue_update.glab.04.06 text:issuenote_update_gcli gclidb.gtblacttstout gtblacttstout:issue_update.glab.07.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" -gclidb.gtblacttstout gtblacttstout:issue_update.glab.07.02 text:"$ISSUE $USER L1,L2 vparizhs opened issue_update_gcli" +gclidb.gtblacttstout gtblacttstout:issue_update.glab.07.02 text:"$ISSUE $USER L1,L2 $USER opened issue_update_gcli" gclidb.gtblacttstout gtblacttstout:issue_update.glab.07.03 text:DESCRIPTION gclidb.gtblacttstout gtblacttstout:issue_update.glab.07.04 text:"ISSUENOTE AUTHOR" gclidb.gtblacttstout gtblacttstout:issue_update.glab.07.05 text:"$NOTE $USER" gclidb.gtblacttstout gtblacttstout:issue_update.glab.07.06 text:issuenote_update_gcli gclidb.gtblacttstout gtblacttstout:issue_update.glab.08.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" -gclidb.gtblacttstout gtblacttstout:issue_update.glab.08.02 text:"$ISSUE $USER opened issue_create_gcli" +gclidb.gtblacttstout gtblacttstout:issue_update.glab.08.02 text:"$ISSUE $USER closed issue_create_gcli" gclidb.gtblacttstout gtblacttstout:issue_update.glab.08.03 text:DESCRIPTION gclidb.gtblacttstout gtblacttstout:issue_update.glab.08.04 text:"ISSUENOTE AUTHOR" gclidb.gtblacttstout gtblacttstout:issue_update.glab.08.05 text:"$NOTE $USER" gclidb.gtblacttstout gtblacttstout:issue_update.glab.08.06 text:issuenote_update_gcli -gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" -gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.02 text:"$ISSUE $USER closed issue_create_gcli" -gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.03 text:DESCRIPTION -gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.04 text:"ISSUENOTE AUTHOR" -gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.05 text:"$NOTE $USER" -gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.06 text:issuenote_update_gcli +gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.01 text:"Issue has no changes." +gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.02 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" +gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.03 text:"$ISSUE $USER closed issue_create_gcli" +gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.04 text:DESCRIPTION +gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.05 text:"ISSUENOTE AUTHOR" +gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.06 text:"$NOTE $USER" +gclidb.gtblacttstout gtblacttstout:issue_update.glab.glab_last.07 text:issuenote_update_gcli gclidb.gtblacttstout gtblacttstout:issuenote_create.ghub.ghub.01 text:"ISSUE MR AUTHOR LABELS ASSIGNEE MILESTONE STATE TITLE" gclidb.gtblacttstout gtblacttstout:issuenote_create.ghub.ghub.02 text:"$ISSUE $USER label open issue_create_gcli" gclidb.gtblacttstout gtblacttstout:issuenote_create.ghub.ghub.03 text:DESCRIPTION @@ -420,8 +385,9 @@ gclidb.gtblacttstout gtblacttstout:mr_create.glab.create_accept.02 text:"MR IS gclidb.gtblacttstout gtblacttstout:mr_create.glab.create_accept.03 text:"$MR $ISSUE $USER opened Draft: Issue $ISSUE# create_start_test" gclidb.gtblacttstout gtblacttstout:mr_create.glab.create_accept.04 text:"MR ISSUE AUTHOR REVIEWER PIPELINE STATE TITLE" gclidb.gtblacttstout gtblacttstout:mr_create.glab.create_accept.05 text:"$MR $ISSUE $USER opened Issue $ISSUE# create_start_test" -gclidb.gtblacttstout gtblacttstout:mr_create.glab.create_accept.06 text:"MR ISSUE AUTHOR REVIEWER PIPELINE STATE TITLE" -gclidb.gtblacttstout gtblacttstout:mr_create.glab.create_accept.07 text:"$MR $ISSUE $USER merged Issue $ISSUE# create_start_test" +gclidb.gtblacttstout gtblacttstout:mr_create.glab.create_accept.06 text:'gcli.error status:"HTTP/1.1 405 Method Not Allowed" message:"405 Method Not Allowed" reason:NA' +gclidb.gtblacttstout gtblacttstout:mr_create.glab.create_accept.07 text:"MR ISSUE AUTHOR REVIEWER PIPELINE STATE TITLE" +gclidb.gtblacttstout gtblacttstout:mr_create.glab.create_accept.08 text:"$MR $ISSUE $USER merged Issue $ISSUE# create_start_test" gclidb.gtblacttstout gtblacttstout:mr_create.glab.glab.01 text:"git -C temp/.glab_glpat push $REPO HEAD -f" gclidb.gtblacttstout gtblacttstout:mr_create.glab.glab.02 text:"MR ISSUE AUTHOR REVIEWER PIPELINE STATE TITLE" gclidb.gtblacttstout gtblacttstout:mr_create.glab.glab.03 text:"$MR $ISSUE $USER opened Draft: Issue $ISSUE# issue_create_gcli" @@ -452,8 +418,8 @@ gclidb.gtblacttstout gtblacttstout:mr_needs_work.ghub.02.01 text:"MR ISSUE AUT gclidb.gtblacttstout gtblacttstout:mr_needs_work.ghub.02.02 text:"$MR $ISSUE $USER open/draft mr_update_title $MR" gclidb.gtblacttstout gtblacttstout:mr_needs_work.glab.01.01 text:"MR ISSUE AUTHOR REVIEWER PIPELINE STATE TITLE" gclidb.gtblacttstout gtblacttstout:mr_needs_work.glab.01.02 text:"$MR $ISSUE $USER opened/draft Draft: mr_update_title $MR" -gclidb.gtblacttstout gtblacttstout:mr_start.ghub.01 text:"Branch '$MR_' set up to track remote branch '$ISSUE' from '$REPO'." -gclidb.gtblacttstout gtblacttstout:mr_start.glab.01 text:"Branch '$MR_' set up to track remote branch '$ISSUE' from '$REPO'." +gclidb.gtblacttstout gtblacttstout:mr_start.ghub.01 text:"branch '$MR_' set up to track '$REPO/$ISSUE'." +gclidb.gtblacttstout gtblacttstout:mr_start.glab.01 text:"branch '$MR_' set up to track '$REPO/$ISSUE'." gclidb.gtblacttstout gtblacttstout:mr_update.ghub.02.01 text:"MR ISSUE AUTHOR REVIEWER PIPELINE STATE TITLE" gclidb.gtblacttstout gtblacttstout:mr_update.ghub.02.02 text:"$MR $ISSUE $USER open/draft mr_update_title $MR" gclidb.gtblacttstout gtblacttstout:mr_update.ghub.02.03 text:DESCRIPTION diff --git a/data/httpdb/content.ssim b/data/httpdb/content.ssim new file mode 100644 index 00000000..bdc8ddce --- /dev/null +++ b/data/httpdb/content.ssim @@ -0,0 +1,34 @@ +httpdb.content content:application/gzip description:"GZip archive" +httpdb.content content:application/json description:"JavaScript Object Notation" +httpdb.content content:application/octet-stream description:"Arbitrary binary data" +httpdb.content content:application/pdf description:"Portable Document Format" +httpdb.content content:application/vnd.ms-excel description:"Microsoft Excel spreadsheet" +httpdb.content content:application/vnd.openxmlformats-officedocument.wordprocessingml.document description:"MS Word DOCX document" +httpdb.content content:application/x-protobuf description:"Protocol Buffers binary format" +httpdb.content content:application/x-www-form-urlencoded description:"Form data encoding" +httpdb.content content:application/xml description:"XML application format" +httpdb.content content:application/zip description:"ZIP archive" +httpdb.content content:audio/mpeg description:"MP3 audio" +httpdb.content content:audio/ogg description:"Ogg Vorbis audio" +httpdb.content content:audio/wav description:"Waveform Audio" +httpdb.content content:audio/webm description:"WebM audio" +httpdb.content content:image/avif description:"AVIF image format" +httpdb.content content:image/bmp description:"Bitmap image" +httpdb.content content:image/gif description:"GIF image" +httpdb.content content:image/jpeg description:"JPEG image" +httpdb.content content:image/png description:"PNG image" +httpdb.content content:image/svg+xml description:"Scalable Vector Graphics" +httpdb.content content:image/webp description:"WebP image" +httpdb.content content:multipart/form-data description:"Form with file upload" +httpdb.content content:multipart/mixed description:"Multiple parts, mixed" +httpdb.content content:multipart/related description:"Related multipart body" +httpdb.content content:text/css description:"Cascading Style Sheets" +httpdb.content content:text/csv description:"Comma-separated values" +httpdb.content content:text/html description:"HTML document" +httpdb.content content:text/javascript description:"Legacy JavaScript type" +httpdb.content content:text/plain description:"raw text" +httpdb.content content:text/xml description:"XML text" +httpdb.content content:video/mp4 description:"MPEG-4 video" +httpdb.content content:video/ogg description:"Ogg Theora video" +httpdb.content content:video/webm description:"WebM video" +httpdb.content content:video/x-msvideo description:"AVI video" diff --git a/data/httpdb/header.ssim b/data/httpdb/header.ssim new file mode 100644 index 00000000..c57f6c53 --- /dev/null +++ b/data/httpdb/header.ssim @@ -0,0 +1,52 @@ +httpdb.header header:accept comment:"" +httpdb.header header:accept-charset comment:"" +httpdb.header header:accept-encoding comment:"" +httpdb.header header:accept-language comment:"" +httpdb.header header:accept-ranges comment:"" +httpdb.header header:age comment:"" +httpdb.header header:allow comment:"" +httpdb.header header:authorization comment:"" +httpdb.header header:cache-control comment:"" +httpdb.header header:connection comment:"" +httpdb.header header:content-encoding comment:"" +httpdb.header header:content-language comment:"" +httpdb.header header:content-length comment:"" +httpdb.header header:content-location comment:"" +httpdb.header header:content-md5 comment:"" +httpdb.header header:content-range comment:"" +httpdb.header header:content-type comment:"" +httpdb.header header:date comment:"" +httpdb.header header:etag comment:"" +httpdb.header header:expect comment:"" +httpdb.header header:expires comment:"" +httpdb.header header:from comment:"" +httpdb.header header:host comment:"" +httpdb.header header:if-match comment:"" +httpdb.header header:if-modified-since comment:"" +httpdb.header header:if-none-match comment:"" +httpdb.header header:if-range comment:"" +httpdb.header header:if-unmodified-since comment:"" +httpdb.header header:last-modified comment:"" +httpdb.header header:location comment:"" +httpdb.header header:max-forwards comment:"" +httpdb.header header:pragma comment:"" +httpdb.header header:proxy-authenticate comment:"" +httpdb.header header:proxy-authorization comment:"" +httpdb.header header:range comment:"" +httpdb.header header:referer comment:"" +httpdb.header header:retry-after comment:"" +httpdb.header header:sec-websocket-accept comment:"" +httpdb.header header:sec-websocket-extensions comment:"" +httpdb.header header:sec-websocket-key comment:"" +httpdb.header header:sec-websocket-protocol comment:"" +httpdb.header header:sec-websocket-version comment:"" +httpdb.header header:server comment:"" +httpdb.header header:te comment:"" +httpdb.header header:trailer comment:"" +httpdb.header header:transfer-encoding comment:"" +httpdb.header header:upgrade comment:"" +httpdb.header header:user-agent comment:"" +httpdb.header header:vary comment:"" +httpdb.header header:via comment:"" +httpdb.header header:warning comment:"" +httpdb.header header:www-authenticate comment:"" diff --git a/data/httpdb/method.ssim b/data/httpdb/method.ssim new file mode 100644 index 00000000..69cee07a --- /dev/null +++ b/data/httpdb/method.ssim @@ -0,0 +1,8 @@ +httpdb.method method:GET id:1 comment:"Transfer a current representation of the target resource" +httpdb.method method:HEAD id:2 comment:"Same as GET, but do not transfer the response content" +httpdb.method method:POST id:3 comment:"Perform resource-specific processing on the request content" +httpdb.method method:PUT id:4 comment:"Replace all current representations of the target resource with the request content" +httpdb.method method:DELETE id:5 comment:"Remove all current representations of the target resource" +httpdb.method method:CONNECT id:6 comment:"Establish a tunnel to the server identified by the target resource" +httpdb.method method:OPTIONS id:7 comment:"Describe the communication options for the target resource" +httpdb.method method:TRACE id:8 comment:"Perform a message loop-back test along the path to the target resource" diff --git a/data/httpdb/status.ssim b/data/httpdb/status.ssim new file mode 100644 index 00000000..38288e5b --- /dev/null +++ b/data/httpdb/status.ssim @@ -0,0 +1,40 @@ +httpdb.status status:"100 Continue" +httpdb.status status:"101 Switching Protocols" +httpdb.status status:"200 OK" +httpdb.status status:"201 Created" +httpdb.status status:"202 Accepted" +httpdb.status status:"203 Non-Authoritative Information" +httpdb.status status:"204 No Content" +httpdb.status status:"205 Reset Content" +httpdb.status status:"206 Partial Content" +httpdb.status status:"300 Multiple Choices" +httpdb.status status:"301 Moved Permanently" +httpdb.status status:"302 Found" +httpdb.status status:"303 See Other" +httpdb.status status:"304 Not Modified" +httpdb.status status:"305 Use Proxy" +httpdb.status status:"307 Temporary Redirect" +httpdb.status status:"400 Bad Request" +httpdb.status status:"401 Unauthorized" +httpdb.status status:"402 Payment Required" +httpdb.status status:"403 Forbidden" +httpdb.status status:"404 Not Found" +httpdb.status status:"405 Method Not Allowed" +httpdb.status status:"406 Not Acceptable" +httpdb.status status:"407 Proxy Authentication Required" +httpdb.status status:"408 Request Time-out" +httpdb.status status:"409 Conflict" +httpdb.status status:"410 Gone" +httpdb.status status:"411 Length Required" +httpdb.status status:"412 Precondition Failed" +httpdb.status status:"413 Request Entity Too Large" +httpdb.status status:"414 Request-URI Too Large" +httpdb.status status:"415 Unsupported Media Type" +httpdb.status status:"416 Requested range not satisfiable" +httpdb.status status:"417 Expectation Failed" +httpdb.status status:"500 Internal Server Error" +httpdb.status status:"501 Not Implemented" +httpdb.status status:"502 Bad Gateway" +httpdb.status status:"503 Service Unavailable" +httpdb.status status:"504 Gateway Time-out" +httpdb.status status:"505 HTTP Version not supported" diff --git a/data/httpdb/version.ssim b/data/httpdb/version.ssim new file mode 100644 index 00000000..740e70eb --- /dev/null +++ b/data/httpdb/version.ssim @@ -0,0 +1,5 @@ +httpdb.version version:HTTP/0.9 comment:"RFC 1945" +httpdb.version version:HTTP/1.0 comment:"RFC 1945" +httpdb.version version:HTTP/1.1 comment:"RFC 9112" +httpdb.version version:HTTP/2.0 comment:"RFC 9113" +httpdb.version version:HTTP/3.0 comment:"RFC 9114" diff --git a/data/sampdb/gitfile.ssim b/data/sampdb/gitfile.ssim new file mode 100644 index 00000000..4fa73f75 --- /dev/null +++ b/data/sampdb/gitfile.ssim @@ -0,0 +1,11 @@ +sampdb.gitfile gitfile:buffer.h comment:"" +sampdb.gitfile gitfile:command.c comment:"" +sampdb.gitfile gitfile:command.h comment:"" +sampdb.gitfile gitfile:defs.h comment:"" +sampdb.gitfile gitfile:display.c comment:"" +sampdb.gitfile gitfile:files.c comment:"" +sampdb.gitfile gitfile:insert.c comment:"" +sampdb.gitfile gitfile:kbd.c comment:"" +sampdb.gitfile gitfile:main.c comment:"" +sampdb.gitfile gitfile:search.c comment:"" +sampdb.gitfile gitfile:utils.c comment:"" diff --git a/data/sampdb/targdep.ssim b/data/sampdb/targdep.ssim new file mode 100644 index 00000000..b0f5e25f --- /dev/null +++ b/data/sampdb/targdep.ssim @@ -0,0 +1,17 @@ +sampdb.targdep targdep:clean.command.o rec:Y pre:N comment:"" +sampdb.targdep targdep:clean.display.o rec:Y pre:N comment:"" +sampdb.targdep targdep:clean.edit rec:Y pre:N comment:"" +sampdb.targdep targdep:clean.files.o rec:Y pre:N comment:"" +sampdb.targdep targdep:clean.insert.o rec:Y pre:N comment:"" +sampdb.targdep targdep:clean.kbd.o rec:Y pre:N comment:"" +sampdb.targdep targdep:clean.main.o rec:Y pre:N comment:"" +sampdb.targdep targdep:clean.search.o rec:Y pre:N comment:"" +sampdb.targdep targdep:clean.utils.o rec:Y pre:N comment:"" +sampdb.targdep targdep:edit.command.o rec:Y pre:Y comment:"" +sampdb.targdep targdep:edit.display.o rec:Y pre:Y comment:"" +sampdb.targdep targdep:edit.files.o rec:Y pre:Y comment:"" +sampdb.targdep targdep:edit.insert.o rec:Y pre:Y comment:"" +sampdb.targdep targdep:edit.kbd.o rec:Y pre:Y comment:"" +sampdb.targdep targdep:edit.main.o rec:Y pre:Y comment:"" +sampdb.targdep targdep:edit.search.o rec:Y pre:Y comment:"" +sampdb.targdep targdep:edit.utils.o rec:Y pre:Y comment:"" diff --git a/data/sampdb/target.ssim b/data/sampdb/target.ssim new file mode 100644 index 00000000..44859943 --- /dev/null +++ b/data/sampdb/target.ssim @@ -0,0 +1,10 @@ +sampdb.target target:clean dflt:N comment:"" +sampdb.target target:command.o dflt:N comment:"" +sampdb.target target:display.o dflt:N comment:"" +sampdb.target target:edit dflt:Y comment:"" +sampdb.target target:files.o dflt:N comment:"" +sampdb.target target:insert.o dflt:N comment:"" +sampdb.target target:kbd.o dflt:N comment:"" +sampdb.target target:main.o dflt:N comment:"" +sampdb.target target:search.o dflt:N comment:"" +sampdb.target target:utils.o dflt:N comment:"" diff --git a/data/sampdb/targrec.ssim b/data/sampdb/targrec.ssim new file mode 100644 index 00000000..a722ace3 --- /dev/null +++ b/data/sampdb/targrec.ssim @@ -0,0 +1,10 @@ +sampdb.targrec target:clean recipe:rm comment:"" +sampdb.targrec target:command.o recipe:"cc -c" comment:"" +sampdb.targrec target:display.o recipe:"cc -c" comment:"" +sampdb.targrec target:edit recipe:"cc -o edit" comment:"" +sampdb.targrec target:files.o recipe:"cc -c" comment:"" +sampdb.targrec target:insert.o recipe:"cc -c" comment:"" +sampdb.targrec target:kbd.o recipe:"cc -c" comment:"" +sampdb.targrec target:main.o recipe:"cc -c" comment:"" +sampdb.targrec target:search.o recipe:"cc -c" comment:"" +sampdb.targrec target:utils.o recipe:"cc -c" comment:"" diff --git a/data/sampdb/targsrc.ssim b/data/sampdb/targsrc.ssim new file mode 100644 index 00000000..756c5734 --- /dev/null +++ b/data/sampdb/targsrc.ssim @@ -0,0 +1,23 @@ +sampdb.targsrc targsrc:command.o/command.c pre:Y rec:Y comment:"" +sampdb.targsrc targsrc:command.o/command.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:command.o/defs.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:display.o/buffer.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:display.o/defs.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:display.o/display.c pre:Y rec:Y comment:"" +sampdb.targsrc targsrc:files.o/buffer.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:files.o/command.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:files.o/defs.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:files.o/files.c pre:Y rec:Y comment:"" +sampdb.targsrc targsrc:insert.o/buffer.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:insert.o/defs.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:insert.o/insert.c pre:Y rec:Y comment:"" +sampdb.targsrc targsrc:kbd.o/command.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:kbd.o/defs.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:kbd.o/kbd.c pre:Y rec:Y comment:"" +sampdb.targsrc targsrc:main.o/defs.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:main.o/main.c pre:Y rec:Y comment:"" +sampdb.targsrc targsrc:search.o/buffer.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:search.o/defs.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:search.o/search.c pre:Y rec:Y comment:"" +sampdb.targsrc targsrc:utils.o/defs.h pre:Y rec:N comment:"" +sampdb.targsrc targsrc:utils.o/utils.c pre:Y rec:Y comment:"" diff --git a/data/wsdb/status.ssim b/data/wsdb/status.ssim new file mode 100644 index 00000000..2cb27a6b --- /dev/null +++ b/data/wsdb/status.ssim @@ -0,0 +1,12 @@ +wsdb.status code:1000 reason:"Normal closure" local_only:N comment:"" +wsdb.status code:1001 reason:"Going away" local_only:N comment:"Server going down or browser page close" +wsdb.status code:1002 reason:"Protocol error" local_only:N comment:"" +wsdb.status code:1003 reason:"Unsupported message data type" local_only:N comment:"Text message while expecting binary and vice-versa" +wsdb.status code:1005 reason:"No status code" local_only:Y comment:"No status code received in remote close message" +wsdb.status code:1006 reason:"Abnormal closure" local_only:Y comment:"Lower layer failure" +wsdb.status code:1007 reason:"Invalid message data" local_only:N comment:"E.g. non-UTF-8 within text message" +wsdb.status code:1008 reason:"Policy violation" local_only:N comment:"" +wsdb.status code:1009 reason:"Message too big" local_only:N comment:"" +wsdb.status code:1010 reason:"Missing extension" local_only:N comment:"" +wsdb.status code:1011 reason:"Internal error" local_only:N comment:"" +wsdb.status code:1015 reason:"TLS Handshake" local_only:Y comment:"" diff --git a/extern/gclitest/id_rsa_gclisvc b/extern/gclitest/id_rsa_gclisvc deleted file mode 100644 index 32eff225..00000000 --- a/extern/gclitest/id_rsa_gclisvc +++ /dev/null @@ -1,39 +0,0 @@ ------BEGIN OPENSSH PRIVATE KEY----- -b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn -NhAAAAAwEAAQAAAYEAq4aXHeZG6FQ8w05erCyWERbTaI3wW538ijw9w0O0G99zdX0Gpwi4 -WmWZ1tB4DKKkDZ6iLYTCT0dbqxlSE5vJhvk3ABeZ7wHtO89L8bmCzpnxQOBCUW9qknRZkO -LgePa85mGaQqcm2UHNKkY3BKKsTx8kcXZkc9HYTGigM/Kp9Op5DoSYN0iu9s2ulBOxF6RO -4jU2gmf9XVDJAIta5QWmOxDipmUhGLez2DZi/nR6eBOEjrA6ZIygRayVBZ1cldiz4AwQl+ -QKPnA/OCVjfMTdzfXqsqfQ5nAesx1QFhMMuedZB6gWaYwnoPgKOwTBtb9OY+D+ZyuABout -xiBl+sjx2HCs7zchN4bCFc+DwS1GKhJJBzkKms+zW6Fm0FKoBar1udQ+PUVSPEo9/39nYW -i7HdjnBii5GThaleUOtwagC7wdXqmZd+XH8BMMSByL1urO+Ug1G9YV3rO9t2HrQae5+FO2 -hqFiintpt48apb7wHsNlaQFURQSSAwGEk2WKb6iJAAAFoE0s67xNLOu8AAAAB3NzaC1yc2 -EAAAGBAKuGlx3mRuhUPMNOXqwslhEW02iN8Fud/Io8PcNDtBvfc3V9BqcIuFplmdbQeAyi -pA2eoi2Ewk9HW6sZUhObyYb5NwAXme8B7TvPS/G5gs6Z8UDgQlFvapJ0WZDi4Hj2vOZhmk -KnJtlBzSpGNwSirE8fJHF2ZHPR2ExooDPyqfTqeQ6EmDdIrvbNrpQTsRekTuI1NoJn/V1Q -yQCLWuUFpjsQ4qZlIRi3s9g2Yv50engThI6wOmSMoEWslQWdXJXYs+AMEJfkCj5wPzglY3 -zE3c316rKn0OZwHrMdUBYTDLnnWQeoFmmMJ6D4CjsEwbW/TmPg/mcrgAaLrcYgZfrI8dhw -rO83ITeGwhXPg8EtRioSSQc5CprPs1uhZtBSqAWq9bnUPj1FUjxKPf9/Z2Foux3Y5wYouR -k4WpXlDrcGoAu8HV6pmXflx/ATDEgci9bqzvlINRvWFd6zvbdh60GnufhTtoahYop7abeP -GqW+8B7DZWkBVEUEkgMBhJNlim+oiQAAAAMBAAEAAAGABx0mJoCO4iMKQRxpO0apyQF+GP -jtZiiuLmqIsjucMZ1py7k40ykpV4sdX1uBOx7suGmNoYnUcuwgo77sA0cDtkl0QUNOqFXC -CdK+EYNc5uYwwLzRq1B4Zk9qiTfg+6Cvcsugqvvald9PhnMSjuqTRGskJwuJZ4Slbf0six -2uSauG2UthB8adMRG/QuzH0b/yte7jOPMzVCaIq5vb/sx7mY6zTmzlJkIKNLZZZ+MbUuBr -r+z5ra1nwUlYMJCB+ZoFlvCkX3Xht2R+T4/UDTNNOknHf2foPKhb6i+ksh1K677nE6xqXz -o3vIfTbWTnR3nw3b8P94kY2tY+NAtK6S2gogfJ5RPPlW+QT3w726JtK1nnOMNu9cRLOIXV -140UGhspfwfxChB0rAebskKye2zkE0LRAmsR/hvGmohVWcSnFK4vm0IA3A7ONICTRnAeRL -mTBJWNyeDzMf2GYRoZG+MxydZA+PC5MlFZ+9sC25OcL2o3kcMc9NGDNfe3I4HiXbVNAAAA -wQDUNo68fRLvFMWgEdRzSAZrPNnxv2/B4gUV6T3OVViDA+lRv4hAXnNkEOe5hPFKitv72n -sqfFiQSQHvzCVPeS//S9tiGW/f84gV4n8vvIHxwHwb/gYxLYjQ6TtJ8XeUUD9wk03yzkrC -hQ6/r9KHP5e2pW7gw9LoJVy7j9bwRV3Up3MdlM+C8BQ107OPjxmad/nmml23pnX0EzUBv7 -Mj7tsbPQfIa4eq0I3HbUE222lCqK/tZtSoZU6FIElfxFGJmFsAAADBAO7yuTAVQR8Q6EXF -hog87LJvKnu60gwblwZfsam+tQMDrlnN46HfTp5fa6+Qha5Uq8iEWCSVk/iJBF4QDYXvhC -oLV+GklVLNy6J0g3yMD3v39wLtxu1WQFfiGEl4PXs8amjlpO7ujf1JrmWC0+uxpRKUBJdc -BmNSsqCjfl9Iw9zWV7vl/K/iudanUmVHNF1mkcRjrCfYPM8jiqhPx18o9nwtVGMan9jFeJ -txxwFVs5v0qiIk5AUZlV0oUAjl8usATQAAAMEAt8QlZFiXcjAAOL2IvH1aV4NZVx9CuNa3 -hBhGNBJA5w65u8jRLxy32YSqA7QnRdD3Goxneiv1rvQtWtTVVNzGKPvUYwBjm0bH1zG3U7 -43mod9DQ/iQ8CjSxoi7CPPcwqc+SCCf0qiQ0LcY7keDkYavyu2PwpxsOdS1W+JYRbOvQsO -vFkoYTnWalh2gQaEiG+dDCbAHrB+B5uHjbQR2ZDytxztj1c/W8ls2yDImkgPFp9z4SINIK -DSdIzR4MLN2IctAAAAKHZwYXJpemhzQHVzZXItdnBhcml6aHMuY3R3c2wxLnZvdmFjby5j -b20BAg== ------END OPENSSH PRIVATE KEY----- diff --git a/extern/gnumake/Simple-Makefile b/extern/gnumake/Simple-Makefile new file mode 100644 index 00000000..4cfc747a --- /dev/null +++ b/extern/gnumake/Simple-Makefile @@ -0,0 +1,24 @@ +edit : main.o kbd.o command.o display.o \ + insert.o search.o files.o utils.o + cc -o edit main.o kbd.o command.o display.o \ + insert.o search.o files.o utils.o + +main.o : main.c defs.h + cc -c main.c +kbd.o : kbd.c defs.h command.h + cc -c kbd.c +command.o : command.c defs.h command.h + cc -c command.c +display.o : display.c defs.h buffer.h + cc -c display.c +insert.o : insert.c defs.h buffer.h + cc -c insert.c +search.o : search.c defs.h buffer.h + cc -c search.c +files.o : files.c defs.h buffer.h command.h + cc -c files.c +utils.o : utils.c defs.h + cc -c utils.c +clean : + rm edit main.o kbd.o command.o display.o \ + insert.o search.o files.o utils.o diff --git a/extern/sqlite-3500400/sqlite3.c b/extern/sqlite-3500400/sqlite3.c index 26a7a43d..69d0003b 100644 --- a/extern/sqlite-3500400/sqlite3.c +++ b/extern/sqlite-3500400/sqlite3.c @@ -1,3 +1,5 @@ +//#pragma endinclude + /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite ** version 3.50.4. By combining all the individual C code files into this @@ -20,7 +22,7 @@ ** The content in this amalgamation comes from Fossil check-in ** 4d8adfb30e03f9cf27f800a2c1ba3c48fb4c with changes in files: ** -** +** */ #ifndef SQLITE_AMALGAMATION #define SQLITE_CORE 1 diff --git a/include/abt.h b/include/abt.h index 3773ba76..0a5385d5 100644 --- a/include/abt.h +++ b/include/abt.h @@ -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 // @@ -56,7 +56,8 @@ namespace abt { // update-hdr abt::FFilestat &GetFilestat(strptr fname); // how are we using this execkey??? - i64 execkey_Get(abt::FSyscmd &cmd); + // (user-implemented function, prototype is in amc-generated header) + // i64 execkey_Get(abt::FSyscmd &cmd); bool SourceQ(abt::FTargsrc &targsrc); // compute obj key by replacing path components @@ -70,7 +71,8 @@ namespace abt { // update-hdr tempstr GetObjpath(abt::FBuilddir &builddir, abt::FSrcfile &srcfile); void DeleteFileV(strptr path); tempstr GetOutfile(abt::FBuilddir &builddir, abt::FTarget &target); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:abt // ------------------------------------------------------------------- // cpp/abt/ood.cpp diff --git a/include/abt_md.h b/include/abt_md.h index 3b00ca02..dc81dcb8 100644 --- a/include/abt_md.h +++ b/include/abt_md.h @@ -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 @@ -87,7 +87,7 @@ namespace abt_md { // update-hdr // Load specified readme into memory as FILE_SECTION records // the section table is global and is wiped on every readme. // Only lines starting with ## or ### are considered FILE_SECTIONS - void LoadSections(abt_md::FReadme &readme); + void LoadSections(abt_md::FReadmefile &readmefile); // Print a single section to string void PrintSection(abt_md::FFileSection &file_section, cstring &out); @@ -102,8 +102,8 @@ namespace abt_md { // update-hdr // cpp/abt_md/main.cpp // - // Return true if readme file README needs section MDSECTION - bool NeedSectionQ(abt_md::FMdsection &mdsection, abt_md::FReadme &readme); + // Return true if readme file READMEFILE needs section MDSECTION + bool NeedSectionQ(abt_md::FMdsection &mdsection, abt_md::FReadmefile &readmefile); // Extract words from line up until first dash // E.g. LineKey("#### Some Text - blah") -> "some-text" @@ -189,35 +189,41 @@ namespace abt_md { // update-hdr // canot handle exceptions like README.md void Main_XrefNs(); void CheckLinks(); - void Main(); + void ProcessReadme(abt_md::FReadmefile& readmefile); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:abt_md // ------------------------------------------------------------------- // cpp/abt_md/mdsection.cpp // void DescribeCtype(abt_md::FCtype *ctype, cstring &out); // (user-implemented function, prototype is in amc-generated header) - // void mdsection_Tables(abt_md::FFileSection §ion); - // void mdsection_Attributes(abt_md::FFileSection §ion); - // void mdsection_Inputs(abt_md::FFileSection §ion); + // void mdsection_Tables(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Tables + // void mdsection_Attributes(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Attributes + abt_md::FSsimfile *FieldSsimfile(abt_md::FCtype &ctype); + void PopulateScanNs(abt_md::FNs &ns); + // (user-implemented function, prototype is in amc-generated header) + // void mdsection_Inputs(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Inputs + // void mdsection_InputMessages(abt_md::FFileSection §ion); // gstatic/dev.mdsection:InputMessages abt_md::FCtype *GenerateFieldsTable(abt_md::FCtype &ctype, cstring &text_out, cstring &base_note); // Extract generated info and combine into a table // (user-implemented function, prototype is in amc-generated header) - // void mdsection_Imdb(abt_md::FFileSection §ion); - // void mdsection_Options(abt_md::FFileSection §ion); - // void mdsection_Ctypes(abt_md::FFileSection §ion); - // void mdsection_Functions(abt_md::FFileSection §ion); + // void mdsection_Imdb(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Imdb + // void mdsection_Options(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Options + // void mdsection_Ctypes(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Ctypes + // void mdsection_Functions(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Functions // Update title of document // - For namespace, pull namespace name and comment from ns table // - For script, use script name and comment from scriptfile table // For all other cases, leave title as-is // Section contents are user-defined - // void mdsection_Title(abt_md::FFileSection §ion); + // void mdsection_Title(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Title // Update syntax string // Invoke command with -h flag and substitute output into section body - // void mdsection_Syntax(abt_md::FFileSection §ion); + // void mdsection_Syntax(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Syntax // Table of contents // for README file, create links to subdirectories @@ -227,34 +233,33 @@ namespace abt_md { // update-hdr // 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 mdsection_Toc(abt_md::FFileSection §ion); + // void mdsection_Toc(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Toc // Create links to other files in the same directory - // void mdsection_Chapters(abt_md::FFileSection §ion); - // void mdsection_Sources(abt_md::FFileSection §ion); - // void mdsection_Dependencies(abt_md::FFileSection §ion); - // void mdsection_Description(abt_md::FFileSection §ion); - // void mdsection_Content(abt_md::FFileSection &); - // void mdsection_Limitations(abt_md::FFileSection &); - // void mdsection_Example(abt_md::FFileSection &); + // void mdsection_Chapters(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Chapters + // void mdsection_Sources(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Sources + // void mdsection_Dependencies(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Dependencies + // void mdsection_Description(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Description + // void mdsection_Content(abt_md::FFileSection &); // gstatic/dev.mdsection:Content + // void mdsection_Limitations(abt_md::FFileSection &); // gstatic/dev.mdsection:Limitations + // void mdsection_Example(abt_md::FFileSection &); // gstatic/dev.mdsection:Example // Update tests section // Scan component tests for this namespace and print a table - // void mdsection_Tests(abt_md::FFileSection §ion); + // void mdsection_Tests(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Tests // Update copyright section - // void mdsection_Copyright(abt_md::FFileSection &); - // void mdsection_Reftypes(abt_md::FFileSection §ion); - // void mdsection_Subsets(abt_md::FFileSection §ion); + // void mdsection_Copyright(abt_md::FFileSection &); // gstatic/dev.mdsection:Copyright + // void mdsection_Reftypes(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Reftypes + // void mdsection_Subsets(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Subsets // Show related ssimfiles (those that reference this ssimfile NOT through pkey) - // void mdsection_Related(abt_md::FFileSection §ion); + // void mdsection_Related(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Related // Show related ssimfiles (those that reference this ssimfile NOT through pkey) - // void mdsection_CmdlineUses(abt_md::FFileSection §ion); + // void mdsection_CmdlineUses(abt_md::FFileSection §ion); // gstatic/dev.mdsection:CmdlineUses // Show related ssimfiles (those that reference this ssimfile NOT through pkey) - // void mdsection_ImdbUses(abt_md::FFileSection §ion); - // void mdsection_Constants(abt_md::FFileSection §ion); + // void mdsection_ImdbUses(abt_md::FFileSection §ion); // gstatic/dev.mdsection:ImdbUses + // void mdsection_Constants(abt_md::FFileSection §ion); // gstatic/dev.mdsection:Constants } diff --git a/include/acr.h b/include/acr.h index 8954c862..170f002b 100644 --- a/include/acr.h +++ b/include/acr.h @@ -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 @@ -135,7 +135,8 @@ namespace acr { // update-hdr // ignore:ptr_byref void LookupField(acr::FRec &rec, strptr fieldname, acr::FCtype *&prev_ctype, acr::FField *&prev_field); void Main_CmdQuery(); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:acr // ------------------------------------------------------------------- // cpp/acr/print.cpp -- Code for output diff --git a/include/acr_compl.h b/include/acr_compl.h index 097c0d16..9358c749 100644 --- a/include/acr_compl.h +++ b/include/acr_compl.h @@ -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 @@ -77,7 +77,8 @@ namespace acr_compl { // update-hdr void Main_Install(strptr prog); // main routine - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:acr_compl // ------------------------------------------------------------------- // cpp/acr_compl/shell.cpp diff --git a/include/acr_dm.h b/include/acr_dm.h index 9db204c4..c80f7169 100644 --- a/include/acr_dm.h +++ b/include/acr_dm.h @@ -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 @@ -65,5 +65,6 @@ namespace acr_dm { // update-hdr void Main_Merge(); // Main routine - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:acr_dm } diff --git a/include/acr_ed.h b/include/acr_ed.h index 9269c9e0..5ceab442 100644 --- a/include/acr_ed.h +++ b/include/acr_ed.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2024 Astra // Copyright (C) 2017-2019 NYSE | Intercontinental Exchange // @@ -47,6 +47,11 @@ namespace acr_ed { // update-hdr // The fields are substrings of FIELD_PKEY void CreateCrossProduct(dmmeta::Ctype &ctype, dmmeta::Field &field_pkey); + // Looking for max(msgtypes value) where msgtypes first field is Base and arg is the target subset + // and return max+1 assuming that msgtypes value is integer. + // ignore:bigret + cstring getNextMsgTypeValue(strptr target_subset); + // Create a new ctype // The new type can be relational, i.e. a subset of a cross product of 2 other types, // or an in-memory type. @@ -55,21 +60,21 @@ namespace acr_ed { // update-hdr // Example 2: // acr_ed -create -ctype atf_tmsg.FOrder -pooltype Tpool -indexed // (user-implemented function, prototype is in amc-generated header) - // void edaction_Create_Ctype(); + // void edaction_Create_Ctype(); // gstatic/dev.edaction:Create_Ctype // acr_ed -ctype:X -del -write - // void edaction_Delete_Ctype(); + // void edaction_Delete_Ctype(); // gstatic/dev.edaction:Delete_Ctype // acr_ed -ctype:X -rename:Y -write - // void edaction_Rename_Ctype(); + // void edaction_Rename_Ctype(); // gstatic/dev.edaction:Rename_Ctype // ------------------------------------------------------------------- // cpp/acr_ed/field.cpp -- Create, delete, rename field // // (user-implemented function, prototype is in amc-generated header) - // void edaction_Delete_Field(); - // void edaction_Rename_Field(); - // void edaction_Create_Field(); + // void edaction_Delete_Field(); // gstatic/dev.edaction:Delete_Field + // void edaction_Rename_Field(); // gstatic/dev.edaction:Rename_Field + // void edaction_Create_Field(); // gstatic/dev.edaction:Create_Field // Look at field FIELD, which is of reftype acr_ed::_db.cmdline.reftype. // Create any required record for it: @@ -91,7 +96,7 @@ namespace acr_ed { // update-hdr // #AL# todo: merge this with -create -ctype // (user-implemented function, prototype is in amc-generated header) - // void edaction_Create_Finput(); + // void edaction_Create_Finput(); // gstatic/dev.edaction:Create_Finput // ------------------------------------------------------------------- // cpp/acr_ed/main.cpp @@ -99,6 +104,7 @@ namespace acr_ed { // update-hdr // Request that amc runs after the current script void NeedAmc(); + void RegisterFile(algo::strptr fname, algo::strptr comment); // Retrieve BASE type for CTYPE acr_ed::FCtype *Basetype(acr_ed::FCtype &ctype); @@ -116,44 +122,45 @@ namespace acr_ed { // update-hdr void BuildTest(); void ScriptEditFile(algo_lib::Replscope &R, strptr fname); void ProcessAction(); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:acr_ed // ------------------------------------------------------------------- // cpp/acr_ed/srcfile.cpp -- Create, delete, rename source file // - // Create cpp, h or readme file + // Create cpp, script, h or readme file // (user-implemented function, prototype is in amc-generated header) - // void edaction_Create_Srcfile(); + // void edaction_Create_Srcfile(); // gstatic/dev.edaction:Create_Srcfile // Rename cpp, h, or readme file - // void edaction_Rename_Srcfile(); + // void edaction_Rename_Srcfile(); // gstatic/dev.edaction:Rename_Srcfile // Delete cpp,h, or readme file - // void edaction_Delete_Srcfile(); + // void edaction_Delete_Srcfile(); // gstatic/dev.edaction:Delete_Srcfile // ------------------------------------------------------------------- // cpp/acr_ed/ssimfile.cpp -- Create, delete, rename ssim file // // (user-implemented function, prototype is in amc-generated header) - // void edaction_Create_Ssimfile(); - // void edaction_Rename_Ssimfile(); - // void edaction_Delete_Ssimfile(); + // void edaction_Create_Ssimfile(); // gstatic/dev.edaction:Create_Ssimfile + // void edaction_Rename_Ssimfile(); // gstatic/dev.edaction:Rename_Ssimfile + // void edaction_Delete_Ssimfile(); // gstatic/dev.edaction:Delete_Ssimfile // ------------------------------------------------------------------- // cpp/acr_ed/target.cpp -- Create, delete, rename target // // (user-implemented function, prototype is in amc-generated header) - // void edaction_Create_Target(); - // void edaction_Rename_Target(); - // void edaction_Delete_Target(); + // void edaction_Create_Target(); // gstatic/dev.edaction:Create_Target + // void edaction_Rename_Target(); // gstatic/dev.edaction:Rename_Target + // void edaction_Delete_Target(); // gstatic/dev.edaction:Delete_Target // ------------------------------------------------------------------- // cpp/acr_ed/unittest.cpp -- Create, delete, rename unit test // // (user-implemented function, prototype is in amc-generated header) - // void edaction_Create_Unittest(); + // void edaction_Create_Unittest(); // gstatic/dev.edaction:Create_Unittest // Create a new normalization check - // void edaction_Create_Citest(); + // void edaction_Create_Citest(); // gstatic/dev.edaction:Create_Citest } diff --git a/include/acr_in.h b/include/acr_in.h index e470d41a..bce74eab 100644 --- a/include/acr_in.h +++ b/include/acr_in.h @@ -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 @@ -41,7 +41,8 @@ namespace acr_in { // update-hdr // True if we are doing a reverse lookup of namespaces by ssimfile, // as opposed to a forward lookup of ssimfiles by namespace bool ReverseLookupQ(); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:acr_in // ------------------------------------------------------------------- // cpp/acr_in/data.cpp diff --git a/include/algo.h b/include/algo.h index a955c45d..a50bfcd4 100644 --- a/include/algo.h +++ b/include/algo.h @@ -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 @@ -35,14 +35,6 @@ // STRUCTS namespace algo { - struct PageBuf : memptr { - PageBuf(){} - ~PageBuf(); - private: - PageBuf(const PageBuf&); - void operator =(const PageBuf&){} - }; - struct RegxMacro { char c; const char *crange; @@ -191,6 +183,24 @@ namespace algo { u64_Ranges_curs(); }; + // Unsigned integer ranges packer + // Usage: + // u64_RangesList p; + // Append(p,1); + // Append(p,2); + // Append(p,3); + // Append(p,5); + // Yield(p); //evaluates to "1-3,5", which is iterable with u64_Ranges_curs + // Note: + // - only succesive numbers are packed, not global, e.g. 1,3,2 is not packed + struct u64_RangesList { + cstring result; + algo::ListSep ls; + bool pending; + u64 start; + u64 end; + }; + // ----------------------------------------------------------------------------- // Day range cursor from start to end struct DayRange_curs { @@ -201,14 +211,10 @@ namespace algo { }; // ----------------------------------------------------------------------------- - // tempstr: - // This type is used when returning a string from a function - // It behaves exactly like cstring with the following exceptions: - // Whenever tempstr A is assigned to tempstr or cstring B, the contents of A and B is swapped - // This MOVE CONSTRUCTOR has the effect of saving an extra copy/dealloc when returning string - // from function. - // For this reason, never use tempstr other than for this intended purpose, - // as its contents can suddently be lost if it ever appears on the right hand side of an assignment + // tempstr: temporary string. + // the system maintains a stack of several global temporary strings which are used + // to build up string expressions with few allocations. + // when tempstr is assigned to tempstr, the assignment is a move (right hand side is emptied). struct tempstr : cstring { tempstr(); explicit tempstr(const cstring &rhs) : cstring(rhs){} @@ -273,11 +279,13 @@ namespace algo { static const i64 WTIME_PER_SEC = 10000000; static const i64 WTIME_PER_MSEC = 10000; static const i64 WTIME_PER_USEC = 10; - - template tempstr &operator <<(const tempstr &lhs, const T &rhs); } // ----------------------------------------------------------------------------- +// definition for an inline template to make clangd happy. +namespace algo { + template inline tempstr &operator <<(const tempstr &lhs, const T &rhs); +} // functions in algo_lib from algo namespace namespace algo { // update-hdr @@ -308,6 +316,98 @@ namespace algo { // update-hdr // print base64-encoded string void strptr_PrintBase64(strptr str, cstring &out); + // ------------------------------------------------------------------- + // cpp/lib/algo/bin_decode.cpp + // + + // single byte + bool DecodeU8(algo::memptr &buf, u8 &result); + + // single byte, signed + bool DecodeI8(algo::memptr &buf, i8 &result); + + // single byte, boolean + bool DecodeBoolean(algo::memptr &buf, bool &result); + + // two-byte, big-endian + bool DecodeBEU16(algo::memptr &buf, u16 &result); + + // two-byte, big endian, signed + bool DecodeBEI16(algo::memptr &buf, i16 &result); + + // four-byte, big-endian + bool DecodeBEU32(algo::memptr &buf, u32 &result); + + // four-byte, big-endian signed + bool DecodeBEI32(algo::memptr &buf, i32 &result); + + // eight-byte, big-endian + bool DecodeBEU64(algo::memptr &buf, u64 &result); + + // eight-byte, big-endian signed + bool DecodeBEI64(algo::memptr &buf, i64 &result); + bool DecodeBEF64(algo::memptr &buf, double &result); + + // continuation bit (bit 7 of each byte), little-endian, u32 + bool DecodeVLCLEU32(algo::memptr &buf, u32 &result); + + // continuation bit (bit 7 of each byte), little-endian, u32, signed zigzag + // sign - bit 0 (lsb) + // unsigned mantissa - bits 1..N (msb) + bool DecodeVLCLEI32Z(algo::memptr &buf, i32 &result); + + // continuation bit (bit 7 of each byte), little-endian, u64 + bool DecodeVLCLEU64(algo::memptr &buf, u64 &result); + + // continuation - bit 7 (msb) of each byte, little-endian, signed zigzag: + // sign - bit 0 (lsb) + // unsigned mantissa - bits 1..N (msb) + bool DecodeVLCLEI64Z(algo::memptr &buf, i64 &result); + + // N bytes, raw + bool DecodeNBytes(algo::memptr &buf, int n, algo::memptr &result); + + // N bytes as chars + bool DecodeNChars(algo::memptr &buf, int n, strptr &result); + + // zero-terminated string + bool DecodeZeroterm(algo::strptr &buf, strptr &result); + + // zero-terminated string + bool DecodeZeroterm(algo::memptr &buf, strptr &result); + + // UUID - raw bytes + bool DecodeUuid(algo::memptr &buf, algo::Uuid &result); + + // ------------------------------------------------------------------- + // cpp/lib/algo/bin_encode.cpp + // + void EncodeBoolean(algo::ByteAry &buf, bool value); + void EncodeU8(algo::ByteAry &buf, u8 value); + void EncodeI8(algo::ByteAry &buf, i8 value); + void EncodeBEU16(algo::ByteAry &buf, u16 value); + void EncodeBEI16(algo::ByteAry &buf, i16 value); + void EncodeBEU32(algo::ByteAry &buf, u32 value); + void EncodeBEI32(algo::ByteAry &buf, i32 value); + void EncodeBEU64(algo::ByteAry &buf, u64 value); + void EncodeBEI64(algo::ByteAry &buf, i64 value); + void EncodeBEF64(algo::ByteAry &buf, double value); + + // variable-length, continuation bit, u32 + void EncodeVLCLEU32(algo::ByteAry &buf, u32 value); + + // variable-length, continuation bit, i32, zigzag + void EncodeVLCLEI32Z(algo::ByteAry &buf, i32 value); + + // variable-length, continuation bit, u64 + void EncodeVLCLEU64(algo::ByteAry &buf, u64 value); + + // variable-length, continuation bit, i64, zigzag + void EncodeVLCLEI64Z(algo::ByteAry &buf, i64 value); + + // UUID - raw bytes + void EncodeUuid(algo::ByteAry &buf, algo::Uuid &value); + // ------------------------------------------------------------------- // cpp/lib/algo/crc32.cpp -- Software-based CRC32 // @@ -325,10 +425,11 @@ namespace algo { // update-hdr bool TryParseDecimal(algo::StringIter &iter, algo::Decimal &result); // Print Decimal - void Decimal_Print(algo::Decimal parent, algo::cstring &str); + // (user-implemented function, prototype is in amc-generated header) + // void Decimal_Print(algo::Decimal parent, algo::cstring &str); // cfmt:algo.Decimal.String // Read Decimal from string - bool Decimal_ReadStrptrMaybe(algo::Decimal &parent, algo::strptr in_str); + // bool Decimal_ReadStrptrMaybe(algo::Decimal &parent, algo::strptr in_str); // cfmt:algo.Decimal.String // Convert Decimal to double double Decimal_GetDouble(algo::Decimal parent); @@ -472,7 +573,8 @@ namespace algo { // update-hdr bool RemDirRecurse(strptr name, bool remove_topmost); // User-defined cleanup trigger for dir_handle field of ctype:algo.DirEntry - void dir_handle_Cleanup(algo::DirEntry &dir_entry); + // (user-implemented function, prototype is in amc-generated header) + // void dir_handle_Cleanup(algo::DirEntry &dir_entry); // fcleanup:algo.DirEntry.dir_handle // Open file FILENAME with flags FLAGS, return resulting file descriptor // Possible flags: @@ -514,7 +616,7 @@ namespace algo { // update-hdr // File is read using a "safe" method of succesively calling read. // relying on reported file size or using mmap does not work in all cases // Todo: test on windows - const tempstr FileToString(const strptr& fname, algo::FileFlags flags = algo_FileFlags__throw); + const tempstr FileToString(const strptr& fname, algo::FileFlags flags = algo::FileFlags()); // Read all bytes from IN_FD as a string. // NUL characters in file will appear in the string -- @@ -586,10 +688,11 @@ namespace algo { // update-hdr // %Y/%m/%d // Where %T is %H:%M:%S.%X // And %X is the nanosecond portion - bool UnTime_ReadStrptrMaybe(algo::UnTime &row, algo::strptr str); - bool UnDiff_ReadStrptrMaybe(UnDiff &row, algo::strptr str); - bool UnixTime_ReadStrptrMaybe(algo::UnixTime &row, algo::strptr str); - bool cstring_ReadStrptrMaybe(algo::cstring &row, algo::strptr str); + // (user-implemented function, prototype is in amc-generated header) + // bool UnTime_ReadStrptrMaybe(algo::UnTime &row, algo::strptr str); // cfmt:algo.UnTime.String + // bool UnDiff_ReadStrptrMaybe(UnDiff &row, algo::strptr str); // cfmt:algo.UnDiff.String + // bool UnixTime_ReadStrptrMaybe(algo::UnixTime &row, algo::strptr str); // cfmt:algo.UnixTime.String + // bool cstring_ReadStrptrMaybe(algo::cstring &row, algo::strptr str); // cfmt:algo.cstring.String // Parse a URL from string STR to OUT. // The format of a URL is @@ -603,8 +706,8 @@ namespace algo { // update-hdr // file://c:/dir/dir2 // c: will not be parsed as a username, but as part of the pathname. // - bool URL_ReadStrptrMaybe(URL &out, algo::strptr str); - bool Ipmask_ReadStrptrMaybe(Ipmask &row, algo::strptr str); + // bool URL_ReadStrptrMaybe(URL &out, algo::strptr str); // cfmt:algo.URL.String + // bool Ipmask_ReadStrptrMaybe(Ipmask &row, algo::strptr str); // cfmt:algo.Ipmask.String void Ptr_Print(void *ptr, algo::cstring &out); // pads with zeros on the left so that at least 'atleast' characters are output. @@ -702,7 +805,8 @@ namespace algo { // update-hdr // Append N instances of character C to string OUT. void char_PrintNTimes(char c, algo::cstring &out, int n); void strptr_PrintAligned(algo::strptr str, algo::cstring &out, int nplaces, algo::TextJust align, char c); - void cstring_Print(algo::cstring &row, algo::cstring &str); + // (user-implemented function, prototype is in amc-generated header) + // void cstring_Print(algo::cstring &row, algo::cstring &str); // cfmt:algo.cstring.String void strptr_Print(const algo::strptr &row, algo::cstring &str); // Append a space unless the string already ends with a space @@ -712,7 +816,8 @@ namespace algo { // update-hdr // Example: // double_PrintPercent(0.334, str, 1) -> "33.4%" void double_PrintPercent(double value, algo::cstring &str, int prec); - void i32_Range_Print(algo::i32_Range &r, algo::cstring &o); + // (user-implemented function, prototype is in amc-generated header) + // void i32_Range_Print(algo::i32_Range &r, algo::cstring &o); // cfmt:algo.i32_Range.String void double_PrintWithCommas(double value, algo::cstring &str, int prec); // ignore:bigret @@ -755,18 +860,22 @@ namespace algo { // update-hdr // %- Print - sign if timespec is negative // %% Print % sign void TimeStruct_Print(const TimeStruct &time, algo::cstring &str, const algo::strptr &spec); - void Tuple_Print(algo::Tuple &row_, algo::cstring &str); - void Bool_Print(algo::Bool row, algo::cstring &str); - void UnDiff_Print(UnDiff row, algo::cstring &str); - void UnixDiff_Print(UnixDiff row, algo::cstring &str); - void UnTime_Print(algo::UnTime row, algo::cstring &str); - void UnixTime_Print(algo::UnixTime row, algo::cstring &str); + // (user-implemented function, prototype is in amc-generated header) + // void Tuple_Print(algo::Tuple &row_, algo::cstring &str); // cfmt:algo.Tuple.String + // void Bool_Print(algo::Bool row, algo::cstring &str); // cfmt:algo.Bool.String + // void UnDiff_Print(UnDiff row, algo::cstring &str); // cfmt:algo.UnDiff.String + // void UnixDiff_Print(UnixDiff row, algo::cstring &str); // cfmt:algo.UnixDiff.String + // void UnTime_Print(algo::UnTime row, algo::cstring &str); // cfmt:algo.UnTime.String + // void UnixTime_Print(algo::UnixTime row, algo::cstring &str); // cfmt:algo.UnixTime.String void UnTime_PrintSpec(UnTime t, algo::cstring &out, const algo::strptr &spec); void UnixTime_PrintSpec(UnixTime t, algo::cstring &out, const algo::strptr &spec); void UnDiff_PrintSpec(UnDiff t, algo::cstring &out, const algo::strptr &spec); void UnixDiff_PrintSpec(UnixDiff t, algo::cstring &out, const algo::strptr &spec); - void Ipmask_Print(algo::Ipmask &row, algo::cstring &str); - void Errcode_Print(algo::Errcode &row, algo::cstring &str); + // (user-implemented function, prototype is in amc-generated header) + // void Ipmask_Print(algo::Ipmask &row, algo::cstring &str); // cfmt:algo.Ipmask.String + + // Decode error using algo_lib table of decoders + // void Errcode_Print(algo::Errcode &row, algo::cstring &str); // cfmt:algo.Errcode.String // Append STR to OUT, using comma-separated-values encoding // If QUOTE is 0, the need for quotes and the type of quote is determined automatically. @@ -776,7 +885,8 @@ namespace algo { // update-hdr // Print CSV field, auto-determine quotes void strptr_PrintCsv(algo::strptr str, algo::cstring &out); - void URL_Print(algo::URL &url, algo::cstring &str); + // (user-implemented function, prototype is in amc-generated header) + // void URL_Print(algo::URL &url, algo::cstring &str); // cfmt:algo.URL.String // Append STR to OUT, and pad remainder with character FILL void strptr_PrintPadRight(algo::strptr str, algo::cstring &out, int nplaces, char fill); @@ -801,7 +911,8 @@ namespace algo { // update-hdr // \t void strptr_PrintSql(algo::strptr str, algo::cstring &out, char q); void strptr_PrintSql(algo::strptr str, algo::cstring &out); - void Attr_Print(algo::Attr &attr, algo::cstring &str); + // (user-implemented function, prototype is in amc-generated header) + // void Attr_Print(algo::Attr &attr, algo::cstring &str); // cfmt:algo.Attr.String // Print a string suitable for parsing with Tuple // If the string doesn't need quotes, it is printed as-is. @@ -814,7 +925,8 @@ namespace algo { // update-hdr // copy string B to TO, using ORIG as a case template // I.e. PrintCopyCase("AbcD", to, "somestring") -> "SomEstring" void strptr_PrintCopyCase(const algo::strptr &orig, algo::cstring &to, const algo::strptr &b); - bool Tuple_ReadStrptrMaybe(Tuple &row, algo::strptr s); + // (user-implemented function, prototype is in amc-generated header) + // bool Tuple_ReadStrptrMaybe(Tuple &row, algo::strptr s); // cfmt:algo.Tuple.String // T target tuple. the tuple is not emptied before parsing. // STR source string @@ -837,7 +949,8 @@ namespace algo { // update-hdr // Read Charset from list of chars. // Every character in RHS is simply added to the bitset void Charset_ReadStrptrPlain(algo::Charset &lhs, strptr desc); - bool Charset_ReadStrptrMaybe(algo::Charset &lhs, strptr rhs); + // (user-implemented function, prototype is in amc-generated header) + // bool Charset_ReadStrptrMaybe(algo::Charset &lhs, strptr rhs); // cfmt:algo.Charset.String // Print STR to OUT in a way that's acceptable as input for bash. void strptr_PrintBash(strptr str, algo::cstring &out); @@ -856,8 +969,9 @@ namespace algo { // update-hdr void strptr_PrintDot(strptr s, algo::cstring &out); // print binary octet string as hex - void Sha1sig_Print(algo::Sha1sig &sha1sig, algo::cstring &out); - bool Sha1sig_ReadStrptrMaybe(algo::Sha1sig &sha1sig, algo::strptr str); + // (user-implemented function, prototype is in amc-generated header) + // void Sha1sig_Print(algo::Sha1sig &sha1sig, algo::cstring &out); // cfmt:algo.Sha1sig.String + // bool Sha1sig_ReadStrptrMaybe(algo::Sha1sig &sha1sig, algo::strptr str); // cfmt:algo.Sha1sig.String // Write character C into string OUT, using C++ character escapement rules // QUOTE_CHAR also gets escaped. @@ -936,12 +1050,22 @@ namespace algo { // update-hdr // Print a string as a classic regex, escaping all special // characters. This regex will only match the specified string. void strptr_PrintRegxSql(algo::strptr value, algo::cstring &str); - void WDiff_Print(algo::WDiff row, algo::cstring &str); - void WTime_Print(algo::WTime row, algo::cstring &str); - bool WDiff_ReadStrptrMaybe(algo::WDiff &parent, algo::strptr in_str); - bool WTime_ReadStrptrMaybe(algo::WTime &parent, algo::strptr in_str); + // (user-implemented function, prototype is in amc-generated header) + // void WDiff_Print(algo::WDiff row, algo::cstring &str); // cfmt:algo.WDiff.String + // void WTime_Print(algo::WTime row, algo::cstring &str); // cfmt:algo.WTime.String + // bool WDiff_ReadStrptrMaybe(algo::WDiff &parent, algo::strptr in_str); // cfmt:algo.WDiff.String + // bool WTime_ReadStrptrMaybe(algo::WTime &parent, algo::strptr in_str); // cfmt:algo.WTime.String void u64_PrintBase32(u64 k, algo::cstring &str); - void Uuid_Print(algo::Uuid &parent, algo::cstring &str); + // (user-implemented function, prototype is in amc-generated header) + // void Uuid_Print(algo::Uuid &parent, algo::cstring &str); // cfmt:algo.Uuid.String + // bool Uuid_ReadStrptrMaybe(algo::Uuid &parent, strptr str); // cfmt:algo.Uuid.String + + // print bytes in hex e.g: 00 01 ff + // void memptr_Print(algo::memptr parent, algo::cstring &str); // cfmt:algo.memptr.String + // void ByteAry_Print(algo::ByteAry &parent, algo::cstring &str); // cfmt:algo.ByteAry.String + + // read bytes in hex e.g: 00 01 ff + // bool ByteAry_ReadStrptrMaybe(algo::ByteAry &parent, strptr str); // cfmt:algo.ByteAry.String // ------------------------------------------------------------------- // cpp/lib/algo/lib.cpp -- Main file @@ -971,10 +1095,18 @@ namespace algo { // update-hdr // Append new attribute with specified name and value. void attr_Add(Tuple &T, strptr name, strptr value); + // Update atribute if exists, otherwise create new one + void attr_Set(Tuple &T, strptr name, strptr value); + // Call sleep/usleep, giving up MS milliseconds void SleepMsec(int ms); + + // Reeturn Errcode corresponding to a UNIX error code VAL Errcode FromErrno(i64 val); - Errcode FromWinErr(i64 val); + + // Return Errcode corresponding to namespace and code VAL + // The namespace should have a decoder function (decode_Call(*errns_Find(ns), val)) + Errcode MakeErrcode(algo::Errns ns, i64 val); i64 I64Power10(u32 power); // Copy bytes from one location to another in blocks of 16 bytes. @@ -1043,10 +1175,12 @@ namespace algo { // update-hdr // // Default implementation of prlog handler + // This function is called via algo_lib::_db.Prlog pointer. + // The pointer may be set by the application to replace the function with something else. // // Notes on WriteFile use: - // some tools set fd 1 to nonblocking mode, which causes EAGAIN during fast writes, - // so we must use WriteFile (which contains a loop) to write all the bytes out. + // we must use WriteFile (which contains a loop) to write all the bytes out, + // otherwise some terminals push back and refuse the data. void Prlog(algo_lib::FLogcat *logcat, algo::SchedTime tstamp, strptr str); // ------------------------------------------------------------------- @@ -1307,6 +1441,8 @@ namespace algo { // update-hdr void u64_Ranges_curs_Next(algo::u64_Ranges_curs &curs); bool u64_Ranges_curs_ValidQ(algo::u64_Ranges_curs &curs); u64 &u64_Ranges_curs_Access(algo::u64_Ranges_curs &curs); + void Append(algo::u64_RangesList &p, u64 item); + strptr Yield(algo::u64_RangesList &p); void Sep_curs_Reset(algo::Sep_curs &curs, strptr line, char sep); void Sep_curs_Next(algo::Sep_curs &curs); @@ -1363,6 +1499,26 @@ namespace algo { // update-hdr // bool SaneTerminalQ(); + // ------------------------------------------------------------------- + // cpp/lib/algo/url.cpp + // + + // perform standard url percent decoding (for raw url, path), + // and optionally translate '+' to space (for application/x-www-form-urlencoded) + tempstr UrlDecode(strptr in, bool plus); + + // Parses HTTP URL + // Place path part as value of first attr, + // other attrs are key-value pairs in order as the appear + void ParseUrl(algo::Tuple &out, strptr in); + + // ------------------------------------------------------------------- + // cpp/lib/algo/uuid.cpp + // + void GenerateRandomUuid(algo::Uuid &uuid); + algo::Uuid GenerateRandomUuid(); + bool NullUuidQ(const algo::Uuid &uuid); + // ------------------------------------------------------------------- // include/algo.inl.h -- Inline functions // @@ -1399,15 +1555,12 @@ namespace algo { // update-hdr // RESULT value of hex digit // RETURN success code inline int ParseHex1(u32 c, u8 &result); - inline void PageBufInit(PageBuf &F, u64 n, u64 align); - inline u32 strptr_Hash(u32 prev, algo::strptr val); + // (user-implemented function, prototype is in amc-generated header) + // inline u32 strptr_Hash(u32 prev, algo::strptr val); inline u32 cstring_Hash(u32 prev, const algo::strptr &val); - inline u32 cstring_Hash(u32 prev, algo::cstring &val); - inline u32 cstring_Hash(u32 prev, const algo::cstring &val); - // this is inefficient because it would be nice to be able to overrun strings. - // however, we don't check byte alignment at the beginning, - // so a 2-byte string that lies 4 bytes before the end of a page could fault. + // When compiled with AOS_SSE42, use intrinsics. + // Otherwise, the function is defined in crc32.cpp and uses a software implementation inline u32 CRC32Step(u32 old, const u8 *x, size_t len); inline int P1Mod(int a, int b); inline u32 u32_Count1s(u32 x); @@ -1551,8 +1704,6 @@ namespace algo { // update-hdr inline algo::aryptr ch_LastN(const strptr &lhs, u32 n); inline algo::aryptr ch_RestFrom(const strptr &lhs, u32 n); inline algo::aryptr ch_GetRegion(const strptr &lhs, u32 lo, u32 n); - inline int ImpliedLength(char *, const char *c); - inline int ImpliedLength(const char *, const char *c); inline int ch_N(const strptr &s); inline int ch_First(const strptr &s, int dflt = 0); inline int ch_Last(const strptr &s, int dflt = 0); @@ -1597,10 +1748,11 @@ namespace algo { // update-hdr template inline bool SameSignQ(T a, T b); // Compare two strings for equality, case-sensitively - inline bool strptr_Eq(algo::strptr a, algo::strptr b); + // (user-implemented function, prototype is in amc-generated header) + // inline bool strptr_Eq(algo::strptr a, algo::strptr b); // Test if string A is lexicographically less than string B. - inline bool strptr_Lt(algo::strptr a, algo::strptr b); + // inline bool strptr_Lt(algo::strptr a, algo::strptr b); // reverse bit order in a byte inline u8 u8_ReverseBits(u8 b); @@ -1609,7 +1761,11 @@ namespace algo { // update-hdr // On Linux, this function calls clock_gettime() which takes about // 30ns and uses rdtsc() to increase underlying clock resolution inline algo::UnTime CurrUnTime(); - inline i32 strptr_Cmp(algo::strptr a, algo::strptr b); + // (user-implemented function, prototype is in amc-generated header) + // inline i32 strptr_Cmp(algo::strptr a, algo::strptr b); + + // helper: N bytes as chars + template inline bool DecodeNChars(algo::memptr &buf, int n, T &result); } // ----------------------------------------------------------------------------- @@ -1673,7 +1829,6 @@ namespace algo_lib { // update-hdr // ------------------------------------------------------------------- // cpp/lib/algo/errtext.cpp // - void SaveBadField(strptr name, strptr value); // Reset value of algo_lib::_db.errtext and return it for further editing // Usage: @@ -1682,14 +1837,11 @@ namespace algo_lib { // update-hdr // Add key-value pair to algo_lib::_db.errtext // Error text beyond a reasonable limit is discarded -- keep errors short! - void SaveBadTag(const strptr &name, const strptr &value); - - // Better name than SaveBadTAg void AppendErrtext(const strptr &name, const strptr &value); - // Retrieve whatever bad tags were saved with SaveBadTag, + // Retrieve whatever bad tags were saved with AppendErrtext, // and clear the state. - // SaveBadTag is typically called by string read functions that encounter + // AppendErrtext is typically called by string read functions that encounter // something unreadable. This is the only way to retrieve that // additional information tempstr DetachBadTags(); @@ -1697,19 +1849,15 @@ namespace algo_lib { // update-hdr // Increment algo_lib::_db.trace.tot_insert_err // And print accumulated 'bad tags' using prerr. // if SetShowInsertErrLim was previously called. - // Note: printing is disabled by default, and must be explicitly enabled. void NoteInsertErr(strptr tuple); - // Specify how many times NoteInsertErr can use prerr - // to output. - void SetShowInsertErrLim(int n); - // ------------------------------------------------------------------- // cpp/lib/algo/file.cpp -- File functions // // User-defined cleanup trigger fildes field of ctype:algo_lib.FLockfile - void fildes_Cleanup(algo_lib::FLockfile &lockfile); + // (user-implemented function, prototype is in amc-generated header) + // void fildes_Cleanup(algo_lib::FLockfile &lockfile); // fcleanup:algo_lib.FTempfile.fildes // If PATH is an existing path, leave it unchanged // On Windows, If PATH.EXE is an existing path, return that @@ -1725,9 +1873,8 @@ namespace algo_lib { // update-hdr // ------------------------------------------------------------------- // cpp/lib/algo/fmt.cpp -- Print to string / Read from string // - void ErrorX_Print(algo_lib::ErrorX &row, algo::cstring &str); - void FTxttbl_Print(algo_lib::FTxttbl &T_, algo::cstring &str); - void FTxttbl_Markdown(algo_lib::FTxttbl &T_, algo::cstring &str); + // (user-implemented function, prototype is in amc-generated header) + // void ErrorX_Print(algo_lib::ErrorX &row, algo::cstring &str); // cfmt:algo_lib.ErrorX.String // ------------------------------------------------------------------- // cpp/lib/algo/iohook.cpp @@ -1751,7 +1898,7 @@ namespace algo_lib { // update-hdr // that occurs before it in the main loop. // Sleep will not extend beyond algo_lib::_db.limit // (user-implemented function, prototype is in amc-generated header) - // void giveup_time_Step(); + // void giveup_time_Step(); // fstep:algo_lib.FDb.giveup_time // ------------------------------------------------------------------- // cpp/lib/algo/lib.cpp -- Main file @@ -1759,25 +1906,32 @@ namespace algo_lib { // update-hdr // Set exit time of main loop to current time. void ReqExitMainLoop(); - void fd_Cleanup(algo_lib::FFildes &fildes); - void fildes_Cleanup(algo_lib::FIohook &iohook); // (user-implemented function, prototype is in amc-generated header) - // void bh_timehook_Step(); + // void fd_Cleanup(algo_lib::FFildes &fildes); // fcleanup:algo_lib.FFildes.fd + // void fildes_Cleanup(algo_lib::FIohook &iohook); // fcleanup:algo_lib.FTempfile.fildes + // void bh_timehook_Step(); // fstep:algo_lib.FDb.bh_timehook // Check signature on incoming data - bool dispsigcheck_InputMaybe(dmmeta::Dispsigcheck &dispsigcheck); + // bool dispsigcheck_InputMaybe(dmmeta::Dispsigcheck &dispsigcheck); // finput:algo_lib.FDb.dispsigcheck // Die when parent process dies void DieWithParent(); + // Return name of temp directory. + // If it's not already initialized, it is set to the default value: + // temp/ where is taken from argv[0]. + // The directory is created as needed. + algo::strptr GetTempDir(); + // Create temporary file // tempfile.fildes points to the new temp file after this - // temp file is created under temp/ + // temp file is created under _db.tempdir // prefix is a namespace-unique name, such as "amc.xyz" - // Actual file that's created becomes "temp/amc.xyz.XXXXXX" + // Actual file that's created becomes "temp/amc/xyz.XXXXXX" // Computed filename is saved to tempfile.filename void TempfileInitX(algo_lib::FTempfile &tempfile, strptr prefix); - void fildes_Cleanup(algo_lib::FTempfile &tempfile); + // (user-implemented function, prototype is in amc-generated header) + // void fildes_Cleanup(algo_lib::FTempfile &tempfile); // fcleanup:algo_lib.FTempfile.fildes // Interpret redirect string, return resulting fd // If no redirect applies, return -1 @@ -1808,7 +1962,8 @@ namespace algo_lib { // update-hdr tempstr EffectiveUser(); // if OWN_FD is cleared, clean up file descriptor before it is closed - void file_Cleanup(algo_lib::InTextFile &file); + // (user-implemented function, prototype is in amc-generated header) + // void file_Cleanup(algo_lib::InTextFile &file); // fcleanup:algo_lib.InTextFile.file // Walk child process tree for parent process pid, in post-order traversal way, // and send signal sig to each process. Kill_topmost is an option whether @@ -1828,6 +1983,18 @@ namespace algo_lib { // update-hdr // Must be balanced with PushDir void PopDir(); + // Global initializer, called from algo_lib::FDb_Init + // (user-implemented function, prototype is in amc-generated header) + // void errns_Userinit(); // fuserinit:algo_lib.FDb.errns + void UpdateRate(algo::I64Rate &rate, i64 val); + + // For InlineOnce and TimeHookOnce steps, break + // out of the enclosing while loop (over timeouts). + // Calling this function may be necessary when it becomes known that + // no further progress can be made by the step function. + void EndStep(); + void _db_Userinit(); + // ------------------------------------------------------------------- // cpp/lib/algo/line.cpp -- Line processing // @@ -1855,22 +2022,12 @@ namespace algo_lib { // update-hdr // Otherwise, algo_lib::_db.errtext (DetachBadTags()) contains human-readable description of error. // If WAIT_TIMEOUT is non-zero, block up to WAIT_TIMEOUT seconds before failing // Write pid to file specified in NAME, and lock file using flock(). - bool LockFileInit(algo_lib::FLockfile &lockfile, strptr name, algo::FailokQ fail_ok, algo::UnDiff wait_timeout); + bool LockFileInit(algo_lib::FLockfile &lockfile, strptr name, algo::FailokQ fail_ok = algo::FailokQ(false), algo::UnDiff wait_timeout = algo::UnDiff()); // Write pid to lockfile, separate function to update pid after fork(). // Sets error text in case of error, and return false. bool WritePid(algo_lib::FLockfile &lockfile); - // Non-blocking attempt to lock LOCKFILE - // Return success status - // If FAIL_OK is FALSE, throw exception on error (must succeed) - bool LockFileInit(algo_lib::FLockfile &lockfile, strptr name, algo::FailokQ fail_ok); - - // Non-blocking attempt to lock LOCKFILE. - // Throw exception on error. - // If the function returns, it has succeeded. - void LockFileInit(algo_lib::FLockfile &lockfile, strptr name); - // Read contents of lock file FNAME, extracting the pid that's stored in there. // On failure, return 0 pid_t LockFileRead(strptr fname); @@ -1880,7 +2037,8 @@ namespace algo_lib { // update-hdr // // User-defined cleanup function for MMAP.MEM - void mem_Cleanup(algo_lib::Mmap &mmap); + // (user-implemented function, prototype is in amc-generated header) + // void mem_Cleanup(algo_lib::Mmap &mmap); // fcleanup:algo_lib.Mmap.mem // Attach mmapfile MMAPFILE to FD. // Return success code. @@ -1890,6 +2048,40 @@ namespace algo_lib { // update-hdr // Return success code. bool MmapFile_Load(MmapFile &mmapfile, strptr fname); + // ------------------------------------------------------------------- + // cpp/lib/algo/prlog.cpp -- prlog macro + // + + // Enable or disable logcat tracing based on traace expression WHAT + // WHAT is a comma-separated list of logcat regexes, e.g. a,b,c + // Each component can be prefixed with + or -, e.g. +a,-b etc. + // Finally, each component can be a key-value pair, e.g. +a:,-b,+c + // is an optional regex; Regex can be prefixed with ! to indicate a negative match. + // Timestamps can be enabled with 'timestamps', disabled with '-timestamps' + // Verbose can be enabled with 'verbose', disabled with '-verbose' + // Debug can be enabled with 'debug', disabled with '-debug' + int ApplyTrace(algo::strptr what); + + // Enable/disable log category NAME with filter FILTER. + // If NAME is prefixed with +, logging is enabled + // If NAME is prefixed with -, logging is disabled + // If NAME is an empty string. current state is printed + // FILTER is a regex + // If FILTER starts with !, it is a negative filter (any matching lines are omitted) + // Return number of logcats affected. + int ApplyTrace(algo::strptr name, algo::strptr filter); + void ShowTrace(); + + // Filter string STR for output on LOGCAT. + // The string must match FILTER and not match NEGFILTER. + // The initial state is that filter is empty (uninitialized), so empty filter + // is interpreted as "match all" + // Filter and negfilter are configured with ApplyTrace which parses a trace expression + // In addition, if throttling is enabled on LOGCAT, block message + // if more than MAXMSG are being printed within WINDOW secs. The counter + // is reset every WINDOW secs. + bool LogcatFilterQ(algo_lib::FLogcat &logcat, algo::strptr str); + // ------------------------------------------------------------------- // cpp/lib/algo/regx.cpp -- Sql Regx implementation // @@ -1898,53 +2090,59 @@ namespace algo_lib { // update-hdr // sql vs shell vs classic regx, vs acr, partial vs full. // we print back the original expression that was read in, but the information // about what function read it is lost. - void Regx_Print(algo_lib::Regx ®x, algo::cstring &lhs); + // (user-implemented function, prototype is in amc-generated header) + // void Regx_Print(algo_lib::Regx ®x, algo::cstring &lhs); // cfmt:algo_lib.Regx.String + // void RegxState_Print(algo_lib::RegxState &state, algo::cstring &lhs); // cfmt:algo_lib.RegxState.String - // Check if REGX matches S, return result + // Check if REGX matches TEXT, return result bool Regx_Match(algo_lib::Regx ®x, algo::strptr text); + // Find REGX in TEXT and return range of chars which match. + // If the regx is not found, return empty range. + // For this to work, REGX must be parsed with "full:N". + algo::i32_Range Regx_Find(algo_lib::Regx ®x, algo::strptr text, int start = 0); + void Regx_ReadStyle(algo_lib::Regx ®x, algo::strptr input, algo_lib::RegxStyle style, bool full); + // Parse string INPUT as regex and store in REGX. // Supported features: - // \n,\r,\t,\a,\e,\v,\f, [..], $, ^, - // ., *, +, (..), {..}, \d,\D,\w,\W,\s,\S + // \n,\r,\t,\a,\e,\v,\f regular escaped chars + // [..] char range, possibly with negation + // $, ^ anchors + // . any char + // * repetition + // + one or more + // (..) precedence grouping and capture groups + // \d,\D,\w,\W,\s,\S macros void Regx_ReadDflt(algo_lib::Regx ®x, algo::strptr input); - - // Parse bash-style regx: - // * -> .* - // ? -> .? - // All other regx chars are escaped away - // if FULL is set to false, input is treated as ".*input.*" void Regx_ReadShell(algo_lib::Regx ®x, algo::strptr input, bool full); - - // Parse SQL-style regx: - // % is rewritten as .* - // _ is rewritten as . - // (, ), [, ] are passed through - // ., *, ?, + are escaped - // if FULL is set to false, input is treated as ".*input.*" void Regx_ReadSql(algo_lib::Regx ®x, algo::strptr input, bool full); - - // Parse ACR-style regx: - // % is rewritten as .* - // (, ), [, ], _ are passed through - // ., *, ?, + are escaped - // if FULL is set to false, input is treated as ".*input.*" - // If the input expression can be matched as a string, set REGX.LITERAL to true void Regx_ReadAcr(algo_lib::Regx ®x, algo::strptr input, bool full); // Set REGX to match string INPUT literally void Regx_ReadLiteral(algo_lib::Regx ®x, algo::strptr input); - bool Regx_ReadStrptrMaybe(algo_lib::Regx ®x, algo::strptr input); + // (user-implemented function, prototype is in amc-generated header) + // bool Regx_ReadStrptrMaybe(algo_lib::Regx ®x, algo::strptr input); // cfmt:algo_lib.Regx.String + algo::tempstr ToDbgString(algo_lib::Bitset &bitset); + algo::tempstr ToDbgString(algo_lib::RegxState &state, int index); + algo::tempstr ToDbgString(algo_lib::Regx ®x); + tempstr ToDbgString(algo_lib::RegxExpr *expr); + tempstr ToDbgString(algo_lib::RegxParse ®xparse); // ------------------------------------------------------------------- - // cpp/lib/algo/string.cpp -- cstring functions + // cpp/lib/algo/replscope.cpp // - void ind_replvar_Cleanup(algo_lib::Replscope &replscope); // Set value of key KEY value VALUE // KEY string to replace // VALUE value to replace it with // SUBST If set, $-expand the VALUE parameter + // NOTES + // With 'strict' Replscope, avoid expressions like this: + // Set(R, "$var", field.comment); + // This will trigger an error when field.comment contains a $ sign and the substitution fails. + // Use + // Set(R, "$var", field.comment, false); + // void Set(algo_lib::Replscope &scope, strptr from, strptr to, bool subst = true); // Append TEXT to OUT, performing $-substitution using variables from SCOPE (must be non-NULL) @@ -1954,13 +2152,13 @@ namespace algo_lib { // update-hdr // Enable comma-eating (default true) void eatcomma_Set(algo_lib::Replscope &scope, bool enable); - // Enable strict mode (default true -- any failed substitution kills process) - // If strict mode is off, failed substitution acts as if there was no substitution - void fatal_Set(algo_lib::Replscope &scope, bool enable); - // Perform $-substitutions in TEXT and return new value. tempstr Subst(algo_lib::Replscope &scope, strptr text); + // ------------------------------------------------------------------- + // cpp/lib/algo/string.cpp -- cstring functions + // + // read TEXT into a tuple. // perform variable substitution on key-value pairs. // write tuple back. @@ -1972,43 +2170,55 @@ namespace algo_lib { // update-hdr // cpp/lib/algo/timehook.cpp // - // Initialize time hook TH as non-recurrent, with delay DELAY. - // Usage: - // ThInit(th, SchedTime()); // schedule at current time - // hook_Set0(th, myfunction); // set callback - // bh_timehook_Reheap(th); // insert into timehook heap - // ... eventually algo_lib::Step() will call the hook - void ThInit(algo_lib::FTimehook& th, algo::SchedTime delay) __attribute__((nothrow)); - - // Similar to the above, but recurrent. + // Initialize a recurrent time hook TH to execute on the next scheduling cycle, + // and after that, every DELAY clocks + // NOTE: 'delay' field of a recurrent timehook is used when automatically rescheduling it. void ThInitRecur(algo_lib::FTimehook& th, algo::SchedTime delay) __attribute__((nothrow)); + // Schedule a time hook TH to execute on the next scheduling cycle, + // and after that, every DELAY clocks + void ThScheduleRecur(algo_lib::FTimehook& th, algo::SchedTime delay) __attribute__((nothrow)); + + // Initialize a non-recurrent time hook TH to execute after DELAY clock cycles with + // respect to current time + // NOTE: 'delay' field of non-recurrent timehook is ignored + // NOTE: this function updates scheduling clock to the most current value + void ThScheduleIn(algo_lib::FTimehook& th, algo::SchedTime delay) __attribute__((nothrow)); + // ------------------------------------------------------------------- // cpp/lib/algo/txttbl.cpp -- Ascii table // + // Look up cell with specific coordinates. + algo_lib::FTxtcell *FindCell(algo_lib::FTxttbl &txttbl, int row, int col); + algo_TextJustEnum EvalJust(algo_lib::FTxttbl &txttbl, u32 col, algo_TextJustEnum just); + // Add new cell to the given row. - algo_lib::FTxtcell &AddCell(algo_lib::FTxtrow &txtrow, algo::strptr title, algo_TextJustEnum justify, int span); - algo_lib::FTxtcell &AddCell(algo_lib::FTxtrow &txtrow, algo::strptr title, algo_TextJustEnum justify); + // TEXT specifies the text for the cell + algo_lib::FTxtcell &AddCell(algo_lib::FTxtrow &txtrow, algo::strptr text, algo_TextJustEnum justify = algo_TextJust_j_auto); + algo::cstring &AddCell(algo_lib::FTxttbl &txttbl); - // Add new cell to the last row of of table and return references to its text + // Add new row to the table and return a reference to it algo_lib::FTxtrow &AddRow(algo_lib::FTxttbl &txttbl); // Add column to the last row of table and return reference to it + // The justification for the column is copied from the header row algo_lib::FTxtcell &AddCellEx(algo_lib::FTxttbl &txttbl); - // Text table. - // Text table is a table with rows; Each row has an array of cells. - // Each call has text, col span, text justification, and optional style (color). - // Add column to the last row of table. - void AddCol(algo_lib::FTxttbl &txttbl, algo::strptr col, algo_TextJustEnum justify); - void AddCol(algo_lib::FTxttbl &txttbl, algo::strptr col); - void AddCols(algo_lib::FTxttbl &txttbl, algo::strptr csv, algo_TextJustEnum justify); - void AddCols(algo_lib::FTxttbl &txttbl, algo::strptr csv); - algo::cstring &AddCell(algo_lib::FTxttbl &txttbl); + // Add a column with specified text TEXT to the last row of the table + // If optional JUSTIFY is provided, the justification is set. Otherwise, justification is automatically + // determined from the header cell. + void AddCol(algo_lib::FTxttbl &txttbl, algo::strptr text, algo_TextJustEnum justify = algo_TextJust_j_auto); - // Use prlog(txttbl) to print. - void TxttblCsv(algo_lib::FTxttbl &tbl); + // Add a comma-separated list of columns to the table + void AddCols(algo_lib::FTxttbl &txttbl, algo::strptr csv, algo_TextJustEnum justify = algo_TextJust_j_left); + // (user-implemented function, prototype is in amc-generated header) + // void FTxttbl_Print(algo_lib::FTxttbl &txttbl, algo::cstring &str); // cfmt:algo_lib.FTxttbl.String + + // Print table TXTTBL using markdown, appending to string STR. + // First row of the table is assumed to be the header. + // Newlines in cells are converted to '
'. + void FTxttbl_Markdown(algo_lib::FTxttbl &txttbl, algo::cstring &str); } @@ -2071,5 +2281,8 @@ using algo::tempstr; #include "include/gen/algo_gen.inl.h" #include "include/gen/algo_lib_gen.inl.h" +// presently cannot be avoided +#include "include/lib_json.h" + // Gcache pragma to precompile this header void __gcache_pragma_pch_preprocess(); diff --git a/include/algo.inl.h b/include/algo.inl.h index e65a94b4..5a13333d 100644 --- a/include/algo.inl.h +++ b/include/algo.inl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2020-2023 Astra // Copyright (C) 2017-2019 NYSE | Intercontinental Exchange // @@ -114,24 +114,39 @@ template inline algo::aryptr algo::BytesOf(const T &t) { template inline algo::aryptr::aryptr(const T *e, i32 in_n) : elems(const_cast(e)) , n_elems(in_n) { } -template inline algo::aryptr::aryptr(const char *e) : elems(const_cast(e)) , n_elems(algo::ImpliedLength((T*)NULL,e)) { -} - template inline T &algo::qLast(const algo::aryptr &ary) { return ary.elems[ary.n_elems-1]; } #ifdef WIN32 -inline u16 htobe16(u16 val) { return _byteswap_ushort(val); } -inline u32 htobe32(u32 val) { return _byteswap_ulong(val); } -inline u64 htobe64(u64 val) { return _byteswap_uint64(val); } -inline u16 be16toh(u16 val) { return _byteswap_ushort(val); } -inline u32 be32toh(u32 val) { return _byteswap_ulong(val); } -inline u64 be64toh(u64 val) { return _byteswap_uint64(val); } -inline u16 htole16(u16 val) { return val; } -inline u32 htole32(u32 val) { return val; } -inline u64 htole64(u64 val) { return val; } +inline u16 htobe16(u16 val) { + return _byteswap_ushort(val); +} +inline u32 htobe32(u32 val) { + return _byteswap_ulong(val); +} +inline u64 htobe64(u64 val) { + return _byteswap_uint64(val); +} +inline u16 be16toh(u16 val) { + return _byteswap_ushort(val); +} +inline u32 be32toh(u32 val) { + return _byteswap_ulong(val); +} +inline u64 be64toh(u64 val) { + return _byteswap_uint64(val); +} +inline u16 htole16(u16 val) { + return val; +} +inline u32 htole32(u32 val) { + return val; +} +inline u64 htole64(u64 val) { + return val; +} #endif // Taylor series expansion. For x around 0.01, this produces 2 digits per @@ -192,68 +207,6 @@ inline int algo::ParseHex1(u32 c, u8 &result) { // ----------------------------------------------------------------------------- -inline void algo::PageBufInit(PageBuf &F, u64 n, u64 align) { -#ifdef WIN32 - F.elems = (u8*)_aligned_malloc(n, align); - vrfy(F.elems!=NULL, "aligned_malloc"); -#else - errno_vrfy(posix_memalign((void**)&F.elems, align, n)==0, "posix_memalign"); -#endif - F.n_elems = (int)n; -} - -inline u32 u8_Hash (u32 prev, u8 val) { - return _mm_crc32_u8 (prev,val); -} - -inline u32 u16_Hash(u32 prev, u16 val) { - return _mm_crc32_u16(prev,val); -} - -inline u32 u32_Hash(u32 prev, u32 val) { - return _mm_crc32_u32(prev,val); -} - -inline u32 u64_Hash(u32 prev, u64 val) { - return _mm_crc32_u64(prev, val); -} - -inline u32 i8_Hash (u32 prev, i8 val) { - return _mm_crc32_u8 (prev,val); -} - -inline u32 i16_Hash(u32 prev, i16 val) { - return _mm_crc32_u16(prev,val); -} - -inline u32 i32_Hash(u32 prev, i32 val) { - return _mm_crc32_u32(prev,val); -} - -inline u32 i64_Hash(u32 prev, i64 val) { - return _mm_crc32_u64(prev, val); -} - -inline u32 bool_Hash(u32 prev, bool val) { - return _mm_crc32_u8 (prev,val); -} - -inline u32 char_Hash(u32 prev, char val) { - return _mm_crc32_u8 (prev,val); -} - -inline u32 float_Hash(u32 prev, float val) { - return algo::CRC32Step(prev, (u8*)&val, sizeof(val)); -} - -inline u32 double_Hash(u32 prev, double val) { - return algo::CRC32Step(prev, (u8*)&val, sizeof(val)); -} - -inline u32 u128_Hash(u32 prev, u128 t) { - return algo::CRC32Step(prev, (u8*)&t, sizeof(t)); -} - inline u32 algo::strptr_Hash(u32 prev, algo::strptr val) { return algo::CRC32Step(prev, (u8*)val.elems, val.n_elems); } @@ -262,181 +215,10 @@ inline u32 algo::cstring_Hash(u32 prev, const algo::strptr &val) { return algo::CRC32Step(prev, (u8*)val.elems, val.n_elems); } -inline u32 algo::cstring_Hash(u32 prev, algo::cstring &val) { - return algo::CRC32Step(prev, (u8*)val.ch_elems, val.ch_n); -} - -inline u32 algo::cstring_Hash(u32 prev, const algo::cstring &val) { - return algo::CRC32Step(prev, (u8*)val.ch_elems, val.ch_n); -} - -// ----------------------------------------------------------------------------- - -inline i32 u8_Cmp (u8 a, u8 b) { - return ab; -} - -inline i32 u16_Cmp(u16 a, u16 b) { - return ab; -} - -inline i32 u32_Cmp(u32 a, u32 b) { - return ab; -} - -inline i32 u64_Cmp(u64 a, u64 b) { - return ab; -} - -inline i32 i8_Cmp (i8 a, i8 b) { - return ab; -} - -inline i32 i16_Cmp(i16 a, i16 b) { - return ab; -} - -inline i32 i32_Cmp(i32 a, i32 b) { - return ab; -} - -inline i32 i64_Cmp(i64 a, i64 b) { - return ab; -} - -inline i32 bool_Cmp(bool a, bool b) { - return ab; -} - -inline i32 char_Cmp(char a, char b) { - return ab; -} - -inline i32 float_Cmp(float a, float b) { - return ab; -} - -inline i32 double_Cmp(double a, double b) { - return ab; -} - -inline i32 u128_Cmp(u128 a, u128 b) { - return ab; -} - -// ----------------------------------------------------------------------------- - -inline bool u8_Lt (u8 a, u8 b) { - return a < b; -} - -inline bool u16_Lt(u16 a, u16 b) { - return a < b; -} - -inline bool u32_Lt(u32 a, u32 b) { - return a < b; -} - -inline bool u64_Lt(u64 a, u64 b) { - return a < b; -} - -inline bool i8_Lt (i8 a, i8 b) { - return a < b; -} - -inline bool i16_Lt(i16 a, i16 b) { - return a < b; -} - -inline bool i32_Lt(i32 a, i32 b) { - return a < b; -} - -inline bool i64_Lt(i64 a, i64 b) { - return a < b; -} - -inline bool bool_Lt(bool a, bool b) { - return a < b; -} - -inline bool char_Lt(char a, char b) { - return a < b; -} - -inline bool float_Lt(float a, float b) { - return a < b; -} - -inline bool double_Lt(double a, double b) { - return a < b; -} - -inline bool u128_Lt(u128 a, u128 b) { - return a < b; -} - -// ----------------------------------------------------------------------------- - -inline bool u8_Eq (u8 a, u8 b) { - return a == b; -} - -inline bool u16_Eq(u16 a, u16 b) { - return a == b; -} - -inline bool u32_Eq(u32 a, u32 b) { - return a == b; -} - -inline bool u64_Eq(u64 a, u64 b) { - return a == b; -} - -inline bool i8_Eq (i8 a, i8 b) { - return a == b; -} - -inline bool i16_Eq(i16 a, i16 b) { - return a == b; -} - -inline bool i32_Eq(i32 a, i32 b) { - return a == b; -} - -inline bool i64_Eq(i64 a, i64 b) { - return a == b; -} - -inline bool bool_Eq(bool a, bool b) { - return a == b; -} - -inline bool char_Eq(char a, char b) { - return a == b; -} - -inline bool float_Eq(float a, float b) { - return a == b; -} - -inline bool double_Eq(double a, double b) { - return a == b; -} - -inline bool u128_Eq(u128 a, u128 b) { - return a == b; -} - #ifdef AOS_SSE42 -// this is inefficient because it would be nice to be able to overrun strings. -// however, we don't check byte alignment at the beginning, -// so a 2-byte string that lies 4 bytes before the end of a page could fault. +// When compiled with AOS_SSE42, use intrinsics. +// Otherwise, the function is defined in crc32.cpp and uses a software implementation inline u32 algo::CRC32Step(u32 old, const u8 *x, size_t len) { u64 h = old; while (len>=8) { h = _mm_crc32_u64(h,*(u64 T_MAY_ALIAS*)x); x = (u8*)x + 8; len -= 8; } @@ -892,10 +674,6 @@ inline bool algo::u32_Pow2Q(u32 i) { return (i>0) && !(i & (i-1)); } -inline algo::PageBuf::~PageBuf() { - free(elems);// posix_memalign_free? -} - #pragma once @@ -1164,14 +942,6 @@ inline algo::aryptr algo::ch_GetRegion(const strptr &lhs, u32 lo, u32 n) { return algo::aryptr(lhs.elems + lo, n); } -inline int algo::ImpliedLength(char *, const char *c) { - return int(c ? strlen(c) : 0); -} - -inline int algo::ImpliedLength(const char *, const char *c) { - return int(c ? strlen(c) : 0); -} - inline int algo::ch_N(const strptr &s) { return s.n_elems; } @@ -1333,15 +1103,13 @@ template inline bool algo::SameSignQ(T a, T b) { // Compare two strings for equality, case-sensitively inline bool algo::strptr_Eq(algo::strptr a, algo::strptr b) { - // strncmp is heavily optimized using vector instructions - // and is the fastest way to do this - return a.n_elems==b.n_elems && strncmp(a.elems,b.elems,a.n_elems)==0; + return a.n_elems==b.n_elems && memcmp(a.elems,b.elems,a.n_elems)==0; } // Test if string A is lexicographically less than string B. inline bool algo::strptr_Lt(algo::strptr a, algo::strptr b) { int n = i32_Min(a.n_elems,b.n_elems); - int cmp=strncmp(a.elems,b.elems,n); + int cmp=memcmp(a.elems,b.elems,n); return cmp==0 ? a.n_elems inline bool algo::DecodeNChars(algo::memptr &buf, int n, T &result) { + strptr tmp; + bool ok = DecodeNChars(buf,n,tmp); + result = tmp; + return ok; +} diff --git a/include/amc.h b/include/amc.h index 070ad3d6..af6fcb87 100644 --- a/include/amc.h +++ b/include/amc.h @@ -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-2013 AlgoEngineering LLC @@ -40,10 +40,10 @@ namespace amc { // update-hdr // cpp/amc/alias.cpp -- Alias field type // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Alias(); - // void tfunc_Alias_Get(); - // void tfunc_Alias_Set(); - // void tfunc_Alias_ReadStrptrMaybe(); + // void tclass_Alias(); // gstatic/amcdb.tclass:Alias + // void tfunc_Alias_Get(); // gstatic/amcdb.tfunc:Alias.Get + // void tfunc_Alias_Set(); // gstatic/amcdb.tfunc:Alias.Set + // void tfunc_Alias_ReadStrptrMaybe(); // gstatic/amcdb.tfunc:Alias.ReadStrptrMaybe // ------------------------------------------------------------------- // cpp/amc/avl.cpp -- AVL tree @@ -51,122 +51,122 @@ namespace amc { // update-hdr // Initialize the structs etc. // (user-implemented function, prototype is in amc-generated header) - // void tclass_Atree(); + // void tclass_Atree(); // gstatic/amcdb.tclass:Atree // Predicate function, can take parent as argument in the case of complicated comparisons. - // void tfunc_Atree_ElemLt(); + // void tfunc_Atree_ElemLt(); // gstatic/amcdb.tfunc:Atree.ElemLt // Generate the Prev function for the element. // Always symmetrical to Next through substitution of // First -> Last and Left -> Right. - // void tfunc_Atree_Prev(); + // void tfunc_Atree_Prev(); // gstatic/amcdb.tfunc:Atree.Prev // Generate the Next function for the element - // void tfunc_Atree_Next(); + // void tfunc_Atree_Next(); // gstatic/amcdb.tfunc:Atree.Next // Initialize Root and Number of elements - // void tfunc_Atree_Init(); + // void tfunc_Atree_Init(); // gstatic/amcdb.tfunc:Atree.Init // Returns true if the element is in tree. - // void tfunc_Atree_InTreeQ(); + // void tfunc_Atree_InTreeQ(); // gstatic/amcdb.tfunc:Atree.InTreeQ // Returns true if the tree is empty. // Plant a tree if empty! - // void tfunc_Atree_EmptyQ(); + // void tfunc_Atree_EmptyQ(); // gstatic/amcdb.tfunc:Atree.EmptyQ // Given an element finds the smallest element in the subtree. - // void tfunc_Atree_FirstImpl(); + // void tfunc_Atree_FirstImpl(); // gstatic/amcdb.tfunc:Atree.FirstImpl // Given an element finds the largest element in the subtree. - // void tfunc_Atree_LastImpl(); + // void tfunc_Atree_LastImpl(); // gstatic/amcdb.tfunc:Atree.LastImpl // Returns the smallest element - // void tfunc_Atree_First(); + // void tfunc_Atree_First(); // gstatic/amcdb.tfunc:Atree.First // Returns the largest element. - // void tfunc_Atree_Last(); + // void tfunc_Atree_Last(); // gstatic/amcdb.tfunc:Atree.Last // Finds the child that violates the balance. Left child if no disbalance. - // void tfunc_Atree_TallerChild(); + // void tfunc_Atree_TallerChild(); // gstatic/amcdb.tfunc:Atree.TallerChild // Disconnect the node from its parent. - // void tfunc_Atree_Disconnect(); + // void tfunc_Atree_Disconnect(); // gstatic/amcdb.tfunc:Atree.Disconnect // Rotates the tree from the direction from->to // Assumption is that from is the child of to. - // void tfunc_Atree_Turn(); + // void tfunc_Atree_Turn(); // gstatic/amcdb.tfunc:Atree.Turn // 1. Find disbalanced child. // 2. Find disbalanced grandchild. // 3. turn the grandchild toward child to have a-b-c simple case. // 4. Turn child onto node. // 5. Make sure to NOT turn the grandchild into child if child is balanced(Many hours of debugging). - // void tfunc_Atree_Rebalance(); - // void tfunc_Atree_UpdateDepth(); + // void tfunc_Atree_Rebalance(); // gstatic/amcdb.tfunc:Atree.Rebalance + // void tfunc_Atree_UpdateDepth(); // gstatic/amcdb.tfunc:Atree.UpdateDepth // Keep updating the depth and propagating up. // If a node needs rebalancing we rebalance and go up // Notice that after rebalance a node can go deeper down the tree. - // void tfunc_Atree_Propagate(); + // void tfunc_Atree_Propagate(); // gstatic/amcdb.tfunc:Atree.Propagate // Iterate down the tree starting from the parent and place // the element in the appropriate leaf. // Note that balance might be broken after this operation. - // void tfunc_Atree_InsertImpl(); + // void tfunc_Atree_InsertImpl(); // gstatic/amcdb.tfunc:Atree.InsertImpl // 1.Insert element starting from the root. // 2. Rebalance if necessary. // 3. Assign new root. - // void tfunc_Atree_Insert(); + // void tfunc_Atree_Insert(); // gstatic/amcdb.tfunc:Atree.Insert // Leftbalance - Rightbalance - // void tfunc_Atree_Balance(); + // void tfunc_Atree_Balance(); // gstatic/amcdb.tfunc:Atree.Balance // A recursive function to delete elements. // if del flag is set it also destroys the elements. - // void tfunc_Atree_RemoveAllImpl(); - // void tfunc_Atree_Cascdel(); + // void tfunc_Atree_RemoveAllImpl(); // gstatic/amcdb.tfunc:Atree.RemoveAllImpl + // void tfunc_Atree_Cascdel(); // gstatic/amcdb.tfunc:Atree.Cascdel // Remove all elements without deleting them. - // void tfunc_Atree_RemoveAll(); + // void tfunc_Atree_RemoveAll(); // gstatic/amcdb.tfunc:Atree.RemoveAll // Remove the first element. Rebalance. Update root. - // void tfunc_Atree_RemoveFirst(); + // void tfunc_Atree_RemoveFirst(); // gstatic/amcdb.tfunc:Atree.RemoveFirst // Reinsert an element - // void tfunc_Atree_Reinsert(); + // void tfunc_Atree_Reinsert(); // gstatic/amcdb.tfunc:Atree.Reinsert // Connect 2 elements (either can be NULL). - // void tfunc_Atree_Connect(); + // void tfunc_Atree_Connect(); // gstatic/amcdb.tfunc:Atree.Connect // 1. Find next/prev element in my subtree (opposite of imbalance direction). // 2. If that element has a child, swap it with the child by turning from child. // 3. Swap the element to be removed with the next. // 4. Remove the element. // 5. Propagate up from the next's parent. - // void tfunc_Atree_Remove(); + // void tfunc_Atree_Remove(); // gstatic/amcdb.tfunc:Atree.Remove // First element that is greater or equal to the given value - // void tfunc_Atree_FirstGe(); + // void tfunc_Atree_FirstGe(); // gstatic/amcdb.tfunc:Atree.FirstGe // First element that is smaller than given value - // void tfunc_Atree_LastLt(); + // void tfunc_Atree_LastLt(); // gstatic/amcdb.tfunc:Atree.LastLt // Generate cursor related funcs and struct. // Pretty straightforward since Next is done without extra state. - // void tfunc_Atree_curs(); + // void tfunc_Atree_curs(); // gstatic/amcdb.tfunc:Atree.curs // ------------------------------------------------------------------- // cpp/amc/base.cpp -- Base reftype // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Base(); + // void tclass_Base(); // gstatic/amcdb.tclass:Base // Generate a function to copy fields from a ctype to its base type - // void tfunc_Base_CopyOut(); - // void tfunc_Base_CopyIn(); - // void tfunc_Base_Castbase(); - // void tfunc_Base_Castdown(); + // void tfunc_Base_CopyOut(); // gstatic/amcdb.tfunc:Base.CopyOut + // void tfunc_Base_CopyIn(); // gstatic/amcdb.tfunc:Base.CopyIn + // void tfunc_Base_Castbase(); // gstatic/amcdb.tfunc:Base.Castbase + // void tfunc_Base_Castdown(); // gstatic/amcdb.tfunc:Base.Castdown double ChildRowid(double rowid); void CloneFields(amc::FCtype &from, amc::FCtype &to, double next_rowid, amc::FField &basefield); @@ -174,83 +174,83 @@ namespace amc { // update-hdr // cpp/amc/bheap.cpp -- Binary heaps // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Bheap(); - // void tfunc_Bheap_Upheap(); - // void tfunc_Bheap_Downheap(); - // void tfunc_Bheap_Reheap(); - // void tfunc_Bheap_ReheapFirst(); - // void tfunc_Bheap_Set(); - // void tfunc_Bheap_SetIfBetter(); - // void tfunc_Bheap_Cascdel(); - // void tfunc_Bheap_RemoveFirst(); - // void tfunc_Bheap_First(); - // void tfunc_Bheap_InBheapQ(); - // void tfunc_Bheap_Insert(); - // void tfunc_Bheap_Compact(); - // void tfunc_Bheap_Remove(); - // void tfunc_Bheap_N(); - // void tfunc_Bheap_EmptyQ(); - // void tfunc_Bheap_RemoveAll(); - // void tfunc_Bheap_Dealloc(); - // void tfunc_Bheap_Reserve(); - // void tfunc_Bheap_Init(); - // void tfunc_Bheap_Uninit(); - // void tfunc_Bheap_ElemLt(); - // void tfunc_Bheap_ElemLtval(); - // void tfunc_Bheap_unordcurs(); - // void tfunc_Bheap_curs(); + // void tclass_Bheap(); // gstatic/amcdb.tclass:Bheap + // void tfunc_Bheap_Upheap(); // gstatic/amcdb.tfunc:Bheap.Upheap + // void tfunc_Bheap_Downheap(); // gstatic/amcdb.tfunc:Bheap.Downheap + // void tfunc_Bheap_Reheap(); // gstatic/amcdb.tfunc:Bheap.Reheap + // void tfunc_Bheap_ReheapFirst(); // gstatic/amcdb.tfunc:Bheap.ReheapFirst + // void tfunc_Bheap_Set(); // gstatic/amcdb.tfunc:Bheap.Set + // void tfunc_Bheap_SetIfBetter(); // gstatic/amcdb.tfunc:Bheap.SetIfBetter + // void tfunc_Bheap_Cascdel(); // gstatic/amcdb.tfunc:Bheap.Cascdel + // void tfunc_Bheap_RemoveFirst(); // gstatic/amcdb.tfunc:Bheap.RemoveFirst + // void tfunc_Bheap_First(); // gstatic/amcdb.tfunc:Bheap.First + // void tfunc_Bheap_InBheapQ(); // gstatic/amcdb.tfunc:Bheap.InBheapQ + // void tfunc_Bheap_Insert(); // gstatic/amcdb.tfunc:Bheap.Insert + // void tfunc_Bheap_Compact(); // gstatic/amcdb.tfunc:Bheap.Compact + // void tfunc_Bheap_Remove(); // gstatic/amcdb.tfunc:Bheap.Remove + // void tfunc_Bheap_N(); // gstatic/amcdb.tfunc:Bheap.N + // void tfunc_Bheap_EmptyQ(); // gstatic/amcdb.tfunc:Bheap.EmptyQ + // void tfunc_Bheap_RemoveAll(); // gstatic/amcdb.tfunc:Bheap.RemoveAll + // void tfunc_Bheap_Dealloc(); // gstatic/amcdb.tfunc:Bheap.Dealloc + // void tfunc_Bheap_Reserve(); // gstatic/amcdb.tfunc:Bheap.Reserve + // void tfunc_Bheap_Init(); // gstatic/amcdb.tfunc:Bheap.Init + // void tfunc_Bheap_Uninit(); // gstatic/amcdb.tfunc:Bheap.Uninit + // void tfunc_Bheap_ElemLt(); // gstatic/amcdb.tfunc:Bheap.ElemLt + // void tfunc_Bheap_ElemLtval(); // gstatic/amcdb.tfunc:Bheap.ElemLtval + // void tfunc_Bheap_unordcurs(); // gstatic/amcdb.tfunc:Bheap.unordcurs + // void tfunc_Bheap_curs(); // gstatic/amcdb.tfunc:Bheap.curs // ------------------------------------------------------------------- // cpp/amc/bitfld.cpp -- Bit fields // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Bitfld(); - // void tfunc_Bitfld_Init(); - // void tfunc_Bitfld_Get(); - // void tfunc_Bitfld_Set(); + // void tclass_Bitfld(); // gstatic/amcdb.tclass:Bitfld + // void tfunc_Bitfld_Init(); // gstatic/amcdb.tfunc:Bitfld.Init + // void tfunc_Bitfld_Get(); // gstatic/amcdb.tfunc:Bitfld.Get + // void tfunc_Bitfld_Set(); // gstatic/amcdb.tfunc:Bitfld.Set // ------------------------------------------------------------------- // cpp/amc/bitset.cpp -- Bit sets // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Bitset(); - // void tfunc_Bitset_N(); - // void tfunc_Bitset_qFind(); - // void tfunc_Bitset_NBits(); - // void tfunc_Bitset_qGetBit(); - // void tfunc_Bitset_GetBit(); - // void tfunc_Bitset_Sum1s(); - // void tfunc_Bitset_BitsEmptyQ(); - // void tfunc_Bitset_qClearBit(); - // void tfunc_Bitset_ClearBit(); - // void tfunc_Bitset_qSetBit(); - // void tfunc_Bitset_SetBit(); - // void tfunc_Bitset_qSetBitVal(); - // void tfunc_Bitset_qOrBitVal(); - // void tfunc_Bitset_ClearBitsAll(); - // void tfunc_Bitset_ClearBits(); - // void tfunc_Bitset_OrBits(); - // void tfunc_Bitset_ExpandBits(); - // void tfunc_Bitset_AllocBit(); - // void tfunc_Bitset_Sup(); - // void tfunc_Bitset_bitcurs(); + // void tclass_Bitset(); // gstatic/amcdb.tclass:Bitset + // void tfunc_Bitset_N(); // gstatic/amcdb.tfunc:Bitset.N + // void tfunc_Bitset_qFind(); // gstatic/amcdb.tfunc:Bitset.qFind + // void tfunc_Bitset_NBits(); // gstatic/amcdb.tfunc:Bitset.NBits + // void tfunc_Bitset_qGetBit(); // gstatic/amcdb.tfunc:Bitset.qGetBit + // void tfunc_Bitset_GetBit(); // gstatic/amcdb.tfunc:Bitset.GetBit + // void tfunc_Bitset_Sum1s(); // gstatic/amcdb.tfunc:Bitset.Sum1s + // void tfunc_Bitset_BitsEmptyQ(); // gstatic/amcdb.tfunc:Bitset.BitsEmptyQ + // void tfunc_Bitset_qClearBit(); // gstatic/amcdb.tfunc:Bitset.qClearBit + // void tfunc_Bitset_ClearBit(); // gstatic/amcdb.tfunc:Bitset.ClearBit + // void tfunc_Bitset_qSetBit(); // gstatic/amcdb.tfunc:Bitset.qSetBit + // void tfunc_Bitset_SetBit(); // gstatic/amcdb.tfunc:Bitset.SetBit + // void tfunc_Bitset_qSetBitVal(); // gstatic/amcdb.tfunc:Bitset.qSetBitVal + // void tfunc_Bitset_qOrBitVal(); // gstatic/amcdb.tfunc:Bitset.qOrBitVal + // void tfunc_Bitset_ClearBitsAll(); // gstatic/amcdb.tfunc:Bitset.ClearBitsAll + // void tfunc_Bitset_ClearBits(); // gstatic/amcdb.tfunc:Bitset.ClearBits + // void tfunc_Bitset_OrBits(); // gstatic/amcdb.tfunc:Bitset.OrBits + // void tfunc_Bitset_ExpandBits(); // gstatic/amcdb.tfunc:Bitset.ExpandBits + // void tfunc_Bitset_AllocBit(); // gstatic/amcdb.tfunc:Bitset.AllocBit + // void tfunc_Bitset_Sup(); // gstatic/amcdb.tfunc:Bitset.Sup + // void tfunc_Bitset_bitcurs(); // gstatic/amcdb.tfunc:Bitset.bitcurs // ------------------------------------------------------------------- // cpp/amc/blkpool.cpp -- Block pool // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Blkpool(); - // void tfunc_Blkpool_AllocMem(); - // void tfunc_Blkpool_SetBufferSize(); - // void tfunc_Blkpool_ReserveBuffers(); - // void tfunc_Blkpool_FreeMem(); - // void tfunc_Blkpool_Init(); + // void tclass_Blkpool(); // gstatic/amcdb.tclass:Blkpool + // void tfunc_Blkpool_AllocMem(); // gstatic/amcdb.tfunc:Blkpool.AllocMem + // void tfunc_Blkpool_SetBufferSize(); // gstatic/amcdb.tfunc:Blkpool.SetBufferSize + // void tfunc_Blkpool_ReserveBuffers(); // gstatic/amcdb.tfunc:Blkpool.ReserveBuffers + // void tfunc_Blkpool_FreeMem(); // gstatic/amcdb.tfunc:Blkpool.FreeMem + // void tfunc_Blkpool_Init(); // gstatic/amcdb.tfunc:Blkpool.Init // ------------------------------------------------------------------- // cpp/amc/cget.cpp -- Getters / Setters // // (user-implemented function, prototype is in amc-generated header) - // void gen_cget(); + // void gen_cget(); // gstatic/amcdb.gen:cget // ------------------------------------------------------------------- // cpp/amc/charset.cpp -- Charset functions @@ -258,15 +258,15 @@ namespace amc { // update-hdr // Preprocess charsets // (user-implemented function, prototype is in amc-generated header) - // void gen_newfield_charset(); - // void tclass_Charset(); - // void tfunc_Charset_Match(); + // void gen_newfield_charset(); // gstatic/amcdb.gen:newfield_charset + // void tclass_Charset(); // gstatic/amcdb.tclass:Charset + // void tfunc_Charset_Match(); // gstatic/amcdb.tfunc:Charset.Match // ------------------------------------------------------------------- // cpp/amc/checkxref.cpp -- X-reference checker // // (user-implemented function, prototype is in amc-generated header) - // void gen_check_xref(); + // void gen_check_xref(); // gstatic/amcdb.gen:check_xref // ------------------------------------------------------------------- // cpp/amc/cmp.cpp -- Comparison functions @@ -274,16 +274,16 @@ namespace amc { // update-hdr // Field comparison functions // (user-implemented function, prototype is in amc-generated header) - // void tclass_Cmp(); + // void tclass_Cmp(); // gstatic/amcdb.tclass:Cmp // Next char function for version sort - // void tfunc_Cmp_Nextchar(); + // void tfunc_Cmp_Nextchar(); // gstatic/amcdb.tfunc:Cmp.Nextchar // Comparison function for field - // void tfunc_Cmp_Cmp(); + // void tfunc_Cmp_Cmp(); // gstatic/amcdb.tfunc:Cmp.Cmp // Lt function for field - // void tfunc_Cmp_Lt(); + // void tfunc_Cmp_Lt(); // gstatic/amcdb.tfunc:Cmp.Lt // ------------------------------------------------------------------- // cpp/amc/concat.cpp -- Pkey constructor @@ -294,25 +294,25 @@ namespace amc { // update-hdr // cpp/amc/count.cpp -- Count reftype // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Count(); - // void tfunc_Count_Insert(); - // void tfunc_Count_Remove(); - // void tfunc_Count_N(); + // void tclass_Count(); // gstatic/amcdb.tclass:Count + // void tfunc_Count_Insert(); // gstatic/amcdb.tfunc:Count.Insert + // void tfunc_Count_Remove(); // gstatic/amcdb.tfunc:Count.Remove + // void tfunc_Count_N(); // gstatic/amcdb.tfunc:Count.N // ------------------------------------------------------------------- // cpp/amc/cppfunc.cpp -- Cppfunc reftype // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Cppfunc(); - // void tfunc_Cppfunc_Get(); - // void tfunc_Cppfunc_Init(); - // void tfunc_Cppfunc_Set(); + // void tclass_Cppfunc(); // gstatic/amcdb.tclass:Cppfunc + // void tfunc_Cppfunc_Get(); // gstatic/amcdb.tfunc:Cppfunc.Get + // void tfunc_Cppfunc_Init(); // gstatic/amcdb.tfunc:Cppfunc.Init + // void tfunc_Cppfunc_Set(); // gstatic/amcdb.tfunc:Cppfunc.Set // ------------------------------------------------------------------- // cpp/amc/ctype.cpp -- Ctype code generators // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Ctype(); + // void tclass_Ctype(); // gstatic/amcdb.tclass:Ctype // Generate de-initialization function: // - cascdel fields @@ -320,31 +320,31 @@ namespace amc { // update-hdr // - user-defined cleanup for all fields // - un-init fields (frees memory) // All fields are scanned in reverse order - // void tfunc_Ctype_Uninit(); + // void tfunc_Ctype_Uninit(); // gstatic/amcdb.tfunc:Ctype.Uninit // Introduce local variable that points to the parent side of XREF // by evaluating the path provided by xref + xreffld + xrefvia records. bool ComputeAccess(algo_lib::Replscope &R, amc::FCtype &ctype, amc::FXref &xref, amc::FFunc &func, amc::FGenXref &frame, bool check_null); // (user-implemented function, prototype is in amc-generated header) - // void tfunc_Ctype_XrefMaybe(); - // void tfunc_Ctype_Unref(); - // void tfunc_Ctype_Hash(); + // void tfunc_Ctype_XrefMaybe(); // gstatic/amcdb.tfunc:Ctype.XrefMaybe + // void tfunc_Ctype_Unref(); // gstatic/amcdb.tfunc:Ctype.Unref + // void tfunc_Ctype_Hash(); // gstatic/amcdb.tfunc:Ctype.Hash // Comparison function for ctype // In amc, equality is not strictly a property of a type; it can be overriden on a per-field basis // For example, the same field (algo.Smallstr100 for instance) can be made case-insensitive // for the purposes of comparison within some ctype // That's why the Cmp function for ctype does not call out fo - // void tfunc_Ctype_Cmp(); + // void tfunc_Ctype_Cmp(); // gstatic/amcdb.tfunc:Ctype.Cmp // Less-than function for ctype - // void tfunc_Ctype_Lt(); - // void tfunc_Ctype_Init(); - // void tfunc_Ctype_Update(); - // void tfunc_Ctype_Min(); - // void tfunc_Ctype_Max(); - // void tfunc_Ctype_UpdateMin(); - // void tfunc_Ctype_UpdateMax(); + // void tfunc_Ctype_Lt(); // gstatic/amcdb.tfunc:Ctype.Lt + // void tfunc_Ctype_Init(); // gstatic/amcdb.tfunc:Ctype.Init + // void tfunc_Ctype_Update(); // gstatic/amcdb.tfunc:Ctype.Update + // void tfunc_Ctype_Min(); // gstatic/amcdb.tfunc:Ctype.Min + // void tfunc_Ctype_Max(); // gstatic/amcdb.tfunc:Ctype.Max + // void tfunc_Ctype_UpdateMin(); // gstatic/amcdb.tfunc:Ctype.UpdateMin + // void tfunc_Ctype_UpdateMax(); // gstatic/amcdb.tfunc:Ctype.UpdateMax // Equality function for ctype // The function proceeds field-by-field, using the following rules: @@ -355,48 +355,48 @@ namespace amc { // update-hdr // - any string fields are compared as regular strings // - if no custom Eq function is defined on a field, but the field's type has an Eq function, it is used // - for all other fields, c++ operator "==" is used. it better be defined - // void tfunc_Ctype_Eq(); - // void tfunc_Ctype_ToCmdline(); + // void tfunc_Ctype_Eq(); // gstatic/amcdb.tfunc:Ctype.Eq + // void tfunc_Ctype_ToCmdline(); // gstatic/amcdb.tfunc:Ctype.ToCmdline // Used with command lines - // void tfunc_Ctype_NArgs(); - // void tfunc_Ctype_Print(); - // void tfunc_Ctype_Read(); - // void tfunc_Ctype_EqEnum(); - // void tfunc_Ctype_GetAnon(); - // void tfunc_Ctype_GetMsgLength(); - // void tfunc_Ctype_GetMsgMemptr(); - // void tclass_Ctype2(); + // void tfunc_Ctype_NArgs(); // gstatic/amcdb.tfunc:Ctype.NArgs + // void tfunc_Ctype_Print(); // gstatic/amcdb.tfunc:Ctype.Print + // void tfunc_Ctype_Read(); // gstatic/amcdb.tfunc:Ctype.Read + // void tfunc_Ctype_EqEnum(); // gstatic/amcdb.tfunc:Ctype.EqEnum + // void tfunc_Ctype_GetAnon(); // gstatic/amcdb.tfunc:Ctype.GetAnon + // void tfunc_Ctype_GetMsgLength(); // gstatic/amcdb.tfunc:Ctype.GetMsgLength + // void tfunc_Ctype_GetMsgMemptr(); // gstatic/amcdb.tfunc:Ctype.GetMsgMemptr + // void tclass_Ctype2(); // gstatic/amcdb.tclass:Ctype2 // Generate constructor. - // void tfunc_Ctype2_Ctor(); - // void tfunc_Ctype2_FieldwiseCtor(); - // void tfunc_Ctype2_EnumCtor(); + // void tfunc_Ctype2_Ctor(); // gstatic/amcdb.tfunc:Ctype2.Ctor + // void tfunc_Ctype2_FieldwiseCtor(); // gstatic/amcdb.tfunc:Ctype2.FieldwiseCtor + // void tfunc_Ctype2_EnumCtor(); // gstatic/amcdb.tfunc:Ctype2.EnumCtor // Generator copy constructor or assignment operator // (the two functions are very similar) void GenCopyCtorOrAssignOp(bool copyctor); // (user-implemented function, prototype is in amc-generated header) - // void tfunc_Ctype2_CopyCtor(); - // void tfunc_Ctype_AssignOp(); - // void tfunc_Ctype2_Dtor(); - // void tfunc_Ctype_EqOp(); - // void tfunc_Ctype_NeOp(); - // void tfunc_Ctype_LtOp(); - // void tfunc_Ctype_GtOp(); - // void tfunc_Ctype_LeOp(); - // void tfunc_Ctype_GeOp(); - // void tfunc_Ctype_EqOpAryptr(); + // void tfunc_Ctype2_CopyCtor(); // gstatic/amcdb.tfunc:Ctype2.CopyCtor + // void tfunc_Ctype_AssignOp(); // gstatic/amcdb.tfunc:Ctype.AssignOp + // void tfunc_Ctype2_Dtor(); // gstatic/amcdb.tfunc:Ctype2.Dtor + // void tfunc_Ctype_EqOp(); // gstatic/amcdb.tfunc:Ctype.EqOp + // void tfunc_Ctype_NeOp(); // gstatic/amcdb.tfunc:Ctype.NeOp + // void tfunc_Ctype_LtOp(); // gstatic/amcdb.tfunc:Ctype.LtOp + // void tfunc_Ctype_GtOp(); // gstatic/amcdb.tfunc:Ctype.GtOp + // void tfunc_Ctype_LeOp(); // gstatic/amcdb.tfunc:Ctype.LeOp + // void tfunc_Ctype_GeOp(); // gstatic/amcdb.tfunc:Ctype.GeOp + // void tfunc_Ctype_EqOpAryptr(); // gstatic/amcdb.tfunc:Ctype.EqOpAryptr // ------------------------------------------------------------------- // cpp/amc/delptr.cpp -- Delptr reftype // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Delptr(); - // void tfunc_Delptr_Init(); - // void tfunc_Delptr_Uninit(); - // void tfunc_Delptr_Delete(); - // void tfunc_Delptr_Access(); + // void tclass_Delptr(); // gstatic/amcdb.tclass:Delptr + // void tfunc_Delptr_Init(); // gstatic/amcdb.tfunc:Delptr.Init + // void tfunc_Delptr_Uninit(); // gstatic/amcdb.tfunc:Delptr.Uninit + // void tfunc_Delptr_Delete(); // gstatic/amcdb.tfunc:Delptr.Delete + // void tfunc_Delptr_Access(); // gstatic/amcdb.tfunc:Delptr.Access // ------------------------------------------------------------------- // cpp/amc/dflt.cpp -- Field default @@ -425,6 +425,13 @@ namespace amc { // update-hdr // header, if one exists, or to a newly created enum. void Disp_CreateCasetype(amc::FDispatch &dispatch); + // ------------------------------------------------------------------- + // cpp/amc/disp/del.cpp + // + + // Generate Dispatch_Delete function + void Disp_Delete(amc::FDispatch &disp); + // ------------------------------------------------------------------- // cpp/amc/disp/filter.cpp -- Dispatch filter // @@ -433,16 +440,26 @@ namespace amc { // update-hdr void Filter_NewField(); void Filter_Gen(amc::FNs &ns); + // ------------------------------------------------------------------- + // cpp/amc/disp/kafka_decode.cpp + // + void Disp_KafkaDecode(amc::FDispatch &disp); + + // ------------------------------------------------------------------- + // cpp/amc/disp/kafka_encode.cpp + // + void Disp_KafkaEncode(amc::FDispatch &disp); + // ------------------------------------------------------------------- // cpp/amc/disp/main.cpp -- Dispatch main // // (user-implemented function, prototype is in amc-generated header) - // void gen_ns_dispatch(); + // void gen_ns_dispatch(); // gstatic/amcdb.gen:ns_dispatch // Create new fields for dispatch filters. void Disp_NewField(); // (user-implemented function, prototype is in amc-generated header) - // void gen_dispenum(); + // void gen_dispenum(); // gstatic/amcdb.gen:dispenum // ------------------------------------------------------------------- // cpp/amc/disp/msg.cpp -- Dispatch on message @@ -483,18 +500,18 @@ namespace amc { // update-hdr // cpp/amc/exec.cpp -- Exec reftype // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Exec(); - // void tfunc_Exec_Init(); - // void tfunc_Exec_Uninit(); - // void tfunc_Exec_Wait(); - // void tfunc_Exec_Kill(); - // void tfunc_Exec_Start(); - // void tfunc_Exec_StartRead(); - // void tfunc_Exec_Exec(); - // void tfunc_Exec_ExecX(); - // void tfunc_Exec_ToCmdline(); - // void tfunc_Exec_ToArgv(); - // void tfunc_Exec_Execv(); + // void tclass_Exec(); // gstatic/amcdb.tclass:Exec + // void tfunc_Exec_Init(); // gstatic/amcdb.tfunc:Exec.Init + // void tfunc_Exec_Uninit(); // gstatic/amcdb.tfunc:Exec.Uninit + // void tfunc_Exec_Wait(); // gstatic/amcdb.tfunc:Exec.Wait + // void tfunc_Exec_Kill(); // gstatic/amcdb.tfunc:Exec.Kill + // void tfunc_Exec_Start(); // gstatic/amcdb.tfunc:Exec.Start + // void tfunc_Exec_StartRead(); // gstatic/amcdb.tfunc:Exec.StartRead + // void tfunc_Exec_Exec(); // gstatic/amcdb.tfunc:Exec.Exec + // void tfunc_Exec_ExecX(); // gstatic/amcdb.tfunc:Exec.ExecX + // void tfunc_Exec_ToCmdline(); // gstatic/amcdb.tfunc:Exec.ToCmdline + // void tfunc_Exec_ToArgv(); // gstatic/amcdb.tfunc:Exec.ToArgv + // void tfunc_Exec_Execv(); // gstatic/amcdb.tfunc:Exec.Execv void NewFieldExec(); // ------------------------------------------------------------------- @@ -503,17 +520,17 @@ namespace amc { // update-hdr // Prepare FAST data // (user-implemented function, prototype is in amc-generated header) - // void gen_fast_presence(); + // void gen_fast_presence(); // gstatic/amcdb.gen:fast_presence // Type FAST encode - // void tfunc_Ctype_FastEncode(); + // void tfunc_Ctype_FastEncode(); // gstatic/amcdb.tfunc:Ctype.FastEncode // Type FAST decode - // void tfunc_Ctype_FastDecode(); - // void tfunc_Ctype_FixEncode(); + // void tfunc_Ctype_FastDecode(); // gstatic/amcdb.tfunc:Ctype.FastDecode + // void tfunc_Ctype_FixEncode(); // gstatic/amcdb.tfunc:Ctype.FixEncode // FAST - ns functions - // void gen_ns_fast(); + // void gen_ns_fast(); // gstatic/amcdb.gen:ns_fast // ------------------------------------------------------------------- // cpp/amc/fbuf.cpp -- Byte buffer @@ -523,33 +540,34 @@ namespace amc { // update-hdr // see tex/amc/amc_fbuf.tex for documentation // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Fbuf(); - // void tfunc_Fbuf_BeginRead(); - // void tfunc_Fbuf_GetMsg(); - // void tfunc_Fbuf_Init(); - // void tfunc_Fbuf_Max(); - // void tfunc_Fbuf_N(); - // void tfunc_Fbuf_Refill(); - // void tfunc_Fbuf_RemoveAll(); - // void tfunc_Fbuf_ScanMsg(); - // void tfunc_Fbuf_Shift(); - // void tfunc_Fbuf_SkipBytes(); - // void tfunc_Fbuf_SkipMsg(); - // void tfunc_Fbuf_WriteAll(); - // void tfunc_Fbuf_WriteMsg(); - // void tfunc_Fbuf_BeginWrite(); - // void tfunc_Fbuf_Outflow(); - // void tfunc_Fbuf_EndRead(); - // void tfunc_Fbuf_EndWrite(); - // void tfunc_Fbuf_Realloc(); - // void tfunc_Fbuf_Uninit(); + // void tclass_Fbuf(); // gstatic/amcdb.tclass:Fbuf + // void tfunc_Fbuf_BeginRead(); // gstatic/amcdb.tfunc:Fbuf.BeginRead + // void tfunc_Fbuf_GetMsg(); // gstatic/amcdb.tfunc:Fbuf.GetMsg + // void tfunc_Fbuf_Init(); // gstatic/amcdb.tfunc:Fbuf.Init + // void tfunc_Fbuf_Max(); // gstatic/amcdb.tfunc:Fbuf.Max + // void tfunc_Fbuf_N(); // gstatic/amcdb.tfunc:Fbuf.N + // void tfunc_Fbuf_Refill(); // gstatic/amcdb.tfunc:Fbuf.Refill + // void tfunc_Fbuf_RemoveAll(); // gstatic/amcdb.tfunc:Fbuf.RemoveAll + // void tfunc_Fbuf_ScanMsg(); // gstatic/amcdb.tfunc:Fbuf.ScanMsg + // void tfunc_Fbuf_Shift(); // gstatic/amcdb.tfunc:Fbuf.Shift + // void tfunc_Fbuf_SkipBytes(); // gstatic/amcdb.tfunc:Fbuf.SkipBytes + // void tfunc_Fbuf_SkipMsg(); // gstatic/amcdb.tfunc:Fbuf.SkipMsg + // void tfunc_Fbuf_WriteReserve(); // gstatic/amcdb.tfunc:Fbuf.WriteReserve + // void tfunc_Fbuf_WriteAll(); // gstatic/amcdb.tfunc:Fbuf.WriteAll + // void tfunc_Fbuf_WriteMsg(); // gstatic/amcdb.tfunc:Fbuf.WriteMsg + // void tfunc_Fbuf_BeginWrite(); // gstatic/amcdb.tfunc:Fbuf.BeginWrite + // void tfunc_Fbuf_Outflow(); // gstatic/amcdb.tfunc:Fbuf.Outflow + // void tfunc_Fbuf_EndRead(); // gstatic/amcdb.tfunc:Fbuf.EndRead + // void tfunc_Fbuf_EndWrite(); // gstatic/amcdb.tfunc:Fbuf.EndWrite + // void tfunc_Fbuf_Realloc(); // gstatic/amcdb.tfunc:Fbuf.Realloc + // void tfunc_Fbuf_Uninit(); // gstatic/amcdb.tfunc:Fbuf.Uninit // ------------------------------------------------------------------- // cpp/amc/fcast.cpp -- Implicit casts // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Fcast(); - // void tfunc_Fcast_Cast(); + // void tclass_Fcast(); // gstatic/amcdb.tclass:Fcast + // void tfunc_Fcast_Cast(); // gstatic/amcdb.tfunc:Fcast.Cast // ------------------------------------------------------------------- // cpp/amc/fcmap.cpp -- Fcmap generation (enum<->enum conversion) @@ -561,45 +579,45 @@ namespace amc { // update-hdr // TODO::warn about the following case: // A.b = A.c, A.d = A.e. That setup yields only one function A_FromA() instead of 2 (and a compile error). // (user-implemented function, prototype is in amc-generated header) - // void gen_fcmap(); + // void gen_fcmap(); // gstatic/amcdb.gen:fcmap // ------------------------------------------------------------------- // cpp/amc/fconst.cpp -- Constants, string <-> int conversion // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Fconst(); - // void tfunc_Fconst_GetEnum(); - // void tfunc_Fconst_SetEnum(); - // void tfunc_Fconst_ToCstr(); - // void tfunc_Fconst_Print(); - // void tfunc_Fconst_SetStrptrMaybe(); - // void tfunc_Fconst_SetStrptr(); - // void tfunc_Fconst_ReadStrptrMaybe(); + // void tclass_Fconst(); // gstatic/amcdb.tclass:Fconst + // void tfunc_Fconst_GetEnum(); // gstatic/amcdb.tfunc:Fconst.GetEnum + // void tfunc_Fconst_SetEnum(); // gstatic/amcdb.tfunc:Fconst.SetEnum + // void tfunc_Fconst_ToCstr(); // gstatic/amcdb.tfunc:Fconst.ToCstr + // void tfunc_Fconst_Print(); // gstatic/amcdb.tfunc:Fconst.Print + // void tfunc_Fconst_SetStrptrMaybe(); // gstatic/amcdb.tfunc:Fconst.SetStrptrMaybe + // void tfunc_Fconst_SetStrptr(); // gstatic/amcdb.tfunc:Fconst.SetStrptr + // void tfunc_Fconst_ReadStrptrMaybe(); // gstatic/amcdb.tfunc:Fconst.ReadStrptrMaybe // ------------------------------------------------------------------- // cpp/amc/fdec.cpp -- Decimal types // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Dec(); - // void tfunc_Dec_GetDouble(); - // void tfunc_Dec_GetInt(); - // void tfunc_Dec_GetScale(); - // void tfunc_Dec_qSetDouble(); - // void tfunc_Dec_SetDoubleMaybe(); - // void tfunc_Dec_ReadStrptrMaybe(); - // void tfunc_Dec_Print(); + // void tclass_Dec(); // gstatic/amcdb.tclass:Dec + // void tfunc_Dec_GetDouble(); // gstatic/amcdb.tfunc:Dec.GetDouble + // void tfunc_Dec_GetInt(); // gstatic/amcdb.tfunc:Dec.GetInt + // void tfunc_Dec_GetScale(); // gstatic/amcdb.tfunc:Dec.GetScale + // void tfunc_Dec_qSetDouble(); // gstatic/amcdb.tfunc:Dec.qSetDouble + // void tfunc_Dec_SetDoubleMaybe(); // gstatic/amcdb.tfunc:Dec.SetDoubleMaybe + // void tfunc_Dec_ReadStrptrMaybe(); // gstatic/amcdb.tfunc:Dec.ReadStrptrMaybe + // void tfunc_Dec_Print(); // gstatic/amcdb.tfunc:Dec.Print // ------------------------------------------------------------------- // cpp/amc/field.cpp -- Generic field genrator // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Field(); - // void tclass_Field2(); - // void tfunc_Field_Cleanup(); - // void tfunc_Field_Userinit(); - // void tfunc_Field_Cascdel(); - // void tfunc_Field2_ReadStrptrMaybe(); - // void tfunc_Field_Concat(); + // void tclass_Field(); // gstatic/amcdb.tclass:Field + // void tclass_Field2(); // gstatic/amcdb.tclass:Field2 + // void tfunc_Field_Cleanup(); // gstatic/amcdb.tfunc:Field.Cleanup + // void tfunc_Field_Userinit(); // gstatic/amcdb.tfunc:Field.Userinit + // void tfunc_Field_Cascdel(); // gstatic/amcdb.tfunc:Field.Cascdel + // void tfunc_Field2_ReadStrptrMaybe(); // gstatic/amcdb.tfunc:Field2.ReadStrptrMaybe + // void tfunc_Field_Concat(); // gstatic/amcdb.tfunc:Field.Concat // True if ReadFieldExpr for the field bool HasReadExprQ(amc::FField &field); @@ -666,7 +684,7 @@ namespace amc { // update-hdr // Emit function prototype into string OUT. // If ctype_context is specified, then the declaration is intended to be // used inside the struct, so different C++ syntax rules apply. - void PrintFuncProto(amc::FFunc& func, amc::FCtype *ctype_context, cstring &out); + void PrintFuncProto(amc::FFunc& func, amc::FCtype *ctype_context, cstring &out, bool querymode); void PrintFuncBody(amc::FNs& ns, amc::FFunc& func); bool SetRetType(amc::FFunc &func, amc::FCtype &ctype); void MaybeUnused(amc::FFunc &func, strptr name); @@ -689,10 +707,10 @@ namespace amc { // update-hdr // defined. bool FwdDeclQ(amc::FField &field); // (user-implemented function, prototype is in amc-generated header) - // void gen_ns_fwddecl2(); + // void gen_ns_fwddecl2(); // gstatic/amcdb.gen:ns_fwddecl2 // emit forward-declarations of steps - // void gen_ns_fwddecl(); + // void gen_ns_fwddecl(); // gstatic/amcdb.gen:ns_fwddecl // ------------------------------------------------------------------- // cpp/amc/gen.cpp -- AMC Generators (amcdb.gen) @@ -703,129 +721,137 @@ namespace amc { // update-hdr void PlaceFieldAfter(amc::FField &field, amc::FField &after); bool HasAllocQ(amc::FField &field); // (user-implemented function, prototype is in amc-generated header) - // void gen_usedns(); - // void gen_include(); - // void gen_ns_check_main(); - // void gen_check_cascdel(); - // void gen_check_ssimsort(); - // void gen_countxref(); + // void gen_usedns(); // gstatic/amcdb.gen:usedns + // void gen_include(); // gstatic/amcdb.gen:include + // void gen_ns_check_main(); // gstatic/amcdb.gen:ns_check_main + // void gen_check_cascdel(); // gstatic/amcdb.gen:check_cascdel + // void gen_check_ssimsort(); // gstatic/amcdb.gen:check_ssimsort + // void gen_countxref(); // gstatic/amcdb.gen:countxref // Check that a struct marked cheap_copy does not contain structs not marked that way - // void gen_check_cheapcopy(); - // void gen_check_prefix(); - // void gen_basepool(); + // void gen_check_cheapcopy(); // gstatic/amcdb.gen:check_cheapcopy + // void gen_check_prefix(); // gstatic/amcdb.gen:check_prefix + // void gen_basepool(); // gstatic/amcdb.gen:basepool // TODO: also check that targdep path exists between namespaces? - // void gen_check_basepool(); - // void gen_check_bitfld(); + // void gen_check_basepool(); // gstatic/amcdb.gen:check_basepool + // void gen_check_bitfld(); // gstatic/amcdb.gen:check_bitfld // Rewrite reftype:Pkey fields into reftype:Val - // void gen_lookuppkey(); + // void gen_lookuppkey(); // gstatic/amcdb.gen:lookuppkey // Ensure fregx record exists for each field of type Regx or RegxSql // Rewrite RegxSql fields as Regx, regxtype Sql // (generalization of original RegxSql reftype) - // void gen_rewrite_regx(); - // void gen_check_reftype(); - // void gen_detectinst(); - // void gen_check_cpptype(); + // void gen_rewrite_regx(); // gstatic/amcdb.gen:rewrite_regx + // void gen_check_reftype(); // gstatic/amcdb.gen:check_reftype + // void gen_detectinst(); // gstatic/amcdb.gen:detectinst + // void gen_check_cpptype(); // gstatic/amcdb.gen:check_cpptype // Count # fields, excluding substrings, cppfuncs, and bitfields int NValFields(amc::FCtype &ctype); // (user-implemented function, prototype is in amc-generated header) - // void gen_prep_field(); - // void gen_check_bigend(); + // void gen_prep_field(); // gstatic/amcdb.gen:prep_field + // void gen_check_bigend(); // gstatic/amcdb.gen:check_bigend // walk over all xrefs and populate ctype.c_parent array, // which lists all the "parent" ctypes (ones used by this ctype) // check - // void gen_xref_parent(); - // void gen_datafld(); - // void gen_ctype_toposort(); + // void gen_xref_parent(); // gstatic/amcdb.gen:xref_parent + // void gen_datafld(); // gstatic/amcdb.gen:datafld + // void gen_ctype_toposort(); // gstatic/amcdb.gen:ctype_toposort void PlaindataVisit(amc::FCtype &ctype); // recursively determine for each type whether it's "plaindata". // set ctype.plaindata flag. // plaindata structs can be copied with memcpy. // (user-implemented function, prototype is in amc-generated header) - // void gen_plaindata(); + // void gen_plaindata(); // gstatic/amcdb.gen:plaindata tempstr Argtype(amc::FField &field); // (user-implemented function, prototype is in amc-generated header) - // void gen_prep_ctype(); - // void gen_xref2(); - // void gen_select_ns(); + // void gen_prep_ctype(); // gstatic/amcdb.gen:prep_ctype + // void gen_xref2(); // gstatic/amcdb.gen:xref2 + // void gen_select_ns(); // gstatic/amcdb.gen:select_ns // // Generate Fconst from a column of some table. // // - // void gen_gconst(); + // void gen_gconst(); // gstatic/amcdb.gen:gconst // // Generate Fconst from a column of some table. // - // void gen_bitfldenum(); - // void gen_prep_fconst(); + // void gen_bitfldenum(); // gstatic/amcdb.gen:bitfldenum + // void gen_prep_fconst(); // gstatic/amcdb.gen:prep_fconst // Generate numeric fconsts from string fconsts - // void gen_clonefconst(); - // void gen_newfield_exec(); - // void gen_newfield_count(); + // void gen_clonefconst(); // gstatic/amcdb.gen:clonefconst + // void gen_newfield_exec(); // gstatic/amcdb.gen:newfield_exec + // void gen_newfield_count(); // gstatic/amcdb.gen:newfield_count // convert cbase records into fields of reftype Base - // void gen_newfield_cbase(); + // void gen_newfield_cbase(); // gstatic/amcdb.gen:newfield_cbase // convert cbase records into fields of reftype Base - // void gen_check_basefield(); - // void gen_newfield_sortfld(); - // void gen_newfield_ptrary(); - // void gen_newfield_dispatch(); - // void gen_newfield_cfmt(); - // void gen_ns_check_pack(); - // void gen_ns_check_path(); - // void gen_ns_pkeytypedef(); - // void gen_ns_enums(); - // void gen_ns_include(); - // void gen_ns_funcindex(); + // void gen_check_basefield(); // gstatic/amcdb.gen:check_basefield + // void gen_newfield_sortfld(); // gstatic/amcdb.gen:newfield_sortfld + // void gen_newfield_ptrary(); // gstatic/amcdb.gen:newfield_ptrary + // void gen_newfield_dispatch(); // gstatic/amcdb.gen:newfield_dispatch + // void gen_newfield_cfmt(); // gstatic/amcdb.gen:newfield_cfmt + // void gen_ns_check_pack(); // gstatic/amcdb.gen:ns_check_pack + + // A singly linked list requires scanning to locate the element to delete. + // It is considered an access path with quadratic deletion cost. + // So is a Ptrary. + bool SlowDelQ(amc::FField &field); + // (user-implemented function, prototype is in amc-generated header) + // void gen_ns_check_path(); // gstatic/amcdb.gen:ns_check_path + // void gen_ns_pkeytypedef(); // gstatic/amcdb.gen:ns_pkeytypedef + // void gen_ns_enums(); // gstatic/amcdb.gen:ns_enums + // void gen_ns_include(); // gstatic/amcdb.gen:ns_include + // void gen_ns_funcindex(); // gstatic/amcdb.gen:ns_funcindex // Print static function prototype declarations // to the cpp file - // void gen_ns_print_proto(); - // void gen_ns_print_struct(); - // void gen_ns_curstext(); - // void gen_ns_pnew(); - // void gen_ns_func(); - // void gen_ns_operators(); - // void gen_ns_check_lim(); - // void gen_proc(); - // void gen_check_fcurs(); - // void gen_check_varlen(); + // void gen_ns_print_proto(); // gstatic/amcdb.gen:ns_print_proto + // void gen_ns_print_struct(); // gstatic/amcdb.gen:ns_print_struct + // void gen_ns_curstext(); // gstatic/amcdb.gen:ns_curstext + // void gen_ns_pnew(); // gstatic/amcdb.gen:ns_pnew + // void gen_ns_func(); // gstatic/amcdb.gen:ns_func + // void gen_ns_operators(); // gstatic/amcdb.gen:ns_operators + // void gen_ns_check_lim(); // gstatic/amcdb.gen:ns_check_lim + // void gen_proc(); // gstatic/amcdb.gen:proc + // void gen_check_fcurs(); // gstatic/amcdb.gen:check_fcurs + // void gen_check_varlen(); // gstatic/amcdb.gen:check_varlen // Generate a global list c_ssimfile_sorted // which indexes ssimfiles in topological order - // void gen_sortssimfile(); + // void gen_sortssimfile(); // gstatic/amcdb.gen:sortssimfile + // void gen_create_userfunc(); // gstatic/amcdb.gen:create_userfunc + // void gen_table_write(); // gstatic/amcdb.gen:table_write // ------------------------------------------------------------------- // cpp/amc/global.cpp -- Global (FDb) // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Global(); - // void tfunc_Global_Init(); + // void tclass_Global(); // gstatic/amcdb.tclass:Global + // void tfunc_Global_Init(); // gstatic/amcdb.tfunc:Global.Init int c_parentns_FindIndex(amc::FNs& ns, amc::FNs *val); // (user-implemented function, prototype is in amc-generated header) - // void tfunc_Global_LoadTuplesMaybe(); - // void tfunc_Global_LoadTuplesFile(); - // void tfunc_Global_LoadTuplesFd(); - // void tfunc_Global_SaveTuples(); - // void tfunc_Global_InsertStrptrMaybe(); - // void tfunc_Global_InitReflection(); - // void tfunc_Global_LoadSsimfileMaybe(); - // void tfunc_Global_main(); - // void tfunc_Global_WinMain(); - // void tfunc_Global_MainLoop(); - // void tfunc_Global_Steps(); - // void tfunc_Global_Step(); - // void tfunc_Global_Main(); + // void tfunc_Global_LoadTuplesMaybe(); // gstatic/amcdb.tfunc:Global.LoadTuplesMaybe + // void tfunc_Global_LoadTuplesFile(); // gstatic/amcdb.tfunc:Global.LoadTuplesFile + // void tfunc_Global_LoadTuplesFd(); // gstatic/amcdb.tfunc:Global.LoadTuplesFd + // void tfunc_Global_SaveTuples(); // gstatic/amcdb.tfunc:Global.SaveTuples + // void tfunc_Global_InsertStrptrMaybe(); // gstatic/amcdb.tfunc:Global.InsertStrptrMaybe + // void tfunc_Global_InitReflection(); // gstatic/amcdb.tfunc:Global.InitReflection + // void tfunc_Global_LoadSsimfileMaybe(); // gstatic/amcdb.tfunc:Global.LoadSsimfileMaybe + // void tfunc_Global_main(); // gstatic/amcdb.tfunc:Global.main + // void tfunc_Global_WinMain(); // gstatic/amcdb.tfunc:Global.WinMain + // void tfunc_Global_MainLoop(); // gstatic/amcdb.tfunc:Global.MainLoop + // void tfunc_Global_Steps(); // gstatic/amcdb.tfunc:Global.Steps + // void tfunc_Global_Step(); // gstatic/amcdb.tfunc:Global.Step + // void tfunc_Global_Main(); // gstatic/amcdb.tfunc:Global.Main // Return TRUE if FIELD (in command line context) requires no argument // This is true for bool fields or fields with "emptyval" provided @@ -850,7 +876,7 @@ namespace amc { // update-hdr // Namespace ReadArgv function to read command line // (user-implemented function, prototype is in amc-generated header) - // void tfunc_Global_ReadArgv(); + // void tfunc_Global_ReadArgv(); // gstatic/amcdb.tfunc:Global.ReadArgv // ------------------------------------------------------------------- // cpp/amc/gsymbol.cpp -- Generate strings from tables @@ -858,7 +884,7 @@ namespace amc { // update-hdr // Generate regular c++ symbols from tables // (user-implemented function, prototype is in amc-generated header) - // void gen_ns_gsymbol(); + // void gen_ns_gsymbol(); // gstatic/amcdb.gen:ns_gsymbol // ------------------------------------------------------------------- // cpp/amc/hook.cpp -- Hook (function pointer) @@ -874,14 +900,14 @@ namespace amc { // update-hdr // that of cursors. void NewFieldHook(amc::FHook &hook); // (user-implemented function, prototype is in amc-generated header) - // void gen_newfield_hook(); - // void tclass_Hook(); - // void tfunc_Hook_Set0(); - // void tfunc_Hook_Set1(); - // void tfunc_Hook_Set2(); + // void gen_newfield_hook(); // gstatic/amcdb.gen:newfield_hook + // void tclass_Hook(); // gstatic/amcdb.tclass:Hook + // void tfunc_Hook_Set0(); // gstatic/amcdb.tfunc:Hook.Set0 + // void tfunc_Hook_Set1(); // gstatic/amcdb.tfunc:Hook.Set1 + // void tfunc_Hook_Set2(); // gstatic/amcdb.tfunc:Hook.Set2 // Implement _Call function for the hook - // void tfunc_Hook_Call(); + // void tfunc_Hook_Call(); // gstatic/amcdb.tfunc:Hook.Call bool InlaryQ(amc::FHook& hook); // ------------------------------------------------------------------- @@ -918,25 +944,25 @@ namespace amc { // update-hdr // cpp/amc/inlary.cpp -- Inline array // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Inlary(); - // void tfunc_Inlary_AllocMem(); - // void tfunc_Inlary_EmptyQ(); - // void tfunc_Inlary_Fill(); - // void tfunc_Inlary_Find(); - // void tfunc_Inlary_Getary(); - // void tfunc_Inlary_Init(); - // void tfunc_Inlary_Eq(); - // void tfunc_Inlary_Cmp(); - // void tfunc_Inlary_Max(); - // void tfunc_Inlary_N(); - // void tfunc_Inlary_RemoveAll(); - // void tfunc_Inlary_RemoveLast(); - // void tfunc_Inlary_RowidFind(); - // void tfunc_Inlary_Setary(); - // void tfunc_Inlary_Uninit(); - // void tfunc_Inlary_qFind(); - // void tfunc_Inlary_rowid_Get(); - // void tfunc_Inlary_curs(); + // void tclass_Inlary(); // gstatic/amcdb.tclass:Inlary + // void tfunc_Inlary_AllocMem(); // gstatic/amcdb.tfunc:Inlary.AllocMem + // void tfunc_Inlary_EmptyQ(); // gstatic/amcdb.tfunc:Inlary.EmptyQ + // void tfunc_Inlary_Fill(); // gstatic/amcdb.tfunc:Inlary.Fill + // void tfunc_Inlary_Find(); // gstatic/amcdb.tfunc:Inlary.Find + // void tfunc_Inlary_Getary(); // gstatic/amcdb.tfunc:Inlary.Getary + // void tfunc_Inlary_Init(); // gstatic/amcdb.tfunc:Inlary.Init + // void tfunc_Inlary_Eq(); // gstatic/amcdb.tfunc:Inlary.Eq + // void tfunc_Inlary_Cmp(); // gstatic/amcdb.tfunc:Inlary.Cmp + // void tfunc_Inlary_Max(); // gstatic/amcdb.tfunc:Inlary.Max + // void tfunc_Inlary_N(); // gstatic/amcdb.tfunc:Inlary.N + // void tfunc_Inlary_RemoveAll(); // gstatic/amcdb.tfunc:Inlary.RemoveAll + // void tfunc_Inlary_RemoveLast(); // gstatic/amcdb.tfunc:Inlary.RemoveLast + // void tfunc_Inlary_RowidFind(); // gstatic/amcdb.tfunc:Inlary.RowidFind + // void tfunc_Inlary_Setary(); // gstatic/amcdb.tfunc:Inlary.Setary + // void tfunc_Inlary_Uninit(); // gstatic/amcdb.tfunc:Inlary.Uninit + // void tfunc_Inlary_qFind(); // gstatic/amcdb.tfunc:Inlary.qFind + // void tfunc_Inlary_rowid_Get(); // gstatic/amcdb.tfunc:Inlary.rowid_Get + // void tfunc_Inlary_curs(); // gstatic/amcdb.tfunc:Inlary.curs // Read/Accumulate inline array from string. // For fixed arrays: @@ -957,7 +983,7 @@ namespace amc { // update-hdr // if the element doesn't fit, function returns false. // (for fixed array, element #0 is read) // - // void tfunc_Inlary_ReadStrptrMaybe(); + // void tfunc_Inlary_ReadStrptrMaybe(); // gstatic/amcdb.tfunc:Inlary.ReadStrptrMaybe // Print array to string // char/u8 are printed as-is @@ -966,16 +992,16 @@ namespace amc { // update-hdr // if none of the above conditions are present, the print function is not generated. // This function is reused by Tary and Varlen, so it cannot really assume // we're dealing with an Inlary - // void tfunc_Inlary_Print(); + // void tfunc_Inlary_Print(); // gstatic/amcdb.tfunc:Inlary.Print // ------------------------------------------------------------------- // cpp/amc/io.cpp -- I/O functions // // (user-implemented function, prototype is in amc-generated header) - // void tfunc_Io_InputMaybe(); - // void tfunc_Io_Input(); - // void tfunc_Io_SaveSsimfile(); - // void tclass_Io(); + // void tfunc_Io_InputMaybe(); // gstatic/amcdb.tfunc:Io.InputMaybe + // void tfunc_Io_Input(); // gstatic/amcdb.tfunc:Io.Input + // void tfunc_Io_SaveSsimfile(); // gstatic/amcdb.tfunc:Io.SaveSsimfile + // void tclass_Io(); // gstatic/amcdb.tclass:Io // Generate a name for the user-defined function based on the specified hook // I.e. amc::tclass_Io (hook name 'step' -- legacy -- all hooks before this feature @@ -984,73 +1010,144 @@ namespace amc { // update-hdr tempstr StaticHookName(amc::FField &field, strptr suffix); tempstr StaticHookPkey(amc::FField &field, strptr suffix); // (user-implemented function, prototype is in amc-generated header) - // void tfunc_Io_LoadStatic(); + // void tfunc_Io_LoadStatic(); // gstatic/amcdb.tfunc:Io.LoadStatic + + // ------------------------------------------------------------------- + // cpp/amc/js.cpp + // + + // add separator if lhs is not empty + void MaybeSep(cstring &lhs, strptr sep = ", "); + + // whether ctype is js or ts + bool JsQ(amc::FCtype &ctype); + + // whether ctype is ts + bool TsQ(amc::FCtype &ctype); + + // compute javascript class name + tempstr JsType(amc::FCtype &ctype); + bool JsBooleanQ(amc::FField &field); + bool JsNumberQ(algo::strptr arg); + bool JsBigintQ(algo::strptr arg); + bool JsStringQ(amc::FField &field); + + // only inline arrays of u8 and char are supported + bool JsInlaryQ(amc::FField &field); + bool JsByteArrayQ(amc::FField &field); + bool JsVarlenStringQ(amc::FField &field); + tempstr JsGetArg(amc::FField &field); + + // json-serialized type for fields + tempstr JsJsonArg(amc::FField &field); + + // explicit cast to javascript type + tempstr JsCastType(amc::FField &field); + + // compute expression for default value of field + tempstr JsDefaultExpr(amc::FField &field); + + // Calculate if the field's type is locally defined in this namespace + bool TsLocalTypeQ(amc::FField &field); + + // add import statement for name if not already in place + void TsImportMaybe(amc::FField &field, strptr name); + + // Return a javscript expression evaluating NAME, which is of type CTYPE + // to a number + tempstr JsGetnumExpr(amc::FCtype &ctype, algo::strptr name); + void JsGenBitfld(); + void TsGenEnum(); + void JsGenField(); + // (user-implemented function, prototype is in amc-generated header) + // void gen_nsjs_field(); // gstatic/amcdb.gen:nsjs_field + void TsEncodeSimpleType(algo_lib::Replscope &R, cstring &out, amc::FField &field); + void TsGenEncode(); + void TsDecodeSimpleType(algo_lib::Replscope &R, cstring &out, amc::FField &field); + void TsGenDecode(); + void TsGenJsonInterface(); + void JsGenCtype(); + // (user-implemented function, prototype is in amc-generated header) + // void gen_nsjs_ctype(); // gstatic/amcdb.gen:nsjs_ctype + void TsGenMsgtype(); + void JsGenNs(); + // (user-implemented function, prototype is in amc-generated header) + // void gen_nsjs_ns(); // gstatic/amcdb.gen:nsjs_ns + // void gen_nsjs_module(); // gstatic/amcdb.gen:nsjs_module + + // ------------------------------------------------------------------- + // cpp/amc/kafka.cpp + // + void KafkaCodec(int dir); + // (user-implemented function, prototype is in amc-generated header) + // void tfunc_Ctype_KafkaEncode(); // gstatic/amcdb.tfunc:Ctype.KafkaEncode + // void tfunc_Ctype_KafkaDecode(); // gstatic/amcdb.tfunc:Ctype.KafkaDecode // ------------------------------------------------------------------- // cpp/amc/lary.cpp -- Level array with permanent pointers // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Lary(); - // void tfunc_Lary_AllocMem(); - // void tfunc_Lary_EmptyQ(); - // void tfunc_Lary_Find(); - // void tfunc_Lary_Init(); - // void tfunc_Lary_Last(); - // void tfunc_Lary_N(); - // void tfunc_Lary_RemoveAll(); - // void tfunc_Lary_RemoveLast(); - // void tfunc_Lary_RowidFind(); - // void tfunc_Lary_Uninit(); - // void tfunc_Lary_qFind(); - // void tfunc_Lary_qLast(); - // void tfunc_Lary_curs(); + // void tclass_Lary(); // gstatic/amcdb.tclass:Lary + // void tfunc_Lary_AllocMem(); // gstatic/amcdb.tfunc:Lary.AllocMem + // void tfunc_Lary_EmptyQ(); // gstatic/amcdb.tfunc:Lary.EmptyQ + // void tfunc_Lary_Find(); // gstatic/amcdb.tfunc:Lary.Find + // void tfunc_Lary_Init(); // gstatic/amcdb.tfunc:Lary.Init + // void tfunc_Lary_Last(); // gstatic/amcdb.tfunc:Lary.Last + // void tfunc_Lary_N(); // gstatic/amcdb.tfunc:Lary.N + // void tfunc_Lary_RemoveAll(); // gstatic/amcdb.tfunc:Lary.RemoveAll + // void tfunc_Lary_RemoveLast(); // gstatic/amcdb.tfunc:Lary.RemoveLast + // void tfunc_Lary_RowidFind(); // gstatic/amcdb.tfunc:Lary.RowidFind + // void tfunc_Lary_Uninit(); // gstatic/amcdb.tfunc:Lary.Uninit + // void tfunc_Lary_qFind(); // gstatic/amcdb.tfunc:Lary.qFind + // void tfunc_Lary_qLast(); // gstatic/amcdb.tfunc:Lary.qLast + // void tfunc_Lary_curs(); // gstatic/amcdb.tfunc:Lary.curs // ------------------------------------------------------------------- // cpp/amc/llist.cpp -- Linked lists // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Llist(); - // void tfunc_Llist_Cascdel(); - // void tfunc_Llist_DestructiveFirst(); - // void tfunc_Llist_EmptyQ(); - // void tfunc_Llist_First(); - // void tfunc_Llist_InLlistQ(); - // void tfunc_Llist_Init(); - // void tfunc_Llist_Last(); - // void tfunc_Llist_N(); - // void tfunc_Llist_Next(); - // void tfunc_Llist_Prev(); - // void tfunc_Llist_Remove(); - // void tfunc_Llist_RemoveAll(); - // void tfunc_Llist_RemoveFirst(); - // void tfunc_Llist_RotateFirst(); - // void tfunc_Llist_Insert(); - // void tfunc_Llist_qLast(); - // void tclass_ZSListMT(); - // void tfunc_ZSListMT_DestructiveFirst(); - // void tfunc_ZSListMT_RemoveFirst(); - // void tfunc_ZSListMT_InLlistQ(); - // void tfunc_ZSListMT_Insert(); - // void tfunc_ZSListMT_Remove(); - // void tfunc_ZSListMT_Init(); + // void tclass_Llist(); // gstatic/amcdb.tclass:Llist + // void tfunc_Llist_Cascdel(); // gstatic/amcdb.tfunc:Llist.Cascdel + // void tfunc_Llist_DestructiveFirst(); // gstatic/amcdb.tfunc:Llist.DestructiveFirst + // void tfunc_Llist_EmptyQ(); // gstatic/amcdb.tfunc:Llist.EmptyQ + // void tfunc_Llist_First(); // gstatic/amcdb.tfunc:Llist.First + // void tfunc_Llist_InLlistQ(); // gstatic/amcdb.tfunc:Llist.InLlistQ + // void tfunc_Llist_Init(); // gstatic/amcdb.tfunc:Llist.Init + // void tfunc_Llist_Last(); // gstatic/amcdb.tfunc:Llist.Last + // void tfunc_Llist_N(); // gstatic/amcdb.tfunc:Llist.N + // void tfunc_Llist_Next(); // gstatic/amcdb.tfunc:Llist.Next + // void tfunc_Llist_Prev(); // gstatic/amcdb.tfunc:Llist.Prev + // void tfunc_Llist_Remove(); // gstatic/amcdb.tfunc:Llist.Remove + // void tfunc_Llist_RemoveAll(); // gstatic/amcdb.tfunc:Llist.RemoveAll + // void tfunc_Llist_RemoveFirst(); // gstatic/amcdb.tfunc:Llist.RemoveFirst + // void tfunc_Llist_RotateFirst(); // gstatic/amcdb.tfunc:Llist.RotateFirst + // void tfunc_Llist_Insert(); // gstatic/amcdb.tfunc:Llist.Insert + // void tfunc_Llist_qLast(); // gstatic/amcdb.tfunc:Llist.qLast + // void tclass_ZSListMT(); // gstatic/amcdb.tclass:ZSListMT + // void tfunc_ZSListMT_DestructiveFirst(); // gstatic/amcdb.tfunc:ZSListMT.DestructiveFirst + // void tfunc_ZSListMT_RemoveFirst(); // gstatic/amcdb.tfunc:ZSListMT.RemoveFirst + // void tfunc_ZSListMT_InLlistQ(); // gstatic/amcdb.tfunc:ZSListMT.InLlistQ + // void tfunc_ZSListMT_Insert(); // gstatic/amcdb.tfunc:ZSListMT.Insert + // void tfunc_ZSListMT_Remove(); // gstatic/amcdb.tfunc:ZSListMT.Remove + // void tfunc_ZSListMT_Init(); // gstatic/amcdb.tfunc:ZSListMT.Init // Generate cursor for llist void Llist_curs(bool needdel); // (user-implemented function, prototype is in amc-generated header) - // void tfunc_Llist_curs(); - // void tfunc_Llist_delcurs(); + // void tfunc_Llist_curs(); // gstatic/amcdb.tfunc:Llist.curs + // void tfunc_Llist_delcurs(); // gstatic/amcdb.tfunc:Llist.delcurs // ------------------------------------------------------------------- // cpp/amc/lpool.cpp -- Variable-length free pool // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Lpool(); - // void tfunc_Lpool_FreeMem(); - // void tfunc_Lpool_AllocMem(); - // void tfunc_Lpool_ReserveBuffers(); - // void tfunc_Lpool_ReallocMem(); - // void tfunc_Lpool_Init(); - // void tfunc_Lpool_N(); + // void tclass_Lpool(); // gstatic/amcdb.tclass:Lpool + // void tfunc_Lpool_FreeMem(); // gstatic/amcdb.tfunc:Lpool.FreeMem + // void tfunc_Lpool_AllocMem(); // gstatic/amcdb.tfunc:Lpool.AllocMem + // void tfunc_Lpool_ReserveBuffers(); // gstatic/amcdb.tfunc:Lpool.ReserveBuffers + // void tfunc_Lpool_ReallocMem(); // gstatic/amcdb.tfunc:Lpool.ReallocMem + // void tfunc_Lpool_Init(); // gstatic/amcdb.tfunc:Lpool.Init + // void tfunc_Lpool_N(); // gstatic/amcdb.tfunc:Lpool.N // ------------------------------------------------------------------- // cpp/amc/main.cpp -- Main driver @@ -1086,6 +1183,9 @@ namespace amc { // update-hdr bool HasFinputsQ(amc::FNs &ns); tempstr PkeyCppident(algo::Tuple &tuple); amc::FField *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 DirectStepQ(amc::FFstep &fstep); bool ExternStepQ(amc::FFstep &fstep); @@ -1108,9 +1208,6 @@ namespace amc { // update-hdr // By default, this is just the field's cpp_type // But if the field has an fcast attached to it, it's the fcast expression tempstr Initcast(amc::FField &field); - - // True if ctype is instantiated through a memory pool that has an Alloc function. - bool PoolHasAllocQ(amc::FCtype &ctype); void GenPrintStmt(cstring &out, amc::FCtype &parenttype, amc::FField &field, strptr strname, strptr parentname); bool FldfuncQ(amc::FField &field); bool CanCopyQ(amc::FCtype &ctype); @@ -1182,7 +1279,7 @@ namespace amc { // update-hdr // parent.field // field_Get(parent) // field_Get(parent.subfield) - tempstr FieldvalExpr(amc::FCtype *ctype, amc::FField &field, strptr parname); + tempstr FieldvalExpr(amc::FCtype *ctype, amc::FField &field, strptr parname, strptr fldname = strptr()); // Return C++ expression computing total length of ctype CTYPE // accessible via name NAME. @@ -1191,7 +1288,7 @@ namespace amc { // update-hdr // Return C++ expression assigning value VALUE to field FIELD // given parent reference PARNAME. // If NEEDS_CAST is set, a cast is added to the target type - tempstr AssignExpr(amc::FField &field, strptr parname, strptr value, bool needs_cast); + tempstr AssignExpr(amc::FField &field, strptr parname, strptr value, bool needs_cast, strptr fldname = strptr()); // Heuristically determine if the type is a string type. // When in doubt, the function answers no. @@ -1263,8 +1360,8 @@ namespace amc { // update-hdr void Field_AddChild(amc::FField &parent, const dmmeta::Field &field); bool NeedSetQ(amc::FField &field); // (user-implemented function, prototype is in amc-generated header) - // void tclass_Cppstack(); - // void tclass_Pkey(); + // void tclass_Cppstack(); // gstatic/amcdb.tclass:Cppstack + // void tclass_Pkey(); // gstatic/amcdb.tclass:Pkey int c_anonfld_N(amc::FCtype &ctype); // Go over `amcdb.gen` table and invoke each global generator @@ -1273,16 +1370,17 @@ namespace amc { // update-hdr void Main_Gen(); // OUTPUT Generate files for the namespace(s) - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:amc // ------------------------------------------------------------------- // cpp/amc/malloc.cpp -- Malloc allocator // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Malloc(); - // void tfunc_Malloc_AllocMem(); - // void tfunc_Malloc_ReallocMem(); - // void tfunc_Malloc_FreeMem(); + // void tclass_Malloc(); // gstatic/amcdb.tclass:Malloc + // void tfunc_Malloc_AllocMem(); // gstatic/amcdb.tfunc:Malloc.AllocMem + // void tfunc_Malloc_ReallocMem(); // gstatic/amcdb.tfunc:Malloc.ReallocMem + // void tfunc_Malloc_FreeMem(); // gstatic/amcdb.tfunc:Malloc.FreeMem // ------------------------------------------------------------------- // cpp/amc/msgcurs.cpp -- Message scanning cursor @@ -1290,36 +1388,36 @@ namespace amc { // update-hdr // Generate a message-scanning cursor for each message header with length // (user-implemented function, prototype is in amc-generated header) - // void gen_msgcurs(); + // void gen_msgcurs(); // gstatic/amcdb.gen:msgcurs // ------------------------------------------------------------------- // cpp/amc/nstype.cpp -- Namespace types // // (user-implemented function, prototype is in amc-generated header) - // void gen_ssimdb(); - // void gen_ns_check_nstype(); + // void gen_ssimdb(); // gstatic/amcdb.gen:ssimdb + // void gen_ns_check_nstype(); // gstatic/amcdb.gen:ns_check_nstype // ------------------------------------------------------------------- // cpp/amc/numstr.cpp -- Small strings // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Numstr(); - // void tfunc_Numstr_Getnum(); - // void tfunc_Numstr_GetnumDflt(); - // void tfunc_Numstr_Geti64(); - // void tfunc_Numstr_SetnumMaybe(); - // void tfunc_Numstr_ForAllStrings(); - // void gen_parsenum(); + // void tclass_Numstr(); // gstatic/amcdb.tclass:Numstr + // void tfunc_Numstr_Getnum(); // gstatic/amcdb.tfunc:Numstr.Getnum + // void tfunc_Numstr_GetnumDflt(); // gstatic/amcdb.tfunc:Numstr.GetnumDflt + // void tfunc_Numstr_Geti64(); // gstatic/amcdb.tfunc:Numstr.Geti64 + // void tfunc_Numstr_SetnumMaybe(); // gstatic/amcdb.tfunc:Numstr.SetnumMaybe + // void tfunc_Numstr_ForAllStrings(); // gstatic/amcdb.tfunc:Numstr.ForAllStrings + // void gen_parsenum(); // gstatic/amcdb.gen:parsenum // ------------------------------------------------------------------- // cpp/amc/opt.cpp -- Opt reftype // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Opt(); - // void tfunc_Opt_Get(); - // void tfunc_Opt_Getary(); - // void tfunc_Opt_Print(); - // void tfunc_Opt_ReadStrptrMaybe(); + // void tclass_Opt(); // gstatic/amcdb.tclass:Opt + // void tfunc_Opt_Get(); // gstatic/amcdb.tfunc:Opt.Get + // void tfunc_Opt_Getary(); // gstatic/amcdb.tfunc:Opt.Getary + // void tfunc_Opt_Print(); // gstatic/amcdb.tfunc:Opt.Print + // void tfunc_Opt_ReadStrptrMaybe(); // gstatic/amcdb.tfunc:Opt.ReadStrptrMaybe // ------------------------------------------------------------------- // cpp/amc/outfile.cpp -- Ouptut functions @@ -1328,7 +1426,7 @@ namespace amc { // update-hdr // Write output file to disk // and deallocate memory associated with it // (user-implemented function, prototype is in amc-generated header) - // void gen_ns_write(); + // void gen_ns_write(); // gstatic/amcdb.gen:ns_write // Create outfile record for specified filename // T here is one outfile per generated output file @@ -1338,11 +1436,11 @@ namespace amc { // update-hdr // cpp/amc/pmask.cpp -- Presence masks // // (user-implemented function, prototype is in amc-generated header) - // void gen_pmask(); - // void tclass_Pmask(); + // void gen_pmask(); // gstatic/amcdb.gen:pmask + // void tclass_Pmask(); // gstatic/amcdb.tclass:Pmask // Create multiple functions, one for each pmask of which this field is a member - // void tfunc_Pmask_PresentQ(); + // void tfunc_Pmask_PresentQ(); // gstatic/amcdb.tfunc:Pmask.PresentQ // Return C++ expression(s) setting the present bit for the field // in all presence masks of which the field is a member @@ -1351,10 +1449,10 @@ namespace amc { // update-hdr // Create multiple functions, one for each pmask of which this field is a member // (user-implemented function, prototype is in amc-generated header) - // void tfunc_Pmask_SetPresent(); + // void tfunc_Pmask_SetPresent(); // gstatic/amcdb.tfunc:Pmask.SetPresent // Create multiple functions, one for each pmask of which this field is a member - // void tfunc_Pmask_GetBit(); + // void tfunc_Pmask_GetBit(); // gstatic/amcdb.tfunc:Pmask.GetBit // Return FPmaskfld which filters printing for ctype CTYPE // NULL if none @@ -1375,28 +1473,28 @@ namespace amc { // update-hdr // cpp/amc/pool.cpp -- Generic pool functions // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Pool(); - // void tfunc_Pool_AllocMaybe(); - // void tfunc_Pool_Alloc(); + // void tclass_Pool(); // gstatic/amcdb.tclass:Pool + // void tfunc_Pool_AllocMaybe(); // gstatic/amcdb.tfunc:Pool.AllocMaybe + // void tfunc_Pool_Alloc(); // gstatic/amcdb.tfunc:Pool.Alloc // Generate Alloc function that takes 2 additional arguments // -- pointer to extra (varlen portion) memory to tack onto the record, // and number of bytes - // void tfunc_Pool_AllocExtraMaybe(); + // void tfunc_Pool_AllocExtraMaybe(); // gstatic/amcdb.tfunc:Pool.AllocExtraMaybe // Like AllocExtraMaybe, but die on out-of-memory - // void tfunc_Pool_AllocExtra(); + // void tfunc_Pool_AllocExtra(); // gstatic/amcdb.tfunc:Pool.AllocExtra // VarlenMaybe -- array of fixed-size structs tacked onto the end of a struct - // void tfunc_Pool_AllocVarlenMaybe(); + // void tfunc_Pool_AllocVarlenMaybe(); // gstatic/amcdb.tfunc:Pool.AllocVarlenMaybe // Like VarlenMaybe, but die on out-of-memory - // void tfunc_Pool_AllocVarlen(); - // void tfunc_Pool_InsertMaybe(); + // void tfunc_Pool_AllocVarlen(); // gstatic/amcdb.tfunc:Pool.AllocVarlen + // void tfunc_Pool_InsertMaybe(); // gstatic/amcdb.tfunc:Pool.InsertMaybe amc::FField *FindFieldByName(amc::FCtype &ctype, algo::strptr name); // (user-implemented function, prototype is in amc-generated header) - // void tfunc_Pool_UpdateMaybe(); - // void tfunc_Pool_Delete(); + // void tfunc_Pool_UpdateMaybe(); // gstatic/amcdb.tfunc:Pool.UpdateMaybe + // void tfunc_Pool_Delete(); // gstatic/amcdb.tfunc:Pool.Delete // Ensure that all instances of CTYPE's record are varlen pools void EnsureVarlenPool(amc::FCtype &ctype); @@ -1418,44 +1516,48 @@ namespace amc { // update-hdr // cpp/amc/protocol.cpp -- Protocol functions // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Ns(); - // void tfunc_Ns_StaticCheck(); + // void tclass_Ns(); // gstatic/amcdb.tclass:Ns + // void tfunc_Ns_StaticCheck(); // gstatic/amcdb.tfunc:Ns.StaticCheck // ------------------------------------------------------------------- // cpp/amc/ptr.cpp -- Ptr reftype // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Ptr(); - // void tfunc_Ptr_Init(); - // void tfunc_Ptr_InsertMaybe(); - // void tfunc_Ptr_Remove(); - // void tfunc_Ptr_Cascdel(); + // void tclass_Ptr(); // gstatic/amcdb.tclass:Ptr + // void tfunc_Ptr_Init(); // gstatic/amcdb.tfunc:Ptr.Init + // void tfunc_Ptr_InsertMaybe(); // gstatic/amcdb.tfunc:Ptr.InsertMaybe + // void tfunc_Ptr_Remove(); // gstatic/amcdb.tfunc:Ptr.Remove + // void tfunc_Ptr_Cascdel(); // gstatic/amcdb.tfunc:Ptr.Cascdel // ------------------------------------------------------------------- // cpp/amc/ptrary.cpp -- Ptrary reftype // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Ptrary(); - // void tfunc_Ptrary_Cascdel(); - // void tfunc_Ptrary_EmptyQ(); - // void tfunc_Ptrary_Find(); - // void tfunc_Ptrary_InAryQ(); - // void tfunc_Ptrary_qFind(); - // void tfunc_Ptrary_qLast(); - // void tfunc_Ptrary_Getary(); - // void tfunc_Ptrary_Init(); - // void tfunc_Ptrary_Insert(); - // void tfunc_Ptrary_InsertMaybe(); - // void tfunc_Ptrary_ScanInsertMaybe(); - // void tfunc_Ptrary_N(); - // void tfunc_Ptrary_Remove(); - // void tfunc_Ptrary_RemoveAll(); - // void tfunc_Ptrary_Reserve(); - // void tfunc_Ptrary_Uninit(); + // void tclass_Ptrary(); // gstatic/amcdb.tclass:Ptrary + // void tfunc_Ptrary_Cascdel(); // gstatic/amcdb.tfunc:Ptrary.Cascdel + // void tfunc_Ptrary_EmptyQ(); // gstatic/amcdb.tfunc:Ptrary.EmptyQ + // void tfunc_Ptrary_Find(); // gstatic/amcdb.tfunc:Ptrary.Find + // void tfunc_Ptrary_InAryQ(); // gstatic/amcdb.tfunc:Ptrary.InAryQ + // void tfunc_Ptrary_qFind(); // gstatic/amcdb.tfunc:Ptrary.qFind + // void tfunc_Ptrary_qLast(); // gstatic/amcdb.tfunc:Ptrary.qLast + // void tfunc_Ptrary_Getary(); // gstatic/amcdb.tfunc:Ptrary.Getary + // void tfunc_Ptrary_Init(); // gstatic/amcdb.tfunc:Ptrary.Init + // void tfunc_Ptrary_Insert(); // gstatic/amcdb.tfunc:Ptrary.Insert + // void tfunc_Ptrary_InsertMaybe(); // gstatic/amcdb.tfunc:Ptrary.InsertMaybe + // void tfunc_Ptrary_ScanInsertMaybe(); // gstatic/amcdb.tfunc:Ptrary.ScanInsertMaybe + // void tfunc_Ptrary_N(); // gstatic/amcdb.tfunc:Ptrary.N + // void tfunc_Ptrary_Remove(); // gstatic/amcdb.tfunc:Ptrary.Remove + // void tfunc_Ptrary_RemoveFirst(); // gstatic/amcdb.tfunc:Ptrary.RemoveFirst + // void tfunc_Ptrary_First(); // gstatic/amcdb.tfunc:Ptrary.First + // void tfunc_Ptrary_RemoveLast(); // gstatic/amcdb.tfunc:Ptrary.RemoveLast + // void tfunc_Ptrary_Last(); // gstatic/amcdb.tfunc:Ptrary.Last + // void tfunc_Ptrary_RemoveAll(); // gstatic/amcdb.tfunc:Ptrary.RemoveAll + // void tfunc_Ptrary_Reserve(); // gstatic/amcdb.tfunc:Ptrary.Reserve + // void tfunc_Ptrary_Uninit(); // gstatic/amcdb.tfunc:Ptrary.Uninit void Ptrary_curs(bool once); // (user-implemented function, prototype is in amc-generated header) - // void tfunc_Ptrary_curs(); - // void tfunc_Ptrary_oncecurs(); + // void tfunc_Ptrary_curs(); // gstatic/amcdb.tfunc:Ptrary.curs + // void tfunc_Ptrary_oncecurs(); // gstatic/amcdb.tfunc:Ptrary.oncecurs // ------------------------------------------------------------------- // cpp/amc/query.cpp -- Query mode @@ -1471,30 +1573,30 @@ namespace amc { // update-hdr // Dispatach on field name, and read appropriate field // (user-implemented function, prototype is in amc-generated header) - // void tfunc_Ctype_ReadFieldMaybe(); + // void tfunc_Ctype_ReadFieldMaybe(); // gstatic/amcdb.tfunc:Ctype.ReadFieldMaybe void GenRead(amc::FCtype &ctype, amc::FCfmt &cfmt); // ------------------------------------------------------------------- // cpp/amc/regx.cpp -- Small strings // // (user-implemented function, prototype is in amc-generated header) - // void tclass_RegxSql(); - // void tfunc_RegxSql_ReadStrptrMaybe(); - // void tfunc_RegxSql_Print(); - // void tfunc_RegxSql_Init(); - // void tclass_Regx(); - // void tfunc_Regx_ReadStrptrMaybe(); - // void tfunc_Regx_Print(); - // void tfunc_Regx_Init(); + // void tclass_RegxSql(); // gstatic/amcdb.tclass:RegxSql + // void tfunc_RegxSql_ReadStrptrMaybe(); // gstatic/amcdb.tfunc:RegxSql.ReadStrptrMaybe + // void tfunc_RegxSql_Print(); // gstatic/amcdb.tfunc:RegxSql.Print + // void tfunc_RegxSql_Init(); // gstatic/amcdb.tfunc:RegxSql.Init + // void tclass_Regx(); // gstatic/amcdb.tclass:Regx + // void tfunc_Regx_ReadStrptrMaybe(); // gstatic/amcdb.tfunc:Regx.ReadStrptrMaybe + // void tfunc_Regx_Print(); // gstatic/amcdb.tfunc:Regx.Print + // void tfunc_Regx_Init(); // gstatic/amcdb.tfunc:Regx.Init // ------------------------------------------------------------------- // cpp/amc/sbrk.cpp -- Sbrk allocator // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Sbrk(); - // void tfunc_Sbrk_AllocMem(); - // void tfunc_Sbrk_FreeMem(); - // void tfunc_Sbrk_Init(); + // void tclass_Sbrk(); // gstatic/amcdb.tclass:Sbrk + // void tfunc_Sbrk_AllocMem(); // gstatic/amcdb.tfunc:Sbrk.AllocMem + // void tfunc_Sbrk_FreeMem(); // gstatic/amcdb.tfunc:Sbrk.FreeMem + // void tfunc_Sbrk_Init(); // gstatic/amcdb.tfunc:Sbrk.Init // ------------------------------------------------------------------- // cpp/amc/signature.cpp -- Signature calculation for protocols @@ -1506,7 +1608,7 @@ namespace amc { // update-hdr // which impacts binary footprint of the top type void SignatureVisit(amc::FCtype &ctype); // (user-implemented function, prototype is in amc-generated header) - // void gen_prep_signature(); + // void gen_prep_signature(); // gstatic/amcdb.gen:prep_signature // compute order-independent superposition of two signatures // that means H(A,B) == H(B,A) @@ -1526,7 +1628,7 @@ namespace amc { // update-hdr // asserting that amc-computed sizes are the same as gcc-computed sizes. // The sizes are computed by scanning the actual generated struct for each ctype. // (user-implemented function, prototype is in amc-generated header) - // void gen_compute_size(); + // void gen_compute_size(); // gstatic/amcdb.gen:compute_size // Generate symbol corresponding to the size of ctype CTYPE. // SizeEnums are generated only for occasional ctypes, and are used @@ -1536,69 +1638,68 @@ namespace amc { // update-hdr // Generate compile-time constants for sizes of certain ctypes // accessed from namespace NS, without having to include corresponding header. // (user-implemented function, prototype is in amc-generated header) - // void gen_ns_size_enums(); + // void gen_ns_size_enums(); // gstatic/amcdb.gen:ns_size_enums // ------------------------------------------------------------------- // cpp/amc/smallstr.cpp -- Small strings // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Smallstr(); - // void tfunc_Smallstr_Init(); - // void tfunc_Smallstr_Getary(); - // void tfunc_Smallstr_Add(); - // void tfunc_Smallstr_AddStrptr(); - // void tfunc_Smallstr_ReadStrptrMaybe(); - // void tfunc_Smallstr_Print(); - // void tfunc_Smallstr_HashStrptr(); + // void tclass_Smallstr(); // gstatic/amcdb.tclass:Smallstr + // void tfunc_Smallstr_Init(); // gstatic/amcdb.tfunc:Smallstr.Init + // void tfunc_Smallstr_Getary(); // gstatic/amcdb.tfunc:Smallstr.Getary + // void tfunc_Smallstr_Add(); // gstatic/amcdb.tfunc:Smallstr.Add + // void tfunc_Smallstr_AddStrptr(); // gstatic/amcdb.tfunc:Smallstr.AddStrptr + // void tfunc_Smallstr_ReadStrptrMaybe(); // gstatic/amcdb.tfunc:Smallstr.ReadStrptrMaybe + // void tfunc_Smallstr_Print(); // gstatic/amcdb.tfunc:Smallstr.Print // compute length - // void tfunc_Smallstr_N(); + // void tfunc_Smallstr_N(); // gstatic/amcdb.tfunc:Smallstr.N // Max # of elements (constant) - // void tfunc_Smallstr_Max(); + // void tfunc_Smallstr_Max(); // gstatic/amcdb.tfunc:Smallstr.Max // Set value as strptr // For a padded string, the string value is allowed to use the pad character // inside the string, i.e. a space-padded field can have a space ("abc def"). // Length of a padded string is determined by stripping the padded characters // from the appropriate end. - // void tfunc_Smallstr_SetStrptr(); + // void tfunc_Smallstr_SetStrptr(); // gstatic/amcdb.tfunc:Smallstr.SetStrptr // Assignment operator from strptr // Generated only if the containing struct has only one field - // void tfunc_Smallstr_AssignStrptr(); + // void tfunc_Smallstr_AssignStrptr(); // gstatic/amcdb.tfunc:Smallstr.AssignStrptr // Construct from strptr // Generated only if the containing struct has only one field - // void tfunc_Smallstr_CtorStrptr(); + // void tfunc_Smallstr_CtorStrptr(); // gstatic/amcdb.tfunc:Smallstr.CtorStrptr // ------------------------------------------------------------------- // cpp/amc/sort.cpp -- Comparison & Sorting routines // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Sort(); - // void tfunc_Sort_Swap(); - // void tfunc_Sort_Rotleft(); - // void tfunc_Sort_Lt(); - // void tfunc_Sort_SortedQ(); - // void tfunc_Sort_IntInsertionSort(); - // void tfunc_Sort_IntHeapSort(); - // void tfunc_Sort_IntQuickSort(); - // void tfunc_Sort_InsertionSort(); - // void tfunc_Sort_HeapSort(); - // void tfunc_Sort_QuickSort(); + // void tclass_Sort(); // gstatic/amcdb.tclass:Sort + // void tfunc_Sort_Swap(); // gstatic/amcdb.tfunc:Sort.Swap + // void tfunc_Sort_Rotleft(); // gstatic/amcdb.tfunc:Sort.Rotleft + // void tfunc_Sort_Lt(); // gstatic/amcdb.tfunc:Sort.Lt + // void tfunc_Sort_SortedQ(); // gstatic/amcdb.tfunc:Sort.SortedQ + // void tfunc_Sort_IntInsertionSort(); // gstatic/amcdb.tfunc:Sort.IntInsertionSort + // void tfunc_Sort_IntHeapSort(); // gstatic/amcdb.tfunc:Sort.IntHeapSort + // void tfunc_Sort_IntQuickSort(); // gstatic/amcdb.tfunc:Sort.IntQuickSort + // void tfunc_Sort_InsertionSort(); // gstatic/amcdb.tfunc:Sort.InsertionSort + // void tfunc_Sort_HeapSort(); // gstatic/amcdb.tfunc:Sort.HeapSort + // void tfunc_Sort_QuickSort(); // gstatic/amcdb.tfunc:Sort.QuickSort // ------------------------------------------------------------------- // cpp/amc/step.cpp -- Step functions // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Step(); - // void tfunc_Step_UpdateCycles(); - // void tfunc_Step_Step(); - // void tfunc_Step_Init(); - // void tfunc_Step_Call(); - // void tfunc_Step_FirstChanged(); - // void tfunc_Step_SetDelay(); + // void tclass_Step(); // gstatic/amcdb.tclass:Step + // void tfunc_Step_UpdateCycles(); // gstatic/amcdb.tfunc:Step.UpdateCycles + // void tfunc_Step_Step(); // gstatic/amcdb.tfunc:Step.Step + // void tfunc_Step_Init(); // gstatic/amcdb.tfunc:Step.Init + // void tfunc_Step_Call(); // gstatic/amcdb.tfunc:Step.Call + // void tfunc_Step_FirstChanged(); // gstatic/amcdb.tfunc:Step.FirstChanged + // void tfunc_Step_SetDelay(); // gstatic/amcdb.tfunc:Step.SetDelay // ------------------------------------------------------------------- // cpp/amc/struct.cpp -- C++ struct output @@ -1612,9 +1713,9 @@ namespace amc { // update-hdr // cpp/amc/substr.cpp -- Substr fields // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Substr(); - // void tfunc_Substr_Get(); - // void tfunc_Substr_Get2(); + // void tclass_Substr(); // gstatic/amcdb.tclass:Substr + // void tfunc_Substr_Get(); // gstatic/amcdb.tfunc:Substr.Get + // void tfunc_Substr_Get2(); // gstatic/amcdb.tfunc:Substr.Get2 // ------------------------------------------------------------------- // cpp/amc/tableid.cpp -- Per-namespace enum of tables @@ -1625,43 +1726,44 @@ namespace amc { // update-hdr // create TableId type. // generate an enum representing tables in the in-memory database // (user-implemented function, prototype is in amc-generated header) - // void gen_tableenum(); + // void gen_tableenum(); // gstatic/amcdb.gen:tableenum void GenFieldId(amc::FNs &ns); // (user-implemented function, prototype is in amc-generated header) - // void gen_fieldid(); + // void gen_fieldid(); // gstatic/amcdb.gen:fieldid // ------------------------------------------------------------------- // cpp/amc/tary.cpp -- Tary (vector) reftype // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Tary(); - // void tfunc_Tary_Addary(); - // void tfunc_Tary_Alloc(); - // void tfunc_Tary_AllocAt(); - // void tfunc_Tary_AllocN(); - // void tfunc_Tary_AllocNVal(); - // void tfunc_Tary_EmptyQ(); - // void tfunc_Tary_Find(); - // void tfunc_Tary_Getary(); - // void tfunc_Tary_Init(); - // void tfunc_Tary_Last(); - // void tfunc_Tary_Max(); - // void tfunc_Tary_N(); - // void tfunc_Tary_Remove(); - // void tfunc_Tary_RemoveAll(); - // void tfunc_Tary_RemoveLast(); - // void tfunc_Tary_AbsReserve(); - // void tfunc_Tary_Reserve(); - // void tfunc_Tary_RowidFind(); - // void tfunc_Tary_Setary(); - // void tfunc_Tary_Setary2(); - // void tfunc_Tary_Uninit(); - // void tfunc_Tary_qFind(); - // void tfunc_Tary_qLast(); - // void tfunc_Tary_rowid_Get(); - // void tfunc_Tary_Eq(); - // void tfunc_Tary_Cmp(); - // void tfunc_Tary_curs(); + // void tclass_Tary(); // gstatic/amcdb.tclass:Tary + // void tfunc_Tary_Addary(); // gstatic/amcdb.tfunc:Tary.Addary + // void tfunc_Tary_Alloc(); // gstatic/amcdb.tfunc:Tary.Alloc + // void tfunc_Tary_AllocAt(); // gstatic/amcdb.tfunc:Tary.AllocAt + // void tfunc_Tary_AllocN(); // gstatic/amcdb.tfunc:Tary.AllocN + // void tfunc_Tary_AllocNAt(); // gstatic/amcdb.tfunc:Tary.AllocNAt + // void tfunc_Tary_AllocNVal(); // gstatic/amcdb.tfunc:Tary.AllocNVal + // void tfunc_Tary_EmptyQ(); // gstatic/amcdb.tfunc:Tary.EmptyQ + // void tfunc_Tary_Find(); // gstatic/amcdb.tfunc:Tary.Find + // void tfunc_Tary_Getary(); // gstatic/amcdb.tfunc:Tary.Getary + // void tfunc_Tary_Init(); // gstatic/amcdb.tfunc:Tary.Init + // void tfunc_Tary_Last(); // gstatic/amcdb.tfunc:Tary.Last + // void tfunc_Tary_Max(); // gstatic/amcdb.tfunc:Tary.Max + // void tfunc_Tary_N(); // gstatic/amcdb.tfunc:Tary.N + // void tfunc_Tary_Remove(); // gstatic/amcdb.tfunc:Tary.Remove + // void tfunc_Tary_RemoveAll(); // gstatic/amcdb.tfunc:Tary.RemoveAll + // void tfunc_Tary_RemoveLast(); // gstatic/amcdb.tfunc:Tary.RemoveLast + // void tfunc_Tary_AbsReserve(); // gstatic/amcdb.tfunc:Tary.AbsReserve + // void tfunc_Tary_Reserve(); // gstatic/amcdb.tfunc:Tary.Reserve + // void tfunc_Tary_RowidFind(); // gstatic/amcdb.tfunc:Tary.RowidFind + // void tfunc_Tary_Setary(); // gstatic/amcdb.tfunc:Tary.Setary + // void tfunc_Tary_Setary2(); // gstatic/amcdb.tfunc:Tary.Setary2 + // void tfunc_Tary_Uninit(); // gstatic/amcdb.tfunc:Tary.Uninit + // void tfunc_Tary_qFind(); // gstatic/amcdb.tfunc:Tary.qFind + // void tfunc_Tary_qLast(); // gstatic/amcdb.tfunc:Tary.qLast + // void tfunc_Tary_rowid_Get(); // gstatic/amcdb.tfunc:Tary.rowid_Get + // void tfunc_Tary_Eq(); // gstatic/amcdb.tfunc:Tary.Eq + // void tfunc_Tary_Cmp(); // gstatic/amcdb.tfunc:Tary.Cmp + // void tfunc_Tary_curs(); // gstatic/amcdb.tfunc:Tary.curs // Read/Accumulate Tary from string. // arg:char & U8 @@ -1676,16 +1778,17 @@ namespace amc { // update-hdr // one element is read from input string and appended to the array without flushing. // if the element cannot be read, the array is unchanged // - // void tfunc_Tary_ReadStrptrMaybe(); - // void tfunc_Tary_Print(); + // void tfunc_Tary_ReadStrptrMaybe(); // gstatic/amcdb.tfunc:Tary.ReadStrptrMaybe + // void tfunc_Tary_Print(); // gstatic/amcdb.tfunc:Tary.Print // Assignment operator from aryptr // Generated only if the containing struct has only one field - // void tfunc_Tary_AssignAryptr(); + // void tfunc_Tary_AssignAryptr(); // gstatic/amcdb.tfunc:Tary.AssignAryptr // Construct from aryptr // Generated only if the containing struct has only one field - // void tfunc_Tary_CtorAryptr(); + // void tfunc_Tary_CtorAryptr(); // gstatic/amcdb.tfunc:Tary.CtorAryptr + // void tfunc_Tary_Insary(); // gstatic/amcdb.tfunc:Tary.Insary // ------------------------------------------------------------------- // cpp/amc/tclass.cpp -- Driver for tfuncs @@ -1715,77 +1818,85 @@ namespace amc { // update-hdr // (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 // (user-implemented function, prototype is in amc-generated header) - // void gen_ns_tclass_field(); + // void gen_ns_tclass_field(); // gstatic/amcdb.gen:ns_tclass_field // Call tfunc generators without field context (Ctype generators) // This must be called after field-specific generators, since by this time // ctype sizes have been computed. - // void gen_ns_tclass_ctype(); - // void gen_ns_tclass_ns(); + // void gen_ns_tclass_ctype(); // gstatic/amcdb.gen:ns_tclass_ctype + // void gen_ns_tclass_ns(); // gstatic/amcdb.gen:ns_tclass_ns // ------------------------------------------------------------------- // cpp/amc/thash.cpp -- Hash tables // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Thash(); - // void tfunc_Thash_Find(); - // void tfunc_Thash_FindX(); - // void tfunc_Thash_Reserve(); - // void tfunc_Thash_GetOrCreate(); - // void tfunc_Thash_N(); - // void tfunc_Thash_EmptyQ(); - // void tfunc_Thash_InsertMaybe(); - // void tfunc_Thash_Cascdel(); - // void tfunc_Thash_Remove(); - // void tfunc_Thash_FindRemove(); - // void tfunc_Thash_Init(); - // void tfunc_Thash_Uninit(); - // void tfunc_Thash_curs(); + // void tclass_Thash(); // gstatic/amcdb.tclass:Thash + // void tfunc_Thash_Find(); // gstatic/amcdb.tfunc:Thash.Find + // void tfunc_Thash_FindX(); // gstatic/amcdb.tfunc:Thash.FindX + // void tfunc_Thash_Reserve(); // gstatic/amcdb.tfunc:Thash.Reserve + // void tfunc_Thash_AbsReserve(); // gstatic/amcdb.tfunc:Thash.AbsReserve + // void tfunc_Thash_GetOrCreate(); // gstatic/amcdb.tfunc:Thash.GetOrCreate + // void tfunc_Thash_N(); // gstatic/amcdb.tfunc:Thash.N + // void tfunc_Thash_EmptyQ(); // gstatic/amcdb.tfunc:Thash.EmptyQ + // void tfunc_Thash_InsertMaybe(); // gstatic/amcdb.tfunc:Thash.InsertMaybe + // void tfunc_Thash_Cascdel(); // gstatic/amcdb.tfunc:Thash.Cascdel + // void tfunc_Thash_Remove(); // gstatic/amcdb.tfunc:Thash.Remove + // void tfunc_Thash_FindRemove(); // gstatic/amcdb.tfunc:Thash.FindRemove + // void tfunc_Thash_Init(); // gstatic/amcdb.tfunc:Thash.Init + // void tfunc_Thash_Uninit(); // gstatic/amcdb.tfunc:Thash.Uninit + // void tfunc_Thash_curs(); // gstatic/amcdb.tfunc:Thash.curs // ------------------------------------------------------------------- // cpp/amc/tpool.cpp -- Tpool refetype (fixed-length freelist) // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Tpool(); - // void tfunc_Tpool_ReserveMem(); - // void tfunc_Tpool_Reserve(); - // void tfunc_Tpool_AllocMem(); - // void tfunc_Tpool_FreeMem(); - // void tfunc_Tpool_Init(); + // void tclass_Tpool(); // gstatic/amcdb.tclass:Tpool + // void tfunc_Tpool_ReserveMem(); // gstatic/amcdb.tfunc:Tpool.ReserveMem + // void tfunc_Tpool_Reserve(); // gstatic/amcdb.tfunc:Tpool.Reserve + // void tfunc_Tpool_AllocMem(); // gstatic/amcdb.tfunc:Tpool.AllocMem + // void tfunc_Tpool_FreeMem(); // gstatic/amcdb.tfunc:Tpool.FreeMem + // void tfunc_Tpool_Init(); // gstatic/amcdb.tfunc:Tpool.Init // ------------------------------------------------------------------- // cpp/amc/trace.cpp -- Generate trace code // // (user-implemented function, prototype is in amc-generated header) - // void gen_trace(); + // void gen_trace(); // gstatic/amcdb.gen:trace // ------------------------------------------------------------------- // cpp/amc/upptr.cpp -- Upptr reftype // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Upptr(); - // void tfunc_Upptr_Init(); + // void tclass_Upptr(); // gstatic/amcdb.tclass:Upptr + // void tfunc_Upptr_Init(); // gstatic/amcdb.tfunc:Upptr.Init // ------------------------------------------------------------------- // cpp/amc/val.cpp -- Val reftype // // (user-implemented function, prototype is in amc-generated header) - // void tclass_Val(); - // void tfunc_Val_Get(); - // void tfunc_Val_Set(); - // void tfunc_Val_Init(); - // void tfunc_Val_RowidFind(); - // void tfunc_Val_N(); + // void tclass_Val(); // gstatic/amcdb.tclass:Val + // void tfunc_Val_Get(); // gstatic/amcdb.tfunc:Val.Get + // void tfunc_Val_Set(); // gstatic/amcdb.tfunc:Val.Set + // void tfunc_Val_Init(); // gstatic/amcdb.tfunc:Val.Init + // void tfunc_Val_RowidFind(); // gstatic/amcdb.tfunc:Val.RowidFind + // void tfunc_Val_N(); // gstatic/amcdb.tfunc:Val.N // ------------------------------------------------------------------- // cpp/amc/varlen.cpp -- Varlen reftype // - // (user-implemented function, prototype is in amc-generated header) - // void tclass_Varlen(); - // void tfunc_Varlen_Addr(); - // void tfunc_Varlen_Getary(); - // void tfunc_Varlen_N(); - // void tfunc_Varlen_ReadStrptrMaybe(); - // void tfunc_Varlen_curs(); - // void tfunc_Varlen_Print(); + amc::FField *LengthField(amc::FCtype &ctype); + tempstr LengthType(amc::FCtype &ctype); + tempstr VarlenEndName(amc::FField &field); + tempstr VarlenEndExpr(strptr parname, amc::FField &field); + tempstr VarlenEndAssign(strptr parname, amc::FField &field, strptr value); + tempstr VarlenEndIncr(strptr parname, amc::FField &field, strptr incr); + // (user-implemented function, prototype is in amc-generated header) + // void tclass_Varlen(); // gstatic/amcdb.tclass:Varlen + // void tfunc_Varlen_Addr(); // gstatic/amcdb.tfunc:Varlen.Addr + // void tfunc_Varlen_Getary(); // gstatic/amcdb.tfunc:Varlen.Getary + // void tfunc_Varlen_N(); // gstatic/amcdb.tfunc:Varlen.N + // void tfunc_Varlen_ReadStrptrMaybe(); // gstatic/amcdb.tfunc:Varlen.ReadStrptrMaybe + // void tfunc_Varlen_curs(); // gstatic/amcdb.tfunc:Varlen.curs + // void tfunc_Varlen_Print(); // gstatic/amcdb.tfunc:Varlen.Print + // void tfunc_Varlen_Init(); // gstatic/amcdb.tfunc:Varlen.Init } diff --git a/include/ams_sendtest.h b/include/ams_sendtest.h index e7b6aeb7..b30fe8b1 100644 --- a/include/ams_sendtest.h +++ b/include/ams_sendtest.h @@ -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 @@ -33,5 +33,7 @@ namespace ams_sendtest { // update-hdr // ------------------------------------------------------------------- // cpp/ams_sendtest.cpp // - void Main(); + lib_ams::FShm &GetOrCreateShm(ams::ShmId shm_id); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:ams_sendtest } diff --git a/include/apm.h b/include/apm.h index 90c0c1b3..0e6a2ec3 100644 --- a/include/apm.h +++ b/include/apm.h @@ -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 @@ -95,7 +95,8 @@ namespace apm { // update-hdr // Definte fake packages based on 'ns' regx void DefPackages(); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:apm // ------------------------------------------------------------------- // cpp/apm/push.cpp @@ -115,6 +116,10 @@ namespace apm { // update-hdr // cpp/apm/rec.cpp // + // return TRUE if the field is a valid edge for transitive closure. + // The field is chosen if it's the pkey, or a leftmost subtring of pkey + bool LeftCheckQ(apm::FField &field); + // Load all records (FRec) from dataset _db.cmdline.data_in) // For each record (FRec), compute p_ssimfile, pkey, tuple // Populate global zd_rec index diff --git a/include/aqlite.h b/include/aqlite.h index be87a9a4..13d426f2 100644 --- a/include/aqlite.h +++ b/include/aqlite.h @@ -1,3 +1,4 @@ +// Copyright (C) 2026 AlgoRND // Copyright (C) 2023 Astra // // License: GPL @@ -33,5 +34,6 @@ namespace aqlite { // update-hdr // cpp/aqlite/aqlite.cpp // int exec_cb(void*, int na, char** av, char** cols); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:aqlite } diff --git a/include/atf_amc.h b/include/atf_amc.h index 4e51fb88..3482ecaf 100644 --- a/include/atf_amc.h +++ b/include/atf_amc.h @@ -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 // Header: include/atf_amc.h // @@ -37,9 +37,9 @@ namespace atf_amc { // update-hdr // cpp/atf_amc/atree.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_atree_test1(); - // void amctest_atree_test2(); - // void amctest_atree_RangeSearch(); + // void amctest_atree_test1(); // gstatic/atfdb.amctest:atree_test1 + // void amctest_atree_test2(); // gstatic/atfdb.amctest:atree_test2 + // void amctest_atree_RangeSearch(); // gstatic/atfdb.amctest:atree_RangeSearch // ------------------------------------------------------------------- // cpp/atf_amc/bheap.cpp @@ -53,88 +53,88 @@ namespace atf_amc { // update-hdr // Check they are inserted and read in the same order // // (user-implemented function, prototype is in amc-generated header) - // void amctest_BheapInsert100(); - // void amctest_BheapCursor(); + // void amctest_BheapInsert100(); // gstatic/atfdb.amctest:BheapInsert100 + // void amctest_BheapCursor(); // gstatic/atfdb.amctest:BheapCursor // void bh_typec_FirstChanged(); - // void amctest_BhFirstChanged1(); - // void amctest_BhFirstChanged2(); - // void amctest_BhFirstChanged3(); + // void amctest_BhFirstChanged1(); // gstatic/atfdb.amctest:BhFirstChanged1 + // void amctest_BhFirstChanged2(); // gstatic/atfdb.amctest:BhFirstChanged2 + // void amctest_BhFirstChanged3(); // gstatic/atfdb.amctest:BhFirstChanged3 // ------------------------------------------------------------------- // cpp/atf_amc/bigend.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_BigEndian(); - // void amctest_BigendFconst(); + // void amctest_BigEndian(); // gstatic/atfdb.amctest:BigEndian + // void amctest_BigendFconst(); // gstatic/atfdb.amctest:BigendFconst // ------------------------------------------------------------------- // cpp/atf_amc/bitfld.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_TestBitfld(); - // void amctest_TestBitfld2(); + // void amctest_TestBitfld(); // gstatic/atfdb.amctest:TestBitfld + // void amctest_TestBitfld2(); // gstatic/atfdb.amctest:TestBitfld2 // Big-endian bitfield test. // Set bits 0..4 // Set bits 8..12 // Set bits 0..4 again // At each step, check that total field has the expected value - // void amctest_BitfldNet(); - // void amctest_BitfldTuple(); - // void amctest_BitfldBitset(); + // void amctest_BitfldNet(); // gstatic/atfdb.amctest:BitfldNet + // void amctest_BitfldTuple(); // gstatic/atfdb.amctest:BitfldTuple + // void amctest_BitfldBitset(); // gstatic/atfdb.amctest:BitfldBitset // ------------------------------------------------------------------- // cpp/atf_amc/bitset.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_BitsetTary64(); - // void amctest_BitsetInlary16(); - // void amctest_BitsetVal8(); - // void amctest_BitsetVal64(); - // void amctest_BitsetVal128(); - // void amctest_BitsetBitcurs(); + // void amctest_BitsetTary64(); // gstatic/atfdb.amctest:BitsetTary64 + // void amctest_BitsetInlary16(); // gstatic/atfdb.amctest:BitsetInlary16 + // void amctest_BitsetVal8(); // gstatic/atfdb.amctest:BitsetVal8 + // void amctest_BitsetVal64(); // gstatic/atfdb.amctest:BitsetVal64 + // void amctest_BitsetVal128(); // gstatic/atfdb.amctest:BitsetVal128 + // void amctest_BitsetBitcurs(); // gstatic/atfdb.amctest:BitsetBitcurs // ------------------------------------------------------------------- // cpp/atf_amc/cascdel.cpp // - void key_Cleanup(atf_amc::FCascdel &parent); + // (user-implemented function, prototype is in amc-generated header) + // void key_Cleanup(atf_amc::FCascdel &parent); // fcleanup:atf_amc.FCascdel.key // ptr - // (user-implemented function, prototype is in amc-generated header) - // void amctest_CascdelPtr(); + // void amctest_CascdelPtr(); // gstatic/atfdb.amctest:CascdelPtr // ptrary - // void amctest_CascdelPtrary(); + // void amctest_CascdelPtrary(); // gstatic/atfdb.amctest:CascdelPtrary // ptrary - chain - // void amctest_CascdelPtraryChain(); + // void amctest_CascdelPtraryChain(); // gstatic/atfdb.amctest:CascdelPtraryChain // thash - // void amctest_CascdelThash(); + // void amctest_CascdelThash(); // gstatic/atfdb.amctest:CascdelThash // thash - chain - // void amctest_CascdelThashChain(); + // void amctest_CascdelThashChain(); // gstatic/atfdb.amctest:CascdelThashChain // bheap - // void amctest_CascdelBheap(); + // void amctest_CascdelBheap(); // gstatic/atfdb.amctest:CascdelBheap // bheap - chain - // void amctest_CascdelBheapChain(); + // void amctest_CascdelBheapChain(); // gstatic/atfdb.amctest:CascdelBheapChain // zslist - // void amctest_CascdelZslist(); + // void amctest_CascdelZslist(); // gstatic/atfdb.amctest:CascdelZslist // zslist - chain - // void amctest_CascdelZslistChain(); + // void amctest_CascdelZslistChain(); // gstatic/atfdb.amctest:CascdelZslistChain // atf_amc::atf_amc::zdlist - // void amctest_CascdelZdlist(); + // void amctest_CascdelZdlist(); // gstatic/atfdb.amctest:CascdelZdlist // zdlist - chain - // void amctest_CascdelZdlistChain(); + // void amctest_CascdelZdlistChain(); // gstatic/atfdb.amctest:CascdelZdlistChain // bheap - // void amctest_CascdelAtree(); + // void amctest_CascdelAtree(); // gstatic/atfdb.amctest:CascdelAtree // ------------------------------------------------------------------- // cpp/atf_amc/cdlist.cpp @@ -144,48 +144,48 @@ namespace atf_amc { // update-hdr // create list item, check if it is not in list // // (user-implemented function, prototype is in amc-generated header) - // void amctest_CdlistItemDfltCtor(); + // void amctest_CdlistItemDfltCtor(); // gstatic/atfdb.amctest:CdlistItemDfltCtor // // Create empty list, check if it is really empty // - // void amctest_CdlistDfltCtor(); + // void amctest_CdlistDfltCtor(); // gstatic/atfdb.amctest:CdlistDfltCtor // // Insert 1 element in the list, check if it is really in the list // - // void amctest_CdlistInsert1(); + // void amctest_CdlistInsert1(); // gstatic/atfdb.amctest:CdlistInsert1 // // Insert 2 elements in the list, check if it they are really in the list // - // void amctest_CdlistInsert2(); + // void amctest_CdlistInsert2(); // gstatic/atfdb.amctest:CdlistInsert2 // // Insert 3 elements in the list, check if it they are really in the list // - // void amctest_CdlistInsert3(); + // void amctest_CdlistInsert3(); // gstatic/atfdb.amctest:CdlistInsert3 // // Insert 100 items to the list, remove first item 100 times // Then try on empty list // - // void amctest_CdlistRemoveFirst(); + // void amctest_CdlistRemoveFirst(); // gstatic/atfdb.amctest:CdlistRemoveFirst // // Insert 100 elements, Remove them in "random" order // - // void amctest_CdlistRemove(); + // void amctest_CdlistRemove(); // gstatic/atfdb.amctest:CdlistRemove // // Flush empty list // - // void amctest_CdlistFlushEmpty(); + // void amctest_CdlistFlushEmpty(); // gstatic/atfdb.amctest:CdlistFlushEmpty // // Flush 100 elements // - // void amctest_CdlistFlush100(); + // void amctest_CdlistFlush100(); // gstatic/atfdb.amctest:CdlistFlush100 // // InsertMaybe: @@ -193,40 +193,40 @@ namespace atf_amc { // update-hdr // 2) try insert the same element, check if not inserted // 3) try insert other element, check if inserted // - // void amctest_CdlistInsertMaybe(); + // void amctest_CdlistInsertMaybe(); // gstatic/atfdb.amctest:CdlistInsertMaybe // CDLIST - HEAD INSERT // // Insert 1 element in the list, check if it is really in the list // - // void amctest_CdlistInsertHead1(); + // void amctest_CdlistInsertHead1(); // gstatic/atfdb.amctest:CdlistInsertHead1 // // Insert 2 elements in the list, check if it they are really in the list // - // void amctest_CdlistInsertHead2(); + // void amctest_CdlistInsertHead2(); // gstatic/atfdb.amctest:CdlistInsertHead2 // // Insert 3 elements in the list, check if it they are really in the list // - // void amctest_CdlistInsertHead3(); + // void amctest_CdlistInsertHead3(); // gstatic/atfdb.amctest:CdlistInsertHead3 // CDLIST - ROTATE FIRST - // void amctest_CdlistRotateFirst(); + // void amctest_CdlistRotateFirst(); // gstatic/atfdb.amctest:CdlistRotateFirst // ------------------------------------------------------------------- // cpp/atf_amc/cleanup.cpp // - void field1_Cleanup(atf_amc::AmcCleanup2 &cleanup2); - void field2_Cleanup(atf_amc::AmcCleanup2 &cleanup2); // (user-implemented function, prototype is in amc-generated header) - // void amctest_CleanupOrder(); + // void field1_Cleanup(atf_amc::AmcCleanup2 &cleanup2); // fcleanup:atf_amc.AmcCleanup2.field1 + // void field2_Cleanup(atf_amc::AmcCleanup2 &cleanup2); // fcleanup:atf_amc.AmcCleanup2.field2 + // void amctest_CleanupOrder(); // gstatic/atfdb.amctest:CleanupOrder // ------------------------------------------------------------------- // cpp/atf_amc/cmp.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_Fcmp(); + // void amctest_Fcmp(); // gstatic/atfdb.amctest:Fcmp // ------------------------------------------------------------------- // cpp/atf_amc/cslist.cpp @@ -236,45 +236,45 @@ namespace atf_amc { // update-hdr // Insert 1 element in the list, check if it is really in the list // // (user-implemented function, prototype is in amc-generated header) - // void amctest_CslistInsertHead1(); + // void amctest_CslistInsertHead1(); // gstatic/atfdb.amctest:CslistInsertHead1 // // Insert 2 elements in the list, check if it they are really in the list // - // void amctest_CslistInsertHead2(); + // void amctest_CslistInsertHead2(); // gstatic/atfdb.amctest:CslistInsertHead2 // // Insert 3 elements in the list, check if it they are really in the list // - // void amctest_CslistInsertHead3(); + // void amctest_CslistInsertHead3(); // gstatic/atfdb.amctest:CslistInsertHead3 // CSLIST - TAIL INSERT // // Insert 1 element in the list, check if it is really in the list // - // void amctest_CslistInsert1(); + // void amctest_CslistInsert1(); // gstatic/atfdb.amctest:CslistInsert1 // // Insert 2 elements in the list, check if it they are really in the list // - // void amctest_CslistInsert2(); + // void amctest_CslistInsert2(); // gstatic/atfdb.amctest:CslistInsert2 // // Insert 3 elements in the list, check if it they are really in the list // - // void amctest_CslistInsert3(); + // void amctest_CslistInsert3(); // gstatic/atfdb.amctest:CslistInsert3 // CSLIST // // Insert 100 items to the list, remove first item 100 times // Then try on empty list // - // void amctest_CslistRemoveFirst(); + // void amctest_CslistRemoveFirst(); // gstatic/atfdb.amctest:CslistRemoveFirst // // Insert 100 elements, Remove them in "random" order // - // void amctest_CslistRemove(); + // void amctest_CslistRemove(); // gstatic/atfdb.amctest:CslistRemove // CSLIST - TAIL INSERTION - FIRST CHANGED // @@ -284,13 +284,13 @@ namespace atf_amc { // update-hdr // // Insert 3 items, check trigger fires only for the first // - // void amctest_CslistFirstChangedInsert(); + // void amctest_CslistFirstChangedInsert(); // gstatic/atfdb.amctest:CslistFirstChangedInsert // // Insert 3 items // RemoveFirst 3 items, check trigger fires for each // RemoveFirst from empty list, check trigger does not fire - // void amctest_CslistFirstChangedRemoveFirst(); + // void amctest_CslistFirstChangedRemoveFirst(); // gstatic/atfdb.amctest:CslistFirstChangedRemoveFirst // // Insert 4 items @@ -300,14 +300,14 @@ namespace atf_amc { // update-hdr // fourth (tail) - does not fire // second - (the only) - fires // - // void amctest_CslistFirstChangedRemove(); + // void amctest_CslistFirstChangedRemove(); // gstatic/atfdb.amctest:CslistFirstChangedRemove // // Insert 100 items // Flush // Trigger fires once // - // void amctest_CslistFirstChangedFlush(); + // void amctest_CslistFirstChangedFlush(); // gstatic/atfdb.amctest:CslistFirstChangedFlush // CSLIST - HEAD INSERTION - FIRST CHANGED // void csl_h_typec_FirstChanged(); @@ -315,74 +315,73 @@ namespace atf_amc { // update-hdr // // Insert 3 items, check the trigger fires for each // - // void amctest_CslistHeadFirstChangedInsert(); + // void amctest_CslistHeadFirstChangedInsert(); // gstatic/atfdb.amctest:CslistHeadFirstChangedInsert // CSLIST - ROTATE FIRST - // void amctest_CslistRotateFirst(); + // void amctest_CslistRotateFirst(); // gstatic/atfdb.amctest:CslistRotateFirst // ------------------------------------------------------------------- // cpp/atf_amc/delptr.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_Delptr(); + // void amctest_Delptr(); // gstatic/atfdb.amctest:Delptr // ------------------------------------------------------------------- // cpp/atf_amc/dispatch.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_DispRead1(); - // void amctest_DispRead2(); - // void amctest_DispRead3(); - // void amctest_DispRead4(); + // void amctest_DispRead1(); // gstatic/atfdb.amctest:DispRead1 + // void amctest_DispRead2(); // gstatic/atfdb.amctest:DispRead2 + // void amctest_DispRead3(); // gstatic/atfdb.amctest:DispRead3 + // void amctest_DispRead4(); // gstatic/atfdb.amctest:DispRead4 // Check that dispatch read supports both lowercase and uppercase versions - // void amctest_DispReadSsimfile(); - // void amctest_TestDispFilter(); - // void amctest_TestDispFilter2(); - // void amctest_TestDispFilter3(); - // void amctest_TestDispFilter4(); + // void amctest_DispReadSsimfile(); // gstatic/atfdb.amctest:DispReadSsimfile + // void amctest_TestDispFilter(); // gstatic/atfdb.amctest:TestDispFilter + // void amctest_TestDispFilter2(); // gstatic/atfdb.amctest:TestDispFilter2 + // void amctest_TestDispFilter3(); // gstatic/atfdb.amctest:TestDispFilter3 + // void amctest_TestDispFilter4(); // gstatic/atfdb.amctest:TestDispFilter4 // ------------------------------------------------------------------- // cpp/atf_amc/exec.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_Exec_Status(); - // void amctest_ReadProc(); - // void amctest_ExecSh(); - // void amctest_ExecVerbose(); + // void amctest_Exec_Status(); // gstatic/atfdb.amctest:Exec_Status + // void amctest_ReadProc(); // gstatic/atfdb.amctest:ReadProc + // void amctest_ExecSh(); // gstatic/atfdb.amctest:ExecSh + // void amctest_ExecVerbose(); // gstatic/atfdb.amctest:ExecVerbose // ------------------------------------------------------------------- // cpp/atf_amc/fbuf.cpp // // (user-implemented function, prototype is in amc-generated header) - // void cd_in_msg_Step(); - // void amctest_msgbuf_test0(); - // void amctest_msgbuf_test1(); - // void amctest_msgbuf_test1_1(); - // void amctest_msgbuf_test1_2(); - // void amctest_msgbuf_test2(); - // void amctest_msgbuf_test3(); - // void amctest_msgbuf_test4(); - // void amctest_msgbuf_test5(); - // void amctest_msgbuf_test6(); - // void amctest_msgbuf_test7(); - // void amctest_msgbuf_test8(); - // void amctest_msgbuf_test9(); - // void amctest_msgbuf_test10(); - // void amctest_msgbuf_extra_test(); - // void amctest_linebuf_test1(); - // void amctest_linebuf_test2(); - // void amctest_linebuf_test3(); - // void amctest_linebuf_test4(); - // void amctest_linebuf_test5(); - // void amctest_bytebuf_test1(); - // void amctest_bytebuf_test2(); - // void amctest_bytebuf_dyn_test1(); + // void cd_in_msg_Step(); // fstep:atf_amc.FDb.cd_in_msg + // void amctest_msgbuf_test0(); // gstatic/atfdb.amctest:msgbuf_test0 + // void amctest_msgbuf_test1(); // gstatic/atfdb.amctest:msgbuf_test1 + // void amctest_msgbuf_test1_1(); // gstatic/atfdb.amctest:msgbuf_test1_1 + // void amctest_msgbuf_test1_2(); // gstatic/atfdb.amctest:msgbuf_test1_2 + // void amctest_msgbuf_test2(); // gstatic/atfdb.amctest:msgbuf_test2 + // void amctest_msgbuf_test3(); // gstatic/atfdb.amctest:msgbuf_test3 + // void amctest_msgbuf_test4(); // gstatic/atfdb.amctest:msgbuf_test4 + // void amctest_msgbuf_test5(); // gstatic/atfdb.amctest:msgbuf_test5 + // void amctest_msgbuf_test6(); // gstatic/atfdb.amctest:msgbuf_test6 + // void amctest_msgbuf_test7(); // gstatic/atfdb.amctest:msgbuf_test7 + // void amctest_msgbuf_test8(); // gstatic/atfdb.amctest:msgbuf_test8 + // void amctest_msgbuf_test9(); // gstatic/atfdb.amctest:msgbuf_test9 + // void amctest_msgbuf_test10(); // gstatic/atfdb.amctest:msgbuf_test10 + // void amctest_msgbuf_extra_test(); // gstatic/atfdb.amctest:msgbuf_extra_test + // void amctest_linebuf_test1(); // gstatic/atfdb.amctest:linebuf_test1 + // void amctest_linebuf_test2(); // gstatic/atfdb.amctest:linebuf_test2 + // void amctest_linebuf_test3(); // gstatic/atfdb.amctest:linebuf_test3 + // void amctest_linebuf_test4(); // gstatic/atfdb.amctest:linebuf_test4 + // void amctest_linebuf_test5(); // gstatic/atfdb.amctest:linebuf_test5 + // void amctest_bytebuf_test1(); // gstatic/atfdb.amctest:bytebuf_test1 + // void amctest_bytebuf_test2(); // gstatic/atfdb.amctest:bytebuf_test2 + // void amctest_bytebuf_dyn_test1(); // gstatic/atfdb.amctest:bytebuf_dyn_test1 // custom framer -- 4 bytes at a time - void in_custom_ScanMsg(atf_amc::Msgbuf &msgbuf); - // (user-implemented function, prototype is in amc-generated header) - // void amctest_msgbuf_custom(); + // void in_custom_ScanMsg(atf_amc::Msgbuf &msgbuf); // fbuf:atf_amc.Msgbuf.in_custom + // void amctest_msgbuf_custom(); // gstatic/atfdb.amctest:msgbuf_custom // ------------------------------------------------------------------- // cpp/atf_amc/fconst.cpp @@ -390,93 +389,108 @@ namespace atf_amc { // update-hdr // FCONST tests // (user-implemented function, prototype is in amc-generated header) - // void amctest_Fconst(); + // void amctest_Fconst(); // gstatic/atfdb.amctest:Fconst // ------------------------------------------------------------------- // cpp/atf_amc/fstep.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_fstep_Inline(); - // void amctest_fstep_InlineOnce(); - // void amctest_fstep_InlineRecur(); - // void amctest_fstep_TimeHookRecur(); + // void amctest_fstep_Inline(); // gstatic/atfdb.amctest:fstep_Inline + // void amctest_fstep_InlineOnce(); // gstatic/atfdb.amctest:fstep_InlineOnce + // void amctest_fstep_InlineRecur(); // gstatic/atfdb.amctest:fstep_InlineRecur + // void amctest_fstep_TimeHookRecur(); // gstatic/atfdb.amctest:fstep_TimeHookRecur + // void bh_time_entry_Step(); // fstep:atf_amc.FDb.bh_time_entry + // void amctest_fstep_TimeHookOnce(); // gstatic/atfdb.amctest:fstep_TimeHookOnce // ------------------------------------------------------------------- // cpp/atf_amc/gsymbol.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_Gsymbol(); + // void amctest_Gsymbol(); // gstatic/atfdb.amctest:Gsymbol // ------------------------------------------------------------------- // cpp/atf_amc/hook.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_Hook1(); - // void amctest_Hook2(); + // void amctest_Hook1(); // gstatic/atfdb.amctest:Hook1 + + // Static hooks with argument + // amctest itself uses static hook without argument, so we'll assume it's been + // tested. + // void listtype_cd(atf_amc::FListtype &listtype); // gstatic/dmmeta.listtype:cd + // void listtype_cdl(atf_amc::FListtype &listtype); // gstatic/dmmeta.listtype:cdl + // void listtype_cs(atf_amc::FListtype &listtype); // gstatic/dmmeta.listtype:cs + // void listtype_csl(atf_amc::FListtype &listtype); // gstatic/dmmeta.listtype:csl + // void listtype_zd(atf_amc::FListtype &listtype); // gstatic/dmmeta.listtype:zd + // void listtype_zdl(atf_amc::FListtype &listtype); // gstatic/dmmeta.listtype:zdl + // void listtype_zs(atf_amc::FListtype &listtype); // gstatic/dmmeta.listtype:zs + // void listtype_zsl(atf_amc::FListtype &listtype); // gstatic/dmmeta.listtype:zsl + // void amctest_Hook2(); // gstatic/atfdb.amctest:Hook2 // ------------------------------------------------------------------- // cpp/atf_amc/inlary.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_Inlary_ReadPrint(); + // void amctest_Inlary_ReadPrint(); // gstatic/atfdb.amctest:Inlary_ReadPrint // ------------------------------------------------------------------- // cpp/atf_amc/lary.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_LaryFind(); + // void amctest_LaryFind(); // gstatic/atfdb.amctest:LaryFind // ------------------------------------------------------------------- // cpp/atf_amc/lineiter.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_LineIter(); + // void amctest_LineIter(); // gstatic/atfdb.amctest:LineIter // ------------------------------------------------------------------- // cpp/atf_amc/lpool.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_Lpool(); - // void amctest_LpoolLockMem(); + // void amctest_Lpool(); // gstatic/atfdb.amctest:Lpool + // void amctest_LpoolLockMem(); // gstatic/atfdb.amctest:LpoolLockMem // ------------------------------------------------------------------- // cpp/atf_amc/main.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_PrintBase36(); - // void amctest_SetGetnumBase10(); + // void amctest_PrintBase36(); // gstatic/atfdb.amctest:PrintBase36 + // void amctest_SetGetnumBase10(); // gstatic/atfdb.amctest:SetGetnumBase10 // not actually a test but scratch area - // void amctest_Scratch(); - // void amctest_CastUp(); - // void amctest_CastDown(); - // void amctest_CastDownFail(); - // void amctest_CastDownTooShort(); - // void amctest_CopyOut1(); - // void amctest_CopyOut2(); - // void amctest_CopyOut3(); - // void amctest_TestInsertX2(); - // void amctest_TestInsertX3(); - // void amctest_TestCstring1(); - // void amctest_TestCstring2(); - // void amctest_TestSep1(); - // void amctest_TestSep2(); - // void amctest_TestRegx1(); - // void amctest_SubstrDfltval(); - // void amctest_Minmax(); - // void bh_typec_Step(); - // void zsl_h_typec_Step(); - // void zs_t_typec_Step(); - // void csl_h_typec_Step(); - // void cs_t_typec_Step(); - // void amctest_ImdXref(); - // void amctest_Typetag(); + // void amctest_Scratch(); // gstatic/atfdb.amctest:Scratch + // void amctest_CastUp(); // gstatic/atfdb.amctest:CastUp + // void amctest_CastDown(); // gstatic/atfdb.amctest:CastDown + // void amctest_CastDownFail(); // gstatic/atfdb.amctest:CastDownFail + // void amctest_CastDownTooShort(); // gstatic/atfdb.amctest:CastDownTooShort + // void amctest_CopyOut1(); // gstatic/atfdb.amctest:CopyOut1 + // void amctest_CopyOut2(); // gstatic/atfdb.amctest:CopyOut2 + // void amctest_CopyOut3(); // gstatic/atfdb.amctest:CopyOut3 + // void amctest_TestInsertX2(); // gstatic/atfdb.amctest:TestInsertX2 + // void amctest_TestInsertX3(); // gstatic/atfdb.amctest:TestInsertX3 + // void amctest_TestCstring1(); // gstatic/atfdb.amctest:TestCstring1 + // void amctest_TestCstring2(); // gstatic/atfdb.amctest:TestCstring2 + // void amctest_TestSep1(); // gstatic/atfdb.amctest:TestSep1 + // void amctest_TestSep2(); // gstatic/atfdb.amctest:TestSep2 + // void amctest_TestRegx1(); // gstatic/atfdb.amctest:TestRegx1 + // void amctest_SubstrDfltval(); // gstatic/atfdb.amctest:SubstrDfltval + // void amctest_Minmax(); // gstatic/atfdb.amctest:Minmax + // void bh_typec_Step(); // fstep:atf_amc.FDb.bh_typec + // void zsl_h_typec_Step(); // fstep:atf_amc.FDb.zsl_h_typec + // void zs_t_typec_Step(); // fstep:atf_amc.FDb.zs_t_typec + // void csl_h_typec_Step(); // fstep:atf_amc.FDb.csl_h_typec + // void cs_t_typec_Step(); // fstep:atf_amc.FDb.cs_t_typec + // void amctest_ImdXref(); // gstatic/atfdb.amctest:ImdXref + // void amctest_Typetag(); // gstatic/atfdb.amctest:Typetag // Check that gconst field within tuple is printed as raw - // void amctest_PrintRawGconst(); - // void amctest_MsgLength(); + // void amctest_PrintRawGconst(); // gstatic/atfdb.amctest:PrintRawGconst + // void amctest_MsgLength(); // gstatic/atfdb.amctest:MsgLength void Phase(algo::strptr phase); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:atf_amc // ------------------------------------------------------------------- // cpp/atf_amc/msgcurs.cpp @@ -484,122 +498,142 @@ namespace atf_amc { // update-hdr // Read 2 messages from byteary // (user-implemented function, prototype is in amc-generated header) - // void amctest_MsgCurs(); + // void amctest_MsgCurs(); // gstatic/atfdb.amctest:MsgCurs // Byte array too small for message - // void amctest_MsgCurs2(); + // void amctest_MsgCurs2(); // gstatic/atfdb.amctest:MsgCurs2 // Message too big for buffer; - // void amctest_MsgCurs3(); + // void amctest_MsgCurs3(); // gstatic/atfdb.amctest:MsgCurs3 // Byte array too small for even message header - // void amctest_MsgCurs4(); + // void amctest_MsgCurs4(); // gstatic/atfdb.amctest:MsgCurs4 // ------------------------------------------------------------------- // cpp/atf_amc/numstr.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_Numstr(); - // void amctest_NumstrCorruption(); + // void amctest_Numstr(); // gstatic/atfdb.amctest:Numstr + // void amctest_NumstrCorruption(); // gstatic/atfdb.amctest:NumstrCorruption // ------------------------------------------------------------------- // cpp/atf_amc/opt.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_OptG(); - // void amctest_OptG2(); - // void amctest_OptOptG3(); - // void amctest_OptOptG4(); - // void amctest_OptOptG5(); - // void amctest_OptOptG6(); - // void amctest_OptOptG7(); - // void amctest_OptG8(); - // void amctest_OptOptG8(); - // void amctest_OptG9(); - // void amctest_OptOptG9(); - // void amctest_OptOptG10(); - // void amctest_OptAlloc(); + // void amctest_OptG(); // gstatic/atfdb.amctest:OptG + // void amctest_OptG2(); // gstatic/atfdb.amctest:OptG2 + // void amctest_OptOptG3(); // gstatic/atfdb.amctest:OptOptG3 + // void amctest_OptOptG4(); // gstatic/atfdb.amctest:OptOptG4 + // void amctest_OptOptG5(); // gstatic/atfdb.amctest:OptOptG5 + // void amctest_OptOptG6(); // gstatic/atfdb.amctest:OptOptG6 + // void amctest_OptOptG7(); // gstatic/atfdb.amctest:OptOptG7 + // void amctest_OptG8(); // gstatic/atfdb.amctest:OptG8 + // void amctest_OptOptG8(); // gstatic/atfdb.amctest:OptOptG8 + // void amctest_OptG9(); // gstatic/atfdb.amctest:OptG9 + // void amctest_OptOptG9(); // gstatic/atfdb.amctest:OptOptG9 + // void amctest_OptOptG10(); // gstatic/atfdb.amctest:OptOptG10 + // void amctest_OptAlloc(); // gstatic/atfdb.amctest:OptAlloc // ------------------------------------------------------------------- // cpp/atf_amc/pmask.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_TestPmask1(); - // void amctest_TestPmask2(); - // void amctest_TestPmask3(); - // void amctest_TestPmask4(); - // void amctest_TestPmask5(); - // void amctest_TestPmask6(); - // void amctest_TestPmask7(); - // void amctest_TestPmask8(); - // void amctest_PmaskMultiple(); + // void amctest_TestPmask1(); // gstatic/atfdb.amctest:TestPmask1 + // void amctest_TestPmask2(); // gstatic/atfdb.amctest:TestPmask2 + // void amctest_TestPmask3(); // gstatic/atfdb.amctest:TestPmask3 + // void amctest_TestPmask4(); // gstatic/atfdb.amctest:TestPmask4 + // void amctest_TestPmask5(); // gstatic/atfdb.amctest:TestPmask5 + // void amctest_TestPmask6(); // gstatic/atfdb.amctest:TestPmask6 + // void amctest_TestPmask7(); // gstatic/atfdb.amctest:TestPmask7 + // void amctest_TestPmask8(); // gstatic/atfdb.amctest:TestPmask8 + // void amctest_PmaskMultiple(); // gstatic/atfdb.amctest:PmaskMultiple // ------------------------------------------------------------------- // cpp/atf_amc/ptrary.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_PtraryInsert(); - // void amctest_PtraryCursor(); + // void amctest_PtraryInsert(); // gstatic/atfdb.amctest:PtraryInsert + // void amctest_PtraryCursor(); // gstatic/atfdb.amctest:PtraryCursor + // void amctest_PtraryHeaplike(); // gstatic/atfdb.amctest:PtraryHeaplike + // void amctest_PtraryNonUnique(); // gstatic/atfdb.amctest:PtraryNonUnique // ------------------------------------------------------------------- // cpp/atf_amc/readstr.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_ReadTuple1(); - // void amctest_ReadTuple2(); - // void amctest_ReadTuple2a(); - // void amctest_ReadTuple3(); - // void amctest_ReadTuple4(); - // void amctest_ReadTuple5(); + // void amctest_ReadTuple1(); // gstatic/atfdb.amctest:ReadTuple1 + // void amctest_ReadTuple2(); // gstatic/atfdb.amctest:ReadTuple2 + // void amctest_ReadTuple2a(); // gstatic/atfdb.amctest:ReadTuple2a + // void amctest_ReadTuple3(); // gstatic/atfdb.amctest:ReadTuple3 + // void amctest_ReadTuple4(); // gstatic/atfdb.amctest:ReadTuple4 + // void amctest_ReadTuple5(); // gstatic/atfdb.amctest:ReadTuple5 // ------------------------------------------------------------------- // cpp/atf_amc/sort.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_AmcSort(); - // void amctest_PerfSortString(); + // void amctest_AmcSort(); // gstatic/atfdb.amctest:AmcSort + // void amctest_PerfSortString(); // gstatic/atfdb.amctest:PerfSortString // ------------------------------------------------------------------- // cpp/atf_amc/strconv.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_TestString(); + // void amctest_TestString(); // gstatic/atfdb.amctest:TestString // ------------------------------------------------------------------- // cpp/atf_amc/tary.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_TaryInit(); - // void amctest_TaryInit2(); - // void amctest_TaryInit3(); - // void amctest_TaryInit4(); - // void amctest_TaryReserve(); + // void amctest_TaryInit(); // gstatic/atfdb.amctest:TaryInit + // void amctest_TaryInit2(); // gstatic/atfdb.amctest:TaryInit2 + // void amctest_TaryInit3(); // gstatic/atfdb.amctest:TaryInit3 + // void amctest_TaryInit4(); // gstatic/atfdb.amctest:TaryInit4 + // void amctest_TaryReserve(); // gstatic/atfdb.amctest:TaryReserve + // void amctest_TaryHash(); // gstatic/atfdb.amctest:TaryHash + void Insary(algo::StringAry &ary, const char *rhs[], int at); + bool Cmpary(algo::StringAry &ary, const char **rhs); + bool Cmpary(algo::aryptr ary, const char **rhs); + // (user-implemented function, prototype is in amc-generated header) + // void amctest_TaryInsary(); // gstatic/atfdb.amctest:TaryInsary + // void amctest_TaryAllocNAt(); // gstatic/atfdb.amctest:TaryAllocNAt // ------------------------------------------------------------------- // cpp/atf_amc/thash.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_ThashEmpty(); - // void amctest_ThashInsertMaybe(); - // void amctest_ThashRemove(); - // void amctest_ThashFindRemove(); - // void amctest_ThashGetOrCreate(); - // void amctest_ThashXref(); + // void amctest_ThashEmpty(); // gstatic/atfdb.amctest:ThashEmpty + // void amctest_ThashInsertMaybe(); // gstatic/atfdb.amctest:ThashInsertMaybe + // void amctest_ThashRemove(); // gstatic/atfdb.amctest:ThashRemove + // void amctest_ThashFindRemove(); // gstatic/atfdb.amctest:ThashFindRemove + // void amctest_ThashGetOrCreate(); // gstatic/atfdb.amctest:ThashGetOrCreate + // void amctest_ThashXref(); // gstatic/atfdb.amctest:ThashXref // THASH DLL - // void amctest_PerfThashRemove(); + // void amctest_PerfThashRemove(); // gstatic/atfdb.amctest:PerfThashRemove + // void amctest_ThashLinear(); // gstatic/atfdb.amctest:ThashLinear + + // Test hash with string keys containing binary chars + // void amctest_ThashStrkey(); // gstatic/atfdb.amctest:ThashStrkey // ------------------------------------------------------------------- // cpp/atf_amc/varlen.cpp // // (user-implemented function, prototype is in amc-generated header) - // void amctest_VarlenExternLength(); - void length_Set(atf_amc::VarlenExtern &vl, u32 n); - u32 length_Get(atf_amc::VarlenExtern &vl); + // void amctest_VarlenExternLength(); // gstatic/atfdb.amctest:VarlenExternLength + // void length_Set(atf_amc::VarlenExtern &vl, u32 n); // cppfunc:atf_amc.VarlenExtern.length + // u32 length_Get(atf_amc::VarlenExtern &vl); + // void amctest_VarlenAlloc(); // gstatic/atfdb.amctest:VarlenAlloc + // void amctest_VarlenMsgs(); // gstatic/atfdb.amctest:VarlenMsgs + // void amctest_VarlenMsgsPnew(); // gstatic/atfdb.amctest:VarlenMsgsPnew + template strptr Bytes(T &arg); + // (user-implemented function, prototype is in amc-generated header) + // void amctest_Varlen2(); // gstatic/atfdb.amctest:Varlen2 + bool Arycmp(algo::aryptr a, algo::aryptr b); // (user-implemented function, prototype is in amc-generated header) - // void amctest_VarlenAlloc(); - // void amctest_VarlenMsgs(); - // void amctest_VarlenMsgsPnew(); + // void amctest_Varlen2a(); // gstatic/atfdb.amctest:Varlen2a + // void amctest_Varlen2m(); // gstatic/atfdb.amctest:Varlen2m + // void amctest_Varlen2v(); // gstatic/atfdb.amctest:Varlen2v // ------------------------------------------------------------------- // cpp/atf_amc/zdlist.cpp @@ -609,48 +643,48 @@ namespace atf_amc { // update-hdr // create list item, check if it is not in list // // (user-implemented function, prototype is in amc-generated header) - // void amctest_ZdlistItemDfltCtor(); + // void amctest_ZdlistItemDfltCtor(); // gstatic/atfdb.amctest:ZdlistItemDfltCtor // // Create empty list, check if it is really empty // - // void amctest_ZdlistDfltCtor(); + // void amctest_ZdlistDfltCtor(); // gstatic/atfdb.amctest:ZdlistDfltCtor // // Insert 1 element in the list, check if it is really in the list // - // void amctest_ZdlistInsert1(); + // void amctest_ZdlistInsert1(); // gstatic/atfdb.amctest:ZdlistInsert1 // // Insert 2 elements in the list, check if it they are really in the list // - // void amctest_ZdlistInsert2(); + // void amctest_ZdlistInsert2(); // gstatic/atfdb.amctest:ZdlistInsert2 // // Insert 3 elements in the list, check if it they are really in the list // - // void amctest_ZdlistInsert3(); + // void amctest_ZdlistInsert3(); // gstatic/atfdb.amctest:ZdlistInsert3 // // Insert 100 items to the list, remove first item 100 times // Then try on empty list // - // void amctest_ZdlistRemoveFirst(); + // void amctest_ZdlistRemoveFirst(); // gstatic/atfdb.amctest:ZdlistRemoveFirst // // Insert 100 elements, Remove them in "random" order // - // void amctest_ZdlistRemove(); + // void amctest_ZdlistRemove(); // gstatic/atfdb.amctest:ZdlistRemove // // Flush empty list // - // void amctest_ZdlistFlushEmpty(); + // void amctest_ZdlistFlushEmpty(); // gstatic/atfdb.amctest:ZdlistFlushEmpty // // Flush 100 elements // - // void amctest_ZdlistFlush100(); + // void amctest_ZdlistFlush100(); // gstatic/atfdb.amctest:ZdlistFlush100 // // InsertMaybe: @@ -658,40 +692,40 @@ namespace atf_amc { // update-hdr // 2) try insert the same element, check if not inserted // 3) try insert other element, check if inserted // - // void amctest_ZdlistInsertMaybe(); + // void amctest_ZdlistInsertMaybe(); // gstatic/atfdb.amctest:ZdlistInsertMaybe // ZDLIST - HEAD INSERT // // Insert 1 element in the list, check if it is really in the list // - // void amctest_ZdlistInsertHead1(); + // void amctest_ZdlistInsertHead1(); // gstatic/atfdb.amctest:ZdlistInsertHead1 // // Insert 2 elements in the list, check if it they are really in the list // - // void amctest_ZdlistInsertHead2(); + // void amctest_ZdlistInsertHead2(); // gstatic/atfdb.amctest:ZdlistInsertHead2 // // Insert 3 elements in the list, check if it they are really in the list // - // void amctest_ZdlistInsertHead3(); + // void amctest_ZdlistInsertHead3(); // gstatic/atfdb.amctest:ZdlistInsertHead3 // ZDLIST - HEAD INSERT - NO TAIL // // Insert 1 element in the list, check if it is really in the list // - // void amctest_ZdlistInsertHeadNoTail1(); + // void amctest_ZdlistInsertHeadNoTail1(); // gstatic/atfdb.amctest:ZdlistInsertHeadNoTail1 // // Insert 2 elements in the list, check if it they are really in the list // - // void amctest_ZdlistInsertHeadNoTail2(); + // void amctest_ZdlistInsertHeadNoTail2(); // gstatic/atfdb.amctest:ZdlistInsertHeadNoTail2 // // Insert 3 elements in the list, check if it they are really in the list // - // void amctest_ZdlistInsertHeadNoTail3(); - // void amctest_ZdlistDelCurs(); + // void amctest_ZdlistInsertHeadNoTail3(); // gstatic/atfdb.amctest:ZdlistInsertHeadNoTail3 + // void amctest_ZdlistDelCurs(); // gstatic/atfdb.amctest:ZdlistDelCurs // ------------------------------------------------------------------- // cpp/atf_amc/zslist.cpp @@ -701,71 +735,71 @@ namespace atf_amc { // update-hdr // Insert 1 element in the list, check if it is really in the list // // (user-implemented function, prototype is in amc-generated header) - // void amctest_ZslistInsertHead1(); + // void amctest_ZslistInsertHead1(); // gstatic/atfdb.amctest:ZslistInsertHead1 // // Insert 2 elements in the list, check if it they are really in the list // - // void amctest_ZslistInsertHead2(); + // void amctest_ZslistInsertHead2(); // gstatic/atfdb.amctest:ZslistInsertHead2 // // Insert 3 elements in the list, check if it they are really in the list // - // void amctest_ZslistInsertHead3(); + // void amctest_ZslistInsertHead3(); // gstatic/atfdb.amctest:ZslistInsertHead3 // ZSLIST - TAIL INSERT // // Insert 1 element in the list, check if it is really in the list // - // void amctest_ZslistInsert1(); + // void amctest_ZslistInsert1(); // gstatic/atfdb.amctest:ZslistInsert1 // // Insert 2 elements in the list, check if it they are really in the list // - // void amctest_ZslistInsert2(); + // void amctest_ZslistInsert2(); // gstatic/atfdb.amctest:ZslistInsert2 // // Insert 3 elements in the list, check if it they are really in the list // - // void amctest_ZslistInsert3(); + // void amctest_ZslistInsert3(); // gstatic/atfdb.amctest:ZslistInsert3 // ZSLIST // // Insert 100 items to the list, remove first item 100 times // Then try on empty list // - // void amctest_ZslistRemoveFirst(); + // void amctest_ZslistRemoveFirst(); // gstatic/atfdb.amctest:ZslistRemoveFirst // // Insert 100 elements, Remove them in "random" order // - // void amctest_ZslistRemove(); + // void amctest_ZslistRemove(); // gstatic/atfdb.amctest:ZslistRemove // ZSLISTMT // // check the newly created item is not in the list // - // void amctest_ZslistmtItemDfltCtor(); + // void amctest_ZslistmtItemDfltCtor(); // gstatic/atfdb.amctest:ZslistmtItemDfltCtor // // check that newly created list is empty // - // void amctest_ZslistmtDfltCtor(); + // void amctest_ZslistmtDfltCtor(); // gstatic/atfdb.amctest:ZslistmtDfltCtor // // add 1 item, and then delete // - // void amctest_Zslistmt1(); + // void amctest_Zslistmt1(); // gstatic/atfdb.amctest:Zslistmt1 // // add 2 items, and then delete // - // void amctest_Zslistmt2(); + // void amctest_Zslistmt2(); // gstatic/atfdb.amctest:Zslistmt2 // // add 3 items, and then delete // - // void amctest_Zslistmt3(); + // void amctest_Zslistmt3(); // gstatic/atfdb.amctest:Zslistmt3 // ZSLIST - TAIL INSERTION - FIRST CHANGED // @@ -775,13 +809,13 @@ namespace atf_amc { // update-hdr // // Insert 3 items, check trigger fires only for the first // - // void amctest_ZslistFirstChangedInsert(); + // void amctest_ZslistFirstChangedInsert(); // gstatic/atfdb.amctest:ZslistFirstChangedInsert // // Insert 3 items // RemoveFirst 3 items, check trigger fires for each // RemoveFirst from empty list, check trigger does not fire - // void amctest_ZslistFirstChangedRemoveFirst(); + // void amctest_ZslistFirstChangedRemoveFirst(); // gstatic/atfdb.amctest:ZslistFirstChangedRemoveFirst // // Insert 4 items @@ -791,14 +825,14 @@ namespace atf_amc { // update-hdr // fourth (tail) - does not fire // second - (the only) - fires // - // void amctest_ZslistFirstChangedRemove(); + // void amctest_ZslistFirstChangedRemove(); // gstatic/atfdb.amctest:ZslistFirstChangedRemove // // Insert 100 items // Flush // Trigger fires once // - // void amctest_ZslistFirstChangedFlush(); + // void amctest_ZslistFirstChangedFlush(); // gstatic/atfdb.amctest:ZslistFirstChangedFlush // ZSLIST - HEAD INSERTION - FIRST CHANGED // void zsl_h_typec_FirstChanged(); @@ -806,5 +840,5 @@ namespace atf_amc { // update-hdr // // Insert 3 items, check the trigger fires for each // - // void amctest_ZslistHeadFirstChangedInsert(); + // void amctest_ZslistHeadFirstChangedInsert(); // gstatic/atfdb.amctest:ZslistHeadFirstChangedInsert } diff --git a/include/atf_ci.h b/include/atf_ci.h index ddc6438e..20f46718 100644 --- a/include/atf_ci.h +++ b/include/atf_ci.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2023 Astra // Copyright (C) 2017-2019 NYSE | Intercontinental Exchange // @@ -35,27 +35,38 @@ namespace atf_ci { // update-hdr // To refresh the contents of this section, run 'update-hdr'. // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. + // ------------------------------------------------------------------- + // cpp/atf_ci/abt_md.cpp + // + + // Runs in sandbox + // (user-implemented function, prototype is in amc-generated header) + // void citest_abt_md_after_ssimfile_is_added(); // gstatic/atfdb.citest:abt_md_after_ssimfile_is_added + // ------------------------------------------------------------------- // cpp/atf_ci/acr_ed.cpp // // Runs in sandbox // (user-implemented function, prototype is in amc-generated header) - // void citest_acr_ed_ssimdb(); + // void citest_acr_ed_ssimdb(); // gstatic/atfdb.citest:acr_ed_ssimdb + + // Runs in sandbox + // void citest_acr_ed_unittest(); // gstatic/atfdb.citest:acr_ed_unittest // Runs in sandbox - // void citest_acr_ed_ssimfile(); + // void citest_acr_ed_ssimfile(); // gstatic/atfdb.citest:acr_ed_ssimfile // Runs in sandbox - // void citest_acr_ed_target(); + // void citest_acr_ed_target(); // gstatic/atfdb.citest:acr_ed_target // ------------------------------------------------------------------- // cpp/atf_ci/apm.cpp // // (user-implemented function, prototype is in amc-generated header) - // void citest_apm(); - // void citest_apm_check(); - // void citest_apm_reinstall(); + // void citest_apm(); // gstatic/atfdb.citest:apm + // void citest_apm_check(); // gstatic/atfdb.citest:apm_check + // void citest_apm_reinstall(); // gstatic/atfdb.citest:apm_reinstall // ------------------------------------------------------------------- // cpp/atf_ci/bootstrap.cpp @@ -63,7 +74,7 @@ namespace atf_ci { // update-hdr // Create a bootstrap file for each build dir // (user-implemented function, prototype is in amc-generated header) - // void citest_bootstrap(); + // void citest_bootstrap(); // gstatic/atfdb.citest:bootstrap // ------------------------------------------------------------------- // cpp/atf_ci/cppcheck.cpp @@ -72,7 +83,7 @@ namespace atf_ci { // update-hdr // Run static code analyzer // Check Linux only // (user-implemented function, prototype is in amc-generated header) - // void citest_cppcheck(); + // void citest_cppcheck(); // gstatic/atfdb.citest:cppcheck // ------------------------------------------------------------------- // cpp/atf_ci/main.cpp @@ -87,26 +98,36 @@ namespace atf_ci { // update-hdr // Check that DIR is not generated by the test void CheckNoDir(strptr dir); // (user-implemented function, prototype is in amc-generated header) - // void citest_atf_amc(); - // void citest_atf_unit(); - // void citest_atf_comp(); - // void citest_atf_comp_cov(); - // void citest_atf_comp_mem(); - // void citest_normalize_amc_vis(); - // void citest_gitfile(); - // void citest_scanreadme(); + // void citest_atf_amc(); // gstatic/atfdb.citest:atf_amc + // void citest_atf_unit(); // gstatic/atfdb.citest:atf_unit + // void citest_atf_comp(); // gstatic/atfdb.citest:atf_comp + // void citest_atf_comp_cov(); // gstatic/atfdb.citest:atf_comp_cov + // void citest_atf_comp_mem(); // gstatic/atfdb.citest:atf_comp_mem + // void citest_normalize_amc_vis(); // gstatic/atfdb.citest:normalize_amc_vis + // void citest_gitfile(); // gstatic/atfdb.citest:gitfile + algo::UnTime FileAtime(algo::strptr fname); + + // Return max. access time of all files in directory DIRNAME, as recursively + // calculated. This is different from the directory access time. + algo::UnTime DirAtime(algo::strptr dirname); + + // Delete files that haven't been accessed in the last couple days + // (user-implemented function, prototype is in amc-generated header) + // void citest_cleantemp(); // gstatic/atfdb.citest:cleantemp + // void citest_scanreadme(); // gstatic/atfdb.citest:scanreadme + // void citest_quickreadme(); // gstatic/atfdb.citest:quickreadme // Compare contents of file `outfname` with the reference file. // Any difference = error void CompareOutput(strptr outfname); // (user-implemented function, prototype is in amc-generated header) - // void citest_bintests(); - // void citest_checkclean(); - // void citest_lineendings(); - // void citest_shebang(); - // void citest_comptest(); - // void citest_readme(); - void Main(); + // void citest_bintests(); // gstatic/atfdb.citest:bintests + // void citest_checkclean(); // gstatic/atfdb.citest:checkclean + // void citest_lineendings(); // gstatic/atfdb.citest:lineendings + // void citest_shebang(); // gstatic/atfdb.citest:shebang + // void citest_comptest(); // gstatic/atfdb.citest:comptest + // void citest_readme(); // gstatic/atfdb.citest:readme + // void Main(); // main:atf_ci // ------------------------------------------------------------------- // cpp/atf_ci/src.cpp -- source file (cpp/, include/) normalizations including amc @@ -116,30 +137,31 @@ namespace atf_ci { // update-hdr // indentation under CYGWIN is broken -- and we don't have a cross-platform // solution. so only try it on Linux // (user-implemented function, prototype is in amc-generated header) - // void citest_indent_srcfile(); + // void citest_indent_srcfile(); // gstatic/atfdb.citest:indent_srcfile + // void citest_update_script(); // gstatic/atfdb.citest:update_script // indent all script files modified in the last commit - // void citest_indent_script(); + // void citest_indent_script(); // gstatic/atfdb.citest:indent_script // update file headers - // void citest_file_header(); + // void citest_file_header(); // gstatic/atfdb.citest:file_header // source code police - // void citest_src_lim(); + // void citest_src_lim(); // gstatic/atfdb.citest:src_lim // run amc - // void citest_amc(); - // void citest_tempcode(); - // void citest_stray_gen(); - // void citest_encoding(); - // void citest_iffy_src(); - // void citest_non_copyrighted(); + // void citest_amc(); // gstatic/atfdb.citest:amc + // void citest_tempcode(); // gstatic/atfdb.citest:tempcode + // void citest_stray_gen(); // gstatic/atfdb.citest:stray_gen + // void citest_encoding(); // gstatic/atfdb.citest:encoding + // void citest_iffy_src(); // gstatic/atfdb.citest:iffy_src + // void citest_non_copyrighted(); // gstatic/atfdb.citest:non-copyrighted // ------------------------------------------------------------------- // cpp/atf_ci/ssim.cpp -- ssim database normalizations // // (user-implemented function, prototype is in amc-generated header) - // void citest_normalize_acr(); - // void citest_normalize_acr_my(); - // void citest_ssimfile(); + // void citest_normalize_acr(); // gstatic/atfdb.citest:normalize_acr + // void citest_normalize_acr_my(); // gstatic/atfdb.citest:normalize_acr_my + // void citest_ssimfile(); // gstatic/atfdb.citest:ssimfile } diff --git a/include/atf_cmdline.h b/include/atf_cmdline.h index ceb5e668..b2e18d21 100644 --- a/include/atf_cmdline.h +++ b/include/atf_cmdline.h @@ -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 diff --git a/include/atf_comp.h b/include/atf_comp.h index a9d063c1..f7e25fa4 100644 --- a/include/atf_comp.h +++ b/include/atf_comp.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2023 Astra // // License: GPL @@ -44,17 +44,17 @@ namespace atf_comp { // update-hdr // // Compute component directory depending on config given on command line - void Main_GuessCompdir(); + void Main_GuessBindir(); // Run abt for build or ood check for config given on command line - // -cfg, -build, and -ood options are passed directly to abt + // -cfg, -build options are passed directly to abt void Main_Ood(); // Running instrumented executable or under dynamic analyzer // may slow down execution greatly. Timeout given on the comptest record is // 3 * typical elapsed time for running release executable without any tool. // This functios applies known slowdown figures for various configurations and tools. - int GetTimeout(atf_comp::FComptest &comptest); + int CalcTimeout(atf_comp::FComptest &comptest); // Initialize COMPTEST.BASH.CMD to the command that will execute // If invoked with -memcheck, wrap the command line with valgrind @@ -62,7 +62,7 @@ namespace atf_comp { // update-hdr // If invoked with -callgrind, wrap the command line with valgrind // and initialize COMPTEST.FILE_CALLGRIND_LOG, COMPTEST.FILE_CALLGRIND_OUT pathname // If invoked with -coverage, wrap the command line with atf_cov - // and initialize COMPTEST.COVDIR + // and link with covdir // void SetupCmdline(atf_comp::FComptest &comptest, algo_lib::Replscope &R); @@ -72,8 +72,10 @@ namespace atf_comp { // update-hdr void Comptest_Start(atf_comp::FComptest &comptest); // Start next test - // (user-implemented function, prototype is in amc-generated header) - // void zd_sel_comptest_Step(); + // If no tests are running, it's always OK to start. + // Otherwise, the test is started only if total "# of cores used" after + // starting the test would not exceed the limit + void StartNextTest(); // Compare output of current test with the reference file. // If tfilt exists, filter output before matching @@ -95,7 +97,7 @@ namespace atf_comp { // update-hdr // will return something interesting // Decreases # of jobs // (user-implemented function, prototype is in amc-generated header) - // void zd_run_comptest_Step(); + // void zd_run_comptest_Step(); // fstep:atf_comp.FDb.zd_run_comptest // Set up signal handler to detect process exits void Main_SetupSigchild(); @@ -107,8 +109,15 @@ namespace atf_comp { // update-hdr // Merge outputs of multiple atf_cov runs into a single report. void Main_Coverage(); - // Rewrite / normalize tags in all tmsgs + // Rewrite / normalize component tests + // - Rewrite type tags in all tmsgs // If a tmsg corresponds to an unknown type, the message is deleted + // - Rewrite "abc | xyz" as + // targs abc + // tfilt xyz + // First, we want to see the true output of abc (the component test), prior to filtering + // Second, xyz will "eat" the non-zero exit code of abc and we don't want to use 'set -o pipefail' tricks + // TODO: also detect errors in command line for subcommand void Main_Normalize(); // Write all testcases from list zd_out_comptest back @@ -121,7 +130,8 @@ namespace atf_comp { // update-hdr void Main_Select(); void Main_Debug(); void Main_RewriteCmdline(); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:atf_comp // ------------------------------------------------------------------- // cpp/atf_comp/read.cpp -- Read comptest from input diff --git a/include/atf_cov.h b/include/atf_cov.h index 8efa5d32..09790f1d 100644 --- a/include/atf_cov.h +++ b/include/atf_cov.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2023 Astra // // License: GPL @@ -46,5 +46,6 @@ namespace atf_cov { // update-hdr void Main_Check(); void Main_Capture(); void SaveCov(); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:atf_cov } diff --git a/include/atf_exp.h b/include/atf_exp.h new file mode 100644 index 00000000..2ff46c2c --- /dev/null +++ b/include/atf_exp.h @@ -0,0 +1,113 @@ +// Copyright (C) 2024,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: atf_exp (exe) -- ATF expect +// Exceptions: yes +// Header: include/atf_exp.h +// +// This source code constitutes confidential information and trade secrets +// of AlgoRND. Unauthorized copying, distribution or sharing of this file, +// via any medium, is strictly prohibited. + +#include "include/gen/atf_exp_gen.h" +#include "include/gen/atf_exp_gen.inl.h" +#include "include/lib_ams.h" + +namespace atf_exp { // update-hdr + // Dear human: + // Text from here to the closing curly brace was produced by scanning + // source files. Editing this text is futile. + // To refresh the contents of this section, run 'update-hdr'. + // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. + + // ------------------------------------------------------------------- + // cpp/atf_exp/atf_exp.cpp + // + + // Add variable NAME=VALUE to global replscope + // And append a line to $tempdir/vars + void SetVar(algo::strptr name, algo::strptr value); + + // remove directory + // (user-implemented function, prototype is in amc-generated header) + // void In_RemDirRecurseMsg(ams::RemDirRecurseMsg &msg); // dispatch_msg:atf_exp.In/ams.RemDirRecurseMsg + + // start new subprocess + // void In_ProcStartMsg(ams::ProcStartMsg &msg); // dispatch_msg:atf_exp.In/ams.ProcStartMsg + + // Switch focus to process, start reading process output + // and waiting `until` string. + // Empty string means until process exit. + // Launch timer. + // void In_ProcReadMsg(ams::ProcReadMsg &msg); // dispatch_msg:atf_exp.In/ams.ProcReadMsg + + // send message to process + // void In_ProcMsg(ams::ProcMsg &msg); // dispatch_msg:atf_exp.In/ams.ProcMsg + + // Close process stdin from write side, delay close in case of non-empty buffer + // void In_ProcEofMsg(ams::ProcEofMsg &msg); // dispatch_msg:atf_exp.In/ams.ProcEofMsg + + // kill process + // void In_ProcKillMsg(ams::ProcKillMsg &msg); // dispatch_msg:atf_exp.In/ams.ProcKillMsg + + // Terminate + // void In_TerminateMsg(ams::TerminateMsg &); // dispatch_msg:atf_exp.In/ams.TerminateMsg + + // read stdin + // void cd_fdin_read_Step(); // fstep:atf_exp.FDb.cd_fdin_read + + // stdin eof + // void cd_fdin_eof_Step(); // fstep:atf_exp.FDb.cd_fdin_eof + + // Read shelved process output, put to stdout. + // Search `until` string. When found, stop reading process output, + // keep the rest of data in the buffer and switch back to stdin. + // Check process exit, issue process status message, delete process. + void ProcRead(atf_exp::FProc &proc); + + // timeout hook + void Timeout(); + + // issue process status message + void ProcStatus(atf_exp::FProc &proc); + + // process read hook: + // - capture process variables in form of `$name:value`, + // which could be utilized when launching next process using `$name` substitution + // in ams.ProcStartMsg cmd:"... $name ..." + // - store process output as ams.ProcMsg in process output buffer (shelf) + // (user-implemented function, prototype is in amc-generated header) + // void cd_proc_read_Step(); // fstep:atf_exp.FDb.cd_proc_read + + // write to subprocess + // void cd_proc_outflow_Step(); // fstep:atf_exp.FDb.cd_proc_outflow + + // wait subprocess + // void ind_proc_pid_Step(); // fstep:atf_exp.FDb.ind_proc_pid + + // Handle SIGCHLD + void SigchldHandler(int sig); + + // Setup signal handlers + void SetupSignalHandlers(); + + // invoke bash with interactive input + void TimeoutBash(); + + // main routine + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:atf_exp +} diff --git a/include/atf_fuzz.h b/include/atf_fuzz.h index f3184224..c6989b04 100644 --- a/include/atf_fuzz.h +++ b/include/atf_fuzz.h @@ -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 @@ -34,6 +34,6 @@ namespace atf_fuzz { // update-hdr // cpp/atf_fuzz/atf_fuzz.cpp // // (user-implemented function, prototype is in amc-generated header) - // void fuzzstrat_skip_inputs(); - void Main(); + // void fuzzstrat_skip_inputs(); // gstatic/atfdb.fuzzstrat:skip_inputs + // void Main(); // main:atf_fuzz } diff --git a/include/atf_gcli.h b/include/atf_gcli.h index e70aef37..f8b78a98 100644 --- a/include/atf_gcli.h +++ b/include/atf_gcli.h @@ -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 @@ -31,8 +31,9 @@ namespace atf_gcli { // update-hdr // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. // ------------------------------------------------------------------- - // cpp/atf/atf_gcli.cpp + // cpp/atf_gcli/atf_gcli.cpp // void DebugDump(); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:atf_gcli } diff --git a/include/atf_nrun.h b/include/atf_nrun.h index b242fcdb..00fe525f 100644 --- a/include/atf_nrun.h +++ b/include/atf_nrun.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2020-2021 Astra // // License: GPL diff --git a/include/atf_unit.h b/include/atf_unit.h index 6fcaed23..9db7dc4e 100644 --- a/include/atf_unit.h +++ b/include/atf_unit.h @@ -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-2012 AlgoEngineering LLC @@ -67,83 +67,85 @@ namespace atf_unit { // update-hdr // Check selecting a single tuple from file. // (user-implemented function, prototype is in amc-generated header) - // void unittest_acr_Read1(); + // void unittest_acr_Read1(); // gstatic/atfdb.unittest:acr.Read1 // Check that selecting all tuples from a mixed file // reorders them in topological order by ctype (i.e. ctype, then field) - // void unittest_acr_Read2(); + // void unittest_acr_Read2(); // gstatic/atfdb.unittest:acr.Read2 // Check that selection on non-pkey attribute works - // void unittest_acr_Read3(); + // void unittest_acr_Read3(); // gstatic/atfdb.unittest:acr.Read3 // Check that -rowid numbers records, but not for relations which are fully sorted - // void unittest_acr_Rowid1(); + // void unittest_acr_Rowid1(); // gstatic/atfdb.unittest:acr.Rowid1 // Check that with -print:N, nothing is shown - // void unittest_acr_Read5(); + // void unittest_acr_Read5(); // gstatic/atfdb.unittest:acr.Read5 // Test re-writing a single file specified with -in - // void unittest_acr_Write1(); + // void unittest_acr_Write1(); // gstatic/atfdb.unittest:acr.Write1 // Test re-writing a single file back in tree mode - // void unittest_acr_Write2(); + // void unittest_acr_Write2(); // gstatic/atfdb.unittest:acr.Write2 // Test that -insert -trunc removes all existing records of a given type // upon first insertion - // void unittest_acr_Insert1(); + // void unittest_acr_Insert1(); // gstatic/atfdb.unittest:acr.Insert1 // Insert a single record into file, no truncation - // void unittest_acr_Insert2(); + // void unittest_acr_Insert2(); // gstatic/atfdb.unittest:acr.Insert2 // Check that acr detects bad references. - // void unittest_acr_Check1(); + // void unittest_acr_Check1(); // gstatic/atfdb.unittest:acr.Check1 // Check that -unused deselects records that are referred to - // void unittest_acr_Unused1(); + // void unittest_acr_Unused1(); // gstatic/atfdb.unittest:acr.Unused1 // Check that -fldfunc expansion operates - // void unittest_acr_Fldfunc1(); + // void unittest_acr_Fldfunc1(); // gstatic/atfdb.unittest:acr.Fldfunc1 // Check that selection + -nup selects an appropriate record // and not another available record - // void unittest_acr_Xref1(); - // void unittest_acr_Xref2(); - // void unittest_acr_Field1(); + // void unittest_acr_Xref1(); // gstatic/atfdb.unittest:acr.Xref1 + // void unittest_acr_Xref2(); // gstatic/atfdb.unittest:acr.Xref2 + // void unittest_acr_Field1(); // gstatic/atfdb.unittest:acr.Field1 // Construct regx of matching records // Input order is preserved, and dots are escaped (to allow interoperability with perl) - // void unittest_acr_Regx1(); + // void unittest_acr_Regx1(); // gstatic/atfdb.unittest:acr.Regx1 // Delete a record from a file - // void unittest_acr_Del1(); + // void unittest_acr_Del1(); // gstatic/atfdb.unittest:acr.Del1 // Update a non-primary attribute - // void unittest_acr_Merge1(); + // void unittest_acr_Merge1(); // gstatic/atfdb.unittest:acr.Merge1 // Replace a record. Unspecified attributes revert to defaults. - // void unittest_acr_Replace1(); + // void unittest_acr_Replace1(); // gstatic/atfdb.unittest:acr.Replace1 // ------------------------------------------------------------------- // cpp/atf_unit/algo_fmt.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_FmtBufDec(); - // void unittest_algo_lib_CaseConversion(); - // void unittest_algo_FileFlags(); - // void unittest_algo_Base64(); + // void unittest_algo_lib_FmtBufDec(); // gstatic/atfdb.unittest:algo_lib.FmtBufDec + // void unittest_algo_lib_CaseConversion(); // gstatic/atfdb.unittest:algo_lib.CaseConversion + // void unittest_algo_FileFlags(); // gstatic/atfdb.unittest:algo.FileFlags + // void unittest_algo_Base64(); // gstatic/atfdb.unittest:algo.Base64 + // void unittest_algo_lib_PrintUuid(); // gstatic/atfdb.unittest:algo_lib.PrintUuid + // void unittest_algo_lib_ReadUuid(); // gstatic/atfdb.unittest:algo_lib.ReadUuid // ------------------------------------------------------------------- // cpp/atf_unit/algo_lib.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_PopCnt1(); - // void unittest_algo_lib_PopCnt2(); - // void unittest_algo_lib_DoTestRounding(); + // void unittest_algo_lib_PopCnt1(); // gstatic/atfdb.unittest:algo_lib.PopCnt1 + // void unittest_algo_lib_PopCnt2(); // gstatic/atfdb.unittest:algo_lib.PopCnt2 + // void unittest_algo_lib_DoTestRounding(); // gstatic/atfdb.unittest:algo_lib.DoTestRounding // CPU should only use the lower 5 bits for shifting - // void unittest_algo_lib_CheckShiftMask(); - // void unittest_algo_lib_ReadLine(); - // void unittest_algo_lib_Ceiling(); + // void unittest_algo_lib_CheckShiftMask(); // gstatic/atfdb.unittest:algo_lib.CheckShiftMask + // void unittest_algo_lib_ReadLine(); // gstatic/atfdb.unittest:algo_lib.ReadLine + // void unittest_algo_lib_Ceiling(); // gstatic/atfdb.unittest:algo_lib.Ceiling // // GetCSVToken, GetCSVTokens @@ -151,9 +153,9 @@ namespace atf_unit { // update-hdr // // // - // void unittest_algo_lib_CSVTokens(); - // void unittest_algo_lib_Strfind(); - // void unittest_algo_lib_PrintSsim(); + // void unittest_algo_lib_CSVTokens(); // gstatic/atfdb.unittest:algo_lib.CSVTokens + // void unittest_algo_lib_Strfind(); // gstatic/atfdb.unittest:algo_lib.Strfind + // void unittest_algo_lib_PrintSsim(); // gstatic/atfdb.unittest:algo_lib.PrintSsim // // Min, Max, Floor, Round, Ceiling, UpdateMin, UpdateMax @@ -161,262 +163,285 @@ namespace atf_unit { // update-hdr // // // - // void unittest_algo_lib_MinMax(); - // void unittest_algo_lib_NToh(); - // void unittest_algo_lib_ParseNumber_Overflow1(); - // void unittest_algo_lib_ParseNumber_Overflow2(); - // void unittest_algo_lib_ParseNumber_Overflow3(); - // void unittest_algo_lib_PrintDoubleWithCommas(); - // void unittest_algo_lib_PrintCppQuoted(); - // void unittest_algo_lib_PrintPad(); - // void unittest_algo_lib_PrintHex(); - // void unittest_algo_lib_TestString(); - // void unittest_algo_lib_TestStringFmt(); - // void unittest_algo_lib_TestStringFmt2(); - // void unittest_algo_lib_TestStringFmt3(); - // void unittest_algo_lib_Smallstr(); - // void unittest_algo_lib_StringIter(); - // void unittest_algo_lib_test_strptr(); + // void unittest_algo_lib_MinMax(); // gstatic/atfdb.unittest:algo_lib.MinMax + // void unittest_algo_lib_NToh(); // gstatic/atfdb.unittest:algo_lib.NToh + // void unittest_algo_lib_ParseNumber_Overflow1(); // gstatic/atfdb.unittest:algo_lib.ParseNumber_Overflow1 + // void unittest_algo_lib_ParseNumber_Overflow2(); // gstatic/atfdb.unittest:algo_lib.ParseNumber_Overflow2 + // void unittest_algo_lib_ParseNumber_Overflow3(); // gstatic/atfdb.unittest:algo_lib.ParseNumber_Overflow3 + // void unittest_algo_lib_PrintDoubleWithCommas(); // gstatic/atfdb.unittest:algo_lib.PrintDoubleWithCommas + // void unittest_algo_lib_PrintCppQuoted(); // gstatic/atfdb.unittest:algo_lib.PrintCppQuoted + // void unittest_algo_lib_PrintPad(); // gstatic/atfdb.unittest:algo_lib.PrintPad + // void unittest_algo_lib_PrintHex(); // gstatic/atfdb.unittest:algo_lib.PrintHex + // void unittest_algo_lib_TestString(); // gstatic/atfdb.unittest:algo_lib.TestString + // void unittest_algo_lib_TestStringFmt(); // gstatic/atfdb.unittest:algo_lib.TestStringFmt + // void unittest_algo_lib_TestStringFmt2(); // gstatic/atfdb.unittest:algo_lib.TestStringFmt2 + // void unittest_algo_lib_TestStringFmt3(); // gstatic/atfdb.unittest:algo_lib.TestStringFmt3 + // void unittest_algo_lib_Smallstr(); // gstatic/atfdb.unittest:algo_lib.Smallstr + // void unittest_algo_lib_StringIter(); // gstatic/atfdb.unittest:algo_lib.StringIter + // void unittest_algo_lib_test_strptr(); // gstatic/atfdb.unittest:algo_lib.test_strptr // The reasons why not to use library calls to setup fixtures - // 1) Test condition should be "clean" as much as possible and // 2) library under test may interfere test results - // void unittest_algo_lib_ParseOct1(); - // void unittest_algo_lib_ParseHex1(); - // void unittest_algo_lib_ParseOct3(); - // void unittest_algo_lib_ParseHex2(); - // void unittest_algo_lib_UnescapeC(); - // void unittest_algo_lib_ParseURL1(); - // void unittest_algo_lib_PerfParseNum(); - // void unittest_algo_lib_DirBeg(); - // void unittest_algo_lib_RemDirRecurse(); - // void unittest_algo_lib_ReadModuleId(); - // void unittest_algo_lib_Tempfile(); - // void unittest_algo_lib_NextSep(); - // void unittest_algo_lib_I32Dec3Fmt(); - // void unittest_algo_lib_OrderID(); - // void unittest_algo_lib_IntPrice(); - // void unittest_algo_lib_Keyval(); - // void unittest_algo_lib_StringToFile(); - // void unittest_algo_lib_U128PrintHex(); - // void unittest_algo_lib_FileToString(); - // void unittest_algo_lib_CheckIpmask(); - // void unittest_algo_lib_TimeConstants(); - // void unittest_algo_lib_Datecache(); - // void unittest_algo_lib_Cmp(); - // void unittest_algo_lib_SchedTime(); - // void unittest_algo_lib_StringSubrange(); - // void unittest_algo_lib_Clipped(); - // void unittest_algo_lib_Abs(); - // void unittest_algo_lib_PerfMinMaxAvg(); - // void unittest_algo_lib_PerfIntrinsics(); - // void unittest_algo_lib_PerfTruncVsFtol(); - // void unittest_algo_lib_PerfParseDouble(); - // void unittest_algo_lib_PerfSort(); - // void unittest_algo_lib_Replscope(); - // void unittest_algo_lib_AvlvsMap(); - // void unittest_algo_lib_Sleep(); - // void unittest_algo_lib_strptr_Eq(); - // void unittest_algo_lib_SysEval(); - // void unittest_algo_lib_TrimZerosRight(); - // void unittest_algo_lib_PrintWithCommas(); - // void unittest_algo_lib_FTruncate(); - // void unittest_algo_lib_GetCpuHz(); - // void unittest_algo_lib_flock(); - // void unittest_algo_lib_u128(); - // void unittest_algo_lib_Mmap(); - // void unittest_algo_lib_FileQ(); - // void unittest_algo_lib_ExitCode(); - // void unittest_algo_lib_KillRecurse(); + // void unittest_algo_lib_ParseOct1(); // gstatic/atfdb.unittest:algo_lib.ParseOct1 + // void unittest_algo_lib_ParseHex1(); // gstatic/atfdb.unittest:algo_lib.ParseHex1 + // void unittest_algo_lib_ParseOct3(); // gstatic/atfdb.unittest:algo_lib.ParseOct3 + // void unittest_algo_lib_ParseHex2(); // gstatic/atfdb.unittest:algo_lib.ParseHex2 + // void unittest_algo_lib_UnescapeC(); // gstatic/atfdb.unittest:algo_lib.UnescapeC + // void unittest_algo_lib_ParseURL1(); // gstatic/atfdb.unittest:algo_lib.ParseURL1 + // void unittest_algo_lib_PerfParseNum(); // gstatic/atfdb.unittest:algo_lib.PerfParseNum + // void unittest_algo_lib_DirBeg(); // gstatic/atfdb.unittest:algo_lib.DirBeg + // void unittest_algo_lib_RemDirRecurse(); // gstatic/atfdb.unittest:algo_lib.RemDirRecurse + // void unittest_algo_lib_ReadModuleId(); // gstatic/atfdb.unittest:algo_lib.ReadModuleId + // void unittest_algo_lib_Tempfile(); // gstatic/atfdb.unittest:algo_lib.Tempfile + // void unittest_algo_lib_NextSep(); // gstatic/atfdb.unittest:algo_lib.NextSep + // void unittest_algo_lib_I32Dec3Fmt(); // gstatic/atfdb.unittest:algo_lib.I32Dec3Fmt + // void unittest_algo_lib_OrderID(); // gstatic/atfdb.unittest:algo_lib.OrderID + // void unittest_algo_lib_IntPrice(); // gstatic/atfdb.unittest:algo_lib.IntPrice + // void unittest_algo_lib_Keyval(); // gstatic/atfdb.unittest:algo_lib.Keyval + // void unittest_algo_lib_StringToFile(); // gstatic/atfdb.unittest:algo_lib.StringToFile + // void unittest_algo_lib_U128PrintHex(); // gstatic/atfdb.unittest:algo_lib.U128PrintHex + // void unittest_algo_lib_FileToString(); // gstatic/atfdb.unittest:algo_lib.FileToString + // void unittest_algo_lib_CheckIpmask(); // gstatic/atfdb.unittest:algo_lib.CheckIpmask + // void unittest_algo_lib_TimeConstants(); // gstatic/atfdb.unittest:algo_lib.TimeConstants + // void unittest_algo_lib_Datecache(); // gstatic/atfdb.unittest:algo_lib.Datecache + // void unittest_algo_lib_Cmp(); // gstatic/atfdb.unittest:algo_lib.Cmp + // void unittest_algo_lib_SchedTime(); // gstatic/atfdb.unittest:algo_lib.SchedTime + // void unittest_algo_lib_StringSubrange(); // gstatic/atfdb.unittest:algo_lib.StringSubrange + // void unittest_algo_lib_Clipped(); // gstatic/atfdb.unittest:algo_lib.Clipped + // void unittest_algo_lib_Abs(); // gstatic/atfdb.unittest:algo_lib.Abs + // void unittest_algo_lib_PerfMinMaxAvg(); // gstatic/atfdb.unittest:algo_lib.PerfMinMaxAvg + // void unittest_algo_lib_PerfIntrinsics(); // gstatic/atfdb.unittest:algo_lib.PerfIntrinsics + // void unittest_algo_lib_PerfTruncVsFtol(); // gstatic/atfdb.unittest:algo_lib.PerfTruncVsFtol + // void unittest_algo_lib_PerfParseDouble(); // gstatic/atfdb.unittest:algo_lib.PerfParseDouble + // void unittest_algo_lib_PerfSort(); // gstatic/atfdb.unittest:algo_lib.PerfSort + // void unittest_algo_lib_Replscope(); // gstatic/atfdb.unittest:algo_lib.Replscope + // void unittest_algo_lib_ReplscopeSharedPrefix(); // gstatic/atfdb.unittest:algo_lib.ReplscopeSharedPrefix + // void unittest_algo_lib_AvlvsMap(); // gstatic/atfdb.unittest:algo_lib.AvlvsMap + // void unittest_algo_lib_Sleep(); // gstatic/atfdb.unittest:algo_lib.Sleep + // void unittest_algo_lib_strptr_Eq(); // gstatic/atfdb.unittest:algo_lib.strptr_Eq + // void unittest_algo_lib_SysEval(); // gstatic/atfdb.unittest:algo_lib.SysEval + // void unittest_algo_lib_TrimZerosRight(); // gstatic/atfdb.unittest:algo_lib.TrimZerosRight + // void unittest_algo_lib_PrintWithCommas(); // gstatic/atfdb.unittest:algo_lib.PrintWithCommas + // void unittest_algo_lib_FTruncate(); // gstatic/atfdb.unittest:algo_lib.FTruncate + // void unittest_algo_lib_GetCpuHz(); // gstatic/atfdb.unittest:algo_lib.GetCpuHz + // void unittest_algo_lib_flock(); // gstatic/atfdb.unittest:algo_lib.flock + // void unittest_algo_lib_u128(); // gstatic/atfdb.unittest:algo_lib.u128 + // void unittest_algo_lib_Mmap(); // gstatic/atfdb.unittest:algo_lib.Mmap + // void unittest_algo_lib_FileQ(); // gstatic/atfdb.unittest:algo_lib.FileQ + // void unittest_algo_lib_ExitCode(); // gstatic/atfdb.unittest:algo_lib.ExitCode + // void unittest_algo_lib_KillRecurse(); // gstatic/atfdb.unittest:algo_lib.KillRecurse // check that all characters print from memptr, and get parsed // back as a string - // void unittest_algo_lib_PrintMemptr(); + // void unittest_algo_lib_PrintMemptr(); // gstatic/atfdb.unittest:algo_lib.PrintMemptr bool Smallstr150_Eq(const algo::Smallstr150 & lhs,const algo::Smallstr150 & rhs); // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_SmallstrEq(); - // void unittest_algo_lib_ReverseBits(); + // void unittest_algo_lib_SmallstrEq(); // gstatic/atfdb.unittest:algo_lib.SmallstrEq + // void unittest_algo_lib_ReverseBits(); // gstatic/atfdb.unittest:algo_lib.ReverseBits + // void unittest_algo_lib_Zigzag(); // gstatic/atfdb.unittest:algo_lib.Zigzag + + // Test that a file opened in append mode always writes at the end + // regardless of file position + // void unittest_algo_lib_FileAppend(); // gstatic/atfdb.unittest:algo_lib.FileAppend + // void unittest_algo_lib_Url(); // gstatic/atfdb.unittest:algo_lib.Url // ------------------------------------------------------------------- // cpp/atf_unit/algo_txttbl.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_Txttbl(); + // void unittest_algo_lib_Txttbl(); // gstatic/atfdb.unittest:algo_lib.Txttbl // ------------------------------------------------------------------- // cpp/atf_unit/ams.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_ams_StreamId(); + // void unittest_ams_StreamId(); // gstatic/atfdb.unittest:ams.StreamId // ------------------------------------------------------------------- // cpp/atf_unit/bash.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_PrintBash(); + // void unittest_algo_lib_PrintBash(); // gstatic/atfdb.unittest:algo_lib.PrintBash // ------------------------------------------------------------------- // cpp/atf_unit/charset.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_Charset(); + // void unittest_algo_lib_Charset(); // gstatic/atfdb.unittest:algo_lib.Charset // ------------------------------------------------------------------- // cpp/atf_unit/decimal.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_Decimal(); + // void unittest_algo_lib_Decimal(); // gstatic/atfdb.unittest:algo_lib.Decimal // ------------------------------------------------------------------- // cpp/atf_unit/fm.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_fm(); + // void unittest_fm(); // gstatic/atfdb.unittest:fm // ------------------------------------------------------------------- // cpp/atf_unit/lib_ams.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_lib_ams_Test1(); - // void unittest_ams_sendtest(); + // void unittest_lib_ams_Test1(); // gstatic/atfdb.unittest:lib_ams.Test1 + // void unittest_ams_sendtest(); // gstatic/atfdb.unittest:ams_sendtest + + // ------------------------------------------------------------------- + // cpp/atf_unit/lib_curl.cpp + // + // (user-implemented function, prototype is in amc-generated header) + // void unittest_lib_curl_GET_Echo(); // gstatic/atfdb.unittest:lib_curl.GET_Echo + // void unittest_lib_curl_POST_JSON(); // gstatic/atfdb.unittest:lib_curl.POST_JSON + // void unittest_lib_curl_PUT_PLAINTEXT(); // gstatic/atfdb.unittest:lib_curl.PUT_PLAINTEXT + // void unittest_lib_curl_STATUS_200(); // gstatic/atfdb.unittest:lib_curl.STATUS_200 // ------------------------------------------------------------------- // cpp/atf_unit/lib_exec.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_lib_exec_Parallel1(); - // void unittest_lib_exec_TooManyFds(); - // void unittest_lib_exec_Timeout(); - // void unittest_lib_exec_Dependency(); + // void unittest_lib_exec_Parallel1(); // gstatic/atfdb.unittest:lib_exec.Parallel1 + // void unittest_lib_exec_TooManyFds(); // gstatic/atfdb.unittest:lib_exec.TooManyFds + // void unittest_lib_exec_Timeout(); // gstatic/atfdb.unittest:lib_exec.Timeout + // void unittest_lib_exec_Dependency(); // gstatic/atfdb.unittest:lib_exec.Dependency // ------------------------------------------------------------------- // cpp/atf_unit/lib_json.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_lib_json_Empty(); - // void unittest_lib_json_TokenNull(); - // void unittest_lib_json_TokenFalse(); - // void unittest_lib_json_TokenTrue(); - // void unittest_lib_json_SimpleNumber(); - // void unittest_lib_json_SimpleString(); - // void unittest_lib_json_EmptyArray(); - // void unittest_lib_json_Emptyobject(); - // void unittest_lib_json_SecString(); - // void unittest_lib_json_NumberZero(); - // void unittest_lib_json_NumberManyDigits(); - // void unittest_lib_json_NumberDecimal(); - // void unittest_lib_json_NumberExponent1(); - // void unittest_lib_json_NumberExponent2(); - // void unittest_lib_json_NumberCombined1(); - // void unittest_lib_json_NumberCombined2(); - // void unittest_lib_json_StringEmpty(); - // void unittest_lib_json_StringWithEscapes(); - // void unittest_lib_json_ObjFieldTokenNull(); - // void unittest_lib_json_ObjFieldTokenFalse(); - // void unittest_lib_json_ObjFieldTokenTrue(); - // void unittest_lib_json_ObjFieldSimpleNumber(); - // void unittest_lib_json_ObjFieldSimpleString(); - // void unittest_lib_json_ObjFieldEmptyArray(); - // void unittest_lib_json_ObjFieldEmptyObject(); - // void unittest_lib_json_ObjFieldAll(); - // void unittest_lib_json_ArrayTokenNull(); - // void unittest_lib_json_ArrayTokenFalse(); - // void unittest_lib_json_ArrayTokenTrue(); - // void unittest_lib_json_ArraySimpleNumber(); - // void unittest_lib_json_ArraySimpleString(); - // void unittest_lib_json_ArrayEmptyArray(); - // void unittest_lib_json_ArrayEmptyObject(); - // void unittest_lib_json_ArrayAll(); - // void unittest_lib_json_Typical(); - // void unittest_lib_json_CtrlCharEscape(); - // void unittest_lib_json_ErrorBadToken1(); - // void unittest_lib_json_ErrorBadToken2(); - // void unittest_lib_json_ErrorBadNumber(); - // void unittest_lib_json_ErrorBadString1(); - // void unittest_lib_json_ErrorBadString2(); - // void unittest_lib_json_ErrorBadString3(); - // void unittest_lib_json_ErrorBadUString1(); - // void unittest_lib_json_ErrorBadUString2(); - // void unittest_lib_json_ErrorBadUString3(); - // void unittest_lib_json_ErrorBadUString4(); - // void unittest_lib_json_ErrorBadUString5(); - // void unittest_lib_json_ErrorBadUString6(); - // void unittest_lib_json_ErrorBadUString7(); - // void unittest_lib_json_ErrorBrMismatch1(); - // void unittest_lib_json_ErrorBrMismatch2(); - // void unittest_lib_json_ErrorBrMismatch3(); - // void unittest_lib_json_ErrorBrMismatch4(); - // void unittest_lib_json_ErrorBrMismatch5(); - // void unittest_lib_json_ErrorBrMismatch6(); - // void unittest_lib_json_ErrorBrMismatch7(); - // void unittest_lib_json_ErrorBrMismatch8(); - // void unittest_lib_json_ErrorBrMismatch9(); - // void unittest_lib_json_ErrorBrMismatch10(); - // void unittest_lib_json_ErrorBrMismatch11(); - // void unittest_lib_json_ErrorBrMismatch12(); - // void unittest_lib_json_ErrorBrMismatch13(); - // void unittest_lib_json_ErrorBrMismatch14(); - // void unittest_lib_json_ErrorArrayComma1(); - // void unittest_lib_json_ErrorArrayComma2(); - // void unittest_lib_json_ErrorArrayComma3(); - // void unittest_lib_json_ErrorArrayComma4(); - // void unittest_lib_json_ErrorObjectComma1(); - // void unittest_lib_json_ErrorObjectComma2(); - // void unittest_lib_json_ErrorObjectComma3(); - // void unittest_lib_json_ErrorObjectComma4(); - // void unittest_lib_json_ErrorBareComma(); - // void unittest_lib_json_ErrorBareValuesWithComma(); - // void unittest_lib_json_ErrorObjectNoValue(); - // void unittest_lib_json_ErrorObjectColon1(); - // void unittest_lib_json_ErrorObjectColon2(); - // void unittest_lib_json_ErrorObjectColon3(); - // void unittest_lib_json_ErrorObjectColon4(); - // void unittest_lib_json_ErrorObjectColon5(); - // void unittest_lib_json_ErrorBareColon(); - // void unittest_lib_json_ErrorArrayColon(); + // void unittest_lib_json_Empty(); // gstatic/atfdb.unittest:lib_json.Empty + // void unittest_lib_json_TokenNull(); // gstatic/atfdb.unittest:lib_json.TokenNull + // void unittest_lib_json_TokenFalse(); // gstatic/atfdb.unittest:lib_json.TokenFalse + // void unittest_lib_json_TokenTrue(); // gstatic/atfdb.unittest:lib_json.TokenTrue + // void unittest_lib_json_SimpleNumber(); // gstatic/atfdb.unittest:lib_json.SimpleNumber + // void unittest_lib_json_SimpleString(); // gstatic/atfdb.unittest:lib_json.SimpleString + // void unittest_lib_json_EmptyArray(); // gstatic/atfdb.unittest:lib_json.EmptyArray + // void unittest_lib_json_Emptyobject(); // gstatic/atfdb.unittest:lib_json.Emptyobject + // void unittest_lib_json_SecString(); // gstatic/atfdb.unittest:lib_json.SecString + // void unittest_lib_json_NumberZero(); // gstatic/atfdb.unittest:lib_json.NumberZero + // void unittest_lib_json_NumberManyDigits(); // gstatic/atfdb.unittest:lib_json.NumberManyDigits + // void unittest_lib_json_NumberDecimal(); // gstatic/atfdb.unittest:lib_json.NumberDecimal + // void unittest_lib_json_NumberExponent1(); // gstatic/atfdb.unittest:lib_json.NumberExponent1 + // void unittest_lib_json_NumberExponent2(); // gstatic/atfdb.unittest:lib_json.NumberExponent2 + // void unittest_lib_json_NumberCombined1(); // gstatic/atfdb.unittest:lib_json.NumberCombined1 + // void unittest_lib_json_NumberCombined2(); // gstatic/atfdb.unittest:lib_json.NumberCombined2 + // void unittest_lib_json_StringEmpty(); // gstatic/atfdb.unittest:lib_json.StringEmpty + // void unittest_lib_json_StringWithEscapes(); // gstatic/atfdb.unittest:lib_json.StringWithEscapes + // void unittest_lib_json_ObjFieldTokenNull(); // gstatic/atfdb.unittest:lib_json.ObjFieldTokenNull + // void unittest_lib_json_ObjFieldTokenFalse(); // gstatic/atfdb.unittest:lib_json.ObjFieldTokenFalse + // void unittest_lib_json_ObjFieldTokenTrue(); // gstatic/atfdb.unittest:lib_json.ObjFieldTokenTrue + // void unittest_lib_json_ObjFieldSimpleNumber(); // gstatic/atfdb.unittest:lib_json.ObjFieldSimpleNumber + // void unittest_lib_json_ObjFieldSimpleString(); // gstatic/atfdb.unittest:lib_json.ObjFieldSimpleString + // void unittest_lib_json_ObjFieldEmptyArray(); // gstatic/atfdb.unittest:lib_json.ObjFieldEmptyArray + // void unittest_lib_json_ObjFieldEmptyObject(); // gstatic/atfdb.unittest:lib_json.ObjFieldEmptyObject + // void unittest_lib_json_ObjFieldAll(); // gstatic/atfdb.unittest:lib_json.ObjFieldAll + // void unittest_lib_json_ArrayTokenNull(); // gstatic/atfdb.unittest:lib_json.ArrayTokenNull + // void unittest_lib_json_ArrayTokenFalse(); // gstatic/atfdb.unittest:lib_json.ArrayTokenFalse + // void unittest_lib_json_ArrayTokenTrue(); // gstatic/atfdb.unittest:lib_json.ArrayTokenTrue + // void unittest_lib_json_ArraySimpleNumber(); // gstatic/atfdb.unittest:lib_json.ArraySimpleNumber + // void unittest_lib_json_ArraySimpleString(); // gstatic/atfdb.unittest:lib_json.ArraySimpleString + // void unittest_lib_json_ArrayEmptyArray(); // gstatic/atfdb.unittest:lib_json.ArrayEmptyArray + // void unittest_lib_json_ArrayEmptyObject(); // gstatic/atfdb.unittest:lib_json.ArrayEmptyObject + // void unittest_lib_json_ArrayAll(); // gstatic/atfdb.unittest:lib_json.ArrayAll + // void unittest_lib_json_Typical(); // gstatic/atfdb.unittest:lib_json.Typical + // void unittest_lib_json_CtrlCharEscape(); // gstatic/atfdb.unittest:lib_json.CtrlCharEscape + // void unittest_lib_json_ErrorBadToken1(); // gstatic/atfdb.unittest:lib_json.ErrorBadToken1 + // void unittest_lib_json_ErrorBadToken2(); // gstatic/atfdb.unittest:lib_json.ErrorBadToken2 + // void unittest_lib_json_ErrorBadNumber(); // gstatic/atfdb.unittest:lib_json.ErrorBadNumber + // void unittest_lib_json_ErrorBadString1(); // gstatic/atfdb.unittest:lib_json.ErrorBadString1 + // void unittest_lib_json_ErrorBadString2(); // gstatic/atfdb.unittest:lib_json.ErrorBadString2 + // void unittest_lib_json_ErrorBadString3(); // gstatic/atfdb.unittest:lib_json.ErrorBadString3 + // void unittest_lib_json_ErrorBadUString1(); // gstatic/atfdb.unittest:lib_json.ErrorBadUString1 + // void unittest_lib_json_ErrorBadUString2(); // gstatic/atfdb.unittest:lib_json.ErrorBadUString2 + // void unittest_lib_json_ErrorBadUString3(); // gstatic/atfdb.unittest:lib_json.ErrorBadUString3 + // void unittest_lib_json_ErrorBadUString4(); // gstatic/atfdb.unittest:lib_json.ErrorBadUString4 + // void unittest_lib_json_ErrorBadUString5(); // gstatic/atfdb.unittest:lib_json.ErrorBadUString5 + // void unittest_lib_json_ErrorBadUString6(); // gstatic/atfdb.unittest:lib_json.ErrorBadUString6 + // void unittest_lib_json_ErrorBadUString7(); // gstatic/atfdb.unittest:lib_json.ErrorBadUString7 + // void unittest_lib_json_ErrorBrMismatch1(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch1 + // void unittest_lib_json_ErrorBrMismatch2(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch2 + // void unittest_lib_json_ErrorBrMismatch3(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch3 + // void unittest_lib_json_ErrorBrMismatch4(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch4 + // void unittest_lib_json_ErrorBrMismatch5(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch5 + // void unittest_lib_json_ErrorBrMismatch6(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch6 + // void unittest_lib_json_ErrorBrMismatch7(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch7 + // void unittest_lib_json_ErrorBrMismatch8(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch8 + // void unittest_lib_json_ErrorBrMismatch9(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch9 + // void unittest_lib_json_ErrorBrMismatch10(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch10 + // void unittest_lib_json_ErrorBrMismatch11(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch11 + // void unittest_lib_json_ErrorBrMismatch12(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch12 + // void unittest_lib_json_ErrorBrMismatch13(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch13 + // void unittest_lib_json_ErrorBrMismatch14(); // gstatic/atfdb.unittest:lib_json.ErrorBrMismatch14 + // void unittest_lib_json_ErrorArrayComma1(); // gstatic/atfdb.unittest:lib_json.ErrorArrayComma1 + // void unittest_lib_json_ErrorArrayComma2(); // gstatic/atfdb.unittest:lib_json.ErrorArrayComma2 + // void unittest_lib_json_ErrorArrayComma3(); // gstatic/atfdb.unittest:lib_json.ErrorArrayComma3 + // void unittest_lib_json_ErrorArrayComma4(); // gstatic/atfdb.unittest:lib_json.ErrorArrayComma4 + // void unittest_lib_json_ErrorObjectComma1(); // gstatic/atfdb.unittest:lib_json.ErrorObjectComma1 + // void unittest_lib_json_ErrorObjectComma2(); // gstatic/atfdb.unittest:lib_json.ErrorObjectComma2 + // void unittest_lib_json_ErrorObjectComma3(); // gstatic/atfdb.unittest:lib_json.ErrorObjectComma3 + // void unittest_lib_json_ErrorObjectComma4(); // gstatic/atfdb.unittest:lib_json.ErrorObjectComma4 + // void unittest_lib_json_ErrorBareComma(); // gstatic/atfdb.unittest:lib_json.ErrorBareComma + // void unittest_lib_json_ErrorBareValuesWithComma(); // gstatic/atfdb.unittest:lib_json.ErrorBareValuesWithComma + // void unittest_lib_json_ErrorObjectNoValue(); // gstatic/atfdb.unittest:lib_json.ErrorObjectNoValue + // void unittest_lib_json_ErrorObjectColon1(); // gstatic/atfdb.unittest:lib_json.ErrorObjectColon1 + // void unittest_lib_json_ErrorObjectColon2(); // gstatic/atfdb.unittest:lib_json.ErrorObjectColon2 + // void unittest_lib_json_ErrorObjectColon3(); // gstatic/atfdb.unittest:lib_json.ErrorObjectColon3 + // void unittest_lib_json_ErrorObjectColon4(); // gstatic/atfdb.unittest:lib_json.ErrorObjectColon4 + // void unittest_lib_json_ErrorObjectColon5(); // gstatic/atfdb.unittest:lib_json.ErrorObjectColon5 + // void unittest_lib_json_ErrorBareColon(); // gstatic/atfdb.unittest:lib_json.ErrorBareColon + // void unittest_lib_json_ErrorArrayColon(); // gstatic/atfdb.unittest:lib_json.ErrorArrayColon + // matches known generated affix atf_unit.unittest_ // void unittest_lib_json_ErrorBareValuesWithColon(); - // void unittest_lib_json_ErrorObjectDupField(); - // void unittest_lib_json_FmtJson_u64_0(); - // void unittest_lib_json_FmtJson_u64_max(); - // void unittest_lib_json_FmtJson_u32_0(); - // void unittest_lib_json_FmtJson_u32_max(); - // void unittest_lib_json_FmtJson_u16_0(); - // void unittest_lib_json_FmtJson_u16_max(); - // void unittest_lib_json_FmtJson_u8_0(); - // void unittest_lib_json_FmtJson_u8_max(); - // void unittest_lib_json_FmtJson_i64_min(); - // void unittest_lib_json_FmtJson_i64_max(); - // void unittest_lib_json_FmtJson_i32_min(); - // void unittest_lib_json_FmtJson_i32_max(); - // void unittest_lib_json_FmtJson_i16_min(); - // void unittest_lib_json_FmtJson_i16_max(); - // void unittest_lib_json_FmtJson_i8_min(); - // void unittest_lib_json_FmtJson_i8_max(); - // void unittest_lib_json_FmtJson_double_prec(); - // void unittest_lib_json_FmtJson_float_prec(); - // void unittest_lib_json_FmtJson_bool_true(); - // void unittest_lib_json_FmtJson_bool_false(); - // void unittest_lib_json_FmtJson_char(); - // void unittest_lib_json_FmtJson_TypeA(); - // void unittest_lib_json_FmtJson_Object(); + // void unittest_lib_json_ErrorObjectDupField(); // gstatic/atfdb.unittest:lib_json.ErrorObjectDupField + // void unittest_lib_json_FmtJson_u64_0(); // gstatic/atfdb.unittest:lib_json.FmtJson_u64_0 + // void unittest_lib_json_FmtJson_u64_max(); // gstatic/atfdb.unittest:lib_json.FmtJson_u64_max + // void unittest_lib_json_FmtJson_u32_0(); // gstatic/atfdb.unittest:lib_json.FmtJson_u32_0 + // void unittest_lib_json_FmtJson_u32_max(); // gstatic/atfdb.unittest:lib_json.FmtJson_u32_max + // void unittest_lib_json_FmtJson_u16_0(); // gstatic/atfdb.unittest:lib_json.FmtJson_u16_0 + // void unittest_lib_json_FmtJson_u16_max(); // gstatic/atfdb.unittest:lib_json.FmtJson_u16_max + // void unittest_lib_json_FmtJson_u8_0(); // gstatic/atfdb.unittest:lib_json.FmtJson_u8_0 + // void unittest_lib_json_FmtJson_u8_max(); // gstatic/atfdb.unittest:lib_json.FmtJson_u8_max + // void unittest_lib_json_FmtJson_i64_min(); // gstatic/atfdb.unittest:lib_json.FmtJson_i64_min + // void unittest_lib_json_FmtJson_i64_max(); // gstatic/atfdb.unittest:lib_json.FmtJson_i64_max + // void unittest_lib_json_FmtJson_i32_min(); // gstatic/atfdb.unittest:lib_json.FmtJson_i32_min + // void unittest_lib_json_FmtJson_i32_max(); // gstatic/atfdb.unittest:lib_json.FmtJson_i32_max + // void unittest_lib_json_FmtJson_i16_min(); // gstatic/atfdb.unittest:lib_json.FmtJson_i16_min + // void unittest_lib_json_FmtJson_i16_max(); // gstatic/atfdb.unittest:lib_json.FmtJson_i16_max + // void unittest_lib_json_FmtJson_i8_min(); // gstatic/atfdb.unittest:lib_json.FmtJson_i8_min + // void unittest_lib_json_FmtJson_i8_max(); // gstatic/atfdb.unittest:lib_json.FmtJson_i8_max + // void unittest_lib_json_FmtJson_double_prec(); // gstatic/atfdb.unittest:lib_json.FmtJson_double_prec + // void unittest_lib_json_FmtJson_float_prec(); // gstatic/atfdb.unittest:lib_json.FmtJson_float_prec + // void unittest_lib_json_FmtJson_bool_true(); // gstatic/atfdb.unittest:lib_json.FmtJson_bool_true + // void unittest_lib_json_FmtJson_bool_false(); // gstatic/atfdb.unittest:lib_json.FmtJson_bool_false + // void unittest_lib_json_FmtJson_char(); // gstatic/atfdb.unittest:lib_json.FmtJson_char + // void unittest_lib_json_FmtJson_TypeA(); // gstatic/atfdb.unittest:lib_json.FmtJson_TypeA + // void unittest_lib_json_FmtJson_Object(); // gstatic/atfdb.unittest:lib_json.FmtJson_Object + + // ------------------------------------------------------------------- + // cpp/atf_unit/lib_netio.cpp + // + // (user-implemented function, prototype is in amc-generated header) + // void unittest_lib_netio_GetHostAddr(); // gstatic/atfdb.unittest:lib_netio_GetHostAddr // ------------------------------------------------------------------- // cpp/atf_unit/lib_sql.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_lib_sql_Main(); + // void unittest_lib_sql_Main(); // gstatic/atfdb.unittest:lib_sql.Main // ------------------------------------------------------------------- // cpp/atf_unit/line.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_FileLine_curs(); + // void unittest_algo_lib_FileLine_curs(); // gstatic/atfdb.unittest:algo_lib.FileLine_curs // ------------------------------------------------------------------- // cpp/atf_unit/lockfile.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_Lockfile(); + // void unittest_algo_lib_Lockfile(); // gstatic/atfdb.unittest:algo_lib.Lockfile // ------------------------------------------------------------------- // cpp/atf_unit/main.cpp @@ -430,7 +455,7 @@ namespace atf_unit { // update-hdr // Run specified test (called both with -nofork and without) void Main_StartTest(atf_unit::FUnittest &test, lib_exec::FSyscmd *start, lib_exec::FSyscmd *end); // (user-implemented function, prototype is in amc-generated header) - // void unittest_amc_Unit(); + // void unittest_amc_Unit(); // gstatic/atfdb.unittest:amc.Unit // usage: // DO_PERF_TEST("Testing XYZ",xyz()); @@ -439,58 +464,58 @@ namespace atf_unit { // update-hdr void Testcmp(const char *file, int line, strptr value, strptr expect, bool eq); void Testcmp(const char *file, int line, const char *value, const char *expect, bool eq); // (user-implemented function, prototype is in amc-generated header) - // void unittest_atf_unit_Outfile(); - void Main(); + // void unittest_atf_unit_Outfile(); // gstatic/atfdb.unittest:atf_unit.Outfile + // void Main(); // main:atf_unit // ------------------------------------------------------------------- // cpp/atf_unit/parsenum.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_ParseNumber(); + // void unittest_algo_lib_ParseNumber(); // gstatic/atfdb.unittest:algo_lib.ParseNumber // ------------------------------------------------------------------- // cpp/atf_unit/regx.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_Regx(); + // void unittest_algo_lib_Regx(); // gstatic/atfdb.unittest:algo_lib.Regx // Test that matching a huge string with a regex that // ends in .* is fast. - // void unittest_algo_lib_RegxShortCircuit(); - // void unittest_algo_lib_RegxReadTwice(); - // void unittest_algo_lib_RegxReadTwice2(); + // void unittest_algo_lib_RegxShortCircuit(); // gstatic/atfdb.unittest:algo_lib.RegxShortCircuit + // void unittest_algo_lib_RegxReadTwice(); // gstatic/atfdb.unittest:algo_lib.RegxReadTwice + // void unittest_algo_lib_RegxReadTwice2(); // gstatic/atfdb.unittest:algo_lib.RegxReadTwice2 // ------------------------------------------------------------------- // cpp/atf_unit/string.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_SubstringIndex(); - // void unittest_algo_lib_Aligned(); - // void unittest_algo_lib_CString(); - // void unittest_algo_lib_StringFind(); - // void unittest_algo_lib_StringCase(); - // void unittest_algo_lib_Tabulate(); - // void unittest_algo_lib_StringSepCurs(); + // void unittest_algo_lib_SubstringIndex(); // gstatic/atfdb.unittest:algo_lib.SubstringIndex + // void unittest_algo_lib_Aligned(); // gstatic/atfdb.unittest:algo_lib.Aligned + // void unittest_algo_lib_CString(); // gstatic/atfdb.unittest:algo_lib.CString + // void unittest_algo_lib_StringFind(); // gstatic/atfdb.unittest:algo_lib.StringFind + // void unittest_algo_lib_StringCase(); // gstatic/atfdb.unittest:algo_lib.StringCase + // void unittest_algo_lib_Tabulate(); // gstatic/atfdb.unittest:algo_lib.Tabulate + // void unittest_algo_lib_StringSepCurs(); // gstatic/atfdb.unittest:algo_lib.StringSepCurs // ------------------------------------------------------------------- // cpp/atf_unit/time.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_TimeConversion(); - // void unittest_algo_lib_TstampCache(); - // void unittest_algo_lib_PrintUnTime(); - // void unittest_algo_lib_ParseUnTime(); - // void unittest_algo_lib_DayName(); - // void unittest_algo_lib_CurrentTime(); - // void unittest_algo_lib_TimeConvert(); + // void unittest_algo_lib_TimeConversion(); // gstatic/atfdb.unittest:algo_lib.TimeConversion + // void unittest_algo_lib_TstampCache(); // gstatic/atfdb.unittest:algo_lib.TstampCache + // void unittest_algo_lib_PrintUnTime(); // gstatic/atfdb.unittest:algo_lib.PrintUnTime + // void unittest_algo_lib_ParseUnTime(); // gstatic/atfdb.unittest:algo_lib.ParseUnTime + // void unittest_algo_lib_DayName(); // gstatic/atfdb.unittest:algo_lib.DayName + // void unittest_algo_lib_CurrentTime(); // gstatic/atfdb.unittest:algo_lib.CurrentTime + // void unittest_algo_lib_TimeConvert(); // gstatic/atfdb.unittest:algo_lib.TimeConvert // ------------------------------------------------------------------- // cpp/atf_unit/tuple.cpp // // (user-implemented function, prototype is in amc-generated header) - // void unittest_algo_lib_Tuple1(); - // void unittest_algo_lib_Tuple2(); + // void unittest_algo_lib_Tuple1(); // gstatic/atfdb.unittest:algo_lib.Tuple1 + // void unittest_algo_lib_Tuple2(); // gstatic/atfdb.unittest:algo_lib.Tuple2 // Check Attr_curs - // void unittest_algo_lib_Tuple(); + // void unittest_algo_lib_Tuple(); // gstatic/atfdb.unittest:algo_lib.Tuple } diff --git a/include/bash2html.h b/include/bash2html.h index 5a9ba1a5..e4be88e4 100644 --- a/include/bash2html.h +++ b/include/bash2html.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2020-2021 Astra // // License: GPL @@ -34,5 +34,6 @@ namespace bash2html { // update-hdr // ------------------------------------------------------------------- // cpp/bash2html.cpp // - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:bash2html } diff --git a/include/define.h b/include/define.h index c2a67c20..c57655c0 100644 --- a/include/define.h +++ b/include/define.h @@ -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-2013 AlgoEngineering LLC @@ -184,12 +184,13 @@ #define prlog(x) log_msg_(algo_lib_logcat_stdout,x,true) #define prerr(x) log_msg_(algo_lib_logcat_stderr,x,true) +#define prcat(cat,x) { if(UNLIKELY(algo_lib_logcat_##cat.enabled)) log_msg_(algo_lib_logcat_##cat,x,true); } +// these 4 are deprecated #define prlog_cat(cat,x) { if(UNLIKELY(cat.enabled)) log_msg_(cat,x,true); } -#define verblog(x) { if(UNLIKELY(algo_lib::_db.cmdline.verbose)) { log_msg_(algo_lib_logcat_stderr,x,true); }} -#define verblog2(x) { if(UNLIKELY(algo_lib::_db.cmdline.verbose>1)) { log_msg_(algo_lib_logcat_stderr,x,true); }} -#define verblog3(x) { if(UNLIKELY(algo_lib::_db.cmdline.verbose>2)) { log_msg_(algo_lib_logcat_stderr,x,true); }} -#define dbglog(x) { if(UNLIKELY(algo_lib::_db.cmdline.debug)) { log_msg_(algo_lib_logcat_stderr,x,true); }} +#define verblog(x) prcat(verbose,x) +#define verblog2(x) prcat(verbose2,x) +#define dbglog(x) prcat(debug,x) #ifdef constant #undef constant diff --git a/include/gcache.h b/include/gcache.h index 4442f74d..3ae66e4d 100644 --- a/include/gcache.h +++ b/include/gcache.h @@ -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 @@ -99,5 +99,6 @@ namespace gcache { // update-hdr void Pch(); // main routine - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:gcache } diff --git a/include/gcli.h b/include/gcli.h index a36e213e..6491538f 100644 --- a/include/gcli.h +++ b/include/gcli.h @@ -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 @@ -20,9 +20,9 @@ // #include "include/algo.h" -#include "include/lib_json.h" #include "include/gen/gcli_gen.h" #include "include/gen/gcli_gen.inl.h" +#define old_intf false namespace gcli { // update-hdr // Dear human: @@ -38,13 +38,14 @@ namespace gcli { // update-hdr tempstr GetCurrentGitBranch(); void PushGitBranch(strptr remote_name); void ParseGitComment(strptr issue_key,tempstr &title,tempstr &description); - void CheckGitBranchExists(strptr issue_key); + bool CheckGitBranchExists(strptr issue_key); + void GitCheckoutBranch(strptr target_branch); void GitCheckoutBranch(strptr target_branch, strptr source_branch); void GitCheckoutMasterBranch(gcli::FIssue &issue); void GitRemoveMrBranch(strptr mr_branch); // (user-implemented function, prototype is in amc-generated header) - // void gtblact_gitconfig_list(gcli::FGtblact&); - // void gtblact_gitconfig_create(gcli::FGtblact >blact); + // void gtblact_gitconfig_list(gcli::FGtblact&); // gstatic/gclidb.gtblact:gitconfig_list + // void gtblact_gitconfig_create(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:gitconfig_create // ------------------------------------------------------------------- // cpp/gcli/gtblact.cpp @@ -76,7 +77,7 @@ namespace gcli { // update-hdr // void ShowHelp(strptr gtbl_key, strptr gact_key); // (user-implemented function, prototype is in amc-generated header) - // void gtblact_help_list(gcli::FGtblact >blact); + // void gtblact_help_list(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:help_list // ------------------------------------------------------------------- // cpp/gcli/issue.cpp @@ -95,24 +96,26 @@ namespace gcli { // update-hdr gcli::FIssue & ReadSingleIssue(gcli::FGtblact >blact); tempstr Gstate(strptr gstate_key); // (user-implemented function, prototype is in amc-generated header) - // void gclicmd_issuelist(gcli::FGclicmd &gclicmd); - // void gclicmd_issuesearch(gcli::FGclicmd &gclicmd); - // void gclicmd_issuenote(gcli::FGclicmd &gclicmd); - // void gclicmd_issueadd(gcli::FGclicmd &gclicmd); - // void gclicmd_issuemod(gcli::FGclicmd &gclicmd); - // void gtblact_issue_list(gcli::FGtblact >blact); - // void gtblact_issue_update(gcli::FGtblact >blact); - // void gtblact_issue_create(gcli::FGtblact >blact); - // void gtblact_issue_start(gcli::FGtblact >blact); - // void gtblact_issue_needs_work(gcli::FGtblact >blact); - // void gtblact_issue_stop(gcli::FGtblact >blact); + // void gclicmd_issuelist(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:issuelist + // void gclicmd_issuesearch(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:issuesearch + // void gclicmd_issuenote(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:issuenote + // void gclicmd_issueadd(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:issueadd + // void gclicmd_issuemod(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:issuemod + // void gtblact_issue_list(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:issue_list + // void gtblact_issue_update(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:issue_update + // void gtblact_issue_create(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:issue_create + // void gtblact_issue_start(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:issue_start + // void gtblact_issue_needs_work(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:issue_needs_work + // void gtblact_issue_stop(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:issue_stop // ------------------------------------------------------------------- // cpp/gcli/main.cpp // + void RemoveEditFile(); gcli::FGclicmd& AddGclicmd(strptr gclicmd_key, bool argOK, strptr arg); void AddGclicmdArg(strptr gclicmd_key, strptr arg); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:gcli // ------------------------------------------------------------------- // cpp/gcli/milestone.cpp @@ -120,70 +123,70 @@ namespace gcli { // update-hdr void Main_ShowMslist(); tempstr MilestoneName(strptr proj, strptr iid); // (user-implemented function, prototype is in amc-generated header) - // void gclicmd_mslist(gcli::FGclicmd &gclicmd); + // void gclicmd_mslist(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:mslist gcli::FMilestone& GetMilestone(strptr milestone_key); // (user-implemented function, prototype is in amc-generated header) - // void gtblact_milestone_list(gcli::FGtblact >blact); + // void gtblact_milestone_list(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:milestone_list // ------------------------------------------------------------------- // cpp/gcli/mr.cpp // // (user-implemented function, prototype is in amc-generated header) - // void gclicmd_graphql(gcli::FGclicmd&); + // void gclicmd_graphql(gcli::FGclicmd&); // gstatic/gclidb.gclicmd:graphql void Main_ShowMrlist(); // (user-implemented function, prototype is in amc-generated header) - // void gclicmd_repojobtrace(gcli::FGclicmd&); - // void gclicmd_repojob(gcli::FGclicmd &gclicmd); - // void gclicmd_mrlist(gcli::FGclicmd &gclicmd); - // void gclicmd_mrlistdet(gcli::FGclicmd &gclicmd); - // void gclicmd_mrnote(gcli::FGclicmd &gclicmd); - // void gclicmd_mrreview(gcli::FGclicmd &gclicmd); - // void gclicmd_mrreviewrm(gcli::FGclicmd &gclicmd); - // void gclicmd_mrreq(gcli::FGclicmd &gclicmd); - // void gclicmd_mrmod(gcli::FGclicmd &gclicmd); - // void gclicmd_mrsearch(gcli::FGclicmd &gclicmd); - // void gclicmd_mraccept(gcli::FGclicmd &gclicmd); - // void gtblact_mr_create(gcli::FGtblact >blact); + // void gclicmd_repojobtrace(gcli::FGclicmd&); // gstatic/gclidb.gclicmd:repojobtrace + // void gclicmd_repojob(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:repojob + // void gclicmd_mrlist(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:mrlist + // void gclicmd_mrlistdet(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:mrlistdet + // void gclicmd_mrnote(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:mrnote + // void gclicmd_mrreview(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:mrreview + // void gclicmd_mrreviewrm(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:mrreviewrm + // void gclicmd_mrreq(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:mrreq + // void gclicmd_mrmod(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:mrmod + // void gclicmd_mrsearch(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:mrsearch + // void gclicmd_mraccept(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:mraccept + // void gtblact_mr_create(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mr_create gcli::FMr & ReadSingleMr(gcli::FGtblact >blact); // (user-implemented function, prototype is in amc-generated header) - // void gtblact_mr_update(gcli::FGtblact >blact); + // void gtblact_mr_update(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mr_update void Mr_SearchCond(gcli::FGtblact >blact); // (user-implemented function, prototype is in amc-generated header) - // void gtblact_mr_list(gcli::FGtblact >blact); - // void gtblact_mrjob_list(gcli::FGtblact >blact); - // void gtblact_mr_accept(gcli::FGtblact >blact); - // void gtblact_mr_approve(gcli::FGtblact >blact); - // void gtblact_mr_needs_work(gcli::FGtblact >blact); - // void gtblact_mr_start(gcli::FGtblact >blact); - // void gtblact_mr_stop(gcli::FGtblact >blact); + // void gtblact_mr_list(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mr_list + // void gtblact_mrjob_list(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mrjob_list + // void gtblact_mr_accept(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mr_accept + // void gtblact_mr_approve(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mr_approve + // void gtblact_mr_needs_work(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mr_needs_work + // void gtblact_mr_start(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mr_start + // void gtblact_mr_stop(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mr_stop // ------------------------------------------------------------------- // cpp/gcli/note.cpp // // (user-implemented function, prototype is in amc-generated header) - // void gclicmd_noteadd(gcli::FGclicmd&); - // void gclicmd_mrnoteadd(gcli::FGclicmd&); - // void gclicmd_notemod(gcli::FGclicmd&); - // void gclicmd_mrnotemod(gcli::FGclicmd&); - // void gtblact_issuenote_create(gcli::FGtblact >blact); - // void gtblact_issuenote_update(gcli::FGtblact >blact); - // void gtblact_issuenote_list(gcli::FGtblact >blact); - // void gtblact_mrnote_list(gcli::FGtblact >blact); - // void gtblact_mrnote_create(gcli::FGtblact >blact); - // void gtblact_mrnote_update(gcli::FGtblact >blact); + // void gclicmd_noteadd(gcli::FGclicmd&); // gstatic/gclidb.gclicmd:noteadd + // void gclicmd_mrnoteadd(gcli::FGclicmd&); // gstatic/gclidb.gclicmd:mrnoteadd + // void gclicmd_notemod(gcli::FGclicmd&); // gstatic/gclidb.gclicmd:notemod + // void gclicmd_mrnotemod(gcli::FGclicmd&); // gstatic/gclidb.gclicmd:mrnotemod + // void gtblact_issuenote_create(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:issuenote_create + // void gtblact_issuenote_update(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:issuenote_update + // void gtblact_issuenote_list(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:issuenote_list + // void gtblact_mrnote_list(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mrnote_list + // void gtblact_mrnote_create(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mrnote_create + // void gtblact_mrnote_update(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:mrnote_update // ------------------------------------------------------------------- // cpp/gcli/repo.cpp // // (user-implemented function, prototype is in amc-generated header) - // void gtblact_repo_list(gcli::FGtblact >blact); - // void gclicmd_token2repos(gcli::FGclicmd &gclicmd); + // void gtblact_repo_list(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:repo_list + // void gclicmd_token2repos(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:token2repos void LoadGrepo(); void Main_ManageAuth(); // (user-implemented function, prototype is in amc-generated header) - // void gtblact_repo_create(gcli::FGtblact >blact); - // void gtblact_reporemote_list(gcli::FGtblact >blact); - // void gtblact_repo_update(gcli::FGtblact >blact); + // void gtblact_repo_create(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:repo_create + // void gtblact_reporemote_list(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:reporemote_list + // void gtblact_repo_update(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:repo_update // ------------------------------------------------------------------- // cpp/gcli/rest.cpp @@ -207,10 +210,10 @@ namespace gcli { // update-hdr // void Main_ShowUserlist(); // (user-implemented function, prototype is in amc-generated header) - // void gclicmd_user(gcli::FGclicmd &gclicmd); - // void gclicmd_userlist(gcli::FGclicmd &gclicmd); - // void gclicmd_userdet(gcli::FGclicmd &gclicmd); + // void gclicmd_user(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:user + // void gclicmd_userlist(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:userlist + // void gclicmd_userdet(gcli::FGclicmd &gclicmd); // gstatic/gclidb.gclicmd:userdet gcli::FUser& GetUser(strptr user_key); // (user-implemented function, prototype is in amc-generated header) - // void gtblact_user_list(gcli::FGtblact >blact); + // void gtblact_user_list(gcli::FGtblact >blact); // gstatic/gclidb.gtblact:user_list } diff --git a/include/gen/_gen.h b/include/gen/_gen.h index aa517efc..9458a5f1 100644 --- a/include/gen/_gen.h +++ b/include/gen/_gen.h @@ -26,13 +26,6 @@ // gen:ns_fwddecl2 namespace lib_json { struct FNode; } -// --- ResponseHeader -struct ResponseHeader { // ResponseHeader - // func:ResponseHeader..Ctor - inline ResponseHeader() __attribute__((nothrow)); -}; - - // --- pad_byte #pragma pack(push,1) struct pad_byte { // pad_byte @@ -47,22 +40,20 @@ struct pad_byte { // pad_byte // Set all fields to initial values. // func:pad_byte..Init inline void pad_byte_Init(pad_byte& parent); +// func:...StaticCheck +void StaticCheck(); // func:bool..Hash -// this function is 'extrn' and implemented by user -u32 bool_Hash(u32 prev, bool rhs) __attribute__((nothrow)); +inline u32 bool_Hash(u32 prev, bool rhs) __attribute__((nothrow)); // Read fields of bool from an ascii string. // func:bool..ReadStrptrMaybe // this function is 'extrn' and implemented by user bool bool_ReadStrptrMaybe(bool &parent, algo::strptr in_str) __attribute__((nothrow)); // func:bool..Lt -// this function is 'extrn' and implemented by user -bool bool_Lt(bool lhs, bool rhs) __attribute__((nothrow)); +inline bool bool_Lt(bool lhs, bool rhs) __attribute__((nothrow)); // func:bool..Cmp -// this function is 'extrn' and implemented by user -i32 bool_Cmp(bool lhs, bool rhs) __attribute__((nothrow)); +inline i32 bool_Cmp(bool lhs, bool rhs) __attribute__((nothrow)); // func:bool..Eq -// this function is 'extrn' and implemented by user -bool bool_Eq(bool lhs, bool rhs) __attribute__((nothrow)); +inline bool bool_Eq(bool lhs, bool rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:bool..Update inline bool bool_Update(bool &lhs, bool rhs) __attribute__((nothrow)); @@ -77,21 +68,17 @@ lib_json::FNode * bool_FmtJson(bool row, lib_json::FNode *parent) __attribute // this function is 'extrn' and implemented by user void bool_Print(bool row, algo::cstring& str) __attribute__((nothrow)); // func:char..Hash -// this function is 'extrn' and implemented by user -u32 char_Hash(u32 prev, char rhs) __attribute__((nothrow)); +inline u32 char_Hash(u32 prev, char rhs) __attribute__((nothrow)); // Read fields of char from an ascii string. // func:char..ReadStrptrMaybe // this function is 'extrn' and implemented by user bool char_ReadStrptrMaybe(char &parent, algo::strptr in_str) __attribute__((nothrow)); // func:char..Lt -// this function is 'extrn' and implemented by user -bool char_Lt(char lhs, char rhs) __attribute__((nothrow)); +inline bool char_Lt(char lhs, char rhs) __attribute__((nothrow)); // func:char..Cmp -// this function is 'extrn' and implemented by user -i32 char_Cmp(char lhs, char rhs) __attribute__((nothrow)); +inline i32 char_Cmp(char lhs, char rhs) __attribute__((nothrow)); // func:char..Eq -// this function is 'extrn' and implemented by user -bool char_Eq(char lhs, char rhs) __attribute__((nothrow)); +inline bool char_Eq(char lhs, char rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:char..Update inline bool char_Update(char &lhs, char rhs) __attribute__((nothrow)); @@ -106,18 +93,15 @@ lib_json::FNode * char_FmtJson(char row, lib_json::FNode *parent) __attribute // this function is 'extrn' and implemented by user void char_Print(char row, algo::cstring& str) __attribute__((nothrow)); // func:double..Hash -// this function is 'extrn' and implemented by user -u32 double_Hash(u32 prev, double rhs) __attribute__((nothrow)); +inline u32 double_Hash(u32 prev, double rhs) __attribute__((nothrow)); // Read fields of double from an ascii string. // func:double..ReadStrptrMaybe // this function is 'extrn' and implemented by user bool double_ReadStrptrMaybe(double &parent, algo::strptr in_str) __attribute__((nothrow)); // func:double..Lt -// this function is 'extrn' and implemented by user -bool double_Lt(double lhs, double rhs) __attribute__((nothrow)); +inline bool double_Lt(double lhs, double rhs) __attribute__((nothrow)); // func:double..Cmp -// this function is 'extrn' and implemented by user -i32 double_Cmp(double lhs, double rhs) __attribute__((nothrow)); +inline i32 double_Cmp(double lhs, double rhs) __attribute__((nothrow)); // Attempt to make LHS bigger. Return true if it was changed // func:double..UpdateMax inline bool double_UpdateMax(double &lhs, double rhs) __attribute__((nothrow)); @@ -131,8 +115,7 @@ inline bool double_UpdateMin(double &lhs, double rhs) __attribute__((no // func:double..Max inline double double_Max(double lhs, double rhs) __attribute__((nothrow)); // func:double..Eq -// this function is 'extrn' and implemented by user -bool double_Eq(double lhs, double rhs) __attribute__((nothrow)); +inline bool double_Eq(double lhs, double rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:double..Update inline bool double_Update(double &lhs, double rhs) __attribute__((nothrow)); @@ -147,18 +130,15 @@ lib_json::FNode * double_FmtJson(double row, lib_json::FNode *parent) __attri // this function is 'extrn' and implemented by user void double_Print(double row, algo::cstring& str) __attribute__((nothrow)); // func:float..Hash -// this function is 'extrn' and implemented by user -u32 float_Hash(u32 prev, float rhs) __attribute__((nothrow)); +inline u32 float_Hash(u32 prev, float rhs) __attribute__((nothrow)); // Read fields of float from an ascii string. // func:float..ReadStrptrMaybe // this function is 'extrn' and implemented by user bool float_ReadStrptrMaybe(float &parent, algo::strptr in_str) __attribute__((nothrow)); // func:float..Lt -// this function is 'extrn' and implemented by user -bool float_Lt(float lhs, float rhs) __attribute__((nothrow)); +inline bool float_Lt(float lhs, float rhs) __attribute__((nothrow)); // func:float..Cmp -// this function is 'extrn' and implemented by user -i32 float_Cmp(float lhs, float rhs) __attribute__((nothrow)); +inline i32 float_Cmp(float lhs, float rhs) __attribute__((nothrow)); // Attempt to make LHS bigger. Return true if it was changed // func:float..UpdateMax inline bool float_UpdateMax(float &lhs, float rhs) __attribute__((nothrow)); @@ -172,8 +152,7 @@ inline bool float_UpdateMin(float &lhs, float rhs) __attribute__((nothr // func:float..Max inline float float_Max(float lhs, float rhs) __attribute__((nothrow)); // func:float..Eq -// this function is 'extrn' and implemented by user -bool float_Eq(float lhs, float rhs) __attribute__((nothrow)); +inline bool float_Eq(float lhs, float rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:float..Update inline bool float_Update(float &lhs, float rhs) __attribute__((nothrow)); @@ -188,8 +167,7 @@ lib_json::FNode * float_FmtJson(float row, lib_json::FNode *parent) __attribu // this function is 'extrn' and implemented by user void float_Print(float row, algo::cstring& str) __attribute__((nothrow)); // func:i16..Hash -// this function is 'extrn' and implemented by user -u32 i16_Hash(u32 prev, i16 rhs) __attribute__((nothrow)); +inline u32 i16_Hash(u32 prev, i16 rhs) __attribute__((nothrow)); // Read fields of i16 from an ascii string. // Attempt to parse i16 from in_str // Leading whitespace is silently skipped @@ -202,11 +180,9 @@ u32 i16_Hash(u32 prev, i16 rhs) __attribute__((nothrow)); // func:i16..ReadStrptrMaybe bool i16_ReadStrptrMaybe(i16 &parent, algo::strptr in_str) __attribute__((nothrow)); // func:i16..Lt -// this function is 'extrn' and implemented by user -bool i16_Lt(i16 lhs, i16 rhs) __attribute__((nothrow)); +inline bool i16_Lt(i16 lhs, i16 rhs) __attribute__((nothrow)); // func:i16..Cmp -// this function is 'extrn' and implemented by user -i32 i16_Cmp(i16 lhs, i16 rhs) __attribute__((nothrow)); +inline i32 i16_Cmp(i16 lhs, i16 rhs) __attribute__((nothrow)); // Attempt to make LHS bigger. Return true if it was changed // func:i16..UpdateMax inline bool i16_UpdateMax(i16 &lhs, i16 rhs) __attribute__((nothrow)); @@ -220,8 +196,7 @@ inline bool i16_UpdateMin(i16 &lhs, i16 rhs) __attribute__((nothrow)); // func:i16..Max inline i16 i16_Max(i16 lhs, i16 rhs) __attribute__((nothrow)); // func:i16..Eq -// this function is 'extrn' and implemented by user -bool i16_Eq(i16 lhs, i16 rhs) __attribute__((nothrow)); +inline bool i16_Eq(i16 lhs, i16 rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:i16..Update inline bool i16_Update(i16 &lhs, i16 rhs) __attribute__((nothrow)); @@ -236,8 +211,7 @@ lib_json::FNode * i16_FmtJson(i16 row, lib_json::FNode *parent) __attribute__ // this function is 'extrn' and implemented by user void i16_Print(i16 row, algo::cstring& str) __attribute__((nothrow)); // func:i32..Hash -// this function is 'extrn' and implemented by user -u32 i32_Hash(u32 prev, i32 rhs) __attribute__((nothrow)); +inline u32 i32_Hash(u32 prev, i32 rhs) __attribute__((nothrow)); // Read fields of i32 from an ascii string. // Attempt to parse i32 from in_str // Leading whitespace is silently skipped @@ -250,11 +224,9 @@ u32 i32_Hash(u32 prev, i32 rhs) __attribute__((nothrow)); // func:i32..ReadStrptrMaybe bool i32_ReadStrptrMaybe(i32 &parent, algo::strptr in_str) __attribute__((nothrow)); // func:i32..Lt -// this function is 'extrn' and implemented by user -bool i32_Lt(i32 lhs, i32 rhs) __attribute__((nothrow)); +inline bool i32_Lt(i32 lhs, i32 rhs) __attribute__((nothrow)); // func:i32..Cmp -// this function is 'extrn' and implemented by user -i32 i32_Cmp(i32 lhs, i32 rhs) __attribute__((nothrow)); +inline i32 i32_Cmp(i32 lhs, i32 rhs) __attribute__((nothrow)); // Attempt to make LHS bigger. Return true if it was changed // func:i32..UpdateMax inline bool i32_UpdateMax(i32 &lhs, i32 rhs) __attribute__((nothrow)); @@ -268,8 +240,7 @@ inline bool i32_UpdateMin(i32 &lhs, i32 rhs) __attribute__((nothrow)); // func:i32..Max inline i32 i32_Max(i32 lhs, i32 rhs) __attribute__((nothrow)); // func:i32..Eq -// this function is 'extrn' and implemented by user -bool i32_Eq(i32 lhs, i32 rhs) __attribute__((nothrow)); +inline bool i32_Eq(i32 lhs, i32 rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:i32..Update inline bool i32_Update(i32 &lhs, i32 rhs) __attribute__((nothrow)); @@ -284,8 +255,7 @@ lib_json::FNode * i32_FmtJson(i32 row, lib_json::FNode *parent) __attribute__ // this function is 'extrn' and implemented by user void i32_Print(i32 row, algo::cstring& str) __attribute__((nothrow)); // func:i64..Hash -// this function is 'extrn' and implemented by user -u32 i64_Hash(u32 prev, i64 rhs) __attribute__((nothrow)); +inline u32 i64_Hash(u32 prev, i64 rhs) __attribute__((nothrow)); // Read fields of i64 from an ascii string. // Attempt to parse i64 from in_str // Leading whitespace is silently skipped @@ -298,11 +268,9 @@ u32 i64_Hash(u32 prev, i64 rhs) __attribute__((nothrow)); // func:i64..ReadStrptrMaybe bool i64_ReadStrptrMaybe(i64 &parent, algo::strptr in_str) __attribute__((nothrow)); // func:i64..Lt -// this function is 'extrn' and implemented by user -bool i64_Lt(i64 lhs, i64 rhs) __attribute__((nothrow)); +inline bool i64_Lt(i64 lhs, i64 rhs) __attribute__((nothrow)); // func:i64..Cmp -// this function is 'extrn' and implemented by user -i32 i64_Cmp(i64 lhs, i64 rhs) __attribute__((nothrow)); +inline i32 i64_Cmp(i64 lhs, i64 rhs) __attribute__((nothrow)); // Attempt to make LHS bigger. Return true if it was changed // func:i64..UpdateMax inline bool i64_UpdateMax(i64 &lhs, i64 rhs) __attribute__((nothrow)); @@ -316,8 +284,7 @@ inline bool i64_UpdateMin(i64 &lhs, i64 rhs) __attribute__((nothrow)); // func:i64..Max inline i64 i64_Max(i64 lhs, i64 rhs) __attribute__((nothrow)); // func:i64..Eq -// this function is 'extrn' and implemented by user -bool i64_Eq(i64 lhs, i64 rhs) __attribute__((nothrow)); +inline bool i64_Eq(i64 lhs, i64 rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:i64..Update inline bool i64_Update(i64 &lhs, i64 rhs) __attribute__((nothrow)); @@ -332,8 +299,7 @@ lib_json::FNode * i64_FmtJson(i64 row, lib_json::FNode *parent) __attribute__ // this function is 'extrn' and implemented by user void i64_Print(i64 row, algo::cstring& str) __attribute__((nothrow)); // func:i8..Hash -// this function is 'extrn' and implemented by user -u32 i8_Hash(u32 prev, i8 rhs) __attribute__((nothrow)); +inline u32 i8_Hash(u32 prev, i8 rhs) __attribute__((nothrow)); // Read fields of i8 from an ascii string. // Attempt to parse i8 from in_str // Leading whitespace is silently skipped @@ -346,11 +312,9 @@ u32 i8_Hash(u32 prev, i8 rhs) __attribute__((nothrow)); // func:i8..ReadStrptrMaybe bool i8_ReadStrptrMaybe(i8 &parent, algo::strptr in_str) __attribute__((nothrow)); // func:i8..Lt -// this function is 'extrn' and implemented by user -bool i8_Lt(i8 lhs, i8 rhs) __attribute__((nothrow)); +inline bool i8_Lt(i8 lhs, i8 rhs) __attribute__((nothrow)); // func:i8..Cmp -// this function is 'extrn' and implemented by user -i32 i8_Cmp(i8 lhs, i8 rhs) __attribute__((nothrow)); +inline i32 i8_Cmp(i8 lhs, i8 rhs) __attribute__((nothrow)); // Attempt to make LHS bigger. Return true if it was changed // func:i8..UpdateMax inline bool i8_UpdateMax(i8 &lhs, i8 rhs) __attribute__((nothrow)); @@ -364,8 +328,7 @@ inline bool i8_UpdateMin(i8 &lhs, i8 rhs) __attribute__((nothrow)); // func:i8..Max inline i8 i8_Max(i8 lhs, i8 rhs) __attribute__((nothrow)); // func:i8..Eq -// this function is 'extrn' and implemented by user -bool i8_Eq(i8 lhs, i8 rhs) __attribute__((nothrow)); +inline bool i8_Eq(i8 lhs, i8 rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:i8..Update inline bool i8_Update(i8 &lhs, i8 rhs) __attribute__((nothrow)); @@ -380,8 +343,7 @@ lib_json::FNode * i8_FmtJson(i8 row, lib_json::FNode *parent) __attribute__(( // this function is 'extrn' and implemented by user void i8_Print(i8 row, algo::cstring& str) __attribute__((nothrow)); // func:u8..Hash -// this function is 'extrn' and implemented by user -u32 u8_Hash(u32 prev, u8 rhs) __attribute__((nothrow)); +inline u32 u8_Hash(u32 prev, u8 rhs) __attribute__((nothrow)); // Read fields of u8 from an ascii string. // Attempt to parse u8 from in_str // Leading whitespace is silently skipped @@ -394,11 +356,9 @@ u32 u8_Hash(u32 prev, u8 rhs) __attribute__((nothrow)); // func:u8..ReadStrptrMaybe bool u8_ReadStrptrMaybe(u8 &parent, algo::strptr in_str) __attribute__((nothrow)); // func:u8..Lt -// this function is 'extrn' and implemented by user -bool u8_Lt(u8 lhs, u8 rhs) __attribute__((nothrow)); +inline bool u8_Lt(u8 lhs, u8 rhs) __attribute__((nothrow)); // func:u8..Cmp -// this function is 'extrn' and implemented by user -i32 u8_Cmp(u8 lhs, u8 rhs) __attribute__((nothrow)); +inline i32 u8_Cmp(u8 lhs, u8 rhs) __attribute__((nothrow)); // Attempt to make LHS bigger. Return true if it was changed // func:u8..UpdateMax inline bool u8_UpdateMax(u8 &lhs, u8 rhs) __attribute__((nothrow)); @@ -412,8 +372,7 @@ inline bool u8_UpdateMin(u8 &lhs, u8 rhs) __attribute__((nothrow)); // func:u8..Max inline u8 u8_Max(u8 lhs, u8 rhs) __attribute__((nothrow)); // func:u8..Eq -// this function is 'extrn' and implemented by user -bool u8_Eq(u8 lhs, u8 rhs) __attribute__((nothrow)); +inline bool u8_Eq(u8 lhs, u8 rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:u8..Update inline bool u8_Update(u8 &lhs, u8 rhs) __attribute__((nothrow)); @@ -428,8 +387,7 @@ lib_json::FNode * u8_FmtJson(u8 row, lib_json::FNode *parent) __attribute__(( // this function is 'extrn' and implemented by user void u8_Print(u8 row, algo::cstring& str) __attribute__((nothrow)); // func:u128..Hash -// this function is 'extrn' and implemented by user -u32 u128_Hash(u32 prev, u128 rhs) __attribute__((nothrow)); +inline u32 u128_Hash(u32 prev, u128 rhs) __attribute__((nothrow)); // Read fields of u128 from an ascii string. // Attempt to parse u128 from in_str // Leading whitespace is silently skipped @@ -442,11 +400,9 @@ u32 u128_Hash(u32 prev, u128 rhs) __attribute__((nothrow)); // func:u128..ReadStrptrMaybe bool u128_ReadStrptrMaybe(u128 &parent, algo::strptr in_str) __attribute__((nothrow)); // func:u128..Lt -// this function is 'extrn' and implemented by user -bool u128_Lt(u128 lhs, u128 rhs) __attribute__((nothrow)); +inline bool u128_Lt(u128 lhs, u128 rhs) __attribute__((nothrow)); // func:u128..Cmp -// this function is 'extrn' and implemented by user -i32 u128_Cmp(u128 lhs, u128 rhs) __attribute__((nothrow)); +inline i32 u128_Cmp(u128 lhs, u128 rhs) __attribute__((nothrow)); // Attempt to make LHS bigger. Return true if it was changed // func:u128..UpdateMax inline bool u128_UpdateMax(u128 &lhs, u128 rhs) __attribute__((nothrow)); @@ -460,8 +416,7 @@ inline bool u128_UpdateMin(u128 &lhs, u128 rhs) __attribute__((nothrow) // func:u128..Max inline u128 u128_Max(u128 lhs, u128 rhs) __attribute__((nothrow)); // func:u128..Eq -// this function is 'extrn' and implemented by user -bool u128_Eq(u128 lhs, u128 rhs) __attribute__((nothrow)); +inline bool u128_Eq(u128 lhs, u128 rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:u128..Update inline bool u128_Update(u128 &lhs, u128 rhs) __attribute__((nothrow)); @@ -471,8 +426,7 @@ inline bool u128_Update(u128 &lhs, u128 rhs) __attribute__((nothrow)); // this function is 'extrn' and implemented by user void u128_Print(u128 row, algo::cstring& str) __attribute__((nothrow)); // func:u16..Hash -// this function is 'extrn' and implemented by user -u32 u16_Hash(u32 prev, u16 rhs) __attribute__((nothrow)); +inline u32 u16_Hash(u32 prev, u16 rhs) __attribute__((nothrow)); // Read fields of u16 from an ascii string. // Attempt to parse u16 from in_str // Leading whitespace is silently skipped @@ -485,11 +439,9 @@ u32 u16_Hash(u32 prev, u16 rhs) __attribute__((nothrow)); // func:u16..ReadStrptrMaybe bool u16_ReadStrptrMaybe(u16 &parent, algo::strptr in_str) __attribute__((nothrow)); // func:u16..Lt -// this function is 'extrn' and implemented by user -bool u16_Lt(u16 lhs, u16 rhs) __attribute__((nothrow)); +inline bool u16_Lt(u16 lhs, u16 rhs) __attribute__((nothrow)); // func:u16..Cmp -// this function is 'extrn' and implemented by user -i32 u16_Cmp(u16 lhs, u16 rhs) __attribute__((nothrow)); +inline i32 u16_Cmp(u16 lhs, u16 rhs) __attribute__((nothrow)); // Attempt to make LHS bigger. Return true if it was changed // func:u16..UpdateMax inline bool u16_UpdateMax(u16 &lhs, u16 rhs) __attribute__((nothrow)); @@ -503,8 +455,7 @@ inline bool u16_UpdateMin(u16 &lhs, u16 rhs) __attribute__((nothrow)); // func:u16..Max inline u16 u16_Max(u16 lhs, u16 rhs) __attribute__((nothrow)); // func:u16..Eq -// this function is 'extrn' and implemented by user -bool u16_Eq(u16 lhs, u16 rhs) __attribute__((nothrow)); +inline bool u16_Eq(u16 lhs, u16 rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:u16..Update inline bool u16_Update(u16 &lhs, u16 rhs) __attribute__((nothrow)); @@ -519,8 +470,7 @@ lib_json::FNode * u16_FmtJson(u16 row, lib_json::FNode *parent) __attribute__ // this function is 'extrn' and implemented by user void u16_Print(u16 row, algo::cstring& str) __attribute__((nothrow)); // func:u32..Hash -// this function is 'extrn' and implemented by user -u32 u32_Hash(u32 prev, u32 rhs) __attribute__((nothrow)); +inline u32 u32_Hash(u32 prev, u32 rhs) __attribute__((nothrow)); // Read fields of u32 from an ascii string. // Attempt to parse u32 from in_str // Leading whitespace is silently skipped @@ -533,11 +483,9 @@ u32 u32_Hash(u32 prev, u32 rhs) __attribute__((nothrow)); // func:u32..ReadStrptrMaybe bool u32_ReadStrptrMaybe(u32 &parent, algo::strptr in_str) __attribute__((nothrow)); // func:u32..Lt -// this function is 'extrn' and implemented by user -bool u32_Lt(u32 lhs, u32 rhs) __attribute__((nothrow)); +inline bool u32_Lt(u32 lhs, u32 rhs) __attribute__((nothrow)); // func:u32..Cmp -// this function is 'extrn' and implemented by user -i32 u32_Cmp(u32 lhs, u32 rhs) __attribute__((nothrow)); +inline i32 u32_Cmp(u32 lhs, u32 rhs) __attribute__((nothrow)); // Attempt to make LHS bigger. Return true if it was changed // func:u32..UpdateMax inline bool u32_UpdateMax(u32 &lhs, u32 rhs) __attribute__((nothrow)); @@ -551,8 +499,7 @@ inline bool u32_UpdateMin(u32 &lhs, u32 rhs) __attribute__((nothrow)); // func:u32..Max inline u32 u32_Max(u32 lhs, u32 rhs) __attribute__((nothrow)); // func:u32..Eq -// this function is 'extrn' and implemented by user -bool u32_Eq(u32 lhs, u32 rhs) __attribute__((nothrow)); +inline bool u32_Eq(u32 lhs, u32 rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:u32..Update inline bool u32_Update(u32 &lhs, u32 rhs) __attribute__((nothrow)); @@ -567,8 +514,7 @@ lib_json::FNode * u32_FmtJson(u32 row, lib_json::FNode *parent) __attribute__ // this function is 'extrn' and implemented by user void u32_Print(u32 row, algo::cstring& str) __attribute__((nothrow)); // func:u64..Hash -// this function is 'extrn' and implemented by user -u32 u64_Hash(u32 prev, u64 rhs) __attribute__((nothrow)); +inline u32 u64_Hash(u32 prev, u64 rhs) __attribute__((nothrow)); // Read fields of u64 from an ascii string. // Attempt to parse u64 from in_str // Leading whitespace is silently skipped @@ -581,11 +527,9 @@ u32 u64_Hash(u32 prev, u64 rhs) __attribute__((nothrow)); // func:u64..ReadStrptrMaybe bool u64_ReadStrptrMaybe(u64 &parent, algo::strptr in_str) __attribute__((nothrow)); // func:u64..Lt -// this function is 'extrn' and implemented by user -bool u64_Lt(u64 lhs, u64 rhs) __attribute__((nothrow)); +inline bool u64_Lt(u64 lhs, u64 rhs) __attribute__((nothrow)); // func:u64..Cmp -// this function is 'extrn' and implemented by user -i32 u64_Cmp(u64 lhs, u64 rhs) __attribute__((nothrow)); +inline i32 u64_Cmp(u64 lhs, u64 rhs) __attribute__((nothrow)); // Attempt to make LHS bigger. Return true if it was changed // func:u64..UpdateMax inline bool u64_UpdateMax(u64 &lhs, u64 rhs) __attribute__((nothrow)); @@ -599,8 +543,7 @@ inline bool u64_UpdateMin(u64 &lhs, u64 rhs) __attribute__((nothrow)); // func:u64..Max inline u64 u64_Max(u64 lhs, u64 rhs) __attribute__((nothrow)); // func:u64..Eq -// this function is 'extrn' and implemented by user -bool u64_Eq(u64 lhs, u64 rhs) __attribute__((nothrow)); +inline bool u64_Eq(u64 lhs, u64 rhs) __attribute__((nothrow)); // Set value. Return true if new value is different from old value. // func:u64..Update inline bool u64_Update(u64 &lhs, u64 rhs) __attribute__((nothrow)); diff --git a/include/gen/_gen.inl.h b/include/gen/_gen.inl.h index e5c927ab..48387341 100644 --- a/include/gen/_gen.inl.h +++ b/include/gen/_gen.inl.h @@ -29,6 +29,31 @@ inline void pad_byte_Init(pad_byte& parent) { parent.value = u8(0); } +// --- bool..Hash +inline u32 bool_Hash(u32 prev, bool rhs) { + prev = _mm_crc32_u8(prev,rhs); + return prev; +} + +// --- bool..Lt +inline bool bool_Lt(bool lhs, bool rhs) { + return lhs < rhs; +} + +// --- bool..Cmp +inline i32 bool_Cmp(bool lhs, bool rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + +// --- bool..Eq +inline bool bool_Eq(bool lhs, bool rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- bool..Update // Set value. Return true if new value is different from old value. inline bool bool_Update(bool &lhs, bool rhs) { @@ -39,6 +64,31 @@ inline bool bool_Update(bool &lhs, bool rhs) { return ret; } +// --- char..Hash +inline u32 char_Hash(u32 prev, char rhs) { + prev = _mm_crc32_u8(prev,rhs); + return prev; +} + +// --- char..Lt +inline bool char_Lt(char lhs, char rhs) { + return lhs < rhs; +} + +// --- char..Cmp +inline i32 char_Cmp(char lhs, char rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + +// --- char..Eq +inline bool char_Eq(char lhs, char rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- char..Update // Set value. Return true if new value is different from old value. inline bool char_Update(char &lhs, char rhs) { @@ -49,6 +99,28 @@ inline bool char_Update(char &lhs, char rhs) { return ret; } +// --- double..Hash +inline u32 double_Hash(u32 prev, double rhs) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" + u64 val0 = *(u64*)((u8*)&rhs + 0); + prev = _mm_crc32_u64(prev, val0); +#pragma GCC diagnostic pop + return prev; +} + +// --- double..Lt +inline bool double_Lt(double lhs, double rhs) { + return lhs < rhs; +} + +// --- double..Cmp +inline i32 double_Cmp(double lhs, double rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + // --- double..UpdateMax // Attempt to make LHS bigger. Return true if it was changed inline bool double_UpdateMax(double &lhs, double rhs) { @@ -81,6 +153,13 @@ inline double double_Max(double lhs, double rhs) { return rhs < lhs ? lhs : rhs; } +// --- double..Eq +inline bool double_Eq(double lhs, double rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- double..Update // Set value. Return true if new value is different from old value. inline bool double_Update(double &lhs, double rhs) { @@ -91,6 +170,28 @@ inline bool double_Update(double &lhs, double rhs) { return ret; } +// --- float..Hash +inline u32 float_Hash(u32 prev, float rhs) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" + u32 val0 = *(u32*)((u8*)&rhs + 0); + prev = _mm_crc32_u32(prev, val0); +#pragma GCC diagnostic pop + return prev; +} + +// --- float..Lt +inline bool float_Lt(float lhs, float rhs) { + return lhs < rhs; +} + +// --- float..Cmp +inline i32 float_Cmp(float lhs, float rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + // --- float..UpdateMax // Attempt to make LHS bigger. Return true if it was changed inline bool float_UpdateMax(float &lhs, float rhs) { @@ -123,6 +224,13 @@ inline float float_Max(float lhs, float rhs) { return rhs < lhs ? lhs : rhs; } +// --- float..Eq +inline bool float_Eq(float lhs, float rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- float..Update // Set value. Return true if new value is different from old value. inline bool float_Update(float &lhs, float rhs) { @@ -133,6 +241,24 @@ inline bool float_Update(float &lhs, float rhs) { return ret; } +// --- i16..Hash +inline u32 i16_Hash(u32 prev, i16 rhs) { + prev = _mm_crc32_u16(prev,rhs); + return prev; +} + +// --- i16..Lt +inline bool i16_Lt(i16 lhs, i16 rhs) { + return lhs < rhs; +} + +// --- i16..Cmp +inline i32 i16_Cmp(i16 lhs, i16 rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + // --- i16..UpdateMax // Attempt to make LHS bigger. Return true if it was changed inline bool i16_UpdateMax(i16 &lhs, i16 rhs) { @@ -165,6 +291,13 @@ inline i16 i16_Max(i16 lhs, i16 rhs) { return rhs < lhs ? lhs : rhs; } +// --- i16..Eq +inline bool i16_Eq(i16 lhs, i16 rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- i16..Update // Set value. Return true if new value is different from old value. inline bool i16_Update(i16 &lhs, i16 rhs) { @@ -175,6 +308,24 @@ inline bool i16_Update(i16 &lhs, i16 rhs) { return ret; } +// --- i32..Hash +inline u32 i32_Hash(u32 prev, i32 rhs) { + prev = _mm_crc32_u32(prev,rhs); + return prev; +} + +// --- i32..Lt +inline bool i32_Lt(i32 lhs, i32 rhs) { + return lhs < rhs; +} + +// --- i32..Cmp +inline i32 i32_Cmp(i32 lhs, i32 rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + // --- i32..UpdateMax // Attempt to make LHS bigger. Return true if it was changed inline bool i32_UpdateMax(i32 &lhs, i32 rhs) { @@ -207,6 +358,13 @@ inline i32 i32_Max(i32 lhs, i32 rhs) { return rhs < lhs ? lhs : rhs; } +// --- i32..Eq +inline bool i32_Eq(i32 lhs, i32 rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- i32..Update // Set value. Return true if new value is different from old value. inline bool i32_Update(i32 &lhs, i32 rhs) { @@ -217,6 +375,24 @@ inline bool i32_Update(i32 &lhs, i32 rhs) { return ret; } +// --- i64..Hash +inline u32 i64_Hash(u32 prev, i64 rhs) { + prev = _mm_crc32_u64(prev,rhs); + return prev; +} + +// --- i64..Lt +inline bool i64_Lt(i64 lhs, i64 rhs) { + return lhs < rhs; +} + +// --- i64..Cmp +inline i32 i64_Cmp(i64 lhs, i64 rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + // --- i64..UpdateMax // Attempt to make LHS bigger. Return true if it was changed inline bool i64_UpdateMax(i64 &lhs, i64 rhs) { @@ -249,6 +425,13 @@ inline i64 i64_Max(i64 lhs, i64 rhs) { return rhs < lhs ? lhs : rhs; } +// --- i64..Eq +inline bool i64_Eq(i64 lhs, i64 rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- i64..Update // Set value. Return true if new value is different from old value. inline bool i64_Update(i64 &lhs, i64 rhs) { @@ -259,6 +442,24 @@ inline bool i64_Update(i64 &lhs, i64 rhs) { return ret; } +// --- i8..Hash +inline u32 i8_Hash(u32 prev, i8 rhs) { + prev = _mm_crc32_u8(prev,rhs); + return prev; +} + +// --- i8..Lt +inline bool i8_Lt(i8 lhs, i8 rhs) { + return lhs < rhs; +} + +// --- i8..Cmp +inline i32 i8_Cmp(i8 lhs, i8 rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + // --- i8..UpdateMax // Attempt to make LHS bigger. Return true if it was changed inline bool i8_UpdateMax(i8 &lhs, i8 rhs) { @@ -291,6 +492,13 @@ inline i8 i8_Max(i8 lhs, i8 rhs) { return rhs < lhs ? lhs : rhs; } +// --- i8..Eq +inline bool i8_Eq(i8 lhs, i8 rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- i8..Update // Set value. Return true if new value is different from old value. inline bool i8_Update(i8 &lhs, i8 rhs) { @@ -301,6 +509,24 @@ inline bool i8_Update(i8 &lhs, i8 rhs) { return ret; } +// --- u8..Hash +inline u32 u8_Hash(u32 prev, u8 rhs) { + prev = _mm_crc32_u8(prev,rhs); + return prev; +} + +// --- u8..Lt +inline bool u8_Lt(u8 lhs, u8 rhs) { + return lhs < rhs; +} + +// --- u8..Cmp +inline i32 u8_Cmp(u8 lhs, u8 rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + // --- u8..UpdateMax // Attempt to make LHS bigger. Return true if it was changed inline bool u8_UpdateMax(u8 &lhs, u8 rhs) { @@ -333,6 +559,13 @@ inline u8 u8_Max(u8 lhs, u8 rhs) { return rhs < lhs ? lhs : rhs; } +// --- u8..Eq +inline bool u8_Eq(u8 lhs, u8 rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- u8..Update // Set value. Return true if new value is different from old value. inline bool u8_Update(u8 &lhs, u8 rhs) { @@ -343,6 +576,30 @@ inline bool u8_Update(u8 &lhs, u8 rhs) { return ret; } +// --- u128..Hash +inline u32 u128_Hash(u32 prev, u128 rhs) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" + u64 val0 = *(u64*)((u8*)&rhs + 0); + prev = _mm_crc32_u64(prev, val0); + u64 val8 = *(u64*)((u8*)&rhs + 8); + prev = _mm_crc32_u64(prev, val8); +#pragma GCC diagnostic pop + return prev; +} + +// --- u128..Lt +inline bool u128_Lt(u128 lhs, u128 rhs) { + return lhs < rhs; +} + +// --- u128..Cmp +inline i32 u128_Cmp(u128 lhs, u128 rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + // --- u128..UpdateMax // Attempt to make LHS bigger. Return true if it was changed inline bool u128_UpdateMax(u128 &lhs, u128 rhs) { @@ -375,6 +632,13 @@ inline u128 u128_Max(u128 lhs, u128 rhs) { return rhs < lhs ? lhs : rhs; } +// --- u128..Eq +inline bool u128_Eq(u128 lhs, u128 rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- u128..Update // Set value. Return true if new value is different from old value. inline bool u128_Update(u128 &lhs, u128 rhs) { @@ -385,6 +649,24 @@ inline bool u128_Update(u128 &lhs, u128 rhs) { return ret; } +// --- u16..Hash +inline u32 u16_Hash(u32 prev, u16 rhs) { + prev = _mm_crc32_u16(prev,rhs); + return prev; +} + +// --- u16..Lt +inline bool u16_Lt(u16 lhs, u16 rhs) { + return lhs < rhs; +} + +// --- u16..Cmp +inline i32 u16_Cmp(u16 lhs, u16 rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + // --- u16..UpdateMax // Attempt to make LHS bigger. Return true if it was changed inline bool u16_UpdateMax(u16 &lhs, u16 rhs) { @@ -417,6 +699,13 @@ inline u16 u16_Max(u16 lhs, u16 rhs) { return rhs < lhs ? lhs : rhs; } +// --- u16..Eq +inline bool u16_Eq(u16 lhs, u16 rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- u16..Update // Set value. Return true if new value is different from old value. inline bool u16_Update(u16 &lhs, u16 rhs) { @@ -427,6 +716,24 @@ inline bool u16_Update(u16 &lhs, u16 rhs) { return ret; } +// --- u32..Hash +inline u32 u32_Hash(u32 prev, u32 rhs) { + prev = _mm_crc32_u32(prev,rhs); + return prev; +} + +// --- u32..Lt +inline bool u32_Lt(u32 lhs, u32 rhs) { + return lhs < rhs; +} + +// --- u32..Cmp +inline i32 u32_Cmp(u32 lhs, u32 rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + // --- u32..UpdateMax // Attempt to make LHS bigger. Return true if it was changed inline bool u32_UpdateMax(u32 &lhs, u32 rhs) { @@ -459,6 +766,13 @@ inline u32 u32_Max(u32 lhs, u32 rhs) { return rhs < lhs ? lhs : rhs; } +// --- u32..Eq +inline bool u32_Eq(u32 lhs, u32 rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- u32..Update // Set value. Return true if new value is different from old value. inline bool u32_Update(u32 &lhs, u32 rhs) { @@ -469,6 +783,24 @@ inline bool u32_Update(u32 &lhs, u32 rhs) { return ret; } +// --- u64..Hash +inline u32 u64_Hash(u32 prev, u64 rhs) { + prev = _mm_crc32_u64(prev,rhs); + return prev; +} + +// --- u64..Lt +inline bool u64_Lt(u64 lhs, u64 rhs) { + return lhs < rhs; +} + +// --- u64..Cmp +inline i32 u64_Cmp(u64 lhs, u64 rhs) { + i32 retval = 0; + retval = lhsrhs; + return retval; +} + // --- u64..UpdateMax // Attempt to make LHS bigger. Return true if it was changed inline bool u64_UpdateMax(u64 &lhs, u64 rhs) { @@ -501,6 +833,13 @@ inline u64 u64_Max(u64 lhs, u64 rhs) { return rhs < lhs ? lhs : rhs; } +// --- u64..Eq +inline bool u64_Eq(u64 lhs, u64 rhs) { + bool retval = true; + retval = lhs == rhs; + return retval; +} + // --- u64..Update // Set value. Return true if new value is different from old value. inline bool u64_Update(u64 &lhs, u64 rhs) { diff --git a/include/gen/abt_gen.h b/include/gen/abt_gen.h index 16f457a7..531d317d 100644 --- a/include/gen/abt_gen.h +++ b/include/gen/abt_gen.h @@ -174,9 +174,10 @@ namespace abt { // gen:ns_print_struct // global access: arch (Lary, by rowid) // global access: ind_arch (Thash, hash field arch) struct FArch { // abt.FArch: Machine architecture - algo::Smallstr50 arch; // - algo::Comment comment; // - abt::FArch* ind_arch_next; // hash next + algo::Smallstr50 arch; // + algo::Comment comment; // + abt::FArch* ind_arch_next; // hash next + u32 ind_arch_hashval; // hash value // func:abt.FArch..AssignOp inline abt::FArch& operator =(const abt::FArch &rhs) = delete; // func:abt.FArch..CopyCtor @@ -210,14 +211,15 @@ void FArch_Uninit(abt::FArch& arch) __attribute__((nothrow)); // global access: ind_builddir (Thash, hash field builddir) // global access: c_builddir (Ptr) struct FBuilddir { // abt.FBuilddir - algo::Smallstr50 builddir; // Primary key - uname.compiler.cfg-arch - algo::Comment comment; // - bool select; // false - algo::cstring path; // Path for this builddir - algo_lib::FLockfile lockfile; // - algo_lib::Replscope R; // - abt::FCompiler* p_compiler; // reference to parent row - abt::FBuilddir* ind_builddir_next; // hash next + algo::Smallstr50 builddir; // Primary key - uname.compiler.cfg-arch + algo::Comment comment; // + bool select; // false + algo::cstring path; // Path for this builddir + algo_lib::FLockfile lockfile; // + algo_lib::Replscope R; // + abt::FCompiler* p_compiler; // reference to parent row + abt::FBuilddir* ind_builddir_next; // hash next + u32 ind_builddir_hashval; // hash value // value field abt.FBuilddir.R is not copiable // x-reference on abt.FBuilddir.p_compiler prevents copy // func:abt.FBuilddir..AssignOp @@ -267,10 +269,11 @@ void FBuilddir_Uninit(abt::FBuilddir& builddir) __attribute__((n // global access: cfg (Lary, by rowid) // global access: ind_cfg (Thash, hash field cfg) struct FCfg { // abt.FCfg: Build configuration - algo::Smallstr50 cfg; // - algo::Smallstr5 suffix; // - algo::Comment comment; // - abt::FCfg* ind_cfg_next; // hash next + algo::Smallstr50 cfg; // + algo::Smallstr5 suffix; // + algo::Comment comment; // + abt::FCfg* ind_cfg_next; // hash next + u32 ind_cfg_hashval; // hash value // func:abt.FCfg..AssignOp inline abt::FCfg& operator =(const abt::FCfg &rhs) = delete; // func:abt.FCfg..CopyCtor @@ -304,17 +307,18 @@ void FCfg_Uninit(abt::FCfg& cfg) __attribute__((nothrow)); // global access: ind_compiler (Thash, hash field compiler) // access: abt.FBuilddir.p_compiler (Upptr) struct FCompiler { // abt.FCompiler: Compiler - algo::Smallstr50 compiler; // - algo::Smallstr50 ranlib; // - algo::Smallstr50 ar; // - algo::Smallstr50 link; // - algo::Smallstr50 libext; // - algo::Smallstr20 exeext; // - algo::Smallstr20 pchext; // - algo::Smallstr20 objext; // - algo::Smallstr50 rc; // - algo::Comment comment; // - abt::FCompiler* ind_compiler_next; // hash next + algo::Smallstr50 compiler; // + algo::Smallstr50 ranlib; // + algo::Smallstr50 ar; // + algo::Smallstr50 link; // + algo::Smallstr50 libext; // + algo::Smallstr20 exeext; // + algo::Smallstr20 pchext; // + algo::Smallstr20 objext; // + algo::Smallstr50 rc; // + algo::Comment comment; // + abt::FCompiler* ind_compiler_next; // hash next + u32 ind_compiler_hashval; // hash value // func:abt.FCompiler..AssignOp abt::FCompiler& operator =(const abt::FCompiler &rhs) = delete; // func:abt.FCompiler..CopyCtor @@ -625,6 +629,9 @@ void ind_target_Remove(abt::FTarget& row) __attribute__((nothrow // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_target.Reserve void ind_target_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_target.AbsReserve +void ind_target_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -684,6 +691,9 @@ void ind_targsrc_Remove(abt::FTargsrc& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_targsrc.Reserve void ind_targsrc_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_targsrc.AbsReserve +void ind_targsrc_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -862,6 +872,9 @@ void ind_syscmd_Remove(abt::FSyscmd& row) __attribute__((nothrow // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_syscmd.Reserve void ind_syscmd_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_syscmd.AbsReserve +void ind_syscmd_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:abt.FDb.ind_running.EmptyQ @@ -884,6 +897,9 @@ void ind_running_Remove(abt::FSyscmd& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_running.Reserve void ind_running_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_running.AbsReserve +void ind_running_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:abt.FDb.ind_srcfile.EmptyQ @@ -906,6 +922,9 @@ void ind_srcfile_Remove(abt::FSrcfile& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_srcfile.Reserve void ind_srcfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_srcfile.AbsReserve +void ind_srcfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -965,6 +984,9 @@ void ind_cfg_Remove(abt::FCfg& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_cfg.Reserve void ind_cfg_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_cfg.AbsReserve +void ind_cfg_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1024,6 +1046,9 @@ void ind_uname_Remove(abt::FUname& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_uname.Reserve void ind_uname_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_uname.AbsReserve +void ind_uname_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1083,6 +1108,9 @@ void ind_compiler_Remove(abt::FCompiler& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_compiler.Reserve void ind_compiler_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_compiler.AbsReserve +void ind_compiler_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1142,6 +1170,9 @@ void ind_arch_Remove(abt::FArch& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_arch.Reserve void ind_arch_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_arch.AbsReserve +void ind_arch_AbsReserve(int n) __attribute__((nothrow)); // Remove all elements from heap and free memory used by the array. // func:abt.FDb.bh_syscmd.Dealloc @@ -1347,6 +1378,9 @@ void ind_syslib_Remove(abt::FSyslib& row) __attribute__((nothrow // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_syslib.Reserve void ind_syslib_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_syslib.AbsReserve +void ind_syslib_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1406,6 +1440,9 @@ void ind_include_Remove(abt::FInclude& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_include.Reserve void ind_include_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_include.AbsReserve +void ind_include_AbsReserve(int n) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -1423,6 +1460,11 @@ algo::cstring& sysincl_AllocAt(int at) __attribute__((__warn_unused_result // Reserve space. Insert N elements at the end of the array, return pointer to array // func:abt.FDb.sysincl.AllocN algo::aryptr sysincl_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:abt.FDb.sysincl.AllocNAt +algo::aryptr sysincl_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:abt.FDb.sysincl.EmptyQ inline bool sysincl_EmptyQ() __attribute__((nothrow)); @@ -1472,6 +1514,10 @@ algo::aryptr sysincl_AllocNVal(int n_elems, const algo::cstring& // Function returns success value. // func:abt.FDb.sysincl.ReadStrptrMaybe bool sysincl_ReadStrptrMaybe(algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:abt.FDb.sysincl.Insary +void sysincl_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // Return true if index is empty // func:abt.FDb.zs_origsel_target.EmptyQ @@ -1563,6 +1609,9 @@ void ind_ns_Remove(abt::FNs& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_ns.Reserve void ind_ns_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_ns.AbsReserve +void ind_ns_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1621,6 +1670,9 @@ void ind_filestat_Remove(abt::FFilestat& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_filestat.Reserve void ind_filestat_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_filestat.AbsReserve +void ind_filestat_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1683,6 +1735,9 @@ void ind_builddir_Remove(abt::FBuilddir& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:abt.FDb.ind_builddir.Reserve void ind_builddir_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt.FDb.ind_builddir.AbsReserve +void ind_builddir_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:abt.FDb.zd_inclstack.EmptyQ @@ -2009,12 +2064,13 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: filestat (Lary, by rowid) // global access: ind_filestat (Thash, hash field filename) struct FFilestat { // abt.FFilestat: Stat cache - abt::FFilestat* ind_filestat_next; // hash next - algo::cstring filename; // - algo::UnTime modtime; // - u64 size; // 0 - bool isdir; // false - bool exists; // false + abt::FFilestat* ind_filestat_next; // hash next + u32 ind_filestat_hashval; // hash value + algo::cstring filename; // + algo::UnTime modtime; // + u64 size; // 0 + bool isdir; // false + bool exists; // false // func:abt.FFilestat..AssignOp inline abt::FFilestat& operator =(const abt::FFilestat &rhs) = delete; // func:abt.FFilestat..CopyCtor @@ -2042,14 +2098,15 @@ void FFilestat_Uninit(abt::FFilestat& filestat) __attribute__((n // global access: ind_include (Thash, hash field include) // access: abt.FSrcfile.zd_include (Llist) struct FInclude { // abt.FInclude - abt::FInclude* ind_include_next; // hash next - algo::Smallstr200 include; // - bool sys; // false - algo::Comment comment; // - abt::FSrcfile* p_header; // reference to parent row - bool wantprint; // false - abt::FInclude* zd_include_next; // zslist link; -1 means not-in-list - abt::FInclude* zd_include_prev; // previous element + abt::FInclude* ind_include_next; // hash next + u32 ind_include_hashval; // hash value + algo::Smallstr200 include; // + bool sys; // false + algo::Comment comment; // + abt::FSrcfile* p_header; // reference to parent row + bool wantprint; // false + abt::FInclude* srcfile_zd_include_next; // zslist link; -1 means not-in-list + abt::FInclude* srcfile_zd_include_prev; // previous element // x-reference on abt.FInclude.p_header prevents copy // func:abt.FInclude..AssignOp inline abt::FInclude& operator =(const abt::FInclude &rhs) = delete; @@ -2091,11 +2148,12 @@ void FInclude_Uninit(abt::FInclude& include) __attribute__((noth // global access: ind_ns (Thash, hash field ns) // access: abt.FTarget.p_ns (Upptr) struct FNs { // abt.FNs - abt::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // + abt::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // // func:abt.FNs..AssignOp inline abt::FNs& operator =(const abt::FNs &rhs) = delete; // func:abt.FNs..CopyCtor @@ -2133,6 +2191,7 @@ void FNs_Uninit(abt::FNs& ns) __attribute__((nothrow)); // access: abt.FTarget.c_srcfile (Ptrary) struct FSrcfile { // abt.FSrcfile: Source file or header (key is pathname) abt::FSrcfile* ind_srcfile_next; // hash next + u32 ind_srcfile_hashval; // hash value abt::FSrcfile* zs_srcfile_read_next; // zslist link; -1 means not-in-list abt::FSrcfile* zd_inclstack_next; // zslist link; -1 means not-in-list abt::FSrcfile* zd_inclstack_prev; // previous element @@ -2184,7 +2243,7 @@ inline bool zd_include_EmptyQ(abt::FSrcfile& srcfile) __attribute__((__ inline abt::FInclude* zd_include_First(abt::FSrcfile& srcfile) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:abt.FSrcfile.zd_include.InLlistQ -inline bool zd_include_InLlistQ(abt::FInclude& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool srcfile_zd_include_InLlistQ(abt::FInclude& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:abt.FSrcfile.zd_include.Insert void zd_include_Insert(abt::FSrcfile& srcfile, abt::FInclude& row) __attribute__((nothrow)); @@ -2196,10 +2255,10 @@ inline abt::FInclude* zd_include_Last(abt::FSrcfile& srcfile) __attribute__((__w inline i32 zd_include_N(const abt::FSrcfile& srcfile) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:abt.FSrcfile.zd_include.Next -inline abt::FInclude* zd_include_Next(abt::FInclude &row) __attribute__((__warn_unused_result__, nothrow)); +inline abt::FInclude* srcfile_zd_include_Next(abt::FInclude &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:abt.FSrcfile.zd_include.Prev -inline abt::FInclude* zd_include_Prev(abt::FInclude &row) __attribute__((__warn_unused_result__, nothrow)); +inline abt::FInclude* srcfile_zd_include_Prev(abt::FInclude &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:abt.FSrcfile.zd_include.Remove void zd_include_Remove(abt::FSrcfile& srcfile, abt::FInclude& row) __attribute__((nothrow)); @@ -2244,31 +2303,33 @@ void FSrcfile_Uninit(abt::FSrcfile& srcfile) __attribute__((noth // access: abt.FTarget.syscmd_link (Ptr) // access: abt.FTarget.syscmd_end (Ptr) struct FSyscmd { // abt.FSyscmd: A build command - abt::FSyscmd* ind_syscmd_next; // hash next - abt::FSyscmd* ind_running_next; // hash next - i32 bh_syscmd_idx; // index in heap; -1 means not-in-heap - i64 syscmd; // 0 Step number - algo::cstring command; // Command to execute - i32 pid; // 0 PID, if running - i32 status; // 0 Exit status (if command has completed) - i32 nprereq; // 0 Number of live pre-requisites - bool fail_prereq; // false Set if one of pre-requisites fails - bool completed; // false Completed? - i32 maxtime; // 0 Optional max running time (used to use SIGALRM) - algo::cstring fstdout; // filename for stdout output - algo::cstring fstderr; // filename for stderr output - abt::FSyscmddep** c_prior_elems; // array of pointers - u32 c_prior_n; // array of pointers - u32 c_prior_max; // capacity of allocated array - abt::FSyscmddep** c_next_elems; // array of pointers - u32 c_next_n; // array of pointers - u32 c_next_max; // capacity of allocated array - i32 rowid; // 0 - algo_lib::FFildes fd_stdout; // fd for stdout - algo_lib::FFildes fd_stderr; // fd for stderr - u64 line_n; // 0 Number of lines attributed to this command - algo::cstring outfile; // - bool redirect; // true + abt::FSyscmd* ind_syscmd_next; // hash next + u32 ind_syscmd_hashval; // hash value + abt::FSyscmd* ind_running_next; // hash next + u32 ind_running_hashval; // hash value + i32 bh_syscmd_idx; // index in heap; -1 means not-in-heap + i64 syscmd; // 0 Step number + algo::cstring command; // Command to execute + i32 pid; // 0 PID, if running + i32 status; // 0 Exit status (if command has completed) + i32 nprereq; // 0 Number of live pre-requisites + bool fail_prereq; // false Set if one of pre-requisites fails + bool completed; // false Completed? + i32 maxtime; // 0 Optional max running time (used to use SIGALRM) + algo::cstring fstdout; // filename for stdout output + algo::cstring fstderr; // filename for stderr output + abt::FSyscmddep** c_prior_elems; // array of pointers + u32 c_prior_n; // array of pointers + u32 c_prior_max; // capacity of allocated array + abt::FSyscmddep** c_next_elems; // array of pointers + u32 c_next_n; // array of pointers + u32 c_next_max; // capacity of allocated array + i32 rowid; // 0 + algo_lib::FFildes fd_stdout; // fd for stdout + algo_lib::FFildes fd_stderr; // fd for stderr + u64 line_n; // 0 Number of lines attributed to this command + algo::cstring outfile; // + bool redirect; // true // reftype Ptrary of abt.FSyscmd.c_prior prohibits copy // reftype Ptrary of abt.FSyscmd.c_next prohibits copy // func:abt.FSyscmd..AssignOp @@ -2443,10 +2504,6 @@ void syscmddep_CopyOut(abt::FSyscmddep &row, dev::Syscmddep &out // func:abt.FSyscmddep.msghdr.CopyIn void syscmddep_CopyIn(abt::FSyscmddep &row, dev::Syscmddep &in) __attribute__((nothrow)); -// func:abt.FSyscmddep.syscmddep.Get -// this function is 'extrn' and implemented by user -algo::RspaceStr16 syscmddep_Get(abt::FSyscmddep& syscmddep) __attribute__((__warn_unused_result__, nothrow)); - // Set all fields to initial values. // func:abt.FSyscmddep..Init inline void FSyscmddep_Init(abt::FSyscmddep& syscmddep); @@ -2459,9 +2516,10 @@ void FSyscmddep_Uninit(abt::FSyscmddep& syscmddep) __attribute__ // global access: ind_syslib (Thash, hash field syslib) // access: abt.FTargsyslib.p_syslib (Upptr) struct FSyslib { // abt.FSyslib: System library - abt::FSyslib* ind_syslib_next; // hash next - algo::Smallstr50 syslib; // - algo::Comment comment; // + abt::FSyslib* ind_syslib_next; // hash next + u32 ind_syslib_hashval; // hash value + algo::Smallstr50 syslib; // + algo::Comment comment; // // func:abt.FSyslib..AssignOp inline abt::FSyslib& operator =(const abt::FSyslib &rhs) = delete; // func:abt.FSyslib..CopyCtor @@ -2545,6 +2603,7 @@ void FTargdep_Uninit(abt::FTargdep& targdep) __attribute__((noth // access: abt.FTargsrc.p_target (Upptr) struct FTarget { // abt.FTarget: Build target abt::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value abt::FTarget* zs_sel_target_next; // zslist link; -1 means not-in-list abt::FTarget* zs_origsel_target_next; // zslist link; -1 means not-in-list algo::Smallstr16 target; // Primary key - name of target @@ -2871,6 +2930,7 @@ void FTarget_Uninit(abt::FTarget& target) __attribute__((nothrow // access: abt.FTarget.c_targsrc (Ptrary) struct FTargsrc { // abt.FTargsrc: Source file for specific target abt::FTargsrc* ind_targsrc_next; // hash next + u32 ind_targsrc_hashval; // hash value algo::Smallstr100 targsrc; // algo::Comment comment; // abt::FTarget* p_target; // reference to parent row @@ -2954,6 +3014,9 @@ algo::Smallstr50 syslib_Get(abt::FTargsyslib& targsyslib) __attribute__((__w // func:abt.FTargsyslib.uname.Get algo::Smallstr50 uname_Get(abt::FTargsyslib& targsyslib) __attribute__((__warn_unused_result__, nothrow)); +// func:abt.FTargsyslib.prefix.Get +algo::Smallstr50 prefix_Get(abt::FTargsyslib& targsyslib) __attribute__((__warn_unused_result__, nothrow)); + // Set all fields to initial values. // func:abt.FTargsyslib..Init inline void FTargsyslib_Init(abt::FTargsyslib& targsyslib); @@ -3021,9 +3084,10 @@ void regx_target_Print(abt::FToolOpt& tool_opt, algo::cstring &o // global access: uname (Lary, by rowid) // global access: ind_uname (Thash, hash field uname) struct FUname { // abt.FUname: Unix name - abt::FUname* ind_uname_next; // hash next - algo::Smallstr50 uname; // - algo::Comment comment; // + abt::FUname* ind_uname_next; // hash next + u32 ind_uname_hashval; // hash value + algo::Smallstr50 uname; // + algo::Comment comment; // // func:abt.FUname..AssignOp inline abt::FUname& operator =(const abt::FUname &rhs) = delete; // func:abt.FUname..CopyCtor diff --git a/include/gen/abt_gen.inl.h b/include/gen/abt_gen.inl.h index ac37b9e5..878a3c14 100644 --- a/include/gen/abt_gen.inl.h +++ b/include/gen/abt_gen.inl.h @@ -35,6 +35,7 @@ // Set all fields to initial values. inline void abt::FArch_Init(abt::FArch& arch) { arch.ind_arch_next = (abt::FArch*)-1; // (abt.FDb.ind_arch) not-in-hash + arch.ind_arch_hashval = 0; // stored hash value } // --- abt.FArch..Ctor @@ -61,6 +62,7 @@ inline abt::FBuilddir::~FBuilddir() { // Set all fields to initial values. inline void abt::FCfg_Init(abt::FCfg& cfg) { cfg.ind_cfg_next = (abt::FCfg*)-1; // (abt.FDb.ind_cfg) not-in-hash + cfg.ind_cfg_hashval = 0; // stored hash value } // --- abt.FCfg..Ctor @@ -77,6 +79,7 @@ inline abt::FCfg::~FCfg() { // Set all fields to initial values. inline void abt::FCompiler_Init(abt::FCompiler& compiler) { compiler.ind_compiler_next = (abt::FCompiler*)-1; // (abt.FDb.ind_compiler) not-in-hash + compiler.ind_compiler_hashval = 0; // stored hash value } // --- abt.FCompiler..Ctor @@ -1835,6 +1838,7 @@ inline void abt::FFilestat_Init(abt::FFilestat& filestat) { filestat.isdir = bool(false); filestat.exists = bool(false); filestat.ind_filestat_next = (abt::FFilestat*)-1; // (abt.FDb.ind_filestat) not-in-hash + filestat.ind_filestat_hashval = 0; // stored hash value } // --- abt.FFilestat..Ctor @@ -1854,8 +1858,9 @@ inline void abt::FInclude_Init(abt::FInclude& include) { include.p_header = NULL; include.wantprint = bool(false); include.ind_include_next = (abt::FInclude*)-1; // (abt.FDb.ind_include) not-in-hash - include.zd_include_next = (abt::FInclude*)-1; // (abt.FSrcfile.zd_include) not-in-list - include.zd_include_prev = NULL; // (abt.FSrcfile.zd_include) + include.ind_include_hashval = 0; // stored hash value + include.srcfile_zd_include_next = (abt::FInclude*)-1; // (abt.FSrcfile.zd_include) not-in-list + include.srcfile_zd_include_prev = NULL; // (abt.FSrcfile.zd_include) } // --- abt.FInclude..Ctor @@ -1872,6 +1877,7 @@ inline abt::FInclude::~FInclude() { // Set all fields to initial values. inline void abt::FNs_Init(abt::FNs& ns) { ns.ind_ns_next = (abt::FNs*)-1; // (abt.FDb.ind_ns) not-in-hash + ns.ind_ns_hashval = 0; // stored hash value } // --- abt.FNs..Ctor @@ -1900,9 +1906,9 @@ inline abt::FInclude* abt::zd_include_First(abt::FSrcfile& srcfile) { // --- abt.FSrcfile.zd_include.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool abt::zd_include_InLlistQ(abt::FInclude& row) { +inline bool abt::srcfile_zd_include_InLlistQ(abt::FInclude& row) { bool result = false; - result = !(row.zd_include_next == (abt::FInclude*)-1); + result = !(row.srcfile_zd_include_next == (abt::FInclude*)-1); return result; } @@ -1922,14 +1928,14 @@ inline i32 abt::zd_include_N(const abt::FSrcfile& srcfile) { // --- abt.FSrcfile.zd_include.Next // Return pointer to next element in the list -inline abt::FInclude* abt::zd_include_Next(abt::FInclude &row) { - return row.zd_include_next; +inline abt::FInclude* abt::srcfile_zd_include_Next(abt::FInclude &row) { + return row.srcfile_zd_include_next; } // --- abt.FSrcfile.zd_include.Prev // Return pointer to previous element in the list -inline abt::FInclude* abt::zd_include_Prev(abt::FInclude &row) { - return row.zd_include_prev; +inline abt::FInclude* abt::srcfile_zd_include_Prev(abt::FInclude &row) { + return row.srcfile_zd_include_prev; } // --- abt.FSrcfile.zd_include.qLast @@ -1955,7 +1961,7 @@ inline bool abt::srcfile_zd_include_curs_ValidQ(srcfile_zd_include_curs &curs) { // --- abt.FSrcfile.zd_include_curs.Next // proceed to next item inline void abt::srcfile_zd_include_curs_Next(srcfile_zd_include_curs &curs) { - abt::FInclude *next = (*curs.row).zd_include_next; + abt::FInclude *next = (*curs.row).srcfile_zd_include_next; curs.row = next; } @@ -2176,6 +2182,7 @@ inline abt::FSyscmddep::~FSyscmddep() { // Set all fields to initial values. inline void abt::FSyslib_Init(abt::FSyslib& syslib) { syslib.ind_syslib_next = (abt::FSyslib*)-1; // (abt.FDb.ind_syslib) not-in-hash + syslib.ind_syslib_hashval = 0; // stored hash value } // --- abt.FSyslib..Ctor @@ -2616,6 +2623,7 @@ inline void abt::FTargsrc_Init(abt::FTargsrc& targsrc) { targsrc.p_target = NULL; targsrc.target_c_targsrc_in_ary = bool(false); targsrc.ind_targsrc_next = (abt::FTargsrc*)-1; // (abt.FDb.ind_targsrc) not-in-hash + targsrc.ind_targsrc_hashval = 0; // stored hash value } // --- abt.FTargsrc..Ctor @@ -2653,6 +2661,7 @@ inline abt::FToolOpt::FToolOpt() { // Set all fields to initial values. inline void abt::FUname_Init(abt::FUname& uname) { uname.ind_uname_next = (abt::FUname*)-1; // (abt.FDb.ind_uname) not-in-hash + uname.ind_uname_hashval = 0; // stored hash value } // --- abt.FUname..Ctor diff --git a/include/gen/abt_md_gen.h b/include/gen/abt_md_gen.h index e73bbbac..7e9dc635 100644 --- a/include/gen/abt_md_gen.h +++ b/include/gen/abt_md_gen.h @@ -44,46 +44,52 @@ enum { abt_md_FieldIdEnum_N = 1 }; // --- abt_md_TableIdEnum -enum abt_md_TableIdEnum { // abt_md.TableId.value - abt_md_TableId_atfdb_Comptest = 0 // atfdb.Comptest -> abt_md.FComptest - ,abt_md_TableId_atfdb_comptest = 0 // atfdb.comptest -> abt_md.FComptest - ,abt_md_TableId_dmmeta_Ctype = 1 // dmmeta.Ctype -> abt_md.FCtype - ,abt_md_TableId_dmmeta_ctype = 1 // dmmeta.ctype -> abt_md.FCtype - ,abt_md_TableId_dmmeta_Fconst = 2 // dmmeta.Fconst -> abt_md.FFconst - ,abt_md_TableId_dmmeta_fconst = 2 // dmmeta.fconst -> abt_md.FFconst - ,abt_md_TableId_dmmeta_Field = 3 // dmmeta.Field -> abt_md.FField - ,abt_md_TableId_dmmeta_field = 3 // dmmeta.field -> abt_md.FField - ,abt_md_TableId_dmmeta_Gconst = 4 // dmmeta.Gconst -> abt_md.FGconst - ,abt_md_TableId_dmmeta_gconst = 4 // dmmeta.gconst -> abt_md.FGconst - ,abt_md_TableId_dmmeta_Gstatic = 5 // dmmeta.Gstatic -> abt_md.FGstatic - ,abt_md_TableId_dmmeta_gstatic = 5 // dmmeta.gstatic -> abt_md.FGstatic - ,abt_md_TableId_dmmeta_Ns = 6 // dmmeta.Ns -> abt_md.FNs - ,abt_md_TableId_dmmeta_ns = 6 // dmmeta.ns -> abt_md.FNs - ,abt_md_TableId_dmmeta_Nstype = 7 // dmmeta.Nstype -> abt_md.FNstype - ,abt_md_TableId_dmmeta_nstype = 7 // dmmeta.nstype -> abt_md.FNstype - ,abt_md_TableId_dev_Readme = 8 // dev.Readme -> abt_md.FReadme - ,abt_md_TableId_dev_readme = 8 // dev.readme -> abt_md.FReadme - ,abt_md_TableId_dev_Readmesort = 9 // dev.Readmesort -> abt_md.FReadmesort - ,abt_md_TableId_dev_readmesort = 9 // dev.readmesort -> abt_md.FReadmesort - ,abt_md_TableId_dmmeta_Reftype = 10 // dmmeta.Reftype -> abt_md.FReftype - ,abt_md_TableId_dmmeta_reftype = 10 // dmmeta.reftype -> abt_md.FReftype - ,abt_md_TableId_dev_Scriptfile = 11 // dev.Scriptfile -> abt_md.FScriptfile - ,abt_md_TableId_dev_scriptfile = 11 // dev.scriptfile -> abt_md.FScriptfile - ,abt_md_TableId_dmmeta_Ssimfile = 12 // dmmeta.Ssimfile -> abt_md.FSsimfile - ,abt_md_TableId_dmmeta_ssimfile = 12 // dmmeta.ssimfile -> abt_md.FSsimfile - ,abt_md_TableId_dmmeta_Substr = 13 // dmmeta.Substr -> abt_md.FSubstr - ,abt_md_TableId_dmmeta_substr = 13 // dmmeta.substr -> abt_md.FSubstr - ,abt_md_TableId_dev_Targdep = 14 // dev.Targdep -> abt_md.FTargdep - ,abt_md_TableId_dev_targdep = 14 // dev.targdep -> abt_md.FTargdep - ,abt_md_TableId_dev_Target = 15 // dev.Target -> abt_md.FTarget - ,abt_md_TableId_dev_target = 15 // dev.target -> abt_md.FTarget - ,abt_md_TableId_dev_Targsrc = 16 // dev.Targsrc -> abt_md.FTargsrc - ,abt_md_TableId_dev_targsrc = 16 // dev.targsrc -> abt_md.FTargsrc - ,abt_md_TableId_amcdb_Tclass = 17 // amcdb.Tclass -> abt_md.FTclass - ,abt_md_TableId_amcdb_tclass = 17 // amcdb.tclass -> abt_md.FTclass -}; - -enum { abt_md_TableIdEnum_N = 36 }; +enum abt_md_TableIdEnum { // abt_md.TableId.value + abt_md_TableId_atfdb_Comptest = 0 // atfdb.Comptest -> abt_md.FComptest + ,abt_md_TableId_atfdb_comptest = 0 // atfdb.comptest -> abt_md.FComptest + ,abt_md_TableId_dmmeta_Ctype = 1 // dmmeta.Ctype -> abt_md.FCtype + ,abt_md_TableId_dmmeta_ctype = 1 // dmmeta.ctype -> abt_md.FCtype + ,abt_md_TableId_dmmeta_Dispatch = 2 // dmmeta.Dispatch -> abt_md.FDispatch + ,abt_md_TableId_dmmeta_dispatch = 2 // dmmeta.dispatch -> abt_md.FDispatch + ,abt_md_TableId_dmmeta_DispatchMsg = 3 // dmmeta.DispatchMsg -> abt_md.FDispatchMsg + ,abt_md_TableId_dmmeta_dispatch_msg = 3 // dmmeta.dispatch_msg -> abt_md.FDispatchMsg + ,abt_md_TableId_dmmeta_Fconst = 4 // dmmeta.Fconst -> abt_md.FFconst + ,abt_md_TableId_dmmeta_fconst = 4 // dmmeta.fconst -> abt_md.FFconst + ,abt_md_TableId_dmmeta_Field = 5 // dmmeta.Field -> abt_md.FField + ,abt_md_TableId_dmmeta_field = 5 // dmmeta.field -> abt_md.FField + ,abt_md_TableId_dmmeta_Finput = 6 // dmmeta.Finput -> abt_md.FFinput + ,abt_md_TableId_dmmeta_finput = 6 // dmmeta.finput -> abt_md.FFinput + ,abt_md_TableId_dmmeta_Gconst = 7 // dmmeta.Gconst -> abt_md.FGconst + ,abt_md_TableId_dmmeta_gconst = 7 // dmmeta.gconst -> abt_md.FGconst + ,abt_md_TableId_dmmeta_Gstatic = 8 // dmmeta.Gstatic -> abt_md.FGstatic + ,abt_md_TableId_dmmeta_gstatic = 8 // dmmeta.gstatic -> abt_md.FGstatic + ,abt_md_TableId_dmmeta_Ns = 9 // dmmeta.Ns -> abt_md.FNs + ,abt_md_TableId_dmmeta_ns = 9 // dmmeta.ns -> abt_md.FNs + ,abt_md_TableId_dmmeta_Nstype = 10 // dmmeta.Nstype -> abt_md.FNstype + ,abt_md_TableId_dmmeta_nstype = 10 // dmmeta.nstype -> abt_md.FNstype + ,abt_md_TableId_dev_Readmefile = 11 // dev.Readmefile -> abt_md.FReadmefile + ,abt_md_TableId_dev_readmefile = 11 // dev.readmefile -> abt_md.FReadmefile + ,abt_md_TableId_dev_Readmesort = 12 // dev.Readmesort -> abt_md.FReadmesort + ,abt_md_TableId_dev_readmesort = 12 // dev.readmesort -> abt_md.FReadmesort + ,abt_md_TableId_dmmeta_Reftype = 13 // dmmeta.Reftype -> abt_md.FReftype + ,abt_md_TableId_dmmeta_reftype = 13 // dmmeta.reftype -> abt_md.FReftype + ,abt_md_TableId_dev_Scriptfile = 14 // dev.Scriptfile -> abt_md.FScriptfile + ,abt_md_TableId_dev_scriptfile = 14 // dev.scriptfile -> abt_md.FScriptfile + ,abt_md_TableId_dmmeta_Ssimfile = 15 // dmmeta.Ssimfile -> abt_md.FSsimfile + ,abt_md_TableId_dmmeta_ssimfile = 15 // dmmeta.ssimfile -> abt_md.FSsimfile + ,abt_md_TableId_dmmeta_Substr = 16 // dmmeta.Substr -> abt_md.FSubstr + ,abt_md_TableId_dmmeta_substr = 16 // dmmeta.substr -> abt_md.FSubstr + ,abt_md_TableId_dev_Targdep = 17 // dev.Targdep -> abt_md.FTargdep + ,abt_md_TableId_dev_targdep = 17 // dev.targdep -> abt_md.FTargdep + ,abt_md_TableId_dev_Target = 18 // dev.Target -> abt_md.FTarget + ,abt_md_TableId_dev_target = 18 // dev.target -> abt_md.FTarget + ,abt_md_TableId_dev_Targsrc = 19 // dev.Targsrc -> abt_md.FTargsrc + ,abt_md_TableId_dev_targsrc = 19 // dev.targsrc -> abt_md.FTargsrc + ,abt_md_TableId_amcdb_Tclass = 20 // amcdb.Tclass -> abt_md.FTclass + ,abt_md_TableId_amcdb_tclass = 20 // amcdb.tclass -> abt_md.FTclass +}; + +enum { abt_md_TableIdEnum_N = 42 }; namespace abt_md { // gen:ns_pkeytypedef } // gen:ns_pkeytypedef @@ -95,16 +101,21 @@ namespace atfdb { struct Comptest; } namespace dmmeta { struct Ctype; } namespace abt_md { struct FNs; } namespace abt_md { struct FDirscan; } +namespace dmmeta { struct Dispatch; } +namespace dmmeta { struct DispatchMsg; } +namespace abt_md { struct FCtype; } namespace dmmeta { struct Fconst; } namespace dmmeta { struct Field; } -namespace abt_md { struct FCtype; } namespace abt_md { struct FMdsection; } +namespace dmmeta { struct Finput; } +namespace abt_md { struct FField; } namespace dmmeta { struct Gconst; } namespace dmmeta { struct Gstatic; } namespace dev { struct Mdsection; } +namespace abt_md { struct FFileSection; } namespace dmmeta { struct Ns; } namespace dmmeta { struct Nstype; } -namespace dev { struct Readme; } +namespace dev { struct Readmefile; } namespace abt_md { struct FSsimfile; } namespace abt_md { struct FScriptfile; } namespace dev { struct Readmesort; } @@ -113,7 +124,6 @@ namespace abt_md { struct FTclass; } namespace dev { struct Scriptfile; } namespace dmmeta { struct Ssimfile; } namespace dmmeta { struct Substr; } -namespace abt_md { struct FField; } namespace dev { struct Targdep; } namespace abt_md { struct FTarget; } namespace dev { struct Target; } @@ -122,7 +132,7 @@ namespace amcdb { struct Tclass; } namespace abt_md { struct ctype_c_field_curs; } namespace abt_md { struct ctype_c_field_arg_curs; } namespace abt_md { struct mdsection_zd_file_section_curs; } -namespace abt_md { struct _db_readme_curs; } +namespace abt_md { struct _db_readmefile_curs; } namespace abt_md { struct _db_mdsection_curs; } namespace abt_md { struct _db_file_section_curs; } namespace abt_md { struct _db_bh_file_section_curs; } @@ -146,26 +156,35 @@ namespace abt_md { struct _db_readmesort_curs; } namespace abt_md { struct _db_gstatic_curs; } namespace abt_md { struct _db_target_curs; } namespace abt_md { struct _db_targdep_curs; } +namespace abt_md { struct _db_finput_curs; } +namespace abt_md { struct _db_zd_scanns_curs; } +namespace abt_md { struct _db_dispatch_curs; } +namespace abt_md { struct _db_dispatch_msg_curs; } namespace abt_md { struct FDirscan_bh_dirent_curs; } namespace abt_md { struct FDirscan_dirent_curs; } +namespace abt_md { struct dispatch_c_dispatch_msg_curs; } namespace abt_md { struct field_c_fconst_curs; } namespace abt_md { struct ns_c_targsrc_curs; } namespace abt_md { struct ns_c_ctype_curs; } namespace abt_md { struct ns_c_comptest_curs; } +namespace abt_md { struct ns_zd_finput_curs; } +namespace abt_md { struct ns_c_dispatch_curs; } namespace abt_md { struct target_c_targdep_curs; } namespace abt_md { struct FAnchor; } namespace abt_md { struct FComptest; } namespace abt_md { struct trace; } namespace abt_md { struct FDb; } namespace abt_md { struct FDirent; } +namespace abt_md { struct FDispatch; } +namespace abt_md { struct FDispatchMsg; } namespace abt_md { struct FFconst; } -namespace abt_md { struct FFileSection; } +namespace abt_md { struct FFinput; } namespace abt_md { struct FGconst; } namespace abt_md { struct FGstatic; } namespace abt_md { struct FHumanText; } namespace abt_md { struct FLink; } namespace abt_md { struct FNstype; } -namespace abt_md { struct FReadme; } +namespace abt_md { struct FReadmefile; } namespace abt_md { struct FReadmesort; } namespace abt_md { struct FReftype; } namespace abt_md { struct FSubstr; } @@ -184,8 +203,9 @@ namespace abt_md { // gen:ns_print_struct // global access: anchor (Lary, by rowid) // global access: ind_anchor (Thash, hash field anchor) struct FAnchor { // abt_md.FAnchor - algo::cstring anchor; // - abt_md::FAnchor* ind_anchor_next; // hash next + algo::cstring anchor; // + abt_md::FAnchor* ind_anchor_next; // hash next + u32 ind_anchor_hashval; // hash value // func:abt_md.FAnchor..AssignOp inline abt_md::FAnchor& operator =(const abt_md::FAnchor &rhs) = delete; // func:abt_md.FAnchor..CopyCtor @@ -215,13 +235,16 @@ struct FComptest { // abt_md.FComptest algo::Smallstr50 comptest; // i32 timeout; // 10 bool memcheck; // true + bool coverage; // true u8 exit_code; // 0 Exit code to check + i32 ncore; // 1 + i32 repeat; // 1 Number of times to repeat the test algo::Comment comment; // bool ns_c_comptest_in_ary; // false membership flag // func:abt_md.FComptest..AssignOp - inline abt_md::FComptest& operator =(const abt_md::FComptest &rhs) = delete; + abt_md::FComptest& operator =(const abt_md::FComptest &rhs) = delete; // func:abt_md.FComptest..CopyCtor - inline FComptest(const abt_md::FComptest &rhs) = delete; + FComptest(const abt_md::FComptest &rhs) = delete; private: // func:abt_md.FComptest..Ctor inline FComptest() __attribute__((nothrow)); @@ -248,7 +271,7 @@ algo::Smallstr50 testname_Get(abt_md::FComptest& comptest) __attribute__((__ // Set all fields to initial values. // func:abt_md.FComptest..Init -inline void FComptest_Init(abt_md::FComptest& comptest); +void FComptest_Init(abt_md::FComptest& comptest); // func:abt_md.FComptest..Uninit void FComptest_Uninit(abt_md::FComptest& comptest) __attribute__((nothrow)); @@ -256,10 +279,11 @@ void FComptest_Uninit(abt_md::FComptest& comptest) __attribute__ // create: abt_md.FDb.ctype (Lary) // global access: ctype (Lary, by rowid) // global access: ind_ctype (Thash, hash field ctype) +// access: abt_md.FDispatchMsg.p_ctype (Upptr) // access: abt_md.FField.p_arg (Upptr) // access: abt_md.FField.p_ctype (Upptr) // access: abt_md.FNs.c_ctype (Ptrary) -// access: abt_md.FReadme.p_ctype (Upptr) +// access: abt_md.FReadmefile.p_ctype (Upptr) // access: abt_md.FSsimfile.p_ctype (Upptr) struct FCtype { // abt_md.FCtype algo::Smallstr100 ctype; // Identifier. must be ns.typename @@ -274,6 +298,7 @@ struct FCtype { // abt_md.FCtype u32 c_field_arg_max; // capacity of allocated array bool ns_c_ctype_in_ary; // false membership flag abt_md::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // x-reference on abt_md.FCtype.c_ssimfile prevents copy // reftype Ptrary of abt_md.FCtype.c_field prohibits copy // x-reference on abt_md.FCtype.p_ns prevents copy @@ -472,7 +497,7 @@ inline bool zd_file_section_EmptyQ(abt_md::FMdsection& mdsection) __att inline abt_md::FFileSection* zd_file_section_First(abt_md::FMdsection& mdsection) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:abt_md.FMdsection.zd_file_section.InLlistQ -inline bool zd_file_section_InLlistQ(abt_md::FFileSection& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool mdsection_zd_file_section_InLlistQ(abt_md::FFileSection& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:abt_md.FMdsection.zd_file_section.Insert void zd_file_section_Insert(abt_md::FMdsection& mdsection, abt_md::FFileSection& row) __attribute__((nothrow)); @@ -484,10 +509,10 @@ inline abt_md::FFileSection* zd_file_section_Last(abt_md::FMdsection& mdsection) inline i32 zd_file_section_N(const abt_md::FMdsection& mdsection) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:abt_md.FMdsection.zd_file_section.Next -inline abt_md::FFileSection* zd_file_section_Next(abt_md::FFileSection &row) __attribute__((__warn_unused_result__, nothrow)); +inline abt_md::FFileSection* mdsection_zd_file_section_Next(abt_md::FFileSection &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:abt_md.FMdsection.zd_file_section.Prev -inline abt_md::FFileSection* zd_file_section_Prev(abt_md::FFileSection &row) __attribute__((__warn_unused_result__, nothrow)); +inline abt_md::FFileSection* mdsection_zd_file_section_Prev(abt_md::FFileSection &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:abt_md.FMdsection.zd_file_section.Remove void zd_file_section_Remove(abt_md::FMdsection& mdsection, abt_md::FFileSection& row) __attribute__((nothrow)); @@ -534,20 +559,20 @@ void trace_Print(abt_md::trace& row, algo::cstring& str) __attri // create: abt_md.FDb._db (Global) struct FDb { // abt_md.FDb: In-memory database for abt_md command::abt_md cmdline; // - abt_md::FReadme* readme_lary[32]; // level array - i32 readme_n; // number of elements in array - abt_md::FReadme** ind_readme_buckets_elems; // pointer to bucket array - i32 ind_readme_buckets_n; // number of elements in bucket array - i32 ind_readme_n; // number of elements in the hash table - u128 mdsection_data[sizeu128(abt_md::FMdsection,25)]; // place for data + abt_md::FReadmefile* readmefile_lary[32]; // level array + i32 readmefile_n; // number of elements in array + abt_md::FReadmefile** ind_readmefile_buckets_elems; // pointer to bucket array + i32 ind_readmefile_buckets_n; // number of elements in bucket array + i32 ind_readmefile_n; // number of elements in the hash table + u128 mdsection_data[sizeu128(abt_md::FMdsection,26)]; // place for data i32 mdsection_n; // number of elems current in existence - enum { mdsection_max = 25 }; + enum { mdsection_max = 26 }; abt_md::FFileSection* file_section_lary[32]; // level array i32 file_section_n; // number of elements in array abt_md::FFileSection** bh_file_section_elems; // binary heap by sortkey i32 bh_file_section_n; // number of elements in the heap i32 bh_file_section_max; // max elements in bh_file_section_elems - abt_md::FReadme* c_readme; // optional pointer + abt_md::FReadmefile* c_readmefile; // optional pointer abt_md::FNs* ns_lary[32]; // level array i32 ns_n; // number of elements in array abt_md::FNs** ind_ns_buckets_elems; // pointer to bucket array @@ -625,6 +650,18 @@ struct FDb { // abt_md.FDb: In-memory database for abt_md abt_md::FTarget** ind_target_buckets_elems; // pointer to bucket array i32 ind_target_buckets_n; // number of elements in bucket array i32 ind_target_n; // number of elements in the hash table + abt_md::FFinput* finput_lary[32]; // level array + i32 finput_n; // number of elements in array + abt_md::FNs* zd_scanns_head; // zero-terminated doubly linked list + i32 zd_scanns_n; // zero-terminated doubly linked list + abt_md::FNs* zd_scanns_tail; // pointer to last element + abt_md::FDispatch* dispatch_lary[32]; // level array + i32 dispatch_n; // number of elements in array + abt_md::FDispatch** ind_dispatch_buckets_elems; // pointer to bucket array + i32 ind_dispatch_buckets_n; // number of elements in bucket array + i32 ind_dispatch_n; // number of elements in the hash table + abt_md::FDispatchMsg* dispatch_msg_lary[32]; // level array + i32 dispatch_msg_n; // number of elements in array abt_md::trace trace; // }; @@ -675,68 +712,71 @@ bool _db_XrefMaybe(); // Allocate memory for new default row. // If out of memory, process is killed. -// func:abt_md.FDb.readme.Alloc -abt_md::FReadme& readme_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// func:abt_md.FDb.readmefile.Alloc +abt_md::FReadmefile& readmefile_Alloc() __attribute__((__warn_unused_result__, nothrow)); // Allocate memory for new element. If out of memory, return NULL. -// func:abt_md.FDb.readme.AllocMaybe -abt_md::FReadme* readme_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// func:abt_md.FDb.readmefile.AllocMaybe +abt_md::FReadmefile* readmefile_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); // Create new row from struct. // Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -// func:abt_md.FDb.readme.InsertMaybe -abt_md::FReadme* readme_InsertMaybe(const dev::Readme &value) __attribute__((nothrow)); +// func:abt_md.FDb.readmefile.InsertMaybe +abt_md::FReadmefile* readmefile_InsertMaybe(const dev::Readmefile &value) __attribute__((nothrow)); // Allocate space for one element. If no memory available, return NULL. -// func:abt_md.FDb.readme.AllocMem -void* readme_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// func:abt_md.FDb.readmefile.AllocMem +void* readmefile_AllocMem() __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty -// func:abt_md.FDb.readme.EmptyQ -inline bool readme_EmptyQ() __attribute__((nothrow, pure)); +// func:abt_md.FDb.readmefile.EmptyQ +inline bool readmefile_EmptyQ() __attribute__((nothrow, pure)); // Look up row by row id. Return NULL if out of range -// func:abt_md.FDb.readme.Find -inline abt_md::FReadme* readme_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:abt_md.FDb.readmefile.Find +inline abt_md::FReadmefile* readmefile_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to last element of array, or NULL if array is empty -// func:abt_md.FDb.readme.Last -inline abt_md::FReadme* readme_Last() __attribute__((nothrow, pure)); +// func:abt_md.FDb.readmefile.Last +inline abt_md::FReadmefile* readmefile_Last() __attribute__((nothrow, pure)); // Return number of items in the pool -// func:abt_md.FDb.readme.N -inline i32 readme_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:abt_md.FDb.readmefile.N +inline i32 readmefile_N() __attribute__((__warn_unused_result__, nothrow, pure)); // Remove all elements from Lary -// func:abt_md.FDb.readme.RemoveAll -void readme_RemoveAll() __attribute__((nothrow)); +// func:abt_md.FDb.readmefile.RemoveAll +void readmefile_RemoveAll() __attribute__((nothrow)); // Delete last element of array. Do nothing if array is empty. -// func:abt_md.FDb.readme.RemoveLast -void readme_RemoveLast() __attribute__((nothrow)); +// func:abt_md.FDb.readmefile.RemoveLast +void readmefile_RemoveLast() __attribute__((nothrow)); // 'quick' Access row by row id. No bounds checking. -// func:abt_md.FDb.readme.qFind -inline abt_md::FReadme& readme_qFind(u64 t) __attribute__((nothrow, pure)); +// func:abt_md.FDb.readmefile.qFind +inline abt_md::FReadmefile& readmefile_qFind(u64 t) __attribute__((nothrow, pure)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:abt_md.FDb.readme.XrefMaybe -bool readme_XrefMaybe(abt_md::FReadme &row); +// func:abt_md.FDb.readmefile.XrefMaybe +bool readmefile_XrefMaybe(abt_md::FReadmefile &row); // Return true if hash is empty -// func:abt_md.FDb.ind_readme.EmptyQ -inline bool ind_readme_EmptyQ() __attribute__((nothrow)); +// func:abt_md.FDb.ind_readmefile.EmptyQ +inline bool ind_readmefile_EmptyQ() __attribute__((nothrow)); // Find row by key. Return NULL if not found. -// func:abt_md.FDb.ind_readme.Find -abt_md::FReadme* ind_readme_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// func:abt_md.FDb.ind_readmefile.Find +abt_md::FReadmefile* ind_readmefile_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); // Look up row by key and return reference. Throw exception if not found -// func:abt_md.FDb.ind_readme.FindX -abt_md::FReadme& ind_readme_FindX(const algo::strptr& key); +// func:abt_md.FDb.ind_readmefile.FindX +abt_md::FReadmefile& ind_readmefile_FindX(const algo::strptr& key); // Find row by key. If not found, create and x-reference a new row with with this key. -// func:abt_md.FDb.ind_readme.GetOrCreate -abt_md::FReadme& ind_readme_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); +// func:abt_md.FDb.ind_readmefile.GetOrCreate +abt_md::FReadmefile& ind_readmefile_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); // Return number of items in the hash -// func:abt_md.FDb.ind_readme.N -inline i32 ind_readme_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:abt_md.FDb.ind_readmefile.N +inline i32 ind_readmefile_N() __attribute__((__warn_unused_result__, nothrow, pure)); // Insert row into hash table. Return true if row is reachable through the hash after the function completes. -// func:abt_md.FDb.ind_readme.InsertMaybe -bool ind_readme_InsertMaybe(abt_md::FReadme& row) __attribute__((nothrow)); +// func:abt_md.FDb.ind_readmefile.InsertMaybe +bool ind_readmefile_InsertMaybe(abt_md::FReadmefile& row) __attribute__((nothrow)); // Remove reference to element from hash index. If element is not in hash, do nothing -// func:abt_md.FDb.ind_readme.Remove -void ind_readme_Remove(abt_md::FReadme& row) __attribute__((nothrow)); +// func:abt_md.FDb.ind_readmefile.Remove +void ind_readmefile_Remove(abt_md::FReadmefile& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. -// func:abt_md.FDb.ind_readme.Reserve -void ind_readme_Reserve(int n) __attribute__((nothrow)); +// func:abt_md.FDb.ind_readmefile.Reserve +void ind_readmefile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_readmefile.AbsReserve +void ind_readmefile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -761,7 +801,7 @@ inline abt_md::FMdsection* mdsection_Find(i32 t) __attribute__((__warn_unused_re // Return array pointer by value // func:abt_md.FDb.mdsection.Getary inline algo::aryptr mdsection_Getary() __attribute__((nothrow)); -// Return constant 25 -- max. number of items in the pool +// Return constant 26 -- max. number of items in the pool // func:abt_md.FDb.mdsection.Max inline i32 mdsection_Max() __attribute__((nothrow)); // Return number of items in the array @@ -926,6 +966,9 @@ void ind_ns_Remove(abt_md::FNs& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_ns.Reserve void ind_ns_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_ns.AbsReserve +void ind_ns_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -988,6 +1031,9 @@ void ind_ssimfile_Remove(abt_md::FSsimfile& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_ssimfile.Reserve void ind_ssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_ssimfile.AbsReserve +void ind_ssimfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1050,6 +1096,9 @@ void ind_ctype_Remove(abt_md::FCtype& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_ctype.Reserve void ind_ctype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_ctype.AbsReserve +void ind_ctype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1112,6 +1161,9 @@ void ind_field_Remove(abt_md::FField& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_field.Reserve void ind_field_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_field.AbsReserve +void ind_field_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1250,6 +1302,9 @@ void ind_human_text_Remove(abt_md::FHumanText& row) __attribute_ // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_human_text.Reserve void ind_human_text_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_human_text.AbsReserve +void ind_human_text_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1315,6 +1370,9 @@ void ind_scriptfile_Remove(abt_md::FScriptfile& row) __attribute // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_scriptfile.Reserve void ind_scriptfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_scriptfile.AbsReserve +void ind_scriptfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1380,6 +1438,9 @@ void ind_nstype_Remove(abt_md::FNstype& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_nstype.Reserve void ind_nstype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_nstype.AbsReserve +void ind_nstype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1481,6 +1542,9 @@ void ind_anchor_Remove(abt_md::FAnchor& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_anchor.Reserve void ind_anchor_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_anchor.AbsReserve +void ind_anchor_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1622,6 +1686,9 @@ void ind_tclass_Remove(abt_md::FTclass& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_tclass.Reserve void ind_tclass_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_tclass.AbsReserve +void ind_tclass_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1767,6 +1834,9 @@ void ind_readmesort_Remove(abt_md::FReadmesort& row) __attribute // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_readmesort.Reserve void ind_readmesort_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_readmesort.AbsReserve +void ind_readmesort_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1832,6 +1902,9 @@ void ind_gstatic_Remove(abt_md::FGstatic& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_gstatic.Reserve void ind_gstatic_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_gstatic.AbsReserve +void ind_gstatic_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1934,19 +2007,204 @@ void ind_target_Remove(abt_md::FTarget& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:abt_md.FDb.ind_target.Reserve void ind_target_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_target.AbsReserve +void ind_target_AbsReserve(int n) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:abt_md.FDb.finput.Alloc +abt_md::FFinput& finput_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:abt_md.FDb.finput.AllocMaybe +abt_md::FFinput* finput_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:abt_md.FDb.finput.InsertMaybe +abt_md::FFinput* finput_InsertMaybe(const dmmeta::Finput &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:abt_md.FDb.finput.AllocMem +void* finput_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:abt_md.FDb.finput.EmptyQ +inline bool finput_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:abt_md.FDb.finput.Find +inline abt_md::FFinput* finput_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:abt_md.FDb.finput.Last +inline abt_md::FFinput* finput_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:abt_md.FDb.finput.N +inline i32 finput_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:abt_md.FDb.finput.RemoveAll +void finput_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:abt_md.FDb.finput.RemoveLast +void finput_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:abt_md.FDb.finput.qFind +inline abt_md::FFinput& finput_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:abt_md.FDb.finput.XrefMaybe +bool finput_XrefMaybe(abt_md::FFinput &row); + +// Return true if index is empty +// func:abt_md.FDb.zd_scanns.EmptyQ +inline bool zd_scanns_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:abt_md.FDb.zd_scanns.First +inline abt_md::FNs* zd_scanns_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:abt_md.FDb.zd_scanns.InLlistQ +inline bool zd_scanns_InLlistQ(abt_md::FNs& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:abt_md.FDb.zd_scanns.Insert +void zd_scanns_Insert(abt_md::FNs& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:abt_md.FDb.zd_scanns.Last +inline abt_md::FNs* zd_scanns_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return number of items in the linked list +// func:abt_md.FDb.zd_scanns.N +inline i32 zd_scanns_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:abt_md.FDb.zd_scanns.Next +inline abt_md::FNs* zd_scanns_Next(abt_md::FNs &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:abt_md.FDb.zd_scanns.Prev +inline abt_md::FNs* zd_scanns_Prev(abt_md::FNs &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:abt_md.FDb.zd_scanns.Remove +void zd_scanns_Remove(abt_md::FNs& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:abt_md.FDb.zd_scanns.RemoveAll +void zd_scanns_RemoveAll() __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// func:abt_md.FDb.zd_scanns.RemoveFirst +abt_md::FNs* zd_scanns_RemoveFirst() __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:abt_md.FDb.zd_scanns.qLast +inline abt_md::FNs& zd_scanns_qLast() __attribute__((__warn_unused_result__, nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:abt_md.FDb.dispatch.Alloc +abt_md::FDispatch& dispatch_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:abt_md.FDb.dispatch.AllocMaybe +abt_md::FDispatch* dispatch_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:abt_md.FDb.dispatch.InsertMaybe +abt_md::FDispatch* dispatch_InsertMaybe(const dmmeta::Dispatch &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:abt_md.FDb.dispatch.AllocMem +void* dispatch_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:abt_md.FDb.dispatch.EmptyQ +inline bool dispatch_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:abt_md.FDb.dispatch.Find +inline abt_md::FDispatch* dispatch_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:abt_md.FDb.dispatch.Last +inline abt_md::FDispatch* dispatch_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:abt_md.FDb.dispatch.N +inline i32 dispatch_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:abt_md.FDb.dispatch.RemoveAll +void dispatch_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:abt_md.FDb.dispatch.RemoveLast +void dispatch_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:abt_md.FDb.dispatch.qFind +inline abt_md::FDispatch& dispatch_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:abt_md.FDb.dispatch.XrefMaybe +bool dispatch_XrefMaybe(abt_md::FDispatch &row); + +// Return true if hash is empty +// func:abt_md.FDb.ind_dispatch.EmptyQ +inline bool ind_dispatch_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:abt_md.FDb.ind_dispatch.Find +abt_md::FDispatch* ind_dispatch_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:abt_md.FDb.ind_dispatch.FindX +abt_md::FDispatch& ind_dispatch_FindX(const algo::strptr& key); +// Return number of items in the hash +// func:abt_md.FDb.ind_dispatch.N +inline i32 ind_dispatch_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:abt_md.FDb.ind_dispatch.InsertMaybe +bool ind_dispatch_InsertMaybe(abt_md::FDispatch& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:abt_md.FDb.ind_dispatch.Remove +void ind_dispatch_Remove(abt_md::FDispatch& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:abt_md.FDb.ind_dispatch.Reserve +void ind_dispatch_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:abt_md.FDb.ind_dispatch.AbsReserve +void ind_dispatch_AbsReserve(int n) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:abt_md.FDb.dispatch_msg.Alloc +abt_md::FDispatchMsg& dispatch_msg_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:abt_md.FDb.dispatch_msg.AllocMaybe +abt_md::FDispatchMsg* dispatch_msg_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:abt_md.FDb.dispatch_msg.InsertMaybe +abt_md::FDispatchMsg* dispatch_msg_InsertMaybe(const dmmeta::DispatchMsg &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:abt_md.FDb.dispatch_msg.AllocMem +void* dispatch_msg_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:abt_md.FDb.dispatch_msg.EmptyQ +inline bool dispatch_msg_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:abt_md.FDb.dispatch_msg.Find +inline abt_md::FDispatchMsg* dispatch_msg_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:abt_md.FDb.dispatch_msg.Last +inline abt_md::FDispatchMsg* dispatch_msg_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:abt_md.FDb.dispatch_msg.N +inline i32 dispatch_msg_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:abt_md.FDb.dispatch_msg.RemoveAll +void dispatch_msg_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:abt_md.FDb.dispatch_msg.RemoveLast +void dispatch_msg_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:abt_md.FDb.dispatch_msg.qFind +inline abt_md::FDispatchMsg& dispatch_msg_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:abt_md.FDb.dispatch_msg.XrefMaybe +bool dispatch_msg_XrefMaybe(abt_md::FDispatchMsg &row); // cursor points to valid item -// func:abt_md.FDb.readme_curs.Reset -inline void _db_readme_curs_Reset(_db_readme_curs &curs, abt_md::FDb &parent) __attribute__((nothrow)); +// func:abt_md.FDb.readmefile_curs.Reset +inline void _db_readmefile_curs_Reset(_db_readmefile_curs &curs, abt_md::FDb &parent) __attribute__((nothrow)); // cursor points to valid item -// func:abt_md.FDb.readme_curs.ValidQ -inline bool _db_readme_curs_ValidQ(_db_readme_curs &curs) __attribute__((nothrow)); +// func:abt_md.FDb.readmefile_curs.ValidQ +inline bool _db_readmefile_curs_ValidQ(_db_readmefile_curs &curs) __attribute__((nothrow)); // proceed to next item -// func:abt_md.FDb.readme_curs.Next -inline void _db_readme_curs_Next(_db_readme_curs &curs) __attribute__((nothrow)); +// func:abt_md.FDb.readmefile_curs.Next +inline void _db_readmefile_curs_Next(_db_readmefile_curs &curs) __attribute__((nothrow)); // item access -// func:abt_md.FDb.readme_curs.Access -inline abt_md::FReadme& _db_readme_curs_Access(_db_readme_curs &curs) __attribute__((nothrow)); +// func:abt_md.FDb.readmefile_curs.Access +inline abt_md::FReadmefile& _db_readmefile_curs_Access(_db_readmefile_curs &curs) __attribute__((nothrow)); // cursor points to valid item // func:abt_md.FDb.mdsection_curs.Reset inline void _db_mdsection_curs_Reset(_db_mdsection_curs &curs, abt_md::FDb &parent) __attribute__((nothrow)); @@ -2224,6 +2482,54 @@ inline void _db_targdep_curs_Next(_db_targdep_curs &curs) __attribute__ // item access // func:abt_md.FDb.targdep_curs.Access inline abt_md::FTargdep& _db_targdep_curs_Access(_db_targdep_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FDb.finput_curs.Reset +inline void _db_finput_curs_Reset(_db_finput_curs &curs, abt_md::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FDb.finput_curs.ValidQ +inline bool _db_finput_curs_ValidQ(_db_finput_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:abt_md.FDb.finput_curs.Next +inline void _db_finput_curs_Next(_db_finput_curs &curs) __attribute__((nothrow)); +// item access +// func:abt_md.FDb.finput_curs.Access +inline abt_md::FFinput& _db_finput_curs_Access(_db_finput_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FDb.zd_scanns_curs.Reset +inline void _db_zd_scanns_curs_Reset(_db_zd_scanns_curs &curs, abt_md::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FDb.zd_scanns_curs.ValidQ +inline bool _db_zd_scanns_curs_ValidQ(_db_zd_scanns_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:abt_md.FDb.zd_scanns_curs.Next +inline void _db_zd_scanns_curs_Next(_db_zd_scanns_curs &curs) __attribute__((nothrow)); +// item access +// func:abt_md.FDb.zd_scanns_curs.Access +inline abt_md::FNs& _db_zd_scanns_curs_Access(_db_zd_scanns_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FDb.dispatch_curs.Reset +inline void _db_dispatch_curs_Reset(_db_dispatch_curs &curs, abt_md::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FDb.dispatch_curs.ValidQ +inline bool _db_dispatch_curs_ValidQ(_db_dispatch_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:abt_md.FDb.dispatch_curs.Next +inline void _db_dispatch_curs_Next(_db_dispatch_curs &curs) __attribute__((nothrow)); +// item access +// func:abt_md.FDb.dispatch_curs.Access +inline abt_md::FDispatch& _db_dispatch_curs_Access(_db_dispatch_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FDb.dispatch_msg_curs.Reset +inline void _db_dispatch_msg_curs_Reset(_db_dispatch_msg_curs &curs, abt_md::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FDb.dispatch_msg_curs.ValidQ +inline bool _db_dispatch_msg_curs_ValidQ(_db_dispatch_msg_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:abt_md.FDb.dispatch_msg_curs.Next +inline void _db_dispatch_msg_curs_Next(_db_dispatch_msg_curs &curs) __attribute__((nothrow)); +// item access +// func:abt_md.FDb.dispatch_msg_curs.Access +inline abt_md::FDispatchMsg& _db_dispatch_msg_curs_Access(_db_dispatch_msg_curs &curs) __attribute__((nothrow)); // Set all fields to initial values. // func:abt_md.FDb..Init void FDb_Init(); @@ -2234,12 +2540,12 @@ void FDb_Uninit() __attribute__((nothrow)); // create: abt_md.FDirscan.dirent (Lary) // access: abt_md.FDirscan.bh_dirent (Bheap) struct FDirent { // abt_md.FDirent - bool is_dir; // false - abt_md::FDirscan* p_dirscan; // reference to parent row - algo::cstring filename; // - algo::cstring sortfld; // - algo::cstring pathname; // - i32 bh_dirent_idx; // index in heap; -1 means not-in-heap + bool is_dir; // false + abt_md::FDirscan* p_dirscan; // reference to parent row + algo::cstring filename; // + algo::cstring sortfld; // + algo::cstring pathname; // + i32 parent_bh_dirent_idx; // index in heap; -1 means not-in-heap // func:abt_md.FDirent..AssignOp inline abt_md::FDirent& operator =(const abt_md::FDirent &rhs) = delete; // func:abt_md.FDirent..CopyCtor @@ -2392,6 +2698,160 @@ void FDirscan_Init(abt_md::FDirscan& parent); // func:abt_md.FDirscan..Uninit void FDirscan_Uninit(abt_md::FDirscan& parent) __attribute__((nothrow)); +// --- abt_md.FDispatch +// create: abt_md.FDb.dispatch (Lary) +// global access: dispatch (Lary, by rowid) +// global access: ind_dispatch (Thash, hash field dispatch) +// access: abt_md.FNs.c_dispatch (Ptrary) +struct FDispatch { // abt_md.FDispatch + abt_md::FDispatch* ind_dispatch_next; // hash next + u32 ind_dispatch_hashval; // hash value + algo::Smallstr50 dispatch; // Primary key (ns.name) + bool unk; // false Want default case? + bool read; // false Generate read function + bool print; // false Generate print function + bool haslen; // false Include length in dispatch function + bool call; // false Generate call to user-defined function + bool strict; // false Only dispatch if length matches exactly + bool dyn; // false Use dynamic memory allocation: new, delete instead of ByteAry + bool kafka; // false generate kafka codec + algo::Comment comment; // + abt_md::FDispatchMsg** c_dispatch_msg_elems; // array of pointers + u32 c_dispatch_msg_n; // array of pointers + u32 c_dispatch_msg_max; // capacity of allocated array + bool ns_c_dispatch_in_ary; // false membership flag + // reftype Ptrary of abt_md.FDispatch.c_dispatch_msg prohibits copy + // func:abt_md.FDispatch..AssignOp + abt_md::FDispatch& operator =(const abt_md::FDispatch &rhs) = delete; + // reftype Ptrary of abt_md.FDispatch.c_dispatch_msg prohibits copy + // func:abt_md.FDispatch..CopyCtor + FDispatch(const abt_md::FDispatch &rhs) = delete; +private: + // func:abt_md.FDispatch..Ctor + inline FDispatch() __attribute__((nothrow)); + // func:abt_md.FDispatch..Dtor + inline ~FDispatch() __attribute__((nothrow)); + friend abt_md::FDispatch& dispatch_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend abt_md::FDispatch* dispatch_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void dispatch_RemoveAll() __attribute__((nothrow)); + friend void dispatch_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:abt_md.FDispatch.base.CopyOut +void dispatch_CopyOut(abt_md::FDispatch &row, dmmeta::Dispatch &out) __attribute__((nothrow)); +// Copy fields in to row +// func:abt_md.FDispatch.base.CopyIn +void dispatch_CopyIn(abt_md::FDispatch &row, dmmeta::Dispatch &in) __attribute__((nothrow)); + +// func:abt_md.FDispatch.ns.Get +algo::Smallstr16 ns_Get(abt_md::FDispatch& dispatch) __attribute__((__warn_unused_result__, nothrow)); + +// func:abt_md.FDispatch.name.Get +algo::Smallstr50 name_Get(abt_md::FDispatch& dispatch) __attribute__((__warn_unused_result__, nothrow)); + +// Return true if index is empty +// func:abt_md.FDispatch.c_dispatch_msg.EmptyQ +inline bool c_dispatch_msg_EmptyQ(abt_md::FDispatch& dispatch) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:abt_md.FDispatch.c_dispatch_msg.Find +inline abt_md::FDispatchMsg* c_dispatch_msg_Find(abt_md::FDispatch& dispatch, u32 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array of pointers +// func:abt_md.FDispatch.c_dispatch_msg.Getary +inline algo::aryptr c_dispatch_msg_Getary(abt_md::FDispatch& dispatch) __attribute__((nothrow)); +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +// func:abt_md.FDispatch.c_dispatch_msg.Insert +void c_dispatch_msg_Insert(abt_md::FDispatch& dispatch, abt_md::FDispatchMsg& row) __attribute__((nothrow)); +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +// func:abt_md.FDispatch.c_dispatch_msg.InsertMaybe +bool c_dispatch_msg_InsertMaybe(abt_md::FDispatch& dispatch, abt_md::FDispatchMsg& row) __attribute__((nothrow)); +// Return number of items in the pointer array +// func:abt_md.FDispatch.c_dispatch_msg.N +inline i32 c_dispatch_msg_N(const abt_md::FDispatch& dispatch) __attribute__((__warn_unused_result__, nothrow, pure)); +// Find element using linear scan. If element is in array, remove, otherwise do nothing +// func:abt_md.FDispatch.c_dispatch_msg.Remove +void c_dispatch_msg_Remove(abt_md::FDispatch& dispatch, abt_md::FDispatchMsg& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:abt_md.FDispatch.c_dispatch_msg.RemoveAll +inline void c_dispatch_msg_RemoveAll(abt_md::FDispatch& dispatch) __attribute__((nothrow)); +// Reserve space in index for N more elements; +// func:abt_md.FDispatch.c_dispatch_msg.Reserve +void c_dispatch_msg_Reserve(abt_md::FDispatch& dispatch, u32 n) __attribute__((nothrow)); +// Return reference without bounds checking +// func:abt_md.FDispatch.c_dispatch_msg.qFind +inline abt_md::FDispatchMsg& c_dispatch_msg_qFind(abt_md::FDispatch& dispatch, u32 idx) __attribute__((nothrow)); +// True if row is in any ptrary instance +// func:abt_md.FDispatch.c_dispatch_msg.InAryQ +inline bool dispatch_c_dispatch_msg_InAryQ(abt_md::FDispatchMsg& row) __attribute__((nothrow)); +// Reference to last element without bounds checking +// func:abt_md.FDispatch.c_dispatch_msg.qLast +inline abt_md::FDispatchMsg& c_dispatch_msg_qLast(abt_md::FDispatch& dispatch) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:abt_md.FDispatch..Init +void FDispatch_Init(abt_md::FDispatch& dispatch); +// func:abt_md.FDispatch.c_dispatch_msg_curs.Reset +inline void dispatch_c_dispatch_msg_curs_Reset(dispatch_c_dispatch_msg_curs &curs, abt_md::FDispatch &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FDispatch.c_dispatch_msg_curs.ValidQ +inline bool dispatch_c_dispatch_msg_curs_ValidQ(dispatch_c_dispatch_msg_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:abt_md.FDispatch.c_dispatch_msg_curs.Next +inline void dispatch_c_dispatch_msg_curs_Next(dispatch_c_dispatch_msg_curs &curs) __attribute__((nothrow)); +// item access +// func:abt_md.FDispatch.c_dispatch_msg_curs.Access +inline abt_md::FDispatchMsg& dispatch_c_dispatch_msg_curs_Access(dispatch_c_dispatch_msg_curs &curs) __attribute__((nothrow)); +// func:abt_md.FDispatch..Uninit +void FDispatch_Uninit(abt_md::FDispatch& dispatch) __attribute__((nothrow)); + +// --- abt_md.FDispatchMsg +// create: abt_md.FDb.dispatch_msg (Lary) +// global access: dispatch_msg (Lary, by rowid) +// access: abt_md.FDispatch.c_dispatch_msg (Ptrary) +struct FDispatchMsg { // abt_md.FDispatchMsg + algo::Smallstr100 dispatch_msg; // + algo::Comment comment; // + abt_md::FCtype* p_ctype; // reference to parent row + bool dispatch_c_dispatch_msg_in_ary; // false membership flag + // x-reference on abt_md.FDispatchMsg.p_ctype prevents copy + // func:abt_md.FDispatchMsg..AssignOp + inline abt_md::FDispatchMsg& operator =(const abt_md::FDispatchMsg &rhs) = delete; + // x-reference on abt_md.FDispatchMsg.p_ctype prevents copy + // func:abt_md.FDispatchMsg..CopyCtor + inline FDispatchMsg(const abt_md::FDispatchMsg &rhs) = delete; +private: + // func:abt_md.FDispatchMsg..Ctor + inline FDispatchMsg() __attribute__((nothrow)); + // func:abt_md.FDispatchMsg..Dtor + inline ~FDispatchMsg() __attribute__((nothrow)); + friend abt_md::FDispatchMsg& dispatch_msg_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend abt_md::FDispatchMsg* dispatch_msg_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void dispatch_msg_RemoveAll() __attribute__((nothrow)); + friend void dispatch_msg_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:abt_md.FDispatchMsg.base.CopyOut +void dispatch_msg_CopyOut(abt_md::FDispatchMsg &row, dmmeta::DispatchMsg &out) __attribute__((nothrow)); +// Copy fields in to row +// func:abt_md.FDispatchMsg.base.CopyIn +void dispatch_msg_CopyIn(abt_md::FDispatchMsg &row, dmmeta::DispatchMsg &in) __attribute__((nothrow)); + +// func:abt_md.FDispatchMsg.dispatch.Get +algo::Smallstr50 dispatch_Get(abt_md::FDispatchMsg& dispatch_msg) __attribute__((__warn_unused_result__, nothrow)); + +// func:abt_md.FDispatchMsg.ctype.Get +algo::Smallstr100 ctype_Get(abt_md::FDispatchMsg& dispatch_msg) __attribute__((__warn_unused_result__, nothrow)); + +// Set all fields to initial values. +// func:abt_md.FDispatchMsg..Init +inline void FDispatchMsg_Init(abt_md::FDispatchMsg& dispatch_msg); +// func:abt_md.FDispatchMsg..Uninit +void FDispatchMsg_Uninit(abt_md::FDispatchMsg& dispatch_msg) __attribute__((nothrow)); + // --- abt_md.FFconst // create: abt_md.FDb.fconst (Lary) // global access: fconst (Lary, by rowid) @@ -2441,9 +2901,11 @@ void FFconst_Uninit(abt_md::FFconst& fconst) __attribute__((noth // global access: ind_field (Thash, hash field field) // access: abt_md.FCtype.c_field (Ptrary) // access: abt_md.FCtype.c_field_arg (Ptrary) +// access: abt_md.FFinput.p_field (Upptr) // access: abt_md.FSubstr.p_srcfield (Upptr) struct FField { // abt_md.FField abt_md::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -2579,15 +3041,15 @@ void FField_Uninit(abt_md::FField& field) __attribute__((nothrow // access: abt_md.FMdsection.step (Hook) // access: abt_md.FMdsection.zd_file_section (Llist) struct FFileSection { // abt_md.FFileSection - abt_md::FFileSection* zd_file_section_next; // zslist link; -1 means not-in-list - abt_md::FFileSection* zd_file_section_prev; // previous element - i32 bh_file_section_idx; // index in heap; -1 means not-in-heap - algo::cstring title; // First line - algo::cstring text; // Remaining lines - i32 sortkey; // 0 Sort key - bool select; // true Selected for processing - i32 firstline; // 0 Line in file where section starts - abt_md::FMdsection* p_mdsection; // reference to parent row + abt_md::FFileSection* mdsection_zd_file_section_next; // zslist link; -1 means not-in-list + abt_md::FFileSection* mdsection_zd_file_section_prev; // previous element + i32 bh_file_section_idx; // index in heap; -1 means not-in-heap + algo::cstring title; // First line + algo::cstring text; // Remaining lines + i32 sortkey; // 0 Sort key + bool select; // true Selected for processing + i32 firstline; // 0 Line in file where section starts + abt_md::FMdsection* p_mdsection; // reference to parent row // func:abt_md.FFileSection..AssignOp inline abt_md::FFileSection& operator =(const abt_md::FFileSection &rhs) = delete; // func:abt_md.FFileSection..CopyCtor @@ -2609,6 +3071,52 @@ inline void FFileSection_Init(abt_md::FFileSection& file_section); // func:abt_md.FFileSection..Uninit void FFileSection_Uninit(abt_md::FFileSection& file_section) __attribute__((nothrow)); +// --- abt_md.FFinput +// create: abt_md.FDb.finput (Lary) +// global access: finput (Lary, by rowid) +// access: abt_md.FNs.zd_finput (Llist) +struct FFinput { // abt_md.FFinput + algo::Smallstr100 field; // Target field to read + bool extrn; // false Call user-provided function + bool update; // false + bool strict; // true Exist process if record contains error + algo::Comment comment; // + abt_md::FField* p_field; // reference to parent row + abt_md::FFinput* ns_zd_finput_next; // zslist link; -1 means not-in-list + abt_md::FFinput* ns_zd_finput_prev; // previous element + // x-reference on abt_md.FFinput.p_field prevents copy + // func:abt_md.FFinput..AssignOp + inline abt_md::FFinput& operator =(const abt_md::FFinput &rhs) = delete; + // x-reference on abt_md.FFinput.p_field prevents copy + // func:abt_md.FFinput..CopyCtor + inline FFinput(const abt_md::FFinput &rhs) = delete; +private: + // func:abt_md.FFinput..Ctor + inline FFinput() __attribute__((nothrow)); + // func:abt_md.FFinput..Dtor + inline ~FFinput() __attribute__((nothrow)); + friend abt_md::FFinput& finput_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend abt_md::FFinput* finput_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void finput_RemoveAll() __attribute__((nothrow)); + friend void finput_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:abt_md.FFinput.base.CopyOut +void finput_CopyOut(abt_md::FFinput &row, dmmeta::Finput &out) __attribute__((nothrow)); +// Copy fields in to row +// func:abt_md.FFinput.base.CopyIn +void finput_CopyIn(abt_md::FFinput &row, dmmeta::Finput &in) __attribute__((nothrow)); + +// func:abt_md.FFinput.ns.Get +algo::Smallstr16 ns_Get(abt_md::FFinput& finput) __attribute__((__warn_unused_result__, nothrow)); + +// Set all fields to initial values. +// func:abt_md.FFinput..Init +inline void FFinput_Init(abt_md::FFinput& finput); +// func:abt_md.FFinput..Uninit +void FFinput_Uninit(abt_md::FFinput& finput) __attribute__((nothrow)); + // --- abt_md.FGconst // create: abt_md.FDb.gconst (Lary) // global access: gconst (Lary, by rowid) @@ -2654,9 +3162,10 @@ void FGconst_Uninit(abt_md::FGconst& gconst) __attribute__((noth // global access: gstatic (Lary, by rowid) // global access: ind_gstatic (Thash, hash field field) struct FGstatic { // abt_md.FGstatic - abt_md::FGstatic* ind_gstatic_next; // hash next - algo::Smallstr100 field; // - algo::Comment comment; // + abt_md::FGstatic* ind_gstatic_next; // hash next + u32 ind_gstatic_hashval; // hash value + algo::Smallstr100 field; // + algo::Comment comment; // // func:abt_md.FGstatic..AssignOp inline abt_md::FGstatic& operator =(const abt_md::FGstatic &rhs) = delete; // func:abt_md.FGstatic..CopyCtor @@ -2692,11 +3201,12 @@ void FGstatic_Uninit(abt_md::FGstatic& gstatic) __attribute__((n // create: abt_md.FDb.human_text (Tpool) // global access: ind_human_text (Thash, hash field key) struct FHumanText { // abt_md.FHumanText - abt_md::FHumanText* human_text_next; // Pointer to next free element int tpool - abt_md::FHumanText* ind_human_text_next; // hash next - algo::cstring key; // - algo::cstring text; // - bool used; // false + abt_md::FHumanText* human_text_next; // Pointer to next free element int tpool + abt_md::FHumanText* ind_human_text_next; // hash next + u32 ind_human_text_hashval; // hash value + algo::cstring key; // + algo::cstring text; // + bool used; // false // func:abt_md.FHumanText..AssignOp inline abt_md::FHumanText& operator =(const abt_md::FHumanText &rhs) = delete; // func:abt_md.FHumanText..CopyCtor @@ -2738,36 +3248,50 @@ struct FLink { // abt_md.FLink // create: abt_md.FDb.ns (Lary) // global access: ns (Lary, by rowid) // global access: ind_ns (Thash, hash field ns) +// global access: zd_scanns (Llist) // access: abt_md.FCtype.p_ns (Upptr) -// access: abt_md.FReadme.p_ns (Upptr) +// access: abt_md.FReadmefile.p_ns (Upptr) // access: abt_md.FTarget.p_ns (Upptr) struct FNs { // abt_md.FNs - abt_md::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // - abt_md::FReadme* c_readme; // optional pointer - abt_md::FTargsrc** c_targsrc_elems; // array of pointers - u32 c_targsrc_n; // array of pointers - u32 c_targsrc_max; // capacity of allocated array - abt_md::FCtype** c_ctype_elems; // array of pointers - u32 c_ctype_n; // array of pointers - u32 c_ctype_max; // capacity of allocated array - abt_md::FComptest** c_comptest_elems; // array of pointers - u32 c_comptest_n; // array of pointers - u32 c_comptest_max; // capacity of allocated array - abt_md::FTarget* c_target; // optional pointer + abt_md::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + abt_md::FNs* zd_scanns_next; // zslist link; -1 means not-in-list + abt_md::FNs* zd_scanns_prev; // previous element + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // + abt_md::FReadmefile* c_readmefile; // optional pointer + abt_md::FTargsrc** c_targsrc_elems; // array of pointers + u32 c_targsrc_n; // array of pointers + u32 c_targsrc_max; // capacity of allocated array + abt_md::FCtype** c_ctype_elems; // array of pointers + u32 c_ctype_n; // array of pointers + u32 c_ctype_max; // capacity of allocated array + abt_md::FComptest** c_comptest_elems; // array of pointers + u32 c_comptest_n; // array of pointers + u32 c_comptest_max; // capacity of allocated array + abt_md::FTarget* c_target; // optional pointer + abt_md::FFinput* zd_finput_head; // zero-terminated doubly linked list + i32 zd_finput_n; // zero-terminated doubly linked list + abt_md::FFinput* zd_finput_tail; // pointer to last element + abt_md::FDispatch** c_dispatch_elems; // array of pointers + u32 c_dispatch_n; // array of pointers + u32 c_dispatch_max; // capacity of allocated array // reftype Ptrary of abt_md.FNs.c_targsrc prohibits copy // reftype Ptrary of abt_md.FNs.c_ctype prohibits copy // reftype Ptrary of abt_md.FNs.c_comptest prohibits copy // x-reference on abt_md.FNs.c_target prevents copy + // reftype Llist of abt_md.FNs.zd_finput prohibits copy + // reftype Ptrary of abt_md.FNs.c_dispatch prohibits copy // func:abt_md.FNs..AssignOp abt_md::FNs& operator =(const abt_md::FNs &rhs) = delete; // reftype Ptrary of abt_md.FNs.c_targsrc prohibits copy // reftype Ptrary of abt_md.FNs.c_ctype prohibits copy // reftype Ptrary of abt_md.FNs.c_comptest prohibits copy // x-reference on abt_md.FNs.c_target prevents copy + // reftype Llist of abt_md.FNs.zd_finput prohibits copy + // reftype Ptrary of abt_md.FNs.c_dispatch prohibits copy // func:abt_md.FNs..CopyCtor FNs(const abt_md::FNs &rhs) = delete; private: @@ -2915,9 +3439,86 @@ inline bool c_target_InsertMaybe(abt_md::FNs& ns, abt_md::FTarget& row) // func:abt_md.FNs.c_target.Remove inline void c_target_Remove(abt_md::FNs& ns, abt_md::FTarget& row) __attribute__((nothrow)); +// Return true if index is empty +// func:abt_md.FNs.zd_finput.EmptyQ +inline bool zd_finput_EmptyQ(abt_md::FNs& ns) __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:abt_md.FNs.zd_finput.First +inline abt_md::FFinput* zd_finput_First(abt_md::FNs& ns) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:abt_md.FNs.zd_finput.InLlistQ +inline bool ns_zd_finput_InLlistQ(abt_md::FFinput& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:abt_md.FNs.zd_finput.Insert +void zd_finput_Insert(abt_md::FNs& ns, abt_md::FFinput& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:abt_md.FNs.zd_finput.Last +inline abt_md::FFinput* zd_finput_Last(abt_md::FNs& ns) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return number of items in the linked list +// func:abt_md.FNs.zd_finput.N +inline i32 zd_finput_N(const abt_md::FNs& ns) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:abt_md.FNs.zd_finput.Next +inline abt_md::FFinput* ns_zd_finput_Next(abt_md::FFinput &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:abt_md.FNs.zd_finput.Prev +inline abt_md::FFinput* ns_zd_finput_Prev(abt_md::FFinput &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:abt_md.FNs.zd_finput.Remove +void zd_finput_Remove(abt_md::FNs& ns, abt_md::FFinput& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:abt_md.FNs.zd_finput.RemoveAll +void zd_finput_RemoveAll(abt_md::FNs& ns) __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// func:abt_md.FNs.zd_finput.RemoveFirst +abt_md::FFinput* zd_finput_RemoveFirst(abt_md::FNs& ns) __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:abt_md.FNs.zd_finput.qLast +inline abt_md::FFinput& zd_finput_qLast(abt_md::FNs& ns) __attribute__((__warn_unused_result__, nothrow)); + +// Return true if index is empty +// func:abt_md.FNs.c_dispatch.EmptyQ +inline bool c_dispatch_EmptyQ(abt_md::FNs& ns) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:abt_md.FNs.c_dispatch.Find +inline abt_md::FDispatch* c_dispatch_Find(abt_md::FNs& ns, u32 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array of pointers +// func:abt_md.FNs.c_dispatch.Getary +inline algo::aryptr c_dispatch_Getary(abt_md::FNs& ns) __attribute__((nothrow)); +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +// func:abt_md.FNs.c_dispatch.Insert +void c_dispatch_Insert(abt_md::FNs& ns, abt_md::FDispatch& row) __attribute__((nothrow)); +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +// func:abt_md.FNs.c_dispatch.InsertMaybe +bool c_dispatch_InsertMaybe(abt_md::FNs& ns, abt_md::FDispatch& row) __attribute__((nothrow)); +// Return number of items in the pointer array +// func:abt_md.FNs.c_dispatch.N +inline i32 c_dispatch_N(const abt_md::FNs& ns) __attribute__((__warn_unused_result__, nothrow, pure)); +// Find element using linear scan. If element is in array, remove, otherwise do nothing +// func:abt_md.FNs.c_dispatch.Remove +void c_dispatch_Remove(abt_md::FNs& ns, abt_md::FDispatch& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:abt_md.FNs.c_dispatch.RemoveAll +inline void c_dispatch_RemoveAll(abt_md::FNs& ns) __attribute__((nothrow)); +// Reserve space in index for N more elements; +// func:abt_md.FNs.c_dispatch.Reserve +void c_dispatch_Reserve(abt_md::FNs& ns, u32 n) __attribute__((nothrow)); +// Return reference without bounds checking +// func:abt_md.FNs.c_dispatch.qFind +inline abt_md::FDispatch& c_dispatch_qFind(abt_md::FNs& ns, u32 idx) __attribute__((nothrow)); +// True if row is in any ptrary instance +// func:abt_md.FNs.c_dispatch.InAryQ +inline bool ns_c_dispatch_InAryQ(abt_md::FDispatch& row) __attribute__((nothrow)); +// Reference to last element without bounds checking +// func:abt_md.FNs.c_dispatch.qLast +inline abt_md::FDispatch& c_dispatch_qLast(abt_md::FNs& ns) __attribute__((nothrow)); + // Set all fields to initial values. // func:abt_md.FNs..Init -inline void FNs_Init(abt_md::FNs& ns); +void FNs_Init(abt_md::FNs& ns); // func:abt_md.FNs.c_targsrc_curs.Reset inline void ns_c_targsrc_curs_Reset(ns_c_targsrc_curs &curs, abt_md::FNs &parent) __attribute__((nothrow)); // cursor points to valid item @@ -2951,6 +3552,29 @@ inline void ns_c_comptest_curs_Next(ns_c_comptest_curs &curs) __attribu // item access // func:abt_md.FNs.c_comptest_curs.Access inline abt_md::FComptest& ns_c_comptest_curs_Access(ns_c_comptest_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FNs.zd_finput_curs.Reset +inline void ns_zd_finput_curs_Reset(ns_zd_finput_curs &curs, abt_md::FNs &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FNs.zd_finput_curs.ValidQ +inline bool ns_zd_finput_curs_ValidQ(ns_zd_finput_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:abt_md.FNs.zd_finput_curs.Next +inline void ns_zd_finput_curs_Next(ns_zd_finput_curs &curs) __attribute__((nothrow)); +// item access +// func:abt_md.FNs.zd_finput_curs.Access +inline abt_md::FFinput& ns_zd_finput_curs_Access(ns_zd_finput_curs &curs) __attribute__((nothrow)); +// func:abt_md.FNs.c_dispatch_curs.Reset +inline void ns_c_dispatch_curs_Reset(ns_c_dispatch_curs &curs, abt_md::FNs &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:abt_md.FNs.c_dispatch_curs.ValidQ +inline bool ns_c_dispatch_curs_ValidQ(ns_c_dispatch_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:abt_md.FNs.c_dispatch_curs.Next +inline void ns_c_dispatch_curs_Next(ns_c_dispatch_curs &curs) __attribute__((nothrow)); +// item access +// func:abt_md.FNs.c_dispatch_curs.Access +inline abt_md::FDispatch& ns_c_dispatch_curs_Access(ns_c_dispatch_curs &curs) __attribute__((nothrow)); // func:abt_md.FNs..Uninit void FNs_Uninit(abt_md::FNs& ns) __attribute__((nothrow)); @@ -2959,9 +3583,10 @@ void FNs_Uninit(abt_md::FNs& ns) __attribute__((nothrow)); // global access: nstype (Lary, by rowid) // global access: ind_nstype (Thash, hash field nstype) struct FNstype { // abt_md.FNstype - abt_md::FNstype* ind_nstype_next; // hash next - algo::Smallstr50 nstype; // - algo::Comment comment; // + abt_md::FNstype* ind_nstype_next; // hash next + u32 ind_nstype_hashval; // hash value + algo::Smallstr50 nstype; // + algo::Comment comment; // // func:abt_md.FNstype..AssignOp inline abt_md::FNstype& operator =(const abt_md::FNstype &rhs) = delete; // func:abt_md.FNstype..CopyCtor @@ -2990,61 +3615,63 @@ inline void FNstype_Init(abt_md::FNstype& nstype); // func:abt_md.FNstype..Uninit void FNstype_Uninit(abt_md::FNstype& nstype) __attribute__((nothrow)); -// --- abt_md.FReadme -// create: abt_md.FDb.readme (Lary) -// global access: readme (Lary, by rowid) -// global access: ind_readme (Thash, hash field gitfile) -// global access: c_readme (Ptr) -// access: abt_md.FNs.c_readme (Ptr) -struct FReadme { // abt_md.FReadme - abt_md::FReadme* ind_readme_next; // hash next - algo::Smallstr200 gitfile; // - bool inl; // false - bool sandbox; // false - algo::Smallstr100 filter; // - algo::Comment comment; // - abt_md::FNs* p_ns; // reference to parent row - abt_md::FSsimfile* p_ssimfile; // reference to parent row - abt_md::FCtype* p_ctype; // reference to parent row - abt_md::FScriptfile* p_scriptfile; // reference to parent row - bool select; // false - // func:abt_md.FReadme..AssignOp - abt_md::FReadme& operator =(const abt_md::FReadme &rhs) = delete; - // func:abt_md.FReadme..CopyCtor - FReadme(const abt_md::FReadme &rhs) = delete; +// --- abt_md.FReadmefile +// create: abt_md.FDb.readmefile (Lary) +// global access: readmefile (Lary, by rowid) +// global access: ind_readmefile (Thash, hash field gitfile) +// global access: c_readmefile (Ptr) +// access: abt_md.FNs.c_readmefile (Ptr) +struct FReadmefile { // abt_md.FReadmefile + abt_md::FReadmefile* ind_readmefile_next; // hash next + u32 ind_readmefile_hashval; // hash value + algo::Smallstr200 gitfile; // + bool inl; // false + bool sandbox; // false + algo::Smallstr100 filter; // + algo::Comment comment; // + abt_md::FNs* p_ns; // reference to parent row + abt_md::FSsimfile* p_ssimfile; // reference to parent row + abt_md::FCtype* p_ctype; // reference to parent row + abt_md::FScriptfile* p_scriptfile; // reference to parent row + bool select; // false + // func:abt_md.FReadmefile..AssignOp + abt_md::FReadmefile& operator =(const abt_md::FReadmefile &rhs) = delete; + // func:abt_md.FReadmefile..CopyCtor + FReadmefile(const abt_md::FReadmefile &rhs) = delete; private: - // func:abt_md.FReadme..Ctor - inline FReadme() __attribute__((nothrow)); - // func:abt_md.FReadme..Dtor - inline ~FReadme() __attribute__((nothrow)); - friend abt_md::FReadme& readme_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend abt_md::FReadme* readme_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void readme_RemoveAll() __attribute__((nothrow)); - friend void readme_RemoveLast() __attribute__((nothrow)); + // func:abt_md.FReadmefile..Ctor + inline FReadmefile() __attribute__((nothrow)); + // func:abt_md.FReadmefile..Dtor + inline ~FReadmefile() __attribute__((nothrow)); + friend abt_md::FReadmefile& readmefile_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend abt_md::FReadmefile* readmefile_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void readmefile_RemoveAll() __attribute__((nothrow)); + friend void readmefile_RemoveLast() __attribute__((nothrow)); }; // Copy fields out of row -// func:abt_md.FReadme.base.CopyOut -void readme_CopyOut(abt_md::FReadme &row, dev::Readme &out) __attribute__((nothrow)); +// func:abt_md.FReadmefile.base.CopyOut +void readmefile_CopyOut(abt_md::FReadmefile &row, dev::Readmefile &out) __attribute__((nothrow)); // Copy fields in to row -// func:abt_md.FReadme.base.CopyIn -void readme_CopyIn(abt_md::FReadme &row, dev::Readme &in) __attribute__((nothrow)); +// func:abt_md.FReadmefile.base.CopyIn +void readmefile_CopyIn(abt_md::FReadmefile &row, dev::Readmefile &in) __attribute__((nothrow)); // Set all fields to initial values. -// func:abt_md.FReadme..Init -void FReadme_Init(abt_md::FReadme& readme); -// func:abt_md.FReadme..Uninit -void FReadme_Uninit(abt_md::FReadme& readme) __attribute__((nothrow)); +// func:abt_md.FReadmefile..Init +void FReadmefile_Init(abt_md::FReadmefile& readmefile); +// func:abt_md.FReadmefile..Uninit +void FReadmefile_Uninit(abt_md::FReadmefile& readmefile) __attribute__((nothrow)); // --- abt_md.FReadmesort // create: abt_md.FDb.readmesort (Lary) // global access: readmesort (Lary, by rowid) // global access: ind_readmesort (Thash, hash field readmesort) struct FReadmesort { // abt_md.FReadmesort - abt_md::FReadmesort* ind_readmesort_next; // hash next - algo::Smallstr250 readmesort; // - algo::Comment comment; // - algo::cstring sortfld; // + abt_md::FReadmesort* ind_readmesort_next; // hash next + u32 ind_readmesort_hashval; // hash value + algo::Smallstr250 readmesort; // + algo::Comment comment; // + algo::cstring sortfld; // // func:abt_md.FReadmesort..AssignOp inline abt_md::FReadmesort& operator =(const abt_md::FReadmesort &rhs) = delete; // func:abt_md.FReadmesort..CopyCtor @@ -3114,12 +3741,13 @@ void FReftype_Init(abt_md::FReftype& reftype); // create: abt_md.FDb.scriptfile (Lary) // global access: scriptfile (Lary, by rowid) // global access: ind_scriptfile (Thash, hash field gitfile) -// access: abt_md.FReadme.p_scriptfile (Upptr) +// access: abt_md.FReadmefile.p_scriptfile (Upptr) struct FScriptfile { // abt_md.FScriptfile - abt_md::FScriptfile* ind_scriptfile_next; // hash next - algo::Smallstr200 gitfile; // - algo::Smallstr50 license; // - algo::Comment comment; // + abt_md::FScriptfile* ind_scriptfile_next; // hash next + u32 ind_scriptfile_hashval; // hash value + algo::Smallstr200 gitfile; // + algo::Smallstr50 license; // + algo::Comment comment; // // func:abt_md.FScriptfile..AssignOp inline abt_md::FScriptfile& operator =(const abt_md::FScriptfile &rhs) = delete; // func:abt_md.FScriptfile..CopyCtor @@ -3156,12 +3784,13 @@ void FScriptfile_Uninit(abt_md::FScriptfile& scriptfile) __attri // global access: ssimfile (Lary, by rowid) // global access: ind_ssimfile (Thash, hash field ssimfile) // access: abt_md.FCtype.c_ssimfile (Ptr) -// access: abt_md.FReadme.p_ssimfile (Upptr) +// access: abt_md.FReadmefile.p_ssimfile (Upptr) struct FSsimfile { // abt_md.FSsimfile - abt_md::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - abt_md::FCtype* p_ctype; // reference to parent row + abt_md::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + abt_md::FCtype* p_ctype; // reference to parent row // x-reference on abt_md.FSsimfile.p_ctype prevents copy // func:abt_md.FSsimfile..AssignOp inline abt_md::FSsimfile& operator =(const abt_md::FSsimfile &rhs) = delete; @@ -3292,12 +3921,13 @@ void FTargdep_Uninit(abt_md::FTargdep& targdep) __attribute__((n // access: abt_md.FNs.c_target (Ptr) // access: abt_md.FTargdep.p_parent (Upptr) struct FTarget { // abt_md.FTarget - abt_md::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target - abt_md::FTargdep** c_targdep_elems; // array of pointers - u32 c_targdep_n; // array of pointers - u32 c_targdep_max; // capacity of allocated array - abt_md::FNs* p_ns; // reference to parent row + abt_md::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target + abt_md::FTargdep** c_targdep_elems; // array of pointers + u32 c_targdep_n; // array of pointers + u32 c_targdep_max; // capacity of allocated array + abt_md::FNs* p_ns; // reference to parent row // reftype Ptrary of abt_md.FTarget.c_targdep prohibits copy // x-reference on abt_md.FTarget.p_ns prevents copy // func:abt_md.FTarget..AssignOp @@ -3432,9 +4062,10 @@ void FTargsrc_Uninit(abt_md::FTargsrc& targsrc) __attribute__((n // global access: ind_tclass (Thash, hash field tclass) // access: abt_md.FReftype.p_tclass (Upptr) struct FTclass { // abt_md.FTclass - abt_md::FTclass* ind_tclass_next; // hash next - algo::Smallstr50 tclass; // - algo::Comment comment; // + abt_md::FTclass* ind_tclass_next; // hash next + u32 ind_tclass_hashval; // hash value + algo::Smallstr50 tclass; // + algo::Comment comment; // // func:abt_md.FTclass..AssignOp inline abt_md::FTclass& operator =(const abt_md::FTclass &rhs) = delete; // func:abt_md.FTclass..CopyCtor @@ -3598,11 +4229,11 @@ struct mdsection_zd_file_section_curs {// fcurs:abt_md.FMdsection.zd_file_sectio }; -struct _db_readme_curs {// cursor - typedef abt_md::FReadme ChildType; +struct _db_readmefile_curs {// cursor + typedef abt_md::FReadmefile ChildType; abt_md::FDb *parent; i64 index; - _db_readme_curs(){ parent=NULL; index=0; } + _db_readmefile_curs(){ parent=NULL; index=0; } }; @@ -3794,6 +4425,39 @@ struct _db_targdep_curs {// cursor _db_targdep_curs(){ parent=NULL; index=0; } }; + +struct _db_finput_curs {// cursor + typedef abt_md::FFinput ChildType; + abt_md::FDb *parent; + i64 index; + _db_finput_curs(){ parent=NULL; index=0; } +}; + + +struct _db_zd_scanns_curs {// fcurs:abt_md.FDb.zd_scanns/curs + typedef abt_md::FNs ChildType; + abt_md::FNs* row; + _db_zd_scanns_curs() { + row = NULL; + } +}; + + +struct _db_dispatch_curs {// cursor + typedef abt_md::FDispatch ChildType; + abt_md::FDb *parent; + i64 index; + _db_dispatch_curs(){ parent=NULL; index=0; } +}; + + +struct _db_dispatch_msg_curs {// cursor + typedef abt_md::FDispatchMsg ChildType; + abt_md::FDb *parent; + i64 index; + _db_dispatch_msg_curs(){ parent=NULL; index=0; } +}; + // Non-destructive heap cursor, returns heap elements in sorted order. // A running front of potential smallest entries is kept in the helper heap (curs.temp_%) struct FDirscan_bh_dirent_curs { @@ -3815,6 +4479,15 @@ struct FDirscan_dirent_curs {// cursor }; +struct dispatch_c_dispatch_msg_curs {// fcurs:abt_md.FDispatch.c_dispatch_msg/curs + typedef abt_md::FDispatchMsg ChildType; + abt_md::FDispatchMsg** elems; + u32 n_elems; + u32 index; + dispatch_c_dispatch_msg_curs() { elems=NULL; n_elems=0; index=0; } +}; + + struct field_c_fconst_curs {// fcurs:abt_md.FField.c_fconst/curs typedef abt_md::FFconst ChildType; abt_md::FFconst** elems; @@ -3851,6 +4524,24 @@ struct ns_c_comptest_curs {// fcurs:abt_md.FNs.c_comptest/curs }; +struct ns_zd_finput_curs {// fcurs:abt_md.FNs.zd_finput/curs + typedef abt_md::FFinput ChildType; + abt_md::FFinput* row; + ns_zd_finput_curs() { + row = NULL; + } +}; + + +struct ns_c_dispatch_curs {// fcurs:abt_md.FNs.c_dispatch/curs + typedef abt_md::FDispatch ChildType; + abt_md::FDispatch** elems; + u32 n_elems; + u32 index; + ns_c_dispatch_curs() { elems=NULL; n_elems=0; index=0; } +}; + + struct target_c_targdep_curs {// fcurs:abt_md.FTarget.c_targdep/curs typedef abt_md::FTargdep ChildType; abt_md::FTargdep** elems; @@ -3938,6 +4629,10 @@ void mdsection_Options(abt_md::FFileSection&); // this function is 'extrn' and implemented by user void mdsection_Inputs(abt_md::FFileSection&); // User-implemented function from gstatic:abt_md.FDb.mdsection +// func:abt_md...mdsection_InputMessages +// this function is 'extrn' and implemented by user +void mdsection_InputMessages(abt_md::FFileSection&); +// User-implemented function from gstatic:abt_md.FDb.mdsection // func:abt_md...mdsection_Sources // this function is 'extrn' and implemented by user void mdsection_Sources(abt_md::FFileSection&); diff --git a/include/gen/abt_md_gen.inl.h b/include/gen/abt_md_gen.inl.h index 92b2fb72..2ea3bb98 100644 --- a/include/gen/abt_md_gen.inl.h +++ b/include/gen/abt_md_gen.inl.h @@ -31,36 +31,38 @@ #include "include/gen/dev_gen.inl.h" #include "include/gen/amcdb_gen.inl.h" //#pragma endinclude -static abt_md::FMdsection &abt_md_mdsection_Title = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[0]; -static abt_md::FMdsection &abt_md_mdsection_Chapters = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[1]; -static abt_md::FMdsection &abt_md_mdsection_Toc = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[2]; -static abt_md::FMdsection &abt_md_mdsection_Reftypes = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[3]; -static abt_md::FMdsection &abt_md_mdsection_Syntax = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[4]; -static abt_md::FMdsection &abt_md_mdsection_Description = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[5]; -static abt_md::FMdsection &abt_md_mdsection_Limitations = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[6]; -static abt_md::FMdsection &abt_md_mdsection_Content = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[7]; -static abt_md::FMdsection &abt_md_mdsection_Example = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[8]; -static abt_md::FMdsection &abt_md_mdsection_Attributes = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[9]; -static abt_md::FMdsection &abt_md_mdsection_Ctypes = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[10]; -static abt_md::FMdsection &abt_md_mdsection_Functions = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[11]; -static abt_md::FMdsection &abt_md_mdsection_Tables = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[12]; -static abt_md::FMdsection &abt_md_mdsection_Subsets = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[13]; -static abt_md::FMdsection &abt_md_mdsection_Related = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[14]; -static abt_md::FMdsection &abt_md_mdsection_Constants = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[15]; -static abt_md::FMdsection &abt_md_mdsection_CmdlineUses = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[16]; -static abt_md::FMdsection &abt_md_mdsection_Options = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[17]; -static abt_md::FMdsection &abt_md_mdsection_Inputs = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[18]; -static abt_md::FMdsection &abt_md_mdsection_Sources = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[19]; -static abt_md::FMdsection &abt_md_mdsection_Dependencies = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[20]; -static abt_md::FMdsection &abt_md_mdsection_Imdb = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[21]; -static abt_md::FMdsection &abt_md_mdsection_ImdbUses = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[22]; -static abt_md::FMdsection &abt_md_mdsection_Tests = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[23]; -static abt_md::FMdsection &abt_md_mdsection_Copyright = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[24]; +static abt_md::FMdsection &abt_md_mdsection_Title = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[0]; +static abt_md::FMdsection &abt_md_mdsection_Chapters = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[1]; +static abt_md::FMdsection &abt_md_mdsection_Toc = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[2]; +static abt_md::FMdsection &abt_md_mdsection_Reftypes = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[3]; +static abt_md::FMdsection &abt_md_mdsection_Syntax = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[4]; +static abt_md::FMdsection &abt_md_mdsection_Description = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[5]; +static abt_md::FMdsection &abt_md_mdsection_Limitations = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[6]; +static abt_md::FMdsection &abt_md_mdsection_Content = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[7]; +static abt_md::FMdsection &abt_md_mdsection_Example = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[8]; +static abt_md::FMdsection &abt_md_mdsection_Attributes = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[9]; +static abt_md::FMdsection &abt_md_mdsection_Ctypes = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[10]; +static abt_md::FMdsection &abt_md_mdsection_Functions = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[11]; +static abt_md::FMdsection &abt_md_mdsection_Tables = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[12]; +static abt_md::FMdsection &abt_md_mdsection_Subsets = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[13]; +static abt_md::FMdsection &abt_md_mdsection_Related = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[14]; +static abt_md::FMdsection &abt_md_mdsection_Constants = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[15]; +static abt_md::FMdsection &abt_md_mdsection_CmdlineUses = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[16]; +static abt_md::FMdsection &abt_md_mdsection_Options = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[17]; +static abt_md::FMdsection &abt_md_mdsection_Inputs = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[18]; +static abt_md::FMdsection &abt_md_mdsection_InputMessages = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[19]; +static abt_md::FMdsection &abt_md_mdsection_Sources = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[20]; +static abt_md::FMdsection &abt_md_mdsection_Dependencies = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[21]; +static abt_md::FMdsection &abt_md_mdsection_Imdb = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[22]; +static abt_md::FMdsection &abt_md_mdsection_ImdbUses = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[23]; +static abt_md::FMdsection &abt_md_mdsection_Tests = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[24]; +static abt_md::FMdsection &abt_md_mdsection_Copyright = ((abt_md::FMdsection*)abt_md::_db.mdsection_data)[25]; // --- abt_md.FAnchor..Init // Set all fields to initial values. inline void abt_md::FAnchor_Init(abt_md::FAnchor& anchor) { anchor.ind_anchor_next = (abt_md::FAnchor*)-1; // (abt_md.FDb.ind_anchor) not-in-hash + anchor.ind_anchor_hashval = 0; // stored hash value } // --- abt_md.FAnchor..Ctor @@ -73,15 +75,6 @@ inline abt_md::FAnchor::~FAnchor() { abt_md::FAnchor_Uninit(*this); } -// --- abt_md.FComptest..Init -// Set all fields to initial values. -inline void abt_md::FComptest_Init(abt_md::FComptest& comptest) { - comptest.timeout = i32(10); - comptest.memcheck = bool(true); - comptest.exit_code = u8(0); - comptest.ns_c_comptest_in_ary = bool(false); -} - // --- abt_md.FComptest..Ctor inline abt_md::FComptest::FComptest() { abt_md::FComptest_Init(*this); @@ -291,6 +284,7 @@ inline void abt_md::FCtype_Init(abt_md::FCtype& ctype) { ctype.c_field_arg_max = 0; // (abt_md.FCtype.c_field_arg) ctype.ns_c_ctype_in_ary = bool(false); ctype.ind_ctype_next = (abt_md::FCtype*)-1; // (abt_md.FDb.ind_ctype) not-in-hash + ctype.ind_ctype_hashval = 0; // stored hash value } // --- abt_md.FCtype..Ctor @@ -325,9 +319,9 @@ inline abt_md::FFileSection* abt_md::zd_file_section_First(abt_md::FMdsection& m // --- abt_md.FMdsection.zd_file_section.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool abt_md::zd_file_section_InLlistQ(abt_md::FFileSection& row) { +inline bool abt_md::mdsection_zd_file_section_InLlistQ(abt_md::FFileSection& row) { bool result = false; - result = !(row.zd_file_section_next == (abt_md::FFileSection*)-1); + result = !(row.mdsection_zd_file_section_next == (abt_md::FFileSection*)-1); return result; } @@ -347,14 +341,14 @@ inline i32 abt_md::zd_file_section_N(const abt_md::FMdsection& mdsection) { // --- abt_md.FMdsection.zd_file_section.Next // Return pointer to next element in the list -inline abt_md::FFileSection* abt_md::zd_file_section_Next(abt_md::FFileSection &row) { - return row.zd_file_section_next; +inline abt_md::FFileSection* abt_md::mdsection_zd_file_section_Next(abt_md::FFileSection &row) { + return row.mdsection_zd_file_section_next; } // --- abt_md.FMdsection.zd_file_section.Prev // Return pointer to previous element in the list -inline abt_md::FFileSection* abt_md::zd_file_section_Prev(abt_md::FFileSection &row) { - return row.zd_file_section_prev; +inline abt_md::FFileSection* abt_md::mdsection_zd_file_section_Prev(abt_md::FFileSection &row) { + return row.mdsection_zd_file_section_prev; } // --- abt_md.FMdsection.zd_file_section.qLast @@ -380,7 +374,7 @@ inline bool abt_md::mdsection_zd_file_section_curs_ValidQ(mdsection_zd_file_sect // --- abt_md.FMdsection.zd_file_section_curs.Next // proceed to next item inline void abt_md::mdsection_zd_file_section_curs_Next(mdsection_zd_file_section_curs &curs) { - abt_md::FFileSection *next = (*curs.row).zd_file_section_next; + abt_md::FFileSection *next = (*curs.row).mdsection_zd_file_section_next; curs.row = next; } @@ -399,65 +393,65 @@ inline abt_md::FMdsection::FMdsection() { inline abt_md::trace::trace() { } -// --- abt_md.FDb.readme.EmptyQ +// --- abt_md.FDb.readmefile.EmptyQ // Return true if index is empty -inline bool abt_md::readme_EmptyQ() { - return _db.readme_n == 0; +inline bool abt_md::readmefile_EmptyQ() { + return _db.readmefile_n == 0; } -// --- abt_md.FDb.readme.Find +// --- abt_md.FDb.readmefile.Find // Look up row by row id. Return NULL if out of range -inline abt_md::FReadme* abt_md::readme_Find(u64 t) { - abt_md::FReadme *retval = NULL; - if (LIKELY(u64(t) < u64(_db.readme_n))) { +inline abt_md::FReadmefile* abt_md::readmefile_Find(u64 t) { + abt_md::FReadmefile *retval = NULL; + if (LIKELY(u64(t) < u64(_db.readmefile_n))) { u64 x = t + 1; u64 bsr = algo::u64_BitScanReverse(x); u64 base = u64(1)<(_db.mdsection_data) + _db.mdsection_n; - if (_db.mdsection_n == 25) row = NULL; + if (_db.mdsection_n == 26) row = NULL; if (row) _db.mdsection_n++; return row; } @@ -483,9 +477,9 @@ inline algo::aryptr abt_md::mdsection_Getary() { } // --- abt_md.FDb.mdsection.Max -// Return constant 25 -- max. number of items in the pool +// Return constant 26 -- max. number of items in the pool inline i32 abt_md::mdsection_Max() { - return 25; + return 26; } // --- abt_md.FDb.mdsection.N @@ -1522,29 +1516,223 @@ inline i32 abt_md::ind_target_N() { return _db.ind_target_n; } -// --- abt_md.FDb.readme_curs.Reset +// --- abt_md.FDb.finput.EmptyQ +// Return true if index is empty +inline bool abt_md::finput_EmptyQ() { + return _db.finput_n == 0; +} + +// --- abt_md.FDb.finput.Find +// Look up row by row id. Return NULL if out of range +inline abt_md::FFinput* abt_md::finput_Find(u64 t) { + abt_md::FFinput *retval = NULL; + if (LIKELY(u64(t) < u64(_db.finput_n))) { + u64 x = t + 1; + u64 bsr = algo::u64_BitScanReverse(x); + u64 base = u64(1)<b, then !(b>a). inline bool abt_md::sortfld_Lt(abt_md::FDirent& dirent, abt_md::FDirent &rhs) { @@ -2126,7 +2414,7 @@ inline i32 abt_md::sortfld_Cmp(abt_md::FDirent& dirent, abt_md::FDirent &rhs) { inline void abt_md::FDirent_Init(abt_md::FDirent& dirent) { dirent.is_dir = bool(false); dirent.p_dirscan = NULL; - dirent.bh_dirent_idx = -1; // (abt_md.FDirscan.bh_dirent) not-in-heap + dirent.parent_bh_dirent_idx = -1; // (abt_md.FDirscan.bh_dirent) not-in-heap } // --- abt_md.FDirent..Ctor @@ -2159,7 +2447,7 @@ inline abt_md::FDirent* abt_md::bh_dirent_First(abt_md::FDirscan& parent) { // Return true if row is in index, false otherwise inline bool abt_md::bh_dirent_InBheapQ(abt_md::FDirent& row) { bool result = false; - result = row.bh_dirent_idx != -1; + result = row.parent_bh_dirent_idx != -1; return result; } @@ -2258,6 +2546,116 @@ inline abt_md::FDirscan::~FDirscan() { abt_md::FDirscan_Uninit(*this); } +// --- abt_md.FDispatch.c_dispatch_msg.EmptyQ +// Return true if index is empty +inline bool abt_md::c_dispatch_msg_EmptyQ(abt_md::FDispatch& dispatch) { + return dispatch.c_dispatch_msg_n == 0; +} + +// --- abt_md.FDispatch.c_dispatch_msg.Find +// Look up row by row id. Return NULL if out of range +inline abt_md::FDispatchMsg* abt_md::c_dispatch_msg_Find(abt_md::FDispatch& dispatch, u32 t) { + abt_md::FDispatchMsg *retval = NULL; + u64 idx = t; + u64 lim = dispatch.c_dispatch_msg_n; + if (idx < lim) { + retval = dispatch.c_dispatch_msg_elems[idx]; + } + return retval; +} + +// --- abt_md.FDispatch.c_dispatch_msg.Getary +// Return array of pointers +inline algo::aryptr abt_md::c_dispatch_msg_Getary(abt_md::FDispatch& dispatch) { + return algo::aryptr(dispatch.c_dispatch_msg_elems, dispatch.c_dispatch_msg_n); +} + +// --- abt_md.FDispatch.c_dispatch_msg.N +// Return number of items in the pointer array +inline i32 abt_md::c_dispatch_msg_N(const abt_md::FDispatch& dispatch) { + return dispatch.c_dispatch_msg_n; +} + +// --- abt_md.FDispatch.c_dispatch_msg.RemoveAll +// Empty the index. (The rows are not deleted) +inline void abt_md::c_dispatch_msg_RemoveAll(abt_md::FDispatch& dispatch) { + for (u32 i = 0; i < dispatch.c_dispatch_msg_n; i++) { + // mark all elements as not-in-array + dispatch.c_dispatch_msg_elems[i]->dispatch_c_dispatch_msg_in_ary = false; + } + dispatch.c_dispatch_msg_n = 0; +} + +// --- abt_md.FDispatch.c_dispatch_msg.qFind +// Return reference without bounds checking +inline abt_md::FDispatchMsg& abt_md::c_dispatch_msg_qFind(abt_md::FDispatch& dispatch, u32 idx) { + return *dispatch.c_dispatch_msg_elems[idx]; +} + +// --- abt_md.FDispatch.c_dispatch_msg.InAryQ +// True if row is in any ptrary instance +inline bool abt_md::dispatch_c_dispatch_msg_InAryQ(abt_md::FDispatchMsg& row) { + return row.dispatch_c_dispatch_msg_in_ary; +} + +// --- abt_md.FDispatch.c_dispatch_msg.qLast +// Reference to last element without bounds checking +inline abt_md::FDispatchMsg& abt_md::c_dispatch_msg_qLast(abt_md::FDispatch& dispatch) { + return *dispatch.c_dispatch_msg_elems[dispatch.c_dispatch_msg_n-1]; +} + +// --- abt_md.FDispatch.c_dispatch_msg_curs.Reset +inline void abt_md::dispatch_c_dispatch_msg_curs_Reset(dispatch_c_dispatch_msg_curs &curs, abt_md::FDispatch &parent) { + curs.elems = parent.c_dispatch_msg_elems; + curs.n_elems = parent.c_dispatch_msg_n; + curs.index = 0; +} + +// --- abt_md.FDispatch.c_dispatch_msg_curs.ValidQ +// cursor points to valid item +inline bool abt_md::dispatch_c_dispatch_msg_curs_ValidQ(dispatch_c_dispatch_msg_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- abt_md.FDispatch.c_dispatch_msg_curs.Next +// proceed to next item +inline void abt_md::dispatch_c_dispatch_msg_curs_Next(dispatch_c_dispatch_msg_curs &curs) { + curs.index++; +} + +// --- abt_md.FDispatch.c_dispatch_msg_curs.Access +// item access +inline abt_md::FDispatchMsg& abt_md::dispatch_c_dispatch_msg_curs_Access(dispatch_c_dispatch_msg_curs &curs) { + return *curs.elems[curs.index]; +} + +// --- abt_md.FDispatch..Ctor +inline abt_md::FDispatch::FDispatch() { + abt_md::FDispatch_Init(*this); +} + +// --- abt_md.FDispatch..Dtor +inline abt_md::FDispatch::~FDispatch() { + abt_md::FDispatch_Uninit(*this); +} + +// --- abt_md.FDispatchMsg..Init +// Set all fields to initial values. +inline void abt_md::FDispatchMsg_Init(abt_md::FDispatchMsg& dispatch_msg) { + dispatch_msg.p_ctype = NULL; + dispatch_msg.dispatch_c_dispatch_msg_in_ary = bool(false); +} + +// --- abt_md.FDispatchMsg..Ctor +inline abt_md::FDispatchMsg::FDispatchMsg() { + abt_md::FDispatchMsg_Init(*this); +} + +// --- abt_md.FDispatchMsg..Dtor +inline abt_md::FDispatchMsg::~FDispatchMsg() { + abt_md::FDispatchMsg_Uninit(*this); +} + // --- abt_md.FFconst..Init // Set all fields to initial values. inline void abt_md::FFconst_Init(abt_md::FFconst& fconst) { @@ -2414,8 +2812,8 @@ inline void abt_md::FFileSection_Init(abt_md::FFileSection& file_section) { file_section.select = bool(true); file_section.firstline = i32(0); file_section.p_mdsection = NULL; - file_section.zd_file_section_next = (abt_md::FFileSection*)-1; // (abt_md.FMdsection.zd_file_section) not-in-list - file_section.zd_file_section_prev = NULL; // (abt_md.FMdsection.zd_file_section) + file_section.mdsection_zd_file_section_next = (abt_md::FFileSection*)-1; // (abt_md.FMdsection.zd_file_section) not-in-list + file_section.mdsection_zd_file_section_prev = NULL; // (abt_md.FMdsection.zd_file_section) file_section.bh_file_section_idx = -1; // (abt_md.FDb.bh_file_section) not-in-heap } @@ -2429,6 +2827,27 @@ inline abt_md::FFileSection::~FFileSection() { abt_md::FFileSection_Uninit(*this); } +// --- abt_md.FFinput..Init +// Set all fields to initial values. +inline void abt_md::FFinput_Init(abt_md::FFinput& finput) { + finput.extrn = bool(false); + finput.update = bool(false); + finput.strict = bool(true); + finput.p_field = NULL; + finput.ns_zd_finput_next = (abt_md::FFinput*)-1; // (abt_md.FNs.zd_finput) not-in-list + finput.ns_zd_finput_prev = NULL; // (abt_md.FNs.zd_finput) +} + +// --- abt_md.FFinput..Ctor +inline abt_md::FFinput::FFinput() { + abt_md::FFinput_Init(*this); +} + +// --- abt_md.FFinput..Dtor +inline abt_md::FFinput::~FFinput() { + abt_md::FFinput_Uninit(*this); +} + // --- abt_md.FGconst..Init // Set all fields to initial values. inline void abt_md::FGconst_Init(abt_md::FGconst& gconst) { @@ -2449,6 +2868,7 @@ inline abt_md::FGconst::~FGconst() { // Set all fields to initial values. inline void abt_md::FGstatic_Init(abt_md::FGstatic& gstatic) { gstatic.ind_gstatic_next = (abt_md::FGstatic*)-1; // (abt_md.FDb.ind_gstatic) not-in-hash + gstatic.ind_gstatic_hashval = 0; // stored hash value } // --- abt_md.FGstatic..Ctor @@ -2467,6 +2887,7 @@ inline void abt_md::FHumanText_Init(abt_md::FHumanText& human_text) { human_text.used = bool(false); human_text.human_text_next = (abt_md::FHumanText*)-1; // (abt_md.FDb.human_text) not-in-tpool's freelist human_text.ind_human_text_next = (abt_md::FHumanText*)-1; // (abt_md.FDb.ind_human_text) not-in-hash + human_text.ind_human_text_hashval = 0; // stored hash value } // --- abt_md.FHumanText..Ctor @@ -2677,21 +3098,118 @@ inline void abt_md::c_target_Remove(abt_md::FNs& ns, abt_md::FTarget& row) { } } -// --- abt_md.FNs..Init -// Set all fields to initial values. -inline void abt_md::FNs_Init(abt_md::FNs& ns) { - ns.c_readme = NULL; - ns.c_targsrc_elems = NULL; // (abt_md.FNs.c_targsrc) - ns.c_targsrc_n = 0; // (abt_md.FNs.c_targsrc) - ns.c_targsrc_max = 0; // (abt_md.FNs.c_targsrc) - ns.c_ctype_elems = NULL; // (abt_md.FNs.c_ctype) - ns.c_ctype_n = 0; // (abt_md.FNs.c_ctype) - ns.c_ctype_max = 0; // (abt_md.FNs.c_ctype) - ns.c_comptest_elems = NULL; // (abt_md.FNs.c_comptest) - ns.c_comptest_n = 0; // (abt_md.FNs.c_comptest) - ns.c_comptest_max = 0; // (abt_md.FNs.c_comptest) - ns.c_target = NULL; - ns.ind_ns_next = (abt_md::FNs*)-1; // (abt_md.FDb.ind_ns) not-in-hash +// --- abt_md.FNs.zd_finput.EmptyQ +// Return true if index is empty +inline bool abt_md::zd_finput_EmptyQ(abt_md::FNs& ns) { + return ns.zd_finput_head == NULL; +} + +// --- abt_md.FNs.zd_finput.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline abt_md::FFinput* abt_md::zd_finput_First(abt_md::FNs& ns) { + abt_md::FFinput *row = NULL; + row = ns.zd_finput_head; + return row; +} + +// --- abt_md.FNs.zd_finput.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool abt_md::ns_zd_finput_InLlistQ(abt_md::FFinput& row) { + bool result = false; + result = !(row.ns_zd_finput_next == (abt_md::FFinput*)-1); + return result; +} + +// --- abt_md.FNs.zd_finput.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline abt_md::FFinput* abt_md::zd_finput_Last(abt_md::FNs& ns) { + abt_md::FFinput *row = NULL; + row = ns.zd_finput_tail; + return row; +} + +// --- abt_md.FNs.zd_finput.N +// Return number of items in the linked list +inline i32 abt_md::zd_finput_N(const abt_md::FNs& ns) { + return ns.zd_finput_n; +} + +// --- abt_md.FNs.zd_finput.Next +// Return pointer to next element in the list +inline abt_md::FFinput* abt_md::ns_zd_finput_Next(abt_md::FFinput &row) { + return row.ns_zd_finput_next; +} + +// --- abt_md.FNs.zd_finput.Prev +// Return pointer to previous element in the list +inline abt_md::FFinput* abt_md::ns_zd_finput_Prev(abt_md::FFinput &row) { + return row.ns_zd_finput_prev; +} + +// --- abt_md.FNs.zd_finput.qLast +// Return reference to last element in the index. No bounds checking. +inline abt_md::FFinput& abt_md::zd_finput_qLast(abt_md::FNs& ns) { + abt_md::FFinput *row = NULL; + row = ns.zd_finput_tail; + return *row; +} + +// --- abt_md.FNs.c_dispatch.EmptyQ +// Return true if index is empty +inline bool abt_md::c_dispatch_EmptyQ(abt_md::FNs& ns) { + return ns.c_dispatch_n == 0; +} + +// --- abt_md.FNs.c_dispatch.Find +// Look up row by row id. Return NULL if out of range +inline abt_md::FDispatch* abt_md::c_dispatch_Find(abt_md::FNs& ns, u32 t) { + abt_md::FDispatch *retval = NULL; + u64 idx = t; + u64 lim = ns.c_dispatch_n; + if (idx < lim) { + retval = ns.c_dispatch_elems[idx]; + } + return retval; +} + +// --- abt_md.FNs.c_dispatch.Getary +// Return array of pointers +inline algo::aryptr abt_md::c_dispatch_Getary(abt_md::FNs& ns) { + return algo::aryptr(ns.c_dispatch_elems, ns.c_dispatch_n); +} + +// --- abt_md.FNs.c_dispatch.N +// Return number of items in the pointer array +inline i32 abt_md::c_dispatch_N(const abt_md::FNs& ns) { + return ns.c_dispatch_n; +} + +// --- abt_md.FNs.c_dispatch.RemoveAll +// Empty the index. (The rows are not deleted) +inline void abt_md::c_dispatch_RemoveAll(abt_md::FNs& ns) { + for (u32 i = 0; i < ns.c_dispatch_n; i++) { + // mark all elements as not-in-array + ns.c_dispatch_elems[i]->ns_c_dispatch_in_ary = false; + } + ns.c_dispatch_n = 0; +} + +// --- abt_md.FNs.c_dispatch.qFind +// Return reference without bounds checking +inline abt_md::FDispatch& abt_md::c_dispatch_qFind(abt_md::FNs& ns, u32 idx) { + return *ns.c_dispatch_elems[idx]; +} + +// --- abt_md.FNs.c_dispatch.InAryQ +// True if row is in any ptrary instance +inline bool abt_md::ns_c_dispatch_InAryQ(abt_md::FDispatch& row) { + return row.ns_c_dispatch_in_ary; +} + +// --- abt_md.FNs.c_dispatch.qLast +// Reference to last element without bounds checking +inline abt_md::FDispatch& abt_md::c_dispatch_qLast(abt_md::FNs& ns) { + return *ns.c_dispatch_elems[ns.c_dispatch_n-1]; } // --- abt_md.FNs.c_targsrc_curs.Reset @@ -2769,6 +3287,56 @@ inline abt_md::FComptest& abt_md::ns_c_comptest_curs_Access(ns_c_comptest_curs & return *curs.elems[curs.index]; } +// --- abt_md.FNs.zd_finput_curs.Reset +// cursor points to valid item +inline void abt_md::ns_zd_finput_curs_Reset(ns_zd_finput_curs &curs, abt_md::FNs &parent) { + curs.row = parent.zd_finput_head; +} + +// --- abt_md.FNs.zd_finput_curs.ValidQ +// cursor points to valid item +inline bool abt_md::ns_zd_finput_curs_ValidQ(ns_zd_finput_curs &curs) { + return curs.row != NULL; +} + +// --- abt_md.FNs.zd_finput_curs.Next +// proceed to next item +inline void abt_md::ns_zd_finput_curs_Next(ns_zd_finput_curs &curs) { + abt_md::FFinput *next = (*curs.row).ns_zd_finput_next; + curs.row = next; +} + +// --- abt_md.FNs.zd_finput_curs.Access +// item access +inline abt_md::FFinput& abt_md::ns_zd_finput_curs_Access(ns_zd_finput_curs &curs) { + return *curs.row; +} + +// --- abt_md.FNs.c_dispatch_curs.Reset +inline void abt_md::ns_c_dispatch_curs_Reset(ns_c_dispatch_curs &curs, abt_md::FNs &parent) { + curs.elems = parent.c_dispatch_elems; + curs.n_elems = parent.c_dispatch_n; + curs.index = 0; +} + +// --- abt_md.FNs.c_dispatch_curs.ValidQ +// cursor points to valid item +inline bool abt_md::ns_c_dispatch_curs_ValidQ(ns_c_dispatch_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- abt_md.FNs.c_dispatch_curs.Next +// proceed to next item +inline void abt_md::ns_c_dispatch_curs_Next(ns_c_dispatch_curs &curs) { + curs.index++; +} + +// --- abt_md.FNs.c_dispatch_curs.Access +// item access +inline abt_md::FDispatch& abt_md::ns_c_dispatch_curs_Access(ns_c_dispatch_curs &curs) { + return *curs.elems[curs.index]; +} + // --- abt_md.FNs..Ctor inline abt_md::FNs::FNs() { abt_md::FNs_Init(*this); @@ -2783,6 +3351,7 @@ inline abt_md::FNs::~FNs() { // Set all fields to initial values. inline void abt_md::FNstype_Init(abt_md::FNstype& nstype) { nstype.ind_nstype_next = (abt_md::FNstype*)-1; // (abt_md.FDb.ind_nstype) not-in-hash + nstype.ind_nstype_hashval = 0; // stored hash value } // --- abt_md.FNstype..Ctor @@ -2795,20 +3364,21 @@ inline abt_md::FNstype::~FNstype() { abt_md::FNstype_Uninit(*this); } -// --- abt_md.FReadme..Ctor -inline abt_md::FReadme::FReadme() { - abt_md::FReadme_Init(*this); +// --- abt_md.FReadmefile..Ctor +inline abt_md::FReadmefile::FReadmefile() { + abt_md::FReadmefile_Init(*this); } -// --- abt_md.FReadme..Dtor -inline abt_md::FReadme::~FReadme() { - abt_md::FReadme_Uninit(*this); +// --- abt_md.FReadmefile..Dtor +inline abt_md::FReadmefile::~FReadmefile() { + abt_md::FReadmefile_Uninit(*this); } // --- abt_md.FReadmesort..Init // Set all fields to initial values. inline void abt_md::FReadmesort_Init(abt_md::FReadmesort& readmesort) { readmesort.ind_readmesort_next = (abt_md::FReadmesort*)-1; // (abt_md.FDb.ind_readmesort) not-in-hash + readmesort.ind_readmesort_hashval = 0; // stored hash value } // --- abt_md.FReadmesort..Ctor @@ -2830,6 +3400,7 @@ inline abt_md::FReftype::FReftype() { // Set all fields to initial values. inline void abt_md::FScriptfile_Init(abt_md::FScriptfile& scriptfile) { scriptfile.ind_scriptfile_next = (abt_md::FScriptfile*)-1; // (abt_md.FDb.ind_scriptfile) not-in-hash + scriptfile.ind_scriptfile_hashval = 0; // stored hash value } // --- abt_md.FScriptfile..Ctor @@ -2847,6 +3418,7 @@ inline abt_md::FScriptfile::~FScriptfile() { inline void abt_md::FSsimfile_Init(abt_md::FSsimfile& ssimfile) { ssimfile.p_ctype = NULL; ssimfile.ind_ssimfile_next = (abt_md::FSsimfile*)-1; // (abt_md.FDb.ind_ssimfile) not-in-hash + ssimfile.ind_ssimfile_hashval = 0; // stored hash value } // --- abt_md.FSsimfile..Ctor @@ -2958,6 +3530,7 @@ inline void abt_md::FTarget_Init(abt_md::FTarget& target) { target.c_targdep_max = 0; // (abt_md.FTarget.c_targdep) target.p_ns = NULL; target.ind_target_next = (abt_md::FTarget*)-1; // (abt_md.FDb.ind_target) not-in-hash + target.ind_target_hashval = 0; // stored hash value } // --- abt_md.FTarget.c_targdep_curs.Reset @@ -3015,6 +3588,7 @@ inline abt_md::FTargsrc::~FTargsrc() { // Set all fields to initial values. inline void abt_md::FTclass_Init(abt_md::FTclass& tclass) { tclass.ind_tclass_next = (abt_md::FTclass*)-1; // (abt_md.FDb.ind_tclass) not-in-hash + tclass.ind_tclass_hashval = 0; // stored hash value } // --- abt_md.FTclass..Ctor diff --git a/include/gen/acr_compl_gen.h b/include/gen/acr_compl_gen.h index 0fcc99c2..7aff9a7f 100644 --- a/include/gen/acr_compl_gen.h +++ b/include/gen/acr_compl_gen.h @@ -395,14 +395,15 @@ struct FComplsource { // acr_compl.FComplsource // access: acr_compl.FField.p_ctype (Upptr) // access: acr_compl.FSsimfile.p_ctype (Upptr) struct FCtype { // acr_compl.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - acr_compl::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - acr_compl::FSsimfile* c_ssimfile; // optional pointer - acr_compl::FArgvtype* c_argvtype; // optional pointer - acr_compl::FCtype* ind_ctype_next; // hash next + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + acr_compl::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + acr_compl::FSsimfile* c_ssimfile; // optional pointer + acr_compl::FArgvtype* c_argvtype; // optional pointer + acr_compl::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // reftype Ptrary of acr_compl.FCtype.c_field prohibits copy // x-reference on acr_compl.FCtype.c_ssimfile prevents copy // x-reference on acr_compl.FCtype.c_argvtype prevents copy @@ -649,6 +650,11 @@ algo::cstring& word_AllocAt(int at) __attribute__((__warn_unused_result__, // Reserve space. Insert N elements at the end of the array, return pointer to array // func:acr_compl.FDb.word.AllocN algo::aryptr word_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:acr_compl.FDb.word.AllocNAt +algo::aryptr word_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:acr_compl.FDb.word.EmptyQ inline bool word_EmptyQ() __attribute__((nothrow)); @@ -698,6 +704,10 @@ algo::aryptr word_AllocNVal(int n_elems, const algo::cstring& val // Function returns success value. // func:acr_compl.FDb.word.ReadStrptrMaybe bool word_ReadStrptrMaybe(algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:acr_compl.FDb.word.Insary +void word_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -757,6 +767,9 @@ void ind_ctype_Remove(acr_compl::FCtype& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:acr_compl.FDb.ind_ctype.Reserve void ind_ctype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_compl.FDb.ind_ctype.AbsReserve +void ind_ctype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -813,6 +826,9 @@ void ind_field_Remove(acr_compl::FField& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:acr_compl.FDb.ind_field.Reserve void ind_field_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_compl.FDb.ind_field.AbsReserve +void ind_field_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -869,6 +885,9 @@ void ind_ssimfile_Remove(acr_compl::FSsimfile& row) __attribute_ // Reserve enough room in the hash for N more elements. Return success code. // func:acr_compl.FDb.ind_ssimfile.Reserve void ind_ssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_compl.FDb.ind_ssimfile.AbsReserve +void ind_ssimfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1207,6 +1226,9 @@ void ind_ns_Remove(acr_compl::FNs& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:acr_compl.FDb.ind_ns.Reserve void ind_ns_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_compl.FDb.ind_ns.AbsReserve +void ind_ns_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:acr_compl.FDb.ind_cmd_field_name.EmptyQ @@ -1226,6 +1248,9 @@ void ind_cmd_field_name_Remove(acr_compl::FField& row) __attribu // Reserve enough room in the hash for N more elements. Return success code. // func:acr_compl.FDb.ind_cmd_field_name.Reserve void ind_cmd_field_name_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_compl.FDb.ind_cmd_field_name.AbsReserve +void ind_cmd_field_name_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1712,28 +1737,30 @@ void FFflag_Uninit(acr_compl::FFflag& fflag) __attribute__((noth // access: acr_compl.FFcmdline.p_field (Upptr) // access: acr_compl.FFcmdline.p_basecmdline (Upptr) struct FField { // acr_compl.FField - acr_compl::FField* ind_field_next; // hash next - acr_compl::FField* zd_cmd_field_next; // zslist link; -1 means not-in-list - acr_compl::FField* zd_cmd_field_prev; // previous element - acr_compl::FField* ind_cmd_field_name_next; // hash next - algo::Smallstr100 field; // Primary key, as ctype.name - algo::Smallstr100 arg; // Type of field - algo::Smallstr50 reftype; // "Val" Type constructor - algo::CppExpr dflt; // Default value (c++ expression) - algo::Comment comment; // - acr_compl::FCtype* p_arg; // reference to parent row - acr_compl::FAnonfld* c_anonfld; // optional pointer - acr_compl::FFconst** c_fconst_elems; // array of pointers - u32 c_fconst_n; // array of pointers - u32 c_fconst_max; // capacity of allocated array - bool seen; // false - acr_compl::FFflag* c_fflag; // optional pointer - acr_compl::FCtype* p_ctype; // reference to parent row - acr_compl::FFalias* c_falias; // optional pointer - acr_compl::FFalias** c_falias_srcfield_elems; // array of pointers - u32 c_falias_srcfield_n; // array of pointers - u32 c_falias_srcfield_max; // capacity of allocated array - bool ctype_c_field_in_ary; // false membership flag + acr_compl::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value + acr_compl::FField* zd_cmd_field_next; // zslist link; -1 means not-in-list + acr_compl::FField* zd_cmd_field_prev; // previous element + acr_compl::FField* ind_cmd_field_name_next; // hash next + u32 ind_cmd_field_name_hashval; // hash value + algo::Smallstr100 field; // Primary key, as ctype.name + algo::Smallstr100 arg; // Type of field + algo::Smallstr50 reftype; // "Val" Type constructor + algo::CppExpr dflt; // Default value (c++ expression) + algo::Comment comment; // + acr_compl::FCtype* p_arg; // reference to parent row + acr_compl::FAnonfld* c_anonfld; // optional pointer + acr_compl::FFconst** c_fconst_elems; // array of pointers + u32 c_fconst_n; // array of pointers + u32 c_fconst_max; // capacity of allocated array + bool seen; // false + acr_compl::FFflag* c_fflag; // optional pointer + acr_compl::FCtype* p_ctype; // reference to parent row + acr_compl::FFalias* c_falias; // optional pointer + acr_compl::FFalias** c_falias_srcfield_elems; // array of pointers + u32 c_falias_srcfield_n; // array of pointers + u32 c_falias_srcfield_max; // capacity of allocated array + bool ctype_c_field_in_ary; // false membership flag // x-reference on acr_compl.FField.p_arg prevents copy // x-reference on acr_compl.FField.c_anonfld prevents copy // reftype Ptrary of acr_compl.FField.c_fconst prohibits copy @@ -1914,12 +1941,13 @@ void FField_Print(acr_compl::FField& row, algo::cstring& str) __ // global access: ns (Lary, by rowid) // global access: ind_ns (Thash, hash field ns) struct FNs { // acr_compl.FNs - acr_compl::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // - acr_compl::FFcmdline* c_fcmdline; // optional pointer + acr_compl::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // + acr_compl::FFcmdline* c_fcmdline; // optional pointer // x-reference on acr_compl.FNs.c_fcmdline prevents copy // func:acr_compl.FNs..AssignOp inline acr_compl::FNs& operator =(const acr_compl::FNs &rhs) = delete; @@ -1963,10 +1991,11 @@ void FNs_Uninit(acr_compl::FNs& ns) __attribute__((nothrow)); // global access: ind_ssimfile (Thash, hash field ssimfile) // access: acr_compl.FCtype.c_ssimfile (Ptr) struct FSsimfile { // acr_compl.FSsimfile - acr_compl::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - acr_compl::FCtype* p_ctype; // reference to parent row + acr_compl::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + acr_compl::FCtype* p_ctype; // reference to parent row // x-reference on acr_compl.FSsimfile.p_ctype prevents copy // func:acr_compl.FSsimfile..AssignOp inline acr_compl::FSsimfile& operator =(const acr_compl::FSsimfile &rhs) = delete; diff --git a/include/gen/acr_compl_gen.inl.h b/include/gen/acr_compl_gen.inl.h index 313cca3e..d4d7a4ea 100644 --- a/include/gen/acr_compl_gen.inl.h +++ b/include/gen/acr_compl_gen.inl.h @@ -327,6 +327,7 @@ inline void acr_compl::FCtype_Init(acr_compl::FCtype& ctype) { ctype.c_ssimfile = NULL; ctype.c_argvtype = NULL; ctype.ind_ctype_next = (acr_compl::FCtype*)-1; // (acr_compl.FDb.ind_ctype) not-in-hash + ctype.ind_ctype_hashval = 0; // stored hash value } // --- acr_compl.FCtype..Ctor @@ -1741,6 +1742,7 @@ inline void acr_compl::c_fcmdline_Remove(acr_compl::FNs& ns, acr_compl::FFcmdlin inline void acr_compl::FNs_Init(acr_compl::FNs& ns) { ns.c_fcmdline = NULL; ns.ind_ns_next = (acr_compl::FNs*)-1; // (acr_compl.FDb.ind_ns) not-in-hash + ns.ind_ns_hashval = 0; // stored hash value } // --- acr_compl.FNs..Ctor @@ -1758,6 +1760,7 @@ inline acr_compl::FNs::~FNs() { inline void acr_compl::FSsimfile_Init(acr_compl::FSsimfile& ssimfile) { ssimfile.p_ctype = NULL; ssimfile.ind_ssimfile_next = (acr_compl::FSsimfile*)-1; // (acr_compl.FDb.ind_ssimfile) not-in-hash + ssimfile.ind_ssimfile_hashval = 0; // stored hash value } // --- acr_compl.FSsimfile..Ctor diff --git a/include/gen/acr_dm_gen.h b/include/gen/acr_dm_gen.h index 7c6fea6c..ed6a8809 100644 --- a/include/gen/acr_dm_gen.h +++ b/include/gen/acr_dm_gen.h @@ -52,7 +52,6 @@ namespace acr_dm { struct _db_tuple_curs; } namespace acr_dm { struct _db_attr_curs; } namespace acr_dm { struct _db_value_curs; } namespace acr_dm { struct _db_bh_tuple_curs; } -namespace acr_dm { struct Source_source_bitcurs; } namespace acr_dm { struct tuple_zs_attr_curs; } namespace acr_dm { struct trace; } namespace acr_dm { struct FDb; } @@ -69,12 +68,12 @@ namespace acr_dm { // gen:ns_print_struct // access: acr_dm.FTuple.zs_attr (Llist) // access: acr_dm.FValue.p_attr (Upptr) struct FAttr { // acr_dm.FAttr - algo::cstring name; // - acr_dm::FTuple* p_tuple; // reference to parent row - acr_dm::FValue* zs_value_head; // zero-terminated singly linked list - i32 zs_value_n; // zero-terminated singly linked list - acr_dm::FValue* zs_value_tail; // pointer to last element - acr_dm::FAttr* zs_attr_next; // zslist link; -1 means not-in-list + algo::cstring name; // + acr_dm::FTuple* p_tuple; // reference to parent row + acr_dm::FValue* zs_value_head; // zero-terminated singly linked list + i32 zs_value_n; // zero-terminated singly linked list + acr_dm::FValue* zs_value_tail; // pointer to last element + acr_dm::FAttr* tuple_zs_attr_next; // zslist link; -1 means not-in-list // reftype Llist of acr_dm.FAttr.zs_value prohibits copy // func:acr_dm.FAttr..AssignOp inline acr_dm::FAttr& operator =(const acr_dm::FAttr &rhs) = delete; @@ -100,7 +99,7 @@ inline bool zs_value_EmptyQ(acr_dm::FAttr& attr) __attribute__((__warn_ inline acr_dm::FValue* zs_value_First(acr_dm::FAttr& attr) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:acr_dm.FAttr.zs_value.InLlistQ -inline bool zs_value_InLlistQ(acr_dm::FValue& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool attr_zs_value_InLlistQ(acr_dm::FValue& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:acr_dm.FAttr.zs_value.Insert void zs_value_Insert(acr_dm::FAttr& attr, acr_dm::FValue& row) __attribute__((nothrow)); @@ -112,7 +111,7 @@ inline acr_dm::FValue* zs_value_Last(acr_dm::FAttr& attr) __attribute__((__warn_ inline i32 zs_value_N(const acr_dm::FAttr& attr) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:acr_dm.FAttr.zs_value.Next -inline acr_dm::FValue* zs_value_Next(acr_dm::FValue &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr_dm::FValue* attr_zs_value_Next(acr_dm::FValue &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. // func:acr_dm.FAttr.zs_value.Remove @@ -282,6 +281,9 @@ void ind_tuple_Remove(acr_dm::FTuple& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:acr_dm.FDb.ind_tuple.Reserve void ind_tuple_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_dm.FDb.ind_tuple.AbsReserve +void ind_tuple_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -560,17 +562,6 @@ inline void source_OrBits(acr_dm::Source& parent, acr_dm::Source &rhs) // func:acr_dm.Source.source.Sup inline i32 source_Sup(acr_dm::Source& parent) __attribute__((__warn_unused_result__, nothrow)); -// proceed to next item -// func:acr_dm.Source.source_bitcurs.Next -void Source_source_bitcurs_Next(Source_source_bitcurs &curs); -// func:acr_dm.Source.source_bitcurs.Reset -inline void Source_source_bitcurs_Reset(Source_source_bitcurs &curs, acr_dm::Source &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:acr_dm.Source.source_bitcurs.ValidQ -inline bool Source_source_bitcurs_ValidQ(Source_source_bitcurs &curs) __attribute__((nothrow)); -// item access -// func:acr_dm.Source.source_bitcurs.Access -inline int& Source_source_bitcurs_Access(Source_source_bitcurs &curs) __attribute__((nothrow)); // Set all fields to initial values. // func:acr_dm.Source..Init inline void Source_Init(acr_dm::Source& parent); @@ -582,14 +573,15 @@ inline void Source_Init(acr_dm::Source& parent); // global access: bh_tuple (Bheap, sort field rowid) // access: acr_dm.FAttr.p_tuple (Upptr) struct FTuple { // acr_dm.FTuple - acr_dm::FTuple* ind_tuple_next; // hash next - i32 bh_tuple_idx; // index in heap; -1 means not-in-heap - algo::cstring key; // - acr_dm::Rowid rowid; // - acr_dm::FAttr* zs_attr_head; // zero-terminated singly linked list - i32 zs_attr_n; // zero-terminated singly linked list - acr_dm::FAttr* zs_attr_tail; // pointer to last element - acr_dm::Source source; // + acr_dm::FTuple* ind_tuple_next; // hash next + u32 ind_tuple_hashval; // hash value + i32 bh_tuple_idx; // index in heap; -1 means not-in-heap + algo::cstring key; // + acr_dm::Rowid rowid; // + acr_dm::FAttr* zs_attr_head; // zero-terminated singly linked list + i32 zs_attr_n; // zero-terminated singly linked list + acr_dm::FAttr* zs_attr_tail; // pointer to last element + acr_dm::Source source; // // reftype Llist of acr_dm.FTuple.zs_attr prohibits copy // func:acr_dm.FTuple..AssignOp inline acr_dm::FTuple& operator =(const acr_dm::FTuple &rhs) = delete; @@ -622,7 +614,7 @@ inline bool zs_attr_EmptyQ(acr_dm::FTuple& tuple) __attribute__((__warn inline acr_dm::FAttr* zs_attr_First(acr_dm::FTuple& tuple) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:acr_dm.FTuple.zs_attr.InLlistQ -inline bool zs_attr_InLlistQ(acr_dm::FAttr& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool tuple_zs_attr_InLlistQ(acr_dm::FAttr& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:acr_dm.FTuple.zs_attr.Insert void zs_attr_Insert(acr_dm::FTuple& tuple, acr_dm::FAttr& row) __attribute__((nothrow)); @@ -634,7 +626,7 @@ inline acr_dm::FAttr* zs_attr_Last(acr_dm::FTuple& tuple) __attribute__((__warn_ inline i32 zs_attr_N(const acr_dm::FTuple& tuple) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:acr_dm.FTuple.zs_attr.Next -inline acr_dm::FAttr* zs_attr_Next(acr_dm::FAttr &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr_dm::FAttr* tuple_zs_attr_Next(acr_dm::FAttr &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. // func:acr_dm.FTuple.zs_attr.Remove @@ -672,10 +664,10 @@ void FTuple_Uninit(acr_dm::FTuple& tuple) __attribute__((nothrow // global access: value (Lary, by rowid) // access: acr_dm.FAttr.zs_value (Llist) struct FValue { // acr_dm.FValue - acr_dm::FValue* zs_value_next; // zslist link; -1 means not-in-list - algo::cstring value; // - acr_dm::FAttr* p_attr; // reference to parent row - acr_dm::Source source; // + acr_dm::FValue* attr_zs_value_next; // zslist link; -1 means not-in-list + algo::cstring value; // + acr_dm::FAttr* p_attr; // reference to parent row + acr_dm::Source source; // // func:acr_dm.FValue..AssignOp inline acr_dm::FValue& operator =(const acr_dm::FValue &rhs) = delete; // func:acr_dm.FValue..CopyCtor @@ -798,15 +790,6 @@ struct _db_bh_tuple_curs { }; -struct Source_source_bitcurs {// cursor - typedef int& ChildType; - u8* elems; - int n_elems; - int bit; - Source_source_bitcurs() : elems(0), n_elems(0), bit(0) {} -}; - - struct tuple_zs_attr_curs {// fcurs:acr_dm.FTuple.zs_attr/curs typedef acr_dm::FAttr ChildType; acr_dm::FAttr* row; diff --git a/include/gen/acr_dm_gen.inl.h b/include/gen/acr_dm_gen.inl.h index 2a778d1c..ffc06cdd 100644 --- a/include/gen/acr_dm_gen.inl.h +++ b/include/gen/acr_dm_gen.inl.h @@ -43,9 +43,9 @@ inline acr_dm::FValue* acr_dm::zs_value_First(acr_dm::FAttr& attr) { // --- acr_dm.FAttr.zs_value.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool acr_dm::zs_value_InLlistQ(acr_dm::FValue& row) { +inline bool acr_dm::attr_zs_value_InLlistQ(acr_dm::FValue& row) { bool result = false; - result = !(row.zs_value_next == (acr_dm::FValue*)-1); + result = !(row.attr_zs_value_next == (acr_dm::FValue*)-1); return result; } @@ -65,8 +65,8 @@ inline i32 acr_dm::zs_value_N(const acr_dm::FAttr& attr) { // --- acr_dm.FAttr.zs_value.Next // Return pointer to next element in the list -inline acr_dm::FValue* acr_dm::zs_value_Next(acr_dm::FValue &row) { - return row.zs_value_next; +inline acr_dm::FValue* acr_dm::attr_zs_value_Next(acr_dm::FValue &row) { + return row.attr_zs_value_next; } // --- acr_dm.FAttr.zs_value.qLast @@ -92,7 +92,7 @@ inline bool acr_dm::attr_zs_value_curs_ValidQ(attr_zs_value_curs &curs) { // --- acr_dm.FAttr.zs_value_curs.Next // proceed to next item inline void acr_dm::attr_zs_value_curs_Next(attr_zs_value_curs &curs) { - acr_dm::FValue *next = (*curs.row).zs_value_next; + acr_dm::FValue *next = (*curs.row).attr_zs_value_next; curs.row = next; } @@ -109,7 +109,7 @@ inline void acr_dm::FAttr_Init(acr_dm::FAttr& attr) { attr.zs_value_head = NULL; // (acr_dm.FAttr.zs_value) attr.zs_value_n = 0; // (acr_dm.FAttr.zs_value) attr.zs_value_tail = NULL; // (acr_dm.FAttr.zs_value) - attr.zs_attr_next = (acr_dm::FAttr*)-1; // (acr_dm.FTuple.zs_attr) not-in-list + attr.tuple_zs_attr_next = (acr_dm::FAttr*)-1; // (acr_dm.FTuple.zs_attr) not-in-list } // --- acr_dm.FAttr..Ctor @@ -649,26 +649,6 @@ inline i32 acr_dm::source_Sup(acr_dm::Source& parent) { return ret; } -// --- acr_dm.Source.source_bitcurs.Reset -inline void acr_dm::Source_source_bitcurs_Reset(Source_source_bitcurs &curs, acr_dm::Source &parent) { - curs.elems = &source_qFind(parent,0); - curs.n_elems = source_N(parent); - curs.bit = -1; - Source_source_bitcurs_Next(curs); -} - -// --- acr_dm.Source.source_bitcurs.ValidQ -// cursor points to valid item -inline bool acr_dm::Source_source_bitcurs_ValidQ(Source_source_bitcurs &curs) { - return curs.bit < curs.n_elems*8; -} - -// --- acr_dm.Source.source_bitcurs.Access -// item access -inline int& acr_dm::Source_source_bitcurs_Access(Source_source_bitcurs &curs) { - return curs.bit; -} - // --- acr_dm.Source..Init // Set all fields to initial values. inline void acr_dm::Source_Init(acr_dm::Source& parent) { @@ -710,9 +690,9 @@ inline acr_dm::FAttr* acr_dm::zs_attr_First(acr_dm::FTuple& tuple) { // --- acr_dm.FTuple.zs_attr.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool acr_dm::zs_attr_InLlistQ(acr_dm::FAttr& row) { +inline bool acr_dm::tuple_zs_attr_InLlistQ(acr_dm::FAttr& row) { bool result = false; - result = !(row.zs_attr_next == (acr_dm::FAttr*)-1); + result = !(row.tuple_zs_attr_next == (acr_dm::FAttr*)-1); return result; } @@ -732,8 +712,8 @@ inline i32 acr_dm::zs_attr_N(const acr_dm::FTuple& tuple) { // --- acr_dm.FTuple.zs_attr.Next // Return pointer to next element in the list -inline acr_dm::FAttr* acr_dm::zs_attr_Next(acr_dm::FAttr &row) { - return row.zs_attr_next; +inline acr_dm::FAttr* acr_dm::tuple_zs_attr_Next(acr_dm::FAttr &row) { + return row.tuple_zs_attr_next; } // --- acr_dm.FTuple.zs_attr.qLast @@ -751,6 +731,7 @@ inline void acr_dm::FTuple_Init(acr_dm::FTuple& tuple) { tuple.zs_attr_n = 0; // (acr_dm.FTuple.zs_attr) tuple.zs_attr_tail = NULL; // (acr_dm.FTuple.zs_attr) tuple.ind_tuple_next = (acr_dm::FTuple*)-1; // (acr_dm.FDb.ind_tuple) not-in-hash + tuple.ind_tuple_hashval = 0; // stored hash value tuple.bh_tuple_idx = -1; // (acr_dm.FDb.bh_tuple) not-in-heap } @@ -769,7 +750,7 @@ inline bool acr_dm::tuple_zs_attr_curs_ValidQ(tuple_zs_attr_curs &curs) { // --- acr_dm.FTuple.zs_attr_curs.Next // proceed to next item inline void acr_dm::tuple_zs_attr_curs_Next(tuple_zs_attr_curs &curs) { - acr_dm::FAttr *next = (*curs.row).zs_attr_next; + acr_dm::FAttr *next = (*curs.row).tuple_zs_attr_next; curs.row = next; } @@ -793,7 +774,7 @@ inline acr_dm::FTuple::~FTuple() { // Set all fields to initial values. inline void acr_dm::FValue_Init(acr_dm::FValue& value) { value.p_attr = NULL; - value.zs_value_next = (acr_dm::FValue*)-1; // (acr_dm.FAttr.zs_value) not-in-list + value.attr_zs_value_next = (acr_dm::FValue*)-1; // (acr_dm.FAttr.zs_value) not-in-list } // --- acr_dm.FValue..Ctor diff --git a/include/gen/acr_ed_gen.h b/include/gen/acr_ed_gen.h index 620419a0..837bd349 100644 --- a/include/gen/acr_ed_gen.h +++ b/include/gen/acr_ed_gen.h @@ -58,25 +58,27 @@ enum acr_ed_TableIdEnum { // acr_ed.TableId.value ,acr_ed_TableId_dev_gitfile = 6 // dev.gitfile -> acr_ed.FGitfile ,acr_ed_TableId_dmmeta_Listtype = 7 // dmmeta.Listtype -> acr_ed.FListtype ,acr_ed_TableId_dmmeta_listtype = 7 // dmmeta.listtype -> acr_ed.FListtype - ,acr_ed_TableId_dmmeta_Ns = 8 // dmmeta.Ns -> acr_ed.FNs - ,acr_ed_TableId_dmmeta_ns = 8 // dmmeta.ns -> acr_ed.FNs - ,acr_ed_TableId_dmmeta_Nsdb = 9 // dmmeta.Nsdb -> acr_ed.FNsdb - ,acr_ed_TableId_dmmeta_nsdb = 9 // dmmeta.nsdb -> acr_ed.FNsdb - ,acr_ed_TableId_dmmeta_Pack = 10 // dmmeta.Pack -> acr_ed.FPack - ,acr_ed_TableId_dmmeta_pack = 10 // dmmeta.pack -> acr_ed.FPack - ,acr_ed_TableId_dev_Sbpath = 11 // dev.Sbpath -> acr_ed.FSbpath - ,acr_ed_TableId_dev_sbpath = 11 // dev.sbpath -> acr_ed.FSbpath - ,acr_ed_TableId_dmmeta_Ssimfile = 12 // dmmeta.Ssimfile -> acr_ed.FSsimfile - ,acr_ed_TableId_dmmeta_ssimfile = 12 // dmmeta.ssimfile -> acr_ed.FSsimfile - ,acr_ed_TableId_dev_Target = 13 // dev.Target -> acr_ed.FTarget - ,acr_ed_TableId_dev_target = 13 // dev.target -> acr_ed.FTarget - ,acr_ed_TableId_dev_Targsrc = 14 // dev.Targsrc -> acr_ed.FTargsrc - ,acr_ed_TableId_dev_targsrc = 14 // dev.targsrc -> acr_ed.FTargsrc - ,acr_ed_TableId_dmmeta_Typefld = 15 // dmmeta.Typefld -> acr_ed.FTypefld - ,acr_ed_TableId_dmmeta_typefld = 15 // dmmeta.typefld -> acr_ed.FTypefld + ,acr_ed_TableId_dmmeta_Msgtype = 8 // dmmeta.Msgtype -> acr_ed.FMsgtype + ,acr_ed_TableId_dmmeta_msgtype = 8 // dmmeta.msgtype -> acr_ed.FMsgtype + ,acr_ed_TableId_dmmeta_Ns = 9 // dmmeta.Ns -> acr_ed.FNs + ,acr_ed_TableId_dmmeta_ns = 9 // dmmeta.ns -> acr_ed.FNs + ,acr_ed_TableId_dmmeta_Nsdb = 10 // dmmeta.Nsdb -> acr_ed.FNsdb + ,acr_ed_TableId_dmmeta_nsdb = 10 // dmmeta.nsdb -> acr_ed.FNsdb + ,acr_ed_TableId_dmmeta_Pack = 11 // dmmeta.Pack -> acr_ed.FPack + ,acr_ed_TableId_dmmeta_pack = 11 // dmmeta.pack -> acr_ed.FPack + ,acr_ed_TableId_dev_Sbpath = 12 // dev.Sbpath -> acr_ed.FSbpath + ,acr_ed_TableId_dev_sbpath = 12 // dev.sbpath -> acr_ed.FSbpath + ,acr_ed_TableId_dmmeta_Ssimfile = 13 // dmmeta.Ssimfile -> acr_ed.FSsimfile + ,acr_ed_TableId_dmmeta_ssimfile = 13 // dmmeta.ssimfile -> acr_ed.FSsimfile + ,acr_ed_TableId_dev_Target = 14 // dev.Target -> acr_ed.FTarget + ,acr_ed_TableId_dev_target = 14 // dev.target -> acr_ed.FTarget + ,acr_ed_TableId_dev_Targsrc = 15 // dev.Targsrc -> acr_ed.FTargsrc + ,acr_ed_TableId_dev_targsrc = 15 // dev.targsrc -> acr_ed.FTargsrc + ,acr_ed_TableId_dmmeta_Typefld = 16 // dmmeta.Typefld -> acr_ed.FTypefld + ,acr_ed_TableId_dmmeta_typefld = 16 // dmmeta.typefld -> acr_ed.FTypefld }; -enum { acr_ed_TableIdEnum_N = 32 }; +enum { acr_ed_TableIdEnum_N = 34 }; namespace acr_ed { // gen:ns_pkeytypedef } // gen:ns_pkeytypedef @@ -95,6 +97,7 @@ namespace acr_ed { struct FCtype; } namespace dmmeta { struct Fprefix; } namespace dev { struct Gitfile; } namespace dmmeta { struct Listtype; } +namespace dmmeta { struct Msgtype; } namespace dmmeta { struct Ns; } namespace dmmeta { struct Nsdb; } namespace dmmeta { struct Pack; } @@ -124,6 +127,7 @@ namespace acr_ed { struct _db_cfmt_curs; } namespace acr_ed { struct _db_nsdb_curs; } namespace acr_ed { struct _db_edaction_curs; } namespace acr_ed { struct _db_gitfile_curs; } +namespace acr_ed { struct _db_msgtype_curs; } namespace acr_ed { struct target_zd_targsrc_curs; } namespace acr_ed { struct FCfmt; } namespace acr_ed { struct FCpptype; } @@ -135,6 +139,7 @@ namespace acr_ed { struct FField; } namespace acr_ed { struct FFprefix; } namespace acr_ed { struct FGitfile; } namespace acr_ed { struct FListtype; } +namespace acr_ed { struct FMsgtype; } namespace acr_ed { struct FNsdb; } namespace acr_ed { struct FPack; } namespace acr_ed { struct FSbpath; } @@ -149,13 +154,11 @@ namespace acr_ed { // hook_fcn_typedef } // hook_decl namespace acr_ed { // gen:ns_gsymbol extern const char* atfdb_cijob_comp; // "comp" - extern const char* atfdb_cijob_cov; // "cov" + extern const char* atfdb_cijob_coverage; // "coverage" extern const char* atfdb_cijob_memcheck; // "memcheck" extern const char* atfdb_cijob_normalize; // "normalize" } // gen:ns_gsymbol namespace acr_ed { // gen:ns_gsymbol - extern const algo::strptr dev_package_amc; // "amc" - extern const algo::strptr dev_package_apm; // "apm" extern const algo::strptr dev_package_openacr; // "openacr" } // gen:ns_gsymbol namespace acr_ed { // gen:ns_print_struct @@ -286,21 +289,22 @@ void FCstr_Uninit(acr_ed::FCstr& cstr) __attribute__((nothrow)); // access: acr_ed.FField.p_arg (Upptr) // access: acr_ed.FSsimfile.p_ctype (Upptr) struct FCtype { // acr_ed.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - acr_ed::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - acr_ed::FCstr* c_cstr; // optional pointer - acr_ed::FNs* p_ns; // reference to parent row - acr_ed::FSsimfile* c_ssimfile; // optional pointer - acr_ed::FPack* c_pack; // optional pointer - acr_ed::FTypefld* c_typefld; // optional pointer - acr_ed::FCpptype* c_cpptype; // optional pointer - acr_ed::FCfmt** c_cfmt_elems; // array of pointers - u32 c_cfmt_n; // array of pointers - u32 c_cfmt_max; // capacity of allocated array - acr_ed::FCtype* ind_ctype_next; // hash next + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + acr_ed::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + acr_ed::FCstr* c_cstr; // optional pointer + acr_ed::FNs* p_ns; // reference to parent row + acr_ed::FSsimfile* c_ssimfile; // optional pointer + acr_ed::FPack* c_pack; // optional pointer + acr_ed::FTypefld* c_typefld; // optional pointer + acr_ed::FCpptype* c_cpptype; // optional pointer + acr_ed::FCfmt** c_cfmt_elems; // array of pointers + u32 c_cfmt_n; // array of pointers + u32 c_cfmt_max; // capacity of allocated array + acr_ed::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // reftype Ptrary of acr_ed.FCtype.c_field prohibits copy // x-reference on acr_ed.FCtype.c_cstr prevents copy // x-reference on acr_ed.FCtype.p_ns prevents copy @@ -489,12 +493,13 @@ void FCtype_Uninit(acr_ed::FCtype& ctype) __attribute__((nothrow // create: acr_ed.FDb.edaction (Inlary) // global access: ind_edaction (Thash, hash field edaction) struct FEdaction { // acr_ed.FEdaction - algo::Smallstr50 edaction; // - bool needamc; // false - algo::Comment comment; // - acr_ed::edaction_step_hook step; // NULL Pointer to a function - bool select; // false - acr_ed::FEdaction* ind_edaction_next; // hash next + algo::Smallstr50 edaction; // + bool needamc; // false + algo::Comment comment; // + acr_ed::edaction_step_hook step; // NULL Pointer to a function + bool select; // false + acr_ed::FEdaction* ind_edaction_next; // hash next + u32 ind_edaction_hashval; // hash value // reftype Hook of acr_ed.FEdaction.step prohibits copy // func:acr_ed.FEdaction..AssignOp inline acr_ed::FEdaction& operator =(const acr_ed::FEdaction &rhs) = delete; @@ -627,6 +632,8 @@ struct FDb { // acr_ed.FDb: In-memory database for acr_ed i32 ind_edaction_n; // number of elements in the hash table acr_ed::FGitfile* gitfile_lary[32]; // level array i32 gitfile_n; // number of elements in array + acr_ed::FMsgtype* msgtype_lary[32]; // level array + i32 msgtype_n; // number of elements in array acr_ed::trace trace; // }; @@ -691,6 +698,9 @@ void ind_ns_Remove(acr_ed::FNs& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:acr_ed.FDb.ind_ns.Reserve void ind_ns_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_ed.FDb.ind_ns.AbsReserve +void ind_ns_AbsReserve(int n) __attribute__((nothrow)); // Read argc,argv directly into the fields of the command line(s) // The following fields are updated: @@ -795,6 +805,9 @@ void ind_field_Remove(acr_ed::FField& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:acr_ed.FDb.ind_field.Reserve void ind_field_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_ed.FDb.ind_field.AbsReserve +void ind_field_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -854,6 +867,9 @@ void ind_ctype_Remove(acr_ed::FCtype& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:acr_ed.FDb.ind_ctype.Reserve void ind_ctype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_ed.FDb.ind_ctype.AbsReserve +void ind_ctype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -913,6 +929,9 @@ void ind_ssimfile_Remove(acr_ed::FSsimfile& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:acr_ed.FDb.ind_ssimfile.Reserve void ind_ssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_ed.FDb.ind_ssimfile.AbsReserve +void ind_ssimfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -967,6 +986,11 @@ algo::cstring& vis_AllocAt(int at) __attribute__((__warn_unused_result__, // Reserve space. Insert N elements at the end of the array, return pointer to array // func:acr_ed.FDb.vis.AllocN algo::aryptr vis_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:acr_ed.FDb.vis.AllocNAt +algo::aryptr vis_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:acr_ed.FDb.vis.EmptyQ inline bool vis_EmptyQ() __attribute__((nothrow)); @@ -1016,6 +1040,10 @@ algo::aryptr vis_AllocNVal(int n_elems, const algo::cstring& val) // Function returns success value. // func:acr_ed.FDb.vis.ReadStrptrMaybe bool vis_ReadStrptrMaybe(algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:acr_ed.FDb.vis.Insary +void vis_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1078,6 +1106,9 @@ void ind_listtype_Remove(acr_ed::FListtype& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:acr_ed.FDb.ind_listtype.Reserve void ind_listtype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_ed.FDb.ind_listtype.AbsReserve +void ind_listtype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1140,6 +1171,9 @@ void ind_fprefix_Remove(acr_ed::FFprefix& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:acr_ed.FDb.ind_fprefix.Reserve void ind_fprefix_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_ed.FDb.ind_fprefix.AbsReserve +void ind_fprefix_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1199,6 +1233,9 @@ void ind_target_Remove(acr_ed::FTarget& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:acr_ed.FDb.ind_target.Reserve void ind_target_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_ed.FDb.ind_target.AbsReserve +void ind_target_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1535,6 +1572,9 @@ void ind_nsdb_Remove(acr_ed::FNsdb& row) __attribute__((nothrow) // Reserve enough room in the hash for N more elements. Return success code. // func:acr_ed.FDb.ind_nsdb.Reserve void ind_nsdb_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_ed.FDb.ind_nsdb.AbsReserve +void ind_nsdb_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1606,6 +1646,9 @@ void ind_edaction_Remove(acr_ed::FEdaction& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:acr_ed.FDb.ind_edaction.Reserve void ind_edaction_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_ed.FDb.ind_edaction.AbsReserve +void ind_edaction_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1647,6 +1690,46 @@ inline acr_ed::FGitfile& gitfile_qFind(u64 t) __attribute__((nothrow, pure)); // func:acr_ed.FDb.gitfile.XrefMaybe bool gitfile_XrefMaybe(acr_ed::FGitfile &row); +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:acr_ed.FDb.msgtype.Alloc +acr_ed::FMsgtype& msgtype_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:acr_ed.FDb.msgtype.AllocMaybe +acr_ed::FMsgtype* msgtype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:acr_ed.FDb.msgtype.InsertMaybe +acr_ed::FMsgtype* msgtype_InsertMaybe(const dmmeta::Msgtype &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:acr_ed.FDb.msgtype.AllocMem +void* msgtype_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:acr_ed.FDb.msgtype.EmptyQ +inline bool msgtype_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:acr_ed.FDb.msgtype.Find +inline acr_ed::FMsgtype* msgtype_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:acr_ed.FDb.msgtype.Last +inline acr_ed::FMsgtype* msgtype_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:acr_ed.FDb.msgtype.N +inline i32 msgtype_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:acr_ed.FDb.msgtype.RemoveAll +void msgtype_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:acr_ed.FDb.msgtype.RemoveLast +void msgtype_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:acr_ed.FDb.msgtype.qFind +inline acr_ed::FMsgtype& msgtype_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:acr_ed.FDb.msgtype.XrefMaybe +bool msgtype_XrefMaybe(acr_ed::FMsgtype &row); + // cursor points to valid item // func:acr_ed.FDb.ns_curs.Reset inline void _db_ns_curs_Reset(_db_ns_curs &curs, acr_ed::FDb &parent) __attribute__((nothrow)); @@ -1862,6 +1945,18 @@ inline void _db_gitfile_curs_Next(_db_gitfile_curs &curs) __attribute__ // item access // func:acr_ed.FDb.gitfile_curs.Access inline acr_ed::FGitfile& _db_gitfile_curs_Access(_db_gitfile_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:acr_ed.FDb.msgtype_curs.Reset +inline void _db_msgtype_curs_Reset(_db_msgtype_curs &curs, acr_ed::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:acr_ed.FDb.msgtype_curs.ValidQ +inline bool _db_msgtype_curs_ValidQ(_db_msgtype_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:acr_ed.FDb.msgtype_curs.Next +inline void _db_msgtype_curs_Next(_db_msgtype_curs &curs) __attribute__((nothrow)); +// item access +// func:acr_ed.FDb.msgtype_curs.Access +inline acr_ed::FMsgtype& _db_msgtype_curs_Access(_db_msgtype_curs &curs) __attribute__((nothrow)); // Set all fields to initial values. // func:acr_ed.FDb..Init void FDb_Init(); @@ -1875,6 +1970,7 @@ void FDb_Uninit() __attribute__((nothrow)); // access: acr_ed.FCtype.c_field (Ptrary) struct FField { // acr_ed.FField acr_ed::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -1931,10 +2027,11 @@ void FField_Uninit(acr_ed::FField& field) __attribute__((nothrow // global access: fprefix (Lary, by rowid) // global access: ind_fprefix (Thash, hash field fprefix) struct FFprefix { // acr_ed.FFprefix - acr_ed::FFprefix* ind_fprefix_next; // hash next - algo::Smallstr5 fprefix; // - algo::Smallstr50 reftype; // - algo::Comment comment; // + acr_ed::FFprefix* ind_fprefix_next; // hash next + u32 ind_fprefix_hashval; // hash value + algo::Smallstr5 fprefix; // + algo::Smallstr50 reftype; // + algo::Comment comment; // // func:acr_ed.FFprefix..AssignOp inline acr_ed::FFprefix& operator =(const acr_ed::FFprefix &rhs) = delete; // func:acr_ed.FFprefix..CopyCtor @@ -1992,12 +2089,13 @@ algo::Smallstr50 ext_Get(acr_ed::FGitfile& gitfile) __attribute__((__warn_un // global access: listtype (Lary, by rowid) // global access: ind_listtype (Thash, hash field listtype) struct FListtype { // acr_ed.FListtype - acr_ed::FListtype* ind_listtype_next; // hash next - algo::Smallstr5 listtype; // - bool circular; // false Circular list - bool haveprev; // false Previous link - bool instail; // false Queue - algo::Comment comment; // + acr_ed::FListtype* ind_listtype_next; // hash next + u32 ind_listtype_hashval; // hash value + algo::Smallstr5 listtype; // + bool circular; // false Circular list + bool haveprev; // false Previous link + bool instail; // false Queue + algo::Comment comment; // // func:acr_ed.FListtype..AssignOp inline acr_ed::FListtype& operator =(const acr_ed::FListtype &rhs) = delete; // func:acr_ed.FListtype..CopyCtor @@ -2025,6 +2123,29 @@ inline void FListtype_Init(acr_ed::FListtype& listtype); // func:acr_ed.FListtype..Uninit void FListtype_Uninit(acr_ed::FListtype& listtype) __attribute__((nothrow)); +// --- acr_ed.FMsgtype +// create: acr_ed.FDb.msgtype (Lary) +// global access: msgtype (Lary, by rowid) +struct FMsgtype { // acr_ed.FMsgtype + algo::Smallstr100 ctype; // + algo::CppExpr type; // +private: + // func:acr_ed.FMsgtype..Ctor + inline FMsgtype() __attribute__((nothrow)); + friend acr_ed::FMsgtype& msgtype_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend acr_ed::FMsgtype* msgtype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void msgtype_RemoveAll() __attribute__((nothrow)); + friend void msgtype_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:acr_ed.FMsgtype.base.CopyOut +void msgtype_CopyOut(acr_ed::FMsgtype &row, dmmeta::Msgtype &out) __attribute__((nothrow)); +// Copy fields in to row +// func:acr_ed.FMsgtype.base.CopyIn +void msgtype_CopyIn(acr_ed::FMsgtype &row, dmmeta::Msgtype &in) __attribute__((nothrow)); + + // --- acr_ed.FNs // create: acr_ed.FDb.ns (Lary) // global access: ns (Lary, by rowid) @@ -2034,11 +2155,12 @@ void FListtype_Uninit(acr_ed::FListtype& listtype) __attribute__ // access: acr_ed.FSsimfile.p_ns (Upptr) // access: acr_ed.FTarget.p_ns (Upptr) struct FNs { // acr_ed.FNs - acr_ed::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // + acr_ed::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // // func:acr_ed.FNs..AssignOp inline acr_ed::FNs& operator =(const acr_ed::FNs &rhs) = delete; // func:acr_ed.FNs..CopyCtor @@ -2071,9 +2193,10 @@ void FNs_Uninit(acr_ed::FNs& ns) __attribute__((nothrow)); // global access: nsdb (Lary, by rowid) // global access: ind_nsdb (Thash, hash field ns) struct FNsdb { // acr_ed.FNsdb - acr_ed::FNsdb* ind_nsdb_next; // hash next - algo::Smallstr16 ns; // - algo::Comment comment; // + acr_ed::FNsdb* ind_nsdb_next; // hash next + u32 ind_nsdb_hashval; // hash value + algo::Smallstr16 ns; // + algo::Comment comment; // // func:acr_ed.FNsdb..AssignOp inline acr_ed::FNsdb& operator =(const acr_ed::FNsdb &rhs) = delete; // func:acr_ed.FNsdb..CopyCtor @@ -2163,11 +2286,12 @@ void sbpath_CopyIn(acr_ed::FSbpath &row, dev::Sbpath &in) __attr // global access: ind_ssimfile (Thash, hash field ssimfile) // access: acr_ed.FCtype.c_ssimfile (Ptr) struct FSsimfile { // acr_ed.FSsimfile - acr_ed::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - acr_ed::FCtype* p_ctype; // reference to parent row - acr_ed::FNs* p_ns; // reference to parent row + acr_ed::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + acr_ed::FCtype* p_ctype; // reference to parent row + acr_ed::FNs* p_ns; // reference to parent row // x-reference on acr_ed.FSsimfile.p_ctype prevents copy // x-reference on acr_ed.FSsimfile.p_ns prevents copy // func:acr_ed.FSsimfile..AssignOp @@ -2214,13 +2338,14 @@ void FSsimfile_Uninit(acr_ed::FSsimfile& ssimfile) __attribute__ // global access: ind_target (Thash, hash field target) // access: acr_ed.FTargsrc.p_target (Upptr) struct FTarget { // acr_ed.FTarget - acr_ed::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target - u32 score; // 0 For guessing target from source file - acr_ed::FTargsrc* zd_targsrc_head; // zero-terminated doubly linked list - i32 zd_targsrc_n; // zero-terminated doubly linked list - acr_ed::FTargsrc* zd_targsrc_tail; // pointer to last element - acr_ed::FNs* p_ns; // reference to parent row + acr_ed::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target + u32 score; // 0 For guessing target from source file + acr_ed::FTargsrc* zd_targsrc_head; // zero-terminated doubly linked list + i32 zd_targsrc_n; // zero-terminated doubly linked list + acr_ed::FTargsrc* zd_targsrc_tail; // pointer to last element + acr_ed::FNs* p_ns; // reference to parent row // reftype Llist of acr_ed.FTarget.zd_targsrc prohibits copy // x-reference on acr_ed.FTarget.p_ns prevents copy // func:acr_ed.FTarget..AssignOp @@ -2254,7 +2379,7 @@ inline bool zd_targsrc_EmptyQ(acr_ed::FTarget& target) __attribute__((_ inline acr_ed::FTargsrc* zd_targsrc_First(acr_ed::FTarget& target) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:acr_ed.FTarget.zd_targsrc.InLlistQ -inline bool zd_targsrc_InLlistQ(acr_ed::FTargsrc& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool target_zd_targsrc_InLlistQ(acr_ed::FTargsrc& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:acr_ed.FTarget.zd_targsrc.Insert void zd_targsrc_Insert(acr_ed::FTarget& target, acr_ed::FTargsrc& row) __attribute__((nothrow)); @@ -2266,10 +2391,10 @@ inline acr_ed::FTargsrc* zd_targsrc_Last(acr_ed::FTarget& target) __attribute__( inline i32 zd_targsrc_N(const acr_ed::FTarget& target) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:acr_ed.FTarget.zd_targsrc.Next -inline acr_ed::FTargsrc* zd_targsrc_Next(acr_ed::FTargsrc &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr_ed::FTargsrc* target_zd_targsrc_Next(acr_ed::FTargsrc &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:acr_ed.FTarget.zd_targsrc.Prev -inline acr_ed::FTargsrc* zd_targsrc_Prev(acr_ed::FTargsrc &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr_ed::FTargsrc* target_zd_targsrc_Prev(acr_ed::FTargsrc &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:acr_ed.FTarget.zd_targsrc.Remove void zd_targsrc_Remove(acr_ed::FTarget& target, acr_ed::FTargsrc& row) __attribute__((nothrow)); @@ -2306,11 +2431,11 @@ void FTarget_Uninit(acr_ed::FTarget& target) __attribute__((noth // global access: targsrc (Lary, by rowid) // access: acr_ed.FTarget.zd_targsrc (Llist) struct FTargsrc { // acr_ed.FTargsrc - acr_ed::FTargsrc* zd_targsrc_next; // zslist link; -1 means not-in-list - acr_ed::FTargsrc* zd_targsrc_prev; // previous element - algo::Smallstr100 targsrc; // - algo::Comment comment; // - acr_ed::FTarget* p_target; // reference to parent row + acr_ed::FTargsrc* target_zd_targsrc_next; // zslist link; -1 means not-in-list + acr_ed::FTargsrc* target_zd_targsrc_prev; // previous element + algo::Smallstr100 targsrc; // + algo::Comment comment; // + acr_ed::FTarget* p_target; // reference to parent row // x-reference on acr_ed.FTargsrc.p_target prevents copy // func:acr_ed.FTargsrc..AssignOp inline acr_ed::FTargsrc& operator =(const acr_ed::FTargsrc &rhs) = delete; @@ -2656,6 +2781,14 @@ struct _db_gitfile_curs {// cursor }; +struct _db_msgtype_curs {// cursor + typedef acr_ed::FMsgtype ChildType; + acr_ed::FDb *parent; + i64 index; + _db_msgtype_curs(){ parent=NULL; index=0; } +}; + + struct target_zd_targsrc_curs {// fcurs:acr_ed.FTarget.zd_targsrc/curs typedef acr_ed::FTargsrc ChildType; acr_ed::FTargsrc* row; diff --git a/include/gen/acr_ed_gen.inl.h b/include/gen/acr_ed_gen.inl.h index c8a88b00..f6966d1c 100644 --- a/include/gen/acr_ed_gen.inl.h +++ b/include/gen/acr_ed_gen.inl.h @@ -378,6 +378,7 @@ inline void acr_ed::FEdaction_Init(acr_ed::FEdaction& edaction) { edaction.select = bool(false); edaction.step = NULL; edaction.ind_edaction_next = (acr_ed::FEdaction*)-1; // (acr_ed.FDb.ind_edaction) not-in-hash + edaction.ind_edaction_hashval = 0; // stored hash value } // --- acr_ed.FEdaction..Ctor @@ -1296,6 +1297,48 @@ inline acr_ed::FGitfile& acr_ed::gitfile_qFind(u64 t) { return _db.gitfile_lary[bsr][index]; } +// --- acr_ed.FDb.msgtype.EmptyQ +// Return true if index is empty +inline bool acr_ed::msgtype_EmptyQ() { + return _db.msgtype_n == 0; +} + +// --- acr_ed.FDb.msgtype.Find +// Look up row by row id. Return NULL if out of range +inline acr_ed::FMsgtype* acr_ed::msgtype_Find(u64 t) { + acr_ed::FMsgtype *retval = NULL; + if (LIKELY(u64(t) < u64(_db.msgtype_n))) { + u64 x = t + 1; + u64 bsr = algo::u64_BitScanReverse(x); + u64 base = u64(1)< ary_name_AllocN(acr::FCheck& check, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:acr.FCheck.ary_name.AllocNAt +algo::aryptr ary_name_AllocNAt(acr::FCheck& check, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:acr.FCheck.ary_name.EmptyQ inline bool ary_name_EmptyQ(acr::FCheck& check) __attribute__((nothrow)); @@ -506,6 +513,10 @@ algo::aryptr ary_name_AllocNVal(acr::FCheck& check, int n_elems, // Function returns success value. // func:acr.FCheck.ary_name.ReadStrptrMaybe bool ary_name_ReadStrptrMaybe(acr::FCheck& check, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:acr.FCheck.ary_name.Insary +void ary_name_Insary(acr::FCheck& check, algo::aryptr rhs, int at) __attribute__((nothrow)); // func:acr.FCheck.c_bad_rec_curs.Reset inline void check_c_bad_rec_curs_Reset(check_c_bad_rec_curs &curs, acr::FCheck &parent) __attribute__((nothrow)); @@ -589,13 +600,13 @@ struct FCtype { // acr.FCtype u32 c_field_max; // capacity of allocated array acr::FCdflt* c_cdflt; // optional pointer acr::FSsimfile* c_ssimfile; // optional pointer - acr::FRec* zd_ctype_rec_head; // zero-terminated doubly linked list - acr::FRec* zd_ctype_rec_tail; // pointer to last element + acr::FRec* zd_rec_head; // zero-terminated doubly linked list + acr::FRec* zd_rec_tail; // pointer to last element acr::FRec** ind_ctype_rec_buckets_elems; // pointer to bucket array i32 ind_ctype_rec_buckets_n; // number of elements in bucket array i32 ind_ctype_rec_n; // number of elements in the hash table - acr::FRec* zd_ctype_selrec_head; // zero-terminated doubly linked list - acr::FRec* zd_ctype_selrec_tail; // pointer to last element + acr::FRec* zd_selrec_head; // zero-terminated doubly linked list + acr::FRec* zd_selrec_tail; // pointer to last element i32 n_insert; // 0 Number of tuples inserted i32 rank; // false Topological sort rank acr::FCtype** c_child_elems; // array of pointers @@ -615,17 +626,18 @@ struct FCtype { // acr.FCtype acr::FSsimreq** c_ssimreq_elems; // array of pointers u32 c_ssimreq_n; // array of pointers u32 c_ssimreq_max; // capacity of allocated array - bool _db_c_ctype_front_in_ary; // false membership flag + bool c_ctype_front_in_ary; // false membership flag acr::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value acr::FCtype* zd_sel_ctype_next; // zslist link; -1 means not-in-list acr::FCtype* zd_sel_ctype_prev; // previous element i32 bh_ctype_topo_idx; // index in heap; -1 means not-in-heap // reftype Ptrary of acr.FCtype.c_field prohibits copy // x-reference on acr.FCtype.c_cdflt prevents copy // x-reference on acr.FCtype.c_ssimfile prevents copy - // reftype Llist of acr.FCtype.zd_ctype_rec prohibits copy + // reftype Llist of acr.FCtype.zd_rec prohibits copy // reftype Thash of acr.FCtype.ind_ctype_rec prohibits copy - // reftype Llist of acr.FCtype.zd_ctype_selrec prohibits copy + // reftype Llist of acr.FCtype.zd_selrec prohibits copy // reftype Ptrary of acr.FCtype.c_child prohibits copy // x-reference on acr.FCtype.c_bltin prevents copy // reftype Llist of acr.FCtype.zd_arg prohibits copy @@ -635,9 +647,9 @@ struct FCtype { // acr.FCtype // reftype Ptrary of acr.FCtype.c_field prohibits copy // x-reference on acr.FCtype.c_cdflt prevents copy // x-reference on acr.FCtype.c_ssimfile prevents copy - // reftype Llist of acr.FCtype.zd_ctype_rec prohibits copy + // reftype Llist of acr.FCtype.zd_rec prohibits copy // reftype Thash of acr.FCtype.ind_ctype_rec prohibits copy - // reftype Llist of acr.FCtype.zd_ctype_selrec prohibits copy + // reftype Llist of acr.FCtype.zd_selrec prohibits copy // reftype Ptrary of acr.FCtype.c_child prohibits copy // x-reference on acr.FCtype.c_bltin prevents copy // reftype Llist of acr.FCtype.zd_arg prohibits copy @@ -722,38 +734,38 @@ inline bool c_ssimfile_InsertMaybe(acr::FCtype& ctype, acr::FSsimfile& inline void c_ssimfile_Remove(acr::FCtype& ctype, acr::FSsimfile& row) __attribute__((nothrow)); // Return true if index is empty -// func:acr.FCtype.zd_ctype_rec.EmptyQ -inline bool zd_ctype_rec_EmptyQ(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:acr.FCtype.zd_rec.EmptyQ +inline bool zd_rec_EmptyQ(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // If index empty, return NULL. Otherwise return pointer to first element in index -// func:acr.FCtype.zd_ctype_rec.First -inline acr::FRec* zd_ctype_rec_First(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:acr.FCtype.zd_rec.First +inline acr::FRec* zd_rec_First(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise -// func:acr.FCtype.zd_ctype_rec.InLlistQ -inline bool zd_ctype_rec_InLlistQ(acr::FRec& row) __attribute__((__warn_unused_result__, nothrow)); +// func:acr.FCtype.zd_rec.InLlistQ +inline bool ctype_zd_rec_InLlistQ(acr::FRec& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. -// func:acr.FCtype.zd_ctype_rec.Insert -void zd_ctype_rec_Insert(acr::FCtype& ctype, acr::FRec& row) __attribute__((nothrow)); +// func:acr.FCtype.zd_rec.Insert +void zd_rec_Insert(acr::FCtype& ctype, acr::FRec& row) __attribute__((nothrow)); // If index empty, return NULL. Otherwise return pointer to last element in index -// func:acr.FCtype.zd_ctype_rec.Last -inline acr::FRec* zd_ctype_rec_Last(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:acr.FCtype.zd_rec.Last +inline acr::FRec* zd_rec_Last(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list -// func:acr.FCtype.zd_ctype_rec.Next -inline acr::FRec* zd_ctype_rec_Next(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); +// func:acr.FCtype.zd_rec.Next +inline acr::FRec* ctype_zd_rec_Next(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list -// func:acr.FCtype.zd_ctype_rec.Prev -inline acr::FRec* zd_ctype_rec_Prev(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); +// func:acr.FCtype.zd_rec.Prev +inline acr::FRec* ctype_zd_rec_Prev(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. -// func:acr.FCtype.zd_ctype_rec.Remove -void zd_ctype_rec_Remove(acr::FCtype& ctype, acr::FRec& row) __attribute__((nothrow)); +// func:acr.FCtype.zd_rec.Remove +void zd_rec_Remove(acr::FCtype& ctype, acr::FRec& row) __attribute__((nothrow)); // Empty the index. (The rows are not deleted) -// func:acr.FCtype.zd_ctype_rec.RemoveAll -void zd_ctype_rec_RemoveAll(acr::FCtype& ctype) __attribute__((nothrow)); +// func:acr.FCtype.zd_rec.RemoveAll +void zd_rec_RemoveAll(acr::FCtype& ctype) __attribute__((nothrow)); // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -// func:acr.FCtype.zd_ctype_rec.RemoveFirst -acr::FRec* zd_ctype_rec_RemoveFirst(acr::FCtype& ctype) __attribute__((nothrow)); +// func:acr.FCtype.zd_rec.RemoveFirst +acr::FRec* zd_rec_RemoveFirst(acr::FCtype& ctype) __attribute__((nothrow)); // Return reference to last element in the index. No bounds checking. -// func:acr.FCtype.zd_ctype_rec.qLast -inline acr::FRec& zd_ctype_rec_qLast(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow)); +// func:acr.FCtype.zd_rec.qLast +inline acr::FRec& zd_rec_qLast(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow)); // Return true if hash is empty // func:acr.FCtype.ind_ctype_rec.EmptyQ @@ -773,40 +785,43 @@ void ind_ctype_rec_Remove(acr::FCtype& ctype, acr::FRec& row) __ // Reserve enough room in the hash for N more elements. Return success code. // func:acr.FCtype.ind_ctype_rec.Reserve void ind_ctype_rec_Reserve(acr::FCtype& ctype, int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr.FCtype.ind_ctype_rec.AbsReserve +void ind_ctype_rec_AbsReserve(acr::FCtype& ctype, int n) __attribute__((nothrow)); // Return true if index is empty -// func:acr.FCtype.zd_ctype_selrec.EmptyQ -inline bool zd_ctype_selrec_EmptyQ(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:acr.FCtype.zd_selrec.EmptyQ +inline bool zd_selrec_EmptyQ(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // If index empty, return NULL. Otherwise return pointer to first element in index -// func:acr.FCtype.zd_ctype_selrec.First -inline acr::FRec* zd_ctype_selrec_First(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:acr.FCtype.zd_selrec.First +inline acr::FRec* zd_selrec_First(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise -// func:acr.FCtype.zd_ctype_selrec.InLlistQ -inline bool zd_ctype_selrec_InLlistQ(acr::FRec& row) __attribute__((__warn_unused_result__, nothrow)); +// func:acr.FCtype.zd_selrec.InLlistQ +inline bool ctype_zd_selrec_InLlistQ(acr::FRec& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. -// func:acr.FCtype.zd_ctype_selrec.Insert -void zd_ctype_selrec_Insert(acr::FCtype& ctype, acr::FRec& row) __attribute__((nothrow)); +// func:acr.FCtype.zd_selrec.Insert +void zd_selrec_Insert(acr::FCtype& ctype, acr::FRec& row) __attribute__((nothrow)); // If index empty, return NULL. Otherwise return pointer to last element in index -// func:acr.FCtype.zd_ctype_selrec.Last -inline acr::FRec* zd_ctype_selrec_Last(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:acr.FCtype.zd_selrec.Last +inline acr::FRec* zd_selrec_Last(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list -// func:acr.FCtype.zd_ctype_selrec.Next -inline acr::FRec* zd_ctype_selrec_Next(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); +// func:acr.FCtype.zd_selrec.Next +inline acr::FRec* ctype_zd_selrec_Next(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list -// func:acr.FCtype.zd_ctype_selrec.Prev -inline acr::FRec* zd_ctype_selrec_Prev(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); +// func:acr.FCtype.zd_selrec.Prev +inline acr::FRec* ctype_zd_selrec_Prev(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. -// func:acr.FCtype.zd_ctype_selrec.Remove -void zd_ctype_selrec_Remove(acr::FCtype& ctype, acr::FRec& row) __attribute__((nothrow)); +// func:acr.FCtype.zd_selrec.Remove +void zd_selrec_Remove(acr::FCtype& ctype, acr::FRec& row) __attribute__((nothrow)); // Empty the index. (The rows are not deleted) -// func:acr.FCtype.zd_ctype_selrec.RemoveAll -void zd_ctype_selrec_RemoveAll(acr::FCtype& ctype) __attribute__((nothrow)); +// func:acr.FCtype.zd_selrec.RemoveAll +void zd_selrec_RemoveAll(acr::FCtype& ctype) __attribute__((nothrow)); // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -// func:acr.FCtype.zd_ctype_selrec.RemoveFirst -acr::FRec* zd_ctype_selrec_RemoveFirst(acr::FCtype& ctype) __attribute__((nothrow)); +// func:acr.FCtype.zd_selrec.RemoveFirst +acr::FRec* zd_selrec_RemoveFirst(acr::FCtype& ctype) __attribute__((nothrow)); // Return reference to last element in the index. No bounds checking. -// func:acr.FCtype.zd_ctype_selrec.qLast -inline acr::FRec& zd_ctype_selrec_qLast(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow)); +// func:acr.FCtype.zd_selrec.qLast +inline acr::FRec& zd_selrec_qLast(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:acr.FCtype.c_child.EmptyQ @@ -861,7 +876,7 @@ inline bool zd_arg_EmptyQ(acr::FCtype& ctype) __attribute__((__warn_unu inline acr::FField* zd_arg_First(acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:acr.FCtype.zd_arg.InLlistQ -inline bool zd_arg_InLlistQ(acr::FField& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool ctype_zd_arg_InLlistQ(acr::FField& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:acr.FCtype.zd_arg.Insert void zd_arg_Insert(acr::FCtype& ctype, acr::FField& row) __attribute__((nothrow)); @@ -873,10 +888,10 @@ inline acr::FField* zd_arg_Last(acr::FCtype& ctype) __attribute__((__warn_unuse inline i32 zd_arg_N(const acr::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:acr.FCtype.zd_arg.Next -inline acr::FField* zd_arg_Next(acr::FField &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr::FField* ctype_zd_arg_Next(acr::FField &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:acr.FCtype.zd_arg.Prev -inline acr::FField* zd_arg_Prev(acr::FField &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr::FField* ctype_zd_arg_Prev(acr::FField &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:acr.FCtype.zd_arg.Remove void zd_arg_Remove(acr::FCtype& ctype, acr::FField& row) __attribute__((nothrow)); @@ -949,17 +964,17 @@ inline void ctype_c_field_curs_Next(ctype_c_field_curs &curs) __attribu // func:acr.FCtype.c_field_curs.Access inline acr::FField& ctype_c_field_curs_Access(ctype_c_field_curs &curs) __attribute__((nothrow)); // cursor points to valid item -// func:acr.FCtype.zd_ctype_rec_curs.Reset -inline void ctype_zd_ctype_rec_curs_Reset(ctype_zd_ctype_rec_curs &curs, acr::FCtype &parent) __attribute__((nothrow)); +// func:acr.FCtype.zd_rec_curs.Reset +inline void ctype_zd_rec_curs_Reset(ctype_zd_rec_curs &curs, acr::FCtype &parent) __attribute__((nothrow)); // cursor points to valid item -// func:acr.FCtype.zd_ctype_rec_curs.ValidQ -inline bool ctype_zd_ctype_rec_curs_ValidQ(ctype_zd_ctype_rec_curs &curs) __attribute__((nothrow)); +// func:acr.FCtype.zd_rec_curs.ValidQ +inline bool ctype_zd_rec_curs_ValidQ(ctype_zd_rec_curs &curs) __attribute__((nothrow)); // proceed to next item -// func:acr.FCtype.zd_ctype_rec_curs.Next -inline void ctype_zd_ctype_rec_curs_Next(ctype_zd_ctype_rec_curs &curs) __attribute__((nothrow)); +// func:acr.FCtype.zd_rec_curs.Next +inline void ctype_zd_rec_curs_Next(ctype_zd_rec_curs &curs) __attribute__((nothrow)); // item access -// func:acr.FCtype.zd_ctype_rec_curs.Access -inline acr::FRec& ctype_zd_ctype_rec_curs_Access(ctype_zd_ctype_rec_curs &curs) __attribute__((nothrow)); +// func:acr.FCtype.zd_rec_curs.Access +inline acr::FRec& ctype_zd_rec_curs_Access(ctype_zd_rec_curs &curs) __attribute__((nothrow)); // func:acr.FCtype.ind_ctype_rec_curs.Reset void ctype_ind_ctype_rec_curs_Reset(ctype_ind_ctype_rec_curs &curs, acr::FCtype &parent) __attribute__((nothrow)); // cursor points to valid item @@ -972,17 +987,17 @@ inline void ctype_ind_ctype_rec_curs_Next(ctype_ind_ctype_rec_curs &cur // func:acr.FCtype.ind_ctype_rec_curs.Access inline acr::FRec& ctype_ind_ctype_rec_curs_Access(ctype_ind_ctype_rec_curs &curs) __attribute__((nothrow)); // cursor points to valid item -// func:acr.FCtype.zd_ctype_selrec_curs.Reset -inline void ctype_zd_ctype_selrec_curs_Reset(ctype_zd_ctype_selrec_curs &curs, acr::FCtype &parent) __attribute__((nothrow)); +// func:acr.FCtype.zd_selrec_curs.Reset +inline void ctype_zd_selrec_curs_Reset(ctype_zd_selrec_curs &curs, acr::FCtype &parent) __attribute__((nothrow)); // cursor points to valid item -// func:acr.FCtype.zd_ctype_selrec_curs.ValidQ -inline bool ctype_zd_ctype_selrec_curs_ValidQ(ctype_zd_ctype_selrec_curs &curs) __attribute__((nothrow)); +// func:acr.FCtype.zd_selrec_curs.ValidQ +inline bool ctype_zd_selrec_curs_ValidQ(ctype_zd_selrec_curs &curs) __attribute__((nothrow)); // proceed to next item -// func:acr.FCtype.zd_ctype_selrec_curs.Next -inline void ctype_zd_ctype_selrec_curs_Next(ctype_zd_ctype_selrec_curs &curs) __attribute__((nothrow)); +// func:acr.FCtype.zd_selrec_curs.Next +inline void ctype_zd_selrec_curs_Next(ctype_zd_selrec_curs &curs) __attribute__((nothrow)); // item access -// func:acr.FCtype.zd_ctype_selrec_curs.Access -inline acr::FRec& ctype_zd_ctype_selrec_curs_Access(ctype_zd_ctype_selrec_curs &curs) __attribute__((nothrow)); +// func:acr.FCtype.zd_selrec_curs.Access +inline acr::FRec& ctype_zd_selrec_curs_Access(ctype_zd_selrec_curs &curs) __attribute__((nothrow)); // func:acr.FCtype.c_child_curs.Reset inline void ctype_c_child_curs_Reset(ctype_c_child_curs &curs, acr::FCtype &parent) __attribute__((nothrow)); // cursor points to valid item @@ -1648,6 +1663,9 @@ void ind_ctype_Remove(acr::FCtype& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:acr.FDb.ind_ctype.Reserve void ind_ctype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr.FDb.ind_ctype.AbsReserve +void ind_ctype_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:acr.FDb.ind_field.EmptyQ @@ -1667,6 +1685,9 @@ void ind_field_Remove(acr::FField& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:acr.FDb.ind_field.Reserve void ind_field_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr.FDb.ind_field.AbsReserve +void ind_field_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:acr.FDb.ind_file.EmptyQ @@ -1689,6 +1710,9 @@ void ind_file_Remove(acr::FFile& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:acr.FDb.ind_file.Reserve void ind_file_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr.FDb.ind_file.AbsReserve +void ind_file_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:acr.FDb.zd_all_selrec.EmptyQ @@ -1971,6 +1995,9 @@ void ind_tempkey_Remove(acr::FTempkey& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:acr.FDb.ind_tempkey.Reserve void ind_tempkey_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr.FDb.ind_tempkey.AbsReserve +void ind_tempkey_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:acr.FDb.ind_ssimfile.EmptyQ @@ -1990,6 +2017,9 @@ void ind_ssimfile_Remove(acr::FSsimfile& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:acr.FDb.ind_ssimfile.Reserve void ind_ssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr.FDb.ind_ssimfile.AbsReserve +void ind_ssimfile_AbsReserve(int n) __attribute__((nothrow)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. @@ -2113,6 +2143,9 @@ void ind_ssimsort_Remove(acr::FSsimsort& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:acr.FDb.ind_ssimsort.Reserve void ind_ssimsort_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr.FDb.ind_ssimsort.AbsReserve +void ind_ssimsort_AbsReserve(int n) __attribute__((nothrow)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. @@ -2214,6 +2247,9 @@ void ind_uniqueattr_Remove(acr::FUniqueattr& row) __attribute__( // Reserve enough room in the hash for N more elements. Return success code. // func:acr.FDb.ind_uniqueattr.Reserve void ind_uniqueattr_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr.FDb.ind_uniqueattr.AbsReserve +void ind_uniqueattr_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -2511,6 +2547,9 @@ void ind_sortkey_Remove(acr::FSortkey& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:acr.FDb.ind_sortkey.Reserve void ind_sortkey_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr.FDb.ind_sortkey.AbsReserve +void ind_sortkey_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:acr.FDb.zd_pline_curs.Reset @@ -2901,9 +2940,10 @@ inline void FEvalattr_Init(acr::FEvalattr& parent); // access: acr.FSsimreq.p_parent_field (Upptr) // access: acr.FErr.fld (Ptr) struct FField { // acr.FField - acr::FField* zd_arg_next; // zslist link; -1 means not-in-list - acr::FField* zd_arg_prev; // previous element + acr::FField* ctype_zd_arg_next; // zslist link; -1 means not-in-list + acr::FField* ctype_zd_arg_prev; // previous element acr::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -2975,16 +3015,17 @@ void FField_Uninit(acr::FField& field) __attribute__((nothrow)); // access: acr.FRec.p_infile (Upptr) // access: acr.FSsimfile.c_file (Ptr) struct FFile { // acr.FFile - acr::FFile* ind_file_next; // hash next - algo::cstring file; // Primary key - algo::cstring filename; // Non-empty if it's a real file - bool ephemeral; // false Do not save back - bool sticky; // false Records loaded from file are written back to file - u32 lineno; // 1 Current line number - acr::FRec* zd_frec_head; // zero-terminated doubly linked list - acr::FRec* zd_frec_tail; // pointer to last element - algo::UnTime modtime; // File modification time at time of loading - bool autoloaded; // false File was pulled in implicitly: loaded records are not 'inserted' + acr::FFile* ind_file_next; // hash next + u32 ind_file_hashval; // hash value + algo::cstring file; // Primary key + algo::cstring filename; // Non-empty if it's a real file + bool ephemeral; // false Do not save back + bool sticky; // false Records loaded from file are written back to file + u32 lineno; // 1 Current line number + acr::FRec* zd_frec_head; // zero-terminated doubly linked list + acr::FRec* zd_frec_tail; // pointer to last element + algo::UnTime modtime; // File modification time at time of loading + bool autoloaded; // false File was pulled in implicitly: loaded records are not 'inserted' // reftype Llist of acr.FFile.zd_frec prohibits copy // func:acr.FFile..AssignOp inline acr::FFile& operator =(const acr::FFile &rhs) = delete; @@ -3010,7 +3051,7 @@ inline bool zd_frec_EmptyQ(acr::FFile& file) __attribute__((__warn_unus inline acr::FRec* zd_frec_First(acr::FFile& file) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:acr.FFile.zd_frec.InLlistQ -inline bool zd_frec_InLlistQ(acr::FRec& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool file_zd_frec_InLlistQ(acr::FRec& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:acr.FFile.zd_frec.Insert void zd_frec_Insert(acr::FFile& file, acr::FRec& row) __attribute__((nothrow)); @@ -3019,10 +3060,10 @@ void zd_frec_Insert(acr::FFile& file, acr::FRec& row) __attribut inline acr::FRec* zd_frec_Last(acr::FFile& file) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:acr.FFile.zd_frec.Next -inline acr::FRec* zd_frec_Next(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr::FRec* file_zd_frec_Next(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:acr.FFile.zd_frec.Prev -inline acr::FRec* zd_frec_Prev(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr::FRec* file_zd_frec_Prev(acr::FRec &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:acr.FFile.zd_frec.Remove void zd_frec_Remove(acr::FFile& file, acr::FRec& row) __attribute__((nothrow)); @@ -3080,15 +3121,15 @@ void funique_CopyIn(acr::FFunique &row, dmmeta::Funique &in) __a // global access: zd_pdep (Llist) // access: acr.FPline.zd_child (Llist) struct FPdep { // acr.FPdep: Dependency between two print-line records - acr::FPdep* pdep_next; // Pointer to next free element int tpool - acr::FPdep* zd_pdep_next; // zslist link; -1 means not-in-list - acr::FPdep* zd_pdep_prev; // previous element - acr::FPline* p_parent; // reference to parent row - acr::FPline* p_child; // reference to parent row - i32 weight; // 0 - i32 lindex; // 0 Index of child referencing attr - acr::FPdep* zd_child_next; // zslist link; -1 means not-in-list - acr::FPdep* zd_child_prev; // previous element + acr::FPdep* pdep_next; // Pointer to next free element int tpool + acr::FPdep* zd_pdep_next; // zslist link; -1 means not-in-list + acr::FPdep* zd_pdep_prev; // previous element + acr::FPline* p_parent; // reference to parent row + acr::FPline* p_child; // reference to parent row + i32 weight; // 0 + i32 lindex; // 0 Index of child referencing attr + acr::FPdep* pline_zd_child_next; // zslist link; -1 means not-in-list + acr::FPdep* pline_zd_child_prev; // previous element // func:acr.FPdep..AssignOp inline acr::FPdep& operator =(const acr::FPdep &rhs) = delete; // func:acr.FPdep..CopyCtor @@ -3239,7 +3280,7 @@ inline bool zd_child_EmptyQ(acr::FPline& pline) __attribute__((__warn_u inline acr::FPdep* zd_child_First(acr::FPline& pline) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:acr.FPline.zd_child.InLlistQ -inline bool zd_child_InLlistQ(acr::FPdep& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool pline_zd_child_InLlistQ(acr::FPdep& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:acr.FPline.zd_child.Insert void zd_child_Insert(acr::FPline& pline, acr::FPdep& row) __attribute__((nothrow)); @@ -3248,10 +3289,10 @@ void zd_child_Insert(acr::FPline& pline, acr::FPdep& row) __attr inline acr::FPdep* zd_child_Last(acr::FPline& pline) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:acr.FPline.zd_child.Next -inline acr::FPdep* zd_child_Next(acr::FPdep &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr::FPdep* pline_zd_child_Next(acr::FPdep &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:acr.FPline.zd_child.Prev -inline acr::FPdep* zd_child_Prev(acr::FPdep &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr::FPdep* pline_zd_child_Prev(acr::FPdep &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:acr.FPline.zd_child.Remove void zd_child_Remove(acr::FPline& pline, acr::FPdep& row) __attribute__((nothrow)); @@ -3333,6 +3374,9 @@ void ind_printattr_Remove(acr::FPrint& print, acr::FPrintAttr& r // Reserve enough room in the hash for N more elements. Return success code. // func:acr.FPrint.ind_printattr.Reserve void ind_printattr_Reserve(acr::FPrint& print, int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr.FPrint.ind_printattr.AbsReserve +void ind_printattr_AbsReserve(acr::FPrint& print, int n) __attribute__((nothrow)); // Return true if index is empty // func:acr.FPrint.c_pline.EmptyQ @@ -3393,10 +3437,11 @@ void FPrint_Uninit(acr::FPrint& print) __attribute__((nothrow)); // create: acr.FDb.printattr (Malloc) // access: acr.FPrint.ind_printattr (Thash) struct FPrintAttr { // acr.FPrintAttr - acr::FPrintAttr* ind_printattr_next; // hash next - acr::FPrint* p_print; // reference to parent row - algo::Smallstr100 field; // 0 - u32 width; // 0 Name width + acr::FPrintAttr* print_ind_printattr_next; // hash next + u32 print_ind_printattr_hashval; // hash value + acr::FPrint* p_print; // reference to parent row + algo::Smallstr100 field; // 0 + u32 width; // 0 Name width // func:acr.FPrintAttr..AssignOp inline acr::FPrintAttr& operator =(const acr::FPrintAttr &rhs) = delete; // func:acr.FPrintAttr..CopyCtor @@ -3525,6 +3570,11 @@ acr::AttrRegx& where_AllocAt(acr::FQuery& query, int at) __attribute__((__ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:acr.FQuery.where.AllocN algo::aryptr where_AllocN(acr::FQuery& query, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:acr.FQuery.where.AllocNAt +algo::aryptr where_AllocNAt(acr::FQuery& query, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:acr.FQuery.where.EmptyQ inline bool where_EmptyQ(acr::FQuery& query) __attribute__((nothrow)); @@ -3576,6 +3626,10 @@ inline u64 where_rowid_Get(acr::FQuery& query, acr::AttrRegx &elem) __ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:acr.FQuery.where.AllocNVal algo::aryptr where_AllocNVal(acr::FQuery& query, int n_elems, const acr::AttrRegx& val) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:acr.FQuery.where.Insary +void where_Insary(acr::FQuery& query, algo::aryptr rhs, int at) __attribute__((nothrow)); // Print back to string // func:acr.FQuery.ssimfile.Print @@ -3755,45 +3809,49 @@ void FQuery_Print(acr::FQuery& row, algo::cstring& str) __attrib // global access: c_ssimreq_rec (Ptrary) // access: acr.Err.rec (Ptr) // access: acr.FCheck.c_bad_rec (Ptrary) -// access: acr.FCtype.zd_ctype_rec (Llist) +// access: acr.FCtype.zd_rec (Llist) // access: acr.FCtype.ind_ctype_rec (Thash) -// access: acr.FCtype.zd_ctype_selrec (Llist) +// access: acr.FCtype.zd_selrec (Llist) // access: acr.FFile.zd_frec (Llist) // access: acr.FPline.p_rec (Upptr) // access: acr.FQuery.c_rec (Ptrary) // access: acr.FWrite.c_cmtrec (Ptrary) // access: acr.FErr.rec (Ptr) struct FRec { // acr.FRec - acr::FRec* zd_ctype_rec_next; // zslist link; -1 means not-in-list - acr::FRec* zd_ctype_rec_prev; // previous element - acr::FRec* ind_ctype_rec_next; // hash next - acr::FRec* zd_ctype_selrec_next; // zslist link; -1 means not-in-list - acr::FRec* zd_ctype_selrec_prev; // previous element - acr::FRec* rec_next; // Pointer to next free element int tpool - acr::FRec* zd_all_selrec_next; // zslist link; -1 means not-in-list - acr::FRec* zd_all_selrec_prev; // previous element - acr::FRec* zd_frec_next; // zslist link; -1 means not-in-list - acr::FRec* zd_frec_prev; // previous element - algo::cstring pkey; // Record key (arbitrary string) - algo::cstring* oldpkey; // Private pointer to value - algo::Tuple tuple; // Data item - bool del; // false Delete? - bool mod; // false Record was modified? - bool metasel; // false Select for meta-data - bool isnew; // false Inserted newly - i32 seldist; // 0 Distance to selection. >0 is up, <0 is down - acr::RecSortkey sortkey; // Output sort key - acr::FPline* c_pline; // Optional pline. optional pointer - acr::FFile* p_outfile; // reference to parent row - acr::FFile* p_infile; // reference to parent row - acr::FCtype* p_ctype; // reference to parent row - i32 lineno; // 0 - bool _db_c_ssimreq_rec_in_ary; // false membership flag + acr::FRec* ctype_zd_rec_next; // zslist link; -1 means not-in-list + acr::FRec* ctype_zd_rec_prev; // previous element + acr::FRec* ctype_ind_ctype_rec_next; // hash next + u32 ctype_ind_ctype_rec_hashval; // hash value + acr::FRec* ctype_zd_selrec_next; // zslist link; -1 means not-in-list + acr::FRec* ctype_zd_selrec_prev; // previous element + acr::FRec* rec_next; // Pointer to next free element int tpool + acr::FRec* zd_all_selrec_next; // zslist link; -1 means not-in-list + acr::FRec* zd_all_selrec_prev; // previous element + acr::FRec* file_zd_frec_next; // zslist link; -1 means not-in-list + acr::FRec* file_zd_frec_prev; // previous element + algo::cstring pkey; // Record key (arbitrary string) + algo::cstring* oldpkey; // Private pointer to value + algo::cstring* oldhead; // Private pointer to value + algo::Tuple tuple; // Data item + bool del; // false Delete? + bool mod; // false Record was modified? + bool metasel; // false Select for meta-data + bool isnew; // false Inserted newly + i32 seldist; // 0 Distance to selection. >0 is up, <0 is down + acr::RecSortkey sortkey; // Output sort key + acr::FPline* c_pline; // Optional pline. optional pointer + acr::FFile* p_outfile; // reference to parent row + acr::FFile* p_infile; // reference to parent row + acr::FCtype* p_ctype; // reference to parent row + i32 lineno; // 0 + bool c_ssimreq_rec_in_ary; // false membership flag // reftype Delptr of acr.FRec.oldpkey prohibits copy + // reftype Delptr of acr.FRec.oldhead prohibits copy // x-reference on acr.FRec.c_pline prevents copy // func:acr.FRec..AssignOp acr::FRec& operator =(const acr::FRec &rhs) = delete; // reftype Delptr of acr.FRec.oldpkey prohibits copy + // reftype Delptr of acr.FRec.oldhead prohibits copy // x-reference on acr.FRec.c_pline prevents copy // func:acr.FRec..CopyCtor FRec(const acr::FRec &rhs) = delete; @@ -3815,6 +3873,14 @@ algo::cstring& oldpkey_Access(acr::FRec& rec) __attribute__((nothrow)); // func:acr.FRec.oldpkey.Delete void oldpkey_Delete(acr::FRec& rec) __attribute__((nothrow)); +// Get or Create +// Access value, creating it if necessary. Process dies if not successful. +// func:acr.FRec.oldhead.Access +algo::cstring& oldhead_Access(acr::FRec& rec) __attribute__((nothrow)); +// Delete value. +// func:acr.FRec.oldhead.Delete +void oldhead_Delete(acr::FRec& rec) __attribute__((nothrow)); + // Insert row into pointer index. Return final membership status. // func:acr.FRec.c_pline.InsertMaybe inline bool c_pline_InsertMaybe(acr::FRec& rec, acr::FPline& row) __attribute__((nothrow)); @@ -3868,9 +3934,10 @@ inline void FSmallstr_Init(acr::FSmallstr& smallstr); // global access: sortkey (Lary, by rowid) // global access: ind_sortkey (Thash, hash field sortkey) struct FSortkey { // acr.FSortkey: Keep track of next rowid for each sortkey - acr::FSortkey* ind_sortkey_next; // hash next - acr::RecSortkey sortkey; // Sort key - double next_rowid; // 0 + acr::FSortkey* ind_sortkey_next; // hash next + u32 ind_sortkey_hashval; // hash value + acr::RecSortkey sortkey; // Sort key + double next_rowid; // 0 // func:acr.FSortkey..AssignOp inline acr::FSortkey& operator =(const acr::FSortkey &rhs) = delete; // func:acr.FSortkey..CopyCtor @@ -3899,12 +3966,13 @@ void FSortkey_Uninit(acr::FSortkey& sortkey) __attribute__((noth // access: acr.FCtype.c_ssimfile (Ptr) // access: acr.FSsimreq.p_child_ssimfile (Upptr) struct FSsimfile { // acr.FSsimfile: One full table - acr::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - acr::FFile* c_file; // optional!. optional pointer - acr::FCtype* p_ctype; // reference to parent row - acr::FSsimsort* c_ssimsort; // Optional sort order. optional pointer + acr::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + acr::FFile* c_file; // optional!. optional pointer + acr::FCtype* p_ctype; // reference to parent row + acr::FSsimsort* c_ssimsort; // Optional sort order. optional pointer // x-reference on acr.FSsimfile.p_ctype prevents copy // x-reference on acr.FSsimfile.c_ssimsort prevents copy // func:acr.FSsimfile..AssignOp @@ -4026,9 +4094,10 @@ void FSsimreq_Uninit(acr::FSsimreq& ssimreq) __attribute__((noth // global access: ind_ssimsort (Thash, hash field ssimfile) // access: acr.FSsimfile.c_ssimsort (Ptr) struct FSsimsort { // acr.FSsimsort - acr::FSsimsort* ind_ssimsort_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 sortfld; // + acr::FSsimsort* ind_ssimsort_next; // hash next + u32 ind_ssimsort_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 sortfld; // // func:acr.FSsimsort..AssignOp inline acr::FSsimsort& operator =(const acr::FSsimsort &rhs) = delete; // func:acr.FSsimsort..CopyCtor @@ -4093,8 +4162,9 @@ void FSubstr_Uninit(acr::FSubstr& substr) __attribute__((nothrow // global access: tempkey (Lary, by rowid) // global access: ind_tempkey (Thash, hash field tempkey) struct FTempkey { // acr.FTempkey - acr::FTempkey* ind_tempkey_next; // hash next - algo::cstring tempkey; // + acr::FTempkey* ind_tempkey_next; // hash next + u32 ind_tempkey_hashval; // hash value + algo::cstring tempkey; // // func:acr.FTempkey..AssignOp inline acr::FTempkey& operator =(const acr::FTempkey &rhs) = delete; // func:acr.FTempkey..CopyCtor @@ -4120,9 +4190,10 @@ void FTempkey_Uninit(acr::FTempkey& tempkey) __attribute__((noth // create: acr.FDb.uniqueattr (Tpool) // global access: ind_uniqueattr (Thash, hash field uniqueattr) struct FUniqueattr { // acr.FUniqueattr - acr::FUniqueattr* uniqueattr_next; // Pointer to next free element int tpool - acr::FUniqueattr* ind_uniqueattr_next; // hash next - algo::cstring uniqueattr; // Data + acr::FUniqueattr* uniqueattr_next; // Pointer to next free element int tpool + acr::FUniqueattr* ind_uniqueattr_next; // hash next + u32 ind_uniqueattr_hashval; // hash value + algo::cstring uniqueattr; // Data // func:acr.FUniqueattr..AssignOp inline acr::FUniqueattr& operator =(const acr::FUniqueattr &rhs) = delete; // func:acr.FUniqueattr..CopyCtor @@ -4406,10 +4477,10 @@ struct ctype_c_field_curs {// fcurs:acr.FCtype.c_field/curs }; -struct ctype_zd_ctype_rec_curs {// fcurs:acr.FCtype.zd_ctype_rec/curs +struct ctype_zd_rec_curs {// fcurs:acr.FCtype.zd_rec/curs typedef acr::FRec ChildType; acr::FRec* row; - ctype_zd_ctype_rec_curs() { + ctype_zd_rec_curs() { row = NULL; } }; @@ -4424,10 +4495,10 @@ struct ctype_ind_ctype_rec_curs {// cursor }; -struct ctype_zd_ctype_selrec_curs {// fcurs:acr.FCtype.zd_ctype_selrec/curs +struct ctype_zd_selrec_curs {// fcurs:acr.FCtype.zd_selrec/curs typedef acr::FRec ChildType; acr::FRec* row; - ctype_zd_ctype_selrec_curs() { + ctype_zd_selrec_curs() { row = NULL; } }; diff --git a/include/gen/acr_gen.inl.h b/include/gen/acr_gen.inl.h index 631b53eb..e56606e8 100644 --- a/include/gen/acr_gen.inl.h +++ b/include/gen/acr_gen.inl.h @@ -464,53 +464,53 @@ inline void acr::c_ssimfile_Remove(acr::FCtype& ctype, acr::FSsimfile& row) { } } -// --- acr.FCtype.zd_ctype_rec.EmptyQ +// --- acr.FCtype.zd_rec.EmptyQ // Return true if index is empty -inline bool acr::zd_ctype_rec_EmptyQ(acr::FCtype& ctype) { - return ctype.zd_ctype_rec_head == NULL; +inline bool acr::zd_rec_EmptyQ(acr::FCtype& ctype) { + return ctype.zd_rec_head == NULL; } -// --- acr.FCtype.zd_ctype_rec.First +// --- acr.FCtype.zd_rec.First // If index empty, return NULL. Otherwise return pointer to first element in index -inline acr::FRec* acr::zd_ctype_rec_First(acr::FCtype& ctype) { +inline acr::FRec* acr::zd_rec_First(acr::FCtype& ctype) { acr::FRec *row = NULL; - row = ctype.zd_ctype_rec_head; + row = ctype.zd_rec_head; return row; } -// --- acr.FCtype.zd_ctype_rec.InLlistQ +// --- acr.FCtype.zd_rec.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool acr::zd_ctype_rec_InLlistQ(acr::FRec& row) { +inline bool acr::ctype_zd_rec_InLlistQ(acr::FRec& row) { bool result = false; - result = !(row.zd_ctype_rec_next == (acr::FRec*)-1); + result = !(row.ctype_zd_rec_next == (acr::FRec*)-1); return result; } -// --- acr.FCtype.zd_ctype_rec.Last +// --- acr.FCtype.zd_rec.Last // If index empty, return NULL. Otherwise return pointer to last element in index -inline acr::FRec* acr::zd_ctype_rec_Last(acr::FCtype& ctype) { +inline acr::FRec* acr::zd_rec_Last(acr::FCtype& ctype) { acr::FRec *row = NULL; - row = ctype.zd_ctype_rec_tail; + row = ctype.zd_rec_tail; return row; } -// --- acr.FCtype.zd_ctype_rec.Next +// --- acr.FCtype.zd_rec.Next // Return pointer to next element in the list -inline acr::FRec* acr::zd_ctype_rec_Next(acr::FRec &row) { - return row.zd_ctype_rec_next; +inline acr::FRec* acr::ctype_zd_rec_Next(acr::FRec &row) { + return row.ctype_zd_rec_next; } -// --- acr.FCtype.zd_ctype_rec.Prev +// --- acr.FCtype.zd_rec.Prev // Return pointer to previous element in the list -inline acr::FRec* acr::zd_ctype_rec_Prev(acr::FRec &row) { - return row.zd_ctype_rec_prev; +inline acr::FRec* acr::ctype_zd_rec_Prev(acr::FRec &row) { + return row.ctype_zd_rec_prev; } -// --- acr.FCtype.zd_ctype_rec.qLast +// --- acr.FCtype.zd_rec.qLast // Return reference to last element in the index. No bounds checking. -inline acr::FRec& acr::zd_ctype_rec_qLast(acr::FCtype& ctype) { +inline acr::FRec& acr::zd_rec_qLast(acr::FCtype& ctype) { acr::FRec *row = NULL; - row = ctype.zd_ctype_rec_tail; + row = ctype.zd_rec_tail; return *row; } @@ -526,53 +526,53 @@ inline i32 acr::ind_ctype_rec_N(const acr::FCtype& ctype) { return ctype.ind_ctype_rec_n; } -// --- acr.FCtype.zd_ctype_selrec.EmptyQ +// --- acr.FCtype.zd_selrec.EmptyQ // Return true if index is empty -inline bool acr::zd_ctype_selrec_EmptyQ(acr::FCtype& ctype) { - return ctype.zd_ctype_selrec_head == NULL; +inline bool acr::zd_selrec_EmptyQ(acr::FCtype& ctype) { + return ctype.zd_selrec_head == NULL; } -// --- acr.FCtype.zd_ctype_selrec.First +// --- acr.FCtype.zd_selrec.First // If index empty, return NULL. Otherwise return pointer to first element in index -inline acr::FRec* acr::zd_ctype_selrec_First(acr::FCtype& ctype) { +inline acr::FRec* acr::zd_selrec_First(acr::FCtype& ctype) { acr::FRec *row = NULL; - row = ctype.zd_ctype_selrec_head; + row = ctype.zd_selrec_head; return row; } -// --- acr.FCtype.zd_ctype_selrec.InLlistQ +// --- acr.FCtype.zd_selrec.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool acr::zd_ctype_selrec_InLlistQ(acr::FRec& row) { +inline bool acr::ctype_zd_selrec_InLlistQ(acr::FRec& row) { bool result = false; - result = !(row.zd_ctype_selrec_next == (acr::FRec*)-1); + result = !(row.ctype_zd_selrec_next == (acr::FRec*)-1); return result; } -// --- acr.FCtype.zd_ctype_selrec.Last +// --- acr.FCtype.zd_selrec.Last // If index empty, return NULL. Otherwise return pointer to last element in index -inline acr::FRec* acr::zd_ctype_selrec_Last(acr::FCtype& ctype) { +inline acr::FRec* acr::zd_selrec_Last(acr::FCtype& ctype) { acr::FRec *row = NULL; - row = ctype.zd_ctype_selrec_tail; + row = ctype.zd_selrec_tail; return row; } -// --- acr.FCtype.zd_ctype_selrec.Next +// --- acr.FCtype.zd_selrec.Next // Return pointer to next element in the list -inline acr::FRec* acr::zd_ctype_selrec_Next(acr::FRec &row) { - return row.zd_ctype_selrec_next; +inline acr::FRec* acr::ctype_zd_selrec_Next(acr::FRec &row) { + return row.ctype_zd_selrec_next; } -// --- acr.FCtype.zd_ctype_selrec.Prev +// --- acr.FCtype.zd_selrec.Prev // Return pointer to previous element in the list -inline acr::FRec* acr::zd_ctype_selrec_Prev(acr::FRec &row) { - return row.zd_ctype_selrec_prev; +inline acr::FRec* acr::ctype_zd_selrec_Prev(acr::FRec &row) { + return row.ctype_zd_selrec_prev; } -// --- acr.FCtype.zd_ctype_selrec.qLast +// --- acr.FCtype.zd_selrec.qLast // Return reference to last element in the index. No bounds checking. -inline acr::FRec& acr::zd_ctype_selrec_qLast(acr::FCtype& ctype) { +inline acr::FRec& acr::zd_selrec_qLast(acr::FCtype& ctype) { acr::FRec *row = NULL; - row = ctype.zd_ctype_selrec_tail; + row = ctype.zd_selrec_tail; return *row; } @@ -660,9 +660,9 @@ inline acr::FField* acr::zd_arg_First(acr::FCtype& ctype) { // --- acr.FCtype.zd_arg.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool acr::zd_arg_InLlistQ(acr::FField& row) { +inline bool acr::ctype_zd_arg_InLlistQ(acr::FField& row) { bool result = false; - result = !(row.zd_arg_next == (acr::FField*)-1); + result = !(row.ctype_zd_arg_next == (acr::FField*)-1); return result; } @@ -682,14 +682,14 @@ inline i32 acr::zd_arg_N(const acr::FCtype& ctype) { // --- acr.FCtype.zd_arg.Next // Return pointer to next element in the list -inline acr::FField* acr::zd_arg_Next(acr::FField &row) { - return row.zd_arg_next; +inline acr::FField* acr::ctype_zd_arg_Next(acr::FField &row) { + return row.ctype_zd_arg_next; } // --- acr.FCtype.zd_arg.Prev // Return pointer to previous element in the list -inline acr::FField* acr::zd_arg_Prev(acr::FField &row) { - return row.zd_arg_prev; +inline acr::FField* acr::ctype_zd_arg_Prev(acr::FField &row) { + return row.ctype_zd_arg_prev; } // --- acr.FCtype.zd_arg.qLast @@ -797,28 +797,28 @@ inline acr::FField& acr::ctype_c_field_curs_Access(ctype_c_field_curs &curs) { return *curs.elems[curs.index]; } -// --- acr.FCtype.zd_ctype_rec_curs.Reset +// --- acr.FCtype.zd_rec_curs.Reset // cursor points to valid item -inline void acr::ctype_zd_ctype_rec_curs_Reset(ctype_zd_ctype_rec_curs &curs, acr::FCtype &parent) { - curs.row = parent.zd_ctype_rec_head; +inline void acr::ctype_zd_rec_curs_Reset(ctype_zd_rec_curs &curs, acr::FCtype &parent) { + curs.row = parent.zd_rec_head; } -// --- acr.FCtype.zd_ctype_rec_curs.ValidQ +// --- acr.FCtype.zd_rec_curs.ValidQ // cursor points to valid item -inline bool acr::ctype_zd_ctype_rec_curs_ValidQ(ctype_zd_ctype_rec_curs &curs) { +inline bool acr::ctype_zd_rec_curs_ValidQ(ctype_zd_rec_curs &curs) { return curs.row != NULL; } -// --- acr.FCtype.zd_ctype_rec_curs.Next +// --- acr.FCtype.zd_rec_curs.Next // proceed to next item -inline void acr::ctype_zd_ctype_rec_curs_Next(ctype_zd_ctype_rec_curs &curs) { - acr::FRec *next = (*curs.row).zd_ctype_rec_next; +inline void acr::ctype_zd_rec_curs_Next(ctype_zd_rec_curs &curs) { + acr::FRec *next = (*curs.row).ctype_zd_rec_next; curs.row = next; } -// --- acr.FCtype.zd_ctype_rec_curs.Access +// --- acr.FCtype.zd_rec_curs.Access // item access -inline acr::FRec& acr::ctype_zd_ctype_rec_curs_Access(ctype_zd_ctype_rec_curs &curs) { +inline acr::FRec& acr::ctype_zd_rec_curs_Access(ctype_zd_rec_curs &curs) { return *curs.row; } @@ -831,7 +831,7 @@ inline bool acr::ctype_ind_ctype_rec_curs_ValidQ(ctype_ind_ctype_rec_curs &curs) // --- acr.FCtype.ind_ctype_rec_curs.Next // proceed to next item inline void acr::ctype_ind_ctype_rec_curs_Next(ctype_ind_ctype_rec_curs &curs) { - curs.prow = &(*curs.prow)->ind_ctype_rec_next; + curs.prow = &(*curs.prow)->ctype_ind_ctype_rec_next; while (!*curs.prow) { curs.bucket += 1; if (curs.bucket >= curs.parent->ind_ctype_rec_buckets_n) break; @@ -845,28 +845,28 @@ inline acr::FRec& acr::ctype_ind_ctype_rec_curs_Access(ctype_ind_ctype_rec_curs return **curs.prow; } -// --- acr.FCtype.zd_ctype_selrec_curs.Reset +// --- acr.FCtype.zd_selrec_curs.Reset // cursor points to valid item -inline void acr::ctype_zd_ctype_selrec_curs_Reset(ctype_zd_ctype_selrec_curs &curs, acr::FCtype &parent) { - curs.row = parent.zd_ctype_selrec_head; +inline void acr::ctype_zd_selrec_curs_Reset(ctype_zd_selrec_curs &curs, acr::FCtype &parent) { + curs.row = parent.zd_selrec_head; } -// --- acr.FCtype.zd_ctype_selrec_curs.ValidQ +// --- acr.FCtype.zd_selrec_curs.ValidQ // cursor points to valid item -inline bool acr::ctype_zd_ctype_selrec_curs_ValidQ(ctype_zd_ctype_selrec_curs &curs) { +inline bool acr::ctype_zd_selrec_curs_ValidQ(ctype_zd_selrec_curs &curs) { return curs.row != NULL; } -// --- acr.FCtype.zd_ctype_selrec_curs.Next +// --- acr.FCtype.zd_selrec_curs.Next // proceed to next item -inline void acr::ctype_zd_ctype_selrec_curs_Next(ctype_zd_ctype_selrec_curs &curs) { - acr::FRec *next = (*curs.row).zd_ctype_selrec_next; +inline void acr::ctype_zd_selrec_curs_Next(ctype_zd_selrec_curs &curs) { + acr::FRec *next = (*curs.row).ctype_zd_selrec_next; curs.row = next; } -// --- acr.FCtype.zd_ctype_selrec_curs.Access +// --- acr.FCtype.zd_selrec_curs.Access // item access -inline acr::FRec& acr::ctype_zd_ctype_selrec_curs_Access(ctype_zd_ctype_selrec_curs &curs) { +inline acr::FRec& acr::ctype_zd_selrec_curs_Access(ctype_zd_selrec_curs &curs) { return *curs.row; } @@ -910,7 +910,7 @@ inline bool acr::ctype_zd_arg_curs_ValidQ(ctype_zd_arg_curs &curs) { // --- acr.FCtype.zd_arg_curs.Next // proceed to next item inline void acr::ctype_zd_arg_curs_Next(ctype_zd_arg_curs &curs) { - acr::FField *next = (*curs.row).zd_arg_next; + acr::FField *next = (*curs.row).ctype_zd_arg_next; curs.row = next; } @@ -2032,7 +2032,7 @@ inline i32 acr::c_ssimreq_rec_N() { inline void acr::c_ssimreq_rec_RemoveAll() { for (u32 i = 0; i < _db.c_ssimreq_rec_n; i++) { // mark all elements as not-in-array - _db.c_ssimreq_rec_elems[i]->_db_c_ssimreq_rec_in_ary = false; + _db.c_ssimreq_rec_elems[i]->c_ssimreq_rec_in_ary = false; } _db.c_ssimreq_rec_n = 0; } @@ -2046,7 +2046,7 @@ inline acr::FRec& acr::c_ssimreq_rec_qFind(u32 idx) { // --- acr.FDb.c_ssimreq_rec.InAryQ // True if row is in any ptrary instance inline bool acr::c_ssimreq_rec_InAryQ(acr::FRec& row) { - return row._db_c_ssimreq_rec_in_ary; + return row.c_ssimreq_rec_in_ary; } // --- acr.FDb.c_ssimreq_rec.qLast @@ -2090,7 +2090,7 @@ inline i32 acr::c_ctype_front_N() { inline void acr::c_ctype_front_RemoveAll() { for (u32 i = 0; i < _db.c_ctype_front_n; i++) { // mark all elements as not-in-array - _db.c_ctype_front_elems[i]->_db_c_ctype_front_in_ary = false; + _db.c_ctype_front_elems[i]->c_ctype_front_in_ary = false; } _db.c_ctype_front_n = 0; } @@ -2104,7 +2104,7 @@ inline acr::FCtype& acr::c_ctype_front_qFind(u32 idx) { // --- acr.FDb.c_ctype_front.InAryQ // True if row is in any ptrary instance inline bool acr::c_ctype_front_InAryQ(acr::FCtype& row) { - return row._db_c_ctype_front_in_ary; + return row.c_ctype_front_in_ary; } // --- acr.FDb.c_ctype_front.qLast @@ -2890,9 +2890,9 @@ inline acr::FRec* acr::zd_frec_First(acr::FFile& file) { // --- acr.FFile.zd_frec.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool acr::zd_frec_InLlistQ(acr::FRec& row) { +inline bool acr::file_zd_frec_InLlistQ(acr::FRec& row) { bool result = false; - result = !(row.zd_frec_next == (acr::FRec*)-1); + result = !(row.file_zd_frec_next == (acr::FRec*)-1); return result; } @@ -2906,14 +2906,14 @@ inline acr::FRec* acr::zd_frec_Last(acr::FFile& file) { // --- acr.FFile.zd_frec.Next // Return pointer to next element in the list -inline acr::FRec* acr::zd_frec_Next(acr::FRec &row) { - return row.zd_frec_next; +inline acr::FRec* acr::file_zd_frec_Next(acr::FRec &row) { + return row.file_zd_frec_next; } // --- acr.FFile.zd_frec.Prev // Return pointer to previous element in the list -inline acr::FRec* acr::zd_frec_Prev(acr::FRec &row) { - return row.zd_frec_prev; +inline acr::FRec* acr::file_zd_frec_Prev(acr::FRec &row) { + return row.file_zd_frec_prev; } // --- acr.FFile.zd_frec.qLast @@ -2934,6 +2934,7 @@ inline void acr::FFile_Init(acr::FFile& file) { file.zd_frec_tail = NULL; // (acr.FFile.zd_frec) file.autoloaded = bool(false); file.ind_file_next = (acr::FFile*)-1; // (acr.FDb.ind_file) not-in-hash + file.ind_file_hashval = 0; // stored hash value } // --- acr.FFile.zd_frec_curs.Reset @@ -2951,7 +2952,7 @@ inline bool acr::file_zd_frec_curs_ValidQ(file_zd_frec_curs &curs) { // --- acr.FFile.zd_frec_curs.Next // proceed to next item inline void acr::file_zd_frec_curs_Next(file_zd_frec_curs &curs) { - acr::FRec *next = (*curs.row).zd_frec_next; + acr::FRec *next = (*curs.row).file_zd_frec_next; curs.row = next; } @@ -2985,8 +2986,8 @@ inline void acr::FPdep_Init(acr::FPdep& pdep) { pdep.pdep_next = (acr::FPdep*)-1; // (acr.FDb.pdep) not-in-tpool's freelist pdep.zd_pdep_next = (acr::FPdep*)-1; // (acr.FDb.zd_pdep) not-in-list pdep.zd_pdep_prev = NULL; // (acr.FDb.zd_pdep) - pdep.zd_child_next = (acr::FPdep*)-1; // (acr.FPline.zd_child) not-in-list - pdep.zd_child_prev = NULL; // (acr.FPline.zd_child) + pdep.pline_zd_child_next = (acr::FPdep*)-1; // (acr.FPline.zd_child) not-in-list + pdep.pline_zd_child_prev = NULL; // (acr.FPline.zd_child) } // --- acr.FPdep..Ctor @@ -3162,9 +3163,9 @@ inline acr::FPdep* acr::zd_child_First(acr::FPline& pline) { // --- acr.FPline.zd_child.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool acr::zd_child_InLlistQ(acr::FPdep& row) { +inline bool acr::pline_zd_child_InLlistQ(acr::FPdep& row) { bool result = false; - result = !(row.zd_child_next == (acr::FPdep*)-1); + result = !(row.pline_zd_child_next == (acr::FPdep*)-1); return result; } @@ -3178,14 +3179,14 @@ inline acr::FPdep* acr::zd_child_Last(acr::FPline& pline) { // --- acr.FPline.zd_child.Next // Return pointer to next element in the list -inline acr::FPdep* acr::zd_child_Next(acr::FPdep &row) { - return row.zd_child_next; +inline acr::FPdep* acr::pline_zd_child_Next(acr::FPdep &row) { + return row.pline_zd_child_next; } // --- acr.FPline.zd_child.Prev // Return pointer to previous element in the list -inline acr::FPdep* acr::zd_child_Prev(acr::FPdep &row) { - return row.zd_child_prev; +inline acr::FPdep* acr::pline_zd_child_Prev(acr::FPdep &row) { + return row.pline_zd_child_prev; } // --- acr.FPline.zd_child.qLast @@ -3223,7 +3224,7 @@ inline bool acr::pline_zd_child_curs_ValidQ(pline_zd_child_curs &curs) { // --- acr.FPline.zd_child_curs.Next // proceed to next item inline void acr::pline_zd_child_curs_Next(pline_zd_child_curs &curs) { - acr::FPdep *next = (*curs.row).zd_child_next; + acr::FPdep *next = (*curs.row).pline_zd_child_next; curs.row = next; } @@ -3344,7 +3345,8 @@ inline void acr::FPrintAttr_Init(acr::FPrintAttr& printattr) { printattr.p_print = NULL; printattr.field = algo::strptr(0); printattr.width = u32(0); - printattr.ind_printattr_next = (acr::FPrintAttr*)-1; // (acr.FPrint.ind_printattr) not-in-hash + printattr.print_ind_printattr_next = (acr::FPrintAttr*)-1; // (acr.FPrint.ind_printattr) not-in-hash + printattr.print_ind_printattr_hashval = 0; // stored hash value } // --- acr.FPrintAttr..Ctor @@ -3765,6 +3767,7 @@ inline acr::FSmallstr::FSmallstr() { inline void acr::FSortkey_Init(acr::FSortkey& sortkey) { sortkey.next_rowid = double(0); sortkey.ind_sortkey_next = (acr::FSortkey*)-1; // (acr.FDb.ind_sortkey) not-in-hash + sortkey.ind_sortkey_hashval = 0; // stored hash value } // --- acr.FSortkey..Ctor @@ -3804,6 +3807,7 @@ inline void acr::FSsimfile_Init(acr::FSsimfile& ssimfile) { ssimfile.p_ctype = NULL; ssimfile.c_ssimsort = NULL; ssimfile.ind_ssimfile_next = (acr::FSsimfile*)-1; // (acr.FDb.ind_ssimfile) not-in-hash + ssimfile.ind_ssimfile_hashval = 0; // stored hash value } // --- acr.FSsimfile..Ctor @@ -3830,6 +3834,7 @@ inline acr::FSsimreq::~FSsimreq() { // Set all fields to initial values. inline void acr::FSsimsort_Init(acr::FSsimsort& ssimsort) { ssimsort.ind_ssimsort_next = (acr::FSsimsort*)-1; // (acr.FDb.ind_ssimsort) not-in-hash + ssimsort.ind_ssimsort_hashval = 0; // stored hash value } // --- acr.FSsimsort..Ctor @@ -3855,6 +3860,7 @@ inline acr::FSubstr::~FSubstr() { // Set all fields to initial values. inline void acr::FTempkey_Init(acr::FTempkey& tempkey) { tempkey.ind_tempkey_next = (acr::FTempkey*)-1; // (acr.FDb.ind_tempkey) not-in-hash + tempkey.ind_tempkey_hashval = 0; // stored hash value } // --- acr.FTempkey..Ctor @@ -3872,6 +3878,7 @@ inline acr::FTempkey::~FTempkey() { inline void acr::FUniqueattr_Init(acr::FUniqueattr& uniqueattr) { uniqueattr.uniqueattr_next = (acr::FUniqueattr*)-1; // (acr.FDb.uniqueattr) not-in-tpool's freelist uniqueattr.ind_uniqueattr_next = (acr::FUniqueattr*)-1; // (acr.FDb.ind_uniqueattr) not-in-hash + uniqueattr.ind_uniqueattr_hashval = 0; // stored hash value } // --- acr.FUniqueattr..Ctor diff --git a/include/gen/acr_in_gen.h b/include/gen/acr_in_gen.h index 748da245..63973617 100644 --- a/include/gen/acr_in_gen.h +++ b/include/gen/acr_in_gen.h @@ -134,25 +134,26 @@ namespace acr_in { // gen:ns_print_struct // access: acr_in.FSsimfile.p_ctype (Upptr) // access: acr_in.FTuple.p_ctype (Upptr) struct FCtype { // acr_in.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - acr_in::FSsimfile* c_ssimfile; // optional pointer - bool related; // false Matches 'related' regex - bool select; // false - bool visit; // false - acr_in::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - acr_in::FCtype** c_ctype_elems; // array of pointers - u32 c_ctype_n; // array of pointers - u32 c_ctype_max; // capacity of allocated array - bool parent_of_finput; // false Ctype required by one of the namespaces - acr_in::FNs* p_ns; // reference to parent row - acr_in::FCtype* ind_ctype_next; // hash next - acr_in::FCtype* zd_todo_next; // zslist link; -1 means not-in-list - acr_in::FCtype* zd_todo_prev; // previous element - acr_in::FCtype* zd_related_next; // zslist link; -1 means not-in-list - acr_in::FCtype* zd_related_prev; // previous element + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + acr_in::FSsimfile* c_ssimfile; // optional pointer + bool related; // false Matches 'related' regex + bool select; // false + bool visit; // false + acr_in::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + acr_in::FCtype** c_ctype_elems; // array of pointers + u32 c_ctype_n; // array of pointers + u32 c_ctype_max; // capacity of allocated array + bool parent_of_finput; // false Ctype required by one of the namespaces + acr_in::FNs* p_ns; // reference to parent row + acr_in::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value + acr_in::FCtype* zd_todo_next; // zslist link; -1 means not-in-list + acr_in::FCtype* zd_todo_prev; // previous element + acr_in::FCtype* zd_related_next; // zslist link; -1 means not-in-list + acr_in::FCtype* zd_related_prev; // previous element // x-reference on acr_in.FCtype.c_ssimfile prevents copy // reftype Ptrary of acr_in.FCtype.c_field prohibits copy // reftype Ptrary of acr_in.FCtype.c_ctype prohibits copy @@ -448,6 +449,9 @@ void ind_tuple_Remove(acr_in::FTuple& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:acr_in.FDb.ind_tuple.Reserve void ind_tuple_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_in.FDb.ind_tuple.AbsReserve +void ind_tuple_AbsReserve(int n) __attribute__((nothrow)); // Read argc,argv directly into the fields of the command line(s) // The following fields are updated: @@ -589,6 +593,9 @@ void ind_field_Remove(acr_in::FField& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:acr_in.FDb.ind_field.Reserve void ind_field_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_in.FDb.ind_field.AbsReserve +void ind_field_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -648,6 +655,9 @@ void ind_ctype_Remove(acr_in::FCtype& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:acr_in.FDb.ind_ctype.Reserve void ind_ctype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_in.FDb.ind_ctype.AbsReserve +void ind_ctype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -747,6 +757,9 @@ void ind_ns_Remove(acr_in::FNs& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:acr_in.FDb.ind_ns.Reserve void ind_ns_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_in.FDb.ind_ns.AbsReserve +void ind_ns_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:acr_in.FDb.zd_todo.EmptyQ @@ -917,6 +930,9 @@ void ind_dispsig_Remove(acr_in::FDispsig& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:acr_in.FDb.ind_dispsig.Reserve void ind_dispsig_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_in.FDb.ind_dispsig.AbsReserve +void ind_dispsig_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:acr_in.FDb.zd_select.EmptyQ @@ -1050,6 +1066,9 @@ void ind_finput_Remove(acr_in::FFinput& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:acr_in.FDb.ind_finput.Reserve void ind_finput_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_in.FDb.ind_finput.AbsReserve +void ind_finput_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1109,6 +1128,9 @@ void ind_target_Remove(acr_in::FTarget& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:acr_in.FDb.ind_target.Reserve void ind_target_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_in.FDb.ind_target.AbsReserve +void ind_target_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1241,6 +1263,9 @@ void ind_nsssimfile_Remove(acr_in::FNsssimfile& row) __attribute // Reserve enough room in the hash for N more elements. Return success code. // func:acr_in.FDb.ind_nsssimfile.Reserve void ind_nsssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_in.FDb.ind_nsssimfile.AbsReserve +void ind_nsssimfile_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:acr_in.FDb.ind_ssimfile.EmptyQ @@ -1263,6 +1288,9 @@ void ind_ssimfile_Remove(acr_in::FSsimfile& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:acr_in.FDb.ind_ssimfile.Reserve void ind_ssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:acr_in.FDb.ind_ssimfile.AbsReserve +void ind_ssimfile_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:acr_in.FDb.tuple_curs.Reset @@ -1479,10 +1507,11 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: dispsig (Lary, by rowid) // global access: ind_dispsig (Thash, hash field dispsig) struct FDispsig { // acr_in.FDispsig - acr_in::FDispsig* ind_dispsig_next; // hash next - algo::Smallstr50 dispsig; // - algo::Sha1sig signature; // - acr_in::FNs* p_ns; // reference to parent row + acr_in::FDispsig* ind_dispsig_next; // hash next + u32 ind_dispsig_hashval; // hash value + algo::Smallstr50 dispsig; // + algo::Sha1sig signature; // + acr_in::FNs* p_ns; // reference to parent row // x-reference on acr_in.FDispsig.p_ns prevents copy // func:acr_in.FDispsig..AssignOp inline acr_in::FDispsig& operator =(const acr_in::FDispsig &rhs) = delete; @@ -1526,6 +1555,7 @@ void FDispsig_Uninit(acr_in::FDispsig& dispsig) __attribute__((n // access: acr_in.FFinput.p_field (Upptr) struct FField { // acr_in.FField acr_in::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -1589,14 +1619,15 @@ void FField_Uninit(acr_in::FField& field) __attribute__((nothrow // global access: finput (Lary, by rowid) // global access: ind_finput (Thash, hash field field) struct FFinput { // acr_in.FFinput - acr_in::FFinput* ind_finput_next; // hash next - algo::Smallstr100 field; // Target field to read - bool extrn; // false Call user-provided function - bool update; // false - bool strict; // true Exist process if record contains error - algo::Comment comment; // - acr_in::FNs* p_ns; // reference to parent row - acr_in::FField* p_field; // reference to parent row + acr_in::FFinput* ind_finput_next; // hash next + u32 ind_finput_hashval; // hash value + algo::Smallstr100 field; // Target field to read + bool extrn; // false Call user-provided function + bool update; // false + bool strict; // true Exist process if record contains error + algo::Comment comment; // + acr_in::FNs* p_ns; // reference to parent row + acr_in::FField* p_field; // reference to parent row // x-reference on acr_in.FFinput.p_ns prevents copy // x-reference on acr_in.FFinput.p_field prevents copy // func:acr_in.FFinput..AssignOp @@ -1642,6 +1673,7 @@ void FFinput_Uninit(acr_in::FFinput& finput) __attribute__((noth // access: acr_in.FTarget.p_ns (Upptr) struct FNs { // acr_in.FNs acr_in::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value algo::Smallstr16 ns; // Namespace name (primary key) algo::Smallstr50 nstype; // Namespace type algo::Smallstr50 license; // Associated license @@ -1691,7 +1723,7 @@ inline bool zd_nsssimfile_ns_EmptyQ(acr_in::FNs& ns) __attribute__((__w inline acr_in::FNsssimfile* zd_nsssimfile_ns_First(acr_in::FNs& ns) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:acr_in.FNs.zd_nsssimfile_ns.InLlistQ -inline bool zd_nsssimfile_ns_InLlistQ(acr_in::FNsssimfile& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool ns_zd_nsssimfile_ns_InLlistQ(acr_in::FNsssimfile& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:acr_in.FNs.zd_nsssimfile_ns.Insert void zd_nsssimfile_ns_Insert(acr_in::FNs& ns, acr_in::FNsssimfile& row) __attribute__((nothrow)); @@ -1703,10 +1735,10 @@ inline acr_in::FNsssimfile* zd_nsssimfile_ns_Last(acr_in::FNs& ns) __attribute__ inline i32 zd_nsssimfile_ns_N(const acr_in::FNs& ns) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:acr_in.FNs.zd_nsssimfile_ns.Next -inline acr_in::FNsssimfile* zd_nsssimfile_ns_Next(acr_in::FNsssimfile &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr_in::FNsssimfile* ns_zd_nsssimfile_ns_Next(acr_in::FNsssimfile &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:acr_in.FNs.zd_nsssimfile_ns.Prev -inline acr_in::FNsssimfile* zd_nsssimfile_ns_Prev(acr_in::FNsssimfile &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr_in::FNsssimfile* ns_zd_nsssimfile_ns_Prev(acr_in::FNsssimfile &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:acr_in.FNs.zd_nsssimfile_ns.Remove void zd_nsssimfile_ns_Remove(acr_in::FNs& ns, acr_in::FNsssimfile& row) __attribute__((nothrow)); @@ -1745,15 +1777,16 @@ void FNs_Uninit(acr_in::FNs& ns) __attribute__((nothrow)); // access: acr_in.FNs.zd_nsssimfile_ns (Llist) // access: acr_in.FSsimfile.zd_nsssimfile_ssimfile (Llist) struct FNsssimfile { // acr_in.FNsssimfile - acr_in::FNsssimfile* ind_nsssimfile_next; // hash next - acr_in::FNsssimfile* zd_nsssimfile_ns_next; // zslist link; -1 means not-in-list - acr_in::FNsssimfile* zd_nsssimfile_ns_prev; // previous element - algo::Smallstr200 nsssimfile; // - bool show; // false - acr_in::FNs* p_ns; // reference to parent row - acr_in::FSsimfile* p_ssimfile; // reference to parent row - acr_in::FNsssimfile* zd_nsssimfile_ssimfile_next; // zslist link; -1 means not-in-list - acr_in::FNsssimfile* zd_nsssimfile_ssimfile_prev; // previous element + acr_in::FNsssimfile* ind_nsssimfile_next; // hash next + u32 ind_nsssimfile_hashval; // hash value + acr_in::FNsssimfile* ns_zd_nsssimfile_ns_next; // zslist link; -1 means not-in-list + acr_in::FNsssimfile* ns_zd_nsssimfile_ns_prev; // previous element + algo::Smallstr200 nsssimfile; // + bool show; // false + acr_in::FNs* p_ns; // reference to parent row + acr_in::FSsimfile* p_ssimfile; // reference to parent row + acr_in::FNsssimfile* ssimfile_zd_nsssimfile_ssimfile_next; // zslist link; -1 means not-in-list + acr_in::FNsssimfile* ssimfile_zd_nsssimfile_ssimfile_prev; // previous element // x-reference on acr_in.FNsssimfile.p_ns prevents copy // x-reference on acr_in.FNsssimfile.p_ssimfile prevents copy // func:acr_in.FNsssimfile..AssignOp @@ -1798,6 +1831,7 @@ struct FSsimfile { // acr_in.FSsimfile acr_in::FSsimfile* zd_ssimfile_next; // zslist link; -1 means not-in-list acr_in::FSsimfile* zd_ssimfile_prev; // previous element acr_in::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value algo::Smallstr50 ssimfile; // algo::Smallstr100 ctype; // acr_in::FCtype* p_ctype; // reference to parent row @@ -1847,7 +1881,7 @@ inline bool zd_nsssimfile_ssimfile_EmptyQ(acr_in::FSsimfile& ssimfile) inline acr_in::FNsssimfile* zd_nsssimfile_ssimfile_First(acr_in::FSsimfile& ssimfile) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:acr_in.FSsimfile.zd_nsssimfile_ssimfile.InLlistQ -inline bool zd_nsssimfile_ssimfile_InLlistQ(acr_in::FNsssimfile& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool ssimfile_zd_nsssimfile_ssimfile_InLlistQ(acr_in::FNsssimfile& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:acr_in.FSsimfile.zd_nsssimfile_ssimfile.Insert void zd_nsssimfile_ssimfile_Insert(acr_in::FSsimfile& ssimfile, acr_in::FNsssimfile& row) __attribute__((nothrow)); @@ -1859,10 +1893,10 @@ inline acr_in::FNsssimfile* zd_nsssimfile_ssimfile_Last(acr_in::FSsimfile& ssimf inline i32 zd_nsssimfile_ssimfile_N(const acr_in::FSsimfile& ssimfile) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:acr_in.FSsimfile.zd_nsssimfile_ssimfile.Next -inline acr_in::FNsssimfile* zd_nsssimfile_ssimfile_Next(acr_in::FNsssimfile &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr_in::FNsssimfile* ssimfile_zd_nsssimfile_ssimfile_Next(acr_in::FNsssimfile &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:acr_in.FSsimfile.zd_nsssimfile_ssimfile.Prev -inline acr_in::FNsssimfile* zd_nsssimfile_ssimfile_Prev(acr_in::FNsssimfile &row) __attribute__((__warn_unused_result__, nothrow)); +inline acr_in::FNsssimfile* ssimfile_zd_nsssimfile_ssimfile_Prev(acr_in::FNsssimfile &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:acr_in.FSsimfile.zd_nsssimfile_ssimfile.Remove void zd_nsssimfile_ssimfile_Remove(acr_in::FSsimfile& ssimfile, acr_in::FNsssimfile& row) __attribute__((nothrow)); @@ -1981,6 +2015,7 @@ void FTargdep_Uninit(acr_in::FTargdep& targdep) __attribute__((n // access: acr_in.FTargdep.p_parent (Upptr) struct FTarget { // acr_in.FTarget acr_in::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value acr_in::FTarget* zd_targ_visit_next; // zslist link; -1 means not-in-list acr_in::FTarget* zd_targ_visit_prev; // previous element algo::Smallstr16 target; // Primary key - name of target @@ -2135,21 +2170,22 @@ void FTarget_Uninit(acr_in::FTarget& target) __attribute__((noth // access: acr_in.FTuple.c_child (Ptrary) // access: acr_in.FTuple.c_parent (Ptrary) struct FTuple { // acr_in.FTuple - acr_in::FTuple* ind_tuple_next; // hash next - acr_in::FTuple* zd_select_next; // zslist link; -1 means not-in-list - acr_in::FTuple* zd_select_prev; // previous element - acr_in::FTuple* zd_deselect_next; // zslist link; -1 means not-in-list - acr_in::FTuple* zd_deselect_prev; // previous element - algo::cstring key; // - algo::cstring str; // - acr_in::FTuple** c_child_elems; // array of pointers - u32 c_child_n; // array of pointers - u32 c_child_max; // capacity of allocated array - acr_in::FCtype* p_ctype; // reference to parent row - acr_in::FTuple** c_parent_elems; // array of pointers - u32 c_parent_n; // array of pointers - u32 c_parent_max; // capacity of allocated array - bool deselect_visited; // false + acr_in::FTuple* ind_tuple_next; // hash next + u32 ind_tuple_hashval; // hash value + acr_in::FTuple* zd_select_next; // zslist link; -1 means not-in-list + acr_in::FTuple* zd_select_prev; // previous element + acr_in::FTuple* zd_deselect_next; // zslist link; -1 means not-in-list + acr_in::FTuple* zd_deselect_prev; // previous element + algo::cstring key; // + algo::cstring str; // + acr_in::FTuple** c_child_elems; // array of pointers + u32 c_child_n; // array of pointers + u32 c_child_max; // capacity of allocated array + acr_in::FCtype* p_ctype; // reference to parent row + acr_in::FTuple** c_parent_elems; // array of pointers + u32 c_parent_n; // array of pointers + u32 c_parent_max; // capacity of allocated array + bool deselect_visited; // false // reftype Ptrary of acr_in.FTuple.c_child prohibits copy // reftype Ptrary of acr_in.FTuple.c_parent prohibits copy // func:acr_in.FTuple..AssignOp diff --git a/include/gen/acr_in_gen.inl.h b/include/gen/acr_in_gen.inl.h index 030c3ee6..6e190840 100644 --- a/include/gen/acr_in_gen.inl.h +++ b/include/gen/acr_in_gen.inl.h @@ -1555,6 +1555,7 @@ inline acr_in::FNsssimfile& acr_in::_db_nsssimfile_curs_Access(_db_nsssimfile_cu inline void acr_in::FDispsig_Init(acr_in::FDispsig& dispsig) { dispsig.p_ns = NULL; dispsig.ind_dispsig_next = (acr_in::FDispsig*)-1; // (acr_in.FDb.ind_dispsig) not-in-hash + dispsig.ind_dispsig_hashval = 0; // stored hash value } // --- acr_in.FDispsig..Ctor @@ -1606,6 +1607,7 @@ inline void acr_in::FFinput_Init(acr_in::FFinput& finput) { finput.p_ns = NULL; finput.p_field = NULL; finput.ind_finput_next = (acr_in::FFinput*)-1; // (acr_in.FDb.ind_finput) not-in-hash + finput.ind_finput_hashval = 0; // stored hash value } // --- acr_in.FFinput..Ctor @@ -1654,9 +1656,9 @@ inline acr_in::FNsssimfile* acr_in::zd_nsssimfile_ns_First(acr_in::FNs& ns) { // --- acr_in.FNs.zd_nsssimfile_ns.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool acr_in::zd_nsssimfile_ns_InLlistQ(acr_in::FNsssimfile& row) { +inline bool acr_in::ns_zd_nsssimfile_ns_InLlistQ(acr_in::FNsssimfile& row) { bool result = false; - result = !(row.zd_nsssimfile_ns_next == (acr_in::FNsssimfile*)-1); + result = !(row.ns_zd_nsssimfile_ns_next == (acr_in::FNsssimfile*)-1); return result; } @@ -1676,14 +1678,14 @@ inline i32 acr_in::zd_nsssimfile_ns_N(const acr_in::FNs& ns) { // --- acr_in.FNs.zd_nsssimfile_ns.Next // Return pointer to next element in the list -inline acr_in::FNsssimfile* acr_in::zd_nsssimfile_ns_Next(acr_in::FNsssimfile &row) { - return row.zd_nsssimfile_ns_next; +inline acr_in::FNsssimfile* acr_in::ns_zd_nsssimfile_ns_Next(acr_in::FNsssimfile &row) { + return row.ns_zd_nsssimfile_ns_next; } // --- acr_in.FNs.zd_nsssimfile_ns.Prev // Return pointer to previous element in the list -inline acr_in::FNsssimfile* acr_in::zd_nsssimfile_ns_Prev(acr_in::FNsssimfile &row) { - return row.zd_nsssimfile_ns_prev; +inline acr_in::FNsssimfile* acr_in::ns_zd_nsssimfile_ns_Prev(acr_in::FNsssimfile &row) { + return row.ns_zd_nsssimfile_ns_prev; } // --- acr_in.FNs.zd_nsssimfile_ns.qLast @@ -1703,6 +1705,7 @@ inline void acr_in::FNs_Init(acr_in::FNs& ns) { ns.zd_nsssimfile_ns_n = 0; // (acr_in.FNs.zd_nsssimfile_ns) ns.zd_nsssimfile_ns_tail = NULL; // (acr_in.FNs.zd_nsssimfile_ns) ns.ind_ns_next = (acr_in::FNs*)-1; // (acr_in.FDb.ind_ns) not-in-hash + ns.ind_ns_hashval = 0; // stored hash value } // --- acr_in.FNs.zd_nsssimfile_ns_curs.Reset @@ -1720,7 +1723,7 @@ inline bool acr_in::ns_zd_nsssimfile_ns_curs_ValidQ(ns_zd_nsssimfile_ns_curs &cu // --- acr_in.FNs.zd_nsssimfile_ns_curs.Next // proceed to next item inline void acr_in::ns_zd_nsssimfile_ns_curs_Next(ns_zd_nsssimfile_ns_curs &curs) { - acr_in::FNsssimfile *next = (*curs.row).zd_nsssimfile_ns_next; + acr_in::FNsssimfile *next = (*curs.row).ns_zd_nsssimfile_ns_next; curs.row = next; } @@ -1747,10 +1750,11 @@ inline void acr_in::FNsssimfile_Init(acr_in::FNsssimfile& nsssimfile) { nsssimfile.p_ns = NULL; nsssimfile.p_ssimfile = NULL; nsssimfile.ind_nsssimfile_next = (acr_in::FNsssimfile*)-1; // (acr_in.FDb.ind_nsssimfile) not-in-hash - nsssimfile.zd_nsssimfile_ns_next = (acr_in::FNsssimfile*)-1; // (acr_in.FNs.zd_nsssimfile_ns) not-in-list - nsssimfile.zd_nsssimfile_ns_prev = NULL; // (acr_in.FNs.zd_nsssimfile_ns) - nsssimfile.zd_nsssimfile_ssimfile_next = (acr_in::FNsssimfile*)-1; // (acr_in.FSsimfile.zd_nsssimfile_ssimfile) not-in-list - nsssimfile.zd_nsssimfile_ssimfile_prev = NULL; // (acr_in.FSsimfile.zd_nsssimfile_ssimfile) + nsssimfile.ind_nsssimfile_hashval = 0; // stored hash value + nsssimfile.ns_zd_nsssimfile_ns_next = (acr_in::FNsssimfile*)-1; // (acr_in.FNs.zd_nsssimfile_ns) not-in-list + nsssimfile.ns_zd_nsssimfile_ns_prev = NULL; // (acr_in.FNs.zd_nsssimfile_ns) + nsssimfile.ssimfile_zd_nsssimfile_ssimfile_next = (acr_in::FNsssimfile*)-1; // (acr_in.FSsimfile.zd_nsssimfile_ssimfile) not-in-list + nsssimfile.ssimfile_zd_nsssimfile_ssimfile_prev = NULL; // (acr_in.FSsimfile.zd_nsssimfile_ssimfile) } // --- acr_in.FNsssimfile..Ctor @@ -1779,9 +1783,9 @@ inline acr_in::FNsssimfile* acr_in::zd_nsssimfile_ssimfile_First(acr_in::FSsimfi // --- acr_in.FSsimfile.zd_nsssimfile_ssimfile.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool acr_in::zd_nsssimfile_ssimfile_InLlistQ(acr_in::FNsssimfile& row) { +inline bool acr_in::ssimfile_zd_nsssimfile_ssimfile_InLlistQ(acr_in::FNsssimfile& row) { bool result = false; - result = !(row.zd_nsssimfile_ssimfile_next == (acr_in::FNsssimfile*)-1); + result = !(row.ssimfile_zd_nsssimfile_ssimfile_next == (acr_in::FNsssimfile*)-1); return result; } @@ -1801,14 +1805,14 @@ inline i32 acr_in::zd_nsssimfile_ssimfile_N(const acr_in::FSsimfile& ssimfile) { // --- acr_in.FSsimfile.zd_nsssimfile_ssimfile.Next // Return pointer to next element in the list -inline acr_in::FNsssimfile* acr_in::zd_nsssimfile_ssimfile_Next(acr_in::FNsssimfile &row) { - return row.zd_nsssimfile_ssimfile_next; +inline acr_in::FNsssimfile* acr_in::ssimfile_zd_nsssimfile_ssimfile_Next(acr_in::FNsssimfile &row) { + return row.ssimfile_zd_nsssimfile_ssimfile_next; } // --- acr_in.FSsimfile.zd_nsssimfile_ssimfile.Prev // Return pointer to previous element in the list -inline acr_in::FNsssimfile* acr_in::zd_nsssimfile_ssimfile_Prev(acr_in::FNsssimfile &row) { - return row.zd_nsssimfile_ssimfile_prev; +inline acr_in::FNsssimfile* acr_in::ssimfile_zd_nsssimfile_ssimfile_Prev(acr_in::FNsssimfile &row) { + return row.ssimfile_zd_nsssimfile_ssimfile_prev; } // --- acr_in.FSsimfile.zd_nsssimfile_ssimfile.qLast @@ -1830,6 +1834,7 @@ inline void acr_in::FSsimfile_Init(acr_in::FSsimfile& ssimfile) { ssimfile.zd_ssimfile_next = (acr_in::FSsimfile*)-1; // (acr_in.FDb.zd_ssimfile) not-in-list ssimfile.zd_ssimfile_prev = NULL; // (acr_in.FDb.zd_ssimfile) ssimfile.ind_ssimfile_next = (acr_in::FSsimfile*)-1; // (acr_in.FDb.ind_ssimfile) not-in-hash + ssimfile.ind_ssimfile_hashval = 0; // stored hash value } // --- acr_in.FSsimfile.zd_nsssimfile_ssimfile_curs.Reset @@ -1847,7 +1852,7 @@ inline bool acr_in::ssimfile_zd_nsssimfile_ssimfile_curs_ValidQ(ssimfile_zd_nsss // --- acr_in.FSsimfile.zd_nsssimfile_ssimfile_curs.Next // proceed to next item inline void acr_in::ssimfile_zd_nsssimfile_ssimfile_curs_Next(ssimfile_zd_nsssimfile_ssimfile_curs &curs) { - acr_in::FNsssimfile *next = (*curs.row).zd_nsssimfile_ssimfile_next; + acr_in::FNsssimfile *next = (*curs.row).ssimfile_zd_nsssimfile_ssimfile_next; curs.row = next; } @@ -2021,6 +2026,7 @@ inline void acr_in::FTarget_Init(acr_in::FTarget& target) { target.c_targdep_child_max = 0; // (acr_in.FTarget.c_targdep_child) target.p_ns = NULL; target.ind_target_next = (acr_in::FTarget*)-1; // (acr_in.FDb.ind_target) not-in-hash + target.ind_target_hashval = 0; // stored hash value target.zd_targ_visit_next = (acr_in::FTarget*)-1; // (acr_in.FDb.zd_targ_visit) not-in-list target.zd_targ_visit_prev = NULL; // (acr_in.FDb.zd_targ_visit) } @@ -2193,6 +2199,7 @@ inline void acr_in::FTuple_Init(acr_in::FTuple& tuple) { tuple.c_parent_max = 0; // (acr_in.FTuple.c_parent) tuple.deselect_visited = bool(false); tuple.ind_tuple_next = (acr_in::FTuple*)-1; // (acr_in.FDb.ind_tuple) not-in-hash + tuple.ind_tuple_hashval = 0; // stored hash value tuple.zd_select_next = (acr_in::FTuple*)-1; // (acr_in.FDb.zd_select) not-in-list tuple.zd_select_prev = NULL; // (acr_in.FDb.zd_select) tuple.zd_deselect_next = (acr_in::FTuple*)-1; // (acr_in.FDb.zd_deselect) not-in-list diff --git a/include/gen/acr_my_gen.h b/include/gen/acr_my_gen.h index 8d0e730b..95e14a59 100644 --- a/include/gen/acr_my_gen.h +++ b/include/gen/acr_my_gen.h @@ -117,6 +117,11 @@ algo::cstring& ary_ns_AllocAt(int at) __attribute__((__warn_unused_result_ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:acr_my.FDb.ary_ns.AllocN algo::aryptr ary_ns_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:acr_my.FDb.ary_ns.AllocNAt +algo::aryptr ary_ns_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:acr_my.FDb.ary_ns.EmptyQ inline bool ary_ns_EmptyQ() __attribute__((nothrow)); @@ -166,6 +171,10 @@ algo::aryptr ary_ns_AllocNVal(int n_elems, const algo::cstring& v // Function returns success value. // func:acr_my.FDb.ary_ns.ReadStrptrMaybe bool ary_ns_ReadStrptrMaybe(algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:acr_my.FDb.ary_ns.Insary +void ary_ns_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // Read argc,argv directly into the fields of the command line(s) // The following fields are updated: diff --git a/include/gen/algo_gen.h b/include/gen/algo_gen.h index 6e6ffb79..7db8416c 100644 --- a/include/gen/algo_gen.h +++ b/include/gen/algo_gen.h @@ -56,12 +56,13 @@ enum { algo_EchoQEnum_N = 2 }; // --- algo_ErrnsEnum -enum algo_ErrnsEnum { // algo.Errns.value - algo_Errns_unix = 0 - ,algo_Errns_win = 1 +enum algo_ErrnsEnum { // algo.Errns.value + algo_Errns_unix = 0 // Unix error code (use strerror) + ,algo_Errns_win = 1 // Windows error code + ,algo_Errns_ssl = 2 // SSL error code }; -enum { algo_ErrnsEnum_N = 2 }; +enum { algo_ErrnsEnum_N = 3 }; // --- algo_FailokQEnum @@ -79,29 +80,29 @@ enum { algo_FailokQEnum_N = 2 }; enum algo_FieldIdEnum { // algo.FieldId.value algo_FieldId_name = 0 ,algo_FieldId_value = 1 - ,algo_FieldId_ch = 2 - ,algo_FieldId_exponent = 3 - ,algo_FieldId_mantissa = 4 - ,algo_FieldId_append = 5 - ,algo_FieldId_read = 6 - ,algo_FieldId_write = 7 - ,algo_FieldId__throw = 8 - ,algo_FieldId_temp = 9 - ,algo_FieldId_overlap = 10 - ,algo_FieldId_linear = 11 - ,algo_FieldId_printerr = 12 - ,algo_FieldId_eof = 13 - ,algo_FieldId_err = 14 - ,algo_FieldId_x = 15 - ,algo_FieldId_y = 16 - ,algo_FieldId_ip_host = 17 - ,algo_FieldId_mask = 18 - ,algo_FieldId_ok = 19 - ,algo_FieldId_neg = 20 - ,algo_FieldId_overflow = 21 - ,algo_FieldId_hex = 22 - ,algo_FieldId_sha1sig = 23 - ,algo_FieldId_ary = 24 + ,algo_FieldId_ary = 2 + ,algo_FieldId_ch = 3 + ,algo_FieldId_exponent = 4 + ,algo_FieldId_mantissa = 5 + ,algo_FieldId_append = 6 + ,algo_FieldId_read = 7 + ,algo_FieldId_write = 8 + ,algo_FieldId__throw = 9 + ,algo_FieldId_temp = 10 + ,algo_FieldId_overlap = 11 + ,algo_FieldId_linear = 12 + ,algo_FieldId_printerr = 13 + ,algo_FieldId_eof = 14 + ,algo_FieldId_err = 15 + ,algo_FieldId_x = 16 + ,algo_FieldId_y = 17 + ,algo_FieldId_ip_host = 18 + ,algo_FieldId_mask = 19 + ,algo_FieldId_ok = 20 + ,algo_FieldId_neg = 21 + ,algo_FieldId_overflow = 22 + ,algo_FieldId_hex = 23 + ,algo_FieldId_sha1sig = 24 ,algo_FieldId_attrs = 25 ,algo_FieldId_head = 26 ,algo_FieldId_protocol = 27 @@ -119,15 +120,15 @@ enum { algo_FieldIdEnum_N = 35 }; // --- algo_FileFlagsEnum -enum algo_FileFlagsEnum { // algo.FileFlags.value - algo_FileFlags_read = (u32(1)<<0) // algo.FileFlags.read - ,algo_FileFlags_write = (u32(1)<<1) // algo.FileFlags.write - ,algo_FileFlags_append = (u32(1)<<4) // algo.FileFlags.append - ,algo_FileFlags__throw = (u32(1)<<5) // algo.FileFlags._throw - ,algo_FileFlags_temp = (u32(1)<<6) // algo.FileFlags.temp - ,algo_FileFlags_overlap = (u32(1)<<7) // algo.FileFlags.overlap - ,algo_FileFlags_linear = (u32(1)<<8) // algo.FileFlags.linear - ,algo_FileFlags_printerr = (u32(1)<<9) // algo.FileFlags.printerr +enum algo_FileFlagsEnum { // algo.FileFlags.value + algo_FileFlags_read = 0x1 // algo.FileFlags.read + ,algo_FileFlags_write = 0x2 // algo.FileFlags.write + ,algo_FileFlags_append = 0x10 // algo.FileFlags.append + ,algo_FileFlags__throw = 0x20 // algo.FileFlags._throw + ,algo_FileFlags_temp = 0x40 // algo.FileFlags.temp + ,algo_FileFlags_overlap = 0x80 // algo.FileFlags.overlap + ,algo_FileFlags_linear = 0x100 // algo.FileFlags.linear + ,algo_FileFlags_printerr = 0x200 // algo.FileFlags.printerr }; enum { algo_FileFlagsEnum_N = 8 }; @@ -135,11 +136,11 @@ enum { algo_FileFlagsEnum_N = 8 }; // --- algo_IOEvtFlagsEnum -enum algo_IOEvtFlagsEnum { // algo.IOEvtFlags.value - algo_IOEvtFlags_read = (u32(1)<<0) // algo.IOEvtFlags.read - ,algo_IOEvtFlags_write = (u32(1)<<1) // algo.IOEvtFlags.write - ,algo_IOEvtFlags_eof = (u32(1)<<2) // algo.IOEvtFlags.eof - ,algo_IOEvtFlags_err = (u32(1)<<3) // algo.IOEvtFlags.err +enum algo_IOEvtFlagsEnum { // algo.IOEvtFlags.value + algo_IOEvtFlags_read = 0x1 // algo.IOEvtFlags.read + ,algo_IOEvtFlags_write = 0x2 // algo.IOEvtFlags.write + ,algo_IOEvtFlags_eof = 0x4 // algo.IOEvtFlags.eof + ,algo_IOEvtFlags_err = 0x8 // algo.IOEvtFlags.err }; enum { algo_IOEvtFlagsEnum_N = 4 }; @@ -168,12 +169,12 @@ enum { algo_MonthEnum_N = 13 }; // --- algo_NumParseFlagsEnum -enum algo_NumParseFlagsEnum { // algo.NumParseFlags.value - algo_NumParseFlags_err = (u32(1)<<0) // algo.NumParseFlags.err - ,algo_NumParseFlags_ok = (u32(1)<<1) // algo.NumParseFlags.ok - ,algo_NumParseFlags_neg = (u32(1)<<2) // algo.NumParseFlags.neg - ,algo_NumParseFlags_overflow = (u32(1)<<3) // algo.NumParseFlags.overflow - ,algo_NumParseFlags_hex = (u32(1)<<4) // algo.NumParseFlags.hex +enum algo_NumParseFlagsEnum { // algo.NumParseFlags.value + algo_NumParseFlags_err = 0x1 // algo.NumParseFlags.err + ,algo_NumParseFlags_ok = 0x2 // algo.NumParseFlags.ok + ,algo_NumParseFlags_neg = 0x4 // algo.NumParseFlags.neg + ,algo_NumParseFlags_overflow = 0x8 // algo.NumParseFlags.overflow + ,algo_NumParseFlags_hex = 0x10 // algo.NumParseFlags.hex }; enum { algo_NumParseFlagsEnum_N = 5 }; @@ -198,9 +199,10 @@ enum algo_TextJustEnum { // algo.TextJust.value algo_TextJust_j_right = 1 ,algo_TextJust_j_left = -1 ,algo_TextJust_j_center = 0 + ,algo_TextJust_j_auto = 2 }; -enum { algo_TextJustEnum_N = 3 }; +enum { algo_TextJustEnum_N = 4 }; namespace algo { // gen:ns_pkeytypedef } // gen:ns_pkeytypedef @@ -209,13 +211,15 @@ namespace algo { // gen:ns_tclass_field // gen:ns_fwddecl2 namespace algo { struct cstring_ch_curs; } namespace algo { struct ByteAry_ary_curs; } -namespace algo { struct Charset_ch_bitcurs; } namespace algo { struct Charset_ch_curs; } +namespace algo { struct I32RangeAry_ary_curs; } namespace algo { struct LineBuf_buf_curs; } namespace algo { struct Md5Digest_value_curs; } namespace algo { struct Sha1sig_sha1sig_curs; } namespace algo { struct StringAry_ary_curs; } namespace algo { struct Tuple_attrs_curs; } +namespace algo { struct U16Ary_ary_curs; } +namespace algo { struct U32Ary_ary_curs; } namespace algo { struct U64Ary_ary_curs; } namespace algo { struct Uuid_value_curs; } namespace lib_json { struct FNode; } @@ -246,6 +250,7 @@ namespace algo { struct I32Dec2; } namespace algo { struct I32Dec3; } namespace algo { struct I32Dec4; } namespace algo { struct I32Dec5; } +namespace algo { struct I32RangeAry; } namespace algo { struct I64Dec1; } namespace algo { struct I64Dec10; } namespace algo { struct I64Dec2; } @@ -256,6 +261,7 @@ namespace algo { struct I64Dec6; } namespace algo { struct I64Dec7; } namespace algo { struct I64Dec8; } namespace algo { struct I64Dec9; } +namespace algo { struct I64Rate; } namespace algo { struct IOEvtFlags; } namespace algo { struct IPoint; } namespace algo { struct Smallstr50; } @@ -390,7 +396,9 @@ namespace algo { struct Smallstr16; } namespace algo { struct Smallstr2; } namespace algo { struct Smallstr20; } namespace algo { struct Smallstr200; } +namespace algo { struct Smallstr249; } namespace algo { struct Smallstr25; } +namespace algo { struct Smallstr255; } namespace algo { struct Smallstr3; } namespace algo { struct Smallstr30; } namespace algo { struct Smallstr32; } @@ -402,12 +410,15 @@ namespace algo { struct TermStyle; } namespace algo { struct TextJust; } namespace algo { struct TstampCache; } namespace algo { struct Tuple; } +namespace algo { struct U16Ary; } namespace algo { struct U16Dec2; } +namespace algo { struct U32Ary; } namespace algo { struct U32Dec1; } namespace algo { struct U32Dec2; } namespace algo { struct U32Dec3; } namespace algo { struct U32Dec4; } namespace algo { struct U32Dec5; } +namespace algo { struct U32LinearKey; } namespace algo { struct U64Ary; } namespace algo { struct U64Dec10; } namespace algo { struct U64Dec2; } @@ -482,6 +493,11 @@ char& ch_AllocAt(algo::cstring& parent, int at) __attribute__((__ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo.cstring.ch.AllocN algo::aryptr ch_AllocN(algo::cstring& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.cstring.ch.AllocNAt +algo::aryptr ch_AllocNAt(algo::cstring& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo.cstring.ch.EmptyQ inline bool ch_EmptyQ(algo::cstring& parent) __attribute__((nothrow)); @@ -540,6 +556,10 @@ algo::aryptr ch_AllocNVal(algo::cstring& parent, int n_elems, const char // The array is replaced with the input string. Function always succeeds. // func:algo.cstring.ch.ReadStrptrMaybe bool ch_ReadStrptrMaybe(algo::cstring& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.cstring.ch.Insary +void ch_Insary(algo::cstring& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:algo.cstring.ch_curs.Next @@ -553,8 +573,7 @@ inline bool cstring_ch_curs_ValidQ(cstring_ch_curs &curs) __attribute__ // func:algo.cstring.ch_curs.Access inline char& cstring_ch_curs_Access(cstring_ch_curs &curs) __attribute__((nothrow)); // func:algo.cstring..Hash -// this function is 'extrn' and implemented by user -u32 cstring_Hash(u32 prev, const algo::cstring& rhs) __attribute__((nothrow)); +inline u32 cstring_Hash(u32 prev, const algo::cstring& rhs) __attribute__((nothrow)); // Read fields of algo::cstring from an ascii string. // func:algo.cstring..ReadStrptrMaybe // this function is 'extrn' and implemented by user @@ -697,6 +716,11 @@ u8& ary_AllocAt(algo::ByteAry& parent, int at) __attribute__((_ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo.ByteAry.ary.AllocN algo::aryptr ary_AllocN(algo::ByteAry& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.ByteAry.ary.AllocNAt +algo::aryptr ary_AllocNAt(algo::ByteAry& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo.ByteAry.ary.EmptyQ inline bool ary_EmptyQ(algo::ByteAry& parent) __attribute__((nothrow)); @@ -755,6 +779,10 @@ algo::aryptr ary_AllocNVal(algo::ByteAry& parent, int n_elems, const u8& // The array is replaced with the input string. Function always succeeds. // func:algo.ByteAry.ary.ReadStrptrMaybe bool ary_ReadStrptrMaybe(algo::ByteAry& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.ByteAry.ary.Insary +void ary_Insary(algo::ByteAry& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:algo.ByteAry.ary_curs.Next @@ -767,11 +795,20 @@ inline bool ByteAry_ary_curs_ValidQ(ByteAry_ary_curs &curs) __attribute // item access // func:algo.ByteAry.ary_curs.Access inline u8& ByteAry_ary_curs_Access(ByteAry_ary_curs &curs) __attribute__((nothrow)); +// Read fields of algo::ByteAry from an ascii string. +// func:algo.ByteAry..ReadStrptrMaybe +// this function is 'extrn' and implemented by user +bool ByteAry_ReadStrptrMaybe(algo::ByteAry &parent, algo::strptr in_str) __attribute__((nothrow)); // Set all fields to initial values. // func:algo.ByteAry..Init inline void ByteAry_Init(algo::ByteAry& parent); // func:algo.ByteAry..Uninit void ByteAry_Uninit(algo::ByteAry& parent) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:algo.ByteAry.String printfmt:Extern +// func:algo.ByteAry..Print +// this function is 'extrn' and implemented by user +void ByteAry_Print(algo::ByteAry& row, algo::cstring& str) __attribute__((nothrow)); // --- algo.Charset struct Charset { // algo.Charset: Character set @@ -857,17 +894,6 @@ void ch_Print(algo::Charset& parent, algo::cstring &rhs) __attri // func:algo.Charset.ch.ReadStrptrMaybe bool ch_ReadStrptrMaybe(algo::Charset& parent, algo::strptr in_str) __attribute__((nothrow)); -// proceed to next item -// func:algo.Charset.ch_bitcurs.Next -void Charset_ch_bitcurs_Next(Charset_ch_bitcurs &curs); -// func:algo.Charset.ch_bitcurs.Reset -inline void Charset_ch_bitcurs_Reset(Charset_ch_bitcurs &curs, algo::Charset &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:algo.Charset.ch_bitcurs.ValidQ -inline bool Charset_ch_bitcurs_ValidQ(Charset_ch_bitcurs &curs) __attribute__((nothrow)); -// item access -// func:algo.Charset.ch_bitcurs.Access -inline int& Charset_ch_bitcurs_Access(Charset_ch_bitcurs &curs) __attribute__((nothrow)); // cursor points to valid item // func:algo.Charset.ch_curs.Reset inline void Charset_ch_curs_Reset(Charset_ch_curs &curs, algo::Charset &parent) __attribute__((nothrow)); @@ -927,8 +953,6 @@ inline void ch_AddStrptr(algo::Smallstr150& parent, algo::strptr str) _ // Access string as array of chars // func:algo.Smallstr150.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr150& parent) __attribute__((nothrow)); -// func:algo.Smallstr150.ch.HashStrptr -inline u32 Smallstr150_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr150.ch.Init inline void ch_Init(algo::Smallstr150 &parent) __attribute__((nothrow)); // always return constant 150 @@ -1028,8 +1052,6 @@ inline void ch_AddStrptr(algo::Smallstr250& parent, algo::strptr str) _ // Access string as array of chars // func:algo.Smallstr250.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr250& parent) __attribute__((nothrow)); -// func:algo.Smallstr250.ch.HashStrptr -inline u32 Smallstr250_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr250.ch.Init inline void ch_Init(algo::Smallstr250 &parent) __attribute__((nothrow)); // always return constant 250 @@ -1335,8 +1357,14 @@ inline void Errns_Init(algo::Errns& parent); // --- algo.Errcode struct Errcode { // algo.Errcode: Error code u64 value; // 0 + // func:algo.Errcode..EqOp + inline bool operator ==(const algo::Errcode &rhs) const __attribute__((nothrow)); + // func:algo.Errcode..NeOp + inline bool operator !=(const algo::Errcode &rhs) const __attribute__((nothrow)); // func:algo.Errcode..Ctor inline Errcode() __attribute__((nothrow)); + // func:algo.Errcode..FieldwiseCtor + explicit inline Errcode(u64 in_value) __attribute__((nothrow)); }; // Retrieve bitfield from value of field value @@ -1357,9 +1385,13 @@ inline algo::Errns type_Get(const algo::Errcode& parent) __attribute__((__warn // func:algo.Errcode.type.Set inline void type_Set(algo::Errcode& parent, algo::Errns rhs) __attribute__((nothrow)); +// func:algo.Errcode..Cmp +inline i32 Errcode_Cmp(algo::Errcode& lhs, algo::Errcode& rhs) __attribute__((nothrow)); // Set all fields to initial values. // func:algo.Errcode..Init inline void Errcode_Init(algo::Errcode& parent); +// func:algo.Errcode..Eq +inline bool Errcode_Eq(algo::Errcode& lhs, algo::Errcode& rhs) __attribute__((nothrow)); // print string representation of ROW to string STR // cfmt:algo.Errcode.String printfmt:Extern // func:algo.Errcode..Print @@ -1859,6 +1891,143 @@ inline void I32Dec5_Init(algo::I32Dec5& parent); // func:algo.I32Dec5..Print void I32Dec5_Print(algo::I32Dec5 row, algo::cstring& str) __attribute__((nothrow)); +// --- algo.I32RangeAry +struct I32RangeAry { // algo.I32RangeAry: Byte array + algo::i32_Range* ary_elems; // pointer to elements + u32 ary_n; // number of elements in array + u32 ary_max; // max. capacity of array before realloc + // Copy from aryptr (operator=) + // func:algo.I32RangeAry.ary.AssignAryptr + inline void operator =(const algo::aryptr &rhs) __attribute__((nothrow)); + // func:algo.I32RangeAry.ary.CtorAryptr + explicit inline I32RangeAry(const algo::aryptr &rhs) __attribute__((nothrow)); + // func:algo.I32RangeAry.ary.Cast + inline operator algo::aryptr() const __attribute__((nothrow)); + // func:algo.I32RangeAry..AssignOp + algo::I32RangeAry& operator =(const algo::I32RangeAry &rhs) __attribute__((nothrow)); + // func:algo.I32RangeAry..Ctor + inline I32RangeAry() __attribute__((nothrow)); + // func:algo.I32RangeAry..Dtor + inline ~I32RangeAry() __attribute__((nothrow)); + // func:algo.I32RangeAry..CopyCtor + I32RangeAry(const algo::I32RangeAry &rhs) __attribute__((nothrow)); +}; + +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.I32RangeAry.ary.Addary +algo::aryptr ary_Addary(algo::I32RangeAry& parent, algo::aryptr rhs) __attribute__((nothrow)); +// Reserve space. Insert element at the end +// The new element is initialized to a default value +// func:algo.I32RangeAry.ary.Alloc +algo::i32_Range& ary_Alloc(algo::I32RangeAry& parent) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.I32RangeAry.ary.AllocAt +algo::i32_Range& ary_AllocAt(algo::I32RangeAry& parent, int at) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:algo.I32RangeAry.ary.AllocN +algo::aryptr ary_AllocN(algo::I32RangeAry& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.I32RangeAry.ary.AllocNAt +algo::aryptr ary_AllocNAt(algo::I32RangeAry& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:algo.I32RangeAry.ary.EmptyQ +inline bool ary_EmptyQ(algo::I32RangeAry& parent) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:algo.I32RangeAry.ary.Find +inline algo::i32_Range* ary_Find(algo::I32RangeAry& parent, u64 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array pointer by value +// func:algo.I32RangeAry.ary.Getary +inline algo::aryptr ary_Getary(const algo::I32RangeAry& parent) __attribute__((nothrow)); +// Return pointer to last element of array, or NULL if array is empty +// func:algo.I32RangeAry.ary.Last +inline algo::i32_Range* ary_Last(algo::I32RangeAry& parent) __attribute__((nothrow, pure)); +// Return max. number of items in the array +// func:algo.I32RangeAry.ary.Max +inline i32 ary_Max(algo::I32RangeAry& parent) __attribute__((nothrow)); +// Return number of items in the array +// func:algo.I32RangeAry.ary.N +inline i32 ary_N(const algo::I32RangeAry& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove item by index. If index outside of range, do nothing. +// func:algo.I32RangeAry.ary.Remove +void ary_Remove(algo::I32RangeAry& parent, u32 i) __attribute__((nothrow)); +// func:algo.I32RangeAry.ary.RemoveAll +inline void ary_RemoveAll(algo::I32RangeAry& parent) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:algo.I32RangeAry.ary.RemoveLast +void ary_RemoveLast(algo::I32RangeAry& parent) __attribute__((nothrow)); +// Make sure N *more* elements will fit in array. Process dies if out of memory +// func:algo.I32RangeAry.ary.Reserve +inline void ary_Reserve(algo::I32RangeAry& parent, int n) __attribute__((nothrow)); +// Make sure N elements fit in array. Process dies if out of memory +// func:algo.I32RangeAry.ary.AbsReserve +void ary_AbsReserve(algo::I32RangeAry& parent, int n) __attribute__((nothrow)); +// Copy contents of RHS to PARENT. +// func:algo.I32RangeAry.ary.Setary +void ary_Setary(algo::I32RangeAry& parent, algo::I32RangeAry &rhs) __attribute__((nothrow)); +// Copy specified array into ary, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +// func:algo.I32RangeAry.ary.Setary2 +void ary_Setary(algo::I32RangeAry& parent, const algo::aryptr &rhs) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:algo.I32RangeAry.ary.qFind +inline algo::i32_Range& ary_qFind(algo::I32RangeAry& parent, u64 t) __attribute__((nothrow)); +// Return reference to last element of array. No bounds checking +// func:algo.I32RangeAry.ary.qLast +inline algo::i32_Range& ary_qLast(algo::I32RangeAry& parent) __attribute__((nothrow)); +// Return row id of specified element +// func:algo.I32RangeAry.ary.rowid_Get +inline u64 ary_rowid_Get(algo::I32RangeAry& parent, algo::i32_Range &elem) __attribute__((nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:algo.I32RangeAry.ary.AllocNVal +algo::aryptr ary_AllocNVal(algo::I32RangeAry& parent, int n_elems, const algo::i32_Range& val) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.I32RangeAry.ary.Insary +void ary_Insary(algo::I32RangeAry& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); +// Verify whether array is sorted +// func:algo.I32RangeAry.ary.SortedQ +bool ary_SortedQ(algo::I32RangeAry& parent) __attribute__((nothrow)); +// Insertion sort +// func:algo.I32RangeAry.ary.InsertionSort +void ary_InsertionSort(algo::I32RangeAry& parent) __attribute__((nothrow)); +// Heap sort +// func:algo.I32RangeAry.ary.HeapSort +void ary_HeapSort(algo::I32RangeAry& parent) __attribute__((nothrow)); +// Quick sort +// func:algo.I32RangeAry.ary.QuickSort +void ary_QuickSort(algo::I32RangeAry& parent) __attribute__((nothrow)); + +// proceed to next item +// func:algo.I32RangeAry.ary_curs.Next +inline void I32RangeAry_ary_curs_Next(I32RangeAry_ary_curs &curs) __attribute__((nothrow)); +// func:algo.I32RangeAry.ary_curs.Reset +inline void I32RangeAry_ary_curs_Reset(I32RangeAry_ary_curs &curs, algo::I32RangeAry &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:algo.I32RangeAry.ary_curs.ValidQ +inline bool I32RangeAry_ary_curs_ValidQ(I32RangeAry_ary_curs &curs) __attribute__((nothrow)); +// item access +// func:algo.I32RangeAry.ary_curs.Access +inline algo::i32_Range& I32RangeAry_ary_curs_Access(I32RangeAry_ary_curs &curs) __attribute__((nothrow)); +// Read fields of algo::I32RangeAry from an ascii string. +// func:algo.I32RangeAry..ReadStrptrMaybe +// this function is 'extrn' and implemented by user +bool I32RangeAry_ReadStrptrMaybe(algo::I32RangeAry &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:algo.I32RangeAry..Init +inline void I32RangeAry_Init(algo::I32RangeAry& parent); +// func:algo.I32RangeAry..Uninit +void I32RangeAry_Uninit(algo::I32RangeAry& parent) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:algo.I32RangeAry.String printfmt:Extern +// func:algo.I32RangeAry..Print +// this function is 'extrn' and implemented by user +void I32RangeAry_Print(algo::I32RangeAry& row, algo::cstring& str) __attribute__((nothrow)); + // --- algo.I64Dec1 struct I64Dec1 { // algo.I64Dec1: signed i64, scale 1e1 i64 value; // 0 @@ -2365,6 +2534,18 @@ inline void I64Dec9_Init(algo::I64Dec9& parent); // func:algo.I64Dec9..Print void I64Dec9_Print(algo::I64Dec9 row, algo::cstring& str) __attribute__((nothrow)); +// --- algo.I64Rate +struct I64Rate { // algo.I64Rate + i64 last; // 0 Last value + i64 delta; // 0 Delta of last value + // func:algo.I64Rate..Ctor + inline I64Rate() __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:algo.I64Rate..Init +inline void I64Rate_Init(algo::I64Rate& parent); + // --- algo.IOEvtFlags struct IOEvtFlags { // algo.IOEvtFlags: IO event flags, used in IOHook u32 value; // 0 @@ -2500,8 +2681,6 @@ inline void ch_AddStrptr(algo::Smallstr50& parent, algo::strptr str) __ // Access string as array of chars // func:algo.Smallstr50.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr50& parent) __attribute__((nothrow)); -// func:algo.Smallstr50.ch.HashStrptr -inline u32 Smallstr50_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr50.ch.Init inline void ch_Init(algo::Smallstr50 &parent) __attribute__((nothrow)); // always return constant 50 @@ -2538,6 +2717,11 @@ inline bool Smallstr50_Eq(algo::Smallstr50& lhs, algo::Smallstr50& rhs) // Set value. Return true if new value is different from old value. // func:algo.Smallstr50..Update inline bool Smallstr50_Update(algo::Smallstr50 &lhs, algo::Smallstr50& rhs) __attribute__((nothrow)); +// Create JSON representation of algo::Smallstr50 under PARENT node +// cfmt:algo.Smallstr50.Json printfmt:Extern +// func:algo.Smallstr50..FmtJson +// this function is 'extrn' and implemented by user +lib_json::FNode * Smallstr50_FmtJson(algo::Smallstr50& row, lib_json::FNode *parent) __attribute__((nothrow)); // print string representation of ROW to string STR // cfmt:algo.Smallstr50.String printfmt:Raw // func:algo.Smallstr50..Print @@ -2598,6 +2782,18 @@ struct Smallstr100 { // algo.Smallstr100: inline string with length field inline Smallstr100(const algo::strptr &rhs) __attribute__((nothrow)); // func:algo.Smallstr100.ch.Cast inline operator algo::strptr() const __attribute__((nothrow)); + // func:algo.Smallstr100..EqOp + inline bool operator ==(const algo::Smallstr100 &rhs) const __attribute__((nothrow)); + // func:algo.Smallstr100..NeOp + inline bool operator !=(const algo::Smallstr100 &rhs) const __attribute__((nothrow)); + // func:algo.Smallstr100..LtOp + inline bool operator <(const algo::Smallstr100 &rhs) const __attribute__((nothrow)); + // func:algo.Smallstr100..GtOp + inline bool operator >(const algo::Smallstr100 &rhs) const __attribute__((nothrow)); + // func:algo.Smallstr100..LeOp + inline bool operator <=(const algo::Smallstr100 &rhs) const __attribute__((nothrow)); + // func:algo.Smallstr100..GeOp + inline bool operator >=(const algo::Smallstr100 &rhs) const __attribute__((nothrow)); // func:algo.Smallstr100..EqOpAryptr inline bool operator ==(const algo::aryptr &rhs) const __attribute__((nothrow)); // func:algo.Smallstr100..AssignOp @@ -2621,8 +2817,6 @@ inline void ch_AddStrptr(algo::Smallstr100& parent, algo::strptr str) _ // Access string as array of chars // func:algo.Smallstr100.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr100& parent) __attribute__((nothrow)); -// func:algo.Smallstr100.ch.HashStrptr -inline u32 Smallstr100_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr100.ch.Init inline void ch_Init(algo::Smallstr100 &parent) __attribute__((nothrow)); // always return constant 100 @@ -2647,6 +2841,8 @@ u32 Smallstr100_Hash(u32 prev, const algo::Smallstr100& rhs) __ // The format of the string is the format of the algo::Smallstr100's only field // func:algo.Smallstr100..ReadStrptrMaybe bool Smallstr100_ReadStrptrMaybe(algo::Smallstr100 &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:algo.Smallstr100..Lt +inline bool Smallstr100_Lt(algo::Smallstr100& lhs, algo::Smallstr100& rhs) __attribute__((nothrow)); // func:algo.Smallstr100..Cmp inline i32 Smallstr100_Cmp(algo::Smallstr100& lhs, algo::Smallstr100& rhs) __attribute__((nothrow)); // Set all fields to initial values. @@ -2654,6 +2850,9 @@ inline i32 Smallstr100_Cmp(algo::Smallstr100& lhs, algo::Smallstr100& inline void Smallstr100_Init(algo::Smallstr100& parent); // func:algo.Smallstr100..Eq inline bool Smallstr100_Eq(algo::Smallstr100& lhs, algo::Smallstr100& rhs) __attribute__((nothrow)); +// Set value. Return true if new value is different from old value. +// func:algo.Smallstr100..Update +inline bool Smallstr100_Update(algo::Smallstr100 &lhs, algo::Smallstr100& rhs) __attribute__((nothrow)); // print string representation of ROW to string STR // cfmt:algo.Smallstr100.String printfmt:Raw // func:algo.Smallstr100..Print @@ -2759,6 +2958,11 @@ char& buf_AllocAt(algo::LineBuf& parent, int at) __attribute__((_ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo.LineBuf.buf.AllocN algo::aryptr buf_AllocN(algo::LineBuf& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.LineBuf.buf.AllocNAt +algo::aryptr buf_AllocNAt(algo::LineBuf& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo.LineBuf.buf.EmptyQ inline bool buf_EmptyQ(algo::LineBuf& parent) __attribute__((nothrow)); @@ -2817,6 +3021,10 @@ algo::aryptr buf_AllocNVal(algo::LineBuf& parent, int n_elems, const cha // The array is replaced with the input string. Function always succeeds. // func:algo.LineBuf.buf.ReadStrptrMaybe bool buf_ReadStrptrMaybe(algo::LineBuf& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.LineBuf.buf.Insary +void buf_Insary(algo::LineBuf& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:algo.LineBuf.buf_curs.Next @@ -2865,8 +3073,6 @@ struct LnumStr10_U64 { // algo.LnumStr10_U64: number stored as ascii digits, lef // Access string as array of chars // func:algo.LnumStr10_U64.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr10_U64& parent) __attribute__((nothrow)); -// func:algo.LnumStr10_U64.ch.HashStrptr -inline u32 LnumStr10_U64_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr10_U64.ch.Init inline void ch_Init(algo::LnumStr10_U64 &parent) __attribute__((nothrow)); // always return constant 10 @@ -2953,8 +3159,6 @@ struct LnumStr11_U64 { // algo.LnumStr11_U64: number stored as ascii digits, lef // Access string as array of chars // func:algo.LnumStr11_U64.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr11_U64& parent) __attribute__((nothrow)); -// func:algo.LnumStr11_U64.ch.HashStrptr -inline u32 LnumStr11_U64_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr11_U64.ch.Init inline void ch_Init(algo::LnumStr11_U64 &parent) __attribute__((nothrow)); // always return constant 11 @@ -3041,8 +3245,6 @@ struct LnumStr12_U64 { // algo.LnumStr12_U64: number stored as ascii digits, lef // Access string as array of chars // func:algo.LnumStr12_U64.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr12_U64& parent) __attribute__((nothrow)); -// func:algo.LnumStr12_U64.ch.HashStrptr -inline u32 LnumStr12_U64_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr12_U64.ch.Init inline void ch_Init(algo::LnumStr12_U64 &parent) __attribute__((nothrow)); // always return constant 12 @@ -3129,8 +3331,6 @@ struct LnumStr13_U64_Base36 { // algo.LnumStr13_U64_Base36: number stored as asc // Access string as array of chars // func:algo.LnumStr13_U64_Base36.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr13_U64_Base36& parent) __attribute__((nothrow)); -// func:algo.LnumStr13_U64_Base36.ch.HashStrptr -inline u32 LnumStr13_U64_Base36_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr13_U64_Base36.ch.Init inline void ch_Init(algo::LnumStr13_U64_Base36 &parent) __attribute__((nothrow)); // always return constant 13 @@ -3217,8 +3417,6 @@ struct LnumStr16_U64_Base16 { // algo.LnumStr16_U64_Base16: number stored as asc // Access string as array of chars // func:algo.LnumStr16_U64_Base16.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr16_U64_Base16& parent) __attribute__((nothrow)); -// func:algo.LnumStr16_U64_Base16.ch.HashStrptr -inline u32 LnumStr16_U64_Base16_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr16_U64_Base16.ch.Init inline void ch_Init(algo::LnumStr16_U64_Base16 &parent) __attribute__((nothrow)); // always return constant 16 @@ -3305,8 +3503,6 @@ struct LnumStr1_U32 { // algo.LnumStr1_U32: number stored as ascii digits, left // Access string as array of chars // func:algo.LnumStr1_U32.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr1_U32& parent) __attribute__((nothrow)); -// func:algo.LnumStr1_U32.ch.HashStrptr -inline u32 LnumStr1_U32_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr1_U32.ch.Init inline void ch_Init(algo::LnumStr1_U32 &parent) __attribute__((nothrow)); // always return constant 1 @@ -3393,8 +3589,6 @@ struct LnumStr20_U64 { // algo.LnumStr20_U64: number stored as ascii digits, lef // Access string as array of chars // func:algo.LnumStr20_U64.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr20_U64& parent) __attribute__((nothrow)); -// func:algo.LnumStr20_U64.ch.HashStrptr -inline u32 LnumStr20_U64_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr20_U64.ch.Init inline void ch_Init(algo::LnumStr20_U64 &parent) __attribute__((nothrow)); // always return constant 20 @@ -3481,8 +3675,6 @@ struct LnumStr22_U64 { // algo.LnumStr22_U64: number stored as ascii digits, lef // Access string as array of chars // func:algo.LnumStr22_U64.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr22_U64& parent) __attribute__((nothrow)); -// func:algo.LnumStr22_U64.ch.HashStrptr -inline u32 LnumStr22_U64_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr22_U64.ch.Init inline void ch_Init(algo::LnumStr22_U64 &parent) __attribute__((nothrow)); // always return constant 22 @@ -3569,8 +3761,6 @@ struct LnumStr2_U32 { // algo.LnumStr2_U32: number stored as ascii digits, left // Access string as array of chars // func:algo.LnumStr2_U32.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr2_U32& parent) __attribute__((nothrow)); -// func:algo.LnumStr2_U32.ch.HashStrptr -inline u32 LnumStr2_U32_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr2_U32.ch.Init inline void ch_Init(algo::LnumStr2_U32 &parent) __attribute__((nothrow)); // always return constant 2 @@ -3657,8 +3847,6 @@ struct LnumStr3_U32 { // algo.LnumStr3_U32: number stored as ascii digits, left // Access string as array of chars // func:algo.LnumStr3_U32.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr3_U32& parent) __attribute__((nothrow)); -// func:algo.LnumStr3_U32.ch.HashStrptr -inline u32 LnumStr3_U32_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr3_U32.ch.Init inline void ch_Init(algo::LnumStr3_U32 &parent) __attribute__((nothrow)); // always return constant 3 @@ -3745,8 +3933,6 @@ struct LnumStr4_U32 { // algo.LnumStr4_U32: number stored as ascii digits, left // Access string as array of chars // func:algo.LnumStr4_U32.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr4_U32& parent) __attribute__((nothrow)); -// func:algo.LnumStr4_U32.ch.HashStrptr -inline u32 LnumStr4_U32_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr4_U32.ch.Init inline void ch_Init(algo::LnumStr4_U32 &parent) __attribute__((nothrow)); // always return constant 4 @@ -3833,8 +4019,6 @@ struct LnumStr5_U32 { // algo.LnumStr5_U32: number stored as ascii digits, left // Access string as array of chars // func:algo.LnumStr5_U32.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr5_U32& parent) __attribute__((nothrow)); -// func:algo.LnumStr5_U32.ch.HashStrptr -inline u32 LnumStr5_U32_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr5_U32.ch.Init inline void ch_Init(algo::LnumStr5_U32 &parent) __attribute__((nothrow)); // always return constant 5 @@ -3921,8 +4105,6 @@ struct LnumStr5_U32_Base36 { // algo.LnumStr5_U32_Base36: number stored as ascii // Access string as array of chars // func:algo.LnumStr5_U32_Base36.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr5_U32_Base36& parent) __attribute__((nothrow)); -// func:algo.LnumStr5_U32_Base36.ch.HashStrptr -inline u32 LnumStr5_U32_Base36_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr5_U32_Base36.ch.Init inline void ch_Init(algo::LnumStr5_U32_Base36 &parent) __attribute__((nothrow)); // always return constant 5 @@ -4009,8 +4191,6 @@ struct LnumStr6_U32 { // algo.LnumStr6_U32: number stored as ascii digits, left // Access string as array of chars // func:algo.LnumStr6_U32.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr6_U32& parent) __attribute__((nothrow)); -// func:algo.LnumStr6_U32.ch.HashStrptr -inline u32 LnumStr6_U32_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr6_U32.ch.Init inline void ch_Init(algo::LnumStr6_U32 &parent) __attribute__((nothrow)); // always return constant 6 @@ -4097,8 +4277,6 @@ struct LnumStr7_U32 { // algo.LnumStr7_U32: number stored as ascii digits, left // Access string as array of chars // func:algo.LnumStr7_U32.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr7_U32& parent) __attribute__((nothrow)); -// func:algo.LnumStr7_U32.ch.HashStrptr -inline u32 LnumStr7_U32_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr7_U32.ch.Init inline void ch_Init(algo::LnumStr7_U32 &parent) __attribute__((nothrow)); // always return constant 7 @@ -4185,8 +4363,6 @@ struct LnumStr7_U32_Base36 { // algo.LnumStr7_U32_Base36: number stored as ascii // Access string as array of chars // func:algo.LnumStr7_U32_Base36.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr7_U32_Base36& parent) __attribute__((nothrow)); -// func:algo.LnumStr7_U32_Base36.ch.HashStrptr -inline u32 LnumStr7_U32_Base36_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr7_U32_Base36.ch.Init inline void ch_Init(algo::LnumStr7_U32_Base36 &parent) __attribute__((nothrow)); // always return constant 7 @@ -4273,8 +4449,6 @@ struct LnumStr8_U32 { // algo.LnumStr8_U32: number stored as ascii digits, left // Access string as array of chars // func:algo.LnumStr8_U32.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr8_U32& parent) __attribute__((nothrow)); -// func:algo.LnumStr8_U32.ch.HashStrptr -inline u32 LnumStr8_U32_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr8_U32.ch.Init inline void ch_Init(algo::LnumStr8_U32 &parent) __attribute__((nothrow)); // always return constant 8 @@ -4361,8 +4535,6 @@ struct LnumStr8_U32_Base16 { // algo.LnumStr8_U32_Base16: number stored as ascii // Access string as array of chars // func:algo.LnumStr8_U32_Base16.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr8_U32_Base16& parent) __attribute__((nothrow)); -// func:algo.LnumStr8_U32_Base16.ch.HashStrptr -inline u32 LnumStr8_U32_Base16_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr8_U32_Base16.ch.Init inline void ch_Init(algo::LnumStr8_U32_Base16 &parent) __attribute__((nothrow)); // always return constant 8 @@ -4449,8 +4621,6 @@ struct LnumStr8_U64 { // algo.LnumStr8_U64: number stored as ascii digits, left // Access string as array of chars // func:algo.LnumStr8_U64.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr8_U64& parent) __attribute__((nothrow)); -// func:algo.LnumStr8_U64.ch.HashStrptr -inline u32 LnumStr8_U64_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr8_U64.ch.Init inline void ch_Init(algo::LnumStr8_U64 &parent) __attribute__((nothrow)); // always return constant 8 @@ -4537,8 +4707,6 @@ struct LnumStr9_U32 { // algo.LnumStr9_U32: number stored as ascii digits, left // Access string as array of chars // func:algo.LnumStr9_U32.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr9_U32& parent) __attribute__((nothrow)); -// func:algo.LnumStr9_U32.ch.HashStrptr -inline u32 LnumStr9_U32_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr9_U32.ch.Init inline void ch_Init(algo::LnumStr9_U32 &parent) __attribute__((nothrow)); // always return constant 9 @@ -4623,8 +4791,6 @@ struct LnumStr9_U64 { // algo.LnumStr9_U64: number stored as ascii digits, left // Access string as array of chars // func:algo.LnumStr9_U64.ch.Getary inline algo::aryptr ch_Getary(const algo::LnumStr9_U64& parent) __attribute__((nothrow)); -// func:algo.LnumStr9_U64.ch.HashStrptr -inline u32 LnumStr9_U64_Hash(u32 prev, const algo::strptr &str); // func:algo.LnumStr9_U64.ch.Init inline void ch_Init(algo::LnumStr9_U64 &parent) __attribute__((nothrow)); // always return constant 9 @@ -4711,8 +4877,6 @@ struct LspaceStr10 { // algo.LspaceStr10: string padded on the left with spaces // Access string as array of chars // func:algo.LspaceStr10.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr10& parent) __attribute__((nothrow)); -// func:algo.LspaceStr10.ch.HashStrptr -inline u32 LspaceStr10_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr10.ch.Init inline void ch_Init(algo::LspaceStr10 &parent) __attribute__((nothrow)); // always return constant 10 @@ -4779,8 +4943,6 @@ struct LspaceStr12 { // algo.LspaceStr12: string padded on the left with spaces // Access string as array of chars // func:algo.LspaceStr12.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr12& parent) __attribute__((nothrow)); -// func:algo.LspaceStr12.ch.HashStrptr -inline u32 LspaceStr12_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr12.ch.Init inline void ch_Init(algo::LspaceStr12 &parent) __attribute__((nothrow)); // always return constant 12 @@ -4847,8 +5009,6 @@ struct LspaceStr14 { // algo.LspaceStr14: string padded on the left with spaces // Access string as array of chars // func:algo.LspaceStr14.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr14& parent) __attribute__((nothrow)); -// func:algo.LspaceStr14.ch.HashStrptr -inline u32 LspaceStr14_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr14.ch.Init inline void ch_Init(algo::LspaceStr14 &parent) __attribute__((nothrow)); // always return constant 14 @@ -4915,8 +5075,6 @@ struct LspaceStr15 { // algo.LspaceStr15: string padded on the left with spaces // Access string as array of chars // func:algo.LspaceStr15.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr15& parent) __attribute__((nothrow)); -// func:algo.LspaceStr15.ch.HashStrptr -inline u32 LspaceStr15_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr15.ch.Init inline void ch_Init(algo::LspaceStr15 &parent) __attribute__((nothrow)); // always return constant 15 @@ -4981,8 +5139,6 @@ struct LspaceStr20_I64 { // algo.LspaceStr20_I64: number stored as ascii digits, // Access string as array of chars // func:algo.LspaceStr20_I64.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr20_I64& parent) __attribute__((nothrow)); -// func:algo.LspaceStr20_I64.ch.HashStrptr -inline u32 LspaceStr20_I64_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr20_I64.ch.Init inline void ch_Init(algo::LspaceStr20_I64 &parent) __attribute__((nothrow)); // always return constant 20 @@ -5069,8 +5225,6 @@ struct LspaceStr20_U64 { // algo.LspaceStr20_U64: number stored as ascii digits, // Access string as array of chars // func:algo.LspaceStr20_U64.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr20_U64& parent) __attribute__((nothrow)); -// func:algo.LspaceStr20_U64.ch.HashStrptr -inline u32 LspaceStr20_U64_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr20_U64.ch.Init inline void ch_Init(algo::LspaceStr20_U64 &parent) __attribute__((nothrow)); // always return constant 20 @@ -5157,8 +5311,6 @@ struct LspaceStr3 { // algo.LspaceStr3: string padded on the left with spaces // Access string as array of chars // func:algo.LspaceStr3.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr3& parent) __attribute__((nothrow)); -// func:algo.LspaceStr3.ch.HashStrptr -inline u32 LspaceStr3_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr3.ch.Init inline void ch_Init(algo::LspaceStr3 &parent) __attribute__((nothrow)); // always return constant 3 @@ -5225,8 +5377,6 @@ struct LspaceStr3_I16 { // algo.LspaceStr3_I16: number stored as ascii digits, l // Access string as array of chars // func:algo.LspaceStr3_I16.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr3_I16& parent) __attribute__((nothrow)); -// func:algo.LspaceStr3_I16.ch.HashStrptr -inline u32 LspaceStr3_I16_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr3_I16.ch.Init inline void ch_Init(algo::LspaceStr3_I16 &parent) __attribute__((nothrow)); // always return constant 3 @@ -5313,8 +5463,6 @@ struct LspaceStr4 { // algo.LspaceStr4: string padded on the left with spaces // Access string as array of chars // func:algo.LspaceStr4.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr4& parent) __attribute__((nothrow)); -// func:algo.LspaceStr4.ch.HashStrptr -inline u32 LspaceStr4_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr4.ch.Init inline void ch_Init(algo::LspaceStr4 &parent) __attribute__((nothrow)); // always return constant 4 @@ -5381,8 +5529,6 @@ struct LspaceStr5 { // algo.LspaceStr5: string padded on the left with spaces // Access string as array of chars // func:algo.LspaceStr5.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr5& parent) __attribute__((nothrow)); -// func:algo.LspaceStr5.ch.HashStrptr -inline u32 LspaceStr5_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr5.ch.Init inline void ch_Init(algo::LspaceStr5 &parent) __attribute__((nothrow)); // always return constant 5 @@ -5449,8 +5595,6 @@ struct LspaceStr5_I16 { // algo.LspaceStr5_I16: string padded on the left with s // Access string as array of chars // func:algo.LspaceStr5_I16.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr5_I16& parent) __attribute__((nothrow)); -// func:algo.LspaceStr5_I16.ch.HashStrptr -inline u32 LspaceStr5_I16_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr5_I16.ch.Init inline void ch_Init(algo::LspaceStr5_I16 &parent) __attribute__((nothrow)); // always return constant 5 @@ -5537,8 +5681,6 @@ struct LspaceStr6 { // algo.LspaceStr6: string padded on the left with spaces // Access string as array of chars // func:algo.LspaceStr6.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr6& parent) __attribute__((nothrow)); -// func:algo.LspaceStr6.ch.HashStrptr -inline u32 LspaceStr6_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr6.ch.Init inline void ch_Init(algo::LspaceStr6 &parent) __attribute__((nothrow)); // always return constant 6 @@ -5603,8 +5745,6 @@ struct LspaceStr6_U32 { // algo.LspaceStr6_U32: number stored as ascii digits, l // Access string as array of chars // func:algo.LspaceStr6_U32.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr6_U32& parent) __attribute__((nothrow)); -// func:algo.LspaceStr6_U32.ch.HashStrptr -inline u32 LspaceStr6_U32_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr6_U32.ch.Init inline void ch_Init(algo::LspaceStr6_U32 &parent) __attribute__((nothrow)); // always return constant 6 @@ -5689,8 +5829,6 @@ struct LspaceStr7_I32_Base36 { // algo.LspaceStr7_I32_Base36: number stored as a // Access string as array of chars // func:algo.LspaceStr7_I32_Base36.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr7_I32_Base36& parent) __attribute__((nothrow)); -// func:algo.LspaceStr7_I32_Base36.ch.HashStrptr -inline u32 LspaceStr7_I32_Base36_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr7_I32_Base36.ch.Init inline void ch_Init(algo::LspaceStr7_I32_Base36 &parent) __attribute__((nothrow)); // always return constant 7 @@ -5777,8 +5915,6 @@ struct LspaceStr8 { // algo.LspaceStr8: string padded on the left with spaces // Access string as array of chars // func:algo.LspaceStr8.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr8& parent) __attribute__((nothrow)); -// func:algo.LspaceStr8.ch.HashStrptr -inline u32 LspaceStr8_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr8.ch.Init inline void ch_Init(algo::LspaceStr8 &parent) __attribute__((nothrow)); // always return constant 8 @@ -5845,8 +5981,6 @@ struct LspaceStr9 { // algo.LspaceStr9: string padded on the left with spaces // Access string as array of chars // func:algo.LspaceStr9.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr9& parent) __attribute__((nothrow)); -// func:algo.LspaceStr9.ch.HashStrptr -inline u32 LspaceStr9_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr9.ch.Init inline void ch_Init(algo::LspaceStr9 &parent) __attribute__((nothrow)); // always return constant 9 @@ -6109,8 +6243,6 @@ struct RnullStr1 { // algo.RnullStr1: fixed-length string padded on the right wi // Access string as array of chars // func:algo.RnullStr1.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr1& parent) __attribute__((nothrow)); -// func:algo.RnullStr1.ch.HashStrptr -inline u32 RnullStr1_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr1.ch.Init inline void ch_Init(algo::RnullStr1 &parent) __attribute__((nothrow)); // always return constant 1 @@ -6190,8 +6322,6 @@ struct RnullStr10 { // algo.RnullStr10: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr10.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr10& parent) __attribute__((nothrow)); -// func:algo.RnullStr10.ch.HashStrptr -inline u32 RnullStr10_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr10.ch.Init inline void ch_Init(algo::RnullStr10 &parent) __attribute__((nothrow)); // always return constant 10 @@ -6259,8 +6389,6 @@ struct RnullStr100 { // algo.RnullStr100: fixed-length string padded on the righ // Access string as array of chars // func:algo.RnullStr100.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr100& parent) __attribute__((nothrow)); -// func:algo.RnullStr100.ch.HashStrptr -inline u32 RnullStr100_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr100.ch.Init inline void ch_Init(algo::RnullStr100 &parent) __attribute__((nothrow)); // always return constant 100 @@ -6340,8 +6468,6 @@ struct RnullStr1000 { // algo.RnullStr1000: fixed-length string padded on the ri // Access string as array of chars // func:algo.RnullStr1000.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr1000& parent) __attribute__((nothrow)); -// func:algo.RnullStr1000.ch.HashStrptr -inline u32 RnullStr1000_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr1000.ch.Init inline void ch_Init(algo::RnullStr1000 &parent) __attribute__((nothrow)); // always return constant 1000 @@ -6421,8 +6547,6 @@ struct RnullStr11 { // algo.RnullStr11: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr11.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr11& parent) __attribute__((nothrow)); -// func:algo.RnullStr11.ch.HashStrptr -inline u32 RnullStr11_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr11.ch.Init inline void ch_Init(algo::RnullStr11 &parent) __attribute__((nothrow)); // always return constant 11 @@ -6502,8 +6626,6 @@ struct RnullStr12 { // algo.RnullStr12: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr12.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr12& parent) __attribute__((nothrow)); -// func:algo.RnullStr12.ch.HashStrptr -inline u32 RnullStr12_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr12.ch.Init inline void ch_Init(algo::RnullStr12 &parent) __attribute__((nothrow)); // always return constant 12 @@ -6583,8 +6705,6 @@ struct RnullStr129 { // algo.RnullStr129: fixed-length string padded on the righ // Access string as array of chars // func:algo.RnullStr129.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr129& parent) __attribute__((nothrow)); -// func:algo.RnullStr129.ch.HashStrptr -inline u32 RnullStr129_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr129.ch.Init inline void ch_Init(algo::RnullStr129 &parent) __attribute__((nothrow)); // always return constant 129 @@ -6664,8 +6784,6 @@ struct RnullStr13 { // algo.RnullStr13: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr13.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr13& parent) __attribute__((nothrow)); -// func:algo.RnullStr13.ch.HashStrptr -inline u32 RnullStr13_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr13.ch.Init inline void ch_Init(algo::RnullStr13 &parent) __attribute__((nothrow)); // always return constant 13 @@ -6745,8 +6863,6 @@ struct RnullStr14 { // algo.RnullStr14: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr14.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr14& parent) __attribute__((nothrow)); -// func:algo.RnullStr14.ch.HashStrptr -inline u32 RnullStr14_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr14.ch.Init inline void ch_Init(algo::RnullStr14 &parent) __attribute__((nothrow)); // always return constant 14 @@ -6826,8 +6942,6 @@ struct RnullStr15 { // algo.RnullStr15: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr15.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr15& parent) __attribute__((nothrow)); -// func:algo.RnullStr15.ch.HashStrptr -inline u32 RnullStr15_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr15.ch.Init inline void ch_Init(algo::RnullStr15 &parent) __attribute__((nothrow)); // always return constant 15 @@ -6907,8 +7021,6 @@ struct RnullStr151 { // algo.RnullStr151: fixed-length string padded on the righ // Access string as array of chars // func:algo.RnullStr151.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr151& parent) __attribute__((nothrow)); -// func:algo.RnullStr151.ch.HashStrptr -inline u32 RnullStr151_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr151.ch.Init inline void ch_Init(algo::RnullStr151 &parent) __attribute__((nothrow)); // always return constant 151 @@ -6976,8 +7088,6 @@ struct RnullStr16 { // algo.RnullStr16: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr16.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr16& parent) __attribute__((nothrow)); -// func:algo.RnullStr16.ch.HashStrptr -inline u32 RnullStr16_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr16.ch.Init inline void ch_Init(algo::RnullStr16 &parent) __attribute__((nothrow)); // always return constant 16 @@ -7057,8 +7167,6 @@ struct RnullStr17 { // algo.RnullStr17: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr17.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr17& parent) __attribute__((nothrow)); -// func:algo.RnullStr17.ch.HashStrptr -inline u32 RnullStr17_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr17.ch.Init inline void ch_Init(algo::RnullStr17 &parent) __attribute__((nothrow)); // always return constant 17 @@ -7138,8 +7246,6 @@ struct RnullStr18 { // algo.RnullStr18: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr18.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr18& parent) __attribute__((nothrow)); -// func:algo.RnullStr18.ch.HashStrptr -inline u32 RnullStr18_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr18.ch.Init inline void ch_Init(algo::RnullStr18 &parent) __attribute__((nothrow)); // always return constant 18 @@ -7207,8 +7313,6 @@ struct RnullStr19 { // algo.RnullStr19: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr19.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr19& parent) __attribute__((nothrow)); -// func:algo.RnullStr19.ch.HashStrptr -inline u32 RnullStr19_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr19.ch.Init inline void ch_Init(algo::RnullStr19 &parent) __attribute__((nothrow)); // always return constant 19 @@ -7288,8 +7392,6 @@ struct RnullStr2 { // algo.RnullStr2: fixed-length string padded on the right wi // Access string as array of chars // func:algo.RnullStr2.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr2& parent) __attribute__((nothrow)); -// func:algo.RnullStr2.ch.HashStrptr -inline u32 RnullStr2_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr2.ch.Init inline void ch_Init(algo::RnullStr2 &parent) __attribute__((nothrow)); // always return constant 2 @@ -7369,8 +7471,6 @@ struct RnullStr20 { // algo.RnullStr20: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr20.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr20& parent) __attribute__((nothrow)); -// func:algo.RnullStr20.ch.HashStrptr -inline u32 RnullStr20_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr20.ch.Init inline void ch_Init(algo::RnullStr20 &parent) __attribute__((nothrow)); // always return constant 20 @@ -7438,8 +7538,6 @@ struct RnullStr21 { // algo.RnullStr21: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr21.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr21& parent) __attribute__((nothrow)); -// func:algo.RnullStr21.ch.HashStrptr -inline u32 RnullStr21_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr21.ch.Init inline void ch_Init(algo::RnullStr21 &parent) __attribute__((nothrow)); // always return constant 21 @@ -7519,8 +7617,6 @@ struct RnullStr24 { // algo.RnullStr24: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr24.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr24& parent) __attribute__((nothrow)); -// func:algo.RnullStr24.ch.HashStrptr -inline u32 RnullStr24_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr24.ch.Init inline void ch_Init(algo::RnullStr24 &parent) __attribute__((nothrow)); // always return constant 24 @@ -7600,8 +7696,6 @@ struct RnullStr25 { // algo.RnullStr25: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr25.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr25& parent) __attribute__((nothrow)); -// func:algo.RnullStr25.ch.HashStrptr -inline u32 RnullStr25_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr25.ch.Init inline void ch_Init(algo::RnullStr25 &parent) __attribute__((nothrow)); // always return constant 25 @@ -7681,8 +7775,6 @@ struct RnullStr28 { // algo.RnullStr28: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr28.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr28& parent) __attribute__((nothrow)); -// func:algo.RnullStr28.ch.HashStrptr -inline u32 RnullStr28_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr28.ch.Init inline void ch_Init(algo::RnullStr28 &parent) __attribute__((nothrow)); // always return constant 28 @@ -7762,8 +7854,6 @@ struct RnullStr3 { // algo.RnullStr3: fixed-length string padded on the right wi // Access string as array of chars // func:algo.RnullStr3.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr3& parent) __attribute__((nothrow)); -// func:algo.RnullStr3.ch.HashStrptr -inline u32 RnullStr3_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr3.ch.Init inline void ch_Init(algo::RnullStr3 &parent) __attribute__((nothrow)); // always return constant 3 @@ -7831,8 +7921,6 @@ struct RnullStr30 { // algo.RnullStr30: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr30.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr30& parent) __attribute__((nothrow)); -// func:algo.RnullStr30.ch.HashStrptr -inline u32 RnullStr30_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr30.ch.Init inline void ch_Init(algo::RnullStr30 &parent) __attribute__((nothrow)); // always return constant 30 @@ -7912,8 +8000,6 @@ struct RnullStr32 { // algo.RnullStr32: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr32.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr32& parent) __attribute__((nothrow)); -// func:algo.RnullStr32.ch.HashStrptr -inline u32 RnullStr32_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr32.ch.Init inline void ch_Init(algo::RnullStr32 &parent) __attribute__((nothrow)); // always return constant 32 @@ -7993,8 +8079,6 @@ struct RnullStr33 { // algo.RnullStr33: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr33.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr33& parent) __attribute__((nothrow)); -// func:algo.RnullStr33.ch.HashStrptr -inline u32 RnullStr33_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr33.ch.Init inline void ch_Init(algo::RnullStr33 &parent) __attribute__((nothrow)); // always return constant 33 @@ -8072,8 +8156,6 @@ struct RnullStr35 { // algo.RnullStr35: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr35.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr35& parent) __attribute__((nothrow)); -// func:algo.RnullStr35.ch.HashStrptr -inline u32 RnullStr35_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr35.ch.Init inline void ch_Init(algo::RnullStr35 &parent) __attribute__((nothrow)); // always return constant 35 @@ -8153,8 +8235,6 @@ struct RnullStr36 { // algo.RnullStr36: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr36.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr36& parent) __attribute__((nothrow)); -// func:algo.RnullStr36.ch.HashStrptr -inline u32 RnullStr36_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr36.ch.Init inline void ch_Init(algo::RnullStr36 &parent) __attribute__((nothrow)); // always return constant 36 @@ -8222,8 +8302,6 @@ struct RnullStr4 { // algo.RnullStr4: fixed-length string padded on the right wi // Access string as array of chars // func:algo.RnullStr4.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr4& parent) __attribute__((nothrow)); -// func:algo.RnullStr4.ch.HashStrptr -inline u32 RnullStr4_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr4.ch.Init inline void ch_Init(algo::RnullStr4 &parent) __attribute__((nothrow)); // always return constant 4 @@ -8303,8 +8381,6 @@ struct RnullStr40 { // algo.RnullStr40: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr40.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr40& parent) __attribute__((nothrow)); -// func:algo.RnullStr40.ch.HashStrptr -inline u32 RnullStr40_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr40.ch.Init inline void ch_Init(algo::RnullStr40 &parent) __attribute__((nothrow)); // always return constant 40 @@ -8384,8 +8460,6 @@ struct RnullStr41 { // algo.RnullStr41: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr41.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr41& parent) __attribute__((nothrow)); -// func:algo.RnullStr41.ch.HashStrptr -inline u32 RnullStr41_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr41.ch.Init inline void ch_Init(algo::RnullStr41 &parent) __attribute__((nothrow)); // always return constant 41 @@ -8453,8 +8527,6 @@ struct RnullStr43 { // algo.RnullStr43: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr43.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr43& parent) __attribute__((nothrow)); -// func:algo.RnullStr43.ch.HashStrptr -inline u32 RnullStr43_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr43.ch.Init inline void ch_Init(algo::RnullStr43 &parent) __attribute__((nothrow)); // always return constant 43 @@ -8522,8 +8594,6 @@ struct RnullStr44 { // algo.RnullStr44: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr44.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr44& parent) __attribute__((nothrow)); -// func:algo.RnullStr44.ch.HashStrptr -inline u32 RnullStr44_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr44.ch.Init inline void ch_Init(algo::RnullStr44 &parent) __attribute__((nothrow)); // always return constant 44 @@ -8591,8 +8661,6 @@ struct RnullStr48 { // algo.RnullStr48: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr48.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr48& parent) __attribute__((nothrow)); -// func:algo.RnullStr48.ch.HashStrptr -inline u32 RnullStr48_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr48.ch.Init inline void ch_Init(algo::RnullStr48 &parent) __attribute__((nothrow)); // always return constant 48 @@ -8660,8 +8728,6 @@ struct RnullStr5 { // algo.RnullStr5: fixed-length string padded on the right wi // Access string as array of chars // func:algo.RnullStr5.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr5& parent) __attribute__((nothrow)); -// func:algo.RnullStr5.ch.HashStrptr -inline u32 RnullStr5_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr5.ch.Init inline void ch_Init(algo::RnullStr5 &parent) __attribute__((nothrow)); // always return constant 5 @@ -8729,8 +8795,6 @@ struct RnullStr50 { // algo.RnullStr50: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr50.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr50& parent) __attribute__((nothrow)); -// func:algo.RnullStr50.ch.HashStrptr -inline u32 RnullStr50_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr50.ch.Init inline void ch_Init(algo::RnullStr50 &parent) __attribute__((nothrow)); // always return constant 50 @@ -8810,8 +8874,6 @@ struct RnullStr54 { // algo.RnullStr54: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr54.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr54& parent) __attribute__((nothrow)); -// func:algo.RnullStr54.ch.HashStrptr -inline u32 RnullStr54_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr54.ch.Init inline void ch_Init(algo::RnullStr54 &parent) __attribute__((nothrow)); // always return constant 54 @@ -8879,8 +8941,6 @@ struct RnullStr55 { // algo.RnullStr55: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr55.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr55& parent) __attribute__((nothrow)); -// func:algo.RnullStr55.ch.HashStrptr -inline u32 RnullStr55_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr55.ch.Init inline void ch_Init(algo::RnullStr55 &parent) __attribute__((nothrow)); // always return constant 55 @@ -8960,8 +9020,6 @@ struct RnullStr6 { // algo.RnullStr6: fixed-length string padded on the right wi // Access string as array of chars // func:algo.RnullStr6.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr6& parent) __attribute__((nothrow)); -// func:algo.RnullStr6.ch.HashStrptr -inline u32 RnullStr6_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr6.ch.Init inline void ch_Init(algo::RnullStr6 &parent) __attribute__((nothrow)); // always return constant 6 @@ -9041,8 +9099,6 @@ struct RnullStr60 { // algo.RnullStr60: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr60.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr60& parent) __attribute__((nothrow)); -// func:algo.RnullStr60.ch.HashStrptr -inline u32 RnullStr60_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr60.ch.Init inline void ch_Init(algo::RnullStr60 &parent) __attribute__((nothrow)); // always return constant 60 @@ -9122,8 +9178,6 @@ struct RnullStr62 { // algo.RnullStr62: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr62.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr62& parent) __attribute__((nothrow)); -// func:algo.RnullStr62.ch.HashStrptr -inline u32 RnullStr62_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr62.ch.Init inline void ch_Init(algo::RnullStr62 &parent) __attribute__((nothrow)); // always return constant 62 @@ -9191,8 +9245,6 @@ struct RnullStr66 { // algo.RnullStr66: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr66.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr66& parent) __attribute__((nothrow)); -// func:algo.RnullStr66.ch.HashStrptr -inline u32 RnullStr66_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr66.ch.Init inline void ch_Init(algo::RnullStr66 &parent) __attribute__((nothrow)); // always return constant 66 @@ -9264,8 +9316,6 @@ struct RnullStr6_U32 { // algo.RnullStr6_U32: number stored as ascii digits, rig // Access string as array of chars // func:algo.RnullStr6_U32.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr6_U32& parent) __attribute__((nothrow)); -// func:algo.RnullStr6_U32.ch.HashStrptr -inline u32 RnullStr6_U32_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr6_U32.ch.Init inline void ch_Init(algo::RnullStr6_U32 &parent) __attribute__((nothrow)); // always return constant 6 @@ -9360,8 +9410,6 @@ struct RnullStr7 { // algo.RnullStr7: fixed-length string padded on the right wi // Access string as array of chars // func:algo.RnullStr7.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr7& parent) __attribute__((nothrow)); -// func:algo.RnullStr7.ch.HashStrptr -inline u32 RnullStr7_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr7.ch.Init inline void ch_Init(algo::RnullStr7 &parent) __attribute__((nothrow)); // always return constant 7 @@ -9429,8 +9477,6 @@ struct RnullStr8 { // algo.RnullStr8: fixed-length string padded on the right wi // Access string as array of chars // func:algo.RnullStr8.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr8& parent) __attribute__((nothrow)); -// func:algo.RnullStr8.ch.HashStrptr -inline u32 RnullStr8_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr8.ch.Init inline void ch_Init(algo::RnullStr8 &parent) __attribute__((nothrow)); // always return constant 8 @@ -9498,8 +9544,6 @@ struct RnullStr80 { // algo.RnullStr80: fixed-length string padded on the right // Access string as array of chars // func:algo.RnullStr80.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr80& parent) __attribute__((nothrow)); -// func:algo.RnullStr80.ch.HashStrptr -inline u32 RnullStr80_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr80.ch.Init inline void ch_Init(algo::RnullStr80 &parent) __attribute__((nothrow)); // always return constant 80 @@ -9579,8 +9623,6 @@ struct RnullStr9 { // algo.RnullStr9: fixed-length string padded on the right wi // Access string as array of chars // func:algo.RnullStr9.ch.Getary inline algo::aryptr ch_Getary(const algo::RnullStr9& parent) __attribute__((nothrow)); -// func:algo.RnullStr9.ch.HashStrptr -inline u32 RnullStr9_Hash(u32 prev, const algo::strptr &str); // func:algo.RnullStr9.ch.Init inline void ch_Init(algo::RnullStr9 &parent) __attribute__((nothrow)); // always return constant 9 @@ -9652,8 +9694,6 @@ struct RspaceStr10 { // algo.RspaceStr10: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr10.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr10& parent) __attribute__((nothrow)); -// func:algo.RspaceStr10.ch.HashStrptr -inline u32 RspaceStr10_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr10.ch.Init inline void ch_Init(algo::RspaceStr10 &parent) __attribute__((nothrow)); // always return constant 10 @@ -9720,8 +9760,6 @@ struct RspaceStr100 { // algo.RspaceStr100: fixed-length string padded on the ri // Access string as array of chars // func:algo.RspaceStr100.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr100& parent) __attribute__((nothrow)); -// func:algo.RspaceStr100.ch.HashStrptr -inline u32 RspaceStr100_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr100.ch.Init inline void ch_Init(algo::RspaceStr100 &parent) __attribute__((nothrow)); // always return constant 100 @@ -9788,8 +9826,6 @@ struct RspaceStr11 { // algo.RspaceStr11: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr11.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr11& parent) __attribute__((nothrow)); -// func:algo.RspaceStr11.ch.HashStrptr -inline u32 RspaceStr11_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr11.ch.Init inline void ch_Init(algo::RspaceStr11 &parent) __attribute__((nothrow)); // always return constant 11 @@ -9856,8 +9892,6 @@ struct RspaceStr12 { // algo.RspaceStr12: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr12.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr12& parent) __attribute__((nothrow)); -// func:algo.RspaceStr12.ch.HashStrptr -inline u32 RspaceStr12_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr12.ch.Init inline void ch_Init(algo::RspaceStr12 &parent) __attribute__((nothrow)); // always return constant 12 @@ -9924,8 +9958,6 @@ struct RspaceStr128 { // algo.RspaceStr128: fixed-length string padded on the ri // Access string as array of chars // func:algo.RspaceStr128.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr128& parent) __attribute__((nothrow)); -// func:algo.RspaceStr128.ch.HashStrptr -inline u32 RspaceStr128_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr128.ch.Init inline void ch_Init(algo::RspaceStr128 &parent) __attribute__((nothrow)); // always return constant 128 @@ -9992,8 +10024,6 @@ struct RspaceStr14 { // algo.RspaceStr14: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr14.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr14& parent) __attribute__((nothrow)); -// func:algo.RspaceStr14.ch.HashStrptr -inline u32 RspaceStr14_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr14.ch.Init inline void ch_Init(algo::RspaceStr14 &parent) __attribute__((nothrow)); // always return constant 14 @@ -10060,8 +10090,6 @@ struct RspaceStr15 { // algo.RspaceStr15: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr15.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr15& parent) __attribute__((nothrow)); -// func:algo.RspaceStr15.ch.HashStrptr -inline u32 RspaceStr15_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr15.ch.Init inline void ch_Init(algo::RspaceStr15 &parent) __attribute__((nothrow)); // always return constant 15 @@ -10124,8 +10152,6 @@ struct RspaceStr16 { // algo.RspaceStr16: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr16.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr16& parent) __attribute__((nothrow)); -// func:algo.RspaceStr16.ch.HashStrptr -inline u32 RspaceStr16_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr16.ch.Init inline void ch_Init(algo::RspaceStr16 &parent) __attribute__((nothrow)); // always return constant 16 @@ -10197,8 +10223,6 @@ struct RspaceStr18 { // algo.RspaceStr18: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr18.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr18& parent) __attribute__((nothrow)); -// func:algo.RspaceStr18.ch.HashStrptr -inline u32 RspaceStr18_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr18.ch.Init inline void ch_Init(algo::RspaceStr18 &parent) __attribute__((nothrow)); // always return constant 18 @@ -10265,8 +10289,6 @@ struct RspaceStr2 { // algo.RspaceStr2: fixed-length string padded on the right // Access string as array of chars // func:algo.RspaceStr2.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr2& parent) __attribute__((nothrow)); -// func:algo.RspaceStr2.ch.HashStrptr -inline u32 RspaceStr2_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr2.ch.Init inline void ch_Init(algo::RspaceStr2 &parent) __attribute__((nothrow)); // always return constant 2 @@ -10333,8 +10355,6 @@ struct RspaceStr20 { // algo.RspaceStr20: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr20.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr20& parent) __attribute__((nothrow)); -// func:algo.RspaceStr20.ch.HashStrptr -inline u32 RspaceStr20_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr20.ch.Init inline void ch_Init(algo::RspaceStr20 &parent) __attribute__((nothrow)); // always return constant 20 @@ -10401,8 +10421,6 @@ struct RspaceStr200 { // algo.RspaceStr200: fixed-length string padded on the ri // Access string as array of chars // func:algo.RspaceStr200.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr200& parent) __attribute__((nothrow)); -// func:algo.RspaceStr200.ch.HashStrptr -inline u32 RspaceStr200_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr200.ch.Init inline void ch_Init(algo::RspaceStr200 &parent) __attribute__((nothrow)); // always return constant 200 @@ -10422,22 +10440,22 @@ bool ch_ReadStrptrMaybe(algo::RspaceStr200& parent, algo::strptr void ch_SetStrptr(algo::RspaceStr200& parent, const algo::strptr& rhs) __attribute__((nothrow)); // func:algo.RspaceStr200..Hash -u32 RspaceStr200_Hash(u32 prev, const algo::RspaceStr200& rhs) __attribute__((nothrow)); +u32 RspaceStr200_Hash(u32 prev, algo::RspaceStr200 rhs) __attribute__((nothrow)); // Read fields of algo::RspaceStr200 from an ascii string. // The format of the string is the format of the algo::RspaceStr200's only field // func:algo.RspaceStr200..ReadStrptrMaybe bool RspaceStr200_ReadStrptrMaybe(algo::RspaceStr200 &parent, algo::strptr in_str) __attribute__((nothrow)); // func:algo.RspaceStr200..Cmp -inline i32 RspaceStr200_Cmp(algo::RspaceStr200& lhs, algo::RspaceStr200& rhs) __attribute__((nothrow)); +inline i32 RspaceStr200_Cmp(algo::RspaceStr200 lhs, algo::RspaceStr200 rhs) __attribute__((nothrow)); // Set all fields to initial values. // func:algo.RspaceStr200..Init inline void RspaceStr200_Init(algo::RspaceStr200& parent); // func:algo.RspaceStr200..Eq -inline bool RspaceStr200_Eq(algo::RspaceStr200& lhs, algo::RspaceStr200& rhs) __attribute__((nothrow)); +inline bool RspaceStr200_Eq(algo::RspaceStr200 lhs, algo::RspaceStr200 rhs) __attribute__((nothrow)); // print string representation of ROW to string STR // cfmt:algo.RspaceStr200.String printfmt:Raw // func:algo.RspaceStr200..Print -void RspaceStr200_Print(algo::RspaceStr200& row, algo::cstring& str) __attribute__((nothrow)); +void RspaceStr200_Print(algo::RspaceStr200 row, algo::cstring& str) __attribute__((nothrow)); // --- algo.RspaceStr21 #pragma pack(push,1) @@ -10469,8 +10487,6 @@ struct RspaceStr21 { // algo.RspaceStr21: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr21.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr21& parent) __attribute__((nothrow)); -// func:algo.RspaceStr21.ch.HashStrptr -inline u32 RspaceStr21_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr21.ch.Init inline void ch_Init(algo::RspaceStr21 &parent) __attribute__((nothrow)); // always return constant 21 @@ -10533,8 +10549,6 @@ struct RspaceStr24 { // algo.RspaceStr24: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr24.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr24& parent) __attribute__((nothrow)); -// func:algo.RspaceStr24.ch.HashStrptr -inline u32 RspaceStr24_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr24.ch.Init inline void ch_Init(algo::RspaceStr24 &parent) __attribute__((nothrow)); // always return constant 24 @@ -10606,8 +10620,6 @@ struct RspaceStr240 { // algo.RspaceStr240: fixed-length string padded on the ri // Access string as array of chars // func:algo.RspaceStr240.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr240& parent) __attribute__((nothrow)); -// func:algo.RspaceStr240.ch.HashStrptr -inline u32 RspaceStr240_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr240.ch.Init inline void ch_Init(algo::RspaceStr240 &parent) __attribute__((nothrow)); // always return constant 240 @@ -10670,8 +10682,6 @@ struct RspaceStr25 { // algo.RspaceStr25: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr25.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr25& parent) __attribute__((nothrow)); -// func:algo.RspaceStr25.ch.HashStrptr -inline u32 RspaceStr25_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr25.ch.Init inline void ch_Init(algo::RspaceStr25 &parent) __attribute__((nothrow)); // always return constant 25 @@ -10743,8 +10753,6 @@ struct RspaceStr26 { // algo.RspaceStr26: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr26.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr26& parent) __attribute__((nothrow)); -// func:algo.RspaceStr26.ch.HashStrptr -inline u32 RspaceStr26_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr26.ch.Init inline void ch_Init(algo::RspaceStr26 &parent) __attribute__((nothrow)); // always return constant 26 @@ -10811,8 +10819,6 @@ struct RspaceStr3 { // algo.RspaceStr3: fixed-length string padded on the right // Access string as array of chars // func:algo.RspaceStr3.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr3& parent) __attribute__((nothrow)); -// func:algo.RspaceStr3.ch.HashStrptr -inline u32 RspaceStr3_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr3.ch.Init inline void ch_Init(algo::RspaceStr3 &parent) __attribute__((nothrow)); // always return constant 3 @@ -10879,8 +10885,6 @@ struct RspaceStr31 { // algo.RspaceStr31: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr31.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr31& parent) __attribute__((nothrow)); -// func:algo.RspaceStr31.ch.HashStrptr -inline u32 RspaceStr31_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr31.ch.Init inline void ch_Init(algo::RspaceStr31 &parent) __attribute__((nothrow)); // always return constant 31 @@ -10947,8 +10951,6 @@ struct RspaceStr32 { // algo.RspaceStr32: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr32.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr32& parent) __attribute__((nothrow)); -// func:algo.RspaceStr32.ch.HashStrptr -inline u32 RspaceStr32_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr32.ch.Init inline void ch_Init(algo::RspaceStr32 &parent) __attribute__((nothrow)); // always return constant 32 @@ -11015,8 +11017,6 @@ struct RspaceStr4 { // algo.RspaceStr4: fixed-length string padded on the right // Access string as array of chars // func:algo.RspaceStr4.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr4& parent) __attribute__((nothrow)); -// func:algo.RspaceStr4.ch.HashStrptr -inline u32 RspaceStr4_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr4.ch.Init inline void ch_Init(algo::RspaceStr4 &parent) __attribute__((nothrow)); // always return constant 4 @@ -11079,8 +11079,6 @@ struct RspaceStr40 { // algo.RspaceStr40: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr40.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr40& parent) __attribute__((nothrow)); -// func:algo.RspaceStr40.ch.HashStrptr -inline u32 RspaceStr40_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr40.ch.Init inline void ch_Init(algo::RspaceStr40 &parent) __attribute__((nothrow)); // always return constant 40 @@ -11147,8 +11145,6 @@ struct RspaceStr5 { // algo.RspaceStr5: fixed-length string padded on the right // Access string as array of chars // func:algo.RspaceStr5.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr5& parent) __attribute__((nothrow)); -// func:algo.RspaceStr5.ch.HashStrptr -inline u32 RspaceStr5_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr5.ch.Init inline void ch_Init(algo::RspaceStr5 &parent) __attribute__((nothrow)); // always return constant 5 @@ -11215,8 +11211,6 @@ struct RspaceStr50 { // algo.RspaceStr50: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr50.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr50& parent) __attribute__((nothrow)); -// func:algo.RspaceStr50.ch.HashStrptr -inline u32 RspaceStr50_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr50.ch.Init inline void ch_Init(algo::RspaceStr50 &parent) __attribute__((nothrow)); // always return constant 50 @@ -11291,8 +11285,6 @@ struct RspaceStr6 { // algo.RspaceStr6: fixed-length string padded on the right // Access string as array of chars // func:algo.RspaceStr6.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr6& parent) __attribute__((nothrow)); -// func:algo.RspaceStr6.ch.HashStrptr -inline u32 RspaceStr6_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr6.ch.Init inline void ch_Init(algo::RspaceStr6 &parent) __attribute__((nothrow)); // always return constant 6 @@ -11364,8 +11356,6 @@ struct RspaceStr64 { // algo.RspaceStr64: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr64.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr64& parent) __attribute__((nothrow)); -// func:algo.RspaceStr64.ch.HashStrptr -inline u32 RspaceStr64_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr64.ch.Init inline void ch_Init(algo::RspaceStr64 &parent) __attribute__((nothrow)); // always return constant 64 @@ -11430,8 +11420,6 @@ struct RspaceStr7 { // algo.RspaceStr7: fixed-length string padded on the right // Access string as array of chars // func:algo.RspaceStr7.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr7& parent) __attribute__((nothrow)); -// func:algo.RspaceStr7.ch.HashStrptr -inline u32 RspaceStr7_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr7.ch.Init inline void ch_Init(algo::RspaceStr7 &parent) __attribute__((nothrow)); // always return constant 7 @@ -11498,8 +11486,6 @@ struct RspaceStr75 { // algo.RspaceStr75: fixed-length string padded on the righ // Access string as array of chars // func:algo.RspaceStr75.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr75& parent) __attribute__((nothrow)); -// func:algo.RspaceStr75.ch.HashStrptr -inline u32 RspaceStr75_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr75.ch.Init inline void ch_Init(algo::RspaceStr75 &parent) __attribute__((nothrow)); // always return constant 75 @@ -11562,8 +11548,6 @@ struct RspaceStr8 { // algo.RspaceStr8: fixed-length string padded on the right // Access string as array of chars // func:algo.RspaceStr8.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr8& parent) __attribute__((nothrow)); -// func:algo.RspaceStr8.ch.HashStrptr -inline u32 RspaceStr8_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr8.ch.Init inline void ch_Init(algo::RspaceStr8 &parent) __attribute__((nothrow)); // always return constant 8 @@ -11635,8 +11619,6 @@ struct RspaceStr9 { // algo.RspaceStr9: fixed-length string padded on the right // Access string as array of chars // func:algo.RspaceStr9.ch.Getary inline algo::aryptr ch_Getary(const algo::RspaceStr9& parent) __attribute__((nothrow)); -// func:algo.RspaceStr9.ch.HashStrptr -inline u32 RspaceStr9_Hash(u32 prev, const algo::strptr &str); // func:algo.RspaceStr9.ch.Init inline void ch_Init(algo::RspaceStr9 &parent) __attribute__((nothrow)); // always return constant 9 @@ -11869,8 +11851,6 @@ inline void ch_AddStrptr(algo::Smallstr1& parent, algo::strptr str) __a // Access string as array of chars // func:algo.Smallstr1.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr1& parent) __attribute__((nothrow)); -// func:algo.Smallstr1.ch.HashStrptr -inline u32 Smallstr1_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr1.ch.Init inline void ch_Init(algo::Smallstr1 &parent) __attribute__((nothrow)); // always return constant 1 @@ -11948,8 +11928,6 @@ inline void ch_AddStrptr(algo::Smallstr10& parent, algo::strptr str) __ // Access string as array of chars // func:algo.Smallstr10.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr10& parent) __attribute__((nothrow)); -// func:algo.Smallstr10.ch.HashStrptr -inline u32 Smallstr10_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr10.ch.Init inline void ch_Init(algo::Smallstr10 &parent) __attribute__((nothrow)); // always return constant 10 @@ -12025,8 +12003,6 @@ inline void ch_AddStrptr(algo::Smallstr16& parent, algo::strptr str) __ // Access string as array of chars // func:algo.Smallstr16.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr16& parent) __attribute__((nothrow)); -// func:algo.Smallstr16.ch.HashStrptr -inline u32 Smallstr16_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr16.ch.Init inline void ch_Init(algo::Smallstr16 &parent) __attribute__((nothrow)); // always return constant 16 @@ -12102,8 +12078,6 @@ inline void ch_AddStrptr(algo::Smallstr2& parent, algo::strptr str) __a // Access string as array of chars // func:algo.Smallstr2.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr2& parent) __attribute__((nothrow)); -// func:algo.Smallstr2.ch.HashStrptr -inline u32 Smallstr2_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr2.ch.Init inline void ch_Init(algo::Smallstr2 &parent) __attribute__((nothrow)); // always return constant 2 @@ -12189,8 +12163,6 @@ inline void ch_AddStrptr(algo::Smallstr20& parent, algo::strptr str) __ // Access string as array of chars // func:algo.Smallstr20.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr20& parent) __attribute__((nothrow)); -// func:algo.Smallstr20.ch.HashStrptr -inline u32 Smallstr20_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr20.ch.Init inline void ch_Init(algo::Smallstr20 &parent) __attribute__((nothrow)); // always return constant 20 @@ -12271,8 +12243,6 @@ inline void ch_AddStrptr(algo::Smallstr200& parent, algo::strptr str) _ // Access string as array of chars // func:algo.Smallstr200.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr200& parent) __attribute__((nothrow)); -// func:algo.Smallstr200.ch.HashStrptr -inline u32 Smallstr200_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr200.ch.Init inline void ch_Init(algo::Smallstr200 &parent) __attribute__((nothrow)); // always return constant 200 @@ -12309,6 +12279,81 @@ inline bool Smallstr200_Eq(algo::Smallstr200& lhs, algo::Smallstr200& r // func:algo.Smallstr200..Print void Smallstr200_Print(algo::Smallstr200& row, algo::cstring& str) __attribute__((nothrow)); +// --- algo.Smallstr249 +struct Smallstr249 { // algo.Smallstr249: inline string with length field + enum { ch_max = 249 }; + u8 ch[249+1]; + u8 n_ch; + + // Copy from strptr (operator=) + // func:algo.Smallstr249.ch.AssignStrptr + inline void operator =(const algo::strptr &str) __attribute__((nothrow)); + // func:algo.Smallstr249.ch.CtorStrptr + inline Smallstr249(const algo::strptr &rhs) __attribute__((nothrow)); + // func:algo.Smallstr249.ch.Cast + inline operator algo::strptr() const __attribute__((nothrow)); + // func:algo.Smallstr249..EqOp + inline bool operator ==(const algo::Smallstr249 &rhs) const __attribute__((nothrow)); + // func:algo.Smallstr249..NeOp + inline bool operator !=(const algo::Smallstr249 &rhs) const __attribute__((nothrow)); + // func:algo.Smallstr249..EqOpAryptr + inline bool operator ==(const algo::aryptr &rhs) const __attribute__((nothrow)); + // func:algo.Smallstr249..AssignOp + inline algo::Smallstr249& operator =(const algo::Smallstr249 &rhs) __attribute__((nothrow)); + // func:algo.Smallstr249..Ctor + inline Smallstr249() __attribute__((nothrow)); + // func:algo.Smallstr249..CopyCtor + inline Smallstr249(const algo::Smallstr249 &rhs) __attribute__((nothrow)); +}; + +// Append character to string. +// If there is no space for an extra character, do nothing. +// func:algo.Smallstr249.ch.Add +inline void ch_Add(algo::Smallstr249& parent, char c) __attribute__((nothrow)); +// Append string to this string. +// If there is no space for an extra character, trim. +// If there is no space left, dump core in debug mode. +// func:algo.Smallstr249.ch.AddStrptr +inline void ch_AddStrptr(algo::Smallstr249& parent, algo::strptr str) __attribute__((nothrow)); +// Access string as array of chars +// func:algo.Smallstr249.ch.Getary +inline algo::aryptr ch_Getary(const algo::Smallstr249& parent) __attribute__((nothrow)); +// func:algo.Smallstr249.ch.Init +inline void ch_Init(algo::Smallstr249 &parent) __attribute__((nothrow)); +// always return constant 249 +// func:algo.Smallstr249.ch.Max +inline int ch_Max(algo::Smallstr249& parent) __attribute__((nothrow)); +// func:algo.Smallstr249.ch.N +inline int ch_N(const algo::Smallstr249& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:algo.Smallstr249.ch.Print +void ch_Print(algo::Smallstr249& parent, algo::cstring &out) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:algo.Smallstr249.ch.ReadStrptrMaybe +bool ch_ReadStrptrMaybe(algo::Smallstr249& parent, algo::strptr rhs) __attribute__((nothrow)); +// Copy from strptr, clipping length +// Set string to the value provided by RHS. +// If RHS is too large, it is silently clipped. +// func:algo.Smallstr249.ch.SetStrptr +void ch_SetStrptr(algo::Smallstr249& parent, const algo::strptr& rhs) __attribute__((nothrow)); + +// func:algo.Smallstr249..Hash +u32 Smallstr249_Hash(u32 prev, const algo::Smallstr249& rhs) __attribute__((nothrow)); +// Read fields of algo::Smallstr249 from an ascii string. +// The format of the string is the format of the algo::Smallstr249's only field +// func:algo.Smallstr249..ReadStrptrMaybe +bool Smallstr249_ReadStrptrMaybe(algo::Smallstr249 &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:algo.Smallstr249..Cmp +inline i32 Smallstr249_Cmp(algo::Smallstr249& lhs, algo::Smallstr249& rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:algo.Smallstr249..Init +inline void Smallstr249_Init(algo::Smallstr249& parent); +// func:algo.Smallstr249..Eq +inline bool Smallstr249_Eq(algo::Smallstr249& lhs, algo::Smallstr249& rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:algo.Smallstr249.String printfmt:Raw +// func:algo.Smallstr249..Print +void Smallstr249_Print(algo::Smallstr249& row, algo::cstring& str) __attribute__((nothrow)); + // --- algo.Smallstr25 struct Smallstr25 { // algo.Smallstr25: inline string with length field enum { ch_max = 25 }; @@ -12348,8 +12393,6 @@ inline void ch_AddStrptr(algo::Smallstr25& parent, algo::strptr str) __ // Access string as array of chars // func:algo.Smallstr25.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr25& parent) __attribute__((nothrow)); -// func:algo.Smallstr25.ch.HashStrptr -inline u32 Smallstr25_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr25.ch.Init inline void ch_Init(algo::Smallstr25 &parent) __attribute__((nothrow)); // always return constant 25 @@ -12386,6 +12429,79 @@ inline bool Smallstr25_Eq(algo::Smallstr25& lhs, algo::Smallstr25& rhs) // func:algo.Smallstr25..Print void Smallstr25_Print(algo::Smallstr25& row, algo::cstring& str) __attribute__((nothrow)); +// --- algo.Smallstr255 +#pragma pack(push,1) +struct Smallstr255 { // algo.Smallstr255: inline string with length field + enum { ch_max = 255 }; + u8 ch[255+1]; + u8 n_ch; + + // Copy from strptr (operator=) + // func:algo.Smallstr255.ch.AssignStrptr + inline void operator =(const algo::strptr &str) __attribute__((nothrow)); + // func:algo.Smallstr255.ch.CtorStrptr + inline Smallstr255(const algo::strptr &rhs) __attribute__((nothrow)); + // func:algo.Smallstr255.ch.Cast + inline operator algo::strptr() const __attribute__((nothrow)); + // func:algo.Smallstr255..EqOpAryptr + inline bool operator ==(const algo::aryptr &rhs) const __attribute__((nothrow)); + // func:algo.Smallstr255..AssignOp + inline algo::Smallstr255& operator =(const algo::Smallstr255 &rhs) __attribute__((nothrow)); + // func:algo.Smallstr255..Ctor + inline Smallstr255() __attribute__((nothrow)); + // func:algo.Smallstr255..CopyCtor + inline Smallstr255(const algo::Smallstr255 &rhs) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Append character to string. +// If there is no space for an extra character, do nothing. +// func:algo.Smallstr255.ch.Add +inline void ch_Add(algo::Smallstr255& parent, char c) __attribute__((nothrow)); +// Append string to this string. +// If there is no space for an extra character, trim. +// If there is no space left, dump core in debug mode. +// func:algo.Smallstr255.ch.AddStrptr +inline void ch_AddStrptr(algo::Smallstr255& parent, algo::strptr str) __attribute__((nothrow)); +// Access string as array of chars +// func:algo.Smallstr255.ch.Getary +inline algo::aryptr ch_Getary(const algo::Smallstr255& parent) __attribute__((nothrow)); +// func:algo.Smallstr255.ch.Init +inline void ch_Init(algo::Smallstr255 &parent) __attribute__((nothrow)); +// always return constant 255 +// func:algo.Smallstr255.ch.Max +inline int ch_Max(algo::Smallstr255& parent) __attribute__((nothrow)); +// func:algo.Smallstr255.ch.N +inline int ch_N(const algo::Smallstr255& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:algo.Smallstr255.ch.Print +void ch_Print(algo::Smallstr255& parent, algo::cstring &out) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:algo.Smallstr255.ch.ReadStrptrMaybe +bool ch_ReadStrptrMaybe(algo::Smallstr255& parent, algo::strptr rhs) __attribute__((nothrow)); +// Copy from strptr, clipping length +// Set string to the value provided by RHS. +// If RHS is too large, it is silently clipped. +// func:algo.Smallstr255.ch.SetStrptr +void ch_SetStrptr(algo::Smallstr255& parent, const algo::strptr& rhs) __attribute__((nothrow)); + +// func:algo.Smallstr255..Hash +u32 Smallstr255_Hash(u32 prev, const algo::Smallstr255& rhs) __attribute__((nothrow)); +// Read fields of algo::Smallstr255 from an ascii string. +// The format of the string is the format of the algo::Smallstr255's only field +// func:algo.Smallstr255..ReadStrptrMaybe +bool Smallstr255_ReadStrptrMaybe(algo::Smallstr255 &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:algo.Smallstr255..Cmp +inline i32 Smallstr255_Cmp(algo::Smallstr255& lhs, algo::Smallstr255& rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:algo.Smallstr255..Init +inline void Smallstr255_Init(algo::Smallstr255& parent); +// func:algo.Smallstr255..Eq +inline bool Smallstr255_Eq(algo::Smallstr255& lhs, algo::Smallstr255& rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:algo.Smallstr255.String printfmt:Raw +// func:algo.Smallstr255..Print +void Smallstr255_Print(algo::Smallstr255& row, algo::cstring& str) __attribute__((nothrow)); + // --- algo.Smallstr3 struct Smallstr3 { // algo.Smallstr3: inline string with length field enum { ch_max = 3 }; @@ -12425,8 +12541,6 @@ inline void ch_AddStrptr(algo::Smallstr3& parent, algo::strptr str) __a // Access string as array of chars // func:algo.Smallstr3.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr3& parent) __attribute__((nothrow)); -// func:algo.Smallstr3.ch.HashStrptr -inline u32 Smallstr3_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr3.ch.Init inline void ch_Init(algo::Smallstr3 &parent) __attribute__((nothrow)); // always return constant 3 @@ -12510,8 +12624,6 @@ inline void ch_AddStrptr(algo::Smallstr30& parent, algo::strptr str) __ // Access string as array of chars // func:algo.Smallstr30.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr30& parent) __attribute__((nothrow)); -// func:algo.Smallstr30.ch.HashStrptr -inline u32 Smallstr30_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr30.ch.Init inline void ch_Init(algo::Smallstr30 &parent) __attribute__((nothrow)); // always return constant 30 @@ -12594,8 +12706,6 @@ inline void ch_AddStrptr(algo::Smallstr32& parent, algo::strptr str) __ // Access string as array of chars // func:algo.Smallstr32.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr32& parent) __attribute__((nothrow)); -// func:algo.Smallstr32.ch.HashStrptr -inline u32 Smallstr32_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr32.ch.Init inline void ch_Init(algo::Smallstr32 &parent) __attribute__((nothrow)); // always return constant 32 @@ -12671,8 +12781,6 @@ inline void ch_AddStrptr(algo::Smallstr4& parent, algo::strptr str) __a // Access string as array of chars // func:algo.Smallstr4.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr4& parent) __attribute__((nothrow)); -// func:algo.Smallstr4.ch.HashStrptr -inline u32 Smallstr4_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr4.ch.Init inline void ch_Init(algo::Smallstr4 &parent) __attribute__((nothrow)); // always return constant 4 @@ -12748,8 +12856,6 @@ inline void ch_AddStrptr(algo::Smallstr40& parent, algo::strptr str) __ // Access string as array of chars // func:algo.Smallstr40.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr40& parent) __attribute__((nothrow)); -// func:algo.Smallstr40.ch.HashStrptr -inline u32 Smallstr40_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr40.ch.Init inline void ch_Init(algo::Smallstr40 &parent) __attribute__((nothrow)); // always return constant 40 @@ -12825,8 +12931,6 @@ inline void ch_AddStrptr(algo::Smallstr5& parent, algo::strptr str) __a // Access string as array of chars // func:algo.Smallstr5.ch.Getary inline algo::aryptr ch_Getary(const algo::Smallstr5& parent) __attribute__((nothrow)); -// func:algo.Smallstr5.ch.HashStrptr -inline u32 Smallstr5_Hash(u32 prev, const algo::strptr &str); // func:algo.Smallstr5.ch.Init inline void ch_Init(algo::Smallstr5 &parent) __attribute__((nothrow)); // always return constant 5 @@ -12901,6 +13005,11 @@ algo::cstring& ary_AllocAt(algo::StringAry& parent, int at) __attribute__( // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo.StringAry.ary.AllocN algo::aryptr ary_AllocN(algo::StringAry& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.StringAry.ary.AllocNAt +algo::aryptr ary_AllocNAt(algo::StringAry& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo.StringAry.ary.EmptyQ inline bool ary_EmptyQ(algo::StringAry& parent) __attribute__((nothrow)); @@ -12957,6 +13066,10 @@ algo::aryptr ary_AllocNVal(algo::StringAry& parent, int n_elems, // Function returns success value. // func:algo.StringAry.ary.ReadStrptrMaybe bool ary_ReadStrptrMaybe(algo::StringAry& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.StringAry.ary.Insary +void ary_Insary(algo::StringAry& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:algo.StringAry.ary_curs.Next @@ -13147,6 +13260,11 @@ algo::Attr& attrs_AllocAt(algo::Tuple& parent, int at) __attribute__((_ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo.Tuple.attrs.AllocN algo::aryptr attrs_AllocN(algo::Tuple& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.Tuple.attrs.AllocNAt +algo::aryptr attrs_AllocNAt(algo::Tuple& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo.Tuple.attrs.EmptyQ inline bool attrs_EmptyQ(algo::Tuple& parent) __attribute__((nothrow)); @@ -13203,6 +13321,10 @@ algo::aryptr attrs_AllocNVal(algo::Tuple& parent, int n_elems, const // Function returns success value. // func:algo.Tuple.attrs.ReadStrptrMaybe bool attrs_ReadStrptrMaybe(algo::Tuple& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.Tuple.attrs.Insary +void attrs_Insary(algo::Tuple& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:algo.Tuple.attrs_curs.Next @@ -13234,6 +13356,143 @@ inline bool Tuple_Eq(algo::Tuple& lhs, algo::Tuple& rhs) __attribute__( // this function is 'extrn' and implemented by user void Tuple_Print(algo::Tuple& row, algo::cstring& str) __attribute__((nothrow)); +// --- algo.U16Ary +struct U16Ary { // algo.U16Ary: Array of u16 + u16* ary_elems; // pointer to elements + u32 ary_n; // number of elements in array + u32 ary_max; // max. capacity of array before realloc + // Copy from aryptr (operator=) + // func:algo.U16Ary.ary.AssignAryptr + inline void operator =(const algo::aryptr &rhs) __attribute__((nothrow)); + // func:algo.U16Ary.ary.CtorAryptr + explicit inline U16Ary(const algo::aryptr &rhs) __attribute__((nothrow)); + // func:algo.U16Ary..EqOp + inline bool operator ==(const algo::U16Ary &rhs) const __attribute__((nothrow)); + // func:algo.U16Ary..NeOp + inline bool operator !=(const algo::U16Ary &rhs) const __attribute__((nothrow)); + // func:algo.U16Ary..AssignOp + algo::U16Ary& operator =(const algo::U16Ary &rhs) __attribute__((nothrow)); + // func:algo.U16Ary..Ctor + inline U16Ary() __attribute__((nothrow)); + // func:algo.U16Ary..Dtor + inline ~U16Ary() __attribute__((nothrow)); + // func:algo.U16Ary..CopyCtor + U16Ary(const algo::U16Ary &rhs) __attribute__((nothrow)); +}; + +// func:algo.U16Ary.ary.Eq +bool ary_Eq(const algo::U16Ary& parent,const algo::U16Ary &rhs) __attribute__((nothrow)); +// func:algo.U16Ary.ary.Cmp +int ary_Cmp(algo::U16Ary& parent, algo::U16Ary &rhs) __attribute__((nothrow)); +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.U16Ary.ary.Addary +algo::aryptr ary_Addary(algo::U16Ary& parent, algo::aryptr rhs) __attribute__((nothrow)); +// Reserve space. Insert element at the end +// The new element is initialized to a default value +// func:algo.U16Ary.ary.Alloc +u16& ary_Alloc(algo::U16Ary& parent) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.U16Ary.ary.AllocAt +u16& ary_AllocAt(algo::U16Ary& parent, int at) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:algo.U16Ary.ary.AllocN +algo::aryptr ary_AllocN(algo::U16Ary& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.U16Ary.ary.AllocNAt +algo::aryptr ary_AllocNAt(algo::U16Ary& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:algo.U16Ary.ary.EmptyQ +inline bool ary_EmptyQ(algo::U16Ary& parent) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:algo.U16Ary.ary.Find +inline u16* ary_Find(algo::U16Ary& parent, u64 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array pointer by value +// func:algo.U16Ary.ary.Getary +inline algo::aryptr ary_Getary(const algo::U16Ary& parent) __attribute__((nothrow)); +// Return pointer to last element of array, or NULL if array is empty +// func:algo.U16Ary.ary.Last +inline u16* ary_Last(algo::U16Ary& parent) __attribute__((nothrow, pure)); +// Return max. number of items in the array +// func:algo.U16Ary.ary.Max +inline i32 ary_Max(algo::U16Ary& parent) __attribute__((nothrow)); +// Return number of items in the array +// func:algo.U16Ary.ary.N +inline i32 ary_N(const algo::U16Ary& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove item by index. If index outside of range, do nothing. +// func:algo.U16Ary.ary.Remove +void ary_Remove(algo::U16Ary& parent, u32 i) __attribute__((nothrow)); +// func:algo.U16Ary.ary.RemoveAll +inline void ary_RemoveAll(algo::U16Ary& parent) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:algo.U16Ary.ary.RemoveLast +void ary_RemoveLast(algo::U16Ary& parent) __attribute__((nothrow)); +// Make sure N *more* elements will fit in array. Process dies if out of memory +// func:algo.U16Ary.ary.Reserve +inline void ary_Reserve(algo::U16Ary& parent, int n) __attribute__((nothrow)); +// Make sure N elements fit in array. Process dies if out of memory +// func:algo.U16Ary.ary.AbsReserve +void ary_AbsReserve(algo::U16Ary& parent, int n) __attribute__((nothrow)); +// Copy contents of RHS to PARENT. +// func:algo.U16Ary.ary.Setary +void ary_Setary(algo::U16Ary& parent, algo::U16Ary &rhs) __attribute__((nothrow)); +// Copy specified array into ary, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +// func:algo.U16Ary.ary.Setary2 +void ary_Setary(algo::U16Ary& parent, const algo::aryptr &rhs) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:algo.U16Ary.ary.qFind +inline u16& ary_qFind(algo::U16Ary& parent, u64 t) __attribute__((nothrow)); +// Return reference to last element of array. No bounds checking +// func:algo.U16Ary.ary.qLast +inline u16& ary_qLast(algo::U16Ary& parent) __attribute__((nothrow)); +// Return row id of specified element +// func:algo.U16Ary.ary.rowid_Get +inline u64 ary_rowid_Get(algo::U16Ary& parent, u16 &elem) __attribute__((nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:algo.U16Ary.ary.AllocNVal +algo::aryptr ary_AllocNVal(algo::U16Ary& parent, int n_elems, const u16& val) __attribute__((nothrow)); +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +// func:algo.U16Ary.ary.ReadStrptrMaybe +bool ary_ReadStrptrMaybe(algo::U16Ary& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.U16Ary.ary.Insary +void ary_Insary(algo::U16Ary& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); + +// proceed to next item +// func:algo.U16Ary.ary_curs.Next +inline void U16Ary_ary_curs_Next(U16Ary_ary_curs &curs) __attribute__((nothrow)); +// func:algo.U16Ary.ary_curs.Reset +inline void U16Ary_ary_curs_Reset(U16Ary_ary_curs &curs, algo::U16Ary &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:algo.U16Ary.ary_curs.ValidQ +inline bool U16Ary_ary_curs_ValidQ(U16Ary_ary_curs &curs) __attribute__((nothrow)); +// item access +// func:algo.U16Ary.ary_curs.Access +inline u16& U16Ary_ary_curs_Access(U16Ary_ary_curs &curs) __attribute__((nothrow)); +// func:algo.U16Ary..Hash +inline u32 U16Ary_Hash(u32 prev, const algo::U16Ary& rhs) __attribute__((nothrow)); +// func:algo.U16Ary..Cmp +inline i32 U16Ary_Cmp(algo::U16Ary& lhs, algo::U16Ary& rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:algo.U16Ary..Init +inline void U16Ary_Init(algo::U16Ary& parent); +// func:algo.U16Ary..Uninit +void U16Ary_Uninit(algo::U16Ary& parent) __attribute__((nothrow)); +// func:algo.U16Ary..Eq +inline bool U16Ary_Eq(algo::U16Ary& lhs, algo::U16Ary& rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:algo.U16Ary.String printfmt:Tuple +// func:algo.U16Ary..Print +void U16Ary_Print(algo::U16Ary& row, algo::cstring& str) __attribute__((nothrow)); + // --- algo.U16Dec2 #pragma pack(push,1) struct U16Dec2 { // algo.U16Dec2: u16, scale 1e2 @@ -13286,6 +13545,143 @@ inline void U16Dec2_Init(algo::U16Dec2& parent); // func:algo.U16Dec2..Print void U16Dec2_Print(algo::U16Dec2 row, algo::cstring& str) __attribute__((nothrow)); +// --- algo.U32Ary +struct U32Ary { // algo.U32Ary: Array of u16 + u32* ary_elems; // pointer to elements + u32 ary_n; // number of elements in array + u32 ary_max; // max. capacity of array before realloc + // Copy from aryptr (operator=) + // func:algo.U32Ary.ary.AssignAryptr + inline void operator =(const algo::aryptr &rhs) __attribute__((nothrow)); + // func:algo.U32Ary.ary.CtorAryptr + explicit inline U32Ary(const algo::aryptr &rhs) __attribute__((nothrow)); + // func:algo.U32Ary..EqOp + inline bool operator ==(const algo::U32Ary &rhs) const __attribute__((nothrow)); + // func:algo.U32Ary..NeOp + inline bool operator !=(const algo::U32Ary &rhs) const __attribute__((nothrow)); + // func:algo.U32Ary..AssignOp + algo::U32Ary& operator =(const algo::U32Ary &rhs) __attribute__((nothrow)); + // func:algo.U32Ary..Ctor + inline U32Ary() __attribute__((nothrow)); + // func:algo.U32Ary..Dtor + inline ~U32Ary() __attribute__((nothrow)); + // func:algo.U32Ary..CopyCtor + U32Ary(const algo::U32Ary &rhs) __attribute__((nothrow)); +}; + +// func:algo.U32Ary.ary.Eq +bool ary_Eq(const algo::U32Ary& parent,const algo::U32Ary &rhs) __attribute__((nothrow)); +// func:algo.U32Ary.ary.Cmp +int ary_Cmp(algo::U32Ary& parent, algo::U32Ary &rhs) __attribute__((nothrow)); +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.U32Ary.ary.Addary +algo::aryptr ary_Addary(algo::U32Ary& parent, algo::aryptr rhs) __attribute__((nothrow)); +// Reserve space. Insert element at the end +// The new element is initialized to a default value +// func:algo.U32Ary.ary.Alloc +u32& ary_Alloc(algo::U32Ary& parent) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.U32Ary.ary.AllocAt +u32& ary_AllocAt(algo::U32Ary& parent, int at) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:algo.U32Ary.ary.AllocN +algo::aryptr ary_AllocN(algo::U32Ary& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.U32Ary.ary.AllocNAt +algo::aryptr ary_AllocNAt(algo::U32Ary& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:algo.U32Ary.ary.EmptyQ +inline bool ary_EmptyQ(algo::U32Ary& parent) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:algo.U32Ary.ary.Find +inline u32* ary_Find(algo::U32Ary& parent, u64 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array pointer by value +// func:algo.U32Ary.ary.Getary +inline algo::aryptr ary_Getary(const algo::U32Ary& parent) __attribute__((nothrow)); +// Return pointer to last element of array, or NULL if array is empty +// func:algo.U32Ary.ary.Last +inline u32* ary_Last(algo::U32Ary& parent) __attribute__((nothrow, pure)); +// Return max. number of items in the array +// func:algo.U32Ary.ary.Max +inline i32 ary_Max(algo::U32Ary& parent) __attribute__((nothrow)); +// Return number of items in the array +// func:algo.U32Ary.ary.N +inline i32 ary_N(const algo::U32Ary& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove item by index. If index outside of range, do nothing. +// func:algo.U32Ary.ary.Remove +void ary_Remove(algo::U32Ary& parent, u32 i) __attribute__((nothrow)); +// func:algo.U32Ary.ary.RemoveAll +inline void ary_RemoveAll(algo::U32Ary& parent) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:algo.U32Ary.ary.RemoveLast +void ary_RemoveLast(algo::U32Ary& parent) __attribute__((nothrow)); +// Make sure N *more* elements will fit in array. Process dies if out of memory +// func:algo.U32Ary.ary.Reserve +inline void ary_Reserve(algo::U32Ary& parent, int n) __attribute__((nothrow)); +// Make sure N elements fit in array. Process dies if out of memory +// func:algo.U32Ary.ary.AbsReserve +void ary_AbsReserve(algo::U32Ary& parent, int n) __attribute__((nothrow)); +// Copy contents of RHS to PARENT. +// func:algo.U32Ary.ary.Setary +void ary_Setary(algo::U32Ary& parent, algo::U32Ary &rhs) __attribute__((nothrow)); +// Copy specified array into ary, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +// func:algo.U32Ary.ary.Setary2 +void ary_Setary(algo::U32Ary& parent, const algo::aryptr &rhs) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:algo.U32Ary.ary.qFind +inline u32& ary_qFind(algo::U32Ary& parent, u64 t) __attribute__((nothrow)); +// Return reference to last element of array. No bounds checking +// func:algo.U32Ary.ary.qLast +inline u32& ary_qLast(algo::U32Ary& parent) __attribute__((nothrow)); +// Return row id of specified element +// func:algo.U32Ary.ary.rowid_Get +inline u64 ary_rowid_Get(algo::U32Ary& parent, u32 &elem) __attribute__((nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:algo.U32Ary.ary.AllocNVal +algo::aryptr ary_AllocNVal(algo::U32Ary& parent, int n_elems, const u32& val) __attribute__((nothrow)); +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +// func:algo.U32Ary.ary.ReadStrptrMaybe +bool ary_ReadStrptrMaybe(algo::U32Ary& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.U32Ary.ary.Insary +void ary_Insary(algo::U32Ary& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); + +// proceed to next item +// func:algo.U32Ary.ary_curs.Next +inline void U32Ary_ary_curs_Next(U32Ary_ary_curs &curs) __attribute__((nothrow)); +// func:algo.U32Ary.ary_curs.Reset +inline void U32Ary_ary_curs_Reset(U32Ary_ary_curs &curs, algo::U32Ary &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:algo.U32Ary.ary_curs.ValidQ +inline bool U32Ary_ary_curs_ValidQ(U32Ary_ary_curs &curs) __attribute__((nothrow)); +// item access +// func:algo.U32Ary.ary_curs.Access +inline u32& U32Ary_ary_curs_Access(U32Ary_ary_curs &curs) __attribute__((nothrow)); +// func:algo.U32Ary..Hash +inline u32 U32Ary_Hash(u32 prev, const algo::U32Ary& rhs) __attribute__((nothrow)); +// func:algo.U32Ary..Cmp +inline i32 U32Ary_Cmp(algo::U32Ary& lhs, algo::U32Ary& rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:algo.U32Ary..Init +inline void U32Ary_Init(algo::U32Ary& parent); +// func:algo.U32Ary..Uninit +void U32Ary_Uninit(algo::U32Ary& parent) __attribute__((nothrow)); +// func:algo.U32Ary..Eq +inline bool U32Ary_Eq(algo::U32Ary& lhs, algo::U32Ary& rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:algo.U32Ary.String printfmt:Tuple +// func:algo.U32Ary..Print +void U32Ary_Print(algo::U32Ary& row, algo::cstring& str) __attribute__((nothrow)); + // --- algo.U32Dec1 #pragma pack(push,1) struct U32Dec1 { // algo.U32Dec1: u32, scale 1e1 @@ -13538,6 +13934,50 @@ inline void U32Dec5_Init(algo::U32Dec5& parent); // func:algo.U32Dec5..Print void U32Dec5_Print(algo::U32Dec5 row, algo::cstring& str) __attribute__((nothrow)); +// --- algo.U32LinearKey +struct U32LinearKey { // algo.U32LinearKey + u32 value; // 0 + // func:algo.U32LinearKey.value.Cast + inline operator u32() const __attribute__((nothrow)); + // func:algo.U32LinearKey..EqOp + inline bool operator ==(const algo::U32LinearKey &rhs) const __attribute__((nothrow)); + // func:algo.U32LinearKey..NeOp + inline bool operator !=(const algo::U32LinearKey &rhs) const __attribute__((nothrow)); + // func:algo.U32LinearKey..LtOp + inline bool operator <(const algo::U32LinearKey &rhs) const __attribute__((nothrow)); + // func:algo.U32LinearKey..GtOp + inline bool operator >(const algo::U32LinearKey &rhs) const __attribute__((nothrow)); + // func:algo.U32LinearKey..LeOp + inline bool operator <=(const algo::U32LinearKey &rhs) const __attribute__((nothrow)); + // func:algo.U32LinearKey..GeOp + inline bool operator >=(const algo::U32LinearKey &rhs) const __attribute__((nothrow)); + // func:algo.U32LinearKey..Ctor + inline U32LinearKey() __attribute__((nothrow)); + // func:algo.U32LinearKey..FieldwiseCtor + explicit inline U32LinearKey(u32 in_value) __attribute__((nothrow)); +}; + +// Read fields of algo::U32LinearKey from an ascii string. +// The format of the string is the format of the algo::U32LinearKey's only field +// func:algo.U32LinearKey..ReadStrptrMaybe +bool U32LinearKey_ReadStrptrMaybe(algo::U32LinearKey &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:algo.U32LinearKey..Lt +inline bool U32LinearKey_Lt(algo::U32LinearKey lhs, algo::U32LinearKey rhs) __attribute__((nothrow)); +// func:algo.U32LinearKey..Cmp +inline i32 U32LinearKey_Cmp(algo::U32LinearKey lhs, algo::U32LinearKey rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:algo.U32LinearKey..Init +inline void U32LinearKey_Init(algo::U32LinearKey& parent); +// func:algo.U32LinearKey..Eq +inline bool U32LinearKey_Eq(algo::U32LinearKey lhs, algo::U32LinearKey rhs) __attribute__((nothrow)); +// Set value. Return true if new value is different from old value. +// func:algo.U32LinearKey..Update +inline bool U32LinearKey_Update(algo::U32LinearKey &lhs, algo::U32LinearKey rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:algo.U32LinearKey.String printfmt:Raw +// func:algo.U32LinearKey..Print +void U32LinearKey_Print(algo::U32LinearKey row, algo::cstring& str) __attribute__((nothrow)); + // --- algo.U64Ary struct U64Ary { // algo.U64Ary: Array of u64 u64* ary_elems; // pointer to elements @@ -13548,6 +13988,10 @@ struct U64Ary { // algo.U64Ary: Array of u64 inline void operator =(const algo::aryptr &rhs) __attribute__((nothrow)); // func:algo.U64Ary.ary.CtorAryptr explicit inline U64Ary(const algo::aryptr &rhs) __attribute__((nothrow)); + // func:algo.U64Ary..EqOp + inline bool operator ==(const algo::U64Ary &rhs) const __attribute__((nothrow)); + // func:algo.U64Ary..NeOp + inline bool operator !=(const algo::U64Ary &rhs) const __attribute__((nothrow)); // func:algo.U64Ary..AssignOp algo::U64Ary& operator =(const algo::U64Ary &rhs) __attribute__((nothrow)); // func:algo.U64Ary..Ctor @@ -13558,6 +14002,10 @@ struct U64Ary { // algo.U64Ary: Array of u64 U64Ary(const algo::U64Ary &rhs) __attribute__((nothrow)); }; +// func:algo.U64Ary.ary.Eq +bool ary_Eq(const algo::U64Ary& parent,const algo::U64Ary &rhs) __attribute__((nothrow)); +// func:algo.U64Ary.ary.Cmp +int ary_Cmp(algo::U64Ary& parent, algo::U64Ary &rhs) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. // If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. @@ -13574,6 +14022,11 @@ u64& ary_AllocAt(algo::U64Ary& parent, int at) __attribute__((__ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo.U64Ary.ary.AllocN algo::aryptr ary_AllocN(algo::U64Ary& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.U64Ary.ary.AllocNAt +algo::aryptr ary_AllocNAt(algo::U64Ary& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo.U64Ary.ary.EmptyQ inline bool ary_EmptyQ(algo::U64Ary& parent) __attribute__((nothrow)); @@ -13630,6 +14083,10 @@ algo::aryptr ary_AllocNVal(algo::U64Ary& parent, int n_elems, const u64& // Function returns success value. // func:algo.U64Ary.ary.ReadStrptrMaybe bool ary_ReadStrptrMaybe(algo::U64Ary& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.U64Ary.ary.Insary +void ary_Insary(algo::U64Ary& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:algo.U64Ary.ary_curs.Next @@ -13642,11 +14099,21 @@ inline bool U64Ary_ary_curs_ValidQ(U64Ary_ary_curs &curs) __attribute__ // item access // func:algo.U64Ary.ary_curs.Access inline u64& U64Ary_ary_curs_Access(U64Ary_ary_curs &curs) __attribute__((nothrow)); +// func:algo.U64Ary..Hash +inline u32 U64Ary_Hash(u32 prev, const algo::U64Ary& rhs) __attribute__((nothrow)); +// func:algo.U64Ary..Cmp +inline i32 U64Ary_Cmp(algo::U64Ary& lhs, algo::U64Ary& rhs) __attribute__((nothrow)); // Set all fields to initial values. // func:algo.U64Ary..Init inline void U64Ary_Init(algo::U64Ary& parent); // func:algo.U64Ary..Uninit void U64Ary_Uninit(algo::U64Ary& parent) __attribute__((nothrow)); +// func:algo.U64Ary..Eq +inline bool U64Ary_Eq(algo::U64Ary& lhs, algo::U64Ary& rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:algo.U64Ary.String printfmt:Tuple +// func:algo.U64Ary..Print +void U64Ary_Print(algo::U64Ary& row, algo::cstring& str) __attribute__((nothrow)); // --- algo.U64Dec10 struct U64Dec10 { // algo.U64Dec10: unsigned u64, scale 1e10 @@ -14453,6 +14920,7 @@ inline bool WTime_Update(algo::WTime &lhs, algo::WTime rhs) __attribute void WTime_Print(algo::WTime row, algo::cstring& str) __attribute__((nothrow)); // --- algo.i32_Range +// create: algo.I32RangeAry.ary (Tary) struct i32_Range { // algo.i32_Range: i32: beg,end i32 beg; // 0 i32 end; // 0 @@ -14493,6 +14961,15 @@ inline bool i32_Range_Update(algo::i32_Range &lhs, algo::i32_Range& rhs // func:algo.i32_Range..Print // this function is 'extrn' and implemented by user void i32_Range_Print(algo::i32_Range& row, algo::cstring& str) __attribute__((nothrow)); +// Read fields of algo::memptr from an ascii string. +// func:algo.memptr..ReadStrptrMaybe +// this function is 'extrn' and implemented by user +bool memptr_ReadStrptrMaybe(algo::memptr &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:algo.memptr.String printfmt:Extern +// func:algo.memptr..Print +// this function is 'extrn' and implemented by user +void memptr_Print(algo::memptr row, algo::cstring& str) __attribute__((nothrow)); } // gen:ns_print_struct namespace algo { // gen:ns_curstext @@ -14514,15 +14991,6 @@ struct ByteAry_ary_curs {// cursor }; -struct Charset_ch_bitcurs {// cursor - typedef int& ChildType; - u64* elems; - int n_elems; - int bit; - Charset_ch_bitcurs() : elems(0), n_elems(0), bit(0) {} -}; - - struct Charset_ch_curs {// cursor typedef u64 ChildType; int index; @@ -14531,6 +14999,15 @@ struct Charset_ch_curs {// cursor }; +struct I32RangeAry_ary_curs {// cursor + typedef algo::i32_Range ChildType; + algo::i32_Range* elems; + int n_elems; + int index; + I32RangeAry_ary_curs() { elems=NULL; n_elems=0; index=0; } +}; + + struct LineBuf_buf_curs {// cursor typedef char ChildType; char* elems; @@ -14574,6 +15051,24 @@ struct Tuple_attrs_curs {// cursor }; +struct U16Ary_ary_curs {// cursor + typedef u16 ChildType; + u16* elems; + int n_elems; + int index; + U16Ary_ary_curs() { elems=NULL; n_elems=0; index=0; } +}; + + +struct U32Ary_ary_curs {// cursor + typedef u32 ChildType; + u32* elems; + int n_elems; + int index; + U32Ary_ary_curs() { elems=NULL; n_elems=0; index=0; } +}; + + struct U64Ary_ary_curs {// cursor typedef u64 ChildType; u64* elems; @@ -14602,6 +15097,7 @@ void StaticCheck(); namespace algo { inline algo::cstring &operator <<(algo::cstring &str, const algo::Attr &row);// cfmt:algo.Attr.String inline algo::cstring &operator <<(algo::cstring &str, const algo::Bool &row);// cfmt:algo.Bool.String +inline algo::cstring &operator <<(algo::cstring &str, const algo::ByteAry &row);// cfmt:algo.ByteAry.String inline algo::cstring &operator <<(algo::cstring &str, const algo::Comment &row);// cfmt:algo.Comment.String inline algo::cstring &operator <<(algo::cstring &str, const algo::CppExpr &row);// cfmt:algo.CppExpr.String inline algo::cstring &operator <<(algo::cstring &str, const algo::UnTime &row);// cfmt:algo.UnTime.String @@ -14618,6 +15114,7 @@ inline algo::cstring &operator <<(algo::cstring &str, const algo::I32Dec2 &row); inline algo::cstring &operator <<(algo::cstring &str, const algo::I32Dec3 &row);// cfmt:algo.I32Dec3.String inline algo::cstring &operator <<(algo::cstring &str, const algo::I32Dec4 &row);// cfmt:algo.I32Dec4.String inline algo::cstring &operator <<(algo::cstring &str, const algo::I32Dec5 &row);// cfmt:algo.I32Dec5.String +inline algo::cstring &operator <<(algo::cstring &str, const algo::I32RangeAry &row);// cfmt:algo.I32RangeAry.String inline algo::cstring &operator <<(algo::cstring &str, const algo::I64Dec1 &row);// cfmt:algo.I64Dec1.String inline algo::cstring &operator <<(algo::cstring &str, const algo::I64Dec10 &row);// cfmt:algo.I64Dec10.String inline algo::cstring &operator <<(algo::cstring &str, const algo::I64Dec2 &row);// cfmt:algo.I64Dec2.String @@ -14643,12 +15140,16 @@ inline algo::cstring &operator <<(algo::cstring &str, const algo::StringAry &row inline algo::cstring &operator <<(algo::cstring &str, const algo::TermStyle &row);// cfmt:algo.TermStyle.String inline algo::cstring &operator <<(algo::cstring &str, const algo::TextJust &row);// cfmt:algo.TextJust.String inline algo::cstring &operator <<(algo::cstring &str, const algo::Tuple &row);// cfmt:algo.Tuple.String +inline algo::cstring &operator <<(algo::cstring &str, const algo::U16Ary &row);// cfmt:algo.U16Ary.String inline algo::cstring &operator <<(algo::cstring &str, const algo::U16Dec2 &row);// cfmt:algo.U16Dec2.String +inline algo::cstring &operator <<(algo::cstring &str, const algo::U32Ary &row);// cfmt:algo.U32Ary.String inline algo::cstring &operator <<(algo::cstring &str, const algo::U32Dec1 &row);// cfmt:algo.U32Dec1.String inline algo::cstring &operator <<(algo::cstring &str, const algo::U32Dec2 &row);// cfmt:algo.U32Dec2.String inline algo::cstring &operator <<(algo::cstring &str, const algo::U32Dec3 &row);// cfmt:algo.U32Dec3.String inline algo::cstring &operator <<(algo::cstring &str, const algo::U32Dec4 &row);// cfmt:algo.U32Dec4.String inline algo::cstring &operator <<(algo::cstring &str, const algo::U32Dec5 &row);// cfmt:algo.U32Dec5.String +inline algo::cstring &operator <<(algo::cstring &str, const algo::U32LinearKey &row);// cfmt:algo.U32LinearKey.String +inline algo::cstring &operator <<(algo::cstring &str, const algo::U64Ary &row);// cfmt:algo.U64Ary.String inline algo::cstring &operator <<(algo::cstring &str, const algo::U64Dec10 &row);// cfmt:algo.U64Dec10.String inline algo::cstring &operator <<(algo::cstring &str, const algo::U64Dec2 &row);// cfmt:algo.U64Dec2.String inline algo::cstring &operator <<(algo::cstring &str, const algo::U64Dec4 &row);// cfmt:algo.U64Dec4.String @@ -14665,4 +15166,5 @@ inline algo::cstring &operator <<(algo::cstring &str, const algo::Uuid &row);// inline algo::cstring &operator <<(algo::cstring &str, const algo::WDiff &row);// cfmt:algo.WDiff.String inline algo::cstring &operator <<(algo::cstring &str, const algo::WTime &row);// cfmt:algo.WTime.String inline algo::cstring &operator <<(algo::cstring &str, const algo::i32_Range &row);// cfmt:algo.i32_Range.String +inline algo::cstring &operator <<(algo::cstring &str, const algo::memptr &row);// cfmt:algo.memptr.String } diff --git a/include/gen/algo_gen.inl.h b/include/gen/algo_gen.inl.h index a941038c..deb1936b 100644 --- a/include/gen/algo_gen.inl.h +++ b/include/gen/algo_gen.inl.h @@ -142,6 +142,12 @@ inline char& algo::cstring_ch_curs_Access(cstring_ch_curs &curs) { return curs.elems[curs.index]; } +// --- algo.cstring..Hash +inline u32 algo::cstring_Hash(u32 prev, const algo::cstring& rhs) { + prev = strptr_Hash(prev, algo::strptr((char*)rhs.ch_elems,rhs.ch_n)); + return prev; +} + // --- algo.cstring..EqOp inline bool algo::cstring::operator ==(const algo::cstring &rhs) const { return algo::cstring_Eq(const_cast(*this),const_cast(rhs)); @@ -644,26 +650,6 @@ inline u64& algo::ch_qFind(algo::Charset& parent, u64 t) { return parent.ch_elems[u64(t)]; } -// --- algo.Charset.ch_bitcurs.Reset -inline void algo::Charset_ch_bitcurs_Reset(Charset_ch_bitcurs &curs, algo::Charset &parent) { - curs.elems = &ch_qFind(parent,0); - curs.n_elems = ch_N(parent); - curs.bit = -1; - Charset_ch_bitcurs_Next(curs); -} - -// --- algo.Charset.ch_bitcurs.ValidQ -// cursor points to valid item -inline bool algo::Charset_ch_bitcurs_ValidQ(Charset_ch_bitcurs &curs) { - return curs.bit < curs.n_elems*64; -} - -// --- algo.Charset.ch_bitcurs.Access -// item access -inline int& algo::Charset_ch_bitcurs_Access(Charset_ch_bitcurs &curs) { - return curs.bit; -} - // --- algo.Charset.ch_curs.Reset // cursor points to valid item inline void algo::Charset_ch_curs_Reset(Charset_ch_curs &curs, algo::Charset &parent) { @@ -732,11 +718,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr150& parent) { return ret; } -// --- algo.Smallstr150.ch.HashStrptr -inline u32 algo::Smallstr150_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr150.ch.Init inline void algo::ch_Init(algo::Smallstr150 &parent) { parent.n_ch = 0; @@ -884,11 +865,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr250& parent) { return ret; } -// --- algo.Smallstr250.ch.HashStrptr -inline u32 algo::Smallstr250_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr250.ch.Init inline void algo::ch_Init(algo::Smallstr250 &parent) { parent.n_ch = 0; @@ -1309,17 +1285,47 @@ inline void algo::type_Set(algo::Errcode& parent, algo::Errns rhs) { parent.value = u64((parent.value & ~t1) | t2); } +// --- algo.Errcode..EqOp +inline bool algo::Errcode::operator ==(const algo::Errcode &rhs) const { + return algo::Errcode_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.Errcode..NeOp +inline bool algo::Errcode::operator !=(const algo::Errcode &rhs) const { + return !algo::Errcode_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.Errcode..Cmp +inline i32 algo::Errcode_Cmp(algo::Errcode& lhs, algo::Errcode& rhs) { + i32 retval = 0; + retval = u64_Cmp(lhs.value, rhs.value); + return retval; +} + // --- algo.Errcode..Init // Set all fields to initial values. inline void algo::Errcode_Init(algo::Errcode& parent) { parent.value = u64(0); } +// --- algo.Errcode..Eq +inline bool algo::Errcode_Eq(algo::Errcode& lhs, algo::Errcode& rhs) { + bool retval = true; + retval = u64_Eq(lhs.value, rhs.value); + return retval; +} + // --- algo.Errcode..Ctor inline algo::Errcode::Errcode() { algo::Errcode_Init(*this); } +// --- algo.Errcode..FieldwiseCtor +inline algo::Errcode::Errcode(u64 in_value) + : value(in_value) + { +} + // --- algo.FailokQ.value.GetEnum // Get value of field as enum type inline algo_FailokQEnum algo::value_GetEnum(const algo::FailokQ& parent) { @@ -1945,6 +1951,141 @@ inline algo::I32Dec5::I32Dec5(i32 in_value) { } +// --- algo.I32RangeAry.ary.EmptyQ +// Return true if index is empty +inline bool algo::ary_EmptyQ(algo::I32RangeAry& parent) { + return parent.ary_n == 0; +} + +// --- algo.I32RangeAry.ary.Find +// Look up row by row id. Return NULL if out of range +inline algo::i32_Range* algo::ary_Find(algo::I32RangeAry& parent, u64 t) { + u64 idx = t; + u64 lim = parent.ary_n; + if (idx >= lim) return NULL; + return parent.ary_elems + idx; +} + +// --- algo.I32RangeAry.ary.Getary +// Return array pointer by value +inline algo::aryptr algo::ary_Getary(const algo::I32RangeAry& parent) { + return algo::aryptr(parent.ary_elems, parent.ary_n); +} + +// --- algo.I32RangeAry.ary.Last +// Return pointer to last element of array, or NULL if array is empty +inline algo::i32_Range* algo::ary_Last(algo::I32RangeAry& parent) { + return ary_Find(parent, u64(parent.ary_n-1)); +} + +// --- algo.I32RangeAry.ary.AssignAryptr +// Copy from aryptr (operator=) +inline void algo::I32RangeAry::operator =(const algo::aryptr &rhs) { + ary_Setary(*this, rhs); +} + +// --- algo.I32RangeAry.ary.CtorAryptr +inline algo::I32RangeAry::I32RangeAry(const algo::aryptr &rhs) { + ary_elems = 0; // (algo.I32RangeAry.ary) + ary_n = 0; // (algo.I32RangeAry.ary) + ary_max = 0; // (algo.I32RangeAry.ary) + ary_Addary(*this, rhs); +} + +// --- algo.I32RangeAry.ary.Max +// Return max. number of items in the array +inline i32 algo::ary_Max(algo::I32RangeAry& parent) { + (void)parent; + return parent.ary_max; +} + +// --- algo.I32RangeAry.ary.N +// Return number of items in the array +inline i32 algo::ary_N(const algo::I32RangeAry& parent) { + return parent.ary_n; +} + +// --- algo.I32RangeAry.ary.RemoveAll +inline void algo::ary_RemoveAll(algo::I32RangeAry& parent) { + parent.ary_n = 0; +} + +// --- algo.I32RangeAry.ary.Reserve +// Make sure N *more* elements will fit in array. Process dies if out of memory +inline void algo::ary_Reserve(algo::I32RangeAry& parent, int n) { + u32 new_n = parent.ary_n + n; + if (UNLIKELY(new_n > parent.ary_max)) { + ary_AbsReserve(parent, new_n); + } +} + +// --- algo.I32RangeAry.ary.qFind +// 'quick' Access row by row id. No bounds checking. +inline algo::i32_Range& algo::ary_qFind(algo::I32RangeAry& parent, u64 t) { + return parent.ary_elems[t]; +} + +// --- algo.I32RangeAry.ary.qLast +// Return reference to last element of array. No bounds checking +inline algo::i32_Range& algo::ary_qLast(algo::I32RangeAry& parent) { + return ary_qFind(parent, u64(parent.ary_n-1)); +} + +// --- algo.I32RangeAry.ary.rowid_Get +// Return row id of specified element +inline u64 algo::ary_rowid_Get(algo::I32RangeAry& parent, algo::i32_Range &elem) { + u64 id = &elem - parent.ary_elems; + return u64(id); +} + +// --- algo.I32RangeAry.ary.Cast +inline algo::I32RangeAry::operator algo::aryptr() const { + return ary_Getary(*this); +} + +// --- algo.I32RangeAry.ary_curs.Next +// proceed to next item +inline void algo::I32RangeAry_ary_curs_Next(I32RangeAry_ary_curs &curs) { + curs.index++; +} + +// --- algo.I32RangeAry.ary_curs.Reset +inline void algo::I32RangeAry_ary_curs_Reset(I32RangeAry_ary_curs &curs, algo::I32RangeAry &parent) { + curs.elems = parent.ary_elems; + curs.n_elems = parent.ary_n; + curs.index = 0; +} + +// --- algo.I32RangeAry.ary_curs.ValidQ +// cursor points to valid item +inline bool algo::I32RangeAry_ary_curs_ValidQ(I32RangeAry_ary_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- algo.I32RangeAry.ary_curs.Access +// item access +inline algo::i32_Range& algo::I32RangeAry_ary_curs_Access(I32RangeAry_ary_curs &curs) { + return curs.elems[curs.index]; +} + +// --- algo.I32RangeAry..Init +// Set all fields to initial values. +inline void algo::I32RangeAry_Init(algo::I32RangeAry& parent) { + parent.ary_elems = 0; // (algo.I32RangeAry.ary) + parent.ary_n = 0; // (algo.I32RangeAry.ary) + parent.ary_max = 0; // (algo.I32RangeAry.ary) +} + +// --- algo.I32RangeAry..Ctor +inline algo::I32RangeAry::I32RangeAry() { + algo::I32RangeAry_Init(*this); +} + +// --- algo.I32RangeAry..Dtor +inline algo::I32RangeAry::~I32RangeAry() { + algo::I32RangeAry_Uninit(*this); +} + // --- algo.I64Dec1.value.qSetDouble // Set value of field value. // The value is rounded to the nearest integer. @@ -2565,6 +2706,18 @@ inline algo::I64Dec9::I64Dec9(i64 in_value) { } +// --- algo.I64Rate..Init +// Set all fields to initial values. +inline void algo::I64Rate_Init(algo::I64Rate& parent) { + parent.last = i64(0); + parent.delta = i64(0); +} + +// --- algo.I64Rate..Ctor +inline algo::I64Rate::I64Rate() { + algo::I64Rate_Init(*this); +} + // --- algo.IOEvtFlags.value.Cast inline algo::IOEvtFlags::operator algo_IOEvtFlagsEnum() const { return algo_IOEvtFlagsEnum((*this).value); @@ -2698,11 +2851,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr50& parent) { return ret; } -// --- algo.Smallstr50.ch.HashStrptr -inline u32 algo::Smallstr50_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr50.ch.Init inline void algo::ch_Init(algo::Smallstr50 &parent) { parent.n_ch = 0; @@ -2903,11 +3051,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr100& parent) { return ret; } -// --- algo.Smallstr100.ch.HashStrptr -inline u32 algo::Smallstr100_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr100.ch.Init inline void algo::ch_Init(algo::Smallstr100 &parent) { parent.n_ch = 0; @@ -2943,6 +3086,41 @@ inline algo::Smallstr100::operator algo::strptr() const { return ch_Getary(*this); } +// --- algo.Smallstr100..EqOp +inline bool algo::Smallstr100::operator ==(const algo::Smallstr100 &rhs) const { + return algo::Smallstr100_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.Smallstr100..NeOp +inline bool algo::Smallstr100::operator !=(const algo::Smallstr100 &rhs) const { + return !algo::Smallstr100_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.Smallstr100..LtOp +inline bool algo::Smallstr100::operator <(const algo::Smallstr100 &rhs) const { + return algo::Smallstr100_Lt(const_cast(*this),const_cast(rhs)); +} + +// --- algo.Smallstr100..GtOp +inline bool algo::Smallstr100::operator >(const algo::Smallstr100 &rhs) const { + return algo::Smallstr100_Lt(const_cast(rhs),const_cast(*this)); +} + +// --- algo.Smallstr100..LeOp +inline bool algo::Smallstr100::operator <=(const algo::Smallstr100 &rhs) const { + return !algo::Smallstr100_Lt(const_cast(rhs),const_cast(*this)); +} + +// --- algo.Smallstr100..GeOp +inline bool algo::Smallstr100::operator >=(const algo::Smallstr100 &rhs) const { + return !algo::Smallstr100_Lt(const_cast(*this),const_cast(rhs)); +} + +// --- algo.Smallstr100..Lt +inline bool algo::Smallstr100_Lt(algo::Smallstr100& lhs, algo::Smallstr100& rhs) { + return algo::strptr_Lt(ch_Getary(lhs), ch_Getary(rhs)); +} + // --- algo.Smallstr100..Cmp inline i32 algo::Smallstr100_Cmp(algo::Smallstr100& lhs, algo::Smallstr100& rhs) { i32 retval = 0; @@ -2963,6 +3141,16 @@ inline bool algo::Smallstr100_Eq(algo::Smallstr100& lhs, algo::Smallstr100& rhs) return retval; } +// --- algo.Smallstr100..Update +// Set value. Return true if new value is different from old value. +inline bool algo::Smallstr100_Update(algo::Smallstr100 &lhs, algo::Smallstr100& rhs) { + bool ret = !Smallstr100_Eq(lhs, rhs); // compare values + if (ret) { + lhs = rhs; // update + } + return ret; +} + // --- algo.Smallstr100..EqOpAryptr inline bool algo::Smallstr100::operator ==(const algo::aryptr &rhs) const { return algo::strptr_Eq(ch_Getary(*this), rhs); @@ -3164,11 +3352,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr10_U64& parent) { return ret; } -// --- algo.LnumStr10_U64.ch.HashStrptr -inline u32 algo::LnumStr10_U64_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr10_U64.ch.Init inline void algo::ch_Init(algo::LnumStr10_U64 &parent) { for (int i = 0; i < 10; i++) { @@ -3276,11 +3459,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr11_U64& parent) { return ret; } -// --- algo.LnumStr11_U64.ch.HashStrptr -inline u32 algo::LnumStr11_U64_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr11_U64.ch.Init inline void algo::ch_Init(algo::LnumStr11_U64 &parent) { for (int i = 0; i < 11; i++) { @@ -3389,11 +3567,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr12_U64& parent) { return ret; } -// --- algo.LnumStr12_U64.ch.HashStrptr -inline u32 algo::LnumStr12_U64_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr12_U64.ch.Init inline void algo::ch_Init(algo::LnumStr12_U64 &parent) { for (int i = 0; i < 12; i++) { @@ -3501,11 +3674,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr13_U64_Base36& pare return ret; } -// --- algo.LnumStr13_U64_Base36.ch.HashStrptr -inline u32 algo::LnumStr13_U64_Base36_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr13_U64_Base36.ch.Init inline void algo::ch_Init(algo::LnumStr13_U64_Base36 &parent) { for (int i = 0; i < 13; i++) { @@ -3614,11 +3782,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr16_U64_Base16& pare return ret; } -// --- algo.LnumStr16_U64_Base16.ch.HashStrptr -inline u32 algo::LnumStr16_U64_Base16_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr16_U64_Base16.ch.Init inline void algo::ch_Init(algo::LnumStr16_U64_Base16 &parent) { for (int i = 0; i < 16; i++) { @@ -3726,11 +3889,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr1_U32& parent) { return ret; } -// --- algo.LnumStr1_U32.ch.HashStrptr -inline u32 algo::LnumStr1_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr1_U32.ch.Init inline void algo::ch_Init(algo::LnumStr1_U32 &parent) { for (int i = 0; i < 1; i++) { @@ -3837,11 +3995,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr20_U64& parent) { return ret; } -// --- algo.LnumStr20_U64.ch.HashStrptr -inline u32 algo::LnumStr20_U64_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr20_U64.ch.Init inline void algo::ch_Init(algo::LnumStr20_U64 &parent) { for (int i = 0; i < 20; i++) { @@ -3950,11 +4103,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr22_U64& parent) { return ret; } -// --- algo.LnumStr22_U64.ch.HashStrptr -inline u32 algo::LnumStr22_U64_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr22_U64.ch.Init inline void algo::ch_Init(algo::LnumStr22_U64 &parent) { for (int i = 0; i < 22; i++) { @@ -4064,11 +4212,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr2_U32& parent) { return ret; } -// --- algo.LnumStr2_U32.ch.HashStrptr -inline u32 algo::LnumStr2_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr2_U32.ch.Init inline void algo::ch_Init(algo::LnumStr2_U32 &parent) { for (int i = 0; i < 2; i++) { @@ -4175,11 +4318,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr3_U32& parent) { return ret; } -// --- algo.LnumStr3_U32.ch.HashStrptr -inline u32 algo::LnumStr3_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr3_U32.ch.Init inline void algo::ch_Init(algo::LnumStr3_U32 &parent) { for (int i = 0; i < 3; i++) { @@ -4287,11 +4425,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr4_U32& parent) { return ret; } -// --- algo.LnumStr4_U32.ch.HashStrptr -inline u32 algo::LnumStr4_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr4_U32.ch.Init inline void algo::ch_Init(algo::LnumStr4_U32 &parent) { for (int i = 0; i < 4; i++) { @@ -4398,11 +4531,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr5_U32& parent) { return ret; } -// --- algo.LnumStr5_U32.ch.HashStrptr -inline u32 algo::LnumStr5_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr5_U32.ch.Init inline void algo::ch_Init(algo::LnumStr5_U32 &parent) { for (int i = 0; i < 5; i++) { @@ -4510,11 +4638,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr5_U32_Base36& paren return ret; } -// --- algo.LnumStr5_U32_Base36.ch.HashStrptr -inline u32 algo::LnumStr5_U32_Base36_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr5_U32_Base36.ch.Init inline void algo::ch_Init(algo::LnumStr5_U32_Base36 &parent) { for (int i = 0; i < 5; i++) { @@ -4622,11 +4745,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr6_U32& parent) { return ret; } -// --- algo.LnumStr6_U32.ch.HashStrptr -inline u32 algo::LnumStr6_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr6_U32.ch.Init inline void algo::ch_Init(algo::LnumStr6_U32 &parent) { for (int i = 0; i < 6; i++) { @@ -4734,11 +4852,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr7_U32& parent) { return ret; } -// --- algo.LnumStr7_U32.ch.HashStrptr -inline u32 algo::LnumStr7_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr7_U32.ch.Init inline void algo::ch_Init(algo::LnumStr7_U32 &parent) { for (int i = 0; i < 7; i++) { @@ -4847,11 +4960,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr7_U32_Base36& paren return ret; } -// --- algo.LnumStr7_U32_Base36.ch.HashStrptr -inline u32 algo::LnumStr7_U32_Base36_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr7_U32_Base36.ch.Init inline void algo::ch_Init(algo::LnumStr7_U32_Base36 &parent) { for (int i = 0; i < 7; i++) { @@ -4960,11 +5068,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr8_U32& parent) { return ret; } -// --- algo.LnumStr8_U32.ch.HashStrptr -inline u32 algo::LnumStr8_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr8_U32.ch.Init inline void algo::ch_Init(algo::LnumStr8_U32 &parent) { for (int i = 0; i < 8; i++) { @@ -5071,11 +5174,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr8_U32_Base16& paren return ret; } -// --- algo.LnumStr8_U32_Base16.ch.HashStrptr -inline u32 algo::LnumStr8_U32_Base16_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr8_U32_Base16.ch.Init inline void algo::ch_Init(algo::LnumStr8_U32_Base16 &parent) { for (int i = 0; i < 8; i++) { @@ -5182,11 +5280,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr8_U64& parent) { return ret; } -// --- algo.LnumStr8_U64.ch.HashStrptr -inline u32 algo::LnumStr8_U64_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr8_U64.ch.Init inline void algo::ch_Init(algo::LnumStr8_U64 &parent) { for (int i = 0; i < 8; i++) { @@ -5293,11 +5386,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr9_U32& parent) { return ret; } -// --- algo.LnumStr9_U32.ch.HashStrptr -inline u32 algo::LnumStr9_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr9_U32.ch.Init inline void algo::ch_Init(algo::LnumStr9_U32 &parent) { for (int i = 0; i < 9; i++) { @@ -5405,11 +5493,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LnumStr9_U64& parent) { return ret; } -// --- algo.LnumStr9_U64.ch.HashStrptr -inline u32 algo::LnumStr9_U64_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LnumStr9_U64.ch.Init inline void algo::ch_Init(algo::LnumStr9_U64 &parent) { for (int i = 0; i < 9; i++) { @@ -5517,11 +5600,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr10& parent) { return ret; } -// --- algo.LspaceStr10.ch.HashStrptr -inline u32 algo::LspaceStr10_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr10.ch.Init inline void algo::ch_Init(algo::LspaceStr10 &parent) { memset(parent.ch, ' ', 10); @@ -5625,11 +5703,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr12& parent) { return ret; } -// --- algo.LspaceStr12.ch.HashStrptr -inline u32 algo::LspaceStr12_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr12.ch.Init inline void algo::ch_Init(algo::LspaceStr12 &parent) { memset(parent.ch, ' ', 12); @@ -5733,11 +5806,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr14& parent) { return ret; } -// --- algo.LspaceStr14.ch.HashStrptr -inline u32 algo::LspaceStr14_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr14.ch.Init inline void algo::ch_Init(algo::LspaceStr14 &parent) { memset(parent.ch, ' ', 14); @@ -5842,11 +5910,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr15& parent) { return ret; } -// --- algo.LspaceStr15.ch.HashStrptr -inline u32 algo::LspaceStr15_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr15.ch.Init inline void algo::ch_Init(algo::LspaceStr15 &parent) { memset(parent.ch, ' ', 15); @@ -5952,11 +6015,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr20_I64& parent) { return ret; } -// --- algo.LspaceStr20_I64.ch.HashStrptr -inline u32 algo::LspaceStr20_I64_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr20_I64.ch.Init inline void algo::ch_Init(algo::LspaceStr20_I64 &parent) { memset(parent.ch, ' ', 20); @@ -6061,11 +6119,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr20_U64& parent) { return ret; } -// --- algo.LspaceStr20_U64.ch.HashStrptr -inline u32 algo::LspaceStr20_U64_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr20_U64.ch.Init inline void algo::ch_Init(algo::LspaceStr20_U64 &parent) { memset(parent.ch, ' ', 20); @@ -6170,11 +6223,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr3& parent) { return ret; } -// --- algo.LspaceStr3.ch.HashStrptr -inline u32 algo::LspaceStr3_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr3.ch.Init inline void algo::ch_Init(algo::LspaceStr3 &parent) { memset(parent.ch, ' ', 3); @@ -6278,11 +6326,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr3_I16& parent) { return ret; } -// --- algo.LspaceStr3_I16.ch.HashStrptr -inline u32 algo::LspaceStr3_I16_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr3_I16.ch.Init inline void algo::ch_Init(algo::LspaceStr3_I16 &parent) { memset(parent.ch, ' ', 3); @@ -6386,11 +6429,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr4& parent) { return ret; } -// --- algo.LspaceStr4.ch.HashStrptr -inline u32 algo::LspaceStr4_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr4.ch.Init inline void algo::ch_Init(algo::LspaceStr4 &parent) { memset(parent.ch, ' ', 4); @@ -6493,11 +6531,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr5& parent) { return ret; } -// --- algo.LspaceStr5.ch.HashStrptr -inline u32 algo::LspaceStr5_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr5.ch.Init inline void algo::ch_Init(algo::LspaceStr5 &parent) { memset(parent.ch, ' ', 5); @@ -6601,11 +6634,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr5_I16& parent) { return ret; } -// --- algo.LspaceStr5_I16.ch.HashStrptr -inline u32 algo::LspaceStr5_I16_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr5_I16.ch.Init inline void algo::ch_Init(algo::LspaceStr5_I16 &parent) { memset(parent.ch, ' ', 5); @@ -6709,11 +6737,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr6& parent) { return ret; } -// --- algo.LspaceStr6.ch.HashStrptr -inline u32 algo::LspaceStr6_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr6.ch.Init inline void algo::ch_Init(algo::LspaceStr6 &parent) { memset(parent.ch, ' ', 6); @@ -6817,11 +6840,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr6_U32& parent) { return ret; } -// --- algo.LspaceStr6_U32.ch.HashStrptr -inline u32 algo::LspaceStr6_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr6_U32.ch.Init inline void algo::ch_Init(algo::LspaceStr6_U32 &parent) { memset(parent.ch, ' ', 6); @@ -6925,11 +6943,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr7_I32_Base36& par return ret; } -// --- algo.LspaceStr7_I32_Base36.ch.HashStrptr -inline u32 algo::LspaceStr7_I32_Base36_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr7_I32_Base36.ch.Init inline void algo::ch_Init(algo::LspaceStr7_I32_Base36 &parent) { memset(parent.ch, ' ', 7); @@ -7034,11 +7047,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr8& parent) { return ret; } -// --- algo.LspaceStr8.ch.HashStrptr -inline u32 algo::LspaceStr8_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr8.ch.Init inline void algo::ch_Init(algo::LspaceStr8 &parent) { memset(parent.ch, ' ', 8); @@ -7141,11 +7149,6 @@ inline algo::aryptr algo::ch_Getary(const algo::LspaceStr9& parent) { return ret; } -// --- algo.LspaceStr9.ch.HashStrptr -inline u32 algo::LspaceStr9_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.LspaceStr9.ch.Init inline void algo::ch_Init(algo::LspaceStr9 &parent) { memset(parent.ch, ' ', 9); @@ -7486,11 +7489,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr1& parent) { return ret; } -// --- algo.RnullStr1.ch.HashStrptr -inline u32 algo::RnullStr1_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr1.ch.Init inline void algo::ch_Init(algo::RnullStr1 &parent) { memset(parent.ch, 0, 1); @@ -7626,11 +7624,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr10& parent) { return ret; } -// --- algo.RnullStr10.ch.HashStrptr -inline u32 algo::RnullStr10_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr10.ch.Init inline void algo::ch_Init(algo::RnullStr10 &parent) { memset(parent.ch, 0, 10); @@ -7767,11 +7760,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr100& parent) { return ret; } -// --- algo.RnullStr100.ch.HashStrptr -inline u32 algo::RnullStr100_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr100.ch.Init inline void algo::ch_Init(algo::RnullStr100 &parent) { memset(parent.ch, 0, 100); @@ -7889,11 +7877,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr1000& parent) { return ret; } -// --- algo.RnullStr1000.ch.HashStrptr -inline u32 algo::RnullStr1000_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr1000.ch.Init inline void algo::ch_Init(algo::RnullStr1000 &parent) { memset(parent.ch, 0, 1000); @@ -8030,11 +8013,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr11& parent) { return ret; } -// --- algo.RnullStr11.ch.HashStrptr -inline u32 algo::RnullStr11_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr11.ch.Init inline void algo::ch_Init(algo::RnullStr11 &parent) { memset(parent.ch, 0, 11); @@ -8172,11 +8150,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr12& parent) { return ret; } -// --- algo.RnullStr12.ch.HashStrptr -inline u32 algo::RnullStr12_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr12.ch.Init inline void algo::ch_Init(algo::RnullStr12 &parent) { memset(parent.ch, 0, 12); @@ -8313,11 +8286,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr129& parent) { return ret; } -// --- algo.RnullStr129.ch.HashStrptr -inline u32 algo::RnullStr129_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr129.ch.Init inline void algo::ch_Init(algo::RnullStr129 &parent) { memset(parent.ch, 0, 129); @@ -8456,11 +8424,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr13& parent) { return ret; } -// --- algo.RnullStr13.ch.HashStrptr -inline u32 algo::RnullStr13_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr13.ch.Init inline void algo::ch_Init(algo::RnullStr13 &parent) { memset(parent.ch, 0, 13); @@ -8598,11 +8561,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr14& parent) { return ret; } -// --- algo.RnullStr14.ch.HashStrptr -inline u32 algo::RnullStr14_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr14.ch.Init inline void algo::ch_Init(algo::RnullStr14 &parent) { memset(parent.ch, 0, 14); @@ -8740,11 +8698,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr15& parent) { return ret; } -// --- algo.RnullStr15.ch.HashStrptr -inline u32 algo::RnullStr15_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr15.ch.Init inline void algo::ch_Init(algo::RnullStr15 &parent) { memset(parent.ch, 0, 15); @@ -8883,11 +8836,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr151& parent) { return ret; } -// --- algo.RnullStr151.ch.HashStrptr -inline u32 algo::RnullStr151_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr151.ch.Init inline void algo::ch_Init(algo::RnullStr151 &parent) { memset(parent.ch, 0, 151); @@ -9028,11 +8976,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr16& parent) { return ret; } -// --- algo.RnullStr16.ch.HashStrptr -inline u32 algo::RnullStr16_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr16.ch.Init inline void algo::ch_Init(algo::RnullStr16 &parent) { memset(parent.ch, 0, 16); @@ -9139,11 +9082,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr17& parent) { return ret; } -// --- algo.RnullStr17.ch.HashStrptr -inline u32 algo::RnullStr17_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr17.ch.Init inline void algo::ch_Init(algo::RnullStr17 &parent) { memset(parent.ch, 0, 17); @@ -9281,11 +9219,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr18& parent) { return ret; } -// --- algo.RnullStr18.ch.HashStrptr -inline u32 algo::RnullStr18_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr18.ch.Init inline void algo::ch_Init(algo::RnullStr18 &parent) { memset(parent.ch, 0, 18); @@ -9423,11 +9356,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr19& parent) { return ret; } -// --- algo.RnullStr19.ch.HashStrptr -inline u32 algo::RnullStr19_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr19.ch.Init inline void algo::ch_Init(algo::RnullStr19 &parent) { memset(parent.ch, 0, 19); @@ -9536,11 +9464,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr2& parent) { return ret; } -// --- algo.RnullStr2.ch.HashStrptr -inline u32 algo::RnullStr2_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr2.ch.Init inline void algo::ch_Init(algo::RnullStr2 &parent) { memset(parent.ch, 0, 2); @@ -9676,11 +9599,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr20& parent) { return ret; } -// --- algo.RnullStr20.ch.HashStrptr -inline u32 algo::RnullStr20_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr20.ch.Init inline void algo::ch_Init(algo::RnullStr20 &parent) { memset(parent.ch, 0, 20); @@ -9818,11 +9736,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr21& parent) { return ret; } -// --- algo.RnullStr21.ch.HashStrptr -inline u32 algo::RnullStr21_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr21.ch.Init inline void algo::ch_Init(algo::RnullStr21 &parent) { memset(parent.ch, 0, 21); @@ -9931,11 +9844,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr24& parent) { return ret; } -// --- algo.RnullStr24.ch.HashStrptr -inline u32 algo::RnullStr24_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr24.ch.Init inline void algo::ch_Init(algo::RnullStr24 &parent) { memset(parent.ch, 0, 24); @@ -10073,11 +9981,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr25& parent) { return ret; } -// --- algo.RnullStr25.ch.HashStrptr -inline u32 algo::RnullStr25_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr25.ch.Init inline void algo::ch_Init(algo::RnullStr25 &parent) { memset(parent.ch, 0, 25); @@ -10216,11 +10119,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr28& parent) { return ret; } -// --- algo.RnullStr28.ch.HashStrptr -inline u32 algo::RnullStr28_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr28.ch.Init inline void algo::ch_Init(algo::RnullStr28 &parent) { memset(parent.ch, 0, 28); @@ -10359,11 +10257,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr3& parent) { return ret; } -// --- algo.RnullStr3.ch.HashStrptr -inline u32 algo::RnullStr3_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr3.ch.Init inline void algo::ch_Init(algo::RnullStr3 &parent) { memset(parent.ch, 0, 3); @@ -10500,11 +10393,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr30& parent) { return ret; } -// --- algo.RnullStr30.ch.HashStrptr -inline u32 algo::RnullStr30_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr30.ch.Init inline void algo::ch_Init(algo::RnullStr30 &parent) { memset(parent.ch, 0, 30); @@ -10614,11 +10502,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr32& parent) { return ret; } -// --- algo.RnullStr32.ch.HashStrptr -inline u32 algo::RnullStr32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr32.ch.Init inline void algo::ch_Init(algo::RnullStr32 &parent) { memset(parent.ch, 0, 32); @@ -10757,11 +10640,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr33& parent) { return ret; } -// --- algo.RnullStr33.ch.HashStrptr -inline u32 algo::RnullStr33_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr33.ch.Init inline void algo::ch_Init(algo::RnullStr33 &parent) { memset(parent.ch, 0, 33); @@ -10901,11 +10779,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr35& parent) { return ret; } -// --- algo.RnullStr35.ch.HashStrptr -inline u32 algo::RnullStr35_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr35.ch.Init inline void algo::ch_Init(algo::RnullStr35 &parent) { memset(parent.ch, 0, 35); @@ -11046,11 +10919,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr36& parent) { return ret; } -// --- algo.RnullStr36.ch.HashStrptr -inline u32 algo::RnullStr36_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr36.ch.Init inline void algo::ch_Init(algo::RnullStr36 &parent) { memset(parent.ch, 0, 36); @@ -11190,11 +11058,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr4& parent) { return ret; } -// --- algo.RnullStr4.ch.HashStrptr -inline u32 algo::RnullStr4_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr4.ch.Init inline void algo::ch_Init(algo::RnullStr4 &parent) { memset(parent.ch, 0, 4); @@ -11300,11 +11163,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr40& parent) { return ret; } -// --- algo.RnullStr40.ch.HashStrptr -inline u32 algo::RnullStr40_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr40.ch.Init inline void algo::ch_Init(algo::RnullStr40 &parent) { memset(parent.ch, 0, 40); @@ -11444,11 +11302,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr41& parent) { return ret; } -// --- algo.RnullStr41.ch.HashStrptr -inline u32 algo::RnullStr41_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr41.ch.Init inline void algo::ch_Init(algo::RnullStr41 &parent) { memset(parent.ch, 0, 41); @@ -11589,11 +11442,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr43& parent) { return ret; } -// --- algo.RnullStr43.ch.HashStrptr -inline u32 algo::RnullStr43_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr43.ch.Init inline void algo::ch_Init(algo::RnullStr43 &parent) { memset(parent.ch, 0, 43); @@ -11705,11 +11553,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr44& parent) { return ret; } -// --- algo.RnullStr44.ch.HashStrptr -inline u32 algo::RnullStr44_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr44.ch.Init inline void algo::ch_Init(algo::RnullStr44 &parent) { memset(parent.ch, 0, 44); @@ -11820,11 +11663,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr48& parent) { return ret; } -// --- algo.RnullStr48.ch.HashStrptr -inline u32 algo::RnullStr48_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr48.ch.Init inline void algo::ch_Init(algo::RnullStr48 &parent) { memset(parent.ch, 0, 48); @@ -11935,11 +11773,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr5& parent) { return ret; } -// --- algo.RnullStr5.ch.HashStrptr -inline u32 algo::RnullStr5_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr5.ch.Init inline void algo::ch_Init(algo::RnullStr5 &parent) { memset(parent.ch, 0, 5); @@ -12046,11 +11879,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr50& parent) { return ret; } -// --- algo.RnullStr50.ch.HashStrptr -inline u32 algo::RnullStr50_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr50.ch.Init inline void algo::ch_Init(algo::RnullStr50 &parent) { memset(parent.ch, 0, 50); @@ -12162,11 +11990,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr54& parent) { return ret; } -// --- algo.RnullStr54.ch.HashStrptr -inline u32 algo::RnullStr54_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr54.ch.Init inline void algo::ch_Init(algo::RnullStr54 &parent) { memset(parent.ch, 0, 54); @@ -12309,11 +12132,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr55& parent) { return ret; } -// --- algo.RnullStr55.ch.HashStrptr -inline u32 algo::RnullStr55_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr55.ch.Init inline void algo::ch_Init(algo::RnullStr55 &parent) { memset(parent.ch, 0, 55); @@ -12427,11 +12245,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr6& parent) { return ret; } -// --- algo.RnullStr6.ch.HashStrptr -inline u32 algo::RnullStr6_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr6.ch.Init inline void algo::ch_Init(algo::RnullStr6 &parent) { memset(parent.ch, 0, 6); @@ -12568,11 +12381,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr60& parent) { return ret; } -// --- algo.RnullStr60.ch.HashStrptr -inline u32 algo::RnullStr60_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr60.ch.Init inline void algo::ch_Init(algo::RnullStr60 &parent) { memset(parent.ch, 0, 60); @@ -12715,11 +12523,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr62& parent) { return ret; } -// --- algo.RnullStr62.ch.HashStrptr -inline u32 algo::RnullStr62_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr62.ch.Init inline void algo::ch_Init(algo::RnullStr62 &parent) { memset(parent.ch, 0, 62); @@ -12863,11 +12666,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr66& parent) { return ret; } -// --- algo.RnullStr66.ch.HashStrptr -inline u32 algo::RnullStr66_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr66.ch.Init inline void algo::ch_Init(algo::RnullStr66 &parent) { memset(parent.ch, 0, 66); @@ -12981,11 +12779,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr6_U32& parent) { return ret; } -// --- algo.RnullStr6_U32.ch.HashStrptr -inline u32 algo::RnullStr6_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr6_U32.ch.Init inline void algo::ch_Init(algo::RnullStr6_U32 &parent) { memset(parent.ch, 0, 6); @@ -13087,11 +12880,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr7& parent) { return ret; } -// --- algo.RnullStr7.ch.HashStrptr -inline u32 algo::RnullStr7_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr7.ch.Init inline void algo::ch_Init(algo::RnullStr7 &parent) { memset(parent.ch, 0, 7); @@ -13229,11 +13017,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr8& parent) { return ret; } -// --- algo.RnullStr8.ch.HashStrptr -inline u32 algo::RnullStr8_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr8.ch.Init inline void algo::ch_Init(algo::RnullStr8 &parent) { memset(parent.ch, 0, 8); @@ -13339,11 +13122,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr80& parent) { return ret; } -// --- algo.RnullStr80.ch.HashStrptr -inline u32 algo::RnullStr80_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr80.ch.Init inline void algo::ch_Init(algo::RnullStr80 &parent) { memset(parent.ch, 0, 80); @@ -13458,11 +13236,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RnullStr9& parent) { return ret; } -// --- algo.RnullStr9.ch.HashStrptr -inline u32 algo::RnullStr9_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RnullStr9.ch.Init inline void algo::ch_Init(algo::RnullStr9 &parent) { memset(parent.ch, 0, 9); @@ -13599,11 +13372,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr10& parent) { return ret; } -// --- algo.RspaceStr10.ch.HashStrptr -inline u32 algo::RspaceStr10_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr10.ch.Init inline void algo::ch_Init(algo::RspaceStr10 &parent) { memset(parent.ch, ' ', 10); @@ -13705,11 +13473,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr100& parent) { return ret; } -// --- algo.RspaceStr100.ch.HashStrptr -inline u32 algo::RspaceStr100_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr100.ch.Init inline void algo::ch_Init(algo::RspaceStr100 &parent) { memset(parent.ch, ' ', 100); @@ -13822,11 +13585,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr11& parent) { return ret; } -// --- algo.RspaceStr11.ch.HashStrptr -inline u32 algo::RspaceStr11_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr11.ch.Init inline void algo::ch_Init(algo::RspaceStr11 &parent) { memset(parent.ch, ' ', 11); @@ -13929,11 +13687,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr12& parent) { return ret; } -// --- algo.RspaceStr12.ch.HashStrptr -inline u32 algo::RspaceStr12_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr12.ch.Init inline void algo::ch_Init(algo::RspaceStr12 &parent) { memset(parent.ch, ' ', 12); @@ -14035,11 +13788,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr128& parent) { return ret; } -// --- algo.RspaceStr128.ch.HashStrptr -inline u32 algo::RspaceStr128_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr128.ch.Init inline void algo::ch_Init(algo::RspaceStr128 &parent) { memset(parent.ch, ' ', 128); @@ -14155,11 +13903,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr14& parent) { return ret; } -// --- algo.RspaceStr14.ch.HashStrptr -inline u32 algo::RspaceStr14_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr14.ch.Init inline void algo::ch_Init(algo::RspaceStr14 &parent) { memset(parent.ch, ' ', 14); @@ -14262,11 +14005,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr15& parent) { return ret; } -// --- algo.RspaceStr15.ch.HashStrptr -inline u32 algo::RspaceStr15_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr15.ch.Init inline void algo::ch_Init(algo::RspaceStr15 &parent) { memset(parent.ch, ' ', 15); @@ -14370,11 +14108,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr16& parent) { return ret; } -// --- algo.RspaceStr16.ch.HashStrptr -inline u32 algo::RspaceStr16_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr16.ch.Init inline void algo::ch_Init(algo::RspaceStr16 &parent) { memset(parent.ch, ' ', 16); @@ -14481,11 +14214,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr18& parent) { return ret; } -// --- algo.RspaceStr18.ch.HashStrptr -inline u32 algo::RspaceStr18_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr18.ch.Init inline void algo::ch_Init(algo::RspaceStr18 &parent) { memset(parent.ch, ' ', 18); @@ -14588,11 +14316,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr2& parent) { return ret; } -// --- algo.RspaceStr2.ch.HashStrptr -inline u32 algo::RspaceStr2_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr2.ch.Init inline void algo::ch_Init(algo::RspaceStr2 &parent) { memset(parent.ch, ' ', 2); @@ -14693,11 +14416,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr20& parent) { return ret; } -// --- algo.RspaceStr20.ch.HashStrptr -inline u32 algo::RspaceStr20_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr20.ch.Init inline void algo::ch_Init(algo::RspaceStr20 &parent) { memset(parent.ch, ' ', 20); @@ -14800,11 +14518,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr200& parent) { return ret; } -// --- algo.RspaceStr200.ch.HashStrptr -inline u32 algo::RspaceStr200_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr200.ch.Init inline void algo::ch_Init(algo::RspaceStr200 &parent) { memset(parent.ch, ' ', 200); @@ -14854,7 +14567,7 @@ inline bool algo::RspaceStr200::operator !=(const algo::RspaceStr200 &rhs) const } // --- algo.RspaceStr200..Cmp -inline i32 algo::RspaceStr200_Cmp(algo::RspaceStr200& lhs, algo::RspaceStr200& rhs) { +inline i32 algo::RspaceStr200_Cmp(algo::RspaceStr200 lhs, algo::RspaceStr200 rhs) { i32 retval = 0; retval = algo::strptr_Cmp(ch_Getary(lhs), ch_Getary(rhs)); return retval; @@ -14867,7 +14580,7 @@ inline void algo::RspaceStr200_Init(algo::RspaceStr200& parent) { } // --- algo.RspaceStr200..Eq -inline bool algo::RspaceStr200_Eq(algo::RspaceStr200& lhs, algo::RspaceStr200& rhs) { +inline bool algo::RspaceStr200_Eq(algo::RspaceStr200 lhs, algo::RspaceStr200 rhs) { bool retval = true; for (int i=0; i<25 && retval; i++) { retval = ((u64*)lhs.ch)[i] == ((u64*)rhs.ch)[i]; @@ -14906,11 +14619,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr21& parent) { return ret; } -// --- algo.RspaceStr21.ch.HashStrptr -inline u32 algo::RspaceStr21_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr21.ch.Init inline void algo::ch_Init(algo::RspaceStr21 &parent) { memset(parent.ch, ' ', 21); @@ -15014,11 +14722,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr24& parent) { return ret; } -// --- algo.RspaceStr24.ch.HashStrptr -inline u32 algo::RspaceStr24_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr24.ch.Init inline void algo::ch_Init(algo::RspaceStr24 &parent) { memset(parent.ch, ' ', 24); @@ -15126,11 +14829,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr240& parent) { return ret; } -// --- algo.RspaceStr240.ch.HashStrptr -inline u32 algo::RspaceStr240_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr240.ch.Init inline void algo::ch_Init(algo::RspaceStr240 &parent) { memset(parent.ch, ' ', 240); @@ -15232,11 +14930,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr25& parent) { return ret; } -// --- algo.RspaceStr25.ch.HashStrptr -inline u32 algo::RspaceStr25_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr25.ch.Init inline void algo::ch_Init(algo::RspaceStr25 &parent) { memset(parent.ch, ' ', 25); @@ -15345,11 +15038,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr26& parent) { return ret; } -// --- algo.RspaceStr26.ch.HashStrptr -inline u32 algo::RspaceStr26_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr26.ch.Init inline void algo::ch_Init(algo::RspaceStr26 &parent) { memset(parent.ch, ' ', 26); @@ -15453,11 +15141,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr3& parent) { return ret; } -// --- algo.RspaceStr3.ch.HashStrptr -inline u32 algo::RspaceStr3_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr3.ch.Init inline void algo::ch_Init(algo::RspaceStr3 &parent) { memset(parent.ch, ' ', 3); @@ -15559,11 +15242,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr31& parent) { return ret; } -// --- algo.RspaceStr31.ch.HashStrptr -inline u32 algo::RspaceStr31_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr31.ch.Init inline void algo::ch_Init(algo::RspaceStr31 &parent) { memset(parent.ch, ' ', 31); @@ -15669,11 +15347,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr32& parent) { return ret; } -// --- algo.RspaceStr32.ch.HashStrptr -inline u32 algo::RspaceStr32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr32.ch.Init inline void algo::ch_Init(algo::RspaceStr32 &parent) { memset(parent.ch, ' ', 32); @@ -15777,11 +15450,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr4& parent) { return ret; } -// --- algo.RspaceStr4.ch.HashStrptr -inline u32 algo::RspaceStr4_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr4.ch.Init inline void algo::ch_Init(algo::RspaceStr4 &parent) { memset(parent.ch, ' ', 4); @@ -15882,11 +15550,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr40& parent) { return ret; } -// --- algo.RspaceStr40.ch.HashStrptr -inline u32 algo::RspaceStr40_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr40.ch.Init inline void algo::ch_Init(algo::RspaceStr40 &parent) { memset(parent.ch, ' ', 40); @@ -15981,11 +15644,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr5& parent) { return ret; } -// --- algo.RspaceStr5.ch.HashStrptr -inline u32 algo::RspaceStr5_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr5.ch.Init inline void algo::ch_Init(algo::RspaceStr5 &parent) { memset(parent.ch, ' ', 5); @@ -16087,11 +15745,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr50& parent) { return ret; } -// --- algo.RspaceStr50.ch.HashStrptr -inline u32 algo::RspaceStr50_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr50.ch.Init inline void algo::ch_Init(algo::RspaceStr50 &parent) { memset(parent.ch, ' ', 50); @@ -16198,11 +15851,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr6& parent) { return ret; } -// --- algo.RspaceStr6.ch.HashStrptr -inline u32 algo::RspaceStr6_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr6.ch.Init inline void algo::ch_Init(algo::RspaceStr6 &parent) { memset(parent.ch, ' ', 6); @@ -16339,11 +15987,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr64& parent) { return ret; } -// --- algo.RspaceStr64.ch.HashStrptr -inline u32 algo::RspaceStr64_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr64.ch.Init inline void algo::ch_Init(algo::RspaceStr64 &parent) { memset(parent.ch, ' ', 64); @@ -16451,11 +16094,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr7& parent) { return ret; } -// --- algo.RspaceStr7.ch.HashStrptr -inline u32 algo::RspaceStr7_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr7.ch.Init inline void algo::ch_Init(algo::RspaceStr7 &parent) { memset(parent.ch, ' ', 7); @@ -16558,11 +16196,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr75& parent) { return ret; } -// --- algo.RspaceStr75.ch.HashStrptr -inline u32 algo::RspaceStr75_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr75.ch.Init inline void algo::ch_Init(algo::RspaceStr75 &parent) { memset(parent.ch, ' ', 75); @@ -16673,11 +16306,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr8& parent) { return ret; } -// --- algo.RspaceStr8.ch.HashStrptr -inline u32 algo::RspaceStr8_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr8.ch.Init inline void algo::ch_Init(algo::RspaceStr8 &parent) { memset(parent.ch, ' ', 8); @@ -16783,11 +16411,6 @@ inline algo::aryptr algo::ch_Getary(const algo::RspaceStr9& parent) { return ret; } -// --- algo.RspaceStr9.ch.HashStrptr -inline u32 algo::RspaceStr9_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.RspaceStr9.ch.Init inline void algo::ch_Init(algo::RspaceStr9 &parent) { memset(parent.ch, ' ', 9); @@ -17165,11 +16788,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr1& parent) { return ret; } -// --- algo.Smallstr1.ch.HashStrptr -inline u32 algo::Smallstr1_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr1.ch.Init inline void algo::ch_Init(algo::Smallstr1 &parent) { parent.n_ch = 0; @@ -17288,11 +16906,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr10& parent) { return ret; } -// --- algo.Smallstr10.ch.HashStrptr -inline u32 algo::Smallstr10_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr10.ch.Init inline void algo::ch_Init(algo::Smallstr10 &parent) { parent.n_ch = 0; @@ -17411,11 +17024,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr16& parent) { return ret; } -// --- algo.Smallstr16.ch.HashStrptr -inline u32 algo::Smallstr16_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr16.ch.Init inline void algo::ch_Init(algo::Smallstr16 &parent) { parent.n_ch = 0; @@ -17534,11 +17142,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr2& parent) { return ret; } -// --- algo.Smallstr2.ch.HashStrptr -inline u32 algo::Smallstr2_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr2.ch.Init inline void algo::ch_Init(algo::Smallstr2 &parent) { parent.n_ch = 0; @@ -17657,11 +17260,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr20& parent) { return ret; } -// --- algo.Smallstr20.ch.HashStrptr -inline u32 algo::Smallstr20_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr20.ch.Init inline void algo::ch_Init(algo::Smallstr20 &parent) { parent.n_ch = 0; @@ -17815,11 +17413,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr200& parent) { return ret; } -// --- algo.Smallstr200.ch.HashStrptr -inline u32 algo::Smallstr200_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr200.ch.Init inline void algo::ch_Init(algo::Smallstr200 &parent) { parent.n_ch = 0; @@ -17908,6 +17501,124 @@ inline algo::Smallstr200::Smallstr200(const algo::Smallstr200 &rhs) { n_ch = rhs.n_ch; } +// --- algo.Smallstr249.ch.Add +// Append character to string. +// If there is no space for an extra character, do nothing. +inline void algo::ch_Add(algo::Smallstr249& parent, char c) { + if (parent.n_ch < 249) { + parent.ch[parent.n_ch++] = c; + } +} + +// --- algo.Smallstr249.ch.AddStrptr +// Append string to this string. +// If there is no space for an extra character, trim. +// If there is no space left, dump core in debug mode. +inline void algo::ch_AddStrptr(algo::Smallstr249& parent, algo::strptr str) { + int n_new = str.n_elems; + if (parent.n_ch + n_new > 249) { + n_new = 249 - parent.n_ch; + } + memcpy(parent.ch + parent.n_ch, str.elems, n_new); + parent.n_ch = u8(parent.n_ch + n_new); +} + +// --- algo.Smallstr249.ch.Getary +// Access string as array of chars +inline algo::aryptr algo::ch_Getary(const algo::Smallstr249& parent) { + int len = ch_N(parent); + algo::aryptr ret((char*)parent.ch, len); + return ret; +} + +// --- algo.Smallstr249.ch.Init +inline void algo::ch_Init(algo::Smallstr249 &parent) { + parent.n_ch = 0; +} + +// --- algo.Smallstr249.ch.Max +// always return constant 249 +inline int algo::ch_Max(algo::Smallstr249& parent) { + (void)parent; + return 249; +} + +// --- algo.Smallstr249.ch.N +inline int algo::ch_N(const algo::Smallstr249& parent) { + u64 ret; + ret = parent.n_ch; + return int(ret); +} + +// --- algo.Smallstr249.ch.AssignStrptr +// Copy from strptr (operator=) +inline void algo::Smallstr249::operator =(const algo::strptr &str) { + ch_SetStrptr(*this, str); +} + +// --- algo.Smallstr249.ch.CtorStrptr +inline algo::Smallstr249::Smallstr249(const algo::strptr &rhs) { + ch_SetStrptr(*this, rhs); +} + +// --- algo.Smallstr249.ch.Cast +inline algo::Smallstr249::operator algo::strptr() const { + return ch_Getary(*this); +} + +// --- algo.Smallstr249..EqOp +inline bool algo::Smallstr249::operator ==(const algo::Smallstr249 &rhs) const { + return algo::Smallstr249_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.Smallstr249..NeOp +inline bool algo::Smallstr249::operator !=(const algo::Smallstr249 &rhs) const { + return !algo::Smallstr249_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.Smallstr249..Cmp +inline i32 algo::Smallstr249_Cmp(algo::Smallstr249& lhs, algo::Smallstr249& rhs) { + i32 retval = 0; + retval = algo::strptr_Cmp(ch_Getary(lhs), ch_Getary(rhs)); + return retval; +} + +// --- algo.Smallstr249..Init +// Set all fields to initial values. +inline void algo::Smallstr249_Init(algo::Smallstr249& parent) { + parent.n_ch = 0; +} + +// --- algo.Smallstr249..Eq +inline bool algo::Smallstr249_Eq(algo::Smallstr249& lhs, algo::Smallstr249& rhs) { + bool retval = true; + retval = algo::strptr_Eq(ch_Getary(lhs), ch_Getary(rhs)); + return retval; +} + +// --- algo.Smallstr249..EqOpAryptr +inline bool algo::Smallstr249::operator ==(const algo::aryptr &rhs) const { + return algo::strptr_Eq(ch_Getary(*this), rhs); +} + +// --- algo.Smallstr249..AssignOp +inline algo::Smallstr249& algo::Smallstr249::operator =(const algo::Smallstr249 &rhs) { + memcpy(ch, rhs.ch, rhs.n_ch); + n_ch = rhs.n_ch; + return *this; +} + +// --- algo.Smallstr249..Ctor +inline algo::Smallstr249::Smallstr249() { + algo::Smallstr249_Init(*this); +} + +// --- algo.Smallstr249..CopyCtor +inline algo::Smallstr249::Smallstr249(const algo::Smallstr249 &rhs) { + memcpy(ch, rhs.ch, rhs.n_ch); + n_ch = rhs.n_ch; +} + // --- algo.Smallstr25.ch.Add // Append character to string. // If there is no space for an extra character, do nothing. @@ -17938,11 +17649,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr25& parent) { return ret; } -// --- algo.Smallstr25.ch.HashStrptr -inline u32 algo::Smallstr25_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr25.ch.Init inline void algo::ch_Init(algo::Smallstr25 &parent) { parent.n_ch = 0; @@ -18031,125 +17737,228 @@ inline algo::Smallstr25::Smallstr25(const algo::Smallstr25 &rhs) { n_ch = rhs.n_ch; } -// --- algo.Smallstr3.ch.Add +// --- algo.Smallstr255.ch.Add // Append character to string. // If there is no space for an extra character, do nothing. -inline void algo::ch_Add(algo::Smallstr3& parent, char c) { - if (parent.n_ch < 3) { +inline void algo::ch_Add(algo::Smallstr255& parent, char c) { + if (parent.n_ch < 255) { parent.ch[parent.n_ch++] = c; } } -// --- algo.Smallstr3.ch.AddStrptr +// --- algo.Smallstr255.ch.AddStrptr // Append string to this string. // If there is no space for an extra character, trim. // If there is no space left, dump core in debug mode. -inline void algo::ch_AddStrptr(algo::Smallstr3& parent, algo::strptr str) { +inline void algo::ch_AddStrptr(algo::Smallstr255& parent, algo::strptr str) { int n_new = str.n_elems; - if (parent.n_ch + n_new > 3) { - n_new = 3 - parent.n_ch; + if (parent.n_ch + n_new > 255) { + n_new = 255 - parent.n_ch; } memcpy(parent.ch + parent.n_ch, str.elems, n_new); parent.n_ch = u8(parent.n_ch + n_new); } -// --- algo.Smallstr3.ch.Getary +// --- algo.Smallstr255.ch.Getary // Access string as array of chars -inline algo::aryptr algo::ch_Getary(const algo::Smallstr3& parent) { +inline algo::aryptr algo::ch_Getary(const algo::Smallstr255& parent) { int len = ch_N(parent); algo::aryptr ret((char*)parent.ch, len); return ret; } -// --- algo.Smallstr3.ch.HashStrptr -inline u32 algo::Smallstr3_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - -// --- algo.Smallstr3.ch.Init -inline void algo::ch_Init(algo::Smallstr3 &parent) { +// --- algo.Smallstr255.ch.Init +inline void algo::ch_Init(algo::Smallstr255 &parent) { parent.n_ch = 0; } -// --- algo.Smallstr3.ch.Max -// always return constant 3 -inline int algo::ch_Max(algo::Smallstr3& parent) { +// --- algo.Smallstr255.ch.Max +// always return constant 255 +inline int algo::ch_Max(algo::Smallstr255& parent) { (void)parent; - return 3; + return 255; } -// --- algo.Smallstr3.ch.N -inline int algo::ch_N(const algo::Smallstr3& parent) { +// --- algo.Smallstr255.ch.N +inline int algo::ch_N(const algo::Smallstr255& parent) { u64 ret; ret = parent.n_ch; return int(ret); } -// --- algo.Smallstr3.ch.AssignStrptr +// --- algo.Smallstr255.ch.AssignStrptr // Copy from strptr (operator=) -inline void algo::Smallstr3::operator =(const algo::strptr &str) { +inline void algo::Smallstr255::operator =(const algo::strptr &str) { ch_SetStrptr(*this, str); } -// --- algo.Smallstr3.ch.CtorStrptr -inline algo::Smallstr3::Smallstr3(const algo::strptr &rhs) { +// --- algo.Smallstr255.ch.CtorStrptr +inline algo::Smallstr255::Smallstr255(const algo::strptr &rhs) { ch_SetStrptr(*this, rhs); } -// --- algo.Smallstr3.ch.Cast -inline algo::Smallstr3::operator algo::strptr() const { +// --- algo.Smallstr255.ch.Cast +inline algo::Smallstr255::operator algo::strptr() const { return ch_Getary(*this); } -// --- algo.Smallstr3..EqOp -inline bool algo::Smallstr3::operator ==(const algo::Smallstr3 &rhs) const { - return algo::Smallstr3_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- algo.Smallstr3..NeOp -inline bool algo::Smallstr3::operator !=(const algo::Smallstr3 &rhs) const { - return !algo::Smallstr3_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- algo.Smallstr3..Cmp -inline i32 algo::Smallstr3_Cmp(algo::Smallstr3& lhs, algo::Smallstr3& rhs) { +// --- algo.Smallstr255..Cmp +inline i32 algo::Smallstr255_Cmp(algo::Smallstr255& lhs, algo::Smallstr255& rhs) { i32 retval = 0; retval = algo::strptr_Cmp(ch_Getary(lhs), ch_Getary(rhs)); return retval; } -// --- algo.Smallstr3..Init +// --- algo.Smallstr255..Init // Set all fields to initial values. -inline void algo::Smallstr3_Init(algo::Smallstr3& parent) { +inline void algo::Smallstr255_Init(algo::Smallstr255& parent) { parent.n_ch = 0; } -// --- algo.Smallstr3..Eq -inline bool algo::Smallstr3_Eq(algo::Smallstr3& lhs, algo::Smallstr3& rhs) { +// --- algo.Smallstr255..Eq +inline bool algo::Smallstr255_Eq(algo::Smallstr255& lhs, algo::Smallstr255& rhs) { bool retval = true; retval = algo::strptr_Eq(ch_Getary(lhs), ch_Getary(rhs)); return retval; } -// --- algo.Smallstr3..EqOpAryptr -inline bool algo::Smallstr3::operator ==(const algo::aryptr &rhs) const { +// --- algo.Smallstr255..EqOpAryptr +inline bool algo::Smallstr255::operator ==(const algo::aryptr &rhs) const { return algo::strptr_Eq(ch_Getary(*this), rhs); } -// --- algo.Smallstr3..AssignOp -inline algo::Smallstr3& algo::Smallstr3::operator =(const algo::Smallstr3 &rhs) { +// --- algo.Smallstr255..AssignOp +inline algo::Smallstr255& algo::Smallstr255::operator =(const algo::Smallstr255 &rhs) { memcpy(ch, rhs.ch, rhs.n_ch); n_ch = rhs.n_ch; return *this; } -// --- algo.Smallstr3..Ctor -inline algo::Smallstr3::Smallstr3() { - algo::Smallstr3_Init(*this); +// --- algo.Smallstr255..Ctor +inline algo::Smallstr255::Smallstr255() { + algo::Smallstr255_Init(*this); } -// --- algo.Smallstr3..CopyCtor -inline algo::Smallstr3::Smallstr3(const algo::Smallstr3 &rhs) { +// --- algo.Smallstr255..CopyCtor +inline algo::Smallstr255::Smallstr255(const algo::Smallstr255 &rhs) { + memcpy(ch, rhs.ch, rhs.n_ch); + n_ch = rhs.n_ch; +} + +// --- algo.Smallstr3.ch.Add +// Append character to string. +// If there is no space for an extra character, do nothing. +inline void algo::ch_Add(algo::Smallstr3& parent, char c) { + if (parent.n_ch < 3) { + parent.ch[parent.n_ch++] = c; + } +} + +// --- algo.Smallstr3.ch.AddStrptr +// Append string to this string. +// If there is no space for an extra character, trim. +// If there is no space left, dump core in debug mode. +inline void algo::ch_AddStrptr(algo::Smallstr3& parent, algo::strptr str) { + int n_new = str.n_elems; + if (parent.n_ch + n_new > 3) { + n_new = 3 - parent.n_ch; + } + memcpy(parent.ch + parent.n_ch, str.elems, n_new); + parent.n_ch = u8(parent.n_ch + n_new); +} + +// --- algo.Smallstr3.ch.Getary +// Access string as array of chars +inline algo::aryptr algo::ch_Getary(const algo::Smallstr3& parent) { + int len = ch_N(parent); + algo::aryptr ret((char*)parent.ch, len); + return ret; +} + +// --- algo.Smallstr3.ch.Init +inline void algo::ch_Init(algo::Smallstr3 &parent) { + parent.n_ch = 0; +} + +// --- algo.Smallstr3.ch.Max +// always return constant 3 +inline int algo::ch_Max(algo::Smallstr3& parent) { + (void)parent; + return 3; +} + +// --- algo.Smallstr3.ch.N +inline int algo::ch_N(const algo::Smallstr3& parent) { + u64 ret; + ret = parent.n_ch; + return int(ret); +} + +// --- algo.Smallstr3.ch.AssignStrptr +// Copy from strptr (operator=) +inline void algo::Smallstr3::operator =(const algo::strptr &str) { + ch_SetStrptr(*this, str); +} + +// --- algo.Smallstr3.ch.CtorStrptr +inline algo::Smallstr3::Smallstr3(const algo::strptr &rhs) { + ch_SetStrptr(*this, rhs); +} + +// --- algo.Smallstr3.ch.Cast +inline algo::Smallstr3::operator algo::strptr() const { + return ch_Getary(*this); +} + +// --- algo.Smallstr3..EqOp +inline bool algo::Smallstr3::operator ==(const algo::Smallstr3 &rhs) const { + return algo::Smallstr3_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.Smallstr3..NeOp +inline bool algo::Smallstr3::operator !=(const algo::Smallstr3 &rhs) const { + return !algo::Smallstr3_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.Smallstr3..Cmp +inline i32 algo::Smallstr3_Cmp(algo::Smallstr3& lhs, algo::Smallstr3& rhs) { + i32 retval = 0; + retval = algo::strptr_Cmp(ch_Getary(lhs), ch_Getary(rhs)); + return retval; +} + +// --- algo.Smallstr3..Init +// Set all fields to initial values. +inline void algo::Smallstr3_Init(algo::Smallstr3& parent) { + parent.n_ch = 0; +} + +// --- algo.Smallstr3..Eq +inline bool algo::Smallstr3_Eq(algo::Smallstr3& lhs, algo::Smallstr3& rhs) { + bool retval = true; + retval = algo::strptr_Eq(ch_Getary(lhs), ch_Getary(rhs)); + return retval; +} + +// --- algo.Smallstr3..EqOpAryptr +inline bool algo::Smallstr3::operator ==(const algo::aryptr &rhs) const { + return algo::strptr_Eq(ch_Getary(*this), rhs); +} + +// --- algo.Smallstr3..AssignOp +inline algo::Smallstr3& algo::Smallstr3::operator =(const algo::Smallstr3 &rhs) { + memcpy(ch, rhs.ch, rhs.n_ch); + n_ch = rhs.n_ch; + return *this; +} + +// --- algo.Smallstr3..Ctor +inline algo::Smallstr3::Smallstr3() { + algo::Smallstr3_Init(*this); +} + +// --- algo.Smallstr3..CopyCtor +inline algo::Smallstr3::Smallstr3(const algo::Smallstr3 &rhs) { memcpy(ch, rhs.ch, rhs.n_ch); n_ch = rhs.n_ch; } @@ -18184,11 +17993,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr30& parent) { return ret; } -// --- algo.Smallstr30.ch.HashStrptr -inline u32 algo::Smallstr30_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr30.ch.Init inline void algo::ch_Init(algo::Smallstr30 &parent) { parent.n_ch = 0; @@ -18342,11 +18146,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr32& parent) { return ret; } -// --- algo.Smallstr32.ch.HashStrptr -inline u32 algo::Smallstr32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr32.ch.Init inline void algo::ch_Init(algo::Smallstr32 &parent) { parent.n_ch = 0; @@ -18465,11 +18264,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr4& parent) { return ret; } -// --- algo.Smallstr4.ch.HashStrptr -inline u32 algo::Smallstr4_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr4.ch.Init inline void algo::ch_Init(algo::Smallstr4 &parent) { parent.n_ch = 0; @@ -18588,11 +18382,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr40& parent) { return ret; } -// --- algo.Smallstr40.ch.HashStrptr -inline u32 algo::Smallstr40_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr40.ch.Init inline void algo::ch_Init(algo::Smallstr40 &parent) { parent.n_ch = 0; @@ -18711,11 +18500,6 @@ inline algo::aryptr algo::ch_Getary(const algo::Smallstr5& parent) { return ret; } -// --- algo.Smallstr5.ch.HashStrptr -inline u32 algo::Smallstr5_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- algo.Smallstr5.ch.Init inline void algo::ch_Init(algo::Smallstr5 &parent) { parent.n_ch = 0; @@ -19160,6 +18944,166 @@ inline algo::Tuple::~Tuple() { algo::Tuple_Uninit(*this); } +// --- algo.U16Ary.ary.EmptyQ +// Return true if index is empty +inline bool algo::ary_EmptyQ(algo::U16Ary& parent) { + return parent.ary_n == 0; +} + +// --- algo.U16Ary.ary.Find +// Look up row by row id. Return NULL if out of range +inline u16* algo::ary_Find(algo::U16Ary& parent, u64 t) { + u64 idx = t; + u64 lim = parent.ary_n; + if (idx >= lim) return NULL; + return parent.ary_elems + idx; +} + +// --- algo.U16Ary.ary.Getary +// Return array pointer by value +inline algo::aryptr algo::ary_Getary(const algo::U16Ary& parent) { + return algo::aryptr(parent.ary_elems, parent.ary_n); +} + +// --- algo.U16Ary.ary.Last +// Return pointer to last element of array, or NULL if array is empty +inline u16* algo::ary_Last(algo::U16Ary& parent) { + return ary_Find(parent, u64(parent.ary_n-1)); +} + +// --- algo.U16Ary.ary.AssignAryptr +// Copy from aryptr (operator=) +inline void algo::U16Ary::operator =(const algo::aryptr &rhs) { + ary_Setary(*this, rhs); +} + +// --- algo.U16Ary.ary.CtorAryptr +inline algo::U16Ary::U16Ary(const algo::aryptr &rhs) { + ary_elems = 0; // (algo.U16Ary.ary) + ary_n = 0; // (algo.U16Ary.ary) + ary_max = 0; // (algo.U16Ary.ary) + ary_Addary(*this, rhs); +} + +// --- algo.U16Ary.ary.Max +// Return max. number of items in the array +inline i32 algo::ary_Max(algo::U16Ary& parent) { + (void)parent; + return parent.ary_max; +} + +// --- algo.U16Ary.ary.N +// Return number of items in the array +inline i32 algo::ary_N(const algo::U16Ary& parent) { + return parent.ary_n; +} + +// --- algo.U16Ary.ary.RemoveAll +inline void algo::ary_RemoveAll(algo::U16Ary& parent) { + parent.ary_n = 0; +} + +// --- algo.U16Ary.ary.Reserve +// Make sure N *more* elements will fit in array. Process dies if out of memory +inline void algo::ary_Reserve(algo::U16Ary& parent, int n) { + u32 new_n = parent.ary_n + n; + if (UNLIKELY(new_n > parent.ary_max)) { + ary_AbsReserve(parent, new_n); + } +} + +// --- algo.U16Ary.ary.qFind +// 'quick' Access row by row id. No bounds checking. +inline u16& algo::ary_qFind(algo::U16Ary& parent, u64 t) { + return parent.ary_elems[t]; +} + +// --- algo.U16Ary.ary.qLast +// Return reference to last element of array. No bounds checking +inline u16& algo::ary_qLast(algo::U16Ary& parent) { + return ary_qFind(parent, u64(parent.ary_n-1)); +} + +// --- algo.U16Ary.ary.rowid_Get +// Return row id of specified element +inline u64 algo::ary_rowid_Get(algo::U16Ary& parent, u16 &elem) { + u64 id = &elem - parent.ary_elems; + return u64(id); +} + +// --- algo.U16Ary.ary_curs.Next +// proceed to next item +inline void algo::U16Ary_ary_curs_Next(U16Ary_ary_curs &curs) { + curs.index++; +} + +// --- algo.U16Ary.ary_curs.Reset +inline void algo::U16Ary_ary_curs_Reset(U16Ary_ary_curs &curs, algo::U16Ary &parent) { + curs.elems = parent.ary_elems; + curs.n_elems = parent.ary_n; + curs.index = 0; +} + +// --- algo.U16Ary.ary_curs.ValidQ +// cursor points to valid item +inline bool algo::U16Ary_ary_curs_ValidQ(U16Ary_ary_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- algo.U16Ary.ary_curs.Access +// item access +inline u16& algo::U16Ary_ary_curs_Access(U16Ary_ary_curs &curs) { + return curs.elems[curs.index]; +} + +// --- algo.U16Ary..Hash +inline u32 algo::U16Ary_Hash(u32 prev, const algo::U16Ary& rhs) { + prev = strptr_Hash(prev, algo::strptr((char*)rhs.ary_elems,rhs.ary_n)); + return prev; +} + +// --- algo.U16Ary..EqOp +inline bool algo::U16Ary::operator ==(const algo::U16Ary &rhs) const { + return algo::U16Ary_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.U16Ary..NeOp +inline bool algo::U16Ary::operator !=(const algo::U16Ary &rhs) const { + return !algo::U16Ary_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.U16Ary..Cmp +inline i32 algo::U16Ary_Cmp(algo::U16Ary& lhs, algo::U16Ary& rhs) { + i32 retval = 0; + retval = ary_Cmp(lhs,rhs); + return retval; +} + +// --- algo.U16Ary..Init +// Set all fields to initial values. +inline void algo::U16Ary_Init(algo::U16Ary& parent) { + parent.ary_elems = 0; // (algo.U16Ary.ary) + parent.ary_n = 0; // (algo.U16Ary.ary) + parent.ary_max = 0; // (algo.U16Ary.ary) +} + +// --- algo.U16Ary..Eq +inline bool algo::U16Ary_Eq(algo::U16Ary& lhs, algo::U16Ary& rhs) { + bool retval = true; + retval = ary_Eq(lhs,rhs); + return retval; +} + +// --- algo.U16Ary..Ctor +inline algo::U16Ary::U16Ary() { + algo::U16Ary_Init(*this); +} + +// --- algo.U16Ary..Dtor +inline algo::U16Ary::~U16Ary() { + algo::U16Ary_Uninit(*this); +} + // --- algo.U16Dec2.value.qSetDouble // Set value of field value. // The value is rounded to the nearest integer. @@ -19222,6 +19166,166 @@ inline algo::U16Dec2::U16Dec2(u16 in_value) { } +// --- algo.U32Ary.ary.EmptyQ +// Return true if index is empty +inline bool algo::ary_EmptyQ(algo::U32Ary& parent) { + return parent.ary_n == 0; +} + +// --- algo.U32Ary.ary.Find +// Look up row by row id. Return NULL if out of range +inline u32* algo::ary_Find(algo::U32Ary& parent, u64 t) { + u64 idx = t; + u64 lim = parent.ary_n; + if (idx >= lim) return NULL; + return parent.ary_elems + idx; +} + +// --- algo.U32Ary.ary.Getary +// Return array pointer by value +inline algo::aryptr algo::ary_Getary(const algo::U32Ary& parent) { + return algo::aryptr(parent.ary_elems, parent.ary_n); +} + +// --- algo.U32Ary.ary.Last +// Return pointer to last element of array, or NULL if array is empty +inline u32* algo::ary_Last(algo::U32Ary& parent) { + return ary_Find(parent, u64(parent.ary_n-1)); +} + +// --- algo.U32Ary.ary.AssignAryptr +// Copy from aryptr (operator=) +inline void algo::U32Ary::operator =(const algo::aryptr &rhs) { + ary_Setary(*this, rhs); +} + +// --- algo.U32Ary.ary.CtorAryptr +inline algo::U32Ary::U32Ary(const algo::aryptr &rhs) { + ary_elems = 0; // (algo.U32Ary.ary) + ary_n = 0; // (algo.U32Ary.ary) + ary_max = 0; // (algo.U32Ary.ary) + ary_Addary(*this, rhs); +} + +// --- algo.U32Ary.ary.Max +// Return max. number of items in the array +inline i32 algo::ary_Max(algo::U32Ary& parent) { + (void)parent; + return parent.ary_max; +} + +// --- algo.U32Ary.ary.N +// Return number of items in the array +inline i32 algo::ary_N(const algo::U32Ary& parent) { + return parent.ary_n; +} + +// --- algo.U32Ary.ary.RemoveAll +inline void algo::ary_RemoveAll(algo::U32Ary& parent) { + parent.ary_n = 0; +} + +// --- algo.U32Ary.ary.Reserve +// Make sure N *more* elements will fit in array. Process dies if out of memory +inline void algo::ary_Reserve(algo::U32Ary& parent, int n) { + u32 new_n = parent.ary_n + n; + if (UNLIKELY(new_n > parent.ary_max)) { + ary_AbsReserve(parent, new_n); + } +} + +// --- algo.U32Ary.ary.qFind +// 'quick' Access row by row id. No bounds checking. +inline u32& algo::ary_qFind(algo::U32Ary& parent, u64 t) { + return parent.ary_elems[t]; +} + +// --- algo.U32Ary.ary.qLast +// Return reference to last element of array. No bounds checking +inline u32& algo::ary_qLast(algo::U32Ary& parent) { + return ary_qFind(parent, u64(parent.ary_n-1)); +} + +// --- algo.U32Ary.ary.rowid_Get +// Return row id of specified element +inline u64 algo::ary_rowid_Get(algo::U32Ary& parent, u32 &elem) { + u64 id = &elem - parent.ary_elems; + return u64(id); +} + +// --- algo.U32Ary.ary_curs.Next +// proceed to next item +inline void algo::U32Ary_ary_curs_Next(U32Ary_ary_curs &curs) { + curs.index++; +} + +// --- algo.U32Ary.ary_curs.Reset +inline void algo::U32Ary_ary_curs_Reset(U32Ary_ary_curs &curs, algo::U32Ary &parent) { + curs.elems = parent.ary_elems; + curs.n_elems = parent.ary_n; + curs.index = 0; +} + +// --- algo.U32Ary.ary_curs.ValidQ +// cursor points to valid item +inline bool algo::U32Ary_ary_curs_ValidQ(U32Ary_ary_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- algo.U32Ary.ary_curs.Access +// item access +inline u32& algo::U32Ary_ary_curs_Access(U32Ary_ary_curs &curs) { + return curs.elems[curs.index]; +} + +// --- algo.U32Ary..Hash +inline u32 algo::U32Ary_Hash(u32 prev, const algo::U32Ary& rhs) { + prev = strptr_Hash(prev, algo::strptr((char*)rhs.ary_elems,rhs.ary_n)); + return prev; +} + +// --- algo.U32Ary..EqOp +inline bool algo::U32Ary::operator ==(const algo::U32Ary &rhs) const { + return algo::U32Ary_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.U32Ary..NeOp +inline bool algo::U32Ary::operator !=(const algo::U32Ary &rhs) const { + return !algo::U32Ary_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.U32Ary..Cmp +inline i32 algo::U32Ary_Cmp(algo::U32Ary& lhs, algo::U32Ary& rhs) { + i32 retval = 0; + retval = ary_Cmp(lhs,rhs); + return retval; +} + +// --- algo.U32Ary..Init +// Set all fields to initial values. +inline void algo::U32Ary_Init(algo::U32Ary& parent) { + parent.ary_elems = 0; // (algo.U32Ary.ary) + parent.ary_n = 0; // (algo.U32Ary.ary) + parent.ary_max = 0; // (algo.U32Ary.ary) +} + +// --- algo.U32Ary..Eq +inline bool algo::U32Ary_Eq(algo::U32Ary& lhs, algo::U32Ary& rhs) { + bool retval = true; + retval = ary_Eq(lhs,rhs); + return retval; +} + +// --- algo.U32Ary..Ctor +inline algo::U32Ary::U32Ary() { + algo::U32Ary_Init(*this); +} + +// --- algo.U32Ary..Dtor +inline algo::U32Ary::~U32Ary() { + algo::U32Ary_Uninit(*this); +} + // --- algo.U32Dec1.value.qSetDouble // Set value of field value. // The value is rounded to the nearest integer. @@ -19532,6 +19636,87 @@ inline algo::U32Dec5::U32Dec5(u32 in_value) { } +// --- algo.U32LinearKey.value.Cast +inline algo::U32LinearKey::operator u32() const { + return u32((*this).value); +} + +// --- algo.U32LinearKey..EqOp +inline bool algo::U32LinearKey::operator ==(const algo::U32LinearKey &rhs) const { + return algo::U32LinearKey_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.U32LinearKey..NeOp +inline bool algo::U32LinearKey::operator !=(const algo::U32LinearKey &rhs) const { + return !algo::U32LinearKey_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.U32LinearKey..LtOp +inline bool algo::U32LinearKey::operator <(const algo::U32LinearKey &rhs) const { + return algo::U32LinearKey_Lt(const_cast(*this),const_cast(rhs)); +} + +// --- algo.U32LinearKey..GtOp +inline bool algo::U32LinearKey::operator >(const algo::U32LinearKey &rhs) const { + return algo::U32LinearKey_Lt(const_cast(rhs),const_cast(*this)); +} + +// --- algo.U32LinearKey..LeOp +inline bool algo::U32LinearKey::operator <=(const algo::U32LinearKey &rhs) const { + return !algo::U32LinearKey_Lt(const_cast(rhs),const_cast(*this)); +} + +// --- algo.U32LinearKey..GeOp +inline bool algo::U32LinearKey::operator >=(const algo::U32LinearKey &rhs) const { + return !algo::U32LinearKey_Lt(const_cast(*this),const_cast(rhs)); +} + +// --- algo.U32LinearKey..Lt +inline bool algo::U32LinearKey_Lt(algo::U32LinearKey lhs, algo::U32LinearKey rhs) { + return u32_Lt(lhs.value, rhs.value); +} + +// --- algo.U32LinearKey..Cmp +inline i32 algo::U32LinearKey_Cmp(algo::U32LinearKey lhs, algo::U32LinearKey rhs) { + i32 retval = 0; + retval = u32_Cmp(lhs.value, rhs.value); + return retval; +} + +// --- algo.U32LinearKey..Init +// Set all fields to initial values. +inline void algo::U32LinearKey_Init(algo::U32LinearKey& parent) { + parent.value = u32(0); +} + +// --- algo.U32LinearKey..Eq +inline bool algo::U32LinearKey_Eq(algo::U32LinearKey lhs, algo::U32LinearKey rhs) { + bool retval = true; + retval = u32_Eq(lhs.value, rhs.value); + return retval; +} + +// --- algo.U32LinearKey..Update +// Set value. Return true if new value is different from old value. +inline bool algo::U32LinearKey_Update(algo::U32LinearKey &lhs, algo::U32LinearKey rhs) { + bool ret = !U32LinearKey_Eq(lhs, rhs); // compare values + if (ret) { + lhs = rhs; // update + } + return ret; +} + +// --- algo.U32LinearKey..Ctor +inline algo::U32LinearKey::U32LinearKey() { + algo::U32LinearKey_Init(*this); +} + +// --- algo.U32LinearKey..FieldwiseCtor +inline algo::U32LinearKey::U32LinearKey(u32 in_value) + : value(in_value) + { +} + // --- algo.U64Ary.ary.EmptyQ // Return true if index is empty inline bool algo::ary_EmptyQ(algo::U64Ary& parent) { @@ -19644,6 +19829,31 @@ inline u64& algo::U64Ary_ary_curs_Access(U64Ary_ary_curs &curs) { return curs.elems[curs.index]; } +// --- algo.U64Ary..Hash +inline u32 algo::U64Ary_Hash(u32 prev, const algo::U64Ary& rhs) { + ind_beg(U64Ary_ary_curs,elem,(algo::U64Ary&)rhs) { + prev = u64_Hash(prev,elem); + }ind_end; + return prev; +} + +// --- algo.U64Ary..EqOp +inline bool algo::U64Ary::operator ==(const algo::U64Ary &rhs) const { + return algo::U64Ary_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.U64Ary..NeOp +inline bool algo::U64Ary::operator !=(const algo::U64Ary &rhs) const { + return !algo::U64Ary_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- algo.U64Ary..Cmp +inline i32 algo::U64Ary_Cmp(algo::U64Ary& lhs, algo::U64Ary& rhs) { + i32 retval = 0; + retval = ary_Cmp(lhs,rhs); + return retval; +} + // --- algo.U64Ary..Init // Set all fields to initial values. inline void algo::U64Ary_Init(algo::U64Ary& parent) { @@ -19652,6 +19862,13 @@ inline void algo::U64Ary_Init(algo::U64Ary& parent) { parent.ary_max = 0; // (algo.U64Ary.ary) } +// --- algo.U64Ary..Eq +inline bool algo::U64Ary_Eq(algo::U64Ary& lhs, algo::U64Ary& rhs) { + bool retval = true; + retval = ary_Eq(lhs,rhs); + return retval; +} + // --- algo.U64Ary..Ctor inline algo::U64Ary::U64Ary() { algo::U64Ary_Init(*this); @@ -20968,6 +21185,11 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::Bool &ro return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::ByteAry &row) {// cfmt:algo.ByteAry.String + algo::ByteAry_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::Comment &row) {// cfmt:algo.Comment.String algo::Comment_Print(const_cast(row), str); return str; @@ -21048,6 +21270,11 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::I32Dec5 return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::I32RangeAry &row) {// cfmt:algo.I32RangeAry.String + algo::I32RangeAry_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::I64Dec1 &row) {// cfmt:algo.I64Dec1.String algo::I64Dec1_Print(const_cast(row), str); return str; @@ -21173,11 +21400,21 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::Tuple &r return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::U16Ary &row) {// cfmt:algo.U16Ary.String + algo::U16Ary_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::U16Dec2 &row) {// cfmt:algo.U16Dec2.String algo::U16Dec2_Print(const_cast(row), str); return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::U32Ary &row) {// cfmt:algo.U32Ary.String + algo::U32Ary_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::U32Dec1 &row) {// cfmt:algo.U32Dec1.String algo::U32Dec1_Print(const_cast(row), str); return str; @@ -21203,6 +21440,16 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::U32Dec5 return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::U32LinearKey &row) {// cfmt:algo.U32LinearKey.String + algo::U32LinearKey_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::U64Ary &row) {// cfmt:algo.U64Ary.String + algo::U64Ary_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::U64Dec10 &row) {// cfmt:algo.U64Dec10.String algo::U64Dec10_Print(const_cast(row), str); return str; @@ -21282,3 +21529,8 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::i32_Rang algo::i32_Range_Print(const_cast(row), str); return str; } + +inline algo::cstring &algo::operator <<(algo::cstring &str, const algo::memptr &row) {// cfmt:algo.memptr.String + algo::memptr_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/algo_lib_gen.h b/include/gen/algo_lib_gen.h index 63361e52..93ece9bc 100644 --- a/include/gen/algo_lib_gen.h +++ b/include/gen/algo_lib_gen.h @@ -28,6 +28,33 @@ //#pragma endinclude // gen:ns_enums +// --- algo_lib_RegxFlagsEnum + +enum algo_lib_RegxFlagsEnum { // algo_lib.RegxFlags.value + algo_lib_RegxFlags_trace = 0x1 // algo_lib.RegxFlags.trace + ,algo_lib_RegxFlags_capture = 0x2 // algo_lib.RegxFlags.capture + ,algo_lib_RegxFlags_valid = 0x4 // algo_lib.RegxFlags.valid + ,algo_lib_RegxFlags_literal = 0x8 // algo_lib.RegxFlags.literal + ,algo_lib_RegxFlags_accepts_all = 0x10 // algo_lib.RegxFlags.accepts_all + ,algo_lib_RegxFlags_fullmatch = 0x20 // algo_lib.RegxFlags.fullmatch +}; + +enum { algo_lib_RegxFlagsEnum_N = 6 }; + + +// --- algo_lib_RegxStyleEnum + +enum algo_lib_RegxStyleEnum { // algo_lib.RegxStyle.value + algo_lib_RegxStyle_default = 0 + ,algo_lib_RegxStyle_sql = 1 + ,algo_lib_RegxStyle_acr = 2 + ,algo_lib_RegxStyle_shell = 3 + ,algo_lib_RegxStyle_literal = 4 +}; + +enum { algo_lib_RegxStyleEnum_N = 5 }; + + // --- algo_lib_FieldIdEnum enum algo_lib_FieldIdEnum { // algo_lib.FieldId.value @@ -47,31 +74,54 @@ enum algo_lib_FieldIdEnum { // algo_lib.FieldId.value ,algo_lib_FieldId_recurrent = 13 ,algo_lib_FieldId_expr = 14 ,algo_lib_FieldId_state = 15 - ,algo_lib_FieldId_front = 16 - ,algo_lib_FieldId_next_front = 17 - ,algo_lib_FieldId_start = 18 - ,algo_lib_FieldId_accept = 19 - ,algo_lib_FieldId_parseerror = 20 - ,algo_lib_FieldId_accepts_all = 21 - ,algo_lib_FieldId_literal = 22 - ,algo_lib_FieldId_type = 23 - ,algo_lib_FieldId_in = 24 - ,algo_lib_FieldId_out = 25 - ,algo_lib_FieldId_value = 26 + ,algo_lib_FieldId_flags = 16 + ,algo_lib_FieldId_style = 17 + ,algo_lib_FieldId_type = 18 + ,algo_lib_FieldId_first = 19 + ,algo_lib_FieldId_last = 20 + ,algo_lib_FieldId_value = 21 + ,algo_lib_FieldId_trace = 22 + ,algo_lib_FieldId_capture = 23 + ,algo_lib_FieldId_valid = 24 + ,algo_lib_FieldId_literal = 25 + ,algo_lib_FieldId_accepts_all = 26 + ,algo_lib_FieldId_fullmatch = 27 + ,algo_lib_FieldId_op = 28 + ,algo_lib_FieldId_consume = 29 + ,algo_lib_FieldId_imm = 30 }; -enum { algo_lib_FieldIdEnum_N = 27 }; +enum { algo_lib_FieldIdEnum_N = 31 }; // --- algo_lib_RegxToken_type_Enum enum algo_lib_RegxToken_type_Enum { // algo_lib.RegxToken.type algo_lib_RegxToken_type_expr = 0 + ,algo_lib_RegxToken_type_start = 4 ,algo_lib_RegxToken_type_or = 1 ,algo_lib_RegxToken_type_lparen = 2 + ,algo_lib_RegxToken_type_rparen = 3 +}; + +enum { algo_lib_RegxToken_type_Enum_N = 5 }; + + +// --- algo_lib_RegxOpEnum + +enum algo_lib_RegxOpEnum { // algo_lib.RegxOp.op + algo_lib_RegxOp_charrange = 0 // Always evaluates to true + ,algo_lib_RegxOp_char = 1 // Compare 1 character + ,algo_lib_RegxOp_true = 2 // Test against a character range + ,algo_lib_RegxOp_stringbeg = 3 // True at left edge of the string + ,algo_lib_RegxOp_lparen = 4 // True; Captures start of group. Imm=group # + ,algo_lib_RegxOp_rparen = 5 // True; Captures end of group. Imm=group # + ,algo_lib_RegxOp_stringend = 6 // True at right edge of the string + ,algo_lib_RegxOp_accept = 7 // True at the end of string + ,algo_lib_RegxOp_noop = 8 // False }; -enum { algo_lib_RegxToken_type_Enum_N = 3 }; +enum { algo_lib_RegxOpEnum_N = 9 }; // --- algo_lib_TableIdEnum @@ -92,14 +142,17 @@ struct lpool_Lpblock { } // gen:ns_tclass_field // gen:ns_fwddecl2 namespace dmmeta { struct Dispsigcheck; } +namespace algo_lib { struct FIohook; } namespace dmmeta { struct Logcat; } namespace algo_lib { struct Replscope; } +namespace algo_lib { struct FTimehook; } namespace algo_lib { struct FTxtrow; } namespace algo_lib { struct FTxttbl; } namespace algo_lib { struct Regx; } namespace algo_lib { struct Bitset_ary_bitcurs; } namespace algo_lib { struct Bitset_ary_curs; } namespace algo_lib { struct csvparse_ary_tok_curs; } +namespace algo_lib { struct regx_state_curs; } namespace algo_lib { struct _db_temp_strings_curs; } namespace algo_lib { struct _db_imtable_curs; } namespace algo_lib { struct _db_bh_timehook_curs; } @@ -108,28 +161,29 @@ namespace algo_lib { struct _db_imdb_curs; } namespace algo_lib { struct _db_logcat_curs; } namespace algo_lib { struct _db_exec_args_curs; } namespace algo_lib { struct _db_dirstack_curs; } +namespace algo_lib { struct _db_errns_curs; } namespace algo_lib { struct txtrow_c_txtcell_curs; } namespace algo_lib { struct txttbl_c_txtrow_curs; } namespace algo_lib { struct InTextFile_temp_buf_curs; } -namespace algo_lib { struct regx_state_curs; } namespace algo_lib { struct regxparse_ary_expr_curs; } -namespace algo_lib { struct RegxState_ch_class_curs; } namespace algo_lib { struct replscope_ind_replvar_curs; } namespace algo_lib { struct tabulate_width_curs; } namespace algo_lib { struct Bitset; } namespace algo_lib { struct Cmdline; } namespace algo_lib { struct CsvParse; } namespace algo_lib { struct ErrorX; } +namespace algo_lib { struct RegxM; } namespace algo_lib { struct FFildes; } namespace algo_lib { struct FLockfile; } -namespace algo_lib { struct FTimehook; } namespace algo_lib { struct FImdb; } +namespace algo_lib { struct RegxFlags; } +namespace algo_lib { struct RegxStyle; } namespace algo_lib { struct FLogcat; } +namespace algo_lib { struct FErrns; } namespace algo_lib { struct trace; } namespace algo_lib { struct FDb; } namespace algo_lib { struct FDispsigcheck; } namespace algo_lib { struct FImtable; } -namespace algo_lib { struct FIohook; } namespace algo_lib { struct FReplvar; } namespace algo_lib { struct FTempfile; } namespace algo_lib { struct FTxtcell; } @@ -139,6 +193,7 @@ namespace algo_lib { struct Mmap; } namespace algo_lib { struct MmapFile; } namespace algo_lib { struct RegxToken; } namespace algo_lib { struct RegxExpr; } +namespace algo_lib { struct RegxOp; } namespace algo_lib { struct RegxParse; } namespace algo_lib { struct RegxState; } namespace algo_lib { struct ShHdr; } @@ -148,6 +203,7 @@ namespace algo_lib { struct Tabulate; } namespace algo_lib { extern struct algo_lib::FDb _db; } namespace algo_lib { // hook_fcn_typedef typedef void (*timehook_hook_hook)(void* userctx, algo_lib::FTimehook& arg); // hook:algo_lib.FTimehook.hook + typedef void (*errns_decode_hook)(void* userctx, i32& arg); // hook:algo_lib.FErrns.decode typedef void (*_db_h_fatalerror_hook)(void* userctx); // hook:algo_lib.FDb.h_fatalerror typedef void (*iohook_callback_hook)(void* userctx, algo_lib::FIohook& arg); // hook:algo_lib.FIohook.callback } // hook_decl @@ -244,6 +300,11 @@ u64& ary_AllocAt(algo_lib::Bitset& parent, int at) __attribute__ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo_lib.Bitset.ary.AllocN algo::aryptr ary_AllocN(algo_lib::Bitset& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo_lib.Bitset.ary.AllocNAt +algo::aryptr ary_AllocNAt(algo_lib::Bitset& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo_lib.Bitset.ary.EmptyQ inline bool ary_EmptyQ(algo_lib::Bitset& parent) __attribute__((nothrow)); @@ -300,6 +361,10 @@ algo::aryptr ary_AllocNVal(algo_lib::Bitset& parent, int n_elems, const // Function returns success value. // func:algo_lib.Bitset.ary.ReadStrptrMaybe bool ary_ReadStrptrMaybe(algo_lib::Bitset& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo_lib.Bitset.ary.Insary +void ary_Insary(algo_lib::Bitset& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:algo_lib.Bitset.ary_bitcurs.Next @@ -441,6 +506,11 @@ algo::cstring& ary_tok_AllocAt(algo_lib::CsvParse& csvparse, int at) __att // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo_lib.CsvParse.ary_tok.AllocN algo::aryptr ary_tok_AllocN(algo_lib::CsvParse& csvparse, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo_lib.CsvParse.ary_tok.AllocNAt +algo::aryptr ary_tok_AllocNAt(algo_lib::CsvParse& csvparse, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo_lib.CsvParse.ary_tok.EmptyQ inline bool ary_tok_EmptyQ(algo_lib::CsvParse& csvparse) __attribute__((nothrow)); @@ -497,6 +567,10 @@ algo::aryptr ary_tok_AllocNVal(algo_lib::CsvParse& csvparse, int // Function returns success value. // func:algo_lib.CsvParse.ary_tok.ReadStrptrMaybe bool ary_tok_ReadStrptrMaybe(algo_lib::CsvParse& csvparse, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo_lib.CsvParse.ary_tok.Insary +void ary_tok_Insary(algo_lib::CsvParse& csvparse, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:algo_lib.CsvParse.ary_tok_curs.Next @@ -535,6 +609,17 @@ struct ErrorX { // algo_lib.ErrorX // this function is 'extrn' and implemented by user void ErrorX_Print(algo_lib::ErrorX& row, algo::cstring& str) __attribute__((nothrow)); +// --- algo_lib.RegxM +struct RegxM { // algo_lib.RegxM: Matching context for regex + algo_lib::Bitset front; // Temporary front (for matching) + algo_lib::Bitset this_char; // States to test on this char + algo_lib::Bitset next_char; // States to test on next char + algo::I32RangeAry matchrange; // List of match char ranges + // func:algo_lib.RegxM..Ctor + inline RegxM() __attribute__((nothrow)); +}; + + // --- algo_lib.FFildes // create: algo_lib.FDb.fildes (Cppstack) struct FFildes { // algo_lib.FFildes: Wrapper for unix file descritor, call close() on Uninit @@ -648,6 +733,7 @@ struct FImdb { // algo_lib.FImdb algo::ImdbGetTraceFcn GetTrace; // 0 algo::Comment comment; // algo_lib::FImdb* ind_imdb_next; // hash next + u32 ind_imdb_hashval; // hash value // func:algo_lib.FImdb..AssignOp inline algo_lib::FImdb& operator =(const algo_lib::FImdb &rhs) = delete; // func:algo_lib.FImdb..Ctor @@ -671,23 +757,290 @@ inline void FImdb_Init(algo_lib::FImdb& imdb); // func:algo_lib.FImdb..Uninit void FImdb_Uninit(algo_lib::FImdb& imdb) __attribute__((nothrow)); +// --- algo_lib.RegxFlags +#pragma pack(push,1) +struct RegxFlags { // algo_lib.RegxFlags + u8 value; // 0 + // func:algo_lib.RegxFlags..Ctor + inline RegxFlags() __attribute__((nothrow)); + // func:algo_lib.RegxFlags..FieldwiseCtor + explicit inline RegxFlags(u8 in_value) __attribute__((nothrow)); + // func:algo_lib.RegxFlags..EnumCtor + inline RegxFlags(algo_lib_RegxFlagsEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 0. +// func:algo_lib.RegxFlags.trace.Get +inline bool trace_Get(const algo_lib::RegxFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 0. +// func:algo_lib.RegxFlags.trace.Set +inline void trace_Set(algo_lib::RegxFlags& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 1. +// func:algo_lib.RegxFlags.capture.Get +inline bool capture_Get(const algo_lib::RegxFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 1. +// func:algo_lib.RegxFlags.capture.Set +inline void capture_Set(algo_lib::RegxFlags& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 2. +// func:algo_lib.RegxFlags.valid.Get +inline bool valid_Get(const algo_lib::RegxFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 2. +// func:algo_lib.RegxFlags.valid.Set +inline void valid_Set(algo_lib::RegxFlags& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 3. +// func:algo_lib.RegxFlags.literal.Get +inline bool literal_Get(const algo_lib::RegxFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 3. +// func:algo_lib.RegxFlags.literal.Set +inline void literal_Set(algo_lib::RegxFlags& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 4. +// func:algo_lib.RegxFlags.accepts_all.Get +inline bool accepts_all_Get(const algo_lib::RegxFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 4. +// func:algo_lib.RegxFlags.accepts_all.Set +inline void accepts_all_Set(algo_lib::RegxFlags& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 5. +// func:algo_lib.RegxFlags.fullmatch.Get +inline bool fullmatch_Get(const algo_lib::RegxFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 5. +// func:algo_lib.RegxFlags.fullmatch.Set +inline void fullmatch_Set(algo_lib::RegxFlags& parent, bool rhs) __attribute__((nothrow)); + +// func:algo_lib.RegxFlags..ReadFieldMaybe +bool RegxFlags_ReadFieldMaybe(algo_lib::RegxFlags& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of algo_lib::RegxFlags from an ascii string. +// func:algo_lib.RegxFlags..ReadStrptrMaybe +bool RegxFlags_ReadStrptrMaybe(algo_lib::RegxFlags &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:algo_lib.RegxFlags..Init +inline void RegxFlags_Init(algo_lib::RegxFlags& parent); +// print string representation of ROW to string STR +// cfmt:algo_lib.RegxFlags.String printfmt:Bitset +// func:algo_lib.RegxFlags..Print +void RegxFlags_Print(algo_lib::RegxFlags row, algo::cstring& str) __attribute__((nothrow)); +// func:algo_lib.RegxFlags..GetAnon +algo::strptr RegxFlags_GetAnon(algo_lib::RegxFlags &parent, i32 idx) __attribute__((nothrow)); + +// --- algo_lib.RegxStyle +struct RegxStyle { // algo_lib.RegxStyle: Regex encoding style (Acr, Sql, Classic, Shell etc) + u8 value; // 0 + // func:algo_lib.RegxStyle.value.Cast + inline operator algo_lib_RegxStyleEnum() const __attribute__((nothrow)); + // func:algo_lib.RegxStyle..Ctor + inline RegxStyle() __attribute__((nothrow)); + // func:algo_lib.RegxStyle..FieldwiseCtor + explicit inline RegxStyle(u8 in_value) __attribute__((nothrow)); + // func:algo_lib.RegxStyle..EnumCtor + inline RegxStyle(algo_lib_RegxStyleEnum arg) __attribute__((nothrow)); +}; + +// Get value of field as enum type +// func:algo_lib.RegxStyle.value.GetEnum +inline algo_lib_RegxStyleEnum value_GetEnum(const algo_lib::RegxStyle& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:algo_lib.RegxStyle.value.SetEnum +inline void value_SetEnum(algo_lib::RegxStyle& parent, algo_lib_RegxStyleEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:algo_lib.RegxStyle.value.ToCstr +const char* value_ToCstr(const algo_lib::RegxStyle& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:algo_lib.RegxStyle.value.Print +void value_Print(const algo_lib::RegxStyle& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:algo_lib.RegxStyle.value.SetStrptrMaybe +bool value_SetStrptrMaybe(algo_lib::RegxStyle& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:algo_lib.RegxStyle.value.SetStrptr +void value_SetStrptr(algo_lib::RegxStyle& parent, algo::strptr rhs, algo_lib_RegxStyleEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:algo_lib.RegxStyle.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(algo_lib::RegxStyle& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of algo_lib::RegxStyle from an ascii string. +// The format of the string is the format of the algo_lib::RegxStyle's only field +// func:algo_lib.RegxStyle..ReadStrptrMaybe +bool RegxStyle_ReadStrptrMaybe(algo_lib::RegxStyle &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:algo_lib.RegxStyle..Init +inline void RegxStyle_Init(algo_lib::RegxStyle& parent); +// print string representation of ROW to string STR +// cfmt:algo_lib.RegxStyle.String printfmt:Raw +// func:algo_lib.RegxStyle..Print +void RegxStyle_Print(algo_lib::RegxStyle& row, algo::cstring& str) __attribute__((nothrow)); + +// --- algo_lib.Regx +// create: algo_lib.FDb.regx (Cppstack) +// access: algo_lib.RegxParse.p_regx (Upptr) +struct Regx { // algo_lib.Regx: Parsed regular expression + algo::cstring expr; // Original string expression + algo_lib::RegxState* state_elems; // pointer to elements + u32 state_n; // number of elements in array + u32 state_max; // max. capacity of array before realloc + algo_lib::RegxFlags flags; // + algo_lib::RegxStyle style; // Regx style according to which EXPR was parsed + // func:algo_lib.Regx..AssignOp + algo_lib::Regx& operator =(const algo_lib::Regx &rhs) __attribute__((nothrow)); + // func:algo_lib.Regx..Ctor + inline Regx() __attribute__((nothrow)); + // func:algo_lib.Regx..Dtor + inline ~Regx() __attribute__((nothrow)); + // func:algo_lib.Regx..CopyCtor + Regx(const algo_lib::Regx &rhs) __attribute__((nothrow)); +}; + +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo_lib.Regx.state.Addary +algo::aryptr state_Addary(algo_lib::Regx& regx, algo::aryptr rhs) __attribute__((nothrow)); +// Reserve space. Insert element at the end +// The new element is initialized to a default value +// func:algo_lib.Regx.state.Alloc +algo_lib::RegxState& state_Alloc(algo_lib::Regx& regx) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo_lib.Regx.state.AllocAt +algo_lib::RegxState& state_AllocAt(algo_lib::Regx& regx, int at) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:algo_lib.Regx.state.AllocN +algo::aryptr state_AllocN(algo_lib::Regx& regx, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo_lib.Regx.state.AllocNAt +algo::aryptr state_AllocNAt(algo_lib::Regx& regx, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:algo_lib.Regx.state.EmptyQ +inline bool state_EmptyQ(algo_lib::Regx& regx) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:algo_lib.Regx.state.Find +inline algo_lib::RegxState* state_Find(algo_lib::Regx& regx, u64 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array pointer by value +// func:algo_lib.Regx.state.Getary +inline algo::aryptr state_Getary(const algo_lib::Regx& regx) __attribute__((nothrow)); +// Return pointer to last element of array, or NULL if array is empty +// func:algo_lib.Regx.state.Last +inline algo_lib::RegxState* state_Last(algo_lib::Regx& regx) __attribute__((nothrow, pure)); +// Return max. number of items in the array +// func:algo_lib.Regx.state.Max +inline i32 state_Max(algo_lib::Regx& regx) __attribute__((nothrow)); +// Return number of items in the array +// func:algo_lib.Regx.state.N +inline i32 state_N(const algo_lib::Regx& regx) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove item by index. If index outside of range, do nothing. +// func:algo_lib.Regx.state.Remove +void state_Remove(algo_lib::Regx& regx, u32 i) __attribute__((nothrow)); +// func:algo_lib.Regx.state.RemoveAll +void state_RemoveAll(algo_lib::Regx& regx) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:algo_lib.Regx.state.RemoveLast +void state_RemoveLast(algo_lib::Regx& regx) __attribute__((nothrow)); +// Make sure N *more* elements will fit in array. Process dies if out of memory +// func:algo_lib.Regx.state.Reserve +inline void state_Reserve(algo_lib::Regx& regx, int n) __attribute__((nothrow)); +// Make sure N elements fit in array. Process dies if out of memory +// func:algo_lib.Regx.state.AbsReserve +void state_AbsReserve(algo_lib::Regx& regx, int n) __attribute__((nothrow)); +// Copy contents of RHS to PARENT. +// func:algo_lib.Regx.state.Setary +void state_Setary(algo_lib::Regx& regx, algo_lib::Regx &rhs) __attribute__((nothrow)); +// Copy specified array into state, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +// func:algo_lib.Regx.state.Setary2 +void state_Setary(algo_lib::Regx& regx, const algo::aryptr &rhs) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:algo_lib.Regx.state.qFind +inline algo_lib::RegxState& state_qFind(algo_lib::Regx& regx, u64 t) __attribute__((nothrow)); +// Return reference to last element of array. No bounds checking +// func:algo_lib.Regx.state.qLast +inline algo_lib::RegxState& state_qLast(algo_lib::Regx& regx) __attribute__((nothrow)); +// Return row id of specified element +// func:algo_lib.Regx.state.rowid_Get +inline u64 state_rowid_Get(algo_lib::Regx& regx, algo_lib::RegxState &elem) __attribute__((nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:algo_lib.Regx.state.AllocNVal +algo::aryptr state_AllocNVal(algo_lib::Regx& regx, int n_elems, const algo_lib::RegxState& val) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo_lib.Regx.state.Insary +void state_Insary(algo_lib::Regx& regx, algo::aryptr rhs, int at) __attribute__((nothrow)); + +// proceed to next item +// func:algo_lib.Regx.state_curs.Next +inline void regx_state_curs_Next(regx_state_curs &curs) __attribute__((nothrow)); +// func:algo_lib.Regx.state_curs.Reset +inline void regx_state_curs_Reset(regx_state_curs &curs, algo_lib::Regx &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:algo_lib.Regx.state_curs.ValidQ +inline bool regx_state_curs_ValidQ(regx_state_curs &curs) __attribute__((nothrow)); +// item access +// func:algo_lib.Regx.state_curs.Access +inline algo_lib::RegxState& regx_state_curs_Access(regx_state_curs &curs) __attribute__((nothrow)); +// Read fields of algo_lib::Regx from an ascii string. +// func:algo_lib.Regx..ReadStrptrMaybe +// this function is 'extrn' and implemented by user +bool Regx_ReadStrptrMaybe(algo_lib::Regx &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:algo_lib.Regx..Init +inline void Regx_Init(algo_lib::Regx& regx); +// func:algo_lib.Regx..Uninit +void Regx_Uninit(algo_lib::Regx& regx) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:algo_lib.Regx.String printfmt:Extern +// func:algo_lib.Regx..Print +// this function is 'extrn' and implemented by user +void Regx_Print(algo_lib::Regx& row, algo::cstring& str) __attribute__((nothrow)); + // --- algo_lib.FLogcat // create: algo_lib.FDb.logcat (Inlary) // global access: ind_logcat (Thash, hash field logcat) struct FLogcat { // algo_lib.FLogcat - algo::Smallstr50 logcat; // - bool enabled; // false - bool builtin; // false - algo::Comment comment; // - algo_lib::FLogcat* ind_logcat_next; // hash next + algo::Smallstr50 logcat; // + bool enabled; // false + bool builtin; // false + bool stdout; // false + i32 maxmsg; // 0 + i32 window; // 0 + algo::Comment comment; // + algo_lib::Regx filter; // Output filter + algo_lib::Regx negfilter; // Negative output filter + i64 nmsg; // 0 Number of messages printed inside current window + algo_lib::FTimehook th_throttle; // + algo_lib::FLogcat* ind_logcat_next; // hash next + u32 ind_logcat_hashval; // hash value + // value field algo_lib.FLogcat.th_throttle is not copiable // func:algo_lib.FLogcat..AssignOp - inline algo_lib::FLogcat& operator =(const algo_lib::FLogcat &rhs) = delete; + algo_lib::FLogcat& operator =(const algo_lib::FLogcat &rhs) = delete; // func:algo_lib.FLogcat..Ctor inline FLogcat() __attribute__((nothrow)); // func:algo_lib.FLogcat..Dtor inline ~FLogcat() __attribute__((nothrow)); + // value field algo_lib.FLogcat.th_throttle is not copiable // func:algo_lib.FLogcat..CopyCtor - inline FLogcat(const algo_lib::FLogcat &rhs) = delete; + FLogcat(const algo_lib::FLogcat &rhs) = delete; }; // Copy fields out of row @@ -699,10 +1052,38 @@ void logcat_CopyIn(algo_lib::FLogcat &row, dmmeta::Logcat &in) _ // Set all fields to initial values. // func:algo_lib.FLogcat..Init -inline void FLogcat_Init(algo_lib::FLogcat& logcat); +void FLogcat_Init(algo_lib::FLogcat& logcat); // func:algo_lib.FLogcat..Uninit void FLogcat_Uninit(algo_lib::FLogcat& logcat) __attribute__((nothrow)); +// --- algo_lib.FErrns +// create: algo_lib.FDb.errns (Inlary) +struct FErrns { // algo_lib.FErrns + i32 errns; // 0 + algo_lib::errns_decode_hook decode; // NULL Pointer to a function + u64 decode_ctx; // 0 Callback context + algo::cstring outstr; // Output of decode operation + // func:algo_lib.FErrns..Ctor + inline FErrns() __attribute__((nothrow)); +}; + +// Invoke function by pointer +// func:algo_lib.FErrns.decode.Call +inline void decode_Call(algo_lib::FErrns& errns, i32& arg) __attribute__((nothrow)); +// Assign 0-argument hook with no context pointer +// func:algo_lib.FErrns.decode.Set0 +inline void decode_Set0(algo_lib::FErrns& errns, void (*fcn)() ) __attribute__((nothrow)); +// Assign 1-argument hook with context pointer +// func:algo_lib.FErrns.decode.Set1 +template inline void decode_Set1(algo_lib::FErrns& errns, T& ctx, void (*fcn)(T&) ) __attribute__((nothrow)); +// Assign 2-argument hook with context pointer +// func:algo_lib.FErrns.decode.Set2 +template inline void decode_Set2(algo_lib::FErrns& errns, T& ctx, void (*fcn)(T&, i32& arg) ) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:algo_lib.FErrns..Init +inline void FErrns_Init(algo_lib::FErrns& errns); + // --- algo_lib.trace #pragma pack(push,1) struct trace { // algo_lib.trace @@ -733,99 +1114,98 @@ void trace_Print(algo_lib::trace& row, algo::cstring& str) __att // --- algo_lib.FDb // create: algo_lib.FDb._db (Global) struct FDb { // algo_lib.FDb: In-memory database for algo_lib - u64 sbrk_huge_limit; // Huge page limit in bytes -- set to 0 with fork! - u64 sbrk_huge_alloc; // Huge page bytes allocated - bool sbrk_zeromem; // Zero allocated memory - lpool_Lpblock* lpool_free[36]; // Lpool levels - algo::SchedTime next_loop; // - algo::SchedTime limit; // 0x7fffffffffffffff - double clocks_to_ms; // 0.0 - u32 n_iohook; // 0 Number of iohooks in epoll - algo::SchedTime clock; // Current cpu clock value - algo::SchedTime mainloop_clock; // Mainloop cpu clock value - algo::SchedTime start_clock; // cpu clock value at startup - double hz; // 0.0 - algo::SchedTime t_last_signal; // Time last async signal was processed - i32 exit_code; // 0 Exit code from main program. 0 = success (this is the unix exit code!) - double clocks_to_ns; // 0.0 - u32 n_temp; // 0 * initialization order is important * - u32 last_signal; // 0 Value of last signal (used by SetupExitSignals) - bool eol; // false - u64 cpu_hz; // 0 Cpu HZ, determined at startup - algo::cstring temp_strings_elems[8]; // fixed array - algo::Charset ArgvIdent; // - algo::Charset BashQuotesafe; // - algo::Charset RegxSqlSpecial; // - algo::Charset SsimBreakName; // - algo::Charset SsimBreakValue; // - algo::Charset SsimQuotesafe; // - algo_lib::FImtable* imtable_lary[32]; // level array - i32 imtable_n; // number of elements in array - algo_lib::FImtable** ind_imtable_buckets_elems; // pointer to bucket array - i32 ind_imtable_buckets_n; // number of elements in bucket array - i32 ind_imtable_n; // number of elements in the hash table - algo::cstring log_str; // - algo_lib::FTimehook** bh_timehook_elems; // binary heap by time - i32 bh_timehook_n; // number of elements in the heap - i32 bh_timehook_max; // max elements in bh_timehook_elems - i32 epoll_fd; // -1 - algo_lib::FLockfile lock_core; // - algo_lib::FTimehook* c_timehook; // TEMP: here only for dependency reasons. optional pointer - algo_lib::FTimehook _timehook; // Keep me here i'm special - algo_lib::FDispsigcheck* dispsigcheck_lary[32]; // level array - i32 dispsigcheck_n; // number of elements in array - algo_lib::FDispsigcheck** ind_dispsigcheck_buckets_elems; // pointer to bucket array - i32 ind_dispsigcheck_buckets_n; // number of elements in bucket array - i32 ind_dispsigcheck_n; // number of elements in the hash table - u128 imdb_data[sizeu128(algo_lib::FImdb,32)]; // place for data - i32 imdb_n; // number of elems current in existence + u64 sbrk_huge_limit; // Huge page limit in bytes -- set to 0 with fork! + u64 sbrk_huge_alloc; // Huge page bytes allocated + bool sbrk_zeromem; // Zero allocated memory + lpool_Lpblock* lpool_free[36]; // Lpool levels + algo::SchedTime next_loop; // + algo::SchedTime limit; // 0x7fffffffffffffff Main loop clock limit + double clocks_to_ms; // 0.0 + u32 n_iohook; // 0 Number of iohooks in epoll + algo::SchedTime clock; // Most recent cpu clock value + algo::SchedTime step_limit; // Execution limit for current step + algo::SchedTime start_clock; // cpu clock value at startup + double hz; // 0.0 + algo::SchedTime t_last_signal; // Time last async signal was processed + i32 exit_code; // 0 Unix exit code from main program. 0 = success + double clocks_to_ns; // 0.0 + u32 n_temp; // 0 + u32 last_signal; // 0 Value of last signal (used by SetupExitSignals) + u64 cpu_hz; // 0 Cpu HZ, determined at startup + algo::cstring temp_strings_elems[8]; // fixed array + algo::Charset ArgvIdent; // + algo::Charset BashQuotesafe; // + algo::Charset RegxSqlSpecial; // + algo::Charset SsimBreakName; // + algo::Charset SsimBreakValue; // + algo::Charset SsimQuotesafe; // + algo_lib::FImtable* imtable_lary[32]; // level array + i32 imtable_n; // number of elements in array + algo_lib::FImtable** ind_imtable_buckets_elems; // pointer to bucket array + i32 ind_imtable_buckets_n; // number of elements in bucket array + i32 ind_imtable_n; // number of elements in the hash table + algo_lib::RegxM regxm; // Context for Regx matching + algo::cstring log_str; // + algo_lib::FTimehook** bh_timehook_elems; // binary heap by time + i32 bh_timehook_n; // number of elements in the heap + i32 bh_timehook_max; // max elements in bh_timehook_elems + i32 epoll_fd; // -1 + algo_lib::FLockfile lock_core; // + algo_lib::FTimehook* c_timehook; // TEMP: here only for dependency reasons. optional pointer + algo_lib::FTimehook _timehook; // Keep me here i'm special + algo_lib::FDispsigcheck* dispsigcheck_lary[32]; // level array + i32 dispsigcheck_n; // number of elements in array + algo_lib::FDispsigcheck** ind_dispsigcheck_buckets_elems; // pointer to bucket array + i32 ind_dispsigcheck_buckets_n; // number of elements in bucket array + i32 ind_dispsigcheck_n; // number of elements in the hash table + u128 imdb_data[sizeu128(algo_lib::FImdb,32)]; // place for data + i32 imdb_n; // number of elems current in existence enum { imdb_max = 32 }; - algo_lib::FImdb** ind_imdb_buckets_elems; // pointer to bucket array - i32 ind_imdb_buckets_n; // number of elements in bucket array - i32 ind_imdb_n; // number of elements in the hash table - u64 txtcell_blocksize; // # bytes per block - algo_lib::FTxtcell* txtcell_free; // - u64 txtrow_blocksize; // # bytes per block - algo_lib::FTxtrow* txtrow_free; // - i32 argc; // 0 Argc from main - char** argv; // Argv from main. optional pointer - algo::cstring xref_error; // - algo::cstring errtext; // - algo::ByteAry* varlenbuf; // optional pointer - u64 replvar_blocksize; // # bytes per block - algo_lib::FReplvar* replvar_free; // - algo_lib::Cmdline cmdline; // - algo_lib::_db_h_fatalerror_hook h_fatalerror; // NULL Pointer to a function - u64 h_fatalerror_ctx; // 0 Callback context - u64 giveup_count; // 0 - algo::cstring fatalerr; // - u32 stringtofile_nwrite; // 0 Global counter of # of files written - bool giveup_time; // true Trigger for giveup_time loop - bool sleep_roundup; // false - u64 last_sleep_clocks; // 0 - algo::ByteAry msgtemp; // - u32 show_insert_err_lim; // 0 - algo::Charset Urlsafe; // - u64 winjob; // 0 - algo::PrlogFcn Prlog; // algo::Prlog - u128 logcat_data[sizeu128(algo_lib::FLogcat,3)]; // place for data - i32 logcat_n; // number of elems current in existence - enum { logcat_max = 3 }; - algo_lib::FLogcat** ind_logcat_buckets_elems; // pointer to bucket array - i32 ind_logcat_buckets_n; // number of elements in bucket array - i32 ind_logcat_n; // number of elements in the hash table - bool show_tstamp; // false - algo::cstring tstamp_fmt; // "%Y/%m/%dT%H:%M:%S.%.6X " - algo::Fildes fildes_stdout; // 1 - algo::Fildes fildes_stderr; // 2 - bool pending_eol; // false - algo::cstring* exec_args_elems; // pointer to elements - u32 exec_args_n; // number of elements in array - u32 exec_args_max; // max. capacity of array before realloc - algo::cstring* dirstack_elems; // pointer to elements - u32 dirstack_n; // number of elements in array - u32 dirstack_max; // max. capacity of array before realloc - algo_lib::trace trace; // + algo_lib::FImdb** ind_imdb_buckets_elems; // pointer to bucket array + i32 ind_imdb_buckets_n; // number of elements in bucket array + i32 ind_imdb_n; // number of elements in the hash table + u64 txtcell_blocksize; // # bytes per block + algo_lib::FTxtcell* txtcell_free; // + u64 txtrow_blocksize; // # bytes per block + algo_lib::FTxtrow* txtrow_free; // + i32 argc; // 0 Argc from main + char** argv; // Argv from main. optional pointer + algo::cstring xref_error; // + algo::cstring errtext; // + algo::ByteAry* varlenbuf; // optional pointer + u64 replvar_blocksize; // # bytes per block + algo_lib::FReplvar* replvar_free; // + algo_lib::Cmdline cmdline; // + algo_lib::_db_h_fatalerror_hook h_fatalerror; // NULL Pointer to a function + u64 h_fatalerror_ctx; // 0 Callback context + u64 giveup_count; // 0 + algo::cstring fatalerr; // + u32 stringtofile_nwrite; // 0 Global counter of # of files written + u64 last_sleep_clocks; // 0 + algo::ByteAry msgtemp; // + algo::Charset Urlsafe; // + u64 winjob; // 0 + algo::PrlogFcn Prlog; // algo::Prlog + u128 logcat_data[sizeu128(algo_lib::FLogcat,10)]; // place for data + i32 logcat_n; // number of elems current in existence + enum { logcat_max = 10 }; + algo_lib::FLogcat** ind_logcat_buckets_elems; // pointer to bucket array + i32 ind_logcat_buckets_n; // number of elements in bucket array + i32 ind_logcat_n; // number of elements in the hash table + algo::cstring tstamp_fmt; // "%Y/%m/%dT%H:%M:%S.%.6X " + algo::cstring* exec_args_elems; // pointer to elements + u32 exec_args_n; // number of elements in array + u32 exec_args_max; // max. capacity of array before realloc + algo::cstring* dirstack_elems; // pointer to elements + u32 dirstack_n; // number of elements in array + u32 dirstack_max; // max. capacity of array before realloc + algo_lib::FErrns errns_elems[8]; // fixed array + algo::cstring tempdir; // + bool use_epoll_pwait2; // false Use epoll_pwait2 system call + bool pending_eol; // false + bool giveup_time; // true Trigger for giveup_time loop + bool show_tstamp; // false + algo_lib::trace trace; // }; // Allocate a new piece of memory at least SIZE bytes long. @@ -915,6 +1295,11 @@ inline bool SsimBreakValueQ(u32 ch) __attribute__((nothrow)); // func:algo_lib.FDb.SsimQuotesafe.Match inline bool SsimQuotesafeQ(u32 ch) __attribute__((nothrow)); +// Declaration for user-defined init function +// User-defined init function invoked for field _db of algo_lib::FDb +// func:algo_lib.FDb._db.Userinit +// this function is 'extrn' and implemented by user +void Userinit() __attribute__((nothrow)); // Main step // func:algo_lib.FDb._db.Step void Step(); @@ -936,8 +1321,6 @@ bool LoadTuplesFile(algo::strptr fname, bool recursive) __attrib // Load all finputs from given file descriptor. // func:algo_lib.FDb._db.LoadTuplesFd bool LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) __attribute__((nothrow)); -// func:algo_lib.FDb._db.Init -void Init() __attribute__((nothrow)); // Load specified ssimfile. // func:algo_lib.FDb._db.LoadSsimfileMaybe bool LoadSsimfileMaybe(algo::strptr fname, bool recursive) __attribute__((nothrow)); @@ -1010,6 +1393,9 @@ void ind_imtable_Remove(algo_lib::FImtable& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:algo_lib.FDb.ind_imtable.Reserve void ind_imtable_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:algo_lib.FDb.ind_imtable.AbsReserve +void ind_imtable_AbsReserve(int n) __attribute__((nothrow)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. @@ -1097,14 +1483,9 @@ void bh_timehook_Reserve(int n) __attribute__((nothrow)); // First element of index changed. // func:algo_lib.FDb.bh_timehook.FirstChanged void bh_timehook_FirstChanged() __attribute__((nothrow)); -// Update cycles count from previous clock capture -// func:algo_lib.FDb.bh_timehook.UpdateCycles -void bh_timehook_UpdateCycles() __attribute__((nothrow)); // func:algo_lib.FDb.bh_timehook.Step // this function is 'extrn' and implemented by user void bh_timehook_Step() __attribute__((nothrow)); -// func:algo_lib.FDb.bh_timehook.Call -inline void bh_timehook_Call() __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1167,6 +1548,9 @@ void ind_dispsigcheck_Remove(algo_lib::FDispsigcheck& row) __att // Reserve enough room in the hash for N more elements. Return success code. // func:algo_lib.FDb.ind_dispsigcheck.Reserve void ind_dispsigcheck_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:algo_lib.FDb.ind_dispsigcheck.AbsReserve +void ind_dispsigcheck_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1235,6 +1619,9 @@ void ind_imdb_Remove(algo_lib::FImdb& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:algo_lib.FDb.ind_imdb.Reserve void ind_imdb_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:algo_lib.FDb.ind_imdb.AbsReserve +void ind_imdb_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1365,15 +1752,6 @@ template inline void h_fatalerror_Set1(T& ctx, void (*fcn)(T&) ) __attr // func:algo_lib.FDb.h_fatalerror.Set2 template inline void h_fatalerror_Set2(T& ctx, void (*fcn)(T&) ) __attribute__((nothrow)); -// Update cycles count from previous clock capture -// func:algo_lib.FDb.giveup_time.UpdateCycles -void giveup_time_UpdateCycles() __attribute__((nothrow)); -// func:algo_lib.FDb.giveup_time.Step -// this function is 'extrn' and implemented by user -void giveup_time_Step() __attribute__((nothrow)); -// func:algo_lib.FDb.giveup_time.Call -inline void giveup_time_Call() __attribute__((nothrow)); - // func:algo_lib.FDb.DigitChar.Match inline bool DigitCharQ(u32 ch) __attribute__((nothrow)); @@ -1439,7 +1817,7 @@ inline algo_lib::FLogcat* logcat_Find(u64 t) __attribute__((__warn_unused_result // Return array pointer by value // func:algo_lib.FDb.logcat.Getary inline algo::aryptr logcat_Getary() __attribute__((nothrow)); -// Return constant 3 -- max. number of items in the pool +// Return constant 10 -- max. number of items in the pool // func:algo_lib.FDb.logcat.Max inline i32 logcat_Max() __attribute__((nothrow)); // Return number of items in the array @@ -1483,6 +1861,9 @@ void ind_logcat_Remove(algo_lib::FLogcat& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:algo_lib.FDb.ind_logcat.Reserve void ind_logcat_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:algo_lib.FDb.ind_logcat.AbsReserve +void ind_logcat_AbsReserve(int n) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -1500,6 +1881,11 @@ algo::cstring& exec_args_AllocAt(int at) __attribute__((__warn_unused_resu // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo_lib.FDb.exec_args.AllocN algo::aryptr exec_args_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo_lib.FDb.exec_args.AllocNAt +algo::aryptr exec_args_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo_lib.FDb.exec_args.EmptyQ inline bool exec_args_EmptyQ() __attribute__((nothrow)); @@ -1549,6 +1935,10 @@ algo::aryptr exec_args_AllocNVal(int n_elems, const algo::cstring // Function returns success value. // func:algo_lib.FDb.exec_args.ReadStrptrMaybe bool exec_args_ReadStrptrMaybe(algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo_lib.FDb.exec_args.Insary +void exec_args_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -1566,6 +1956,11 @@ algo::cstring& dirstack_AllocAt(int at) __attribute__((__warn_unused_resul // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo_lib.FDb.dirstack.AllocN algo::aryptr dirstack_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo_lib.FDb.dirstack.AllocNAt +algo::aryptr dirstack_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo_lib.FDb.dirstack.EmptyQ inline bool dirstack_EmptyQ() __attribute__((nothrow)); @@ -1615,6 +2010,44 @@ algo::aryptr dirstack_AllocNVal(int n_elems, const algo::cstring& // Function returns success value. // func:algo_lib.FDb.dirstack.ReadStrptrMaybe bool dirstack_ReadStrptrMaybe(algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo_lib.FDb.dirstack.Insary +void dirstack_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); + +// Declaration for user-defined init function +// User-defined init function invoked for field errns of algo_lib::FDb +// func:algo_lib.FDb.errns.Userinit +// this function is 'extrn' and implemented by user +void errns_Userinit() __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:algo_lib.FDb.errns.Find +inline algo_lib::FErrns* errns_Find(i32 t) __attribute__((__warn_unused_result__, nothrow)); +// Access fixed array errns as aryptr. +// func:algo_lib.FDb.errns.Getary +inline algo::aryptr errns_Getary() __attribute__((nothrow)); +// Return max number of items in the array +// func:algo_lib.FDb.errns.Max +inline i32 errns_Max() __attribute__((nothrow)); +// Return number of items in the array +// func:algo_lib.FDb.errns.N +inline i32 errns_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// 'quick' Access row by row id. No bounds checking in release. +// func:algo_lib.FDb.errns.qFind +inline algo_lib::FErrns& errns_qFind(i32 t) __attribute__((nothrow)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:algo_lib.FDb.errns.XrefMaybe +bool errns_XrefMaybe(algo_lib::FErrns &row); + +// Update cycles count from previous clock capture +// func:algo_lib.FDb.giveup_time.UpdateCycles +void giveup_time_UpdateCycles() __attribute__((nothrow)); +// func:algo_lib.FDb.giveup_time.Step +// this function is 'extrn' and implemented by user +void giveup_time_Step() __attribute__((nothrow)); +// func:algo_lib.FDb.giveup_time.Call +inline void giveup_time_Call() __attribute__((nothrow)); // cursor points to valid item // func:algo_lib.FDb.temp_strings_curs.Reset @@ -1715,6 +2148,18 @@ inline bool _db_dirstack_curs_ValidQ(_db_dirstack_curs &curs) __attribu // item access // func:algo_lib.FDb.dirstack_curs.Access inline algo::cstring& _db_dirstack_curs_Access(_db_dirstack_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:algo_lib.FDb.errns_curs.Reset +inline void _db_errns_curs_Reset(_db_errns_curs &curs, algo_lib::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:algo_lib.FDb.errns_curs.ValidQ +inline bool _db_errns_curs_ValidQ(_db_errns_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:algo_lib.FDb.errns_curs.Next +inline void _db_errns_curs_Next(_db_errns_curs &curs) __attribute__((nothrow)); +// item access +// func:algo_lib.FDb.errns_curs.Access +inline algo_lib::FErrns& _db_errns_curs_Access(_db_errns_curs &curs) __attribute__((nothrow)); // func:algo_lib.FDb..Uninit void FDb_Uninit() __attribute__((nothrow)); @@ -1723,9 +2168,10 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: dispsigcheck (Lary, by rowid) // global access: ind_dispsigcheck (Thash, hash field dispsig) struct FDispsigcheck { // algo_lib.FDispsigcheck - algo_lib::FDispsigcheck* ind_dispsigcheck_next; // hash next - algo::Smallstr50 dispsig; // - algo::Sha1sig signature; // + algo_lib::FDispsigcheck* ind_dispsigcheck_next; // hash next + u32 ind_dispsigcheck_hashval; // hash value + algo::Smallstr50 dispsig; // + algo::Sha1sig signature; // // func:algo_lib.FDispsigcheck..AssignOp inline algo_lib::FDispsigcheck& operator =(const algo_lib::FDispsigcheck &rhs) = delete; // func:algo_lib.FDispsigcheck..CopyCtor @@ -1762,16 +2208,17 @@ void FDispsigcheck_Print(algo_lib::FDispsigcheck& row, algo::cst // global access: imtable (Lary, by rowid) // global access: ind_imtable (Thash, hash field imtable) struct FImtable { // algo_lib.FImtable - algo_lib::FImtable* ind_imtable_next; // hash next - algo::Smallstr50 imtable; // Table name - algo::Smallstr100 elem_type; // Element type name - algo::ImrowRowidFindFcn c_RowidFind; // 0 Function to find element by rowid (may be NULL) - algo::ImrowXrefXFcn XrefX; // 0 Function to x-reference an element (may be NULL) - algo::ImrowNItemsFcn NItems; // 0 Return number of elements in the table - algo::ImrowPrintFcn Print; // 0 Convert specified element to string (may be NULL) - i32 size; // 0 Size of one element (for fixed-width elements only) - algo::Smallstr50 ssimfile; // Ssimfile name (if associated) - algo::Comment comment; // + algo_lib::FImtable* ind_imtable_next; // hash next + u32 ind_imtable_hashval; // hash value + algo::Smallstr50 imtable; // Table name + algo::Smallstr100 elem_type; // Element type name + algo::ImrowRowidFindFcn c_RowidFind; // 0 Function to find element by rowid (may be NULL) + algo::ImrowXrefXFcn XrefX; // 0 Function to x-reference an element (may be NULL) + algo::ImrowNItemsFcn NItems; // 0 Return number of elements in the table + algo::ImrowPrintFcn Print; // 0 Convert specified element to string (may be NULL) + i32 size; // 0 Size of one element (for fixed-width elements only) + algo::Smallstr50 ssimfile; // Ssimfile name (if associated) + algo::Comment comment; // // func:algo_lib.FImtable..AssignOp algo_lib::FImtable& operator =(const algo_lib::FImtable &rhs) = delete; // func:algo_lib.FImtable..CopyCtor @@ -1846,12 +2293,14 @@ inline void FIohook_Uninit(algo_lib::FIohook& iohook) __attribute__((no // create: algo_lib.FDb.replvar (Tpool) // access: algo_lib.Replscope.ind_replvar (Thash) struct FReplvar { // algo_lib.FReplvar - algo_lib::FReplvar* replvar_next; // Pointer to next free element int tpool - algo_lib::Replscope* p_replscope; // reference to parent row - algo::cstring key; // Key - algo::cstring value; // Value - i32 nsubst; // 0 Number of times variable accessed - algo_lib::FReplvar* ind_replvar_next; // hash next + algo_lib::FReplvar* replvar_next; // Pointer to next free element int tpool + algo_lib::Replscope* p_replscope; // reference to parent row + algo::cstring key; // Key + algo::cstring value; // Value + i32 nsubst; // 0 Number of times variable accessed + bool partial; // false This is a partial match on another variable + algo_lib::FReplvar* replscope_ind_replvar_next; // hash next + u32 replscope_ind_replvar_hashval; // hash value // func:algo_lib.FReplvar..AssignOp inline algo_lib::FReplvar& operator =(const algo_lib::FReplvar &rhs) = delete; // func:algo_lib.FReplvar..CopyCtor @@ -1899,7 +2348,7 @@ struct FTxtcell { // algo_lib.FTxtcell algo_lib::FTxtrow* p_txtrow; // reference to parent row algo::TextJust justify; // algo_TextJust_j_left Justification of text within cell algo::TermStyle style; // Text style - i32 span; // 1 Span in columns + i32 span; // 1 Column span of this cell i32 width; // 0 Width in chars algo::cstring text; // Cell contents algo::cstring rsep; // Right separator @@ -2032,8 +2481,7 @@ struct FTxttbl { // algo_lib.FTxttbl: Table row. Todo: absolute index for cells? algo_lib::FTxtrow** c_txtrow_elems; // array of pointers u32 c_txtrow_n; // array of pointers u32 c_txtrow_max; // capacity of allocated array - i32 col_space; // 2 Extra space between columns - i32 hdr_row; // 0 Index of header row (default -1) + i32 col_space; // 2 Default extra space between columns bool normalized; // false Cell widths computed // func:algo_lib.FTxttbl..Ctor inline FTxttbl() __attribute__((nothrow)); @@ -2291,127 +2739,8 @@ struct MmapFile { // algo_lib.MmapFile }; -// --- algo_lib.Regx -// create: algo_lib.FDb.regx (Cppstack) -// access: algo_lib.RegxParse.p_regx (Upptr) -struct Regx { // algo_lib.Regx: Parsed regular expression - algo::cstring expr; // Original string expression in some unspecified regx dialect - algo_lib::RegxState* state_elems; // pointer to elements - u32 state_n; // number of elements in array - u32 state_max; // max. capacity of array before realloc - algo_lib::Bitset front; // Temporary front (for matching) - algo_lib::Bitset next_front; // Next front (for matching) - algo_lib::Bitset start; // Set of starting states - i32 accept; // 0 Accept state - bool parseerror; // false Non-fatal error while parsing - bool accepts_all; // false True if this regx matches anything - bool literal; // false True if expr may be matched literally (set during translation) - // func:algo_lib.Regx..AssignOp - algo_lib::Regx& operator =(const algo_lib::Regx &rhs) __attribute__((nothrow)); - // func:algo_lib.Regx..Ctor - inline Regx() __attribute__((nothrow)); - // func:algo_lib.Regx..Dtor - inline ~Regx() __attribute__((nothrow)); - // func:algo_lib.Regx..CopyCtor - Regx(const algo_lib::Regx &rhs) __attribute__((nothrow)); -}; - -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -// func:algo_lib.Regx.state.Addary -algo::aryptr state_Addary(algo_lib::Regx& regx, algo::aryptr rhs) __attribute__((nothrow)); -// Reserve space. Insert element at the end -// The new element is initialized to a default value -// func:algo_lib.Regx.state.Alloc -algo_lib::RegxState& state_Alloc(algo_lib::Regx& regx) __attribute__((__warn_unused_result__, nothrow)); -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -// func:algo_lib.Regx.state.AllocAt -algo_lib::RegxState& state_AllocAt(algo_lib::Regx& regx, int at) __attribute__((__warn_unused_result__, nothrow)); -// Reserve space. Insert N elements at the end of the array, return pointer to array -// func:algo_lib.Regx.state.AllocN -algo::aryptr state_AllocN(algo_lib::Regx& regx, int n_elems) __attribute__((__warn_unused_result__, nothrow)); -// Return true if index is empty -// func:algo_lib.Regx.state.EmptyQ -inline bool state_EmptyQ(algo_lib::Regx& regx) __attribute__((nothrow)); -// Look up row by row id. Return NULL if out of range -// func:algo_lib.Regx.state.Find -inline algo_lib::RegxState* state_Find(algo_lib::Regx& regx, u64 t) __attribute__((__warn_unused_result__, nothrow)); -// Return array pointer by value -// func:algo_lib.Regx.state.Getary -inline algo::aryptr state_Getary(const algo_lib::Regx& regx) __attribute__((nothrow)); -// Return pointer to last element of array, or NULL if array is empty -// func:algo_lib.Regx.state.Last -inline algo_lib::RegxState* state_Last(algo_lib::Regx& regx) __attribute__((nothrow, pure)); -// Return max. number of items in the array -// func:algo_lib.Regx.state.Max -inline i32 state_Max(algo_lib::Regx& regx) __attribute__((nothrow)); -// Return number of items in the array -// func:algo_lib.Regx.state.N -inline i32 state_N(const algo_lib::Regx& regx) __attribute__((__warn_unused_result__, nothrow, pure)); -// Remove item by index. If index outside of range, do nothing. -// func:algo_lib.Regx.state.Remove -void state_Remove(algo_lib::Regx& regx, u32 i) __attribute__((nothrow)); -// func:algo_lib.Regx.state.RemoveAll -void state_RemoveAll(algo_lib::Regx& regx) __attribute__((nothrow)); -// Delete last element of array. Do nothing if array is empty. -// func:algo_lib.Regx.state.RemoveLast -void state_RemoveLast(algo_lib::Regx& regx) __attribute__((nothrow)); -// Make sure N *more* elements will fit in array. Process dies if out of memory -// func:algo_lib.Regx.state.Reserve -inline void state_Reserve(algo_lib::Regx& regx, int n) __attribute__((nothrow)); -// Make sure N elements fit in array. Process dies if out of memory -// func:algo_lib.Regx.state.AbsReserve -void state_AbsReserve(algo_lib::Regx& regx, int n) __attribute__((nothrow)); -// Copy contents of RHS to PARENT. -// func:algo_lib.Regx.state.Setary -void state_Setary(algo_lib::Regx& regx, algo_lib::Regx &rhs) __attribute__((nothrow)); -// Copy specified array into state, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -// func:algo_lib.Regx.state.Setary2 -void state_Setary(algo_lib::Regx& regx, const algo::aryptr &rhs) __attribute__((nothrow)); -// 'quick' Access row by row id. No bounds checking. -// func:algo_lib.Regx.state.qFind -inline algo_lib::RegxState& state_qFind(algo_lib::Regx& regx, u64 t) __attribute__((nothrow)); -// Return reference to last element of array. No bounds checking -// func:algo_lib.Regx.state.qLast -inline algo_lib::RegxState& state_qLast(algo_lib::Regx& regx) __attribute__((nothrow)); -// Return row id of specified element -// func:algo_lib.Regx.state.rowid_Get -inline u64 state_rowid_Get(algo_lib::Regx& regx, algo_lib::RegxState &elem) __attribute__((nothrow)); -// Reserve space. Insert N elements at the end of the array, return pointer to array -// func:algo_lib.Regx.state.AllocNVal -algo::aryptr state_AllocNVal(algo_lib::Regx& regx, int n_elems, const algo_lib::RegxState& val) __attribute__((nothrow)); - -// proceed to next item -// func:algo_lib.Regx.state_curs.Next -inline void regx_state_curs_Next(regx_state_curs &curs) __attribute__((nothrow)); -// func:algo_lib.Regx.state_curs.Reset -inline void regx_state_curs_Reset(regx_state_curs &curs, algo_lib::Regx &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:algo_lib.Regx.state_curs.ValidQ -inline bool regx_state_curs_ValidQ(regx_state_curs &curs) __attribute__((nothrow)); -// item access -// func:algo_lib.Regx.state_curs.Access -inline algo_lib::RegxState& regx_state_curs_Access(regx_state_curs &curs) __attribute__((nothrow)); -// Read fields of algo_lib::Regx from an ascii string. -// func:algo_lib.Regx..ReadStrptrMaybe -// this function is 'extrn' and implemented by user -bool Regx_ReadStrptrMaybe(algo_lib::Regx &parent, algo::strptr in_str) __attribute__((nothrow)); -// Set all fields to initial values. -// func:algo_lib.Regx..Init -inline void Regx_Init(algo_lib::Regx& regx); -// func:algo_lib.Regx..Uninit -void Regx_Uninit(algo_lib::Regx& regx) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:algo_lib.Regx.String printfmt:Extern -// func:algo_lib.Regx..Print -// this function is 'extrn' and implemented by user -void Regx_Print(algo_lib::Regx& row, algo::cstring& str) __attribute__((nothrow)); - // --- algo_lib.RegxToken -struct RegxToken { // algo_lib.RegxToken +struct RegxToken { // algo_lib.RegxToken: Used when parsing i32 type; // 0 State // func:algo_lib.RegxToken.type.Cast inline operator algo_lib_RegxToken_type_Enum() const __attribute__((nothrow)); @@ -2464,10 +2793,10 @@ void RegxToken_Print(algo_lib::RegxToken& row, algo::cstring& st // --- algo_lib.RegxExpr // create: algo_lib.RegxParse.ary_expr (Tary) -struct RegxExpr { // algo_lib.RegxExpr - algo_lib::RegxToken type; // - i32 in; // 0 Input state - algo_lib::Bitset out; // Output states +struct RegxExpr { // algo_lib.RegxExpr: Expression during parsing + algo_lib::RegxToken type; // + i32 first; // 0 First character + algo_lib::Bitset last; // Last character(s) // func:algo_lib.RegxExpr..Ctor inline RegxExpr() __attribute__((nothrow)); }; @@ -2486,10 +2815,65 @@ inline void RegxExpr_Init(algo_lib::RegxExpr& parent); // func:algo_lib.RegxExpr..Print void RegxExpr_Print(algo_lib::RegxExpr& row, algo::cstring& str) __attribute__((nothrow)); +// --- algo_lib.RegxOp +struct RegxOp { // algo_lib.RegxOp: A single instruction for Regex NFA + u8 op; // 0 What test to perform + u8 consume; // 1 Number of characters to consume + u16 imm; // 0 immediate value + // func:algo_lib.RegxOp..Ctor + inline RegxOp() __attribute__((nothrow)); + // func:algo_lib.RegxOp..FieldwiseCtor + explicit inline RegxOp(u8 in_op, u8 in_consume, u16 in_imm) __attribute__((nothrow)); +}; + +// Get value of field as enum type +// func:algo_lib.RegxOp.op.GetEnum +inline algo_lib_RegxOpEnum op_GetEnum(const algo_lib::RegxOp& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:algo_lib.RegxOp.op.SetEnum +inline void op_SetEnum(algo_lib::RegxOp& parent, algo_lib_RegxOpEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:algo_lib.RegxOp.op.ToCstr +const char* op_ToCstr(const algo_lib::RegxOp& parent) __attribute__((nothrow)); +// Convert op to a string. First, attempt conversion to a known string. +// If no string matches, print op as a numeric value. +// func:algo_lib.RegxOp.op.Print +void op_Print(const algo_lib::RegxOp& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:algo_lib.RegxOp.op.SetStrptrMaybe +bool op_SetStrptrMaybe(algo_lib::RegxOp& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:algo_lib.RegxOp.op.SetStrptr +void op_SetStrptr(algo_lib::RegxOp& parent, algo::strptr rhs, algo_lib_RegxOpEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:algo_lib.RegxOp.op.ReadStrptrMaybe +bool op_ReadStrptrMaybe(algo_lib::RegxOp& parent, algo::strptr rhs) __attribute__((nothrow)); + +// func:algo_lib.RegxOp..ReadFieldMaybe +bool RegxOp_ReadFieldMaybe(algo_lib::RegxOp& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of algo_lib::RegxOp from an ascii string. +// The format of the string is a string with separated values +// func:algo_lib.RegxOp..ReadStrptrMaybe +bool RegxOp_ReadStrptrMaybe(algo_lib::RegxOp &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:algo_lib.RegxOp..Init +inline void RegxOp_Init(algo_lib::RegxOp& parent); +// print string representation of ROW to string STR +// cfmt:algo_lib.RegxOp.String printfmt:Sep +// func:algo_lib.RegxOp..Print +void RegxOp_Print(algo_lib::RegxOp& row, algo::cstring& str) __attribute__((nothrow)); +// func:algo_lib.RegxOp..GetAnon +algo::strptr RegxOp_GetAnon(algo_lib::RegxOp &parent, i32 idx) __attribute__((nothrow)); + // --- algo_lib.RegxParse // create: algo_lib.FDb.regxparse (Cppstack) struct RegxParse { // algo_lib.RegxParse: Function to parse regx algo::strptr input; // Input string + i32 nextgroup; // 0 Next capture group # algo_lib::Regx* p_regx; // reference to parent row algo_lib::RegxExpr* ary_expr_elems; // pointer to elements u32 ary_expr_n; // number of elements in array @@ -2520,6 +2904,11 @@ algo_lib::RegxExpr& ary_expr_AllocAt(algo_lib::RegxParse& regxparse, int at) __ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo_lib.RegxParse.ary_expr.AllocN algo::aryptr ary_expr_AllocN(algo_lib::RegxParse& regxparse, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo_lib.RegxParse.ary_expr.AllocNAt +algo::aryptr ary_expr_AllocNAt(algo_lib::RegxParse& regxparse, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo_lib.RegxParse.ary_expr.EmptyQ inline bool ary_expr_EmptyQ(algo_lib::RegxParse& regxparse) __attribute__((nothrow)); @@ -2576,6 +2965,10 @@ algo::aryptr ary_expr_AllocNVal(algo_lib::RegxParse& regxpar // Function returns success value. // func:algo_lib.RegxParse.ary_expr.ReadStrptrMaybe bool ary_expr_ReadStrptrMaybe(algo_lib::RegxParse& regxparse, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo_lib.RegxParse.ary_expr.Insary +void ary_expr_Insary(algo_lib::RegxParse& regxparse, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:algo_lib.RegxParse.ary_expr_curs.Next @@ -2600,118 +2993,18 @@ void RegxParse_Print(algo_lib::RegxParse& row, algo::cstring& st // --- algo_lib.RegxState // create: algo_lib.Regx.state (Tary) -struct RegxState { // algo_lib.RegxState - algo::i32_Range* ch_class_elems; // pointer to elements - u32 ch_class_n; // number of elements in array - u32 ch_class_max; // max. capacity of array before realloc - algo_lib::Bitset out; // Where to go on a match - bool accept_all; // false Regx always succeeds from here - // func:algo_lib.RegxState..AssignOp - algo_lib::RegxState& operator =(const algo_lib::RegxState &rhs) __attribute__((nothrow)); +struct RegxState { // algo_lib.RegxState: Instruction + jumps + algo::U16Ary ch_class; // What to match + algo_lib::RegxOp op; // Operation to perform + i32 lparen; // 0 + algo_lib::Bitset next; // Where to go on a match // func:algo_lib.RegxState..Ctor inline RegxState() __attribute__((nothrow)); - // func:algo_lib.RegxState..Dtor - inline ~RegxState() __attribute__((nothrow)); - // func:algo_lib.RegxState..CopyCtor - RegxState(const algo_lib::RegxState &rhs) __attribute__((nothrow)); }; -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -// func:algo_lib.RegxState.ch_class.Addary -algo::aryptr ch_class_Addary(algo_lib::RegxState& parent, algo::aryptr rhs) __attribute__((nothrow)); -// Reserve space. Insert element at the end -// The new element is initialized to a default value -// func:algo_lib.RegxState.ch_class.Alloc -algo::i32_Range& ch_class_Alloc(algo_lib::RegxState& parent) __attribute__((__warn_unused_result__, nothrow)); -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -// func:algo_lib.RegxState.ch_class.AllocAt -algo::i32_Range& ch_class_AllocAt(algo_lib::RegxState& parent, int at) __attribute__((__warn_unused_result__, nothrow)); -// Reserve space. Insert N elements at the end of the array, return pointer to array -// func:algo_lib.RegxState.ch_class.AllocN -algo::aryptr ch_class_AllocN(algo_lib::RegxState& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); -// Return true if index is empty -// func:algo_lib.RegxState.ch_class.EmptyQ -inline bool ch_class_EmptyQ(algo_lib::RegxState& parent) __attribute__((nothrow)); -// Look up row by row id. Return NULL if out of range -// func:algo_lib.RegxState.ch_class.Find -inline algo::i32_Range* ch_class_Find(algo_lib::RegxState& parent, u64 t) __attribute__((__warn_unused_result__, nothrow)); -// Return array pointer by value -// func:algo_lib.RegxState.ch_class.Getary -inline algo::aryptr ch_class_Getary(const algo_lib::RegxState& parent) __attribute__((nothrow)); -// Return pointer to last element of array, or NULL if array is empty -// func:algo_lib.RegxState.ch_class.Last -inline algo::i32_Range* ch_class_Last(algo_lib::RegxState& parent) __attribute__((nothrow, pure)); -// Return max. number of items in the array -// func:algo_lib.RegxState.ch_class.Max -inline i32 ch_class_Max(algo_lib::RegxState& parent) __attribute__((nothrow)); -// Return number of items in the array -// func:algo_lib.RegxState.ch_class.N -inline i32 ch_class_N(const algo_lib::RegxState& parent) __attribute__((__warn_unused_result__, nothrow, pure)); -// Remove item by index. If index outside of range, do nothing. -// func:algo_lib.RegxState.ch_class.Remove -void ch_class_Remove(algo_lib::RegxState& parent, u32 i) __attribute__((nothrow)); -// func:algo_lib.RegxState.ch_class.RemoveAll -inline void ch_class_RemoveAll(algo_lib::RegxState& parent) __attribute__((nothrow)); -// Delete last element of array. Do nothing if array is empty. -// func:algo_lib.RegxState.ch_class.RemoveLast -void ch_class_RemoveLast(algo_lib::RegxState& parent) __attribute__((nothrow)); -// Make sure N *more* elements will fit in array. Process dies if out of memory -// func:algo_lib.RegxState.ch_class.Reserve -inline void ch_class_Reserve(algo_lib::RegxState& parent, int n) __attribute__((nothrow)); -// Make sure N elements fit in array. Process dies if out of memory -// func:algo_lib.RegxState.ch_class.AbsReserve -void ch_class_AbsReserve(algo_lib::RegxState& parent, int n) __attribute__((nothrow)); -// Copy contents of RHS to PARENT. -// func:algo_lib.RegxState.ch_class.Setary -void ch_class_Setary(algo_lib::RegxState& parent, algo_lib::RegxState &rhs) __attribute__((nothrow)); -// Copy specified array into ch_class, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -// func:algo_lib.RegxState.ch_class.Setary2 -void ch_class_Setary(algo_lib::RegxState& parent, const algo::aryptr &rhs) __attribute__((nothrow)); -// 'quick' Access row by row id. No bounds checking. -// func:algo_lib.RegxState.ch_class.qFind -inline algo::i32_Range& ch_class_qFind(algo_lib::RegxState& parent, u64 t) __attribute__((nothrow)); -// Return reference to last element of array. No bounds checking -// func:algo_lib.RegxState.ch_class.qLast -inline algo::i32_Range& ch_class_qLast(algo_lib::RegxState& parent) __attribute__((nothrow)); -// Return row id of specified element -// func:algo_lib.RegxState.ch_class.rowid_Get -inline u64 ch_class_rowid_Get(algo_lib::RegxState& parent, algo::i32_Range &elem) __attribute__((nothrow)); -// Reserve space. Insert N elements at the end of the array, return pointer to array -// func:algo_lib.RegxState.ch_class.AllocNVal -algo::aryptr ch_class_AllocNVal(algo_lib::RegxState& parent, int n_elems, const algo::i32_Range& val) __attribute__((nothrow)); -// Verify whether array is sorted -// func:algo_lib.RegxState.ch_class.SortedQ -bool ch_class_SortedQ(algo_lib::RegxState& parent) __attribute__((nothrow)); -// Insertion sort -// func:algo_lib.RegxState.ch_class.InsertionSort -void ch_class_InsertionSort(algo_lib::RegxState& parent) __attribute__((nothrow)); -// Heap sort -// func:algo_lib.RegxState.ch_class.HeapSort -void ch_class_HeapSort(algo_lib::RegxState& parent) __attribute__((nothrow)); -// Quick sort -// func:algo_lib.RegxState.ch_class.QuickSort -void ch_class_QuickSort(algo_lib::RegxState& parent) __attribute__((nothrow)); - -// proceed to next item -// func:algo_lib.RegxState.ch_class_curs.Next -inline void RegxState_ch_class_curs_Next(RegxState_ch_class_curs &curs) __attribute__((nothrow)); -// func:algo_lib.RegxState.ch_class_curs.Reset -inline void RegxState_ch_class_curs_Reset(RegxState_ch_class_curs &curs, algo_lib::RegxState &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:algo_lib.RegxState.ch_class_curs.ValidQ -inline bool RegxState_ch_class_curs_ValidQ(RegxState_ch_class_curs &curs) __attribute__((nothrow)); -// item access -// func:algo_lib.RegxState.ch_class_curs.Access -inline algo::i32_Range& RegxState_ch_class_curs_Access(RegxState_ch_class_curs &curs) __attribute__((nothrow)); // Set all fields to initial values. // func:algo_lib.RegxState..Init inline void RegxState_Init(algo_lib::RegxState& parent); -// func:algo_lib.RegxState..Uninit -void RegxState_Uninit(algo_lib::RegxState& parent) __attribute__((nothrow)); // print string representation of ROW to string STR // cfmt:algo_lib.RegxState.String printfmt:Extern // func:algo_lib.RegxState..Print @@ -2722,8 +3015,8 @@ void RegxState_Print(algo_lib::RegxState& row, algo::cstring& st // create: algo_lib.FDb.replscope (Cppstack) // access: algo_lib.FReplvar.p_replscope (Upptr) struct Replscope { // algo_lib.Replscope - bool eatcomma; // true - bool fatal; // false Kill process on bad substitution + bool eatcomma; // true Delete comma+space after substitution + u8 strict; // 0 1=warnings; 2=throw exception on error algo_lib::FReplvar** ind_replvar_buckets_elems; // pointer to bucket array i32 ind_replvar_buckets_n; // number of elements in bucket array i32 ind_replvar_n; // number of elements in the hash table @@ -2733,11 +3026,6 @@ struct Replscope { // algo_lib.Replscope inline ~Replscope() __attribute__((nothrow)); }; -// Declaration for user-defined cleanup function -// User-defined cleanup function invoked for field ind_replvar of algo_lib::Replscope -// func:algo_lib.Replscope.ind_replvar.Cleanup -// this function is 'extrn' and implemented by user -void ind_replvar_Cleanup(algo_lib::Replscope& replscope) __attribute__((nothrow)); // Delete all rows reachable through the hash index // func:algo_lib.Replscope.ind_replvar.Cascdel void ind_replvar_Cascdel(algo_lib::Replscope& replscope) __attribute__((nothrow)); @@ -2759,6 +3047,9 @@ void ind_replvar_Remove(algo_lib::Replscope& replscope, algo_lib // Reserve enough room in the hash for N more elements. Return success code. // func:algo_lib.Replscope.ind_replvar.Reserve void ind_replvar_Reserve(algo_lib::Replscope& replscope, int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:algo_lib.Replscope.ind_replvar.AbsReserve +void ind_replvar_AbsReserve(algo_lib::Replscope& replscope, int n) __attribute__((nothrow)); // func:algo_lib.Replscope.ind_replvar_curs.Reset void replscope_ind_replvar_curs_Reset(replscope_ind_replvar_curs &curs, algo_lib::Replscope &parent) __attribute__((nothrow)); @@ -2895,6 +3186,11 @@ i32& width_AllocAt(algo_lib::Tabulate& tabulate, int at) __attri // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo_lib.Tabulate.width.AllocN algo::aryptr width_AllocN(algo_lib::Tabulate& tabulate, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo_lib.Tabulate.width.AllocNAt +algo::aryptr width_AllocNAt(algo_lib::Tabulate& tabulate, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo_lib.Tabulate.width.EmptyQ inline bool width_EmptyQ(algo_lib::Tabulate& tabulate) __attribute__((nothrow)); @@ -2951,6 +3247,10 @@ algo::aryptr width_AllocNVal(algo_lib::Tabulate& tabulate, int n_elems, // Function returns success value. // func:algo_lib.Tabulate.width.ReadStrptrMaybe bool width_ReadStrptrMaybe(algo_lib::Tabulate& tabulate, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo_lib.Tabulate.width.Insary +void width_Insary(algo_lib::Tabulate& tabulate, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:algo_lib.Tabulate.width_curs.Next @@ -3002,6 +3302,15 @@ struct csvparse_ary_tok_curs {// cursor }; +struct regx_state_curs {// cursor + typedef algo_lib::RegxState ChildType; + algo_lib::RegxState* elems; + int n_elems; + int index; + regx_state_curs() { elems=NULL; n_elems=0; index=0; } +}; + + struct _db_temp_strings_curs {// cursor typedef algo::cstring ChildType; int index; @@ -3072,6 +3381,14 @@ struct _db_dirstack_curs {// cursor }; +struct _db_errns_curs {// cursor + typedef algo_lib::FErrns ChildType; + int index; + algo_lib::FDb *parent; + _db_errns_curs() { parent=NULL; index=0; } +}; + + struct txtrow_c_txtcell_curs {// fcurs:algo_lib.FTxtrow.c_txtcell/curs typedef algo_lib::FTxtcell ChildType; algo_lib::FTxtcell** elems; @@ -3098,15 +3415,6 @@ struct InTextFile_temp_buf_curs {// cursor }; -struct regx_state_curs {// cursor - typedef algo_lib::RegxState ChildType; - algo_lib::RegxState* elems; - int n_elems; - int index; - regx_state_curs() { elems=NULL; n_elems=0; index=0; } -}; - - struct regxparse_ary_expr_curs {// cursor typedef algo_lib::RegxExpr ChildType; algo_lib::RegxExpr* elems; @@ -3116,15 +3424,6 @@ struct regxparse_ary_expr_curs {// cursor }; -struct RegxState_ch_class_curs {// cursor - typedef algo::i32_Range ChildType; - algo::i32_Range* elems; - int n_elems; - int index; - RegxState_ch_class_curs() { elems=NULL; n_elems=0; index=0; } -}; - - struct replscope_ind_replvar_curs {// cursor typedef algo_lib::FReplvar ChildType; algo_lib::Replscope *parent; @@ -3154,13 +3453,16 @@ inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::CsvParse & inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::ErrorX &row);// cfmt:algo_lib.ErrorX.String inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::FFildes &row);// cfmt:algo_lib.FFildes.String inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::FTimehook &row);// cfmt:algo_lib.FTimehook.String +inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::RegxFlags &row);// cfmt:algo_lib.RegxFlags.String +inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::RegxStyle &row);// cfmt:algo_lib.RegxStyle.String +inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::Regx &row);// cfmt:algo_lib.Regx.String inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::trace &row);// cfmt:algo_lib.trace.String inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::FDispsigcheck &row);// cfmt:algo_lib.FDispsigcheck.String inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::FTxttbl &row);// cfmt:algo_lib.FTxttbl.String inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::FieldId &row);// cfmt:algo_lib.FieldId.String -inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::Regx &row);// cfmt:algo_lib.Regx.String inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::RegxToken &row);// cfmt:algo_lib.RegxToken.String inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::RegxExpr &row);// cfmt:algo_lib.RegxExpr.String +inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::RegxOp &row);// cfmt:algo_lib.RegxOp.String inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::RegxParse &row);// cfmt:algo_lib.RegxParse.String inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::RegxState &row);// cfmt:algo_lib.RegxState.String inline algo::cstring &operator <<(algo::cstring &str, const algo_lib::Replscope &row);// cfmt:algo_lib.Replscope.String diff --git a/include/gen/algo_lib_gen.inl.h b/include/gen/algo_lib_gen.inl.h index cab0ed92..1d98ff09 100644 --- a/include/gen/algo_lib_gen.inl.h +++ b/include/gen/algo_lib_gen.inl.h @@ -26,9 +26,16 @@ #include "include/gen/algo_gen.inl.h" #include "include/gen/dmmeta_gen.inl.h" //#pragma endinclude -static algo_lib::FLogcat &algo_lib_logcat_expect = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[0]; -static algo_lib::FLogcat &algo_lib_logcat_stderr = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[1]; -static algo_lib::FLogcat &algo_lib_logcat_stdout = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[2]; +static algo_lib::FLogcat &algo_lib_logcat_ams = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[0]; +static algo_lib::FLogcat &algo_lib_logcat_debug = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[1]; +static algo_lib::FLogcat &algo_lib_logcat_inserr = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[2]; +static algo_lib::FLogcat &algo_lib_logcat_slowness = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[3]; +static algo_lib::FLogcat &algo_lib_logcat_stderr = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[4]; +static algo_lib::FLogcat &algo_lib_logcat_stdout = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[5]; +static algo_lib::FLogcat &algo_lib_logcat_timestamps = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[6]; +static algo_lib::FLogcat &algo_lib_logcat_verbose = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[7]; +static algo_lib::FLogcat &algo_lib_logcat_verbose2 = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[8]; +static algo_lib::FLogcat &algo_lib_logcat_warn = ((algo_lib::FLogcat*)algo_lib::_db.logcat_data)[9]; // --- algo_lib.Bitset.ary.NBits // Get max # of bits in the bitset @@ -513,6 +520,10 @@ inline algo_lib::ErrorX::ErrorX(const algo::strptr& in_str) { } +// --- algo_lib.RegxM..Ctor +inline algo_lib::RegxM::RegxM() { +} + // --- algo_lib.FFildes..Uninit inline void algo_lib::FFildes_Uninit(algo_lib::FFildes& fildes) { algo_lib::FFildes &row = fildes; (void)row; @@ -613,6 +624,7 @@ inline void algo_lib::FImdb_Init(algo_lib::FImdb& imdb) { memset(&imdb.MainLoop, 0, sizeof(imdb.MainLoop)); memset(&imdb.GetTrace, 0, sizeof(imdb.GetTrace)); imdb.ind_imdb_next = (algo_lib::FImdb*)-1; // (algo_lib.FDb.ind_imdb) not-in-hash + imdb.ind_imdb_hashval = 0; // stored hash value } // --- algo_lib.FImdb..Ctor @@ -625,12 +637,272 @@ inline algo_lib::FImdb::~FImdb() { algo_lib::FImdb_Uninit(*this); } -// --- algo_lib.FLogcat..Init +// --- algo_lib.RegxFlags.trace.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 0. +inline bool algo_lib::trace_Get(const algo_lib::RegxFlags& parent) { + return bool((parent.value >> 0) & 0x01); +} + +// --- algo_lib.RegxFlags.trace.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 0. +inline void algo_lib::trace_Set(algo_lib::RegxFlags& parent, bool rhs) { + u8 t1 = u8(0x01) << 0; + u8 t2 = (u8(rhs) & 0x01) << 0; + parent.value = u8((parent.value & ~t1) | t2); +} + +// --- algo_lib.RegxFlags.capture.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 1. +inline bool algo_lib::capture_Get(const algo_lib::RegxFlags& parent) { + return bool((parent.value >> 1) & 0x01); +} + +// --- algo_lib.RegxFlags.capture.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 1. +inline void algo_lib::capture_Set(algo_lib::RegxFlags& parent, bool rhs) { + u8 t1 = u8(0x01) << 1; + u8 t2 = (u8(rhs) & 0x01) << 1; + parent.value = u8((parent.value & ~t1) | t2); +} + +// --- algo_lib.RegxFlags.valid.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 2. +inline bool algo_lib::valid_Get(const algo_lib::RegxFlags& parent) { + return bool((parent.value >> 2) & 0x01); +} + +// --- algo_lib.RegxFlags.valid.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 2. +inline void algo_lib::valid_Set(algo_lib::RegxFlags& parent, bool rhs) { + u8 t1 = u8(0x01) << 2; + u8 t2 = (u8(rhs) & 0x01) << 2; + parent.value = u8((parent.value & ~t1) | t2); +} + +// --- algo_lib.RegxFlags.literal.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 3. +inline bool algo_lib::literal_Get(const algo_lib::RegxFlags& parent) { + return bool((parent.value >> 3) & 0x01); +} + +// --- algo_lib.RegxFlags.literal.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 3. +inline void algo_lib::literal_Set(algo_lib::RegxFlags& parent, bool rhs) { + u8 t1 = u8(0x01) << 3; + u8 t2 = (u8(rhs) & 0x01) << 3; + parent.value = u8((parent.value & ~t1) | t2); +} + +// --- algo_lib.RegxFlags.accepts_all.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 4. +inline bool algo_lib::accepts_all_Get(const algo_lib::RegxFlags& parent) { + return bool((parent.value >> 4) & 0x01); +} + +// --- algo_lib.RegxFlags.accepts_all.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 4. +inline void algo_lib::accepts_all_Set(algo_lib::RegxFlags& parent, bool rhs) { + u8 t1 = u8(0x01) << 4; + u8 t2 = (u8(rhs) & 0x01) << 4; + parent.value = u8((parent.value & ~t1) | t2); +} + +// --- algo_lib.RegxFlags.fullmatch.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 5. +inline bool algo_lib::fullmatch_Get(const algo_lib::RegxFlags& parent) { + return bool((parent.value >> 5) & 0x01); +} + +// --- algo_lib.RegxFlags.fullmatch.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 5. +inline void algo_lib::fullmatch_Set(algo_lib::RegxFlags& parent, bool rhs) { + u8 t1 = u8(0x01) << 5; + u8 t2 = (u8(rhs) & 0x01) << 5; + parent.value = u8((parent.value & ~t1) | t2); +} + +// --- algo_lib.RegxFlags..Init +// Set all fields to initial values. +inline void algo_lib::RegxFlags_Init(algo_lib::RegxFlags& parent) { + parent.value = u8(0); +} + +// --- algo_lib.RegxFlags..Ctor +inline algo_lib::RegxFlags::RegxFlags() { + algo_lib::RegxFlags_Init(*this); +} + +// --- algo_lib.RegxFlags..FieldwiseCtor +inline algo_lib::RegxFlags::RegxFlags(u8 in_value) + : value(in_value) + { +} + +// --- algo_lib.RegxFlags..EnumCtor +inline algo_lib::RegxFlags::RegxFlags(algo_lib_RegxFlagsEnum arg) { + this->value = u8(arg); +} + +// --- algo_lib.RegxStyle.value.GetEnum +// Get value of field as enum type +inline algo_lib_RegxStyleEnum algo_lib::value_GetEnum(const algo_lib::RegxStyle& parent) { + return algo_lib_RegxStyleEnum(parent.value); +} + +// --- algo_lib.RegxStyle.value.SetEnum +// Set value of field from enum type. +inline void algo_lib::value_SetEnum(algo_lib::RegxStyle& parent, algo_lib_RegxStyleEnum rhs) { + parent.value = u8(rhs); +} + +// --- algo_lib.RegxStyle.value.Cast +inline algo_lib::RegxStyle::operator algo_lib_RegxStyleEnum() const { + return algo_lib_RegxStyleEnum((*this).value); +} + +// --- algo_lib.RegxStyle..Init +// Set all fields to initial values. +inline void algo_lib::RegxStyle_Init(algo_lib::RegxStyle& parent) { + parent.value = u8(0); +} + +// --- algo_lib.RegxStyle..Ctor +inline algo_lib::RegxStyle::RegxStyle() { + algo_lib::RegxStyle_Init(*this); +} + +// --- algo_lib.RegxStyle..FieldwiseCtor +inline algo_lib::RegxStyle::RegxStyle(u8 in_value) + : value(in_value) + { +} + +// --- algo_lib.RegxStyle..EnumCtor +inline algo_lib::RegxStyle::RegxStyle(algo_lib_RegxStyleEnum arg) { + this->value = u8(arg); +} + +// --- algo_lib.Regx.state.EmptyQ +// Return true if index is empty +inline bool algo_lib::state_EmptyQ(algo_lib::Regx& regx) { + return regx.state_n == 0; +} + +// --- algo_lib.Regx.state.Find +// Look up row by row id. Return NULL if out of range +inline algo_lib::RegxState* algo_lib::state_Find(algo_lib::Regx& regx, u64 t) { + u64 idx = t; + u64 lim = regx.state_n; + if (idx >= lim) return NULL; + return regx.state_elems + idx; +} + +// --- algo_lib.Regx.state.Getary +// Return array pointer by value +inline algo::aryptr algo_lib::state_Getary(const algo_lib::Regx& regx) { + return algo::aryptr(regx.state_elems, regx.state_n); +} + +// --- algo_lib.Regx.state.Last +// Return pointer to last element of array, or NULL if array is empty +inline algo_lib::RegxState* algo_lib::state_Last(algo_lib::Regx& regx) { + return state_Find(regx, u64(regx.state_n-1)); +} + +// --- algo_lib.Regx.state.Max +// Return max. number of items in the array +inline i32 algo_lib::state_Max(algo_lib::Regx& regx) { + (void)regx; + return regx.state_max; +} + +// --- algo_lib.Regx.state.N +// Return number of items in the array +inline i32 algo_lib::state_N(const algo_lib::Regx& regx) { + return regx.state_n; +} + +// --- algo_lib.Regx.state.Reserve +// Make sure N *more* elements will fit in array. Process dies if out of memory +inline void algo_lib::state_Reserve(algo_lib::Regx& regx, int n) { + u32 new_n = regx.state_n + n; + if (UNLIKELY(new_n > regx.state_max)) { + state_AbsReserve(regx, new_n); + } +} + +// --- algo_lib.Regx.state.qFind +// 'quick' Access row by row id. No bounds checking. +inline algo_lib::RegxState& algo_lib::state_qFind(algo_lib::Regx& regx, u64 t) { + return regx.state_elems[t]; +} + +// --- algo_lib.Regx.state.qLast +// Return reference to last element of array. No bounds checking +inline algo_lib::RegxState& algo_lib::state_qLast(algo_lib::Regx& regx) { + return state_qFind(regx, u64(regx.state_n-1)); +} + +// --- algo_lib.Regx.state.rowid_Get +// Return row id of specified element +inline u64 algo_lib::state_rowid_Get(algo_lib::Regx& regx, algo_lib::RegxState &elem) { + u64 id = &elem - regx.state_elems; + return u64(id); +} + +// --- algo_lib.Regx.state_curs.Next +// proceed to next item +inline void algo_lib::regx_state_curs_Next(regx_state_curs &curs) { + curs.index++; +} + +// --- algo_lib.Regx.state_curs.Reset +inline void algo_lib::regx_state_curs_Reset(regx_state_curs &curs, algo_lib::Regx &parent) { + curs.elems = parent.state_elems; + curs.n_elems = parent.state_n; + curs.index = 0; +} + +// --- algo_lib.Regx.state_curs.ValidQ +// cursor points to valid item +inline bool algo_lib::regx_state_curs_ValidQ(regx_state_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- algo_lib.Regx.state_curs.Access +// item access +inline algo_lib::RegxState& algo_lib::regx_state_curs_Access(regx_state_curs &curs) { + return curs.elems[curs.index]; +} + +// --- algo_lib.Regx..Init // Set all fields to initial values. -inline void algo_lib::FLogcat_Init(algo_lib::FLogcat& logcat) { - logcat.enabled = bool(false); - logcat.builtin = bool(false); - logcat.ind_logcat_next = (algo_lib::FLogcat*)-1; // (algo_lib.FDb.ind_logcat) not-in-hash +inline void algo_lib::Regx_Init(algo_lib::Regx& regx) { + regx.state_elems = 0; // (algo_lib.Regx.state) + regx.state_n = 0; // (algo_lib.Regx.state) + regx.state_max = 0; // (algo_lib.Regx.state) +} + +// --- algo_lib.Regx..Ctor +inline algo_lib::Regx::Regx() { + algo_lib::Regx_Init(*this); +} + +// --- algo_lib.Regx..Dtor +inline algo_lib::Regx::~Regx() { + algo_lib::Regx_Uninit(*this); } // --- algo_lib.FLogcat..Ctor @@ -643,6 +915,48 @@ inline algo_lib::FLogcat::~FLogcat() { algo_lib::FLogcat_Uninit(*this); } +// --- algo_lib.FErrns.decode.Call +// Invoke function by pointer +inline void algo_lib::decode_Call(algo_lib::FErrns& errns, i32& arg) { + if (errns.decode) { + errns.decode((void*)errns.decode_ctx, arg); + } +} + +// --- algo_lib.FErrns.decode.Set0 +// Assign 0-argument hook with no context pointer +inline void algo_lib::decode_Set0(algo_lib::FErrns& errns, void (*fcn)() ) { + errns.decode_ctx = 0; + errns.decode = (algo_lib::errns_decode_hook)fcn; +} + +// --- algo_lib.FErrns.decode.Set1 +// Assign 1-argument hook with context pointer +template inline void algo_lib::decode_Set1(algo_lib::FErrns& errns, T& ctx, void (*fcn)(T&) ) { + errns.decode_ctx = (u64)&ctx; + errns.decode = (algo_lib::errns_decode_hook)fcn; +} + +// --- algo_lib.FErrns.decode.Set2 +// Assign 2-argument hook with context pointer +template inline void algo_lib::decode_Set2(algo_lib::FErrns& errns, T& ctx, void (*fcn)(T&, i32& arg) ) { + errns.decode_ctx = (u64)&ctx; + errns.decode = (algo_lib::errns_decode_hook)fcn; +} + +// --- algo_lib.FErrns..Init +// Set all fields to initial values. +inline void algo_lib::FErrns_Init(algo_lib::FErrns& errns) { + errns.errns = i32(0); + errns.decode = NULL; + errns.decode_ctx = 0; +} + +// --- algo_lib.FErrns..Ctor +inline algo_lib::FErrns::FErrns() { + algo_lib::FErrns_Init(*this); +} + // --- algo_lib.trace..Ctor inline algo_lib::trace::trace() { algo_lib::trace_Init(*this); @@ -812,13 +1126,6 @@ inline i32 algo_lib::bh_timehook_N() { return _db.bh_timehook_n; } -// --- algo_lib.FDb.bh_timehook.Call -inline void algo_lib::bh_timehook_Call() { - if (!algo_lib::bh_timehook_EmptyQ()) { // fstep:algo_lib.FDb.bh_timehook - algo_lib::bh_timehook_Step(); // steptype:Callback: user calls call _UpdateCycles - } -} - // --- algo_lib.FDb.dispsigcheck.EmptyQ // Return true if index is empty inline bool algo_lib::dispsigcheck_EmptyQ() { @@ -969,11 +1276,6 @@ template inline void algo_lib::h_fatalerror_Set2(T& ctx, void (*fcn)(T& _db.h_fatalerror = (algo_lib::_db_h_fatalerror_hook)fcn; } -// --- algo_lib.FDb.giveup_time.Call -inline void algo_lib::giveup_time_Call() { - algo_lib::giveup_time_Step(); -} - // --- algo_lib.FDb.DigitChar.Match inline bool algo_lib::DigitCharQ(u32 ch) { bool ret = false; @@ -1110,7 +1412,7 @@ inline bool algo_lib::UrlsafeQ(u32 ch) { // Allocate space for one element. If no memory available, return NULL. inline void* algo_lib::logcat_AllocMem() { void *row = reinterpret_cast(_db.logcat_data) + _db.logcat_n; - if (_db.logcat_n == 3) row = NULL; + if (_db.logcat_n == 10) row = NULL; if (row) _db.logcat_n++; return row; } @@ -1136,9 +1438,9 @@ inline algo::aryptr algo_lib::logcat_Getary() { } // --- algo_lib.FDb.logcat.Max -// Return constant 3 -- max. number of items in the pool +// Return constant 10 -- max. number of items in the pool inline i32 algo_lib::logcat_Max() { - return 3; + return 10; } // --- algo_lib.FDb.logcat.N @@ -1307,6 +1609,44 @@ inline u64 algo_lib::dirstack_rowid_Get(algo::cstring &elem) { return u64(id); } +// --- algo_lib.FDb.errns.Find +// Look up row by row id. Return NULL if out of range +inline algo_lib::FErrns* algo_lib::errns_Find(i32 t) { + u64 idx = t; + u64 lim = 8; + return idx < lim ? _db.errns_elems + idx : NULL; // unsigned comparison with limit +} + +// --- algo_lib.FDb.errns.Getary +// Access fixed array errns as aryptr. +inline algo::aryptr algo_lib::errns_Getary() { + return algo::aryptr(_db.errns_elems, 8); +} + +// --- algo_lib.FDb.errns.Max +// Return max number of items in the array +inline i32 algo_lib::errns_Max() { + return 8; +} + +// --- algo_lib.FDb.errns.N +// Return number of items in the array +inline i32 algo_lib::errns_N() { + (void)_db;//only to avoid -Wunused-parameter + return 8; +} + +// --- algo_lib.FDb.errns.qFind +// 'quick' Access row by row id. No bounds checking in release. +inline algo_lib::FErrns& algo_lib::errns_qFind(i32 t) { + return _db.errns_elems[u64(t)]; +} + +// --- algo_lib.FDb.giveup_time.Call +inline void algo_lib::giveup_time_Call() { + algo_lib::giveup_time_Step(); +} + // --- algo_lib.FDb.temp_strings_curs.Reset // cursor points to valid item inline void algo_lib::_db_temp_strings_curs_Reset(_db_temp_strings_curs &curs, algo_lib::FDb &parent) { @@ -1494,10 +1834,36 @@ inline algo::cstring& algo_lib::_db_dirstack_curs_Access(_db_dirstack_curs &curs return curs.elems[curs.index]; } +// --- algo_lib.FDb.errns_curs.Reset +// cursor points to valid item +inline void algo_lib::_db_errns_curs_Reset(_db_errns_curs &curs, algo_lib::FDb &parent) { + curs.parent = &parent; + curs.index = 0; +} + +// --- algo_lib.FDb.errns_curs.ValidQ +// cursor points to valid item +inline bool algo_lib::_db_errns_curs_ValidQ(_db_errns_curs &curs) { + return u64(curs.index) < u64(8); +} + +// --- algo_lib.FDb.errns_curs.Next +// proceed to next item +inline void algo_lib::_db_errns_curs_Next(_db_errns_curs &curs) { + curs.index++; +} + +// --- algo_lib.FDb.errns_curs.Access +// item access +inline algo_lib::FErrns& algo_lib::_db_errns_curs_Access(_db_errns_curs &curs) { + return errns_qFind(i32(curs.index)); +} + // --- algo_lib.FDispsigcheck..Init // Set all fields to initial values. inline void algo_lib::FDispsigcheck_Init(algo_lib::FDispsigcheck& dispsigcheck) { dispsigcheck.ind_dispsigcheck_next = (algo_lib::FDispsigcheck*)-1; // (algo_lib.FDb.ind_dispsigcheck) not-in-hash + dispsigcheck.ind_dispsigcheck_hashval = 0; // stored hash value } // --- algo_lib.FDispsigcheck..Ctor @@ -1519,6 +1885,7 @@ inline void algo_lib::FImtable_Init(algo_lib::FImtable& imtable) { memset(&imtable.Print, 0, sizeof(imtable.Print)); imtable.size = i32(0); imtable.ind_imtable_next = (algo_lib::FImtable*)-1; // (algo_lib.FDb.ind_imtable) not-in-hash + imtable.ind_imtable_hashval = 0; // stored hash value } // --- algo_lib.FImtable..Ctor @@ -1590,8 +1957,10 @@ inline algo_lib::FIohook::~FIohook() { inline void algo_lib::FReplvar_Init(algo_lib::FReplvar& replvar) { replvar.p_replscope = NULL; replvar.nsubst = i32(0); + replvar.partial = bool(false); replvar.replvar_next = (algo_lib::FReplvar*)-1; // (algo_lib.FDb.replvar) not-in-tpool's freelist - replvar.ind_replvar_next = (algo_lib::FReplvar*)-1; // (algo_lib.Replscope.ind_replvar) not-in-hash + replvar.replscope_ind_replvar_next = (algo_lib::FReplvar*)-1; // (algo_lib.Replscope.ind_replvar) not-in-hash + replvar.replscope_ind_replvar_hashval = 0; // stored hash value } // --- algo_lib.FReplvar..Ctor @@ -1855,7 +2224,6 @@ inline void algo_lib::FTxttbl_Init(algo_lib::FTxttbl& txttbl) { txttbl.c_txtrow_n = 0; // (algo_lib.FTxttbl.c_txtrow) txttbl.c_txtrow_max = 0; // (algo_lib.FTxttbl.c_txtrow) txttbl.col_space = i32(2); - txttbl.hdr_row = i32(0); txttbl.normalized = bool(false); } @@ -2046,121 +2414,6 @@ inline algo_lib::Mmap::~Mmap() { inline algo_lib::MmapFile::MmapFile() { } -// --- algo_lib.Regx.state.EmptyQ -// Return true if index is empty -inline bool algo_lib::state_EmptyQ(algo_lib::Regx& regx) { - return regx.state_n == 0; -} - -// --- algo_lib.Regx.state.Find -// Look up row by row id. Return NULL if out of range -inline algo_lib::RegxState* algo_lib::state_Find(algo_lib::Regx& regx, u64 t) { - u64 idx = t; - u64 lim = regx.state_n; - if (idx >= lim) return NULL; - return regx.state_elems + idx; -} - -// --- algo_lib.Regx.state.Getary -// Return array pointer by value -inline algo::aryptr algo_lib::state_Getary(const algo_lib::Regx& regx) { - return algo::aryptr(regx.state_elems, regx.state_n); -} - -// --- algo_lib.Regx.state.Last -// Return pointer to last element of array, or NULL if array is empty -inline algo_lib::RegxState* algo_lib::state_Last(algo_lib::Regx& regx) { - return state_Find(regx, u64(regx.state_n-1)); -} - -// --- algo_lib.Regx.state.Max -// Return max. number of items in the array -inline i32 algo_lib::state_Max(algo_lib::Regx& regx) { - (void)regx; - return regx.state_max; -} - -// --- algo_lib.Regx.state.N -// Return number of items in the array -inline i32 algo_lib::state_N(const algo_lib::Regx& regx) { - return regx.state_n; -} - -// --- algo_lib.Regx.state.Reserve -// Make sure N *more* elements will fit in array. Process dies if out of memory -inline void algo_lib::state_Reserve(algo_lib::Regx& regx, int n) { - u32 new_n = regx.state_n + n; - if (UNLIKELY(new_n > regx.state_max)) { - state_AbsReserve(regx, new_n); - } -} - -// --- algo_lib.Regx.state.qFind -// 'quick' Access row by row id. No bounds checking. -inline algo_lib::RegxState& algo_lib::state_qFind(algo_lib::Regx& regx, u64 t) { - return regx.state_elems[t]; -} - -// --- algo_lib.Regx.state.qLast -// Return reference to last element of array. No bounds checking -inline algo_lib::RegxState& algo_lib::state_qLast(algo_lib::Regx& regx) { - return state_qFind(regx, u64(regx.state_n-1)); -} - -// --- algo_lib.Regx.state.rowid_Get -// Return row id of specified element -inline u64 algo_lib::state_rowid_Get(algo_lib::Regx& regx, algo_lib::RegxState &elem) { - u64 id = &elem - regx.state_elems; - return u64(id); -} - -// --- algo_lib.Regx.state_curs.Next -// proceed to next item -inline void algo_lib::regx_state_curs_Next(regx_state_curs &curs) { - curs.index++; -} - -// --- algo_lib.Regx.state_curs.Reset -inline void algo_lib::regx_state_curs_Reset(regx_state_curs &curs, algo_lib::Regx &parent) { - curs.elems = parent.state_elems; - curs.n_elems = parent.state_n; - curs.index = 0; -} - -// --- algo_lib.Regx.state_curs.ValidQ -// cursor points to valid item -inline bool algo_lib::regx_state_curs_ValidQ(regx_state_curs &curs) { - return curs.index < curs.n_elems; -} - -// --- algo_lib.Regx.state_curs.Access -// item access -inline algo_lib::RegxState& algo_lib::regx_state_curs_Access(regx_state_curs &curs) { - return curs.elems[curs.index]; -} - -// --- algo_lib.Regx..Init -// Set all fields to initial values. -inline void algo_lib::Regx_Init(algo_lib::Regx& regx) { - regx.state_elems = 0; // (algo_lib.Regx.state) - regx.state_n = 0; // (algo_lib.Regx.state) - regx.state_max = 0; // (algo_lib.Regx.state) - regx.accept = i32(0); - regx.parseerror = bool(false); - regx.accepts_all = bool(false); - regx.literal = bool(false); -} - -// --- algo_lib.Regx..Ctor -inline algo_lib::Regx::Regx() { - algo_lib::Regx_Init(*this); -} - -// --- algo_lib.Regx..Dtor -inline algo_lib::Regx::~Regx() { - algo_lib::Regx_Uninit(*this); -} - // --- algo_lib.RegxToken.type.GetEnum // Get value of field as enum type inline algo_lib_RegxToken_type_Enum algo_lib::type_GetEnum(const algo_lib::RegxToken& parent) { @@ -2203,7 +2456,7 @@ inline algo_lib::RegxToken::RegxToken(algo_lib_RegxToken_type_Enum arg) { // --- algo_lib.RegxExpr..Init // Set all fields to initial values. inline void algo_lib::RegxExpr_Init(algo_lib::RegxExpr& parent) { - parent.in = i32(0); + parent.first = i32(0); } // --- algo_lib.RegxExpr..Ctor @@ -2211,6 +2464,39 @@ inline algo_lib::RegxExpr::RegxExpr() { algo_lib::RegxExpr_Init(*this); } +// --- algo_lib.RegxOp.op.GetEnum +// Get value of field as enum type +inline algo_lib_RegxOpEnum algo_lib::op_GetEnum(const algo_lib::RegxOp& parent) { + return algo_lib_RegxOpEnum(parent.op); +} + +// --- algo_lib.RegxOp.op.SetEnum +// Set value of field from enum type. +inline void algo_lib::op_SetEnum(algo_lib::RegxOp& parent, algo_lib_RegxOpEnum rhs) { + parent.op = u8(rhs); +} + +// --- algo_lib.RegxOp..Init +// Set all fields to initial values. +inline void algo_lib::RegxOp_Init(algo_lib::RegxOp& parent) { + parent.op = u8(0); + parent.consume = u8(1); + parent.imm = u16(0); +} + +// --- algo_lib.RegxOp..Ctor +inline algo_lib::RegxOp::RegxOp() { + algo_lib::RegxOp_Init(*this); +} + +// --- algo_lib.RegxOp..FieldwiseCtor +inline algo_lib::RegxOp::RegxOp(u8 in_op, u8 in_consume, u16 in_imm) + : op(in_op) + , consume(in_consume) + , imm(in_imm) + { +} + // --- algo_lib.RegxParse.ary_expr.EmptyQ // Return true if index is empty inline bool algo_lib::ary_expr_EmptyQ(algo_lib::RegxParse& regxparse) { @@ -2307,6 +2593,7 @@ inline algo_lib::RegxExpr& algo_lib::regxparse_ary_expr_curs_Access(regxparse_ar // --- algo_lib.RegxParse..Init // Set all fields to initial values. inline void algo_lib::RegxParse_Init(algo_lib::RegxParse& regxparse) { + regxparse.nextgroup = i32(0); regxparse.p_regx = NULL; regxparse.ary_expr_elems = 0; // (algo_lib.RegxParse.ary_expr) regxparse.ary_expr_n = 0; // (algo_lib.RegxParse.ary_expr) @@ -2323,111 +2610,10 @@ inline algo_lib::RegxParse::~RegxParse() { algo_lib::RegxParse_Uninit(*this); } -// --- algo_lib.RegxState.ch_class.EmptyQ -// Return true if index is empty -inline bool algo_lib::ch_class_EmptyQ(algo_lib::RegxState& parent) { - return parent.ch_class_n == 0; -} - -// --- algo_lib.RegxState.ch_class.Find -// Look up row by row id. Return NULL if out of range -inline algo::i32_Range* algo_lib::ch_class_Find(algo_lib::RegxState& parent, u64 t) { - u64 idx = t; - u64 lim = parent.ch_class_n; - if (idx >= lim) return NULL; - return parent.ch_class_elems + idx; -} - -// --- algo_lib.RegxState.ch_class.Getary -// Return array pointer by value -inline algo::aryptr algo_lib::ch_class_Getary(const algo_lib::RegxState& parent) { - return algo::aryptr(parent.ch_class_elems, parent.ch_class_n); -} - -// --- algo_lib.RegxState.ch_class.Last -// Return pointer to last element of array, or NULL if array is empty -inline algo::i32_Range* algo_lib::ch_class_Last(algo_lib::RegxState& parent) { - return ch_class_Find(parent, u64(parent.ch_class_n-1)); -} - -// --- algo_lib.RegxState.ch_class.Max -// Return max. number of items in the array -inline i32 algo_lib::ch_class_Max(algo_lib::RegxState& parent) { - (void)parent; - return parent.ch_class_max; -} - -// --- algo_lib.RegxState.ch_class.N -// Return number of items in the array -inline i32 algo_lib::ch_class_N(const algo_lib::RegxState& parent) { - return parent.ch_class_n; -} - -// --- algo_lib.RegxState.ch_class.RemoveAll -inline void algo_lib::ch_class_RemoveAll(algo_lib::RegxState& parent) { - parent.ch_class_n = 0; -} - -// --- algo_lib.RegxState.ch_class.Reserve -// Make sure N *more* elements will fit in array. Process dies if out of memory -inline void algo_lib::ch_class_Reserve(algo_lib::RegxState& parent, int n) { - u32 new_n = parent.ch_class_n + n; - if (UNLIKELY(new_n > parent.ch_class_max)) { - ch_class_AbsReserve(parent, new_n); - } -} - -// --- algo_lib.RegxState.ch_class.qFind -// 'quick' Access row by row id. No bounds checking. -inline algo::i32_Range& algo_lib::ch_class_qFind(algo_lib::RegxState& parent, u64 t) { - return parent.ch_class_elems[t]; -} - -// --- algo_lib.RegxState.ch_class.qLast -// Return reference to last element of array. No bounds checking -inline algo::i32_Range& algo_lib::ch_class_qLast(algo_lib::RegxState& parent) { - return ch_class_qFind(parent, u64(parent.ch_class_n-1)); -} - -// --- algo_lib.RegxState.ch_class.rowid_Get -// Return row id of specified element -inline u64 algo_lib::ch_class_rowid_Get(algo_lib::RegxState& parent, algo::i32_Range &elem) { - u64 id = &elem - parent.ch_class_elems; - return u64(id); -} - -// --- algo_lib.RegxState.ch_class_curs.Next -// proceed to next item -inline void algo_lib::RegxState_ch_class_curs_Next(RegxState_ch_class_curs &curs) { - curs.index++; -} - -// --- algo_lib.RegxState.ch_class_curs.Reset -inline void algo_lib::RegxState_ch_class_curs_Reset(RegxState_ch_class_curs &curs, algo_lib::RegxState &parent) { - curs.elems = parent.ch_class_elems; - curs.n_elems = parent.ch_class_n; - curs.index = 0; -} - -// --- algo_lib.RegxState.ch_class_curs.ValidQ -// cursor points to valid item -inline bool algo_lib::RegxState_ch_class_curs_ValidQ(RegxState_ch_class_curs &curs) { - return curs.index < curs.n_elems; -} - -// --- algo_lib.RegxState.ch_class_curs.Access -// item access -inline algo::i32_Range& algo_lib::RegxState_ch_class_curs_Access(RegxState_ch_class_curs &curs) { - return curs.elems[curs.index]; -} - // --- algo_lib.RegxState..Init // Set all fields to initial values. inline void algo_lib::RegxState_Init(algo_lib::RegxState& parent) { - parent.ch_class_elems = 0; // (algo_lib.RegxState.ch_class) - parent.ch_class_n = 0; // (algo_lib.RegxState.ch_class) - parent.ch_class_max = 0; // (algo_lib.RegxState.ch_class) - parent.accept_all = bool(false); + parent.lparen = i32(0); } // --- algo_lib.RegxState..Ctor @@ -2435,11 +2621,6 @@ inline algo_lib::RegxState::RegxState() { algo_lib::RegxState_Init(*this); } -// --- algo_lib.RegxState..Dtor -inline algo_lib::RegxState::~RegxState() { - algo_lib::RegxState_Uninit(*this); -} - // --- algo_lib.Replscope.ind_replvar.EmptyQ // Return true if hash is empty inline bool algo_lib::ind_replvar_EmptyQ(algo_lib::Replscope& replscope) { @@ -2461,7 +2642,7 @@ inline bool algo_lib::replscope_ind_replvar_curs_ValidQ(replscope_ind_replvar_cu // --- algo_lib.Replscope.ind_replvar_curs.Next // proceed to next item inline void algo_lib::replscope_ind_replvar_curs_Next(replscope_ind_replvar_curs &curs) { - curs.prow = &(*curs.prow)->ind_replvar_next; + curs.prow = &(*curs.prow)->replscope_ind_replvar_next; while (!*curs.prow) { curs.bucket += 1; if (curs.bucket >= curs.parent->ind_replvar_buckets_n) break; @@ -2693,6 +2874,21 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const algo_lib::FTim return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const algo_lib::RegxFlags &row) {// cfmt:algo_lib.RegxFlags.String + algo_lib::RegxFlags_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const algo_lib::RegxStyle &row) {// cfmt:algo_lib.RegxStyle.String + algo_lib::RegxStyle_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const algo_lib::Regx &row) {// cfmt:algo_lib.Regx.String + algo_lib::Regx_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const algo_lib::trace &row) {// cfmt:algo_lib.trace.String algo_lib::trace_Print(const_cast(row), str); return str; @@ -2713,11 +2909,6 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const algo_lib::Fiel return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const algo_lib::Regx &row) {// cfmt:algo_lib.Regx.String - algo_lib::Regx_Print(const_cast(row), str); - return str; -} - inline algo::cstring &algo::operator <<(algo::cstring &str, const algo_lib::RegxToken &row) {// cfmt:algo_lib.RegxToken.String algo_lib::RegxToken_Print(const_cast(row), str); return str; @@ -2728,6 +2919,11 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const algo_lib::Regx return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const algo_lib::RegxOp &row) {// cfmt:algo_lib.RegxOp.String + algo_lib::RegxOp_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const algo_lib::RegxParse &row) {// cfmt:algo_lib.RegxParse.String algo_lib::RegxParse_Print(const_cast(row), str); return str; diff --git a/include/gen/amc_gen.h b/include/gen/amc_gen.h index 4bd4be3a..26d310e0 100644 --- a/include/gen/amc_gen.h +++ b/include/gen/amc_gen.h @@ -160,13 +160,13 @@ enum { amc_FieldIdEnum_N = 3 }; // --- amc_PnewtypeEnum -enum amc_PnewtypeEnum { // amc.Pnewtype.value - amc_Pnewtype_Memptr = 0 // Some region in memory - ,amc_Pnewtype_AmsStream = 1 // Ams stream - ,amc_Pnewtype_Fixed = 2 // Fixed buffer - ,amc_Pnewtype_Dynamic = 3 // Dynamic buffer - ,amc_Pnewtype_ByteAry = 4 // ByteAry - ,amc_Pnewtype_Append = 5 // Append +enum amc_PnewtypeEnum { // amc.Pnewtype.value + amc_Pnewtype_Memptr = 0 // Some region in memory + ,amc_Pnewtype_Shm = 1 // Ams stream + ,amc_Pnewtype_Fixed = 2 // Fixed buffer + ,amc_Pnewtype_Dynamic = 3 // Dynamic buffer + ,amc_Pnewtype_ByteAry = 4 // ByteAry + ,amc_Pnewtype_Append = 5 // Append }; enum { amc_PnewtypeEnum_N = 6 }; @@ -174,210 +174,220 @@ enum { amc_PnewtypeEnum_N = 6 }; // --- amc_TableIdEnum -enum amc_TableIdEnum { // amc.TableId.value - amc_TableId_dmmeta_Anonfld = 0 // dmmeta.Anonfld -> amc.FAnonfld - ,amc_TableId_dmmeta_anonfld = 0 // dmmeta.anonfld -> amc.FAnonfld - ,amc_TableId_dmmeta_Argvtype = 1 // dmmeta.Argvtype -> amc.FArgvtype - ,amc_TableId_dmmeta_argvtype = 1 // dmmeta.argvtype -> amc.FArgvtype - ,amc_TableId_dmmeta_Basepool = 2 // dmmeta.Basepool -> amc.FBasepool - ,amc_TableId_dmmeta_basepool = 2 // dmmeta.basepool -> amc.FBasepool - ,amc_TableId_dmmeta_Bitfld = 3 // dmmeta.Bitfld -> amc.FBitfld - ,amc_TableId_dmmeta_bitfld = 3 // dmmeta.bitfld -> amc.FBitfld - ,amc_TableId_amcdb_Bltin = 4 // amcdb.Bltin -> amc.FBltin - ,amc_TableId_amcdb_bltin = 4 // amcdb.bltin -> amc.FBltin - ,amc_TableId_dmmeta_Cafter = 5 // dmmeta.Cafter -> amc.FCafter - ,amc_TableId_dmmeta_cafter = 5 // dmmeta.cafter -> amc.FCafter - ,amc_TableId_dmmeta_Cascdel = 6 // dmmeta.Cascdel -> amc.FCascdel - ,amc_TableId_dmmeta_cascdel = 6 // dmmeta.cascdel -> amc.FCascdel - ,amc_TableId_dmmeta_Ccmp = 7 // dmmeta.Ccmp -> amc.FCcmp - ,amc_TableId_dmmeta_ccmp = 7 // dmmeta.ccmp -> amc.FCcmp - ,amc_TableId_dmmeta_Cdflt = 8 // dmmeta.Cdflt -> amc.FCdflt - ,amc_TableId_dmmeta_cdflt = 8 // dmmeta.cdflt -> amc.FCdflt - ,amc_TableId_dmmeta_Cextern = 9 // dmmeta.Cextern -> amc.FCextern - ,amc_TableId_dmmeta_cextern = 9 // dmmeta.cextern -> amc.FCextern - ,amc_TableId_dmmeta_Cfast = 10 // dmmeta.Cfast -> amc.FCfast - ,amc_TableId_dmmeta_cfast = 10 // dmmeta.cfast -> amc.FCfast - ,amc_TableId_dmmeta_Cfmt = 11 // dmmeta.Cfmt -> amc.FCfmt - ,amc_TableId_dmmeta_cfmt = 11 // dmmeta.cfmt -> amc.FCfmt - ,amc_TableId_dmmeta_Cget = 12 // dmmeta.Cget -> amc.FCget - ,amc_TableId_dmmeta_cget = 12 // dmmeta.cget -> amc.FCget - ,amc_TableId_dmmeta_Charset = 13 // dmmeta.Charset -> amc.FCharset - ,amc_TableId_dmmeta_charset = 13 // dmmeta.charset -> amc.FCharset - ,amc_TableId_dmmeta_Chash = 14 // dmmeta.Chash -> amc.FChash - ,amc_TableId_dmmeta_chash = 14 // dmmeta.chash -> amc.FChash - ,amc_TableId_dmmeta_Cppfunc = 15 // dmmeta.Cppfunc -> amc.FCppfunc - ,amc_TableId_dmmeta_cppfunc = 15 // dmmeta.cppfunc -> amc.FCppfunc - ,amc_TableId_dmmeta_Cpptype = 16 // dmmeta.Cpptype -> amc.FCpptype - ,amc_TableId_dmmeta_cpptype = 16 // dmmeta.cpptype -> amc.FCpptype - ,amc_TableId_dmmeta_Csize = 17 // dmmeta.Csize -> amc.FCsize - ,amc_TableId_dmmeta_csize = 17 // dmmeta.csize -> amc.FCsize - ,amc_TableId_dmmeta_Cstr = 18 // dmmeta.Cstr -> amc.FCstr - ,amc_TableId_dmmeta_cstr = 18 // dmmeta.cstr -> amc.FCstr - ,amc_TableId_dmmeta_Ctype = 19 // dmmeta.Ctype -> amc.FCtype - ,amc_TableId_dmmeta_ctype = 19 // dmmeta.ctype -> amc.FCtype - ,amc_TableId_dmmeta_Dispatch = 20 // dmmeta.Dispatch -> amc.FDispatch - ,amc_TableId_dmmeta_dispatch = 20 // dmmeta.dispatch -> amc.FDispatch - ,amc_TableId_dmmeta_DispatchMsg = 21 // dmmeta.DispatchMsg -> amc.FDispatchmsg - ,amc_TableId_dmmeta_dispatch_msg = 21 // dmmeta.dispatch_msg -> amc.FDispatchmsg - ,amc_TableId_dmmeta_Dispctx = 22 // dmmeta.Dispctx -> amc.FDispctx - ,amc_TableId_dmmeta_dispctx = 22 // dmmeta.dispctx -> amc.FDispctx - ,amc_TableId_dmmeta_Dispfilter = 23 // dmmeta.Dispfilter -> amc.FDispfilter - ,amc_TableId_dmmeta_dispfilter = 23 // dmmeta.dispfilter -> amc.FDispfilter - ,amc_TableId_dmmeta_Disptrace = 24 // dmmeta.Disptrace -> amc.FDisptrace - ,amc_TableId_dmmeta_disptrace = 24 // dmmeta.disptrace -> amc.FDisptrace - ,amc_TableId_dmmeta_Falias = 25 // dmmeta.Falias -> amc.FFalias - ,amc_TableId_dmmeta_falias = 25 // dmmeta.falias -> amc.FFalias - ,amc_TableId_dmmeta_Fbase = 26 // dmmeta.Fbase -> amc.FFbase - ,amc_TableId_dmmeta_fbase = 26 // dmmeta.fbase -> amc.FFbase - ,amc_TableId_dmmeta_Fbigend = 27 // dmmeta.Fbigend -> amc.FFbigend - ,amc_TableId_dmmeta_fbigend = 27 // dmmeta.fbigend -> amc.FFbigend - ,amc_TableId_dmmeta_Fbitset = 28 // dmmeta.Fbitset -> amc.FFbitset - ,amc_TableId_dmmeta_fbitset = 28 // dmmeta.fbitset -> amc.FFbitset - ,amc_TableId_dmmeta_Fbuf = 29 // dmmeta.Fbuf -> amc.FFbuf - ,amc_TableId_dmmeta_fbuf = 29 // dmmeta.fbuf -> amc.FFbuf - ,amc_TableId_dmmeta_Fbuftype = 30 // dmmeta.Fbuftype -> amc.FFbuftype - ,amc_TableId_dmmeta_fbuftype = 30 // dmmeta.fbuftype -> amc.FFbuftype - ,amc_TableId_dmmeta_Fcast = 31 // dmmeta.Fcast -> amc.FFcast - ,amc_TableId_dmmeta_fcast = 31 // dmmeta.fcast -> amc.FFcast - ,amc_TableId_dmmeta_Fcleanup = 32 // dmmeta.Fcleanup -> amc.FFcleanup - ,amc_TableId_dmmeta_fcleanup = 32 // dmmeta.fcleanup -> amc.FFcleanup - ,amc_TableId_dmmeta_Fcmap = 33 // dmmeta.Fcmap -> amc.FFcmap - ,amc_TableId_dmmeta_fcmap = 33 // dmmeta.fcmap -> amc.FFcmap - ,amc_TableId_dmmeta_Fcmdline = 34 // dmmeta.Fcmdline -> amc.FFcmdline - ,amc_TableId_dmmeta_fcmdline = 34 // dmmeta.fcmdline -> amc.FFcmdline - ,amc_TableId_dmmeta_Fcmp = 35 // dmmeta.Fcmp -> amc.FFcmp - ,amc_TableId_dmmeta_fcmp = 35 // dmmeta.fcmp -> amc.FFcmp - ,amc_TableId_dmmeta_Fcompact = 36 // dmmeta.Fcompact -> amc.FFcompact - ,amc_TableId_dmmeta_fcompact = 36 // dmmeta.fcompact -> amc.FFcompact - ,amc_TableId_dmmeta_Fconst = 37 // dmmeta.Fconst -> amc.FFconst - ,amc_TableId_dmmeta_fconst = 37 // dmmeta.fconst -> amc.FFconst - ,amc_TableId_dmmeta_Fcurs = 38 // dmmeta.Fcurs -> amc.FFcurs - ,amc_TableId_dmmeta_fcurs = 38 // dmmeta.fcurs -> amc.FFcurs - ,amc_TableId_dmmeta_Fdec = 39 // dmmeta.Fdec -> amc.FFdec - ,amc_TableId_dmmeta_fdec = 39 // dmmeta.fdec -> amc.FFdec - ,amc_TableId_dmmeta_Fdelay = 40 // dmmeta.Fdelay -> amc.FFdelay - ,amc_TableId_dmmeta_fdelay = 40 // dmmeta.fdelay -> amc.FFdelay - ,amc_TableId_dmmeta_Ffast = 41 // dmmeta.Ffast -> amc.FFfast - ,amc_TableId_dmmeta_ffast = 41 // dmmeta.ffast -> amc.FFfast - ,amc_TableId_dmmeta_Fflag = 42 // dmmeta.Fflag -> amc.FFflag - ,amc_TableId_dmmeta_fflag = 42 // dmmeta.fflag -> amc.FFflag - ,amc_TableId_dmmeta_Field = 43 // dmmeta.Field -> amc.FField - ,amc_TableId_dmmeta_field = 43 // dmmeta.field -> amc.FField - ,amc_TableId_dmmeta_Findrem = 44 // dmmeta.Findrem -> amc.FFindrem - ,amc_TableId_dmmeta_findrem = 44 // dmmeta.findrem -> amc.FFindrem - ,amc_TableId_dmmeta_Finput = 45 // dmmeta.Finput -> amc.FFinput - ,amc_TableId_dmmeta_finput = 45 // dmmeta.finput -> amc.FFinput - ,amc_TableId_dmmeta_Fldoffset = 46 // dmmeta.Fldoffset -> amc.FFldoffset - ,amc_TableId_dmmeta_fldoffset = 46 // dmmeta.fldoffset -> amc.FFldoffset - ,amc_TableId_dmmeta_Floadtuples = 47 // dmmeta.Floadtuples -> amc.FFloadtuples - ,amc_TableId_dmmeta_floadtuples = 47 // dmmeta.floadtuples -> amc.FFloadtuples - ,amc_TableId_dmmeta_Fnoremove = 48 // dmmeta.Fnoremove -> amc.FFnoremove - ,amc_TableId_dmmeta_fnoremove = 48 // dmmeta.fnoremove -> amc.FFnoremove - ,amc_TableId_dmmeta_Foutput = 49 // dmmeta.Foutput -> amc.FFoutput - ,amc_TableId_dmmeta_foutput = 49 // dmmeta.foutput -> amc.FFoutput - ,amc_TableId_dmmeta_Fprefix = 50 // dmmeta.Fprefix -> amc.FFprefix - ,amc_TableId_dmmeta_fprefix = 50 // dmmeta.fprefix -> amc.FFprefix - ,amc_TableId_dmmeta_Fregx = 51 // dmmeta.Fregx -> amc.FFregx - ,amc_TableId_dmmeta_fregx = 51 // dmmeta.fregx -> amc.FFregx - ,amc_TableId_dmmeta_Fsort = 52 // dmmeta.Fsort -> amc.FFsort - ,amc_TableId_dmmeta_fsort = 52 // dmmeta.fsort -> amc.FFsort - ,amc_TableId_dmmeta_Fstep = 53 // dmmeta.Fstep -> amc.FFstep - ,amc_TableId_dmmeta_fstep = 53 // dmmeta.fstep -> amc.FFstep - ,amc_TableId_dmmeta_Ftrace = 54 // dmmeta.Ftrace -> amc.FFtrace - ,amc_TableId_dmmeta_ftrace = 54 // dmmeta.ftrace -> amc.FFtrace - ,amc_TableId_dmmeta_Func = 55 // dmmeta.Func -> amc.FFunc - ,amc_TableId_dmmeta_func = 55 // dmmeta.func -> amc.FFunc - ,amc_TableId_dmmeta_Funique = 56 // dmmeta.Funique -> amc.FFunique - ,amc_TableId_dmmeta_funique = 56 // dmmeta.funique -> amc.FFunique - ,amc_TableId_dmmeta_Fuserinit = 57 // dmmeta.Fuserinit -> amc.FFuserinit - ,amc_TableId_dmmeta_fuserinit = 57 // dmmeta.fuserinit -> amc.FFuserinit - ,amc_TableId_dmmeta_Fwddecl = 58 // dmmeta.Fwddecl -> amc.FFwddecl - ,amc_TableId_dmmeta_fwddecl = 58 // dmmeta.fwddecl -> amc.FFwddecl - ,amc_TableId_dmmeta_Gconst = 59 // dmmeta.Gconst -> amc.FGconst - ,amc_TableId_dmmeta_gconst = 59 // dmmeta.gconst -> amc.FGconst - ,amc_TableId_dmmeta_Gstatic = 60 // dmmeta.Gstatic -> amc.FGstatic - ,amc_TableId_dmmeta_gstatic = 60 // dmmeta.gstatic -> amc.FGstatic - ,amc_TableId_dmmeta_Gsymbol = 61 // dmmeta.Gsymbol -> amc.FGsymbol - ,amc_TableId_dmmeta_gsymbol = 61 // dmmeta.gsymbol -> amc.FGsymbol - ,amc_TableId_dmmeta_Hook = 62 // dmmeta.Hook -> amc.FHook - ,amc_TableId_dmmeta_hook = 62 // dmmeta.hook -> amc.FHook - ,amc_TableId_dmmeta_Inlary = 63 // dmmeta.Inlary -> amc.FInlary - ,amc_TableId_dmmeta_inlary = 63 // dmmeta.inlary -> amc.FInlary - ,amc_TableId_dmmeta_Lenfld = 64 // dmmeta.Lenfld -> amc.FLenfld - ,amc_TableId_dmmeta_lenfld = 64 // dmmeta.lenfld -> amc.FLenfld - ,amc_TableId_dev_License = 65 // dev.License -> amc.FLicense - ,amc_TableId_dev_license = 65 // dev.license -> amc.FLicense - ,amc_TableId_dmmeta_Listtype = 66 // dmmeta.Listtype -> amc.FListtype - ,amc_TableId_dmmeta_listtype = 66 // dmmeta.listtype -> amc.FListtype - ,amc_TableId_dmmeta_Llist = 67 // dmmeta.Llist -> amc.FLlist - ,amc_TableId_dmmeta_llist = 67 // dmmeta.llist -> amc.FLlist - ,amc_TableId_dmmeta_Main = 68 // dmmeta.Main -> amc.FMain - ,amc_TableId_dmmeta_main = 68 // dmmeta.main -> amc.FMain - ,amc_TableId_dmmeta_Msgtype = 69 // dmmeta.Msgtype -> amc.FMsgtype - ,amc_TableId_dmmeta_msgtype = 69 // dmmeta.msgtype -> amc.FMsgtype - ,amc_TableId_dmmeta_Nocascdel = 70 // dmmeta.Nocascdel -> amc.FNocascdel - ,amc_TableId_dmmeta_nocascdel = 70 // dmmeta.nocascdel -> amc.FNocascdel - ,amc_TableId_dmmeta_Nossimfile = 71 // dmmeta.Nossimfile -> amc.FNossimfile - ,amc_TableId_dmmeta_nossimfile = 71 // dmmeta.nossimfile -> amc.FNossimfile - ,amc_TableId_dmmeta_Noxref = 72 // dmmeta.Noxref -> amc.FNoxref - ,amc_TableId_dmmeta_noxref = 72 // dmmeta.noxref -> amc.FNoxref - ,amc_TableId_dmmeta_Ns = 73 // dmmeta.Ns -> amc.FNs - ,amc_TableId_dmmeta_ns = 73 // dmmeta.ns -> amc.FNs - ,amc_TableId_dmmeta_Nscpp = 74 // dmmeta.Nscpp -> amc.FNscpp - ,amc_TableId_dmmeta_nscpp = 74 // dmmeta.nscpp -> amc.FNscpp - ,amc_TableId_dmmeta_Nsdb = 75 // dmmeta.Nsdb -> amc.FNsdb - ,amc_TableId_dmmeta_nsdb = 75 // dmmeta.nsdb -> amc.FNsdb - ,amc_TableId_dmmeta_Nsinclude = 76 // dmmeta.Nsinclude -> amc.FNsinclude - ,amc_TableId_dmmeta_nsinclude = 76 // dmmeta.nsinclude -> amc.FNsinclude - ,amc_TableId_dmmeta_Nsproto = 77 // dmmeta.Nsproto -> amc.FNsproto - ,amc_TableId_dmmeta_nsproto = 77 // dmmeta.nsproto -> amc.FNsproto - ,amc_TableId_dmmeta_Nsx = 78 // dmmeta.Nsx -> amc.FNsx - ,amc_TableId_dmmeta_nsx = 78 // dmmeta.nsx -> amc.FNsx - ,amc_TableId_dmmeta_Numstr = 79 // dmmeta.Numstr -> amc.FNumstr - ,amc_TableId_dmmeta_numstr = 79 // dmmeta.numstr -> amc.FNumstr - ,amc_TableId_dmmeta_Pack = 80 // dmmeta.Pack -> amc.FPack - ,amc_TableId_dmmeta_pack = 80 // dmmeta.pack -> amc.FPack - ,amc_TableId_dmmeta_Pmaskfld = 81 // dmmeta.Pmaskfld -> amc.FPmaskfld - ,amc_TableId_dmmeta_pmaskfld = 81 // dmmeta.pmaskfld -> amc.FPmaskfld - ,amc_TableId_dmmeta_PmaskfldMember = 82 // dmmeta.PmaskfldMember -> amc.FPmaskfldMember - ,amc_TableId_dmmeta_pmaskfld_member = 82 // dmmeta.pmaskfld_member -> amc.FPmaskfldMember - ,amc_TableId_dmmeta_Pnew = 83 // dmmeta.Pnew -> amc.FPnew - ,amc_TableId_dmmeta_pnew = 83 // dmmeta.pnew -> amc.FPnew - ,amc_TableId_dmmeta_Ptrary = 84 // dmmeta.Ptrary -> amc.FPtrary - ,amc_TableId_dmmeta_ptrary = 84 // dmmeta.ptrary -> amc.FPtrary - ,amc_TableId_dmmeta_Rowid = 85 // dmmeta.Rowid -> amc.FRowid - ,amc_TableId_dmmeta_rowid = 85 // dmmeta.rowid -> amc.FRowid - ,amc_TableId_dmmeta_Smallstr = 86 // dmmeta.Smallstr -> amc.FSmallstr - ,amc_TableId_dmmeta_smallstr = 86 // dmmeta.smallstr -> amc.FSmallstr - ,amc_TableId_dmmeta_Sortfld = 87 // dmmeta.Sortfld -> amc.FSortfld - ,amc_TableId_dmmeta_sortfld = 87 // dmmeta.sortfld -> amc.FSortfld - ,amc_TableId_dmmeta_Ssimfile = 88 // dmmeta.Ssimfile -> amc.FSsimfile - ,amc_TableId_dmmeta_ssimfile = 88 // dmmeta.ssimfile -> amc.FSsimfile - ,amc_TableId_dmmeta_Ssimsort = 89 // dmmeta.Ssimsort -> amc.FSsimsort - ,amc_TableId_dmmeta_ssimsort = 89 // dmmeta.ssimsort -> amc.FSsimsort - ,amc_TableId_dmmeta_Ssimvolatile = 90 // dmmeta.Ssimvolatile -> amc.FSsimvolatile - ,amc_TableId_dmmeta_ssimvolatile = 90 // dmmeta.ssimvolatile -> amc.FSsimvolatile - ,amc_TableId_dmmeta_Substr = 91 // dmmeta.Substr -> amc.FSubstr - ,amc_TableId_dmmeta_substr = 91 // dmmeta.substr -> amc.FSubstr - ,amc_TableId_dev_Targdep = 92 // dev.Targdep -> amc.FTargdep - ,amc_TableId_dev_targdep = 92 // dev.targdep -> amc.FTargdep - ,amc_TableId_dev_Target = 93 // dev.Target -> amc.FTarget - ,amc_TableId_dev_target = 93 // dev.target -> amc.FTarget - ,amc_TableId_dmmeta_Tary = 94 // dmmeta.Tary -> amc.FTary - ,amc_TableId_dmmeta_tary = 94 // dmmeta.tary -> amc.FTary - ,amc_TableId_amcdb_Tcurs = 95 // amcdb.Tcurs -> amc.FTcurs - ,amc_TableId_amcdb_tcurs = 95 // amcdb.tcurs -> amc.FTcurs - ,amc_TableId_dmmeta_Thash = 96 // dmmeta.Thash -> amc.FThash - ,amc_TableId_dmmeta_thash = 96 // dmmeta.thash -> amc.FThash - ,amc_TableId_dmmeta_Typefld = 97 // dmmeta.Typefld -> amc.FTypefld - ,amc_TableId_dmmeta_typefld = 97 // dmmeta.typefld -> amc.FTypefld - ,amc_TableId_dmmeta_Usertracefld = 98 // dmmeta.Usertracefld -> amc.FUsertracefld - ,amc_TableId_dmmeta_usertracefld = 98 // dmmeta.usertracefld -> amc.FUsertracefld - ,amc_TableId_dmmeta_Xref = 99 // dmmeta.Xref -> amc.FXref - ,amc_TableId_dmmeta_xref = 99 // dmmeta.xref -> amc.FXref -}; - -enum { amc_TableIdEnum_N = 200 }; +enum amc_TableIdEnum { // amc.TableId.value + amc_TableId_dmmeta_Anonfld = 0 // dmmeta.Anonfld -> amc.FAnonfld + ,amc_TableId_dmmeta_anonfld = 0 // dmmeta.anonfld -> amc.FAnonfld + ,amc_TableId_dmmeta_Argvtype = 1 // dmmeta.Argvtype -> amc.FArgvtype + ,amc_TableId_dmmeta_argvtype = 1 // dmmeta.argvtype -> amc.FArgvtype + ,amc_TableId_dmmeta_Basepool = 2 // dmmeta.Basepool -> amc.FBasepool + ,amc_TableId_dmmeta_basepool = 2 // dmmeta.basepool -> amc.FBasepool + ,amc_TableId_dmmeta_Bitfld = 3 // dmmeta.Bitfld -> amc.FBitfld + ,amc_TableId_dmmeta_bitfld = 3 // dmmeta.bitfld -> amc.FBitfld + ,amc_TableId_amcdb_Bltin = 4 // amcdb.Bltin -> amc.FBltin + ,amc_TableId_amcdb_bltin = 4 // amcdb.bltin -> amc.FBltin + ,amc_TableId_dmmeta_Cafter = 5 // dmmeta.Cafter -> amc.FCafter + ,amc_TableId_dmmeta_cafter = 5 // dmmeta.cafter -> amc.FCafter + ,amc_TableId_dmmeta_Cascdel = 6 // dmmeta.Cascdel -> amc.FCascdel + ,amc_TableId_dmmeta_cascdel = 6 // dmmeta.cascdel -> amc.FCascdel + ,amc_TableId_dmmeta_Ccmp = 7 // dmmeta.Ccmp -> amc.FCcmp + ,amc_TableId_dmmeta_ccmp = 7 // dmmeta.ccmp -> amc.FCcmp + ,amc_TableId_dmmeta_Cdflt = 8 // dmmeta.Cdflt -> amc.FCdflt + ,amc_TableId_dmmeta_cdflt = 8 // dmmeta.cdflt -> amc.FCdflt + ,amc_TableId_dmmeta_Cextern = 9 // dmmeta.Cextern -> amc.FCextern + ,amc_TableId_dmmeta_cextern = 9 // dmmeta.cextern -> amc.FCextern + ,amc_TableId_dmmeta_Cfast = 10 // dmmeta.Cfast -> amc.FCfast + ,amc_TableId_dmmeta_cfast = 10 // dmmeta.cfast -> amc.FCfast + ,amc_TableId_dmmeta_Cfmt = 11 // dmmeta.Cfmt -> amc.FCfmt + ,amc_TableId_dmmeta_cfmt = 11 // dmmeta.cfmt -> amc.FCfmt + ,amc_TableId_dmmeta_Cget = 12 // dmmeta.Cget -> amc.FCget + ,amc_TableId_dmmeta_cget = 12 // dmmeta.cget -> amc.FCget + ,amc_TableId_dmmeta_Charset = 13 // dmmeta.Charset -> amc.FCharset + ,amc_TableId_dmmeta_charset = 13 // dmmeta.charset -> amc.FCharset + ,amc_TableId_dmmeta_Chash = 14 // dmmeta.Chash -> amc.FChash + ,amc_TableId_dmmeta_chash = 14 // dmmeta.chash -> amc.FChash + ,amc_TableId_dmmeta_Ckafka = 15 // dmmeta.Ckafka -> amc.FCkafka + ,amc_TableId_dmmeta_ckafka = 15 // dmmeta.ckafka -> amc.FCkafka + ,amc_TableId_dmmeta_Cppfunc = 16 // dmmeta.Cppfunc -> amc.FCppfunc + ,amc_TableId_dmmeta_cppfunc = 16 // dmmeta.cppfunc -> amc.FCppfunc + ,amc_TableId_dmmeta_Cpptype = 17 // dmmeta.Cpptype -> amc.FCpptype + ,amc_TableId_dmmeta_cpptype = 17 // dmmeta.cpptype -> amc.FCpptype + ,amc_TableId_dmmeta_Csize = 18 // dmmeta.Csize -> amc.FCsize + ,amc_TableId_dmmeta_csize = 18 // dmmeta.csize -> amc.FCsize + ,amc_TableId_dmmeta_Cstr = 19 // dmmeta.Cstr -> amc.FCstr + ,amc_TableId_dmmeta_cstr = 19 // dmmeta.cstr -> amc.FCstr + ,amc_TableId_dmmeta_Ctype = 20 // dmmeta.Ctype -> amc.FCtype + ,amc_TableId_dmmeta_ctype = 20 // dmmeta.ctype -> amc.FCtype + ,amc_TableId_dmmeta_Dispatch = 21 // dmmeta.Dispatch -> amc.FDispatch + ,amc_TableId_dmmeta_dispatch = 21 // dmmeta.dispatch -> amc.FDispatch + ,amc_TableId_dmmeta_DispatchMsg = 22 // dmmeta.DispatchMsg -> amc.FDispatchmsg + ,amc_TableId_dmmeta_dispatch_msg = 22 // dmmeta.dispatch_msg -> amc.FDispatchmsg + ,amc_TableId_dmmeta_Dispctx = 23 // dmmeta.Dispctx -> amc.FDispctx + ,amc_TableId_dmmeta_dispctx = 23 // dmmeta.dispctx -> amc.FDispctx + ,amc_TableId_dmmeta_Dispfilter = 24 // dmmeta.Dispfilter -> amc.FDispfilter + ,amc_TableId_dmmeta_dispfilter = 24 // dmmeta.dispfilter -> amc.FDispfilter + ,amc_TableId_dmmeta_Disptrace = 25 // dmmeta.Disptrace -> amc.FDisptrace + ,amc_TableId_dmmeta_disptrace = 25 // dmmeta.disptrace -> amc.FDisptrace + ,amc_TableId_dmmeta_Falias = 26 // dmmeta.Falias -> amc.FFalias + ,amc_TableId_dmmeta_falias = 26 // dmmeta.falias -> amc.FFalias + ,amc_TableId_dmmeta_Fbase = 27 // dmmeta.Fbase -> amc.FFbase + ,amc_TableId_dmmeta_fbase = 27 // dmmeta.fbase -> amc.FFbase + ,amc_TableId_dmmeta_Fbigend = 28 // dmmeta.Fbigend -> amc.FFbigend + ,amc_TableId_dmmeta_fbigend = 28 // dmmeta.fbigend -> amc.FFbigend + ,amc_TableId_dmmeta_Fbitset = 29 // dmmeta.Fbitset -> amc.FFbitset + ,amc_TableId_dmmeta_fbitset = 29 // dmmeta.fbitset -> amc.FFbitset + ,amc_TableId_dmmeta_Fbuf = 30 // dmmeta.Fbuf -> amc.FFbuf + ,amc_TableId_dmmeta_fbuf = 30 // dmmeta.fbuf -> amc.FFbuf + ,amc_TableId_dmmeta_Fbuftype = 31 // dmmeta.Fbuftype -> amc.FFbuftype + ,amc_TableId_dmmeta_fbuftype = 31 // dmmeta.fbuftype -> amc.FFbuftype + ,amc_TableId_dmmeta_Fcast = 32 // dmmeta.Fcast -> amc.FFcast + ,amc_TableId_dmmeta_fcast = 32 // dmmeta.fcast -> amc.FFcast + ,amc_TableId_dmmeta_Fcleanup = 33 // dmmeta.Fcleanup -> amc.FFcleanup + ,amc_TableId_dmmeta_fcleanup = 33 // dmmeta.fcleanup -> amc.FFcleanup + ,amc_TableId_dmmeta_Fcmap = 34 // dmmeta.Fcmap -> amc.FFcmap + ,amc_TableId_dmmeta_fcmap = 34 // dmmeta.fcmap -> amc.FFcmap + ,amc_TableId_dmmeta_Fcmdline = 35 // dmmeta.Fcmdline -> amc.FFcmdline + ,amc_TableId_dmmeta_fcmdline = 35 // dmmeta.fcmdline -> amc.FFcmdline + ,amc_TableId_dmmeta_Fcmp = 36 // dmmeta.Fcmp -> amc.FFcmp + ,amc_TableId_dmmeta_fcmp = 36 // dmmeta.fcmp -> amc.FFcmp + ,amc_TableId_dmmeta_Fcompact = 37 // dmmeta.Fcompact -> amc.FFcompact + ,amc_TableId_dmmeta_fcompact = 37 // dmmeta.fcompact -> amc.FFcompact + ,amc_TableId_dmmeta_Fconst = 38 // dmmeta.Fconst -> amc.FFconst + ,amc_TableId_dmmeta_fconst = 38 // dmmeta.fconst -> amc.FFconst + ,amc_TableId_dmmeta_Fcurs = 39 // dmmeta.Fcurs -> amc.FFcurs + ,amc_TableId_dmmeta_fcurs = 39 // dmmeta.fcurs -> amc.FFcurs + ,amc_TableId_dmmeta_Fdec = 40 // dmmeta.Fdec -> amc.FFdec + ,amc_TableId_dmmeta_fdec = 40 // dmmeta.fdec -> amc.FFdec + ,amc_TableId_dmmeta_Fdelay = 41 // dmmeta.Fdelay -> amc.FFdelay + ,amc_TableId_dmmeta_fdelay = 41 // dmmeta.fdelay -> amc.FFdelay + ,amc_TableId_dmmeta_Ffast = 42 // dmmeta.Ffast -> amc.FFfast + ,amc_TableId_dmmeta_ffast = 42 // dmmeta.ffast -> amc.FFfast + ,amc_TableId_dmmeta_Fflag = 43 // dmmeta.Fflag -> amc.FFflag + ,amc_TableId_dmmeta_fflag = 43 // dmmeta.fflag -> amc.FFflag + ,amc_TableId_dmmeta_Field = 44 // dmmeta.Field -> amc.FField + ,amc_TableId_dmmeta_field = 44 // dmmeta.field -> amc.FField + ,amc_TableId_dmmeta_Findrem = 45 // dmmeta.Findrem -> amc.FFindrem + ,amc_TableId_dmmeta_findrem = 45 // dmmeta.findrem -> amc.FFindrem + ,amc_TableId_dmmeta_Finput = 46 // dmmeta.Finput -> amc.FFinput + ,amc_TableId_dmmeta_finput = 46 // dmmeta.finput -> amc.FFinput + ,amc_TableId_dmmeta_Fkafka = 47 // dmmeta.Fkafka -> amc.FFkafka + ,amc_TableId_dmmeta_fkafka = 47 // dmmeta.fkafka -> amc.FFkafka + ,amc_TableId_dmmeta_Fldoffset = 48 // dmmeta.Fldoffset -> amc.FFldoffset + ,amc_TableId_dmmeta_fldoffset = 48 // dmmeta.fldoffset -> amc.FFldoffset + ,amc_TableId_dmmeta_Floadtuples = 49 // dmmeta.Floadtuples -> amc.FFloadtuples + ,amc_TableId_dmmeta_floadtuples = 49 // dmmeta.floadtuples -> amc.FFloadtuples + ,amc_TableId_dmmeta_Fnoremove = 50 // dmmeta.Fnoremove -> amc.FFnoremove + ,amc_TableId_dmmeta_fnoremove = 50 // dmmeta.fnoremove -> amc.FFnoremove + ,amc_TableId_dmmeta_Foutput = 51 // dmmeta.Foutput -> amc.FFoutput + ,amc_TableId_dmmeta_foutput = 51 // dmmeta.foutput -> amc.FFoutput + ,amc_TableId_dmmeta_Fprefix = 52 // dmmeta.Fprefix -> amc.FFprefix + ,amc_TableId_dmmeta_fprefix = 52 // dmmeta.fprefix -> amc.FFprefix + ,amc_TableId_dmmeta_Fregx = 53 // dmmeta.Fregx -> amc.FFregx + ,amc_TableId_dmmeta_fregx = 53 // dmmeta.fregx -> amc.FFregx + ,amc_TableId_dmmeta_Fsort = 54 // dmmeta.Fsort -> amc.FFsort + ,amc_TableId_dmmeta_fsort = 54 // dmmeta.fsort -> amc.FFsort + ,amc_TableId_dmmeta_Fstep = 55 // dmmeta.Fstep -> amc.FFstep + ,amc_TableId_dmmeta_fstep = 55 // dmmeta.fstep -> amc.FFstep + ,amc_TableId_dmmeta_Ftrace = 56 // dmmeta.Ftrace -> amc.FFtrace + ,amc_TableId_dmmeta_ftrace = 56 // dmmeta.ftrace -> amc.FFtrace + ,amc_TableId_dmmeta_Func = 57 // dmmeta.Func -> amc.FFunc + ,amc_TableId_dmmeta_func = 57 // dmmeta.func -> amc.FFunc + ,amc_TableId_dmmeta_Funique = 58 // dmmeta.Funique -> amc.FFunique + ,amc_TableId_dmmeta_funique = 58 // dmmeta.funique -> amc.FFunique + ,amc_TableId_dmmeta_Fuserinit = 59 // dmmeta.Fuserinit -> amc.FFuserinit + ,amc_TableId_dmmeta_fuserinit = 59 // dmmeta.fuserinit -> amc.FFuserinit + ,amc_TableId_dmmeta_Fwddecl = 60 // dmmeta.Fwddecl -> amc.FFwddecl + ,amc_TableId_dmmeta_fwddecl = 60 // dmmeta.fwddecl -> amc.FFwddecl + ,amc_TableId_dmmeta_Gconst = 61 // dmmeta.Gconst -> amc.FGconst + ,amc_TableId_dmmeta_gconst = 61 // dmmeta.gconst -> amc.FGconst + ,amc_TableId_dmmeta_Gstatic = 62 // dmmeta.Gstatic -> amc.FGstatic + ,amc_TableId_dmmeta_gstatic = 62 // dmmeta.gstatic -> amc.FGstatic + ,amc_TableId_dmmeta_Gsymbol = 63 // dmmeta.Gsymbol -> amc.FGsymbol + ,amc_TableId_dmmeta_gsymbol = 63 // dmmeta.gsymbol -> amc.FGsymbol + ,amc_TableId_dmmeta_Hook = 64 // dmmeta.Hook -> amc.FHook + ,amc_TableId_dmmeta_hook = 64 // dmmeta.hook -> amc.FHook + ,amc_TableId_dmmeta_Inlary = 65 // dmmeta.Inlary -> amc.FInlary + ,amc_TableId_dmmeta_inlary = 65 // dmmeta.inlary -> amc.FInlary + ,amc_TableId_dmmeta_Jstype = 66 // dmmeta.Jstype -> amc.FJstype + ,amc_TableId_dmmeta_jstype = 66 // dmmeta.jstype -> amc.FJstype + ,amc_TableId_dmmeta_Lenfld = 67 // dmmeta.Lenfld -> amc.FLenfld + ,amc_TableId_dmmeta_lenfld = 67 // dmmeta.lenfld -> amc.FLenfld + ,amc_TableId_dev_License = 68 // dev.License -> amc.FLicense + ,amc_TableId_dev_license = 68 // dev.license -> amc.FLicense + ,amc_TableId_dmmeta_Listtype = 69 // dmmeta.Listtype -> amc.FListtype + ,amc_TableId_dmmeta_listtype = 69 // dmmeta.listtype -> amc.FListtype + ,amc_TableId_dmmeta_Llist = 70 // dmmeta.Llist -> amc.FLlist + ,amc_TableId_dmmeta_llist = 70 // dmmeta.llist -> amc.FLlist + ,amc_TableId_dmmeta_Main = 71 // dmmeta.Main -> amc.FMain + ,amc_TableId_dmmeta_main = 71 // dmmeta.main -> amc.FMain + ,amc_TableId_dmmeta_Msgtype = 72 // dmmeta.Msgtype -> amc.FMsgtype + ,amc_TableId_dmmeta_msgtype = 72 // dmmeta.msgtype -> amc.FMsgtype + ,amc_TableId_dmmeta_Nocascdel = 73 // dmmeta.Nocascdel -> amc.FNocascdel + ,amc_TableId_dmmeta_nocascdel = 73 // dmmeta.nocascdel -> amc.FNocascdel + ,amc_TableId_dmmeta_Nossimfile = 74 // dmmeta.Nossimfile -> amc.FNossimfile + ,amc_TableId_dmmeta_nossimfile = 74 // dmmeta.nossimfile -> amc.FNossimfile + ,amc_TableId_dmmeta_Noxref = 75 // dmmeta.Noxref -> amc.FNoxref + ,amc_TableId_dmmeta_noxref = 75 // dmmeta.noxref -> amc.FNoxref + ,amc_TableId_dmmeta_Ns = 76 // dmmeta.Ns -> amc.FNs + ,amc_TableId_dmmeta_ns = 76 // dmmeta.ns -> amc.FNs + ,amc_TableId_dmmeta_Nscpp = 77 // dmmeta.Nscpp -> amc.FNscpp + ,amc_TableId_dmmeta_nscpp = 77 // dmmeta.nscpp -> amc.FNscpp + ,amc_TableId_dmmeta_Nsdb = 78 // dmmeta.Nsdb -> amc.FNsdb + ,amc_TableId_dmmeta_nsdb = 78 // dmmeta.nsdb -> amc.FNsdb + ,amc_TableId_dmmeta_Nsinclude = 79 // dmmeta.Nsinclude -> amc.FNsinclude + ,amc_TableId_dmmeta_nsinclude = 79 // dmmeta.nsinclude -> amc.FNsinclude + ,amc_TableId_dmmeta_Nsjs = 80 // dmmeta.Nsjs -> amc.FNsjs + ,amc_TableId_dmmeta_nsjs = 80 // dmmeta.nsjs -> amc.FNsjs + ,amc_TableId_dmmeta_Nsproto = 81 // dmmeta.Nsproto -> amc.FNsproto + ,amc_TableId_dmmeta_nsproto = 81 // dmmeta.nsproto -> amc.FNsproto + ,amc_TableId_dmmeta_Nsx = 82 // dmmeta.Nsx -> amc.FNsx + ,amc_TableId_dmmeta_nsx = 82 // dmmeta.nsx -> amc.FNsx + ,amc_TableId_dmmeta_Numstr = 83 // dmmeta.Numstr -> amc.FNumstr + ,amc_TableId_dmmeta_numstr = 83 // dmmeta.numstr -> amc.FNumstr + ,amc_TableId_dmmeta_Pack = 84 // dmmeta.Pack -> amc.FPack + ,amc_TableId_dmmeta_pack = 84 // dmmeta.pack -> amc.FPack + ,amc_TableId_dmmeta_Pmaskfld = 85 // dmmeta.Pmaskfld -> amc.FPmaskfld + ,amc_TableId_dmmeta_pmaskfld = 85 // dmmeta.pmaskfld -> amc.FPmaskfld + ,amc_TableId_dmmeta_PmaskfldMember = 86 // dmmeta.PmaskfldMember -> amc.FPmaskfldMember + ,amc_TableId_dmmeta_pmaskfld_member = 86 // dmmeta.pmaskfld_member -> amc.FPmaskfldMember + ,amc_TableId_dmmeta_Pnew = 87 // dmmeta.Pnew -> amc.FPnew + ,amc_TableId_dmmeta_pnew = 87 // dmmeta.pnew -> amc.FPnew + ,amc_TableId_dmmeta_Ptrary = 88 // dmmeta.Ptrary -> amc.FPtrary + ,amc_TableId_dmmeta_ptrary = 88 // dmmeta.ptrary -> amc.FPtrary + ,amc_TableId_dmmeta_Rowid = 89 // dmmeta.Rowid -> amc.FRowid + ,amc_TableId_dmmeta_rowid = 89 // dmmeta.rowid -> amc.FRowid + ,amc_TableId_dmmeta_Smallstr = 90 // dmmeta.Smallstr -> amc.FSmallstr + ,amc_TableId_dmmeta_smallstr = 90 // dmmeta.smallstr -> amc.FSmallstr + ,amc_TableId_dmmeta_Sortfld = 91 // dmmeta.Sortfld -> amc.FSortfld + ,amc_TableId_dmmeta_sortfld = 91 // dmmeta.sortfld -> amc.FSortfld + ,amc_TableId_dmmeta_Ssimfile = 92 // dmmeta.Ssimfile -> amc.FSsimfile + ,amc_TableId_dmmeta_ssimfile = 92 // dmmeta.ssimfile -> amc.FSsimfile + ,amc_TableId_dmmeta_Ssimsort = 93 // dmmeta.Ssimsort -> amc.FSsimsort + ,amc_TableId_dmmeta_ssimsort = 93 // dmmeta.ssimsort -> amc.FSsimsort + ,amc_TableId_dmmeta_Ssimvolatile = 94 // dmmeta.Ssimvolatile -> amc.FSsimvolatile + ,amc_TableId_dmmeta_ssimvolatile = 94 // dmmeta.ssimvolatile -> amc.FSsimvolatile + ,amc_TableId_dmmeta_Steptype = 95 // dmmeta.Steptype -> amc.FSteptype + ,amc_TableId_dmmeta_steptype = 95 // dmmeta.steptype -> amc.FSteptype + ,amc_TableId_dmmeta_Substr = 96 // dmmeta.Substr -> amc.FSubstr + ,amc_TableId_dmmeta_substr = 96 // dmmeta.substr -> amc.FSubstr + ,amc_TableId_dev_Targdep = 97 // dev.Targdep -> amc.FTargdep + ,amc_TableId_dev_targdep = 97 // dev.targdep -> amc.FTargdep + ,amc_TableId_dev_Target = 98 // dev.Target -> amc.FTarget + ,amc_TableId_dev_target = 98 // dev.target -> amc.FTarget + ,amc_TableId_dmmeta_Tary = 99 // dmmeta.Tary -> amc.FTary + ,amc_TableId_dmmeta_tary = 99 // dmmeta.tary -> amc.FTary + ,amc_TableId_amcdb_Tcurs = 100 // amcdb.Tcurs -> amc.FTcurs + ,amc_TableId_amcdb_tcurs = 100 // amcdb.tcurs -> amc.FTcurs + ,amc_TableId_dmmeta_Thash = 101 // dmmeta.Thash -> amc.FThash + ,amc_TableId_dmmeta_thash = 101 // dmmeta.thash -> amc.FThash + ,amc_TableId_dmmeta_Typefld = 102 // dmmeta.Typefld -> amc.FTypefld + ,amc_TableId_dmmeta_typefld = 102 // dmmeta.typefld -> amc.FTypefld + ,amc_TableId_dmmeta_Usertracefld = 103 // dmmeta.Usertracefld -> amc.FUsertracefld + ,amc_TableId_dmmeta_usertracefld = 103 // dmmeta.usertracefld -> amc.FUsertracefld + ,amc_TableId_dmmeta_Xref = 104 // dmmeta.Xref -> amc.FXref + ,amc_TableId_dmmeta_xref = 104 // dmmeta.xref -> amc.FXref +}; + +enum { amc_TableIdEnum_N = 210 }; namespace amc { // gen:ns_pkeytypedef } // gen:ns_pkeytypedef @@ -405,6 +415,7 @@ namespace dmmeta { struct Cfmt; } namespace dmmeta { struct Cget; } namespace dmmeta { struct Charset; } namespace dmmeta { struct Chash; } +namespace dmmeta { struct Ckafka; } namespace dmmeta { struct Cppfunc; } namespace dmmeta { struct Cpptype; } namespace dmmeta { struct Csize; } @@ -442,6 +453,7 @@ namespace dmmeta { struct Field; } namespace amc { struct FReftype; } namespace dmmeta { struct Findrem; } namespace dmmeta { struct Finput; } +namespace dmmeta { struct Fkafka; } namespace dmmeta { struct Fldoffset; } namespace dmmeta { struct Floadtuples; } namespace dmmeta { struct Fnoremove; } @@ -450,6 +462,7 @@ namespace dmmeta { struct Fprefix; } namespace dmmeta { struct Fregx; } namespace dmmeta { struct Fsort; } namespace dmmeta { struct Fstep; } +namespace amc { struct FSteptype; } namespace dmmeta { struct Ftrace; } namespace dmmeta { struct Func; } namespace dmmeta { struct Funique; } @@ -462,6 +475,7 @@ namespace dmmeta { struct Gsymbol; } namespace amc { struct FSsimfile; } namespace dmmeta { struct Hook; } namespace dmmeta { struct Inlary; } +namespace dmmeta { struct Jstype; } namespace dmmeta { struct Lenfld; } namespace dev { struct License; } namespace dmmeta { struct Listtype; } @@ -477,6 +491,7 @@ namespace amc { struct FLicense; } namespace dmmeta { struct Nscpp; } namespace dmmeta { struct Nsdb; } namespace dmmeta { struct Nsinclude; } +namespace dmmeta { struct Nsjs; } namespace dmmeta { struct Nsproto; } namespace dmmeta { struct Nsx; } namespace dmmeta { struct Numstr; } @@ -494,6 +509,7 @@ namespace dmmeta { struct Sortfld; } namespace dmmeta { struct Ssimfile; } namespace dmmeta { struct Ssimsort; } namespace dmmeta { struct Ssimvolatile; } +namespace dmmeta { struct Steptype; } namespace dmmeta { struct Substr; } namespace dev { struct Targdep; } namespace amc { struct FTarget; } @@ -506,6 +522,7 @@ namespace dmmeta { struct Thash; } namespace dmmeta { struct Tracefld; } namespace dmmeta { struct Tracerec; } namespace dmmeta { struct Typefld; } +namespace dmmeta { struct Userfunc; } namespace dmmeta { struct Usertracefld; } namespace dmmeta { struct Xref; } namespace amc { struct FTfunc; } @@ -523,6 +540,7 @@ namespace amc { struct ctype_zd_cafter_curs; } namespace amc { struct ctype_zd_access_curs; } namespace amc { struct ctype_c_fcurs_curs; } namespace amc { struct ctype_c_ffast_curs; } +namespace amc { struct ctype_zd_varlenfld_curs; } namespace amc { struct tclass_c_tfunc_curs; } namespace amc { struct _db_fsort_curs; } namespace amc { struct _db_dispfilter_curs; } @@ -588,7 +606,6 @@ namespace amc { struct _db_disptrace_curs; } namespace amc { struct _db_tracefld_curs; } namespace amc { struct _db_tracerec_curs; } namespace amc { struct _db_dispsig_curs; } -namespace amc { struct _db_c_dispsig_sorted_curs; } namespace amc { struct _db_zs_sig_visit_curs; } namespace amc { struct _db_target_curs; } namespace amc { struct _db_targdep_curs; } @@ -623,8 +640,6 @@ namespace amc { struct _db_ftrace_curs; } namespace amc { struct _db_fnoremove_curs; } namespace amc { struct _db_c_substr_field_curs; } namespace amc { struct _db_ctypelen_curs; } -namespace amc { struct _db_c_ctypelen_curs; } -namespace amc { struct _db_c_tempfield_curs; } namespace amc { struct _db_fbase_curs; } namespace amc { struct _db_nossimfile_curs; } namespace amc { struct _db_gsymbol_curs; } @@ -650,6 +665,12 @@ namespace amc { struct _db_ffast_curs; } namespace amc { struct _db_pmaskfld_member_curs; } namespace amc { struct _db_ssimsort_curs; } namespace amc { struct _db_fbuftype_curs; } +namespace amc { struct _db_nsjs_curs; } +namespace amc { struct _db_jstype_curs; } +namespace amc { struct _db_ckafka_curs; } +namespace amc { struct _db_fkafka_curs; } +namespace amc { struct _db_userfunc_curs; } +namespace amc { struct _db_steptype_curs; } namespace amc { struct dispatch_c_dispatch_msg_curs; } namespace amc { struct enumstr_c_fconst_curs; } namespace amc { struct enumstr_len_bh_enumstr_curs; } @@ -699,10 +720,12 @@ namespace amc { struct FCfmt; } namespace amc { struct FCget; } namespace amc { struct FCharset; } namespace amc { struct FChash; } +namespace amc { struct FCkafka; } namespace amc { struct FCppfunc; } namespace amc { struct FCpptype; } namespace amc { struct FCsize; } namespace amc { struct FCstr; } +namespace amc { struct JsCtype; } namespace amc { struct FCtypelen; } namespace amc { struct Genctx; } namespace amc { struct trace; } @@ -733,6 +756,7 @@ namespace amc { struct FFfast; } namespace amc { struct FFflag; } namespace amc { struct FFindrem; } namespace amc { struct FFinput; } +namespace amc { struct FFkafka; } namespace amc { struct FFldoffset; } namespace amc { struct FFloadtuples; } namespace amc { struct FFnoremove; } @@ -753,6 +777,7 @@ namespace amc { struct FGstatic; } namespace amc { struct FGsymbol; } namespace amc { struct FHook; } namespace amc { struct FInlary; } +namespace amc { struct FJstype; } namespace amc { struct FLenfld; } namespace amc { struct FLlist; } namespace amc { struct FMain; } @@ -760,9 +785,11 @@ namespace amc { struct FMsgtype; } namespace amc { struct FNocascdel; } namespace amc { struct FNossimfile; } namespace amc { struct FNoxref; } +namespace amc { struct JsNs; } namespace amc { struct FNscpp; } namespace amc { struct FNsdb; } namespace amc { struct FNsinclude; } +namespace amc { struct FNsjs; } namespace amc { struct FNsproto; } namespace amc { struct FNsx; } namespace amc { struct FNumstr; } @@ -785,6 +812,7 @@ namespace amc { struct FThash; } namespace amc { struct FTracefld; } namespace amc { struct FTracerec; } namespace amc { struct FTypefld; } +namespace amc { struct FUserfunc; } namespace amc { struct FUsertracefld; } namespace amc { struct FXref; } namespace amc { struct FieldId; } @@ -807,6 +835,19 @@ namespace amc { // gen:ns_gsymbol namespace amc { // gen:ns_gsymbol extern const algo::strptr dev_gitfile_conf_copyright_txt; // "conf/copyright.txt" } // gen:ns_gsymbol +namespace amc { // gen:ns_gsymbol + extern const char* dmmeta_fbufiotype_nofd; // "nofd" + extern const char* dmmeta_fbufiotype_openssl; // "openssl" + extern const char* dmmeta_fbufiotype_standard; // "standard" +} // gen:ns_gsymbol +namespace amc { // gen:ns_gsymbol + extern const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_common; // "common" + extern const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_data; // "data" + extern const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_field; // "field" + extern const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_header; // "header" + extern const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_request; // "request" + extern const dmmeta::KafkaTypeKindPkey dmmeta_kafka_type_kind_response; // "response" +} // gen:ns_gsymbol namespace amc { // gen:ns_print_struct // --- amc.BltinId @@ -1064,13 +1105,13 @@ void FBasepool_Uninit(amc::FBasepool& basepool) __attribute__((n // access: amc.FField.c_bitfld (Ptr) // access: amc.FField.bh_bitfld (Bheap) struct FBitfld { // amc.FBitfld - algo::Smallstr100 field; // - i32 offset; // 0 Offset, in bits, within parent field - i32 width; // 0 Width, in bits, within parent field. - algo::Smallstr100 srcfield; // - amc::FField* p_srcfield; // reference to parent row - amc::FField* p_field; // reference to parent row - i32 bh_bitfld_idx; // index in heap; -1 means not-in-heap + algo::Smallstr100 field; // + i32 offset; // 0 Offset, in bits, within parent field + i32 width; // 0 Width, in bits, within parent field. + algo::Smallstr100 srcfield; // + amc::FField* p_srcfield; // reference to parent row + amc::FField* p_field; // reference to parent row + i32 field_bh_bitfld_idx; // index in heap; -1 means not-in-heap // x-reference on amc.FBitfld.p_srcfield prevents copy // x-reference on amc.FBitfld.p_field prevents copy // func:amc.FBitfld..AssignOp @@ -1111,11 +1152,12 @@ void FBitfld_Uninit(amc::FBitfld& bitfld) __attribute__((nothrow // global access: ind_bltin (Thash, hash field ctype) // access: amc.FCtype.c_bltin (Ptr) struct FBltin { // amc.FBltin - algo::Smallstr100 ctype; // - bool likeu64; // false - bool bigendok; // false - bool issigned; // false - amc::FBltin* ind_bltin_next; // hash next + algo::Smallstr100 ctype; // + bool likeu64; // false + bool bigendok; // false + bool issigned; // false + amc::FBltin* ind_bltin_next; // hash next + u32 ind_bltin_hashval; // hash value // func:amc.FBltin..AssignOp inline amc::FBltin& operator =(const amc::FBltin &rhs) = delete; // func:amc.FBltin..CopyCtor @@ -1148,10 +1190,10 @@ void FBltin_Uninit(amc::FBltin& bltin) __attribute__((nothrow)); // global access: cafter (Lary, by rowid) // access: amc.FCtype.zd_cafter (Llist) struct FCafter { // amc.FCafter - algo::Smallstr50 cafter; // - amc::FCtype* p_after; // reference to parent row - amc::FCafter* zd_cafter_next; // zslist link; -1 means not-in-list - amc::FCafter* zd_cafter_prev; // previous element + algo::Smallstr50 cafter; // + amc::FCtype* p_after; // reference to parent row + amc::FCafter* ctype_zd_cafter_next; // zslist link; -1 means not-in-list + amc::FCafter* ctype_zd_cafter_prev; // previous element // x-reference on amc.FCafter.p_after prevents copy // func:amc.FCafter..AssignOp inline amc::FCafter& operator =(const amc::FCafter &rhs) = delete; @@ -1229,12 +1271,13 @@ void FCascdel_Uninit(amc::FCascdel& cascdel) __attribute__((noth // global access: ind_ccmp (Thash, hash field ctype) // access: amc.FCtype.c_ccmp (Ptr) struct FCcmp { // amc.FCcmp - algo::Smallstr100 ctype; // Target ctype - bool extrn; // false Whether implementation is external - bool genop; // false Generate C++ comparison operators (<,>, etc) - bool order; // false - bool minmax; // false - amc::FCcmp* ind_ccmp_next; // hash next + algo::Smallstr100 ctype; // Target ctype + bool extrn; // false Whether implementation is external + bool genop; // false Generate C++ comparison operators (<,>, etc) + bool order; // false + bool minmax; // false + amc::FCcmp* ind_ccmp_next; // hash next + u32 ind_ccmp_hashval; // hash value // func:amc.FCcmp..AssignOp inline amc::FCcmp& operator =(const amc::FCcmp &rhs) = delete; // func:amc.FCcmp..CopyCtor @@ -1377,14 +1420,15 @@ void FCfast_Uninit(amc::FCfast& cfast) __attribute__((nothrow)); // global access: cfmt (Lary, by rowid) // access: amc.FCtype.zs_cfmt (Llist) struct FCfmt { // amc.FCfmt - algo::Smallstr100 cfmt; // - algo::Smallstr50 printfmt; // - bool read; // false - bool print; // false - algo::Smallstr20 sep; // - bool genop; // false - amc::FCfmt* zs_cfmt_next; // zslist link; -1 means not-in-list - amc::FCfmt* ind_cfmt_next; // hash next + algo::Smallstr100 cfmt; // + algo::Smallstr50 printfmt; // + bool read; // false + bool print; // false + algo::Smallstr20 sep; // + bool genop; // false + amc::FCfmt* ctype_zs_cfmt_next; // zslist link; -1 means not-in-list + amc::FCfmt* ind_cfmt_next; // hash next + u32 ind_cfmt_hashval; // hash value // func:amc.FCfmt..AssignOp inline amc::FCfmt& operator =(const amc::FCfmt &rhs) = delete; // func:amc.FCfmt..CopyCtor @@ -1489,9 +1533,10 @@ void FCharset_Uninit(amc::FCharset& charset) __attribute__((noth // global access: ind_chash (Thash, hash field ctype) // access: amc.FCtype.c_chash (Ptr) struct FChash { // amc.FChash - algo::Smallstr100 ctype; // Target ctype - algo::Smallstr50 hashtype; // Hash type - amc::FChash* ind_chash_next; // hash next + algo::Smallstr100 ctype; // Target ctype + algo::Smallstr50 hashtype; // Hash type + amc::FChash* ind_chash_next; // hash next + u32 ind_chash_hashval; // hash value // func:amc.FChash..AssignOp inline amc::FChash& operator =(const amc::FChash &rhs) = delete; // func:amc.FChash..CopyCtor @@ -1519,6 +1564,42 @@ inline void FChash_Init(amc::FChash& chash); // func:amc.FChash..Uninit void FChash_Uninit(amc::FChash& chash) __attribute__((nothrow)); +// --- amc.FCkafka +// create: amc.FDb.ckafka (Lary) +// global access: ckafka (Lary, by rowid) +// access: amc.FCtype.c_ckafka (Ptr) +struct FCkafka { // amc.FCkafka + algo::Smallstr100 ctype; // + algo::Smallstr50 kind; // + algo::cstring root; // + algo::Smallstr10 valid_versions; // + algo::Smallstr10 flexible_versions; // + algo::Comment comment; // + // func:amc.FCkafka..AssignOp + inline amc::FCkafka& operator =(const amc::FCkafka &rhs) = delete; + // func:amc.FCkafka..CopyCtor + inline FCkafka(const amc::FCkafka &rhs) = delete; +private: + // func:amc.FCkafka..Ctor + inline FCkafka() __attribute__((nothrow)); + // func:amc.FCkafka..Dtor + inline ~FCkafka() __attribute__((nothrow)); + friend amc::FCkafka& ckafka_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FCkafka* ckafka_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void ckafka_RemoveAll() __attribute__((nothrow)); + friend void ckafka_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:amc.FCkafka.base.CopyOut +void ckafka_CopyOut(amc::FCkafka &row, dmmeta::Ckafka &out) __attribute__((nothrow)); +// Copy fields in to row +// func:amc.FCkafka.base.CopyIn +void ckafka_CopyIn(amc::FCkafka &row, dmmeta::Ckafka &in) __attribute__((nothrow)); + +// func:amc.FCkafka..Uninit +void FCkafka_Uninit(amc::FCkafka& ckafka) __attribute__((nothrow)); + // --- amc.FCppfunc // create: amc.FDb.cppfunc (Lary) // global access: cppfunc (Lary, by rowid) @@ -1561,12 +1642,13 @@ void FCppfunc_Uninit(amc::FCppfunc& cppfunc) __attribute__((noth // global access: ind_cpptype (Thash, hash field ctype) // access: amc.FCtype.c_cpptype (Ptr) struct FCpptype { // amc.FCpptype - algo::Smallstr100 ctype; // - bool ctor; // false if true, generate non-default constructor from all fields - bool dtor; // true generate non-default destructor - bool cheap_copy; // false Pass by value whenever possible - amc::FCtype* p_ctype; // reference to parent row - amc::FCpptype* ind_cpptype_next; // hash next + algo::Smallstr100 ctype; // + bool ctor; // false if true, generate non-default constructor from all fields + bool dtor; // true generate non-default destructor + bool cheap_copy; // false Pass by value whenever possible + amc::FCtype* p_ctype; // reference to parent row + amc::FCpptype* ind_cpptype_next; // hash next + u32 ind_cpptype_hashval; // hash value // x-reference on amc.FCpptype.p_ctype prevents copy // func:amc.FCpptype..AssignOp inline amc::FCpptype& operator =(const amc::FCpptype &rhs) = delete; @@ -1665,6 +1747,17 @@ inline void FCstr_Init(amc::FCstr& cstr); // func:amc.FCstr..Uninit void FCstr_Uninit(amc::FCstr& cstr) __attribute__((nothrow)); +// --- amc.JsCtype +struct JsCtype { // amc.JsCtype + algo::cstring body; // + algo::cstring ctor; // + algo::cstring args; // + algo::cstring funcs; // + // func:amc.JsCtype..Ctor + inline JsCtype() __attribute__((nothrow)); +}; + + // --- amc.FCtype // create: amc.FDb.ctype (Lary) // global access: ctype (Lary, by rowid) @@ -1710,7 +1803,6 @@ struct FCtype { // amc.FCtype u32 c_field_n; // array of pointers u32 c_field_max; // capacity of allocated array amc::FMsgtype* c_msgtype; // optional pointer - amc::FField* c_varlenfld; // optional pointer amc::FField* c_optfld; // optional pointer amc::FStatictuple** c_static_elems; // array of pointers u32 c_static_n; // array of pointers @@ -1757,16 +1849,13 @@ struct FCtype { // amc.FCtype amc::FFcurs** c_fcurs_elems; // array of pointers u32 c_fcurs_n; // array of pointers u32 c_fcurs_max; // capacity of allocated array - algo::cstring copy_priv_reason; // amc::FCtypelen* c_ctypelen; // optional pointer bool size_unknown; // false - bool copy_priv_valid; // false bool size_locked; // false bool topo_visited; // false Temporary bool enum_visited; // false Temporary bool fields_cloned; // false True if fields from c_cbase have been cloned. bool original; // false True if this ctype comes from disk - bool copy_priv; // false disallow copy ctor / assign op bool plaindata; // false u32 alignment; // 1 i32 n_padbytes; // 0 @@ -1780,8 +1869,15 @@ struct FCtype { // amc.FCtype u32 c_ffast_n; // array of pointers u32 c_ffast_max; // capacity of allocated array bool in_copy_priv; // false + amc::FField* zd_varlenfld_head; // zero-terminated doubly linked list + i32 zd_varlenfld_n; // zero-terminated doubly linked list + amc::FField* zd_varlenfld_tail; // pointer to last element + amc::JsCtype js; // + amc::FJstype* c_jstype; // optional pointer + amc::FCkafka* c_ckafka; // optional pointer bool ns_c_ctype_in_ary; // false membership flag amc::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value amc::FCtype* zsl_ctype_pack_tran_next; // zslist link; -1 means not-in-list amc::FCtype* zs_sig_visit_next; // zslist link; -1 means not-in-list // reftype Llist of amc.FCtype.zs_cfmt prohibits copy @@ -1789,7 +1885,6 @@ struct FCtype { // amc.FCtype // x-reference on amc.FCtype.c_bltin prevents copy // reftype Ptrary of amc.FCtype.c_field prohibits copy // x-reference on amc.FCtype.c_msgtype prevents copy - // x-reference on amc.FCtype.c_varlenfld prevents copy // x-reference on amc.FCtype.c_optfld prevents copy // reftype Ptrary of amc.FCtype.c_static prohibits copy // x-reference on amc.FCtype.c_cpptype prevents copy @@ -1818,6 +1913,9 @@ struct FCtype { // amc.FCtype // x-reference on amc.FCtype.c_nossimfile prevents copy // x-reference on amc.FCtype.c_cfast prevents copy // reftype Ptrary of amc.FCtype.c_ffast prohibits copy + // reftype Llist of amc.FCtype.zd_varlenfld prohibits copy + // x-reference on amc.FCtype.c_jstype prevents copy + // x-reference on amc.FCtype.c_ckafka prevents copy // func:amc.FCtype..AssignOp amc::FCtype& operator =(const amc::FCtype &rhs) = delete; // reftype Llist of amc.FCtype.zs_cfmt prohibits copy @@ -1825,7 +1923,6 @@ struct FCtype { // amc.FCtype // x-reference on amc.FCtype.c_bltin prevents copy // reftype Ptrary of amc.FCtype.c_field prohibits copy // x-reference on amc.FCtype.c_msgtype prevents copy - // x-reference on amc.FCtype.c_varlenfld prevents copy // x-reference on amc.FCtype.c_optfld prevents copy // reftype Ptrary of amc.FCtype.c_static prohibits copy // x-reference on amc.FCtype.c_cpptype prevents copy @@ -1854,6 +1951,9 @@ struct FCtype { // amc.FCtype // x-reference on amc.FCtype.c_nossimfile prevents copy // x-reference on amc.FCtype.c_cfast prevents copy // reftype Ptrary of amc.FCtype.c_ffast prohibits copy + // reftype Llist of amc.FCtype.zd_varlenfld prohibits copy + // x-reference on amc.FCtype.c_jstype prevents copy + // x-reference on amc.FCtype.c_ckafka prevents copy // func:amc.FCtype..CopyCtor FCtype(const amc::FCtype &rhs) = delete; private: @@ -1887,7 +1987,7 @@ inline bool zs_cfmt_EmptyQ(amc::FCtype& ctype) __attribute__((__warn_un inline amc::FCfmt* zs_cfmt_First(amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc.FCtype.zs_cfmt.InLlistQ -inline bool zs_cfmt_InLlistQ(amc::FCfmt& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool ctype_zs_cfmt_InLlistQ(amc::FCfmt& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc.FCtype.zs_cfmt.Insert void zs_cfmt_Insert(amc::FCtype& ctype, amc::FCfmt& row) __attribute__((nothrow)); @@ -1896,7 +1996,7 @@ void zs_cfmt_Insert(amc::FCtype& ctype, amc::FCfmt& row) __attri inline amc::FCfmt* zs_cfmt_Last(amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc.FCtype.zs_cfmt.Next -inline amc::FCfmt* zs_cfmt_Next(amc::FCfmt &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FCfmt* ctype_zs_cfmt_Next(amc::FCfmt &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. // func:amc.FCtype.zs_cfmt.Remove @@ -1975,13 +2075,6 @@ inline bool c_msgtype_InsertMaybe(amc::FCtype& ctype, amc::FMsgtype& ro // func:amc.FCtype.c_msgtype.Remove inline void c_msgtype_Remove(amc::FCtype& ctype, amc::FMsgtype& row) __attribute__((nothrow)); -// Insert row into pointer index. Return final membership status. -// func:amc.FCtype.c_varlenfld.InsertMaybe -inline bool c_varlenfld_InsertMaybe(amc::FCtype& ctype, amc::FField& row) __attribute__((nothrow)); -// Remove element from index. If element is not in index, do nothing. -// func:amc.FCtype.c_varlenfld.Remove -inline void c_varlenfld_Remove(amc::FCtype& ctype, amc::FField& row) __attribute__((nothrow)); - // Insert row into pointer index. Return final membership status. // func:amc.FCtype.c_optfld.InsertMaybe inline bool c_optfld_InsertMaybe(amc::FCtype& ctype, amc::FField& row) __attribute__((nothrow)); @@ -2190,7 +2283,7 @@ inline bool zd_inst_EmptyQ(amc::FCtype& ctype) __attribute__((__warn_un inline amc::FField* zd_inst_First(amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc.FCtype.zd_inst.InLlistQ -inline bool zd_inst_InLlistQ(amc::FField& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool ctype_zd_inst_InLlistQ(amc::FField& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc.FCtype.zd_inst.Insert void zd_inst_Insert(amc::FCtype& ctype, amc::FField& row) __attribute__((nothrow)); @@ -2202,10 +2295,10 @@ inline amc::FField* zd_inst_Last(amc::FCtype& ctype) __attribute__((__warn_unus inline i32 zd_inst_N(const amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc.FCtype.zd_inst.Next -inline amc::FField* zd_inst_Next(amc::FField &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FField* ctype_zd_inst_Next(amc::FField &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:amc.FCtype.zd_inst.Prev -inline amc::FField* zd_inst_Prev(amc::FField &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FField* ctype_zd_inst_Prev(amc::FField &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:amc.FCtype.zd_inst.Remove void zd_inst_Remove(amc::FCtype& ctype, amc::FField& row) __attribute__((nothrow)); @@ -2227,7 +2320,7 @@ inline bool zs_xref_EmptyQ(amc::FCtype& ctype) __attribute__((__warn_un inline amc::FXref* zs_xref_First(amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc.FCtype.zs_xref.InLlistQ -inline bool zs_xref_InLlistQ(amc::FXref& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool ctype_zs_xref_InLlistQ(amc::FXref& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc.FCtype.zs_xref.Insert void zs_xref_Insert(amc::FCtype& ctype, amc::FXref& row) __attribute__((nothrow)); @@ -2239,7 +2332,7 @@ inline amc::FXref* zs_xref_Last(amc::FCtype& ctype) __attribute__((__warn_unus inline i32 zs_xref_N(const amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc.FCtype.zs_xref.Next -inline amc::FXref* zs_xref_Next(amc::FXref &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FXref* ctype_zs_xref_Next(amc::FXref &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. // func:amc.FCtype.zs_xref.Remove @@ -2328,7 +2421,7 @@ inline bool zd_cafter_EmptyQ(amc::FCtype& ctype) __attribute__((__warn_ inline amc::FCafter* zd_cafter_First(amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc.FCtype.zd_cafter.InLlistQ -inline bool zd_cafter_InLlistQ(amc::FCafter& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool ctype_zd_cafter_InLlistQ(amc::FCafter& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc.FCtype.zd_cafter.Insert void zd_cafter_Insert(amc::FCtype& ctype, amc::FCafter& row) __attribute__((nothrow)); @@ -2340,10 +2433,10 @@ inline amc::FCafter* zd_cafter_Last(amc::FCtype& ctype) __attribute__((__warn_un inline i32 zd_cafter_N(const amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc.FCtype.zd_cafter.Next -inline amc::FCafter* zd_cafter_Next(amc::FCafter &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FCafter* ctype_zd_cafter_Next(amc::FCafter &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:amc.FCtype.zd_cafter.Prev -inline amc::FCafter* zd_cafter_Prev(amc::FCafter &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FCafter* ctype_zd_cafter_Prev(amc::FCafter &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:amc.FCtype.zd_cafter.Remove void zd_cafter_Remove(amc::FCtype& ctype, amc::FCafter& row) __attribute__((nothrow)); @@ -2372,7 +2465,7 @@ inline bool zd_access_EmptyQ(amc::FCtype& ctype) __attribute__((__warn_ inline amc::FField* zd_access_First(amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc.FCtype.zd_access.InLlistQ -inline bool zd_access_InLlistQ(amc::FField& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool ctype_zd_access_InLlistQ(amc::FField& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc.FCtype.zd_access.Insert void zd_access_Insert(amc::FCtype& ctype, amc::FField& row) __attribute__((nothrow)); @@ -2384,10 +2477,10 @@ inline amc::FField* zd_access_Last(amc::FCtype& ctype) __attribute__((__warn_un inline i32 zd_access_N(const amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc.FCtype.zd_access.Next -inline amc::FField* zd_access_Next(amc::FField &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FField* ctype_zd_access_Next(amc::FField &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:amc.FCtype.zd_access.Prev -inline amc::FField* zd_access_Prev(amc::FField &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FField* ctype_zd_access_Prev(amc::FField &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:amc.FCtype.zd_access.Remove void zd_access_Remove(amc::FCtype& ctype, amc::FField& row) __attribute__((nothrow)); @@ -2535,6 +2628,57 @@ void c_ffast_HeapSort(amc::FCtype& ctype) __attribute__((nothrow // func:amc.FCtype.c_ffast.QuickSort void c_ffast_QuickSort(amc::FCtype& ctype) __attribute__((nothrow)); +// Return true if index is empty +// func:amc.FCtype.zd_varlenfld.EmptyQ +inline bool zd_varlenfld_EmptyQ(amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:amc.FCtype.zd_varlenfld.First +inline amc::FField* zd_varlenfld_First(amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:amc.FCtype.zd_varlenfld.InLlistQ +inline bool ctype_zd_varlenfld_InLlistQ(amc::FField& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:amc.FCtype.zd_varlenfld.Insert +void zd_varlenfld_Insert(amc::FCtype& ctype, amc::FField& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:amc.FCtype.zd_varlenfld.Last +inline amc::FField* zd_varlenfld_Last(amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return number of items in the linked list +// func:amc.FCtype.zd_varlenfld.N +inline i32 zd_varlenfld_N(const amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:amc.FCtype.zd_varlenfld.Next +inline amc::FField* ctype_zd_varlenfld_Next(amc::FField &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:amc.FCtype.zd_varlenfld.Prev +inline amc::FField* ctype_zd_varlenfld_Prev(amc::FField &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:amc.FCtype.zd_varlenfld.Remove +void zd_varlenfld_Remove(amc::FCtype& ctype, amc::FField& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:amc.FCtype.zd_varlenfld.RemoveAll +void zd_varlenfld_RemoveAll(amc::FCtype& ctype) __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// func:amc.FCtype.zd_varlenfld.RemoveFirst +amc::FField* zd_varlenfld_RemoveFirst(amc::FCtype& ctype) __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:amc.FCtype.zd_varlenfld.qLast +inline amc::FField& zd_varlenfld_qLast(amc::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow)); + +// Insert row into pointer index. Return final membership status. +// func:amc.FCtype.c_jstype.InsertMaybe +inline bool c_jstype_InsertMaybe(amc::FCtype& ctype, amc::FJstype& row) __attribute__((nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:amc.FCtype.c_jstype.Remove +inline void c_jstype_Remove(amc::FCtype& ctype, amc::FJstype& row) __attribute__((nothrow)); + +// Insert row into pointer index. Return final membership status. +// func:amc.FCtype.c_ckafka.InsertMaybe +inline bool c_ckafka_InsertMaybe(amc::FCtype& ctype, amc::FCkafka& row) __attribute__((nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:amc.FCtype.c_ckafka.Remove +inline void c_ckafka_Remove(amc::FCtype& ctype, amc::FCkafka& row) __attribute__((nothrow)); + // cursor points to valid item // func:amc.FCtype.zs_cfmt_curs.Reset inline void ctype_zs_cfmt_curs_Reset(ctype_zs_cfmt_curs &curs, amc::FCtype &parent) __attribute__((nothrow)); @@ -2683,6 +2827,18 @@ inline void ctype_c_ffast_curs_Next(ctype_c_ffast_curs &curs) __attribu // item access // func:amc.FCtype.c_ffast_curs.Access inline amc::FFfast& ctype_c_ffast_curs_Access(ctype_c_ffast_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FCtype.zd_varlenfld_curs.Reset +inline void ctype_zd_varlenfld_curs_Reset(ctype_zd_varlenfld_curs &curs, amc::FCtype &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FCtype.zd_varlenfld_curs.ValidQ +inline bool ctype_zd_varlenfld_curs_ValidQ(ctype_zd_varlenfld_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:amc.FCtype.zd_varlenfld_curs.Next +inline void ctype_zd_varlenfld_curs_Next(ctype_zd_varlenfld_curs &curs) __attribute__((nothrow)); +// item access +// func:amc.FCtype.zd_varlenfld_curs.Access +inline amc::FField& ctype_zd_varlenfld_curs_Access(ctype_zd_varlenfld_curs &curs) __attribute__((nothrow)); // Set all fields to initial values. // func:amc.FCtype..Init void FCtype_Init(amc::FCtype& ctype); @@ -2692,15 +2848,13 @@ void FCtype_Uninit(amc::FCtype& ctype) __attribute__((nothrow)); // --- amc.FCtypelen // create: amc.FDb.ctypelen (Lary) // global access: ctypelen (Lary, by rowid) -// global access: c_ctypelen (Ptrary) // access: amc.FCtype.c_ctypelen (Ptr) struct FCtypelen { // amc.FCtypelen - algo::Smallstr100 ctype; // Identifies the Ctype - u32 len; // 0 (calculated) length of the C++ struct in bytes - i32 alignment; // 0 (calculated) alignment for the struct - i32 padbytes; // 0 (calculated) total # of pad bytes - bool plaindata; // false (calculated) this struct can me safely memcpy'ed - bool _db_c_ctypelen_in_ary; // false membership flag + algo::Smallstr100 ctype; // Identifies the Ctype + u32 len; // 0 (calculated) length of the C++ struct in bytes + i32 alignment; // 0 (calculated) alignment for the struct + i32 padbytes; // 0 (calculated) total # of pad bytes + bool plaindata; // false (calculated) this struct can me safely memcpy'ed // func:amc.FCtypelen..AssignOp inline amc::FCtypelen& operator =(const amc::FCtypelen &rhs) = delete; // func:amc.FCtypelen..CopyCtor @@ -2749,12 +2903,13 @@ inline void Genctx_Init(amc::Genctx& parent); // global access: ind_tclass (Thash, hash field tclass) // access: amc.FReftype.p_tclass (Upptr) struct FTclass { // amc.FTclass - algo::Smallstr50 tclass; // - amc::FTfunc** c_tfunc_elems; // array of pointers - u32 c_tfunc_n; // array of pointers - u32 c_tfunc_max; // capacity of allocated array - amc::tclass_step_hook step; // NULL Pointer to a function - amc::FTclass* ind_tclass_next; // hash next + algo::Smallstr50 tclass; // + amc::FTfunc** c_tfunc_elems; // array of pointers + u32 c_tfunc_n; // array of pointers + u32 c_tfunc_max; // capacity of allocated array + amc::tclass_step_hook step; // NULL Pointer to a function + amc::FTclass* ind_tclass_next; // hash next + u32 ind_tclass_hashval; // hash value // reftype Ptrary of amc.FTclass.c_tfunc prohibits copy // reftype Hook of amc.FTclass.step prohibits copy // func:amc.FTclass..AssignOp @@ -3068,9 +3223,6 @@ struct FDb { // amc.FDb: In-memory database for amc i32 tracerec_n; // number of elements in array amc::FDispsig* dispsig_lary[32]; // level array i32 dispsig_n; // number of elements in array - amc::FDispsig** c_dispsig_sorted_elems; // array of pointers - u32 c_dispsig_sorted_n; // array of pointers - u32 c_dispsig_sorted_max; // capacity of allocated array amc::FCtype* zs_sig_visit_head; // zero-terminated singly linked list amc::FCtype* zs_sig_visit_tail; // pointer to last element amc::FTarget* target_lary[32]; // level array @@ -3170,13 +3322,7 @@ struct FDb { // amc.FDb: In-memory database for amc u32 c_substr_field_max; // capacity of allocated array amc::FCtypelen* ctypelen_lary[32]; // level array i32 ctypelen_n; // number of elements in array - amc::FCtypelen** c_ctypelen_elems; // array of pointers - u32 c_ctypelen_n; // array of pointers - u32 c_ctypelen_max; // capacity of allocated array amc::FCtype* c_u64; // optional pointer - amc::FField** c_tempfield_elems; // array of pointers - u32 c_tempfield_n; // array of pointers - u32 c_tempfield_max; // capacity of allocated array amc::FFbase* fbase_lary[32]; // level array i32 fbase_n; // number of elements in array amc::FFcmap** ind_fcmap_buckets_elems; // pointer to bucket array @@ -3251,6 +3397,21 @@ struct FDb { // amc.FDb: In-memory database for amc amc::FFbuftype** ind_fbuftype_buckets_elems; // pointer to bucket array i32 ind_fbuftype_buckets_n; // number of elements in bucket array i32 ind_fbuftype_n; // number of elements in the hash table + amc::FNsjs* nsjs_lary[32]; // level array + i32 nsjs_n; // number of elements in array + amc::FJstype* jstype_lary[32]; // level array + i32 jstype_n; // number of elements in array + amc::FCkafka* ckafka_lary[32]; // level array + i32 ckafka_n; // number of elements in array + amc::FFkafka* fkafka_lary[32]; // level array + i32 fkafka_n; // number of elements in array + amc::FUserfunc* userfunc_lary[32]; // level array + i32 userfunc_n; // number of elements in array + amc::FSteptype* steptype_lary[32]; // level array + i32 steptype_n; // number of elements in array + amc::FSteptype** ind_steptype_buckets_elems; // pointer to bucket array + i32 ind_steptype_buckets_n; // number of elements in bucket array + i32 ind_steptype_n; // number of elements in the hash table amc::trace trace; // }; @@ -3342,6 +3503,9 @@ void ind_cfmt_Remove(amc::FCfmt& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_cfmt.Reserve void ind_cfmt_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_cfmt.AbsReserve +void ind_cfmt_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -4408,9 +4572,6 @@ bool LoadTuplesFile(algo::strptr fname, bool recursive) __attrib // Load all finputs from given file descriptor. // func:amc.FDb._db.LoadTuplesFd bool LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) __attribute__((nothrow)); -// Save ssim data to given directory. -// func:amc.FDb._db.SaveTuples -u32 SaveTuples(algo::strptr root) __attribute__((nothrow)); // Load specified ssimfile. // func:amc.FDb._db.LoadSsimfileMaybe bool LoadSsimfileMaybe(algo::strptr fname, bool recursive) __attribute__((nothrow)); @@ -4443,6 +4604,9 @@ void ind_bltin_Remove(amc::FBltin& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_bltin.Reserve void ind_bltin_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_bltin.AbsReserve +void ind_bltin_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:amc.FDb.ind_ctype.EmptyQ @@ -4465,6 +4629,9 @@ void ind_ctype_Remove(amc::FCtype& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_ctype.Reserve void ind_ctype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_ctype.AbsReserve +void ind_ctype_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:amc.FDb.ind_dispatch.EmptyQ @@ -4487,6 +4654,9 @@ void ind_dispatch_Remove(amc::FDispatch& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_dispatch.Reserve void ind_dispatch_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_dispatch.AbsReserve +void ind_dispatch_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:amc.FDb.ind_func.EmptyQ @@ -4509,6 +4679,9 @@ void ind_func_Remove(amc::FFunc& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_func.Reserve void ind_func_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_func.AbsReserve +void ind_func_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:amc.FDb.ind_field.EmptyQ @@ -4528,6 +4701,9 @@ void ind_field_Remove(amc::FField& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_field.Reserve void ind_field_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_field.AbsReserve +void ind_field_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:amc.FDb.ind_ns.EmptyQ @@ -4550,6 +4726,9 @@ void ind_ns_Remove(amc::FNs& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_ns.Reserve void ind_ns_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_ns.AbsReserve +void ind_ns_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:amc.FDb.ind_pnew.EmptyQ @@ -4572,6 +4751,9 @@ void ind_pnew_Remove(amc::FPnew& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_pnew.Reserve void ind_pnew_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_pnew.AbsReserve +void ind_pnew_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:amc.FDb.ind_xref.EmptyQ @@ -4594,6 +4776,9 @@ void ind_xref_Remove(amc::FXref& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_xref.Reserve void ind_xref_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_xref.AbsReserve +void ind_xref_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -4653,6 +4838,9 @@ void ind_cpptype_Remove(amc::FCpptype& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_cpptype.Reserve void ind_cpptype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_cpptype.AbsReserve +void ind_cpptype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -4712,6 +4900,9 @@ void ind_inlary_Remove(amc::FInlary& row) __attribute__((nothrow // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_inlary.Reserve void ind_inlary_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_inlary.AbsReserve +void ind_inlary_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -4771,6 +4962,9 @@ void ind_tary_Remove(amc::FTary& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_tary.Reserve void ind_tary_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_tary.AbsReserve +void ind_tary_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -4867,6 +5061,9 @@ void ind_rowid_Remove(amc::FRowid& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_rowid.Reserve void ind_rowid_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_rowid.AbsReserve +void ind_rowid_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -5037,6 +5234,9 @@ void ind_ssimfile_Remove(amc::FSsimfile& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_ssimfile.Reserve void ind_ssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_ssimfile.AbsReserve +void ind_ssimfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -5096,6 +5296,9 @@ void ind_pack_Remove(amc::FPack& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_pack.Reserve void ind_pack_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_pack.AbsReserve +void ind_pack_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:amc.FDb.ind_smallstr.EmptyQ @@ -5118,6 +5321,9 @@ void ind_smallstr_Remove(amc::FSmallstr& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_smallstr.Reserve void ind_smallstr_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_smallstr.AbsReserve +void ind_smallstr_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -5341,6 +5547,9 @@ void ind_enumstr_len_Remove(amc::FEnumstrLen& row) __attribute__ // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_enumstr_len.Reserve void ind_enumstr_len_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_enumstr_len.AbsReserve +void ind_enumstr_len_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:amc.FDb.ind_enumstr.EmptyQ @@ -5363,6 +5572,9 @@ void ind_enumstr_Remove(amc::FEnumstr& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_enumstr.Reserve void ind_enumstr_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_enumstr.AbsReserve +void ind_enumstr_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -5422,6 +5634,9 @@ void ind_fbitset_Remove(amc::FFbitset& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_fbitset.Reserve void ind_fbitset_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_fbitset.AbsReserve +void ind_fbitset_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -5518,6 +5733,9 @@ void ind_fdec_Remove(amc::FFdec& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_fdec.Reserve void ind_fdec_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_fdec.AbsReserve +void ind_fdec_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:amc.FDb.ind_reftype.EmptyQ @@ -5540,6 +5758,9 @@ void ind_reftype_Remove(amc::FReftype& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_reftype.Reserve void ind_reftype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_reftype.AbsReserve +void ind_reftype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -5599,6 +5820,9 @@ void ind_fconst_Remove(amc::FFconst& row) __attribute__((nothrow // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_fconst.Reserve void ind_fconst_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_fconst.AbsReserve +void ind_fconst_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:amc.FDb.c_ns_sorted.EmptyQ @@ -5770,6 +5994,9 @@ void ind_fbuf_Remove(amc::FFbuf& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_fbuf.Reserve void ind_fbuf_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_fbuf.AbsReserve +void ind_fbuf_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -5829,6 +6056,9 @@ void ind_chash_Remove(amc::FChash& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_chash.Reserve void ind_chash_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_chash.AbsReserve +void ind_chash_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -5888,6 +6118,9 @@ void ind_ccmp_Remove(amc::FCcmp& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_ccmp.Reserve void ind_ccmp_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_ccmp.AbsReserve +void ind_ccmp_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -6047,6 +6280,9 @@ void ind_listtype_Remove(amc::FListtype& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_listtype.Reserve void ind_listtype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_listtype.AbsReserve +void ind_listtype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -6217,6 +6453,9 @@ void ind_fstep_Remove(amc::FFstep& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_fstep.Reserve void ind_fstep_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_fstep.AbsReserve +void ind_fstep_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -6253,9 +6492,6 @@ void tracefld_RemoveLast() __attribute__((nothrow)); // 'quick' Access row by row id. No bounds checking. // func:amc.FDb.tracefld.qFind inline amc::FTracefld& tracefld_qFind(u64 t) __attribute__((nothrow, pure)); -// Save table to ssimfile -// func:amc.FDb.tracefld.SaveSsimfile -bool tracefld_SaveSsimfile(algo::strptr fname) __attribute__((nothrow)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. // func:amc.FDb.tracefld.XrefMaybe @@ -6296,9 +6532,6 @@ void tracerec_RemoveLast() __attribute__((nothrow)); // 'quick' Access row by row id. No bounds checking. // func:amc.FDb.tracerec.qFind inline amc::FTracerec& tracerec_qFind(u64 t) __attribute__((nothrow, pure)); -// Save table to ssimfile -// func:amc.FDb.tracerec.SaveSsimfile -bool tracerec_SaveSsimfile(algo::strptr fname) __attribute__((nothrow)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. // func:amc.FDb.tracerec.XrefMaybe @@ -6344,61 +6577,6 @@ inline amc::FDispsig& dispsig_qFind(u64 t) __attribute__((nothrow, pure)); // func:amc.FDb.dispsig.XrefMaybe bool dispsig_XrefMaybe(amc::FDispsig &row); -// Return true if index is empty -// func:amc.FDb.c_dispsig_sorted.EmptyQ -inline bool c_dispsig_sorted_EmptyQ() __attribute__((nothrow)); -// Look up row by row id. Return NULL if out of range -// func:amc.FDb.c_dispsig_sorted.Find -inline amc::FDispsig* c_dispsig_sorted_Find(u32 t) __attribute__((__warn_unused_result__, nothrow)); -// Return array of pointers -// func:amc.FDb.c_dispsig_sorted.Getary -inline algo::aryptr c_dispsig_sorted_Getary() __attribute__((nothrow)); -// Insert pointer to row into array. Row must not already be in array. -// If pointer is already in the array, it may be inserted twice. -// func:amc.FDb.c_dispsig_sorted.Insert -void c_dispsig_sorted_Insert(amc::FDispsig& row) __attribute__((nothrow)); -// Insert pointer to row in array. -// If row is already in the array, do nothing. -// Return value: whether element was inserted into array. -// func:amc.FDb.c_dispsig_sorted.InsertMaybe -bool c_dispsig_sorted_InsertMaybe(amc::FDispsig& row) __attribute__((nothrow)); -// Return number of items in the pointer array -// func:amc.FDb.c_dispsig_sorted.N -inline i32 c_dispsig_sorted_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Find element using linear scan. If element is in array, remove, otherwise do nothing -// func:amc.FDb.c_dispsig_sorted.Remove -void c_dispsig_sorted_Remove(amc::FDispsig& row) __attribute__((nothrow)); -// Empty the index. (The rows are not deleted) -// func:amc.FDb.c_dispsig_sorted.RemoveAll -inline void c_dispsig_sorted_RemoveAll() __attribute__((nothrow)); -// Reserve space in index for N more elements; -// func:amc.FDb.c_dispsig_sorted.Reserve -void c_dispsig_sorted_Reserve(u32 n) __attribute__((nothrow)); -// Return reference without bounds checking -// func:amc.FDb.c_dispsig_sorted.qFind -inline amc::FDispsig& c_dispsig_sorted_qFind(u32 idx) __attribute__((nothrow)); -// True if row is in any ptrary instance -// func:amc.FDb.c_dispsig_sorted.InAryQ -inline bool c_dispsig_sorted_InAryQ(amc::FDispsig& row) __attribute__((nothrow)); -// Reference to last element without bounds checking -// func:amc.FDb.c_dispsig_sorted.qLast -inline amc::FDispsig& c_dispsig_sorted_qLast() __attribute__((nothrow)); -// Verify whether array is sorted -// func:amc.FDb.c_dispsig_sorted.SortedQ -bool c_dispsig_sorted_SortedQ() __attribute__((nothrow)); -// Insertion sort -// func:amc.FDb.c_dispsig_sorted.InsertionSort -void c_dispsig_sorted_InsertionSort() __attribute__((nothrow)); -// Heap sort -// func:amc.FDb.c_dispsig_sorted.HeapSort -void c_dispsig_sorted_HeapSort() __attribute__((nothrow)); -// Quick sort -// func:amc.FDb.c_dispsig_sorted.QuickSort -void c_dispsig_sorted_QuickSort() __attribute__((nothrow)); -// Save table to ssimfile -// func:amc.FDb.c_dispsig_sorted.SaveSsimfile -bool c_dispsig_sorted_SaveSsimfile(algo::strptr fname) __attribute__((nothrow)); - // Return true if index is empty // func:amc.FDb.zs_sig_visit.EmptyQ inline bool zs_sig_visit_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); @@ -6489,6 +6667,9 @@ void ind_target_Remove(amc::FTarget& row) __attribute__((nothrow // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_target.Reserve void ind_target_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_target.AbsReserve +void ind_target_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -6659,6 +6840,9 @@ void ind_fwddecl_Remove(amc::FFwddecl& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_fwddecl.Reserve void ind_fwddecl_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_fwddecl.AbsReserve +void ind_fwddecl_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -6721,6 +6905,9 @@ void ind_tfunc_Remove(amc::FTfunc& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_tfunc.Reserve void ind_tfunc_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_tfunc.AbsReserve +void ind_tfunc_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -6866,6 +7053,9 @@ void ind_tclass_Remove(amc::FTclass& row) __attribute__((nothrow // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_tclass.Reserve void ind_tclass_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_tclass.AbsReserve +void ind_tclass_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -7369,6 +7559,9 @@ void ind_main_Remove(amc::FMain& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_main.Reserve void ind_main_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_main.AbsReserve +void ind_main_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -7605,6 +7798,9 @@ void ind_fconst_int_Remove(amc::FFconst& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_fconst_int.Reserve void ind_fconst_int_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_fconst_int.AbsReserve +void ind_fconst_int_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -7664,6 +7860,9 @@ void ind_prefix_Remove(amc::FFprefix& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_prefix.Reserve void ind_prefix_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_prefix.AbsReserve +void ind_prefix_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -7831,101 +8030,6 @@ inline amc::FCtypelen& ctypelen_qFind(u64 t) __attribute__((nothrow, pure)); // func:amc.FDb.ctypelen.XrefMaybe bool ctypelen_XrefMaybe(amc::FCtypelen &row); -// Return true if index is empty -// func:amc.FDb.c_ctypelen.EmptyQ -inline bool c_ctypelen_EmptyQ() __attribute__((nothrow)); -// Look up row by row id. Return NULL if out of range -// func:amc.FDb.c_ctypelen.Find -inline amc::FCtypelen* c_ctypelen_Find(u32 t) __attribute__((__warn_unused_result__, nothrow)); -// Return array of pointers -// func:amc.FDb.c_ctypelen.Getary -inline algo::aryptr c_ctypelen_Getary() __attribute__((nothrow)); -// Insert pointer to row into array. Row must not already be in array. -// If pointer is already in the array, it may be inserted twice. -// func:amc.FDb.c_ctypelen.Insert -void c_ctypelen_Insert(amc::FCtypelen& row) __attribute__((nothrow)); -// Insert pointer to row in array. -// If row is already in the array, do nothing. -// Return value: whether element was inserted into array. -// func:amc.FDb.c_ctypelen.InsertMaybe -bool c_ctypelen_InsertMaybe(amc::FCtypelen& row) __attribute__((nothrow)); -// Return number of items in the pointer array -// func:amc.FDb.c_ctypelen.N -inline i32 c_ctypelen_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Find element using linear scan. If element is in array, remove, otherwise do nothing -// func:amc.FDb.c_ctypelen.Remove -void c_ctypelen_Remove(amc::FCtypelen& row) __attribute__((nothrow)); -// Empty the index. (The rows are not deleted) -// func:amc.FDb.c_ctypelen.RemoveAll -inline void c_ctypelen_RemoveAll() __attribute__((nothrow)); -// Reserve space in index for N more elements; -// func:amc.FDb.c_ctypelen.Reserve -void c_ctypelen_Reserve(u32 n) __attribute__((nothrow)); -// Return reference without bounds checking -// func:amc.FDb.c_ctypelen.qFind -inline amc::FCtypelen& c_ctypelen_qFind(u32 idx) __attribute__((nothrow)); -// True if row is in any ptrary instance -// func:amc.FDb.c_ctypelen.InAryQ -inline bool c_ctypelen_InAryQ(amc::FCtypelen& row) __attribute__((nothrow)); -// Reference to last element without bounds checking -// func:amc.FDb.c_ctypelen.qLast -inline amc::FCtypelen& c_ctypelen_qLast() __attribute__((nothrow)); -// Verify whether array is sorted -// func:amc.FDb.c_ctypelen.SortedQ -bool c_ctypelen_SortedQ() __attribute__((nothrow)); -// Insertion sort -// func:amc.FDb.c_ctypelen.InsertionSort -void c_ctypelen_InsertionSort() __attribute__((nothrow)); -// Heap sort -// func:amc.FDb.c_ctypelen.HeapSort -void c_ctypelen_HeapSort() __attribute__((nothrow)); -// Quick sort -// func:amc.FDb.c_ctypelen.QuickSort -void c_ctypelen_QuickSort() __attribute__((nothrow)); -// Save table to ssimfile -// func:amc.FDb.c_ctypelen.SaveSsimfile -bool c_ctypelen_SaveSsimfile(algo::strptr fname) __attribute__((nothrow)); - -// Return true if index is empty -// func:amc.FDb.c_tempfield.EmptyQ -inline bool c_tempfield_EmptyQ() __attribute__((nothrow)); -// Look up row by row id. Return NULL if out of range -// func:amc.FDb.c_tempfield.Find -inline amc::FField* c_tempfield_Find(u32 t) __attribute__((__warn_unused_result__, nothrow)); -// Return array of pointers -// func:amc.FDb.c_tempfield.Getary -inline algo::aryptr c_tempfield_Getary() __attribute__((nothrow)); -// Insert pointer to row into array. Row must not already be in array. -// If pointer is already in the array, it may be inserted twice. -// func:amc.FDb.c_tempfield.Insert -void c_tempfield_Insert(amc::FField& row) __attribute__((nothrow)); -// Insert pointer to row in array. -// If row is already in the array, do nothing. -// Return value: whether element was inserted into array. -// func:amc.FDb.c_tempfield.InsertMaybe -bool c_tempfield_InsertMaybe(amc::FField& row) __attribute__((nothrow)); -// Return number of items in the pointer array -// func:amc.FDb.c_tempfield.N -inline i32 c_tempfield_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Find element using linear scan. If element is in array, remove, otherwise do nothing -// func:amc.FDb.c_tempfield.Remove -void c_tempfield_Remove(amc::FField& row) __attribute__((nothrow)); -// Empty the index. (The rows are not deleted) -// func:amc.FDb.c_tempfield.RemoveAll -inline void c_tempfield_RemoveAll() __attribute__((nothrow)); -// Reserve space in index for N more elements; -// func:amc.FDb.c_tempfield.Reserve -void c_tempfield_Reserve(u32 n) __attribute__((nothrow)); -// Return reference without bounds checking -// func:amc.FDb.c_tempfield.qFind -inline amc::FField& c_tempfield_qFind(u32 idx) __attribute__((nothrow)); -// True if row is in any ptrary instance -// func:amc.FDb.c_tempfield.InAryQ -inline bool c_tempfield_InAryQ(amc::FField& row) __attribute__((nothrow)); -// Reference to last element without bounds checking -// func:amc.FDb.c_tempfield.qLast -inline amc::FField& c_tempfield_qLast() __attribute__((nothrow)); - // Allocate memory for new default row. // If out of memory, process is killed. // func:amc.FDb.fbase.Alloc @@ -7987,6 +8091,9 @@ void ind_fcmap_Remove(amc::FFcmap& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_fcmap.Reserve void ind_fcmap_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_fcmap.AbsReserve +void ind_fcmap_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -8479,6 +8586,9 @@ void ind_fcurs_Remove(amc::FFcurs& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_fcurs.Reserve void ind_fcurs_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_fcurs.AbsReserve +void ind_fcurs_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -8621,6 +8731,9 @@ void ind_fflag_Remove(amc::FFflag& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_fflag.Reserve void ind_fflag_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_fflag.AbsReserve +void ind_fflag_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -8723,6 +8836,9 @@ void ind_license_Remove(amc::FLicense& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_license.Reserve void ind_license_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_license.AbsReserve +void ind_license_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:amc.FDb.c_ssimfile_sorted.EmptyQ @@ -8942,6 +9058,9 @@ void ind_pmaskfld_Remove(amc::FPmaskfld& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_pmaskfld.Reserve void ind_pmaskfld_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_pmaskfld.AbsReserve +void ind_pmaskfld_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -9044,6 +9163,274 @@ void ind_fbuftype_Remove(amc::FFbuftype& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FDb.ind_fbuftype.Reserve void ind_fbuftype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_fbuftype.AbsReserve +void ind_fbuftype_AbsReserve(int n) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:amc.FDb.nsjs.Alloc +amc::FNsjs& nsjs_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:amc.FDb.nsjs.AllocMaybe +amc::FNsjs* nsjs_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:amc.FDb.nsjs.InsertMaybe +amc::FNsjs* nsjs_InsertMaybe(const dmmeta::Nsjs &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:amc.FDb.nsjs.AllocMem +void* nsjs_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:amc.FDb.nsjs.EmptyQ +inline bool nsjs_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:amc.FDb.nsjs.Find +inline amc::FNsjs* nsjs_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:amc.FDb.nsjs.Last +inline amc::FNsjs* nsjs_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:amc.FDb.nsjs.N +inline i32 nsjs_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:amc.FDb.nsjs.RemoveAll +void nsjs_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:amc.FDb.nsjs.RemoveLast +void nsjs_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:amc.FDb.nsjs.qFind +inline amc::FNsjs& nsjs_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:amc.FDb.nsjs.XrefMaybe +bool nsjs_XrefMaybe(amc::FNsjs &row); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:amc.FDb.jstype.Alloc +amc::FJstype& jstype_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:amc.FDb.jstype.AllocMaybe +amc::FJstype* jstype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:amc.FDb.jstype.InsertMaybe +amc::FJstype* jstype_InsertMaybe(const dmmeta::Jstype &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:amc.FDb.jstype.AllocMem +void* jstype_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:amc.FDb.jstype.EmptyQ +inline bool jstype_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:amc.FDb.jstype.Find +inline amc::FJstype* jstype_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:amc.FDb.jstype.Last +inline amc::FJstype* jstype_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:amc.FDb.jstype.N +inline i32 jstype_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:amc.FDb.jstype.RemoveAll +void jstype_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:amc.FDb.jstype.RemoveLast +void jstype_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:amc.FDb.jstype.qFind +inline amc::FJstype& jstype_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:amc.FDb.jstype.XrefMaybe +bool jstype_XrefMaybe(amc::FJstype &row); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:amc.FDb.ckafka.Alloc +amc::FCkafka& ckafka_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:amc.FDb.ckafka.AllocMaybe +amc::FCkafka* ckafka_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:amc.FDb.ckafka.InsertMaybe +amc::FCkafka* ckafka_InsertMaybe(const dmmeta::Ckafka &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:amc.FDb.ckafka.AllocMem +void* ckafka_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:amc.FDb.ckafka.EmptyQ +inline bool ckafka_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:amc.FDb.ckafka.Find +inline amc::FCkafka* ckafka_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:amc.FDb.ckafka.Last +inline amc::FCkafka* ckafka_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:amc.FDb.ckafka.N +inline i32 ckafka_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:amc.FDb.ckafka.RemoveAll +void ckafka_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:amc.FDb.ckafka.RemoveLast +void ckafka_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:amc.FDb.ckafka.qFind +inline amc::FCkafka& ckafka_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:amc.FDb.ckafka.XrefMaybe +bool ckafka_XrefMaybe(amc::FCkafka &row); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:amc.FDb.fkafka.Alloc +amc::FFkafka& fkafka_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:amc.FDb.fkafka.AllocMaybe +amc::FFkafka* fkafka_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:amc.FDb.fkafka.InsertMaybe +amc::FFkafka* fkafka_InsertMaybe(const dmmeta::Fkafka &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:amc.FDb.fkafka.AllocMem +void* fkafka_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:amc.FDb.fkafka.EmptyQ +inline bool fkafka_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:amc.FDb.fkafka.Find +inline amc::FFkafka* fkafka_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:amc.FDb.fkafka.Last +inline amc::FFkafka* fkafka_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:amc.FDb.fkafka.N +inline i32 fkafka_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:amc.FDb.fkafka.RemoveAll +void fkafka_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:amc.FDb.fkafka.RemoveLast +void fkafka_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:amc.FDb.fkafka.qFind +inline amc::FFkafka& fkafka_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:amc.FDb.fkafka.XrefMaybe +bool fkafka_XrefMaybe(amc::FFkafka &row); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:amc.FDb.userfunc.Alloc +amc::FUserfunc& userfunc_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:amc.FDb.userfunc.AllocMaybe +amc::FUserfunc* userfunc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:amc.FDb.userfunc.InsertMaybe +amc::FUserfunc* userfunc_InsertMaybe(const dmmeta::Userfunc &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:amc.FDb.userfunc.AllocMem +void* userfunc_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:amc.FDb.userfunc.EmptyQ +inline bool userfunc_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:amc.FDb.userfunc.Find +inline amc::FUserfunc* userfunc_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:amc.FDb.userfunc.Last +inline amc::FUserfunc* userfunc_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:amc.FDb.userfunc.N +inline i32 userfunc_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:amc.FDb.userfunc.RemoveAll +void userfunc_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:amc.FDb.userfunc.RemoveLast +void userfunc_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:amc.FDb.userfunc.qFind +inline amc::FUserfunc& userfunc_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:amc.FDb.userfunc.XrefMaybe +bool userfunc_XrefMaybe(amc::FUserfunc &row); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:amc.FDb.steptype.Alloc +amc::FSteptype& steptype_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:amc.FDb.steptype.AllocMaybe +amc::FSteptype* steptype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:amc.FDb.steptype.InsertMaybe +amc::FSteptype* steptype_InsertMaybe(const dmmeta::Steptype &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:amc.FDb.steptype.AllocMem +void* steptype_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:amc.FDb.steptype.EmptyQ +inline bool steptype_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:amc.FDb.steptype.Find +inline amc::FSteptype* steptype_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:amc.FDb.steptype.Last +inline amc::FSteptype* steptype_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:amc.FDb.steptype.N +inline i32 steptype_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:amc.FDb.steptype.RemoveAll +void steptype_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:amc.FDb.steptype.RemoveLast +void steptype_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:amc.FDb.steptype.qFind +inline amc::FSteptype& steptype_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:amc.FDb.steptype.XrefMaybe +bool steptype_XrefMaybe(amc::FSteptype &row); + +// Return true if hash is empty +// func:amc.FDb.ind_steptype.EmptyQ +inline bool ind_steptype_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:amc.FDb.ind_steptype.Find +amc::FSteptype* ind_steptype_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Find row by key. If not found, create and x-reference a new row with with this key. +// func:amc.FDb.ind_steptype.GetOrCreate +amc::FSteptype& ind_steptype_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); +// Return number of items in the hash +// func:amc.FDb.ind_steptype.N +inline i32 ind_steptype_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:amc.FDb.ind_steptype.InsertMaybe +bool ind_steptype_InsertMaybe(amc::FSteptype& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:amc.FDb.ind_steptype.Remove +void ind_steptype_Remove(amc::FSteptype& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:amc.FDb.ind_steptype.Reserve +void ind_steptype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FDb.ind_steptype.AbsReserve +void ind_steptype_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:amc.FDb.fsort_curs.Reset @@ -9813,17 +10200,6 @@ inline void _db_dispsig_curs_Next(_db_dispsig_curs &curs) __attribute__ // item access // func:amc.FDb.dispsig_curs.Access inline amc::FDispsig& _db_dispsig_curs_Access(_db_dispsig_curs &curs) __attribute__((nothrow)); -// func:amc.FDb.c_dispsig_sorted_curs.Reset -inline void _db_c_dispsig_sorted_curs_Reset(_db_c_dispsig_sorted_curs &curs, amc::FDb &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:amc.FDb.c_dispsig_sorted_curs.ValidQ -inline bool _db_c_dispsig_sorted_curs_ValidQ(_db_c_dispsig_sorted_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:amc.FDb.c_dispsig_sorted_curs.Next -inline void _db_c_dispsig_sorted_curs_Next(_db_c_dispsig_sorted_curs &curs) __attribute__((nothrow)); -// item access -// func:amc.FDb.c_dispsig_sorted_curs.Access -inline amc::FDispsig& _db_c_dispsig_sorted_curs_Access(_db_c_dispsig_sorted_curs &curs) __attribute__((nothrow)); // cursor points to valid item // func:amc.FDb.zs_sig_visit_curs.Reset inline void _db_zs_sig_visit_curs_Reset(_db_zs_sig_visit_curs &curs, amc::FDb &parent) __attribute__((nothrow)); @@ -10231,28 +10607,6 @@ inline void _db_ctypelen_curs_Next(_db_ctypelen_curs &curs) __attribute // item access // func:amc.FDb.ctypelen_curs.Access inline amc::FCtypelen& _db_ctypelen_curs_Access(_db_ctypelen_curs &curs) __attribute__((nothrow)); -// func:amc.FDb.c_ctypelen_curs.Reset -inline void _db_c_ctypelen_curs_Reset(_db_c_ctypelen_curs &curs, amc::FDb &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:amc.FDb.c_ctypelen_curs.ValidQ -inline bool _db_c_ctypelen_curs_ValidQ(_db_c_ctypelen_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:amc.FDb.c_ctypelen_curs.Next -inline void _db_c_ctypelen_curs_Next(_db_c_ctypelen_curs &curs) __attribute__((nothrow)); -// item access -// func:amc.FDb.c_ctypelen_curs.Access -inline amc::FCtypelen& _db_c_ctypelen_curs_Access(_db_c_ctypelen_curs &curs) __attribute__((nothrow)); -// func:amc.FDb.c_tempfield_curs.Reset -inline void _db_c_tempfield_curs_Reset(_db_c_tempfield_curs &curs, amc::FDb &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:amc.FDb.c_tempfield_curs.ValidQ -inline bool _db_c_tempfield_curs_ValidQ(_db_c_tempfield_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:amc.FDb.c_tempfield_curs.Next -inline void _db_c_tempfield_curs_Next(_db_c_tempfield_curs &curs) __attribute__((nothrow)); -// item access -// func:amc.FDb.c_tempfield_curs.Access -inline amc::FField& _db_c_tempfield_curs_Access(_db_c_tempfield_curs &curs) __attribute__((nothrow)); // cursor points to valid item // func:amc.FDb.fbase_curs.Reset inline void _db_fbase_curs_Reset(_db_fbase_curs &curs, amc::FDb &parent) __attribute__((nothrow)); @@ -10552,6 +10906,78 @@ inline void _db_fbuftype_curs_Next(_db_fbuftype_curs &curs) __attribute // item access // func:amc.FDb.fbuftype_curs.Access inline amc::FFbuftype& _db_fbuftype_curs_Access(_db_fbuftype_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.nsjs_curs.Reset +inline void _db_nsjs_curs_Reset(_db_nsjs_curs &curs, amc::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.nsjs_curs.ValidQ +inline bool _db_nsjs_curs_ValidQ(_db_nsjs_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:amc.FDb.nsjs_curs.Next +inline void _db_nsjs_curs_Next(_db_nsjs_curs &curs) __attribute__((nothrow)); +// item access +// func:amc.FDb.nsjs_curs.Access +inline amc::FNsjs& _db_nsjs_curs_Access(_db_nsjs_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.jstype_curs.Reset +inline void _db_jstype_curs_Reset(_db_jstype_curs &curs, amc::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.jstype_curs.ValidQ +inline bool _db_jstype_curs_ValidQ(_db_jstype_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:amc.FDb.jstype_curs.Next +inline void _db_jstype_curs_Next(_db_jstype_curs &curs) __attribute__((nothrow)); +// item access +// func:amc.FDb.jstype_curs.Access +inline amc::FJstype& _db_jstype_curs_Access(_db_jstype_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.ckafka_curs.Reset +inline void _db_ckafka_curs_Reset(_db_ckafka_curs &curs, amc::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.ckafka_curs.ValidQ +inline bool _db_ckafka_curs_ValidQ(_db_ckafka_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:amc.FDb.ckafka_curs.Next +inline void _db_ckafka_curs_Next(_db_ckafka_curs &curs) __attribute__((nothrow)); +// item access +// func:amc.FDb.ckafka_curs.Access +inline amc::FCkafka& _db_ckafka_curs_Access(_db_ckafka_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.fkafka_curs.Reset +inline void _db_fkafka_curs_Reset(_db_fkafka_curs &curs, amc::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.fkafka_curs.ValidQ +inline bool _db_fkafka_curs_ValidQ(_db_fkafka_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:amc.FDb.fkafka_curs.Next +inline void _db_fkafka_curs_Next(_db_fkafka_curs &curs) __attribute__((nothrow)); +// item access +// func:amc.FDb.fkafka_curs.Access +inline amc::FFkafka& _db_fkafka_curs_Access(_db_fkafka_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.userfunc_curs.Reset +inline void _db_userfunc_curs_Reset(_db_userfunc_curs &curs, amc::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.userfunc_curs.ValidQ +inline bool _db_userfunc_curs_ValidQ(_db_userfunc_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:amc.FDb.userfunc_curs.Next +inline void _db_userfunc_curs_Next(_db_userfunc_curs &curs) __attribute__((nothrow)); +// item access +// func:amc.FDb.userfunc_curs.Access +inline amc::FUserfunc& _db_userfunc_curs_Access(_db_userfunc_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.steptype_curs.Reset +inline void _db_steptype_curs_Reset(_db_steptype_curs &curs, amc::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:amc.FDb.steptype_curs.ValidQ +inline bool _db_steptype_curs_ValidQ(_db_steptype_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:amc.FDb.steptype_curs.Next +inline void _db_steptype_curs_Next(_db_steptype_curs &curs) __attribute__((nothrow)); +// item access +// func:amc.FDb.steptype_curs.Access +inline amc::FSteptype& _db_steptype_curs_Access(_db_steptype_curs &curs) __attribute__((nothrow)); // Set all fields to initial values. // func:amc.FDb..Init void FDb_Init(); @@ -10567,6 +10993,7 @@ void FDb_Uninit() __attribute__((nothrow)); // access: amc.FNs.c_dispatch (Ptrary) struct FDispatch { // amc.FDispatch amc::FDispatch* ind_dispatch_next; // hash next + u32 ind_dispatch_hashval; // hash value algo::Smallstr50 dispatch; // Primary key (ns.name) bool unk; // false Want default case? bool read; // false Generate read function @@ -10574,6 +11001,8 @@ struct FDispatch { // amc.FDispatch bool haslen; // false Include length in dispatch function bool call; // false Generate call to user-defined function bool strict; // false Only dispatch if length matches exactly + bool dyn; // false Use dynamic memory allocation: new, delete instead of ByteAry + bool kafka; // false generate kafka codec amc::FCtype* p_ctype_hdr; // reference to parent row amc::FCtype* p_casetype; // reference to parent row amc::FDispfilter* c_dispfilter; // optional pointer @@ -10821,13 +11250,11 @@ void FDispfilter_Uninit(amc::FDispfilter& dispfilter) __attribut // --- amc.FDispsig // create: amc.FDb.dispsig (Lary) // global access: dispsig (Lary, by rowid) -// global access: c_dispsig_sorted (Ptrary) // access: amc.FNs.c_dispsig (Ptrary) struct FDispsig { // amc.FDispsig - algo::Smallstr50 dispsig; // - algo::Sha1sig signature; // - bool _db_c_dispsig_sorted_in_ary; // false membership flag - bool ns_c_dispsig_in_ary; // false membership flag + algo::Smallstr50 dispsig; // + algo::Sha1sig signature; // + bool ns_c_dispsig_in_ary; // false membership flag // func:amc.FDispsig..AssignOp inline amc::FDispsig& operator =(const amc::FDispsig &rhs) = delete; // func:amc.FDispsig..CopyCtor @@ -10906,12 +11333,13 @@ void FDisptrace_Uninit(amc::FDisptrace& disptrace) __attribute__ // global access: ind_enumstr (Thash, hash field enumstr) // access: amc.FEnumstrLen.bh_enumstr (Bheap) struct FEnumstr { // amc.FEnumstr: All values of a given length - amc::FEnumstr* ind_enumstr_next; // hash next - amc::Enumstr enumstr; // - amc::FFconst** c_fconst_elems; // array of pointers - u32 c_fconst_n; // array of pointers - u32 c_fconst_max; // capacity of allocated array - i32 bh_enumstr_idx; // index in heap; -1 means not-in-heap + amc::FEnumstr* ind_enumstr_next; // hash next + u32 ind_enumstr_hashval; // hash value + amc::Enumstr enumstr; // + amc::FFconst** c_fconst_elems; // array of pointers + u32 c_fconst_n; // array of pointers + u32 c_fconst_max; // capacity of allocated array + i32 enumstr_len_bh_enumstr_idx; // index in heap; -1 means not-in-heap // reftype Ptrary of amc.FEnumstr.c_fconst prohibits copy // func:amc.FEnumstr..AssignOp inline amc::FEnumstr& operator =(const amc::FEnumstr &rhs) = delete; @@ -10990,12 +11418,13 @@ void FEnumstr_Uninit(amc::FEnumstr& enumstr) __attribute__((noth // global access: bh_enumstr_len (Bheap, sort field len) // global access: ind_enumstr_len (Thash, hash field len) struct FEnumstrLen { // amc.FEnumstrLen - i32 bh_enumstr_len_idx; // index in heap; -1 means not-in-heap - amc::FEnumstrLen* ind_enumstr_len_next; // hash next - i32 len; // 0 - amc::FEnumstr** bh_enumstr_elems; // binary heap by str - i32 bh_enumstr_n; // number of elements in the heap - i32 bh_enumstr_max; // max elements in bh_enumstr_elems + i32 bh_enumstr_len_idx; // index in heap; -1 means not-in-heap + amc::FEnumstrLen* ind_enumstr_len_next; // hash next + u32 ind_enumstr_len_hashval; // hash value + i32 len; // 0 + amc::FEnumstr** bh_enumstr_elems; // binary heap by str + i32 bh_enumstr_n; // number of elements in the heap + i32 bh_enumstr_max; // max elements in bh_enumstr_elems // reftype Bheap of amc.FEnumstrLen.bh_enumstr prohibits copy // func:amc.FEnumstrLen..AssignOp inline amc::FEnumstrLen& operator =(const amc::FEnumstrLen &rhs) = delete; @@ -11193,9 +11622,10 @@ void FFbigend_Uninit(amc::FFbigend& fbigend) __attribute__((noth // global access: ind_fbitset (Thash, hash field field) // access: amc.FField.c_fbitset (Ptr) struct FFbitset { // amc.FFbitset - amc::FFbitset* ind_fbitset_next; // hash next - algo::Smallstr100 field; // - amc::FField* p_field; // reference to parent row + amc::FFbitset* ind_fbitset_next; // hash next + u32 ind_fbitset_hashval; // hash value + algo::Smallstr100 field; // + amc::FField* p_field; // reference to parent row // x-reference on amc.FFbitset.p_field prevents copy // func:amc.FFbitset..AssignOp inline amc::FFbitset& operator =(const amc::FFbitset &rhs) = delete; @@ -11231,15 +11661,17 @@ void FFbitset_Uninit(amc::FFbitset& fbitset) __attribute__((noth // global access: ind_fbuf (Thash, hash field field) // access: amc.FField.c_fbuf (Ptr) struct FFbuf { // amc.FFbuf - amc::FFbuf* ind_fbuf_next; // hash next - algo::Smallstr100 field; // - u32 max; // 0 Size of buffer in bytes - algo::Smallstr50 fbuftype; // Type of buffer - algo::Smallstr100 insready; // - algo::Smallstr100 inseof; // - amc::FField* p_insready; // reference to parent row - amc::FField* p_inseof; // reference to parent row - amc::FFbuftype* p_fbuftype; // reference to parent row + amc::FFbuf* ind_fbuf_next; // hash next + u32 ind_fbuf_hashval; // hash value + algo::Smallstr100 field; // + u32 max; // 0 Size of buffer in bytes + algo::Smallstr50 fbuftype; // Type of buffer + algo::Smallstr100 insready; // + algo::Smallstr100 inseof; // + algo::Smallstr50 iotype; // "standard" + amc::FField* p_insready; // reference to parent row + amc::FField* p_inseof; // reference to parent row + amc::FFbuftype* p_fbuftype; // reference to parent row // x-reference on amc.FFbuf.p_insready prevents copy // x-reference on amc.FFbuf.p_inseof prevents copy // x-reference on amc.FFbuf.p_fbuftype prevents copy @@ -11272,7 +11704,7 @@ algo::Smallstr50 fbufdir_Get(amc::FFbuf& fbuf) __attribute__((__warn_unused_ // Set all fields to initial values. // func:amc.FFbuf..Init -inline void FFbuf_Init(amc::FFbuf& fbuf); +void FFbuf_Init(amc::FFbuf& fbuf); // func:amc.FFbuf..Uninit void FFbuf_Uninit(amc::FFbuf& fbuf) __attribute__((nothrow)); @@ -11282,10 +11714,11 @@ void FFbuf_Uninit(amc::FFbuf& fbuf) __attribute__((nothrow)); // global access: ind_fbuftype (Thash, hash field fbuftype) // access: amc.FFbuf.p_fbuftype (Upptr) struct FFbuftype { // amc.FFbuftype - amc::FFbuftype* ind_fbuftype_next; // hash next - algo::Smallstr50 fbuftype; // - bool skipbytes; // false Has skipbytes function? - algo::Comment comment; // + amc::FFbuftype* ind_fbuftype_next; // hash next + u32 ind_fbuftype_hashval; // hash value + algo::Smallstr50 fbuftype; // + bool skipbytes; // false Has skipbytes function? + algo::Comment comment; // // func:amc.FFbuftype..AssignOp inline amc::FFbuftype& operator =(const amc::FFbuftype &rhs) = delete; // func:amc.FFbuftype..CopyCtor @@ -11387,14 +11820,15 @@ void FFcleanup_Uninit(amc::FFcleanup& fcleanup) __attribute__((n // global access: ind_fcmap (Thash, hash field fcmap) // access: amc.FField.zs_fcmap (Llist) struct FFcmap { // amc.FFcmap - amc::FFcmap* ind_fcmap_next; // hash next - algo::Smallstr250 fcmap; // cstring maybe? - bool bidir; // true - algo::Comment comment; // - amc::FField* p_leftField; // reference to parent row - amc::FField* p_rightField; // reference to parent row - amc::FFunc* c_convfunc; // Generated conversion func. optional pointer - amc::FFcmap* zs_fcmap_next; // zslist link; -1 means not-in-list + amc::FFcmap* ind_fcmap_next; // hash next + u32 ind_fcmap_hashval; // hash value + algo::Smallstr250 fcmap; // cstring maybe? + bool bidir; // true + algo::Comment comment; // + amc::FField* p_leftField; // reference to parent row + amc::FField* p_rightField; // reference to parent row + amc::FFunc* c_convfunc; // Generated conversion func. optional pointer + amc::FFcmap* field_zs_fcmap_next; // zslist link; -1 means not-in-list // x-reference on amc.FFcmap.p_leftField prevents copy // x-reference on amc.FFcmap.p_rightField prevents copy // func:amc.FFcmap..AssignOp @@ -11563,16 +11997,18 @@ void FFcompact_Uninit(amc::FFcompact& fcompact) __attribute__((n // access: amc.FField.c_fconst (Ptrary) // access: amc.FField.c_inkey_fconst (Ptr) struct FFconst { // amc.FFconst - amc::FFconst* ind_fconst_next; // hash next - amc::FFconst* ind_fconst_int_next; // hash next - algo::Smallstr100 fconst; // - algo::CppExpr value; // - algo::Comment comment; // - amc::FField* p_field; // reference to parent row - algo::cstring cpp_value; // - i64 int_val; // 0 integer value - algo::cstring cpp_name; // symbol to use in cpp file - bool field_c_fconst_in_ary; // false membership flag + amc::FFconst* ind_fconst_next; // hash next + u32 ind_fconst_hashval; // hash value + amc::FFconst* ind_fconst_int_next; // hash next + u32 ind_fconst_int_hashval; // hash value + algo::Smallstr100 fconst; // + algo::CppExpr value; // + algo::Comment comment; // + amc::FField* p_field; // reference to parent row + algo::cstring cpp_value; // + i64 int_val; // 0 integer value + algo::cstring cpp_name; // symbol to use in cpp file + bool field_c_fconst_in_ary; // false membership flag // x-reference on amc.FFconst.p_field prevents copy // func:amc.FFconst..AssignOp amc::FFconst& operator =(const amc::FFconst &rhs) = delete; @@ -11615,6 +12051,7 @@ void FFconst_Uninit(amc::FFconst& fconst) __attribute__((nothrow // access: amc.FCtype.c_fcurs (Ptrary) struct FFcurs { // amc.FFcurs amc::FFcurs* ind_fcurs_next; // hash next + u32 ind_fcurs_hashval; // hash value algo::Smallstr50 fcurs; // algo::Comment comment; // amc::FField* p_field; // reference to parent row @@ -11663,11 +12100,12 @@ void FFcurs_Uninit(amc::FFcurs& fcurs) __attribute__((nothrow)); // global access: ind_fdec (Thash, hash field field) // access: amc.FField.c_fdec (Ptr) struct FFdec { // amc.FFdec - amc::FFdec* ind_fdec_next; // hash next - algo::Smallstr100 field; // Target field - i32 nplace; // 0 Number of implied decimal places - bool fixedfmt; // false Print exactly SCALE chars after decimal point - amc::FField* p_field; // reference to parent row + amc::FFdec* ind_fdec_next; // hash next + u32 ind_fdec_hashval; // hash value + algo::Smallstr100 field; // Target field + i32 nplace; // 0 Number of implied decimal places + bool fixedfmt; // false Print exactly SCALE chars after decimal point + amc::FField* p_field; // reference to parent row // x-reference on amc.FFdec.p_field prevents copy // func:amc.FFdec..AssignOp inline amc::FFdec& operator =(const amc::FFdec &rhs) = delete; @@ -11798,11 +12236,12 @@ void FFfast_Uninit(amc::FFfast& ffast) __attribute__((nothrow)); // global access: ind_fflag (Thash, hash field field) // access: amc.FField.c_fflag (Ptr) struct FFflag { // amc.FFflag - amc::FFflag* ind_fflag_next; // hash next - algo::Smallstr100 field; // - bool cumulative; // false Accumulate on every read - algo::cstring emptyval; // "" - algo::Comment comment; // + amc::FFflag* ind_fflag_next; // hash next + u32 ind_fflag_hashval; // hash value + algo::Smallstr100 field; // + bool cumulative; // false Accumulate on every read + algo::cstring emptyval; // "" + algo::Comment comment; // // func:amc.FFflag..AssignOp inline amc::FFflag& operator =(const amc::FFflag &rhs) = delete; // func:amc.FFflag..CopyCtor @@ -11837,19 +12276,18 @@ void FFflag_Uninit(amc::FFflag& fflag) __attribute__((nothrow)); // global access: ind_field (Thash, hash field field) // global access: c_malloc (Ptr) // global access: zs_ordkeyfield (Llist) -// global access: c_tempfield (Ptrary) // access: amc.FBasepool.p_field (Upptr) // access: amc.FBasepool.p_base (Upptr) // access: amc.FBitfld.p_srcfield (Upptr) // access: amc.FBitfld.p_field (Upptr) // access: amc.FCascdel.p_field (Upptr) // access: amc.FCtype.c_field (Ptrary) -// access: amc.FCtype.c_varlenfld (Ptr) // access: amc.FCtype.c_optfld (Ptr) // access: amc.FCtype.c_datafld (Ptrary) // access: amc.FCtype.zd_inst (Llist) // access: amc.FCtype.zd_access (Llist) // access: amc.FCtype.c_pkeyfield (Ptr) +// access: amc.FCtype.zd_varlenfld (Llist) // access: amc.FFalias.p_srcfield (Upptr) // access: amc.FFbigend.p_field (Upptr) // access: amc.FFbitset.p_field (Upptr) @@ -11896,11 +12334,14 @@ void FFflag_Uninit(amc::FFflag& fflag) __attribute__((nothrow)); // access: amc.Genpnew.p_optfld (Upptr) // access: amc.Genpnew.p_varlenfld (Upptr) struct FField { // amc.FField - amc::FField* zd_inst_next; // zslist link; -1 means not-in-list - amc::FField* zd_inst_prev; // previous element - amc::FField* zd_access_next; // zslist link; -1 means not-in-list - amc::FField* zd_access_prev; // previous element + amc::FField* ctype_zd_inst_next; // zslist link; -1 means not-in-list + amc::FField* ctype_zd_inst_prev; // previous element + amc::FField* ctype_zd_access_next; // zslist link; -1 means not-in-list + amc::FField* ctype_zd_access_prev; // previous element + amc::FField* ctype_zd_varlenfld_next; // zslist link; -1 means not-in-list + amc::FField* ctype_zd_varlenfld_prev; // previous element amc::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value amc::FField* zs_ordkeyfield_next; // zslist link; -1 means not-in-list algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field @@ -11989,8 +12430,9 @@ struct FField { // amc.FField amc::FPmaskfldMember** c_pmaskfld_member_elems; // array of pointers u32 c_pmaskfld_member_n; // array of pointers u32 c_pmaskfld_member_max; // capacity of allocated array + amc::FLenfld* c_lenfld; // optional pointer + amc::FFkafka* c_fkafka; // optional pointer bool ctype_c_datafld_in_ary; // false membership flag - bool _db_c_tempfield_in_ary; // false membership flag // x-reference on amc.FField.c_fsort prevents copy // x-reference on amc.FField.c_fbitset prevents copy // x-reference on amc.FField.c_smallstr prevents copy @@ -12048,6 +12490,8 @@ struct FField { // amc.FField // x-reference on amc.FField.c_ffast_mantissa prevents copy // reftype Ptrary of amc.FField.c_ffast prohibits copy // reftype Ptrary of amc.FField.c_pmaskfld_member prohibits copy + // x-reference on amc.FField.c_lenfld prevents copy + // x-reference on amc.FField.c_fkafka prevents copy // func:amc.FField..AssignOp amc::FField& operator =(const amc::FField &rhs) = delete; // x-reference on amc.FField.c_fsort prevents copy @@ -12107,6 +12551,8 @@ struct FField { // amc.FField // x-reference on amc.FField.c_ffast_mantissa prevents copy // reftype Ptrary of amc.FField.c_ffast prohibits copy // reftype Ptrary of amc.FField.c_pmaskfld_member prohibits copy + // x-reference on amc.FField.c_lenfld prevents copy + // x-reference on amc.FField.c_fkafka prevents copy // func:amc.FField..CopyCtor FField(const amc::FField &rhs) = delete; private: @@ -12459,7 +12905,7 @@ inline bool zd_xref_keyfld_EmptyQ(amc::FField& field) __attribute__((__ inline amc::FXref* zd_xref_keyfld_First(amc::FField& field) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc.FField.zd_xref_keyfld.InLlistQ -inline bool zd_xref_keyfld_InLlistQ(amc::FXref& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool field_zd_xref_keyfld_InLlistQ(amc::FXref& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc.FField.zd_xref_keyfld.Insert void zd_xref_keyfld_Insert(amc::FField& field, amc::FXref& row) __attribute__((nothrow)); @@ -12471,10 +12917,10 @@ inline amc::FXref* zd_xref_keyfld_Last(amc::FField& field) __attribute__((__wa inline i32 zd_xref_keyfld_N(const amc::FField& field) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc.FField.zd_xref_keyfld.Next -inline amc::FXref* zd_xref_keyfld_Next(amc::FXref &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FXref* field_zd_xref_keyfld_Next(amc::FXref &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:amc.FField.zd_xref_keyfld.Prev -inline amc::FXref* zd_xref_keyfld_Prev(amc::FXref &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FXref* field_zd_xref_keyfld_Prev(amc::FXref &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:amc.FField.zd_xref_keyfld.Remove void zd_xref_keyfld_Remove(amc::FField& field, amc::FXref& row) __attribute__((nothrow)); @@ -12496,7 +12942,7 @@ inline bool zs_fcmap_EmptyQ(amc::FField& field) __attribute__((__warn_u inline amc::FFcmap* zs_fcmap_First(amc::FField& field) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc.FField.zs_fcmap.InLlistQ -inline bool zs_fcmap_InLlistQ(amc::FFcmap& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool field_zs_fcmap_InLlistQ(amc::FFcmap& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc.FField.zs_fcmap.Insert void zs_fcmap_Insert(amc::FField& field, amc::FFcmap& row) __attribute__((nothrow)); @@ -12505,7 +12951,7 @@ void zs_fcmap_Insert(amc::FField& field, amc::FFcmap& row) __att inline amc::FFcmap* zs_fcmap_Last(amc::FField& field) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc.FField.zs_fcmap.Next -inline amc::FFcmap* zs_fcmap_Next(amc::FFcmap &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FFcmap* field_zs_fcmap_Next(amc::FFcmap &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. // func:amc.FField.zs_fcmap.Remove @@ -12733,6 +13179,20 @@ inline bool field_c_pmaskfld_member_InAryQ(amc::FPmaskfldMember& row) _ // func:amc.FField.c_pmaskfld_member.qLast inline amc::FPmaskfldMember& c_pmaskfld_member_qLast(amc::FField& field) __attribute__((nothrow)); +// Insert row into pointer index. Return final membership status. +// func:amc.FField.c_lenfld.InsertMaybe +inline bool c_lenfld_InsertMaybe(amc::FField& field, amc::FLenfld& row) __attribute__((nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:amc.FField.c_lenfld.Remove +inline void c_lenfld_Remove(amc::FField& field, amc::FLenfld& row) __attribute__((nothrow)); + +// Insert row into pointer index. Return final membership status. +// func:amc.FField.c_fkafka.InsertMaybe +inline bool c_fkafka_InsertMaybe(amc::FField& field, amc::FFkafka& row) __attribute__((nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:amc.FField.c_fkafka.Remove +inline void c_fkafka_Remove(amc::FField& field, amc::FFkafka& row) __attribute__((nothrow)); + // Set all fields to initial values. // func:amc.FField..Init void FField_Init(amc::FField& field); @@ -12894,6 +13354,45 @@ inline void FFinput_Init(amc::FFinput& finput); // func:amc.FFinput..Uninit void FFinput_Uninit(amc::FFinput& finput) __attribute__((nothrow)); +// --- amc.FFkafka +// create: amc.FDb.fkafka (Lary) +// global access: fkafka (Lary, by rowid) +// access: amc.FField.c_fkafka (Ptr) +struct FFkafka { // amc.FFkafka + algo::Smallstr100 field; // + algo::Smallstr10 versions; // + algo::Smallstr10 nullable_versions; // + algo::Smallstr10 tagged_versions; // + u64 tag; // 0 + algo::Comment comment; // + // func:amc.FFkafka..AssignOp + inline amc::FFkafka& operator =(const amc::FFkafka &rhs) = delete; + // func:amc.FFkafka..CopyCtor + inline FFkafka(const amc::FFkafka &rhs) = delete; +private: + // func:amc.FFkafka..Ctor + inline FFkafka() __attribute__((nothrow)); + // func:amc.FFkafka..Dtor + inline ~FFkafka() __attribute__((nothrow)); + friend amc::FFkafka& fkafka_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FFkafka* fkafka_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void fkafka_RemoveAll() __attribute__((nothrow)); + friend void fkafka_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:amc.FFkafka.base.CopyOut +void fkafka_CopyOut(amc::FFkafka &row, dmmeta::Fkafka &out) __attribute__((nothrow)); +// Copy fields in to row +// func:amc.FFkafka.base.CopyIn +void fkafka_CopyIn(amc::FFkafka &row, dmmeta::Fkafka &in) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:amc.FFkafka..Init +inline void FFkafka_Init(amc::FFkafka& fkafka); +// func:amc.FFkafka..Uninit +void FFkafka_Uninit(amc::FFkafka& fkafka) __attribute__((nothrow)); + // --- amc.FFldoffset // create: amc.FDb.fldoffset (Lary) // global access: fldoffset (Lary, by rowid) @@ -13046,11 +13545,12 @@ void FFoutput_Uninit(amc::FFoutput& foutput) __attribute__((noth // global access: ind_prefix (Thash, hash field fprefix) // access: amc.FReftype.zs_fprefix (Llist) struct FFprefix { // amc.FFprefix - amc::FFprefix* ind_prefix_next; // hash next - algo::Smallstr5 fprefix; // - algo::Smallstr50 reftype; // - algo::Comment comment; // - amc::FFprefix* zs_fprefix_next; // zslist link; -1 means not-in-list + amc::FFprefix* ind_prefix_next; // hash next + u32 ind_prefix_hashval; // hash value + algo::Smallstr5 fprefix; // + algo::Smallstr50 reftype; // + algo::Comment comment; // + amc::FFprefix* reftype_zs_fprefix_next; // zslist link; -1 means not-in-list // func:amc.FFprefix..AssignOp inline amc::FFprefix& operator =(const amc::FFprefix &rhs) = delete; // func:amc.FFprefix..CopyCtor @@ -13163,18 +13663,22 @@ void FFsort_Uninit(amc::FFsort& fsort) __attribute__((nothrow)); // access: amc.FNs.c_fstep (Ptrary) struct FFstep { // amc.FFstep amc::FFstep* ind_fstep_next; // hash next + u32 ind_fstep_hashval; // hash value algo::Smallstr100 fstep; // algo::Smallstr50 steptype; // algo::Comment comment; // amc::FFdelay* c_fdelay; // optional pointer amc::FField* p_field; // reference to parent row + amc::FSteptype* p_steptype; // reference to parent row bool ns_c_fstep_in_ary; // false membership flag // x-reference on amc.FFstep.c_fdelay prevents copy // x-reference on amc.FFstep.p_field prevents copy + // x-reference on amc.FFstep.p_steptype prevents copy // func:amc.FFstep..AssignOp amc::FFstep& operator =(const amc::FFstep &rhs) = delete; // x-reference on amc.FFstep.c_fdelay prevents copy // x-reference on amc.FFstep.p_field prevents copy + // x-reference on amc.FFstep.p_steptype prevents copy // func:amc.FFstep..CopyCtor FFstep(const amc::FFstep &rhs) = delete; private: @@ -13212,7 +13716,7 @@ inline void c_fdelay_Remove(amc::FFstep& fstep, amc::FFdelay& row) __at // Set all fields to initial values. // func:amc.FFstep..Init -inline void FFstep_Init(amc::FFstep& fstep); +void FFstep_Init(amc::FFstep& fstep); // func:amc.FFstep..Uninit void FFstep_Uninit(amc::FFstep& fstep) __attribute__((nothrow)); @@ -13260,23 +13764,26 @@ void FFtrace_Uninit(amc::FFtrace& ftrace) __attribute__((nothrow // access: amc.Genpnew.p_func (Upptr) struct FFunc { // amc.FFunc amc::FFunc* ind_func_next; // hash next + u32 ind_func_hashval; // hash value amc::FFunc* cd_temp_func_next; // zslist link; -1 means not-in-list amc::FFunc* cd_temp_func_prev; // previous element algo::Smallstr100 func; // Primary key bool extrn; // false Implemented externally by user algo::cstring comment; // Description amc::FNs* p_ns; // reference to parent row - bool inl; // false Make inline? + algo::cstring body; // Body of function + algo::cstring prepcond; // Preprocessor #if condition + algo::cstring proto; // Prototype algo::cstring nonnull; // List of non-null attributes + algo::StringAry initializer; // Initializer list (constructors only) + algo::cstring ret; // Return type (c++ expression) + algo::cstring acrkey; // Acr key due to which function was created amc::Funcarg* funcarg_elems; // pointer to elements u32 funcarg_n; // number of elements in array u32 funcarg_max; // max. capacity of array before realloc bool printed; // false Already printed? (internal) bool throws; // false Throws exceptions - algo::cstring proto; // Prototype bool nothrow; // false Definitely doesn't throw exception - bool oper; // false Is operator? - algo::cstring body; // Body of function bool member; // false Function is a member (print inside struct) bool disable; // false Function is enabled (if not, don't print) bool deprecate; // false Make deprecated? @@ -13287,15 +13794,13 @@ struct FFunc { // amc.FFunc bool glob; // false Function is not attached to a field (EXPLAIN!!) bool wur; // false Warn on unused result bool priv; // false Private to translateion unit (static) - algo::cstring ret; // Return type (c++ expression) bool pure; // false OK to call fewer times than specified in text bool isprivate; // false Applies to member functions only -- private bool finalized; // false Don't add any more code to me bool isexplicit; // false Is explicit constructor (add 'explicit') bool istmpl; // false Function is a template bool deleted; // false Function is marked as deleted - algo::cstring prepcond; // Preprocessor #if condition - algo::StringAry initializer; // Initializer list (constructors only) + bool inl; // false Make inline? bool ns_c_func_in_ary; // false membership flag // x-reference on amc.FFunc.p_ns prevents copy // func:amc.FFunc..AssignOp @@ -13348,6 +13853,11 @@ amc::Funcarg& funcarg_AllocAt(amc::FFunc& func, int at) __attribute__((__ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:amc.FFunc.funcarg.AllocN algo::aryptr funcarg_AllocN(amc::FFunc& func, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:amc.FFunc.funcarg.AllocNAt +algo::aryptr funcarg_AllocNAt(amc::FFunc& func, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:amc.FFunc.funcarg.EmptyQ inline bool funcarg_EmptyQ(amc::FFunc& func) __attribute__((nothrow)); @@ -13399,6 +13909,10 @@ inline u64 funcarg_rowid_Get(amc::FFunc& func, amc::Funcarg &elem) __a // Reserve space. Insert N elements at the end of the array, return pointer to array // func:amc.FFunc.funcarg.AllocNVal algo::aryptr funcarg_AllocNVal(amc::FFunc& func, int n_elems, const amc::Funcarg& val) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:amc.FFunc.funcarg.Insary +void funcarg_Insary(amc::FFunc& func, algo::aryptr rhs, int at) __attribute__((nothrow)); // Set all fields to initial values. // func:amc.FFunc..Init @@ -13488,6 +14002,7 @@ void FFuserinit_Uninit(amc::FFuserinit& fuserinit) __attribute__ // access: amc.FNs.c_fwddecl (Ptrary) struct FFwddecl { // amc.FFwddecl amc::FFwddecl* ind_fwddecl_next; // hash next + u32 ind_fwddecl_hashval; // hash value algo::Smallstr100 fwddecl; // bool ns_c_fwddecl_in_ary; // false membership flag // func:amc.FFwddecl..AssignOp @@ -13644,6 +14159,9 @@ void ind_seen_Remove(amc::FGenXref& parent, amc::FGenXrefSeen& r // Reserve enough room in the hash for N more elements. Return success code. // func:amc.FGenXref.ind_seen.Reserve void ind_seen_Reserve(amc::FGenXref& parent, int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc.FGenXref.ind_seen.AbsReserve +void ind_seen_AbsReserve(amc::FGenXref& parent, int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -13703,10 +14221,11 @@ void FGenXref_Uninit(amc::FGenXref& parent) __attribute__((nothr // create: amc.FGenXref.seen (Lary) // access: amc.FGenXref.ind_seen (Thash) struct FGenXrefSeen { // amc.FGenXrefSeen - amc::FGenXrefSeen* ind_seen_next; // hash next - algo::cstring value; // - algo::Smallstr100 via; // Saved via - algo::Smallstr100 xreffld; // Saved xreffld + amc::FGenXrefSeen* parent_ind_seen_next; // hash next + u32 parent_ind_seen_hashval; // hash value + algo::cstring value; // + algo::Smallstr100 via; // Saved via + algo::Smallstr100 xreffld; // Saved xreffld private: // func:amc.FGenXrefSeen..Ctor inline FGenXrefSeen() __attribute__((nothrow)); @@ -13818,7 +14337,6 @@ void FGsymbol_Uninit(amc::FGsymbol& gsymbol) __attribute__((noth // access: amc.FField.c_hook (Ptr) struct FHook { // amc.FHook algo::Smallstr100 field; // The field - algo::Comment comment; // amc::FCtype* p_funcptr; // reference to parent row amc::FField* p_field; // reference to parent row // x-reference on amc.FHook.p_field prevents copy @@ -13857,11 +14375,12 @@ void FHook_Uninit(amc::FHook& hook) __attribute__((nothrow)); // global access: ind_inlary (Thash, hash field field) // access: amc.FField.c_inlary (Ptr) struct FInlary { // amc.FInlary - amc::FInlary* ind_inlary_next; // hash next - algo::Smallstr100 field; // - i32 min; // 0 Min. elements to preallocate - i32 max; // 0 Max. elements - algo::Comment comment; // + amc::FInlary* ind_inlary_next; // hash next + u32 ind_inlary_hashval; // hash value + algo::Smallstr100 field; // + i32 min; // 0 Min. elements to preallocate + i32 max; // 0 Max. elements + algo::Comment comment; // // func:amc.FInlary..AssignOp inline amc::FInlary& operator =(const amc::FInlary &rhs) = delete; // func:amc.FInlary..CopyCtor @@ -13889,10 +14408,43 @@ inline void FInlary_Init(amc::FInlary& inlary); // func:amc.FInlary..Uninit void FInlary_Uninit(amc::FInlary& inlary) __attribute__((nothrow)); +// --- amc.FJstype +// create: amc.FDb.jstype (Lary) +// global access: jstype (Lary, by rowid) +// access: amc.FCtype.c_jstype (Ptr) +struct FJstype { // amc.FJstype + algo::Smallstr100 ctype; // + algo::Comment comment; // + // func:amc.FJstype..AssignOp + inline amc::FJstype& operator =(const amc::FJstype &rhs) = delete; + // func:amc.FJstype..CopyCtor + inline FJstype(const amc::FJstype &rhs) = delete; +private: + // func:amc.FJstype..Ctor + inline FJstype() __attribute__((nothrow)); + // func:amc.FJstype..Dtor + inline ~FJstype() __attribute__((nothrow)); + friend amc::FJstype& jstype_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FJstype* jstype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void jstype_RemoveAll() __attribute__((nothrow)); + friend void jstype_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:amc.FJstype.base.CopyOut +void jstype_CopyOut(amc::FJstype &row, dmmeta::Jstype &out) __attribute__((nothrow)); +// Copy fields in to row +// func:amc.FJstype.base.CopyIn +void jstype_CopyIn(amc::FJstype &row, dmmeta::Jstype &in) __attribute__((nothrow)); + +// func:amc.FJstype..Uninit +void FJstype_Uninit(amc::FJstype& jstype) __attribute__((nothrow)); + // --- amc.FLenfld // create: amc.FDb.lenfld (Lary) // global access: lenfld (Lary, by rowid) // access: amc.FCtype.c_lenfld (Ptr) +// access: amc.FField.c_lenfld (Ptr) struct FLenfld { // amc.FLenfld algo::Smallstr100 field; // Name of length field i32 extra; // 0 Extra #bytes to add @@ -13935,10 +14487,11 @@ void FLenfld_Uninit(amc::FLenfld& lenfld) __attribute__((nothrow // global access: ind_license (Thash, hash field license) // access: amc.FNs.p_license (Upptr) struct FLicense { // amc.FLicense - amc::FLicense* ind_license_next; // hash next - algo::Smallstr50 license; // - algo::Comment comment; // - algo::cstring text; // + amc::FLicense* ind_license_next; // hash next + u32 ind_license_hashval; // hash value + algo::Smallstr50 license; // + algo::Comment comment; // + algo::cstring text; // // func:amc.FLicense..AssignOp inline amc::FLicense& operator =(const amc::FLicense &rhs) = delete; // func:amc.FLicense..CopyCtor @@ -13973,11 +14526,12 @@ void FLicense_Uninit(amc::FLicense& license) __attribute__((noth // global access: ind_listtype (Thash, hash field listtype) // access: amc.FLlist.p_listtype (Upptr) struct FListtype { // amc.FListtype - amc::FListtype* ind_listtype_next; // hash next - algo::Smallstr5 listtype; // - bool circular; // false Circular list - bool haveprev; // false Previous link - bool instail; // false Queue + amc::FListtype* ind_listtype_next; // hash next + u32 ind_listtype_hashval; // hash value + algo::Smallstr5 listtype; // + bool circular; // false Circular list + bool haveprev; // false Previous link + bool instail; // false Queue // func:amc.FListtype..AssignOp inline amc::FListtype& operator =(const amc::FListtype &rhs) = delete; // func:amc.FListtype..CopyCtor @@ -14052,9 +14606,10 @@ void FLlist_Uninit(amc::FLlist& llist) __attribute__((nothrow)); // global access: ind_main (Thash, hash field ns) // access: amc.FNs.c_main (Ptr) struct FMain { // amc.FMain - amc::FMain* ind_main_next; // hash next - algo::Smallstr16 ns; // - bool ismodule; // false + amc::FMain* ind_main_next; // hash next + u32 ind_main_hashval; // hash value + algo::Smallstr16 ns; // + bool ismodule; // false // func:amc.FMain..AssignOp inline amc::FMain& operator =(const amc::FMain &rhs) = delete; // func:amc.FMain..CopyCtor @@ -14211,6 +14766,19 @@ void noxref_CopyIn(amc::FNoxref &row, dmmeta::Noxref &in) __attr // func:amc.FNoxref..Uninit void FNoxref_Uninit(amc::FNoxref& noxref) __attribute__((nothrow)); +// --- amc.JsNs +struct JsNs { // amc.JsNs + algo::cstring import; // + algo::cstring* mdl; // optional pointer + algo::cstring body; // + // func:amc.JsNs..Ctor + inline JsNs() __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:amc.JsNs..Init +inline void JsNs_Init(amc::JsNs& parent); + // --- amc.FNs // create: amc.FDb.ns (Lary) // global access: ns (Lary, by rowid) @@ -14231,6 +14799,7 @@ void FNoxref_Uninit(amc::FNoxref& noxref) __attribute__((nothrow // access: amc.Genctx.p_ns (Upptr) struct FNs { // amc.FNs amc::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value algo::Smallstr16 ns; // Namespace name (primary key) algo::Smallstr50 nstype; // Namespace type algo::Smallstr50 license; // Associated license @@ -14300,6 +14869,8 @@ struct FNs { // amc.FNs u32 c_nsinclude_max; // capacity of allocated array amc::FNscpp* c_nscpp; // optional pointer amc::FLicense* p_license; // reference to parent row + amc::JsNs js; // + amc::FNsjs* c_nsjs; // optional pointer // reftype Ptrary of amc.FNs.c_ctype prohibits copy // reftype Ptrary of amc.FNs.c_func prohibits copy // reftype Ptrary of amc.FNs.c_dispatch prohibits copy @@ -14324,6 +14895,7 @@ struct FNs { // amc.FNs // reftype Ptrary of amc.FNs.c_nsinclude prohibits copy // x-reference on amc.FNs.c_nscpp prevents copy // x-reference on amc.FNs.p_license prevents copy + // x-reference on amc.FNs.c_nsjs prevents copy // func:amc.FNs..AssignOp amc::FNs& operator =(const amc::FNs &rhs) = delete; // reftype Ptrary of amc.FNs.c_ctype prohibits copy @@ -14350,6 +14922,7 @@ struct FNs { // amc.FNs // reftype Ptrary of amc.FNs.c_nsinclude prohibits copy // x-reference on amc.FNs.c_nscpp prevents copy // x-reference on amc.FNs.p_license prevents copy + // x-reference on amc.FNs.c_nsjs prevents copy // func:amc.FNs..CopyCtor FNs(const amc::FNs &rhs) = delete; private: @@ -14559,6 +15132,11 @@ algo::cstring& include_AllocAt(amc::FNs& ns, int at) __attribute__((__warn // Reserve space. Insert N elements at the end of the array, return pointer to array // func:amc.FNs.include.AllocN algo::aryptr include_AllocN(amc::FNs& ns, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:amc.FNs.include.AllocNAt +algo::aryptr include_AllocNAt(amc::FNs& ns, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:amc.FNs.include.EmptyQ inline bool include_EmptyQ(amc::FNs& ns) __attribute__((nothrow)); @@ -14615,6 +15193,10 @@ algo::aryptr include_AllocNVal(amc::FNs& ns, int n_elems, const a // Function returns success value. // func:amc.FNs.include.ReadStrptrMaybe bool include_ReadStrptrMaybe(amc::FNs& ns, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:amc.FNs.include.Insary +void include_Insary(amc::FNs& ns, algo::aryptr rhs, int at) __attribute__((nothrow)); // Return true if index is empty // func:amc.FNs.c_dispsig.EmptyQ @@ -15095,6 +15677,13 @@ inline bool c_nscpp_InsertMaybe(amc::FNs& ns, amc::FNscpp& row) __attri // func:amc.FNs.c_nscpp.Remove inline void c_nscpp_Remove(amc::FNs& ns, amc::FNscpp& row) __attribute__((nothrow)); +// Insert row into pointer index. Return final membership status. +// func:amc.FNs.c_nsjs.InsertMaybe +inline bool c_nsjs_InsertMaybe(amc::FNs& ns, amc::FNsjs& row) __attribute__((nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:amc.FNs.c_nsjs.Remove +inline void c_nsjs_Remove(amc::FNs& ns, amc::FNsjs& row) __attribute__((nothrow)); + // Set all fields to initial values. // func:amc.FNs..Init void FNs_Init(amc::FNs& ns); @@ -15383,6 +15972,43 @@ inline void FNsinclude_Init(amc::FNsinclude& nsinclude); // func:amc.FNsinclude..Uninit void FNsinclude_Uninit(amc::FNsinclude& nsinclude) __attribute__((nothrow)); +// --- amc.FNsjs +// create: amc.FDb.nsjs (Lary) +// global access: nsjs (Lary, by rowid) +// access: amc.FNs.c_nsjs (Ptr) +struct FNsjs { // amc.FNsjs + algo::Smallstr16 ns; // + bool typescript; // false Generate typescript + bool gensel; // false Generate selected, false-all + algo::Comment comment; // + // func:amc.FNsjs..AssignOp + inline amc::FNsjs& operator =(const amc::FNsjs &rhs) = delete; + // func:amc.FNsjs..CopyCtor + inline FNsjs(const amc::FNsjs &rhs) = delete; +private: + // func:amc.FNsjs..Ctor + inline FNsjs() __attribute__((nothrow)); + // func:amc.FNsjs..Dtor + inline ~FNsjs() __attribute__((nothrow)); + friend amc::FNsjs& nsjs_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FNsjs* nsjs_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void nsjs_RemoveAll() __attribute__((nothrow)); + friend void nsjs_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:amc.FNsjs.base.CopyOut +void nsjs_CopyOut(amc::FNsjs &row, dmmeta::Nsjs &out) __attribute__((nothrow)); +// Copy fields in to row +// func:amc.FNsjs.base.CopyIn +void nsjs_CopyIn(amc::FNsjs &row, dmmeta::Nsjs &in) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:amc.FNsjs..Init +inline void FNsjs_Init(amc::FNsjs& nsjs); +// func:amc.FNsjs..Uninit +void FNsjs_Uninit(amc::FNsjs& nsjs) __attribute__((nothrow)); + // --- amc.FNsproto // create: amc.FDb.nsproto (Lary) // global access: nsproto (Lary, by rowid) @@ -15540,9 +16166,10 @@ void FOutfile_Uninit(amc::FOutfile& outfile) __attribute__((noth // global access: ind_pack (Thash, hash field ctype) // access: amc.FCtype.c_pack (Ptr) struct FPack { // amc.FPack - amc::FPack* ind_pack_next; // hash next - algo::Smallstr100 ctype; // Target ctype - amc::FCtype* p_ctype; // reference to parent row + amc::FPack* ind_pack_next; // hash next + u32 ind_pack_hashval; // hash value + algo::Smallstr100 ctype; // Target ctype + amc::FCtype* p_ctype; // reference to parent row // x-reference on amc.FPack.p_ctype prevents copy // func:amc.FPack..AssignOp inline amc::FPack& operator =(const amc::FPack &rhs) = delete; @@ -15581,6 +16208,7 @@ void FPack_Uninit(amc::FPack& pack) __attribute__((nothrow)); // access: amc.FPmaskfldMember.p_pmaskfld (Upptr) struct FPmaskfld { // amc.FPmaskfld amc::FPmaskfld* ind_pmaskfld_next; // hash next + u32 ind_pmaskfld_hashval; // hash value algo::Smallstr100 field; // bool filter_print; // true Omit non-present fields when printing algo::Comment comment; // @@ -15682,7 +16310,7 @@ void FPmaskfld_Uninit(amc::FPmaskfld& pmaskfld) __attribute__((n // access: amc.FField.c_pmaskfld_member (Ptrary) // access: amc.FPmaskfld.c_pmaskfld_member (Ptrary) struct FPmaskfldMember { // amc.FPmaskfldMember - algo::Smallstr100 pmaskfld_member; // + algo::Smallstr200 pmaskfld_member; // algo::Comment comment; // u32 bit; // 0 amc::FField* p_field; // reference to parent row @@ -15734,6 +16362,7 @@ void FPmaskfldMember_Uninit(amc::FPmaskfldMember& pmaskfld_membe // access: amc.FNs.c_pnew (Ptrary) struct FPnew { // amc.FPnew amc::FPnew* ind_pnew_next; // hash next + u32 ind_pnew_hashval; // hash value algo::Smallstr100 pnew; // amc::FCtype* p_ctype; // reference to parent row amc::FNs* p_ns; // reference to parent row @@ -15783,9 +16412,10 @@ void FPnew_Uninit(amc::FPnew& pnew) __attribute__((nothrow)); // global access: ptrary (Lary, by rowid) // access: amc.FField.c_ptrary (Ptr) struct FPtrary { // amc.FPtrary - algo::Smallstr100 field; // - bool unique; // false Search for and ignore duplicates - amc::FField* p_field; // reference to parent row + algo::Smallstr100 field; // + bool unique; // false Search for and ignore duplicates + bool heaplike; // false + amc::FField* p_field; // reference to parent row // x-reference on amc.FPtrary.p_field prevents copy // func:amc.FPtrary..AssignOp inline amc::FPtrary& operator =(const amc::FPtrary &rhs) = delete; @@ -15821,23 +16451,24 @@ void FPtrary_Uninit(amc::FPtrary& ptrary) __attribute__((nothrow // global access: ind_reftype (Thash, hash field reftype) // access: amc.FField.p_reftype (Upptr) struct FReftype { // amc.FReftype - amc::FReftype* ind_reftype_next; // hash next - algo::Smallstr50 reftype; // "Val" - bool isval; // false True if field makes values of target type - bool cascins; // false Field is cascade-insert - bool usebasepool; // false Fields with this type make use of dmmeta.basepool - bool cancopy; // false This type of field can be copied - bool isxref; // false This type of field is an x-ref - bool del; // false Supports random deletion? - bool up; // false This type of field is a reference - bool isnew; // false If set, skip this relation in amc_vis - bool hasalloc; // false Generte Alloc/Delete functions for arg type - bool inst; // false Field creates an instance of arg type (directly or indirectly) - bool varlen; // false This pool supports varlen allocations - i32 rowid; // 0 - amc::FTclass* p_tclass; // reference to parent row - amc::FFprefix* zs_fprefix_head; // zero-terminated singly linked list - amc::FFprefix* zs_fprefix_tail; // pointer to last element + amc::FReftype* ind_reftype_next; // hash next + u32 ind_reftype_hashval; // hash value + algo::Smallstr50 reftype; // "Val" + bool isval; // false True if field makes values of target type + bool cascins; // false Field is cascade-insert + bool usebasepool; // false Fields with this type make use of dmmeta.basepool + bool cancopy; // false This type of field can be copied + bool isxref; // false This type of field is an x-ref + bool del; // false Supports random deletion? + bool up; // false This type of field is a reference + bool isnew; // false If set, skip this relation in amc_vis + bool hasalloc; // false Generte Alloc/Delete functions for arg type + bool inst; // false Field creates an instance of arg type (directly or indirectly) + bool varlen; // false This pool supports varlen allocations + i32 rowid; // 0 + amc::FTclass* p_tclass; // reference to parent row + amc::FFprefix* zs_fprefix_head; // zero-terminated singly linked list + amc::FFprefix* zs_fprefix_tail; // pointer to last element // x-reference on amc.FReftype.p_tclass prevents copy // reftype Llist of amc.FReftype.zs_fprefix prohibits copy // func:amc.FReftype..AssignOp @@ -15872,7 +16503,7 @@ inline bool zs_fprefix_EmptyQ(amc::FReftype& reftype) __attribute__((__ inline amc::FFprefix* zs_fprefix_First(amc::FReftype& reftype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc.FReftype.zs_fprefix.InLlistQ -inline bool zs_fprefix_InLlistQ(amc::FFprefix& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool reftype_zs_fprefix_InLlistQ(amc::FFprefix& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc.FReftype.zs_fprefix.Insert void zs_fprefix_Insert(amc::FReftype& reftype, amc::FFprefix& row) __attribute__((nothrow)); @@ -15881,7 +16512,7 @@ void zs_fprefix_Insert(amc::FReftype& reftype, amc::FFprefix& ro inline amc::FFprefix* zs_fprefix_Last(amc::FReftype& reftype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc.FReftype.zs_fprefix.Next -inline amc::FFprefix* zs_fprefix_Next(amc::FFprefix &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc::FFprefix* reftype_zs_fprefix_Next(amc::FFprefix &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // Since the list is singly-linked, use linear search to locate the element. // func:amc.FReftype.zs_fprefix.Remove @@ -15920,9 +16551,10 @@ void FReftype_Uninit(amc::FReftype& reftype) __attribute__((noth // global access: ind_rowid (Thash, hash field field) // access: amc.FField.c_rowid (Ptr) struct FRowid { // amc.FRowid - amc::FRowid* ind_rowid_next; // hash next - algo::Smallstr100 field; // - algo::Comment comment; // + amc::FRowid* ind_rowid_next; // hash next + u32 ind_rowid_hashval; // hash value + algo::Smallstr100 field; // + algo::Comment comment; // // func:amc.FRowid..AssignOp inline amc::FRowid& operator =(const amc::FRowid &rhs) = delete; // func:amc.FRowid..CopyCtor @@ -15956,14 +16588,15 @@ void FRowid_Uninit(amc::FRowid& rowid) __attribute__((nothrow)); // global access: ind_smallstr (Thash, hash field field) // access: amc.FField.c_smallstr (Ptr) struct FSmallstr { // amc.FSmallstr - amc::FSmallstr* ind_smallstr_next; // hash next - algo::Smallstr100 field; // - i32 length; // 0 Maximum characters in the string - algo::Smallstr50 strtype; // Data format for string - algo::CppExpr pad; // Pad character (if applicable) - bool strict; // false - amc::FField* p_field; // reference to parent row - amc::FNumstr* c_numstr; // optional pointer + amc::FSmallstr* ind_smallstr_next; // hash next + u32 ind_smallstr_hashval; // hash value + algo::Smallstr100 field; // + i32 length; // 0 Maximum characters in the string + algo::Smallstr50 strtype; // Data format for string + algo::CppExpr pad; // Pad character (if applicable) + bool strict; // false + amc::FField* p_field; // reference to parent row + amc::FNumstr* c_numstr; // optional pointer // x-reference on amc.FSmallstr.p_field prevents copy // x-reference on amc.FSmallstr.c_numstr prevents copy // func:amc.FSmallstr..AssignOp @@ -16052,18 +16685,19 @@ void FSortfld_Uninit(amc::FSortfld& sortfld) __attribute__((noth // access: amc.FGsymbol.p_ssimfile (Upptr) // access: amc.FSsimsort.p_ssimfile (Upptr) struct FSsimfile { // amc.FSsimfile - amc::FSsimfile* ind_ssimfile_next; // hash next - amc::FSsimfile* zd_ssimfile_todo_next; // zslist link; -1 means not-in-list - amc::FSsimfile* zd_ssimfile_todo_prev; // previous element - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - algo::cstring ssim; // Ssim content - amc::FCtype* p_ctype; // reference to parent row - amc::FSsimvolatile* c_ssimvolatile; // optional pointer - bool topovisit; // false - i32 topoindex; // 0 - bool input_select; // false - bool _db_c_ssimfile_sorted_in_ary; // false membership flag + amc::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + amc::FSsimfile* zd_ssimfile_todo_next; // zslist link; -1 means not-in-list + amc::FSsimfile* zd_ssimfile_todo_prev; // previous element + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + algo::cstring ssim; // Ssim content + amc::FCtype* p_ctype; // reference to parent row + amc::FSsimvolatile* c_ssimvolatile; // optional pointer + bool topovisit; // false + i32 topoindex; // 0 + bool input_select; // false + bool c_ssimfile_sorted_in_ary; // false membership flag // x-reference on amc.FSsimfile.p_ctype prevents copy // x-reference on amc.FSsimfile.c_ssimvolatile prevents copy // func:amc.FSsimfile..AssignOp @@ -16202,6 +16836,44 @@ inline void FStatictuple_Init(amc::FStatictuple& static_tuple); // func:amc.FStatictuple..Uninit void FStatictuple_Uninit(amc::FStatictuple& static_tuple) __attribute__((nothrow)); +// --- amc.FSteptype +// create: amc.FDb.steptype (Lary) +// global access: steptype (Lary, by rowid) +// global access: ind_steptype (Thash, hash field steptype) +// access: amc.FFstep.p_steptype (Upptr) +struct FSteptype { // amc.FSteptype + amc::FSteptype* ind_steptype_next; // hash next + u32 ind_steptype_hashval; // hash value + algo::Smallstr50 steptype; // + algo::Comment comment; // + // func:amc.FSteptype..AssignOp + inline amc::FSteptype& operator =(const amc::FSteptype &rhs) = delete; + // func:amc.FSteptype..CopyCtor + inline FSteptype(const amc::FSteptype &rhs) = delete; +private: + // func:amc.FSteptype..Ctor + inline FSteptype() __attribute__((nothrow)); + // func:amc.FSteptype..Dtor + inline ~FSteptype() __attribute__((nothrow)); + friend amc::FSteptype& steptype_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FSteptype* steptype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void steptype_RemoveAll() __attribute__((nothrow)); + friend void steptype_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:amc.FSteptype.base.CopyOut +void steptype_CopyOut(amc::FSteptype &row, dmmeta::Steptype &out) __attribute__((nothrow)); +// Copy fields in to row +// func:amc.FSteptype.base.CopyIn +void steptype_CopyIn(amc::FSteptype &row, dmmeta::Steptype &in) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:amc.FSteptype..Init +inline void FSteptype_Init(amc::FSteptype& steptype); +// func:amc.FSteptype..Uninit +void FSteptype_Uninit(amc::FSteptype& steptype) __attribute__((nothrow)); + // --- amc.FSubstr // create: amc.FDb.substr (Lary) // global access: substr (Lary, by rowid) @@ -16209,15 +16881,15 @@ void FStatictuple_Uninit(amc::FStatictuple& static_tuple) __attr // global access: c_substr_field (Ptrary) // access: amc.FField.c_substr (Ptr) struct FSubstr { // amc.FSubstr - amc::FSubstr* zd_substr_params_next; // zslist link; -1 means not-in-list - amc::FSubstr* zd_substr_params_prev; // previous element - algo::Smallstr100 field; // - algo::CppExpr expr; // - algo::Smallstr100 srcfield; // - amc::FField* p_field; // reference to parent row - amc::FField* p_srcfield; // reference to parent row - u64 range; // 0 - bool _db_c_substr_field_in_ary; // false membership flag + amc::FSubstr* zd_substr_params_next; // zslist link; -1 means not-in-list + amc::FSubstr* zd_substr_params_prev; // previous element + algo::Smallstr100 field; // + algo::CppExpr expr; // + algo::Smallstr100 srcfield; // + amc::FField* p_field; // reference to parent row + amc::FField* p_srcfield; // reference to parent row + u64 range; // 0 + bool c_substr_field_in_ary; // false membership flag // x-reference on amc.FSubstr.p_field prevents copy // x-reference on amc.FSubstr.p_srcfield prevents copy // func:amc.FSubstr..AssignOp @@ -16303,12 +16975,13 @@ void FTargdep_Uninit(amc::FTargdep& targdep) __attribute__((noth // access: amc.FTargdep.p_target (Upptr) // access: amc.FTargdep.p_parent (Upptr) struct FTarget { // amc.FTarget - amc::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target - amc::FTargdep** c_targdep_elems; // array of pointers - u32 c_targdep_n; // array of pointers - u32 c_targdep_max; // capacity of allocated array - amc::FNs* p_ns; // reference to parent row + amc::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target + amc::FTargdep** c_targdep_elems; // array of pointers + u32 c_targdep_n; // array of pointers + u32 c_targdep_max; // capacity of allocated array + amc::FNs* p_ns; // reference to parent row // reftype Ptrary of amc.FTarget.c_targdep prohibits copy // x-reference on amc.FTarget.p_ns prevents copy // func:amc.FTarget..AssignOp @@ -16397,10 +17070,11 @@ void FTarget_Uninit(amc::FTarget& target) __attribute__((nothrow // global access: ind_tary (Thash, hash field field) // access: amc.FField.c_tary (Ptr) struct FTary { // amc.FTary - amc::FTary* ind_tary_next; // hash next - algo::Smallstr100 field; // - bool aliased; // false Geneate functions to copy from aryptr - amc::FField* p_field; // reference to parent row + amc::FTary* ind_tary_next; // hash next + u32 ind_tary_hashval; // hash value + algo::Smallstr100 field; // + bool aliased; // false Geneate functions to copy from aryptr + amc::FField* p_field; // reference to parent row // x-reference on amc.FTary.p_field prevents copy // func:amc.FTary..AssignOp inline amc::FTary& operator =(const amc::FTary &rhs) = delete; @@ -16477,6 +17151,7 @@ void FTcurs_Uninit(amc::FTcurs& tcurs) __attribute__((nothrow)); // access: amc.Genctx.p_tfunc (Upptr) struct FTfunc { // amc.FTfunc amc::FTfunc* ind_tfunc_next; // hash next + u32 ind_tfunc_hashval; // hash value algo::Smallstr50 tfunc; // bool hasthrow; // false Important defaults for new tfuncs to work bool leaf; // true Important defaults for new tfuncs to work @@ -16681,6 +17356,31 @@ inline void FTypefld_Init(amc::FTypefld& typefld); // func:amc.FTypefld..Uninit void FTypefld_Uninit(amc::FTypefld& typefld) __attribute__((nothrow)); +// --- amc.FUserfunc +// create: amc.FDb.userfunc (Lary) +// global access: userfunc (Lary, by rowid) +struct FUserfunc { // amc.FUserfunc + algo::Smallstr50 userfunc; // + algo::Smallstr200 acrkey; // + algo::Smallstr100 cppname; // + algo::Comment comment; // +private: + // func:amc.FUserfunc..Ctor + inline FUserfunc() __attribute__((nothrow)); + friend amc::FUserfunc& userfunc_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FUserfunc* userfunc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void userfunc_RemoveAll() __attribute__((nothrow)); + friend void userfunc_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:amc.FUserfunc.base.CopyOut +void userfunc_CopyOut(amc::FUserfunc &row, dmmeta::Userfunc &out) __attribute__((nothrow)); +// Copy fields in to row +// func:amc.FUserfunc.base.CopyIn +void userfunc_CopyIn(amc::FUserfunc &row, dmmeta::Userfunc &in) __attribute__((nothrow)); + + // --- amc.FUsertracefld // create: amc.FDb.usertracefld (Lary) // global access: usertracefld (Lary, by rowid) @@ -16711,18 +17411,19 @@ void usertracefld_CopyIn(amc::FUsertracefld &row, dmmeta::Usertr // access: amc.FField.c_xref (Ptr) // access: amc.FField.zd_xref_keyfld (Llist) struct FXref { // amc.FXref - amc::FXref* zs_xref_next; // zslist link; -1 means not-in-list - amc::FXref* ind_xref_next; // hash next - amc::FXref* zd_xref_keyfld_next; // zslist link; -1 means not-in-list - amc::FXref* zd_xref_keyfld_prev; // previous element - algo::Smallstr100 field; // - algo::CppExpr inscond; // "true" Insert condition - algo::Smallstr200 via; // - amc::FField* p_field; // reference to parent row - amc::FCtype* p_ctype; // reference to parent row - amc::FNocascdel* c_nocascdel; // optional pointer - amc::FField* p_viafld; // reference to parent row - amc::FField* p_keyfld; // reference to parent row + amc::FXref* ctype_zs_xref_next; // zslist link; -1 means not-in-list + amc::FXref* ind_xref_next; // hash next + u32 ind_xref_hashval; // hash value + amc::FXref* field_zd_xref_keyfld_next; // zslist link; -1 means not-in-list + amc::FXref* field_zd_xref_keyfld_prev; // previous element + algo::Smallstr100 field; // + algo::CppExpr inscond; // "true" Insert condition + algo::Smallstr200 via; // + amc::FField* p_field; // reference to parent row + amc::FCtype* p_ctype; // reference to parent row + amc::FNocascdel* c_nocascdel; // optional pointer + amc::FField* p_viafld; // reference to parent row + amc::FField* p_keyfld; // reference to parent row // x-reference on amc.FXref.p_field prevents copy // x-reference on amc.FXref.c_nocascdel prevents copy // x-reference on amc.FXref.p_viafld prevents copy @@ -17092,6 +17793,15 @@ struct ctype_c_ffast_curs {// fcurs:amc.FCtype.c_ffast/curs }; +struct ctype_zd_varlenfld_curs {// fcurs:amc.FCtype.zd_varlenfld/curs + typedef amc::FField ChildType; + amc::FField* row; + ctype_zd_varlenfld_curs() { + row = NULL; + } +}; + + struct tclass_c_tfunc_curs {// fcurs:amc.FTclass.c_tfunc/curs typedef amc::FTfunc ChildType; amc::FTfunc** elems; @@ -17620,15 +18330,6 @@ struct _db_dispsig_curs {// cursor }; -struct _db_c_dispsig_sorted_curs {// fcurs:amc.FDb.c_dispsig_sorted/curs - typedef amc::FDispsig ChildType; - amc::FDispsig** elems; - u32 n_elems; - u32 index; - _db_c_dispsig_sorted_curs() { elems=NULL; n_elems=0; index=0; } -}; - - struct _db_zs_sig_visit_curs {// fcurs:amc.FDb.zs_sig_visit/curs typedef amc::FCtype ChildType; amc::FCtype* row; @@ -17905,24 +18606,6 @@ struct _db_ctypelen_curs {// cursor }; -struct _db_c_ctypelen_curs {// fcurs:amc.FDb.c_ctypelen/curs - typedef amc::FCtypelen ChildType; - amc::FCtypelen** elems; - u32 n_elems; - u32 index; - _db_c_ctypelen_curs() { elems=NULL; n_elems=0; index=0; } -}; - - -struct _db_c_tempfield_curs {// fcurs:amc.FDb.c_tempfield/curs - typedef amc::FField ChildType; - amc::FField** elems; - u32 n_elems; - u32 index; - _db_c_tempfield_curs() { elems=NULL; n_elems=0; index=0; } -}; - - struct _db_fbase_curs {// cursor typedef amc::FFbase ChildType; amc::FDb *parent; @@ -18129,6 +18812,54 @@ struct _db_fbuftype_curs {// cursor }; +struct _db_nsjs_curs {// cursor + typedef amc::FNsjs ChildType; + amc::FDb *parent; + i64 index; + _db_nsjs_curs(){ parent=NULL; index=0; } +}; + + +struct _db_jstype_curs {// cursor + typedef amc::FJstype ChildType; + amc::FDb *parent; + i64 index; + _db_jstype_curs(){ parent=NULL; index=0; } +}; + + +struct _db_ckafka_curs {// cursor + typedef amc::FCkafka ChildType; + amc::FDb *parent; + i64 index; + _db_ckafka_curs(){ parent=NULL; index=0; } +}; + + +struct _db_fkafka_curs {// cursor + typedef amc::FFkafka ChildType; + amc::FDb *parent; + i64 index; + _db_fkafka_curs(){ parent=NULL; index=0; } +}; + + +struct _db_userfunc_curs {// cursor + typedef amc::FUserfunc ChildType; + amc::FDb *parent; + i64 index; + _db_userfunc_curs(){ parent=NULL; index=0; } +}; + + +struct _db_steptype_curs {// cursor + typedef amc::FSteptype ChildType; + amc::FDb *parent; + i64 index; + _db_steptype_curs(){ parent=NULL; index=0; } +}; + + struct dispatch_c_dispatch_msg_curs {// fcurs:amc.FDispatch.c_dispatch_msg/curs typedef amc::FDispatchmsg ChildType; amc::FDispatchmsg** elems; @@ -19139,6 +19870,14 @@ void tfunc_Ctype_FastEncode(); // this function is 'extrn' and implemented by user void tfunc_Ctype_FastDecode(); // User-implemented function from gstatic:amc.FDb.tfunc +// func:amc...tfunc_Ctype_KafkaEncode +// this function is 'extrn' and implemented by user +void tfunc_Ctype_KafkaEncode(); +// User-implemented function from gstatic:amc.FDb.tfunc +// func:amc...tfunc_Ctype_KafkaDecode +// this function is 'extrn' and implemented by user +void tfunc_Ctype_KafkaDecode(); +// User-implemented function from gstatic:amc.FDb.tfunc // func:amc...tfunc_Ctype_AssignOp // this function is 'extrn' and implemented by user void tfunc_Ctype_AssignOp(); @@ -19323,6 +20062,10 @@ void tfunc_Fbuf_SkipMsg(); // this function is 'extrn' and implemented by user void tfunc_Fbuf_WriteAll(); // User-implemented function from gstatic:amc.FDb.tfunc +// func:amc...tfunc_Fbuf_WriteReserve +// this function is 'extrn' and implemented by user +void tfunc_Fbuf_WriteReserve(); +// User-implemented function from gstatic:amc.FDb.tfunc // func:amc...tfunc_Fbuf_WriteMsg // this function is 'extrn' and implemented by user void tfunc_Fbuf_WriteMsg(); @@ -19839,6 +20582,14 @@ void tfunc_Ptrary_Getary(); // this function is 'extrn' and implemented by user void tfunc_Ptrary_Init(); // User-implemented function from gstatic:amc.FDb.tfunc +// func:amc...tfunc_Ptrary_First +// this function is 'extrn' and implemented by user +void tfunc_Ptrary_First(); +// User-implemented function from gstatic:amc.FDb.tfunc +// func:amc...tfunc_Ptrary_Last +// this function is 'extrn' and implemented by user +void tfunc_Ptrary_Last(); +// User-implemented function from gstatic:amc.FDb.tfunc // func:amc...tfunc_Ptrary_Insert // this function is 'extrn' and implemented by user void tfunc_Ptrary_Insert(); @@ -19875,10 +20626,18 @@ void tfunc_Ptrary_Uninit(); // this function is 'extrn' and implemented by user void tfunc_Ptrary_curs(); // User-implemented function from gstatic:amc.FDb.tfunc +// func:amc...tfunc_Ptrary_RemoveFirst +// this function is 'extrn' and implemented by user +void tfunc_Ptrary_RemoveFirst(); +// User-implemented function from gstatic:amc.FDb.tfunc // func:amc...tfunc_Ptrary_oncecurs // this function is 'extrn' and implemented by user void tfunc_Ptrary_oncecurs(); // User-implemented function from gstatic:amc.FDb.tfunc +// func:amc...tfunc_Ptrary_RemoveLast +// this function is 'extrn' and implemented by user +void tfunc_Ptrary_RemoveLast(); +// User-implemented function from gstatic:amc.FDb.tfunc // func:amc...tfunc_Ptrary_qFind // this function is 'extrn' and implemented by user void tfunc_Ptrary_qFind(); @@ -19939,10 +20698,6 @@ void tfunc_Smallstr_AddStrptr(); // this function is 'extrn' and implemented by user void tfunc_Smallstr_Getary(); // User-implemented function from gstatic:amc.FDb.tfunc -// func:amc...tfunc_Smallstr_HashStrptr -// this function is 'extrn' and implemented by user -void tfunc_Smallstr_HashStrptr(); -// User-implemented function from gstatic:amc.FDb.tfunc // func:amc...tfunc_Smallstr_Init // this function is 'extrn' and implemented by user void tfunc_Smallstr_Init(); @@ -20071,6 +20826,10 @@ void tfunc_Tary_AllocAt(); // this function is 'extrn' and implemented by user void tfunc_Tary_AllocN(); // User-implemented function from gstatic:amc.FDb.tfunc +// func:amc...tfunc_Tary_AllocNAt +// this function is 'extrn' and implemented by user +void tfunc_Tary_AllocNAt(); +// User-implemented function from gstatic:amc.FDb.tfunc // func:amc...tfunc_Tary_EmptyQ // this function is 'extrn' and implemented by user void tfunc_Tary_EmptyQ(); @@ -20171,6 +20930,10 @@ void tfunc_Tary_AllocNVal(); // this function is 'extrn' and implemented by user void tfunc_Tary_ReadStrptrMaybe(); // User-implemented function from gstatic:amc.FDb.tfunc +// func:amc...tfunc_Tary_Insary +// this function is 'extrn' and implemented by user +void tfunc_Tary_Insary(); +// User-implemented function from gstatic:amc.FDb.tfunc // func:amc...tfunc_Thash_Cascdel // this function is 'extrn' and implemented by user void tfunc_Thash_Cascdel(); @@ -20211,6 +20974,10 @@ void tfunc_Thash_Remove(); // this function is 'extrn' and implemented by user void tfunc_Thash_Reserve(); // User-implemented function from gstatic:amc.FDb.tfunc +// func:amc...tfunc_Thash_AbsReserve +// this function is 'extrn' and implemented by user +void tfunc_Thash_AbsReserve(); +// User-implemented function from gstatic:amc.FDb.tfunc // func:amc...tfunc_Thash_FindRemove // this function is 'extrn' and implemented by user void tfunc_Thash_FindRemove(); @@ -20291,6 +21058,10 @@ void tfunc_Varlen_curs(); // this function is 'extrn' and implemented by user void tfunc_Varlen_Print(); // User-implemented function from gstatic:amc.FDb.tfunc +// func:amc...tfunc_Varlen_Init +// this function is 'extrn' and implemented by user +void tfunc_Varlen_Init(); +// User-implemented function from gstatic:amc.FDb.tfunc // func:amc...tfunc_ZSListMT_DestructiveFirst // this function is 'extrn' and implemented by user void tfunc_ZSListMT_DestructiveFirst(); @@ -20647,9 +21418,33 @@ void gen_ns_operators(); // this function is 'extrn' and implemented by user void gen_ns_check_lim(); // User-implemented function from gstatic:amc.FDb.gen +// func:amc...gen_create_userfunc +// this function is 'extrn' and implemented by user +void gen_create_userfunc(); +// User-implemented function from gstatic:amc.FDb.gen +// func:amc...gen_nsjs_field +// this function is 'extrn' and implemented by user +void gen_nsjs_field(); +// User-implemented function from gstatic:amc.FDb.gen +// func:amc...gen_nsjs_ctype +// this function is 'extrn' and implemented by user +void gen_nsjs_ctype(); +// User-implemented function from gstatic:amc.FDb.gen +// func:amc...gen_nsjs_ns +// this function is 'extrn' and implemented by user +void gen_nsjs_ns(); +// User-implemented function from gstatic:amc.FDb.gen +// func:amc...gen_nsjs_module +// this function is 'extrn' and implemented by user +void gen_nsjs_module(); +// User-implemented function from gstatic:amc.FDb.gen // func:amc...gen_ns_write // this function is 'extrn' and implemented by user void gen_ns_write(); +// User-implemented function from gstatic:amc.FDb.gen +// func:amc...gen_table_write +// this function is 'extrn' and implemented by user +void gen_table_write(); // func:amc...StaticCheck void StaticCheck(); } // gen:ns_func diff --git a/include/gen/amc_gen.inl.h b/include/gen/amc_gen.inl.h index 8a77bafa..6f93e105 100644 --- a/include/gen/amc_gen.inl.h +++ b/include/gen/amc_gen.inl.h @@ -306,7 +306,7 @@ inline void amc::FBitfld_Init(amc::FBitfld& bitfld) { bitfld.width = i32(0); bitfld.p_srcfield = NULL; bitfld.p_field = NULL; - bitfld.bh_bitfld_idx = -1; // (amc.FField.bh_bitfld) not-in-heap + bitfld.field_bh_bitfld_idx = -1; // (amc.FField.bh_bitfld) not-in-heap } // --- amc.FBitfld..Ctor @@ -326,6 +326,7 @@ inline void amc::FBltin_Init(amc::FBltin& bltin) { bltin.bigendok = bool(false); bltin.issigned = bool(false); bltin.ind_bltin_next = (amc::FBltin*)-1; // (amc.FDb.ind_bltin) not-in-hash + bltin.ind_bltin_hashval = 0; // stored hash value } // --- amc.FBltin..Ctor @@ -342,8 +343,8 @@ inline amc::FBltin::~FBltin() { // Set all fields to initial values. inline void amc::FCafter_Init(amc::FCafter& cafter) { cafter.p_after = NULL; - cafter.zd_cafter_next = (amc::FCafter*)-1; // (amc.FCtype.zd_cafter) not-in-list - cafter.zd_cafter_prev = NULL; // (amc.FCtype.zd_cafter) + cafter.ctype_zd_cafter_next = (amc::FCafter*)-1; // (amc.FCtype.zd_cafter) not-in-list + cafter.ctype_zd_cafter_prev = NULL; // (amc.FCtype.zd_cafter) } // --- amc.FCafter..Ctor @@ -380,6 +381,7 @@ inline void amc::FCcmp_Init(amc::FCcmp& ccmp) { ccmp.order = bool(false); ccmp.minmax = bool(false); ccmp.ind_ccmp_next = (amc::FCcmp*)-1; // (amc.FDb.ind_ccmp) not-in-hash + ccmp.ind_ccmp_hashval = 0; // stored hash value } // --- amc.FCcmp..Ctor @@ -442,8 +444,9 @@ inline void amc::FCfmt_Init(amc::FCfmt& cfmt) { cfmt.read = bool(false); cfmt.print = bool(false); cfmt.genop = bool(false); - cfmt.zs_cfmt_next = (amc::FCfmt*)-1; // (amc.FCtype.zs_cfmt) not-in-list + cfmt.ctype_zs_cfmt_next = (amc::FCfmt*)-1; // (amc.FCtype.zs_cfmt) not-in-list cfmt.ind_cfmt_next = (amc::FCfmt*)-1; // (amc.FDb.ind_cfmt) not-in-hash + cfmt.ind_cfmt_hashval = 0; // stored hash value } // --- amc.FCfmt..Ctor @@ -488,6 +491,7 @@ inline amc::FCharset::~FCharset() { // Set all fields to initial values. inline void amc::FChash_Init(amc::FChash& chash) { chash.ind_chash_next = (amc::FChash*)-1; // (amc.FDb.ind_chash) not-in-hash + chash.ind_chash_hashval = 0; // stored hash value } // --- amc.FChash..Ctor @@ -500,6 +504,15 @@ inline amc::FChash::~FChash() { amc::FChash_Uninit(*this); } +// --- amc.FCkafka..Ctor +inline amc::FCkafka::FCkafka() { +} + +// --- amc.FCkafka..Dtor +inline amc::FCkafka::~FCkafka() { + amc::FCkafka_Uninit(*this); +} + // --- amc.FCppfunc..Init // Set all fields to initial values. inline void amc::FCppfunc_Init(amc::FCppfunc& cppfunc) { @@ -525,6 +538,7 @@ inline void amc::FCpptype_Init(amc::FCpptype& cpptype) { cpptype.cheap_copy = bool(false); cpptype.p_ctype = NULL; cpptype.ind_cpptype_next = (amc::FCpptype*)-1; // (amc.FDb.ind_cpptype) not-in-hash + cpptype.ind_cpptype_hashval = 0; // stored hash value } // --- amc.FCpptype..Ctor @@ -570,6 +584,10 @@ inline amc::FCstr::~FCstr() { amc::FCstr_Uninit(*this); } +// --- amc.JsCtype..Ctor +inline amc::JsCtype::JsCtype() { +} + // --- amc.FCtype.zs_cfmt.EmptyQ // Return true if index is empty inline bool amc::zs_cfmt_EmptyQ(amc::FCtype& ctype) { @@ -586,9 +604,9 @@ inline amc::FCfmt* amc::zs_cfmt_First(amc::FCtype& ctype) { // --- amc.FCtype.zs_cfmt.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool amc::zs_cfmt_InLlistQ(amc::FCfmt& row) { +inline bool amc::ctype_zs_cfmt_InLlistQ(amc::FCfmt& row) { bool result = false; - result = !(row.zs_cfmt_next == (amc::FCfmt*)-1); + result = !(row.ctype_zs_cfmt_next == (amc::FCfmt*)-1); return result; } @@ -602,8 +620,8 @@ inline amc::FCfmt* amc::zs_cfmt_Last(amc::FCtype& ctype) { // --- amc.FCtype.zs_cfmt.Next // Return pointer to next element in the list -inline amc::FCfmt* amc::zs_cfmt_Next(amc::FCfmt &row) { - return row.zs_cfmt_next; +inline amc::FCfmt* amc::ctype_zs_cfmt_Next(amc::FCfmt &row) { + return row.ctype_zs_cfmt_next; } // --- amc.FCtype.zs_cfmt.qLast @@ -702,26 +720,6 @@ inline void amc::c_msgtype_Remove(amc::FCtype& ctype, amc::FMsgtype& row) { } } -// --- amc.FCtype.c_varlenfld.InsertMaybe -// Insert row into pointer index. Return final membership status. -inline bool amc::c_varlenfld_InsertMaybe(amc::FCtype& ctype, amc::FField& row) { - amc::FField* ptr = ctype.c_varlenfld; - bool retval = (ptr == NULL) | (ptr == &row); - if (retval) { - ctype.c_varlenfld = &row; - } - return retval; -} - -// --- amc.FCtype.c_varlenfld.Remove -// Remove element from index. If element is not in index, do nothing. -inline void amc::c_varlenfld_Remove(amc::FCtype& ctype, amc::FField& row) { - amc::FField *ptr = ctype.c_varlenfld; - if (LIKELY(ptr == &row)) { - ctype.c_varlenfld = NULL; - } -} - // --- amc.FCtype.c_optfld.InsertMaybe // Insert row into pointer index. Return final membership status. inline bool amc::c_optfld_InsertMaybe(amc::FCtype& ctype, amc::FField& row) { @@ -1080,9 +1078,9 @@ inline amc::FField* amc::zd_inst_First(amc::FCtype& ctype) { // --- amc.FCtype.zd_inst.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool amc::zd_inst_InLlistQ(amc::FField& row) { +inline bool amc::ctype_zd_inst_InLlistQ(amc::FField& row) { bool result = false; - result = !(row.zd_inst_next == (amc::FField*)-1); + result = !(row.ctype_zd_inst_next == (amc::FField*)-1); return result; } @@ -1102,14 +1100,14 @@ inline i32 amc::zd_inst_N(const amc::FCtype& ctype) { // --- amc.FCtype.zd_inst.Next // Return pointer to next element in the list -inline amc::FField* amc::zd_inst_Next(amc::FField &row) { - return row.zd_inst_next; +inline amc::FField* amc::ctype_zd_inst_Next(amc::FField &row) { + return row.ctype_zd_inst_next; } // --- amc.FCtype.zd_inst.Prev // Return pointer to previous element in the list -inline amc::FField* amc::zd_inst_Prev(amc::FField &row) { - return row.zd_inst_prev; +inline amc::FField* amc::ctype_zd_inst_Prev(amc::FField &row) { + return row.ctype_zd_inst_prev; } // --- amc.FCtype.zd_inst.qLast @@ -1136,9 +1134,9 @@ inline amc::FXref* amc::zs_xref_First(amc::FCtype& ctype) { // --- amc.FCtype.zs_xref.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool amc::zs_xref_InLlistQ(amc::FXref& row) { +inline bool amc::ctype_zs_xref_InLlistQ(amc::FXref& row) { bool result = false; - result = !(row.zs_xref_next == (amc::FXref*)-1); + result = !(row.ctype_zs_xref_next == (amc::FXref*)-1); return result; } @@ -1158,8 +1156,8 @@ inline i32 amc::zs_xref_N(const amc::FCtype& ctype) { // --- amc.FCtype.zs_xref.Next // Return pointer to next element in the list -inline amc::FXref* amc::zs_xref_Next(amc::FXref &row) { - return row.zs_xref_next; +inline amc::FXref* amc::ctype_zs_xref_Next(amc::FXref &row) { + return row.ctype_zs_xref_next; } // --- amc.FCtype.zs_xref.qLast @@ -1314,9 +1312,9 @@ inline amc::FCafter* amc::zd_cafter_First(amc::FCtype& ctype) { // --- amc.FCtype.zd_cafter.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool amc::zd_cafter_InLlistQ(amc::FCafter& row) { +inline bool amc::ctype_zd_cafter_InLlistQ(amc::FCafter& row) { bool result = false; - result = !(row.zd_cafter_next == (amc::FCafter*)-1); + result = !(row.ctype_zd_cafter_next == (amc::FCafter*)-1); return result; } @@ -1336,14 +1334,14 @@ inline i32 amc::zd_cafter_N(const amc::FCtype& ctype) { // --- amc.FCtype.zd_cafter.Next // Return pointer to next element in the list -inline amc::FCafter* amc::zd_cafter_Next(amc::FCafter &row) { - return row.zd_cafter_next; +inline amc::FCafter* amc::ctype_zd_cafter_Next(amc::FCafter &row) { + return row.ctype_zd_cafter_next; } // --- amc.FCtype.zd_cafter.Prev // Return pointer to previous element in the list -inline amc::FCafter* amc::zd_cafter_Prev(amc::FCafter &row) { - return row.zd_cafter_prev; +inline amc::FCafter* amc::ctype_zd_cafter_Prev(amc::FCafter &row) { + return row.ctype_zd_cafter_prev; } // --- amc.FCtype.zd_cafter.qLast @@ -1390,9 +1388,9 @@ inline amc::FField* amc::zd_access_First(amc::FCtype& ctype) { // --- amc.FCtype.zd_access.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool amc::zd_access_InLlistQ(amc::FField& row) { +inline bool amc::ctype_zd_access_InLlistQ(amc::FField& row) { bool result = false; - result = !(row.zd_access_next == (amc::FField*)-1); + result = !(row.ctype_zd_access_next == (amc::FField*)-1); return result; } @@ -1412,14 +1410,14 @@ inline i32 amc::zd_access_N(const amc::FCtype& ctype) { // --- amc.FCtype.zd_access.Next // Return pointer to next element in the list -inline amc::FField* amc::zd_access_Next(amc::FField &row) { - return row.zd_access_next; +inline amc::FField* amc::ctype_zd_access_Next(amc::FField &row) { + return row.ctype_zd_access_next; } // --- amc.FCtype.zd_access.Prev // Return pointer to previous element in the list -inline amc::FField* amc::zd_access_Prev(amc::FField &row) { - return row.zd_access_prev; +inline amc::FField* amc::ctype_zd_access_Prev(amc::FField &row) { + return row.ctype_zd_access_prev; } // --- amc.FCtype.zd_access.qLast @@ -1666,6 +1664,102 @@ inline amc::FFfast& amc::c_ffast_qLast(amc::FCtype& ctype) { return *ctype.c_ffast_elems[ctype.c_ffast_n-1]; } +// --- amc.FCtype.zd_varlenfld.EmptyQ +// Return true if index is empty +inline bool amc::zd_varlenfld_EmptyQ(amc::FCtype& ctype) { + return ctype.zd_varlenfld_head == NULL; +} + +// --- amc.FCtype.zd_varlenfld.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline amc::FField* amc::zd_varlenfld_First(amc::FCtype& ctype) { + amc::FField *row = NULL; + row = ctype.zd_varlenfld_head; + return row; +} + +// --- amc.FCtype.zd_varlenfld.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool amc::ctype_zd_varlenfld_InLlistQ(amc::FField& row) { + bool result = false; + result = !(row.ctype_zd_varlenfld_next == (amc::FField*)-1); + return result; +} + +// --- amc.FCtype.zd_varlenfld.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline amc::FField* amc::zd_varlenfld_Last(amc::FCtype& ctype) { + amc::FField *row = NULL; + row = ctype.zd_varlenfld_tail; + return row; +} + +// --- amc.FCtype.zd_varlenfld.N +// Return number of items in the linked list +inline i32 amc::zd_varlenfld_N(const amc::FCtype& ctype) { + return ctype.zd_varlenfld_n; +} + +// --- amc.FCtype.zd_varlenfld.Next +// Return pointer to next element in the list +inline amc::FField* amc::ctype_zd_varlenfld_Next(amc::FField &row) { + return row.ctype_zd_varlenfld_next; +} + +// --- amc.FCtype.zd_varlenfld.Prev +// Return pointer to previous element in the list +inline amc::FField* amc::ctype_zd_varlenfld_Prev(amc::FField &row) { + return row.ctype_zd_varlenfld_prev; +} + +// --- amc.FCtype.zd_varlenfld.qLast +// Return reference to last element in the index. No bounds checking. +inline amc::FField& amc::zd_varlenfld_qLast(amc::FCtype& ctype) { + amc::FField *row = NULL; + row = ctype.zd_varlenfld_tail; + return *row; +} + +// --- amc.FCtype.c_jstype.InsertMaybe +// Insert row into pointer index. Return final membership status. +inline bool amc::c_jstype_InsertMaybe(amc::FCtype& ctype, amc::FJstype& row) { + amc::FJstype* ptr = ctype.c_jstype; + bool retval = (ptr == NULL) | (ptr == &row); + if (retval) { + ctype.c_jstype = &row; + } + return retval; +} + +// --- amc.FCtype.c_jstype.Remove +// Remove element from index. If element is not in index, do nothing. +inline void amc::c_jstype_Remove(amc::FCtype& ctype, amc::FJstype& row) { + amc::FJstype *ptr = ctype.c_jstype; + if (LIKELY(ptr == &row)) { + ctype.c_jstype = NULL; + } +} + +// --- amc.FCtype.c_ckafka.InsertMaybe +// Insert row into pointer index. Return final membership status. +inline bool amc::c_ckafka_InsertMaybe(amc::FCtype& ctype, amc::FCkafka& row) { + amc::FCkafka* ptr = ctype.c_ckafka; + bool retval = (ptr == NULL) | (ptr == &row); + if (retval) { + ctype.c_ckafka = &row; + } + return retval; +} + +// --- amc.FCtype.c_ckafka.Remove +// Remove element from index. If element is not in index, do nothing. +inline void amc::c_ckafka_Remove(amc::FCtype& ctype, amc::FCkafka& row) { + amc::FCkafka *ptr = ctype.c_ckafka; + if (LIKELY(ptr == &row)) { + ctype.c_ckafka = NULL; + } +} + // --- amc.FCtype.zs_cfmt_curs.Reset // cursor points to valid item inline void amc::ctype_zs_cfmt_curs_Reset(ctype_zs_cfmt_curs &curs, amc::FCtype &parent) { @@ -1681,7 +1775,7 @@ inline bool amc::ctype_zs_cfmt_curs_ValidQ(ctype_zs_cfmt_curs &curs) { // --- amc.FCtype.zs_cfmt_curs.Next // proceed to next item inline void amc::ctype_zs_cfmt_curs_Next(ctype_zs_cfmt_curs &curs) { - amc::FCfmt *next = (*curs.row).zs_cfmt_next; + amc::FCfmt *next = (*curs.row).ctype_zs_cfmt_next; curs.row = next; } @@ -1831,7 +1925,7 @@ inline bool amc::ctype_zd_inst_curs_ValidQ(ctype_zd_inst_curs &curs) { // --- amc.FCtype.zd_inst_curs.Next // proceed to next item inline void amc::ctype_zd_inst_curs_Next(ctype_zd_inst_curs &curs) { - amc::FField *next = (*curs.row).zd_inst_next; + amc::FField *next = (*curs.row).ctype_zd_inst_next; curs.row = next; } @@ -1856,7 +1950,7 @@ inline bool amc::ctype_zs_xref_curs_ValidQ(ctype_zs_xref_curs &curs) { // --- amc.FCtype.zs_xref_curs.Next // proceed to next item inline void amc::ctype_zs_xref_curs_Next(ctype_zs_xref_curs &curs) { - amc::FXref *next = (*curs.row).zs_xref_next; + amc::FXref *next = (*curs.row).ctype_zs_xref_next; curs.row = next; } @@ -1906,7 +2000,7 @@ inline bool amc::ctype_zd_cafter_curs_ValidQ(ctype_zd_cafter_curs &curs) { // --- amc.FCtype.zd_cafter_curs.Next // proceed to next item inline void amc::ctype_zd_cafter_curs_Next(ctype_zd_cafter_curs &curs) { - amc::FCafter *next = (*curs.row).zd_cafter_next; + amc::FCafter *next = (*curs.row).ctype_zd_cafter_next; curs.row = next; } @@ -1931,7 +2025,7 @@ inline bool amc::ctype_zd_access_curs_ValidQ(ctype_zd_access_curs &curs) { // --- amc.FCtype.zd_access_curs.Next // proceed to next item inline void amc::ctype_zd_access_curs_Next(ctype_zd_access_curs &curs) { - amc::FField *next = (*curs.row).zd_access_next; + amc::FField *next = (*curs.row).ctype_zd_access_next; curs.row = next; } @@ -1991,6 +2085,31 @@ inline amc::FFfast& amc::ctype_c_ffast_curs_Access(ctype_c_ffast_curs &curs) { return *curs.elems[curs.index]; } +// --- amc.FCtype.zd_varlenfld_curs.Reset +// cursor points to valid item +inline void amc::ctype_zd_varlenfld_curs_Reset(ctype_zd_varlenfld_curs &curs, amc::FCtype &parent) { + curs.row = parent.zd_varlenfld_head; +} + +// --- amc.FCtype.zd_varlenfld_curs.ValidQ +// cursor points to valid item +inline bool amc::ctype_zd_varlenfld_curs_ValidQ(ctype_zd_varlenfld_curs &curs) { + return curs.row != NULL; +} + +// --- amc.FCtype.zd_varlenfld_curs.Next +// proceed to next item +inline void amc::ctype_zd_varlenfld_curs_Next(ctype_zd_varlenfld_curs &curs) { + amc::FField *next = (*curs.row).ctype_zd_varlenfld_next; + curs.row = next; +} + +// --- amc.FCtype.zd_varlenfld_curs.Access +// item access +inline amc::FField& amc::ctype_zd_varlenfld_curs_Access(ctype_zd_varlenfld_curs &curs) { + return *curs.row; +} + // --- amc.FCtype..Ctor inline amc::FCtype::FCtype() { amc::FCtype_Init(*this); @@ -2008,7 +2127,6 @@ inline void amc::FCtypelen_Init(amc::FCtypelen& ctypelen) { ctypelen.alignment = i32(0); ctypelen.padbytes = i32(0); ctypelen.plaindata = bool(false); - ctypelen._db_c_ctypelen_in_ary = bool(false); } // --- amc.FCtypelen..Ctor @@ -2132,6 +2250,7 @@ inline void amc::FTclass_Init(amc::FTclass& tclass) { tclass.c_tfunc_max = 0; // (amc.FTclass.c_tfunc) tclass.step = NULL; tclass.ind_tclass_next = (amc::FTclass*)-1; // (amc.FDb.ind_tclass) not-in-hash + tclass.ind_tclass_hashval = 0; // stored hash value } // --- amc.FTclass..Ctor @@ -5146,64 +5265,6 @@ inline amc::FDispsig& amc::dispsig_qFind(u64 t) { return _db.dispsig_lary[bsr][index]; } -// --- amc.FDb.c_dispsig_sorted.EmptyQ -// Return true if index is empty -inline bool amc::c_dispsig_sorted_EmptyQ() { - return _db.c_dispsig_sorted_n == 0; -} - -// --- amc.FDb.c_dispsig_sorted.Find -// Look up row by row id. Return NULL if out of range -inline amc::FDispsig* amc::c_dispsig_sorted_Find(u32 t) { - amc::FDispsig *retval = NULL; - u64 idx = t; - u64 lim = _db.c_dispsig_sorted_n; - if (idx < lim) { - retval = _db.c_dispsig_sorted_elems[idx]; - } - return retval; -} - -// --- amc.FDb.c_dispsig_sorted.Getary -// Return array of pointers -inline algo::aryptr amc::c_dispsig_sorted_Getary() { - return algo::aryptr(_db.c_dispsig_sorted_elems, _db.c_dispsig_sorted_n); -} - -// --- amc.FDb.c_dispsig_sorted.N -// Return number of items in the pointer array -inline i32 amc::c_dispsig_sorted_N() { - return _db.c_dispsig_sorted_n; -} - -// --- amc.FDb.c_dispsig_sorted.RemoveAll -// Empty the index. (The rows are not deleted) -inline void amc::c_dispsig_sorted_RemoveAll() { - for (u32 i = 0; i < _db.c_dispsig_sorted_n; i++) { - // mark all elements as not-in-array - _db.c_dispsig_sorted_elems[i]->_db_c_dispsig_sorted_in_ary = false; - } - _db.c_dispsig_sorted_n = 0; -} - -// --- amc.FDb.c_dispsig_sorted.qFind -// Return reference without bounds checking -inline amc::FDispsig& amc::c_dispsig_sorted_qFind(u32 idx) { - return *_db.c_dispsig_sorted_elems[idx]; -} - -// --- amc.FDb.c_dispsig_sorted.InAryQ -// True if row is in any ptrary instance -inline bool amc::c_dispsig_sorted_InAryQ(amc::FDispsig& row) { - return row._db_c_dispsig_sorted_in_ary; -} - -// --- amc.FDb.c_dispsig_sorted.qLast -// Reference to last element without bounds checking -inline amc::FDispsig& amc::c_dispsig_sorted_qLast() { - return *_db.c_dispsig_sorted_elems[_db.c_dispsig_sorted_n-1]; -} - // --- amc.FDb.zs_sig_visit.EmptyQ // Return true if index is empty inline bool amc::zs_sig_visit_EmptyQ() { @@ -6698,7 +6759,7 @@ inline i32 amc::c_substr_field_N() { inline void amc::c_substr_field_RemoveAll() { for (u32 i = 0; i < _db.c_substr_field_n; i++) { // mark all elements as not-in-array - _db.c_substr_field_elems[i]->_db_c_substr_field_in_ary = false; + _db.c_substr_field_elems[i]->c_substr_field_in_ary = false; } _db.c_substr_field_n = 0; } @@ -6712,7 +6773,7 @@ inline amc::FSubstr& amc::c_substr_field_qFind(u32 idx) { // --- amc.FDb.c_substr_field.InAryQ // True if row is in any ptrary instance inline bool amc::c_substr_field_InAryQ(amc::FSubstr& row) { - return row._db_c_substr_field_in_ary; + return row.c_substr_field_in_ary; } // --- amc.FDb.c_substr_field.qLast @@ -6763,122 +6824,6 @@ inline amc::FCtypelen& amc::ctypelen_qFind(u64 t) { return _db.ctypelen_lary[bsr][index]; } -// --- amc.FDb.c_ctypelen.EmptyQ -// Return true if index is empty -inline bool amc::c_ctypelen_EmptyQ() { - return _db.c_ctypelen_n == 0; -} - -// --- amc.FDb.c_ctypelen.Find -// Look up row by row id. Return NULL if out of range -inline amc::FCtypelen* amc::c_ctypelen_Find(u32 t) { - amc::FCtypelen *retval = NULL; - u64 idx = t; - u64 lim = _db.c_ctypelen_n; - if (idx < lim) { - retval = _db.c_ctypelen_elems[idx]; - } - return retval; -} - -// --- amc.FDb.c_ctypelen.Getary -// Return array of pointers -inline algo::aryptr amc::c_ctypelen_Getary() { - return algo::aryptr(_db.c_ctypelen_elems, _db.c_ctypelen_n); -} - -// --- amc.FDb.c_ctypelen.N -// Return number of items in the pointer array -inline i32 amc::c_ctypelen_N() { - return _db.c_ctypelen_n; -} - -// --- amc.FDb.c_ctypelen.RemoveAll -// Empty the index. (The rows are not deleted) -inline void amc::c_ctypelen_RemoveAll() { - for (u32 i = 0; i < _db.c_ctypelen_n; i++) { - // mark all elements as not-in-array - _db.c_ctypelen_elems[i]->_db_c_ctypelen_in_ary = false; - } - _db.c_ctypelen_n = 0; -} - -// --- amc.FDb.c_ctypelen.qFind -// Return reference without bounds checking -inline amc::FCtypelen& amc::c_ctypelen_qFind(u32 idx) { - return *_db.c_ctypelen_elems[idx]; -} - -// --- amc.FDb.c_ctypelen.InAryQ -// True if row is in any ptrary instance -inline bool amc::c_ctypelen_InAryQ(amc::FCtypelen& row) { - return row._db_c_ctypelen_in_ary; -} - -// --- amc.FDb.c_ctypelen.qLast -// Reference to last element without bounds checking -inline amc::FCtypelen& amc::c_ctypelen_qLast() { - return *_db.c_ctypelen_elems[_db.c_ctypelen_n-1]; -} - -// --- amc.FDb.c_tempfield.EmptyQ -// Return true if index is empty -inline bool amc::c_tempfield_EmptyQ() { - return _db.c_tempfield_n == 0; -} - -// --- amc.FDb.c_tempfield.Find -// Look up row by row id. Return NULL if out of range -inline amc::FField* amc::c_tempfield_Find(u32 t) { - amc::FField *retval = NULL; - u64 idx = t; - u64 lim = _db.c_tempfield_n; - if (idx < lim) { - retval = _db.c_tempfield_elems[idx]; - } - return retval; -} - -// --- amc.FDb.c_tempfield.Getary -// Return array of pointers -inline algo::aryptr amc::c_tempfield_Getary() { - return algo::aryptr(_db.c_tempfield_elems, _db.c_tempfield_n); -} - -// --- amc.FDb.c_tempfield.N -// Return number of items in the pointer array -inline i32 amc::c_tempfield_N() { - return _db.c_tempfield_n; -} - -// --- amc.FDb.c_tempfield.RemoveAll -// Empty the index. (The rows are not deleted) -inline void amc::c_tempfield_RemoveAll() { - for (u32 i = 0; i < _db.c_tempfield_n; i++) { - // mark all elements as not-in-array - _db.c_tempfield_elems[i]->_db_c_tempfield_in_ary = false; - } - _db.c_tempfield_n = 0; -} - -// --- amc.FDb.c_tempfield.qFind -// Return reference without bounds checking -inline amc::FField& amc::c_tempfield_qFind(u32 idx) { - return *_db.c_tempfield_elems[idx]; -} - -// --- amc.FDb.c_tempfield.InAryQ -// True if row is in any ptrary instance -inline bool amc::c_tempfield_InAryQ(amc::FField& row) { - return row._db_c_tempfield_in_ary; -} - -// --- amc.FDb.c_tempfield.qLast -// Reference to last element without bounds checking -inline amc::FField& amc::c_tempfield_qLast() { - return *_db.c_tempfield_elems[_db.c_tempfield_n-1]; -} - // --- amc.FDb.fbase.EmptyQ // Return true if index is empty inline bool amc::fbase_EmptyQ() { @@ -7739,7 +7684,7 @@ inline i32 amc::c_ssimfile_sorted_N() { inline void amc::c_ssimfile_sorted_RemoveAll() { for (u32 i = 0; i < _db.c_ssimfile_sorted_n; i++) { // mark all elements as not-in-array - _db.c_ssimfile_sorted_elems[i]->_db_c_ssimfile_sorted_in_ary = false; + _db.c_ssimfile_sorted_elems[i]->c_ssimfile_sorted_in_ary = false; } _db.c_ssimfile_sorted_n = 0; } @@ -7753,7 +7698,7 @@ inline amc::FSsimfile& amc::c_ssimfile_sorted_qFind(u32 idx) { // --- amc.FDb.c_ssimfile_sorted.InAryQ // True if row is in any ptrary instance inline bool amc::c_ssimfile_sorted_InAryQ(amc::FSsimfile& row) { - return row._db_c_ssimfile_sorted_in_ary; + return row.c_ssimfile_sorted_in_ary; } // --- amc.FDb.c_ssimfile_sorted.qLast @@ -7956,100 +7901,364 @@ inline i32 amc::ind_pmaskfld_N() { return _db.ind_pmaskfld_n; } -// --- amc.FDb.ssimsort.EmptyQ +// --- amc.FDb.ssimsort.EmptyQ +// Return true if index is empty +inline bool amc::ssimsort_EmptyQ() { + return _db.ssimsort_n == 0; +} + +// --- amc.FDb.ssimsort.Find +// Look up row by row id. Return NULL if out of range +inline amc::FSsimsort* amc::ssimsort_Find(u64 t) { + amc::FSsimsort *retval = NULL; + if (LIKELY(u64(t) < u64(_db.ssimsort_n))) { + u64 x = t + 1; + u64 bsr = algo::u64_BitScanReverse(x); + u64 base = u64(1)< c_linklist_Getary() __attribute__((nothrow)); +inline algo::aryptr c_linklist_Getary() __attribute__((nothrow)); // Insert pointer to row into array. Row must not already be in array. // If pointer is already in the array, it may be inserted twice. // func:amc_vis.FDb.c_linklist.Insert -void c_linklist_Insert(amc_vis::Link& row) __attribute__((nothrow)); +void c_linklist_Insert(amc_vis::FLink& row) __attribute__((nothrow)); // Insert pointer to row in array. // If row is already in the array, do nothing. // Return value: whether element was inserted into array. // func:amc_vis.FDb.c_linklist.InsertMaybe -bool c_linklist_InsertMaybe(amc_vis::Link& row) __attribute__((nothrow)); +bool c_linklist_InsertMaybe(amc_vis::FLink& row) __attribute__((nothrow)); // Return number of items in the pointer array // func:amc_vis.FDb.c_linklist.N inline i32 c_linklist_N() __attribute__((__warn_unused_result__, nothrow, pure)); // Find element using linear scan. If element is in array, remove, otherwise do nothing // func:amc_vis.FDb.c_linklist.Remove -void c_linklist_Remove(amc_vis::Link& row) __attribute__((nothrow)); +void c_linklist_Remove(amc_vis::FLink& row) __attribute__((nothrow)); // Empty the index. (The rows are not deleted) // func:amc_vis.FDb.c_linklist.RemoveAll inline void c_linklist_RemoveAll() __attribute__((nothrow)); @@ -663,13 +682,13 @@ inline void c_linklist_RemoveAll() __attribute__((nothrow)); void c_linklist_Reserve(u32 n) __attribute__((nothrow)); // Return reference without bounds checking // func:amc_vis.FDb.c_linklist.qFind -inline amc_vis::Link& c_linklist_qFind(u32 idx) __attribute__((nothrow)); +inline amc_vis::FLink& c_linklist_qFind(u32 idx) __attribute__((nothrow)); // True if row is in any ptrary instance // func:amc_vis.FDb.c_linklist.InAryQ -inline bool c_linklist_InAryQ(amc_vis::Link& row) __attribute__((nothrow)); +inline bool c_linklist_InAryQ(amc_vis::FLink& row) __attribute__((nothrow)); // Reference to last element without bounds checking // func:amc_vis.FDb.c_linklist.qLast -inline amc_vis::Link& c_linklist_qLast() __attribute__((nothrow)); +inline amc_vis::FLink& c_linklist_qLast() __attribute__((nothrow)); // Remove all elements from heap and free memory used by the array. // func:amc_vis.FDb.bh_node.Dealloc @@ -721,20 +740,20 @@ void bh_link_Dealloc() __attribute__((nothrow)); inline bool bh_link_EmptyQ() __attribute__((nothrow)); // If index empty, return NULL. Otherwise return pointer to first element in index // func:amc_vis.FDb.bh_link.First -inline amc_vis::Link* bh_link_First() __attribute__((__warn_unused_result__, nothrow, pure)); +inline amc_vis::FLink* bh_link_First() __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in index, false otherwise // func:amc_vis.FDb.bh_link.InBheapQ -inline bool bh_link_InBheapQ(amc_vis::Link& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool bh_link_InBheapQ(amc_vis::FLink& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row. Row must not already be in index. If row is already in index, do nothing. // func:amc_vis.FDb.bh_link.Insert -void bh_link_Insert(amc_vis::Link& row) __attribute__((nothrow)); +void bh_link_Insert(amc_vis::FLink& row) __attribute__((nothrow)); // Return number of items in the heap // func:amc_vis.FDb.bh_link.N inline i32 bh_link_N() __attribute__((__warn_unused_result__, nothrow, pure)); // If row is in heap, update its position. If row is not in heap, insert it. // Return new position of item in the heap (0=top) // func:amc_vis.FDb.bh_link.Reheap -i32 bh_link_Reheap(amc_vis::Link& row) __attribute__((nothrow)); +i32 bh_link_Reheap(amc_vis::FLink& row) __attribute__((nothrow)); // Key of first element in the heap changed. Move it. // This function does not check the insert condition. // Return new position of item in the heap (0=top). @@ -743,14 +762,14 @@ i32 bh_link_Reheap(amc_vis::Link& row) __attribute__((nothrow)) i32 bh_link_ReheapFirst() __attribute__((nothrow)); // Remove element from index. If element is not in index, do nothing. // func:amc_vis.FDb.bh_link.Remove -void bh_link_Remove(amc_vis::Link& row) __attribute__((nothrow)); +void bh_link_Remove(amc_vis::FLink& row) __attribute__((nothrow)); // Remove all elements from binary heap // func:amc_vis.FDb.bh_link.RemoveAll void bh_link_RemoveAll() __attribute__((nothrow)); // If index is empty, return NULL. Otherwise remove and return first key in index. // Call 'head changed' trigger. // func:amc_vis.FDb.bh_link.RemoveFirst -amc_vis::Link* bh_link_RemoveFirst() __attribute__((nothrow)); +amc_vis::FLink* bh_link_RemoveFirst() __attribute__((nothrow)); // Reserve space in index for N more elements // func:amc_vis.FDb.bh_link.Reserve void bh_link_Reserve(int n) __attribute__((nothrow)); @@ -816,6 +835,9 @@ void ind_reftype_Remove(amc_vis::FReftype& row) __attribute__((n // Reserve enough room in the hash for N more elements. Return success code. // func:amc_vis.FDb.ind_reftype.Reserve void ind_reftype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:amc_vis.FDb.ind_reftype.AbsReserve +void ind_reftype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -856,10 +878,10 @@ bool nodedep_XrefMaybe(amc_vis::FNodedep &row); // Allocate memory for new default row. // If out of memory, process is killed. // func:amc_vis.FDb.outrow.Alloc -amc_vis::Outrow& outrow_Alloc() __attribute__((__warn_unused_result__, nothrow)); +amc_vis::FOutrow& outrow_Alloc() __attribute__((__warn_unused_result__, nothrow)); // Allocate memory for new element. If out of memory, return NULL. // func:amc_vis.FDb.outrow.AllocMaybe -amc_vis::Outrow* outrow_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +amc_vis::FOutrow* outrow_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); // Allocate space for one element. If no memory available, return NULL. // func:amc_vis.FDb.outrow.AllocMem void* outrow_AllocMem() __attribute__((__warn_unused_result__, nothrow)); @@ -868,10 +890,10 @@ void* outrow_AllocMem() __attribute__((__warn_unused_result__, no inline bool outrow_EmptyQ() __attribute__((nothrow, pure)); // Look up row by row id. Return NULL if out of range // func:amc_vis.FDb.outrow.Find -inline amc_vis::Outrow* outrow_Find(i32 t) __attribute__((__warn_unused_result__, nothrow, pure)); +inline amc_vis::FOutrow* outrow_Find(i32 t) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to last element of array, or NULL if array is empty // func:amc_vis.FDb.outrow.Last -inline amc_vis::Outrow* outrow_Last() __attribute__((nothrow, pure)); +inline amc_vis::FOutrow* outrow_Last() __attribute__((nothrow, pure)); // Return number of items in the pool // func:amc_vis.FDb.outrow.N inline i32 outrow_N() __attribute__((__warn_unused_result__, nothrow, pure)); @@ -883,11 +905,11 @@ void outrow_RemoveAll() __attribute__((nothrow)); void outrow_RemoveLast() __attribute__((nothrow)); // 'quick' Access row by row id. No bounds checking. // func:amc_vis.FDb.outrow.qFind -inline amc_vis::Outrow& outrow_qFind(i32 t) __attribute__((nothrow, pure)); +inline amc_vis::FOutrow& outrow_qFind(i32 t) __attribute__((nothrow, pure)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. // func:amc_vis.FDb.outrow.XrefMaybe -bool outrow_XrefMaybe(amc_vis::Outrow &row); +bool outrow_XrefMaybe(amc_vis::FOutrow &row); // Return true if index is empty // func:amc_vis.FDb.zd_select.EmptyQ @@ -1010,7 +1032,7 @@ inline bool _db_link_curs_ValidQ(_db_link_curs &curs) __attribute__((no inline void _db_link_curs_Next(_db_link_curs &curs) __attribute__((nothrow)); // item access // func:amc_vis.FDb.link_curs.Access -inline amc_vis::Link& _db_link_curs_Access(_db_link_curs &curs) __attribute__((nothrow)); +inline amc_vis::FLink& _db_link_curs_Access(_db_link_curs &curs) __attribute__((nothrow)); // cursor points to valid item // func:amc_vis.FDb.linkdep_curs.Reset inline void _db_linkdep_curs_Reset(_db_linkdep_curs &curs, amc_vis::FDb &parent) __attribute__((nothrow)); @@ -1022,7 +1044,7 @@ inline bool _db_linkdep_curs_ValidQ(_db_linkdep_curs &curs) __attribute inline void _db_linkdep_curs_Next(_db_linkdep_curs &curs) __attribute__((nothrow)); // item access // func:amc_vis.FDb.linkdep_curs.Access -inline amc_vis::Linkdep& _db_linkdep_curs_Access(_db_linkdep_curs &curs) __attribute__((nothrow)); +inline amc_vis::FLinkdep& _db_linkdep_curs_Access(_db_linkdep_curs &curs) __attribute__((nothrow)); // func:amc_vis.FDb.c_linklist_curs.Reset inline void _db_c_linklist_curs_Reset(_db_c_linklist_curs &curs, amc_vis::FDb &parent) __attribute__((nothrow)); // cursor points to valid item @@ -1033,7 +1055,7 @@ inline bool _db_c_linklist_curs_ValidQ(_db_c_linklist_curs &curs) __att inline void _db_c_linklist_curs_Next(_db_c_linklist_curs &curs) __attribute__((nothrow)); // item access // func:amc_vis.FDb.c_linklist_curs.Access -inline amc_vis::Link& _db_c_linklist_curs_Access(_db_c_linklist_curs &curs) __attribute__((nothrow)); +inline amc_vis::FLink& _db_c_linklist_curs_Access(_db_c_linklist_curs &curs) __attribute__((nothrow)); // func:amc_vis.FDb.bh_node_curs.Reserve void _db_bh_node_curs_Reserve(_db_bh_node_curs &curs, int n); // Reset cursor. If HEAP is non-empty, add its top element to CURS. @@ -1058,7 +1080,7 @@ void _db_bh_link_curs_Reset(_db_bh_link_curs &curs, amc_vis::FDb void _db_bh_link_curs_Next(_db_bh_link_curs &curs); // Access current element. If not more elements, return NULL // func:amc_vis.FDb.bh_link_curs.Access -inline amc_vis::Link& _db_bh_link_curs_Access(_db_bh_link_curs &curs) __attribute__((nothrow)); +inline amc_vis::FLink& _db_bh_link_curs_Access(_db_bh_link_curs &curs) __attribute__((nothrow)); // Return true if Access() will return non-NULL. // func:amc_vis.FDb.bh_link_curs.ValidQ inline bool _db_bh_link_curs_ValidQ(_db_bh_link_curs &curs) __attribute__((nothrow)); @@ -1097,7 +1119,7 @@ inline bool _db_outrow_curs_ValidQ(_db_outrow_curs &curs) __attribute__ inline void _db_outrow_curs_Next(_db_outrow_curs &curs) __attribute__((nothrow)); // item access // func:amc_vis.FDb.outrow_curs.Access -inline amc_vis::Outrow& _db_outrow_curs_Access(_db_outrow_curs &curs) __attribute__((nothrow)); +inline amc_vis::FOutrow& _db_outrow_curs_Access(_db_outrow_curs &curs) __attribute__((nothrow)); // cursor points to valid item // func:amc_vis.FDb.zd_select_curs.Reset inline void _db_zd_select_curs_Reset(_db_zd_select_curs &curs, amc_vis::FDb &parent) __attribute__((nothrow)); @@ -1135,6 +1157,7 @@ void FDb_Uninit() __attribute__((nothrow)); // access: amc_vis.FCtype.c_field (Ptrary) struct FField { // amc_vis.FField amc_vis::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -1236,11 +1259,256 @@ inline void FFinput_Init(amc_vis::FFinput& finput); // func:amc_vis.FFinput..Uninit void FFinput_Uninit(amc_vis::FFinput& finput) __attribute__((nothrow)); +// --- amc_vis.Linkkey +struct Linkkey { // amc_vis.Linkkey: Heap key for selecting next link to render - fields quantify selection criteria + u32 n_link_in; // 0 Number of incoming dependencies + i32 samecol; // 0 Set on links that lead to the same column + i32 colweight; // 0 Heavier columns are scheduled first + // func:amc_vis.Linkkey..EqOp + inline bool operator ==(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..NeOp + inline bool operator !=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..LtOp + inline bool operator <(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..GtOp + inline bool operator >(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..LeOp + inline bool operator <=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..GeOp + inline bool operator >=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..Ctor + inline Linkkey() __attribute__((nothrow)); + // func:amc_vis.Linkkey..FieldwiseCtor + explicit inline Linkkey(u32 in_n_link_in, i32 in_samecol, i32 in_colweight) __attribute__((nothrow)); +}; + +// func:amc_vis.Linkkey..Hash +inline u32 Linkkey_Hash(u32 prev, amc_vis::Linkkey rhs) __attribute__((nothrow)); +// func:amc_vis.Linkkey..Lt +inline bool Linkkey_Lt(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) __attribute__((nothrow)); +// func:amc_vis.Linkkey..Cmp +inline i32 Linkkey_Cmp(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:amc_vis.Linkkey..Init +inline void Linkkey_Init(amc_vis::Linkkey& parent); +// func:amc_vis.Linkkey..Eq +inline bool Linkkey_Eq(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) __attribute__((nothrow)); +// Set value. Return true if new value is different from old value. +// func:amc_vis.Linkkey..Update +inline bool Linkkey_Update(amc_vis::Linkkey &lhs, amc_vis::Linkkey rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:amc_vis.Linkkey.String printfmt:Tuple +// func:amc_vis.Linkkey..Print +void Linkkey_Print(amc_vis::Linkkey row, algo::cstring& str) __attribute__((nothrow)); + +// --- amc_vis.FLink +// create: amc_vis.FDb.link (Lary) +// global access: link (Lary, by rowid) +// global access: ind_link (Thash, hash field link) +// global access: c_linklist (Ptrary) +// global access: bh_link (Bheap, sort field linkkey) +// access: amc_vis.FLinkdep.p_link_from (Upptr) +// access: amc_vis.FLinkdep.p_link_to (Upptr) +// access: amc_vis.FNode.c_bottom (Ptr) +// access: amc_vis.FNode.c_top (Ptr) +// access: amc_vis.FNode.zd_link_out (Llist) +// access: amc_vis.FNode.zd_link_in (Llist) +struct FLink { // amc_vis.FLink: Correspodns to a ctype + amc_vis::FLink* ind_link_next; // hash next + u32 ind_link_hashval; // hash value + i32 bh_link_idx; // index in heap; -1 means not-in-heap + algo::cstring link; // Primary key + algo::cstring label1; // Label in column 1 + algo::cstring label2; // Label in column 2 + amc_vis::Linkkey linkkey; // + i32 outrow; // 0 Outrow # + amc_vis::FNode* p_node1; // reference to parent row + amc_vis::FNode* p_node2; // reference to parent row + bool upptr; // false Up-arrow (not a constraint) + amc_vis::FLinkdep* zd_linkdep_out_head; // zero-terminated doubly linked list + amc_vis::FLinkdep* zd_linkdep_out_tail; // pointer to last element + amc_vis::FLinkdep* zd_linkdep_in_head; // zero-terminated doubly linked list + amc_vis::FLinkdep* zd_linkdep_in_tail; // pointer to last element + bool c_linklist_in_ary; // false membership flag + amc_vis::FLink* node_zd_link_out_next; // zslist link; -1 means not-in-list + amc_vis::FLink* node_zd_link_out_prev; // previous element + amc_vis::FLink* node_zd_link_in_next; // zslist link; -1 means not-in-list + amc_vis::FLink* node_zd_link_in_prev; // previous element + // reftype Llist of amc_vis.FLink.zd_linkdep_out prohibits copy + // reftype Llist of amc_vis.FLink.zd_linkdep_in prohibits copy + // func:amc_vis.FLink..AssignOp + amc_vis::FLink& operator =(const amc_vis::FLink &rhs) = delete; + // reftype Llist of amc_vis.FLink.zd_linkdep_out prohibits copy + // reftype Llist of amc_vis.FLink.zd_linkdep_in prohibits copy + // func:amc_vis.FLink..CopyCtor + FLink(const amc_vis::FLink &rhs) = delete; +private: + // func:amc_vis.FLink..Ctor + inline FLink() __attribute__((nothrow)); + // func:amc_vis.FLink..Dtor + inline ~FLink() __attribute__((nothrow)); + friend amc_vis::FLink& link_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc_vis::FLink* link_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void link_RemoveAll() __attribute__((nothrow)); + friend void link_RemoveLast() __attribute__((nothrow)); +}; + +// Compare two fields. Comparison is anti-symmetric: if a>b, then !(b>a). +// func:amc_vis.FLink.linkkey.Lt +inline bool linkkey_Lt(amc_vis::FLink& link, amc_vis::FLink &rhs) __attribute__((nothrow)); +// Compare two fields. +// func:amc_vis.FLink.linkkey.Cmp +inline i32 linkkey_Cmp(amc_vis::FLink& link, amc_vis::FLink &rhs) __attribute__((nothrow)); + +// Return true if index is empty +// func:amc_vis.FLink.zd_linkdep_out.EmptyQ +inline bool zd_linkdep_out_EmptyQ(amc_vis::FLink& link) __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:amc_vis.FLink.zd_linkdep_out.First +inline amc_vis::FLinkdep* zd_linkdep_out_First(amc_vis::FLink& link) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:amc_vis.FLink.zd_linkdep_out.InLlistQ +inline bool link_zd_linkdep_out_InLlistQ(amc_vis::FLinkdep& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:amc_vis.FLink.zd_linkdep_out.Insert +void zd_linkdep_out_Insert(amc_vis::FLink& link, amc_vis::FLinkdep& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:amc_vis.FLink.zd_linkdep_out.Last +inline amc_vis::FLinkdep* zd_linkdep_out_Last(amc_vis::FLink& link) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:amc_vis.FLink.zd_linkdep_out.Next +inline amc_vis::FLinkdep* link_zd_linkdep_out_Next(amc_vis::FLinkdep &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:amc_vis.FLink.zd_linkdep_out.Prev +inline amc_vis::FLinkdep* link_zd_linkdep_out_Prev(amc_vis::FLinkdep &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:amc_vis.FLink.zd_linkdep_out.Remove +void zd_linkdep_out_Remove(amc_vis::FLink& link, amc_vis::FLinkdep& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:amc_vis.FLink.zd_linkdep_out.RemoveAll +void zd_linkdep_out_RemoveAll(amc_vis::FLink& link) __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// func:amc_vis.FLink.zd_linkdep_out.RemoveFirst +amc_vis::FLinkdep* zd_linkdep_out_RemoveFirst(amc_vis::FLink& link) __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:amc_vis.FLink.zd_linkdep_out.qLast +inline amc_vis::FLinkdep& zd_linkdep_out_qLast(amc_vis::FLink& link) __attribute__((__warn_unused_result__, nothrow)); + +// Return true if index is empty +// func:amc_vis.FLink.zd_linkdep_in.EmptyQ +inline bool zd_linkdep_in_EmptyQ(amc_vis::FLink& link) __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:amc_vis.FLink.zd_linkdep_in.First +inline amc_vis::FLinkdep* zd_linkdep_in_First(amc_vis::FLink& link) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:amc_vis.FLink.zd_linkdep_in.InLlistQ +inline bool link_zd_linkdep_in_InLlistQ(amc_vis::FLinkdep& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:amc_vis.FLink.zd_linkdep_in.Insert +void zd_linkdep_in_Insert(amc_vis::FLink& link, amc_vis::FLinkdep& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:amc_vis.FLink.zd_linkdep_in.Last +inline amc_vis::FLinkdep* zd_linkdep_in_Last(amc_vis::FLink& link) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:amc_vis.FLink.zd_linkdep_in.Next +inline amc_vis::FLinkdep* link_zd_linkdep_in_Next(amc_vis::FLinkdep &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:amc_vis.FLink.zd_linkdep_in.Prev +inline amc_vis::FLinkdep* link_zd_linkdep_in_Prev(amc_vis::FLinkdep &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:amc_vis.FLink.zd_linkdep_in.Remove +void zd_linkdep_in_Remove(amc_vis::FLink& link, amc_vis::FLinkdep& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:amc_vis.FLink.zd_linkdep_in.RemoveAll +void zd_linkdep_in_RemoveAll(amc_vis::FLink& link) __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// func:amc_vis.FLink.zd_linkdep_in.RemoveFirst +amc_vis::FLinkdep* zd_linkdep_in_RemoveFirst(amc_vis::FLink& link) __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:amc_vis.FLink.zd_linkdep_in.qLast +inline amc_vis::FLinkdep& zd_linkdep_in_qLast(amc_vis::FLink& link) __attribute__((__warn_unused_result__, nothrow)); + +// Set all fields to initial values. +// func:amc_vis.FLink..Init +void FLink_Init(amc_vis::FLink& link); +// cursor points to valid item +// func:amc_vis.FLink.zd_linkdep_out_curs.Reset +inline void link_zd_linkdep_out_curs_Reset(link_zd_linkdep_out_curs &curs, amc_vis::FLink &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:amc_vis.FLink.zd_linkdep_out_curs.ValidQ +inline bool link_zd_linkdep_out_curs_ValidQ(link_zd_linkdep_out_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:amc_vis.FLink.zd_linkdep_out_curs.Next +inline void link_zd_linkdep_out_curs_Next(link_zd_linkdep_out_curs &curs) __attribute__((nothrow)); +// item access +// func:amc_vis.FLink.zd_linkdep_out_curs.Access +inline amc_vis::FLinkdep& link_zd_linkdep_out_curs_Access(link_zd_linkdep_out_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:amc_vis.FLink.zd_linkdep_in_curs.Reset +inline void link_zd_linkdep_in_curs_Reset(link_zd_linkdep_in_curs &curs, amc_vis::FLink &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:amc_vis.FLink.zd_linkdep_in_curs.ValidQ +inline bool link_zd_linkdep_in_curs_ValidQ(link_zd_linkdep_in_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:amc_vis.FLink.zd_linkdep_in_curs.Next +inline void link_zd_linkdep_in_curs_Next(link_zd_linkdep_in_curs &curs) __attribute__((nothrow)); +// item access +// func:amc_vis.FLink.zd_linkdep_in_curs.Access +inline amc_vis::FLinkdep& link_zd_linkdep_in_curs_Access(link_zd_linkdep_in_curs &curs) __attribute__((nothrow)); +// func:amc_vis.FLink..Uninit +void FLink_Uninit(amc_vis::FLink& link) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:amc_vis.FLink.String printfmt:Tuple +// func:amc_vis.FLink..Print +void FLink_Print(amc_vis::FLink& row, algo::cstring& str) __attribute__((nothrow)); + +// --- amc_vis.FLinkdep +// create: amc_vis.FDb.linkdep (Lary) +// global access: linkdep (Lary, by rowid) +// access: amc_vis.FLink.zd_linkdep_out (Llist) +// access: amc_vis.FLink.zd_linkdep_in (Llist) +struct FLinkdep { // amc_vis.FLinkdep: Corresponds to a field + amc_vis::FLinkdep* link_zd_linkdep_out_next; // zslist link; -1 means not-in-list + amc_vis::FLinkdep* link_zd_linkdep_out_prev; // previous element + amc_vis::FLinkdep* link_zd_linkdep_in_next; // zslist link; -1 means not-in-list + amc_vis::FLinkdep* link_zd_linkdep_in_prev; // previous element + i32 row; // 0 + i32 rowid; // 0 Id + bool up; // false Points up + bool inst; // false Instance (vs. index) + amc_vis::FLink* p_link_from; // reference to parent row + amc_vis::FLink* p_link_to; // reference to parent row + // func:amc_vis.FLinkdep..AssignOp + inline amc_vis::FLinkdep& operator =(const amc_vis::FLinkdep &rhs) = delete; + // func:amc_vis.FLinkdep..CopyCtor + inline FLinkdep(const amc_vis::FLinkdep &rhs) = delete; + // func:amc_vis.FLinkdep..FieldwiseCtor + explicit inline FLinkdep(i32 in_row, i32 in_rowid, bool in_up, bool in_inst, amc_vis::FLink* in_p_link_from, amc_vis::FLink* in_p_link_to) __attribute__((nothrow)); +private: + // func:amc_vis.FLinkdep..Ctor + inline FLinkdep() __attribute__((nothrow)); + // func:amc_vis.FLinkdep..Dtor + inline ~FLinkdep() __attribute__((nothrow)); + friend amc_vis::FLinkdep& linkdep_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc_vis::FLinkdep* linkdep_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void linkdep_RemoveAll() __attribute__((nothrow)); + friend void linkdep_RemoveLast() __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:amc_vis.FLinkdep..Init +inline void FLinkdep_Init(amc_vis::FLinkdep& linkdep); +// func:amc_vis.FLinkdep..Uninit +void FLinkdep_Uninit(amc_vis::FLinkdep& linkdep) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:amc_vis.FLinkdep.String printfmt:Tuple +// func:amc_vis.FLinkdep..Print +void FLinkdep_Print(amc_vis::FLinkdep& row, algo::cstring& str) __attribute__((nothrow)); + // --- amc_vis.Nodekey struct Nodekey { // amc_vis.Nodekey: Correspodns to a ctype - u32 n_ct_in; // 0 Number of incoming dependencies - i32 idx; // 0 Set to -rowid - i32 prev_xpos; // 99999999 + u32 n_ct_in; // 0 Number of incoming dependencies + i32 idx; // 0 Set to -rowid // func:amc_vis.Nodekey..EqOp inline bool operator ==(const amc_vis::Nodekey &rhs) const __attribute__((nothrow)); // func:amc_vis.Nodekey..NeOp @@ -1256,7 +1524,7 @@ struct Nodekey { // amc_vis.Nodekey: Correspodns to a ctype // func:amc_vis.Nodekey..Ctor inline Nodekey() __attribute__((nothrow)); // func:amc_vis.Nodekey..FieldwiseCtor - explicit inline Nodekey(u32 in_n_ct_in, i32 in_idx, i32 in_prev_xpos) __attribute__((nothrow)); + explicit inline Nodekey(u32 in_n_ct_in, i32 in_idx) __attribute__((nothrow)); }; // func:amc_vis.Nodekey..Hash @@ -1283,20 +1551,21 @@ void Nodekey_Print(amc_vis::Nodekey row, algo::cstring& str) __a // global access: node (Lary, by rowid) // global access: ind_node (Thash, hash field node) // global access: bh_node (Bheap, sort field nodekey) +// access: amc_vis.FLink.p_node1 (Upptr) +// access: amc_vis.FLink.p_node2 (Upptr) // access: amc_vis.FNodedep.p_node1 (Upptr) // access: amc_vis.FNodedep.p_node2 (Upptr) -// access: amc_vis.Link.p_node1 (Upptr) -// access: amc_vis.Link.p_node2 (Upptr) struct FNode { // amc_vis.FNode: Corresponds to a ctype amc_vis::FNode* ind_node_next; // hash next + u32 ind_node_hashval; // hash value i32 bh_node_idx; // index in heap; -1 means not-in-heap algo::Smallstr100 node; // amc_vis::Nodekey nodekey; // Sort key for columns algo::Smallstr100 label; // Display label - i32 xpos; // 1 + i32 xpos; // 0 algo::Smallstr100 label2; // Display label - amc_vis::Link* c_bottom; // Bottom. optional pointer - amc_vis::Link* c_top; // Top. optional pointer + amc_vis::FLink* c_bottom; // Bottom. optional pointer + amc_vis::FLink* c_top; // Top. optional pointer amc_vis::FCtype* p_ctype; // reference to parent row i32 rowid; // 0 amc_vis::FNodedep* zd_nodedep_out_head; // zero-terminated doubly linked list @@ -1304,12 +1573,12 @@ struct FNode { // amc_vis.FNode: Corresponds to a ctype amc_vis::FNodedep* zd_nodedep_in_head; // zero-terminated doubly linked list i32 zd_nodedep_in_n; // zero-terminated doubly linked list amc_vis::FNodedep* zd_nodedep_in_tail; // pointer to last element - amc_vis::Link* zd_link_out_head; // zero-terminated doubly linked list + amc_vis::FLink* zd_link_out_head; // zero-terminated doubly linked list i32 zd_link_out_n; // zero-terminated doubly linked list - amc_vis::Link* zd_link_out_tail; // pointer to last element - amc_vis::Link* zd_link_in_head; // zero-terminated doubly linked list + amc_vis::FLink* zd_link_out_tail; // pointer to last element + amc_vis::FLink* zd_link_in_head; // zero-terminated doubly linked list i32 zd_link_in_n; // zero-terminated doubly linked list - amc_vis::Link* zd_link_in_tail; // pointer to last element + amc_vis::FLink* zd_link_in_tail; // pointer to last element // reftype Llist of amc_vis.FNode.zd_nodedep_out prohibits copy // reftype Llist of amc_vis.FNode.zd_nodedep_in prohibits copy // reftype Llist of amc_vis.FNode.zd_link_out prohibits copy @@ -1348,7 +1617,7 @@ inline bool zd_nodedep_out_EmptyQ(amc_vis::FNode& node) __attribute__(( inline amc_vis::FNodedep* zd_nodedep_out_First(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc_vis.FNode.zd_nodedep_out.InLlistQ -inline bool zd_nodedep_out_InLlistQ(amc_vis::FNodedep& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool node_zd_nodedep_out_InLlistQ(amc_vis::FNodedep& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc_vis.FNode.zd_nodedep_out.Insert void zd_nodedep_out_Insert(amc_vis::FNode& node, amc_vis::FNodedep& row) __attribute__((nothrow)); @@ -1357,10 +1626,10 @@ void zd_nodedep_out_Insert(amc_vis::FNode& node, amc_vis::FNoded inline amc_vis::FNodedep* zd_nodedep_out_Last(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc_vis.FNode.zd_nodedep_out.Next -inline amc_vis::FNodedep* zd_nodedep_out_Next(amc_vis::FNodedep &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc_vis::FNodedep* node_zd_nodedep_out_Next(amc_vis::FNodedep &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:amc_vis.FNode.zd_nodedep_out.Prev -inline amc_vis::FNodedep* zd_nodedep_out_Prev(amc_vis::FNodedep &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc_vis::FNodedep* node_zd_nodedep_out_Prev(amc_vis::FNodedep &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:amc_vis.FNode.zd_nodedep_out.Remove void zd_nodedep_out_Remove(amc_vis::FNode& node, amc_vis::FNodedep& row) __attribute__((nothrow)); @@ -1382,7 +1651,7 @@ inline bool zd_nodedep_in_EmptyQ(amc_vis::FNode& node) __attribute__((_ inline amc_vis::FNodedep* zd_nodedep_in_First(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc_vis.FNode.zd_nodedep_in.InLlistQ -inline bool zd_nodedep_in_InLlistQ(amc_vis::FNodedep& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool node_zd_nodedep_in_InLlistQ(amc_vis::FNodedep& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc_vis.FNode.zd_nodedep_in.Insert void zd_nodedep_in_Insert(amc_vis::FNode& node, amc_vis::FNodedep& row) __attribute__((nothrow)); @@ -1394,10 +1663,10 @@ inline amc_vis::FNodedep* zd_nodedep_in_Last(amc_vis::FNode& node) __attribute__ inline i32 zd_nodedep_in_N(const amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc_vis.FNode.zd_nodedep_in.Next -inline amc_vis::FNodedep* zd_nodedep_in_Next(amc_vis::FNodedep &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc_vis::FNodedep* node_zd_nodedep_in_Next(amc_vis::FNodedep &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:amc_vis.FNode.zd_nodedep_in.Prev -inline amc_vis::FNodedep* zd_nodedep_in_Prev(amc_vis::FNodedep &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc_vis::FNodedep* node_zd_nodedep_in_Prev(amc_vis::FNodedep &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:amc_vis.FNode.zd_nodedep_in.Remove void zd_nodedep_in_Remove(amc_vis::FNode& node, amc_vis::FNodedep& row) __attribute__((nothrow)); @@ -1416,74 +1685,74 @@ inline amc_vis::FNodedep& zd_nodedep_in_qLast(amc_vis::FNode& node) __attribute_ inline bool zd_link_out_EmptyQ(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // If index empty, return NULL. Otherwise return pointer to first element in index // func:amc_vis.FNode.zd_link_out.First -inline amc_vis::Link* zd_link_out_First(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); +inline amc_vis::FLink* zd_link_out_First(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc_vis.FNode.zd_link_out.InLlistQ -inline bool zd_link_out_InLlistQ(amc_vis::Link& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool node_zd_link_out_InLlistQ(amc_vis::FLink& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc_vis.FNode.zd_link_out.Insert -void zd_link_out_Insert(amc_vis::FNode& node, amc_vis::Link& row) __attribute__((nothrow)); +void zd_link_out_Insert(amc_vis::FNode& node, amc_vis::FLink& row) __attribute__((nothrow)); // If index empty, return NULL. Otherwise return pointer to last element in index // func:amc_vis.FNode.zd_link_out.Last -inline amc_vis::Link* zd_link_out_Last(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); +inline amc_vis::FLink* zd_link_out_Last(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // Return number of items in the linked list // func:amc_vis.FNode.zd_link_out.N inline i32 zd_link_out_N(const amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc_vis.FNode.zd_link_out.Next -inline amc_vis::Link* zd_link_out_Next(amc_vis::Link &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc_vis::FLink* node_zd_link_out_Next(amc_vis::FLink &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:amc_vis.FNode.zd_link_out.Prev -inline amc_vis::Link* zd_link_out_Prev(amc_vis::Link &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc_vis::FLink* node_zd_link_out_Prev(amc_vis::FLink &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:amc_vis.FNode.zd_link_out.Remove -void zd_link_out_Remove(amc_vis::FNode& node, amc_vis::Link& row) __attribute__((nothrow)); +void zd_link_out_Remove(amc_vis::FNode& node, amc_vis::FLink& row) __attribute__((nothrow)); // Empty the index. (The rows are not deleted) // func:amc_vis.FNode.zd_link_out.RemoveAll void zd_link_out_RemoveAll(amc_vis::FNode& node) __attribute__((nothrow)); // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. // func:amc_vis.FNode.zd_link_out.RemoveFirst -amc_vis::Link* zd_link_out_RemoveFirst(amc_vis::FNode& node) __attribute__((nothrow)); +amc_vis::FLink* zd_link_out_RemoveFirst(amc_vis::FNode& node) __attribute__((nothrow)); // Return reference to last element in the index. No bounds checking. // func:amc_vis.FNode.zd_link_out.qLast -inline amc_vis::Link& zd_link_out_qLast(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow)); +inline amc_vis::FLink& zd_link_out_qLast(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:amc_vis.FNode.zd_link_in.EmptyQ inline bool zd_link_in_EmptyQ(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // If index empty, return NULL. Otherwise return pointer to first element in index // func:amc_vis.FNode.zd_link_in.First -inline amc_vis::Link* zd_link_in_First(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); +inline amc_vis::FLink* zd_link_in_First(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:amc_vis.FNode.zd_link_in.InLlistQ -inline bool zd_link_in_InLlistQ(amc_vis::Link& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool node_zd_link_in_InLlistQ(amc_vis::FLink& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:amc_vis.FNode.zd_link_in.Insert -void zd_link_in_Insert(amc_vis::FNode& node, amc_vis::Link& row) __attribute__((nothrow)); +void zd_link_in_Insert(amc_vis::FNode& node, amc_vis::FLink& row) __attribute__((nothrow)); // If index empty, return NULL. Otherwise return pointer to last element in index // func:amc_vis.FNode.zd_link_in.Last -inline amc_vis::Link* zd_link_in_Last(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); +inline amc_vis::FLink* zd_link_in_Last(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // Return number of items in the linked list // func:amc_vis.FNode.zd_link_in.N inline i32 zd_link_in_N(const amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:amc_vis.FNode.zd_link_in.Next -inline amc_vis::Link* zd_link_in_Next(amc_vis::Link &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc_vis::FLink* node_zd_link_in_Next(amc_vis::FLink &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:amc_vis.FNode.zd_link_in.Prev -inline amc_vis::Link* zd_link_in_Prev(amc_vis::Link &row) __attribute__((__warn_unused_result__, nothrow)); +inline amc_vis::FLink* node_zd_link_in_Prev(amc_vis::FLink &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:amc_vis.FNode.zd_link_in.Remove -void zd_link_in_Remove(amc_vis::FNode& node, amc_vis::Link& row) __attribute__((nothrow)); +void zd_link_in_Remove(amc_vis::FNode& node, amc_vis::FLink& row) __attribute__((nothrow)); // Empty the index. (The rows are not deleted) // func:amc_vis.FNode.zd_link_in.RemoveAll void zd_link_in_RemoveAll(amc_vis::FNode& node) __attribute__((nothrow)); // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. // func:amc_vis.FNode.zd_link_in.RemoveFirst -amc_vis::Link* zd_link_in_RemoveFirst(amc_vis::FNode& node) __attribute__((nothrow)); +amc_vis::FLink* zd_link_in_RemoveFirst(amc_vis::FNode& node) __attribute__((nothrow)); // Return reference to last element in the index. No bounds checking. // func:amc_vis.FNode.zd_link_in.qLast -inline amc_vis::Link& zd_link_in_qLast(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow)); +inline amc_vis::FLink& zd_link_in_qLast(amc_vis::FNode& node) __attribute__((__warn_unused_result__, nothrow)); // Set all fields to initial values. // func:amc_vis.FNode..Init @@ -1523,7 +1792,7 @@ inline bool node_zd_link_out_curs_ValidQ(node_zd_link_out_curs &curs) _ inline void node_zd_link_out_curs_Next(node_zd_link_out_curs &curs) __attribute__((nothrow)); // item access // func:amc_vis.FNode.zd_link_out_curs.Access -inline amc_vis::Link& node_zd_link_out_curs_Access(node_zd_link_out_curs &curs) __attribute__((nothrow)); +inline amc_vis::FLink& node_zd_link_out_curs_Access(node_zd_link_out_curs &curs) __attribute__((nothrow)); // cursor points to valid item // func:amc_vis.FNode.zd_link_in_curs.Reset inline void node_zd_link_in_curs_Reset(node_zd_link_in_curs &curs, amc_vis::FNode &parent) __attribute__((nothrow)); @@ -1535,7 +1804,7 @@ inline bool node_zd_link_in_curs_ValidQ(node_zd_link_in_curs &curs) __a inline void node_zd_link_in_curs_Next(node_zd_link_in_curs &curs) __attribute__((nothrow)); // item access // func:amc_vis.FNode.zd_link_in_curs.Access -inline amc_vis::Link& node_zd_link_in_curs_Access(node_zd_link_in_curs &curs) __attribute__((nothrow)); +inline amc_vis::FLink& node_zd_link_in_curs_Access(node_zd_link_in_curs &curs) __attribute__((nothrow)); // func:amc_vis.FNode..Uninit void FNode_Uninit(amc_vis::FNode& node) __attribute__((nothrow)); @@ -1545,18 +1814,18 @@ void FNode_Uninit(amc_vis::FNode& node) __attribute__((nothrow)) // access: amc_vis.FNode.zd_nodedep_out (Llist) // access: amc_vis.FNode.zd_nodedep_in (Llist) struct FNodedep { // amc_vis.FNodedep: Edge for computing node dependencies - amc_vis::FNodedep* zd_nodedep_out_next; // zslist link; -1 means not-in-list - amc_vis::FNodedep* zd_nodedep_out_prev; // previous element - amc_vis::FNodedep* zd_nodedep_in_next; // zslist link; -1 means not-in-list - amc_vis::FNodedep* zd_nodedep_in_prev; // previous element - i32 row; // 0 - i32 rowid; // 0 Id - bool up; // false Points up - bool inst; // false Instance (vs. index) - amc_vis::FNode* p_node1; // reference to parent row - amc_vis::FNode* p_node2; // reference to parent row - algo::Smallstr50 name; // - algo::Smallstr50 reftype; // + amc_vis::FNodedep* node_zd_nodedep_out_next; // zslist link; -1 means not-in-list + amc_vis::FNodedep* node_zd_nodedep_out_prev; // previous element + amc_vis::FNodedep* node_zd_nodedep_in_next; // zslist link; -1 means not-in-list + amc_vis::FNodedep* node_zd_nodedep_in_prev; // previous element + i32 row; // 0 + i32 rowid; // 0 Id + bool up; // false Points up + bool inst; // false Instance (vs. index) + amc_vis::FNode* p_node1; // reference to parent row + amc_vis::FNode* p_node2; // reference to parent row + algo::Smallstr50 name; // + algo::Smallstr50 reftype; // // func:amc_vis.FNodedep..AssignOp inline amc_vis::FNodedep& operator =(const amc_vis::FNodedep &rhs) = delete; // func:amc_vis.FNodedep..CopyCtor @@ -1580,25 +1849,152 @@ inline void FNodedep_Init(amc_vis::FNodedep& nodedep); // func:amc_vis.FNodedep..Uninit void FNodedep_Uninit(amc_vis::FNodedep& nodedep) __attribute__((nothrow)); +// --- amc_vis.FOutrow +// create: amc_vis.FDb.outrow (Lary) +// global access: outrow (Lary, by rowid) +struct FOutrow { // amc_vis.FOutrow: One line of text + i32 rowid; // 0 FOutrow pkey + u16* text_elems; // pointer to elements + u32 text_n; // number of elements in array + u32 text_max; // max. capacity of array before realloc + // func:amc_vis.FOutrow..AssignOp + amc_vis::FOutrow& operator =(const amc_vis::FOutrow &rhs) __attribute__((nothrow)); + // func:amc_vis.FOutrow..CopyCtor + FOutrow(const amc_vis::FOutrow &rhs) __attribute__((nothrow)); +private: + // func:amc_vis.FOutrow..Ctor + inline FOutrow() __attribute__((nothrow)); + // func:amc_vis.FOutrow..Dtor + inline ~FOutrow() __attribute__((nothrow)); + friend amc_vis::FOutrow& outrow_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc_vis::FOutrow* outrow_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void outrow_RemoveAll() __attribute__((nothrow)); + friend void outrow_RemoveLast() __attribute__((nothrow)); +}; + +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:amc_vis.FOutrow.text.Addary +algo::aryptr text_Addary(amc_vis::FOutrow& outrow, algo::aryptr rhs) __attribute__((nothrow)); +// Reserve space. Insert element at the end +// The new element is initialized to a default value +// func:amc_vis.FOutrow.text.Alloc +u16& text_Alloc(amc_vis::FOutrow& outrow) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:amc_vis.FOutrow.text.AllocAt +u16& text_AllocAt(amc_vis::FOutrow& outrow, int at) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:amc_vis.FOutrow.text.AllocN +algo::aryptr text_AllocN(amc_vis::FOutrow& outrow, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:amc_vis.FOutrow.text.AllocNAt +algo::aryptr text_AllocNAt(amc_vis::FOutrow& outrow, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:amc_vis.FOutrow.text.EmptyQ +inline bool text_EmptyQ(amc_vis::FOutrow& outrow) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:amc_vis.FOutrow.text.Find +inline u16* text_Find(amc_vis::FOutrow& outrow, u64 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array pointer by value +// func:amc_vis.FOutrow.text.Getary +inline algo::aryptr text_Getary(const amc_vis::FOutrow& outrow) __attribute__((nothrow)); +// Return pointer to last element of array, or NULL if array is empty +// func:amc_vis.FOutrow.text.Last +inline u16* text_Last(amc_vis::FOutrow& outrow) __attribute__((nothrow, pure)); +// Return max. number of items in the array +// func:amc_vis.FOutrow.text.Max +inline i32 text_Max(amc_vis::FOutrow& outrow) __attribute__((nothrow)); +// Return number of items in the array +// func:amc_vis.FOutrow.text.N +inline i32 text_N(const amc_vis::FOutrow& outrow) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove item by index. If index outside of range, do nothing. +// func:amc_vis.FOutrow.text.Remove +void text_Remove(amc_vis::FOutrow& outrow, u32 i) __attribute__((nothrow)); +// func:amc_vis.FOutrow.text.RemoveAll +inline void text_RemoveAll(amc_vis::FOutrow& outrow) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:amc_vis.FOutrow.text.RemoveLast +void text_RemoveLast(amc_vis::FOutrow& outrow) __attribute__((nothrow)); +// Make sure N *more* elements will fit in array. Process dies if out of memory +// func:amc_vis.FOutrow.text.Reserve +inline void text_Reserve(amc_vis::FOutrow& outrow, int n) __attribute__((nothrow)); +// Make sure N elements fit in array. Process dies if out of memory +// func:amc_vis.FOutrow.text.AbsReserve +void text_AbsReserve(amc_vis::FOutrow& outrow, int n) __attribute__((nothrow)); +// Copy contents of RHS to PARENT. +// func:amc_vis.FOutrow.text.Setary +void text_Setary(amc_vis::FOutrow& outrow, amc_vis::FOutrow &rhs) __attribute__((nothrow)); +// Copy specified array into text, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +// func:amc_vis.FOutrow.text.Setary2 +void text_Setary(amc_vis::FOutrow& outrow, const algo::aryptr &rhs) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:amc_vis.FOutrow.text.qFind +inline u16& text_qFind(amc_vis::FOutrow& outrow, u64 t) __attribute__((nothrow)); +// Return reference to last element of array. No bounds checking +// func:amc_vis.FOutrow.text.qLast +inline u16& text_qLast(amc_vis::FOutrow& outrow) __attribute__((nothrow)); +// Return row id of specified element +// func:amc_vis.FOutrow.text.rowid_Get +inline u64 text_rowid_Get(amc_vis::FOutrow& outrow, u16 &elem) __attribute__((nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:amc_vis.FOutrow.text.AllocNVal +algo::aryptr text_AllocNVal(amc_vis::FOutrow& outrow, int n_elems, const u16& val) __attribute__((nothrow)); +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +// func:amc_vis.FOutrow.text.ReadStrptrMaybe +bool text_ReadStrptrMaybe(amc_vis::FOutrow& outrow, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:amc_vis.FOutrow.text.Insary +void text_Insary(amc_vis::FOutrow& outrow, algo::aryptr rhs, int at) __attribute__((nothrow)); + +// proceed to next item +// func:amc_vis.FOutrow.text_curs.Next +inline void outrow_text_curs_Next(outrow_text_curs &curs) __attribute__((nothrow)); +// func:amc_vis.FOutrow.text_curs.Reset +inline void outrow_text_curs_Reset(outrow_text_curs &curs, amc_vis::FOutrow &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:amc_vis.FOutrow.text_curs.ValidQ +inline bool outrow_text_curs_ValidQ(outrow_text_curs &curs) __attribute__((nothrow)); +// item access +// func:amc_vis.FOutrow.text_curs.Access +inline u16& outrow_text_curs_Access(outrow_text_curs &curs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:amc_vis.FOutrow..Init +inline void FOutrow_Init(amc_vis::FOutrow& outrow); +// func:amc_vis.FOutrow..Uninit +void FOutrow_Uninit(amc_vis::FOutrow& outrow) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:amc_vis.FOutrow.String printfmt:Tuple +// func:amc_vis.FOutrow..Print +void FOutrow_Print(amc_vis::FOutrow& row, algo::cstring& str) __attribute__((nothrow)); + // --- amc_vis.FReftype // create: amc_vis.FDb.reftype (Lary) // global access: reftype (Lary, by rowid) // global access: ind_reftype (Thash, hash field reftype) // access: amc_vis.FField.p_reftype (Upptr) struct FReftype { // amc_vis.FReftype - amc_vis::FReftype* ind_reftype_next; // hash next - algo::Smallstr50 reftype; // "Val" - bool isval; // false True if field makes values of target type - bool cascins; // false Field is cascade-insert - bool usebasepool; // false Fields with this type make use of dmmeta.basepool - bool cancopy; // false This type of field can be copied - bool isxref; // false This type of field is an x-ref - bool del; // false Supports random deletion? - bool up; // false This type of field is a reference - bool isnew; // false If set, skip this relation in amc_vis - bool hasalloc; // false Generte Alloc/Delete functions for arg type - bool inst; // false Field creates an instance of arg type (directly or indirectly) - bool varlen; // false This pool supports varlen allocations + amc_vis::FReftype* ind_reftype_next; // hash next + u32 ind_reftype_hashval; // hash value + algo::Smallstr50 reftype; // "Val" + bool isval; // false True if field makes values of target type + bool cascins; // false Field is cascade-insert + bool usebasepool; // false Fields with this type make use of dmmeta.basepool + bool cancopy; // false This type of field can be copied + bool isxref; // false This type of field is an x-ref + bool del; // false Supports random deletion? + bool up; // false This type of field is a reference + bool isnew; // false If set, skip this relation in amc_vis + bool hasalloc; // false Generte Alloc/Delete functions for arg type + bool inst; // false Field creates an instance of arg type (directly or indirectly) + bool varlen; // false This pool supports varlen allocations // func:amc_vis.FReftype..AssignOp amc_vis::FReftype& operator =(const amc_vis::FReftype &rhs) = delete; // func:amc_vis.FReftype..CopyCtor @@ -1680,371 +2076,6 @@ inline void FieldId_Init(amc_vis::FieldId& parent); // func:amc_vis.FieldId..Print void FieldId_Print(amc_vis::FieldId& row, algo::cstring& str) __attribute__((nothrow)); -// --- amc_vis.Linkkey -struct Linkkey { // amc_vis.Linkkey: Correspodns to a ctype - u32 n_link_in; // 0 Number of incoming dependencies - i32 samecol; // 0 Set on links that lead to the same col - i32 colweight; // 0 Smaller cols are scheduled first - i32 topbot; // 0 Set to -1 for bottoms and tops to schedule them sooner - // func:amc_vis.Linkkey..EqOp - inline bool operator ==(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..NeOp - inline bool operator !=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..LtOp - inline bool operator <(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..GtOp - inline bool operator >(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..LeOp - inline bool operator <=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..GeOp - inline bool operator >=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..Ctor - inline Linkkey() __attribute__((nothrow)); - // func:amc_vis.Linkkey..FieldwiseCtor - explicit inline Linkkey(u32 in_n_link_in, i32 in_samecol, i32 in_colweight, i32 in_topbot) __attribute__((nothrow)); -}; - -// func:amc_vis.Linkkey..Hash -inline u32 Linkkey_Hash(u32 prev, amc_vis::Linkkey rhs) __attribute__((nothrow)); -// func:amc_vis.Linkkey..Lt -inline bool Linkkey_Lt(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) __attribute__((nothrow)); -// func:amc_vis.Linkkey..Cmp -i32 Linkkey_Cmp(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) __attribute__((nothrow)); -// Set all fields to initial values. -// func:amc_vis.Linkkey..Init -inline void Linkkey_Init(amc_vis::Linkkey& parent); -// func:amc_vis.Linkkey..Eq -bool Linkkey_Eq(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) __attribute__((nothrow)); -// Set value. Return true if new value is different from old value. -// func:amc_vis.Linkkey..Update -inline bool Linkkey_Update(amc_vis::Linkkey &lhs, amc_vis::Linkkey rhs) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:amc_vis.Linkkey.String printfmt:Tuple -// func:amc_vis.Linkkey..Print -void Linkkey_Print(amc_vis::Linkkey row, algo::cstring& str) __attribute__((nothrow)); - -// --- amc_vis.Link -// create: amc_vis.FDb.link (Lary) -// global access: link (Lary, by rowid) -// global access: ind_link (Thash, hash field link) -// global access: c_linklist (Ptrary) -// global access: bh_link (Bheap, sort field linkkey) -// access: amc_vis.FNode.c_bottom (Ptr) -// access: amc_vis.FNode.c_top (Ptr) -// access: amc_vis.FNode.zd_link_out (Llist) -// access: amc_vis.FNode.zd_link_in (Llist) -// access: amc_vis.Linkdep.p_link_from (Upptr) -// access: amc_vis.Linkdep.p_link_to (Upptr) -struct Link { // amc_vis.Link: Correspodns to a ctype - amc_vis::Link* ind_link_next; // hash next - i32 bh_link_idx; // index in heap; -1 means not-in-heap - amc_vis::Link* zd_link_out_next; // zslist link; -1 means not-in-list - amc_vis::Link* zd_link_out_prev; // previous element - amc_vis::Link* zd_link_in_next; // zslist link; -1 means not-in-list - amc_vis::Link* zd_link_in_prev; // previous element - algo::Smallstr100 link; // Primary key - algo::Smallstr100 label1; // Label in column 1 - algo::Smallstr100 label2; // Label in column 2 - amc_vis::Linkkey linkkey; // - i32 outrow; // 0 Outrow # - amc_vis::FNode* p_node1; // reference to parent row - amc_vis::FNode* p_node2; // reference to parent row - bool upptr; // false Up-arrow (not a constraint) - amc_vis::Linkdep* zd_linkdep_out_head; // zero-terminated doubly linked list - amc_vis::Linkdep* zd_linkdep_out_tail; // pointer to last element - amc_vis::Linkdep* zd_linkdep_in_head; // zero-terminated doubly linked list - amc_vis::Linkdep* zd_linkdep_in_tail; // pointer to last element - bool _db_c_linklist_in_ary; // false membership flag - // reftype Llist of amc_vis.Link.zd_linkdep_out prohibits copy - // reftype Llist of amc_vis.Link.zd_linkdep_in prohibits copy - // func:amc_vis.Link..AssignOp - amc_vis::Link& operator =(const amc_vis::Link &rhs) = delete; - // reftype Llist of amc_vis.Link.zd_linkdep_out prohibits copy - // reftype Llist of amc_vis.Link.zd_linkdep_in prohibits copy - // func:amc_vis.Link..CopyCtor - Link(const amc_vis::Link &rhs) = delete; -private: - // func:amc_vis.Link..Ctor - inline Link() __attribute__((nothrow)); - // func:amc_vis.Link..Dtor - inline ~Link() __attribute__((nothrow)); - friend amc_vis::Link& link_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend amc_vis::Link* link_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void link_RemoveAll() __attribute__((nothrow)); - friend void link_RemoveLast() __attribute__((nothrow)); -}; - -// Compare two fields. Comparison is anti-symmetric: if a>b, then !(b>a). -// func:amc_vis.Link.linkkey.Lt -inline bool linkkey_Lt(amc_vis::Link& link, amc_vis::Link &rhs) __attribute__((nothrow)); -// Compare two fields. -// func:amc_vis.Link.linkkey.Cmp -inline i32 linkkey_Cmp(amc_vis::Link& link, amc_vis::Link &rhs) __attribute__((nothrow)); - -// Return true if index is empty -// func:amc_vis.Link.zd_linkdep_out.EmptyQ -inline bool zd_linkdep_out_EmptyQ(amc_vis::Link& link) __attribute__((__warn_unused_result__, nothrow, pure)); -// If index empty, return NULL. Otherwise return pointer to first element in index -// func:amc_vis.Link.zd_linkdep_out.First -inline amc_vis::Linkdep* zd_linkdep_out_First(amc_vis::Link& link) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return true if row is in the linked list, false otherwise -// func:amc_vis.Link.zd_linkdep_out.InLlistQ -inline bool zd_linkdep_out_InLlistQ(amc_vis::Linkdep& row) __attribute__((__warn_unused_result__, nothrow)); -// Insert row into linked list. If row is already in linked list, do nothing. -// func:amc_vis.Link.zd_linkdep_out.Insert -void zd_linkdep_out_Insert(amc_vis::Link& link, amc_vis::Linkdep& row) __attribute__((nothrow)); -// If index empty, return NULL. Otherwise return pointer to last element in index -// func:amc_vis.Link.zd_linkdep_out.Last -inline amc_vis::Linkdep* zd_linkdep_out_Last(amc_vis::Link& link) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return pointer to next element in the list -// func:amc_vis.Link.zd_linkdep_out.Next -inline amc_vis::Linkdep* zd_linkdep_out_Next(amc_vis::Linkdep &row) __attribute__((__warn_unused_result__, nothrow)); -// Return pointer to previous element in the list -// func:amc_vis.Link.zd_linkdep_out.Prev -inline amc_vis::Linkdep* zd_linkdep_out_Prev(amc_vis::Linkdep &row) __attribute__((__warn_unused_result__, nothrow)); -// Remove element from index. If element is not in index, do nothing. -// func:amc_vis.Link.zd_linkdep_out.Remove -void zd_linkdep_out_Remove(amc_vis::Link& link, amc_vis::Linkdep& row) __attribute__((nothrow)); -// Empty the index. (The rows are not deleted) -// func:amc_vis.Link.zd_linkdep_out.RemoveAll -void zd_linkdep_out_RemoveAll(amc_vis::Link& link) __attribute__((nothrow)); -// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -// func:amc_vis.Link.zd_linkdep_out.RemoveFirst -amc_vis::Linkdep* zd_linkdep_out_RemoveFirst(amc_vis::Link& link) __attribute__((nothrow)); -// Return reference to last element in the index. No bounds checking. -// func:amc_vis.Link.zd_linkdep_out.qLast -inline amc_vis::Linkdep& zd_linkdep_out_qLast(amc_vis::Link& link) __attribute__((__warn_unused_result__, nothrow)); - -// Return true if index is empty -// func:amc_vis.Link.zd_linkdep_in.EmptyQ -inline bool zd_linkdep_in_EmptyQ(amc_vis::Link& link) __attribute__((__warn_unused_result__, nothrow, pure)); -// If index empty, return NULL. Otherwise return pointer to first element in index -// func:amc_vis.Link.zd_linkdep_in.First -inline amc_vis::Linkdep* zd_linkdep_in_First(amc_vis::Link& link) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return true if row is in the linked list, false otherwise -// func:amc_vis.Link.zd_linkdep_in.InLlistQ -inline bool zd_linkdep_in_InLlistQ(amc_vis::Linkdep& row) __attribute__((__warn_unused_result__, nothrow)); -// Insert row into linked list. If row is already in linked list, do nothing. -// func:amc_vis.Link.zd_linkdep_in.Insert -void zd_linkdep_in_Insert(amc_vis::Link& link, amc_vis::Linkdep& row) __attribute__((nothrow)); -// If index empty, return NULL. Otherwise return pointer to last element in index -// func:amc_vis.Link.zd_linkdep_in.Last -inline amc_vis::Linkdep* zd_linkdep_in_Last(amc_vis::Link& link) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return pointer to next element in the list -// func:amc_vis.Link.zd_linkdep_in.Next -inline amc_vis::Linkdep* zd_linkdep_in_Next(amc_vis::Linkdep &row) __attribute__((__warn_unused_result__, nothrow)); -// Return pointer to previous element in the list -// func:amc_vis.Link.zd_linkdep_in.Prev -inline amc_vis::Linkdep* zd_linkdep_in_Prev(amc_vis::Linkdep &row) __attribute__((__warn_unused_result__, nothrow)); -// Remove element from index. If element is not in index, do nothing. -// func:amc_vis.Link.zd_linkdep_in.Remove -void zd_linkdep_in_Remove(amc_vis::Link& link, amc_vis::Linkdep& row) __attribute__((nothrow)); -// Empty the index. (The rows are not deleted) -// func:amc_vis.Link.zd_linkdep_in.RemoveAll -void zd_linkdep_in_RemoveAll(amc_vis::Link& link) __attribute__((nothrow)); -// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -// func:amc_vis.Link.zd_linkdep_in.RemoveFirst -amc_vis::Linkdep* zd_linkdep_in_RemoveFirst(amc_vis::Link& link) __attribute__((nothrow)); -// Return reference to last element in the index. No bounds checking. -// func:amc_vis.Link.zd_linkdep_in.qLast -inline amc_vis::Linkdep& zd_linkdep_in_qLast(amc_vis::Link& link) __attribute__((__warn_unused_result__, nothrow)); - -// Set all fields to initial values. -// func:amc_vis.Link..Init -void Link_Init(amc_vis::Link& link); -// cursor points to valid item -// func:amc_vis.Link.zd_linkdep_out_curs.Reset -inline void link_zd_linkdep_out_curs_Reset(link_zd_linkdep_out_curs &curs, amc_vis::Link &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:amc_vis.Link.zd_linkdep_out_curs.ValidQ -inline bool link_zd_linkdep_out_curs_ValidQ(link_zd_linkdep_out_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:amc_vis.Link.zd_linkdep_out_curs.Next -inline void link_zd_linkdep_out_curs_Next(link_zd_linkdep_out_curs &curs) __attribute__((nothrow)); -// item access -// func:amc_vis.Link.zd_linkdep_out_curs.Access -inline amc_vis::Linkdep& link_zd_linkdep_out_curs_Access(link_zd_linkdep_out_curs &curs) __attribute__((nothrow)); -// cursor points to valid item -// func:amc_vis.Link.zd_linkdep_in_curs.Reset -inline void link_zd_linkdep_in_curs_Reset(link_zd_linkdep_in_curs &curs, amc_vis::Link &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:amc_vis.Link.zd_linkdep_in_curs.ValidQ -inline bool link_zd_linkdep_in_curs_ValidQ(link_zd_linkdep_in_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:amc_vis.Link.zd_linkdep_in_curs.Next -inline void link_zd_linkdep_in_curs_Next(link_zd_linkdep_in_curs &curs) __attribute__((nothrow)); -// item access -// func:amc_vis.Link.zd_linkdep_in_curs.Access -inline amc_vis::Linkdep& link_zd_linkdep_in_curs_Access(link_zd_linkdep_in_curs &curs) __attribute__((nothrow)); -// func:amc_vis.Link..Uninit -void Link_Uninit(amc_vis::Link& link) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:amc_vis.Link.String printfmt:Tuple -// func:amc_vis.Link..Print -void Link_Print(amc_vis::Link& row, algo::cstring& str) __attribute__((nothrow)); - -// --- amc_vis.Linkdep -// create: amc_vis.FDb.linkdep (Lary) -// global access: linkdep (Lary, by rowid) -// access: amc_vis.Link.zd_linkdep_out (Llist) -// access: amc_vis.Link.zd_linkdep_in (Llist) -struct Linkdep { // amc_vis.Linkdep: Corresponds to a field - amc_vis::Linkdep* zd_linkdep_out_next; // zslist link; -1 means not-in-list - amc_vis::Linkdep* zd_linkdep_out_prev; // previous element - amc_vis::Linkdep* zd_linkdep_in_next; // zslist link; -1 means not-in-list - amc_vis::Linkdep* zd_linkdep_in_prev; // previous element - i32 row; // 0 - i32 rowid; // 0 Id - bool up; // false Points up - bool inst; // false Instance (vs. index) - amc_vis::Link* p_link_from; // reference to parent row - amc_vis::Link* p_link_to; // reference to parent row - // func:amc_vis.Linkdep..AssignOp - inline amc_vis::Linkdep& operator =(const amc_vis::Linkdep &rhs) = delete; - // func:amc_vis.Linkdep..CopyCtor - inline Linkdep(const amc_vis::Linkdep &rhs) = delete; - // func:amc_vis.Linkdep..FieldwiseCtor - explicit inline Linkdep(i32 in_row, i32 in_rowid, bool in_up, bool in_inst, amc_vis::Link* in_p_link_from, amc_vis::Link* in_p_link_to) __attribute__((nothrow)); -private: - // func:amc_vis.Linkdep..Ctor - inline Linkdep() __attribute__((nothrow)); - // func:amc_vis.Linkdep..Dtor - inline ~Linkdep() __attribute__((nothrow)); - friend amc_vis::Linkdep& linkdep_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend amc_vis::Linkdep* linkdep_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void linkdep_RemoveAll() __attribute__((nothrow)); - friend void linkdep_RemoveLast() __attribute__((nothrow)); -}; - -// Set all fields to initial values. -// func:amc_vis.Linkdep..Init -inline void Linkdep_Init(amc_vis::Linkdep& linkdep); -// func:amc_vis.Linkdep..Uninit -void Linkdep_Uninit(amc_vis::Linkdep& linkdep) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:amc_vis.Linkdep.String printfmt:Tuple -// func:amc_vis.Linkdep..Print -void Linkdep_Print(amc_vis::Linkdep& row, algo::cstring& str) __attribute__((nothrow)); - -// --- amc_vis.Outrow -// create: amc_vis.FDb.outrow (Lary) -// global access: outrow (Lary, by rowid) -struct Outrow { // amc_vis.Outrow: One line of text - i32 rowid; // 0 Outrow pkey - u8* text_elems; // pointer to elements - u32 text_n; // number of elements in array - u32 text_max; // max. capacity of array before realloc - // func:amc_vis.Outrow..AssignOp - amc_vis::Outrow& operator =(const amc_vis::Outrow &rhs) __attribute__((nothrow)); - // func:amc_vis.Outrow..CopyCtor - Outrow(const amc_vis::Outrow &rhs) __attribute__((nothrow)); -private: - // func:amc_vis.Outrow..Ctor - inline Outrow() __attribute__((nothrow)); - // func:amc_vis.Outrow..Dtor - inline ~Outrow() __attribute__((nothrow)); - friend amc_vis::Outrow& outrow_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend amc_vis::Outrow* outrow_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void outrow_RemoveAll() __attribute__((nothrow)); - friend void outrow_RemoveLast() __attribute__((nothrow)); -}; - -// Reserve space (this may move memory). Insert N element at the end. -// Return aryptr to newly inserted block. -// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. -// func:amc_vis.Outrow.text.Addary -algo::aryptr text_Addary(amc_vis::Outrow& outrow, algo::aryptr rhs) __attribute__((nothrow)); -// Reserve space. Insert element at the end -// The new element is initialized to a default value -// func:amc_vis.Outrow.text.Alloc -u8& text_Alloc(amc_vis::Outrow& outrow) __attribute__((__warn_unused_result__, nothrow)); -// Reserve space for new element, reallocating the array if necessary -// Insert new element at specified index. Index must be in range or a fatal error occurs. -// func:amc_vis.Outrow.text.AllocAt -u8& text_AllocAt(amc_vis::Outrow& outrow, int at) __attribute__((__warn_unused_result__, nothrow)); -// Reserve space. Insert N elements at the end of the array, return pointer to array -// func:amc_vis.Outrow.text.AllocN -algo::aryptr text_AllocN(amc_vis::Outrow& outrow, int n_elems) __attribute__((__warn_unused_result__, nothrow)); -// Return true if index is empty -// func:amc_vis.Outrow.text.EmptyQ -inline bool text_EmptyQ(amc_vis::Outrow& outrow) __attribute__((nothrow)); -// Look up row by row id. Return NULL if out of range -// func:amc_vis.Outrow.text.Find -inline u8* text_Find(amc_vis::Outrow& outrow, u64 t) __attribute__((__warn_unused_result__, nothrow)); -// Return array pointer by value -// func:amc_vis.Outrow.text.Getary -inline algo::aryptr text_Getary(const amc_vis::Outrow& outrow) __attribute__((nothrow)); -// Return pointer to last element of array, or NULL if array is empty -// func:amc_vis.Outrow.text.Last -inline u8* text_Last(amc_vis::Outrow& outrow) __attribute__((nothrow, pure)); -// Return max. number of items in the array -// func:amc_vis.Outrow.text.Max -inline i32 text_Max(amc_vis::Outrow& outrow) __attribute__((nothrow)); -// Return number of items in the array -// func:amc_vis.Outrow.text.N -inline i32 text_N(const amc_vis::Outrow& outrow) __attribute__((__warn_unused_result__, nothrow, pure)); -// Remove item by index. If index outside of range, do nothing. -// func:amc_vis.Outrow.text.Remove -void text_Remove(amc_vis::Outrow& outrow, u32 i) __attribute__((nothrow)); -// func:amc_vis.Outrow.text.RemoveAll -inline void text_RemoveAll(amc_vis::Outrow& outrow) __attribute__((nothrow)); -// Delete last element of array. Do nothing if array is empty. -// func:amc_vis.Outrow.text.RemoveLast -void text_RemoveLast(amc_vis::Outrow& outrow) __attribute__((nothrow)); -// Make sure N *more* elements will fit in array. Process dies if out of memory -// func:amc_vis.Outrow.text.Reserve -inline void text_Reserve(amc_vis::Outrow& outrow, int n) __attribute__((nothrow)); -// Make sure N elements fit in array. Process dies if out of memory -// func:amc_vis.Outrow.text.AbsReserve -void text_AbsReserve(amc_vis::Outrow& outrow, int n) __attribute__((nothrow)); -// Convert text to a string. -// Array is printed as a regular string. -// func:amc_vis.Outrow.text.Print -void text_Print(amc_vis::Outrow& outrow, algo::cstring &rhs) __attribute__((nothrow)); -// Copy contents of RHS to PARENT. -// func:amc_vis.Outrow.text.Setary -void text_Setary(amc_vis::Outrow& outrow, amc_vis::Outrow &rhs) __attribute__((nothrow)); -// Copy specified array into text, discarding previous contents. -// If the RHS argument aliases the array (refers to the same memory), throw exception. -// func:amc_vis.Outrow.text.Setary2 -void text_Setary(amc_vis::Outrow& outrow, const algo::aryptr &rhs) __attribute__((nothrow)); -// 'quick' Access row by row id. No bounds checking. -// func:amc_vis.Outrow.text.qFind -inline u8& text_qFind(amc_vis::Outrow& outrow, u64 t) __attribute__((nothrow)); -// Return reference to last element of array. No bounds checking -// func:amc_vis.Outrow.text.qLast -inline u8& text_qLast(amc_vis::Outrow& outrow) __attribute__((nothrow)); -// Return row id of specified element -// func:amc_vis.Outrow.text.rowid_Get -inline u64 text_rowid_Get(amc_vis::Outrow& outrow, u8 &elem) __attribute__((nothrow)); -// Reserve space. Insert N elements at the end of the array, return pointer to array -// func:amc_vis.Outrow.text.AllocNVal -algo::aryptr text_AllocNVal(amc_vis::Outrow& outrow, int n_elems, const u8& val) __attribute__((nothrow)); -// The array is replaced with the input string. Function always succeeds. -// func:amc_vis.Outrow.text.ReadStrptrMaybe -bool text_ReadStrptrMaybe(amc_vis::Outrow& outrow, algo::strptr in_str) __attribute__((nothrow)); - -// proceed to next item -// func:amc_vis.Outrow.text_curs.Next -inline void outrow_text_curs_Next(outrow_text_curs &curs) __attribute__((nothrow)); -// func:amc_vis.Outrow.text_curs.Reset -inline void outrow_text_curs_Reset(outrow_text_curs &curs, amc_vis::Outrow &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:amc_vis.Outrow.text_curs.ValidQ -inline bool outrow_text_curs_ValidQ(outrow_text_curs &curs) __attribute__((nothrow)); -// item access -// func:amc_vis.Outrow.text_curs.Access -inline u8& outrow_text_curs_Access(outrow_text_curs &curs) __attribute__((nothrow)); -// Set all fields to initial values. -// func:amc_vis.Outrow..Init -inline void Outrow_Init(amc_vis::Outrow& outrow); -// func:amc_vis.Outrow..Uninit -void Outrow_Uninit(amc_vis::Outrow& outrow) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:amc_vis.Outrow.String printfmt:Tuple -// func:amc_vis.Outrow..Print -void Outrow_Print(amc_vis::Outrow& row, algo::cstring& str) __attribute__((nothrow)); - // --- amc_vis.TableId struct TableId { // amc_vis.TableId: Index of table in this namespace i32 value; // -1 index of table @@ -2133,7 +2164,7 @@ struct _db_node_curs {// cursor struct _db_link_curs {// cursor - typedef amc_vis::Link ChildType; + typedef amc_vis::FLink ChildType; amc_vis::FDb *parent; i64 index; _db_link_curs(){ parent=NULL; index=0; } @@ -2141,7 +2172,7 @@ struct _db_link_curs {// cursor struct _db_linkdep_curs {// cursor - typedef amc_vis::Linkdep ChildType; + typedef amc_vis::FLinkdep ChildType; amc_vis::FDb *parent; i64 index; _db_linkdep_curs(){ parent=NULL; index=0; } @@ -2149,8 +2180,8 @@ struct _db_linkdep_curs {// cursor struct _db_c_linklist_curs {// fcurs:amc_vis.FDb.c_linklist/curs - typedef amc_vis::Link ChildType; - amc_vis::Link** elems; + typedef amc_vis::FLink ChildType; + amc_vis::FLink** elems; u32 n_elems; u32 index; _db_c_linklist_curs() { elems=NULL; n_elems=0; index=0; } @@ -2171,9 +2202,9 @@ struct _db_bh_node_curs { // Non-destructive heap cursor, returns heap elements in sorted order. // A running front of potential smallest entries is kept in the helper heap (curs.temp_%) struct _db_bh_link_curs { - typedef amc_vis::Link ChildType; + typedef amc_vis::FLink ChildType; amc_vis::FDb *parent; // parent - amc_vis::Link* *temp_elems; // helper heap + amc_vis::FLink* *temp_elems; // helper heap int temp_n; // number of elements heaped in the helper heap int temp_max; // max number of elements possible in the helper heap _db_bh_link_curs() : parent(NULL), temp_elems(NULL), temp_n(0), temp_max(0) {} @@ -2198,7 +2229,7 @@ struct _db_nodedep_curs {// cursor struct _db_outrow_curs {// cursor - typedef amc_vis::Outrow ChildType; + typedef amc_vis::FOutrow ChildType; amc_vis::FDb *parent; i64 index; _db_outrow_curs(){ parent=NULL; index=0; } @@ -2222,6 +2253,24 @@ struct _db_finput_curs {// cursor }; +struct link_zd_linkdep_out_curs {// fcurs:amc_vis.FLink.zd_linkdep_out/curs + typedef amc_vis::FLinkdep ChildType; + amc_vis::FLinkdep* row; + link_zd_linkdep_out_curs() { + row = NULL; + } +}; + + +struct link_zd_linkdep_in_curs {// fcurs:amc_vis.FLink.zd_linkdep_in/curs + typedef amc_vis::FLinkdep ChildType; + amc_vis::FLinkdep* row; + link_zd_linkdep_in_curs() { + row = NULL; + } +}; + + struct node_zd_nodedep_out_curs {// fcurs:amc_vis.FNode.zd_nodedep_out/curs typedef amc_vis::FNodedep ChildType; amc_vis::FNodedep* row; @@ -2241,8 +2290,8 @@ struct node_zd_nodedep_in_curs {// fcurs:amc_vis.FNode.zd_nodedep_in/curs struct node_zd_link_out_curs {// fcurs:amc_vis.FNode.zd_link_out/curs - typedef amc_vis::Link ChildType; - amc_vis::Link* row; + typedef amc_vis::FLink ChildType; + amc_vis::FLink* row; node_zd_link_out_curs() { row = NULL; } @@ -2250,35 +2299,17 @@ struct node_zd_link_out_curs {// fcurs:amc_vis.FNode.zd_link_out/curs struct node_zd_link_in_curs {// fcurs:amc_vis.FNode.zd_link_in/curs - typedef amc_vis::Link ChildType; - amc_vis::Link* row; + typedef amc_vis::FLink ChildType; + amc_vis::FLink* row; node_zd_link_in_curs() { row = NULL; } }; -struct link_zd_linkdep_out_curs {// fcurs:amc_vis.Link.zd_linkdep_out/curs - typedef amc_vis::Linkdep ChildType; - amc_vis::Linkdep* row; - link_zd_linkdep_out_curs() { - row = NULL; - } -}; - - -struct link_zd_linkdep_in_curs {// fcurs:amc_vis.Link.zd_linkdep_in/curs - typedef amc_vis::Linkdep ChildType; - amc_vis::Linkdep* row; - link_zd_linkdep_in_curs() { - row = NULL; - } -}; - - struct outrow_text_curs {// cursor - typedef u8 ChildType; - u8* elems; + typedef u16 ChildType; + u16* elems; int n_elems; int index; outrow_text_curs() { elems=NULL; n_elems=0; index=0; } @@ -2298,11 +2329,11 @@ int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int); // gen:ns_operators namespace algo { inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::trace &row);// cfmt:amc_vis.trace.String +inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::Linkkey &row);// cfmt:amc_vis.Linkkey.String +inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::FLink &row);// cfmt:amc_vis.FLink.String +inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::FLinkdep &row);// cfmt:amc_vis.FLinkdep.String inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::Nodekey &row);// cfmt:amc_vis.Nodekey.String +inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::FOutrow &row);// cfmt:amc_vis.FOutrow.String inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::FieldId &row);// cfmt:amc_vis.FieldId.String -inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::Linkkey &row);// cfmt:amc_vis.Linkkey.String -inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::Link &row);// cfmt:amc_vis.Link.String -inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::Linkdep &row);// cfmt:amc_vis.Linkdep.String -inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::Outrow &row);// cfmt:amc_vis.Outrow.String inline algo::cstring &operator <<(algo::cstring &str, const amc_vis::TableId &row);// cfmt:amc_vis.TableId.String } diff --git a/include/gen/amc_vis_gen.inl.h b/include/gen/amc_vis_gen.inl.h index 788cf1cc..cc971cc7 100644 --- a/include/gen/amc_vis_gen.inl.h +++ b/include/gen/amc_vis_gen.inl.h @@ -111,20 +111,6 @@ inline amc_vis::FField& amc_vis::ctype_c_field_curs_Access(ctype_c_field_curs &c return *curs.elems[curs.index]; } -// --- amc_vis.FCtype..Init -// Set all fields to initial values. -inline void amc_vis::FCtype_Init(amc_vis::FCtype& ctype) { - ctype.p_base = NULL; - ctype.c_field_elems = NULL; // (amc_vis.FCtype.c_field) - ctype.c_field_n = 0; // (amc_vis.FCtype.c_field) - ctype.c_field_max = 0; // (amc_vis.FCtype.c_field) - ctype.mm_id = i32(0); - ctype.isinput = bool(false); - ctype.ind_ctype_next = (amc_vis::FCtype*)-1; // (amc_vis.FDb.ind_ctype) not-in-hash - ctype.zd_select_next = (amc_vis::FCtype*)-1; // (amc_vis.FDb.zd_select) not-in-list - ctype.zd_select_prev = NULL; // (amc_vis.FDb.zd_select) -} - // --- amc_vis.FCtype..Ctor inline amc_vis::FCtype::FCtype() { amc_vis::FCtype_Init(*this); @@ -309,8 +295,8 @@ inline bool amc_vis::link_EmptyQ() { // --- amc_vis.FDb.link.Find // Look up row by row id. Return NULL if out of range -inline amc_vis::Link* amc_vis::link_Find(u64 t) { - amc_vis::Link *retval = NULL; +inline amc_vis::FLink* amc_vis::link_Find(u64 t) { + amc_vis::FLink *retval = NULL; if (LIKELY(u64(t) < u64(_db.link_n))) { u64 x = t + 1; u64 bsr = algo::u64_BitScanReverse(x); @@ -323,7 +309,7 @@ inline amc_vis::Link* amc_vis::link_Find(u64 t) { // --- amc_vis.FDb.link.Last // Return pointer to last element of array, or NULL if array is empty -inline amc_vis::Link* amc_vis::link_Last() { +inline amc_vis::FLink* amc_vis::link_Last() { return link_Find(u64(_db.link_n-1)); } @@ -335,7 +321,7 @@ inline i32 amc_vis::link_N() { // --- amc_vis.FDb.link.qFind // 'quick' Access row by row id. No bounds checking. -inline amc_vis::Link& amc_vis::link_qFind(u64 t) { +inline amc_vis::FLink& amc_vis::link_qFind(u64 t) { u64 x = t + 1; u64 bsr = algo::u64_BitScanReverse(x); u64 base = u64(1)< amc_vis::c_linklist_Getary() { - return algo::aryptr(_db.c_linklist_elems, _db.c_linklist_n); +inline algo::aryptr amc_vis::c_linklist_Getary() { + return algo::aryptr(_db.c_linklist_elems, _db.c_linklist_n); } // --- amc_vis.FDb.c_linklist.N @@ -432,26 +418,26 @@ inline i32 amc_vis::c_linklist_N() { inline void amc_vis::c_linklist_RemoveAll() { for (u32 i = 0; i < _db.c_linklist_n; i++) { // mark all elements as not-in-array - _db.c_linklist_elems[i]->_db_c_linklist_in_ary = false; + _db.c_linklist_elems[i]->c_linklist_in_ary = false; } _db.c_linklist_n = 0; } // --- amc_vis.FDb.c_linklist.qFind // Return reference without bounds checking -inline amc_vis::Link& amc_vis::c_linklist_qFind(u32 idx) { +inline amc_vis::FLink& amc_vis::c_linklist_qFind(u32 idx) { return *_db.c_linklist_elems[idx]; } // --- amc_vis.FDb.c_linklist.InAryQ // True if row is in any ptrary instance -inline bool amc_vis::c_linklist_InAryQ(amc_vis::Link& row) { - return row._db_c_linklist_in_ary; +inline bool amc_vis::c_linklist_InAryQ(amc_vis::FLink& row) { + return row.c_linklist_in_ary; } // --- amc_vis.FDb.c_linklist.qLast // Reference to last element without bounds checking -inline amc_vis::Link& amc_vis::c_linklist_qLast() { +inline amc_vis::FLink& amc_vis::c_linklist_qLast() { return *_db.c_linklist_elems[_db.c_linklist_n-1]; } @@ -493,8 +479,8 @@ inline bool amc_vis::bh_link_EmptyQ() { // --- amc_vis.FDb.bh_link.First // If index empty, return NULL. Otherwise return pointer to first element in index -inline amc_vis::Link* amc_vis::bh_link_First() { - amc_vis::Link *row = NULL; +inline amc_vis::FLink* amc_vis::bh_link_First() { + amc_vis::FLink *row = NULL; if (_db.bh_link_n > 0) { row = _db.bh_link_elems[0]; } @@ -503,7 +489,7 @@ inline amc_vis::Link* amc_vis::bh_link_First() { // --- amc_vis.FDb.bh_link.InBheapQ // Return true if row is in index, false otherwise -inline bool amc_vis::bh_link_InBheapQ(amc_vis::Link& row) { +inline bool amc_vis::bh_link_InBheapQ(amc_vis::FLink& row) { bool result = false; result = row.bh_link_idx != -1; return result; @@ -619,8 +605,8 @@ inline bool amc_vis::outrow_EmptyQ() { // --- amc_vis.FDb.outrow.Find // Look up row by row id. Return NULL if out of range -inline amc_vis::Outrow* amc_vis::outrow_Find(i32 t) { - amc_vis::Outrow *retval = NULL; +inline amc_vis::FOutrow* amc_vis::outrow_Find(i32 t) { + amc_vis::FOutrow *retval = NULL; if (LIKELY(u64(t) < u64(_db.outrow_n))) { u64 x = t + 1; u64 bsr = algo::u64_BitScanReverse(x); @@ -633,7 +619,7 @@ inline amc_vis::Outrow* amc_vis::outrow_Find(i32 t) { // --- amc_vis.FDb.outrow.Last // Return pointer to last element of array, or NULL if array is empty -inline amc_vis::Outrow* amc_vis::outrow_Last() { +inline amc_vis::FOutrow* amc_vis::outrow_Last() { return outrow_Find(i32(_db.outrow_n-1)); } @@ -645,7 +631,7 @@ inline i32 amc_vis::outrow_N() { // --- amc_vis.FDb.outrow.qFind // 'quick' Access row by row id. No bounds checking. -inline amc_vis::Outrow& amc_vis::outrow_qFind(i32 t) { +inline amc_vis::FOutrow& amc_vis::outrow_qFind(i32 t) { u64 x = t + 1; u64 bsr = algo::u64_BitScanReverse(x); u64 base = u64(1)<(*this),const_cast(rhs)); +} + +// --- amc_vis.Linkkey..NeOp +inline bool amc_vis::Linkkey::operator !=(const amc_vis::Linkkey &rhs) const { + return !amc_vis::Linkkey_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- amc_vis.Linkkey..LtOp +inline bool amc_vis::Linkkey::operator <(const amc_vis::Linkkey &rhs) const { + return amc_vis::Linkkey_Lt(const_cast(*this),const_cast(rhs)); +} + +// --- amc_vis.Linkkey..GtOp +inline bool amc_vis::Linkkey::operator >(const amc_vis::Linkkey &rhs) const { + return amc_vis::Linkkey_Lt(const_cast(rhs),const_cast(*this)); +} + +// --- amc_vis.Linkkey..LeOp +inline bool amc_vis::Linkkey::operator <=(const amc_vis::Linkkey &rhs) const { + return !amc_vis::Linkkey_Lt(const_cast(rhs),const_cast(*this)); +} + +// --- amc_vis.Linkkey..GeOp +inline bool amc_vis::Linkkey::operator >=(const amc_vis::Linkkey &rhs) const { + return !amc_vis::Linkkey_Lt(const_cast(*this),const_cast(rhs)); +} + +// --- amc_vis.Linkkey..Lt +inline bool amc_vis::Linkkey_Lt(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) { + return Linkkey_Cmp(lhs,rhs) < 0; +} + +// --- amc_vis.Linkkey..Cmp +inline i32 amc_vis::Linkkey_Cmp(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) { + i32 retval = 0; + retval = u32_Cmp(lhs.n_link_in, rhs.n_link_in); + if (retval != 0) { + return retval; + } + retval = i32_Cmp(lhs.samecol, rhs.samecol); + if (retval != 0) { + return retval; + } + retval = i32_Cmp(lhs.colweight, rhs.colweight); + return retval; +} + +// --- amc_vis.Linkkey..Init +// Set all fields to initial values. +inline void amc_vis::Linkkey_Init(amc_vis::Linkkey& parent) { + parent.n_link_in = u32(0); + parent.samecol = i32(0); + parent.colweight = i32(0); +} + +// --- amc_vis.Linkkey..Eq +inline bool amc_vis::Linkkey_Eq(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) { + bool retval = true; + retval = u32_Eq(lhs.n_link_in, rhs.n_link_in); + if (!retval) { + return false; + } + retval = i32_Eq(lhs.samecol, rhs.samecol); + if (!retval) { + return false; + } + retval = i32_Eq(lhs.colweight, rhs.colweight); + return retval; +} + +// --- amc_vis.Linkkey..Update +// Set value. Return true if new value is different from old value. +inline bool amc_vis::Linkkey_Update(amc_vis::Linkkey &lhs, amc_vis::Linkkey rhs) { + bool ret = !Linkkey_Eq(lhs, rhs); // compare values + if (ret) { + lhs = rhs; // update + } + return ret; +} + +// --- amc_vis.Linkkey..Ctor +inline amc_vis::Linkkey::Linkkey() { + amc_vis::Linkkey_Init(*this); +} + +// --- amc_vis.Linkkey..FieldwiseCtor +inline amc_vis::Linkkey::Linkkey(u32 in_n_link_in, i32 in_samecol, i32 in_colweight) + : n_link_in(in_n_link_in) + , samecol(in_samecol) + , colweight(in_colweight) + { +} + +// --- amc_vis.FLink.linkkey.Lt +// Compare two fields. Comparison is anti-symmetric: if a>b, then !(b>a). +inline bool amc_vis::linkkey_Lt(amc_vis::FLink& link, amc_vis::FLink &rhs) { + return amc_vis::Linkkey_Lt(link.linkkey,rhs.linkkey); +} + +// --- amc_vis.FLink.linkkey.Cmp +// Compare two fields. +inline i32 amc_vis::linkkey_Cmp(amc_vis::FLink& link, amc_vis::FLink &rhs) { + i32 retval = 0; + retval = amc_vis::Linkkey_Cmp(link.linkkey, rhs.linkkey); + return retval; +} + +// --- amc_vis.FLink.zd_linkdep_out.EmptyQ +// Return true if index is empty +inline bool amc_vis::zd_linkdep_out_EmptyQ(amc_vis::FLink& link) { + return link.zd_linkdep_out_head == NULL; +} + +// --- amc_vis.FLink.zd_linkdep_out.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline amc_vis::FLinkdep* amc_vis::zd_linkdep_out_First(amc_vis::FLink& link) { + amc_vis::FLinkdep *row = NULL; + row = link.zd_linkdep_out_head; + return row; +} + +// --- amc_vis.FLink.zd_linkdep_out.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool amc_vis::link_zd_linkdep_out_InLlistQ(amc_vis::FLinkdep& row) { + bool result = false; + result = !(row.link_zd_linkdep_out_next == (amc_vis::FLinkdep*)-1); + return result; +} + +// --- amc_vis.FLink.zd_linkdep_out.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline amc_vis::FLinkdep* amc_vis::zd_linkdep_out_Last(amc_vis::FLink& link) { + amc_vis::FLinkdep *row = NULL; + row = link.zd_linkdep_out_tail; + return row; +} + +// --- amc_vis.FLink.zd_linkdep_out.Next +// Return pointer to next element in the list +inline amc_vis::FLinkdep* amc_vis::link_zd_linkdep_out_Next(amc_vis::FLinkdep &row) { + return row.link_zd_linkdep_out_next; +} + +// --- amc_vis.FLink.zd_linkdep_out.Prev +// Return pointer to previous element in the list +inline amc_vis::FLinkdep* amc_vis::link_zd_linkdep_out_Prev(amc_vis::FLinkdep &row) { + return row.link_zd_linkdep_out_prev; +} + +// --- amc_vis.FLink.zd_linkdep_out.qLast +// Return reference to last element in the index. No bounds checking. +inline amc_vis::FLinkdep& amc_vis::zd_linkdep_out_qLast(amc_vis::FLink& link) { + amc_vis::FLinkdep *row = NULL; + row = link.zd_linkdep_out_tail; + return *row; +} + +// --- amc_vis.FLink.zd_linkdep_in.EmptyQ +// Return true if index is empty +inline bool amc_vis::zd_linkdep_in_EmptyQ(amc_vis::FLink& link) { + return link.zd_linkdep_in_head == NULL; +} + +// --- amc_vis.FLink.zd_linkdep_in.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline amc_vis::FLinkdep* amc_vis::zd_linkdep_in_First(amc_vis::FLink& link) { + amc_vis::FLinkdep *row = NULL; + row = link.zd_linkdep_in_head; + return row; +} + +// --- amc_vis.FLink.zd_linkdep_in.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool amc_vis::link_zd_linkdep_in_InLlistQ(amc_vis::FLinkdep& row) { + bool result = false; + result = !(row.link_zd_linkdep_in_next == (amc_vis::FLinkdep*)-1); + return result; +} + +// --- amc_vis.FLink.zd_linkdep_in.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline amc_vis::FLinkdep* amc_vis::zd_linkdep_in_Last(amc_vis::FLink& link) { + amc_vis::FLinkdep *row = NULL; + row = link.zd_linkdep_in_tail; + return row; +} + +// --- amc_vis.FLink.zd_linkdep_in.Next +// Return pointer to next element in the list +inline amc_vis::FLinkdep* amc_vis::link_zd_linkdep_in_Next(amc_vis::FLinkdep &row) { + return row.link_zd_linkdep_in_next; +} + +// --- amc_vis.FLink.zd_linkdep_in.Prev +// Return pointer to previous element in the list +inline amc_vis::FLinkdep* amc_vis::link_zd_linkdep_in_Prev(amc_vis::FLinkdep &row) { + return row.link_zd_linkdep_in_prev; +} + +// --- amc_vis.FLink.zd_linkdep_in.qLast +// Return reference to last element in the index. No bounds checking. +inline amc_vis::FLinkdep& amc_vis::zd_linkdep_in_qLast(amc_vis::FLink& link) { + amc_vis::FLinkdep *row = NULL; + row = link.zd_linkdep_in_tail; + return *row; +} + +// --- amc_vis.FLink.zd_linkdep_out_curs.Reset +// cursor points to valid item +inline void amc_vis::link_zd_linkdep_out_curs_Reset(link_zd_linkdep_out_curs &curs, amc_vis::FLink &parent) { + curs.row = parent.zd_linkdep_out_head; +} + +// --- amc_vis.FLink.zd_linkdep_out_curs.ValidQ +// cursor points to valid item +inline bool amc_vis::link_zd_linkdep_out_curs_ValidQ(link_zd_linkdep_out_curs &curs) { + return curs.row != NULL; +} + +// --- amc_vis.FLink.zd_linkdep_out_curs.Next +// proceed to next item +inline void amc_vis::link_zd_linkdep_out_curs_Next(link_zd_linkdep_out_curs &curs) { + amc_vis::FLinkdep *next = (*curs.row).link_zd_linkdep_out_next; + curs.row = next; +} + +// --- amc_vis.FLink.zd_linkdep_out_curs.Access +// item access +inline amc_vis::FLinkdep& amc_vis::link_zd_linkdep_out_curs_Access(link_zd_linkdep_out_curs &curs) { + return *curs.row; +} + +// --- amc_vis.FLink.zd_linkdep_in_curs.Reset +// cursor points to valid item +inline void amc_vis::link_zd_linkdep_in_curs_Reset(link_zd_linkdep_in_curs &curs, amc_vis::FLink &parent) { + curs.row = parent.zd_linkdep_in_head; +} + +// --- amc_vis.FLink.zd_linkdep_in_curs.ValidQ +// cursor points to valid item +inline bool amc_vis::link_zd_linkdep_in_curs_ValidQ(link_zd_linkdep_in_curs &curs) { + return curs.row != NULL; +} + +// --- amc_vis.FLink.zd_linkdep_in_curs.Next +// proceed to next item +inline void amc_vis::link_zd_linkdep_in_curs_Next(link_zd_linkdep_in_curs &curs) { + amc_vis::FLinkdep *next = (*curs.row).link_zd_linkdep_in_next; + curs.row = next; +} + +// --- amc_vis.FLink.zd_linkdep_in_curs.Access +// item access +inline amc_vis::FLinkdep& amc_vis::link_zd_linkdep_in_curs_Access(link_zd_linkdep_in_curs &curs) { + return *curs.row; +} + +// --- amc_vis.FLink..Ctor +inline amc_vis::FLink::FLink() { + amc_vis::FLink_Init(*this); +} + +// --- amc_vis.FLink..Dtor +inline amc_vis::FLink::~FLink() { + amc_vis::FLink_Uninit(*this); +} + +// --- amc_vis.FLinkdep..Init +// Set all fields to initial values. +inline void amc_vis::FLinkdep_Init(amc_vis::FLinkdep& linkdep) { + linkdep.row = i32(0); + linkdep.rowid = i32(0); + linkdep.up = bool(false); + linkdep.inst = bool(false); + linkdep.p_link_from = NULL; + linkdep.p_link_to = NULL; + linkdep.link_zd_linkdep_out_next = (amc_vis::FLinkdep*)-1; // (amc_vis.FLink.zd_linkdep_out) not-in-list + linkdep.link_zd_linkdep_out_prev = NULL; // (amc_vis.FLink.zd_linkdep_out) + linkdep.link_zd_linkdep_in_next = (amc_vis::FLinkdep*)-1; // (amc_vis.FLink.zd_linkdep_in) not-in-list + linkdep.link_zd_linkdep_in_prev = NULL; // (amc_vis.FLink.zd_linkdep_in) +} + +// --- amc_vis.FLinkdep..Ctor +inline amc_vis::FLinkdep::FLinkdep() { + amc_vis::FLinkdep_Init(*this); +} + +// --- amc_vis.FLinkdep..Dtor +inline amc_vis::FLinkdep::~FLinkdep() { + amc_vis::FLinkdep_Uninit(*this); +} + +// --- amc_vis.FLinkdep..FieldwiseCtor +inline amc_vis::FLinkdep::FLinkdep(i32 in_row, i32 in_rowid, bool in_up, bool in_inst, amc_vis::FLink* in_p_link_from, amc_vis::FLink* in_p_link_to) + : row(in_row) + , rowid(in_rowid) + , up(in_up) + , inst(in_inst) + , p_link_from(in_p_link_from) + , p_link_to(in_p_link_to) + { +} + // --- amc_vis.Nodekey..Hash inline u32 amc_vis::Nodekey_Hash(u32 prev, amc_vis::Nodekey rhs) { prev = u32_Hash(prev, rhs.n_ct_in); prev = i32_Hash(prev, rhs.idx); - prev = i32_Hash(prev, rhs.prev_xpos); return prev; } @@ -1149,10 +1448,6 @@ inline i32 amc_vis::Nodekey_Cmp(amc_vis::Nodekey lhs, amc_vis::Nodekey rhs) { return retval; } retval = i32_Cmp(lhs.idx, rhs.idx); - if (retval != 0) { - return retval; - } - retval = i32_Cmp(lhs.prev_xpos, rhs.prev_xpos); return retval; } @@ -1161,7 +1456,6 @@ inline i32 amc_vis::Nodekey_Cmp(amc_vis::Nodekey lhs, amc_vis::Nodekey rhs) { inline void amc_vis::Nodekey_Init(amc_vis::Nodekey& parent) { parent.n_ct_in = u32(0); parent.idx = i32(0); - parent.prev_xpos = i32(99999999); } // --- amc_vis.Nodekey..Eq @@ -1172,10 +1466,6 @@ inline bool amc_vis::Nodekey_Eq(amc_vis::Nodekey lhs, amc_vis::Nodekey rhs) { return false; } retval = i32_Eq(lhs.idx, rhs.idx); - if (!retval) { - return false; - } - retval = i32_Eq(lhs.prev_xpos, rhs.prev_xpos); return retval; } @@ -1195,10 +1485,9 @@ inline amc_vis::Nodekey::Nodekey() { } // --- amc_vis.Nodekey..FieldwiseCtor -inline amc_vis::Nodekey::Nodekey(u32 in_n_ct_in, i32 in_idx, i32 in_prev_xpos) +inline amc_vis::Nodekey::Nodekey(u32 in_n_ct_in, i32 in_idx) : n_ct_in(in_n_ct_in) , idx(in_idx) - , prev_xpos(in_prev_xpos) { } @@ -1232,9 +1521,9 @@ inline amc_vis::FNodedep* amc_vis::zd_nodedep_out_First(amc_vis::FNode& node) { // --- amc_vis.FNode.zd_nodedep_out.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool amc_vis::zd_nodedep_out_InLlistQ(amc_vis::FNodedep& row) { +inline bool amc_vis::node_zd_nodedep_out_InLlistQ(amc_vis::FNodedep& row) { bool result = false; - result = !(row.zd_nodedep_out_next == (amc_vis::FNodedep*)-1); + result = !(row.node_zd_nodedep_out_next == (amc_vis::FNodedep*)-1); return result; } @@ -1248,14 +1537,14 @@ inline amc_vis::FNodedep* amc_vis::zd_nodedep_out_Last(amc_vis::FNode& node) { // --- amc_vis.FNode.zd_nodedep_out.Next // Return pointer to next element in the list -inline amc_vis::FNodedep* amc_vis::zd_nodedep_out_Next(amc_vis::FNodedep &row) { - return row.zd_nodedep_out_next; +inline amc_vis::FNodedep* amc_vis::node_zd_nodedep_out_Next(amc_vis::FNodedep &row) { + return row.node_zd_nodedep_out_next; } // --- amc_vis.FNode.zd_nodedep_out.Prev // Return pointer to previous element in the list -inline amc_vis::FNodedep* amc_vis::zd_nodedep_out_Prev(amc_vis::FNodedep &row) { - return row.zd_nodedep_out_prev; +inline amc_vis::FNodedep* amc_vis::node_zd_nodedep_out_Prev(amc_vis::FNodedep &row) { + return row.node_zd_nodedep_out_prev; } // --- amc_vis.FNode.zd_nodedep_out.qLast @@ -1282,9 +1571,9 @@ inline amc_vis::FNodedep* amc_vis::zd_nodedep_in_First(amc_vis::FNode& node) { // --- amc_vis.FNode.zd_nodedep_in.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool amc_vis::zd_nodedep_in_InLlistQ(amc_vis::FNodedep& row) { +inline bool amc_vis::node_zd_nodedep_in_InLlistQ(amc_vis::FNodedep& row) { bool result = false; - result = !(row.zd_nodedep_in_next == (amc_vis::FNodedep*)-1); + result = !(row.node_zd_nodedep_in_next == (amc_vis::FNodedep*)-1); return result; } @@ -1304,14 +1593,14 @@ inline i32 amc_vis::zd_nodedep_in_N(const amc_vis::FNode& node) { // --- amc_vis.FNode.zd_nodedep_in.Next // Return pointer to next element in the list -inline amc_vis::FNodedep* amc_vis::zd_nodedep_in_Next(amc_vis::FNodedep &row) { - return row.zd_nodedep_in_next; +inline amc_vis::FNodedep* amc_vis::node_zd_nodedep_in_Next(amc_vis::FNodedep &row) { + return row.node_zd_nodedep_in_next; } // --- amc_vis.FNode.zd_nodedep_in.Prev // Return pointer to previous element in the list -inline amc_vis::FNodedep* amc_vis::zd_nodedep_in_Prev(amc_vis::FNodedep &row) { - return row.zd_nodedep_in_prev; +inline amc_vis::FNodedep* amc_vis::node_zd_nodedep_in_Prev(amc_vis::FNodedep &row) { + return row.node_zd_nodedep_in_prev; } // --- amc_vis.FNode.zd_nodedep_in.qLast @@ -1330,24 +1619,24 @@ inline bool amc_vis::zd_link_out_EmptyQ(amc_vis::FNode& node) { // --- amc_vis.FNode.zd_link_out.First // If index empty, return NULL. Otherwise return pointer to first element in index -inline amc_vis::Link* amc_vis::zd_link_out_First(amc_vis::FNode& node) { - amc_vis::Link *row = NULL; +inline amc_vis::FLink* amc_vis::zd_link_out_First(amc_vis::FNode& node) { + amc_vis::FLink *row = NULL; row = node.zd_link_out_head; return row; } // --- amc_vis.FNode.zd_link_out.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool amc_vis::zd_link_out_InLlistQ(amc_vis::Link& row) { +inline bool amc_vis::node_zd_link_out_InLlistQ(amc_vis::FLink& row) { bool result = false; - result = !(row.zd_link_out_next == (amc_vis::Link*)-1); + result = !(row.node_zd_link_out_next == (amc_vis::FLink*)-1); return result; } // --- amc_vis.FNode.zd_link_out.Last // If index empty, return NULL. Otherwise return pointer to last element in index -inline amc_vis::Link* amc_vis::zd_link_out_Last(amc_vis::FNode& node) { - amc_vis::Link *row = NULL; +inline amc_vis::FLink* amc_vis::zd_link_out_Last(amc_vis::FNode& node) { + amc_vis::FLink *row = NULL; row = node.zd_link_out_tail; return row; } @@ -1360,20 +1649,20 @@ inline i32 amc_vis::zd_link_out_N(const amc_vis::FNode& node) { // --- amc_vis.FNode.zd_link_out.Next // Return pointer to next element in the list -inline amc_vis::Link* amc_vis::zd_link_out_Next(amc_vis::Link &row) { - return row.zd_link_out_next; +inline amc_vis::FLink* amc_vis::node_zd_link_out_Next(amc_vis::FLink &row) { + return row.node_zd_link_out_next; } // --- amc_vis.FNode.zd_link_out.Prev // Return pointer to previous element in the list -inline amc_vis::Link* amc_vis::zd_link_out_Prev(amc_vis::Link &row) { - return row.zd_link_out_prev; +inline amc_vis::FLink* amc_vis::node_zd_link_out_Prev(amc_vis::FLink &row) { + return row.node_zd_link_out_prev; } // --- amc_vis.FNode.zd_link_out.qLast // Return reference to last element in the index. No bounds checking. -inline amc_vis::Link& amc_vis::zd_link_out_qLast(amc_vis::FNode& node) { - amc_vis::Link *row = NULL; +inline amc_vis::FLink& amc_vis::zd_link_out_qLast(amc_vis::FNode& node) { + amc_vis::FLink *row = NULL; row = node.zd_link_out_tail; return *row; } @@ -1386,24 +1675,24 @@ inline bool amc_vis::zd_link_in_EmptyQ(amc_vis::FNode& node) { // --- amc_vis.FNode.zd_link_in.First // If index empty, return NULL. Otherwise return pointer to first element in index -inline amc_vis::Link* amc_vis::zd_link_in_First(amc_vis::FNode& node) { - amc_vis::Link *row = NULL; +inline amc_vis::FLink* amc_vis::zd_link_in_First(amc_vis::FNode& node) { + amc_vis::FLink *row = NULL; row = node.zd_link_in_head; return row; } // --- amc_vis.FNode.zd_link_in.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool amc_vis::zd_link_in_InLlistQ(amc_vis::Link& row) { +inline bool amc_vis::node_zd_link_in_InLlistQ(amc_vis::FLink& row) { bool result = false; - result = !(row.zd_link_in_next == (amc_vis::Link*)-1); + result = !(row.node_zd_link_in_next == (amc_vis::FLink*)-1); return result; } // --- amc_vis.FNode.zd_link_in.Last // If index empty, return NULL. Otherwise return pointer to last element in index -inline amc_vis::Link* amc_vis::zd_link_in_Last(amc_vis::FNode& node) { - amc_vis::Link *row = NULL; +inline amc_vis::FLink* amc_vis::zd_link_in_Last(amc_vis::FNode& node) { + amc_vis::FLink *row = NULL; row = node.zd_link_in_tail; return row; } @@ -1416,20 +1705,20 @@ inline i32 amc_vis::zd_link_in_N(const amc_vis::FNode& node) { // --- amc_vis.FNode.zd_link_in.Next // Return pointer to next element in the list -inline amc_vis::Link* amc_vis::zd_link_in_Next(amc_vis::Link &row) { - return row.zd_link_in_next; +inline amc_vis::FLink* amc_vis::node_zd_link_in_Next(amc_vis::FLink &row) { + return row.node_zd_link_in_next; } // --- amc_vis.FNode.zd_link_in.Prev // Return pointer to previous element in the list -inline amc_vis::Link* amc_vis::zd_link_in_Prev(amc_vis::Link &row) { - return row.zd_link_in_prev; +inline amc_vis::FLink* amc_vis::node_zd_link_in_Prev(amc_vis::FLink &row) { + return row.node_zd_link_in_prev; } // --- amc_vis.FNode.zd_link_in.qLast // Return reference to last element in the index. No bounds checking. -inline amc_vis::Link& amc_vis::zd_link_in_qLast(amc_vis::FNode& node) { - amc_vis::Link *row = NULL; +inline amc_vis::FLink& amc_vis::zd_link_in_qLast(amc_vis::FNode& node) { + amc_vis::FLink *row = NULL; row = node.zd_link_in_tail; return *row; } @@ -1449,7 +1738,7 @@ inline bool amc_vis::node_zd_nodedep_out_curs_ValidQ(node_zd_nodedep_out_curs &c // --- amc_vis.FNode.zd_nodedep_out_curs.Next // proceed to next item inline void amc_vis::node_zd_nodedep_out_curs_Next(node_zd_nodedep_out_curs &curs) { - amc_vis::FNodedep *next = (*curs.row).zd_nodedep_out_next; + amc_vis::FNodedep *next = (*curs.row).node_zd_nodedep_out_next; curs.row = next; } @@ -1474,7 +1763,7 @@ inline bool amc_vis::node_zd_nodedep_in_curs_ValidQ(node_zd_nodedep_in_curs &cur // --- amc_vis.FNode.zd_nodedep_in_curs.Next // proceed to next item inline void amc_vis::node_zd_nodedep_in_curs_Next(node_zd_nodedep_in_curs &curs) { - amc_vis::FNodedep *next = (*curs.row).zd_nodedep_in_next; + amc_vis::FNodedep *next = (*curs.row).node_zd_nodedep_in_next; curs.row = next; } @@ -1499,13 +1788,13 @@ inline bool amc_vis::node_zd_link_out_curs_ValidQ(node_zd_link_out_curs &curs) { // --- amc_vis.FNode.zd_link_out_curs.Next // proceed to next item inline void amc_vis::node_zd_link_out_curs_Next(node_zd_link_out_curs &curs) { - amc_vis::Link *next = (*curs.row).zd_link_out_next; + amc_vis::FLink *next = (*curs.row).node_zd_link_out_next; curs.row = next; } // --- amc_vis.FNode.zd_link_out_curs.Access // item access -inline amc_vis::Link& amc_vis::node_zd_link_out_curs_Access(node_zd_link_out_curs &curs) { +inline amc_vis::FLink& amc_vis::node_zd_link_out_curs_Access(node_zd_link_out_curs &curs) { return *curs.row; } @@ -1524,13 +1813,13 @@ inline bool amc_vis::node_zd_link_in_curs_ValidQ(node_zd_link_in_curs &curs) { // --- amc_vis.FNode.zd_link_in_curs.Next // proceed to next item inline void amc_vis::node_zd_link_in_curs_Next(node_zd_link_in_curs &curs) { - amc_vis::Link *next = (*curs.row).zd_link_in_next; + amc_vis::FLink *next = (*curs.row).node_zd_link_in_next; curs.row = next; } // --- amc_vis.FNode.zd_link_in_curs.Access // item access -inline amc_vis::Link& amc_vis::node_zd_link_in_curs_Access(node_zd_link_in_curs &curs) { +inline amc_vis::FLink& amc_vis::node_zd_link_in_curs_Access(node_zd_link_in_curs &curs) { return *curs.row; } @@ -1553,10 +1842,10 @@ inline void amc_vis::FNodedep_Init(amc_vis::FNodedep& nodedep) { nodedep.inst = bool(false); nodedep.p_node1 = NULL; nodedep.p_node2 = NULL; - nodedep.zd_nodedep_out_next = (amc_vis::FNodedep*)-1; // (amc_vis.FNode.zd_nodedep_out) not-in-list - nodedep.zd_nodedep_out_prev = NULL; // (amc_vis.FNode.zd_nodedep_out) - nodedep.zd_nodedep_in_next = (amc_vis::FNodedep*)-1; // (amc_vis.FNode.zd_nodedep_in) not-in-list - nodedep.zd_nodedep_in_prev = NULL; // (amc_vis.FNode.zd_nodedep_in) + nodedep.node_zd_nodedep_out_next = (amc_vis::FNodedep*)-1; // (amc_vis.FNode.zd_nodedep_out) not-in-list + nodedep.node_zd_nodedep_out_prev = NULL; // (amc_vis.FNode.zd_nodedep_out) + nodedep.node_zd_nodedep_in_next = (amc_vis::FNodedep*)-1; // (amc_vis.FNode.zd_nodedep_in) not-in-list + nodedep.node_zd_nodedep_in_prev = NULL; // (amc_vis.FNode.zd_nodedep_in) } // --- amc_vis.FNodedep..Ctor @@ -1582,457 +1871,170 @@ inline amc_vis::FNodedep::FNodedep(i32 in_row, i32 in_rowid, bool in_up, bool i { } -// --- amc_vis.FReftype..Ctor -inline amc_vis::FReftype::FReftype() { - amc_vis::FReftype_Init(*this); +// --- amc_vis.FOutrow.text.EmptyQ +// Return true if index is empty +inline bool amc_vis::text_EmptyQ(amc_vis::FOutrow& outrow) { + return outrow.text_n == 0; } -// --- amc_vis.FReftype..Dtor -inline amc_vis::FReftype::~FReftype() { - amc_vis::FReftype_Uninit(*this); +// --- amc_vis.FOutrow.text.Find +// Look up row by row id. Return NULL if out of range +inline u16* amc_vis::text_Find(amc_vis::FOutrow& outrow, u64 t) { + u64 idx = t; + u64 lim = outrow.text_n; + if (idx >= lim) return NULL; + return outrow.text_elems + idx; } -// --- amc_vis.FieldId.value.GetEnum -// Get value of field as enum type -inline amc_vis_FieldIdEnum amc_vis::value_GetEnum(const amc_vis::FieldId& parent) { - return amc_vis_FieldIdEnum(parent.value); +// --- amc_vis.FOutrow.text.Getary +// Return array pointer by value +inline algo::aryptr amc_vis::text_Getary(const amc_vis::FOutrow& outrow) { + return algo::aryptr(outrow.text_elems, outrow.text_n); } -// --- amc_vis.FieldId.value.SetEnum -// Set value of field from enum type. -inline void amc_vis::value_SetEnum(amc_vis::FieldId& parent, amc_vis_FieldIdEnum rhs) { - parent.value = i32(rhs); -} - -// --- amc_vis.FieldId.value.Cast -inline amc_vis::FieldId::operator amc_vis_FieldIdEnum() const { - return amc_vis_FieldIdEnum((*this).value); -} - -// --- amc_vis.FieldId..Init -// Set all fields to initial values. -inline void amc_vis::FieldId_Init(amc_vis::FieldId& parent) { - parent.value = i32(-1); -} - -// --- amc_vis.FieldId..Ctor -inline amc_vis::FieldId::FieldId() { - amc_vis::FieldId_Init(*this); -} - -// --- amc_vis.FieldId..FieldwiseCtor -inline amc_vis::FieldId::FieldId(i32 in_value) - : value(in_value) - { -} - -// --- amc_vis.FieldId..EnumCtor -inline amc_vis::FieldId::FieldId(amc_vis_FieldIdEnum arg) { - this->value = i32(arg); -} - -// --- amc_vis.Linkkey..Hash -inline u32 amc_vis::Linkkey_Hash(u32 prev, amc_vis::Linkkey rhs) { - prev = u32_Hash(prev, rhs.n_link_in); - prev = i32_Hash(prev, rhs.samecol); - prev = i32_Hash(prev, rhs.colweight); - prev = i32_Hash(prev, rhs.topbot); - return prev; -} - -// --- amc_vis.Linkkey..EqOp -inline bool amc_vis::Linkkey::operator ==(const amc_vis::Linkkey &rhs) const { - return amc_vis::Linkkey_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- amc_vis.Linkkey..NeOp -inline bool amc_vis::Linkkey::operator !=(const amc_vis::Linkkey &rhs) const { - return !amc_vis::Linkkey_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- amc_vis.Linkkey..LtOp -inline bool amc_vis::Linkkey::operator <(const amc_vis::Linkkey &rhs) const { - return amc_vis::Linkkey_Lt(const_cast(*this),const_cast(rhs)); -} - -// --- amc_vis.Linkkey..GtOp -inline bool amc_vis::Linkkey::operator >(const amc_vis::Linkkey &rhs) const { - return amc_vis::Linkkey_Lt(const_cast(rhs),const_cast(*this)); -} - -// --- amc_vis.Linkkey..LeOp -inline bool amc_vis::Linkkey::operator <=(const amc_vis::Linkkey &rhs) const { - return !amc_vis::Linkkey_Lt(const_cast(rhs),const_cast(*this)); -} - -// --- amc_vis.Linkkey..GeOp -inline bool amc_vis::Linkkey::operator >=(const amc_vis::Linkkey &rhs) const { - return !amc_vis::Linkkey_Lt(const_cast(*this),const_cast(rhs)); -} - -// --- amc_vis.Linkkey..Lt -inline bool amc_vis::Linkkey_Lt(amc_vis::Linkkey lhs, amc_vis::Linkkey rhs) { - return Linkkey_Cmp(lhs,rhs) < 0; -} - -// --- amc_vis.Linkkey..Init -// Set all fields to initial values. -inline void amc_vis::Linkkey_Init(amc_vis::Linkkey& parent) { - parent.n_link_in = u32(0); - parent.samecol = i32(0); - parent.colweight = i32(0); - parent.topbot = i32(0); -} - -// --- amc_vis.Linkkey..Update -// Set value. Return true if new value is different from old value. -inline bool amc_vis::Linkkey_Update(amc_vis::Linkkey &lhs, amc_vis::Linkkey rhs) { - bool ret = !Linkkey_Eq(lhs, rhs); // compare values - if (ret) { - lhs = rhs; // update - } - return ret; -} - -// --- amc_vis.Linkkey..Ctor -inline amc_vis::Linkkey::Linkkey() { - amc_vis::Linkkey_Init(*this); -} - -// --- amc_vis.Linkkey..FieldwiseCtor -inline amc_vis::Linkkey::Linkkey(u32 in_n_link_in, i32 in_samecol, i32 in_colweight, i32 in_topbot) - : n_link_in(in_n_link_in) - , samecol(in_samecol) - , colweight(in_colweight) - , topbot(in_topbot) - { -} - -// --- amc_vis.Link.linkkey.Lt -// Compare two fields. Comparison is anti-symmetric: if a>b, then !(b>a). -inline bool amc_vis::linkkey_Lt(amc_vis::Link& link, amc_vis::Link &rhs) { - return amc_vis::Linkkey_Lt(link.linkkey,rhs.linkkey); -} - -// --- amc_vis.Link.linkkey.Cmp -// Compare two fields. -inline i32 amc_vis::linkkey_Cmp(amc_vis::Link& link, amc_vis::Link &rhs) { - i32 retval = 0; - retval = amc_vis::Linkkey_Cmp(link.linkkey, rhs.linkkey); - return retval; -} - -// --- amc_vis.Link.zd_linkdep_out.EmptyQ -// Return true if index is empty -inline bool amc_vis::zd_linkdep_out_EmptyQ(amc_vis::Link& link) { - return link.zd_linkdep_out_head == NULL; -} - -// --- amc_vis.Link.zd_linkdep_out.First -// If index empty, return NULL. Otherwise return pointer to first element in index -inline amc_vis::Linkdep* amc_vis::zd_linkdep_out_First(amc_vis::Link& link) { - amc_vis::Linkdep *row = NULL; - row = link.zd_linkdep_out_head; - return row; -} - -// --- amc_vis.Link.zd_linkdep_out.InLlistQ -// Return true if row is in the linked list, false otherwise -inline bool amc_vis::zd_linkdep_out_InLlistQ(amc_vis::Linkdep& row) { - bool result = false; - result = !(row.zd_linkdep_out_next == (amc_vis::Linkdep*)-1); - return result; -} - -// --- amc_vis.Link.zd_linkdep_out.Last -// If index empty, return NULL. Otherwise return pointer to last element in index -inline amc_vis::Linkdep* amc_vis::zd_linkdep_out_Last(amc_vis::Link& link) { - amc_vis::Linkdep *row = NULL; - row = link.zd_linkdep_out_tail; - return row; -} - -// --- amc_vis.Link.zd_linkdep_out.Next -// Return pointer to next element in the list -inline amc_vis::Linkdep* amc_vis::zd_linkdep_out_Next(amc_vis::Linkdep &row) { - return row.zd_linkdep_out_next; -} - -// --- amc_vis.Link.zd_linkdep_out.Prev -// Return pointer to previous element in the list -inline amc_vis::Linkdep* amc_vis::zd_linkdep_out_Prev(amc_vis::Linkdep &row) { - return row.zd_linkdep_out_prev; -} - -// --- amc_vis.Link.zd_linkdep_out.qLast -// Return reference to last element in the index. No bounds checking. -inline amc_vis::Linkdep& amc_vis::zd_linkdep_out_qLast(amc_vis::Link& link) { - amc_vis::Linkdep *row = NULL; - row = link.zd_linkdep_out_tail; - return *row; -} - -// --- amc_vis.Link.zd_linkdep_in.EmptyQ -// Return true if index is empty -inline bool amc_vis::zd_linkdep_in_EmptyQ(amc_vis::Link& link) { - return link.zd_linkdep_in_head == NULL; -} - -// --- amc_vis.Link.zd_linkdep_in.First -// If index empty, return NULL. Otherwise return pointer to first element in index -inline amc_vis::Linkdep* amc_vis::zd_linkdep_in_First(amc_vis::Link& link) { - amc_vis::Linkdep *row = NULL; - row = link.zd_linkdep_in_head; - return row; -} - -// --- amc_vis.Link.zd_linkdep_in.InLlistQ -// Return true if row is in the linked list, false otherwise -inline bool amc_vis::zd_linkdep_in_InLlistQ(amc_vis::Linkdep& row) { - bool result = false; - result = !(row.zd_linkdep_in_next == (amc_vis::Linkdep*)-1); - return result; -} - -// --- amc_vis.Link.zd_linkdep_in.Last -// If index empty, return NULL. Otherwise return pointer to last element in index -inline amc_vis::Linkdep* amc_vis::zd_linkdep_in_Last(amc_vis::Link& link) { - amc_vis::Linkdep *row = NULL; - row = link.zd_linkdep_in_tail; - return row; -} - -// --- amc_vis.Link.zd_linkdep_in.Next -// Return pointer to next element in the list -inline amc_vis::Linkdep* amc_vis::zd_linkdep_in_Next(amc_vis::Linkdep &row) { - return row.zd_linkdep_in_next; -} - -// --- amc_vis.Link.zd_linkdep_in.Prev -// Return pointer to previous element in the list -inline amc_vis::Linkdep* amc_vis::zd_linkdep_in_Prev(amc_vis::Linkdep &row) { - return row.zd_linkdep_in_prev; -} - -// --- amc_vis.Link.zd_linkdep_in.qLast -// Return reference to last element in the index. No bounds checking. -inline amc_vis::Linkdep& amc_vis::zd_linkdep_in_qLast(amc_vis::Link& link) { - amc_vis::Linkdep *row = NULL; - row = link.zd_linkdep_in_tail; - return *row; -} - -// --- amc_vis.Link.zd_linkdep_out_curs.Reset -// cursor points to valid item -inline void amc_vis::link_zd_linkdep_out_curs_Reset(link_zd_linkdep_out_curs &curs, amc_vis::Link &parent) { - curs.row = parent.zd_linkdep_out_head; -} - -// --- amc_vis.Link.zd_linkdep_out_curs.ValidQ -// cursor points to valid item -inline bool amc_vis::link_zd_linkdep_out_curs_ValidQ(link_zd_linkdep_out_curs &curs) { - return curs.row != NULL; -} - -// --- amc_vis.Link.zd_linkdep_out_curs.Next -// proceed to next item -inline void amc_vis::link_zd_linkdep_out_curs_Next(link_zd_linkdep_out_curs &curs) { - amc_vis::Linkdep *next = (*curs.row).zd_linkdep_out_next; - curs.row = next; -} - -// --- amc_vis.Link.zd_linkdep_out_curs.Access -// item access -inline amc_vis::Linkdep& amc_vis::link_zd_linkdep_out_curs_Access(link_zd_linkdep_out_curs &curs) { - return *curs.row; -} - -// --- amc_vis.Link.zd_linkdep_in_curs.Reset -// cursor points to valid item -inline void amc_vis::link_zd_linkdep_in_curs_Reset(link_zd_linkdep_in_curs &curs, amc_vis::Link &parent) { - curs.row = parent.zd_linkdep_in_head; -} - -// --- amc_vis.Link.zd_linkdep_in_curs.ValidQ -// cursor points to valid item -inline bool amc_vis::link_zd_linkdep_in_curs_ValidQ(link_zd_linkdep_in_curs &curs) { - return curs.row != NULL; -} - -// --- amc_vis.Link.zd_linkdep_in_curs.Next -// proceed to next item -inline void amc_vis::link_zd_linkdep_in_curs_Next(link_zd_linkdep_in_curs &curs) { - amc_vis::Linkdep *next = (*curs.row).zd_linkdep_in_next; - curs.row = next; -} - -// --- amc_vis.Link.zd_linkdep_in_curs.Access -// item access -inline amc_vis::Linkdep& amc_vis::link_zd_linkdep_in_curs_Access(link_zd_linkdep_in_curs &curs) { - return *curs.row; -} - -// --- amc_vis.Link..Ctor -inline amc_vis::Link::Link() { - amc_vis::Link_Init(*this); -} - -// --- amc_vis.Link..Dtor -inline amc_vis::Link::~Link() { - amc_vis::Link_Uninit(*this); -} - -// --- amc_vis.Linkdep..Init -// Set all fields to initial values. -inline void amc_vis::Linkdep_Init(amc_vis::Linkdep& linkdep) { - linkdep.row = i32(0); - linkdep.rowid = i32(0); - linkdep.up = bool(false); - linkdep.inst = bool(false); - linkdep.p_link_from = NULL; - linkdep.p_link_to = NULL; - linkdep.zd_linkdep_out_next = (amc_vis::Linkdep*)-1; // (amc_vis.Link.zd_linkdep_out) not-in-list - linkdep.zd_linkdep_out_prev = NULL; // (amc_vis.Link.zd_linkdep_out) - linkdep.zd_linkdep_in_next = (amc_vis::Linkdep*)-1; // (amc_vis.Link.zd_linkdep_in) not-in-list - linkdep.zd_linkdep_in_prev = NULL; // (amc_vis.Link.zd_linkdep_in) -} - -// --- amc_vis.Linkdep..Ctor -inline amc_vis::Linkdep::Linkdep() { - amc_vis::Linkdep_Init(*this); -} - -// --- amc_vis.Linkdep..Dtor -inline amc_vis::Linkdep::~Linkdep() { - amc_vis::Linkdep_Uninit(*this); -} - -// --- amc_vis.Linkdep..FieldwiseCtor -inline amc_vis::Linkdep::Linkdep(i32 in_row, i32 in_rowid, bool in_up, bool in_inst, amc_vis::Link* in_p_link_from, amc_vis::Link* in_p_link_to) - : row(in_row) - , rowid(in_rowid) - , up(in_up) - , inst(in_inst) - , p_link_from(in_p_link_from) - , p_link_to(in_p_link_to) - { -} - -// --- amc_vis.Outrow.text.EmptyQ -// Return true if index is empty -inline bool amc_vis::text_EmptyQ(amc_vis::Outrow& outrow) { - return outrow.text_n == 0; -} - -// --- amc_vis.Outrow.text.Find -// Look up row by row id. Return NULL if out of range -inline u8* amc_vis::text_Find(amc_vis::Outrow& outrow, u64 t) { - u64 idx = t; - u64 lim = outrow.text_n; - if (idx >= lim) return NULL; - return outrow.text_elems + idx; -} - -// --- amc_vis.Outrow.text.Getary -// Return array pointer by value -inline algo::aryptr amc_vis::text_Getary(const amc_vis::Outrow& outrow) { - return algo::aryptr(outrow.text_elems, outrow.text_n); -} - -// --- amc_vis.Outrow.text.Last +// --- amc_vis.FOutrow.text.Last // Return pointer to last element of array, or NULL if array is empty -inline u8* amc_vis::text_Last(amc_vis::Outrow& outrow) { +inline u16* amc_vis::text_Last(amc_vis::FOutrow& outrow) { return text_Find(outrow, u64(outrow.text_n-1)); } -// --- amc_vis.Outrow.text.Max +// --- amc_vis.FOutrow.text.Max // Return max. number of items in the array -inline i32 amc_vis::text_Max(amc_vis::Outrow& outrow) { +inline i32 amc_vis::text_Max(amc_vis::FOutrow& outrow) { (void)outrow; return outrow.text_max; } -// --- amc_vis.Outrow.text.N +// --- amc_vis.FOutrow.text.N // Return number of items in the array -inline i32 amc_vis::text_N(const amc_vis::Outrow& outrow) { +inline i32 amc_vis::text_N(const amc_vis::FOutrow& outrow) { return outrow.text_n; } -// --- amc_vis.Outrow.text.RemoveAll -inline void amc_vis::text_RemoveAll(amc_vis::Outrow& outrow) { +// --- amc_vis.FOutrow.text.RemoveAll +inline void amc_vis::text_RemoveAll(amc_vis::FOutrow& outrow) { outrow.text_n = 0; } -// --- amc_vis.Outrow.text.Reserve +// --- amc_vis.FOutrow.text.Reserve // Make sure N *more* elements will fit in array. Process dies if out of memory -inline void amc_vis::text_Reserve(amc_vis::Outrow& outrow, int n) { +inline void amc_vis::text_Reserve(amc_vis::FOutrow& outrow, int n) { u32 new_n = outrow.text_n + n; if (UNLIKELY(new_n > outrow.text_max)) { text_AbsReserve(outrow, new_n); } } -// --- amc_vis.Outrow.text.qFind +// --- amc_vis.FOutrow.text.qFind // 'quick' Access row by row id. No bounds checking. -inline u8& amc_vis::text_qFind(amc_vis::Outrow& outrow, u64 t) { +inline u16& amc_vis::text_qFind(amc_vis::FOutrow& outrow, u64 t) { return outrow.text_elems[t]; } -// --- amc_vis.Outrow.text.qLast +// --- amc_vis.FOutrow.text.qLast // Return reference to last element of array. No bounds checking -inline u8& amc_vis::text_qLast(amc_vis::Outrow& outrow) { +inline u16& amc_vis::text_qLast(amc_vis::FOutrow& outrow) { return text_qFind(outrow, u64(outrow.text_n-1)); } -// --- amc_vis.Outrow.text.rowid_Get +// --- amc_vis.FOutrow.text.rowid_Get // Return row id of specified element -inline u64 amc_vis::text_rowid_Get(amc_vis::Outrow& outrow, u8 &elem) { +inline u64 amc_vis::text_rowid_Get(amc_vis::FOutrow& outrow, u16 &elem) { u64 id = &elem - outrow.text_elems; return u64(id); } -// --- amc_vis.Outrow.text_curs.Next +// --- amc_vis.FOutrow.text_curs.Next // proceed to next item inline void amc_vis::outrow_text_curs_Next(outrow_text_curs &curs) { curs.index++; } -// --- amc_vis.Outrow.text_curs.Reset -inline void amc_vis::outrow_text_curs_Reset(outrow_text_curs &curs, amc_vis::Outrow &parent) { +// --- amc_vis.FOutrow.text_curs.Reset +inline void amc_vis::outrow_text_curs_Reset(outrow_text_curs &curs, amc_vis::FOutrow &parent) { curs.elems = parent.text_elems; curs.n_elems = parent.text_n; curs.index = 0; } -// --- amc_vis.Outrow.text_curs.ValidQ +// --- amc_vis.FOutrow.text_curs.ValidQ // cursor points to valid item inline bool amc_vis::outrow_text_curs_ValidQ(outrow_text_curs &curs) { return curs.index < curs.n_elems; } -// --- amc_vis.Outrow.text_curs.Access +// --- amc_vis.FOutrow.text_curs.Access // item access -inline u8& amc_vis::outrow_text_curs_Access(outrow_text_curs &curs) { +inline u16& amc_vis::outrow_text_curs_Access(outrow_text_curs &curs) { return curs.elems[curs.index]; } -// --- amc_vis.Outrow..Init +// --- amc_vis.FOutrow..Init // Set all fields to initial values. -inline void amc_vis::Outrow_Init(amc_vis::Outrow& outrow) { +inline void amc_vis::FOutrow_Init(amc_vis::FOutrow& outrow) { outrow.rowid = i32(0); - outrow.text_elems = 0; // (amc_vis.Outrow.text) - outrow.text_n = 0; // (amc_vis.Outrow.text) - outrow.text_max = 0; // (amc_vis.Outrow.text) + outrow.text_elems = 0; // (amc_vis.FOutrow.text) + outrow.text_n = 0; // (amc_vis.FOutrow.text) + outrow.text_max = 0; // (amc_vis.FOutrow.text) } -// --- amc_vis.Outrow..Ctor -inline amc_vis::Outrow::Outrow() { - amc_vis::Outrow_Init(*this); +// --- amc_vis.FOutrow..Ctor +inline amc_vis::FOutrow::FOutrow() { + amc_vis::FOutrow_Init(*this); } -// --- amc_vis.Outrow..Dtor -inline amc_vis::Outrow::~Outrow() { - amc_vis::Outrow_Uninit(*this); +// --- amc_vis.FOutrow..Dtor +inline amc_vis::FOutrow::~FOutrow() { + amc_vis::FOutrow_Uninit(*this); +} + +// --- amc_vis.FReftype..Ctor +inline amc_vis::FReftype::FReftype() { + amc_vis::FReftype_Init(*this); +} + +// --- amc_vis.FReftype..Dtor +inline amc_vis::FReftype::~FReftype() { + amc_vis::FReftype_Uninit(*this); +} + +// --- amc_vis.FieldId.value.GetEnum +// Get value of field as enum type +inline amc_vis_FieldIdEnum amc_vis::value_GetEnum(const amc_vis::FieldId& parent) { + return amc_vis_FieldIdEnum(parent.value); +} + +// --- amc_vis.FieldId.value.SetEnum +// Set value of field from enum type. +inline void amc_vis::value_SetEnum(amc_vis::FieldId& parent, amc_vis_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- amc_vis.FieldId.value.Cast +inline amc_vis::FieldId::operator amc_vis_FieldIdEnum() const { + return amc_vis_FieldIdEnum((*this).value); +} + +// --- amc_vis.FieldId..Init +// Set all fields to initial values. +inline void amc_vis::FieldId_Init(amc_vis::FieldId& parent) { + parent.value = i32(-1); +} + +// --- amc_vis.FieldId..Ctor +inline amc_vis::FieldId::FieldId() { + amc_vis::FieldId_Init(*this); +} + +// --- amc_vis.FieldId..FieldwiseCtor +inline amc_vis::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- amc_vis.FieldId..EnumCtor +inline amc_vis::FieldId::FieldId(amc_vis_FieldIdEnum arg) { + this->value = i32(arg); } // --- amc_vis.TableId.value.GetEnum @@ -2079,33 +2081,33 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::trace return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::Nodekey &row) {// cfmt:amc_vis.Nodekey.String - amc_vis::Nodekey_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::Linkkey &row) {// cfmt:amc_vis.Linkkey.String + amc_vis::Linkkey_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::FieldId &row) {// cfmt:amc_vis.FieldId.String - amc_vis::FieldId_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::FLink &row) {// cfmt:amc_vis.FLink.String + amc_vis::FLink_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::Linkkey &row) {// cfmt:amc_vis.Linkkey.String - amc_vis::Linkkey_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::FLinkdep &row) {// cfmt:amc_vis.FLinkdep.String + amc_vis::FLinkdep_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::Link &row) {// cfmt:amc_vis.Link.String - amc_vis::Link_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::Nodekey &row) {// cfmt:amc_vis.Nodekey.String + amc_vis::Nodekey_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::Linkdep &row) {// cfmt:amc_vis.Linkdep.String - amc_vis::Linkdep_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::FOutrow &row) {// cfmt:amc_vis.FOutrow.String + amc_vis::FOutrow_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::Outrow &row) {// cfmt:amc_vis.Outrow.String - amc_vis::Outrow_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const amc_vis::FieldId &row) {// cfmt:amc_vis.FieldId.String + amc_vis::FieldId_Print(const_cast(row), str); return str; } diff --git a/include/gen/ams_gen.h b/include/gen/ams_gen.h index 4d98e5b7..0d6c3750 100644 --- a/include/gen/ams_gen.h +++ b/include/gen/ams_gen.h @@ -28,165 +28,146 @@ //#pragma endinclude // gen:ns_enums -// --- ams_ProcTypeEnum - -enum ams_ProcTypeEnum { // ams.ProcType.value - ams_ProcType_0 = 0 // No process - ,ams_ProcType_amstest = 5 // Ams testing -}; - -enum { ams_ProcTypeEnum_N = 2 }; - - -// --- ams_StreamTypeEnum +// --- ams_FieldIdEnum -enum ams_StreamTypeEnum { // ams.StreamType.value - ams_StreamType_0 = 0 // No stream - ,ams_StreamType_ctl = 1 // AMS control messages - ,ams_StreamType_io = 5 // Messages intended for file output - ,ams_StreamType_out = 2 // Log messages, alarms - ,ams_StreamType_trace = 6 // Trace messages +enum ams_FieldIdEnum { // ams.FieldId.value + ams_FieldId_base = 0 + ,ams_FieldId_type = 1 + ,ams_FieldId_length = 2 + ,ams_FieldId_text = 3 + ,ams_FieldId_proc_id = 4 + ,ams_FieldId_payload = 5 + ,ams_FieldId_tstamp = 6 + ,ams_FieldId_logcat = 7 + ,ams_FieldId_proc = 8 + ,ams_FieldId_value = 9 + ,ams_FieldId_proctype = 10 + ,ams_FieldId_nodeidx = 11 + ,ams_FieldId_procidx = 12 + ,ams_FieldId_signal = 13 + ,ams_FieldId_until = 14 + ,ams_FieldId_pty = 15 + ,ams_FieldId_cmd = 16 + ,ams_FieldId_status = 17 + ,ams_FieldId_remove_topmost = 18 + ,ams_FieldId_pathname = 19 + ,ams_FieldId_write = 20 + ,ams_FieldId_read = 21 + ,ams_FieldId_nonblock = 22 + ,ams_FieldId_write_err = 23 + ,ams_FieldId_shmember = 24 + ,ams_FieldId_off = 25 + ,ams_FieldId_wbudget = 26 + ,ams_FieldId_shmtype = 27 + ,ams_FieldId_index = 28 + ,ams_FieldId_r = 29 + ,ams_FieldId_w = 30 + ,ams_FieldId_shm_id = 31 + ,ams_FieldId_flags = 32 }; -enum { ams_StreamTypeEnum_N = 5 }; +enum { ams_FieldIdEnum_N = 33 }; -// --- ams_FieldIdEnum +// --- ams_ProctypeEnum -enum ams_FieldIdEnum { // ams.FieldId.value - ams_FieldId_base = 0 - ,ams_FieldId_type = 1 - ,ams_FieldId_length = 2 - ,ams_FieldId_updated_after = 3 - ,ams_FieldId_stream_id = 4 - ,ams_FieldId_proc_id = 5 - ,ams_FieldId_text = 6 - ,ams_FieldId_time = 7 - ,ams_FieldId_payload = 8 - ,ams_FieldId_logcat = 9 - ,ams_FieldId_tstamp = 10 - ,ams_FieldId_mode = 11 - ,ams_FieldId_member = 12 - ,ams_FieldId_pos = 13 - ,ams_FieldId_data = 14 - ,ams_FieldId_proc_type = 15 - ,ams_FieldId_procidx = 16 - ,ams_FieldId_value = 17 - ,ams_FieldId_seqmsg_id = 18 - ,ams_FieldId_tsc = 19 - ,ams_FieldId_seq = 20 - ,ams_FieldId_off = 21 - ,ams_FieldId_write = 22 - ,ams_FieldId_read = 23 - ,ams_FieldId_nonblock = 24 - ,ams_FieldId_trace_read = 25 - ,ams_FieldId_trace_write = 26 - ,ams_FieldId_write_err = 27 - ,ams_FieldId_trace_text = 28 - ,ams_FieldId_wbudget = 29 - ,ams_FieldId_stream_type = 30 - ,ams_FieldId_streamidx = 31 - ,ams_FieldId_proc = 32 - ,ams_FieldId_trace = 33 - ,ams_FieldId_part = 34 +enum ams_ProctypeEnum { // ams.Proctype.value + ams_Proctype_ = 0 // No process + ,ams_Proctype_ams_sendtest = 5 // Ams testing }; -enum { ams_FieldIdEnum_N = 35 }; +enum { ams_ProctypeEnum_N = 2 }; -// --- ams_Member_mode_Enum +// --- ams_MsgHeader_type_Enum -enum ams_Member_mode_Enum { // ams.Member.mode - ams_Member_mode_r = 0 - ,ams_Member_mode_w = 1 +enum ams_MsgHeader_type_Enum { // ams.MsgHeader.type + ams_MsgHeader_type_ams_ExpectMsg = 395 // Pause reading until some output is produced + ,ams_MsgHeader_type_ams_InputLineMsg = 22 // Unrecognized input line + ,ams_MsgHeader_type_ams_LogMsg = 6 // Log message + ,ams_MsgHeader_type_ams_MsgBlock = 1 // A block of messages from ams commit file + ,ams_MsgHeader_type_ams_ProcEofMsg = 703 // EOF from/to a process + ,ams_MsgHeader_type_ams_ProcKillMsg = 704 // Kill process + ,ams_MsgHeader_type_ams_ProcMsg = 701 // Message from/to a process + ,ams_MsgHeader_type_ams_ProcReadMsg = 702 // Read process output + ,ams_MsgHeader_type_ams_ProcStartMsg = 700 // Start process + ,ams_MsgHeader_type_ams_ProcStatusMsg = 705 // Process status + ,ams_MsgHeader_type_ams_RemDirRecurseMsg = 633 // Message sent to process to terminate it + ,ams_MsgHeader_type_ams_ShmHbMsg = 3 // Shm heartbeat + ,ams_MsgHeader_type_ams_Shmmsg = 10 // Sequenced message on a shm + ,ams_MsgHeader_type_ams_TerminateMsg = 352 // Message sent to process to terminate it + ,ams_MsgHeader_type_ams_UdpFrame = 2 // sniffer-captured ethernet frame + ,ams_MsgHeader_type_fm_AlarmMsg = 17 + ,ams_MsgHeader_type_ws_CloseMsg = 504 + ,ams_MsgHeader_type_ws_ConnectMsg = 502 + ,ams_MsgHeader_type_ws_DataMsg = 503 + ,ams_MsgHeader_type_ws_ServerStartMsg = 500 + ,ams_MsgHeader_type_ws_ServerStopMsg = 501 }; -enum { ams_Member_mode_Enum_N = 2 }; +enum { ams_MsgHeader_type_Enum_N = 21 }; -// --- ams_MsgHeader_type_Enum +// --- ams_MsgHeaderMsgsCaseEnum -enum ams_MsgHeader_type_Enum { // ams.MsgHeader.type - ams_MsgHeader_type_ams_AlarmSyncMsg = 18 - ,ams_MsgHeader_type_ams_DfltStream = 21 // Set default stream for subsequent messages - ,ams_MsgHeader_type_ams_DumpStreamTableMsg = 12 // Remove process from process group - ,ams_MsgHeader_type_ams_ExpectMsg = 395 // Pause reading until some output is produced - ,ams_MsgHeader_type_ams_HeartbeatMsg = 16 - ,ams_MsgHeader_type_ams_InputLineMsg = 22 // Unrecognized input line - ,ams_MsgHeader_type_ams_LogMsg = 6 // Log message - ,ams_MsgHeader_type_ams_MsgBlock = 1 // A block of messages from ams commit file - ,ams_MsgHeader_type_ams_OpenMsg = 7 // Open stream for reading - ,ams_MsgHeader_type_ams_PrlogMsg = 229 - ,ams_MsgHeader_type_ams_ProcAddMsg = 4 // Add process to process group - ,ams_MsgHeader_type_ams_ProcRemoveMsg = 5 // Remove process from process group - ,ams_MsgHeader_type_ams_Seqmsg = 10 // Sequenced stream message - ,ams_MsgHeader_type_ams_SeqmsgTrace = 11 // Message used to trace reading/writing seqmsgs - ,ams_MsgHeader_type_ams_StreamHbMsg = 3 // Stream heartbeat - ,ams_MsgHeader_type_ams_TerminateMsg = 352 // Message sent to process to terminate it - ,ams_MsgHeader_type_ams_Trace2Msg = 108 // Trace2 message - ,ams_MsgHeader_type_ams_TraceInfo2Msg = 109 // Trace info message - ,ams_MsgHeader_type_ams_TraceInfoMsg = 9 // Trace info message - ,ams_MsgHeader_type_ams_TraceMsg = 8 // Trace message - ,ams_MsgHeader_type_ams_UdpFrame = 2 // sniffer-captured ethernet frame - ,ams_MsgHeader_type_fm_AlarmMsg = 17 +enum ams_MsgHeaderMsgsCaseEnum { // ams.MsgHeaderMsgsCase.value + ams_MsgHeaderMsgsCase_ams_ExpectMsg = 395 + ,ams_MsgHeaderMsgsCase_ams_InputLineMsg = 22 + ,ams_MsgHeaderMsgsCase_ams_LogMsg = 6 + ,ams_MsgHeaderMsgsCase_ams_MsgBlock = 1 + ,ams_MsgHeaderMsgsCase_ams_ProcEofMsg = 703 + ,ams_MsgHeaderMsgsCase_ams_ProcKillMsg = 704 + ,ams_MsgHeaderMsgsCase_ams_ProcMsg = 701 + ,ams_MsgHeaderMsgsCase_ams_ProcReadMsg = 702 + ,ams_MsgHeaderMsgsCase_ams_ProcStartMsg = 700 + ,ams_MsgHeaderMsgsCase_ams_ProcStatusMsg = 705 + ,ams_MsgHeaderMsgsCase_ams_RemDirRecurseMsg = 633 + ,ams_MsgHeaderMsgsCase_ams_ShmHbMsg = 3 + ,ams_MsgHeaderMsgsCase_ams_Shmmsg = 10 + ,ams_MsgHeaderMsgsCase_ams_TerminateMsg = 352 + ,ams_MsgHeaderMsgsCase_ams_UdpFrame = 2 + ,ams_MsgHeaderMsgsCase_fm_AlarmMsg = 17 + ,ams_MsgHeaderMsgsCase_ws_CloseMsg = 504 + ,ams_MsgHeaderMsgsCase_ws_ConnectMsg = 502 + ,ams_MsgHeaderMsgsCase_ws_DataMsg = 503 + ,ams_MsgHeaderMsgsCase_ws_ServerStartMsg = 500 + ,ams_MsgHeaderMsgsCase_ws_ServerStopMsg = 501 }; -enum { ams_MsgHeader_type_Enum_N = 22 }; +enum { ams_MsgHeaderMsgsCaseEnum_N = 21 }; -// --- ams_MsgHeaderMsgsCaseEnum +// --- ams_ShmFlagsEnum -enum ams_MsgHeaderMsgsCaseEnum { // ams.MsgHeaderMsgsCase.value - ams_MsgHeaderMsgsCase_ams_AlarmSyncMsg = 18 - ,ams_MsgHeaderMsgsCase_ams_DfltStream = 21 - ,ams_MsgHeaderMsgsCase_ams_DumpStreamTableMsg = 12 - ,ams_MsgHeaderMsgsCase_ams_ExpectMsg = 395 - ,ams_MsgHeaderMsgsCase_ams_HeartbeatMsg = 16 - ,ams_MsgHeaderMsgsCase_ams_InputLineMsg = 22 - ,ams_MsgHeaderMsgsCase_ams_LogMsg = 6 - ,ams_MsgHeaderMsgsCase_ams_MsgBlock = 1 - ,ams_MsgHeaderMsgsCase_ams_OpenMsg = 7 - ,ams_MsgHeaderMsgsCase_ams_PrlogMsg = 229 - ,ams_MsgHeaderMsgsCase_ams_ProcAddMsg = 4 - ,ams_MsgHeaderMsgsCase_ams_ProcRemoveMsg = 5 - ,ams_MsgHeaderMsgsCase_ams_Seqmsg = 10 - ,ams_MsgHeaderMsgsCase_ams_SeqmsgTrace = 11 - ,ams_MsgHeaderMsgsCase_ams_StreamHbMsg = 3 - ,ams_MsgHeaderMsgsCase_ams_TerminateMsg = 352 - ,ams_MsgHeaderMsgsCase_ams_Trace2Msg = 108 - ,ams_MsgHeaderMsgsCase_ams_TraceInfo2Msg = 109 - ,ams_MsgHeaderMsgsCase_ams_TraceInfoMsg = 9 - ,ams_MsgHeaderMsgsCase_ams_TraceMsg = 8 - ,ams_MsgHeaderMsgsCase_ams_UdpFrame = 2 - ,ams_MsgHeaderMsgsCase_fm_AlarmMsg = 17 +enum ams_ShmFlagsEnum { // ams.ShmFlags.value + ams_ShmFlags_write = 0x2 // ams.ShmFlags.write + ,ams_ShmFlags_read = 0x4 // ams.ShmFlags.read + ,ams_ShmFlags_nonblock = 0x8 // ams.ShmFlags.nonblock + ,ams_ShmFlags_write_err = 0x40 // ams.ShmFlags.write_err }; -enum { ams_MsgHeaderMsgsCaseEnum_N = 22 }; +enum { ams_ShmFlagsEnum_N = 4 }; -// --- ams_SeqmsgTrace_mode_Enum +// --- ams_ShmtypeEnum -enum ams_SeqmsgTrace_mode_Enum { // ams.SeqmsgTrace.mode - ams_SeqmsgTrace_mode_r = 0 - ,ams_SeqmsgTrace_mode_w = 1 +enum ams_ShmtypeEnum { // ams.Shmtype.value + ams_Shmtype_ctl = 1 // AMS control messages + ,ams_Shmtype_log = 9 // Log messages + ,ams_Shmtype_out = 2 // Log messages, alarms }; -enum { ams_SeqmsgTrace_mode_Enum_N = 2 }; +enum { ams_ShmtypeEnum_N = 3 }; -// --- ams_StreamFlagsEnum +// --- ams_ShmemberFlagsEnum -enum ams_StreamFlagsEnum { // ams.StreamFlags.value - ams_StreamFlags_write = (u8(1)<<1) // ams.StreamFlags.write - ,ams_StreamFlags_read = (u8(1)<<2) // ams.StreamFlags.read - ,ams_StreamFlags_nonblock = (u8(1)<<3) // ams.StreamFlags.nonblock - ,ams_StreamFlags_trace_read = (u8(1)<<4) // ams.StreamFlags.trace_read - ,ams_StreamFlags_trace_write = (u8(1)<<5) // ams.StreamFlags.trace_write - ,ams_StreamFlags_write_err = (u8(1)<<6) // ams.StreamFlags.write_err - ,ams_StreamFlags_trace_text = (u8(1)<<7) // ams.StreamFlags.trace_text +enum ams_ShmemberFlagsEnum { // ams.ShmemberFlags.value + ams_ShmemberFlags_r = 0x1 // ams.ShmemberFlags.r + ,ams_ShmemberFlags_w = 0x2 // ams.ShmemberFlags.w }; -enum { ams_StreamFlagsEnum_N = 7 }; +enum { ams_ShmemberFlagsEnum_N = 2 }; namespace ams { // gen:ns_pkeytypedef } // gen:ns_pkeytypedef @@ -194,49 +175,48 @@ namespace ams { // gen:ns_tclass_field } // gen:ns_tclass_field // gen:ns_fwddecl2 namespace ams { struct MsgHeader; } -namespace ams { struct AlarmSyncMsg; } -namespace ams { struct DfltStream; } -namespace ams { struct DumpStreamTableMsg; } namespace ams { struct ExpectMsg; } -namespace ams { struct HeartbeatMsg; } namespace ams { struct InputLineMsg; } namespace ams { struct LogMsg; } namespace ams { struct MsgBlock; } -namespace ams { struct OpenMsg; } -namespace ams { struct PrlogMsg; } -namespace ams { struct ProcAddMsg; } -namespace ams { struct ProcRemoveMsg; } -namespace ams { struct Seqmsg; } -namespace ams { struct SeqmsgTrace; } -namespace ams { struct StreamHbMsg; } +namespace ams { struct ProcEofMsg; } +namespace ams { struct ProcKillMsg; } +namespace ams { struct ProcMsg; } +namespace ams { struct ProcReadMsg; } +namespace ams { struct ProcStartMsg; } +namespace ams { struct ProcStatusMsg; } +namespace ams { struct RemDirRecurseMsg; } +namespace ams { struct ShmHbMsg; } +namespace ams { struct Shmmsg; } namespace ams { struct TerminateMsg; } -namespace ams { struct Trace2Msg; } -namespace ams { struct TraceInfo2Msg; } -namespace ams { struct TraceInfoMsg; } -namespace ams { struct TraceMsg; } namespace ams { struct UdpFrame; } namespace fm { struct AlarmMsg; } +namespace ws { struct CloseMsg; } +namespace ws { struct ConnectMsg; } +namespace ws { struct DataMsg; } +namespace ws { struct ServerStartMsg; } +namespace ws { struct ServerStopMsg; } namespace ams { struct ProcId; } -namespace ams { struct SeqmsgId; } namespace ietf { struct Ipv4; } namespace ams { struct ExpectMsg_text_curs; } namespace ams { struct InputLineMsg_payload_curs; } +namespace ams { struct LogMsg_logcat_curs; } namespace ams { struct LogMsg_text_curs; } namespace ams { struct MsgBlock_messages_curs; } -namespace ams { struct Trace2Msg_data_curs; } -namespace ams { struct TraceInfo2Msg_data_curs; } -namespace ams { struct TraceInfoMsg_data_curs; } -namespace ams { struct TraceMsg_data_curs; } +namespace ams { struct ProcMsg_payload_curs; } +namespace ams { struct ProcReadMsg_until_curs; } +namespace ams { struct ProcStartMsg_cmd_curs; } +namespace ams { struct RemDirRecurseMsg_pathname_curs; } namespace ams { struct UdpFrame_payload_curs; } -namespace ams { struct ProcType; } -namespace ams { struct StreamType; } -namespace ams { struct StreamId; } namespace ams { struct FieldId; } -namespace ams { struct Member; } +namespace ams { struct Proctype; } namespace ams { struct MsgHeaderMsgsCase; } namespace ams { struct MsgHeader_curs; } -namespace ams { struct StreamPos; } -namespace ams { struct StreamFlags; } +namespace ams { struct ShmFlags; } +namespace ams { struct Shmtype; } +namespace ams { struct ShmId; } +namespace ams { struct ShmemberFlags; } +namespace ams { struct ShmemberId; } namespace ams { // gen:ns_size_enums // sizes types appearing as Opt or Varlen; these need to be here @@ -248,344 +228,6 @@ enum { } // gen:ns_size_enums namespace ams { // gen:ns_print_struct -// --- ams.AlarmSyncMsg -#pragma pack(push,1) -struct AlarmSyncMsg { // ams.AlarmSyncMsg - u32 type; // 18 - u32 length; // ssizeof(parent) + (0) - algo::UnTime updated_after; // - // func:ams.AlarmSyncMsg..Ctor - inline AlarmSyncMsg() __attribute__((nothrow)); - // func:ams.AlarmSyncMsg..FieldwiseCtor - explicit inline AlarmSyncMsg(algo::UnTime in_updated_after) __attribute__((nothrow)); -}; -#pragma pack(pop) - -// Copy fields out of row -// func:ams.AlarmSyncMsg.base.CopyOut -void parent_CopyOut(ams::AlarmSyncMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of AlarmSyncMsg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of AlarmSyncMsg. -// If not successful, quietly return NULL. -// func:ams.AlarmSyncMsg.base.Castdown -inline ams::AlarmSyncMsg* AlarmSyncMsg_Castdown(ams::MsgHeader &hdr); -// func:ams.AlarmSyncMsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::AlarmSyncMsg& parent); - -// func:ams.AlarmSyncMsg..ReadFieldMaybe -bool AlarmSyncMsg_ReadFieldMaybe(ams::AlarmSyncMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::AlarmSyncMsg from an ascii string. -// The format of the string is an ssim Tuple -// func:ams.AlarmSyncMsg..ReadStrptrMaybe -bool AlarmSyncMsg_ReadStrptrMaybe(ams::AlarmSyncMsg &parent, algo::strptr in_str) __attribute__((nothrow)); -// Message length (uses length field) -// func:ams.AlarmSyncMsg..GetMsgLength -inline i32 GetMsgLength(const ams::AlarmSyncMsg& parent) __attribute__((nothrow)); -// Memptr encompassing the message (uses length field) -// func:ams.AlarmSyncMsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::AlarmSyncMsg& row) __attribute__((nothrow)); -// Set all fields to initial values. -// func:ams.AlarmSyncMsg..Init -inline void AlarmSyncMsg_Init(ams::AlarmSyncMsg& parent); -// print string representation of ROW to string STR -// cfmt:ams.AlarmSyncMsg.String printfmt:Tuple -// func:ams.AlarmSyncMsg..Print -void AlarmSyncMsg_Print(ams::AlarmSyncMsg& row, algo::cstring& str) __attribute__((nothrow)); - -// --- ams.ProcType -#pragma pack(push,1) -struct ProcType { // ams.ProcType: StreamID + Sequence number - u8 value; // 0 - // func:ams.ProcType..EqOp - inline bool operator ==(const ams::ProcType &rhs) const __attribute__((nothrow)); - // func:ams.ProcType..NeOp - inline bool operator !=(const ams::ProcType &rhs) const __attribute__((nothrow)); - // define enum comparison operator to avoid ambiguity - // func:ams.ProcType..EqEnum - inline bool operator ==(ams_ProcTypeEnum rhs) const __attribute__((nothrow)); - // func:ams.ProcType..Ctor - inline ProcType() __attribute__((nothrow)); - // func:ams.ProcType..FieldwiseCtor - explicit inline ProcType(u8 in_value) __attribute__((nothrow)); - // func:ams.ProcType..EnumCtor - inline ProcType(ams_ProcTypeEnum arg) __attribute__((nothrow)); -}; -#pragma pack(pop) - -// Get value of field as enum type -// func:ams.ProcType.value.GetEnum -inline ams_ProcTypeEnum value_GetEnum(const ams::ProcType& parent) __attribute__((nothrow)); -// Set value of field from enum type. -// func:ams.ProcType.value.SetEnum -inline void value_SetEnum(ams::ProcType& parent, ams_ProcTypeEnum rhs) __attribute__((nothrow)); -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -// func:ams.ProcType.value.ToCstr -const char* value_ToCstr(const ams::ProcType& parent) __attribute__((nothrow)); -// Convert value to a string. First, attempt conversion to a known string. -// If no string matches, print value as a numeric value. -// func:ams.ProcType.value.Print -void value_Print(const ams::ProcType& parent, algo::cstring &lhs) __attribute__((nothrow)); -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -// func:ams.ProcType.value.SetStrptrMaybe -bool value_SetStrptrMaybe(ams::ProcType& parent, algo::strptr rhs) __attribute__((nothrow)); -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -// func:ams.ProcType.value.SetStrptr -void value_SetStrptr(ams::ProcType& parent, algo::strptr rhs, ams_ProcTypeEnum dflt) __attribute__((nothrow)); -// Convert string to field. Return success value -// func:ams.ProcType.value.ReadStrptrMaybe -bool value_ReadStrptrMaybe(ams::ProcType& parent, algo::strptr rhs) __attribute__((nothrow)); - -// func:ams.ProcType..Hash -inline u32 ProcType_Hash(u32 prev, ams::ProcType rhs) __attribute__((nothrow)); -// Read fields of ams::ProcType from an ascii string. -// The format of the string is the format of the ams::ProcType's only field -// func:ams.ProcType..ReadStrptrMaybe -bool ProcType_ReadStrptrMaybe(ams::ProcType &parent, algo::strptr in_str) __attribute__((nothrow)); -// func:ams.ProcType..Cmp -inline i32 ProcType_Cmp(ams::ProcType lhs, ams::ProcType rhs) __attribute__((nothrow)); -// Set all fields to initial values. -// func:ams.ProcType..Init -inline void ProcType_Init(ams::ProcType& parent); -// func:ams.ProcType..Eq -inline bool ProcType_Eq(ams::ProcType lhs, ams::ProcType rhs) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:ams.ProcType.String printfmt:Raw -// func:ams.ProcType..Print -void ProcType_Print(ams::ProcType row, algo::cstring& str) __attribute__((nothrow)); - -// --- ams.ProcId -#pragma pack(push,1) -struct ProcId { // ams.ProcId: Local process id, such as proc1-0, proc2-1 etc - ams::ProcType proc_type; // Writer process ID - u8 procidx; // 0 Writer process index - // func:ams.ProcId..EqOp - inline bool operator ==(const ams::ProcId &rhs) const __attribute__((nothrow)); - // func:ams.ProcId..NeOp - inline bool operator !=(const ams::ProcId &rhs) const __attribute__((nothrow)); - // func:ams.ProcId..Ctor - inline ProcId() __attribute__((nothrow)); - // func:ams.ProcId..FieldwiseCtor - explicit inline ProcId(ams::ProcType in_proc_type, u8 in_procidx) __attribute__((nothrow)); -}; -#pragma pack(pop) - -// func:ams.ProcId..Hash -inline u32 ProcId_Hash(u32 prev, ams::ProcId rhs) __attribute__((nothrow)); -// func:ams.ProcId..ReadFieldMaybe -bool ProcId_ReadFieldMaybe(ams::ProcId& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::ProcId from an ascii string. -// The format of the string is a string with separated values -// func:ams.ProcId..ReadStrptrMaybe -bool ProcId_ReadStrptrMaybe(ams::ProcId &parent, algo::strptr in_str) __attribute__((nothrow)); -// func:ams.ProcId..Cmp -inline i32 ProcId_Cmp(ams::ProcId lhs, ams::ProcId rhs) __attribute__((nothrow)); -// Set all fields to initial values. -// func:ams.ProcId..Init -inline void ProcId_Init(ams::ProcId& parent); -// func:ams.ProcId..Eq -inline bool ProcId_Eq(ams::ProcId lhs, ams::ProcId rhs) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:ams.ProcId.String printfmt:Sep -// func:ams.ProcId..Print -void ProcId_Print(ams::ProcId row, algo::cstring& str) __attribute__((nothrow)); - -// --- ams.StreamType -#pragma pack(push,1) -struct StreamType { // ams.StreamType: StreamID + Sequence number - u8 value; // 0 - // func:ams.StreamType..EqOp - inline bool operator ==(const ams::StreamType &rhs) const __attribute__((nothrow)); - // func:ams.StreamType..NeOp - inline bool operator !=(const ams::StreamType &rhs) const __attribute__((nothrow)); - // define enum comparison operator to avoid ambiguity - // func:ams.StreamType..EqEnum - inline bool operator ==(ams_StreamTypeEnum rhs) const __attribute__((nothrow)); - // func:ams.StreamType..Ctor - inline StreamType() __attribute__((nothrow)); - // func:ams.StreamType..FieldwiseCtor - explicit inline StreamType(u8 in_value) __attribute__((nothrow)); - // func:ams.StreamType..EnumCtor - inline StreamType(ams_StreamTypeEnum arg) __attribute__((nothrow)); -}; -#pragma pack(pop) - -// Get value of field as enum type -// func:ams.StreamType.value.GetEnum -inline ams_StreamTypeEnum value_GetEnum(const ams::StreamType& parent) __attribute__((nothrow)); -// Set value of field from enum type. -// func:ams.StreamType.value.SetEnum -inline void value_SetEnum(ams::StreamType& parent, ams_StreamTypeEnum rhs) __attribute__((nothrow)); -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -// func:ams.StreamType.value.ToCstr -const char* value_ToCstr(const ams::StreamType& parent) __attribute__((nothrow)); -// Convert value to a string. First, attempt conversion to a known string. -// If no string matches, print value as a numeric value. -// func:ams.StreamType.value.Print -void value_Print(const ams::StreamType& parent, algo::cstring &lhs) __attribute__((nothrow)); -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -// func:ams.StreamType.value.SetStrptrMaybe -bool value_SetStrptrMaybe(ams::StreamType& parent, algo::strptr rhs) __attribute__((nothrow)); -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -// func:ams.StreamType.value.SetStrptr -void value_SetStrptr(ams::StreamType& parent, algo::strptr rhs, ams_StreamTypeEnum dflt) __attribute__((nothrow)); -// Convert string to field. Return success value -// func:ams.StreamType.value.ReadStrptrMaybe -bool value_ReadStrptrMaybe(ams::StreamType& parent, algo::strptr rhs) __attribute__((nothrow)); - -// func:ams.StreamType..Hash -inline u32 StreamType_Hash(u32 prev, ams::StreamType rhs) __attribute__((nothrow)); -// Read fields of ams::StreamType from an ascii string. -// The format of the string is the format of the ams::StreamType's only field -// func:ams.StreamType..ReadStrptrMaybe -bool StreamType_ReadStrptrMaybe(ams::StreamType &parent, algo::strptr in_str) __attribute__((nothrow)); -// func:ams.StreamType..Cmp -inline i32 StreamType_Cmp(ams::StreamType lhs, ams::StreamType rhs) __attribute__((nothrow)); -// Set all fields to initial values. -// func:ams.StreamType..Init -inline void StreamType_Init(ams::StreamType& parent); -// func:ams.StreamType..Eq -inline bool StreamType_Eq(ams::StreamType lhs, ams::StreamType rhs) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:ams.StreamType.String printfmt:Raw -// func:ams.StreamType..Print -void StreamType_Print(ams::StreamType row, algo::cstring& str) __attribute__((nothrow)); - -// --- ams.StreamId -#pragma pack(push,1) -struct StreamId { // ams.StreamId: Host-unique stream ID. E.g. proc1-0.out-0 - ams::ProcId proc_id; // Writer process ID - ams::StreamType stream_type; // Stream type ID - u8 streamidx; // 0 Stream index - // func:ams.StreamId..EqOp - inline bool operator ==(const ams::StreamId &rhs) const __attribute__((nothrow)); - // func:ams.StreamId..NeOp - inline bool operator !=(const ams::StreamId &rhs) const __attribute__((nothrow)); - // func:ams.StreamId..Ctor - inline StreamId() __attribute__((nothrow)); - // func:ams.StreamId..FieldwiseCtor - explicit inline StreamId(ams::ProcId in_proc_id, ams::StreamType in_stream_type, u8 in_streamidx) __attribute__((nothrow)); -}; -#pragma pack(pop) - -// func:ams.StreamId..Hash -inline u32 StreamId_Hash(u32 prev, ams::StreamId rhs) __attribute__((nothrow)); -// func:ams.StreamId..ReadFieldMaybe -bool StreamId_ReadFieldMaybe(ams::StreamId& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::StreamId from an ascii string. -// The format of the string is a string with separated values -// func:ams.StreamId..ReadStrptrMaybe -bool StreamId_ReadStrptrMaybe(ams::StreamId &parent, algo::strptr in_str) __attribute__((nothrow)); -// func:ams.StreamId..Cmp -inline i32 StreamId_Cmp(ams::StreamId lhs, ams::StreamId rhs) __attribute__((nothrow)); -// Set all fields to initial values. -// func:ams.StreamId..Init -inline void StreamId_Init(ams::StreamId& parent); -// func:ams.StreamId..Eq -inline bool StreamId_Eq(ams::StreamId lhs, ams::StreamId rhs) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:ams.StreamId.String printfmt:Sep -// func:ams.StreamId..Print -void StreamId_Print(ams::StreamId row, algo::cstring& str) __attribute__((nothrow)); - -// --- ams.DfltStream -#pragma pack(push,1) -struct DfltStream { // ams.DfltStream: Set default stream for subsequent messages - u32 type; // 21 - u32 length; // ssizeof(parent) + (0) - ams::StreamId stream_id; // Message ID - // func:ams.DfltStream..Ctor - inline DfltStream() __attribute__((nothrow)); - // func:ams.DfltStream..FieldwiseCtor - explicit inline DfltStream(ams::StreamId in_stream_id) __attribute__((nothrow)); -}; -#pragma pack(pop) - -// Copy fields out of row -// func:ams.DfltStream.base.CopyOut -void parent_CopyOut(ams::DfltStream &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of DfltStream by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of DfltStream. -// If not successful, quietly return NULL. -// func:ams.DfltStream.base.Castdown -inline ams::DfltStream* DfltStream_Castdown(ams::MsgHeader &hdr); -// func:ams.DfltStream.base.Castbase -inline ams::MsgHeader& Castbase(ams::DfltStream& parent); - -// func:ams.DfltStream..ReadFieldMaybe -bool DfltStream_ReadFieldMaybe(ams::DfltStream& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::DfltStream from an ascii string. -// The format of the string is an ssim Tuple -// func:ams.DfltStream..ReadStrptrMaybe -bool DfltStream_ReadStrptrMaybe(ams::DfltStream &parent, algo::strptr in_str) __attribute__((nothrow)); -// Message length (uses length field) -// func:ams.DfltStream..GetMsgLength -inline i32 GetMsgLength(const ams::DfltStream& parent) __attribute__((nothrow)); -// Memptr encompassing the message (uses length field) -// func:ams.DfltStream..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::DfltStream& row) __attribute__((nothrow)); -// Set all fields to initial values. -// func:ams.DfltStream..Init -inline void DfltStream_Init(ams::DfltStream& parent); -// print string representation of ROW to string STR -// cfmt:ams.DfltStream.String printfmt:Tuple -// func:ams.DfltStream..Print -void DfltStream_Print(ams::DfltStream& row, algo::cstring& str) __attribute__((nothrow)); - -// --- ams.DumpStreamTableMsg -#pragma pack(push,1) -struct DumpStreamTableMsg { // ams.DumpStreamTableMsg: Remove process from process group - u32 type; // 12 - u32 length; // ssizeof(parent) + (0) - ams::ProcId proc_id; // Target process - // func:ams.DumpStreamTableMsg..Ctor - inline DumpStreamTableMsg() __attribute__((nothrow)); - // func:ams.DumpStreamTableMsg..FieldwiseCtor - explicit inline DumpStreamTableMsg(ams::ProcId in_proc_id) __attribute__((nothrow)); -}; -#pragma pack(pop) - -// Copy fields out of row -// func:ams.DumpStreamTableMsg.base.CopyOut -void parent_CopyOut(ams::DumpStreamTableMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of DumpStreamTableMsg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of DumpStreamTableMsg. -// If not successful, quietly return NULL. -// func:ams.DumpStreamTableMsg.base.Castdown -inline ams::DumpStreamTableMsg* DumpStreamTableMsg_Castdown(ams::MsgHeader &hdr); -// func:ams.DumpStreamTableMsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::DumpStreamTableMsg& parent); - -// func:ams.DumpStreamTableMsg..ReadFieldMaybe -bool DumpStreamTableMsg_ReadFieldMaybe(ams::DumpStreamTableMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::DumpStreamTableMsg from an ascii string. -// The format of the string is an ssim Tuple -// func:ams.DumpStreamTableMsg..ReadStrptrMaybe -bool DumpStreamTableMsg_ReadStrptrMaybe(ams::DumpStreamTableMsg &parent, algo::strptr in_str) __attribute__((nothrow)); -// Message length (uses length field) -// func:ams.DumpStreamTableMsg..GetMsgLength -inline i32 GetMsgLength(const ams::DumpStreamTableMsg& parent) __attribute__((nothrow)); -// Memptr encompassing the message (uses length field) -// func:ams.DumpStreamTableMsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::DumpStreamTableMsg& row) __attribute__((nothrow)); -// Set all fields to initial values. -// func:ams.DumpStreamTableMsg..Init -inline void DumpStreamTableMsg_Init(ams::DumpStreamTableMsg& parent); -// print string representation of ROW to string STR -// cfmt:ams.DumpStreamTableMsg.String printfmt:Tuple -// func:ams.DumpStreamTableMsg..Print -void DumpStreamTableMsg_Print(ams::DumpStreamTableMsg& row, algo::cstring& str) __attribute__((nothrow)); - // --- ams.ExpectMsg #pragma pack(push,1) struct ExpectMsg { // ams.ExpectMsg: Pause reading until some output is produced @@ -711,59 +353,145 @@ inline void FieldId_Init(ams::FieldId& parent); // func:ams.FieldId..Print void FieldId_Print(ams::FieldId& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.HeartbeatMsg +// --- ams.Proctype +// create: ams.ProcId.proctype (Bitfld) #pragma pack(push,1) -struct HeartbeatMsg { // ams.HeartbeatMsg - u32 type; // 16 - u32 length; // ssizeof(parent) + (0) - algo::UnTime time; // - // func:ams.HeartbeatMsg..Ctor - inline HeartbeatMsg() __attribute__((nothrow)); - // func:ams.HeartbeatMsg..FieldwiseCtor - explicit inline HeartbeatMsg(algo::UnTime in_time) __attribute__((nothrow)); +struct Proctype { // ams.Proctype + u8 value; // 0 + // func:ams.Proctype..EqOp + inline bool operator ==(const ams::Proctype &rhs) const __attribute__((nothrow)); + // func:ams.Proctype..NeOp + inline bool operator !=(const ams::Proctype &rhs) const __attribute__((nothrow)); + // define enum comparison operator to avoid ambiguity + // func:ams.Proctype..EqEnum + inline bool operator ==(ams_ProctypeEnum rhs) const __attribute__((nothrow)); + // func:ams.Proctype..Ctor + inline Proctype() __attribute__((nothrow)); + // func:ams.Proctype..FieldwiseCtor + explicit inline Proctype(u8 in_value) __attribute__((nothrow)); + // func:ams.Proctype..EnumCtor + inline Proctype(ams_ProctypeEnum arg) __attribute__((nothrow)); }; #pragma pack(pop) -// Copy fields out of row -// func:ams.HeartbeatMsg.base.CopyOut -void parent_CopyOut(ams::HeartbeatMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of HeartbeatMsg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of HeartbeatMsg. -// If not successful, quietly return NULL. -// func:ams.HeartbeatMsg.base.Castdown -inline ams::HeartbeatMsg* HeartbeatMsg_Castdown(ams::MsgHeader &hdr); -// func:ams.HeartbeatMsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::HeartbeatMsg& parent); - -// func:ams.HeartbeatMsg..ReadFieldMaybe -bool HeartbeatMsg_ReadFieldMaybe(ams::HeartbeatMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::HeartbeatMsg from an ascii string. -// The format of the string is an ssim Tuple -// func:ams.HeartbeatMsg..ReadStrptrMaybe -bool HeartbeatMsg_ReadStrptrMaybe(ams::HeartbeatMsg &parent, algo::strptr in_str) __attribute__((nothrow)); -// Message length (uses length field) -// func:ams.HeartbeatMsg..GetMsgLength -inline i32 GetMsgLength(const ams::HeartbeatMsg& parent) __attribute__((nothrow)); -// Memptr encompassing the message (uses length field) -// func:ams.HeartbeatMsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::HeartbeatMsg& row) __attribute__((nothrow)); +// Get value of field as enum type +// func:ams.Proctype.value.GetEnum +inline ams_ProctypeEnum value_GetEnum(const ams::Proctype& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:ams.Proctype.value.SetEnum +inline void value_SetEnum(ams::Proctype& parent, ams_ProctypeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:ams.Proctype.value.ToCstr +const char* value_ToCstr(const ams::Proctype& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:ams.Proctype.value.Print +void value_Print(const ams::Proctype& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:ams.Proctype.value.SetStrptrMaybe +bool value_SetStrptrMaybe(ams::Proctype& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:ams.Proctype.value.SetStrptr +void value_SetStrptr(ams::Proctype& parent, algo::strptr rhs, ams_ProctypeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:ams.Proctype.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(ams::Proctype& parent, algo::strptr rhs) __attribute__((nothrow)); + +// func:ams.Proctype..Hash +inline u32 Proctype_Hash(u32 prev, ams::Proctype rhs) __attribute__((nothrow)); +// Read fields of ams::Proctype from an ascii string. +// The format of the string is the format of the ams::Proctype's only field +// func:ams.Proctype..ReadStrptrMaybe +bool Proctype_ReadStrptrMaybe(ams::Proctype &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.Proctype..Cmp +inline i32 Proctype_Cmp(ams::Proctype lhs, ams::Proctype rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ams.Proctype..Init +inline void Proctype_Init(ams::Proctype& parent); +// func:ams.Proctype..Eq +inline bool Proctype_Eq(ams::Proctype lhs, ams::Proctype rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:ams.Proctype.String printfmt:Raw +// func:ams.Proctype..Print +void Proctype_Print(ams::Proctype row, algo::cstring& str) __attribute__((nothrow)); + +// --- ams.ProcId +#pragma pack(push,1) +struct ProcId { // ams.ProcId: Process ID within topology: type, node index, process index, e.g. proc-0-0 + u32 value; // 0 Process type + // func:ams.ProcId..EqOp + inline bool operator ==(const ams::ProcId &rhs) const __attribute__((nothrow)); + // func:ams.ProcId..NeOp + inline bool operator !=(const ams::ProcId &rhs) const __attribute__((nothrow)); + // func:ams.ProcId..Ctor + inline ProcId() __attribute__((nothrow)); + // func:ams.ProcId..FieldwiseCtor + explicit inline ProcId(u32 in_value) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Retrieve bitfield from value of field value +// 8 bits starting at bit 24. +// func:ams.ProcId.proctype.Get +inline ams::Proctype proctype_Get(const ams::ProcId& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 8 bits starting at bit 24. +// func:ams.ProcId.proctype.Set +inline void proctype_Set(ams::ProcId& parent, ams::Proctype rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 8 bits starting at bit 8. +// func:ams.ProcId.nodeidx.Get +inline u8 nodeidx_Get(const ams::ProcId& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 8 bits starting at bit 8. +// func:ams.ProcId.nodeidx.Set +inline void nodeidx_Set(ams::ProcId& parent, u8 rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 4 bits starting at bit 0. +// func:ams.ProcId.procidx.Get +inline u8 procidx_Get(const ams::ProcId& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 4 bits starting at bit 0. +// func:ams.ProcId.procidx.Set +inline void procidx_Set(ams::ProcId& parent, u8 rhs) __attribute__((nothrow)); + +// func:ams.ProcId..Hash +inline u32 ProcId_Hash(u32 prev, ams::ProcId rhs) __attribute__((nothrow)); +// func:ams.ProcId..ReadFieldMaybe +bool ProcId_ReadFieldMaybe(ams::ProcId& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ams::ProcId from an ascii string. +// The format of the string is a string with separated values +// func:ams.ProcId..ReadStrptrMaybe +bool ProcId_ReadStrptrMaybe(ams::ProcId &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ProcId..Cmp +inline i32 ProcId_Cmp(ams::ProcId lhs, ams::ProcId rhs) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.HeartbeatMsg..Init -inline void HeartbeatMsg_Init(ams::HeartbeatMsg& parent); +// func:ams.ProcId..Init +inline void ProcId_Init(ams::ProcId& parent); +// func:ams.ProcId..Eq +inline bool ProcId_Eq(ams::ProcId lhs, ams::ProcId rhs) __attribute__((nothrow)); // print string representation of ROW to string STR -// cfmt:ams.HeartbeatMsg.String printfmt:Tuple -// func:ams.HeartbeatMsg..Print -void HeartbeatMsg_Print(ams::HeartbeatMsg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.ProcId.String printfmt:Sep +// func:ams.ProcId..Print +void ProcId_Print(ams::ProcId row, algo::cstring& str) __attribute__((nothrow)); // --- ams.InputLineMsg #pragma pack(push,1) struct InputLineMsg { // ams.InputLineMsg: Unrecognized input line - u32 type; // 22 - u32 length; // ssizeof(parent) + (0) + u32 type; // 22 + u32 length; // ssizeof(parent) + (0) + ams::ProcId proc_id; // Target process // var-length field ams.InputLineMsg.payload starts here. access it with payload_Addr // func:ams.InputLineMsg..Ctor inline InputLineMsg() __attribute__((nothrow)); + // func:ams.InputLineMsg..FieldwiseCtor + explicit inline InputLineMsg(ams::ProcId in_proc_id) __attribute__((nothrow)); }; #pragma pack(pop) @@ -830,15 +558,17 @@ void InputLineMsg_Print(ams::InputLineMsg& row, algo::cstring& s // --- ams.LogMsg #pragma pack(push,1) struct LogMsg { // ams.LogMsg: Log message - u32 type; // 6 - u32 length; // ssizeof(parent) + (0) - algo::RnullStr50 logcat; // - algo::SchedTime tstamp; // + u32 type; // 6 + u32 length; // ssizeof(parent) + (0) + ams::ProcId proc_id; // + algo::SchedTime tstamp; // Local timestamp + u32 logcat_end; // end of logcat field + // var-length field ams.LogMsg.logcat starts here. access it with logcat_Addr // var-length field ams.LogMsg.text starts here. access it with text_Addr // func:ams.LogMsg..Ctor inline LogMsg() __attribute__((nothrow)); // func:ams.LogMsg..FieldwiseCtor - explicit inline LogMsg(const algo::strptr& in_logcat, algo::SchedTime in_tstamp) __attribute__((nothrow)); + explicit inline LogMsg(ams::ProcId in_proc_id, algo::SchedTime in_tstamp) __attribute__((nothrow)); }; #pragma pack(pop) @@ -854,6 +584,22 @@ inline ams::LogMsg* LogMsg_Castdown(ams::MsgHeader &hdr); // func:ams.LogMsg.base.Castbase inline ams::MsgHeader& Castbase(ams::LogMsg& parent); +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ams.LogMsg.logcat.Getary +algo::aryptr logcat_Getary(ams::LogMsg& parent) __attribute__((nothrow)); +// func:ams.LogMsg.logcat.Addr +char* logcat_Addr(ams::LogMsg& parent); +// Return number of elements in varlen field +// func:ams.LogMsg.logcat.N +inline u32 logcat_N(const ams::LogMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:ams.LogMsg.logcat.ReadStrptrMaybe +bool logcat_ReadStrptrMaybe(ams::LogMsg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert logcat to a string. +// Array is printed as a regular string. +// func:ams.LogMsg.logcat.Print +void logcat_Print(ams::LogMsg& parent, algo::cstring &rhs) __attribute__((nothrow)); + // Access var-length portion as an aryptr. Length is determined from one of the fields. // func:ams.LogMsg.text.Getary algo::aryptr text_Getary(ams::LogMsg& parent) __attribute__((nothrow)); @@ -870,6 +616,17 @@ bool text_ReadStrptrMaybe(ams::LogMsg& parent, algo::strptr in_s // func:ams.LogMsg.text.Print void text_Print(ams::LogMsg& parent, algo::cstring &rhs) __attribute__((nothrow)); +// func:ams.LogMsg.logcat_curs.Reset +inline void LogMsg_logcat_curs_Reset(LogMsg_logcat_curs &curs, ams::LogMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:ams.LogMsg.logcat_curs.ValidQ +inline bool LogMsg_logcat_curs_ValidQ(LogMsg_logcat_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:ams.LogMsg.logcat_curs.Next +inline void LogMsg_logcat_curs_Next(LogMsg_logcat_curs &curs) __attribute__((nothrow)); +// item access +// func:ams.LogMsg.logcat_curs.Access +inline char& LogMsg_logcat_curs_Access(LogMsg_logcat_curs &curs) __attribute__((nothrow)); // func:ams.LogMsg.text_curs.Reset inline void LogMsg_text_curs_Reset(LogMsg_text_curs &curs, ams::LogMsg &parent) __attribute__((nothrow)); // cursor points to valid item @@ -902,70 +659,6 @@ inline void LogMsg_Init(ams::LogMsg& parent); // func:ams.LogMsg..Print void LogMsg_Print(ams::LogMsg& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.Member -#pragma pack(push,1) -struct Member { // ams.Member: Process/Stream/Mode - primary key for reader/writer of stream - ams::ProcId proc_id; // Proces ID - ams::StreamId stream_id; // Stream ID - u8 mode; // 0 0=read, 1=write (2 or more =read) - // func:ams.Member..EqOp - inline bool operator ==(const ams::Member &rhs) const __attribute__((nothrow)); - // func:ams.Member..NeOp - inline bool operator !=(const ams::Member &rhs) const __attribute__((nothrow)); - // func:ams.Member..Ctor - inline Member() __attribute__((nothrow)); - // func:ams.Member..FieldwiseCtor - explicit inline Member(ams::ProcId in_proc_id, ams::StreamId in_stream_id, u8 in_mode) __attribute__((nothrow)); -}; -#pragma pack(pop) - -// Get value of field as enum type -// func:ams.Member.mode.GetEnum -inline ams_Member_mode_Enum mode_GetEnum(const ams::Member& parent) __attribute__((nothrow)); -// Set value of field from enum type. -// func:ams.Member.mode.SetEnum -inline void mode_SetEnum(ams::Member& parent, ams_Member_mode_Enum rhs) __attribute__((nothrow)); -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -// func:ams.Member.mode.ToCstr -const char* mode_ToCstr(const ams::Member& parent) __attribute__((nothrow)); -// Convert mode to a string. First, attempt conversion to a known string. -// If no string matches, print mode as a numeric value. -// func:ams.Member.mode.Print -void mode_Print(const ams::Member& parent, algo::cstring &lhs) __attribute__((nothrow)); -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -// func:ams.Member.mode.SetStrptrMaybe -bool mode_SetStrptrMaybe(ams::Member& parent, algo::strptr rhs) __attribute__((nothrow)); -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -// func:ams.Member.mode.SetStrptr -void mode_SetStrptr(ams::Member& parent, algo::strptr rhs, ams_Member_mode_Enum dflt) __attribute__((nothrow)); -// Convert string to field. Return success value -// func:ams.Member.mode.ReadStrptrMaybe -bool mode_ReadStrptrMaybe(ams::Member& parent, algo::strptr rhs) __attribute__((nothrow)); - -// func:ams.Member..Hash -inline u32 Member_Hash(u32 prev, ams::Member rhs) __attribute__((nothrow)); -// func:ams.Member..ReadFieldMaybe -bool Member_ReadFieldMaybe(ams::Member& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::Member from an ascii string. -// The format of the string is a string with separated values -// func:ams.Member..ReadStrptrMaybe -bool Member_ReadStrptrMaybe(ams::Member &parent, algo::strptr in_str) __attribute__((nothrow)); -// func:ams.Member..Cmp -inline i32 Member_Cmp(ams::Member lhs, ams::Member rhs) __attribute__((nothrow)); -// Set all fields to initial values. -// func:ams.Member..Init -inline void Member_Init(ams::Member& parent); -// func:ams.Member..Eq -inline bool Member_Eq(ams::Member lhs, ams::Member rhs) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:ams.Member.String printfmt:Sep -// func:ams.Member..Print -void Member_Print(ams::Member row, algo::cstring& str) __attribute__((nothrow)); - // --- ams.MsgBlock #pragma pack(push,1) struct MsgBlock { // ams.MsgBlock: A block of messages from ams commit file @@ -1031,29 +724,21 @@ inline void MsgBlock_Init(ams::MsgBlock& parent); void MsgBlock_Print(ams::MsgBlock& row, algo::cstring& str) __attribute__((nothrow)); // --- ams.MsgHeader -// create: ams.PrlogMsg.data (Opt) -// create: ams.Seqmsg.payload (Opt) -// create: ams.SeqmsgTrace.payload (Opt) -// access: ams.AlarmSyncMsg.base (Base) -// access: ams.DfltStream.base (Base) -// access: ams.DumpStreamTableMsg.base (Base) +// create: ams.Shmmsg.payload (Opt) // access: ams.ExpectMsg.base (Base) -// access: ams.HeartbeatMsg.base (Base) // access: ams.InputLineMsg.base (Base) // access: ams.LogMsg.base (Base) // access: ams.MsgBlock.header (Base) -// access: ams.OpenMsg.base (Base) -// access: ams.PrlogMsg.base (Base) -// access: ams.ProcAddMsg.base (Base) -// access: ams.ProcRemoveMsg.base (Base) -// access: ams.Seqmsg.base (Base) -// access: ams.SeqmsgTrace.base (Base) -// access: ams.StreamHbMsg.base (Base) +// access: ams.ProcEofMsg.base (Base) +// access: ams.ProcKillMsg.base (Base) +// access: ams.ProcMsg.base (Base) +// access: ams.ProcReadMsg.base (Base) +// access: ams.ProcStartMsg.base (Base) +// access: ams.ProcStatusMsg.base (Base) +// access: ams.RemDirRecurseMsg.base (Base) +// access: ams.ShmHbMsg.base (Base) +// access: ams.Shmmsg.base (Base) // access: ams.TerminateMsg.base (Base) -// access: ams.Trace2Msg.base (Base) -// access: ams.TraceInfo2Msg.base (Base) -// access: ams.TraceInfoMsg.base (Base) -// access: ams.TraceMsg.base (Base) // access: ams.UdpFrame.header (Base) // access: ams.MsgHeader_curs.msg (Ptr) #pragma pack(push,1) @@ -1069,30 +754,30 @@ struct MsgHeader { // ams.MsgHeader // Get value of field as enum type // func:ams.MsgHeader.type.GetEnum -inline ams_MsgHeader_type_Enum type_GetEnum(const ams::MsgHeader& data) __attribute__((nothrow)); +inline ams_MsgHeader_type_Enum type_GetEnum(const ams::MsgHeader& payload) __attribute__((nothrow)); // Set value of field from enum type. // func:ams.MsgHeader.type.SetEnum -inline void type_SetEnum(ams::MsgHeader& data, ams_MsgHeader_type_Enum rhs) __attribute__((nothrow)); +inline void type_SetEnum(ams::MsgHeader& payload, ams_MsgHeader_type_Enum rhs) __attribute__((nothrow)); // Convert numeric value of field to one of predefined string constants. // If string is found, return a static C string. Otherwise, return NULL. // func:ams.MsgHeader.type.ToCstr -const char* type_ToCstr(const ams::MsgHeader& data) __attribute__((nothrow)); +const char* type_ToCstr(const ams::MsgHeader& payload) __attribute__((nothrow)); // Convert type to a string. First, attempt conversion to a known string. // If no string matches, print type as a numeric value. // func:ams.MsgHeader.type.Print -void type_Print(const ams::MsgHeader& data, algo::cstring &lhs) __attribute__((nothrow)); +void type_Print(const ams::MsgHeader& payload, algo::cstring &lhs) __attribute__((nothrow)); // Convert string to field. // If the string is invalid, do not modify field and return false. // In case of success, return true // func:ams.MsgHeader.type.SetStrptrMaybe -bool type_SetStrptrMaybe(ams::MsgHeader& data, algo::strptr rhs) __attribute__((nothrow)); +bool type_SetStrptrMaybe(ams::MsgHeader& payload, algo::strptr rhs) __attribute__((nothrow)); // Convert string to field. // If the string is invalid, set numeric value to DFLT // func:ams.MsgHeader.type.SetStrptr -void type_SetStrptr(ams::MsgHeader& data, algo::strptr rhs, ams_MsgHeader_type_Enum dflt) __attribute__((nothrow)); +void type_SetStrptr(ams::MsgHeader& payload, algo::strptr rhs, ams_MsgHeader_type_Enum dflt) __attribute__((nothrow)); // Convert string to field. Return success value // func:ams.MsgHeader.type.ReadStrptrMaybe -bool type_ReadStrptrMaybe(ams::MsgHeader& data, algo::strptr rhs) __attribute__((nothrow)); +bool type_ReadStrptrMaybe(ams::MsgHeader& payload, algo::strptr rhs) __attribute__((nothrow)); // func:ams.MsgHeader..ReadFieldMaybe bool MsgHeader_ReadFieldMaybe(ams::MsgHeader& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); @@ -1108,7 +793,7 @@ inline i32 GetMsgLength(const ams::MsgHeader& parent) __attribute__((n inline algo::memptr GetMsgMemptr(const ams::MsgHeader& row) __attribute__((nothrow)); // Set all fields to initial values. // func:ams.MsgHeader..Init -inline void MsgHeader_Init(ams::MsgHeader& data); +inline void MsgHeader_Init(ams::MsgHeader& payload); // print string representation of ROW to string STR // cfmt:ams.MsgHeader.String printfmt:Tuple // func:ams.MsgHeader..Print @@ -1189,892 +874,842 @@ inline void MsgHeader_curs_Next(ams::MsgHeader_curs& curs) __attribute_ // func:ams.MsgHeader_curs..Init inline void MsgHeader_curs_Init(ams::MsgHeader_curs& parent); -// --- ams.StreamPos +// --- ams.ProcEofMsg #pragma pack(push,1) -struct StreamPos { // ams.StreamPos: Sequence,Offset - u64 seq; // 1 - u64 off; // 0 - // func:ams.StreamPos..Ctor - inline StreamPos() __attribute__((nothrow)); - // func:ams.StreamPos..FieldwiseCtor - explicit inline StreamPos(u64 in_seq, u64 in_off) __attribute__((nothrow)); +struct ProcEofMsg { // ams.ProcEofMsg: EOF from/to a process + u32 type; // 703 + u32 length; // ssizeof(parent) + (0) + algo::RnullStr50 proc; // + // func:ams.ProcEofMsg..Ctor + inline ProcEofMsg() __attribute__((nothrow)); }; #pragma pack(pop) -// func:ams.StreamPos..ReadFieldMaybe -bool StreamPos_ReadFieldMaybe(ams::StreamPos& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::StreamPos from an ascii string. -// The format of the string is a string with separated values -// func:ams.StreamPos..ReadStrptrMaybe -bool StreamPos_ReadStrptrMaybe(ams::StreamPos &parent, algo::strptr in_str) __attribute__((nothrow)); +// Copy fields out of row +// func:ams.ProcEofMsg.base.CopyOut +void parent_CopyOut(ams::ProcEofMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of ProcEofMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of ProcEofMsg. +// If not successful, quietly return NULL. +// func:ams.ProcEofMsg.base.Castdown +inline ams::ProcEofMsg* ProcEofMsg_Castdown(ams::MsgHeader &hdr); +// func:ams.ProcEofMsg.base.Castbase +inline ams::MsgHeader& Castbase(ams::ProcEofMsg& parent); + +// func:ams.ProcEofMsg..ReadFieldMaybe +bool ProcEofMsg_ReadFieldMaybe(ams::ProcEofMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ams::ProcEofMsg from an ascii string. +// The format of the string is an ssim Tuple +// func:ams.ProcEofMsg..ReadStrptrMaybe +bool ProcEofMsg_ReadStrptrMaybe(ams::ProcEofMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:ams.ProcEofMsg..GetMsgLength +inline i32 GetMsgLength(const ams::ProcEofMsg& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:ams.ProcEofMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ams::ProcEofMsg& row) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.StreamPos..Init -inline void StreamPos_Init(ams::StreamPos& parent); +// func:ams.ProcEofMsg..Init +inline void ProcEofMsg_Init(ams::ProcEofMsg& parent); // print string representation of ROW to string STR -// cfmt:ams.StreamPos.String printfmt:Sep -// func:ams.StreamPos..Print -void StreamPos_Print(ams::StreamPos row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.ProcEofMsg.String printfmt:Tuple +// func:ams.ProcEofMsg..Print +void ProcEofMsg_Print(ams::ProcEofMsg& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.OpenMsg +// --- ams.ProcKillMsg #pragma pack(push,1) -struct OpenMsg { // ams.OpenMsg: Open stream for reading - u32 type; // 7 - u32 length; // ssizeof(parent) + (0) - ams::Member member; // Target process_id and stream_id - ams::StreamPos pos; // Start reading here - // func:ams.OpenMsg..Ctor - inline OpenMsg() __attribute__((nothrow)); - // func:ams.OpenMsg..FieldwiseCtor - explicit inline OpenMsg(ams::Member in_member, ams::StreamPos in_pos) __attribute__((nothrow)); +struct ProcKillMsg { // ams.ProcKillMsg: Kill process + u32 type; // 704 + u32 length; // ssizeof(parent) + (0) + algo::RnullStr50 proc; // + i32 signal; // 15 + // func:ams.ProcKillMsg..Ctor + inline ProcKillMsg() __attribute__((nothrow)); }; #pragma pack(pop) // Copy fields out of row -// func:ams.OpenMsg.base.CopyOut -void parent_CopyOut(ams::OpenMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of OpenMsg by checking the type field +// func:ams.ProcKillMsg.base.CopyOut +void parent_CopyOut(ams::ProcKillMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of ProcKillMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of OpenMsg. +// Additionally, check if the length field permits valid instance of ProcKillMsg. // If not successful, quietly return NULL. -// func:ams.OpenMsg.base.Castdown -inline ams::OpenMsg* OpenMsg_Castdown(ams::MsgHeader &hdr); -// func:ams.OpenMsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::OpenMsg& parent); - -// func:ams.OpenMsg..ReadFieldMaybe -bool OpenMsg_ReadFieldMaybe(ams::OpenMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::OpenMsg from an ascii string. +// func:ams.ProcKillMsg.base.Castdown +inline ams::ProcKillMsg* ProcKillMsg_Castdown(ams::MsgHeader &hdr); +// func:ams.ProcKillMsg.base.Castbase +inline ams::MsgHeader& Castbase(ams::ProcKillMsg& parent); + +// func:ams.ProcKillMsg..ReadFieldMaybe +bool ProcKillMsg_ReadFieldMaybe(ams::ProcKillMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ams::ProcKillMsg from an ascii string. // The format of the string is an ssim Tuple -// func:ams.OpenMsg..ReadStrptrMaybe -bool OpenMsg_ReadStrptrMaybe(ams::OpenMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ProcKillMsg..ReadStrptrMaybe +bool ProcKillMsg_ReadStrptrMaybe(ams::ProcKillMsg &parent, algo::strptr in_str) __attribute__((nothrow)); // Message length (uses length field) -// func:ams.OpenMsg..GetMsgLength -inline i32 GetMsgLength(const ams::OpenMsg& parent) __attribute__((nothrow)); +// func:ams.ProcKillMsg..GetMsgLength +inline i32 GetMsgLength(const ams::ProcKillMsg& parent) __attribute__((nothrow)); // Memptr encompassing the message (uses length field) -// func:ams.OpenMsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::OpenMsg& row) __attribute__((nothrow)); +// func:ams.ProcKillMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ams::ProcKillMsg& row) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.OpenMsg..Init -inline void OpenMsg_Init(ams::OpenMsg& parent); +// func:ams.ProcKillMsg..Init +inline void ProcKillMsg_Init(ams::ProcKillMsg& parent); // print string representation of ROW to string STR -// cfmt:ams.OpenMsg.String printfmt:Tuple -// func:ams.OpenMsg..Print -void OpenMsg_Print(ams::OpenMsg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.ProcKillMsg.String printfmt:Tuple +// func:ams.ProcKillMsg..Print +void ProcKillMsg_Print(ams::ProcKillMsg& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.PrlogMsg +// --- ams.ProcMsg #pragma pack(push,1) -struct PrlogMsg { // ams.PrlogMsg - u32 type; // 229 - u32 length; // ssizeof(parent) + (0) - algo::RnullStr50 logcat; // - algo::SchedTime tstamp; // - // ams::MsgHeader data[]; optional field - // func:ams.PrlogMsg..Ctor - inline PrlogMsg() __attribute__((nothrow)); +struct ProcMsg { // ams.ProcMsg: Message from/to a process + u32 type; // 701 + u32 length; // ssizeof(parent) + (0) + algo::RnullStr50 proc; // + // var-length field ams.ProcMsg.payload starts here. access it with payload_Addr + // func:ams.ProcMsg..Ctor + inline ProcMsg() __attribute__((nothrow)); }; #pragma pack(pop) // Copy fields out of row -// func:ams.PrlogMsg.base.CopyOut -void parent_CopyOut(ams::PrlogMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of PrlogMsg by checking the type field +// func:ams.ProcMsg.base.CopyOut +void parent_CopyOut(ams::ProcMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of ProcMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of PrlogMsg. +// Additionally, check if the length field permits valid instance of ProcMsg. // If not successful, quietly return NULL. -// func:ams.PrlogMsg.base.Castdown -inline ams::PrlogMsg* PrlogMsg_Castdown(ams::MsgHeader &hdr); -// func:ams.PrlogMsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::PrlogMsg& parent); +// func:ams.ProcMsg.base.Castdown +inline ams::ProcMsg* ProcMsg_Castdown(ams::MsgHeader &hdr); +// func:ams.ProcMsg.base.Castbase +inline ams::MsgHeader& Castbase(ams::ProcMsg& parent); -// Return pointer to optional last element (NULL if none) -// The parent's length field is assumed to have already been checked for validity. -// If the parent's lengthis too short to allow a full-sized data, return NULL. -// Since the last element is itself variable-length, two more checks are applied: -// If data's length field value is too short, return NULL. -// If data's length field value extends past parent's allowed length, return NULL. -// func:ams.PrlogMsg.data.Get -inline ams::MsgHeader* data_Get(ams::PrlogMsg& parent) __attribute__((__warn_unused_result__, nothrow)); -// Access optional portion as an array of bytes -// func:ams.PrlogMsg.data.Getary -algo::aryptr data_Getary(ams::PrlogMsg& parent) __attribute__((nothrow)); -// func:ams.PrlogMsg.data.Print -void data_Print(ams::PrlogMsg& parent, cstring &out) __attribute__((nothrow)); +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ams.ProcMsg.payload.Getary +algo::aryptr payload_Getary(ams::ProcMsg& parent) __attribute__((nothrow)); +// func:ams.ProcMsg.payload.Addr +char* payload_Addr(ams::ProcMsg& parent); +// Return number of elements in varlen field +// func:ams.ProcMsg.payload.N +inline u32 payload_N(const ams::ProcMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); // Convert string to field. Return success value -// func:ams.PrlogMsg.data.ReadStrptrMaybe -bool data_ReadStrptrMaybe(ams::PrlogMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ProcMsg.payload.ReadStrptrMaybe +bool payload_ReadStrptrMaybe(ams::ProcMsg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert payload to a string. +// Array is printed as a regular string. +// func:ams.ProcMsg.payload.Print +void payload_Print(ams::ProcMsg& parent, algo::cstring &rhs) __attribute__((nothrow)); -// func:ams.PrlogMsg..ReadFieldMaybe -bool PrlogMsg_ReadFieldMaybe(ams::PrlogMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// func:ams.ProcMsg.payload_curs.Reset +inline void ProcMsg_payload_curs_Reset(ProcMsg_payload_curs &curs, ams::ProcMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:ams.ProcMsg.payload_curs.ValidQ +inline bool ProcMsg_payload_curs_ValidQ(ProcMsg_payload_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:ams.ProcMsg.payload_curs.Next +inline void ProcMsg_payload_curs_Next(ProcMsg_payload_curs &curs) __attribute__((nothrow)); +// item access +// func:ams.ProcMsg.payload_curs.Access +inline char& ProcMsg_payload_curs_Access(ProcMsg_payload_curs &curs) __attribute__((nothrow)); +// func:ams.ProcMsg..ReadFieldMaybe +bool ProcMsg_ReadFieldMaybe(ams::ProcMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); // Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::PrlogMsg from an ascii string. +// Read fields of ams::ProcMsg from an ascii string. // The format of the string is an ssim Tuple -// func:ams.PrlogMsg..ReadStrptrMaybe -bool PrlogMsg_ReadStrptrMaybe(ams::PrlogMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ProcMsg..ReadStrptrMaybe +bool ProcMsg_ReadStrptrMaybe(ams::ProcMsg &parent, algo::strptr in_str) __attribute__((nothrow)); // Message length (uses length field) -// func:ams.PrlogMsg..GetMsgLength -inline i32 GetMsgLength(const ams::PrlogMsg& parent) __attribute__((nothrow)); +// func:ams.ProcMsg..GetMsgLength +inline i32 GetMsgLength(const ams::ProcMsg& parent) __attribute__((nothrow)); // Memptr encompassing the message (uses length field) -// func:ams.PrlogMsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::PrlogMsg& row) __attribute__((nothrow)); +// func:ams.ProcMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ams::ProcMsg& row) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.PrlogMsg..Init -inline void PrlogMsg_Init(ams::PrlogMsg& parent); +// func:ams.ProcMsg..Init +inline void ProcMsg_Init(ams::ProcMsg& parent); // print string representation of ROW to string STR -// cfmt:ams.PrlogMsg.String printfmt:Tuple -// func:ams.PrlogMsg..Print -void PrlogMsg_Print(ams::PrlogMsg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.ProcMsg.String printfmt:Tuple +// func:ams.ProcMsg..Print +void ProcMsg_Print(ams::ProcMsg& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.ProcAddMsg +// --- ams.ProcReadMsg #pragma pack(push,1) -struct ProcAddMsg { // ams.ProcAddMsg: Add process to process group - u32 type; // 4 - u32 length; // ssizeof(parent) + (0) - ams::ProcId proc_id; // ID of process being added - // func:ams.ProcAddMsg..Ctor - inline ProcAddMsg() __attribute__((nothrow)); - // func:ams.ProcAddMsg..FieldwiseCtor - explicit inline ProcAddMsg(ams::ProcId in_proc_id) __attribute__((nothrow)); +struct ProcReadMsg { // ams.ProcReadMsg: Read process output + u32 type; // 702 + u32 length; // ssizeof(parent) + (0) + algo::RnullStr50 proc; // + // var-length field ams.ProcReadMsg.until starts here. access it with until_Addr + // func:ams.ProcReadMsg..Ctor + inline ProcReadMsg() __attribute__((nothrow)); }; #pragma pack(pop) // Copy fields out of row -// func:ams.ProcAddMsg.base.CopyOut -void parent_CopyOut(ams::ProcAddMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of ProcAddMsg by checking the type field +// func:ams.ProcReadMsg.base.CopyOut +void parent_CopyOut(ams::ProcReadMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of ProcReadMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of ProcAddMsg. +// Additionally, check if the length field permits valid instance of ProcReadMsg. // If not successful, quietly return NULL. -// func:ams.ProcAddMsg.base.Castdown -inline ams::ProcAddMsg* ProcAddMsg_Castdown(ams::MsgHeader &hdr); -// func:ams.ProcAddMsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::ProcAddMsg& parent); - -// func:ams.ProcAddMsg..ReadFieldMaybe -bool ProcAddMsg_ReadFieldMaybe(ams::ProcAddMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::ProcAddMsg from an ascii string. +// func:ams.ProcReadMsg.base.Castdown +inline ams::ProcReadMsg* ProcReadMsg_Castdown(ams::MsgHeader &hdr); +// func:ams.ProcReadMsg.base.Castbase +inline ams::MsgHeader& Castbase(ams::ProcReadMsg& parent); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ams.ProcReadMsg.until.Getary +algo::aryptr until_Getary(ams::ProcReadMsg& parent) __attribute__((nothrow)); +// func:ams.ProcReadMsg.until.Addr +char* until_Addr(ams::ProcReadMsg& parent); +// Return number of elements in varlen field +// func:ams.ProcReadMsg.until.N +inline u32 until_N(const ams::ProcReadMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:ams.ProcReadMsg.until.ReadStrptrMaybe +bool until_ReadStrptrMaybe(ams::ProcReadMsg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert until to a string. +// Array is printed as a regular string. +// func:ams.ProcReadMsg.until.Print +void until_Print(ams::ProcReadMsg& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:ams.ProcReadMsg.until_curs.Reset +inline void ProcReadMsg_until_curs_Reset(ProcReadMsg_until_curs &curs, ams::ProcReadMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:ams.ProcReadMsg.until_curs.ValidQ +inline bool ProcReadMsg_until_curs_ValidQ(ProcReadMsg_until_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:ams.ProcReadMsg.until_curs.Next +inline void ProcReadMsg_until_curs_Next(ProcReadMsg_until_curs &curs) __attribute__((nothrow)); +// item access +// func:ams.ProcReadMsg.until_curs.Access +inline char& ProcReadMsg_until_curs_Access(ProcReadMsg_until_curs &curs) __attribute__((nothrow)); +// func:ams.ProcReadMsg..ReadFieldMaybe +bool ProcReadMsg_ReadFieldMaybe(ams::ProcReadMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ams::ProcReadMsg from an ascii string. // The format of the string is an ssim Tuple -// func:ams.ProcAddMsg..ReadStrptrMaybe -bool ProcAddMsg_ReadStrptrMaybe(ams::ProcAddMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ProcReadMsg..ReadStrptrMaybe +bool ProcReadMsg_ReadStrptrMaybe(ams::ProcReadMsg &parent, algo::strptr in_str) __attribute__((nothrow)); // Message length (uses length field) -// func:ams.ProcAddMsg..GetMsgLength -inline i32 GetMsgLength(const ams::ProcAddMsg& parent) __attribute__((nothrow)); +// func:ams.ProcReadMsg..GetMsgLength +inline i32 GetMsgLength(const ams::ProcReadMsg& parent) __attribute__((nothrow)); // Memptr encompassing the message (uses length field) -// func:ams.ProcAddMsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::ProcAddMsg& row) __attribute__((nothrow)); +// func:ams.ProcReadMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ams::ProcReadMsg& row) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.ProcAddMsg..Init -inline void ProcAddMsg_Init(ams::ProcAddMsg& parent); +// func:ams.ProcReadMsg..Init +inline void ProcReadMsg_Init(ams::ProcReadMsg& parent); // print string representation of ROW to string STR -// cfmt:ams.ProcAddMsg.String printfmt:Tuple -// func:ams.ProcAddMsg..Print -void ProcAddMsg_Print(ams::ProcAddMsg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.ProcReadMsg.String printfmt:Tuple +// func:ams.ProcReadMsg..Print +void ProcReadMsg_Print(ams::ProcReadMsg& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.ProcRemoveMsg +// --- ams.ProcStartMsg #pragma pack(push,1) -struct ProcRemoveMsg { // ams.ProcRemoveMsg: Remove process from process group - u32 type; // 5 - u32 length; // ssizeof(parent) + (0) - ams::ProcId proc_id; // ID of process being removed - // func:ams.ProcRemoveMsg..Ctor - inline ProcRemoveMsg() __attribute__((nothrow)); - // func:ams.ProcRemoveMsg..FieldwiseCtor - explicit inline ProcRemoveMsg(ams::ProcId in_proc_id) __attribute__((nothrow)); +struct ProcStartMsg { // ams.ProcStartMsg: Start process + u32 type; // 700 + u32 length; // ssizeof(parent) + (0) + algo::RnullStr50 proc; // + bool pty; // false + // var-length field ams.ProcStartMsg.cmd starts here. access it with cmd_Addr + // func:ams.ProcStartMsg..Ctor + inline ProcStartMsg() __attribute__((nothrow)); }; #pragma pack(pop) // Copy fields out of row -// func:ams.ProcRemoveMsg.base.CopyOut -void parent_CopyOut(ams::ProcRemoveMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of ProcRemoveMsg by checking the type field +// func:ams.ProcStartMsg.base.CopyOut +void parent_CopyOut(ams::ProcStartMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of ProcStartMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of ProcRemoveMsg. +// Additionally, check if the length field permits valid instance of ProcStartMsg. // If not successful, quietly return NULL. -// func:ams.ProcRemoveMsg.base.Castdown -inline ams::ProcRemoveMsg* ProcRemoveMsg_Castdown(ams::MsgHeader &hdr); -// func:ams.ProcRemoveMsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::ProcRemoveMsg& parent); - -// func:ams.ProcRemoveMsg..ReadFieldMaybe -bool ProcRemoveMsg_ReadFieldMaybe(ams::ProcRemoveMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::ProcRemoveMsg from an ascii string. +// func:ams.ProcStartMsg.base.Castdown +inline ams::ProcStartMsg* ProcStartMsg_Castdown(ams::MsgHeader &hdr); +// func:ams.ProcStartMsg.base.Castbase +inline ams::MsgHeader& Castbase(ams::ProcStartMsg& parent); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ams.ProcStartMsg.cmd.Getary +algo::aryptr cmd_Getary(ams::ProcStartMsg& parent) __attribute__((nothrow)); +// func:ams.ProcStartMsg.cmd.Addr +char* cmd_Addr(ams::ProcStartMsg& parent); +// Return number of elements in varlen field +// func:ams.ProcStartMsg.cmd.N +inline u32 cmd_N(const ams::ProcStartMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:ams.ProcStartMsg.cmd.ReadStrptrMaybe +bool cmd_ReadStrptrMaybe(ams::ProcStartMsg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert cmd to a string. +// Array is printed as a regular string. +// func:ams.ProcStartMsg.cmd.Print +void cmd_Print(ams::ProcStartMsg& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:ams.ProcStartMsg.cmd_curs.Reset +inline void ProcStartMsg_cmd_curs_Reset(ProcStartMsg_cmd_curs &curs, ams::ProcStartMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:ams.ProcStartMsg.cmd_curs.ValidQ +inline bool ProcStartMsg_cmd_curs_ValidQ(ProcStartMsg_cmd_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:ams.ProcStartMsg.cmd_curs.Next +inline void ProcStartMsg_cmd_curs_Next(ProcStartMsg_cmd_curs &curs) __attribute__((nothrow)); +// item access +// func:ams.ProcStartMsg.cmd_curs.Access +inline char& ProcStartMsg_cmd_curs_Access(ProcStartMsg_cmd_curs &curs) __attribute__((nothrow)); +// func:ams.ProcStartMsg..ReadFieldMaybe +bool ProcStartMsg_ReadFieldMaybe(ams::ProcStartMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ams::ProcStartMsg from an ascii string. // The format of the string is an ssim Tuple -// func:ams.ProcRemoveMsg..ReadStrptrMaybe -bool ProcRemoveMsg_ReadStrptrMaybe(ams::ProcRemoveMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ProcStartMsg..ReadStrptrMaybe +bool ProcStartMsg_ReadStrptrMaybe(ams::ProcStartMsg &parent, algo::strptr in_str) __attribute__((nothrow)); // Message length (uses length field) -// func:ams.ProcRemoveMsg..GetMsgLength -inline i32 GetMsgLength(const ams::ProcRemoveMsg& parent) __attribute__((nothrow)); +// func:ams.ProcStartMsg..GetMsgLength +inline i32 GetMsgLength(const ams::ProcStartMsg& parent) __attribute__((nothrow)); // Memptr encompassing the message (uses length field) -// func:ams.ProcRemoveMsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::ProcRemoveMsg& row) __attribute__((nothrow)); +// func:ams.ProcStartMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ams::ProcStartMsg& row) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.ProcRemoveMsg..Init -inline void ProcRemoveMsg_Init(ams::ProcRemoveMsg& parent); +// func:ams.ProcStartMsg..Init +inline void ProcStartMsg_Init(ams::ProcStartMsg& parent); // print string representation of ROW to string STR -// cfmt:ams.ProcRemoveMsg.String printfmt:Tuple -// func:ams.ProcRemoveMsg..Print -void ProcRemoveMsg_Print(ams::ProcRemoveMsg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.ProcStartMsg.String printfmt:Tuple +// func:ams.ProcStartMsg..Print +void ProcStartMsg_Print(ams::ProcStartMsg& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.SeqmsgId +// --- ams.ProcStatusMsg #pragma pack(push,1) -struct SeqmsgId { // ams.SeqmsgId: StreamID + Sequence number, e.g. proc1-0.out-0@1 - ams::StreamId stream_id; // - u64 seq; // 1 - u32 off; // 0 - // func:ams.SeqmsgId..Ctor - inline SeqmsgId() __attribute__((nothrow)); - // func:ams.SeqmsgId..FieldwiseCtor - explicit inline SeqmsgId(ams::StreamId in_stream_id, u64 in_seq, u32 in_off) __attribute__((nothrow)); -}; -#pragma pack(pop) - -// func:ams.SeqmsgId..ReadFieldMaybe -bool SeqmsgId_ReadFieldMaybe(ams::SeqmsgId& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::SeqmsgId from an ascii string. -// The format of the string is a string with separated values -// func:ams.SeqmsgId..ReadStrptrMaybe -bool SeqmsgId_ReadStrptrMaybe(ams::SeqmsgId &parent, algo::strptr in_str) __attribute__((nothrow)); -// Set all fields to initial values. -// func:ams.SeqmsgId..Init -inline void SeqmsgId_Init(ams::SeqmsgId& parent); -// print string representation of ROW to string STR -// cfmt:ams.SeqmsgId.String printfmt:Sep -// func:ams.SeqmsgId..Print -void SeqmsgId_Print(ams::SeqmsgId row, algo::cstring& str) __attribute__((nothrow)); - -// --- ams.Seqmsg -#pragma pack(push,1) -struct Seqmsg { // ams.Seqmsg: Sequenced stream message - u32 type; // 10 - u32 length; // ssizeof(parent) + (0) - ams::SeqmsgId seqmsg_id; // Message ID - u64 tsc; // 0 TSC of sender - // ams::MsgHeader payload[]; optional field - // func:ams.Seqmsg..Ctor - inline Seqmsg() __attribute__((nothrow)); - // func:ams.Seqmsg..FieldwiseCtor - explicit inline Seqmsg(ams::SeqmsgId in_seqmsg_id, u64 in_tsc) __attribute__((nothrow)); +struct ProcStatusMsg { // ams.ProcStatusMsg: Process status + u32 type; // 705 + u32 length; // ssizeof(parent) + (0) + algo::RnullStr50 proc; // + algo::RnullStr50 status; // + // func:ams.ProcStatusMsg..Ctor + inline ProcStatusMsg() __attribute__((nothrow)); }; #pragma pack(pop) // Copy fields out of row -// func:ams.Seqmsg.base.CopyOut -void parent_CopyOut(ams::Seqmsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of Seqmsg by checking the type field +// func:ams.ProcStatusMsg.base.CopyOut +void parent_CopyOut(ams::ProcStatusMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of ProcStatusMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of Seqmsg. +// Additionally, check if the length field permits valid instance of ProcStatusMsg. // If not successful, quietly return NULL. -// func:ams.Seqmsg.base.Castdown -inline ams::Seqmsg* Seqmsg_Castdown(ams::MsgHeader &hdr); -// func:ams.Seqmsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::Seqmsg& parent); - -// Return pointer to optional last element (NULL if none) -// The parent's length field is assumed to have already been checked for validity. -// If the parent's lengthis too short to allow a full-sized payload, return NULL. -// Since the last element is itself variable-length, two more checks are applied: -// If payload's length field value is too short, return NULL. -// If payload's length field value extends past parent's allowed length, return NULL. -// func:ams.Seqmsg.payload.Get -inline ams::MsgHeader* payload_Get(ams::Seqmsg& parent) __attribute__((__warn_unused_result__, nothrow)); -// Access optional portion as an array of bytes -// func:ams.Seqmsg.payload.Getary -algo::aryptr payload_Getary(ams::Seqmsg& parent) __attribute__((nothrow)); -// func:ams.Seqmsg.payload.Print -void payload_Print(ams::Seqmsg& parent, cstring &out) __attribute__((nothrow)); -// Convert string to field. Return success value -// func:ams.Seqmsg.payload.ReadStrptrMaybe -bool payload_ReadStrptrMaybe(ams::Seqmsg &parent, algo::strptr in_str) __attribute__((nothrow)); - -// func:ams.Seqmsg..ReadFieldMaybe -bool Seqmsg_ReadFieldMaybe(ams::Seqmsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::Seqmsg from an ascii string. +// func:ams.ProcStatusMsg.base.Castdown +inline ams::ProcStatusMsg* ProcStatusMsg_Castdown(ams::MsgHeader &hdr); +// func:ams.ProcStatusMsg.base.Castbase +inline ams::MsgHeader& Castbase(ams::ProcStatusMsg& parent); + +// func:ams.ProcStatusMsg..ReadFieldMaybe +bool ProcStatusMsg_ReadFieldMaybe(ams::ProcStatusMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ams::ProcStatusMsg from an ascii string. // The format of the string is an ssim Tuple -// func:ams.Seqmsg..ReadStrptrMaybe -bool Seqmsg_ReadStrptrMaybe(ams::Seqmsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ProcStatusMsg..ReadStrptrMaybe +bool ProcStatusMsg_ReadStrptrMaybe(ams::ProcStatusMsg &parent, algo::strptr in_str) __attribute__((nothrow)); // Message length (uses length field) -// func:ams.Seqmsg..GetMsgLength -inline i32 GetMsgLength(const ams::Seqmsg& parent) __attribute__((nothrow)); +// func:ams.ProcStatusMsg..GetMsgLength +inline i32 GetMsgLength(const ams::ProcStatusMsg& parent) __attribute__((nothrow)); // Memptr encompassing the message (uses length field) -// func:ams.Seqmsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::Seqmsg& row) __attribute__((nothrow)); +// func:ams.ProcStatusMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ams::ProcStatusMsg& row) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.Seqmsg..Init -inline void Seqmsg_Init(ams::Seqmsg& parent); +// func:ams.ProcStatusMsg..Init +inline void ProcStatusMsg_Init(ams::ProcStatusMsg& parent); // print string representation of ROW to string STR -// cfmt:ams.Seqmsg.String printfmt:Tuple -// func:ams.Seqmsg..Print -void Seqmsg_Print(ams::Seqmsg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.ProcStatusMsg.String printfmt:Tuple +// func:ams.ProcStatusMsg..Print +void ProcStatusMsg_Print(ams::ProcStatusMsg& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.SeqmsgTrace +// --- ams.RemDirRecurseMsg #pragma pack(push,1) -struct SeqmsgTrace { // ams.SeqmsgTrace: Message used to trace reading/writing seqmsgs - u32 type; // 11 - u32 length; // ssizeof(parent) + (0) - ams::ProcId proc_id; // Proces ID - u8 mode; // 0 0=read, 1=write (2 or more =read) - ams::SeqmsgId seqmsg_id; // Message ID - u64 tsc; // 0 TSC of sender - // ams::MsgHeader payload[]; optional field - // func:ams.SeqmsgTrace..Ctor - inline SeqmsgTrace() __attribute__((nothrow)); - // func:ams.SeqmsgTrace..FieldwiseCtor - explicit inline SeqmsgTrace(ams::ProcId in_proc_id, u8 in_mode, ams::SeqmsgId in_seqmsg_id, u64 in_tsc) __attribute__((nothrow)); +struct RemDirRecurseMsg { // ams.RemDirRecurseMsg: Message sent to process to terminate it + u32 type; // 633 + u32 length; // ssizeof(parent) + (0) + bool remove_topmost; // false + // var-length field ams.RemDirRecurseMsg.pathname starts here. access it with pathname_Addr + // func:ams.RemDirRecurseMsg..Ctor + inline RemDirRecurseMsg() __attribute__((nothrow)); }; #pragma pack(pop) // Copy fields out of row -// func:ams.SeqmsgTrace.base.CopyOut -void parent_CopyOut(ams::SeqmsgTrace &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of SeqmsgTrace by checking the type field +// func:ams.RemDirRecurseMsg.base.CopyOut +void parent_CopyOut(ams::RemDirRecurseMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of RemDirRecurseMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of SeqmsgTrace. +// Additionally, check if the length field permits valid instance of RemDirRecurseMsg. // If not successful, quietly return NULL. -// func:ams.SeqmsgTrace.base.Castdown -inline ams::SeqmsgTrace* SeqmsgTrace_Castdown(ams::MsgHeader &hdr); -// func:ams.SeqmsgTrace.base.Castbase -inline ams::MsgHeader& Castbase(ams::SeqmsgTrace& parent); - -// Get value of field as enum type -// func:ams.SeqmsgTrace.mode.GetEnum -inline ams_SeqmsgTrace_mode_Enum mode_GetEnum(const ams::SeqmsgTrace& parent) __attribute__((nothrow)); -// Set value of field from enum type. -// func:ams.SeqmsgTrace.mode.SetEnum -inline void mode_SetEnum(ams::SeqmsgTrace& parent, ams_SeqmsgTrace_mode_Enum rhs) __attribute__((nothrow)); -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -// func:ams.SeqmsgTrace.mode.ToCstr -const char* mode_ToCstr(const ams::SeqmsgTrace& parent) __attribute__((nothrow)); -// Convert mode to a string. First, attempt conversion to a known string. -// If no string matches, print mode as a numeric value. -// func:ams.SeqmsgTrace.mode.Print -void mode_Print(const ams::SeqmsgTrace& parent, algo::cstring &lhs) __attribute__((nothrow)); -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -// func:ams.SeqmsgTrace.mode.SetStrptrMaybe -bool mode_SetStrptrMaybe(ams::SeqmsgTrace& parent, algo::strptr rhs) __attribute__((nothrow)); -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -// func:ams.SeqmsgTrace.mode.SetStrptr -void mode_SetStrptr(ams::SeqmsgTrace& parent, algo::strptr rhs, ams_SeqmsgTrace_mode_Enum dflt) __attribute__((nothrow)); -// Convert string to field. Return success value -// func:ams.SeqmsgTrace.mode.ReadStrptrMaybe -bool mode_ReadStrptrMaybe(ams::SeqmsgTrace& parent, algo::strptr rhs) __attribute__((nothrow)); +// func:ams.RemDirRecurseMsg.base.Castdown +inline ams::RemDirRecurseMsg* RemDirRecurseMsg_Castdown(ams::MsgHeader &hdr); +// func:ams.RemDirRecurseMsg.base.Castbase +inline ams::MsgHeader& Castbase(ams::RemDirRecurseMsg& parent); -// Return pointer to optional last element (NULL if none) -// The parent's length field is assumed to have already been checked for validity. -// If the parent's lengthis too short to allow a full-sized payload, return NULL. -// Since the last element is itself variable-length, two more checks are applied: -// If payload's length field value is too short, return NULL. -// If payload's length field value extends past parent's allowed length, return NULL. -// func:ams.SeqmsgTrace.payload.Get -inline ams::MsgHeader* payload_Get(ams::SeqmsgTrace& parent) __attribute__((__warn_unused_result__, nothrow)); -// Access optional portion as an array of bytes -// func:ams.SeqmsgTrace.payload.Getary -algo::aryptr payload_Getary(ams::SeqmsgTrace& parent) __attribute__((nothrow)); -// func:ams.SeqmsgTrace.payload.Print -void payload_Print(ams::SeqmsgTrace& parent, cstring &out) __attribute__((nothrow)); +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ams.RemDirRecurseMsg.pathname.Getary +algo::aryptr pathname_Getary(ams::RemDirRecurseMsg& parent) __attribute__((nothrow)); +// func:ams.RemDirRecurseMsg.pathname.Addr +char* pathname_Addr(ams::RemDirRecurseMsg& parent); +// Return number of elements in varlen field +// func:ams.RemDirRecurseMsg.pathname.N +inline u32 pathname_N(const ams::RemDirRecurseMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); // Convert string to field. Return success value -// func:ams.SeqmsgTrace.payload.ReadStrptrMaybe -bool payload_ReadStrptrMaybe(ams::SeqmsgTrace &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.RemDirRecurseMsg.pathname.ReadStrptrMaybe +bool pathname_ReadStrptrMaybe(ams::RemDirRecurseMsg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert pathname to a string. +// Array is printed as a regular string. +// func:ams.RemDirRecurseMsg.pathname.Print +void pathname_Print(ams::RemDirRecurseMsg& parent, algo::cstring &rhs) __attribute__((nothrow)); -// func:ams.SeqmsgTrace..ReadFieldMaybe -bool SeqmsgTrace_ReadFieldMaybe(ams::SeqmsgTrace& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// func:ams.RemDirRecurseMsg.pathname_curs.Reset +inline void RemDirRecurseMsg_pathname_curs_Reset(RemDirRecurseMsg_pathname_curs &curs, ams::RemDirRecurseMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:ams.RemDirRecurseMsg.pathname_curs.ValidQ +inline bool RemDirRecurseMsg_pathname_curs_ValidQ(RemDirRecurseMsg_pathname_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:ams.RemDirRecurseMsg.pathname_curs.Next +inline void RemDirRecurseMsg_pathname_curs_Next(RemDirRecurseMsg_pathname_curs &curs) __attribute__((nothrow)); +// item access +// func:ams.RemDirRecurseMsg.pathname_curs.Access +inline char& RemDirRecurseMsg_pathname_curs_Access(RemDirRecurseMsg_pathname_curs &curs) __attribute__((nothrow)); +// func:ams.RemDirRecurseMsg..ReadFieldMaybe +bool RemDirRecurseMsg_ReadFieldMaybe(ams::RemDirRecurseMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); // Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::SeqmsgTrace from an ascii string. +// Read fields of ams::RemDirRecurseMsg from an ascii string. // The format of the string is an ssim Tuple -// func:ams.SeqmsgTrace..ReadStrptrMaybe -bool SeqmsgTrace_ReadStrptrMaybe(ams::SeqmsgTrace &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.RemDirRecurseMsg..ReadStrptrMaybe +bool RemDirRecurseMsg_ReadStrptrMaybe(ams::RemDirRecurseMsg &parent, algo::strptr in_str) __attribute__((nothrow)); // Message length (uses length field) -// func:ams.SeqmsgTrace..GetMsgLength -inline i32 GetMsgLength(const ams::SeqmsgTrace& parent) __attribute__((nothrow)); +// func:ams.RemDirRecurseMsg..GetMsgLength +inline i32 GetMsgLength(const ams::RemDirRecurseMsg& parent) __attribute__((nothrow)); // Memptr encompassing the message (uses length field) -// func:ams.SeqmsgTrace..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::SeqmsgTrace& row) __attribute__((nothrow)); +// func:ams.RemDirRecurseMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ams::RemDirRecurseMsg& row) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.SeqmsgTrace..Init -inline void SeqmsgTrace_Init(ams::SeqmsgTrace& parent); +// func:ams.RemDirRecurseMsg..Init +inline void RemDirRecurseMsg_Init(ams::RemDirRecurseMsg& parent); // print string representation of ROW to string STR -// cfmt:ams.SeqmsgTrace.String printfmt:Tuple -// func:ams.SeqmsgTrace..Print -void SeqmsgTrace_Print(ams::SeqmsgTrace& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.RemDirRecurseMsg.String printfmt:Tuple +// func:ams.RemDirRecurseMsg..Print +void RemDirRecurseMsg_Print(ams::RemDirRecurseMsg& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.StreamFlags +// --- ams.ShmFlags #pragma pack(push,1) -struct StreamFlags { // ams.StreamFlags +struct ShmFlags { // ams.ShmFlags u8 value; // 0 - // func:ams.StreamFlags..Ctor - inline StreamFlags() __attribute__((nothrow)); - // func:ams.StreamFlags..FieldwiseCtor - explicit inline StreamFlags(u8 in_value) __attribute__((nothrow)); - // func:ams.StreamFlags..EnumCtor - inline StreamFlags(ams_StreamFlagsEnum arg) __attribute__((nothrow)); + // func:ams.ShmFlags..Ctor + inline ShmFlags() __attribute__((nothrow)); + // func:ams.ShmFlags..FieldwiseCtor + explicit inline ShmFlags(u8 in_value) __attribute__((nothrow)); + // func:ams.ShmFlags..EnumCtor + inline ShmFlags(ams_ShmFlagsEnum arg) __attribute__((nothrow)); }; #pragma pack(pop) // Retrieve bitfield from value of field value // 1 bits starting at bit 1. -// func:ams.StreamFlags.write.Get -inline bool write_Get(const ams::StreamFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:ams.ShmFlags.write.Get +inline bool write_Get(const ams::ShmFlags& parent) __attribute__((__warn_unused_result__, nothrow)); // Set bitfield in value of field 'value' // 1 bits starting at bit 1. -// func:ams.StreamFlags.write.Set -inline void write_Set(ams::StreamFlags& parent, bool rhs) __attribute__((nothrow)); +// func:ams.ShmFlags.write.Set +inline void write_Set(ams::ShmFlags& parent, bool rhs) __attribute__((nothrow)); // Retrieve bitfield from value of field value // 1 bits starting at bit 2. -// func:ams.StreamFlags.read.Get -inline bool read_Get(const ams::StreamFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:ams.ShmFlags.read.Get +inline bool read_Get(const ams::ShmFlags& parent) __attribute__((__warn_unused_result__, nothrow)); // Set bitfield in value of field 'value' // 1 bits starting at bit 2. -// func:ams.StreamFlags.read.Set -inline void read_Set(ams::StreamFlags& parent, bool rhs) __attribute__((nothrow)); +// func:ams.ShmFlags.read.Set +inline void read_Set(ams::ShmFlags& parent, bool rhs) __attribute__((nothrow)); // Retrieve bitfield from value of field value // 1 bits starting at bit 3. -// func:ams.StreamFlags.nonblock.Get -inline bool nonblock_Get(const ams::StreamFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:ams.ShmFlags.nonblock.Get +inline bool nonblock_Get(const ams::ShmFlags& parent) __attribute__((__warn_unused_result__, nothrow)); // Set bitfield in value of field 'value' // 1 bits starting at bit 3. -// func:ams.StreamFlags.nonblock.Set -inline void nonblock_Set(ams::StreamFlags& parent, bool rhs) __attribute__((nothrow)); - -// Retrieve bitfield from value of field value -// 1 bits starting at bit 4. -// func:ams.StreamFlags.trace_read.Get -inline bool trace_read_Get(const ams::StreamFlags& parent) __attribute__((__warn_unused_result__, nothrow)); -// Set bitfield in value of field 'value' -// 1 bits starting at bit 4. -// func:ams.StreamFlags.trace_read.Set -inline void trace_read_Set(ams::StreamFlags& parent, bool rhs) __attribute__((nothrow)); - -// Retrieve bitfield from value of field value -// 1 bits starting at bit 5. -// func:ams.StreamFlags.trace_write.Get -inline bool trace_write_Get(const ams::StreamFlags& parent) __attribute__((__warn_unused_result__, nothrow)); -// Set bitfield in value of field 'value' -// 1 bits starting at bit 5. -// func:ams.StreamFlags.trace_write.Set -inline void trace_write_Set(ams::StreamFlags& parent, bool rhs) __attribute__((nothrow)); +// func:ams.ShmFlags.nonblock.Set +inline void nonblock_Set(ams::ShmFlags& parent, bool rhs) __attribute__((nothrow)); // Retrieve bitfield from value of field value // 1 bits starting at bit 6. -// func:ams.StreamFlags.write_err.Get -inline bool write_err_Get(const ams::StreamFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:ams.ShmFlags.write_err.Get +inline bool write_err_Get(const ams::ShmFlags& parent) __attribute__((__warn_unused_result__, nothrow)); // Set bitfield in value of field 'value' // 1 bits starting at bit 6. -// func:ams.StreamFlags.write_err.Set -inline void write_err_Set(ams::StreamFlags& parent, bool rhs) __attribute__((nothrow)); - -// Retrieve bitfield from value of field value -// 1 bits starting at bit 7. -// func:ams.StreamFlags.trace_text.Get -inline bool trace_text_Get(const ams::StreamFlags& parent) __attribute__((__warn_unused_result__, nothrow)); -// Set bitfield in value of field 'value' -// 1 bits starting at bit 7. -// func:ams.StreamFlags.trace_text.Set -inline void trace_text_Set(ams::StreamFlags& parent, bool rhs) __attribute__((nothrow)); - -// func:ams.StreamFlags..ReadFieldMaybe -bool StreamFlags_ReadFieldMaybe(ams::StreamFlags& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::StreamFlags from an ascii string. -// func:ams.StreamFlags..ReadStrptrMaybe -bool StreamFlags_ReadStrptrMaybe(ams::StreamFlags &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ShmFlags.write_err.Set +inline void write_err_Set(ams::ShmFlags& parent, bool rhs) __attribute__((nothrow)); + +// func:ams.ShmFlags..ReadFieldMaybe +bool ShmFlags_ReadFieldMaybe(ams::ShmFlags& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ams::ShmFlags from an ascii string. +// func:ams.ShmFlags..ReadStrptrMaybe +bool ShmFlags_ReadStrptrMaybe(ams::ShmFlags &parent, algo::strptr in_str) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.StreamFlags..Init -inline void StreamFlags_Init(ams::StreamFlags& parent); +// func:ams.ShmFlags..Init +inline void ShmFlags_Init(ams::ShmFlags& parent); // print string representation of ROW to string STR -// cfmt:ams.StreamFlags.String printfmt:Bitset -// func:ams.StreamFlags..Print -void StreamFlags_Print(ams::StreamFlags row, algo::cstring& str) __attribute__((nothrow)); -// func:ams.StreamFlags..GetAnon -algo::strptr StreamFlags_GetAnon(ams::StreamFlags &parent, i32 idx) __attribute__((nothrow)); +// cfmt:ams.ShmFlags.String printfmt:Bitset +// func:ams.ShmFlags..Print +void ShmFlags_Print(ams::ShmFlags row, algo::cstring& str) __attribute__((nothrow)); +// func:ams.ShmFlags..GetAnon +algo::strptr ShmFlags_GetAnon(ams::ShmFlags &parent, i32 idx) __attribute__((nothrow)); -// --- ams.StreamHbMsg +// --- ams.Shmtype #pragma pack(push,1) -struct StreamHbMsg { // ams.StreamHbMsg: Stream heartbeat - u32 type; // 3 - u32 length; // ssizeof(parent) + (0) - ams::Member member; // Primary key - ams::StreamPos pos; // Read/write position - u32 wbudget; // 0 Max. offset for writing - // func:ams.StreamHbMsg..Ctor - inline StreamHbMsg() __attribute__((nothrow)); - // func:ams.StreamHbMsg..FieldwiseCtor - explicit inline StreamHbMsg(ams::Member in_member, ams::StreamPos in_pos, u32 in_wbudget) __attribute__((nothrow)); +struct Shmtype { // ams.Shmtype + u8 value; // 0 + // func:ams.Shmtype..EqOp + inline bool operator ==(const ams::Shmtype &rhs) const __attribute__((nothrow)); + // func:ams.Shmtype..NeOp + inline bool operator !=(const ams::Shmtype &rhs) const __attribute__((nothrow)); + // define enum comparison operator to avoid ambiguity + // func:ams.Shmtype..EqEnum + inline bool operator ==(ams_ShmtypeEnum rhs) const __attribute__((nothrow)); + // func:ams.Shmtype..Ctor + inline Shmtype() __attribute__((nothrow)); + // func:ams.Shmtype..FieldwiseCtor + explicit inline Shmtype(u8 in_value) __attribute__((nothrow)); + // func:ams.Shmtype..EnumCtor + inline Shmtype(ams_ShmtypeEnum arg) __attribute__((nothrow)); }; #pragma pack(pop) -// Copy fields out of row -// func:ams.StreamHbMsg.base.CopyOut -void parent_CopyOut(ams::StreamHbMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of StreamHbMsg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of StreamHbMsg. -// If not successful, quietly return NULL. -// func:ams.StreamHbMsg.base.Castdown -inline ams::StreamHbMsg* StreamHbMsg_Castdown(ams::MsgHeader &hdr); -// func:ams.StreamHbMsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::StreamHbMsg& parent); - -// func:ams.StreamHbMsg..ReadFieldMaybe -bool StreamHbMsg_ReadFieldMaybe(ams::StreamHbMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::StreamHbMsg from an ascii string. -// The format of the string is an ssim Tuple -// func:ams.StreamHbMsg..ReadStrptrMaybe -bool StreamHbMsg_ReadStrptrMaybe(ams::StreamHbMsg &parent, algo::strptr in_str) __attribute__((nothrow)); -// Message length (uses length field) -// func:ams.StreamHbMsg..GetMsgLength -inline i32 GetMsgLength(const ams::StreamHbMsg& parent) __attribute__((nothrow)); -// Memptr encompassing the message (uses length field) -// func:ams.StreamHbMsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::StreamHbMsg& row) __attribute__((nothrow)); +// Get value of field as enum type +// func:ams.Shmtype.value.GetEnum +inline ams_ShmtypeEnum value_GetEnum(const ams::Shmtype& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:ams.Shmtype.value.SetEnum +inline void value_SetEnum(ams::Shmtype& parent, ams_ShmtypeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:ams.Shmtype.value.ToCstr +const char* value_ToCstr(const ams::Shmtype& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:ams.Shmtype.value.Print +void value_Print(const ams::Shmtype& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:ams.Shmtype.value.SetStrptrMaybe +bool value_SetStrptrMaybe(ams::Shmtype& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:ams.Shmtype.value.SetStrptr +void value_SetStrptr(ams::Shmtype& parent, algo::strptr rhs, ams_ShmtypeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:ams.Shmtype.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(ams::Shmtype& parent, algo::strptr rhs) __attribute__((nothrow)); + +// func:ams.Shmtype..Hash +inline u32 Shmtype_Hash(u32 prev, ams::Shmtype rhs) __attribute__((nothrow)); +// Read fields of ams::Shmtype from an ascii string. +// The format of the string is the format of the ams::Shmtype's only field +// func:ams.Shmtype..ReadStrptrMaybe +bool Shmtype_ReadStrptrMaybe(ams::Shmtype &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.Shmtype..Cmp +inline i32 Shmtype_Cmp(ams::Shmtype lhs, ams::Shmtype rhs) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.StreamHbMsg..Init -inline void StreamHbMsg_Init(ams::StreamHbMsg& parent); +// func:ams.Shmtype..Init +inline void Shmtype_Init(ams::Shmtype& parent); +// func:ams.Shmtype..Eq +inline bool Shmtype_Eq(ams::Shmtype lhs, ams::Shmtype rhs) __attribute__((nothrow)); // print string representation of ROW to string STR -// cfmt:ams.StreamHbMsg.String printfmt:Tuple -// func:ams.StreamHbMsg..Print -void StreamHbMsg_Print(ams::StreamHbMsg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.Shmtype.String printfmt:Raw +// func:ams.Shmtype..Print +void Shmtype_Print(ams::Shmtype row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.TerminateMsg +// --- ams.ShmId #pragma pack(push,1) -struct TerminateMsg { // ams.TerminateMsg: Message sent to process to terminate it - u32 type; // 352 - u32 length; // ssizeof(parent) + (0) - // func:ams.TerminateMsg..Ctor - inline TerminateMsg() __attribute__((nothrow)); +struct ShmId { // ams.ShmId: Host-unique stream ID. E.g. proc1-0.out-0 + ams::ProcId proc_id; // Writer process ID + ams::Shmtype shmtype; // Stream type ID + u8 index; // 0 Stream index + // func:ams.ShmId..EqOp + inline bool operator ==(const ams::ShmId &rhs) const __attribute__((nothrow)); + // func:ams.ShmId..NeOp + inline bool operator !=(const ams::ShmId &rhs) const __attribute__((nothrow)); + // func:ams.ShmId..Ctor + inline ShmId() __attribute__((nothrow)); + // func:ams.ShmId..FieldwiseCtor + explicit inline ShmId(ams::ProcId in_proc_id, ams::Shmtype in_shmtype, u8 in_index) __attribute__((nothrow)); }; #pragma pack(pop) -// Copy fields out of row -// func:ams.TerminateMsg.base.CopyOut -void parent_CopyOut(ams::TerminateMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of TerminateMsg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of TerminateMsg. -// If not successful, quietly return NULL. -// func:ams.TerminateMsg.base.Castdown -inline ams::TerminateMsg* TerminateMsg_Castdown(ams::MsgHeader &hdr); -// func:ams.TerminateMsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::TerminateMsg& parent); - -// func:ams.TerminateMsg..ReadFieldMaybe -bool TerminateMsg_ReadFieldMaybe(ams::TerminateMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of ams::TerminateMsg from an ascii string. -// The format of the string is an ssim Tuple -// func:ams.TerminateMsg..ReadStrptrMaybe -bool TerminateMsg_ReadStrptrMaybe(ams::TerminateMsg &parent, algo::strptr in_str) __attribute__((nothrow)); -// Message length (uses length field) -// func:ams.TerminateMsg..GetMsgLength -inline i32 GetMsgLength(const ams::TerminateMsg& parent) __attribute__((nothrow)); -// Memptr encompassing the message (uses length field) -// func:ams.TerminateMsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::TerminateMsg& row) __attribute__((nothrow)); +// func:ams.ShmId..Hash +inline u32 ShmId_Hash(u32 prev, ams::ShmId rhs) __attribute__((nothrow)); +// func:ams.ShmId..ReadFieldMaybe +bool ShmId_ReadFieldMaybe(ams::ShmId& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ams::ShmId from an ascii string. +// The format of the string is a string with separated values +// func:ams.ShmId..ReadStrptrMaybe +bool ShmId_ReadStrptrMaybe(ams::ShmId &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ShmId..Cmp +inline i32 ShmId_Cmp(ams::ShmId lhs, ams::ShmId rhs) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.TerminateMsg..Init -inline void TerminateMsg_Init(ams::TerminateMsg& parent); +// func:ams.ShmId..Init +inline void ShmId_Init(ams::ShmId& parent); +// func:ams.ShmId..Eq +inline bool ShmId_Eq(ams::ShmId lhs, ams::ShmId rhs) __attribute__((nothrow)); // print string representation of ROW to string STR -// cfmt:ams.TerminateMsg.String printfmt:Tuple -// func:ams.TerminateMsg..Print -void TerminateMsg_Print(ams::TerminateMsg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.ShmId.String printfmt:Sep +// func:ams.ShmId..Print +void ShmId_Print(ams::ShmId row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.Trace2Msg +// --- ams.ShmemberFlags #pragma pack(push,1) -struct Trace2Msg { // ams.Trace2Msg: Trace2 message - u32 type; // 108 - u32 length; // ssizeof(parent) + (0) - ams::ProcId proc; // - u8 trace; // 0 - algo::UnTime tstamp; // - // var-length field ams.Trace2Msg.data starts here. access it with data_Addr - // func:ams.Trace2Msg..Ctor - inline Trace2Msg() __attribute__((nothrow)); - // func:ams.Trace2Msg..FieldwiseCtor - explicit inline Trace2Msg(ams::ProcId in_proc, u8 in_trace, algo::UnTime in_tstamp) __attribute__((nothrow)); +struct ShmemberFlags { // ams.ShmemberFlags: Shm member flags + u16 value; // 0 Shm member flags + // func:ams.ShmemberFlags..EqOp + inline bool operator ==(const ams::ShmemberFlags &rhs) const __attribute__((nothrow)); + // func:ams.ShmemberFlags..NeOp + inline bool operator !=(const ams::ShmemberFlags &rhs) const __attribute__((nothrow)); + // define enum comparison operator to avoid ambiguity + // func:ams.ShmemberFlags..EqEnum + inline bool operator ==(ams_ShmemberFlagsEnum rhs) const __attribute__((nothrow)); + // func:ams.ShmemberFlags..Ctor + inline ShmemberFlags() __attribute__((nothrow)); + // func:ams.ShmemberFlags..FieldwiseCtor + explicit inline ShmemberFlags(u16 in_value) __attribute__((nothrow)); + // func:ams.ShmemberFlags..EnumCtor + inline ShmemberFlags(ams_ShmemberFlagsEnum arg) __attribute__((nothrow)); }; #pragma pack(pop) -// Copy fields out of row -// func:ams.Trace2Msg.base.CopyOut -void parent_CopyOut(ams::Trace2Msg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of Trace2Msg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of Trace2Msg. -// If not successful, quietly return NULL. -// func:ams.Trace2Msg.base.Castdown -inline ams::Trace2Msg* Trace2Msg_Castdown(ams::MsgHeader &hdr); -// func:ams.Trace2Msg.base.Castbase -inline ams::MsgHeader& Castbase(ams::Trace2Msg& parent); +// Retrieve bitfield from value of field value +// 1 bits starting at bit 0. +// func:ams.ShmemberFlags.r.Get +inline bool r_Get(const ams::ShmemberFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 0. +// func:ams.ShmemberFlags.r.Set +inline void r_Set(ams::ShmemberFlags& parent, bool rhs) __attribute__((nothrow)); -// Access var-length portion as an aryptr. Length is determined from one of the fields. -// func:ams.Trace2Msg.data.Getary -algo::aryptr data_Getary(ams::Trace2Msg& parent) __attribute__((nothrow)); -// func:ams.Trace2Msg.data.Addr -u64* data_Addr(ams::Trace2Msg& parent); -// Return number of elements in varlen field -// func:ams.Trace2Msg.data.N -inline u32 data_N(const ams::Trace2Msg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); -// Convert string to field. Return success value -// func:ams.Trace2Msg.data.ReadStrptrMaybe -bool data_ReadStrptrMaybe(ams::Trace2Msg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Retrieve bitfield from value of field value +// 1 bits starting at bit 1. +// func:ams.ShmemberFlags.w.Get +inline bool w_Get(const ams::ShmemberFlags& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 1. +// func:ams.ShmemberFlags.w.Set +inline void w_Set(ams::ShmemberFlags& parent, bool rhs) __attribute__((nothrow)); + +// func:ams.ShmemberFlags..Hash +inline u32 ShmemberFlags_Hash(u32 prev, ams::ShmemberFlags rhs) __attribute__((nothrow)); +// func:ams.ShmemberFlags..ReadFieldMaybe +bool ShmemberFlags_ReadFieldMaybe(ams::ShmemberFlags& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ams::ShmemberFlags from an ascii string. +// func:ams.ShmemberFlags..ReadStrptrMaybe +bool ShmemberFlags_ReadStrptrMaybe(ams::ShmemberFlags &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ShmemberFlags..Cmp +inline i32 ShmemberFlags_Cmp(ams::ShmemberFlags lhs, ams::ShmemberFlags rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ams.ShmemberFlags..Init +inline void ShmemberFlags_Init(ams::ShmemberFlags& parent); +// func:ams.ShmemberFlags..Eq +inline bool ShmemberFlags_Eq(ams::ShmemberFlags lhs, ams::ShmemberFlags rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:ams.ShmemberFlags.String printfmt:Bitset +// func:ams.ShmemberFlags..Print +void ShmemberFlags_Print(ams::ShmemberFlags row, algo::cstring& str) __attribute__((nothrow)); +// func:ams.ShmemberFlags..GetAnon +algo::strptr ShmemberFlags_GetAnon(ams::ShmemberFlags &parent, i32 idx) __attribute__((nothrow)); -// func:ams.Trace2Msg.data_curs.Reset -inline void Trace2Msg_data_curs_Reset(Trace2Msg_data_curs &curs, ams::Trace2Msg &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:ams.Trace2Msg.data_curs.ValidQ -inline bool Trace2Msg_data_curs_ValidQ(Trace2Msg_data_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:ams.Trace2Msg.data_curs.Next -inline void Trace2Msg_data_curs_Next(Trace2Msg_data_curs &curs) __attribute__((nothrow)); -// item access -// func:ams.Trace2Msg.data_curs.Access -inline u64& Trace2Msg_data_curs_Access(Trace2Msg_data_curs &curs) __attribute__((nothrow)); -// func:ams.Trace2Msg..ReadFieldMaybe -bool Trace2Msg_ReadFieldMaybe(ams::Trace2Msg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::Trace2Msg from an ascii string. -// The format of the string is an ssim Tuple -// func:ams.Trace2Msg..ReadStrptrMaybe -bool Trace2Msg_ReadStrptrMaybe(ams::Trace2Msg &parent, algo::strptr in_str) __attribute__((nothrow)); -// Message length (uses length field) -// func:ams.Trace2Msg..GetMsgLength -inline i32 GetMsgLength(const ams::Trace2Msg& parent) __attribute__((nothrow)); -// Memptr encompassing the message (uses length field) -// func:ams.Trace2Msg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::Trace2Msg& row) __attribute__((nothrow)); +// --- ams.ShmemberId +#pragma pack(push,1) +struct ShmemberId { // ams.ShmemberId: Shm/Process - member ID for AMS SHM + ams::ShmId shm_id; // Stream ID + ams::ProcId proc_id; // Process ID + ams::ShmemberFlags flags; // 0 + // func:ams.ShmemberId..EqOp + inline bool operator ==(const ams::ShmemberId &rhs) const __attribute__((nothrow)); + // func:ams.ShmemberId..NeOp + inline bool operator !=(const ams::ShmemberId &rhs) const __attribute__((nothrow)); + // func:ams.ShmemberId..Ctor + inline ShmemberId() __attribute__((nothrow)); + // func:ams.ShmemberId..FieldwiseCtor + explicit inline ShmemberId(ams::ShmId in_shm_id, ams::ProcId in_proc_id, ams::ShmemberFlags in_flags) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// func:ams.ShmemberId..Hash +inline u32 ShmemberId_Hash(u32 prev, ams::ShmemberId rhs) __attribute__((nothrow)); +// func:ams.ShmemberId..ReadFieldMaybe +bool ShmemberId_ReadFieldMaybe(ams::ShmemberId& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ams::ShmemberId from an ascii string. +// The format of the string is a string with separated values +// func:ams.ShmemberId..ReadStrptrMaybe +bool ShmemberId_ReadStrptrMaybe(ams::ShmemberId &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ShmemberId..Cmp +inline i32 ShmemberId_Cmp(ams::ShmemberId lhs, ams::ShmemberId rhs) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.Trace2Msg..Init -inline void Trace2Msg_Init(ams::Trace2Msg& parent); +// func:ams.ShmemberId..Init +inline void ShmemberId_Init(ams::ShmemberId& parent); +// func:ams.ShmemberId..Eq +inline bool ShmemberId_Eq(ams::ShmemberId lhs, ams::ShmemberId rhs) __attribute__((nothrow)); // print string representation of ROW to string STR -// cfmt:ams.Trace2Msg.String printfmt:Tuple -// func:ams.Trace2Msg..Print -void Trace2Msg_Print(ams::Trace2Msg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.ShmemberId.String printfmt:Sep +// func:ams.ShmemberId..Print +void ShmemberId_Print(ams::ShmemberId row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.TraceInfo2Msg +// --- ams.ShmHbMsg #pragma pack(push,1) -struct TraceInfo2Msg { // ams.TraceInfo2Msg: Trace info message - u32 type; // 109 - u32 length; // ssizeof(parent) + (0) - ams::ProcId proc; // - u8 trace; // 0 - algo::UnTime tstamp; // - u8 part; // 0 - // var-length field ams.TraceInfo2Msg.data starts here. access it with data_Addr - // func:ams.TraceInfo2Msg..Ctor - inline TraceInfo2Msg() __attribute__((nothrow)); - // func:ams.TraceInfo2Msg..FieldwiseCtor - explicit inline TraceInfo2Msg(ams::ProcId in_proc, u8 in_trace, algo::UnTime in_tstamp, u8 in_part) __attribute__((nothrow)); +struct ShmHbMsg { // ams.ShmHbMsg: Shm heartbeat + u32 type; // 3 + u32 length; // ssizeof(parent) + (0) + ams::ShmemberId shmember; // Primary key + u64 off; // 0 Read/write position + u32 wbudget; // 0 Max. offset for writing + // func:ams.ShmHbMsg..Ctor + inline ShmHbMsg() __attribute__((nothrow)); + // func:ams.ShmHbMsg..FieldwiseCtor + explicit inline ShmHbMsg(ams::ShmemberId in_shmember, u64 in_off, u32 in_wbudget) __attribute__((nothrow)); }; #pragma pack(pop) // Copy fields out of row -// func:ams.TraceInfo2Msg.base.CopyOut -void parent_CopyOut(ams::TraceInfo2Msg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of TraceInfo2Msg by checking the type field +// func:ams.ShmHbMsg.base.CopyOut +void parent_CopyOut(ams::ShmHbMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of ShmHbMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of TraceInfo2Msg. +// Additionally, check if the length field permits valid instance of ShmHbMsg. // If not successful, quietly return NULL. -// func:ams.TraceInfo2Msg.base.Castdown -inline ams::TraceInfo2Msg* TraceInfo2Msg_Castdown(ams::MsgHeader &hdr); -// func:ams.TraceInfo2Msg.base.Castbase -inline ams::MsgHeader& Castbase(ams::TraceInfo2Msg& parent); - -// Access var-length portion as an aryptr. Length is determined from one of the fields. -// func:ams.TraceInfo2Msg.data.Getary -algo::aryptr data_Getary(ams::TraceInfo2Msg& parent) __attribute__((nothrow)); -// func:ams.TraceInfo2Msg.data.Addr -char* data_Addr(ams::TraceInfo2Msg& parent); -// Return number of elements in varlen field -// func:ams.TraceInfo2Msg.data.N -inline u32 data_N(const ams::TraceInfo2Msg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); -// Convert string to field. Return success value -// func:ams.TraceInfo2Msg.data.ReadStrptrMaybe -bool data_ReadStrptrMaybe(ams::TraceInfo2Msg& parent, algo::strptr in_str) __attribute__((nothrow)); -// Convert data to a string. -// Array is printed as a regular string. -// func:ams.TraceInfo2Msg.data.Print -void data_Print(ams::TraceInfo2Msg& parent, algo::cstring &rhs) __attribute__((nothrow)); - -// func:ams.TraceInfo2Msg.data_curs.Reset -inline void TraceInfo2Msg_data_curs_Reset(TraceInfo2Msg_data_curs &curs, ams::TraceInfo2Msg &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:ams.TraceInfo2Msg.data_curs.ValidQ -inline bool TraceInfo2Msg_data_curs_ValidQ(TraceInfo2Msg_data_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:ams.TraceInfo2Msg.data_curs.Next -inline void TraceInfo2Msg_data_curs_Next(TraceInfo2Msg_data_curs &curs) __attribute__((nothrow)); -// item access -// func:ams.TraceInfo2Msg.data_curs.Access -inline char& TraceInfo2Msg_data_curs_Access(TraceInfo2Msg_data_curs &curs) __attribute__((nothrow)); -// func:ams.TraceInfo2Msg..ReadFieldMaybe -bool TraceInfo2Msg_ReadFieldMaybe(ams::TraceInfo2Msg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::TraceInfo2Msg from an ascii string. +// func:ams.ShmHbMsg.base.Castdown +inline ams::ShmHbMsg* ShmHbMsg_Castdown(ams::MsgHeader &hdr); +// func:ams.ShmHbMsg.base.Castbase +inline ams::MsgHeader& Castbase(ams::ShmHbMsg& parent); + +// func:ams.ShmHbMsg..ReadFieldMaybe +bool ShmHbMsg_ReadFieldMaybe(ams::ShmHbMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ams::ShmHbMsg from an ascii string. // The format of the string is an ssim Tuple -// func:ams.TraceInfo2Msg..ReadStrptrMaybe -bool TraceInfo2Msg_ReadStrptrMaybe(ams::TraceInfo2Msg &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.ShmHbMsg..ReadStrptrMaybe +bool ShmHbMsg_ReadStrptrMaybe(ams::ShmHbMsg &parent, algo::strptr in_str) __attribute__((nothrow)); // Message length (uses length field) -// func:ams.TraceInfo2Msg..GetMsgLength -inline i32 GetMsgLength(const ams::TraceInfo2Msg& parent) __attribute__((nothrow)); +// func:ams.ShmHbMsg..GetMsgLength +inline i32 GetMsgLength(const ams::ShmHbMsg& parent) __attribute__((nothrow)); // Memptr encompassing the message (uses length field) -// func:ams.TraceInfo2Msg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::TraceInfo2Msg& row) __attribute__((nothrow)); +// func:ams.ShmHbMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ams::ShmHbMsg& row) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.TraceInfo2Msg..Init -inline void TraceInfo2Msg_Init(ams::TraceInfo2Msg& parent); +// func:ams.ShmHbMsg..Init +inline void ShmHbMsg_Init(ams::ShmHbMsg& parent); // print string representation of ROW to string STR -// cfmt:ams.TraceInfo2Msg.String printfmt:Tuple -// func:ams.TraceInfo2Msg..Print -void TraceInfo2Msg_Print(ams::TraceInfo2Msg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.ShmHbMsg.String printfmt:Tuple +// func:ams.ShmHbMsg..Print +void ShmHbMsg_Print(ams::ShmHbMsg& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.TraceInfoMsg +// --- ams.Shmmsg #pragma pack(push,1) -struct TraceInfoMsg { // ams.TraceInfoMsg: Trace info message - u32 type; // 9 - u32 length; // ssizeof(parent) + (0) - ams::ProcId proc; // - algo::UnTime tstamp; // - u8 part; // 0 - // var-length field ams.TraceInfoMsg.data starts here. access it with data_Addr - // func:ams.TraceInfoMsg..Ctor - inline TraceInfoMsg() __attribute__((nothrow)); - // func:ams.TraceInfoMsg..FieldwiseCtor - explicit inline TraceInfoMsg(ams::ProcId in_proc, algo::UnTime in_tstamp, u8 in_part) __attribute__((nothrow)); +struct Shmmsg { // ams.Shmmsg: Sequenced message on a shm + u32 type; // 10 + u32 length; // ssizeof(parent) + (0) + ams::ShmId shm_id; // + u64 off; // 0 + u64 tstamp; // 0 + // ams::MsgHeader payload[]; optional field + // func:ams.Shmmsg..Ctor + inline Shmmsg() __attribute__((nothrow)); + // func:ams.Shmmsg..FieldwiseCtor + explicit inline Shmmsg(ams::ShmId in_shm_id, u64 in_off, u64 in_tstamp) __attribute__((nothrow)); }; #pragma pack(pop) // Copy fields out of row -// func:ams.TraceInfoMsg.base.CopyOut -void parent_CopyOut(ams::TraceInfoMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of TraceInfoMsg by checking the type field +// func:ams.Shmmsg.base.CopyOut +void parent_CopyOut(ams::Shmmsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of Shmmsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of TraceInfoMsg. +// Additionally, check if the length field permits valid instance of Shmmsg. // If not successful, quietly return NULL. -// func:ams.TraceInfoMsg.base.Castdown -inline ams::TraceInfoMsg* TraceInfoMsg_Castdown(ams::MsgHeader &hdr); -// func:ams.TraceInfoMsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::TraceInfoMsg& parent); +// func:ams.Shmmsg.base.Castdown +inline ams::Shmmsg* Shmmsg_Castdown(ams::MsgHeader &hdr); +// func:ams.Shmmsg.base.Castbase +inline ams::MsgHeader& Castbase(ams::Shmmsg& parent); -// Access var-length portion as an aryptr. Length is determined from one of the fields. -// func:ams.TraceInfoMsg.data.Getary -algo::aryptr data_Getary(ams::TraceInfoMsg& parent) __attribute__((nothrow)); -// func:ams.TraceInfoMsg.data.Addr -char* data_Addr(ams::TraceInfoMsg& parent); -// Return number of elements in varlen field -// func:ams.TraceInfoMsg.data.N -inline u32 data_N(const ams::TraceInfoMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to optional last element (NULL if none) +// The parent's length field is assumed to have already been checked for validity. +// If the parent's lengthis too short to allow a full-sized payload, return NULL. +// Since the last element is itself variable-length, two more checks are applied: +// If payload's length field value is too short, return NULL. +// If payload's length field value extends past parent's allowed length, return NULL. +// func:ams.Shmmsg.payload.Get +inline ams::MsgHeader* payload_Get(ams::Shmmsg& parent) __attribute__((__warn_unused_result__, nothrow)); +// Access optional portion as an array of bytes +// func:ams.Shmmsg.payload.Getary +algo::aryptr payload_Getary(ams::Shmmsg& parent) __attribute__((nothrow)); +// func:ams.Shmmsg.payload.Print +void payload_Print(ams::Shmmsg& parent, cstring &out) __attribute__((nothrow)); // Convert string to field. Return success value -// func:ams.TraceInfoMsg.data.ReadStrptrMaybe -bool data_ReadStrptrMaybe(ams::TraceInfoMsg& parent, algo::strptr in_str) __attribute__((nothrow)); -// Convert data to a string. -// Array is printed as a regular string. -// func:ams.TraceInfoMsg.data.Print -void data_Print(ams::TraceInfoMsg& parent, algo::cstring &rhs) __attribute__((nothrow)); +// func:ams.Shmmsg.payload.ReadStrptrMaybe +bool payload_ReadStrptrMaybe(ams::Shmmsg &parent, algo::strptr in_str) __attribute__((nothrow)); -// func:ams.TraceInfoMsg.data_curs.Reset -inline void TraceInfoMsg_data_curs_Reset(TraceInfoMsg_data_curs &curs, ams::TraceInfoMsg &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:ams.TraceInfoMsg.data_curs.ValidQ -inline bool TraceInfoMsg_data_curs_ValidQ(TraceInfoMsg_data_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:ams.TraceInfoMsg.data_curs.Next -inline void TraceInfoMsg_data_curs_Next(TraceInfoMsg_data_curs &curs) __attribute__((nothrow)); -// item access -// func:ams.TraceInfoMsg.data_curs.Access -inline char& TraceInfoMsg_data_curs_Access(TraceInfoMsg_data_curs &curs) __attribute__((nothrow)); -// func:ams.TraceInfoMsg..ReadFieldMaybe -bool TraceInfoMsg_ReadFieldMaybe(ams::TraceInfoMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// func:ams.Shmmsg..ReadFieldMaybe +bool Shmmsg_ReadFieldMaybe(ams::Shmmsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); // Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::TraceInfoMsg from an ascii string. +// Read fields of ams::Shmmsg from an ascii string. // The format of the string is an ssim Tuple -// func:ams.TraceInfoMsg..ReadStrptrMaybe -bool TraceInfoMsg_ReadStrptrMaybe(ams::TraceInfoMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.Shmmsg..ReadStrptrMaybe +bool Shmmsg_ReadStrptrMaybe(ams::Shmmsg &parent, algo::strptr in_str) __attribute__((nothrow)); // Message length (uses length field) -// func:ams.TraceInfoMsg..GetMsgLength -inline i32 GetMsgLength(const ams::TraceInfoMsg& parent) __attribute__((nothrow)); +// func:ams.Shmmsg..GetMsgLength +inline i32 GetMsgLength(const ams::Shmmsg& parent) __attribute__((nothrow)); // Memptr encompassing the message (uses length field) -// func:ams.TraceInfoMsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::TraceInfoMsg& row) __attribute__((nothrow)); +// func:ams.Shmmsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ams::Shmmsg& row) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.TraceInfoMsg..Init -inline void TraceInfoMsg_Init(ams::TraceInfoMsg& parent); +// func:ams.Shmmsg..Init +inline void Shmmsg_Init(ams::Shmmsg& parent); // print string representation of ROW to string STR -// cfmt:ams.TraceInfoMsg.String printfmt:Tuple -// func:ams.TraceInfoMsg..Print -void TraceInfoMsg_Print(ams::TraceInfoMsg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.Shmmsg.String printfmt:Tuple +// func:ams.Shmmsg..Print +void Shmmsg_Print(ams::Shmmsg& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams.TraceMsg +// --- ams.TerminateMsg #pragma pack(push,1) -struct TraceMsg { // ams.TraceMsg: Trace message - u32 type; // 8 - u32 length; // ssizeof(parent) + (0) - ams::ProcId proc; // - algo::UnTime tstamp; // - // var-length field ams.TraceMsg.data starts here. access it with data_Addr - // func:ams.TraceMsg..Ctor - inline TraceMsg() __attribute__((nothrow)); - // func:ams.TraceMsg..FieldwiseCtor - explicit inline TraceMsg(ams::ProcId in_proc, algo::UnTime in_tstamp) __attribute__((nothrow)); +struct TerminateMsg { // ams.TerminateMsg: Message sent to process to terminate it + u32 type; // 352 + u32 length; // ssizeof(parent) + (0) + // func:ams.TerminateMsg..Ctor + inline TerminateMsg() __attribute__((nothrow)); }; #pragma pack(pop) // Copy fields out of row -// func:ams.TraceMsg.base.CopyOut -void parent_CopyOut(ams::TraceMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); -// Check if ams::MsgHeader is an instance of TraceMsg by checking the type field +// func:ams.TerminateMsg.base.CopyOut +void parent_CopyOut(ams::TerminateMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of TerminateMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of TraceMsg. +// Additionally, check if the length field permits valid instance of TerminateMsg. // If not successful, quietly return NULL. -// func:ams.TraceMsg.base.Castdown -inline ams::TraceMsg* TraceMsg_Castdown(ams::MsgHeader &hdr); -// func:ams.TraceMsg.base.Castbase -inline ams::MsgHeader& Castbase(ams::TraceMsg& parent); - -// Access var-length portion as an aryptr. Length is determined from one of the fields. -// func:ams.TraceMsg.data.Getary -algo::aryptr data_Getary(ams::TraceMsg& parent) __attribute__((nothrow)); -// func:ams.TraceMsg.data.Addr -u64* data_Addr(ams::TraceMsg& parent); -// Return number of elements in varlen field -// func:ams.TraceMsg.data.N -inline u32 data_N(const ams::TraceMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); -// Convert string to field. Return success value -// func:ams.TraceMsg.data.ReadStrptrMaybe -bool data_ReadStrptrMaybe(ams::TraceMsg& parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.TerminateMsg.base.Castdown +inline ams::TerminateMsg* TerminateMsg_Castdown(ams::MsgHeader &hdr); +// func:ams.TerminateMsg.base.Castbase +inline ams::MsgHeader& Castbase(ams::TerminateMsg& parent); -// func:ams.TraceMsg.data_curs.Reset -inline void TraceMsg_data_curs_Reset(TraceMsg_data_curs &curs, ams::TraceMsg &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:ams.TraceMsg.data_curs.ValidQ -inline bool TraceMsg_data_curs_ValidQ(TraceMsg_data_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:ams.TraceMsg.data_curs.Next -inline void TraceMsg_data_curs_Next(TraceMsg_data_curs &curs) __attribute__((nothrow)); -// item access -// func:ams.TraceMsg.data_curs.Access -inline u64& TraceMsg_data_curs_Access(TraceMsg_data_curs &curs) __attribute__((nothrow)); -// func:ams.TraceMsg..ReadFieldMaybe -bool TraceMsg_ReadFieldMaybe(ams::TraceMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of ams::TraceMsg from an ascii string. +// func:ams.TerminateMsg..ReadFieldMaybe +bool TerminateMsg_ReadFieldMaybe(ams::TerminateMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ams::TerminateMsg from an ascii string. // The format of the string is an ssim Tuple -// func:ams.TraceMsg..ReadStrptrMaybe -bool TraceMsg_ReadStrptrMaybe(ams::TraceMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:ams.TerminateMsg..ReadStrptrMaybe +bool TerminateMsg_ReadStrptrMaybe(ams::TerminateMsg &parent, algo::strptr in_str) __attribute__((nothrow)); // Message length (uses length field) -// func:ams.TraceMsg..GetMsgLength -inline i32 GetMsgLength(const ams::TraceMsg& parent) __attribute__((nothrow)); +// func:ams.TerminateMsg..GetMsgLength +inline i32 GetMsgLength(const ams::TerminateMsg& parent) __attribute__((nothrow)); // Memptr encompassing the message (uses length field) -// func:ams.TraceMsg..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const ams::TraceMsg& row) __attribute__((nothrow)); +// func:ams.TerminateMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ams::TerminateMsg& row) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams.TraceMsg..Init -inline void TraceMsg_Init(ams::TraceMsg& parent); +// func:ams.TerminateMsg..Init +inline void TerminateMsg_Init(ams::TerminateMsg& parent); // print string representation of ROW to string STR -// cfmt:ams.TraceMsg.String printfmt:Tuple -// func:ams.TraceMsg..Print -void TraceMsg_Print(ams::TraceMsg& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:ams.TerminateMsg.String printfmt:Tuple +// func:ams.TerminateMsg..Print +void TerminateMsg_Print(ams::TerminateMsg& row, algo::cstring& str) __attribute__((nothrow)); // --- ams.UdpFrame #pragma pack(push,1) @@ -2162,6 +1797,15 @@ struct InputLineMsg_payload_curs {// cursor }; +struct LogMsg_logcat_curs {// cursor + typedef char ChildType; + u8 *ptr; + int length; + int index; + LogMsg_logcat_curs() { ptr=NULL; length=0; index=0; } +}; + + struct LogMsg_text_curs {// cursor typedef char ChildType; u8 *ptr; @@ -2180,39 +1824,39 @@ struct MsgBlock_messages_curs {// cursor }; -struct Trace2Msg_data_curs {// cursor - typedef u64 ChildType; +struct ProcMsg_payload_curs {// cursor + typedef char ChildType; u8 *ptr; int length; int index; - Trace2Msg_data_curs() { ptr=NULL; length=0; index=0; } + ProcMsg_payload_curs() { ptr=NULL; length=0; index=0; } }; -struct TraceInfo2Msg_data_curs {// cursor +struct ProcReadMsg_until_curs {// cursor typedef char ChildType; u8 *ptr; int length; int index; - TraceInfo2Msg_data_curs() { ptr=NULL; length=0; index=0; } + ProcReadMsg_until_curs() { ptr=NULL; length=0; index=0; } }; -struct TraceInfoMsg_data_curs {// cursor +struct ProcStartMsg_cmd_curs {// cursor typedef char ChildType; u8 *ptr; int length; int index; - TraceInfoMsg_data_curs() { ptr=NULL; length=0; index=0; } + ProcStartMsg_cmd_curs() { ptr=NULL; length=0; index=0; } }; -struct TraceMsg_data_curs {// cursor - typedef u64 ChildType; +struct RemDirRecurseMsg_pathname_curs {// cursor + typedef char ChildType; u8 *ptr; int length; int index; - TraceMsg_data_curs() { ptr=NULL; length=0; index=0; } + RemDirRecurseMsg_pathname_curs() { ptr=NULL; length=0; index=0; } }; @@ -2242,7 +1886,7 @@ bool MsgHeaderMsgs_ReadStrptrMaybe(algo::strptr str, algo::ByteA // Construct a new ams::LogMsg in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. // func:ams...LogMsg_FmtByteAry -ams::LogMsg * LogMsg_FmtByteAry(algo::ByteAry &buf, const algo::strptr& logcat, algo::SchedTime tstamp, algo::aryptr text); +ams::LogMsg * LogMsg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc_id, algo::SchedTime tstamp, algo::aryptr logcat, algo::aryptr text); // Construct a new ams::MsgBlock in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. // func:ams...MsgBlock_FmtByteAry @@ -2252,26 +1896,6 @@ ams::MsgBlock * MsgBlock_FmtByteAry(algo::ByteAry &buf, u64 first_seqno, u3 // After constructing, advance BUF appropriate number of bytes forward // func:ams...MsgBlock_FmtMemptr ams::MsgBlock * MsgBlock_FmtMemptr(algo::memptr &buf, u64 first_seqno, u32 n_messages, u32 original_length, algo::aryptr messages); -// Construct a new ams::SeqmsgTrace in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:ams...SeqmsgTrace_FmtByteAry -ams::SeqmsgTrace * SeqmsgTrace_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc_id, u8 mode, ams::SeqmsgId seqmsg_id, u64 tsc, ams::MsgHeader* payload); -// Construct a new ams::Trace2Msg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:ams...Trace2Msg_FmtByteAry -ams::Trace2Msg * Trace2Msg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc, u8 trace, algo::UnTime tstamp, algo::aryptr data); -// Construct a new ams::TraceInfo2Msg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:ams...TraceInfo2Msg_FmtByteAry -ams::TraceInfo2Msg * TraceInfo2Msg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc, u8 trace, algo::UnTime tstamp, u8 part, algo::aryptr data); -// Construct a new ams::TraceInfoMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:ams...TraceInfoMsg_FmtByteAry -ams::TraceInfoMsg * TraceInfoMsg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc, algo::UnTime tstamp, u8 part, algo::aryptr data); -// Construct a new ams::TraceMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:ams...TraceMsg_FmtByteAry -ams::TraceMsg * TraceMsg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc, algo::UnTime tstamp, algo::aryptr data); // Construct a new ams::UdpFrame in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. // func:ams...UdpFrame_FmtByteAry @@ -2284,28 +1908,26 @@ ams::UdpFrame * UdpFrame_FmtMemptr(algo::memptr &buf, algo::UnTime timestam } // gen:ns_func // gen:ns_operators namespace algo { -inline algo::cstring &operator <<(algo::cstring &str, const ams::AlarmSyncMsg &row);// cfmt:ams.AlarmSyncMsg.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::ProcId &row);// cfmt:ams.ProcId.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::StreamType &row);// cfmt:ams.StreamType.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::StreamId &row);// cfmt:ams.StreamId.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::DfltStream &row);// cfmt:ams.DfltStream.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::DumpStreamTableMsg &row);// cfmt:ams.DumpStreamTableMsg.String inline algo::cstring &operator <<(algo::cstring &str, const ams::ExpectMsg &row);// cfmt:ams.ExpectMsg.String inline algo::cstring &operator <<(algo::cstring &str, const ams::FieldId &row);// cfmt:ams.FieldId.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::HeartbeatMsg &row);// cfmt:ams.HeartbeatMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::Proctype &row);// cfmt:ams.Proctype.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ProcId &row);// cfmt:ams.ProcId.String inline algo::cstring &operator <<(algo::cstring &str, const ams::InputLineMsg &row);// cfmt:ams.InputLineMsg.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::Member &row);// cfmt:ams.Member.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::LogMsg &row);// cfmt:ams.LogMsg.String inline algo::cstring &operator <<(algo::cstring &str, const ams::MsgBlock &row);// cfmt:ams.MsgBlock.String inline algo::cstring &operator <<(algo::cstring &str, const ams::MsgHeader &row);// cfmt:ams.MsgHeader.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::StreamPos &row);// cfmt:ams.StreamPos.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::OpenMsg &row);// cfmt:ams.OpenMsg.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::PrlogMsg &row);// cfmt:ams.PrlogMsg.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::ProcAddMsg &row);// cfmt:ams.ProcAddMsg.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::ProcRemoveMsg &row);// cfmt:ams.ProcRemoveMsg.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::SeqmsgId &row);// cfmt:ams.SeqmsgId.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::Seqmsg &row);// cfmt:ams.Seqmsg.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::SeqmsgTrace &row);// cfmt:ams.SeqmsgTrace.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::StreamFlags &row);// cfmt:ams.StreamFlags.String -inline algo::cstring &operator <<(algo::cstring &str, const ams::StreamHbMsg &row);// cfmt:ams.StreamHbMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ProcEofMsg &row);// cfmt:ams.ProcEofMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ProcKillMsg &row);// cfmt:ams.ProcKillMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ProcMsg &row);// cfmt:ams.ProcMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ProcReadMsg &row);// cfmt:ams.ProcReadMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ProcStartMsg &row);// cfmt:ams.ProcStartMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ProcStatusMsg &row);// cfmt:ams.ProcStatusMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ShmFlags &row);// cfmt:ams.ShmFlags.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::Shmtype &row);// cfmt:ams.Shmtype.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ShmId &row);// cfmt:ams.ShmId.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ShmemberFlags &row);// cfmt:ams.ShmemberFlags.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ShmemberId &row);// cfmt:ams.ShmemberId.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::ShmHbMsg &row);// cfmt:ams.ShmHbMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ams::Shmmsg &row);// cfmt:ams.Shmmsg.String inline algo::cstring &operator <<(algo::cstring &str, const ams::UdpFrame &row);// cfmt:ams.UdpFrame.String } diff --git a/include/gen/ams_gen.inl.h b/include/gen/ams_gen.inl.h index 723eb492..a6fb851c 100644 --- a/include/gen/ams_gen.inl.h +++ b/include/gen/ams_gen.inl.h @@ -27,414 +27,6 @@ #include "include/gen/ietf_gen.inl.h" //#pragma endinclude -// --- ams.AlarmSyncMsg.base.Castdown -// Check if ams::MsgHeader is an instance of AlarmSyncMsg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of AlarmSyncMsg. -// If not successful, quietly return NULL. -inline ams::AlarmSyncMsg* ams::AlarmSyncMsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (18); - cond &= i32(hdr.length) >= ssizeof(ams::AlarmSyncMsg); - return cond ? reinterpret_cast(&hdr) : NULL; -} - -// --- ams.AlarmSyncMsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::AlarmSyncMsg& parent) { - return reinterpret_cast(parent); -} - -// --- ams.AlarmSyncMsg..GetMsgLength -// Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::AlarmSyncMsg& parent) { - return i32(const_cast(parent).length); -} - -// --- ams.AlarmSyncMsg..GetMsgMemptr -// Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::AlarmSyncMsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); -} - -// --- ams.AlarmSyncMsg..Init -// Set all fields to initial values. -inline void ams::AlarmSyncMsg_Init(ams::AlarmSyncMsg& parent) { - parent.type = u32(18); - parent.length = u32(ssizeof(parent) + (0)); -} - -// --- ams.AlarmSyncMsg..Ctor -inline ams::AlarmSyncMsg::AlarmSyncMsg() { - ams::AlarmSyncMsg_Init(*this); -} - -// --- ams.AlarmSyncMsg..FieldwiseCtor -inline ams::AlarmSyncMsg::AlarmSyncMsg(algo::UnTime in_updated_after) - : updated_after(in_updated_after) - { - this->type = u32(18); - this->length = u32(ssizeof(*this) + (0)); -} - -// --- ams.ProcType.value.GetEnum -// Get value of field as enum type -inline ams_ProcTypeEnum ams::value_GetEnum(const ams::ProcType& parent) { - return ams_ProcTypeEnum(parent.value); -} - -// --- ams.ProcType.value.SetEnum -// Set value of field from enum type. -inline void ams::value_SetEnum(ams::ProcType& parent, ams_ProcTypeEnum rhs) { - parent.value = u8(rhs); -} - -// --- ams.ProcType..Hash -inline u32 ams::ProcType_Hash(u32 prev, ams::ProcType rhs) { - prev = u8_Hash(prev, rhs.value); - return prev; -} - -// --- ams.ProcType..EqOp -inline bool ams::ProcType::operator ==(const ams::ProcType &rhs) const { - return ams::ProcType_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- ams.ProcType..NeOp -inline bool ams::ProcType::operator !=(const ams::ProcType &rhs) const { - return !ams::ProcType_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- ams.ProcType..Cmp -inline i32 ams::ProcType_Cmp(ams::ProcType lhs, ams::ProcType rhs) { - i32 retval = 0; - retval = u8_Cmp(lhs.value, rhs.value); - return retval; -} - -// --- ams.ProcType..Init -// Set all fields to initial values. -inline void ams::ProcType_Init(ams::ProcType& parent) { - parent.value = u8(0); -} - -// --- ams.ProcType..Eq -inline bool ams::ProcType_Eq(ams::ProcType lhs, ams::ProcType rhs) { - bool retval = true; - retval = u8_Eq(lhs.value, rhs.value); - return retval; -} - -// --- ams.ProcType..EqEnum -// define enum comparison operator to avoid ambiguity -inline bool ams::ProcType::operator ==(ams_ProcTypeEnum rhs) const { - return ams_ProcTypeEnum(value) == rhs; -} - -// --- ams.ProcType..Ctor -inline ams::ProcType::ProcType() { - ams::ProcType_Init(*this); -} - -// --- ams.ProcType..FieldwiseCtor -inline ams::ProcType::ProcType(u8 in_value) - : value(in_value) - { -} - -// --- ams.ProcType..EnumCtor -inline ams::ProcType::ProcType(ams_ProcTypeEnum arg) { - this->value = u8(arg); -} - -// --- ams.ProcId..Hash -inline u32 ams::ProcId_Hash(u32 prev, ams::ProcId rhs) { - prev = ProcType_Hash(prev, rhs.proc_type); - prev = u8_Hash(prev, rhs.procidx); - return prev; -} - -// --- ams.ProcId..EqOp -inline bool ams::ProcId::operator ==(const ams::ProcId &rhs) const { - return ams::ProcId_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- ams.ProcId..NeOp -inline bool ams::ProcId::operator !=(const ams::ProcId &rhs) const { - return !ams::ProcId_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- ams.ProcId..Cmp -inline i32 ams::ProcId_Cmp(ams::ProcId lhs, ams::ProcId rhs) { - i32 retval = 0; - retval = ams::ProcType_Cmp(lhs.proc_type, rhs.proc_type); - if (retval != 0) { - return retval; - } - retval = u8_Cmp(lhs.procidx, rhs.procidx); - return retval; -} - -// --- ams.ProcId..Init -// Set all fields to initial values. -inline void ams::ProcId_Init(ams::ProcId& parent) { - parent.procidx = u8(0); -} - -// --- ams.ProcId..Eq -inline bool ams::ProcId_Eq(ams::ProcId lhs, ams::ProcId rhs) { - bool retval = true; - retval = ams::ProcType_Eq(lhs.proc_type, rhs.proc_type); - if (!retval) { - return false; - } - retval = u8_Eq(lhs.procidx, rhs.procidx); - return retval; -} - -// --- ams.ProcId..Ctor -inline ams::ProcId::ProcId() { - ams::ProcId_Init(*this); -} - -// --- ams.ProcId..FieldwiseCtor -inline ams::ProcId::ProcId(ams::ProcType in_proc_type, u8 in_procidx) - : proc_type(in_proc_type) - , procidx(in_procidx) - { -} - -// --- ams.StreamType.value.GetEnum -// Get value of field as enum type -inline ams_StreamTypeEnum ams::value_GetEnum(const ams::StreamType& parent) { - return ams_StreamTypeEnum(parent.value); -} - -// --- ams.StreamType.value.SetEnum -// Set value of field from enum type. -inline void ams::value_SetEnum(ams::StreamType& parent, ams_StreamTypeEnum rhs) { - parent.value = u8(rhs); -} - -// --- ams.StreamType..Hash -inline u32 ams::StreamType_Hash(u32 prev, ams::StreamType rhs) { - prev = u8_Hash(prev, rhs.value); - return prev; -} - -// --- ams.StreamType..EqOp -inline bool ams::StreamType::operator ==(const ams::StreamType &rhs) const { - return ams::StreamType_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- ams.StreamType..NeOp -inline bool ams::StreamType::operator !=(const ams::StreamType &rhs) const { - return !ams::StreamType_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- ams.StreamType..Cmp -inline i32 ams::StreamType_Cmp(ams::StreamType lhs, ams::StreamType rhs) { - i32 retval = 0; - retval = u8_Cmp(lhs.value, rhs.value); - return retval; -} - -// --- ams.StreamType..Init -// Set all fields to initial values. -inline void ams::StreamType_Init(ams::StreamType& parent) { - parent.value = u8(0); -} - -// --- ams.StreamType..Eq -inline bool ams::StreamType_Eq(ams::StreamType lhs, ams::StreamType rhs) { - bool retval = true; - retval = u8_Eq(lhs.value, rhs.value); - return retval; -} - -// --- ams.StreamType..EqEnum -// define enum comparison operator to avoid ambiguity -inline bool ams::StreamType::operator ==(ams_StreamTypeEnum rhs) const { - return ams_StreamTypeEnum(value) == rhs; -} - -// --- ams.StreamType..Ctor -inline ams::StreamType::StreamType() { - ams::StreamType_Init(*this); -} - -// --- ams.StreamType..FieldwiseCtor -inline ams::StreamType::StreamType(u8 in_value) - : value(in_value) - { -} - -// --- ams.StreamType..EnumCtor -inline ams::StreamType::StreamType(ams_StreamTypeEnum arg) { - this->value = u8(arg); -} - -// --- ams.StreamId..Hash -inline u32 ams::StreamId_Hash(u32 prev, ams::StreamId rhs) { - prev = ProcId_Hash(prev, rhs.proc_id); - prev = StreamType_Hash(prev, rhs.stream_type); - prev = u8_Hash(prev, rhs.streamidx); - return prev; -} - -// --- ams.StreamId..EqOp -inline bool ams::StreamId::operator ==(const ams::StreamId &rhs) const { - return ams::StreamId_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- ams.StreamId..NeOp -inline bool ams::StreamId::operator !=(const ams::StreamId &rhs) const { - return !ams::StreamId_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- ams.StreamId..Cmp -inline i32 ams::StreamId_Cmp(ams::StreamId lhs, ams::StreamId rhs) { - i32 retval = 0; - retval = ams::ProcId_Cmp(lhs.proc_id, rhs.proc_id); - if (retval != 0) { - return retval; - } - retval = ams::StreamType_Cmp(lhs.stream_type, rhs.stream_type); - if (retval != 0) { - return retval; - } - retval = u8_Cmp(lhs.streamidx, rhs.streamidx); - return retval; -} - -// --- ams.StreamId..Init -// Set all fields to initial values. -inline void ams::StreamId_Init(ams::StreamId& parent) { - parent.streamidx = u8(0); -} - -// --- ams.StreamId..Eq -inline bool ams::StreamId_Eq(ams::StreamId lhs, ams::StreamId rhs) { - bool retval = true; - retval = ams::ProcId_Eq(lhs.proc_id, rhs.proc_id); - if (!retval) { - return false; - } - retval = ams::StreamType_Eq(lhs.stream_type, rhs.stream_type); - if (!retval) { - return false; - } - retval = u8_Eq(lhs.streamidx, rhs.streamidx); - return retval; -} - -// --- ams.StreamId..Ctor -inline ams::StreamId::StreamId() { - ams::StreamId_Init(*this); -} - -// --- ams.StreamId..FieldwiseCtor -inline ams::StreamId::StreamId(ams::ProcId in_proc_id, ams::StreamType in_stream_type, u8 in_streamidx) - : proc_id(in_proc_id) - , stream_type(in_stream_type) - , streamidx(in_streamidx) - { -} - -// --- ams.DfltStream.base.Castdown -// Check if ams::MsgHeader is an instance of DfltStream by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of DfltStream. -// If not successful, quietly return NULL. -inline ams::DfltStream* ams::DfltStream_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (21); - cond &= i32(hdr.length) >= ssizeof(ams::DfltStream); - return cond ? reinterpret_cast(&hdr) : NULL; -} - -// --- ams.DfltStream.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::DfltStream& parent) { - return reinterpret_cast(parent); -} - -// --- ams.DfltStream..GetMsgLength -// Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::DfltStream& parent) { - return i32(const_cast(parent).length); -} - -// --- ams.DfltStream..GetMsgMemptr -// Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::DfltStream& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); -} - -// --- ams.DfltStream..Init -// Set all fields to initial values. -inline void ams::DfltStream_Init(ams::DfltStream& parent) { - parent.type = u32(21); - parent.length = u32(ssizeof(parent) + (0)); -} - -// --- ams.DfltStream..Ctor -inline ams::DfltStream::DfltStream() { - ams::DfltStream_Init(*this); -} - -// --- ams.DfltStream..FieldwiseCtor -inline ams::DfltStream::DfltStream(ams::StreamId in_stream_id) - : stream_id(in_stream_id) - { - this->type = u32(21); - this->length = u32(ssizeof(*this) + (0)); -} - -// --- ams.DumpStreamTableMsg.base.Castdown -// Check if ams::MsgHeader is an instance of DumpStreamTableMsg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of DumpStreamTableMsg. -// If not successful, quietly return NULL. -inline ams::DumpStreamTableMsg* ams::DumpStreamTableMsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (12); - cond &= i32(hdr.length) >= ssizeof(ams::DumpStreamTableMsg); - return cond ? reinterpret_cast(&hdr) : NULL; -} - -// --- ams.DumpStreamTableMsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::DumpStreamTableMsg& parent) { - return reinterpret_cast(parent); -} - -// --- ams.DumpStreamTableMsg..GetMsgLength -// Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::DumpStreamTableMsg& parent) { - return i32(const_cast(parent).length); -} - -// --- ams.DumpStreamTableMsg..GetMsgMemptr -// Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::DumpStreamTableMsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); -} - -// --- ams.DumpStreamTableMsg..Init -// Set all fields to initial values. -inline void ams::DumpStreamTableMsg_Init(ams::DumpStreamTableMsg& parent) { - parent.type = u32(12); - parent.length = u32(ssizeof(parent) + (0)); -} - -// --- ams.DumpStreamTableMsg..Ctor -inline ams::DumpStreamTableMsg::DumpStreamTableMsg() { - ams::DumpStreamTableMsg_Init(*this); -} - -// --- ams.DumpStreamTableMsg..FieldwiseCtor -inline ams::DumpStreamTableMsg::DumpStreamTableMsg(ams::ProcId in_proc_id) - : proc_id(in_proc_id) - { - this->type = u32(12); - this->length = u32(ssizeof(*this) + (0)); -} - // --- ams.ExpectMsg.base.Castdown // Check if ams::MsgHeader is an instance of ExpectMsg by checking the type field // If it is, return the pointer of target type. @@ -461,7 +53,7 @@ inline u32 ams::text_N(const ams::ExpectMsg& parent) { // --- ams.ExpectMsg.text_curs.Reset inline void ams::ExpectMsg_text_curs_Reset(ExpectMsg_text_curs &curs, ams::ExpectMsg &parent) { - curs.ptr = (u8*)&parent + sizeof(ams::ExpectMsg); + curs.ptr = (u8*)text_Addr(parent); curs.length = i32(parent.length) - sizeof(ams::ExpectMsg); curs.index = 0; } @@ -551,52 +143,169 @@ inline ams::FieldId::FieldId(ams_FieldIdEnum arg) { this->value = i32(arg); } -// --- ams.HeartbeatMsg.base.Castdown -// Check if ams::MsgHeader is an instance of HeartbeatMsg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of HeartbeatMsg. -// If not successful, quietly return NULL. -inline ams::HeartbeatMsg* ams::HeartbeatMsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (16); - cond &= i32(hdr.length) >= ssizeof(ams::HeartbeatMsg); - return cond ? reinterpret_cast(&hdr) : NULL; +// --- ams.Proctype.value.GetEnum +// Get value of field as enum type +inline ams_ProctypeEnum ams::value_GetEnum(const ams::Proctype& parent) { + return ams_ProctypeEnum(parent.value); } -// --- ams.HeartbeatMsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::HeartbeatMsg& parent) { - return reinterpret_cast(parent); +// --- ams.Proctype.value.SetEnum +// Set value of field from enum type. +inline void ams::value_SetEnum(ams::Proctype& parent, ams_ProctypeEnum rhs) { + parent.value = u8(rhs); } -// --- ams.HeartbeatMsg..GetMsgLength -// Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::HeartbeatMsg& parent) { - return i32(const_cast(parent).length); +// --- ams.Proctype..Hash +inline u32 ams::Proctype_Hash(u32 prev, ams::Proctype rhs) { + prev = u8_Hash(prev, rhs.value); + return prev; } -// --- ams.HeartbeatMsg..GetMsgMemptr -// Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::HeartbeatMsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +// --- ams.Proctype..EqOp +inline bool ams::Proctype::operator ==(const ams::Proctype &rhs) const { + return ams::Proctype_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- ams.Proctype..NeOp +inline bool ams::Proctype::operator !=(const ams::Proctype &rhs) const { + return !ams::Proctype_Eq(const_cast(*this),const_cast(rhs)); } -// --- ams.HeartbeatMsg..Init +// --- ams.Proctype..Cmp +inline i32 ams::Proctype_Cmp(ams::Proctype lhs, ams::Proctype rhs) { + i32 retval = 0; + retval = u8_Cmp(lhs.value, rhs.value); + return retval; +} + +// --- ams.Proctype..Init // Set all fields to initial values. -inline void ams::HeartbeatMsg_Init(ams::HeartbeatMsg& parent) { - parent.type = u32(16); - parent.length = u32(ssizeof(parent) + (0)); +inline void ams::Proctype_Init(ams::Proctype& parent) { + parent.value = u8(0); } -// --- ams.HeartbeatMsg..Ctor -inline ams::HeartbeatMsg::HeartbeatMsg() { - ams::HeartbeatMsg_Init(*this); +// --- ams.Proctype..Eq +inline bool ams::Proctype_Eq(ams::Proctype lhs, ams::Proctype rhs) { + bool retval = true; + retval = u8_Eq(lhs.value, rhs.value); + return retval; +} + +// --- ams.Proctype..EqEnum +// define enum comparison operator to avoid ambiguity +inline bool ams::Proctype::operator ==(ams_ProctypeEnum rhs) const { + return ams_ProctypeEnum(value) == rhs; } -// --- ams.HeartbeatMsg..FieldwiseCtor -inline ams::HeartbeatMsg::HeartbeatMsg(algo::UnTime in_time) - : time(in_time) +// --- ams.Proctype..Ctor +inline ams::Proctype::Proctype() { + ams::Proctype_Init(*this); +} + +// --- ams.Proctype..FieldwiseCtor +inline ams::Proctype::Proctype(u8 in_value) + : value(in_value) + { +} + +// --- ams.Proctype..EnumCtor +inline ams::Proctype::Proctype(ams_ProctypeEnum arg) { + this->value = u8(arg); +} + +// --- ams.ProcId.proctype.Get +// Retrieve bitfield from value of field value +// 8 bits starting at bit 24. +inline ams::Proctype ams::proctype_Get(const ams::ProcId& parent) { + return ams::Proctype((parent.value >> 24) & 0xff); +} + +// --- ams.ProcId.proctype.Set +// Set bitfield in value of field 'value' +// 8 bits starting at bit 24. +inline void ams::proctype_Set(ams::ProcId& parent, ams::Proctype rhs) { + u32 t1 = u32(0xff) << 24; + u32 t2 = (u32(rhs.value) & 0xff) << 24; + parent.value = u32((parent.value & ~t1) | t2); +} + +// --- ams.ProcId.nodeidx.Get +// Retrieve bitfield from value of field value +// 8 bits starting at bit 8. +inline u8 ams::nodeidx_Get(const ams::ProcId& parent) { + return u8((parent.value >> 8) & 0xff); +} + +// --- ams.ProcId.nodeidx.Set +// Set bitfield in value of field 'value' +// 8 bits starting at bit 8. +inline void ams::nodeidx_Set(ams::ProcId& parent, u8 rhs) { + u32 t1 = u32(0xff) << 8; + u32 t2 = (u32(rhs) & 0xff) << 8; + parent.value = u32((parent.value & ~t1) | t2); +} + +// --- ams.ProcId.procidx.Get +// Retrieve bitfield from value of field value +// 4 bits starting at bit 0. +inline u8 ams::procidx_Get(const ams::ProcId& parent) { + return u8((parent.value >> 0) & 0x0f); +} + +// --- ams.ProcId.procidx.Set +// Set bitfield in value of field 'value' +// 4 bits starting at bit 0. +inline void ams::procidx_Set(ams::ProcId& parent, u8 rhs) { + u32 t1 = u32(0x0f) << 0; + u32 t2 = (u32(rhs) & 0x0f) << 0; + parent.value = u32((parent.value & ~t1) | t2); +} + +// --- ams.ProcId..Hash +inline u32 ams::ProcId_Hash(u32 prev, ams::ProcId rhs) { + prev = u32_Hash(prev, rhs.value); + return prev; +} + +// --- ams.ProcId..EqOp +inline bool ams::ProcId::operator ==(const ams::ProcId &rhs) const { + return ams::ProcId_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- ams.ProcId..NeOp +inline bool ams::ProcId::operator !=(const ams::ProcId &rhs) const { + return !ams::ProcId_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- ams.ProcId..Cmp +inline i32 ams::ProcId_Cmp(ams::ProcId lhs, ams::ProcId rhs) { + i32 retval = 0; + retval = u32_Cmp(lhs.value, rhs.value); + return retval; +} + +// --- ams.ProcId..Init +// Set all fields to initial values. +inline void ams::ProcId_Init(ams::ProcId& parent) { + parent.value = u32(0); +} + +// --- ams.ProcId..Eq +inline bool ams::ProcId_Eq(ams::ProcId lhs, ams::ProcId rhs) { + bool retval = true; + retval = u32_Eq(lhs.value, rhs.value); + return retval; +} + +// --- ams.ProcId..Ctor +inline ams::ProcId::ProcId() { + ams::ProcId_Init(*this); +} + +// --- ams.ProcId..FieldwiseCtor +inline ams::ProcId::ProcId(u32 in_value) + : value(in_value) { - this->type = u32(16); - this->length = u32(ssizeof(*this) + (0)); } // --- ams.InputLineMsg.base.Castdown @@ -625,7 +334,7 @@ inline u32 ams::payload_N(const ams::InputLineMsg& parent) { // --- ams.InputLineMsg.payload_curs.Reset inline void ams::InputLineMsg_payload_curs_Reset(InputLineMsg_payload_curs &curs, ams::InputLineMsg &parent) { - curs.ptr = (u8*)&parent + sizeof(ams::InputLineMsg); + curs.ptr = (u8*)payload_Addr(parent); curs.length = i32(parent.length) - sizeof(ams::InputLineMsg); curs.index = 0; } @@ -676,6 +385,14 @@ inline ams::InputLineMsg::InputLineMsg() { ams::InputLineMsg_Init(*this); } +// --- ams.InputLineMsg..FieldwiseCtor +inline ams::InputLineMsg::InputLineMsg(ams::ProcId in_proc_id) + : proc_id(in_proc_id) + { + this->type = u32(22); + this->length = u32(ssizeof(*this) + (0)); +} + // --- ams.LogMsg.base.Castdown // Check if ams::MsgHeader is an instance of LogMsg by checking the type field // If it is, return the pointer of target type. @@ -692,18 +409,53 @@ inline ams::MsgHeader& ams::Castbase(ams::LogMsg& parent) { return reinterpret_cast(parent); } +// --- ams.LogMsg.logcat.N +// Return number of elements in varlen field +inline u32 ams::logcat_N(const ams::LogMsg& parent) { + return u32((parent.logcat_end) / sizeof(char)); +} + // --- ams.LogMsg.text.N // Return number of elements in varlen field inline u32 ams::text_N(const ams::LogMsg& parent) { u32 length = i32(((ams::LogMsg&)parent).length); - u32 extra_bytes = u32_Max(length,sizeof(ams::LogMsg)) - sizeof(ams::LogMsg); // avoid unsigned subtraction underflow + u32 extra_bytes = u32_Max(length,sizeof(ams::LogMsg)) - sizeof(ams::LogMsg) - parent.logcat_end; // avoid unsigned subtraction underflow return u32(extra_bytes / sizeof(char)); } +// --- ams.LogMsg.logcat_curs.Reset +inline void ams::LogMsg_logcat_curs_Reset(LogMsg_logcat_curs &curs, ams::LogMsg &parent) { + curs.ptr = (u8*)logcat_Addr(parent); + curs.length = parent.logcat_end; + curs.index = 0; +} + +// --- ams.LogMsg.logcat_curs.ValidQ +// cursor points to valid item +inline bool ams::LogMsg_logcat_curs_ValidQ(LogMsg_logcat_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- ams.LogMsg.logcat_curs.Next +// proceed to next item +inline void ams::LogMsg_logcat_curs_Next(LogMsg_logcat_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- ams.LogMsg.logcat_curs.Access +// item access +inline char& ams::LogMsg_logcat_curs_Access(LogMsg_logcat_curs &curs) { + return *(char*)curs.ptr; +} + // --- ams.LogMsg.text_curs.Reset inline void ams::LogMsg_text_curs_Reset(LogMsg_text_curs &curs, ams::LogMsg &parent) { - curs.ptr = (u8*)&parent + sizeof(ams::LogMsg); - curs.length = i32(parent.length) - sizeof(ams::LogMsg); + curs.ptr = (u8*)text_Addr(parent); + curs.length = i32(parent.length) - parent.logcat_end - sizeof(ams::LogMsg); curs.index = 0; } @@ -746,6 +498,7 @@ inline algo::memptr ams::GetMsgMemptr(const ams::LogMsg& row) { inline void ams::LogMsg_Init(ams::LogMsg& parent) { parent.type = u32(6); parent.length = u32(ssizeof(parent) + (0)); + parent.logcat_end = u32(0); // logcat: initialize } // --- ams.LogMsg..Ctor @@ -754,93 +507,14 @@ inline ams::LogMsg::LogMsg() { } // --- ams.LogMsg..FieldwiseCtor -inline ams::LogMsg::LogMsg(const algo::strptr& in_logcat, algo::SchedTime in_tstamp) - : logcat(in_logcat) +inline ams::LogMsg::LogMsg(ams::ProcId in_proc_id, algo::SchedTime in_tstamp) + : proc_id(in_proc_id) , tstamp(in_tstamp) { this->type = u32(6); this->length = u32(ssizeof(*this) + (0)); } -// --- ams.Member.mode.GetEnum -// Get value of field as enum type -inline ams_Member_mode_Enum ams::mode_GetEnum(const ams::Member& parent) { - return ams_Member_mode_Enum(parent.mode); -} - -// --- ams.Member.mode.SetEnum -// Set value of field from enum type. -inline void ams::mode_SetEnum(ams::Member& parent, ams_Member_mode_Enum rhs) { - parent.mode = u8(rhs); -} - -// --- ams.Member..Hash -inline u32 ams::Member_Hash(u32 prev, ams::Member rhs) { - prev = ProcId_Hash(prev, rhs.proc_id); - prev = StreamId_Hash(prev, rhs.stream_id); - prev = u8_Hash(prev, rhs.mode); - return prev; -} - -// --- ams.Member..EqOp -inline bool ams::Member::operator ==(const ams::Member &rhs) const { - return ams::Member_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- ams.Member..NeOp -inline bool ams::Member::operator !=(const ams::Member &rhs) const { - return !ams::Member_Eq(const_cast(*this),const_cast(rhs)); -} - -// --- ams.Member..Cmp -inline i32 ams::Member_Cmp(ams::Member lhs, ams::Member rhs) { - i32 retval = 0; - retval = ams::ProcId_Cmp(lhs.proc_id, rhs.proc_id); - if (retval != 0) { - return retval; - } - retval = ams::StreamId_Cmp(lhs.stream_id, rhs.stream_id); - if (retval != 0) { - return retval; - } - retval = u8_Cmp(lhs.mode, rhs.mode); - return retval; -} - -// --- ams.Member..Init -// Set all fields to initial values. -inline void ams::Member_Init(ams::Member& parent) { - parent.mode = u8(0); -} - -// --- ams.Member..Eq -inline bool ams::Member_Eq(ams::Member lhs, ams::Member rhs) { - bool retval = true; - retval = ams::ProcId_Eq(lhs.proc_id, rhs.proc_id); - if (!retval) { - return false; - } - retval = ams::StreamId_Eq(lhs.stream_id, rhs.stream_id); - if (!retval) { - return false; - } - retval = u8_Eq(lhs.mode, rhs.mode); - return retval; -} - -// --- ams.Member..Ctor -inline ams::Member::Member() { - ams::Member_Init(*this); -} - -// --- ams.Member..FieldwiseCtor -inline ams::Member::Member(ams::ProcId in_proc_id, ams::StreamId in_stream_id, u8 in_mode) - : proc_id(in_proc_id) - , stream_id(in_stream_id) - , mode(in_mode) - { -} - // --- ams.MsgBlock.header.Castdown // Check if ams::MsgHeader is an instance of MsgBlock by checking the type field // If it is, return the pointer of target type. @@ -867,7 +541,7 @@ inline u32 ams::messages_N(const ams::MsgBlock& parent) { // --- ams.MsgBlock.messages_curs.Reset inline void ams::MsgBlock_messages_curs_Reset(MsgBlock_messages_curs &curs, ams::MsgBlock &parent) { - curs.ptr = (u8*)&parent + sizeof(ams::MsgBlock); + curs.ptr = (u8*)messages_Addr(parent); curs.length = i32(parent.length) - sizeof(ams::MsgBlock); curs.index = 0; } @@ -923,14 +597,14 @@ inline ams::MsgBlock::MsgBlock() { // --- ams.MsgHeader.type.GetEnum // Get value of field as enum type -inline ams_MsgHeader_type_Enum ams::type_GetEnum(const ams::MsgHeader& data) { - return ams_MsgHeader_type_Enum(data.type); +inline ams_MsgHeader_type_Enum ams::type_GetEnum(const ams::MsgHeader& payload) { + return ams_MsgHeader_type_Enum(payload.type); } // --- ams.MsgHeader.type.SetEnum // Set value of field from enum type. -inline void ams::type_SetEnum(ams::MsgHeader& data, ams_MsgHeader_type_Enum rhs) { - data.type = u32(rhs); +inline void ams::type_SetEnum(ams::MsgHeader& payload, ams_MsgHeader_type_Enum rhs) { + payload.type = u32(rhs); } // --- ams.MsgHeader..GetMsgLength @@ -947,9 +621,9 @@ inline algo::memptr ams::GetMsgMemptr(const ams::MsgHeader& row) { // --- ams.MsgHeader..Init // Set all fields to initial values. -inline void ams::MsgHeader_Init(ams::MsgHeader& data) { - data.type = u32(0); - data.length = u32(0); +inline void ams::MsgHeader_Init(ams::MsgHeader& payload) { + payload.type = u32(0); + payload.length = u32(0); } // --- ams.MsgHeader..Ctor @@ -1061,968 +735,977 @@ inline ams::MsgHeader_curs::MsgHeader_curs() { ams::MsgHeader_curs_Init(*this); } -// --- ams.StreamPos..Init -// Set all fields to initial values. -inline void ams::StreamPos_Init(ams::StreamPos& parent) { - parent.seq = u64(1); - parent.off = u64(0); +// --- ams.ProcEofMsg.base.Castdown +// Check if ams::MsgHeader is an instance of ProcEofMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of ProcEofMsg. +// If not successful, quietly return NULL. +inline ams::ProcEofMsg* ams::ProcEofMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (703); + cond &= i32(hdr.length) >= ssizeof(ams::ProcEofMsg); + return cond ? reinterpret_cast(&hdr) : NULL; } -// --- ams.StreamPos..Ctor -inline ams::StreamPos::StreamPos() { - ams::StreamPos_Init(*this); +// --- ams.ProcEofMsg.base.Castbase +inline ams::MsgHeader& ams::Castbase(ams::ProcEofMsg& parent) { + return reinterpret_cast(parent); } -// --- ams.StreamPos..FieldwiseCtor -inline ams::StreamPos::StreamPos(u64 in_seq, u64 in_off) - : seq(in_seq) - , off(in_off) - { +// --- ams.ProcEofMsg..GetMsgLength +// Message length (uses length field) +inline i32 ams::GetMsgLength(const ams::ProcEofMsg& parent) { + return i32(const_cast(parent).length); +} + +// --- ams.ProcEofMsg..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr ams::GetMsgMemptr(const ams::ProcEofMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); +} + +// --- ams.ProcEofMsg..Init +// Set all fields to initial values. +inline void ams::ProcEofMsg_Init(ams::ProcEofMsg& parent) { + parent.type = u32(703); + parent.length = u32(ssizeof(parent) + (0)); +} + +// --- ams.ProcEofMsg..Ctor +inline ams::ProcEofMsg::ProcEofMsg() { + ams::ProcEofMsg_Init(*this); } -// --- ams.OpenMsg.base.Castdown -// Check if ams::MsgHeader is an instance of OpenMsg by checking the type field +// --- ams.ProcKillMsg.base.Castdown +// Check if ams::MsgHeader is an instance of ProcKillMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of OpenMsg. +// Additionally, check if the length field permits valid instance of ProcKillMsg. // If not successful, quietly return NULL. -inline ams::OpenMsg* ams::OpenMsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (7); - cond &= i32(hdr.length) >= ssizeof(ams::OpenMsg); - return cond ? reinterpret_cast(&hdr) : NULL; +inline ams::ProcKillMsg* ams::ProcKillMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (704); + cond &= i32(hdr.length) >= ssizeof(ams::ProcKillMsg); + return cond ? reinterpret_cast(&hdr) : NULL; } -// --- ams.OpenMsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::OpenMsg& parent) { +// --- ams.ProcKillMsg.base.Castbase +inline ams::MsgHeader& ams::Castbase(ams::ProcKillMsg& parent) { return reinterpret_cast(parent); } -// --- ams.OpenMsg..GetMsgLength +// --- ams.ProcKillMsg..GetMsgLength // Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::OpenMsg& parent) { - return i32(const_cast(parent).length); +inline i32 ams::GetMsgLength(const ams::ProcKillMsg& parent) { + return i32(const_cast(parent).length); } -// --- ams.OpenMsg..GetMsgMemptr +// --- ams.ProcKillMsg..GetMsgMemptr // Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::OpenMsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +inline algo::memptr ams::GetMsgMemptr(const ams::ProcKillMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); } -// --- ams.OpenMsg..Init +// --- ams.ProcKillMsg..Init // Set all fields to initial values. -inline void ams::OpenMsg_Init(ams::OpenMsg& parent) { - parent.type = u32(7); +inline void ams::ProcKillMsg_Init(ams::ProcKillMsg& parent) { + parent.type = u32(704); parent.length = u32(ssizeof(parent) + (0)); + parent.signal = i32(15); } -// --- ams.OpenMsg..Ctor -inline ams::OpenMsg::OpenMsg() { - ams::OpenMsg_Init(*this); +// --- ams.ProcKillMsg..Ctor +inline ams::ProcKillMsg::ProcKillMsg() { + ams::ProcKillMsg_Init(*this); } -// --- ams.OpenMsg..FieldwiseCtor -inline ams::OpenMsg::OpenMsg(ams::Member in_member, ams::StreamPos in_pos) - : member(in_member) - , pos(in_pos) - { - this->type = u32(7); - this->length = u32(ssizeof(*this) + (0)); -} - -// --- ams.PrlogMsg.base.Castdown -// Check if ams::MsgHeader is an instance of PrlogMsg by checking the type field +// --- ams.ProcMsg.base.Castdown +// Check if ams::MsgHeader is an instance of ProcMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of PrlogMsg. +// Additionally, check if the length field permits valid instance of ProcMsg. // If not successful, quietly return NULL. -inline ams::PrlogMsg* ams::PrlogMsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (229); - cond &= i32(hdr.length) >= ssizeof(ams::PrlogMsg); - return cond ? reinterpret_cast(&hdr) : NULL; +inline ams::ProcMsg* ams::ProcMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (701); + cond &= i32(hdr.length) >= ssizeof(ams::ProcMsg); + return cond ? reinterpret_cast(&hdr) : NULL; } -// --- ams.PrlogMsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::PrlogMsg& parent) { +// --- ams.ProcMsg.base.Castbase +inline ams::MsgHeader& ams::Castbase(ams::ProcMsg& parent) { return reinterpret_cast(parent); } -// --- ams.PrlogMsg.data.Get -// Return pointer to optional last element (NULL if none) -// The parent's length field is assumed to have already been checked for validity. -// If the parent's lengthis too short to allow a full-sized data, return NULL. -// Since the last element is itself variable-length, two more checks are applied: -// If data's length field value is too short, return NULL. -// If data's length field value extends past parent's allowed length, return NULL. -inline ams::MsgHeader* ams::data_Get(ams::PrlogMsg& parent) { - i32 totlen = i32(parent.length); - u8 *end = (u8*)&parent + sizeof(ams::PrlogMsg); - ams::MsgHeader *ptr = (ams::MsgHeader*)end; - bool exists = ssizeof(ams::PrlogMsg) + sizeof_ams_MsgHeader <= totlen; - exists = exists && i32((*ptr).length) >= sizeof_ams_MsgHeader && ssizeof(ams::PrlogMsg) + i32((*ptr).length) <= totlen; - return exists ? ptr : NULL; +// --- ams.ProcMsg.payload.N +// Return number of elements in varlen field +inline u32 ams::payload_N(const ams::ProcMsg& parent) { + u32 length = i32(((ams::ProcMsg&)parent).length); + u32 extra_bytes = u32_Max(length,sizeof(ams::ProcMsg)) - sizeof(ams::ProcMsg); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(char)); +} + +// --- ams.ProcMsg.payload_curs.Reset +inline void ams::ProcMsg_payload_curs_Reset(ProcMsg_payload_curs &curs, ams::ProcMsg &parent) { + curs.ptr = (u8*)payload_Addr(parent); + curs.length = i32(parent.length) - sizeof(ams::ProcMsg); + curs.index = 0; +} + +// --- ams.ProcMsg.payload_curs.ValidQ +// cursor points to valid item +inline bool ams::ProcMsg_payload_curs_ValidQ(ProcMsg_payload_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- ams.ProcMsg.payload_curs.Next +// proceed to next item +inline void ams::ProcMsg_payload_curs_Next(ProcMsg_payload_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- ams.ProcMsg.payload_curs.Access +// item access +inline char& ams::ProcMsg_payload_curs_Access(ProcMsg_payload_curs &curs) { + return *(char*)curs.ptr; } -// --- ams.PrlogMsg..GetMsgLength +// --- ams.ProcMsg..GetMsgLength // Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::PrlogMsg& parent) { - return i32(const_cast(parent).length); +inline i32 ams::GetMsgLength(const ams::ProcMsg& parent) { + return i32(const_cast(parent).length); } -// --- ams.PrlogMsg..GetMsgMemptr +// --- ams.ProcMsg..GetMsgMemptr // Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::PrlogMsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +inline algo::memptr ams::GetMsgMemptr(const ams::ProcMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); } -// --- ams.PrlogMsg..Init +// --- ams.ProcMsg..Init // Set all fields to initial values. -inline void ams::PrlogMsg_Init(ams::PrlogMsg& parent) { - parent.type = u32(229); +inline void ams::ProcMsg_Init(ams::ProcMsg& parent) { + parent.type = u32(701); parent.length = u32(ssizeof(parent) + (0)); } -// --- ams.PrlogMsg..Ctor -inline ams::PrlogMsg::PrlogMsg() { - ams::PrlogMsg_Init(*this); +// --- ams.ProcMsg..Ctor +inline ams::ProcMsg::ProcMsg() { + ams::ProcMsg_Init(*this); } -// --- ams.ProcAddMsg.base.Castdown -// Check if ams::MsgHeader is an instance of ProcAddMsg by checking the type field +// --- ams.ProcReadMsg.base.Castdown +// Check if ams::MsgHeader is an instance of ProcReadMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of ProcAddMsg. +// Additionally, check if the length field permits valid instance of ProcReadMsg. // If not successful, quietly return NULL. -inline ams::ProcAddMsg* ams::ProcAddMsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (4); - cond &= i32(hdr.length) >= ssizeof(ams::ProcAddMsg); - return cond ? reinterpret_cast(&hdr) : NULL; +inline ams::ProcReadMsg* ams::ProcReadMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (702); + cond &= i32(hdr.length) >= ssizeof(ams::ProcReadMsg); + return cond ? reinterpret_cast(&hdr) : NULL; } -// --- ams.ProcAddMsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::ProcAddMsg& parent) { +// --- ams.ProcReadMsg.base.Castbase +inline ams::MsgHeader& ams::Castbase(ams::ProcReadMsg& parent) { return reinterpret_cast(parent); } -// --- ams.ProcAddMsg..GetMsgLength +// --- ams.ProcReadMsg.until.N +// Return number of elements in varlen field +inline u32 ams::until_N(const ams::ProcReadMsg& parent) { + u32 length = i32(((ams::ProcReadMsg&)parent).length); + u32 extra_bytes = u32_Max(length,sizeof(ams::ProcReadMsg)) - sizeof(ams::ProcReadMsg); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(char)); +} + +// --- ams.ProcReadMsg.until_curs.Reset +inline void ams::ProcReadMsg_until_curs_Reset(ProcReadMsg_until_curs &curs, ams::ProcReadMsg &parent) { + curs.ptr = (u8*)until_Addr(parent); + curs.length = i32(parent.length) - sizeof(ams::ProcReadMsg); + curs.index = 0; +} + +// --- ams.ProcReadMsg.until_curs.ValidQ +// cursor points to valid item +inline bool ams::ProcReadMsg_until_curs_ValidQ(ProcReadMsg_until_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- ams.ProcReadMsg.until_curs.Next +// proceed to next item +inline void ams::ProcReadMsg_until_curs_Next(ProcReadMsg_until_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- ams.ProcReadMsg.until_curs.Access +// item access +inline char& ams::ProcReadMsg_until_curs_Access(ProcReadMsg_until_curs &curs) { + return *(char*)curs.ptr; +} + +// --- ams.ProcReadMsg..GetMsgLength // Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::ProcAddMsg& parent) { - return i32(const_cast(parent).length); +inline i32 ams::GetMsgLength(const ams::ProcReadMsg& parent) { + return i32(const_cast(parent).length); } -// --- ams.ProcAddMsg..GetMsgMemptr +// --- ams.ProcReadMsg..GetMsgMemptr // Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::ProcAddMsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +inline algo::memptr ams::GetMsgMemptr(const ams::ProcReadMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); } -// --- ams.ProcAddMsg..Init +// --- ams.ProcReadMsg..Init // Set all fields to initial values. -inline void ams::ProcAddMsg_Init(ams::ProcAddMsg& parent) { - parent.type = u32(4); +inline void ams::ProcReadMsg_Init(ams::ProcReadMsg& parent) { + parent.type = u32(702); parent.length = u32(ssizeof(parent) + (0)); } -// --- ams.ProcAddMsg..Ctor -inline ams::ProcAddMsg::ProcAddMsg() { - ams::ProcAddMsg_Init(*this); -} - -// --- ams.ProcAddMsg..FieldwiseCtor -inline ams::ProcAddMsg::ProcAddMsg(ams::ProcId in_proc_id) - : proc_id(in_proc_id) - { - this->type = u32(4); - this->length = u32(ssizeof(*this) + (0)); +// --- ams.ProcReadMsg..Ctor +inline ams::ProcReadMsg::ProcReadMsg() { + ams::ProcReadMsg_Init(*this); } -// --- ams.ProcRemoveMsg.base.Castdown -// Check if ams::MsgHeader is an instance of ProcRemoveMsg by checking the type field +// --- ams.ProcStartMsg.base.Castdown +// Check if ams::MsgHeader is an instance of ProcStartMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of ProcRemoveMsg. +// Additionally, check if the length field permits valid instance of ProcStartMsg. // If not successful, quietly return NULL. -inline ams::ProcRemoveMsg* ams::ProcRemoveMsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (5); - cond &= i32(hdr.length) >= ssizeof(ams::ProcRemoveMsg); - return cond ? reinterpret_cast(&hdr) : NULL; +inline ams::ProcStartMsg* ams::ProcStartMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (700); + cond &= i32(hdr.length) >= ssizeof(ams::ProcStartMsg); + return cond ? reinterpret_cast(&hdr) : NULL; } -// --- ams.ProcRemoveMsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::ProcRemoveMsg& parent) { +// --- ams.ProcStartMsg.base.Castbase +inline ams::MsgHeader& ams::Castbase(ams::ProcStartMsg& parent) { return reinterpret_cast(parent); } -// --- ams.ProcRemoveMsg..GetMsgLength -// Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::ProcRemoveMsg& parent) { - return i32(const_cast(parent).length); +// --- ams.ProcStartMsg.cmd.N +// Return number of elements in varlen field +inline u32 ams::cmd_N(const ams::ProcStartMsg& parent) { + u32 length = i32(((ams::ProcStartMsg&)parent).length); + u32 extra_bytes = u32_Max(length,sizeof(ams::ProcStartMsg)) - sizeof(ams::ProcStartMsg); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(char)); } -// --- ams.ProcRemoveMsg..GetMsgMemptr -// Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::ProcRemoveMsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +// --- ams.ProcStartMsg.cmd_curs.Reset +inline void ams::ProcStartMsg_cmd_curs_Reset(ProcStartMsg_cmd_curs &curs, ams::ProcStartMsg &parent) { + curs.ptr = (u8*)cmd_Addr(parent); + curs.length = i32(parent.length) - sizeof(ams::ProcStartMsg); + curs.index = 0; } -// --- ams.ProcRemoveMsg..Init -// Set all fields to initial values. -inline void ams::ProcRemoveMsg_Init(ams::ProcRemoveMsg& parent) { - parent.type = u32(5); - parent.length = u32(ssizeof(parent) + (0)); +// --- ams.ProcStartMsg.cmd_curs.ValidQ +// cursor points to valid item +inline bool ams::ProcStartMsg_cmd_curs_ValidQ(ProcStartMsg_cmd_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; } -// --- ams.ProcRemoveMsg..Ctor -inline ams::ProcRemoveMsg::ProcRemoveMsg() { - ams::ProcRemoveMsg_Init(*this); +// --- ams.ProcStartMsg.cmd_curs.Next +// proceed to next item +inline void ams::ProcStartMsg_cmd_curs_Next(ProcStartMsg_cmd_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; } -// --- ams.ProcRemoveMsg..FieldwiseCtor -inline ams::ProcRemoveMsg::ProcRemoveMsg(ams::ProcId in_proc_id) - : proc_id(in_proc_id) - { - this->type = u32(5); - this->length = u32(ssizeof(*this) + (0)); +// --- ams.ProcStartMsg.cmd_curs.Access +// item access +inline char& ams::ProcStartMsg_cmd_curs_Access(ProcStartMsg_cmd_curs &curs) { + return *(char*)curs.ptr; } -// --- ams.SeqmsgId..Init -// Set all fields to initial values. -inline void ams::SeqmsgId_Init(ams::SeqmsgId& parent) { - parent.seq = u64(1); - parent.off = u32(0); +// --- ams.ProcStartMsg..GetMsgLength +// Message length (uses length field) +inline i32 ams::GetMsgLength(const ams::ProcStartMsg& parent) { + return i32(const_cast(parent).length); } -// --- ams.SeqmsgId..Ctor -inline ams::SeqmsgId::SeqmsgId() { - ams::SeqmsgId_Init(*this); +// --- ams.ProcStartMsg..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr ams::GetMsgMemptr(const ams::ProcStartMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); } -// --- ams.SeqmsgId..FieldwiseCtor -inline ams::SeqmsgId::SeqmsgId(ams::StreamId in_stream_id, u64 in_seq, u32 in_off) - : stream_id(in_stream_id) - , seq(in_seq) - , off(in_off) - { +// --- ams.ProcStartMsg..Init +// Set all fields to initial values. +inline void ams::ProcStartMsg_Init(ams::ProcStartMsg& parent) { + parent.type = u32(700); + parent.length = u32(ssizeof(parent) + (0)); + parent.pty = bool(false); +} + +// --- ams.ProcStartMsg..Ctor +inline ams::ProcStartMsg::ProcStartMsg() { + ams::ProcStartMsg_Init(*this); } -// --- ams.Seqmsg.base.Castdown -// Check if ams::MsgHeader is an instance of Seqmsg by checking the type field +// --- ams.ProcStatusMsg.base.Castdown +// Check if ams::MsgHeader is an instance of ProcStatusMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of Seqmsg. +// Additionally, check if the length field permits valid instance of ProcStatusMsg. // If not successful, quietly return NULL. -inline ams::Seqmsg* ams::Seqmsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (10); - cond &= i32(hdr.length) >= ssizeof(ams::Seqmsg); - return cond ? reinterpret_cast(&hdr) : NULL; +inline ams::ProcStatusMsg* ams::ProcStatusMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (705); + cond &= i32(hdr.length) >= ssizeof(ams::ProcStatusMsg); + return cond ? reinterpret_cast(&hdr) : NULL; } -// --- ams.Seqmsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::Seqmsg& parent) { +// --- ams.ProcStatusMsg.base.Castbase +inline ams::MsgHeader& ams::Castbase(ams::ProcStatusMsg& parent) { return reinterpret_cast(parent); } -// --- ams.Seqmsg.payload.Get -// Return pointer to optional last element (NULL if none) -// The parent's length field is assumed to have already been checked for validity. -// If the parent's lengthis too short to allow a full-sized payload, return NULL. -// Since the last element is itself variable-length, two more checks are applied: -// If payload's length field value is too short, return NULL. -// If payload's length field value extends past parent's allowed length, return NULL. -inline ams::MsgHeader* ams::payload_Get(ams::Seqmsg& parent) { - i32 totlen = i32(parent.length); - u8 *end = (u8*)&parent + sizeof(ams::Seqmsg); - ams::MsgHeader *ptr = (ams::MsgHeader*)end; - bool exists = ssizeof(ams::Seqmsg) + sizeof_ams_MsgHeader <= totlen; - exists = exists && i32((*ptr).length) >= sizeof_ams_MsgHeader && ssizeof(ams::Seqmsg) + i32((*ptr).length) <= totlen; - return exists ? ptr : NULL; -} - -// --- ams.Seqmsg..GetMsgLength +// --- ams.ProcStatusMsg..GetMsgLength // Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::Seqmsg& parent) { - return i32(const_cast(parent).length); +inline i32 ams::GetMsgLength(const ams::ProcStatusMsg& parent) { + return i32(const_cast(parent).length); } -// --- ams.Seqmsg..GetMsgMemptr +// --- ams.ProcStatusMsg..GetMsgMemptr // Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::Seqmsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +inline algo::memptr ams::GetMsgMemptr(const ams::ProcStatusMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); } -// --- ams.Seqmsg..Init +// --- ams.ProcStatusMsg..Init // Set all fields to initial values. -inline void ams::Seqmsg_Init(ams::Seqmsg& parent) { - parent.type = u32(10); +inline void ams::ProcStatusMsg_Init(ams::ProcStatusMsg& parent) { + parent.type = u32(705); parent.length = u32(ssizeof(parent) + (0)); - parent.tsc = u64(0); -} - -// --- ams.Seqmsg..Ctor -inline ams::Seqmsg::Seqmsg() { - ams::Seqmsg_Init(*this); } -// --- ams.Seqmsg..FieldwiseCtor -inline ams::Seqmsg::Seqmsg(ams::SeqmsgId in_seqmsg_id, u64 in_tsc) - : seqmsg_id(in_seqmsg_id) - , tsc(in_tsc) - { - this->type = u32(10); - this->length = u32(ssizeof(*this) + (0)); +// --- ams.ProcStatusMsg..Ctor +inline ams::ProcStatusMsg::ProcStatusMsg() { + ams::ProcStatusMsg_Init(*this); } -// --- ams.SeqmsgTrace.base.Castdown -// Check if ams::MsgHeader is an instance of SeqmsgTrace by checking the type field +// --- ams.RemDirRecurseMsg.base.Castdown +// Check if ams::MsgHeader is an instance of RemDirRecurseMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of SeqmsgTrace. +// Additionally, check if the length field permits valid instance of RemDirRecurseMsg. // If not successful, quietly return NULL. -inline ams::SeqmsgTrace* ams::SeqmsgTrace_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (11); - cond &= i32(hdr.length) >= ssizeof(ams::SeqmsgTrace); - return cond ? reinterpret_cast(&hdr) : NULL; +inline ams::RemDirRecurseMsg* ams::RemDirRecurseMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (633); + cond &= i32(hdr.length) >= ssizeof(ams::RemDirRecurseMsg); + return cond ? reinterpret_cast(&hdr) : NULL; } -// --- ams.SeqmsgTrace.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::SeqmsgTrace& parent) { +// --- ams.RemDirRecurseMsg.base.Castbase +inline ams::MsgHeader& ams::Castbase(ams::RemDirRecurseMsg& parent) { return reinterpret_cast(parent); } -// --- ams.SeqmsgTrace.mode.GetEnum -// Get value of field as enum type -inline ams_SeqmsgTrace_mode_Enum ams::mode_GetEnum(const ams::SeqmsgTrace& parent) { - return ams_SeqmsgTrace_mode_Enum(parent.mode); +// --- ams.RemDirRecurseMsg.pathname.N +// Return number of elements in varlen field +inline u32 ams::pathname_N(const ams::RemDirRecurseMsg& parent) { + u32 length = i32(((ams::RemDirRecurseMsg&)parent).length); + u32 extra_bytes = u32_Max(length,sizeof(ams::RemDirRecurseMsg)) - sizeof(ams::RemDirRecurseMsg); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(char)); } -// --- ams.SeqmsgTrace.mode.SetEnum -// Set value of field from enum type. -inline void ams::mode_SetEnum(ams::SeqmsgTrace& parent, ams_SeqmsgTrace_mode_Enum rhs) { - parent.mode = u8(rhs); +// --- ams.RemDirRecurseMsg.pathname_curs.Reset +inline void ams::RemDirRecurseMsg_pathname_curs_Reset(RemDirRecurseMsg_pathname_curs &curs, ams::RemDirRecurseMsg &parent) { + curs.ptr = (u8*)pathname_Addr(parent); + curs.length = i32(parent.length) - sizeof(ams::RemDirRecurseMsg); + curs.index = 0; } -// --- ams.SeqmsgTrace.payload.Get -// Return pointer to optional last element (NULL if none) -// The parent's length field is assumed to have already been checked for validity. -// If the parent's lengthis too short to allow a full-sized payload, return NULL. -// Since the last element is itself variable-length, two more checks are applied: -// If payload's length field value is too short, return NULL. -// If payload's length field value extends past parent's allowed length, return NULL. -inline ams::MsgHeader* ams::payload_Get(ams::SeqmsgTrace& parent) { - i32 totlen = i32(parent.length); - u8 *end = (u8*)&parent + sizeof(ams::SeqmsgTrace); - ams::MsgHeader *ptr = (ams::MsgHeader*)end; - bool exists = ssizeof(ams::SeqmsgTrace) + sizeof_ams_MsgHeader <= totlen; - exists = exists && i32((*ptr).length) >= sizeof_ams_MsgHeader && ssizeof(ams::SeqmsgTrace) + i32((*ptr).length) <= totlen; - return exists ? ptr : NULL; +// --- ams.RemDirRecurseMsg.pathname_curs.ValidQ +// cursor points to valid item +inline bool ams::RemDirRecurseMsg_pathname_curs_ValidQ(RemDirRecurseMsg_pathname_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- ams.RemDirRecurseMsg.pathname_curs.Next +// proceed to next item +inline void ams::RemDirRecurseMsg_pathname_curs_Next(RemDirRecurseMsg_pathname_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- ams.RemDirRecurseMsg.pathname_curs.Access +// item access +inline char& ams::RemDirRecurseMsg_pathname_curs_Access(RemDirRecurseMsg_pathname_curs &curs) { + return *(char*)curs.ptr; } -// --- ams.SeqmsgTrace..GetMsgLength +// --- ams.RemDirRecurseMsg..GetMsgLength // Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::SeqmsgTrace& parent) { - return i32(const_cast(parent).length); +inline i32 ams::GetMsgLength(const ams::RemDirRecurseMsg& parent) { + return i32(const_cast(parent).length); } -// --- ams.SeqmsgTrace..GetMsgMemptr +// --- ams.RemDirRecurseMsg..GetMsgMemptr // Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::SeqmsgTrace& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +inline algo::memptr ams::GetMsgMemptr(const ams::RemDirRecurseMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); } -// --- ams.SeqmsgTrace..Init +// --- ams.RemDirRecurseMsg..Init // Set all fields to initial values. -inline void ams::SeqmsgTrace_Init(ams::SeqmsgTrace& parent) { - parent.type = u32(11); +inline void ams::RemDirRecurseMsg_Init(ams::RemDirRecurseMsg& parent) { + parent.type = u32(633); parent.length = u32(ssizeof(parent) + (0)); - parent.mode = u8(0); - parent.tsc = u64(0); -} - -// --- ams.SeqmsgTrace..Ctor -inline ams::SeqmsgTrace::SeqmsgTrace() { - ams::SeqmsgTrace_Init(*this); + parent.remove_topmost = bool(false); } -// --- ams.SeqmsgTrace..FieldwiseCtor -inline ams::SeqmsgTrace::SeqmsgTrace(ams::ProcId in_proc_id, u8 in_mode, ams::SeqmsgId in_seqmsg_id, u64 in_tsc) - : proc_id(in_proc_id) - , mode(in_mode) - , seqmsg_id(in_seqmsg_id) - , tsc(in_tsc) - { - this->type = u32(11); - this->length = u32(ssizeof(*this) + (0)); +// --- ams.RemDirRecurseMsg..Ctor +inline ams::RemDirRecurseMsg::RemDirRecurseMsg() { + ams::RemDirRecurseMsg_Init(*this); } -// --- ams.StreamFlags.write.Get +// --- ams.ShmFlags.write.Get // Retrieve bitfield from value of field value // 1 bits starting at bit 1. -inline bool ams::write_Get(const ams::StreamFlags& parent) { +inline bool ams::write_Get(const ams::ShmFlags& parent) { return bool((parent.value >> 1) & 0x01); } -// --- ams.StreamFlags.write.Set +// --- ams.ShmFlags.write.Set // Set bitfield in value of field 'value' // 1 bits starting at bit 1. -inline void ams::write_Set(ams::StreamFlags& parent, bool rhs) { +inline void ams::write_Set(ams::ShmFlags& parent, bool rhs) { u8 t1 = u8(0x01) << 1; u8 t2 = (u8(rhs) & 0x01) << 1; parent.value = u8((parent.value & ~t1) | t2); } -// --- ams.StreamFlags.read.Get +// --- ams.ShmFlags.read.Get // Retrieve bitfield from value of field value // 1 bits starting at bit 2. -inline bool ams::read_Get(const ams::StreamFlags& parent) { +inline bool ams::read_Get(const ams::ShmFlags& parent) { return bool((parent.value >> 2) & 0x01); } -// --- ams.StreamFlags.read.Set +// --- ams.ShmFlags.read.Set // Set bitfield in value of field 'value' // 1 bits starting at bit 2. -inline void ams::read_Set(ams::StreamFlags& parent, bool rhs) { +inline void ams::read_Set(ams::ShmFlags& parent, bool rhs) { u8 t1 = u8(0x01) << 2; u8 t2 = (u8(rhs) & 0x01) << 2; parent.value = u8((parent.value & ~t1) | t2); } -// --- ams.StreamFlags.nonblock.Get +// --- ams.ShmFlags.nonblock.Get // Retrieve bitfield from value of field value // 1 bits starting at bit 3. -inline bool ams::nonblock_Get(const ams::StreamFlags& parent) { +inline bool ams::nonblock_Get(const ams::ShmFlags& parent) { return bool((parent.value >> 3) & 0x01); } -// --- ams.StreamFlags.nonblock.Set +// --- ams.ShmFlags.nonblock.Set // Set bitfield in value of field 'value' // 1 bits starting at bit 3. -inline void ams::nonblock_Set(ams::StreamFlags& parent, bool rhs) { +inline void ams::nonblock_Set(ams::ShmFlags& parent, bool rhs) { u8 t1 = u8(0x01) << 3; u8 t2 = (u8(rhs) & 0x01) << 3; parent.value = u8((parent.value & ~t1) | t2); } -// --- ams.StreamFlags.trace_read.Get +// --- ams.ShmFlags.write_err.Get // Retrieve bitfield from value of field value -// 1 bits starting at bit 4. -inline bool ams::trace_read_Get(const ams::StreamFlags& parent) { - return bool((parent.value >> 4) & 0x01); +// 1 bits starting at bit 6. +inline bool ams::write_err_Get(const ams::ShmFlags& parent) { + return bool((parent.value >> 6) & 0x01); } -// --- ams.StreamFlags.trace_read.Set +// --- ams.ShmFlags.write_err.Set // Set bitfield in value of field 'value' -// 1 bits starting at bit 4. -inline void ams::trace_read_Set(ams::StreamFlags& parent, bool rhs) { - u8 t1 = u8(0x01) << 4; - u8 t2 = (u8(rhs) & 0x01) << 4; +// 1 bits starting at bit 6. +inline void ams::write_err_Set(ams::ShmFlags& parent, bool rhs) { + u8 t1 = u8(0x01) << 6; + u8 t2 = (u8(rhs) & 0x01) << 6; parent.value = u8((parent.value & ~t1) | t2); } -// --- ams.StreamFlags.trace_write.Get -// Retrieve bitfield from value of field value -// 1 bits starting at bit 5. -inline bool ams::trace_write_Get(const ams::StreamFlags& parent) { - return bool((parent.value >> 5) & 0x01); +// --- ams.ShmFlags..Init +// Set all fields to initial values. +inline void ams::ShmFlags_Init(ams::ShmFlags& parent) { + parent.value = u8(0); } -// --- ams.StreamFlags.trace_write.Set -// Set bitfield in value of field 'value' -// 1 bits starting at bit 5. -inline void ams::trace_write_Set(ams::StreamFlags& parent, bool rhs) { - u8 t1 = u8(0x01) << 5; - u8 t2 = (u8(rhs) & 0x01) << 5; - parent.value = u8((parent.value & ~t1) | t2); +// --- ams.ShmFlags..Ctor +inline ams::ShmFlags::ShmFlags() { + ams::ShmFlags_Init(*this); } -// --- ams.StreamFlags.write_err.Get -// Retrieve bitfield from value of field value -// 1 bits starting at bit 6. -inline bool ams::write_err_Get(const ams::StreamFlags& parent) { - return bool((parent.value >> 6) & 0x01); +// --- ams.ShmFlags..FieldwiseCtor +inline ams::ShmFlags::ShmFlags(u8 in_value) + : value(in_value) + { } -// --- ams.StreamFlags.write_err.Set -// Set bitfield in value of field 'value' -// 1 bits starting at bit 6. -inline void ams::write_err_Set(ams::StreamFlags& parent, bool rhs) { - u8 t1 = u8(0x01) << 6; - u8 t2 = (u8(rhs) & 0x01) << 6; - parent.value = u8((parent.value & ~t1) | t2); +// --- ams.ShmFlags..EnumCtor +inline ams::ShmFlags::ShmFlags(ams_ShmFlagsEnum arg) { + this->value = u8(arg); } -// --- ams.StreamFlags.trace_text.Get -// Retrieve bitfield from value of field value -// 1 bits starting at bit 7. -inline bool ams::trace_text_Get(const ams::StreamFlags& parent) { - return bool((parent.value >> 7) & 0x01); +// --- ams.Shmtype.value.GetEnum +// Get value of field as enum type +inline ams_ShmtypeEnum ams::value_GetEnum(const ams::Shmtype& parent) { + return ams_ShmtypeEnum(parent.value); } -// --- ams.StreamFlags.trace_text.Set -// Set bitfield in value of field 'value' -// 1 bits starting at bit 7. -inline void ams::trace_text_Set(ams::StreamFlags& parent, bool rhs) { - u8 t1 = u8(0x01) << 7; - u8 t2 = (u8(rhs) & 0x01) << 7; - parent.value = u8((parent.value & ~t1) | t2); +// --- ams.Shmtype.value.SetEnum +// Set value of field from enum type. +inline void ams::value_SetEnum(ams::Shmtype& parent, ams_ShmtypeEnum rhs) { + parent.value = u8(rhs); +} + +// --- ams.Shmtype..Hash +inline u32 ams::Shmtype_Hash(u32 prev, ams::Shmtype rhs) { + prev = u8_Hash(prev, rhs.value); + return prev; +} + +// --- ams.Shmtype..EqOp +inline bool ams::Shmtype::operator ==(const ams::Shmtype &rhs) const { + return ams::Shmtype_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- ams.Shmtype..NeOp +inline bool ams::Shmtype::operator !=(const ams::Shmtype &rhs) const { + return !ams::Shmtype_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- ams.Shmtype..Cmp +inline i32 ams::Shmtype_Cmp(ams::Shmtype lhs, ams::Shmtype rhs) { + i32 retval = 0; + retval = u8_Cmp(lhs.value, rhs.value); + return retval; } -// --- ams.StreamFlags..Init +// --- ams.Shmtype..Init // Set all fields to initial values. -inline void ams::StreamFlags_Init(ams::StreamFlags& parent) { +inline void ams::Shmtype_Init(ams::Shmtype& parent) { parent.value = u8(0); } -// --- ams.StreamFlags..Ctor -inline ams::StreamFlags::StreamFlags() { - ams::StreamFlags_Init(*this); +// --- ams.Shmtype..Eq +inline bool ams::Shmtype_Eq(ams::Shmtype lhs, ams::Shmtype rhs) { + bool retval = true; + retval = u8_Eq(lhs.value, rhs.value); + return retval; +} + +// --- ams.Shmtype..EqEnum +// define enum comparison operator to avoid ambiguity +inline bool ams::Shmtype::operator ==(ams_ShmtypeEnum rhs) const { + return ams_ShmtypeEnum(value) == rhs; +} + +// --- ams.Shmtype..Ctor +inline ams::Shmtype::Shmtype() { + ams::Shmtype_Init(*this); } -// --- ams.StreamFlags..FieldwiseCtor -inline ams::StreamFlags::StreamFlags(u8 in_value) +// --- ams.Shmtype..FieldwiseCtor +inline ams::Shmtype::Shmtype(u8 in_value) : value(in_value) { } -// --- ams.StreamFlags..EnumCtor -inline ams::StreamFlags::StreamFlags(ams_StreamFlagsEnum arg) { +// --- ams.Shmtype..EnumCtor +inline ams::Shmtype::Shmtype(ams_ShmtypeEnum arg) { this->value = u8(arg); } -// --- ams.StreamHbMsg.base.Castdown -// Check if ams::MsgHeader is an instance of StreamHbMsg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of StreamHbMsg. -// If not successful, quietly return NULL. -inline ams::StreamHbMsg* ams::StreamHbMsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (3); - cond &= i32(hdr.length) >= ssizeof(ams::StreamHbMsg); - return cond ? reinterpret_cast(&hdr) : NULL; -} - -// --- ams.StreamHbMsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::StreamHbMsg& parent) { - return reinterpret_cast(parent); +// --- ams.ShmId..Hash +inline u32 ams::ShmId_Hash(u32 prev, ams::ShmId rhs) { + prev = ProcId_Hash(prev, rhs.proc_id); + prev = Shmtype_Hash(prev, rhs.shmtype); + prev = u8_Hash(prev, rhs.index); + return prev; } -// --- ams.StreamHbMsg..GetMsgLength -// Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::StreamHbMsg& parent) { - return i32(const_cast(parent).length); +// --- ams.ShmId..EqOp +inline bool ams::ShmId::operator ==(const ams::ShmId &rhs) const { + return ams::ShmId_Eq(const_cast(*this),const_cast(rhs)); } -// --- ams.StreamHbMsg..GetMsgMemptr -// Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::StreamHbMsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +// --- ams.ShmId..NeOp +inline bool ams::ShmId::operator !=(const ams::ShmId &rhs) const { + return !ams::ShmId_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- ams.ShmId..Cmp +inline i32 ams::ShmId_Cmp(ams::ShmId lhs, ams::ShmId rhs) { + i32 retval = 0; + retval = ams::ProcId_Cmp(lhs.proc_id, rhs.proc_id); + if (retval != 0) { + return retval; + } + retval = ams::Shmtype_Cmp(lhs.shmtype, rhs.shmtype); + if (retval != 0) { + return retval; + } + retval = u8_Cmp(lhs.index, rhs.index); + return retval; } -// --- ams.StreamHbMsg..Init +// --- ams.ShmId..Init // Set all fields to initial values. -inline void ams::StreamHbMsg_Init(ams::StreamHbMsg& parent) { - parent.type = u32(3); - parent.length = u32(ssizeof(parent) + (0)); - parent.wbudget = u32(0); +inline void ams::ShmId_Init(ams::ShmId& parent) { + parent.index = u8(0); } -// --- ams.StreamHbMsg..Ctor -inline ams::StreamHbMsg::StreamHbMsg() { - ams::StreamHbMsg_Init(*this); +// --- ams.ShmId..Eq +inline bool ams::ShmId_Eq(ams::ShmId lhs, ams::ShmId rhs) { + bool retval = true; + retval = ams::ProcId_Eq(lhs.proc_id, rhs.proc_id); + if (!retval) { + return false; + } + retval = ams::Shmtype_Eq(lhs.shmtype, rhs.shmtype); + if (!retval) { + return false; + } + retval = u8_Eq(lhs.index, rhs.index); + return retval; } -// --- ams.StreamHbMsg..FieldwiseCtor -inline ams::StreamHbMsg::StreamHbMsg(ams::Member in_member, ams::StreamPos in_pos, u32 in_wbudget) - : member(in_member) - , pos(in_pos) - , wbudget(in_wbudget) - { - this->type = u32(3); - this->length = u32(ssizeof(*this) + (0)); +// --- ams.ShmId..Ctor +inline ams::ShmId::ShmId() { + ams::ShmId_Init(*this); } -// --- ams.TerminateMsg.base.Castdown -// Check if ams::MsgHeader is an instance of TerminateMsg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of TerminateMsg. -// If not successful, quietly return NULL. -inline ams::TerminateMsg* ams::TerminateMsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (352); - cond &= i32(hdr.length) >= ssizeof(ams::TerminateMsg); - return cond ? reinterpret_cast(&hdr) : NULL; +// --- ams.ShmId..FieldwiseCtor +inline ams::ShmId::ShmId(ams::ProcId in_proc_id, ams::Shmtype in_shmtype, u8 in_index) + : proc_id(in_proc_id) + , shmtype(in_shmtype) + , index(in_index) + { } -// --- ams.TerminateMsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::TerminateMsg& parent) { - return reinterpret_cast(parent); +// --- ams.ShmemberFlags.r.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 0. +inline bool ams::r_Get(const ams::ShmemberFlags& parent) { + return bool((parent.value >> 0) & 0x01); } -// --- ams.TerminateMsg..GetMsgLength -// Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::TerminateMsg& parent) { - return i32(const_cast(parent).length); +// --- ams.ShmemberFlags.r.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 0. +inline void ams::r_Set(ams::ShmemberFlags& parent, bool rhs) { + u16 t1 = u16(0x01) << 0; + u16 t2 = (u16(rhs) & 0x01) << 0; + parent.value = u16((parent.value & ~t1) | t2); } -// --- ams.TerminateMsg..GetMsgMemptr -// Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::TerminateMsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +// --- ams.ShmemberFlags.w.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 1. +inline bool ams::w_Get(const ams::ShmemberFlags& parent) { + return bool((parent.value >> 1) & 0x01); } -// --- ams.TerminateMsg..Init -// Set all fields to initial values. -inline void ams::TerminateMsg_Init(ams::TerminateMsg& parent) { - parent.type = u32(352); - parent.length = u32(ssizeof(parent) + (0)); +// --- ams.ShmemberFlags.w.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 1. +inline void ams::w_Set(ams::ShmemberFlags& parent, bool rhs) { + u16 t1 = u16(0x01) << 1; + u16 t2 = (u16(rhs) & 0x01) << 1; + parent.value = u16((parent.value & ~t1) | t2); } -// --- ams.TerminateMsg..Ctor -inline ams::TerminateMsg::TerminateMsg() { - ams::TerminateMsg_Init(*this); +// --- ams.ShmemberFlags..Hash +inline u32 ams::ShmemberFlags_Hash(u32 prev, ams::ShmemberFlags rhs) { + prev = u16_Hash(prev, rhs.value); + return prev; } -// --- ams.Trace2Msg.base.Castdown -// Check if ams::MsgHeader is an instance of Trace2Msg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of Trace2Msg. -// If not successful, quietly return NULL. -inline ams::Trace2Msg* ams::Trace2Msg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (108); - cond &= i32(hdr.length) >= ssizeof(ams::Trace2Msg); - return cond ? reinterpret_cast(&hdr) : NULL; +// --- ams.ShmemberFlags..EqOp +inline bool ams::ShmemberFlags::operator ==(const ams::ShmemberFlags &rhs) const { + return ams::ShmemberFlags_Eq(const_cast(*this),const_cast(rhs)); } -// --- ams.Trace2Msg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::Trace2Msg& parent) { - return reinterpret_cast(parent); +// --- ams.ShmemberFlags..NeOp +inline bool ams::ShmemberFlags::operator !=(const ams::ShmemberFlags &rhs) const { + return !ams::ShmemberFlags_Eq(const_cast(*this),const_cast(rhs)); } -// --- ams.Trace2Msg.data.N -// Return number of elements in varlen field -inline u32 ams::data_N(const ams::Trace2Msg& parent) { - u32 length = i32(((ams::Trace2Msg&)parent).length); - u32 extra_bytes = u32_Max(length,sizeof(ams::Trace2Msg)) - sizeof(ams::Trace2Msg); // avoid unsigned subtraction underflow - return u32(extra_bytes / sizeof(u64)); +// --- ams.ShmemberFlags..Cmp +inline i32 ams::ShmemberFlags_Cmp(ams::ShmemberFlags lhs, ams::ShmemberFlags rhs) { + i32 retval = 0; + retval = u16_Cmp(lhs.value, rhs.value); + return retval; } -// --- ams.Trace2Msg.data_curs.Reset -inline void ams::Trace2Msg_data_curs_Reset(Trace2Msg_data_curs &curs, ams::Trace2Msg &parent) { - curs.ptr = (u8*)&parent + sizeof(ams::Trace2Msg); - curs.length = i32(parent.length) - sizeof(ams::Trace2Msg); - curs.index = 0; +// --- ams.ShmemberFlags..Init +// Set all fields to initial values. +inline void ams::ShmemberFlags_Init(ams::ShmemberFlags& parent) { + parent.value = u16(0); + r_Set(parent, 0); // default value + w_Set(parent, 0); // default value } -// --- ams.Trace2Msg.data_curs.ValidQ -// cursor points to valid item -inline bool ams::Trace2Msg_data_curs_ValidQ(Trace2Msg_data_curs &curs) { - bool valid = ssizeof(u64) <= curs.length; - return valid; +// --- ams.ShmemberFlags..Eq +inline bool ams::ShmemberFlags_Eq(ams::ShmemberFlags lhs, ams::ShmemberFlags rhs) { + bool retval = true; + retval = u16_Eq(lhs.value, rhs.value); + return retval; } -// --- ams.Trace2Msg.data_curs.Next -// proceed to next item -inline void ams::Trace2Msg_data_curs_Next(Trace2Msg_data_curs &curs) { - i32 len = i32(sizeof(u64)); - curs.ptr += len; - curs.length -= len; - ++curs.index; +// --- ams.ShmemberFlags..EqEnum +// define enum comparison operator to avoid ambiguity +inline bool ams::ShmemberFlags::operator ==(ams_ShmemberFlagsEnum rhs) const { + return ams_ShmemberFlagsEnum(value) == rhs; } -// --- ams.Trace2Msg.data_curs.Access -// item access -inline u64& ams::Trace2Msg_data_curs_Access(Trace2Msg_data_curs &curs) { - return *(u64*)curs.ptr; +// --- ams.ShmemberFlags..Ctor +inline ams::ShmemberFlags::ShmemberFlags() { + ams::ShmemberFlags_Init(*this); } -// --- ams.Trace2Msg..GetMsgLength -// Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::Trace2Msg& parent) { - return i32(const_cast(parent).length); +// --- ams.ShmemberFlags..FieldwiseCtor +inline ams::ShmemberFlags::ShmemberFlags(u16 in_value) + : value(in_value) + { } -// --- ams.Trace2Msg..GetMsgMemptr -// Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::Trace2Msg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +// --- ams.ShmemberFlags..EnumCtor +inline ams::ShmemberFlags::ShmemberFlags(ams_ShmemberFlagsEnum arg) { + this->value = u16(arg); } -// --- ams.Trace2Msg..Init -// Set all fields to initial values. -inline void ams::Trace2Msg_Init(ams::Trace2Msg& parent) { - parent.type = u32(108); - parent.length = u32(ssizeof(parent) + (0)); - parent.trace = u8(0); +// --- ams.ShmemberId..Hash +inline u32 ams::ShmemberId_Hash(u32 prev, ams::ShmemberId rhs) { + prev = ShmId_Hash(prev, rhs.shm_id); + prev = ProcId_Hash(prev, rhs.proc_id); + prev = ShmemberFlags_Hash(prev, rhs.flags); + return prev; } -// --- ams.Trace2Msg..Ctor -inline ams::Trace2Msg::Trace2Msg() { - ams::Trace2Msg_Init(*this); +// --- ams.ShmemberId..EqOp +inline bool ams::ShmemberId::operator ==(const ams::ShmemberId &rhs) const { + return ams::ShmemberId_Eq(const_cast(*this),const_cast(rhs)); } -// --- ams.Trace2Msg..FieldwiseCtor -inline ams::Trace2Msg::Trace2Msg(ams::ProcId in_proc, u8 in_trace, algo::UnTime in_tstamp) - : proc(in_proc) - , trace(in_trace) - , tstamp(in_tstamp) - { - this->type = u32(108); - this->length = u32(ssizeof(*this) + (0)); +// --- ams.ShmemberId..NeOp +inline bool ams::ShmemberId::operator !=(const ams::ShmemberId &rhs) const { + return !ams::ShmemberId_Eq(const_cast(*this),const_cast(rhs)); } -// --- ams.TraceInfo2Msg.base.Castdown -// Check if ams::MsgHeader is an instance of TraceInfo2Msg by checking the type field -// If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of TraceInfo2Msg. -// If not successful, quietly return NULL. -inline ams::TraceInfo2Msg* ams::TraceInfo2Msg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (109); - cond &= i32(hdr.length) >= ssizeof(ams::TraceInfo2Msg); - return cond ? reinterpret_cast(&hdr) : NULL; +// --- ams.ShmemberId..Cmp +inline i32 ams::ShmemberId_Cmp(ams::ShmemberId lhs, ams::ShmemberId rhs) { + i32 retval = 0; + retval = ams::ShmId_Cmp(lhs.shm_id, rhs.shm_id); + if (retval != 0) { + return retval; + } + retval = ams::ProcId_Cmp(lhs.proc_id, rhs.proc_id); + if (retval != 0) { + return retval; + } + retval = ams::ShmemberFlags_Cmp(lhs.flags, rhs.flags); + return retval; } -// --- ams.TraceInfo2Msg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::TraceInfo2Msg& parent) { - return reinterpret_cast(parent); +// --- ams.ShmemberId..Init +// Set all fields to initial values. +inline void ams::ShmemberId_Init(ams::ShmemberId& parent) { + parent.flags = ams::ShmemberFlags(0); } -// --- ams.TraceInfo2Msg.data.N -// Return number of elements in varlen field -inline u32 ams::data_N(const ams::TraceInfo2Msg& parent) { - u32 length = i32(((ams::TraceInfo2Msg&)parent).length); - u32 extra_bytes = u32_Max(length,sizeof(ams::TraceInfo2Msg)) - sizeof(ams::TraceInfo2Msg); // avoid unsigned subtraction underflow - return u32(extra_bytes / sizeof(char)); +// --- ams.ShmemberId..Eq +inline bool ams::ShmemberId_Eq(ams::ShmemberId lhs, ams::ShmemberId rhs) { + bool retval = true; + retval = ams::ShmId_Eq(lhs.shm_id, rhs.shm_id); + if (!retval) { + return false; + } + retval = ams::ProcId_Eq(lhs.proc_id, rhs.proc_id); + if (!retval) { + return false; + } + retval = ams::ShmemberFlags_Eq(lhs.flags, rhs.flags); + return retval; } -// --- ams.TraceInfo2Msg.data_curs.Reset -inline void ams::TraceInfo2Msg_data_curs_Reset(TraceInfo2Msg_data_curs &curs, ams::TraceInfo2Msg &parent) { - curs.ptr = (u8*)&parent + sizeof(ams::TraceInfo2Msg); - curs.length = i32(parent.length) - sizeof(ams::TraceInfo2Msg); - curs.index = 0; +// --- ams.ShmemberId..Ctor +inline ams::ShmemberId::ShmemberId() { + ams::ShmemberId_Init(*this); } -// --- ams.TraceInfo2Msg.data_curs.ValidQ -// cursor points to valid item -inline bool ams::TraceInfo2Msg_data_curs_ValidQ(TraceInfo2Msg_data_curs &curs) { - bool valid = ssizeof(char) <= curs.length; - return valid; +// --- ams.ShmemberId..FieldwiseCtor +inline ams::ShmemberId::ShmemberId(ams::ShmId in_shm_id, ams::ProcId in_proc_id, ams::ShmemberFlags in_flags) + : shm_id(in_shm_id) + , proc_id(in_proc_id) + , flags(in_flags) + { } -// --- ams.TraceInfo2Msg.data_curs.Next -// proceed to next item -inline void ams::TraceInfo2Msg_data_curs_Next(TraceInfo2Msg_data_curs &curs) { - i32 len = i32(sizeof(char)); - curs.ptr += len; - curs.length -= len; - ++curs.index; +// --- ams.ShmHbMsg.base.Castdown +// Check if ams::MsgHeader is an instance of ShmHbMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of ShmHbMsg. +// If not successful, quietly return NULL. +inline ams::ShmHbMsg* ams::ShmHbMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (3); + cond &= i32(hdr.length) >= ssizeof(ams::ShmHbMsg); + return cond ? reinterpret_cast(&hdr) : NULL; } -// --- ams.TraceInfo2Msg.data_curs.Access -// item access -inline char& ams::TraceInfo2Msg_data_curs_Access(TraceInfo2Msg_data_curs &curs) { - return *(char*)curs.ptr; +// --- ams.ShmHbMsg.base.Castbase +inline ams::MsgHeader& ams::Castbase(ams::ShmHbMsg& parent) { + return reinterpret_cast(parent); } -// --- ams.TraceInfo2Msg..GetMsgLength +// --- ams.ShmHbMsg..GetMsgLength // Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::TraceInfo2Msg& parent) { - return i32(const_cast(parent).length); +inline i32 ams::GetMsgLength(const ams::ShmHbMsg& parent) { + return i32(const_cast(parent).length); } -// --- ams.TraceInfo2Msg..GetMsgMemptr +// --- ams.ShmHbMsg..GetMsgMemptr // Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::TraceInfo2Msg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +inline algo::memptr ams::GetMsgMemptr(const ams::ShmHbMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); } -// --- ams.TraceInfo2Msg..Init +// --- ams.ShmHbMsg..Init // Set all fields to initial values. -inline void ams::TraceInfo2Msg_Init(ams::TraceInfo2Msg& parent) { - parent.type = u32(109); +inline void ams::ShmHbMsg_Init(ams::ShmHbMsg& parent) { + parent.type = u32(3); parent.length = u32(ssizeof(parent) + (0)); - parent.trace = u8(0); - parent.part = u8(0); + parent.off = u64(0); + parent.wbudget = u32(0); } -// --- ams.TraceInfo2Msg..Ctor -inline ams::TraceInfo2Msg::TraceInfo2Msg() { - ams::TraceInfo2Msg_Init(*this); +// --- ams.ShmHbMsg..Ctor +inline ams::ShmHbMsg::ShmHbMsg() { + ams::ShmHbMsg_Init(*this); } -// --- ams.TraceInfo2Msg..FieldwiseCtor -inline ams::TraceInfo2Msg::TraceInfo2Msg(ams::ProcId in_proc, u8 in_trace, algo::UnTime in_tstamp, u8 in_part) - : proc(in_proc) - , trace(in_trace) - , tstamp(in_tstamp) - , part(in_part) +// --- ams.ShmHbMsg..FieldwiseCtor +inline ams::ShmHbMsg::ShmHbMsg(ams::ShmemberId in_shmember, u64 in_off, u32 in_wbudget) + : shmember(in_shmember) + , off(in_off) + , wbudget(in_wbudget) { - this->type = u32(109); + this->type = u32(3); this->length = u32(ssizeof(*this) + (0)); } -// --- ams.TraceInfoMsg.base.Castdown -// Check if ams::MsgHeader is an instance of TraceInfoMsg by checking the type field +// --- ams.Shmmsg.base.Castdown +// Check if ams::MsgHeader is an instance of Shmmsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of TraceInfoMsg. +// Additionally, check if the length field permits valid instance of Shmmsg. // If not successful, quietly return NULL. -inline ams::TraceInfoMsg* ams::TraceInfoMsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (9); - cond &= i32(hdr.length) >= ssizeof(ams::TraceInfoMsg); - return cond ? reinterpret_cast(&hdr) : NULL; +inline ams::Shmmsg* ams::Shmmsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (10); + cond &= i32(hdr.length) >= ssizeof(ams::Shmmsg); + return cond ? reinterpret_cast(&hdr) : NULL; } -// --- ams.TraceInfoMsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::TraceInfoMsg& parent) { +// --- ams.Shmmsg.base.Castbase +inline ams::MsgHeader& ams::Castbase(ams::Shmmsg& parent) { return reinterpret_cast(parent); } -// --- ams.TraceInfoMsg.data.N -// Return number of elements in varlen field -inline u32 ams::data_N(const ams::TraceInfoMsg& parent) { - u32 length = i32(((ams::TraceInfoMsg&)parent).length); - u32 extra_bytes = u32_Max(length,sizeof(ams::TraceInfoMsg)) - sizeof(ams::TraceInfoMsg); // avoid unsigned subtraction underflow - return u32(extra_bytes / sizeof(char)); -} - -// --- ams.TraceInfoMsg.data_curs.Reset -inline void ams::TraceInfoMsg_data_curs_Reset(TraceInfoMsg_data_curs &curs, ams::TraceInfoMsg &parent) { - curs.ptr = (u8*)&parent + sizeof(ams::TraceInfoMsg); - curs.length = i32(parent.length) - sizeof(ams::TraceInfoMsg); - curs.index = 0; -} - -// --- ams.TraceInfoMsg.data_curs.ValidQ -// cursor points to valid item -inline bool ams::TraceInfoMsg_data_curs_ValidQ(TraceInfoMsg_data_curs &curs) { - bool valid = ssizeof(char) <= curs.length; - return valid; -} - -// --- ams.TraceInfoMsg.data_curs.Next -// proceed to next item -inline void ams::TraceInfoMsg_data_curs_Next(TraceInfoMsg_data_curs &curs) { - i32 len = i32(sizeof(char)); - curs.ptr += len; - curs.length -= len; - ++curs.index; -} - -// --- ams.TraceInfoMsg.data_curs.Access -// item access -inline char& ams::TraceInfoMsg_data_curs_Access(TraceInfoMsg_data_curs &curs) { - return *(char*)curs.ptr; +// --- ams.Shmmsg.payload.Get +// Return pointer to optional last element (NULL if none) +// The parent's length field is assumed to have already been checked for validity. +// If the parent's lengthis too short to allow a full-sized payload, return NULL. +// Since the last element is itself variable-length, two more checks are applied: +// If payload's length field value is too short, return NULL. +// If payload's length field value extends past parent's allowed length, return NULL. +inline ams::MsgHeader* ams::payload_Get(ams::Shmmsg& parent) { + i32 totlen = i32(parent.length); + u8 *end = (u8*)&parent + sizeof(ams::Shmmsg); + ams::MsgHeader *ptr = (ams::MsgHeader*)end; + bool exists = ssizeof(ams::Shmmsg) + sizeof_ams_MsgHeader <= totlen; + exists = exists && i32((*ptr).length) >= sizeof_ams_MsgHeader && ssizeof(ams::Shmmsg) + i32((*ptr).length) <= totlen; + return exists ? ptr : NULL; } -// --- ams.TraceInfoMsg..GetMsgLength +// --- ams.Shmmsg..GetMsgLength // Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::TraceInfoMsg& parent) { - return i32(const_cast(parent).length); +inline i32 ams::GetMsgLength(const ams::Shmmsg& parent) { + return i32(const_cast(parent).length); } -// --- ams.TraceInfoMsg..GetMsgMemptr +// --- ams.Shmmsg..GetMsgMemptr // Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::TraceInfoMsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +inline algo::memptr ams::GetMsgMemptr(const ams::Shmmsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); } -// --- ams.TraceInfoMsg..Init +// --- ams.Shmmsg..Init // Set all fields to initial values. -inline void ams::TraceInfoMsg_Init(ams::TraceInfoMsg& parent) { - parent.type = u32(9); +inline void ams::Shmmsg_Init(ams::Shmmsg& parent) { + parent.type = u32(10); parent.length = u32(ssizeof(parent) + (0)); - parent.part = u8(0); + parent.off = u64(0); + parent.tstamp = u64(0); } -// --- ams.TraceInfoMsg..Ctor -inline ams::TraceInfoMsg::TraceInfoMsg() { - ams::TraceInfoMsg_Init(*this); +// --- ams.Shmmsg..Ctor +inline ams::Shmmsg::Shmmsg() { + ams::Shmmsg_Init(*this); } -// --- ams.TraceInfoMsg..FieldwiseCtor -inline ams::TraceInfoMsg::TraceInfoMsg(ams::ProcId in_proc, algo::UnTime in_tstamp, u8 in_part) - : proc(in_proc) +// --- ams.Shmmsg..FieldwiseCtor +inline ams::Shmmsg::Shmmsg(ams::ShmId in_shm_id, u64 in_off, u64 in_tstamp) + : shm_id(in_shm_id) + , off(in_off) , tstamp(in_tstamp) - , part(in_part) { - this->type = u32(9); + this->type = u32(10); this->length = u32(ssizeof(*this) + (0)); } -// --- ams.TraceMsg.base.Castdown -// Check if ams::MsgHeader is an instance of TraceMsg by checking the type field +// --- ams.TerminateMsg.base.Castdown +// Check if ams::MsgHeader is an instance of TerminateMsg by checking the type field // If it is, return the pointer of target type. -// Additionally, check if the length field permits valid instance of TraceMsg. +// Additionally, check if the length field permits valid instance of TerminateMsg. // If not successful, quietly return NULL. -inline ams::TraceMsg* ams::TraceMsg_Castdown(ams::MsgHeader &hdr) { - bool cond = hdr.type == (8); - cond &= i32(hdr.length) >= ssizeof(ams::TraceMsg); - return cond ? reinterpret_cast(&hdr) : NULL; +inline ams::TerminateMsg* ams::TerminateMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (352); + cond &= i32(hdr.length) >= ssizeof(ams::TerminateMsg); + return cond ? reinterpret_cast(&hdr) : NULL; } -// --- ams.TraceMsg.base.Castbase -inline ams::MsgHeader& ams::Castbase(ams::TraceMsg& parent) { +// --- ams.TerminateMsg.base.Castbase +inline ams::MsgHeader& ams::Castbase(ams::TerminateMsg& parent) { return reinterpret_cast(parent); } -// --- ams.TraceMsg.data.N -// Return number of elements in varlen field -inline u32 ams::data_N(const ams::TraceMsg& parent) { - u32 length = i32(((ams::TraceMsg&)parent).length); - u32 extra_bytes = u32_Max(length,sizeof(ams::TraceMsg)) - sizeof(ams::TraceMsg); // avoid unsigned subtraction underflow - return u32(extra_bytes / sizeof(u64)); -} - -// --- ams.TraceMsg.data_curs.Reset -inline void ams::TraceMsg_data_curs_Reset(TraceMsg_data_curs &curs, ams::TraceMsg &parent) { - curs.ptr = (u8*)&parent + sizeof(ams::TraceMsg); - curs.length = i32(parent.length) - sizeof(ams::TraceMsg); - curs.index = 0; -} - -// --- ams.TraceMsg.data_curs.ValidQ -// cursor points to valid item -inline bool ams::TraceMsg_data_curs_ValidQ(TraceMsg_data_curs &curs) { - bool valid = ssizeof(u64) <= curs.length; - return valid; -} - -// --- ams.TraceMsg.data_curs.Next -// proceed to next item -inline void ams::TraceMsg_data_curs_Next(TraceMsg_data_curs &curs) { - i32 len = i32(sizeof(u64)); - curs.ptr += len; - curs.length -= len; - ++curs.index; -} - -// --- ams.TraceMsg.data_curs.Access -// item access -inline u64& ams::TraceMsg_data_curs_Access(TraceMsg_data_curs &curs) { - return *(u64*)curs.ptr; -} - -// --- ams.TraceMsg..GetMsgLength +// --- ams.TerminateMsg..GetMsgLength // Message length (uses length field) -inline i32 ams::GetMsgLength(const ams::TraceMsg& parent) { - return i32(const_cast(parent).length); +inline i32 ams::GetMsgLength(const ams::TerminateMsg& parent) { + return i32(const_cast(parent).length); } -// --- ams.TraceMsg..GetMsgMemptr +// --- ams.TerminateMsg..GetMsgMemptr // Memptr encompassing the message (uses length field) -inline algo::memptr ams::GetMsgMemptr(const ams::TraceMsg& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); +inline algo::memptr ams::GetMsgMemptr(const ams::TerminateMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); } -// --- ams.TraceMsg..Init +// --- ams.TerminateMsg..Init // Set all fields to initial values. -inline void ams::TraceMsg_Init(ams::TraceMsg& parent) { - parent.type = u32(8); +inline void ams::TerminateMsg_Init(ams::TerminateMsg& parent) { + parent.type = u32(352); parent.length = u32(ssizeof(parent) + (0)); } -// --- ams.TraceMsg..Ctor -inline ams::TraceMsg::TraceMsg() { - ams::TraceMsg_Init(*this); -} - -// --- ams.TraceMsg..FieldwiseCtor -inline ams::TraceMsg::TraceMsg(ams::ProcId in_proc, algo::UnTime in_tstamp) - : proc(in_proc) - , tstamp(in_tstamp) - { - this->type = u32(8); - this->length = u32(ssizeof(*this) + (0)); +// --- ams.TerminateMsg..Ctor +inline ams::TerminateMsg::TerminateMsg() { + ams::TerminateMsg_Init(*this); } // --- ams.UdpFrame.header.Castdown @@ -2051,7 +1734,7 @@ inline u32 ams::payload_N(const ams::UdpFrame& parent) { // --- ams.UdpFrame.payload_curs.Reset inline void ams::UdpFrame_payload_curs_Reset(UdpFrame_payload_curs &curs, ams::UdpFrame &parent) { - curs.ptr = (u8*)&parent + sizeof(ams::UdpFrame); + curs.ptr = (u8*)payload_Addr(parent); curs.length = i32(parent.length) - sizeof(ams::UdpFrame); curs.index = 0; } @@ -2104,118 +1787,108 @@ inline ams::UdpFrame::UdpFrame() { ams::UdpFrame_Init(*this); } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::AlarmSyncMsg &row) {// cfmt:ams.AlarmSyncMsg.String - ams::AlarmSyncMsg_Print(const_cast(row), str); - return str; -} - -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ProcId &row) {// cfmt:ams.ProcId.String - ams::ProcId_Print(const_cast(row), str); - return str; -} - -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::StreamType &row) {// cfmt:ams.StreamType.String - ams::StreamType_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ExpectMsg &row) {// cfmt:ams.ExpectMsg.String + ams::ExpectMsg_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::StreamId &row) {// cfmt:ams.StreamId.String - ams::StreamId_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::FieldId &row) {// cfmt:ams.FieldId.String + ams::FieldId_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::DfltStream &row) {// cfmt:ams.DfltStream.String - ams::DfltStream_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::Proctype &row) {// cfmt:ams.Proctype.String + ams::Proctype_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::DumpStreamTableMsg &row) {// cfmt:ams.DumpStreamTableMsg.String - ams::DumpStreamTableMsg_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ProcId &row) {// cfmt:ams.ProcId.String + ams::ProcId_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ExpectMsg &row) {// cfmt:ams.ExpectMsg.String - ams::ExpectMsg_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::InputLineMsg &row) {// cfmt:ams.InputLineMsg.String + ams::InputLineMsg_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::FieldId &row) {// cfmt:ams.FieldId.String - ams::FieldId_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::LogMsg &row) {// cfmt:ams.LogMsg.String + ams::LogMsg_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::HeartbeatMsg &row) {// cfmt:ams.HeartbeatMsg.String - ams::HeartbeatMsg_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::MsgBlock &row) {// cfmt:ams.MsgBlock.String + ams::MsgBlock_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::InputLineMsg &row) {// cfmt:ams.InputLineMsg.String - ams::InputLineMsg_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::MsgHeader &row) {// cfmt:ams.MsgHeader.String + ams::MsgHeader_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::Member &row) {// cfmt:ams.Member.String - ams::Member_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ProcEofMsg &row) {// cfmt:ams.ProcEofMsg.String + ams::ProcEofMsg_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::MsgBlock &row) {// cfmt:ams.MsgBlock.String - ams::MsgBlock_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ProcKillMsg &row) {// cfmt:ams.ProcKillMsg.String + ams::ProcKillMsg_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::MsgHeader &row) {// cfmt:ams.MsgHeader.String - ams::MsgHeader_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ProcMsg &row) {// cfmt:ams.ProcMsg.String + ams::ProcMsg_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::StreamPos &row) {// cfmt:ams.StreamPos.String - ams::StreamPos_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ProcReadMsg &row) {// cfmt:ams.ProcReadMsg.String + ams::ProcReadMsg_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::OpenMsg &row) {// cfmt:ams.OpenMsg.String - ams::OpenMsg_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ProcStartMsg &row) {// cfmt:ams.ProcStartMsg.String + ams::ProcStartMsg_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::PrlogMsg &row) {// cfmt:ams.PrlogMsg.String - ams::PrlogMsg_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ProcStatusMsg &row) {// cfmt:ams.ProcStatusMsg.String + ams::ProcStatusMsg_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ProcAddMsg &row) {// cfmt:ams.ProcAddMsg.String - ams::ProcAddMsg_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ShmFlags &row) {// cfmt:ams.ShmFlags.String + ams::ShmFlags_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ProcRemoveMsg &row) {// cfmt:ams.ProcRemoveMsg.String - ams::ProcRemoveMsg_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::Shmtype &row) {// cfmt:ams.Shmtype.String + ams::Shmtype_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::SeqmsgId &row) {// cfmt:ams.SeqmsgId.String - ams::SeqmsgId_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ShmId &row) {// cfmt:ams.ShmId.String + ams::ShmId_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::Seqmsg &row) {// cfmt:ams.Seqmsg.String - ams::Seqmsg_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ShmemberFlags &row) {// cfmt:ams.ShmemberFlags.String + ams::ShmemberFlags_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::SeqmsgTrace &row) {// cfmt:ams.SeqmsgTrace.String - ams::SeqmsgTrace_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ShmemberId &row) {// cfmt:ams.ShmemberId.String + ams::ShmemberId_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::StreamFlags &row) {// cfmt:ams.StreamFlags.String - ams::StreamFlags_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::ShmHbMsg &row) {// cfmt:ams.ShmHbMsg.String + ams::ShmHbMsg_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::StreamHbMsg &row) {// cfmt:ams.StreamHbMsg.String - ams::StreamHbMsg_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const ams::Shmmsg &row) {// cfmt:ams.Shmmsg.String + ams::Shmmsg_Print(const_cast(row), str); return str; } diff --git a/include/gen/ams_sendtest_gen.h b/include/gen/ams_sendtest_gen.h index c7c3e65c..fbad4f7d 100644 --- a/include/gen/ams_sendtest_gen.h +++ b/include/gen/ams_sendtest_gen.h @@ -57,6 +57,8 @@ namespace ams_sendtest { // gen:ns_print_struct // --- ams_sendtest.AmsSendTest struct AmsSendTest { // ams_sendtest.AmsSendTest u64 n_msg_send; // 0 Number of messages sent + u64 off_send; // 0 Offset sent + u64 off_recv; // 0 Offset received u64 n_msg_recv; // 0 Number of messages received u64 n_write_wait; // 0 Number of waits by parent u64 n_msg_limit; // 1000000 Limit of messages to send @@ -151,7 +153,7 @@ void trace_Print(ams_sendtest::trace& row, algo::cstring& str) _ // --- ams_sendtest.FDb // create: ams_sendtest.FDb._db (Global) struct FDb { // ams_sendtest.FDb: In-memory database for ams_sendtest - lib_ams::FStream* c_out; // Output goes here. optional pointer + lib_ams::FShm* c_out; // Output goes here. optional pointer command::ams_sendtest cmdline; // ams_sendtest::AmsSendTest ams_send_test; // ams_sendtest::FChild* child_lary[32]; // level array diff --git a/include/gen/ams_sendtest_gen.inl.h b/include/gen/ams_sendtest_gen.inl.h index 440a5c68..fdd84465 100644 --- a/include/gen/ams_sendtest_gen.inl.h +++ b/include/gen/ams_sendtest_gen.inl.h @@ -34,6 +34,8 @@ // Set all fields to initial values. inline void ams_sendtest::AmsSendTest_Init(ams_sendtest::AmsSendTest& parent) { parent.n_msg_send = u64(0); + parent.off_send = u64(0); + parent.off_recv = u64(0); parent.n_msg_recv = u64(0); parent.n_write_wait = u64(0); parent.n_msg_limit = u64(1000000); diff --git a/include/gen/amsdb_gen.h b/include/gen/amsdb_gen.h index 5d4fb239..7e6aad40 100644 --- a/include/gen/amsdb_gen.h +++ b/include/gen/amsdb_gen.h @@ -30,27 +30,27 @@ // --- amsdb_FieldIdEnum -enum amsdb_FieldIdEnum { // amsdb.FieldId.value - amsdb_FieldId_proctype = 0 - ,amsdb_FieldId_id = 1 - ,amsdb_FieldId_ns = 2 - ,amsdb_FieldId_comment = 3 - ,amsdb_FieldId_streamtype = 4 - ,amsdb_FieldId_value = 5 +enum amsdb_FieldIdEnum { // amsdb.FieldId.value + amsdb_FieldId_proctype = 0 + ,amsdb_FieldId_id = 1 + ,amsdb_FieldId_ns = 2 + ,amsdb_FieldId_comment = 3 + ,amsdb_FieldId_shmtype = 4 + ,amsdb_FieldId_nonblock = 5 + ,amsdb_FieldId_value = 6 }; -enum { amsdb_FieldIdEnum_N = 6 }; +enum { amsdb_FieldIdEnum_N = 7 }; namespace amsdb { // gen:ns_pkeytypedef - typedef algo::Smallstr50 ProcTypePkey; - typedef algo::Smallstr50 StreamTypePkey; + typedef algo::Smallstr50 ShmtypePkey; } // gen:ns_pkeytypedef namespace amsdb { // gen:ns_tclass_field } // gen:ns_tclass_field // gen:ns_fwddecl2 namespace amsdb { struct FieldId; } -namespace amsdb { struct ProcType; } -namespace amsdb { struct StreamType; } +namespace amsdb { struct Proctype; } +namespace amsdb { struct Shmtype; } namespace amsdb { // gen:ns_print_struct // --- amsdb.FieldId @@ -107,55 +107,59 @@ inline void FieldId_Init(amsdb::FieldId& parent); // func:amsdb.FieldId..Print void FieldId_Print(amsdb::FieldId& row, algo::cstring& str) __attribute__((nothrow)); -// --- amsdb.ProcType -struct ProcType { // amsdb.ProcType - algo::Smallstr50 proctype; // +// --- amsdb.Proctype +struct Proctype { // amsdb.Proctype + algo::Smallstr16 proctype; // u32 id; // 0 algo::Smallstr16 ns; // algo::Comment comment; // - // func:amsdb.ProcType..Ctor - inline ProcType() __attribute__((nothrow)); + // func:amsdb.Proctype..Ctor + inline Proctype() __attribute__((nothrow)); }; -// func:amsdb.ProcType..ReadFieldMaybe -bool ProcType_ReadFieldMaybe(amsdb::ProcType& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of amsdb::ProcType from an ascii string. +// func:amsdb.Proctype..ReadFieldMaybe +bool Proctype_ReadFieldMaybe(amsdb::Proctype& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of amsdb::Proctype from an ascii string. // The format of the string is an ssim Tuple -// func:amsdb.ProcType..ReadStrptrMaybe -bool ProcType_ReadStrptrMaybe(amsdb::ProcType &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:amsdb.Proctype..ReadStrptrMaybe +bool Proctype_ReadStrptrMaybe(amsdb::Proctype &parent, algo::strptr in_str) __attribute__((nothrow)); // Set all fields to initial values. -// func:amsdb.ProcType..Init -inline void ProcType_Init(amsdb::ProcType& parent); +// func:amsdb.Proctype..Init +inline void Proctype_Init(amsdb::Proctype& parent); // print string representation of ROW to string STR -// cfmt:amsdb.ProcType.String printfmt:Tuple -// func:amsdb.ProcType..Print -void ProcType_Print(amsdb::ProcType& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:amsdb.Proctype.String printfmt:Tuple +// func:amsdb.Proctype..Print +void Proctype_Print(amsdb::Proctype& row, algo::cstring& str) __attribute__((nothrow)); -// --- amsdb.StreamType -struct StreamType { // amsdb.StreamType - algo::Smallstr50 streamtype; // - ams::StreamType id; // - algo::Comment comment; // - // func:amsdb.StreamType..Ctor - inline StreamType() __attribute__((nothrow)); +// --- amsdb.Shmtype +struct Shmtype { // amsdb.Shmtype + algo::Smallstr50 shmtype; // + ams::Shmtype id; // + bool nonblock; // false Non-blocking (lossy) stream + algo::Comment comment; // + // func:amsdb.Shmtype..Ctor + inline Shmtype() __attribute__((nothrow)); }; -// func:amsdb.StreamType..ReadFieldMaybe -bool StreamType_ReadFieldMaybe(amsdb::StreamType& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of amsdb::StreamType from an ascii string. +// func:amsdb.Shmtype..ReadFieldMaybe +bool Shmtype_ReadFieldMaybe(amsdb::Shmtype& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of amsdb::Shmtype from an ascii string. // The format of the string is an ssim Tuple -// func:amsdb.StreamType..ReadStrptrMaybe -bool StreamType_ReadStrptrMaybe(amsdb::StreamType &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:amsdb.Shmtype..ReadStrptrMaybe +bool Shmtype_ReadStrptrMaybe(amsdb::Shmtype &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:amsdb.Shmtype..Init +inline void Shmtype_Init(amsdb::Shmtype& parent); // print string representation of ROW to string STR -// cfmt:amsdb.StreamType.String printfmt:Tuple -// func:amsdb.StreamType..Print -void StreamType_Print(amsdb::StreamType& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:amsdb.Shmtype.String printfmt:Tuple +// func:amsdb.Shmtype..Print +void Shmtype_Print(amsdb::Shmtype& row, algo::cstring& str) __attribute__((nothrow)); } // gen:ns_print_struct namespace amsdb { // gen:ns_func } // gen:ns_func // gen:ns_operators namespace algo { inline algo::cstring &operator <<(algo::cstring &str, const amsdb::FieldId &row);// cfmt:amsdb.FieldId.String -inline algo::cstring &operator <<(algo::cstring &str, const amsdb::ProcType &row);// cfmt:amsdb.ProcType.String -inline algo::cstring &operator <<(algo::cstring &str, const amsdb::StreamType &row);// cfmt:amsdb.StreamType.String +inline algo::cstring &operator <<(algo::cstring &str, const amsdb::Proctype &row);// cfmt:amsdb.Proctype.String +inline algo::cstring &operator <<(algo::cstring &str, const amsdb::Shmtype &row);// cfmt:amsdb.Shmtype.String } diff --git a/include/gen/amsdb_gen.inl.h b/include/gen/amsdb_gen.inl.h index 506d3bb3..613d37a3 100644 --- a/include/gen/amsdb_gen.inl.h +++ b/include/gen/amsdb_gen.inl.h @@ -66,19 +66,26 @@ inline amsdb::FieldId::FieldId(amsdb_FieldIdEnum arg) { this->value = i32(arg); } -// --- amsdb.ProcType..Init +// --- amsdb.Proctype..Init // Set all fields to initial values. -inline void amsdb::ProcType_Init(amsdb::ProcType& parent) { +inline void amsdb::Proctype_Init(amsdb::Proctype& parent) { parent.id = u32(0); } -// --- amsdb.ProcType..Ctor -inline amsdb::ProcType::ProcType() { - amsdb::ProcType_Init(*this); +// --- amsdb.Proctype..Ctor +inline amsdb::Proctype::Proctype() { + amsdb::Proctype_Init(*this); } -// --- amsdb.StreamType..Ctor -inline amsdb::StreamType::StreamType() { +// --- amsdb.Shmtype..Init +// Set all fields to initial values. +inline void amsdb::Shmtype_Init(amsdb::Shmtype& parent) { + parent.nonblock = bool(false); +} + +// --- amsdb.Shmtype..Ctor +inline amsdb::Shmtype::Shmtype() { + amsdb::Shmtype_Init(*this); } inline algo::cstring &algo::operator <<(algo::cstring &str, const amsdb::FieldId &row) {// cfmt:amsdb.FieldId.String @@ -86,12 +93,12 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const amsdb::FieldId return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const amsdb::ProcType &row) {// cfmt:amsdb.ProcType.String - amsdb::ProcType_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const amsdb::Proctype &row) {// cfmt:amsdb.Proctype.String + amsdb::Proctype_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const amsdb::StreamType &row) {// cfmt:amsdb.StreamType.String - amsdb::StreamType_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const amsdb::Shmtype &row) {// cfmt:amsdb.Shmtype.String + amsdb::Shmtype_Print(const_cast(row), str); return str; } diff --git a/include/gen/apm_gen.h b/include/gen/apm_gen.h index b835836e..143be8ea 100644 --- a/include/gen/apm_gen.h +++ b/include/gen/apm_gen.h @@ -126,8 +126,6 @@ namespace apm { struct FieldId; } namespace apm { struct TableId; } namespace apm { extern struct apm::FDb _db; } namespace apm { // gen:ns_gsymbol - extern const algo::strptr dev_package_amc; // "amc" - extern const algo::strptr dev_package_apm; // "apm" extern const algo::strptr dev_package_openacr; // "openacr" } // gen:ns_gsymbol namespace apm { // gen:ns_print_struct @@ -141,16 +139,17 @@ namespace apm { // gen:ns_print_struct // access: apm.FSsimfile.p_ctype (Upptr) // access: apm.FSsimreq.p_ctype (Upptr) struct FCtype { // apm.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - apm::FSsimfile* c_ssimfile; // optional pointer - apm::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - apm::FSsimreq** c_ssimreq_elems; // array of pointers - u32 c_ssimreq_n; // array of pointers - u32 c_ssimreq_max; // capacity of allocated array - apm::FCtype* ind_ctype_next; // hash next + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + apm::FSsimfile* c_ssimfile; // optional pointer + apm::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + apm::FSsimreq** c_ssimreq_elems; // array of pointers + u32 c_ssimreq_n; // array of pointers + u32 c_ssimreq_max; // capacity of allocated array + apm::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // x-reference on apm.FCtype.c_ssimfile prevents copy // reftype Ptrary of apm.FCtype.c_field prohibits copy // reftype Ptrary of apm.FCtype.c_ssimreq prohibits copy @@ -540,6 +539,9 @@ void ind_package_Remove(apm::FPackage& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:apm.FDb.ind_package.Reserve void ind_package_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:apm.FDb.ind_package.AbsReserve +void ind_package_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -681,6 +683,9 @@ void ind_mergefile_Remove(apm::FMergefile& row) __attribute__((n // Reserve enough room in the hash for N more elements. Return success code. // func:apm.FDb.ind_mergefile.Reserve void ind_mergefile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:apm.FDb.ind_mergefile.AbsReserve +void ind_mergefile_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:apm.FDb.ind_pkgkey.EmptyQ @@ -703,6 +708,9 @@ void ind_pkgkey_Remove(apm::FPkgkey& row) __attribute__((nothrow // Reserve enough room in the hash for N more elements. Return success code. // func:apm.FDb.ind_pkgkey.Reserve void ind_pkgkey_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:apm.FDb.ind_pkgkey.AbsReserve +void ind_pkgkey_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -768,6 +776,9 @@ void ind_ctype_Remove(apm::FCtype& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:apm.FDb.ind_ctype.Reserve void ind_ctype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:apm.FDb.ind_ctype.AbsReserve +void ind_ctype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -830,6 +841,9 @@ void ind_field_Remove(apm::FField& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:apm.FDb.ind_field.Reserve void ind_field_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:apm.FDb.ind_field.AbsReserve +void ind_field_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -892,6 +906,9 @@ void ind_ssimfile_Remove(apm::FSsimfile& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:apm.FDb.ind_ssimfile.Reserve void ind_ssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:apm.FDb.ind_ssimfile.AbsReserve +void ind_ssimfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -944,6 +961,9 @@ void ind_rec_Remove(apm::FRec& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:apm.FDb.ind_rec.Reserve void ind_rec_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:apm.FDb.ind_rec.AbsReserve +void ind_rec_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:apm.FDb.zd_rec.EmptyQ @@ -1263,6 +1283,9 @@ void ind_mkdir_Remove(apm::FMkdir& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:apm.FDb.ind_mkdir.Reserve void ind_mkdir_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:apm.FDb.ind_mkdir.AbsReserve +void ind_mkdir_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1523,6 +1546,7 @@ void FDb_Uninit() __attribute__((nothrow)); // access: apm.FSubstr.p_srcfield (Upptr) struct FField { // apm.FField apm::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -1587,14 +1611,15 @@ void FField_Uninit(apm::FField& field) __attribute__((nothrow)); // global access: mergefile (Lary, by rowid) // global access: ind_mergefile (Thash, hash field mergefile) struct FMergefile { // apm.FMergefile - apm::FMergefile* ind_mergefile_next; // hash next - algo::cstring mergefile; // - algo::cstring base_file; // - i32 base_mode; // 0 - algo::cstring ours_file; // - i32 ours_mode; // 0 - algo::cstring theirs_file; // - i32 theirs_mode; // 0 + apm::FMergefile* ind_mergefile_next; // hash next + u32 ind_mergefile_hashval; // hash value + algo::cstring mergefile; // + algo::cstring base_file; // + i32 base_mode; // 0 + algo::cstring ours_file; // + i32 ours_mode; // 0 + algo::cstring theirs_file; // + i32 theirs_mode; // 0 // func:apm.FMergefile..AssignOp inline apm::FMergefile& operator =(const apm::FMergefile &rhs) = delete; // func:apm.FMergefile..CopyCtor @@ -1625,8 +1650,9 @@ void FMergefile_Print(apm::FMergefile& row, algo::cstring& str) // global access: mkdir (Lary, by rowid) // global access: ind_mkdir (Thash, hash field mkdir) struct FMkdir { // apm.FMkdir - apm::FMkdir* ind_mkdir_next; // hash next - algo::cstring mkdir; // + apm::FMkdir* ind_mkdir_next; // hash next + u32 ind_mkdir_hashval; // hash value + algo::cstring mkdir; // // func:apm.FMkdir..AssignOp inline apm::FMkdir& operator =(const apm::FMkdir &rhs) = delete; // func:apm.FMkdir..CopyCtor @@ -1686,6 +1712,7 @@ struct FPackage { // apm.FPackage apm::FPackage* zd_sel_package_next; // zslist link; -1 means not-in-list apm::FPackage* zd_sel_package_prev; // previous element apm::FPackage* ind_package_next; // hash next + u32 ind_package_hashval; // hash value apm::FPackage* zd_topo_package_next; // zslist link; -1 means not-in-list apm::FPackage* zd_topo_package_prev; // previous element algo::Smallstr50 package; // Package name @@ -1743,7 +1770,7 @@ inline bool zd_pkgkey_EmptyQ(apm::FPackage& package) __attribute__((__w inline apm::FPkgkey* zd_pkgkey_First(apm::FPackage& package) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:apm.FPackage.zd_pkgkey.InLlistQ -inline bool zd_pkgkey_InLlistQ(apm::FPkgkey& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool package_zd_pkgkey_InLlistQ(apm::FPkgkey& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:apm.FPackage.zd_pkgkey.Insert void zd_pkgkey_Insert(apm::FPackage& package, apm::FPkgkey& row) __attribute__((nothrow)); @@ -1755,10 +1782,10 @@ inline apm::FPkgkey* zd_pkgkey_Last(apm::FPackage& package) __attribute__((__war inline i32 zd_pkgkey_N(const apm::FPackage& package) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:apm.FPackage.zd_pkgkey.Next -inline apm::FPkgkey* zd_pkgkey_Next(apm::FPkgkey &row) __attribute__((__warn_unused_result__, nothrow)); +inline apm::FPkgkey* package_zd_pkgkey_Next(apm::FPkgkey &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:apm.FPackage.zd_pkgkey.Prev -inline apm::FPkgkey* zd_pkgkey_Prev(apm::FPkgkey &row) __attribute__((__warn_unused_result__, nothrow)); +inline apm::FPkgkey* package_zd_pkgkey_Prev(apm::FPkgkey &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:apm.FPackage.zd_pkgkey.Remove void zd_pkgkey_Remove(apm::FPackage& package, apm::FPkgkey& row) __attribute__((nothrow)); @@ -1860,7 +1887,7 @@ inline bool zd_pkgrec_EmptyQ(apm::FPackage& package) __attribute__((__w inline apm::FPkgrec* zd_pkgrec_First(apm::FPackage& package) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:apm.FPackage.zd_pkgrec.InLlistQ -inline bool zd_pkgrec_InLlistQ(apm::FPkgrec& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool package_zd_pkgrec_InLlistQ(apm::FPkgrec& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:apm.FPackage.zd_pkgrec.Insert void zd_pkgrec_Insert(apm::FPackage& package, apm::FPkgrec& row) __attribute__((nothrow)); @@ -1872,10 +1899,10 @@ inline apm::FPkgrec* zd_pkgrec_Last(apm::FPackage& package) __attribute__((__war inline i32 zd_pkgrec_N(const apm::FPackage& package) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:apm.FPackage.zd_pkgrec.Next -inline apm::FPkgrec* zd_pkgrec_Next(apm::FPkgrec &row) __attribute__((__warn_unused_result__, nothrow)); +inline apm::FPkgrec* package_zd_pkgrec_Next(apm::FPkgrec &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:apm.FPackage.zd_pkgrec.Prev -inline apm::FPkgrec* zd_pkgrec_Prev(apm::FPkgrec &row) __attribute__((__warn_unused_result__, nothrow)); +inline apm::FPkgrec* package_zd_pkgrec_Prev(apm::FPkgrec &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:apm.FPackage.zd_pkgrec.Remove void zd_pkgrec_Remove(apm::FPackage& package, apm::FPkgrec& row) __attribute__((nothrow)); @@ -1999,14 +2026,15 @@ void FPkgdep_Uninit(apm::FPkgdep& pkgdep) __attribute__((nothrow // access: apm.FPackage.zd_pkgkey (Llist) // access: apm.FPkgrec.p_pkgkey (Upptr) struct FPkgkey { // apm.FPkgkey - apm::FPkgkey* ind_pkgkey_next; // hash next - apm::FPkgkey* zd_pkgkey_next; // zslist link; -1 means not-in-list - apm::FPkgkey* zd_pkgkey_prev; // previous element - algo::Smallstr150 pkgkey; // - algo::Comment comment; // - apm::FPkgrec** c_pkgrec_elems; // array of pointers - u32 c_pkgrec_n; // array of pointers - u32 c_pkgrec_max; // capacity of allocated array + apm::FPkgkey* ind_pkgkey_next; // hash next + u32 ind_pkgkey_hashval; // hash value + apm::FPkgkey* package_zd_pkgkey_next; // zslist link; -1 means not-in-list + apm::FPkgkey* package_zd_pkgkey_prev; // previous element + algo::Smallstr150 pkgkey; // + algo::Comment comment; // + apm::FPkgrec** c_pkgrec_elems; // array of pointers + u32 c_pkgrec_n; // array of pointers + u32 c_pkgrec_max; // capacity of allocated array // reftype Ptrary of apm.FPkgkey.c_pkgrec prohibits copy // func:apm.FPkgkey..AssignOp inline apm::FPkgkey& operator =(const apm::FPkgkey &rhs) = delete; @@ -2101,14 +2129,14 @@ void FPkgkey_Uninit(apm::FPkgkey& pkgkey) __attribute__((nothrow // access: apm.FRec.zd_rec_pkgrec (Llist) struct FPkgrec { // apm.FPkgrec apm::FPkgrec* pkgrec_next; // Pointer to next free element int tpool - apm::FPkgrec* zd_pkgrec_next; // zslist link; -1 means not-in-list - apm::FPkgrec* zd_pkgrec_prev; // previous element + apm::FPkgrec* package_zd_pkgrec_next; // zslist link; -1 means not-in-list + apm::FPkgrec* package_zd_pkgrec_prev; // previous element apm::FPackage* p_package; // reference to parent row apm::FRec* p_rec; // reference to parent row apm::FPkgkey* p_pkgkey; // reference to parent row bool pkgkey_c_pkgrec_in_ary; // false membership flag - apm::FPkgrec* zd_rec_pkgrec_next; // zslist link; -1 means not-in-list - apm::FPkgrec* zd_rec_pkgrec_prev; // previous element + apm::FPkgrec* rec_zd_rec_pkgrec_next; // zslist link; -1 means not-in-list + apm::FPkgrec* rec_zd_rec_pkgrec_prev; // previous element // func:apm.FPkgrec..AssignOp inline apm::FPkgrec& operator =(const apm::FPkgrec &rhs) = delete; // func:apm.FPkgrec..CopyCtor @@ -2139,26 +2167,27 @@ void FPkgrec_Uninit(apm::FPkgrec& pkgrec) __attribute__((nothrow // access: apm.FRec.c_child (Ptrary) // access: apm.FSsimfile.zd_ssimfile_rec (Llist) struct FRec { // apm.FRec - apm::FRec* rec_next; // Pointer to next free element int tpool - apm::FRec* ind_rec_next; // hash next - apm::FRec* zd_rec_next; // zslist link; -1 means not-in-list - apm::FRec* zd_rec_prev; // previous element - apm::FRec* zd_selrec_next; // zslist link; -1 means not-in-list - apm::FRec* zd_selrec_prev; // previous element - apm::FRec* zd_chooserec_next; // zslist link; -1 means not-in-list - apm::FRec* zd_chooserec_prev; // previous element - algo::cstring rec; // Primary key: ssimfile:pkey - apm::FSsimfile* p_ssimfile; // reference to parent row - algo::Tuple tuple; // Original record from file - apm::FRec** c_child_elems; // array of pointers - u32 c_child_n; // array of pointers - u32 c_child_max; // capacity of allocated array - i32 level; // 0 - apm::FPkgrec* zd_rec_pkgrec_head; // zero-terminated doubly linked list - i32 zd_rec_pkgrec_n; // zero-terminated doubly linked list - apm::FPkgrec* zd_rec_pkgrec_tail; // pointer to last element - apm::FRec* zd_ssimfile_rec_next; // zslist link; -1 means not-in-list - apm::FRec* zd_ssimfile_rec_prev; // previous element + apm::FRec* rec_next; // Pointer to next free element int tpool + apm::FRec* ind_rec_next; // hash next + u32 ind_rec_hashval; // hash value + apm::FRec* zd_rec_next; // zslist link; -1 means not-in-list + apm::FRec* zd_rec_prev; // previous element + apm::FRec* zd_selrec_next; // zslist link; -1 means not-in-list + apm::FRec* zd_selrec_prev; // previous element + apm::FRec* zd_chooserec_next; // zslist link; -1 means not-in-list + apm::FRec* zd_chooserec_prev; // previous element + algo::cstring rec; // Primary key: ssimfile:pkey + apm::FSsimfile* p_ssimfile; // reference to parent row + algo::Tuple tuple; // Original record from file + apm::FRec** c_child_elems; // array of pointers + u32 c_child_n; // array of pointers + u32 c_child_max; // capacity of allocated array + i32 level; // 0 + apm::FPkgrec* zd_rec_pkgrec_head; // zero-terminated doubly linked list + i32 zd_rec_pkgrec_n; // zero-terminated doubly linked list + apm::FPkgrec* zd_rec_pkgrec_tail; // pointer to last element + apm::FRec* ssimfile_zd_ssimfile_rec_next; // zslist link; -1 means not-in-list + apm::FRec* ssimfile_zd_ssimfile_rec_prev; // previous element // reftype Ptrary of apm.FRec.c_child prohibits copy // reftype Llist of apm.FRec.zd_rec_pkgrec prohibits copy // func:apm.FRec..AssignOp @@ -2226,7 +2255,7 @@ inline bool zd_rec_pkgrec_EmptyQ(apm::FRec& rec) __attribute__((__warn_ inline apm::FPkgrec* zd_rec_pkgrec_First(apm::FRec& rec) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:apm.FRec.zd_rec_pkgrec.InLlistQ -inline bool zd_rec_pkgrec_InLlistQ(apm::FPkgrec& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool rec_zd_rec_pkgrec_InLlistQ(apm::FPkgrec& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:apm.FRec.zd_rec_pkgrec.Insert void zd_rec_pkgrec_Insert(apm::FRec& rec, apm::FPkgrec& row) __attribute__((nothrow)); @@ -2238,10 +2267,10 @@ inline apm::FPkgrec* zd_rec_pkgrec_Last(apm::FRec& rec) __attribute__((__warn_un inline i32 zd_rec_pkgrec_N(const apm::FRec& rec) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:apm.FRec.zd_rec_pkgrec.Next -inline apm::FPkgrec* zd_rec_pkgrec_Next(apm::FPkgrec &row) __attribute__((__warn_unused_result__, nothrow)); +inline apm::FPkgrec* rec_zd_rec_pkgrec_Next(apm::FPkgrec &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:apm.FRec.zd_rec_pkgrec.Prev -inline apm::FPkgrec* zd_rec_pkgrec_Prev(apm::FPkgrec &row) __attribute__((__warn_unused_result__, nothrow)); +inline apm::FPkgrec* rec_zd_rec_pkgrec_Prev(apm::FPkgrec &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:apm.FRec.zd_rec_pkgrec.Remove void zd_rec_pkgrec_Remove(apm::FRec& rec, apm::FPkgrec& row) __attribute__((nothrow)); @@ -2293,6 +2322,7 @@ void FRec_Uninit(apm::FRec& rec) __attribute__((nothrow)); // access: apm.FSsimreq.p_child_ssimfile (Upptr) struct FSsimfile { // apm.FSsimfile apm::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value algo::Smallstr50 ssimfile; // algo::Smallstr100 ctype; // apm::FCtype* p_ctype; // reference to parent row @@ -2342,7 +2372,7 @@ inline bool zd_ssimfile_rec_EmptyQ(apm::FSsimfile& ssimfile) __attribut inline apm::FRec* zd_ssimfile_rec_First(apm::FSsimfile& ssimfile) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:apm.FSsimfile.zd_ssimfile_rec.InLlistQ -inline bool zd_ssimfile_rec_InLlistQ(apm::FRec& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool ssimfile_zd_ssimfile_rec_InLlistQ(apm::FRec& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:apm.FSsimfile.zd_ssimfile_rec.Insert void zd_ssimfile_rec_Insert(apm::FSsimfile& ssimfile, apm::FRec& row) __attribute__((nothrow)); @@ -2354,10 +2384,10 @@ inline apm::FRec* zd_ssimfile_rec_Last(apm::FSsimfile& ssimfile) __attribute_ inline i32 zd_ssimfile_rec_N(const apm::FSsimfile& ssimfile) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:apm.FSsimfile.zd_ssimfile_rec.Next -inline apm::FRec* zd_ssimfile_rec_Next(apm::FRec &row) __attribute__((__warn_unused_result__, nothrow)); +inline apm::FRec* ssimfile_zd_ssimfile_rec_Next(apm::FRec &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:apm.FSsimfile.zd_ssimfile_rec.Prev -inline apm::FRec* zd_ssimfile_rec_Prev(apm::FRec &row) __attribute__((__warn_unused_result__, nothrow)); +inline apm::FRec* ssimfile_zd_ssimfile_rec_Prev(apm::FRec &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:apm.FSsimfile.zd_ssimfile_rec.Remove void zd_ssimfile_rec_Remove(apm::FSsimfile& ssimfile, apm::FRec& row) __attribute__((nothrow)); diff --git a/include/gen/apm_gen.inl.h b/include/gen/apm_gen.inl.h index 9551493c..c9144906 100644 --- a/include/gen/apm_gen.inl.h +++ b/include/gen/apm_gen.inl.h @@ -227,6 +227,7 @@ inline void apm::FCtype_Init(apm::FCtype& ctype) { ctype.c_ssimreq_n = 0; // (apm.FCtype.c_ssimreq) ctype.c_ssimreq_max = 0; // (apm.FCtype.c_ssimreq) ctype.ind_ctype_next = (apm::FCtype*)-1; // (apm.FDb.ind_ctype) not-in-hash + ctype.ind_ctype_hashval = 0; // stored hash value } // --- apm.FCtype..Ctor @@ -1549,6 +1550,7 @@ inline void apm::FMergefile_Init(apm::FMergefile& mergefile) { mergefile.ours_mode = i32(0); mergefile.theirs_mode = i32(0); mergefile.ind_mergefile_next = (apm::FMergefile*)-1; // (apm.FDb.ind_mergefile) not-in-hash + mergefile.ind_mergefile_hashval = 0; // stored hash value } // --- apm.FMergefile..Ctor @@ -1565,6 +1567,7 @@ inline apm::FMergefile::~FMergefile() { // Set all fields to initial values. inline void apm::FMkdir_Init(apm::FMkdir& mkdir) { mkdir.ind_mkdir_next = (apm::FMkdir*)-1; // (apm.FDb.ind_mkdir) not-in-hash + mkdir.ind_mkdir_hashval = 0; // stored hash value } // --- apm.FMkdir..Ctor @@ -1597,9 +1600,9 @@ inline apm::FPkgkey* apm::zd_pkgkey_First(apm::FPackage& package) { // --- apm.FPackage.zd_pkgkey.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool apm::zd_pkgkey_InLlistQ(apm::FPkgkey& row) { +inline bool apm::package_zd_pkgkey_InLlistQ(apm::FPkgkey& row) { bool result = false; - result = !(row.zd_pkgkey_next == (apm::FPkgkey*)-1); + result = !(row.package_zd_pkgkey_next == (apm::FPkgkey*)-1); return result; } @@ -1619,14 +1622,14 @@ inline i32 apm::zd_pkgkey_N(const apm::FPackage& package) { // --- apm.FPackage.zd_pkgkey.Next // Return pointer to next element in the list -inline apm::FPkgkey* apm::zd_pkgkey_Next(apm::FPkgkey &row) { - return row.zd_pkgkey_next; +inline apm::FPkgkey* apm::package_zd_pkgkey_Next(apm::FPkgkey &row) { + return row.package_zd_pkgkey_next; } // --- apm.FPackage.zd_pkgkey.Prev // Return pointer to previous element in the list -inline apm::FPkgkey* apm::zd_pkgkey_Prev(apm::FPkgkey &row) { - return row.zd_pkgkey_prev; +inline apm::FPkgkey* apm::package_zd_pkgkey_Prev(apm::FPkgkey &row) { + return row.package_zd_pkgkey_prev; } // --- apm.FPackage.zd_pkgkey.qLast @@ -1769,9 +1772,9 @@ inline apm::FPkgrec* apm::zd_pkgrec_First(apm::FPackage& package) { // --- apm.FPackage.zd_pkgrec.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool apm::zd_pkgrec_InLlistQ(apm::FPkgrec& row) { +inline bool apm::package_zd_pkgrec_InLlistQ(apm::FPkgrec& row) { bool result = false; - result = !(row.zd_pkgrec_next == (apm::FPkgrec*)-1); + result = !(row.package_zd_pkgrec_next == (apm::FPkgrec*)-1); return result; } @@ -1791,14 +1794,14 @@ inline i32 apm::zd_pkgrec_N(const apm::FPackage& package) { // --- apm.FPackage.zd_pkgrec.Next // Return pointer to next element in the list -inline apm::FPkgrec* apm::zd_pkgrec_Next(apm::FPkgrec &row) { - return row.zd_pkgrec_next; +inline apm::FPkgrec* apm::package_zd_pkgrec_Next(apm::FPkgrec &row) { + return row.package_zd_pkgrec_next; } // --- apm.FPackage.zd_pkgrec.Prev // Return pointer to previous element in the list -inline apm::FPkgrec* apm::zd_pkgrec_Prev(apm::FPkgrec &row) { - return row.zd_pkgrec_prev; +inline apm::FPkgrec* apm::package_zd_pkgrec_Prev(apm::FPkgrec &row) { + return row.package_zd_pkgrec_prev; } // --- apm.FPackage.zd_pkgrec.qLast @@ -1828,6 +1831,7 @@ inline void apm::FPackage_Init(apm::FPackage& package) { package.zd_sel_package_next = (apm::FPackage*)-1; // (apm.FDb.zd_sel_package) not-in-list package.zd_sel_package_prev = NULL; // (apm.FDb.zd_sel_package) package.ind_package_next = (apm::FPackage*)-1; // (apm.FDb.ind_package) not-in-hash + package.ind_package_hashval = 0; // stored hash value package.zd_topo_package_next = (apm::FPackage*)-1; // (apm.FDb.zd_topo_package) not-in-list package.zd_topo_package_prev = NULL; // (apm.FDb.zd_topo_package) } @@ -1847,7 +1851,7 @@ inline bool apm::package_zd_pkgkey_curs_ValidQ(package_zd_pkgkey_curs &curs) { // --- apm.FPackage.zd_pkgkey_curs.Next // proceed to next item inline void apm::package_zd_pkgkey_curs_Next(package_zd_pkgkey_curs &curs) { - apm::FPkgkey *next = (*curs.row).zd_pkgkey_next; + apm::FPkgkey *next = (*curs.row).package_zd_pkgkey_next; curs.row = next; } @@ -1922,7 +1926,7 @@ inline bool apm::package_zd_pkgrec_curs_ValidQ(package_zd_pkgrec_curs &curs) { // --- apm.FPackage.zd_pkgrec_curs.Next // proceed to next item inline void apm::package_zd_pkgrec_curs_Next(package_zd_pkgrec_curs &curs) { - apm::FPkgrec *next = (*curs.row).zd_pkgrec_next; + apm::FPkgrec *next = (*curs.row).package_zd_pkgrec_next; curs.row = next; } @@ -2027,8 +2031,9 @@ inline void apm::FPkgkey_Init(apm::FPkgkey& pkgkey) { pkgkey.c_pkgrec_n = 0; // (apm.FPkgkey.c_pkgrec) pkgkey.c_pkgrec_max = 0; // (apm.FPkgkey.c_pkgrec) pkgkey.ind_pkgkey_next = (apm::FPkgkey*)-1; // (apm.FDb.ind_pkgkey) not-in-hash - pkgkey.zd_pkgkey_next = (apm::FPkgkey*)-1; // (apm.FPackage.zd_pkgkey) not-in-list - pkgkey.zd_pkgkey_prev = NULL; // (apm.FPackage.zd_pkgkey) + pkgkey.ind_pkgkey_hashval = 0; // stored hash value + pkgkey.package_zd_pkgkey_next = (apm::FPkgkey*)-1; // (apm.FPackage.zd_pkgkey) not-in-list + pkgkey.package_zd_pkgkey_prev = NULL; // (apm.FPackage.zd_pkgkey) } // --- apm.FPkgkey.c_pkgrec_curs.Reset @@ -2074,10 +2079,10 @@ inline void apm::FPkgrec_Init(apm::FPkgrec& pkgrec) { pkgrec.p_pkgkey = NULL; pkgrec.pkgkey_c_pkgrec_in_ary = bool(false); pkgrec.pkgrec_next = (apm::FPkgrec*)-1; // (apm.FDb.pkgrec) not-in-tpool's freelist - pkgrec.zd_pkgrec_next = (apm::FPkgrec*)-1; // (apm.FPackage.zd_pkgrec) not-in-list - pkgrec.zd_pkgrec_prev = NULL; // (apm.FPackage.zd_pkgrec) - pkgrec.zd_rec_pkgrec_next = (apm::FPkgrec*)-1; // (apm.FRec.zd_rec_pkgrec) not-in-list - pkgrec.zd_rec_pkgrec_prev = NULL; // (apm.FRec.zd_rec_pkgrec) + pkgrec.package_zd_pkgrec_next = (apm::FPkgrec*)-1; // (apm.FPackage.zd_pkgrec) not-in-list + pkgrec.package_zd_pkgrec_prev = NULL; // (apm.FPackage.zd_pkgrec) + pkgrec.rec_zd_rec_pkgrec_next = (apm::FPkgrec*)-1; // (apm.FRec.zd_rec_pkgrec) not-in-list + pkgrec.rec_zd_rec_pkgrec_prev = NULL; // (apm.FRec.zd_rec_pkgrec) } // --- apm.FPkgrec..Ctor @@ -2154,9 +2159,9 @@ inline apm::FPkgrec* apm::zd_rec_pkgrec_First(apm::FRec& rec) { // --- apm.FRec.zd_rec_pkgrec.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool apm::zd_rec_pkgrec_InLlistQ(apm::FPkgrec& row) { +inline bool apm::rec_zd_rec_pkgrec_InLlistQ(apm::FPkgrec& row) { bool result = false; - result = !(row.zd_rec_pkgrec_next == (apm::FPkgrec*)-1); + result = !(row.rec_zd_rec_pkgrec_next == (apm::FPkgrec*)-1); return result; } @@ -2176,14 +2181,14 @@ inline i32 apm::zd_rec_pkgrec_N(const apm::FRec& rec) { // --- apm.FRec.zd_rec_pkgrec.Next // Return pointer to next element in the list -inline apm::FPkgrec* apm::zd_rec_pkgrec_Next(apm::FPkgrec &row) { - return row.zd_rec_pkgrec_next; +inline apm::FPkgrec* apm::rec_zd_rec_pkgrec_Next(apm::FPkgrec &row) { + return row.rec_zd_rec_pkgrec_next; } // --- apm.FRec.zd_rec_pkgrec.Prev // Return pointer to previous element in the list -inline apm::FPkgrec* apm::zd_rec_pkgrec_Prev(apm::FPkgrec &row) { - return row.zd_rec_pkgrec_prev; +inline apm::FPkgrec* apm::rec_zd_rec_pkgrec_Prev(apm::FPkgrec &row) { + return row.rec_zd_rec_pkgrec_prev; } // --- apm.FRec.zd_rec_pkgrec.qLast @@ -2207,14 +2212,15 @@ inline void apm::FRec_Init(apm::FRec& rec) { rec.zd_rec_pkgrec_tail = NULL; // (apm.FRec.zd_rec_pkgrec) rec.rec_next = (apm::FRec*)-1; // (apm.FDb.rec) not-in-tpool's freelist rec.ind_rec_next = (apm::FRec*)-1; // (apm.FDb.ind_rec) not-in-hash + rec.ind_rec_hashval = 0; // stored hash value rec.zd_rec_next = (apm::FRec*)-1; // (apm.FDb.zd_rec) not-in-list rec.zd_rec_prev = NULL; // (apm.FDb.zd_rec) rec.zd_selrec_next = (apm::FRec*)-1; // (apm.FDb.zd_selrec) not-in-list rec.zd_selrec_prev = NULL; // (apm.FDb.zd_selrec) rec.zd_chooserec_next = (apm::FRec*)-1; // (apm.FDb.zd_chooserec) not-in-list rec.zd_chooserec_prev = NULL; // (apm.FDb.zd_chooserec) - rec.zd_ssimfile_rec_next = (apm::FRec*)-1; // (apm.FSsimfile.zd_ssimfile_rec) not-in-list - rec.zd_ssimfile_rec_prev = NULL; // (apm.FSsimfile.zd_ssimfile_rec) + rec.ssimfile_zd_ssimfile_rec_next = (apm::FRec*)-1; // (apm.FSsimfile.zd_ssimfile_rec) not-in-list + rec.ssimfile_zd_ssimfile_rec_prev = NULL; // (apm.FSsimfile.zd_ssimfile_rec) } // --- apm.FRec.c_child_curs.Reset @@ -2257,7 +2263,7 @@ inline bool apm::rec_zd_rec_pkgrec_curs_ValidQ(rec_zd_rec_pkgrec_curs &curs) { // --- apm.FRec.zd_rec_pkgrec_curs.Next // proceed to next item inline void apm::rec_zd_rec_pkgrec_curs_Next(rec_zd_rec_pkgrec_curs &curs) { - apm::FPkgrec *next = (*curs.row).zd_rec_pkgrec_next; + apm::FPkgrec *next = (*curs.row).rec_zd_rec_pkgrec_next; curs.row = next; } @@ -2293,9 +2299,9 @@ inline apm::FRec* apm::zd_ssimfile_rec_First(apm::FSsimfile& ssimfile) { // --- apm.FSsimfile.zd_ssimfile_rec.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool apm::zd_ssimfile_rec_InLlistQ(apm::FRec& row) { +inline bool apm::ssimfile_zd_ssimfile_rec_InLlistQ(apm::FRec& row) { bool result = false; - result = !(row.zd_ssimfile_rec_next == (apm::FRec*)-1); + result = !(row.ssimfile_zd_ssimfile_rec_next == (apm::FRec*)-1); return result; } @@ -2315,14 +2321,14 @@ inline i32 apm::zd_ssimfile_rec_N(const apm::FSsimfile& ssimfile) { // --- apm.FSsimfile.zd_ssimfile_rec.Next // Return pointer to next element in the list -inline apm::FRec* apm::zd_ssimfile_rec_Next(apm::FRec &row) { - return row.zd_ssimfile_rec_next; +inline apm::FRec* apm::ssimfile_zd_ssimfile_rec_Next(apm::FRec &row) { + return row.ssimfile_zd_ssimfile_rec_next; } // --- apm.FSsimfile.zd_ssimfile_rec.Prev // Return pointer to previous element in the list -inline apm::FRec* apm::zd_ssimfile_rec_Prev(apm::FRec &row) { - return row.zd_ssimfile_rec_prev; +inline apm::FRec* apm::ssimfile_zd_ssimfile_rec_Prev(apm::FRec &row) { + return row.ssimfile_zd_ssimfile_rec_prev; } // --- apm.FSsimfile.zd_ssimfile_rec.qLast @@ -2341,6 +2347,7 @@ inline void apm::FSsimfile_Init(apm::FSsimfile& ssimfile) { ssimfile.zd_ssimfile_rec_n = 0; // (apm.FSsimfile.zd_ssimfile_rec) ssimfile.zd_ssimfile_rec_tail = NULL; // (apm.FSsimfile.zd_ssimfile_rec) ssimfile.ind_ssimfile_next = (apm::FSsimfile*)-1; // (apm.FDb.ind_ssimfile) not-in-hash + ssimfile.ind_ssimfile_hashval = 0; // stored hash value } // --- apm.FSsimfile.zd_ssimfile_rec_curs.Reset @@ -2358,7 +2365,7 @@ inline bool apm::ssimfile_zd_ssimfile_rec_curs_ValidQ(ssimfile_zd_ssimfile_rec_c // --- apm.FSsimfile.zd_ssimfile_rec_curs.Next // proceed to next item inline void apm::ssimfile_zd_ssimfile_rec_curs_Next(ssimfile_zd_ssimfile_rec_curs &curs) { - apm::FRec *next = (*curs.row).zd_ssimfile_rec_next; + apm::FRec *next = (*curs.row).ssimfile_zd_ssimfile_rec_next; curs.row = next; } diff --git a/include/gen/atf_amc_gen.h b/include/gen/atf_amc_gen.h index c112bb8b..21a631bc 100644 --- a/include/gen/atf_amc_gen.h +++ b/include/gen/atf_amc_gen.h @@ -35,9 +35,9 @@ // --- atf_amc_BitfldType2_value_Enum -enum atf_amc_BitfldType2_value_Enum { // atf_amc.BitfldType2.value - atf_amc_BitfldType2_value_bit0 = (u64(1)<<0) // atf_amc.BitfldType2.bit0 - ,atf_amc_BitfldType2_value_bit1 = (u64(1)<<1) // atf_amc.BitfldType2.bit1 +enum atf_amc_BitfldType2_value_Enum { // atf_amc.BitfldType2.value + atf_amc_BitfldType2_value_bit0 = 0x1 // atf_amc.BitfldType2.bit0 + ,atf_amc_BitfldType2_value_bit1 = 0x2 // atf_amc.BitfldType2.bit1 }; enum { atf_amc_BitfldType2_value_Enum_N = 2 }; @@ -184,17 +184,29 @@ enum atf_amc_FieldIdEnum { // atf_amc.FieldId.value ,atf_amc_FieldId_typeh = 109 ,atf_amc_FieldId_types = 110 ,atf_amc_FieldId_comment = 111 - ,atf_amc_FieldId_i = 112 - ,atf_amc_FieldId_k = 113 - ,atf_amc_FieldId_strval_regx = 114 - ,atf_amc_FieldId_strval2_regx = 115 - ,atf_amc_FieldId_start_dateval = 116 - ,atf_amc_FieldId_end_dateval = 117 - ,atf_amc_FieldId_start_intval = 118 - ,atf_amc_FieldId_end_intval = 119 -}; - -enum { atf_amc_FieldIdEnum_N = 120 }; + ,atf_amc_FieldId_s1 = 112 + ,atf_amc_FieldId_s2 = 113 + ,atf_amc_FieldId_s3 = 114 + ,atf_amc_FieldId_u1 = 115 + ,atf_amc_FieldId_u2 = 116 + ,atf_amc_FieldId_u3 = 117 + ,atf_amc_FieldId_m1 = 118 + ,atf_amc_FieldId_m2 = 119 + ,atf_amc_FieldId_m3 = 120 + ,atf_amc_FieldId_v1 = 121 + ,atf_amc_FieldId_v2 = 122 + ,atf_amc_FieldId_v3 = 123 + ,atf_amc_FieldId_i = 124 + ,atf_amc_FieldId_k = 125 + ,atf_amc_FieldId_strval_regx = 126 + ,atf_amc_FieldId_strval2_regx = 127 + ,atf_amc_FieldId_start_dateval = 128 + ,atf_amc_FieldId_end_dateval = 129 + ,atf_amc_FieldId_start_intval = 130 + ,atf_amc_FieldId_end_intval = 131 +}; + +enum { atf_amc_FieldIdEnum_N = 132 }; // --- atf_amc_MsgHdrLT_type_Enum @@ -223,13 +235,17 @@ enum { atf_amc_MsgHdrLTMsgsCaseEnum_N = 4 }; // --- atf_amc_MsgTypeEnum -enum atf_amc_MsgTypeEnum { // atf_amc.MsgType.value - atf_amc_MsgType_atf_amc_Seqmsg = 0x0905 // Sequenced message for stream - ,atf_amc_MsgType_atf_amc_Text = 0x0412 - ,atf_amc_MsgType_atf_amc_VarlenMsg = 0x1000 +enum atf_amc_MsgTypeEnum { // atf_amc.MsgType.value + atf_amc_MsgType_atf_amc_Seqmsg = 0x0905 // Sequenced message for stream + ,atf_amc_MsgType_atf_amc_Text = 0x0412 + ,atf_amc_MsgType_atf_amc_Varlen2Msg = 0x1001 + ,atf_amc_MsgType_atf_amc_Varlen2aMsg = 0x1002 + ,atf_amc_MsgType_atf_amc_Varlen2mMsg = 0x1004 + ,atf_amc_MsgType_atf_amc_Varlen2vMsg = 0x1003 + ,atf_amc_MsgType_atf_amc_VarlenMsg = 0x1000 }; -enum { atf_amc_MsgTypeEnum_N = 3 }; +enum { atf_amc_MsgTypeEnum_N = 7 }; // --- atf_amc_MsgsCaseEnum @@ -314,6 +330,7 @@ namespace atfdb { struct Amctest; } namespace atf_amc { struct FCascdel; } namespace atf_amc { struct Cstring; } namespace dmmeta { struct Listtype; } +namespace atf_amc { struct FListtype; } namespace atf_amc { struct OptG; } namespace atf_amc { struct TypeG; } namespace atf_amc { struct TypeA; } @@ -321,10 +338,11 @@ namespace atf_amc { struct TypeB; } namespace atf_amc { struct TypeC; } namespace atf_amc { struct TypeS; } namespace atf_amc { struct TypeT; } +namespace atf_amc { struct Hooktype; } namespace atf_amc { struct MsgHdrLT; } namespace atf_amc { struct MsgHeader; } -namespace atf_amc { struct TypeH; } namespace atf_amc { struct VarlenK; } +namespace atf_amc { struct TypeH; } namespace atf_amc { struct DispType1; } namespace atf_amc { struct DispType2; } namespace atf_amc { struct DispType3; } @@ -335,6 +353,10 @@ namespace atf_amc { struct MsgLTO; } namespace atf_amc { struct MsgLTV; } namespace atf_amc { struct Seqmsg; } namespace atf_amc { struct Text; } +namespace atf_amc { struct Varlen2Msg; } +namespace atf_amc { struct Varlen2aMsg; } +namespace atf_amc { struct Varlen2mMsg; } +namespace atf_amc { struct Varlen2vMsg; } namespace atf_amc { struct VarlenMsg; } namespace atf_amc { struct OptOptG; } namespace atf_amc { struct MsgType; } @@ -344,7 +366,6 @@ namespace atf_amc { struct Bitset_fld1_curs; } namespace atf_amc { struct Bitset_fld8_bitcurs; } namespace atf_amc { struct Bitset_fld64_bitcurs; } namespace atf_amc { struct Bitset_fld128_bitcurs; } -namespace atf_amc { struct DispFilter_pmask_bitcurs; } namespace atf_amc { struct DispFilter_pmask_curs; } namespace atf_amc { struct cascdel_c_child_ptrary_curs; } namespace atf_amc { struct cascdel_bh_child_bheap_curs; } @@ -374,10 +395,14 @@ namespace atf_amc { struct _db_cd_in_msg_curs; } namespace atf_amc { struct _db_amctest_curs; } namespace atf_amc { struct _db_c_typek_curs; } namespace atf_amc { struct _db_c_typek_oncecurs; } +namespace atf_amc { struct _db_c_typel_curs; } +namespace atf_amc { struct _db_c_typem_curs; } namespace atf_amc { struct _db_avl_curs; } namespace atf_amc { struct _db_tr_avl_curs; } namespace atf_amc { struct _db_listtype_curs; } namespace atf_amc { struct _db_thash_elem_curs; } +namespace atf_amc { struct _db_bh_time_entry_curs; } +namespace atf_amc { struct _db_ind_linear_curs; } namespace atf_amc { struct FPerfSortString_orig_curs; } namespace atf_amc { struct FPerfSortString_sorted1_curs; } namespace atf_amc { struct typea_typec_curs; } @@ -391,20 +416,26 @@ namespace atf_amc { struct InlaryPrint_fixary_curs; } namespace atf_amc { struct InlaryPrint_inlary_curs; } namespace atf_amc { struct Lary32_lary_curs; } namespace atf_amc { struct MsgLTV_v_curs; } -namespace atf_amc { struct PmaskMultiple_present_bitcurs; } -namespace atf_amc { struct PmaskMultiple_assigned_bitcurs; } -namespace atf_amc { struct PmaskMultiple_nullable_bitcurs; } -namespace atf_amc { struct PmaskU128_pmask_bitcurs; } -namespace atf_amc { struct PmaskU32_pmask_bitcurs; } -namespace atf_amc { struct PmaskU555_pmask_bitcurs; } namespace atf_amc { struct PmaskU555_pmask_curs; } namespace atf_amc { struct TaryU32_tary_u32_curs; } namespace atf_amc { struct TaryU8_ary_curs; } namespace atf_amc { struct Text_text_curs; } +namespace atf_amc { struct Varlen2Msg_s1_curs; } +namespace atf_amc { struct Varlen2Msg_s2_curs; } +namespace atf_amc { struct Varlen2Msg_s3_curs; } +namespace atf_amc { struct Varlen2aMsg_u1_curs; } +namespace atf_amc { struct Varlen2aMsg_u2_curs; } +namespace atf_amc { struct Varlen2aMsg_u3_curs; } +namespace atf_amc { struct Varlen2mMsg_m1_curs; } +namespace atf_amc { struct Varlen2mMsg_m2_curs; } +namespace atf_amc { struct Varlen2mMsg_m3_curs; } +namespace atf_amc { struct v1_i_curs; } +namespace atf_amc { struct Varlen2vMsg_v1_curs; } +namespace atf_amc { struct Varlen2vMsg_v2_curs; } +namespace atf_amc { struct Varlen2vMsg_v3_curs; } namespace atf_amc { struct varlenalloc_elem_curs; } namespace atf_amc { struct varlen_extern_varlen_curs; } namespace atf_amc { struct VarlenH_typeh_curs; } -namespace atf_amc { struct k_i_curs; } namespace atf_amc { struct VarlenMsg_k_curs; } namespace atf_amc { struct AmcCleanup2; } namespace atf_amc { struct AmcSubstr1; } @@ -425,22 +456,25 @@ namespace atf_amc { struct DispFilter; } namespace atf_amc { struct FAmctest; } namespace atf_amc { struct FAvl; } namespace atf_amc { struct FCstring; } -namespace atf_amc { struct FListtype; } namespace atf_amc { struct trace; } namespace atf_amc { struct FDb; } +namespace atf_amc { struct FHashableLinear; } namespace atf_amc { struct FOptG; } namespace atf_amc { struct FPerfSortString; } namespace atf_amc { struct FThashElem; } +namespace atf_amc { struct FTimeEntry; } namespace atf_amc { struct FTypeC; } namespace atf_amc { struct FTypeA; } namespace atf_amc { struct FTypeB; } namespace atf_amc { struct FTypeD; } namespace atf_amc { struct FTypeK; } +namespace atf_amc { struct FTypeL; } +namespace atf_amc { struct FTypeM; } namespace atf_amc { struct FTypeS; } namespace atf_amc { struct FTypeT; } namespace atf_amc { struct FUnitSort; } namespace atf_amc { struct FieldId; } -namespace atf_amc { struct Hooktype; } +namespace atf_amc { struct Hashable; } namespace atf_amc { struct InlaryPrint; } namespace atf_amc { struct Lary32; } namespace atf_amc { struct Linebuf; } @@ -464,6 +498,7 @@ namespace atf_amc { struct RpasU32Str6; } namespace atf_amc { struct Sep1; } namespace atf_amc { struct SortedStr; } namespace atf_amc { struct SsimfilesCase; } +namespace atf_amc { struct Strkey; } namespace atf_amc { struct TableId; } namespace atf_amc { struct TaryU32; } namespace atf_amc { struct TaryU8; } @@ -985,17 +1020,19 @@ inline void Bitset_Init(atf_amc::Bitset& parent); // --- atf_amc.Bytebuf // create: atf_amc.FDb.bytebuf (Cppstack) struct Bytebuf { // atf_amc.Bytebuf - u8 in_elems[64]; // pointer to elements of inline array + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array i32 in_start; // beginning of valid bytes (in bytes) i32 in_end; // end of valid bytes (in bytes) - bool in_eof; // no more data will be written to buffer + i32 in_msglen; // current message length algo::Errcode in_err; // system error code + bool in_eof; // no more data will be written to buffer bool in_msgvalid; // current message is valid - i32 in_msglen; // current message length bool in_epoll_enable; // use epoll? - enum { in_max = 64 }; // func:atf_amc.Bytebuf..Ctor inline Bytebuf() __attribute__((nothrow)); + // func:atf_amc.Bytebuf..Dtor + inline ~Bytebuf() __attribute__((nothrow)); }; // Detect incoming message in buffer and return it @@ -1006,6 +1043,12 @@ struct Bytebuf { // atf_amc.Bytebuf // // func:atf_amc.Bytebuf.in.GetMsg algo::aryptr in_GetMsg(atf_amc::Bytebuf& bytebuf) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:atf_amc.Bytebuf.in.Realloc +void in_Realloc(atf_amc::Bytebuf& bytebuf, int new_max) __attribute__((nothrow)); // Return max. number of bytes in the buffer. // func:atf_amc.Bytebuf.in.Max inline i32 in_Max(atf_amc::Bytebuf& bytebuf) __attribute__((nothrow)); @@ -1025,17 +1068,23 @@ void in_SkipBytes(atf_amc::Bytebuf& bytebuf, int n) __attribute_ // Skip current message, if any. // func:atf_amc.Bytebuf.in.SkipMsg void in_SkipMsg(atf_amc::Bytebuf& bytebuf) __attribute__((nothrow)); -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. // // func:atf_amc.Bytebuf.in.WriteAll bool in_WriteAll(atf_amc::Bytebuf& bytebuf, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:atf_amc.Bytebuf.in.WriteReserve +void in_WriteReserve(atf_amc::Bytebuf& bytebuf, u8 *in, i32 in_n) __attribute__((nothrow)); // Set all fields to initial values. // func:atf_amc.Bytebuf..Init void Bytebuf_Init(atf_amc::Bytebuf& bytebuf); +// func:atf_amc.Bytebuf..Uninit +void Bytebuf_Uninit(atf_amc::Bytebuf& bytebuf) __attribute__((nothrow)); // print string representation of ROW to string STR // cfmt:atf_amc.Bytebuf.String printfmt:Raw // func:atf_amc.Bytebuf..Print @@ -1048,10 +1097,10 @@ struct BytebufDyn { // atf_amc.BytebufDyn u32 in_max; // 0 current length of allocated array i32 in_start; // beginning of valid bytes (in bytes) i32 in_end; // end of valid bytes (in bytes) - bool in_eof; // no more data will be written to buffer + i32 in_msglen; // current message length algo::Errcode in_err; // system error code + bool in_eof; // no more data will be written to buffer bool in_msgvalid; // current message is valid - i32 in_msglen; // current message length bool in_epoll_enable; // use epoll? // func:atf_amc.BytebufDyn..Ctor inline BytebufDyn() __attribute__((nothrow)); @@ -1092,13 +1141,17 @@ void in_SkipBytes(atf_amc::BytebufDyn& bytebuf_dyn, int n) __att // Skip current message, if any. // func:atf_amc.BytebufDyn.in.SkipMsg void in_SkipMsg(atf_amc::BytebufDyn& bytebuf_dyn) __attribute__((nothrow)); -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. // // func:atf_amc.BytebufDyn.in.WriteAll bool in_WriteAll(atf_amc::BytebufDyn& bytebuf_dyn, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:atf_amc.BytebufDyn.in.WriteReserve +void in_WriteReserve(atf_amc::BytebufDyn& bytebuf_dyn, u8 *in, i32 in_n) __attribute__((nothrow)); // Set all fields to initial values. // func:atf_amc.BytebufDyn..Init @@ -1568,17 +1621,6 @@ inline int intval_Present_GetBit(atf_amc::DispFilter& parent) __attrib // func:atf_amc.DispFilter.intval.Set inline void intval_Set(atf_amc::DispFilter& parent, u32 rhs) __attribute__((nothrow)); -// proceed to next item -// func:atf_amc.DispFilter.pmask_bitcurs.Next -void DispFilter_pmask_bitcurs_Next(DispFilter_pmask_bitcurs &curs); -// func:atf_amc.DispFilter.pmask_bitcurs.Reset -inline void DispFilter_pmask_bitcurs_Reset(DispFilter_pmask_bitcurs &curs, atf_amc::DispFilter &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:atf_amc.DispFilter.pmask_bitcurs.ValidQ -inline bool DispFilter_pmask_bitcurs_ValidQ(DispFilter_pmask_bitcurs &curs) __attribute__((nothrow)); -// item access -// func:atf_amc.DispFilter.pmask_bitcurs.Access -inline int& DispFilter_pmask_bitcurs_Access(DispFilter_pmask_bitcurs &curs) __attribute__((nothrow)); // cursor points to valid item // func:atf_amc.DispFilter.pmask_curs.Reset inline void DispFilter_pmask_curs_Reset(DispFilter_pmask_curs &curs, atf_amc::DispFilter &parent) __attribute__((nothrow)); @@ -1746,34 +1788,35 @@ void FAvl_Uninit(atf_amc::FAvl& avl) __attribute__((nothrow)); // access: atf_amc.FCascdel.zd_childlist (Llist) // access: atf_amc.FCascdel.tr_child_atree (Atree) struct FCascdel { // atf_amc.FCascdel: Test type for cascade delete - atf_amc::FCascdel* p_parent; // reference to parent row - u32 key; // 0 - u32 type; // 0 - atf_amc::FCascdel* child_ptr; // optional pointer - atf_amc::FCascdel** c_child_ptrary_elems; // array of pointers - u32 c_child_ptrary_n; // array of pointers - u32 c_child_ptrary_max; // capacity of allocated array - atf_amc::FCascdel** ind_child_thash_buckets_elems; // pointer to bucket array - i32 ind_child_thash_buckets_n; // number of elements in bucket array - i32 ind_child_thash_n; // number of elements in the hash table - atf_amc::FCascdel* ind_child_thash_next; // hash next - atf_amc::FCascdel** bh_child_bheap_elems; // binary heap by key - i32 bh_child_bheap_n; // number of elements in the heap - i32 bh_child_bheap_max; // max elements in bh_child_bheap_elems - i32 bh_child_bheap_idx; // index in heap; -1 means not-in-heap - atf_amc::FCascdel* zd_childlist_head; // zero-terminated doubly linked list - i32 zd_childlist_n; // zero-terminated doubly linked list - atf_amc::FCascdel* zd_childlist_tail; // pointer to last element - atf_amc::FCascdel* zd_childlist_next; // zslist link; -1 means not-in-list - atf_amc::FCascdel* zd_childlist_prev; // previous element - atf_amc::FCascdel* tr_child_atree_root; // Root of the tree - i32 tr_child_atree_n; // number of elements in the tree - atf_amc::FCascdel* tr_child_atree_up; // pointer to parent - atf_amc::FCascdel* tr_child_atree_left; // Left child - atf_amc::FCascdel* tr_child_atree_right; // Right child - i32 tr_child_atree_depth; // Depth - bool cascdel_c_child_ptrary_in_ary; // false membership flag - atf_amc::FCascdel* cascdel_next; // Pointer to next free element int tpool + atf_amc::FCascdel* p_parent; // reference to parent row + u32 key; // 0 + u32 type; // 0 + atf_amc::FCascdel* child_ptr; // optional pointer + atf_amc::FCascdel** c_child_ptrary_elems; // array of pointers + u32 c_child_ptrary_n; // array of pointers + u32 c_child_ptrary_max; // capacity of allocated array + atf_amc::FCascdel** ind_child_thash_buckets_elems; // pointer to bucket array + i32 ind_child_thash_buckets_n; // number of elements in bucket array + i32 ind_child_thash_n; // number of elements in the hash table + atf_amc::FCascdel* cascdel_ind_child_thash_next; // hash next + u32 cascdel_ind_child_thash_hashval; // hash value + atf_amc::FCascdel** bh_child_bheap_elems; // binary heap by key + i32 bh_child_bheap_n; // number of elements in the heap + i32 bh_child_bheap_max; // max elements in bh_child_bheap_elems + i32 cascdel_bh_child_bheap_idx; // index in heap; -1 means not-in-heap + atf_amc::FCascdel* zd_childlist_head; // zero-terminated doubly linked list + i32 zd_childlist_n; // zero-terminated doubly linked list + atf_amc::FCascdel* zd_childlist_tail; // pointer to last element + atf_amc::FCascdel* cascdel_zd_childlist_next; // zslist link; -1 means not-in-list + atf_amc::FCascdel* cascdel_zd_childlist_prev; // previous element + atf_amc::FCascdel* tr_child_atree_root; // Root of the tree + i32 tr_child_atree_n; // number of elements in the tree + atf_amc::FCascdel* cascdel_tr_child_atree_up; // pointer to parent + atf_amc::FCascdel* cascdel_tr_child_atree_left; // Left child + atf_amc::FCascdel* cascdel_tr_child_atree_right; // Right child + i32 cascdel_tr_child_atree_depth; // Depth + bool cascdel_c_child_ptrary_in_ary; // false membership flag + atf_amc::FCascdel* cascdel_next; // Pointer to next free element int tpool // x-reference on atf_amc.FCascdel.child_ptr prevents copy // reftype Ptrary of atf_amc.FCascdel.c_child_ptrary prohibits copy // reftype Thash of atf_amc.FCascdel.ind_child_thash prohibits copy @@ -1893,6 +1936,9 @@ inline bool ind_child_thash_EmptyQ(atf_amc::FCascdel& cascdel) __attrib // Find row by key. Return NULL if not found. // func:atf_amc.FCascdel.ind_child_thash.Find atf_amc::FCascdel* ind_child_thash_Find(atf_amc::FCascdel& cascdel, u32 key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:atf_amc.FCascdel.ind_child_thash.FindX +atf_amc::FCascdel& ind_child_thash_FindX(atf_amc::FCascdel& cascdel, u32 key); // Return number of items in the hash // func:atf_amc.FCascdel.ind_child_thash.N inline i32 ind_child_thash_N(const atf_amc::FCascdel& cascdel) __attribute__((__warn_unused_result__, nothrow, pure)); @@ -1905,6 +1951,9 @@ void ind_child_thash_Remove(atf_amc::FCascdel& cascdel, atf_amc: // Reserve enough room in the hash for N more elements. Return success code. // func:atf_amc.FCascdel.ind_child_thash.Reserve void ind_child_thash_Reserve(atf_amc::FCascdel& cascdel, int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_amc.FCascdel.ind_child_thash.AbsReserve +void ind_child_thash_AbsReserve(atf_amc::FCascdel& cascdel, int n) __attribute__((nothrow)); // Delete referred-to items. // Delete all elements referenced by the heap. @@ -1972,7 +2021,7 @@ inline bool zd_childlist_EmptyQ(atf_amc::FCascdel& cascdel) __attribute inline atf_amc::FCascdel* zd_childlist_First(atf_amc::FCascdel& cascdel) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:atf_amc.FCascdel.zd_childlist.InLlistQ -inline bool zd_childlist_InLlistQ(atf_amc::FCascdel& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool cascdel_zd_childlist_InLlistQ(atf_amc::FCascdel& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:atf_amc.FCascdel.zd_childlist.Insert void zd_childlist_Insert(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& row) __attribute__((nothrow)); @@ -1984,10 +2033,10 @@ inline atf_amc::FCascdel* zd_childlist_Last(atf_amc::FCascdel& cascdel) __attrib inline i32 zd_childlist_N(const atf_amc::FCascdel& cascdel) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:atf_amc.FCascdel.zd_childlist.Next -inline atf_amc::FCascdel* zd_childlist_Next(atf_amc::FCascdel &row) __attribute__((__warn_unused_result__, nothrow)); +inline atf_amc::FCascdel* cascdel_zd_childlist_Next(atf_amc::FCascdel &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:atf_amc.FCascdel.zd_childlist.Prev -inline atf_amc::FCascdel* zd_childlist_Prev(atf_amc::FCascdel &row) __attribute__((__warn_unused_result__, nothrow)); +inline atf_amc::FCascdel* cascdel_zd_childlist_Prev(atf_amc::FCascdel &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:atf_amc.FCascdel.zd_childlist.Remove void zd_childlist_Remove(atf_amc::FCascdel& cascdel, atf_amc::FCascdel& row) __attribute__((nothrow)); @@ -2124,8 +2173,9 @@ void FCascdel_Print(atf_amc::FCascdel& row, algo::cstring& str) // global access: cstring (Lary, by rowid) // global access: ind_cstring (Thash, hash field str) struct FCstring { // atf_amc.FCstring - algo::cstring str; // - atf_amc::FCstring* ind_cstring_next; // hash next + algo::cstring str; // + atf_amc::FCstring* ind_cstring_next; // hash next + u32 ind_cstring_hashval; // hash value // func:atf_amc.FCstring..AssignOp inline atf_amc::FCstring& operator =(const atf_amc::FCstring &rhs) = delete; // func:atf_amc.FCstring..CopyCtor @@ -2215,106 +2265,135 @@ void trace_Print(atf_amc::trace& row, algo::cstring& str) __attr // --- atf_amc.FDb // create: atf_amc.FDb._db (Global) struct FDb { // atf_amc.FDb: In-memory database for atf_amc - command::atf_amc cmdline; // - atf_amc::FTypeC** bh_typec_elems; // binary heap by typec - i32 bh_typec_n; // number of elements in the heap - i32 bh_typec_max; // max elements in bh_typec_elems - atf_amc::FTypeC* zdl_h_typec_head; // zero-terminated doubly linked list - i32 zdl_h_typec_n; // zero-terminated doubly linked list - atf_amc::FTypeC* zdl_h_typec_tail; // pointer to last element - atf_amc::FTypeC* zd_t_typec_head; // zero-terminated doubly linked list - i32 zd_t_typec_n; // zero-terminated doubly linked list - atf_amc::FTypeC* zd_t_typec_tail; // pointer to last element - atf_amc::FTypeD* zd_typed_head; // zero-terminated doubly linked list - i32 zd_typed_n; // zero-terminated doubly linked list - atf_amc::FTypeD* zd_typed_tail; // pointer to last element - atf_amc::FTypeD* zs_t_typed_head; // zero-terminated singly linked list - i32 zs_t_typed_n; // zero-terminated singly linked list - atf_amc::FTypeD* zs_t_typed_tail; // pointer to last element - atf_amc::FTypeD* cd_typed_head; // zero-terminated doubly linked list - i32 cd_typed_n; // zero-terminated doubly linked list - atf_amc::FTypeC* zsl_h_typec_head; // zero-terminated singly linked list - i32 zsl_h_typec_n; // zero-terminated singly linked list - atf_amc::FTypeC* zsl_h_typec_tail; // pointer to last element - atf_amc::FTypeC* zs_t_typec_head; // zero-terminated singly linked list - i32 zs_t_typec_n; // zero-terminated singly linked list - atf_amc::FTypeC* zs_t_typec_tail; // pointer to last element - - atf_amc::FTypeC* zs_mt_typec_head; // ZSListMT - zero-terminated singly linked list -- read side - atf_amc::FTypeC* zs_mt_typec_mt; // elements inserted here from another thread -- write side - atf_amc::FTypeC* zdl_hnt_typec_head; // zero-terminated doubly linked list - i32 zdl_hnt_typec_n; // zero-terminated doubly linked list - atf_amc::FTypeC* cdl_h_typec_head; // zero-terminated doubly linked list - i32 cdl_h_typec_n; // zero-terminated doubly linked list - atf_amc::FTypeC* cd_t_typec_head; // zero-terminated doubly linked list - i32 cd_t_typec_n; // zero-terminated doubly linked list - atf_amc::FTypeC* csl_h_typec_head; // zero-terminated singly linked list - i32 csl_h_typec_n; // zero-terminated singly linked list - atf_amc::FTypeC* csl_h_typec_tail; // pointer to last element - atf_amc::FTypeC* cs_t_typec_head; // zero-terminated singly linked list - i32 cs_t_typec_n; // zero-terminated singly linked list - atf_amc::FTypeC* cs_t_typec_tail; // pointer to last element - atf_amc::FTypeA* typea_lary[32]; // level array - i32 typea_n; // number of elements in array - atf_amc::FTypeS* types_lary[32]; // level array - i32 types_n; // number of elements in array - atf_amc::FTypeS** ind_types_buckets_elems; // pointer to bucket array - i32 ind_types_buckets_n; // number of elements in bucket array - i32 ind_types_n; // number of elements in the hash table - atf_amc::FTypeA** ind_typea_buckets_elems; // pointer to bucket array - i32 ind_typea_buckets_n; // number of elements in bucket array - i32 ind_typea_n; // number of elements in the hash table - i32 cs_h_count; // 0 FirstChanged trigger fire count - i32 cs_t_count; // 0 FirstChanged trigger fire count - i32 zs_h_count; // 0 FirstChanged trigger fire count - i32 zs_t_count; // 0 FirstChanged trigger fire count - i32 zs_mt_count; // 0 FirstChanged trigger fire count - i32 bh_count; // 0 FirstChanged trigger fire count - atf_amc::FTypeT* typet_lary[32]; // level array - i32 typet_n; // number of elements in array - atf_amc::FCstring* cstring_lary[32]; // level array - i32 cstring_n; // number of elements in array - atf_amc::FCstring** ind_cstring_buckets_elems; // pointer to bucket array - i32 ind_cstring_buckets_n; // number of elements in bucket array - i32 ind_cstring_n; // number of elements in the hash table - atf_amc::Msgbuf* cd_in_msg_head; // zero-terminated doubly linked list - u64 typeb_blocksize; // # bytes per block - atf_amc::FTypeB* typeb_free; // - u64 pooledbe64_blocksize; // # bytes per block - atf_amc::PooledBE64* pooledbe64_free; // - i64 varlen_extern_n; // Number of elements - varlen_extern_Lpblock* varlen_extern_free[36]; // Lpool levels - atf_amc::FAmctest* amctest_lary[32]; // level array - i32 amctest_n; // number of elements in array - u64 cascdel_blocksize; // # bytes per block - atf_amc::FCascdel* cascdel_free; // - algo_lib::Bitset cascdel_check; // Bitset of FCascdel records in existence - u32 cascdel_next_key; // 0 Next sequence number for FCascdel record - i64 optalloc_n; // Number of elements - optalloc_Lpblock* optalloc_free[36]; // Lpool levels - i64 varlenalloc_n; // Number of elements - varlenalloc_Lpblock* varlenalloc_free[36]; // Lpool levels - i64 optg_n; // Number of elements - optg_Lpblock* optg_free[36]; // Lpool levels - atf_amc::FTypeK** c_typek_elems; // array of pointers - u32 c_typek_n; // array of pointers - u32 c_typek_max; // capacity of allocated array - atf_amc::FAvl* avl_lary[32]; // level array - i32 avl_n; // number of elements in array - atf_amc::FAvl* tr_avl_root; // Root of the tree - i32 tr_avl_n; // number of elements in the tree - u128 listtype_data[sizeu128(atf_amc::FListtype,10)]; // place for data - i32 listtype_n; // number of elems current in existence + command::atf_amc cmdline; // + atf_amc::FTypeC** bh_typec_elems; // binary heap by typec + i32 bh_typec_n; // number of elements in the heap + i32 bh_typec_max; // max elements in bh_typec_elems + atf_amc::FTypeC* zdl_h_typec_head; // zero-terminated doubly linked list + i32 zdl_h_typec_n; // zero-terminated doubly linked list + atf_amc::FTypeC* zdl_h_typec_tail; // pointer to last element + atf_amc::FTypeC* zd_t_typec_head; // zero-terminated doubly linked list + i32 zd_t_typec_n; // zero-terminated doubly linked list + atf_amc::FTypeC* zd_t_typec_tail; // pointer to last element + atf_amc::FTypeD* zd_typed_head; // zero-terminated doubly linked list + i32 zd_typed_n; // zero-terminated doubly linked list + atf_amc::FTypeD* zd_typed_tail; // pointer to last element + atf_amc::FTypeD* zs_t_typed_head; // zero-terminated singly linked list + i32 zs_t_typed_n; // zero-terminated singly linked list + atf_amc::FTypeD* zs_t_typed_tail; // pointer to last element + atf_amc::FTypeD* cd_typed_head; // zero-terminated doubly linked list + i32 cd_typed_n; // zero-terminated doubly linked list + atf_amc::FTypeC* zsl_h_typec_head; // zero-terminated singly linked list + i32 zsl_h_typec_n; // zero-terminated singly linked list + atf_amc::FTypeC* zsl_h_typec_tail; // pointer to last element + atf_amc::FTypeC* zs_t_typec_head; // zero-terminated singly linked list + i32 zs_t_typec_n; // zero-terminated singly linked list + atf_amc::FTypeC* zs_t_typec_tail; // pointer to last element + + atf_amc::FTypeC* zs_mt_typec_head; // ZSListMT - zero-terminated singly linked list -- read side + atf_amc::FTypeC* zs_mt_typec_mt; // elements inserted here from another thread -- write side + atf_amc::FTypeC* zdl_hnt_typec_head; // zero-terminated doubly linked list + i32 zdl_hnt_typec_n; // zero-terminated doubly linked list + atf_amc::FTypeC* cdl_h_typec_head; // zero-terminated doubly linked list + i32 cdl_h_typec_n; // zero-terminated doubly linked list + atf_amc::FTypeC* cd_t_typec_head; // zero-terminated doubly linked list + i32 cd_t_typec_n; // zero-terminated doubly linked list + atf_amc::FTypeC* csl_h_typec_head; // zero-terminated singly linked list + i32 csl_h_typec_n; // zero-terminated singly linked list + atf_amc::FTypeC* csl_h_typec_tail; // pointer to last element + atf_amc::FTypeC* cs_t_typec_head; // zero-terminated singly linked list + i32 cs_t_typec_n; // zero-terminated singly linked list + atf_amc::FTypeC* cs_t_typec_tail; // pointer to last element + atf_amc::FTypeA* typea_lary[32]; // level array + i32 typea_n; // number of elements in array + atf_amc::FTypeS* types_lary[32]; // level array + i32 types_n; // number of elements in array + atf_amc::FTypeS** ind_types_buckets_elems; // pointer to bucket array + i32 ind_types_buckets_n; // number of elements in bucket array + i32 ind_types_n; // number of elements in the hash table + atf_amc::FTypeA** ind_typea_buckets_elems; // pointer to bucket array + i32 ind_typea_buckets_n; // number of elements in bucket array + i32 ind_typea_n; // number of elements in the hash table + i32 cs_h_count; // 0 FirstChanged trigger fire count + i32 cs_t_count; // 0 FirstChanged trigger fire count + i32 zs_h_count; // 0 FirstChanged trigger fire count + i32 zs_t_count; // 0 FirstChanged trigger fire count + i32 zs_mt_count; // 0 FirstChanged trigger fire count + i32 bh_count; // 0 FirstChanged trigger fire count + atf_amc::FTypeT* typet_lary[32]; // level array + i32 typet_n; // number of elements in array + atf_amc::FCstring* cstring_lary[32]; // level array + i32 cstring_n; // number of elements in array + atf_amc::FCstring** ind_cstring_buckets_elems; // pointer to bucket array + i32 ind_cstring_buckets_n; // number of elements in bucket array + i32 ind_cstring_n; // number of elements in the hash table + atf_amc::Msgbuf* cd_in_msg_head; // zero-terminated doubly linked list + u64 typeb_blocksize; // # bytes per block + atf_amc::FTypeB* typeb_free; // + u64 pooledbe64_blocksize; // # bytes per block + atf_amc::PooledBE64* pooledbe64_free; // + i64 varlen_extern_n; // Number of elements + varlen_extern_Lpblock* varlen_extern_free[36]; // Lpool levels + atf_amc::FAmctest* amctest_lary[32]; // level array + i32 amctest_n; // number of elements in array + u64 cascdel_blocksize; // # bytes per block + atf_amc::FCascdel* cascdel_free; // + algo_lib::Bitset cascdel_check; // Bitset of FCascdel records in existence + u32 cascdel_next_key; // 0 Next sequence number for FCascdel record + i64 optalloc_n; // Number of elements + optalloc_Lpblock* optalloc_free[36]; // Lpool levels + i64 varlenalloc_n; // Number of elements + varlenalloc_Lpblock* varlenalloc_free[36]; // Lpool levels + i64 optg_n; // Number of elements + optg_Lpblock* optg_free[36]; // Lpool levels + atf_amc::FTypeK** c_typek_elems; // array of pointers + u32 c_typek_n; // array of pointers + u32 c_typek_max; // capacity of allocated array + atf_amc::FTypeL** c_typel_elems; // array of pointers + u32 c_typel_n; // array of pointers + u32 c_typel_max; // capacity of allocated array + atf_amc::FTypeM** c_typem_elems; // array of pointers + u32 c_typem_n; // array of pointers + u32 c_typem_max; // capacity of allocated array + atf_amc::FAvl* avl_lary[32]; // level array + i32 avl_n; // number of elements in array + atf_amc::FAvl* tr_avl_root; // Root of the tree + i32 tr_avl_n; // number of elements in the tree + u128 listtype_data[sizeu128(atf_amc::FListtype,10)]; // place for data + i32 listtype_n; // number of elems current in existence enum { listtype_max = 10 }; - bool dofork; // false - u64 typed_blocksize; // # bytes per block - atf_amc::FTypeD* typed_free; // - atf_amc::FThashElem** ind_thash_elem_buckets_elems; // pointer to bucket array - i32 ind_thash_elem_buckets_n; // number of elements in bucket array - i32 ind_thash_elem_n; // number of elements in the hash table - atf_amc::FThashElem* thash_elem_lary[32]; // level array - i32 thash_elem_n; // number of elements in array - atf_amc::trace trace; // + bool dofork; // false + u64 typed_blocksize; // # bytes per block + atf_amc::FTypeD* typed_free; // + atf_amc::FThashElem** ind_thash_elem_buckets_elems; // pointer to bucket array + i32 ind_thash_elem_buckets_n; // number of elements in bucket array + i32 ind_thash_elem_n; // number of elements in the hash table + atf_amc::FThashElem* thash_elem_lary[32]; // level array + i32 thash_elem_n; // number of elements in array + u64 hashable_blocksize; // # bytes per block + atf_amc::Hashable* hashable_free; // + atf_amc::Hashable** ind_hashable_buckets_elems; // pointer to bucket array + i32 ind_hashable_buckets_n; // number of elements in bucket array + i32 ind_hashable_n; // number of elements in the hash table + u64 time_entry_blocksize; // # bytes per block + atf_amc::FTimeEntry* time_entry_free; // + atf_amc::FTimeEntry** bh_time_entry_elems; // binary heap by time + i32 bh_time_entry_n; // number of elements in the heap + i32 bh_time_entry_max; // max elements in bh_time_entry_elems + algo_lib::FTimehook th_bh_time_entry; // atf_amc.FDb.bh_time_entry fstep time hook for atf_amc.FDb.bh_time_entry + u64 timehook_recur_counter; // 0 + u64 timehook_once_counter; // 0 + atf_amc::FHashableLinear** ind_linear_buckets_elems; // pointer to bucket array + i32 ind_linear_buckets_n; // number of elements in bucket array + i32 ind_linear_n; // number of elements in the hash table + u64 hashable_linear_blocksize; // # bytes per block + atf_amc::FHashableLinear* hashable_linear_free; // + u64 strkey_blocksize; // # bytes per block + atf_amc::Strkey* strkey_free; // + atf_amc::Strkey** ind_strkey_buckets_elems; // pointer to bucket array + i32 ind_strkey_buckets_n; // number of elements in bucket array + i32 ind_strkey_n; // number of elements in the hash table + atf_amc::trace trace; // }; // Remove all elements from heap and free memory used by the array. @@ -2985,6 +3064,9 @@ inline bool ind_types_EmptyQ() __attribute__((nothrow)); // Find row by key. Return NULL if not found. // func:atf_amc.FDb.ind_types.Find atf_amc::FTypeS* ind_types_Find(i32 key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:atf_amc.FDb.ind_types.FindX +atf_amc::FTypeS& ind_types_FindX(i32 key); // Find row by key. If not found, create and x-reference a new row with with this key. // func:atf_amc.FDb.ind_types.GetOrCreate atf_amc::FTypeS& ind_types_GetOrCreate(i32 key) __attribute__((nothrow)); @@ -3000,6 +3082,9 @@ void ind_types_Remove(atf_amc::FTypeS& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:atf_amc.FDb.ind_types.Reserve void ind_types_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_amc.FDb.ind_types.AbsReserve +void ind_types_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:atf_amc.FDb.ind_typea.EmptyQ @@ -3007,6 +3092,9 @@ inline bool ind_typea_EmptyQ() __attribute__((nothrow)); // Find row by key. Return NULL if not found. // func:atf_amc.FDb.ind_typea.Find atf_amc::FTypeA* ind_typea_Find(i32 key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:atf_amc.FDb.ind_typea.FindX +atf_amc::FTypeA& ind_typea_FindX(i32 key); // Find row by key. If not found, create and x-reference a new row with with this key. // func:atf_amc.FDb.ind_typea.GetOrCreate atf_amc::FTypeA& ind_typea_GetOrCreate(i32 key) __attribute__((nothrow)); @@ -3022,6 +3110,9 @@ void ind_typea_Remove(atf_amc::FTypeA& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:atf_amc.FDb.ind_typea.Reserve void ind_typea_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_amc.FDb.ind_typea.AbsReserve +void ind_typea_AbsReserve(int n) __attribute__((nothrow)); // Read argc,argv directly into the fields of the command line(s) // The following fields are updated: @@ -3154,6 +3245,9 @@ inline bool ind_cstring_EmptyQ() __attribute__((nothrow)); // Find row by key. Return NULL if not found. // func:atf_amc.FDb.ind_cstring.Find atf_amc::FCstring* ind_cstring_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:atf_amc.FDb.ind_cstring.FindX +atf_amc::FCstring& ind_cstring_FindX(const algo::strptr& key); // Find row by key. If not found, create and x-reference a new row with with this key. // func:atf_amc.FDb.ind_cstring.GetOrCreate atf_amc::FCstring& ind_cstring_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); @@ -3169,6 +3263,9 @@ void ind_cstring_Remove(atf_amc::FCstring& row) __attribute__((n // Reserve enough room in the hash for N more elements. Return success code. // func:atf_amc.FDb.ind_cstring.Reserve void ind_cstring_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_amc.FDb.ind_cstring.AbsReserve +void ind_cstring_AbsReserve(int n) __attribute__((nothrow)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. @@ -3575,6 +3672,96 @@ inline bool c_typek_InAryQ(atf_amc::FTypeK& row) __attribute__((nothrow // func:atf_amc.FDb.c_typek.qLast inline atf_amc::FTypeK& c_typek_qLast() __attribute__((nothrow)); +// Return true if index is empty +// func:atf_amc.FDb.c_typel.EmptyQ +inline bool c_typel_EmptyQ() __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:atf_amc.FDb.c_typel.Find +inline atf_amc::FTypeL* c_typel_Find(u32 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array of pointers +// func:atf_amc.FDb.c_typel.Getary +inline algo::aryptr c_typel_Getary() __attribute__((nothrow)); +// func:atf_amc.FDb.c_typel.First +inline atf_amc::FTypeL* c_typel_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:atf_amc.FDb.c_typel.Last +inline atf_amc::FTypeL* c_typel_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +// func:atf_amc.FDb.c_typel.Insert +void c_typel_Insert(atf_amc::FTypeL& row) __attribute__((nothrow)); +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +// func:atf_amc.FDb.c_typel.InsertMaybe +bool c_typel_InsertMaybe(atf_amc::FTypeL& row) __attribute__((nothrow)); +// Return number of items in the pointer array +// func:atf_amc.FDb.c_typel.N +inline i32 c_typel_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Find element using linear scan. If element is in array, remove, otherwise do nothing +// func:atf_amc.FDb.c_typel.Remove +void c_typel_Remove(atf_amc::FTypeL& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:atf_amc.FDb.c_typel.RemoveAll +inline void c_typel_RemoveAll() __attribute__((nothrow)); +// Reserve space in index for N more elements; +// func:atf_amc.FDb.c_typel.Reserve +void c_typel_Reserve(u32 n) __attribute__((nothrow)); +// Heap-like Ptrary: remove first element +// If index is empty, return NULL. Otherwise remove and return first element in index. +// func:atf_amc.FDb.c_typel.RemoveFirst +atf_amc::FTypeL* c_typel_RemoveFirst() __attribute__((nothrow)); +// Ptrary: remove last element +// If index is empty, return NULL. Otherwise remove and return last element in index. +// func:atf_amc.FDb.c_typel.RemoveLast +atf_amc::FTypeL* c_typel_RemoveLast() __attribute__((nothrow)); +// Return reference without bounds checking +// func:atf_amc.FDb.c_typel.qFind +inline atf_amc::FTypeL& c_typel_qFind(u32 idx) __attribute__((nothrow)); +// True if row is in any ptrary instance +// func:atf_amc.FDb.c_typel.InAryQ +inline bool c_typel_InAryQ(atf_amc::FTypeL& row) __attribute__((nothrow)); +// Reference to last element without bounds checking +// func:atf_amc.FDb.c_typel.qLast +inline atf_amc::FTypeL& c_typel_qLast() __attribute__((nothrow)); + +// Return true if index is empty +// func:atf_amc.FDb.c_typem.EmptyQ +inline bool c_typem_EmptyQ() __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:atf_amc.FDb.c_typem.Find +inline atf_amc::FTypeM* c_typem_Find(u32 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array of pointers +// func:atf_amc.FDb.c_typem.Getary +inline algo::aryptr c_typem_Getary() __attribute__((nothrow)); +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +// func:atf_amc.FDb.c_typem.Insert +void c_typem_Insert(atf_amc::FTypeM& row) __attribute__((nothrow)); +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Linear search is used to locate the element. +// Return value: whether element was inserted into array. +// func:atf_amc.FDb.c_typem.ScanInsertMaybe +bool c_typem_ScanInsertMaybe(atf_amc::FTypeM& row) __attribute__((nothrow)); +// Return number of items in the pointer array +// func:atf_amc.FDb.c_typem.N +inline i32 c_typem_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Find element using linear scan. If element is in array, remove, otherwise do nothing +// func:atf_amc.FDb.c_typem.Remove +void c_typem_Remove(atf_amc::FTypeM& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:atf_amc.FDb.c_typem.RemoveAll +inline void c_typem_RemoveAll() __attribute__((nothrow)); +// Reserve space in index for N more elements; +// func:atf_amc.FDb.c_typem.Reserve +void c_typem_Reserve(u32 n) __attribute__((nothrow)); +// Return reference without bounds checking +// func:atf_amc.FDb.c_typem.qFind +inline atf_amc::FTypeM& c_typem_qFind(u32 idx) __attribute__((nothrow)); +// Reference to last element without bounds checking +// func:atf_amc.FDb.c_typem.qLast +inline atf_amc::FTypeM& c_typem_qLast() __attribute__((nothrow)); + // Allocate memory for new default row. // If out of memory, process is killed. // func:atf_amc.FDb.avl.Alloc @@ -3758,6 +3945,9 @@ inline bool ind_thash_elem_EmptyQ() __attribute__((nothrow)); // Find row by key. Return NULL if not found. // func:atf_amc.FDb.ind_thash_elem.Find atf_amc::FThashElem* ind_thash_elem_Find(u64 key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:atf_amc.FDb.ind_thash_elem.FindX +atf_amc::FThashElem& ind_thash_elem_FindX(u64 key); // Find row by key. If not found, create and x-reference a new row with with this key. // func:atf_amc.FDb.ind_thash_elem.GetOrCreate atf_amc::FThashElem& ind_thash_elem_GetOrCreate(u64 key) __attribute__((nothrow)); @@ -3773,6 +3963,9 @@ void ind_thash_elem_Remove(atf_amc::FThashElem& row) __attribute // Reserve enough room in the hash for N more elements. Return success code. // func:atf_amc.FDb.ind_thash_elem.Reserve void ind_thash_elem_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_amc.FDb.ind_thash_elem.AbsReserve +void ind_thash_elem_AbsReserve(int n) __attribute__((nothrow)); // func:atf_amc.FDb.ind_thash_elem.FindRemove atf_amc::FThashElem* ind_thash_elem_FindRemove(u64 key) __attribute__((nothrow)); @@ -3812,6 +4005,259 @@ inline atf_amc::FThashElem& thash_elem_qFind(u64 t) __attribute__((nothrow, pure // func:atf_amc.FDb.thash_elem.XrefMaybe bool thash_elem_XrefMaybe(atf_amc::FThashElem &row); +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:atf_amc.FDb.hashable.Alloc +atf_amc::Hashable& hashable_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:atf_amc.FDb.hashable.AllocMaybe +atf_amc::Hashable* hashable_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Remove row from all global and cross indices, then deallocate row +// func:atf_amc.FDb.hashable.Delete +void hashable_Delete(atf_amc::Hashable &row) __attribute__((nothrow)); +// Allocate space for one element +// If no memory available, return NULL. +// func:atf_amc.FDb.hashable.AllocMem +void* hashable_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Remove mem from all global and cross indices, then deallocate mem +// func:atf_amc.FDb.hashable.FreeMem +void hashable_FreeMem(atf_amc::Hashable &row) __attribute__((nothrow)); +// Preallocate memory for N more elements +// Return number of elements actually reserved. +// func:atf_amc.FDb.hashable.Reserve +u64 hashable_Reserve(u64 n_elems) __attribute__((nothrow)); +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +// func:atf_amc.FDb.hashable.ReserveMem +u64 hashable_ReserveMem(u64 size) __attribute__((nothrow)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:atf_amc.FDb.hashable.XrefMaybe +bool hashable_XrefMaybe(atf_amc::Hashable &row); + +// Return true if hash is empty +// func:atf_amc.FDb.ind_hashable.EmptyQ +inline bool ind_hashable_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:atf_amc.FDb.ind_hashable.Find +atf_amc::Hashable* ind_hashable_Find(const algo::U64Ary& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:atf_amc.FDb.ind_hashable.FindX +atf_amc::Hashable& ind_hashable_FindX(const algo::U64Ary& key); +// Find row by key. If not found, create and x-reference a new row with with this key. +// func:atf_amc.FDb.ind_hashable.GetOrCreate +atf_amc::Hashable& ind_hashable_GetOrCreate(const algo::U64Ary& key) __attribute__((nothrow)); +// Return number of items in the hash +// func:atf_amc.FDb.ind_hashable.N +inline i32 ind_hashable_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:atf_amc.FDb.ind_hashable.InsertMaybe +bool ind_hashable_InsertMaybe(atf_amc::Hashable& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:atf_amc.FDb.ind_hashable.Remove +void ind_hashable_Remove(atf_amc::Hashable& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:atf_amc.FDb.ind_hashable.Reserve +void ind_hashable_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_amc.FDb.ind_hashable.AbsReserve +void ind_hashable_AbsReserve(int n) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:atf_amc.FDb.time_entry.Alloc +atf_amc::FTimeEntry& time_entry_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:atf_amc.FDb.time_entry.AllocMaybe +atf_amc::FTimeEntry* time_entry_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Remove row from all global and cross indices, then deallocate row +// func:atf_amc.FDb.time_entry.Delete +void time_entry_Delete(atf_amc::FTimeEntry &row) __attribute__((nothrow)); +// Allocate space for one element +// If no memory available, return NULL. +// func:atf_amc.FDb.time_entry.AllocMem +void* time_entry_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Remove mem from all global and cross indices, then deallocate mem +// func:atf_amc.FDb.time_entry.FreeMem +void time_entry_FreeMem(atf_amc::FTimeEntry &row) __attribute__((nothrow)); +// Preallocate memory for N more elements +// Return number of elements actually reserved. +// func:atf_amc.FDb.time_entry.Reserve +u64 time_entry_Reserve(u64 n_elems) __attribute__((nothrow)); +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +// func:atf_amc.FDb.time_entry.ReserveMem +u64 time_entry_ReserveMem(u64 size) __attribute__((nothrow)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:atf_amc.FDb.time_entry.XrefMaybe +bool time_entry_XrefMaybe(atf_amc::FTimeEntry &row); + +// Remove all elements from heap and free memory used by the array. +// func:atf_amc.FDb.bh_time_entry.Dealloc +void bh_time_entry_Dealloc() __attribute__((nothrow)); +// Return true if index is empty +// func:atf_amc.FDb.bh_time_entry.EmptyQ +inline bool bh_time_entry_EmptyQ() __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:atf_amc.FDb.bh_time_entry.First +inline atf_amc::FTimeEntry* bh_time_entry_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in index, false otherwise +// func:atf_amc.FDb.bh_time_entry.InBheapQ +inline bool bh_time_entry_InBheapQ(atf_amc::FTimeEntry& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row. Row must not already be in index. If row is already in index, do nothing. +// func:atf_amc.FDb.bh_time_entry.Insert +void bh_time_entry_Insert(atf_amc::FTimeEntry& row) __attribute__((nothrow)); +// Return number of items in the heap +// func:atf_amc.FDb.bh_time_entry.N +inline i32 bh_time_entry_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// If row is in heap, update its position. If row is not in heap, insert it. +// Return new position of item in the heap (0=top) +// If first item of the is changed, update fstep:atf_amc.FDb.bh_time_entry +// func:atf_amc.FDb.bh_time_entry.Reheap +i32 bh_time_entry_Reheap(atf_amc::FTimeEntry& row) __attribute__((nothrow)); +// Key of first element in the heap changed. Move it. +// This function does not check the insert condition. +// Return new position of item in the heap (0=top). +// Heap must be non-empty or behavior is undefined. +// Update fstep:atf_amc.FDb.bh_time_entry +// func:atf_amc.FDb.bh_time_entry.ReheapFirst +i32 bh_time_entry_ReheapFirst() __attribute__((nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:atf_amc.FDb.bh_time_entry.Remove +void bh_time_entry_Remove(atf_amc::FTimeEntry& row) __attribute__((nothrow)); +// Remove all elements from binary heap +// func:atf_amc.FDb.bh_time_entry.RemoveAll +void bh_time_entry_RemoveAll() __attribute__((nothrow)); +// If index is empty, return NULL. Otherwise remove and return first key in index. +// Call 'head changed' trigger. +// func:atf_amc.FDb.bh_time_entry.RemoveFirst +atf_amc::FTimeEntry* bh_time_entry_RemoveFirst() __attribute__((nothrow)); +// Reserve space in index for N more elements +// func:atf_amc.FDb.bh_time_entry.Reserve +void bh_time_entry_Reserve(int n) __attribute__((nothrow)); +// func:atf_amc.FDb.bh_time_entry.Step +// this function is 'extrn' and implemented by user +void bh_time_entry_Step() __attribute__((nothrow)); + +// Return true if hash is empty +// func:atf_amc.FDb.ind_linear.EmptyQ +inline bool ind_linear_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:atf_amc.FDb.ind_linear.Find +atf_amc::FHashableLinear* ind_linear_Find(algo::U32LinearKey key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:atf_amc.FDb.ind_linear.FindX +atf_amc::FHashableLinear& ind_linear_FindX(algo::U32LinearKey key); +// Find row by key. If not found, create and x-reference a new row with with this key. +// func:atf_amc.FDb.ind_linear.GetOrCreate +atf_amc::FHashableLinear& ind_linear_GetOrCreate(algo::U32LinearKey key) __attribute__((nothrow)); +// Return number of items in the hash +// func:atf_amc.FDb.ind_linear.N +inline i32 ind_linear_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:atf_amc.FDb.ind_linear.InsertMaybe +bool ind_linear_InsertMaybe(atf_amc::FHashableLinear& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:atf_amc.FDb.ind_linear.Remove +void ind_linear_Remove(atf_amc::FHashableLinear& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:atf_amc.FDb.ind_linear.Reserve +void ind_linear_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_amc.FDb.ind_linear.AbsReserve +void ind_linear_AbsReserve(int n) __attribute__((nothrow)); +// func:atf_amc.FDb.ind_linear.FindRemove +atf_amc::FHashableLinear* ind_linear_FindRemove(algo::U32LinearKey key) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:atf_amc.FDb.hashable_linear.Alloc +atf_amc::FHashableLinear& hashable_linear_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:atf_amc.FDb.hashable_linear.AllocMaybe +atf_amc::FHashableLinear* hashable_linear_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Remove row from all global and cross indices, then deallocate row +// func:atf_amc.FDb.hashable_linear.Delete +void hashable_linear_Delete(atf_amc::FHashableLinear &row) __attribute__((nothrow)); +// Allocate space for one element +// If no memory available, return NULL. +// func:atf_amc.FDb.hashable_linear.AllocMem +void* hashable_linear_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Remove mem from all global and cross indices, then deallocate mem +// func:atf_amc.FDb.hashable_linear.FreeMem +void hashable_linear_FreeMem(atf_amc::FHashableLinear &row) __attribute__((nothrow)); +// Preallocate memory for N more elements +// Return number of elements actually reserved. +// func:atf_amc.FDb.hashable_linear.Reserve +u64 hashable_linear_Reserve(u64 n_elems) __attribute__((nothrow)); +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +// func:atf_amc.FDb.hashable_linear.ReserveMem +u64 hashable_linear_ReserveMem(u64 size) __attribute__((nothrow)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:atf_amc.FDb.hashable_linear.XrefMaybe +bool hashable_linear_XrefMaybe(atf_amc::FHashableLinear &row); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:atf_amc.FDb.strkey.Alloc +atf_amc::Strkey& strkey_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:atf_amc.FDb.strkey.AllocMaybe +atf_amc::Strkey* strkey_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Remove row from all global and cross indices, then deallocate row +// func:atf_amc.FDb.strkey.Delete +void strkey_Delete(atf_amc::Strkey &row) __attribute__((nothrow)); +// Allocate space for one element +// If no memory available, return NULL. +// func:atf_amc.FDb.strkey.AllocMem +void* strkey_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Remove mem from all global and cross indices, then deallocate mem +// func:atf_amc.FDb.strkey.FreeMem +void strkey_FreeMem(atf_amc::Strkey &row) __attribute__((nothrow)); +// Preallocate memory for N more elements +// Return number of elements actually reserved. +// func:atf_amc.FDb.strkey.Reserve +u64 strkey_Reserve(u64 n_elems) __attribute__((nothrow)); +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +// func:atf_amc.FDb.strkey.ReserveMem +u64 strkey_ReserveMem(u64 size) __attribute__((nothrow)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:atf_amc.FDb.strkey.XrefMaybe +bool strkey_XrefMaybe(atf_amc::Strkey &row); + +// Return true if hash is empty +// func:atf_amc.FDb.ind_strkey.EmptyQ +inline bool ind_strkey_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:atf_amc.FDb.ind_strkey.Find +atf_amc::Strkey* ind_strkey_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:atf_amc.FDb.ind_strkey.FindX +atf_amc::Strkey& ind_strkey_FindX(const algo::strptr& key); +// Find row by key. If not found, create and x-reference a new row with with this key. +// func:atf_amc.FDb.ind_strkey.GetOrCreate +atf_amc::Strkey& ind_strkey_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); +// Return number of items in the hash +// func:atf_amc.FDb.ind_strkey.N +inline i32 ind_strkey_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:atf_amc.FDb.ind_strkey.InsertMaybe +bool ind_strkey_InsertMaybe(atf_amc::Strkey& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:atf_amc.FDb.ind_strkey.Remove +void ind_strkey_Remove(atf_amc::Strkey& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:atf_amc.FDb.ind_strkey.Reserve +void ind_strkey_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_amc.FDb.ind_strkey.AbsReserve +void ind_strkey_AbsReserve(int n) __attribute__((nothrow)); + // func:atf_amc.FDb.bh_typec_curs.Reserve void _db_bh_typec_curs_Reserve(_db_bh_typec_curs &curs, int n); // Reset cursor. If HEAP is non-empty, add its top element to CURS. @@ -4100,6 +4546,28 @@ inline void _db_c_typek_oncecurs_Next(_db_c_typek_oncecurs &curs) __att // item access // func:atf_amc.FDb.c_typek_oncecurs.Access inline atf_amc::FTypeK& _db_c_typek_oncecurs_Access(_db_c_typek_oncecurs &curs) __attribute__((nothrow)); +// func:atf_amc.FDb.c_typel_curs.Reset +inline void _db_c_typel_curs_Reset(_db_c_typel_curs &curs, atf_amc::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.FDb.c_typel_curs.ValidQ +inline bool _db_c_typel_curs_ValidQ(_db_c_typel_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.FDb.c_typel_curs.Next +inline void _db_c_typel_curs_Next(_db_c_typel_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.FDb.c_typel_curs.Access +inline atf_amc::FTypeL& _db_c_typel_curs_Access(_db_c_typel_curs &curs) __attribute__((nothrow)); +// func:atf_amc.FDb.c_typem_curs.Reset +inline void _db_c_typem_curs_Reset(_db_c_typem_curs &curs, atf_amc::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.FDb.c_typem_curs.ValidQ +inline bool _db_c_typem_curs_ValidQ(_db_c_typem_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.FDb.c_typem_curs.Next +inline void _db_c_typem_curs_Next(_db_c_typem_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.FDb.c_typem_curs.Access +inline atf_amc::FTypeM& _db_c_typem_curs_Access(_db_c_typem_curs &curs) __attribute__((nothrow)); // cursor points to valid item // func:atf_amc.FDb.avl_curs.Reset inline void _db_avl_curs_Reset(_db_avl_curs &curs, atf_amc::FDb &parent) __attribute__((nothrow)); @@ -4148,12 +4616,65 @@ inline void _db_thash_elem_curs_Next(_db_thash_elem_curs &curs) __attri // item access // func:atf_amc.FDb.thash_elem_curs.Access inline atf_amc::FThashElem& _db_thash_elem_curs_Access(_db_thash_elem_curs &curs) __attribute__((nothrow)); +// func:atf_amc.FDb.bh_time_entry_curs.Reserve +void _db_bh_time_entry_curs_Reserve(_db_bh_time_entry_curs &curs, int n); +// Reset cursor. If HEAP is non-empty, add its top element to CURS. +// func:atf_amc.FDb.bh_time_entry_curs.Reset +void _db_bh_time_entry_curs_Reset(_db_bh_time_entry_curs &curs, atf_amc::FDb &parent); +// Advance cursor. +// func:atf_amc.FDb.bh_time_entry_curs.Next +void _db_bh_time_entry_curs_Next(_db_bh_time_entry_curs &curs); +// Access current element. If not more elements, return NULL +// func:atf_amc.FDb.bh_time_entry_curs.Access +inline atf_amc::FTimeEntry& _db_bh_time_entry_curs_Access(_db_bh_time_entry_curs &curs) __attribute__((nothrow)); +// Return true if Access() will return non-NULL. +// func:atf_amc.FDb.bh_time_entry_curs.ValidQ +inline bool _db_bh_time_entry_curs_ValidQ(_db_bh_time_entry_curs &curs) __attribute__((nothrow)); +// func:atf_amc.FDb.ind_linear_curs.Reset +void _db_ind_linear_curs_Reset(_db_ind_linear_curs &curs, atf_amc::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.FDb.ind_linear_curs.ValidQ +inline bool _db_ind_linear_curs_ValidQ(_db_ind_linear_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.FDb.ind_linear_curs.Next +inline void _db_ind_linear_curs_Next(_db_ind_linear_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.FDb.ind_linear_curs.Access +inline atf_amc::FHashableLinear& _db_ind_linear_curs_Access(_db_ind_linear_curs &curs) __attribute__((nothrow)); // Set all fields to initial values. // func:atf_amc.FDb..Init void FDb_Init(); // func:atf_amc.FDb..Uninit void FDb_Uninit() __attribute__((nothrow)); +// --- atf_amc.FHashableLinear +// create: atf_amc.FDb.hashable_linear (Tpool) +// global access: ind_linear (Thash, hash field key) +struct FHashableLinear { // atf_amc.FHashableLinear + atf_amc::FHashableLinear* ind_linear_next; // hash next + u32 ind_linear_hashval; // hash value + atf_amc::FHashableLinear* hashable_linear_next; // Pointer to next free element int tpool + algo::U32LinearKey key; // + // func:atf_amc.FHashableLinear..AssignOp + inline atf_amc::FHashableLinear& operator =(const atf_amc::FHashableLinear &rhs) = delete; + // func:atf_amc.FHashableLinear..CopyCtor + inline FHashableLinear(const atf_amc::FHashableLinear &rhs) = delete; +private: + // func:atf_amc.FHashableLinear..Ctor + inline FHashableLinear() __attribute__((nothrow)); + // func:atf_amc.FHashableLinear..Dtor + inline ~FHashableLinear() __attribute__((nothrow)); + friend atf_amc::FHashableLinear& hashable_linear_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_amc::FHashableLinear* hashable_linear_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void hashable_linear_Delete(atf_amc::FHashableLinear &row) __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:atf_amc.FHashableLinear..Init +inline void FHashableLinear_Init(atf_amc::FHashableLinear& hashable_linear); +// func:atf_amc.FHashableLinear..Uninit +void FHashableLinear_Uninit(atf_amc::FHashableLinear& hashable_linear) __attribute__((nothrow)); + // --- atf_amc.TypeG // create: atf_amc.OptAlloc.typeg (Opt) // create: atf_amc.OptG.typeg (Opt) @@ -4274,6 +4795,11 @@ atf_amc::Cstr& orig_AllocAt(atf_amc::FPerfSortString& parent, int at) __at // Reserve space. Insert N elements at the end of the array, return pointer to array // func:atf_amc.FPerfSortString.orig.AllocN algo::aryptr orig_AllocN(atf_amc::FPerfSortString& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:atf_amc.FPerfSortString.orig.AllocNAt +algo::aryptr orig_AllocNAt(atf_amc::FPerfSortString& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:atf_amc.FPerfSortString.orig.EmptyQ inline bool orig_EmptyQ(atf_amc::FPerfSortString& parent) __attribute__((nothrow)); @@ -4325,6 +4851,10 @@ inline u64 orig_rowid_Get(atf_amc::FPerfSortString& parent, atf_amc::C // Reserve space. Insert N elements at the end of the array, return pointer to array // func:atf_amc.FPerfSortString.orig.AllocNVal algo::aryptr orig_AllocNVal(atf_amc::FPerfSortString& parent, int n_elems, const atf_amc::Cstr& val) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:atf_amc.FPerfSortString.orig.Insary +void orig_Insary(atf_amc::FPerfSortString& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -4342,6 +4872,11 @@ atf_amc::Cstr& sorted1_AllocAt(atf_amc::FPerfSortString& parent, int at) _ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:atf_amc.FPerfSortString.sorted1.AllocN algo::aryptr sorted1_AllocN(atf_amc::FPerfSortString& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:atf_amc.FPerfSortString.sorted1.AllocNAt +algo::aryptr sorted1_AllocNAt(atf_amc::FPerfSortString& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:atf_amc.FPerfSortString.sorted1.EmptyQ inline bool sorted1_EmptyQ(atf_amc::FPerfSortString& parent) __attribute__((nothrow)); @@ -4393,6 +4928,10 @@ inline u64 sorted1_rowid_Get(atf_amc::FPerfSortString& parent, atf_amc // Reserve space. Insert N elements at the end of the array, return pointer to array // func:atf_amc.FPerfSortString.sorted1.AllocNVal algo::aryptr sorted1_AllocNVal(atf_amc::FPerfSortString& parent, int n_elems, const atf_amc::Cstr& val) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:atf_amc.FPerfSortString.sorted1.Insary +void sorted1_Insary(atf_amc::FPerfSortString& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Verify whether array is sorted // func:atf_amc.FPerfSortString.sorted1.SortedQ bool sorted1_SortedQ(atf_amc::FPerfSortString& parent) __attribute__((nothrow)); @@ -4439,8 +4978,9 @@ void FPerfSortString_Uninit(atf_amc::FPerfSortString& parent) __ // global access: ind_thash_elem (Thash, hash field key) // global access: thash_elem (Lary, by rowid) struct FThashElem { // atf_amc.FThashElem - atf_amc::FThashElem* ind_thash_elem_next; // hash next - u64 key; // 0 + atf_amc::FThashElem* ind_thash_elem_next; // hash next + u32 ind_thash_elem_hashval; // hash value + u64 key; // 0 // func:atf_amc.FThashElem..AssignOp inline atf_amc::FThashElem& operator =(const atf_amc::FThashElem &rhs) = delete; // func:atf_amc.FThashElem..CopyCtor @@ -4462,6 +5002,40 @@ inline void FThashElem_Init(atf_amc::FThashElem& thash_elem); // func:atf_amc.FThashElem..Uninit void FThashElem_Uninit(atf_amc::FThashElem& thash_elem) __attribute__((nothrow)); +// --- atf_amc.FTimeEntry +// create: atf_amc.FDb.time_entry (Tpool) +// global access: bh_time_entry (Bheap, sort field time) +struct FTimeEntry { // atf_amc.FTimeEntry + atf_amc::FTimeEntry* time_entry_next; // Pointer to next free element int tpool + i32 bh_time_entry_idx; // index in heap; -1 means not-in-heap + algo::SchedTime time; // + // func:atf_amc.FTimeEntry..AssignOp + inline atf_amc::FTimeEntry& operator =(const atf_amc::FTimeEntry &rhs) = delete; + // func:atf_amc.FTimeEntry..CopyCtor + inline FTimeEntry(const atf_amc::FTimeEntry &rhs) = delete; +private: + // func:atf_amc.FTimeEntry..Ctor + inline FTimeEntry() __attribute__((nothrow)); + // func:atf_amc.FTimeEntry..Dtor + inline ~FTimeEntry() __attribute__((nothrow)); + friend atf_amc::FTimeEntry& time_entry_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_amc::FTimeEntry* time_entry_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void time_entry_Delete(atf_amc::FTimeEntry &row) __attribute__((nothrow)); +}; + +// Compare two fields. Comparison is anti-symmetric: if a>b, then !(b>a). +// func:atf_amc.FTimeEntry.time.Lt +inline bool time_Lt(atf_amc::FTimeEntry& time_entry, atf_amc::FTimeEntry &rhs) __attribute__((nothrow)); +// Compare two fields. +// func:atf_amc.FTimeEntry.time.Cmp +inline i32 time_Cmp(atf_amc::FTimeEntry& time_entry, atf_amc::FTimeEntry &rhs) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:atf_amc.FTimeEntry..Init +inline void FTimeEntry_Init(atf_amc::FTimeEntry& time_entry); +// func:atf_amc.FTimeEntry..Uninit +void FTimeEntry_Uninit(atf_amc::FTimeEntry& time_entry) __attribute__((nothrow)); + // --- atf_amc.FTypeC // create: atf_amc.FTypeA.typec (Inlary) // global access: bh_typec (Bheap, sort field typec) @@ -4526,6 +5100,7 @@ void FTypeC_Print(atf_amc::FTypeC& row, algo::cstring& str) __at // global access: ind_typea (Thash, hash field typea) struct FTypeA { // atf_amc.FTypeA atf_amc::FTypeA* ind_typea_next; // hash next + u32 ind_typea_hashval; // hash value i32 typea; // 0 u128 typec_data[sizeu128(atf_amc::FTypeC,10)]; // place for data i32 typec_n; // number of elems current in existence @@ -4620,7 +5195,7 @@ inline bool zdl_typeb_EmptyQ(atf_amc::FTypeA& typea) __attribute__((__w inline atf_amc::FTypeB* zdl_typeb_First(atf_amc::FTypeA& typea) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:atf_amc.FTypeA.zdl_typeb.InLlistQ -inline bool zdl_typeb_InLlistQ(atf_amc::FTypeB& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool typea_zdl_typeb_InLlistQ(atf_amc::FTypeB& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:atf_amc.FTypeA.zdl_typeb.Insert void zdl_typeb_Insert(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) __attribute__((nothrow)); @@ -4632,10 +5207,10 @@ inline atf_amc::FTypeB* zdl_typeb_Last(atf_amc::FTypeA& typea) __attribute__((__ inline i32 zdl_typeb_N(const atf_amc::FTypeA& typea) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:atf_amc.FTypeA.zdl_typeb.Next -inline atf_amc::FTypeB* zdl_typeb_Next(atf_amc::FTypeB &row) __attribute__((__warn_unused_result__, nothrow)); +inline atf_amc::FTypeB* typea_zdl_typeb_Next(atf_amc::FTypeB &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:atf_amc.FTypeA.zdl_typeb.Prev -inline atf_amc::FTypeB* zdl_typeb_Prev(atf_amc::FTypeB &row) __attribute__((__warn_unused_result__, nothrow)); +inline atf_amc::FTypeB* typea_zdl_typeb_Prev(atf_amc::FTypeB &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:atf_amc.FTypeA.zdl_typeb.Remove void zdl_typeb_Remove(atf_amc::FTypeA& typea, atf_amc::FTypeB& row) __attribute__((nothrow)); @@ -4748,12 +5323,12 @@ void FTypeA_Print(atf_amc::FTypeA& row, algo::cstring& str) __at // access: atf_amc.FTypeA.zdl_typeb (Llist) // access: atf_amc.FTypeA.bh_typeb (Bheap) struct FTypeB { // atf_amc.FTypeB - atf_amc::FTypeB* typeb_next; // Pointer to next free element int tpool - atf_amc::FTypeB* zdl_typeb_next; // zslist link; -1 means not-in-list - atf_amc::FTypeB* zdl_typeb_prev; // previous element - i32 bh_typeb_idx; // index in heap; -1 means not-in-heap - i32 typea; // 0 - i32 j; // 0 + atf_amc::FTypeB* typeb_next; // Pointer to next free element int tpool + atf_amc::FTypeB* typea_zdl_typeb_next; // zslist link; -1 means not-in-list + atf_amc::FTypeB* typea_zdl_typeb_prev; // previous element + i32 typea_bh_typeb_idx; // index in heap; -1 means not-in-heap + i32 typea; // 0 + i32 j; // 0 // func:atf_amc.FTypeB..AssignOp inline atf_amc::FTypeB& operator =(const atf_amc::FTypeB &rhs) = delete; // func:atf_amc.FTypeB..CopyCtor @@ -4831,9 +5406,9 @@ void FTypeD_Print(atf_amc::FTypeD& row, algo::cstring& str) __at // --- atf_amc.FTypeK // global access: c_typek (Ptrary) -struct FTypeK { // atf_amc.FTypeK - u32 value; // 0 - bool _db_c_typek_in_ary; // false membership flag +struct FTypeK { // atf_amc.FTypeK: Test element for Ptrary + u32 value; // 0 + bool c_typek_in_ary; // false membership flag // func:atf_amc.FTypeK..Ctor inline FTypeK() __attribute__((nothrow)); }; @@ -4842,17 +5417,43 @@ struct FTypeK { // atf_amc.FTypeK // func:atf_amc.FTypeK..Init inline void FTypeK_Init(atf_amc::FTypeK& parent); +// --- atf_amc.FTypeL +// global access: c_typel (Ptrary) +struct FTypeL { // atf_amc.FTypeL: Test element for heap-like Ptrary + u32 value; // 0 + i32 c_typel_idx; // -1 Array index (-1 = not in array) + // func:atf_amc.FTypeL..Ctor + inline FTypeL() __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:atf_amc.FTypeL..Init +inline void FTypeL_Init(atf_amc::FTypeL& parent); + +// --- atf_amc.FTypeM +// global access: c_typem (Ptrary) +struct FTypeM { // atf_amc.FTypeM: Test element for non-unique Ptrary + u32 value; // 0 + // func:atf_amc.FTypeM..Ctor + inline FTypeM() __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:atf_amc.FTypeM..Init +inline void FTypeM_Init(atf_amc::FTypeM& parent); + // --- atf_amc.FTypeS // create: atf_amc.FDb.types (Lary) // global access: types (Lary, by rowid) // global access: ind_types (Thash, hash field types) struct FTypeS { // atf_amc.FTypeS - atf_amc::FTypeS* ind_types_next; // hash next - i32 types; // 0 - algo::Comment comment; // - atf_amc::FTypeT* zdl_typet_head; // zero-terminated doubly linked list - i32 zdl_typet_n; // zero-terminated doubly linked list - atf_amc::FTypeT* zdl_typet_tail; // pointer to last element + atf_amc::FTypeS* ind_types_next; // hash next + u32 ind_types_hashval; // hash value + i32 types; // 0 + algo::Comment comment; // + atf_amc::FTypeT* zdl_typet_head; // zero-terminated doubly linked list + i32 zdl_typet_n; // zero-terminated doubly linked list + atf_amc::FTypeT* zdl_typet_tail; // pointer to last element // reftype Llist of atf_amc.FTypeS.zdl_typet prohibits copy // func:atf_amc.FTypeS..AssignOp inline atf_amc::FTypeS& operator =(const atf_amc::FTypeS &rhs) = delete; @@ -4885,7 +5486,7 @@ inline bool zdl_typet_EmptyQ(atf_amc::FTypeS& types) __attribute__((__w inline atf_amc::FTypeT* zdl_typet_First(atf_amc::FTypeS& types) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:atf_amc.FTypeS.zdl_typet.InLlistQ -inline bool zdl_typet_InLlistQ(atf_amc::FTypeT& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool types_zdl_typet_InLlistQ(atf_amc::FTypeT& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:atf_amc.FTypeS.zdl_typet.Insert void zdl_typet_Insert(atf_amc::FTypeS& types, atf_amc::FTypeT& row) __attribute__((nothrow)); @@ -4897,10 +5498,10 @@ inline atf_amc::FTypeT* zdl_typet_Last(atf_amc::FTypeS& types) __attribute__((__ inline i32 zdl_typet_N(const atf_amc::FTypeS& types) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:atf_amc.FTypeS.zdl_typet.Next -inline atf_amc::FTypeT* zdl_typet_Next(atf_amc::FTypeT &row) __attribute__((__warn_unused_result__, nothrow)); +inline atf_amc::FTypeT* types_zdl_typet_Next(atf_amc::FTypeT &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:atf_amc.FTypeS.zdl_typet.Prev -inline atf_amc::FTypeT* zdl_typet_Prev(atf_amc::FTypeT &row) __attribute__((__warn_unused_result__, nothrow)); +inline atf_amc::FTypeT* types_zdl_typet_Prev(atf_amc::FTypeT &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:atf_amc.FTypeS.zdl_typet.Remove void zdl_typet_Remove(atf_amc::FTypeS& types, atf_amc::FTypeT& row) __attribute__((nothrow)); @@ -4941,10 +5542,10 @@ void FTypeS_Print(atf_amc::FTypeS& row, algo::cstring& str) __at // global access: typet (Lary, by rowid) // access: atf_amc.FTypeS.zdl_typet (Llist) struct FTypeT { // atf_amc.FTypeT - atf_amc::FTypeT* zdl_typet_next; // zslist link; -1 means not-in-list - atf_amc::FTypeT* zdl_typet_prev; // previous element - i32 types; // 0 - i32 j; // 0 + atf_amc::FTypeT* types_zdl_typet_next; // zslist link; -1 means not-in-list + atf_amc::FTypeT* types_zdl_typet_prev; // previous element + i32 types; // 0 + i32 j; // 0 // func:atf_amc.FTypeT..AssignOp inline atf_amc::FTypeT& operator =(const atf_amc::FTypeT &rhs) = delete; // func:atf_amc.FTypeT..CopyCtor @@ -5064,6 +5665,11 @@ atf_amc::TypeA& tary_AllocAt(atf_amc::FUnitSort& parent, int at) __attribut // Reserve space. Insert N elements at the end of the array, return pointer to array // func:atf_amc.FUnitSort.tary.AllocN algo::aryptr tary_AllocN(atf_amc::FUnitSort& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:atf_amc.FUnitSort.tary.AllocNAt +algo::aryptr tary_AllocNAt(atf_amc::FUnitSort& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:atf_amc.FUnitSort.tary.EmptyQ inline bool tary_EmptyQ(atf_amc::FUnitSort& parent) __attribute__((nothrow)); @@ -5120,6 +5726,10 @@ algo::aryptr tary_AllocNVal(atf_amc::FUnitSort& parent, int n_el // Function returns success value. // func:atf_amc.FUnitSort.tary.ReadStrptrMaybe bool tary_ReadStrptrMaybe(atf_amc::FUnitSort& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:atf_amc.FUnitSort.tary.Insary +void tary_Insary(atf_amc::FUnitSort& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Verify whether array is sorted // func:atf_amc.FUnitSort.tary.SortedQ bool tary_SortedQ(atf_amc::FUnitSort& parent) __attribute__((nothrow)); @@ -5319,6 +5929,35 @@ inline void FieldId_Init(atf_amc::FieldId& parent); // func:atf_amc.FieldId..Print void FieldId_Print(atf_amc::FieldId& row, algo::cstring& str) __attribute__((nothrow)); +// --- atf_amc.Hashable +// create: atf_amc.FDb.hashable (Tpool) +// global access: ind_hashable (Thash, hash field key) +struct Hashable { // atf_amc.Hashable + atf_amc::Hashable* hashable_next; // Pointer to next free element int tpool + atf_amc::Hashable* ind_hashable_next; // hash next + u32 ind_hashable_hashval; // hash value + i32 hashable; // 0 + algo::U64Ary key; // + // func:atf_amc.Hashable..AssignOp + inline atf_amc::Hashable& operator =(const atf_amc::Hashable &rhs) = delete; + // func:atf_amc.Hashable..CopyCtor + inline Hashable(const atf_amc::Hashable &rhs) = delete; +private: + // func:atf_amc.Hashable..Ctor + inline Hashable() __attribute__((nothrow)); + // func:atf_amc.Hashable..Dtor + inline ~Hashable() __attribute__((nothrow)); + friend atf_amc::Hashable& hashable_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_amc::Hashable* hashable_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void hashable_Delete(atf_amc::Hashable &row) __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:atf_amc.Hashable..Init +inline void Hashable_Init(atf_amc::Hashable& hashable); +// func:atf_amc.Hashable..Uninit +void Hashable_Uninit(atf_amc::Hashable& hashable) __attribute__((nothrow)); + // --- atf_amc.Hooktype // access: atf_amc.Hooktype.callback (Hook) struct Hooktype { // atf_amc.Hooktype @@ -5544,17 +6183,19 @@ void Lary32_Uninit(atf_amc::Lary32& parent) __attribute__((nothr // --- atf_amc.Linebuf // create: atf_amc.FDb.linebuf (Cppstack) struct Linebuf { // atf_amc.Linebuf - u8 in_elems[64]; // pointer to elements of inline array + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array i32 in_start; // beginning of valid bytes (in bytes) i32 in_end; // end of valid bytes (in bytes) - bool in_eof; // no more data will be written to buffer + i32 in_msglen; // current message length algo::Errcode in_err; // system error code + bool in_eof; // no more data will be written to buffer bool in_msgvalid; // current message is valid - i32 in_msglen; // current message length bool in_epoll_enable; // use epoll? - enum { in_max = 64 }; // func:atf_amc.Linebuf..Ctor inline Linebuf() __attribute__((nothrow)); + // func:atf_amc.Linebuf..Dtor + inline ~Linebuf() __attribute__((nothrow)); }; // Detect incoming message in buffer and return it @@ -5570,6 +6211,12 @@ struct Linebuf { // atf_amc.Linebuf // // func:atf_amc.Linebuf.in.GetMsg algo::aryptr in_GetMsg(atf_amc::Linebuf& linebuf) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:atf_amc.Linebuf.in.Realloc +void in_Realloc(atf_amc::Linebuf& linebuf, int new_max) __attribute__((nothrow)); // Return max. number of bytes in the buffer. // func:atf_amc.Linebuf.in.Max inline i32 in_Max(atf_amc::Linebuf& linebuf) __attribute__((nothrow)); @@ -5589,17 +6236,23 @@ void in_SkipBytes(atf_amc::Linebuf& linebuf, int n) __attribute_ // Skip current message, if any. // func:atf_amc.Linebuf.in.SkipMsg void in_SkipMsg(atf_amc::Linebuf& linebuf) __attribute__((nothrow)); -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. // // func:atf_amc.Linebuf.in.WriteAll bool in_WriteAll(atf_amc::Linebuf& linebuf, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:atf_amc.Linebuf.in.WriteReserve +void in_WriteReserve(atf_amc::Linebuf& linebuf, u8 *in, i32 in_n) __attribute__((nothrow)); // Set all fields to initial values. // func:atf_amc.Linebuf..Init void Linebuf_Init(atf_amc::Linebuf& linebuf); +// func:atf_amc.Linebuf..Uninit +void Linebuf_Uninit(atf_amc::Linebuf& linebuf) __attribute__((nothrow)); // print string representation of ROW to string STR // cfmt:atf_amc.Linebuf.String printfmt:Raw // func:atf_amc.Linebuf..Print @@ -5867,8 +6520,15 @@ void MsgLength_Print(atf_amc::MsgLength row, algo::cstring& str) // --- atf_amc.MsgHeader // create: atf_amc.Msgbuf.in_buf (Fbuf) // create: atf_amc.Seqmsg.payload (Opt) +// create: atf_amc.Varlen2mMsg.m1 (Varlen) +// create: atf_amc.Varlen2mMsg.m2 (Varlen) +// create: atf_amc.Varlen2mMsg.m3 (Varlen) // access: atf_amc.Seqmsg.msghdr (Base) // access: atf_amc.Text.msghdr (Base) +// access: atf_amc.Varlen2Msg.base (Base) +// access: atf_amc.Varlen2aMsg.base (Base) +// access: atf_amc.Varlen2mMsg.base (Base) +// access: atf_amc.Varlen2vMsg.base (Base) // access: atf_amc.VarlenMsg.base (Base) // access: atf_amc.MsgHeader_curs.msg (Ptr) #pragma pack(push,1) @@ -6162,44 +6822,44 @@ void MsgLTV_Print(atf_amc::MsgLTV& row, algo::cstring& str) __at struct Msgbuf { // atf_amc.Msgbuf atf_amc::Msgbuf* cd_in_msg_next; // zslist link; -1 means not-in-list atf_amc::Msgbuf* cd_in_msg_prev; // previous element - u8 in_buf_elems[64]; // pointer to elements of inline array + u8* in_buf_elems; // NULL pointer to elements of indirect array + u32 in_buf_max; // 0 current length of allocated array i32 in_buf_start; // beginning of valid bytes (in bytes) i32 in_buf_end; // end of valid bytes (in bytes) - bool in_buf_eof; // no more data will be written to buffer + i32 in_buf_msglen; // current message length algo::Errcode in_buf_err; // system error code + algo_lib::FIohook in_buf_iohook; // edge-triggered hook for the buffer + bool in_buf_eof; // no more data will be written to buffer bool in_buf_msgvalid; // current message is valid - i32 in_buf_msglen; // current message length - algo_lib::FIohook in_buf_iohook; // edge-triggered hook for refilling buffer bool in_buf_epoll_enable; // use epoll? - enum { in_buf_max = 64 }; - u8 in_custom_elems[64]; // pointer to elements of inline array + u8* in_custom_elems; // NULL pointer to elements of indirect array + u32 in_custom_max; // 0 current length of allocated array i32 in_custom_start; // beginning of valid bytes (in bytes) i32 in_custom_end; // end of valid bytes (in bytes) - bool in_custom_eof; // no more data will be written to buffer + i32 in_custom_msglen; // current message length algo::Errcode in_custom_err; // system error code + algo_lib::FIohook in_custom_iohook; // edge-triggered hook for the buffer + bool in_custom_eof; // no more data will be written to buffer bool in_custom_msgvalid; // current message is valid - i32 in_custom_msglen; // current message length - algo_lib::FIohook in_custom_iohook; // edge-triggered hook for refilling buffer bool in_custom_epoll_enable; // use epoll? - enum { in_custom_max = 64 }; - u8 out_extra_elems[64]; // pointer to elements of inline array + u8* out_extra_elems; // NULL pointer to elements of indirect array + u32 out_extra_max; // 0 current length of allocated array i32 out_extra_start; // beginning of valid bytes (in bytes) i32 out_extra_end; // end of valid bytes (in bytes) - bool out_extra_eof; // no more data will be written to buffer + i32 out_extra_msglen; // current message length algo::Errcode out_extra_err; // system error code + bool out_extra_eof; // no more data will be written to buffer bool out_extra_msgvalid; // current message is valid - i32 out_extra_msglen; // current message length bool out_extra_epoll_enable; // use epoll? - enum { out_extra_max = 64 }; - u8 in_extra_elems[64]; // pointer to elements of inline array + u8* in_extra_elems; // NULL pointer to elements of indirect array + u32 in_extra_max; // 0 current length of allocated array i32 in_extra_start; // beginning of valid bytes (in bytes) i32 in_extra_end; // end of valid bytes (in bytes) - bool in_extra_eof; // no more data will be written to buffer + i32 in_extra_msglen; // current message length algo::Errcode in_extra_err; // system error code + bool in_extra_eof; // no more data will be written to buffer bool in_extra_msgvalid; // current message is valid - i32 in_extra_msglen; // current message length bool in_extra_epoll_enable; // use epoll? - enum { in_extra_max = 64 }; // field atf_amc.Msgbuf.in_buf prevents copy // field atf_amc.Msgbuf.in_custom prevents copy // field atf_amc.Msgbuf.out_extra prevents copy @@ -6235,6 +6895,12 @@ void in_buf_EndRead(atf_amc::Msgbuf& msgbuf) __attribute__((noth // // func:atf_amc.Msgbuf.in_buf.GetMsg atf_amc::MsgHeader* in_buf_GetMsg(atf_amc::Msgbuf& msgbuf) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:atf_amc.Msgbuf.in_buf.Realloc +void in_buf_Realloc(atf_amc::Msgbuf& msgbuf, int new_max) __attribute__((nothrow)); // Return max. number of bytes in the buffer. // func:atf_amc.Msgbuf.in_buf.Max inline i32 in_buf_Max(atf_amc::Msgbuf& msgbuf) __attribute__((nothrow)); @@ -6252,13 +6918,17 @@ void in_buf_RemoveAll(atf_amc::Msgbuf& msgbuf) __attribute__((no // Skip current message, if any. // func:atf_amc.Msgbuf.in_buf.SkipMsg void in_buf_SkipMsg(atf_amc::Msgbuf& msgbuf) __attribute__((nothrow)); -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. // // func:atf_amc.Msgbuf.in_buf.WriteAll bool in_buf_WriteAll(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:atf_amc.Msgbuf.in_buf.WriteReserve +void in_buf_WriteReserve(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) __attribute__((nothrow)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. // func:atf_amc.Msgbuf.in_buf.XrefMaybe @@ -6281,6 +6951,12 @@ void in_custom_EndRead(atf_amc::Msgbuf& msgbuf) __attribute__((n // // func:atf_amc.Msgbuf.in_custom.GetMsg algo::aryptr in_custom_GetMsg(atf_amc::Msgbuf& msgbuf) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:atf_amc.Msgbuf.in_custom.Realloc +void in_custom_Realloc(atf_amc::Msgbuf& msgbuf, int new_max) __attribute__((nothrow)); // Return max. number of bytes in the buffer. // func:atf_amc.Msgbuf.in_custom.Max inline i32 in_custom_Max(atf_amc::Msgbuf& msgbuf) __attribute__((nothrow)); @@ -6308,14 +6984,24 @@ void in_custom_SkipBytes(atf_amc::Msgbuf& msgbuf, int n) __attri // Skip current message, if any. // func:atf_amc.Msgbuf.in_custom.SkipMsg void in_custom_SkipMsg(atf_amc::Msgbuf& msgbuf) __attribute__((nothrow)); -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. // // func:atf_amc.Msgbuf.in_custom.WriteAll bool in_custom_WriteAll(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:atf_amc.Msgbuf.in_custom.WriteReserve +void in_custom_WriteReserve(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:atf_amc.Msgbuf.out_extra.Realloc +void out_extra_Realloc(atf_amc::Msgbuf& msgbuf, int new_max) __attribute__((nothrow)); // Return max. number of bytes in the buffer. // func:atf_amc.Msgbuf.out_extra.Max inline i32 out_extra_Max(atf_amc::Msgbuf& msgbuf) __attribute__((nothrow)); @@ -6335,13 +7021,17 @@ void out_extra_SkipBytes(atf_amc::Msgbuf& msgbuf, int n) __attri // Skip current message, if any. // func:atf_amc.Msgbuf.out_extra.SkipMsg void out_extra_SkipMsg(atf_amc::Msgbuf& msgbuf) __attribute__((nothrow)); -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. // // func:atf_amc.Msgbuf.out_extra.WriteAll bool out_extra_WriteAll(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:atf_amc.Msgbuf.out_extra.WriteReserve +void out_extra_WriteReserve(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) __attribute__((nothrow)); // Write message to buffer. If the entire message is written, return true, otherwise false. // func:atf_amc.Msgbuf.out_extra.WriteMsg bool out_extra_WriteMsg(atf_amc::Msgbuf& msgbuf, atf_amc::MsgHdrLT &msg) __attribute__((nothrow)); @@ -6354,6 +7044,12 @@ bool out_extra_WriteMsg(atf_amc::Msgbuf& msgbuf, atf_amc::MsgHdr // // func:atf_amc.Msgbuf.in_extra.GetMsg atf_amc::MsgHdrLT* in_extra_GetMsg(atf_amc::Msgbuf& msgbuf) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:atf_amc.Msgbuf.in_extra.Realloc +void in_extra_Realloc(atf_amc::Msgbuf& msgbuf, int new_max) __attribute__((nothrow)); // Return max. number of bytes in the buffer. // func:atf_amc.Msgbuf.in_extra.Max inline i32 in_extra_Max(atf_amc::Msgbuf& msgbuf) __attribute__((nothrow)); @@ -6368,13 +7064,17 @@ void in_extra_RemoveAll(atf_amc::Msgbuf& msgbuf) __attribute__(( // Skip current message, if any. // func:atf_amc.Msgbuf.in_extra.SkipMsg void in_extra_SkipMsg(atf_amc::Msgbuf& msgbuf) __attribute__((nothrow)); -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. // // func:atf_amc.Msgbuf.in_extra.WriteAll bool in_extra_WriteAll(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:atf_amc.Msgbuf.in_extra.WriteReserve +void in_extra_WriteReserve(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) __attribute__((nothrow)); // Set all fields to initial values. // func:atf_amc.Msgbuf..Init @@ -7069,39 +7769,6 @@ inline int value7_Present_GetBit(atf_amc::PmaskMultiple& parent) __att // func:atf_amc.PmaskMultiple.value7.Set inline void value7_Set(atf_amc::PmaskMultiple& parent, u32 rhs) __attribute__((nothrow)); -// proceed to next item -// func:atf_amc.PmaskMultiple.present_bitcurs.Next -void PmaskMultiple_present_bitcurs_Next(PmaskMultiple_present_bitcurs &curs); -// func:atf_amc.PmaskMultiple.present_bitcurs.Reset -inline void PmaskMultiple_present_bitcurs_Reset(PmaskMultiple_present_bitcurs &curs, atf_amc::PmaskMultiple &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:atf_amc.PmaskMultiple.present_bitcurs.ValidQ -inline bool PmaskMultiple_present_bitcurs_ValidQ(PmaskMultiple_present_bitcurs &curs) __attribute__((nothrow)); -// item access -// func:atf_amc.PmaskMultiple.present_bitcurs.Access -inline int& PmaskMultiple_present_bitcurs_Access(PmaskMultiple_present_bitcurs &curs) __attribute__((nothrow)); -// proceed to next item -// func:atf_amc.PmaskMultiple.assigned_bitcurs.Next -void PmaskMultiple_assigned_bitcurs_Next(PmaskMultiple_assigned_bitcurs &curs); -// func:atf_amc.PmaskMultiple.assigned_bitcurs.Reset -inline void PmaskMultiple_assigned_bitcurs_Reset(PmaskMultiple_assigned_bitcurs &curs, atf_amc::PmaskMultiple &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:atf_amc.PmaskMultiple.assigned_bitcurs.ValidQ -inline bool PmaskMultiple_assigned_bitcurs_ValidQ(PmaskMultiple_assigned_bitcurs &curs) __attribute__((nothrow)); -// item access -// func:atf_amc.PmaskMultiple.assigned_bitcurs.Access -inline int& PmaskMultiple_assigned_bitcurs_Access(PmaskMultiple_assigned_bitcurs &curs) __attribute__((nothrow)); -// proceed to next item -// func:atf_amc.PmaskMultiple.nullable_bitcurs.Next -void PmaskMultiple_nullable_bitcurs_Next(PmaskMultiple_nullable_bitcurs &curs); -// func:atf_amc.PmaskMultiple.nullable_bitcurs.Reset -inline void PmaskMultiple_nullable_bitcurs_Reset(PmaskMultiple_nullable_bitcurs &curs, atf_amc::PmaskMultiple &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:atf_amc.PmaskMultiple.nullable_bitcurs.ValidQ -inline bool PmaskMultiple_nullable_bitcurs_ValidQ(PmaskMultiple_nullable_bitcurs &curs) __attribute__((nothrow)); -// item access -// func:atf_amc.PmaskMultiple.nullable_bitcurs.Access -inline int& PmaskMultiple_nullable_bitcurs_Access(PmaskMultiple_nullable_bitcurs &curs) __attribute__((nothrow)); // func:atf_amc.PmaskMultiple..ReadFieldMaybe bool PmaskMultiple_ReadFieldMaybe(atf_amc::PmaskMultiple& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); // Read fields of atf_amc::PmaskMultiple from an ascii string. @@ -8241,17 +8908,6 @@ inline int value5_Present_GetBit(atf_amc::PmaskU32& parent) __attribut // func:atf_amc.PmaskU32.value5.Set inline void value5_Set(atf_amc::PmaskU32& parent, u32 rhs) __attribute__((nothrow)); -// proceed to next item -// func:atf_amc.PmaskU32.pmask_bitcurs.Next -void PmaskU32_pmask_bitcurs_Next(PmaskU32_pmask_bitcurs &curs); -// func:atf_amc.PmaskU32.pmask_bitcurs.Reset -inline void PmaskU32_pmask_bitcurs_Reset(PmaskU32_pmask_bitcurs &curs, atf_amc::PmaskU32 &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:atf_amc.PmaskU32.pmask_bitcurs.ValidQ -inline bool PmaskU32_pmask_bitcurs_ValidQ(PmaskU32_pmask_bitcurs &curs) __attribute__((nothrow)); -// item access -// func:atf_amc.PmaskU32.pmask_bitcurs.Access -inline int& PmaskU32_pmask_bitcurs_Access(PmaskU32_pmask_bitcurs &curs) __attribute__((nothrow)); // func:atf_amc.PmaskU32..ReadFieldMaybe bool PmaskU32_ReadFieldMaybe(atf_amc::PmaskU32& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); // Read fields of atf_amc::PmaskU32 from an ascii string. @@ -8361,17 +9017,6 @@ inline u64& pmask_qFind(atf_amc::PmaskU555& parent, u64 t) __attribute_ // func:atf_amc.PmaskU555.pmask.ReadStrptrMaybe bool pmask_ReadStrptrMaybe(atf_amc::PmaskU555& parent, algo::strptr in_str) __attribute__((nothrow)); -// proceed to next item -// func:atf_amc.PmaskU555.pmask_bitcurs.Next -void PmaskU555_pmask_bitcurs_Next(PmaskU555_pmask_bitcurs &curs); -// func:atf_amc.PmaskU555.pmask_bitcurs.Reset -inline void PmaskU555_pmask_bitcurs_Reset(PmaskU555_pmask_bitcurs &curs, atf_amc::PmaskU555 &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:atf_amc.PmaskU555.pmask_bitcurs.ValidQ -inline bool PmaskU555_pmask_bitcurs_ValidQ(PmaskU555_pmask_bitcurs &curs) __attribute__((nothrow)); -// item access -// func:atf_amc.PmaskU555.pmask_bitcurs.Access -inline int& PmaskU555_pmask_bitcurs_Access(PmaskU555_pmask_bitcurs &curs) __attribute__((nothrow)); // cursor points to valid item // func:atf_amc.PmaskU555.pmask_curs.Reset inline void PmaskU555_pmask_curs_Reset(PmaskU555_pmask_curs &curs, atf_amc::PmaskU555 &parent) __attribute__((nothrow)); @@ -8482,8 +9127,6 @@ struct RnullStr6_U32 { // atf_amc.RnullStr6_U32: number stored as ascii digits, // Access string as array of chars // func:atf_amc.RnullStr6_U32.ch.Getary inline algo::aryptr ch_Getary(const atf_amc::RnullStr6_U32& parent) __attribute__((nothrow)); -// func:atf_amc.RnullStr6_U32.ch.HashStrptr -inline u32 RnullStr6_U32_Hash(u32 prev, const algo::strptr &str); // func:atf_amc.RnullStr6_U32.ch.Init inline void ch_Init(atf_amc::RnullStr6_U32 &parent) __attribute__((nothrow)); // always return constant 6 @@ -8590,8 +9233,6 @@ inline void ch_AddStrptr(atf_amc::RpasU32Str6& parent, algo::strptr str // Access string as array of chars // func:atf_amc.RpasU32Str6.ch.Getary inline algo::aryptr ch_Getary(const atf_amc::RpasU32Str6& parent) __attribute__((nothrow)); -// func:atf_amc.RpasU32Str6.ch.HashStrptr -inline u32 RpasU32Str6_Hash(u32 prev, const algo::strptr &str); // func:atf_amc.RpasU32Str6.ch.Init inline void ch_Init(atf_amc::RpasU32Str6 &parent) __attribute__((nothrow)); // always return constant 6 @@ -8860,6 +9501,34 @@ bool SsimfilesCase_ReadStrptrMaybe(atf_amc::SsimfilesCase &paren // func:atf_amc.SsimfilesCase..Init inline void SsimfilesCase_Init(atf_amc::SsimfilesCase& parent); +// --- atf_amc.Strkey +// create: atf_amc.FDb.strkey (Tpool) +// global access: ind_strkey (Thash, hash field strkey) +struct Strkey { // atf_amc.Strkey + atf_amc::Strkey* strkey_next; // Pointer to next free element int tpool + atf_amc::Strkey* ind_strkey_next; // hash next + u32 ind_strkey_hashval; // hash value + algo::cstring strkey; // + // func:atf_amc.Strkey..AssignOp + inline atf_amc::Strkey& operator =(const atf_amc::Strkey &rhs) = delete; + // func:atf_amc.Strkey..CopyCtor + inline Strkey(const atf_amc::Strkey &rhs) = delete; +private: + // func:atf_amc.Strkey..Ctor + inline Strkey() __attribute__((nothrow)); + // func:atf_amc.Strkey..Dtor + inline ~Strkey() __attribute__((nothrow)); + friend atf_amc::Strkey& strkey_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_amc::Strkey* strkey_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void strkey_Delete(atf_amc::Strkey &row) __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:atf_amc.Strkey..Init +inline void Strkey_Init(atf_amc::Strkey& strkey); +// func:atf_amc.Strkey..Uninit +void Strkey_Uninit(atf_amc::Strkey& strkey) __attribute__((nothrow)); + // --- atf_amc.TableId struct TableId { // atf_amc.TableId: Index of table in this namespace i32 value; // -1 index of table @@ -8948,6 +9617,11 @@ u32& tary_u32_AllocAt(atf_amc::TaryU32& parent, int at) __attrib // Reserve space. Insert N elements at the end of the array, return pointer to array // func:atf_amc.TaryU32.tary_u32.AllocN algo::aryptr tary_u32_AllocN(atf_amc::TaryU32& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:atf_amc.TaryU32.tary_u32.AllocNAt +algo::aryptr tary_u32_AllocNAt(atf_amc::TaryU32& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:atf_amc.TaryU32.tary_u32.EmptyQ inline bool tary_u32_EmptyQ(atf_amc::TaryU32& parent) __attribute__((nothrow)); @@ -9004,6 +9678,10 @@ algo::aryptr tary_u32_AllocNVal(atf_amc::TaryU32& parent, int n_elems, c // Function returns success value. // func:atf_amc.TaryU32.tary_u32.ReadStrptrMaybe bool tary_u32_ReadStrptrMaybe(atf_amc::TaryU32& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:atf_amc.TaryU32.tary_u32.Insary +void tary_u32_Insary(atf_amc::TaryU32& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:atf_amc.TaryU32.tary_u32_curs.Next @@ -9058,6 +9736,11 @@ u8& ary_AllocAt(atf_amc::TaryU8& parent, int at) __attribute__( // Reserve space. Insert N elements at the end of the array, return pointer to array // func:atf_amc.TaryU8.ary.AllocN algo::aryptr ary_AllocN(atf_amc::TaryU8& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:atf_amc.TaryU8.ary.AllocNAt +algo::aryptr ary_AllocNAt(atf_amc::TaryU8& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:atf_amc.TaryU8.ary.EmptyQ inline bool ary_EmptyQ(atf_amc::TaryU8& parent) __attribute__((nothrow)); @@ -9116,6 +9799,10 @@ algo::aryptr ary_AllocNVal(atf_amc::TaryU8& parent, int n_elems, const u // The array is replaced with the input string. Function always succeeds. // func:atf_amc.TaryU8.ary.ReadStrptrMaybe bool ary_ReadStrptrMaybe(atf_amc::TaryU8& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:atf_amc.TaryU8.ary.Insary +void ary_Insary(atf_amc::TaryU8& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:atf_amc.TaryU8.ary_curs.Next @@ -9808,6 +10495,549 @@ inline void Typefconst_Init(atf_amc::Typefconst& parent); // func:atf_amc.Typefconst..Print void Typefconst_Print(atf_amc::Typefconst& row, algo::cstring& str) __attribute__((nothrow)); +// --- atf_amc.Varlen2Msg +#pragma pack(push,1) +struct Varlen2Msg { // atf_amc.Varlen2Msg + atf_amc::MsgType type; // 0x1001 Message type + atf_amc::MsgLength length; // ssizeof(parent) + (0) Total message length, including this header + atf_amc::MsgLength s1_end; // end of s1 field + // var-length field atf_amc.Varlen2Msg.s1 starts here. access it with s1_Addr + atf_amc::MsgLength s2_end; // end of s2 field + // var-length field atf_amc.Varlen2Msg.s2 starts here. access it with s2_Addr + // var-length field atf_amc.Varlen2Msg.s3 starts here. access it with s3_Addr + // func:atf_amc.Varlen2Msg..Ctor + inline Varlen2Msg() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:atf_amc.Varlen2Msg.base.CopyOut +void parent_CopyOut(atf_amc::Varlen2Msg &row, atf_amc::MsgHeader &out) __attribute__((nothrow)); +// Check if atf_amc::MsgHeader is an instance of Varlen2Msg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Varlen2Msg. +// If not successful, quietly return NULL. +// func:atf_amc.Varlen2Msg.base.Castdown +inline atf_amc::Varlen2Msg* Varlen2Msg_Castdown(atf_amc::MsgHeader &hdr); +// func:atf_amc.Varlen2Msg.base.Castbase +inline atf_amc::MsgHeader& Castbase(atf_amc::Varlen2Msg& parent); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2Msg.s1.Getary +algo::aryptr s1_Getary(atf_amc::Varlen2Msg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2Msg.s1.Addr +char* s1_Addr(atf_amc::Varlen2Msg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2Msg.s1.N +inline u32 s1_N(const atf_amc::Varlen2Msg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2Msg.s1.ReadStrptrMaybe +bool s1_ReadStrptrMaybe(atf_amc::Varlen2Msg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert s1 to a string. +// Array is printed as a regular string. +// func:atf_amc.Varlen2Msg.s1.Print +void s1_Print(atf_amc::Varlen2Msg& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2Msg.s2.Getary +algo::aryptr s2_Getary(atf_amc::Varlen2Msg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2Msg.s2.Addr +char* s2_Addr(atf_amc::Varlen2Msg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2Msg.s2.N +inline u32 s2_N(const atf_amc::Varlen2Msg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2Msg.s2.ReadStrptrMaybe +bool s2_ReadStrptrMaybe(atf_amc::Varlen2Msg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert s2 to a string. +// Array is printed as a regular string. +// func:atf_amc.Varlen2Msg.s2.Print +void s2_Print(atf_amc::Varlen2Msg& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2Msg.s3.Getary +algo::aryptr s3_Getary(atf_amc::Varlen2Msg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2Msg.s3.Addr +char* s3_Addr(atf_amc::Varlen2Msg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2Msg.s3.N +inline u32 s3_N(const atf_amc::Varlen2Msg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2Msg.s3.ReadStrptrMaybe +bool s3_ReadStrptrMaybe(atf_amc::Varlen2Msg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert s3 to a string. +// Array is printed as a regular string. +// func:atf_amc.Varlen2Msg.s3.Print +void s3_Print(atf_amc::Varlen2Msg& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:atf_amc.Varlen2Msg.s1_curs.Reset +inline void Varlen2Msg_s1_curs_Reset(Varlen2Msg_s1_curs &curs, atf_amc::Varlen2Msg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2Msg.s1_curs.ValidQ +inline bool Varlen2Msg_s1_curs_ValidQ(Varlen2Msg_s1_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2Msg.s1_curs.Next +inline void Varlen2Msg_s1_curs_Next(Varlen2Msg_s1_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2Msg.s1_curs.Access +inline char& Varlen2Msg_s1_curs_Access(Varlen2Msg_s1_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2Msg.s2_curs.Reset +inline void Varlen2Msg_s2_curs_Reset(Varlen2Msg_s2_curs &curs, atf_amc::Varlen2Msg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2Msg.s2_curs.ValidQ +inline bool Varlen2Msg_s2_curs_ValidQ(Varlen2Msg_s2_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2Msg.s2_curs.Next +inline void Varlen2Msg_s2_curs_Next(Varlen2Msg_s2_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2Msg.s2_curs.Access +inline char& Varlen2Msg_s2_curs_Access(Varlen2Msg_s2_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2Msg.s3_curs.Reset +inline void Varlen2Msg_s3_curs_Reset(Varlen2Msg_s3_curs &curs, atf_amc::Varlen2Msg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2Msg.s3_curs.ValidQ +inline bool Varlen2Msg_s3_curs_ValidQ(Varlen2Msg_s3_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2Msg.s3_curs.Next +inline void Varlen2Msg_s3_curs_Next(Varlen2Msg_s3_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2Msg.s3_curs.Access +inline char& Varlen2Msg_s3_curs_Access(Varlen2Msg_s3_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2Msg..ReadFieldMaybe +bool Varlen2Msg_ReadFieldMaybe(atf_amc::Varlen2Msg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::Varlen2Msg from an ascii string. +// The format of the string is an ssim Tuple +// func:atf_amc.Varlen2Msg..ReadStrptrMaybe +bool Varlen2Msg_ReadStrptrMaybe(atf_amc::Varlen2Msg &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:atf_amc.Varlen2Msg..GetMsgLength +inline i32 GetMsgLength(const atf_amc::Varlen2Msg& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:atf_amc.Varlen2Msg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const atf_amc::Varlen2Msg& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:atf_amc.Varlen2Msg..Init +inline void Varlen2Msg_Init(atf_amc::Varlen2Msg& parent); +// print string representation of ROW to string STR +// cfmt:atf_amc.Varlen2Msg.String printfmt:Tuple +// func:atf_amc.Varlen2Msg..Print +void Varlen2Msg_Print(atf_amc::Varlen2Msg& row, algo::cstring& str) __attribute__((nothrow)); + +// --- atf_amc.Varlen2aMsg +#pragma pack(push,1) +struct Varlen2aMsg { // atf_amc.Varlen2aMsg + atf_amc::MsgType type; // 0x1002 Message type + atf_amc::MsgLength length; // ssizeof(parent) + (0) Total message length, including this header + atf_amc::MsgLength u1_end; // end of u1 field + // var-length field atf_amc.Varlen2aMsg.u1 starts here. access it with u1_Addr + atf_amc::MsgLength u2_end; // end of u2 field + // var-length field atf_amc.Varlen2aMsg.u2 starts here. access it with u2_Addr + // var-length field atf_amc.Varlen2aMsg.u3 starts here. access it with u3_Addr + // func:atf_amc.Varlen2aMsg..Ctor + inline Varlen2aMsg() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:atf_amc.Varlen2aMsg.base.CopyOut +void parent_CopyOut(atf_amc::Varlen2aMsg &row, atf_amc::MsgHeader &out) __attribute__((nothrow)); +// Check if atf_amc::MsgHeader is an instance of Varlen2aMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Varlen2aMsg. +// If not successful, quietly return NULL. +// func:atf_amc.Varlen2aMsg.base.Castdown +inline atf_amc::Varlen2aMsg* Varlen2aMsg_Castdown(atf_amc::MsgHeader &hdr); +// func:atf_amc.Varlen2aMsg.base.Castbase +inline atf_amc::MsgHeader& Castbase(atf_amc::Varlen2aMsg& parent); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2aMsg.u1.Getary +algo::aryptr u1_Getary(atf_amc::Varlen2aMsg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2aMsg.u1.Addr +u32* u1_Addr(atf_amc::Varlen2aMsg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2aMsg.u1.N +inline u32 u1_N(const atf_amc::Varlen2aMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2aMsg.u1.ReadStrptrMaybe +bool u1_ReadStrptrMaybe(atf_amc::Varlen2aMsg& parent, algo::strptr in_str) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2aMsg.u2.Getary +algo::aryptr u2_Getary(atf_amc::Varlen2aMsg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2aMsg.u2.Addr +u32* u2_Addr(atf_amc::Varlen2aMsg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2aMsg.u2.N +inline u32 u2_N(const atf_amc::Varlen2aMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2aMsg.u2.ReadStrptrMaybe +bool u2_ReadStrptrMaybe(atf_amc::Varlen2aMsg& parent, algo::strptr in_str) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2aMsg.u3.Getary +algo::aryptr u3_Getary(atf_amc::Varlen2aMsg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2aMsg.u3.Addr +u32* u3_Addr(atf_amc::Varlen2aMsg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2aMsg.u3.N +inline u32 u3_N(const atf_amc::Varlen2aMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2aMsg.u3.ReadStrptrMaybe +bool u3_ReadStrptrMaybe(atf_amc::Varlen2aMsg& parent, algo::strptr in_str) __attribute__((nothrow)); + +// func:atf_amc.Varlen2aMsg.u1_curs.Reset +inline void Varlen2aMsg_u1_curs_Reset(Varlen2aMsg_u1_curs &curs, atf_amc::Varlen2aMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2aMsg.u1_curs.ValidQ +inline bool Varlen2aMsg_u1_curs_ValidQ(Varlen2aMsg_u1_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2aMsg.u1_curs.Next +inline void Varlen2aMsg_u1_curs_Next(Varlen2aMsg_u1_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2aMsg.u1_curs.Access +inline u32& Varlen2aMsg_u1_curs_Access(Varlen2aMsg_u1_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2aMsg.u2_curs.Reset +inline void Varlen2aMsg_u2_curs_Reset(Varlen2aMsg_u2_curs &curs, atf_amc::Varlen2aMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2aMsg.u2_curs.ValidQ +inline bool Varlen2aMsg_u2_curs_ValidQ(Varlen2aMsg_u2_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2aMsg.u2_curs.Next +inline void Varlen2aMsg_u2_curs_Next(Varlen2aMsg_u2_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2aMsg.u2_curs.Access +inline u32& Varlen2aMsg_u2_curs_Access(Varlen2aMsg_u2_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2aMsg.u3_curs.Reset +inline void Varlen2aMsg_u3_curs_Reset(Varlen2aMsg_u3_curs &curs, atf_amc::Varlen2aMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2aMsg.u3_curs.ValidQ +inline bool Varlen2aMsg_u3_curs_ValidQ(Varlen2aMsg_u3_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2aMsg.u3_curs.Next +inline void Varlen2aMsg_u3_curs_Next(Varlen2aMsg_u3_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2aMsg.u3_curs.Access +inline u32& Varlen2aMsg_u3_curs_Access(Varlen2aMsg_u3_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2aMsg..ReadFieldMaybe +bool Varlen2aMsg_ReadFieldMaybe(atf_amc::Varlen2aMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::Varlen2aMsg from an ascii string. +// The format of the string is an ssim Tuple +// func:atf_amc.Varlen2aMsg..ReadStrptrMaybe +bool Varlen2aMsg_ReadStrptrMaybe(atf_amc::Varlen2aMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:atf_amc.Varlen2aMsg..GetMsgLength +inline i32 GetMsgLength(const atf_amc::Varlen2aMsg& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:atf_amc.Varlen2aMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const atf_amc::Varlen2aMsg& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:atf_amc.Varlen2aMsg..Init +inline void Varlen2aMsg_Init(atf_amc::Varlen2aMsg& parent); +// print string representation of ROW to string STR +// cfmt:atf_amc.Varlen2aMsg.String printfmt:Tuple +// func:atf_amc.Varlen2aMsg..Print +void Varlen2aMsg_Print(atf_amc::Varlen2aMsg& row, algo::cstring& str) __attribute__((nothrow)); + +// --- atf_amc.Varlen2mMsg +#pragma pack(push,1) +struct Varlen2mMsg { // atf_amc.Varlen2mMsg + atf_amc::MsgType type; // 0x1004 Message type + atf_amc::MsgLength length; // ssizeof(parent) + (0) Total message length, including this header + atf_amc::MsgLength m1_end; // end of m1 field + // var-length field atf_amc.Varlen2mMsg.m1 starts here. access it with m1_Addr + atf_amc::MsgLength m2_end; // end of m2 field + // var-length field atf_amc.Varlen2mMsg.m2 starts here. access it with m2_Addr + // var-length field atf_amc.Varlen2mMsg.m3 starts here. access it with m3_Addr + // func:atf_amc.Varlen2mMsg..Ctor + inline Varlen2mMsg() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:atf_amc.Varlen2mMsg.base.CopyOut +void parent_CopyOut(atf_amc::Varlen2mMsg &row, atf_amc::MsgHeader &out) __attribute__((nothrow)); +// Check if atf_amc::MsgHeader is an instance of Varlen2mMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Varlen2mMsg. +// If not successful, quietly return NULL. +// func:atf_amc.Varlen2mMsg.base.Castdown +inline atf_amc::Varlen2mMsg* Varlen2mMsg_Castdown(atf_amc::MsgHeader &hdr); +// func:atf_amc.Varlen2mMsg.base.Castbase +inline atf_amc::MsgHeader& Castbase(atf_amc::Varlen2mMsg& parent); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2mMsg.m1.Getary +algo::aryptr m1_Getary(atf_amc::Varlen2mMsg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2mMsg.m1.Addr +u8* m1_Addr(atf_amc::Varlen2mMsg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2mMsg.m1.N +inline u32 m1_N(const atf_amc::Varlen2mMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2mMsg.m1.ReadStrptrMaybe +bool m1_ReadStrptrMaybe(atf_amc::Varlen2mMsg& parent, algo::strptr in_str) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2mMsg.m2.Getary +algo::aryptr m2_Getary(atf_amc::Varlen2mMsg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2mMsg.m2.Addr +u8* m2_Addr(atf_amc::Varlen2mMsg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2mMsg.m2.N +inline u32 m2_N(const atf_amc::Varlen2mMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2mMsg.m2.ReadStrptrMaybe +bool m2_ReadStrptrMaybe(atf_amc::Varlen2mMsg& parent, algo::strptr in_str) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2mMsg.m3.Getary +algo::aryptr m3_Getary(atf_amc::Varlen2mMsg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2mMsg.m3.Addr +u8* m3_Addr(atf_amc::Varlen2mMsg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2mMsg.m3.N +inline u32 m3_N(const atf_amc::Varlen2mMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2mMsg.m3.ReadStrptrMaybe +bool m3_ReadStrptrMaybe(atf_amc::Varlen2mMsg& parent, algo::strptr in_str) __attribute__((nothrow)); + +// func:atf_amc.Varlen2mMsg.m1_curs.Reset +inline void Varlen2mMsg_m1_curs_Reset(Varlen2mMsg_m1_curs &curs, atf_amc::Varlen2mMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2mMsg.m1_curs.ValidQ +inline bool Varlen2mMsg_m1_curs_ValidQ(Varlen2mMsg_m1_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2mMsg.m1_curs.Next +inline void Varlen2mMsg_m1_curs_Next(Varlen2mMsg_m1_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2mMsg.m1_curs.Access +inline atf_amc::MsgHeader& Varlen2mMsg_m1_curs_Access(Varlen2mMsg_m1_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2mMsg.m2_curs.Reset +inline void Varlen2mMsg_m2_curs_Reset(Varlen2mMsg_m2_curs &curs, atf_amc::Varlen2mMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2mMsg.m2_curs.ValidQ +inline bool Varlen2mMsg_m2_curs_ValidQ(Varlen2mMsg_m2_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2mMsg.m2_curs.Next +inline void Varlen2mMsg_m2_curs_Next(Varlen2mMsg_m2_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2mMsg.m2_curs.Access +inline atf_amc::MsgHeader& Varlen2mMsg_m2_curs_Access(Varlen2mMsg_m2_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2mMsg.m3_curs.Reset +inline void Varlen2mMsg_m3_curs_Reset(Varlen2mMsg_m3_curs &curs, atf_amc::Varlen2mMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2mMsg.m3_curs.ValidQ +inline bool Varlen2mMsg_m3_curs_ValidQ(Varlen2mMsg_m3_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2mMsg.m3_curs.Next +inline void Varlen2mMsg_m3_curs_Next(Varlen2mMsg_m3_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2mMsg.m3_curs.Access +inline atf_amc::MsgHeader& Varlen2mMsg_m3_curs_Access(Varlen2mMsg_m3_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2mMsg..ReadFieldMaybe +bool Varlen2mMsg_ReadFieldMaybe(atf_amc::Varlen2mMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::Varlen2mMsg from an ascii string. +// The format of the string is an ssim Tuple +// func:atf_amc.Varlen2mMsg..ReadStrptrMaybe +bool Varlen2mMsg_ReadStrptrMaybe(atf_amc::Varlen2mMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:atf_amc.Varlen2mMsg..GetMsgLength +inline i32 GetMsgLength(const atf_amc::Varlen2mMsg& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:atf_amc.Varlen2mMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const atf_amc::Varlen2mMsg& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:atf_amc.Varlen2mMsg..Init +inline void Varlen2mMsg_Init(atf_amc::Varlen2mMsg& parent); +// print string representation of ROW to string STR +// cfmt:atf_amc.Varlen2mMsg.String printfmt:Tuple +// func:atf_amc.Varlen2mMsg..Print +void Varlen2mMsg_Print(atf_amc::Varlen2mMsg& row, algo::cstring& str) __attribute__((nothrow)); + +// --- atf_amc.VarlenK +// create: atf_amc.Varlen2vMsg.v1 (Varlen) +// create: atf_amc.Varlen2vMsg.v2 (Varlen) +// create: atf_amc.Varlen2vMsg.v3 (Varlen) +// create: atf_amc.VarlenMsg.k (Varlen) +// access: atf_amc.VarlenK_curs.msg (Ptr) +#pragma pack(push,1) +struct VarlenK { // atf_amc.VarlenK: An optional instance of atf_unit.A + u32 length; // 0 + // var-length field atf_amc.VarlenK.i starts here. access it with i_Addr + // func:atf_amc.VarlenK..Ctor + inline VarlenK() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.VarlenK.i.Getary +algo::aryptr i_Getary(atf_amc::VarlenK& v1) __attribute__((nothrow)); +// func:atf_amc.VarlenK.i.Addr +u32* i_Addr(atf_amc::VarlenK& v1); +// Return number of elements in varlen field +// func:atf_amc.VarlenK.i.N +inline u32 i_N(const atf_amc::VarlenK& v1) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.VarlenK.i.ReadStrptrMaybe +bool i_ReadStrptrMaybe(atf_amc::VarlenK& v1, algo::strptr in_str) __attribute__((nothrow)); + +// func:atf_amc.VarlenK.i_curs.Reset +inline void v1_i_curs_Reset(v1_i_curs &curs, atf_amc::VarlenK &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.VarlenK.i_curs.ValidQ +inline bool v1_i_curs_ValidQ(v1_i_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.VarlenK.i_curs.Next +inline void v1_i_curs_Next(v1_i_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.VarlenK.i_curs.Access +inline u32& v1_i_curs_Access(v1_i_curs &curs) __attribute__((nothrow)); +// func:atf_amc.VarlenK..ReadFieldMaybe +bool VarlenK_ReadFieldMaybe(atf_amc::VarlenK& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::VarlenK from an ascii string. +// The format of the string is an ssim Tuple +// func:atf_amc.VarlenK..ReadStrptrMaybe +bool VarlenK_ReadStrptrMaybe(atf_amc::VarlenK &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:atf_amc.VarlenK..GetMsgLength +inline i32 GetMsgLength(const atf_amc::VarlenK& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:atf_amc.VarlenK..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const atf_amc::VarlenK& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:atf_amc.VarlenK..Init +inline void VarlenK_Init(atf_amc::VarlenK& v1); +// print string representation of ROW to string STR +// cfmt:atf_amc.VarlenK.String printfmt:Tuple +// func:atf_amc.VarlenK..Print +void VarlenK_Print(atf_amc::VarlenK& row, algo::cstring& str) __attribute__((nothrow)); + +// --- atf_amc.Varlen2vMsg +#pragma pack(push,1) +struct Varlen2vMsg { // atf_amc.Varlen2vMsg + atf_amc::MsgType type; // 0x1003 Message type + atf_amc::MsgLength length; // ssizeof(parent) + (0) Total message length, including this header + atf_amc::MsgLength v1_end; // end of v1 field + // var-length field atf_amc.Varlen2vMsg.v1 starts here. access it with v1_Addr + atf_amc::MsgLength v2_end; // end of v2 field + // var-length field atf_amc.Varlen2vMsg.v2 starts here. access it with v2_Addr + // var-length field atf_amc.Varlen2vMsg.v3 starts here. access it with v3_Addr + // func:atf_amc.Varlen2vMsg..Ctor + inline Varlen2vMsg() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:atf_amc.Varlen2vMsg.base.CopyOut +void parent_CopyOut(atf_amc::Varlen2vMsg &row, atf_amc::MsgHeader &out) __attribute__((nothrow)); +// Check if atf_amc::MsgHeader is an instance of Varlen2vMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Varlen2vMsg. +// If not successful, quietly return NULL. +// func:atf_amc.Varlen2vMsg.base.Castdown +inline atf_amc::Varlen2vMsg* Varlen2vMsg_Castdown(atf_amc::MsgHeader &hdr); +// func:atf_amc.Varlen2vMsg.base.Castbase +inline atf_amc::MsgHeader& Castbase(atf_amc::Varlen2vMsg& parent); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2vMsg.v1.Getary +algo::aryptr v1_Getary(atf_amc::Varlen2vMsg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2vMsg.v1.Addr +u8* v1_Addr(atf_amc::Varlen2vMsg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2vMsg.v1.N +inline u32 v1_N(const atf_amc::Varlen2vMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2vMsg.v1.ReadStrptrMaybe +bool v1_ReadStrptrMaybe(atf_amc::Varlen2vMsg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:atf_amc.Varlen2vMsg.v1.XrefMaybe +bool v1_XrefMaybe(atf_amc::VarlenK &row); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2vMsg.v2.Getary +algo::aryptr v2_Getary(atf_amc::Varlen2vMsg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2vMsg.v2.Addr +u8* v2_Addr(atf_amc::Varlen2vMsg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2vMsg.v2.N +inline u32 v2_N(const atf_amc::Varlen2vMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2vMsg.v2.ReadStrptrMaybe +bool v2_ReadStrptrMaybe(atf_amc::Varlen2vMsg& parent, algo::strptr in_str) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:atf_amc.Varlen2vMsg.v3.Getary +algo::aryptr v3_Getary(atf_amc::Varlen2vMsg& parent) __attribute__((nothrow)); +// func:atf_amc.Varlen2vMsg.v3.Addr +u8* v3_Addr(atf_amc::Varlen2vMsg& parent); +// Return number of elements in varlen field +// func:atf_amc.Varlen2vMsg.v3.N +inline u32 v3_N(const atf_amc::Varlen2vMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:atf_amc.Varlen2vMsg.v3.ReadStrptrMaybe +bool v3_ReadStrptrMaybe(atf_amc::Varlen2vMsg& parent, algo::strptr in_str) __attribute__((nothrow)); + +// func:atf_amc.Varlen2vMsg.v1_curs.Reset +inline void Varlen2vMsg_v1_curs_Reset(Varlen2vMsg_v1_curs &curs, atf_amc::Varlen2vMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2vMsg.v1_curs.ValidQ +inline bool Varlen2vMsg_v1_curs_ValidQ(Varlen2vMsg_v1_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2vMsg.v1_curs.Next +inline void Varlen2vMsg_v1_curs_Next(Varlen2vMsg_v1_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2vMsg.v1_curs.Access +inline atf_amc::VarlenK& Varlen2vMsg_v1_curs_Access(Varlen2vMsg_v1_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2vMsg.v2_curs.Reset +inline void Varlen2vMsg_v2_curs_Reset(Varlen2vMsg_v2_curs &curs, atf_amc::Varlen2vMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2vMsg.v2_curs.ValidQ +inline bool Varlen2vMsg_v2_curs_ValidQ(Varlen2vMsg_v2_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2vMsg.v2_curs.Next +inline void Varlen2vMsg_v2_curs_Next(Varlen2vMsg_v2_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2vMsg.v2_curs.Access +inline atf_amc::VarlenK& Varlen2vMsg_v2_curs_Access(Varlen2vMsg_v2_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2vMsg.v3_curs.Reset +inline void Varlen2vMsg_v3_curs_Reset(Varlen2vMsg_v3_curs &curs, atf_amc::Varlen2vMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_amc.Varlen2vMsg.v3_curs.ValidQ +inline bool Varlen2vMsg_v3_curs_ValidQ(Varlen2vMsg_v3_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_amc.Varlen2vMsg.v3_curs.Next +inline void Varlen2vMsg_v3_curs_Next(Varlen2vMsg_v3_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_amc.Varlen2vMsg.v3_curs.Access +inline atf_amc::VarlenK& Varlen2vMsg_v3_curs_Access(Varlen2vMsg_v3_curs &curs) __attribute__((nothrow)); +// func:atf_amc.Varlen2vMsg..ReadFieldMaybe +bool Varlen2vMsg_ReadFieldMaybe(atf_amc::Varlen2vMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of atf_amc::Varlen2vMsg from an ascii string. +// The format of the string is an ssim Tuple +// func:atf_amc.Varlen2vMsg..ReadStrptrMaybe +bool Varlen2vMsg_ReadStrptrMaybe(atf_amc::Varlen2vMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:atf_amc.Varlen2vMsg..GetMsgLength +inline i32 GetMsgLength(const atf_amc::Varlen2vMsg& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:atf_amc.Varlen2vMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const atf_amc::Varlen2vMsg& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:atf_amc.Varlen2vMsg..Init +inline void Varlen2vMsg_Init(atf_amc::Varlen2vMsg& parent); +// print string representation of ROW to string STR +// cfmt:atf_amc.Varlen2vMsg.String printfmt:Tuple +// func:atf_amc.Varlen2vMsg..Print +void Varlen2vMsg_Print(atf_amc::Varlen2vMsg& row, algo::cstring& str) __attribute__((nothrow)); + // --- atf_amc.VarlenAlloc // create: atf_amc.FDb.varlenalloc (Lpool) // access: atf_amc.VarlenAlloc_curs.msg (Ptr) @@ -10045,62 +11275,6 @@ inline void VarlenH_curs_Next(atf_amc::VarlenH_curs& curs) __attribute_ // func:atf_amc.VarlenH_curs..Init inline void VarlenH_curs_Init(atf_amc::VarlenH_curs& parent); -// --- atf_amc.VarlenK -// create: atf_amc.VarlenMsg.k (Varlen) -// access: atf_amc.VarlenK_curs.msg (Ptr) -#pragma pack(push,1) -struct VarlenK { // atf_amc.VarlenK: An optional instance of atf_unit.A - u32 length; // 0 - // var-length field atf_amc.VarlenK.i starts here. access it with i_Addr - // func:atf_amc.VarlenK..Ctor - inline VarlenK() __attribute__((nothrow)); -}; -#pragma pack(pop) - -// Access var-length portion as an aryptr. Length is determined from one of the fields. -// func:atf_amc.VarlenK.i.Getary -algo::aryptr i_Getary(atf_amc::VarlenK& k) __attribute__((nothrow)); -// func:atf_amc.VarlenK.i.Addr -u32* i_Addr(atf_amc::VarlenK& k); -// Return number of elements in varlen field -// func:atf_amc.VarlenK.i.N -inline u32 i_N(const atf_amc::VarlenK& k) __attribute__((__warn_unused_result__, nothrow, pure)); -// Convert string to field. Return success value -// func:atf_amc.VarlenK.i.ReadStrptrMaybe -bool i_ReadStrptrMaybe(atf_amc::VarlenK& k, algo::strptr in_str) __attribute__((nothrow)); - -// func:atf_amc.VarlenK.i_curs.Reset -inline void k_i_curs_Reset(k_i_curs &curs, atf_amc::VarlenK &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:atf_amc.VarlenK.i_curs.ValidQ -inline bool k_i_curs_ValidQ(k_i_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:atf_amc.VarlenK.i_curs.Next -inline void k_i_curs_Next(k_i_curs &curs) __attribute__((nothrow)); -// item access -// func:atf_amc.VarlenK.i_curs.Access -inline u32& k_i_curs_Access(k_i_curs &curs) __attribute__((nothrow)); -// func:atf_amc.VarlenK..ReadFieldMaybe -bool VarlenK_ReadFieldMaybe(atf_amc::VarlenK& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Any varlen fields are returned in algo_lib::_db.varlenbuf if set -// Read fields of atf_amc::VarlenK from an ascii string. -// The format of the string is an ssim Tuple -// func:atf_amc.VarlenK..ReadStrptrMaybe -bool VarlenK_ReadStrptrMaybe(atf_amc::VarlenK &parent, algo::strptr in_str) __attribute__((nothrow)); -// Message length (uses length field) -// func:atf_amc.VarlenK..GetMsgLength -inline i32 GetMsgLength(const atf_amc::VarlenK& parent) __attribute__((nothrow)); -// Memptr encompassing the message (uses length field) -// func:atf_amc.VarlenK..GetMsgMemptr -inline algo::memptr GetMsgMemptr(const atf_amc::VarlenK& row) __attribute__((nothrow)); -// Set all fields to initial values. -// func:atf_amc.VarlenK..Init -inline void VarlenK_Init(atf_amc::VarlenK& k); -// print string representation of ROW to string STR -// cfmt:atf_amc.VarlenK.String printfmt:Tuple -// func:atf_amc.VarlenK..Print -void VarlenK_Print(atf_amc::VarlenK& row, algo::cstring& str) __attribute__((nothrow)); - // --- atf_amc.VarlenK_curs #pragma pack(push,1) struct VarlenK_curs { // atf_amc.VarlenK_curs: Cursor for scanning messages in a memptr @@ -10160,10 +11334,6 @@ inline u32 k_N(const atf_amc::VarlenMsg& parent) __attribute__((__warn // Convert string to field. Return success value // func:atf_amc.VarlenMsg.k.ReadStrptrMaybe bool k_ReadStrptrMaybe(atf_amc::VarlenMsg& parent, algo::strptr in_str) __attribute__((nothrow)); -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:atf_amc.VarlenMsg.k.XrefMaybe -bool k_XrefMaybe(atf_amc::VarlenK &row); // func:atf_amc.VarlenMsg.k_curs.Reset inline void VarlenMsg_k_curs_Reset(VarlenMsg_k_curs &curs, atf_amc::VarlenMsg &parent) __attribute__((nothrow)); @@ -10234,15 +11404,6 @@ struct Bitset_fld64_bitcurs {// cursor }; -struct DispFilter_pmask_bitcurs {// cursor - typedef int& ChildType; - u64* elems; - int n_elems; - int bit; - DispFilter_pmask_bitcurs() : elems(0), n_elems(0), bit(0) {} -}; - - struct DispFilter_pmask_curs {// cursor typedef u64 ChildType; int index; @@ -10524,6 +11685,24 @@ struct _db_c_typek_oncecurs {// fcurs:atf_amc.FDb.c_typek/oncecurs }; +struct _db_c_typel_curs {// fcurs:atf_amc.FDb.c_typel/curs + typedef atf_amc::FTypeL ChildType; + atf_amc::FTypeL** elems; + u32 n_elems; + u32 index; + _db_c_typel_curs() { elems=NULL; n_elems=0; index=0; } +}; + + +struct _db_c_typem_curs {// fcurs:atf_amc.FDb.c_typem/curs + typedef atf_amc::FTypeM ChildType; + atf_amc::FTypeM** elems; + u32 n_elems; + u32 index; + _db_c_typem_curs() { elems=NULL; n_elems=0; index=0; } +}; + + struct _db_avl_curs {// cursor typedef atf_amc::FAvl ChildType; atf_amc::FDb *parent; @@ -10556,6 +11735,27 @@ struct _db_thash_elem_curs {// cursor _db_thash_elem_curs(){ parent=NULL; index=0; } }; +// Non-destructive heap cursor, returns heap elements in sorted order. +// A running front of potential smallest entries is kept in the helper heap (curs.temp_%) +struct _db_bh_time_entry_curs { + typedef atf_amc::FTimeEntry ChildType; + atf_amc::FDb *parent; // parent + atf_amc::FTimeEntry* *temp_elems; // helper heap + int temp_n; // number of elements heaped in the helper heap + int temp_max; // max number of elements possible in the helper heap + _db_bh_time_entry_curs() : parent(NULL), temp_elems(NULL), temp_n(0), temp_max(0) {} + ~_db_bh_time_entry_curs(); +}; + + +struct _db_ind_linear_curs {// cursor + typedef atf_amc::FHashableLinear ChildType; + atf_amc::FDb *parent; + int bucket; + atf_amc::FHashableLinear **prow; + _db_ind_linear_curs() { parent=NULL; bucket=0; prow=NULL; } +}; + struct FPerfSortString_orig_curs {// cursor typedef atf_amc::Cstr ChildType; @@ -10672,83 +11872,155 @@ struct MsgLTV_v_curs {// cursor }; -struct PmaskMultiple_present_bitcurs {// cursor - typedef int& ChildType; - u32* elems; - int n_elems; - int bit; - PmaskMultiple_present_bitcurs() : elems(0), n_elems(0), bit(0) {} +struct PmaskU555_pmask_curs {// cursor + typedef u64 ChildType; + int index; + atf_amc::PmaskU555 *parent; + PmaskU555_pmask_curs() { parent=NULL; index=0; } }; -struct PmaskMultiple_assigned_bitcurs {// cursor - typedef int& ChildType; +struct TaryU32_tary_u32_curs {// cursor + typedef u32 ChildType; u32* elems; int n_elems; - int bit; - PmaskMultiple_assigned_bitcurs() : elems(0), n_elems(0), bit(0) {} + int index; + TaryU32_tary_u32_curs() { elems=NULL; n_elems=0; index=0; } }; -struct PmaskMultiple_nullable_bitcurs {// cursor - typedef int& ChildType; - u32* elems; +struct TaryU8_ary_curs {// cursor + typedef u8 ChildType; + u8* elems; int n_elems; - int bit; - PmaskMultiple_nullable_bitcurs() : elems(0), n_elems(0), bit(0) {} + int index; + TaryU8_ary_curs() { elems=NULL; n_elems=0; index=0; } }; -struct PmaskU32_pmask_bitcurs {// cursor - typedef int& ChildType; - u32* elems; - int n_elems; - int bit; - PmaskU32_pmask_bitcurs() : elems(0), n_elems(0), bit(0) {} +struct Text_text_curs {// cursor + typedef char ChildType; + u8 *ptr; + int length; + int index; + Text_text_curs() { ptr=NULL; length=0; index=0; } }; -struct PmaskU555_pmask_bitcurs {// cursor - typedef int& ChildType; - u64* elems; - int n_elems; - int bit; - PmaskU555_pmask_bitcurs() : elems(0), n_elems(0), bit(0) {} +struct Varlen2Msg_s1_curs {// cursor + typedef char ChildType; + u8 *ptr; + int length; + int index; + Varlen2Msg_s1_curs() { ptr=NULL; length=0; index=0; } }; -struct PmaskU555_pmask_curs {// cursor - typedef u64 ChildType; +struct Varlen2Msg_s2_curs {// cursor + typedef char ChildType; + u8 *ptr; + int length; int index; - atf_amc::PmaskU555 *parent; - PmaskU555_pmask_curs() { parent=NULL; index=0; } + Varlen2Msg_s2_curs() { ptr=NULL; length=0; index=0; } }; -struct TaryU32_tary_u32_curs {// cursor +struct Varlen2Msg_s3_curs {// cursor + typedef char ChildType; + u8 *ptr; + int length; + int index; + Varlen2Msg_s3_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct Varlen2aMsg_u1_curs {// cursor typedef u32 ChildType; - u32* elems; - int n_elems; + u8 *ptr; + int length; int index; - TaryU32_tary_u32_curs() { elems=NULL; n_elems=0; index=0; } + Varlen2aMsg_u1_curs() { ptr=NULL; length=0; index=0; } }; -struct TaryU8_ary_curs {// cursor - typedef u8 ChildType; - u8* elems; - int n_elems; +struct Varlen2aMsg_u2_curs {// cursor + typedef u32 ChildType; + u8 *ptr; + int length; int index; - TaryU8_ary_curs() { elems=NULL; n_elems=0; index=0; } + Varlen2aMsg_u2_curs() { ptr=NULL; length=0; index=0; } }; -struct Text_text_curs {// cursor - typedef char ChildType; +struct Varlen2aMsg_u3_curs {// cursor + typedef u32 ChildType; u8 *ptr; int length; int index; - Text_text_curs() { ptr=NULL; length=0; index=0; } + Varlen2aMsg_u3_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct Varlen2mMsg_m1_curs {// cursor + typedef atf_amc::MsgHeader ChildType; + u8 *ptr; + int length; + int index; + Varlen2mMsg_m1_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct Varlen2mMsg_m2_curs {// cursor + typedef atf_amc::MsgHeader ChildType; + u8 *ptr; + int length; + int index; + Varlen2mMsg_m2_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct Varlen2mMsg_m3_curs {// cursor + typedef atf_amc::MsgHeader ChildType; + u8 *ptr; + int length; + int index; + Varlen2mMsg_m3_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct v1_i_curs {// cursor + typedef u32 ChildType; + u8 *ptr; + int length; + int index; + v1_i_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct Varlen2vMsg_v1_curs {// cursor + typedef atf_amc::VarlenK ChildType; + u8 *ptr; + int length; + int index; + Varlen2vMsg_v1_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct Varlen2vMsg_v2_curs {// cursor + typedef atf_amc::VarlenK ChildType; + u8 *ptr; + int length; + int index; + Varlen2vMsg_v2_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct Varlen2vMsg_v3_curs {// cursor + typedef atf_amc::VarlenK ChildType; + u8 *ptr; + int length; + int index; + Varlen2vMsg_v3_curs() { ptr=NULL; length=0; index=0; } }; @@ -10779,15 +12051,6 @@ struct VarlenH_typeh_curs {// cursor }; -struct k_i_curs {// cursor - typedef u32 ChildType; - u8 *ptr; - int length; - int index; - k_i_curs() { ptr=NULL; length=0; index=0; } -}; - - struct VarlenMsg_k_curs {// cursor typedef atf_amc::VarlenK ChildType; u8 *ptr; @@ -11250,10 +12513,18 @@ void amctest_PrintRawGconst(); // this function is 'extrn' and implemented by user void amctest_PtraryCursor(); // User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_PtraryHeaplike +// this function is 'extrn' and implemented by user +void amctest_PtraryHeaplike(); +// User-implemented function from gstatic:atf_amc.FDb.amctest // func:atf_amc...amctest_PtraryInsert // this function is 'extrn' and implemented by user void amctest_PtraryInsert(); // User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_PtraryNonUnique +// this function is 'extrn' and implemented by user +void amctest_PtraryNonUnique(); +// User-implemented function from gstatic:atf_amc.FDb.amctest // func:atf_amc...amctest_ReadProc // this function is 'extrn' and implemented by user void amctest_ReadProc(); @@ -11294,6 +12565,14 @@ void amctest_SetGetnumBase10(); // this function is 'extrn' and implemented by user void amctest_SubstrDfltval(); // User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_TaryAllocNAt +// this function is 'extrn' and implemented by user +void amctest_TaryAllocNAt(); +// User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_TaryHash +// this function is 'extrn' and implemented by user +void amctest_TaryHash(); +// User-implemented function from gstatic:atf_amc.FDb.amctest // func:atf_amc...amctest_TaryInit // this function is 'extrn' and implemented by user void amctest_TaryInit(); @@ -11310,6 +12589,10 @@ void amctest_TaryInit3(); // this function is 'extrn' and implemented by user void amctest_TaryInit4(); // User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_TaryInsary +// this function is 'extrn' and implemented by user +void amctest_TaryInsary(); +// User-implemented function from gstatic:atf_amc.FDb.amctest // func:atf_amc...amctest_TaryReserve // this function is 'extrn' and implemented by user void amctest_TaryReserve(); @@ -11418,10 +12701,18 @@ void amctest_ThashGetOrCreate(); // this function is 'extrn' and implemented by user void amctest_ThashInsertMaybe(); // User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_ThashLinear +// this function is 'extrn' and implemented by user +void amctest_ThashLinear(); +// User-implemented function from gstatic:atf_amc.FDb.amctest // func:atf_amc...amctest_ThashRemove // this function is 'extrn' and implemented by user void amctest_ThashRemove(); // User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_ThashStrkey +// this function is 'extrn' and implemented by user +void amctest_ThashStrkey(); +// User-implemented function from gstatic:atf_amc.FDb.amctest // func:atf_amc...amctest_ThashXref // this function is 'extrn' and implemented by user void amctest_ThashXref(); @@ -11430,6 +12721,22 @@ void amctest_ThashXref(); // this function is 'extrn' and implemented by user void amctest_Typetag(); // User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_Varlen2 +// this function is 'extrn' and implemented by user +void amctest_Varlen2(); +// User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_Varlen2a +// this function is 'extrn' and implemented by user +void amctest_Varlen2a(); +// User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_Varlen2m +// this function is 'extrn' and implemented by user +void amctest_Varlen2m(); +// User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_Varlen2v +// this function is 'extrn' and implemented by user +void amctest_Varlen2v(); +// User-implemented function from gstatic:atf_amc.FDb.amctest // func:atf_amc...amctest_VarlenAlloc // this function is 'extrn' and implemented by user void amctest_VarlenAlloc(); @@ -11622,6 +12929,10 @@ void amctest_fstep_InlineOnce(); // this function is 'extrn' and implemented by user void amctest_fstep_InlineRecur(); // User-implemented function from gstatic:atf_amc.FDb.amctest +// func:atf_amc...amctest_fstep_TimeHookOnce +// this function is 'extrn' and implemented by user +void amctest_fstep_TimeHookOnce(); +// User-implemented function from gstatic:atf_amc.FDb.amctest // func:atf_amc...amctest_fstep_TimeHookRecur // this function is 'extrn' and implemented by user void amctest_fstep_TimeHookRecur(); @@ -11803,6 +13114,22 @@ atf_amc::OptOptG * OptOptG_FmtMemptr(algo::memptr &buf, atf_amc::OptG* optg); // If BUF doesn't have enough space available, throw exception. // func:atf_amc...Text_FmtByteAry atf_amc::Text * Text_FmtByteAry(algo::ByteAry &buf, algo::aryptr text); +// Construct a new atf_amc::Varlen2Msg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:atf_amc...Varlen2Msg_FmtByteAry +atf_amc::Varlen2Msg * Varlen2Msg_FmtByteAry(algo::ByteAry &buf, algo::aryptr s1, algo::aryptr s2, algo::aryptr s3); +// Construct a new atf_amc::Varlen2aMsg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:atf_amc...Varlen2aMsg_FmtByteAry +atf_amc::Varlen2aMsg * Varlen2aMsg_FmtByteAry(algo::ByteAry &buf, algo::aryptr u1, algo::aryptr u2, algo::aryptr u3); +// Construct a new atf_amc::Varlen2mMsg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:atf_amc...Varlen2mMsg_FmtByteAry +atf_amc::Varlen2mMsg * Varlen2mMsg_FmtByteAry(algo::ByteAry &buf, algo::memptr m1, algo::memptr m2, algo::memptr m3); +// Construct a new atf_amc::Varlen2vMsg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:atf_amc...Varlen2vMsg_FmtByteAry +atf_amc::Varlen2vMsg * Varlen2vMsg_FmtByteAry(algo::ByteAry &buf, algo::memptr v1, algo::memptr v2, algo::memptr v3); // Construct a new atf_amc::VarlenK in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. // func:atf_amc...VarlenK_FmtByteAry @@ -11849,5 +13176,9 @@ inline algo::cstring &operator <<(algo::cstring &str, const atf_amc::TestRegx1 & inline algo::cstring &operator <<(algo::cstring &str, const atf_amc::TypeBE32en &row);// cfmt:atf_amc.TypeBE32en.String inline algo::cstring &operator <<(algo::cstring &str, const atf_amc::TypeBE64 &row);// cfmt:atf_amc.TypeBE64.String inline algo::cstring &operator <<(algo::cstring &str, const atf_amc::Typefconst &row);// cfmt:atf_amc.Typefconst.String +inline algo::cstring &operator <<(algo::cstring &str, const atf_amc::Varlen2Msg &row);// cfmt:atf_amc.Varlen2Msg.String +inline algo::cstring &operator <<(algo::cstring &str, const atf_amc::Varlen2aMsg &row);// cfmt:atf_amc.Varlen2aMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const atf_amc::Varlen2mMsg &row);// cfmt:atf_amc.Varlen2mMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const atf_amc::Varlen2vMsg &row);// cfmt:atf_amc.Varlen2vMsg.String inline algo::cstring &operator <<(algo::cstring &str, const atf_amc::VarlenMsg &row);// cfmt:atf_amc.VarlenMsg.String } diff --git a/include/gen/atf_amc_gen.inl.h b/include/gen/atf_amc_gen.inl.h index 8c9dbd9d..ef7d6467 100644 --- a/include/gen/atf_amc_gen.inl.h +++ b/include/gen/atf_amc_gen.inl.h @@ -1052,8 +1052,7 @@ inline atf_amc::Bitset::Bitset() { // --- atf_amc.Bytebuf.in.Max // Return max. number of bytes in the buffer. inline i32 atf_amc::in_Max(atf_amc::Bytebuf& bytebuf) { - return 64; - (void)bytebuf;//only to avoid -Wunused-parameter + return bytebuf.in_max; } // --- atf_amc.Bytebuf.in.N @@ -1069,6 +1068,11 @@ inline atf_amc::Bytebuf::Bytebuf() { // coverity[uninit_member] } +// --- atf_amc.Bytebuf..Dtor +inline atf_amc::Bytebuf::~Bytebuf() { + atf_amc::Bytebuf_Uninit(*this); +} + // --- atf_amc.BytebufDyn.in.Max // Return max. number of bytes in the buffer. inline i32 atf_amc::in_Max(atf_amc::BytebufDyn& bytebuf_dyn) { @@ -1901,26 +1905,6 @@ inline void atf_amc::intval_Set(atf_amc::DispFilter& parent, u32 rhs) { pmask_qSetBit(parent, 9); // mark presence in pmask } -// --- atf_amc.DispFilter.pmask_bitcurs.Reset -inline void atf_amc::DispFilter_pmask_bitcurs_Reset(DispFilter_pmask_bitcurs &curs, atf_amc::DispFilter &parent) { - curs.elems = &pmask_qFind(parent,0); - curs.n_elems = pmask_N(parent); - curs.bit = -1; - DispFilter_pmask_bitcurs_Next(curs); -} - -// --- atf_amc.DispFilter.pmask_bitcurs.ValidQ -// cursor points to valid item -inline bool atf_amc::DispFilter_pmask_bitcurs_ValidQ(DispFilter_pmask_bitcurs &curs) { - return curs.bit < curs.n_elems*64; -} - -// --- atf_amc.DispFilter.pmask_bitcurs.Access -// item access -inline int& atf_amc::DispFilter_pmask_bitcurs_Access(DispFilter_pmask_bitcurs &curs) { - return curs.bit; -} - // --- atf_amc.DispFilter.pmask_curs.Reset // cursor points to valid item inline void atf_amc::DispFilter_pmask_curs_Reset(DispFilter_pmask_curs &curs, atf_amc::DispFilter &parent) { @@ -2141,7 +2125,7 @@ inline atf_amc::FCascdel* atf_amc::bh_child_bheap_First(atf_amc::FCascdel& cascd // Return true if row is in index, false otherwise inline bool atf_amc::bh_child_bheap_InBheapQ(atf_amc::FCascdel& row) { bool result = false; - result = row.bh_child_bheap_idx != -1; + result = row.cascdel_bh_child_bheap_idx != -1; return result; } @@ -2167,9 +2151,9 @@ inline atf_amc::FCascdel* atf_amc::zd_childlist_First(atf_amc::FCascdel& cascdel // --- atf_amc.FCascdel.zd_childlist.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool atf_amc::zd_childlist_InLlistQ(atf_amc::FCascdel& row) { +inline bool atf_amc::cascdel_zd_childlist_InLlistQ(atf_amc::FCascdel& row) { bool result = false; - result = !(row.zd_childlist_next == (atf_amc::FCascdel*)-1); + result = !(row.cascdel_zd_childlist_next == (atf_amc::FCascdel*)-1); return result; } @@ -2189,14 +2173,14 @@ inline i32 atf_amc::zd_childlist_N(const atf_amc::FCascdel& cascdel) { // --- atf_amc.FCascdel.zd_childlist.Next // Return pointer to next element in the list -inline atf_amc::FCascdel* atf_amc::zd_childlist_Next(atf_amc::FCascdel &row) { - return row.zd_childlist_next; +inline atf_amc::FCascdel* atf_amc::cascdel_zd_childlist_Next(atf_amc::FCascdel &row) { + return row.cascdel_zd_childlist_next; } // --- atf_amc.FCascdel.zd_childlist.Prev // Return pointer to previous element in the list -inline atf_amc::FCascdel* atf_amc::zd_childlist_Prev(atf_amc::FCascdel &row) { - return row.zd_childlist_prev; +inline atf_amc::FCascdel* atf_amc::cascdel_zd_childlist_Prev(atf_amc::FCascdel &row) { + return row.cascdel_zd_childlist_prev; } // --- atf_amc.FCascdel.zd_childlist.qLast @@ -2216,7 +2200,7 @@ inline bool atf_amc::tr_child_atree_EmptyQ(atf_amc::FCascdel& cascdel) { // --- atf_amc.FCascdel.tr_child_atree.InTreeQ // Return true if row is in the tree, false otherwise inline bool atf_amc::tr_child_atree_InTreeQ(atf_amc::FCascdel& row) { - return row.tr_child_atree_up != (atf_amc::FCascdel*)-1; + return row.cascdel_tr_child_atree_up != (atf_amc::FCascdel*)-1; } // --- atf_amc.FCascdel.tr_child_atree.RemoveAll @@ -2279,7 +2263,7 @@ inline bool atf_amc::cascdel_zd_childlist_curs_ValidQ(cascdel_zd_childlist_curs // --- atf_amc.FCascdel.zd_childlist_curs.Next // proceed to next item inline void atf_amc::cascdel_zd_childlist_curs_Next(cascdel_zd_childlist_curs &curs) { - atf_amc::FCascdel *next = (*curs.row).zd_childlist_next; + atf_amc::FCascdel *next = (*curs.row).cascdel_zd_childlist_next; curs.row = next; } @@ -2327,6 +2311,7 @@ inline atf_amc::FCascdel::~FCascdel() { // Set all fields to initial values. inline void atf_amc::FCstring_Init(atf_amc::FCstring& cstring) { cstring.ind_cstring_next = (atf_amc::FCstring*)-1; // (atf_amc.FDb.ind_cstring) not-in-hash + cstring.ind_cstring_hashval = 0; // stored hash value } // --- atf_amc.FCstring..Ctor @@ -3451,7 +3436,7 @@ inline i32 atf_amc::c_typek_N() { inline void atf_amc::c_typek_RemoveAll() { for (u32 i = 0; i < _db.c_typek_n; i++) { // mark all elements as not-in-array - _db.c_typek_elems[i]->_db_c_typek_in_ary = false; + _db.c_typek_elems[i]->c_typek_in_ary = false; } _db.c_typek_n = 0; } @@ -3465,7 +3450,7 @@ inline atf_amc::FTypeK& atf_amc::c_typek_qFind(u32 idx) { // --- atf_amc.FDb.c_typek.InAryQ // True if row is in any ptrary instance inline bool atf_amc::c_typek_InAryQ(atf_amc::FTypeK& row) { - return row._db_c_typek_in_ary; + return row.c_typek_in_ary; } // --- atf_amc.FDb.c_typek.qLast @@ -3474,6 +3459,125 @@ inline atf_amc::FTypeK& atf_amc::c_typek_qLast() { return *_db.c_typek_elems[_db.c_typek_n-1]; } +// --- atf_amc.FDb.c_typel.EmptyQ +// Return true if index is empty +inline bool atf_amc::c_typel_EmptyQ() { + return _db.c_typel_n == 0; +} + +// --- atf_amc.FDb.c_typel.Find +// Look up row by row id. Return NULL if out of range +inline atf_amc::FTypeL* atf_amc::c_typel_Find(u32 t) { + atf_amc::FTypeL *retval = NULL; + u64 idx = t; + u64 lim = _db.c_typel_n; + if (idx < lim) { + retval = _db.c_typel_elems[idx]; + } + return retval; +} + +// --- atf_amc.FDb.c_typel.Getary +// Return array of pointers +inline algo::aryptr atf_amc::c_typel_Getary() { + return algo::aryptr(_db.c_typel_elems, _db.c_typel_n); +} + +// --- atf_amc.FDb.c_typel.First +inline atf_amc::FTypeL* atf_amc::c_typel_First() { + atf_amc::FTypeL *row = NULL; + row = _db.c_typel_n ? _db.c_typel_elems[0] : NULL; + return row; +} + +// --- atf_amc.FDb.c_typel.Last +inline atf_amc::FTypeL* atf_amc::c_typel_Last() { + atf_amc::FTypeL *row = NULL; + row = _db.c_typel_n ? _db.c_typel_elems[_db.c_typel_n-1] : NULL; + return row; +} + +// --- atf_amc.FDb.c_typel.N +// Return number of items in the pointer array +inline i32 atf_amc::c_typel_N() { + return _db.c_typel_n; +} + +// --- atf_amc.FDb.c_typel.RemoveAll +// Empty the index. (The rows are not deleted) +inline void atf_amc::c_typel_RemoveAll() { + for (u32 i = 0; i < _db.c_typel_n; i++) { + _db.c_typel_elems[i]->c_typel_idx = -1; + } + _db.c_typel_n = 0; +} + +// --- atf_amc.FDb.c_typel.qFind +// Return reference without bounds checking +inline atf_amc::FTypeL& atf_amc::c_typel_qFind(u32 idx) { + return *_db.c_typel_elems[idx]; +} + +// --- atf_amc.FDb.c_typel.InAryQ +// True if row is in any ptrary instance +inline bool atf_amc::c_typel_InAryQ(atf_amc::FTypeL& row) { + return row.c_typel_idx != -1; +} + +// --- atf_amc.FDb.c_typel.qLast +// Reference to last element without bounds checking +inline atf_amc::FTypeL& atf_amc::c_typel_qLast() { + return *_db.c_typel_elems[_db.c_typel_n-1]; +} + +// --- atf_amc.FDb.c_typem.EmptyQ +// Return true if index is empty +inline bool atf_amc::c_typem_EmptyQ() { + return _db.c_typem_n == 0; +} + +// --- atf_amc.FDb.c_typem.Find +// Look up row by row id. Return NULL if out of range +inline atf_amc::FTypeM* atf_amc::c_typem_Find(u32 t) { + atf_amc::FTypeM *retval = NULL; + u64 idx = t; + u64 lim = _db.c_typem_n; + if (idx < lim) { + retval = _db.c_typem_elems[idx]; + } + return retval; +} + +// --- atf_amc.FDb.c_typem.Getary +// Return array of pointers +inline algo::aryptr atf_amc::c_typem_Getary() { + return algo::aryptr(_db.c_typem_elems, _db.c_typem_n); +} + +// --- atf_amc.FDb.c_typem.N +// Return number of items in the pointer array +inline i32 atf_amc::c_typem_N() { + return _db.c_typem_n; +} + +// --- atf_amc.FDb.c_typem.RemoveAll +// Empty the index. (The rows are not deleted) +inline void atf_amc::c_typem_RemoveAll() { + _db.c_typem_n = 0; +} + +// --- atf_amc.FDb.c_typem.qFind +// Return reference without bounds checking +inline atf_amc::FTypeM& atf_amc::c_typem_qFind(u32 idx) { + return *_db.c_typem_elems[idx]; +} + +// --- atf_amc.FDb.c_typem.qLast +// Reference to last element without bounds checking +inline atf_amc::FTypeM& atf_amc::c_typem_qLast() { + return *_db.c_typem_elems[_db.c_typem_n-1]; +} + // --- atf_amc.FDb.avl.EmptyQ // Return true if index is empty inline bool atf_amc::avl_EmptyQ() { @@ -3645,6 +3749,72 @@ inline atf_amc::FThashElem& atf_amc::thash_elem_qFind(u64 t) { return _db.thash_elem_lary[bsr][index]; } +// --- atf_amc.FDb.ind_hashable.EmptyQ +// Return true if hash is empty +inline bool atf_amc::ind_hashable_EmptyQ() { + return _db.ind_hashable_n == 0; +} + +// --- atf_amc.FDb.ind_hashable.N +// Return number of items in the hash +inline i32 atf_amc::ind_hashable_N() { + return _db.ind_hashable_n; +} + +// --- atf_amc.FDb.bh_time_entry.EmptyQ +// Return true if index is empty +inline bool atf_amc::bh_time_entry_EmptyQ() { + return _db.bh_time_entry_n == 0; +} + +// --- atf_amc.FDb.bh_time_entry.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline atf_amc::FTimeEntry* atf_amc::bh_time_entry_First() { + atf_amc::FTimeEntry *row = NULL; + if (_db.bh_time_entry_n > 0) { + row = _db.bh_time_entry_elems[0]; + } + return row; +} + +// --- atf_amc.FDb.bh_time_entry.InBheapQ +// Return true if row is in index, false otherwise +inline bool atf_amc::bh_time_entry_InBheapQ(atf_amc::FTimeEntry& row) { + bool result = false; + result = row.bh_time_entry_idx != -1; + return result; +} + +// --- atf_amc.FDb.bh_time_entry.N +// Return number of items in the heap +inline i32 atf_amc::bh_time_entry_N() { + return _db.bh_time_entry_n; +} + +// --- atf_amc.FDb.ind_linear.EmptyQ +// Return true if hash is empty +inline bool atf_amc::ind_linear_EmptyQ() { + return _db.ind_linear_n == 0; +} + +// --- atf_amc.FDb.ind_linear.N +// Return number of items in the hash +inline i32 atf_amc::ind_linear_N() { + return _db.ind_linear_n; +} + +// --- atf_amc.FDb.ind_strkey.EmptyQ +// Return true if hash is empty +inline bool atf_amc::ind_strkey_EmptyQ() { + return _db.ind_strkey_n == 0; +} + +// --- atf_amc.FDb.ind_strkey.N +// Return number of items in the hash +inline i32 atf_amc::ind_strkey_N() { + return _db.ind_strkey_n; +} + // --- atf_amc.FDb.bh_typec_curs.Access // Access current element. If not more elements, return NULL inline atf_amc::FTypeC& atf_amc::_db_bh_typec_curs_Access(_db_bh_typec_curs &curs) { @@ -4273,7 +4443,7 @@ inline bool atf_amc::_db_c_typek_oncecurs_ValidQ(_db_c_typek_oncecurs &curs) { // --- atf_amc.FDb.c_typek_oncecurs.Next // proceed to next item inline void atf_amc::_db_c_typek_oncecurs_Next(_db_c_typek_oncecurs &curs) { - curs.elems[curs.index]->_db_c_typek_in_ary = false; + curs.elems[curs.index]->c_typek_in_ary = false; curs.index++; } @@ -4283,6 +4453,56 @@ inline atf_amc::FTypeK& atf_amc::_db_c_typek_oncecurs_Access(_db_c_typek_oncecur return *curs.elems[curs.index]; } +// --- atf_amc.FDb.c_typel_curs.Reset +inline void atf_amc::_db_c_typel_curs_Reset(_db_c_typel_curs &curs, atf_amc::FDb &parent) { + curs.elems = parent.c_typel_elems; + curs.n_elems = parent.c_typel_n; + curs.index = 0; +} + +// --- atf_amc.FDb.c_typel_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::_db_c_typel_curs_ValidQ(_db_c_typel_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- atf_amc.FDb.c_typel_curs.Next +// proceed to next item +inline void atf_amc::_db_c_typel_curs_Next(_db_c_typel_curs &curs) { + curs.index++; +} + +// --- atf_amc.FDb.c_typel_curs.Access +// item access +inline atf_amc::FTypeL& atf_amc::_db_c_typel_curs_Access(_db_c_typel_curs &curs) { + return *curs.elems[curs.index]; +} + +// --- atf_amc.FDb.c_typem_curs.Reset +inline void atf_amc::_db_c_typem_curs_Reset(_db_c_typem_curs &curs, atf_amc::FDb &parent) { + curs.elems = parent.c_typem_elems; + curs.n_elems = parent.c_typem_n; + curs.index = 0; +} + +// --- atf_amc.FDb.c_typem_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::_db_c_typem_curs_ValidQ(_db_c_typem_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- atf_amc.FDb.c_typem_curs.Next +// proceed to next item +inline void atf_amc::_db_c_typem_curs_Next(_db_c_typem_curs &curs) { + curs.index++; +} + +// --- atf_amc.FDb.c_typem_curs.Access +// item access +inline atf_amc::FTypeM& atf_amc::_db_c_typem_curs_Access(_db_c_typem_curs &curs) { + return *curs.elems[curs.index]; +} + // --- atf_amc.FDb.avl_curs.Reset // cursor points to valid item inline void atf_amc::_db_avl_curs_Reset(_db_avl_curs &curs, atf_amc::FDb &parent) { @@ -4382,6 +4602,59 @@ inline atf_amc::FThashElem& atf_amc::_db_thash_elem_curs_Access(_db_thash_elem_c return thash_elem_qFind(u64(curs.index)); } +// --- atf_amc.FDb.bh_time_entry_curs.Access +// Access current element. If not more elements, return NULL +inline atf_amc::FTimeEntry& atf_amc::_db_bh_time_entry_curs_Access(_db_bh_time_entry_curs &curs) { + return *curs.temp_elems[0]; +} + +// --- atf_amc.FDb.bh_time_entry_curs.ValidQ +// Return true if Access() will return non-NULL. +inline bool atf_amc::_db_bh_time_entry_curs_ValidQ(_db_bh_time_entry_curs &curs) { + return curs.temp_n > 0; +} + +// --- atf_amc.FDb.ind_linear_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::_db_ind_linear_curs_ValidQ(_db_ind_linear_curs &curs) { + return *curs.prow != NULL; +} + +// --- atf_amc.FDb.ind_linear_curs.Next +// proceed to next item +inline void atf_amc::_db_ind_linear_curs_Next(_db_ind_linear_curs &curs) { + curs.prow = &(*curs.prow)->ind_linear_next; + while (!*curs.prow) { + curs.bucket += 1; + if (curs.bucket >= curs.parent->ind_linear_buckets_n) break; + curs.prow = &curs.parent->ind_linear_buckets_elems[curs.bucket]; + } +} + +// --- atf_amc.FDb.ind_linear_curs.Access +// item access +inline atf_amc::FHashableLinear& atf_amc::_db_ind_linear_curs_Access(_db_ind_linear_curs &curs) { + return **curs.prow; +} + +// --- atf_amc.FHashableLinear..Init +// Set all fields to initial values. +inline void atf_amc::FHashableLinear_Init(atf_amc::FHashableLinear& hashable_linear) { + hashable_linear.ind_linear_next = (atf_amc::FHashableLinear*)-1; // (atf_amc.FDb.ind_linear) not-in-hash + hashable_linear.ind_linear_hashval = 0; // stored hash value + hashable_linear.hashable_linear_next = (atf_amc::FHashableLinear*)-1; // (atf_amc.FDb.hashable_linear) not-in-tpool's freelist +} + +// --- atf_amc.FHashableLinear..Ctor +inline atf_amc::FHashableLinear::FHashableLinear() { + atf_amc::FHashableLinear_Init(*this); +} + +// --- atf_amc.FHashableLinear..Dtor +inline atf_amc::FHashableLinear::~FHashableLinear() { + atf_amc::FHashableLinear_Uninit(*this); +} + // --- atf_amc.TypeG..Hash inline u32 atf_amc::TypeG_Hash(u32 prev, const atf_amc::TypeG& rhs) { prev = i32_Hash(prev, rhs.typeg); @@ -4705,6 +4978,7 @@ inline atf_amc::FPerfSortString::~FPerfSortString() { inline void atf_amc::FThashElem_Init(atf_amc::FThashElem& thash_elem) { thash_elem.key = u64(0); thash_elem.ind_thash_elem_next = (atf_amc::FThashElem*)-1; // (atf_amc.FDb.ind_thash_elem) not-in-hash + thash_elem.ind_thash_elem_hashval = 0; // stored hash value } // --- atf_amc.FThashElem..Ctor @@ -4717,6 +4991,37 @@ inline atf_amc::FThashElem::~FThashElem() { atf_amc::FThashElem_Uninit(*this); } +// --- atf_amc.FTimeEntry.time.Lt +// Compare two fields. Comparison is anti-symmetric: if a>b, then !(b>a). +inline bool atf_amc::time_Lt(atf_amc::FTimeEntry& time_entry, atf_amc::FTimeEntry &rhs) { + return algo::SchedTime_Lt(time_entry.time,rhs.time); +} + +// --- atf_amc.FTimeEntry.time.Cmp +// Compare two fields. +inline i32 atf_amc::time_Cmp(atf_amc::FTimeEntry& time_entry, atf_amc::FTimeEntry &rhs) { + i32 retval = 0; + retval = algo::SchedTime_Cmp(time_entry.time, rhs.time); + return retval; +} + +// --- atf_amc.FTimeEntry..Init +// Set all fields to initial values. +inline void atf_amc::FTimeEntry_Init(atf_amc::FTimeEntry& time_entry) { + time_entry.time_entry_next = (atf_amc::FTimeEntry*)-1; // (atf_amc.FDb.time_entry) not-in-tpool's freelist + time_entry.bh_time_entry_idx = -1; // (atf_amc.FDb.bh_time_entry) not-in-heap +} + +// --- atf_amc.FTimeEntry..Ctor +inline atf_amc::FTimeEntry::FTimeEntry() { + atf_amc::FTimeEntry_Init(*this); +} + +// --- atf_amc.FTimeEntry..Dtor +inline atf_amc::FTimeEntry::~FTimeEntry() { + atf_amc::FTimeEntry_Uninit(*this); +} + // --- atf_amc.FTypeC..Init // Set all fields to initial values. inline void atf_amc::FTypeC_Init(atf_amc::FTypeC& typec) { @@ -4823,9 +5128,9 @@ inline atf_amc::FTypeB* atf_amc::zdl_typeb_First(atf_amc::FTypeA& typea) { // --- atf_amc.FTypeA.zdl_typeb.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool atf_amc::zdl_typeb_InLlistQ(atf_amc::FTypeB& row) { +inline bool atf_amc::typea_zdl_typeb_InLlistQ(atf_amc::FTypeB& row) { bool result = false; - result = !(row.zdl_typeb_next == (atf_amc::FTypeB*)-1); + result = !(row.typea_zdl_typeb_next == (atf_amc::FTypeB*)-1); return result; } @@ -4845,14 +5150,14 @@ inline i32 atf_amc::zdl_typeb_N(const atf_amc::FTypeA& typea) { // --- atf_amc.FTypeA.zdl_typeb.Next // Return pointer to next element in the list -inline atf_amc::FTypeB* atf_amc::zdl_typeb_Next(atf_amc::FTypeB &row) { - return row.zdl_typeb_next; +inline atf_amc::FTypeB* atf_amc::typea_zdl_typeb_Next(atf_amc::FTypeB &row) { + return row.typea_zdl_typeb_next; } // --- atf_amc.FTypeA.zdl_typeb.Prev // Return pointer to previous element in the list -inline atf_amc::FTypeB* atf_amc::zdl_typeb_Prev(atf_amc::FTypeB &row) { - return row.zdl_typeb_prev; +inline atf_amc::FTypeB* atf_amc::typea_zdl_typeb_Prev(atf_amc::FTypeB &row) { + return row.typea_zdl_typeb_prev; } // --- atf_amc.FTypeA.zdl_typeb.qLast @@ -4883,7 +5188,7 @@ inline atf_amc::FTypeB* atf_amc::bh_typeb_First(atf_amc::FTypeA& typea) { // Return true if row is in index, false otherwise inline bool atf_amc::bh_typeb_InBheapQ(atf_amc::FTypeB& row) { bool result = false; - result = row.bh_typeb_idx != -1; + result = row.typea_bh_typeb_idx != -1; return result; } @@ -4933,7 +5238,7 @@ inline bool atf_amc::typea_zdl_typeb_curs_ValidQ(typea_zdl_typeb_curs &curs) { // --- atf_amc.FTypeA.zdl_typeb_curs.Next // proceed to next item inline void atf_amc::typea_zdl_typeb_curs_Next(typea_zdl_typeb_curs &curs) { - atf_amc::FTypeB *next = (*curs.row).zdl_typeb_next; + atf_amc::FTypeB *next = (*curs.row).typea_zdl_typeb_next; curs.row = next; } @@ -4973,9 +5278,9 @@ inline void atf_amc::FTypeB_Init(atf_amc::FTypeB& typeb) { typeb.typea = i32(0); typeb.j = i32(0); typeb.typeb_next = (atf_amc::FTypeB*)-1; // (atf_amc.FDb.typeb) not-in-tpool's freelist - typeb.zdl_typeb_next = (atf_amc::FTypeB*)-1; // (atf_amc.FTypeA.zdl_typeb) not-in-list - typeb.zdl_typeb_prev = NULL; // (atf_amc.FTypeA.zdl_typeb) - typeb.bh_typeb_idx = -1; // (atf_amc.FTypeA.bh_typeb) not-in-heap + typeb.typea_zdl_typeb_next = (atf_amc::FTypeB*)-1; // (atf_amc.FTypeA.zdl_typeb) not-in-list + typeb.typea_zdl_typeb_prev = NULL; // (atf_amc.FTypeA.zdl_typeb) + typeb.typea_bh_typeb_idx = -1; // (atf_amc.FTypeA.bh_typeb) not-in-heap } // --- atf_amc.FTypeB..Ctor @@ -5014,7 +5319,7 @@ inline atf_amc::FTypeD::~FTypeD() { // Set all fields to initial values. inline void atf_amc::FTypeK_Init(atf_amc::FTypeK& parent) { parent.value = u32(0); - parent._db_c_typek_in_ary = bool(false); + parent.c_typek_in_ary = bool(false); } // --- atf_amc.FTypeK..Ctor @@ -5022,6 +5327,29 @@ inline atf_amc::FTypeK::FTypeK() { atf_amc::FTypeK_Init(*this); } +// --- atf_amc.FTypeL..Init +// Set all fields to initial values. +inline void atf_amc::FTypeL_Init(atf_amc::FTypeL& parent) { + parent.value = u32(0); + parent.c_typel_idx = i32(-1); +} + +// --- atf_amc.FTypeL..Ctor +inline atf_amc::FTypeL::FTypeL() { + atf_amc::FTypeL_Init(*this); +} + +// --- atf_amc.FTypeM..Init +// Set all fields to initial values. +inline void atf_amc::FTypeM_Init(atf_amc::FTypeM& parent) { + parent.value = u32(0); +} + +// --- atf_amc.FTypeM..Ctor +inline atf_amc::FTypeM::FTypeM() { + atf_amc::FTypeM_Init(*this); +} + // --- atf_amc.FTypeS.zdl_typet.EmptyQ // Return true if index is empty inline bool atf_amc::zdl_typet_EmptyQ(atf_amc::FTypeS& types) { @@ -5038,9 +5366,9 @@ inline atf_amc::FTypeT* atf_amc::zdl_typet_First(atf_amc::FTypeS& types) { // --- atf_amc.FTypeS.zdl_typet.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool atf_amc::zdl_typet_InLlistQ(atf_amc::FTypeT& row) { +inline bool atf_amc::types_zdl_typet_InLlistQ(atf_amc::FTypeT& row) { bool result = false; - result = !(row.zdl_typet_next == (atf_amc::FTypeT*)-1); + result = !(row.types_zdl_typet_next == (atf_amc::FTypeT*)-1); return result; } @@ -5060,14 +5388,14 @@ inline i32 atf_amc::zdl_typet_N(const atf_amc::FTypeS& types) { // --- atf_amc.FTypeS.zdl_typet.Next // Return pointer to next element in the list -inline atf_amc::FTypeT* atf_amc::zdl_typet_Next(atf_amc::FTypeT &row) { - return row.zdl_typet_next; +inline atf_amc::FTypeT* atf_amc::types_zdl_typet_Next(atf_amc::FTypeT &row) { + return row.types_zdl_typet_next; } // --- atf_amc.FTypeS.zdl_typet.Prev // Return pointer to previous element in the list -inline atf_amc::FTypeT* atf_amc::zdl_typet_Prev(atf_amc::FTypeT &row) { - return row.zdl_typet_prev; +inline atf_amc::FTypeT* atf_amc::types_zdl_typet_Prev(atf_amc::FTypeT &row) { + return row.types_zdl_typet_prev; } // --- atf_amc.FTypeS.zdl_typet.qLast @@ -5086,6 +5414,7 @@ inline void atf_amc::FTypeS_Init(atf_amc::FTypeS& types) { types.zdl_typet_n = 0; // (atf_amc.FTypeS.zdl_typet) types.zdl_typet_tail = NULL; // (atf_amc.FTypeS.zdl_typet) types.ind_types_next = (atf_amc::FTypeS*)-1; // (atf_amc.FDb.ind_types) not-in-hash + types.ind_types_hashval = 0; // stored hash value } // --- atf_amc.FTypeS.zdl_typet_curs.Reset @@ -5103,7 +5432,7 @@ inline bool atf_amc::types_zdl_typet_curs_ValidQ(types_zdl_typet_curs &curs) { // --- atf_amc.FTypeS.zdl_typet_curs.Next // proceed to next item inline void atf_amc::types_zdl_typet_curs_Next(types_zdl_typet_curs &curs) { - atf_amc::FTypeT *next = (*curs.row).zdl_typet_next; + atf_amc::FTypeT *next = (*curs.row).types_zdl_typet_next; curs.row = next; } @@ -5128,8 +5457,8 @@ inline atf_amc::FTypeS::~FTypeS() { inline void atf_amc::FTypeT_Init(atf_amc::FTypeT& typet) { typet.types = i32(0); typet.j = i32(0); - typet.zdl_typet_next = (atf_amc::FTypeT*)-1; // (atf_amc.FTypeS.zdl_typet) not-in-list - typet.zdl_typet_prev = NULL; // (atf_amc.FTypeS.zdl_typet) + typet.types_zdl_typet_next = (atf_amc::FTypeT*)-1; // (atf_amc.FTypeS.zdl_typet) not-in-list + typet.types_zdl_typet_prev = NULL; // (atf_amc.FTypeS.zdl_typet) } // --- atf_amc.FTypeT..Ctor @@ -5518,6 +5847,25 @@ inline atf_amc::FieldId::FieldId(atf_amc_FieldIdEnum arg) { this->value = i32(arg); } +// --- atf_amc.Hashable..Init +// Set all fields to initial values. +inline void atf_amc::Hashable_Init(atf_amc::Hashable& hashable) { + hashable.hashable = i32(0); + hashable.hashable_next = (atf_amc::Hashable*)-1; // (atf_amc.FDb.hashable) not-in-tpool's freelist + hashable.ind_hashable_next = (atf_amc::Hashable*)-1; // (atf_amc.FDb.ind_hashable) not-in-hash + hashable.ind_hashable_hashval = 0; // stored hash value +} + +// --- atf_amc.Hashable..Ctor +inline atf_amc::Hashable::Hashable() { + atf_amc::Hashable_Init(*this); +} + +// --- atf_amc.Hashable..Dtor +inline atf_amc::Hashable::~Hashable() { + atf_amc::Hashable_Uninit(*this); +} + // --- atf_amc.Hooktype.callback.Call // Invoke function by pointer inline void atf_amc::callback_Call(atf_amc::Hooktype& parent, atf_amc::Hooktype& arg) { @@ -5831,8 +6179,7 @@ inline atf_amc::Lary32::~Lary32() { // --- atf_amc.Linebuf.in.Max // Return max. number of bytes in the buffer. inline i32 atf_amc::in_Max(atf_amc::Linebuf& linebuf) { - return 64; - (void)linebuf;//only to avoid -Wunused-parameter + return linebuf.in_max; } // --- atf_amc.Linebuf.in.N @@ -5848,6 +6195,11 @@ inline atf_amc::Linebuf::Linebuf() { // coverity[uninit_member] } +// --- atf_amc.Linebuf..Dtor +inline atf_amc::Linebuf::~Linebuf() { + atf_amc::Linebuf_Uninit(*this); +} + // --- atf_amc.MsgHdrLT.type.GetEnum // Get value of field as enum type inline atf_amc_MsgHdrLT_type_Enum atf_amc::type_GetEnum(const atf_amc::MsgHdrLT& o) { @@ -6453,7 +6805,7 @@ inline u32 atf_amc::v_N(const atf_amc::MsgLTV& parent) { // --- atf_amc.MsgLTV.v_curs.Reset inline void atf_amc::MsgLTV_v_curs_Reset(MsgLTV_v_curs &curs, atf_amc::MsgLTV &parent) { - curs.ptr = (u8*)&parent + sizeof(atf_amc::MsgLTV); + curs.ptr = (u8*)v_Addr(parent); curs.length = i32(parent.len + 2) - sizeof(atf_amc::MsgLTV); curs.index = 0; } @@ -6508,8 +6860,7 @@ inline atf_amc::MsgLTV::MsgLTV() { // --- atf_amc.Msgbuf.in_buf.Max // Return max. number of bytes in the buffer. inline i32 atf_amc::in_buf_Max(atf_amc::Msgbuf& msgbuf) { - return 64; - (void)msgbuf;//only to avoid -Wunused-parameter + return msgbuf.in_buf_max; } // --- atf_amc.Msgbuf.in_buf.N @@ -6521,8 +6872,7 @@ inline i32 atf_amc::in_buf_N(atf_amc::Msgbuf& msgbuf) { // --- atf_amc.Msgbuf.in_custom.Max // Return max. number of bytes in the buffer. inline i32 atf_amc::in_custom_Max(atf_amc::Msgbuf& msgbuf) { - return 64; - (void)msgbuf;//only to avoid -Wunused-parameter + return msgbuf.in_custom_max; } // --- atf_amc.Msgbuf.in_custom.N @@ -6534,8 +6884,7 @@ inline i32 atf_amc::in_custom_N(atf_amc::Msgbuf& msgbuf) { // --- atf_amc.Msgbuf.out_extra.Max // Return max. number of bytes in the buffer. inline i32 atf_amc::out_extra_Max(atf_amc::Msgbuf& msgbuf) { - return 64; - (void)msgbuf;//only to avoid -Wunused-parameter + return msgbuf.out_extra_max; } // --- atf_amc.Msgbuf.out_extra.N @@ -6547,8 +6896,7 @@ inline i32 atf_amc::out_extra_N(atf_amc::Msgbuf& msgbuf) { // --- atf_amc.Msgbuf.in_extra.Max // Return max. number of bytes in the buffer. inline i32 atf_amc::in_extra_Max(atf_amc::Msgbuf& msgbuf) { - return 64; - (void)msgbuf;//only to avoid -Wunused-parameter + return msgbuf.in_extra_max; } // --- atf_amc.Msgbuf.in_extra.N @@ -7862,66 +8210,6 @@ inline void atf_amc::value7_Set(atf_amc::PmaskMultiple& parent, u32 rhs) { present_qSetBit(parent, 6); // mark presence in pmask } -// --- atf_amc.PmaskMultiple.present_bitcurs.Reset -inline void atf_amc::PmaskMultiple_present_bitcurs_Reset(PmaskMultiple_present_bitcurs &curs, atf_amc::PmaskMultiple &parent) { - curs.elems = &present_qFind(parent,0); - curs.n_elems = present_N(parent); - curs.bit = -1; - PmaskMultiple_present_bitcurs_Next(curs); -} - -// --- atf_amc.PmaskMultiple.present_bitcurs.ValidQ -// cursor points to valid item -inline bool atf_amc::PmaskMultiple_present_bitcurs_ValidQ(PmaskMultiple_present_bitcurs &curs) { - return curs.bit < curs.n_elems*32; -} - -// --- atf_amc.PmaskMultiple.present_bitcurs.Access -// item access -inline int& atf_amc::PmaskMultiple_present_bitcurs_Access(PmaskMultiple_present_bitcurs &curs) { - return curs.bit; -} - -// --- atf_amc.PmaskMultiple.assigned_bitcurs.Reset -inline void atf_amc::PmaskMultiple_assigned_bitcurs_Reset(PmaskMultiple_assigned_bitcurs &curs, atf_amc::PmaskMultiple &parent) { - curs.elems = &assigned_qFind(parent,0); - curs.n_elems = assigned_N(parent); - curs.bit = -1; - PmaskMultiple_assigned_bitcurs_Next(curs); -} - -// --- atf_amc.PmaskMultiple.assigned_bitcurs.ValidQ -// cursor points to valid item -inline bool atf_amc::PmaskMultiple_assigned_bitcurs_ValidQ(PmaskMultiple_assigned_bitcurs &curs) { - return curs.bit < curs.n_elems*32; -} - -// --- atf_amc.PmaskMultiple.assigned_bitcurs.Access -// item access -inline int& atf_amc::PmaskMultiple_assigned_bitcurs_Access(PmaskMultiple_assigned_bitcurs &curs) { - return curs.bit; -} - -// --- atf_amc.PmaskMultiple.nullable_bitcurs.Reset -inline void atf_amc::PmaskMultiple_nullable_bitcurs_Reset(PmaskMultiple_nullable_bitcurs &curs, atf_amc::PmaskMultiple &parent) { - curs.elems = &nullable_qFind(parent,0); - curs.n_elems = nullable_N(parent); - curs.bit = -1; - PmaskMultiple_nullable_bitcurs_Next(curs); -} - -// --- atf_amc.PmaskMultiple.nullable_bitcurs.ValidQ -// cursor points to valid item -inline bool atf_amc::PmaskMultiple_nullable_bitcurs_ValidQ(PmaskMultiple_nullable_bitcurs &curs) { - return curs.bit < curs.n_elems*32; -} - -// --- atf_amc.PmaskMultiple.nullable_bitcurs.Access -// item access -inline int& atf_amc::PmaskMultiple_nullable_bitcurs_Access(PmaskMultiple_nullable_bitcurs &curs) { - return curs.bit; -} - // --- atf_amc.PmaskMultiple..Ctor inline atf_amc::PmaskMultiple::PmaskMultiple() { atf_amc::PmaskMultiple_Init(*this); @@ -10236,26 +10524,6 @@ inline void atf_amc::value5_Set(atf_amc::PmaskU32& parent, u32 rhs) { pmask_qSetBit(parent, 4); // mark presence in pmask } -// --- atf_amc.PmaskU32.pmask_bitcurs.Reset -inline void atf_amc::PmaskU32_pmask_bitcurs_Reset(PmaskU32_pmask_bitcurs &curs, atf_amc::PmaskU32 &parent) { - curs.elems = &pmask_qFind(parent,0); - curs.n_elems = pmask_N(parent); - curs.bit = -1; - PmaskU32_pmask_bitcurs_Next(curs); -} - -// --- atf_amc.PmaskU32.pmask_bitcurs.ValidQ -// cursor points to valid item -inline bool atf_amc::PmaskU32_pmask_bitcurs_ValidQ(PmaskU32_pmask_bitcurs &curs) { - return curs.bit < curs.n_elems*32; -} - -// --- atf_amc.PmaskU32.pmask_bitcurs.Access -// item access -inline int& atf_amc::PmaskU32_pmask_bitcurs_Access(PmaskU32_pmask_bitcurs &curs) { - return curs.bit; -} - // --- atf_amc.PmaskU32..Init // Set all fields to initial values. inline void atf_amc::PmaskU32_Init(atf_amc::PmaskU32& parent) { @@ -10506,26 +10774,6 @@ inline u64& atf_amc::pmask_qFind(atf_amc::PmaskU555& parent, u64 t) { return parent.pmask_elems[u64(t)]; } -// --- atf_amc.PmaskU555.pmask_bitcurs.Reset -inline void atf_amc::PmaskU555_pmask_bitcurs_Reset(PmaskU555_pmask_bitcurs &curs, atf_amc::PmaskU555 &parent) { - curs.elems = &pmask_qFind(parent,0); - curs.n_elems = pmask_N(parent); - curs.bit = -1; - PmaskU555_pmask_bitcurs_Next(curs); -} - -// --- atf_amc.PmaskU555.pmask_bitcurs.ValidQ -// cursor points to valid item -inline bool atf_amc::PmaskU555_pmask_bitcurs_ValidQ(PmaskU555_pmask_bitcurs &curs) { - return curs.bit < curs.n_elems*64; -} - -// --- atf_amc.PmaskU555.pmask_bitcurs.Access -// item access -inline int& atf_amc::PmaskU555_pmask_bitcurs_Access(PmaskU555_pmask_bitcurs &curs) { - return curs.bit; -} - // --- atf_amc.PmaskU555.pmask_curs.Reset // cursor points to valid item inline void atf_amc::PmaskU555_pmask_curs_Reset(PmaskU555_pmask_curs &curs, atf_amc::PmaskU555 &parent) { @@ -10612,11 +10860,6 @@ inline algo::aryptr atf_amc::ch_Getary(const atf_amc::RnullStr6_U32& paren return ret; } -// --- atf_amc.RnullStr6_U32.ch.HashStrptr -inline u32 atf_amc::RnullStr6_U32_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- atf_amc.RnullStr6_U32.ch.Init inline void atf_amc::ch_Init(atf_amc::RnullStr6_U32 &parent) { memset(parent.ch, 0, 6); @@ -10770,11 +11013,6 @@ inline algo::aryptr atf_amc::ch_Getary(const atf_amc::RpasU32Str6& parent) return ret; } -// --- atf_amc.RpasU32Str6.ch.HashStrptr -inline u32 atf_amc::RpasU32Str6_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- atf_amc.RpasU32Str6.ch.Init inline void atf_amc::ch_Init(atf_amc::RpasU32Str6 &parent) { parent.n_ch = 0; @@ -11190,9 +11428,27 @@ inline atf_amc::SsimfilesCase::SsimfilesCase(atf_amc_SsimfilesCaseEnum arg) { this->value = u32(arg); } -// --- atf_amc.TableId.value.GetEnum -// Get value of field as enum type -inline atf_amc_TableIdEnum atf_amc::value_GetEnum(const atf_amc::TableId& parent) { +// --- atf_amc.Strkey..Init +// Set all fields to initial values. +inline void atf_amc::Strkey_Init(atf_amc::Strkey& strkey) { + strkey.strkey_next = (atf_amc::Strkey*)-1; // (atf_amc.FDb.strkey) not-in-tpool's freelist + strkey.ind_strkey_next = (atf_amc::Strkey*)-1; // (atf_amc.FDb.ind_strkey) not-in-hash + strkey.ind_strkey_hashval = 0; // stored hash value +} + +// --- atf_amc.Strkey..Ctor +inline atf_amc::Strkey::Strkey() { + atf_amc::Strkey_Init(*this); +} + +// --- atf_amc.Strkey..Dtor +inline atf_amc::Strkey::~Strkey() { + atf_amc::Strkey_Uninit(*this); +} + +// --- atf_amc.TableId.value.GetEnum +// Get value of field as enum type +inline atf_amc_TableIdEnum atf_amc::value_GetEnum(const atf_amc::TableId& parent) { return atf_amc_TableIdEnum(parent.value); } @@ -11523,7 +11779,7 @@ inline u32 atf_amc::text_N(const atf_amc::Text& parent) { // --- atf_amc.Text.text_curs.Reset inline void atf_amc::Text_text_curs_Reset(Text_text_curs &curs, atf_amc::Text &parent) { - curs.ptr = (u8*)&parent + sizeof(atf_amc::Text); + curs.ptr = (u8*)text_Addr(parent); curs.length = i32(parent.length) - sizeof(atf_amc::Text); curs.index = 0; } @@ -12304,6 +12560,668 @@ inline atf_amc::Typefconst::Typefconst(atf_amc_Typefconst_value_Enum arg) { this->value = u32(arg); } +// --- atf_amc.Varlen2Msg.base.Castdown +// Check if atf_amc::MsgHeader is an instance of Varlen2Msg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Varlen2Msg. +// If not successful, quietly return NULL. +inline atf_amc::Varlen2Msg* atf_amc::Varlen2Msg_Castdown(atf_amc::MsgHeader &hdr) { + bool cond = hdr.type == (0x1001); + cond &= i32(hdr.length) >= ssizeof(atf_amc::Varlen2Msg); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- atf_amc.Varlen2Msg.base.Castbase +inline atf_amc::MsgHeader& atf_amc::Castbase(atf_amc::Varlen2Msg& parent) { + return reinterpret_cast(parent); +} + +// --- atf_amc.Varlen2Msg.s1.N +// Return number of elements in varlen field +inline u32 atf_amc::s1_N(const atf_amc::Varlen2Msg& parent) { + return u32((parent.s1_end) / sizeof(char)); +} + +// --- atf_amc.Varlen2Msg.s2.N +// Return number of elements in varlen field +inline u32 atf_amc::s2_N(const atf_amc::Varlen2Msg& parent) { + return u32((parent.s2_end - parent.s1_end) / sizeof(char)); +} + +// --- atf_amc.Varlen2Msg.s3.N +// Return number of elements in varlen field +inline u32 atf_amc::s3_N(const atf_amc::Varlen2Msg& parent) { + u32 length = i32(((atf_amc::Varlen2Msg&)parent).length); + u32 extra_bytes = u32_Max(length,sizeof(atf_amc::Varlen2Msg)) - sizeof(atf_amc::Varlen2Msg) - parent.s2_end; // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(char)); +} + +// --- atf_amc.Varlen2Msg.s1_curs.Reset +inline void atf_amc::Varlen2Msg_s1_curs_Reset(Varlen2Msg_s1_curs &curs, atf_amc::Varlen2Msg &parent) { + curs.ptr = (u8*)s1_Addr(parent); + curs.length = parent.s1_end; + curs.index = 0; +} + +// --- atf_amc.Varlen2Msg.s1_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2Msg_s1_curs_ValidQ(Varlen2Msg_s1_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- atf_amc.Varlen2Msg.s1_curs.Next +// proceed to next item +inline void atf_amc::Varlen2Msg_s1_curs_Next(Varlen2Msg_s1_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2Msg.s1_curs.Access +// item access +inline char& atf_amc::Varlen2Msg_s1_curs_Access(Varlen2Msg_s1_curs &curs) { + return *(char*)curs.ptr; +} + +// --- atf_amc.Varlen2Msg.s2_curs.Reset +inline void atf_amc::Varlen2Msg_s2_curs_Reset(Varlen2Msg_s2_curs &curs, atf_amc::Varlen2Msg &parent) { + curs.ptr = (u8*)s2_Addr(parent); + curs.length = parent.s2_end- parent.s1_end; + curs.index = 0; +} + +// --- atf_amc.Varlen2Msg.s2_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2Msg_s2_curs_ValidQ(Varlen2Msg_s2_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- atf_amc.Varlen2Msg.s2_curs.Next +// proceed to next item +inline void atf_amc::Varlen2Msg_s2_curs_Next(Varlen2Msg_s2_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2Msg.s2_curs.Access +// item access +inline char& atf_amc::Varlen2Msg_s2_curs_Access(Varlen2Msg_s2_curs &curs) { + return *(char*)curs.ptr; +} + +// --- atf_amc.Varlen2Msg.s3_curs.Reset +inline void atf_amc::Varlen2Msg_s3_curs_Reset(Varlen2Msg_s3_curs &curs, atf_amc::Varlen2Msg &parent) { + curs.ptr = (u8*)s3_Addr(parent); + curs.length = i32(parent.length) - parent.s2_end - sizeof(atf_amc::Varlen2Msg); + curs.index = 0; +} + +// --- atf_amc.Varlen2Msg.s3_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2Msg_s3_curs_ValidQ(Varlen2Msg_s3_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- atf_amc.Varlen2Msg.s3_curs.Next +// proceed to next item +inline void atf_amc::Varlen2Msg_s3_curs_Next(Varlen2Msg_s3_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2Msg.s3_curs.Access +// item access +inline char& atf_amc::Varlen2Msg_s3_curs_Access(Varlen2Msg_s3_curs &curs) { + return *(char*)curs.ptr; +} + +// --- atf_amc.Varlen2Msg..GetMsgLength +// Message length (uses length field) +inline i32 atf_amc::GetMsgLength(const atf_amc::Varlen2Msg& parent) { + return i32(const_cast(parent).length); +} + +// --- atf_amc.Varlen2Msg..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr atf_amc::GetMsgMemptr(const atf_amc::Varlen2Msg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); +} + +// --- atf_amc.Varlen2Msg..Init +// Set all fields to initial values. +inline void atf_amc::Varlen2Msg_Init(atf_amc::Varlen2Msg& parent) { + parent.type = atf_amc_MsgTypeEnum(0x1001); + parent.length = atf_amc::MsgLength(ssizeof(parent) + (0)); + parent.s1_end = atf_amc::MsgLength(0); // s1: initialize + parent.s2_end = atf_amc::MsgLength(0); // s2: initialize +} + +// --- atf_amc.Varlen2Msg..Ctor +inline atf_amc::Varlen2Msg::Varlen2Msg() { + atf_amc::Varlen2Msg_Init(*this); +} + +// --- atf_amc.Varlen2aMsg.base.Castdown +// Check if atf_amc::MsgHeader is an instance of Varlen2aMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Varlen2aMsg. +// If not successful, quietly return NULL. +inline atf_amc::Varlen2aMsg* atf_amc::Varlen2aMsg_Castdown(atf_amc::MsgHeader &hdr) { + bool cond = hdr.type == (0x1002); + cond &= i32(hdr.length) >= ssizeof(atf_amc::Varlen2aMsg); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- atf_amc.Varlen2aMsg.base.Castbase +inline atf_amc::MsgHeader& atf_amc::Castbase(atf_amc::Varlen2aMsg& parent) { + return reinterpret_cast(parent); +} + +// --- atf_amc.Varlen2aMsg.u1.N +// Return number of elements in varlen field +inline u32 atf_amc::u1_N(const atf_amc::Varlen2aMsg& parent) { + return u32((parent.u1_end) / sizeof(u32)); +} + +// --- atf_amc.Varlen2aMsg.u2.N +// Return number of elements in varlen field +inline u32 atf_amc::u2_N(const atf_amc::Varlen2aMsg& parent) { + return u32((parent.u2_end - parent.u1_end) / sizeof(u32)); +} + +// --- atf_amc.Varlen2aMsg.u3.N +// Return number of elements in varlen field +inline u32 atf_amc::u3_N(const atf_amc::Varlen2aMsg& parent) { + u32 length = i32(((atf_amc::Varlen2aMsg&)parent).length); + u32 extra_bytes = u32_Max(length,sizeof(atf_amc::Varlen2aMsg)) - sizeof(atf_amc::Varlen2aMsg) - parent.u2_end; // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(u32)); +} + +// --- atf_amc.Varlen2aMsg.u1_curs.Reset +inline void atf_amc::Varlen2aMsg_u1_curs_Reset(Varlen2aMsg_u1_curs &curs, atf_amc::Varlen2aMsg &parent) { + curs.ptr = (u8*)u1_Addr(parent); + curs.length = parent.u1_end; + curs.index = 0; +} + +// --- atf_amc.Varlen2aMsg.u1_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2aMsg_u1_curs_ValidQ(Varlen2aMsg_u1_curs &curs) { + bool valid = ssizeof(u32) <= curs.length; + return valid; +} + +// --- atf_amc.Varlen2aMsg.u1_curs.Next +// proceed to next item +inline void atf_amc::Varlen2aMsg_u1_curs_Next(Varlen2aMsg_u1_curs &curs) { + i32 len = i32(sizeof(u32)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2aMsg.u1_curs.Access +// item access +inline u32& atf_amc::Varlen2aMsg_u1_curs_Access(Varlen2aMsg_u1_curs &curs) { + return *(u32*)curs.ptr; +} + +// --- atf_amc.Varlen2aMsg.u2_curs.Reset +inline void atf_amc::Varlen2aMsg_u2_curs_Reset(Varlen2aMsg_u2_curs &curs, atf_amc::Varlen2aMsg &parent) { + curs.ptr = (u8*)u2_Addr(parent); + curs.length = parent.u2_end- parent.u1_end; + curs.index = 0; +} + +// --- atf_amc.Varlen2aMsg.u2_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2aMsg_u2_curs_ValidQ(Varlen2aMsg_u2_curs &curs) { + bool valid = ssizeof(u32) <= curs.length; + return valid; +} + +// --- atf_amc.Varlen2aMsg.u2_curs.Next +// proceed to next item +inline void atf_amc::Varlen2aMsg_u2_curs_Next(Varlen2aMsg_u2_curs &curs) { + i32 len = i32(sizeof(u32)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2aMsg.u2_curs.Access +// item access +inline u32& atf_amc::Varlen2aMsg_u2_curs_Access(Varlen2aMsg_u2_curs &curs) { + return *(u32*)curs.ptr; +} + +// --- atf_amc.Varlen2aMsg.u3_curs.Reset +inline void atf_amc::Varlen2aMsg_u3_curs_Reset(Varlen2aMsg_u3_curs &curs, atf_amc::Varlen2aMsg &parent) { + curs.ptr = (u8*)u3_Addr(parent); + curs.length = i32(parent.length) - parent.u2_end - sizeof(atf_amc::Varlen2aMsg); + curs.index = 0; +} + +// --- atf_amc.Varlen2aMsg.u3_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2aMsg_u3_curs_ValidQ(Varlen2aMsg_u3_curs &curs) { + bool valid = ssizeof(u32) <= curs.length; + return valid; +} + +// --- atf_amc.Varlen2aMsg.u3_curs.Next +// proceed to next item +inline void atf_amc::Varlen2aMsg_u3_curs_Next(Varlen2aMsg_u3_curs &curs) { + i32 len = i32(sizeof(u32)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2aMsg.u3_curs.Access +// item access +inline u32& atf_amc::Varlen2aMsg_u3_curs_Access(Varlen2aMsg_u3_curs &curs) { + return *(u32*)curs.ptr; +} + +// --- atf_amc.Varlen2aMsg..GetMsgLength +// Message length (uses length field) +inline i32 atf_amc::GetMsgLength(const atf_amc::Varlen2aMsg& parent) { + return i32(const_cast(parent).length); +} + +// --- atf_amc.Varlen2aMsg..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr atf_amc::GetMsgMemptr(const atf_amc::Varlen2aMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); +} + +// --- atf_amc.Varlen2aMsg..Init +// Set all fields to initial values. +inline void atf_amc::Varlen2aMsg_Init(atf_amc::Varlen2aMsg& parent) { + parent.type = atf_amc_MsgTypeEnum(0x1002); + parent.length = atf_amc::MsgLength(ssizeof(parent) + (0)); + parent.u1_end = atf_amc::MsgLength(0); // u1: initialize + parent.u2_end = atf_amc::MsgLength(0); // u2: initialize +} + +// --- atf_amc.Varlen2aMsg..Ctor +inline atf_amc::Varlen2aMsg::Varlen2aMsg() { + atf_amc::Varlen2aMsg_Init(*this); +} + +// --- atf_amc.Varlen2mMsg.base.Castdown +// Check if atf_amc::MsgHeader is an instance of Varlen2mMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Varlen2mMsg. +// If not successful, quietly return NULL. +inline atf_amc::Varlen2mMsg* atf_amc::Varlen2mMsg_Castdown(atf_amc::MsgHeader &hdr) { + bool cond = hdr.type == (0x1004); + cond &= i32(hdr.length) >= ssizeof(atf_amc::Varlen2mMsg); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- atf_amc.Varlen2mMsg.base.Castbase +inline atf_amc::MsgHeader& atf_amc::Castbase(atf_amc::Varlen2mMsg& parent) { + return reinterpret_cast(parent); +} + +// --- atf_amc.Varlen2mMsg.m1.N +// Return number of elements in varlen field +inline u32 atf_amc::m1_N(const atf_amc::Varlen2mMsg& parent) { + return u32((parent.m1_end) / sizeof(u8)); +} + +// --- atf_amc.Varlen2mMsg.m2.N +// Return number of elements in varlen field +inline u32 atf_amc::m2_N(const atf_amc::Varlen2mMsg& parent) { + return u32((parent.m2_end - parent.m1_end) / sizeof(u8)); +} + +// --- atf_amc.Varlen2mMsg.m3.N +// Return number of elements in varlen field +inline u32 atf_amc::m3_N(const atf_amc::Varlen2mMsg& parent) { + u32 length = i32(((atf_amc::Varlen2mMsg&)parent).length); + u32 extra_bytes = u32_Max(length,sizeof(atf_amc::Varlen2mMsg)) - sizeof(atf_amc::Varlen2mMsg) - parent.m2_end; // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(u8)); +} + +// --- atf_amc.Varlen2mMsg.m1_curs.Reset +inline void atf_amc::Varlen2mMsg_m1_curs_Reset(Varlen2mMsg_m1_curs &curs, atf_amc::Varlen2mMsg &parent) { + curs.ptr = (u8*)m1_Addr(parent); + curs.length = parent.m1_end; + curs.index = 0; +} + +// --- atf_amc.Varlen2mMsg.m1_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2mMsg_m1_curs_ValidQ(Varlen2mMsg_m1_curs &curs) { + bool valid = ssizeof(atf_amc::MsgHeader) <= curs.length; + valid = valid && unsigned(i32((*(atf_amc::MsgHeader*)curs.ptr).length)-ssizeof(atf_amc::MsgHeader)) <= curs.length-ssizeof(atf_amc::MsgHeader); + return valid; +} + +// --- atf_amc.Varlen2mMsg.m1_curs.Next +// proceed to next item +inline void atf_amc::Varlen2mMsg_m1_curs_Next(Varlen2mMsg_m1_curs &curs) { + i32 len = i32((*(atf_amc::MsgHeader*)curs.ptr).length); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2mMsg.m1_curs.Access +// item access +inline atf_amc::MsgHeader& atf_amc::Varlen2mMsg_m1_curs_Access(Varlen2mMsg_m1_curs &curs) { + return *(atf_amc::MsgHeader*)curs.ptr; +} + +// --- atf_amc.Varlen2mMsg.m2_curs.Reset +inline void atf_amc::Varlen2mMsg_m2_curs_Reset(Varlen2mMsg_m2_curs &curs, atf_amc::Varlen2mMsg &parent) { + curs.ptr = (u8*)m2_Addr(parent); + curs.length = parent.m2_end- parent.m1_end; + curs.index = 0; +} + +// --- atf_amc.Varlen2mMsg.m2_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2mMsg_m2_curs_ValidQ(Varlen2mMsg_m2_curs &curs) { + bool valid = ssizeof(atf_amc::MsgHeader) <= curs.length; + valid = valid && unsigned(i32((*(atf_amc::MsgHeader*)curs.ptr).length)-ssizeof(atf_amc::MsgHeader)) <= curs.length-ssizeof(atf_amc::MsgHeader); + return valid; +} + +// --- atf_amc.Varlen2mMsg.m2_curs.Next +// proceed to next item +inline void atf_amc::Varlen2mMsg_m2_curs_Next(Varlen2mMsg_m2_curs &curs) { + i32 len = i32((*(atf_amc::MsgHeader*)curs.ptr).length); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2mMsg.m2_curs.Access +// item access +inline atf_amc::MsgHeader& atf_amc::Varlen2mMsg_m2_curs_Access(Varlen2mMsg_m2_curs &curs) { + return *(atf_amc::MsgHeader*)curs.ptr; +} + +// --- atf_amc.Varlen2mMsg.m3_curs.Reset +inline void atf_amc::Varlen2mMsg_m3_curs_Reset(Varlen2mMsg_m3_curs &curs, atf_amc::Varlen2mMsg &parent) { + curs.ptr = (u8*)m3_Addr(parent); + curs.length = i32(parent.length) - parent.m2_end - sizeof(atf_amc::Varlen2mMsg); + curs.index = 0; +} + +// --- atf_amc.Varlen2mMsg.m3_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2mMsg_m3_curs_ValidQ(Varlen2mMsg_m3_curs &curs) { + bool valid = ssizeof(atf_amc::MsgHeader) <= curs.length; + valid = valid && unsigned(i32((*(atf_amc::MsgHeader*)curs.ptr).length)-ssizeof(atf_amc::MsgHeader)) <= curs.length-ssizeof(atf_amc::MsgHeader); + return valid; +} + +// --- atf_amc.Varlen2mMsg.m3_curs.Next +// proceed to next item +inline void atf_amc::Varlen2mMsg_m3_curs_Next(Varlen2mMsg_m3_curs &curs) { + i32 len = i32((*(atf_amc::MsgHeader*)curs.ptr).length); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2mMsg.m3_curs.Access +// item access +inline atf_amc::MsgHeader& atf_amc::Varlen2mMsg_m3_curs_Access(Varlen2mMsg_m3_curs &curs) { + return *(atf_amc::MsgHeader*)curs.ptr; +} + +// --- atf_amc.Varlen2mMsg..GetMsgLength +// Message length (uses length field) +inline i32 atf_amc::GetMsgLength(const atf_amc::Varlen2mMsg& parent) { + return i32(const_cast(parent).length); +} + +// --- atf_amc.Varlen2mMsg..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr atf_amc::GetMsgMemptr(const atf_amc::Varlen2mMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); +} + +// --- atf_amc.Varlen2mMsg..Init +// Set all fields to initial values. +inline void atf_amc::Varlen2mMsg_Init(atf_amc::Varlen2mMsg& parent) { + parent.type = atf_amc_MsgTypeEnum(0x1004); + parent.length = atf_amc::MsgLength(ssizeof(parent) + (0)); + parent.m1_end = atf_amc::MsgLength(0); // m1: initialize + parent.m2_end = atf_amc::MsgLength(0); // m2: initialize +} + +// --- atf_amc.Varlen2mMsg..Ctor +inline atf_amc::Varlen2mMsg::Varlen2mMsg() { + atf_amc::Varlen2mMsg_Init(*this); +} + +// --- atf_amc.VarlenK.i.N +// Return number of elements in varlen field +inline u32 atf_amc::i_N(const atf_amc::VarlenK& v1) { + u32 length = i32(((atf_amc::VarlenK&)v1).length); + u32 extra_bytes = u32_Max(length,sizeof(atf_amc::VarlenK)) - sizeof(atf_amc::VarlenK); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(u32)); +} + +// --- atf_amc.VarlenK.i_curs.Reset +inline void atf_amc::v1_i_curs_Reset(v1_i_curs &curs, atf_amc::VarlenK &parent) { + curs.ptr = (u8*)i_Addr(parent); + curs.length = i32(parent.length) - sizeof(atf_amc::VarlenK); + curs.index = 0; +} + +// --- atf_amc.VarlenK.i_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::v1_i_curs_ValidQ(v1_i_curs &curs) { + bool valid = ssizeof(u32) <= curs.length; + return valid; +} + +// --- atf_amc.VarlenK.i_curs.Next +// proceed to next item +inline void atf_amc::v1_i_curs_Next(v1_i_curs &curs) { + i32 len = i32(sizeof(u32)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.VarlenK.i_curs.Access +// item access +inline u32& atf_amc::v1_i_curs_Access(v1_i_curs &curs) { + return *(u32*)curs.ptr; +} + +// --- atf_amc.VarlenK..GetMsgLength +// Message length (uses length field) +inline i32 atf_amc::GetMsgLength(const atf_amc::VarlenK& parent) { + return i32(const_cast(parent).length); +} + +// --- atf_amc.VarlenK..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr atf_amc::GetMsgMemptr(const atf_amc::VarlenK& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); +} + +// --- atf_amc.VarlenK..Init +// Set all fields to initial values. +inline void atf_amc::VarlenK_Init(atf_amc::VarlenK& v1) { + v1.length = u32(0); +} + +// --- atf_amc.VarlenK..Ctor +inline atf_amc::VarlenK::VarlenK() { + atf_amc::VarlenK_Init(*this); +} + +// --- atf_amc.Varlen2vMsg.base.Castdown +// Check if atf_amc::MsgHeader is an instance of Varlen2vMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Varlen2vMsg. +// If not successful, quietly return NULL. +inline atf_amc::Varlen2vMsg* atf_amc::Varlen2vMsg_Castdown(atf_amc::MsgHeader &hdr) { + bool cond = hdr.type == (0x1003); + cond &= i32(hdr.length) >= ssizeof(atf_amc::Varlen2vMsg); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- atf_amc.Varlen2vMsg.base.Castbase +inline atf_amc::MsgHeader& atf_amc::Castbase(atf_amc::Varlen2vMsg& parent) { + return reinterpret_cast(parent); +} + +// --- atf_amc.Varlen2vMsg.v1.N +// Return number of elements in varlen field +inline u32 atf_amc::v1_N(const atf_amc::Varlen2vMsg& parent) { + return u32((parent.v1_end) / sizeof(u8)); +} + +// --- atf_amc.Varlen2vMsg.v2.N +// Return number of elements in varlen field +inline u32 atf_amc::v2_N(const atf_amc::Varlen2vMsg& parent) { + return u32((parent.v2_end - parent.v1_end) / sizeof(u8)); +} + +// --- atf_amc.Varlen2vMsg.v3.N +// Return number of elements in varlen field +inline u32 atf_amc::v3_N(const atf_amc::Varlen2vMsg& parent) { + u32 length = i32(((atf_amc::Varlen2vMsg&)parent).length); + u32 extra_bytes = u32_Max(length,sizeof(atf_amc::Varlen2vMsg)) - sizeof(atf_amc::Varlen2vMsg) - parent.v2_end; // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(u8)); +} + +// --- atf_amc.Varlen2vMsg.v1_curs.Reset +inline void atf_amc::Varlen2vMsg_v1_curs_Reset(Varlen2vMsg_v1_curs &curs, atf_amc::Varlen2vMsg &parent) { + curs.ptr = (u8*)v1_Addr(parent); + curs.length = parent.v1_end; + curs.index = 0; +} + +// --- atf_amc.Varlen2vMsg.v1_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2vMsg_v1_curs_ValidQ(Varlen2vMsg_v1_curs &curs) { + bool valid = ssizeof(atf_amc::VarlenK) <= curs.length; + valid = valid && unsigned(i32((*(atf_amc::VarlenK*)curs.ptr).length)-ssizeof(atf_amc::VarlenK)) <= curs.length-ssizeof(atf_amc::VarlenK); + return valid; +} + +// --- atf_amc.Varlen2vMsg.v1_curs.Next +// proceed to next item +inline void atf_amc::Varlen2vMsg_v1_curs_Next(Varlen2vMsg_v1_curs &curs) { + i32 len = i32((*(atf_amc::VarlenK*)curs.ptr).length); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2vMsg.v1_curs.Access +// item access +inline atf_amc::VarlenK& atf_amc::Varlen2vMsg_v1_curs_Access(Varlen2vMsg_v1_curs &curs) { + return *(atf_amc::VarlenK*)curs.ptr; +} + +// --- atf_amc.Varlen2vMsg.v2_curs.Reset +inline void atf_amc::Varlen2vMsg_v2_curs_Reset(Varlen2vMsg_v2_curs &curs, atf_amc::Varlen2vMsg &parent) { + curs.ptr = (u8*)v2_Addr(parent); + curs.length = parent.v2_end- parent.v1_end; + curs.index = 0; +} + +// --- atf_amc.Varlen2vMsg.v2_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2vMsg_v2_curs_ValidQ(Varlen2vMsg_v2_curs &curs) { + bool valid = ssizeof(atf_amc::VarlenK) <= curs.length; + valid = valid && unsigned(i32((*(atf_amc::VarlenK*)curs.ptr).length)-ssizeof(atf_amc::VarlenK)) <= curs.length-ssizeof(atf_amc::VarlenK); + return valid; +} + +// --- atf_amc.Varlen2vMsg.v2_curs.Next +// proceed to next item +inline void atf_amc::Varlen2vMsg_v2_curs_Next(Varlen2vMsg_v2_curs &curs) { + i32 len = i32((*(atf_amc::VarlenK*)curs.ptr).length); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2vMsg.v2_curs.Access +// item access +inline atf_amc::VarlenK& atf_amc::Varlen2vMsg_v2_curs_Access(Varlen2vMsg_v2_curs &curs) { + return *(atf_amc::VarlenK*)curs.ptr; +} + +// --- atf_amc.Varlen2vMsg.v3_curs.Reset +inline void atf_amc::Varlen2vMsg_v3_curs_Reset(Varlen2vMsg_v3_curs &curs, atf_amc::Varlen2vMsg &parent) { + curs.ptr = (u8*)v3_Addr(parent); + curs.length = i32(parent.length) - parent.v2_end - sizeof(atf_amc::Varlen2vMsg); + curs.index = 0; +} + +// --- atf_amc.Varlen2vMsg.v3_curs.ValidQ +// cursor points to valid item +inline bool atf_amc::Varlen2vMsg_v3_curs_ValidQ(Varlen2vMsg_v3_curs &curs) { + bool valid = ssizeof(atf_amc::VarlenK) <= curs.length; + valid = valid && unsigned(i32((*(atf_amc::VarlenK*)curs.ptr).length)-ssizeof(atf_amc::VarlenK)) <= curs.length-ssizeof(atf_amc::VarlenK); + return valid; +} + +// --- atf_amc.Varlen2vMsg.v3_curs.Next +// proceed to next item +inline void atf_amc::Varlen2vMsg_v3_curs_Next(Varlen2vMsg_v3_curs &curs) { + i32 len = i32((*(atf_amc::VarlenK*)curs.ptr).length); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- atf_amc.Varlen2vMsg.v3_curs.Access +// item access +inline atf_amc::VarlenK& atf_amc::Varlen2vMsg_v3_curs_Access(Varlen2vMsg_v3_curs &curs) { + return *(atf_amc::VarlenK*)curs.ptr; +} + +// --- atf_amc.Varlen2vMsg..GetMsgLength +// Message length (uses length field) +inline i32 atf_amc::GetMsgLength(const atf_amc::Varlen2vMsg& parent) { + return i32(const_cast(parent).length); +} + +// --- atf_amc.Varlen2vMsg..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr atf_amc::GetMsgMemptr(const atf_amc::Varlen2vMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); +} + +// --- atf_amc.Varlen2vMsg..Init +// Set all fields to initial values. +inline void atf_amc::Varlen2vMsg_Init(atf_amc::Varlen2vMsg& parent) { + parent.type = atf_amc_MsgTypeEnum(0x1003); + parent.length = atf_amc::MsgLength(ssizeof(parent) + (0)); + parent.v1_end = atf_amc::MsgLength(0); // v1: initialize + parent.v2_end = atf_amc::MsgLength(0); // v2: initialize +} + +// --- atf_amc.Varlen2vMsg..Ctor +inline atf_amc::Varlen2vMsg::Varlen2vMsg() { + atf_amc::Varlen2vMsg_Init(*this); +} + // --- atf_amc.VarlenAlloc.elem.N // Return number of elements in varlen field inline u32 atf_amc::elem_N(const atf_amc::VarlenAlloc& varlenalloc) { @@ -12314,7 +13232,7 @@ inline u32 atf_amc::elem_N(const atf_amc::VarlenAlloc& varlenalloc) { // --- atf_amc.VarlenAlloc.elem_curs.Reset inline void atf_amc::varlenalloc_elem_curs_Reset(varlenalloc_elem_curs &curs, atf_amc::VarlenAlloc &parent) { - curs.ptr = (u8*)&parent + sizeof(atf_amc::VarlenAlloc); + curs.ptr = (u8*)elem_Addr(parent); curs.length = i32(parent.length) - sizeof(atf_amc::VarlenAlloc); curs.index = 0; } @@ -12432,7 +13350,7 @@ inline u32 atf_amc::varlen_N(const atf_amc::VarlenExtern& varlen_extern) { // --- atf_amc.VarlenExtern.varlen_curs.Reset inline void atf_amc::varlen_extern_varlen_curs_Reset(varlen_extern_varlen_curs &curs, atf_amc::VarlenExtern &parent) { - curs.ptr = (u8*)&parent + sizeof(atf_amc::VarlenExtern); + curs.ptr = (u8*)varlen_Addr(parent); curs.length = i32(length_Get(parent)) - sizeof(atf_amc::VarlenExtern); curs.index = 0; } @@ -12550,7 +13468,7 @@ inline u32 atf_amc::typeh_N(const atf_amc::VarlenH& parent) { // --- atf_amc.VarlenH.typeh_curs.Reset inline void atf_amc::VarlenH_typeh_curs_Reset(VarlenH_typeh_curs &curs, atf_amc::VarlenH &parent) { - curs.ptr = (u8*)&parent + sizeof(atf_amc::VarlenH); + curs.ptr = (u8*)typeh_Addr(parent); curs.length = i32(parent.length) - sizeof(atf_amc::VarlenH); curs.index = 0; } @@ -12658,66 +13576,6 @@ inline atf_amc::VarlenH_curs::VarlenH_curs() { atf_amc::VarlenH_curs_Init(*this); } -// --- atf_amc.VarlenK.i.N -// Return number of elements in varlen field -inline u32 atf_amc::i_N(const atf_amc::VarlenK& k) { - u32 length = i32(((atf_amc::VarlenK&)k).length); - u32 extra_bytes = u32_Max(length,sizeof(atf_amc::VarlenK)) - sizeof(atf_amc::VarlenK); // avoid unsigned subtraction underflow - return u32(extra_bytes / sizeof(u32)); -} - -// --- atf_amc.VarlenK.i_curs.Reset -inline void atf_amc::k_i_curs_Reset(k_i_curs &curs, atf_amc::VarlenK &parent) { - curs.ptr = (u8*)&parent + sizeof(atf_amc::VarlenK); - curs.length = i32(parent.length) - sizeof(atf_amc::VarlenK); - curs.index = 0; -} - -// --- atf_amc.VarlenK.i_curs.ValidQ -// cursor points to valid item -inline bool atf_amc::k_i_curs_ValidQ(k_i_curs &curs) { - bool valid = ssizeof(u32) <= curs.length; - return valid; -} - -// --- atf_amc.VarlenK.i_curs.Next -// proceed to next item -inline void atf_amc::k_i_curs_Next(k_i_curs &curs) { - i32 len = i32(sizeof(u32)); - curs.ptr += len; - curs.length -= len; - ++curs.index; -} - -// --- atf_amc.VarlenK.i_curs.Access -// item access -inline u32& atf_amc::k_i_curs_Access(k_i_curs &curs) { - return *(u32*)curs.ptr; -} - -// --- atf_amc.VarlenK..GetMsgLength -// Message length (uses length field) -inline i32 atf_amc::GetMsgLength(const atf_amc::VarlenK& parent) { - return i32(const_cast(parent).length); -} - -// --- atf_amc.VarlenK..GetMsgMemptr -// Memptr encompassing the message (uses length field) -inline algo::memptr atf_amc::GetMsgMemptr(const atf_amc::VarlenK& row) { - return algo::memptr((u8*)&row, i32(const_cast(row).length)); -} - -// --- atf_amc.VarlenK..Init -// Set all fields to initial values. -inline void atf_amc::VarlenK_Init(atf_amc::VarlenK& k) { - k.length = u32(0); -} - -// --- atf_amc.VarlenK..Ctor -inline atf_amc::VarlenK::VarlenK() { - atf_amc::VarlenK_Init(*this); -} - // --- atf_amc.VarlenK_curs..ValidQ inline bool atf_amc::VarlenK_curs_ValidQ(atf_amc::VarlenK_curs& curs) { return curs.msg != NULL; @@ -12802,7 +13660,7 @@ inline u32 atf_amc::k_N(const atf_amc::VarlenMsg& parent) { // --- atf_amc.VarlenMsg.k_curs.Reset inline void atf_amc::VarlenMsg_k_curs_Reset(VarlenMsg_k_curs &curs, atf_amc::VarlenMsg &parent) { - curs.ptr = (u8*)&parent + sizeof(atf_amc::VarlenMsg); + curs.ptr = (u8*)k_Addr(parent); curs.length = i32(parent.length) - sizeof(atf_amc::VarlenMsg); curs.index = 0; } @@ -12994,6 +13852,26 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const atf_amc::Typef return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const atf_amc::Varlen2Msg &row) {// cfmt:atf_amc.Varlen2Msg.String + atf_amc::Varlen2Msg_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const atf_amc::Varlen2aMsg &row) {// cfmt:atf_amc.Varlen2aMsg.String + atf_amc::Varlen2aMsg_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const atf_amc::Varlen2mMsg &row) {// cfmt:atf_amc.Varlen2mMsg.String + atf_amc::Varlen2mMsg_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const atf_amc::Varlen2vMsg &row) {// cfmt:atf_amc.Varlen2vMsg.String + atf_amc::Varlen2vMsg_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const atf_amc::VarlenMsg &row) {// cfmt:atf_amc.VarlenMsg.String atf_amc::VarlenMsg_Print(const_cast(row), str); return str; diff --git a/include/gen/atf_ci_gen.h b/include/gen/atf_ci_gen.h index 228f2227..855e82b1 100644 --- a/include/gen/atf_ci_gen.h +++ b/include/gen/atf_ci_gen.h @@ -57,8 +57,8 @@ enum atf_ci_TableIdEnum { // atf_ci.TableId.value ,atf_ci_TableId_dev_noindent = 5 // dev.noindent -> atf_ci.FNoindent ,atf_ci_TableId_dmmeta_Ns = 6 // dmmeta.Ns -> atf_ci.FNs ,atf_ci_TableId_dmmeta_ns = 6 // dmmeta.ns -> atf_ci.FNs - ,atf_ci_TableId_dev_Readme = 7 // dev.Readme -> atf_ci.FReadme - ,atf_ci_TableId_dev_readme = 7 // dev.readme -> atf_ci.FReadme + ,atf_ci_TableId_dev_Readmefile = 7 // dev.Readmefile -> atf_ci.FReadmefile + ,atf_ci_TableId_dev_readmefile = 7 // dev.readmefile -> atf_ci.FReadmefile ,atf_ci_TableId_dev_Scriptfile = 8 // dev.Scriptfile -> atf_ci.FScriptfile ,atf_ci_TableId_dev_scriptfile = 8 // dev.scriptfile -> atf_ci.FScriptfile ,atf_ci_TableId_dmmeta_Ssimfile = 9 // dmmeta.Ssimfile -> atf_ci.FSsimfile @@ -83,7 +83,7 @@ namespace dev { struct Gitfile; } namespace dev { struct Msgfile; } namespace dev { struct Noindent; } namespace dmmeta { struct Ns; } -namespace dev { struct Readme; } +namespace dev { struct Readmefile; } namespace dev { struct Scriptfile; } namespace dmmeta { struct Ssimfile; } namespace dev { struct Targsrc; } @@ -91,7 +91,7 @@ namespace atf_ci { struct _db_citest_curs; } namespace atf_ci { struct _db_ssimfile_curs; } namespace atf_ci { struct _db_scriptfile_curs; } namespace atf_ci { struct _db_ns_curs; } -namespace atf_ci { struct _db_readme_curs; } +namespace atf_ci { struct _db_readmefile_curs; } namespace atf_ci { struct _db_builddir_curs; } namespace atf_ci { struct _db_cfg_curs; } namespace atf_ci { struct _db_gitfile_curs; } @@ -111,7 +111,7 @@ namespace atf_ci { struct FGitfile; } namespace atf_ci { struct FMsgfile; } namespace atf_ci { struct FNoindent; } namespace atf_ci { struct FNs; } -namespace atf_ci { struct FReadme; } +namespace atf_ci { struct FReadmefile; } namespace atf_ci { struct FScriptfile; } namespace atf_ci { struct FSsimfile; } namespace atf_ci { struct FTargsrc; } @@ -124,7 +124,7 @@ namespace atf_ci { // hook_fcn_typedef } // hook_decl namespace atf_ci { // gen:ns_gsymbol extern const atfdb::CijobPkey atfdb_cijob_comp; // "comp" - extern const atfdb::CijobPkey atfdb_cijob_cov; // "cov" + extern const atfdb::CijobPkey atfdb_cijob_coverage; // "coverage" extern const atfdb::CijobPkey atfdb_cijob_memcheck; // "memcheck" extern const atfdb::CijobPkey atfdb_cijob_normalize; // "normalize" } // gen:ns_gsymbol @@ -149,9 +149,10 @@ namespace atf_ci { // gen:ns_print_struct // global access: builddir (Lary, by rowid) // global access: ind_builddir (Thash, hash field builddir) struct FBuilddir { // atf_ci.FBuilddir - algo::Smallstr50 builddir; // Primary key - uname.compiler.cfg-arch - algo::Comment comment; // - atf_ci::FBuilddir* ind_builddir_next; // hash next + algo::Smallstr50 builddir; // Primary key - uname.compiler.cfg-arch + algo::Comment comment; // + atf_ci::FBuilddir* ind_builddir_next; // hash next + u32 ind_builddir_hashval; // hash value // func:atf_ci.FBuilddir..AssignOp inline atf_ci::FBuilddir& operator =(const atf_ci::FBuilddir &rhs) = delete; // func:atf_ci.FBuilddir..CopyCtor @@ -251,13 +252,14 @@ inline void FCipackage_Init(atf_ci::FCipackage& cipackage); // global access: c_citest (Ptr) // global access: ind_citest (Thash, hash field citest) struct FCitest { // atf_ci.FCitest - algo::Smallstr50 citest; // Primary key - algo::Smallstr50 cijob; // "test" CI job in which this test runs - bool sandbox; // false Run test in sandbox - algo::Comment comment; // - i32 nerr; // 0 - atf_ci::citest_step_hook step; // NULL Pointer to a function - atf_ci::FCitest* ind_citest_next; // hash next + algo::Smallstr50 citest; // Primary key + algo::Smallstr50 cijob; // "test" CI job in which this test runs + bool sandbox; // false Run test in sandbox + algo::Comment comment; // + i32 nerr; // 0 + atf_ci::citest_step_hook step; // NULL Pointer to a function + atf_ci::FCitest* ind_citest_next; // hash next + u32 ind_citest_hashval; // hash value // reftype Hook of atf_ci.FCitest.step prohibits copy // func:atf_ci.FCitest..AssignOp inline atf_ci::FCitest& operator =(const atf_ci::FCitest &rhs) = delete; @@ -327,8 +329,8 @@ struct FDb { // atf_ci.FDb: In-memory database for atf_ci atf_ci::FNs** ind_ns_buckets_elems; // pointer to bucket array i32 ind_ns_buckets_n; // number of elements in bucket array i32 ind_ns_n; // number of elements in the hash table - atf_ci::FReadme* readme_lary[32]; // level array - i32 readme_n; // number of elements in array + atf_ci::FReadmefile* readmefile_lary[32]; // level array + i32 readmefile_n; // number of elements in array atf_ci::FBuilddir* builddir_lary[32]; // level array i32 builddir_n; // number of elements in array atf_ci::FCfg* cfg_lary[32]; // level array @@ -358,6 +360,7 @@ struct FDb { // atf_ci.FDb: In-memory database for atf_ci bool sandbox_need_init; // false atf_ci::FCipackage* cipackage_lary[32]; // level array i32 cipackage_n; // number of elements in array + bool called_npm_install; // false atf_ci::trace trace; // }; @@ -507,6 +510,9 @@ void ind_ssimfile_Remove(atf_ci::FSsimfile& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:atf_ci.FDb.ind_ssimfile.Reserve void ind_ssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_ci.FDb.ind_ssimfile.AbsReserve +void ind_ssimfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -569,6 +575,9 @@ void ind_scriptfile_Remove(atf_ci::FScriptfile& row) __attribute // Reserve enough room in the hash for N more elements. Return success code. // func:atf_ci.FDb.ind_scriptfile.Reserve void ind_scriptfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_ci.FDb.ind_scriptfile.AbsReserve +void ind_scriptfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -634,46 +643,49 @@ void ind_ns_Remove(atf_ci::FNs& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:atf_ci.FDb.ind_ns.Reserve void ind_ns_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_ci.FDb.ind_ns.AbsReserve +void ind_ns_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. -// func:atf_ci.FDb.readme.Alloc -atf_ci::FReadme& readme_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// func:atf_ci.FDb.readmefile.Alloc +atf_ci::FReadmefile& readmefile_Alloc() __attribute__((__warn_unused_result__, nothrow)); // Allocate memory for new element. If out of memory, return NULL. -// func:atf_ci.FDb.readme.AllocMaybe -atf_ci::FReadme* readme_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// func:atf_ci.FDb.readmefile.AllocMaybe +atf_ci::FReadmefile* readmefile_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); // Create new row from struct. // Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -// func:atf_ci.FDb.readme.InsertMaybe -atf_ci::FReadme* readme_InsertMaybe(const dev::Readme &value) __attribute__((nothrow)); +// func:atf_ci.FDb.readmefile.InsertMaybe +atf_ci::FReadmefile* readmefile_InsertMaybe(const dev::Readmefile &value) __attribute__((nothrow)); // Allocate space for one element. If no memory available, return NULL. -// func:atf_ci.FDb.readme.AllocMem -void* readme_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// func:atf_ci.FDb.readmefile.AllocMem +void* readmefile_AllocMem() __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty -// func:atf_ci.FDb.readme.EmptyQ -inline bool readme_EmptyQ() __attribute__((nothrow, pure)); +// func:atf_ci.FDb.readmefile.EmptyQ +inline bool readmefile_EmptyQ() __attribute__((nothrow, pure)); // Look up row by row id. Return NULL if out of range -// func:atf_ci.FDb.readme.Find -inline atf_ci::FReadme* readme_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:atf_ci.FDb.readmefile.Find +inline atf_ci::FReadmefile* readmefile_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to last element of array, or NULL if array is empty -// func:atf_ci.FDb.readme.Last -inline atf_ci::FReadme* readme_Last() __attribute__((nothrow, pure)); +// func:atf_ci.FDb.readmefile.Last +inline atf_ci::FReadmefile* readmefile_Last() __attribute__((nothrow, pure)); // Return number of items in the pool -// func:atf_ci.FDb.readme.N -inline i32 readme_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:atf_ci.FDb.readmefile.N +inline i32 readmefile_N() __attribute__((__warn_unused_result__, nothrow, pure)); // Remove all elements from Lary -// func:atf_ci.FDb.readme.RemoveAll -void readme_RemoveAll() __attribute__((nothrow)); +// func:atf_ci.FDb.readmefile.RemoveAll +void readmefile_RemoveAll() __attribute__((nothrow)); // Delete last element of array. Do nothing if array is empty. -// func:atf_ci.FDb.readme.RemoveLast -void readme_RemoveLast() __attribute__((nothrow)); +// func:atf_ci.FDb.readmefile.RemoveLast +void readmefile_RemoveLast() __attribute__((nothrow)); // 'quick' Access row by row id. No bounds checking. -// func:atf_ci.FDb.readme.qFind -inline atf_ci::FReadme& readme_qFind(u64 t) __attribute__((nothrow, pure)); +// func:atf_ci.FDb.readmefile.qFind +inline atf_ci::FReadmefile& readmefile_qFind(u64 t) __attribute__((nothrow, pure)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:atf_ci.FDb.readme.XrefMaybe -bool readme_XrefMaybe(atf_ci::FReadme &row); +// func:atf_ci.FDb.readmefile.XrefMaybe +bool readmefile_XrefMaybe(atf_ci::FReadmefile &row); // Allocate memory for new default row. // If out of memory, process is killed. @@ -779,6 +791,9 @@ void ind_builddir_Remove(atf_ci::FBuilddir& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:atf_ci.FDb.ind_builddir.Reserve void ind_builddir_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_ci.FDb.ind_builddir.AbsReserve +void ind_builddir_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -844,6 +859,9 @@ void ind_gitfile_Remove(atf_ci::FGitfile& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:atf_ci.FDb.ind_gitfile.Reserve void ind_gitfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_ci.FDb.ind_gitfile.AbsReserve +void ind_gitfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -989,6 +1007,9 @@ void ind_citest_Remove(atf_ci::FCitest& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:atf_ci.FDb.ind_citest.Reserve void ind_citest_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_ci.FDb.ind_citest.AbsReserve +void ind_citest_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1050,6 +1071,9 @@ void ind_file_Remove(atf_ci::File& row) __attribute__((nothrow)) // Reserve enough room in the hash for N more elements. Return success code. // func:atf_ci.FDb.ind_file.Reserve void ind_file_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_ci.FDb.ind_file.AbsReserve +void ind_file_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1140,17 +1164,17 @@ inline void _db_ns_curs_Next(_db_ns_curs &curs) __attribute__((nothrow) // func:atf_ci.FDb.ns_curs.Access inline atf_ci::FNs& _db_ns_curs_Access(_db_ns_curs &curs) __attribute__((nothrow)); // cursor points to valid item -// func:atf_ci.FDb.readme_curs.Reset -inline void _db_readme_curs_Reset(_db_readme_curs &curs, atf_ci::FDb &parent) __attribute__((nothrow)); +// func:atf_ci.FDb.readmefile_curs.Reset +inline void _db_readmefile_curs_Reset(_db_readmefile_curs &curs, atf_ci::FDb &parent) __attribute__((nothrow)); // cursor points to valid item -// func:atf_ci.FDb.readme_curs.ValidQ -inline bool _db_readme_curs_ValidQ(_db_readme_curs &curs) __attribute__((nothrow)); +// func:atf_ci.FDb.readmefile_curs.ValidQ +inline bool _db_readmefile_curs_ValidQ(_db_readmefile_curs &curs) __attribute__((nothrow)); // proceed to next item -// func:atf_ci.FDb.readme_curs.Next -inline void _db_readme_curs_Next(_db_readme_curs &curs) __attribute__((nothrow)); +// func:atf_ci.FDb.readmefile_curs.Next +inline void _db_readmefile_curs_Next(_db_readmefile_curs &curs) __attribute__((nothrow)); // item access -// func:atf_ci.FDb.readme_curs.Access -inline atf_ci::FReadme& _db_readme_curs_Access(_db_readme_curs &curs) __attribute__((nothrow)); +// func:atf_ci.FDb.readmefile_curs.Access +inline atf_ci::FReadmefile& _db_readmefile_curs_Access(_db_readmefile_curs &curs) __attribute__((nothrow)); // cursor points to valid item // func:atf_ci.FDb.builddir_curs.Reset inline void _db_builddir_curs_Reset(_db_builddir_curs &curs, atf_ci::FDb &parent) __attribute__((nothrow)); @@ -1265,11 +1289,12 @@ struct FExecLimit { // atf_ci.FExecLimit // global access: gitfile (Lary, by rowid) // global access: ind_gitfile (Thash, hash field gitfile) struct FGitfile { // atf_ci.FGitfile - atf_ci::FGitfile* ind_gitfile_next; // hash next - algo::Smallstr200 gitfile; // - atf_ci::FNoindent* c_noindent; // optional pointer - atf_ci::FScriptfile* c_scriptfile; // optional pointer - atf_ci::FTargsrc* c_targsrc; // optional pointer + atf_ci::FGitfile* ind_gitfile_next; // hash next + u32 ind_gitfile_hashval; // hash value + algo::Smallstr200 gitfile; // + atf_ci::FNoindent* c_noindent; // optional pointer + atf_ci::FScriptfile* c_scriptfile; // optional pointer + atf_ci::FTargsrc* c_targsrc; // optional pointer // x-reference on atf_ci.FGitfile.c_noindent prevents copy // x-reference on atf_ci.FGitfile.c_scriptfile prevents copy // x-reference on atf_ci.FGitfile.c_targsrc prevents copy @@ -1392,11 +1417,12 @@ void FNoindent_Uninit(atf_ci::FNoindent& noindent) __attribute__ // global access: ns (Lary, by rowid) // global access: ind_ns (Thash, hash field ns) struct FNs { // atf_ci.FNs - atf_ci::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // + atf_ci::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // // func:atf_ci.FNs..AssignOp inline atf_ci::FNs& operator =(const atf_ci::FNs &rhs) = delete; // func:atf_ci.FNs..CopyCtor @@ -1425,34 +1451,34 @@ inline void FNs_Init(atf_ci::FNs& ns); // func:atf_ci.FNs..Uninit void FNs_Uninit(atf_ci::FNs& ns) __attribute__((nothrow)); -// --- atf_ci.FReadme -// create: atf_ci.FDb.readme (Lary) -// global access: readme (Lary, by rowid) -struct FReadme { // atf_ci.FReadme +// --- atf_ci.FReadmefile +// create: atf_ci.FDb.readmefile (Lary) +// global access: readmefile (Lary, by rowid) +struct FReadmefile { // atf_ci.FReadmefile algo::Smallstr200 gitfile; // bool inl; // false bool sandbox; // false algo::Smallstr100 filter; // algo::Comment comment; // private: - // func:atf_ci.FReadme..Ctor - inline FReadme() __attribute__((nothrow)); - friend atf_ci::FReadme& readme_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend atf_ci::FReadme* readme_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void readme_RemoveAll() __attribute__((nothrow)); - friend void readme_RemoveLast() __attribute__((nothrow)); + // func:atf_ci.FReadmefile..Ctor + inline FReadmefile() __attribute__((nothrow)); + friend atf_ci::FReadmefile& readmefile_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_ci::FReadmefile* readmefile_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void readmefile_RemoveAll() __attribute__((nothrow)); + friend void readmefile_RemoveLast() __attribute__((nothrow)); }; // Copy fields out of row -// func:atf_ci.FReadme.base.CopyOut -void readme_CopyOut(atf_ci::FReadme &row, dev::Readme &out) __attribute__((nothrow)); +// func:atf_ci.FReadmefile.base.CopyOut +void readmefile_CopyOut(atf_ci::FReadmefile &row, dev::Readmefile &out) __attribute__((nothrow)); // Copy fields in to row -// func:atf_ci.FReadme.base.CopyIn -void readme_CopyIn(atf_ci::FReadme &row, dev::Readme &in) __attribute__((nothrow)); +// func:atf_ci.FReadmefile.base.CopyIn +void readmefile_CopyIn(atf_ci::FReadmefile &row, dev::Readmefile &in) __attribute__((nothrow)); // Set all fields to initial values. -// func:atf_ci.FReadme..Init -inline void FReadme_Init(atf_ci::FReadme& readme); +// func:atf_ci.FReadmefile..Init +inline void FReadmefile_Init(atf_ci::FReadmefile& readmefile); // --- atf_ci.FScriptfile // create: atf_ci.FDb.scriptfile (Lary) @@ -1460,10 +1486,11 @@ inline void FReadme_Init(atf_ci::FReadme& readme); // global access: ind_scriptfile (Thash, hash field gitfile) // access: atf_ci.FGitfile.c_scriptfile (Ptr) struct FScriptfile { // atf_ci.FScriptfile - atf_ci::FScriptfile* ind_scriptfile_next; // hash next - algo::Smallstr200 gitfile; // - algo::Smallstr50 license; // - algo::Comment comment; // + atf_ci::FScriptfile* ind_scriptfile_next; // hash next + u32 ind_scriptfile_hashval; // hash value + algo::Smallstr200 gitfile; // + algo::Smallstr50 license; // + algo::Comment comment; // // func:atf_ci.FScriptfile..AssignOp inline atf_ci::FScriptfile& operator =(const atf_ci::FScriptfile &rhs) = delete; // func:atf_ci.FScriptfile..CopyCtor @@ -1500,9 +1527,10 @@ void FScriptfile_Uninit(atf_ci::FScriptfile& scriptfile) __attri // global access: ssimfile (Lary, by rowid) // global access: ind_ssimfile (Thash, hash field ssimfile) struct FSsimfile { // atf_ci.FSsimfile - atf_ci::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // + atf_ci::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // // func:atf_ci.FSsimfile..AssignOp inline atf_ci::FSsimfile& operator =(const atf_ci::FSsimfile &rhs) = delete; // func:atf_ci.FSsimfile..CopyCtor @@ -1639,10 +1667,11 @@ void FieldId_Print(atf_ci::FieldId& row, algo::cstring& str) __a // global access: file (Lary, by rowid) // global access: ind_file (Thash, hash field file) struct File { // atf_ci.File - atf_ci::File* ind_file_next; // hash next - algo::cstring file; // Filename - bool file_exists; // false - bool record_exists; // false + atf_ci::File* ind_file_next; // hash next + u32 ind_file_hashval; // hash value + algo::cstring file; // Filename + bool file_exists; // false + bool record_exists; // false // func:atf_ci.File..AssignOp inline atf_ci::File& operator =(const atf_ci::File &rhs) = delete; // func:atf_ci.File..CopyCtor @@ -1750,11 +1779,11 @@ struct _db_ns_curs {// cursor }; -struct _db_readme_curs {// cursor - typedef atf_ci::FReadme ChildType; +struct _db_readmefile_curs {// cursor + typedef atf_ci::FReadmefile ChildType; atf_ci::FDb *parent; i64 index; - _db_readme_curs(){ parent=NULL; index=0; } + _db_readmefile_curs(){ parent=NULL; index=0; } }; @@ -1828,9 +1857,9 @@ namespace atf_ci { // gen:ns_func // this function is 'extrn' and implemented by user void citest_checkclean(); // User-implemented function from gstatic:atf_ci.FDb.citest -// func:atf_ci...citest_atf_amc +// func:atf_ci...citest_cleantemp // this function is 'extrn' and implemented by user -void citest_atf_amc(); +void citest_cleantemp(); // User-implemented function from gstatic:atf_ci.FDb.citest // func:atf_ci...citest_gitfile // this function is 'extrn' and implemented by user @@ -1840,6 +1869,10 @@ void citest_gitfile(); // this function is 'extrn' and implemented by user void citest_scanreadme(); // User-implemented function from gstatic:atf_ci.FDb.citest +// func:atf_ci...citest_quickreadme +// this function is 'extrn' and implemented by user +void citest_quickreadme(); +// User-implemented function from gstatic:atf_ci.FDb.citest // func:atf_ci...citest_ssimfile // this function is 'extrn' and implemented by user void citest_ssimfile(); @@ -1868,10 +1901,6 @@ void citest_shebang(); // this function is 'extrn' and implemented by user void citest_encoding(); // User-implemented function from gstatic:atf_ci.FDb.citest -// func:atf_ci...citest_readme -// this function is 'extrn' and implemented by user -void citest_readme(); -// User-implemented function from gstatic:atf_ci.FDb.citest // func:atf_ci...citest_file_header // this function is 'extrn' and implemented by user void citest_file_header(); @@ -1896,26 +1925,26 @@ void citest_tempcode(); // this function is 'extrn' and implemented by user void citest_lineendings(); // User-implemented function from gstatic:atf_ci.FDb.citest -// func:atf_ci...citest_indent_script +// func:atf_ci...citest_update_script // this function is 'extrn' and implemented by user -void citest_indent_script(); +void citest_update_script(); // User-implemented function from gstatic:atf_ci.FDb.citest -// func:atf_ci...citest_comptest +// func:atf_ci...citest_indent_script // this function is 'extrn' and implemented by user -void citest_comptest(); +void citest_indent_script(); // User-implemented function from gstatic:atf_ci.FDb.citest // func:atf_ci...citest_cppcheck // this function is 'extrn' and implemented by user void citest_cppcheck(); // User-implemented function from gstatic:atf_ci.FDb.citest -// func:atf_ci...citest_bintests -// this function is 'extrn' and implemented by user -void citest_bintests(); -// User-implemented function from gstatic:atf_ci.FDb.citest // func:atf_ci...citest_indent_srcfile // this function is 'extrn' and implemented by user void citest_indent_srcfile(); // User-implemented function from gstatic:atf_ci.FDb.citest +// func:atf_ci...citest_readme +// this function is 'extrn' and implemented by user +void citest_readme(); +// User-implemented function from gstatic:atf_ci.FDb.citest // func:atf_ci...citest_normalize_amc_vis // this function is 'extrn' and implemented by user void citest_normalize_amc_vis(); @@ -1928,6 +1957,18 @@ void citest_normalize_acr_my(); // this function is 'extrn' and implemented by user void citest_apm_check(); // User-implemented function from gstatic:atf_ci.FDb.citest +// func:atf_ci...citest_atf_amc +// this function is 'extrn' and implemented by user +void citest_atf_amc(); +// User-implemented function from gstatic:atf_ci.FDb.citest +// func:atf_ci...citest_comptest +// this function is 'extrn' and implemented by user +void citest_comptest(); +// User-implemented function from gstatic:atf_ci.FDb.citest +// func:atf_ci...citest_bintests +// this function is 'extrn' and implemented by user +void citest_bintests(); +// User-implemented function from gstatic:atf_ci.FDb.citest // func:atf_ci...citest_atf_unit // this function is 'extrn' and implemented by user void citest_atf_unit(); @@ -1940,14 +1981,6 @@ void citest_atf_comp(); // this function is 'extrn' and implemented by user void citest_atf_comp_cov(); // User-implemented function from gstatic:atf_ci.FDb.citest -// func:atf_ci...citest_apm -// this function is 'extrn' and implemented by user -void citest_apm(); -// User-implemented function from gstatic:atf_ci.FDb.citest -// func:atf_ci...citest_atf_comp_mem -// this function is 'extrn' and implemented by user -void citest_atf_comp_mem(); -// User-implemented function from gstatic:atf_ci.FDb.citest // func:atf_ci...citest_acr_ed_ssimfile // this function is 'extrn' and implemented by user void citest_acr_ed_ssimfile(); @@ -1956,13 +1989,29 @@ void citest_acr_ed_ssimfile(); // this function is 'extrn' and implemented by user void citest_acr_ed_ssimdb(); // User-implemented function from gstatic:atf_ci.FDb.citest -// func:atf_ci...citest_apm_reinstall +// func:atf_ci...citest_acr_ed_unittest // this function is 'extrn' and implemented by user -void citest_apm_reinstall(); +void citest_acr_ed_unittest(); // User-implemented function from gstatic:atf_ci.FDb.citest // func:atf_ci...citest_acr_ed_target // this function is 'extrn' and implemented by user void citest_acr_ed_target(); +// User-implemented function from gstatic:atf_ci.FDb.citest +// func:atf_ci...citest_apm +// this function is 'extrn' and implemented by user +void citest_apm(); +// User-implemented function from gstatic:atf_ci.FDb.citest +// func:atf_ci...citest_apm_reinstall +// this function is 'extrn' and implemented by user +void citest_apm_reinstall(); +// User-implemented function from gstatic:atf_ci.FDb.citest +// func:atf_ci...citest_abt_md_after_ssimfile_is_added +// this function is 'extrn' and implemented by user +void citest_abt_md_after_ssimfile_is_added(); +// User-implemented function from gstatic:atf_ci.FDb.citest +// func:atf_ci...citest_atf_comp_mem +// this function is 'extrn' and implemented by user +void citest_atf_comp_mem(); // func:atf_ci...StaticCheck void StaticCheck(); } // gen:ns_func diff --git a/include/gen/atf_ci_gen.inl.h b/include/gen/atf_ci_gen.inl.h index bd7fb9ed..b7eec492 100644 --- a/include/gen/atf_ci_gen.inl.h +++ b/include/gen/atf_ci_gen.inl.h @@ -34,6 +34,7 @@ // Set all fields to initial values. inline void atf_ci::FBuilddir_Init(atf_ci::FBuilddir& builddir) { builddir.ind_builddir_next = (atf_ci::FBuilddir*)-1; // (atf_ci.FDb.ind_builddir) not-in-hash + builddir.ind_builddir_hashval = 0; // stored hash value } // --- atf_ci.FBuilddir..Ctor @@ -78,6 +79,7 @@ inline void atf_ci::FCitest_Init(atf_ci::FCitest& citest) { citest.nerr = i32(0); citest.step = NULL; citest.ind_citest_next = (atf_ci::FCitest*)-1; // (atf_ci.FDb.ind_citest) not-in-hash + citest.ind_citest_hashval = 0; // stored hash value } // --- atf_ci.FCitest..Ctor @@ -298,46 +300,46 @@ inline i32 atf_ci::ind_ns_N() { return _db.ind_ns_n; } -// --- atf_ci.FDb.readme.EmptyQ +// --- atf_ci.FDb.readmefile.EmptyQ // Return true if index is empty -inline bool atf_ci::readme_EmptyQ() { - return _db.readme_n == 0; +inline bool atf_ci::readmefile_EmptyQ() { + return _db.readmefile_n == 0; } -// --- atf_ci.FDb.readme.Find +// --- atf_ci.FDb.readmefile.Find // Look up row by row id. Return NULL if out of range -inline atf_ci::FReadme* atf_ci::readme_Find(u64 t) { - atf_ci::FReadme *retval = NULL; - if (LIKELY(u64(t) < u64(_db.readme_n))) { +inline atf_ci::FReadmefile* atf_ci::readmefile_Find(u64 t) { + atf_ci::FReadmefile *retval = NULL; + if (LIKELY(u64(t) < u64(_db.readmefile_n))) { u64 x = t + 1; u64 bsr = algo::u64_BitScanReverse(x); u64 base = u64(1)<. +// + + +#pragma once +#include "include/gen/command_gen.h" +#include "include/gen/algo_lib_gen.h" +#include "include/gen/algo_gen.h" +#include "include/gen/ams_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- atf_exp_FieldIdEnum + +enum atf_exp_FieldIdEnum { // atf_exp.FieldId.value + atf_exp_FieldId_value = 0 +}; + +enum { atf_exp_FieldIdEnum_N = 1 }; + + +// --- atf_exp_InCaseEnum + +enum atf_exp_InCaseEnum { // atf_exp.InCase.value + atf_exp_InCase_ams_ProcEofMsg = 703 + ,atf_exp_InCase_ams_ProcKillMsg = 704 + ,atf_exp_InCase_ams_ProcMsg = 701 + ,atf_exp_InCase_ams_ProcReadMsg = 702 + ,atf_exp_InCase_ams_ProcStartMsg = 700 + ,atf_exp_InCase_ams_RemDirRecurseMsg = 633 + ,atf_exp_InCase_ams_TerminateMsg = 352 +}; + +enum { atf_exp_InCaseEnum_N = 7 }; + +namespace atf_exp { // gen:ns_pkeytypedef +} // gen:ns_pkeytypedef +namespace atf_exp { // gen:ns_tclass_field +extern const char *atf_exp_help; +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace atf_exp { struct Proc; } +namespace atf_exp { struct _db_zd_proc_curs; } +namespace atf_exp { struct _db_cd_proc_read_curs; } +namespace atf_exp { struct _db_cd_proc_outflow_curs; } +namespace atf_exp { struct _db_cd_fdin_eof_curs; } +namespace atf_exp { struct _db_cd_fdin_read_curs; } +namespace atf_exp { struct _db_cd_fdin_suspend_curs; } +namespace atf_exp { struct trace; } +namespace atf_exp { struct FDb; } +namespace atf_exp { struct FFdin; } +namespace atf_exp { struct FProc; } +namespace atf_exp { struct FieldId; } +namespace atf_exp { struct InCase; } +namespace atf_exp { extern struct atf_exp::FDb _db; } +namespace atf_exp { // gen:ns_print_struct + +// --- atf_exp.trace +#pragma pack(push,1) +struct trace { // atf_exp.trace + u64 dispatch_In_ProcEofMsg; // 0 Total number of ProcEofMsg processed by atf_exp + u64 dispatch_In_ProcEofMsg_cycles; // 0 + u64 dispatch_In_ProcKillMsg; // 0 Total number of ProcKillMsg processed by atf_exp + u64 dispatch_In_ProcKillMsg_cycles; // 0 + u64 dispatch_In_ProcMsg; // 0 Total number of ProcMsg processed by atf_exp + u64 dispatch_In_ProcMsg_cycles; // 0 + u64 dispatch_In_ProcReadMsg; // 0 Total number of ProcReadMsg processed by atf_exp + u64 dispatch_In_ProcReadMsg_cycles; // 0 + u64 dispatch_In_ProcStartMsg; // 0 Total number of ProcStartMsg processed by atf_exp + u64 dispatch_In_ProcStartMsg_cycles; // 0 + u64 dispatch_In_RemDirRecurseMsg; // 0 Total number of RemDirRecurseMsg processed by atf_exp + u64 dispatch_In_RemDirRecurseMsg_cycles; // 0 + u64 dispatch_In_TerminateMsg; // 0 Total number of TerminateMsg processed by atf_exp + u64 dispatch_In_TerminateMsg_cycles; // 0 + u64 dispatch_In_Unkmsg; // 0 + u64 dispatch_In_Unkmsg_cycles; // 0 + // func:atf_exp.trace..Ctor + inline trace() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Set all fields to initial values. +// func:atf_exp.trace..Init +void trace_Init(atf_exp::trace& parent); +// print string representation of ROW to string STR +// cfmt:atf_exp.trace.String printfmt:Tuple +// func:atf_exp.trace..Print +void trace_Print(atf_exp::trace& row, algo::cstring& str) __attribute__((nothrow)); + +// --- atf_exp.FDb +// create: atf_exp.FDb._db (Global) +struct FDb { // atf_exp.FDb + command::atf_exp cmdline; // + u64 proc_blocksize; // # bytes per block + atf_exp::FProc* proc_free; // + atf_exp::FProc** ind_proc_buckets_elems; // pointer to bucket array + i32 ind_proc_buckets_n; // number of elements in bucket array + i32 ind_proc_n; // number of elements in the hash table + atf_exp::FProc* zd_proc_head; // zero-terminated doubly linked list + i32 zd_proc_n; // zero-terminated doubly linked list + atf_exp::FProc* zd_proc_tail; // pointer to last element + atf_exp::FProc* cd_proc_read_head; // zero-terminated doubly linked list + i32 cd_proc_read_n; // zero-terminated doubly linked list + atf_exp::FProc* cd_proc_outflow_head; // zero-terminated doubly linked list + i32 cd_proc_outflow_n; // zero-terminated doubly linked list + algo_lib::Replscope R; // + atf_exp::FProc** ind_proc_pid_buckets_elems; // pointer to bucket array + i32 ind_proc_pid_buckets_n; // number of elements in bucket array + i32 ind_proc_pid_n; // number of elements in the hash table + algo::SchedTime ind_proc_pid_next; // atf_exp.FDb.ind_proc_pid Next invocation time + algo::SchedTime ind_proc_pid_delay; // atf_exp.FDb.ind_proc_pid Delay between invocations + atf_exp::FProc* c_proc_read; // optional pointer + algo::cstring proc_read_until; // + u64 fdin_blocksize; // # bytes per block + atf_exp::FFdin* fdin_free; // + atf_exp::FFdin* cd_fdin_eof_head; // zero-terminated doubly linked list + i32 cd_fdin_eof_n; // zero-terminated doubly linked list + atf_exp::FFdin* cd_fdin_read_head; // zero-terminated doubly linked list + i32 cd_fdin_read_n; // zero-terminated doubly linked list + atf_exp::FFdin* cd_fdin_suspend_head; // zero-terminated doubly linked list + i32 cd_fdin_suspend_n; // zero-terminated doubly linked list + algo_lib::FTimehook timeout; // + algo_lib::FFildes vars_file; // + atf_exp::trace trace; // +}; + +// Read argc,argv directly into the fields of the command line(s) +// The following fields are updated: +// atf_exp.FDb.cmdline +// algo_lib.FDb.cmdline +// func:atf_exp.FDb._db.ReadArgv +void ReadArgv() __attribute__((nothrow)); +// Main loop. +// func:atf_exp.FDb._db.MainLoop +void MainLoop(); +// Main step +// func:atf_exp.FDb._db.Step +void Step(); +// Main function +// func:atf_exp.FDb._db.Main +// this function is 'extrn' and implemented by user +void Main(); +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +// func:atf_exp.FDb._db.InsertStrptrMaybe +bool InsertStrptrMaybe(algo::strptr str); +// Load all finputs from given directory. +// func:atf_exp.FDb._db.LoadTuplesMaybe +bool LoadTuplesMaybe(algo::strptr root, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +// func:atf_exp.FDb._db.LoadTuplesFile +bool LoadTuplesFile(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file descriptor. +// func:atf_exp.FDb._db.LoadTuplesFd +bool LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load specified ssimfile. +// func:atf_exp.FDb._db.LoadSsimfileMaybe +bool LoadSsimfileMaybe(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Calls Step function of dependencies +// func:atf_exp.FDb._db.Steps +void Steps(); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:atf_exp.FDb._db.XrefMaybe +bool _db_XrefMaybe(); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:atf_exp.FDb.proc.Alloc +atf_exp::FProc& proc_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:atf_exp.FDb.proc.AllocMaybe +atf_exp::FProc* proc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:atf_exp.FDb.proc.InsertMaybe +atf_exp::FProc* proc_InsertMaybe(const atf_exp::Proc &value) __attribute__((nothrow)); +// Remove row from all global and cross indices, then deallocate row +// func:atf_exp.FDb.proc.Delete +void proc_Delete(atf_exp::FProc &row) __attribute__((nothrow)); +// Allocate space for one element +// If no memory available, return NULL. +// func:atf_exp.FDb.proc.AllocMem +void* proc_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Remove mem from all global and cross indices, then deallocate mem +// func:atf_exp.FDb.proc.FreeMem +void proc_FreeMem(atf_exp::FProc &row) __attribute__((nothrow)); +// Preallocate memory for N more elements +// Return number of elements actually reserved. +// func:atf_exp.FDb.proc.Reserve +u64 proc_Reserve(u64 n_elems) __attribute__((nothrow)); +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +// func:atf_exp.FDb.proc.ReserveMem +u64 proc_ReserveMem(u64 size) __attribute__((nothrow)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:atf_exp.FDb.proc.XrefMaybe +bool proc_XrefMaybe(atf_exp::FProc &row); + +// Return true if hash is empty +// func:atf_exp.FDb.ind_proc.EmptyQ +inline bool ind_proc_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:atf_exp.FDb.ind_proc.Find +atf_exp::FProc* ind_proc_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:atf_exp.FDb.ind_proc.FindX +atf_exp::FProc& ind_proc_FindX(const algo::strptr& key); +// Find row by key. If not found, create and x-reference a new row with with this key. +// func:atf_exp.FDb.ind_proc.GetOrCreate +atf_exp::FProc& ind_proc_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); +// Return number of items in the hash +// func:atf_exp.FDb.ind_proc.N +inline i32 ind_proc_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:atf_exp.FDb.ind_proc.InsertMaybe +bool ind_proc_InsertMaybe(atf_exp::FProc& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:atf_exp.FDb.ind_proc.Remove +void ind_proc_Remove(atf_exp::FProc& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:atf_exp.FDb.ind_proc.Reserve +void ind_proc_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_exp.FDb.ind_proc.AbsReserve +void ind_proc_AbsReserve(int n) __attribute__((nothrow)); + +// Return true if index is empty +// func:atf_exp.FDb.zd_proc.EmptyQ +inline bool zd_proc_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:atf_exp.FDb.zd_proc.First +inline atf_exp::FProc* zd_proc_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:atf_exp.FDb.zd_proc.InLlistQ +inline bool zd_proc_InLlistQ(atf_exp::FProc& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:atf_exp.FDb.zd_proc.Insert +void zd_proc_Insert(atf_exp::FProc& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:atf_exp.FDb.zd_proc.Last +inline atf_exp::FProc* zd_proc_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return number of items in the linked list +// func:atf_exp.FDb.zd_proc.N +inline i32 zd_proc_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:atf_exp.FDb.zd_proc.Next +inline atf_exp::FProc* zd_proc_Next(atf_exp::FProc &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:atf_exp.FDb.zd_proc.Prev +inline atf_exp::FProc* zd_proc_Prev(atf_exp::FProc &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:atf_exp.FDb.zd_proc.Remove +void zd_proc_Remove(atf_exp::FProc& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:atf_exp.FDb.zd_proc.RemoveAll +void zd_proc_RemoveAll() __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// func:atf_exp.FDb.zd_proc.RemoveFirst +atf_exp::FProc* zd_proc_RemoveFirst() __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:atf_exp.FDb.zd_proc.qLast +inline atf_exp::FProc& zd_proc_qLast() __attribute__((__warn_unused_result__, nothrow)); + +// Return true if index is empty +// func:atf_exp.FDb.cd_proc_read.EmptyQ +inline bool cd_proc_read_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:atf_exp.FDb.cd_proc_read.First +inline atf_exp::FProc* cd_proc_read_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:atf_exp.FDb.cd_proc_read.InLlistQ +inline bool cd_proc_read_InLlistQ(atf_exp::FProc& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:atf_exp.FDb.cd_proc_read.Insert +void cd_proc_read_Insert(atf_exp::FProc& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:atf_exp.FDb.cd_proc_read.Last +inline atf_exp::FProc* cd_proc_read_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return number of items in the linked list +// func:atf_exp.FDb.cd_proc_read.N +inline i32 cd_proc_read_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:atf_exp.FDb.cd_proc_read.Next +inline atf_exp::FProc* cd_proc_read_Next(atf_exp::FProc &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:atf_exp.FDb.cd_proc_read.Prev +inline atf_exp::FProc* cd_proc_read_Prev(atf_exp::FProc &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:atf_exp.FDb.cd_proc_read.Remove +void cd_proc_read_Remove(atf_exp::FProc& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:atf_exp.FDb.cd_proc_read.RemoveAll +void cd_proc_read_RemoveAll() __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// Call FirstChanged trigger. +// func:atf_exp.FDb.cd_proc_read.RemoveFirst +atf_exp::FProc* cd_proc_read_RemoveFirst() __attribute__((nothrow)); +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +// func:atf_exp.FDb.cd_proc_read.RotateFirst +atf_exp::FProc* cd_proc_read_RotateFirst() __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:atf_exp.FDb.cd_proc_read.qLast +inline atf_exp::FProc& cd_proc_read_qLast() __attribute__((__warn_unused_result__, nothrow)); +// func:atf_exp.FDb.cd_proc_read.Step +// this function is 'extrn' and implemented by user +void cd_proc_read_Step() __attribute__((nothrow)); + +// Return true if index is empty +// func:atf_exp.FDb.cd_proc_outflow.EmptyQ +inline bool cd_proc_outflow_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:atf_exp.FDb.cd_proc_outflow.First +inline atf_exp::FProc* cd_proc_outflow_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:atf_exp.FDb.cd_proc_outflow.InLlistQ +inline bool cd_proc_outflow_InLlistQ(atf_exp::FProc& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:atf_exp.FDb.cd_proc_outflow.Insert +void cd_proc_outflow_Insert(atf_exp::FProc& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:atf_exp.FDb.cd_proc_outflow.Last +inline atf_exp::FProc* cd_proc_outflow_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return number of items in the linked list +// func:atf_exp.FDb.cd_proc_outflow.N +inline i32 cd_proc_outflow_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:atf_exp.FDb.cd_proc_outflow.Next +inline atf_exp::FProc* cd_proc_outflow_Next(atf_exp::FProc &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:atf_exp.FDb.cd_proc_outflow.Prev +inline atf_exp::FProc* cd_proc_outflow_Prev(atf_exp::FProc &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:atf_exp.FDb.cd_proc_outflow.Remove +void cd_proc_outflow_Remove(atf_exp::FProc& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:atf_exp.FDb.cd_proc_outflow.RemoveAll +void cd_proc_outflow_RemoveAll() __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// Call FirstChanged trigger. +// func:atf_exp.FDb.cd_proc_outflow.RemoveFirst +atf_exp::FProc* cd_proc_outflow_RemoveFirst() __attribute__((nothrow)); +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +// func:atf_exp.FDb.cd_proc_outflow.RotateFirst +atf_exp::FProc* cd_proc_outflow_RotateFirst() __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:atf_exp.FDb.cd_proc_outflow.qLast +inline atf_exp::FProc& cd_proc_outflow_qLast() __attribute__((__warn_unused_result__, nothrow)); +// func:atf_exp.FDb.cd_proc_outflow.Step +// this function is 'extrn' and implemented by user +void cd_proc_outflow_Step() __attribute__((nothrow)); + +// Return true if hash is empty +// func:atf_exp.FDb.ind_proc_pid.EmptyQ +inline bool ind_proc_pid_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:atf_exp.FDb.ind_proc_pid.Find +atf_exp::FProc* ind_proc_pid_Find(i32 key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:atf_exp.FDb.ind_proc_pid.FindX +atf_exp::FProc& ind_proc_pid_FindX(i32 key); +// Return number of items in the hash +// func:atf_exp.FDb.ind_proc_pid.N +inline i32 ind_proc_pid_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:atf_exp.FDb.ind_proc_pid.InsertMaybe +bool ind_proc_pid_InsertMaybe(atf_exp::FProc& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:atf_exp.FDb.ind_proc_pid.Remove +void ind_proc_pid_Remove(atf_exp::FProc& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:atf_exp.FDb.ind_proc_pid.Reserve +void ind_proc_pid_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_exp.FDb.ind_proc_pid.AbsReserve +void ind_proc_pid_AbsReserve(int n) __attribute__((nothrow)); +// func:atf_exp.FDb.ind_proc_pid.Step +// this function is 'extrn' and implemented by user +void ind_proc_pid_Step() __attribute__((nothrow)); +// Set inter-step delay to specified value. +// The difference between new delay and current delay is added to the next scheduled time. +// func:atf_exp.FDb.ind_proc_pid.SetDelay +void ind_proc_pid_SetDelay(algo::SchedTime delay) __attribute__((nothrow)); + +// Insert row into pointer index. Return final membership status. +// func:atf_exp.FDb.c_proc_read.InsertMaybe +inline bool c_proc_read_InsertMaybe(atf_exp::FProc& row) __attribute__((nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:atf_exp.FDb.c_proc_read.Remove +inline void c_proc_read_Remove(atf_exp::FProc& row) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:atf_exp.FDb.fdin.Alloc +atf_exp::FFdin& fdin_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:atf_exp.FDb.fdin.AllocMaybe +atf_exp::FFdin* fdin_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Remove row from all global and cross indices, then deallocate row +// func:atf_exp.FDb.fdin.Delete +void fdin_Delete(atf_exp::FFdin &row) __attribute__((nothrow)); +// Allocate space for one element +// If no memory available, return NULL. +// func:atf_exp.FDb.fdin.AllocMem +void* fdin_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Remove mem from all global and cross indices, then deallocate mem +// func:atf_exp.FDb.fdin.FreeMem +void fdin_FreeMem(atf_exp::FFdin &row) __attribute__((nothrow)); +// Preallocate memory for N more elements +// Return number of elements actually reserved. +// func:atf_exp.FDb.fdin.Reserve +u64 fdin_Reserve(u64 n_elems) __attribute__((nothrow)); +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +// func:atf_exp.FDb.fdin.ReserveMem +u64 fdin_ReserveMem(u64 size) __attribute__((nothrow)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:atf_exp.FDb.fdin.XrefMaybe +bool fdin_XrefMaybe(atf_exp::FFdin &row); + +// Return true if index is empty +// func:atf_exp.FDb.cd_fdin_eof.EmptyQ +inline bool cd_fdin_eof_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:atf_exp.FDb.cd_fdin_eof.First +inline atf_exp::FFdin* cd_fdin_eof_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:atf_exp.FDb.cd_fdin_eof.InLlistQ +inline bool cd_fdin_eof_InLlistQ(atf_exp::FFdin& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:atf_exp.FDb.cd_fdin_eof.Insert +void cd_fdin_eof_Insert(atf_exp::FFdin& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:atf_exp.FDb.cd_fdin_eof.Last +inline atf_exp::FFdin* cd_fdin_eof_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return number of items in the linked list +// func:atf_exp.FDb.cd_fdin_eof.N +inline i32 cd_fdin_eof_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:atf_exp.FDb.cd_fdin_eof.Next +inline atf_exp::FFdin* cd_fdin_eof_Next(atf_exp::FFdin &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:atf_exp.FDb.cd_fdin_eof.Prev +inline atf_exp::FFdin* cd_fdin_eof_Prev(atf_exp::FFdin &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:atf_exp.FDb.cd_fdin_eof.Remove +void cd_fdin_eof_Remove(atf_exp::FFdin& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:atf_exp.FDb.cd_fdin_eof.RemoveAll +void cd_fdin_eof_RemoveAll() __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// Call FirstChanged trigger. +// func:atf_exp.FDb.cd_fdin_eof.RemoveFirst +atf_exp::FFdin* cd_fdin_eof_RemoveFirst() __attribute__((nothrow)); +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +// func:atf_exp.FDb.cd_fdin_eof.RotateFirst +atf_exp::FFdin* cd_fdin_eof_RotateFirst() __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:atf_exp.FDb.cd_fdin_eof.qLast +inline atf_exp::FFdin& cd_fdin_eof_qLast() __attribute__((__warn_unused_result__, nothrow)); +// func:atf_exp.FDb.cd_fdin_eof.Step +// this function is 'extrn' and implemented by user +void cd_fdin_eof_Step() __attribute__((nothrow)); + +// Return true if index is empty +// func:atf_exp.FDb.cd_fdin_read.EmptyQ +inline bool cd_fdin_read_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:atf_exp.FDb.cd_fdin_read.First +inline atf_exp::FFdin* cd_fdin_read_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:atf_exp.FDb.cd_fdin_read.InLlistQ +inline bool cd_fdin_read_InLlistQ(atf_exp::FFdin& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:atf_exp.FDb.cd_fdin_read.Insert +void cd_fdin_read_Insert(atf_exp::FFdin& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:atf_exp.FDb.cd_fdin_read.Last +inline atf_exp::FFdin* cd_fdin_read_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return number of items in the linked list +// func:atf_exp.FDb.cd_fdin_read.N +inline i32 cd_fdin_read_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:atf_exp.FDb.cd_fdin_read.Next +inline atf_exp::FFdin* cd_fdin_read_Next(atf_exp::FFdin &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:atf_exp.FDb.cd_fdin_read.Prev +inline atf_exp::FFdin* cd_fdin_read_Prev(atf_exp::FFdin &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:atf_exp.FDb.cd_fdin_read.Remove +void cd_fdin_read_Remove(atf_exp::FFdin& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:atf_exp.FDb.cd_fdin_read.RemoveAll +void cd_fdin_read_RemoveAll() __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// Call FirstChanged trigger. +// func:atf_exp.FDb.cd_fdin_read.RemoveFirst +atf_exp::FFdin* cd_fdin_read_RemoveFirst() __attribute__((nothrow)); +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +// func:atf_exp.FDb.cd_fdin_read.RotateFirst +atf_exp::FFdin* cd_fdin_read_RotateFirst() __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:atf_exp.FDb.cd_fdin_read.qLast +inline atf_exp::FFdin& cd_fdin_read_qLast() __attribute__((__warn_unused_result__, nothrow)); +// func:atf_exp.FDb.cd_fdin_read.Step +// this function is 'extrn' and implemented by user +void cd_fdin_read_Step() __attribute__((nothrow)); + +// Return true if index is empty +// func:atf_exp.FDb.cd_fdin_suspend.EmptyQ +inline bool cd_fdin_suspend_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:atf_exp.FDb.cd_fdin_suspend.First +inline atf_exp::FFdin* cd_fdin_suspend_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:atf_exp.FDb.cd_fdin_suspend.InLlistQ +inline bool cd_fdin_suspend_InLlistQ(atf_exp::FFdin& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:atf_exp.FDb.cd_fdin_suspend.Insert +void cd_fdin_suspend_Insert(atf_exp::FFdin& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:atf_exp.FDb.cd_fdin_suspend.Last +inline atf_exp::FFdin* cd_fdin_suspend_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return number of items in the linked list +// func:atf_exp.FDb.cd_fdin_suspend.N +inline i32 cd_fdin_suspend_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:atf_exp.FDb.cd_fdin_suspend.Next +inline atf_exp::FFdin* cd_fdin_suspend_Next(atf_exp::FFdin &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:atf_exp.FDb.cd_fdin_suspend.Prev +inline atf_exp::FFdin* cd_fdin_suspend_Prev(atf_exp::FFdin &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:atf_exp.FDb.cd_fdin_suspend.Remove +void cd_fdin_suspend_Remove(atf_exp::FFdin& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:atf_exp.FDb.cd_fdin_suspend.RemoveAll +void cd_fdin_suspend_RemoveAll() __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// func:atf_exp.FDb.cd_fdin_suspend.RemoveFirst +atf_exp::FFdin* cd_fdin_suspend_RemoveFirst() __attribute__((nothrow)); +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +// func:atf_exp.FDb.cd_fdin_suspend.RotateFirst +atf_exp::FFdin* cd_fdin_suspend_RotateFirst() __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:atf_exp.FDb.cd_fdin_suspend.qLast +inline atf_exp::FFdin& cd_fdin_suspend_qLast() __attribute__((__warn_unused_result__, nothrow)); + +// cursor points to valid item +// func:atf_exp.FDb.zd_proc_curs.Reset +inline void _db_zd_proc_curs_Reset(_db_zd_proc_curs &curs, atf_exp::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_exp.FDb.zd_proc_curs.ValidQ +inline bool _db_zd_proc_curs_ValidQ(_db_zd_proc_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_exp.FDb.zd_proc_curs.Next +inline void _db_zd_proc_curs_Next(_db_zd_proc_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_exp.FDb.zd_proc_curs.Access +inline atf_exp::FProc& _db_zd_proc_curs_Access(_db_zd_proc_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_exp.FDb.cd_proc_read_curs.Reset +inline void _db_cd_proc_read_curs_Reset(_db_cd_proc_read_curs &curs, atf_exp::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_exp.FDb.cd_proc_read_curs.ValidQ +inline bool _db_cd_proc_read_curs_ValidQ(_db_cd_proc_read_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_exp.FDb.cd_proc_read_curs.Next +inline void _db_cd_proc_read_curs_Next(_db_cd_proc_read_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_exp.FDb.cd_proc_read_curs.Access +inline atf_exp::FProc& _db_cd_proc_read_curs_Access(_db_cd_proc_read_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_exp.FDb.cd_proc_outflow_curs.Reset +inline void _db_cd_proc_outflow_curs_Reset(_db_cd_proc_outflow_curs &curs, atf_exp::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_exp.FDb.cd_proc_outflow_curs.ValidQ +inline bool _db_cd_proc_outflow_curs_ValidQ(_db_cd_proc_outflow_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_exp.FDb.cd_proc_outflow_curs.Next +inline void _db_cd_proc_outflow_curs_Next(_db_cd_proc_outflow_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_exp.FDb.cd_proc_outflow_curs.Access +inline atf_exp::FProc& _db_cd_proc_outflow_curs_Access(_db_cd_proc_outflow_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_exp.FDb.cd_fdin_eof_curs.Reset +inline void _db_cd_fdin_eof_curs_Reset(_db_cd_fdin_eof_curs &curs, atf_exp::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_exp.FDb.cd_fdin_eof_curs.ValidQ +inline bool _db_cd_fdin_eof_curs_ValidQ(_db_cd_fdin_eof_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_exp.FDb.cd_fdin_eof_curs.Next +inline void _db_cd_fdin_eof_curs_Next(_db_cd_fdin_eof_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_exp.FDb.cd_fdin_eof_curs.Access +inline atf_exp::FFdin& _db_cd_fdin_eof_curs_Access(_db_cd_fdin_eof_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_exp.FDb.cd_fdin_read_curs.Reset +inline void _db_cd_fdin_read_curs_Reset(_db_cd_fdin_read_curs &curs, atf_exp::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_exp.FDb.cd_fdin_read_curs.ValidQ +inline bool _db_cd_fdin_read_curs_ValidQ(_db_cd_fdin_read_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_exp.FDb.cd_fdin_read_curs.Next +inline void _db_cd_fdin_read_curs_Next(_db_cd_fdin_read_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_exp.FDb.cd_fdin_read_curs.Access +inline atf_exp::FFdin& _db_cd_fdin_read_curs_Access(_db_cd_fdin_read_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_exp.FDb.cd_fdin_suspend_curs.Reset +inline void _db_cd_fdin_suspend_curs_Reset(_db_cd_fdin_suspend_curs &curs, atf_exp::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:atf_exp.FDb.cd_fdin_suspend_curs.ValidQ +inline bool _db_cd_fdin_suspend_curs_ValidQ(_db_cd_fdin_suspend_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:atf_exp.FDb.cd_fdin_suspend_curs.Next +inline void _db_cd_fdin_suspend_curs_Next(_db_cd_fdin_suspend_curs &curs) __attribute__((nothrow)); +// item access +// func:atf_exp.FDb.cd_fdin_suspend_curs.Access +inline atf_exp::FFdin& _db_cd_fdin_suspend_curs_Access(_db_cd_fdin_suspend_curs &curs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:atf_exp.FDb..Init +void FDb_Init(); +// func:atf_exp.FDb..Uninit +void FDb_Uninit() __attribute__((nothrow)); + +// --- atf_exp.FFdin +// create: atf_exp.FDb.fdin (Tpool) +// global access: cd_fdin_eof (Llist) +// global access: cd_fdin_read (Llist) +// global access: cd_fdin_suspend (Llist) +struct FFdin { // atf_exp.FFdin: FD input (normally stdin) + atf_exp::FFdin* fdin_next; // Pointer to next free element int tpool + atf_exp::FFdin* cd_fdin_eof_next; // zslist link; -1 means not-in-list + atf_exp::FFdin* cd_fdin_eof_prev; // previous element + atf_exp::FFdin* cd_fdin_read_next; // zslist link; -1 means not-in-list + atf_exp::FFdin* cd_fdin_read_prev; // previous element + atf_exp::FFdin* cd_fdin_suspend_next; // zslist link; -1 means not-in-list + atf_exp::FFdin* cd_fdin_suspend_prev; // previous element + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array + i32 in_start; // beginning of valid bytes (in bytes) + i32 in_end; // end of valid bytes (in bytes) + i32 in_msglen; // current message length + algo::Errcode in_err; // system error code + algo_lib::FIohook in_iohook; // edge-triggered hook for the buffer + bool in_eof; // no more data will be written to buffer + bool in_msgvalid; // current message is valid + bool in_epoll_enable; // use epoll? + // field atf_exp.FFdin.in prevents copy + // func:atf_exp.FFdin..AssignOp + inline atf_exp::FFdin& operator =(const atf_exp::FFdin &rhs) = delete; + // field atf_exp.FFdin.in prevents copy + // func:atf_exp.FFdin..CopyCtor + inline FFdin(const atf_exp::FFdin &rhs) = delete; +private: + // func:atf_exp.FFdin..Ctor + inline FFdin() __attribute__((nothrow)); + // func:atf_exp.FFdin..Dtor + inline ~FFdin() __attribute__((nothrow)); + friend atf_exp::FFdin& fdin_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_exp::FFdin* fdin_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void fdin_Delete(atf_exp::FFdin &row) __attribute__((nothrow)); +}; + +// Attach fbuf to Iohook for reading +// Attach file descriptor and begin reading using edge-triggered epoll. +// File descriptor becomes owned by atf_exp::FFdin.in via FIohook field. +// Whenever the file descriptor becomes readable, insert fdin into cd_fdin_read. +// func:atf_exp.FFdin.in.BeginRead +void in_BeginRead(atf_exp::FFdin& fdin, algo::Fildes fd) __attribute__((nothrow)); +// Set EOF flag +// func:atf_exp.FFdin.in.EndRead +void in_EndRead(atf_exp::FFdin& fdin) __attribute__((nothrow)); +// Detect incoming message in buffer and return it +// Look for valid message at current position in the buffer. +// If message is already there, return a pointer to it. Do not skip message (call SkipMsg to do that). +// If there is no message, read once from underlying file descriptor and try again. +// The message is found by looking for delimiter '\n'. +// The return value is an aryptr. If ret.elems is non-NULL, the message is valid (possibly empty). +// If ret.elems is NULL, no message can be extracted from buffer. +// The returned aryptr excludes the trailing deliminter. +// SkipMsg will skip both the line and the deliminter. +// A partial line at the end of input is NOT returned (TODO?) +// +// func:atf_exp.FFdin.in.GetMsg +algo::aryptr in_GetMsg(atf_exp::FFdin& fdin) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:atf_exp.FFdin.in.Realloc +void in_Realloc(atf_exp::FFdin& fdin, int new_max) __attribute__((nothrow)); +// Return max. number of bytes in the buffer. +// func:atf_exp.FFdin.in.Max +inline i32 in_Max(atf_exp::FFdin& fdin) __attribute__((nothrow)); +// Return number of bytes in the buffer. +// func:atf_exp.FFdin.in.N +inline i32 in_N(atf_exp::FFdin& fdin) __attribute__((__warn_unused_result__, nothrow, pure)); +// Refill buffer. Return false if no further refill possible (input buffer exhausted) +// func:atf_exp.FFdin.in.Refill +bool in_Refill(atf_exp::FFdin& fdin) __attribute__((nothrow)); +// Empty bfufer +// Discard contents of the buffer. +// func:atf_exp.FFdin.in.RemoveAll +void in_RemoveAll(atf_exp::FFdin& fdin) __attribute__((nothrow)); +// Skip N bytes when reading +// Mark some buffer contents as read. +// +// func:atf_exp.FFdin.in.SkipBytes +void in_SkipBytes(atf_exp::FFdin& fdin, int n) __attribute__((nothrow)); +// Skip current message, if any +// Skip current message, if any. +// func:atf_exp.FFdin.in.SkipMsg +void in_SkipMsg(atf_exp::FFdin& fdin) __attribute__((nothrow)); +// Attempt to write buffer contents to fbuf, return success +// Write bytes to the buffer. If the entire block is written, return true, +// Otherwise return false. +// Bytes in the buffer are potentially shifted left to make room for the message. +// +// func:atf_exp.FFdin.in.WriteAll +bool in_WriteAll(atf_exp::FFdin& fdin, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:atf_exp.FFdin.in.WriteReserve +void in_WriteReserve(atf_exp::FFdin& fdin, u8 *in, i32 in_n) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:atf_exp.FFdin..Init +void FFdin_Init(atf_exp::FFdin& fdin); +// func:atf_exp.FFdin..Uninit +void FFdin_Uninit(atf_exp::FFdin& fdin) __attribute__((nothrow)); + +// --- atf_exp.FProc +// create: atf_exp.FDb.proc (Tpool) +// global access: ind_proc (Thash, hash field proc) +// global access: zd_proc (Llist) +// global access: cd_proc_read (Llist) +// global access: cd_proc_outflow (Llist) +// global access: ind_proc_pid (Thash, hash field pid) +// global access: c_proc_read (Ptr) +struct FProc { // atf_exp.FProc + atf_exp::FProc* proc_next; // Pointer to next free element int tpool + atf_exp::FProc* ind_proc_next; // hash next + u32 ind_proc_hashval; // hash value + atf_exp::FProc* zd_proc_next; // zslist link; -1 means not-in-list + atf_exp::FProc* zd_proc_prev; // previous element + atf_exp::FProc* cd_proc_read_next; // zslist link; -1 means not-in-list + atf_exp::FProc* cd_proc_read_prev; // previous element + atf_exp::FProc* cd_proc_outflow_next; // zslist link; -1 means not-in-list + atf_exp::FProc* cd_proc_outflow_prev; // previous element + atf_exp::FProc* ind_proc_pid_next; // hash next + u32 ind_proc_pid_hashval; // hash value + algo::Smallstr50 proc; // + command::bash_proc bash; // + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array + i32 in_start; // beginning of valid bytes (in bytes) + i32 in_end; // end of valid bytes (in bytes) + i32 in_msglen; // current message length + algo::Errcode in_err; // system error code + algo_lib::FIohook in_iohook; // edge-triggered hook for the buffer + bool in_eof; // no more data will be written to buffer + bool in_msgvalid; // current message is valid + bool in_epoll_enable; // use epoll? + u8* out_elems; // NULL pointer to elements of indirect array + u32 out_max; // 0 current length of allocated array + i32 out_start; // beginning of valid bytes (in bytes) + i32 out_end; // end of valid bytes (in bytes) + i32 out_msglen; // current message length + algo::Errcode out_err; // system error code + algo_lib::FIohook out_iohook; // edge-triggered hook for the buffer + u64 out_n_eagain; // eagain counter + bool out_eof; // no more data will be written to buffer + bool out_msgvalid; // current message is valid + bool out_epoll_enable; // use epoll? + bool out_zerocopy; // support zero-copy optimization + i32 pid; // 0 + bool out_delay_close; // false + algo::ByteAry output; // + bool wait; // false + // value field atf_exp.FProc.bash is not copiable + // field atf_exp.FProc.in prevents copy + // field atf_exp.FProc.out prevents copy + // func:atf_exp.FProc..AssignOp + inline atf_exp::FProc& operator =(const atf_exp::FProc &rhs) = delete; + // value field atf_exp.FProc.bash is not copiable + // field atf_exp.FProc.in prevents copy + // field atf_exp.FProc.out prevents copy + // func:atf_exp.FProc..CopyCtor + inline FProc(const atf_exp::FProc &rhs) = delete; +private: + // func:atf_exp.FProc..Ctor + inline FProc() __attribute__((nothrow)); + // func:atf_exp.FProc..Dtor + inline ~FProc() __attribute__((nothrow)); + friend atf_exp::FProc& proc_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_exp::FProc* proc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void proc_Delete(atf_exp::FProc &row) __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:atf_exp.FProc.base.CopyOut +void proc_CopyOut(atf_exp::FProc &row, atf_exp::Proc &out) __attribute__((nothrow)); +// Copy fields in to row +// func:atf_exp.FProc.base.CopyIn +void proc_CopyIn(atf_exp::FProc &row, atf_exp::Proc &in) __attribute__((nothrow)); + +// Attach fbuf to Iohook for reading +// Attach file descriptor and begin reading using edge-triggered epoll. +// File descriptor becomes owned by atf_exp::FProc.in via FIohook field. +// Whenever the file descriptor becomes readable, insert proc into cd_proc_read. +// func:atf_exp.FProc.in.BeginRead +void in_BeginRead(atf_exp::FProc& proc, algo::Fildes fd) __attribute__((nothrow)); +// Set EOF flag +// func:atf_exp.FProc.in.EndRead +void in_EndRead(atf_exp::FProc& proc) __attribute__((nothrow)); +// Detect incoming message in buffer and return it +// Look for valid message at current position in the buffer. +// If message is already there, return a pointer to it. Do not skip message (call SkipMsg to do that). +// If there is no message, read once from underlying file descriptor and try again. +// The message is found by looking for delimiter '\n'. +// The return value is an aryptr. If ret.elems is non-NULL, the message is valid (possibly empty). +// If ret.elems is NULL, no message can be extracted from buffer. +// The returned aryptr excludes the trailing deliminter. +// SkipMsg will skip both the line and the deliminter. +// A partial line at the end of input is NOT returned (TODO?) +// +// func:atf_exp.FProc.in.GetMsg +algo::aryptr in_GetMsg(atf_exp::FProc& proc) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:atf_exp.FProc.in.Realloc +void in_Realloc(atf_exp::FProc& proc, int new_max) __attribute__((nothrow)); +// Return max. number of bytes in the buffer. +// func:atf_exp.FProc.in.Max +inline i32 in_Max(atf_exp::FProc& proc) __attribute__((nothrow)); +// Return number of bytes in the buffer. +// func:atf_exp.FProc.in.N +inline i32 in_N(atf_exp::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); +// Refill buffer. Return false if no further refill possible (input buffer exhausted) +// func:atf_exp.FProc.in.Refill +bool in_Refill(atf_exp::FProc& proc) __attribute__((nothrow)); +// Empty bfufer +// Discard contents of the buffer. +// func:atf_exp.FProc.in.RemoveAll +void in_RemoveAll(atf_exp::FProc& proc) __attribute__((nothrow)); +// Skip N bytes when reading +// Mark some buffer contents as read. +// +// func:atf_exp.FProc.in.SkipBytes +void in_SkipBytes(atf_exp::FProc& proc, int n) __attribute__((nothrow)); +// Skip current message, if any +// Skip current message, if any. +// func:atf_exp.FProc.in.SkipMsg +void in_SkipMsg(atf_exp::FProc& proc) __attribute__((nothrow)); +// Attempt to write buffer contents to fbuf, return success +// Write bytes to the buffer. If the entire block is written, return true, +// Otherwise return false. +// Bytes in the buffer are potentially shifted left to make room for the message. +// +// func:atf_exp.FProc.in.WriteAll +bool in_WriteAll(atf_exp::FProc& proc, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:atf_exp.FProc.in.WriteReserve +void in_WriteReserve(atf_exp::FProc& proc, u8 *in, i32 in_n) __attribute__((nothrow)); + +// Send zero-byte write +// func:atf_exp.FProc.out.EndWrite +void out_EndWrite(atf_exp::FProc& proc) __attribute__((nothrow)); +// Attach fbuf to Iohook for writing +// Attach file descriptor and begin outflowing buffer reading using edge-triggered epoll. +// Whenever buffer is non-empty and fd is writable, insert proc into cd_proc_outflow. +// User should implement a step function that calls out_Outflow. +// func:atf_exp.FProc.out.BeginWrite +void out_BeginWrite(atf_exp::FProc& proc, algo::Fildes fd, bool nodelete) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:atf_exp.FProc.out.Realloc +void out_Realloc(atf_exp::FProc& proc, int new_max) __attribute__((nothrow)); +// Return max. number of bytes in the buffer. +// func:atf_exp.FProc.out.Max +inline i32 out_Max(atf_exp::FProc& proc) __attribute__((nothrow)); +// Return number of bytes in the buffer. +// func:atf_exp.FProc.out.N +inline i32 out_N(atf_exp::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); +// Transfer bytes from buffer to fd using write() +// Once all bytes are written or when fd buffer is full, buffer is automatically removed from cd_proc_outflow list. +// Edge-triggered epoll will re-insert out into cd_proc_outflow. +// func:atf_exp.FProc.out.Outflow +bool out_Outflow(atf_exp::FProc& proc) __attribute__((nothrow)); +// Empty bfufer +// Discard contents of the buffer. +// func:atf_exp.FProc.out.RemoveAll +void out_RemoveAll(atf_exp::FProc& proc) __attribute__((nothrow)); +// Skip N bytes when reading +// Mark some buffer contents as read. +// +// func:atf_exp.FProc.out.SkipBytes +void out_SkipBytes(atf_exp::FProc& proc, int n) __attribute__((nothrow)); +// Skip current message, if any +// Skip current message, if any. +// func:atf_exp.FProc.out.SkipMsg +void out_SkipMsg(atf_exp::FProc& proc) __attribute__((nothrow)); +// Attempt to write buffer contents to fbuf, return success +// Write bytes to the buffer. If the entire block is written, return true, +// Otherwise return false. +// Bytes in the buffer are potentially shifted left to make room for the message. +// +// func:atf_exp.FProc.out.WriteAll +bool out_WriteAll(atf_exp::FProc& proc, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:atf_exp.FProc.out.WriteReserve +void out_WriteReserve(atf_exp::FProc& proc, u8 *in, i32 in_n) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:atf_exp.FProc..Init +void FProc_Init(atf_exp::FProc& proc); +// func:atf_exp.FProc..Uninit +void FProc_Uninit(atf_exp::FProc& proc) __attribute__((nothrow)); + +// --- atf_exp.FieldId +#pragma pack(push,1) +struct FieldId { // atf_exp.FieldId: Field read helper + i32 value; // -1 + // func:atf_exp.FieldId.value.Cast + inline operator atf_exp_FieldIdEnum() const __attribute__((nothrow)); + // func:atf_exp.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:atf_exp.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:atf_exp.FieldId..EnumCtor + inline FieldId(atf_exp_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:atf_exp.FieldId.value.GetEnum +inline atf_exp_FieldIdEnum value_GetEnum(const atf_exp::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:atf_exp.FieldId.value.SetEnum +inline void value_SetEnum(atf_exp::FieldId& parent, atf_exp_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:atf_exp.FieldId.value.ToCstr +const char* value_ToCstr(const atf_exp::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:atf_exp.FieldId.value.Print +void value_Print(const atf_exp::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:atf_exp.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(atf_exp::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:atf_exp.FieldId.value.SetStrptr +void value_SetStrptr(atf_exp::FieldId& parent, algo::strptr rhs, atf_exp_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:atf_exp.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(atf_exp::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of atf_exp::FieldId from an ascii string. +// The format of the string is the format of the atf_exp::FieldId's only field +// func:atf_exp.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(atf_exp::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:atf_exp.FieldId..Init +inline void FieldId_Init(atf_exp::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:atf_exp.FieldId.String printfmt:Raw +// func:atf_exp.FieldId..Print +void FieldId_Print(atf_exp::FieldId& row, algo::cstring& str) __attribute__((nothrow)); + +// --- atf_exp.InCase +#pragma pack(push,1) +struct InCase { // atf_exp.InCase: Enum for dispatch atf_exp.In + u32 value; // 0 + // func:atf_exp.InCase.value.Cast + inline operator atf_exp_InCaseEnum() const __attribute__((nothrow)); + // func:atf_exp.InCase..Ctor + inline InCase() __attribute__((nothrow)); + // func:atf_exp.InCase..FieldwiseCtor + explicit inline InCase(u32 in_value) __attribute__((nothrow)); + // func:atf_exp.InCase..EnumCtor + inline InCase(atf_exp_InCaseEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:atf_exp.InCase.value.GetEnum +inline atf_exp_InCaseEnum value_GetEnum(const atf_exp::InCase& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:atf_exp.InCase.value.SetEnum +inline void value_SetEnum(atf_exp::InCase& parent, atf_exp_InCaseEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:atf_exp.InCase.value.ToCstr +const char* value_ToCstr(const atf_exp::InCase& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:atf_exp.InCase.value.Print +void value_Print(const atf_exp::InCase& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:atf_exp.InCase.value.SetStrptrMaybe +bool value_SetStrptrMaybe(atf_exp::InCase& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:atf_exp.InCase.value.SetStrptr +void value_SetStrptr(atf_exp::InCase& parent, algo::strptr rhs, atf_exp_InCaseEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:atf_exp.InCase.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(atf_exp::InCase& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of atf_exp::InCase from an ascii string. +// The format of the string is the format of the atf_exp::InCase's only field +// func:atf_exp.InCase..ReadStrptrMaybe +bool InCase_ReadStrptrMaybe(atf_exp::InCase &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:atf_exp.InCase..Init +inline void InCase_Init(atf_exp::InCase& parent); + +// --- atf_exp.Proc +// access: atf_exp.FProc.base (Base) +struct Proc { // atf_exp.Proc + algo::Smallstr50 proc; // + // func:atf_exp.Proc..Ctor + inline Proc() __attribute__((nothrow)); +}; + +} // gen:ns_print_struct +namespace atf_exp { // gen:ns_curstext + +struct _db_zd_proc_curs {// fcurs:atf_exp.FDb.zd_proc/curs + typedef atf_exp::FProc ChildType; + atf_exp::FProc* row; + _db_zd_proc_curs() { + row = NULL; + } +}; + + +struct _db_cd_proc_read_curs {// fcurs:atf_exp.FDb.cd_proc_read/curs + typedef atf_exp::FProc ChildType; + atf_exp::FProc* row; + atf_exp::FProc** head; // address of head element + _db_cd_proc_read_curs() { + row = NULL; + head = NULL; + } +}; + + +struct _db_cd_proc_outflow_curs {// fcurs:atf_exp.FDb.cd_proc_outflow/curs + typedef atf_exp::FProc ChildType; + atf_exp::FProc* row; + atf_exp::FProc** head; // address of head element + _db_cd_proc_outflow_curs() { + row = NULL; + head = NULL; + } +}; + + +struct _db_cd_fdin_eof_curs {// fcurs:atf_exp.FDb.cd_fdin_eof/curs + typedef atf_exp::FFdin ChildType; + atf_exp::FFdin* row; + atf_exp::FFdin** head; // address of head element + _db_cd_fdin_eof_curs() { + row = NULL; + head = NULL; + } +}; + + +struct _db_cd_fdin_read_curs {// fcurs:atf_exp.FDb.cd_fdin_read/curs + typedef atf_exp::FFdin ChildType; + atf_exp::FFdin* row; + atf_exp::FFdin** head; // address of head element + _db_cd_fdin_read_curs() { + row = NULL; + head = NULL; + } +}; + + +struct _db_cd_fdin_suspend_curs {// fcurs:atf_exp.FDb.cd_fdin_suspend/curs + typedef atf_exp::FFdin ChildType; + atf_exp::FFdin* row; + atf_exp::FFdin** head; // address of head element + _db_cd_fdin_suspend_curs() { + row = NULL; + head = NULL; + } +}; + +} // gen:ns_curstext +namespace atf_exp { // gen:ns_func +// func:atf_exp...StaticCheck +void StaticCheck(); +// User-implemented callback function for dispatch In +// func:atf_exp.In.ams.ProcEofMsg +// this function is 'extrn' and implemented by user +void In_ProcEofMsg(ams::ProcEofMsg &msg); +// User-implemented callback function for dispatch In +// func:atf_exp.In.ams.ProcKillMsg +// this function is 'extrn' and implemented by user +void In_ProcKillMsg(ams::ProcKillMsg &msg); +// User-implemented callback function for dispatch In +// func:atf_exp.In.ams.ProcMsg +// this function is 'extrn' and implemented by user +void In_ProcMsg(ams::ProcMsg &msg); +// User-implemented callback function for dispatch In +// func:atf_exp.In.ams.ProcReadMsg +// this function is 'extrn' and implemented by user +void In_ProcReadMsg(ams::ProcReadMsg &msg); +// User-implemented callback function for dispatch In +// func:atf_exp.In.ams.ProcStartMsg +// this function is 'extrn' and implemented by user +void In_ProcStartMsg(ams::ProcStartMsg &msg); +// User-implemented callback function for dispatch In +// func:atf_exp.In.ams.RemDirRecurseMsg +// this function is 'extrn' and implemented by user +void In_RemDirRecurseMsg(ams::RemDirRecurseMsg &msg); +// User-implemented callback function for dispatch In +// func:atf_exp.In.ams.TerminateMsg +// this function is 'extrn' and implemented by user +void In_TerminateMsg(ams::TerminateMsg &msg); +// func:atf_exp.In..DispatchRaw +int InDispatchRaw(atf_exp::InCase type, u8 *msg, u32 len); +// func:atf_exp.In..Dispatch +int InDispatch(ams::MsgHeader& msg); +// void rettype useful for hooks +// func:atf_exp.In..Dispatch2 +void vInDispatch(ams::MsgHeader& msg); +// Construct a new ams::ProcMsg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:atf_exp...ProcMsg_FmtAppend +ams::ProcMsg * ProcMsg_FmtAppend(algo::ByteAry &buf, const algo::strptr& proc, algo::aryptr payload); +// Construct a new ams::ProcStatusMsg in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:atf_exp...ProcStatusMsg_FmtAppend +ams::ProcStatusMsg * ProcStatusMsg_FmtAppend(algo::ByteAry &buf, const algo::strptr& proc, const algo::strptr& status); +} // gen:ns_func +// func:atf_exp...main +int main(int argc, char **argv); +#if defined(WIN32) +// func:atf_exp...WinMain +int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int); +#endif +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const atf_exp::trace &row);// cfmt:atf_exp.trace.String +inline algo::cstring &operator <<(algo::cstring &str, const atf_exp::FieldId &row);// cfmt:atf_exp.FieldId.String +} diff --git a/include/gen/atf_exp_gen.inl.h b/include/gen/atf_exp_gen.inl.h new file mode 100644 index 00000000..23b45f45 --- /dev/null +++ b/include/gen/atf_exp_gen.inl.h @@ -0,0 +1,737 @@ +// +// include/gen/atf_exp_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/command_gen.inl.h" +#include "include/gen/algo_lib_gen.inl.h" +#include "include/gen/algo_gen.inl.h" +#include "include/gen/ams_gen.inl.h" +//#pragma endinclude + +// --- atf_exp.trace..Ctor +inline atf_exp::trace::trace() { + atf_exp::trace_Init(*this); +} + +// --- atf_exp.FDb.ind_proc.EmptyQ +// Return true if hash is empty +inline bool atf_exp::ind_proc_EmptyQ() { + return _db.ind_proc_n == 0; +} + +// --- atf_exp.FDb.ind_proc.N +// Return number of items in the hash +inline i32 atf_exp::ind_proc_N() { + return _db.ind_proc_n; +} + +// --- atf_exp.FDb.zd_proc.EmptyQ +// Return true if index is empty +inline bool atf_exp::zd_proc_EmptyQ() { + return _db.zd_proc_head == NULL; +} + +// --- atf_exp.FDb.zd_proc.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline atf_exp::FProc* atf_exp::zd_proc_First() { + atf_exp::FProc *row = NULL; + row = _db.zd_proc_head; + return row; +} + +// --- atf_exp.FDb.zd_proc.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool atf_exp::zd_proc_InLlistQ(atf_exp::FProc& row) { + bool result = false; + result = !(row.zd_proc_next == (atf_exp::FProc*)-1); + return result; +} + +// --- atf_exp.FDb.zd_proc.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline atf_exp::FProc* atf_exp::zd_proc_Last() { + atf_exp::FProc *row = NULL; + row = _db.zd_proc_tail; + return row; +} + +// --- atf_exp.FDb.zd_proc.N +// Return number of items in the linked list +inline i32 atf_exp::zd_proc_N() { + return _db.zd_proc_n; +} + +// --- atf_exp.FDb.zd_proc.Next +// Return pointer to next element in the list +inline atf_exp::FProc* atf_exp::zd_proc_Next(atf_exp::FProc &row) { + return row.zd_proc_next; +} + +// --- atf_exp.FDb.zd_proc.Prev +// Return pointer to previous element in the list +inline atf_exp::FProc* atf_exp::zd_proc_Prev(atf_exp::FProc &row) { + return row.zd_proc_prev; +} + +// --- atf_exp.FDb.zd_proc.qLast +// Return reference to last element in the index. No bounds checking. +inline atf_exp::FProc& atf_exp::zd_proc_qLast() { + atf_exp::FProc *row = NULL; + row = _db.zd_proc_tail; + return *row; +} + +// --- atf_exp.FDb.cd_proc_read.EmptyQ +// Return true if index is empty +inline bool atf_exp::cd_proc_read_EmptyQ() { + return _db.cd_proc_read_head == NULL; +} + +// --- atf_exp.FDb.cd_proc_read.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline atf_exp::FProc* atf_exp::cd_proc_read_First() { + atf_exp::FProc *row = NULL; + row = _db.cd_proc_read_head; + return row; +} + +// --- atf_exp.FDb.cd_proc_read.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool atf_exp::cd_proc_read_InLlistQ(atf_exp::FProc& row) { + bool result = false; + result = !(row.cd_proc_read_next == (atf_exp::FProc*)-1); + return result; +} + +// --- atf_exp.FDb.cd_proc_read.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline atf_exp::FProc* atf_exp::cd_proc_read_Last() { + atf_exp::FProc *row = NULL; + row = _db.cd_proc_read_head ? _db.cd_proc_read_head->cd_proc_read_prev : NULL; + return row; +} + +// --- atf_exp.FDb.cd_proc_read.N +// Return number of items in the linked list +inline i32 atf_exp::cd_proc_read_N() { + return _db.cd_proc_read_n; +} + +// --- atf_exp.FDb.cd_proc_read.Next +// Return pointer to next element in the list +inline atf_exp::FProc* atf_exp::cd_proc_read_Next(atf_exp::FProc &row) { + return row.cd_proc_read_next; +} + +// --- atf_exp.FDb.cd_proc_read.Prev +// Return pointer to previous element in the list +inline atf_exp::FProc* atf_exp::cd_proc_read_Prev(atf_exp::FProc &row) { + return row.cd_proc_read_prev; +} + +// --- atf_exp.FDb.cd_proc_read.qLast +// Return reference to last element in the index. No bounds checking. +inline atf_exp::FProc& atf_exp::cd_proc_read_qLast() { + atf_exp::FProc *row = NULL; + row = _db.cd_proc_read_head ? _db.cd_proc_read_head->cd_proc_read_prev : NULL; + return *row; +} + +// --- atf_exp.FDb.cd_proc_outflow.EmptyQ +// Return true if index is empty +inline bool atf_exp::cd_proc_outflow_EmptyQ() { + return _db.cd_proc_outflow_head == NULL; +} + +// --- atf_exp.FDb.cd_proc_outflow.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline atf_exp::FProc* atf_exp::cd_proc_outflow_First() { + atf_exp::FProc *row = NULL; + row = _db.cd_proc_outflow_head; + return row; +} + +// --- atf_exp.FDb.cd_proc_outflow.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool atf_exp::cd_proc_outflow_InLlistQ(atf_exp::FProc& row) { + bool result = false; + result = !(row.cd_proc_outflow_next == (atf_exp::FProc*)-1); + return result; +} + +// --- atf_exp.FDb.cd_proc_outflow.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline atf_exp::FProc* atf_exp::cd_proc_outflow_Last() { + atf_exp::FProc *row = NULL; + row = _db.cd_proc_outflow_head ? _db.cd_proc_outflow_head->cd_proc_outflow_prev : NULL; + return row; +} + +// --- atf_exp.FDb.cd_proc_outflow.N +// Return number of items in the linked list +inline i32 atf_exp::cd_proc_outflow_N() { + return _db.cd_proc_outflow_n; +} + +// --- atf_exp.FDb.cd_proc_outflow.Next +// Return pointer to next element in the list +inline atf_exp::FProc* atf_exp::cd_proc_outflow_Next(atf_exp::FProc &row) { + return row.cd_proc_outflow_next; +} + +// --- atf_exp.FDb.cd_proc_outflow.Prev +// Return pointer to previous element in the list +inline atf_exp::FProc* atf_exp::cd_proc_outflow_Prev(atf_exp::FProc &row) { + return row.cd_proc_outflow_prev; +} + +// --- atf_exp.FDb.cd_proc_outflow.qLast +// Return reference to last element in the index. No bounds checking. +inline atf_exp::FProc& atf_exp::cd_proc_outflow_qLast() { + atf_exp::FProc *row = NULL; + row = _db.cd_proc_outflow_head ? _db.cd_proc_outflow_head->cd_proc_outflow_prev : NULL; + return *row; +} + +// --- atf_exp.FDb.ind_proc_pid.EmptyQ +// Return true if hash is empty +inline bool atf_exp::ind_proc_pid_EmptyQ() { + return _db.ind_proc_pid_n == 0; +} + +// --- atf_exp.FDb.ind_proc_pid.N +// Return number of items in the hash +inline i32 atf_exp::ind_proc_pid_N() { + return _db.ind_proc_pid_n; +} + +// --- atf_exp.FDb.c_proc_read.InsertMaybe +// Insert row into pointer index. Return final membership status. +inline bool atf_exp::c_proc_read_InsertMaybe(atf_exp::FProc& row) { + atf_exp::FProc* ptr = _db.c_proc_read; + bool retval = (ptr == NULL) | (ptr == &row); + if (retval) { + _db.c_proc_read = &row; + } + return retval; +} + +// --- atf_exp.FDb.c_proc_read.Remove +// Remove element from index. If element is not in index, do nothing. +inline void atf_exp::c_proc_read_Remove(atf_exp::FProc& row) { + atf_exp::FProc *ptr = _db.c_proc_read; + if (LIKELY(ptr == &row)) { + _db.c_proc_read = NULL; + } +} + +// --- atf_exp.FDb.cd_fdin_eof.EmptyQ +// Return true if index is empty +inline bool atf_exp::cd_fdin_eof_EmptyQ() { + return _db.cd_fdin_eof_head == NULL; +} + +// --- atf_exp.FDb.cd_fdin_eof.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline atf_exp::FFdin* atf_exp::cd_fdin_eof_First() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_eof_head; + return row; +} + +// --- atf_exp.FDb.cd_fdin_eof.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool atf_exp::cd_fdin_eof_InLlistQ(atf_exp::FFdin& row) { + bool result = false; + result = !(row.cd_fdin_eof_next == (atf_exp::FFdin*)-1); + return result; +} + +// --- atf_exp.FDb.cd_fdin_eof.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline atf_exp::FFdin* atf_exp::cd_fdin_eof_Last() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_eof_head ? _db.cd_fdin_eof_head->cd_fdin_eof_prev : NULL; + return row; +} + +// --- atf_exp.FDb.cd_fdin_eof.N +// Return number of items in the linked list +inline i32 atf_exp::cd_fdin_eof_N() { + return _db.cd_fdin_eof_n; +} + +// --- atf_exp.FDb.cd_fdin_eof.Next +// Return pointer to next element in the list +inline atf_exp::FFdin* atf_exp::cd_fdin_eof_Next(atf_exp::FFdin &row) { + return row.cd_fdin_eof_next; +} + +// --- atf_exp.FDb.cd_fdin_eof.Prev +// Return pointer to previous element in the list +inline atf_exp::FFdin* atf_exp::cd_fdin_eof_Prev(atf_exp::FFdin &row) { + return row.cd_fdin_eof_prev; +} + +// --- atf_exp.FDb.cd_fdin_eof.qLast +// Return reference to last element in the index. No bounds checking. +inline atf_exp::FFdin& atf_exp::cd_fdin_eof_qLast() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_eof_head ? _db.cd_fdin_eof_head->cd_fdin_eof_prev : NULL; + return *row; +} + +// --- atf_exp.FDb.cd_fdin_read.EmptyQ +// Return true if index is empty +inline bool atf_exp::cd_fdin_read_EmptyQ() { + return _db.cd_fdin_read_head == NULL; +} + +// --- atf_exp.FDb.cd_fdin_read.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline atf_exp::FFdin* atf_exp::cd_fdin_read_First() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_read_head; + return row; +} + +// --- atf_exp.FDb.cd_fdin_read.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool atf_exp::cd_fdin_read_InLlistQ(atf_exp::FFdin& row) { + bool result = false; + result = !(row.cd_fdin_read_next == (atf_exp::FFdin*)-1); + return result; +} + +// --- atf_exp.FDb.cd_fdin_read.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline atf_exp::FFdin* atf_exp::cd_fdin_read_Last() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_read_head ? _db.cd_fdin_read_head->cd_fdin_read_prev : NULL; + return row; +} + +// --- atf_exp.FDb.cd_fdin_read.N +// Return number of items in the linked list +inline i32 atf_exp::cd_fdin_read_N() { + return _db.cd_fdin_read_n; +} + +// --- atf_exp.FDb.cd_fdin_read.Next +// Return pointer to next element in the list +inline atf_exp::FFdin* atf_exp::cd_fdin_read_Next(atf_exp::FFdin &row) { + return row.cd_fdin_read_next; +} + +// --- atf_exp.FDb.cd_fdin_read.Prev +// Return pointer to previous element in the list +inline atf_exp::FFdin* atf_exp::cd_fdin_read_Prev(atf_exp::FFdin &row) { + return row.cd_fdin_read_prev; +} + +// --- atf_exp.FDb.cd_fdin_read.qLast +// Return reference to last element in the index. No bounds checking. +inline atf_exp::FFdin& atf_exp::cd_fdin_read_qLast() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_read_head ? _db.cd_fdin_read_head->cd_fdin_read_prev : NULL; + return *row; +} + +// --- atf_exp.FDb.cd_fdin_suspend.EmptyQ +// Return true if index is empty +inline bool atf_exp::cd_fdin_suspend_EmptyQ() { + return _db.cd_fdin_suspend_head == NULL; +} + +// --- atf_exp.FDb.cd_fdin_suspend.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline atf_exp::FFdin* atf_exp::cd_fdin_suspend_First() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_suspend_head; + return row; +} + +// --- atf_exp.FDb.cd_fdin_suspend.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool atf_exp::cd_fdin_suspend_InLlistQ(atf_exp::FFdin& row) { + bool result = false; + result = !(row.cd_fdin_suspend_next == (atf_exp::FFdin*)-1); + return result; +} + +// --- atf_exp.FDb.cd_fdin_suspend.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline atf_exp::FFdin* atf_exp::cd_fdin_suspend_Last() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_suspend_head ? _db.cd_fdin_suspend_head->cd_fdin_suspend_prev : NULL; + return row; +} + +// --- atf_exp.FDb.cd_fdin_suspend.N +// Return number of items in the linked list +inline i32 atf_exp::cd_fdin_suspend_N() { + return _db.cd_fdin_suspend_n; +} + +// --- atf_exp.FDb.cd_fdin_suspend.Next +// Return pointer to next element in the list +inline atf_exp::FFdin* atf_exp::cd_fdin_suspend_Next(atf_exp::FFdin &row) { + return row.cd_fdin_suspend_next; +} + +// --- atf_exp.FDb.cd_fdin_suspend.Prev +// Return pointer to previous element in the list +inline atf_exp::FFdin* atf_exp::cd_fdin_suspend_Prev(atf_exp::FFdin &row) { + return row.cd_fdin_suspend_prev; +} + +// --- atf_exp.FDb.cd_fdin_suspend.qLast +// Return reference to last element in the index. No bounds checking. +inline atf_exp::FFdin& atf_exp::cd_fdin_suspend_qLast() { + atf_exp::FFdin *row = NULL; + row = _db.cd_fdin_suspend_head ? _db.cd_fdin_suspend_head->cd_fdin_suspend_prev : NULL; + return *row; +} + +// --- atf_exp.FDb.zd_proc_curs.Reset +// cursor points to valid item +inline void atf_exp::_db_zd_proc_curs_Reset(_db_zd_proc_curs &curs, atf_exp::FDb &parent) { + curs.row = parent.zd_proc_head; +} + +// --- atf_exp.FDb.zd_proc_curs.ValidQ +// cursor points to valid item +inline bool atf_exp::_db_zd_proc_curs_ValidQ(_db_zd_proc_curs &curs) { + return curs.row != NULL; +} + +// --- atf_exp.FDb.zd_proc_curs.Next +// proceed to next item +inline void atf_exp::_db_zd_proc_curs_Next(_db_zd_proc_curs &curs) { + atf_exp::FProc *next = (*curs.row).zd_proc_next; + curs.row = next; +} + +// --- atf_exp.FDb.zd_proc_curs.Access +// item access +inline atf_exp::FProc& atf_exp::_db_zd_proc_curs_Access(_db_zd_proc_curs &curs) { + return *curs.row; +} + +// --- atf_exp.FDb.cd_proc_read_curs.Reset +// cursor points to valid item +inline void atf_exp::_db_cd_proc_read_curs_Reset(_db_cd_proc_read_curs &curs, atf_exp::FDb &parent) { + curs.row = parent.cd_proc_read_head; + curs.head = &parent.cd_proc_read_head; +} + +// --- atf_exp.FDb.cd_proc_read_curs.ValidQ +// cursor points to valid item +inline bool atf_exp::_db_cd_proc_read_curs_ValidQ(_db_cd_proc_read_curs &curs) { + return curs.row != NULL; +} + +// --- atf_exp.FDb.cd_proc_read_curs.Next +// proceed to next item +inline void atf_exp::_db_cd_proc_read_curs_Next(_db_cd_proc_read_curs &curs) { + atf_exp::FProc *next = (*curs.row).cd_proc_read_next; + curs.row = next; + if (curs.row == *curs.head) { + curs.row = NULL; + } +} + +// --- atf_exp.FDb.cd_proc_read_curs.Access +// item access +inline atf_exp::FProc& atf_exp::_db_cd_proc_read_curs_Access(_db_cd_proc_read_curs &curs) { + return *curs.row; +} + +// --- atf_exp.FDb.cd_proc_outflow_curs.Reset +// cursor points to valid item +inline void atf_exp::_db_cd_proc_outflow_curs_Reset(_db_cd_proc_outflow_curs &curs, atf_exp::FDb &parent) { + curs.row = parent.cd_proc_outflow_head; + curs.head = &parent.cd_proc_outflow_head; +} + +// --- atf_exp.FDb.cd_proc_outflow_curs.ValidQ +// cursor points to valid item +inline bool atf_exp::_db_cd_proc_outflow_curs_ValidQ(_db_cd_proc_outflow_curs &curs) { + return curs.row != NULL; +} + +// --- atf_exp.FDb.cd_proc_outflow_curs.Next +// proceed to next item +inline void atf_exp::_db_cd_proc_outflow_curs_Next(_db_cd_proc_outflow_curs &curs) { + atf_exp::FProc *next = (*curs.row).cd_proc_outflow_next; + curs.row = next; + if (curs.row == *curs.head) { + curs.row = NULL; + } +} + +// --- atf_exp.FDb.cd_proc_outflow_curs.Access +// item access +inline atf_exp::FProc& atf_exp::_db_cd_proc_outflow_curs_Access(_db_cd_proc_outflow_curs &curs) { + return *curs.row; +} + +// --- atf_exp.FDb.cd_fdin_eof_curs.Reset +// cursor points to valid item +inline void atf_exp::_db_cd_fdin_eof_curs_Reset(_db_cd_fdin_eof_curs &curs, atf_exp::FDb &parent) { + curs.row = parent.cd_fdin_eof_head; + curs.head = &parent.cd_fdin_eof_head; +} + +// --- atf_exp.FDb.cd_fdin_eof_curs.ValidQ +// cursor points to valid item +inline bool atf_exp::_db_cd_fdin_eof_curs_ValidQ(_db_cd_fdin_eof_curs &curs) { + return curs.row != NULL; +} + +// --- atf_exp.FDb.cd_fdin_eof_curs.Next +// proceed to next item +inline void atf_exp::_db_cd_fdin_eof_curs_Next(_db_cd_fdin_eof_curs &curs) { + atf_exp::FFdin *next = (*curs.row).cd_fdin_eof_next; + curs.row = next; + if (curs.row == *curs.head) { + curs.row = NULL; + } +} + +// --- atf_exp.FDb.cd_fdin_eof_curs.Access +// item access +inline atf_exp::FFdin& atf_exp::_db_cd_fdin_eof_curs_Access(_db_cd_fdin_eof_curs &curs) { + return *curs.row; +} + +// --- atf_exp.FDb.cd_fdin_read_curs.Reset +// cursor points to valid item +inline void atf_exp::_db_cd_fdin_read_curs_Reset(_db_cd_fdin_read_curs &curs, atf_exp::FDb &parent) { + curs.row = parent.cd_fdin_read_head; + curs.head = &parent.cd_fdin_read_head; +} + +// --- atf_exp.FDb.cd_fdin_read_curs.ValidQ +// cursor points to valid item +inline bool atf_exp::_db_cd_fdin_read_curs_ValidQ(_db_cd_fdin_read_curs &curs) { + return curs.row != NULL; +} + +// --- atf_exp.FDb.cd_fdin_read_curs.Next +// proceed to next item +inline void atf_exp::_db_cd_fdin_read_curs_Next(_db_cd_fdin_read_curs &curs) { + atf_exp::FFdin *next = (*curs.row).cd_fdin_read_next; + curs.row = next; + if (curs.row == *curs.head) { + curs.row = NULL; + } +} + +// --- atf_exp.FDb.cd_fdin_read_curs.Access +// item access +inline atf_exp::FFdin& atf_exp::_db_cd_fdin_read_curs_Access(_db_cd_fdin_read_curs &curs) { + return *curs.row; +} + +// --- atf_exp.FDb.cd_fdin_suspend_curs.Reset +// cursor points to valid item +inline void atf_exp::_db_cd_fdin_suspend_curs_Reset(_db_cd_fdin_suspend_curs &curs, atf_exp::FDb &parent) { + curs.row = parent.cd_fdin_suspend_head; + curs.head = &parent.cd_fdin_suspend_head; +} + +// --- atf_exp.FDb.cd_fdin_suspend_curs.ValidQ +// cursor points to valid item +inline bool atf_exp::_db_cd_fdin_suspend_curs_ValidQ(_db_cd_fdin_suspend_curs &curs) { + return curs.row != NULL; +} + +// --- atf_exp.FDb.cd_fdin_suspend_curs.Next +// proceed to next item +inline void atf_exp::_db_cd_fdin_suspend_curs_Next(_db_cd_fdin_suspend_curs &curs) { + atf_exp::FFdin *next = (*curs.row).cd_fdin_suspend_next; + curs.row = next; + if (curs.row == *curs.head) { + curs.row = NULL; + } +} + +// --- atf_exp.FDb.cd_fdin_suspend_curs.Access +// item access +inline atf_exp::FFdin& atf_exp::_db_cd_fdin_suspend_curs_Access(_db_cd_fdin_suspend_curs &curs) { + return *curs.row; +} + +// --- atf_exp.FFdin.in.Max +// Return max. number of bytes in the buffer. +inline i32 atf_exp::in_Max(atf_exp::FFdin& fdin) { + return fdin.in_max; +} + +// --- atf_exp.FFdin.in.N +// Return number of bytes in the buffer. +inline i32 atf_exp::in_N(atf_exp::FFdin& fdin) { + return fdin.in_end - fdin.in_start; +} + +// --- atf_exp.FFdin..Ctor +inline atf_exp::FFdin::FFdin() { + atf_exp::FFdin_Init(*this); + // added because atf_exp.FFdin.in (Fbuf) does not need initialization + // coverity[uninit_member] +} + +// --- atf_exp.FFdin..Dtor +inline atf_exp::FFdin::~FFdin() { + atf_exp::FFdin_Uninit(*this); +} + +// --- atf_exp.FProc.in.Max +// Return max. number of bytes in the buffer. +inline i32 atf_exp::in_Max(atf_exp::FProc& proc) { + return proc.in_max; +} + +// --- atf_exp.FProc.in.N +// Return number of bytes in the buffer. +inline i32 atf_exp::in_N(atf_exp::FProc& proc) { + return proc.in_end - proc.in_start; +} + +// --- atf_exp.FProc.out.Max +// Return max. number of bytes in the buffer. +inline i32 atf_exp::out_Max(atf_exp::FProc& proc) { + return proc.out_max; +} + +// --- atf_exp.FProc.out.N +// Return number of bytes in the buffer. +inline i32 atf_exp::out_N(atf_exp::FProc& proc) { + return proc.out_end - proc.out_start; +} + +// --- atf_exp.FProc..Ctor +inline atf_exp::FProc::FProc() { + atf_exp::FProc_Init(*this); + // added because atf_exp.FProc.in (Fbuf) does not need initialization + // coverity[uninit_member] +} + +// --- atf_exp.FProc..Dtor +inline atf_exp::FProc::~FProc() { + atf_exp::FProc_Uninit(*this); +} + +// --- atf_exp.FieldId.value.GetEnum +// Get value of field as enum type +inline atf_exp_FieldIdEnum atf_exp::value_GetEnum(const atf_exp::FieldId& parent) { + return atf_exp_FieldIdEnum(parent.value); +} + +// --- atf_exp.FieldId.value.SetEnum +// Set value of field from enum type. +inline void atf_exp::value_SetEnum(atf_exp::FieldId& parent, atf_exp_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- atf_exp.FieldId.value.Cast +inline atf_exp::FieldId::operator atf_exp_FieldIdEnum() const { + return atf_exp_FieldIdEnum((*this).value); +} + +// --- atf_exp.FieldId..Init +// Set all fields to initial values. +inline void atf_exp::FieldId_Init(atf_exp::FieldId& parent) { + parent.value = i32(-1); +} + +// --- atf_exp.FieldId..Ctor +inline atf_exp::FieldId::FieldId() { + atf_exp::FieldId_Init(*this); +} + +// --- atf_exp.FieldId..FieldwiseCtor +inline atf_exp::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- atf_exp.FieldId..EnumCtor +inline atf_exp::FieldId::FieldId(atf_exp_FieldIdEnum arg) { + this->value = i32(arg); +} + +// --- atf_exp.InCase.value.GetEnum +// Get value of field as enum type +inline atf_exp_InCaseEnum atf_exp::value_GetEnum(const atf_exp::InCase& parent) { + return atf_exp_InCaseEnum(parent.value); +} + +// --- atf_exp.InCase.value.SetEnum +// Set value of field from enum type. +inline void atf_exp::value_SetEnum(atf_exp::InCase& parent, atf_exp_InCaseEnum rhs) { + parent.value = u32(rhs); +} + +// --- atf_exp.InCase.value.Cast +inline atf_exp::InCase::operator atf_exp_InCaseEnum() const { + return atf_exp_InCaseEnum((*this).value); +} + +// --- atf_exp.InCase..Init +// Set all fields to initial values. +inline void atf_exp::InCase_Init(atf_exp::InCase& parent) { + parent.value = u32(0); +} + +// --- atf_exp.InCase..Ctor +inline atf_exp::InCase::InCase() { + atf_exp::InCase_Init(*this); +} + +// --- atf_exp.InCase..FieldwiseCtor +inline atf_exp::InCase::InCase(u32 in_value) + : value(in_value) + { +} + +// --- atf_exp.InCase..EnumCtor +inline atf_exp::InCase::InCase(atf_exp_InCaseEnum arg) { + this->value = u32(arg); +} + +// --- atf_exp.Proc..Ctor +inline atf_exp::Proc::Proc() { +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const atf_exp::trace &row) {// cfmt:atf_exp.trace.String + atf_exp::trace_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const atf_exp::FieldId &row) {// cfmt:atf_exp.FieldId.String + atf_exp::FieldId_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/atf_fuzz_gen.h b/include/gen/atf_fuzz_gen.h index 8e6a8235..9bfa798b 100644 --- a/include/gen/atf_fuzz_gen.h +++ b/include/gen/atf_fuzz_gen.h @@ -247,6 +247,9 @@ void ind_target_Remove(atf_fuzz::FTarget& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:atf_fuzz.FDb.ind_target.Reserve void ind_target_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_fuzz.FDb.ind_target.AbsReserve +void ind_target_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:atf_fuzz.FDb.fuzzstrat_curs.Reset @@ -315,8 +318,9 @@ inline void FFuzzstrat_Init(atf_fuzz::FFuzzstrat& fuzzstrat); // global access: ind_target (Thash, hash field target) // global access: c_target (Ptr) struct FTarget { // atf_fuzz.FTarget - atf_fuzz::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target + atf_fuzz::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target // func:atf_fuzz.FTarget..AssignOp inline atf_fuzz::FTarget& operator =(const atf_fuzz::FTarget &rhs) = delete; // func:atf_fuzz.FTarget..CopyCtor diff --git a/include/gen/atf_fuzz_gen.inl.h b/include/gen/atf_fuzz_gen.inl.h index e61792e8..78cf6549 100644 --- a/include/gen/atf_fuzz_gen.inl.h +++ b/include/gen/atf_fuzz_gen.inl.h @@ -202,6 +202,7 @@ inline atf_fuzz::FFuzzstrat::FFuzzstrat() { // Set all fields to initial values. inline void atf_fuzz::FTarget_Init(atf_fuzz::FTarget& target) { target.ind_target_next = (atf_fuzz::FTarget*)-1; // (atf_fuzz.FDb.ind_target) not-in-hash + target.ind_target_hashval = 0; // stored hash value } // --- atf_fuzz.FTarget..Ctor diff --git a/include/gen/atf_gcli_gen.h b/include/gen/atf_gcli_gen.h index 6962f97e..c74fdb72 100644 --- a/include/gen/atf_gcli_gen.h +++ b/include/gen/atf_gcli_gen.h @@ -282,6 +282,9 @@ void ind_gtblacttst_Remove(atf_gcli::FGtblacttst& row) __attribu // Reserve enough room in the hash for N more elements. Return success code. // func:atf_gcli.FDb.ind_gtblacttst.Reserve void ind_gtblacttst_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_gcli.FDb.ind_gtblacttst.AbsReserve +void ind_gtblacttst_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:atf_gcli.FDb.ind_gtblacttstout.EmptyQ @@ -304,6 +307,9 @@ void ind_gtblacttstout_Remove(atf_gcli::FGtblacttstout& row) __a // Reserve enough room in the hash for N more elements. Return success code. // func:atf_gcli.FDb.ind_gtblacttstout.Reserve void ind_gtblacttstout_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_gcli.FDb.ind_gtblacttstout.AbsReserve +void ind_gtblacttstout_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:atf_gcli.FDb.c_gtblacttst.EmptyQ @@ -449,6 +455,9 @@ void ind_gclienv_Remove(atf_gcli::FGclienv& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:atf_gcli.FDb.ind_gclienv.Reserve void ind_gclienv_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_gcli.FDb.ind_gclienv.AbsReserve +void ind_gclienv_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:atf_gcli.FDb.ind_gclienvsub.EmptyQ @@ -471,6 +480,9 @@ void ind_gclienvsub_Remove(atf_gcli::FGclienvsub& row) __attribu // Reserve enough room in the hash for N more elements. Return success code. // func:atf_gcli.FDb.ind_gclienvsub.Reserve void ind_gclienvsub_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_gcli.FDb.ind_gclienvsub.AbsReserve +void ind_gclienvsub_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -536,6 +548,9 @@ void ind_gtblact_Remove(atf_gcli::FGtblact& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:atf_gcli.FDb.ind_gtblact.Reserve void ind_gtblact_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_gcli.FDb.ind_gtblact.AbsReserve +void ind_gtblact_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:atf_gcli.FDb.gtblacttst_curs.Reset @@ -620,13 +635,14 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: ind_gclienv (Thash, hash field gclienv) // access: atf_gcli.FGtblacttst.p_gclienv (Upptr) struct FGclienv { // atf_gcli.FGclienv - atf_gcli::FGclienv* ind_gclienv_next; // hash next - algo::Smallstr50 gclienv; // - algo::cstring addon; // - algo::Comment comment; // - atf_gcli::FGclienvsub** c_gclienvsub_elems; // array of pointers - u32 c_gclienvsub_n; // array of pointers - u32 c_gclienvsub_max; // capacity of allocated array + atf_gcli::FGclienv* ind_gclienv_next; // hash next + u32 ind_gclienv_hashval; // hash value + algo::Smallstr50 gclienv; // + algo::cstring addon; // + algo::Comment comment; // + atf_gcli::FGclienvsub** c_gclienvsub_elems; // array of pointers + u32 c_gclienvsub_n; // array of pointers + u32 c_gclienvsub_max; // capacity of allocated array // reftype Ptrary of atf_gcli.FGclienv.c_gclienvsub prohibits copy // func:atf_gcli.FGclienv..AssignOp inline atf_gcli::FGclienv& operator =(const atf_gcli::FGclienv &rhs) = delete; @@ -715,6 +731,7 @@ void FGclienv_Uninit(atf_gcli::FGclienv& gclienv) __attribute__( // access: atf_gcli.FGclienv.c_gclienvsub (Ptrary) struct FGclienvsub { // atf_gcli.FGclienvsub atf_gcli::FGclienvsub* ind_gclienvsub_next; // hash next + u32 ind_gclienvsub_hashval; // hash value algo::Smallstr50 gclienvsub; // bool fwd; // false bool rev; // false @@ -760,15 +777,16 @@ void FGclienvsub_Uninit(atf_gcli::FGclienvsub& gclienvsub) __att // global access: ind_gtblact (Thash, hash field gtblact) // access: atf_gcli.FGtblacttst.p_gtblact (Upptr) struct FGtblact { // atf_gcli.FGtblact - atf_gcli::FGtblact* ind_gtblact_next; // hash next - algo::Smallstr50 gtblact; // - bool t; // false - bool e; // false - bool auth; // false - u32 glab_fail; // 0 - u32 glab_run; // 0 - u32 ghub_run; // 0 - u32 ghub_fail; // 0 + atf_gcli::FGtblact* ind_gtblact_next; // hash next + u32 ind_gtblact_hashval; // hash value + algo::Smallstr50 gtblact; // + bool t; // false + bool e; // false + bool auth; // false + u32 glab_fail; // 0 + u32 glab_run; // 0 + u32 ghub_run; // 0 + u32 ghub_fail; // 0 // func:atf_gcli.FGtblact..AssignOp atf_gcli::FGtblact& operator =(const atf_gcli::FGtblact &rhs) = delete; // func:atf_gcli.FGtblact..CopyCtor @@ -809,19 +827,20 @@ void FGtblact_Uninit(atf_gcli::FGtblact& gtblact) __attribute__( // global access: ind_gtblacttst (Thash, hash field gtblacttst) // global access: c_gtblacttst (Ptrary) struct FGtblacttst { // atf_gcli.FGtblacttst - atf_gcli::FGtblacttst* ind_gtblacttst_next; // hash next - algo::Smallstr250 gtblacttst; // - bool working; // true - algo::cstring cmd; // - algo::Comment comment; // - bool fail; // false - atf_gcli::FGtblacttstout** c_gtblacttstout_elems; // array of pointers - u32 c_gtblacttstout_n; // array of pointers - u32 c_gtblacttstout_max; // capacity of allocated array - bool select; // false - atf_gcli::FGclienv* p_gclienv; // reference to parent row - atf_gcli::FGtblact* p_gtblact; // reference to parent row - bool _db_c_gtblacttst_in_ary; // false membership flag + atf_gcli::FGtblacttst* ind_gtblacttst_next; // hash next + u32 ind_gtblacttst_hashval; // hash value + algo::Smallstr250 gtblacttst; // + bool working; // true + algo::cstring cmd; // + algo::Comment comment; // + bool fail; // false + atf_gcli::FGtblacttstout** c_gtblacttstout_elems; // array of pointers + u32 c_gtblacttstout_n; // array of pointers + u32 c_gtblacttstout_max; // capacity of allocated array + bool select; // false + atf_gcli::FGclienv* p_gclienv; // reference to parent row + atf_gcli::FGtblact* p_gtblact; // reference to parent row + bool c_gtblacttst_in_ary; // false membership flag // reftype Ptrary of atf_gcli.FGtblacttst.c_gtblacttstout prohibits copy // x-reference on atf_gcli.FGtblacttst.p_gclienv prevents copy // x-reference on atf_gcli.FGtblacttst.p_gtblact prevents copy @@ -923,6 +942,7 @@ void FGtblacttst_Uninit(atf_gcli::FGtblacttst& gtblacttst) __att // access: atf_gcli.FGtblacttst.c_gtblacttstout (Ptrary) struct FGtblacttstout { // atf_gcli.FGtblacttstout atf_gcli::FGtblacttstout* ind_gtblacttstout_next; // hash next + u32 ind_gtblacttstout_hashval; // hash value algo::Smallstr250 gtblacttstout; // algo::cstring text; // algo::cstring tout; // diff --git a/include/gen/atf_gcli_gen.inl.h b/include/gen/atf_gcli_gen.inl.h index 71417774..23245216 100644 --- a/include/gen/atf_gcli_gen.inl.h +++ b/include/gen/atf_gcli_gen.inl.h @@ -176,7 +176,7 @@ inline i32 atf_gcli::c_gtblacttst_N() { inline void atf_gcli::c_gtblacttst_RemoveAll() { for (u32 i = 0; i < _db.c_gtblacttst_n; i++) { // mark all elements as not-in-array - _db.c_gtblacttst_elems[i]->_db_c_gtblacttst_in_ary = false; + _db.c_gtblacttst_elems[i]->c_gtblacttst_in_ary = false; } _db.c_gtblacttst_n = 0; } @@ -190,7 +190,7 @@ inline atf_gcli::FGtblacttst& atf_gcli::c_gtblacttst_qFind(u32 idx) { // --- atf_gcli.FDb.c_gtblacttst.InAryQ // True if row is in any ptrary instance inline bool atf_gcli::c_gtblacttst_InAryQ(atf_gcli::FGtblacttst& row) { - return row._db_c_gtblacttst_in_ary; + return row.c_gtblacttst_in_ary; } // --- atf_gcli.FDb.c_gtblacttst.qLast @@ -576,6 +576,7 @@ inline void atf_gcli::FGclienv_Init(atf_gcli::FGclienv& gclienv) { gclienv.c_gclienvsub_n = 0; // (atf_gcli.FGclienv.c_gclienvsub) gclienv.c_gclienvsub_max = 0; // (atf_gcli.FGclienv.c_gclienvsub) gclienv.ind_gclienv_next = (atf_gcli::FGclienv*)-1; // (atf_gcli.FDb.ind_gclienv) not-in-hash + gclienv.ind_gclienv_hashval = 0; // stored hash value } // --- atf_gcli.FGclienv.c_gclienvsub_curs.Reset @@ -620,6 +621,7 @@ inline void atf_gcli::FGclienvsub_Init(atf_gcli::FGclienvsub& gclienvsub) { gclienvsub.rev = bool(false); gclienvsub.gclienv_c_gclienvsub_in_ary = bool(false); gclienvsub.ind_gclienvsub_next = (atf_gcli::FGclienvsub*)-1; // (atf_gcli.FDb.ind_gclienvsub) not-in-hash + gclienvsub.ind_gclienvsub_hashval = 0; // stored hash value } // --- atf_gcli.FGclienvsub..Ctor @@ -740,6 +742,7 @@ inline atf_gcli::FGtblacttst::~FGtblacttst() { inline void atf_gcli::FGtblacttstout_Init(atf_gcli::FGtblacttstout& gtblacttstout) { gtblacttstout.gtblacttst_c_gtblacttstout_in_ary = bool(false); gtblacttstout.ind_gtblacttstout_next = (atf_gcli::FGtblacttstout*)-1; // (atf_gcli.FDb.ind_gtblacttstout) not-in-hash + gtblacttstout.ind_gtblacttstout_hashval = 0; // stored hash value } // --- atf_gcli.FGtblacttstout..Ctor diff --git a/include/gen/atf_nrun_gen.h b/include/gen/atf_nrun_gen.h index e148bab7..41f8042b 100644 --- a/include/gen/atf_nrun_gen.h +++ b/include/gen/atf_nrun_gen.h @@ -188,6 +188,9 @@ void ind_running_Remove(atf_nrun::FEntry& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:atf_nrun.FDb.ind_running.Reserve void ind_running_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_nrun.FDb.ind_running.AbsReserve +void ind_running_AbsReserve(int n) __attribute__((nothrow)); // func:atf_nrun.FDb.ind_running.Step // this function is 'extrn' and implemented by user void ind_running_Step() __attribute__((nothrow)); @@ -280,19 +283,20 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: ind_running (Thash, hash field pid) // global access: zd_todo (Llist) struct FEntry { // atf_nrun.FEntry - atf_nrun::FEntry* ind_running_next; // hash next - atf_nrun::FEntry* zd_todo_next; // zslist link; -1 means not-in-list - atf_nrun::FEntry* zd_todo_prev; // previous element - algo::cstring command; // Command to execute - i32 pid; // 0 Pid of running bash job - algo::cstring job_path; // "bin/bash" path for executable - command::bash job_cmd; // command line for child process - algo::cstring job_fstdin; // redirect for stdin - algo::cstring job_fstdout; // redirect for stdout - algo::cstring job_fstderr; // redirect for stderr - pid_t job_pid; // 0 pid of running child process - i32 job_timeout; // 0 optional timeout for child process - i32 job_status; // 0 last exit status of child process + atf_nrun::FEntry* ind_running_next; // hash next + u32 ind_running_hashval; // hash value + atf_nrun::FEntry* zd_todo_next; // zslist link; -1 means not-in-list + atf_nrun::FEntry* zd_todo_prev; // previous element + algo::cstring command; // Command to execute + i32 pid; // 0 Pid of running bash job + algo::cstring job_path; // "bin/bash" path for executable + command::bash job_cmd; // command line for child process + algo::cstring job_fstdin; // redirect for stdin + algo::cstring job_fstdout; // redirect for stdout + algo::cstring job_fstderr; // redirect for stderr + pid_t job_pid; // 0 pid of running child process + i32 job_timeout; // 0 optional timeout for child process + i32 job_status; // 0 last exit status of child process // reftype Exec of atf_nrun.FEntry.job prohibits copy // func:atf_nrun.FEntry..AssignOp atf_nrun::FEntry& operator =(const atf_nrun::FEntry &rhs) = delete; diff --git a/include/gen/atf_unit_gen.h b/include/gen/atf_unit_gen.h index 46c5e733..f2e80125 100644 --- a/include/gen/atf_unit_gen.h +++ b/include/gen/atf_unit_gen.h @@ -435,6 +435,9 @@ void ind_unittest_Remove(atf_unit::FUnittest& row) __attribute__ // Reserve enough room in the hash for N more elements. Return success code. // func:atf_unit.FDb.ind_unittest.Reserve void ind_unittest_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:atf_unit.FDb.ind_unittest.AbsReserve +void ind_unittest_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:atf_unit.FDb.tr_number_curs.Reset @@ -533,6 +536,11 @@ atf_unit::Dbl& orig_AllocAt(atf_unit::FPerfSort& parent, int at) __attribu // Reserve space. Insert N elements at the end of the array, return pointer to array // func:atf_unit.FPerfSort.orig.AllocN algo::aryptr orig_AllocN(atf_unit::FPerfSort& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:atf_unit.FPerfSort.orig.AllocNAt +algo::aryptr orig_AllocNAt(atf_unit::FPerfSort& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:atf_unit.FPerfSort.orig.EmptyQ inline bool orig_EmptyQ(atf_unit::FPerfSort& parent) __attribute__((nothrow)); @@ -589,6 +597,10 @@ algo::aryptr orig_AllocNVal(atf_unit::FPerfSort& parent, int n_el // Function returns success value. // func:atf_unit.FPerfSort.orig.ReadStrptrMaybe bool orig_ReadStrptrMaybe(atf_unit::FPerfSort& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:atf_unit.FPerfSort.orig.Insary +void orig_Insary(atf_unit::FPerfSort& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -606,6 +618,11 @@ atf_unit::Dbl& sorted_AllocAt(atf_unit::FPerfSort& parent, int at) __attri // Reserve space. Insert N elements at the end of the array, return pointer to array // func:atf_unit.FPerfSort.sorted.AllocN algo::aryptr sorted_AllocN(atf_unit::FPerfSort& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:atf_unit.FPerfSort.sorted.AllocNAt +algo::aryptr sorted_AllocNAt(atf_unit::FPerfSort& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:atf_unit.FPerfSort.sorted.EmptyQ inline bool sorted_EmptyQ(atf_unit::FPerfSort& parent) __attribute__((nothrow)); @@ -662,6 +679,10 @@ algo::aryptr sorted_AllocNVal(atf_unit::FPerfSort& parent, int n_ // Function returns success value. // func:atf_unit.FPerfSort.sorted.ReadStrptrMaybe bool sorted_ReadStrptrMaybe(atf_unit::FPerfSort& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:atf_unit.FPerfSort.sorted.Insary +void sorted_Insary(atf_unit::FPerfSort& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Verify whether array is sorted // func:atf_unit.FPerfSort.sorted.SortedQ bool sorted_SortedQ(atf_unit::FPerfSort& parent) __attribute__((nothrow)); @@ -691,6 +712,11 @@ i32& index_AllocAt(atf_unit::FPerfSort& parent, int at) __attrib // Reserve space. Insert N elements at the end of the array, return pointer to array // func:atf_unit.FPerfSort.index.AllocN algo::aryptr index_AllocN(atf_unit::FPerfSort& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:atf_unit.FPerfSort.index.AllocNAt +algo::aryptr index_AllocNAt(atf_unit::FPerfSort& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:atf_unit.FPerfSort.index.EmptyQ inline bool index_EmptyQ(atf_unit::FPerfSort& parent) __attribute__((nothrow)); @@ -747,6 +773,10 @@ algo::aryptr index_AllocNVal(atf_unit::FPerfSort& parent, int n_elems, c // Function returns success value. // func:atf_unit.FPerfSort.index.ReadStrptrMaybe bool index_ReadStrptrMaybe(atf_unit::FPerfSort& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:atf_unit.FPerfSort.index.Insary +void index_Insary(atf_unit::FPerfSort& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:atf_unit.FPerfSort.orig_curs.Next @@ -793,14 +823,15 @@ void FPerfSort_Uninit(atf_unit::FPerfSort& parent) __attribute__ // global access: ind_unittest (Thash, hash field unittest) // global access: c_curtest (Ptr) struct FUnittest { // atf_unit.FUnittest: Test function - atf_unit::FUnittest* ind_unittest_next; // hash next - algo::Smallstr50 unittest; // - algo::Comment comment; // - bool select; // false Select test for running? - atf_unit::unittest_step_hook step; // NULL Pointer to a function - bool success; // false - algo::cstring error; // - lib_exec::FSyscmd* c_syscmd; // optional pointer + atf_unit::FUnittest* ind_unittest_next; // hash next + u32 ind_unittest_hashval; // hash value + algo::Smallstr50 unittest; // + algo::Comment comment; // + bool select; // false Select test for running? + atf_unit::unittest_step_hook step; // NULL Pointer to a function + bool success; // false + algo::cstring error; // + lib_exec::FSyscmd* c_syscmd; // optional pointer // reftype Hook of atf_unit.FUnittest.step prohibits copy // func:atf_unit.FUnittest..AssignOp atf_unit::FUnittest& operator =(const atf_unit::FUnittest &rhs) = delete; @@ -825,8 +856,8 @@ void unittest_CopyOut(atf_unit::FUnittest &row, atfdb::Unittest // func:atf_unit.FUnittest.base.CopyIn void unittest_CopyIn(atf_unit::FUnittest &row, atfdb::Unittest &in) __attribute__((nothrow)); -// func:atf_unit.FUnittest.target.Get -algo::Smallstr16 target_Get(atf_unit::FUnittest& unittest) __attribute__((__warn_unused_result__, nothrow)); +// func:atf_unit.FUnittest.ns.Get +algo::Smallstr16 ns_Get(atf_unit::FUnittest& unittest) __attribute__((__warn_unused_result__, nothrow)); // func:atf_unit.FUnittest.testname.Get algo::Smallstr50 testname_Get(atf_unit::FUnittest& unittest) __attribute__((__warn_unused_result__, nothrow)); @@ -1242,6 +1273,10 @@ void unittest_algo_lib_ExitCode(); // this function is 'extrn' and implemented by user void unittest_algo_lib_FTruncate(); // User-implemented function from gstatic:atf_unit.FDb.unittest +// func:atf_unit...unittest_algo_lib_FileAppend +// this function is 'extrn' and implemented by user +void unittest_algo_lib_FileAppend(); +// User-implemented function from gstatic:atf_unit.FDb.unittest // func:atf_unit...unittest_algo_lib_FileLine_curs // this function is 'extrn' and implemented by user void unittest_algo_lib_FileLine_curs(); @@ -1406,6 +1441,10 @@ void unittest_algo_lib_PrintSsim(); // this function is 'extrn' and implemented by user void unittest_algo_lib_PrintUnTime(); // User-implemented function from gstatic:atf_unit.FDb.unittest +// func:atf_unit...unittest_algo_lib_PrintUuid +// this function is 'extrn' and implemented by user +void unittest_algo_lib_PrintUuid(); +// User-implemented function from gstatic:atf_unit.FDb.unittest // func:atf_unit...unittest_algo_lib_PrintWithCommas // this function is 'extrn' and implemented by user void unittest_algo_lib_PrintWithCommas(); @@ -1418,6 +1457,10 @@ void unittest_algo_lib_ReadLine(); // this function is 'extrn' and implemented by user void unittest_algo_lib_ReadModuleId(); // User-implemented function from gstatic:atf_unit.FDb.unittest +// func:atf_unit...unittest_algo_lib_ReadUuid +// this function is 'extrn' and implemented by user +void unittest_algo_lib_ReadUuid(); +// User-implemented function from gstatic:atf_unit.FDb.unittest // func:atf_unit...unittest_algo_lib_Regx // this function is 'extrn' and implemented by user void unittest_algo_lib_Regx(); @@ -1442,6 +1485,10 @@ void unittest_algo_lib_RemDirRecurse(); // this function is 'extrn' and implemented by user void unittest_algo_lib_Replscope(); // User-implemented function from gstatic:atf_unit.FDb.unittest +// func:atf_unit...unittest_algo_lib_ReplscopeSharedPrefix +// this function is 'extrn' and implemented by user +void unittest_algo_lib_ReplscopeSharedPrefix(); +// User-implemented function from gstatic:atf_unit.FDb.unittest // func:atf_unit...unittest_algo_lib_ReverseBits // this function is 'extrn' and implemented by user void unittest_algo_lib_ReverseBits(); @@ -1566,6 +1613,14 @@ void unittest_algo_lib_U128PrintHex(); // this function is 'extrn' and implemented by user void unittest_algo_lib_UnescapeC(); // User-implemented function from gstatic:atf_unit.FDb.unittest +// func:atf_unit...unittest_algo_lib_Url +// this function is 'extrn' and implemented by user +void unittest_algo_lib_Url(); +// User-implemented function from gstatic:atf_unit.FDb.unittest +// func:atf_unit...unittest_algo_lib_Zigzag +// this function is 'extrn' and implemented by user +void unittest_algo_lib_Zigzag(); +// User-implemented function from gstatic:atf_unit.FDb.unittest // func:atf_unit...unittest_algo_lib_flock // this function is 'extrn' and implemented by user void unittest_algo_lib_flock(); @@ -1606,6 +1661,22 @@ void unittest_fm(); // this function is 'extrn' and implemented by user void unittest_lib_ams_Test1(); // User-implemented function from gstatic:atf_unit.FDb.unittest +// func:atf_unit...unittest_lib_curl_GET_Echo +// this function is 'extrn' and implemented by user +void unittest_lib_curl_GET_Echo(); +// User-implemented function from gstatic:atf_unit.FDb.unittest +// func:atf_unit...unittest_lib_curl_POST_JSON +// this function is 'extrn' and implemented by user +void unittest_lib_curl_POST_JSON(); +// User-implemented function from gstatic:atf_unit.FDb.unittest +// func:atf_unit...unittest_lib_curl_PUT_PLAINTEXT +// this function is 'extrn' and implemented by user +void unittest_lib_curl_PUT_PLAINTEXT(); +// User-implemented function from gstatic:atf_unit.FDb.unittest +// func:atf_unit...unittest_lib_curl_STATUS_200 +// this function is 'extrn' and implemented by user +void unittest_lib_curl_STATUS_200(); +// User-implemented function from gstatic:atf_unit.FDb.unittest // func:atf_unit...unittest_lib_exec_Dependency // this function is 'extrn' and implemented by user void unittest_lib_exec_Dependency(); @@ -2046,6 +2117,10 @@ void unittest_lib_json_TokenTrue(); // this function is 'extrn' and implemented by user void unittest_lib_json_Typical(); // User-implemented function from gstatic:atf_unit.FDb.unittest +// func:atf_unit...unittest_lib_netio_GetHostAddr +// this function is 'extrn' and implemented by user +void unittest_lib_netio_GetHostAddr(); +// User-implemented function from gstatic:atf_unit.FDb.unittest // func:atf_unit...unittest_lib_sql_Main // this function is 'extrn' and implemented by user void unittest_lib_sql_Main(); diff --git a/include/gen/atf_unit_gen.inl.h b/include/gen/atf_unit_gen.inl.h index fd9bd6cb..a76e91a2 100644 --- a/include/gen/atf_unit_gen.inl.h +++ b/include/gen/atf_unit_gen.inl.h @@ -662,6 +662,7 @@ inline void atf_unit::FUnittest_Init(atf_unit::FUnittest& unittest) { unittest.success = bool(false); unittest.c_syscmd = NULL; unittest.ind_unittest_next = (atf_unit::FUnittest*)-1; // (atf_unit.FDb.ind_unittest) not-in-hash + unittest.ind_unittest_hashval = 0; // stored hash value unittest.step = NULL; } diff --git a/include/gen/atfdb_gen.h b/include/gen/atfdb_gen.h index 1c0d0740..416edebd 100644 --- a/include/gen/atfdb_gen.h +++ b/include/gen/atfdb_gen.h @@ -44,24 +44,29 @@ enum atfdb_FieldIdEnum { // atfdb.FieldId.value ,atfdb_FieldId_testname = 11 ,atfdb_FieldId_timeout = 12 ,atfdb_FieldId_memcheck = 13 - ,atfdb_FieldId_exit_code = 14 - ,atfdb_FieldId_fuzzstrat = 15 - ,atfdb_FieldId_msgdir = 16 - ,atfdb_FieldId_args = 17 - ,atfdb_FieldId_test_gsymbol_char = 18 - ,atfdb_FieldId_test_gsymbol_pkey = 19 - ,atfdb_FieldId_test_gsymbol_strptr = 20 - ,atfdb_FieldId_filter = 21 - ,atfdb_FieldId_tmsg = 22 - ,atfdb_FieldId_rank = 23 - ,atfdb_FieldId_dir = 24 - ,atfdb_FieldId_istuple = 25 - ,atfdb_FieldId_msg = 26 - ,atfdb_FieldId_unittest = 27 - ,atfdb_FieldId_value = 28 + ,atfdb_FieldId_coverage = 14 + ,atfdb_FieldId_exit_code = 15 + ,atfdb_FieldId_ncore = 16 + ,atfdb_FieldId_repeat = 17 + ,atfdb_FieldId_fuzzstrat = 18 + ,atfdb_FieldId_msgdir = 19 + ,atfdb_FieldId_args = 20 + ,atfdb_FieldId_test_gsymbol_char = 21 + ,atfdb_FieldId_test_gsymbol_pkey = 22 + ,atfdb_FieldId_test_gsymbol_strptr = 23 + ,atfdb_FieldId_filter = 24 + ,atfdb_FieldId_tmsg = 25 + ,atfdb_FieldId_rank = 26 + ,atfdb_FieldId_dir = 27 + ,atfdb_FieldId_istuple = 28 + ,atfdb_FieldId_msg = 29 + ,atfdb_FieldId_unittest = 30 + ,atfdb_FieldId_ns = 31 + ,atfdb_FieldId_var = 32 + ,atfdb_FieldId_value = 33 }; -enum { atfdb_FieldIdEnum_N = 29 }; +enum { atfdb_FieldIdEnum_N = 34 }; extern const char * atfdb_Msgdir_msgdir_exp; // exp fconst:atfdb.Msgdir.msgdir/exp extern const char * atfdb_Msgdir_msgdir_in; // in fconst:atfdb.Msgdir.msgdir/in @@ -77,6 +82,7 @@ namespace atfdb { // gen:ns_pkeytypedef typedef algo::Smallstr50 TestGsymbolStrptrPkey; typedef algo::Smallstr50 TmsgPkey; typedef algo::Smallstr50 UnittestPkey; + typedef algo::Smallstr50 VarPkey; } // gen:ns_pkeytypedef namespace atfdb { // gen:ns_tclass_field } // gen:ns_tclass_field @@ -96,6 +102,7 @@ namespace atfdb { struct TestGsymbolStrptr; } namespace atfdb { struct Tfilt; } namespace atfdb { struct Tmsg; } namespace atfdb { struct Unittest; } +namespace atfdb { struct Var; } namespace atfdb { // gen:ns_print_struct // --- atfdb.Amctest @@ -190,7 +197,10 @@ struct Comptest { // atfdb.Comptest algo::Smallstr50 comptest; // i32 timeout; // 10 bool memcheck; // true + bool coverage; // true u8 exit_code; // 0 Exit code to check + i32 ncore; // 1 + i32 repeat; // 1 Number of times to repeat the test algo::Comment comment; // // func:atfdb.Comptest..Ctor inline Comptest() __attribute__((nothrow)); @@ -216,7 +226,7 @@ bool Comptest_ReadFieldMaybe(atfdb::Comptest& parent, algo::strp bool Comptest_ReadStrptrMaybe(atfdb::Comptest &parent, algo::strptr in_str) __attribute__((nothrow)); // Set all fields to initial values. // func:atfdb.Comptest..Init -inline void Comptest_Init(atfdb::Comptest& parent); +void Comptest_Init(atfdb::Comptest& parent); // print string representation of ROW to string STR // cfmt:atfdb.Comptest.String printfmt:Tuple // func:atfdb.Comptest..Print @@ -458,18 +468,18 @@ struct Unittest { // atfdb.Unittest inline Unittest() __attribute__((nothrow)); }; -// func:atfdb.Unittest.target.Get -algo::Smallstr16 target_Get(atfdb::Unittest& parent) __attribute__((__warn_unused_result__, nothrow)); -// func:atfdb.Unittest.target.Get2 -algo::Smallstr16 Unittest_target_Get(algo::strptr arg) __attribute__((nothrow)); +// func:atfdb.Unittest.ns.Get +algo::Smallstr16 ns_Get(atfdb::Unittest& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:atfdb.Unittest.ns.Get2 +algo::Smallstr16 Unittest_ns_Get(algo::strptr arg) __attribute__((nothrow)); // func:atfdb.Unittest.testname.Get algo::Smallstr50 testname_Get(atfdb::Unittest& parent) __attribute__((__warn_unused_result__, nothrow)); // func:atfdb.Unittest.testname.Get2 algo::Smallstr50 Unittest_testname_Get(algo::strptr arg) __attribute__((nothrow)); -// func:atfdb.Unittest..Concat_target_testname -tempstr Unittest_Concat_target_testname( const algo::strptr& target ,const algo::strptr& testname ); +// func:atfdb.Unittest..Concat_ns_testname +tempstr Unittest_Concat_ns_testname( const algo::strptr& ns ,const algo::strptr& testname ); // func:atfdb.Unittest..ReadFieldMaybe bool Unittest_ReadFieldMaybe(atfdb::Unittest& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); // Read fields of atfdb::Unittest from an ascii string. @@ -483,6 +493,26 @@ bool Unittest_ReadTupleMaybe(atfdb::Unittest &parent, algo::Tupl // cfmt:atfdb.Unittest.String printfmt:Tuple // func:atfdb.Unittest..Print void Unittest_Print(atfdb::Unittest& row, algo::cstring& str) __attribute__((nothrow)); + +// --- atfdb.Var +struct Var { // atfdb.Var + algo::Smallstr50 var; // + algo::Smallstr100 value; // + algo::Comment comment; // + // func:atfdb.Var..Ctor + inline Var() __attribute__((nothrow)); +}; + +// func:atfdb.Var..ReadFieldMaybe +bool Var_ReadFieldMaybe(atfdb::Var& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of atfdb::Var from an ascii string. +// The format of the string is an ssim Tuple +// func:atfdb.Var..ReadStrptrMaybe +bool Var_ReadStrptrMaybe(atfdb::Var &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:atfdb.Var.String printfmt:Tuple +// func:atfdb.Var..Print +void Var_Print(atfdb::Var& row, algo::cstring& str) __attribute__((nothrow)); } // gen:ns_print_struct namespace atfdb { // gen:ns_func } // gen:ns_func @@ -501,4 +531,5 @@ inline algo::cstring &operator <<(algo::cstring &str, const atfdb::TestGsymbolPk inline algo::cstring &operator <<(algo::cstring &str, const atfdb::TestGsymbolStrptr &row);// cfmt:atfdb.TestGsymbolStrptr.String inline algo::cstring &operator <<(algo::cstring &str, const atfdb::Tfilt &row);// cfmt:atfdb.Tfilt.String inline algo::cstring &operator <<(algo::cstring &str, const atfdb::Tmsg &row);// cfmt:atfdb.Tmsg.String +inline algo::cstring &operator <<(algo::cstring &str, const atfdb::Var &row);// cfmt:atfdb.Var.String } diff --git a/include/gen/atfdb_gen.inl.h b/include/gen/atfdb_gen.inl.h index 29350c7f..bfe6ef9f 100644 --- a/include/gen/atfdb_gen.inl.h +++ b/include/gen/atfdb_gen.inl.h @@ -58,14 +58,6 @@ inline atfdb::Citest::Citest() { atfdb::Citest_Init(*this); } -// --- atfdb.Comptest..Init -// Set all fields to initial values. -inline void atfdb::Comptest_Init(atfdb::Comptest& parent) { - parent.timeout = i32(10); - parent.memcheck = bool(true); - parent.exit_code = u8(0); -} - // --- atfdb.Comptest..Ctor inline atfdb::Comptest::Comptest() { atfdb::Comptest_Init(*this); @@ -153,6 +145,10 @@ inline atfdb::Tmsg::Tmsg() { inline atfdb::Unittest::Unittest() { } +// --- atfdb.Var..Ctor +inline atfdb::Var::Var() { +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const atfdb::Cijob &row) {// cfmt:atfdb.Cijob.String atfdb::Cijob_Print(const_cast(row), str); return str; @@ -217,3 +213,8 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const atfdb::Tmsg &r atfdb::Tmsg_Print(const_cast(row), str); return str; } + +inline algo::cstring &algo::operator <<(algo::cstring &str, const atfdb::Var &row) {// cfmt:atfdb.Var.String + atfdb::Var_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/command_gen.h b/include/gen/command_gen.h index 7aeab713..6d463a13 100644 --- a/include/gen/command_gen.h +++ b/include/gen/command_gen.h @@ -24,6 +24,7 @@ #pragma once #include "include/gen/algo_gen.h" +#include "include/gen/algo_lib_gen.h" //#pragma endinclude // gen:ns_enums @@ -56,7 +57,7 @@ enum command_FieldIdEnum { // command.FieldId.value ,command_FieldId_jcdb = 23 ,command_FieldId_cache = 24 ,command_FieldId_shortlink = 25 - ,command_FieldId_readme = 26 + ,command_FieldId_readmefile = 26 ,command_FieldId_ns = 27 ,command_FieldId_section = 28 ,command_FieldId_update = 29 @@ -143,200 +144,222 @@ enum command_FieldIdEnum { // command.FieldId.value ,command_FieldId_showcpp = 110 ,command_FieldId_msgtype = 111 ,command_FieldId_anonfld = 112 - ,command_FieldId_sigcheck = 113 - ,command_FieldId_data_dir = 114 - ,command_FieldId_related = 115 - ,command_FieldId_notssimfile = 116 - ,command_FieldId_checkable = 117 - ,command_FieldId_r = 118 - ,command_FieldId_nsdb = 119 - ,command_FieldId_fkey = 120 - ,command_FieldId_start = 121 - ,command_FieldId_stop = 122 - ,command_FieldId_abort = 123 - ,command_FieldId_shell = 124 - ,command_FieldId_serv = 125 - ,command_FieldId_in_dir = 126 - ,command_FieldId_out_dir = 127 - ,command_FieldId_proto = 128 - ,command_FieldId_trace = 129 - ,command_FieldId_key = 130 - ,command_FieldId_include = 131 - ,command_FieldId_dot = 132 - ,command_FieldId_xns = 133 - ,command_FieldId_noinput = 134 - ,command_FieldId_render = 135 - ,command_FieldId_id = 136 - ,command_FieldId_file_prefix = 137 - ,command_FieldId_nchild = 138 - ,command_FieldId_blocking = 139 - ,command_FieldId_nmsg = 140 - ,command_FieldId_timeout = 141 - ,command_FieldId_recvdelay_ns = 142 - ,command_FieldId_senddelay_ns = 143 - ,command_FieldId_msgsize_min = 144 - ,command_FieldId_msgsize_max = 145 - ,command_FieldId_bufsize = 146 - ,command_FieldId_recvdelay = 147 - ,command_FieldId_pkgdata = 148 - ,command_FieldId_diff = 149 - ,command_FieldId_push = 150 - ,command_FieldId_remove = 151 - ,command_FieldId_origin = 152 - ,command_FieldId_ref = 153 - ,command_FieldId_showrec = 154 - ,command_FieldId_showfile = 155 - ,command_FieldId_R = 156 - ,command_FieldId_reset = 157 - ,command_FieldId_checkclean = 158 - ,command_FieldId_stat = 159 - ,command_FieldId_annotate = 160 - ,command_FieldId_data_in = 161 - ,command_FieldId_binpath = 162 - ,command_FieldId_amctest = 163 - ,command_FieldId_dofork = 164 - ,command_FieldId_q = 165 - ,command_FieldId_cijob = 166 - ,command_FieldId_capture = 167 - ,command_FieldId_exec = 168 - ,command_FieldId_astr = 169 - ,command_FieldId_anum = 170 - ,command_FieldId_adbl = 171 - ,command_FieldId_aflag = 172 - ,command_FieldId_str = 173 - ,command_FieldId_num = 174 - ,command_FieldId_dbl = 175 - ,command_FieldId_flag = 176 - ,command_FieldId_dstr = 177 - ,command_FieldId_dnum = 178 - ,command_FieldId_ddbl = 179 - ,command_FieldId_dflag = 180 - ,command_FieldId_mstr = 181 - ,command_FieldId_mnum = 182 - ,command_FieldId_mdbl = 183 - ,command_FieldId_amnum = 184 - ,command_FieldId_fconst = 185 - ,command_FieldId_cconst = 186 - ,command_FieldId_dregx = 187 - ,command_FieldId_dpkey = 188 - ,command_FieldId_comptest = 189 - ,command_FieldId_mdbg = 190 - ,command_FieldId_run = 191 - ,command_FieldId_printinput = 192 - ,command_FieldId_normalize = 193 - ,command_FieldId_covcapture = 194 - ,command_FieldId_covcheck = 195 - ,command_FieldId_compdir = 196 - ,command_FieldId_check_untracked = 197 - ,command_FieldId_memcheck = 198 - ,command_FieldId_callgrind = 199 - ,command_FieldId_stream = 200 - ,command_FieldId_i = 201 - ,command_FieldId_b = 202 - ,command_FieldId_covdir = 203 - ,command_FieldId_logfile = 204 - ,command_FieldId_runcmd = 205 - ,command_FieldId_exclude = 206 - ,command_FieldId_mergepath = 207 - ,command_FieldId_gcov = 208 - ,command_FieldId_ssim = 209 - ,command_FieldId_xmlpretty = 210 - ,command_FieldId_summary = 211 - ,command_FieldId_reprofile = 212 - ,command_FieldId_args = 213 - ,command_FieldId_inputfile = 214 - ,command_FieldId_fuzzstrat = 215 - ,command_FieldId_seed = 216 - ,command_FieldId_testprob = 217 - ,command_FieldId_gtblacttst = 218 - ,command_FieldId_mr = 219 - ,command_FieldId_note = 220 - ,command_FieldId_skip_init = 221 - ,command_FieldId_skip_git_init = 222 - ,command_FieldId_ncmd = 223 - ,command_FieldId_nofork = 224 - ,command_FieldId_perf_secs = 225 - ,command_FieldId_pertest_timeout = 226 - ,command_FieldId_stats = 227 - ,command_FieldId_enable = 228 - ,command_FieldId_disable = 229 - ,command_FieldId_gc = 230 - ,command_FieldId_dir = 231 - ,command_FieldId_hitrate = 232 - ,command_FieldId_after = 233 - ,command_FieldId_selector = 234 - ,command_FieldId_fields = 235 - ,command_FieldId_accept = 236 - ,command_FieldId_approve = 237 - ,command_FieldId_needs_work = 238 - ,command_FieldId_authdir = 239 - ,command_FieldId_gitdir = 240 - ,command_FieldId_show_gitlab_system_notes = 241 - ,command_FieldId_attach = 242 - ,command_FieldId_catchthrow = 243 - ,command_FieldId_tui = 244 - ,command_FieldId_bcmd = 245 - ,command_FieldId_emacs = 246 - ,command_FieldId_manywin = 247 - ,command_FieldId_follow_child = 248 - ,command_FieldId_py = 249 - ,command_FieldId_writessimfile = 250 - ,command_FieldId_url = 251 - ,command_FieldId_tables = 252 - ,command_FieldId_nologo = 253 - ,command_FieldId_baddbok = 254 - ,command_FieldId_move = 255 - ,command_FieldId_dedup = 256 - ,command_FieldId_commit = 257 - ,command_FieldId_undo = 258 - ,command_FieldId_hash = 259 - ,command_FieldId_expr = 260 - ,command_FieldId_style = 261 - ,command_FieldId_match = 262 - ,command_FieldId_string = 263 - ,command_FieldId_show = 264 - ,command_FieldId_name = 265 - ,command_FieldId_files = 266 - ,command_FieldId_refs = 267 - ,command_FieldId_body = 268 - ,command_FieldId_targsrc = 269 - ,command_FieldId_func = 270 - ,command_FieldId_nextfile = 271 - ,command_FieldId_other = 272 - ,command_FieldId_updateproto = 273 - ,command_FieldId_listfunc = 274 - ,command_FieldId_iffy = 275 - ,command_FieldId_gen = 276 - ,command_FieldId_showloc = 277 - ,command_FieldId_showstatic = 278 - ,command_FieldId_showsortkey = 279 - ,command_FieldId_sortname = 280 - ,command_FieldId_baddecl = 281 - ,command_FieldId_indent = 282 - ,command_FieldId_update_copyright = 283 - ,command_FieldId_scriptfile = 284 - ,command_FieldId_linelim = 285 - ,command_FieldId_strayfile = 286 - ,command_FieldId_badchar = 287 - ,command_FieldId_badline = 288 - ,command_FieldId_expand = 289 - ,command_FieldId_ignoreQuote = 290 - ,command_FieldId_maxpacket = 291 - ,command_FieldId_db = 292 - ,command_FieldId_createdb = 293 - ,command_FieldId_typetag = 294 - ,command_FieldId_format = 295 - ,command_FieldId_tocamelcase = 296 - ,command_FieldId_tolowerunder = 297 - ,command_FieldId_pathcomp = 298 - ,command_FieldId_fname = 299 - ,command_FieldId_outseparator = 300 - ,command_FieldId_header = 301 - ,command_FieldId_prefer_signed = 302 - ,command_FieldId_value = 303 + ,command_FieldId_amc = 113 + ,command_FieldId_sigcheck = 114 + ,command_FieldId_data_dir = 115 + ,command_FieldId_related = 116 + ,command_FieldId_notssimfile = 117 + ,command_FieldId_checkable = 118 + ,command_FieldId_r = 119 + ,command_FieldId_nsdb = 120 + ,command_FieldId_fkey = 121 + ,command_FieldId_start = 122 + ,command_FieldId_stop = 123 + ,command_FieldId_abort = 124 + ,command_FieldId_shell = 125 + ,command_FieldId_serv = 126 + ,command_FieldId_in_dir = 127 + ,command_FieldId_out_dir = 128 + ,command_FieldId_proto = 129 + ,command_FieldId_showcomment = 130 + ,command_FieldId_trace = 131 + ,command_FieldId_key = 132 + ,command_FieldId_include = 133 + ,command_FieldId_dot = 134 + ,command_FieldId_xns = 135 + ,command_FieldId_noinput = 136 + ,command_FieldId_render = 137 + ,command_FieldId_id = 138 + ,command_FieldId_file_prefix = 139 + ,command_FieldId_nchild = 140 + ,command_FieldId_blocking = 141 + ,command_FieldId_nmsg = 142 + ,command_FieldId_timeout = 143 + ,command_FieldId_recvdelay_ns = 144 + ,command_FieldId_senddelay_ns = 145 + ,command_FieldId_msgsize_min = 146 + ,command_FieldId_msgsize_max = 147 + ,command_FieldId_bufsize = 148 + ,command_FieldId_recvdelay = 149 + ,command_FieldId_pkgdata = 150 + ,command_FieldId_diff = 151 + ,command_FieldId_push = 152 + ,command_FieldId_remove = 153 + ,command_FieldId_origin = 154 + ,command_FieldId_ref = 155 + ,command_FieldId_showrec = 156 + ,command_FieldId_showfile = 157 + ,command_FieldId_R = 158 + ,command_FieldId_reset = 159 + ,command_FieldId_checkclean = 160 + ,command_FieldId_stat = 161 + ,command_FieldId_annotate = 162 + ,command_FieldId_data_in = 163 + ,command_FieldId_binpath = 164 + ,command_FieldId_amctest = 165 + ,command_FieldId_dofork = 166 + ,command_FieldId_q = 167 + ,command_FieldId_cijob = 168 + ,command_FieldId_capture = 169 + ,command_FieldId_check_clean = 170 + ,command_FieldId_exec = 171 + ,command_FieldId_astr = 172 + ,command_FieldId_anum = 173 + ,command_FieldId_adbl = 174 + ,command_FieldId_aflag = 175 + ,command_FieldId_str = 176 + ,command_FieldId_num = 177 + ,command_FieldId_dbl = 178 + ,command_FieldId_flag = 179 + ,command_FieldId_dstr = 180 + ,command_FieldId_dnum = 181 + ,command_FieldId_ddbl = 182 + ,command_FieldId_dflag = 183 + ,command_FieldId_mstr = 184 + ,command_FieldId_mnum = 185 + ,command_FieldId_mdbl = 186 + ,command_FieldId_amnum = 187 + ,command_FieldId_fconst = 188 + ,command_FieldId_cconst = 189 + ,command_FieldId_dregx = 190 + ,command_FieldId_dpkey = 191 + ,command_FieldId_comptest = 192 + ,command_FieldId_mdbg = 193 + ,command_FieldId_run = 194 + ,command_FieldId_printinput = 195 + ,command_FieldId_normalize = 196 + ,command_FieldId_covcapture = 197 + ,command_FieldId_covcheck = 198 + ,command_FieldId_bindir = 199 + ,command_FieldId_check_untracked = 200 + ,command_FieldId_memcheck = 201 + ,command_FieldId_callgrind = 202 + ,command_FieldId_stream = 203 + ,command_FieldId_i = 204 + ,command_FieldId_b = 205 + ,command_FieldId_covfast = 206 + ,command_FieldId_minrepeat = 207 + ,command_FieldId_maxrepeat = 208 + ,command_FieldId_covdir = 209 + ,command_FieldId_logfile = 210 + ,command_FieldId_runcmd = 211 + ,command_FieldId_exclude = 212 + ,command_FieldId_mergepath = 213 + ,command_FieldId_gcov = 214 + ,command_FieldId_ssim = 215 + ,command_FieldId_xmlpretty = 216 + ,command_FieldId_summary = 217 + ,command_FieldId_incremental = 218 + ,command_FieldId_tempdir = 219 + ,command_FieldId_dbgshell = 220 + ,command_FieldId_reprofile = 221 + ,command_FieldId_args = 222 + ,command_FieldId_inputfile = 223 + ,command_FieldId_fuzzstrat = 224 + ,command_FieldId_seed = 225 + ,command_FieldId_testprob = 226 + ,command_FieldId_gtblacttst = 227 + ,command_FieldId_mr = 228 + ,command_FieldId_note = 229 + ,command_FieldId_skip_init = 230 + ,command_FieldId_skip_git_init = 231 + ,command_FieldId_ncmd = 232 + ,command_FieldId_nofork = 233 + ,command_FieldId_perf_secs = 234 + ,command_FieldId_pertest_timeout = 235 + ,command_FieldId_stats = 236 + ,command_FieldId_enable = 237 + ,command_FieldId_disable = 238 + ,command_FieldId_gc = 239 + ,command_FieldId_dir = 240 + ,command_FieldId_hitrate = 241 + ,command_FieldId_after = 242 + ,command_FieldId_selector = 243 + ,command_FieldId_fields = 244 + ,command_FieldId_accept = 245 + ,command_FieldId_approve = 246 + ,command_FieldId_needs_work = 247 + ,command_FieldId_authdir = 248 + ,command_FieldId_gitdir = 249 + ,command_FieldId_show_gitlab_system_notes = 250 + ,command_FieldId_file = 251 + ,command_FieldId_kv = 252 + ,command_FieldId_output = 253 + ,command_FieldId_attach = 254 + ,command_FieldId_pid = 255 + ,command_FieldId_catchthrow = 256 + ,command_FieldId_tui = 257 + ,command_FieldId_bcmd = 258 + ,command_FieldId_emacs = 259 + ,command_FieldId_manywin = 260 + ,command_FieldId_follow_child = 261 + ,command_FieldId_py = 262 + ,command_FieldId_mp = 263 + ,command_FieldId_writessimfile = 264 + ,command_FieldId_url = 265 + ,command_FieldId_tables = 266 + ,command_FieldId_nologo = 267 + ,command_FieldId_baddbok = 268 + ,command_FieldId_move = 269 + ,command_FieldId_dedup = 270 + ,command_FieldId_commit = 271 + ,command_FieldId_undo = 272 + ,command_FieldId_hash = 273 + ,command_FieldId_parse_make = 274 + ,command_FieldId_makefile = 275 + ,command_FieldId_expr = 276 + ,command_FieldId_style = 277 + ,command_FieldId_full = 278 + ,command_FieldId_f = 279 + ,command_FieldId_match = 280 + ,command_FieldId_string = 281 + ,command_FieldId_name = 282 + ,command_FieldId_files = 283 + ,command_FieldId_refs = 284 + ,command_FieldId_targsrc = 285 + ,command_FieldId_acrkey = 286 + ,command_FieldId_func = 287 + ,command_FieldId_nextfile = 288 + ,command_FieldId_other = 289 + ,command_FieldId_updateproto = 290 + ,command_FieldId_createmissing = 291 + ,command_FieldId_iffy = 292 + ,command_FieldId_gen = 293 + ,command_FieldId_showloc = 294 + ,command_FieldId_showstatic = 295 + ,command_FieldId_matchproto = 296 + ,command_FieldId_matchbody = 297 + ,command_FieldId_matchcomment = 298 + ,command_FieldId_showsortkey = 299 + ,command_FieldId_showbody = 300 + ,command_FieldId_sortname = 301 + ,command_FieldId_printssim = 302 + ,command_FieldId_baddecl = 303 + ,command_FieldId_indent = 304 + ,command_FieldId_update_copyright = 305 + ,command_FieldId_scriptfile = 306 + ,command_FieldId_linelim = 307 + ,command_FieldId_strayfile = 308 + ,command_FieldId_badchar = 309 + ,command_FieldId_badline = 310 + ,command_FieldId_expand = 311 + ,command_FieldId_ignoreQuote = 312 + ,command_FieldId_maxpacket = 313 + ,command_FieldId_db = 314 + ,command_FieldId_createdb = 315 + ,command_FieldId_typetag = 316 + ,command_FieldId_format = 317 + ,command_FieldId_tocamelcase = 318 + ,command_FieldId_tolowerunder = 319 + ,command_FieldId_pathcomp = 320 + ,command_FieldId_fname = 321 + ,command_FieldId_outseparator = 322 + ,command_FieldId_header = 323 + ,command_FieldId_prefer_signed = 324 + ,command_FieldId_value = 325 }; -enum { command_FieldIdEnum_N = 304 }; +enum { command_FieldIdEnum_N = 326 }; // --- command_abt_cache_Enum @@ -363,16 +386,15 @@ enum command_atf_cmdline_fconst_Enum { // command.atf_cmdline.fconst enum { command_atf_cmdline_fconst_Enum_N = 3 }; -// --- command_samp_regx_style_Enum +// --- command_jkv_output_Enum -enum command_samp_regx_style_Enum { // command.samp_regx.style - command_samp_regx_style_acr = 0 // ACR-style regx - ,command_samp_regx_style_shell = 1 // Shell-style regx - ,command_samp_regx_style_classic = 2 // Classic regx - ,command_samp_regx_style_literal = 3 // Literal string +enum command_jkv_output_Enum { // command.jkv.output + command_jkv_output_auto = 0 // Automatic + ,command_jkv_output_json = 1 // Json only + ,command_jkv_output_kv = 2 // Key-value only }; -enum { command_samp_regx_style_Enum_N = 4 }; +enum { command_jkv_output_Enum_N = 3 }; // --- command_ssimfilt_format_Enum @@ -404,6 +426,7 @@ namespace command { struct atf_cmdline_mdbl_curs; } namespace command { struct atf_cmdline_amnum_curs; } namespace command { struct gcache_cmd_curs; } namespace command { struct gcli_fields_curs; } +namespace command { struct jkv_kv_curs; } namespace command { struct mdbg_args_curs; } namespace command { struct mdbg_b_curs; } namespace command { struct sandbox_cmd_curs; } @@ -433,8 +456,6 @@ namespace command { struct amc_gc_proc; } namespace command { struct amc_proc; } namespace command { struct amc_vis; } namespace command { struct amc_vis_proc; } -namespace command { struct ams_cat; } -namespace command { struct ams_cat_proc; } namespace command { struct ams_sendtest; } namespace command { struct ams_sendtest_proc; } namespace command { struct apm; } @@ -451,6 +472,8 @@ namespace command { struct atf_comp; } namespace command { struct atf_comp_proc; } namespace command { struct atf_cov; } namespace command { struct atf_cov_proc; } +namespace command { struct atf_exp; } +namespace command { struct atf_exp_proc; } namespace command { struct atf_fuzz; } namespace command { struct atf_fuzz_proc; } namespace command { struct atf_gcli; } @@ -467,12 +490,18 @@ namespace command { struct gcache; } namespace command { struct gcache_proc; } namespace command { struct gcli; } namespace command { struct gcli_proc; } +namespace command { struct generic; } +namespace command { struct generic_proc; } +namespace command { struct jkv; } +namespace command { struct jkv_proc; } namespace command { struct mdbg; } namespace command { struct mdbg_proc; } namespace command { struct mysql2ssim; } namespace command { struct mysql2ssim_proc; } namespace command { struct orgfile; } namespace command { struct orgfile_proc; } +namespace command { struct samp_make; } +namespace command { struct samp_make_proc; } namespace command { struct samp_meng; } namespace command { struct samp_meng_proc; } namespace command { struct samp_regx; } @@ -670,29 +699,29 @@ i32 abt_NArgs(command::FieldId field, algo::strptr& out_dflt, b // --- command.abt_md // access: command.abt_md_proc.abt_md (Exec) struct abt_md { // command.abt_md - algo::cstring in; // "data" Input directory or filename, - for stdin - algo_lib::Regx readme; // "%" Sql Regx of dev::Readme - algo_lib::Regx ns; // "" Sql Regx of dmmeta::Ns - algo_lib::Regx section; // "%" Sql Regx - bool update; // true (action) Update mode: Re-generate mdfiles - bool check; // false (action) Check mode: Check syntax and links - bool link; // false (with -print) Print links - bool anchor; // false (with -print) Print anchors - bool print; // false (action) Query mode: Print .md section without evaluating - bool dry_run; // false Do not write changes to disk - bool external; // false Check external links as well (may fail if no internet connection) - bool evalcmd; // true Execute inline-commands + algo::cstring in; // "data" Input directory or filename, - for stdin + algo_lib::Regx readmefile; // "%" Sql Regx of dev::Readmefile + algo_lib::Regx ns; // "" Sql Regx of dmmeta::Ns + algo_lib::Regx section; // "%" Sql Regx + bool update; // true (action) Update mode: Re-generate mdfiles + bool check; // false (action) Check mode: Check syntax and links + bool link; // false (with -print) Print links + bool anchor; // false (with -print) Print anchors + bool print; // false (action) Query mode: Print .md section without evaluating + bool dry_run; // false Do not write changes to disk + bool external; // false Check external links as well (may fail if no internet connection) + bool evalcmd; // true Execute inline-commands // func:command.abt_md..Ctor inline abt_md() __attribute__((nothrow)); }; // Print back to string -// func:command.abt_md.readme.Print -void readme_Print(command::abt_md& parent, algo::cstring &out) __attribute__((nothrow)); +// func:command.abt_md.readmefile.Print +void readmefile_Print(command::abt_md& parent, algo::cstring &out) __attribute__((nothrow)); // Read Regx from string // Convert string to field. Return success value -// func:command.abt_md.readme.ReadStrptrMaybe -bool readme_ReadStrptrMaybe(command::abt_md& parent, algo::strptr in) __attribute__((nothrow)); +// func:command.abt_md.readmefile.ReadStrptrMaybe +bool readmefile_ReadStrptrMaybe(command::abt_md& parent, algo::strptr in) __attribute__((nothrow)); // Print back to string // func:command.abt_md.ns.Print @@ -912,6 +941,11 @@ algo::cstring& where_AllocAt(command::acr& parent, int at) __attribute__(( // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.acr.where.AllocN algo::aryptr where_AllocN(command::acr& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.acr.where.AllocNAt +algo::aryptr where_AllocNAt(command::acr& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.acr.where.EmptyQ inline bool where_EmptyQ(command::acr& parent) __attribute__((nothrow)); @@ -968,6 +1002,10 @@ algo::aryptr where_AllocNVal(command::acr& parent, int n_elems, c // Function returns success value. // func:command.acr.where.ReadStrptrMaybe bool where_ReadStrptrMaybe(command::acr& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.acr.where.Insary +void where_Insary(command::acr& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -985,6 +1023,11 @@ algo::cstring& field_AllocAt(command::acr& parent, int at) __attribute__(( // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.acr.field.AllocN algo::aryptr field_AllocN(command::acr& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.acr.field.AllocNAt +algo::aryptr field_AllocNAt(command::acr& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.acr.field.EmptyQ inline bool field_EmptyQ(command::acr& parent) __attribute__((nothrow)); @@ -1041,6 +1084,10 @@ algo::aryptr field_AllocNVal(command::acr& parent, int n_elems, c // Function returns success value. // func:command.acr.field.ReadStrptrMaybe bool field_ReadStrptrMaybe(command::acr& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.acr.field.Insary +void field_Insary(command::acr& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:command.acr.where_curs.Next @@ -1223,6 +1270,11 @@ algo::cstring& arg_AllocAt(command::acr_dm& parent, int at) __attribute__( // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.acr_dm.arg.AllocN algo::aryptr arg_AllocN(command::acr_dm& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.acr_dm.arg.AllocNAt +algo::aryptr arg_AllocNAt(command::acr_dm& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.acr_dm.arg.EmptyQ inline bool arg_EmptyQ(command::acr_dm& parent) __attribute__((nothrow)); @@ -1279,6 +1331,10 @@ algo::aryptr arg_AllocNVal(command::acr_dm& parent, int n_elems, // Function returns success value. // func:command.acr_dm.arg.ReadStrptrMaybe bool arg_ReadStrptrMaybe(command::acr_dm& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.acr_dm.arg.Insary +void arg_Insary(command::acr_dm& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:command.acr_dm.arg_curs.Next @@ -1418,6 +1474,7 @@ struct acr_ed { // command.acr_ed bool showcpp; // false (With -sandbox), show resulting diff algo::cstring msgtype; // "" (with -ctype) use this msgtype as type bool anonfld; // false Create anonfld + bool amc; // true Run amc if needed // func:command.acr_ed..Ctor inline acr_ed() __attribute__((nothrow)); }; @@ -1775,13 +1832,14 @@ void acr_proc_Uninit(command::acr_proc& parent) __attribute__((n // --- command.amc // access: command.amc_proc.amc (Exec) struct amc { // command.amc - algo::cstring in_dir; // "data" Root of input ssim dir - algo::cstring query; // "" Query mode: generate code for specified object - algo::cstring out_dir; // "." Root of output cpp dir - bool proto; // false Print prototype - bool report; // true Final report - bool e; // false Open matching records in editor - algo_lib::Regx trace; // "" Sql Regx + algo::cstring in_dir; // "data" Root of input ssim dir + algo::cstring query; // "" Query mode: generate code for specified object + algo::cstring out_dir; // "." Root of output cpp dir + bool proto; // false Print prototype + bool showcomment; // true Show generated comments + bool report; // true Final report + bool e; // false Open matching records in editor + algo_lib::Regx trace; // "" Sql Regx // func:command.amc..Ctor inline amc() __attribute__((nothrow)); }; @@ -1980,7 +2038,7 @@ struct amc_vis { // command.amc_vis algo::cstring in; // "data" Input directory or filename, - for stdin algo::cstring dot; // "" Save dot file with specified filename bool xref; // false Include all ctypes referenced by selected ones - bool xns; // false Cross namespace boundaries + bool xns; // true Cross namespace boundaries bool noinput; // false Deselect module inputs bool check; // false Check model for dependency problems bool render; // true Produce an ascii drawing @@ -2073,89 +2131,6 @@ inline void amc_vis_proc_Init(command::amc_vis_proc& parent); // func:command.amc_vis_proc..Uninit void amc_vis_proc_Uninit(command::amc_vis_proc& parent) __attribute__((nothrow)); -// --- command.ams_cat -// access: command.ams_cat_proc.ams_cat (Exec) -struct ams_cat { // command.ams_cat - algo::cstring in; // "data" Input directory or filename, - for stdin - // func:command.ams_cat..Ctor - inline ams_cat() __attribute__((nothrow)); -}; - -// func:command.ams_cat..ReadFieldMaybe -bool ams_cat_ReadFieldMaybe(command::ams_cat& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of command::ams_cat from attributes of ascii tuple TUPLE -// func:command.ams_cat..ReadTupleMaybe -bool ams_cat_ReadTupleMaybe(command::ams_cat &parent, algo::Tuple &tuple) __attribute__((nothrow)); -// Set all fields to initial values. -// func:command.ams_cat..Init -inline void ams_cat_Init(command::ams_cat& parent); -// Convenience function that returns a full command line -// Assume command is in a directory called bin -// func:command.ams_cat..ToCmdline -tempstr ams_cat_ToCmdline(command::ams_cat& row) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:command.ams_cat.Argv printfmt:Tuple -// func:command.ams_cat..PrintArgv -void ams_cat_PrintArgv(command::ams_cat& row, algo::cstring& str) __attribute__((nothrow)); -// Used with command lines -// Return # of command-line arguments that must follow this argument -// If FIELD is invalid, return -1 -// func:command.ams_cat..NArgs -i32 ams_cat_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) __attribute__((nothrow)); - -// --- command.ams_cat_proc -struct ams_cat_proc { // command.ams_cat_proc: Subprocess: Algo Messaging System sample tool - algo::cstring path; // "bin/ams_cat" path for executable - command::ams_cat cmd; // command line for child process - algo::cstring fstdin; // redirect for stdin - algo::cstring fstdout; // redirect for stdout - algo::cstring fstderr; // redirect for stderr - pid_t pid; // 0 pid of running child process - i32 timeout; // 0 optional timeout for child process - i32 status; // 0 last exit status of child process - // func:command.ams_cat_proc..Ctor - inline ams_cat_proc() __attribute__((nothrow)); - // func:command.ams_cat_proc..Dtor - inline ~ams_cat_proc() __attribute__((nothrow)); -}; - -// Start subprocess -// If subprocess already running, do nothing. Otherwise, start it -// func:command.ams_cat_proc.ams_cat.Start -int ams_cat_Start(command::ams_cat_proc& parent) __attribute__((nothrow)); -// Start subprocess & Read output -// func:command.ams_cat_proc.ams_cat.StartRead -algo::Fildes ams_cat_StartRead(command::ams_cat_proc& parent, algo_lib::FFildes &read) __attribute__((nothrow)); -// Kill subprocess and wait -// func:command.ams_cat_proc.ams_cat.Kill -void ams_cat_Kill(command::ams_cat_proc& parent); -// Wait for subprocess to return -// func:command.ams_cat_proc.ams_cat.Wait -void ams_cat_Wait(command::ams_cat_proc& parent) __attribute__((nothrow)); -// Start + Wait -// Execute subprocess and return exit code -// func:command.ams_cat_proc.ams_cat.Exec -int ams_cat_Exec(command::ams_cat_proc& parent) __attribute__((nothrow)); -// Start + Wait, throw exception on error -// Execute subprocess; throw human-readable exception on error -// func:command.ams_cat_proc.ams_cat.ExecX -void ams_cat_ExecX(command::ams_cat_proc& parent); -// Call execv() -// Call execv with specified parameters -// func:command.ams_cat_proc.ams_cat.Execv -int ams_cat_Execv(command::ams_cat_proc& parent) __attribute__((nothrow)); -// func:command.ams_cat_proc.ams_cat.ToCmdline -algo::tempstr ams_cat_ToCmdline(command::ams_cat_proc& parent) __attribute__((nothrow)); -// Form array from the command line -// func:command.ams_cat_proc.ams_cat.ToArgv -void ams_cat_ToArgv(command::ams_cat_proc& parent, algo::StringAry& args) __attribute__((nothrow)); - -// Set all fields to initial values. -// func:command.ams_cat_proc..Init -inline void ams_cat_proc_Init(command::ams_cat_proc& parent); -// func:command.ams_cat_proc..Uninit -void ams_cat_proc_Uninit(command::ams_cat_proc& parent) __attribute__((nothrow)); - // --- command.ams_sendtest // access: command.ams_sendtest_proc.ams_sendtest (Exec) struct ams_sendtest { // command.ams_sendtest @@ -2389,13 +2364,22 @@ void apm_proc_Uninit(command::apm_proc& parent) __attribute__((n // --- command.aqlite // access: command.aqlite_proc.aqlite (Exec) struct aqlite { // command.aqlite - algo::cstring in; // "data" Input directory or filename, - for stdin - algo::cstring schema; // "data" Schema dir - algo::cstring cmd; // Sql Query to run + algo::cstring in; // "data" Input directory or filename, - for stdin + algo::cstring schema; // "data" Schema dir + algo::cstring cmd; // Sql Query to run + algo_lib::Regx ns; // "dmmeta" Sql Regx of dmmeta::Ns // func:command.aqlite..Ctor inline aqlite() __attribute__((nothrow)); }; +// Print back to string +// func:command.aqlite.ns.Print +void ns_Print(command::aqlite& parent, algo::cstring &out) __attribute__((nothrow)); +// Read Regx from string +// Convert string to field. Return success value +// func:command.aqlite.ns.ReadStrptrMaybe +bool ns_ReadStrptrMaybe(command::aqlite& parent, algo::strptr in) __attribute__((nothrow)); + // func:command.aqlite..ReadFieldMaybe bool aqlite_ReadFieldMaybe(command::aqlite& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); // Read fields of command::aqlite from attributes of ascii tuple TUPLE @@ -2403,7 +2387,7 @@ bool aqlite_ReadFieldMaybe(command::aqlite& parent, algo::strptr bool aqlite_ReadTupleMaybe(command::aqlite &parent, algo::Tuple &tuple) __attribute__((nothrow)); // Set all fields to initial values. // func:command.aqlite..Init -inline void aqlite_Init(command::aqlite& parent); +void aqlite_Init(command::aqlite& parent); // Convenience function that returns a full command line // Assume command is in a directory called bin // func:command.aqlite..ToCmdline @@ -2572,11 +2556,12 @@ void atf_amc_proc_Uninit(command::atf_amc_proc& parent) __attrib // --- command.atf_ci // access: command.atf_ci_proc.atf_ci (Exec) struct atf_ci { // command.atf_ci - algo::cstring in; // "data" Input directory or filename, - for stdin - algo_lib::Regx citest; // "%" Sql Regx of atfdb::Citest - i32 maxerr; // 0 Exit after this many errors - algo_lib::Regx cijob; // "%" Sql Regx of atfdb::Cijob - bool capture; // false Capture the output of the test + algo::cstring in; // "data" Input directory or filename, - for stdin + algo_lib::Regx citest; // "%" Sql Regx of atfdb::Citest + i32 maxerr; // 0 Exit after this many errors + algo_lib::Regx cijob; // "%" Sql Regx of atfdb::Cijob + bool capture; // false Capture the output of the test + bool check_clean; // true Check for modifications after each test // func:command.atf_ci..Ctor inline atf_ci() __attribute__((nothrow)); }; @@ -2704,7 +2689,7 @@ struct atf_cmdline { // command.atf_cmdline u32 amnum_n; // number of elements in array u32 amnum_max; // max. capacity of array before realloc u8 fconst; // 0 Fconst for field - algo::Month cconst; // 0 Fconst for arg ctype + algo::Month cconst; // Fconst for arg ctype algo_lib::Regx dregx; // "%" Sql Regx of dmmeta::Ctype algo::Smallstr100 dpkey; // "" Predefined pkey // func:command.atf_cmdline..AssignOp @@ -2733,6 +2718,11 @@ algo::cstring& mstr_AllocAt(command::atf_cmdline& parent, int at) __attrib // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.atf_cmdline.mstr.AllocN algo::aryptr mstr_AllocN(command::atf_cmdline& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.atf_cmdline.mstr.AllocNAt +algo::aryptr mstr_AllocNAt(command::atf_cmdline& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.atf_cmdline.mstr.EmptyQ inline bool mstr_EmptyQ(command::atf_cmdline& parent) __attribute__((nothrow)); @@ -2789,6 +2779,10 @@ algo::aryptr mstr_AllocNVal(command::atf_cmdline& parent, int n_e // Function returns success value. // func:command.atf_cmdline.mstr.ReadStrptrMaybe bool mstr_ReadStrptrMaybe(command::atf_cmdline& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.atf_cmdline.mstr.Insary +void mstr_Insary(command::atf_cmdline& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -2806,6 +2800,11 @@ i32& mnum_AllocAt(command::atf_cmdline& parent, int at) __attrib // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.atf_cmdline.mnum.AllocN algo::aryptr mnum_AllocN(command::atf_cmdline& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.atf_cmdline.mnum.AllocNAt +algo::aryptr mnum_AllocNAt(command::atf_cmdline& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.atf_cmdline.mnum.EmptyQ inline bool mnum_EmptyQ(command::atf_cmdline& parent) __attribute__((nothrow)); @@ -2862,6 +2861,10 @@ algo::aryptr mnum_AllocNVal(command::atf_cmdline& parent, int n_elems, c // Function returns success value. // func:command.atf_cmdline.mnum.ReadStrptrMaybe bool mnum_ReadStrptrMaybe(command::atf_cmdline& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.atf_cmdline.mnum.Insary +void mnum_Insary(command::atf_cmdline& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -2879,6 +2882,11 @@ double& mdbl_AllocAt(command::atf_cmdline& parent, int at) __attrib // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.atf_cmdline.mdbl.AllocN algo::aryptr mdbl_AllocN(command::atf_cmdline& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.atf_cmdline.mdbl.AllocNAt +algo::aryptr mdbl_AllocNAt(command::atf_cmdline& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.atf_cmdline.mdbl.EmptyQ inline bool mdbl_EmptyQ(command::atf_cmdline& parent) __attribute__((nothrow)); @@ -2935,6 +2943,10 @@ algo::aryptr mdbl_AllocNVal(command::atf_cmdline& parent, int n_elems, c // Function returns success value. // func:command.atf_cmdline.mdbl.ReadStrptrMaybe bool mdbl_ReadStrptrMaybe(command::atf_cmdline& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.atf_cmdline.mdbl.Insary +void mdbl_Insary(command::atf_cmdline& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -2952,6 +2964,11 @@ i32& amnum_AllocAt(command::atf_cmdline& parent, int at) __attri // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.atf_cmdline.amnum.AllocN algo::aryptr amnum_AllocN(command::atf_cmdline& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.atf_cmdline.amnum.AllocNAt +algo::aryptr amnum_AllocNAt(command::atf_cmdline& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.atf_cmdline.amnum.EmptyQ inline bool amnum_EmptyQ(command::atf_cmdline& parent) __attribute__((nothrow)); @@ -3008,6 +3025,10 @@ algo::aryptr amnum_AllocNVal(command::atf_cmdline& parent, int n_elems, // Function returns success value. // func:command.atf_cmdline.amnum.ReadStrptrMaybe bool amnum_ReadStrptrMaybe(command::atf_cmdline& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.atf_cmdline.amnum.Insary +void amnum_Insary(command::atf_cmdline& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Get value of field as enum type // func:command.atf_cmdline.fconst.GetEnum @@ -3181,12 +3202,11 @@ struct atf_comp { // command.atf_comp bool normalize; // false (action) Renumber and normalize tmsgs bool covcapture; // false (action) Capture new coverage percentages and save back bool covcheck; // false (action) Check coverage percentages against tgtcov table - algo::cstring compdir; // "" Component image directory (exe) + algo::cstring bindir; // "" Directory with binaries (default: build/cfg) algo::Smallstr50 cfg; // "release" Set config bool check_untracked; // true Check for untracked file before allowing test to run - i32 maxerr; // 1 Exit after this many errors + i32 maxerr; // 3 Exit after this many errors bool build; // false Build given cfg before test - bool ood; // false Check given cfg for ood before test bool memcheck; // false Run under memory checker (valgrind) bool force; // false (With -memcheck) run suppressed memcheck bool callgrind; // false Run under callgrind profiler (valgrind) @@ -3194,8 +3214,11 @@ struct atf_comp { // command.atf_comp bool stream; // false prints component's output bool i; // false Read and execute testcase from stdin bool write; // true (implied with -e) Write any changes back to ssim tables - bool report; // false Print final report + bool report; // true Print final report algo::cstring b; // "" Breakpoint passed to mdbg as-is + bool covfast; // true Speedup coverage processing + i32 minrepeat; // 0 Execute every comptest at least this many times + i32 maxrepeat; // 1 Don't repeat any individual comptest more than X times // func:command.atf_comp..Ctor inline atf_comp() __attribute__((nothrow)); }; @@ -3288,19 +3311,20 @@ void atf_comp_proc_Uninit(command::atf_comp_proc& parent) __attr // --- command.atf_cov // access: command.atf_cov_proc.atf_cov (Exec) struct atf_cov { // command.atf_cov - algo::cstring in; // "data" Input directory or filename, - for stdin - algo::cstring covdir; // "temp/covdata" Output directory to save coverage data - algo::cstring logfile; // "" Log file - algo::cstring runcmd; // "" command to run - algo_lib::Regx exclude; // "(extern|include/gen|cpp/gen)/%" Sql Regx of dev::Gitfile - algo::cstring mergepath; // "" colon-separated dir list to load .cov.ssim files from - bool gcov; // false run gcov - bool ssim; // false write out ssim files - bool report; // false write out all reports - bool capture; // false Write coverage information into tgtcov table - bool xmlpretty; // false Generate pretty-formatted XML - bool summary; // true Show summary figures - bool check; // false Check coverage information against tgtcov table + algo::cstring in; // "data" Input directory or filename, - for stdin + algo::cstring covdir; // "temp/covdata" Output directory to save coverage data + algo::cstring logfile; // "" Log file + algo::cstring runcmd; // "" command to run + algo_lib::Regx exclude; // "(extern|include/gen|cpp/gen)/%" Sql Regx of dev::Gitfile + algo::cstring mergepath; // "" colon-separated dir list to load .cov.ssim files from + bool gcov; // false run gcov + bool ssim; // false write out ssim files + bool report; // false write out all reports + bool capture; // false Write coverage information into tgtcov table + bool xmlpretty; // false Generate pretty-formatted XML + bool summary; // true Show summary figures + bool check; // false Check coverage information against tgtcov table + bool incremental; // false Keep *.gcda files from previous run // func:command.atf_cov..Ctor inline atf_cov() __attribute__((nothrow)); }; @@ -3388,6 +3412,95 @@ inline void atf_cov_proc_Init(command::atf_cov_proc& parent); // func:command.atf_cov_proc..Uninit void atf_cov_proc_Uninit(command::atf_cov_proc& parent) __attribute__((nothrow)); +// --- command.atf_exp +// access: command.atf_exp_proc.atf_exp (Exec) +struct atf_exp { // command.atf_exp + algo::cstring in; // "data" Input directory or filename, - for stdin + algo::cstring trace; // "" Regx of things to trace + algo::cstring bindir; // "bin" Directory with binaries + algo::Smallstr50 comptest; // "" Component test name + algo::cstring tempdir; // "" Temporary directory for the component test + double timeout; // 8.0 Timeout in seconds for a step + bool dbgshell; // false Invoke bash with curr envs in case of timeout + // func:command.atf_exp..Ctor + inline atf_exp() __attribute__((nothrow)); +}; + +// func:command.atf_exp..ReadFieldMaybe +bool atf_exp_ReadFieldMaybe(command::atf_exp& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of command::atf_exp from attributes of ascii tuple TUPLE +// func:command.atf_exp..ReadTupleMaybe +bool atf_exp_ReadTupleMaybe(command::atf_exp &parent, algo::Tuple &tuple) __attribute__((nothrow)); +// Set all fields to initial values. +// func:command.atf_exp..Init +inline void atf_exp_Init(command::atf_exp& parent); +// Convenience function that returns a full command line +// Assume command is in a directory called bin +// func:command.atf_exp..ToCmdline +tempstr atf_exp_ToCmdline(command::atf_exp& row) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:command.atf_exp.Argv printfmt:Tuple +// func:command.atf_exp..PrintArgv +void atf_exp_PrintArgv(command::atf_exp& row, algo::cstring& str) __attribute__((nothrow)); +// Used with command lines +// Return # of command-line arguments that must follow this argument +// If FIELD is invalid, return -1 +// func:command.atf_exp..NArgs +i32 atf_exp_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) __attribute__((nothrow)); + +// --- command.atf_exp_proc +struct atf_exp_proc { // command.atf_exp_proc: Subprocess: ATF expect + algo::cstring path; // "bin/atf_exp" path for executable + command::atf_exp cmd; // command line for child process + algo::cstring fstdin; // redirect for stdin + algo::cstring fstdout; // redirect for stdout + algo::cstring fstderr; // redirect for stderr + pid_t pid; // 0 pid of running child process + i32 timeout; // 0 optional timeout for child process + i32 status; // 0 last exit status of child process + // func:command.atf_exp_proc..Ctor + inline atf_exp_proc() __attribute__((nothrow)); + // func:command.atf_exp_proc..Dtor + inline ~atf_exp_proc() __attribute__((nothrow)); +}; + +// Start subprocess +// If subprocess already running, do nothing. Otherwise, start it +// func:command.atf_exp_proc.atf_exp.Start +int atf_exp_Start(command::atf_exp_proc& parent) __attribute__((nothrow)); +// Start subprocess & Read output +// func:command.atf_exp_proc.atf_exp.StartRead +algo::Fildes atf_exp_StartRead(command::atf_exp_proc& parent, algo_lib::FFildes &read) __attribute__((nothrow)); +// Kill subprocess and wait +// func:command.atf_exp_proc.atf_exp.Kill +void atf_exp_Kill(command::atf_exp_proc& parent); +// Wait for subprocess to return +// func:command.atf_exp_proc.atf_exp.Wait +void atf_exp_Wait(command::atf_exp_proc& parent) __attribute__((nothrow)); +// Start + Wait +// Execute subprocess and return exit code +// func:command.atf_exp_proc.atf_exp.Exec +int atf_exp_Exec(command::atf_exp_proc& parent) __attribute__((nothrow)); +// Start + Wait, throw exception on error +// Execute subprocess; throw human-readable exception on error +// func:command.atf_exp_proc.atf_exp.ExecX +void atf_exp_ExecX(command::atf_exp_proc& parent); +// Call execv() +// Call execv with specified parameters +// func:command.atf_exp_proc.atf_exp.Execv +int atf_exp_Execv(command::atf_exp_proc& parent) __attribute__((nothrow)); +// func:command.atf_exp_proc.atf_exp.ToCmdline +algo::tempstr atf_exp_ToCmdline(command::atf_exp_proc& parent) __attribute__((nothrow)); +// Form array from the command line +// func:command.atf_exp_proc.atf_exp.ToArgv +void atf_exp_ToArgv(command::atf_exp_proc& parent, algo::StringAry& args) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:command.atf_exp_proc..Init +inline void atf_exp_proc_Init(command::atf_exp_proc& parent); +// func:command.atf_exp_proc..Uninit +void atf_exp_proc_Uninit(command::atf_exp_proc& parent) __attribute__((nothrow)); + // --- command.atf_fuzz // access: command.atf_fuzz_proc.atf_fuzz (Exec) struct atf_fuzz { // command.atf_fuzz @@ -3973,6 +4086,11 @@ algo::cstring& cmd_AllocAt(command::gcache& parent, int at) __attribute__( // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.gcache.cmd.AllocN algo::aryptr cmd_AllocN(command::gcache& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.gcache.cmd.AllocNAt +algo::aryptr cmd_AllocNAt(command::gcache& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.gcache.cmd.EmptyQ inline bool cmd_EmptyQ(command::gcache& parent) __attribute__((nothrow)); @@ -4029,6 +4147,10 @@ algo::aryptr cmd_AllocNVal(command::gcache& parent, int n_elems, // Function returns success value. // func:command.gcache.cmd.ReadStrptrMaybe bool cmd_ReadStrptrMaybe(command::gcache& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.gcache.cmd.Insary +void cmd_Insary(command::gcache& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:command.gcache.cmd_curs.Next @@ -4132,7 +4254,7 @@ struct gcli { // command.gcli algo::cstring* fields_elems; // pointer to elements u32 fields_n; // number of elements in array u32 fields_max; // max. capacity of array before realloc - bool accept; // false (action) accept a slected merge request + bool accept; // false (action) accept a selected merge request bool start; // false (action) start working on a selected issue bool list; // false (action) show selected table bool create; // false (action) create a table record(s) @@ -4172,6 +4294,11 @@ algo::cstring& fields_AllocAt(command::gcli& parent, int at) __attribute__ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.gcli.fields.AllocN algo::aryptr fields_AllocN(command::gcli& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.gcli.fields.AllocNAt +algo::aryptr fields_AllocNAt(command::gcli& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.gcli.fields.EmptyQ inline bool fields_EmptyQ(command::gcli& parent) __attribute__((nothrow)); @@ -4228,6 +4355,10 @@ algo::aryptr fields_AllocNVal(command::gcli& parent, int n_elems, // Function returns success value. // func:command.gcli.fields.ReadStrptrMaybe bool fields_ReadStrptrMaybe(command::gcli& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.gcli.fields.Insary +void fields_Insary(command::gcli& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:command.gcli.fields_curs.Next @@ -4319,6 +4450,292 @@ inline void gcli_proc_Init(command::gcli_proc& parent); // func:command.gcli_proc..Uninit void gcli_proc_Uninit(command::gcli_proc& parent) __attribute__((nothrow)); +// --- command.generic +// access: command.generic_proc.name (Exec) +struct generic { // command.generic: Any generic subprocess + // func:command.generic..Ctor + inline generic() __attribute__((nothrow)); +}; + +// print string representation of ROW to string STR +// cfmt:command.generic.ArgvGnu printfmt:Auto +// func:command.generic..PrintArgv +void generic_PrintArgv(command::generic& row, algo::cstring& str) __attribute__((nothrow)); + +// --- command.generic_proc +struct generic_proc { // command.generic_proc + algo::cstring path; // "" path for executable + command::generic cmd; // command line for child process + algo::cstring fstdin; // redirect for stdin + algo::cstring fstdout; // redirect for stdout + algo::cstring fstderr; // redirect for stderr + pid_t pid; // 0 pid of running child process + i32 timeout; // 0 optional timeout for child process + i32 status; // 0 last exit status of child process + // func:command.generic_proc..Ctor + inline generic_proc() __attribute__((nothrow)); + // func:command.generic_proc..Dtor + inline ~generic_proc() __attribute__((nothrow)); +}; + +// Start subprocess +// If subprocess already running, do nothing. Otherwise, start it +// func:command.generic_proc.name.Start +int name_Start(command::generic_proc& parent) __attribute__((nothrow)); +// Start subprocess & Read output +// func:command.generic_proc.name.StartRead +algo::Fildes name_StartRead(command::generic_proc& parent, algo_lib::FFildes &read) __attribute__((nothrow)); +// Kill subprocess and wait +// func:command.generic_proc.name.Kill +void name_Kill(command::generic_proc& parent); +// Wait for subprocess to return +// func:command.generic_proc.name.Wait +void name_Wait(command::generic_proc& parent) __attribute__((nothrow)); +// Start + Wait +// Execute subprocess and return exit code +// func:command.generic_proc.name.Exec +int name_Exec(command::generic_proc& parent) __attribute__((nothrow)); +// Start + Wait, throw exception on error +// Execute subprocess; throw human-readable exception on error +// func:command.generic_proc.name.ExecX +void name_ExecX(command::generic_proc& parent); +// Call execv() +// Call execv with specified parameters +// func:command.generic_proc.name.Execv +int name_Execv(command::generic_proc& parent) __attribute__((nothrow)); +// func:command.generic_proc.name.ToCmdline +algo::tempstr name_ToCmdline(command::generic_proc& parent) __attribute__((nothrow)); +// Form array from the command line +// func:command.generic_proc.name.ToArgv +void name_ToArgv(command::generic_proc& parent, algo::StringAry& args) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:command.generic_proc..Init +inline void generic_proc_Init(command::generic_proc& parent); +// func:command.generic_proc..Uninit +void generic_proc_Uninit(command::generic_proc& parent) __attribute__((nothrow)); + +// --- command.jkv +// access: command.jkv_proc.jkv (Exec) +struct jkv { // command.jkv + algo::cstring in; // "data" Input directory or filename, - for stdin + algo::cstring file; // Filename (use - for stdin) + algo::cstring* kv_elems; // pointer to elements + u32 kv_n; // number of elements in array + u32 kv_max; // max. capacity of array before realloc + bool r; // false Reverse (json keyvals -> JSON) mapping + bool write; // false Write the modified file back + u8 output; // 0 Output format + u32 pretty; // 2 Pretty-printer (0-compact; 1=algo style; 2=jq style) + // func:command.jkv..AssignOp + command::jkv& operator =(const command::jkv &rhs) __attribute__((nothrow)); + // func:command.jkv..Ctor + inline jkv() __attribute__((nothrow)); + // func:command.jkv..Dtor + inline ~jkv() __attribute__((nothrow)); + // func:command.jkv..CopyCtor + jkv(const command::jkv &rhs) __attribute__((nothrow)); +}; + +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.jkv.kv.Addary +algo::aryptr kv_Addary(command::jkv& parent, algo::aryptr rhs) __attribute__((nothrow)); +// Reserve space. Insert element at the end +// The new element is initialized to a default value +// func:command.jkv.kv.Alloc +algo::cstring& kv_Alloc(command::jkv& parent) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.jkv.kv.AllocAt +algo::cstring& kv_AllocAt(command::jkv& parent, int at) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:command.jkv.kv.AllocN +algo::aryptr kv_AllocN(command::jkv& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.jkv.kv.AllocNAt +algo::aryptr kv_AllocNAt(command::jkv& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:command.jkv.kv.EmptyQ +inline bool kv_EmptyQ(command::jkv& parent) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:command.jkv.kv.Find +inline algo::cstring* kv_Find(command::jkv& parent, u64 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array pointer by value +// func:command.jkv.kv.Getary +inline algo::aryptr kv_Getary(const command::jkv& parent) __attribute__((nothrow)); +// Return pointer to last element of array, or NULL if array is empty +// func:command.jkv.kv.Last +inline algo::cstring* kv_Last(command::jkv& parent) __attribute__((nothrow, pure)); +// Return max. number of items in the array +// func:command.jkv.kv.Max +inline i32 kv_Max(command::jkv& parent) __attribute__((nothrow)); +// Return number of items in the array +// func:command.jkv.kv.N +inline i32 kv_N(const command::jkv& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove item by index. If index outside of range, do nothing. +// func:command.jkv.kv.Remove +void kv_Remove(command::jkv& parent, u32 i) __attribute__((nothrow)); +// func:command.jkv.kv.RemoveAll +void kv_RemoveAll(command::jkv& parent) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:command.jkv.kv.RemoveLast +void kv_RemoveLast(command::jkv& parent) __attribute__((nothrow)); +// Make sure N *more* elements will fit in array. Process dies if out of memory +// func:command.jkv.kv.Reserve +inline void kv_Reserve(command::jkv& parent, int n) __attribute__((nothrow)); +// Make sure N elements fit in array. Process dies if out of memory +// func:command.jkv.kv.AbsReserve +void kv_AbsReserve(command::jkv& parent, int n) __attribute__((nothrow)); +// Copy contents of RHS to PARENT. +// func:command.jkv.kv.Setary +void kv_Setary(command::jkv& parent, command::jkv &rhs) __attribute__((nothrow)); +// Copy specified array into kv, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +// func:command.jkv.kv.Setary2 +void kv_Setary(command::jkv& parent, const algo::aryptr &rhs) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:command.jkv.kv.qFind +inline algo::cstring& kv_qFind(command::jkv& parent, u64 t) __attribute__((nothrow)); +// Return reference to last element of array. No bounds checking +// func:command.jkv.kv.qLast +inline algo::cstring& kv_qLast(command::jkv& parent) __attribute__((nothrow)); +// Return row id of specified element +// func:command.jkv.kv.rowid_Get +inline u64 kv_rowid_Get(command::jkv& parent, algo::cstring &elem) __attribute__((nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:command.jkv.kv.AllocNVal +algo::aryptr kv_AllocNVal(command::jkv& parent, int n_elems, const algo::cstring& val) __attribute__((nothrow)); +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +// func:command.jkv.kv.ReadStrptrMaybe +bool kv_ReadStrptrMaybe(command::jkv& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.jkv.kv.Insary +void kv_Insary(command::jkv& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); + +// Get value of field as enum type +// func:command.jkv.output.GetEnum +inline command_jkv_output_Enum output_GetEnum(const command::jkv& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:command.jkv.output.SetEnum +inline void output_SetEnum(command::jkv& parent, command_jkv_output_Enum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:command.jkv.output.ToCstr +const char* output_ToCstr(const command::jkv& parent) __attribute__((nothrow)); +// Convert output to a string. First, attempt conversion to a known string. +// If no string matches, print output as a numeric value. +// func:command.jkv.output.Print +void output_Print(const command::jkv& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:command.jkv.output.SetStrptrMaybe +bool output_SetStrptrMaybe(command::jkv& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:command.jkv.output.SetStrptr +void output_SetStrptr(command::jkv& parent, algo::strptr rhs, command_jkv_output_Enum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:command.jkv.output.ReadStrptrMaybe +bool output_ReadStrptrMaybe(command::jkv& parent, algo::strptr rhs) __attribute__((nothrow)); + +// proceed to next item +// func:command.jkv.kv_curs.Next +inline void jkv_kv_curs_Next(jkv_kv_curs &curs) __attribute__((nothrow)); +// func:command.jkv.kv_curs.Reset +inline void jkv_kv_curs_Reset(jkv_kv_curs &curs, command::jkv &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:command.jkv.kv_curs.ValidQ +inline bool jkv_kv_curs_ValidQ(jkv_kv_curs &curs) __attribute__((nothrow)); +// item access +// func:command.jkv.kv_curs.Access +inline algo::cstring& jkv_kv_curs_Access(jkv_kv_curs &curs) __attribute__((nothrow)); +// func:command.jkv..ReadFieldMaybe +bool jkv_ReadFieldMaybe(command::jkv& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of command::jkv from attributes of ascii tuple TUPLE +// func:command.jkv..ReadTupleMaybe +bool jkv_ReadTupleMaybe(command::jkv &parent, algo::Tuple &tuple) __attribute__((nothrow)); +// Set all fields to initial values. +// func:command.jkv..Init +inline void jkv_Init(command::jkv& parent); +// func:command.jkv..Uninit +void jkv_Uninit(command::jkv& parent) __attribute__((nothrow)); +// Convenience function that returns a full command line +// Assume command is in a directory called bin +// func:command.jkv..ToCmdline +tempstr jkv_ToCmdline(command::jkv& row) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:command.jkv.Argv printfmt:Tuple +// func:command.jkv..PrintArgv +void jkv_PrintArgv(command::jkv& row, algo::cstring& str) __attribute__((nothrow)); +// func:command.jkv..GetAnon +algo::strptr jkv_GetAnon(command::jkv &parent, i32 idx) __attribute__((nothrow)); +// Used with command lines +// Return # of command-line arguments that must follow this argument +// If FIELD is invalid, return -1 +// func:command.jkv..NArgs +i32 jkv_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) __attribute__((nothrow)); + +// --- command.jkv_proc +struct jkv_proc { // command.jkv_proc: Subprocess: JSON <-> key-value mapping tool + algo::cstring path; // "bin/jkv" path for executable + command::jkv cmd; // command line for child process + algo::cstring fstdin; // redirect for stdin + algo::cstring fstdout; // redirect for stdout + algo::cstring fstderr; // redirect for stderr + pid_t pid; // 0 pid of running child process + i32 timeout; // 0 optional timeout for child process + i32 status; // 0 last exit status of child process + // func:command.jkv_proc..Ctor + inline jkv_proc() __attribute__((nothrow)); + // func:command.jkv_proc..Dtor + inline ~jkv_proc() __attribute__((nothrow)); +}; + +// Start subprocess +// If subprocess already running, do nothing. Otherwise, start it +// func:command.jkv_proc.jkv.Start +int jkv_Start(command::jkv_proc& parent) __attribute__((nothrow)); +// Start subprocess & Read output +// func:command.jkv_proc.jkv.StartRead +algo::Fildes jkv_StartRead(command::jkv_proc& parent, algo_lib::FFildes &read) __attribute__((nothrow)); +// Kill subprocess and wait +// func:command.jkv_proc.jkv.Kill +void jkv_Kill(command::jkv_proc& parent); +// Wait for subprocess to return +// func:command.jkv_proc.jkv.Wait +void jkv_Wait(command::jkv_proc& parent) __attribute__((nothrow)); +// Start + Wait +// Execute subprocess and return exit code +// func:command.jkv_proc.jkv.Exec +int jkv_Exec(command::jkv_proc& parent) __attribute__((nothrow)); +// Start + Wait, throw exception on error +// Execute subprocess; throw human-readable exception on error +// func:command.jkv_proc.jkv.ExecX +void jkv_ExecX(command::jkv_proc& parent); +// Call execv() +// Call execv with specified parameters +// func:command.jkv_proc.jkv.Execv +int jkv_Execv(command::jkv_proc& parent) __attribute__((nothrow)); +// func:command.jkv_proc.jkv.ToCmdline +algo::tempstr jkv_ToCmdline(command::jkv_proc& parent) __attribute__((nothrow)); +// Form array from the command line +// func:command.jkv_proc.jkv.ToArgv +void jkv_ToArgv(command::jkv_proc& parent, algo::StringAry& args) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:command.jkv_proc..Init +inline void jkv_proc_Init(command::jkv_proc& parent); +// func:command.jkv_proc..Uninit +void jkv_proc_Uninit(command::jkv_proc& parent) __attribute__((nothrow)); + // --- command.mdbg // access: command.mdbg_proc.mdbg (Exec) struct mdbg { // command.mdbg @@ -4330,6 +4747,7 @@ struct mdbg { // command.mdbg algo::Smallstr50 cfg; // "debug" Configuration to use bool disas; // false Show disassembly (use F12) bool attach; // false Attach to a running process + i32 pid; // 0 (with -attach) Pid, if omitted mdbg will guess algo::cstring* b_elems; // pointer to elements u32 b_n; // number of elements in array u32 b_max; // max. capacity of array before realloc @@ -4338,9 +4756,10 @@ struct mdbg { // command.mdbg algo::cstring bcmd; // "" Evaluate command at breakpoint bool emacs; // true Use emacs environment as the debugger bool manywin; // false Use gdb-many-windows emacs mode - bool follow_child; // false + bool follow_child; // false When forking, follow child (default is parent) bool py; // false Enable python scripting bool dry_run; // false Print commands but don't execute + bool mp; // false Multi-process debugging // func:command.mdbg..AssignOp command::mdbg& operator =(const command::mdbg &rhs) __attribute__((nothrow)); // func:command.mdbg..Ctor @@ -4367,6 +4786,11 @@ algo::cstring& args_AllocAt(command::mdbg& parent, int at) __attribute__(( // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.mdbg.args.AllocN algo::aryptr args_AllocN(command::mdbg& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.mdbg.args.AllocNAt +algo::aryptr args_AllocNAt(command::mdbg& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.mdbg.args.EmptyQ inline bool args_EmptyQ(command::mdbg& parent) __attribute__((nothrow)); @@ -4423,6 +4847,10 @@ algo::aryptr args_AllocNVal(command::mdbg& parent, int n_elems, c // Function returns success value. // func:command.mdbg.args.ReadStrptrMaybe bool args_ReadStrptrMaybe(command::mdbg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.mdbg.args.Insary +void args_Insary(command::mdbg& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -4440,6 +4868,11 @@ algo::cstring& b_AllocAt(command::mdbg& parent, int at) __attribute__((__w // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.mdbg.b.AllocN algo::aryptr b_AllocN(command::mdbg& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.mdbg.b.AllocNAt +algo::aryptr b_AllocNAt(command::mdbg& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.mdbg.b.EmptyQ inline bool b_EmptyQ(command::mdbg& parent) __attribute__((nothrow)); @@ -4496,6 +4929,10 @@ algo::aryptr b_AllocNVal(command::mdbg& parent, int n_elems, cons // Function returns success value. // func:command.mdbg.b.ReadStrptrMaybe bool b_ReadStrptrMaybe(command::mdbg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.mdbg.b.Insary +void b_Insary(command::mdbg& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:command.mdbg.args_curs.Next @@ -4786,6 +5223,101 @@ inline void orgfile_proc_Init(command::orgfile_proc& parent); // func:command.orgfile_proc..Uninit void orgfile_proc_Uninit(command::orgfile_proc& parent) __attribute__((nothrow)); +// --- command.samp_make +// access: command.samp_make_proc.samp_make (Exec) +struct samp_make { // command.samp_make + algo::cstring in; // "data" Input directory or filename, - for stdin + algo_lib::Regx target; // "%" Sql Regx of sampdb::Target + bool parse_make; // false Parse extern/gnumake/Simple-Makefile + algo::cstring makefile; // "extern/gnumake/Simple-Makefile" (with parse_make) makefile to parse + bool write; // false P(with parse_make) write ssimfiles, otherwise print them + // func:command.samp_make..Ctor + inline samp_make() __attribute__((nothrow)); +}; + +// Print back to string +// func:command.samp_make.target.Print +void target_Print(command::samp_make& parent, algo::cstring &out) __attribute__((nothrow)); +// Read Regx from string +// Convert string to field. Return success value +// func:command.samp_make.target.ReadStrptrMaybe +bool target_ReadStrptrMaybe(command::samp_make& parent, algo::strptr in) __attribute__((nothrow)); + +// func:command.samp_make..ReadFieldMaybe +bool samp_make_ReadFieldMaybe(command::samp_make& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of command::samp_make from attributes of ascii tuple TUPLE +// func:command.samp_make..ReadTupleMaybe +bool samp_make_ReadTupleMaybe(command::samp_make &parent, algo::Tuple &tuple) __attribute__((nothrow)); +// Set all fields to initial values. +// func:command.samp_make..Init +void samp_make_Init(command::samp_make& parent); +// Convenience function that returns a full command line +// Assume command is in a directory called bin +// func:command.samp_make..ToCmdline +tempstr samp_make_ToCmdline(command::samp_make& row) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:command.samp_make.Argv printfmt:Tuple +// func:command.samp_make..PrintArgv +void samp_make_PrintArgv(command::samp_make& row, algo::cstring& str) __attribute__((nothrow)); +// Used with command lines +// Return # of command-line arguments that must follow this argument +// If FIELD is invalid, return -1 +// func:command.samp_make..NArgs +i32 samp_make_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) __attribute__((nothrow)); + +// --- command.samp_make_proc +struct samp_make_proc { // command.samp_make_proc: Subprocess: sample program for Makefile management + algo::cstring path; // "bin/samp_make" path for executable + command::samp_make cmd; // command line for child process + algo::cstring fstdin; // redirect for stdin + algo::cstring fstdout; // redirect for stdout + algo::cstring fstderr; // redirect for stderr + pid_t pid; // 0 pid of running child process + i32 timeout; // 0 optional timeout for child process + i32 status; // 0 last exit status of child process + // func:command.samp_make_proc..Ctor + inline samp_make_proc() __attribute__((nothrow)); + // func:command.samp_make_proc..Dtor + inline ~samp_make_proc() __attribute__((nothrow)); +}; + +// Start subprocess +// If subprocess already running, do nothing. Otherwise, start it +// func:command.samp_make_proc.samp_make.Start +int samp_make_Start(command::samp_make_proc& parent) __attribute__((nothrow)); +// Start subprocess & Read output +// func:command.samp_make_proc.samp_make.StartRead +algo::Fildes samp_make_StartRead(command::samp_make_proc& parent, algo_lib::FFildes &read) __attribute__((nothrow)); +// Kill subprocess and wait +// func:command.samp_make_proc.samp_make.Kill +void samp_make_Kill(command::samp_make_proc& parent); +// Wait for subprocess to return +// func:command.samp_make_proc.samp_make.Wait +void samp_make_Wait(command::samp_make_proc& parent) __attribute__((nothrow)); +// Start + Wait +// Execute subprocess and return exit code +// func:command.samp_make_proc.samp_make.Exec +int samp_make_Exec(command::samp_make_proc& parent) __attribute__((nothrow)); +// Start + Wait, throw exception on error +// Execute subprocess; throw human-readable exception on error +// func:command.samp_make_proc.samp_make.ExecX +void samp_make_ExecX(command::samp_make_proc& parent); +// Call execv() +// Call execv with specified parameters +// func:command.samp_make_proc.samp_make.Execv +int samp_make_Execv(command::samp_make_proc& parent) __attribute__((nothrow)); +// func:command.samp_make_proc.samp_make.ToCmdline +algo::tempstr samp_make_ToCmdline(command::samp_make_proc& parent) __attribute__((nothrow)); +// Form array from the command line +// func:command.samp_make_proc.samp_make.ToArgv +void samp_make_ToArgv(command::samp_make_proc& parent, algo::StringAry& args) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:command.samp_make_proc..Init +inline void samp_make_proc_Init(command::samp_make_proc& parent); +// func:command.samp_make_proc..Uninit +void samp_make_proc_Uninit(command::samp_make_proc& parent) __attribute__((nothrow)); + // --- command.samp_meng // access: command.samp_meng_proc.samp_meng (Exec) struct samp_meng { // command.samp_meng @@ -4817,7 +5349,7 @@ void samp_meng_PrintArgv(command::samp_meng& row, algo::cstring& i32 samp_meng_NArgs(command::FieldId field, algo::strptr& out_dflt, bool* out_anon) __attribute__((nothrow)); // --- command.samp_meng_proc -struct samp_meng_proc { // command.samp_meng_proc: Subprocess: +struct samp_meng_proc { // command.samp_meng_proc: Subprocess: Sample matching engine algo::cstring path; // "bin/samp_meng" path for executable command::samp_meng cmd; // command line for child process algo::cstring fstdin; // redirect for stdin @@ -4872,43 +5404,19 @@ void samp_meng_proc_Uninit(command::samp_meng_proc& parent) __at // --- command.samp_regx // access: command.samp_regx_proc.samp_regx (Exec) struct samp_regx { // command.samp_regx - algo::cstring in; // "data" Input directory or filename, - for stdin - algo::cstring expr; // Expression - u8 style; // 0 Regx style - bool match; // false Match a string - algo::cstring string; // "" String to match - bool show; // false Show regx innards + algo::cstring in; // "data" Input directory or filename, - for stdin + algo::cstring expr; // Expression + algo_lib::RegxStyle style; // 2 Regx style + bool trace; // false Trace regx innards + bool capture; // false Use capture groups + bool full; // true Match full string + bool f; // false is a filename, grep the lines + bool match; // false Match a string, exit code represnts success + algo::cstring string; // "" String to match // func:command.samp_regx..Ctor inline samp_regx() __attribute__((nothrow)); }; -// Get value of field as enum type -// func:command.samp_regx.style.GetEnum -inline command_samp_regx_style_Enum style_GetEnum(const command::samp_regx& parent) __attribute__((nothrow)); -// Set value of field from enum type. -// func:command.samp_regx.style.SetEnum -inline void style_SetEnum(command::samp_regx& parent, command_samp_regx_style_Enum rhs) __attribute__((nothrow)); -// Convert numeric value of field to one of predefined string constants. -// If string is found, return a static C string. Otherwise, return NULL. -// func:command.samp_regx.style.ToCstr -const char* style_ToCstr(const command::samp_regx& parent) __attribute__((nothrow)); -// Convert style to a string. First, attempt conversion to a known string. -// If no string matches, print style as a numeric value. -// func:command.samp_regx.style.Print -void style_Print(const command::samp_regx& parent, algo::cstring &lhs) __attribute__((nothrow)); -// Convert string to field. -// If the string is invalid, do not modify field and return false. -// In case of success, return true -// func:command.samp_regx.style.SetStrptrMaybe -bool style_SetStrptrMaybe(command::samp_regx& parent, algo::strptr rhs) __attribute__((nothrow)); -// Convert string to field. -// If the string is invalid, set numeric value to DFLT -// func:command.samp_regx.style.SetStrptr -void style_SetStrptr(command::samp_regx& parent, algo::strptr rhs, command_samp_regx_style_Enum dflt) __attribute__((nothrow)); -// Convert string to field. Return success value -// func:command.samp_regx.style.ReadStrptrMaybe -bool style_ReadStrptrMaybe(command::samp_regx& parent, algo::strptr rhs) __attribute__((nothrow)); - // func:command.samp_regx..ReadFieldMaybe bool samp_regx_ReadFieldMaybe(command::samp_regx& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); // Read fields of command::samp_regx from attributes of ascii tuple TUPLE @@ -5005,7 +5513,8 @@ struct sandbox { // command.sandbox algo::cstring* files_elems; // pointer to elements u32 files_n; // number of elements in array u32 files_max; // max. capacity of array before realloc - algo::cstring refs; // "HEAD" Refs to fetch into sandbox + algo::cstring refs; // "HEAD" Additional list of refs to fetch into sandbox + algo::cstring ref; // "HEAD" Reset to this ref bool q; // false Quiet mode // func:command.sandbox..AssignOp command::sandbox& operator =(const command::sandbox &rhs) __attribute__((nothrow)); @@ -5041,6 +5550,11 @@ algo::cstring& cmd_AllocAt(command::sandbox& parent, int at) __attribute__ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.sandbox.cmd.AllocN algo::aryptr cmd_AllocN(command::sandbox& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.sandbox.cmd.AllocNAt +algo::aryptr cmd_AllocNAt(command::sandbox& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.sandbox.cmd.EmptyQ inline bool cmd_EmptyQ(command::sandbox& parent) __attribute__((nothrow)); @@ -5097,6 +5611,10 @@ algo::aryptr cmd_AllocNVal(command::sandbox& parent, int n_elems, // Function returns success value. // func:command.sandbox.cmd.ReadStrptrMaybe bool cmd_ReadStrptrMaybe(command::sandbox& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.sandbox.cmd.Insary +void cmd_Insary(command::sandbox& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -5114,6 +5632,11 @@ algo::cstring& files_AllocAt(command::sandbox& parent, int at) __attribute // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.sandbox.files.AllocN algo::aryptr files_AllocN(command::sandbox& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.sandbox.files.AllocNAt +algo::aryptr files_AllocNAt(command::sandbox& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.sandbox.files.EmptyQ inline bool files_EmptyQ(command::sandbox& parent) __attribute__((nothrow)); @@ -5170,6 +5693,10 @@ algo::aryptr files_AllocNVal(command::sandbox& parent, int n_elem // Function returns success value. // func:command.sandbox.files.ReadStrptrMaybe bool files_ReadStrptrMaybe(command::sandbox& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.sandbox.files.Insary +void files_Insary(command::sandbox& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:command.sandbox.cmd_curs.Next @@ -5275,78 +5802,82 @@ void sandbox_proc_Uninit(command::sandbox_proc& parent) __attrib // --- command.src_func // access: command.src_func_proc.src_func (Exec) struct src_func { // command.src_func - algo::cstring in; // "data" Input directory or filename, - for stdin - algo_lib::Regx target; // "%" Sql Regx of dev::Target - algo_lib::Regx name; // "%" Sql Regx - algo_lib::Regx body; // "%" Sql Regx - algo_lib::Regx targsrc; // "" Sql Regx of dev::Targsrc - algo_lib::Regx func; // "%" Sql Regx - algo_lib::Regx comment; // "%" Sql Regx - algo::Smallstr200 nextfile; // "" Print name of next srcfile in targsrc list - bool other; // false (with -nextfile), name of previous file - bool updateproto; // false Update prototypes in headers - bool listfunc; // false Show functions in target - bool iffy; // false Select functions that may contain errors - bool proto; // false (with -listfunc) List prototypes only - bool gen; // false (with -listfunc) Visit generated files - bool showloc; // true (with -listfunc) Show file location - bool showstatic; // true (with -listfunc) Show static functions - bool showsortkey; // false (with -listfunc) Display function sortkey - bool sortname; // false (with -listfunc) Sort functions by name - bool e; // false (with -listfunc) Edit found functions - bool baddecl; // false Report and fail on bad declarations - bool report; // false + algo::cstring in; // "data" Input directory or filename, - for stdin + algo_lib::Regx targsrc; // "%" Sql Regx of dev::Targsrc + algo_lib::Regx acrkey; // "%" Sql Regx + algo_lib::Regx func; // "%" Sql Regx of dev::Target + algo::Smallstr200 nextfile; // "" (action) Print name of next srcfile in targsrc list + bool other; // false (with -nextfile), name of previous file + bool list; // false (action) List matching functions + bool updateproto; // false (action) Update prototypes in headers + bool createmissing; // false (action) Create missing functions declared in userfunc table + bool iffy; // false (filter) Select functions that may contain errors + bool gen; // false (scan) Scan generated files + bool showloc; // false (output) Show file location + bool f; // false (output) -sortname -showcomment -showbody + bool showstatic; // true (filter) Allow static functions + algo_lib::Regx matchproto; // "%" Sql Regx + algo_lib::Regx matchbody; // "%" Sql Regx + algo_lib::Regx matchcomment; // "%" Sql Regx + bool showsortkey; // false (output) Display function sortkey + bool showcomment; // false (output) Display function comment + bool showbody; // false (output) Print function body + bool sortname; // false (output) Sort functions by name + bool printssim; // false (output) Print ssim tuples + bool e; // false Edit found functions + bool baddecl; // false Report and fail on bad declarations + bool report; // false Print final report // func:command.src_func..Ctor inline src_func() __attribute__((nothrow)); }; // Print back to string -// func:command.src_func.target.Print -void target_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); +// func:command.src_func.targsrc.Print +void targsrc_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); // Read Regx from string // Convert string to field. Return success value -// func:command.src_func.target.ReadStrptrMaybe -bool target_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); +// func:command.src_func.targsrc.ReadStrptrMaybe +bool targsrc_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); // Print back to string -// func:command.src_func.name.Print -void name_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); +// func:command.src_func.acrkey.Print +void acrkey_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); // Read Regx from string // Convert string to field. Return success value -// func:command.src_func.name.ReadStrptrMaybe -bool name_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); +// func:command.src_func.acrkey.ReadStrptrMaybe +bool acrkey_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); // Print back to string -// func:command.src_func.body.Print -void body_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); +// func:command.src_func.func.Print +void func_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); // Read Regx from string // Convert string to field. Return success value -// func:command.src_func.body.ReadStrptrMaybe -bool body_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); +// func:command.src_func.func.ReadStrptrMaybe +bool func_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); // Print back to string -// func:command.src_func.targsrc.Print -void targsrc_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); +// func:command.src_func.matchproto.Print +void matchproto_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); // Read Regx from string // Convert string to field. Return success value -// func:command.src_func.targsrc.ReadStrptrMaybe -bool targsrc_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); +// func:command.src_func.matchproto.ReadStrptrMaybe +bool matchproto_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); // Print back to string -// func:command.src_func.func.Print -void func_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); +// func:command.src_func.matchbody.Print +void matchbody_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); // Read Regx from string // Convert string to field. Return success value -// func:command.src_func.func.ReadStrptrMaybe -bool func_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); +// func:command.src_func.matchbody.ReadStrptrMaybe +bool matchbody_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); // Print back to string -// func:command.src_func.comment.Print -void comment_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); +// func:command.src_func.matchcomment.Print +void matchcomment_Print(command::src_func& parent, algo::cstring &out) __attribute__((nothrow)); // Read Regx from string // Convert string to field. Return success value -// func:command.src_func.comment.ReadStrptrMaybe -bool comment_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); +// func:command.src_func.matchcomment.ReadStrptrMaybe +bool matchcomment_ReadStrptrMaybe(command::src_func& parent, algo::strptr in) __attribute__((nothrow)); // func:command.src_func..ReadFieldMaybe bool src_func_ReadFieldMaybe(command::src_func& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); @@ -5860,6 +6391,11 @@ algo::cstring& match_AllocAt(command::ssimfilt& parent, int at) __attribut // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.ssimfilt.match.AllocN algo::aryptr match_AllocN(command::ssimfilt& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.ssimfilt.match.AllocNAt +algo::aryptr match_AllocNAt(command::ssimfilt& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.ssimfilt.match.EmptyQ inline bool match_EmptyQ(command::ssimfilt& parent) __attribute__((nothrow)); @@ -5916,6 +6452,10 @@ algo::aryptr match_AllocNVal(command::ssimfilt& parent, int n_ele // Function returns success value. // func:command.ssimfilt.match.ReadStrptrMaybe bool match_ReadStrptrMaybe(command::ssimfilt& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.ssimfilt.match.Insary +void match_Insary(command::ssimfilt& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -5933,6 +6473,11 @@ algo::cstring& field_AllocAt(command::ssimfilt& parent, int at) __attribut // Reserve space. Insert N elements at the end of the array, return pointer to array // func:command.ssimfilt.field.AllocN algo::aryptr field_AllocN(command::ssimfilt& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:command.ssimfilt.field.AllocNAt +algo::aryptr field_AllocNAt(command::ssimfilt& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:command.ssimfilt.field.EmptyQ inline bool field_EmptyQ(command::ssimfilt& parent) __attribute__((nothrow)); @@ -5989,6 +6534,10 @@ algo::aryptr field_AllocNVal(command::ssimfilt& parent, int n_ele // Function returns success value. // func:command.ssimfilt.field.ReadStrptrMaybe bool field_ReadStrptrMaybe(command::ssimfilt& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:command.ssimfilt.field.Insary +void field_Insary(command::ssimfilt& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Get value of field as enum type // func:command.ssimfilt.format.GetEnum @@ -6394,6 +6943,15 @@ struct gcli_fields_curs {// cursor }; +struct jkv_kv_curs {// cursor + typedef algo::cstring ChildType; + algo::cstring* elems; + int n_elems; + int index; + jkv_kv_curs() { elems=NULL; n_elems=0; index=0; } +}; + + struct mdbg_args_curs {// cursor typedef algo::cstring ChildType; algo::cstring* elems; diff --git a/include/gen/command_gen.inl.h b/include/gen/command_gen.inl.h index 610984ee..f8936920 100644 --- a/include/gen/command_gen.inl.h +++ b/include/gen/command_gen.inl.h @@ -24,6 +24,7 @@ #pragma once #include "include/gen/algo_gen.inl.h" +#include "include/gen/algo_lib_gen.inl.h" //#pragma endinclude // --- command.FieldId.value.GetEnum @@ -654,36 +655,6 @@ inline command::amc_vis_proc::~amc_vis_proc() { command::amc_vis_proc_Uninit(*this); } -// --- command.ams_cat..Init -// Set all fields to initial values. -inline void command::ams_cat_Init(command::ams_cat& parent) { - parent.in = algo::strptr("data"); -} - -// --- command.ams_cat..Ctor -inline command::ams_cat::ams_cat() { - command::ams_cat_Init(*this); -} - -// --- command.ams_cat_proc..Init -// Set all fields to initial values. -inline void command::ams_cat_proc_Init(command::ams_cat_proc& parent) { - parent.path = algo::strptr("bin/ams_cat"); - parent.pid = pid_t(0); - parent.timeout = i32(0); - parent.status = i32(0); -} - -// --- command.ams_cat_proc..Ctor -inline command::ams_cat_proc::ams_cat_proc() { - command::ams_cat_proc_Init(*this); -} - -// --- command.ams_cat_proc..Dtor -inline command::ams_cat_proc::~ams_cat_proc() { - command::ams_cat_proc_Uninit(*this); -} - // --- command.ams_sendtest..Ctor inline command::ams_sendtest::ams_sendtest() { command::ams_sendtest_Init(*this); @@ -732,13 +703,6 @@ inline command::apm_proc::~apm_proc() { command::apm_proc_Uninit(*this); } -// --- command.aqlite..Init -// Set all fields to initial values. -inline void command::aqlite_Init(command::aqlite& parent) { - parent.in = algo::strptr("data"); - parent.schema = algo::strptr("data"); -} - // --- command.aqlite..Ctor inline command::aqlite::aqlite() { command::aqlite_Init(*this); @@ -1287,6 +1251,42 @@ inline command::atf_cov_proc::~atf_cov_proc() { command::atf_cov_proc_Uninit(*this); } +// --- command.atf_exp..Init +// Set all fields to initial values. +inline void command::atf_exp_Init(command::atf_exp& parent) { + parent.in = algo::strptr("data"); + parent.trace = algo::strptr(""); + parent.bindir = algo::strptr("bin"); + parent.comptest = algo::strptr(""); + parent.tempdir = algo::strptr(""); + parent.timeout = double(8.0); + parent.dbgshell = bool(false); +} + +// --- command.atf_exp..Ctor +inline command::atf_exp::atf_exp() { + command::atf_exp_Init(*this); +} + +// --- command.atf_exp_proc..Init +// Set all fields to initial values. +inline void command::atf_exp_proc_Init(command::atf_exp_proc& parent) { + parent.path = algo::strptr("bin/atf_exp"); + parent.pid = pid_t(0); + parent.timeout = i32(0); + parent.status = i32(0); +} + +// --- command.atf_exp_proc..Ctor +inline command::atf_exp_proc::atf_exp_proc() { + command::atf_exp_proc_Init(*this); +} + +// --- command.atf_exp_proc..Dtor +inline command::atf_exp_proc::~atf_exp_proc() { + command::atf_exp_proc_Uninit(*this); +} + // --- command.atf_fuzz..Ctor inline command::atf_fuzz::atf_fuzz() { command::atf_fuzz_Init(*this); @@ -1696,6 +1696,176 @@ inline command::gcli_proc::~gcli_proc() { command::gcli_proc_Uninit(*this); } +// --- command.generic..Ctor +inline command::generic::generic() { +} + +// --- command.generic_proc..Init +// Set all fields to initial values. +inline void command::generic_proc_Init(command::generic_proc& parent) { + parent.path = algo::strptr(""); + parent.pid = pid_t(0); + parent.timeout = i32(0); + parent.status = i32(0); +} + +// --- command.generic_proc..Ctor +inline command::generic_proc::generic_proc() { + command::generic_proc_Init(*this); +} + +// --- command.generic_proc..Dtor +inline command::generic_proc::~generic_proc() { + command::generic_proc_Uninit(*this); +} + +// --- command.jkv.kv.EmptyQ +// Return true if index is empty +inline bool command::kv_EmptyQ(command::jkv& parent) { + return parent.kv_n == 0; +} + +// --- command.jkv.kv.Find +// Look up row by row id. Return NULL if out of range +inline algo::cstring* command::kv_Find(command::jkv& parent, u64 t) { + u64 idx = t; + u64 lim = parent.kv_n; + if (idx >= lim) return NULL; + return parent.kv_elems + idx; +} + +// --- command.jkv.kv.Getary +// Return array pointer by value +inline algo::aryptr command::kv_Getary(const command::jkv& parent) { + return algo::aryptr(parent.kv_elems, parent.kv_n); +} + +// --- command.jkv.kv.Last +// Return pointer to last element of array, or NULL if array is empty +inline algo::cstring* command::kv_Last(command::jkv& parent) { + return kv_Find(parent, u64(parent.kv_n-1)); +} + +// --- command.jkv.kv.Max +// Return max. number of items in the array +inline i32 command::kv_Max(command::jkv& parent) { + (void)parent; + return parent.kv_max; +} + +// --- command.jkv.kv.N +// Return number of items in the array +inline i32 command::kv_N(const command::jkv& parent) { + return parent.kv_n; +} + +// --- command.jkv.kv.Reserve +// Make sure N *more* elements will fit in array. Process dies if out of memory +inline void command::kv_Reserve(command::jkv& parent, int n) { + u32 new_n = parent.kv_n + n; + if (UNLIKELY(new_n > parent.kv_max)) { + kv_AbsReserve(parent, new_n); + } +} + +// --- command.jkv.kv.qFind +// 'quick' Access row by row id. No bounds checking. +inline algo::cstring& command::kv_qFind(command::jkv& parent, u64 t) { + return parent.kv_elems[t]; +} + +// --- command.jkv.kv.qLast +// Return reference to last element of array. No bounds checking +inline algo::cstring& command::kv_qLast(command::jkv& parent) { + return kv_qFind(parent, u64(parent.kv_n-1)); +} + +// --- command.jkv.kv.rowid_Get +// Return row id of specified element +inline u64 command::kv_rowid_Get(command::jkv& parent, algo::cstring &elem) { + u64 id = &elem - parent.kv_elems; + return u64(id); +} + +// --- command.jkv.output.GetEnum +// Get value of field as enum type +inline command_jkv_output_Enum command::output_GetEnum(const command::jkv& parent) { + return command_jkv_output_Enum(parent.output); +} + +// --- command.jkv.output.SetEnum +// Set value of field from enum type. +inline void command::output_SetEnum(command::jkv& parent, command_jkv_output_Enum rhs) { + parent.output = u8(rhs); +} + +// --- command.jkv.kv_curs.Next +// proceed to next item +inline void command::jkv_kv_curs_Next(jkv_kv_curs &curs) { + curs.index++; +} + +// --- command.jkv.kv_curs.Reset +inline void command::jkv_kv_curs_Reset(jkv_kv_curs &curs, command::jkv &parent) { + curs.elems = parent.kv_elems; + curs.n_elems = parent.kv_n; + curs.index = 0; +} + +// --- command.jkv.kv_curs.ValidQ +// cursor points to valid item +inline bool command::jkv_kv_curs_ValidQ(jkv_kv_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- command.jkv.kv_curs.Access +// item access +inline algo::cstring& command::jkv_kv_curs_Access(jkv_kv_curs &curs) { + return curs.elems[curs.index]; +} + +// --- command.jkv..Init +// Set all fields to initial values. +inline void command::jkv_Init(command::jkv& parent) { + parent.in = algo::strptr("data"); + parent.kv_elems = 0; // (command.jkv.kv) + parent.kv_n = 0; // (command.jkv.kv) + parent.kv_max = 0; // (command.jkv.kv) + parent.r = bool(false); + parent.write = bool(false); + parent.output = u8(0); + parent.pretty = u32(2); +} + +// --- command.jkv..Ctor +inline command::jkv::jkv() { + command::jkv_Init(*this); +} + +// --- command.jkv..Dtor +inline command::jkv::~jkv() { + command::jkv_Uninit(*this); +} + +// --- command.jkv_proc..Init +// Set all fields to initial values. +inline void command::jkv_proc_Init(command::jkv_proc& parent) { + parent.path = algo::strptr("bin/jkv"); + parent.pid = pid_t(0); + parent.timeout = i32(0); + parent.status = i32(0); +} + +// --- command.jkv_proc..Ctor +inline command::jkv_proc::jkv_proc() { + command::jkv_proc_Init(*this); +} + +// --- command.jkv_proc..Dtor +inline command::jkv_proc::~jkv_proc() { + command::jkv_proc_Uninit(*this); +} + // --- command.mdbg.args.EmptyQ // Return true if index is empty inline bool command::args_EmptyQ(command::mdbg& parent) { @@ -1971,6 +2141,30 @@ inline command::orgfile_proc::~orgfile_proc() { command::orgfile_proc_Uninit(*this); } +// --- command.samp_make..Ctor +inline command::samp_make::samp_make() { + command::samp_make_Init(*this); +} + +// --- command.samp_make_proc..Init +// Set all fields to initial values. +inline void command::samp_make_proc_Init(command::samp_make_proc& parent) { + parent.path = algo::strptr("bin/samp_make"); + parent.pid = pid_t(0); + parent.timeout = i32(0); + parent.status = i32(0); +} + +// --- command.samp_make_proc..Ctor +inline command::samp_make_proc::samp_make_proc() { + command::samp_make_proc_Init(*this); +} + +// --- command.samp_make_proc..Dtor +inline command::samp_make_proc::~samp_make_proc() { + command::samp_make_proc_Uninit(*this); +} + // --- command.samp_meng..Init // Set all fields to initial values. inline void command::samp_meng_Init(command::samp_meng& parent) { @@ -2001,26 +2195,17 @@ inline command::samp_meng_proc::~samp_meng_proc() { command::samp_meng_proc_Uninit(*this); } -// --- command.samp_regx.style.GetEnum -// Get value of field as enum type -inline command_samp_regx_style_Enum command::style_GetEnum(const command::samp_regx& parent) { - return command_samp_regx_style_Enum(parent.style); -} - -// --- command.samp_regx.style.SetEnum -// Set value of field from enum type. -inline void command::style_SetEnum(command::samp_regx& parent, command_samp_regx_style_Enum rhs) { - parent.style = u8(rhs); -} - // --- command.samp_regx..Init // Set all fields to initial values. inline void command::samp_regx_Init(command::samp_regx& parent) { parent.in = algo::strptr("data"); - parent.style = u8(0); + parent.style = algo_lib_RegxStyleEnum(2); + parent.trace = bool(false); + parent.capture = bool(false); + parent.full = bool(true); + parent.f = bool(false); parent.match = bool(false); parent.string = algo::strptr(""); - parent.show = bool(false); } // --- command.samp_regx..Ctor diff --git a/include/gen/dev_gen.h b/include/gen/dev_gen.h index 6a29d5d4..e95a4ad8 100644 --- a/include/gen/dev_gen.h +++ b/include/gen/dev_gen.h @@ -71,117 +71,123 @@ enum { dev_Covline_flag_Enum_N = 3 }; // --- dev_FieldIdEnum -enum dev_FieldIdEnum { // dev.FieldId.value - dev_FieldId_arch = 0 - ,dev_FieldId_comment = 1 - ,dev_FieldId_badline = 2 - ,dev_FieldId_expr = 3 - ,dev_FieldId_targsrc_regx = 4 - ,dev_FieldId_builddir = 5 - ,dev_FieldId_uname = 6 - ,dev_FieldId_compiler = 7 - ,dev_FieldId_cfg = 8 - ,dev_FieldId_suffix = 9 - ,dev_FieldId_ranlib = 10 - ,dev_FieldId_ar = 11 - ,dev_FieldId_link = 12 - ,dev_FieldId_libext = 13 - ,dev_FieldId_exeext = 14 - ,dev_FieldId_pchext = 15 - ,dev_FieldId_objext = 16 - ,dev_FieldId_rc = 17 - ,dev_FieldId_copyright = 18 - ,dev_FieldId_dflt = 19 - ,dev_FieldId_covfile = 20 - ,dev_FieldId_total = 21 - ,dev_FieldId_nonexe = 22 - ,dev_FieldId_exe = 23 - ,dev_FieldId_exer = 24 - ,dev_FieldId_hit = 25 - ,dev_FieldId_cov = 26 - ,dev_FieldId_covline = 27 - ,dev_FieldId_src = 28 - ,dev_FieldId_line = 29 - ,dev_FieldId_flag = 30 - ,dev_FieldId_text = 31 - ,dev_FieldId_covtarget = 32 - ,dev_FieldId_edaction = 33 - ,dev_FieldId_edacttype = 34 - ,dev_FieldId_name = 35 - ,dev_FieldId_needamc = 36 - ,dev_FieldId_gitfile = 37 - ,dev_FieldId_ext = 38 - ,dev_FieldId_gitinfo = 39 - ,dev_FieldId_author = 40 - ,dev_FieldId_compver = 41 - ,dev_FieldId_package = 42 - ,dev_FieldId_hilite = 43 - ,dev_FieldId_color = 44 - ,dev_FieldId_htmlentity = 45 - ,dev_FieldId_code = 46 - ,dev_FieldId_include = 47 - ,dev_FieldId_srcfile = 48 - ,dev_FieldId_filename = 49 - ,dev_FieldId_sys = 50 - ,dev_FieldId_license = 51 - ,dev_FieldId_nlongline = 52 - ,dev_FieldId_longestline = 53 - ,dev_FieldId_nbadws = 54 - ,dev_FieldId_maxws = 55 - ,dev_FieldId_nlongfunc = 56 - ,dev_FieldId_longestfunc = 57 - ,dev_FieldId_nmysteryfunc = 58 - ,dev_FieldId_badness = 59 - ,dev_FieldId_mdmark = 60 - ,dev_FieldId_state = 61 - ,dev_FieldId_param = 62 - ,dev_FieldId_mdsection = 63 - ,dev_FieldId_match = 64 - ,dev_FieldId_path = 65 - ,dev_FieldId_genlist = 66 - ,dev_FieldId_strict = 67 - ,dev_FieldId_opt_type = 68 - ,dev_FieldId_sep = 69 - ,dev_FieldId_baseref = 70 - ,dev_FieldId_origin = 71 - ,dev_FieldId_pkgdep = 72 - ,dev_FieldId_parent = 73 - ,dev_FieldId_soft = 74 - ,dev_FieldId_pkgkey = 75 - ,dev_FieldId_key = 76 - ,dev_FieldId_inl = 77 - ,dev_FieldId_sandbox = 78 - ,dev_FieldId_filter = 79 - ,dev_FieldId_readmesort = 80 - ,dev_FieldId_sbpath = 81 - ,dev_FieldId_syscmd = 82 - ,dev_FieldId_execkey = 83 - ,dev_FieldId_command = 84 - ,dev_FieldId_pid = 85 - ,dev_FieldId_status = 86 - ,dev_FieldId_nprereq = 87 - ,dev_FieldId_fail_prereq = 88 - ,dev_FieldId_completed = 89 - ,dev_FieldId_maxtime = 90 - ,dev_FieldId_syscmddep = 91 - ,dev_FieldId_child = 92 - ,dev_FieldId_syslib = 93 - ,dev_FieldId_targdep = 94 - ,dev_FieldId_target = 95 - ,dev_FieldId_targsrc = 96 - ,dev_FieldId_targsyslib = 97 - ,dev_FieldId_cov_min = 98 - ,dev_FieldId_maxerr = 99 - ,dev_FieldId_timefmt = 100 - ,dev_FieldId_dirname = 101 - ,dev_FieldId_tool_opt = 102 - ,dev_FieldId_opt = 103 - ,dev_FieldId_sortfld = 104 - ,dev_FieldId_field = 105 - ,dev_FieldId_value = 106 +enum dev_FieldIdEnum { // dev.FieldId.value + dev_FieldId_arch = 0 + ,dev_FieldId_comment = 1 + ,dev_FieldId_badline = 2 + ,dev_FieldId_expr = 3 + ,dev_FieldId_targsrc_regx = 4 + ,dev_FieldId_builddir = 5 + ,dev_FieldId_uname = 6 + ,dev_FieldId_compiler = 7 + ,dev_FieldId_cfg = 8 + ,dev_FieldId_suffix = 9 + ,dev_FieldId_ranlib = 10 + ,dev_FieldId_ar = 11 + ,dev_FieldId_link = 12 + ,dev_FieldId_libext = 13 + ,dev_FieldId_exeext = 14 + ,dev_FieldId_pchext = 15 + ,dev_FieldId_objext = 16 + ,dev_FieldId_rc = 17 + ,dev_FieldId_copyright = 18 + ,dev_FieldId_dflt = 19 + ,dev_FieldId_covfile = 20 + ,dev_FieldId_total = 21 + ,dev_FieldId_nonexe = 22 + ,dev_FieldId_exe = 23 + ,dev_FieldId_exer = 24 + ,dev_FieldId_hit = 25 + ,dev_FieldId_cov = 26 + ,dev_FieldId_covline = 27 + ,dev_FieldId_src = 28 + ,dev_FieldId_line = 29 + ,dev_FieldId_flag = 30 + ,dev_FieldId_text = 31 + ,dev_FieldId_covtarget = 32 + ,dev_FieldId_edaction = 33 + ,dev_FieldId_edacttype = 34 + ,dev_FieldId_name = 35 + ,dev_FieldId_needamc = 36 + ,dev_FieldId_gitfile = 37 + ,dev_FieldId_ext = 38 + ,dev_FieldId_gitinfo = 39 + ,dev_FieldId_author = 40 + ,dev_FieldId_compver = 41 + ,dev_FieldId_package = 42 + ,dev_FieldId_hilite = 43 + ,dev_FieldId_color = 44 + ,dev_FieldId_htmlentity = 45 + ,dev_FieldId_code = 46 + ,dev_FieldId_include = 47 + ,dev_FieldId_srcfile = 48 + ,dev_FieldId_filename = 49 + ,dev_FieldId_sys = 50 + ,dev_FieldId_license = 51 + ,dev_FieldId_nlongline = 52 + ,dev_FieldId_longestline = 53 + ,dev_FieldId_nbadws = 54 + ,dev_FieldId_maxws = 55 + ,dev_FieldId_nlongfunc = 56 + ,dev_FieldId_longestfunc = 57 + ,dev_FieldId_nmysteryfunc = 58 + ,dev_FieldId_badness = 59 + ,dev_FieldId_mdmark = 60 + ,dev_FieldId_state = 61 + ,dev_FieldId_param = 62 + ,dev_FieldId_mdsection = 63 + ,dev_FieldId_match = 64 + ,dev_FieldId_path = 65 + ,dev_FieldId_genlist = 66 + ,dev_FieldId_strict = 67 + ,dev_FieldId_netproto = 68 + ,dev_FieldId_tls = 69 + ,dev_FieldId_opt_type = 70 + ,dev_FieldId_sep = 71 + ,dev_FieldId_baseref = 72 + ,dev_FieldId_origin = 73 + ,dev_FieldId_pkgdep = 74 + ,dev_FieldId_parent = 75 + ,dev_FieldId_soft = 76 + ,dev_FieldId_pkgkey = 77 + ,dev_FieldId_key = 78 + ,dev_FieldId_prototransport = 79 + ,dev_FieldId_transport = 80 + ,dev_FieldId_inl = 81 + ,dev_FieldId_sandbox = 82 + ,dev_FieldId_filter = 83 + ,dev_FieldId_readmesort = 84 + ,dev_FieldId_rpm = 85 + ,dev_FieldId_sbpath = 86 + ,dev_FieldId_syscmd = 87 + ,dev_FieldId_execkey = 88 + ,dev_FieldId_command = 89 + ,dev_FieldId_pid = 90 + ,dev_FieldId_status = 91 + ,dev_FieldId_nprereq = 92 + ,dev_FieldId_fail_prereq = 93 + ,dev_FieldId_completed = 94 + ,dev_FieldId_maxtime = 95 + ,dev_FieldId_child = 96 + ,dev_FieldId_syslib = 97 + ,dev_FieldId_targdep = 98 + ,dev_FieldId_target = 99 + ,dev_FieldId_targsrc = 100 + ,dev_FieldId_targsyslib = 101 + ,dev_FieldId_prefix = 102 + ,dev_FieldId_cov_min = 103 + ,dev_FieldId_maxerr = 104 + ,dev_FieldId_timefmt = 105 + ,dev_FieldId_dirname = 106 + ,dev_FieldId_tool_opt = 107 + ,dev_FieldId_opt = 108 + ,dev_FieldId_sortfld = 109 + ,dev_FieldId_ip = 110 + ,dev_FieldId_field = 111 + ,dev_FieldId_value = 112 }; -enum { dev_FieldIdEnum_N = 107 }; +enum { dev_FieldIdEnum_N = 113 }; extern const char * dev_License_license_; // fconst:dev.License.license/ extern const char * dev_License_license_GPL; // GPL fconst:dev.License.license/GPL @@ -203,6 +209,10 @@ enum dev_MdmarkCaseEnum { // dev.MdmarkCase.mdmark enum { dev_MdmarkCaseEnum_N = 3 }; +extern const char * dev_Netproto_netproto_http; // http fconst:dev.Netproto.netproto/http +extern const char * dev_Netproto_netproto_https; // https fconst:dev.Netproto.netproto/https +extern const char * dev_Netproto_netproto_smtp; // smtp fconst:dev.Netproto.netproto/smtp +extern const char * dev_Netproto_netproto_ssh; // ssh fconst:dev.Netproto.netproto/ssh extern const char * dev_Sandbox_sandbox_abt_md; // abt_md fconst:dev.Sandbox.sandbox/abt_md extern const char * dev_Sandbox_sandbox_acr_ed; // acr_ed fconst:dev.Sandbox.sandbox/acr_ed extern const char * dev_Sandbox_sandbox_amc; // amc fconst:dev.Sandbox.sandbox/amc @@ -220,7 +230,7 @@ namespace dev { // gen:ns_pkeytypedef typedef algo::Smallstr50 CfgPkey; typedef algo::Smallstr50 CompilerPkey; typedef algo::Smallstr50 CopyrightPkey; - typedef algo::Smallstr200 CovlinePkey; + typedef algo::cstring CovlinePkey; typedef algo::Smallstr50 EdactionPkey; typedef algo::Smallstr50 EdacttypePkey; typedef algo::Smallstr200 GitfilePkey; @@ -231,16 +241,18 @@ namespace dev { // gen:ns_pkeytypedef typedef algo::Smallstr50 LicensePkey; typedef algo::Smallstr50 MdmarkPkey; typedef algo::Smallstr50 MdsectionPkey; + typedef algo::Smallstr50 NetprotoPkey; typedef algo::Smallstr50 OptTypePkey; typedef algo::Smallstr50 PackagePkey; typedef algo::Smallstr100 PkgdepPkey; typedef algo::Smallstr150 PkgkeyPkey; + typedef algo::Smallstr50 PrototransportPkey; typedef algo::Smallstr250 ReadmesortPkey; + typedef algo::Smallstr50 RpmPkey; typedef algo::Smallstr50 SandboxPkey; typedef algo::Smallstr50 SbpathPkey; typedef algo::Smallstr200 SrcfilePkey; typedef i64 SyscmdPkey; - typedef algo::RspaceStr16 SyscmddepPkey; typedef algo::Smallstr50 SyslibPkey; typedef algo::Smallstr50 TargdepPkey; typedef algo::Smallstr16 TargetPkey; @@ -248,6 +260,7 @@ namespace dev { // gen:ns_pkeytypedef typedef algo::Smallstr50 TargsyslibPkey; typedef algo::Smallstr100 TimefmtPkey; typedef algo::Smallstr100 ToolOptPkey; + typedef algo::Smallstr50 TransportPkey; typedef algo::Smallstr50 UnamePkey; } // gen:ns_pkeytypedef namespace dev { // gen:ns_tclass_field @@ -276,13 +289,16 @@ namespace dev { struct Mdmark; } namespace dev { struct MdmarkCase; } namespace dev { struct Mdsection; } namespace dev { struct Msgfile; } +namespace dev { struct Netproto; } namespace dev { struct Noindent; } namespace dev { struct OptType; } namespace dev { struct Package; } namespace dev { struct Pkgdep; } namespace dev { struct Pkgkey; } -namespace dev { struct Readme; } +namespace dev { struct Prototransport; } +namespace dev { struct Readmefile; } namespace dev { struct Readmesort; } +namespace dev { struct Rpm; } namespace dev { struct Sandbox; } namespace dev { struct Sbpath; } namespace dev { struct Scriptfile; } @@ -297,6 +313,7 @@ namespace dev { struct Targsyslib; } namespace dev { struct Tgtcov; } namespace dev { struct Timefmt; } namespace dev { struct ToolOpt; } +namespace dev { struct Transport; } namespace dev { struct Uname; } namespace dev { struct Unstablefld; } namespace dev { // gen:ns_print_struct @@ -487,10 +504,10 @@ void Covfile_Print(dev::Covfile& row, algo::cstring& str) __attr // --- dev.Covline struct Covline { // dev.Covline - algo::Smallstr200 covline; // file:line - char flag; // 'N' Flag - u32 hit; // 0 Number of hits - algo::cstring text; // Line text + algo::cstring covline; // Key: file:line + char flag; // 'N' Flag + u32 hit; // 0 Number of hits + algo::cstring text; // Line text // func:dev.Covline..Ctor inline Covline() __attribute__((nothrow)); }; @@ -967,6 +984,29 @@ inline void Msgfile_Init(dev::Msgfile& parent); // func:dev.Msgfile..Print void Msgfile_Print(dev::Msgfile& row, algo::cstring& str) __attribute__((nothrow)); +// --- dev.Netproto +struct Netproto { // dev.Netproto: Network protocol: add all levels here + algo::Smallstr50 netproto; // + bool tls; // false + algo::Comment comment; // + // func:dev.Netproto..Ctor + inline Netproto() __attribute__((nothrow)); +}; + +// func:dev.Netproto..ReadFieldMaybe +bool Netproto_ReadFieldMaybe(dev::Netproto& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dev::Netproto from an ascii string. +// The format of the string is an ssim Tuple +// func:dev.Netproto..ReadStrptrMaybe +bool Netproto_ReadStrptrMaybe(dev::Netproto &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:dev.Netproto..Init +inline void Netproto_Init(dev::Netproto& parent); +// print string representation of ROW to string STR +// cfmt:dev.Netproto.String printfmt:Tuple +// func:dev.Netproto..Print +void Netproto_Print(dev::Netproto& row, algo::cstring& str) __attribute__((nothrow)); + // --- dev.Noindent struct Noindent { // dev.Noindent: Indicates that a file should not be automatically indented algo::Smallstr200 gitfile; // @@ -1101,32 +1141,63 @@ bool Pkgkey_ReadStrptrMaybe(dev::Pkgkey &parent, algo::strptr in // func:dev.Pkgkey..Print void Pkgkey_Print(dev::Pkgkey& row, algo::cstring& str) __attribute__((nothrow)); -// --- dev.Readme -struct Readme { // dev.Readme: File containing documentation +// --- dev.Prototransport +struct Prototransport { // dev.Prototransport: Protocol/transport binding + algo::Smallstr50 prototransport; // + algo::Comment comment; // + // func:dev.Prototransport..Ctor + inline Prototransport() __attribute__((nothrow)); +}; + +// func:dev.Prototransport.netproto.Get +algo::Smallstr50 netproto_Get(dev::Prototransport& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:dev.Prototransport.netproto.Get2 +algo::Smallstr50 Prototransport_netproto_Get(algo::strptr arg) __attribute__((nothrow)); + +// func:dev.Prototransport.transport.Get +algo::Smallstr50 transport_Get(dev::Prototransport& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:dev.Prototransport.transport.Get2 +algo::Smallstr50 Prototransport_transport_Get(algo::strptr arg) __attribute__((nothrow)); + +// func:dev.Prototransport..Concat_netproto_transport +tempstr Prototransport_Concat_netproto_transport( const algo::strptr& netproto ,const algo::strptr& transport ); +// func:dev.Prototransport..ReadFieldMaybe +bool Prototransport_ReadFieldMaybe(dev::Prototransport& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dev::Prototransport from an ascii string. +// The format of the string is an ssim Tuple +// func:dev.Prototransport..ReadStrptrMaybe +bool Prototransport_ReadStrptrMaybe(dev::Prototransport &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:dev.Prototransport.String printfmt:Tuple +// func:dev.Prototransport..Print +void Prototransport_Print(dev::Prototransport& row, algo::cstring& str) __attribute__((nothrow)); + +// --- dev.Readmefile +struct Readmefile { // dev.Readmefile: File containing documentation algo::Smallstr200 gitfile; // bool inl; // false bool sandbox; // false algo::Smallstr100 filter; // algo::Comment comment; // - // func:dev.Readme..Ctor - inline Readme() __attribute__((nothrow)); - // func:dev.Readme..FieldwiseCtor - explicit inline Readme(const algo::strptr& in_gitfile, bool in_inl, bool in_sandbox, const algo::strptr& in_filter, const algo::Comment& in_comment) __attribute__((nothrow)); + // func:dev.Readmefile..Ctor + inline Readmefile() __attribute__((nothrow)); + // func:dev.Readmefile..FieldwiseCtor + explicit inline Readmefile(const algo::strptr& in_gitfile, bool in_inl, bool in_sandbox, const algo::strptr& in_filter, const algo::Comment& in_comment) __attribute__((nothrow)); }; -// func:dev.Readme..ReadFieldMaybe -bool Readme_ReadFieldMaybe(dev::Readme& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of dev::Readme from an ascii string. +// func:dev.Readmefile..ReadFieldMaybe +bool Readmefile_ReadFieldMaybe(dev::Readmefile& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dev::Readmefile from an ascii string. // The format of the string is an ssim Tuple -// func:dev.Readme..ReadStrptrMaybe -bool Readme_ReadStrptrMaybe(dev::Readme &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:dev.Readmefile..ReadStrptrMaybe +bool Readmefile_ReadStrptrMaybe(dev::Readmefile &parent, algo::strptr in_str) __attribute__((nothrow)); // Set all fields to initial values. -// func:dev.Readme..Init -inline void Readme_Init(dev::Readme& parent); +// func:dev.Readmefile..Init +inline void Readmefile_Init(dev::Readmefile& parent); // print string representation of ROW to string STR -// cfmt:dev.Readme.String printfmt:Tuple -// func:dev.Readme..Print -void Readme_Print(dev::Readme& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:dev.Readmefile.String printfmt:Tuple +// func:dev.Readmefile..Print +void Readmefile_Print(dev::Readmefile& row, algo::cstring& str) __attribute__((nothrow)); // --- dev.Readmesort struct Readmesort { // dev.Readmesort: sorted categories of txt/ *.md files presented in dev.readme @@ -1147,6 +1218,25 @@ bool Readmesort_ReadStrptrMaybe(dev::Readmesort &parent, algo::s // func:dev.Readmesort..Print void Readmesort_Print(dev::Readmesort& row, algo::cstring& str) __attribute__((nothrow)); +// --- dev.Rpm +struct Rpm { // dev.Rpm + algo::Smallstr50 rpm; // + algo::Comment comment; // + // func:dev.Rpm..Ctor + inline Rpm() __attribute__((nothrow)); +}; + +// func:dev.Rpm..ReadFieldMaybe +bool Rpm_ReadFieldMaybe(dev::Rpm& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dev::Rpm from an ascii string. +// The format of the string is an ssim Tuple +// func:dev.Rpm..ReadStrptrMaybe +bool Rpm_ReadStrptrMaybe(dev::Rpm &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:dev.Rpm.String printfmt:Tuple +// func:dev.Rpm..Print +void Rpm_Print(dev::Rpm& row, algo::cstring& str) __attribute__((nothrow)); + // --- dev.Sandbox struct Sandbox { // dev.Sandbox: Registered sandbox algo::Smallstr50 sandbox; // @@ -1277,10 +1367,6 @@ struct Syscmddep { // dev.Syscmddep: Dependency between two commands explicit inline Syscmddep(i64 in_child, i64 in_parent) __attribute__((nothrow)); }; -// func:dev.Syscmddep.syscmddep.Get -// this function is 'extrn' and implemented by user -algo::RspaceStr16 syscmddep_Get(dev::Syscmddep& parent) __attribute__((__warn_unused_result__, nothrow)); - // func:dev.Syscmddep..ReadFieldMaybe bool Syscmddep_ReadFieldMaybe(dev::Syscmddep& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); // Read fields of dev::Syscmddep from an ascii string. @@ -1428,6 +1514,11 @@ algo::Smallstr50 uname_Get(dev::Targsyslib& parent) __attribute__((__warn_un // func:dev.Targsyslib.uname.Get2 algo::Smallstr50 Targsyslib_uname_Get(algo::strptr arg) __attribute__((nothrow)); +// func:dev.Targsyslib.prefix.Get +algo::Smallstr50 prefix_Get(dev::Targsyslib& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:dev.Targsyslib.prefix.Get2 +algo::Smallstr50 Targsyslib_prefix_Get(algo::strptr arg) __attribute__((nothrow)); + // func:dev.Targsyslib..Concat_uname_target_syslib tempstr Targsyslib_Concat_uname_target_syslib( const algo::strptr& uname ,const algo::strptr& target ,const algo::strptr& syslib ); // func:dev.Targsyslib..ReadFieldMaybe @@ -1548,6 +1639,29 @@ bool ToolOpt_ReadStrptrMaybe(dev::ToolOpt &parent, algo::strptr // func:dev.ToolOpt..Print void ToolOpt_Print(dev::ToolOpt& row, algo::cstring& str) __attribute__((nothrow)); +// --- dev.Transport +struct Transport { // dev.Transport: Transport layer + algo::Smallstr50 transport; // + bool ip; // false + algo::Comment comment; // + // func:dev.Transport..Ctor + inline Transport() __attribute__((nothrow)); +}; + +// func:dev.Transport..ReadFieldMaybe +bool Transport_ReadFieldMaybe(dev::Transport& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dev::Transport from an ascii string. +// The format of the string is an ssim Tuple +// func:dev.Transport..ReadStrptrMaybe +bool Transport_ReadStrptrMaybe(dev::Transport &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:dev.Transport..Init +inline void Transport_Init(dev::Transport& parent); +// print string representation of ROW to string STR +// cfmt:dev.Transport.String printfmt:Tuple +// func:dev.Transport..Print +void Transport_Print(dev::Transport& row, algo::cstring& str) __attribute__((nothrow)); + // --- dev.Uname struct Uname { // dev.Uname: List of known unames algo::Smallstr50 uname; // @@ -1609,12 +1723,15 @@ inline algo::cstring &operator <<(algo::cstring &str, const dev::Linelim &row);/ inline algo::cstring &operator <<(algo::cstring &str, const dev::Mdmark &row);// cfmt:dev.Mdmark.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Mdsection &row);// cfmt:dev.Mdsection.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Msgfile &row);// cfmt:dev.Msgfile.String +inline algo::cstring &operator <<(algo::cstring &str, const dev::Netproto &row);// cfmt:dev.Netproto.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Noindent &row);// cfmt:dev.Noindent.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Package &row);// cfmt:dev.Package.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Pkgdep &row);// cfmt:dev.Pkgdep.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Pkgkey &row);// cfmt:dev.Pkgkey.String -inline algo::cstring &operator <<(algo::cstring &str, const dev::Readme &row);// cfmt:dev.Readme.String +inline algo::cstring &operator <<(algo::cstring &str, const dev::Prototransport &row);// cfmt:dev.Prototransport.String +inline algo::cstring &operator <<(algo::cstring &str, const dev::Readmefile &row);// cfmt:dev.Readmefile.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Readmesort &row);// cfmt:dev.Readmesort.String +inline algo::cstring &operator <<(algo::cstring &str, const dev::Rpm &row);// cfmt:dev.Rpm.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Sandbox &row);// cfmt:dev.Sandbox.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Sbpath &row);// cfmt:dev.Sbpath.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Scriptfile &row);// cfmt:dev.Scriptfile.String @@ -1629,6 +1746,7 @@ inline algo::cstring &operator <<(algo::cstring &str, const dev::Targsyslib &row inline algo::cstring &operator <<(algo::cstring &str, const dev::Tgtcov &row);// cfmt:dev.Tgtcov.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Timefmt &row);// cfmt:dev.Timefmt.String inline algo::cstring &operator <<(algo::cstring &str, const dev::ToolOpt &row);// cfmt:dev.ToolOpt.String +inline algo::cstring &operator <<(algo::cstring &str, const dev::Transport &row);// cfmt:dev.Transport.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Uname &row);// cfmt:dev.Uname.String inline algo::cstring &operator <<(algo::cstring &str, const dev::Unstablefld &row);// cfmt:dev.Unstablefld.String } diff --git a/include/gen/dev_gen.inl.h b/include/gen/dev_gen.inl.h index 3c895613..cddbeff9 100644 --- a/include/gen/dev_gen.inl.h +++ b/include/gen/dev_gen.inl.h @@ -323,6 +323,17 @@ inline dev::Msgfile::Msgfile() { dev::Msgfile_Init(*this); } +// --- dev.Netproto..Init +// Set all fields to initial values. +inline void dev::Netproto_Init(dev::Netproto& parent) { + parent.tls = bool(false); +} + +// --- dev.Netproto..Ctor +inline dev::Netproto::Netproto() { + dev::Netproto_Init(*this); +} + // --- dev.Noindent..Ctor inline dev::Noindent::Noindent() { } @@ -382,20 +393,24 @@ inline dev::Pkgkey::Pkgkey(const algo::strptr& in_pkgkey, const algo::Comment& { } -// --- dev.Readme..Init +// --- dev.Prototransport..Ctor +inline dev::Prototransport::Prototransport() { +} + +// --- dev.Readmefile..Init // Set all fields to initial values. -inline void dev::Readme_Init(dev::Readme& parent) { +inline void dev::Readmefile_Init(dev::Readmefile& parent) { parent.inl = bool(false); parent.sandbox = bool(false); } -// --- dev.Readme..Ctor -inline dev::Readme::Readme() { - dev::Readme_Init(*this); +// --- dev.Readmefile..Ctor +inline dev::Readmefile::Readmefile() { + dev::Readmefile_Init(*this); } -// --- dev.Readme..FieldwiseCtor -inline dev::Readme::Readme(const algo::strptr& in_gitfile, bool in_inl, bool in_sandbox, const algo::strptr& in_filter, const algo::Comment& in_comment) +// --- dev.Readmefile..FieldwiseCtor +inline dev::Readmefile::Readmefile(const algo::strptr& in_gitfile, bool in_inl, bool in_sandbox, const algo::strptr& in_filter, const algo::Comment& in_comment) : gitfile(in_gitfile) , inl(in_inl) , sandbox(in_sandbox) @@ -408,6 +423,10 @@ inline dev::Readme::Readme(const algo::strptr& in_gitfile, bool in_inl, bool in inline dev::Readmesort::Readmesort() { } +// --- dev.Rpm..Ctor +inline dev::Rpm::Rpm() { +} + // --- dev.Sandbox..Ctor inline dev::Sandbox::Sandbox() { } @@ -539,6 +558,17 @@ inline dev::ToolOpt::ToolOpt(const algo::strptr& in_tool_opt, const algo::Comme { } +// --- dev.Transport..Init +// Set all fields to initial values. +inline void dev::Transport_Init(dev::Transport& parent) { + parent.ip = bool(false); +} + +// --- dev.Transport..Ctor +inline dev::Transport::Transport() { + dev::Transport_Init(*this); +} + // --- dev.Uname..Ctor inline dev::Uname::Uname() { } @@ -639,6 +669,11 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Msgfile & return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Netproto &row) {// cfmt:dev.Netproto.String + dev::Netproto_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Noindent &row) {// cfmt:dev.Noindent.String dev::Noindent_Print(const_cast(row), str); return str; @@ -659,8 +694,13 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Pkgkey &r return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Readme &row) {// cfmt:dev.Readme.String - dev::Readme_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Prototransport &row) {// cfmt:dev.Prototransport.String + dev::Prototransport_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Readmefile &row) {// cfmt:dev.Readmefile.String + dev::Readmefile_Print(const_cast(row), str); return str; } @@ -669,6 +709,11 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Readmesor return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Rpm &row) {// cfmt:dev.Rpm.String + dev::Rpm_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Sandbox &row) {// cfmt:dev.Sandbox.String dev::Sandbox_Print(const_cast(row), str); return str; @@ -739,6 +784,11 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::ToolOpt & return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Transport &row) {// cfmt:dev.Transport.String + dev::Transport_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const dev::Uname &row) {// cfmt:dev.Uname.String dev::Uname_Print(const_cast(row), str); return str; diff --git a/include/gen/dmmeta_gen.h b/include/gen/dmmeta_gen.h index d180a0a3..9240957e 100644 --- a/include/gen/dmmeta_gen.h +++ b/include/gen/dmmeta_gen.h @@ -26,12 +26,12 @@ #include "include/gen/algo_gen.h" //#pragma endinclude // gen:ns_enums -extern const char * dmmeta_Buftype_pnewtype_Memptr; // Memptr fconst:dmmeta.Buftype.pnewtype/Memptr -extern const char * dmmeta_Buftype_pnewtype_AmsStream; // AmsStream fconst:dmmeta.Buftype.pnewtype/AmsStream -extern const char * dmmeta_Buftype_pnewtype_Fixed; // Fixed fconst:dmmeta.Buftype.pnewtype/Fixed -extern const char * dmmeta_Buftype_pnewtype_Dynamic; // Dynamic fconst:dmmeta.Buftype.pnewtype/Dynamic -extern const char * dmmeta_Buftype_pnewtype_ByteAry; // ByteAry fconst:dmmeta.Buftype.pnewtype/ByteAry -extern const char * dmmeta_Buftype_pnewtype_Append; // Append fconst:dmmeta.Buftype.pnewtype/Append +extern const char * dmmeta_Buftype_pnewtype_Memptr; // Memptr fconst:dmmeta.Buftype.pnewtype/Memptr +extern const char * dmmeta_Buftype_pnewtype_Shm; // Shm fconst:dmmeta.Buftype.pnewtype/Shm +extern const char * dmmeta_Buftype_pnewtype_Fixed; // Fixed fconst:dmmeta.Buftype.pnewtype/Fixed +extern const char * dmmeta_Buftype_pnewtype_Dynamic; // Dynamic fconst:dmmeta.Buftype.pnewtype/Dynamic +extern const char * dmmeta_Buftype_pnewtype_ByteAry; // ByteAry fconst:dmmeta.Buftype.pnewtype/ByteAry +extern const char * dmmeta_Buftype_pnewtype_Append; // Append fconst:dmmeta.Buftype.pnewtype/Append extern const char * dmmeta_Fastenc_fastenc_byteVector; // byteVector fconst:dmmeta.Fastenc.fastenc/byteVector extern const char * dmmeta_Fastenc_fastenc_group; // group fconst:dmmeta.Fastenc.fastenc/group extern const char * dmmeta_Fastenc_fastenc_scaled; // scaled fconst:dmmeta.Fastenc.fastenc/scaled @@ -140,151 +140,174 @@ enum dmmeta_FieldIdEnum { // dmmeta.FieldId.value ,dmmeta_FieldId_charrange = 33 ,dmmeta_FieldId_calc = 34 ,dmmeta_FieldId_hashtype = 35 - ,dmmeta_FieldId_set = 36 - ,dmmeta_FieldId_cppkeyword = 37 - ,dmmeta_FieldId_ctor = 38 - ,dmmeta_FieldId_dtor = 39 - ,dmmeta_FieldId_cheap_copy = 40 - ,dmmeta_FieldId_size = 41 - ,dmmeta_FieldId_alignment = 42 - ,dmmeta_FieldId_strequiv = 43 - ,dmmeta_FieldId_ns = 44 - ,dmmeta_FieldId_len = 45 - ,dmmeta_FieldId_padbytes = 46 - ,dmmeta_FieldId_dispatch = 47 - ,dmmeta_FieldId_unk = 48 - ,dmmeta_FieldId_haslen = 49 - ,dmmeta_FieldId_call = 50 - ,dmmeta_FieldId_strict = 51 - ,dmmeta_FieldId_dispatch_msg = 52 - ,dmmeta_FieldId_match_all = 53 - ,dmmeta_FieldId_dispsig = 54 - ,dmmeta_FieldId_signature = 55 - ,dmmeta_FieldId_cycle = 56 - ,dmmeta_FieldId_fastenc = 57 - ,dmmeta_FieldId_fastinstr = 58 - ,dmmeta_FieldId_fastop = 59 - ,dmmeta_FieldId_stripcomment = 60 - ,dmmeta_FieldId_fbufdir = 61 - ,dmmeta_FieldId_max = 62 - ,dmmeta_FieldId_fbuftype = 63 - ,dmmeta_FieldId_insready = 64 - ,dmmeta_FieldId_inseof = 65 - ,dmmeta_FieldId_skipbytes = 66 - ,dmmeta_FieldId_fcmap = 67 - ,dmmeta_FieldId_leftField = 68 - ,dmmeta_FieldId_leftVal = 69 - ,dmmeta_FieldId_rightVal = 70 - ,dmmeta_FieldId_rightField = 71 - ,dmmeta_FieldId_bidir = 72 - ,dmmeta_FieldId_basecmdline = 73 - ,dmmeta_FieldId_versionsort = 74 - ,dmmeta_FieldId_casesens = 75 - ,dmmeta_FieldId_fconst = 76 - ,dmmeta_FieldId_value = 77 - ,dmmeta_FieldId_fcurs = 78 - ,dmmeta_FieldId_curstype = 79 - ,dmmeta_FieldId_nplace = 80 - ,dmmeta_FieldId_fixedfmt = 81 - ,dmmeta_FieldId_fstep = 82 - ,dmmeta_FieldId_delay = 83 - ,dmmeta_FieldId_scale = 84 - ,dmmeta_FieldId_ffast = 85 - ,dmmeta_FieldId_pos = 86 - ,dmmeta_FieldId_optional = 87 - ,dmmeta_FieldId_op = 88 - ,dmmeta_FieldId_cumulative = 89 - ,dmmeta_FieldId_emptyval = 90 - ,dmmeta_FieldId_arg = 91 - ,dmmeta_FieldId_reftype = 92 - ,dmmeta_FieldId_update = 93 - ,dmmeta_FieldId_fprefix = 94 - ,dmmeta_FieldId_partial = 95 - ,dmmeta_FieldId_regxtype = 96 - ,dmmeta_FieldId_sorttype = 97 - ,dmmeta_FieldId_sortfld = 98 - ,dmmeta_FieldId_steptype = 99 - ,dmmeta_FieldId_func = 100 - ,dmmeta_FieldId_fwddecl = 101 - ,dmmeta_FieldId_namefld = 102 - ,dmmeta_FieldId_idfld = 103 - ,dmmeta_FieldId_wantenum = 104 - ,dmmeta_FieldId_namefldctyp = 105 - ,dmmeta_FieldId_gsymbol = 106 - ,dmmeta_FieldId_ssimfile = 107 - ,dmmeta_FieldId_inc = 108 - ,dmmeta_FieldId_symboltype = 109 - ,dmmeta_FieldId_min = 110 - ,dmmeta_FieldId_extra = 111 - ,dmmeta_FieldId_listtype = 112 - ,dmmeta_FieldId_circular = 113 - ,dmmeta_FieldId_haveprev = 114 - ,dmmeta_FieldId_instail = 115 - ,dmmeta_FieldId_havetail = 116 - ,dmmeta_FieldId_havecount = 117 - ,dmmeta_FieldId_logcat = 118 - ,dmmeta_FieldId_enabled = 119 - ,dmmeta_FieldId_builtin = 120 - ,dmmeta_FieldId_ismodule = 121 - ,dmmeta_FieldId_type = 122 - ,dmmeta_FieldId_xref = 123 - ,dmmeta_FieldId_nstype = 124 - ,dmmeta_FieldId_license = 125 - ,dmmeta_FieldId_nsinclude = 126 - ,dmmeta_FieldId_sys = 127 - ,dmmeta_FieldId_version = 128 - ,dmmeta_FieldId_genthrow = 129 - ,dmmeta_FieldId_correct_getorcreate = 130 - ,dmmeta_FieldId_pool = 131 - ,dmmeta_FieldId_sortxref = 132 - ,dmmeta_FieldId_pack = 133 - ,dmmeta_FieldId_numtype = 134 - ,dmmeta_FieldId_min_len = 135 - ,dmmeta_FieldId_filter_print = 136 - ,dmmeta_FieldId_pmaskfld_member = 137 - ,dmmeta_FieldId_pmaskfld = 138 - ,dmmeta_FieldId_pnew = 139 - ,dmmeta_FieldId_buftype = 140 - ,dmmeta_FieldId_unique = 141 - ,dmmeta_FieldId_isval = 142 - ,dmmeta_FieldId_cascins = 143 - ,dmmeta_FieldId_usebasepool = 144 - ,dmmeta_FieldId_cancopy = 145 - ,dmmeta_FieldId_isxref = 146 - ,dmmeta_FieldId_del = 147 - ,dmmeta_FieldId_up = 148 - ,dmmeta_FieldId_isnew = 149 - ,dmmeta_FieldId_hasalloc = 150 - ,dmmeta_FieldId_inst = 151 - ,dmmeta_FieldId_varlen = 152 - ,dmmeta_FieldId_length = 153 - ,dmmeta_FieldId_strtype = 154 - ,dmmeta_FieldId_pad = 155 - ,dmmeta_FieldId_ssimns = 156 - ,dmmeta_FieldId_ssimreq = 157 - ,dmmeta_FieldId_parent = 158 - ,dmmeta_FieldId_parent_field = 159 - ,dmmeta_FieldId_parent_ctype = 160 - ,dmmeta_FieldId_child_ssimfile = 161 - ,dmmeta_FieldId_child_key = 162 - ,dmmeta_FieldId_reqchild = 163 - ,dmmeta_FieldId_maxwid = 164 - ,dmmeta_FieldId_fixedwid1 = 165 - ,dmmeta_FieldId_fixedwid2 = 166 - ,dmmeta_FieldId_aliased = 167 - ,dmmeta_FieldId_hashfld = 168 - ,dmmeta_FieldId_tracefld = 169 - ,dmmeta_FieldId_tracerec = 170 - ,dmmeta_FieldId_inscond = 171 - ,dmmeta_FieldId_via = 172 - ,dmmeta_FieldId_viafld = 173 - ,dmmeta_FieldId_keyfld = 174 -}; - -enum { dmmeta_FieldIdEnum_N = 175 }; + ,dmmeta_FieldId_kind = 36 + ,dmmeta_FieldId_root = 37 + ,dmmeta_FieldId_valid_versions = 38 + ,dmmeta_FieldId_flexible_versions = 39 + ,dmmeta_FieldId_set = 40 + ,dmmeta_FieldId_cppkeyword = 41 + ,dmmeta_FieldId_ctor = 42 + ,dmmeta_FieldId_dtor = 43 + ,dmmeta_FieldId_cheap_copy = 44 + ,dmmeta_FieldId_size = 45 + ,dmmeta_FieldId_alignment = 46 + ,dmmeta_FieldId_strequiv = 47 + ,dmmeta_FieldId_ns = 48 + ,dmmeta_FieldId_len = 49 + ,dmmeta_FieldId_padbytes = 50 + ,dmmeta_FieldId_dispatch = 51 + ,dmmeta_FieldId_unk = 52 + ,dmmeta_FieldId_haslen = 53 + ,dmmeta_FieldId_call = 54 + ,dmmeta_FieldId_strict = 55 + ,dmmeta_FieldId_dyn = 56 + ,dmmeta_FieldId_kafka = 57 + ,dmmeta_FieldId_dispatch_msg = 58 + ,dmmeta_FieldId_match_all = 59 + ,dmmeta_FieldId_dispsig = 60 + ,dmmeta_FieldId_signature = 61 + ,dmmeta_FieldId_cycle = 62 + ,dmmeta_FieldId_fastenc = 63 + ,dmmeta_FieldId_fastinstr = 64 + ,dmmeta_FieldId_fastop = 65 + ,dmmeta_FieldId_stripcomment = 66 + ,dmmeta_FieldId_fbufdir = 67 + ,dmmeta_FieldId_max = 68 + ,dmmeta_FieldId_fbuftype = 69 + ,dmmeta_FieldId_insready = 70 + ,dmmeta_FieldId_inseof = 71 + ,dmmeta_FieldId_iotype = 72 + ,dmmeta_FieldId_fbufiotype = 73 + ,dmmeta_FieldId_skipbytes = 74 + ,dmmeta_FieldId_fcmap = 75 + ,dmmeta_FieldId_leftField = 76 + ,dmmeta_FieldId_leftVal = 77 + ,dmmeta_FieldId_rightVal = 78 + ,dmmeta_FieldId_rightField = 79 + ,dmmeta_FieldId_bidir = 80 + ,dmmeta_FieldId_basecmdline = 81 + ,dmmeta_FieldId_versionsort = 82 + ,dmmeta_FieldId_casesens = 83 + ,dmmeta_FieldId_fconst = 84 + ,dmmeta_FieldId_value = 85 + ,dmmeta_FieldId_fcurs = 86 + ,dmmeta_FieldId_curstype = 87 + ,dmmeta_FieldId_nplace = 88 + ,dmmeta_FieldId_fixedfmt = 89 + ,dmmeta_FieldId_fstep = 90 + ,dmmeta_FieldId_delay = 91 + ,dmmeta_FieldId_scale = 92 + ,dmmeta_FieldId_ffast = 93 + ,dmmeta_FieldId_pos = 94 + ,dmmeta_FieldId_optional = 95 + ,dmmeta_FieldId_op = 96 + ,dmmeta_FieldId_cumulative = 97 + ,dmmeta_FieldId_emptyval = 98 + ,dmmeta_FieldId_arg = 99 + ,dmmeta_FieldId_reftype = 100 + ,dmmeta_FieldId_update = 101 + ,dmmeta_FieldId_versions = 102 + ,dmmeta_FieldId_nullable_versions = 103 + ,dmmeta_FieldId_tagged_versions = 104 + ,dmmeta_FieldId_tag = 105 + ,dmmeta_FieldId_fprefix = 106 + ,dmmeta_FieldId_partial = 107 + ,dmmeta_FieldId_regxtype = 108 + ,dmmeta_FieldId_sorttype = 109 + ,dmmeta_FieldId_sortfld = 110 + ,dmmeta_FieldId_steptype = 111 + ,dmmeta_FieldId_func = 112 + ,dmmeta_FieldId_fwddecl = 113 + ,dmmeta_FieldId_namefld = 114 + ,dmmeta_FieldId_idfld = 115 + ,dmmeta_FieldId_wantenum = 116 + ,dmmeta_FieldId_namefldctyp = 117 + ,dmmeta_FieldId_gsymbol = 118 + ,dmmeta_FieldId_ssimfile = 119 + ,dmmeta_FieldId_inc = 120 + ,dmmeta_FieldId_symboltype = 121 + ,dmmeta_FieldId_min = 122 + ,dmmeta_FieldId_kafka_type_kind = 123 + ,dmmeta_FieldId_extra = 124 + ,dmmeta_FieldId_listtype = 125 + ,dmmeta_FieldId_circular = 126 + ,dmmeta_FieldId_haveprev = 127 + ,dmmeta_FieldId_instail = 128 + ,dmmeta_FieldId_havetail = 129 + ,dmmeta_FieldId_havecount = 130 + ,dmmeta_FieldId_logcat = 131 + ,dmmeta_FieldId_enabled = 132 + ,dmmeta_FieldId_builtin = 133 + ,dmmeta_FieldId_stdout = 134 + ,dmmeta_FieldId_maxmsg = 135 + ,dmmeta_FieldId_window = 136 + ,dmmeta_FieldId_ismodule = 137 + ,dmmeta_FieldId_type = 138 + ,dmmeta_FieldId_xref = 139 + ,dmmeta_FieldId_nstype = 140 + ,dmmeta_FieldId_license = 141 + ,dmmeta_FieldId_nsinclude = 142 + ,dmmeta_FieldId_sys = 143 + ,dmmeta_FieldId_typescript = 144 + ,dmmeta_FieldId_gensel = 145 + ,dmmeta_FieldId_version = 146 + ,dmmeta_FieldId_genthrow = 147 + ,dmmeta_FieldId_correct_getorcreate = 148 + ,dmmeta_FieldId_pool = 149 + ,dmmeta_FieldId_sortxref = 150 + ,dmmeta_FieldId_pack = 151 + ,dmmeta_FieldId_numtype = 152 + ,dmmeta_FieldId_min_len = 153 + ,dmmeta_FieldId_filter_print = 154 + ,dmmeta_FieldId_pmaskfld_member = 155 + ,dmmeta_FieldId_pmaskfld = 156 + ,dmmeta_FieldId_pnew = 157 + ,dmmeta_FieldId_buftype = 158 + ,dmmeta_FieldId_unique = 159 + ,dmmeta_FieldId_heaplike = 160 + ,dmmeta_FieldId_isval = 161 + ,dmmeta_FieldId_cascins = 162 + ,dmmeta_FieldId_usebasepool = 163 + ,dmmeta_FieldId_cancopy = 164 + ,dmmeta_FieldId_isxref = 165 + ,dmmeta_FieldId_del = 166 + ,dmmeta_FieldId_up = 167 + ,dmmeta_FieldId_isnew = 168 + ,dmmeta_FieldId_hasalloc = 169 + ,dmmeta_FieldId_inst = 170 + ,dmmeta_FieldId_varlen = 171 + ,dmmeta_FieldId_length = 172 + ,dmmeta_FieldId_strtype = 173 + ,dmmeta_FieldId_pad = 174 + ,dmmeta_FieldId_ssimns = 175 + ,dmmeta_FieldId_ssimreq = 176 + ,dmmeta_FieldId_parent = 177 + ,dmmeta_FieldId_parent_field = 178 + ,dmmeta_FieldId_parent_ctype = 179 + ,dmmeta_FieldId_child_ssimfile = 180 + ,dmmeta_FieldId_child_key = 181 + ,dmmeta_FieldId_reqchild = 182 + ,dmmeta_FieldId_maxwid = 183 + ,dmmeta_FieldId_fixedwid1 = 184 + ,dmmeta_FieldId_fixedwid2 = 185 + ,dmmeta_FieldId_aliased = 186 + ,dmmeta_FieldId_hashfld = 187 + ,dmmeta_FieldId_tracefld = 188 + ,dmmeta_FieldId_tracerec = 189 + ,dmmeta_FieldId_userfunc = 190 + ,dmmeta_FieldId_acrkey = 191 + ,dmmeta_FieldId_cppname = 192 + ,dmmeta_FieldId_inscond = 193 + ,dmmeta_FieldId_via = 194 + ,dmmeta_FieldId_viafld = 195 + ,dmmeta_FieldId_keyfld = 196 +}; + +enum { dmmeta_FieldIdEnum_N = 197 }; extern const char * dmmeta_Hashtype_hashtype_Extern; // Extern fconst:dmmeta.Hashtype.hashtype/Extern extern const char * dmmeta_Hashtype_hashtype_CRC32; // CRC32 fconst:dmmeta.Hashtype.hashtype/CRC32 +extern const char * dmmeta_Hashtype_hashtype_Linear; // Linear fconst:dmmeta.Hashtype.hashtype/Linear extern const char * dmmeta_Ns_ns_; // fconst:dmmeta.Ns.ns/ extern const char * dmmeta_Ns_ns_abt; // abt fconst:dmmeta.Ns.ns/abt extern const char * dmmeta_Ns_ns_abt_md; // abt_md fconst:dmmeta.Ns.ns/abt_md @@ -301,7 +324,6 @@ extern const char * dmmeta_Ns_ns_amc_gc; // amc_gc fconst:dmme extern const char * dmmeta_Ns_ns_amc_vis; // amc_vis fconst:dmmeta.Ns.ns/amc_vis extern const char * dmmeta_Ns_ns_amcdb; // amcdb fconst:dmmeta.Ns.ns/amcdb extern const char * dmmeta_Ns_ns_ams; // ams fconst:dmmeta.Ns.ns/ams -extern const char * dmmeta_Ns_ns_ams_cat; // ams_cat fconst:dmmeta.Ns.ns/ams_cat extern const char * dmmeta_Ns_ns_ams_sendtest; // ams_sendtest fconst:dmmeta.Ns.ns/ams_sendtest extern const char * dmmeta_Ns_ns_amsdb; // amsdb fconst:dmmeta.Ns.ns/amsdb extern const char * dmmeta_Ns_ns_apm; // apm fconst:dmmeta.Ns.ns/apm @@ -312,6 +334,7 @@ extern const char * dmmeta_Ns_ns_atf_ci; // atf_ci fconst:dmme extern const char * dmmeta_Ns_ns_atf_cmdline; // atf_cmdline fconst:dmmeta.Ns.ns/atf_cmdline extern const char * dmmeta_Ns_ns_atf_comp; // atf_comp fconst:dmmeta.Ns.ns/atf_comp extern const char * dmmeta_Ns_ns_atf_cov; // atf_cov fconst:dmmeta.Ns.ns/atf_cov +extern const char * dmmeta_Ns_ns_atf_exp; // atf_exp fconst:dmmeta.Ns.ns/atf_exp extern const char * dmmeta_Ns_ns_atf_fuzz; // atf_fuzz fconst:dmmeta.Ns.ns/atf_fuzz extern const char * dmmeta_Ns_ns_atf_gcli; // atf_gcli fconst:dmmeta.Ns.ns/atf_gcli extern const char * dmmeta_Ns_ns_atf_nrun; // atf_nrun fconst:dmmeta.Ns.ns/atf_nrun @@ -326,25 +349,37 @@ extern const char * dmmeta_Ns_ns_fmdb; // fmdb fconst:dmme extern const char * dmmeta_Ns_ns_gcache; // gcache fconst:dmmeta.Ns.ns/gcache extern const char * dmmeta_Ns_ns_gcli; // gcli fconst:dmmeta.Ns.ns/gcli extern const char * dmmeta_Ns_ns_gclidb; // gclidb fconst:dmmeta.Ns.ns/gclidb +extern const char * dmmeta_Ns_ns_http; // http fconst:dmmeta.Ns.ns/http +extern const char * dmmeta_Ns_ns_httpdb; // httpdb fconst:dmmeta.Ns.ns/httpdb extern const char * dmmeta_Ns_ns_ietf; // ietf fconst:dmmeta.Ns.ns/ietf +extern const char * dmmeta_Ns_ns_jkv; // jkv fconst:dmmeta.Ns.ns/jkv +extern const char * dmmeta_Ns_ns_js; // js fconst:dmmeta.Ns.ns/js +extern const char * dmmeta_Ns_ns_kafka; // kafka fconst:dmmeta.Ns.ns/kafka extern const char * dmmeta_Ns_ns_lib_amcdb; // lib_amcdb fconst:dmmeta.Ns.ns/lib_amcdb extern const char * dmmeta_Ns_ns_lib_ams; // lib_ams fconst:dmmeta.Ns.ns/lib_ams extern const char * dmmeta_Ns_ns_lib_ctype; // lib_ctype fconst:dmmeta.Ns.ns/lib_ctype +extern const char * dmmeta_Ns_ns_lib_curl; // lib_curl fconst:dmmeta.Ns.ns/lib_curl extern const char * dmmeta_Ns_ns_lib_exec; // lib_exec fconst:dmmeta.Ns.ns/lib_exec extern const char * dmmeta_Ns_ns_lib_fm; // lib_fm fconst:dmmeta.Ns.ns/lib_fm extern const char * dmmeta_Ns_ns_lib_git; // lib_git fconst:dmmeta.Ns.ns/lib_git +extern const char * dmmeta_Ns_ns_lib_http; // lib_http fconst:dmmeta.Ns.ns/lib_http extern const char * dmmeta_Ns_ns_lib_iconv; // lib_iconv fconst:dmmeta.Ns.ns/lib_iconv extern const char * dmmeta_Ns_ns_lib_json; // lib_json fconst:dmmeta.Ns.ns/lib_json extern const char * dmmeta_Ns_ns_lib_mysql; // lib_mysql fconst:dmmeta.Ns.ns/lib_mysql +extern const char * dmmeta_Ns_ns_lib_netio; // lib_netio fconst:dmmeta.Ns.ns/lib_netio extern const char * dmmeta_Ns_ns_lib_prot; // lib_prot fconst:dmmeta.Ns.ns/lib_prot +extern const char * dmmeta_Ns_ns_lib_rl; // lib_rl fconst:dmmeta.Ns.ns/lib_rl extern const char * dmmeta_Ns_ns_lib_sql; // lib_sql fconst:dmmeta.Ns.ns/lib_sql extern const char * dmmeta_Ns_ns_lib_sqlite; // lib_sqlite fconst:dmmeta.Ns.ns/lib_sqlite +extern const char * dmmeta_Ns_ns_lib_ws; // lib_ws fconst:dmmeta.Ns.ns/lib_ws extern const char * dmmeta_Ns_ns_mdbg; // mdbg fconst:dmmeta.Ns.ns/mdbg extern const char * dmmeta_Ns_ns_mysql2ssim; // mysql2ssim fconst:dmmeta.Ns.ns/mysql2ssim extern const char * dmmeta_Ns_ns_orgfile; // orgfile fconst:dmmeta.Ns.ns/orgfile extern const char * dmmeta_Ns_ns_report; // report fconst:dmmeta.Ns.ns/report +extern const char * dmmeta_Ns_ns_samp_make; // samp_make fconst:dmmeta.Ns.ns/samp_make extern const char * dmmeta_Ns_ns_samp_meng; // samp_meng fconst:dmmeta.Ns.ns/samp_meng extern const char * dmmeta_Ns_ns_samp_regx; // samp_regx fconst:dmmeta.Ns.ns/samp_regx +extern const char * dmmeta_Ns_ns_sampdb; // sampdb fconst:dmmeta.Ns.ns/sampdb extern const char * dmmeta_Ns_ns_sandbox; // sandbox fconst:dmmeta.Ns.ns/sandbox extern const char * dmmeta_Ns_ns_src_func; // src_func fconst:dmmeta.Ns.ns/src_func extern const char * dmmeta_Ns_ns_src_hdr; // src_hdr fconst:dmmeta.Ns.ns/src_hdr @@ -354,6 +389,8 @@ extern const char * dmmeta_Ns_ns_ssim2mysql; // ssim2mysql fconst:dmme extern const char * dmmeta_Ns_ns_ssimfilt; // ssimfilt fconst:dmmeta.Ns.ns/ssimfilt extern const char * dmmeta_Ns_ns_strconv; // strconv fconst:dmmeta.Ns.ns/strconv extern const char * dmmeta_Ns_ns_sv2ssim; // sv2ssim fconst:dmmeta.Ns.ns/sv2ssim +extern const char * dmmeta_Ns_ns_ws; // ws fconst:dmmeta.Ns.ns/ws +extern const char * dmmeta_Ns_ns_wsdb; // wsdb fconst:dmmeta.Ns.ns/wsdb extern const char * dmmeta_Nstype_nstype_exe; // exe fconst:dmmeta.Nstype.nstype/exe extern const char * dmmeta_Nstype_nstype_lib; // lib fconst:dmmeta.Nstype.nstype/lib extern const char * dmmeta_Nstype_nstype_none; // none fconst:dmmeta.Nstype.nstype/none @@ -456,7 +493,7 @@ extern const char * dmmeta_Ssimfile_ssimfile_amcdb_tclass; // am extern const char * dmmeta_Ssimfile_ssimfile_amcdb_tcurs; // amcdb.tcurs fconst:dmmeta.Ssimfile.ssimfile/amcdb.tcurs extern const char * dmmeta_Ssimfile_ssimfile_amcdb_tfunc; // amcdb.tfunc fconst:dmmeta.Ssimfile.ssimfile/amcdb.tfunc extern const char * dmmeta_Ssimfile_ssimfile_amsdb_proctype; // amsdb.proctype fconst:dmmeta.Ssimfile.ssimfile/amsdb.proctype -extern const char * dmmeta_Ssimfile_ssimfile_amsdb_streamtype; // amsdb.streamtype fconst:dmmeta.Ssimfile.ssimfile/amsdb.streamtype +extern const char * dmmeta_Ssimfile_ssimfile_amsdb_shmtype; // amsdb.shmtype fconst:dmmeta.Ssimfile.ssimfile/amsdb.shmtype extern const char * dmmeta_Ssimfile_ssimfile_atfdb_amctest; // atfdb.amctest fconst:dmmeta.Ssimfile.ssimfile/atfdb.amctest extern const char * dmmeta_Ssimfile_ssimfile_atfdb_cijob; // atfdb.cijob fconst:dmmeta.Ssimfile.ssimfile/atfdb.cijob extern const char * dmmeta_Ssimfile_ssimfile_atfdb_cipackage; // atfdb.cipackage fconst:dmmeta.Ssimfile.ssimfile/atfdb.cipackage @@ -471,6 +508,7 @@ extern const char * dmmeta_Ssimfile_ssimfile_atfdb_test_gsymbol_strptr; // at extern const char * dmmeta_Ssimfile_ssimfile_atfdb_tfilt; // atfdb.tfilt fconst:dmmeta.Ssimfile.ssimfile/atfdb.tfilt extern const char * dmmeta_Ssimfile_ssimfile_atfdb_tmsg; // atfdb.tmsg fconst:dmmeta.Ssimfile.ssimfile/atfdb.tmsg extern const char * dmmeta_Ssimfile_ssimfile_atfdb_unittest; // atfdb.unittest fconst:dmmeta.Ssimfile.ssimfile/atfdb.unittest +extern const char * dmmeta_Ssimfile_ssimfile_atfdb_var; // atfdb.var fconst:dmmeta.Ssimfile.ssimfile/atfdb.var extern const char * dmmeta_Ssimfile_ssimfile_dev_arch; // dev.arch fconst:dmmeta.Ssimfile.ssimfile/dev.arch extern const char * dmmeta_Ssimfile_ssimfile_dev_badline; // dev.badline fconst:dmmeta.Ssimfile.ssimfile/dev.badline extern const char * dmmeta_Ssimfile_ssimfile_dev_builddir; // dev.builddir fconst:dmmeta.Ssimfile.ssimfile/dev.builddir @@ -492,13 +530,16 @@ extern const char * dmmeta_Ssimfile_ssimfile_dev_linelim; // de extern const char * dmmeta_Ssimfile_ssimfile_dev_mdmark; // dev.mdmark fconst:dmmeta.Ssimfile.ssimfile/dev.mdmark extern const char * dmmeta_Ssimfile_ssimfile_dev_mdsection; // dev.mdsection fconst:dmmeta.Ssimfile.ssimfile/dev.mdsection extern const char * dmmeta_Ssimfile_ssimfile_dev_msgfile; // dev.msgfile fconst:dmmeta.Ssimfile.ssimfile/dev.msgfile +extern const char * dmmeta_Ssimfile_ssimfile_dev_netproto; // dev.netproto fconst:dmmeta.Ssimfile.ssimfile/dev.netproto extern const char * dmmeta_Ssimfile_ssimfile_dev_noindent; // dev.noindent fconst:dmmeta.Ssimfile.ssimfile/dev.noindent extern const char * dmmeta_Ssimfile_ssimfile_dev_opt_type; // dev.opt_type fconst:dmmeta.Ssimfile.ssimfile/dev.opt_type extern const char * dmmeta_Ssimfile_ssimfile_dev_package; // dev.package fconst:dmmeta.Ssimfile.ssimfile/dev.package extern const char * dmmeta_Ssimfile_ssimfile_dev_pkgdep; // dev.pkgdep fconst:dmmeta.Ssimfile.ssimfile/dev.pkgdep extern const char * dmmeta_Ssimfile_ssimfile_dev_pkgkey; // dev.pkgkey fconst:dmmeta.Ssimfile.ssimfile/dev.pkgkey -extern const char * dmmeta_Ssimfile_ssimfile_dev_readme; // dev.readme fconst:dmmeta.Ssimfile.ssimfile/dev.readme +extern const char * dmmeta_Ssimfile_ssimfile_dev_prototransport; // dev.prototransport fconst:dmmeta.Ssimfile.ssimfile/dev.prototransport +extern const char * dmmeta_Ssimfile_ssimfile_dev_readmefile; // dev.readmefile fconst:dmmeta.Ssimfile.ssimfile/dev.readmefile extern const char * dmmeta_Ssimfile_ssimfile_dev_readmesort; // dev.readmesort fconst:dmmeta.Ssimfile.ssimfile/dev.readmesort +extern const char * dmmeta_Ssimfile_ssimfile_dev_rpm; // dev.rpm fconst:dmmeta.Ssimfile.ssimfile/dev.rpm extern const char * dmmeta_Ssimfile_ssimfile_dev_sandbox; // dev.sandbox fconst:dmmeta.Ssimfile.ssimfile/dev.sandbox extern const char * dmmeta_Ssimfile_ssimfile_dev_sbpath; // dev.sbpath fconst:dmmeta.Ssimfile.ssimfile/dev.sbpath extern const char * dmmeta_Ssimfile_ssimfile_dev_scriptfile; // dev.scriptfile fconst:dmmeta.Ssimfile.ssimfile/dev.scriptfile @@ -513,6 +554,7 @@ extern const char * dmmeta_Ssimfile_ssimfile_dev_targsyslib; // de extern const char * dmmeta_Ssimfile_ssimfile_dev_tgtcov; // dev.tgtcov fconst:dmmeta.Ssimfile.ssimfile/dev.tgtcov extern const char * dmmeta_Ssimfile_ssimfile_dev_timefmt; // dev.timefmt fconst:dmmeta.Ssimfile.ssimfile/dev.timefmt extern const char * dmmeta_Ssimfile_ssimfile_dev_tool_opt; // dev.tool_opt fconst:dmmeta.Ssimfile.ssimfile/dev.tool_opt +extern const char * dmmeta_Ssimfile_ssimfile_dev_transport; // dev.transport fconst:dmmeta.Ssimfile.ssimfile/dev.transport extern const char * dmmeta_Ssimfile_ssimfile_dev_uname; // dev.uname fconst:dmmeta.Ssimfile.ssimfile/dev.uname extern const char * dmmeta_Ssimfile_ssimfile_dev_unstablefld; // dev.unstablefld fconst:dmmeta.Ssimfile.ssimfile/dev.unstablefld extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_anonfld; // dmmeta.anonfld fconst:dmmeta.Ssimfile.ssimfile/dmmeta.anonfld @@ -529,6 +571,7 @@ extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_cfmt; // dm extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_cget; // dmmeta.cget fconst:dmmeta.Ssimfile.ssimfile/dmmeta.cget extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_charset; // dmmeta.charset fconst:dmmeta.Ssimfile.ssimfile/dmmeta.charset extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_chash; // dmmeta.chash fconst:dmmeta.Ssimfile.ssimfile/dmmeta.chash +extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_ckafka; // dmmeta.ckafka fconst:dmmeta.Ssimfile.ssimfile/dmmeta.ckafka extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_cppfunc; // dmmeta.cppfunc fconst:dmmeta.Ssimfile.ssimfile/dmmeta.cppfunc extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_cppkeyword; // dmmeta.cppkeyword fconst:dmmeta.Ssimfile.ssimfile/dmmeta.cppkeyword extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_cpptype; // dmmeta.cpptype fconst:dmmeta.Ssimfile.ssimfile/dmmeta.cpptype @@ -552,6 +595,7 @@ extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fbigend; // dm extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fbitset; // dmmeta.fbitset fconst:dmmeta.Ssimfile.ssimfile/dmmeta.fbitset extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fbuf; // dmmeta.fbuf fconst:dmmeta.Ssimfile.ssimfile/dmmeta.fbuf extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fbufdir; // dmmeta.fbufdir fconst:dmmeta.Ssimfile.ssimfile/dmmeta.fbufdir +extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fbufiotype; // dmmeta.fbufiotype fconst:dmmeta.Ssimfile.ssimfile/dmmeta.fbufiotype extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fbuftype; // dmmeta.fbuftype fconst:dmmeta.Ssimfile.ssimfile/dmmeta.fbuftype extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fcast; // dmmeta.fcast fconst:dmmeta.Ssimfile.ssimfile/dmmeta.fcast extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fcleanup; // dmmeta.fcleanup fconst:dmmeta.Ssimfile.ssimfile/dmmeta.fcleanup @@ -568,6 +612,7 @@ extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fflag; // dm extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_field; // dmmeta.field fconst:dmmeta.Ssimfile.ssimfile/dmmeta.field extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_findrem; // dmmeta.findrem fconst:dmmeta.Ssimfile.ssimfile/dmmeta.findrem extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_finput; // dmmeta.finput fconst:dmmeta.Ssimfile.ssimfile/dmmeta.finput +extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fkafka; // dmmeta.fkafka fconst:dmmeta.Ssimfile.ssimfile/dmmeta.fkafka extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fldoffset; // dmmeta.fldoffset fconst:dmmeta.Ssimfile.ssimfile/dmmeta.fldoffset extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_floadtuples; // dmmeta.floadtuples fconst:dmmeta.Ssimfile.ssimfile/dmmeta.floadtuples extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_fnoremove; // dmmeta.fnoremove fconst:dmmeta.Ssimfile.ssimfile/dmmeta.fnoremove @@ -588,6 +633,8 @@ extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_gsymbol; // dm extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_hashtype; // dmmeta.hashtype fconst:dmmeta.Ssimfile.ssimfile/dmmeta.hashtype extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_hook; // dmmeta.hook fconst:dmmeta.Ssimfile.ssimfile/dmmeta.hook extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_inlary; // dmmeta.inlary fconst:dmmeta.Ssimfile.ssimfile/dmmeta.inlary +extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_jstype; // dmmeta.jstype fconst:dmmeta.Ssimfile.ssimfile/dmmeta.jstype +extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_kafka_type_kind; // dmmeta.kafka_type_kind fconst:dmmeta.Ssimfile.ssimfile/dmmeta.kafka_type_kind extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_lenfld; // dmmeta.lenfld fconst:dmmeta.Ssimfile.ssimfile/dmmeta.lenfld extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_listtype; // dmmeta.listtype fconst:dmmeta.Ssimfile.ssimfile/dmmeta.listtype extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_llist; // dmmeta.llist fconst:dmmeta.Ssimfile.ssimfile/dmmeta.llist @@ -602,6 +649,7 @@ extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_nscpp; // dm extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_nsdb; // dmmeta.nsdb fconst:dmmeta.Ssimfile.ssimfile/dmmeta.nsdb extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_nsfast; // dmmeta.nsfast fconst:dmmeta.Ssimfile.ssimfile/dmmeta.nsfast extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_nsinclude; // dmmeta.nsinclude fconst:dmmeta.Ssimfile.ssimfile/dmmeta.nsinclude +extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_nsjs; // dmmeta.nsjs fconst:dmmeta.Ssimfile.ssimfile/dmmeta.nsjs extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_nsproto; // dmmeta.nsproto fconst:dmmeta.Ssimfile.ssimfile/dmmeta.nsproto extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_nstype; // dmmeta.nstype fconst:dmmeta.Ssimfile.ssimfile/dmmeta.nstype extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_nsversion; // dmmeta.nsversion fconst:dmmeta.Ssimfile.ssimfile/dmmeta.nsversion @@ -634,6 +682,7 @@ extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_thash; // dm extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_tracefld; // dmmeta.tracefld fconst:dmmeta.Ssimfile.ssimfile/dmmeta.tracefld extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_tracerec; // dmmeta.tracerec fconst:dmmeta.Ssimfile.ssimfile/dmmeta.tracerec extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_typefld; // dmmeta.typefld fconst:dmmeta.Ssimfile.ssimfile/dmmeta.typefld +extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_userfunc; // dmmeta.userfunc fconst:dmmeta.Ssimfile.ssimfile/dmmeta.userfunc extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_usertracefld; // dmmeta.usertracefld fconst:dmmeta.Ssimfile.ssimfile/dmmeta.usertracefld extern const char * dmmeta_Ssimfile_ssimfile_dmmeta_xref; // dmmeta.xref fconst:dmmeta.Ssimfile.ssimfile/dmmeta.xref extern const char * dmmeta_Ssimfile_ssimfile_fmdb_alarm; // fmdb.alarm fconst:dmmeta.Ssimfile.ssimfile/fmdb.alarm @@ -652,8 +701,6 @@ extern const char * dmmeta_Ssimfile_ssimfile_gclidb_gfld; // gc extern const char * dmmeta_Ssimfile_ssimfile_gclidb_githost; // gclidb.githost fconst:dmmeta.Ssimfile.ssimfile/gclidb.githost extern const char * dmmeta_Ssimfile_ssimfile_gclidb_gmethod; // gclidb.gmethod fconst:dmmeta.Ssimfile.ssimfile/gclidb.gmethod extern const char * dmmeta_Ssimfile_ssimfile_gclidb_grepo; // gclidb.grepo fconst:dmmeta.Ssimfile.ssimfile/gclidb.grepo -extern const char * dmmeta_Ssimfile_ssimfile_gclidb_grepogitport; // gclidb.grepogitport fconst:dmmeta.Ssimfile.ssimfile/gclidb.grepogitport -extern const char * dmmeta_Ssimfile_ssimfile_gclidb_grepossh; // gclidb.grepossh fconst:dmmeta.Ssimfile.ssimfile/gclidb.grepossh extern const char * dmmeta_Ssimfile_ssimfile_gclidb_gstate; // gclidb.gstate fconst:dmmeta.Ssimfile.ssimfile/gclidb.gstate extern const char * dmmeta_Ssimfile_ssimfile_gclidb_gstatet; // gclidb.gstatet fconst:dmmeta.Ssimfile.ssimfile/gclidb.gstatet extern const char * dmmeta_Ssimfile_ssimfile_gclidb_gtbl; // gclidb.gtbl fconst:dmmeta.Ssimfile.ssimfile/gclidb.gtbl @@ -674,11 +721,23 @@ extern const char * dmmeta_Ssimfile_ssimfile_gclidb_mrjob; // gc extern const char * dmmeta_Ssimfile_ssimfile_gclidb_mrnote; // gclidb.mrnote fconst:dmmeta.Ssimfile.ssimfile/gclidb.mrnote extern const char * dmmeta_Ssimfile_ssimfile_gclidb_project; // gclidb.project fconst:dmmeta.Ssimfile.ssimfile/gclidb.project extern const char * dmmeta_Ssimfile_ssimfile_gclidb_user; // gclidb.user fconst:dmmeta.Ssimfile.ssimfile/gclidb.user +extern const char * dmmeta_Ssimfile_ssimfile_httpdb_content; // httpdb.content fconst:dmmeta.Ssimfile.ssimfile/httpdb.content +extern const char * dmmeta_Ssimfile_ssimfile_httpdb_header; // httpdb.header fconst:dmmeta.Ssimfile.ssimfile/httpdb.header +extern const char * dmmeta_Ssimfile_ssimfile_httpdb_method; // httpdb.method fconst:dmmeta.Ssimfile.ssimfile/httpdb.method +extern const char * dmmeta_Ssimfile_ssimfile_httpdb_status; // httpdb.status fconst:dmmeta.Ssimfile.ssimfile/httpdb.status +extern const char * dmmeta_Ssimfile_ssimfile_httpdb_version; // httpdb.version fconst:dmmeta.Ssimfile.ssimfile/httpdb.version +extern const char * dmmeta_Ssimfile_ssimfile_sampdb_gitfile; // sampdb.gitfile fconst:dmmeta.Ssimfile.ssimfile/sampdb.gitfile +extern const char * dmmeta_Ssimfile_ssimfile_sampdb_targdep; // sampdb.targdep fconst:dmmeta.Ssimfile.ssimfile/sampdb.targdep +extern const char * dmmeta_Ssimfile_ssimfile_sampdb_target; // sampdb.target fconst:dmmeta.Ssimfile.ssimfile/sampdb.target +extern const char * dmmeta_Ssimfile_ssimfile_sampdb_targrec; // sampdb.targrec fconst:dmmeta.Ssimfile.ssimfile/sampdb.targrec +extern const char * dmmeta_Ssimfile_ssimfile_sampdb_targsrc; // sampdb.targsrc fconst:dmmeta.Ssimfile.ssimfile/sampdb.targsrc +extern const char * dmmeta_Ssimfile_ssimfile_wsdb_status; // wsdb.status fconst:dmmeta.Ssimfile.ssimfile/wsdb.status extern const char * dmmeta_Steptype_steptype_Callback; // Callback fconst:dmmeta.Steptype.steptype/Callback extern const char * dmmeta_Steptype_steptype_Extern; // Extern fconst:dmmeta.Steptype.steptype/Extern extern const char * dmmeta_Steptype_steptype_Inline; // Inline fconst:dmmeta.Steptype.steptype/Inline extern const char * dmmeta_Steptype_steptype_InlineOnce; // InlineOnce fconst:dmmeta.Steptype.steptype/InlineOnce extern const char * dmmeta_Steptype_steptype_InlineRecur; // InlineRecur fconst:dmmeta.Steptype.steptype/InlineRecur +extern const char * dmmeta_Steptype_steptype_TimeHookOnce; // TimeHookOnce fconst:dmmeta.Steptype.steptype/TimeHookOnce extern const char * dmmeta_Steptype_steptype_TimeHookRecur; // TimeHookRecur fconst:dmmeta.Steptype.steptype/TimeHookRecur extern const char * dmmeta_Strfmt_strfmt_Argv; // Argv fconst:dmmeta.Strfmt.strfmt/Argv extern const char * dmmeta_Strfmt_strfmt_ArgvGnu; // ArgvGnu fconst:dmmeta.Strfmt.strfmt/ArgvGnu @@ -701,6 +760,7 @@ namespace dmmeta { // gen:ns_pkeytypedef typedef algo::Smallstr50 FastinstrPkey; typedef algo::Smallstr50 FastopPkey; typedef algo::Smallstr50 FbufdirPkey; + typedef algo::Smallstr50 FbufiotypePkey; typedef algo::Smallstr50 FbuftypePkey; typedef algo::Smallstr250 FcmapPkey; typedef algo::Smallstr100 FconstPkey; @@ -713,6 +773,7 @@ namespace dmmeta { // gen:ns_pkeytypedef typedef algo::Smallstr100 FwddeclPkey; typedef algo::Smallstr50 GsymbolPkey; typedef algo::Smallstr50 HashtypePkey; + typedef algo::Smallstr50 KafkaTypeKindPkey; typedef algo::Smallstr5 ListtypePkey; typedef algo::Smallstr50 LogcatPkey; typedef algo::Smallstr16 NsPkey; @@ -720,7 +781,7 @@ namespace dmmeta { // gen:ns_pkeytypedef typedef algo::Smallstr50 NsincludePkey; typedef algo::Smallstr50 NstypePkey; typedef algo::Smallstr100 PmaskfldPkey; - typedef algo::Smallstr100 PmaskfldMemberPkey; + typedef algo::Smallstr200 PmaskfldMemberPkey; typedef algo::Smallstr100 PnewPkey; typedef algo::Smallstr50 PrintfmtPkey; typedef algo::Smallstr50 ReftypePkey; @@ -734,6 +795,7 @@ namespace dmmeta { // gen:ns_pkeytypedef typedef algo::Smallstr100 SubstrPkey; typedef algo::Smallstr100 TracefldPkey; typedef algo::Smallstr50 TracerecPkey; + typedef algo::Smallstr50 UserfuncPkey; typedef algo::Smallstr100 XrefPkey; } // gen:ns_pkeytypedef namespace dmmeta { // gen:ns_tclass_field @@ -754,6 +816,7 @@ namespace dmmeta { struct Cfmt; } namespace dmmeta { struct Cget; } namespace dmmeta { struct Charset; } namespace dmmeta { struct Chash; } +namespace dmmeta { struct Ckafka; } namespace dmmeta { struct Cppfunc; } namespace dmmeta { struct Cppkeyword; } namespace dmmeta { struct Cpptype; } @@ -780,6 +843,7 @@ namespace dmmeta { struct Fbigend; } namespace dmmeta { struct Fbitset; } namespace dmmeta { struct Fbuf; } namespace dmmeta { struct Fbufdir; } +namespace dmmeta { struct Fbufiotype; } namespace dmmeta { struct Fbuftype; } namespace dmmeta { struct Fcast; } namespace dmmeta { struct Fcleanup; } @@ -797,6 +861,7 @@ namespace dmmeta { struct Field; } namespace dmmeta { struct FieldId; } namespace dmmeta { struct Findrem; } namespace dmmeta { struct Finput; } +namespace dmmeta { struct Fkafka; } namespace dmmeta { struct Fldoffset; } namespace dmmeta { struct Floadtuples; } namespace dmmeta { struct Fnoremove; } @@ -817,6 +882,8 @@ namespace dmmeta { struct Gsymbol; } namespace dmmeta { struct Hashtype; } namespace dmmeta { struct Hook; } namespace dmmeta { struct Inlary; } +namespace dmmeta { struct Jstype; } +namespace dmmeta { struct KafkaTypeKind; } namespace dmmeta { struct Lenfld; } namespace dmmeta { struct Listtype; } namespace dmmeta { struct Llist; } @@ -831,6 +898,7 @@ namespace dmmeta { struct Nscpp; } namespace dmmeta { struct Nsdb; } namespace dmmeta { struct Nsfast; } namespace dmmeta { struct Nsinclude; } +namespace dmmeta { struct Nsjs; } namespace dmmeta { struct Nsproto; } namespace dmmeta { struct Nstype; } namespace dmmeta { struct Nsversion; } @@ -863,6 +931,7 @@ namespace dmmeta { struct Thash; } namespace dmmeta { struct Tracefld; } namespace dmmeta { struct Tracerec; } namespace dmmeta { struct Typefld; } +namespace dmmeta { struct Userfunc; } namespace dmmeta { struct Usertracefld; } namespace dmmeta { struct Xref; } namespace dmmeta { // gen:ns_print_struct @@ -1243,6 +1312,29 @@ bool Chash_ReadStrptrMaybe(dmmeta::Chash &parent, algo::strptr i // func:dmmeta.Chash..Print void Chash_Print(dmmeta::Chash& row, algo::cstring& str) __attribute__((nothrow)); +// --- dmmeta.Ckafka +struct Ckafka { // dmmeta.Ckafka + algo::Smallstr100 ctype; // + algo::Smallstr50 kind; // + algo::cstring root; // + algo::Smallstr10 valid_versions; // + algo::Smallstr10 flexible_versions; // + algo::Comment comment; // + // func:dmmeta.Ckafka..Ctor + inline Ckafka() __attribute__((nothrow)); +}; + +// func:dmmeta.Ckafka..ReadFieldMaybe +bool Ckafka_ReadFieldMaybe(dmmeta::Ckafka& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dmmeta::Ckafka from an ascii string. +// The format of the string is an ssim Tuple +// func:dmmeta.Ckafka..ReadStrptrMaybe +bool Ckafka_ReadStrptrMaybe(dmmeta::Ckafka &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:dmmeta.Ckafka.String printfmt:Tuple +// func:dmmeta.Ckafka..Print +void Ckafka_Print(dmmeta::Ckafka& row, algo::cstring& str) __attribute__((nothrow)); + // --- dmmeta.Cppfunc struct Cppfunc { // dmmeta.Cppfunc: Value of field provided by this expression algo::Smallstr100 field; // @@ -1431,11 +1523,13 @@ struct Dispatch { // dmmeta.Dispatch: Generate code for a multi-way branch bool haslen; // false Include length in dispatch function bool call; // false Generate call to user-defined function bool strict; // false Only dispatch if length matches exactly + bool dyn; // false Use dynamic memory allocation: new, delete instead of ByteAry + bool kafka; // false generate kafka codec algo::Comment comment; // // func:dmmeta.Dispatch..Ctor inline Dispatch() __attribute__((nothrow)); // func:dmmeta.Dispatch..FieldwiseCtor - explicit inline Dispatch(const algo::strptr& in_dispatch, bool in_unk, bool in_read, bool in_print, bool in_haslen, bool in_call, bool in_strict, const algo::Comment& in_comment) __attribute__((nothrow)); + explicit inline Dispatch(const algo::strptr& in_dispatch, bool in_unk, bool in_read, bool in_print, bool in_haslen, bool in_call, bool in_strict, bool in_dyn, bool in_kafka, const algo::Comment& in_comment) __attribute__((nothrow)); }; // func:dmmeta.Dispatch.ns.Get @@ -1891,6 +1985,7 @@ struct Fbuf { // dmmeta.Fbuf: Buffer for reading/writing messages, works with Io algo::Smallstr50 fbuftype; // Type of buffer algo::Smallstr100 insready; // algo::Smallstr100 inseof; // + algo::Smallstr50 iotype; // "standard" algo::Comment comment; // // func:dmmeta.Fbuf..Ctor inline Fbuf() __attribute__((nothrow)); @@ -1938,6 +2033,25 @@ inline void Fbufdir_Init(dmmeta::Fbufdir& parent); // func:dmmeta.Fbufdir..Print void Fbufdir_Print(dmmeta::Fbufdir& row, algo::cstring& str) __attribute__((nothrow)); +// --- dmmeta.Fbufiotype +struct Fbufiotype { // dmmeta.Fbufiotype: Underlying IO type + algo::Smallstr50 fbufiotype; // + algo::Comment comment; // + // func:dmmeta.Fbufiotype..Ctor + inline Fbufiotype() __attribute__((nothrow)); +}; + +// func:dmmeta.Fbufiotype..ReadFieldMaybe +bool Fbufiotype_ReadFieldMaybe(dmmeta::Fbufiotype& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dmmeta::Fbufiotype from an ascii string. +// The format of the string is an ssim Tuple +// func:dmmeta.Fbufiotype..ReadStrptrMaybe +bool Fbufiotype_ReadStrptrMaybe(dmmeta::Fbufiotype &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:dmmeta.Fbufiotype.String printfmt:Tuple +// func:dmmeta.Fbufiotype..Print +void Fbufiotype_Print(dmmeta::Fbufiotype& row, algo::cstring& str) __attribute__((nothrow)); + // --- dmmeta.Fbuftype struct Fbuftype { // dmmeta.Fbuftype: Buffer type algo::Smallstr50 fbuftype; // @@ -2461,6 +2575,32 @@ inline void Finput_Init(dmmeta::Finput& parent); // func:dmmeta.Finput..Print void Finput_Print(dmmeta::Finput& row, algo::cstring& str) __attribute__((nothrow)); +// --- dmmeta.Fkafka +struct Fkafka { // dmmeta.Fkafka + algo::Smallstr100 field; // + algo::Smallstr10 versions; // + algo::Smallstr10 nullable_versions; // + algo::Smallstr10 tagged_versions; // + u64 tag; // 0 + algo::Comment comment; // + // func:dmmeta.Fkafka..Ctor + inline Fkafka() __attribute__((nothrow)); +}; + +// func:dmmeta.Fkafka..ReadFieldMaybe +bool Fkafka_ReadFieldMaybe(dmmeta::Fkafka& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dmmeta::Fkafka from an ascii string. +// The format of the string is an ssim Tuple +// func:dmmeta.Fkafka..ReadStrptrMaybe +bool Fkafka_ReadStrptrMaybe(dmmeta::Fkafka &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:dmmeta.Fkafka..Init +inline void Fkafka_Init(dmmeta::Fkafka& parent); +// print string representation of ROW to string STR +// cfmt:dmmeta.Fkafka.String printfmt:Tuple +// func:dmmeta.Fkafka..Print +void Fkafka_Print(dmmeta::Fkafka& row, algo::cstring& str) __attribute__((nothrow)); + // --- dmmeta.Fldoffset struct Fldoffset { // dmmeta.Fldoffset: Assert field offset - will result in compile-time error if violated algo::Smallstr100 field; // @@ -2919,8 +3059,7 @@ void Hashtype_Print(dmmeta::Hashtype& row, algo::cstring& str) _ // --- dmmeta.Hook struct Hook { // dmmeta.Hook: Required on Hook fields - algo::Smallstr100 field; // The field - algo::Comment comment; // + algo::Smallstr100 field; // The field // func:dmmeta.Hook..Ctor inline Hook() __attribute__((nothrow)); }; @@ -2962,6 +3101,44 @@ inline void Inlary_Init(dmmeta::Inlary& parent); // func:dmmeta.Inlary..Print void Inlary_Print(dmmeta::Inlary& row, algo::cstring& str) __attribute__((nothrow)); +// --- dmmeta.Jstype +struct Jstype { // dmmeta.Jstype + algo::Smallstr100 ctype; // + algo::Comment comment; // + // func:dmmeta.Jstype..Ctor + inline Jstype() __attribute__((nothrow)); +}; + +// func:dmmeta.Jstype..ReadFieldMaybe +bool Jstype_ReadFieldMaybe(dmmeta::Jstype& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dmmeta::Jstype from an ascii string. +// The format of the string is an ssim Tuple +// func:dmmeta.Jstype..ReadStrptrMaybe +bool Jstype_ReadStrptrMaybe(dmmeta::Jstype &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:dmmeta.Jstype.String printfmt:Tuple +// func:dmmeta.Jstype..Print +void Jstype_Print(dmmeta::Jstype& row, algo::cstring& str) __attribute__((nothrow)); + +// --- dmmeta.KafkaTypeKind +struct KafkaTypeKind { // dmmeta.KafkaTypeKind + algo::Smallstr50 kafka_type_kind; // + algo::Comment comment; // + // func:dmmeta.KafkaTypeKind..Ctor + inline KafkaTypeKind() __attribute__((nothrow)); +}; + +// func:dmmeta.KafkaTypeKind..ReadFieldMaybe +bool KafkaTypeKind_ReadFieldMaybe(dmmeta::KafkaTypeKind& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dmmeta::KafkaTypeKind from an ascii string. +// The format of the string is an ssim Tuple +// func:dmmeta.KafkaTypeKind..ReadStrptrMaybe +bool KafkaTypeKind_ReadStrptrMaybe(dmmeta::KafkaTypeKind &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:dmmeta.KafkaTypeKind.String printfmt:Tuple +// func:dmmeta.KafkaTypeKind..Print +void KafkaTypeKind_Print(dmmeta::KafkaTypeKind& row, algo::cstring& str) __attribute__((nothrow)); + // --- dmmeta.Lenfld struct Lenfld { // dmmeta.Lenfld: Specify which gives length of varlen portion in bytes algo::Smallstr100 field; // Name of length field @@ -3052,6 +3229,9 @@ struct Logcat { // dmmeta.Logcat: Log category algo::Smallstr50 logcat; // bool enabled; // false bool builtin; // false + bool stdout; // false + i32 maxmsg; // 0 + i32 window; // 0 algo::Comment comment; // // func:dmmeta.Logcat..Ctor inline Logcat() __attribute__((nothrow)); @@ -3290,6 +3470,30 @@ inline void Nsinclude_Init(dmmeta::Nsinclude& parent); // func:dmmeta.Nsinclude..Print void Nsinclude_Print(dmmeta::Nsinclude& row, algo::cstring& str) __attribute__((nothrow)); +// --- dmmeta.Nsjs +struct Nsjs { // dmmeta.Nsjs: Generate JavaScript code for this namespace + algo::Smallstr16 ns; // + bool typescript; // false Generate typescript + bool gensel; // false Generate selected, false-all + algo::Comment comment; // + // func:dmmeta.Nsjs..Ctor + inline Nsjs() __attribute__((nothrow)); +}; + +// func:dmmeta.Nsjs..ReadFieldMaybe +bool Nsjs_ReadFieldMaybe(dmmeta::Nsjs& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dmmeta::Nsjs from an ascii string. +// The format of the string is an ssim Tuple +// func:dmmeta.Nsjs..ReadStrptrMaybe +bool Nsjs_ReadStrptrMaybe(dmmeta::Nsjs &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:dmmeta.Nsjs..Init +inline void Nsjs_Init(dmmeta::Nsjs& parent); +// print string representation of ROW to string STR +// cfmt:dmmeta.Nsjs.String printfmt:Tuple +// func:dmmeta.Nsjs..Print +void Nsjs_Print(dmmeta::Nsjs& row, algo::cstring& str) __attribute__((nothrow)); + // --- dmmeta.Nsproto struct Nsproto { // dmmeta.Nsproto: Annotate protocol namespace (collection of types, no state) algo::Smallstr16 ns; // @@ -3460,7 +3664,7 @@ void Pmaskfld_Print(dmmeta::Pmaskfld& row, algo::cstring& str) _ // --- dmmeta.PmaskfldMember struct PmaskfldMember { // dmmeta.PmaskfldMember: Explicit field-to-pmask association - algo::Smallstr100 pmaskfld_member; // + algo::Smallstr200 pmaskfld_member; // algo::Comment comment; // // func:dmmeta.PmaskfldMember..Ctor inline PmaskfldMember() __attribute__((nothrow)); @@ -3548,12 +3752,13 @@ void Printfmt_Print(dmmeta::Printfmt& row, algo::cstring& str) _ // --- dmmeta.Ptrary struct Ptrary { // dmmeta.Ptrary: Required for fields with reftype:Ptrary - algo::Smallstr100 field; // - bool unique; // false Search for and ignore duplicates + algo::Smallstr100 field; // + bool unique; // false Search for and ignore duplicates + bool heaplike; // false // func:dmmeta.Ptrary..Ctor inline Ptrary() __attribute__((nothrow)); // func:dmmeta.Ptrary..FieldwiseCtor - explicit inline Ptrary(const algo::strptr& in_field, bool in_unique) __attribute__((nothrow)); + explicit inline Ptrary(const algo::strptr& in_field, bool in_unique, bool in_heaplike) __attribute__((nothrow)); }; // func:dmmeta.Ptrary..ReadFieldMaybe @@ -4122,6 +4327,27 @@ bool Typefld_ReadStrptrMaybe(dmmeta::Typefld &parent, algo::strp // func:dmmeta.Typefld..Print void Typefld_Print(dmmeta::Typefld& row, algo::cstring& str) __attribute__((nothrow)); +// --- dmmeta.Userfunc +struct Userfunc { // dmmeta.Userfunc + algo::Smallstr50 userfunc; // + algo::Smallstr200 acrkey; // + algo::Smallstr100 cppname; // + algo::Comment comment; // + // func:dmmeta.Userfunc..Ctor + inline Userfunc() __attribute__((nothrow)); +}; + +// func:dmmeta.Userfunc..ReadFieldMaybe +bool Userfunc_ReadFieldMaybe(dmmeta::Userfunc& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of dmmeta::Userfunc from an ascii string. +// The format of the string is an ssim Tuple +// func:dmmeta.Userfunc..ReadStrptrMaybe +bool Userfunc_ReadStrptrMaybe(dmmeta::Userfunc &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:dmmeta.Userfunc.String printfmt:Tuple +// func:dmmeta.Userfunc..Print +void Userfunc_Print(dmmeta::Userfunc& row, algo::cstring& str) __attribute__((nothrow)); + // --- dmmeta.Usertracefld struct Usertracefld { // dmmeta.Usertracefld: Add custom user trace fields to process's trace struct algo::Smallstr100 tracefld; // @@ -4205,6 +4431,7 @@ inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Cfmt &row);/ inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Cget &row);// cfmt:dmmeta.Cget.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Charset &row);// cfmt:dmmeta.Charset.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Chash &row);// cfmt:dmmeta.Chash.String +inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Ckafka &row);// cfmt:dmmeta.Ckafka.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Cppfunc &row);// cfmt:dmmeta.Cppfunc.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Cppkeyword &row);// cfmt:dmmeta.Cppkeyword.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Cpptype &row);// cfmt:dmmeta.Cpptype.String @@ -4228,6 +4455,7 @@ inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Fbigend &row inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Fbitset &row);// cfmt:dmmeta.Fbitset.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Fbuf &row);// cfmt:dmmeta.Fbuf.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Fbufdir &row);// cfmt:dmmeta.Fbufdir.String +inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Fbufiotype &row);// cfmt:dmmeta.Fbufiotype.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Fbuftype &row);// cfmt:dmmeta.Fbuftype.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Fcast &row);// cfmt:dmmeta.Fcast.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Fcleanup &row);// cfmt:dmmeta.Fcleanup.String @@ -4245,6 +4473,7 @@ inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Field &row); inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::FieldId &row);// cfmt:dmmeta.FieldId.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Findrem &row);// cfmt:dmmeta.Findrem.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Finput &row);// cfmt:dmmeta.Finput.String +inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Fkafka &row);// cfmt:dmmeta.Fkafka.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Fldoffset &row);// cfmt:dmmeta.Fldoffset.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Floadtuples &row);// cfmt:dmmeta.Floadtuples.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Fnoremove &row);// cfmt:dmmeta.Fnoremove.String @@ -4265,6 +4494,8 @@ inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Gsymbol &row inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Hashtype &row);// cfmt:dmmeta.Hashtype.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Hook &row);// cfmt:dmmeta.Hook.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Inlary &row);// cfmt:dmmeta.Inlary.String +inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Jstype &row);// cfmt:dmmeta.Jstype.String +inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::KafkaTypeKind &row);// cfmt:dmmeta.KafkaTypeKind.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Lenfld &row);// cfmt:dmmeta.Lenfld.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Listtype &row);// cfmt:dmmeta.Listtype.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Llist &row);// cfmt:dmmeta.Llist.String @@ -4279,6 +4510,7 @@ inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Nscpp &row); inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Nsdb &row);// cfmt:dmmeta.Nsdb.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Nsfast &row);// cfmt:dmmeta.Nsfast.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Nsinclude &row);// cfmt:dmmeta.Nsinclude.String +inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Nsjs &row);// cfmt:dmmeta.Nsjs.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Nsproto &row);// cfmt:dmmeta.Nsproto.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Nstype &row);// cfmt:dmmeta.Nstype.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Nsversion &row);// cfmt:dmmeta.Nsversion.String @@ -4309,6 +4541,7 @@ inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Thash &row); inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Tracefld &row);// cfmt:dmmeta.Tracefld.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Tracerec &row);// cfmt:dmmeta.Tracerec.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Typefld &row);// cfmt:dmmeta.Typefld.String +inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Userfunc &row);// cfmt:dmmeta.Userfunc.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Usertracefld &row);// cfmt:dmmeta.Usertracefld.String inline algo::cstring &operator <<(algo::cstring &str, const dmmeta::Xref &row);// cfmt:dmmeta.Xref.String } diff --git a/include/gen/dmmeta_gen.inl.h b/include/gen/dmmeta_gen.inl.h index a0daedc2..3758b351 100644 --- a/include/gen/dmmeta_gen.inl.h +++ b/include/gen/dmmeta_gen.inl.h @@ -216,6 +216,10 @@ inline dmmeta::Chash::Chash(const algo::strptr& in_ctype, const algo::strptr& i { } +// --- dmmeta.Ckafka..Ctor +inline dmmeta::Ckafka::Ckafka() { +} + // --- dmmeta.Cppfunc..Init // Set all fields to initial values. inline void dmmeta::Cppfunc_Init(dmmeta::Cppfunc& parent) { @@ -333,7 +337,7 @@ inline dmmeta::Dispatch::Dispatch() { } // --- dmmeta.Dispatch..FieldwiseCtor -inline dmmeta::Dispatch::Dispatch(const algo::strptr& in_dispatch, bool in_unk, bool in_read, bool in_print, bool in_haslen, bool in_call, bool in_strict, const algo::Comment& in_comment) +inline dmmeta::Dispatch::Dispatch(const algo::strptr& in_dispatch, bool in_unk, bool in_read, bool in_print, bool in_haslen, bool in_call, bool in_strict, bool in_dyn, bool in_kafka, const algo::Comment& in_comment) : dispatch(in_dispatch) , unk(in_unk) , read(in_read) @@ -341,6 +345,8 @@ inline dmmeta::Dispatch::Dispatch(const algo::strptr& in_dispatch, bool in_unk, , haslen(in_haslen) , call(in_call) , strict(in_strict) + , dyn(in_dyn) + , kafka(in_kafka) , comment(in_comment) { } @@ -560,6 +566,7 @@ inline dmmeta::Fbitset::Fbitset(const algo::strptr& in_field, const algo::Comme // Set all fields to initial values. inline void dmmeta::Fbuf_Init(dmmeta::Fbuf& parent) { parent.max = u32(0); + parent.iotype = algo::strptr("standard"); } // --- dmmeta.Fbuf..Ctor @@ -578,6 +585,10 @@ inline dmmeta::Fbufdir::Fbufdir() { dmmeta::Fbufdir_Init(*this); } +// --- dmmeta.Fbufiotype..Ctor +inline dmmeta::Fbufiotype::Fbufiotype() { +} + // --- dmmeta.Fbuftype..Init // Set all fields to initial values. inline void dmmeta::Fbuftype_Init(dmmeta::Fbuftype& parent) { @@ -802,6 +813,17 @@ inline dmmeta::Finput::Finput(const algo::strptr& in_field, bool in_extrn, bool { } +// --- dmmeta.Fkafka..Init +// Set all fields to initial values. +inline void dmmeta::Fkafka_Init(dmmeta::Fkafka& parent) { + parent.tag = u64(0); +} + +// --- dmmeta.Fkafka..Ctor +inline dmmeta::Fkafka::Fkafka() { + dmmeta::Fkafka_Init(*this); +} + // --- dmmeta.Fldoffset..Init // Set all fields to initial values. inline void dmmeta::Fldoffset_Init(dmmeta::Fldoffset& parent) { @@ -957,6 +979,14 @@ inline dmmeta::Inlary::Inlary(const algo::strptr& in_field, i32 in_min, i32 in_ { } +// --- dmmeta.Jstype..Ctor +inline dmmeta::Jstype::Jstype() { +} + +// --- dmmeta.KafkaTypeKind..Ctor +inline dmmeta::KafkaTypeKind::KafkaTypeKind() { +} + // --- dmmeta.Lenfld..Init // Set all fields to initial values. inline void dmmeta::Lenfld_Init(dmmeta::Lenfld& parent) { @@ -1014,6 +1044,9 @@ inline dmmeta::Llist::Llist(const algo::strptr& in_field, bool in_havetail, boo inline void dmmeta::Logcat_Init(dmmeta::Logcat& parent) { parent.enabled = bool(false); parent.builtin = bool(false); + parent.stdout = bool(false); + parent.maxmsg = i32(0); + parent.window = i32(0); } // --- dmmeta.Logcat..Ctor @@ -1105,6 +1138,18 @@ inline dmmeta::Nsinclude::Nsinclude() { dmmeta::Nsinclude_Init(*this); } +// --- dmmeta.Nsjs..Init +// Set all fields to initial values. +inline void dmmeta::Nsjs_Init(dmmeta::Nsjs& parent) { + parent.typescript = bool(false); + parent.gensel = bool(false); +} + +// --- dmmeta.Nsjs..Ctor +inline dmmeta::Nsjs::Nsjs() { + dmmeta::Nsjs_Init(*this); +} + // --- dmmeta.Nsproto..Ctor inline dmmeta::Nsproto::Nsproto() { } @@ -1231,6 +1276,7 @@ inline dmmeta::Printfmt::Printfmt() { // Set all fields to initial values. inline void dmmeta::Ptrary_Init(dmmeta::Ptrary& parent) { parent.unique = bool(false); + parent.heaplike = bool(false); } // --- dmmeta.Ptrary..Ctor @@ -1239,9 +1285,10 @@ inline dmmeta::Ptrary::Ptrary() { } // --- dmmeta.Ptrary..FieldwiseCtor -inline dmmeta::Ptrary::Ptrary(const algo::strptr& in_field, bool in_unique) +inline dmmeta::Ptrary::Ptrary(const algo::strptr& in_field, bool in_unique, bool in_heaplike) : field(in_field) , unique(in_unique) + , heaplike(in_heaplike) { } @@ -1470,6 +1517,10 @@ inline dmmeta::Typefld::Typefld(const algo::strptr& in_field, const algo::Comme { } +// --- dmmeta.Userfunc..Ctor +inline dmmeta::Userfunc::Userfunc() { +} + // --- dmmeta.Usertracefld..Ctor inline dmmeta::Usertracefld::Usertracefld() { } @@ -1568,6 +1619,11 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Chash return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Ckafka &row) {// cfmt:dmmeta.Ckafka.String + dmmeta::Ckafka_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Cppfunc &row) {// cfmt:dmmeta.Cppfunc.String dmmeta::Cppfunc_Print(const_cast(row), str); return str; @@ -1683,6 +1739,11 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Fbufdi return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Fbufiotype &row) {// cfmt:dmmeta.Fbufiotype.String + dmmeta::Fbufiotype_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Fbuftype &row) {// cfmt:dmmeta.Fbuftype.String dmmeta::Fbuftype_Print(const_cast(row), str); return str; @@ -1768,6 +1829,11 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Finput return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Fkafka &row) {// cfmt:dmmeta.Fkafka.String + dmmeta::Fkafka_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Fldoffset &row) {// cfmt:dmmeta.Fldoffset.String dmmeta::Fldoffset_Print(const_cast(row), str); return str; @@ -1868,6 +1934,16 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Inlary return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Jstype &row) {// cfmt:dmmeta.Jstype.String + dmmeta::Jstype_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::KafkaTypeKind &row) {// cfmt:dmmeta.KafkaTypeKind.String + dmmeta::KafkaTypeKind_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Lenfld &row) {// cfmt:dmmeta.Lenfld.String dmmeta::Lenfld_Print(const_cast(row), str); return str; @@ -1938,6 +2014,11 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Nsincl return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Nsjs &row) {// cfmt:dmmeta.Nsjs.String + dmmeta::Nsjs_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Nsproto &row) {// cfmt:dmmeta.Nsproto.String dmmeta::Nsproto_Print(const_cast(row), str); return str; @@ -2088,6 +2169,11 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Typefl return str; } +inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Userfunc &row) {// cfmt:dmmeta.Userfunc.String + dmmeta::Userfunc_Print(const_cast(row), str); + return str; +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const dmmeta::Usertracefld &row) {// cfmt:dmmeta.Usertracefld.String dmmeta::Usertracefld_Print(const_cast(row), str); return str; diff --git a/include/gen/fm_gen.h b/include/gen/fm_gen.h index 54c60b04..260d9b24 100644 --- a/include/gen/fm_gen.h +++ b/include/gen/fm_gen.h @@ -121,8 +121,6 @@ struct Code { // fm.Code // Access string as array of chars // func:fm.Code.ch.Getary inline algo::aryptr ch_Getary(const fm::Code& parent) __attribute__((nothrow)); -// func:fm.Code.ch.HashStrptr -inline u32 Code_Hash(u32 prev, const algo::strptr &str); // func:fm.Code.ch.Init inline void ch_Init(fm::Code &parent) __attribute__((nothrow)); // always return constant 32 @@ -189,8 +187,6 @@ struct Objtype { // fm.Objtype // Access string as array of chars // func:fm.Objtype.ch.Getary inline algo::aryptr ch_Getary(const fm::Objtype& parent) __attribute__((nothrow)); -// func:fm.Objtype.ch.HashStrptr -inline u32 Objtype_Hash(u32 prev, const algo::strptr &str); // func:fm.Objtype.ch.Init inline void ch_Init(fm::Objtype &parent) __attribute__((nothrow)); // always return constant 15 @@ -257,8 +253,6 @@ struct Objinst { // fm.Objinst // Access string as array of chars // func:fm.Objinst.ch.Getary inline algo::aryptr ch_Getary(const fm::Objinst& parent) __attribute__((nothrow)); -// func:fm.Objinst.ch.HashStrptr -inline u32 Objinst_Hash(u32 prev, const algo::strptr &str); // func:fm.Objinst.ch.Init inline void ch_Init(fm::Objinst &parent) __attribute__((nothrow)); // always return constant 79 @@ -461,8 +455,6 @@ struct Summary { // fm.Summary // Access string as array of chars // func:fm.Summary.ch.Getary inline algo::aryptr ch_Getary(const fm::Summary& parent) __attribute__((nothrow)); -// func:fm.Summary.ch.HashStrptr -inline u32 Summary_Hash(u32 prev, const algo::strptr &str); // func:fm.Summary.ch.Init inline void ch_Init(fm::Summary &parent) __attribute__((nothrow)); // always return constant 64 @@ -529,8 +521,6 @@ struct Description { // fm.Description // Access string as array of chars // func:fm.Description.ch.Getary inline algo::aryptr ch_Getary(const fm::Description& parent) __attribute__((nothrow)); -// func:fm.Description.ch.HashStrptr -inline u32 Description_Hash(u32 prev, const algo::strptr &str); // func:fm.Description.ch.Init inline void ch_Init(fm::Description &parent) __attribute__((nothrow)); // always return constant 128 @@ -597,8 +587,6 @@ struct Source { // fm.Source // Access string as array of chars // func:fm.Source.ch.Getary inline algo::aryptr ch_Getary(const fm::Source& parent) __attribute__((nothrow)); -// func:fm.Source.ch.HashStrptr -inline u32 Source_Hash(u32 prev, const algo::strptr &str); // func:fm.Source.ch.Init inline void ch_Init(fm::Source &parent) __attribute__((nothrow)); // always return constant 32 diff --git a/include/gen/fm_gen.inl.h b/include/gen/fm_gen.inl.h index 0f78f921..256c2d8a 100644 --- a/include/gen/fm_gen.inl.h +++ b/include/gen/fm_gen.inl.h @@ -35,11 +35,6 @@ inline algo::aryptr fm::ch_Getary(const fm::Code& parent) { return ret; } -// --- fm.Code.ch.HashStrptr -inline u32 fm::Code_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- fm.Code.ch.Init inline void fm::ch_Init(fm::Code &parent) { memset(parent.ch, ' ', 32); @@ -143,11 +138,6 @@ inline algo::aryptr fm::ch_Getary(const fm::Objtype& parent) { return ret; } -// --- fm.Objtype.ch.HashStrptr -inline u32 fm::Objtype_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- fm.Objtype.ch.Init inline void fm::ch_Init(fm::Objtype &parent) { memset(parent.ch, ' ', 15); @@ -251,11 +241,6 @@ inline algo::aryptr fm::ch_Getary(const fm::Objinst& parent) { return ret; } -// --- fm.Objinst.ch.HashStrptr -inline u32 fm::Objinst_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- fm.Objinst.ch.Init inline void fm::ch_Init(fm::Objinst &parent) { memset(parent.ch, ' ', 79); @@ -520,11 +505,6 @@ inline algo::aryptr fm::ch_Getary(const fm::Summary& parent) { return ret; } -// --- fm.Summary.ch.HashStrptr -inline u32 fm::Summary_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- fm.Summary.ch.Init inline void fm::ch_Init(fm::Summary &parent) { memset(parent.ch, ' ', 64); @@ -632,11 +612,6 @@ inline algo::aryptr fm::ch_Getary(const fm::Description& parent) { return ret; } -// --- fm.Description.ch.HashStrptr -inline u32 fm::Description_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- fm.Description.ch.Init inline void fm::ch_Init(fm::Description &parent) { memset(parent.ch, ' ', 128); @@ -752,11 +727,6 @@ inline algo::aryptr fm::ch_Getary(const fm::Source& parent) { return ret; } -// --- fm.Source.ch.HashStrptr -inline u32 fm::Source_Hash(u32 prev, const algo::strptr &str) { - return algo::CRC32Step(prev, (u8*)str.elems, str.n_elems); -} - // --- fm.Source.ch.Init inline void fm::ch_Init(fm::Source &parent) { memset(parent.ch, ' ', 32); diff --git a/include/gen/gcli_gen.h b/include/gen/gcli_gen.h index c229a0e2..e225c6d4 100644 --- a/include/gen/gcli_gen.h +++ b/include/gen/gcli_gen.h @@ -54,38 +54,34 @@ enum { gcli_FieldIdEnum_N = 1 }; // --- gcli_TableIdEnum -enum gcli_TableIdEnum { // gcli.TableId.value - gcli_TableId_gclidb_Gact = 0 // gclidb.Gact -> gcli.FGact - ,gcli_TableId_gclidb_gact = 0 // gclidb.gact -> gcli.FGact - ,gcli_TableId_gclidb_Gclicmdf2j = 1 // gclidb.Gclicmdf2j -> gcli.FGclicmdf2j - ,gcli_TableId_gclidb_gclicmdf2j = 1 // gclidb.gclicmdf2j -> gcli.FGclicmdf2j - ,gcli_TableId_gclidb_Gclicmdt = 2 // gclidb.Gclicmdt -> gcli.FGclicmdt - ,gcli_TableId_gclidb_gclicmdt = 2 // gclidb.gclicmdt -> gcli.FGclicmdt - ,gcli_TableId_gclidb_Gfld = 3 // gclidb.Gfld -> gcli.FGfld - ,gcli_TableId_gclidb_gfld = 3 // gclidb.gfld -> gcli.FGfld - ,gcli_TableId_gclidb_Gmethod = 4 // gclidb.Gmethod -> gcli.FGmethod - ,gcli_TableId_gclidb_gmethod = 4 // gclidb.gmethod -> gcli.FGmethod - ,gcli_TableId_gclidb_Grepo = 5 // gclidb.Grepo -> gcli.FGrepo - ,gcli_TableId_gclidb_grepo = 5 // gclidb.grepo -> gcli.FGrepo - ,gcli_TableId_gclidb_Grepogitport = 6 // gclidb.Grepogitport -> gcli.FGrepogitport - ,gcli_TableId_gclidb_grepogitport = 6 // gclidb.grepogitport -> gcli.FGrepogitport - ,gcli_TableId_gclidb_Grepossh = 7 // gclidb.Grepossh -> gcli.FGrepossh - ,gcli_TableId_gclidb_grepossh = 7 // gclidb.grepossh -> gcli.FGrepossh - ,gcli_TableId_gclidb_Gstatet = 8 // gclidb.Gstatet -> gcli.FGstatet - ,gcli_TableId_gclidb_gstatet = 8 // gclidb.gstatet -> gcli.FGstatet - ,gcli_TableId_gclidb_Gtbl = 9 // gclidb.Gtbl -> gcli.FGtbl - ,gcli_TableId_gclidb_gtbl = 9 // gclidb.gtbl -> gcli.FGtbl - ,gcli_TableId_gclidb_Gtblactfld = 10 // gclidb.Gtblactfld -> gcli.FGtblactfld - ,gcli_TableId_gclidb_gtblactfld = 10 // gclidb.gtblactfld -> gcli.FGtblactfld - ,gcli_TableId_gclidb_Gtype = 11 // gclidb.Gtype -> gcli.FGtype - ,gcli_TableId_gclidb_gtype = 11 // gclidb.gtype -> gcli.FGtype - ,gcli_TableId_gclidb_Gtypeh = 12 // gclidb.Gtypeh -> gcli.FGtypeh - ,gcli_TableId_gclidb_gtypeh = 12 // gclidb.gtypeh -> gcli.FGtypeh - ,gcli_TableId_gclidb_Gtypeprefix = 13 // gclidb.Gtypeprefix -> gcli.FGtypeprefix - ,gcli_TableId_gclidb_gtypeprefix = 13 // gclidb.gtypeprefix -> gcli.FGtypeprefix +enum gcli_TableIdEnum { // gcli.TableId.value + gcli_TableId_gclidb_Gact = 0 // gclidb.Gact -> gcli.FGact + ,gcli_TableId_gclidb_gact = 0 // gclidb.gact -> gcli.FGact + ,gcli_TableId_gclidb_Gclicmdf2j = 1 // gclidb.Gclicmdf2j -> gcli.FGclicmdf2j + ,gcli_TableId_gclidb_gclicmdf2j = 1 // gclidb.gclicmdf2j -> gcli.FGclicmdf2j + ,gcli_TableId_gclidb_Gclicmdt = 2 // gclidb.Gclicmdt -> gcli.FGclicmdt + ,gcli_TableId_gclidb_gclicmdt = 2 // gclidb.gclicmdt -> gcli.FGclicmdt + ,gcli_TableId_gclidb_Gfld = 3 // gclidb.Gfld -> gcli.FGfld + ,gcli_TableId_gclidb_gfld = 3 // gclidb.gfld -> gcli.FGfld + ,gcli_TableId_gclidb_Gmethod = 4 // gclidb.Gmethod -> gcli.FGmethod + ,gcli_TableId_gclidb_gmethod = 4 // gclidb.gmethod -> gcli.FGmethod + ,gcli_TableId_gclidb_Grepo = 5 // gclidb.Grepo -> gcli.FGrepo + ,gcli_TableId_gclidb_grepo = 5 // gclidb.grepo -> gcli.FGrepo + ,gcli_TableId_gclidb_Gstatet = 6 // gclidb.Gstatet -> gcli.FGstatet + ,gcli_TableId_gclidb_gstatet = 6 // gclidb.gstatet -> gcli.FGstatet + ,gcli_TableId_gclidb_Gtbl = 7 // gclidb.Gtbl -> gcli.FGtbl + ,gcli_TableId_gclidb_gtbl = 7 // gclidb.gtbl -> gcli.FGtbl + ,gcli_TableId_gclidb_Gtblactfld = 8 // gclidb.Gtblactfld -> gcli.FGtblactfld + ,gcli_TableId_gclidb_gtblactfld = 8 // gclidb.gtblactfld -> gcli.FGtblactfld + ,gcli_TableId_gclidb_Gtype = 9 // gclidb.Gtype -> gcli.FGtype + ,gcli_TableId_gclidb_gtype = 9 // gclidb.gtype -> gcli.FGtype + ,gcli_TableId_gclidb_Gtypeh = 10 // gclidb.Gtypeh -> gcli.FGtypeh + ,gcli_TableId_gclidb_gtypeh = 10 // gclidb.gtypeh -> gcli.FGtypeh + ,gcli_TableId_gclidb_Gtypeprefix = 11 // gclidb.Gtypeprefix -> gcli.FGtypeprefix + ,gcli_TableId_gclidb_gtypeprefix = 11 // gclidb.gtypeprefix -> gcli.FGtypeprefix }; -enum { gcli_TableIdEnum_N = 28 }; +enum { gcli_TableIdEnum_N = 24 }; namespace gcli { // gen:ns_pkeytypedef } // gen:ns_pkeytypedef @@ -102,11 +98,10 @@ namespace gcli { struct FGtype; } namespace gclidb { struct Gfld; } namespace gclidb { struct Gmethod; } namespace gclidb { struct Grepo; } -namespace gclidb { struct Grepogitport; } -namespace gclidb { struct Grepossh; } namespace gclidb { struct Gstatet; } namespace gclidb { struct Gtbl; } namespace gclidb { struct Gtblact; } +namespace gcli { struct FGtblact; } namespace gclidb { struct Gtblactfld; } namespace gcli { struct FGfld; } namespace gclidb { struct Gtype; } @@ -120,8 +115,6 @@ namespace gclidb { struct Mrjob; } namespace gclidb { struct Mrnote; } namespace gclidb { struct User; } namespace gcli { struct _db_gtype_curs; } -namespace gcli { struct _db_grepossh_curs; } -namespace gcli { struct _db_grepogitport_curs; } namespace gcli { struct _db_githost_curs; } namespace gcli { struct _db_gstatet_curs; } namespace gcli { struct _db_gmethod_curs; } @@ -179,11 +172,8 @@ namespace gcli { struct FGclicmdt; } namespace gcli { struct FGithost; } namespace gcli { struct FGmethod; } namespace gcli { struct FGrepo; } -namespace gcli { struct FGrepogitport; } -namespace gcli { struct FGrepossh; } namespace gcli { struct FGstatet; } namespace gcli { struct FGtbl; } -namespace gcli { struct FGtblact; } namespace gcli { struct FGtblactfld; } namespace gcli { struct FGtypeh; } namespace gcli { struct FGtypeprefix; } @@ -221,160 +211,150 @@ void trace_Print(gcli::trace& row, algo::cstring& str) __attribu // --- gcli.FDb // create: gcli.FDb._db (Global) struct FDb { // gcli.FDb: In-memory database for gcli - command::gcli cmdline; // - gcli::FGtype* gtype_lary[32]; // level array - i32 gtype_n; // number of elements in array - gcli::FGrepossh* grepossh_lary[32]; // level array - i32 grepossh_n; // number of elements in array - gcli::FGrepogitport* grepogitport_lary[32]; // level array - i32 grepogitport_n; // number of elements in array - gcli::FGithost* githost_lary[32]; // level array - i32 githost_n; // number of elements in array - bool need_auth; // false - gcli::FGstatet* gstatet_lary[32]; // level array - i32 gstatet_n; // number of elements in array - gcli::FGmethod* gmethod_lary[32]; // level array - i32 gmethod_n; // number of elements in array - gcli::FGclicmdt* gclicmdt_lary[32]; // level array - i32 gclicmdt_n; // number of elements in array - gcli::FGclicmdf* gclicmdf_lary[32]; // level array - i32 gclicmdf_n; // number of elements in array - gcli::FGclicmdf2j* gclicmdf2j_lary[32]; // level array - i32 gclicmdf2j_n; // number of elements in array - gcli::FGclicmd* gclicmd_lary[32]; // level array - i32 gclicmd_n; // number of elements in array - gcli::FGtypeh* gtypeh_lary[32]; // level array - i32 gtypeh_n; // number of elements in array - gcli::FGtype* p_gtype; // optional pointer - gcli::FGtbl* p_gtbl; // optional pointer - gclidb::Grepo grepo_sel; // - gcli::FGclicmd** ind_gclicmd_buckets_elems; // pointer to bucket array - i32 ind_gclicmd_buckets_n; // number of elements in bucket array - i32 ind_gclicmd_n; // number of elements in the hash table - gcli::FGclicmdf** ind_gclicmdf_buckets_elems; // pointer to bucket array - i32 ind_gclicmdf_buckets_n; // number of elements in bucket array - i32 ind_gclicmdf_n; // number of elements in the hash table - gcli::FGclicmdt** ind_gclicmdt_buckets_elems; // pointer to bucket array - i32 ind_gclicmdt_buckets_n; // number of elements in bucket array - i32 ind_gclicmdt_n; // number of elements in the hash table - gcli::FGmethod** ind_gmethod_buckets_elems; // pointer to bucket array - i32 ind_gmethod_buckets_n; // number of elements in bucket array - i32 ind_gmethod_n; // number of elements in the hash table - gcli::FGrepo** ind_grepo_buckets_elems; // pointer to bucket array - i32 ind_grepo_buckets_n; // number of elements in bucket array - i32 ind_grepo_n; // number of elements in the hash table - gcli::FIssue** ind_issue_buckets_elems; // pointer to bucket array - i32 ind_issue_buckets_n; // number of elements in bucket array - i32 ind_issue_n; // number of elements in the hash table - algo_lib::Regx regx_repo; // "%" Sql Regx - gcli::FGstatet** ind_gstatet_buckets_elems; // pointer to bucket array - i32 ind_gstatet_buckets_n; // number of elements in bucket array - i32 ind_gstatet_n; // number of elements in the hash table - gcli::FGithost** ind_githost_buckets_elems; // pointer to bucket array - i32 ind_githost_buckets_n; // number of elements in bucket array - i32 ind_githost_n; // number of elements in the hash table - gcli::FGrepogitport** ind_grepogitport_buckets_elems; // pointer to bucket array - i32 ind_grepogitport_buckets_n; // number of elements in bucket array - i32 ind_grepogitport_n; // number of elements in the hash table - gcli::FGrepossh** ind_grepossh_buckets_elems; // pointer to bucket array - i32 ind_grepossh_buckets_n; // number of elements in bucket array - i32 ind_grepossh_n; // number of elements in the hash table - gcli::FGtype** ind_gtype_buckets_elems; // pointer to bucket array - i32 ind_gtype_buckets_n; // number of elements in bucket array - i32 ind_gtype_n; // number of elements in the hash table - algo::cstring home; // User's HOME directory - algo::cstring auth_file; // - algo::cstring edit_file; // - gcli::FGclicmd** c_gclicmd_elems; // array of pointers - u32 c_gclicmd_n; // array of pointers - u32 c_gclicmd_max; // capacity of allocated array - algo::cstring unix_user; // UNIX user login name - algo::cstring editor; // Command line to invoke editor - gcli::FGclicmdj2f* gclicmdj2f_lary[32]; // level array - i32 gclicmdj2f_n; // number of elements in array - gcli::FGclicmdc* gclicmdc_lary[32]; // level array - i32 gclicmdc_n; // number of elements in array - gcli::FGclicmdarg* gclicmdarg_lary[32]; // level array - i32 gclicmdarg_n; // number of elements in array - gcli::FGclicmdj2f** ind_gclicmdj2f_buckets_elems; // pointer to bucket array - i32 ind_gclicmdj2f_buckets_n; // number of elements in bucket array - i32 ind_gclicmdj2f_n; // number of elements in the hash table - gcli::FGclicmdarg** ind_gclicmdarg_buckets_elems; // pointer to bucket array - i32 ind_gclicmdarg_buckets_n; // number of elements in bucket array - i32 ind_gclicmdarg_n; // number of elements in the hash table - gcli::FGclicmdc** ind_gclicmdc_buckets_elems; // pointer to bucket array - i32 ind_gclicmdc_buckets_n; // number of elements in bucket array - i32 ind_gclicmdc_n; // number of elements in the hash table - gcli::FIssue* issue_lary[32]; // level array - i32 issue_n; // number of elements in array - gcli::FGrepo* grepo_lary[32]; // level array - i32 grepo_n; // number of elements in array - gcli::FTuples* tuples_lary[32]; // level array - i32 tuples_n; // number of elements in array - gcli::FIssuenote* issuenote_lary[32]; // level array - i32 issuenote_n; // number of elements in array - gcli::FMrjob* mrjob_lary[32]; // level array - i32 mrjob_n; // number of elements in array - gcli::FMrnote* mrnote_lary[32]; // level array - i32 mrnote_n; // number of elements in array - gcli::FMrnote** ind_mrnote_buckets_elems; // pointer to bucket array - i32 ind_mrnote_buckets_n; // number of elements in bucket array - i32 ind_mrnote_n; // number of elements in the hash table - gcli::FIssuenote** ind_issuenote_buckets_elems; // pointer to bucket array - i32 ind_issuenote_buckets_n; // number of elements in bucket array - i32 ind_issuenote_n; // number of elements in the hash table - gcli::FMrjob** ind_mrjob_buckets_elems; // pointer to bucket array - i32 ind_mrjob_buckets_n; // number of elements in bucket array - i32 ind_mrjob_n; // number of elements in the hash table - gcli::FUser* user_lary[32]; // level array - i32 user_n; // number of elements in array - gcli::FUser** ind_user_buckets_elems; // pointer to bucket array - i32 ind_user_buckets_n; // number of elements in bucket array - i32 ind_user_n; // number of elements in the hash table - gcli::FMr** ind_mr_buckets_elems; // pointer to bucket array - i32 ind_mr_buckets_n; // number of elements in bucket array - i32 ind_mr_n; // number of elements in the hash table - gcli::FMilestone** ind_milestone_buckets_elems; // pointer to bucket array - i32 ind_milestone_buckets_n; // number of elements in bucket array - i32 ind_milestone_n; // number of elements in the hash table - gcli::FMilestone* milestone_lary[32]; // level array - i32 milestone_n; // number of elements in array - gcli::FMr* mr_lary[32]; // level array - i32 mr_n; // number of elements in array - gcli::FGtypeprefix* gtypeprefix_lary[32]; // level array - i32 gtypeprefix_n; // number of elements in array - gcli::FGtblact* gtblact_lary[32]; // level array - i32 gtblact_n; // number of elements in array - gcli::FGtblactfld* gtblactfld_lary[32]; // level array - i32 gtblactfld_n; // number of elements in array - gcli::FGtblact** ind_gtblact_buckets_elems; // pointer to bucket array - i32 ind_gtblact_buckets_n; // number of elements in bucket array - i32 ind_gtblact_n; // number of elements in the hash table - gcli::FGtblact* zd_gtblact_head; // zero-terminated doubly linked list - i32 zd_gtblact_n; // zero-terminated doubly linked list - gcli::FGtblact* zd_gtblact_tail; // pointer to last element - gcli::FGtblactfld** ind_gtblactfld_buckets_elems; // pointer to bucket array - i32 ind_gtblactfld_buckets_n; // number of elements in bucket array - i32 ind_gtblactfld_n; // number of elements in the hash table - gcli::FGfld* gfld_lary[32]; // level array - i32 gfld_n; // number of elements in array - gcli::FGfld** ind_gfld_buckets_elems; // pointer to bucket array - i32 ind_gfld_buckets_n; // number of elements in bucket array - i32 ind_gfld_n; // number of elements in the hash table - gcli::FGfld** c_gfld_elems; // array of pointers - u32 c_gfld_n; // array of pointers - u32 c_gfld_max; // capacity of allocated array - gcli::FGtbl* gtbl_lary[32]; // level array - i32 gtbl_n; // number of elements in array - gcli::FGtbl** ind_gtbl_buckets_elems; // pointer to bucket array - i32 ind_gtbl_buckets_n; // number of elements in bucket array - i32 ind_gtbl_n; // number of elements in the hash table - gcli::FGact* gact_lary[32]; // level array - i32 gact_n; // number of elements in array - gcli::FGact** ind_gact_buckets_elems; // pointer to bucket array - i32 ind_gact_buckets_n; // number of elements in bucket array - i32 ind_gact_n; // number of elements in the hash table - gcli::trace trace; // + command::gcli cmdline; // + gcli::FGtype* gtype_lary[32]; // level array + i32 gtype_n; // number of elements in array + gcli::FGithost* githost_lary[32]; // level array + i32 githost_n; // number of elements in array + bool need_auth; // false + gcli::FGstatet* gstatet_lary[32]; // level array + i32 gstatet_n; // number of elements in array + gcli::FGmethod* gmethod_lary[32]; // level array + i32 gmethod_n; // number of elements in array + gcli::FGclicmdt* gclicmdt_lary[32]; // level array + i32 gclicmdt_n; // number of elements in array + gcli::FGclicmdf* gclicmdf_lary[32]; // level array + i32 gclicmdf_n; // number of elements in array + gcli::FGclicmdf2j* gclicmdf2j_lary[32]; // level array + i32 gclicmdf2j_n; // number of elements in array + gcli::FGclicmd* gclicmd_lary[32]; // level array + i32 gclicmd_n; // number of elements in array + gcli::FGtypeh* gtypeh_lary[32]; // level array + i32 gtypeh_n; // number of elements in array + gcli::FGtype* p_gtype; // optional pointer + gcli::FGtbl* p_gtbl; // optional pointer + gclidb::Grepo grepo_sel; // + gcli::FGclicmd** ind_gclicmd_buckets_elems; // pointer to bucket array + i32 ind_gclicmd_buckets_n; // number of elements in bucket array + i32 ind_gclicmd_n; // number of elements in the hash table + gcli::FGclicmdf** ind_gclicmdf_buckets_elems; // pointer to bucket array + i32 ind_gclicmdf_buckets_n; // number of elements in bucket array + i32 ind_gclicmdf_n; // number of elements in the hash table + gcli::FGclicmdt** ind_gclicmdt_buckets_elems; // pointer to bucket array + i32 ind_gclicmdt_buckets_n; // number of elements in bucket array + i32 ind_gclicmdt_n; // number of elements in the hash table + gcli::FGmethod** ind_gmethod_buckets_elems; // pointer to bucket array + i32 ind_gmethod_buckets_n; // number of elements in bucket array + i32 ind_gmethod_n; // number of elements in the hash table + gcli::FGrepo** ind_grepo_buckets_elems; // pointer to bucket array + i32 ind_grepo_buckets_n; // number of elements in bucket array + i32 ind_grepo_n; // number of elements in the hash table + gcli::FIssue** ind_issue_buckets_elems; // pointer to bucket array + i32 ind_issue_buckets_n; // number of elements in bucket array + i32 ind_issue_n; // number of elements in the hash table + algo_lib::Regx regx_repo; // "%" Sql Regx + gcli::FGstatet** ind_gstatet_buckets_elems; // pointer to bucket array + i32 ind_gstatet_buckets_n; // number of elements in bucket array + i32 ind_gstatet_n; // number of elements in the hash table + gcli::FGithost** ind_githost_buckets_elems; // pointer to bucket array + i32 ind_githost_buckets_n; // number of elements in bucket array + i32 ind_githost_n; // number of elements in the hash table + gcli::FGtype** ind_gtype_buckets_elems; // pointer to bucket array + i32 ind_gtype_buckets_n; // number of elements in bucket array + i32 ind_gtype_n; // number of elements in the hash table + algo::cstring home; // User's HOME directory + algo::cstring auth_file; // + algo::cstring edit_file; // + gcli::FGclicmd** c_gclicmd_elems; // array of pointers + u32 c_gclicmd_n; // array of pointers + u32 c_gclicmd_max; // capacity of allocated array + algo::cstring unix_user; // UNIX user login name + algo::cstring editor; // Command line to invoke editor + gcli::FGclicmdj2f* gclicmdj2f_lary[32]; // level array + i32 gclicmdj2f_n; // number of elements in array + gcli::FGclicmdc* gclicmdc_lary[32]; // level array + i32 gclicmdc_n; // number of elements in array + gcli::FGclicmdarg* gclicmdarg_lary[32]; // level array + i32 gclicmdarg_n; // number of elements in array + gcli::FGclicmdj2f** ind_gclicmdj2f_buckets_elems; // pointer to bucket array + i32 ind_gclicmdj2f_buckets_n; // number of elements in bucket array + i32 ind_gclicmdj2f_n; // number of elements in the hash table + gcli::FGclicmdarg** ind_gclicmdarg_buckets_elems; // pointer to bucket array + i32 ind_gclicmdarg_buckets_n; // number of elements in bucket array + i32 ind_gclicmdarg_n; // number of elements in the hash table + gcli::FGclicmdc** ind_gclicmdc_buckets_elems; // pointer to bucket array + i32 ind_gclicmdc_buckets_n; // number of elements in bucket array + i32 ind_gclicmdc_n; // number of elements in the hash table + gcli::FIssue* issue_lary[32]; // level array + i32 issue_n; // number of elements in array + gcli::FGrepo* grepo_lary[32]; // level array + i32 grepo_n; // number of elements in array + gcli::FTuples* tuples_lary[32]; // level array + i32 tuples_n; // number of elements in array + gcli::FIssuenote* issuenote_lary[32]; // level array + i32 issuenote_n; // number of elements in array + gcli::FMrjob* mrjob_lary[32]; // level array + i32 mrjob_n; // number of elements in array + gcli::FMrnote* mrnote_lary[32]; // level array + i32 mrnote_n; // number of elements in array + gcli::FMrnote** ind_mrnote_buckets_elems; // pointer to bucket array + i32 ind_mrnote_buckets_n; // number of elements in bucket array + i32 ind_mrnote_n; // number of elements in the hash table + gcli::FIssuenote** ind_issuenote_buckets_elems; // pointer to bucket array + i32 ind_issuenote_buckets_n; // number of elements in bucket array + i32 ind_issuenote_n; // number of elements in the hash table + gcli::FMrjob** ind_mrjob_buckets_elems; // pointer to bucket array + i32 ind_mrjob_buckets_n; // number of elements in bucket array + i32 ind_mrjob_n; // number of elements in the hash table + gcli::FUser* user_lary[32]; // level array + i32 user_n; // number of elements in array + gcli::FUser** ind_user_buckets_elems; // pointer to bucket array + i32 ind_user_buckets_n; // number of elements in bucket array + i32 ind_user_n; // number of elements in the hash table + gcli::FMr** ind_mr_buckets_elems; // pointer to bucket array + i32 ind_mr_buckets_n; // number of elements in bucket array + i32 ind_mr_n; // number of elements in the hash table + gcli::FMilestone** ind_milestone_buckets_elems; // pointer to bucket array + i32 ind_milestone_buckets_n; // number of elements in bucket array + i32 ind_milestone_n; // number of elements in the hash table + gcli::FMilestone* milestone_lary[32]; // level array + i32 milestone_n; // number of elements in array + gcli::FMr* mr_lary[32]; // level array + i32 mr_n; // number of elements in array + gcli::FGtypeprefix* gtypeprefix_lary[32]; // level array + i32 gtypeprefix_n; // number of elements in array + gcli::FGtblact* gtblact_lary[32]; // level array + i32 gtblact_n; // number of elements in array + gcli::FGtblactfld* gtblactfld_lary[32]; // level array + i32 gtblactfld_n; // number of elements in array + gcli::FGtblact** ind_gtblact_buckets_elems; // pointer to bucket array + i32 ind_gtblact_buckets_n; // number of elements in bucket array + i32 ind_gtblact_n; // number of elements in the hash table + gcli::FGtblact* zd_gtblact_head; // zero-terminated doubly linked list + i32 zd_gtblact_n; // zero-terminated doubly linked list + gcli::FGtblact* zd_gtblact_tail; // pointer to last element + gcli::FGtblactfld** ind_gtblactfld_buckets_elems; // pointer to bucket array + i32 ind_gtblactfld_buckets_n; // number of elements in bucket array + i32 ind_gtblactfld_n; // number of elements in the hash table + gcli::FGfld* gfld_lary[32]; // level array + i32 gfld_n; // number of elements in array + gcli::FGfld** ind_gfld_buckets_elems; // pointer to bucket array + i32 ind_gfld_buckets_n; // number of elements in bucket array + i32 ind_gfld_n; // number of elements in the hash table + gcli::FGfld** c_gfld_elems; // array of pointers + u32 c_gfld_n; // array of pointers + u32 c_gfld_max; // capacity of allocated array + gcli::FGtbl* gtbl_lary[32]; // level array + i32 gtbl_n; // number of elements in array + gcli::FGtbl** ind_gtbl_buckets_elems; // pointer to bucket array + i32 ind_gtbl_buckets_n; // number of elements in bucket array + i32 ind_gtbl_n; // number of elements in the hash table + gcli::FGact* gact_lary[32]; // level array + i32 gact_n; // number of elements in array + gcli::FGact** ind_gact_buckets_elems; // pointer to bucket array + i32 ind_gact_buckets_n; // number of elements in bucket array + i32 ind_gact_n; // number of elements in the hash table + gcli::trace trace; // }; // Read argc,argv directly into the fields of the command line(s) @@ -462,86 +442,6 @@ inline gcli::FGtype& gtype_qFind(u64 t) __attribute__((nothrow, pure)); // func:gcli.FDb.gtype.XrefMaybe bool gtype_XrefMaybe(gcli::FGtype &row); -// Allocate memory for new default row. -// If out of memory, process is killed. -// func:gcli.FDb.grepossh.Alloc -gcli::FGrepossh& grepossh_Alloc() __attribute__((__warn_unused_result__, nothrow)); -// Allocate memory for new element. If out of memory, return NULL. -// func:gcli.FDb.grepossh.AllocMaybe -gcli::FGrepossh* grepossh_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); -// Create new row from struct. -// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -// func:gcli.FDb.grepossh.InsertMaybe -gcli::FGrepossh* grepossh_InsertMaybe(const gclidb::Grepossh &value) __attribute__((nothrow)); -// Allocate space for one element. If no memory available, return NULL. -// func:gcli.FDb.grepossh.AllocMem -void* grepossh_AllocMem() __attribute__((__warn_unused_result__, nothrow)); -// Return true if index is empty -// func:gcli.FDb.grepossh.EmptyQ -inline bool grepossh_EmptyQ() __attribute__((nothrow, pure)); -// Look up row by row id. Return NULL if out of range -// func:gcli.FDb.grepossh.Find -inline gcli::FGrepossh* grepossh_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return pointer to last element of array, or NULL if array is empty -// func:gcli.FDb.grepossh.Last -inline gcli::FGrepossh* grepossh_Last() __attribute__((nothrow, pure)); -// Return number of items in the pool -// func:gcli.FDb.grepossh.N -inline i32 grepossh_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Remove all elements from Lary -// func:gcli.FDb.grepossh.RemoveAll -void grepossh_RemoveAll() __attribute__((nothrow)); -// Delete last element of array. Do nothing if array is empty. -// func:gcli.FDb.grepossh.RemoveLast -void grepossh_RemoveLast() __attribute__((nothrow)); -// 'quick' Access row by row id. No bounds checking. -// func:gcli.FDb.grepossh.qFind -inline gcli::FGrepossh& grepossh_qFind(u64 t) __attribute__((nothrow, pure)); -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:gcli.FDb.grepossh.XrefMaybe -bool grepossh_XrefMaybe(gcli::FGrepossh &row); - -// Allocate memory for new default row. -// If out of memory, process is killed. -// func:gcli.FDb.grepogitport.Alloc -gcli::FGrepogitport& grepogitport_Alloc() __attribute__((__warn_unused_result__, nothrow)); -// Allocate memory for new element. If out of memory, return NULL. -// func:gcli.FDb.grepogitport.AllocMaybe -gcli::FGrepogitport* grepogitport_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); -// Create new row from struct. -// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -// func:gcli.FDb.grepogitport.InsertMaybe -gcli::FGrepogitport* grepogitport_InsertMaybe(const gclidb::Grepogitport &value) __attribute__((nothrow)); -// Allocate space for one element. If no memory available, return NULL. -// func:gcli.FDb.grepogitport.AllocMem -void* grepogitport_AllocMem() __attribute__((__warn_unused_result__, nothrow)); -// Return true if index is empty -// func:gcli.FDb.grepogitport.EmptyQ -inline bool grepogitport_EmptyQ() __attribute__((nothrow, pure)); -// Look up row by row id. Return NULL if out of range -// func:gcli.FDb.grepogitport.Find -inline gcli::FGrepogitport* grepogitport_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return pointer to last element of array, or NULL if array is empty -// func:gcli.FDb.grepogitport.Last -inline gcli::FGrepogitport* grepogitport_Last() __attribute__((nothrow, pure)); -// Return number of items in the pool -// func:gcli.FDb.grepogitport.N -inline i32 grepogitport_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Remove all elements from Lary -// func:gcli.FDb.grepogitport.RemoveAll -void grepogitport_RemoveAll() __attribute__((nothrow)); -// Delete last element of array. Do nothing if array is empty. -// func:gcli.FDb.grepogitport.RemoveLast -void grepogitport_RemoveLast() __attribute__((nothrow)); -// 'quick' Access row by row id. No bounds checking. -// func:gcli.FDb.grepogitport.qFind -inline gcli::FGrepogitport& grepogitport_qFind(u64 t) __attribute__((nothrow, pure)); -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:gcli.FDb.grepogitport.XrefMaybe -bool grepogitport_XrefMaybe(gcli::FGrepogitport &row); - // Allocate memory for new default row. // If out of memory, process is killed. // func:gcli.FDb.githost.Alloc @@ -878,6 +778,9 @@ void ind_gclicmd_Remove(gcli::FGclicmd& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gclicmd.Reserve void ind_gclicmd_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gclicmd.AbsReserve +void ind_gclicmd_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_gclicmdf.EmptyQ @@ -903,6 +806,9 @@ void ind_gclicmdf_Remove(gcli::FGclicmdf& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gclicmdf.Reserve void ind_gclicmdf_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gclicmdf.AbsReserve +void ind_gclicmdf_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_gclicmdt.EmptyQ @@ -925,6 +831,9 @@ void ind_gclicmdt_Remove(gcli::FGclicmdt& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gclicmdt.Reserve void ind_gclicmdt_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gclicmdt.AbsReserve +void ind_gclicmdt_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_gmethod.EmptyQ @@ -950,6 +859,9 @@ void ind_gmethod_Remove(gcli::FGmethod& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gmethod.Reserve void ind_gmethod_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gmethod.AbsReserve +void ind_gmethod_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_grepo.EmptyQ @@ -975,6 +887,9 @@ void ind_grepo_Remove(gcli::FGrepo& row) __attribute__((nothrow) // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_grepo.Reserve void ind_grepo_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_grepo.AbsReserve +void ind_grepo_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_issue.EmptyQ @@ -1000,6 +915,9 @@ void ind_issue_Remove(gcli::FIssue& row) __attribute__((nothrow) // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_issue.Reserve void ind_issue_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_issue.AbsReserve +void ind_issue_AbsReserve(int n) __attribute__((nothrow)); // Print back to string // func:gcli.FDb.regx_repo.Print @@ -1029,6 +947,9 @@ void ind_gstatet_Remove(gcli::FGstatet& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gstatet.Reserve void ind_gstatet_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gstatet.AbsReserve +void ind_gstatet_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_githost.EmptyQ @@ -1054,56 +975,9 @@ void ind_githost_Remove(gcli::FGithost& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_githost.Reserve void ind_githost_Reserve(int n) __attribute__((nothrow)); - -// Return true if hash is empty -// func:gcli.FDb.ind_grepogitport.EmptyQ -inline bool ind_grepogitport_EmptyQ() __attribute__((nothrow)); -// Find row by key. Return NULL if not found. -// func:gcli.FDb.ind_grepogitport.Find -gcli::FGrepogitport* ind_grepogitport_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); -// Look up row by key and return reference. Throw exception if not found -// func:gcli.FDb.ind_grepogitport.FindX -gcli::FGrepogitport& ind_grepogitport_FindX(const algo::strptr& key); -// Find row by key. If not found, create and x-reference a new row with with this key. -// func:gcli.FDb.ind_grepogitport.GetOrCreate -gcli::FGrepogitport& ind_grepogitport_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); -// Return number of items in the hash -// func:gcli.FDb.ind_grepogitport.N -inline i32 ind_grepogitport_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Insert row into hash table. Return true if row is reachable through the hash after the function completes. -// func:gcli.FDb.ind_grepogitport.InsertMaybe -bool ind_grepogitport_InsertMaybe(gcli::FGrepogitport& row) __attribute__((nothrow)); -// Remove reference to element from hash index. If element is not in hash, do nothing -// func:gcli.FDb.ind_grepogitport.Remove -void ind_grepogitport_Remove(gcli::FGrepogitport& row) __attribute__((nothrow)); -// Reserve enough room in the hash for N more elements. Return success code. -// func:gcli.FDb.ind_grepogitport.Reserve -void ind_grepogitport_Reserve(int n) __attribute__((nothrow)); - -// Return true if hash is empty -// func:gcli.FDb.ind_grepossh.EmptyQ -inline bool ind_grepossh_EmptyQ() __attribute__((nothrow)); -// Find row by key. Return NULL if not found. -// func:gcli.FDb.ind_grepossh.Find -gcli::FGrepossh* ind_grepossh_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); -// Look up row by key and return reference. Throw exception if not found -// func:gcli.FDb.ind_grepossh.FindX -gcli::FGrepossh& ind_grepossh_FindX(const algo::strptr& key); -// Find row by key. If not found, create and x-reference a new row with with this key. -// func:gcli.FDb.ind_grepossh.GetOrCreate -gcli::FGrepossh& ind_grepossh_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); -// Return number of items in the hash -// func:gcli.FDb.ind_grepossh.N -inline i32 ind_grepossh_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Insert row into hash table. Return true if row is reachable through the hash after the function completes. -// func:gcli.FDb.ind_grepossh.InsertMaybe -bool ind_grepossh_InsertMaybe(gcli::FGrepossh& row) __attribute__((nothrow)); -// Remove reference to element from hash index. If element is not in hash, do nothing -// func:gcli.FDb.ind_grepossh.Remove -void ind_grepossh_Remove(gcli::FGrepossh& row) __attribute__((nothrow)); -// Reserve enough room in the hash for N more elements. Return success code. -// func:gcli.FDb.ind_grepossh.Reserve -void ind_grepossh_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_githost.AbsReserve +void ind_githost_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_gtype.EmptyQ @@ -1129,6 +1003,9 @@ void ind_gtype_Remove(gcli::FGtype& row) __attribute__((nothrow) // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gtype.Reserve void ind_gtype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gtype.AbsReserve +void ind_gtype_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:gcli.FDb.c_gclicmd.EmptyQ @@ -1302,6 +1179,9 @@ void ind_gclicmdj2f_Remove(gcli::FGclicmdj2f& row) __attribute__ // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gclicmdj2f.Reserve void ind_gclicmdj2f_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gclicmdj2f.AbsReserve +void ind_gclicmdj2f_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_gclicmdarg.EmptyQ @@ -1327,6 +1207,9 @@ void ind_gclicmdarg_Remove(gcli::FGclicmdarg& row) __attribute__ // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gclicmdarg.Reserve void ind_gclicmdarg_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gclicmdarg.AbsReserve +void ind_gclicmdarg_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_gclicmdc.EmptyQ @@ -1352,6 +1235,9 @@ void ind_gclicmdc_Remove(gcli::FGclicmdc& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gclicmdc.Reserve void ind_gclicmdc_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gclicmdc.AbsReserve +void ind_gclicmdc_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1610,6 +1496,9 @@ void ind_mrnote_Remove(gcli::FMrnote& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_mrnote.Reserve void ind_mrnote_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_mrnote.AbsReserve +void ind_mrnote_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_issuenote.EmptyQ @@ -1632,6 +1521,9 @@ void ind_issuenote_Remove(gcli::FIssuenote& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_issuenote.Reserve void ind_issuenote_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_issuenote.AbsReserve +void ind_issuenote_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_mrjob.EmptyQ @@ -1654,6 +1546,9 @@ void ind_mrjob_Remove(gcli::FMrjob& row) __attribute__((nothrow) // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_mrjob.Reserve void ind_mrjob_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_mrjob.AbsReserve +void ind_mrjob_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1719,6 +1614,9 @@ void ind_user_Remove(gcli::FUser& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_user.Reserve void ind_user_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_user.AbsReserve +void ind_user_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_mr.EmptyQ @@ -1744,6 +1642,9 @@ void ind_mr_Remove(gcli::FMr& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_mr.Reserve void ind_mr_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_mr.AbsReserve +void ind_mr_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:gcli.FDb.ind_milestone.EmptyQ @@ -1769,6 +1670,9 @@ void ind_milestone_Remove(gcli::FMilestone& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_milestone.Reserve void ind_milestone_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_milestone.AbsReserve +void ind_milestone_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1994,6 +1898,9 @@ void ind_gtblact_Remove(gcli::FGtblact& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gtblact.Reserve void ind_gtblact_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gtblact.AbsReserve +void ind_gtblact_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:gcli.FDb.zd_gtblact.EmptyQ @@ -2053,6 +1960,9 @@ void ind_gtblactfld_Remove(gcli::FGtblactfld& row) __attribute__ // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gtblactfld.Reserve void ind_gtblactfld_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gtblactfld.AbsReserve +void ind_gtblactfld_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -2118,6 +2028,9 @@ void ind_gfld_Remove(gcli::FGfld& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gfld.Reserve void ind_gfld_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gfld.AbsReserve +void ind_gfld_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:gcli.FDb.c_gfld.EmptyQ @@ -2223,6 +2136,9 @@ void ind_gtbl_Remove(gcli::FGtbl& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gtbl.Reserve void ind_gtbl_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gtbl.AbsReserve +void ind_gtbl_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -2288,6 +2204,9 @@ void ind_gact_Remove(gcli::FGact& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:gcli.FDb.ind_gact.Reserve void ind_gact_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:gcli.FDb.ind_gact.AbsReserve +void ind_gact_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:gcli.FDb.gtype_curs.Reset @@ -2302,30 +2221,6 @@ inline void _db_gtype_curs_Next(_db_gtype_curs &curs) __attribute__((no // func:gcli.FDb.gtype_curs.Access inline gcli::FGtype& _db_gtype_curs_Access(_db_gtype_curs &curs) __attribute__((nothrow)); // cursor points to valid item -// func:gcli.FDb.grepossh_curs.Reset -inline void _db_grepossh_curs_Reset(_db_grepossh_curs &curs, gcli::FDb &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:gcli.FDb.grepossh_curs.ValidQ -inline bool _db_grepossh_curs_ValidQ(_db_grepossh_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:gcli.FDb.grepossh_curs.Next -inline void _db_grepossh_curs_Next(_db_grepossh_curs &curs) __attribute__((nothrow)); -// item access -// func:gcli.FDb.grepossh_curs.Access -inline gcli::FGrepossh& _db_grepossh_curs_Access(_db_grepossh_curs &curs) __attribute__((nothrow)); -// cursor points to valid item -// func:gcli.FDb.grepogitport_curs.Reset -inline void _db_grepogitport_curs_Reset(_db_grepogitport_curs &curs, gcli::FDb &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:gcli.FDb.grepogitport_curs.ValidQ -inline bool _db_grepogitport_curs_ValidQ(_db_grepogitport_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:gcli.FDb.grepogitport_curs.Next -inline void _db_grepogitport_curs_Next(_db_grepogitport_curs &curs) __attribute__((nothrow)); -// item access -// func:gcli.FDb.grepogitport_curs.Access -inline gcli::FGrepogitport& _db_grepogitport_curs_Access(_db_grepogitport_curs &curs) __attribute__((nothrow)); -// cursor points to valid item // func:gcli.FDb.githost_curs.Reset inline void _db_githost_curs_Reset(_db_githost_curs &curs, gcli::FDb &parent) __attribute__((nothrow)); // cursor points to valid item @@ -2682,9 +2577,10 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: gact (Lary, by rowid) // global access: ind_gact (Thash, hash field gact) struct FGact { // gcli.FGact - gcli::FGact* ind_gact_next; // hash next - algo::Smallstr50 gact; // - algo::Comment comment; // + gcli::FGact* ind_gact_next; // hash next + u32 ind_gact_hashval; // hash value + algo::Smallstr50 gact; // + algo::Comment comment; // // func:gcli.FGact..AssignOp inline gcli::FGact& operator =(const gcli::FGact &rhs) = delete; // func:gcli.FGact..CopyCtor @@ -2723,41 +2619,42 @@ void FGact_Uninit(gcli::FGact& gact) __attribute__((nothrow)); // access: gcli.FGclicmdf2j.p_gclicmd (Upptr) // access: gcli.FGclicmdt.p_gclicmd (Upptr) struct FGclicmd { // gcli.FGclicmd - gcli::FGclicmd* ind_gclicmd_next; // hash next - algo::Smallstr250 gclicmd; // - algo::Smallstr250 gclicmdf2j; // Base for gclicmdf2j - algo::Comment comment; // - algo::cstring url; // - algo::cstring sep; // - algo::cstring host; // - algo::cstring proj; // - algo::cstring token; // - algo::cstring body; // - algo::cstring note_id; // - algo::cstring issue_id; // - algo::cstring cond; // - bool select; // false - bool write_auth; // false - bool finish; // false - algo::cstring gclicmdt_key; // - u32 method; // 0 - gcli::FIssue* p_issue; // optional pointer - gcli::FMr* p_mr; // optional pointer - gcli::FTuples** c_tuples_elems; // array of pointers - u32 c_tuples_n; // array of pointers - u32 c_tuples_max; // capacity of allocated array - gcli::gclicmd_step_hook step; // NULL Pointer to a function - gcli::FGclicmdarg** c_gclicmdarg_elems; // array of pointers - u32 c_gclicmdarg_n; // array of pointers - u32 c_gclicmdarg_max; // capacity of allocated array - gcli::FGclicmdc** c_gclicmdc_elems; // array of pointers - u32 c_gclicmdc_n; // array of pointers - u32 c_gclicmdc_max; // capacity of allocated array - gcli::FGclicmdf2j** c_gclicmdf2j_elems; // array of pointers - u32 c_gclicmdf2j_n; // array of pointers - u32 c_gclicmdf2j_max; // capacity of allocated array - gcli::FGclicmd* p_gclicmd; // reference to parent row - bool _db_c_gclicmd_in_ary; // false membership flag + gcli::FGclicmd* ind_gclicmd_next; // hash next + u32 ind_gclicmd_hashval; // hash value + algo::Smallstr250 gclicmd; // table of static commands + algo::Smallstr250 gclicmdf2j; // Base for gclicmdf2j + algo::Comment comment; // + algo::cstring url; // + algo::cstring sep; // + algo::cstring host; // + algo::cstring proj; // + algo::cstring token; // + algo::cstring body; // + algo::cstring note_id; // + algo::cstring issue_id; // + algo::cstring cond; // + bool select; // false + bool write_auth; // false + bool finish; // false + algo::cstring gclicmdt_key; // + u32 method; // 0 + gcli::FIssue* p_issue; // optional pointer + gcli::FMr* p_mr; // optional pointer + gcli::FTuples** c_tuples_elems; // array of pointers + u32 c_tuples_n; // array of pointers + u32 c_tuples_max; // capacity of allocated array + gcli::gclicmd_step_hook step; // NULL Pointer to a function + gcli::FGclicmdarg** c_gclicmdarg_elems; // array of pointers + u32 c_gclicmdarg_n; // array of pointers + u32 c_gclicmdarg_max; // capacity of allocated array + gcli::FGclicmdc** c_gclicmdc_elems; // array of pointers + u32 c_gclicmdc_n; // array of pointers + u32 c_gclicmdc_max; // capacity of allocated array + gcli::FGclicmdf2j** c_gclicmdf2j_elems; // array of pointers + u32 c_gclicmdf2j_n; // array of pointers + u32 c_gclicmdf2j_max; // capacity of allocated array + gcli::FGclicmd* p_gclicmd; // reference to parent row + bool c_gclicmd_in_ary; // false membership flag // reftype Ptrary of gcli.FGclicmd.c_tuples prohibits copy // reftype Hook of gcli.FGclicmd.step prohibits copy // reftype Ptrary of gcli.FGclicmd.c_gclicmdarg prohibits copy @@ -3009,6 +2906,7 @@ void FGclicmd_Uninit(gcli::FGclicmd& gclicmd) __attribute__((not // access: gcli.FGclicmd.c_gclicmdarg (Ptrary) struct FGclicmdarg { // gcli.FGclicmdarg gcli::FGclicmdarg* ind_gclicmdarg_next; // hash next + u32 ind_gclicmdarg_hashval; // hash value algo::Smallstr250 gclicmdarg; // bool gclicmd_c_gclicmdarg_in_ary; // false membership flag // func:gcli.FGclicmdarg..AssignOp @@ -3047,6 +2945,7 @@ void FGclicmdarg_Uninit(gcli::FGclicmdarg& gclicmdarg) __attribu // access: gcli.FGclicmd.c_gclicmdc (Ptrary) struct FGclicmdc { // gcli.FGclicmdc gcli::FGclicmdc* ind_gclicmdc_next; // hash next + u32 ind_gclicmdc_hashval; // hash value algo::Smallstr250 gclicmdc; // gcli::FGclicmdf** c_gclicmdf_elems; // array of pointers u32 c_gclicmdf_n; // array of pointers @@ -3142,6 +3041,7 @@ void FGclicmdc_Uninit(gcli::FGclicmdc& gclicmdc) __attribute__(( // access: gcli.FGclicmdj2f.c_gclicmdf (Ptrary) struct FGclicmdf { // gcli.FGclicmdf: fields gcli::FGclicmdf* ind_gclicmdf_next; // hash next + u32 ind_gclicmdf_hashval; // hash value algo::Smallstr250 gclicmdf; // algo::cstring uval; // bool gclicmdc_c_gclicmdf_in_ary; // false membership flag @@ -3239,13 +3139,14 @@ void FGclicmdf2j_Uninit(gcli::FGclicmdf2j& gclicmdf2j) __attribu // global access: gclicmdj2f (Lary, by rowid) // global access: ind_gclicmdj2f (Thash, hash field gclicmdj2f) struct FGclicmdj2f { // gcli.FGclicmdj2f - gcli::FGclicmdj2f* ind_gclicmdj2f_next; // hash next - algo::Smallstr250 gclicmdj2f; // - bool select; // false - bool dup; // false - gcli::FGclicmdf** c_gclicmdf_elems; // array of pointers - u32 c_gclicmdf_n; // array of pointers - u32 c_gclicmdf_max; // capacity of allocated array + gcli::FGclicmdj2f* ind_gclicmdj2f_next; // hash next + u32 ind_gclicmdj2f_hashval; // hash value + algo::Smallstr250 gclicmdj2f; // + bool select; // false + bool dup; // false + gcli::FGclicmdf** c_gclicmdf_elems; // array of pointers + u32 c_gclicmdf_n; // array of pointers + u32 c_gclicmdf_max; // capacity of allocated array // reftype Ptrary of gcli.FGclicmdj2f.c_gclicmdf prohibits copy // func:gcli.FGclicmdj2f..AssignOp inline gcli::FGclicmdj2f& operator =(const gcli::FGclicmdj2f &rhs) = delete; @@ -3331,13 +3232,14 @@ void FGclicmdj2f_Uninit(gcli::FGclicmdj2f& gclicmdj2f) __attribu // global access: gclicmdt (Lary, by rowid) // global access: ind_gclicmdt (Thash, hash field gclicmdt) struct FGclicmdt { // gcli.FGclicmdt - gcli::FGclicmdt* ind_gclicmdt_next; // hash next - algo::Smallstr250 gclicmdt; // - algo::Smallstr50 gmethod; // "GET" - algo::Comment uri; // - algo::Comment comment; // - gcli::FGclicmd* p_gclicmd; // reference to parent row - gcli::FGtype* p_gtype; // reference to parent row + gcli::FGclicmdt* ind_gclicmdt_next; // hash next + u32 ind_gclicmdt_hashval; // hash value + algo::Smallstr250 gclicmdt; // + algo::Smallstr50 gmethod; // "GET" + algo::Comment uri; // + algo::Comment comment; // + gcli::FGclicmd* p_gclicmd; // reference to parent row + gcli::FGtype* p_gtype; // reference to parent row // x-reference on gcli.FGclicmdt.p_gclicmd prevents copy // x-reference on gcli.FGclicmdt.p_gtype prevents copy // func:gcli.FGclicmdt..AssignOp @@ -3384,12 +3286,13 @@ void FGclicmdt_Uninit(gcli::FGclicmdt& gclicmdt) __attribute__(( // access: gcli.FGtblactfld.p_gfld (Upptr) struct FGfld { // gcli.FGfld gcli::FGfld* ind_gfld_next; // hash next + u32 ind_gfld_hashval; // hash value algo::Smallstr50 gfld; // algo::Comment comment; // gcli::FGtblactfld** c_gtblactfld_elems; // array of pointers u32 c_gtblactfld_n; // array of pointers u32 c_gtblactfld_max; // capacity of allocated array - bool _db_c_gfld_in_ary; // false membership flag + bool c_gfld_in_ary; // false membership flag // reftype Ptrary of gcli.FGfld.c_gtblactfld prohibits copy // func:gcli.FGfld..AssignOp inline gcli::FGfld& operator =(const gcli::FGfld &rhs) = delete; @@ -3476,15 +3379,16 @@ void FGfld_Uninit(gcli::FGfld& gfld) __attribute__((nothrow)); // global access: githost (Lary, by rowid) // global access: ind_githost (Thash, hash field githost) struct FGithost { // gcli.FGithost - gcli::FGithost* ind_githost_next; // hash next - algo::Smallstr250 githost; // - algo::cstring ip; // - algo::cstring id; // - algo::cstring id_file; // - algo::cstring port; // - algo::cstring user; // - algo::cstring ssh_config; // - algo::cstring ssh_cmd; // + gcli::FGithost* ind_githost_next; // hash next + u32 ind_githost_hashval; // hash value + algo::Smallstr250 githost; // + algo::cstring ip; // + algo::cstring id; // + algo::cstring id_file; // + algo::cstring port; // + algo::cstring user; // + algo::cstring ssh_config; // + algo::cstring ssh_cmd; // // func:gcli.FGithost..AssignOp inline gcli::FGithost& operator =(const gcli::FGithost &rhs) = delete; // func:gcli.FGithost..CopyCtor @@ -3511,10 +3415,11 @@ void FGithost_Uninit(gcli::FGithost& githost) __attribute__((not // global access: gmethod (Lary, by rowid) // global access: ind_gmethod (Thash, hash field gmethod) struct FGmethod { // gcli.FGmethod - gcli::FGmethod* ind_gmethod_next; // hash next - algo::Smallstr50 gmethod; // - u32 val; // 0 - algo::Comment comment; // + gcli::FGmethod* ind_gmethod_next; // hash next + u32 ind_gmethod_hashval; // hash value + algo::Smallstr50 gmethod; // + u32 val; // 0 + algo::Comment comment; // // func:gcli.FGmethod..AssignOp inline gcli::FGmethod& operator =(const gcli::FGmethod &rhs) = delete; // func:gcli.FGmethod..CopyCtor @@ -3548,19 +3453,20 @@ void FGmethod_Uninit(gcli::FGmethod& gmethod) __attribute__((not // global access: ind_grepo (Thash, hash field grepo) // global access: grepo (Lary, by rowid) struct FGrepo { // gcli.FGrepo - gcli::FGrepo* ind_grepo_next; // hash next - algo::Smallstr250 grepo; // gcli host/full name - algo::cstring name; // gcli full name - algo::cstring token; // gitlab project or repo access token - algo::cstring default_branch; // "origin" gcli remote used in the workflow - algo::cstring keyid; // gcli project id or repo - algo::cstring ssh_repo; // - algo::cstring web_url; // - algo::cstring descr; // - bool active; // true set to false to ignore the line but keep it in the file - algo::cstring priv; // - bool select; // false - algo::cstring gitremote_cmd; // + gcli::FGrepo* ind_grepo_next; // hash next + u32 ind_grepo_hashval; // hash value + algo::Smallstr250 grepo; // gcli host/full name + algo::cstring name; // gcli full name + algo::cstring token; // gitlab project or repo access token + algo::cstring default_branch; // "origin" gcli remote used in the workflow + algo::cstring keyid; // gcli project id or repo + algo::cstring ssh_repo; // + algo::cstring web_url; // + algo::cstring descr; // + bool active; // true set to false to ignore the line but keep it in the file + algo::cstring priv; // + bool select; // false + algo::cstring gitremote_cmd; // // func:gcli.FGrepo..AssignOp gcli::FGrepo& operator =(const gcli::FGrepo &rhs) = delete; // func:gcli.FGrepo..CopyCtor @@ -3595,91 +3501,15 @@ void FGrepo_Init(gcli::FGrepo& grepo); // func:gcli.FGrepo..Uninit void FGrepo_Uninit(gcli::FGrepo& grepo) __attribute__((nothrow)); -// --- gcli.FGrepogitport -// create: gcli.FDb.grepogitport (Lary) -// global access: grepogitport (Lary, by rowid) -// global access: ind_grepogitport (Thash, hash field grepogitport) -struct FGrepogitport { // gcli.FGrepogitport - gcli::FGrepogitport* ind_grepogitport_next; // hash next - algo::Smallstr50 grepogitport; // grepo git host - algo::cstring port; // ssh port for config - algo::Comment comment; // - // func:gcli.FGrepogitport..AssignOp - inline gcli::FGrepogitport& operator =(const gcli::FGrepogitport &rhs) = delete; - // func:gcli.FGrepogitport..CopyCtor - inline FGrepogitport(const gcli::FGrepogitport &rhs) = delete; -private: - // func:gcli.FGrepogitport..Ctor - inline FGrepogitport() __attribute__((nothrow)); - // func:gcli.FGrepogitport..Dtor - inline ~FGrepogitport() __attribute__((nothrow)); - friend gcli::FGrepogitport& grepogitport_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend gcli::FGrepogitport* grepogitport_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void grepogitport_RemoveAll() __attribute__((nothrow)); - friend void grepogitport_RemoveLast() __attribute__((nothrow)); -}; - -// Copy fields out of row -// func:gcli.FGrepogitport.base.CopyOut -void grepogitport_CopyOut(gcli::FGrepogitport &row, gclidb::Grepogitport &out) __attribute__((nothrow)); -// Copy fields in to row -// func:gcli.FGrepogitport.base.CopyIn -void grepogitport_CopyIn(gcli::FGrepogitport &row, gclidb::Grepogitport &in) __attribute__((nothrow)); - -// Set all fields to initial values. -// func:gcli.FGrepogitport..Init -inline void FGrepogitport_Init(gcli::FGrepogitport& grepogitport); -// func:gcli.FGrepogitport..Uninit -void FGrepogitport_Uninit(gcli::FGrepogitport& grepogitport) __attribute__((nothrow)); - -// --- gcli.FGrepossh -// create: gcli.FDb.grepossh (Lary) -// global access: grepossh (Lary, by rowid) -// global access: ind_grepossh (Thash, hash field grepossh) -struct FGrepossh { // gcli.FGrepossh - gcli::FGrepossh* ind_grepossh_next; // hash next - algo::Smallstr50 grepossh; // grepo project/repo name - algo::Smallstr200 sshid; // ssh id key name for ssh config - algo::Comment comment; // - // func:gcli.FGrepossh..AssignOp - inline gcli::FGrepossh& operator =(const gcli::FGrepossh &rhs) = delete; - // func:gcli.FGrepossh..CopyCtor - inline FGrepossh(const gcli::FGrepossh &rhs) = delete; -private: - // func:gcli.FGrepossh..Ctor - inline FGrepossh() __attribute__((nothrow)); - // func:gcli.FGrepossh..Dtor - inline ~FGrepossh() __attribute__((nothrow)); - friend gcli::FGrepossh& grepossh_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend gcli::FGrepossh* grepossh_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void grepossh_RemoveAll() __attribute__((nothrow)); - friend void grepossh_RemoveLast() __attribute__((nothrow)); -}; - -// Copy fields out of row -// func:gcli.FGrepossh.base.CopyOut -void grepossh_CopyOut(gcli::FGrepossh &row, gclidb::Grepossh &out) __attribute__((nothrow)); -// Copy fields in to row -// func:gcli.FGrepossh.base.CopyIn -void grepossh_CopyIn(gcli::FGrepossh &row, gclidb::Grepossh &in) __attribute__((nothrow)); - -// func:gcli.FGrepossh.name.Get -algo::cstring name_Get(gcli::FGrepossh& grepossh) __attribute__((__warn_unused_result__, nothrow)); - -// Set all fields to initial values. -// func:gcli.FGrepossh..Init -inline void FGrepossh_Init(gcli::FGrepossh& grepossh); -// func:gcli.FGrepossh..Uninit -void FGrepossh_Uninit(gcli::FGrepossh& grepossh) __attribute__((nothrow)); - // --- gcli.FGstatet // create: gcli.FDb.gstatet (Lary) // global access: gstatet (Lary, by rowid) // global access: ind_gstatet (Thash, hash field gstatet) struct FGstatet { // gcli.FGstatet - gcli::FGstatet* ind_gstatet_next; // hash next - algo::Smallstr50 gstatet; // - algo::cstring state; // + gcli::FGstatet* ind_gstatet_next; // hash next + u32 ind_gstatet_hashval; // hash value + algo::Smallstr50 gstatet; // + algo::cstring state; // // func:gcli.FGstatet..AssignOp inline gcli::FGstatet& operator =(const gcli::FGstatet &rhs) = delete; // func:gcli.FGstatet..CopyCtor @@ -3720,15 +3550,16 @@ void FGstatet_Uninit(gcli::FGstatet& gstatet) __attribute__((not // global access: gtbl (Lary, by rowid) // global access: ind_gtbl (Thash, hash field gtbl) struct FGtbl { // gcli.FGtbl - gcli::FGtbl* ind_gtbl_next; // hash next - algo::Smallstr250 gtbl; // - algo::Comment comment; // - algo::cstring id; // - bool set_as_dflt; // false - bool tail_dot; // false - gcli::FGtblact** c_gtblact_elems; // array of pointers - u32 c_gtblact_n; // array of pointers - u32 c_gtblact_max; // capacity of allocated array + gcli::FGtbl* ind_gtbl_next; // hash next + u32 ind_gtbl_hashval; // hash value + algo::Smallstr250 gtbl; // + algo::Comment comment; // + algo::cstring id; // + bool set_as_dflt; // false + bool tail_dot; // false + gcli::FGtblact** c_gtblact_elems; // array of pointers + u32 c_gtblact_n; // array of pointers + u32 c_gtblact_max; // capacity of allocated array // reftype Ptrary of gcli.FGtbl.c_gtblact prohibits copy // func:gcli.FGtbl..AssignOp inline gcli::FGtbl& operator =(const gcli::FGtbl &rhs) = delete; @@ -3819,6 +3650,7 @@ void FGtbl_Uninit(gcli::FGtbl& gtbl) __attribute__((nothrow)); // access: gcli.FGtblact.step (Hook) struct FGtblact { // gcli.FGtblact gcli::FGtblact* ind_gtblact_next; // hash next + u32 ind_gtblact_hashval; // hash value gcli::FGtblact* zd_gtblact_next; // zslist link; -1 means not-in-list gcli::FGtblact* zd_gtblact_prev; // previous element algo::Smallstr50 gtblact; // @@ -3934,6 +3766,7 @@ void FGtblact_Uninit(gcli::FGtblact& gtblact) __attribute__((not // access: gcli.FGtblact.c_gtblactfld (Ptrary) struct FGtblactfld { // gcli.FGtblactfld gcli::FGtblactfld* ind_gtblactfld_next; // hash next + u32 ind_gtblactfld_hashval; // hash value algo::Smallstr50 gtblactfld; // algo::cstring dflt; // bool field_name_dflt; // false @@ -3993,6 +3826,7 @@ void FGtblactfld_Uninit(gcli::FGtblactfld& gtblactfld) __attribu // access: gcli.FGtypeprefix.p_gtype (Upptr) struct FGtype { // gcli.FGtype gcli::FGtype* ind_gtype_next; // hash next + u32 ind_gtype_hashval; // hash value algo::Smallstr50 gtype; // algo::cstring default_url; // algo::Comment comment; // @@ -4292,6 +4126,11 @@ algo::cstring& response_header_AllocAt(gcli::FHttp& parent, int at) __attr // Reserve space. Insert N elements at the end of the array, return pointer to array // func:gcli.FHttp.response_header.AllocN algo::aryptr response_header_AllocN(gcli::FHttp& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:gcli.FHttp.response_header.AllocNAt +algo::aryptr response_header_AllocNAt(gcli::FHttp& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:gcli.FHttp.response_header.EmptyQ inline bool response_header_EmptyQ(gcli::FHttp& parent) __attribute__((nothrow)); @@ -4348,6 +4187,10 @@ algo::aryptr response_header_AllocNVal(gcli::FHttp& parent, int n // Function returns success value. // func:gcli.FHttp.response_header.ReadStrptrMaybe bool response_header_ReadStrptrMaybe(gcli::FHttp& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:gcli.FHttp.response_header.Insary +void response_header_Insary(gcli::FHttp& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:gcli.FHttp.response_header_curs.Next @@ -4377,6 +4220,7 @@ void FHttp_Print(gcli::FHttp& row, algo::cstring& str) __attribu // access: gcli.FGclicmd.p_issue (Ptr) struct FIssue { // gcli.FIssue gcli::FIssue* ind_issue_next; // hash next + u32 ind_issue_hashval; // hash value algo::Smallstr50 issue; // Identifier. must be in form project.iid algo::Smallstr50 assignee; // User the issue is assigned to algo::cstring labels; // issue labels - comma-separated list @@ -4543,6 +4387,7 @@ void FIssue_Uninit(gcli::FIssue& issue) __attribute__((nothrow)) // access: gcli.FIssue.c_issuenote (Ptrary) struct FIssuenote { // gcli.FIssuenote gcli::FIssuenote* ind_issuenote_next; // hash next + u32 ind_issuenote_hashval; // hash value algo::Smallstr250 issuenote; // Identifier. must be in form issue.id algo::cstring note; // Body of issue note algo::cstring system; // System or user note (glab only) @@ -4588,11 +4433,12 @@ void FIssuenote_Uninit(gcli::FIssuenote& issuenote) __attribute_ // global access: ind_milestone (Thash, hash field milestone) // global access: milestone (Lary, by rowid) struct FMilestone { // gcli.FMilestone - gcli::FMilestone* ind_milestone_next; // hash next - algo::Smallstr200 milestone; // Milestone id - algo::cstring description; // Milestone description - algo::cstring title; // Milestone title - bool select; // false + gcli::FMilestone* ind_milestone_next; // hash next + u32 ind_milestone_hashval; // hash value + algo::Smallstr200 milestone; // Milestone id + algo::cstring description; // Milestone description + algo::cstring title; // Milestone title + bool select; // false // func:gcli.FMilestone..AssignOp inline gcli::FMilestone& operator =(const gcli::FMilestone &rhs) = delete; // func:gcli.FMilestone..CopyCtor @@ -4639,6 +4485,7 @@ void FMilestone_Print(gcli::FMilestone& row, algo::cstring& str) // access: gcli.FIssue.p_mr_open (Ptr) struct FMr { // gcli.FMr gcli::FMr* ind_mr_next; // hash next + u32 ind_mr_hashval; // hash value algo::Smallstr150 mr; // Identifier. must be in form project.iid algo::cstring state; // Mr state algo::cstring title; // Mr title @@ -4810,6 +4657,7 @@ void FMr_Print(gcli::FMr& row, algo::cstring& str) __attribute__ // access: gcli.FMr.c_mrjob (Ptrary) struct FMrjob { // gcli.FMrjob gcli::FMrjob* ind_mrjob_next; // hash next + u32 ind_mrjob_hashval; // hash value algo::Smallstr250 mrjob; // Identifier. must be in form mr.id algo::Smallstr150 ref; // Mr portion of mr job algo::cstring id; // Job ID @@ -4861,6 +4709,7 @@ void FMrjob_Uninit(gcli::FMrjob& mrjob) __attribute__((nothrow)) // access: gcli.FMr.c_mrnote (Ptrary) struct FMrnote { // gcli.FMrnote gcli::FMrnote* ind_mrnote_next; // hash next + u32 ind_mrnote_hashval; // hash value algo::cstring system; // System or user note (glab only) algo::Smallstr250 mrnote; // Identifier. must be in form issue.id algo::cstring note; // Body of mr note @@ -4922,11 +4771,12 @@ struct FTuples { // gcli.FTuples // global access: user (Lary, by rowid) // global access: ind_user (Thash, hash field user) struct FUser { // gcli.FUser - gcli::FUser* ind_user_next; // hash next - algo::Smallstr50 user; // - u32 id; // 0 - algo::cstring name; // - bool select; // false + gcli::FUser* ind_user_next; // hash next + u32 ind_user_hashval; // hash value + algo::Smallstr50 user; // + u32 id; // 0 + algo::cstring name; // + bool select; // false // func:gcli.FUser..AssignOp inline gcli::FUser& operator =(const gcli::FUser &rhs) = delete; // func:gcli.FUser..CopyCtor @@ -5071,22 +4921,6 @@ struct _db_gtype_curs {// cursor }; -struct _db_grepossh_curs {// cursor - typedef gcli::FGrepossh ChildType; - gcli::FDb *parent; - i64 index; - _db_grepossh_curs(){ parent=NULL; index=0; } -}; - - -struct _db_grepogitport_curs {// cursor - typedef gcli::FGrepogitport ChildType; - gcli::FDb *parent; - i64 index; - _db_grepogitport_curs(){ parent=NULL; index=0; } -}; - - struct _db_githost_curs {// cursor typedef gcli::FGithost ChildType; gcli::FDb *parent; diff --git a/include/gen/gcli_gen.inl.h b/include/gen/gcli_gen.inl.h index b18c43a6..51fa25c1 100644 --- a/include/gen/gcli_gen.inl.h +++ b/include/gen/gcli_gen.inl.h @@ -75,90 +75,6 @@ inline gcli::FGtype& gcli::gtype_qFind(u64 t) { return _db.gtype_lary[bsr][index]; } -// --- gcli.FDb.grepossh.EmptyQ -// Return true if index is empty -inline bool gcli::grepossh_EmptyQ() { - return _db.grepossh_n == 0; -} - -// --- gcli.FDb.grepossh.Find -// Look up row by row id. Return NULL if out of range -inline gcli::FGrepossh* gcli::grepossh_Find(u64 t) { - gcli::FGrepossh *retval = NULL; - if (LIKELY(u64(t) < u64(_db.grepossh_n))) { - u64 x = t + 1; - u64 bsr = algo::u64_BitScanReverse(x); - u64 base = u64(1)<_db_c_gclicmd_in_ary = false; + _db.c_gclicmd_elems[i]->c_gclicmd_in_ary = false; } _db.c_gclicmd_n = 0; } @@ -676,7 +568,7 @@ inline gcli::FGclicmd& gcli::c_gclicmd_qFind(u32 idx) { // --- gcli.FDb.c_gclicmd.InAryQ // True if row is in any ptrary instance inline bool gcli::c_gclicmd_InAryQ(gcli::FGclicmd& row) { - return row._db_c_gclicmd_in_ary; + return row.c_gclicmd_in_ary; } // --- gcli.FDb.c_gclicmd.qLast @@ -1592,7 +1484,7 @@ inline i32 gcli::c_gfld_N() { inline void gcli::c_gfld_RemoveAll() { for (u32 i = 0; i < _db.c_gfld_n; i++) { // mark all elements as not-in-array - _db.c_gfld_elems[i]->_db_c_gfld_in_ary = false; + _db.c_gfld_elems[i]->c_gfld_in_ary = false; } _db.c_gfld_n = 0; } @@ -1606,7 +1498,7 @@ inline gcli::FGfld& gcli::c_gfld_qFind(u32 idx) { // --- gcli.FDb.c_gfld.InAryQ // True if row is in any ptrary instance inline bool gcli::c_gfld_InAryQ(gcli::FGfld& row) { - return row._db_c_gfld_in_ary; + return row.c_gfld_in_ary; } // --- gcli.FDb.c_gfld.qLast @@ -1748,56 +1640,6 @@ inline gcli::FGtype& gcli::_db_gtype_curs_Access(_db_gtype_curs &curs) { return gtype_qFind(u64(curs.index)); } -// --- gcli.FDb.grepossh_curs.Reset -// cursor points to valid item -inline void gcli::_db_grepossh_curs_Reset(_db_grepossh_curs &curs, gcli::FDb &parent) { - curs.parent = &parent; - curs.index = 0; -} - -// --- gcli.FDb.grepossh_curs.ValidQ -// cursor points to valid item -inline bool gcli::_db_grepossh_curs_ValidQ(_db_grepossh_curs &curs) { - return curs.index < _db.grepossh_n; -} - -// --- gcli.FDb.grepossh_curs.Next -// proceed to next item -inline void gcli::_db_grepossh_curs_Next(_db_grepossh_curs &curs) { - curs.index++; -} - -// --- gcli.FDb.grepossh_curs.Access -// item access -inline gcli::FGrepossh& gcli::_db_grepossh_curs_Access(_db_grepossh_curs &curs) { - return grepossh_qFind(u64(curs.index)); -} - -// --- gcli.FDb.grepogitport_curs.Reset -// cursor points to valid item -inline void gcli::_db_grepogitport_curs_Reset(_db_grepogitport_curs &curs, gcli::FDb &parent) { - curs.parent = &parent; - curs.index = 0; -} - -// --- gcli.FDb.grepogitport_curs.ValidQ -// cursor points to valid item -inline bool gcli::_db_grepogitport_curs_ValidQ(_db_grepogitport_curs &curs) { - return curs.index < _db.grepogitport_n; -} - -// --- gcli.FDb.grepogitport_curs.Next -// proceed to next item -inline void gcli::_db_grepogitport_curs_Next(_db_grepogitport_curs &curs) { - curs.index++; -} - -// --- gcli.FDb.grepogitport_curs.Access -// item access -inline gcli::FGrepogitport& gcli::_db_grepogitport_curs_Access(_db_grepogitport_curs &curs) { - return grepogitport_qFind(u64(curs.index)); -} - // --- gcli.FDb.githost_curs.Reset // cursor points to valid item inline void gcli::_db_githost_curs_Reset(_db_githost_curs &curs, gcli::FDb &parent) { @@ -2527,6 +2369,7 @@ inline gcli::FGact& gcli::_db_gact_curs_Access(_db_gact_curs &curs) { // Set all fields to initial values. inline void gcli::FGact_Init(gcli::FGact& gact) { gact.ind_gact_next = (gcli::FGact*)-1; // (gcli.FDb.ind_gact) not-in-hash + gact.ind_gact_hashval = 0; // stored hash value } // --- gcli.FGact..Ctor @@ -2884,6 +2727,7 @@ inline gcli::FGclicmd::~FGclicmd() { inline void gcli::FGclicmdarg_Init(gcli::FGclicmdarg& gclicmdarg) { gclicmdarg.gclicmd_c_gclicmdarg_in_ary = bool(false); gclicmdarg.ind_gclicmdarg_next = (gcli::FGclicmdarg*)-1; // (gcli.FDb.ind_gclicmdarg) not-in-hash + gclicmdarg.ind_gclicmdarg_hashval = 0; // stored hash value } // --- gcli.FGclicmdarg..Ctor @@ -2962,6 +2806,7 @@ inline void gcli::FGclicmdc_Init(gcli::FGclicmdc& gclicmdc) { gclicmdc.c_gclicmdf_max = 0; // (gcli.FGclicmdc.c_gclicmdf) gclicmdc.gclicmd_c_gclicmdc_in_ary = bool(false); gclicmdc.ind_gclicmdc_next = (gcli::FGclicmdc*)-1; // (gcli.FDb.ind_gclicmdc) not-in-hash + gclicmdc.ind_gclicmdc_hashval = 0; // stored hash value } // --- gcli.FGclicmdc.c_gclicmdf_curs.Reset @@ -3004,6 +2849,7 @@ inline gcli::FGclicmdc::~FGclicmdc() { inline void gcli::FGclicmdf_Init(gcli::FGclicmdf& gclicmdf) { gclicmdf.gclicmdc_c_gclicmdf_in_ary = bool(false); gclicmdf.ind_gclicmdf_next = (gcli::FGclicmdf*)-1; // (gcli.FDb.ind_gclicmdf) not-in-hash + gclicmdf.ind_gclicmdf_hashval = 0; // stored hash value } // --- gcli.FGclicmdf..Ctor @@ -3091,6 +2937,7 @@ inline void gcli::FGclicmdj2f_Init(gcli::FGclicmdj2f& gclicmdj2f) { gclicmdj2f.c_gclicmdf_n = 0; // (gcli.FGclicmdj2f.c_gclicmdf) gclicmdj2f.c_gclicmdf_max = 0; // (gcli.FGclicmdj2f.c_gclicmdf) gclicmdj2f.ind_gclicmdj2f_next = (gcli::FGclicmdj2f*)-1; // (gcli.FDb.ind_gclicmdj2f) not-in-hash + gclicmdj2f.ind_gclicmdj2f_hashval = 0; // stored hash value } // --- gcli.FGclicmdj2f.c_gclicmdf_curs.Reset @@ -3135,6 +2982,7 @@ inline void gcli::FGclicmdt_Init(gcli::FGclicmdt& gclicmdt) { gclicmdt.p_gclicmd = NULL; gclicmdt.p_gtype = NULL; gclicmdt.ind_gclicmdt_next = (gcli::FGclicmdt*)-1; // (gcli.FDb.ind_gclicmdt) not-in-hash + gclicmdt.ind_gclicmdt_hashval = 0; // stored hash value } // --- gcli.FGclicmdt..Ctor @@ -3211,8 +3059,9 @@ inline void gcli::FGfld_Init(gcli::FGfld& gfld) { gfld.c_gtblactfld_elems = NULL; // (gcli.FGfld.c_gtblactfld) gfld.c_gtblactfld_n = 0; // (gcli.FGfld.c_gtblactfld) gfld.c_gtblactfld_max = 0; // (gcli.FGfld.c_gtblactfld) - gfld._db_c_gfld_in_ary = bool(false); + gfld.c_gfld_in_ary = bool(false); gfld.ind_gfld_next = (gcli::FGfld*)-1; // (gcli.FDb.ind_gfld) not-in-hash + gfld.ind_gfld_hashval = 0; // stored hash value } // --- gcli.FGfld.c_gtblactfld_curs.Reset @@ -3254,6 +3103,7 @@ inline gcli::FGfld::~FGfld() { // Set all fields to initial values. inline void gcli::FGithost_Init(gcli::FGithost& githost) { githost.ind_githost_next = (gcli::FGithost*)-1; // (gcli.FDb.ind_githost) not-in-hash + githost.ind_githost_hashval = 0; // stored hash value } // --- gcli.FGithost..Ctor @@ -3271,6 +3121,7 @@ inline gcli::FGithost::~FGithost() { inline void gcli::FGmethod_Init(gcli::FGmethod& gmethod) { gmethod.val = u32(0); gmethod.ind_gmethod_next = (gcli::FGmethod*)-1; // (gcli.FDb.ind_gmethod) not-in-hash + gmethod.ind_gmethod_hashval = 0; // stored hash value } // --- gcli.FGmethod..Ctor @@ -3293,42 +3144,11 @@ inline gcli::FGrepo::~FGrepo() { gcli::FGrepo_Uninit(*this); } -// --- gcli.FGrepogitport..Init -// Set all fields to initial values. -inline void gcli::FGrepogitport_Init(gcli::FGrepogitport& grepogitport) { - grepogitport.ind_grepogitport_next = (gcli::FGrepogitport*)-1; // (gcli.FDb.ind_grepogitport) not-in-hash -} - -// --- gcli.FGrepogitport..Ctor -inline gcli::FGrepogitport::FGrepogitport() { - gcli::FGrepogitport_Init(*this); -} - -// --- gcli.FGrepogitport..Dtor -inline gcli::FGrepogitport::~FGrepogitport() { - gcli::FGrepogitport_Uninit(*this); -} - -// --- gcli.FGrepossh..Init -// Set all fields to initial values. -inline void gcli::FGrepossh_Init(gcli::FGrepossh& grepossh) { - grepossh.ind_grepossh_next = (gcli::FGrepossh*)-1; // (gcli.FDb.ind_grepossh) not-in-hash -} - -// --- gcli.FGrepossh..Ctor -inline gcli::FGrepossh::FGrepossh() { - gcli::FGrepossh_Init(*this); -} - -// --- gcli.FGrepossh..Dtor -inline gcli::FGrepossh::~FGrepossh() { - gcli::FGrepossh_Uninit(*this); -} - // --- gcli.FGstatet..Init // Set all fields to initial values. inline void gcli::FGstatet_Init(gcli::FGstatet& gstatet) { gstatet.ind_gstatet_next = (gcli::FGstatet*)-1; // (gcli.FDb.ind_gstatet) not-in-hash + gstatet.ind_gstatet_hashval = 0; // stored hash value } // --- gcli.FGstatet..Ctor @@ -3408,6 +3228,7 @@ inline void gcli::FGtbl_Init(gcli::FGtbl& gtbl) { gtbl.c_gtblact_n = 0; // (gcli.FGtbl.c_gtblact) gtbl.c_gtblact_max = 0; // (gcli.FGtbl.c_gtblact) gtbl.ind_gtbl_next = (gcli::FGtbl*)-1; // (gcli.FDb.ind_gtbl) not-in-hash + gtbl.ind_gtbl_hashval = 0; // stored hash value } // --- gcli.FGtbl.c_gtblact_curs.Reset @@ -3682,6 +3503,7 @@ inline void gcli::FGtype_Init(gcli::FGtype& gtype) { gtype.c_gtypeprefix_n = 0; // (gcli.FGtype.c_gtypeprefix) gtype.c_gtypeprefix_max = 0; // (gcli.FGtype.c_gtypeprefix) gtype.ind_gtype_next = (gcli::FGtype*)-1; // (gcli.FDb.ind_gtype) not-in-hash + gtype.ind_gtype_hashval = 0; // stored hash value } // --- gcli.FGtype.c_gtypeh_curs.Reset @@ -4074,6 +3896,7 @@ inline void gcli::FIssuenote_Init(gcli::FIssuenote& issuenote) { issuenote.select = bool(false); issuenote.issue_c_issuenote_in_ary = bool(false); issuenote.ind_issuenote_next = (gcli::FIssuenote*)-1; // (gcli.FDb.ind_issuenote) not-in-hash + issuenote.ind_issuenote_hashval = 0; // stored hash value } // --- gcli.FIssuenote..Ctor @@ -4091,6 +3914,7 @@ inline gcli::FIssuenote::~FIssuenote() { inline void gcli::FMilestone_Init(gcli::FMilestone& milestone) { milestone.select = bool(false); milestone.ind_milestone_next = (gcli::FMilestone*)-1; // (gcli.FDb.ind_milestone) not-in-hash + milestone.ind_milestone_hashval = 0; // stored hash value } // --- gcli.FMilestone..Ctor @@ -4295,6 +4119,7 @@ inline void gcli::FMrnote_Init(gcli::FMrnote& mrnote) { mrnote.select = bool(false); mrnote.mr_c_mrnote_in_ary = bool(false); mrnote.ind_mrnote_next = (gcli::FMrnote*)-1; // (gcli.FDb.ind_mrnote) not-in-hash + mrnote.ind_mrnote_hashval = 0; // stored hash value } // --- gcli.FMrnote..Ctor @@ -4317,6 +4142,7 @@ inline void gcli::FUser_Init(gcli::FUser& user) { user.id = u32(0); user.select = bool(false); user.ind_user_next = (gcli::FUser*)-1; // (gcli.FDb.ind_user) not-in-hash + user.ind_user_hashval = 0; // stored hash value } // --- gcli.FUser..Ctor diff --git a/include/gen/gclidb_gen.h b/include/gen/gclidb_gen.h index d23e4aaa..2832cf86 100644 --- a/include/gen/gclidb_gen.h +++ b/include/gen/gclidb_gen.h @@ -65,74 +65,70 @@ enum gclidb_FieldIdEnum { // gclidb.FieldId.value ,gclidb_FieldId_descr = 32 ,gclidb_FieldId_active = 33 ,gclidb_FieldId_priv = 34 - ,gclidb_FieldId_grepogitport = 35 - ,gclidb_FieldId_port = 36 - ,gclidb_FieldId_grepossh = 37 - ,gclidb_FieldId_sshid = 38 - ,gclidb_FieldId_gstate = 39 - ,gclidb_FieldId_st = 40 - ,gclidb_FieldId_state = 41 - ,gclidb_FieldId_gstatet = 42 - ,gclidb_FieldId_gtbl = 43 - ,gclidb_FieldId_gtblact = 44 - ,gclidb_FieldId_t = 45 - ,gclidb_FieldId_e = 46 - ,gclidb_FieldId_auth = 47 - ,gclidb_FieldId_gtblactfld = 48 - ,gclidb_FieldId_dflt = 49 - ,gclidb_FieldId_field_name_dflt = 50 - ,gclidb_FieldId_optional = 51 - ,gclidb_FieldId_regx = 52 - ,gclidb_FieldId_gtblacttst = 53 - ,gclidb_FieldId_working = 54 - ,gclidb_FieldId_cmd = 55 - ,gclidb_FieldId_gtblacttstout = 56 - ,gclidb_FieldId_out = 57 - ,gclidb_FieldId_text = 58 - ,gclidb_FieldId_default_url = 59 - ,gclidb_FieldId_gtypeh = 60 - ,gclidb_FieldId_header = 61 - ,gclidb_FieldId_gtypeprefix = 62 - ,gclidb_FieldId_prefix = 63 - ,gclidb_FieldId_issue = 64 - ,gclidb_FieldId_project = 65 - ,gclidb_FieldId_iid = 66 - ,gclidb_FieldId_assignee = 67 - ,gclidb_FieldId_labels = 68 - ,gclidb_FieldId_milestone_iid = 69 - ,gclidb_FieldId_milestone_num = 70 - ,gclidb_FieldId_milestone = 71 - ,gclidb_FieldId_title = 72 - ,gclidb_FieldId_author = 73 - ,gclidb_FieldId_mr = 74 - ,gclidb_FieldId_description = 75 - ,gclidb_FieldId_issuenote = 76 - ,gclidb_FieldId_nid = 77 - ,gclidb_FieldId_note = 78 - ,gclidb_FieldId_system = 79 - ,gclidb_FieldId_issuepipeline = 80 - ,gclidb_FieldId_id = 81 - ,gclidb_FieldId_id_in = 82 - ,gclidb_FieldId_status = 83 - ,gclidb_FieldId_label = 84 - ,gclidb_FieldId_proj = 85 - ,gclidb_FieldId_source_branch = 86 - ,gclidb_FieldId_source_repo = 87 - ,gclidb_FieldId_reviewer = 88 - ,gclidb_FieldId_pipeline_status = 89 - ,gclidb_FieldId_pipeline_id = 90 - ,gclidb_FieldId_draft = 91 - ,gclidb_FieldId_node_id = 92 - ,gclidb_FieldId_mrjob = 93 - ,gclidb_FieldId_job = 94 - ,gclidb_FieldId_ref = 95 - ,gclidb_FieldId_runner = 96 - ,gclidb_FieldId_mrnote = 97 - ,gclidb_FieldId_user = 98 - ,gclidb_FieldId_value = 99 + ,gclidb_FieldId_gstate = 35 + ,gclidb_FieldId_st = 36 + ,gclidb_FieldId_state = 37 + ,gclidb_FieldId_gstatet = 38 + ,gclidb_FieldId_gtbl = 39 + ,gclidb_FieldId_gtblact = 40 + ,gclidb_FieldId_t = 41 + ,gclidb_FieldId_e = 42 + ,gclidb_FieldId_auth = 43 + ,gclidb_FieldId_gtblactfld = 44 + ,gclidb_FieldId_dflt = 45 + ,gclidb_FieldId_field_name_dflt = 46 + ,gclidb_FieldId_optional = 47 + ,gclidb_FieldId_regx = 48 + ,gclidb_FieldId_gtblacttst = 49 + ,gclidb_FieldId_working = 50 + ,gclidb_FieldId_cmd = 51 + ,gclidb_FieldId_gtblacttstout = 52 + ,gclidb_FieldId_out = 53 + ,gclidb_FieldId_text = 54 + ,gclidb_FieldId_default_url = 55 + ,gclidb_FieldId_gtypeh = 56 + ,gclidb_FieldId_header = 57 + ,gclidb_FieldId_gtypeprefix = 58 + ,gclidb_FieldId_prefix = 59 + ,gclidb_FieldId_issue = 60 + ,gclidb_FieldId_project = 61 + ,gclidb_FieldId_iid = 62 + ,gclidb_FieldId_assignee = 63 + ,gclidb_FieldId_labels = 64 + ,gclidb_FieldId_milestone_iid = 65 + ,gclidb_FieldId_milestone_num = 66 + ,gclidb_FieldId_milestone = 67 + ,gclidb_FieldId_title = 68 + ,gclidb_FieldId_author = 69 + ,gclidb_FieldId_mr = 70 + ,gclidb_FieldId_description = 71 + ,gclidb_FieldId_issuenote = 72 + ,gclidb_FieldId_nid = 73 + ,gclidb_FieldId_note = 74 + ,gclidb_FieldId_system = 75 + ,gclidb_FieldId_issuepipeline = 76 + ,gclidb_FieldId_id = 77 + ,gclidb_FieldId_id_in = 78 + ,gclidb_FieldId_status = 79 + ,gclidb_FieldId_label = 80 + ,gclidb_FieldId_proj = 81 + ,gclidb_FieldId_source_branch = 82 + ,gclidb_FieldId_source_repo = 83 + ,gclidb_FieldId_reviewer = 84 + ,gclidb_FieldId_pipeline_status = 85 + ,gclidb_FieldId_pipeline_id = 86 + ,gclidb_FieldId_draft = 87 + ,gclidb_FieldId_node_id = 88 + ,gclidb_FieldId_mrjob = 89 + ,gclidb_FieldId_job = 90 + ,gclidb_FieldId_ref = 91 + ,gclidb_FieldId_runner = 92 + ,gclidb_FieldId_mrnote = 93 + ,gclidb_FieldId_user = 94 + ,gclidb_FieldId_value = 95 }; -enum { gclidb_FieldIdEnum_N = 100 }; +enum { gclidb_FieldIdEnum_N = 96 }; extern const char * gclidb_Gact_gact_accept; // accept fconst:gclidb.Gact.gact/accept extern const char * gclidb_Gact_gact_approve; // approve fconst:gclidb.Gact.gact/approve @@ -173,6 +169,7 @@ extern const char * gclidb_Gclienv_gclienv_ghub; // ghub fconst:gclidb.Gcl extern const char * gclidb_Gclienv_gclienv_glab; // glab fconst:gclidb.Gclienv.gclienv/glab extern const char * gclidb_Gclisub_gclisub__GITDIR; // $GITDIR fconst:gclidb.Gclisub.gclisub/$GITDIR extern const char * gclidb_Gclisub_gclisub__HOST; // $HOST fconst:gclidb.Gclisub.gclisub/$HOST +extern const char * gclidb_Gclisub_gclisub__ID_RSA; // $ID_RSA fconst:gclidb.Gclisub.gclisub/$ID_RSA extern const char * gclidb_Gclisub_gclisub__IN_AUTH; // $IN_AUTH fconst:gclidb.Gclisub.gclisub/$IN_AUTH extern const char * gclidb_Gclisub_gclisub__ISSUE; // $ISSUE fconst:gclidb.Gclisub.gclisub/$ISSUE extern const char * gclidb_Gclisub_gclisub__ISSUE_; // $ISSUE# fconst:gclidb.Gclisub.gclisub/$ISSUE# @@ -199,11 +196,6 @@ extern const char * gclidb_Gfld_gfld_state; // state fconst: extern const char * gclidb_Gfld_gfld_title; // title fconst:gclidb.Gfld.gfld/title extern const char * gclidb_Gfld_gfld_token; // token fconst:gclidb.Gfld.gfld/token extern const char * gclidb_Gfld_gfld_user; // user fconst:gclidb.Gfld.gfld/user -extern const char * gclidb_Grepogitport_grepogitport_default; // default fconst:gclidb.Grepogitport.grepogitport/default -extern const char * gclidb_Grepogitport_grepogitport_github_com; // github.com fconst:gclidb.Grepogitport.grepogitport/github.com -extern const char * gclidb_Grepogitport_grepogitport_gitlab_vovaco_com; // gitlab.vovaco.com fconst:gclidb.Grepogitport.grepogitport/gitlab.vovaco.com -extern const char * gclidb_Grepossh_grepossh_glpat; // glpat fconst:gclidb.Grepossh.grepossh/glpat -extern const char * gclidb_Grepossh_grepossh_vparizhs_ghp; // vparizhs/ghp fconst:gclidb.Grepossh.grepossh/vparizhs/ghp extern const char * gclidb_Gstate_gstate_state_all; // state_all fconst:gclidb.Gstate.gstate/state_all extern const char * gclidb_Gstate_gstate_state_close; // state_close fconst:gclidb.Gstate.gstate/state_close extern const char * gclidb_Gstate_gstate_state_closed; // state_closed fconst:gclidb.Gstate.gstate/state_closed @@ -283,8 +275,6 @@ namespace gclidb { // gen:ns_pkeytypedef typedef algo::Smallstr250 GithostPkey; typedef algo::Smallstr50 GmethodPkey; typedef algo::Smallstr250 GrepoPkey; - typedef algo::Smallstr50 GrepogitportPkey; - typedef algo::Smallstr50 GreposshPkey; typedef algo::Smallstr50 GstatePkey; typedef algo::Smallstr50 GstatetPkey; typedef algo::Smallstr250 GtblPkey; @@ -322,8 +312,6 @@ namespace gclidb { struct Gfld; } namespace gclidb { struct Githost; } namespace gclidb { struct Gmethod; } namespace gclidb { struct Grepo; } -namespace gclidb { struct Grepogitport; } -namespace gclidb { struct Grepossh; } namespace gclidb { struct Gstate; } namespace gclidb { struct Gstatet; } namespace gclidb { struct Gtbl; } @@ -439,8 +427,8 @@ bool Gatv_ReadStrptrMaybe(gclidb::Gatv &parent, algo::strptr in_ void Gatv_Print(gclidb::Gatv& row, algo::cstring& str) __attribute__((nothrow)); // --- gclidb.Gclicmd -struct Gclicmd { // gclidb.Gclicmd - algo::Smallstr250 gclicmd; // +struct Gclicmd { // gclidb.Gclicmd: table of static gcli commands + algo::Smallstr250 gclicmd; // table of static commands algo::Smallstr250 gclicmdf2j; // Base for gclicmdf2j algo::Comment comment; // // func:gclidb.Gclicmd..Ctor @@ -723,51 +711,6 @@ void Grepo_Init(gclidb::Grepo& parent); // func:gclidb.Grepo..Print void Grepo_Print(gclidb::Grepo& row, algo::cstring& str) __attribute__((nothrow)); -// --- gclidb.Grepogitport -struct Grepogitport { // gclidb.Grepogitport: Default ports for repositories - algo::Smallstr50 grepogitport; // grepo git host - algo::cstring port; // ssh port for config - algo::Comment comment; // - // func:gclidb.Grepogitport..Ctor - inline Grepogitport() __attribute__((nothrow)); -}; - -// func:gclidb.Grepogitport..ReadFieldMaybe -bool Grepogitport_ReadFieldMaybe(gclidb::Grepogitport& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of gclidb::Grepogitport from an ascii string. -// The format of the string is an ssim Tuple -// func:gclidb.Grepogitport..ReadStrptrMaybe -bool Grepogitport_ReadStrptrMaybe(gclidb::Grepogitport &parent, algo::strptr in_str) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:gclidb.Grepogitport.String printfmt:Tuple -// func:gclidb.Grepogitport..Print -void Grepogitport_Print(gclidb::Grepogitport& row, algo::cstring& str) __attribute__((nothrow)); - -// --- gclidb.Grepossh -struct Grepossh { // gclidb.Grepossh: Ssh key table - algo::Smallstr50 grepossh; // grepo project/repo name - algo::Smallstr200 sshid; // ssh id key name for ssh config - algo::Comment comment; // - // func:gclidb.Grepossh..Ctor - inline Grepossh() __attribute__((nothrow)); -}; - -// func:gclidb.Grepossh.name.Get -algo::cstring name_Get(gclidb::Grepossh& parent) __attribute__((__warn_unused_result__, nothrow)); -// func:gclidb.Grepossh.name.Get2 -algo::cstring Grepossh_name_Get(algo::strptr arg) __attribute__((nothrow)); - -// func:gclidb.Grepossh..ReadFieldMaybe -bool Grepossh_ReadFieldMaybe(gclidb::Grepossh& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); -// Read fields of gclidb::Grepossh from an ascii string. -// The format of the string is an ssim Tuple -// func:gclidb.Grepossh..ReadStrptrMaybe -bool Grepossh_ReadStrptrMaybe(gclidb::Grepossh &parent, algo::strptr in_str) __attribute__((nothrow)); -// print string representation of ROW to string STR -// cfmt:gclidb.Grepossh.String printfmt:Tuple -// func:gclidb.Grepossh..Print -void Grepossh_Print(gclidb::Grepossh& row, algo::cstring& str) __attribute__((nothrow)); - // --- gclidb.Gstate struct Gstate { // gclidb.Gstate: Issue/MR state list algo::Smallstr50 gstate; // @@ -850,7 +793,7 @@ bool Gtbl_ReadStrptrMaybe(gclidb::Gtbl &parent, algo::strptr in_ void Gtbl_Print(gclidb::Gtbl& row, algo::cstring& str) __attribute__((nothrow)); // --- gclidb.Gtblact -struct Gtblact { // gclidb.Gtblact +struct Gtblact { // gclidb.Gtblact: static combination of gcli tables and actions algo::Smallstr50 gtblact; // bool t; // false bool e; // false @@ -1388,8 +1331,6 @@ inline algo::cstring &operator <<(algo::cstring &str, const gclidb::Gclisub &row inline algo::cstring &operator <<(algo::cstring &str, const gclidb::Gfld &row);// cfmt:gclidb.Gfld.String inline algo::cstring &operator <<(algo::cstring &str, const gclidb::Gmethod &row);// cfmt:gclidb.Gmethod.String inline algo::cstring &operator <<(algo::cstring &str, const gclidb::Grepo &row);// cfmt:gclidb.Grepo.String -inline algo::cstring &operator <<(algo::cstring &str, const gclidb::Grepogitport &row);// cfmt:gclidb.Grepogitport.String -inline algo::cstring &operator <<(algo::cstring &str, const gclidb::Grepossh &row);// cfmt:gclidb.Grepossh.String inline algo::cstring &operator <<(algo::cstring &str, const gclidb::Gstate &row);// cfmt:gclidb.Gstate.String inline algo::cstring &operator <<(algo::cstring &str, const gclidb::Gstatet &row);// cfmt:gclidb.Gstatet.String inline algo::cstring &operator <<(algo::cstring &str, const gclidb::Gtbl &row);// cfmt:gclidb.Gtbl.String diff --git a/include/gen/gclidb_gen.inl.h b/include/gen/gclidb_gen.inl.h index 58054d33..2eb41ec1 100644 --- a/include/gen/gclidb_gen.inl.h +++ b/include/gen/gclidb_gen.inl.h @@ -143,14 +143,6 @@ inline gclidb::Grepo::Grepo() { gclidb::Grepo_Init(*this); } -// --- gclidb.Grepogitport..Ctor -inline gclidb::Grepogitport::Grepogitport() { -} - -// --- gclidb.Grepossh..Ctor -inline gclidb::Grepossh::Grepossh() { -} - // --- gclidb.Gstate..Ctor inline gclidb::Gstate::Gstate() { } @@ -323,16 +315,6 @@ inline algo::cstring &algo::operator <<(algo::cstring &str, const gclidb::Grepo return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const gclidb::Grepogitport &row) {// cfmt:gclidb.Grepogitport.String - gclidb::Grepogitport_Print(const_cast(row), str); - return str; -} - -inline algo::cstring &algo::operator <<(algo::cstring &str, const gclidb::Grepossh &row) {// cfmt:gclidb.Grepossh.String - gclidb::Grepossh_Print(const_cast(row), str); - return str; -} - inline algo::cstring &algo::operator <<(algo::cstring &str, const gclidb::Gstate &row) {// cfmt:gclidb.Gstate.String gclidb::Gstate_Print(const_cast(row), str); return str; diff --git a/include/gen/http_gen.h b/include/gen/http_gen.h new file mode 100644 index 00000000..4654af56 --- /dev/null +++ b/include/gen/http_gen.h @@ -0,0 +1,730 @@ +// +// include/gen/http_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- http_FieldIdEnum + +enum http_FieldIdEnum { // http.FieldId.value + http_FieldId_name = 0 + ,http_FieldId_value = 1 + ,http_FieldId_method = 2 + ,http_FieldId_extension_method = 3 + ,http_FieldId_uri = 4 + ,http_FieldId_version = 5 + ,http_FieldId_cache_control = 6 + ,http_FieldId_connection = 7 + ,http_FieldId_date = 8 + ,http_FieldId_pragma = 9 + ,http_FieldId_trailer = 10 + ,http_FieldId_transfer_encoding = 11 + ,http_FieldId_upgrade = 12 + ,http_FieldId_via = 13 + ,http_FieldId_warning = 14 + ,http_FieldId_accept = 15 + ,http_FieldId_accept_charset = 16 + ,http_FieldId_accept_encoding = 17 + ,http_FieldId_accept_language = 18 + ,http_FieldId_authorization = 19 + ,http_FieldId_expect = 20 + ,http_FieldId_from = 21 + ,http_FieldId_host = 22 + ,http_FieldId_if_match = 23 + ,http_FieldId_if_modified_since = 24 + ,http_FieldId_if_none_match = 25 + ,http_FieldId_if_range = 26 + ,http_FieldId_if_unmodified_since = 27 + ,http_FieldId_max_forwards = 28 + ,http_FieldId_proxy_authorization = 29 + ,http_FieldId_range = 30 + ,http_FieldId_referer = 31 + ,http_FieldId_te = 32 + ,http_FieldId_user_agent = 33 + ,http_FieldId_allow = 34 + ,http_FieldId_content_encoding = 35 + ,http_FieldId_content_language = 36 + ,http_FieldId_content_length = 37 + ,http_FieldId_content_location = 38 + ,http_FieldId_content_md5 = 39 + ,http_FieldId_content_range = 40 + ,http_FieldId_content_type = 41 + ,http_FieldId_expires = 42 + ,http_FieldId_last_modified = 43 + ,http_FieldId_sec_websocket_key = 44 + ,http_FieldId_sec_websocket_extensions = 45 + ,http_FieldId_sec_websocket_protocol = 46 + ,http_FieldId_sec_websocket_version = 47 + ,http_FieldId_extension_header = 48 + ,http_FieldId_body = 49 + ,http_FieldId_status = 50 + ,http_FieldId_accept_ranges = 51 + ,http_FieldId_age = 52 + ,http_FieldId_etag = 53 + ,http_FieldId_location = 54 + ,http_FieldId_proxy_authenticate = 55 + ,http_FieldId_retry_after = 56 + ,http_FieldId_server = 57 + ,http_FieldId_vary = 58 + ,http_FieldId_www_authenticate = 59 + ,http_FieldId_sec_websocket_accept = 60 +}; + +enum { http_FieldIdEnum_N = 61 }; + + +// --- http_HeaderTypeEnum + +enum http_HeaderTypeEnum { // http.HeaderType.value + http_HeaderType_accept = 0 + ,http_HeaderType_accept_charset = 1 + ,http_HeaderType_accept_encoding = 2 + ,http_HeaderType_accept_language = 3 + ,http_HeaderType_accept_ranges = 4 + ,http_HeaderType_age = 5 + ,http_HeaderType_allow = 6 + ,http_HeaderType_authorization = 7 + ,http_HeaderType_cache_control = 8 + ,http_HeaderType_connection = 9 + ,http_HeaderType_content_encoding = 10 + ,http_HeaderType_content_language = 11 + ,http_HeaderType_content_length = 12 + ,http_HeaderType_content_location = 13 + ,http_HeaderType_content_md5 = 14 + ,http_HeaderType_content_range = 15 + ,http_HeaderType_content_type = 16 + ,http_HeaderType_date = 17 + ,http_HeaderType_etag = 18 + ,http_HeaderType_expect = 19 + ,http_HeaderType_expires = 20 + ,http_HeaderType_from = 21 + ,http_HeaderType_host = 22 + ,http_HeaderType_if_match = 23 + ,http_HeaderType_if_modified_since = 24 + ,http_HeaderType_if_none_match = 25 + ,http_HeaderType_if_range = 26 + ,http_HeaderType_if_unmodified_since = 27 + ,http_HeaderType_last_modified = 28 + ,http_HeaderType_location = 29 + ,http_HeaderType_max_forwards = 30 + ,http_HeaderType_pragma = 31 + ,http_HeaderType_proxy_authenticate = 32 + ,http_HeaderType_proxy_authorization = 33 + ,http_HeaderType_range = 34 + ,http_HeaderType_referer = 35 + ,http_HeaderType_retry_after = 36 + ,http_HeaderType_sec_websocket_accept = 37 + ,http_HeaderType_sec_websocket_extensions = 38 + ,http_HeaderType_sec_websocket_key = 39 + ,http_HeaderType_sec_websocket_protocol = 40 + ,http_HeaderType_sec_websocket_version = 41 + ,http_HeaderType_server = 42 + ,http_HeaderType_te = 43 + ,http_HeaderType_trailer = 44 + ,http_HeaderType_transfer_encoding = 45 + ,http_HeaderType_upgrade = 46 + ,http_HeaderType_user_agent = 47 + ,http_HeaderType_vary = 48 + ,http_HeaderType_via = 49 + ,http_HeaderType_warning = 50 + ,http_HeaderType_www_authenticate = 51 +}; + +enum { http_HeaderTypeEnum_N = 52 }; + + +// --- http_MethodEnum + +enum http_MethodEnum { // http.Method.value + http_Method_extension_method = 255 + ,http_Method_GET = 1 // Transfer a current representation of the target resource + ,http_Method_HEAD = 2 // Same as GET, but do not transfer the response content + ,http_Method_POST = 3 // Perform resource-specific processing on the request content + ,http_Method_PUT = 4 // Replace all current representations of the target resource with the request content + ,http_Method_DELETE = 5 // Remove all current representations of the target resource + ,http_Method_CONNECT = 6 // Establish a tunnel to the server identified by the target resource + ,http_Method_OPTIONS = 7 // Describe the communication options for the target resource + ,http_Method_TRACE = 8 // Perform a message loop-back test along the path to the target resource +}; + +enum { http_MethodEnum_N = 9 }; + +namespace http { // gen:ns_pkeytypedef +} // gen:ns_pkeytypedef +namespace http { // gen:ns_tclass_field +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace http { struct Request_extension_header_curs; } +namespace http { struct Response_extension_header_curs; } +namespace http { struct ExtensionHeader; } +namespace http { struct FieldId; } +namespace http { struct HeaderType; } +namespace http { struct Method; } +namespace http { struct Request; } +namespace http { struct Response; } +namespace http { // gen:ns_gsymbol + extern const algo::strptr httpdb_version_HTTP_0_9; // "HTTP/0.9" + extern const algo::strptr httpdb_version_HTTP_1_0; // "HTTP/1.0" + extern const algo::strptr httpdb_version_HTTP_1_1; // "HTTP/1.1" + extern const algo::strptr httpdb_version_HTTP_2_0; // "HTTP/2.0" + extern const algo::strptr httpdb_version_HTTP_3_0; // "HTTP/3.0" +} // gen:ns_gsymbol +namespace http { // gen:ns_print_struct + +// --- http.ExtensionHeader +// create: http.Request.extension_header (Tary) +// create: http.Response.extension_header (Tary) +struct ExtensionHeader { // http.ExtensionHeader + algo::cstring name; // + algo::cstring value; // + // func:http.ExtensionHeader..Ctor + inline ExtensionHeader() __attribute__((nothrow)); +}; + +// func:http.ExtensionHeader..ReadFieldMaybe +bool ExtensionHeader_ReadFieldMaybe(http::ExtensionHeader& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of http::ExtensionHeader from an ascii string. +// The format of the string is an ssim Tuple +// func:http.ExtensionHeader..ReadStrptrMaybe +bool ExtensionHeader_ReadStrptrMaybe(http::ExtensionHeader &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:http.ExtensionHeader.String printfmt:Tuple +// func:http.ExtensionHeader..Print +void ExtensionHeader_Print(http::ExtensionHeader& row, algo::cstring& str) __attribute__((nothrow)); + +// --- http.FieldId +#pragma pack(push,1) +struct FieldId { // http.FieldId: Field read helper + i32 value; // -1 + // func:http.FieldId.value.Cast + inline operator http_FieldIdEnum() const __attribute__((nothrow)); + // func:http.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:http.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:http.FieldId..EnumCtor + inline FieldId(http_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:http.FieldId.value.GetEnum +inline http_FieldIdEnum value_GetEnum(const http::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:http.FieldId.value.SetEnum +inline void value_SetEnum(http::FieldId& parent, http_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:http.FieldId.value.ToCstr +const char* value_ToCstr(const http::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:http.FieldId.value.Print +void value_Print(const http::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:http.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(http::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:http.FieldId.value.SetStrptr +void value_SetStrptr(http::FieldId& parent, algo::strptr rhs, http_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:http.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(http::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of http::FieldId from an ascii string. +// The format of the string is the format of the http::FieldId's only field +// func:http.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(http::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:http.FieldId..Init +inline void FieldId_Init(http::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:http.FieldId.String printfmt:Raw +// func:http.FieldId..Print +void FieldId_Print(http::FieldId& row, algo::cstring& str) __attribute__((nothrow)); + +// --- http.HeaderType +struct HeaderType { // http.HeaderType + u16 value; // 0 + // func:http.HeaderType..Ctor + inline HeaderType() __attribute__((nothrow)); + // func:http.HeaderType..EnumCtor + inline HeaderType(http_HeaderTypeEnum arg) __attribute__((nothrow)); +}; + +// Get value of field as enum type +// func:http.HeaderType.value.GetEnum +inline http_HeaderTypeEnum value_GetEnum(const http::HeaderType& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:http.HeaderType.value.SetEnum +inline void value_SetEnum(http::HeaderType& parent, http_HeaderTypeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:http.HeaderType.value.ToCstr +const char* value_ToCstr(const http::HeaderType& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:http.HeaderType.value.Print +void value_Print(const http::HeaderType& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:http.HeaderType.value.SetStrptrMaybe +bool value_SetStrptrMaybe(http::HeaderType& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:http.HeaderType.value.SetStrptr +void value_SetStrptr(http::HeaderType& parent, algo::strptr rhs, http_HeaderTypeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:http.HeaderType.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(http::HeaderType& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of http::HeaderType from an ascii string. +// The format of the string is the format of the http::HeaderType's only field +// func:http.HeaderType..ReadStrptrMaybe +bool HeaderType_ReadStrptrMaybe(http::HeaderType &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:http.HeaderType..Init +inline void HeaderType_Init(http::HeaderType& parent); +// print string representation of ROW to string STR +// cfmt:http.HeaderType.String printfmt:Raw +// func:http.HeaderType..Print +void HeaderType_Print(http::HeaderType& row, algo::cstring& str) __attribute__((nothrow)); + +// --- http.Method +struct Method { // http.Method + u8 value; // 0 + // func:http.Method..Ctor + inline Method() __attribute__((nothrow)); + // func:http.Method..EnumCtor + inline Method(http_MethodEnum arg) __attribute__((nothrow)); +}; + +// Get value of field as enum type +// func:http.Method.value.GetEnum +inline http_MethodEnum value_GetEnum(const http::Method& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:http.Method.value.SetEnum +inline void value_SetEnum(http::Method& parent, http_MethodEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:http.Method.value.ToCstr +const char* value_ToCstr(const http::Method& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:http.Method.value.Print +void value_Print(const http::Method& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:http.Method.value.SetStrptrMaybe +bool value_SetStrptrMaybe(http::Method& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:http.Method.value.SetStrptr +void value_SetStrptr(http::Method& parent, algo::strptr rhs, http_MethodEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:http.Method.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(http::Method& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of http::Method from an ascii string. +// The format of the string is the format of the http::Method's only field +// func:http.Method..ReadStrptrMaybe +bool Method_ReadStrptrMaybe(http::Method &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:http.Method..Init +inline void Method_Init(http::Method& parent); +// print string representation of ROW to string STR +// cfmt:http.Method.String printfmt:Raw +// func:http.Method..Print +void Method_Print(http::Method& row, algo::cstring& str) __attribute__((nothrow)); + +// --- http.Request +struct Request { // http.Request + http::Method method; // + algo::cstring extension_method; // + algo::cstring uri; // + algo::cstring version; // + algo::cstring cache_control; // + algo::cstring connection; // + algo::cstring date; // + algo::cstring pragma; // + algo::cstring trailer; // + algo::cstring transfer_encoding; // + algo::cstring upgrade; // + algo::cstring via; // + algo::cstring warning; // + algo::cstring accept; // + algo::cstring accept_charset; // + algo::cstring accept_encoding; // + algo::cstring accept_language; // + algo::cstring authorization; // + algo::cstring expect; // + algo::cstring from; // + algo::cstring host; // + algo::cstring if_match; // + algo::cstring if_modified_since; // + algo::cstring if_none_match; // + algo::cstring if_range; // + algo::cstring if_unmodified_since; // + algo::cstring max_forwards; // + algo::cstring proxy_authorization; // + algo::cstring range; // + algo::cstring referer; // + algo::cstring te; // + algo::cstring user_agent; // + algo::cstring allow; // + algo::cstring content_encoding; // + algo::cstring content_language; // + i32 content_length; // 0 + algo::cstring content_location; // + algo::cstring content_md5; // + algo::cstring content_range; // + algo::cstring content_type; // + algo::cstring expires; // + algo::cstring last_modified; // + algo::cstring sec_websocket_key; // + algo::cstring sec_websocket_extensions; // + algo::cstring sec_websocket_protocol; // + algo::cstring sec_websocket_version; // + http::ExtensionHeader* extension_header_elems; // pointer to elements + u32 extension_header_n; // number of elements in array + u32 extension_header_max; // max. capacity of array before realloc + algo::cstring body; // + // func:http.Request..AssignOp + http::Request& operator =(const http::Request &rhs) __attribute__((nothrow)); + // func:http.Request..Ctor + inline Request() __attribute__((nothrow)); + // func:http.Request..Dtor + inline ~Request() __attribute__((nothrow)); + // func:http.Request..CopyCtor + Request(const http::Request &rhs) __attribute__((nothrow)); +}; + +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:http.Request.extension_header.Addary +algo::aryptr extension_header_Addary(http::Request& parent, algo::aryptr rhs) __attribute__((nothrow)); +// Reserve space. Insert element at the end +// The new element is initialized to a default value +// func:http.Request.extension_header.Alloc +http::ExtensionHeader& extension_header_Alloc(http::Request& parent) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:http.Request.extension_header.AllocAt +http::ExtensionHeader& extension_header_AllocAt(http::Request& parent, int at) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:http.Request.extension_header.AllocN +algo::aryptr extension_header_AllocN(http::Request& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:http.Request.extension_header.AllocNAt +algo::aryptr extension_header_AllocNAt(http::Request& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:http.Request.extension_header.EmptyQ +inline bool extension_header_EmptyQ(http::Request& parent) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:http.Request.extension_header.Find +inline http::ExtensionHeader* extension_header_Find(http::Request& parent, u64 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array pointer by value +// func:http.Request.extension_header.Getary +inline algo::aryptr extension_header_Getary(const http::Request& parent) __attribute__((nothrow)); +// Return pointer to last element of array, or NULL if array is empty +// func:http.Request.extension_header.Last +inline http::ExtensionHeader* extension_header_Last(http::Request& parent) __attribute__((nothrow, pure)); +// Return max. number of items in the array +// func:http.Request.extension_header.Max +inline i32 extension_header_Max(http::Request& parent) __attribute__((nothrow)); +// Return number of items in the array +// func:http.Request.extension_header.N +inline i32 extension_header_N(const http::Request& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove item by index. If index outside of range, do nothing. +// func:http.Request.extension_header.Remove +void extension_header_Remove(http::Request& parent, u32 i) __attribute__((nothrow)); +// func:http.Request.extension_header.RemoveAll +void extension_header_RemoveAll(http::Request& parent) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:http.Request.extension_header.RemoveLast +void extension_header_RemoveLast(http::Request& parent) __attribute__((nothrow)); +// Make sure N *more* elements will fit in array. Process dies if out of memory +// func:http.Request.extension_header.Reserve +inline void extension_header_Reserve(http::Request& parent, int n) __attribute__((nothrow)); +// Make sure N elements fit in array. Process dies if out of memory +// func:http.Request.extension_header.AbsReserve +void extension_header_AbsReserve(http::Request& parent, int n) __attribute__((nothrow)); +// Copy contents of RHS to PARENT. +// func:http.Request.extension_header.Setary +void extension_header_Setary(http::Request& parent, http::Request &rhs) __attribute__((nothrow)); +// Copy specified array into extension_header, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +// func:http.Request.extension_header.Setary2 +void extension_header_Setary(http::Request& parent, const algo::aryptr &rhs) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:http.Request.extension_header.qFind +inline http::ExtensionHeader& extension_header_qFind(http::Request& parent, u64 t) __attribute__((nothrow)); +// Return reference to last element of array. No bounds checking +// func:http.Request.extension_header.qLast +inline http::ExtensionHeader& extension_header_qLast(http::Request& parent) __attribute__((nothrow)); +// Return row id of specified element +// func:http.Request.extension_header.rowid_Get +inline u64 extension_header_rowid_Get(http::Request& parent, http::ExtensionHeader &elem) __attribute__((nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:http.Request.extension_header.AllocNVal +algo::aryptr extension_header_AllocNVal(http::Request& parent, int n_elems, const http::ExtensionHeader& val) __attribute__((nothrow)); +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +// func:http.Request.extension_header.ReadStrptrMaybe +bool extension_header_ReadStrptrMaybe(http::Request& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:http.Request.extension_header.Insary +void extension_header_Insary(http::Request& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); + +// proceed to next item +// func:http.Request.extension_header_curs.Next +inline void Request_extension_header_curs_Next(Request_extension_header_curs &curs) __attribute__((nothrow)); +// func:http.Request.extension_header_curs.Reset +inline void Request_extension_header_curs_Reset(Request_extension_header_curs &curs, http::Request &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:http.Request.extension_header_curs.ValidQ +inline bool Request_extension_header_curs_ValidQ(Request_extension_header_curs &curs) __attribute__((nothrow)); +// item access +// func:http.Request.extension_header_curs.Access +inline http::ExtensionHeader& Request_extension_header_curs_Access(Request_extension_header_curs &curs) __attribute__((nothrow)); +// func:http.Request..ReadFieldMaybe +bool Request_ReadFieldMaybe(http::Request& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of http::Request from an ascii string. +// The format of the string is an ssim Tuple +// func:http.Request..ReadStrptrMaybe +bool Request_ReadStrptrMaybe(http::Request &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:http.Request..Init +void Request_Init(http::Request& parent); +// func:http.Request..Uninit +void Request_Uninit(http::Request& parent) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:http.Request.String printfmt:Tuple +// func:http.Request..Print +void Request_Print(http::Request& row, algo::cstring& str) __attribute__((nothrow)); + +// --- http.Response +struct Response { // http.Response + algo::Smallstr50 version; // "HTTP/1.0" + algo::Smallstr50 status; // "200 OK" + algo::cstring cache_control; // + algo::cstring connection; // + algo::cstring date; // + algo::cstring pragma; // + algo::cstring trailer; // + algo::cstring transfer_encoding; // + algo::cstring upgrade; // + algo::cstring via; // + algo::cstring warning; // + algo::cstring accept_ranges; // + algo::cstring age; // + algo::cstring etag; // + algo::cstring location; // + algo::cstring proxy_authenticate; // + algo::cstring retry_after; // + algo::cstring server; // + algo::cstring vary; // + algo::cstring www_authenticate; // + algo::cstring allow; // + algo::cstring content_encoding; // + algo::cstring content_language; // + i32 content_length; // 0 + algo::cstring content_location; // + algo::cstring content_md5; // + algo::cstring content_range; // + algo::cstring content_type; // + algo::cstring expires; // + algo::cstring last_modified; // + algo::cstring sec_websocket_accept; // + algo::cstring sec_websocket_extensions; // + algo::cstring sec_websocket_protocol; // + algo::cstring sec_websocket_version; // + http::ExtensionHeader* extension_header_elems; // pointer to elements + u32 extension_header_n; // number of elements in array + u32 extension_header_max; // max. capacity of array before realloc + algo::cstring body; // + // func:http.Response..AssignOp + http::Response& operator =(const http::Response &rhs) __attribute__((nothrow)); + // func:http.Response..Ctor + inline Response() __attribute__((nothrow)); + // func:http.Response..Dtor + inline ~Response() __attribute__((nothrow)); + // func:http.Response..CopyCtor + Response(const http::Response &rhs) __attribute__((nothrow)); +}; + +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:http.Response.extension_header.Addary +algo::aryptr extension_header_Addary(http::Response& parent, algo::aryptr rhs) __attribute__((nothrow)); +// Reserve space. Insert element at the end +// The new element is initialized to a default value +// func:http.Response.extension_header.Alloc +http::ExtensionHeader& extension_header_Alloc(http::Response& parent) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:http.Response.extension_header.AllocAt +http::ExtensionHeader& extension_header_AllocAt(http::Response& parent, int at) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:http.Response.extension_header.AllocN +algo::aryptr extension_header_AllocN(http::Response& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:http.Response.extension_header.AllocNAt +algo::aryptr extension_header_AllocNAt(http::Response& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:http.Response.extension_header.EmptyQ +inline bool extension_header_EmptyQ(http::Response& parent) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:http.Response.extension_header.Find +inline http::ExtensionHeader* extension_header_Find(http::Response& parent, u64 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array pointer by value +// func:http.Response.extension_header.Getary +inline algo::aryptr extension_header_Getary(const http::Response& parent) __attribute__((nothrow)); +// Return pointer to last element of array, or NULL if array is empty +// func:http.Response.extension_header.Last +inline http::ExtensionHeader* extension_header_Last(http::Response& parent) __attribute__((nothrow, pure)); +// Return max. number of items in the array +// func:http.Response.extension_header.Max +inline i32 extension_header_Max(http::Response& parent) __attribute__((nothrow)); +// Return number of items in the array +// func:http.Response.extension_header.N +inline i32 extension_header_N(const http::Response& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove item by index. If index outside of range, do nothing. +// func:http.Response.extension_header.Remove +void extension_header_Remove(http::Response& parent, u32 i) __attribute__((nothrow)); +// func:http.Response.extension_header.RemoveAll +void extension_header_RemoveAll(http::Response& parent) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:http.Response.extension_header.RemoveLast +void extension_header_RemoveLast(http::Response& parent) __attribute__((nothrow)); +// Make sure N *more* elements will fit in array. Process dies if out of memory +// func:http.Response.extension_header.Reserve +inline void extension_header_Reserve(http::Response& parent, int n) __attribute__((nothrow)); +// Make sure N elements fit in array. Process dies if out of memory +// func:http.Response.extension_header.AbsReserve +void extension_header_AbsReserve(http::Response& parent, int n) __attribute__((nothrow)); +// Copy contents of RHS to PARENT. +// func:http.Response.extension_header.Setary +void extension_header_Setary(http::Response& parent, http::Response &rhs) __attribute__((nothrow)); +// Copy specified array into extension_header, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +// func:http.Response.extension_header.Setary2 +void extension_header_Setary(http::Response& parent, const algo::aryptr &rhs) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:http.Response.extension_header.qFind +inline http::ExtensionHeader& extension_header_qFind(http::Response& parent, u64 t) __attribute__((nothrow)); +// Return reference to last element of array. No bounds checking +// func:http.Response.extension_header.qLast +inline http::ExtensionHeader& extension_header_qLast(http::Response& parent) __attribute__((nothrow)); +// Return row id of specified element +// func:http.Response.extension_header.rowid_Get +inline u64 extension_header_rowid_Get(http::Response& parent, http::ExtensionHeader &elem) __attribute__((nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:http.Response.extension_header.AllocNVal +algo::aryptr extension_header_AllocNVal(http::Response& parent, int n_elems, const http::ExtensionHeader& val) __attribute__((nothrow)); +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +// func:http.Response.extension_header.ReadStrptrMaybe +bool extension_header_ReadStrptrMaybe(http::Response& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:http.Response.extension_header.Insary +void extension_header_Insary(http::Response& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); + +// proceed to next item +// func:http.Response.extension_header_curs.Next +inline void Response_extension_header_curs_Next(Response_extension_header_curs &curs) __attribute__((nothrow)); +// func:http.Response.extension_header_curs.Reset +inline void Response_extension_header_curs_Reset(Response_extension_header_curs &curs, http::Response &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:http.Response.extension_header_curs.ValidQ +inline bool Response_extension_header_curs_ValidQ(Response_extension_header_curs &curs) __attribute__((nothrow)); +// item access +// func:http.Response.extension_header_curs.Access +inline http::ExtensionHeader& Response_extension_header_curs_Access(Response_extension_header_curs &curs) __attribute__((nothrow)); +// func:http.Response..ReadFieldMaybe +bool Response_ReadFieldMaybe(http::Response& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of http::Response from an ascii string. +// The format of the string is an ssim Tuple +// func:http.Response..ReadStrptrMaybe +bool Response_ReadStrptrMaybe(http::Response &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:http.Response..Init +void Response_Init(http::Response& parent); +// func:http.Response..Uninit +void Response_Uninit(http::Response& parent) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:http.Response.String printfmt:Tuple +// func:http.Response..Print +void Response_Print(http::Response& row, algo::cstring& str) __attribute__((nothrow)); +} // gen:ns_print_struct +namespace http { // gen:ns_curstext + +struct Request_extension_header_curs {// cursor + typedef http::ExtensionHeader ChildType; + http::ExtensionHeader* elems; + int n_elems; + int index; + Request_extension_header_curs() { elems=NULL; n_elems=0; index=0; } +}; + + +struct Response_extension_header_curs {// cursor + typedef http::ExtensionHeader ChildType; + http::ExtensionHeader* elems; + int n_elems; + int index; + Response_extension_header_curs() { elems=NULL; n_elems=0; index=0; } +}; + +} // gen:ns_curstext +namespace http { // gen:ns_func +// func:http...StaticCheck +void StaticCheck(); +} // gen:ns_func +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const http::ExtensionHeader &row);// cfmt:http.ExtensionHeader.String +inline algo::cstring &operator <<(algo::cstring &str, const http::FieldId &row);// cfmt:http.FieldId.String +inline algo::cstring &operator <<(algo::cstring &str, const http::HeaderType &row);// cfmt:http.HeaderType.String +inline algo::cstring &operator <<(algo::cstring &str, const http::Method &row);// cfmt:http.Method.String +inline algo::cstring &operator <<(algo::cstring &str, const http::Request &row);// cfmt:http.Request.String +inline algo::cstring &operator <<(algo::cstring &str, const http::Response &row);// cfmt:http.Response.String +} diff --git a/include/gen/http_gen.inl.h b/include/gen/http_gen.inl.h new file mode 100644 index 00000000..d35e5810 --- /dev/null +++ b/include/gen/http_gen.inl.h @@ -0,0 +1,362 @@ +// +// include/gen/http_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude + +// --- http.ExtensionHeader..Ctor +inline http::ExtensionHeader::ExtensionHeader() { +} + +// --- http.FieldId.value.GetEnum +// Get value of field as enum type +inline http_FieldIdEnum http::value_GetEnum(const http::FieldId& parent) { + return http_FieldIdEnum(parent.value); +} + +// --- http.FieldId.value.SetEnum +// Set value of field from enum type. +inline void http::value_SetEnum(http::FieldId& parent, http_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- http.FieldId.value.Cast +inline http::FieldId::operator http_FieldIdEnum() const { + return http_FieldIdEnum((*this).value); +} + +// --- http.FieldId..Init +// Set all fields to initial values. +inline void http::FieldId_Init(http::FieldId& parent) { + parent.value = i32(-1); +} + +// --- http.FieldId..Ctor +inline http::FieldId::FieldId() { + http::FieldId_Init(*this); +} + +// --- http.FieldId..FieldwiseCtor +inline http::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- http.FieldId..EnumCtor +inline http::FieldId::FieldId(http_FieldIdEnum arg) { + this->value = i32(arg); +} + +// --- http.HeaderType.value.GetEnum +// Get value of field as enum type +inline http_HeaderTypeEnum http::value_GetEnum(const http::HeaderType& parent) { + return http_HeaderTypeEnum(parent.value); +} + +// --- http.HeaderType.value.SetEnum +// Set value of field from enum type. +inline void http::value_SetEnum(http::HeaderType& parent, http_HeaderTypeEnum rhs) { + parent.value = u16(rhs); +} + +// --- http.HeaderType..Init +// Set all fields to initial values. +inline void http::HeaderType_Init(http::HeaderType& parent) { + parent.value = u16(0); +} + +// --- http.HeaderType..Ctor +inline http::HeaderType::HeaderType() { + http::HeaderType_Init(*this); +} + +// --- http.HeaderType..EnumCtor +inline http::HeaderType::HeaderType(http_HeaderTypeEnum arg) { + this->value = u16(arg); +} + +// --- http.Method.value.GetEnum +// Get value of field as enum type +inline http_MethodEnum http::value_GetEnum(const http::Method& parent) { + return http_MethodEnum(parent.value); +} + +// --- http.Method.value.SetEnum +// Set value of field from enum type. +inline void http::value_SetEnum(http::Method& parent, http_MethodEnum rhs) { + parent.value = u8(rhs); +} + +// --- http.Method..Init +// Set all fields to initial values. +inline void http::Method_Init(http::Method& parent) { + parent.value = u8(0); +} + +// --- http.Method..Ctor +inline http::Method::Method() { + http::Method_Init(*this); +} + +// --- http.Method..EnumCtor +inline http::Method::Method(http_MethodEnum arg) { + this->value = u8(arg); +} + +// --- http.Request.extension_header.EmptyQ +// Return true if index is empty +inline bool http::extension_header_EmptyQ(http::Request& parent) { + return parent.extension_header_n == 0; +} + +// --- http.Request.extension_header.Find +// Look up row by row id. Return NULL if out of range +inline http::ExtensionHeader* http::extension_header_Find(http::Request& parent, u64 t) { + u64 idx = t; + u64 lim = parent.extension_header_n; + if (idx >= lim) return NULL; + return parent.extension_header_elems + idx; +} + +// --- http.Request.extension_header.Getary +// Return array pointer by value +inline algo::aryptr http::extension_header_Getary(const http::Request& parent) { + return algo::aryptr(parent.extension_header_elems, parent.extension_header_n); +} + +// --- http.Request.extension_header.Last +// Return pointer to last element of array, or NULL if array is empty +inline http::ExtensionHeader* http::extension_header_Last(http::Request& parent) { + return extension_header_Find(parent, u64(parent.extension_header_n-1)); +} + +// --- http.Request.extension_header.Max +// Return max. number of items in the array +inline i32 http::extension_header_Max(http::Request& parent) { + (void)parent; + return parent.extension_header_max; +} + +// --- http.Request.extension_header.N +// Return number of items in the array +inline i32 http::extension_header_N(const http::Request& parent) { + return parent.extension_header_n; +} + +// --- http.Request.extension_header.Reserve +// Make sure N *more* elements will fit in array. Process dies if out of memory +inline void http::extension_header_Reserve(http::Request& parent, int n) { + u32 new_n = parent.extension_header_n + n; + if (UNLIKELY(new_n > parent.extension_header_max)) { + extension_header_AbsReserve(parent, new_n); + } +} + +// --- http.Request.extension_header.qFind +// 'quick' Access row by row id. No bounds checking. +inline http::ExtensionHeader& http::extension_header_qFind(http::Request& parent, u64 t) { + return parent.extension_header_elems[t]; +} + +// --- http.Request.extension_header.qLast +// Return reference to last element of array. No bounds checking +inline http::ExtensionHeader& http::extension_header_qLast(http::Request& parent) { + return extension_header_qFind(parent, u64(parent.extension_header_n-1)); +} + +// --- http.Request.extension_header.rowid_Get +// Return row id of specified element +inline u64 http::extension_header_rowid_Get(http::Request& parent, http::ExtensionHeader &elem) { + u64 id = &elem - parent.extension_header_elems; + return u64(id); +} + +// --- http.Request.extension_header_curs.Next +// proceed to next item +inline void http::Request_extension_header_curs_Next(Request_extension_header_curs &curs) { + curs.index++; +} + +// --- http.Request.extension_header_curs.Reset +inline void http::Request_extension_header_curs_Reset(Request_extension_header_curs &curs, http::Request &parent) { + curs.elems = parent.extension_header_elems; + curs.n_elems = parent.extension_header_n; + curs.index = 0; +} + +// --- http.Request.extension_header_curs.ValidQ +// cursor points to valid item +inline bool http::Request_extension_header_curs_ValidQ(Request_extension_header_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- http.Request.extension_header_curs.Access +// item access +inline http::ExtensionHeader& http::Request_extension_header_curs_Access(Request_extension_header_curs &curs) { + return curs.elems[curs.index]; +} + +// --- http.Request..Ctor +inline http::Request::Request() { + http::Request_Init(*this); +} + +// --- http.Request..Dtor +inline http::Request::~Request() { + http::Request_Uninit(*this); +} + +// --- http.Response.extension_header.EmptyQ +// Return true if index is empty +inline bool http::extension_header_EmptyQ(http::Response& parent) { + return parent.extension_header_n == 0; +} + +// --- http.Response.extension_header.Find +// Look up row by row id. Return NULL if out of range +inline http::ExtensionHeader* http::extension_header_Find(http::Response& parent, u64 t) { + u64 idx = t; + u64 lim = parent.extension_header_n; + if (idx >= lim) return NULL; + return parent.extension_header_elems + idx; +} + +// --- http.Response.extension_header.Getary +// Return array pointer by value +inline algo::aryptr http::extension_header_Getary(const http::Response& parent) { + return algo::aryptr(parent.extension_header_elems, parent.extension_header_n); +} + +// --- http.Response.extension_header.Last +// Return pointer to last element of array, or NULL if array is empty +inline http::ExtensionHeader* http::extension_header_Last(http::Response& parent) { + return extension_header_Find(parent, u64(parent.extension_header_n-1)); +} + +// --- http.Response.extension_header.Max +// Return max. number of items in the array +inline i32 http::extension_header_Max(http::Response& parent) { + (void)parent; + return parent.extension_header_max; +} + +// --- http.Response.extension_header.N +// Return number of items in the array +inline i32 http::extension_header_N(const http::Response& parent) { + return parent.extension_header_n; +} + +// --- http.Response.extension_header.Reserve +// Make sure N *more* elements will fit in array. Process dies if out of memory +inline void http::extension_header_Reserve(http::Response& parent, int n) { + u32 new_n = parent.extension_header_n + n; + if (UNLIKELY(new_n > parent.extension_header_max)) { + extension_header_AbsReserve(parent, new_n); + } +} + +// --- http.Response.extension_header.qFind +// 'quick' Access row by row id. No bounds checking. +inline http::ExtensionHeader& http::extension_header_qFind(http::Response& parent, u64 t) { + return parent.extension_header_elems[t]; +} + +// --- http.Response.extension_header.qLast +// Return reference to last element of array. No bounds checking +inline http::ExtensionHeader& http::extension_header_qLast(http::Response& parent) { + return extension_header_qFind(parent, u64(parent.extension_header_n-1)); +} + +// --- http.Response.extension_header.rowid_Get +// Return row id of specified element +inline u64 http::extension_header_rowid_Get(http::Response& parent, http::ExtensionHeader &elem) { + u64 id = &elem - parent.extension_header_elems; + return u64(id); +} + +// --- http.Response.extension_header_curs.Next +// proceed to next item +inline void http::Response_extension_header_curs_Next(Response_extension_header_curs &curs) { + curs.index++; +} + +// --- http.Response.extension_header_curs.Reset +inline void http::Response_extension_header_curs_Reset(Response_extension_header_curs &curs, http::Response &parent) { + curs.elems = parent.extension_header_elems; + curs.n_elems = parent.extension_header_n; + curs.index = 0; +} + +// --- http.Response.extension_header_curs.ValidQ +// cursor points to valid item +inline bool http::Response_extension_header_curs_ValidQ(Response_extension_header_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- http.Response.extension_header_curs.Access +// item access +inline http::ExtensionHeader& http::Response_extension_header_curs_Access(Response_extension_header_curs &curs) { + return curs.elems[curs.index]; +} + +// --- http.Response..Ctor +inline http::Response::Response() { + http::Response_Init(*this); +} + +// --- http.Response..Dtor +inline http::Response::~Response() { + http::Response_Uninit(*this); +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const http::ExtensionHeader &row) {// cfmt:http.ExtensionHeader.String + http::ExtensionHeader_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const http::FieldId &row) {// cfmt:http.FieldId.String + http::FieldId_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const http::HeaderType &row) {// cfmt:http.HeaderType.String + http::HeaderType_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const http::Method &row) {// cfmt:http.Method.String + http::Method_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const http::Request &row) {// cfmt:http.Request.String + http::Request_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const http::Response &row) {// cfmt:http.Response.String + http::Response_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/httpdb_gen.h b/include/gen/httpdb_gen.h new file mode 100644 index 00000000..e7159216 --- /dev/null +++ b/include/gen/httpdb_gen.h @@ -0,0 +1,240 @@ +// +// include/gen/httpdb_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- httpdb_FieldIdEnum + +enum httpdb_FieldIdEnum { // httpdb.FieldId.value + httpdb_FieldId_content = 0 + ,httpdb_FieldId_description = 1 + ,httpdb_FieldId_header = 2 + ,httpdb_FieldId_comment = 3 + ,httpdb_FieldId_method = 4 + ,httpdb_FieldId_id = 5 + ,httpdb_FieldId_status = 6 + ,httpdb_FieldId_code = 7 + ,httpdb_FieldId_reason = 8 + ,httpdb_FieldId_version = 9 + ,httpdb_FieldId_value = 10 +}; + +enum { httpdb_FieldIdEnum_N = 11 }; + +namespace httpdb { // gen:ns_pkeytypedef + typedef algo::Smallstr250 ContentPkey; + typedef algo::Smallstr50 HeaderPkey; + typedef algo::Smallstr50 MethodPkey; + typedef algo::Smallstr50 StatusPkey; + typedef algo::Smallstr50 VersionPkey; +} // gen:ns_pkeytypedef +namespace httpdb { // gen:ns_tclass_field +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace httpdb { struct Content; } +namespace httpdb { struct FieldId; } +namespace httpdb { struct Header; } +namespace httpdb { struct Method; } +namespace httpdb { struct Status; } +namespace httpdb { struct Version; } +namespace httpdb { // gen:ns_print_struct + +// --- httpdb.Content +struct Content { // httpdb.Content: core/common Content-Type values + algo::Smallstr250 content; // + algo::cstring description; // + // func:httpdb.Content..Ctor + inline Content() __attribute__((nothrow)); +}; + +// func:httpdb.Content..ReadFieldMaybe +bool Content_ReadFieldMaybe(httpdb::Content& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of httpdb::Content from an ascii string. +// The format of the string is an ssim Tuple +// func:httpdb.Content..ReadStrptrMaybe +bool Content_ReadStrptrMaybe(httpdb::Content &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:httpdb.Content.String printfmt:Tuple +// func:httpdb.Content..Print +void Content_Print(httpdb::Content& row, algo::cstring& str) __attribute__((nothrow)); + +// --- httpdb.FieldId +#pragma pack(push,1) +struct FieldId { // httpdb.FieldId: Field read helper + i32 value; // -1 + // func:httpdb.FieldId.value.Cast + inline operator httpdb_FieldIdEnum() const __attribute__((nothrow)); + // func:httpdb.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:httpdb.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:httpdb.FieldId..EnumCtor + inline FieldId(httpdb_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:httpdb.FieldId.value.GetEnum +inline httpdb_FieldIdEnum value_GetEnum(const httpdb::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:httpdb.FieldId.value.SetEnum +inline void value_SetEnum(httpdb::FieldId& parent, httpdb_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:httpdb.FieldId.value.ToCstr +const char* value_ToCstr(const httpdb::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:httpdb.FieldId.value.Print +void value_Print(const httpdb::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:httpdb.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(httpdb::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:httpdb.FieldId.value.SetStrptr +void value_SetStrptr(httpdb::FieldId& parent, algo::strptr rhs, httpdb_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:httpdb.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(httpdb::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of httpdb::FieldId from an ascii string. +// The format of the string is the format of the httpdb::FieldId's only field +// func:httpdb.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(httpdb::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:httpdb.FieldId..Init +inline void FieldId_Init(httpdb::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:httpdb.FieldId.String printfmt:Raw +// func:httpdb.FieldId..Print +void FieldId_Print(httpdb::FieldId& row, algo::cstring& str) __attribute__((nothrow)); + +// --- httpdb.Header +struct Header { // httpdb.Header + algo::Smallstr50 header; // + algo::Comment comment; // + // func:httpdb.Header..Ctor + inline Header() __attribute__((nothrow)); +}; + +// func:httpdb.Header..ReadFieldMaybe +bool Header_ReadFieldMaybe(httpdb::Header& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of httpdb::Header from an ascii string. +// The format of the string is an ssim Tuple +// func:httpdb.Header..ReadStrptrMaybe +bool Header_ReadStrptrMaybe(httpdb::Header &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:httpdb.Header.String printfmt:Tuple +// func:httpdb.Header..Print +void Header_Print(httpdb::Header& row, algo::cstring& str) __attribute__((nothrow)); + +// --- httpdb.Method +struct Method { // httpdb.Method + algo::Smallstr50 method; // + u8 id; // 0 + algo::Comment comment; // + // func:httpdb.Method..Ctor + inline Method() __attribute__((nothrow)); +}; + +// func:httpdb.Method..ReadFieldMaybe +bool Method_ReadFieldMaybe(httpdb::Method& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of httpdb::Method from an ascii string. +// The format of the string is an ssim Tuple +// func:httpdb.Method..ReadStrptrMaybe +bool Method_ReadStrptrMaybe(httpdb::Method &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:httpdb.Method..Init +inline void Method_Init(httpdb::Method& parent); +// print string representation of ROW to string STR +// cfmt:httpdb.Method.String printfmt:Tuple +// func:httpdb.Method..Print +void Method_Print(httpdb::Method& row, algo::cstring& str) __attribute__((nothrow)); + +// --- httpdb.Status +struct Status { // httpdb.Status + algo::Smallstr50 status; // + // func:httpdb.Status..Ctor + inline Status() __attribute__((nothrow)); +}; + +// func:httpdb.Status.code.Get +u16 code_Get(httpdb::Status& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:httpdb.Status.code.Get2 +u16 Status_code_Get(algo::strptr arg) __attribute__((nothrow)); + +// func:httpdb.Status.reason.Get +algo::Smallstr50 reason_Get(httpdb::Status& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:httpdb.Status.reason.Get2 +algo::Smallstr50 Status_reason_Get(algo::strptr arg) __attribute__((nothrow)); + +// func:httpdb.Status..Concat_code_reason +tempstr Status_Concat_code_reason( u16 code ,const algo::strptr& reason ); +// func:httpdb.Status..ReadFieldMaybe +bool Status_ReadFieldMaybe(httpdb::Status& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of httpdb::Status from an ascii string. +// The format of the string is an ssim Tuple +// func:httpdb.Status..ReadStrptrMaybe +bool Status_ReadStrptrMaybe(httpdb::Status &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:httpdb.Status.String printfmt:Tuple +// func:httpdb.Status..Print +void Status_Print(httpdb::Status& row, algo::cstring& str) __attribute__((nothrow)); + +// --- httpdb.Version +struct Version { // httpdb.Version + algo::Smallstr50 version; // + algo::Comment comment; // + // func:httpdb.Version..Ctor + inline Version() __attribute__((nothrow)); +}; + +// func:httpdb.Version..ReadFieldMaybe +bool Version_ReadFieldMaybe(httpdb::Version& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of httpdb::Version from an ascii string. +// The format of the string is an ssim Tuple +// func:httpdb.Version..ReadStrptrMaybe +bool Version_ReadStrptrMaybe(httpdb::Version &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:httpdb.Version.String printfmt:Tuple +// func:httpdb.Version..Print +void Version_Print(httpdb::Version& row, algo::cstring& str) __attribute__((nothrow)); +} // gen:ns_print_struct +namespace httpdb { // gen:ns_func +} // gen:ns_func +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const httpdb::Content &row);// cfmt:httpdb.Content.String +inline algo::cstring &operator <<(algo::cstring &str, const httpdb::FieldId &row);// cfmt:httpdb.FieldId.String +inline algo::cstring &operator <<(algo::cstring &str, const httpdb::Header &row);// cfmt:httpdb.Header.String +inline algo::cstring &operator <<(algo::cstring &str, const httpdb::Method &row);// cfmt:httpdb.Method.String +inline algo::cstring &operator <<(algo::cstring &str, const httpdb::Status &row);// cfmt:httpdb.Status.String +inline algo::cstring &operator <<(algo::cstring &str, const httpdb::Version &row);// cfmt:httpdb.Version.String +} diff --git a/include/gen/httpdb_gen.inl.h b/include/gen/httpdb_gen.inl.h new file mode 100644 index 00000000..211aae3a --- /dev/null +++ b/include/gen/httpdb_gen.inl.h @@ -0,0 +1,123 @@ +// +// include/gen/httpdb_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude + +// --- httpdb.Content..Ctor +inline httpdb::Content::Content() { +} + +// --- httpdb.FieldId.value.GetEnum +// Get value of field as enum type +inline httpdb_FieldIdEnum httpdb::value_GetEnum(const httpdb::FieldId& parent) { + return httpdb_FieldIdEnum(parent.value); +} + +// --- httpdb.FieldId.value.SetEnum +// Set value of field from enum type. +inline void httpdb::value_SetEnum(httpdb::FieldId& parent, httpdb_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- httpdb.FieldId.value.Cast +inline httpdb::FieldId::operator httpdb_FieldIdEnum() const { + return httpdb_FieldIdEnum((*this).value); +} + +// --- httpdb.FieldId..Init +// Set all fields to initial values. +inline void httpdb::FieldId_Init(httpdb::FieldId& parent) { + parent.value = i32(-1); +} + +// --- httpdb.FieldId..Ctor +inline httpdb::FieldId::FieldId() { + httpdb::FieldId_Init(*this); +} + +// --- httpdb.FieldId..FieldwiseCtor +inline httpdb::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- httpdb.FieldId..EnumCtor +inline httpdb::FieldId::FieldId(httpdb_FieldIdEnum arg) { + this->value = i32(arg); +} + +// --- httpdb.Header..Ctor +inline httpdb::Header::Header() { +} + +// --- httpdb.Method..Init +// Set all fields to initial values. +inline void httpdb::Method_Init(httpdb::Method& parent) { + parent.id = u8(0); +} + +// --- httpdb.Method..Ctor +inline httpdb::Method::Method() { + httpdb::Method_Init(*this); +} + +// --- httpdb.Status..Ctor +inline httpdb::Status::Status() { +} + +// --- httpdb.Version..Ctor +inline httpdb::Version::Version() { +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const httpdb::Content &row) {// cfmt:httpdb.Content.String + httpdb::Content_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const httpdb::FieldId &row) {// cfmt:httpdb.FieldId.String + httpdb::FieldId_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const httpdb::Header &row) {// cfmt:httpdb.Header.String + httpdb::Header_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const httpdb::Method &row) {// cfmt:httpdb.Method.String + httpdb::Method_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const httpdb::Status &row) {// cfmt:httpdb.Status.String + httpdb::Status_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const httpdb::Version &row) {// cfmt:httpdb.Version.String + httpdb::Version_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/ams_cat_gen.h b/include/gen/jkv_gen.h similarity index 54% rename from include/gen/ams_cat_gen.h rename to include/gen/jkv_gen.h index bd552372..5e69d70f 100644 --- a/include/gen/ams_cat_gen.h +++ b/include/gen/jkv_gen.h @@ -1,5 +1,5 @@ // -// include/gen/ams_cat_gen.h +// include/gen/jkv_gen.h // Generated by AMC // // Copyright (C) 2008-2013 AlgoEngineering LLC @@ -24,71 +24,73 @@ #pragma once #include "include/gen/command_gen.h" +#include "include/gen/algo_gen.h" //#pragma endinclude // gen:ns_enums -// --- ams_cat_FieldIdEnum +// --- jkv_FieldIdEnum -enum ams_cat_FieldIdEnum { // ams_cat.FieldId.value - ams_cat_FieldId_value = 0 +enum jkv_FieldIdEnum { // jkv.FieldId.value + jkv_FieldId_value = 0 }; -enum { ams_cat_FieldIdEnum_N = 1 }; +enum { jkv_FieldIdEnum_N = 1 }; -namespace ams_cat { // gen:ns_pkeytypedef +namespace jkv { // gen:ns_pkeytypedef } // gen:ns_pkeytypedef -namespace ams_cat { // gen:ns_tclass_field -extern const char *ams_cat_help; +namespace jkv { // gen:ns_tclass_field +extern const char *jkv_help; } // gen:ns_tclass_field // gen:ns_fwddecl2 -namespace ams_cat { struct trace; } -namespace ams_cat { struct FDb; } -namespace ams_cat { struct FieldId; } -namespace ams_cat { extern struct ams_cat::FDb _db; } -namespace ams_cat { // gen:ns_print_struct +namespace jkv { struct trace; } +namespace jkv { struct FDb; } +namespace jkv { struct FieldId; } +namespace jkv { extern struct jkv::FDb _db; } +namespace jkv { // gen:ns_print_struct -// --- ams_cat.trace +// --- jkv.trace #pragma pack(push,1) -struct trace { // ams_cat.trace - // func:ams_cat.trace..Ctor +struct trace { // jkv.trace + // func:jkv.trace..Ctor inline trace() __attribute__((nothrow)); }; #pragma pack(pop) // print string representation of ROW to string STR -// cfmt:ams_cat.trace.String printfmt:Tuple -// func:ams_cat.trace..Print -void trace_Print(ams_cat::trace& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:jkv.trace.String printfmt:Tuple +// func:jkv.trace..Print +void trace_Print(jkv::trace& row, algo::cstring& str) __attribute__((nothrow)); -// --- ams_cat.FDb -// create: ams_cat.FDb._db (Global) -struct FDb { // ams_cat.FDb: In-memory database for ams_cat - command::ams_cat cmdline; // - ams_cat::trace trace; // +// --- jkv.FDb +// create: jkv.FDb._db (Global) +struct FDb { // jkv.FDb + command::jkv cmdline; // + algo::cstring last_kv; // + jkv::trace trace; // }; // Read argc,argv directly into the fields of the command line(s) // The following fields are updated: -// ams_cat.FDb.cmdline +// jkv.FDb.cmdline // algo_lib.FDb.cmdline -// func:ams_cat.FDb._db.ReadArgv +// func:jkv.FDb._db.ReadArgv void ReadArgv() __attribute__((nothrow)); // Main loop. -// func:ams_cat.FDb._db.MainLoop +// func:jkv.FDb._db.MainLoop void MainLoop(); // Main step -// func:ams_cat.FDb._db.Step +// func:jkv.FDb._db.Step void Step(); // Main function -// func:ams_cat.FDb._db.Main +// func:jkv.FDb._db.Main // this function is 'extrn' and implemented by user void Main(); // Parse strptr into known type and add to database. // Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text -// func:ams_cat.FDb._db.InsertStrptrMaybe +// func:jkv.FDb._db.InsertStrptrMaybe bool InsertStrptrMaybe(algo::strptr str); // Load all finputs from given directory. -// func:ams_cat.FDb._db.LoadTuplesMaybe +// func:jkv.FDb._db.LoadTuplesMaybe bool LoadTuplesMaybe(algo::strptr root, bool recursive) __attribute__((nothrow)); // Load all finputs from given file. // Read tuples from file FNAME into this namespace's in-memory database. @@ -96,94 +98,94 @@ bool LoadTuplesMaybe(algo::strptr root, bool recursive) __attrib // It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). // Function returns TRUE if all records were parsed and inserted without error. // If the function returns FALSE, use algo_lib::DetachBadTags() for error description -// func:ams_cat.FDb._db.LoadTuplesFile +// func:jkv.FDb._db.LoadTuplesFile bool LoadTuplesFile(algo::strptr fname, bool recursive) __attribute__((nothrow)); // Load all finputs from given file descriptor. -// func:ams_cat.FDb._db.LoadTuplesFd +// func:jkv.FDb._db.LoadTuplesFd bool LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) __attribute__((nothrow)); // Load specified ssimfile. -// func:ams_cat.FDb._db.LoadSsimfileMaybe +// func:jkv.FDb._db.LoadSsimfileMaybe bool LoadSsimfileMaybe(algo::strptr fname, bool recursive) __attribute__((nothrow)); // Calls Step function of dependencies -// func:ams_cat.FDb._db.Steps +// func:jkv.FDb._db.Steps void Steps(); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:ams_cat.FDb._db.XrefMaybe +// func:jkv.FDb._db.XrefMaybe bool _db_XrefMaybe(); // Set all fields to initial values. -// func:ams_cat.FDb..Init +// func:jkv.FDb..Init void FDb_Init(); -// func:ams_cat.FDb..Uninit +// func:jkv.FDb..Uninit inline void FDb_Uninit() __attribute__((nothrow)); -// --- ams_cat.FieldId +// --- jkv.FieldId #pragma pack(push,1) -struct FieldId { // ams_cat.FieldId: Field read helper +struct FieldId { // jkv.FieldId: Field read helper i32 value; // -1 - // func:ams_cat.FieldId.value.Cast - inline operator ams_cat_FieldIdEnum() const __attribute__((nothrow)); - // func:ams_cat.FieldId..Ctor + // func:jkv.FieldId.value.Cast + inline operator jkv_FieldIdEnum() const __attribute__((nothrow)); + // func:jkv.FieldId..Ctor inline FieldId() __attribute__((nothrow)); - // func:ams_cat.FieldId..FieldwiseCtor + // func:jkv.FieldId..FieldwiseCtor explicit inline FieldId(i32 in_value) __attribute__((nothrow)); - // func:ams_cat.FieldId..EnumCtor - inline FieldId(ams_cat_FieldIdEnum arg) __attribute__((nothrow)); + // func:jkv.FieldId..EnumCtor + inline FieldId(jkv_FieldIdEnum arg) __attribute__((nothrow)); }; #pragma pack(pop) // Get value of field as enum type -// func:ams_cat.FieldId.value.GetEnum -inline ams_cat_FieldIdEnum value_GetEnum(const ams_cat::FieldId& parent) __attribute__((nothrow)); +// func:jkv.FieldId.value.GetEnum +inline jkv_FieldIdEnum value_GetEnum(const jkv::FieldId& parent) __attribute__((nothrow)); // Set value of field from enum type. -// func:ams_cat.FieldId.value.SetEnum -inline void value_SetEnum(ams_cat::FieldId& parent, ams_cat_FieldIdEnum rhs) __attribute__((nothrow)); +// func:jkv.FieldId.value.SetEnum +inline void value_SetEnum(jkv::FieldId& parent, jkv_FieldIdEnum rhs) __attribute__((nothrow)); // Convert numeric value of field to one of predefined string constants. // If string is found, return a static C string. Otherwise, return NULL. -// func:ams_cat.FieldId.value.ToCstr -const char* value_ToCstr(const ams_cat::FieldId& parent) __attribute__((nothrow)); +// func:jkv.FieldId.value.ToCstr +const char* value_ToCstr(const jkv::FieldId& parent) __attribute__((nothrow)); // Convert value to a string. First, attempt conversion to a known string. // If no string matches, print value as a numeric value. -// func:ams_cat.FieldId.value.Print -void value_Print(const ams_cat::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// func:jkv.FieldId.value.Print +void value_Print(const jkv::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); // Convert string to field. // If the string is invalid, do not modify field and return false. // In case of success, return true -// func:ams_cat.FieldId.value.SetStrptrMaybe -bool value_SetStrptrMaybe(ams_cat::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// func:jkv.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(jkv::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); // Convert string to field. // If the string is invalid, set numeric value to DFLT -// func:ams_cat.FieldId.value.SetStrptr -void value_SetStrptr(ams_cat::FieldId& parent, algo::strptr rhs, ams_cat_FieldIdEnum dflt) __attribute__((nothrow)); +// func:jkv.FieldId.value.SetStrptr +void value_SetStrptr(jkv::FieldId& parent, algo::strptr rhs, jkv_FieldIdEnum dflt) __attribute__((nothrow)); // Convert string to field. Return success value -// func:ams_cat.FieldId.value.ReadStrptrMaybe -bool value_ReadStrptrMaybe(ams_cat::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// func:jkv.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(jkv::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); -// Read fields of ams_cat::FieldId from an ascii string. -// The format of the string is the format of the ams_cat::FieldId's only field -// func:ams_cat.FieldId..ReadStrptrMaybe -bool FieldId_ReadStrptrMaybe(ams_cat::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Read fields of jkv::FieldId from an ascii string. +// The format of the string is the format of the jkv::FieldId's only field +// func:jkv.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(jkv::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); // Set all fields to initial values. -// func:ams_cat.FieldId..Init -inline void FieldId_Init(ams_cat::FieldId& parent); +// func:jkv.FieldId..Init +inline void FieldId_Init(jkv::FieldId& parent); // print string representation of ROW to string STR -// cfmt:ams_cat.FieldId.String printfmt:Raw -// func:ams_cat.FieldId..Print -void FieldId_Print(ams_cat::FieldId& row, algo::cstring& str) __attribute__((nothrow)); +// cfmt:jkv.FieldId.String printfmt:Raw +// func:jkv.FieldId..Print +void FieldId_Print(jkv::FieldId& row, algo::cstring& str) __attribute__((nothrow)); } // gen:ns_print_struct -namespace ams_cat { // gen:ns_func -// func:ams_cat...StaticCheck +namespace jkv { // gen:ns_func +// func:jkv...StaticCheck void StaticCheck(); } // gen:ns_func -// func:ams_cat...main +// func:jkv...main int main(int argc, char **argv); #if defined(WIN32) -// func:ams_cat...WinMain +// func:jkv...WinMain int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int); #endif // gen:ns_operators namespace algo { -inline algo::cstring &operator <<(algo::cstring &str, const ams_cat::trace &row);// cfmt:ams_cat.trace.String -inline algo::cstring &operator <<(algo::cstring &str, const ams_cat::FieldId &row);// cfmt:ams_cat.FieldId.String +inline algo::cstring &operator <<(algo::cstring &str, const jkv::trace &row);// cfmt:jkv.trace.String +inline algo::cstring &operator <<(algo::cstring &str, const jkv::FieldId &row);// cfmt:jkv.FieldId.String } diff --git a/include/gen/ams_cat_gen.inl.h b/include/gen/jkv_gen.inl.h similarity index 51% rename from include/gen/ams_cat_gen.inl.h rename to include/gen/jkv_gen.inl.h index 04fdf731..41fe6ae2 100644 --- a/include/gen/ams_cat_gen.inl.h +++ b/include/gen/jkv_gen.inl.h @@ -1,5 +1,5 @@ // -// include/gen/ams_cat_gen.inl.h +// include/gen/jkv_gen.inl.h // Generated by AMC // // Copyright (C) 2008-2013 AlgoEngineering LLC @@ -24,62 +24,63 @@ #pragma once #include "include/gen/command_gen.inl.h" +#include "include/gen/algo_gen.inl.h" //#pragma endinclude -// --- ams_cat.trace..Ctor -inline ams_cat::trace::trace() { +// --- jkv.trace..Ctor +inline jkv::trace::trace() { } -// --- ams_cat.FDb..Uninit -inline void ams_cat::FDb_Uninit() { - ams_cat::FDb &row = _db; (void)row; +// --- jkv.FDb..Uninit +inline void jkv::FDb_Uninit() { + jkv::FDb &row = _db; (void)row; } -// --- ams_cat.FieldId.value.GetEnum +// --- jkv.FieldId.value.GetEnum // Get value of field as enum type -inline ams_cat_FieldIdEnum ams_cat::value_GetEnum(const ams_cat::FieldId& parent) { - return ams_cat_FieldIdEnum(parent.value); +inline jkv_FieldIdEnum jkv::value_GetEnum(const jkv::FieldId& parent) { + return jkv_FieldIdEnum(parent.value); } -// --- ams_cat.FieldId.value.SetEnum +// --- jkv.FieldId.value.SetEnum // Set value of field from enum type. -inline void ams_cat::value_SetEnum(ams_cat::FieldId& parent, ams_cat_FieldIdEnum rhs) { +inline void jkv::value_SetEnum(jkv::FieldId& parent, jkv_FieldIdEnum rhs) { parent.value = i32(rhs); } -// --- ams_cat.FieldId.value.Cast -inline ams_cat::FieldId::operator ams_cat_FieldIdEnum() const { - return ams_cat_FieldIdEnum((*this).value); +// --- jkv.FieldId.value.Cast +inline jkv::FieldId::operator jkv_FieldIdEnum() const { + return jkv_FieldIdEnum((*this).value); } -// --- ams_cat.FieldId..Init +// --- jkv.FieldId..Init // Set all fields to initial values. -inline void ams_cat::FieldId_Init(ams_cat::FieldId& parent) { +inline void jkv::FieldId_Init(jkv::FieldId& parent) { parent.value = i32(-1); } -// --- ams_cat.FieldId..Ctor -inline ams_cat::FieldId::FieldId() { - ams_cat::FieldId_Init(*this); +// --- jkv.FieldId..Ctor +inline jkv::FieldId::FieldId() { + jkv::FieldId_Init(*this); } -// --- ams_cat.FieldId..FieldwiseCtor -inline ams_cat::FieldId::FieldId(i32 in_value) +// --- jkv.FieldId..FieldwiseCtor +inline jkv::FieldId::FieldId(i32 in_value) : value(in_value) { } -// --- ams_cat.FieldId..EnumCtor -inline ams_cat::FieldId::FieldId(ams_cat_FieldIdEnum arg) { +// --- jkv.FieldId..EnumCtor +inline jkv::FieldId::FieldId(jkv_FieldIdEnum arg) { this->value = i32(arg); } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams_cat::trace &row) {// cfmt:ams_cat.trace.String - ams_cat::trace_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const jkv::trace &row) {// cfmt:jkv.trace.String + jkv::trace_Print(const_cast(row), str); return str; } -inline algo::cstring &algo::operator <<(algo::cstring &str, const ams_cat::FieldId &row) {// cfmt:ams_cat.FieldId.String - ams_cat::FieldId_Print(const_cast(row), str); +inline algo::cstring &algo::operator <<(algo::cstring &str, const jkv::FieldId &row) {// cfmt:jkv.FieldId.String + jkv::FieldId_Print(const_cast(row), str); return str; } diff --git a/include/gen/kafka_gen.h b/include/gen/kafka_gen.h new file mode 100644 index 00000000..3cca7b5e --- /dev/null +++ b/include/gen/kafka_gen.h @@ -0,0 +1,1828 @@ +// +// include/gen/kafka_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- kafka_AclOperationTypeEnum + +enum kafka_AclOperationTypeEnum { // kafka.AclOperationType.value + kafka_AclOperationType_UNKNOWN = 0 + ,kafka_AclOperationType_ANY = 1 + ,kafka_AclOperationType_ALL = 2 + ,kafka_AclOperationType_READ = 3 + ,kafka_AclOperationType_WRITE = 4 + ,kafka_AclOperationType_CREATE = 5 + ,kafka_AclOperationType_DELETE = 6 + ,kafka_AclOperationType_ALTER = 7 + ,kafka_AclOperationType_DESCRIBE = 8 + ,kafka_AclOperationType_CLUSTER_ACTION = 9 + ,kafka_AclOperationType_DESCRIBE_CONFIGS = 10 + ,kafka_AclOperationType_ALTER_CONFIGS = 11 + ,kafka_AclOperationType_IDEMPOTENT_WRITE = 12 + ,kafka_AclOperationType_CREATE_TOKENS = 13 + ,kafka_AclOperationType_DESCRIBE_TOKENS = 14 +}; + +enum { kafka_AclOperationTypeEnum_N = 15 }; + + +// --- kafka_AclOperationsEnum + +enum kafka_AclOperationsEnum { // kafka.AclOperations.value + kafka_AclOperations_UNKNOWN = 0x1 // kafka.AclOperations.UNKNOWN + ,kafka_AclOperations_ANY = 0x2 // kafka.AclOperations.ANY + ,kafka_AclOperations_ALL = 0x4 // kafka.AclOperations.ALL + ,kafka_AclOperations_READ = 0x8 // kafka.AclOperations.READ + ,kafka_AclOperations_WRITE = 0x10 // kafka.AclOperations.WRITE + ,kafka_AclOperations_CREATE = 0x20 // kafka.AclOperations.CREATE + ,kafka_AclOperations_DELETE = 0x40 // kafka.AclOperations.DELETE + ,kafka_AclOperations_ALTER = 0x80 // kafka.AclOperations.ALTER + ,kafka_AclOperations_DESCRIBE = 0x100 // kafka.AclOperations.DESCRIBE + ,kafka_AclOperations_CLUSTER_ACTION = 0x200 // kafka.AclOperations.CLUSTER_ACTION + ,kafka_AclOperations_DESCRIBE_CONFIGS = 0x400 // kafka.AclOperations.DESCRIBE_CONFIGS + ,kafka_AclOperations_ALTER_CONFIGS = 0x800 // kafka.AclOperations.ALTER_CONFIGS + ,kafka_AclOperations_IDEMPOTENT_WRITE = 0x1000 // kafka.AclOperations.IDEMPOTENT_WRITE + ,kafka_AclOperations_CREATE_TOKENS = 0x2000 // kafka.AclOperations.CREATE_TOKENS + ,kafka_AclOperations_DESCRIBE_TOKENS = 0x4000 // kafka.AclOperations.DESCRIBE_TOKENS + ,kafka_AclOperations_OMITTED = 0x80000000 // kafka.AclOperations.OMITTED +}; + +enum { kafka_AclOperationsEnum_N = 16 }; + + +// --- kafka_AclPermissionTypeEnum + +enum kafka_AclPermissionTypeEnum { // kafka.AclPermissionType.value + kafka_AclPermissionType_UNKNOWN = 0 + ,kafka_AclPermissionType_ANY = 1 + ,kafka_AclPermissionType_DENY = 2 + ,kafka_AclPermissionType_ALLOW = 3 +}; + +enum { kafka_AclPermissionTypeEnum_N = 4 }; + + +// --- kafka_CompressionTypeEnum + +enum kafka_CompressionTypeEnum { // kafka.CompressionType.value + kafka_CompressionType_no_compression = 0 + ,kafka_CompressionType_gzip = 1 + ,kafka_CompressionType_snappy = 2 + ,kafka_CompressionType_lz4 = 3 + ,kafka_CompressionType_zstd = 4 +}; + +enum { kafka_CompressionTypeEnum_N = 5 }; + + +// --- kafka_ConfigSourceEnum + +enum kafka_ConfigSourceEnum { // kafka.ConfigSource.value + kafka_ConfigSource_UNKNOWN = 0 + ,kafka_ConfigSource_TOPIC_CONFIG = 1 + ,kafka_ConfigSource_DYNAMIC_BROKER_CONFIG = 2 + ,kafka_ConfigSource_DYNAMIC_DEFAULT_BROKER_CONFIG = 3 + ,kafka_ConfigSource_STATIC_BROKER_CONFIG = 4 + ,kafka_ConfigSource_DEFAULT_CONFIG = 5 + ,kafka_ConfigSource_DYNAMIC_BROKER_LOGGER_CONFIG = 6 + ,kafka_ConfigSource_CLIENT_METRICS_CONFIG = 7 + ,kafka_ConfigSource_GROUP_CONFIG = 8 +}; + +enum { kafka_ConfigSourceEnum_N = 9 }; + + +// --- kafka_ConfigTypeEnum + +enum kafka_ConfigTypeEnum { // kafka.ConfigType.value + kafka_ConfigType_UNKNOWN = 0 + ,kafka_ConfigType_BOOLEAN = 1 + ,kafka_ConfigType_STRING = 2 + ,kafka_ConfigType_INT = 3 + ,kafka_ConfigType_SHORT = 4 + ,kafka_ConfigType_LONG = 5 + ,kafka_ConfigType_DOUBLE = 6 + ,kafka_ConfigType_LIST = 7 + ,kafka_ConfigType_CLASS = 8 + ,kafka_ConfigType_PASSWORD = 9 +}; + +enum { kafka_ConfigTypeEnum_N = 10 }; + + +// --- kafka_FieldIdEnum + +enum kafka_FieldIdEnum { // kafka.FieldId.value + kafka_FieldId_value = 0 + ,kafka_FieldId_UNKNOWN = 1 + ,kafka_FieldId_ANY = 2 + ,kafka_FieldId_ALL = 3 + ,kafka_FieldId_READ = 4 + ,kafka_FieldId_WRITE = 5 + ,kafka_FieldId_CREATE = 6 + ,kafka_FieldId_DELETE = 7 + ,kafka_FieldId_ALTER = 8 + ,kafka_FieldId_DESCRIBE = 9 + ,kafka_FieldId_CLUSTER_ACTION = 10 + ,kafka_FieldId_DESCRIBE_CONFIGS = 11 + ,kafka_FieldId_ALTER_CONFIGS = 12 + ,kafka_FieldId_IDEMPOTENT_WRITE = 13 + ,kafka_FieldId_CREATE_TOKENS = 14 + ,kafka_FieldId_DESCRIBE_TOKENS = 15 + ,kafka_FieldId_OMITTED = 16 + ,kafka_FieldId_key = 17 + ,kafka_FieldId_base = 18 + ,kafka_FieldId_type = 19 + ,kafka_FieldId_version = 20 + ,kafka_FieldId_group = 21 + ,kafka_FieldId_topic = 22 + ,kafka_FieldId_partition = 23 + ,kafka_FieldId_attributes = 24 + ,kafka_FieldId_pmask = 25 + ,kafka_FieldId_timestamp_delta = 26 + ,kafka_FieldId_offset_delta = 27 + ,kafka_FieldId_headers = 28 + ,kafka_FieldId_base_offset = 29 + ,kafka_FieldId_partition_leader_epoch = 30 + ,kafka_FieldId_magic = 31 + ,kafka_FieldId_crc = 32 + ,kafka_FieldId_last_offset_delta = 33 + ,kafka_FieldId_base_timestamp = 34 + ,kafka_FieldId_max_timestamp = 35 + ,kafka_FieldId_producer_id = 36 + ,kafka_FieldId_producer_epoch = 37 + ,kafka_FieldId_base_sequence = 38 + ,kafka_FieldId_records = 39 +}; + +enum { kafka_FieldIdEnum_N = 40 }; + + +// --- kafka_GroupRecordKeyHeader_type_Enum + +enum kafka_GroupRecordKeyHeader_type_Enum { // kafka.GroupRecordKeyHeader.type + kafka_GroupRecordKeyHeader_type_kafka_OffsetCommitKey = 1 +}; + +enum { kafka_GroupRecordKeyHeader_type_Enum_N = 1 }; + + +// --- kafka_GroupRecordKeyHeaderMsgsCaseEnum + +enum kafka_GroupRecordKeyHeaderMsgsCaseEnum { // kafka.GroupRecordKeyHeaderMsgsCase.value + kafka_GroupRecordKeyHeaderMsgsCase_kafka_OffsetCommitKey = 1 +}; + +enum { kafka_GroupRecordKeyHeaderMsgsCaseEnum_N = 1 }; + + +// --- kafka_GroupRecordValueHeader_type_Enum + +enum kafka_GroupRecordValueHeader_type_Enum { // kafka.GroupRecordValueHeader.type + kafka_GroupRecordValueHeader_type_kafka_OffsetCommitValue = 1 +}; + +enum { kafka_GroupRecordValueHeader_type_Enum_N = 1 }; + + +// --- kafka_GroupRecordValueHeaderMsgsCaseEnum + +enum kafka_GroupRecordValueHeaderMsgsCaseEnum { // kafka.GroupRecordValueHeaderMsgsCase.value + kafka_GroupRecordValueHeaderMsgsCase_kafka_OffsetCommitValue = 1 +}; + +enum { kafka_GroupRecordValueHeaderMsgsCaseEnum_N = 1 }; + + +// --- kafka_GroupStateEnum + +enum kafka_GroupStateEnum { // kafka.GroupState.value + kafka_GroupState_Unknown = 0 + ,kafka_GroupState_PreparingRebalance = 1 + ,kafka_GroupState_CompletingRebalance = 2 + ,kafka_GroupState_Stable = 3 + ,kafka_GroupState_Dead = 4 + ,kafka_GroupState_Empty = 5 + ,kafka_GroupState_Assigning = 6 + ,kafka_GroupState_Reconciling = 7 + ,kafka_GroupState_NotReady = 8 +}; + +enum { kafka_GroupStateEnum_N = 9 }; + + +// --- kafka_PatternTypeEnum + +enum kafka_PatternTypeEnum { // kafka.PatternType.value + kafka_PatternType_UNKNOWN = 0 // Client is too old + ,kafka_PatternType_ANY = 1 // In a filter, matches any resource pattern type + ,kafka_PatternType_MATCH = 2 // In a filter, pattern matching + ,kafka_PatternType_LITERAL = 3 // Literal resource name, or * for any + ,kafka_PatternType_PREFIXED = 4 // Prefix for a resource +}; + +enum { kafka_PatternTypeEnum_N = 5 }; + + +// --- kafka_ResourceTypeEnum + +enum kafka_ResourceTypeEnum { // kafka.ResourceType.value + kafka_ResourceType_UNKNOWN = 0 + ,kafka_ResourceType_ANY = 1 + ,kafka_ResourceType_TOPIC = 2 + ,kafka_ResourceType_GROUP = 3 + ,kafka_ResourceType_CLUSTER = 4 + ,kafka_ResourceType_TRANSACTIONAL_ID = 5 + ,kafka_ResourceType_DELEGATION_TOKEN = 6 + ,kafka_ResourceType_USER = 7 +}; + +enum { kafka_ResourceTypeEnum_N = 8 }; + + +// --- kafka_TimestampTypeEnum + +enum kafka_TimestampTypeEnum { // kafka.TimestampType.value + kafka_TimestampType_create_time = 0 + ,kafka_TimestampType_log_append_time = 1 +}; + +enum { kafka_TimestampTypeEnum_N = 2 }; + +namespace kafka { // gen:ns_pkeytypedef +} // gen:ns_pkeytypedef +namespace kafka { // gen:ns_tclass_field +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace kafka { struct GroupRecordKeyHeader; } +namespace kafka { struct GroupRecordValueHeader; } +namespace kafka { struct OffsetCommitKey; } +namespace kafka { struct OffsetCommitValue; } +namespace kafka { struct Frame_payload_curs; } +namespace kafka { struct Record_headers_curs; } +namespace kafka { struct RecordBatch_records_curs; } +namespace kafka { struct AclOperationType; } +namespace kafka { struct AclOperations; } +namespace kafka { struct AclPermissionType; } +namespace kafka { struct CompressionType; } +namespace kafka { struct ConfigSource; } +namespace kafka { struct ConfigType; } +namespace kafka { struct Error; } +namespace kafka { struct FieldId; } +namespace kafka { struct Frame; } +namespace kafka { struct Frame_curs; } +namespace kafka { struct GroupRecordKeyHeaderMsgsCase; } +namespace kafka { struct GroupRecordValueHeaderMsgsCase; } +namespace kafka { struct GroupState; } +namespace kafka { struct Header; } +namespace kafka { struct PatternType; } +namespace kafka { struct Record; } +namespace kafka { struct RecordBatch; } +namespace kafka { struct ResourceType; } +namespace kafka { struct TimestampType; } +namespace kafka { // gen:ns_print_struct + +// --- kafka.AclOperationType +#pragma pack(push,1) +struct AclOperationType { // kafka.AclOperationType: AclOperation type + u8 value; // 0 + // func:kafka.AclOperationType..Ctor + inline AclOperationType() __attribute__((nothrow)); + // func:kafka.AclOperationType..FieldwiseCtor + explicit inline AclOperationType(u8 in_value) __attribute__((nothrow)); + // func:kafka.AclOperationType..EnumCtor + inline AclOperationType(kafka_AclOperationTypeEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:kafka.AclOperationType.value.GetEnum +inline kafka_AclOperationTypeEnum value_GetEnum(const kafka::AclOperationType& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.AclOperationType.value.SetEnum +inline void value_SetEnum(kafka::AclOperationType& parent, kafka_AclOperationTypeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.AclOperationType.value.ToCstr +const char* value_ToCstr(const kafka::AclOperationType& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.AclOperationType.value.Print +void value_Print(const kafka::AclOperationType& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.AclOperationType.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::AclOperationType& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.AclOperationType.value.SetStrptr +void value_SetStrptr(kafka::AclOperationType& parent, algo::strptr rhs, kafka_AclOperationTypeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.AclOperationType.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::AclOperationType& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of kafka::AclOperationType from an ascii string. +// The format of the string is the format of the kafka::AclOperationType's only field +// func:kafka.AclOperationType..ReadStrptrMaybe +bool AclOperationType_ReadStrptrMaybe(kafka::AclOperationType &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.AclOperationType..Init +inline void AclOperationType_Init(kafka::AclOperationType& parent); +// print string representation of ROW to string STR +// cfmt:kafka.AclOperationType.String printfmt:Raw +// func:kafka.AclOperationType..Print +void AclOperationType_Print(kafka::AclOperationType& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.AclOperations +struct AclOperations { // kafka.AclOperations: ACL operations + i32 value; // 0 + // func:kafka.AclOperations.value.Cast + inline operator kafka_AclOperationsEnum() const __attribute__((nothrow)); + // func:kafka.AclOperations..Ctor + inline AclOperations() __attribute__((nothrow)); + // func:kafka.AclOperations..FieldwiseCtor + explicit inline AclOperations(i32 in_value) __attribute__((nothrow)); + // func:kafka.AclOperations..EnumCtor + inline AclOperations(kafka_AclOperationsEnum arg) __attribute__((nothrow)); +}; + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 0. +// func:kafka.AclOperations.UNKNOWN.Get +inline bool UNKNOWN_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 0. +// func:kafka.AclOperations.UNKNOWN.Set +inline void UNKNOWN_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 1. +// func:kafka.AclOperations.ANY.Get +inline bool ANY_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 1. +// func:kafka.AclOperations.ANY.Set +inline void ANY_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 2. +// func:kafka.AclOperations.ALL.Get +inline bool ALL_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 2. +// func:kafka.AclOperations.ALL.Set +inline void ALL_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 3. +// func:kafka.AclOperations.READ.Get +inline bool READ_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 3. +// func:kafka.AclOperations.READ.Set +inline void READ_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 4. +// func:kafka.AclOperations.WRITE.Get +inline bool WRITE_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 4. +// func:kafka.AclOperations.WRITE.Set +inline void WRITE_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 5. +// func:kafka.AclOperations.CREATE.Get +inline bool CREATE_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 5. +// func:kafka.AclOperations.CREATE.Set +inline void CREATE_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 6. +// func:kafka.AclOperations.DELETE.Get +inline bool DELETE_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 6. +// func:kafka.AclOperations.DELETE.Set +inline void DELETE_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 7. +// func:kafka.AclOperations.ALTER.Get +inline bool ALTER_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 7. +// func:kafka.AclOperations.ALTER.Set +inline void ALTER_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 8. +// func:kafka.AclOperations.DESCRIBE.Get +inline bool DESCRIBE_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 8. +// func:kafka.AclOperations.DESCRIBE.Set +inline void DESCRIBE_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 9. +// func:kafka.AclOperations.CLUSTER_ACTION.Get +inline bool CLUSTER_ACTION_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 9. +// func:kafka.AclOperations.CLUSTER_ACTION.Set +inline void CLUSTER_ACTION_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 10. +// func:kafka.AclOperations.DESCRIBE_CONFIGS.Get +inline bool DESCRIBE_CONFIGS_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 10. +// func:kafka.AclOperations.DESCRIBE_CONFIGS.Set +inline void DESCRIBE_CONFIGS_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 11. +// func:kafka.AclOperations.ALTER_CONFIGS.Get +inline bool ALTER_CONFIGS_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 11. +// func:kafka.AclOperations.ALTER_CONFIGS.Set +inline void ALTER_CONFIGS_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 12. +// func:kafka.AclOperations.IDEMPOTENT_WRITE.Get +inline bool IDEMPOTENT_WRITE_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 12. +// func:kafka.AclOperations.IDEMPOTENT_WRITE.Set +inline void IDEMPOTENT_WRITE_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 13. +// func:kafka.AclOperations.CREATE_TOKENS.Get +inline bool CREATE_TOKENS_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 13. +// func:kafka.AclOperations.CREATE_TOKENS.Set +inline void CREATE_TOKENS_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 14. +// func:kafka.AclOperations.DESCRIBE_TOKENS.Get +inline bool DESCRIBE_TOKENS_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 14. +// func:kafka.AclOperations.DESCRIBE_TOKENS.Set +inline void DESCRIBE_TOKENS_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field value +// 1 bits starting at bit 31. +// func:kafka.AclOperations.OMITTED.Get +inline bool OMITTED_Get(const kafka::AclOperations& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'value' +// 1 bits starting at bit 31. +// func:kafka.AclOperations.OMITTED.Set +inline void OMITTED_Set(kafka::AclOperations& parent, bool rhs) __attribute__((nothrow)); + +// func:kafka.AclOperations..ReadFieldMaybe +bool AclOperations_ReadFieldMaybe(kafka::AclOperations& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of kafka::AclOperations from an ascii string. +// func:kafka.AclOperations..ReadStrptrMaybe +bool AclOperations_ReadStrptrMaybe(kafka::AclOperations &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.AclOperations..Init +void AclOperations_Init(kafka::AclOperations& parent); +// print string representation of ROW to string STR +// cfmt:kafka.AclOperations.String printfmt:Bitset +// func:kafka.AclOperations..Print +void AclOperations_Print(kafka::AclOperations row, algo::cstring& str) __attribute__((nothrow)); +// func:kafka.AclOperations..GetAnon +algo::strptr AclOperations_GetAnon(kafka::AclOperations &parent, i32 idx) __attribute__((nothrow)); + +// --- kafka.AclPermissionType +#pragma pack(push,1) +struct AclPermissionType { // kafka.AclPermissionType: AclPermission type + u8 value; // 0 + // func:kafka.AclPermissionType..Ctor + inline AclPermissionType() __attribute__((nothrow)); + // func:kafka.AclPermissionType..FieldwiseCtor + explicit inline AclPermissionType(u8 in_value) __attribute__((nothrow)); + // func:kafka.AclPermissionType..EnumCtor + inline AclPermissionType(kafka_AclPermissionTypeEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:kafka.AclPermissionType.value.GetEnum +inline kafka_AclPermissionTypeEnum value_GetEnum(const kafka::AclPermissionType& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.AclPermissionType.value.SetEnum +inline void value_SetEnum(kafka::AclPermissionType& parent, kafka_AclPermissionTypeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.AclPermissionType.value.ToCstr +const char* value_ToCstr(const kafka::AclPermissionType& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.AclPermissionType.value.Print +void value_Print(const kafka::AclPermissionType& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.AclPermissionType.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::AclPermissionType& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.AclPermissionType.value.SetStrptr +void value_SetStrptr(kafka::AclPermissionType& parent, algo::strptr rhs, kafka_AclPermissionTypeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.AclPermissionType.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::AclPermissionType& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of kafka::AclPermissionType from an ascii string. +// The format of the string is the format of the kafka::AclPermissionType's only field +// func:kafka.AclPermissionType..ReadStrptrMaybe +bool AclPermissionType_ReadStrptrMaybe(kafka::AclPermissionType &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.AclPermissionType..Init +inline void AclPermissionType_Init(kafka::AclPermissionType& parent); +// print string representation of ROW to string STR +// cfmt:kafka.AclPermissionType.String printfmt:Raw +// func:kafka.AclPermissionType..Print +void AclPermissionType_Print(kafka::AclPermissionType& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.CompressionType +struct CompressionType { // kafka.CompressionType + u8 value; // 0 + // func:kafka.CompressionType..Ctor + inline CompressionType() __attribute__((nothrow)); + // func:kafka.CompressionType..FieldwiseCtor + explicit inline CompressionType(u8 in_value) __attribute__((nothrow)); + // func:kafka.CompressionType..EnumCtor + inline CompressionType(kafka_CompressionTypeEnum arg) __attribute__((nothrow)); +}; + +// Get value of field as enum type +// func:kafka.CompressionType.value.GetEnum +inline kafka_CompressionTypeEnum value_GetEnum(const kafka::CompressionType& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.CompressionType.value.SetEnum +inline void value_SetEnum(kafka::CompressionType& parent, kafka_CompressionTypeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.CompressionType.value.ToCstr +const char* value_ToCstr(const kafka::CompressionType& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.CompressionType.value.Print +void value_Print(const kafka::CompressionType& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.CompressionType.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::CompressionType& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.CompressionType.value.SetStrptr +void value_SetStrptr(kafka::CompressionType& parent, algo::strptr rhs, kafka_CompressionTypeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.CompressionType.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::CompressionType& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of kafka::CompressionType from an ascii string. +// The format of the string is the format of the kafka::CompressionType's only field +// func:kafka.CompressionType..ReadStrptrMaybe +bool CompressionType_ReadStrptrMaybe(kafka::CompressionType &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.CompressionType..Init +inline void CompressionType_Init(kafka::CompressionType& parent); +// print string representation of ROW to string STR +// cfmt:kafka.CompressionType.String printfmt:Raw +// func:kafka.CompressionType..Print +void CompressionType_Print(kafka::CompressionType& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.ConfigSource +#pragma pack(push,1) +struct ConfigSource { // kafka.ConfigSource: Config type + u8 value; // 0 + // func:kafka.ConfigSource..EqOp + inline bool operator ==(const kafka::ConfigSource &rhs) const __attribute__((nothrow)); + // func:kafka.ConfigSource..NeOp + inline bool operator !=(const kafka::ConfigSource &rhs) const __attribute__((nothrow)); + // define enum comparison operator to avoid ambiguity + // func:kafka.ConfigSource..EqEnum + inline bool operator ==(kafka_ConfigSourceEnum rhs) const __attribute__((nothrow)); + // func:kafka.ConfigSource..Ctor + inline ConfigSource() __attribute__((nothrow)); + // func:kafka.ConfigSource..FieldwiseCtor + explicit inline ConfigSource(u8 in_value) __attribute__((nothrow)); + // func:kafka.ConfigSource..EnumCtor + inline ConfigSource(kafka_ConfigSourceEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:kafka.ConfigSource.value.GetEnum +inline kafka_ConfigSourceEnum value_GetEnum(const kafka::ConfigSource& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.ConfigSource.value.SetEnum +inline void value_SetEnum(kafka::ConfigSource& parent, kafka_ConfigSourceEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.ConfigSource.value.ToCstr +const char* value_ToCstr(const kafka::ConfigSource& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.ConfigSource.value.Print +void value_Print(const kafka::ConfigSource& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.ConfigSource.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::ConfigSource& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.ConfigSource.value.SetStrptr +void value_SetStrptr(kafka::ConfigSource& parent, algo::strptr rhs, kafka_ConfigSourceEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.ConfigSource.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::ConfigSource& parent, algo::strptr rhs) __attribute__((nothrow)); + +// func:kafka.ConfigSource..Hash +inline u32 ConfigSource_Hash(u32 prev, const kafka::ConfigSource& rhs) __attribute__((nothrow)); +// Read fields of kafka::ConfigSource from an ascii string. +// The format of the string is the format of the kafka::ConfigSource's only field +// func:kafka.ConfigSource..ReadStrptrMaybe +bool ConfigSource_ReadStrptrMaybe(kafka::ConfigSource &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:kafka.ConfigSource..Cmp +inline i32 ConfigSource_Cmp(kafka::ConfigSource& lhs, kafka::ConfigSource& rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.ConfigSource..Init +inline void ConfigSource_Init(kafka::ConfigSource& parent); +// func:kafka.ConfigSource..Eq +inline bool ConfigSource_Eq(kafka::ConfigSource& lhs, kafka::ConfigSource& rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:kafka.ConfigSource.String printfmt:Raw +// func:kafka.ConfigSource..Print +void ConfigSource_Print(kafka::ConfigSource& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.ConfigType +#pragma pack(push,1) +struct ConfigType { // kafka.ConfigType: Config type + u8 value; // 0 + // func:kafka.ConfigType..EqOp + inline bool operator ==(const kafka::ConfigType &rhs) const __attribute__((nothrow)); + // func:kafka.ConfigType..NeOp + inline bool operator !=(const kafka::ConfigType &rhs) const __attribute__((nothrow)); + // define enum comparison operator to avoid ambiguity + // func:kafka.ConfigType..EqEnum + inline bool operator ==(kafka_ConfigTypeEnum rhs) const __attribute__((nothrow)); + // func:kafka.ConfigType..Ctor + inline ConfigType() __attribute__((nothrow)); + // func:kafka.ConfigType..FieldwiseCtor + explicit inline ConfigType(u8 in_value) __attribute__((nothrow)); + // func:kafka.ConfigType..EnumCtor + inline ConfigType(kafka_ConfigTypeEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:kafka.ConfigType.value.GetEnum +inline kafka_ConfigTypeEnum value_GetEnum(const kafka::ConfigType& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.ConfigType.value.SetEnum +inline void value_SetEnum(kafka::ConfigType& parent, kafka_ConfigTypeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.ConfigType.value.ToCstr +const char* value_ToCstr(const kafka::ConfigType& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.ConfigType.value.Print +void value_Print(const kafka::ConfigType& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.ConfigType.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::ConfigType& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.ConfigType.value.SetStrptr +void value_SetStrptr(kafka::ConfigType& parent, algo::strptr rhs, kafka_ConfigTypeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.ConfigType.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::ConfigType& parent, algo::strptr rhs) __attribute__((nothrow)); + +// func:kafka.ConfigType..Hash +inline u32 ConfigType_Hash(u32 prev, const kafka::ConfigType& rhs) __attribute__((nothrow)); +// Read fields of kafka::ConfigType from an ascii string. +// The format of the string is the format of the kafka::ConfigType's only field +// func:kafka.ConfigType..ReadStrptrMaybe +bool ConfigType_ReadStrptrMaybe(kafka::ConfigType &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:kafka.ConfigType..Cmp +inline i32 ConfigType_Cmp(kafka::ConfigType& lhs, kafka::ConfigType& rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.ConfigType..Init +inline void ConfigType_Init(kafka::ConfigType& parent); +// func:kafka.ConfigType..Eq +inline bool ConfigType_Eq(kafka::ConfigType& lhs, kafka::ConfigType& rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:kafka.ConfigType.String printfmt:Raw +// func:kafka.ConfigType..Print +void ConfigType_Print(kafka::ConfigType& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.Error +struct Error { // kafka.Error + i16 value; // 0 + // func:kafka.Error.value.Cast + inline operator i16() const __attribute__((nothrow)); + // func:kafka.Error..Ctor + inline Error() __attribute__((nothrow)); + // func:kafka.Error..FieldwiseCtor + explicit inline Error(i16 in_value) __attribute__((nothrow)); +}; + +// Read fields of kafka::Error from an ascii string. +// The format of the string is the format of the kafka::Error's only field +// func:kafka.Error..ReadStrptrMaybe +bool Error_ReadStrptrMaybe(kafka::Error &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.Error..Init +inline void Error_Init(kafka::Error& parent); +// print string representation of ROW to string STR +// cfmt:kafka.Error.String printfmt:Raw +// func:kafka.Error..Print +void Error_Print(kafka::Error& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.FieldId +#pragma pack(push,1) +struct FieldId { // kafka.FieldId: Field read helper + i32 value; // -1 + // func:kafka.FieldId.value.Cast + inline operator kafka_FieldIdEnum() const __attribute__((nothrow)); + // func:kafka.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:kafka.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:kafka.FieldId..EnumCtor + inline FieldId(kafka_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:kafka.FieldId.value.GetEnum +inline kafka_FieldIdEnum value_GetEnum(const kafka::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.FieldId.value.SetEnum +inline void value_SetEnum(kafka::FieldId& parent, kafka_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.FieldId.value.ToCstr +const char* value_ToCstr(const kafka::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.FieldId.value.Print +void value_Print(const kafka::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.FieldId.value.SetStrptr +void value_SetStrptr(kafka::FieldId& parent, algo::strptr rhs, kafka_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of kafka::FieldId from an ascii string. +// The format of the string is the format of the kafka::FieldId's only field +// func:kafka.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(kafka::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.FieldId..Init +inline void FieldId_Init(kafka::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:kafka.FieldId.String printfmt:Raw +// func:kafka.FieldId..Print +void FieldId_Print(kafka::FieldId& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.Frame +// access: kafka.Frame_curs.msg (Ptr) +struct Frame { // kafka.Frame: Frame of binary Kafka protocol + i32 size_be; // 0 + // var-length field kafka.Frame.payload starts here. access it with payload_Addr + // func:kafka.Frame..Ctor + inline Frame() __attribute__((nothrow)); +}; + +// func:kafka.Frame.size.Get +inline i32 size_Get(const kafka::Frame& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:kafka.Frame.size.Set +inline void size_Set(kafka::Frame& parent, i32 rhs) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:kafka.Frame.payload.Getary +algo::aryptr payload_Getary(kafka::Frame& parent) __attribute__((nothrow)); +// func:kafka.Frame.payload.Addr +u8* payload_Addr(kafka::Frame& parent); +// Return number of elements in varlen field +// func:kafka.Frame.payload.N +inline u32 payload_N(const kafka::Frame& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert payload to a string. +// Array is printed as a regular string. +// func:kafka.Frame.payload.Print +void payload_Print(kafka::Frame& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:kafka.Frame.payload_curs.Reset +inline void Frame_payload_curs_Reset(Frame_payload_curs &curs, kafka::Frame &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:kafka.Frame.payload_curs.ValidQ +inline bool Frame_payload_curs_ValidQ(Frame_payload_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:kafka.Frame.payload_curs.Next +inline void Frame_payload_curs_Next(Frame_payload_curs &curs) __attribute__((nothrow)); +// item access +// func:kafka.Frame.payload_curs.Access +inline u8& Frame_payload_curs_Access(Frame_payload_curs &curs) __attribute__((nothrow)); +// Message length (uses length field) +// func:kafka.Frame..GetMsgLength +inline i32 GetMsgLength(const kafka::Frame& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:kafka.Frame..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const kafka::Frame& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.Frame..Init +inline void Frame_Init(kafka::Frame& parent); + +// --- kafka.Frame_curs +#pragma pack(push,1) +struct Frame_curs { // kafka.Frame_curs: Cursor for scanning messages in a memptr + typedef kafka::Frame *ChildType; + kafka::Frame* msg; // Pointer to current message. optional pointer + u8* bytes; // Beginning of region. optional pointer + i32 limit; // 0 # Of bytes in the region + i32 msglen; // 0 Length of current message (if any) + // func:kafka.Frame_curs..Ctor + inline Frame_curs() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// func:kafka.Frame_curs..ValidQ +inline bool Frame_curs_ValidQ(kafka::Frame_curs& curs) __attribute__((nothrow)); +// func:kafka.Frame_curs..Reset +inline void Frame_curs_Reset(kafka::Frame_curs& curs, algo::memptr buf) __attribute__((nothrow)); +// func:kafka.Frame_curs..Access +inline kafka::Frame*& Frame_curs_Access(kafka::Frame_curs& curs) __attribute__((nothrow)); +// func:kafka.Frame_curs..Next +inline void Frame_curs_Next(kafka::Frame_curs& curs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.Frame_curs..Init +inline void Frame_curs_Init(kafka::Frame_curs& parent); + +// --- kafka.GroupRecordKeyHeader +// access: kafka.OffsetCommitKey.base (Base) +struct GroupRecordKeyHeader { // kafka.GroupRecordKeyHeader + i16 type; // 0 + i16 version; // 0 + // func:kafka.GroupRecordKeyHeader..Ctor + inline GroupRecordKeyHeader() __attribute__((nothrow)); +}; + +// Get value of field as enum type +// func:kafka.GroupRecordKeyHeader.type.GetEnum +inline kafka_GroupRecordKeyHeader_type_Enum type_GetEnum(const kafka::GroupRecordKeyHeader& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.GroupRecordKeyHeader.type.SetEnum +inline void type_SetEnum(kafka::GroupRecordKeyHeader& parent, kafka_GroupRecordKeyHeader_type_Enum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.GroupRecordKeyHeader.type.ToCstr +const char* type_ToCstr(const kafka::GroupRecordKeyHeader& parent) __attribute__((nothrow)); +// Convert type to a string. First, attempt conversion to a known string. +// If no string matches, print type as a numeric value. +// func:kafka.GroupRecordKeyHeader.type.Print +void type_Print(const kafka::GroupRecordKeyHeader& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.GroupRecordKeyHeader.type.SetStrptrMaybe +bool type_SetStrptrMaybe(kafka::GroupRecordKeyHeader& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.GroupRecordKeyHeader.type.SetStrptr +void type_SetStrptr(kafka::GroupRecordKeyHeader& parent, algo::strptr rhs, kafka_GroupRecordKeyHeader_type_Enum dflt) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:kafka.GroupRecordKeyHeader..Init +inline void GroupRecordKeyHeader_Init(kafka::GroupRecordKeyHeader& parent); + +// --- kafka.GroupRecordKeyHeaderMsgsCase +#pragma pack(push,1) +struct GroupRecordKeyHeaderMsgsCase { // kafka.GroupRecordKeyHeaderMsgsCase: Enum for dispatch kafka.GroupRecordKeyHeaderMsgs + u32 value; // 0 + // func:kafka.GroupRecordKeyHeaderMsgsCase.value.Cast + inline operator kafka_GroupRecordKeyHeaderMsgsCaseEnum() const __attribute__((nothrow)); + // func:kafka.GroupRecordKeyHeaderMsgsCase..Ctor + inline GroupRecordKeyHeaderMsgsCase() __attribute__((nothrow)); + // func:kafka.GroupRecordKeyHeaderMsgsCase..FieldwiseCtor + explicit inline GroupRecordKeyHeaderMsgsCase(u32 in_value) __attribute__((nothrow)); + // func:kafka.GroupRecordKeyHeaderMsgsCase..EnumCtor + inline GroupRecordKeyHeaderMsgsCase(kafka_GroupRecordKeyHeaderMsgsCaseEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:kafka.GroupRecordKeyHeaderMsgsCase.value.GetEnum +inline kafka_GroupRecordKeyHeaderMsgsCaseEnum value_GetEnum(const kafka::GroupRecordKeyHeaderMsgsCase& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.GroupRecordKeyHeaderMsgsCase.value.SetEnum +inline void value_SetEnum(kafka::GroupRecordKeyHeaderMsgsCase& parent, kafka_GroupRecordKeyHeaderMsgsCaseEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.GroupRecordKeyHeaderMsgsCase.value.ToCstr +const char* value_ToCstr(const kafka::GroupRecordKeyHeaderMsgsCase& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.GroupRecordKeyHeaderMsgsCase.value.Print +void value_Print(const kafka::GroupRecordKeyHeaderMsgsCase& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.GroupRecordKeyHeaderMsgsCase.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::GroupRecordKeyHeaderMsgsCase& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.GroupRecordKeyHeaderMsgsCase.value.SetStrptr +void value_SetStrptr(kafka::GroupRecordKeyHeaderMsgsCase& parent, algo::strptr rhs, kafka_GroupRecordKeyHeaderMsgsCaseEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.GroupRecordKeyHeaderMsgsCase.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::GroupRecordKeyHeaderMsgsCase& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of kafka::GroupRecordKeyHeaderMsgsCase from an ascii string. +// The format of the string is the format of the kafka::GroupRecordKeyHeaderMsgsCase's only field +// func:kafka.GroupRecordKeyHeaderMsgsCase..ReadStrptrMaybe +bool GroupRecordKeyHeaderMsgsCase_ReadStrptrMaybe(kafka::GroupRecordKeyHeaderMsgsCase &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.GroupRecordKeyHeaderMsgsCase..Init +inline void GroupRecordKeyHeaderMsgsCase_Init(kafka::GroupRecordKeyHeaderMsgsCase& parent); + +// --- kafka.GroupRecordValueHeader +// access: kafka.OffsetCommitValue.base (Base) +struct GroupRecordValueHeader { // kafka.GroupRecordValueHeader + i16 type; // 0 + i16 version; // 0 + // func:kafka.GroupRecordValueHeader..Ctor + inline GroupRecordValueHeader() __attribute__((nothrow)); +}; + +// Get value of field as enum type +// func:kafka.GroupRecordValueHeader.type.GetEnum +inline kafka_GroupRecordValueHeader_type_Enum type_GetEnum(const kafka::GroupRecordValueHeader& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.GroupRecordValueHeader.type.SetEnum +inline void type_SetEnum(kafka::GroupRecordValueHeader& parent, kafka_GroupRecordValueHeader_type_Enum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.GroupRecordValueHeader.type.ToCstr +const char* type_ToCstr(const kafka::GroupRecordValueHeader& parent) __attribute__((nothrow)); +// Convert type to a string. First, attempt conversion to a known string. +// If no string matches, print type as a numeric value. +// func:kafka.GroupRecordValueHeader.type.Print +void type_Print(const kafka::GroupRecordValueHeader& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.GroupRecordValueHeader.type.SetStrptrMaybe +bool type_SetStrptrMaybe(kafka::GroupRecordValueHeader& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.GroupRecordValueHeader.type.SetStrptr +void type_SetStrptr(kafka::GroupRecordValueHeader& parent, algo::strptr rhs, kafka_GroupRecordValueHeader_type_Enum dflt) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:kafka.GroupRecordValueHeader..Init +inline void GroupRecordValueHeader_Init(kafka::GroupRecordValueHeader& parent); + +// --- kafka.GroupRecordValueHeaderMsgsCase +#pragma pack(push,1) +struct GroupRecordValueHeaderMsgsCase { // kafka.GroupRecordValueHeaderMsgsCase: Enum for dispatch kafka.GroupRecordValueHeaderMsgs + u32 value; // 0 + // func:kafka.GroupRecordValueHeaderMsgsCase.value.Cast + inline operator kafka_GroupRecordValueHeaderMsgsCaseEnum() const __attribute__((nothrow)); + // func:kafka.GroupRecordValueHeaderMsgsCase..Ctor + inline GroupRecordValueHeaderMsgsCase() __attribute__((nothrow)); + // func:kafka.GroupRecordValueHeaderMsgsCase..FieldwiseCtor + explicit inline GroupRecordValueHeaderMsgsCase(u32 in_value) __attribute__((nothrow)); + // func:kafka.GroupRecordValueHeaderMsgsCase..EnumCtor + inline GroupRecordValueHeaderMsgsCase(kafka_GroupRecordValueHeaderMsgsCaseEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:kafka.GroupRecordValueHeaderMsgsCase.value.GetEnum +inline kafka_GroupRecordValueHeaderMsgsCaseEnum value_GetEnum(const kafka::GroupRecordValueHeaderMsgsCase& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.GroupRecordValueHeaderMsgsCase.value.SetEnum +inline void value_SetEnum(kafka::GroupRecordValueHeaderMsgsCase& parent, kafka_GroupRecordValueHeaderMsgsCaseEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.GroupRecordValueHeaderMsgsCase.value.ToCstr +const char* value_ToCstr(const kafka::GroupRecordValueHeaderMsgsCase& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.GroupRecordValueHeaderMsgsCase.value.Print +void value_Print(const kafka::GroupRecordValueHeaderMsgsCase& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.GroupRecordValueHeaderMsgsCase.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::GroupRecordValueHeaderMsgsCase& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.GroupRecordValueHeaderMsgsCase.value.SetStrptr +void value_SetStrptr(kafka::GroupRecordValueHeaderMsgsCase& parent, algo::strptr rhs, kafka_GroupRecordValueHeaderMsgsCaseEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.GroupRecordValueHeaderMsgsCase.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::GroupRecordValueHeaderMsgsCase& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of kafka::GroupRecordValueHeaderMsgsCase from an ascii string. +// The format of the string is the format of the kafka::GroupRecordValueHeaderMsgsCase's only field +// func:kafka.GroupRecordValueHeaderMsgsCase..ReadStrptrMaybe +bool GroupRecordValueHeaderMsgsCase_ReadStrptrMaybe(kafka::GroupRecordValueHeaderMsgsCase &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.GroupRecordValueHeaderMsgsCase..Init +inline void GroupRecordValueHeaderMsgsCase_Init(kafka::GroupRecordValueHeaderMsgsCase& parent); + +// --- kafka.GroupState +#pragma pack(push,1) +struct GroupState { // kafka.GroupState: Group state + u8 value; // 5 + // func:kafka.GroupState..EqOp + inline bool operator ==(const kafka::GroupState &rhs) const __attribute__((nothrow)); + // func:kafka.GroupState..NeOp + inline bool operator !=(const kafka::GroupState &rhs) const __attribute__((nothrow)); + // define enum comparison operator to avoid ambiguity + // func:kafka.GroupState..EqEnum + inline bool operator ==(kafka_GroupStateEnum rhs) const __attribute__((nothrow)); + // func:kafka.GroupState..Ctor + inline GroupState() __attribute__((nothrow)); + // func:kafka.GroupState..FieldwiseCtor + explicit inline GroupState(u8 in_value) __attribute__((nothrow)); + // func:kafka.GroupState..EnumCtor + inline GroupState(kafka_GroupStateEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:kafka.GroupState.value.GetEnum +inline kafka_GroupStateEnum value_GetEnum(const kafka::GroupState& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.GroupState.value.SetEnum +inline void value_SetEnum(kafka::GroupState& parent, kafka_GroupStateEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.GroupState.value.ToCstr +const char* value_ToCstr(const kafka::GroupState& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.GroupState.value.Print +void value_Print(const kafka::GroupState& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.GroupState.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::GroupState& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.GroupState.value.SetStrptr +void value_SetStrptr(kafka::GroupState& parent, algo::strptr rhs, kafka_GroupStateEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.GroupState.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::GroupState& parent, algo::strptr rhs) __attribute__((nothrow)); + +// func:kafka.GroupState..Hash +inline u32 GroupState_Hash(u32 prev, const kafka::GroupState& rhs) __attribute__((nothrow)); +// Read fields of kafka::GroupState from an ascii string. +// The format of the string is the format of the kafka::GroupState's only field +// func:kafka.GroupState..ReadStrptrMaybe +bool GroupState_ReadStrptrMaybe(kafka::GroupState &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:kafka.GroupState..Cmp +inline i32 GroupState_Cmp(kafka::GroupState& lhs, kafka::GroupState& rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.GroupState..Init +inline void GroupState_Init(kafka::GroupState& parent); +// func:kafka.GroupState..Eq +inline bool GroupState_Eq(kafka::GroupState& lhs, kafka::GroupState& rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:kafka.GroupState.String printfmt:Raw +// func:kafka.GroupState..Print +void GroupState_Print(kafka::GroupState& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.Header +// create: kafka.Record.headers (Tary) +struct Header { // kafka.Header + algo::cstring key; // + algo::cstring value; // + // func:kafka.Header..Ctor + inline Header() __attribute__((nothrow)); +}; + +// func:kafka.Header..ReadFieldMaybe +bool Header_ReadFieldMaybe(kafka::Header& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of kafka::Header from an ascii string. +// The format of the string is an ssim Tuple +// func:kafka.Header..ReadStrptrMaybe +bool Header_ReadStrptrMaybe(kafka::Header &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:kafka.Header.String printfmt:Tuple +// func:kafka.Header..Print +void Header_Print(kafka::Header& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.OffsetCommitKey +struct OffsetCommitKey { // kafka.OffsetCommitKey + i16 type; // 1 + i16 version; // 0 + algo::cstring group; // + algo::cstring topic; // + i32 partition; // 0 + // func:kafka.OffsetCommitKey..Ctor + inline OffsetCommitKey() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:kafka.OffsetCommitKey.base.CopyOut +void parent_CopyOut(kafka::OffsetCommitKey &row, kafka::GroupRecordKeyHeader &out) __attribute__((nothrow)); +// Check if kafka::GroupRecordKeyHeader is an instance of OffsetCommitKey by checking the type field +// If it is, return the pointer of target type. +// If not successful, quietly return NULL. +// func:kafka.OffsetCommitKey.base.Castdown +inline kafka::OffsetCommitKey* OffsetCommitKey_Castdown(kafka::GroupRecordKeyHeader &hdr); +// func:kafka.OffsetCommitKey.base.Castbase +inline kafka::GroupRecordKeyHeader& Castbase(kafka::OffsetCommitKey& parent); + +// func:kafka.OffsetCommitKey..ReadFieldMaybe +bool OffsetCommitKey_ReadFieldMaybe(kafka::OffsetCommitKey& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of kafka::OffsetCommitKey from an ascii string. +// The format of the string is an ssim Tuple +// func:kafka.OffsetCommitKey..ReadStrptrMaybe +bool OffsetCommitKey_ReadStrptrMaybe(kafka::OffsetCommitKey &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.OffsetCommitKey..Init +inline void OffsetCommitKey_Init(kafka::OffsetCommitKey& parent); +// print string representation of ROW to string STR +// cfmt:kafka.OffsetCommitKey.String printfmt:Tuple +// func:kafka.OffsetCommitKey..Print +void OffsetCommitKey_Print(kafka::OffsetCommitKey& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.OffsetCommitValue +struct OffsetCommitValue { // kafka.OffsetCommitValue + i16 type; // 1 + i16 version; // 0 + i64 offset; // 0 + i32 leader_epoch; // -1 + algo::cstring metadata; // + i64 commit_timestamp; // 0 + i64 expire_timestamp; // -1 + // func:kafka.OffsetCommitValue..Ctor + inline OffsetCommitValue() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:kafka.OffsetCommitValue.base.CopyOut +void parent_CopyOut(kafka::OffsetCommitValue &row, kafka::GroupRecordValueHeader &out) __attribute__((nothrow)); +// Check if kafka::GroupRecordValueHeader is an instance of OffsetCommitValue by checking the type field +// If it is, return the pointer of target type. +// If not successful, quietly return NULL. +// func:kafka.OffsetCommitValue.base.Castdown +inline kafka::OffsetCommitValue* OffsetCommitValue_Castdown(kafka::GroupRecordValueHeader &hdr); +// func:kafka.OffsetCommitValue.base.Castbase +inline kafka::GroupRecordValueHeader& Castbase(kafka::OffsetCommitValue& parent); + +// Set all fields to initial values. +// func:kafka.OffsetCommitValue..Init +inline void OffsetCommitValue_Init(kafka::OffsetCommitValue& parent); +// print string representation of ROW to string STR +// cfmt:kafka.OffsetCommitValue.String printfmt:Tuple +// func:kafka.OffsetCommitValue..Print +void OffsetCommitValue_Print(kafka::OffsetCommitValue& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.PatternType +#pragma pack(push,1) +struct PatternType { // kafka.PatternType: Pattern type + u8 value; // 0 + // func:kafka.PatternType..EqOp + inline bool operator ==(const kafka::PatternType &rhs) const __attribute__((nothrow)); + // func:kafka.PatternType..NeOp + inline bool operator !=(const kafka::PatternType &rhs) const __attribute__((nothrow)); + // define enum comparison operator to avoid ambiguity + // func:kafka.PatternType..EqEnum + inline bool operator ==(kafka_PatternTypeEnum rhs) const __attribute__((nothrow)); + // func:kafka.PatternType..Ctor + inline PatternType() __attribute__((nothrow)); + // func:kafka.PatternType..FieldwiseCtor + explicit inline PatternType(u8 in_value) __attribute__((nothrow)); + // func:kafka.PatternType..EnumCtor + inline PatternType(kafka_PatternTypeEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:kafka.PatternType.value.GetEnum +inline kafka_PatternTypeEnum value_GetEnum(const kafka::PatternType& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.PatternType.value.SetEnum +inline void value_SetEnum(kafka::PatternType& parent, kafka_PatternTypeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.PatternType.value.ToCstr +const char* value_ToCstr(const kafka::PatternType& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.PatternType.value.Print +void value_Print(const kafka::PatternType& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.PatternType.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::PatternType& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.PatternType.value.SetStrptr +void value_SetStrptr(kafka::PatternType& parent, algo::strptr rhs, kafka_PatternTypeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.PatternType.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::PatternType& parent, algo::strptr rhs) __attribute__((nothrow)); + +// func:kafka.PatternType..Hash +inline u32 PatternType_Hash(u32 prev, const kafka::PatternType& rhs) __attribute__((nothrow)); +// Read fields of kafka::PatternType from an ascii string. +// The format of the string is the format of the kafka::PatternType's only field +// func:kafka.PatternType..ReadStrptrMaybe +bool PatternType_ReadStrptrMaybe(kafka::PatternType &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:kafka.PatternType..Cmp +inline i32 PatternType_Cmp(kafka::PatternType& lhs, kafka::PatternType& rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.PatternType..Init +inline void PatternType_Init(kafka::PatternType& parent); +// func:kafka.PatternType..Eq +inline bool PatternType_Eq(kafka::PatternType& lhs, kafka::PatternType& rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:kafka.PatternType.String printfmt:Raw +// func:kafka.PatternType..Print +void PatternType_Print(kafka::PatternType& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.Record +// create: kafka.RecordBatch.records (Tary) +struct Record { // kafka.Record + u8 attributes; // 0 + u8 pmask; // 0 + i64 timestamp_delta; // 0 + i32 offset_delta; // 0 + algo::cstring key; // + algo::cstring value; // + kafka::Header* headers_elems; // pointer to elements + u32 headers_n; // number of elements in array + u32 headers_max; // max. capacity of array before realloc + // func:kafka.Record..AssignOp + kafka::Record& operator =(const kafka::Record &rhs) __attribute__((nothrow)); + // func:kafka.Record..Ctor + inline Record() __attribute__((nothrow)); + // func:kafka.Record..Dtor + inline ~Record() __attribute__((nothrow)); + // func:kafka.Record..CopyCtor + Record(const kafka::Record &rhs) __attribute__((nothrow)); +}; + +// Return constant 1 +// func:kafka.Record.pmask.N +inline int pmask_N(kafka::Record& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Access value +// func:kafka.Record.pmask.qFind +inline u8& pmask_qFind(kafka::Record& parent, int) __attribute__((__warn_unused_result__, nothrow)); +// Get max # of bits in the bitset +// Return max. number of bits supported by array +// func:kafka.Record.pmask.NBits +inline int pmask_Nbits(kafka::Record& parent) __attribute__((__warn_unused_result__, nothrow)); +// Retrieve value of bit #BIT_IDX in bit set. No bounds checking +// func:kafka.Record.pmask.qGetBit +inline bool pmask_qGetBit(kafka::Record& parent, u32 bit_idx) __attribute__((__warn_unused_result__, nothrow)); +// Retrieve value of bit #BIT_IDX in bit set. If bit index is out of bounds, return 0. +// func:kafka.Record.pmask.GetBit +inline bool pmask_GetBit(kafka::Record& parent, u32 bit_idx) __attribute__((__warn_unused_result__, nothrow)); +// Check if all the bits in the bitset are equal to zero +// func:kafka.Record.pmask.BitsEmptyQ +inline bool pmask_BitsEmptyQ(kafka::Record& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:kafka.Record.pmask.Sum1s +inline u64 pmask_Sum1s(kafka::Record& parent) __attribute__((__warn_unused_result__, nothrow)); +// Clear bit # BIT_IDX in bit set. No bounds checking +// func:kafka.Record.pmask.qClearBit +inline void pmask_qClearBit(kafka::Record& parent, u32 bit_idx) __attribute__((nothrow)); +// Clear bit # BIT_IDX in bit set. If bit index is out of bounds, do nothing +// func:kafka.Record.pmask.ClearBit +inline void pmask_ClearBit(kafka::Record& parent, u32 bit_idx) __attribute__((nothrow)); +// Set bit # BIT_IDX in bit set. No bounds checking +// func:kafka.Record.pmask.qSetBit +inline void pmask_qSetBit(kafka::Record& parent, u32 bit_idx) __attribute__((nothrow)); +// Set bit # BIT_IDX in bit set. If bit index is out of bounds, do nothing. +// func:kafka.Record.pmask.SetBit +inline void pmask_SetBit(kafka::Record& parent, u32 bit_idx) __attribute__((nothrow)); +// Set bit # BIT_IDX in bit set. No bounds checking +// func:kafka.Record.pmask.qSetBitVal +inline void pmask_qSetBitVal(kafka::Record& parent, u32 bit_idx, bool val) __attribute__((nothrow)); +// Or bit # BIT_IDX in bit set. No bounds checking +// func:kafka.Record.pmask.qOrBitVal +inline void pmask_qOrBitVal(kafka::Record& parent, u32 bit_idx, bool val) __attribute__((nothrow)); +// Set all bits of array to zero. +// Note: this does not change what NBits will return. +// func:kafka.Record.pmask.ClearBitsAll +inline void pmask_ClearBitsAll(kafka::Record& parent) __attribute__((nothrow)); +// Zero in PARENT any bits that are set in RHS. +// func:kafka.Record.pmask.ClearBits +inline void pmask_ClearBits(kafka::Record& parent, kafka::Record &rhs) __attribute__((nothrow)); +// Set PARENT to union of two bitsets. +// (This function is not named Set.. to avoid triple entendre). +// func:kafka.Record.pmask.OrBits +inline void pmask_OrBits(kafka::Record& parent, kafka::Record &rhs) __attribute__((nothrow)); +// Return smallest number N such that indexes of all 1 bits are below N +// func:kafka.Record.pmask.Sup +inline i32 pmask_Sup(kafka::Record& parent) __attribute__((__warn_unused_result__, nothrow)); + +// Return true if the field is marked in the presence mask +// func:kafka.Record.key.PresentQ +inline bool key_PresentQ(kafka::Record& parent) __attribute__((nothrow)); +// Set presence bit for this field in the pmask +// func:kafka.Record.key.SetPresent +inline void key_SetPresent(kafka::Record& parent) __attribute__((nothrow)); +// Return field's bit number in the pmask +// func:kafka.Record.key.Present_GetBit +inline int key_Present_GetBit(kafka::Record& parent) __attribute__((nothrow)); +// func:kafka.Record.key.Set +inline void key_Set(kafka::Record& parent, const algo::strptr& rhs) __attribute__((nothrow)); + +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:kafka.Record.headers.Addary +algo::aryptr headers_Addary(kafka::Record& parent, algo::aryptr rhs) __attribute__((nothrow)); +// Reserve space. Insert element at the end +// The new element is initialized to a default value +// func:kafka.Record.headers.Alloc +kafka::Header& headers_Alloc(kafka::Record& parent) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:kafka.Record.headers.AllocAt +kafka::Header& headers_AllocAt(kafka::Record& parent, int at) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:kafka.Record.headers.AllocN +algo::aryptr headers_AllocN(kafka::Record& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:kafka.Record.headers.AllocNAt +algo::aryptr headers_AllocNAt(kafka::Record& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:kafka.Record.headers.EmptyQ +inline bool headers_EmptyQ(kafka::Record& parent) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:kafka.Record.headers.Find +inline kafka::Header* headers_Find(kafka::Record& parent, u64 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array pointer by value +// func:kafka.Record.headers.Getary +inline algo::aryptr headers_Getary(const kafka::Record& parent) __attribute__((nothrow)); +// Return pointer to last element of array, or NULL if array is empty +// func:kafka.Record.headers.Last +inline kafka::Header* headers_Last(kafka::Record& parent) __attribute__((nothrow, pure)); +// Return max. number of items in the array +// func:kafka.Record.headers.Max +inline i32 headers_Max(kafka::Record& parent) __attribute__((nothrow)); +// Return number of items in the array +// func:kafka.Record.headers.N +inline i32 headers_N(const kafka::Record& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove item by index. If index outside of range, do nothing. +// func:kafka.Record.headers.Remove +void headers_Remove(kafka::Record& parent, u32 i) __attribute__((nothrow)); +// func:kafka.Record.headers.RemoveAll +void headers_RemoveAll(kafka::Record& parent) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:kafka.Record.headers.RemoveLast +void headers_RemoveLast(kafka::Record& parent) __attribute__((nothrow)); +// Make sure N *more* elements will fit in array. Process dies if out of memory +// func:kafka.Record.headers.Reserve +inline void headers_Reserve(kafka::Record& parent, int n) __attribute__((nothrow)); +// Make sure N elements fit in array. Process dies if out of memory +// func:kafka.Record.headers.AbsReserve +void headers_AbsReserve(kafka::Record& parent, int n) __attribute__((nothrow)); +// Copy contents of RHS to PARENT. +// func:kafka.Record.headers.Setary +void headers_Setary(kafka::Record& parent, kafka::Record &rhs) __attribute__((nothrow)); +// Copy specified array into headers, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +// func:kafka.Record.headers.Setary2 +void headers_Setary(kafka::Record& parent, const algo::aryptr &rhs) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:kafka.Record.headers.qFind +inline kafka::Header& headers_qFind(kafka::Record& parent, u64 t) __attribute__((nothrow)); +// Return reference to last element of array. No bounds checking +// func:kafka.Record.headers.qLast +inline kafka::Header& headers_qLast(kafka::Record& parent) __attribute__((nothrow)); +// Return row id of specified element +// func:kafka.Record.headers.rowid_Get +inline u64 headers_rowid_Get(kafka::Record& parent, kafka::Header &elem) __attribute__((nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:kafka.Record.headers.AllocNVal +algo::aryptr headers_AllocNVal(kafka::Record& parent, int n_elems, const kafka::Header& val) __attribute__((nothrow)); +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +// func:kafka.Record.headers.ReadStrptrMaybe +bool headers_ReadStrptrMaybe(kafka::Record& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:kafka.Record.headers.Insary +void headers_Insary(kafka::Record& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); + +// proceed to next item +// func:kafka.Record.headers_curs.Next +inline void Record_headers_curs_Next(Record_headers_curs &curs) __attribute__((nothrow)); +// func:kafka.Record.headers_curs.Reset +inline void Record_headers_curs_Reset(Record_headers_curs &curs, kafka::Record &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:kafka.Record.headers_curs.ValidQ +inline bool Record_headers_curs_ValidQ(Record_headers_curs &curs) __attribute__((nothrow)); +// item access +// func:kafka.Record.headers_curs.Access +inline kafka::Header& Record_headers_curs_Access(Record_headers_curs &curs) __attribute__((nothrow)); +// func:kafka.Record..ReadFieldMaybe +bool Record_ReadFieldMaybe(kafka::Record& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of kafka::Record from an ascii string. +// The format of the string is an ssim Tuple +// func:kafka.Record..ReadStrptrMaybe +bool Record_ReadStrptrMaybe(kafka::Record &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.Record..Init +inline void Record_Init(kafka::Record& parent); +// func:kafka.Record..Uninit +void Record_Uninit(kafka::Record& parent) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:kafka.Record.String printfmt:Tuple +// func:kafka.Record..Print +void Record_Print(kafka::Record& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.RecordBatch +struct RecordBatch { // kafka.RecordBatch + i64 base_offset; // 0 + i32 partition_leader_epoch; // 0 + i8 magic; // 2 + u32 crc; // 0 + i16 attributes; // 0 + i32 last_offset_delta; // 0 + i64 base_timestamp; // 0 + i64 max_timestamp; // 0 + i64 producer_id; // -1 + i16 producer_epoch; // -1 + i32 base_sequence; // -1 + kafka::Record* records_elems; // pointer to elements + u32 records_n; // number of elements in array + u32 records_max; // max. capacity of array before realloc + // func:kafka.RecordBatch..AssignOp + kafka::RecordBatch& operator =(const kafka::RecordBatch &rhs) __attribute__((nothrow)); + // func:kafka.RecordBatch..Ctor + inline RecordBatch() __attribute__((nothrow)); + // func:kafka.RecordBatch..Dtor + inline ~RecordBatch() __attribute__((nothrow)); + // func:kafka.RecordBatch..CopyCtor + RecordBatch(const kafka::RecordBatch &rhs) __attribute__((nothrow)); +}; + +// Reserve space (this may move memory). Insert N element at the end. +// Return aryptr to newly inserted block. +// If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:kafka.RecordBatch.records.Addary +algo::aryptr records_Addary(kafka::RecordBatch& parent, algo::aryptr rhs) __attribute__((nothrow)); +// Reserve space. Insert element at the end +// The new element is initialized to a default value +// func:kafka.RecordBatch.records.Alloc +kafka::Record& records_Alloc(kafka::RecordBatch& parent) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:kafka.RecordBatch.records.AllocAt +kafka::Record& records_AllocAt(kafka::RecordBatch& parent, int at) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:kafka.RecordBatch.records.AllocN +algo::aryptr records_AllocN(kafka::RecordBatch& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:kafka.RecordBatch.records.AllocNAt +algo::aryptr records_AllocNAt(kafka::RecordBatch& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:kafka.RecordBatch.records.EmptyQ +inline bool records_EmptyQ(kafka::RecordBatch& parent) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:kafka.RecordBatch.records.Find +inline kafka::Record* records_Find(kafka::RecordBatch& parent, u64 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array pointer by value +// func:kafka.RecordBatch.records.Getary +inline algo::aryptr records_Getary(const kafka::RecordBatch& parent) __attribute__((nothrow)); +// Return pointer to last element of array, or NULL if array is empty +// func:kafka.RecordBatch.records.Last +inline kafka::Record* records_Last(kafka::RecordBatch& parent) __attribute__((nothrow, pure)); +// Return max. number of items in the array +// func:kafka.RecordBatch.records.Max +inline i32 records_Max(kafka::RecordBatch& parent) __attribute__((nothrow)); +// Return number of items in the array +// func:kafka.RecordBatch.records.N +inline i32 records_N(const kafka::RecordBatch& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove item by index. If index outside of range, do nothing. +// func:kafka.RecordBatch.records.Remove +void records_Remove(kafka::RecordBatch& parent, u32 i) __attribute__((nothrow)); +// func:kafka.RecordBatch.records.RemoveAll +void records_RemoveAll(kafka::RecordBatch& parent) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:kafka.RecordBatch.records.RemoveLast +void records_RemoveLast(kafka::RecordBatch& parent) __attribute__((nothrow)); +// Make sure N *more* elements will fit in array. Process dies if out of memory +// func:kafka.RecordBatch.records.Reserve +inline void records_Reserve(kafka::RecordBatch& parent, int n) __attribute__((nothrow)); +// Make sure N elements fit in array. Process dies if out of memory +// func:kafka.RecordBatch.records.AbsReserve +void records_AbsReserve(kafka::RecordBatch& parent, int n) __attribute__((nothrow)); +// Copy contents of RHS to PARENT. +// func:kafka.RecordBatch.records.Setary +void records_Setary(kafka::RecordBatch& parent, kafka::RecordBatch &rhs) __attribute__((nothrow)); +// Copy specified array into records, discarding previous contents. +// If the RHS argument aliases the array (refers to the same memory), throw exception. +// func:kafka.RecordBatch.records.Setary2 +void records_Setary(kafka::RecordBatch& parent, const algo::aryptr &rhs) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:kafka.RecordBatch.records.qFind +inline kafka::Record& records_qFind(kafka::RecordBatch& parent, u64 t) __attribute__((nothrow)); +// Return reference to last element of array. No bounds checking +// func:kafka.RecordBatch.records.qLast +inline kafka::Record& records_qLast(kafka::RecordBatch& parent) __attribute__((nothrow)); +// Return row id of specified element +// func:kafka.RecordBatch.records.rowid_Get +inline u64 records_rowid_Get(kafka::RecordBatch& parent, kafka::Record &elem) __attribute__((nothrow)); +// Reserve space. Insert N elements at the end of the array, return pointer to array +// func:kafka.RecordBatch.records.AllocNVal +algo::aryptr records_AllocNVal(kafka::RecordBatch& parent, int n_elems, const kafka::Record& val) __attribute__((nothrow)); +// A single element is read from input string and appended to the array. +// If the string contains an error, the array is untouched. +// Function returns success value. +// func:kafka.RecordBatch.records.ReadStrptrMaybe +bool records_ReadStrptrMaybe(kafka::RecordBatch& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:kafka.RecordBatch.records.Insary +void records_Insary(kafka::RecordBatch& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); + +// proceed to next item +// func:kafka.RecordBatch.records_curs.Next +inline void RecordBatch_records_curs_Next(RecordBatch_records_curs &curs) __attribute__((nothrow)); +// func:kafka.RecordBatch.records_curs.Reset +inline void RecordBatch_records_curs_Reset(RecordBatch_records_curs &curs, kafka::RecordBatch &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:kafka.RecordBatch.records_curs.ValidQ +inline bool RecordBatch_records_curs_ValidQ(RecordBatch_records_curs &curs) __attribute__((nothrow)); +// item access +// func:kafka.RecordBatch.records_curs.Access +inline kafka::Record& RecordBatch_records_curs_Access(RecordBatch_records_curs &curs) __attribute__((nothrow)); +// func:kafka.RecordBatch..ReadFieldMaybe +bool RecordBatch_ReadFieldMaybe(kafka::RecordBatch& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of kafka::RecordBatch from an ascii string. +// The format of the string is an ssim Tuple +// func:kafka.RecordBatch..ReadStrptrMaybe +bool RecordBatch_ReadStrptrMaybe(kafka::RecordBatch &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.RecordBatch..Init +void RecordBatch_Init(kafka::RecordBatch& parent); +// func:kafka.RecordBatch..Uninit +void RecordBatch_Uninit(kafka::RecordBatch& parent) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:kafka.RecordBatch.String printfmt:Tuple +// func:kafka.RecordBatch..Print +void RecordBatch_Print(kafka::RecordBatch& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.ResourceType +#pragma pack(push,1) +struct ResourceType { // kafka.ResourceType: Resource type + u8 value; // 0 + // func:kafka.ResourceType..EqOp + inline bool operator ==(const kafka::ResourceType &rhs) const __attribute__((nothrow)); + // func:kafka.ResourceType..NeOp + inline bool operator !=(const kafka::ResourceType &rhs) const __attribute__((nothrow)); + // define enum comparison operator to avoid ambiguity + // func:kafka.ResourceType..EqEnum + inline bool operator ==(kafka_ResourceTypeEnum rhs) const __attribute__((nothrow)); + // func:kafka.ResourceType..Ctor + inline ResourceType() __attribute__((nothrow)); + // func:kafka.ResourceType..FieldwiseCtor + explicit inline ResourceType(u8 in_value) __attribute__((nothrow)); + // func:kafka.ResourceType..EnumCtor + inline ResourceType(kafka_ResourceTypeEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:kafka.ResourceType.value.GetEnum +inline kafka_ResourceTypeEnum value_GetEnum(const kafka::ResourceType& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.ResourceType.value.SetEnum +inline void value_SetEnum(kafka::ResourceType& parent, kafka_ResourceTypeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.ResourceType.value.ToCstr +const char* value_ToCstr(const kafka::ResourceType& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.ResourceType.value.Print +void value_Print(const kafka::ResourceType& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.ResourceType.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::ResourceType& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.ResourceType.value.SetStrptr +void value_SetStrptr(kafka::ResourceType& parent, algo::strptr rhs, kafka_ResourceTypeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.ResourceType.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::ResourceType& parent, algo::strptr rhs) __attribute__((nothrow)); + +// func:kafka.ResourceType..Hash +inline u32 ResourceType_Hash(u32 prev, const kafka::ResourceType& rhs) __attribute__((nothrow)); +// Read fields of kafka::ResourceType from an ascii string. +// The format of the string is the format of the kafka::ResourceType's only field +// func:kafka.ResourceType..ReadStrptrMaybe +bool ResourceType_ReadStrptrMaybe(kafka::ResourceType &parent, algo::strptr in_str) __attribute__((nothrow)); +// func:kafka.ResourceType..Cmp +inline i32 ResourceType_Cmp(kafka::ResourceType& lhs, kafka::ResourceType& rhs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.ResourceType..Init +inline void ResourceType_Init(kafka::ResourceType& parent); +// func:kafka.ResourceType..Eq +inline bool ResourceType_Eq(kafka::ResourceType& lhs, kafka::ResourceType& rhs) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:kafka.ResourceType.String printfmt:Raw +// func:kafka.ResourceType..Print +void ResourceType_Print(kafka::ResourceType& row, algo::cstring& str) __attribute__((nothrow)); + +// --- kafka.TimestampType +struct TimestampType { // kafka.TimestampType + u8 value; // 0 + // func:kafka.TimestampType..Ctor + inline TimestampType() __attribute__((nothrow)); + // func:kafka.TimestampType..FieldwiseCtor + explicit inline TimestampType(u8 in_value) __attribute__((nothrow)); + // func:kafka.TimestampType..EnumCtor + inline TimestampType(kafka_TimestampTypeEnum arg) __attribute__((nothrow)); +}; + +// Get value of field as enum type +// func:kafka.TimestampType.value.GetEnum +inline kafka_TimestampTypeEnum value_GetEnum(const kafka::TimestampType& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:kafka.TimestampType.value.SetEnum +inline void value_SetEnum(kafka::TimestampType& parent, kafka_TimestampTypeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:kafka.TimestampType.value.ToCstr +const char* value_ToCstr(const kafka::TimestampType& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:kafka.TimestampType.value.Print +void value_Print(const kafka::TimestampType& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:kafka.TimestampType.value.SetStrptrMaybe +bool value_SetStrptrMaybe(kafka::TimestampType& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:kafka.TimestampType.value.SetStrptr +void value_SetStrptr(kafka::TimestampType& parent, algo::strptr rhs, kafka_TimestampTypeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:kafka.TimestampType.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(kafka::TimestampType& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of kafka::TimestampType from an ascii string. +// The format of the string is the format of the kafka::TimestampType's only field +// func:kafka.TimestampType..ReadStrptrMaybe +bool TimestampType_ReadStrptrMaybe(kafka::TimestampType &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:kafka.TimestampType..Init +inline void TimestampType_Init(kafka::TimestampType& parent); +// print string representation of ROW to string STR +// cfmt:kafka.TimestampType.String printfmt:Raw +// func:kafka.TimestampType..Print +void TimestampType_Print(kafka::TimestampType& row, algo::cstring& str) __attribute__((nothrow)); +} // gen:ns_print_struct +namespace kafka { // gen:ns_curstext + +struct Frame_payload_curs {// cursor + typedef u8 ChildType; + u8 *ptr; + int length; + int index; + Frame_payload_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct Record_headers_curs {// cursor + typedef kafka::Header ChildType; + kafka::Header* elems; + int n_elems; + int index; + Record_headers_curs() { elems=NULL; n_elems=0; index=0; } +}; + + +struct RecordBatch_records_curs {// cursor + typedef kafka::Record ChildType; + kafka::Record* elems; + int n_elems; + int index; + RecordBatch_records_curs() { elems=NULL; n_elems=0; index=0; } +}; + +} // gen:ns_curstext +namespace kafka { // gen:ns_func +// func:kafka...StaticCheck +void StaticCheck(); +// Print message to STR. If message is too short for MSG_LEN, print nothing. +// MSG.LENGTH must have already been validated against msg_len. +// This function will additionally validate that sizeof(Msg) <= msg_len +// func:kafka.GroupRecordKeyHeaderMsgs..Print +bool GroupRecordKeyHeaderMsgs_Print(algo::cstring &str, kafka::GroupRecordKeyHeader &msg, u32 msg_len); +// Print message to STR. If message is too short for MSG_LEN, print nothing. +// MSG.LENGTH must have already been validated against msg_len. +// This function will additionally validate that sizeof(Msg) <= msg_len +// func:kafka.GroupRecordValueHeaderMsgs..Print +bool GroupRecordValueHeaderMsgs_Print(algo::cstring &str, kafka::GroupRecordValueHeader &msg, u32 msg_len); +// Parse ascii representation of message into binary, appending new data to BUF. +// func:kafka.GroupRecordKeyHeaderMsgs..ReadStrptr +kafka::GroupRecordKeyHeaderMsgsCase GroupRecordKeyHeaderMsgs_ReadStrptr(algo::strptr str, algo::ByteAry &buf); +// Parse ascii representation of message into binary, appending new data to BUF. +// func:kafka.GroupRecordKeyHeaderMsgs..ReadStrptrMaybe +bool GroupRecordKeyHeaderMsgs_ReadStrptrMaybe(algo::strptr str, algo::ByteAry &buf); +// Parse ascii representation of message into binary, appending new data to BUF. +// func:kafka.GroupRecordValueHeaderMsgs..ReadStrptr +kafka::GroupRecordValueHeaderMsgsCase GroupRecordValueHeaderMsgs_ReadStrptr(algo::strptr str, algo::ByteAry &buf); +// Parse ascii representation of message into binary, appending new data to BUF. +// func:kafka.GroupRecordValueHeaderMsgs..ReadStrptrMaybe +bool GroupRecordValueHeaderMsgs_ReadStrptrMaybe(algo::strptr str, algo::ByteAry &buf); +} // gen:ns_func +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const kafka::AclOperationType &row);// cfmt:kafka.AclOperationType.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::AclOperations &row);// cfmt:kafka.AclOperations.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::AclPermissionType &row);// cfmt:kafka.AclPermissionType.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::CompressionType &row);// cfmt:kafka.CompressionType.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::ConfigSource &row);// cfmt:kafka.ConfigSource.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::ConfigType &row);// cfmt:kafka.ConfigType.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::Error &row);// cfmt:kafka.Error.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::FieldId &row);// cfmt:kafka.FieldId.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::GroupState &row);// cfmt:kafka.GroupState.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::Header &row);// cfmt:kafka.Header.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::OffsetCommitKey &row);// cfmt:kafka.OffsetCommitKey.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::OffsetCommitValue &row);// cfmt:kafka.OffsetCommitValue.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::PatternType &row);// cfmt:kafka.PatternType.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::Record &row);// cfmt:kafka.Record.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::RecordBatch &row);// cfmt:kafka.RecordBatch.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::ResourceType &row);// cfmt:kafka.ResourceType.String +inline algo::cstring &operator <<(algo::cstring &str, const kafka::TimestampType &row);// cfmt:kafka.TimestampType.String +} diff --git a/include/gen/kafka_gen.inl.h b/include/gen/kafka_gen.inl.h new file mode 100644 index 00000000..015dea68 --- /dev/null +++ b/include/gen/kafka_gen.inl.h @@ -0,0 +1,1667 @@ +// +// include/gen/kafka_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude + +// --- kafka.AclOperationType.value.GetEnum +// Get value of field as enum type +inline kafka_AclOperationTypeEnum kafka::value_GetEnum(const kafka::AclOperationType& parent) { + return kafka_AclOperationTypeEnum(parent.value); +} + +// --- kafka.AclOperationType.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::AclOperationType& parent, kafka_AclOperationTypeEnum rhs) { + parent.value = u8(rhs); +} + +// --- kafka.AclOperationType..Init +// Set all fields to initial values. +inline void kafka::AclOperationType_Init(kafka::AclOperationType& parent) { + parent.value = u8(0); +} + +// --- kafka.AclOperationType..Ctor +inline kafka::AclOperationType::AclOperationType() { + kafka::AclOperationType_Init(*this); +} + +// --- kafka.AclOperationType..FieldwiseCtor +inline kafka::AclOperationType::AclOperationType(u8 in_value) + : value(in_value) + { +} + +// --- kafka.AclOperationType..EnumCtor +inline kafka::AclOperationType::AclOperationType(kafka_AclOperationTypeEnum arg) { + this->value = u8(arg); +} + +// --- kafka.AclOperations.value.Cast +inline kafka::AclOperations::operator kafka_AclOperationsEnum() const { + return kafka_AclOperationsEnum((*this).value); +} + +// --- kafka.AclOperations.UNKNOWN.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 0. +inline bool kafka::UNKNOWN_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 0) & 0x01); +} + +// --- kafka.AclOperations.UNKNOWN.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 0. +inline void kafka::UNKNOWN_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 0; + i32 t2 = (i32(rhs) & 0x01) << 0; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.ANY.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 1. +inline bool kafka::ANY_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 1) & 0x01); +} + +// --- kafka.AclOperations.ANY.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 1. +inline void kafka::ANY_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 1; + i32 t2 = (i32(rhs) & 0x01) << 1; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.ALL.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 2. +inline bool kafka::ALL_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 2) & 0x01); +} + +// --- kafka.AclOperations.ALL.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 2. +inline void kafka::ALL_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 2; + i32 t2 = (i32(rhs) & 0x01) << 2; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.READ.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 3. +inline bool kafka::READ_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 3) & 0x01); +} + +// --- kafka.AclOperations.READ.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 3. +inline void kafka::READ_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 3; + i32 t2 = (i32(rhs) & 0x01) << 3; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.WRITE.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 4. +inline bool kafka::WRITE_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 4) & 0x01); +} + +// --- kafka.AclOperations.WRITE.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 4. +inline void kafka::WRITE_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 4; + i32 t2 = (i32(rhs) & 0x01) << 4; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.CREATE.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 5. +inline bool kafka::CREATE_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 5) & 0x01); +} + +// --- kafka.AclOperations.CREATE.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 5. +inline void kafka::CREATE_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 5; + i32 t2 = (i32(rhs) & 0x01) << 5; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.DELETE.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 6. +inline bool kafka::DELETE_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 6) & 0x01); +} + +// --- kafka.AclOperations.DELETE.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 6. +inline void kafka::DELETE_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 6; + i32 t2 = (i32(rhs) & 0x01) << 6; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.ALTER.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 7. +inline bool kafka::ALTER_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 7) & 0x01); +} + +// --- kafka.AclOperations.ALTER.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 7. +inline void kafka::ALTER_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 7; + i32 t2 = (i32(rhs) & 0x01) << 7; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.DESCRIBE.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 8. +inline bool kafka::DESCRIBE_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 8) & 0x01); +} + +// --- kafka.AclOperations.DESCRIBE.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 8. +inline void kafka::DESCRIBE_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 8; + i32 t2 = (i32(rhs) & 0x01) << 8; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.CLUSTER_ACTION.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 9. +inline bool kafka::CLUSTER_ACTION_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 9) & 0x01); +} + +// --- kafka.AclOperations.CLUSTER_ACTION.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 9. +inline void kafka::CLUSTER_ACTION_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 9; + i32 t2 = (i32(rhs) & 0x01) << 9; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.DESCRIBE_CONFIGS.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 10. +inline bool kafka::DESCRIBE_CONFIGS_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 10) & 0x01); +} + +// --- kafka.AclOperations.DESCRIBE_CONFIGS.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 10. +inline void kafka::DESCRIBE_CONFIGS_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 10; + i32 t2 = (i32(rhs) & 0x01) << 10; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.ALTER_CONFIGS.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 11. +inline bool kafka::ALTER_CONFIGS_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 11) & 0x01); +} + +// --- kafka.AclOperations.ALTER_CONFIGS.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 11. +inline void kafka::ALTER_CONFIGS_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 11; + i32 t2 = (i32(rhs) & 0x01) << 11; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.IDEMPOTENT_WRITE.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 12. +inline bool kafka::IDEMPOTENT_WRITE_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 12) & 0x01); +} + +// --- kafka.AclOperations.IDEMPOTENT_WRITE.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 12. +inline void kafka::IDEMPOTENT_WRITE_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 12; + i32 t2 = (i32(rhs) & 0x01) << 12; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.CREATE_TOKENS.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 13. +inline bool kafka::CREATE_TOKENS_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 13) & 0x01); +} + +// --- kafka.AclOperations.CREATE_TOKENS.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 13. +inline void kafka::CREATE_TOKENS_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 13; + i32 t2 = (i32(rhs) & 0x01) << 13; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.DESCRIBE_TOKENS.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 14. +inline bool kafka::DESCRIBE_TOKENS_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 14) & 0x01); +} + +// --- kafka.AclOperations.DESCRIBE_TOKENS.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 14. +inline void kafka::DESCRIBE_TOKENS_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 14; + i32 t2 = (i32(rhs) & 0x01) << 14; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations.OMITTED.Get +// Retrieve bitfield from value of field value +// 1 bits starting at bit 31. +inline bool kafka::OMITTED_Get(const kafka::AclOperations& parent) { + return bool((parent.value >> 31) & 0x01); +} + +// --- kafka.AclOperations.OMITTED.Set +// Set bitfield in value of field 'value' +// 1 bits starting at bit 31. +inline void kafka::OMITTED_Set(kafka::AclOperations& parent, bool rhs) { + i32 t1 = i32(0x01) << 31; + i32 t2 = (i32(rhs) & 0x01) << 31; + parent.value = i32((parent.value & ~t1) | t2); +} + +// --- kafka.AclOperations..Ctor +inline kafka::AclOperations::AclOperations() { + kafka::AclOperations_Init(*this); +} + +// --- kafka.AclOperations..FieldwiseCtor +inline kafka::AclOperations::AclOperations(i32 in_value) + : value(in_value) + { +} + +// --- kafka.AclOperations..EnumCtor +inline kafka::AclOperations::AclOperations(kafka_AclOperationsEnum arg) { + this->value = i32(arg); +} + +// --- kafka.AclPermissionType.value.GetEnum +// Get value of field as enum type +inline kafka_AclPermissionTypeEnum kafka::value_GetEnum(const kafka::AclPermissionType& parent) { + return kafka_AclPermissionTypeEnum(parent.value); +} + +// --- kafka.AclPermissionType.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::AclPermissionType& parent, kafka_AclPermissionTypeEnum rhs) { + parent.value = u8(rhs); +} + +// --- kafka.AclPermissionType..Init +// Set all fields to initial values. +inline void kafka::AclPermissionType_Init(kafka::AclPermissionType& parent) { + parent.value = u8(0); +} + +// --- kafka.AclPermissionType..Ctor +inline kafka::AclPermissionType::AclPermissionType() { + kafka::AclPermissionType_Init(*this); +} + +// --- kafka.AclPermissionType..FieldwiseCtor +inline kafka::AclPermissionType::AclPermissionType(u8 in_value) + : value(in_value) + { +} + +// --- kafka.AclPermissionType..EnumCtor +inline kafka::AclPermissionType::AclPermissionType(kafka_AclPermissionTypeEnum arg) { + this->value = u8(arg); +} + +// --- kafka.CompressionType.value.GetEnum +// Get value of field as enum type +inline kafka_CompressionTypeEnum kafka::value_GetEnum(const kafka::CompressionType& parent) { + return kafka_CompressionTypeEnum(parent.value); +} + +// --- kafka.CompressionType.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::CompressionType& parent, kafka_CompressionTypeEnum rhs) { + parent.value = u8(rhs); +} + +// --- kafka.CompressionType..Init +// Set all fields to initial values. +inline void kafka::CompressionType_Init(kafka::CompressionType& parent) { + parent.value = u8(0); +} + +// --- kafka.CompressionType..Ctor +inline kafka::CompressionType::CompressionType() { + kafka::CompressionType_Init(*this); +} + +// --- kafka.CompressionType..FieldwiseCtor +inline kafka::CompressionType::CompressionType(u8 in_value) + : value(in_value) + { +} + +// --- kafka.CompressionType..EnumCtor +inline kafka::CompressionType::CompressionType(kafka_CompressionTypeEnum arg) { + this->value = u8(arg); +} + +// --- kafka.ConfigSource.value.GetEnum +// Get value of field as enum type +inline kafka_ConfigSourceEnum kafka::value_GetEnum(const kafka::ConfigSource& parent) { + return kafka_ConfigSourceEnum(parent.value); +} + +// --- kafka.ConfigSource.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::ConfigSource& parent, kafka_ConfigSourceEnum rhs) { + parent.value = u8(rhs); +} + +// --- kafka.ConfigSource..Hash +inline u32 kafka::ConfigSource_Hash(u32 prev, const kafka::ConfigSource& rhs) { + prev = u8_Hash(prev, rhs.value); + return prev; +} + +// --- kafka.ConfigSource..EqOp +inline bool kafka::ConfigSource::operator ==(const kafka::ConfigSource &rhs) const { + return kafka::ConfigSource_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- kafka.ConfigSource..NeOp +inline bool kafka::ConfigSource::operator !=(const kafka::ConfigSource &rhs) const { + return !kafka::ConfigSource_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- kafka.ConfigSource..Cmp +inline i32 kafka::ConfigSource_Cmp(kafka::ConfigSource& lhs, kafka::ConfigSource& rhs) { + i32 retval = 0; + retval = u8_Cmp(lhs.value, rhs.value); + return retval; +} + +// --- kafka.ConfigSource..Init +// Set all fields to initial values. +inline void kafka::ConfigSource_Init(kafka::ConfigSource& parent) { + parent.value = u8(0); +} + +// --- kafka.ConfigSource..Eq +inline bool kafka::ConfigSource_Eq(kafka::ConfigSource& lhs, kafka::ConfigSource& rhs) { + bool retval = true; + retval = u8_Eq(lhs.value, rhs.value); + return retval; +} + +// --- kafka.ConfigSource..EqEnum +// define enum comparison operator to avoid ambiguity +inline bool kafka::ConfigSource::operator ==(kafka_ConfigSourceEnum rhs) const { + return kafka_ConfigSourceEnum(value) == rhs; +} + +// --- kafka.ConfigSource..Ctor +inline kafka::ConfigSource::ConfigSource() { + kafka::ConfigSource_Init(*this); +} + +// --- kafka.ConfigSource..FieldwiseCtor +inline kafka::ConfigSource::ConfigSource(u8 in_value) + : value(in_value) + { +} + +// --- kafka.ConfigSource..EnumCtor +inline kafka::ConfigSource::ConfigSource(kafka_ConfigSourceEnum arg) { + this->value = u8(arg); +} + +// --- kafka.ConfigType.value.GetEnum +// Get value of field as enum type +inline kafka_ConfigTypeEnum kafka::value_GetEnum(const kafka::ConfigType& parent) { + return kafka_ConfigTypeEnum(parent.value); +} + +// --- kafka.ConfigType.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::ConfigType& parent, kafka_ConfigTypeEnum rhs) { + parent.value = u8(rhs); +} + +// --- kafka.ConfigType..Hash +inline u32 kafka::ConfigType_Hash(u32 prev, const kafka::ConfigType& rhs) { + prev = u8_Hash(prev, rhs.value); + return prev; +} + +// --- kafka.ConfigType..EqOp +inline bool kafka::ConfigType::operator ==(const kafka::ConfigType &rhs) const { + return kafka::ConfigType_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- kafka.ConfigType..NeOp +inline bool kafka::ConfigType::operator !=(const kafka::ConfigType &rhs) const { + return !kafka::ConfigType_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- kafka.ConfigType..Cmp +inline i32 kafka::ConfigType_Cmp(kafka::ConfigType& lhs, kafka::ConfigType& rhs) { + i32 retval = 0; + retval = u8_Cmp(lhs.value, rhs.value); + return retval; +} + +// --- kafka.ConfigType..Init +// Set all fields to initial values. +inline void kafka::ConfigType_Init(kafka::ConfigType& parent) { + parent.value = u8(0); +} + +// --- kafka.ConfigType..Eq +inline bool kafka::ConfigType_Eq(kafka::ConfigType& lhs, kafka::ConfigType& rhs) { + bool retval = true; + retval = u8_Eq(lhs.value, rhs.value); + return retval; +} + +// --- kafka.ConfigType..EqEnum +// define enum comparison operator to avoid ambiguity +inline bool kafka::ConfigType::operator ==(kafka_ConfigTypeEnum rhs) const { + return kafka_ConfigTypeEnum(value) == rhs; +} + +// --- kafka.ConfigType..Ctor +inline kafka::ConfigType::ConfigType() { + kafka::ConfigType_Init(*this); +} + +// --- kafka.ConfigType..FieldwiseCtor +inline kafka::ConfigType::ConfigType(u8 in_value) + : value(in_value) + { +} + +// --- kafka.ConfigType..EnumCtor +inline kafka::ConfigType::ConfigType(kafka_ConfigTypeEnum arg) { + this->value = u8(arg); +} + +// --- kafka.Error.value.Cast +inline kafka::Error::operator i16() const { + return i16((*this).value); +} + +// --- kafka.Error..Init +// Set all fields to initial values. +inline void kafka::Error_Init(kafka::Error& parent) { + parent.value = i16(0); +} + +// --- kafka.Error..Ctor +inline kafka::Error::Error() { + kafka::Error_Init(*this); +} + +// --- kafka.Error..FieldwiseCtor +inline kafka::Error::Error(i16 in_value) + : value(in_value) + { +} + +// --- kafka.FieldId.value.GetEnum +// Get value of field as enum type +inline kafka_FieldIdEnum kafka::value_GetEnum(const kafka::FieldId& parent) { + return kafka_FieldIdEnum(parent.value); +} + +// --- kafka.FieldId.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::FieldId& parent, kafka_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- kafka.FieldId.value.Cast +inline kafka::FieldId::operator kafka_FieldIdEnum() const { + return kafka_FieldIdEnum((*this).value); +} + +// --- kafka.FieldId..Init +// Set all fields to initial values. +inline void kafka::FieldId_Init(kafka::FieldId& parent) { + parent.value = i32(-1); +} + +// --- kafka.FieldId..Ctor +inline kafka::FieldId::FieldId() { + kafka::FieldId_Init(*this); +} + +// --- kafka.FieldId..FieldwiseCtor +inline kafka::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- kafka.FieldId..EnumCtor +inline kafka::FieldId::FieldId(kafka_FieldIdEnum arg) { + this->value = i32(arg); +} + +// --- kafka.Frame.size.Get +inline i32 kafka::size_Get(const kafka::Frame& parent) { + return be32toh(parent.size_be); // read big-endian value from memory +} + +// --- kafka.Frame.size.Set +inline void kafka::size_Set(kafka::Frame& parent, i32 rhs) { + parent.size_be = htobe32(rhs); // write big-endian value to memory +} + +// --- kafka.Frame.payload.N +// Return number of elements in varlen field +inline u32 kafka::payload_N(const kafka::Frame& parent) { + u32 length = i32(size_Get(((kafka::Frame&)parent)) + 4); + u32 extra_bytes = u32_Max(length,sizeof(kafka::Frame)) - sizeof(kafka::Frame); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(u8)); +} + +// --- kafka.Frame.payload_curs.Reset +inline void kafka::Frame_payload_curs_Reset(Frame_payload_curs &curs, kafka::Frame &parent) { + curs.ptr = (u8*)payload_Addr(parent); + curs.length = i32(size_Get(parent) + 4) - sizeof(kafka::Frame); + curs.index = 0; +} + +// --- kafka.Frame.payload_curs.ValidQ +// cursor points to valid item +inline bool kafka::Frame_payload_curs_ValidQ(Frame_payload_curs &curs) { + bool valid = ssizeof(u8) <= curs.length; + return valid; +} + +// --- kafka.Frame.payload_curs.Next +// proceed to next item +inline void kafka::Frame_payload_curs_Next(Frame_payload_curs &curs) { + i32 len = i32(sizeof(u8)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- kafka.Frame.payload_curs.Access +// item access +inline u8& kafka::Frame_payload_curs_Access(Frame_payload_curs &curs) { + return *(u8*)curs.ptr; +} + +// --- kafka.Frame..GetMsgLength +// Message length (uses length field) +inline i32 kafka::GetMsgLength(const kafka::Frame& parent) { + return i32(size_Get(const_cast(parent)) + 4); +} + +// --- kafka.Frame..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr kafka::GetMsgMemptr(const kafka::Frame& row) { + return algo::memptr((u8*)&row, i32(size_Get(const_cast(row)) + 4)); +} + +// --- kafka.Frame..Init +// Set all fields to initial values. +inline void kafka::Frame_Init(kafka::Frame& parent) { + parent.size_be = htobe32(0); // write big-endian value to memory +} + +// --- kafka.Frame..Ctor +inline kafka::Frame::Frame() { + kafka::Frame_Init(*this); +} + +// --- kafka.Frame_curs..ValidQ +inline bool kafka::Frame_curs_ValidQ(kafka::Frame_curs& curs) { + return curs.msg != NULL; +} + +// --- kafka.Frame_curs..Reset +inline void kafka::Frame_curs_Reset(kafka::Frame_curs& curs, algo::memptr buf) { + curs.bytes = buf.elems; + curs.limit = buf.n_elems; + kafka::Frame *msg = NULL; + int msglen = 0; + if (curs.limit >= ssizeof(kafka::Frame)) { + kafka::Frame *ptr = (kafka::Frame*)curs.bytes; + msglen = i32(size_Get((*ptr)) + 4); + if (msglen >= ssizeof(kafka::Frame) && curs.limit >= msglen) { + msg = ptr; + } + } + curs.msg = msg; + curs.msglen = msglen; +} + +// --- kafka.Frame_curs..Access +inline kafka::Frame*& kafka::Frame_curs_Access(kafka::Frame_curs& curs) { + return curs.msg; +} + +// --- kafka.Frame_curs..Next +inline void kafka::Frame_curs_Next(kafka::Frame_curs& curs) { + curs.bytes += curs.msglen; + curs.limit -= curs.msglen; + kafka::Frame *msg = NULL; + int msglen = 0; + if (curs.limit >= ssizeof(kafka::Frame)) { + kafka::Frame *ptr = (kafka::Frame*)curs.bytes; + msglen = i32(size_Get((*ptr)) + 4); + if (msglen >= ssizeof(kafka::Frame) && curs.limit >= msglen) { + msg = ptr; + } + } + curs.msg = msg; + curs.msglen = msglen; +} + +// --- kafka.Frame_curs..Init +// Set all fields to initial values. +inline void kafka::Frame_curs_Init(kafka::Frame_curs& parent) { + parent.msg = NULL; + parent.bytes = NULL; + parent.limit = i32(0); + parent.msglen = i32(0); +} + +// --- kafka.Frame_curs..Ctor +inline kafka::Frame_curs::Frame_curs() { + kafka::Frame_curs_Init(*this); +} + +// --- kafka.GroupRecordKeyHeader.type.GetEnum +// Get value of field as enum type +inline kafka_GroupRecordKeyHeader_type_Enum kafka::type_GetEnum(const kafka::GroupRecordKeyHeader& parent) { + return kafka_GroupRecordKeyHeader_type_Enum(parent.type); +} + +// --- kafka.GroupRecordKeyHeader.type.SetEnum +// Set value of field from enum type. +inline void kafka::type_SetEnum(kafka::GroupRecordKeyHeader& parent, kafka_GroupRecordKeyHeader_type_Enum rhs) { + parent.type = i16(rhs); +} + +// --- kafka.GroupRecordKeyHeader..Init +// Set all fields to initial values. +inline void kafka::GroupRecordKeyHeader_Init(kafka::GroupRecordKeyHeader& parent) { + parent.type = i16(0); + parent.version = i16(0); +} + +// --- kafka.GroupRecordKeyHeader..Ctor +inline kafka::GroupRecordKeyHeader::GroupRecordKeyHeader() { + kafka::GroupRecordKeyHeader_Init(*this); +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase.value.GetEnum +// Get value of field as enum type +inline kafka_GroupRecordKeyHeaderMsgsCaseEnum kafka::value_GetEnum(const kafka::GroupRecordKeyHeaderMsgsCase& parent) { + return kafka_GroupRecordKeyHeaderMsgsCaseEnum(parent.value); +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::GroupRecordKeyHeaderMsgsCase& parent, kafka_GroupRecordKeyHeaderMsgsCaseEnum rhs) { + parent.value = u32(rhs); +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase.value.Cast +inline kafka::GroupRecordKeyHeaderMsgsCase::operator kafka_GroupRecordKeyHeaderMsgsCaseEnum() const { + return kafka_GroupRecordKeyHeaderMsgsCaseEnum((*this).value); +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase..Init +// Set all fields to initial values. +inline void kafka::GroupRecordKeyHeaderMsgsCase_Init(kafka::GroupRecordKeyHeaderMsgsCase& parent) { + parent.value = u32(0); +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase..Ctor +inline kafka::GroupRecordKeyHeaderMsgsCase::GroupRecordKeyHeaderMsgsCase() { + kafka::GroupRecordKeyHeaderMsgsCase_Init(*this); +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase..FieldwiseCtor +inline kafka::GroupRecordKeyHeaderMsgsCase::GroupRecordKeyHeaderMsgsCase(u32 in_value) + : value(in_value) + { +} + +// --- kafka.GroupRecordKeyHeaderMsgsCase..EnumCtor +inline kafka::GroupRecordKeyHeaderMsgsCase::GroupRecordKeyHeaderMsgsCase(kafka_GroupRecordKeyHeaderMsgsCaseEnum arg) { + this->value = u32(arg); +} + +// --- kafka.GroupRecordValueHeader.type.GetEnum +// Get value of field as enum type +inline kafka_GroupRecordValueHeader_type_Enum kafka::type_GetEnum(const kafka::GroupRecordValueHeader& parent) { + return kafka_GroupRecordValueHeader_type_Enum(parent.type); +} + +// --- kafka.GroupRecordValueHeader.type.SetEnum +// Set value of field from enum type. +inline void kafka::type_SetEnum(kafka::GroupRecordValueHeader& parent, kafka_GroupRecordValueHeader_type_Enum rhs) { + parent.type = i16(rhs); +} + +// --- kafka.GroupRecordValueHeader..Init +// Set all fields to initial values. +inline void kafka::GroupRecordValueHeader_Init(kafka::GroupRecordValueHeader& parent) { + parent.type = i16(0); + parent.version = i16(0); +} + +// --- kafka.GroupRecordValueHeader..Ctor +inline kafka::GroupRecordValueHeader::GroupRecordValueHeader() { + kafka::GroupRecordValueHeader_Init(*this); +} + +// --- kafka.GroupRecordValueHeaderMsgsCase.value.GetEnum +// Get value of field as enum type +inline kafka_GroupRecordValueHeaderMsgsCaseEnum kafka::value_GetEnum(const kafka::GroupRecordValueHeaderMsgsCase& parent) { + return kafka_GroupRecordValueHeaderMsgsCaseEnum(parent.value); +} + +// --- kafka.GroupRecordValueHeaderMsgsCase.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::GroupRecordValueHeaderMsgsCase& parent, kafka_GroupRecordValueHeaderMsgsCaseEnum rhs) { + parent.value = u32(rhs); +} + +// --- kafka.GroupRecordValueHeaderMsgsCase.value.Cast +inline kafka::GroupRecordValueHeaderMsgsCase::operator kafka_GroupRecordValueHeaderMsgsCaseEnum() const { + return kafka_GroupRecordValueHeaderMsgsCaseEnum((*this).value); +} + +// --- kafka.GroupRecordValueHeaderMsgsCase..Init +// Set all fields to initial values. +inline void kafka::GroupRecordValueHeaderMsgsCase_Init(kafka::GroupRecordValueHeaderMsgsCase& parent) { + parent.value = u32(0); +} + +// --- kafka.GroupRecordValueHeaderMsgsCase..Ctor +inline kafka::GroupRecordValueHeaderMsgsCase::GroupRecordValueHeaderMsgsCase() { + kafka::GroupRecordValueHeaderMsgsCase_Init(*this); +} + +// --- kafka.GroupRecordValueHeaderMsgsCase..FieldwiseCtor +inline kafka::GroupRecordValueHeaderMsgsCase::GroupRecordValueHeaderMsgsCase(u32 in_value) + : value(in_value) + { +} + +// --- kafka.GroupRecordValueHeaderMsgsCase..EnumCtor +inline kafka::GroupRecordValueHeaderMsgsCase::GroupRecordValueHeaderMsgsCase(kafka_GroupRecordValueHeaderMsgsCaseEnum arg) { + this->value = u32(arg); +} + +// --- kafka.GroupState.value.GetEnum +// Get value of field as enum type +inline kafka_GroupStateEnum kafka::value_GetEnum(const kafka::GroupState& parent) { + return kafka_GroupStateEnum(parent.value); +} + +// --- kafka.GroupState.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::GroupState& parent, kafka_GroupStateEnum rhs) { + parent.value = u8(rhs); +} + +// --- kafka.GroupState..Hash +inline u32 kafka::GroupState_Hash(u32 prev, const kafka::GroupState& rhs) { + prev = u8_Hash(prev, rhs.value); + return prev; +} + +// --- kafka.GroupState..EqOp +inline bool kafka::GroupState::operator ==(const kafka::GroupState &rhs) const { + return kafka::GroupState_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- kafka.GroupState..NeOp +inline bool kafka::GroupState::operator !=(const kafka::GroupState &rhs) const { + return !kafka::GroupState_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- kafka.GroupState..Cmp +inline i32 kafka::GroupState_Cmp(kafka::GroupState& lhs, kafka::GroupState& rhs) { + i32 retval = 0; + retval = u8_Cmp(lhs.value, rhs.value); + return retval; +} + +// --- kafka.GroupState..Init +// Set all fields to initial values. +inline void kafka::GroupState_Init(kafka::GroupState& parent) { + parent.value = u8(5); +} + +// --- kafka.GroupState..Eq +inline bool kafka::GroupState_Eq(kafka::GroupState& lhs, kafka::GroupState& rhs) { + bool retval = true; + retval = u8_Eq(lhs.value, rhs.value); + return retval; +} + +// --- kafka.GroupState..EqEnum +// define enum comparison operator to avoid ambiguity +inline bool kafka::GroupState::operator ==(kafka_GroupStateEnum rhs) const { + return kafka_GroupStateEnum(value) == rhs; +} + +// --- kafka.GroupState..Ctor +inline kafka::GroupState::GroupState() { + kafka::GroupState_Init(*this); +} + +// --- kafka.GroupState..FieldwiseCtor +inline kafka::GroupState::GroupState(u8 in_value) + : value(in_value) + { +} + +// --- kafka.GroupState..EnumCtor +inline kafka::GroupState::GroupState(kafka_GroupStateEnum arg) { + this->value = u8(arg); +} + +// --- kafka.Header..Ctor +inline kafka::Header::Header() { +} + +// --- kafka.OffsetCommitKey.base.Castdown +// Check if kafka::GroupRecordKeyHeader is an instance of OffsetCommitKey by checking the type field +// If it is, return the pointer of target type. +// If not successful, quietly return NULL. +inline kafka::OffsetCommitKey* kafka::OffsetCommitKey_Castdown(kafka::GroupRecordKeyHeader &hdr) { + bool cond = hdr.type == (1); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- kafka.OffsetCommitKey.base.Castbase +inline kafka::GroupRecordKeyHeader& kafka::Castbase(kafka::OffsetCommitKey& parent) { + return reinterpret_cast(parent); +} + +// --- kafka.OffsetCommitKey..Init +// Set all fields to initial values. +inline void kafka::OffsetCommitKey_Init(kafka::OffsetCommitKey& parent) { + parent.type = i16(1); + parent.version = i16(0); + parent.partition = i32(0); +} + +// --- kafka.OffsetCommitKey..Ctor +inline kafka::OffsetCommitKey::OffsetCommitKey() { + kafka::OffsetCommitKey_Init(*this); +} + +// --- kafka.OffsetCommitValue.base.Castdown +// Check if kafka::GroupRecordValueHeader is an instance of OffsetCommitValue by checking the type field +// If it is, return the pointer of target type. +// If not successful, quietly return NULL. +inline kafka::OffsetCommitValue* kafka::OffsetCommitValue_Castdown(kafka::GroupRecordValueHeader &hdr) { + bool cond = hdr.type == (1); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- kafka.OffsetCommitValue.base.Castbase +inline kafka::GroupRecordValueHeader& kafka::Castbase(kafka::OffsetCommitValue& parent) { + return reinterpret_cast(parent); +} + +// --- kafka.OffsetCommitValue..Init +// Set all fields to initial values. +inline void kafka::OffsetCommitValue_Init(kafka::OffsetCommitValue& parent) { + parent.type = i16(1); + parent.version = i16(0); + parent.offset = i64(0); + parent.leader_epoch = i32(-1); + parent.commit_timestamp = i64(0); + parent.expire_timestamp = i64(-1); +} + +// --- kafka.OffsetCommitValue..Ctor +inline kafka::OffsetCommitValue::OffsetCommitValue() { + kafka::OffsetCommitValue_Init(*this); +} + +// --- kafka.PatternType.value.GetEnum +// Get value of field as enum type +inline kafka_PatternTypeEnum kafka::value_GetEnum(const kafka::PatternType& parent) { + return kafka_PatternTypeEnum(parent.value); +} + +// --- kafka.PatternType.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::PatternType& parent, kafka_PatternTypeEnum rhs) { + parent.value = u8(rhs); +} + +// --- kafka.PatternType..Hash +inline u32 kafka::PatternType_Hash(u32 prev, const kafka::PatternType& rhs) { + prev = u8_Hash(prev, rhs.value); + return prev; +} + +// --- kafka.PatternType..EqOp +inline bool kafka::PatternType::operator ==(const kafka::PatternType &rhs) const { + return kafka::PatternType_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- kafka.PatternType..NeOp +inline bool kafka::PatternType::operator !=(const kafka::PatternType &rhs) const { + return !kafka::PatternType_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- kafka.PatternType..Cmp +inline i32 kafka::PatternType_Cmp(kafka::PatternType& lhs, kafka::PatternType& rhs) { + i32 retval = 0; + retval = u8_Cmp(lhs.value, rhs.value); + return retval; +} + +// --- kafka.PatternType..Init +// Set all fields to initial values. +inline void kafka::PatternType_Init(kafka::PatternType& parent) { + parent.value = u8(0); +} + +// --- kafka.PatternType..Eq +inline bool kafka::PatternType_Eq(kafka::PatternType& lhs, kafka::PatternType& rhs) { + bool retval = true; + retval = u8_Eq(lhs.value, rhs.value); + return retval; +} + +// --- kafka.PatternType..EqEnum +// define enum comparison operator to avoid ambiguity +inline bool kafka::PatternType::operator ==(kafka_PatternTypeEnum rhs) const { + return kafka_PatternTypeEnum(value) == rhs; +} + +// --- kafka.PatternType..Ctor +inline kafka::PatternType::PatternType() { + kafka::PatternType_Init(*this); +} + +// --- kafka.PatternType..FieldwiseCtor +inline kafka::PatternType::PatternType(u8 in_value) + : value(in_value) + { +} + +// --- kafka.PatternType..EnumCtor +inline kafka::PatternType::PatternType(kafka_PatternTypeEnum arg) { + this->value = u8(arg); +} + +// --- kafka.Record.pmask.N +// Return constant 1 +inline int kafka::pmask_N(kafka::Record& parent) { + (void)parent; + return 1; +} + +// --- kafka.Record.pmask.qFind +// Access value +inline u8& kafka::pmask_qFind(kafka::Record& parent, int) { + return parent.pmask; +} + +// --- kafka.Record.pmask.NBits +// Get max # of bits in the bitset +// Return max. number of bits supported by array +inline int kafka::pmask_Nbits(kafka::Record& parent) { + return pmask_N(parent) * 8; +} + +// --- kafka.Record.pmask.qGetBit +// Retrieve value of bit #BIT_IDX in bit set. No bounds checking +inline bool kafka::pmask_qGetBit(kafka::Record& parent, u32 bit_idx) { + u64 elem_idx = bit_idx >> 3; + u64 shift = bit_idx & 7; + u8 &elem = pmask_qFind(parent, elem_idx); // fetch element + return bool((elem >> shift) & 1); // extract bit +} + +// --- kafka.Record.pmask.GetBit +// Retrieve value of bit #BIT_IDX in bit set. If bit index is out of bounds, return 0. +inline bool kafka::pmask_GetBit(kafka::Record& parent, u32 bit_idx) { + u64 elem_idx = bit_idx >> 3; + u64 shift = bit_idx & 7; + bool ret = false; + u64 lim = pmask_N(parent); + if (elem_idx < lim) { + u8 &elem = pmask_qFind(parent, elem_idx); // fetch element + ret = (elem >> shift) & 1; // extract bit + } + return ret; +} + +// --- kafka.Record.pmask.BitsEmptyQ +// Check if all the bits in the bitset are equal to zero +inline bool kafka::pmask_BitsEmptyQ(kafka::Record& parent) { + bool retval = true; + u64 n = pmask_N(parent); + for (u64 i = 0; i < n; i++) { + if (pmask_qFind(parent,i) != 0) { + retval = false; + break; + } + } + return retval; +} + +// --- kafka.Record.pmask.Sum1s +inline u64 kafka::pmask_Sum1s(kafka::Record& parent) { + u64 sum = 0; + u64 n = pmask_N(parent); + for (u64 i = 0; i < n; i++) { + sum += algo::u8_Count1s(pmask_qFind(parent, i)); + } + return sum; +} + +// --- kafka.Record.pmask.qClearBit +// Clear bit # BIT_IDX in bit set. No bounds checking +inline void kafka::pmask_qClearBit(kafka::Record& parent, u32 bit_idx) { + u64 elem_idx = bit_idx >> 3; + u64 shift = bit_idx & 7; + u8 &elem = pmask_qFind(parent, elem_idx); // fetch + elem = elem & ~(u8(1) << shift); // clear bit +} + +// --- kafka.Record.pmask.ClearBit +// Clear bit # BIT_IDX in bit set. If bit index is out of bounds, do nothing +inline void kafka::pmask_ClearBit(kafka::Record& parent, u32 bit_idx) { + u64 elem_idx = bit_idx >> 3; + u64 shift = bit_idx & 7; + u64 lim = pmask_N(parent); + if (elem_idx < lim) { + u8 &elem = pmask_qFind(parent, elem_idx); // fetch + elem = elem & ~(u8(1) << shift); // clear bit + } +} + +// --- kafka.Record.pmask.qSetBit +// Set bit # BIT_IDX in bit set. No bounds checking +inline void kafka::pmask_qSetBit(kafka::Record& parent, u32 bit_idx) { + u64 elem_idx = bit_idx >> 3; + u64 shift = bit_idx & 7; + u8 &elem = pmask_qFind(parent, elem_idx); // fetch + elem = elem | (u8(1) << shift); // set bit +} + +// --- kafka.Record.pmask.SetBit +// Set bit # BIT_IDX in bit set. If bit index is out of bounds, do nothing. +inline void kafka::pmask_SetBit(kafka::Record& parent, u32 bit_idx) { + u64 elem_idx = bit_idx >> 3; + u64 shift = bit_idx & 7; + u64 lim = pmask_N(parent); + if (elem_idx < lim) { + u8 &elem = pmask_qFind(parent, elem_idx); // fetch + elem = elem | (u8(1) << shift); // set bit + } +} + +// --- kafka.Record.pmask.qSetBitVal +// Set bit # BIT_IDX in bit set. No bounds checking +inline void kafka::pmask_qSetBitVal(kafka::Record& parent, u32 bit_idx, bool val) { + u64 elem_idx = bit_idx >> 3; + u64 shift = bit_idx & 7; + u8 &elem = pmask_qFind(parent, elem_idx); // fetch + elem = (elem & ~(u8(1) << shift)) | (u8(val) << shift); // insert new value +} + +// --- kafka.Record.pmask.qOrBitVal +// Or bit # BIT_IDX in bit set. No bounds checking +inline void kafka::pmask_qOrBitVal(kafka::Record& parent, u32 bit_idx, bool val) { + u64 elem_idx = bit_idx >> 3; + u64 shift = bit_idx & 7; + u8 &elem = pmask_qFind(parent, elem_idx); // fetch + elem = elem | (u8(val) << shift); // Or in val into elem +} + +// --- kafka.Record.pmask.ClearBitsAll +// Set all bits of array to zero. +// Note: this does not change what NBits will return. +inline void kafka::pmask_ClearBitsAll(kafka::Record& parent) { + u64 n = pmask_N(parent); + for (u64 i = 0; i < n; i++) { + pmask_qFind(parent, i) = 0; + } +} + +// --- kafka.Record.pmask.ClearBits +// Zero in PARENT any bits that are set in RHS. +inline void kafka::pmask_ClearBits(kafka::Record& parent, kafka::Record &rhs) { + u64 n = u64_Min(pmask_N(parent), pmask_N(rhs)); + for (u64 i = 0; i < n; i++) { + pmask_qFind(parent, i) &= ~pmask_qFind(rhs, i); + } +} + +// --- kafka.Record.pmask.OrBits +// Set PARENT to union of two bitsets. +// (This function is not named Set.. to avoid triple entendre). +inline void kafka::pmask_OrBits(kafka::Record& parent, kafka::Record &rhs) { + u64 n = u64_Min(pmask_N(parent), pmask_N(rhs)); + for (u64 i = 0; i < n; i++) { + pmask_qFind(parent, i) |= pmask_qFind(rhs, i); + } +} + +// --- kafka.Record.pmask.Sup +// Return smallest number N such that indexes of all 1 bits are below N +inline i32 kafka::pmask_Sup(kafka::Record& parent) { + u64 lim = pmask_N(parent); + i32 ret = 0; + for (int i = lim-1; i >= 0; i--) { + u8 &val = pmask_qFind(parent, i); + if (val) { + u32 bitidx = algo::u64_BitScanReverse(val) + 1; + ret = i * 8 + bitidx; + break; + } + } + return ret; +} + +// --- kafka.Record.key.PresentQ +// Return true if the field is marked in the presence mask +inline bool kafka::key_PresentQ(kafka::Record& parent) { + return pmask_qGetBit(parent, 0); +} + +// --- kafka.Record.key.SetPresent +// Set presence bit for this field in the pmask +inline void kafka::key_SetPresent(kafka::Record& parent) { + pmask_qSetBit(parent, 0); // mark presence in pmask +} + +// --- kafka.Record.key.Present_GetBit +// Return field's bit number in the pmask +inline int kafka::key_Present_GetBit(kafka::Record& parent) { + int retval = 0; + (void)parent;//only to avoid -Wunused-parameter + return retval; +} + +// --- kafka.Record.key.Set +inline void kafka::key_Set(kafka::Record& parent, const algo::strptr& rhs) { + parent.key = rhs; + pmask_qSetBit(parent, 0); // mark presence in pmask +} + +// --- kafka.Record.headers.EmptyQ +// Return true if index is empty +inline bool kafka::headers_EmptyQ(kafka::Record& parent) { + return parent.headers_n == 0; +} + +// --- kafka.Record.headers.Find +// Look up row by row id. Return NULL if out of range +inline kafka::Header* kafka::headers_Find(kafka::Record& parent, u64 t) { + u64 idx = t; + u64 lim = parent.headers_n; + if (idx >= lim) return NULL; + return parent.headers_elems + idx; +} + +// --- kafka.Record.headers.Getary +// Return array pointer by value +inline algo::aryptr kafka::headers_Getary(const kafka::Record& parent) { + return algo::aryptr(parent.headers_elems, parent.headers_n); +} + +// --- kafka.Record.headers.Last +// Return pointer to last element of array, or NULL if array is empty +inline kafka::Header* kafka::headers_Last(kafka::Record& parent) { + return headers_Find(parent, u64(parent.headers_n-1)); +} + +// --- kafka.Record.headers.Max +// Return max. number of items in the array +inline i32 kafka::headers_Max(kafka::Record& parent) { + (void)parent; + return parent.headers_max; +} + +// --- kafka.Record.headers.N +// Return number of items in the array +inline i32 kafka::headers_N(const kafka::Record& parent) { + return parent.headers_n; +} + +// --- kafka.Record.headers.Reserve +// Make sure N *more* elements will fit in array. Process dies if out of memory +inline void kafka::headers_Reserve(kafka::Record& parent, int n) { + u32 new_n = parent.headers_n + n; + if (UNLIKELY(new_n > parent.headers_max)) { + headers_AbsReserve(parent, new_n); + } +} + +// --- kafka.Record.headers.qFind +// 'quick' Access row by row id. No bounds checking. +inline kafka::Header& kafka::headers_qFind(kafka::Record& parent, u64 t) { + return parent.headers_elems[t]; +} + +// --- kafka.Record.headers.qLast +// Return reference to last element of array. No bounds checking +inline kafka::Header& kafka::headers_qLast(kafka::Record& parent) { + return headers_qFind(parent, u64(parent.headers_n-1)); +} + +// --- kafka.Record.headers.rowid_Get +// Return row id of specified element +inline u64 kafka::headers_rowid_Get(kafka::Record& parent, kafka::Header &elem) { + u64 id = &elem - parent.headers_elems; + return u64(id); +} + +// --- kafka.Record.headers_curs.Next +// proceed to next item +inline void kafka::Record_headers_curs_Next(Record_headers_curs &curs) { + curs.index++; +} + +// --- kafka.Record.headers_curs.Reset +inline void kafka::Record_headers_curs_Reset(Record_headers_curs &curs, kafka::Record &parent) { + curs.elems = parent.headers_elems; + curs.n_elems = parent.headers_n; + curs.index = 0; +} + +// --- kafka.Record.headers_curs.ValidQ +// cursor points to valid item +inline bool kafka::Record_headers_curs_ValidQ(Record_headers_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- kafka.Record.headers_curs.Access +// item access +inline kafka::Header& kafka::Record_headers_curs_Access(Record_headers_curs &curs) { + return curs.elems[curs.index]; +} + +// --- kafka.Record..Init +// Set all fields to initial values. +inline void kafka::Record_Init(kafka::Record& parent) { + parent.attributes = u8(0); + parent.pmask = u8(0); + parent.timestamp_delta = i64(0); + parent.offset_delta = i32(0); + parent.headers_elems = 0; // (kafka.Record.headers) + parent.headers_n = 0; // (kafka.Record.headers) + parent.headers_max = 0; // (kafka.Record.headers) +} + +// --- kafka.Record..Ctor +inline kafka::Record::Record() { + kafka::Record_Init(*this); +} + +// --- kafka.Record..Dtor +inline kafka::Record::~Record() { + kafka::Record_Uninit(*this); +} + +// --- kafka.RecordBatch.records.EmptyQ +// Return true if index is empty +inline bool kafka::records_EmptyQ(kafka::RecordBatch& parent) { + return parent.records_n == 0; +} + +// --- kafka.RecordBatch.records.Find +// Look up row by row id. Return NULL if out of range +inline kafka::Record* kafka::records_Find(kafka::RecordBatch& parent, u64 t) { + u64 idx = t; + u64 lim = parent.records_n; + if (idx >= lim) return NULL; + return parent.records_elems + idx; +} + +// --- kafka.RecordBatch.records.Getary +// Return array pointer by value +inline algo::aryptr kafka::records_Getary(const kafka::RecordBatch& parent) { + return algo::aryptr(parent.records_elems, parent.records_n); +} + +// --- kafka.RecordBatch.records.Last +// Return pointer to last element of array, or NULL if array is empty +inline kafka::Record* kafka::records_Last(kafka::RecordBatch& parent) { + return records_Find(parent, u64(parent.records_n-1)); +} + +// --- kafka.RecordBatch.records.Max +// Return max. number of items in the array +inline i32 kafka::records_Max(kafka::RecordBatch& parent) { + (void)parent; + return parent.records_max; +} + +// --- kafka.RecordBatch.records.N +// Return number of items in the array +inline i32 kafka::records_N(const kafka::RecordBatch& parent) { + return parent.records_n; +} + +// --- kafka.RecordBatch.records.Reserve +// Make sure N *more* elements will fit in array. Process dies if out of memory +inline void kafka::records_Reserve(kafka::RecordBatch& parent, int n) { + u32 new_n = parent.records_n + n; + if (UNLIKELY(new_n > parent.records_max)) { + records_AbsReserve(parent, new_n); + } +} + +// --- kafka.RecordBatch.records.qFind +// 'quick' Access row by row id. No bounds checking. +inline kafka::Record& kafka::records_qFind(kafka::RecordBatch& parent, u64 t) { + return parent.records_elems[t]; +} + +// --- kafka.RecordBatch.records.qLast +// Return reference to last element of array. No bounds checking +inline kafka::Record& kafka::records_qLast(kafka::RecordBatch& parent) { + return records_qFind(parent, u64(parent.records_n-1)); +} + +// --- kafka.RecordBatch.records.rowid_Get +// Return row id of specified element +inline u64 kafka::records_rowid_Get(kafka::RecordBatch& parent, kafka::Record &elem) { + u64 id = &elem - parent.records_elems; + return u64(id); +} + +// --- kafka.RecordBatch.records_curs.Next +// proceed to next item +inline void kafka::RecordBatch_records_curs_Next(RecordBatch_records_curs &curs) { + curs.index++; +} + +// --- kafka.RecordBatch.records_curs.Reset +inline void kafka::RecordBatch_records_curs_Reset(RecordBatch_records_curs &curs, kafka::RecordBatch &parent) { + curs.elems = parent.records_elems; + curs.n_elems = parent.records_n; + curs.index = 0; +} + +// --- kafka.RecordBatch.records_curs.ValidQ +// cursor points to valid item +inline bool kafka::RecordBatch_records_curs_ValidQ(RecordBatch_records_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- kafka.RecordBatch.records_curs.Access +// item access +inline kafka::Record& kafka::RecordBatch_records_curs_Access(RecordBatch_records_curs &curs) { + return curs.elems[curs.index]; +} + +// --- kafka.RecordBatch..Ctor +inline kafka::RecordBatch::RecordBatch() { + kafka::RecordBatch_Init(*this); +} + +// --- kafka.RecordBatch..Dtor +inline kafka::RecordBatch::~RecordBatch() { + kafka::RecordBatch_Uninit(*this); +} + +// --- kafka.ResourceType.value.GetEnum +// Get value of field as enum type +inline kafka_ResourceTypeEnum kafka::value_GetEnum(const kafka::ResourceType& parent) { + return kafka_ResourceTypeEnum(parent.value); +} + +// --- kafka.ResourceType.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::ResourceType& parent, kafka_ResourceTypeEnum rhs) { + parent.value = u8(rhs); +} + +// --- kafka.ResourceType..Hash +inline u32 kafka::ResourceType_Hash(u32 prev, const kafka::ResourceType& rhs) { + prev = u8_Hash(prev, rhs.value); + return prev; +} + +// --- kafka.ResourceType..EqOp +inline bool kafka::ResourceType::operator ==(const kafka::ResourceType &rhs) const { + return kafka::ResourceType_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- kafka.ResourceType..NeOp +inline bool kafka::ResourceType::operator !=(const kafka::ResourceType &rhs) const { + return !kafka::ResourceType_Eq(const_cast(*this),const_cast(rhs)); +} + +// --- kafka.ResourceType..Cmp +inline i32 kafka::ResourceType_Cmp(kafka::ResourceType& lhs, kafka::ResourceType& rhs) { + i32 retval = 0; + retval = u8_Cmp(lhs.value, rhs.value); + return retval; +} + +// --- kafka.ResourceType..Init +// Set all fields to initial values. +inline void kafka::ResourceType_Init(kafka::ResourceType& parent) { + parent.value = u8(0); +} + +// --- kafka.ResourceType..Eq +inline bool kafka::ResourceType_Eq(kafka::ResourceType& lhs, kafka::ResourceType& rhs) { + bool retval = true; + retval = u8_Eq(lhs.value, rhs.value); + return retval; +} + +// --- kafka.ResourceType..EqEnum +// define enum comparison operator to avoid ambiguity +inline bool kafka::ResourceType::operator ==(kafka_ResourceTypeEnum rhs) const { + return kafka_ResourceTypeEnum(value) == rhs; +} + +// --- kafka.ResourceType..Ctor +inline kafka::ResourceType::ResourceType() { + kafka::ResourceType_Init(*this); +} + +// --- kafka.ResourceType..FieldwiseCtor +inline kafka::ResourceType::ResourceType(u8 in_value) + : value(in_value) + { +} + +// --- kafka.ResourceType..EnumCtor +inline kafka::ResourceType::ResourceType(kafka_ResourceTypeEnum arg) { + this->value = u8(arg); +} + +// --- kafka.TimestampType.value.GetEnum +// Get value of field as enum type +inline kafka_TimestampTypeEnum kafka::value_GetEnum(const kafka::TimestampType& parent) { + return kafka_TimestampTypeEnum(parent.value); +} + +// --- kafka.TimestampType.value.SetEnum +// Set value of field from enum type. +inline void kafka::value_SetEnum(kafka::TimestampType& parent, kafka_TimestampTypeEnum rhs) { + parent.value = u8(rhs); +} + +// --- kafka.TimestampType..Init +// Set all fields to initial values. +inline void kafka::TimestampType_Init(kafka::TimestampType& parent) { + parent.value = u8(0); +} + +// --- kafka.TimestampType..Ctor +inline kafka::TimestampType::TimestampType() { + kafka::TimestampType_Init(*this); +} + +// --- kafka.TimestampType..FieldwiseCtor +inline kafka::TimestampType::TimestampType(u8 in_value) + : value(in_value) + { +} + +// --- kafka.TimestampType..EnumCtor +inline kafka::TimestampType::TimestampType(kafka_TimestampTypeEnum arg) { + this->value = u8(arg); +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::AclOperationType &row) {// cfmt:kafka.AclOperationType.String + kafka::AclOperationType_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::AclOperations &row) {// cfmt:kafka.AclOperations.String + kafka::AclOperations_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::AclPermissionType &row) {// cfmt:kafka.AclPermissionType.String + kafka::AclPermissionType_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::CompressionType &row) {// cfmt:kafka.CompressionType.String + kafka::CompressionType_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::ConfigSource &row) {// cfmt:kafka.ConfigSource.String + kafka::ConfigSource_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::ConfigType &row) {// cfmt:kafka.ConfigType.String + kafka::ConfigType_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::Error &row) {// cfmt:kafka.Error.String + kafka::Error_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::FieldId &row) {// cfmt:kafka.FieldId.String + kafka::FieldId_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::GroupState &row) {// cfmt:kafka.GroupState.String + kafka::GroupState_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::Header &row) {// cfmt:kafka.Header.String + kafka::Header_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::OffsetCommitKey &row) {// cfmt:kafka.OffsetCommitKey.String + kafka::OffsetCommitKey_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::OffsetCommitValue &row) {// cfmt:kafka.OffsetCommitValue.String + kafka::OffsetCommitValue_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::PatternType &row) {// cfmt:kafka.PatternType.String + kafka::PatternType_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::Record &row) {// cfmt:kafka.Record.String + kafka::Record_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::RecordBatch &row) {// cfmt:kafka.RecordBatch.String + kafka::RecordBatch_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::ResourceType &row) {// cfmt:kafka.ResourceType.String + kafka::ResourceType_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const kafka::TimestampType &row) {// cfmt:kafka.TimestampType.String + kafka::TimestampType_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/lib_ams_gen.h b/include/gen/lib_ams_gen.h index 644a2e38..ae4865d1 100644 --- a/include/gen/lib_ams_gen.h +++ b/include/gen/lib_ams_gen.h @@ -32,25 +32,20 @@ // --- lib_ams_CtlConnCaseEnum -enum lib_ams_CtlConnCaseEnum { // lib_ams.CtlConnCase.value - lib_ams_CtlConnCase_ams_AlarmSyncMsg = 18 - ,lib_ams_CtlConnCase_ams_HeartbeatMsg = 16 - ,lib_ams_CtlConnCase_fm_AlarmMsg = 17 +enum lib_ams_CtlConnCaseEnum { // lib_ams.CtlConnCase.value + lib_ams_CtlConnCase_fm_AlarmMsg = 17 }; -enum { lib_ams_CtlConnCaseEnum_N = 3 }; +enum { lib_ams_CtlConnCaseEnum_N = 1 }; // --- lib_ams_CtlMsgCaseEnum -enum lib_ams_CtlMsgCaseEnum { // lib_ams.CtlMsgCase.value - lib_ams_CtlMsgCase_ams_DumpStreamTableMsg = 12 - ,lib_ams_CtlMsgCase_ams_ProcAddMsg = 4 - ,lib_ams_CtlMsgCase_ams_ProcRemoveMsg = 5 - ,lib_ams_CtlMsgCase_ams_StreamHbMsg = 3 +enum lib_ams_CtlMsgCaseEnum { // lib_ams.CtlMsgCase.value + lib_ams_CtlMsgCase_ams_ShmHbMsg = 3 }; -enum { lib_ams_CtlMsgCaseEnum_N = 4 }; +enum { lib_ams_CtlMsgCaseEnum_N = 1 }; // --- lib_ams_FieldIdEnum @@ -61,29 +56,44 @@ enum lib_ams_FieldIdEnum { // lib_ams.FieldId.value enum { lib_ams_FieldIdEnum_N = 1 }; + +// --- lib_ams_MsgFmt_format_Enum + +enum lib_ams_MsgFmt_format_Enum { // lib_ams.MsgFmt.format + lib_ams_MsgFmt_format_ssim = 0 // Each output message is an ssim tuple + ,lib_ams_MsgFmt_format_bin = 1 // Each output message is bin +}; + +enum { lib_ams_MsgFmt_format_Enum_N = 2 }; + namespace lib_ams { // gen:ns_pkeytypedef } // gen:ns_pkeytypedef namespace lib_ams { // gen:ns_tclass_field } // gen:ns_tclass_field // gen:ns_fwddecl2 -namespace lib_ams { struct FStream; } +namespace lib_ams { struct FShmtype; } +namespace lib_ams { struct FShm; } namespace lib_ams { struct FProc; } -namespace lib_ams { struct FStreamType; } +namespace lib_ams { struct MsgFmt; } namespace lib_ams { struct _db_fdin_curs; } namespace lib_ams { struct _db_cd_fdin_eof_curs; } namespace lib_ams { struct _db_cd_fdin_read_curs; } namespace lib_ams { struct _db_zd_flush_curs; } -namespace lib_ams { struct _db_stream_curs; } -namespace lib_ams { struct _db_cd_stream_hb_curs; } +namespace lib_ams { struct _db_shm_curs; } +namespace lib_ams { struct _db_cd_hb_curs; } namespace lib_ams { struct _db_cd_poll_read_curs; } -namespace lib_ams { struct _db_streamtype_curs; } -namespace lib_ams { struct _db_zd_ctlin_curs; } +namespace lib_ams { struct _db_cd_slow_poll_read_curs; } +namespace lib_ams { struct _db_ind_shmember_curs; } +namespace lib_ams { struct _db_shmtype_curs; } +namespace lib_ams { struct _db_c_ctlin_curs; } namespace lib_ams { struct _db_zd_proc_curs; } -namespace lib_ams { struct proc_zd_member_byproc_curs; } +namespace lib_ams { struct _db_bh_shmember_read_curs; } +namespace lib_ams { struct proc_c_shm_curs; } +namespace lib_ams { struct proc_c_shmember_curs; } namespace lib_ams { struct FReadfile_buf_curs; } namespace lib_ams { struct FReadfile_cbuf_curs; } namespace lib_ams { struct FReadfile_offset_curs; } -namespace lib_ams { struct stream_zd_member_bystream_curs; } +namespace lib_ams { struct shm_c_shmember_curs; } namespace lib_ams { struct writefile_buf_curs; } namespace lib_ams { struct writefile_cbuf_curs; } namespace lib_ams { struct CtlConnCase; } @@ -91,30 +101,29 @@ namespace lib_ams { struct CtlMsgCase; } namespace lib_ams { struct trace; } namespace lib_ams { struct FDb; } namespace lib_ams { struct FFdin; } -namespace lib_ams { struct FMember; } namespace lib_ams { struct FReadfile; } +namespace lib_ams { struct FShmember; } namespace lib_ams { struct FWritefile; } namespace lib_ams { struct FieldId; } namespace lib_ams { extern struct lib_ams::FDb _db; } namespace lib_ams { // hook_fcn_typedef - typedef void (*stream_h_msg_hook)(void* userctx, ams::MsgHeader& arg); // hook:lib_ams.FStream.h_msg - typedef void (*stream_h_msg_orig_hook)(void* userctx, ams::MsgHeader& arg); // hook:lib_ams.FStream.h_msg_orig + typedef void (*shm_h_amsmsg_hook)(void* userctx, ams::MsgHeader& arg); // hook:lib_ams.FShm.h_amsmsg + typedef void (*shm_h_msg_orig_hook)(void* userctx, ams::MsgHeader& arg); // hook:lib_ams.FShm.h_msg_orig + typedef void (*parent_h_convert_hook)(void* userctx, lib_ams::MsgFmt& arg); // hook:lib_ams.MsgFmt.h_convert } // hook_decl namespace lib_ams { // gen:ns_gsymbol - extern const char* amsdb_proctype_0; // "0" - extern const char* amsdb_proctype_amstest; // "amstest" + extern const char* amsdb_proctype_; // "" + extern const char* amsdb_proctype_ams_sendtest; // "ams_sendtest" } // gen:ns_gsymbol namespace lib_ams { // gen:ns_gsymbol - extern const char* amsdb_streamtype_0; // "0" - extern const char* amsdb_streamtype_ctl; // "ctl" - extern const char* amsdb_streamtype_io; // "io" - extern const char* amsdb_streamtype_out; // "out" - extern const char* amsdb_streamtype_trace; // "trace" + extern const char* amsdb_shmtype_ctl; // "ctl" + extern const char* amsdb_shmtype_log; // "log" + extern const char* amsdb_shmtype_out; // "out" } // gen:ns_gsymbol namespace lib_ams { // gen:ns_pnew -struct FStream; -void *BeginWrite(lib_ams::FStream &stream, int len); -void EndWrite(lib_ams::FStream &stream, void *msg, int len); +struct FShm; +void *BeginWrite(lib_ams::FShm &shm, int len); +void EndWrite(lib_ams::FShm &shm, void *msg, int len); } // gen:ns_pnew namespace lib_ams { // gen:ns_print_struct @@ -221,10 +230,34 @@ inline void CtlMsgCase_Init(lib_ams::CtlMsgCase& parent); // --- lib_ams.trace #pragma pack(push,1) struct trace { // lib_ams.trace - u64 n_fdin_drop_notgt; // 0 # of fdin messages dropped because no target stream found - u64 n_fdin_posted; // 0 # of fdin messages posted to target stream - u64 n_fdin_pushback; // 0 # of fdin messages paused because target stream blocked - u64 n_write_block_spin; // 0 # Spin cycles spent waiting for write budget + u64 n_fdin_drop_notgt; // 0 # of fdin messages dropped because no target stream found + u64 n_fdin_posted; // 0 # of fdin messages posted to target stream + u64 n_fdin_pushback; // 0 # of fdin messages paused because target stream blocked + u64 n_write_block_spin; // 0 # Spin cycles spent waiting for write budget + u64 step_cd_fdin_eof; // 0 + u64 step_cd_fdin_eof_cycles; // 0 + u64 step_cd_fdin_read; // 0 + u64 step_cd_fdin_read_cycles; // 0 + u64 step_cd_hb; // 0 + u64 step_cd_hb_cycles; // 0 + u64 step_zd_flush; // 0 + u64 step_zd_flush_cycles; // 0 + u64 step_cd_poll_read; // 0 + u64 step_cd_poll_read_cycles; // 0 + u64 step_cd_slow_poll_read; // 0 + u64 step_cd_slow_poll_read_cycles; // 0 + u64 step_bh_shmember_read; // 0 + u64 step_bh_shmember_read_cycles; // 0 + u64 alloc__db_fdin; // 0 FD input (normally stdin) + u64 del__db_fdin; // 0 FD input (normally stdin) + u64 alloc__db_shm; // 0 Shm record + u64 del__db_shm; // 0 Shm record + u64 alloc__db_proc; // 0 + u64 del__db_proc; // 0 + u64 alloc__db_shmember; // 0 + u64 del__db_shmember; // 0 + u64 alloc__db_shmtype; // 0 + u64 del__db_shmtype; // 0 // func:lib_ams.trace..Ctor inline trace() __attribute__((nothrow)); }; @@ -232,7 +265,7 @@ struct trace { // lib_ams.trace // Set all fields to initial values. // func:lib_ams.trace..Init -inline void trace_Init(lib_ams::trace& parent); +void trace_Init(lib_ams::trace& parent); // print string representation of ROW to string STR // cfmt:lib_ams.trace.String printfmt:Tuple // func:lib_ams.trace..Print @@ -241,67 +274,74 @@ void trace_Print(lib_ams::trace& row, algo::cstring& str) __attr // --- lib_ams.FDb // create: lib_ams.FDb._db (Global) struct FDb { // lib_ams.FDb: In-memory database for lib_ams - lib_ams::FFdin* fdin_lary[32]; // level array - i32 fdin_n; // number of elements in array - lib_ams::FFdin* cd_fdin_eof_head; // zero-terminated doubly linked list - i32 cd_fdin_eof_n; // zero-terminated doubly linked list - lib_ams::FFdin* cd_fdin_read_head; // zero-terminated doubly linked list - i32 cd_fdin_read_n; // zero-terminated doubly linked list - lib_ams::FWritefile* zd_flush_head; // zero-terminated doubly linked list - i32 zd_flush_n; // zero-terminated doubly linked list - lib_ams::FWritefile* zd_flush_tail; // pointer to last element - algo::SchedTime zd_flush_next; // lib_ams.FDb.zd_flush Next invocation time - algo::SchedTime zd_flush_delay; // lib_ams.FDb.zd_flush Delay between invocations - lib_ams::FStream* stream_lary[32]; // level array - i32 stream_n; // number of elements in array - lib_ams::FStream** ind_stream_buckets_elems; // pointer to bucket array - i32 ind_stream_buckets_n; // number of elements in bucket array - i32 ind_stream_n; // number of elements in the hash table - lib_ams::FStream* cd_stream_hb_head; // zero-terminated doubly linked list - i32 cd_stream_hb_n; // zero-terminated doubly linked list - algo::SchedTime cd_stream_hb_next; // lib_ams.FDb.cd_stream_hb Next invocation time - algo::SchedTime cd_stream_hb_delay; // lib_ams.FDb.cd_stream_hb Delay between invocations - ams::ProcId proc_id; // Process id, e.g. amstest-0 - i32 shmem_size; // 32768 Default stream shared memory size - i32 max_msg_size; // 4096 Maximum message size - lib_ams::FStream* cd_poll_read_head; // zero-terminated doubly linked list - i32 cd_poll_read_n; // zero-terminated doubly linked list - algo::cstring file_prefix; // "" File prefix for all streams - u64 proc_blocksize; // # bytes per block - lib_ams::FProc* proc_free; // - lib_ams::FProc** ind_proc_buckets_elems; // pointer to bucket array - i32 ind_proc_buckets_n; // number of elements in bucket array - i32 ind_proc_n; // number of elements in the hash table - u64 member_blocksize; // # bytes per block - lib_ams::FMember* member_free; // - lib_ams::FMember** ind_member_buckets_elems; // pointer to bucket array - i32 ind_member_buckets_n; // number of elements in bucket array - i32 ind_member_n; // number of elements in the hash table - lib_ams::FStreamType* streamtype_lary[32]; // level array - i32 streamtype_n; // number of elements in array - lib_ams::FStreamType** ind_streamtype_buckets_elems; // pointer to bucket array - i32 ind_streamtype_buckets_n; // number of elements in bucket array - i32 ind_streamtype_n; // number of elements in the hash table - lib_ams::FStream* zd_ctlin_head; // zero-terminated doubly linked list - i32 zd_ctlin_n; // zero-terminated doubly linked list - lib_ams::FStream* zd_ctlin_tail; // pointer to last element - bool stream_files_cleaned; // false - bool shmem_mode; // false - algo::ByteAry fdin_buf; // - ams::StreamId dflt_stream_id; // - lib_ams::FProc* zd_proc_head; // zero-terminated doubly linked list - i32 zd_proc_n; // zero-terminated doubly linked list - lib_ams::FProc* zd_proc_tail; // pointer to last element - lib_ams::FStream* c_stream_ctl; // Ctl output stream (process events). optional pointer - algo::cstring expect_buf; // Buffer containing outputs produced since last input - algo::cstring expect_str; // If non-empty, pause reading inputs until this string is non-empty - algo_lib::FTimehook th_expect; // Timeout for expect message - i32 expect_pos; // 0 Match position within expect buf - double expect_timeout; // 10.0 Default expect timeout - algo::ByteAry fmt_buf; // - algo_lib::Regx regx_trace; // Sql Regx - lib_ams::FStream* c_stream_out; // Output stream. optional pointer - lib_ams::trace trace; // + lib_ams::FFdin* fdin_lary[32]; // level array + i32 fdin_n; // number of elements in array + lib_ams::FFdin* cd_fdin_eof_head; // zero-terminated doubly linked list + i32 cd_fdin_eof_n; // zero-terminated doubly linked list + lib_ams::FFdin* cd_fdin_read_head; // zero-terminated doubly linked list + i32 cd_fdin_read_n; // zero-terminated doubly linked list + lib_ams::FWritefile* zd_flush_head; // zero-terminated doubly linked list + i32 zd_flush_n; // zero-terminated doubly linked list + lib_ams::FWritefile* zd_flush_tail; // pointer to last element + algo::SchedTime zd_flush_next; // lib_ams.FDb.zd_flush Next invocation time + algo::SchedTime zd_flush_delay; // lib_ams.FDb.zd_flush Delay between invocations + lib_ams::FShm* shm_lary[32]; // level array + i32 shm_n; // number of elements in array + lib_ams::FShm** ind_shm_buckets_elems; // pointer to bucket array + i32 ind_shm_buckets_n; // number of elements in bucket array + i32 ind_shm_n; // number of elements in the hash table + lib_ams::FShmember* cd_hb_head; // zero-terminated doubly linked list + i32 cd_hb_n; // zero-terminated doubly linked list + algo::SchedTime cd_hb_next; // lib_ams.FDb.cd_hb Next invocation time + algo::SchedTime cd_hb_delay; // lib_ams.FDb.cd_hb Delay between invocations + ams::ProcId proc_id; // Process id, e.g. amstest-0 + i32 shmem_size; // 32768 Default stream shared memory size + i32 max_msg_size; // 4096 Max. size + lib_ams::FShmember* cd_poll_read_head; // zero-terminated doubly linked list + i32 cd_poll_read_n; // zero-terminated doubly linked list + lib_ams::FShmember* cd_slow_poll_read_head; // zero-terminated doubly linked list + i32 cd_slow_poll_read_n; // zero-terminated doubly linked list + algo::SchedTime cd_slow_poll_read_next; // lib_ams.FDb.cd_slow_poll_read Next invocation time + algo::SchedTime cd_slow_poll_read_delay; // lib_ams.FDb.cd_slow_poll_read Delay between invocations + algo::cstring file_prefix; // "" File prefix for all streams + u64 proc_blocksize; // # bytes per block + lib_ams::FProc* proc_free; // + lib_ams::FProc** ind_proc_buckets_elems; // pointer to bucket array + i32 ind_proc_buckets_n; // number of elements in bucket array + i32 ind_proc_n; // number of elements in the hash table + u64 shmember_blocksize; // # bytes per block + lib_ams::FShmember* shmember_free; // + lib_ams::FShmember** ind_shmember_buckets_elems; // pointer to bucket array + i32 ind_shmember_buckets_n; // number of elements in bucket array + i32 ind_shmember_n; // number of elements in the hash table + lib_ams::FShmtype* shmtype_lary[32]; // level array + i32 shmtype_n; // number of elements in array + lib_ams::FShmtype** ind_shmtype_buckets_elems; // pointer to bucket array + i32 ind_shmtype_buckets_n; // number of elements in bucket array + i32 ind_shmtype_n; // number of elements in the hash table + lib_ams::FShmember** c_ctlin_elems; // array of pointers + u32 c_ctlin_n; // array of pointers + u32 c_ctlin_max; // capacity of allocated array + bool shm_files_cleaned; // false + bool shmem_mode; // false + algo::ByteAry fdin_buf; // + ams::ShmId dflt_shm_id; // + lib_ams::FProc* zd_proc_head; // zero-terminated doubly linked list + i32 zd_proc_n; // zero-terminated doubly linked list + lib_ams::FProc* zd_proc_tail; // pointer to last element + lib_ams::FShm* c_shm_ctl; // Ctl output shm (process events). optional pointer + algo::cstring expect_buf; // Buffer containing outputs produced since last input + algo::cstring expect_str; // If non-empty, pause reading inputs until this string is non-empty + i32 expect_pos; // 0 Match position within expect buf + double expect_timeout; // 10.0 Default expect timeout + algo::ByteAry fmt_buf; // + lib_ams::FShmember* c_cur_shmember; // lib_ams message read callback context. optional pointer + lib_ams::FShmember** bh_shmember_read_elems; // binary heap by sortkey + i32 bh_shmember_read_n; // number of elements in the heap + i32 bh_shmember_read_max; // max elements in bh_shmember_read_elems + lib_ams::FProc* c_thisproc; // optional pointer + bool powersave; // false + lib_ams::trace trace; // }; // Allocate memory for new default row. @@ -517,159 +557,214 @@ void zd_flush_SetDelay(algo::SchedTime delay) __attribute__((not // Allocate memory for new default row. // If out of memory, process is killed. -// func:lib_ams.FDb.stream.Alloc -lib_ams::FStream& stream_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.shm.Alloc +lib_ams::FShm& shm_Alloc() __attribute__((__warn_unused_result__, nothrow)); // Allocate memory for new element. If out of memory, return NULL. -// func:lib_ams.FDb.stream.AllocMaybe -lib_ams::FStream* stream_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.shm.AllocMaybe +lib_ams::FShm* shm_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); // Allocate space for one element. If no memory available, return NULL. -// func:lib_ams.FDb.stream.AllocMem -void* stream_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.shm.AllocMem +void* shm_AllocMem() __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty -// func:lib_ams.FDb.stream.EmptyQ -inline bool stream_EmptyQ() __attribute__((nothrow, pure)); +// func:lib_ams.FDb.shm.EmptyQ +inline bool shm_EmptyQ() __attribute__((nothrow, pure)); // Look up row by row id. Return NULL if out of range -// func:lib_ams.FDb.stream.Find -inline lib_ams::FStream* stream_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.shm.Find +inline lib_ams::FShm* shm_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to last element of array, or NULL if array is empty -// func:lib_ams.FDb.stream.Last -inline lib_ams::FStream* stream_Last() __attribute__((nothrow, pure)); +// func:lib_ams.FDb.shm.Last +inline lib_ams::FShm* shm_Last() __attribute__((nothrow, pure)); // Return number of items in the pool -// func:lib_ams.FDb.stream.N -inline i32 stream_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.shm.N +inline i32 shm_N() __attribute__((__warn_unused_result__, nothrow, pure)); // Remove all elements from Lary -// func:lib_ams.FDb.stream.RemoveAll -void stream_RemoveAll() __attribute__((nothrow)); +// func:lib_ams.FDb.shm.RemoveAll +void shm_RemoveAll() __attribute__((nothrow)); // Delete last element of array. Do nothing if array is empty. -// func:lib_ams.FDb.stream.RemoveLast -void stream_RemoveLast() __attribute__((nothrow)); +// func:lib_ams.FDb.shm.RemoveLast +void shm_RemoveLast() __attribute__((nothrow)); // 'quick' Access row by row id. No bounds checking. -// func:lib_ams.FDb.stream.qFind -inline lib_ams::FStream& stream_qFind(u64 t) __attribute__((nothrow, pure)); +// func:lib_ams.FDb.shm.qFind +inline lib_ams::FShm& shm_qFind(u64 t) __attribute__((nothrow, pure)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:lib_ams.FDb.stream.XrefMaybe -bool stream_XrefMaybe(lib_ams::FStream &row); +// func:lib_ams.FDb.shm.XrefMaybe +bool shm_XrefMaybe(lib_ams::FShm &row); // Return true if hash is empty -// func:lib_ams.FDb.ind_stream.EmptyQ -inline bool ind_stream_EmptyQ() __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shm.EmptyQ +inline bool ind_shm_EmptyQ() __attribute__((nothrow)); // Find row by key. Return NULL if not found. -// func:lib_ams.FDb.ind_stream.Find -lib_ams::FStream* ind_stream_Find(ams::StreamId key) __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.ind_shm.Find +lib_ams::FShm* ind_shm_Find(ams::ShmId key) __attribute__((__warn_unused_result__, nothrow)); // Look up row by key and return reference. Throw exception if not found -// func:lib_ams.FDb.ind_stream.FindX -lib_ams::FStream& ind_stream_FindX(ams::StreamId key); +// func:lib_ams.FDb.ind_shm.FindX +lib_ams::FShm& ind_shm_FindX(ams::ShmId key); // Return number of items in the hash -// func:lib_ams.FDb.ind_stream.N -inline i32 ind_stream_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.ind_shm.N +inline i32 ind_shm_N() __attribute__((__warn_unused_result__, nothrow, pure)); // Insert row into hash table. Return true if row is reachable through the hash after the function completes. -// func:lib_ams.FDb.ind_stream.InsertMaybe -bool ind_stream_InsertMaybe(lib_ams::FStream& row) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shm.InsertMaybe +bool ind_shm_InsertMaybe(lib_ams::FShm& row) __attribute__((nothrow)); // Remove reference to element from hash index. If element is not in hash, do nothing -// func:lib_ams.FDb.ind_stream.Remove -void ind_stream_Remove(lib_ams::FStream& row) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shm.Remove +void ind_shm_Remove(lib_ams::FShm& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. -// func:lib_ams.FDb.ind_stream.Reserve -void ind_stream_Reserve(int n) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shm.Reserve +void ind_shm_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_ams.FDb.ind_shm.AbsReserve +void ind_shm_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty -// func:lib_ams.FDb.cd_stream_hb.EmptyQ -inline bool cd_stream_hb_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.cd_hb.EmptyQ +inline bool cd_hb_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); // If index empty, return NULL. Otherwise return pointer to first element in index -// func:lib_ams.FDb.cd_stream_hb.First -inline lib_ams::FStream* cd_stream_hb_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.cd_hb.First +inline lib_ams::FShmember* cd_hb_First() __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise -// func:lib_ams.FDb.cd_stream_hb.InLlistQ -inline bool cd_stream_hb_InLlistQ(lib_ams::FStream& row) __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.cd_hb.InLlistQ +inline bool cd_hb_InLlistQ(lib_ams::FShmember& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. -// func:lib_ams.FDb.cd_stream_hb.Insert -void cd_stream_hb_Insert(lib_ams::FStream& row) __attribute__((nothrow)); +// func:lib_ams.FDb.cd_hb.Insert +void cd_hb_Insert(lib_ams::FShmember& row) __attribute__((nothrow)); // If index empty, return NULL. Otherwise return pointer to last element in index -// func:lib_ams.FDb.cd_stream_hb.Last -inline lib_ams::FStream* cd_stream_hb_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.cd_hb.Last +inline lib_ams::FShmember* cd_hb_Last() __attribute__((__warn_unused_result__, nothrow, pure)); // Return number of items in the linked list -// func:lib_ams.FDb.cd_stream_hb.N -inline i32 cd_stream_hb_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.cd_hb.N +inline i32 cd_hb_N() __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list -// func:lib_ams.FDb.cd_stream_hb.Next -inline lib_ams::FStream* cd_stream_hb_Next(lib_ams::FStream &row) __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.cd_hb.Next +inline lib_ams::FShmember* cd_hb_Next(lib_ams::FShmember &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list -// func:lib_ams.FDb.cd_stream_hb.Prev -inline lib_ams::FStream* cd_stream_hb_Prev(lib_ams::FStream &row) __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.cd_hb.Prev +inline lib_ams::FShmember* cd_hb_Prev(lib_ams::FShmember &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. -// func:lib_ams.FDb.cd_stream_hb.Remove -void cd_stream_hb_Remove(lib_ams::FStream& row) __attribute__((nothrow)); +// func:lib_ams.FDb.cd_hb.Remove +void cd_hb_Remove(lib_ams::FShmember& row) __attribute__((nothrow)); // Empty the index. (The rows are not deleted) -// func:lib_ams.FDb.cd_stream_hb.RemoveAll -void cd_stream_hb_RemoveAll() __attribute__((nothrow)); +// func:lib_ams.FDb.cd_hb.RemoveAll +void cd_hb_RemoveAll() __attribute__((nothrow)); // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. // Call FirstChanged trigger. -// func:lib_ams.FDb.cd_stream_hb.RemoveFirst -lib_ams::FStream* cd_stream_hb_RemoveFirst() __attribute__((nothrow)); +// func:lib_ams.FDb.cd_hb.RemoveFirst +lib_ams::FShmember* cd_hb_RemoveFirst() __attribute__((nothrow)); // If linked list is empty, return NULL. // Otherwise return head item and advance head to the next item. -// func:lib_ams.FDb.cd_stream_hb.RotateFirst -lib_ams::FStream* cd_stream_hb_RotateFirst() __attribute__((nothrow)); +// func:lib_ams.FDb.cd_hb.RotateFirst +lib_ams::FShmember* cd_hb_RotateFirst() __attribute__((nothrow)); // Return reference to last element in the index. No bounds checking. -// func:lib_ams.FDb.cd_stream_hb.qLast -inline lib_ams::FStream& cd_stream_hb_qLast() __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.cd_hb.qLast +inline lib_ams::FShmember& cd_hb_qLast() __attribute__((__warn_unused_result__, nothrow)); // First element of index changed. -// func:lib_ams.FDb.cd_stream_hb.FirstChanged -void cd_stream_hb_FirstChanged() __attribute__((nothrow)); -// func:lib_ams.FDb.cd_stream_hb.Step +// func:lib_ams.FDb.cd_hb.FirstChanged +void cd_hb_FirstChanged() __attribute__((nothrow)); +// func:lib_ams.FDb.cd_hb.Step // this function is 'extrn' and implemented by user -void cd_stream_hb_Step() __attribute__((nothrow)); +void cd_hb_Step() __attribute__((nothrow)); // Set inter-step delay to specified value. // The difference between new delay and current delay is added to the next scheduled time. -// func:lib_ams.FDb.cd_stream_hb.SetDelay -void cd_stream_hb_SetDelay(algo::SchedTime delay) __attribute__((nothrow)); +// func:lib_ams.FDb.cd_hb.SetDelay +void cd_hb_SetDelay(algo::SchedTime delay) __attribute__((nothrow)); // Return true if index is empty // func:lib_ams.FDb.cd_poll_read.EmptyQ inline bool cd_poll_read_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); // If index empty, return NULL. Otherwise return pointer to first element in index // func:lib_ams.FDb.cd_poll_read.First -inline lib_ams::FStream* cd_poll_read_First() __attribute__((__warn_unused_result__, nothrow, pure)); +inline lib_ams::FShmember* cd_poll_read_First() __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:lib_ams.FDb.cd_poll_read.InLlistQ -inline bool cd_poll_read_InLlistQ(lib_ams::FStream& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool cd_poll_read_InLlistQ(lib_ams::FShmember& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:lib_ams.FDb.cd_poll_read.Insert -void cd_poll_read_Insert(lib_ams::FStream& row) __attribute__((nothrow)); +void cd_poll_read_Insert(lib_ams::FShmember& row) __attribute__((nothrow)); // If index empty, return NULL. Otherwise return pointer to last element in index // func:lib_ams.FDb.cd_poll_read.Last -inline lib_ams::FStream* cd_poll_read_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +inline lib_ams::FShmember* cd_poll_read_Last() __attribute__((__warn_unused_result__, nothrow, pure)); // Return number of items in the linked list // func:lib_ams.FDb.cd_poll_read.N inline i32 cd_poll_read_N() __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:lib_ams.FDb.cd_poll_read.Next -inline lib_ams::FStream* cd_poll_read_Next(lib_ams::FStream &row) __attribute__((__warn_unused_result__, nothrow)); +inline lib_ams::FShmember* cd_poll_read_Next(lib_ams::FShmember &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:lib_ams.FDb.cd_poll_read.Prev -inline lib_ams::FStream* cd_poll_read_Prev(lib_ams::FStream &row) __attribute__((__warn_unused_result__, nothrow)); +inline lib_ams::FShmember* cd_poll_read_Prev(lib_ams::FShmember &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:lib_ams.FDb.cd_poll_read.Remove -void cd_poll_read_Remove(lib_ams::FStream& row) __attribute__((nothrow)); +void cd_poll_read_Remove(lib_ams::FShmember& row) __attribute__((nothrow)); // Empty the index. (The rows are not deleted) // func:lib_ams.FDb.cd_poll_read.RemoveAll void cd_poll_read_RemoveAll() __attribute__((nothrow)); // If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. // Call FirstChanged trigger. // func:lib_ams.FDb.cd_poll_read.RemoveFirst -lib_ams::FStream* cd_poll_read_RemoveFirst() __attribute__((nothrow)); +lib_ams::FShmember* cd_poll_read_RemoveFirst() __attribute__((nothrow)); // If linked list is empty, return NULL. // Otherwise return head item and advance head to the next item. // func:lib_ams.FDb.cd_poll_read.RotateFirst -lib_ams::FStream* cd_poll_read_RotateFirst() __attribute__((nothrow)); +lib_ams::FShmember* cd_poll_read_RotateFirst() __attribute__((nothrow)); // Return reference to last element in the index. No bounds checking. // func:lib_ams.FDb.cd_poll_read.qLast -inline lib_ams::FStream& cd_poll_read_qLast() __attribute__((__warn_unused_result__, nothrow)); +inline lib_ams::FShmember& cd_poll_read_qLast() __attribute__((__warn_unused_result__, nothrow)); // func:lib_ams.FDb.cd_poll_read.Step // this function is 'extrn' and implemented by user void cd_poll_read_Step() __attribute__((nothrow)); +// Return true if index is empty +// func:lib_ams.FDb.cd_slow_poll_read.EmptyQ +inline bool cd_slow_poll_read_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:lib_ams.FDb.cd_slow_poll_read.First +inline lib_ams::FShmember* cd_slow_poll_read_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:lib_ams.FDb.cd_slow_poll_read.InLlistQ +inline bool cd_slow_poll_read_InLlistQ(lib_ams::FShmember& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:lib_ams.FDb.cd_slow_poll_read.Insert +void cd_slow_poll_read_Insert(lib_ams::FShmember& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:lib_ams.FDb.cd_slow_poll_read.Last +inline lib_ams::FShmember* cd_slow_poll_read_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return number of items in the linked list +// func:lib_ams.FDb.cd_slow_poll_read.N +inline i32 cd_slow_poll_read_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:lib_ams.FDb.cd_slow_poll_read.Next +inline lib_ams::FShmember* cd_slow_poll_read_Next(lib_ams::FShmember &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:lib_ams.FDb.cd_slow_poll_read.Prev +inline lib_ams::FShmember* cd_slow_poll_read_Prev(lib_ams::FShmember &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:lib_ams.FDb.cd_slow_poll_read.Remove +void cd_slow_poll_read_Remove(lib_ams::FShmember& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:lib_ams.FDb.cd_slow_poll_read.RemoveAll +void cd_slow_poll_read_RemoveAll() __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// Call FirstChanged trigger. +// func:lib_ams.FDb.cd_slow_poll_read.RemoveFirst +lib_ams::FShmember* cd_slow_poll_read_RemoveFirst() __attribute__((nothrow)); +// If linked list is empty, return NULL. +// Otherwise return head item and advance head to the next item. +// func:lib_ams.FDb.cd_slow_poll_read.RotateFirst +lib_ams::FShmember* cd_slow_poll_read_RotateFirst() __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:lib_ams.FDb.cd_slow_poll_read.qLast +inline lib_ams::FShmember& cd_slow_poll_read_qLast() __attribute__((__warn_unused_result__, nothrow)); +// First element of index changed. +// func:lib_ams.FDb.cd_slow_poll_read.FirstChanged +void cd_slow_poll_read_FirstChanged() __attribute__((nothrow)); +// func:lib_ams.FDb.cd_slow_poll_read.Step +// this function is 'extrn' and implemented by user +void cd_slow_poll_read_Step() __attribute__((nothrow)); +// Set inter-step delay to specified value. +// The difference between new delay and current delay is added to the next scheduled time. +// func:lib_ams.FDb.cd_slow_poll_read.SetDelay +void cd_slow_poll_read_SetDelay(algo::SchedTime delay) __attribute__((nothrow)); + // Allocate memory for new default row. // If out of memory, process is killed. // func:lib_ams.FDb.proc.Alloc @@ -724,160 +819,184 @@ void ind_proc_Remove(lib_ams::FProc& row) __attribute__((nothrow // Reserve enough room in the hash for N more elements. Return success code. // func:lib_ams.FDb.ind_proc.Reserve void ind_proc_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_ams.FDb.ind_proc.AbsReserve +void ind_proc_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. -// func:lib_ams.FDb.member.Alloc -lib_ams::FMember& member_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.shmember.Alloc +lib_ams::FShmember& shmember_Alloc() __attribute__((__warn_unused_result__, nothrow)); // Allocate memory for new element. If out of memory, return NULL. -// func:lib_ams.FDb.member.AllocMaybe -lib_ams::FMember* member_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.shmember.AllocMaybe +lib_ams::FShmember* shmember_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); // Remove row from all global and cross indices, then deallocate row -// func:lib_ams.FDb.member.Delete -void member_Delete(lib_ams::FMember &row) __attribute__((nothrow)); +// func:lib_ams.FDb.shmember.Delete +void shmember_Delete(lib_ams::FShmember &row) __attribute__((nothrow)); // Allocate space for one element // If no memory available, return NULL. -// func:lib_ams.FDb.member.AllocMem -void* member_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.shmember.AllocMem +void* shmember_AllocMem() __attribute__((__warn_unused_result__, nothrow)); // Remove mem from all global and cross indices, then deallocate mem -// func:lib_ams.FDb.member.FreeMem -void member_FreeMem(lib_ams::FMember &row) __attribute__((nothrow)); +// func:lib_ams.FDb.shmember.FreeMem +void shmember_FreeMem(lib_ams::FShmember &row) __attribute__((nothrow)); // Preallocate memory for N more elements // Return number of elements actually reserved. -// func:lib_ams.FDb.member.Reserve -u64 member_Reserve(u64 n_elems) __attribute__((nothrow)); +// func:lib_ams.FDb.shmember.Reserve +u64 shmember_Reserve(u64 n_elems) __attribute__((nothrow)); // Allocate block of given size, break up into small elements and append to free list. // Return number of elements reserved. -// func:lib_ams.FDb.member.ReserveMem -u64 member_ReserveMem(u64 size) __attribute__((nothrow)); +// func:lib_ams.FDb.shmember.ReserveMem +u64 shmember_ReserveMem(u64 size) __attribute__((nothrow)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:lib_ams.FDb.member.XrefMaybe -bool member_XrefMaybe(lib_ams::FMember &row); +// func:lib_ams.FDb.shmember.XrefMaybe +bool shmember_XrefMaybe(lib_ams::FShmember &row); // Return true if hash is empty -// func:lib_ams.FDb.ind_member.EmptyQ -inline bool ind_member_EmptyQ() __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shmember.EmptyQ +inline bool ind_shmember_EmptyQ() __attribute__((nothrow)); // Find row by key. Return NULL if not found. -// func:lib_ams.FDb.ind_member.Find -lib_ams::FMember* ind_member_Find(ams::Member key) __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.ind_shmember.Find +lib_ams::FShmember* ind_shmember_Find(ams::ShmemberId key) __attribute__((__warn_unused_result__, nothrow)); // Look up row by key and return reference. Throw exception if not found -// func:lib_ams.FDb.ind_member.FindX -lib_ams::FMember& ind_member_FindX(ams::Member key); +// func:lib_ams.FDb.ind_shmember.FindX +lib_ams::FShmember& ind_shmember_FindX(ams::ShmemberId key); // Return number of items in the hash -// func:lib_ams.FDb.ind_member.N -inline i32 ind_member_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.ind_shmember.N +inline i32 ind_shmember_N() __attribute__((__warn_unused_result__, nothrow, pure)); // Insert row into hash table. Return true if row is reachable through the hash after the function completes. -// func:lib_ams.FDb.ind_member.InsertMaybe -bool ind_member_InsertMaybe(lib_ams::FMember& row) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shmember.InsertMaybe +bool ind_shmember_InsertMaybe(lib_ams::FShmember& row) __attribute__((nothrow)); // Remove reference to element from hash index. If element is not in hash, do nothing -// func:lib_ams.FDb.ind_member.Remove -void ind_member_Remove(lib_ams::FMember& row) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shmember.Remove +void ind_shmember_Remove(lib_ams::FShmember& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. -// func:lib_ams.FDb.ind_member.Reserve -void ind_member_Reserve(int n) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shmember.Reserve +void ind_shmember_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_ams.FDb.ind_shmember.AbsReserve +void ind_shmember_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. -// func:lib_ams.FDb.streamtype.Alloc -lib_ams::FStreamType& streamtype_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.shmtype.Alloc +lib_ams::FShmtype& shmtype_Alloc() __attribute__((__warn_unused_result__, nothrow)); // Allocate memory for new element. If out of memory, return NULL. -// func:lib_ams.FDb.streamtype.AllocMaybe -lib_ams::FStreamType* streamtype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.shmtype.AllocMaybe +lib_ams::FShmtype* shmtype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); // Create new row from struct. // Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -// func:lib_ams.FDb.streamtype.InsertMaybe -lib_ams::FStreamType* streamtype_InsertMaybe(const amsdb::StreamType &value) __attribute__((nothrow)); +// func:lib_ams.FDb.shmtype.InsertMaybe +lib_ams::FShmtype* shmtype_InsertMaybe(const amsdb::Shmtype &value) __attribute__((nothrow)); // Allocate space for one element. If no memory available, return NULL. -// func:lib_ams.FDb.streamtype.AllocMem -void* streamtype_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.shmtype.AllocMem +void* shmtype_AllocMem() __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty -// func:lib_ams.FDb.streamtype.EmptyQ -inline bool streamtype_EmptyQ() __attribute__((nothrow, pure)); +// func:lib_ams.FDb.shmtype.EmptyQ +inline bool shmtype_EmptyQ() __attribute__((nothrow, pure)); // Look up row by row id. Return NULL if out of range -// func:lib_ams.FDb.streamtype.Find -inline lib_ams::FStreamType* streamtype_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.shmtype.Find +inline lib_ams::FShmtype* shmtype_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to last element of array, or NULL if array is empty -// func:lib_ams.FDb.streamtype.Last -inline lib_ams::FStreamType* streamtype_Last() __attribute__((nothrow, pure)); +// func:lib_ams.FDb.shmtype.Last +inline lib_ams::FShmtype* shmtype_Last() __attribute__((nothrow, pure)); // Return number of items in the pool -// func:lib_ams.FDb.streamtype.N -inline i32 streamtype_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.shmtype.N +inline i32 shmtype_N() __attribute__((__warn_unused_result__, nothrow, pure)); // Remove all elements from Lary -// func:lib_ams.FDb.streamtype.RemoveAll -void streamtype_RemoveAll() __attribute__((nothrow)); +// func:lib_ams.FDb.shmtype.RemoveAll +void shmtype_RemoveAll() __attribute__((nothrow)); // Delete last element of array. Do nothing if array is empty. -// func:lib_ams.FDb.streamtype.RemoveLast -void streamtype_RemoveLast() __attribute__((nothrow)); +// func:lib_ams.FDb.shmtype.RemoveLast +void shmtype_RemoveLast() __attribute__((nothrow)); // 'quick' Access row by row id. No bounds checking. -// func:lib_ams.FDb.streamtype.qFind -inline lib_ams::FStreamType& streamtype_qFind(u64 t) __attribute__((nothrow, pure)); +// func:lib_ams.FDb.shmtype.qFind +inline lib_ams::FShmtype& shmtype_qFind(u64 t) __attribute__((nothrow, pure)); // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:lib_ams.FDb.streamtype.XrefMaybe -bool streamtype_XrefMaybe(lib_ams::FStreamType &row); +// func:lib_ams.FDb.shmtype.XrefMaybe +bool shmtype_XrefMaybe(lib_ams::FShmtype &row); // Return true if hash is empty -// func:lib_ams.FDb.ind_streamtype.EmptyQ -inline bool ind_streamtype_EmptyQ() __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shmtype.EmptyQ +inline bool ind_shmtype_EmptyQ() __attribute__((nothrow)); // Find row by key. Return NULL if not found. -// func:lib_ams.FDb.ind_streamtype.Find -lib_ams::FStreamType* ind_streamtype_Find(ams::StreamType key) __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.ind_shmtype.Find +lib_ams::FShmtype* ind_shmtype_Find(ams::Shmtype key) __attribute__((__warn_unused_result__, nothrow)); // Look up row by key and return reference. Throw exception if not found -// func:lib_ams.FDb.ind_streamtype.FindX -lib_ams::FStreamType& ind_streamtype_FindX(ams::StreamType key); +// func:lib_ams.FDb.ind_shmtype.FindX +lib_ams::FShmtype& ind_shmtype_FindX(ams::Shmtype key); // Find row by key. If not found, create and x-reference a new row with with this key. -// func:lib_ams.FDb.ind_streamtype.GetOrCreate -lib_ams::FStreamType& ind_streamtype_GetOrCreate(ams::StreamType key) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shmtype.GetOrCreate +lib_ams::FShmtype& ind_shmtype_GetOrCreate(ams::Shmtype key) __attribute__((nothrow)); // Return number of items in the hash -// func:lib_ams.FDb.ind_streamtype.N -inline i32 ind_streamtype_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.ind_shmtype.N +inline i32 ind_shmtype_N() __attribute__((__warn_unused_result__, nothrow, pure)); // Insert row into hash table. Return true if row is reachable through the hash after the function completes. -// func:lib_ams.FDb.ind_streamtype.InsertMaybe -bool ind_streamtype_InsertMaybe(lib_ams::FStreamType& row) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shmtype.InsertMaybe +bool ind_shmtype_InsertMaybe(lib_ams::FShmtype& row) __attribute__((nothrow)); // Remove reference to element from hash index. If element is not in hash, do nothing -// func:lib_ams.FDb.ind_streamtype.Remove -void ind_streamtype_Remove(lib_ams::FStreamType& row) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shmtype.Remove +void ind_shmtype_Remove(lib_ams::FShmtype& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. -// func:lib_ams.FDb.ind_streamtype.Reserve -void ind_streamtype_Reserve(int n) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shmtype.Reserve +void ind_shmtype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_ams.FDb.ind_shmtype.AbsReserve +void ind_shmtype_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty -// func:lib_ams.FDb.zd_ctlin.EmptyQ -inline bool zd_ctlin_EmptyQ() __attribute__((__warn_unused_result__, nothrow, pure)); -// If index empty, return NULL. Otherwise return pointer to first element in index -// func:lib_ams.FDb.zd_ctlin.First -inline lib_ams::FStream* zd_ctlin_First() __attribute__((__warn_unused_result__, nothrow, pure)); -// Return true if row is in the linked list, false otherwise -// func:lib_ams.FDb.zd_ctlin.InLlistQ -inline bool zd_ctlin_InLlistQ(lib_ams::FStream& row) __attribute__((__warn_unused_result__, nothrow)); -// Insert row into linked list. If row is already in linked list, do nothing. -// func:lib_ams.FDb.zd_ctlin.Insert -void zd_ctlin_Insert(lib_ams::FStream& row) __attribute__((nothrow)); -// If index empty, return NULL. Otherwise return pointer to last element in index -// func:lib_ams.FDb.zd_ctlin.Last -inline lib_ams::FStream* zd_ctlin_Last() __attribute__((__warn_unused_result__, nothrow, pure)); -// Return number of items in the linked list -// func:lib_ams.FDb.zd_ctlin.N -inline i32 zd_ctlin_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Return pointer to next element in the list -// func:lib_ams.FDb.zd_ctlin.Next -inline lib_ams::FStream* zd_ctlin_Next(lib_ams::FStream &row) __attribute__((__warn_unused_result__, nothrow)); -// Return pointer to previous element in the list -// func:lib_ams.FDb.zd_ctlin.Prev -inline lib_ams::FStream* zd_ctlin_Prev(lib_ams::FStream &row) __attribute__((__warn_unused_result__, nothrow)); -// Remove element from index. If element is not in index, do nothing. -// func:lib_ams.FDb.zd_ctlin.Remove -void zd_ctlin_Remove(lib_ams::FStream& row) __attribute__((nothrow)); +// func:lib_ams.FDb.c_ctlin.EmptyQ +inline bool c_ctlin_EmptyQ() __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:lib_ams.FDb.c_ctlin.Find +inline lib_ams::FShmember* c_ctlin_Find(u32 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array of pointers +// func:lib_ams.FDb.c_ctlin.Getary +inline algo::aryptr c_ctlin_Getary() __attribute__((nothrow)); +// func:lib_ams.FDb.c_ctlin.First +inline lib_ams::FShmember* c_ctlin_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FDb.c_ctlin.Last +inline lib_ams::FShmember* c_ctlin_Last() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +// func:lib_ams.FDb.c_ctlin.Insert +void c_ctlin_Insert(lib_ams::FShmember& row) __attribute__((nothrow)); +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +// func:lib_ams.FDb.c_ctlin.InsertMaybe +bool c_ctlin_InsertMaybe(lib_ams::FShmember& row) __attribute__((nothrow)); +// Return number of items in the pointer array +// func:lib_ams.FDb.c_ctlin.N +inline i32 c_ctlin_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Find element using linear scan. If element is in array, remove, otherwise do nothing +// func:lib_ams.FDb.c_ctlin.Remove +void c_ctlin_Remove(lib_ams::FShmember& row) __attribute__((nothrow)); // Empty the index. (The rows are not deleted) -// func:lib_ams.FDb.zd_ctlin.RemoveAll -void zd_ctlin_RemoveAll() __attribute__((nothrow)); -// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -// func:lib_ams.FDb.zd_ctlin.RemoveFirst -lib_ams::FStream* zd_ctlin_RemoveFirst() __attribute__((nothrow)); -// Return reference to last element in the index. No bounds checking. -// func:lib_ams.FDb.zd_ctlin.qLast -inline lib_ams::FStream& zd_ctlin_qLast() __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FDb.c_ctlin.RemoveAll +inline void c_ctlin_RemoveAll() __attribute__((nothrow)); +// Reserve space in index for N more elements; +// func:lib_ams.FDb.c_ctlin.Reserve +void c_ctlin_Reserve(u32 n) __attribute__((nothrow)); +// Heap-like Ptrary: remove first element +// If index is empty, return NULL. Otherwise remove and return first element in index. +// func:lib_ams.FDb.c_ctlin.RemoveFirst +lib_ams::FShmember* c_ctlin_RemoveFirst() __attribute__((nothrow)); +// Ptrary: remove last element +// If index is empty, return NULL. Otherwise remove and return last element in index. +// func:lib_ams.FDb.c_ctlin.RemoveLast +lib_ams::FShmember* c_ctlin_RemoveLast() __attribute__((nothrow)); +// Return reference without bounds checking +// func:lib_ams.FDb.c_ctlin.qFind +inline lib_ams::FShmember& c_ctlin_qFind(u32 idx) __attribute__((nothrow)); +// True if row is in any ptrary instance +// func:lib_ams.FDb.c_ctlin.InAryQ +inline bool c_ctlin_InAryQ(lib_ams::FShmember& row) __attribute__((nothrow)); +// Reference to last element without bounds checking +// func:lib_ams.FDb.c_ctlin.qLast +inline lib_ams::FShmember& c_ctlin_qLast() __attribute__((nothrow)); // Return true if index is empty // func:lib_ams.FDb.zd_proc.EmptyQ @@ -916,9 +1035,52 @@ lib_ams::FProc* zd_proc_RemoveFirst() __attribute__((nothrow)); // func:lib_ams.FDb.zd_proc.qLast inline lib_ams::FProc& zd_proc_qLast() __attribute__((__warn_unused_result__, nothrow)); -// Print back to string -// func:lib_ams.FDb.regx_trace.Print -void regx_trace_Print(algo::cstring &out) __attribute__((nothrow)); +// Remove all elements from heap and free memory used by the array. +// func:lib_ams.FDb.bh_shmember_read.Dealloc +void bh_shmember_read_Dealloc() __attribute__((nothrow)); +// Return true if index is empty +// func:lib_ams.FDb.bh_shmember_read.EmptyQ +inline bool bh_shmember_read_EmptyQ() __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:lib_ams.FDb.bh_shmember_read.First +inline lib_ams::FShmember* bh_shmember_read_First() __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in index, false otherwise +// func:lib_ams.FDb.bh_shmember_read.InBheapQ +inline bool bh_shmember_read_InBheapQ(lib_ams::FShmember& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row. Row must not already be in index. If row is already in index, do nothing. +// func:lib_ams.FDb.bh_shmember_read.Insert +void bh_shmember_read_Insert(lib_ams::FShmember& row) __attribute__((nothrow)); +// Return number of items in the heap +// func:lib_ams.FDb.bh_shmember_read.N +inline i32 bh_shmember_read_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// If row is in heap, update its position. If row is not in heap, insert it. +// Return new position of item in the heap (0=top) +// If first item of the is changed, update fstep:lib_ams.FDb.bh_shmember_read +// func:lib_ams.FDb.bh_shmember_read.Reheap +i32 bh_shmember_read_Reheap(lib_ams::FShmember& row) __attribute__((nothrow)); +// Key of first element in the heap changed. Move it. +// This function does not check the insert condition. +// Return new position of item in the heap (0=top). +// Heap must be non-empty or behavior is undefined. +// Update fstep:lib_ams.FDb.bh_shmember_read +// func:lib_ams.FDb.bh_shmember_read.ReheapFirst +i32 bh_shmember_read_ReheapFirst() __attribute__((nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:lib_ams.FDb.bh_shmember_read.Remove +void bh_shmember_read_Remove(lib_ams::FShmember& row) __attribute__((nothrow)); +// Remove all elements from binary heap +// func:lib_ams.FDb.bh_shmember_read.RemoveAll +void bh_shmember_read_RemoveAll() __attribute__((nothrow)); +// If index is empty, return NULL. Otherwise remove and return first key in index. +// Call 'head changed' trigger. +// func:lib_ams.FDb.bh_shmember_read.RemoveFirst +lib_ams::FShmember* bh_shmember_read_RemoveFirst() __attribute__((nothrow)); +// Reserve space in index for N more elements +// func:lib_ams.FDb.bh_shmember_read.Reserve +void bh_shmember_read_Reserve(int n) __attribute__((nothrow)); +// func:lib_ams.FDb.bh_shmember_read.Step +// this function is 'extrn' and implemented by user +void bh_shmember_read_Step() __attribute__((nothrow)); // cursor points to valid item // func:lib_ams.FDb.fdin_curs.Reset @@ -969,29 +1131,29 @@ inline void _db_zd_flush_curs_Next(_db_zd_flush_curs &curs) __attribute // func:lib_ams.FDb.zd_flush_curs.Access inline lib_ams::FWritefile& _db_zd_flush_curs_Access(_db_zd_flush_curs &curs) __attribute__((nothrow)); // cursor points to valid item -// func:lib_ams.FDb.stream_curs.Reset -inline void _db_stream_curs_Reset(_db_stream_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); +// func:lib_ams.FDb.shm_curs.Reset +inline void _db_shm_curs_Reset(_db_shm_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); // cursor points to valid item -// func:lib_ams.FDb.stream_curs.ValidQ -inline bool _db_stream_curs_ValidQ(_db_stream_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.shm_curs.ValidQ +inline bool _db_shm_curs_ValidQ(_db_shm_curs &curs) __attribute__((nothrow)); // proceed to next item -// func:lib_ams.FDb.stream_curs.Next -inline void _db_stream_curs_Next(_db_stream_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.shm_curs.Next +inline void _db_shm_curs_Next(_db_shm_curs &curs) __attribute__((nothrow)); // item access -// func:lib_ams.FDb.stream_curs.Access -inline lib_ams::FStream& _db_stream_curs_Access(_db_stream_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.shm_curs.Access +inline lib_ams::FShm& _db_shm_curs_Access(_db_shm_curs &curs) __attribute__((nothrow)); // cursor points to valid item -// func:lib_ams.FDb.cd_stream_hb_curs.Reset -inline void _db_cd_stream_hb_curs_Reset(_db_cd_stream_hb_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); +// func:lib_ams.FDb.cd_hb_curs.Reset +inline void _db_cd_hb_curs_Reset(_db_cd_hb_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); // cursor points to valid item -// func:lib_ams.FDb.cd_stream_hb_curs.ValidQ -inline bool _db_cd_stream_hb_curs_ValidQ(_db_cd_stream_hb_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.cd_hb_curs.ValidQ +inline bool _db_cd_hb_curs_ValidQ(_db_cd_hb_curs &curs) __attribute__((nothrow)); // proceed to next item -// func:lib_ams.FDb.cd_stream_hb_curs.Next -inline void _db_cd_stream_hb_curs_Next(_db_cd_stream_hb_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.cd_hb_curs.Next +inline void _db_cd_hb_curs_Next(_db_cd_hb_curs &curs) __attribute__((nothrow)); // item access -// func:lib_ams.FDb.cd_stream_hb_curs.Access -inline lib_ams::FStream& _db_cd_stream_hb_curs_Access(_db_cd_stream_hb_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.cd_hb_curs.Access +inline lib_ams::FShmember& _db_cd_hb_curs_Access(_db_cd_hb_curs &curs) __attribute__((nothrow)); // cursor points to valid item // func:lib_ams.FDb.cd_poll_read_curs.Reset inline void _db_cd_poll_read_curs_Reset(_db_cd_poll_read_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); @@ -1003,31 +1165,53 @@ inline bool _db_cd_poll_read_curs_ValidQ(_db_cd_poll_read_curs &curs) _ inline void _db_cd_poll_read_curs_Next(_db_cd_poll_read_curs &curs) __attribute__((nothrow)); // item access // func:lib_ams.FDb.cd_poll_read_curs.Access -inline lib_ams::FStream& _db_cd_poll_read_curs_Access(_db_cd_poll_read_curs &curs) __attribute__((nothrow)); +inline lib_ams::FShmember& _db_cd_poll_read_curs_Access(_db_cd_poll_read_curs &curs) __attribute__((nothrow)); // cursor points to valid item -// func:lib_ams.FDb.streamtype_curs.Reset -inline void _db_streamtype_curs_Reset(_db_streamtype_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); +// func:lib_ams.FDb.cd_slow_poll_read_curs.Reset +inline void _db_cd_slow_poll_read_curs_Reset(_db_cd_slow_poll_read_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); // cursor points to valid item -// func:lib_ams.FDb.streamtype_curs.ValidQ -inline bool _db_streamtype_curs_ValidQ(_db_streamtype_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.cd_slow_poll_read_curs.ValidQ +inline bool _db_cd_slow_poll_read_curs_ValidQ(_db_cd_slow_poll_read_curs &curs) __attribute__((nothrow)); // proceed to next item -// func:lib_ams.FDb.streamtype_curs.Next -inline void _db_streamtype_curs_Next(_db_streamtype_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.cd_slow_poll_read_curs.Next +inline void _db_cd_slow_poll_read_curs_Next(_db_cd_slow_poll_read_curs &curs) __attribute__((nothrow)); // item access -// func:lib_ams.FDb.streamtype_curs.Access -inline lib_ams::FStreamType& _db_streamtype_curs_Access(_db_streamtype_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.cd_slow_poll_read_curs.Access +inline lib_ams::FShmember& _db_cd_slow_poll_read_curs_Access(_db_cd_slow_poll_read_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shmember_curs.Reset +void _db_ind_shmember_curs_Reset(_db_ind_shmember_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); // cursor points to valid item -// func:lib_ams.FDb.zd_ctlin_curs.Reset -inline void _db_zd_ctlin_curs_Reset(_db_zd_ctlin_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); +// func:lib_ams.FDb.ind_shmember_curs.ValidQ +inline bool _db_ind_shmember_curs_ValidQ(_db_ind_shmember_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:lib_ams.FDb.ind_shmember_curs.Next +inline void _db_ind_shmember_curs_Next(_db_ind_shmember_curs &curs) __attribute__((nothrow)); +// item access +// func:lib_ams.FDb.ind_shmember_curs.Access +inline lib_ams::FShmember& _db_ind_shmember_curs_Access(_db_ind_shmember_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:lib_ams.FDb.shmtype_curs.Reset +inline void _db_shmtype_curs_Reset(_db_shmtype_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:lib_ams.FDb.shmtype_curs.ValidQ +inline bool _db_shmtype_curs_ValidQ(_db_shmtype_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:lib_ams.FDb.shmtype_curs.Next +inline void _db_shmtype_curs_Next(_db_shmtype_curs &curs) __attribute__((nothrow)); +// item access +// func:lib_ams.FDb.shmtype_curs.Access +inline lib_ams::FShmtype& _db_shmtype_curs_Access(_db_shmtype_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.c_ctlin_curs.Reset +inline void _db_c_ctlin_curs_Reset(_db_c_ctlin_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); // cursor points to valid item -// func:lib_ams.FDb.zd_ctlin_curs.ValidQ -inline bool _db_zd_ctlin_curs_ValidQ(_db_zd_ctlin_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.c_ctlin_curs.ValidQ +inline bool _db_c_ctlin_curs_ValidQ(_db_c_ctlin_curs &curs) __attribute__((nothrow)); // proceed to next item -// func:lib_ams.FDb.zd_ctlin_curs.Next -inline void _db_zd_ctlin_curs_Next(_db_zd_ctlin_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.c_ctlin_curs.Next +inline void _db_c_ctlin_curs_Next(_db_c_ctlin_curs &curs) __attribute__((nothrow)); // item access -// func:lib_ams.FDb.zd_ctlin_curs.Access -inline lib_ams::FStream& _db_zd_ctlin_curs_Access(_db_zd_ctlin_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.c_ctlin_curs.Access +inline lib_ams::FShmember& _db_c_ctlin_curs_Access(_db_c_ctlin_curs &curs) __attribute__((nothrow)); // cursor points to valid item // func:lib_ams.FDb.zd_proc_curs.Reset inline void _db_zd_proc_curs_Reset(_db_zd_proc_curs &curs, lib_ams::FDb &parent) __attribute__((nothrow)); @@ -1040,6 +1224,20 @@ inline void _db_zd_proc_curs_Next(_db_zd_proc_curs &curs) __attribute__ // item access // func:lib_ams.FDb.zd_proc_curs.Access inline lib_ams::FProc& _db_zd_proc_curs_Access(_db_zd_proc_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FDb.bh_shmember_read_curs.Reserve +void _db_bh_shmember_read_curs_Reserve(_db_bh_shmember_read_curs &curs, int n); +// Reset cursor. If HEAP is non-empty, add its top element to CURS. +// func:lib_ams.FDb.bh_shmember_read_curs.Reset +void _db_bh_shmember_read_curs_Reset(_db_bh_shmember_read_curs &curs, lib_ams::FDb &parent); +// Advance cursor. +// func:lib_ams.FDb.bh_shmember_read_curs.Next +void _db_bh_shmember_read_curs_Next(_db_bh_shmember_read_curs &curs); +// Access current element. If not more elements, return NULL +// func:lib_ams.FDb.bh_shmember_read_curs.Access +inline lib_ams::FShmember& _db_bh_shmember_read_curs_Access(_db_bh_shmember_read_curs &curs) __attribute__((nothrow)); +// Return true if Access() will return non-NULL. +// func:lib_ams.FDb.bh_shmember_read_curs.ValidQ +inline bool _db_bh_shmember_read_curs_ValidQ(_db_bh_shmember_read_curs &curs) __attribute__((nothrow)); // Set all fields to initial values. // func:lib_ams.FDb..Init void FDb_Init(); @@ -1057,16 +1255,16 @@ struct FFdin { // lib_ams.FFdin: FD input (normally stdin) lib_ams::FFdin* cd_fdin_read_next; // zslist link; -1 means not-in-list lib_ams::FFdin* cd_fdin_read_prev; // previous element algo_lib::FIohook iohook; // - u8 in_elems[8192]; // pointer to elements of inline array + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array i32 in_start; // beginning of valid bytes (in bytes) i32 in_end; // end of valid bytes (in bytes) - bool in_eof; // no more data will be written to buffer + i32 in_msglen; // current message length algo::Errcode in_err; // system error code + algo_lib::FIohook in_iohook; // edge-triggered hook for the buffer + bool in_eof; // no more data will be written to buffer bool in_msgvalid; // current message is valid - i32 in_msglen; // current message length - algo_lib::FIohook in_iohook; // edge-triggered hook for refilling buffer bool in_epoll_enable; // use epoll? - enum { in_max = 8192 }; // value field lib_ams.FFdin.iohook is not copiable // field lib_ams.FFdin.in prevents copy // func:lib_ams.FFdin..AssignOp @@ -1108,6 +1306,12 @@ void in_EndRead(lib_ams::FFdin& fdin) __attribute__((nothrow)); // // func:lib_ams.FFdin.in.GetMsg algo::aryptr in_GetMsg(lib_ams::FFdin& fdin) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:lib_ams.FFdin.in.Realloc +void in_Realloc(lib_ams::FFdin& fdin, int new_max) __attribute__((nothrow)); // Return max. number of bytes in the buffer. // func:lib_ams.FFdin.in.Max inline i32 in_Max(lib_ams::FFdin& fdin) __attribute__((nothrow)); @@ -1130,13 +1334,17 @@ void in_SkipBytes(lib_ams::FFdin& fdin, int n) __attribute__((no // Skip current message, if any. // func:lib_ams.FFdin.in.SkipMsg void in_SkipMsg(lib_ams::FFdin& fdin) __attribute__((nothrow)); -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. // // func:lib_ams.FFdin.in.WriteAll bool in_WriteAll(lib_ams::FFdin& fdin, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:lib_ams.FFdin.in.WriteReserve +void in_WriteReserve(lib_ams::FFdin& fdin, u8 *in, i32 in_n) __attribute__((nothrow)); // Set all fields to initial values. // func:lib_ams.FFdin..Init @@ -1144,72 +1352,35 @@ void FFdin_Init(lib_ams::FFdin& fdin); // func:lib_ams.FFdin..Uninit void FFdin_Uninit(lib_ams::FFdin& fdin) __attribute__((nothrow)); -// --- lib_ams.FMember -// create: lib_ams.FDb.member (Tpool) -// global access: ind_member (Thash, hash field member) -// access: lib_ams.FProc.zd_member_byproc (Llist) -// access: lib_ams.FStream.zd_member_bystream (Llist) -struct FMember { // lib_ams.FMember - lib_ams::FMember* member_next; // Pointer to next free element int tpool - lib_ams::FMember* ind_member_next; // hash next - ams::Member member; // - ams::StreamPos pos; // - algo::UnTime last_hb; // Time last heartbeat received - u32 budget; // 0 - lib_ams::FStream* p_stream; // reference to parent row - lib_ams::FProc* p_proc; // reference to parent row - lib_ams::FMember* zd_member_byproc_next; // zslist link; -1 means not-in-list - lib_ams::FMember* zd_member_byproc_prev; // previous element - lib_ams::FMember* zd_member_bystream_next; // zslist link; -1 means not-in-list - lib_ams::FMember* zd_member_bystream_prev; // previous element - // x-reference on lib_ams.FMember.p_stream prevents copy - // x-reference on lib_ams.FMember.p_proc prevents copy - // func:lib_ams.FMember..AssignOp - inline lib_ams::FMember& operator =(const lib_ams::FMember &rhs) = delete; - // x-reference on lib_ams.FMember.p_stream prevents copy - // x-reference on lib_ams.FMember.p_proc prevents copy - // func:lib_ams.FMember..CopyCtor - inline FMember(const lib_ams::FMember &rhs) = delete; -private: - // func:lib_ams.FMember..Ctor - inline FMember() __attribute__((nothrow)); - // func:lib_ams.FMember..Dtor - inline ~FMember() __attribute__((nothrow)); - friend lib_ams::FMember& member_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend lib_ams::FMember* member_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void member_Delete(lib_ams::FMember &row) __attribute__((nothrow)); -}; - -// Set all fields to initial values. -// func:lib_ams.FMember..Init -inline void FMember_Init(lib_ams::FMember& member); -// func:lib_ams.FMember..Uninit -void FMember_Uninit(lib_ams::FMember& member) __attribute__((nothrow)); - // --- lib_ams.FProc // create: lib_ams.FDb.proc (Tpool) // global access: ind_proc (Thash, hash field proc_id) // global access: zd_proc (Llist) -// access: lib_ams.FMember.p_proc (Upptr) +// global access: c_thisproc (Ptr) +// access: lib_ams.FShmember.p_proc (Upptr) struct FProc { // lib_ams.FProc - lib_ams::FProc* proc_next; // Pointer to next free element int tpool - lib_ams::FProc* ind_proc_next; // hash next - lib_ams::FProc* zd_proc_next; // zslist link; -1 means not-in-list - lib_ams::FProc* zd_proc_prev; // previous element - ams::ProcId proc_id; // - lib_ams::FMember* zd_member_byproc_head; // zero-terminated doubly linked list - i32 zd_member_byproc_n; // zero-terminated doubly linked list - lib_ams::FMember* zd_member_byproc_tail; // pointer to last element - i32 pid; // 0 - i32 status; // 0 - algo::cstring logbuf; // - u32 hbtimeout; // 0 - bool critical; // false - bool realtime; // false - // reftype Llist of lib_ams.FProc.zd_member_byproc prohibits copy + lib_ams::FProc* proc_next; // Pointer to next free element int tpool + lib_ams::FProc* ind_proc_next; // hash next + u32 ind_proc_hashval; // hash value + lib_ams::FProc* zd_proc_next; // zslist link; -1 means not-in-list + lib_ams::FProc* zd_proc_prev; // previous element + ams::ProcId proc_id; // Unique ID + lib_ams::FShm** c_shm_elems; // array of pointers + u32 c_shm_n; // array of pointers + u32 c_shm_max; // capacity of allocated array + lib_ams::FShmember** c_shmember_elems; // array of pointers + u32 c_shmember_n; // array of pointers + u32 c_shmember_max; // capacity of allocated array + i32 pid; // 0 Current PID + i32 status; // 0 Exit status + u32 hbtimeout; // 0 Heartbeat timeout + bool critical; // false Exit if process dies? + // reftype Ptrary of lib_ams.FProc.c_shm prohibits copy + // reftype Ptrary of lib_ams.FProc.c_shmember prohibits copy // func:lib_ams.FProc..AssignOp inline lib_ams::FProc& operator =(const lib_ams::FProc &rhs) = delete; - // reftype Llist of lib_ams.FProc.zd_member_byproc prohibits copy + // reftype Ptrary of lib_ams.FProc.c_shm prohibits copy + // reftype Ptrary of lib_ams.FProc.c_shmember prohibits copy // func:lib_ams.FProc..CopyCtor inline FProc(const lib_ams::FProc &rhs) = delete; private: @@ -1222,61 +1393,135 @@ struct FProc { // lib_ams.FProc friend void proc_Delete(lib_ams::FProc &row) __attribute__((nothrow)); }; -// Delete all elements in the linked list. -// func:lib_ams.FProc.zd_member_byproc.Cascdel -void zd_member_byproc_Cascdel(lib_ams::FProc& proc) __attribute__((nothrow)); // Return true if index is empty -// func:lib_ams.FProc.zd_member_byproc.EmptyQ -inline bool zd_member_byproc_EmptyQ(lib_ams::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); -// If index empty, return NULL. Otherwise return pointer to first element in index -// func:lib_ams.FProc.zd_member_byproc.First -inline lib_ams::FMember* zd_member_byproc_First(lib_ams::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return true if row is in the linked list, false otherwise -// func:lib_ams.FProc.zd_member_byproc.InLlistQ -inline bool zd_member_byproc_InLlistQ(lib_ams::FMember& row) __attribute__((__warn_unused_result__, nothrow)); -// Insert row into linked list. If row is already in linked list, do nothing. -// func:lib_ams.FProc.zd_member_byproc.Insert -void zd_member_byproc_Insert(lib_ams::FProc& proc, lib_ams::FMember& row) __attribute__((nothrow)); -// If index empty, return NULL. Otherwise return pointer to last element in index -// func:lib_ams.FProc.zd_member_byproc.Last -inline lib_ams::FMember* zd_member_byproc_Last(lib_ams::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return number of items in the linked list -// func:lib_ams.FProc.zd_member_byproc.N -inline i32 zd_member_byproc_N(const lib_ams::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return pointer to next element in the list -// func:lib_ams.FProc.zd_member_byproc.Next -inline lib_ams::FMember* zd_member_byproc_Next(lib_ams::FMember &row) __attribute__((__warn_unused_result__, nothrow)); -// Return pointer to previous element in the list -// func:lib_ams.FProc.zd_member_byproc.Prev -inline lib_ams::FMember* zd_member_byproc_Prev(lib_ams::FMember &row) __attribute__((__warn_unused_result__, nothrow)); -// Remove element from index. If element is not in index, do nothing. -// func:lib_ams.FProc.zd_member_byproc.Remove -void zd_member_byproc_Remove(lib_ams::FProc& proc, lib_ams::FMember& row) __attribute__((nothrow)); +// func:lib_ams.FProc.c_shm.EmptyQ +inline bool c_shm_EmptyQ(lib_ams::FProc& proc) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:lib_ams.FProc.c_shm.Find +inline lib_ams::FShm* c_shm_Find(lib_ams::FProc& proc, u32 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array of pointers +// func:lib_ams.FProc.c_shm.Getary +inline algo::aryptr c_shm_Getary(lib_ams::FProc& proc) __attribute__((nothrow)); +// func:lib_ams.FProc.c_shm.First +inline lib_ams::FShm* c_shm_First(lib_ams::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FProc.c_shm.Last +inline lib_ams::FShm* c_shm_Last(lib_ams::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +// func:lib_ams.FProc.c_shm.Insert +void c_shm_Insert(lib_ams::FProc& proc, lib_ams::FShm& row) __attribute__((nothrow)); +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +// func:lib_ams.FProc.c_shm.InsertMaybe +bool c_shm_InsertMaybe(lib_ams::FProc& proc, lib_ams::FShm& row) __attribute__((nothrow)); +// Return number of items in the pointer array +// func:lib_ams.FProc.c_shm.N +inline i32 c_shm_N(const lib_ams::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); +// Find element using linear scan. If element is in array, remove, otherwise do nothing +// func:lib_ams.FProc.c_shm.Remove +void c_shm_Remove(lib_ams::FProc& proc, lib_ams::FShm& row) __attribute__((nothrow)); // Empty the index. (The rows are not deleted) -// func:lib_ams.FProc.zd_member_byproc.RemoveAll -void zd_member_byproc_RemoveAll(lib_ams::FProc& proc) __attribute__((nothrow)); -// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -// func:lib_ams.FProc.zd_member_byproc.RemoveFirst -lib_ams::FMember* zd_member_byproc_RemoveFirst(lib_ams::FProc& proc) __attribute__((nothrow)); -// Return reference to last element in the index. No bounds checking. -// func:lib_ams.FProc.zd_member_byproc.qLast -inline lib_ams::FMember& zd_member_byproc_qLast(lib_ams::FProc& proc) __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FProc.c_shm.RemoveAll +inline void c_shm_RemoveAll(lib_ams::FProc& proc) __attribute__((nothrow)); +// Reserve space in index for N more elements; +// func:lib_ams.FProc.c_shm.Reserve +void c_shm_Reserve(lib_ams::FProc& proc, u32 n) __attribute__((nothrow)); +// Heap-like Ptrary: remove first element +// If index is empty, return NULL. Otherwise remove and return first element in index. +// func:lib_ams.FProc.c_shm.RemoveFirst +lib_ams::FShm* c_shm_RemoveFirst(lib_ams::FProc& proc) __attribute__((nothrow)); +// Ptrary: remove last element +// If index is empty, return NULL. Otherwise remove and return last element in index. +// func:lib_ams.FProc.c_shm.RemoveLast +lib_ams::FShm* c_shm_RemoveLast(lib_ams::FProc& proc) __attribute__((nothrow)); +// Return reference without bounds checking +// func:lib_ams.FProc.c_shm.qFind +inline lib_ams::FShm& c_shm_qFind(lib_ams::FProc& proc, u32 idx) __attribute__((nothrow)); +// True if row is in any ptrary instance +// func:lib_ams.FProc.c_shm.InAryQ +inline bool proc_c_shm_InAryQ(lib_ams::FShm& row) __attribute__((nothrow)); +// Reference to last element without bounds checking +// func:lib_ams.FProc.c_shm.qLast +inline lib_ams::FShm& c_shm_qLast(lib_ams::FProc& proc) __attribute__((nothrow)); + +// Return true if index is empty +// func:lib_ams.FProc.c_shmember.EmptyQ +inline bool c_shmember_EmptyQ(lib_ams::FProc& proc) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:lib_ams.FProc.c_shmember.Find +inline lib_ams::FShmember* c_shmember_Find(lib_ams::FProc& proc, u32 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array of pointers +// func:lib_ams.FProc.c_shmember.Getary +inline algo::aryptr c_shmember_Getary(lib_ams::FProc& proc) __attribute__((nothrow)); +// func:lib_ams.FProc.c_shmember.First +inline lib_ams::FShmember* c_shmember_First(lib_ams::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FProc.c_shmember.Last +inline lib_ams::FShmember* c_shmember_Last(lib_ams::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +// func:lib_ams.FProc.c_shmember.Insert +void c_shmember_Insert(lib_ams::FProc& proc, lib_ams::FShmember& row) __attribute__((nothrow)); +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +// func:lib_ams.FProc.c_shmember.InsertMaybe +bool c_shmember_InsertMaybe(lib_ams::FProc& proc, lib_ams::FShmember& row) __attribute__((nothrow)); +// Return number of items in the pointer array +// func:lib_ams.FProc.c_shmember.N +inline i32 c_shmember_N(const lib_ams::FProc& proc) __attribute__((__warn_unused_result__, nothrow, pure)); +// Find element using linear scan. If element is in array, remove, otherwise do nothing +// func:lib_ams.FProc.c_shmember.Remove +void c_shmember_Remove(lib_ams::FProc& proc, lib_ams::FShmember& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:lib_ams.FProc.c_shmember.RemoveAll +inline void c_shmember_RemoveAll(lib_ams::FProc& proc) __attribute__((nothrow)); +// Reserve space in index for N more elements; +// func:lib_ams.FProc.c_shmember.Reserve +void c_shmember_Reserve(lib_ams::FProc& proc, u32 n) __attribute__((nothrow)); +// Heap-like Ptrary: remove first element +// If index is empty, return NULL. Otherwise remove and return first element in index. +// func:lib_ams.FProc.c_shmember.RemoveFirst +lib_ams::FShmember* c_shmember_RemoveFirst(lib_ams::FProc& proc) __attribute__((nothrow)); +// Ptrary: remove last element +// If index is empty, return NULL. Otherwise remove and return last element in index. +// func:lib_ams.FProc.c_shmember.RemoveLast +lib_ams::FShmember* c_shmember_RemoveLast(lib_ams::FProc& proc) __attribute__((nothrow)); +// Return reference without bounds checking +// func:lib_ams.FProc.c_shmember.qFind +inline lib_ams::FShmember& c_shmember_qFind(lib_ams::FProc& proc, u32 idx) __attribute__((nothrow)); +// True if row is in any ptrary instance +// func:lib_ams.FProc.c_shmember.InAryQ +inline bool proc_c_shmember_InAryQ(lib_ams::FShmember& row) __attribute__((nothrow)); +// Reference to last element without bounds checking +// func:lib_ams.FProc.c_shmember.qLast +inline lib_ams::FShmember& c_shmember_qLast(lib_ams::FProc& proc) __attribute__((nothrow)); // Set all fields to initial values. // func:lib_ams.FProc..Init inline void FProc_Init(lib_ams::FProc& proc); +// func:lib_ams.FProc.c_shm_curs.Reset +inline void proc_c_shm_curs_Reset(proc_c_shm_curs &curs, lib_ams::FProc &parent) __attribute__((nothrow)); // cursor points to valid item -// func:lib_ams.FProc.zd_member_byproc_curs.Reset -inline void proc_zd_member_byproc_curs_Reset(proc_zd_member_byproc_curs &curs, lib_ams::FProc &parent) __attribute__((nothrow)); +// func:lib_ams.FProc.c_shm_curs.ValidQ +inline bool proc_c_shm_curs_ValidQ(proc_c_shm_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:lib_ams.FProc.c_shm_curs.Next +inline void proc_c_shm_curs_Next(proc_c_shm_curs &curs) __attribute__((nothrow)); +// item access +// func:lib_ams.FProc.c_shm_curs.Access +inline lib_ams::FShm& proc_c_shm_curs_Access(proc_c_shm_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FProc.c_shmember_curs.Reset +inline void proc_c_shmember_curs_Reset(proc_c_shmember_curs &curs, lib_ams::FProc &parent) __attribute__((nothrow)); // cursor points to valid item -// func:lib_ams.FProc.zd_member_byproc_curs.ValidQ -inline bool proc_zd_member_byproc_curs_ValidQ(proc_zd_member_byproc_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FProc.c_shmember_curs.ValidQ +inline bool proc_c_shmember_curs_ValidQ(proc_c_shmember_curs &curs) __attribute__((nothrow)); // proceed to next item -// func:lib_ams.FProc.zd_member_byproc_curs.Next -inline void proc_zd_member_byproc_curs_Next(proc_zd_member_byproc_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FProc.c_shmember_curs.Next +inline void proc_c_shmember_curs_Next(proc_c_shmember_curs &curs) __attribute__((nothrow)); // item access -// func:lib_ams.FProc.zd_member_byproc_curs.Access -inline lib_ams::FMember& proc_zd_member_byproc_curs_Access(proc_zd_member_byproc_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FProc.c_shmember_curs.Access +inline lib_ams::FShmember& proc_c_shmember_curs_Access(proc_c_shmember_curs &curs) __attribute__((nothrow)); // func:lib_ams.FProc..Uninit void FProc_Uninit(lib_ams::FProc& proc) __attribute__((nothrow)); @@ -1328,6 +1573,11 @@ u8& buf_AllocAt(lib_ams::FReadfile& parent, int at) __attribute // Reserve space. Insert N elements at the end of the array, return pointer to array // func:lib_ams.FReadfile.buf.AllocN algo::aryptr buf_AllocN(lib_ams::FReadfile& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:lib_ams.FReadfile.buf.AllocNAt +algo::aryptr buf_AllocNAt(lib_ams::FReadfile& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:lib_ams.FReadfile.buf.EmptyQ inline bool buf_EmptyQ(lib_ams::FReadfile& parent) __attribute__((nothrow)); @@ -1386,6 +1636,10 @@ algo::aryptr buf_AllocNVal(lib_ams::FReadfile& parent, int n_elems, cons // The array is replaced with the input string. Function always succeeds. // func:lib_ams.FReadfile.buf.ReadStrptrMaybe bool buf_ReadStrptrMaybe(lib_ams::FReadfile& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:lib_ams.FReadfile.buf.Insary +void buf_Insary(lib_ams::FReadfile& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -1403,6 +1657,11 @@ u8& cbuf_AllocAt(lib_ams::FReadfile& parent, int at) __attribut // Reserve space. Insert N elements at the end of the array, return pointer to array // func:lib_ams.FReadfile.cbuf.AllocN algo::aryptr cbuf_AllocN(lib_ams::FReadfile& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:lib_ams.FReadfile.cbuf.AllocNAt +algo::aryptr cbuf_AllocNAt(lib_ams::FReadfile& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:lib_ams.FReadfile.cbuf.EmptyQ inline bool cbuf_EmptyQ(lib_ams::FReadfile& parent) __attribute__((nothrow)); @@ -1461,6 +1720,10 @@ algo::aryptr cbuf_AllocNVal(lib_ams::FReadfile& parent, int n_elems, con // The array is replaced with the input string. Function always succeeds. // func:lib_ams.FReadfile.cbuf.ReadStrptrMaybe bool cbuf_ReadStrptrMaybe(lib_ams::FReadfile& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:lib_ams.FReadfile.cbuf.Insary +void cbuf_Insary(lib_ams::FReadfile& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -1478,6 +1741,11 @@ u32& offset_AllocAt(lib_ams::FReadfile& parent, int at) __attrib // Reserve space. Insert N elements at the end of the array, return pointer to array // func:lib_ams.FReadfile.offset.AllocN algo::aryptr offset_AllocN(lib_ams::FReadfile& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:lib_ams.FReadfile.offset.AllocNAt +algo::aryptr offset_AllocNAt(lib_ams::FReadfile& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:lib_ams.FReadfile.offset.EmptyQ inline bool offset_EmptyQ(lib_ams::FReadfile& parent) __attribute__((nothrow)); @@ -1534,6 +1802,10 @@ algo::aryptr offset_AllocNVal(lib_ams::FReadfile& parent, int n_elems, c // Function returns success value. // func:lib_ams.FReadfile.offset.ReadStrptrMaybe bool offset_ReadStrptrMaybe(lib_ams::FReadfile& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:lib_ams.FReadfile.offset.Insary +void offset_Insary(lib_ams::FReadfile& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:lib_ams.FReadfile.buf_curs.Next @@ -1578,203 +1850,263 @@ void FReadfile_Uninit(lib_ams::FReadfile& parent) __attribute__( // func:lib_ams.FReadfile..Print void FReadfile_Print(lib_ams::FReadfile& row, algo::cstring& str) __attribute__((nothrow)); -// --- lib_ams.FStream -// create: lib_ams.FDb.stream (Lary) -// global access: stream (Lary, by rowid) -// global access: ind_stream (Thash, hash field stream_id) -// global access: cd_stream_hb (Llist) -// global access: cd_poll_read (Llist) -// global access: zd_ctlin (Llist) -// global access: c_stream_ctl (Ptr) -// global access: c_stream_out (Ptr) -// access: lib_ams.FMember.p_stream (Upptr) -struct FStream { // lib_ams.FStream: Stream record - lib_ams::FStream* ind_stream_next; // hash next - lib_ams::FStream* cd_stream_hb_next; // zslist link; -1 means not-in-list - lib_ams::FStream* cd_stream_hb_prev; // previous element - lib_ams::FStream* cd_poll_read_next; // zslist link; -1 means not-in-list - lib_ams::FStream* cd_poll_read_prev; // previous element - lib_ams::FStream* zd_ctlin_next; // zslist link; -1 means not-in-list - lib_ams::FStream* zd_ctlin_prev; // previous element - ams::StreamId stream_id; // Stream ID (primary key) - algo::cstring filename; // Name of the file (if opened) - algo_lib::FFildes shm_file; // Associated file - ams::StreamFlags flags; // Is stream open for writing - algo::ByteAry byteary; // Substitute for shm_region - u8* shm_handle; // Associated memory segment handle (windows only). optional pointer - ams::StreamPos rpos; // Read position - ams::StreamPos wpos; // Write position - algo::memptr shm_region; // Shared memory region - u64 limit; // 0 Updated with ackoff, limit for nextoff - u64 offset_mask; // 0 Mask for byte eof - ams::Seqmsg* cur_msg; // Current message. optional pointer - lib_ams::stream_h_msg_hook h_msg; // NULL Pointer to a function - u64 h_msg_ctx; // 0 Callback context - lib_ams::stream_h_msg_orig_hook h_msg_orig; // NULL Pointer to a function - u64 h_msg_orig_ctx; // 0 Callback context - lib_ams::FMember* zd_member_bystream_head; // zero-terminated doubly linked list - i32 zd_member_bystream_n; // zero-terminated doubly linked list - lib_ams::FMember* zd_member_bystream_tail; // pointer to last element - u64 next_ackoff; // 1023 Force StreamHb after reaching this offset - lib_ams::FStreamType* p_streamtype; // reference to parent row - u32 n_write_block; // 0 - i32 burst; // 20 Max number of messages processed at once - bool writer_error; // false Writer error was detected - // user-defined fcleanup on lib_ams.FStream.shm_handle prevents copy - // reftype Hook of lib_ams.FStream.h_msg prohibits copy - // reftype Hook of lib_ams.FStream.h_msg_orig prohibits copy - // reftype Llist of lib_ams.FStream.zd_member_bystream prohibits copy - // x-reference on lib_ams.FStream.p_streamtype prevents copy - // func:lib_ams.FStream..AssignOp - lib_ams::FStream& operator =(const lib_ams::FStream &rhs) = delete; - // user-defined fcleanup on lib_ams.FStream.shm_handle prevents copy - // reftype Hook of lib_ams.FStream.h_msg prohibits copy - // reftype Hook of lib_ams.FStream.h_msg_orig prohibits copy - // reftype Llist of lib_ams.FStream.zd_member_bystream prohibits copy - // x-reference on lib_ams.FStream.p_streamtype prevents copy - // func:lib_ams.FStream..CopyCtor - FStream(const lib_ams::FStream &rhs) = delete; +// --- lib_ams.FShm +// create: lib_ams.FDb.shm (Lary) +// global access: shm (Lary, by rowid) +// global access: ind_shm (Thash, hash field shm_id) +// global access: c_shm_ctl (Ptr) +// access: lib_ams.FProc.c_shm (Ptrary) +// access: lib_ams.FShmember.p_shm (Upptr) +struct FShm { // lib_ams.FShm: Shm record + lib_ams::FShm* ind_shm_next; // hash next + u32 ind_shm_hashval; // hash value + ams::ShmId shm_id; // Stream ID (primary key) + lib_ams::FShmember** c_shmember_elems; // array of pointers + u32 c_shmember_n; // array of pointers + u32 c_shmember_max; // capacity of allocated array + algo::cstring filename; // Name of the file (if opened) + algo_lib::FFildes shm_file; // Associated file + ams::ShmFlags flags; // Is stream open for writing + u8* shm_handle; // Associated memory segment handle (windows only). optional pointer + lib_ams::FShmember* c_read; // This process. optional pointer + lib_ams::FShmember* c_write; // This process. optional pointer + algo::memptr shm_region; // Shared memory region + u64 writelimit; // 0 Write limit, based on all read members + u64 offset_mask; // 0 Mask for byte eof + lib_ams::shm_h_amsmsg_hook h_amsmsg; // NULL Pointer to a function + u64 h_amsmsg_ctx; // 0 Callback context + lib_ams::shm_h_msg_orig_hook h_msg_orig; // NULL Pointer to a function + u64 h_msg_orig_ctx; // 0 Callback context + u64 next_ackoff; // 1023 Force StreamHb after reaching this offset + lib_ams::FShmtype* p_shmtype; // reference to parent row + u32 n_write_block; // 0 + bool error; // false Error was detected + bool created; // false + i64 schedbias; // 0 + i32 proc_c_shm_idx; // -1 Array index (-1 = not in array) + // reftype Ptrary of lib_ams.FShm.c_shmember prohibits copy + // reftype Hook of lib_ams.FShm.h_amsmsg prohibits copy + // reftype Hook of lib_ams.FShm.h_msg_orig prohibits copy + // x-reference on lib_ams.FShm.p_shmtype prevents copy + // func:lib_ams.FShm..AssignOp + lib_ams::FShm& operator =(const lib_ams::FShm &rhs) = delete; + // reftype Ptrary of lib_ams.FShm.c_shmember prohibits copy + // reftype Hook of lib_ams.FShm.h_amsmsg prohibits copy + // reftype Hook of lib_ams.FShm.h_msg_orig prohibits copy + // x-reference on lib_ams.FShm.p_shmtype prevents copy + // func:lib_ams.FShm..CopyCtor + FShm(const lib_ams::FShm &rhs) = delete; private: - // func:lib_ams.FStream..Ctor - inline FStream() __attribute__((nothrow)); - // func:lib_ams.FStream..Dtor - inline ~FStream() __attribute__((nothrow)); - friend lib_ams::FStream& stream_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend lib_ams::FStream* stream_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void stream_RemoveAll() __attribute__((nothrow)); - friend void stream_RemoveLast() __attribute__((nothrow)); + // func:lib_ams.FShm..Ctor + inline FShm() __attribute__((nothrow)); + // func:lib_ams.FShm..Dtor + inline ~FShm() __attribute__((nothrow)); + friend lib_ams::FShm& shm_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_ams::FShm* shm_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void shm_RemoveAll() __attribute__((nothrow)); + friend void shm_RemoveLast() __attribute__((nothrow)); }; -// Declaration for user-defined cleanup function -// User-defined cleanup function invoked for field shm_file of lib_ams::FStream -// func:lib_ams.FStream.shm_file.Cleanup -// this function is 'extrn' and implemented by user -void shm_file_Cleanup(lib_ams::FStream& stream) __attribute__((nothrow)); +// Return true if index is empty +// func:lib_ams.FShm.c_shmember.EmptyQ +inline bool c_shmember_EmptyQ(lib_ams::FShm& shm) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:lib_ams.FShm.c_shmember.Find +inline lib_ams::FShmember* c_shmember_Find(lib_ams::FShm& shm, u32 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array of pointers +// func:lib_ams.FShm.c_shmember.Getary +inline algo::aryptr c_shmember_Getary(lib_ams::FShm& shm) __attribute__((nothrow)); +// func:lib_ams.FShm.c_shmember.First +inline lib_ams::FShmember* c_shmember_First(lib_ams::FShm& shm) __attribute__((__warn_unused_result__, nothrow, pure)); +// func:lib_ams.FShm.c_shmember.Last +inline lib_ams::FShmember* c_shmember_Last(lib_ams::FShm& shm) __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +// func:lib_ams.FShm.c_shmember.Insert +void c_shmember_Insert(lib_ams::FShm& shm, lib_ams::FShmember& row) __attribute__((nothrow)); +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +// func:lib_ams.FShm.c_shmember.InsertMaybe +bool c_shmember_InsertMaybe(lib_ams::FShm& shm, lib_ams::FShmember& row) __attribute__((nothrow)); +// Return number of items in the pointer array +// func:lib_ams.FShm.c_shmember.N +inline i32 c_shmember_N(const lib_ams::FShm& shm) __attribute__((__warn_unused_result__, nothrow, pure)); +// Find element using linear scan. If element is in array, remove, otherwise do nothing +// func:lib_ams.FShm.c_shmember.Remove +void c_shmember_Remove(lib_ams::FShm& shm, lib_ams::FShmember& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:lib_ams.FShm.c_shmember.RemoveAll +inline void c_shmember_RemoveAll(lib_ams::FShm& shm) __attribute__((nothrow)); +// Reserve space in index for N more elements; +// func:lib_ams.FShm.c_shmember.Reserve +void c_shmember_Reserve(lib_ams::FShm& shm, u32 n) __attribute__((nothrow)); +// Heap-like Ptrary: remove first element +// If index is empty, return NULL. Otherwise remove and return first element in index. +// func:lib_ams.FShm.c_shmember.RemoveFirst +lib_ams::FShmember* c_shmember_RemoveFirst(lib_ams::FShm& shm) __attribute__((nothrow)); +// Ptrary: remove last element +// If index is empty, return NULL. Otherwise remove and return last element in index. +// func:lib_ams.FShm.c_shmember.RemoveLast +lib_ams::FShmember* c_shmember_RemoveLast(lib_ams::FShm& shm) __attribute__((nothrow)); +// Return reference without bounds checking +// func:lib_ams.FShm.c_shmember.qFind +inline lib_ams::FShmember& c_shmember_qFind(lib_ams::FShm& shm, u32 idx) __attribute__((nothrow)); +// True if row is in any ptrary instance +// func:lib_ams.FShm.c_shmember.InAryQ +inline bool shm_c_shmember_InAryQ(lib_ams::FShmember& row) __attribute__((nothrow)); +// Reference to last element without bounds checking +// func:lib_ams.FShm.c_shmember.qLast +inline lib_ams::FShmember& c_shmember_qLast(lib_ams::FShm& shm) __attribute__((nothrow)); // Declaration for user-defined cleanup function -// User-defined cleanup function invoked for field shm_handle of lib_ams::FStream -// func:lib_ams.FStream.shm_handle.Cleanup +// User-defined cleanup function invoked for field shm_file of lib_ams::FShm +// func:lib_ams.FShm.shm_file.Cleanup // this function is 'extrn' and implemented by user -void shm_handle_Cleanup(lib_ams::FStream& stream) __attribute__((nothrow)); +void shm_file_Cleanup(lib_ams::FShm& shm) __attribute__((nothrow)); // Invoke function by pointer -// func:lib_ams.FStream.h_msg.Call -inline void h_msg_Call(lib_ams::FStream& stream, ams::MsgHeader& arg) __attribute__((nothrow)); +// func:lib_ams.FShm.h_amsmsg.Call +inline void h_amsmsg_Call(lib_ams::FShm& shm, ams::MsgHeader& arg) __attribute__((nothrow)); // Assign 0-argument hook with no context pointer -// func:lib_ams.FStream.h_msg.Set0 -inline void h_msg_Set0(lib_ams::FStream& stream, void (*fcn)() ) __attribute__((nothrow)); +// func:lib_ams.FShm.h_amsmsg.Set0 +inline void h_amsmsg_Set0(lib_ams::FShm& shm, void (*fcn)() ) __attribute__((nothrow)); // Assign 1-argument hook with context pointer -// func:lib_ams.FStream.h_msg.Set1 -template inline void h_msg_Set1(lib_ams::FStream& stream, T& ctx, void (*fcn)(T&) ) __attribute__((nothrow)); +// func:lib_ams.FShm.h_amsmsg.Set1 +template inline void h_amsmsg_Set1(lib_ams::FShm& shm, T& ctx, void (*fcn)(T&) ) __attribute__((nothrow)); // Assign 2-argument hook with context pointer -// func:lib_ams.FStream.h_msg.Set2 -template inline void h_msg_Set2(lib_ams::FStream& stream, T& ctx, void (*fcn)(T&, ams::MsgHeader& arg) ) __attribute__((nothrow)); +// func:lib_ams.FShm.h_amsmsg.Set2 +template inline void h_amsmsg_Set2(lib_ams::FShm& shm, T& ctx, void (*fcn)(T&, ams::MsgHeader& arg) ) __attribute__((nothrow)); // Invoke function by pointer -// func:lib_ams.FStream.h_msg_orig.Call -inline void h_msg_orig_Call(lib_ams::FStream& stream, ams::MsgHeader& arg) __attribute__((nothrow)); +// func:lib_ams.FShm.h_msg_orig.Call +inline void h_msg_orig_Call(lib_ams::FShm& shm, ams::MsgHeader& arg) __attribute__((nothrow)); // Assign 0-argument hook with no context pointer -// func:lib_ams.FStream.h_msg_orig.Set0 -inline void h_msg_orig_Set0(lib_ams::FStream& stream, void (*fcn)() ) __attribute__((nothrow)); +// func:lib_ams.FShm.h_msg_orig.Set0 +inline void h_msg_orig_Set0(lib_ams::FShm& shm, void (*fcn)() ) __attribute__((nothrow)); // Assign 1-argument hook with context pointer -// func:lib_ams.FStream.h_msg_orig.Set1 -template inline void h_msg_orig_Set1(lib_ams::FStream& stream, T& ctx, void (*fcn)(T&) ) __attribute__((nothrow)); +// func:lib_ams.FShm.h_msg_orig.Set1 +template inline void h_msg_orig_Set1(lib_ams::FShm& shm, T& ctx, void (*fcn)(T&) ) __attribute__((nothrow)); // Assign 2-argument hook with context pointer -// func:lib_ams.FStream.h_msg_orig.Set2 -template inline void h_msg_orig_Set2(lib_ams::FStream& stream, T& ctx, void (*fcn)(T&, ams::MsgHeader& arg) ) __attribute__((nothrow)); - -// Return true if index is empty -// func:lib_ams.FStream.zd_member_bystream.EmptyQ -inline bool zd_member_bystream_EmptyQ(lib_ams::FStream& stream) __attribute__((__warn_unused_result__, nothrow, pure)); -// If index empty, return NULL. Otherwise return pointer to first element in index -// func:lib_ams.FStream.zd_member_bystream.First -inline lib_ams::FMember* zd_member_bystream_First(lib_ams::FStream& stream) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return true if row is in the linked list, false otherwise -// func:lib_ams.FStream.zd_member_bystream.InLlistQ -inline bool zd_member_bystream_InLlistQ(lib_ams::FMember& row) __attribute__((__warn_unused_result__, nothrow)); -// Insert row into linked list. If row is already in linked list, do nothing. -// func:lib_ams.FStream.zd_member_bystream.Insert -void zd_member_bystream_Insert(lib_ams::FStream& stream, lib_ams::FMember& row) __attribute__((nothrow)); -// If index empty, return NULL. Otherwise return pointer to last element in index -// func:lib_ams.FStream.zd_member_bystream.Last -inline lib_ams::FMember* zd_member_bystream_Last(lib_ams::FStream& stream) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return number of items in the linked list -// func:lib_ams.FStream.zd_member_bystream.N -inline i32 zd_member_bystream_N(const lib_ams::FStream& stream) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return pointer to next element in the list -// func:lib_ams.FStream.zd_member_bystream.Next -inline lib_ams::FMember* zd_member_bystream_Next(lib_ams::FMember &row) __attribute__((__warn_unused_result__, nothrow)); -// Return pointer to previous element in the list -// func:lib_ams.FStream.zd_member_bystream.Prev -inline lib_ams::FMember* zd_member_bystream_Prev(lib_ams::FMember &row) __attribute__((__warn_unused_result__, nothrow)); -// Remove element from index. If element is not in index, do nothing. -// func:lib_ams.FStream.zd_member_bystream.Remove -void zd_member_bystream_Remove(lib_ams::FStream& stream, lib_ams::FMember& row) __attribute__((nothrow)); -// Empty the index. (The rows are not deleted) -// func:lib_ams.FStream.zd_member_bystream.RemoveAll -void zd_member_bystream_RemoveAll(lib_ams::FStream& stream) __attribute__((nothrow)); -// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. -// func:lib_ams.FStream.zd_member_bystream.RemoveFirst -lib_ams::FMember* zd_member_bystream_RemoveFirst(lib_ams::FStream& stream) __attribute__((nothrow)); -// Return reference to last element in the index. No bounds checking. -// func:lib_ams.FStream.zd_member_bystream.qLast -inline lib_ams::FMember& zd_member_bystream_qLast(lib_ams::FStream& stream) __attribute__((__warn_unused_result__, nothrow)); +// func:lib_ams.FShm.h_msg_orig.Set2 +template inline void h_msg_orig_Set2(lib_ams::FShm& shm, T& ctx, void (*fcn)(T&, ams::MsgHeader& arg) ) __attribute__((nothrow)); // Set all fields to initial values. -// func:lib_ams.FStream..Init -void FStream_Init(lib_ams::FStream& stream); -// cursor points to valid item -// func:lib_ams.FStream.zd_member_bystream_curs.Reset -inline void stream_zd_member_bystream_curs_Reset(stream_zd_member_bystream_curs &curs, lib_ams::FStream &parent) __attribute__((nothrow)); +// func:lib_ams.FShm..Init +void FShm_Init(lib_ams::FShm& shm); +// func:lib_ams.FShm.c_shmember_curs.Reset +inline void shm_c_shmember_curs_Reset(shm_c_shmember_curs &curs, lib_ams::FShm &parent) __attribute__((nothrow)); // cursor points to valid item -// func:lib_ams.FStream.zd_member_bystream_curs.ValidQ -inline bool stream_zd_member_bystream_curs_ValidQ(stream_zd_member_bystream_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FShm.c_shmember_curs.ValidQ +inline bool shm_c_shmember_curs_ValidQ(shm_c_shmember_curs &curs) __attribute__((nothrow)); // proceed to next item -// func:lib_ams.FStream.zd_member_bystream_curs.Next -inline void stream_zd_member_bystream_curs_Next(stream_zd_member_bystream_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FShm.c_shmember_curs.Next +inline void shm_c_shmember_curs_Next(shm_c_shmember_curs &curs) __attribute__((nothrow)); // item access -// func:lib_ams.FStream.zd_member_bystream_curs.Access -inline lib_ams::FMember& stream_zd_member_bystream_curs_Access(stream_zd_member_bystream_curs &curs) __attribute__((nothrow)); -// func:lib_ams.FStream..Uninit -void FStream_Uninit(lib_ams::FStream& stream) __attribute__((nothrow)); - -// --- lib_ams.FStreamType -// create: lib_ams.FDb.streamtype (Lary) -// global access: streamtype (Lary, by rowid) -// global access: ind_streamtype (Thash, hash field id) -// access: lib_ams.FStream.p_streamtype (Upptr) -struct FStreamType { // lib_ams.FStreamType - lib_ams::FStreamType* ind_streamtype_next; // hash next - algo::Smallstr50 streamtype; // - ams::StreamType id; // - algo::Comment comment; // - // func:lib_ams.FStreamType..AssignOp - inline lib_ams::FStreamType& operator =(const lib_ams::FStreamType &rhs) = delete; - // func:lib_ams.FStreamType..CopyCtor - inline FStreamType(const lib_ams::FStreamType &rhs) = delete; +// func:lib_ams.FShm.c_shmember_curs.Access +inline lib_ams::FShmember& shm_c_shmember_curs_Access(shm_c_shmember_curs &curs) __attribute__((nothrow)); +// func:lib_ams.FShm..Uninit +void FShm_Uninit(lib_ams::FShm& shm) __attribute__((nothrow)); + +// --- lib_ams.FShmember +// create: lib_ams.FDb.shmember (Tpool) +// global access: cd_hb (Llist) +// global access: cd_poll_read (Llist) +// global access: cd_slow_poll_read (Llist) +// global access: ind_shmember (Thash, hash field shmember) +// global access: c_ctlin (Ptrary) +// global access: c_cur_shmember (Ptr) +// global access: bh_shmember_read (Bheap, sort field sortkey) +// access: lib_ams.FProc.c_shmember (Ptrary) +// access: lib_ams.FShm.c_shmember (Ptrary) +// access: lib_ams.FShm.c_read (Ptr) +// access: lib_ams.FShm.c_write (Ptr) +struct FShmember { // lib_ams.FShmember + lib_ams::FShmember* cd_hb_next; // zslist link; -1 means not-in-list + lib_ams::FShmember* cd_hb_prev; // previous element + lib_ams::FShmember* cd_poll_read_next; // zslist link; -1 means not-in-list + lib_ams::FShmember* cd_poll_read_prev; // previous element + lib_ams::FShmember* cd_slow_poll_read_next; // zslist link; -1 means not-in-list + lib_ams::FShmember* cd_slow_poll_read_prev; // previous element + lib_ams::FShmember* shmember_next; // Pointer to next free element int tpool + lib_ams::FShmember* ind_shmember_next; // hash next + u32 ind_shmember_hashval; // hash value + i32 bh_shmember_read_idx; // index in heap; -1 means not-in-heap + ams::ShmemberId shmember; // + u64 off; // 0 Current offset + algo::I64Rate rate_off; // Rate of change of offset + u64 sortkey; // 0 Sort key for reading + algo::SchedTime last_hb; // Time last heartbeat received + u64 budget; // 0 Write budget (if applicable) + lib_ams::FShm* p_shm; // reference to parent row + ams::Shmmsg* c_cur_msg; // Current message. optional pointer + lib_ams::FProc* p_proc; // reference to parent row + i32 c_ctlin_idx; // -1 Array index (-1 = not in array) + i32 proc_c_shmember_idx; // -1 Array index (-1 = not in array) + i32 shm_c_shmember_idx; // -1 Array index (-1 = not in array) + // x-reference on lib_ams.FShmember.p_shm prevents copy + // x-reference on lib_ams.FShmember.p_proc prevents copy + // func:lib_ams.FShmember..AssignOp + lib_ams::FShmember& operator =(const lib_ams::FShmember &rhs) = delete; + // x-reference on lib_ams.FShmember.p_shm prevents copy + // x-reference on lib_ams.FShmember.p_proc prevents copy + // func:lib_ams.FShmember..CopyCtor + FShmember(const lib_ams::FShmember &rhs) = delete; +private: + // func:lib_ams.FShmember..Ctor + inline FShmember() __attribute__((nothrow)); + // func:lib_ams.FShmember..Dtor + inline ~FShmember() __attribute__((nothrow)); + friend lib_ams::FShmember& shmember_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_ams::FShmember* shmember_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void shmember_Delete(lib_ams::FShmember &row) __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:lib_ams.FShmember..Init +void FShmember_Init(lib_ams::FShmember& shmember); +// func:lib_ams.FShmember..Uninit +void FShmember_Uninit(lib_ams::FShmember& shmember) __attribute__((nothrow)); + +// --- lib_ams.FShmtype +// create: lib_ams.FDb.shmtype (Lary) +// global access: shmtype (Lary, by rowid) +// global access: ind_shmtype (Thash, hash field id) +// access: lib_ams.FShm.p_shmtype (Upptr) +struct FShmtype { // lib_ams.FShmtype + lib_ams::FShmtype* ind_shmtype_next; // hash next + u32 ind_shmtype_hashval; // hash value + algo::Smallstr50 shmtype; // + ams::Shmtype id; // + bool nonblock; // false Non-blocking (lossy) stream + algo::Comment comment; // + // func:lib_ams.FShmtype..AssignOp + inline lib_ams::FShmtype& operator =(const lib_ams::FShmtype &rhs) = delete; + // func:lib_ams.FShmtype..CopyCtor + inline FShmtype(const lib_ams::FShmtype &rhs) = delete; private: - // func:lib_ams.FStreamType..Ctor - inline FStreamType() __attribute__((nothrow)); - // func:lib_ams.FStreamType..Dtor - inline ~FStreamType() __attribute__((nothrow)); - friend lib_ams::FStreamType& streamtype_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend lib_ams::FStreamType* streamtype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void streamtype_RemoveAll() __attribute__((nothrow)); - friend void streamtype_RemoveLast() __attribute__((nothrow)); + // func:lib_ams.FShmtype..Ctor + inline FShmtype() __attribute__((nothrow)); + // func:lib_ams.FShmtype..Dtor + inline ~FShmtype() __attribute__((nothrow)); + friend lib_ams::FShmtype& shmtype_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_ams::FShmtype* shmtype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void shmtype_RemoveAll() __attribute__((nothrow)); + friend void shmtype_RemoveLast() __attribute__((nothrow)); }; // Copy fields out of row -// func:lib_ams.FStreamType.base.CopyOut -void streamtype_CopyOut(lib_ams::FStreamType &row, amsdb::StreamType &out) __attribute__((nothrow)); +// func:lib_ams.FShmtype.base.CopyOut +void shmtype_CopyOut(lib_ams::FShmtype &row, amsdb::Shmtype &out) __attribute__((nothrow)); // Copy fields in to row -// func:lib_ams.FStreamType.base.CopyIn -void streamtype_CopyIn(lib_ams::FStreamType &row, amsdb::StreamType &in) __attribute__((nothrow)); +// func:lib_ams.FShmtype.base.CopyIn +void shmtype_CopyIn(lib_ams::FShmtype &row, amsdb::Shmtype &in) __attribute__((nothrow)); // Set all fields to initial values. -// func:lib_ams.FStreamType..Init -inline void FStreamType_Init(lib_ams::FStreamType& streamtype); -// func:lib_ams.FStreamType..Uninit -void FStreamType_Uninit(lib_ams::FStreamType& streamtype) __attribute__((nothrow)); +// func:lib_ams.FShmtype..Init +inline void FShmtype_Init(lib_ams::FShmtype& shmtype); +// func:lib_ams.FShmtype..Uninit +void FShmtype_Uninit(lib_ams::FShmtype& shmtype) __attribute__((nothrow)); // --- lib_ams.FWritefile // create: lib_ams.FDb.writefile (Cppstack) @@ -1825,6 +2157,11 @@ u8& buf_AllocAt(lib_ams::FWritefile& writefile, int at) __attri // Reserve space. Insert N elements at the end of the array, return pointer to array // func:lib_ams.FWritefile.buf.AllocN algo::aryptr buf_AllocN(lib_ams::FWritefile& writefile, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:lib_ams.FWritefile.buf.AllocNAt +algo::aryptr buf_AllocNAt(lib_ams::FWritefile& writefile, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:lib_ams.FWritefile.buf.EmptyQ inline bool buf_EmptyQ(lib_ams::FWritefile& writefile) __attribute__((nothrow)); @@ -1883,6 +2220,10 @@ algo::aryptr buf_AllocNVal(lib_ams::FWritefile& writefile, int n_elems, // The array is replaced with the input string. Function always succeeds. // func:lib_ams.FWritefile.buf.ReadStrptrMaybe bool buf_ReadStrptrMaybe(lib_ams::FWritefile& writefile, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:lib_ams.FWritefile.buf.Insary +void buf_Insary(lib_ams::FWritefile& writefile, algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -1900,6 +2241,11 @@ u8& cbuf_AllocAt(lib_ams::FWritefile& writefile, int at) __attr // Reserve space. Insert N elements at the end of the array, return pointer to array // func:lib_ams.FWritefile.cbuf.AllocN algo::aryptr cbuf_AllocN(lib_ams::FWritefile& writefile, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:lib_ams.FWritefile.cbuf.AllocNAt +algo::aryptr cbuf_AllocNAt(lib_ams::FWritefile& writefile, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:lib_ams.FWritefile.cbuf.EmptyQ inline bool cbuf_EmptyQ(lib_ams::FWritefile& writefile) __attribute__((nothrow)); @@ -1958,6 +2304,10 @@ algo::aryptr cbuf_AllocNVal(lib_ams::FWritefile& writefile, int n_elems, // The array is replaced with the input string. Function always succeeds. // func:lib_ams.FWritefile.cbuf.ReadStrptrMaybe bool cbuf_ReadStrptrMaybe(lib_ams::FWritefile& writefile, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:lib_ams.FWritefile.cbuf.Insary +void cbuf_Insary(lib_ams::FWritefile& writefile, algo::aryptr rhs, int at) __attribute__((nothrow)); // Set all fields to initial values. // func:lib_ams.FWritefile..Init @@ -2044,6 +2394,64 @@ inline void FieldId_Init(lib_ams::FieldId& parent); // cfmt:lib_ams.FieldId.String printfmt:Raw // func:lib_ams.FieldId..Print void FieldId_Print(lib_ams::FieldId& row, algo::cstring& str) __attribute__((nothrow)); + +// --- lib_ams.MsgFmt +// access: lib_ams.MsgFmt.h_convert (Hook) +struct MsgFmt { // lib_ams.MsgFmt + i32 payload_lim; // 1024000 Print up to this many chars from payload + i32 indent; // 0 Print indentation (with -pretty) + u8 format; // 0 Output format + i32 strip; // 0 Number of headers to strip + bool pretty; // true Use structured and indented printing + bool showlen; // false Show message length + lib_ams::parent_h_convert_hook h_convert; // NULL Pointer to a function + u64 h_convert_ctx; // 0 Callback context + algo::cstring convert_key; // conversion key + algo::cstring convert_val; // conversion value - overwritten by the return + // func:lib_ams.MsgFmt..Ctor + inline MsgFmt() __attribute__((nothrow)); +}; + +// Get value of field as enum type +// func:lib_ams.MsgFmt.format.GetEnum +inline lib_ams_MsgFmt_format_Enum format_GetEnum(const lib_ams::MsgFmt& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:lib_ams.MsgFmt.format.SetEnum +inline void format_SetEnum(lib_ams::MsgFmt& parent, lib_ams_MsgFmt_format_Enum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:lib_ams.MsgFmt.format.ToCstr +const char* format_ToCstr(const lib_ams::MsgFmt& parent) __attribute__((nothrow)); +// Convert format to a string. First, attempt conversion to a known string. +// If no string matches, print format as a numeric value. +// func:lib_ams.MsgFmt.format.Print +void format_Print(const lib_ams::MsgFmt& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:lib_ams.MsgFmt.format.SetStrptrMaybe +bool format_SetStrptrMaybe(lib_ams::MsgFmt& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:lib_ams.MsgFmt.format.SetStrptr +void format_SetStrptr(lib_ams::MsgFmt& parent, algo::strptr rhs, lib_ams_MsgFmt_format_Enum dflt) __attribute__((nothrow)); + +// Invoke function by pointer +// func:lib_ams.MsgFmt.h_convert.Call +inline void h_convert_Call(lib_ams::MsgFmt& parent, lib_ams::MsgFmt& arg) __attribute__((nothrow)); +// Assign 0-argument hook with no context pointer +// func:lib_ams.MsgFmt.h_convert.Set0 +inline void h_convert_Set0(lib_ams::MsgFmt& parent, void (*fcn)() ) __attribute__((nothrow)); +// Assign 1-argument hook with context pointer +// func:lib_ams.MsgFmt.h_convert.Set1 +template inline void h_convert_Set1(lib_ams::MsgFmt& parent, T& ctx, void (*fcn)(T&) ) __attribute__((nothrow)); +// Assign 2-argument hook with context pointer +// func:lib_ams.MsgFmt.h_convert.Set2 +template inline void h_convert_Set2(lib_ams::MsgFmt& parent, T& ctx, void (*fcn)(T&, lib_ams::MsgFmt& arg) ) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:lib_ams.MsgFmt..Init +inline void MsgFmt_Init(lib_ams::MsgFmt& parent); } // gen:ns_print_struct namespace lib_ams { // gen:ns_curstext @@ -2086,19 +2494,19 @@ struct _db_zd_flush_curs {// fcurs:lib_ams.FDb.zd_flush/curs }; -struct _db_stream_curs {// cursor - typedef lib_ams::FStream ChildType; +struct _db_shm_curs {// cursor + typedef lib_ams::FShm ChildType; lib_ams::FDb *parent; i64 index; - _db_stream_curs(){ parent=NULL; index=0; } + _db_shm_curs(){ parent=NULL; index=0; } }; -struct _db_cd_stream_hb_curs {// fcurs:lib_ams.FDb.cd_stream_hb/curs - typedef lib_ams::FStream ChildType; - lib_ams::FStream* row; - lib_ams::FStream** head; // address of head element - _db_cd_stream_hb_curs() { +struct _db_cd_hb_curs {// fcurs:lib_ams.FDb.cd_hb/curs + typedef lib_ams::FShmember ChildType; + lib_ams::FShmember* row; + lib_ams::FShmember** head; // address of head element + _db_cd_hb_curs() { row = NULL; head = NULL; } @@ -2106,9 +2514,9 @@ struct _db_cd_stream_hb_curs {// fcurs:lib_ams.FDb.cd_stream_hb/curs struct _db_cd_poll_read_curs {// fcurs:lib_ams.FDb.cd_poll_read/curs - typedef lib_ams::FStream ChildType; - lib_ams::FStream* row; - lib_ams::FStream** head; // address of head element + typedef lib_ams::FShmember ChildType; + lib_ams::FShmember* row; + lib_ams::FShmember** head; // address of head element _db_cd_poll_read_curs() { row = NULL; head = NULL; @@ -2116,20 +2524,40 @@ struct _db_cd_poll_read_curs {// fcurs:lib_ams.FDb.cd_poll_read/curs }; -struct _db_streamtype_curs {// cursor - typedef lib_ams::FStreamType ChildType; +struct _db_cd_slow_poll_read_curs {// fcurs:lib_ams.FDb.cd_slow_poll_read/curs + typedef lib_ams::FShmember ChildType; + lib_ams::FShmember* row; + lib_ams::FShmember** head; // address of head element + _db_cd_slow_poll_read_curs() { + row = NULL; + head = NULL; + } +}; + + +struct _db_ind_shmember_curs {// cursor + typedef lib_ams::FShmember ChildType; + lib_ams::FDb *parent; + int bucket; + lib_ams::FShmember **prow; + _db_ind_shmember_curs() { parent=NULL; bucket=0; prow=NULL; } +}; + + +struct _db_shmtype_curs {// cursor + typedef lib_ams::FShmtype ChildType; lib_ams::FDb *parent; i64 index; - _db_streamtype_curs(){ parent=NULL; index=0; } + _db_shmtype_curs(){ parent=NULL; index=0; } }; -struct _db_zd_ctlin_curs {// fcurs:lib_ams.FDb.zd_ctlin/curs - typedef lib_ams::FStream ChildType; - lib_ams::FStream* row; - _db_zd_ctlin_curs() { - row = NULL; - } +struct _db_c_ctlin_curs {// fcurs:lib_ams.FDb.c_ctlin/curs + typedef lib_ams::FShmember ChildType; + lib_ams::FShmember** elems; + u32 n_elems; + u32 index; + _db_c_ctlin_curs() { elems=NULL; n_elems=0; index=0; } }; @@ -2141,13 +2569,34 @@ struct _db_zd_proc_curs {// fcurs:lib_ams.FDb.zd_proc/curs } }; +// Non-destructive heap cursor, returns heap elements in sorted order. +// A running front of potential smallest entries is kept in the helper heap (curs.temp_%) +struct _db_bh_shmember_read_curs { + typedef lib_ams::FShmember ChildType; + lib_ams::FDb *parent; // parent + lib_ams::FShmember* *temp_elems; // helper heap + int temp_n; // number of elements heaped in the helper heap + int temp_max; // max number of elements possible in the helper heap + _db_bh_shmember_read_curs() : parent(NULL), temp_elems(NULL), temp_n(0), temp_max(0) {} + ~_db_bh_shmember_read_curs(); +}; -struct proc_zd_member_byproc_curs {// fcurs:lib_ams.FProc.zd_member_byproc/curs - typedef lib_ams::FMember ChildType; - lib_ams::FMember* row; - proc_zd_member_byproc_curs() { - row = NULL; - } + +struct proc_c_shm_curs {// fcurs:lib_ams.FProc.c_shm/curs + typedef lib_ams::FShm ChildType; + lib_ams::FShm** elems; + u32 n_elems; + u32 index; + proc_c_shm_curs() { elems=NULL; n_elems=0; index=0; } +}; + + +struct proc_c_shmember_curs {// fcurs:lib_ams.FProc.c_shmember/curs + typedef lib_ams::FShmember ChildType; + lib_ams::FShmember** elems; + u32 n_elems; + u32 index; + proc_c_shmember_curs() { elems=NULL; n_elems=0; index=0; } }; @@ -2178,12 +2627,12 @@ struct FReadfile_offset_curs {// cursor }; -struct stream_zd_member_bystream_curs {// fcurs:lib_ams.FStream.zd_member_bystream/curs - typedef lib_ams::FMember ChildType; - lib_ams::FMember* row; - stream_zd_member_bystream_curs() { - row = NULL; - } +struct shm_c_shmember_curs {// fcurs:lib_ams.FShm.c_shmember/curs + typedef lib_ams::FShmember ChildType; + lib_ams::FShmember** elems; + u32 n_elems; + u32 index; + shm_c_shmember_curs() { elems=NULL; n_elems=0; index=0; } }; @@ -2209,21 +2658,9 @@ namespace lib_ams { // gen:ns_func // func:lib_ams...StaticCheck void StaticCheck(); // User-implemented callback function for dispatch CtlMsg -// func:lib_ams.CtlMsg.ams.DumpStreamTableMsg -// this function is 'extrn' and implemented by user -void CtlMsg_DumpStreamTableMsg(ams::DumpStreamTableMsg &msg); -// User-implemented callback function for dispatch CtlMsg -// func:lib_ams.CtlMsg.ams.ProcAddMsg -// this function is 'extrn' and implemented by user -void CtlMsg_ProcAddMsg(ams::ProcAddMsg &msg); -// User-implemented callback function for dispatch CtlMsg -// func:lib_ams.CtlMsg.ams.ProcRemoveMsg -// this function is 'extrn' and implemented by user -void CtlMsg_ProcRemoveMsg(ams::ProcRemoveMsg &msg); -// User-implemented callback function for dispatch CtlMsg -// func:lib_ams.CtlMsg.ams.StreamHbMsg +// func:lib_ams.CtlMsg.ams.ShmHbMsg // this function is 'extrn' and implemented by user -void CtlMsg_StreamHbMsg(ams::StreamHbMsg &msg); +void CtlMsg_ShmHbMsg(ams::ShmHbMsg &msg); // func:lib_ams.CtlMsg..DispatchRaw int CtlMsgDispatchRaw(lib_ams::CtlMsgCase type, u8 *msg, u32 len); // func:lib_ams.CtlMsg..Dispatch @@ -2234,55 +2671,27 @@ void vCtlMsgDispatch(ams::MsgHeader& msg); // Construct a new ams::InputLineMsg in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. // func:lib_ams...InputLineMsg_FmtByteAry -ams::InputLineMsg * InputLineMsg_FmtByteAry(algo::ByteAry &buf, algo::aryptr payload); +ams::InputLineMsg * InputLineMsg_FmtByteAry(algo::ByteAry &buf, ams::ProcId proc_id, algo::aryptr payload); // Construct a new ams::LogMsg in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -// func:lib_ams...LogMsg_FmtAmsStream -ams::LogMsg * LogMsg_FmtAmsStream(lib_ams::FStream &stream, const algo::strptr& logcat, algo::SchedTime tstamp, algo::aryptr text); +// func:lib_ams...LogMsg_FmtShm +ams::LogMsg * LogMsg_FmtShm(lib_ams::FShm &shm, ams::ProcId proc_id, algo::SchedTime tstamp, algo::aryptr logcat, algo::aryptr text); // Construct a new ams::MsgBlock in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -// func:lib_ams...MsgBlock_FmtAmsStream -ams::MsgBlock * MsgBlock_FmtAmsStream(lib_ams::FStream &stream, u64 first_seqno, u32 n_messages, u32 original_length, algo::aryptr messages); -// Construct a new ams::OpenMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:lib_ams...OpenMsg_FmtAmsStream -ams::OpenMsg * OpenMsg_FmtAmsStream(lib_ams::FStream &stream, ams::Member member, ams::StreamPos pos); -// Construct a new ams::PrlogMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:lib_ams...PrlogMsg_FmtAmsStream -ams::PrlogMsg * PrlogMsg_FmtAmsStream(lib_ams::FStream &stream, const algo::strptr& logcat, algo::SchedTime tstamp, ams::MsgHeader* data); -// Construct a new ams::ProcAddMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:lib_ams...ProcAddMsg_FmtAmsStream -ams::ProcAddMsg * ProcAddMsg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc_id); -// Construct a new ams::ProcRemoveMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:lib_ams...ProcRemoveMsg_FmtAmsStream -ams::ProcRemoveMsg * ProcRemoveMsg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc_id); -// Construct a new ams::StreamHbMsg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:lib_ams...StreamHbMsg_FmtAmsStream -ams::StreamHbMsg * StreamHbMsg_FmtAmsStream(lib_ams::FStream &stream, ams::Member member, ams::StreamPos pos, u32 wbudget); -// Construct a new ams::Trace2Msg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:lib_ams...Trace2Msg_FmtAmsStream -ams::Trace2Msg * Trace2Msg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc, u8 trace, algo::UnTime tstamp, algo::aryptr data); -// Construct a new ams::TraceInfo2Msg in the space provided by BUF. -// If BUF doesn't have enough space available, throw exception. -// func:lib_ams...TraceInfo2Msg_FmtAmsStream -ams::TraceInfo2Msg * TraceInfo2Msg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc, u8 trace, algo::UnTime tstamp, u8 part, algo::aryptr data); -// Construct a new ams::TraceInfoMsg in the space provided by BUF. +// func:lib_ams...MsgBlock_FmtShm +ams::MsgBlock * MsgBlock_FmtShm(lib_ams::FShm &shm, u64 first_seqno, u32 n_messages, u32 original_length, algo::aryptr messages); +// Construct a new ams::ShmHbMsg in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -// func:lib_ams...TraceInfoMsg_FmtAmsStream -ams::TraceInfoMsg * TraceInfoMsg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc, algo::UnTime tstamp, u8 part, algo::aryptr data); -// Construct a new ams::TraceMsg in the space provided by BUF. +// func:lib_ams...ShmHbMsg_FmtShm +ams::ShmHbMsg * ShmHbMsg_FmtShm(lib_ams::FShm &shm, ams::ShmemberId shmember, u64 off, u32 wbudget); +// Construct a new ams::TerminateMsg in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -// func:lib_ams...TraceMsg_FmtAmsStream -ams::TraceMsg * TraceMsg_FmtAmsStream(lib_ams::FStream &stream, ams::ProcId proc, algo::UnTime tstamp, algo::aryptr data); +// func:lib_ams...TerminateMsg_FmtShm +ams::TerminateMsg * TerminateMsg_FmtShm(lib_ams::FShm &shm); // Construct a new ams::UdpFrame in the space provided by BUF. // If BUF doesn't have enough space available, throw exception. -// func:lib_ams...UdpFrame_FmtAmsStream -ams::UdpFrame * UdpFrame_FmtAmsStream(lib_ams::FStream &stream, algo::UnTime timestamp, ietf::Ipv4 src_ip, ietf::Ipv4 dst_ip, u16 src_port, u16 dst_port, algo::aryptr payload); +// func:lib_ams...UdpFrame_FmtShm +ams::UdpFrame * UdpFrame_FmtShm(lib_ams::FShm &shm, algo::UnTime timestamp, ietf::Ipv4 src_ip, ietf::Ipv4 dst_ip, u16 src_port, u16 dst_port, algo::aryptr payload); } // gen:ns_func // gen:ns_operators namespace algo { diff --git a/include/gen/lib_ams_gen.inl.h b/include/gen/lib_ams_gen.inl.h index 79a8a70d..ec67df73 100644 --- a/include/gen/lib_ams_gen.inl.h +++ b/include/gen/lib_ams_gen.inl.h @@ -107,15 +107,6 @@ inline lib_ams::CtlMsgCase::CtlMsgCase(lib_ams_CtlMsgCaseEnum arg) { this->value = u32(arg); } -// --- lib_ams.trace..Init -// Set all fields to initial values. -inline void lib_ams::trace_Init(lib_ams::trace& parent) { - parent.n_fdin_drop_notgt = u64(0); - parent.n_fdin_posted = u64(0); - parent.n_fdin_pushback = u64(0); - parent.n_write_block_spin = u64(0); -} - // --- lib_ams.trace..Ctor inline lib_ams::trace::trace() { lib_ams::trace_Init(*this); @@ -331,113 +322,113 @@ inline lib_ams::FWritefile& lib_ams::zd_flush_qLast() { return *row; } -// --- lib_ams.FDb.stream.EmptyQ +// --- lib_ams.FDb.shm.EmptyQ // Return true if index is empty -inline bool lib_ams::stream_EmptyQ() { - return _db.stream_n == 0; +inline bool lib_ams::shm_EmptyQ() { + return _db.shm_n == 0; } -// --- lib_ams.FDb.stream.Find +// --- lib_ams.FDb.shm.Find // Look up row by row id. Return NULL if out of range -inline lib_ams::FStream* lib_ams::stream_Find(u64 t) { - lib_ams::FStream *retval = NULL; - if (LIKELY(u64(t) < u64(_db.stream_n))) { +inline lib_ams::FShm* lib_ams::shm_Find(u64 t) { + lib_ams::FShm *retval = NULL; + if (LIKELY(u64(t) < u64(_db.shm_n))) { u64 x = t + 1; u64 bsr = algo::u64_BitScanReverse(x); u64 base = u64(1)<cd_stream_hb_prev : NULL; +inline lib_ams::FShmember* lib_ams::cd_hb_Last() { + lib_ams::FShmember *row = NULL; + row = _db.cd_hb_head ? _db.cd_hb_head->cd_hb_prev : NULL; return row; } -// --- lib_ams.FDb.cd_stream_hb.N +// --- lib_ams.FDb.cd_hb.N // Return number of items in the linked list -inline i32 lib_ams::cd_stream_hb_N() { - return _db.cd_stream_hb_n; +inline i32 lib_ams::cd_hb_N() { + return _db.cd_hb_n; } -// --- lib_ams.FDb.cd_stream_hb.Next +// --- lib_ams.FDb.cd_hb.Next // Return pointer to next element in the list -inline lib_ams::FStream* lib_ams::cd_stream_hb_Next(lib_ams::FStream &row) { - return row.cd_stream_hb_next; +inline lib_ams::FShmember* lib_ams::cd_hb_Next(lib_ams::FShmember &row) { + return row.cd_hb_next; } -// --- lib_ams.FDb.cd_stream_hb.Prev +// --- lib_ams.FDb.cd_hb.Prev // Return pointer to previous element in the list -inline lib_ams::FStream* lib_ams::cd_stream_hb_Prev(lib_ams::FStream &row) { - return row.cd_stream_hb_prev; +inline lib_ams::FShmember* lib_ams::cd_hb_Prev(lib_ams::FShmember &row) { + return row.cd_hb_prev; } -// --- lib_ams.FDb.cd_stream_hb.qLast +// --- lib_ams.FDb.cd_hb.qLast // Return reference to last element in the index. No bounds checking. -inline lib_ams::FStream& lib_ams::cd_stream_hb_qLast() { - lib_ams::FStream *row = NULL; - row = _db.cd_stream_hb_head ? _db.cd_stream_hb_head->cd_stream_hb_prev : NULL; +inline lib_ams::FShmember& lib_ams::cd_hb_qLast() { + lib_ams::FShmember *row = NULL; + row = _db.cd_hb_head ? _db.cd_hb_head->cd_hb_prev : NULL; return *row; } @@ -449,24 +440,24 @@ inline bool lib_ams::cd_poll_read_EmptyQ() { // --- lib_ams.FDb.cd_poll_read.First // If index empty, return NULL. Otherwise return pointer to first element in index -inline lib_ams::FStream* lib_ams::cd_poll_read_First() { - lib_ams::FStream *row = NULL; +inline lib_ams::FShmember* lib_ams::cd_poll_read_First() { + lib_ams::FShmember *row = NULL; row = _db.cd_poll_read_head; return row; } // --- lib_ams.FDb.cd_poll_read.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool lib_ams::cd_poll_read_InLlistQ(lib_ams::FStream& row) { +inline bool lib_ams::cd_poll_read_InLlistQ(lib_ams::FShmember& row) { bool result = false; - result = !(row.cd_poll_read_next == (lib_ams::FStream*)-1); + result = !(row.cd_poll_read_next == (lib_ams::FShmember*)-1); return result; } // --- lib_ams.FDb.cd_poll_read.Last // If index empty, return NULL. Otherwise return pointer to last element in index -inline lib_ams::FStream* lib_ams::cd_poll_read_Last() { - lib_ams::FStream *row = NULL; +inline lib_ams::FShmember* lib_ams::cd_poll_read_Last() { + lib_ams::FShmember *row = NULL; row = _db.cd_poll_read_head ? _db.cd_poll_read_head->cd_poll_read_prev : NULL; return row; } @@ -479,24 +470,80 @@ inline i32 lib_ams::cd_poll_read_N() { // --- lib_ams.FDb.cd_poll_read.Next // Return pointer to next element in the list -inline lib_ams::FStream* lib_ams::cd_poll_read_Next(lib_ams::FStream &row) { +inline lib_ams::FShmember* lib_ams::cd_poll_read_Next(lib_ams::FShmember &row) { return row.cd_poll_read_next; } // --- lib_ams.FDb.cd_poll_read.Prev // Return pointer to previous element in the list -inline lib_ams::FStream* lib_ams::cd_poll_read_Prev(lib_ams::FStream &row) { +inline lib_ams::FShmember* lib_ams::cd_poll_read_Prev(lib_ams::FShmember &row) { return row.cd_poll_read_prev; } // --- lib_ams.FDb.cd_poll_read.qLast // Return reference to last element in the index. No bounds checking. -inline lib_ams::FStream& lib_ams::cd_poll_read_qLast() { - lib_ams::FStream *row = NULL; +inline lib_ams::FShmember& lib_ams::cd_poll_read_qLast() { + lib_ams::FShmember *row = NULL; row = _db.cd_poll_read_head ? _db.cd_poll_read_head->cd_poll_read_prev : NULL; return *row; } +// --- lib_ams.FDb.cd_slow_poll_read.EmptyQ +// Return true if index is empty +inline bool lib_ams::cd_slow_poll_read_EmptyQ() { + return _db.cd_slow_poll_read_head == NULL; +} + +// --- lib_ams.FDb.cd_slow_poll_read.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline lib_ams::FShmember* lib_ams::cd_slow_poll_read_First() { + lib_ams::FShmember *row = NULL; + row = _db.cd_slow_poll_read_head; + return row; +} + +// --- lib_ams.FDb.cd_slow_poll_read.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool lib_ams::cd_slow_poll_read_InLlistQ(lib_ams::FShmember& row) { + bool result = false; + result = !(row.cd_slow_poll_read_next == (lib_ams::FShmember*)-1); + return result; +} + +// --- lib_ams.FDb.cd_slow_poll_read.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline lib_ams::FShmember* lib_ams::cd_slow_poll_read_Last() { + lib_ams::FShmember *row = NULL; + row = _db.cd_slow_poll_read_head ? _db.cd_slow_poll_read_head->cd_slow_poll_read_prev : NULL; + return row; +} + +// --- lib_ams.FDb.cd_slow_poll_read.N +// Return number of items in the linked list +inline i32 lib_ams::cd_slow_poll_read_N() { + return _db.cd_slow_poll_read_n; +} + +// --- lib_ams.FDb.cd_slow_poll_read.Next +// Return pointer to next element in the list +inline lib_ams::FShmember* lib_ams::cd_slow_poll_read_Next(lib_ams::FShmember &row) { + return row.cd_slow_poll_read_next; +} + +// --- lib_ams.FDb.cd_slow_poll_read.Prev +// Return pointer to previous element in the list +inline lib_ams::FShmember* lib_ams::cd_slow_poll_read_Prev(lib_ams::FShmember &row) { + return row.cd_slow_poll_read_prev; +} + +// --- lib_ams.FDb.cd_slow_poll_read.qLast +// Return reference to last element in the index. No bounds checking. +inline lib_ams::FShmember& lib_ams::cd_slow_poll_read_qLast() { + lib_ams::FShmember *row = NULL; + row = _db.cd_slow_poll_read_head ? _db.cd_slow_poll_read_head->cd_slow_poll_read_prev : NULL; + return *row; +} + // --- lib_ams.FDb.ind_proc.EmptyQ // Return true if hash is empty inline bool lib_ams::ind_proc_EmptyQ() { @@ -509,126 +556,141 @@ inline i32 lib_ams::ind_proc_N() { return _db.ind_proc_n; } -// --- lib_ams.FDb.ind_member.EmptyQ +// --- lib_ams.FDb.ind_shmember.EmptyQ // Return true if hash is empty -inline bool lib_ams::ind_member_EmptyQ() { - return _db.ind_member_n == 0; +inline bool lib_ams::ind_shmember_EmptyQ() { + return _db.ind_shmember_n == 0; } -// --- lib_ams.FDb.ind_member.N +// --- lib_ams.FDb.ind_shmember.N // Return number of items in the hash -inline i32 lib_ams::ind_member_N() { - return _db.ind_member_n; +inline i32 lib_ams::ind_shmember_N() { + return _db.ind_shmember_n; } -// --- lib_ams.FDb.streamtype.EmptyQ +// --- lib_ams.FDb.shmtype.EmptyQ // Return true if index is empty -inline bool lib_ams::streamtype_EmptyQ() { - return _db.streamtype_n == 0; +inline bool lib_ams::shmtype_EmptyQ() { + return _db.shmtype_n == 0; } -// --- lib_ams.FDb.streamtype.Find +// --- lib_ams.FDb.shmtype.Find // Look up row by row id. Return NULL if out of range -inline lib_ams::FStreamType* lib_ams::streamtype_Find(u64 t) { - lib_ams::FStreamType *retval = NULL; - if (LIKELY(u64(t) < u64(_db.streamtype_n))) { +inline lib_ams::FShmtype* lib_ams::shmtype_Find(u64 t) { + lib_ams::FShmtype *retval = NULL; + if (LIKELY(u64(t) < u64(_db.shmtype_n))) { u64 x = t + 1; u64 bsr = algo::u64_BitScanReverse(x); u64 base = u64(1)< lib_ams::c_ctlin_Getary() { + return algo::aryptr(_db.c_ctlin_elems, _db.c_ctlin_n); } -// --- lib_ams.FDb.zd_ctlin.Last -// If index empty, return NULL. Otherwise return pointer to last element in index -inline lib_ams::FStream* lib_ams::zd_ctlin_Last() { - lib_ams::FStream *row = NULL; - row = _db.zd_ctlin_tail; +// --- lib_ams.FDb.c_ctlin.First +inline lib_ams::FShmember* lib_ams::c_ctlin_First() { + lib_ams::FShmember *row = NULL; + row = _db.c_ctlin_n ? _db.c_ctlin_elems[0] : NULL; return row; } -// --- lib_ams.FDb.zd_ctlin.N -// Return number of items in the linked list -inline i32 lib_ams::zd_ctlin_N() { - return _db.zd_ctlin_n; +// --- lib_ams.FDb.c_ctlin.Last +inline lib_ams::FShmember* lib_ams::c_ctlin_Last() { + lib_ams::FShmember *row = NULL; + row = _db.c_ctlin_n ? _db.c_ctlin_elems[_db.c_ctlin_n-1] : NULL; + return row; } -// --- lib_ams.FDb.zd_ctlin.Next -// Return pointer to next element in the list -inline lib_ams::FStream* lib_ams::zd_ctlin_Next(lib_ams::FStream &row) { - return row.zd_ctlin_next; +// --- lib_ams.FDb.c_ctlin.N +// Return number of items in the pointer array +inline i32 lib_ams::c_ctlin_N() { + return _db.c_ctlin_n; } -// --- lib_ams.FDb.zd_ctlin.Prev -// Return pointer to previous element in the list -inline lib_ams::FStream* lib_ams::zd_ctlin_Prev(lib_ams::FStream &row) { - return row.zd_ctlin_prev; +// --- lib_ams.FDb.c_ctlin.RemoveAll +// Empty the index. (The rows are not deleted) +inline void lib_ams::c_ctlin_RemoveAll() { + for (u32 i = 0; i < _db.c_ctlin_n; i++) { + _db.c_ctlin_elems[i]->c_ctlin_idx = -1; + } + _db.c_ctlin_n = 0; } -// --- lib_ams.FDb.zd_ctlin.qLast -// Return reference to last element in the index. No bounds checking. -inline lib_ams::FStream& lib_ams::zd_ctlin_qLast() { - lib_ams::FStream *row = NULL; - row = _db.zd_ctlin_tail; - return *row; +// --- lib_ams.FDb.c_ctlin.qFind +// Return reference without bounds checking +inline lib_ams::FShmember& lib_ams::c_ctlin_qFind(u32 idx) { + return *_db.c_ctlin_elems[idx]; +} + +// --- lib_ams.FDb.c_ctlin.InAryQ +// True if row is in any ptrary instance +inline bool lib_ams::c_ctlin_InAryQ(lib_ams::FShmember& row) { + return row.c_ctlin_idx != -1; +} + +// --- lib_ams.FDb.c_ctlin.qLast +// Reference to last element without bounds checking +inline lib_ams::FShmember& lib_ams::c_ctlin_qLast() { + return *_db.c_ctlin_elems[_db.c_ctlin_n-1]; } // --- lib_ams.FDb.zd_proc.EmptyQ @@ -687,6 +749,36 @@ inline lib_ams::FProc& lib_ams::zd_proc_qLast() { return *row; } +// --- lib_ams.FDb.bh_shmember_read.EmptyQ +// Return true if index is empty +inline bool lib_ams::bh_shmember_read_EmptyQ() { + return _db.bh_shmember_read_n == 0; +} + +// --- lib_ams.FDb.bh_shmember_read.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline lib_ams::FShmember* lib_ams::bh_shmember_read_First() { + lib_ams::FShmember *row = NULL; + if (_db.bh_shmember_read_n > 0) { + row = _db.bh_shmember_read_elems[0]; + } + return row; +} + +// --- lib_ams.FDb.bh_shmember_read.InBheapQ +// Return true if row is in index, false otherwise +inline bool lib_ams::bh_shmember_read_InBheapQ(lib_ams::FShmember& row) { + bool result = false; + result = row.bh_shmember_read_idx != -1; + return result; +} + +// --- lib_ams.FDb.bh_shmember_read.N +// Return number of items in the heap +inline i32 lib_ams::bh_shmember_read_N() { + return _db.bh_shmember_read_n; +} + // --- lib_ams.FDb.fdin_curs.Reset // cursor points to valid item inline void lib_ams::_db_fdin_curs_Reset(_db_fdin_curs &curs, lib_ams::FDb &parent) { @@ -795,57 +887,57 @@ inline lib_ams::FWritefile& lib_ams::_db_zd_flush_curs_Access(_db_zd_flush_curs return *curs.row; } -// --- lib_ams.FDb.stream_curs.Reset +// --- lib_ams.FDb.shm_curs.Reset // cursor points to valid item -inline void lib_ams::_db_stream_curs_Reset(_db_stream_curs &curs, lib_ams::FDb &parent) { +inline void lib_ams::_db_shm_curs_Reset(_db_shm_curs &curs, lib_ams::FDb &parent) { curs.parent = &parent; curs.index = 0; } -// --- lib_ams.FDb.stream_curs.ValidQ +// --- lib_ams.FDb.shm_curs.ValidQ // cursor points to valid item -inline bool lib_ams::_db_stream_curs_ValidQ(_db_stream_curs &curs) { - return curs.index < _db.stream_n; +inline bool lib_ams::_db_shm_curs_ValidQ(_db_shm_curs &curs) { + return curs.index < _db.shm_n; } -// --- lib_ams.FDb.stream_curs.Next +// --- lib_ams.FDb.shm_curs.Next // proceed to next item -inline void lib_ams::_db_stream_curs_Next(_db_stream_curs &curs) { +inline void lib_ams::_db_shm_curs_Next(_db_shm_curs &curs) { curs.index++; } -// --- lib_ams.FDb.stream_curs.Access +// --- lib_ams.FDb.shm_curs.Access // item access -inline lib_ams::FStream& lib_ams::_db_stream_curs_Access(_db_stream_curs &curs) { - return stream_qFind(u64(curs.index)); +inline lib_ams::FShm& lib_ams::_db_shm_curs_Access(_db_shm_curs &curs) { + return shm_qFind(u64(curs.index)); } -// --- lib_ams.FDb.cd_stream_hb_curs.Reset +// --- lib_ams.FDb.cd_hb_curs.Reset // cursor points to valid item -inline void lib_ams::_db_cd_stream_hb_curs_Reset(_db_cd_stream_hb_curs &curs, lib_ams::FDb &parent) { - curs.row = parent.cd_stream_hb_head; - curs.head = &parent.cd_stream_hb_head; +inline void lib_ams::_db_cd_hb_curs_Reset(_db_cd_hb_curs &curs, lib_ams::FDb &parent) { + curs.row = parent.cd_hb_head; + curs.head = &parent.cd_hb_head; } -// --- lib_ams.FDb.cd_stream_hb_curs.ValidQ +// --- lib_ams.FDb.cd_hb_curs.ValidQ // cursor points to valid item -inline bool lib_ams::_db_cd_stream_hb_curs_ValidQ(_db_cd_stream_hb_curs &curs) { +inline bool lib_ams::_db_cd_hb_curs_ValidQ(_db_cd_hb_curs &curs) { return curs.row != NULL; } -// --- lib_ams.FDb.cd_stream_hb_curs.Next +// --- lib_ams.FDb.cd_hb_curs.Next // proceed to next item -inline void lib_ams::_db_cd_stream_hb_curs_Next(_db_cd_stream_hb_curs &curs) { - lib_ams::FStream *next = (*curs.row).cd_stream_hb_next; +inline void lib_ams::_db_cd_hb_curs_Next(_db_cd_hb_curs &curs) { + lib_ams::FShmember *next = (*curs.row).cd_hb_next; curs.row = next; if (curs.row == *curs.head) { curs.row = NULL; } } -// --- lib_ams.FDb.cd_stream_hb_curs.Access +// --- lib_ams.FDb.cd_hb_curs.Access // item access -inline lib_ams::FStream& lib_ams::_db_cd_stream_hb_curs_Access(_db_cd_stream_hb_curs &curs) { +inline lib_ams::FShmember& lib_ams::_db_cd_hb_curs_Access(_db_cd_hb_curs &curs) { return *curs.row; } @@ -865,7 +957,7 @@ inline bool lib_ams::_db_cd_poll_read_curs_ValidQ(_db_cd_poll_read_curs &curs) { // --- lib_ams.FDb.cd_poll_read_curs.Next // proceed to next item inline void lib_ams::_db_cd_poll_read_curs_Next(_db_cd_poll_read_curs &curs) { - lib_ams::FStream *next = (*curs.row).cd_poll_read_next; + lib_ams::FShmember *next = (*curs.row).cd_poll_read_next; curs.row = next; if (curs.row == *curs.head) { curs.row = NULL; @@ -874,58 +966,110 @@ inline void lib_ams::_db_cd_poll_read_curs_Next(_db_cd_poll_read_curs &curs) { // --- lib_ams.FDb.cd_poll_read_curs.Access // item access -inline lib_ams::FStream& lib_ams::_db_cd_poll_read_curs_Access(_db_cd_poll_read_curs &curs) { +inline lib_ams::FShmember& lib_ams::_db_cd_poll_read_curs_Access(_db_cd_poll_read_curs &curs) { return *curs.row; } -// --- lib_ams.FDb.streamtype_curs.Reset +// --- lib_ams.FDb.cd_slow_poll_read_curs.Reset +// cursor points to valid item +inline void lib_ams::_db_cd_slow_poll_read_curs_Reset(_db_cd_slow_poll_read_curs &curs, lib_ams::FDb &parent) { + curs.row = parent.cd_slow_poll_read_head; + curs.head = &parent.cd_slow_poll_read_head; +} + +// --- lib_ams.FDb.cd_slow_poll_read_curs.ValidQ // cursor points to valid item -inline void lib_ams::_db_streamtype_curs_Reset(_db_streamtype_curs &curs, lib_ams::FDb &parent) { +inline bool lib_ams::_db_cd_slow_poll_read_curs_ValidQ(_db_cd_slow_poll_read_curs &curs) { + return curs.row != NULL; +} + +// --- lib_ams.FDb.cd_slow_poll_read_curs.Next +// proceed to next item +inline void lib_ams::_db_cd_slow_poll_read_curs_Next(_db_cd_slow_poll_read_curs &curs) { + lib_ams::FShmember *next = (*curs.row).cd_slow_poll_read_next; + curs.row = next; + if (curs.row == *curs.head) { + curs.row = NULL; + } +} + +// --- lib_ams.FDb.cd_slow_poll_read_curs.Access +// item access +inline lib_ams::FShmember& lib_ams::_db_cd_slow_poll_read_curs_Access(_db_cd_slow_poll_read_curs &curs) { + return *curs.row; +} + +// --- lib_ams.FDb.ind_shmember_curs.ValidQ +// cursor points to valid item +inline bool lib_ams::_db_ind_shmember_curs_ValidQ(_db_ind_shmember_curs &curs) { + return *curs.prow != NULL; +} + +// --- lib_ams.FDb.ind_shmember_curs.Next +// proceed to next item +inline void lib_ams::_db_ind_shmember_curs_Next(_db_ind_shmember_curs &curs) { + curs.prow = &(*curs.prow)->ind_shmember_next; + while (!*curs.prow) { + curs.bucket += 1; + if (curs.bucket >= curs.parent->ind_shmember_buckets_n) break; + curs.prow = &curs.parent->ind_shmember_buckets_elems[curs.bucket]; + } +} + +// --- lib_ams.FDb.ind_shmember_curs.Access +// item access +inline lib_ams::FShmember& lib_ams::_db_ind_shmember_curs_Access(_db_ind_shmember_curs &curs) { + return **curs.prow; +} + +// --- lib_ams.FDb.shmtype_curs.Reset +// cursor points to valid item +inline void lib_ams::_db_shmtype_curs_Reset(_db_shmtype_curs &curs, lib_ams::FDb &parent) { curs.parent = &parent; curs.index = 0; } -// --- lib_ams.FDb.streamtype_curs.ValidQ +// --- lib_ams.FDb.shmtype_curs.ValidQ // cursor points to valid item -inline bool lib_ams::_db_streamtype_curs_ValidQ(_db_streamtype_curs &curs) { - return curs.index < _db.streamtype_n; +inline bool lib_ams::_db_shmtype_curs_ValidQ(_db_shmtype_curs &curs) { + return curs.index < _db.shmtype_n; } -// --- lib_ams.FDb.streamtype_curs.Next +// --- lib_ams.FDb.shmtype_curs.Next // proceed to next item -inline void lib_ams::_db_streamtype_curs_Next(_db_streamtype_curs &curs) { +inline void lib_ams::_db_shmtype_curs_Next(_db_shmtype_curs &curs) { curs.index++; } -// --- lib_ams.FDb.streamtype_curs.Access +// --- lib_ams.FDb.shmtype_curs.Access // item access -inline lib_ams::FStreamType& lib_ams::_db_streamtype_curs_Access(_db_streamtype_curs &curs) { - return streamtype_qFind(u64(curs.index)); +inline lib_ams::FShmtype& lib_ams::_db_shmtype_curs_Access(_db_shmtype_curs &curs) { + return shmtype_qFind(u64(curs.index)); } -// --- lib_ams.FDb.zd_ctlin_curs.Reset -// cursor points to valid item -inline void lib_ams::_db_zd_ctlin_curs_Reset(_db_zd_ctlin_curs &curs, lib_ams::FDb &parent) { - curs.row = parent.zd_ctlin_head; +// --- lib_ams.FDb.c_ctlin_curs.Reset +inline void lib_ams::_db_c_ctlin_curs_Reset(_db_c_ctlin_curs &curs, lib_ams::FDb &parent) { + curs.elems = parent.c_ctlin_elems; + curs.n_elems = parent.c_ctlin_n; + curs.index = 0; } -// --- lib_ams.FDb.zd_ctlin_curs.ValidQ +// --- lib_ams.FDb.c_ctlin_curs.ValidQ // cursor points to valid item -inline bool lib_ams::_db_zd_ctlin_curs_ValidQ(_db_zd_ctlin_curs &curs) { - return curs.row != NULL; +inline bool lib_ams::_db_c_ctlin_curs_ValidQ(_db_c_ctlin_curs &curs) { + return curs.index < curs.n_elems; } -// --- lib_ams.FDb.zd_ctlin_curs.Next +// --- lib_ams.FDb.c_ctlin_curs.Next // proceed to next item -inline void lib_ams::_db_zd_ctlin_curs_Next(_db_zd_ctlin_curs &curs) { - lib_ams::FStream *next = (*curs.row).zd_ctlin_next; - curs.row = next; +inline void lib_ams::_db_c_ctlin_curs_Next(_db_c_ctlin_curs &curs) { + curs.index++; } -// --- lib_ams.FDb.zd_ctlin_curs.Access +// --- lib_ams.FDb.c_ctlin_curs.Access // item access -inline lib_ams::FStream& lib_ams::_db_zd_ctlin_curs_Access(_db_zd_ctlin_curs &curs) { - return *curs.row; +inline lib_ams::FShmember& lib_ams::_db_c_ctlin_curs_Access(_db_c_ctlin_curs &curs) { + return *curs.elems[curs.index]; } // --- lib_ams.FDb.zd_proc_curs.Reset @@ -953,11 +1097,22 @@ inline lib_ams::FProc& lib_ams::_db_zd_proc_curs_Access(_db_zd_proc_curs &curs) return *curs.row; } +// --- lib_ams.FDb.bh_shmember_read_curs.Access +// Access current element. If not more elements, return NULL +inline lib_ams::FShmember& lib_ams::_db_bh_shmember_read_curs_Access(_db_bh_shmember_read_curs &curs) { + return *curs.temp_elems[0]; +} + +// --- lib_ams.FDb.bh_shmember_read_curs.ValidQ +// Return true if Access() will return non-NULL. +inline bool lib_ams::_db_bh_shmember_read_curs_ValidQ(_db_bh_shmember_read_curs &curs) { + return curs.temp_n > 0; +} + // --- lib_ams.FFdin.in.Max // Return max. number of bytes in the buffer. inline i32 lib_ams::in_Max(lib_ams::FFdin& fdin) { - return 8192; - (void)fdin;//only to avoid -Wunused-parameter + return fdin.in_max; } // --- lib_ams.FFdin.in.N @@ -978,126 +1133,216 @@ inline lib_ams::FFdin::~FFdin() { lib_ams::FFdin_Uninit(*this); } -// --- lib_ams.FMember..Init -// Set all fields to initial values. -inline void lib_ams::FMember_Init(lib_ams::FMember& member) { - member.budget = u32(0); - member.p_stream = NULL; - member.p_proc = NULL; - member.member_next = (lib_ams::FMember*)-1; // (lib_ams.FDb.member) not-in-tpool's freelist - member.ind_member_next = (lib_ams::FMember*)-1; // (lib_ams.FDb.ind_member) not-in-hash - member.zd_member_byproc_next = (lib_ams::FMember*)-1; // (lib_ams.FProc.zd_member_byproc) not-in-list - member.zd_member_byproc_prev = NULL; // (lib_ams.FProc.zd_member_byproc) - member.zd_member_bystream_next = (lib_ams::FMember*)-1; // (lib_ams.FStream.zd_member_bystream) not-in-list - member.zd_member_bystream_prev = NULL; // (lib_ams.FStream.zd_member_bystream) +// --- lib_ams.FProc.c_shm.EmptyQ +// Return true if index is empty +inline bool lib_ams::c_shm_EmptyQ(lib_ams::FProc& proc) { + return proc.c_shm_n == 0; } -// --- lib_ams.FMember..Ctor -inline lib_ams::FMember::FMember() { - lib_ams::FMember_Init(*this); +// --- lib_ams.FProc.c_shm.Find +// Look up row by row id. Return NULL if out of range +inline lib_ams::FShm* lib_ams::c_shm_Find(lib_ams::FProc& proc, u32 t) { + lib_ams::FShm *retval = NULL; + u64 idx = t; + u64 lim = proc.c_shm_n; + if (idx < lim) { + retval = proc.c_shm_elems[idx]; + } + return retval; } -// --- lib_ams.FMember..Dtor -inline lib_ams::FMember::~FMember() { - lib_ams::FMember_Uninit(*this); +// --- lib_ams.FProc.c_shm.Getary +// Return array of pointers +inline algo::aryptr lib_ams::c_shm_Getary(lib_ams::FProc& proc) { + return algo::aryptr(proc.c_shm_elems, proc.c_shm_n); } -// --- lib_ams.FProc.zd_member_byproc.EmptyQ -// Return true if index is empty -inline bool lib_ams::zd_member_byproc_EmptyQ(lib_ams::FProc& proc) { - return proc.zd_member_byproc_head == NULL; +// --- lib_ams.FProc.c_shm.First +inline lib_ams::FShm* lib_ams::c_shm_First(lib_ams::FProc& proc) { + lib_ams::FShm *row = NULL; + row = proc.c_shm_n ? proc.c_shm_elems[0] : NULL; + return row; } -// --- lib_ams.FProc.zd_member_byproc.First -// If index empty, return NULL. Otherwise return pointer to first element in index -inline lib_ams::FMember* lib_ams::zd_member_byproc_First(lib_ams::FProc& proc) { - lib_ams::FMember *row = NULL; - row = proc.zd_member_byproc_head; +// --- lib_ams.FProc.c_shm.Last +inline lib_ams::FShm* lib_ams::c_shm_Last(lib_ams::FProc& proc) { + lib_ams::FShm *row = NULL; + row = proc.c_shm_n ? proc.c_shm_elems[proc.c_shm_n-1] : NULL; return row; } -// --- lib_ams.FProc.zd_member_byproc.InLlistQ -// Return true if row is in the linked list, false otherwise -inline bool lib_ams::zd_member_byproc_InLlistQ(lib_ams::FMember& row) { - bool result = false; - result = !(row.zd_member_byproc_next == (lib_ams::FMember*)-1); - return result; +// --- lib_ams.FProc.c_shm.N +// Return number of items in the pointer array +inline i32 lib_ams::c_shm_N(const lib_ams::FProc& proc) { + return proc.c_shm_n; } -// --- lib_ams.FProc.zd_member_byproc.Last -// If index empty, return NULL. Otherwise return pointer to last element in index -inline lib_ams::FMember* lib_ams::zd_member_byproc_Last(lib_ams::FProc& proc) { - lib_ams::FMember *row = NULL; - row = proc.zd_member_byproc_tail; +// --- lib_ams.FProc.c_shm.RemoveAll +// Empty the index. (The rows are not deleted) +inline void lib_ams::c_shm_RemoveAll(lib_ams::FProc& proc) { + for (u32 i = 0; i < proc.c_shm_n; i++) { + proc.c_shm_elems[i]->proc_c_shm_idx = -1; + } + proc.c_shm_n = 0; +} + +// --- lib_ams.FProc.c_shm.qFind +// Return reference without bounds checking +inline lib_ams::FShm& lib_ams::c_shm_qFind(lib_ams::FProc& proc, u32 idx) { + return *proc.c_shm_elems[idx]; +} + +// --- lib_ams.FProc.c_shm.InAryQ +// True if row is in any ptrary instance +inline bool lib_ams::proc_c_shm_InAryQ(lib_ams::FShm& row) { + return row.proc_c_shm_idx != -1; +} + +// --- lib_ams.FProc.c_shm.qLast +// Reference to last element without bounds checking +inline lib_ams::FShm& lib_ams::c_shm_qLast(lib_ams::FProc& proc) { + return *proc.c_shm_elems[proc.c_shm_n-1]; +} + +// --- lib_ams.FProc.c_shmember.EmptyQ +// Return true if index is empty +inline bool lib_ams::c_shmember_EmptyQ(lib_ams::FProc& proc) { + return proc.c_shmember_n == 0; +} + +// --- lib_ams.FProc.c_shmember.Find +// Look up row by row id. Return NULL if out of range +inline lib_ams::FShmember* lib_ams::c_shmember_Find(lib_ams::FProc& proc, u32 t) { + lib_ams::FShmember *retval = NULL; + u64 idx = t; + u64 lim = proc.c_shmember_n; + if (idx < lim) { + retval = proc.c_shmember_elems[idx]; + } + return retval; +} + +// --- lib_ams.FProc.c_shmember.Getary +// Return array of pointers +inline algo::aryptr lib_ams::c_shmember_Getary(lib_ams::FProc& proc) { + return algo::aryptr(proc.c_shmember_elems, proc.c_shmember_n); +} + +// --- lib_ams.FProc.c_shmember.First +inline lib_ams::FShmember* lib_ams::c_shmember_First(lib_ams::FProc& proc) { + lib_ams::FShmember *row = NULL; + row = proc.c_shmember_n ? proc.c_shmember_elems[0] : NULL; return row; } -// --- lib_ams.FProc.zd_member_byproc.N -// Return number of items in the linked list -inline i32 lib_ams::zd_member_byproc_N(const lib_ams::FProc& proc) { - return proc.zd_member_byproc_n; +// --- lib_ams.FProc.c_shmember.Last +inline lib_ams::FShmember* lib_ams::c_shmember_Last(lib_ams::FProc& proc) { + lib_ams::FShmember *row = NULL; + row = proc.c_shmember_n ? proc.c_shmember_elems[proc.c_shmember_n-1] : NULL; + return row; } -// --- lib_ams.FProc.zd_member_byproc.Next -// Return pointer to next element in the list -inline lib_ams::FMember* lib_ams::zd_member_byproc_Next(lib_ams::FMember &row) { - return row.zd_member_byproc_next; +// --- lib_ams.FProc.c_shmember.N +// Return number of items in the pointer array +inline i32 lib_ams::c_shmember_N(const lib_ams::FProc& proc) { + return proc.c_shmember_n; } -// --- lib_ams.FProc.zd_member_byproc.Prev -// Return pointer to previous element in the list -inline lib_ams::FMember* lib_ams::zd_member_byproc_Prev(lib_ams::FMember &row) { - return row.zd_member_byproc_prev; +// --- lib_ams.FProc.c_shmember.RemoveAll +// Empty the index. (The rows are not deleted) +inline void lib_ams::c_shmember_RemoveAll(lib_ams::FProc& proc) { + for (u32 i = 0; i < proc.c_shmember_n; i++) { + proc.c_shmember_elems[i]->proc_c_shmember_idx = -1; + } + proc.c_shmember_n = 0; } -// --- lib_ams.FProc.zd_member_byproc.qLast -// Return reference to last element in the index. No bounds checking. -inline lib_ams::FMember& lib_ams::zd_member_byproc_qLast(lib_ams::FProc& proc) { - lib_ams::FMember *row = NULL; - row = proc.zd_member_byproc_tail; - return *row; +// --- lib_ams.FProc.c_shmember.qFind +// Return reference without bounds checking +inline lib_ams::FShmember& lib_ams::c_shmember_qFind(lib_ams::FProc& proc, u32 idx) { + return *proc.c_shmember_elems[idx]; +} + +// --- lib_ams.FProc.c_shmember.InAryQ +// True if row is in any ptrary instance +inline bool lib_ams::proc_c_shmember_InAryQ(lib_ams::FShmember& row) { + return row.proc_c_shmember_idx != -1; +} + +// --- lib_ams.FProc.c_shmember.qLast +// Reference to last element without bounds checking +inline lib_ams::FShmember& lib_ams::c_shmember_qLast(lib_ams::FProc& proc) { + return *proc.c_shmember_elems[proc.c_shmember_n-1]; } // --- lib_ams.FProc..Init // Set all fields to initial values. inline void lib_ams::FProc_Init(lib_ams::FProc& proc) { - proc.zd_member_byproc_head = NULL; // (lib_ams.FProc.zd_member_byproc) - proc.zd_member_byproc_n = 0; // (lib_ams.FProc.zd_member_byproc) - proc.zd_member_byproc_tail = NULL; // (lib_ams.FProc.zd_member_byproc) + proc.c_shm_elems = NULL; // (lib_ams.FProc.c_shm) + proc.c_shm_n = 0; // (lib_ams.FProc.c_shm) + proc.c_shm_max = 0; // (lib_ams.FProc.c_shm) + proc.c_shmember_elems = NULL; // (lib_ams.FProc.c_shmember) + proc.c_shmember_n = 0; // (lib_ams.FProc.c_shmember) + proc.c_shmember_max = 0; // (lib_ams.FProc.c_shmember) proc.pid = i32(0); proc.status = i32(0); proc.hbtimeout = u32(0); proc.critical = bool(false); - proc.realtime = bool(false); proc.proc_next = (lib_ams::FProc*)-1; // (lib_ams.FDb.proc) not-in-tpool's freelist proc.ind_proc_next = (lib_ams::FProc*)-1; // (lib_ams.FDb.ind_proc) not-in-hash + proc.ind_proc_hashval = 0; // stored hash value proc.zd_proc_next = (lib_ams::FProc*)-1; // (lib_ams.FDb.zd_proc) not-in-list proc.zd_proc_prev = NULL; // (lib_ams.FDb.zd_proc) } -// --- lib_ams.FProc.zd_member_byproc_curs.Reset +// --- lib_ams.FProc.c_shm_curs.Reset +inline void lib_ams::proc_c_shm_curs_Reset(proc_c_shm_curs &curs, lib_ams::FProc &parent) { + curs.elems = parent.c_shm_elems; + curs.n_elems = parent.c_shm_n; + curs.index = 0; +} + +// --- lib_ams.FProc.c_shm_curs.ValidQ // cursor points to valid item -inline void lib_ams::proc_zd_member_byproc_curs_Reset(proc_zd_member_byproc_curs &curs, lib_ams::FProc &parent) { - curs.row = parent.zd_member_byproc_head; +inline bool lib_ams::proc_c_shm_curs_ValidQ(proc_c_shm_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- lib_ams.FProc.c_shm_curs.Next +// proceed to next item +inline void lib_ams::proc_c_shm_curs_Next(proc_c_shm_curs &curs) { + curs.index++; +} + +// --- lib_ams.FProc.c_shm_curs.Access +// item access +inline lib_ams::FShm& lib_ams::proc_c_shm_curs_Access(proc_c_shm_curs &curs) { + return *curs.elems[curs.index]; } -// --- lib_ams.FProc.zd_member_byproc_curs.ValidQ +// --- lib_ams.FProc.c_shmember_curs.Reset +inline void lib_ams::proc_c_shmember_curs_Reset(proc_c_shmember_curs &curs, lib_ams::FProc &parent) { + curs.elems = parent.c_shmember_elems; + curs.n_elems = parent.c_shmember_n; + curs.index = 0; +} + +// --- lib_ams.FProc.c_shmember_curs.ValidQ // cursor points to valid item -inline bool lib_ams::proc_zd_member_byproc_curs_ValidQ(proc_zd_member_byproc_curs &curs) { - return curs.row != NULL; +inline bool lib_ams::proc_c_shmember_curs_ValidQ(proc_c_shmember_curs &curs) { + return curs.index < curs.n_elems; } -// --- lib_ams.FProc.zd_member_byproc_curs.Next +// --- lib_ams.FProc.c_shmember_curs.Next // proceed to next item -inline void lib_ams::proc_zd_member_byproc_curs_Next(proc_zd_member_byproc_curs &curs) { - lib_ams::FMember *next = (*curs.row).zd_member_byproc_next; - curs.row = next; +inline void lib_ams::proc_c_shmember_curs_Next(proc_c_shmember_curs &curs) { + curs.index++; } -// --- lib_ams.FProc.zd_member_byproc_curs.Access +// --- lib_ams.FProc.c_shmember_curs.Access // item access -inline lib_ams::FMember& lib_ams::proc_zd_member_byproc_curs_Access(proc_zd_member_byproc_curs &curs) { - return *curs.row; +inline lib_ams::FShmember& lib_ams::proc_c_shmember_curs_Access(proc_c_shmember_curs &curs) { + return *curs.elems[curs.index]; } // --- lib_ams.FProc..Ctor @@ -1430,169 +1675,196 @@ inline lib_ams::FReadfile::~FReadfile() { lib_ams::FReadfile_Uninit(*this); } -// --- lib_ams.FStream.h_msg.Call -// Invoke function by pointer -inline void lib_ams::h_msg_Call(lib_ams::FStream& stream, ams::MsgHeader& arg) { - if (stream.h_msg) { - stream.h_msg((void*)stream.h_msg_ctx, arg); +// --- lib_ams.FShm.c_shmember.EmptyQ +// Return true if index is empty +inline bool lib_ams::c_shmember_EmptyQ(lib_ams::FShm& shm) { + return shm.c_shmember_n == 0; +} + +// --- lib_ams.FShm.c_shmember.Find +// Look up row by row id. Return NULL if out of range +inline lib_ams::FShmember* lib_ams::c_shmember_Find(lib_ams::FShm& shm, u32 t) { + lib_ams::FShmember *retval = NULL; + u64 idx = t; + u64 lim = shm.c_shmember_n; + if (idx < lim) { + retval = shm.c_shmember_elems[idx]; } + return retval; } -// --- lib_ams.FStream.h_msg.Set0 -// Assign 0-argument hook with no context pointer -inline void lib_ams::h_msg_Set0(lib_ams::FStream& stream, void (*fcn)() ) { - stream.h_msg_ctx = 0; - stream.h_msg = (lib_ams::stream_h_msg_hook)fcn; +// --- lib_ams.FShm.c_shmember.Getary +// Return array of pointers +inline algo::aryptr lib_ams::c_shmember_Getary(lib_ams::FShm& shm) { + return algo::aryptr(shm.c_shmember_elems, shm.c_shmember_n); } -// --- lib_ams.FStream.h_msg.Set1 -// Assign 1-argument hook with context pointer -template inline void lib_ams::h_msg_Set1(lib_ams::FStream& stream, T& ctx, void (*fcn)(T&) ) { - stream.h_msg_ctx = (u64)&ctx; - stream.h_msg = (lib_ams::stream_h_msg_hook)fcn; +// --- lib_ams.FShm.c_shmember.First +inline lib_ams::FShmember* lib_ams::c_shmember_First(lib_ams::FShm& shm) { + lib_ams::FShmember *row = NULL; + row = shm.c_shmember_n ? shm.c_shmember_elems[0] : NULL; + return row; } -// --- lib_ams.FStream.h_msg.Set2 -// Assign 2-argument hook with context pointer -template inline void lib_ams::h_msg_Set2(lib_ams::FStream& stream, T& ctx, void (*fcn)(T&, ams::MsgHeader& arg) ) { - stream.h_msg_ctx = (u64)&ctx; - stream.h_msg = (lib_ams::stream_h_msg_hook)fcn; +// --- lib_ams.FShm.c_shmember.Last +inline lib_ams::FShmember* lib_ams::c_shmember_Last(lib_ams::FShm& shm) { + lib_ams::FShmember *row = NULL; + row = shm.c_shmember_n ? shm.c_shmember_elems[shm.c_shmember_n-1] : NULL; + return row; } -// --- lib_ams.FStream.h_msg_orig.Call -// Invoke function by pointer -inline void lib_ams::h_msg_orig_Call(lib_ams::FStream& stream, ams::MsgHeader& arg) { - if (stream.h_msg_orig) { - stream.h_msg_orig((void*)stream.h_msg_orig_ctx, arg); +// --- lib_ams.FShm.c_shmember.N +// Return number of items in the pointer array +inline i32 lib_ams::c_shmember_N(const lib_ams::FShm& shm) { + return shm.c_shmember_n; +} + +// --- lib_ams.FShm.c_shmember.RemoveAll +// Empty the index. (The rows are not deleted) +inline void lib_ams::c_shmember_RemoveAll(lib_ams::FShm& shm) { + for (u32 i = 0; i < shm.c_shmember_n; i++) { + shm.c_shmember_elems[i]->shm_c_shmember_idx = -1; } + shm.c_shmember_n = 0; } -// --- lib_ams.FStream.h_msg_orig.Set0 -// Assign 0-argument hook with no context pointer -inline void lib_ams::h_msg_orig_Set0(lib_ams::FStream& stream, void (*fcn)() ) { - stream.h_msg_orig_ctx = 0; - stream.h_msg_orig = (lib_ams::stream_h_msg_orig_hook)fcn; +// --- lib_ams.FShm.c_shmember.qFind +// Return reference without bounds checking +inline lib_ams::FShmember& lib_ams::c_shmember_qFind(lib_ams::FShm& shm, u32 idx) { + return *shm.c_shmember_elems[idx]; } -// --- lib_ams.FStream.h_msg_orig.Set1 -// Assign 1-argument hook with context pointer -template inline void lib_ams::h_msg_orig_Set1(lib_ams::FStream& stream, T& ctx, void (*fcn)(T&) ) { - stream.h_msg_orig_ctx = (u64)&ctx; - stream.h_msg_orig = (lib_ams::stream_h_msg_orig_hook)fcn; +// --- lib_ams.FShm.c_shmember.InAryQ +// True if row is in any ptrary instance +inline bool lib_ams::shm_c_shmember_InAryQ(lib_ams::FShmember& row) { + return row.shm_c_shmember_idx != -1; } -// --- lib_ams.FStream.h_msg_orig.Set2 -// Assign 2-argument hook with context pointer -template inline void lib_ams::h_msg_orig_Set2(lib_ams::FStream& stream, T& ctx, void (*fcn)(T&, ams::MsgHeader& arg) ) { - stream.h_msg_orig_ctx = (u64)&ctx; - stream.h_msg_orig = (lib_ams::stream_h_msg_orig_hook)fcn; +// --- lib_ams.FShm.c_shmember.qLast +// Reference to last element without bounds checking +inline lib_ams::FShmember& lib_ams::c_shmember_qLast(lib_ams::FShm& shm) { + return *shm.c_shmember_elems[shm.c_shmember_n-1]; } -// --- lib_ams.FStream.zd_member_bystream.EmptyQ -// Return true if index is empty -inline bool lib_ams::zd_member_bystream_EmptyQ(lib_ams::FStream& stream) { - return stream.zd_member_bystream_head == NULL; +// --- lib_ams.FShm.h_amsmsg.Call +// Invoke function by pointer +inline void lib_ams::h_amsmsg_Call(lib_ams::FShm& shm, ams::MsgHeader& arg) { + if (shm.h_amsmsg) { + shm.h_amsmsg((void*)shm.h_amsmsg_ctx, arg); + } } -// --- lib_ams.FStream.zd_member_bystream.First -// If index empty, return NULL. Otherwise return pointer to first element in index -inline lib_ams::FMember* lib_ams::zd_member_bystream_First(lib_ams::FStream& stream) { - lib_ams::FMember *row = NULL; - row = stream.zd_member_bystream_head; - return row; +// --- lib_ams.FShm.h_amsmsg.Set0 +// Assign 0-argument hook with no context pointer +inline void lib_ams::h_amsmsg_Set0(lib_ams::FShm& shm, void (*fcn)() ) { + shm.h_amsmsg_ctx = 0; + shm.h_amsmsg = (lib_ams::shm_h_amsmsg_hook)fcn; } -// --- lib_ams.FStream.zd_member_bystream.InLlistQ -// Return true if row is in the linked list, false otherwise -inline bool lib_ams::zd_member_bystream_InLlistQ(lib_ams::FMember& row) { - bool result = false; - result = !(row.zd_member_bystream_next == (lib_ams::FMember*)-1); - return result; +// --- lib_ams.FShm.h_amsmsg.Set1 +// Assign 1-argument hook with context pointer +template inline void lib_ams::h_amsmsg_Set1(lib_ams::FShm& shm, T& ctx, void (*fcn)(T&) ) { + shm.h_amsmsg_ctx = (u64)&ctx; + shm.h_amsmsg = (lib_ams::shm_h_amsmsg_hook)fcn; } -// --- lib_ams.FStream.zd_member_bystream.Last -// If index empty, return NULL. Otherwise return pointer to last element in index -inline lib_ams::FMember* lib_ams::zd_member_bystream_Last(lib_ams::FStream& stream) { - lib_ams::FMember *row = NULL; - row = stream.zd_member_bystream_tail; - return row; +// --- lib_ams.FShm.h_amsmsg.Set2 +// Assign 2-argument hook with context pointer +template inline void lib_ams::h_amsmsg_Set2(lib_ams::FShm& shm, T& ctx, void (*fcn)(T&, ams::MsgHeader& arg) ) { + shm.h_amsmsg_ctx = (u64)&ctx; + shm.h_amsmsg = (lib_ams::shm_h_amsmsg_hook)fcn; } -// --- lib_ams.FStream.zd_member_bystream.N -// Return number of items in the linked list -inline i32 lib_ams::zd_member_bystream_N(const lib_ams::FStream& stream) { - return stream.zd_member_bystream_n; +// --- lib_ams.FShm.h_msg_orig.Call +// Invoke function by pointer +inline void lib_ams::h_msg_orig_Call(lib_ams::FShm& shm, ams::MsgHeader& arg) { + if (shm.h_msg_orig) { + shm.h_msg_orig((void*)shm.h_msg_orig_ctx, arg); + } } -// --- lib_ams.FStream.zd_member_bystream.Next -// Return pointer to next element in the list -inline lib_ams::FMember* lib_ams::zd_member_bystream_Next(lib_ams::FMember &row) { - return row.zd_member_bystream_next; +// --- lib_ams.FShm.h_msg_orig.Set0 +// Assign 0-argument hook with no context pointer +inline void lib_ams::h_msg_orig_Set0(lib_ams::FShm& shm, void (*fcn)() ) { + shm.h_msg_orig_ctx = 0; + shm.h_msg_orig = (lib_ams::shm_h_msg_orig_hook)fcn; } -// --- lib_ams.FStream.zd_member_bystream.Prev -// Return pointer to previous element in the list -inline lib_ams::FMember* lib_ams::zd_member_bystream_Prev(lib_ams::FMember &row) { - return row.zd_member_bystream_prev; +// --- lib_ams.FShm.h_msg_orig.Set1 +// Assign 1-argument hook with context pointer +template inline void lib_ams::h_msg_orig_Set1(lib_ams::FShm& shm, T& ctx, void (*fcn)(T&) ) { + shm.h_msg_orig_ctx = (u64)&ctx; + shm.h_msg_orig = (lib_ams::shm_h_msg_orig_hook)fcn; } -// --- lib_ams.FStream.zd_member_bystream.qLast -// Return reference to last element in the index. No bounds checking. -inline lib_ams::FMember& lib_ams::zd_member_bystream_qLast(lib_ams::FStream& stream) { - lib_ams::FMember *row = NULL; - row = stream.zd_member_bystream_tail; - return *row; +// --- lib_ams.FShm.h_msg_orig.Set2 +// Assign 2-argument hook with context pointer +template inline void lib_ams::h_msg_orig_Set2(lib_ams::FShm& shm, T& ctx, void (*fcn)(T&, ams::MsgHeader& arg) ) { + shm.h_msg_orig_ctx = (u64)&ctx; + shm.h_msg_orig = (lib_ams::shm_h_msg_orig_hook)fcn; } -// --- lib_ams.FStream.zd_member_bystream_curs.Reset -// cursor points to valid item -inline void lib_ams::stream_zd_member_bystream_curs_Reset(stream_zd_member_bystream_curs &curs, lib_ams::FStream &parent) { - curs.row = parent.zd_member_bystream_head; +// --- lib_ams.FShm.c_shmember_curs.Reset +inline void lib_ams::shm_c_shmember_curs_Reset(shm_c_shmember_curs &curs, lib_ams::FShm &parent) { + curs.elems = parent.c_shmember_elems; + curs.n_elems = parent.c_shmember_n; + curs.index = 0; } -// --- lib_ams.FStream.zd_member_bystream_curs.ValidQ +// --- lib_ams.FShm.c_shmember_curs.ValidQ // cursor points to valid item -inline bool lib_ams::stream_zd_member_bystream_curs_ValidQ(stream_zd_member_bystream_curs &curs) { - return curs.row != NULL; +inline bool lib_ams::shm_c_shmember_curs_ValidQ(shm_c_shmember_curs &curs) { + return curs.index < curs.n_elems; } -// --- lib_ams.FStream.zd_member_bystream_curs.Next +// --- lib_ams.FShm.c_shmember_curs.Next // proceed to next item -inline void lib_ams::stream_zd_member_bystream_curs_Next(stream_zd_member_bystream_curs &curs) { - lib_ams::FMember *next = (*curs.row).zd_member_bystream_next; - curs.row = next; +inline void lib_ams::shm_c_shmember_curs_Next(shm_c_shmember_curs &curs) { + curs.index++; } -// --- lib_ams.FStream.zd_member_bystream_curs.Access +// --- lib_ams.FShm.c_shmember_curs.Access // item access -inline lib_ams::FMember& lib_ams::stream_zd_member_bystream_curs_Access(stream_zd_member_bystream_curs &curs) { - return *curs.row; +inline lib_ams::FShmember& lib_ams::shm_c_shmember_curs_Access(shm_c_shmember_curs &curs) { + return *curs.elems[curs.index]; +} + +// --- lib_ams.FShm..Ctor +inline lib_ams::FShm::FShm() { + lib_ams::FShm_Init(*this); +} + +// --- lib_ams.FShm..Dtor +inline lib_ams::FShm::~FShm() { + lib_ams::FShm_Uninit(*this); } -// --- lib_ams.FStream..Ctor -inline lib_ams::FStream::FStream() { - lib_ams::FStream_Init(*this); +// --- lib_ams.FShmember..Ctor +inline lib_ams::FShmember::FShmember() { + lib_ams::FShmember_Init(*this); } -// --- lib_ams.FStream..Dtor -inline lib_ams::FStream::~FStream() { - lib_ams::FStream_Uninit(*this); +// --- lib_ams.FShmember..Dtor +inline lib_ams::FShmember::~FShmember() { + lib_ams::FShmember_Uninit(*this); } -// --- lib_ams.FStreamType..Init +// --- lib_ams.FShmtype..Init // Set all fields to initial values. -inline void lib_ams::FStreamType_Init(lib_ams::FStreamType& streamtype) { - streamtype.ind_streamtype_next = (lib_ams::FStreamType*)-1; // (lib_ams.FDb.ind_streamtype) not-in-hash +inline void lib_ams::FShmtype_Init(lib_ams::FShmtype& shmtype) { + shmtype.nonblock = bool(false); + shmtype.ind_shmtype_next = (lib_ams::FShmtype*)-1; // (lib_ams.FDb.ind_shmtype) not-in-hash + shmtype.ind_shmtype_hashval = 0; // stored hash value } -// --- lib_ams.FStreamType..Ctor -inline lib_ams::FStreamType::FStreamType() { - lib_ams::FStreamType_Init(*this); +// --- lib_ams.FShmtype..Ctor +inline lib_ams::FShmtype::FShmtype() { + lib_ams::FShmtype_Init(*this); } -// --- lib_ams.FStreamType..Dtor -inline lib_ams::FStreamType::~FStreamType() { - lib_ams::FStreamType_Uninit(*this); +// --- lib_ams.FShmtype..Dtor +inline lib_ams::FShmtype::~FShmtype() { + lib_ams::FShmtype_Uninit(*this); } // --- lib_ams.FWritefile.buf.EmptyQ @@ -1855,6 +2127,65 @@ inline lib_ams::FieldId::FieldId(lib_ams_FieldIdEnum arg) { this->value = i32(arg); } +// --- lib_ams.MsgFmt.format.GetEnum +// Get value of field as enum type +inline lib_ams_MsgFmt_format_Enum lib_ams::format_GetEnum(const lib_ams::MsgFmt& parent) { + return lib_ams_MsgFmt_format_Enum(parent.format); +} + +// --- lib_ams.MsgFmt.format.SetEnum +// Set value of field from enum type. +inline void lib_ams::format_SetEnum(lib_ams::MsgFmt& parent, lib_ams_MsgFmt_format_Enum rhs) { + parent.format = u8(rhs); +} + +// --- lib_ams.MsgFmt.h_convert.Call +// Invoke function by pointer +inline void lib_ams::h_convert_Call(lib_ams::MsgFmt& parent, lib_ams::MsgFmt& arg) { + if (parent.h_convert) { + parent.h_convert((void*)parent.h_convert_ctx, arg); + } +} + +// --- lib_ams.MsgFmt.h_convert.Set0 +// Assign 0-argument hook with no context pointer +inline void lib_ams::h_convert_Set0(lib_ams::MsgFmt& parent, void (*fcn)() ) { + parent.h_convert_ctx = 0; + parent.h_convert = (lib_ams::parent_h_convert_hook)fcn; +} + +// --- lib_ams.MsgFmt.h_convert.Set1 +// Assign 1-argument hook with context pointer +template inline void lib_ams::h_convert_Set1(lib_ams::MsgFmt& parent, T& ctx, void (*fcn)(T&) ) { + parent.h_convert_ctx = (u64)&ctx; + parent.h_convert = (lib_ams::parent_h_convert_hook)fcn; +} + +// --- lib_ams.MsgFmt.h_convert.Set2 +// Assign 2-argument hook with context pointer +template inline void lib_ams::h_convert_Set2(lib_ams::MsgFmt& parent, T& ctx, void (*fcn)(T&, lib_ams::MsgFmt& arg) ) { + parent.h_convert_ctx = (u64)&ctx; + parent.h_convert = (lib_ams::parent_h_convert_hook)fcn; +} + +// --- lib_ams.MsgFmt..Init +// Set all fields to initial values. +inline void lib_ams::MsgFmt_Init(lib_ams::MsgFmt& parent) { + parent.payload_lim = i32(1024000); + parent.indent = i32(0); + parent.format = u8(0); + parent.strip = i32(0); + parent.pretty = bool(true); + parent.showlen = bool(false); + parent.h_convert = NULL; + parent.h_convert_ctx = 0; +} + +// --- lib_ams.MsgFmt..Ctor +inline lib_ams::MsgFmt::MsgFmt() { + lib_ams::MsgFmt_Init(*this); +} + inline algo::cstring &algo::operator <<(algo::cstring &str, const lib_ams::trace &row) {// cfmt:lib_ams.trace.String lib_ams::trace_Print(const_cast(row), str); return str; diff --git a/include/gen/lib_ctype_gen.h b/include/gen/lib_ctype_gen.h index 54141a73..9cf944da 100644 --- a/include/gen/lib_ctype_gen.h +++ b/include/gen/lib_ctype_gen.h @@ -230,6 +230,7 @@ struct FCfmt { // lib_ctype.FCfmt algo::Comment comment; // bool ctype_c_cfmt_in_ary; // false membership flag lib_ctype::FCfmt* ind_cfmt_next; // hash next + u32 ind_cfmt_hashval; // hash value // func:lib_ctype.FCfmt..AssignOp lib_ctype::FCfmt& operator =(const lib_ctype::FCfmt &rhs) = delete; // func:lib_ctype.FCfmt..CopyCtor @@ -313,19 +314,20 @@ void FCppfunc_Uninit(lib_ctype::FCppfunc& cppfunc) __attribute__ // access: lib_ctype.FField.p_arg (Upptr) // access: lib_ctype.FSsimfile.p_ctype (Upptr) struct FCtype { // lib_ctype.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - lib_ctype::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - algo::Smallstr50 printfmt; // - lib_ctype::FCdflt* c_cdflt; // optional pointer - lib_ctype::FCfmt** c_cfmt_elems; // array of pointers - u32 c_cfmt_n; // array of pointers - u32 c_cfmt_max; // capacity of allocated array - lib_ctype::FBltin* c_bltin; // optional pointer - lib_ctype::FSqltype* c_sqltype; // optional pointer - lib_ctype::FCtype* ind_ctype_next; // hash next + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + lib_ctype::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + algo::Smallstr50 printfmt; // + lib_ctype::FCdflt* c_cdflt; // optional pointer + lib_ctype::FCfmt** c_cfmt_elems; // array of pointers + u32 c_cfmt_n; // array of pointers + u32 c_cfmt_max; // capacity of allocated array + lib_ctype::FBltin* c_bltin; // optional pointer + lib_ctype::FSqltype* c_sqltype; // optional pointer + lib_ctype::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // reftype Ptrary of lib_ctype.FCtype.c_field prohibits copy // x-reference on lib_ctype.FCtype.c_cdflt prevents copy // reftype Ptrary of lib_ctype.FCtype.c_cfmt prohibits copy @@ -614,6 +616,9 @@ void ind_fconst_key_Remove(lib_ctype::FFconst& row) __attribute_ // Reserve enough room in the hash for N more elements. Return success code. // func:lib_ctype.FDb.ind_fconst_key.Reserve void ind_fconst_key_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_ctype.FDb.ind_fconst_key.AbsReserve +void ind_fconst_key_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:lib_ctype.FDb.ind_fconst.EmptyQ @@ -636,6 +641,9 @@ void ind_fconst_Remove(lib_ctype::FFconst& row) __attribute__((n // Reserve enough room in the hash for N more elements. Return success code. // func:lib_ctype.FDb.ind_fconst.Reserve void ind_fconst_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_ctype.FDb.ind_fconst.AbsReserve +void ind_fconst_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -695,6 +703,9 @@ void ind_ssimfile_Remove(lib_ctype::FSsimfile& row) __attribute_ // Reserve enough room in the hash for N more elements. Return success code. // func:lib_ctype.FDb.ind_ssimfile.Reserve void ind_ssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_ctype.FDb.ind_ssimfile.AbsReserve +void ind_ssimfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -794,6 +805,9 @@ void ind_ctype_Remove(lib_ctype::FCtype& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:lib_ctype.FDb.ind_ctype.Reserve void ind_ctype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_ctype.FDb.ind_ctype.AbsReserve +void ind_ctype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -853,6 +867,9 @@ void ind_field_Remove(lib_ctype::FField& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:lib_ctype.FDb.ind_field.Reserve void ind_field_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_ctype.FDb.ind_field.AbsReserve +void ind_field_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -978,6 +995,9 @@ void ind_cfmt_Remove(lib_ctype::FCfmt& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:lib_ctype.FDb.ind_cfmt.Reserve void ind_cfmt_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_ctype.FDb.ind_cfmt.AbsReserve +void ind_cfmt_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1336,14 +1356,16 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: ind_fconst (Thash, hash field fconst) // access: lib_ctype.FField.zd_fconst (Llist) struct FFconst { // lib_ctype.FFconst - lib_ctype::FFconst* ind_fconst_key_next; // hash next - lib_ctype::FFconst* ind_fconst_next; // hash next - algo::Smallstr100 fconst; // - algo::CppExpr value; // - algo::Comment comment; // - algo::cstring key; // - lib_ctype::FFconst* zd_fconst_next; // zslist link; -1 means not-in-list - lib_ctype::FFconst* zd_fconst_prev; // previous element + lib_ctype::FFconst* ind_fconst_key_next; // hash next + u32 ind_fconst_key_hashval; // hash value + lib_ctype::FFconst* ind_fconst_next; // hash next + u32 ind_fconst_hashval; // hash value + algo::Smallstr100 fconst; // + algo::CppExpr value; // + algo::Comment comment; // + algo::cstring key; // + lib_ctype::FFconst* field_zd_fconst_next; // zslist link; -1 means not-in-list + lib_ctype::FFconst* field_zd_fconst_prev; // previous element // func:lib_ctype.FFconst..AssignOp inline lib_ctype::FFconst& operator =(const lib_ctype::FFconst &rhs) = delete; // func:lib_ctype.FFconst..CopyCtor @@ -1390,6 +1412,7 @@ void FFconst_Print(lib_ctype::FFconst& row, algo::cstring& str) // access: lib_ctype.FSubstr.p_field (Upptr) struct FField { // lib_ctype.FField lib_ctype::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -1469,7 +1492,7 @@ inline bool zd_fconst_EmptyQ(lib_ctype::FField& field) __attribute__((_ inline lib_ctype::FFconst* zd_fconst_First(lib_ctype::FField& field) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:lib_ctype.FField.zd_fconst.InLlistQ -inline bool zd_fconst_InLlistQ(lib_ctype::FFconst& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool field_zd_fconst_InLlistQ(lib_ctype::FFconst& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:lib_ctype.FField.zd_fconst.Insert void zd_fconst_Insert(lib_ctype::FField& field, lib_ctype::FFconst& row) __attribute__((nothrow)); @@ -1481,10 +1504,10 @@ inline lib_ctype::FFconst* zd_fconst_Last(lib_ctype::FField& field) __attribute_ inline i32 zd_fconst_N(const lib_ctype::FField& field) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:lib_ctype.FField.zd_fconst.Next -inline lib_ctype::FFconst* zd_fconst_Next(lib_ctype::FFconst &row) __attribute__((__warn_unused_result__, nothrow)); +inline lib_ctype::FFconst* field_zd_fconst_Next(lib_ctype::FFconst &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:lib_ctype.FField.zd_fconst.Prev -inline lib_ctype::FFconst* zd_fconst_Prev(lib_ctype::FFconst &row) __attribute__((__warn_unused_result__, nothrow)); +inline lib_ctype::FFconst* field_zd_fconst_Prev(lib_ctype::FFconst &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:lib_ctype.FField.zd_fconst.Remove void zd_fconst_Remove(lib_ctype::FField& field, lib_ctype::FFconst& row) __attribute__((nothrow)); @@ -1661,10 +1684,11 @@ void FSqltype_Uninit(lib_ctype::FSqltype& sqltype) __attribute__ // global access: ssimfile (Lary, by rowid) // global access: ind_ssimfile (Thash, hash field ssimfile) struct FSsimfile { // lib_ctype.FSsimfile - lib_ctype::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - lib_ctype::FCtype* p_ctype; // reference to parent row + lib_ctype::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + lib_ctype::FCtype* p_ctype; // reference to parent row // x-reference on lib_ctype.FSsimfile.p_ctype prevents copy // func:lib_ctype.FSsimfile..AssignOp inline lib_ctype::FSsimfile& operator =(const lib_ctype::FSsimfile &rhs) = delete; diff --git a/include/gen/lib_ctype_gen.inl.h b/include/gen/lib_ctype_gen.inl.h index 9b649e4d..965137d9 100644 --- a/include/gen/lib_ctype_gen.inl.h +++ b/include/gen/lib_ctype_gen.inl.h @@ -1214,9 +1214,11 @@ inline lib_ctype::FSqltype& lib_ctype::_db_sqltype_curs_Access(_db_sqltype_curs // Set all fields to initial values. inline void lib_ctype::FFconst_Init(lib_ctype::FFconst& fconst) { fconst.ind_fconst_key_next = (lib_ctype::FFconst*)-1; // (lib_ctype.FDb.ind_fconst_key) not-in-hash + fconst.ind_fconst_key_hashval = 0; // stored hash value fconst.ind_fconst_next = (lib_ctype::FFconst*)-1; // (lib_ctype.FDb.ind_fconst) not-in-hash - fconst.zd_fconst_next = (lib_ctype::FFconst*)-1; // (lib_ctype.FField.zd_fconst) not-in-list - fconst.zd_fconst_prev = NULL; // (lib_ctype.FField.zd_fconst) + fconst.ind_fconst_hashval = 0; // stored hash value + fconst.field_zd_fconst_next = (lib_ctype::FFconst*)-1; // (lib_ctype.FField.zd_fconst) not-in-list + fconst.field_zd_fconst_prev = NULL; // (lib_ctype.FField.zd_fconst) } // --- lib_ctype.FFconst..Ctor @@ -1265,9 +1267,9 @@ inline lib_ctype::FFconst* lib_ctype::zd_fconst_First(lib_ctype::FField& field) // --- lib_ctype.FField.zd_fconst.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool lib_ctype::zd_fconst_InLlistQ(lib_ctype::FFconst& row) { +inline bool lib_ctype::field_zd_fconst_InLlistQ(lib_ctype::FFconst& row) { bool result = false; - result = !(row.zd_fconst_next == (lib_ctype::FFconst*)-1); + result = !(row.field_zd_fconst_next == (lib_ctype::FFconst*)-1); return result; } @@ -1287,14 +1289,14 @@ inline i32 lib_ctype::zd_fconst_N(const lib_ctype::FField& field) { // --- lib_ctype.FField.zd_fconst.Next // Return pointer to next element in the list -inline lib_ctype::FFconst* lib_ctype::zd_fconst_Next(lib_ctype::FFconst &row) { - return row.zd_fconst_next; +inline lib_ctype::FFconst* lib_ctype::field_zd_fconst_Next(lib_ctype::FFconst &row) { + return row.field_zd_fconst_next; } // --- lib_ctype.FField.zd_fconst.Prev // Return pointer to previous element in the list -inline lib_ctype::FFconst* lib_ctype::zd_fconst_Prev(lib_ctype::FFconst &row) { - return row.zd_fconst_prev; +inline lib_ctype::FFconst* lib_ctype::field_zd_fconst_Prev(lib_ctype::FFconst &row) { + return row.field_zd_fconst_prev; } // --- lib_ctype.FField.zd_fconst.qLast @@ -1438,7 +1440,7 @@ inline bool lib_ctype::field_zd_fconst_curs_ValidQ(field_zd_fconst_curs &curs) { // --- lib_ctype.FField.zd_fconst_curs.Next // proceed to next item inline void lib_ctype::field_zd_fconst_curs_Next(field_zd_fconst_curs &curs) { - lib_ctype::FFconst *next = (*curs.row).zd_fconst_next; + lib_ctype::FFconst *next = (*curs.row).field_zd_fconst_next; curs.row = next; } @@ -1506,6 +1508,7 @@ inline lib_ctype::FSqltype::~FSqltype() { inline void lib_ctype::FSsimfile_Init(lib_ctype::FSsimfile& ssimfile) { ssimfile.p_ctype = NULL; ssimfile.ind_ssimfile_next = (lib_ctype::FSsimfile*)-1; // (lib_ctype.FDb.ind_ssimfile) not-in-hash + ssimfile.ind_ssimfile_hashval = 0; // stored hash value } // --- lib_ctype.FSsimfile..Ctor diff --git a/include/gen/lib_curl_gen.h b/include/gen/lib_curl_gen.h new file mode 100644 index 00000000..2894660e --- /dev/null +++ b/include/gen/lib_curl_gen.h @@ -0,0 +1,396 @@ +// +// include/gen/lib_curl_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- lib_curl_FieldIdEnum + +enum lib_curl_FieldIdEnum { // lib_curl.FieldId.value + lib_curl_FieldId_value = 0 +}; + +enum { lib_curl_FieldIdEnum_N = 1 }; + +namespace lib_curl { // gen:ns_pkeytypedef +} // gen:ns_pkeytypedef +namespace lib_curl { // gen:ns_tclass_field +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace lib_curl { struct request_headers_curs; } +namespace lib_curl { struct response_headers_curs; } +namespace lib_curl { struct trace; } +namespace lib_curl { struct FDb; } +namespace lib_curl { struct FRequest; } +namespace lib_curl { struct FResponse; } +namespace lib_curl { struct FieldId; } +namespace lib_curl { extern struct lib_curl::FDb _db; } +namespace lib_curl { // gen:ns_print_struct + +// --- lib_curl.trace +#pragma pack(push,1) +struct trace { // lib_curl.trace + // func:lib_curl.trace..Ctor + inline trace() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// print string representation of ROW to string STR +// cfmt:lib_curl.trace.String printfmt:Tuple +// func:lib_curl.trace..Print +void trace_Print(lib_curl::trace& row, algo::cstring& str) __attribute__((nothrow)); + +// --- lib_curl.FDb +// create: lib_curl.FDb._db (Global) +struct FDb { // lib_curl.FDb + u64 request_blocksize; // # bytes per block + lib_curl::FRequest* request_free; // + u64 response_blocksize; // # bytes per block + lib_curl::FResponse* response_free; // + lib_curl::trace trace; // +}; + +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +// func:lib_curl.FDb._db.InsertStrptrMaybe +bool InsertStrptrMaybe(algo::strptr str); +// Load all finputs from given directory. +// func:lib_curl.FDb._db.LoadTuplesMaybe +bool LoadTuplesMaybe(algo::strptr root, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +// func:lib_curl.FDb._db.LoadTuplesFile +bool LoadTuplesFile(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file descriptor. +// func:lib_curl.FDb._db.LoadTuplesFd +bool LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load specified ssimfile. +// func:lib_curl.FDb._db.LoadSsimfileMaybe +bool LoadSsimfileMaybe(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Calls Step function of dependencies +// func:lib_curl.FDb._db.Steps +void Steps(); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:lib_curl.FDb._db.XrefMaybe +bool _db_XrefMaybe(); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:lib_curl.FDb.request.Alloc +lib_curl::FRequest& request_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:lib_curl.FDb.request.AllocMaybe +lib_curl::FRequest* request_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Remove row from all global and cross indices, then deallocate row +// func:lib_curl.FDb.request.Delete +void request_Delete(lib_curl::FRequest &row) __attribute__((nothrow)); +// Allocate space for one element +// If no memory available, return NULL. +// func:lib_curl.FDb.request.AllocMem +void* request_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Remove mem from all global and cross indices, then deallocate mem +// func:lib_curl.FDb.request.FreeMem +void request_FreeMem(lib_curl::FRequest &row) __attribute__((nothrow)); +// Preallocate memory for N more elements +// Return number of elements actually reserved. +// func:lib_curl.FDb.request.Reserve +u64 request_Reserve(u64 n_elems) __attribute__((nothrow)); +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +// func:lib_curl.FDb.request.ReserveMem +u64 request_ReserveMem(u64 size) __attribute__((nothrow)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:lib_curl.FDb.request.XrefMaybe +bool request_XrefMaybe(lib_curl::FRequest &row); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:lib_curl.FDb.response.Alloc +lib_curl::FResponse& response_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:lib_curl.FDb.response.AllocMaybe +lib_curl::FResponse* response_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Remove row from all global and cross indices, then deallocate row +// func:lib_curl.FDb.response.Delete +void response_Delete(lib_curl::FResponse &row) __attribute__((nothrow)); +// Allocate space for one element +// If no memory available, return NULL. +// func:lib_curl.FDb.response.AllocMem +void* response_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Remove mem from all global and cross indices, then deallocate mem +// func:lib_curl.FDb.response.FreeMem +void response_FreeMem(lib_curl::FResponse &row) __attribute__((nothrow)); +// Preallocate memory for N more elements +// Return number of elements actually reserved. +// func:lib_curl.FDb.response.Reserve +u64 response_Reserve(u64 n_elems) __attribute__((nothrow)); +// Allocate block of given size, break up into small elements and append to free list. +// Return number of elements reserved. +// func:lib_curl.FDb.response.ReserveMem +u64 response_ReserveMem(u64 size) __attribute__((nothrow)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:lib_curl.FDb.response.XrefMaybe +bool response_XrefMaybe(lib_curl::FResponse &row); + +// Set all fields to initial values. +// func:lib_curl.FDb..Init +void FDb_Init(); +// func:lib_curl.FDb..Uninit +inline void FDb_Uninit() __attribute__((nothrow)); + +// --- lib_curl.FRequest +// create: lib_curl.FDb.request (Tpool) +struct FRequest { // lib_curl.FRequest: curl request structure + lib_curl::FRequest* request_next; // Pointer to next free element int tpool + algo::Smallstr50 method; // "GET" HTTP verb: GET, POST, PUT, PATCH, DELETE + bool curlrc_only; // false Generate curlrc info, do not call curl + algo::cstring url; // Absolute URL (e.g., https://api.example.com/v1/data) + algo::cstring* headers_lary[32]; // level array + i32 headers_n; // number of elements in array + algo::cstring body; // Optional request body (sent as-is, often JSON string) + bool insecure_tls; // false Skip TLS verification if true + u32 connect_timeout_sec; // 5 connect_timeout_sec + u32 total_timeout_sec; // 120 Total request timeout (s) +private: + // func:lib_curl.FRequest..Ctor + inline FRequest() __attribute__((nothrow)); + // func:lib_curl.FRequest..Dtor + inline ~FRequest() __attribute__((nothrow)); + friend lib_curl::FRequest& request_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_curl::FRequest* request_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void request_Delete(lib_curl::FRequest &row) __attribute__((nothrow)); +}; + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:lib_curl.FRequest.headers.Alloc +algo::cstring& headers_Alloc(lib_curl::FRequest& request) __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:lib_curl.FRequest.headers.AllocMaybe +algo::cstring* headers_AllocMaybe(lib_curl::FRequest& request) __attribute__((__warn_unused_result__, nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:lib_curl.FRequest.headers.AllocMem +void* headers_AllocMem(lib_curl::FRequest& request) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:lib_curl.FRequest.headers.EmptyQ +inline bool headers_EmptyQ(lib_curl::FRequest& request) __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:lib_curl.FRequest.headers.Find +inline algo::cstring* headers_Find(lib_curl::FRequest& request, u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:lib_curl.FRequest.headers.Last +inline algo::cstring* headers_Last(lib_curl::FRequest& request) __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:lib_curl.FRequest.headers.N +inline i32 headers_N(const lib_curl::FRequest& request) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:lib_curl.FRequest.headers.RemoveAll +void headers_RemoveAll(lib_curl::FRequest& request) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:lib_curl.FRequest.headers.RemoveLast +void headers_RemoveLast(lib_curl::FRequest& request) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:lib_curl.FRequest.headers.qFind +inline algo::cstring& headers_qFind(lib_curl::FRequest& request, u64 t) __attribute__((nothrow, pure)); + +// Set all fields to initial values. +// func:lib_curl.FRequest..Init +void FRequest_Init(lib_curl::FRequest& request); +// cursor points to valid item +// func:lib_curl.FRequest.headers_curs.Reset +inline void request_headers_curs_Reset(request_headers_curs &curs, lib_curl::FRequest &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:lib_curl.FRequest.headers_curs.ValidQ +inline bool request_headers_curs_ValidQ(request_headers_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:lib_curl.FRequest.headers_curs.Next +inline void request_headers_curs_Next(request_headers_curs &curs) __attribute__((nothrow)); +// item access +// func:lib_curl.FRequest.headers_curs.Access +inline algo::cstring& request_headers_curs_Access(request_headers_curs &curs) __attribute__((nothrow)); +// func:lib_curl.FRequest..Uninit +void FRequest_Uninit(lib_curl::FRequest& request) __attribute__((nothrow)); + +// --- lib_curl.FResponse +// create: lib_curl.FDb.response (Tpool) +struct FResponse { // lib_curl.FResponse: curl response structure + lib_curl::FResponse* response_next; // Pointer to next free element int tpool + u16 code; // 0 HTTP status code + algo::cstring body; // raw response body + algo::cstring content_type; // parsed Content-Type (no params) + algo::cstring status_line; // e.g., HTTP/1.1 200 OK + algo::cstring reason; // parsed reason phrase, if available + algo::cstring* headers_lary[32]; // level array + i32 headers_n; // number of elements in array + algo::cstring curlrc; // curlrc content +private: + // func:lib_curl.FResponse..Ctor + inline FResponse() __attribute__((nothrow)); + // func:lib_curl.FResponse..Dtor + inline ~FResponse() __attribute__((nothrow)); + friend lib_curl::FResponse& response_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_curl::FResponse* response_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void response_Delete(lib_curl::FResponse &row) __attribute__((nothrow)); +}; + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:lib_curl.FResponse.headers.Alloc +algo::cstring& headers_Alloc(lib_curl::FResponse& response) __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:lib_curl.FResponse.headers.AllocMaybe +algo::cstring* headers_AllocMaybe(lib_curl::FResponse& response) __attribute__((__warn_unused_result__, nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:lib_curl.FResponse.headers.AllocMem +void* headers_AllocMem(lib_curl::FResponse& response) __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:lib_curl.FResponse.headers.EmptyQ +inline bool headers_EmptyQ(lib_curl::FResponse& response) __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:lib_curl.FResponse.headers.Find +inline algo::cstring* headers_Find(lib_curl::FResponse& response, u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:lib_curl.FResponse.headers.Last +inline algo::cstring* headers_Last(lib_curl::FResponse& response) __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:lib_curl.FResponse.headers.N +inline i32 headers_N(const lib_curl::FResponse& response) __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:lib_curl.FResponse.headers.RemoveAll +void headers_RemoveAll(lib_curl::FResponse& response) __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:lib_curl.FResponse.headers.RemoveLast +void headers_RemoveLast(lib_curl::FResponse& response) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:lib_curl.FResponse.headers.qFind +inline algo::cstring& headers_qFind(lib_curl::FResponse& response, u64 t) __attribute__((nothrow, pure)); + +// Set all fields to initial values. +// func:lib_curl.FResponse..Init +void FResponse_Init(lib_curl::FResponse& response); +// cursor points to valid item +// func:lib_curl.FResponse.headers_curs.Reset +inline void response_headers_curs_Reset(response_headers_curs &curs, lib_curl::FResponse &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:lib_curl.FResponse.headers_curs.ValidQ +inline bool response_headers_curs_ValidQ(response_headers_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:lib_curl.FResponse.headers_curs.Next +inline void response_headers_curs_Next(response_headers_curs &curs) __attribute__((nothrow)); +// item access +// func:lib_curl.FResponse.headers_curs.Access +inline algo::cstring& response_headers_curs_Access(response_headers_curs &curs) __attribute__((nothrow)); +// func:lib_curl.FResponse..Uninit +void FResponse_Uninit(lib_curl::FResponse& response) __attribute__((nothrow)); + +// --- lib_curl.FieldId +#pragma pack(push,1) +struct FieldId { // lib_curl.FieldId: Field read helper + i32 value; // -1 + // func:lib_curl.FieldId.value.Cast + inline operator lib_curl_FieldIdEnum() const __attribute__((nothrow)); + // func:lib_curl.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:lib_curl.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:lib_curl.FieldId..EnumCtor + inline FieldId(lib_curl_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:lib_curl.FieldId.value.GetEnum +inline lib_curl_FieldIdEnum value_GetEnum(const lib_curl::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:lib_curl.FieldId.value.SetEnum +inline void value_SetEnum(lib_curl::FieldId& parent, lib_curl_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:lib_curl.FieldId.value.ToCstr +const char* value_ToCstr(const lib_curl::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:lib_curl.FieldId.value.Print +void value_Print(const lib_curl::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:lib_curl.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(lib_curl::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:lib_curl.FieldId.value.SetStrptr +void value_SetStrptr(lib_curl::FieldId& parent, algo::strptr rhs, lib_curl_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:lib_curl.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(lib_curl::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of lib_curl::FieldId from an ascii string. +// The format of the string is the format of the lib_curl::FieldId's only field +// func:lib_curl.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(lib_curl::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:lib_curl.FieldId..Init +inline void FieldId_Init(lib_curl::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:lib_curl.FieldId.String printfmt:Raw +// func:lib_curl.FieldId..Print +void FieldId_Print(lib_curl::FieldId& row, algo::cstring& str) __attribute__((nothrow)); +} // gen:ns_print_struct +namespace lib_curl { // gen:ns_curstext + +struct request_headers_curs {// cursor + typedef algo::cstring ChildType; + lib_curl::FRequest *parent; + i64 index; + request_headers_curs(){ parent=NULL; index=0; } +}; + + +struct response_headers_curs {// cursor + typedef algo::cstring ChildType; + lib_curl::FResponse *parent; + i64 index; + response_headers_curs(){ parent=NULL; index=0; } +}; + +} // gen:ns_curstext +namespace lib_curl { // gen:ns_func +// func:lib_curl...StaticCheck +void StaticCheck(); +} // gen:ns_func +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const lib_curl::trace &row);// cfmt:lib_curl.trace.String +inline algo::cstring &operator <<(algo::cstring &str, const lib_curl::FieldId &row);// cfmt:lib_curl.FieldId.String +} diff --git a/include/gen/lib_curl_gen.inl.h b/include/gen/lib_curl_gen.inl.h new file mode 100644 index 00000000..fba47302 --- /dev/null +++ b/include/gen/lib_curl_gen.inl.h @@ -0,0 +1,239 @@ +// +// include/gen/lib_curl_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude + +// --- lib_curl.trace..Ctor +inline lib_curl::trace::trace() { +} + +// --- lib_curl.FDb..Uninit +inline void lib_curl::FDb_Uninit() { + lib_curl::FDb &row = _db; (void)row; +} + +// --- lib_curl.FRequest.headers.EmptyQ +// Return true if index is empty +inline bool lib_curl::headers_EmptyQ(lib_curl::FRequest& request) { + return request.headers_n == 0; +} + +// --- lib_curl.FRequest.headers.Find +// Look up row by row id. Return NULL if out of range +inline algo::cstring* lib_curl::headers_Find(lib_curl::FRequest& request, u64 t) { + algo::cstring *retval = NULL; + if (LIKELY(u64(t) < u64(request.headers_n))) { + u64 x = t + 1; + u64 bsr = algo::u64_BitScanReverse(x); + u64 base = u64(1)<value = i32(arg); +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const lib_curl::trace &row) {// cfmt:lib_curl.trace.String + lib_curl::trace_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const lib_curl::FieldId &row) {// cfmt:lib_curl.FieldId.String + lib_curl::FieldId_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/lib_exec_gen.h b/include/gen/lib_exec_gen.h index b089231f..2fefd965 100644 --- a/include/gen/lib_exec_gen.h +++ b/include/gen/lib_exec_gen.h @@ -259,6 +259,9 @@ void ind_running_Remove(lib_exec::FSyscmd& row) __attribute__((n // Reserve enough room in the hash for N more elements. Return success code. // func:lib_exec.FDb.ind_running.Reserve void ind_running_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_exec.FDb.ind_running.AbsReserve +void ind_running_AbsReserve(int n) __attribute__((nothrow)); // Remove all elements from heap and free memory used by the array. // func:lib_exec.FDb.bh_syscmd.Dealloc @@ -404,32 +407,33 @@ void FDb_Uninit() __attribute__((nothrow)); // access: lib_exec.FSyscmddep.p_child (Upptr) // access: lib_exec.FSyscmddep.p_parent (Upptr) struct FSyscmd { // lib_exec.FSyscmd - lib_exec::FSyscmd* ind_running_next; // hash next - i32 bh_syscmd_idx; // index in heap; -1 means not-in-heap - lib_exec::FSyscmd* zd_started_next; // zslist link; -1 means not-in-list - lib_exec::FSyscmd* zd_started_prev; // previous element - i64 syscmd; // 0 Step number - algo::cstring command; // Command to execute - i32 pid; // 0 PID, if running - i32 status; // 0 Exit status (if command has completed) - i32 nprereq; // 0 Number of live pre-requisites - bool fail_prereq; // false Set if one of pre-requisites fails - bool completed; // false Completed? - i32 maxtime; // 0 Optional max running time (used to use SIGALRM) - lib_exec::FSyscmddep** c_prior_elems; // array of pointers - u32 c_prior_n; // array of pointers - u32 c_prior_max; // capacity of allocated array - lib_exec::FSyscmddep** c_next_elems; // array of pointers - u32 c_next_n; // array of pointers - u32 c_next_max; // capacity of allocated array - i32 rowid; // 0 - algo::cstring message; // Message to print when command finishes - bool redir_out; // true Redirect stdout/stderr to temp file - bool show_out; // true Print stdout/stderr - algo_lib::FFildes stdout_fd; // Temporary file containing stdout of subprocess - algo_lib::FFildes stderr_fd; // Temporary file containing stderr of subprocess - i32 signal; // 0 Signal received by process (if any) - algo::StringAry args; // Overrides 'command' + lib_exec::FSyscmd* ind_running_next; // hash next + u32 ind_running_hashval; // hash value + i32 bh_syscmd_idx; // index in heap; -1 means not-in-heap + lib_exec::FSyscmd* zd_started_next; // zslist link; -1 means not-in-list + lib_exec::FSyscmd* zd_started_prev; // previous element + i64 syscmd; // 0 Step number + algo::cstring command; // Command to execute + i32 pid; // 0 PID, if running + i32 status; // 0 Exit status (if command has completed) + i32 nprereq; // 0 Number of live pre-requisites + bool fail_prereq; // false Set if one of pre-requisites fails + bool completed; // false Completed? + i32 maxtime; // 0 Optional max running time (used to use SIGALRM) + lib_exec::FSyscmddep** c_prior_elems; // array of pointers + u32 c_prior_n; // array of pointers + u32 c_prior_max; // capacity of allocated array + lib_exec::FSyscmddep** c_next_elems; // array of pointers + u32 c_next_n; // array of pointers + u32 c_next_max; // capacity of allocated array + i32 rowid; // 0 + algo::cstring message; // Message to print when command finishes + bool redir_out; // true Redirect stdout/stderr to temp file + bool show_out; // true Print stdout/stderr + algo_lib::FFildes stdout_fd; // Temporary file containing stdout of subprocess + algo_lib::FFildes stderr_fd; // Temporary file containing stderr of subprocess + i32 signal; // 0 Signal received by process (if any) + algo::StringAry args; // Overrides 'command' // reftype Ptrary of lib_exec.FSyscmd.c_prior prohibits copy // reftype Ptrary of lib_exec.FSyscmd.c_next prohibits copy // func:lib_exec.FSyscmd..AssignOp @@ -610,10 +614,6 @@ void syscmddep_CopyOut(lib_exec::FSyscmddep &row, dev::Syscmddep // func:lib_exec.FSyscmddep.msghdr.CopyIn void syscmddep_CopyIn(lib_exec::FSyscmddep &row, dev::Syscmddep &in) __attribute__((nothrow)); -// func:lib_exec.FSyscmddep.syscmddep.Get -// this function is 'extrn' and implemented by user -algo::RspaceStr16 syscmddep_Get(lib_exec::FSyscmddep& syscmddep) __attribute__((__warn_unused_result__, nothrow)); - // Set all fields to initial values. // func:lib_exec.FSyscmddep..Init inline void FSyscmddep_Init(lib_exec::FSyscmddep& syscmddep); diff --git a/include/gen/lib_fm_gen.h b/include/gen/lib_fm_gen.h index 71480fef..947446e0 100644 --- a/include/gen/lib_fm_gen.h +++ b/include/gen/lib_fm_gen.h @@ -54,10 +54,10 @@ namespace lib_fm { // gen:ns_pkeytypedef namespace lib_fm { // gen:ns_tclass_field } // gen:ns_tclass_field // gen:ns_fwddecl2 +namespace lib_fm { struct FAlarm; } namespace lib_fm { struct _db_alarm_curs; } namespace lib_fm { struct _db_alm_code_curs; } namespace lib_fm { struct _db_alm_objtype_curs; } -namespace lib_fm { struct FAlarm; } namespace lib_fm { struct FAlmCode; } namespace lib_fm { struct FAlmObjtype; } namespace lib_fm { struct trace; } @@ -85,19 +85,20 @@ namespace lib_fm { // gen:ns_print_struct // global access: ind_alarm (Thash, hash field alarm) // global access: h_alarm (Hook) struct FAlarm { // lib_fm.FAlarm - algo::Smallstr200 alarm; // Alarm identity: code@object - fm::Flag flag; // Flag: raised or cleared - fm::Severity severity; // Perceived severity - i32 n_occurred; // 0 How many times the alarm occurred since first_time - algo::UnTime first_time; // Time of first occurrence - algo::UnTime last_time; // Time of last occurrence - algo::UnTime clear_time; // Time when the alarm has beed cleared (only for cleared alarms - algo::UnTime update_time; // Time of last update - fm::Summary objtype_summary; // Object type explained - fm::Summary summary; // Alarm summary from inventory - fm::Description description; // Alarm message from object - fm::Source source; // Subsystem where alarm has been detected - lib_fm::FAlarm* ind_alarm_next; // hash next + algo::Smallstr200 alarm; // Alarm identity: code@object + fm::Flag flag; // Flag: raised or cleared + fm::Severity severity; // Perceived severity + i32 n_occurred; // 0 How many times the alarm occurred since first_time + algo::UnTime first_time; // Time of first occurrence + algo::UnTime last_time; // Time of last occurrence + algo::UnTime clear_time; // Time when the alarm has beed cleared (only for cleared alarms + algo::UnTime update_time; // Time of last update + fm::Summary objtype_summary; // Object type explained + fm::Summary summary; // Alarm summary from inventory + fm::Description description; // Alarm message from object + fm::Source source; // Subsystem where alarm has been detected + lib_fm::FAlarm* ind_alarm_next; // hash next + u32 ind_alarm_hashval; // hash value // func:lib_fm.FAlarm..AssignOp lib_fm::FAlarm& operator =(const lib_fm::FAlarm &rhs) = delete; // func:lib_fm.FAlarm..CopyCtor @@ -146,11 +147,12 @@ void FAlarm_Uninit(lib_fm::FAlarm& alarm) __attribute__((nothrow // global access: alm_code (Lary, by rowid) // global access: ind_alm_code (Thash, hash field alm_code) struct FAlmCode { // lib_fm.FAlmCode - fm::Code alm_code; // Alarm code - fm::Severity severity; // Assigned severity - fm::Source source; // - fm::Summary summary; // Alarm summary (slogan) - lib_fm::FAlmCode* ind_alm_code_next; // hash next + fm::Code alm_code; // Alarm code + fm::Severity severity; // Assigned severity + fm::Source source; // + fm::Summary summary; // Alarm summary (slogan) + lib_fm::FAlmCode* ind_alm_code_next; // hash next + u32 ind_alm_code_hashval; // hash value // func:lib_fm.FAlmCode..AssignOp inline lib_fm::FAlmCode& operator =(const lib_fm::FAlmCode &rhs) = delete; // func:lib_fm.FAlmCode..CopyCtor @@ -184,9 +186,10 @@ void FAlmCode_Uninit(lib_fm::FAlmCode& alm_code) __attribute__(( // global access: alm_objtype (Lary, by rowid) // global access: ind_alm_objtype (Thash, hash field alm_objtype) struct FAlmObjtype { // lib_fm.FAlmObjtype - fm::Objtype alm_objtype; // Object type - fm::Summary summary; // Object type summary - lib_fm::FAlmObjtype* ind_alm_objtype_next; // hash next + fm::Objtype alm_objtype; // Object type + fm::Summary summary; // Object type summary + lib_fm::FAlmObjtype* ind_alm_objtype_next; // hash next + u32 ind_alm_objtype_hashval; // hash value // func:lib_fm.FAlmObjtype..AssignOp inline lib_fm::FAlmObjtype& operator =(const lib_fm::FAlmObjtype &rhs) = delete; // func:lib_fm.FAlmObjtype..CopyCtor @@ -351,6 +354,9 @@ void ind_alarm_Remove(lib_fm::FAlarm& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:lib_fm.FDb.ind_alarm.Reserve void ind_alarm_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_fm.FDb.ind_alarm.AbsReserve +void ind_alarm_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -416,6 +422,9 @@ void ind_alm_code_Remove(lib_fm::FAlmCode& row) __attribute__((n // Reserve enough room in the hash for N more elements. Return success code. // func:lib_fm.FDb.ind_alm_code.Reserve void ind_alm_code_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_fm.FDb.ind_alm_code.AbsReserve +void ind_alm_code_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -481,6 +490,9 @@ void ind_alm_objtype_Remove(lib_fm::FAlmObjtype& row) __attribut // Reserve enough room in the hash for N more elements. Return success code. // func:lib_fm.FDb.ind_alm_objtype.Reserve void ind_alm_objtype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_fm.FDb.ind_alm_objtype.AbsReserve +void ind_alm_objtype_AbsReserve(int n) __attribute__((nothrow)); // Invoke function by pointer // func:lib_fm.FDb.h_alarm.Call diff --git a/include/gen/lib_fm_gen.inl.h b/include/gen/lib_fm_gen.inl.h index db48f91f..dbac387b 100644 --- a/include/gen/lib_fm_gen.inl.h +++ b/include/gen/lib_fm_gen.inl.h @@ -42,6 +42,7 @@ inline lib_fm::FAlarm::~FAlarm() { // Set all fields to initial values. inline void lib_fm::FAlmCode_Init(lib_fm::FAlmCode& alm_code) { alm_code.ind_alm_code_next = (lib_fm::FAlmCode*)-1; // (lib_fm.FDb.ind_alm_code) not-in-hash + alm_code.ind_alm_code_hashval = 0; // stored hash value } // --- lib_fm.FAlmCode..Ctor @@ -58,6 +59,7 @@ inline lib_fm::FAlmCode::~FAlmCode() { // Set all fields to initial values. inline void lib_fm::FAlmObjtype_Init(lib_fm::FAlmObjtype& alm_objtype) { alm_objtype.ind_alm_objtype_next = (lib_fm::FAlmObjtype*)-1; // (lib_fm.FDb.ind_alm_objtype) not-in-hash + alm_objtype.ind_alm_objtype_hashval = 0; // stored hash value } // --- lib_fm.FAlmObjtype..Ctor diff --git a/include/gen/lib_http_gen.h b/include/gen/lib_http_gen.h new file mode 100644 index 00000000..d2227056 --- /dev/null +++ b/include/gen/lib_http_gen.h @@ -0,0 +1,264 @@ +// +// include/gen/lib_http_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/httpdb_gen.h" +#include "include/gen/algo_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- lib_http_FieldIdEnum + +enum lib_http_FieldIdEnum { // lib_http.FieldId.value + lib_http_FieldId_value = 0 +}; + +enum { lib_http_FieldIdEnum_N = 1 }; + +namespace lib_http { // gen:ns_pkeytypedef +} // gen:ns_pkeytypedef +namespace lib_http { // gen:ns_tclass_field +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace lib_http { struct _db_status_curs; } +namespace lib_http { struct FStatus; } +namespace lib_http { struct trace; } +namespace lib_http { struct FDb; } +namespace lib_http { struct FieldId; } +namespace lib_http { extern struct lib_http::FDb _db; } +namespace lib_http { // gen:ns_print_struct + +// --- lib_http.FStatus +// create: lib_http.FDb.status (Inlary) +struct FStatus { // lib_http.FStatus + algo::Smallstr50 status; // + // func:lib_http.FStatus..Ctor + inline FStatus() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:lib_http.FStatus.base.CopyOut +void status_CopyOut(lib_http::FStatus &row, httpdb::Status &out) __attribute__((nothrow)); +// Copy fields in to row +// func:lib_http.FStatus.base.CopyIn +void status_CopyIn(lib_http::FStatus &row, httpdb::Status &in) __attribute__((nothrow)); + +// func:lib_http.FStatus.code.Get +u16 code_Get(lib_http::FStatus& status) __attribute__((__warn_unused_result__, nothrow)); + +// func:lib_http.FStatus.reason.Get +algo::Smallstr50 reason_Get(lib_http::FStatus& status) __attribute__((__warn_unused_result__, nothrow)); + + +// --- lib_http.trace +#pragma pack(push,1) +struct trace { // lib_http.trace + // func:lib_http.trace..Ctor + inline trace() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// print string representation of ROW to string STR +// cfmt:lib_http.trace.String printfmt:Tuple +// func:lib_http.trace..Print +void trace_Print(lib_http::trace& row, algo::cstring& str) __attribute__((nothrow)); + +// --- lib_http.FDb +// create: lib_http.FDb._db (Global) +struct FDb { // lib_http.FDb + u128 status_data[sizeu128(lib_http::FStatus,40)]; // place for data + i32 status_n; // number of elems current in existence + enum { status_max = 40 }; + lib_http::trace trace; // +}; + +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +// func:lib_http.FDb._db.InsertStrptrMaybe +bool InsertStrptrMaybe(algo::strptr str); +// Load all finputs from given directory. +// func:lib_http.FDb._db.LoadTuplesMaybe +bool LoadTuplesMaybe(algo::strptr root, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +// func:lib_http.FDb._db.LoadTuplesFile +bool LoadTuplesFile(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file descriptor. +// func:lib_http.FDb._db.LoadTuplesFd +bool LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load specified ssimfile. +// func:lib_http.FDb._db.LoadSsimfileMaybe +bool LoadSsimfileMaybe(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Calls Step function of dependencies +// func:lib_http.FDb._db.Steps +void Steps(); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:lib_http.FDb._db.XrefMaybe +bool _db_XrefMaybe(); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:lib_http.FDb.status.Alloc +lib_http::FStatus& status_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:lib_http.FDb.status.AllocMaybe +lib_http::FStatus* status_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:lib_http.FDb.status.InsertMaybe +lib_http::FStatus* status_InsertMaybe(const httpdb::Status &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:lib_http.FDb.status.AllocMem +inline void* status_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:lib_http.FDb.status.EmptyQ +inline bool status_EmptyQ() __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:lib_http.FDb.status.Find +inline lib_http::FStatus* status_Find(u64 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array pointer by value +// func:lib_http.FDb.status.Getary +inline algo::aryptr status_Getary() __attribute__((nothrow)); +// Return constant 40 -- max. number of items in the pool +// func:lib_http.FDb.status.Max +inline i32 status_Max() __attribute__((nothrow)); +// Return number of items in the array +// func:lib_http.FDb.status.N +inline i32 status_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Destroy all elements of Inlary +// func:lib_http.FDb.status.RemoveAll +void status_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:lib_http.FDb.status.RemoveLast +void status_RemoveLast() __attribute__((nothrow)); +// Set contents of fixed array to RHS; Input length is trimmed as necessary +// func:lib_http.FDb.status.Setary +inline void status_Setary(const algo::aryptr &rhs) __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking in release. +// func:lib_http.FDb.status.qFind +inline lib_http::FStatus& status_qFind(u64 t) __attribute__((nothrow)); +// Compute row id of element given element's address +// func:lib_http.FDb.status.rowid_Get +inline u64 status_rowid_Get(lib_http::FStatus &row) __attribute__((nothrow)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:lib_http.FDb.status.XrefMaybe +bool status_XrefMaybe(lib_http::FStatus &row); + +// cursor points to valid item +// func:lib_http.FDb.status_curs.Reset +inline void _db_status_curs_Reset(_db_status_curs &curs, lib_http::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:lib_http.FDb.status_curs.ValidQ +inline bool _db_status_curs_ValidQ(_db_status_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:lib_http.FDb.status_curs.Next +inline void _db_status_curs_Next(_db_status_curs &curs) __attribute__((nothrow)); +// item access +// func:lib_http.FDb.status_curs.Access +inline lib_http::FStatus& _db_status_curs_Access(_db_status_curs &curs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:lib_http.FDb..Init +void FDb_Init(); +// func:lib_http.FDb..Uninit +void FDb_Uninit() __attribute__((nothrow)); + +// --- lib_http.FieldId +#pragma pack(push,1) +struct FieldId { // lib_http.FieldId: Field read helper + i32 value; // -1 + // func:lib_http.FieldId.value.Cast + inline operator lib_http_FieldIdEnum() const __attribute__((nothrow)); + // func:lib_http.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:lib_http.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:lib_http.FieldId..EnumCtor + inline FieldId(lib_http_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:lib_http.FieldId.value.GetEnum +inline lib_http_FieldIdEnum value_GetEnum(const lib_http::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:lib_http.FieldId.value.SetEnum +inline void value_SetEnum(lib_http::FieldId& parent, lib_http_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:lib_http.FieldId.value.ToCstr +const char* value_ToCstr(const lib_http::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:lib_http.FieldId.value.Print +void value_Print(const lib_http::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:lib_http.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(lib_http::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:lib_http.FieldId.value.SetStrptr +void value_SetStrptr(lib_http::FieldId& parent, algo::strptr rhs, lib_http_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:lib_http.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(lib_http::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of lib_http::FieldId from an ascii string. +// The format of the string is the format of the lib_http::FieldId's only field +// func:lib_http.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(lib_http::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:lib_http.FieldId..Init +inline void FieldId_Init(lib_http::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:lib_http.FieldId.String printfmt:Raw +// func:lib_http.FieldId..Print +void FieldId_Print(lib_http::FieldId& row, algo::cstring& str) __attribute__((nothrow)); +} // gen:ns_print_struct +namespace lib_http { // gen:ns_curstext + +struct _db_status_curs {// cursor + typedef lib_http::FStatus ChildType; + int index; + lib_http::FDb *parent; + _db_status_curs() { parent=NULL; index=0; } +}; + +} // gen:ns_curstext +namespace lib_http { // gen:ns_func +// func:lib_http...StaticCheck +void StaticCheck(); +} // gen:ns_func +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const lib_http::trace &row);// cfmt:lib_http.trace.String +inline algo::cstring &operator <<(algo::cstring &str, const lib_http::FieldId &row);// cfmt:lib_http.FieldId.String +} diff --git a/include/gen/lib_http_gen.inl.h b/include/gen/lib_http_gen.inl.h new file mode 100644 index 00000000..5ccc4a96 --- /dev/null +++ b/include/gen/lib_http_gen.inl.h @@ -0,0 +1,212 @@ +// +// include/gen/lib_http_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/httpdb_gen.inl.h" +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude +static lib_http::FStatus &lib_http_status__100_Continue = ((lib_http::FStatus*)lib_http::_db.status_data)[0]; +static lib_http::FStatus &lib_http_status__101_Switching_Protocols = ((lib_http::FStatus*)lib_http::_db.status_data)[1]; +static lib_http::FStatus &lib_http_status__200_OK = ((lib_http::FStatus*)lib_http::_db.status_data)[2]; +static lib_http::FStatus &lib_http_status__201_Created = ((lib_http::FStatus*)lib_http::_db.status_data)[3]; +static lib_http::FStatus &lib_http_status__202_Accepted = ((lib_http::FStatus*)lib_http::_db.status_data)[4]; +static lib_http::FStatus &lib_http_status__203_Non_Authoritative_Information = ((lib_http::FStatus*)lib_http::_db.status_data)[5]; +static lib_http::FStatus &lib_http_status__204_No_Content = ((lib_http::FStatus*)lib_http::_db.status_data)[6]; +static lib_http::FStatus &lib_http_status__205_Reset_Content = ((lib_http::FStatus*)lib_http::_db.status_data)[7]; +static lib_http::FStatus &lib_http_status__206_Partial_Content = ((lib_http::FStatus*)lib_http::_db.status_data)[8]; +static lib_http::FStatus &lib_http_status__300_Multiple_Choices = ((lib_http::FStatus*)lib_http::_db.status_data)[9]; +static lib_http::FStatus &lib_http_status__301_Moved_Permanently = ((lib_http::FStatus*)lib_http::_db.status_data)[10]; +static lib_http::FStatus &lib_http_status__302_Found = ((lib_http::FStatus*)lib_http::_db.status_data)[11]; +static lib_http::FStatus &lib_http_status__303_See_Other = ((lib_http::FStatus*)lib_http::_db.status_data)[12]; +static lib_http::FStatus &lib_http_status__304_Not_Modified = ((lib_http::FStatus*)lib_http::_db.status_data)[13]; +static lib_http::FStatus &lib_http_status__305_Use_Proxy = ((lib_http::FStatus*)lib_http::_db.status_data)[14]; +static lib_http::FStatus &lib_http_status__307_Temporary_Redirect = ((lib_http::FStatus*)lib_http::_db.status_data)[15]; +static lib_http::FStatus &lib_http_status__400_Bad_Request = ((lib_http::FStatus*)lib_http::_db.status_data)[16]; +static lib_http::FStatus &lib_http_status__401_Unauthorized = ((lib_http::FStatus*)lib_http::_db.status_data)[17]; +static lib_http::FStatus &lib_http_status__402_Payment_Required = ((lib_http::FStatus*)lib_http::_db.status_data)[18]; +static lib_http::FStatus &lib_http_status__403_Forbidden = ((lib_http::FStatus*)lib_http::_db.status_data)[19]; +static lib_http::FStatus &lib_http_status__404_Not_Found = ((lib_http::FStatus*)lib_http::_db.status_data)[20]; +static lib_http::FStatus &lib_http_status__405_Method_Not_Allowed = ((lib_http::FStatus*)lib_http::_db.status_data)[21]; +static lib_http::FStatus &lib_http_status__406_Not_Acceptable = ((lib_http::FStatus*)lib_http::_db.status_data)[22]; +static lib_http::FStatus &lib_http_status__407_Proxy_Authentication_Required = ((lib_http::FStatus*)lib_http::_db.status_data)[23]; +static lib_http::FStatus &lib_http_status__408_Request_Time_out = ((lib_http::FStatus*)lib_http::_db.status_data)[24]; +static lib_http::FStatus &lib_http_status__409_Conflict = ((lib_http::FStatus*)lib_http::_db.status_data)[25]; +static lib_http::FStatus &lib_http_status__410_Gone = ((lib_http::FStatus*)lib_http::_db.status_data)[26]; +static lib_http::FStatus &lib_http_status__411_Length_Required = ((lib_http::FStatus*)lib_http::_db.status_data)[27]; +static lib_http::FStatus &lib_http_status__412_Precondition_Failed = ((lib_http::FStatus*)lib_http::_db.status_data)[28]; +static lib_http::FStatus &lib_http_status__413_Request_Entity_Too_Large = ((lib_http::FStatus*)lib_http::_db.status_data)[29]; +static lib_http::FStatus &lib_http_status__414_Request_URI_Too_Large = ((lib_http::FStatus*)lib_http::_db.status_data)[30]; +static lib_http::FStatus &lib_http_status__415_Unsupported_Media_Type = ((lib_http::FStatus*)lib_http::_db.status_data)[31]; +static lib_http::FStatus &lib_http_status__416_Requested_range_not_satisfiable = ((lib_http::FStatus*)lib_http::_db.status_data)[32]; +static lib_http::FStatus &lib_http_status__417_Expectation_Failed = ((lib_http::FStatus*)lib_http::_db.status_data)[33]; +static lib_http::FStatus &lib_http_status__500_Internal_Server_Error = ((lib_http::FStatus*)lib_http::_db.status_data)[34]; +static lib_http::FStatus &lib_http_status__501_Not_Implemented = ((lib_http::FStatus*)lib_http::_db.status_data)[35]; +static lib_http::FStatus &lib_http_status__502_Bad_Gateway = ((lib_http::FStatus*)lib_http::_db.status_data)[36]; +static lib_http::FStatus &lib_http_status__503_Service_Unavailable = ((lib_http::FStatus*)lib_http::_db.status_data)[37]; +static lib_http::FStatus &lib_http_status__504_Gateway_Time_out = ((lib_http::FStatus*)lib_http::_db.status_data)[38]; +static lib_http::FStatus &lib_http_status__505_HTTP_Version_not_supported = ((lib_http::FStatus*)lib_http::_db.status_data)[39]; + +// --- lib_http.FStatus..Ctor +inline lib_http::FStatus::FStatus() { +} + +// --- lib_http.trace..Ctor +inline lib_http::trace::trace() { +} + +// --- lib_http.FDb.status.AllocMem +// Allocate space for one element. If no memory available, return NULL. +inline void* lib_http::status_AllocMem() { + void *row = reinterpret_cast(_db.status_data) + _db.status_n; + if (_db.status_n == 40) row = NULL; + if (row) _db.status_n++; + return row; +} + +// --- lib_http.FDb.status.EmptyQ +// Return true if index is empty +inline bool lib_http::status_EmptyQ() { + return _db.status_n == 0; +} + +// --- lib_http.FDb.status.Find +// Look up row by row id. Return NULL if out of range +inline lib_http::FStatus* lib_http::status_Find(u64 t) { + u64 idx = t; + u64 lim = _db.status_n; + return idx < lim ? reinterpret_cast(_db.status_data) + idx : NULL; // unsigned comparison with limit +} + +// --- lib_http.FDb.status.Getary +// Return array pointer by value +inline algo::aryptr lib_http::status_Getary() { + return algo::aryptr(reinterpret_cast(_db.status_data), _db.status_n); +} + +// --- lib_http.FDb.status.Max +// Return constant 40 -- max. number of items in the pool +inline i32 lib_http::status_Max() { + return 40; +} + +// --- lib_http.FDb.status.N +// Return number of items in the array +inline i32 lib_http::status_N() { + (void)_db;//only to avoid -Wunused-parameter + return _db.status_n; +} + +// --- lib_http.FDb.status.Setary +// Set contents of fixed array to RHS; Input length is trimmed as necessary +inline void lib_http::status_Setary(const algo::aryptr &rhs) { + int n = i32_Min(40, rhs.n_elems); + memcpy(reinterpret_cast(_db.status_data), rhs.elems, sizeof(lib_http::FStatus)*n); +} + +// --- lib_http.FDb.status.qFind +// 'quick' Access row by row id. No bounds checking in release. +inline lib_http::FStatus& lib_http::status_qFind(u64 t) { + return reinterpret_cast(_db.status_data)[u64(t)]; +} + +// --- lib_http.FDb.status.rowid_Get +// Compute row id of element given element's address +inline u64 lib_http::status_rowid_Get(lib_http::FStatus &row) { + u64 ret = u64(&row - reinterpret_cast(_db.status_data)); + return u64(ret); +} + +// --- lib_http.FDb.status_curs.Reset +// cursor points to valid item +inline void lib_http::_db_status_curs_Reset(_db_status_curs &curs, lib_http::FDb &parent) { + curs.parent = &parent; + curs.index = 0; +} + +// --- lib_http.FDb.status_curs.ValidQ +// cursor points to valid item +inline bool lib_http::_db_status_curs_ValidQ(_db_status_curs &curs) { + return u64(curs.index) < u64(curs.parent->status_n); +} + +// --- lib_http.FDb.status_curs.Next +// proceed to next item +inline void lib_http::_db_status_curs_Next(_db_status_curs &curs) { + curs.index++; +} + +// --- lib_http.FDb.status_curs.Access +// item access +inline lib_http::FStatus& lib_http::_db_status_curs_Access(_db_status_curs &curs) { + return status_qFind(u64(curs.index)); +} + +// --- lib_http.FieldId.value.GetEnum +// Get value of field as enum type +inline lib_http_FieldIdEnum lib_http::value_GetEnum(const lib_http::FieldId& parent) { + return lib_http_FieldIdEnum(parent.value); +} + +// --- lib_http.FieldId.value.SetEnum +// Set value of field from enum type. +inline void lib_http::value_SetEnum(lib_http::FieldId& parent, lib_http_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- lib_http.FieldId.value.Cast +inline lib_http::FieldId::operator lib_http_FieldIdEnum() const { + return lib_http_FieldIdEnum((*this).value); +} + +// --- lib_http.FieldId..Init +// Set all fields to initial values. +inline void lib_http::FieldId_Init(lib_http::FieldId& parent) { + parent.value = i32(-1); +} + +// --- lib_http.FieldId..Ctor +inline lib_http::FieldId::FieldId() { + lib_http::FieldId_Init(*this); +} + +// --- lib_http.FieldId..FieldwiseCtor +inline lib_http::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- lib_http.FieldId..EnumCtor +inline lib_http::FieldId::FieldId(lib_http_FieldIdEnum arg) { + this->value = i32(arg); +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const lib_http::trace &row) {// cfmt:lib_http.trace.String + lib_http::trace_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const lib_http::FieldId &row) {// cfmt:lib_http.FieldId.String + lib_http::FieldId_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/lib_json_gen.h b/include/gen/lib_json_gen.h index 5ee1b8f2..b5597d69 100644 --- a/include/gen/lib_json_gen.h +++ b/include/gen/lib_json_gen.h @@ -224,6 +224,9 @@ void ind_objfld_Remove(lib_json::FNode& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:lib_json.FDb.ind_objfld.Reserve void ind_objfld_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_json.FDb.ind_objfld.AbsReserve +void ind_objfld_AbsReserve(int n) __attribute__((nothrow)); // func:lib_json.FDb.JsonNumChar.Match inline bool JsonNumCharQ(u32 ch) __attribute__((nothrow)); @@ -239,8 +242,8 @@ void FDb_Uninit() __attribute__((nothrow)); // --- lib_json.FldKey struct FldKey { // lib_json.FldKey - lib_json::FNode* object; // optional pointer - algo::strptr field; // + lib_json::FNode* p_object; // reference to parent row + algo::strptr field; // // func:lib_json.FldKey..EqOp inline bool operator ==(const lib_json::FldKey &rhs) const __attribute__((nothrow)); // func:lib_json.FldKey..NeOp @@ -256,7 +259,7 @@ struct FldKey { // lib_json.FldKey // func:lib_json.FldKey..Ctor inline FldKey() __attribute__((nothrow)); // func:lib_json.FldKey..FieldwiseCtor - explicit inline FldKey(lib_json::FNode* in_object, algo::strptr in_field) __attribute__((nothrow)); + explicit inline FldKey(lib_json::FNode* in_p_object, algo::strptr in_field) __attribute__((nothrow)); }; // func:lib_json.FldKey..Hash @@ -285,10 +288,11 @@ void FldKey_Print(lib_json::FldKey& row, algo::cstring& str) __a // access: lib_json.FNode.c_child (Ptrary) // access: lib_json.FParser.node (Ptr) // access: lib_json.FParser.root_node (Ptr) -// access: lib_json.FldKey.object (Ptr) +// access: lib_json.FldKey.p_object (Upptr) struct FNode { // lib_json.FNode lib_json::FNode* node_next; // Pointer to next free element int tpool lib_json::FNode* ind_objfld_next; // hash next + u32 ind_objfld_hashval; // hash value lib_json::FNode* p_parent; // reference to parent row lib_json::FNode** c_child_elems; // array of pointers u32 c_child_n; // array of pointers diff --git a/include/gen/lib_json_gen.inl.h b/include/gen/lib_json_gen.inl.h index 7bc288fc..72d9df16 100644 --- a/include/gen/lib_json_gen.inl.h +++ b/include/gen/lib_json_gen.inl.h @@ -71,7 +71,7 @@ inline bool lib_json::JsonFirstNumCharQ(u32 ch) { // --- lib_json.FldKey..Hash inline u32 lib_json::FldKey_Hash(u32 prev, const lib_json::FldKey& rhs) { - prev = u64_Hash(prev, u64(rhs.object)); + prev = u64_Hash(prev, u64(rhs.p_object)); prev = strptr_Hash(prev, rhs.field); return prev; } @@ -114,7 +114,7 @@ inline bool lib_json::FldKey_Lt(lib_json::FldKey& lhs, lib_json::FldKey& rhs) { // --- lib_json.FldKey..Cmp inline i32 lib_json::FldKey_Cmp(lib_json::FldKey& lhs, lib_json::FldKey& rhs) { i32 retval = 0; - retval = u64_Cmp((u64)(void*)lhs.object, (u64)(void*)rhs.object); + retval = u64_Cmp((u64)(void*)lhs.p_object, (u64)(void*)rhs.p_object); if (retval != 0) { return retval; } @@ -125,13 +125,13 @@ inline i32 lib_json::FldKey_Cmp(lib_json::FldKey& lhs, lib_json::FldKey& rhs) { // --- lib_json.FldKey..Init // Set all fields to initial values. inline void lib_json::FldKey_Init(lib_json::FldKey& parent) { - parent.object = NULL; + parent.p_object = NULL; } // --- lib_json.FldKey..Eq inline bool lib_json::FldKey_Eq(lib_json::FldKey& lhs, lib_json::FldKey& rhs) { bool retval = true; - retval = u64_Eq((u64)(void*)lhs.object, (u64)(void*)rhs.object); + retval = u64_Eq((u64)(void*)lhs.p_object, (u64)(void*)rhs.p_object); if (!retval) { return false; } @@ -155,8 +155,8 @@ inline lib_json::FldKey::FldKey() { } // --- lib_json.FldKey..FieldwiseCtor -inline lib_json::FldKey::FldKey(lib_json::FNode* in_object, algo::strptr in_field) - : object(in_object) +inline lib_json::FldKey::FldKey(lib_json::FNode* in_p_object, algo::strptr in_field) + : p_object(in_p_object) , field(in_field) { } @@ -242,6 +242,7 @@ inline void lib_json::FNode_Init(lib_json::FNode& node) { node.node_c_child_in_ary = bool(false); node.node_next = (lib_json::FNode*)-1; // (lib_json.FDb.node) not-in-tpool's freelist node.ind_objfld_next = (lib_json::FNode*)-1; // (lib_json.FDb.ind_objfld) not-in-hash + node.ind_objfld_hashval = 0; // stored hash value } // --- lib_json.FNode.c_child_curs.Reset diff --git a/include/gen/lib_netio_gen.h b/include/gen/lib_netio_gen.h new file mode 100644 index 00000000..16f2e683 --- /dev/null +++ b/include/gen/lib_netio_gen.h @@ -0,0 +1,288 @@ +// +// include/gen/lib_netio_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- lib_netio_FieldIdEnum + +enum lib_netio_FieldIdEnum { // lib_netio.FieldId.value + lib_netio_FieldId_value = 0 +}; + +enum { lib_netio_FieldIdEnum_N = 1 }; + +namespace lib_netio { // gen:ns_pkeytypedef +} // gen:ns_pkeytypedef +namespace lib_netio { // gen:ns_tclass_field +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace lib_netio { struct _db_var_curs; } +namespace lib_netio { struct trace; } +namespace lib_netio { struct FDb; } +namespace lib_netio { struct FVar; } +namespace lib_netio { struct FieldId; } +namespace lib_netio { extern struct lib_netio::FDb _db; } +namespace lib_netio { // gen:ns_print_struct + +// --- lib_netio.trace +#pragma pack(push,1) +struct trace { // lib_netio.trace + // func:lib_netio.trace..Ctor + inline trace() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// print string representation of ROW to string STR +// cfmt:lib_netio.trace.String printfmt:Tuple +// func:lib_netio.trace..Print +void trace_Print(lib_netio::trace& row, algo::cstring& str) __attribute__((nothrow)); + +// --- lib_netio.FDb +// create: lib_netio.FDb._db (Global) +struct FDb { // lib_netio.FDb + lib_netio::FVar* var_lary[32]; // level array + i32 var_n; // number of elements in array + lib_netio::FVar** ind_var_buckets_elems; // pointer to bucket array + i32 ind_var_buckets_n; // number of elements in bucket array + i32 ind_var_n; // number of elements in the hash table + lib_netio::trace trace; // +}; + +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +// func:lib_netio.FDb._db.InsertStrptrMaybe +bool InsertStrptrMaybe(algo::strptr str); +// Load all finputs from given directory. +// func:lib_netio.FDb._db.LoadTuplesMaybe +bool LoadTuplesMaybe(algo::strptr root, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +// func:lib_netio.FDb._db.LoadTuplesFile +bool LoadTuplesFile(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file descriptor. +// func:lib_netio.FDb._db.LoadTuplesFd +bool LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load specified ssimfile. +// func:lib_netio.FDb._db.LoadSsimfileMaybe +bool LoadSsimfileMaybe(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Calls Step function of dependencies +// func:lib_netio.FDb._db.Steps +void Steps(); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:lib_netio.FDb._db.XrefMaybe +bool _db_XrefMaybe(); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:lib_netio.FDb.var.Alloc +lib_netio::FVar& var_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:lib_netio.FDb.var.AllocMaybe +lib_netio::FVar* var_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:lib_netio.FDb.var.AllocMem +void* var_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:lib_netio.FDb.var.EmptyQ +inline bool var_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:lib_netio.FDb.var.Find +inline lib_netio::FVar* var_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:lib_netio.FDb.var.Last +inline lib_netio::FVar* var_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:lib_netio.FDb.var.N +inline i32 var_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:lib_netio.FDb.var.RemoveAll +void var_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:lib_netio.FDb.var.RemoveLast +void var_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:lib_netio.FDb.var.qFind +inline lib_netio::FVar& var_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:lib_netio.FDb.var.XrefMaybe +bool var_XrefMaybe(lib_netio::FVar &row); + +// Return true if hash is empty +// func:lib_netio.FDb.ind_var.EmptyQ +inline bool ind_var_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:lib_netio.FDb.ind_var.Find +lib_netio::FVar* ind_var_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:lib_netio.FDb.ind_var.FindX +lib_netio::FVar& ind_var_FindX(const algo::strptr& key); +// Find row by key. If not found, create and x-reference a new row with with this key. +// func:lib_netio.FDb.ind_var.GetOrCreate +lib_netio::FVar& ind_var_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); +// Return number of items in the hash +// func:lib_netio.FDb.ind_var.N +inline i32 ind_var_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:lib_netio.FDb.ind_var.InsertMaybe +bool ind_var_InsertMaybe(lib_netio::FVar& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:lib_netio.FDb.ind_var.Remove +void ind_var_Remove(lib_netio::FVar& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:lib_netio.FDb.ind_var.Reserve +void ind_var_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_netio.FDb.ind_var.AbsReserve +void ind_var_AbsReserve(int n) __attribute__((nothrow)); + +// cursor points to valid item +// func:lib_netio.FDb.var_curs.Reset +inline void _db_var_curs_Reset(_db_var_curs &curs, lib_netio::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:lib_netio.FDb.var_curs.ValidQ +inline bool _db_var_curs_ValidQ(_db_var_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:lib_netio.FDb.var_curs.Next +inline void _db_var_curs_Next(_db_var_curs &curs) __attribute__((nothrow)); +// item access +// func:lib_netio.FDb.var_curs.Access +inline lib_netio::FVar& _db_var_curs_Access(_db_var_curs &curs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:lib_netio.FDb..Init +void FDb_Init(); +// func:lib_netio.FDb..Uninit +void FDb_Uninit() __attribute__((nothrow)); + +// --- lib_netio.FVar +// create: lib_netio.FDb.var (Lary) +// global access: var (Lary, by rowid) +// global access: ind_var (Thash, hash field var) +struct FVar { // lib_netio.FVar + lib_netio::FVar* ind_var_next; // hash next + u32 ind_var_hashval; // hash value + algo::cstring var; // + algo::cstring value; // + // func:lib_netio.FVar..AssignOp + inline lib_netio::FVar& operator =(const lib_netio::FVar &rhs) = delete; + // func:lib_netio.FVar..CopyCtor + inline FVar(const lib_netio::FVar &rhs) = delete; +private: + // func:lib_netio.FVar..Ctor + inline FVar() __attribute__((nothrow)); + // func:lib_netio.FVar..Dtor + inline ~FVar() __attribute__((nothrow)); + friend lib_netio::FVar& var_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_netio::FVar* var_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void var_RemoveAll() __attribute__((nothrow)); + friend void var_RemoveLast() __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:lib_netio.FVar..Init +inline void FVar_Init(lib_netio::FVar& var); +// func:lib_netio.FVar..Uninit +void FVar_Uninit(lib_netio::FVar& var) __attribute__((nothrow)); + +// --- lib_netio.FieldId +#pragma pack(push,1) +struct FieldId { // lib_netio.FieldId: Field read helper + i32 value; // -1 + // func:lib_netio.FieldId.value.Cast + inline operator lib_netio_FieldIdEnum() const __attribute__((nothrow)); + // func:lib_netio.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:lib_netio.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:lib_netio.FieldId..EnumCtor + inline FieldId(lib_netio_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:lib_netio.FieldId.value.GetEnum +inline lib_netio_FieldIdEnum value_GetEnum(const lib_netio::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:lib_netio.FieldId.value.SetEnum +inline void value_SetEnum(lib_netio::FieldId& parent, lib_netio_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:lib_netio.FieldId.value.ToCstr +const char* value_ToCstr(const lib_netio::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:lib_netio.FieldId.value.Print +void value_Print(const lib_netio::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:lib_netio.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(lib_netio::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:lib_netio.FieldId.value.SetStrptr +void value_SetStrptr(lib_netio::FieldId& parent, algo::strptr rhs, lib_netio_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:lib_netio.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(lib_netio::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of lib_netio::FieldId from an ascii string. +// The format of the string is the format of the lib_netio::FieldId's only field +// func:lib_netio.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(lib_netio::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:lib_netio.FieldId..Init +inline void FieldId_Init(lib_netio::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:lib_netio.FieldId.String printfmt:Raw +// func:lib_netio.FieldId..Print +void FieldId_Print(lib_netio::FieldId& row, algo::cstring& str) __attribute__((nothrow)); +} // gen:ns_print_struct +namespace lib_netio { // gen:ns_curstext + +struct _db_var_curs {// cursor + typedef lib_netio::FVar ChildType; + lib_netio::FDb *parent; + i64 index; + _db_var_curs(){ parent=NULL; index=0; } +}; + +} // gen:ns_curstext +namespace lib_netio { // gen:ns_func +// func:lib_netio...StaticCheck +void StaticCheck(); +} // gen:ns_func +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const lib_netio::trace &row);// cfmt:lib_netio.trace.String +inline algo::cstring &operator <<(algo::cstring &str, const lib_netio::FieldId &row);// cfmt:lib_netio.FieldId.String +} diff --git a/include/gen/lib_netio_gen.inl.h b/include/gen/lib_netio_gen.inl.h new file mode 100644 index 00000000..ee414208 --- /dev/null +++ b/include/gen/lib_netio_gen.inl.h @@ -0,0 +1,176 @@ +// +// include/gen/lib_netio_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude + +// --- lib_netio.trace..Ctor +inline lib_netio::trace::trace() { +} + +// --- lib_netio.FDb.var.EmptyQ +// Return true if index is empty +inline bool lib_netio::var_EmptyQ() { + return _db.var_n == 0; +} + +// --- lib_netio.FDb.var.Find +// Look up row by row id. Return NULL if out of range +inline lib_netio::FVar* lib_netio::var_Find(u64 t) { + lib_netio::FVar *retval = NULL; + if (LIKELY(u64(t) < u64(_db.var_n))) { + u64 x = t + 1; + u64 bsr = algo::u64_BitScanReverse(x); + u64 base = u64(1)<value = i32(arg); +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const lib_netio::trace &row) {// cfmt:lib_netio.trace.String + lib_netio::trace_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const lib_netio::FieldId &row) {// cfmt:lib_netio.FieldId.String + lib_netio::FieldId_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/lib_rl_gen.h b/include/gen/lib_rl_gen.h new file mode 100644 index 00000000..a10ccbe4 --- /dev/null +++ b/include/gen/lib_rl_gen.h @@ -0,0 +1,196 @@ +// +// include/gen/lib_rl_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.h" +#include "include/gen/algo_lib_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- lib_rl_FieldIdEnum + +enum lib_rl_FieldIdEnum { // lib_rl.FieldId.value + lib_rl_FieldId_value = 0 +}; + +enum { lib_rl_FieldIdEnum_N = 1 }; + +namespace lib_rl { // gen:ns_pkeytypedef +} // gen:ns_pkeytypedef +namespace lib_rl { // gen:ns_tclass_field +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace lib_rl { struct Cmdline; } +namespace lib_rl { struct trace; } +namespace lib_rl { struct FDb; } +namespace lib_rl { struct FieldId; } +namespace lib_rl { extern struct lib_rl::FDb _db; } +namespace lib_rl { // gen:ns_print_struct + +// --- lib_rl.Cmdline +struct Cmdline { // lib_rl.Cmdline + algo::cstring app; // "" Application name + algo::cstring prompt; // "" Application name + bool add_history; // true Automatically add to history + i32 max_history; // 1000 Number to history entries to keep + // func:lib_rl.Cmdline..Ctor + inline Cmdline() __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:lib_rl.Cmdline..Init +inline void Cmdline_Init(lib_rl::Cmdline& parent); + +// --- lib_rl.trace +#pragma pack(push,1) +struct trace { // lib_rl.trace + // func:lib_rl.trace..Ctor + inline trace() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// print string representation of ROW to string STR +// cfmt:lib_rl.trace.String printfmt:Tuple +// func:lib_rl.trace..Print +void trace_Print(lib_rl::trace& row, algo::cstring& str) __attribute__((nothrow)); + +// --- lib_rl.FDb +// create: lib_rl.FDb._db (Global) +struct FDb { // lib_rl.FDb + lib_rl::Cmdline cmdline; // + algo::PrlogFcn Prlog; // + algo::cstring history_file; // + algo_lib::FIohook iohook; // + algo::cstring line; // + bool line_valid; // false + bool eof; // false + i32 err; // 0 + bool isatty; // false + lib_rl::trace trace; // +}; + +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +// func:lib_rl.FDb._db.InsertStrptrMaybe +bool InsertStrptrMaybe(algo::strptr str); +// Load all finputs from given directory. +// func:lib_rl.FDb._db.LoadTuplesMaybe +bool LoadTuplesMaybe(algo::strptr root, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +// func:lib_rl.FDb._db.LoadTuplesFile +bool LoadTuplesFile(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file descriptor. +// func:lib_rl.FDb._db.LoadTuplesFd +bool LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load specified ssimfile. +// func:lib_rl.FDb._db.LoadSsimfileMaybe +bool LoadSsimfileMaybe(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Calls Step function of dependencies +// func:lib_rl.FDb._db.Steps +void Steps(); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:lib_rl.FDb._db.XrefMaybe +bool _db_XrefMaybe(); + +// Declaration for user-defined cleanup function +// User-defined cleanup function invoked for field iohook of lib_rl::FDb +// func:lib_rl.FDb.iohook.Cleanup +// this function is 'extrn' and implemented by user +void iohook_Cleanup() __attribute__((nothrow)); + +// Set all fields to initial values. +// func:lib_rl.FDb..Init +void FDb_Init(); +// func:lib_rl.FDb..Uninit +void FDb_Uninit() __attribute__((nothrow)); + +// --- lib_rl.FieldId +#pragma pack(push,1) +struct FieldId { // lib_rl.FieldId: Field read helper + i32 value; // -1 + // func:lib_rl.FieldId.value.Cast + inline operator lib_rl_FieldIdEnum() const __attribute__((nothrow)); + // func:lib_rl.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:lib_rl.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:lib_rl.FieldId..EnumCtor + inline FieldId(lib_rl_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:lib_rl.FieldId.value.GetEnum +inline lib_rl_FieldIdEnum value_GetEnum(const lib_rl::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:lib_rl.FieldId.value.SetEnum +inline void value_SetEnum(lib_rl::FieldId& parent, lib_rl_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:lib_rl.FieldId.value.ToCstr +const char* value_ToCstr(const lib_rl::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:lib_rl.FieldId.value.Print +void value_Print(const lib_rl::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:lib_rl.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(lib_rl::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:lib_rl.FieldId.value.SetStrptr +void value_SetStrptr(lib_rl::FieldId& parent, algo::strptr rhs, lib_rl_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:lib_rl.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(lib_rl::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of lib_rl::FieldId from an ascii string. +// The format of the string is the format of the lib_rl::FieldId's only field +// func:lib_rl.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(lib_rl::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:lib_rl.FieldId..Init +inline void FieldId_Init(lib_rl::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:lib_rl.FieldId.String printfmt:Raw +// func:lib_rl.FieldId..Print +void FieldId_Print(lib_rl::FieldId& row, algo::cstring& str) __attribute__((nothrow)); +} // gen:ns_print_struct +namespace lib_rl { // gen:ns_func +// func:lib_rl...StaticCheck +void StaticCheck(); +} // gen:ns_func +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const lib_rl::trace &row);// cfmt:lib_rl.trace.String +inline algo::cstring &operator <<(algo::cstring &str, const lib_rl::FieldId &row);// cfmt:lib_rl.FieldId.String +} diff --git a/include/gen/lib_rl_gen.inl.h b/include/gen/lib_rl_gen.inl.h new file mode 100644 index 00000000..4e101df5 --- /dev/null +++ b/include/gen/lib_rl_gen.inl.h @@ -0,0 +1,95 @@ +// +// include/gen/lib_rl_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.inl.h" +#include "include/gen/algo_lib_gen.inl.h" +//#pragma endinclude + +// --- lib_rl.Cmdline..Init +// Set all fields to initial values. +inline void lib_rl::Cmdline_Init(lib_rl::Cmdline& parent) { + parent.app = algo::strptr(""); + parent.prompt = algo::strptr(""); + parent.add_history = bool(true); + parent.max_history = i32(1000); +} + +// --- lib_rl.Cmdline..Ctor +inline lib_rl::Cmdline::Cmdline() { + lib_rl::Cmdline_Init(*this); +} + +// --- lib_rl.trace..Ctor +inline lib_rl::trace::trace() { +} + +// --- lib_rl.FieldId.value.GetEnum +// Get value of field as enum type +inline lib_rl_FieldIdEnum lib_rl::value_GetEnum(const lib_rl::FieldId& parent) { + return lib_rl_FieldIdEnum(parent.value); +} + +// --- lib_rl.FieldId.value.SetEnum +// Set value of field from enum type. +inline void lib_rl::value_SetEnum(lib_rl::FieldId& parent, lib_rl_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- lib_rl.FieldId.value.Cast +inline lib_rl::FieldId::operator lib_rl_FieldIdEnum() const { + return lib_rl_FieldIdEnum((*this).value); +} + +// --- lib_rl.FieldId..Init +// Set all fields to initial values. +inline void lib_rl::FieldId_Init(lib_rl::FieldId& parent) { + parent.value = i32(-1); +} + +// --- lib_rl.FieldId..Ctor +inline lib_rl::FieldId::FieldId() { + lib_rl::FieldId_Init(*this); +} + +// --- lib_rl.FieldId..FieldwiseCtor +inline lib_rl::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- lib_rl.FieldId..EnumCtor +inline lib_rl::FieldId::FieldId(lib_rl_FieldIdEnum arg) { + this->value = i32(arg); +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const lib_rl::trace &row) {// cfmt:lib_rl.trace.String + lib_rl::trace_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const lib_rl::FieldId &row) {// cfmt:lib_rl.FieldId.String + lib_rl::FieldId_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/lib_sql_gen.h b/include/gen/lib_sql_gen.h index a92d3508..043ce3f2 100644 --- a/include/gen/lib_sql_gen.h +++ b/include/gen/lib_sql_gen.h @@ -53,9 +53,10 @@ namespace lib_sql { // gen:ns_print_struct // global access: attr (Lary, by rowid) // global access: ind_attr (Thash, hash field attr) struct FAttr { // lib_sql.FAttr - algo::cstring attr; // - bool isbool; // false - lib_sql::FAttr* ind_attr_next; // hash next + algo::cstring attr; // + bool isbool; // false + lib_sql::FAttr* ind_attr_next; // hash next + u32 ind_attr_hashval; // hash value // func:lib_sql.FAttr..AssignOp inline lib_sql::FAttr& operator =(const lib_sql::FAttr &rhs) = delete; // func:lib_sql.FAttr..CopyCtor @@ -190,6 +191,9 @@ void ind_attr_Remove(lib_sql::FAttr& row) __attribute__((nothrow // Reserve enough room in the hash for N more elements. Return success code. // func:lib_sql.FDb.ind_attr.Reserve void ind_attr_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_sql.FDb.ind_attr.AbsReserve +void ind_attr_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:lib_sql.FDb.attr_curs.Reset diff --git a/include/gen/lib_sql_gen.inl.h b/include/gen/lib_sql_gen.inl.h index daf7b291..f35c771f 100644 --- a/include/gen/lib_sql_gen.inl.h +++ b/include/gen/lib_sql_gen.inl.h @@ -31,6 +31,7 @@ inline void lib_sql::FAttr_Init(lib_sql::FAttr& attr) { attr.isbool = bool(false); attr.ind_attr_next = (lib_sql::FAttr*)-1; // (lib_sql.FDb.ind_attr) not-in-hash + attr.ind_attr_hashval = 0; // stored hash value } // --- lib_sql.FAttr..Ctor diff --git a/include/gen/lib_sqlite_gen.h b/include/gen/lib_sqlite_gen.h index f42b4e65..e7d419ad 100644 --- a/include/gen/lib_sqlite_gen.h +++ b/include/gen/lib_sqlite_gen.h @@ -24,6 +24,7 @@ #pragma once #include "extern/sqlite-3500400/sqlite3.h" +#include #include "include/gen/algo_gen.h" #include "include/gen/dmmeta_gen.h" //#pragma endinclude @@ -116,10 +117,11 @@ inline void Cons_Init(lib_sqlite::Cons& parent); // create: lib_sqlite.FDb.conn (Tpool) // global access: ind_conn (Thash, hash field name) struct FConn { // lib_sqlite.FConn - algo::cstring name; // - sqlite3* db; // optional pointer - lib_sqlite::FConn* conn_next; // Pointer to next free element int tpool - lib_sqlite::FConn* ind_conn_next; // hash next + algo::cstring name; // + sqlite3* db; // optional pointer + lib_sqlite::FConn* conn_next; // Pointer to next free element int tpool + lib_sqlite::FConn* ind_conn_next; // hash next + u32 ind_conn_hashval; // hash value // user-defined fcleanup on lib_sqlite.FConn.db prevents copy // func:lib_sqlite.FConn..AssignOp inline lib_sqlite::FConn& operator =(const lib_sqlite::FConn &rhs) = delete; @@ -179,6 +181,7 @@ struct FCtype { // lib_sqlite.FCtype u32 c_row_n; // array of pointers u32 c_row_max; // capacity of allocated array lib_sqlite::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // reftype Ptrary of lib_sqlite.FCtype.c_field prohibits copy // x-reference on lib_sqlite.FCtype.c_sqltype prevents copy // reftype Thash of lib_sqlite.FCtype.ind_field_name prohibits copy @@ -289,6 +292,9 @@ void ind_field_name_Remove(lib_sqlite::FCtype& ctype, lib_sqlite // Reserve enough room in the hash for N more elements. Return success code. // func:lib_sqlite.FCtype.ind_field_name.Reserve void ind_field_name_Reserve(lib_sqlite::FCtype& ctype, int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_sqlite.FCtype.ind_field_name.AbsReserve +void ind_field_name_AbsReserve(lib_sqlite::FCtype& ctype, int n) __attribute__((nothrow)); // Insert row into pointer index. Return final membership status. // func:lib_sqlite.FCtype.c_ssimfile.InsertMaybe @@ -305,7 +311,7 @@ inline bool zd_row_EmptyQ(lib_sqlite::FCtype& ctype) __attribute__((__w inline lib_sqlite::FRow* zd_row_First(lib_sqlite::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:lib_sqlite.FCtype.zd_row.InLlistQ -inline bool zd_row_InLlistQ(lib_sqlite::FRow& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool ctype_zd_row_InLlistQ(lib_sqlite::FRow& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:lib_sqlite.FCtype.zd_row.Insert void zd_row_Insert(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& row) __attribute__((nothrow)); @@ -317,10 +323,10 @@ inline lib_sqlite::FRow* zd_row_Last(lib_sqlite::FCtype& ctype) __attribute__((_ inline i32 zd_row_N(const lib_sqlite::FCtype& ctype) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:lib_sqlite.FCtype.zd_row.Next -inline lib_sqlite::FRow* zd_row_Next(lib_sqlite::FRow &row) __attribute__((__warn_unused_result__, nothrow)); +inline lib_sqlite::FRow* ctype_zd_row_Next(lib_sqlite::FRow &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:lib_sqlite.FCtype.zd_row.Prev -inline lib_sqlite::FRow* zd_row_Prev(lib_sqlite::FRow &row) __attribute__((__warn_unused_result__, nothrow)); +inline lib_sqlite::FRow* ctype_zd_row_Prev(lib_sqlite::FRow &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:lib_sqlite.FCtype.zd_row.Remove void zd_row_Remove(lib_sqlite::FCtype& ctype, lib_sqlite::FRow& row) __attribute__((nothrow)); @@ -355,6 +361,9 @@ void ind_pkey_Remove(lib_sqlite::FCtype& ctype, lib_sqlite::FRow // Reserve enough room in the hash for N more elements. Return success code. // func:lib_sqlite.FCtype.ind_pkey.Reserve void ind_pkey_Reserve(lib_sqlite::FCtype& ctype, int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_sqlite.FCtype.ind_pkey.AbsReserve +void ind_pkey_AbsReserve(lib_sqlite::FCtype& ctype, int n) __attribute__((nothrow)); // Return true if index is empty // func:lib_sqlite.FCtype.c_row.EmptyQ @@ -572,6 +581,9 @@ void ind_conn_Remove(lib_sqlite::FConn& row) __attribute__((noth // Reserve enough room in the hash for N more elements. Return success code. // func:lib_sqlite.FDb.ind_conn.Reserve void ind_conn_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_sqlite.FDb.ind_conn.AbsReserve +void ind_conn_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -674,6 +686,9 @@ void ind_field_Remove(lib_sqlite::FField& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:lib_sqlite.FDb.ind_field.Reserve void ind_field_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_sqlite.FDb.ind_field.AbsReserve +void ind_field_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -739,6 +754,9 @@ void ind_ctype_Remove(lib_sqlite::FCtype& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:lib_sqlite.FDb.ind_ctype.Reserve void ind_ctype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_sqlite.FDb.ind_ctype.AbsReserve +void ind_ctype_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -801,6 +819,9 @@ void ind_ssimfile_Remove(lib_sqlite::FSsimfile& row) __attribute // Reserve enough room in the hash for N more elements. Return success code. // func:lib_sqlite.FDb.ind_ssimfile.Reserve void ind_ssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_sqlite.FDb.ind_ssimfile.AbsReserve +void ind_ssimfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -858,6 +879,11 @@ lib_sqlite::FIdx& bestidx_AllocAt(int at) __attribute__((__warn_unused_result // Reserve space. Insert N elements at the end of the array, return pointer to array // func:lib_sqlite.FDb.bestidx.AllocN algo::aryptr bestidx_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:lib_sqlite.FDb.bestidx.AllocNAt +algo::aryptr bestidx_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:lib_sqlite.FDb.bestidx.EmptyQ inline bool bestidx_EmptyQ() __attribute__((nothrow)); @@ -902,6 +928,10 @@ inline u64 bestidx_rowid_Get(lib_sqlite::FIdx &elem) __attribute__((no // Reserve space. Insert N elements at the end of the array, return pointer to array // func:lib_sqlite.FDb.bestidx.AllocNVal algo::aryptr bestidx_AllocNVal(int n_elems, const lib_sqlite::FIdx& val) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:lib_sqlite.FDb.bestidx.Insary +void bestidx_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -1003,6 +1033,9 @@ void ind_ns_Remove(lib_sqlite::FNs& row) __attribute__((nothrow) // Reserve enough room in the hash for N more elements. Return success code. // func:lib_sqlite.FDb.ind_ns.Reserve void ind_ns_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:lib_sqlite.FDb.ind_ns.AbsReserve +void ind_ns_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:lib_sqlite.FDb.substr_curs.Reset @@ -1114,18 +1147,20 @@ void FDb_Uninit() __attribute__((nothrow)); // access: lib_sqlite.FCtype.ind_field_name (Thash) // access: lib_sqlite.FSubstr.p_srcfield (Upptr) struct FField { // lib_sqlite.FField - lib_sqlite::FField* ind_field_name_next; // hash next - lib_sqlite::FField* ind_field_next; // hash next - algo::Smallstr100 field; // Primary key, as ctype.name - algo::Smallstr100 arg; // Type of field - algo::Smallstr50 reftype; // "Val" Type constructor - algo::CppExpr dflt; // Default value (c++ expression) - algo::Comment comment; // - lib_sqlite::FSubstr* c_substr; // optional pointer - lib_sqlite::FCtype* p_arg; // reference to parent row - lib_sqlite::FCtype* p_ctype; // reference to parent row - u32 id; // 0 - bool ctype_c_field_in_ary; // false membership flag + lib_sqlite::FField* ctype_ind_field_name_next; // hash next + u32 ctype_ind_field_name_hashval; // hash value + lib_sqlite::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value + algo::Smallstr100 field; // Primary key, as ctype.name + algo::Smallstr100 arg; // Type of field + algo::Smallstr50 reftype; // "Val" Type constructor + algo::CppExpr dflt; // Default value (c++ expression) + algo::Comment comment; // + lib_sqlite::FSubstr* c_substr; // optional pointer + lib_sqlite::FCtype* p_arg; // reference to parent row + lib_sqlite::FCtype* p_ctype; // reference to parent row + u32 id; // 0 + bool ctype_c_field_in_ary; // false membership flag // x-reference on lib_sqlite.FField.c_substr prevents copy // x-reference on lib_sqlite.FField.p_arg prevents copy // x-reference on lib_sqlite.FField.p_ctype prevents copy @@ -1210,6 +1245,11 @@ lib_sqlite::Cons& cons_AllocAt(lib_sqlite::FIdx& parent, int at) __attribute_ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:lib_sqlite.FIdx.cons.AllocN algo::aryptr cons_AllocN(lib_sqlite::FIdx& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:lib_sqlite.FIdx.cons.AllocNAt +algo::aryptr cons_AllocNAt(lib_sqlite::FIdx& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:lib_sqlite.FIdx.cons.EmptyQ inline bool cons_EmptyQ(lib_sqlite::FIdx& parent) __attribute__((nothrow)); @@ -1261,6 +1301,10 @@ inline u64 cons_rowid_Get(lib_sqlite::FIdx& parent, lib_sqlite::Cons & // Reserve space. Insert N elements at the end of the array, return pointer to array // func:lib_sqlite.FIdx.cons.AllocNVal algo::aryptr cons_AllocNVal(lib_sqlite::FIdx& parent, int n_elems, const lib_sqlite::Cons& val) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:lib_sqlite.FIdx.cons.Insary +void cons_Insary(lib_sqlite::FIdx& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:lib_sqlite.FIdx.cons_curs.Next @@ -1286,6 +1330,7 @@ void FIdx_Uninit(lib_sqlite::FIdx& parent) __attribute__((nothro // access: lib_sqlite.FSsimfile.p_ns (Upptr) struct FNs { // lib_sqlite.FNs lib_sqlite::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value algo::Smallstr16 ns; // Namespace name (primary key) algo::Smallstr50 nstype; // Namespace type algo::Smallstr50 license; // Associated license @@ -1382,14 +1427,15 @@ void FNs_Uninit(lib_sqlite::FNs& ns) __attribute__((nothrow)); // access: lib_sqlite.FCtype.c_row (Ptrary) // access: lib_sqlite.VtabCurs.c_row (Ptr) struct FRow { // lib_sqlite.FRow - lib_sqlite::FRow* zd_row_next; // zslist link; -1 means not-in-list - lib_sqlite::FRow* zd_row_prev; // previous element - lib_sqlite::FRow* ind_pkey_next; // hash next - algo::cstring pkey; // - algo::Tuple tuple; // - lib_sqlite::FCtype* p_ctype; // reference to parent row - i64 rowid; // 0 - bool ctype_c_row_in_ary; // false membership flag + lib_sqlite::FRow* ctype_zd_row_next; // zslist link; -1 means not-in-list + lib_sqlite::FRow* ctype_zd_row_prev; // previous element + lib_sqlite::FRow* ctype_ind_pkey_next; // hash next + u32 ctype_ind_pkey_hashval; // hash value + algo::cstring pkey; // + algo::Tuple tuple; // + lib_sqlite::FCtype* p_ctype; // reference to parent row + i64 rowid; // 0 + bool ctype_c_row_in_ary; // false membership flag // func:lib_sqlite.FRow..AssignOp inline lib_sqlite::FRow& operator =(const lib_sqlite::FRow &rhs) = delete; // func:lib_sqlite.FRow..CopyCtor @@ -1452,6 +1498,7 @@ void FSqltype_Uninit(lib_sqlite::FSqltype& sqltype) __attribute_ // access: lib_sqlite.FNs.c_ssimfile (Ptrary) struct FSsimfile { // lib_sqlite.FSsimfile lib_sqlite::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value algo::Smallstr50 ssimfile; // algo::Smallstr100 ctype; // lib_sqlite::FCtype* p_ctype; // reference to parent row @@ -1757,6 +1804,11 @@ algo::cstring& attrs_AllocAt(lib_sqlite::VtabCurs& parent, int at) __attri // Reserve space. Insert N elements at the end of the array, return pointer to array // func:lib_sqlite.VtabCurs.attrs.AllocN algo::aryptr attrs_AllocN(lib_sqlite::VtabCurs& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:lib_sqlite.VtabCurs.attrs.AllocNAt +algo::aryptr attrs_AllocNAt(lib_sqlite::VtabCurs& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:lib_sqlite.VtabCurs.attrs.EmptyQ inline bool attrs_EmptyQ(lib_sqlite::VtabCurs& parent) __attribute__((nothrow)); @@ -1813,6 +1865,10 @@ algo::aryptr attrs_AllocNVal(lib_sqlite::VtabCurs& parent, int n_ // Function returns success value. // func:lib_sqlite.VtabCurs.attrs.ReadStrptrMaybe bool attrs_ReadStrptrMaybe(lib_sqlite::VtabCurs& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:lib_sqlite.VtabCurs.attrs.Insary +void attrs_Insary(lib_sqlite::VtabCurs& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:lib_sqlite.VtabCurs.attrs_curs.Next diff --git a/include/gen/lib_sqlite_gen.inl.h b/include/gen/lib_sqlite_gen.inl.h index 94589f9a..025c90a4 100644 --- a/include/gen/lib_sqlite_gen.inl.h +++ b/include/gen/lib_sqlite_gen.inl.h @@ -46,6 +46,7 @@ inline void lib_sqlite::FConn_Init(lib_sqlite::FConn& conn) { conn.db = NULL; conn.conn_next = (lib_sqlite::FConn*)-1; // (lib_sqlite.FDb.conn) not-in-tpool's freelist conn.ind_conn_next = (lib_sqlite::FConn*)-1; // (lib_sqlite.FDb.ind_conn) not-in-hash + conn.ind_conn_hashval = 0; // stored hash value } // --- lib_sqlite.FConn..Ctor @@ -184,9 +185,9 @@ inline lib_sqlite::FRow* lib_sqlite::zd_row_First(lib_sqlite::FCtype& ctype) { // --- lib_sqlite.FCtype.zd_row.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool lib_sqlite::zd_row_InLlistQ(lib_sqlite::FRow& row) { +inline bool lib_sqlite::ctype_zd_row_InLlistQ(lib_sqlite::FRow& row) { bool result = false; - result = !(row.zd_row_next == (lib_sqlite::FRow*)-1); + result = !(row.ctype_zd_row_next == (lib_sqlite::FRow*)-1); return result; } @@ -206,14 +207,14 @@ inline i32 lib_sqlite::zd_row_N(const lib_sqlite::FCtype& ctype) { // --- lib_sqlite.FCtype.zd_row.Next // Return pointer to next element in the list -inline lib_sqlite::FRow* lib_sqlite::zd_row_Next(lib_sqlite::FRow &row) { - return row.zd_row_next; +inline lib_sqlite::FRow* lib_sqlite::ctype_zd_row_Next(lib_sqlite::FRow &row) { + return row.ctype_zd_row_next; } // --- lib_sqlite.FCtype.zd_row.Prev // Return pointer to previous element in the list -inline lib_sqlite::FRow* lib_sqlite::zd_row_Prev(lib_sqlite::FRow &row) { - return row.zd_row_prev; +inline lib_sqlite::FRow* lib_sqlite::ctype_zd_row_Prev(lib_sqlite::FRow &row) { + return row.ctype_zd_row_prev; } // --- lib_sqlite.FCtype.zd_row.qLast @@ -334,7 +335,7 @@ inline bool lib_sqlite::ctype_zd_row_curs_ValidQ(ctype_zd_row_curs &curs) { // --- lib_sqlite.FCtype.zd_row_curs.Next // proceed to next item inline void lib_sqlite::ctype_zd_row_curs_Next(ctype_zd_row_curs &curs) { - lib_sqlite::FRow *next = (*curs.row).zd_row_next; + lib_sqlite::FRow *next = (*curs.row).ctype_zd_row_next; curs.row = next; } @@ -1211,6 +1212,7 @@ inline void lib_sqlite::FNs_Init(lib_sqlite::FNs& ns) { ns.c_ssimfile_n = 0; // (lib_sqlite.FNs.c_ssimfile) ns.c_ssimfile_max = 0; // (lib_sqlite.FNs.c_ssimfile) ns.ind_ns_next = (lib_sqlite::FNs*)-1; // (lib_sqlite.FDb.ind_ns) not-in-hash + ns.ind_ns_hashval = 0; // stored hash value } // --- lib_sqlite.FNs.c_ssimfile_curs.Reset @@ -1254,9 +1256,10 @@ inline void lib_sqlite::FRow_Init(lib_sqlite::FRow& trow) { trow.p_ctype = NULL; trow.rowid = i64(0); trow.ctype_c_row_in_ary = bool(false); - trow.zd_row_next = (lib_sqlite::FRow*)-1; // (lib_sqlite.FCtype.zd_row) not-in-list - trow.zd_row_prev = NULL; // (lib_sqlite.FCtype.zd_row) - trow.ind_pkey_next = (lib_sqlite::FRow*)-1; // (lib_sqlite.FCtype.ind_pkey) not-in-hash + trow.ctype_zd_row_next = (lib_sqlite::FRow*)-1; // (lib_sqlite.FCtype.zd_row) not-in-list + trow.ctype_zd_row_prev = NULL; // (lib_sqlite.FCtype.zd_row) + trow.ctype_ind_pkey_next = (lib_sqlite::FRow*)-1; // (lib_sqlite.FCtype.ind_pkey) not-in-hash + trow.ctype_ind_pkey_hashval = 0; // stored hash value } // --- lib_sqlite.FRow..Ctor @@ -1285,6 +1288,7 @@ inline void lib_sqlite::FSsimfile_Init(lib_sqlite::FSsimfile& ssimfile) { ssimfile.p_ns = NULL; ssimfile.ns_c_ssimfile_in_ary = bool(false); ssimfile.ind_ssimfile_next = (lib_sqlite::FSsimfile*)-1; // (lib_sqlite.FDb.ind_ssimfile) not-in-hash + ssimfile.ind_ssimfile_hashval = 0; // stored hash value } // --- lib_sqlite.FSsimfile..Ctor diff --git a/include/gen/lib_ws_gen.h b/include/gen/lib_ws_gen.h new file mode 100644 index 00000000..4cbe28dc --- /dev/null +++ b/include/gen/lib_ws_gen.h @@ -0,0 +1,386 @@ +// +// include/gen/lib_ws_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.h" +#include "include/gen/ws_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- lib_ws_FieldIdEnum + +enum lib_ws_FieldIdEnum { // lib_ws.FieldId.value + lib_ws_FieldId_value = 0 +}; + +enum { lib_ws_FieldIdEnum_N = 1 }; + + +// --- lib_ws_FrameIdxCaseEnum + +enum lib_ws_FrameIdxCaseEnum { // lib_ws.FrameIdxCase.value + lib_ws_FrameIdxCase_ws_Frame16 = 126 + ,lib_ws_FrameIdxCase_ws_Frame64 = 127 + ,lib_ws_FrameIdxCase_ws_FrameMasked16 = 254 + ,lib_ws_FrameIdxCase_ws_FrameMasked64 = 255 +}; + +enum { lib_ws_FrameIdxCaseEnum_N = 4 }; + + +// --- lib_ws_FrameLenCaseEnum + +enum lib_ws_FrameLenCaseEnum { // lib_ws.FrameLenCase.value + lib_ws_FrameLenCase_ws_Frame16 = 126 + ,lib_ws_FrameLenCase_ws_Frame64 = 127 + ,lib_ws_FrameLenCase_ws_FrameMasked16 = 254 + ,lib_ws_FrameLenCase_ws_FrameMasked64 = 255 +}; + +enum { lib_ws_FrameLenCaseEnum_N = 4 }; + +namespace lib_ws { // gen:ns_pkeytypedef +} // gen:ns_pkeytypedef +namespace lib_ws { // gen:ns_tclass_field +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace lib_ws { struct FrameIdx; } +namespace ws { struct Frame; } +namespace ws { struct Opcode; } +namespace ws { struct FrameMasked; } +namespace lib_ws { struct trace; } +namespace lib_ws { struct FDb; } +namespace lib_ws { struct FieldId; } +namespace lib_ws { struct FrameIdxCase; } +namespace lib_ws { struct FrameLenCase; } +namespace lib_ws { extern struct lib_ws::FDb _db; } +namespace lib_ws { // gen:ns_print_struct + +// --- lib_ws.trace +#pragma pack(push,1) +struct trace { // lib_ws.trace + // func:lib_ws.trace..Ctor + inline trace() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// print string representation of ROW to string STR +// cfmt:lib_ws.trace.String printfmt:Tuple +// func:lib_ws.trace..Print +void trace_Print(lib_ws::trace& row, algo::cstring& str) __attribute__((nothrow)); + +// --- lib_ws.FDb +// create: lib_ws.FDb._db (Global) +struct FDb { // lib_ws.FDb: In-memory database for lib_ws + lib_ws::trace trace; // +}; + +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +// func:lib_ws.FDb._db.InsertStrptrMaybe +bool InsertStrptrMaybe(algo::strptr str); +// Load all finputs from given directory. +// func:lib_ws.FDb._db.LoadTuplesMaybe +bool LoadTuplesMaybe(algo::strptr root, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +// func:lib_ws.FDb._db.LoadTuplesFile +bool LoadTuplesFile(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file descriptor. +// func:lib_ws.FDb._db.LoadTuplesFd +bool LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load specified ssimfile. +// func:lib_ws.FDb._db.LoadSsimfileMaybe +bool LoadSsimfileMaybe(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Calls Step function of dependencies +// func:lib_ws.FDb._db.Steps +void Steps(); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:lib_ws.FDb._db.XrefMaybe +bool _db_XrefMaybe(); + +// Set all fields to initial values. +// func:lib_ws.FDb..Init +void FDb_Init(); +// func:lib_ws.FDb..Uninit +inline void FDb_Uninit() __attribute__((nothrow)); + +// --- lib_ws.FieldId +#pragma pack(push,1) +struct FieldId { // lib_ws.FieldId: Field read helper + i32 value; // -1 + // func:lib_ws.FieldId.value.Cast + inline operator lib_ws_FieldIdEnum() const __attribute__((nothrow)); + // func:lib_ws.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:lib_ws.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:lib_ws.FieldId..EnumCtor + inline FieldId(lib_ws_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:lib_ws.FieldId.value.GetEnum +inline lib_ws_FieldIdEnum value_GetEnum(const lib_ws::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:lib_ws.FieldId.value.SetEnum +inline void value_SetEnum(lib_ws::FieldId& parent, lib_ws_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:lib_ws.FieldId.value.ToCstr +const char* value_ToCstr(const lib_ws::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:lib_ws.FieldId.value.Print +void value_Print(const lib_ws::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:lib_ws.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(lib_ws::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:lib_ws.FieldId.value.SetStrptr +void value_SetStrptr(lib_ws::FieldId& parent, algo::strptr rhs, lib_ws_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:lib_ws.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(lib_ws::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of lib_ws::FieldId from an ascii string. +// The format of the string is the format of the lib_ws::FieldId's only field +// func:lib_ws.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(lib_ws::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:lib_ws.FieldId..Init +inline void FieldId_Init(lib_ws::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:lib_ws.FieldId.String printfmt:Raw +// func:lib_ws.FieldId..Print +void FieldId_Print(lib_ws::FieldId& row, algo::cstring& str) __attribute__((nothrow)); + +// --- lib_ws.FrameIdx +struct FrameIdx { // lib_ws.FrameIdx + u32* masking_key; // optional pointer + algo::strptr payload; // + // func:lib_ws.FrameIdx..Ctor + inline FrameIdx() __attribute__((nothrow)); +}; + +// Set all fields to initial values. +// func:lib_ws.FrameIdx..Init +inline void FrameIdx_Init(lib_ws::FrameIdx& parent); +// User-implemented callback function for dispatch FrameIdx +// func:lib_ws.FrameIdx.ws.Frame16 +// this function is 'extrn' and implemented by user +void FrameIdx_Frame16(lib_ws::FrameIdx &ctx, ws::Frame16 &msg, u32 msg_len); +// User-implemented callback function for dispatch FrameIdx +// func:lib_ws.FrameIdx.ws.Frame64 +// this function is 'extrn' and implemented by user +void FrameIdx_Frame64(lib_ws::FrameIdx &ctx, ws::Frame64 &msg, u32 msg_len); +// User-implemented callback function for dispatch FrameIdx +// func:lib_ws.FrameIdx.ws.FrameMasked16 +// this function is 'extrn' and implemented by user +void FrameIdx_FrameMasked16(lib_ws::FrameIdx &ctx, ws::FrameMasked16 &msg, u32 msg_len); +// User-implemented callback function for dispatch FrameIdx +// func:lib_ws.FrameIdx.ws.FrameMasked64 +// this function is 'extrn' and implemented by user +void FrameIdx_FrameMasked64(lib_ws::FrameIdx &ctx, ws::FrameMasked64 &msg, u32 msg_len); +// User-implemented callback function for dispatch FrameIdx +// func:lib_ws.FrameIdx..Unkmsg +// this function is 'extrn' and implemented by user +int FrameIdx_Unkmsg(lib_ws::FrameIdx &ctx, ws::FrameHeader& msg, u32 msg_len); +// func:lib_ws.FrameIdx..DispatchRaw +int FrameIdxDispatchRaw(lib_ws::FrameIdx &ctx, lib_ws::FrameIdxCase type, u8 *msg, u32 len); +// func:lib_ws.FrameIdx..Dispatch +int FrameIdxDispatch(lib_ws::FrameIdx &ctx, ws::FrameHeader& msg, u32 msg_len); +// void rettype useful for hooks +// func:lib_ws.FrameIdx..Dispatch2 +void vFrameIdxDispatch(lib_ws::FrameIdx &ctx, ws::FrameHeader& msg, u32 msg_len); + +// --- lib_ws.FrameIdxCase +#pragma pack(push,1) +struct FrameIdxCase { // lib_ws.FrameIdxCase: Enum for dispatch lib_ws.FrameIdx + u32 value; // 0 + // func:lib_ws.FrameIdxCase.value.Cast + inline operator lib_ws_FrameIdxCaseEnum() const __attribute__((nothrow)); + // func:lib_ws.FrameIdxCase..Ctor + inline FrameIdxCase() __attribute__((nothrow)); + // func:lib_ws.FrameIdxCase..FieldwiseCtor + explicit inline FrameIdxCase(u32 in_value) __attribute__((nothrow)); + // func:lib_ws.FrameIdxCase..EnumCtor + inline FrameIdxCase(lib_ws_FrameIdxCaseEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:lib_ws.FrameIdxCase.value.GetEnum +inline lib_ws_FrameIdxCaseEnum value_GetEnum(const lib_ws::FrameIdxCase& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:lib_ws.FrameIdxCase.value.SetEnum +inline void value_SetEnum(lib_ws::FrameIdxCase& parent, lib_ws_FrameIdxCaseEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:lib_ws.FrameIdxCase.value.ToCstr +const char* value_ToCstr(const lib_ws::FrameIdxCase& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:lib_ws.FrameIdxCase.value.Print +void value_Print(const lib_ws::FrameIdxCase& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:lib_ws.FrameIdxCase.value.SetStrptrMaybe +bool value_SetStrptrMaybe(lib_ws::FrameIdxCase& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:lib_ws.FrameIdxCase.value.SetStrptr +void value_SetStrptr(lib_ws::FrameIdxCase& parent, algo::strptr rhs, lib_ws_FrameIdxCaseEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:lib_ws.FrameIdxCase.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(lib_ws::FrameIdxCase& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of lib_ws::FrameIdxCase from an ascii string. +// The format of the string is the format of the lib_ws::FrameIdxCase's only field +// func:lib_ws.FrameIdxCase..ReadStrptrMaybe +bool FrameIdxCase_ReadStrptrMaybe(lib_ws::FrameIdxCase &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:lib_ws.FrameIdxCase..Init +inline void FrameIdxCase_Init(lib_ws::FrameIdxCase& parent); + +// --- lib_ws.FrameLenCase +#pragma pack(push,1) +struct FrameLenCase { // lib_ws.FrameLenCase: Enum for dispatch lib_ws.FrameLen + u32 value; // 0 + // func:lib_ws.FrameLenCase.value.Cast + inline operator lib_ws_FrameLenCaseEnum() const __attribute__((nothrow)); + // func:lib_ws.FrameLenCase..Ctor + inline FrameLenCase() __attribute__((nothrow)); + // func:lib_ws.FrameLenCase..FieldwiseCtor + explicit inline FrameLenCase(u32 in_value) __attribute__((nothrow)); + // func:lib_ws.FrameLenCase..EnumCtor + inline FrameLenCase(lib_ws_FrameLenCaseEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:lib_ws.FrameLenCase.value.GetEnum +inline lib_ws_FrameLenCaseEnum value_GetEnum(const lib_ws::FrameLenCase& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:lib_ws.FrameLenCase.value.SetEnum +inline void value_SetEnum(lib_ws::FrameLenCase& parent, lib_ws_FrameLenCaseEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:lib_ws.FrameLenCase.value.ToCstr +const char* value_ToCstr(const lib_ws::FrameLenCase& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:lib_ws.FrameLenCase.value.Print +void value_Print(const lib_ws::FrameLenCase& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:lib_ws.FrameLenCase.value.SetStrptrMaybe +bool value_SetStrptrMaybe(lib_ws::FrameLenCase& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:lib_ws.FrameLenCase.value.SetStrptr +void value_SetStrptr(lib_ws::FrameLenCase& parent, algo::strptr rhs, lib_ws_FrameLenCaseEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:lib_ws.FrameLenCase.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(lib_ws::FrameLenCase& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of lib_ws::FrameLenCase from an ascii string. +// The format of the string is the format of the lib_ws::FrameLenCase's only field +// func:lib_ws.FrameLenCase..ReadStrptrMaybe +bool FrameLenCase_ReadStrptrMaybe(lib_ws::FrameLenCase &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:lib_ws.FrameLenCase..Init +inline void FrameLenCase_Init(lib_ws::FrameLenCase& parent); +} // gen:ns_print_struct +namespace lib_ws { // gen:ns_func +// func:lib_ws...StaticCheck +void StaticCheck(); +// User-implemented callback function for dispatch FrameLen +// func:lib_ws.FrameLen.ws.Frame16 +// this function is 'extrn' and implemented by user +void FrameLen_Frame16(i32 &ctx, ws::Frame16 &msg, u32 msg_len); +// User-implemented callback function for dispatch FrameLen +// func:lib_ws.FrameLen.ws.Frame64 +// this function is 'extrn' and implemented by user +void FrameLen_Frame64(i32 &ctx, ws::Frame64 &msg, u32 msg_len); +// User-implemented callback function for dispatch FrameLen +// func:lib_ws.FrameLen.ws.FrameMasked16 +// this function is 'extrn' and implemented by user +void FrameLen_FrameMasked16(i32 &ctx, ws::FrameMasked16 &msg, u32 msg_len); +// User-implemented callback function for dispatch FrameLen +// func:lib_ws.FrameLen.ws.FrameMasked64 +// this function is 'extrn' and implemented by user +void FrameLen_FrameMasked64(i32 &ctx, ws::FrameMasked64 &msg, u32 msg_len); +// User-implemented callback function for dispatch FrameLen +// func:lib_ws.FrameLen..Unkmsg +// this function is 'extrn' and implemented by user +int FrameLen_Unkmsg(i32 &ctx, ws::FrameHeader& msg, u32 msg_len); +// func:lib_ws.FrameLen..DispatchRaw +int FrameLenDispatchRaw(i32 &ctx, lib_ws::FrameLenCase type, u8 *msg, u32 len); +// func:lib_ws.FrameLen..Dispatch +int FrameLenDispatch(i32 &ctx, ws::FrameHeader& msg, u32 msg_len); +// void rettype useful for hooks +// func:lib_ws.FrameLen..Dispatch2 +void vFrameLenDispatch(i32 &ctx, ws::FrameHeader& msg, u32 msg_len); +// Construct a new ws::Frame in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:lib_ws...Frame_FmtByteAry +ws::Frame * Frame_FmtByteAry(algo::ByteAry &buf, u8 byte0, u8 byte1, algo::aryptr payload); +// Construct a new ws::Frame16 in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:lib_ws...Frame16_FmtByteAry +ws::Frame16 * Frame16_FmtByteAry(algo::ByteAry &buf, u8 byte0, algo::aryptr payload); +// Construct a new ws::Frame64 in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:lib_ws...Frame64_FmtByteAry +ws::Frame64 * Frame64_FmtByteAry(algo::ByteAry &buf, u8 byte0, algo::aryptr payload); +// Construct a new ws::FrameMasked in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:lib_ws...FrameMasked_FmtByteAry +ws::FrameMasked * FrameMasked_FmtByteAry(algo::ByteAry &buf, u8 byte0, u8 byte1, u32 masking_key, algo::aryptr payload); +// Construct a new ws::FrameMasked16 in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:lib_ws...FrameMasked16_FmtByteAry +ws::FrameMasked16 * FrameMasked16_FmtByteAry(algo::ByteAry &buf, u8 byte0, u32 masking_key, algo::aryptr payload); +// Construct a new ws::FrameMasked64 in the space provided by BUF. +// If BUF doesn't have enough space available, throw exception. +// func:lib_ws...FrameMasked64_FmtByteAry +ws::FrameMasked64 * FrameMasked64_FmtByteAry(algo::ByteAry &buf, u8 byte0, u32 masking_key, algo::aryptr payload); +} // gen:ns_func +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const lib_ws::trace &row);// cfmt:lib_ws.trace.String +inline algo::cstring &operator <<(algo::cstring &str, const lib_ws::FieldId &row);// cfmt:lib_ws.FieldId.String +} diff --git a/include/gen/lib_ws_gen.inl.h b/include/gen/lib_ws_gen.inl.h new file mode 100644 index 00000000..440b652a --- /dev/null +++ b/include/gen/lib_ws_gen.inl.h @@ -0,0 +1,175 @@ +// +// include/gen/lib_ws_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.inl.h" +#include "include/gen/ws_gen.inl.h" +//#pragma endinclude + +// --- lib_ws.trace..Ctor +inline lib_ws::trace::trace() { +} + +// --- lib_ws.FDb..Uninit +inline void lib_ws::FDb_Uninit() { + lib_ws::FDb &row = _db; (void)row; +} + +// --- lib_ws.FieldId.value.GetEnum +// Get value of field as enum type +inline lib_ws_FieldIdEnum lib_ws::value_GetEnum(const lib_ws::FieldId& parent) { + return lib_ws_FieldIdEnum(parent.value); +} + +// --- lib_ws.FieldId.value.SetEnum +// Set value of field from enum type. +inline void lib_ws::value_SetEnum(lib_ws::FieldId& parent, lib_ws_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- lib_ws.FieldId.value.Cast +inline lib_ws::FieldId::operator lib_ws_FieldIdEnum() const { + return lib_ws_FieldIdEnum((*this).value); +} + +// --- lib_ws.FieldId..Init +// Set all fields to initial values. +inline void lib_ws::FieldId_Init(lib_ws::FieldId& parent) { + parent.value = i32(-1); +} + +// --- lib_ws.FieldId..Ctor +inline lib_ws::FieldId::FieldId() { + lib_ws::FieldId_Init(*this); +} + +// --- lib_ws.FieldId..FieldwiseCtor +inline lib_ws::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- lib_ws.FieldId..EnumCtor +inline lib_ws::FieldId::FieldId(lib_ws_FieldIdEnum arg) { + this->value = i32(arg); +} + +// --- lib_ws.FrameIdx..Init +// Set all fields to initial values. +inline void lib_ws::FrameIdx_Init(lib_ws::FrameIdx& parent) { + parent.masking_key = NULL; +} + +// --- lib_ws.FrameIdx..Ctor +inline lib_ws::FrameIdx::FrameIdx() { + lib_ws::FrameIdx_Init(*this); +} + +// --- lib_ws.FrameIdxCase.value.GetEnum +// Get value of field as enum type +inline lib_ws_FrameIdxCaseEnum lib_ws::value_GetEnum(const lib_ws::FrameIdxCase& parent) { + return lib_ws_FrameIdxCaseEnum(parent.value); +} + +// --- lib_ws.FrameIdxCase.value.SetEnum +// Set value of field from enum type. +inline void lib_ws::value_SetEnum(lib_ws::FrameIdxCase& parent, lib_ws_FrameIdxCaseEnum rhs) { + parent.value = u32(rhs); +} + +// --- lib_ws.FrameIdxCase.value.Cast +inline lib_ws::FrameIdxCase::operator lib_ws_FrameIdxCaseEnum() const { + return lib_ws_FrameIdxCaseEnum((*this).value); +} + +// --- lib_ws.FrameIdxCase..Init +// Set all fields to initial values. +inline void lib_ws::FrameIdxCase_Init(lib_ws::FrameIdxCase& parent) { + parent.value = u32(0); +} + +// --- lib_ws.FrameIdxCase..Ctor +inline lib_ws::FrameIdxCase::FrameIdxCase() { + lib_ws::FrameIdxCase_Init(*this); +} + +// --- lib_ws.FrameIdxCase..FieldwiseCtor +inline lib_ws::FrameIdxCase::FrameIdxCase(u32 in_value) + : value(in_value) + { +} + +// --- lib_ws.FrameIdxCase..EnumCtor +inline lib_ws::FrameIdxCase::FrameIdxCase(lib_ws_FrameIdxCaseEnum arg) { + this->value = u32(arg); +} + +// --- lib_ws.FrameLenCase.value.GetEnum +// Get value of field as enum type +inline lib_ws_FrameLenCaseEnum lib_ws::value_GetEnum(const lib_ws::FrameLenCase& parent) { + return lib_ws_FrameLenCaseEnum(parent.value); +} + +// --- lib_ws.FrameLenCase.value.SetEnum +// Set value of field from enum type. +inline void lib_ws::value_SetEnum(lib_ws::FrameLenCase& parent, lib_ws_FrameLenCaseEnum rhs) { + parent.value = u32(rhs); +} + +// --- lib_ws.FrameLenCase.value.Cast +inline lib_ws::FrameLenCase::operator lib_ws_FrameLenCaseEnum() const { + return lib_ws_FrameLenCaseEnum((*this).value); +} + +// --- lib_ws.FrameLenCase..Init +// Set all fields to initial values. +inline void lib_ws::FrameLenCase_Init(lib_ws::FrameLenCase& parent) { + parent.value = u32(0); +} + +// --- lib_ws.FrameLenCase..Ctor +inline lib_ws::FrameLenCase::FrameLenCase() { + lib_ws::FrameLenCase_Init(*this); +} + +// --- lib_ws.FrameLenCase..FieldwiseCtor +inline lib_ws::FrameLenCase::FrameLenCase(u32 in_value) + : value(in_value) + { +} + +// --- lib_ws.FrameLenCase..EnumCtor +inline lib_ws::FrameLenCase::FrameLenCase(lib_ws_FrameLenCaseEnum arg) { + this->value = u32(arg); +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const lib_ws::trace &row) {// cfmt:lib_ws.trace.String + lib_ws::trace_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const lib_ws::FieldId &row) {// cfmt:lib_ws.FieldId.String + lib_ws::FieldId_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/mdbg_gen.h b/include/gen/mdbg_gen.h index c8fe4476..8ffd912e 100644 --- a/include/gen/mdbg_gen.h +++ b/include/gen/mdbg_gen.h @@ -130,6 +130,7 @@ struct FCfg { // mdbg.FCfg u32 c_builddir_n; // array of pointers u32 c_builddir_max; // capacity of allocated array mdbg::FCfg* ind_cfg_next; // hash next + u32 ind_cfg_hashval; // hash value // reftype Ptrary of mdbg.FCfg.c_builddir prohibits copy // func:mdbg.FCfg..AssignOp inline mdbg::FCfg& operator =(const mdbg::FCfg &rhs) = delete; @@ -379,6 +380,9 @@ void ind_cfg_Remove(mdbg::FCfg& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:mdbg.FDb.ind_cfg.Reserve void ind_cfg_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:mdbg.FDb.ind_cfg.AbsReserve +void ind_cfg_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. diff --git a/include/gen/mdbg_gen.inl.h b/include/gen/mdbg_gen.inl.h index 32768480..4d7c8da7 100644 --- a/include/gen/mdbg_gen.inl.h +++ b/include/gen/mdbg_gen.inl.h @@ -134,6 +134,7 @@ inline void mdbg::FCfg_Init(mdbg::FCfg& cfg) { cfg.c_builddir_n = 0; // (mdbg.FCfg.c_builddir) cfg.c_builddir_max = 0; // (mdbg.FCfg.c_builddir) cfg.ind_cfg_next = (mdbg::FCfg*)-1; // (mdbg.FDb.ind_cfg) not-in-hash + cfg.ind_cfg_hashval = 0; // stored hash value } // --- mdbg.FCfg..Ctor diff --git a/include/gen/mysql2ssim_gen.h b/include/gen/mysql2ssim_gen.h index 2277c4c7..448df548 100644 --- a/include/gen/mysql2ssim_gen.h +++ b/include/gen/mysql2ssim_gen.h @@ -140,6 +140,11 @@ algo::cstring& table_names_AllocAt(int at) __attribute__((__warn_unused_re // Reserve space. Insert N elements at the end of the array, return pointer to array // func:mysql2ssim.FDb.table_names.AllocN algo::aryptr table_names_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:mysql2ssim.FDb.table_names.AllocNAt +algo::aryptr table_names_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:mysql2ssim.FDb.table_names.EmptyQ inline bool table_names_EmptyQ() __attribute__((nothrow)); @@ -189,6 +194,10 @@ algo::aryptr table_names_AllocNVal(int n_elems, const algo::cstri // Function returns success value. // func:mysql2ssim.FDb.table_names.ReadStrptrMaybe bool table_names_ReadStrptrMaybe(algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:mysql2ssim.FDb.table_names.Insary +void table_names_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -206,6 +215,11 @@ algo::cstring& in_tables_AllocAt(int at) __attribute__((__warn_unused_resu // Reserve space. Insert N elements at the end of the array, return pointer to array // func:mysql2ssim.FDb.in_tables.AllocN algo::aryptr in_tables_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:mysql2ssim.FDb.in_tables.AllocNAt +algo::aryptr in_tables_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:mysql2ssim.FDb.in_tables.EmptyQ inline bool in_tables_EmptyQ() __attribute__((nothrow)); @@ -255,6 +269,10 @@ algo::aryptr in_tables_AllocNVal(int n_elems, const algo::cstring // Function returns success value. // func:mysql2ssim.FDb.in_tables.ReadStrptrMaybe bool in_tables_ReadStrptrMaybe(algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:mysql2ssim.FDb.in_tables.Insary +void in_tables_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:mysql2ssim.FDb.table_names_curs.Next @@ -317,6 +335,11 @@ algo::cstring& vals_AllocAt(mysql2ssim::FTobltin& parent, int at) __attrib // Reserve space. Insert N elements at the end of the array, return pointer to array // func:mysql2ssim.FTobltin.vals.AllocN algo::aryptr vals_AllocN(mysql2ssim::FTobltin& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:mysql2ssim.FTobltin.vals.AllocNAt +algo::aryptr vals_AllocNAt(mysql2ssim::FTobltin& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:mysql2ssim.FTobltin.vals.EmptyQ inline bool vals_EmptyQ(mysql2ssim::FTobltin& parent) __attribute__((nothrow)); @@ -373,6 +396,10 @@ algo::aryptr vals_AllocNVal(mysql2ssim::FTobltin& parent, int n_e // Function returns success value. // func:mysql2ssim.FTobltin.vals.ReadStrptrMaybe bool vals_ReadStrptrMaybe(mysql2ssim::FTobltin& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:mysql2ssim.FTobltin.vals.Insary +void vals_Insary(mysql2ssim::FTobltin& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); // proceed to next item // func:mysql2ssim.FTobltin.vals_curs.Next diff --git a/include/gen/orgfile_gen.h b/include/gen/orgfile_gen.h index 65cf4c4a..8dae44dc 100644 --- a/include/gen/orgfile_gen.h +++ b/include/gen/orgfile_gen.h @@ -202,6 +202,9 @@ void ind_filename_Remove(orgfile::FFilename& row) __attribute__( // Reserve enough room in the hash for N more elements. Return success code. // func:orgfile.FDb.ind_filename.Reserve void ind_filename_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:orgfile.FDb.ind_filename.AbsReserve +void ind_filename_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -263,6 +266,9 @@ void ind_filehash_Remove(orgfile::FFilehash& row) __attribute__( // Reserve enough room in the hash for N more elements. Return success code. // func:orgfile.FDb.ind_filehash.Reserve void ind_filehash_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:orgfile.FDb.ind_filehash.AbsReserve +void ind_filehash_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -340,11 +346,12 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: ind_filehash (Thash, hash field filehash) // access: orgfile.FFilename.p_filehash (Upptr) struct FFilehash { // orgfile.FFilehash - orgfile::FFilehash* ind_filehash_next; // hash next - algo::Smallstr40 filehash; // - orgfile::FFilename** c_filename_elems; // array of pointers - u32 c_filename_n; // array of pointers - u32 c_filename_max; // capacity of allocated array + orgfile::FFilehash* ind_filehash_next; // hash next + u32 ind_filehash_hashval; // hash value + algo::Smallstr40 filehash; // + orgfile::FFilename** c_filename_elems; // array of pointers + u32 c_filename_n; // array of pointers + u32 c_filename_max; // capacity of allocated array // reftype Ptrary of orgfile.FFilehash.c_filename prohibits copy // func:orgfile.FFilehash..AssignOp inline orgfile::FFilehash& operator =(const orgfile::FFilehash &rhs) = delete; @@ -426,6 +433,7 @@ void FFilehash_Uninit(orgfile::FFilehash& filehash) __attribute_ struct FFilename { // orgfile.FFilename orgfile::FFilename* filename_next; // Pointer to next free element int tpool orgfile::FFilename* ind_filename_next; // hash next + u32 ind_filename_hashval; // hash value algo::cstring filename; // algo::Smallstr40 filehash; // orgfile::FFilehash* p_filehash; // reference to parent row diff --git a/include/gen/orgfile_gen.inl.h b/include/gen/orgfile_gen.inl.h index 910eb1c8..c89ca461 100644 --- a/include/gen/orgfile_gen.inl.h +++ b/include/gen/orgfile_gen.inl.h @@ -255,6 +255,7 @@ inline void orgfile::FFilehash_Init(orgfile::FFilehash& filehash) { filehash.c_filename_n = 0; // (orgfile.FFilehash.c_filename) filehash.c_filename_max = 0; // (orgfile.FFilehash.c_filename) filehash.ind_filehash_next = (orgfile::FFilehash*)-1; // (orgfile.FDb.ind_filehash) not-in-hash + filehash.ind_filehash_hashval = 0; // stored hash value } // --- orgfile.FFilehash.c_filename_curs.Reset @@ -299,6 +300,7 @@ inline void orgfile::FFilename_Init(orgfile::FFilename& filename) { filename.filehash_c_filename_in_ary = bool(false); filename.filename_next = (orgfile::FFilename*)-1; // (orgfile.FDb.filename) not-in-tpool's freelist filename.ind_filename_next = (orgfile::FFilename*)-1; // (orgfile.FDb.ind_filename) not-in-hash + filename.ind_filename_hashval = 0; // stored hash value } // --- orgfile.FFilename..Ctor diff --git a/include/gen/report_gen.h b/include/gen/report_gen.h index 11df0b41..9f06f57a 100644 --- a/include/gen/report_gen.h +++ b/include/gen/report_gen.h @@ -264,7 +264,7 @@ struct atf_comp { // report.atf_comp i32 ntest; // 0 Total number of tests i32 nselect; // 0 Number of tests selected for execution i32 npass; // 0 Number of tests succeeded - i32 nskip; // 0 Number of tests failed + i32 nskip; // 0 Number of tests not selected i32 nrun; // 0 Number of tests run i32 nwrite; // 0 Number of files written i32 nerr; // 0 Number of errors diff --git a/include/gen/samp_make_gen.h b/include/gen/samp_make_gen.h new file mode 100644 index 00000000..d83fb951 --- /dev/null +++ b/include/gen/samp_make_gen.h @@ -0,0 +1,1163 @@ +// +// include/gen/samp_make_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/command_gen.h" +#include "include/gen/sampdb_gen.h" +#include "include/gen/algo_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- samp_make_FieldIdEnum + +enum samp_make_FieldIdEnum { // samp_make.FieldId.value + samp_make_FieldId_value = 0 +}; + +enum { samp_make_FieldIdEnum_N = 1 }; + + +// --- samp_make_TableIdEnum + +enum samp_make_TableIdEnum { // samp_make.TableId.value + samp_make_TableId_sampdb_Gitfile = 0 // sampdb.Gitfile -> samp_make.FGitfile + ,samp_make_TableId_sampdb_gitfile = 0 // sampdb.gitfile -> samp_make.FGitfile + ,samp_make_TableId_sampdb_Targdep = 1 // sampdb.Targdep -> samp_make.FTargdep + ,samp_make_TableId_sampdb_targdep = 1 // sampdb.targdep -> samp_make.FTargdep + ,samp_make_TableId_sampdb_Target = 2 // sampdb.Target -> samp_make.FTarget + ,samp_make_TableId_sampdb_target = 2 // sampdb.target -> samp_make.FTarget + ,samp_make_TableId_sampdb_Targrec = 3 // sampdb.Targrec -> samp_make.FTargrec + ,samp_make_TableId_sampdb_targrec = 3 // sampdb.targrec -> samp_make.FTargrec + ,samp_make_TableId_sampdb_Targsrc = 4 // sampdb.Targsrc -> samp_make.FTargsrc + ,samp_make_TableId_sampdb_targsrc = 4 // sampdb.targsrc -> samp_make.FTargsrc +}; + +enum { samp_make_TableIdEnum_N = 10 }; + +namespace samp_make { // gen:ns_pkeytypedef +} // gen:ns_pkeytypedef +namespace samp_make { // gen:ns_tclass_field +extern const char *samp_make_help; +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace sampdb { struct Gitfile; } +namespace sampdb { struct Targdep; } +namespace samp_make { struct FTarget; } +namespace sampdb { struct Target; } +namespace sampdb { struct Targrec; } +namespace sampdb { struct Targsrc; } +namespace samp_make { struct _db_gitfile_curs; } +namespace samp_make { struct _db_target_curs; } +namespace samp_make { struct _db_targdep_curs; } +namespace samp_make { struct _db_targsrc_curs; } +namespace samp_make { struct _db_targrec_curs; } +namespace samp_make { struct _db_c_target_curs; } +namespace samp_make { struct target_c_targsrc_curs; } +namespace samp_make { struct target_c_targdep_curs; } +namespace samp_make { struct trace; } +namespace samp_make { struct FDb; } +namespace samp_make { struct FGitfile; } +namespace samp_make { struct FTargdep; } +namespace samp_make { struct FTargrec; } +namespace samp_make { struct FTargsrc; } +namespace samp_make { struct FieldId; } +namespace samp_make { struct TableId; } +namespace samp_make { extern struct samp_make::FDb _db; } +namespace samp_make { // gen:ns_print_struct + +// --- samp_make.trace +#pragma pack(push,1) +struct trace { // samp_make.trace + // func:samp_make.trace..Ctor + inline trace() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// print string representation of ROW to string STR +// cfmt:samp_make.trace.String printfmt:Tuple +// func:samp_make.trace..Print +void trace_Print(samp_make::trace& row, algo::cstring& str) __attribute__((nothrow)); + +// --- samp_make.FDb +// create: samp_make.FDb._db (Global) +struct FDb { // samp_make.FDb + command::samp_make cmdline; // + samp_make::FGitfile* gitfile_lary[32]; // level array + i32 gitfile_n; // number of elements in array + samp_make::FGitfile** ind_gitfile_buckets_elems; // pointer to bucket array + i32 ind_gitfile_buckets_n; // number of elements in bucket array + i32 ind_gitfile_n; // number of elements in the hash table + samp_make::FTarget* target_lary[32]; // level array + i32 target_n; // number of elements in array + samp_make::FTarget** ind_target_buckets_elems; // pointer to bucket array + i32 ind_target_buckets_n; // number of elements in bucket array + i32 ind_target_n; // number of elements in the hash table + samp_make::FTargdep* targdep_lary[32]; // level array + i32 targdep_n; // number of elements in array + samp_make::FTargdep** ind_targdep_buckets_elems; // pointer to bucket array + i32 ind_targdep_buckets_n; // number of elements in bucket array + i32 ind_targdep_n; // number of elements in the hash table + samp_make::FTargsrc* targsrc_lary[32]; // level array + i32 targsrc_n; // number of elements in array + samp_make::FTargsrc** ind_targsrc_buckets_elems; // pointer to bucket array + i32 ind_targsrc_buckets_n; // number of elements in bucket array + i32 ind_targsrc_n; // number of elements in the hash table + samp_make::FTargrec* targrec_lary[32]; // level array + i32 targrec_n; // number of elements in array + samp_make::FTargrec** ind_targrec_buckets_elems; // pointer to bucket array + i32 ind_targrec_buckets_n; // number of elements in bucket array + i32 ind_targrec_n; // number of elements in the hash table + samp_make::FTarget** c_target_elems; // array of pointers + u32 c_target_n; // array of pointers + u32 c_target_max; // capacity of allocated array + samp_make::trace trace; // +}; + +// Read argc,argv directly into the fields of the command line(s) +// The following fields are updated: +// samp_make.FDb.cmdline +// algo_lib.FDb.cmdline +// func:samp_make.FDb._db.ReadArgv +void ReadArgv() __attribute__((nothrow)); +// Main loop. +// func:samp_make.FDb._db.MainLoop +void MainLoop(); +// Main step +// func:samp_make.FDb._db.Step +void Step(); +// Main function +// func:samp_make.FDb._db.Main +// this function is 'extrn' and implemented by user +void Main(); +// Parse strptr into known type and add to database. +// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text +// func:samp_make.FDb._db.InsertStrptrMaybe +bool InsertStrptrMaybe(algo::strptr str); +// Load all finputs from given directory. +// func:samp_make.FDb._db.LoadTuplesMaybe +bool LoadTuplesMaybe(algo::strptr root, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file. +// Read tuples from file FNAME into this namespace's in-memory database. +// If RECURSIVE is TRUE, then also load these tuples into any parent namespaces +// It a file referred to by FNAME is missing, no error is reported (it's considered an empty set). +// Function returns TRUE if all records were parsed and inserted without error. +// If the function returns FALSE, use algo_lib::DetachBadTags() for error description +// func:samp_make.FDb._db.LoadTuplesFile +bool LoadTuplesFile(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load all finputs from given file descriptor. +// func:samp_make.FDb._db.LoadTuplesFd +bool LoadTuplesFd(algo::Fildes fd, algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Load specified ssimfile. +// func:samp_make.FDb._db.LoadSsimfileMaybe +bool LoadSsimfileMaybe(algo::strptr fname, bool recursive) __attribute__((nothrow)); +// Calls Step function of dependencies +// func:samp_make.FDb._db.Steps +void Steps(); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:samp_make.FDb._db.XrefMaybe +bool _db_XrefMaybe(); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:samp_make.FDb.gitfile.Alloc +samp_make::FGitfile& gitfile_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:samp_make.FDb.gitfile.AllocMaybe +samp_make::FGitfile* gitfile_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:samp_make.FDb.gitfile.InsertMaybe +samp_make::FGitfile* gitfile_InsertMaybe(const sampdb::Gitfile &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:samp_make.FDb.gitfile.AllocMem +void* gitfile_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:samp_make.FDb.gitfile.EmptyQ +inline bool gitfile_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:samp_make.FDb.gitfile.Find +inline samp_make::FGitfile* gitfile_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:samp_make.FDb.gitfile.Last +inline samp_make::FGitfile* gitfile_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:samp_make.FDb.gitfile.N +inline i32 gitfile_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:samp_make.FDb.gitfile.RemoveAll +void gitfile_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:samp_make.FDb.gitfile.RemoveLast +void gitfile_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:samp_make.FDb.gitfile.qFind +inline samp_make::FGitfile& gitfile_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:samp_make.FDb.gitfile.XrefMaybe +bool gitfile_XrefMaybe(samp_make::FGitfile &row); + +// Return true if hash is empty +// func:samp_make.FDb.ind_gitfile.EmptyQ +inline bool ind_gitfile_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:samp_make.FDb.ind_gitfile.Find +samp_make::FGitfile* ind_gitfile_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:samp_make.FDb.ind_gitfile.FindX +samp_make::FGitfile& ind_gitfile_FindX(const algo::strptr& key); +// Find row by key. If not found, create and x-reference a new row with with this key. +// func:samp_make.FDb.ind_gitfile.GetOrCreate +samp_make::FGitfile& ind_gitfile_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); +// Return number of items in the hash +// func:samp_make.FDb.ind_gitfile.N +inline i32 ind_gitfile_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:samp_make.FDb.ind_gitfile.InsertMaybe +bool ind_gitfile_InsertMaybe(samp_make::FGitfile& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:samp_make.FDb.ind_gitfile.Remove +void ind_gitfile_Remove(samp_make::FGitfile& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:samp_make.FDb.ind_gitfile.Reserve +void ind_gitfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:samp_make.FDb.ind_gitfile.AbsReserve +void ind_gitfile_AbsReserve(int n) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:samp_make.FDb.target.Alloc +samp_make::FTarget& target_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:samp_make.FDb.target.AllocMaybe +samp_make::FTarget* target_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:samp_make.FDb.target.InsertMaybe +samp_make::FTarget* target_InsertMaybe(const sampdb::Target &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:samp_make.FDb.target.AllocMem +void* target_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:samp_make.FDb.target.EmptyQ +inline bool target_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:samp_make.FDb.target.Find +inline samp_make::FTarget* target_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:samp_make.FDb.target.Last +inline samp_make::FTarget* target_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:samp_make.FDb.target.N +inline i32 target_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:samp_make.FDb.target.RemoveAll +void target_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:samp_make.FDb.target.RemoveLast +void target_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:samp_make.FDb.target.qFind +inline samp_make::FTarget& target_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:samp_make.FDb.target.XrefMaybe +bool target_XrefMaybe(samp_make::FTarget &row); + +// Return true if hash is empty +// func:samp_make.FDb.ind_target.EmptyQ +inline bool ind_target_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:samp_make.FDb.ind_target.Find +samp_make::FTarget* ind_target_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:samp_make.FDb.ind_target.FindX +samp_make::FTarget& ind_target_FindX(const algo::strptr& key); +// Find row by key. If not found, create and x-reference a new row with with this key. +// func:samp_make.FDb.ind_target.GetOrCreate +samp_make::FTarget& ind_target_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); +// Return number of items in the hash +// func:samp_make.FDb.ind_target.N +inline i32 ind_target_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:samp_make.FDb.ind_target.InsertMaybe +bool ind_target_InsertMaybe(samp_make::FTarget& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:samp_make.FDb.ind_target.Remove +void ind_target_Remove(samp_make::FTarget& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:samp_make.FDb.ind_target.Reserve +void ind_target_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:samp_make.FDb.ind_target.AbsReserve +void ind_target_AbsReserve(int n) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:samp_make.FDb.targdep.Alloc +samp_make::FTargdep& targdep_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:samp_make.FDb.targdep.AllocMaybe +samp_make::FTargdep* targdep_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:samp_make.FDb.targdep.InsertMaybe +samp_make::FTargdep* targdep_InsertMaybe(const sampdb::Targdep &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:samp_make.FDb.targdep.AllocMem +void* targdep_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:samp_make.FDb.targdep.EmptyQ +inline bool targdep_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:samp_make.FDb.targdep.Find +inline samp_make::FTargdep* targdep_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:samp_make.FDb.targdep.Last +inline samp_make::FTargdep* targdep_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:samp_make.FDb.targdep.N +inline i32 targdep_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:samp_make.FDb.targdep.RemoveAll +void targdep_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:samp_make.FDb.targdep.RemoveLast +void targdep_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:samp_make.FDb.targdep.qFind +inline samp_make::FTargdep& targdep_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:samp_make.FDb.targdep.XrefMaybe +bool targdep_XrefMaybe(samp_make::FTargdep &row); + +// Return true if hash is empty +// func:samp_make.FDb.ind_targdep.EmptyQ +inline bool ind_targdep_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:samp_make.FDb.ind_targdep.Find +samp_make::FTargdep* ind_targdep_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:samp_make.FDb.ind_targdep.FindX +samp_make::FTargdep& ind_targdep_FindX(const algo::strptr& key); +// Return number of items in the hash +// func:samp_make.FDb.ind_targdep.N +inline i32 ind_targdep_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:samp_make.FDb.ind_targdep.InsertMaybe +bool ind_targdep_InsertMaybe(samp_make::FTargdep& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:samp_make.FDb.ind_targdep.Remove +void ind_targdep_Remove(samp_make::FTargdep& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:samp_make.FDb.ind_targdep.Reserve +void ind_targdep_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:samp_make.FDb.ind_targdep.AbsReserve +void ind_targdep_AbsReserve(int n) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:samp_make.FDb.targsrc.Alloc +samp_make::FTargsrc& targsrc_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:samp_make.FDb.targsrc.AllocMaybe +samp_make::FTargsrc* targsrc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:samp_make.FDb.targsrc.InsertMaybe +samp_make::FTargsrc* targsrc_InsertMaybe(const sampdb::Targsrc &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:samp_make.FDb.targsrc.AllocMem +void* targsrc_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:samp_make.FDb.targsrc.EmptyQ +inline bool targsrc_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:samp_make.FDb.targsrc.Find +inline samp_make::FTargsrc* targsrc_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:samp_make.FDb.targsrc.Last +inline samp_make::FTargsrc* targsrc_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:samp_make.FDb.targsrc.N +inline i32 targsrc_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:samp_make.FDb.targsrc.RemoveAll +void targsrc_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:samp_make.FDb.targsrc.RemoveLast +void targsrc_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:samp_make.FDb.targsrc.qFind +inline samp_make::FTargsrc& targsrc_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:samp_make.FDb.targsrc.XrefMaybe +bool targsrc_XrefMaybe(samp_make::FTargsrc &row); + +// Return true if hash is empty +// func:samp_make.FDb.ind_targsrc.EmptyQ +inline bool ind_targsrc_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:samp_make.FDb.ind_targsrc.Find +samp_make::FTargsrc* ind_targsrc_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:samp_make.FDb.ind_targsrc.FindX +samp_make::FTargsrc& ind_targsrc_FindX(const algo::strptr& key); +// Return number of items in the hash +// func:samp_make.FDb.ind_targsrc.N +inline i32 ind_targsrc_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:samp_make.FDb.ind_targsrc.InsertMaybe +bool ind_targsrc_InsertMaybe(samp_make::FTargsrc& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:samp_make.FDb.ind_targsrc.Remove +void ind_targsrc_Remove(samp_make::FTargsrc& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:samp_make.FDb.ind_targsrc.Reserve +void ind_targsrc_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:samp_make.FDb.ind_targsrc.AbsReserve +void ind_targsrc_AbsReserve(int n) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:samp_make.FDb.targrec.Alloc +samp_make::FTargrec& targrec_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:samp_make.FDb.targrec.AllocMaybe +samp_make::FTargrec* targrec_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:samp_make.FDb.targrec.InsertMaybe +samp_make::FTargrec* targrec_InsertMaybe(const sampdb::Targrec &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:samp_make.FDb.targrec.AllocMem +void* targrec_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:samp_make.FDb.targrec.EmptyQ +inline bool targrec_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:samp_make.FDb.targrec.Find +inline samp_make::FTargrec* targrec_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:samp_make.FDb.targrec.Last +inline samp_make::FTargrec* targrec_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:samp_make.FDb.targrec.N +inline i32 targrec_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:samp_make.FDb.targrec.RemoveAll +void targrec_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:samp_make.FDb.targrec.RemoveLast +void targrec_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:samp_make.FDb.targrec.qFind +inline samp_make::FTargrec& targrec_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:samp_make.FDb.targrec.XrefMaybe +bool targrec_XrefMaybe(samp_make::FTargrec &row); + +// Return true if hash is empty +// func:samp_make.FDb.ind_targrec.EmptyQ +inline bool ind_targrec_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:samp_make.FDb.ind_targrec.Find +samp_make::FTargrec* ind_targrec_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:samp_make.FDb.ind_targrec.FindX +samp_make::FTargrec& ind_targrec_FindX(const algo::strptr& key); +// Return number of items in the hash +// func:samp_make.FDb.ind_targrec.N +inline i32 ind_targrec_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:samp_make.FDb.ind_targrec.InsertMaybe +bool ind_targrec_InsertMaybe(samp_make::FTargrec& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:samp_make.FDb.ind_targrec.Remove +void ind_targrec_Remove(samp_make::FTargrec& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:samp_make.FDb.ind_targrec.Reserve +void ind_targrec_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:samp_make.FDb.ind_targrec.AbsReserve +void ind_targrec_AbsReserve(int n) __attribute__((nothrow)); + +// Return true if index is empty +// func:samp_make.FDb.c_target.EmptyQ +inline bool c_target_EmptyQ() __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:samp_make.FDb.c_target.Find +inline samp_make::FTarget* c_target_Find(u32 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array of pointers +// func:samp_make.FDb.c_target.Getary +inline algo::aryptr c_target_Getary() __attribute__((nothrow)); +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +// func:samp_make.FDb.c_target.Insert +void c_target_Insert(samp_make::FTarget& row) __attribute__((nothrow)); +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +// func:samp_make.FDb.c_target.InsertMaybe +bool c_target_InsertMaybe(samp_make::FTarget& row) __attribute__((nothrow)); +// Return number of items in the pointer array +// func:samp_make.FDb.c_target.N +inline i32 c_target_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Find element using linear scan. If element is in array, remove, otherwise do nothing +// func:samp_make.FDb.c_target.Remove +void c_target_Remove(samp_make::FTarget& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:samp_make.FDb.c_target.RemoveAll +inline void c_target_RemoveAll() __attribute__((nothrow)); +// Reserve space in index for N more elements; +// func:samp_make.FDb.c_target.Reserve +void c_target_Reserve(u32 n) __attribute__((nothrow)); +// Return reference without bounds checking +// func:samp_make.FDb.c_target.qFind +inline samp_make::FTarget& c_target_qFind(u32 idx) __attribute__((nothrow)); +// True if row is in any ptrary instance +// func:samp_make.FDb.c_target.InAryQ +inline bool c_target_InAryQ(samp_make::FTarget& row) __attribute__((nothrow)); +// Reference to last element without bounds checking +// func:samp_make.FDb.c_target.qLast +inline samp_make::FTarget& c_target_qLast() __attribute__((nothrow)); + +// cursor points to valid item +// func:samp_make.FDb.gitfile_curs.Reset +inline void _db_gitfile_curs_Reset(_db_gitfile_curs &curs, samp_make::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FDb.gitfile_curs.ValidQ +inline bool _db_gitfile_curs_ValidQ(_db_gitfile_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:samp_make.FDb.gitfile_curs.Next +inline void _db_gitfile_curs_Next(_db_gitfile_curs &curs) __attribute__((nothrow)); +// item access +// func:samp_make.FDb.gitfile_curs.Access +inline samp_make::FGitfile& _db_gitfile_curs_Access(_db_gitfile_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FDb.target_curs.Reset +inline void _db_target_curs_Reset(_db_target_curs &curs, samp_make::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FDb.target_curs.ValidQ +inline bool _db_target_curs_ValidQ(_db_target_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:samp_make.FDb.target_curs.Next +inline void _db_target_curs_Next(_db_target_curs &curs) __attribute__((nothrow)); +// item access +// func:samp_make.FDb.target_curs.Access +inline samp_make::FTarget& _db_target_curs_Access(_db_target_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FDb.targdep_curs.Reset +inline void _db_targdep_curs_Reset(_db_targdep_curs &curs, samp_make::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FDb.targdep_curs.ValidQ +inline bool _db_targdep_curs_ValidQ(_db_targdep_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:samp_make.FDb.targdep_curs.Next +inline void _db_targdep_curs_Next(_db_targdep_curs &curs) __attribute__((nothrow)); +// item access +// func:samp_make.FDb.targdep_curs.Access +inline samp_make::FTargdep& _db_targdep_curs_Access(_db_targdep_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FDb.targsrc_curs.Reset +inline void _db_targsrc_curs_Reset(_db_targsrc_curs &curs, samp_make::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FDb.targsrc_curs.ValidQ +inline bool _db_targsrc_curs_ValidQ(_db_targsrc_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:samp_make.FDb.targsrc_curs.Next +inline void _db_targsrc_curs_Next(_db_targsrc_curs &curs) __attribute__((nothrow)); +// item access +// func:samp_make.FDb.targsrc_curs.Access +inline samp_make::FTargsrc& _db_targsrc_curs_Access(_db_targsrc_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FDb.targrec_curs.Reset +inline void _db_targrec_curs_Reset(_db_targrec_curs &curs, samp_make::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FDb.targrec_curs.ValidQ +inline bool _db_targrec_curs_ValidQ(_db_targrec_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:samp_make.FDb.targrec_curs.Next +inline void _db_targrec_curs_Next(_db_targrec_curs &curs) __attribute__((nothrow)); +// item access +// func:samp_make.FDb.targrec_curs.Access +inline samp_make::FTargrec& _db_targrec_curs_Access(_db_targrec_curs &curs) __attribute__((nothrow)); +// func:samp_make.FDb.c_target_curs.Reset +inline void _db_c_target_curs_Reset(_db_c_target_curs &curs, samp_make::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FDb.c_target_curs.ValidQ +inline bool _db_c_target_curs_ValidQ(_db_c_target_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:samp_make.FDb.c_target_curs.Next +inline void _db_c_target_curs_Next(_db_c_target_curs &curs) __attribute__((nothrow)); +// item access +// func:samp_make.FDb.c_target_curs.Access +inline samp_make::FTarget& _db_c_target_curs_Access(_db_c_target_curs &curs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:samp_make.FDb..Init +void FDb_Init(); +// func:samp_make.FDb..Uninit +void FDb_Uninit() __attribute__((nothrow)); + +// --- samp_make.FGitfile +// create: samp_make.FDb.gitfile (Lary) +// global access: gitfile (Lary, by rowid) +// global access: ind_gitfile (Thash, hash field gitfile) +struct FGitfile { // samp_make.FGitfile + samp_make::FGitfile* ind_gitfile_next; // hash next + u32 ind_gitfile_hashval; // hash value + algo::Smallstr50 gitfile; // + algo::Comment comment; // + // func:samp_make.FGitfile..AssignOp + inline samp_make::FGitfile& operator =(const samp_make::FGitfile &rhs) = delete; + // func:samp_make.FGitfile..CopyCtor + inline FGitfile(const samp_make::FGitfile &rhs) = delete; +private: + // func:samp_make.FGitfile..Ctor + inline FGitfile() __attribute__((nothrow)); + // func:samp_make.FGitfile..Dtor + inline ~FGitfile() __attribute__((nothrow)); + friend samp_make::FGitfile& gitfile_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend samp_make::FGitfile* gitfile_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void gitfile_RemoveAll() __attribute__((nothrow)); + friend void gitfile_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:samp_make.FGitfile.base.CopyOut +void gitfile_CopyOut(samp_make::FGitfile &row, sampdb::Gitfile &out) __attribute__((nothrow)); +// Copy fields in to row +// func:samp_make.FGitfile.base.CopyIn +void gitfile_CopyIn(samp_make::FGitfile &row, sampdb::Gitfile &in) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:samp_make.FGitfile..Init +inline void FGitfile_Init(samp_make::FGitfile& gitfile); +// func:samp_make.FGitfile..Uninit +void FGitfile_Uninit(samp_make::FGitfile& gitfile) __attribute__((nothrow)); + +// --- samp_make.FTargdep +// create: samp_make.FDb.targdep (Lary) +// global access: targdep (Lary, by rowid) +// global access: ind_targdep (Thash, hash field targdep) +// access: samp_make.FTarget.c_targdep (Ptrary) +struct FTargdep { // samp_make.FTargdep + samp_make::FTargdep* ind_targdep_next; // hash next + u32 ind_targdep_hashval; // hash value + algo::Smallstr50 targdep; // + bool rec; // false use in recipe + bool pre; // false use in prerequisite + algo::Comment comment; // + samp_make::FTarget* p_parent; // reference to parent row + samp_make::FTarget* p_target; // reference to parent row + bool target_c_targdep_in_ary; // false membership flag + // x-reference on samp_make.FTargdep.p_parent prevents copy + // x-reference on samp_make.FTargdep.p_target prevents copy + // func:samp_make.FTargdep..AssignOp + samp_make::FTargdep& operator =(const samp_make::FTargdep &rhs) = delete; + // x-reference on samp_make.FTargdep.p_parent prevents copy + // x-reference on samp_make.FTargdep.p_target prevents copy + // func:samp_make.FTargdep..CopyCtor + FTargdep(const samp_make::FTargdep &rhs) = delete; +private: + // func:samp_make.FTargdep..Ctor + inline FTargdep() __attribute__((nothrow)); + // func:samp_make.FTargdep..Dtor + inline ~FTargdep() __attribute__((nothrow)); + friend samp_make::FTargdep& targdep_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend samp_make::FTargdep* targdep_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void targdep_RemoveAll() __attribute__((nothrow)); + friend void targdep_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:samp_make.FTargdep.base.CopyOut +void targdep_CopyOut(samp_make::FTargdep &row, sampdb::Targdep &out) __attribute__((nothrow)); +// Copy fields in to row +// func:samp_make.FTargdep.base.CopyIn +void targdep_CopyIn(samp_make::FTargdep &row, sampdb::Targdep &in) __attribute__((nothrow)); + +// func:samp_make.FTargdep.target.Get +algo::Smallstr50 target_Get(samp_make::FTargdep& targdep) __attribute__((__warn_unused_result__, nothrow)); + +// func:samp_make.FTargdep.parent.Get +algo::Smallstr50 parent_Get(samp_make::FTargdep& targdep) __attribute__((__warn_unused_result__, nothrow)); + +// Set all fields to initial values. +// func:samp_make.FTargdep..Init +inline void FTargdep_Init(samp_make::FTargdep& targdep); +// func:samp_make.FTargdep..Uninit +void FTargdep_Uninit(samp_make::FTargdep& targdep) __attribute__((nothrow)); + +// --- samp_make.FTarget +// create: samp_make.FDb.target (Lary) +// global access: target (Lary, by rowid) +// global access: ind_target (Thash, hash field target) +// global access: c_target (Ptrary) +// access: samp_make.FTargdep.p_parent (Upptr) +// access: samp_make.FTargdep.p_target (Upptr) +struct FTarget { // samp_make.FTarget + samp_make::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr50 target; // + bool dflt; // false make first target - default target + algo::Comment comment; // + algo::cstring prereq; // collection of make prereq lines + bool select; // false + algo::cstring recipe; // collection of make recipe lines + samp_make::FTargsrc** c_targsrc_elems; // array of pointers + u32 c_targsrc_n; // array of pointers + u32 c_targsrc_max; // capacity of allocated array + samp_make::FTargdep** c_targdep_elems; // array of pointers + u32 c_targdep_n; // array of pointers + u32 c_targdep_max; // capacity of allocated array + samp_make::FTargrec* c_targrec; // optional pointer + bool c_target_in_ary; // false membership flag + // reftype Ptrary of samp_make.FTarget.c_targsrc prohibits copy + // reftype Ptrary of samp_make.FTarget.c_targdep prohibits copy + // x-reference on samp_make.FTarget.c_targrec prevents copy + // func:samp_make.FTarget..AssignOp + samp_make::FTarget& operator =(const samp_make::FTarget &rhs) = delete; + // reftype Ptrary of samp_make.FTarget.c_targsrc prohibits copy + // reftype Ptrary of samp_make.FTarget.c_targdep prohibits copy + // x-reference on samp_make.FTarget.c_targrec prevents copy + // func:samp_make.FTarget..CopyCtor + FTarget(const samp_make::FTarget &rhs) = delete; +private: + // func:samp_make.FTarget..Ctor + inline FTarget() __attribute__((nothrow)); + // func:samp_make.FTarget..Dtor + inline ~FTarget() __attribute__((nothrow)); + friend samp_make::FTarget& target_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend samp_make::FTarget* target_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void target_RemoveAll() __attribute__((nothrow)); + friend void target_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:samp_make.FTarget.base.CopyOut +void target_CopyOut(samp_make::FTarget &row, sampdb::Target &out) __attribute__((nothrow)); +// Copy fields in to row +// func:samp_make.FTarget.base.CopyIn +void target_CopyIn(samp_make::FTarget &row, sampdb::Target &in) __attribute__((nothrow)); + +// Return true if index is empty +// func:samp_make.FTarget.c_targsrc.EmptyQ +inline bool c_targsrc_EmptyQ(samp_make::FTarget& target) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:samp_make.FTarget.c_targsrc.Find +inline samp_make::FTargsrc* c_targsrc_Find(samp_make::FTarget& target, u32 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array of pointers +// func:samp_make.FTarget.c_targsrc.Getary +inline algo::aryptr c_targsrc_Getary(samp_make::FTarget& target) __attribute__((nothrow)); +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +// func:samp_make.FTarget.c_targsrc.Insert +void c_targsrc_Insert(samp_make::FTarget& target, samp_make::FTargsrc& row) __attribute__((nothrow)); +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +// func:samp_make.FTarget.c_targsrc.InsertMaybe +bool c_targsrc_InsertMaybe(samp_make::FTarget& target, samp_make::FTargsrc& row) __attribute__((nothrow)); +// Return number of items in the pointer array +// func:samp_make.FTarget.c_targsrc.N +inline i32 c_targsrc_N(const samp_make::FTarget& target) __attribute__((__warn_unused_result__, nothrow, pure)); +// Find element using linear scan. If element is in array, remove, otherwise do nothing +// func:samp_make.FTarget.c_targsrc.Remove +void c_targsrc_Remove(samp_make::FTarget& target, samp_make::FTargsrc& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:samp_make.FTarget.c_targsrc.RemoveAll +inline void c_targsrc_RemoveAll(samp_make::FTarget& target) __attribute__((nothrow)); +// Reserve space in index for N more elements; +// func:samp_make.FTarget.c_targsrc.Reserve +void c_targsrc_Reserve(samp_make::FTarget& target, u32 n) __attribute__((nothrow)); +// Return reference without bounds checking +// func:samp_make.FTarget.c_targsrc.qFind +inline samp_make::FTargsrc& c_targsrc_qFind(samp_make::FTarget& target, u32 idx) __attribute__((nothrow)); +// True if row is in any ptrary instance +// func:samp_make.FTarget.c_targsrc.InAryQ +inline bool target_c_targsrc_InAryQ(samp_make::FTargsrc& row) __attribute__((nothrow)); +// Reference to last element without bounds checking +// func:samp_make.FTarget.c_targsrc.qLast +inline samp_make::FTargsrc& c_targsrc_qLast(samp_make::FTarget& target) __attribute__((nothrow)); + +// Return true if index is empty +// func:samp_make.FTarget.c_targdep.EmptyQ +inline bool c_targdep_EmptyQ(samp_make::FTarget& target) __attribute__((nothrow)); +// Look up row by row id. Return NULL if out of range +// func:samp_make.FTarget.c_targdep.Find +inline samp_make::FTargdep* c_targdep_Find(samp_make::FTarget& target, u32 t) __attribute__((__warn_unused_result__, nothrow)); +// Return array of pointers +// func:samp_make.FTarget.c_targdep.Getary +inline algo::aryptr c_targdep_Getary(samp_make::FTarget& target) __attribute__((nothrow)); +// Insert pointer to row into array. Row must not already be in array. +// If pointer is already in the array, it may be inserted twice. +// func:samp_make.FTarget.c_targdep.Insert +void c_targdep_Insert(samp_make::FTarget& target, samp_make::FTargdep& row) __attribute__((nothrow)); +// Insert pointer to row in array. +// If row is already in the array, do nothing. +// Return value: whether element was inserted into array. +// func:samp_make.FTarget.c_targdep.InsertMaybe +bool c_targdep_InsertMaybe(samp_make::FTarget& target, samp_make::FTargdep& row) __attribute__((nothrow)); +// Return number of items in the pointer array +// func:samp_make.FTarget.c_targdep.N +inline i32 c_targdep_N(const samp_make::FTarget& target) __attribute__((__warn_unused_result__, nothrow, pure)); +// Find element using linear scan. If element is in array, remove, otherwise do nothing +// func:samp_make.FTarget.c_targdep.Remove +void c_targdep_Remove(samp_make::FTarget& target, samp_make::FTargdep& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:samp_make.FTarget.c_targdep.RemoveAll +inline void c_targdep_RemoveAll(samp_make::FTarget& target) __attribute__((nothrow)); +// Reserve space in index for N more elements; +// func:samp_make.FTarget.c_targdep.Reserve +void c_targdep_Reserve(samp_make::FTarget& target, u32 n) __attribute__((nothrow)); +// Return reference without bounds checking +// func:samp_make.FTarget.c_targdep.qFind +inline samp_make::FTargdep& c_targdep_qFind(samp_make::FTarget& target, u32 idx) __attribute__((nothrow)); +// True if row is in any ptrary instance +// func:samp_make.FTarget.c_targdep.InAryQ +inline bool target_c_targdep_InAryQ(samp_make::FTargdep& row) __attribute__((nothrow)); +// Reference to last element without bounds checking +// func:samp_make.FTarget.c_targdep.qLast +inline samp_make::FTargdep& c_targdep_qLast(samp_make::FTarget& target) __attribute__((nothrow)); + +// Insert row into pointer index. Return final membership status. +// func:samp_make.FTarget.c_targrec.InsertMaybe +inline bool c_targrec_InsertMaybe(samp_make::FTarget& target, samp_make::FTargrec& row) __attribute__((nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:samp_make.FTarget.c_targrec.Remove +inline void c_targrec_Remove(samp_make::FTarget& target, samp_make::FTargrec& row) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:samp_make.FTarget..Init +void FTarget_Init(samp_make::FTarget& target); +// func:samp_make.FTarget.c_targsrc_curs.Reset +inline void target_c_targsrc_curs_Reset(target_c_targsrc_curs &curs, samp_make::FTarget &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FTarget.c_targsrc_curs.ValidQ +inline bool target_c_targsrc_curs_ValidQ(target_c_targsrc_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:samp_make.FTarget.c_targsrc_curs.Next +inline void target_c_targsrc_curs_Next(target_c_targsrc_curs &curs) __attribute__((nothrow)); +// item access +// func:samp_make.FTarget.c_targsrc_curs.Access +inline samp_make::FTargsrc& target_c_targsrc_curs_Access(target_c_targsrc_curs &curs) __attribute__((nothrow)); +// func:samp_make.FTarget.c_targdep_curs.Reset +inline void target_c_targdep_curs_Reset(target_c_targdep_curs &curs, samp_make::FTarget &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:samp_make.FTarget.c_targdep_curs.ValidQ +inline bool target_c_targdep_curs_ValidQ(target_c_targdep_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:samp_make.FTarget.c_targdep_curs.Next +inline void target_c_targdep_curs_Next(target_c_targdep_curs &curs) __attribute__((nothrow)); +// item access +// func:samp_make.FTarget.c_targdep_curs.Access +inline samp_make::FTargdep& target_c_targdep_curs_Access(target_c_targdep_curs &curs) __attribute__((nothrow)); +// func:samp_make.FTarget..Uninit +void FTarget_Uninit(samp_make::FTarget& target) __attribute__((nothrow)); + +// --- samp_make.FTargrec +// create: samp_make.FDb.targrec (Lary) +// global access: targrec (Lary, by rowid) +// global access: ind_targrec (Thash, hash field target) +// access: samp_make.FTarget.c_targrec (Ptr) +struct FTargrec { // samp_make.FTargrec + samp_make::FTargrec* ind_targrec_next; // hash next + u32 ind_targrec_hashval; // hash value + algo::Smallstr50 target; // + algo::cstring recipe; // + algo::Comment comment; // + // func:samp_make.FTargrec..AssignOp + inline samp_make::FTargrec& operator =(const samp_make::FTargrec &rhs) = delete; + // func:samp_make.FTargrec..CopyCtor + inline FTargrec(const samp_make::FTargrec &rhs) = delete; +private: + // func:samp_make.FTargrec..Ctor + inline FTargrec() __attribute__((nothrow)); + // func:samp_make.FTargrec..Dtor + inline ~FTargrec() __attribute__((nothrow)); + friend samp_make::FTargrec& targrec_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend samp_make::FTargrec* targrec_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void targrec_RemoveAll() __attribute__((nothrow)); + friend void targrec_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:samp_make.FTargrec.base.CopyOut +void targrec_CopyOut(samp_make::FTargrec &row, sampdb::Targrec &out) __attribute__((nothrow)); +// Copy fields in to row +// func:samp_make.FTargrec.base.CopyIn +void targrec_CopyIn(samp_make::FTargrec &row, sampdb::Targrec &in) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:samp_make.FTargrec..Init +inline void FTargrec_Init(samp_make::FTargrec& targrec); +// func:samp_make.FTargrec..Uninit +void FTargrec_Uninit(samp_make::FTargrec& targrec) __attribute__((nothrow)); + +// --- samp_make.FTargsrc +// create: samp_make.FDb.targsrc (Lary) +// global access: targsrc (Lary, by rowid) +// global access: ind_targsrc (Thash, hash field targsrc) +// access: samp_make.FTarget.c_targsrc (Ptrary) +struct FTargsrc { // samp_make.FTargsrc + samp_make::FTargsrc* ind_targsrc_next; // hash next + u32 ind_targsrc_hashval; // hash value + algo::Smallstr50 targsrc; // + bool pre; // false use in prerequisite + bool rec; // false use in recipe + algo::Comment comment; // + bool target_c_targsrc_in_ary; // false membership flag + // func:samp_make.FTargsrc..AssignOp + inline samp_make::FTargsrc& operator =(const samp_make::FTargsrc &rhs) = delete; + // func:samp_make.FTargsrc..CopyCtor + inline FTargsrc(const samp_make::FTargsrc &rhs) = delete; +private: + // func:samp_make.FTargsrc..Ctor + inline FTargsrc() __attribute__((nothrow)); + // func:samp_make.FTargsrc..Dtor + inline ~FTargsrc() __attribute__((nothrow)); + friend samp_make::FTargsrc& targsrc_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend samp_make::FTargsrc* targsrc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void targsrc_RemoveAll() __attribute__((nothrow)); + friend void targsrc_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:samp_make.FTargsrc.base.CopyOut +void targsrc_CopyOut(samp_make::FTargsrc &row, sampdb::Targsrc &out) __attribute__((nothrow)); +// Copy fields in to row +// func:samp_make.FTargsrc.base.CopyIn +void targsrc_CopyIn(samp_make::FTargsrc &row, sampdb::Targsrc &in) __attribute__((nothrow)); + +// func:samp_make.FTargsrc.target.Get +algo::Smallstr50 target_Get(samp_make::FTargsrc& targsrc) __attribute__((__warn_unused_result__, nothrow)); + +// func:samp_make.FTargsrc.src.Get +algo::Smallstr50 src_Get(samp_make::FTargsrc& targsrc) __attribute__((__warn_unused_result__, nothrow)); + +// Set all fields to initial values. +// func:samp_make.FTargsrc..Init +inline void FTargsrc_Init(samp_make::FTargsrc& targsrc); +// func:samp_make.FTargsrc..Uninit +void FTargsrc_Uninit(samp_make::FTargsrc& targsrc) __attribute__((nothrow)); + +// --- samp_make.FieldId +#pragma pack(push,1) +struct FieldId { // samp_make.FieldId: Field read helper + i32 value; // -1 + // func:samp_make.FieldId.value.Cast + inline operator samp_make_FieldIdEnum() const __attribute__((nothrow)); + // func:samp_make.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:samp_make.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:samp_make.FieldId..EnumCtor + inline FieldId(samp_make_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:samp_make.FieldId.value.GetEnum +inline samp_make_FieldIdEnum value_GetEnum(const samp_make::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:samp_make.FieldId.value.SetEnum +inline void value_SetEnum(samp_make::FieldId& parent, samp_make_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:samp_make.FieldId.value.ToCstr +const char* value_ToCstr(const samp_make::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:samp_make.FieldId.value.Print +void value_Print(const samp_make::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:samp_make.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(samp_make::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:samp_make.FieldId.value.SetStrptr +void value_SetStrptr(samp_make::FieldId& parent, algo::strptr rhs, samp_make_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:samp_make.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(samp_make::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of samp_make::FieldId from an ascii string. +// The format of the string is the format of the samp_make::FieldId's only field +// func:samp_make.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(samp_make::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:samp_make.FieldId..Init +inline void FieldId_Init(samp_make::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:samp_make.FieldId.String printfmt:Raw +// func:samp_make.FieldId..Print +void FieldId_Print(samp_make::FieldId& row, algo::cstring& str) __attribute__((nothrow)); + +// --- samp_make.TableId +struct TableId { // samp_make.TableId: Index of table in this namespace + i32 value; // -1 index of table + // func:samp_make.TableId.value.Cast + inline operator samp_make_TableIdEnum() const __attribute__((nothrow)); + // func:samp_make.TableId..Ctor + inline TableId() __attribute__((nothrow)); + // func:samp_make.TableId..FieldwiseCtor + explicit inline TableId(i32 in_value) __attribute__((nothrow)); + // func:samp_make.TableId..EnumCtor + inline TableId(samp_make_TableIdEnum arg) __attribute__((nothrow)); +}; + +// Get value of field as enum type +// func:samp_make.TableId.value.GetEnum +inline samp_make_TableIdEnum value_GetEnum(const samp_make::TableId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:samp_make.TableId.value.SetEnum +inline void value_SetEnum(samp_make::TableId& parent, samp_make_TableIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:samp_make.TableId.value.ToCstr +const char* value_ToCstr(const samp_make::TableId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:samp_make.TableId.value.Print +void value_Print(const samp_make::TableId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:samp_make.TableId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(samp_make::TableId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:samp_make.TableId.value.SetStrptr +void value_SetStrptr(samp_make::TableId& parent, algo::strptr rhs, samp_make_TableIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:samp_make.TableId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(samp_make::TableId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of samp_make::TableId from an ascii string. +// The format of the string is the format of the samp_make::TableId's only field +// func:samp_make.TableId..ReadStrptrMaybe +bool TableId_ReadStrptrMaybe(samp_make::TableId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:samp_make.TableId..Init +inline void TableId_Init(samp_make::TableId& parent); +// print string representation of ROW to string STR +// cfmt:samp_make.TableId.String printfmt:Raw +// func:samp_make.TableId..Print +void TableId_Print(samp_make::TableId& row, algo::cstring& str) __attribute__((nothrow)); +} // gen:ns_print_struct +namespace samp_make { // gen:ns_curstext + +struct _db_gitfile_curs {// cursor + typedef samp_make::FGitfile ChildType; + samp_make::FDb *parent; + i64 index; + _db_gitfile_curs(){ parent=NULL; index=0; } +}; + + +struct _db_target_curs {// cursor + typedef samp_make::FTarget ChildType; + samp_make::FDb *parent; + i64 index; + _db_target_curs(){ parent=NULL; index=0; } +}; + + +struct _db_targdep_curs {// cursor + typedef samp_make::FTargdep ChildType; + samp_make::FDb *parent; + i64 index; + _db_targdep_curs(){ parent=NULL; index=0; } +}; + + +struct _db_targsrc_curs {// cursor + typedef samp_make::FTargsrc ChildType; + samp_make::FDb *parent; + i64 index; + _db_targsrc_curs(){ parent=NULL; index=0; } +}; + + +struct _db_targrec_curs {// cursor + typedef samp_make::FTargrec ChildType; + samp_make::FDb *parent; + i64 index; + _db_targrec_curs(){ parent=NULL; index=0; } +}; + + +struct _db_c_target_curs {// fcurs:samp_make.FDb.c_target/curs + typedef samp_make::FTarget ChildType; + samp_make::FTarget** elems; + u32 n_elems; + u32 index; + _db_c_target_curs() { elems=NULL; n_elems=0; index=0; } +}; + + +struct target_c_targsrc_curs {// fcurs:samp_make.FTarget.c_targsrc/curs + typedef samp_make::FTargsrc ChildType; + samp_make::FTargsrc** elems; + u32 n_elems; + u32 index; + target_c_targsrc_curs() { elems=NULL; n_elems=0; index=0; } +}; + + +struct target_c_targdep_curs {// fcurs:samp_make.FTarget.c_targdep/curs + typedef samp_make::FTargdep ChildType; + samp_make::FTargdep** elems; + u32 n_elems; + u32 index; + target_c_targdep_curs() { elems=NULL; n_elems=0; index=0; } +}; + +} // gen:ns_curstext +namespace samp_make { // gen:ns_func +// func:samp_make...StaticCheck +void StaticCheck(); +} // gen:ns_func +// func:samp_make...main +int main(int argc, char **argv); +#if defined(WIN32) +// func:samp_make...WinMain +int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int); +#endif +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const samp_make::trace &row);// cfmt:samp_make.trace.String +inline algo::cstring &operator <<(algo::cstring &str, const samp_make::FieldId &row);// cfmt:samp_make.FieldId.String +inline algo::cstring &operator <<(algo::cstring &str, const samp_make::TableId &row);// cfmt:samp_make.TableId.String +} diff --git a/include/gen/samp_make_gen.inl.h b/include/gen/samp_make_gen.inl.h new file mode 100644 index 00000000..821bc83e --- /dev/null +++ b/include/gen/samp_make_gen.inl.h @@ -0,0 +1,876 @@ +// +// include/gen/samp_make_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/command_gen.inl.h" +#include "include/gen/sampdb_gen.inl.h" +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude + +// --- samp_make.trace..Ctor +inline samp_make::trace::trace() { +} + +// --- samp_make.FDb.gitfile.EmptyQ +// Return true if index is empty +inline bool samp_make::gitfile_EmptyQ() { + return _db.gitfile_n == 0; +} + +// --- samp_make.FDb.gitfile.Find +// Look up row by row id. Return NULL if out of range +inline samp_make::FGitfile* samp_make::gitfile_Find(u64 t) { + samp_make::FGitfile *retval = NULL; + if (LIKELY(u64(t) < u64(_db.gitfile_n))) { + u64 x = t + 1; + u64 bsr = algo::u64_BitScanReverse(x); + u64 base = u64(1)< samp_make::c_target_Getary() { + return algo::aryptr(_db.c_target_elems, _db.c_target_n); +} + +// --- samp_make.FDb.c_target.N +// Return number of items in the pointer array +inline i32 samp_make::c_target_N() { + return _db.c_target_n; +} + +// --- samp_make.FDb.c_target.RemoveAll +// Empty the index. (The rows are not deleted) +inline void samp_make::c_target_RemoveAll() { + for (u32 i = 0; i < _db.c_target_n; i++) { + // mark all elements as not-in-array + _db.c_target_elems[i]->c_target_in_ary = false; + } + _db.c_target_n = 0; +} + +// --- samp_make.FDb.c_target.qFind +// Return reference without bounds checking +inline samp_make::FTarget& samp_make::c_target_qFind(u32 idx) { + return *_db.c_target_elems[idx]; +} + +// --- samp_make.FDb.c_target.InAryQ +// True if row is in any ptrary instance +inline bool samp_make::c_target_InAryQ(samp_make::FTarget& row) { + return row.c_target_in_ary; +} + +// --- samp_make.FDb.c_target.qLast +// Reference to last element without bounds checking +inline samp_make::FTarget& samp_make::c_target_qLast() { + return *_db.c_target_elems[_db.c_target_n-1]; +} + +// --- samp_make.FDb.gitfile_curs.Reset +// cursor points to valid item +inline void samp_make::_db_gitfile_curs_Reset(_db_gitfile_curs &curs, samp_make::FDb &parent) { + curs.parent = &parent; + curs.index = 0; +} + +// --- samp_make.FDb.gitfile_curs.ValidQ +// cursor points to valid item +inline bool samp_make::_db_gitfile_curs_ValidQ(_db_gitfile_curs &curs) { + return curs.index < _db.gitfile_n; +} + +// --- samp_make.FDb.gitfile_curs.Next +// proceed to next item +inline void samp_make::_db_gitfile_curs_Next(_db_gitfile_curs &curs) { + curs.index++; +} + +// --- samp_make.FDb.gitfile_curs.Access +// item access +inline samp_make::FGitfile& samp_make::_db_gitfile_curs_Access(_db_gitfile_curs &curs) { + return gitfile_qFind(u64(curs.index)); +} + +// --- samp_make.FDb.target_curs.Reset +// cursor points to valid item +inline void samp_make::_db_target_curs_Reset(_db_target_curs &curs, samp_make::FDb &parent) { + curs.parent = &parent; + curs.index = 0; +} + +// --- samp_make.FDb.target_curs.ValidQ +// cursor points to valid item +inline bool samp_make::_db_target_curs_ValidQ(_db_target_curs &curs) { + return curs.index < _db.target_n; +} + +// --- samp_make.FDb.target_curs.Next +// proceed to next item +inline void samp_make::_db_target_curs_Next(_db_target_curs &curs) { + curs.index++; +} + +// --- samp_make.FDb.target_curs.Access +// item access +inline samp_make::FTarget& samp_make::_db_target_curs_Access(_db_target_curs &curs) { + return target_qFind(u64(curs.index)); +} + +// --- samp_make.FDb.targdep_curs.Reset +// cursor points to valid item +inline void samp_make::_db_targdep_curs_Reset(_db_targdep_curs &curs, samp_make::FDb &parent) { + curs.parent = &parent; + curs.index = 0; +} + +// --- samp_make.FDb.targdep_curs.ValidQ +// cursor points to valid item +inline bool samp_make::_db_targdep_curs_ValidQ(_db_targdep_curs &curs) { + return curs.index < _db.targdep_n; +} + +// --- samp_make.FDb.targdep_curs.Next +// proceed to next item +inline void samp_make::_db_targdep_curs_Next(_db_targdep_curs &curs) { + curs.index++; +} + +// --- samp_make.FDb.targdep_curs.Access +// item access +inline samp_make::FTargdep& samp_make::_db_targdep_curs_Access(_db_targdep_curs &curs) { + return targdep_qFind(u64(curs.index)); +} + +// --- samp_make.FDb.targsrc_curs.Reset +// cursor points to valid item +inline void samp_make::_db_targsrc_curs_Reset(_db_targsrc_curs &curs, samp_make::FDb &parent) { + curs.parent = &parent; + curs.index = 0; +} + +// --- samp_make.FDb.targsrc_curs.ValidQ +// cursor points to valid item +inline bool samp_make::_db_targsrc_curs_ValidQ(_db_targsrc_curs &curs) { + return curs.index < _db.targsrc_n; +} + +// --- samp_make.FDb.targsrc_curs.Next +// proceed to next item +inline void samp_make::_db_targsrc_curs_Next(_db_targsrc_curs &curs) { + curs.index++; +} + +// --- samp_make.FDb.targsrc_curs.Access +// item access +inline samp_make::FTargsrc& samp_make::_db_targsrc_curs_Access(_db_targsrc_curs &curs) { + return targsrc_qFind(u64(curs.index)); +} + +// --- samp_make.FDb.targrec_curs.Reset +// cursor points to valid item +inline void samp_make::_db_targrec_curs_Reset(_db_targrec_curs &curs, samp_make::FDb &parent) { + curs.parent = &parent; + curs.index = 0; +} + +// --- samp_make.FDb.targrec_curs.ValidQ +// cursor points to valid item +inline bool samp_make::_db_targrec_curs_ValidQ(_db_targrec_curs &curs) { + return curs.index < _db.targrec_n; +} + +// --- samp_make.FDb.targrec_curs.Next +// proceed to next item +inline void samp_make::_db_targrec_curs_Next(_db_targrec_curs &curs) { + curs.index++; +} + +// --- samp_make.FDb.targrec_curs.Access +// item access +inline samp_make::FTargrec& samp_make::_db_targrec_curs_Access(_db_targrec_curs &curs) { + return targrec_qFind(u64(curs.index)); +} + +// --- samp_make.FDb.c_target_curs.Reset +inline void samp_make::_db_c_target_curs_Reset(_db_c_target_curs &curs, samp_make::FDb &parent) { + curs.elems = parent.c_target_elems; + curs.n_elems = parent.c_target_n; + curs.index = 0; +} + +// --- samp_make.FDb.c_target_curs.ValidQ +// cursor points to valid item +inline bool samp_make::_db_c_target_curs_ValidQ(_db_c_target_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- samp_make.FDb.c_target_curs.Next +// proceed to next item +inline void samp_make::_db_c_target_curs_Next(_db_c_target_curs &curs) { + curs.index++; +} + +// --- samp_make.FDb.c_target_curs.Access +// item access +inline samp_make::FTarget& samp_make::_db_c_target_curs_Access(_db_c_target_curs &curs) { + return *curs.elems[curs.index]; +} + +// --- samp_make.FGitfile..Init +// Set all fields to initial values. +inline void samp_make::FGitfile_Init(samp_make::FGitfile& gitfile) { + gitfile.ind_gitfile_next = (samp_make::FGitfile*)-1; // (samp_make.FDb.ind_gitfile) not-in-hash + gitfile.ind_gitfile_hashval = 0; // stored hash value +} + +// --- samp_make.FGitfile..Ctor +inline samp_make::FGitfile::FGitfile() { + samp_make::FGitfile_Init(*this); +} + +// --- samp_make.FGitfile..Dtor +inline samp_make::FGitfile::~FGitfile() { + samp_make::FGitfile_Uninit(*this); +} + +// --- samp_make.FTargdep..Init +// Set all fields to initial values. +inline void samp_make::FTargdep_Init(samp_make::FTargdep& targdep) { + targdep.rec = bool(false); + targdep.pre = bool(false); + targdep.p_parent = NULL; + targdep.p_target = NULL; + targdep.target_c_targdep_in_ary = bool(false); + targdep.ind_targdep_next = (samp_make::FTargdep*)-1; // (samp_make.FDb.ind_targdep) not-in-hash + targdep.ind_targdep_hashval = 0; // stored hash value +} + +// --- samp_make.FTargdep..Ctor +inline samp_make::FTargdep::FTargdep() { + samp_make::FTargdep_Init(*this); +} + +// --- samp_make.FTargdep..Dtor +inline samp_make::FTargdep::~FTargdep() { + samp_make::FTargdep_Uninit(*this); +} + +// --- samp_make.FTarget.c_targsrc.EmptyQ +// Return true if index is empty +inline bool samp_make::c_targsrc_EmptyQ(samp_make::FTarget& target) { + return target.c_targsrc_n == 0; +} + +// --- samp_make.FTarget.c_targsrc.Find +// Look up row by row id. Return NULL if out of range +inline samp_make::FTargsrc* samp_make::c_targsrc_Find(samp_make::FTarget& target, u32 t) { + samp_make::FTargsrc *retval = NULL; + u64 idx = t; + u64 lim = target.c_targsrc_n; + if (idx < lim) { + retval = target.c_targsrc_elems[idx]; + } + return retval; +} + +// --- samp_make.FTarget.c_targsrc.Getary +// Return array of pointers +inline algo::aryptr samp_make::c_targsrc_Getary(samp_make::FTarget& target) { + return algo::aryptr(target.c_targsrc_elems, target.c_targsrc_n); +} + +// --- samp_make.FTarget.c_targsrc.N +// Return number of items in the pointer array +inline i32 samp_make::c_targsrc_N(const samp_make::FTarget& target) { + return target.c_targsrc_n; +} + +// --- samp_make.FTarget.c_targsrc.RemoveAll +// Empty the index. (The rows are not deleted) +inline void samp_make::c_targsrc_RemoveAll(samp_make::FTarget& target) { + for (u32 i = 0; i < target.c_targsrc_n; i++) { + // mark all elements as not-in-array + target.c_targsrc_elems[i]->target_c_targsrc_in_ary = false; + } + target.c_targsrc_n = 0; +} + +// --- samp_make.FTarget.c_targsrc.qFind +// Return reference without bounds checking +inline samp_make::FTargsrc& samp_make::c_targsrc_qFind(samp_make::FTarget& target, u32 idx) { + return *target.c_targsrc_elems[idx]; +} + +// --- samp_make.FTarget.c_targsrc.InAryQ +// True if row is in any ptrary instance +inline bool samp_make::target_c_targsrc_InAryQ(samp_make::FTargsrc& row) { + return row.target_c_targsrc_in_ary; +} + +// --- samp_make.FTarget.c_targsrc.qLast +// Reference to last element without bounds checking +inline samp_make::FTargsrc& samp_make::c_targsrc_qLast(samp_make::FTarget& target) { + return *target.c_targsrc_elems[target.c_targsrc_n-1]; +} + +// --- samp_make.FTarget.c_targdep.EmptyQ +// Return true if index is empty +inline bool samp_make::c_targdep_EmptyQ(samp_make::FTarget& target) { + return target.c_targdep_n == 0; +} + +// --- samp_make.FTarget.c_targdep.Find +// Look up row by row id. Return NULL if out of range +inline samp_make::FTargdep* samp_make::c_targdep_Find(samp_make::FTarget& target, u32 t) { + samp_make::FTargdep *retval = NULL; + u64 idx = t; + u64 lim = target.c_targdep_n; + if (idx < lim) { + retval = target.c_targdep_elems[idx]; + } + return retval; +} + +// --- samp_make.FTarget.c_targdep.Getary +// Return array of pointers +inline algo::aryptr samp_make::c_targdep_Getary(samp_make::FTarget& target) { + return algo::aryptr(target.c_targdep_elems, target.c_targdep_n); +} + +// --- samp_make.FTarget.c_targdep.N +// Return number of items in the pointer array +inline i32 samp_make::c_targdep_N(const samp_make::FTarget& target) { + return target.c_targdep_n; +} + +// --- samp_make.FTarget.c_targdep.RemoveAll +// Empty the index. (The rows are not deleted) +inline void samp_make::c_targdep_RemoveAll(samp_make::FTarget& target) { + for (u32 i = 0; i < target.c_targdep_n; i++) { + // mark all elements as not-in-array + target.c_targdep_elems[i]->target_c_targdep_in_ary = false; + } + target.c_targdep_n = 0; +} + +// --- samp_make.FTarget.c_targdep.qFind +// Return reference without bounds checking +inline samp_make::FTargdep& samp_make::c_targdep_qFind(samp_make::FTarget& target, u32 idx) { + return *target.c_targdep_elems[idx]; +} + +// --- samp_make.FTarget.c_targdep.InAryQ +// True if row is in any ptrary instance +inline bool samp_make::target_c_targdep_InAryQ(samp_make::FTargdep& row) { + return row.target_c_targdep_in_ary; +} + +// --- samp_make.FTarget.c_targdep.qLast +// Reference to last element without bounds checking +inline samp_make::FTargdep& samp_make::c_targdep_qLast(samp_make::FTarget& target) { + return *target.c_targdep_elems[target.c_targdep_n-1]; +} + +// --- samp_make.FTarget.c_targrec.InsertMaybe +// Insert row into pointer index. Return final membership status. +inline bool samp_make::c_targrec_InsertMaybe(samp_make::FTarget& target, samp_make::FTargrec& row) { + samp_make::FTargrec* ptr = target.c_targrec; + bool retval = (ptr == NULL) | (ptr == &row); + if (retval) { + target.c_targrec = &row; + } + return retval; +} + +// --- samp_make.FTarget.c_targrec.Remove +// Remove element from index. If element is not in index, do nothing. +inline void samp_make::c_targrec_Remove(samp_make::FTarget& target, samp_make::FTargrec& row) { + samp_make::FTargrec *ptr = target.c_targrec; + if (LIKELY(ptr == &row)) { + target.c_targrec = NULL; + } +} + +// --- samp_make.FTarget.c_targsrc_curs.Reset +inline void samp_make::target_c_targsrc_curs_Reset(target_c_targsrc_curs &curs, samp_make::FTarget &parent) { + curs.elems = parent.c_targsrc_elems; + curs.n_elems = parent.c_targsrc_n; + curs.index = 0; +} + +// --- samp_make.FTarget.c_targsrc_curs.ValidQ +// cursor points to valid item +inline bool samp_make::target_c_targsrc_curs_ValidQ(target_c_targsrc_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- samp_make.FTarget.c_targsrc_curs.Next +// proceed to next item +inline void samp_make::target_c_targsrc_curs_Next(target_c_targsrc_curs &curs) { + curs.index++; +} + +// --- samp_make.FTarget.c_targsrc_curs.Access +// item access +inline samp_make::FTargsrc& samp_make::target_c_targsrc_curs_Access(target_c_targsrc_curs &curs) { + return *curs.elems[curs.index]; +} + +// --- samp_make.FTarget.c_targdep_curs.Reset +inline void samp_make::target_c_targdep_curs_Reset(target_c_targdep_curs &curs, samp_make::FTarget &parent) { + curs.elems = parent.c_targdep_elems; + curs.n_elems = parent.c_targdep_n; + curs.index = 0; +} + +// --- samp_make.FTarget.c_targdep_curs.ValidQ +// cursor points to valid item +inline bool samp_make::target_c_targdep_curs_ValidQ(target_c_targdep_curs &curs) { + return curs.index < curs.n_elems; +} + +// --- samp_make.FTarget.c_targdep_curs.Next +// proceed to next item +inline void samp_make::target_c_targdep_curs_Next(target_c_targdep_curs &curs) { + curs.index++; +} + +// --- samp_make.FTarget.c_targdep_curs.Access +// item access +inline samp_make::FTargdep& samp_make::target_c_targdep_curs_Access(target_c_targdep_curs &curs) { + return *curs.elems[curs.index]; +} + +// --- samp_make.FTarget..Ctor +inline samp_make::FTarget::FTarget() { + samp_make::FTarget_Init(*this); +} + +// --- samp_make.FTarget..Dtor +inline samp_make::FTarget::~FTarget() { + samp_make::FTarget_Uninit(*this); +} + +// --- samp_make.FTargrec..Init +// Set all fields to initial values. +inline void samp_make::FTargrec_Init(samp_make::FTargrec& targrec) { + targrec.ind_targrec_next = (samp_make::FTargrec*)-1; // (samp_make.FDb.ind_targrec) not-in-hash + targrec.ind_targrec_hashval = 0; // stored hash value +} + +// --- samp_make.FTargrec..Ctor +inline samp_make::FTargrec::FTargrec() { + samp_make::FTargrec_Init(*this); +} + +// --- samp_make.FTargrec..Dtor +inline samp_make::FTargrec::~FTargrec() { + samp_make::FTargrec_Uninit(*this); +} + +// --- samp_make.FTargsrc..Init +// Set all fields to initial values. +inline void samp_make::FTargsrc_Init(samp_make::FTargsrc& targsrc) { + targsrc.pre = bool(false); + targsrc.rec = bool(false); + targsrc.target_c_targsrc_in_ary = bool(false); + targsrc.ind_targsrc_next = (samp_make::FTargsrc*)-1; // (samp_make.FDb.ind_targsrc) not-in-hash + targsrc.ind_targsrc_hashval = 0; // stored hash value +} + +// --- samp_make.FTargsrc..Ctor +inline samp_make::FTargsrc::FTargsrc() { + samp_make::FTargsrc_Init(*this); +} + +// --- samp_make.FTargsrc..Dtor +inline samp_make::FTargsrc::~FTargsrc() { + samp_make::FTargsrc_Uninit(*this); +} + +// --- samp_make.FieldId.value.GetEnum +// Get value of field as enum type +inline samp_make_FieldIdEnum samp_make::value_GetEnum(const samp_make::FieldId& parent) { + return samp_make_FieldIdEnum(parent.value); +} + +// --- samp_make.FieldId.value.SetEnum +// Set value of field from enum type. +inline void samp_make::value_SetEnum(samp_make::FieldId& parent, samp_make_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- samp_make.FieldId.value.Cast +inline samp_make::FieldId::operator samp_make_FieldIdEnum() const { + return samp_make_FieldIdEnum((*this).value); +} + +// --- samp_make.FieldId..Init +// Set all fields to initial values. +inline void samp_make::FieldId_Init(samp_make::FieldId& parent) { + parent.value = i32(-1); +} + +// --- samp_make.FieldId..Ctor +inline samp_make::FieldId::FieldId() { + samp_make::FieldId_Init(*this); +} + +// --- samp_make.FieldId..FieldwiseCtor +inline samp_make::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- samp_make.FieldId..EnumCtor +inline samp_make::FieldId::FieldId(samp_make_FieldIdEnum arg) { + this->value = i32(arg); +} + +// --- samp_make.TableId.value.GetEnum +// Get value of field as enum type +inline samp_make_TableIdEnum samp_make::value_GetEnum(const samp_make::TableId& parent) { + return samp_make_TableIdEnum(parent.value); +} + +// --- samp_make.TableId.value.SetEnum +// Set value of field from enum type. +inline void samp_make::value_SetEnum(samp_make::TableId& parent, samp_make_TableIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- samp_make.TableId.value.Cast +inline samp_make::TableId::operator samp_make_TableIdEnum() const { + return samp_make_TableIdEnum((*this).value); +} + +// --- samp_make.TableId..Init +// Set all fields to initial values. +inline void samp_make::TableId_Init(samp_make::TableId& parent) { + parent.value = i32(-1); +} + +// --- samp_make.TableId..Ctor +inline samp_make::TableId::TableId() { + samp_make::TableId_Init(*this); +} + +// --- samp_make.TableId..FieldwiseCtor +inline samp_make::TableId::TableId(i32 in_value) + : value(in_value) + { +} + +// --- samp_make.TableId..EnumCtor +inline samp_make::TableId::TableId(samp_make_TableIdEnum arg) { + this->value = i32(arg); +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const samp_make::trace &row) {// cfmt:samp_make.trace.String + samp_make::trace_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const samp_make::FieldId &row) {// cfmt:samp_make.FieldId.String + samp_make::FieldId_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const samp_make::TableId &row) {// cfmt:samp_make.TableId.String + samp_make::TableId_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/samp_meng_gen.h b/include/gen/samp_meng_gen.h index c4c170f1..8abe68d7 100644 --- a/include/gen/samp_meng_gen.h +++ b/include/gen/samp_meng_gen.h @@ -76,7 +76,7 @@ enum samp_meng_MsgHeader_type_Enum { // samp_meng.M ,samp_meng_MsgHeader_type_samp_meng_NewUserMsg = 6 // From matching engine: new user ,samp_meng_MsgHeader_type_samp_meng_NewUserReqMsg = 14 // To matching engine: new user request ,samp_meng_MsgHeader_type_samp_meng_OrderTradeMsg = 4 // From matching engine: trade order - ,samp_meng_MsgHeader_type_samp_meng_TextMsg = 7 // debug message + ,samp_meng_MsgHeader_type_samp_meng_TextMsg = 7 // Debug message }; enum { samp_meng_MsgHeader_type_Enum_N = 11 }; @@ -237,11 +237,28 @@ void CancelReqMsg_Print(samp_meng::CancelReqMsg& row, algo::cstr // --- samp_meng.trace #pragma pack(push,1) struct trace { // samp_meng.trace + u64 dispatch_In_CancelReqMsg; // 0 Total number of CancelReqMsg processed by samp_meng + u64 dispatch_In_CancelReqMsg_cycles; // 0 + u64 dispatch_In_MassCancelReqMsg; // 0 Total number of MassCancelReqMsg processed by samp_meng + u64 dispatch_In_MassCancelReqMsg_cycles; // 0 + u64 dispatch_In_NewOrderReqMsg; // 0 Total number of NewOrderReqMsg processed by samp_meng + u64 dispatch_In_NewOrderReqMsg_cycles; // 0 + u64 dispatch_In_NewSymbolReqMsg; // 0 Total number of NewSymbolReqMsg processed by samp_meng + u64 dispatch_In_NewSymbolReqMsg_cycles; // 0 + u64 dispatch_In_NewUserReqMsg; // 0 Total number of NewUserReqMsg processed by samp_meng + u64 dispatch_In_NewUserReqMsg_cycles; // 0 + u64 dispatch_In_TextMsg; // 0 Total number of TextMsg processed by samp_meng + u64 dispatch_In_TextMsg_cycles; // 0 + u64 dispatch_In_Unkmsg; // 0 + u64 dispatch_In_Unkmsg_cycles; // 0 // func:samp_meng.trace..Ctor inline trace() __attribute__((nothrow)); }; #pragma pack(pop) +// Set all fields to initial values. +// func:samp_meng.trace..Init +void trace_Init(samp_meng::trace& parent); // print string representation of ROW to string STR // cfmt:samp_meng.trace.String printfmt:Tuple // func:samp_meng.trace..Print @@ -249,7 +266,7 @@ void trace_Print(samp_meng::trace& row, algo::cstring& str) __at // --- samp_meng.FDb // create: samp_meng.FDb._db (Global) -struct FDb { // samp_meng.FDb +struct FDb { // samp_meng.FDb: In-memory database samp_meng::FFdin* fdin_lary[32]; // level array i32 fdin_n; // number of elements in array command::samp_meng cmdline; // @@ -509,6 +526,9 @@ void ind_symbol_Remove(samp_meng::FSymbol& row) __attribute__((n // Reserve enough room in the hash for N more elements. Return success code. // func:samp_meng.FDb.ind_symbol.Reserve void ind_symbol_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:samp_meng.FDb.ind_symbol.AbsReserve +void ind_symbol_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -561,6 +581,9 @@ void ind_order_Remove(samp_meng::FOrder& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:samp_meng.FDb.ind_order.Reserve void ind_order_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:samp_meng.FDb.ind_order.AbsReserve +void ind_order_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -652,6 +675,9 @@ void ind_user_Remove(samp_meng::FUser& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:samp_meng.FDb.ind_user.Reserve void ind_user_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:samp_meng.FDb.ind_user.AbsReserve +void ind_user_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:samp_meng.FDb.fdin_curs.Reset @@ -724,22 +750,22 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: fdin (Lary, by rowid) // global access: cd_fdin_eof (Llist) // global access: cd_fdin_read (Llist) -struct FFdin { // samp_meng.FFdin: FD input +struct FFdin { // samp_meng.FFdin: File descriptor input samp_meng::FFdin* cd_fdin_eof_next; // zslist link; -1 means not-in-list samp_meng::FFdin* cd_fdin_eof_prev; // previous element samp_meng::FFdin* cd_fdin_read_next; // zslist link; -1 means not-in-list samp_meng::FFdin* cd_fdin_read_prev; // previous element algo_lib::FIohook iohook; // - u8 in_elems[8192]; // pointer to elements of inline array + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array i32 in_start; // beginning of valid bytes (in bytes) i32 in_end; // end of valid bytes (in bytes) - bool in_eof; // no more data will be written to buffer + i32 in_msglen; // current message length algo::Errcode in_err; // system error code + algo_lib::FIohook in_iohook; // edge-triggered hook for the buffer + bool in_eof; // no more data will be written to buffer bool in_msgvalid; // current message is valid - i32 in_msglen; // current message length - algo_lib::FIohook in_iohook; // edge-triggered hook for refilling buffer bool in_epoll_enable; // use epoll? - enum { in_max = 8192 }; // value field samp_meng.FFdin.iohook is not copiable // field samp_meng.FFdin.in prevents copy // func:samp_meng.FFdin..AssignOp @@ -781,6 +807,12 @@ void in_EndRead(samp_meng::FFdin& fdin) __attribute__((nothrow)) // // func:samp_meng.FFdin.in.GetMsg algo::aryptr in_GetMsg(samp_meng::FFdin& fdin) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:samp_meng.FFdin.in.Realloc +void in_Realloc(samp_meng::FFdin& fdin, int new_max) __attribute__((nothrow)); // Return max. number of bytes in the buffer. // func:samp_meng.FFdin.in.Max inline i32 in_Max(samp_meng::FFdin& fdin) __attribute__((nothrow)); @@ -803,13 +835,17 @@ void in_SkipBytes(samp_meng::FFdin& fdin, int n) __attribute__(( // Skip current message, if any. // func:samp_meng.FFdin.in.SkipMsg void in_SkipMsg(samp_meng::FFdin& fdin) __attribute__((nothrow)); -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. // // func:samp_meng.FFdin.in.WriteAll bool in_WriteAll(samp_meng::FFdin& fdin, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:samp_meng.FFdin.in.WriteReserve +void in_WriteReserve(samp_meng::FFdin& fdin, u8 *in, i32 in_n) __attribute__((nothrow)); // Set all fields to initial values. // func:samp_meng.FFdin..Init @@ -819,7 +855,7 @@ void FFdin_Uninit(samp_meng::FFdin& fdin) __attribute__((nothrow // --- samp_meng.I64Price8 #pragma pack(push,1) -struct I64Price8 { // samp_meng.I64Price8 +struct I64Price8 { // samp_meng.I64Price8: Price type (8 implied decimal places) i64 value; // 0 // func:samp_meng.I64Price8..EqOp inline bool operator ==(const samp_meng::I64Price8 &rhs) const __attribute__((nothrow)); @@ -901,7 +937,7 @@ inline bool I64Price8_Update(samp_meng::I64Price8 &lhs, samp_meng::I64P void I64Price8_Print(samp_meng::I64Price8 row, algo::cstring& str) __attribute__((nothrow)); // --- samp_meng.Ordkey -struct Ordkey { // samp_meng.Ordkey +struct Ordkey { // samp_meng.Ordkey: Order key u64 price; // 0 u64 time; // 0 // func:samp_meng.Ordkey..EqOp @@ -938,19 +974,20 @@ inline bool Ordkey_Update(samp_meng::Ordkey &lhs, samp_meng::Ordkey& rh // global access: ind_order (Thash, hash field order) // access: samp_meng.FOrdq.bh_order (Bheap) // access: samp_meng.FUser.zd_order (Llist) -struct FOrder { // samp_meng.FOrder - samp_meng::FOrder* order_next; // Pointer to next free element int tpool - samp_meng::FOrder* ind_order_next; // hash next - i64 order; // 0 - samp_meng::FOrdq* p_ordq; // reference to parent row - samp_meng::I64Price8 price; // - algo::UnTime time; // - u32 qty; // 0 - samp_meng::Ordkey ordkey; // - samp_meng::FUser* p_user; // reference to parent row - i32 bh_order_idx; // index in heap; -1 means not-in-heap - samp_meng::FOrder* zd_order_next; // zslist link; -1 means not-in-list - samp_meng::FOrder* zd_order_prev; // previous element +struct FOrder { // samp_meng.FOrder: Order record + samp_meng::FOrder* order_next; // Pointer to next free element int tpool + samp_meng::FOrder* ind_order_next; // hash next + u32 ind_order_hashval; // hash value + i64 order; // 0 + samp_meng::FOrdq* p_ordq; // reference to parent row + samp_meng::I64Price8 price; // + algo::UnTime time; // + u32 qty; // 0 + samp_meng::Ordkey ordkey; // + samp_meng::FUser* p_user; // reference to parent row + i32 ordq_bh_order_idx; // index in heap; -1 means not-in-heap + samp_meng::FOrder* user_zd_order_next; // zslist link; -1 means not-in-list + samp_meng::FOrder* user_zd_order_prev; // previous element // func:samp_meng.FOrder..AssignOp inline samp_meng::FOrder& operator =(const samp_meng::FOrder &rhs) = delete; // func:samp_meng.FOrder..CopyCtor @@ -982,7 +1019,7 @@ void FOrder_Uninit(samp_meng::FOrder& order) __attribute__((noth // create: samp_meng.FDb.ordq (Tpool) // access: samp_meng.FOrder.p_ordq (Upptr) // access: samp_meng.FSymbol.c_ordq (Ptrary) -struct FOrdq { // samp_meng.FOrdq +struct FOrdq { // samp_meng.FOrdq: Order queue record samp_meng::FOrdq* ordq_next; // Pointer to next free element int tpool u8 side; // 0 samp_meng::FSymbol* p_symbol; // reference to parent row @@ -1074,7 +1111,7 @@ void FOrdq_Uninit(samp_meng::FOrdq& ordq) __attribute__((nothrow // --- samp_meng.Symbol #pragma pack(push,1) -struct Symbol { // samp_meng.Symbol +struct Symbol { // samp_meng.Symbol: Symbol name algo::RnullStr8 symbol; // // func:samp_meng.Symbol..EqOp inline bool operator ==(const samp_meng::Symbol &rhs) const __attribute__((nothrow)); @@ -1105,13 +1142,14 @@ void Symbol_Print(samp_meng::Symbol& row, algo::cstring& str) __ // global access: symbol (Lary, by rowid) // global access: ind_symbol (Thash, hash field symbol) // access: samp_meng.FOrdq.p_symbol (Upptr) -struct FSymbol { // samp_meng.FSymbol - samp_meng::FSymbol* ind_symbol_next; // hash next - samp_meng::Symbol symbol; // - i32 id; // 0 - samp_meng::FOrdq** c_ordq_elems; // array of pointers - u32 c_ordq_n; // array of pointers - u32 c_ordq_max; // capacity of allocated array +struct FSymbol { // samp_meng.FSymbol: Symbol record + samp_meng::FSymbol* ind_symbol_next; // hash next + u32 ind_symbol_hashval; // hash value + samp_meng::Symbol symbol; // + i32 id; // 0 + samp_meng::FOrdq** c_ordq_elems; // array of pointers + u32 c_ordq_n; // array of pointers + u32 c_ordq_max; // capacity of allocated array // reftype Ptrary of samp_meng.FSymbol.c_ordq prohibits copy // func:samp_meng.FSymbol..AssignOp inline samp_meng::FSymbol& operator =(const samp_meng::FSymbol &rhs) = delete; @@ -1191,12 +1229,13 @@ void FSymbol_Uninit(samp_meng::FSymbol& symbol) __attribute__((n // global access: user (Lary, by rowid) // global access: ind_user (Thash, hash field user) // access: samp_meng.FOrder.p_user (Upptr) -struct FUser { // samp_meng.FUser - samp_meng::FUser* ind_user_next; // hash next - i32 user; // 0 - samp_meng::FOrder* zd_order_head; // zero-terminated doubly linked list - i32 zd_order_n; // zero-terminated doubly linked list - samp_meng::FOrder* zd_order_tail; // pointer to last element +struct FUser { // samp_meng.FUser: User record + samp_meng::FUser* ind_user_next; // hash next + u32 ind_user_hashval; // hash value + i32 user; // 0 + samp_meng::FOrder* zd_order_head; // zero-terminated doubly linked list + i32 zd_order_n; // zero-terminated doubly linked list + samp_meng::FOrder* zd_order_tail; // pointer to last element // reftype Llist of samp_meng.FUser.zd_order prohibits copy // func:samp_meng.FUser..AssignOp inline samp_meng::FUser& operator =(const samp_meng::FUser &rhs) = delete; @@ -1222,7 +1261,7 @@ inline bool zd_order_EmptyQ(samp_meng::FUser& user) __attribute__((__wa inline samp_meng::FOrder* zd_order_First(samp_meng::FUser& user) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:samp_meng.FUser.zd_order.InLlistQ -inline bool zd_order_InLlistQ(samp_meng::FOrder& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool user_zd_order_InLlistQ(samp_meng::FOrder& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:samp_meng.FUser.zd_order.Insert void zd_order_Insert(samp_meng::FUser& user, samp_meng::FOrder& row) __attribute__((nothrow)); @@ -1234,10 +1273,10 @@ inline samp_meng::FOrder* zd_order_Last(samp_meng::FUser& user) __attribute__((_ inline i32 zd_order_N(const samp_meng::FUser& user) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:samp_meng.FUser.zd_order.Next -inline samp_meng::FOrder* zd_order_Next(samp_meng::FOrder &row) __attribute__((__warn_unused_result__, nothrow)); +inline samp_meng::FOrder* user_zd_order_Next(samp_meng::FOrder &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:samp_meng.FUser.zd_order.Prev -inline samp_meng::FOrder* zd_order_Prev(samp_meng::FOrder &row) __attribute__((__warn_unused_result__, nothrow)); +inline samp_meng::FOrder* user_zd_order_Prev(samp_meng::FOrder &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:samp_meng.FUser.zd_order.Remove void zd_order_Remove(samp_meng::FUser& user, samp_meng::FOrder& row) __attribute__((nothrow)); @@ -1432,7 +1471,7 @@ void MassCancelReqMsg_Print(samp_meng::MassCancelReqMsg& row, al // access: samp_meng.TextMsg.base (Base) // access: samp_meng.MsgHeader_curs.msg (Ptr) #pragma pack(push,1) -struct MsgHeader { // samp_meng.MsgHeader +struct MsgHeader { // samp_meng.MsgHeader: Message header u8 type; // 0 u8 length; // 0 // func:samp_meng.MsgHeader..Ctor @@ -1891,7 +1930,7 @@ void OrderTradeMsg_Print(samp_meng::OrderTradeMsg& row, algo::cs // --- samp_meng.TextMsg #pragma pack(push,1) -struct TextMsg { // samp_meng.TextMsg: debug message +struct TextMsg { // samp_meng.TextMsg: Debug message u8 type; // 7 u8 length; // ssizeof(parent) + (0) // var-length field samp_meng.TextMsg.text starts here. access it with text_Addr diff --git a/include/gen/samp_meng_gen.inl.h b/include/gen/samp_meng_gen.inl.h index 5ef7955a..a299cac5 100644 --- a/include/gen/samp_meng_gen.inl.h +++ b/include/gen/samp_meng_gen.inl.h @@ -128,6 +128,7 @@ inline samp_meng::CancelReqMsg::CancelReqMsg(u64 in_order) // --- samp_meng.trace..Ctor inline samp_meng::trace::trace() { + samp_meng::trace_Init(*this); } // --- samp_meng.FDb.fdin.EmptyQ @@ -540,8 +541,7 @@ inline samp_meng::FUser& samp_meng::_db_user_curs_Access(_db_user_curs &curs) { // --- samp_meng.FFdin.in.Max // Return max. number of bytes in the buffer. inline i32 samp_meng::in_Max(samp_meng::FFdin& fdin) { - return 8192; - (void)fdin;//only to avoid -Wunused-parameter + return fdin.in_max; } // --- samp_meng.FFdin.in.N @@ -812,9 +812,10 @@ inline void samp_meng::FOrder_Init(samp_meng::FOrder& order) { order.p_user = NULL; order.order_next = (samp_meng::FOrder*)-1; // (samp_meng.FDb.order) not-in-tpool's freelist order.ind_order_next = (samp_meng::FOrder*)-1; // (samp_meng.FDb.ind_order) not-in-hash - order.bh_order_idx = -1; // (samp_meng.FOrdq.bh_order) not-in-heap - order.zd_order_next = (samp_meng::FOrder*)-1; // (samp_meng.FUser.zd_order) not-in-list - order.zd_order_prev = NULL; // (samp_meng.FUser.zd_order) + order.ind_order_hashval = 0; // stored hash value + order.ordq_bh_order_idx = -1; // (samp_meng.FOrdq.bh_order) not-in-heap + order.user_zd_order_next = (samp_meng::FOrder*)-1; // (samp_meng.FUser.zd_order) not-in-list + order.user_zd_order_prev = NULL; // (samp_meng.FUser.zd_order) } // --- samp_meng.FOrder..Ctor @@ -847,7 +848,7 @@ inline samp_meng::FOrder* samp_meng::bh_order_First(samp_meng::FOrdq& ordq) { // Return true if row is in index, false otherwise inline bool samp_meng::bh_order_InBheapQ(samp_meng::FOrder& row) { bool result = false; - result = row.bh_order_idx != -1; + result = row.ordq_bh_order_idx != -1; return result; } @@ -991,6 +992,7 @@ inline void samp_meng::FSymbol_Init(samp_meng::FSymbol& symbol) { symbol.c_ordq_n = 0; // (samp_meng.FSymbol.c_ordq) symbol.c_ordq_max = 0; // (samp_meng.FSymbol.c_ordq) symbol.ind_symbol_next = (samp_meng::FSymbol*)-1; // (samp_meng.FDb.ind_symbol) not-in-hash + symbol.ind_symbol_hashval = 0; // stored hash value } // --- samp_meng.FSymbol.c_ordq_curs.Reset @@ -1044,9 +1046,9 @@ inline samp_meng::FOrder* samp_meng::zd_order_First(samp_meng::FUser& user) { // --- samp_meng.FUser.zd_order.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool samp_meng::zd_order_InLlistQ(samp_meng::FOrder& row) { +inline bool samp_meng::user_zd_order_InLlistQ(samp_meng::FOrder& row) { bool result = false; - result = !(row.zd_order_next == (samp_meng::FOrder*)-1); + result = !(row.user_zd_order_next == (samp_meng::FOrder*)-1); return result; } @@ -1066,14 +1068,14 @@ inline i32 samp_meng::zd_order_N(const samp_meng::FUser& user) { // --- samp_meng.FUser.zd_order.Next // Return pointer to next element in the list -inline samp_meng::FOrder* samp_meng::zd_order_Next(samp_meng::FOrder &row) { - return row.zd_order_next; +inline samp_meng::FOrder* samp_meng::user_zd_order_Next(samp_meng::FOrder &row) { + return row.user_zd_order_next; } // --- samp_meng.FUser.zd_order.Prev // Return pointer to previous element in the list -inline samp_meng::FOrder* samp_meng::zd_order_Prev(samp_meng::FOrder &row) { - return row.zd_order_prev; +inline samp_meng::FOrder* samp_meng::user_zd_order_Prev(samp_meng::FOrder &row) { + return row.user_zd_order_prev; } // --- samp_meng.FUser.zd_order.qLast @@ -1092,6 +1094,7 @@ inline void samp_meng::FUser_Init(samp_meng::FUser& user) { user.zd_order_n = 0; // (samp_meng.FUser.zd_order) user.zd_order_tail = NULL; // (samp_meng.FUser.zd_order) user.ind_user_next = (samp_meng::FUser*)-1; // (samp_meng.FDb.ind_user) not-in-hash + user.ind_user_hashval = 0; // stored hash value } // --- samp_meng.FUser.zd_order_curs.Reset @@ -1109,7 +1112,7 @@ inline bool samp_meng::user_zd_order_curs_ValidQ(user_zd_order_curs &curs) { // --- samp_meng.FUser.zd_order_curs.Next // proceed to next item inline void samp_meng::user_zd_order_curs_Next(user_zd_order_curs &curs) { - samp_meng::FOrder *next = (*curs.row).zd_order_next; + samp_meng::FOrder *next = (*curs.row).user_zd_order_next; curs.row = next; } @@ -1777,7 +1780,7 @@ inline u32 samp_meng::text_N(const samp_meng::TextMsg& parent) { // --- samp_meng.TextMsg.text_curs.Reset inline void samp_meng::TextMsg_text_curs_Reset(TextMsg_text_curs &curs, samp_meng::TextMsg &parent) { - curs.ptr = (u8*)&parent + sizeof(samp_meng::TextMsg); + curs.ptr = (u8*)text_Addr(parent); curs.length = i32(parent.length) - sizeof(samp_meng::TextMsg); curs.index = 0; } diff --git a/include/gen/sampdb_gen.h b/include/gen/sampdb_gen.h new file mode 100644 index 00000000..2682fcff --- /dev/null +++ b/include/gen/sampdb_gen.h @@ -0,0 +1,264 @@ +// +// include/gen/sampdb_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- sampdb_FieldIdEnum + +enum sampdb_FieldIdEnum { // sampdb.FieldId.value + sampdb_FieldId_gitfile = 0 + ,sampdb_FieldId_comment = 1 + ,sampdb_FieldId_targdep = 2 + ,sampdb_FieldId_target = 3 + ,sampdb_FieldId_parent = 4 + ,sampdb_FieldId_rec = 5 + ,sampdb_FieldId_pre = 6 + ,sampdb_FieldId_dflt = 7 + ,sampdb_FieldId_recipe = 8 + ,sampdb_FieldId_targsrc = 9 + ,sampdb_FieldId_src = 10 + ,sampdb_FieldId_value = 11 +}; + +enum { sampdb_FieldIdEnum_N = 12 }; + +namespace sampdb { // gen:ns_pkeytypedef + typedef algo::Smallstr50 GitfilePkey; + typedef algo::Smallstr50 TargdepPkey; + typedef algo::Smallstr50 TargetPkey; + typedef algo::Smallstr50 TargsrcPkey; +} // gen:ns_pkeytypedef +namespace sampdb { // gen:ns_tclass_field +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace sampdb { struct FieldId; } +namespace sampdb { struct Gitfile; } +namespace sampdb { struct Targdep; } +namespace sampdb { struct Target; } +namespace sampdb { struct Targrec; } +namespace sampdb { struct Targsrc; } +namespace sampdb { // gen:ns_print_struct + +// --- sampdb.FieldId +#pragma pack(push,1) +struct FieldId { // sampdb.FieldId: Field read helper + i32 value; // -1 + // func:sampdb.FieldId.value.Cast + inline operator sampdb_FieldIdEnum() const __attribute__((nothrow)); + // func:sampdb.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:sampdb.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:sampdb.FieldId..EnumCtor + inline FieldId(sampdb_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:sampdb.FieldId.value.GetEnum +inline sampdb_FieldIdEnum value_GetEnum(const sampdb::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:sampdb.FieldId.value.SetEnum +inline void value_SetEnum(sampdb::FieldId& parent, sampdb_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:sampdb.FieldId.value.ToCstr +const char* value_ToCstr(const sampdb::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:sampdb.FieldId.value.Print +void value_Print(const sampdb::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:sampdb.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(sampdb::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:sampdb.FieldId.value.SetStrptr +void value_SetStrptr(sampdb::FieldId& parent, algo::strptr rhs, sampdb_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:sampdb.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(sampdb::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of sampdb::FieldId from an ascii string. +// The format of the string is the format of the sampdb::FieldId's only field +// func:sampdb.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(sampdb::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:sampdb.FieldId..Init +inline void FieldId_Init(sampdb::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:sampdb.FieldId.String printfmt:Raw +// func:sampdb.FieldId..Print +void FieldId_Print(sampdb::FieldId& row, algo::cstring& str) __attribute__((nothrow)); + +// --- sampdb.Gitfile +struct Gitfile { // sampdb.Gitfile: samp_make list of gitfile sources + algo::Smallstr50 gitfile; // + algo::Comment comment; // + // func:sampdb.Gitfile..Ctor + inline Gitfile() __attribute__((nothrow)); +}; + +// func:sampdb.Gitfile..ReadFieldMaybe +bool Gitfile_ReadFieldMaybe(sampdb::Gitfile& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of sampdb::Gitfile from an ascii string. +// The format of the string is an ssim Tuple +// func:sampdb.Gitfile..ReadStrptrMaybe +bool Gitfile_ReadStrptrMaybe(sampdb::Gitfile &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:sampdb.Gitfile.String printfmt:Tuple +// func:sampdb.Gitfile..Print +void Gitfile_Print(sampdb::Gitfile& row, algo::cstring& str) __attribute__((nothrow)); + +// --- sampdb.Targdep +struct Targdep { // sampdb.Targdep: samp_make targets dependencies + algo::Smallstr50 targdep; // + bool rec; // false use in recipe + bool pre; // false use in prerequisite + algo::Comment comment; // + // func:sampdb.Targdep..Ctor + inline Targdep() __attribute__((nothrow)); +}; + +// func:sampdb.Targdep.target.Get +algo::Smallstr50 target_Get(sampdb::Targdep& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:sampdb.Targdep.target.Get2 +algo::Smallstr50 Targdep_target_Get(algo::strptr arg) __attribute__((nothrow)); + +// func:sampdb.Targdep.parent.Get +algo::Smallstr50 parent_Get(sampdb::Targdep& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:sampdb.Targdep.parent.Get2 +algo::Smallstr50 Targdep_parent_Get(algo::strptr arg) __attribute__((nothrow)); + +// func:sampdb.Targdep..Concat_target_parent +tempstr Targdep_Concat_target_parent( const algo::strptr& target ,const algo::strptr& parent ); +// func:sampdb.Targdep..ReadFieldMaybe +bool Targdep_ReadFieldMaybe(sampdb::Targdep& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of sampdb::Targdep from an ascii string. +// The format of the string is an ssim Tuple +// func:sampdb.Targdep..ReadStrptrMaybe +bool Targdep_ReadStrptrMaybe(sampdb::Targdep &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:sampdb.Targdep..Init +inline void Targdep_Init(sampdb::Targdep& parent); +// print string representation of ROW to string STR +// cfmt:sampdb.Targdep.String printfmt:Tuple +// func:sampdb.Targdep..Print +void Targdep_Print(sampdb::Targdep& row, algo::cstring& str) __attribute__((nothrow)); + +// --- sampdb.Target +struct Target { // sampdb.Target: samp_make targets list + algo::Smallstr50 target; // + bool dflt; // false make first target - default target + algo::Comment comment; // + // func:sampdb.Target..Ctor + inline Target() __attribute__((nothrow)); +}; + +// func:sampdb.Target..ReadFieldMaybe +bool Target_ReadFieldMaybe(sampdb::Target& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of sampdb::Target from an ascii string. +// The format of the string is an ssim Tuple +// func:sampdb.Target..ReadStrptrMaybe +bool Target_ReadStrptrMaybe(sampdb::Target &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:sampdb.Target..Init +inline void Target_Init(sampdb::Target& parent); +// print string representation of ROW to string STR +// cfmt:sampdb.Target.String printfmt:Tuple +// func:sampdb.Target..Print +void Target_Print(sampdb::Target& row, algo::cstring& str) __attribute__((nothrow)); + +// --- sampdb.Targrec +struct Targrec { // sampdb.Targrec: samp_make recipe for a target + algo::Smallstr50 target; // + algo::cstring recipe; // + algo::Comment comment; // + // func:sampdb.Targrec..Ctor + inline Targrec() __attribute__((nothrow)); +}; + +// func:sampdb.Targrec..ReadFieldMaybe +bool Targrec_ReadFieldMaybe(sampdb::Targrec& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of sampdb::Targrec from an ascii string. +// The format of the string is an ssim Tuple +// func:sampdb.Targrec..ReadStrptrMaybe +bool Targrec_ReadStrptrMaybe(sampdb::Targrec &parent, algo::strptr in_str) __attribute__((nothrow)); +// print string representation of ROW to string STR +// cfmt:sampdb.Targrec.String printfmt:Tuple +// func:sampdb.Targrec..Print +void Targrec_Print(sampdb::Targrec& row, algo::cstring& str) __attribute__((nothrow)); + +// --- sampdb.Targsrc +struct Targsrc { // sampdb.Targsrc: samp_make targets source dependencies + algo::Smallstr50 targsrc; // + bool pre; // false use in prerequisite + bool rec; // false use in recipe + algo::Comment comment; // + // func:sampdb.Targsrc..Ctor + inline Targsrc() __attribute__((nothrow)); +}; + +// func:sampdb.Targsrc.target.Get +algo::Smallstr50 target_Get(sampdb::Targsrc& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:sampdb.Targsrc.target.Get2 +algo::Smallstr50 Targsrc_target_Get(algo::strptr arg) __attribute__((nothrow)); + +// func:sampdb.Targsrc.src.Get +algo::Smallstr50 src_Get(sampdb::Targsrc& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:sampdb.Targsrc.src.Get2 +algo::Smallstr50 Targsrc_src_Get(algo::strptr arg) __attribute__((nothrow)); + +// func:sampdb.Targsrc..Concat_target_src +tempstr Targsrc_Concat_target_src( const algo::strptr& target ,const algo::strptr& src ); +// func:sampdb.Targsrc..ReadFieldMaybe +bool Targsrc_ReadFieldMaybe(sampdb::Targsrc& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of sampdb::Targsrc from an ascii string. +// The format of the string is an ssim Tuple +// func:sampdb.Targsrc..ReadStrptrMaybe +bool Targsrc_ReadStrptrMaybe(sampdb::Targsrc &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:sampdb.Targsrc..Init +inline void Targsrc_Init(sampdb::Targsrc& parent); +// print string representation of ROW to string STR +// cfmt:sampdb.Targsrc.String printfmt:Tuple +// func:sampdb.Targsrc..Print +void Targsrc_Print(sampdb::Targsrc& row, algo::cstring& str) __attribute__((nothrow)); +} // gen:ns_print_struct +namespace sampdb { // gen:ns_func +} // gen:ns_func +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const sampdb::FieldId &row);// cfmt:sampdb.FieldId.String +inline algo::cstring &operator <<(algo::cstring &str, const sampdb::Gitfile &row);// cfmt:sampdb.Gitfile.String +inline algo::cstring &operator <<(algo::cstring &str, const sampdb::Targdep &row);// cfmt:sampdb.Targdep.String +inline algo::cstring &operator <<(algo::cstring &str, const sampdb::Target &row);// cfmt:sampdb.Target.String +inline algo::cstring &operator <<(algo::cstring &str, const sampdb::Targrec &row);// cfmt:sampdb.Targrec.String +inline algo::cstring &operator <<(algo::cstring &str, const sampdb::Targsrc &row);// cfmt:sampdb.Targsrc.String +} diff --git a/include/gen/sampdb_gen.inl.h b/include/gen/sampdb_gen.inl.h new file mode 100644 index 00000000..9581f469 --- /dev/null +++ b/include/gen/sampdb_gen.inl.h @@ -0,0 +1,139 @@ +// +// include/gen/sampdb_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude + +// --- sampdb.FieldId.value.GetEnum +// Get value of field as enum type +inline sampdb_FieldIdEnum sampdb::value_GetEnum(const sampdb::FieldId& parent) { + return sampdb_FieldIdEnum(parent.value); +} + +// --- sampdb.FieldId.value.SetEnum +// Set value of field from enum type. +inline void sampdb::value_SetEnum(sampdb::FieldId& parent, sampdb_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- sampdb.FieldId.value.Cast +inline sampdb::FieldId::operator sampdb_FieldIdEnum() const { + return sampdb_FieldIdEnum((*this).value); +} + +// --- sampdb.FieldId..Init +// Set all fields to initial values. +inline void sampdb::FieldId_Init(sampdb::FieldId& parent) { + parent.value = i32(-1); +} + +// --- sampdb.FieldId..Ctor +inline sampdb::FieldId::FieldId() { + sampdb::FieldId_Init(*this); +} + +// --- sampdb.FieldId..FieldwiseCtor +inline sampdb::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- sampdb.FieldId..EnumCtor +inline sampdb::FieldId::FieldId(sampdb_FieldIdEnum arg) { + this->value = i32(arg); +} + +// --- sampdb.Gitfile..Ctor +inline sampdb::Gitfile::Gitfile() { +} + +// --- sampdb.Targdep..Init +// Set all fields to initial values. +inline void sampdb::Targdep_Init(sampdb::Targdep& parent) { + parent.rec = bool(false); + parent.pre = bool(false); +} + +// --- sampdb.Targdep..Ctor +inline sampdb::Targdep::Targdep() { + sampdb::Targdep_Init(*this); +} + +// --- sampdb.Target..Init +// Set all fields to initial values. +inline void sampdb::Target_Init(sampdb::Target& parent) { + parent.dflt = bool(false); +} + +// --- sampdb.Target..Ctor +inline sampdb::Target::Target() { + sampdb::Target_Init(*this); +} + +// --- sampdb.Targrec..Ctor +inline sampdb::Targrec::Targrec() { +} + +// --- sampdb.Targsrc..Init +// Set all fields to initial values. +inline void sampdb::Targsrc_Init(sampdb::Targsrc& parent) { + parent.pre = bool(false); + parent.rec = bool(false); +} + +// --- sampdb.Targsrc..Ctor +inline sampdb::Targsrc::Targsrc() { + sampdb::Targsrc_Init(*this); +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const sampdb::FieldId &row) {// cfmt:sampdb.FieldId.String + sampdb::FieldId_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const sampdb::Gitfile &row) {// cfmt:sampdb.Gitfile.String + sampdb::Gitfile_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const sampdb::Targdep &row) {// cfmt:sampdb.Targdep.String + sampdb::Targdep_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const sampdb::Target &row) {// cfmt:sampdb.Target.String + sampdb::Target_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const sampdb::Targrec &row) {// cfmt:sampdb.Targrec.String + sampdb::Targrec_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const sampdb::Targsrc &row) {// cfmt:sampdb.Targsrc.String + sampdb::Targsrc_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/sandbox_gen.h b/include/gen/sandbox_gen.h index 94bd569c..3df65895 100644 --- a/include/gen/sandbox_gen.h +++ b/include/gen/sandbox_gen.h @@ -202,6 +202,9 @@ void ind_sandbox_Remove(sandbox::FSandbox& row) __attribute__((n // Reserve enough room in the hash for N more elements. Return success code. // func:sandbox.FDb.ind_sandbox.Reserve void ind_sandbox_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:sandbox.FDb.ind_sandbox.AbsReserve +void ind_sandbox_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -278,11 +281,12 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: sandbox (Lary, by rowid) // global access: ind_sandbox (Thash, hash field sandbox) struct FSandbox { // sandbox.FSandbox - sandbox::FSandbox* ind_sandbox_next; // hash next - algo::Smallstr50 sandbox; // - algo::Comment comment; // - algo::cstring dir; // - bool select; // false + sandbox::FSandbox* ind_sandbox_next; // hash next + u32 ind_sandbox_hashval; // hash value + algo::Smallstr50 sandbox; // + algo::Comment comment; // + algo::cstring dir; // + bool select; // false // func:sandbox.FSandbox..AssignOp inline sandbox::FSandbox& operator =(const sandbox::FSandbox &rhs) = delete; // func:sandbox.FSandbox..CopyCtor diff --git a/include/gen/sandbox_gen.inl.h b/include/gen/sandbox_gen.inl.h index 2e1a60de..8c441339 100644 --- a/include/gen/sandbox_gen.inl.h +++ b/include/gen/sandbox_gen.inl.h @@ -183,6 +183,7 @@ inline sandbox::FSbpath& sandbox::_db_sbpath_curs_Access(_db_sbpath_curs &curs) inline void sandbox::FSandbox_Init(sandbox::FSandbox& sandbox) { sandbox.select = bool(false); sandbox.ind_sandbox_next = (sandbox::FSandbox*)-1; // (sandbox.FDb.ind_sandbox) not-in-hash + sandbox.ind_sandbox_hashval = 0; // stored hash value } // --- sandbox.FSandbox..Ctor diff --git a/include/gen/src_func_gen.h b/include/gen/src_func_gen.h index c8007348..d242be2b 100644 --- a/include/gen/src_func_gen.h +++ b/include/gen/src_func_gen.h @@ -46,19 +46,15 @@ enum { src_func_FieldIdEnum_N = 1 }; enum src_func_TableIdEnum { // src_func.TableId.value src_func_TableId_dmmeta_Ctypelen = 0 // dmmeta.Ctypelen -> src_func.FCtypelen ,src_func_TableId_dmmeta_ctypelen = 0 // dmmeta.ctypelen -> src_func.FCtypelen - ,src_func_TableId_dmmeta_Dispatch = 1 // dmmeta.Dispatch -> src_func.FDispatch - ,src_func_TableId_dmmeta_dispatch = 1 // dmmeta.dispatch -> src_func.FDispatch - ,src_func_TableId_dmmeta_Fstep = 2 // dmmeta.Fstep -> src_func.FFstep - ,src_func_TableId_dmmeta_fstep = 2 // dmmeta.fstep -> src_func.FFstep - ,src_func_TableId_dmmeta_Gstatic = 3 // dmmeta.Gstatic -> src_func.FGstatic - ,src_func_TableId_dmmeta_gstatic = 3 // dmmeta.gstatic -> src_func.FGstatic - ,src_func_TableId_dev_Target = 4 // dev.Target -> src_func.FTarget - ,src_func_TableId_dev_target = 4 // dev.target -> src_func.FTarget - ,src_func_TableId_dev_Targsrc = 5 // dev.Targsrc -> src_func.FTargsrc - ,src_func_TableId_dev_targsrc = 5 // dev.targsrc -> src_func.FTargsrc + ,src_func_TableId_dev_Target = 1 // dev.Target -> src_func.FTarget + ,src_func_TableId_dev_target = 1 // dev.target -> src_func.FTarget + ,src_func_TableId_dev_Targsrc = 2 // dev.Targsrc -> src_func.FTargsrc + ,src_func_TableId_dev_targsrc = 2 // dev.targsrc -> src_func.FTargsrc + ,src_func_TableId_dmmeta_Userfunc = 3 // dmmeta.Userfunc -> src_func.FUserfunc + ,src_func_TableId_dmmeta_userfunc = 3 // dmmeta.userfunc -> src_func.FUserfunc }; -enum { src_func_TableIdEnum_N = 12 }; +enum { src_func_TableIdEnum_N = 8 }; namespace src_func { // gen:ns_pkeytypedef } // gen:ns_pkeytypedef @@ -67,26 +63,23 @@ extern const char *src_func_help; } // gen:ns_tclass_field // gen:ns_fwddecl2 namespace src_func { struct FTargsrc; } +namespace src_func { struct FUserfunc; } namespace src_func { struct FTarget; } -namespace src_func { struct _db_genprefix_curs; } namespace src_func { struct _db_targsrc_curs; } namespace src_func { struct _db_target_curs; } namespace src_func { struct _db_func_curs; } namespace src_func { struct _db_bh_func_curs; } -namespace src_func { struct _db_dispatch_curs; } -namespace src_func { struct _db_fstep_curs; } -namespace src_func { struct _db_gstatic_curs; } namespace src_func { struct _db_ctypelen_curs; } +namespace src_func { struct _db_userfunc_curs; } +namespace src_func { struct _db_genaffix_curs; } namespace src_func { struct target_cd_targsrc_curs; } namespace src_func { struct targsrc_zd_func_curs; } +namespace src_func { struct userfunc_zd_func_curs; } namespace src_func { struct FCtypelen; } namespace src_func { struct trace; } namespace src_func { struct FDb; } -namespace src_func { struct FDispatch; } -namespace src_func { struct FFstep; } namespace src_func { struct FFunc; } -namespace src_func { struct FGenprefix; } -namespace src_func { struct FGstatic; } +namespace src_func { struct FGenaffix; } namespace src_func { struct FieldId; } namespace src_func { struct TableId; } namespace src_func { extern struct src_func::FDb _db; } @@ -97,12 +90,13 @@ namespace src_func { // gen:ns_print_struct // global access: ctypelen (Lary, by rowid) // global access: ind_ctypelen (Thash, hash field ctype) struct FCtypelen { // src_func.FCtypelen - algo::Smallstr100 ctype; // Identifies the Ctype - u32 len; // 0 (calculated) length of the C++ struct in bytes - i32 alignment; // 0 (calculated) alignment for the struct - i32 padbytes; // 0 (calculated) total # of pad bytes - bool plaindata; // false (calculated) this struct can me safely memcpy'ed - src_func::FCtypelen* ind_ctypelen_next; // hash next + algo::Smallstr100 ctype; // Identifies the Ctype + u32 len; // 0 (calculated) length of the C++ struct in bytes + i32 alignment; // 0 (calculated) alignment for the struct + i32 padbytes; // 0 (calculated) total # of pad bytes + bool plaindata; // false (calculated) this struct can me safely memcpy'ed + src_func::FCtypelen* ind_ctypelen_next; // hash next + u32 ind_ctypelen_hashval; // hash value // func:src_func.FCtypelen..AssignOp inline src_func::FCtypelen& operator =(const src_func::FCtypelen &rhs) = delete; // func:src_func.FCtypelen..CopyCtor @@ -147,82 +141,49 @@ void trace_Print(src_func::trace& row, algo::cstring& str) __att // --- src_func.FDb // create: src_func.FDb._db (Global) struct FDb { // src_func.FDb: In-memory database for src_func - report::src_func report; // Final report - src_func::FGenprefix* genprefix_lary[32]; // level array - i32 genprefix_n; // number of elements in array - command::src_func cmdline; // - src_func::FTargsrc* targsrc_lary[32]; // level array - i32 targsrc_n; // number of elements in array - src_func::FTarget* target_lary[32]; // level array - i32 target_n; // number of elements in array - src_func::FTarget** ind_target_buckets_elems; // pointer to bucket array - i32 ind_target_buckets_n; // number of elements in bucket array - i32 ind_target_n; // number of elements in the hash table - src_func::FFunc* func_lary[32]; // level array - i32 func_n; // number of elements in array - src_func::FFunc** ind_func_buckets_elems; // pointer to bucket array - i32 ind_func_buckets_n; // number of elements in bucket array - i32 ind_func_n; // number of elements in the hash table - src_func::FFunc** bh_func_elems; // binary heap by sortkey - i32 bh_func_n; // number of elements in the heap - i32 bh_func_max; // max elements in bh_func_elems - src_func::FDispatch* dispatch_lary[32]; // level array - i32 dispatch_n; // number of elements in array - src_func::FTargsrc* c_cur_targsrc; // optional pointer - i32 cur_line; // 0 - algo_lib::Regx ignore_funcstart; // - src_func::FFstep* fstep_lary[32]; // level array - i32 fstep_n; // number of elements in array - src_func::FGstatic* gstatic_lary[32]; // level array - i32 gstatic_n; // number of elements in array - src_func::FGenprefix** ind_genprefix_buckets_elems; // pointer to bucket array - i32 ind_genprefix_buckets_n; // number of elements in bucket array - i32 ind_genprefix_n; // number of elements in the hash table - src_func::FCtypelen* ctypelen_lary[32]; // level array - i32 ctypelen_n; // number of elements in array - src_func::FCtypelen** ind_ctypelen_buckets_elems; // pointer to bucket array - i32 ind_ctypelen_buckets_n; // number of elements in bucket array - i32 ind_ctypelen_n; // number of elements in the hash table - bool printed_user_impl_notice; // false - src_func::trace trace; // + report::src_func report; // Final report + command::src_func cmdline; // + src_func::FTargsrc* targsrc_lary[32]; // level array + i32 targsrc_n; // number of elements in array + src_func::FTarget* target_lary[32]; // level array + i32 target_n; // number of elements in array + src_func::FTarget** ind_target_buckets_elems; // pointer to bucket array + i32 ind_target_buckets_n; // number of elements in bucket array + i32 ind_target_n; // number of elements in the hash table + src_func::FFunc* func_lary[32]; // level array + i32 func_n; // number of elements in array + src_func::FFunc** ind_func_buckets_elems; // pointer to bucket array + i32 ind_func_buckets_n; // number of elements in bucket array + i32 ind_func_n; // number of elements in the hash table + src_func::FFunc** bh_func_elems; // binary heap by sortkey + i32 bh_func_n; // number of elements in the heap + i32 bh_func_max; // max elements in bh_func_elems + src_func::FTargsrc* c_cur_targsrc; // optional pointer + i32 cur_line; // 0 + algo_lib::Regx ignore_funcstart; // + src_func::FCtypelen* ctypelen_lary[32]; // level array + i32 ctypelen_n; // number of elements in array + src_func::FCtypelen** ind_ctypelen_buckets_elems; // pointer to bucket array + i32 ind_ctypelen_buckets_n; // number of elements in bucket array + i32 ind_ctypelen_n; // number of elements in the hash table + bool printed_user_impl_notice; // false + src_func::FUserfunc* userfunc_lary[32]; // level array + i32 userfunc_n; // number of elements in array + src_func::FUserfunc** ind_userfunc_buckets_elems; // pointer to bucket array + i32 ind_userfunc_buckets_n; // number of elements in bucket array + i32 ind_userfunc_n; // number of elements in the hash table + src_func::FUserfunc** ind_userfunc_cppname_buckets_elems; // pointer to bucket array + i32 ind_userfunc_cppname_buckets_n; // number of elements in bucket array + i32 ind_userfunc_cppname_n; // number of elements in the hash table + algo::cstring editloc; // List of locations to edit + src_func::FGenaffix* genaffix_lary[32]; // level array + i32 genaffix_n; // number of elements in array + src_func::FGenaffix** ind_genaffix_buckets_elems; // pointer to bucket array + i32 ind_genaffix_buckets_n; // number of elements in bucket array + i32 ind_genaffix_n; // number of elements in the hash table + src_func::trace trace; // }; -// Allocate memory for new default row. -// If out of memory, process is killed. -// func:src_func.FDb.genprefix.Alloc -src_func::FGenprefix& genprefix_Alloc() __attribute__((__warn_unused_result__, nothrow)); -// Allocate memory for new element. If out of memory, return NULL. -// func:src_func.FDb.genprefix.AllocMaybe -src_func::FGenprefix* genprefix_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); -// Allocate space for one element. If no memory available, return NULL. -// func:src_func.FDb.genprefix.AllocMem -void* genprefix_AllocMem() __attribute__((__warn_unused_result__, nothrow)); -// Return true if index is empty -// func:src_func.FDb.genprefix.EmptyQ -inline bool genprefix_EmptyQ() __attribute__((nothrow, pure)); -// Look up row by row id. Return NULL if out of range -// func:src_func.FDb.genprefix.Find -inline src_func::FGenprefix* genprefix_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return pointer to last element of array, or NULL if array is empty -// func:src_func.FDb.genprefix.Last -inline src_func::FGenprefix* genprefix_Last() __attribute__((nothrow, pure)); -// Return number of items in the pool -// func:src_func.FDb.genprefix.N -inline i32 genprefix_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Remove all elements from Lary -// func:src_func.FDb.genprefix.RemoveAll -void genprefix_RemoveAll() __attribute__((nothrow)); -// Delete last element of array. Do nothing if array is empty. -// func:src_func.FDb.genprefix.RemoveLast -void genprefix_RemoveLast() __attribute__((nothrow)); -// 'quick' Access row by row id. No bounds checking. -// func:src_func.FDb.genprefix.qFind -inline src_func::FGenprefix& genprefix_qFind(u64 t) __attribute__((nothrow, pure)); -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:src_func.FDb.genprefix.XrefMaybe -bool genprefix_XrefMaybe(src_func::FGenprefix &row); - // Read argc,argv directly into the fields of the command line(s) // The following fields are updated: // src_func.FDb.cmdline @@ -366,6 +327,9 @@ void ind_target_Remove(src_func::FTarget& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:src_func.FDb.ind_target.Reserve void ind_target_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_func.FDb.ind_target.AbsReserve +void ind_target_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -424,6 +388,9 @@ void ind_func_Remove(src_func::FFunc& row) __attribute__((nothro // Reserve enough room in the hash for N more elements. Return success code. // func:src_func.FDb.ind_func.Reserve void ind_func_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_func.FDb.ind_func.AbsReserve +void ind_func_AbsReserve(int n) __attribute__((nothrow)); // Remove all elements from heap and free memory used by the array. // func:src_func.FDb.bh_func.Dealloc @@ -467,151 +434,6 @@ src_func::FFunc* bh_func_RemoveFirst() __attribute__((nothrow)); // func:src_func.FDb.bh_func.Reserve void bh_func_Reserve(int n) __attribute__((nothrow)); -// Allocate memory for new default row. -// If out of memory, process is killed. -// func:src_func.FDb.dispatch.Alloc -src_func::FDispatch& dispatch_Alloc() __attribute__((__warn_unused_result__, nothrow)); -// Allocate memory for new element. If out of memory, return NULL. -// func:src_func.FDb.dispatch.AllocMaybe -src_func::FDispatch* dispatch_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); -// Create new row from struct. -// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -// func:src_func.FDb.dispatch.InsertMaybe -src_func::FDispatch* dispatch_InsertMaybe(const dmmeta::Dispatch &value) __attribute__((nothrow)); -// Allocate space for one element. If no memory available, return NULL. -// func:src_func.FDb.dispatch.AllocMem -void* dispatch_AllocMem() __attribute__((__warn_unused_result__, nothrow)); -// Return true if index is empty -// func:src_func.FDb.dispatch.EmptyQ -inline bool dispatch_EmptyQ() __attribute__((nothrow, pure)); -// Look up row by row id. Return NULL if out of range -// func:src_func.FDb.dispatch.Find -inline src_func::FDispatch* dispatch_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return pointer to last element of array, or NULL if array is empty -// func:src_func.FDb.dispatch.Last -inline src_func::FDispatch* dispatch_Last() __attribute__((nothrow, pure)); -// Return number of items in the pool -// func:src_func.FDb.dispatch.N -inline i32 dispatch_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Remove all elements from Lary -// func:src_func.FDb.dispatch.RemoveAll -void dispatch_RemoveAll() __attribute__((nothrow)); -// Delete last element of array. Do nothing if array is empty. -// func:src_func.FDb.dispatch.RemoveLast -void dispatch_RemoveLast() __attribute__((nothrow)); -// 'quick' Access row by row id. No bounds checking. -// func:src_func.FDb.dispatch.qFind -inline src_func::FDispatch& dispatch_qFind(u64 t) __attribute__((nothrow, pure)); -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:src_func.FDb.dispatch.XrefMaybe -bool dispatch_XrefMaybe(src_func::FDispatch &row); - -// Allocate memory for new default row. -// If out of memory, process is killed. -// func:src_func.FDb.fstep.Alloc -src_func::FFstep& fstep_Alloc() __attribute__((__warn_unused_result__, nothrow)); -// Allocate memory for new element. If out of memory, return NULL. -// func:src_func.FDb.fstep.AllocMaybe -src_func::FFstep* fstep_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); -// Create new row from struct. -// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -// func:src_func.FDb.fstep.InsertMaybe -src_func::FFstep* fstep_InsertMaybe(const dmmeta::Fstep &value) __attribute__((nothrow)); -// Allocate space for one element. If no memory available, return NULL. -// func:src_func.FDb.fstep.AllocMem -void* fstep_AllocMem() __attribute__((__warn_unused_result__, nothrow)); -// Return true if index is empty -// func:src_func.FDb.fstep.EmptyQ -inline bool fstep_EmptyQ() __attribute__((nothrow, pure)); -// Look up row by row id. Return NULL if out of range -// func:src_func.FDb.fstep.Find -inline src_func::FFstep* fstep_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return pointer to last element of array, or NULL if array is empty -// func:src_func.FDb.fstep.Last -inline src_func::FFstep* fstep_Last() __attribute__((nothrow, pure)); -// Return number of items in the pool -// func:src_func.FDb.fstep.N -inline i32 fstep_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Remove all elements from Lary -// func:src_func.FDb.fstep.RemoveAll -void fstep_RemoveAll() __attribute__((nothrow)); -// Delete last element of array. Do nothing if array is empty. -// func:src_func.FDb.fstep.RemoveLast -void fstep_RemoveLast() __attribute__((nothrow)); -// 'quick' Access row by row id. No bounds checking. -// func:src_func.FDb.fstep.qFind -inline src_func::FFstep& fstep_qFind(u64 t) __attribute__((nothrow, pure)); -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:src_func.FDb.fstep.XrefMaybe -bool fstep_XrefMaybe(src_func::FFstep &row); - -// Allocate memory for new default row. -// If out of memory, process is killed. -// func:src_func.FDb.gstatic.Alloc -src_func::FGstatic& gstatic_Alloc() __attribute__((__warn_unused_result__, nothrow)); -// Allocate memory for new element. If out of memory, return NULL. -// func:src_func.FDb.gstatic.AllocMaybe -src_func::FGstatic* gstatic_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); -// Create new row from struct. -// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -// func:src_func.FDb.gstatic.InsertMaybe -src_func::FGstatic* gstatic_InsertMaybe(const dmmeta::Gstatic &value) __attribute__((nothrow)); -// Allocate space for one element. If no memory available, return NULL. -// func:src_func.FDb.gstatic.AllocMem -void* gstatic_AllocMem() __attribute__((__warn_unused_result__, nothrow)); -// Return true if index is empty -// func:src_func.FDb.gstatic.EmptyQ -inline bool gstatic_EmptyQ() __attribute__((nothrow, pure)); -// Look up row by row id. Return NULL if out of range -// func:src_func.FDb.gstatic.Find -inline src_func::FGstatic* gstatic_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); -// Return pointer to last element of array, or NULL if array is empty -// func:src_func.FDb.gstatic.Last -inline src_func::FGstatic* gstatic_Last() __attribute__((nothrow, pure)); -// Return number of items in the pool -// func:src_func.FDb.gstatic.N -inline i32 gstatic_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Remove all elements from Lary -// func:src_func.FDb.gstatic.RemoveAll -void gstatic_RemoveAll() __attribute__((nothrow)); -// Delete last element of array. Do nothing if array is empty. -// func:src_func.FDb.gstatic.RemoveLast -void gstatic_RemoveLast() __attribute__((nothrow)); -// 'quick' Access row by row id. No bounds checking. -// func:src_func.FDb.gstatic.qFind -inline src_func::FGstatic& gstatic_qFind(u64 t) __attribute__((nothrow, pure)); -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:src_func.FDb.gstatic.XrefMaybe -bool gstatic_XrefMaybe(src_func::FGstatic &row); - -// Return true if hash is empty -// func:src_func.FDb.ind_genprefix.EmptyQ -inline bool ind_genprefix_EmptyQ() __attribute__((nothrow)); -// Find row by key. Return NULL if not found. -// func:src_func.FDb.ind_genprefix.Find -src_func::FGenprefix* ind_genprefix_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); -// Look up row by key and return reference. Throw exception if not found -// func:src_func.FDb.ind_genprefix.FindX -src_func::FGenprefix& ind_genprefix_FindX(const algo::strptr& key); -// Find row by key. If not found, create and x-reference a new row with with this key. -// func:src_func.FDb.ind_genprefix.GetOrCreate -src_func::FGenprefix& ind_genprefix_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); -// Return number of items in the hash -// func:src_func.FDb.ind_genprefix.N -inline i32 ind_genprefix_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Insert row into hash table. Return true if row is reachable through the hash after the function completes. -// func:src_func.FDb.ind_genprefix.InsertMaybe -bool ind_genprefix_InsertMaybe(src_func::FGenprefix& row) __attribute__((nothrow)); -// Remove reference to element from hash index. If element is not in hash, do nothing -// func:src_func.FDb.ind_genprefix.Remove -void ind_genprefix_Remove(src_func::FGenprefix& row) __attribute__((nothrow)); -// Reserve enough room in the hash for N more elements. Return success code. -// func:src_func.FDb.ind_genprefix.Reserve -void ind_genprefix_Reserve(int n) __attribute__((nothrow)); - // Allocate memory for new default row. // If out of memory, process is killed. // func:src_func.FDb.ctypelen.Alloc @@ -676,19 +498,164 @@ void ind_ctypelen_Remove(src_func::FCtypelen& row) __attribute__ // Reserve enough room in the hash for N more elements. Return success code. // func:src_func.FDb.ind_ctypelen.Reserve void ind_ctypelen_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_func.FDb.ind_ctypelen.AbsReserve +void ind_ctypelen_AbsReserve(int n) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:src_func.FDb.userfunc.Alloc +src_func::FUserfunc& userfunc_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:src_func.FDb.userfunc.AllocMaybe +src_func::FUserfunc* userfunc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Create new row from struct. +// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) +// func:src_func.FDb.userfunc.InsertMaybe +src_func::FUserfunc* userfunc_InsertMaybe(const dmmeta::Userfunc &value) __attribute__((nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:src_func.FDb.userfunc.AllocMem +void* userfunc_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:src_func.FDb.userfunc.EmptyQ +inline bool userfunc_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:src_func.FDb.userfunc.Find +inline src_func::FUserfunc* userfunc_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:src_func.FDb.userfunc.Last +inline src_func::FUserfunc* userfunc_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:src_func.FDb.userfunc.N +inline i32 userfunc_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:src_func.FDb.userfunc.RemoveAll +void userfunc_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:src_func.FDb.userfunc.RemoveLast +void userfunc_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:src_func.FDb.userfunc.qFind +inline src_func::FUserfunc& userfunc_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:src_func.FDb.userfunc.XrefMaybe +bool userfunc_XrefMaybe(src_func::FUserfunc &row); + +// Return true if hash is empty +// func:src_func.FDb.ind_userfunc.EmptyQ +inline bool ind_userfunc_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:src_func.FDb.ind_userfunc.Find +src_func::FUserfunc* ind_userfunc_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:src_func.FDb.ind_userfunc.FindX +src_func::FUserfunc& ind_userfunc_FindX(const algo::strptr& key); +// Return number of items in the hash +// func:src_func.FDb.ind_userfunc.N +inline i32 ind_userfunc_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:src_func.FDb.ind_userfunc.InsertMaybe +bool ind_userfunc_InsertMaybe(src_func::FUserfunc& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:src_func.FDb.ind_userfunc.Remove +void ind_userfunc_Remove(src_func::FUserfunc& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:src_func.FDb.ind_userfunc.Reserve +void ind_userfunc_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_func.FDb.ind_userfunc.AbsReserve +void ind_userfunc_AbsReserve(int n) __attribute__((nothrow)); + +// Return true if hash is empty +// func:src_func.FDb.ind_userfunc_cppname.EmptyQ +inline bool ind_userfunc_cppname_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:src_func.FDb.ind_userfunc_cppname.Find +src_func::FUserfunc* ind_userfunc_cppname_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:src_func.FDb.ind_userfunc_cppname.FindX +src_func::FUserfunc& ind_userfunc_cppname_FindX(const algo::strptr& key); +// Return number of items in the hash +// func:src_func.FDb.ind_userfunc_cppname.N +inline i32 ind_userfunc_cppname_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:src_func.FDb.ind_userfunc_cppname.InsertMaybe +bool ind_userfunc_cppname_InsertMaybe(src_func::FUserfunc& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:src_func.FDb.ind_userfunc_cppname.Remove +void ind_userfunc_cppname_Remove(src_func::FUserfunc& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:src_func.FDb.ind_userfunc_cppname.Reserve +void ind_userfunc_cppname_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_func.FDb.ind_userfunc_cppname.AbsReserve +void ind_userfunc_cppname_AbsReserve(int n) __attribute__((nothrow)); + +// Allocate memory for new default row. +// If out of memory, process is killed. +// func:src_func.FDb.genaffix.Alloc +src_func::FGenaffix& genaffix_Alloc() __attribute__((__warn_unused_result__, nothrow)); +// Allocate memory for new element. If out of memory, return NULL. +// func:src_func.FDb.genaffix.AllocMaybe +src_func::FGenaffix* genaffix_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +// Allocate space for one element. If no memory available, return NULL. +// func:src_func.FDb.genaffix.AllocMem +void* genaffix_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +// Return true if index is empty +// func:src_func.FDb.genaffix.EmptyQ +inline bool genaffix_EmptyQ() __attribute__((nothrow, pure)); +// Look up row by row id. Return NULL if out of range +// func:src_func.FDb.genaffix.Find +inline src_func::FGenaffix* genaffix_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to last element of array, or NULL if array is empty +// func:src_func.FDb.genaffix.Last +inline src_func::FGenaffix* genaffix_Last() __attribute__((nothrow, pure)); +// Return number of items in the pool +// func:src_func.FDb.genaffix.N +inline i32 genaffix_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Remove all elements from Lary +// func:src_func.FDb.genaffix.RemoveAll +void genaffix_RemoveAll() __attribute__((nothrow)); +// Delete last element of array. Do nothing if array is empty. +// func:src_func.FDb.genaffix.RemoveLast +void genaffix_RemoveLast() __attribute__((nothrow)); +// 'quick' Access row by row id. No bounds checking. +// func:src_func.FDb.genaffix.qFind +inline src_func::FGenaffix& genaffix_qFind(u64 t) __attribute__((nothrow, pure)); +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +// func:src_func.FDb.genaffix.XrefMaybe +bool genaffix_XrefMaybe(src_func::FGenaffix &row); + +// Return true if hash is empty +// func:src_func.FDb.ind_genaffix.EmptyQ +inline bool ind_genaffix_EmptyQ() __attribute__((nothrow)); +// Find row by key. Return NULL if not found. +// func:src_func.FDb.ind_genaffix.Find +src_func::FGenaffix* ind_genaffix_Find(const algo::strptr& key) __attribute__((__warn_unused_result__, nothrow)); +// Look up row by key and return reference. Throw exception if not found +// func:src_func.FDb.ind_genaffix.FindX +src_func::FGenaffix& ind_genaffix_FindX(const algo::strptr& key); +// Find row by key. If not found, create and x-reference a new row with with this key. +// func:src_func.FDb.ind_genaffix.GetOrCreate +src_func::FGenaffix& ind_genaffix_GetOrCreate(const algo::strptr& key) __attribute__((nothrow)); +// Return number of items in the hash +// func:src_func.FDb.ind_genaffix.N +inline i32 ind_genaffix_N() __attribute__((__warn_unused_result__, nothrow, pure)); +// Insert row into hash table. Return true if row is reachable through the hash after the function completes. +// func:src_func.FDb.ind_genaffix.InsertMaybe +bool ind_genaffix_InsertMaybe(src_func::FGenaffix& row) __attribute__((nothrow)); +// Remove reference to element from hash index. If element is not in hash, do nothing +// func:src_func.FDb.ind_genaffix.Remove +void ind_genaffix_Remove(src_func::FGenaffix& row) __attribute__((nothrow)); +// Reserve enough room in the hash for N more elements. Return success code. +// func:src_func.FDb.ind_genaffix.Reserve +void ind_genaffix_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_func.FDb.ind_genaffix.AbsReserve +void ind_genaffix_AbsReserve(int n) __attribute__((nothrow)); -// cursor points to valid item -// func:src_func.FDb.genprefix_curs.Reset -inline void _db_genprefix_curs_Reset(_db_genprefix_curs &curs, src_func::FDb &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:src_func.FDb.genprefix_curs.ValidQ -inline bool _db_genprefix_curs_ValidQ(_db_genprefix_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:src_func.FDb.genprefix_curs.Next -inline void _db_genprefix_curs_Next(_db_genprefix_curs &curs) __attribute__((nothrow)); -// item access -// func:src_func.FDb.genprefix_curs.Access -inline src_func::FGenprefix& _db_genprefix_curs_Access(_db_genprefix_curs &curs) __attribute__((nothrow)); // cursor points to valid item // func:src_func.FDb.targsrc_curs.Reset inline void _db_targsrc_curs_Reset(_db_targsrc_curs &curs, src_func::FDb &parent) __attribute__((nothrow)); @@ -740,42 +707,6 @@ inline src_func::FFunc& _db_bh_func_curs_Access(_db_bh_func_curs &curs) __attrib // func:src_func.FDb.bh_func_curs.ValidQ inline bool _db_bh_func_curs_ValidQ(_db_bh_func_curs &curs) __attribute__((nothrow)); // cursor points to valid item -// func:src_func.FDb.dispatch_curs.Reset -inline void _db_dispatch_curs_Reset(_db_dispatch_curs &curs, src_func::FDb &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:src_func.FDb.dispatch_curs.ValidQ -inline bool _db_dispatch_curs_ValidQ(_db_dispatch_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:src_func.FDb.dispatch_curs.Next -inline void _db_dispatch_curs_Next(_db_dispatch_curs &curs) __attribute__((nothrow)); -// item access -// func:src_func.FDb.dispatch_curs.Access -inline src_func::FDispatch& _db_dispatch_curs_Access(_db_dispatch_curs &curs) __attribute__((nothrow)); -// cursor points to valid item -// func:src_func.FDb.fstep_curs.Reset -inline void _db_fstep_curs_Reset(_db_fstep_curs &curs, src_func::FDb &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:src_func.FDb.fstep_curs.ValidQ -inline bool _db_fstep_curs_ValidQ(_db_fstep_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:src_func.FDb.fstep_curs.Next -inline void _db_fstep_curs_Next(_db_fstep_curs &curs) __attribute__((nothrow)); -// item access -// func:src_func.FDb.fstep_curs.Access -inline src_func::FFstep& _db_fstep_curs_Access(_db_fstep_curs &curs) __attribute__((nothrow)); -// cursor points to valid item -// func:src_func.FDb.gstatic_curs.Reset -inline void _db_gstatic_curs_Reset(_db_gstatic_curs &curs, src_func::FDb &parent) __attribute__((nothrow)); -// cursor points to valid item -// func:src_func.FDb.gstatic_curs.ValidQ -inline bool _db_gstatic_curs_ValidQ(_db_gstatic_curs &curs) __attribute__((nothrow)); -// proceed to next item -// func:src_func.FDb.gstatic_curs.Next -inline void _db_gstatic_curs_Next(_db_gstatic_curs &curs) __attribute__((nothrow)); -// item access -// func:src_func.FDb.gstatic_curs.Access -inline src_func::FGstatic& _db_gstatic_curs_Access(_db_gstatic_curs &curs) __attribute__((nothrow)); -// cursor points to valid item // func:src_func.FDb.ctypelen_curs.Reset inline void _db_ctypelen_curs_Reset(_db_ctypelen_curs &curs, src_func::FDb &parent) __attribute__((nothrow)); // cursor points to valid item @@ -787,108 +718,66 @@ inline void _db_ctypelen_curs_Next(_db_ctypelen_curs &curs) __attribute // item access // func:src_func.FDb.ctypelen_curs.Access inline src_func::FCtypelen& _db_ctypelen_curs_Access(_db_ctypelen_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:src_func.FDb.userfunc_curs.Reset +inline void _db_userfunc_curs_Reset(_db_userfunc_curs &curs, src_func::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:src_func.FDb.userfunc_curs.ValidQ +inline bool _db_userfunc_curs_ValidQ(_db_userfunc_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:src_func.FDb.userfunc_curs.Next +inline void _db_userfunc_curs_Next(_db_userfunc_curs &curs) __attribute__((nothrow)); +// item access +// func:src_func.FDb.userfunc_curs.Access +inline src_func::FUserfunc& _db_userfunc_curs_Access(_db_userfunc_curs &curs) __attribute__((nothrow)); +// cursor points to valid item +// func:src_func.FDb.genaffix_curs.Reset +inline void _db_genaffix_curs_Reset(_db_genaffix_curs &curs, src_func::FDb &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:src_func.FDb.genaffix_curs.ValidQ +inline bool _db_genaffix_curs_ValidQ(_db_genaffix_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:src_func.FDb.genaffix_curs.Next +inline void _db_genaffix_curs_Next(_db_genaffix_curs &curs) __attribute__((nothrow)); +// item access +// func:src_func.FDb.genaffix_curs.Access +inline src_func::FGenaffix& _db_genaffix_curs_Access(_db_genaffix_curs &curs) __attribute__((nothrow)); // Set all fields to initial values. // func:src_func.FDb..Init void FDb_Init(); // func:src_func.FDb..Uninit void FDb_Uninit() __attribute__((nothrow)); -// --- src_func.FDispatch -// create: src_func.FDb.dispatch (Lary) -// global access: dispatch (Lary, by rowid) -struct FDispatch { // src_func.FDispatch - algo::Smallstr50 dispatch; // Primary key (ns.name) - bool unk; // false Want default case? - bool read; // false Generate read function - bool print; // false Generate print function - bool haslen; // false Include length in dispatch function - bool call; // false Generate call to user-defined function - bool strict; // false Only dispatch if length matches exactly - algo::Comment comment; // -private: - // func:src_func.FDispatch..Ctor - inline FDispatch() __attribute__((nothrow)); - friend src_func::FDispatch& dispatch_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend src_func::FDispatch* dispatch_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void dispatch_RemoveAll() __attribute__((nothrow)); - friend void dispatch_RemoveLast() __attribute__((nothrow)); -}; - -// Copy fields out of row -// func:src_func.FDispatch.base.CopyOut -void dispatch_CopyOut(src_func::FDispatch &row, dmmeta::Dispatch &out) __attribute__((nothrow)); -// Copy fields in to row -// func:src_func.FDispatch.base.CopyIn -void dispatch_CopyIn(src_func::FDispatch &row, dmmeta::Dispatch &in) __attribute__((nothrow)); - -// func:src_func.FDispatch.ns.Get -algo::Smallstr16 ns_Get(src_func::FDispatch& dispatch) __attribute__((__warn_unused_result__, nothrow)); - -// func:src_func.FDispatch.name.Get -algo::Smallstr50 name_Get(src_func::FDispatch& dispatch) __attribute__((__warn_unused_result__, nothrow)); - -// Set all fields to initial values. -// func:src_func.FDispatch..Init -void FDispatch_Init(src_func::FDispatch& dispatch); - -// --- src_func.FFstep -// create: src_func.FDb.fstep (Lary) -// global access: fstep (Lary, by rowid) -struct FFstep { // src_func.FFstep - algo::Smallstr100 fstep; // - algo::Smallstr50 steptype; // - algo::Comment comment; // -private: - // func:src_func.FFstep..Ctor - inline FFstep() __attribute__((nothrow)); - friend src_func::FFstep& fstep_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend src_func::FFstep* fstep_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void fstep_RemoveAll() __attribute__((nothrow)); - friend void fstep_RemoveLast() __attribute__((nothrow)); -}; - -// Copy fields out of row -// func:src_func.FFstep.base.CopyOut -void fstep_CopyOut(src_func::FFstep &row, dmmeta::Fstep &out) __attribute__((nothrow)); -// Copy fields in to row -// func:src_func.FFstep.base.CopyIn -void fstep_CopyIn(src_func::FFstep &row, dmmeta::Fstep &in) __attribute__((nothrow)); - -// func:src_func.FFstep.field.Get -algo::Smallstr100 field_Get(src_func::FFstep& fstep) __attribute__((__warn_unused_result__, nothrow)); - -// func:src_func.FFstep.ns.Get -algo::Smallstr16 ns_Get(src_func::FFstep& fstep) __attribute__((__warn_unused_result__, nothrow)); - -// func:src_func.FFstep.name.Get -algo::Smallstr50 name_Get(src_func::FFstep& fstep) __attribute__((__warn_unused_result__, nothrow)); - - // --- src_func.FFunc // create: src_func.FDb.func (Lary) // global access: func (Lary, by rowid) // global access: ind_func (Thash, hash field func) // global access: bh_func (Bheap, sort field sortkey) // access: src_func.FTargsrc.zd_func (Llist) +// access: src_func.FUserfunc.zd_func (Llist) struct FFunc { // src_func.FFunc - src_func::FFunc* ind_func_next; // hash next - i32 bh_func_idx; // index in heap; -1 means not-in-heap - algo::cstring func; // First line of function -- primary key - algo::cstring args; // Argument list -- everything beyond first open parenthesis - algo::cstring sortkey; // - algo::cstring body; // Function body - src_func::FTargsrc* p_targsrc; // reference to parent row - i32 line; // 0 Line where function started - algo::cstring precomment; // Comments that appeare before function body - bool isstatic; // false Static? - bool isinline; // false Inline? - bool amcprot; // false Looks like a function where amc has already provided prototype? - bool select; // false Select for further processing - bool iffy; // false - bool mystery; // false - src_func::FTargsrc* p_written_to; // reference to parent row - src_func::FFunc* zd_func_next; // zslist link; -1 means not-in-list - src_func::FFunc* zd_func_prev; // previous element + src_func::FFunc* ind_func_next; // hash next + u32 ind_func_hashval; // hash value + i32 bh_func_idx; // index in heap; -1 means not-in-heap + algo::cstring func; // First line of function -- primary key + algo::cstring name; // Function name in the form ns.name + algo::cstring args; // Argument list -- everything beyond first open parenthesis + algo::cstring sortkey; // + algo::cstring body; // Function body + src_func::FTargsrc* p_targsrc; // reference to parent row + i32 line; // 0 Line number where function started + algo::cstring precomment; // Comments that appeare before function body + bool isstatic; // false Static? + bool isinline; // false Inline? + bool select; // false Select for further processing + bool iffy; // false Something wrong with the declaration + bool mystery; // false Non-static and missing a comment + src_func::FTargsrc* p_written_to; // reference to parent row + src_func::FUserfunc* p_userfunc; // reference to parent row + src_func::FFunc* targsrc_zd_func_next; // zslist link; -1 means not-in-list + src_func::FFunc* targsrc_zd_func_prev; // previous element + src_func::FFunc* userfunc_zd_func_next; // zslist link; -1 means not-in-list + src_func::FFunc* userfunc_zd_func_prev; // previous element // func:src_func.FFunc..AssignOp src_func::FFunc& operator =(const src_func::FFunc &rhs) = delete; // func:src_func.FFunc..CopyCtor @@ -919,59 +808,34 @@ void FFunc_Init(src_func::FFunc& func); // func:src_func.FFunc..Uninit void FFunc_Uninit(src_func::FFunc& func) __attribute__((nothrow)); -// --- src_func.FGenprefix -// create: src_func.FDb.genprefix (Lary) -// global access: genprefix (Lary, by rowid) -// global access: ind_genprefix (Thash, hash field genprefix) -struct FGenprefix { // src_func.FGenprefix: Prefixes of generated functions, skip generating prototypes for those - src_func::FGenprefix* ind_genprefix_next; // hash next - algo::Smallstr100 genprefix; // - // func:src_func.FGenprefix..AssignOp - inline src_func::FGenprefix& operator =(const src_func::FGenprefix &rhs) = delete; - // func:src_func.FGenprefix..CopyCtor - inline FGenprefix(const src_func::FGenprefix &rhs) = delete; +// --- src_func.FGenaffix +// create: src_func.FDb.genaffix (Lary) +// global access: genaffix (Lary, by rowid) +// global access: ind_genaffix (Thash, hash field genaffix) +struct FGenaffix { // src_func.FGenaffix: Prefix or suffix of a generated function -- skip generating prototype + src_func::FGenaffix* ind_genaffix_next; // hash next + u32 ind_genaffix_hashval; // hash value + algo::cstring genaffix; // + // func:src_func.FGenaffix..AssignOp + inline src_func::FGenaffix& operator =(const src_func::FGenaffix &rhs) = delete; + // func:src_func.FGenaffix..CopyCtor + inline FGenaffix(const src_func::FGenaffix &rhs) = delete; private: - // func:src_func.FGenprefix..Ctor - inline FGenprefix() __attribute__((nothrow)); - // func:src_func.FGenprefix..Dtor - inline ~FGenprefix() __attribute__((nothrow)); - friend src_func::FGenprefix& genprefix_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend src_func::FGenprefix* genprefix_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void genprefix_RemoveAll() __attribute__((nothrow)); - friend void genprefix_RemoveLast() __attribute__((nothrow)); + // func:src_func.FGenaffix..Ctor + inline FGenaffix() __attribute__((nothrow)); + // func:src_func.FGenaffix..Dtor + inline ~FGenaffix() __attribute__((nothrow)); + friend src_func::FGenaffix& genaffix_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend src_func::FGenaffix* genaffix_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void genaffix_RemoveAll() __attribute__((nothrow)); + friend void genaffix_RemoveLast() __attribute__((nothrow)); }; // Set all fields to initial values. -// func:src_func.FGenprefix..Init -inline void FGenprefix_Init(src_func::FGenprefix& genprefix); -// func:src_func.FGenprefix..Uninit -void FGenprefix_Uninit(src_func::FGenprefix& genprefix) __attribute__((nothrow)); - -// --- src_func.FGstatic -// create: src_func.FDb.gstatic (Lary) -// global access: gstatic (Lary, by rowid) -struct FGstatic { // src_func.FGstatic - algo::Smallstr100 field; // - algo::Comment comment; // -private: - // func:src_func.FGstatic..Ctor - inline FGstatic() __attribute__((nothrow)); - friend src_func::FGstatic& gstatic_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend src_func::FGstatic* gstatic_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void gstatic_RemoveAll() __attribute__((nothrow)); - friend void gstatic_RemoveLast() __attribute__((nothrow)); -}; - -// Copy fields out of row -// func:src_func.FGstatic.base.CopyOut -void gstatic_CopyOut(src_func::FGstatic &row, dmmeta::Gstatic &out) __attribute__((nothrow)); -// Copy fields in to row -// func:src_func.FGstatic.base.CopyIn -void gstatic_CopyIn(src_func::FGstatic &row, dmmeta::Gstatic &in) __attribute__((nothrow)); - -// func:src_func.FGstatic.ns.Get -algo::Smallstr16 ns_Get(src_func::FGstatic& gstatic) __attribute__((__warn_unused_result__, nothrow)); - +// func:src_func.FGenaffix..Init +inline void FGenaffix_Init(src_func::FGenaffix& genaffix); +// func:src_func.FGenaffix..Uninit +void FGenaffix_Uninit(src_func::FGenaffix& genaffix) __attribute__((nothrow)); // --- src_func.FTarget // create: src_func.FDb.target (Lary) @@ -979,11 +843,11 @@ algo::Smallstr16 ns_Get(src_func::FGstatic& gstatic) __attribute__((__warn_u // global access: ind_target (Thash, hash field target) // access: src_func.FTargsrc.p_target (Upptr) struct FTarget { // src_func.FTarget - src_func::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target - src_func::FTargsrc* cd_targsrc_head; // zero-terminated doubly linked list - i32 cd_targsrc_n; // zero-terminated doubly linked list - bool select; // false + src_func::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target + src_func::FTargsrc* cd_targsrc_head; // zero-terminated doubly linked list + i32 cd_targsrc_n; // zero-terminated doubly linked list // reftype Llist of src_func.FTarget.cd_targsrc prohibits copy // func:src_func.FTarget..AssignOp inline src_func::FTarget& operator =(const src_func::FTarget &rhs) = delete; @@ -1015,7 +879,7 @@ inline bool cd_targsrc_EmptyQ(src_func::FTarget& target) __attribute__( inline src_func::FTargsrc* cd_targsrc_First(src_func::FTarget& target) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:src_func.FTarget.cd_targsrc.InLlistQ -inline bool cd_targsrc_InLlistQ(src_func::FTargsrc& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool target_cd_targsrc_InLlistQ(src_func::FTargsrc& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:src_func.FTarget.cd_targsrc.Insert void cd_targsrc_Insert(src_func::FTarget& target, src_func::FTargsrc& row) __attribute__((nothrow)); @@ -1027,10 +891,10 @@ inline src_func::FTargsrc* cd_targsrc_Last(src_func::FTarget& target) __attribut inline i32 cd_targsrc_N(const src_func::FTarget& target) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:src_func.FTarget.cd_targsrc.Next -inline src_func::FTargsrc* cd_targsrc_Next(src_func::FTargsrc &row) __attribute__((__warn_unused_result__, nothrow)); +inline src_func::FTargsrc* target_cd_targsrc_Next(src_func::FTargsrc &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:src_func.FTarget.cd_targsrc.Prev -inline src_func::FTargsrc* cd_targsrc_Prev(src_func::FTargsrc &row) __attribute__((__warn_unused_result__, nothrow)); +inline src_func::FTargsrc* target_cd_targsrc_Prev(src_func::FTargsrc &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:src_func.FTarget.cd_targsrc.Remove void cd_targsrc_Remove(src_func::FTarget& target, src_func::FTargsrc& row) __attribute__((nothrow)); @@ -1074,23 +938,24 @@ void FTarget_Uninit(src_func::FTarget& target) __attribute__((no // access: src_func.FFunc.p_written_to (Upptr) // access: src_func.FTarget.cd_targsrc (Llist) struct FTargsrc { // src_func.FTargsrc - src_func::FTargsrc* cd_targsrc_next; // zslist link; -1 means not-in-list - src_func::FTargsrc* cd_targsrc_prev; // previous element - algo::Smallstr100 targsrc; // - algo::Comment comment; // - src_func::FFunc* zd_func_head; // zero-terminated doubly linked list - i32 zd_func_n; // zero-terminated doubly linked list - src_func::FFunc* zd_func_tail; // pointer to last element - src_func::FTarget* p_target; // reference to parent row - bool select; // false + src_func::FTargsrc* target_cd_targsrc_next; // zslist link; -1 means not-in-list + src_func::FTargsrc* target_cd_targsrc_prev; // previous element + algo::Smallstr100 targsrc; // + algo::Comment comment; // + src_func::FFunc* zd_func_head; // zero-terminated doubly linked list + i32 zd_func_n; // zero-terminated doubly linked list + src_func::FFunc* zd_func_tail; // pointer to last element + src_func::FTarget* p_target; // reference to parent row + bool select; // false + i32 counter; // 0 // reftype Llist of src_func.FTargsrc.zd_func prohibits copy // x-reference on src_func.FTargsrc.p_target prevents copy // func:src_func.FTargsrc..AssignOp - inline src_func::FTargsrc& operator =(const src_func::FTargsrc &rhs) = delete; + src_func::FTargsrc& operator =(const src_func::FTargsrc &rhs) = delete; // reftype Llist of src_func.FTargsrc.zd_func prohibits copy // x-reference on src_func.FTargsrc.p_target prevents copy // func:src_func.FTargsrc..CopyCtor - inline FTargsrc(const src_func::FTargsrc &rhs) = delete; + FTargsrc(const src_func::FTargsrc &rhs) = delete; private: // func:src_func.FTargsrc..Ctor inline FTargsrc() __attribute__((nothrow)); @@ -1125,7 +990,7 @@ inline bool zd_func_EmptyQ(src_func::FTargsrc& targsrc) __attribute__(( inline src_func::FFunc* zd_func_First(src_func::FTargsrc& targsrc) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:src_func.FTargsrc.zd_func.InLlistQ -inline bool zd_func_InLlistQ(src_func::FFunc& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool targsrc_zd_func_InLlistQ(src_func::FFunc& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:src_func.FTargsrc.zd_func.Insert void zd_func_Insert(src_func::FTargsrc& targsrc, src_func::FFunc& row) __attribute__((nothrow)); @@ -1137,10 +1002,10 @@ inline src_func::FFunc* zd_func_Last(src_func::FTargsrc& targsrc) __attribute__( inline i32 zd_func_N(const src_func::FTargsrc& targsrc) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:src_func.FTargsrc.zd_func.Next -inline src_func::FFunc* zd_func_Next(src_func::FFunc &row) __attribute__((__warn_unused_result__, nothrow)); +inline src_func::FFunc* targsrc_zd_func_Next(src_func::FFunc &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:src_func.FTargsrc.zd_func.Prev -inline src_func::FFunc* zd_func_Prev(src_func::FFunc &row) __attribute__((__warn_unused_result__, nothrow)); +inline src_func::FFunc* targsrc_zd_func_Prev(src_func::FFunc &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:src_func.FTargsrc.zd_func.Remove void zd_func_Remove(src_func::FTargsrc& targsrc, src_func::FFunc& row) __attribute__((nothrow)); @@ -1172,6 +1037,103 @@ inline src_func::FFunc& targsrc_zd_func_curs_Access(targsrc_zd_func_curs &curs) // func:src_func.FTargsrc..Uninit void FTargsrc_Uninit(src_func::FTargsrc& targsrc) __attribute__((nothrow)); +// --- src_func.FUserfunc +// create: src_func.FDb.userfunc (Lary) +// global access: userfunc (Lary, by rowid) +// global access: ind_userfunc (Thash, hash field userfunc) +// global access: ind_userfunc_cppname (Thash, hash field cppname) +// access: src_func.FFunc.p_userfunc (Upptr) +struct FUserfunc { // src_func.FUserfunc + src_func::FUserfunc* ind_userfunc_next; // hash next + u32 ind_userfunc_hashval; // hash value + src_func::FUserfunc* ind_userfunc_cppname_next; // hash next + u32 ind_userfunc_cppname_hashval; // hash value + algo::Smallstr50 userfunc; // + algo::Smallstr200 acrkey; // + algo::Smallstr100 cppname; // + algo::Comment comment; // + src_func::FFunc* zd_func_head; // zero-terminated doubly linked list + i32 zd_func_n; // zero-terminated doubly linked list + src_func::FFunc* zd_func_tail; // pointer to last element + // reftype Llist of src_func.FUserfunc.zd_func prohibits copy + // func:src_func.FUserfunc..AssignOp + inline src_func::FUserfunc& operator =(const src_func::FUserfunc &rhs) = delete; + // reftype Llist of src_func.FUserfunc.zd_func prohibits copy + // func:src_func.FUserfunc..CopyCtor + inline FUserfunc(const src_func::FUserfunc &rhs) = delete; +private: + // func:src_func.FUserfunc..Ctor + inline FUserfunc() __attribute__((nothrow)); + // func:src_func.FUserfunc..Dtor + inline ~FUserfunc() __attribute__((nothrow)); + friend src_func::FUserfunc& userfunc_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend src_func::FUserfunc* userfunc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void userfunc_RemoveAll() __attribute__((nothrow)); + friend void userfunc_RemoveLast() __attribute__((nothrow)); +}; + +// Copy fields out of row +// func:src_func.FUserfunc.base.CopyOut +void userfunc_CopyOut(src_func::FUserfunc &row, dmmeta::Userfunc &out) __attribute__((nothrow)); +// Copy fields in to row +// func:src_func.FUserfunc.base.CopyIn +void userfunc_CopyIn(src_func::FUserfunc &row, dmmeta::Userfunc &in) __attribute__((nothrow)); + +// Return true if index is empty +// func:src_func.FUserfunc.zd_func.EmptyQ +inline bool zd_func_EmptyQ(src_func::FUserfunc& userfunc) __attribute__((__warn_unused_result__, nothrow, pure)); +// If index empty, return NULL. Otherwise return pointer to first element in index +// func:src_func.FUserfunc.zd_func.First +inline src_func::FFunc* zd_func_First(src_func::FUserfunc& userfunc) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return true if row is in the linked list, false otherwise +// func:src_func.FUserfunc.zd_func.InLlistQ +inline bool userfunc_zd_func_InLlistQ(src_func::FFunc& row) __attribute__((__warn_unused_result__, nothrow)); +// Insert row into linked list. If row is already in linked list, do nothing. +// func:src_func.FUserfunc.zd_func.Insert +void zd_func_Insert(src_func::FUserfunc& userfunc, src_func::FFunc& row) __attribute__((nothrow)); +// If index empty, return NULL. Otherwise return pointer to last element in index +// func:src_func.FUserfunc.zd_func.Last +inline src_func::FFunc* zd_func_Last(src_func::FUserfunc& userfunc) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return number of items in the linked list +// func:src_func.FUserfunc.zd_func.N +inline i32 zd_func_N(const src_func::FUserfunc& userfunc) __attribute__((__warn_unused_result__, nothrow, pure)); +// Return pointer to next element in the list +// func:src_func.FUserfunc.zd_func.Next +inline src_func::FFunc* userfunc_zd_func_Next(src_func::FFunc &row) __attribute__((__warn_unused_result__, nothrow)); +// Return pointer to previous element in the list +// func:src_func.FUserfunc.zd_func.Prev +inline src_func::FFunc* userfunc_zd_func_Prev(src_func::FFunc &row) __attribute__((__warn_unused_result__, nothrow)); +// Remove element from index. If element is not in index, do nothing. +// func:src_func.FUserfunc.zd_func.Remove +void zd_func_Remove(src_func::FUserfunc& userfunc, src_func::FFunc& row) __attribute__((nothrow)); +// Empty the index. (The rows are not deleted) +// func:src_func.FUserfunc.zd_func.RemoveAll +void zd_func_RemoveAll(src_func::FUserfunc& userfunc) __attribute__((nothrow)); +// If linked list is empty, return NULL. Otherwise unlink and return pointer to first element. +// func:src_func.FUserfunc.zd_func.RemoveFirst +src_func::FFunc* zd_func_RemoveFirst(src_func::FUserfunc& userfunc) __attribute__((nothrow)); +// Return reference to last element in the index. No bounds checking. +// func:src_func.FUserfunc.zd_func.qLast +inline src_func::FFunc& zd_func_qLast(src_func::FUserfunc& userfunc) __attribute__((__warn_unused_result__, nothrow)); + +// Set all fields to initial values. +// func:src_func.FUserfunc..Init +inline void FUserfunc_Init(src_func::FUserfunc& userfunc); +// cursor points to valid item +// func:src_func.FUserfunc.zd_func_curs.Reset +inline void userfunc_zd_func_curs_Reset(userfunc_zd_func_curs &curs, src_func::FUserfunc &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:src_func.FUserfunc.zd_func_curs.ValidQ +inline bool userfunc_zd_func_curs_ValidQ(userfunc_zd_func_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:src_func.FUserfunc.zd_func_curs.Next +inline void userfunc_zd_func_curs_Next(userfunc_zd_func_curs &curs) __attribute__((nothrow)); +// item access +// func:src_func.FUserfunc.zd_func_curs.Access +inline src_func::FFunc& userfunc_zd_func_curs_Access(userfunc_zd_func_curs &curs) __attribute__((nothrow)); +// func:src_func.FUserfunc..Uninit +void FUserfunc_Uninit(src_func::FUserfunc& userfunc) __attribute__((nothrow)); + // --- src_func.FieldId #pragma pack(push,1) struct FieldId { // src_func.FieldId: Field read helper @@ -1280,14 +1242,6 @@ void TableId_Print(src_func::TableId& row, algo::cstring& str) _ } // gen:ns_print_struct namespace src_func { // gen:ns_curstext -struct _db_genprefix_curs {// cursor - typedef src_func::FGenprefix ChildType; - src_func::FDb *parent; - i64 index; - _db_genprefix_curs(){ parent=NULL; index=0; } -}; - - struct _db_targsrc_curs {// cursor typedef src_func::FTargsrc ChildType; src_func::FDb *parent; @@ -1324,35 +1278,27 @@ struct _db_bh_func_curs { }; -struct _db_dispatch_curs {// cursor - typedef src_func::FDispatch ChildType; - src_func::FDb *parent; - i64 index; - _db_dispatch_curs(){ parent=NULL; index=0; } -}; - - -struct _db_fstep_curs {// cursor - typedef src_func::FFstep ChildType; +struct _db_ctypelen_curs {// cursor + typedef src_func::FCtypelen ChildType; src_func::FDb *parent; i64 index; - _db_fstep_curs(){ parent=NULL; index=0; } + _db_ctypelen_curs(){ parent=NULL; index=0; } }; -struct _db_gstatic_curs {// cursor - typedef src_func::FGstatic ChildType; +struct _db_userfunc_curs {// cursor + typedef src_func::FUserfunc ChildType; src_func::FDb *parent; i64 index; - _db_gstatic_curs(){ parent=NULL; index=0; } + _db_userfunc_curs(){ parent=NULL; index=0; } }; -struct _db_ctypelen_curs {// cursor - typedef src_func::FCtypelen ChildType; +struct _db_genaffix_curs {// cursor + typedef src_func::FGenaffix ChildType; src_func::FDb *parent; i64 index; - _db_ctypelen_curs(){ parent=NULL; index=0; } + _db_genaffix_curs(){ parent=NULL; index=0; } }; @@ -1375,6 +1321,15 @@ struct targsrc_zd_func_curs {// fcurs:src_func.FTargsrc.zd_func/curs } }; + +struct userfunc_zd_func_curs {// fcurs:src_func.FUserfunc.zd_func/curs + typedef src_func::FFunc ChildType; + src_func::FFunc* row; + userfunc_zd_func_curs() { + row = NULL; + } +}; + } // gen:ns_curstext namespace src_func { // gen:ns_func // func:src_func...StaticCheck diff --git a/include/gen/src_func_gen.inl.h b/include/gen/src_func_gen.inl.h index 459702ef..171a4ff4 100644 --- a/include/gen/src_func_gen.inl.h +++ b/include/gen/src_func_gen.inl.h @@ -39,6 +39,7 @@ inline void src_func::FCtypelen_Init(src_func::FCtypelen& ctypelen) { ctypelen.padbytes = i32(0); ctypelen.plaindata = bool(false); ctypelen.ind_ctypelen_next = (src_func::FCtypelen*)-1; // (src_func.FDb.ind_ctypelen) not-in-hash + ctypelen.ind_ctypelen_hashval = 0; // stored hash value } // --- src_func.FCtypelen..Ctor @@ -55,48 +56,6 @@ inline src_func::FCtypelen::~FCtypelen() { inline src_func::trace::trace() { } -// --- src_func.FDb.genprefix.EmptyQ -// Return true if index is empty -inline bool src_func::genprefix_EmptyQ() { - return _db.genprefix_n == 0; -} - -// --- src_func.FDb.genprefix.Find -// Look up row by row id. Return NULL if out of range -inline src_func::FGenprefix* src_func::genprefix_Find(u64 t) { - src_func::FGenprefix *retval = NULL; - if (LIKELY(u64(t) < u64(_db.genprefix_n))) { - u64 x = t + 1; - u64 bsr = algo::u64_BitScanReverse(x); - u64 base = u64(1)< 0; } -// --- src_func.FDb.dispatch_curs.Reset -// cursor points to valid item -inline void src_func::_db_dispatch_curs_Reset(_db_dispatch_curs &curs, src_func::FDb &parent) { - curs.parent = &parent; - curs.index = 0; -} - -// --- src_func.FDb.dispatch_curs.ValidQ -// cursor points to valid item -inline bool src_func::_db_dispatch_curs_ValidQ(_db_dispatch_curs &curs) { - return curs.index < _db.dispatch_n; -} - -// --- src_func.FDb.dispatch_curs.Next -// proceed to next item -inline void src_func::_db_dispatch_curs_Next(_db_dispatch_curs &curs) { - curs.index++; -} - -// --- src_func.FDb.dispatch_curs.Access -// item access -inline src_func::FDispatch& src_func::_db_dispatch_curs_Access(_db_dispatch_curs &curs) { - return dispatch_qFind(u64(curs.index)); -} - -// --- src_func.FDb.fstep_curs.Reset +// --- src_func.FDb.ctypelen_curs.Reset // cursor points to valid item -inline void src_func::_db_fstep_curs_Reset(_db_fstep_curs &curs, src_func::FDb &parent) { +inline void src_func::_db_ctypelen_curs_Reset(_db_ctypelen_curs &curs, src_func::FDb &parent) { curs.parent = &parent; curs.index = 0; } -// --- src_func.FDb.fstep_curs.ValidQ +// --- src_func.FDb.ctypelen_curs.ValidQ // cursor points to valid item -inline bool src_func::_db_fstep_curs_ValidQ(_db_fstep_curs &curs) { - return curs.index < _db.fstep_n; +inline bool src_func::_db_ctypelen_curs_ValidQ(_db_ctypelen_curs &curs) { + return curs.index < _db.ctypelen_n; } -// --- src_func.FDb.fstep_curs.Next +// --- src_func.FDb.ctypelen_curs.Next // proceed to next item -inline void src_func::_db_fstep_curs_Next(_db_fstep_curs &curs) { +inline void src_func::_db_ctypelen_curs_Next(_db_ctypelen_curs &curs) { curs.index++; } -// --- src_func.FDb.fstep_curs.Access +// --- src_func.FDb.ctypelen_curs.Access // item access -inline src_func::FFstep& src_func::_db_fstep_curs_Access(_db_fstep_curs &curs) { - return fstep_qFind(u64(curs.index)); +inline src_func::FCtypelen& src_func::_db_ctypelen_curs_Access(_db_ctypelen_curs &curs) { + return ctypelen_qFind(u64(curs.index)); } -// --- src_func.FDb.gstatic_curs.Reset +// --- src_func.FDb.userfunc_curs.Reset // cursor points to valid item -inline void src_func::_db_gstatic_curs_Reset(_db_gstatic_curs &curs, src_func::FDb &parent) { +inline void src_func::_db_userfunc_curs_Reset(_db_userfunc_curs &curs, src_func::FDb &parent) { curs.parent = &parent; curs.index = 0; } -// --- src_func.FDb.gstatic_curs.ValidQ +// --- src_func.FDb.userfunc_curs.ValidQ // cursor points to valid item -inline bool src_func::_db_gstatic_curs_ValidQ(_db_gstatic_curs &curs) { - return curs.index < _db.gstatic_n; +inline bool src_func::_db_userfunc_curs_ValidQ(_db_userfunc_curs &curs) { + return curs.index < _db.userfunc_n; } -// --- src_func.FDb.gstatic_curs.Next +// --- src_func.FDb.userfunc_curs.Next // proceed to next item -inline void src_func::_db_gstatic_curs_Next(_db_gstatic_curs &curs) { +inline void src_func::_db_userfunc_curs_Next(_db_userfunc_curs &curs) { curs.index++; } -// --- src_func.FDb.gstatic_curs.Access +// --- src_func.FDb.userfunc_curs.Access // item access -inline src_func::FGstatic& src_func::_db_gstatic_curs_Access(_db_gstatic_curs &curs) { - return gstatic_qFind(u64(curs.index)); +inline src_func::FUserfunc& src_func::_db_userfunc_curs_Access(_db_userfunc_curs &curs) { + return userfunc_qFind(u64(curs.index)); } -// --- src_func.FDb.ctypelen_curs.Reset +// --- src_func.FDb.genaffix_curs.Reset // cursor points to valid item -inline void src_func::_db_ctypelen_curs_Reset(_db_ctypelen_curs &curs, src_func::FDb &parent) { +inline void src_func::_db_genaffix_curs_Reset(_db_genaffix_curs &curs, src_func::FDb &parent) { curs.parent = &parent; curs.index = 0; } -// --- src_func.FDb.ctypelen_curs.ValidQ +// --- src_func.FDb.genaffix_curs.ValidQ // cursor points to valid item -inline bool src_func::_db_ctypelen_curs_ValidQ(_db_ctypelen_curs &curs) { - return curs.index < _db.ctypelen_n; +inline bool src_func::_db_genaffix_curs_ValidQ(_db_genaffix_curs &curs) { + return curs.index < _db.genaffix_n; } -// --- src_func.FDb.ctypelen_curs.Next +// --- src_func.FDb.genaffix_curs.Next // proceed to next item -inline void src_func::_db_ctypelen_curs_Next(_db_ctypelen_curs &curs) { +inline void src_func::_db_genaffix_curs_Next(_db_genaffix_curs &curs) { curs.index++; } -// --- src_func.FDb.ctypelen_curs.Access +// --- src_func.FDb.genaffix_curs.Access // item access -inline src_func::FCtypelen& src_func::_db_ctypelen_curs_Access(_db_ctypelen_curs &curs) { - return ctypelen_qFind(u64(curs.index)); -} - -// --- src_func.FDispatch..Ctor -inline src_func::FDispatch::FDispatch() { - src_func::FDispatch_Init(*this); -} - -// --- src_func.FFstep..Ctor -inline src_func::FFstep::FFstep() { +inline src_func::FGenaffix& src_func::_db_genaffix_curs_Access(_db_genaffix_curs &curs) { + return genaffix_qFind(u64(curs.index)); } // --- src_func.FFunc.sortkey.Lt @@ -706,24 +588,21 @@ inline src_func::FFunc::~FFunc() { src_func::FFunc_Uninit(*this); } -// --- src_func.FGenprefix..Init +// --- src_func.FGenaffix..Init // Set all fields to initial values. -inline void src_func::FGenprefix_Init(src_func::FGenprefix& genprefix) { - genprefix.ind_genprefix_next = (src_func::FGenprefix*)-1; // (src_func.FDb.ind_genprefix) not-in-hash -} - -// --- src_func.FGenprefix..Ctor -inline src_func::FGenprefix::FGenprefix() { - src_func::FGenprefix_Init(*this); +inline void src_func::FGenaffix_Init(src_func::FGenaffix& genaffix) { + genaffix.ind_genaffix_next = (src_func::FGenaffix*)-1; // (src_func.FDb.ind_genaffix) not-in-hash + genaffix.ind_genaffix_hashval = 0; // stored hash value } -// --- src_func.FGenprefix..Dtor -inline src_func::FGenprefix::~FGenprefix() { - src_func::FGenprefix_Uninit(*this); +// --- src_func.FGenaffix..Ctor +inline src_func::FGenaffix::FGenaffix() { + src_func::FGenaffix_Init(*this); } -// --- src_func.FGstatic..Ctor -inline src_func::FGstatic::FGstatic() { +// --- src_func.FGenaffix..Dtor +inline src_func::FGenaffix::~FGenaffix() { + src_func::FGenaffix_Uninit(*this); } // --- src_func.FTarget.cd_targsrc.EmptyQ @@ -742,9 +621,9 @@ inline src_func::FTargsrc* src_func::cd_targsrc_First(src_func::FTarget& target) // --- src_func.FTarget.cd_targsrc.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool src_func::cd_targsrc_InLlistQ(src_func::FTargsrc& row) { +inline bool src_func::target_cd_targsrc_InLlistQ(src_func::FTargsrc& row) { bool result = false; - result = !(row.cd_targsrc_next == (src_func::FTargsrc*)-1); + result = !(row.target_cd_targsrc_next == (src_func::FTargsrc*)-1); return result; } @@ -752,7 +631,7 @@ inline bool src_func::cd_targsrc_InLlistQ(src_func::FTargsrc& row) { // If index empty, return NULL. Otherwise return pointer to last element in index inline src_func::FTargsrc* src_func::cd_targsrc_Last(src_func::FTarget& target) { src_func::FTargsrc *row = NULL; - row = target.cd_targsrc_head ? target.cd_targsrc_head->cd_targsrc_prev : NULL; + row = target.cd_targsrc_head ? target.cd_targsrc_head->target_cd_targsrc_prev : NULL; return row; } @@ -764,21 +643,21 @@ inline i32 src_func::cd_targsrc_N(const src_func::FTarget& target) { // --- src_func.FTarget.cd_targsrc.Next // Return pointer to next element in the list -inline src_func::FTargsrc* src_func::cd_targsrc_Next(src_func::FTargsrc &row) { - return row.cd_targsrc_next; +inline src_func::FTargsrc* src_func::target_cd_targsrc_Next(src_func::FTargsrc &row) { + return row.target_cd_targsrc_next; } // --- src_func.FTarget.cd_targsrc.Prev // Return pointer to previous element in the list -inline src_func::FTargsrc* src_func::cd_targsrc_Prev(src_func::FTargsrc &row) { - return row.cd_targsrc_prev; +inline src_func::FTargsrc* src_func::target_cd_targsrc_Prev(src_func::FTargsrc &row) { + return row.target_cd_targsrc_prev; } // --- src_func.FTarget.cd_targsrc.qLast // Return reference to last element in the index. No bounds checking. inline src_func::FTargsrc& src_func::cd_targsrc_qLast(src_func::FTarget& target) { src_func::FTargsrc *row = NULL; - row = target.cd_targsrc_head ? target.cd_targsrc_head->cd_targsrc_prev : NULL; + row = target.cd_targsrc_head ? target.cd_targsrc_head->target_cd_targsrc_prev : NULL; return *row; } @@ -787,8 +666,8 @@ inline src_func::FTargsrc& src_func::cd_targsrc_qLast(src_func::FTarget& target) inline void src_func::FTarget_Init(src_func::FTarget& target) { target.cd_targsrc_head = NULL; // (src_func.FTarget.cd_targsrc) target.cd_targsrc_n = 0; // (src_func.FTarget.cd_targsrc) - target.select = bool(false); target.ind_target_next = (src_func::FTarget*)-1; // (src_func.FDb.ind_target) not-in-hash + target.ind_target_hashval = 0; // stored hash value } // --- src_func.FTarget.cd_targsrc_curs.Reset @@ -807,7 +686,7 @@ inline bool src_func::target_cd_targsrc_curs_ValidQ(target_cd_targsrc_curs &curs // --- src_func.FTarget.cd_targsrc_curs.Next // proceed to next item inline void src_func::target_cd_targsrc_curs_Next(target_cd_targsrc_curs &curs) { - src_func::FTargsrc *next = (*curs.row).cd_targsrc_next; + src_func::FTargsrc *next = (*curs.row).target_cd_targsrc_next; curs.row = next; if (curs.row == *curs.head) { curs.row = NULL; @@ -846,9 +725,9 @@ inline src_func::FFunc* src_func::zd_func_First(src_func::FTargsrc& targsrc) { // --- src_func.FTargsrc.zd_func.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool src_func::zd_func_InLlistQ(src_func::FFunc& row) { +inline bool src_func::targsrc_zd_func_InLlistQ(src_func::FFunc& row) { bool result = false; - result = !(row.zd_func_next == (src_func::FFunc*)-1); + result = !(row.targsrc_zd_func_next == (src_func::FFunc*)-1); return result; } @@ -868,14 +747,14 @@ inline i32 src_func::zd_func_N(const src_func::FTargsrc& targsrc) { // --- src_func.FTargsrc.zd_func.Next // Return pointer to next element in the list -inline src_func::FFunc* src_func::zd_func_Next(src_func::FFunc &row) { - return row.zd_func_next; +inline src_func::FFunc* src_func::targsrc_zd_func_Next(src_func::FFunc &row) { + return row.targsrc_zd_func_next; } // --- src_func.FTargsrc.zd_func.Prev // Return pointer to previous element in the list -inline src_func::FFunc* src_func::zd_func_Prev(src_func::FFunc &row) { - return row.zd_func_prev; +inline src_func::FFunc* src_func::targsrc_zd_func_Prev(src_func::FFunc &row) { + return row.targsrc_zd_func_prev; } // --- src_func.FTargsrc.zd_func.qLast @@ -894,8 +773,9 @@ inline void src_func::FTargsrc_Init(src_func::FTargsrc& targsrc) { targsrc.zd_func_tail = NULL; // (src_func.FTargsrc.zd_func) targsrc.p_target = NULL; targsrc.select = bool(false); - targsrc.cd_targsrc_next = (src_func::FTargsrc*)-1; // (src_func.FTarget.cd_targsrc) not-in-list - targsrc.cd_targsrc_prev = NULL; // (src_func.FTarget.cd_targsrc) + targsrc.counter = i32(0); + targsrc.target_cd_targsrc_next = (src_func::FTargsrc*)-1; // (src_func.FTarget.cd_targsrc) not-in-list + targsrc.target_cd_targsrc_prev = NULL; // (src_func.FTarget.cd_targsrc) } // --- src_func.FTargsrc.zd_func_curs.Reset @@ -913,7 +793,7 @@ inline bool src_func::targsrc_zd_func_curs_ValidQ(targsrc_zd_func_curs &curs) { // --- src_func.FTargsrc.zd_func_curs.Next // proceed to next item inline void src_func::targsrc_zd_func_curs_Next(targsrc_zd_func_curs &curs) { - src_func::FFunc *next = (*curs.row).zd_func_next; + src_func::FFunc *next = (*curs.row).targsrc_zd_func_next; curs.row = next; } @@ -933,6 +813,109 @@ inline src_func::FTargsrc::~FTargsrc() { src_func::FTargsrc_Uninit(*this); } +// --- src_func.FUserfunc.zd_func.EmptyQ +// Return true if index is empty +inline bool src_func::zd_func_EmptyQ(src_func::FUserfunc& userfunc) { + return userfunc.zd_func_head == NULL; +} + +// --- src_func.FUserfunc.zd_func.First +// If index empty, return NULL. Otherwise return pointer to first element in index +inline src_func::FFunc* src_func::zd_func_First(src_func::FUserfunc& userfunc) { + src_func::FFunc *row = NULL; + row = userfunc.zd_func_head; + return row; +} + +// --- src_func.FUserfunc.zd_func.InLlistQ +// Return true if row is in the linked list, false otherwise +inline bool src_func::userfunc_zd_func_InLlistQ(src_func::FFunc& row) { + bool result = false; + result = !(row.userfunc_zd_func_next == (src_func::FFunc*)-1); + return result; +} + +// --- src_func.FUserfunc.zd_func.Last +// If index empty, return NULL. Otherwise return pointer to last element in index +inline src_func::FFunc* src_func::zd_func_Last(src_func::FUserfunc& userfunc) { + src_func::FFunc *row = NULL; + row = userfunc.zd_func_tail; + return row; +} + +// --- src_func.FUserfunc.zd_func.N +// Return number of items in the linked list +inline i32 src_func::zd_func_N(const src_func::FUserfunc& userfunc) { + return userfunc.zd_func_n; +} + +// --- src_func.FUserfunc.zd_func.Next +// Return pointer to next element in the list +inline src_func::FFunc* src_func::userfunc_zd_func_Next(src_func::FFunc &row) { + return row.userfunc_zd_func_next; +} + +// --- src_func.FUserfunc.zd_func.Prev +// Return pointer to previous element in the list +inline src_func::FFunc* src_func::userfunc_zd_func_Prev(src_func::FFunc &row) { + return row.userfunc_zd_func_prev; +} + +// --- src_func.FUserfunc.zd_func.qLast +// Return reference to last element in the index. No bounds checking. +inline src_func::FFunc& src_func::zd_func_qLast(src_func::FUserfunc& userfunc) { + src_func::FFunc *row = NULL; + row = userfunc.zd_func_tail; + return *row; +} + +// --- src_func.FUserfunc..Init +// Set all fields to initial values. +inline void src_func::FUserfunc_Init(src_func::FUserfunc& userfunc) { + userfunc.zd_func_head = NULL; // (src_func.FUserfunc.zd_func) + userfunc.zd_func_n = 0; // (src_func.FUserfunc.zd_func) + userfunc.zd_func_tail = NULL; // (src_func.FUserfunc.zd_func) + userfunc.ind_userfunc_next = (src_func::FUserfunc*)-1; // (src_func.FDb.ind_userfunc) not-in-hash + userfunc.ind_userfunc_hashval = 0; // stored hash value + userfunc.ind_userfunc_cppname_next = (src_func::FUserfunc*)-1; // (src_func.FDb.ind_userfunc_cppname) not-in-hash + userfunc.ind_userfunc_cppname_hashval = 0; // stored hash value +} + +// --- src_func.FUserfunc.zd_func_curs.Reset +// cursor points to valid item +inline void src_func::userfunc_zd_func_curs_Reset(userfunc_zd_func_curs &curs, src_func::FUserfunc &parent) { + curs.row = parent.zd_func_head; +} + +// --- src_func.FUserfunc.zd_func_curs.ValidQ +// cursor points to valid item +inline bool src_func::userfunc_zd_func_curs_ValidQ(userfunc_zd_func_curs &curs) { + return curs.row != NULL; +} + +// --- src_func.FUserfunc.zd_func_curs.Next +// proceed to next item +inline void src_func::userfunc_zd_func_curs_Next(userfunc_zd_func_curs &curs) { + src_func::FFunc *next = (*curs.row).userfunc_zd_func_next; + curs.row = next; +} + +// --- src_func.FUserfunc.zd_func_curs.Access +// item access +inline src_func::FFunc& src_func::userfunc_zd_func_curs_Access(userfunc_zd_func_curs &curs) { + return *curs.row; +} + +// --- src_func.FUserfunc..Ctor +inline src_func::FUserfunc::FUserfunc() { + src_func::FUserfunc_Init(*this); +} + +// --- src_func.FUserfunc..Dtor +inline src_func::FUserfunc::~FUserfunc() { + src_func::FUserfunc_Uninit(*this); +} + // --- src_func.FieldId.value.GetEnum // Get value of field as enum type inline src_func_FieldIdEnum src_func::value_GetEnum(const src_func::FieldId& parent) { diff --git a/include/gen/src_hdr_gen.h b/include/gen/src_hdr_gen.h index 3d436f89..3075f33a 100644 --- a/include/gen/src_hdr_gen.h +++ b/include/gen/src_hdr_gen.h @@ -95,9 +95,10 @@ namespace src_hdr { // gen:ns_print_struct // create: src_hdr.FDb.fcopyline (Tpool) // global access: ind_fcopyline (Thash, hash field fcopyline) struct FCopyline { // src_hdr.FCopyline - algo::cstring fcopyline; // - src_hdr::FCopyline* fcopyline_next; // Pointer to next free element int tpool - src_hdr::FCopyline* ind_fcopyline_next; // hash next + algo::cstring fcopyline; // + src_hdr::FCopyline* fcopyline_next; // Pointer to next free element int tpool + src_hdr::FCopyline* ind_fcopyline_next; // hash next + u32 ind_fcopyline_hashval; // hash value // func:src_hdr.FCopyline..AssignOp inline src_hdr::FCopyline& operator =(const src_hdr::FCopyline &rhs) = delete; // func:src_hdr.FCopyline..CopyCtor @@ -125,13 +126,14 @@ void FCopyline_Uninit(src_hdr::FCopyline& fcopyline) __attribute // global access: ind_copyright (Thash, hash field copyright) // global access: bh_copyright (Bheap, sort field sortkey) struct FCopyright { // src_hdr.FCopyright - algo::Smallstr50 copyright; // - bool dflt; // false - algo::Comment comment; // - algo::cstring years; // - i32 sortkey; // 0 - src_hdr::FCopyright* ind_copyright_next; // hash next - i32 bh_copyright_idx; // index in heap; -1 means not-in-heap + algo::Smallstr50 copyright; // + bool dflt; // false + algo::Comment comment; // + algo::cstring years; // + i32 sortkey; // 0 + src_hdr::FCopyright* ind_copyright_next; // hash next + u32 ind_copyright_hashval; // hash value + i32 bh_copyright_idx; // index in heap; -1 means not-in-heap // func:src_hdr.FCopyright..AssignOp inline src_hdr::FCopyright& operator =(const src_hdr::FCopyright &rhs) = delete; // func:src_hdr.FCopyright..CopyCtor @@ -355,6 +357,9 @@ void ind_ns_Remove(src_hdr::FNs& row) __attribute__((nothrow)); // Reserve enough room in the hash for N more elements. Return success code. // func:src_hdr.FDb.ind_ns.Reserve void ind_ns_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_hdr.FDb.ind_ns.AbsReserve +void ind_ns_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -457,6 +462,9 @@ void ind_license_Remove(src_hdr::FLicense& row) __attribute__((n // Reserve enough room in the hash for N more elements. Return success code. // func:src_hdr.FDb.ind_license.Reserve void ind_license_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_hdr.FDb.ind_license.AbsReserve +void ind_license_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -519,6 +527,9 @@ void ind_target_Remove(src_hdr::FTarget& row) __attribute__((not // Reserve enough room in the hash for N more elements. Return success code. // func:src_hdr.FDb.ind_target.Reserve void ind_target_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_hdr.FDb.ind_target.AbsReserve +void ind_target_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -614,6 +625,9 @@ void ind_fcopyline_Remove(src_hdr::FCopyline& row) __attribute__ // Reserve enough room in the hash for N more elements. Return success code. // func:src_hdr.FDb.ind_fcopyline.Reserve void ind_fcopyline_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_hdr.FDb.ind_fcopyline.AbsReserve +void ind_fcopyline_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -683,6 +697,9 @@ void ind_copyright_Remove(src_hdr::FCopyright& row) __attribute_ // Reserve enough room in the hash for N more elements. Return success code. // func:src_hdr.FDb.ind_copyright.Reserve void ind_copyright_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_hdr.FDb.ind_copyright.AbsReserve +void ind_copyright_AbsReserve(int n) __attribute__((nothrow)); // Remove all elements from heap and free memory used by the array. // func:src_hdr.FDb.bh_copyright.Dealloc @@ -838,10 +855,11 @@ void FDb_Uninit() __attribute__((nothrow)); // access: src_hdr.FScriptfile.p_license (Upptr) // access: src_hdr.FSrc.p_license (Upptr) struct FLicense { // src_hdr.FLicense - src_hdr::FLicense* ind_license_next; // hash next - algo::Smallstr50 license; // - algo::Comment comment; // - algo::cstring text; // + src_hdr::FLicense* ind_license_next; // hash next + u32 ind_license_hashval; // hash value + algo::Smallstr50 license; // + algo::Comment comment; // + algo::cstring text; // // func:src_hdr.FLicense..AssignOp inline src_hdr::FLicense& operator =(const src_hdr::FLicense &rhs) = delete; // func:src_hdr.FLicense..CopyCtor @@ -876,13 +894,14 @@ void FLicense_Uninit(src_hdr::FLicense& license) __attribute__(( // global access: ind_ns (Thash, hash field ns) // access: src_hdr.FTarget.p_ns (Upptr) struct FNs { // src_hdr.FNs - src_hdr::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // - src_hdr::FNsx* c_nsx; // optional pointer - src_hdr::FLicense* p_license; // reference to parent row + src_hdr::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // + src_hdr::FNsx* c_nsx; // optional pointer + src_hdr::FLicense* p_license; // reference to parent row // x-reference on src_hdr.FNs.c_nsx prevents copy // x-reference on src_hdr.FNs.p_license prevents copy // func:src_hdr.FNs..AssignOp @@ -1018,12 +1037,13 @@ void FSrc_Init(src_hdr::FSrc& parent); // global access: ind_target (Thash, hash field target) // access: src_hdr.FTargsrc.p_target (Upptr) struct FTarget { // src_hdr.FTarget - src_hdr::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target - src_hdr::FTargsrc** c_targsrc_elems; // array of pointers - u32 c_targsrc_n; // array of pointers - u32 c_targsrc_max; // capacity of allocated array - src_hdr::FNs* p_ns; // reference to parent row + src_hdr::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target + src_hdr::FTargsrc** c_targsrc_elems; // array of pointers + u32 c_targsrc_n; // array of pointers + u32 c_targsrc_max; // capacity of allocated array + src_hdr::FNs* p_ns; // reference to parent row // reftype Ptrary of src_hdr.FTarget.c_targsrc prohibits copy // x-reference on src_hdr.FTarget.p_ns prevents copy // func:src_hdr.FTarget..AssignOp diff --git a/include/gen/src_hdr_gen.inl.h b/include/gen/src_hdr_gen.inl.h index 56a3b31c..c0bd94e7 100644 --- a/include/gen/src_hdr_gen.inl.h +++ b/include/gen/src_hdr_gen.inl.h @@ -34,6 +34,7 @@ inline void src_hdr::FCopyline_Init(src_hdr::FCopyline& fcopyline) { fcopyline.fcopyline_next = (src_hdr::FCopyline*)-1; // (src_hdr.FDb.fcopyline) not-in-tpool's freelist fcopyline.ind_fcopyline_next = (src_hdr::FCopyline*)-1; // (src_hdr.FDb.ind_fcopyline) not-in-hash + fcopyline.ind_fcopyline_hashval = 0; // stored hash value } // --- src_hdr.FCopyline..Ctor @@ -52,6 +53,7 @@ inline void src_hdr::FCopyright_Init(src_hdr::FCopyright& copyright) { copyright.dflt = bool(false); copyright.sortkey = i32(0); copyright.ind_copyright_next = (src_hdr::FCopyright*)-1; // (src_hdr.FDb.ind_copyright) not-in-hash + copyright.ind_copyright_hashval = 0; // stored hash value copyright.bh_copyright_idx = -1; // (src_hdr.FDb.bh_copyright) not-in-heap } @@ -664,6 +666,7 @@ inline bool src_hdr::_db_bh_copyright_curs_ValidQ(_db_bh_copyright_curs &curs) { // Set all fields to initial values. inline void src_hdr::FLicense_Init(src_hdr::FLicense& license) { license.ind_license_next = (src_hdr::FLicense*)-1; // (src_hdr.FDb.ind_license) not-in-hash + license.ind_license_hashval = 0; // stored hash value } // --- src_hdr.FLicense..Ctor @@ -702,6 +705,7 @@ inline void src_hdr::FNs_Init(src_hdr::FNs& ns) { ns.c_nsx = NULL; ns.p_license = NULL; ns.ind_ns_next = (src_hdr::FNs*)-1; // (src_hdr.FDb.ind_ns) not-in-hash + ns.ind_ns_hashval = 0; // stored hash value } // --- src_hdr.FNs..Ctor @@ -815,6 +819,7 @@ inline void src_hdr::FTarget_Init(src_hdr::FTarget& target) { target.c_targsrc_max = 0; // (src_hdr.FTarget.c_targsrc) target.p_ns = NULL; target.ind_target_next = (src_hdr::FTarget*)-1; // (src_hdr.FDb.ind_target) not-in-hash + target.ind_target_hashval = 0; // stored hash value } // --- src_hdr.FTarget.c_targsrc_curs.Reset diff --git a/include/gen/src_lim_gen.h b/include/gen/src_lim_gen.h index 45d264e5..14b2ef87 100644 --- a/include/gen/src_lim_gen.h +++ b/include/gen/src_lim_gen.h @@ -362,6 +362,9 @@ void ind_gitfile_Remove(src_lim::FGitfile& row) __attribute__((n // Reserve enough room in the hash for N more elements. Return success code. // func:src_lim.FDb.ind_gitfile.Reserve void ind_gitfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:src_lim.FDb.ind_gitfile.AbsReserve +void ind_gitfile_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -475,13 +478,14 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: ind_gitfile (Thash, hash field gitfile) // access: src_lim.FTargsrc.p_gitfile (Upptr) struct FGitfile { // src_lim.FGitfile - src_lim::FGitfile* ind_gitfile_next; // hash next - algo::Smallstr200 gitfile; // - src_lim::FInclude* zd_include_head; // zero-terminated doubly linked list - i32 zd_include_n; // zero-terminated doubly linked list - src_lim::FInclude* zd_include_tail; // pointer to last element - src_lim::FLinelim* c_linelim; // optional pointer - src_lim::FTargsrc* c_targsrc; // optional pointer + src_lim::FGitfile* ind_gitfile_next; // hash next + u32 ind_gitfile_hashval; // hash value + algo::Smallstr200 gitfile; // + src_lim::FInclude* zd_include_head; // zero-terminated doubly linked list + i32 zd_include_n; // zero-terminated doubly linked list + src_lim::FInclude* zd_include_tail; // pointer to last element + src_lim::FLinelim* c_linelim; // optional pointer + src_lim::FTargsrc* c_targsrc; // optional pointer // reftype Llist of src_lim.FGitfile.zd_include prohibits copy // x-reference on src_lim.FGitfile.c_linelim prevents copy // x-reference on src_lim.FGitfile.c_targsrc prevents copy @@ -520,7 +524,7 @@ inline bool zd_include_EmptyQ(src_lim::FGitfile& gitfile) __attribute__ inline src_lim::FInclude* zd_include_First(src_lim::FGitfile& gitfile) __attribute__((__warn_unused_result__, nothrow, pure)); // Return true if row is in the linked list, false otherwise // func:src_lim.FGitfile.zd_include.InLlistQ -inline bool zd_include_InLlistQ(src_lim::FInclude& row) __attribute__((__warn_unused_result__, nothrow)); +inline bool gitfile_zd_include_InLlistQ(src_lim::FInclude& row) __attribute__((__warn_unused_result__, nothrow)); // Insert row into linked list. If row is already in linked list, do nothing. // func:src_lim.FGitfile.zd_include.Insert void zd_include_Insert(src_lim::FGitfile& gitfile, src_lim::FInclude& row) __attribute__((nothrow)); @@ -532,10 +536,10 @@ inline src_lim::FInclude* zd_include_Last(src_lim::FGitfile& gitfile) __attribut inline i32 zd_include_N(const src_lim::FGitfile& gitfile) __attribute__((__warn_unused_result__, nothrow, pure)); // Return pointer to next element in the list // func:src_lim.FGitfile.zd_include.Next -inline src_lim::FInclude* zd_include_Next(src_lim::FInclude &row) __attribute__((__warn_unused_result__, nothrow)); +inline src_lim::FInclude* gitfile_zd_include_Next(src_lim::FInclude &row) __attribute__((__warn_unused_result__, nothrow)); // Return pointer to previous element in the list // func:src_lim.FGitfile.zd_include.Prev -inline src_lim::FInclude* zd_include_Prev(src_lim::FInclude &row) __attribute__((__warn_unused_result__, nothrow)); +inline src_lim::FInclude* gitfile_zd_include_Prev(src_lim::FInclude &row) __attribute__((__warn_unused_result__, nothrow)); // Remove element from index. If element is not in index, do nothing. // func:src_lim.FGitfile.zd_include.Remove void zd_include_Remove(src_lim::FGitfile& gitfile, src_lim::FInclude& row) __attribute__((nothrow)); @@ -586,11 +590,11 @@ void FGitfile_Uninit(src_lim::FGitfile& gitfile) __attribute__(( // global access: include (Lary, by rowid) // access: src_lim.FGitfile.zd_include (Llist) struct FInclude { // src_lim.FInclude - src_lim::FInclude* zd_include_next; // zslist link; -1 means not-in-list - src_lim::FInclude* zd_include_prev; // previous element - algo::Smallstr200 include; // - bool sys; // false - algo::Comment comment; // + src_lim::FInclude* gitfile_zd_include_next; // zslist link; -1 means not-in-list + src_lim::FInclude* gitfile_zd_include_prev; // previous element + algo::Smallstr200 include; // + bool sys; // false + algo::Comment comment; // // func:src_lim.FInclude..AssignOp inline src_lim::FInclude& operator =(const src_lim::FInclude &rhs) = delete; // func:src_lim.FInclude..CopyCtor diff --git a/include/gen/src_lim_gen.inl.h b/include/gen/src_lim_gen.inl.h index f7427432..bf24a325 100644 --- a/include/gen/src_lim_gen.inl.h +++ b/include/gen/src_lim_gen.inl.h @@ -407,9 +407,9 @@ inline src_lim::FInclude* src_lim::zd_include_First(src_lim::FGitfile& gitfile) // --- src_lim.FGitfile.zd_include.InLlistQ // Return true if row is in the linked list, false otherwise -inline bool src_lim::zd_include_InLlistQ(src_lim::FInclude& row) { +inline bool src_lim::gitfile_zd_include_InLlistQ(src_lim::FInclude& row) { bool result = false; - result = !(row.zd_include_next == (src_lim::FInclude*)-1); + result = !(row.gitfile_zd_include_next == (src_lim::FInclude*)-1); return result; } @@ -429,14 +429,14 @@ inline i32 src_lim::zd_include_N(const src_lim::FGitfile& gitfile) { // --- src_lim.FGitfile.zd_include.Next // Return pointer to next element in the list -inline src_lim::FInclude* src_lim::zd_include_Next(src_lim::FInclude &row) { - return row.zd_include_next; +inline src_lim::FInclude* src_lim::gitfile_zd_include_Next(src_lim::FInclude &row) { + return row.gitfile_zd_include_next; } // --- src_lim.FGitfile.zd_include.Prev // Return pointer to previous element in the list -inline src_lim::FInclude* src_lim::zd_include_Prev(src_lim::FInclude &row) { - return row.zd_include_prev; +inline src_lim::FInclude* src_lim::gitfile_zd_include_Prev(src_lim::FInclude &row) { + return row.gitfile_zd_include_prev; } // --- src_lim.FGitfile.zd_include.qLast @@ -496,6 +496,7 @@ inline void src_lim::FGitfile_Init(src_lim::FGitfile& gitfile) { gitfile.c_linelim = NULL; gitfile.c_targsrc = NULL; gitfile.ind_gitfile_next = (src_lim::FGitfile*)-1; // (src_lim.FDb.ind_gitfile) not-in-hash + gitfile.ind_gitfile_hashval = 0; // stored hash value } // --- src_lim.FGitfile.zd_include_curs.Reset @@ -513,7 +514,7 @@ inline bool src_lim::gitfile_zd_include_curs_ValidQ(gitfile_zd_include_curs &cur // --- src_lim.FGitfile.zd_include_curs.Next // proceed to next item inline void src_lim::gitfile_zd_include_curs_Next(gitfile_zd_include_curs &curs) { - src_lim::FInclude *next = (*curs.row).zd_include_next; + src_lim::FInclude *next = (*curs.row).gitfile_zd_include_next; curs.row = next; } @@ -537,8 +538,8 @@ inline src_lim::FGitfile::~FGitfile() { // Set all fields to initial values. inline void src_lim::FInclude_Init(src_lim::FInclude& include) { include.sys = bool(false); - include.zd_include_next = (src_lim::FInclude*)-1; // (src_lim.FGitfile.zd_include) not-in-list - include.zd_include_prev = NULL; // (src_lim.FGitfile.zd_include) + include.gitfile_zd_include_next = (src_lim::FInclude*)-1; // (src_lim.FGitfile.zd_include) not-in-list + include.gitfile_zd_include_prev = NULL; // (src_lim.FGitfile.zd_include) } // --- src_lim.FInclude..Ctor diff --git a/include/gen/ssim2csv_gen.h b/include/gen/ssim2csv_gen.h index 571d280f..02cca7b4 100644 --- a/include/gen/ssim2csv_gen.h +++ b/include/gen/ssim2csv_gen.h @@ -201,6 +201,9 @@ void ind_expand_Remove(ssim2csv::FExpand& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:ssim2csv.FDb.ind_expand.Reserve void ind_expand_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:ssim2csv.FDb.ind_expand.AbsReserve +void ind_expand_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -262,6 +265,9 @@ void ind_outfile_Remove(ssim2csv::FOutfile& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:ssim2csv.FDb.ind_outfile.Reserve void ind_outfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:ssim2csv.FDb.ind_outfile.AbsReserve +void ind_outfile_AbsReserve(int n) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -279,6 +285,11 @@ algo::cstring& name_AllocAt(int at) __attribute__((__warn_unused_result__, // Reserve space. Insert N elements at the end of the array, return pointer to array // func:ssim2csv.FDb.name.AllocN algo::aryptr name_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:ssim2csv.FDb.name.AllocNAt +algo::aryptr name_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:ssim2csv.FDb.name.EmptyQ inline bool name_EmptyQ() __attribute__((nothrow)); @@ -328,6 +339,10 @@ algo::aryptr name_AllocNVal(int n_elems, const algo::cstring& val // Function returns success value. // func:ssim2csv.FDb.name.ReadStrptrMaybe bool name_ReadStrptrMaybe(algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:ssim2csv.FDb.name.Insary +void name_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -345,6 +360,11 @@ algo::cstring& value_AllocAt(int at) __attribute__((__warn_unused_result__ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:ssim2csv.FDb.value.AllocN algo::aryptr value_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:ssim2csv.FDb.value.AllocNAt +algo::aryptr value_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:ssim2csv.FDb.value.EmptyQ inline bool value_EmptyQ() __attribute__((nothrow)); @@ -394,6 +414,10 @@ algo::aryptr value_AllocNVal(int n_elems, const algo::cstring& va // Function returns success value. // func:ssim2csv.FDb.value.ReadStrptrMaybe bool value_ReadStrptrMaybe(algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:ssim2csv.FDb.value.Insary +void value_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // Reserve space (this may move memory). Insert N element at the end. // Return aryptr to newly inserted block. @@ -411,6 +435,11 @@ ssim2csv::FFlatten& flatten_AllocAt(int at) __attribute__((__warn_unused_result // Reserve space. Insert N elements at the end of the array, return pointer to array // func:ssim2csv.FDb.flatten.AllocN algo::aryptr flatten_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:ssim2csv.FDb.flatten.AllocNAt +algo::aryptr flatten_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:ssim2csv.FDb.flatten.EmptyQ inline bool flatten_EmptyQ() __attribute__((nothrow)); @@ -455,6 +484,10 @@ inline u64 flatten_rowid_Get(ssim2csv::FFlatten &elem) __attribute__(( // Reserve space. Insert N elements at the end of the array, return pointer to array // func:ssim2csv.FDb.flatten.AllocNVal algo::aryptr flatten_AllocNVal(int n_elems, const ssim2csv::FFlatten& val) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:ssim2csv.FDb.flatten.Insary +void flatten_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // cursor points to valid item // func:ssim2csv.FDb.expand_curs.Reset @@ -524,8 +557,9 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: expand (Lary, by rowid) // global access: ind_expand (Thash, hash field expand) struct FExpand { // ssim2csv.FExpand - ssim2csv::FExpand* ind_expand_next; // hash next - algo::cstring expand; // + ssim2csv::FExpand* ind_expand_next; // hash next + u32 ind_expand_hashval; // hash value + algo::cstring expand; // // func:ssim2csv.FExpand..AssignOp inline ssim2csv::FExpand& operator =(const ssim2csv::FExpand &rhs) = delete; // func:ssim2csv.FExpand..CopyCtor @@ -570,10 +604,11 @@ void FFlatten_Print(ssim2csv::FFlatten& row, algo::cstring& str) // global access: outfile (Lary, by rowid) // global access: ind_outfile (Thash, hash field outfile) struct FOutfile { // ssim2csv.FOutfile - ssim2csv::FOutfile* ind_outfile_next; // hash next - algo_lib::FFildes fildes; // - algo::cstring header; // - algo::cstring outfile; // + ssim2csv::FOutfile* ind_outfile_next; // hash next + u32 ind_outfile_hashval; // hash value + algo_lib::FFildes fildes; // + algo::cstring header; // + algo::cstring outfile; // // func:ssim2csv.FOutfile..AssignOp inline ssim2csv::FOutfile& operator =(const ssim2csv::FOutfile &rhs) = delete; // func:ssim2csv.FOutfile..CopyCtor diff --git a/include/gen/ssim2csv_gen.inl.h b/include/gen/ssim2csv_gen.inl.h index 183e30aa..38db9431 100644 --- a/include/gen/ssim2csv_gen.inl.h +++ b/include/gen/ssim2csv_gen.inl.h @@ -470,6 +470,7 @@ inline ssim2csv::FFlatten& ssim2csv::_db_flatten_curs_Access(_db_flatten_curs &c // Set all fields to initial values. inline void ssim2csv::FExpand_Init(ssim2csv::FExpand& expand) { expand.ind_expand_next = (ssim2csv::FExpand*)-1; // (ssim2csv.FDb.ind_expand) not-in-hash + expand.ind_expand_hashval = 0; // stored hash value } // --- ssim2csv.FExpand..Ctor @@ -490,6 +491,7 @@ inline ssim2csv::FFlatten::FFlatten() { // Set all fields to initial values. inline void ssim2csv::FOutfile_Init(ssim2csv::FOutfile& outfile) { outfile.ind_outfile_next = (ssim2csv::FOutfile*)-1; // (ssim2csv.FDb.ind_outfile) not-in-hash + outfile.ind_outfile_hashval = 0; // stored hash value } // --- ssim2csv.FOutfile..Ctor diff --git a/include/gen/ssim2mysql_gen.h b/include/gen/ssim2mysql_gen.h index c3ce5082..b357022d 100644 --- a/include/gen/ssim2mysql_gen.h +++ b/include/gen/ssim2mysql_gen.h @@ -137,6 +137,7 @@ struct FColumn { // ssim2mysql.FColumn bool is_pkey; // false bool ssimfile_c_column_in_ary; // false membership flag ssim2mysql::FColumn* ind_column_next; // hash next + u32 ind_column_hashval; // hash value // func:ssim2mysql.FColumn..AssignOp inline ssim2mysql::FColumn& operator =(const ssim2mysql::FColumn &rhs) = delete; // func:ssim2mysql.FColumn..CopyCtor @@ -178,15 +179,16 @@ void FColumn_Print(ssim2mysql::FColumn& row, algo::cstring& str) // access: ssim2mysql.FField.p_arg (Upptr) // access: ssim2mysql.FSsimfile.p_ctype (Upptr) struct FCtype { // ssim2mysql.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - ssim2mysql::FNs* p_ns; // reference to parent row - ssim2mysql::FSqltype* c_sqltype; // optional pointer - ssim2mysql::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - ssim2mysql::FSsimfile* c_ssimfile; // optional pointer - ssim2mysql::FCtype* ind_ctype_next; // hash next + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + ssim2mysql::FNs* p_ns; // reference to parent row + ssim2mysql::FSqltype* c_sqltype; // optional pointer + ssim2mysql::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + ssim2mysql::FSsimfile* c_ssimfile; // optional pointer + ssim2mysql::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // x-reference on ssim2mysql.FCtype.p_ns prevents copy // x-reference on ssim2mysql.FCtype.c_sqltype prevents copy // reftype Ptrary of ssim2mysql.FCtype.c_field prohibits copy @@ -389,6 +391,9 @@ void ind_column_Remove(ssim2mysql::FColumn& row) __attribute__(( // Reserve enough room in the hash for N more elements. Return success code. // func:ssim2mysql.FDb.ind_column.Reserve void ind_column_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:ssim2mysql.FDb.ind_column.AbsReserve +void ind_column_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -673,6 +678,9 @@ void ind_ns_Remove(ssim2mysql::FNs& row) __attribute__((nothrow) // Reserve enough room in the hash for N more elements. Return success code. // func:ssim2mysql.FDb.ind_ns.Reserve void ind_ns_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:ssim2mysql.FDb.ind_ns.AbsReserve +void ind_ns_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:ssim2mysql.FDb.ind_ctype.EmptyQ @@ -698,6 +706,9 @@ void ind_ctype_Remove(ssim2mysql::FCtype& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:ssim2mysql.FDb.ind_ctype.Reserve void ind_ctype_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:ssim2mysql.FDb.ind_ctype.AbsReserve +void ind_ctype_AbsReserve(int n) __attribute__((nothrow)); // Return true if hash is empty // func:ssim2mysql.FDb.ind_field.EmptyQ @@ -723,6 +734,9 @@ void ind_field_Remove(ssim2mysql::FField& row) __attribute__((no // Reserve enough room in the hash for N more elements. Return success code. // func:ssim2mysql.FDb.ind_field.Reserve void ind_field_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:ssim2mysql.FDb.ind_field.AbsReserve +void ind_field_AbsReserve(int n) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -822,6 +836,9 @@ void ind_ssimfile_Remove(ssim2mysql::FSsimfile& row) __attribute // Reserve enough room in the hash for N more elements. Return success code. // func:ssim2mysql.FDb.ind_ssimfile.Reserve void ind_ssimfile_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:ssim2mysql.FDb.ind_ssimfile.AbsReserve +void ind_ssimfile_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:ssim2mysql.FDb.zs_cmd.EmptyQ @@ -1100,6 +1117,7 @@ void FDb_Uninit() __attribute__((nothrow)); // access: ssim2mysql.FSubstr.p_field (Upptr) struct FField { // ssim2mysql.FField ssim2mysql::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -1171,16 +1189,16 @@ struct FInput { // ssim2mysql.FInput ssim2mysql::FInput* input_next; // Pointer to next free element int tpool ssim2mysql::FInput* cd_input_line_next; // zslist link; -1 means not-in-list ssim2mysql::FInput* cd_input_line_prev; // previous element - u8 in_buf_elems[65536]; // pointer to elements of inline array + u8* in_buf_elems; // NULL pointer to elements of indirect array + u32 in_buf_max; // 0 current length of allocated array i32 in_buf_start; // beginning of valid bytes (in bytes) i32 in_buf_end; // end of valid bytes (in bytes) - bool in_buf_eof; // no more data will be written to buffer + i32 in_buf_msglen; // current message length algo::Errcode in_buf_err; // system error code + algo_lib::FIohook in_buf_iohook; // edge-triggered hook for the buffer + bool in_buf_eof; // no more data will be written to buffer bool in_buf_msgvalid; // current message is valid - i32 in_buf_msglen; // current message length - algo_lib::FIohook in_buf_iohook; // edge-triggered hook for refilling buffer bool in_buf_epoll_enable; // use epoll? - enum { in_buf_max = 65536 }; algo::Tuple tuple; // Temp tuple algo::cstring warnstr; // Warning string // field ssim2mysql.FInput.in_buf prevents copy @@ -1221,6 +1239,12 @@ void in_buf_EndRead(ssim2mysql::FInput& input) __attribute__((no // // func:ssim2mysql.FInput.in_buf.GetMsg algo::aryptr in_buf_GetMsg(ssim2mysql::FInput& input) __attribute__((nothrow)); +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +// func:ssim2mysql.FInput.in_buf.Realloc +void in_buf_Realloc(ssim2mysql::FInput& input, int new_max) __attribute__((nothrow)); // Return max. number of bytes in the buffer. // func:ssim2mysql.FInput.in_buf.Max inline i32 in_buf_Max(ssim2mysql::FInput& input) __attribute__((nothrow)); @@ -1243,13 +1267,17 @@ void in_buf_SkipBytes(ssim2mysql::FInput& input, int n) __attrib // Skip current message, if any. // func:ssim2mysql.FInput.in_buf.SkipMsg void in_buf_SkipMsg(ssim2mysql::FInput& input) __attribute__((nothrow)); -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. // // func:ssim2mysql.FInput.in_buf.WriteAll bool in_buf_WriteAll(ssim2mysql::FInput& input, u8 *in, i32 in_n) __attribute__((nothrow)); +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +// func:ssim2mysql.FInput.in_buf.WriteReserve +void in_buf_WriteReserve(ssim2mysql::FInput& input, u8 *in, i32 in_n) __attribute__((nothrow)); // Set all fields to initial values. // func:ssim2mysql.FInput..Init @@ -1268,6 +1296,7 @@ void FInput_Print(ssim2mysql::FInput& row, algo::cstring& str) _ // access: ssim2mysql.FCtype.p_ns (Upptr) struct FNs { // ssim2mysql.FNs ssim2mysql::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value algo::Smallstr16 ns; // Namespace name (primary key) algo::Smallstr50 nstype; // Namespace type algo::Smallstr50 license; // Associated license @@ -1405,6 +1434,7 @@ void FSqltype_Print(ssim2mysql::FSqltype& row, algo::cstring& st // access: ssim2mysql.FNs.c_ssimfile (Ptrary) struct FSsimfile { // ssim2mysql.FSsimfile ssim2mysql::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value ssim2mysql::FSsimfile* zd_ssimfile_next; // zslist link; -1 means not-in-list ssim2mysql::FSsimfile* zd_ssimfile_prev; // previous element algo::Smallstr50 ssimfile; // diff --git a/include/gen/ssim2mysql_gen.inl.h b/include/gen/ssim2mysql_gen.inl.h index 43a96414..9477f17e 100644 --- a/include/gen/ssim2mysql_gen.inl.h +++ b/include/gen/ssim2mysql_gen.inl.h @@ -53,6 +53,7 @@ inline void ssim2mysql::FColumn_Init(ssim2mysql::FColumn& column) { column.is_pkey = bool(false); column.ssimfile_c_column_in_ary = bool(false); column.ind_column_next = (ssim2mysql::FColumn*)-1; // (ssim2mysql.FDb.ind_column) not-in-hash + column.ind_column_hashval = 0; // stored hash value } // --- ssim2mysql.FColumn..Ctor @@ -198,6 +199,7 @@ inline void ssim2mysql::FCtype_Init(ssim2mysql::FCtype& ctype) { ctype.c_field_max = 0; // (ssim2mysql.FCtype.c_field) ctype.c_ssimfile = NULL; ctype.ind_ctype_next = (ssim2mysql::FCtype*)-1; // (ssim2mysql.FDb.ind_ctype) not-in-hash + ctype.ind_ctype_hashval = 0; // stored hash value } // --- ssim2mysql.FCtype..Ctor @@ -1009,8 +1011,7 @@ inline ssim2mysql::FField::~FField() { // --- ssim2mysql.FInput.in_buf.Max // Return max. number of bytes in the buffer. inline i32 ssim2mysql::in_buf_Max(ssim2mysql::FInput& input) { - return 65536; - (void)input;//only to avoid -Wunused-parameter + return input.in_buf_max; } // --- ssim2mysql.FInput.in_buf.N @@ -1096,6 +1097,7 @@ inline void ssim2mysql::FNs_Init(ssim2mysql::FNs& ns) { ns.c_ssimfile_n = 0; // (ssim2mysql.FNs.c_ssimfile) ns.c_ssimfile_max = 0; // (ssim2mysql.FNs.c_ssimfile) ns.ind_ns_next = (ssim2mysql::FNs*)-1; // (ssim2mysql.FDb.ind_ns) not-in-hash + ns.ind_ns_hashval = 0; // stored hash value } // --- ssim2mysql.FNs.c_ssimfile_curs.Reset diff --git a/include/gen/ssimfilt_gen.h b/include/gen/ssimfilt_gen.h index 0cba7276..43e1a5ed 100644 --- a/include/gen/ssimfilt_gen.h +++ b/include/gen/ssimfilt_gen.h @@ -308,6 +308,9 @@ void ind_unstablefld_Remove(ssimfilt::FUnstablefld& row) __attri // Reserve enough room in the hash for N more elements. Return success code. // func:ssimfilt.FDb.ind_unstablefld.Reserve void ind_unstablefld_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:ssimfilt.FDb.ind_unstablefld.AbsReserve +void ind_unstablefld_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:ssimfilt.FDb.tuple_curs.Reset @@ -368,9 +371,10 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: unstablefld (Lary, by rowid) // global access: ind_unstablefld (Thash, hash field field) struct FUnstablefld { // ssimfilt.FUnstablefld - ssimfilt::FUnstablefld* ind_unstablefld_next; // hash next - algo::Smallstr100 field; // - algo::Comment comment; // + ssimfilt::FUnstablefld* ind_unstablefld_next; // hash next + u32 ind_unstablefld_hashval; // hash value + algo::Smallstr100 field; // + algo::Comment comment; // // func:ssimfilt.FUnstablefld..AssignOp inline ssimfilt::FUnstablefld& operator =(const ssimfilt::FUnstablefld &rhs) = delete; // func:ssimfilt.FUnstablefld..CopyCtor diff --git a/include/gen/ssimfilt_gen.inl.h b/include/gen/ssimfilt_gen.inl.h index d1eeb439..82141f1d 100644 --- a/include/gen/ssimfilt_gen.inl.h +++ b/include/gen/ssimfilt_gen.inl.h @@ -316,6 +316,7 @@ inline ssimfilt::FUnstablefld& ssimfilt::_db_unstablefld_curs_Access(_db_unstabl // Set all fields to initial values. inline void ssimfilt::FUnstablefld_Init(ssimfilt::FUnstablefld& unstablefld) { unstablefld.ind_unstablefld_next = (ssimfilt::FUnstablefld*)-1; // (ssimfilt.FDb.ind_unstablefld) not-in-hash + unstablefld.ind_unstablefld_hashval = 0; // stored hash value } // --- ssimfilt.FUnstablefld..Ctor diff --git a/include/gen/sv2ssim_gen.h b/include/gen/sv2ssim_gen.h index fe46e1bc..2f29dda1 100644 --- a/include/gen/sv2ssim_gen.h +++ b/include/gen/sv2ssim_gen.h @@ -90,12 +90,13 @@ namespace sv2ssim { // gen:ns_print_struct // global access: bltin (Lary, by rowid) // global access: ind_bltin (Thash, hash field ctype) struct FBltin { // sv2ssim.FBltin - algo::Smallstr100 ctype; // - bool likeu64; // false - bool bigendok; // false - bool issigned; // false - algo::Comment comment; // - sv2ssim::FBltin* ind_bltin_next; // hash next + algo::Smallstr100 ctype; // + bool likeu64; // false + bool bigendok; // false + bool issigned; // false + algo::Comment comment; // + sv2ssim::FBltin* ind_bltin_next; // hash next + u32 ind_bltin_hashval; // hash value // func:sv2ssim.FBltin..AssignOp inline sv2ssim::FBltin& operator =(const sv2ssim::FBltin &rhs) = delete; // func:sv2ssim.FBltin..CopyCtor @@ -261,6 +262,11 @@ algo::cstring& linetok_AllocAt(int at) __attribute__((__warn_unused_result // Reserve space. Insert N elements at the end of the array, return pointer to array // func:sv2ssim.FDb.linetok.AllocN algo::aryptr linetok_AllocN(int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:sv2ssim.FDb.linetok.AllocNAt +algo::aryptr linetok_AllocNAt(int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:sv2ssim.FDb.linetok.EmptyQ inline bool linetok_EmptyQ() __attribute__((nothrow)); @@ -310,6 +316,10 @@ algo::aryptr linetok_AllocNVal(int n_elems, const algo::cstring& // Function returns success value. // func:sv2ssim.FDb.linetok.ReadStrptrMaybe bool linetok_ReadStrptrMaybe(algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:sv2ssim.FDb.linetok.Insary +void linetok_Insary(algo::aryptr rhs, int at) __attribute__((nothrow)); // Allocate memory for new default row. // If out of memory, process is killed. @@ -375,6 +385,9 @@ void ind_field_Remove(sv2ssim::FField& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:sv2ssim.FDb.ind_field.Reserve void ind_field_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:sv2ssim.FDb.ind_field.AbsReserve +void ind_field_AbsReserve(int n) __attribute__((nothrow)); // Return true if index is empty // func:sv2ssim.FDb.zd_selfield.EmptyQ @@ -477,6 +490,9 @@ void ind_bltin_Remove(sv2ssim::FBltin& row) __attribute__((nothr // Reserve enough room in the hash for N more elements. Return success code. // func:sv2ssim.FDb.ind_bltin.Reserve void ind_bltin_Reserve(int n) __attribute__((nothrow)); +// Reserve enough room for exacty N elements. Return success code. +// func:sv2ssim.FDb.ind_bltin.AbsReserve +void ind_bltin_AbsReserve(int n) __attribute__((nothrow)); // cursor points to valid item // func:sv2ssim.FDb.field_curs.Reset @@ -549,23 +565,24 @@ void FDb_Uninit() __attribute__((nothrow)); // global access: ind_field (Thash, hash field name) // global access: zd_selfield (Llist) struct FField { // sv2ssim.FField - sv2ssim::FField* ind_field_next; // hash next - sv2ssim::FField* zd_selfield_next; // zslist link; -1 means not-in-list - sv2ssim::FField* zd_selfield_prev; // previous element - algo::cstring name; // Field name - algo::Smallstr100 ctype; // Determined type - i32 maxwid; // 0 Max field width in chars - double minval; // 1e300 Min numeric value - double maxval; // -1e300 Max numeric value - i32 minwid_fix1; // 100000 Min digits before . - i32 maxwid_fix1; // 0 Max digits before . - i32 minwid_fix2; // 100000 Min digits after . - i32 maxwid_fix2; // 0 Max digits after . - bool couldbe_int; // true - bool couldbe_bool; // true - bool couldbe_fixwid; // true Fixed width char - bool couldbe_double; // true - i32 rowid; // 0 + sv2ssim::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value + sv2ssim::FField* zd_selfield_next; // zslist link; -1 means not-in-list + sv2ssim::FField* zd_selfield_prev; // previous element + algo::cstring name; // Field name + algo::Smallstr100 ctype; // Determined type + i32 maxwid; // 0 Max field width in chars + double minval; // 1e300 Min numeric value + double maxval; // -1e300 Max numeric value + i32 minwid_fix1; // 100000 Min digits before . + i32 maxwid_fix1; // 0 Max digits before . + i32 minwid_fix2; // 100000 Min digits after . + i32 maxwid_fix2; // 0 Max digits after . + bool couldbe_int; // true + bool couldbe_bool; // true + bool couldbe_fixwid; // true Fixed width char + bool couldbe_double; // true + i32 rowid; // 0 // func:sv2ssim.FField..AssignOp sv2ssim::FField& operator =(const sv2ssim::FField &rhs) = delete; // func:sv2ssim.FField..CopyCtor diff --git a/include/gen/sv2ssim_gen.inl.h b/include/gen/sv2ssim_gen.inl.h index 543c1dd2..d53fdb22 100644 --- a/include/gen/sv2ssim_gen.inl.h +++ b/include/gen/sv2ssim_gen.inl.h @@ -36,6 +36,7 @@ inline void sv2ssim::FBltin_Init(sv2ssim::FBltin& bltin) { bltin.bigendok = bool(false); bltin.issigned = bool(false); bltin.ind_bltin_next = (sv2ssim::FBltin*)-1; // (sv2ssim.FDb.ind_bltin) not-in-hash + bltin.ind_bltin_hashval = 0; // stored hash value } // --- sv2ssim.FBltin..Ctor diff --git a/include/gen/ws_gen.h b/include/gen/ws_gen.h new file mode 100644 index 00000000..96187fa7 --- /dev/null +++ b/include/gen/ws_gen.h @@ -0,0 +1,1850 @@ +// +// include/gen/ws_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/ams_gen.h" +#include "include/gen/algo_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- ws_SideEnum + +enum ws_SideEnum { // ws.Side.value + ws_Side_server = 0 + ,ws_Side_client = 1 +}; + +enum { ws_SideEnum_N = 2 }; + + +// --- ws_StatusCodeEnum + +enum ws_StatusCodeEnum { // ws.StatusCode.value + ws_StatusCode_Normal_closure = 1000 + ,ws_StatusCode_Going_away = 1001 // Server going down or browser page close + ,ws_StatusCode_Protocol_error = 1002 + ,ws_StatusCode_Unsupported_message_data_type = 1003 // Text message while expecting binary and vice-versa + ,ws_StatusCode_No_status_code = 1005 // No status code received in remote close message + ,ws_StatusCode_Abnormal_closure = 1006 // Lower layer failure + ,ws_StatusCode_Invalid_message_data = 1007 // E.g. non-UTF-8 within text message + ,ws_StatusCode_Policy_violation = 1008 + ,ws_StatusCode_Message_too_big = 1009 + ,ws_StatusCode_Missing_extension = 1010 + ,ws_StatusCode_Internal_error = 1011 + ,ws_StatusCode_TLS_Handshake = 1015 +}; + +enum { ws_StatusCodeEnum_N = 12 }; + + +// --- ws_OpcodeEnum + +enum ws_OpcodeEnum { // ws.Opcode.value + ws_Opcode_cont = 0 // continuation frame + ,ws_Opcode_text = 1 // text frame + ,ws_Opcode_binary = 2 // binary frame + ,ws_Opcode_close = 8 // connection close + ,ws_Opcode_ping = 9 // ping + ,ws_Opcode_pong = 10 // pong +}; + +enum { ws_OpcodeEnum_N = 6 }; + + +// --- ws_FieldIdEnum + +enum ws_FieldIdEnum { // ws.FieldId.value + ws_FieldId_base = 0 + ,ws_FieldId_type = 1 + ,ws_FieldId_length = 2 + ,ws_FieldId_conn = 3 + ,ws_FieldId_side = 4 + ,ws_FieldId_code = 5 + ,ws_FieldId_reason = 6 + ,ws_FieldId_opcode = 7 + ,ws_FieldId_data = 8 + ,ws_FieldId_byte0 = 9 + ,ws_FieldId_byte1 = 10 + ,ws_FieldId_fin = 11 + ,ws_FieldId_rsv1 = 12 + ,ws_FieldId_rsv2 = 13 + ,ws_FieldId_rsv3 = 14 + ,ws_FieldId_mask = 15 + ,ws_FieldId_payload_len = 16 + ,ws_FieldId_payload = 17 + ,ws_FieldId_ext_payload_len = 18 + ,ws_FieldId_masking_key = 19 + ,ws_FieldId_value = 20 + ,ws_FieldId_server = 21 +}; + +enum { ws_FieldIdEnum_N = 22 }; + + +// --- ws_FrameHeader_byte0_Enum + +enum ws_FrameHeader_byte0_Enum { // ws.FrameHeader.byte0 + ws_FrameHeader_byte0_rsv3 = 0x10 // ws.FrameHeader.rsv3 + ,ws_FrameHeader_byte0_rsv2 = 0x20 // ws.FrameHeader.rsv2 + ,ws_FrameHeader_byte0_rsv1 = 0x40 // ws.FrameHeader.rsv1 + ,ws_FrameHeader_byte0_fin = 0x80 // ws.FrameHeader.fin +}; + +enum { ws_FrameHeader_byte0_Enum_N = 4 }; + + +// --- ws_FrameHeader_byte1_Enum + +enum ws_FrameHeader_byte1_Enum { // ws.FrameHeader.byte1 + ws_FrameHeader_byte1_ws_Frame16 = 126 + ,ws_FrameHeader_byte1_ws_Frame64 = 127 + ,ws_FrameHeader_byte1_ws_FrameMasked16 = 254 + ,ws_FrameHeader_byte1_ws_FrameMasked64 = 255 + ,ws_FrameHeader_byte1_mask = 0x80 // ws.FrameHeader.mask +}; + +enum { ws_FrameHeader_byte1_Enum_N = 5 }; + + +// --- ws_FrameHeaderMsgsCaseEnum + +enum ws_FrameHeaderMsgsCaseEnum { // ws.FrameHeaderMsgsCase.value + ws_FrameHeaderMsgsCase_ws_Frame16 = 126 + ,ws_FrameHeaderMsgsCase_ws_Frame64 = 127 + ,ws_FrameHeaderMsgsCase_ws_FrameMasked16 = 254 + ,ws_FrameHeaderMsgsCase_ws_FrameMasked64 = 255 +}; + +enum { ws_FrameHeaderMsgsCaseEnum_N = 4 }; + + +// --- ws_HttpStateEnum + +enum ws_HttpStateEnum { // ws.HttpState.value + ws_HttpState_INIT = 0 // created connection, waiting request-line + ,ws_HttpState_REQLINE = 1 // request-line received, waiting first header + ,ws_HttpState_HEADER = 2 // waiting next header + ,ws_HttpState_BODY = 3 // headers received, waiting body + ,ws_HttpState_FIN = 4 // connection closed, to be deleted +}; + +enum { ws_HttpStateEnum_N = 5 }; + +namespace ws { // gen:ns_pkeytypedef +} // gen:ns_pkeytypedef +namespace ws { // gen:ns_tclass_field +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace ws { struct FrameHeader; } +namespace ws { struct Frame16; } +namespace ws { struct Frame64; } +namespace ws { struct FrameMasked16; } +namespace ws { struct FrameMasked64; } +namespace ws { struct CloseMsg_reason_curs; } +namespace ws { struct DataMsg_data_curs; } +namespace ws { struct Frame_payload_curs; } +namespace ws { struct Frame16_payload_curs; } +namespace ws { struct Frame64_payload_curs; } +namespace ws { struct FrameMasked_payload_curs; } +namespace ws { struct FrameMasked16_payload_curs; } +namespace ws { struct FrameMasked64_payload_curs; } +namespace ws { struct Side; } +namespace ws { struct StatusCode; } +namespace ws { struct Opcode; } +namespace ws { struct FieldId; } +namespace ws { struct Frame; } +namespace ws { struct Frame16_curs; } +namespace ws { struct Frame64_curs; } +namespace ws { struct FrameHeaderMsgsCase; } +namespace ws { struct FrameMasked; } +namespace ws { struct FrameMasked16_curs; } +namespace ws { struct FrameMasked64_curs; } +namespace ws { struct HttpState; } +namespace ws { // gen:ns_print_struct + +// --- ws.Side +#pragma pack(push,1) +struct Side { // ws.Side + char value; // 0 + // func:ws.Side.value.Cast + inline operator ws_SideEnum() const __attribute__((nothrow)); + // func:ws.Side..Ctor + inline Side() __attribute__((nothrow)); + // func:ws.Side..FieldwiseCtor + explicit inline Side(char in_value) __attribute__((nothrow)); + // func:ws.Side..EnumCtor + inline Side(ws_SideEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:ws.Side.value.GetEnum +inline ws_SideEnum value_GetEnum(const ws::Side& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:ws.Side.value.SetEnum +inline void value_SetEnum(ws::Side& parent, ws_SideEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:ws.Side.value.ToCstr +const char* value_ToCstr(const ws::Side& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:ws.Side.value.Print +void value_Print(const ws::Side& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:ws.Side.value.SetStrptrMaybe +bool value_SetStrptrMaybe(ws::Side& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:ws.Side.value.SetStrptr +void value_SetStrptr(ws::Side& parent, algo::strptr rhs, ws_SideEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:ws.Side.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(ws::Side& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of ws::Side from an ascii string. +// The format of the string is the format of the ws::Side's only field +// func:ws.Side..ReadStrptrMaybe +bool Side_ReadStrptrMaybe(ws::Side &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.Side..Init +inline void Side_Init(ws::Side& parent); +// print string representation of ROW to string STR +// cfmt:ws.Side.String printfmt:Raw +// func:ws.Side..Print +void Side_Print(ws::Side row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.StatusCode +#pragma pack(push,1) +struct StatusCode { // ws.StatusCode + u16 value; // 0 + // func:ws.StatusCode.value.Cast + inline operator ws_StatusCodeEnum() const __attribute__((nothrow)); + // func:ws.StatusCode..Ctor + inline StatusCode() __attribute__((nothrow)); + // func:ws.StatusCode..FieldwiseCtor + explicit inline StatusCode(u16 in_value) __attribute__((nothrow)); + // func:ws.StatusCode..EnumCtor + inline StatusCode(ws_StatusCodeEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:ws.StatusCode.value.GetEnum +inline ws_StatusCodeEnum value_GetEnum(const ws::StatusCode& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:ws.StatusCode.value.SetEnum +inline void value_SetEnum(ws::StatusCode& parent, ws_StatusCodeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:ws.StatusCode.value.ToCstr +const char* value_ToCstr(const ws::StatusCode& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:ws.StatusCode.value.Print +void value_Print(const ws::StatusCode& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:ws.StatusCode.value.SetStrptrMaybe +bool value_SetStrptrMaybe(ws::StatusCode& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:ws.StatusCode.value.SetStrptr +void value_SetStrptr(ws::StatusCode& parent, algo::strptr rhs, ws_StatusCodeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:ws.StatusCode.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(ws::StatusCode& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of ws::StatusCode from an ascii string. +// The format of the string is the format of the ws::StatusCode's only field +// func:ws.StatusCode..ReadStrptrMaybe +bool StatusCode_ReadStrptrMaybe(ws::StatusCode &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.StatusCode..Init +inline void StatusCode_Init(ws::StatusCode& parent); +// print string representation of ROW to string STR +// cfmt:ws.StatusCode.String printfmt:Raw +// func:ws.StatusCode..Print +void StatusCode_Print(ws::StatusCode row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.CloseMsg +#pragma pack(push,1) +struct CloseMsg { // ws.CloseMsg + u32 type; // 504 + u32 length; // ssizeof(parent) + (0) + algo::RspaceStr50 conn; // + ws::Side side; // + ws::StatusCode code; // + // var-length field ws.CloseMsg.reason starts here. access it with reason_Addr + // func:ws.CloseMsg..Ctor + inline CloseMsg() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:ws.CloseMsg.base.CopyOut +void parent_CopyOut(ws::CloseMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of CloseMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of CloseMsg. +// If not successful, quietly return NULL. +// func:ws.CloseMsg.base.Castdown +inline ws::CloseMsg* CloseMsg_Castdown(ams::MsgHeader &hdr); +// func:ws.CloseMsg.base.Castbase +inline ams::MsgHeader& Castbase(ws::CloseMsg& parent); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ws.CloseMsg.reason.Getary +algo::aryptr reason_Getary(ws::CloseMsg& parent) __attribute__((nothrow)); +// func:ws.CloseMsg.reason.Addr +char* reason_Addr(ws::CloseMsg& parent); +// Return number of elements in varlen field +// func:ws.CloseMsg.reason.N +inline u32 reason_N(const ws::CloseMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:ws.CloseMsg.reason.ReadStrptrMaybe +bool reason_ReadStrptrMaybe(ws::CloseMsg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert reason to a string. +// Array is printed as a regular string. +// func:ws.CloseMsg.reason.Print +void reason_Print(ws::CloseMsg& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:ws.CloseMsg.reason_curs.Reset +inline void CloseMsg_reason_curs_Reset(CloseMsg_reason_curs &curs, ws::CloseMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:ws.CloseMsg.reason_curs.ValidQ +inline bool CloseMsg_reason_curs_ValidQ(CloseMsg_reason_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:ws.CloseMsg.reason_curs.Next +inline void CloseMsg_reason_curs_Next(CloseMsg_reason_curs &curs) __attribute__((nothrow)); +// item access +// func:ws.CloseMsg.reason_curs.Access +inline char& CloseMsg_reason_curs_Access(CloseMsg_reason_curs &curs) __attribute__((nothrow)); +// func:ws.CloseMsg..ReadFieldMaybe +bool CloseMsg_ReadFieldMaybe(ws::CloseMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::CloseMsg from an ascii string. +// The format of the string is an ssim Tuple +// func:ws.CloseMsg..ReadStrptrMaybe +bool CloseMsg_ReadStrptrMaybe(ws::CloseMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:ws.CloseMsg..GetMsgLength +inline i32 GetMsgLength(const ws::CloseMsg& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:ws.CloseMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ws::CloseMsg& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.CloseMsg..Init +inline void CloseMsg_Init(ws::CloseMsg& parent); +// print string representation of ROW to string STR +// cfmt:ws.CloseMsg.String printfmt:Tuple +// func:ws.CloseMsg..Print +void CloseMsg_Print(ws::CloseMsg& row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.ConnectMsg +#pragma pack(push,1) +struct ConnectMsg { // ws.ConnectMsg + u32 type; // 502 + u32 length; // ssizeof(parent) + (0) + algo::RspaceStr50 conn; // + ws::Side side; // + // func:ws.ConnectMsg..Ctor + inline ConnectMsg() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:ws.ConnectMsg.base.CopyOut +void parent_CopyOut(ws::ConnectMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of ConnectMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of ConnectMsg. +// If not successful, quietly return NULL. +// func:ws.ConnectMsg.base.Castdown +inline ws::ConnectMsg* ConnectMsg_Castdown(ams::MsgHeader &hdr); +// func:ws.ConnectMsg.base.Castbase +inline ams::MsgHeader& Castbase(ws::ConnectMsg& parent); + +// func:ws.ConnectMsg..ReadFieldMaybe +bool ConnectMsg_ReadFieldMaybe(ws::ConnectMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ws::ConnectMsg from an ascii string. +// The format of the string is an ssim Tuple +// func:ws.ConnectMsg..ReadStrptrMaybe +bool ConnectMsg_ReadStrptrMaybe(ws::ConnectMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:ws.ConnectMsg..GetMsgLength +inline i32 GetMsgLength(const ws::ConnectMsg& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:ws.ConnectMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ws::ConnectMsg& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.ConnectMsg..Init +inline void ConnectMsg_Init(ws::ConnectMsg& parent); +// print string representation of ROW to string STR +// cfmt:ws.ConnectMsg.String printfmt:Tuple +// func:ws.ConnectMsg..Print +void ConnectMsg_Print(ws::ConnectMsg& row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.Opcode +// create: ws.FrameHeader.opcode (Bitfld) +// create: ws.Frame.opcode (Bitfld) +// create: ws.Frame16.opcode (Bitfld) +// create: ws.Frame64.opcode (Bitfld) +// create: ws.FrameMasked.opcode (Bitfld) +// create: ws.FrameMasked16.opcode (Bitfld) +// create: ws.FrameMasked64.opcode (Bitfld) +#pragma pack(push,1) +struct Opcode { // ws.Opcode + u8 value; // 0 + // func:ws.Opcode..Ctor + inline Opcode() __attribute__((nothrow)); + // func:ws.Opcode..FieldwiseCtor + explicit inline Opcode(u8 in_value) __attribute__((nothrow)); + // func:ws.Opcode..EnumCtor + inline Opcode(ws_OpcodeEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:ws.Opcode.value.GetEnum +inline ws_OpcodeEnum value_GetEnum(const ws::Opcode& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:ws.Opcode.value.SetEnum +inline void value_SetEnum(ws::Opcode& parent, ws_OpcodeEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:ws.Opcode.value.ToCstr +const char* value_ToCstr(const ws::Opcode& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:ws.Opcode.value.Print +void value_Print(const ws::Opcode& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:ws.Opcode.value.SetStrptrMaybe +bool value_SetStrptrMaybe(ws::Opcode& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:ws.Opcode.value.SetStrptr +void value_SetStrptr(ws::Opcode& parent, algo::strptr rhs, ws_OpcodeEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:ws.Opcode.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(ws::Opcode& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of ws::Opcode from an ascii string. +// The format of the string is the format of the ws::Opcode's only field +// func:ws.Opcode..ReadStrptrMaybe +bool Opcode_ReadStrptrMaybe(ws::Opcode &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.Opcode..Init +inline void Opcode_Init(ws::Opcode& parent); +// print string representation of ROW to string STR +// cfmt:ws.Opcode.String printfmt:Raw +// func:ws.Opcode..Print +void Opcode_Print(ws::Opcode row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.DataMsg +#pragma pack(push,1) +struct DataMsg { // ws.DataMsg + u32 type; // 503 + u32 length; // ssizeof(parent) + (0) + algo::RspaceStr50 conn; // + ws::Side side; // + ws::Opcode opcode; // + // var-length field ws.DataMsg.data starts here. access it with data_Addr + // func:ws.DataMsg..Ctor + inline DataMsg() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:ws.DataMsg.base.CopyOut +void parent_CopyOut(ws::DataMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of DataMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of DataMsg. +// If not successful, quietly return NULL. +// func:ws.DataMsg.base.Castdown +inline ws::DataMsg* DataMsg_Castdown(ams::MsgHeader &hdr); +// func:ws.DataMsg.base.Castbase +inline ams::MsgHeader& Castbase(ws::DataMsg& parent); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ws.DataMsg.data.Getary +algo::aryptr data_Getary(ws::DataMsg& parent) __attribute__((nothrow)); +// func:ws.DataMsg.data.Addr +char* data_Addr(ws::DataMsg& parent); +// Return number of elements in varlen field +// func:ws.DataMsg.data.N +inline u32 data_N(const ws::DataMsg& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:ws.DataMsg.data.ReadStrptrMaybe +bool data_ReadStrptrMaybe(ws::DataMsg& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert data to a string. +// Array is printed as a regular string. +// func:ws.DataMsg.data.Print +void data_Print(ws::DataMsg& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:ws.DataMsg.data_curs.Reset +inline void DataMsg_data_curs_Reset(DataMsg_data_curs &curs, ws::DataMsg &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:ws.DataMsg.data_curs.ValidQ +inline bool DataMsg_data_curs_ValidQ(DataMsg_data_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:ws.DataMsg.data_curs.Next +inline void DataMsg_data_curs_Next(DataMsg_data_curs &curs) __attribute__((nothrow)); +// item access +// func:ws.DataMsg.data_curs.Access +inline char& DataMsg_data_curs_Access(DataMsg_data_curs &curs) __attribute__((nothrow)); +// func:ws.DataMsg..ReadFieldMaybe +bool DataMsg_ReadFieldMaybe(ws::DataMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::DataMsg from an ascii string. +// The format of the string is an ssim Tuple +// func:ws.DataMsg..ReadStrptrMaybe +bool DataMsg_ReadStrptrMaybe(ws::DataMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:ws.DataMsg..GetMsgLength +inline i32 GetMsgLength(const ws::DataMsg& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:ws.DataMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ws::DataMsg& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.DataMsg..Init +inline void DataMsg_Init(ws::DataMsg& parent); +// print string representation of ROW to string STR +// cfmt:ws.DataMsg.String printfmt:Tuple +// func:ws.DataMsg..Print +void DataMsg_Print(ws::DataMsg& row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.FieldId +#pragma pack(push,1) +struct FieldId { // ws.FieldId: Field read helper + i32 value; // -1 + // func:ws.FieldId.value.Cast + inline operator ws_FieldIdEnum() const __attribute__((nothrow)); + // func:ws.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:ws.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:ws.FieldId..EnumCtor + inline FieldId(ws_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:ws.FieldId.value.GetEnum +inline ws_FieldIdEnum value_GetEnum(const ws::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:ws.FieldId.value.SetEnum +inline void value_SetEnum(ws::FieldId& parent, ws_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:ws.FieldId.value.ToCstr +const char* value_ToCstr(const ws::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:ws.FieldId.value.Print +void value_Print(const ws::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:ws.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(ws::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:ws.FieldId.value.SetStrptr +void value_SetStrptr(ws::FieldId& parent, algo::strptr rhs, ws_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:ws.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(ws::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of ws::FieldId from an ascii string. +// The format of the string is the format of the ws::FieldId's only field +// func:ws.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(ws::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.FieldId..Init +inline void FieldId_Init(ws::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:ws.FieldId.String printfmt:Raw +// func:ws.FieldId..Print +void FieldId_Print(ws::FieldId& row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.Frame +#pragma pack(push,1) +struct Frame { // ws.Frame + u8 byte0; // 0 + u8 byte1; // 0 + // var-length field ws.Frame.payload starts here. access it with payload_Addr + // func:ws.Frame..Ctor + inline Frame() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:ws.Frame.base.CopyOut +void parent_CopyOut(ws::Frame &row, ws::FrameHeader &out) __attribute__((nothrow)); +// func:ws.Frame.base.Castbase +inline ws::FrameHeader& Castbase(ws::Frame& parent); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +// func:ws.Frame.fin.Get +inline bool fin_Get(const ws::Frame& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +// func:ws.Frame.fin.Set +inline void fin_Set(ws::Frame& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +// func:ws.Frame.rsv1.Get +inline bool rsv1_Get(const ws::Frame& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +// func:ws.Frame.rsv1.Set +inline void rsv1_Set(ws::Frame& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +// func:ws.Frame.rsv2.Get +inline bool rsv2_Get(const ws::Frame& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +// func:ws.Frame.rsv2.Set +inline void rsv2_Set(ws::Frame& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +// func:ws.Frame.rsv3.Get +inline bool rsv3_Get(const ws::Frame& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +// func:ws.Frame.rsv3.Set +inline void rsv3_Set(ws::Frame& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +// func:ws.Frame.opcode.Get +inline ws::Opcode opcode_Get(const ws::Frame& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +// func:ws.Frame.opcode.Set +inline void opcode_Set(ws::Frame& parent, ws::Opcode rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +// func:ws.Frame.mask.Get +inline bool mask_Get(const ws::Frame& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +// func:ws.Frame.mask.Set +inline void mask_Set(ws::Frame& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +// func:ws.Frame.payload_len.Get +inline u8 payload_len_Get(const ws::Frame& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +// func:ws.Frame.payload_len.Set +inline void payload_len_Set(ws::Frame& parent, u8 rhs) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ws.Frame.payload.Getary +algo::aryptr payload_Getary(ws::Frame& parent) __attribute__((nothrow)); +// func:ws.Frame.payload.Addr +char* payload_Addr(ws::Frame& parent); +// Return number of elements in varlen field +// func:ws.Frame.payload.N +// this function is 'extrn' and implemented by user +u32 payload_N(const ws::Frame& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:ws.Frame.payload.ReadStrptrMaybe +bool payload_ReadStrptrMaybe(ws::Frame& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert payload to a string. +// Array is printed as a regular string. +// func:ws.Frame.payload.Print +void payload_Print(ws::Frame& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:ws.Frame..ReadFieldMaybe +bool Frame_ReadFieldMaybe(ws::Frame& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::Frame from an ascii string. +// The format of the string is an ssim Tuple +// func:ws.Frame..ReadStrptrMaybe +bool Frame_ReadStrptrMaybe(ws::Frame &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.Frame..Init +void Frame_Init(ws::Frame& parent); +// print string representation of ROW to string STR +// cfmt:ws.Frame.String printfmt:Tuple +// func:ws.Frame..Print +void Frame_Print(ws::Frame& row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.Frame16 +// access: ws.Frame16_curs.msg (Ptr) +#pragma pack(push,1) +struct Frame16 { // ws.Frame16 + u8 byte0; // 0 + u8 byte1; // 126 + u16 ext_payload_len_be; // ssizeof(parent) + (-4) + // var-length field ws.Frame16.payload starts here. access it with payload_Addr + // func:ws.Frame16..Ctor + inline Frame16() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:ws.Frame16.base.CopyOut +void parent_CopyOut(ws::Frame16 &row, ws::FrameHeader &out) __attribute__((nothrow)); +// Check if ws::FrameHeader is an instance of Frame16 by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Frame16. +// If not successful, quietly return NULL. +// func:ws.Frame16.base.Castdown +inline ws::Frame16* Frame16_Castdown(ws::FrameHeader &hdr); +// func:ws.Frame16.base.Castbase +inline ws::FrameHeader& Castbase(ws::Frame16& parent); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +// func:ws.Frame16.fin.Get +inline bool fin_Get(const ws::Frame16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +// func:ws.Frame16.fin.Set +inline void fin_Set(ws::Frame16& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +// func:ws.Frame16.rsv1.Get +inline bool rsv1_Get(const ws::Frame16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +// func:ws.Frame16.rsv1.Set +inline void rsv1_Set(ws::Frame16& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +// func:ws.Frame16.rsv2.Get +inline bool rsv2_Get(const ws::Frame16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +// func:ws.Frame16.rsv2.Set +inline void rsv2_Set(ws::Frame16& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +// func:ws.Frame16.rsv3.Get +inline bool rsv3_Get(const ws::Frame16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +// func:ws.Frame16.rsv3.Set +inline void rsv3_Set(ws::Frame16& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +// func:ws.Frame16.opcode.Get +inline ws::Opcode opcode_Get(const ws::Frame16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +// func:ws.Frame16.opcode.Set +inline void opcode_Set(ws::Frame16& parent, ws::Opcode rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +// func:ws.Frame16.mask.Get +inline bool mask_Get(const ws::Frame16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +// func:ws.Frame16.mask.Set +inline void mask_Set(ws::Frame16& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +// func:ws.Frame16.payload_len.Get +inline u8 payload_len_Get(const ws::Frame16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +// func:ws.Frame16.payload_len.Set +inline void payload_len_Set(ws::Frame16& parent, u8 rhs) __attribute__((nothrow)); + +// func:ws.Frame16.ext_payload_len.Get +inline u16 ext_payload_len_Get(const ws::Frame16& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:ws.Frame16.ext_payload_len.Set +inline void ext_payload_len_Set(ws::Frame16& parent, u16 rhs) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ws.Frame16.payload.Getary +algo::aryptr payload_Getary(ws::Frame16& parent) __attribute__((nothrow)); +// func:ws.Frame16.payload.Addr +char* payload_Addr(ws::Frame16& parent); +// Return number of elements in varlen field +// func:ws.Frame16.payload.N +inline u32 payload_N(const ws::Frame16& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:ws.Frame16.payload.ReadStrptrMaybe +bool payload_ReadStrptrMaybe(ws::Frame16& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert payload to a string. +// Array is printed as a regular string. +// func:ws.Frame16.payload.Print +void payload_Print(ws::Frame16& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:ws.Frame16.payload_curs.Reset +inline void Frame16_payload_curs_Reset(Frame16_payload_curs &curs, ws::Frame16 &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:ws.Frame16.payload_curs.ValidQ +inline bool Frame16_payload_curs_ValidQ(Frame16_payload_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:ws.Frame16.payload_curs.Next +inline void Frame16_payload_curs_Next(Frame16_payload_curs &curs) __attribute__((nothrow)); +// item access +// func:ws.Frame16.payload_curs.Access +inline char& Frame16_payload_curs_Access(Frame16_payload_curs &curs) __attribute__((nothrow)); +// func:ws.Frame16..ReadFieldMaybe +bool Frame16_ReadFieldMaybe(ws::Frame16& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::Frame16 from an ascii string. +// The format of the string is an ssim Tuple +// func:ws.Frame16..ReadStrptrMaybe +bool Frame16_ReadStrptrMaybe(ws::Frame16 &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:ws.Frame16..GetMsgLength +inline i32 GetMsgLength(const ws::Frame16& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:ws.Frame16..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ws::Frame16& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.Frame16..Init +void Frame16_Init(ws::Frame16& parent); +// print string representation of ROW to string STR +// cfmt:ws.Frame16.String printfmt:Tuple +// func:ws.Frame16..Print +void Frame16_Print(ws::Frame16& row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.Frame16_curs +#pragma pack(push,1) +struct Frame16_curs { // ws.Frame16_curs: Cursor for scanning messages in a memptr + typedef ws::Frame16 *ChildType; + ws::Frame16* msg; // Pointer to current message. optional pointer + u8* bytes; // Beginning of region. optional pointer + i32 limit; // 0 # Of bytes in the region + i32 msglen; // 0 Length of current message (if any) + // func:ws.Frame16_curs..Ctor + inline Frame16_curs() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// func:ws.Frame16_curs..ValidQ +inline bool Frame16_curs_ValidQ(ws::Frame16_curs& curs) __attribute__((nothrow)); +// func:ws.Frame16_curs..Reset +inline void Frame16_curs_Reset(ws::Frame16_curs& curs, algo::memptr buf) __attribute__((nothrow)); +// func:ws.Frame16_curs..Access +inline ws::Frame16*& Frame16_curs_Access(ws::Frame16_curs& curs) __attribute__((nothrow)); +// func:ws.Frame16_curs..Next +inline void Frame16_curs_Next(ws::Frame16_curs& curs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.Frame16_curs..Init +inline void Frame16_curs_Init(ws::Frame16_curs& parent); + +// --- ws.Frame64 +// access: ws.Frame64_curs.msg (Ptr) +#pragma pack(push,1) +struct Frame64 { // ws.Frame64 + u8 byte0; // 0 + u8 byte1; // 127 + u64 ext_payload_len_be; // ssizeof(parent) + (-10) + // var-length field ws.Frame64.payload starts here. access it with payload_Addr + // func:ws.Frame64..Ctor + inline Frame64() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:ws.Frame64.base.CopyOut +void parent_CopyOut(ws::Frame64 &row, ws::FrameHeader &out) __attribute__((nothrow)); +// Check if ws::FrameHeader is an instance of Frame64 by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Frame64. +// If not successful, quietly return NULL. +// func:ws.Frame64.base.Castdown +inline ws::Frame64* Frame64_Castdown(ws::FrameHeader &hdr); +// func:ws.Frame64.base.Castbase +inline ws::FrameHeader& Castbase(ws::Frame64& parent); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +// func:ws.Frame64.fin.Get +inline bool fin_Get(const ws::Frame64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +// func:ws.Frame64.fin.Set +inline void fin_Set(ws::Frame64& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +// func:ws.Frame64.rsv1.Get +inline bool rsv1_Get(const ws::Frame64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +// func:ws.Frame64.rsv1.Set +inline void rsv1_Set(ws::Frame64& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +// func:ws.Frame64.rsv2.Get +inline bool rsv2_Get(const ws::Frame64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +// func:ws.Frame64.rsv2.Set +inline void rsv2_Set(ws::Frame64& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +// func:ws.Frame64.rsv3.Get +inline bool rsv3_Get(const ws::Frame64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +// func:ws.Frame64.rsv3.Set +inline void rsv3_Set(ws::Frame64& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +// func:ws.Frame64.opcode.Get +inline ws::Opcode opcode_Get(const ws::Frame64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +// func:ws.Frame64.opcode.Set +inline void opcode_Set(ws::Frame64& parent, ws::Opcode rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +// func:ws.Frame64.mask.Get +inline bool mask_Get(const ws::Frame64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +// func:ws.Frame64.mask.Set +inline void mask_Set(ws::Frame64& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +// func:ws.Frame64.payload_len.Get +inline u8 payload_len_Get(const ws::Frame64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +// func:ws.Frame64.payload_len.Set +inline void payload_len_Set(ws::Frame64& parent, u8 rhs) __attribute__((nothrow)); + +// func:ws.Frame64.ext_payload_len.Get +inline u64 ext_payload_len_Get(const ws::Frame64& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:ws.Frame64.ext_payload_len.Set +inline void ext_payload_len_Set(ws::Frame64& parent, u64 rhs) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ws.Frame64.payload.Getary +algo::aryptr payload_Getary(ws::Frame64& parent) __attribute__((nothrow)); +// func:ws.Frame64.payload.Addr +char* payload_Addr(ws::Frame64& parent); +// Return number of elements in varlen field +// func:ws.Frame64.payload.N +inline u32 payload_N(const ws::Frame64& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:ws.Frame64.payload.ReadStrptrMaybe +bool payload_ReadStrptrMaybe(ws::Frame64& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert payload to a string. +// Array is printed as a regular string. +// func:ws.Frame64.payload.Print +void payload_Print(ws::Frame64& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:ws.Frame64.payload_curs.Reset +inline void Frame64_payload_curs_Reset(Frame64_payload_curs &curs, ws::Frame64 &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:ws.Frame64.payload_curs.ValidQ +inline bool Frame64_payload_curs_ValidQ(Frame64_payload_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:ws.Frame64.payload_curs.Next +inline void Frame64_payload_curs_Next(Frame64_payload_curs &curs) __attribute__((nothrow)); +// item access +// func:ws.Frame64.payload_curs.Access +inline char& Frame64_payload_curs_Access(Frame64_payload_curs &curs) __attribute__((nothrow)); +// func:ws.Frame64..ReadFieldMaybe +bool Frame64_ReadFieldMaybe(ws::Frame64& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::Frame64 from an ascii string. +// The format of the string is an ssim Tuple +// func:ws.Frame64..ReadStrptrMaybe +bool Frame64_ReadStrptrMaybe(ws::Frame64 &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:ws.Frame64..GetMsgLength +inline i32 GetMsgLength(const ws::Frame64& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:ws.Frame64..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ws::Frame64& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.Frame64..Init +void Frame64_Init(ws::Frame64& parent); +// print string representation of ROW to string STR +// cfmt:ws.Frame64.String printfmt:Tuple +// func:ws.Frame64..Print +void Frame64_Print(ws::Frame64& row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.Frame64_curs +#pragma pack(push,1) +struct Frame64_curs { // ws.Frame64_curs: Cursor for scanning messages in a memptr + typedef ws::Frame64 *ChildType; + ws::Frame64* msg; // Pointer to current message. optional pointer + u8* bytes; // Beginning of region. optional pointer + i32 limit; // 0 # Of bytes in the region + i32 msglen; // 0 Length of current message (if any) + // func:ws.Frame64_curs..Ctor + inline Frame64_curs() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// func:ws.Frame64_curs..ValidQ +inline bool Frame64_curs_ValidQ(ws::Frame64_curs& curs) __attribute__((nothrow)); +// func:ws.Frame64_curs..Reset +inline void Frame64_curs_Reset(ws::Frame64_curs& curs, algo::memptr buf) __attribute__((nothrow)); +// func:ws.Frame64_curs..Access +inline ws::Frame64*& Frame64_curs_Access(ws::Frame64_curs& curs) __attribute__((nothrow)); +// func:ws.Frame64_curs..Next +inline void Frame64_curs_Next(ws::Frame64_curs& curs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.Frame64_curs..Init +inline void Frame64_curs_Init(ws::Frame64_curs& parent); + +// --- ws.FrameHeader +// access: ws.Frame.base (Base) +// access: ws.Frame16.base (Base) +// access: ws.Frame64.base (Base) +// access: ws.FrameMasked.base (Base) +// access: ws.FrameMasked16.base (Base) +// access: ws.FrameMasked64.base (Base) +#pragma pack(push,1) +struct FrameHeader { // ws.FrameHeader + u8 byte0; // 0 + u8 byte1; // 0 + // func:ws.FrameHeader..Ctor + inline FrameHeader() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +// func:ws.FrameHeader.fin.Get +inline bool fin_Get(const ws::FrameHeader& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +// func:ws.FrameHeader.fin.Set +inline void fin_Set(ws::FrameHeader& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +// func:ws.FrameHeader.rsv1.Get +inline bool rsv1_Get(const ws::FrameHeader& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +// func:ws.FrameHeader.rsv1.Set +inline void rsv1_Set(ws::FrameHeader& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +// func:ws.FrameHeader.rsv2.Get +inline bool rsv2_Get(const ws::FrameHeader& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +// func:ws.FrameHeader.rsv2.Set +inline void rsv2_Set(ws::FrameHeader& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +// func:ws.FrameHeader.rsv3.Get +inline bool rsv3_Get(const ws::FrameHeader& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +// func:ws.FrameHeader.rsv3.Set +inline void rsv3_Set(ws::FrameHeader& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +// func:ws.FrameHeader.opcode.Get +inline ws::Opcode opcode_Get(const ws::FrameHeader& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +// func:ws.FrameHeader.opcode.Set +inline void opcode_Set(ws::FrameHeader& parent, ws::Opcode rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +// func:ws.FrameHeader.mask.Get +inline bool mask_Get(const ws::FrameHeader& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +// func:ws.FrameHeader.mask.Set +inline void mask_Set(ws::FrameHeader& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +// func:ws.FrameHeader.payload_len.Get +inline u8 payload_len_Get(const ws::FrameHeader& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +// func:ws.FrameHeader.payload_len.Set +inline void payload_len_Set(ws::FrameHeader& parent, u8 rhs) __attribute__((nothrow)); + +// Set all fields to initial values. +// func:ws.FrameHeader..Init +inline void FrameHeader_Init(ws::FrameHeader& parent); + +// --- ws.FrameHeaderMsgsCase +#pragma pack(push,1) +struct FrameHeaderMsgsCase { // ws.FrameHeaderMsgsCase: Enum for dispatch ws.FrameHeaderMsgs + u32 value; // 0 + // func:ws.FrameHeaderMsgsCase.value.Cast + inline operator ws_FrameHeaderMsgsCaseEnum() const __attribute__((nothrow)); + // func:ws.FrameHeaderMsgsCase..Ctor + inline FrameHeaderMsgsCase() __attribute__((nothrow)); + // func:ws.FrameHeaderMsgsCase..FieldwiseCtor + explicit inline FrameHeaderMsgsCase(u32 in_value) __attribute__((nothrow)); + // func:ws.FrameHeaderMsgsCase..EnumCtor + inline FrameHeaderMsgsCase(ws_FrameHeaderMsgsCaseEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:ws.FrameHeaderMsgsCase.value.GetEnum +inline ws_FrameHeaderMsgsCaseEnum value_GetEnum(const ws::FrameHeaderMsgsCase& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:ws.FrameHeaderMsgsCase.value.SetEnum +inline void value_SetEnum(ws::FrameHeaderMsgsCase& parent, ws_FrameHeaderMsgsCaseEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:ws.FrameHeaderMsgsCase.value.ToCstr +const char* value_ToCstr(const ws::FrameHeaderMsgsCase& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:ws.FrameHeaderMsgsCase.value.Print +void value_Print(const ws::FrameHeaderMsgsCase& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:ws.FrameHeaderMsgsCase.value.SetStrptrMaybe +bool value_SetStrptrMaybe(ws::FrameHeaderMsgsCase& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:ws.FrameHeaderMsgsCase.value.SetStrptr +void value_SetStrptr(ws::FrameHeaderMsgsCase& parent, algo::strptr rhs, ws_FrameHeaderMsgsCaseEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:ws.FrameHeaderMsgsCase.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(ws::FrameHeaderMsgsCase& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of ws::FrameHeaderMsgsCase from an ascii string. +// The format of the string is the format of the ws::FrameHeaderMsgsCase's only field +// func:ws.FrameHeaderMsgsCase..ReadStrptrMaybe +bool FrameHeaderMsgsCase_ReadStrptrMaybe(ws::FrameHeaderMsgsCase &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.FrameHeaderMsgsCase..Init +inline void FrameHeaderMsgsCase_Init(ws::FrameHeaderMsgsCase& parent); + +// --- ws.FrameMasked +#pragma pack(push,1) +struct FrameMasked { // ws.FrameMasked + u8 byte0; // 0 + u8 byte1; // 0 + u32 masking_key; // 0 + // var-length field ws.FrameMasked.payload starts here. access it with payload_Addr + // func:ws.FrameMasked..Ctor + inline FrameMasked() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:ws.FrameMasked.base.CopyOut +void parent_CopyOut(ws::FrameMasked &row, ws::FrameHeader &out) __attribute__((nothrow)); +// func:ws.FrameMasked.base.Castbase +inline ws::FrameHeader& Castbase(ws::FrameMasked& parent); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +// func:ws.FrameMasked.fin.Get +inline bool fin_Get(const ws::FrameMasked& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +// func:ws.FrameMasked.fin.Set +inline void fin_Set(ws::FrameMasked& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +// func:ws.FrameMasked.rsv1.Get +inline bool rsv1_Get(const ws::FrameMasked& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +// func:ws.FrameMasked.rsv1.Set +inline void rsv1_Set(ws::FrameMasked& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +// func:ws.FrameMasked.rsv2.Get +inline bool rsv2_Get(const ws::FrameMasked& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +// func:ws.FrameMasked.rsv2.Set +inline void rsv2_Set(ws::FrameMasked& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +// func:ws.FrameMasked.rsv3.Get +inline bool rsv3_Get(const ws::FrameMasked& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +// func:ws.FrameMasked.rsv3.Set +inline void rsv3_Set(ws::FrameMasked& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +// func:ws.FrameMasked.opcode.Get +inline ws::Opcode opcode_Get(const ws::FrameMasked& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +// func:ws.FrameMasked.opcode.Set +inline void opcode_Set(ws::FrameMasked& parent, ws::Opcode rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +// func:ws.FrameMasked.mask.Get +inline bool mask_Get(const ws::FrameMasked& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +// func:ws.FrameMasked.mask.Set +inline void mask_Set(ws::FrameMasked& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +// func:ws.FrameMasked.payload_len.Get +inline u8 payload_len_Get(const ws::FrameMasked& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +// func:ws.FrameMasked.payload_len.Set +inline void payload_len_Set(ws::FrameMasked& parent, u8 rhs) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ws.FrameMasked.payload.Getary +algo::aryptr payload_Getary(ws::FrameMasked& parent) __attribute__((nothrow)); +// func:ws.FrameMasked.payload.Addr +char* payload_Addr(ws::FrameMasked& parent); +// Return number of elements in varlen field +// func:ws.FrameMasked.payload.N +// this function is 'extrn' and implemented by user +u32 payload_N(const ws::FrameMasked& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:ws.FrameMasked.payload.ReadStrptrMaybe +bool payload_ReadStrptrMaybe(ws::FrameMasked& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert payload to a string. +// Array is printed as a regular string. +// func:ws.FrameMasked.payload.Print +void payload_Print(ws::FrameMasked& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:ws.FrameMasked..ReadFieldMaybe +bool FrameMasked_ReadFieldMaybe(ws::FrameMasked& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::FrameMasked from an ascii string. +// The format of the string is an ssim Tuple +// func:ws.FrameMasked..ReadStrptrMaybe +bool FrameMasked_ReadStrptrMaybe(ws::FrameMasked &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.FrameMasked..Init +void FrameMasked_Init(ws::FrameMasked& parent); +// print string representation of ROW to string STR +// cfmt:ws.FrameMasked.String printfmt:Tuple +// func:ws.FrameMasked..Print +void FrameMasked_Print(ws::FrameMasked& row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.FrameMasked16 +// access: ws.FrameMasked16_curs.msg (Ptr) +#pragma pack(push,1) +struct FrameMasked16 { // ws.FrameMasked16 + u8 byte0; // 0 + u8 byte1; // 254 + u16 ext_payload_len_be; // ssizeof(parent) + (-8) + u32 masking_key; // 0 + // var-length field ws.FrameMasked16.payload starts here. access it with payload_Addr + // func:ws.FrameMasked16..Ctor + inline FrameMasked16() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:ws.FrameMasked16.base.CopyOut +void parent_CopyOut(ws::FrameMasked16 &row, ws::FrameHeader &out) __attribute__((nothrow)); +// Check if ws::FrameHeader is an instance of FrameMasked16 by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of FrameMasked16. +// If not successful, quietly return NULL. +// func:ws.FrameMasked16.base.Castdown +inline ws::FrameMasked16* FrameMasked16_Castdown(ws::FrameHeader &hdr); +// func:ws.FrameMasked16.base.Castbase +inline ws::FrameHeader& Castbase(ws::FrameMasked16& parent); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +// func:ws.FrameMasked16.fin.Get +inline bool fin_Get(const ws::FrameMasked16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +// func:ws.FrameMasked16.fin.Set +inline void fin_Set(ws::FrameMasked16& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +// func:ws.FrameMasked16.rsv1.Get +inline bool rsv1_Get(const ws::FrameMasked16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +// func:ws.FrameMasked16.rsv1.Set +inline void rsv1_Set(ws::FrameMasked16& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +// func:ws.FrameMasked16.rsv2.Get +inline bool rsv2_Get(const ws::FrameMasked16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +// func:ws.FrameMasked16.rsv2.Set +inline void rsv2_Set(ws::FrameMasked16& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +// func:ws.FrameMasked16.rsv3.Get +inline bool rsv3_Get(const ws::FrameMasked16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +// func:ws.FrameMasked16.rsv3.Set +inline void rsv3_Set(ws::FrameMasked16& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +// func:ws.FrameMasked16.opcode.Get +inline ws::Opcode opcode_Get(const ws::FrameMasked16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +// func:ws.FrameMasked16.opcode.Set +inline void opcode_Set(ws::FrameMasked16& parent, ws::Opcode rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +// func:ws.FrameMasked16.mask.Get +inline bool mask_Get(const ws::FrameMasked16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +// func:ws.FrameMasked16.mask.Set +inline void mask_Set(ws::FrameMasked16& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +// func:ws.FrameMasked16.payload_len.Get +inline u8 payload_len_Get(const ws::FrameMasked16& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +// func:ws.FrameMasked16.payload_len.Set +inline void payload_len_Set(ws::FrameMasked16& parent, u8 rhs) __attribute__((nothrow)); + +// func:ws.FrameMasked16.ext_payload_len.Get +inline u16 ext_payload_len_Get(const ws::FrameMasked16& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:ws.FrameMasked16.ext_payload_len.Set +inline void ext_payload_len_Set(ws::FrameMasked16& parent, u16 rhs) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ws.FrameMasked16.payload.Getary +algo::aryptr payload_Getary(ws::FrameMasked16& parent) __attribute__((nothrow)); +// func:ws.FrameMasked16.payload.Addr +char* payload_Addr(ws::FrameMasked16& parent); +// Return number of elements in varlen field +// func:ws.FrameMasked16.payload.N +inline u32 payload_N(const ws::FrameMasked16& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:ws.FrameMasked16.payload.ReadStrptrMaybe +bool payload_ReadStrptrMaybe(ws::FrameMasked16& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert payload to a string. +// Array is printed as a regular string. +// func:ws.FrameMasked16.payload.Print +void payload_Print(ws::FrameMasked16& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:ws.FrameMasked16.payload_curs.Reset +inline void FrameMasked16_payload_curs_Reset(FrameMasked16_payload_curs &curs, ws::FrameMasked16 &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:ws.FrameMasked16.payload_curs.ValidQ +inline bool FrameMasked16_payload_curs_ValidQ(FrameMasked16_payload_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:ws.FrameMasked16.payload_curs.Next +inline void FrameMasked16_payload_curs_Next(FrameMasked16_payload_curs &curs) __attribute__((nothrow)); +// item access +// func:ws.FrameMasked16.payload_curs.Access +inline char& FrameMasked16_payload_curs_Access(FrameMasked16_payload_curs &curs) __attribute__((nothrow)); +// func:ws.FrameMasked16..ReadFieldMaybe +bool FrameMasked16_ReadFieldMaybe(ws::FrameMasked16& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::FrameMasked16 from an ascii string. +// The format of the string is an ssim Tuple +// func:ws.FrameMasked16..ReadStrptrMaybe +bool FrameMasked16_ReadStrptrMaybe(ws::FrameMasked16 &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:ws.FrameMasked16..GetMsgLength +inline i32 GetMsgLength(const ws::FrameMasked16& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:ws.FrameMasked16..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ws::FrameMasked16& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.FrameMasked16..Init +void FrameMasked16_Init(ws::FrameMasked16& parent); +// print string representation of ROW to string STR +// cfmt:ws.FrameMasked16.String printfmt:Tuple +// func:ws.FrameMasked16..Print +void FrameMasked16_Print(ws::FrameMasked16& row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.FrameMasked16_curs +#pragma pack(push,1) +struct FrameMasked16_curs { // ws.FrameMasked16_curs: Cursor for scanning messages in a memptr + typedef ws::FrameMasked16 *ChildType; + ws::FrameMasked16* msg; // Pointer to current message. optional pointer + u8* bytes; // Beginning of region. optional pointer + i32 limit; // 0 # Of bytes in the region + i32 msglen; // 0 Length of current message (if any) + // func:ws.FrameMasked16_curs..Ctor + inline FrameMasked16_curs() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// func:ws.FrameMasked16_curs..ValidQ +inline bool FrameMasked16_curs_ValidQ(ws::FrameMasked16_curs& curs) __attribute__((nothrow)); +// func:ws.FrameMasked16_curs..Reset +inline void FrameMasked16_curs_Reset(ws::FrameMasked16_curs& curs, algo::memptr buf) __attribute__((nothrow)); +// func:ws.FrameMasked16_curs..Access +inline ws::FrameMasked16*& FrameMasked16_curs_Access(ws::FrameMasked16_curs& curs) __attribute__((nothrow)); +// func:ws.FrameMasked16_curs..Next +inline void FrameMasked16_curs_Next(ws::FrameMasked16_curs& curs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.FrameMasked16_curs..Init +inline void FrameMasked16_curs_Init(ws::FrameMasked16_curs& parent); + +// --- ws.FrameMasked64 +// access: ws.FrameMasked64_curs.msg (Ptr) +#pragma pack(push,1) +struct FrameMasked64 { // ws.FrameMasked64 + u8 byte0; // 0 + u8 byte1; // 255 + u64 ext_payload_len_be; // ssizeof(parent) + (-14) + u32 masking_key; // 0 + // var-length field ws.FrameMasked64.payload starts here. access it with payload_Addr + // func:ws.FrameMasked64..Ctor + inline FrameMasked64() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:ws.FrameMasked64.base.CopyOut +void parent_CopyOut(ws::FrameMasked64 &row, ws::FrameHeader &out) __attribute__((nothrow)); +// Check if ws::FrameHeader is an instance of FrameMasked64 by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of FrameMasked64. +// If not successful, quietly return NULL. +// func:ws.FrameMasked64.base.Castdown +inline ws::FrameMasked64* FrameMasked64_Castdown(ws::FrameHeader &hdr); +// func:ws.FrameMasked64.base.Castbase +inline ws::FrameHeader& Castbase(ws::FrameMasked64& parent); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +// func:ws.FrameMasked64.fin.Get +inline bool fin_Get(const ws::FrameMasked64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +// func:ws.FrameMasked64.fin.Set +inline void fin_Set(ws::FrameMasked64& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +// func:ws.FrameMasked64.rsv1.Get +inline bool rsv1_Get(const ws::FrameMasked64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +// func:ws.FrameMasked64.rsv1.Set +inline void rsv1_Set(ws::FrameMasked64& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +// func:ws.FrameMasked64.rsv2.Get +inline bool rsv2_Get(const ws::FrameMasked64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +// func:ws.FrameMasked64.rsv2.Set +inline void rsv2_Set(ws::FrameMasked64& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +// func:ws.FrameMasked64.rsv3.Get +inline bool rsv3_Get(const ws::FrameMasked64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +// func:ws.FrameMasked64.rsv3.Set +inline void rsv3_Set(ws::FrameMasked64& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +// func:ws.FrameMasked64.opcode.Get +inline ws::Opcode opcode_Get(const ws::FrameMasked64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +// func:ws.FrameMasked64.opcode.Set +inline void opcode_Set(ws::FrameMasked64& parent, ws::Opcode rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +// func:ws.FrameMasked64.mask.Get +inline bool mask_Get(const ws::FrameMasked64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +// func:ws.FrameMasked64.mask.Set +inline void mask_Set(ws::FrameMasked64& parent, bool rhs) __attribute__((nothrow)); + +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +// func:ws.FrameMasked64.payload_len.Get +inline u8 payload_len_Get(const ws::FrameMasked64& parent) __attribute__((__warn_unused_result__, nothrow)); +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +// func:ws.FrameMasked64.payload_len.Set +inline void payload_len_Set(ws::FrameMasked64& parent, u8 rhs) __attribute__((nothrow)); + +// func:ws.FrameMasked64.ext_payload_len.Get +inline u64 ext_payload_len_Get(const ws::FrameMasked64& parent) __attribute__((__warn_unused_result__, nothrow)); +// func:ws.FrameMasked64.ext_payload_len.Set +inline void ext_payload_len_Set(ws::FrameMasked64& parent, u64 rhs) __attribute__((nothrow)); + +// Access var-length portion as an aryptr. Length is determined from one of the fields. +// func:ws.FrameMasked64.payload.Getary +algo::aryptr payload_Getary(ws::FrameMasked64& parent) __attribute__((nothrow)); +// func:ws.FrameMasked64.payload.Addr +char* payload_Addr(ws::FrameMasked64& parent); +// Return number of elements in varlen field +// func:ws.FrameMasked64.payload.N +inline u32 payload_N(const ws::FrameMasked64& parent) __attribute__((__warn_unused_result__, nothrow, pure)); +// Convert string to field. Return success value +// func:ws.FrameMasked64.payload.ReadStrptrMaybe +bool payload_ReadStrptrMaybe(ws::FrameMasked64& parent, algo::strptr in_str) __attribute__((nothrow)); +// Convert payload to a string. +// Array is printed as a regular string. +// func:ws.FrameMasked64.payload.Print +void payload_Print(ws::FrameMasked64& parent, algo::cstring &rhs) __attribute__((nothrow)); + +// func:ws.FrameMasked64.payload_curs.Reset +inline void FrameMasked64_payload_curs_Reset(FrameMasked64_payload_curs &curs, ws::FrameMasked64 &parent) __attribute__((nothrow)); +// cursor points to valid item +// func:ws.FrameMasked64.payload_curs.ValidQ +inline bool FrameMasked64_payload_curs_ValidQ(FrameMasked64_payload_curs &curs) __attribute__((nothrow)); +// proceed to next item +// func:ws.FrameMasked64.payload_curs.Next +inline void FrameMasked64_payload_curs_Next(FrameMasked64_payload_curs &curs) __attribute__((nothrow)); +// item access +// func:ws.FrameMasked64.payload_curs.Access +inline char& FrameMasked64_payload_curs_Access(FrameMasked64_payload_curs &curs) __attribute__((nothrow)); +// func:ws.FrameMasked64..ReadFieldMaybe +bool FrameMasked64_ReadFieldMaybe(ws::FrameMasked64& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Any varlen fields are returned in algo_lib::_db.varlenbuf if set +// Read fields of ws::FrameMasked64 from an ascii string. +// The format of the string is an ssim Tuple +// func:ws.FrameMasked64..ReadStrptrMaybe +bool FrameMasked64_ReadStrptrMaybe(ws::FrameMasked64 &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:ws.FrameMasked64..GetMsgLength +inline i32 GetMsgLength(const ws::FrameMasked64& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:ws.FrameMasked64..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ws::FrameMasked64& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.FrameMasked64..Init +void FrameMasked64_Init(ws::FrameMasked64& parent); +// print string representation of ROW to string STR +// cfmt:ws.FrameMasked64.String printfmt:Tuple +// func:ws.FrameMasked64..Print +void FrameMasked64_Print(ws::FrameMasked64& row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.FrameMasked64_curs +#pragma pack(push,1) +struct FrameMasked64_curs { // ws.FrameMasked64_curs: Cursor for scanning messages in a memptr + typedef ws::FrameMasked64 *ChildType; + ws::FrameMasked64* msg; // Pointer to current message. optional pointer + u8* bytes; // Beginning of region. optional pointer + i32 limit; // 0 # Of bytes in the region + i32 msglen; // 0 Length of current message (if any) + // func:ws.FrameMasked64_curs..Ctor + inline FrameMasked64_curs() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// func:ws.FrameMasked64_curs..ValidQ +inline bool FrameMasked64_curs_ValidQ(ws::FrameMasked64_curs& curs) __attribute__((nothrow)); +// func:ws.FrameMasked64_curs..Reset +inline void FrameMasked64_curs_Reset(ws::FrameMasked64_curs& curs, algo::memptr buf) __attribute__((nothrow)); +// func:ws.FrameMasked64_curs..Access +inline ws::FrameMasked64*& FrameMasked64_curs_Access(ws::FrameMasked64_curs& curs) __attribute__((nothrow)); +// func:ws.FrameMasked64_curs..Next +inline void FrameMasked64_curs_Next(ws::FrameMasked64_curs& curs) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.FrameMasked64_curs..Init +inline void FrameMasked64_curs_Init(ws::FrameMasked64_curs& parent); + +// --- ws.HttpState +#pragma pack(push,1) +struct HttpState { // ws.HttpState + u8 value; // 0 + // func:ws.HttpState..Ctor + inline HttpState() __attribute__((nothrow)); + // func:ws.HttpState..FieldwiseCtor + explicit inline HttpState(u8 in_value) __attribute__((nothrow)); + // func:ws.HttpState..EnumCtor + inline HttpState(ws_HttpStateEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:ws.HttpState.value.GetEnum +inline ws_HttpStateEnum value_GetEnum(const ws::HttpState& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:ws.HttpState.value.SetEnum +inline void value_SetEnum(ws::HttpState& parent, ws_HttpStateEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:ws.HttpState.value.ToCstr +const char* value_ToCstr(const ws::HttpState& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:ws.HttpState.value.Print +void value_Print(const ws::HttpState& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:ws.HttpState.value.SetStrptrMaybe +bool value_SetStrptrMaybe(ws::HttpState& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:ws.HttpState.value.SetStrptr +void value_SetStrptr(ws::HttpState& parent, algo::strptr rhs, ws_HttpStateEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:ws.HttpState.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(ws::HttpState& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of ws::HttpState from an ascii string. +// The format of the string is the format of the ws::HttpState's only field +// func:ws.HttpState..ReadStrptrMaybe +bool HttpState_ReadStrptrMaybe(ws::HttpState &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.HttpState..Init +inline void HttpState_Init(ws::HttpState& parent); +// print string representation of ROW to string STR +// cfmt:ws.HttpState.String printfmt:Raw +// func:ws.HttpState..Print +void HttpState_Print(ws::HttpState row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.ServerStartMsg +#pragma pack(push,1) +struct ServerStartMsg { // ws.ServerStartMsg + u32 type; // 500 + u32 length; // ssizeof(parent) + (0) + algo::RspaceStr25 server; // + // func:ws.ServerStartMsg..Ctor + inline ServerStartMsg() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:ws.ServerStartMsg.base.CopyOut +void parent_CopyOut(ws::ServerStartMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of ServerStartMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of ServerStartMsg. +// If not successful, quietly return NULL. +// func:ws.ServerStartMsg.base.Castdown +inline ws::ServerStartMsg* ServerStartMsg_Castdown(ams::MsgHeader &hdr); +// func:ws.ServerStartMsg.base.Castbase +inline ams::MsgHeader& Castbase(ws::ServerStartMsg& parent); + +// func:ws.ServerStartMsg..ReadFieldMaybe +bool ServerStartMsg_ReadFieldMaybe(ws::ServerStartMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ws::ServerStartMsg from an ascii string. +// The format of the string is an ssim Tuple +// func:ws.ServerStartMsg..ReadStrptrMaybe +bool ServerStartMsg_ReadStrptrMaybe(ws::ServerStartMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:ws.ServerStartMsg..GetMsgLength +inline i32 GetMsgLength(const ws::ServerStartMsg& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:ws.ServerStartMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ws::ServerStartMsg& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.ServerStartMsg..Init +inline void ServerStartMsg_Init(ws::ServerStartMsg& parent); +// print string representation of ROW to string STR +// cfmt:ws.ServerStartMsg.String printfmt:Tuple +// func:ws.ServerStartMsg..Print +void ServerStartMsg_Print(ws::ServerStartMsg& row, algo::cstring& str) __attribute__((nothrow)); + +// --- ws.ServerStopMsg +#pragma pack(push,1) +struct ServerStopMsg { // ws.ServerStopMsg + u32 type; // 501 + u32 length; // ssizeof(parent) + (0) + algo::RspaceStr25 server; // + // func:ws.ServerStopMsg..Ctor + inline ServerStopMsg() __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Copy fields out of row +// func:ws.ServerStopMsg.base.CopyOut +void parent_CopyOut(ws::ServerStopMsg &row, ams::MsgHeader &out) __attribute__((nothrow)); +// Check if ams::MsgHeader is an instance of ServerStopMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of ServerStopMsg. +// If not successful, quietly return NULL. +// func:ws.ServerStopMsg.base.Castdown +inline ws::ServerStopMsg* ServerStopMsg_Castdown(ams::MsgHeader &hdr); +// func:ws.ServerStopMsg.base.Castbase +inline ams::MsgHeader& Castbase(ws::ServerStopMsg& parent); + +// func:ws.ServerStopMsg..ReadFieldMaybe +bool ServerStopMsg_ReadFieldMaybe(ws::ServerStopMsg& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of ws::ServerStopMsg from an ascii string. +// The format of the string is an ssim Tuple +// func:ws.ServerStopMsg..ReadStrptrMaybe +bool ServerStopMsg_ReadStrptrMaybe(ws::ServerStopMsg &parent, algo::strptr in_str) __attribute__((nothrow)); +// Message length (uses length field) +// func:ws.ServerStopMsg..GetMsgLength +inline i32 GetMsgLength(const ws::ServerStopMsg& parent) __attribute__((nothrow)); +// Memptr encompassing the message (uses length field) +// func:ws.ServerStopMsg..GetMsgMemptr +inline algo::memptr GetMsgMemptr(const ws::ServerStopMsg& row) __attribute__((nothrow)); +// Set all fields to initial values. +// func:ws.ServerStopMsg..Init +inline void ServerStopMsg_Init(ws::ServerStopMsg& parent); +// print string representation of ROW to string STR +// cfmt:ws.ServerStopMsg.String printfmt:Tuple +// func:ws.ServerStopMsg..Print +void ServerStopMsg_Print(ws::ServerStopMsg& row, algo::cstring& str) __attribute__((nothrow)); +} // gen:ns_print_struct +namespace ws { // gen:ns_curstext + +struct CloseMsg_reason_curs {// cursor + typedef char ChildType; + u8 *ptr; + int length; + int index; + CloseMsg_reason_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct DataMsg_data_curs {// cursor + typedef char ChildType; + u8 *ptr; + int length; + int index; + DataMsg_data_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct Frame16_payload_curs {// cursor + typedef char ChildType; + u8 *ptr; + int length; + int index; + Frame16_payload_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct Frame64_payload_curs {// cursor + typedef char ChildType; + u8 *ptr; + int length; + int index; + Frame64_payload_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct FrameMasked16_payload_curs {// cursor + typedef char ChildType; + u8 *ptr; + int length; + int index; + FrameMasked16_payload_curs() { ptr=NULL; length=0; index=0; } +}; + + +struct FrameMasked64_payload_curs {// cursor + typedef char ChildType; + u8 *ptr; + int length; + int index; + FrameMasked64_payload_curs() { ptr=NULL; length=0; index=0; } +}; + +} // gen:ns_curstext +namespace ws { // gen:ns_func +// func:ws...StaticCheck +void StaticCheck(); +// Print message to STR. If message is too short for MSG_LEN, print nothing. +// MSG.LENGTH must have already been validated against msg_len. +// This function will additionally validate that sizeof(Msg) <= msg_len +// func:ws.FrameHeaderMsgs..Print +bool FrameHeaderMsgs_Print(algo::cstring &str, ws::FrameHeader &msg, u32 msg_len); +// Parse ascii representation of message into binary, appending new data to BUF. +// func:ws.FrameHeaderMsgs..ReadStrptr +ws::FrameHeaderMsgsCase FrameHeaderMsgs_ReadStrptr(algo::strptr str, algo::ByteAry &buf); +// Parse ascii representation of message into binary, appending new data to BUF. +// func:ws.FrameHeaderMsgs..ReadStrptrMaybe +bool FrameHeaderMsgs_ReadStrptrMaybe(algo::strptr str, algo::ByteAry &buf); +} // gen:ns_func +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const ws::Side &row);// cfmt:ws.Side.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::StatusCode &row);// cfmt:ws.StatusCode.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::CloseMsg &row);// cfmt:ws.CloseMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::ConnectMsg &row);// cfmt:ws.ConnectMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::Opcode &row);// cfmt:ws.Opcode.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::DataMsg &row);// cfmt:ws.DataMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::FieldId &row);// cfmt:ws.FieldId.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::Frame &row);// cfmt:ws.Frame.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::Frame16 &row);// cfmt:ws.Frame16.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::Frame64 &row);// cfmt:ws.Frame64.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::FrameMasked &row);// cfmt:ws.FrameMasked.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::FrameMasked16 &row);// cfmt:ws.FrameMasked16.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::FrameMasked64 &row);// cfmt:ws.FrameMasked64.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::HttpState &row);// cfmt:ws.HttpState.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::ServerStartMsg &row);// cfmt:ws.ServerStartMsg.String +inline algo::cstring &operator <<(algo::cstring &str, const ws::ServerStopMsg &row);// cfmt:ws.ServerStopMsg.String +} diff --git a/include/gen/ws_gen.inl.h b/include/gen/ws_gen.inl.h new file mode 100644 index 00000000..5f18b1b3 --- /dev/null +++ b/include/gen/ws_gen.inl.h @@ -0,0 +1,1974 @@ +// +// include/gen/ws_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/ams_gen.inl.h" +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude + +// --- ws.Side.value.GetEnum +// Get value of field as enum type +inline ws_SideEnum ws::value_GetEnum(const ws::Side& parent) { + return ws_SideEnum(parent.value); +} + +// --- ws.Side.value.SetEnum +// Set value of field from enum type. +inline void ws::value_SetEnum(ws::Side& parent, ws_SideEnum rhs) { + parent.value = char(rhs); +} + +// --- ws.Side.value.Cast +inline ws::Side::operator ws_SideEnum() const { + return ws_SideEnum((*this).value); +} + +// --- ws.Side..Init +// Set all fields to initial values. +inline void ws::Side_Init(ws::Side& parent) { + parent.value = char(0); +} + +// --- ws.Side..Ctor +inline ws::Side::Side() { + ws::Side_Init(*this); +} + +// --- ws.Side..FieldwiseCtor +inline ws::Side::Side(char in_value) + : value(in_value) + { +} + +// --- ws.Side..EnumCtor +inline ws::Side::Side(ws_SideEnum arg) { + this->value = char(arg); +} + +// --- ws.StatusCode.value.GetEnum +// Get value of field as enum type +inline ws_StatusCodeEnum ws::value_GetEnum(const ws::StatusCode& parent) { + return ws_StatusCodeEnum(parent.value); +} + +// --- ws.StatusCode.value.SetEnum +// Set value of field from enum type. +inline void ws::value_SetEnum(ws::StatusCode& parent, ws_StatusCodeEnum rhs) { + parent.value = u16(rhs); +} + +// --- ws.StatusCode.value.Cast +inline ws::StatusCode::operator ws_StatusCodeEnum() const { + return ws_StatusCodeEnum((*this).value); +} + +// --- ws.StatusCode..Init +// Set all fields to initial values. +inline void ws::StatusCode_Init(ws::StatusCode& parent) { + parent.value = u16(0); +} + +// --- ws.StatusCode..Ctor +inline ws::StatusCode::StatusCode() { + ws::StatusCode_Init(*this); +} + +// --- ws.StatusCode..FieldwiseCtor +inline ws::StatusCode::StatusCode(u16 in_value) + : value(in_value) + { +} + +// --- ws.StatusCode..EnumCtor +inline ws::StatusCode::StatusCode(ws_StatusCodeEnum arg) { + this->value = u16(arg); +} + +// --- ws.CloseMsg.base.Castdown +// Check if ams::MsgHeader is an instance of CloseMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of CloseMsg. +// If not successful, quietly return NULL. +inline ws::CloseMsg* ws::CloseMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (504); + cond &= i32(hdr.length) >= ssizeof(ws::CloseMsg); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- ws.CloseMsg.base.Castbase +inline ams::MsgHeader& ws::Castbase(ws::CloseMsg& parent) { + return reinterpret_cast(parent); +} + +// --- ws.CloseMsg.reason.N +// Return number of elements in varlen field +inline u32 ws::reason_N(const ws::CloseMsg& parent) { + u32 length = i32(((ws::CloseMsg&)parent).length); + u32 extra_bytes = u32_Max(length,sizeof(ws::CloseMsg)) - sizeof(ws::CloseMsg); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(char)); +} + +// --- ws.CloseMsg.reason_curs.Reset +inline void ws::CloseMsg_reason_curs_Reset(CloseMsg_reason_curs &curs, ws::CloseMsg &parent) { + curs.ptr = (u8*)reason_Addr(parent); + curs.length = i32(parent.length) - sizeof(ws::CloseMsg); + curs.index = 0; +} + +// --- ws.CloseMsg.reason_curs.ValidQ +// cursor points to valid item +inline bool ws::CloseMsg_reason_curs_ValidQ(CloseMsg_reason_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- ws.CloseMsg.reason_curs.Next +// proceed to next item +inline void ws::CloseMsg_reason_curs_Next(CloseMsg_reason_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- ws.CloseMsg.reason_curs.Access +// item access +inline char& ws::CloseMsg_reason_curs_Access(CloseMsg_reason_curs &curs) { + return *(char*)curs.ptr; +} + +// --- ws.CloseMsg..GetMsgLength +// Message length (uses length field) +inline i32 ws::GetMsgLength(const ws::CloseMsg& parent) { + return i32(const_cast(parent).length); +} + +// --- ws.CloseMsg..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr ws::GetMsgMemptr(const ws::CloseMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); +} + +// --- ws.CloseMsg..Init +// Set all fields to initial values. +inline void ws::CloseMsg_Init(ws::CloseMsg& parent) { + parent.type = u32(504); + parent.length = u32(ssizeof(parent) + (0)); +} + +// --- ws.CloseMsg..Ctor +inline ws::CloseMsg::CloseMsg() { + ws::CloseMsg_Init(*this); +} + +// --- ws.ConnectMsg.base.Castdown +// Check if ams::MsgHeader is an instance of ConnectMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of ConnectMsg. +// If not successful, quietly return NULL. +inline ws::ConnectMsg* ws::ConnectMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (502); + cond &= i32(hdr.length) >= ssizeof(ws::ConnectMsg); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- ws.ConnectMsg.base.Castbase +inline ams::MsgHeader& ws::Castbase(ws::ConnectMsg& parent) { + return reinterpret_cast(parent); +} + +// --- ws.ConnectMsg..GetMsgLength +// Message length (uses length field) +inline i32 ws::GetMsgLength(const ws::ConnectMsg& parent) { + return i32(const_cast(parent).length); +} + +// --- ws.ConnectMsg..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr ws::GetMsgMemptr(const ws::ConnectMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); +} + +// --- ws.ConnectMsg..Init +// Set all fields to initial values. +inline void ws::ConnectMsg_Init(ws::ConnectMsg& parent) { + parent.type = u32(502); + parent.length = u32(ssizeof(parent) + (0)); +} + +// --- ws.ConnectMsg..Ctor +inline ws::ConnectMsg::ConnectMsg() { + ws::ConnectMsg_Init(*this); +} + +// --- ws.Opcode.value.GetEnum +// Get value of field as enum type +inline ws_OpcodeEnum ws::value_GetEnum(const ws::Opcode& parent) { + return ws_OpcodeEnum(parent.value); +} + +// --- ws.Opcode.value.SetEnum +// Set value of field from enum type. +inline void ws::value_SetEnum(ws::Opcode& parent, ws_OpcodeEnum rhs) { + parent.value = u8(rhs); +} + +// --- ws.Opcode..Init +// Set all fields to initial values. +inline void ws::Opcode_Init(ws::Opcode& parent) { + parent.value = u8(0); +} + +// --- ws.Opcode..Ctor +inline ws::Opcode::Opcode() { + ws::Opcode_Init(*this); +} + +// --- ws.Opcode..FieldwiseCtor +inline ws::Opcode::Opcode(u8 in_value) + : value(in_value) + { +} + +// --- ws.Opcode..EnumCtor +inline ws::Opcode::Opcode(ws_OpcodeEnum arg) { + this->value = u8(arg); +} + +// --- ws.DataMsg.base.Castdown +// Check if ams::MsgHeader is an instance of DataMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of DataMsg. +// If not successful, quietly return NULL. +inline ws::DataMsg* ws::DataMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (503); + cond &= i32(hdr.length) >= ssizeof(ws::DataMsg); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- ws.DataMsg.base.Castbase +inline ams::MsgHeader& ws::Castbase(ws::DataMsg& parent) { + return reinterpret_cast(parent); +} + +// --- ws.DataMsg.data.N +// Return number of elements in varlen field +inline u32 ws::data_N(const ws::DataMsg& parent) { + u32 length = i32(((ws::DataMsg&)parent).length); + u32 extra_bytes = u32_Max(length,sizeof(ws::DataMsg)) - sizeof(ws::DataMsg); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(char)); +} + +// --- ws.DataMsg.data_curs.Reset +inline void ws::DataMsg_data_curs_Reset(DataMsg_data_curs &curs, ws::DataMsg &parent) { + curs.ptr = (u8*)data_Addr(parent); + curs.length = i32(parent.length) - sizeof(ws::DataMsg); + curs.index = 0; +} + +// --- ws.DataMsg.data_curs.ValidQ +// cursor points to valid item +inline bool ws::DataMsg_data_curs_ValidQ(DataMsg_data_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- ws.DataMsg.data_curs.Next +// proceed to next item +inline void ws::DataMsg_data_curs_Next(DataMsg_data_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- ws.DataMsg.data_curs.Access +// item access +inline char& ws::DataMsg_data_curs_Access(DataMsg_data_curs &curs) { + return *(char*)curs.ptr; +} + +// --- ws.DataMsg..GetMsgLength +// Message length (uses length field) +inline i32 ws::GetMsgLength(const ws::DataMsg& parent) { + return i32(const_cast(parent).length); +} + +// --- ws.DataMsg..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr ws::GetMsgMemptr(const ws::DataMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); +} + +// --- ws.DataMsg..Init +// Set all fields to initial values. +inline void ws::DataMsg_Init(ws::DataMsg& parent) { + parent.type = u32(503); + parent.length = u32(ssizeof(parent) + (0)); +} + +// --- ws.DataMsg..Ctor +inline ws::DataMsg::DataMsg() { + ws::DataMsg_Init(*this); +} + +// --- ws.FieldId.value.GetEnum +// Get value of field as enum type +inline ws_FieldIdEnum ws::value_GetEnum(const ws::FieldId& parent) { + return ws_FieldIdEnum(parent.value); +} + +// --- ws.FieldId.value.SetEnum +// Set value of field from enum type. +inline void ws::value_SetEnum(ws::FieldId& parent, ws_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- ws.FieldId.value.Cast +inline ws::FieldId::operator ws_FieldIdEnum() const { + return ws_FieldIdEnum((*this).value); +} + +// --- ws.FieldId..Init +// Set all fields to initial values. +inline void ws::FieldId_Init(ws::FieldId& parent) { + parent.value = i32(-1); +} + +// --- ws.FieldId..Ctor +inline ws::FieldId::FieldId() { + ws::FieldId_Init(*this); +} + +// --- ws.FieldId..FieldwiseCtor +inline ws::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- ws.FieldId..EnumCtor +inline ws::FieldId::FieldId(ws_FieldIdEnum arg) { + this->value = i32(arg); +} + +// --- ws.Frame.base.Castbase +inline ws::FrameHeader& ws::Castbase(ws::Frame& parent) { + return reinterpret_cast(parent); +} + +// --- ws.Frame.fin.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +inline bool ws::fin_Get(const ws::Frame& parent) { + return bool((parent.byte0 >> 7) & 0x01); +} + +// --- ws.Frame.fin.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +inline void ws::fin_Set(ws::Frame& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame.rsv1.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +inline bool ws::rsv1_Get(const ws::Frame& parent) { + return bool((parent.byte0 >> 6) & 0x01); +} + +// --- ws.Frame.rsv1.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +inline void ws::rsv1_Set(ws::Frame& parent, bool rhs) { + u8 t1 = u8(0x01) << 6; + u8 t2 = (u8(rhs) & 0x01) << 6; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame.rsv2.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +inline bool ws::rsv2_Get(const ws::Frame& parent) { + return bool((parent.byte0 >> 5) & 0x01); +} + +// --- ws.Frame.rsv2.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +inline void ws::rsv2_Set(ws::Frame& parent, bool rhs) { + u8 t1 = u8(0x01) << 5; + u8 t2 = (u8(rhs) & 0x01) << 5; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame.rsv3.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +inline bool ws::rsv3_Get(const ws::Frame& parent) { + return bool((parent.byte0 >> 4) & 0x01); +} + +// --- ws.Frame.rsv3.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +inline void ws::rsv3_Set(ws::Frame& parent, bool rhs) { + u8 t1 = u8(0x01) << 4; + u8 t2 = (u8(rhs) & 0x01) << 4; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame.opcode.Get +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +inline ws::Opcode ws::opcode_Get(const ws::Frame& parent) { + return ws::Opcode((parent.byte0 >> 0) & 0x0f); +} + +// --- ws.Frame.opcode.Set +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +inline void ws::opcode_Set(ws::Frame& parent, ws::Opcode rhs) { + u8 t1 = u8(0x0f) << 0; + u8 t2 = (u8(rhs.value) & 0x0f) << 0; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame.mask.Get +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +inline bool ws::mask_Get(const ws::Frame& parent) { + return bool((parent.byte1 >> 7) & 0x01); +} + +// --- ws.Frame.mask.Set +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +inline void ws::mask_Set(ws::Frame& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.Frame.payload_len.Get +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +inline u8 ws::payload_len_Get(const ws::Frame& parent) { + return u8((parent.byte1 >> 0) & 0x7f); +} + +// --- ws.Frame.payload_len.Set +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +inline void ws::payload_len_Set(ws::Frame& parent, u8 rhs) { + u8 t1 = u8(0x7f) << 0; + u8 t2 = (u8(rhs) & 0x7f) << 0; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.Frame..Ctor +inline ws::Frame::Frame() { + ws::Frame_Init(*this); +} + +// --- ws.Frame16.base.Castdown +// Check if ws::FrameHeader is an instance of Frame16 by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Frame16. +// If not successful, quietly return NULL. +inline ws::Frame16* ws::Frame16_Castdown(ws::FrameHeader &hdr) { + bool cond = hdr.byte1 == (126); + cond &= i32(sizeof(ws::FrameHeader)) >= ssizeof(ws::Frame16); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- ws.Frame16.base.Castbase +inline ws::FrameHeader& ws::Castbase(ws::Frame16& parent) { + return reinterpret_cast(parent); +} + +// --- ws.Frame16.fin.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +inline bool ws::fin_Get(const ws::Frame16& parent) { + return bool((parent.byte0 >> 7) & 0x01); +} + +// --- ws.Frame16.fin.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +inline void ws::fin_Set(ws::Frame16& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame16.rsv1.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +inline bool ws::rsv1_Get(const ws::Frame16& parent) { + return bool((parent.byte0 >> 6) & 0x01); +} + +// --- ws.Frame16.rsv1.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +inline void ws::rsv1_Set(ws::Frame16& parent, bool rhs) { + u8 t1 = u8(0x01) << 6; + u8 t2 = (u8(rhs) & 0x01) << 6; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame16.rsv2.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +inline bool ws::rsv2_Get(const ws::Frame16& parent) { + return bool((parent.byte0 >> 5) & 0x01); +} + +// --- ws.Frame16.rsv2.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +inline void ws::rsv2_Set(ws::Frame16& parent, bool rhs) { + u8 t1 = u8(0x01) << 5; + u8 t2 = (u8(rhs) & 0x01) << 5; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame16.rsv3.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +inline bool ws::rsv3_Get(const ws::Frame16& parent) { + return bool((parent.byte0 >> 4) & 0x01); +} + +// --- ws.Frame16.rsv3.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +inline void ws::rsv3_Set(ws::Frame16& parent, bool rhs) { + u8 t1 = u8(0x01) << 4; + u8 t2 = (u8(rhs) & 0x01) << 4; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame16.opcode.Get +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +inline ws::Opcode ws::opcode_Get(const ws::Frame16& parent) { + return ws::Opcode((parent.byte0 >> 0) & 0x0f); +} + +// --- ws.Frame16.opcode.Set +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +inline void ws::opcode_Set(ws::Frame16& parent, ws::Opcode rhs) { + u8 t1 = u8(0x0f) << 0; + u8 t2 = (u8(rhs.value) & 0x0f) << 0; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame16.mask.Get +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +inline bool ws::mask_Get(const ws::Frame16& parent) { + return bool((parent.byte1 >> 7) & 0x01); +} + +// --- ws.Frame16.mask.Set +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +inline void ws::mask_Set(ws::Frame16& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.Frame16.payload_len.Get +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +inline u8 ws::payload_len_Get(const ws::Frame16& parent) { + return u8((parent.byte1 >> 0) & 0x7f); +} + +// --- ws.Frame16.payload_len.Set +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +inline void ws::payload_len_Set(ws::Frame16& parent, u8 rhs) { + u8 t1 = u8(0x7f) << 0; + u8 t2 = (u8(rhs) & 0x7f) << 0; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.Frame16.ext_payload_len.Get +inline u16 ws::ext_payload_len_Get(const ws::Frame16& parent) { + return be16toh(parent.ext_payload_len_be); // read big-endian value from memory +} + +// --- ws.Frame16.ext_payload_len.Set +inline void ws::ext_payload_len_Set(ws::Frame16& parent, u16 rhs) { + parent.ext_payload_len_be = htobe16(rhs); // write big-endian value to memory +} + +// --- ws.Frame16.payload.N +// Return number of elements in varlen field +inline u32 ws::payload_N(const ws::Frame16& parent) { + u32 length = i32(ext_payload_len_Get(((ws::Frame16&)parent)) + 4); + u32 extra_bytes = u32_Max(length,sizeof(ws::Frame16)) - sizeof(ws::Frame16); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(char)); +} + +// --- ws.Frame16.payload_curs.Reset +inline void ws::Frame16_payload_curs_Reset(Frame16_payload_curs &curs, ws::Frame16 &parent) { + curs.ptr = (u8*)payload_Addr(parent); + curs.length = i32(ext_payload_len_Get(parent) + 4) - sizeof(ws::Frame16); + curs.index = 0; +} + +// --- ws.Frame16.payload_curs.ValidQ +// cursor points to valid item +inline bool ws::Frame16_payload_curs_ValidQ(Frame16_payload_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- ws.Frame16.payload_curs.Next +// proceed to next item +inline void ws::Frame16_payload_curs_Next(Frame16_payload_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- ws.Frame16.payload_curs.Access +// item access +inline char& ws::Frame16_payload_curs_Access(Frame16_payload_curs &curs) { + return *(char*)curs.ptr; +} + +// --- ws.Frame16..GetMsgLength +// Message length (uses length field) +inline i32 ws::GetMsgLength(const ws::Frame16& parent) { + return i32(ext_payload_len_Get(const_cast(parent)) + 4); +} + +// --- ws.Frame16..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr ws::GetMsgMemptr(const ws::Frame16& row) { + return algo::memptr((u8*)&row, i32(ext_payload_len_Get(const_cast(row)) + 4)); +} + +// --- ws.Frame16..Ctor +inline ws::Frame16::Frame16() { + ws::Frame16_Init(*this); +} + +// --- ws.Frame16_curs..ValidQ +inline bool ws::Frame16_curs_ValidQ(ws::Frame16_curs& curs) { + return curs.msg != NULL; +} + +// --- ws.Frame16_curs..Reset +inline void ws::Frame16_curs_Reset(ws::Frame16_curs& curs, algo::memptr buf) { + curs.bytes = buf.elems; + curs.limit = buf.n_elems; + ws::Frame16 *msg = NULL; + int msglen = 0; + if (curs.limit >= ssizeof(ws::Frame16)) { + ws::Frame16 *ptr = (ws::Frame16*)curs.bytes; + msglen = i32(ext_payload_len_Get((*ptr)) + 4); + if (msglen >= ssizeof(ws::Frame16) && curs.limit >= msglen) { + msg = ptr; + } + } + curs.msg = msg; + curs.msglen = msglen; +} + +// --- ws.Frame16_curs..Access +inline ws::Frame16*& ws::Frame16_curs_Access(ws::Frame16_curs& curs) { + return curs.msg; +} + +// --- ws.Frame16_curs..Next +inline void ws::Frame16_curs_Next(ws::Frame16_curs& curs) { + curs.bytes += curs.msglen; + curs.limit -= curs.msglen; + ws::Frame16 *msg = NULL; + int msglen = 0; + if (curs.limit >= ssizeof(ws::Frame16)) { + ws::Frame16 *ptr = (ws::Frame16*)curs.bytes; + msglen = i32(ext_payload_len_Get((*ptr)) + 4); + if (msglen >= ssizeof(ws::Frame16) && curs.limit >= msglen) { + msg = ptr; + } + } + curs.msg = msg; + curs.msglen = msglen; +} + +// --- ws.Frame16_curs..Init +// Set all fields to initial values. +inline void ws::Frame16_curs_Init(ws::Frame16_curs& parent) { + parent.msg = NULL; + parent.bytes = NULL; + parent.limit = i32(0); + parent.msglen = i32(0); +} + +// --- ws.Frame16_curs..Ctor +inline ws::Frame16_curs::Frame16_curs() { + ws::Frame16_curs_Init(*this); +} + +// --- ws.Frame64.base.Castdown +// Check if ws::FrameHeader is an instance of Frame64 by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of Frame64. +// If not successful, quietly return NULL. +inline ws::Frame64* ws::Frame64_Castdown(ws::FrameHeader &hdr) { + bool cond = hdr.byte1 == (127); + cond &= i32(sizeof(ws::FrameHeader)) >= ssizeof(ws::Frame64); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- ws.Frame64.base.Castbase +inline ws::FrameHeader& ws::Castbase(ws::Frame64& parent) { + return reinterpret_cast(parent); +} + +// --- ws.Frame64.fin.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +inline bool ws::fin_Get(const ws::Frame64& parent) { + return bool((parent.byte0 >> 7) & 0x01); +} + +// --- ws.Frame64.fin.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +inline void ws::fin_Set(ws::Frame64& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame64.rsv1.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +inline bool ws::rsv1_Get(const ws::Frame64& parent) { + return bool((parent.byte0 >> 6) & 0x01); +} + +// --- ws.Frame64.rsv1.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +inline void ws::rsv1_Set(ws::Frame64& parent, bool rhs) { + u8 t1 = u8(0x01) << 6; + u8 t2 = (u8(rhs) & 0x01) << 6; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame64.rsv2.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +inline bool ws::rsv2_Get(const ws::Frame64& parent) { + return bool((parent.byte0 >> 5) & 0x01); +} + +// --- ws.Frame64.rsv2.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +inline void ws::rsv2_Set(ws::Frame64& parent, bool rhs) { + u8 t1 = u8(0x01) << 5; + u8 t2 = (u8(rhs) & 0x01) << 5; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame64.rsv3.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +inline bool ws::rsv3_Get(const ws::Frame64& parent) { + return bool((parent.byte0 >> 4) & 0x01); +} + +// --- ws.Frame64.rsv3.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +inline void ws::rsv3_Set(ws::Frame64& parent, bool rhs) { + u8 t1 = u8(0x01) << 4; + u8 t2 = (u8(rhs) & 0x01) << 4; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame64.opcode.Get +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +inline ws::Opcode ws::opcode_Get(const ws::Frame64& parent) { + return ws::Opcode((parent.byte0 >> 0) & 0x0f); +} + +// --- ws.Frame64.opcode.Set +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +inline void ws::opcode_Set(ws::Frame64& parent, ws::Opcode rhs) { + u8 t1 = u8(0x0f) << 0; + u8 t2 = (u8(rhs.value) & 0x0f) << 0; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.Frame64.mask.Get +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +inline bool ws::mask_Get(const ws::Frame64& parent) { + return bool((parent.byte1 >> 7) & 0x01); +} + +// --- ws.Frame64.mask.Set +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +inline void ws::mask_Set(ws::Frame64& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.Frame64.payload_len.Get +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +inline u8 ws::payload_len_Get(const ws::Frame64& parent) { + return u8((parent.byte1 >> 0) & 0x7f); +} + +// --- ws.Frame64.payload_len.Set +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +inline void ws::payload_len_Set(ws::Frame64& parent, u8 rhs) { + u8 t1 = u8(0x7f) << 0; + u8 t2 = (u8(rhs) & 0x7f) << 0; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.Frame64.ext_payload_len.Get +inline u64 ws::ext_payload_len_Get(const ws::Frame64& parent) { + return be64toh(parent.ext_payload_len_be); // read big-endian value from memory +} + +// --- ws.Frame64.ext_payload_len.Set +inline void ws::ext_payload_len_Set(ws::Frame64& parent, u64 rhs) { + parent.ext_payload_len_be = htobe64(rhs); // write big-endian value to memory +} + +// --- ws.Frame64.payload.N +// Return number of elements in varlen field +inline u32 ws::payload_N(const ws::Frame64& parent) { + u32 length = i32(ext_payload_len_Get(((ws::Frame64&)parent)) + 10); + u32 extra_bytes = u32_Max(length,sizeof(ws::Frame64)) - sizeof(ws::Frame64); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(char)); +} + +// --- ws.Frame64.payload_curs.Reset +inline void ws::Frame64_payload_curs_Reset(Frame64_payload_curs &curs, ws::Frame64 &parent) { + curs.ptr = (u8*)payload_Addr(parent); + curs.length = i32(ext_payload_len_Get(parent) + 10) - sizeof(ws::Frame64); + curs.index = 0; +} + +// --- ws.Frame64.payload_curs.ValidQ +// cursor points to valid item +inline bool ws::Frame64_payload_curs_ValidQ(Frame64_payload_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- ws.Frame64.payload_curs.Next +// proceed to next item +inline void ws::Frame64_payload_curs_Next(Frame64_payload_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- ws.Frame64.payload_curs.Access +// item access +inline char& ws::Frame64_payload_curs_Access(Frame64_payload_curs &curs) { + return *(char*)curs.ptr; +} + +// --- ws.Frame64..GetMsgLength +// Message length (uses length field) +inline i32 ws::GetMsgLength(const ws::Frame64& parent) { + return i32(ext_payload_len_Get(const_cast(parent)) + 10); +} + +// --- ws.Frame64..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr ws::GetMsgMemptr(const ws::Frame64& row) { + return algo::memptr((u8*)&row, i32(ext_payload_len_Get(const_cast(row)) + 10)); +} + +// --- ws.Frame64..Ctor +inline ws::Frame64::Frame64() { + ws::Frame64_Init(*this); +} + +// --- ws.Frame64_curs..ValidQ +inline bool ws::Frame64_curs_ValidQ(ws::Frame64_curs& curs) { + return curs.msg != NULL; +} + +// --- ws.Frame64_curs..Reset +inline void ws::Frame64_curs_Reset(ws::Frame64_curs& curs, algo::memptr buf) { + curs.bytes = buf.elems; + curs.limit = buf.n_elems; + ws::Frame64 *msg = NULL; + int msglen = 0; + if (curs.limit >= ssizeof(ws::Frame64)) { + ws::Frame64 *ptr = (ws::Frame64*)curs.bytes; + msglen = i32(ext_payload_len_Get((*ptr)) + 10); + if (msglen >= ssizeof(ws::Frame64) && curs.limit >= msglen) { + msg = ptr; + } + } + curs.msg = msg; + curs.msglen = msglen; +} + +// --- ws.Frame64_curs..Access +inline ws::Frame64*& ws::Frame64_curs_Access(ws::Frame64_curs& curs) { + return curs.msg; +} + +// --- ws.Frame64_curs..Next +inline void ws::Frame64_curs_Next(ws::Frame64_curs& curs) { + curs.bytes += curs.msglen; + curs.limit -= curs.msglen; + ws::Frame64 *msg = NULL; + int msglen = 0; + if (curs.limit >= ssizeof(ws::Frame64)) { + ws::Frame64 *ptr = (ws::Frame64*)curs.bytes; + msglen = i32(ext_payload_len_Get((*ptr)) + 10); + if (msglen >= ssizeof(ws::Frame64) && curs.limit >= msglen) { + msg = ptr; + } + } + curs.msg = msg; + curs.msglen = msglen; +} + +// --- ws.Frame64_curs..Init +// Set all fields to initial values. +inline void ws::Frame64_curs_Init(ws::Frame64_curs& parent) { + parent.msg = NULL; + parent.bytes = NULL; + parent.limit = i32(0); + parent.msglen = i32(0); +} + +// --- ws.Frame64_curs..Ctor +inline ws::Frame64_curs::Frame64_curs() { + ws::Frame64_curs_Init(*this); +} + +// --- ws.FrameHeader.fin.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +inline bool ws::fin_Get(const ws::FrameHeader& parent) { + return bool((parent.byte0 >> 7) & 0x01); +} + +// --- ws.FrameHeader.fin.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +inline void ws::fin_Set(ws::FrameHeader& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameHeader.rsv1.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +inline bool ws::rsv1_Get(const ws::FrameHeader& parent) { + return bool((parent.byte0 >> 6) & 0x01); +} + +// --- ws.FrameHeader.rsv1.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +inline void ws::rsv1_Set(ws::FrameHeader& parent, bool rhs) { + u8 t1 = u8(0x01) << 6; + u8 t2 = (u8(rhs) & 0x01) << 6; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameHeader.rsv2.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +inline bool ws::rsv2_Get(const ws::FrameHeader& parent) { + return bool((parent.byte0 >> 5) & 0x01); +} + +// --- ws.FrameHeader.rsv2.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +inline void ws::rsv2_Set(ws::FrameHeader& parent, bool rhs) { + u8 t1 = u8(0x01) << 5; + u8 t2 = (u8(rhs) & 0x01) << 5; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameHeader.rsv3.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +inline bool ws::rsv3_Get(const ws::FrameHeader& parent) { + return bool((parent.byte0 >> 4) & 0x01); +} + +// --- ws.FrameHeader.rsv3.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +inline void ws::rsv3_Set(ws::FrameHeader& parent, bool rhs) { + u8 t1 = u8(0x01) << 4; + u8 t2 = (u8(rhs) & 0x01) << 4; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameHeader.opcode.Get +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +inline ws::Opcode ws::opcode_Get(const ws::FrameHeader& parent) { + return ws::Opcode((parent.byte0 >> 0) & 0x0f); +} + +// --- ws.FrameHeader.opcode.Set +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +inline void ws::opcode_Set(ws::FrameHeader& parent, ws::Opcode rhs) { + u8 t1 = u8(0x0f) << 0; + u8 t2 = (u8(rhs.value) & 0x0f) << 0; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameHeader.mask.Get +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +inline bool ws::mask_Get(const ws::FrameHeader& parent) { + return bool((parent.byte1 >> 7) & 0x01); +} + +// --- ws.FrameHeader.mask.Set +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +inline void ws::mask_Set(ws::FrameHeader& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.FrameHeader.payload_len.Get +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +inline u8 ws::payload_len_Get(const ws::FrameHeader& parent) { + return u8((parent.byte1 >> 0) & 0x7f); +} + +// --- ws.FrameHeader.payload_len.Set +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +inline void ws::payload_len_Set(ws::FrameHeader& parent, u8 rhs) { + u8 t1 = u8(0x7f) << 0; + u8 t2 = (u8(rhs) & 0x7f) << 0; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.FrameHeader..Init +// Set all fields to initial values. +inline void ws::FrameHeader_Init(ws::FrameHeader& parent) { + parent.byte0 = u8(0); + parent.byte1 = u8(0); +} + +// --- ws.FrameHeader..Ctor +inline ws::FrameHeader::FrameHeader() { + ws::FrameHeader_Init(*this); +} + +// --- ws.FrameHeaderMsgsCase.value.GetEnum +// Get value of field as enum type +inline ws_FrameHeaderMsgsCaseEnum ws::value_GetEnum(const ws::FrameHeaderMsgsCase& parent) { + return ws_FrameHeaderMsgsCaseEnum(parent.value); +} + +// --- ws.FrameHeaderMsgsCase.value.SetEnum +// Set value of field from enum type. +inline void ws::value_SetEnum(ws::FrameHeaderMsgsCase& parent, ws_FrameHeaderMsgsCaseEnum rhs) { + parent.value = u32(rhs); +} + +// --- ws.FrameHeaderMsgsCase.value.Cast +inline ws::FrameHeaderMsgsCase::operator ws_FrameHeaderMsgsCaseEnum() const { + return ws_FrameHeaderMsgsCaseEnum((*this).value); +} + +// --- ws.FrameHeaderMsgsCase..Init +// Set all fields to initial values. +inline void ws::FrameHeaderMsgsCase_Init(ws::FrameHeaderMsgsCase& parent) { + parent.value = u32(0); +} + +// --- ws.FrameHeaderMsgsCase..Ctor +inline ws::FrameHeaderMsgsCase::FrameHeaderMsgsCase() { + ws::FrameHeaderMsgsCase_Init(*this); +} + +// --- ws.FrameHeaderMsgsCase..FieldwiseCtor +inline ws::FrameHeaderMsgsCase::FrameHeaderMsgsCase(u32 in_value) + : value(in_value) + { +} + +// --- ws.FrameHeaderMsgsCase..EnumCtor +inline ws::FrameHeaderMsgsCase::FrameHeaderMsgsCase(ws_FrameHeaderMsgsCaseEnum arg) { + this->value = u32(arg); +} + +// --- ws.FrameMasked.base.Castbase +inline ws::FrameHeader& ws::Castbase(ws::FrameMasked& parent) { + return reinterpret_cast(parent); +} + +// --- ws.FrameMasked.fin.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +inline bool ws::fin_Get(const ws::FrameMasked& parent) { + return bool((parent.byte0 >> 7) & 0x01); +} + +// --- ws.FrameMasked.fin.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +inline void ws::fin_Set(ws::FrameMasked& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked.rsv1.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +inline bool ws::rsv1_Get(const ws::FrameMasked& parent) { + return bool((parent.byte0 >> 6) & 0x01); +} + +// --- ws.FrameMasked.rsv1.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +inline void ws::rsv1_Set(ws::FrameMasked& parent, bool rhs) { + u8 t1 = u8(0x01) << 6; + u8 t2 = (u8(rhs) & 0x01) << 6; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked.rsv2.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +inline bool ws::rsv2_Get(const ws::FrameMasked& parent) { + return bool((parent.byte0 >> 5) & 0x01); +} + +// --- ws.FrameMasked.rsv2.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +inline void ws::rsv2_Set(ws::FrameMasked& parent, bool rhs) { + u8 t1 = u8(0x01) << 5; + u8 t2 = (u8(rhs) & 0x01) << 5; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked.rsv3.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +inline bool ws::rsv3_Get(const ws::FrameMasked& parent) { + return bool((parent.byte0 >> 4) & 0x01); +} + +// --- ws.FrameMasked.rsv3.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +inline void ws::rsv3_Set(ws::FrameMasked& parent, bool rhs) { + u8 t1 = u8(0x01) << 4; + u8 t2 = (u8(rhs) & 0x01) << 4; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked.opcode.Get +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +inline ws::Opcode ws::opcode_Get(const ws::FrameMasked& parent) { + return ws::Opcode((parent.byte0 >> 0) & 0x0f); +} + +// --- ws.FrameMasked.opcode.Set +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +inline void ws::opcode_Set(ws::FrameMasked& parent, ws::Opcode rhs) { + u8 t1 = u8(0x0f) << 0; + u8 t2 = (u8(rhs.value) & 0x0f) << 0; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked.mask.Get +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +inline bool ws::mask_Get(const ws::FrameMasked& parent) { + return bool((parent.byte1 >> 7) & 0x01); +} + +// --- ws.FrameMasked.mask.Set +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +inline void ws::mask_Set(ws::FrameMasked& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.FrameMasked.payload_len.Get +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +inline u8 ws::payload_len_Get(const ws::FrameMasked& parent) { + return u8((parent.byte1 >> 0) & 0x7f); +} + +// --- ws.FrameMasked.payload_len.Set +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +inline void ws::payload_len_Set(ws::FrameMasked& parent, u8 rhs) { + u8 t1 = u8(0x7f) << 0; + u8 t2 = (u8(rhs) & 0x7f) << 0; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.FrameMasked..Ctor +inline ws::FrameMasked::FrameMasked() { + ws::FrameMasked_Init(*this); +} + +// --- ws.FrameMasked16.base.Castdown +// Check if ws::FrameHeader is an instance of FrameMasked16 by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of FrameMasked16. +// If not successful, quietly return NULL. +inline ws::FrameMasked16* ws::FrameMasked16_Castdown(ws::FrameHeader &hdr) { + bool cond = hdr.byte1 == (254); + cond &= i32(sizeof(ws::FrameHeader)) >= ssizeof(ws::FrameMasked16); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- ws.FrameMasked16.base.Castbase +inline ws::FrameHeader& ws::Castbase(ws::FrameMasked16& parent) { + return reinterpret_cast(parent); +} + +// --- ws.FrameMasked16.fin.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +inline bool ws::fin_Get(const ws::FrameMasked16& parent) { + return bool((parent.byte0 >> 7) & 0x01); +} + +// --- ws.FrameMasked16.fin.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +inline void ws::fin_Set(ws::FrameMasked16& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked16.rsv1.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +inline bool ws::rsv1_Get(const ws::FrameMasked16& parent) { + return bool((parent.byte0 >> 6) & 0x01); +} + +// --- ws.FrameMasked16.rsv1.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +inline void ws::rsv1_Set(ws::FrameMasked16& parent, bool rhs) { + u8 t1 = u8(0x01) << 6; + u8 t2 = (u8(rhs) & 0x01) << 6; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked16.rsv2.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +inline bool ws::rsv2_Get(const ws::FrameMasked16& parent) { + return bool((parent.byte0 >> 5) & 0x01); +} + +// --- ws.FrameMasked16.rsv2.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +inline void ws::rsv2_Set(ws::FrameMasked16& parent, bool rhs) { + u8 t1 = u8(0x01) << 5; + u8 t2 = (u8(rhs) & 0x01) << 5; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked16.rsv3.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +inline bool ws::rsv3_Get(const ws::FrameMasked16& parent) { + return bool((parent.byte0 >> 4) & 0x01); +} + +// --- ws.FrameMasked16.rsv3.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +inline void ws::rsv3_Set(ws::FrameMasked16& parent, bool rhs) { + u8 t1 = u8(0x01) << 4; + u8 t2 = (u8(rhs) & 0x01) << 4; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked16.opcode.Get +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +inline ws::Opcode ws::opcode_Get(const ws::FrameMasked16& parent) { + return ws::Opcode((parent.byte0 >> 0) & 0x0f); +} + +// --- ws.FrameMasked16.opcode.Set +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +inline void ws::opcode_Set(ws::FrameMasked16& parent, ws::Opcode rhs) { + u8 t1 = u8(0x0f) << 0; + u8 t2 = (u8(rhs.value) & 0x0f) << 0; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked16.mask.Get +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +inline bool ws::mask_Get(const ws::FrameMasked16& parent) { + return bool((parent.byte1 >> 7) & 0x01); +} + +// --- ws.FrameMasked16.mask.Set +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +inline void ws::mask_Set(ws::FrameMasked16& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.FrameMasked16.payload_len.Get +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +inline u8 ws::payload_len_Get(const ws::FrameMasked16& parent) { + return u8((parent.byte1 >> 0) & 0x7f); +} + +// --- ws.FrameMasked16.payload_len.Set +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +inline void ws::payload_len_Set(ws::FrameMasked16& parent, u8 rhs) { + u8 t1 = u8(0x7f) << 0; + u8 t2 = (u8(rhs) & 0x7f) << 0; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.FrameMasked16.ext_payload_len.Get +inline u16 ws::ext_payload_len_Get(const ws::FrameMasked16& parent) { + return be16toh(parent.ext_payload_len_be); // read big-endian value from memory +} + +// --- ws.FrameMasked16.ext_payload_len.Set +inline void ws::ext_payload_len_Set(ws::FrameMasked16& parent, u16 rhs) { + parent.ext_payload_len_be = htobe16(rhs); // write big-endian value to memory +} + +// --- ws.FrameMasked16.payload.N +// Return number of elements in varlen field +inline u32 ws::payload_N(const ws::FrameMasked16& parent) { + u32 length = i32(ext_payload_len_Get(((ws::FrameMasked16&)parent)) + 8); + u32 extra_bytes = u32_Max(length,sizeof(ws::FrameMasked16)) - sizeof(ws::FrameMasked16); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(char)); +} + +// --- ws.FrameMasked16.payload_curs.Reset +inline void ws::FrameMasked16_payload_curs_Reset(FrameMasked16_payload_curs &curs, ws::FrameMasked16 &parent) { + curs.ptr = (u8*)payload_Addr(parent); + curs.length = i32(ext_payload_len_Get(parent) + 8) - sizeof(ws::FrameMasked16); + curs.index = 0; +} + +// --- ws.FrameMasked16.payload_curs.ValidQ +// cursor points to valid item +inline bool ws::FrameMasked16_payload_curs_ValidQ(FrameMasked16_payload_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- ws.FrameMasked16.payload_curs.Next +// proceed to next item +inline void ws::FrameMasked16_payload_curs_Next(FrameMasked16_payload_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- ws.FrameMasked16.payload_curs.Access +// item access +inline char& ws::FrameMasked16_payload_curs_Access(FrameMasked16_payload_curs &curs) { + return *(char*)curs.ptr; +} + +// --- ws.FrameMasked16..GetMsgLength +// Message length (uses length field) +inline i32 ws::GetMsgLength(const ws::FrameMasked16& parent) { + return i32(ext_payload_len_Get(const_cast(parent)) + 8); +} + +// --- ws.FrameMasked16..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr ws::GetMsgMemptr(const ws::FrameMasked16& row) { + return algo::memptr((u8*)&row, i32(ext_payload_len_Get(const_cast(row)) + 8)); +} + +// --- ws.FrameMasked16..Ctor +inline ws::FrameMasked16::FrameMasked16() { + ws::FrameMasked16_Init(*this); +} + +// --- ws.FrameMasked16_curs..ValidQ +inline bool ws::FrameMasked16_curs_ValidQ(ws::FrameMasked16_curs& curs) { + return curs.msg != NULL; +} + +// --- ws.FrameMasked16_curs..Reset +inline void ws::FrameMasked16_curs_Reset(ws::FrameMasked16_curs& curs, algo::memptr buf) { + curs.bytes = buf.elems; + curs.limit = buf.n_elems; + ws::FrameMasked16 *msg = NULL; + int msglen = 0; + if (curs.limit >= ssizeof(ws::FrameMasked16)) { + ws::FrameMasked16 *ptr = (ws::FrameMasked16*)curs.bytes; + msglen = i32(ext_payload_len_Get((*ptr)) + 8); + if (msglen >= ssizeof(ws::FrameMasked16) && curs.limit >= msglen) { + msg = ptr; + } + } + curs.msg = msg; + curs.msglen = msglen; +} + +// --- ws.FrameMasked16_curs..Access +inline ws::FrameMasked16*& ws::FrameMasked16_curs_Access(ws::FrameMasked16_curs& curs) { + return curs.msg; +} + +// --- ws.FrameMasked16_curs..Next +inline void ws::FrameMasked16_curs_Next(ws::FrameMasked16_curs& curs) { + curs.bytes += curs.msglen; + curs.limit -= curs.msglen; + ws::FrameMasked16 *msg = NULL; + int msglen = 0; + if (curs.limit >= ssizeof(ws::FrameMasked16)) { + ws::FrameMasked16 *ptr = (ws::FrameMasked16*)curs.bytes; + msglen = i32(ext_payload_len_Get((*ptr)) + 8); + if (msglen >= ssizeof(ws::FrameMasked16) && curs.limit >= msglen) { + msg = ptr; + } + } + curs.msg = msg; + curs.msglen = msglen; +} + +// --- ws.FrameMasked16_curs..Init +// Set all fields to initial values. +inline void ws::FrameMasked16_curs_Init(ws::FrameMasked16_curs& parent) { + parent.msg = NULL; + parent.bytes = NULL; + parent.limit = i32(0); + parent.msglen = i32(0); +} + +// --- ws.FrameMasked16_curs..Ctor +inline ws::FrameMasked16_curs::FrameMasked16_curs() { + ws::FrameMasked16_curs_Init(*this); +} + +// --- ws.FrameMasked64.base.Castdown +// Check if ws::FrameHeader is an instance of FrameMasked64 by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of FrameMasked64. +// If not successful, quietly return NULL. +inline ws::FrameMasked64* ws::FrameMasked64_Castdown(ws::FrameHeader &hdr) { + bool cond = hdr.byte1 == (255); + cond &= i32(sizeof(ws::FrameHeader)) >= ssizeof(ws::FrameMasked64); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- ws.FrameMasked64.base.Castbase +inline ws::FrameHeader& ws::Castbase(ws::FrameMasked64& parent) { + return reinterpret_cast(parent); +} + +// --- ws.FrameMasked64.fin.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 7. +inline bool ws::fin_Get(const ws::FrameMasked64& parent) { + return bool((parent.byte0 >> 7) & 0x01); +} + +// --- ws.FrameMasked64.fin.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 7. +inline void ws::fin_Set(ws::FrameMasked64& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked64.rsv1.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 6. +inline bool ws::rsv1_Get(const ws::FrameMasked64& parent) { + return bool((parent.byte0 >> 6) & 0x01); +} + +// --- ws.FrameMasked64.rsv1.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 6. +inline void ws::rsv1_Set(ws::FrameMasked64& parent, bool rhs) { + u8 t1 = u8(0x01) << 6; + u8 t2 = (u8(rhs) & 0x01) << 6; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked64.rsv2.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 5. +inline bool ws::rsv2_Get(const ws::FrameMasked64& parent) { + return bool((parent.byte0 >> 5) & 0x01); +} + +// --- ws.FrameMasked64.rsv2.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 5. +inline void ws::rsv2_Set(ws::FrameMasked64& parent, bool rhs) { + u8 t1 = u8(0x01) << 5; + u8 t2 = (u8(rhs) & 0x01) << 5; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked64.rsv3.Get +// Retrieve bitfield from value of field byte0 +// 1 bits starting at bit 4. +inline bool ws::rsv3_Get(const ws::FrameMasked64& parent) { + return bool((parent.byte0 >> 4) & 0x01); +} + +// --- ws.FrameMasked64.rsv3.Set +// Set bitfield in value of field 'byte0' +// 1 bits starting at bit 4. +inline void ws::rsv3_Set(ws::FrameMasked64& parent, bool rhs) { + u8 t1 = u8(0x01) << 4; + u8 t2 = (u8(rhs) & 0x01) << 4; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked64.opcode.Get +// Retrieve bitfield from value of field byte0 +// 4 bits starting at bit 0. +inline ws::Opcode ws::opcode_Get(const ws::FrameMasked64& parent) { + return ws::Opcode((parent.byte0 >> 0) & 0x0f); +} + +// --- ws.FrameMasked64.opcode.Set +// Set bitfield in value of field 'byte0' +// 4 bits starting at bit 0. +inline void ws::opcode_Set(ws::FrameMasked64& parent, ws::Opcode rhs) { + u8 t1 = u8(0x0f) << 0; + u8 t2 = (u8(rhs.value) & 0x0f) << 0; + parent.byte0 = u8((parent.byte0 & ~t1) | t2); +} + +// --- ws.FrameMasked64.mask.Get +// Retrieve bitfield from value of field byte1 +// 1 bits starting at bit 7. +inline bool ws::mask_Get(const ws::FrameMasked64& parent) { + return bool((parent.byte1 >> 7) & 0x01); +} + +// --- ws.FrameMasked64.mask.Set +// Set bitfield in value of field 'byte1' +// 1 bits starting at bit 7. +inline void ws::mask_Set(ws::FrameMasked64& parent, bool rhs) { + u8 t1 = u8(0x01) << 7; + u8 t2 = (u8(rhs) & 0x01) << 7; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.FrameMasked64.payload_len.Get +// Retrieve bitfield from value of field byte1 +// 7 bits starting at bit 0. +inline u8 ws::payload_len_Get(const ws::FrameMasked64& parent) { + return u8((parent.byte1 >> 0) & 0x7f); +} + +// --- ws.FrameMasked64.payload_len.Set +// Set bitfield in value of field 'byte1' +// 7 bits starting at bit 0. +inline void ws::payload_len_Set(ws::FrameMasked64& parent, u8 rhs) { + u8 t1 = u8(0x7f) << 0; + u8 t2 = (u8(rhs) & 0x7f) << 0; + parent.byte1 = u8((parent.byte1 & ~t1) | t2); +} + +// --- ws.FrameMasked64.ext_payload_len.Get +inline u64 ws::ext_payload_len_Get(const ws::FrameMasked64& parent) { + return be64toh(parent.ext_payload_len_be); // read big-endian value from memory +} + +// --- ws.FrameMasked64.ext_payload_len.Set +inline void ws::ext_payload_len_Set(ws::FrameMasked64& parent, u64 rhs) { + parent.ext_payload_len_be = htobe64(rhs); // write big-endian value to memory +} + +// --- ws.FrameMasked64.payload.N +// Return number of elements in varlen field +inline u32 ws::payload_N(const ws::FrameMasked64& parent) { + u32 length = i32(ext_payload_len_Get(((ws::FrameMasked64&)parent)) + 14); + u32 extra_bytes = u32_Max(length,sizeof(ws::FrameMasked64)) - sizeof(ws::FrameMasked64); // avoid unsigned subtraction underflow + return u32(extra_bytes / sizeof(char)); +} + +// --- ws.FrameMasked64.payload_curs.Reset +inline void ws::FrameMasked64_payload_curs_Reset(FrameMasked64_payload_curs &curs, ws::FrameMasked64 &parent) { + curs.ptr = (u8*)payload_Addr(parent); + curs.length = i32(ext_payload_len_Get(parent) + 14) - sizeof(ws::FrameMasked64); + curs.index = 0; +} + +// --- ws.FrameMasked64.payload_curs.ValidQ +// cursor points to valid item +inline bool ws::FrameMasked64_payload_curs_ValidQ(FrameMasked64_payload_curs &curs) { + bool valid = ssizeof(char) <= curs.length; + return valid; +} + +// --- ws.FrameMasked64.payload_curs.Next +// proceed to next item +inline void ws::FrameMasked64_payload_curs_Next(FrameMasked64_payload_curs &curs) { + i32 len = i32(sizeof(char)); + curs.ptr += len; + curs.length -= len; + ++curs.index; +} + +// --- ws.FrameMasked64.payload_curs.Access +// item access +inline char& ws::FrameMasked64_payload_curs_Access(FrameMasked64_payload_curs &curs) { + return *(char*)curs.ptr; +} + +// --- ws.FrameMasked64..GetMsgLength +// Message length (uses length field) +inline i32 ws::GetMsgLength(const ws::FrameMasked64& parent) { + return i32(ext_payload_len_Get(const_cast(parent)) + 14); +} + +// --- ws.FrameMasked64..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr ws::GetMsgMemptr(const ws::FrameMasked64& row) { + return algo::memptr((u8*)&row, i32(ext_payload_len_Get(const_cast(row)) + 14)); +} + +// --- ws.FrameMasked64..Ctor +inline ws::FrameMasked64::FrameMasked64() { + ws::FrameMasked64_Init(*this); +} + +// --- ws.FrameMasked64_curs..ValidQ +inline bool ws::FrameMasked64_curs_ValidQ(ws::FrameMasked64_curs& curs) { + return curs.msg != NULL; +} + +// --- ws.FrameMasked64_curs..Reset +inline void ws::FrameMasked64_curs_Reset(ws::FrameMasked64_curs& curs, algo::memptr buf) { + curs.bytes = buf.elems; + curs.limit = buf.n_elems; + ws::FrameMasked64 *msg = NULL; + int msglen = 0; + if (curs.limit >= ssizeof(ws::FrameMasked64)) { + ws::FrameMasked64 *ptr = (ws::FrameMasked64*)curs.bytes; + msglen = i32(ext_payload_len_Get((*ptr)) + 14); + if (msglen >= ssizeof(ws::FrameMasked64) && curs.limit >= msglen) { + msg = ptr; + } + } + curs.msg = msg; + curs.msglen = msglen; +} + +// --- ws.FrameMasked64_curs..Access +inline ws::FrameMasked64*& ws::FrameMasked64_curs_Access(ws::FrameMasked64_curs& curs) { + return curs.msg; +} + +// --- ws.FrameMasked64_curs..Next +inline void ws::FrameMasked64_curs_Next(ws::FrameMasked64_curs& curs) { + curs.bytes += curs.msglen; + curs.limit -= curs.msglen; + ws::FrameMasked64 *msg = NULL; + int msglen = 0; + if (curs.limit >= ssizeof(ws::FrameMasked64)) { + ws::FrameMasked64 *ptr = (ws::FrameMasked64*)curs.bytes; + msglen = i32(ext_payload_len_Get((*ptr)) + 14); + if (msglen >= ssizeof(ws::FrameMasked64) && curs.limit >= msglen) { + msg = ptr; + } + } + curs.msg = msg; + curs.msglen = msglen; +} + +// --- ws.FrameMasked64_curs..Init +// Set all fields to initial values. +inline void ws::FrameMasked64_curs_Init(ws::FrameMasked64_curs& parent) { + parent.msg = NULL; + parent.bytes = NULL; + parent.limit = i32(0); + parent.msglen = i32(0); +} + +// --- ws.FrameMasked64_curs..Ctor +inline ws::FrameMasked64_curs::FrameMasked64_curs() { + ws::FrameMasked64_curs_Init(*this); +} + +// --- ws.HttpState.value.GetEnum +// Get value of field as enum type +inline ws_HttpStateEnum ws::value_GetEnum(const ws::HttpState& parent) { + return ws_HttpStateEnum(parent.value); +} + +// --- ws.HttpState.value.SetEnum +// Set value of field from enum type. +inline void ws::value_SetEnum(ws::HttpState& parent, ws_HttpStateEnum rhs) { + parent.value = u8(rhs); +} + +// --- ws.HttpState..Init +// Set all fields to initial values. +inline void ws::HttpState_Init(ws::HttpState& parent) { + parent.value = u8(0); +} + +// --- ws.HttpState..Ctor +inline ws::HttpState::HttpState() { + ws::HttpState_Init(*this); +} + +// --- ws.HttpState..FieldwiseCtor +inline ws::HttpState::HttpState(u8 in_value) + : value(in_value) + { +} + +// --- ws.HttpState..EnumCtor +inline ws::HttpState::HttpState(ws_HttpStateEnum arg) { + this->value = u8(arg); +} + +// --- ws.ServerStartMsg.base.Castdown +// Check if ams::MsgHeader is an instance of ServerStartMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of ServerStartMsg. +// If not successful, quietly return NULL. +inline ws::ServerStartMsg* ws::ServerStartMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (500); + cond &= i32(hdr.length) >= ssizeof(ws::ServerStartMsg); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- ws.ServerStartMsg.base.Castbase +inline ams::MsgHeader& ws::Castbase(ws::ServerStartMsg& parent) { + return reinterpret_cast(parent); +} + +// --- ws.ServerStartMsg..GetMsgLength +// Message length (uses length field) +inline i32 ws::GetMsgLength(const ws::ServerStartMsg& parent) { + return i32(const_cast(parent).length); +} + +// --- ws.ServerStartMsg..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr ws::GetMsgMemptr(const ws::ServerStartMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); +} + +// --- ws.ServerStartMsg..Init +// Set all fields to initial values. +inline void ws::ServerStartMsg_Init(ws::ServerStartMsg& parent) { + parent.type = u32(500); + parent.length = u32(ssizeof(parent) + (0)); +} + +// --- ws.ServerStartMsg..Ctor +inline ws::ServerStartMsg::ServerStartMsg() { + ws::ServerStartMsg_Init(*this); +} + +// --- ws.ServerStopMsg.base.Castdown +// Check if ams::MsgHeader is an instance of ServerStopMsg by checking the type field +// If it is, return the pointer of target type. +// Additionally, check if the length field permits valid instance of ServerStopMsg. +// If not successful, quietly return NULL. +inline ws::ServerStopMsg* ws::ServerStopMsg_Castdown(ams::MsgHeader &hdr) { + bool cond = hdr.type == (501); + cond &= i32(hdr.length) >= ssizeof(ws::ServerStopMsg); + return cond ? reinterpret_cast(&hdr) : NULL; +} + +// --- ws.ServerStopMsg.base.Castbase +inline ams::MsgHeader& ws::Castbase(ws::ServerStopMsg& parent) { + return reinterpret_cast(parent); +} + +// --- ws.ServerStopMsg..GetMsgLength +// Message length (uses length field) +inline i32 ws::GetMsgLength(const ws::ServerStopMsg& parent) { + return i32(const_cast(parent).length); +} + +// --- ws.ServerStopMsg..GetMsgMemptr +// Memptr encompassing the message (uses length field) +inline algo::memptr ws::GetMsgMemptr(const ws::ServerStopMsg& row) { + return algo::memptr((u8*)&row, i32(const_cast(row).length)); +} + +// --- ws.ServerStopMsg..Init +// Set all fields to initial values. +inline void ws::ServerStopMsg_Init(ws::ServerStopMsg& parent) { + parent.type = u32(501); + parent.length = u32(ssizeof(parent) + (0)); +} + +// --- ws.ServerStopMsg..Ctor +inline ws::ServerStopMsg::ServerStopMsg() { + ws::ServerStopMsg_Init(*this); +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::Side &row) {// cfmt:ws.Side.String + ws::Side_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::StatusCode &row) {// cfmt:ws.StatusCode.String + ws::StatusCode_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::CloseMsg &row) {// cfmt:ws.CloseMsg.String + ws::CloseMsg_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::ConnectMsg &row) {// cfmt:ws.ConnectMsg.String + ws::ConnectMsg_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::Opcode &row) {// cfmt:ws.Opcode.String + ws::Opcode_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::DataMsg &row) {// cfmt:ws.DataMsg.String + ws::DataMsg_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::FieldId &row) {// cfmt:ws.FieldId.String + ws::FieldId_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::Frame &row) {// cfmt:ws.Frame.String + ws::Frame_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::Frame16 &row) {// cfmt:ws.Frame16.String + ws::Frame16_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::Frame64 &row) {// cfmt:ws.Frame64.String + ws::Frame64_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::FrameMasked &row) {// cfmt:ws.FrameMasked.String + ws::FrameMasked_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::FrameMasked16 &row) {// cfmt:ws.FrameMasked16.String + ws::FrameMasked16_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::FrameMasked64 &row) {// cfmt:ws.FrameMasked64.String + ws::FrameMasked64_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::HttpState &row) {// cfmt:ws.HttpState.String + ws::HttpState_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::ServerStartMsg &row) {// cfmt:ws.ServerStartMsg.String + ws::ServerStartMsg_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const ws::ServerStopMsg &row) {// cfmt:ws.ServerStopMsg.String + ws::ServerStopMsg_Print(const_cast(row), str); + return str; +} diff --git a/include/gen/wsdb_gen.h b/include/gen/wsdb_gen.h new file mode 100644 index 00000000..fce87a6d --- /dev/null +++ b/include/gen/wsdb_gen.h @@ -0,0 +1,136 @@ +// +// include/gen/wsdb_gen.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.h" +//#pragma endinclude +// gen:ns_enums + +// --- wsdb_FieldIdEnum + +enum wsdb_FieldIdEnum { // wsdb.FieldId.value + wsdb_FieldId_code = 0 + ,wsdb_FieldId_reason = 1 + ,wsdb_FieldId_local_only = 2 + ,wsdb_FieldId_comment = 3 + ,wsdb_FieldId_value = 4 +}; + +enum { wsdb_FieldIdEnum_N = 5 }; + +namespace wsdb { // gen:ns_pkeytypedef + typedef u32 StatusPkey; +} // gen:ns_pkeytypedef +namespace wsdb { // gen:ns_tclass_field +} // gen:ns_tclass_field +// gen:ns_fwddecl2 +namespace wsdb { struct FieldId; } +namespace wsdb { struct Status; } +namespace wsdb { // gen:ns_print_struct + +// --- wsdb.FieldId +#pragma pack(push,1) +struct FieldId { // wsdb.FieldId: Field read helper + i32 value; // -1 + // func:wsdb.FieldId.value.Cast + inline operator wsdb_FieldIdEnum() const __attribute__((nothrow)); + // func:wsdb.FieldId..Ctor + inline FieldId() __attribute__((nothrow)); + // func:wsdb.FieldId..FieldwiseCtor + explicit inline FieldId(i32 in_value) __attribute__((nothrow)); + // func:wsdb.FieldId..EnumCtor + inline FieldId(wsdb_FieldIdEnum arg) __attribute__((nothrow)); +}; +#pragma pack(pop) + +// Get value of field as enum type +// func:wsdb.FieldId.value.GetEnum +inline wsdb_FieldIdEnum value_GetEnum(const wsdb::FieldId& parent) __attribute__((nothrow)); +// Set value of field from enum type. +// func:wsdb.FieldId.value.SetEnum +inline void value_SetEnum(wsdb::FieldId& parent, wsdb_FieldIdEnum rhs) __attribute__((nothrow)); +// Convert numeric value of field to one of predefined string constants. +// If string is found, return a static C string. Otherwise, return NULL. +// func:wsdb.FieldId.value.ToCstr +const char* value_ToCstr(const wsdb::FieldId& parent) __attribute__((nothrow)); +// Convert value to a string. First, attempt conversion to a known string. +// If no string matches, print value as a numeric value. +// func:wsdb.FieldId.value.Print +void value_Print(const wsdb::FieldId& parent, algo::cstring &lhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, do not modify field and return false. +// In case of success, return true +// func:wsdb.FieldId.value.SetStrptrMaybe +bool value_SetStrptrMaybe(wsdb::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); +// Convert string to field. +// If the string is invalid, set numeric value to DFLT +// func:wsdb.FieldId.value.SetStrptr +void value_SetStrptr(wsdb::FieldId& parent, algo::strptr rhs, wsdb_FieldIdEnum dflt) __attribute__((nothrow)); +// Convert string to field. Return success value +// func:wsdb.FieldId.value.ReadStrptrMaybe +bool value_ReadStrptrMaybe(wsdb::FieldId& parent, algo::strptr rhs) __attribute__((nothrow)); + +// Read fields of wsdb::FieldId from an ascii string. +// The format of the string is the format of the wsdb::FieldId's only field +// func:wsdb.FieldId..ReadStrptrMaybe +bool FieldId_ReadStrptrMaybe(wsdb::FieldId &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:wsdb.FieldId..Init +inline void FieldId_Init(wsdb::FieldId& parent); +// print string representation of ROW to string STR +// cfmt:wsdb.FieldId.String printfmt:Raw +// func:wsdb.FieldId..Print +void FieldId_Print(wsdb::FieldId& row, algo::cstring& str) __attribute__((nothrow)); + +// --- wsdb.Status +struct Status { // wsdb.Status + u32 code; // 0 Status code + algo::Smallstr32 reason; // Status reason + bool local_only; // false Never sent on close frame, use locally + algo::Comment comment; // + // func:wsdb.Status..Ctor + inline Status() __attribute__((nothrow)); +}; + +// func:wsdb.Status..ReadFieldMaybe +bool Status_ReadFieldMaybe(wsdb::Status& parent, algo::strptr field, algo::strptr strval) __attribute__((nothrow)); +// Read fields of wsdb::Status from an ascii string. +// The format of the string is an ssim Tuple +// func:wsdb.Status..ReadStrptrMaybe +bool Status_ReadStrptrMaybe(wsdb::Status &parent, algo::strptr in_str) __attribute__((nothrow)); +// Set all fields to initial values. +// func:wsdb.Status..Init +inline void Status_Init(wsdb::Status& parent); +// print string representation of ROW to string STR +// cfmt:wsdb.Status.String printfmt:Tuple +// func:wsdb.Status..Print +void Status_Print(wsdb::Status& row, algo::cstring& str) __attribute__((nothrow)); +} // gen:ns_print_struct +namespace wsdb { // gen:ns_func +} // gen:ns_func +// gen:ns_operators +namespace algo { +inline algo::cstring &operator <<(algo::cstring &str, const wsdb::FieldId &row);// cfmt:wsdb.FieldId.String +inline algo::cstring &operator <<(algo::cstring &str, const wsdb::Status &row);// cfmt:wsdb.Status.String +} diff --git a/include/gen/wsdb_gen.inl.h b/include/gen/wsdb_gen.inl.h new file mode 100644 index 00000000..3db41bc3 --- /dev/null +++ b/include/gen/wsdb_gen.inl.h @@ -0,0 +1,88 @@ +// +// include/gen/wsdb_gen.inl.h +// Generated by AMC +// +// Copyright (C) 2008-2013 AlgoEngineering LLC +// Copyright (C) 2013-2019 NYSE | Intercontinental Exchange +// Copyright (C) 2020-2023 Astra +// Copyright (C) 2023 AlgoRND +// +// 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 . +// + + +#pragma once +#include "include/gen/algo_gen.inl.h" +//#pragma endinclude + +// --- wsdb.FieldId.value.GetEnum +// Get value of field as enum type +inline wsdb_FieldIdEnum wsdb::value_GetEnum(const wsdb::FieldId& parent) { + return wsdb_FieldIdEnum(parent.value); +} + +// --- wsdb.FieldId.value.SetEnum +// Set value of field from enum type. +inline void wsdb::value_SetEnum(wsdb::FieldId& parent, wsdb_FieldIdEnum rhs) { + parent.value = i32(rhs); +} + +// --- wsdb.FieldId.value.Cast +inline wsdb::FieldId::operator wsdb_FieldIdEnum() const { + return wsdb_FieldIdEnum((*this).value); +} + +// --- wsdb.FieldId..Init +// Set all fields to initial values. +inline void wsdb::FieldId_Init(wsdb::FieldId& parent) { + parent.value = i32(-1); +} + +// --- wsdb.FieldId..Ctor +inline wsdb::FieldId::FieldId() { + wsdb::FieldId_Init(*this); +} + +// --- wsdb.FieldId..FieldwiseCtor +inline wsdb::FieldId::FieldId(i32 in_value) + : value(in_value) + { +} + +// --- wsdb.FieldId..EnumCtor +inline wsdb::FieldId::FieldId(wsdb_FieldIdEnum arg) { + this->value = i32(arg); +} + +// --- wsdb.Status..Init +// Set all fields to initial values. +inline void wsdb::Status_Init(wsdb::Status& parent) { + parent.code = u32(0); + parent.local_only = bool(false); +} + +// --- wsdb.Status..Ctor +inline wsdb::Status::Status() { + wsdb::Status_Init(*this); +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const wsdb::FieldId &row) {// cfmt:wsdb.FieldId.String + wsdb::FieldId_Print(const_cast(row), str); + return str; +} + +inline algo::cstring &algo::operator <<(algo::cstring &str, const wsdb::Status &row) {// cfmt:wsdb.Status.String + wsdb::Status_Print(const_cast(row), str); + return str; +} diff --git a/include/jkv.h b/include/jkv.h new file mode 100644 index 00000000..8043b143 --- /dev/null +++ b/include/jkv.h @@ -0,0 +1,40 @@ +// 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: jkv (exe) -- JSON <-> key-value mapping tool +// Exceptions: yes +// Header: include/jkv.h +// + +#include "include/gen/jkv_gen.h" +#include "include/gen/jkv_gen.inl.h" + +namespace jkv { // update-hdr + // Dear human: + // Text from here to the closing curly brace was produced by scanning + // source files. Editing this text is futile. + // To refresh the contents of this section, run 'update-hdr'. + // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. + + // ------------------------------------------------------------------- + // cpp/jkv/jkv.cpp + // + void PrintKv(lib_json::FNode &node, algo::strptr prefix, cstring &out); + void SetPath(lib_json::FNode *node, algo::strptr key, lib_json::FNode *val); + void ApplyKv(lib_json::FNode &node, algo::strptr kv); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:jkv +} diff --git a/include/lib_amcdb.h b/include/lib_amcdb.h index b2ef1371..6d3a595a 100644 --- a/include/lib_amcdb.h +++ b/include/lib_amcdb.h @@ -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 diff --git a/include/lib_ams.h b/include/lib_ams.h index 91cc215b..00f3194e 100644 --- a/include/lib_ams.h +++ b/include/lib_ams.h @@ -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 @@ -19,6 +19,7 @@ // Header: include/lib_ams.h // +#pragma once #include "include/algo.h" #include "include/gen/lib_ams_gen.h" #include "include/gen/lib_ams_gen.inl.h" @@ -31,48 +32,35 @@ namespace lib_ams { // update-hdr // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. // ------------------------------------------------------------------- - // cpp/lib_ams/expect.cpp -- Expect implementation + // cpp/lib_ams/dump.cpp // - // In-process `expect` implementation allows pausing reading of inputs until - // a certain prlog output is produced - // Motivating example: - // InputMsg1 - // InputMsg2 - // Expect text:blah - // InputMsg3 - // InputMsg3 is not processed until blah is printed. - // Implementation: - // When reading an input message: - // clear output buffer - // if read an ExpectMsg: - // set expect string to the input data - // check output buffer (match any outputs since last input against expect string) - // set expect timeout - // Expect timeout: - // exit process with error - // When printing: - // add to output buffer (limit: 100K). - // if expect mode, check output buffer - void ExpectEnable(strptr str); - - // Replace input reading function with one that pauses output - // to support ExpectMsg functionality - void ExpectAttach(lib_ams::FStream &stream); - - // Function that replaces uses-provided message hook for a given stream - // Having no cost until the first call to ExpectEnable, the purpose - // is to block processing of any messages until expect_Str is empty - void ExpectHook(lib_ams::FStream &stream, ams::MsgHeader &msg); - - // Save output to possibly check against expect string later - // Keep last 50k-100k of output - void ExpectSaveOutput(algo::strptr text); - void ExpectTimeout(); - - // Check saved output buffer against expect string - // WARNING: calling prlog() from this function will cause an infinite loop - void ExpectCheck(); + // Print table of shms in lib_ams, using ssim format + // if MEMBER is specified, print member information as well + void DumpShmTableDflt(algo_lib::Regx ®x, bool member); + + // Print table of shms in lib_ams, using a more readable layout + void DumpShmTableVisual(algo_lib::Regx ®x); + + // Print message MSG to string OUT according to format FMT + // if FMT.STRIP > 0, strip this many outer "layers"; + // if FMT.BIN, the message is printed as pure binary; otherwise, convert to text + // if FMT.PRETTY, every next layer / payload is printed on a new line with indent + // for readability. + // FMT.PAYLOAD_LEN limits maximum printed payload length, allowing to fit one messge per + // screen even if payload is 10MB + // Finally, if FMT.SHOWLEN is true, message length is included in output. + void PrintMsg(lib_ams::MsgFmt &fmt, ams::MsgHeader &msg, cstring &out); + + // This function should be called if the ams logcat is enabled + // It prints the given MSG to ams logcat using pretty format. + // Heartbeats (ShmHb, MemberHb, PubMetric) are skipped unless verbose is on + void TraceMsg(ams::Shmmsg *msg, ams::MsgHeader *payload); + tempstr ToString(ams::MsgHeader &msg); + + // Convert message MSG to string in a way suitable for debugging + // (some information is lost in exchange for readability) + tempstr ToDbgString(ams::MsgHeader &msg); // ------------------------------------------------------------------- // cpp/lib_ams/file.cpp @@ -91,7 +79,7 @@ namespace lib_ams { // update-hdr // Flush data to file // (user-implemented function, prototype is in amc-generated header) - // void zd_flush_Step(); + // void zd_flush_Step(); // fstep:lib_ams.FDb.zd_flush // Write message (buffered) void WriteMsg(lib_ams::FWritefile &wf, ams::MsgHeader &msg); @@ -112,7 +100,8 @@ namespace lib_ams { // update-hdr void Close(lib_ams::FWritefile &wf); // cleanup function - void fd_Cleanup(lib_ams::FWritefile& parent); + // (user-implemented function, prototype is in amc-generated header) + // void fd_Cleanup(lib_ams::FWritefile& parent); // fcleanup:lib_ams.FWritefile.fd // Whether read file is in good state - valid fd and no failure. // EOF is not a failure. @@ -162,183 +151,183 @@ namespace lib_ams { // update-hdr void Close(lib_ams::FReadfile &wf); // cleanup function - void fd_Cleanup(lib_ams::FReadfile& parent); + // (user-implemented function, prototype is in amc-generated header) + // void fd_Cleanup(lib_ams::FReadfile& parent); // fcleanup:lib_ams.FWritefile.fd // ------------------------------------------------------------------- - // cpp/lib_ams/stream.cpp + // cpp/lib_ams/shm.cpp // - // Scan /dev/shm for stale stream files and delete them + // Scan /dev/shm for stale shm files and delete them // A file is stale if it's flockable (i.e. no process has locked it for writing) - // and it's at least 1 hour old - void CleanOldStreamFiles(); + // and it's at least 15 seconds old + void CleanOldShmFiles(); - // return TRUE if shared memory region is attached to stream STREAM. - bool ShmemOpenQ(lib_ams::FStream &stream); + // return TRUE if shared memory region is attached to shm SHM. + bool ShmemFdOpenQ(lib_ams::FShm &shm); // Open shared memory for reading/writing (as specified in FLAGS) - // and return resulting shared memory region size. + // and return success status // Fields initialized: - // - stream.filename - // - stream.shm_handle (windows) - // - stream.shm_file (linux) - // - stream.shm_region, if mapped successfully - i64 OpenShmem(lib_ams::FStream &stream, ams::StreamFlags flags); - - // Open stream for reading or writing (but not both) - // If shared memory mode (lib_ams::_db.shmem_mode) is set, - // The file creator sets stream size. + // - shm.filename + // - shm.shm_handle (windows) + // - shm.shm_file (linux) + // - shm.shm_region, if mapped successfully + // If the segment is opened for writing, it is flocked. + bool ShmemOpenFile(lib_ams::FShm &shm, ams::ShmFlags flags); + + // Open shm for reading or writing (or both) + // The file creator sets shm size. // Writer creates & locks the file. // Reader determines file from file size - // If shared memory mode is not set (stdio mode), - // the stream is attached to a private memory block of default size. // When opening for writing: - // The next message written to the stream will have sequence SEQ and offset OFFSET. - // Default is to use sequence 1, offset 0. + // The next message written to the shm will have OFFSET as determined by POS + // Initial value of offset is 0 // (However a newly spawned child process can be provided a known sequence & offset by the parent.) // When opening for reading: - // begin hot-polling for new messages on the stream - bool OpenStream(lib_ams::FStream &stream, ams::StreamFlags flags, ams::StreamPos pos); - bool OpenStream(lib_ams::FStream &stream, ams::StreamFlags flags); - - // TBD not sure if this function is needed in non-fork() environment - bool ReopenForReading(lib_ams::FStream &stream); + // begin hot-polling for new messages on the shm + bool OpenShm(lib_ams::FShm &shm, ams::ShmFlags flags, u64 pos = 0); - // Update budget for stream STREAM - // Return TRUE if the stream is potentially unblocked for + // Update budget for shm SHM + // Return TRUE if the shm is potentially unblocked for // writing due to WRITELIMIT being increased. // (WRITELIMIT is the point beyond which no message can be written // because doing so would overwrite data not yet consumed by one of the read members.) - // TODO: do not update budget for a stream that is not opened for writing - bool UpdateBudget(lib_ams::FStream &stream); - - // Update stream budgets - void UpdateBudgets(); + bool UpdateWriteLimit(lib_ams::FShm &shm); // Register a bad, unskippable incoming message - // on STREAM, report it, and stop reading. - void WriterError(lib_ams::FStream &stream, ams::Seqmsg *msg); - - // If the stream is open for reading, check to see if a message - // is available. - // If it is available, return pointer to message. - ams::Seqmsg *PeekMsg(lib_ams::FStream &stream); - - // Called by the client - // to aoivd reading current message - void StopReading(lib_ams::FStream &stream); - - // Mark current message as read and move to the next message. - void SkipMsg(lib_ams::FStream &stream); - int WriteBudget(lib_ams::FStream &stream); - - // Send heartbeat to control stream - // Update - void SendHb(lib_ams::FStream &stream); - - // Publish stream heartbeats to c_stream_ctl stream - // (user-implemented function, prototype is in amc-generated header) - // void cd_stream_hb_Step(); - - // Check all streams (that are not already readable) for readability. - // If readable, call h_msg hook. - // void cd_poll_read_Step(); + // on SHM, report it, and stop reading. + void ShmError(lib_ams::FShm &shm, ams::Shmmsg *msg, const char *text); void PollCtlIn(); // Begin writing message of length LENGTH // Used by WriteMsg and with amc's pnew (acr pnew) for zero-copy sends. // If successful, return pointer to region of size LENGTH whre the mssage can be written, // otherwise return NULL. - void *BeginWrite(lib_ams::FStream &stream, int length); + void *BeginWrite(lib_ams::FShm &shm, int length); // Finish writing message of length LENGTH, // and send the result. - void EndWrite(lib_ams::FStream &stream, void *ptr, int len); + void EndWrite(lib_ams::FShm &shm, void *ptr, int len); - // If the stream is attached to a writable shared memory segment, - // write sequenced message to stream STREAM, and increment sequence number - // and stream offset. + // If the shm is attached to a writable shared memory segment, + // write sequenced message to shm SHM, and increment sequence number + // and shm offset. // Message must be within max. message size - // If the stream is not configured for writingIf an output fd is associated with the stream, hthe stream, write - bool WriteMsg(lib_ams::FStream &stream, ams::MsgHeader &msg); - - // Write message MSG to output, either in binary or text mode. - // Return success status - // If ISREAD flag is set, this is a copy of a message that has just been read - // from another stream. Otherwise, it's a copy of a message that's just been written. - // In stdin mode, where messages are read from ascii input and posted to the - void TraceMsg(lib_ams::FStream &stream, ams::MsgHeader &msg, bool isread); - - // Initialize stream library - // FILE_PREFIX: unique filesystem prefix for all subsequently created streams - // Also clean any stale (unlocked) stream files. - // (this can be disabled by setting _db.stream_files_cleaned to true) + // If the shm is not configured for writingIf an output fd is associated with the shm, hthe shm, write + bool WriteMsg(lib_ams::FShm &shm, ams::MsgHeader &msg); + + // Initialize shm library + // FILE_PREFIX: unique filesystem prefix for all subsequently created shms. + // This is copied to lib_ams::_db.file_prefix. + // if FILE_PREFIX is empty, we are running in NON-SHMEM mode. In this mode, + // the library begins reading STDIN and posting any input messages to the default + // input shm. + // PROC_ID: process ID for this app. This is copied to lib_ams::_db.proc_id. + // The PROC_ID is .- -- enough to identify any number of processes within + // a cluster. + // If the variable _db.shm_files_cleaned is FALSE (which is the default), + // clean any stale (unlocked) shm files in /dev/shm/*.ams + // In SHMEM mode, all current and future memory is locked using mlockall. bool Init(algo::strptr file_prefix, ams::ProcId proc_id); void Uninit(); - void shm_handle_Cleanup(lib_ams::FStream &stream); - void shm_file_Cleanup(lib_ams::FStream &stream); - - // Process joined the group // (user-implemented function, prototype is in amc-generated header) - // void CtlMsg_ProcAddMsg(ams::ProcAddMsg &msg); - - // A process has exited - // Remove any read/write members contributed by the process and - // potentially unblock some write streams - // void CtlMsg_ProcRemoveMsg(ams::ProcRemoveMsg &msg); - // void CtlMsg_DumpStreamTableMsg(ams::DumpStreamTableMsg &msg); - // void CtlMsg_StreamHbMsg(ams::StreamHbMsg &msg); - void ReadCtlMsg(lib_ams::FStream &, ams::MsgHeader &msg); + // void shm_file_Cleanup(lib_ams::FShm &shm); // fcleanup:lib_ams.FShm.shm_file + // void CtlMsg_ShmHbMsg(ams::ShmHbMsg &msg); // dispatch_msg:lib_ams.CtlMsg/ams.ShmHbMsg + void ReadCtlMsg(lib_ams::FShm &, ams::MsgHeader &msg); // Read next input line from stdin + // The line is parsed as an AMS message. It could be a Shmmsg or any other msg. + // If the line doesn't look like anything, it is converted to ams.InputLineMsg + // Then, look up a shm where to post the message. + // If we see a Shmmsg, find shm where this message is intended to go and write the message there. + // Otherwise, post the message to the default shm (lib_ams::_db.dflt_shm_id) + // If the shm where we are posting the message is full (won't accept the message) + // then reading of fdin is stopped and will resume after the shm has room. + // If there is nowhere to post the message because no target shm is found, the counter + // trace.n_fdin_drop_notgt is incremented and a message is printed in verbose mode. // (user-implemented function, prototype is in amc-generated header) - // void cd_fdin_read_Step(); + // void cd_fdin_read_Step(); // fstep:lib_ams.FDb.cd_fdin_read // Stop reading stdin - // void cd_fdin_eof_Step(); + // void cd_fdin_eof_Step(); // fstep:lib_ams.FDb.cd_fdin_eof // Begin reading ams control messages from stdin void BeginReadStdin(); - lib_ams::FStream &ind_stream_GetOrCreate(ams::StreamId stream_id); - void DumpStreamTableDflt(); - void DumpStreamTableVisual(); - void DumpStreamTable(int format = 0); - - // Close stream. - // If stream is opened for writing, remove its file. - // BUG: I think if the stream is opened for reading, the mmap() leaks - void Close(lib_ams::FStream &stream); + lib_ams::FShm &ind_shm_GetOrCreate(ams::ShmId shm_id); + + // Close shm. + // If shm is opened for writing, remove its file. + // BUG: I think if the shm is opened for reading, the mmap() leaks + void Close(lib_ams::FShm &shm); void SetDfltShmSize(u32 size); - ams::StreamPos ReadStreamPos(algo::strptr val); - // Register PROC_ID as reader of stream STREAM_ID starting at offset 0 - // This immediately limits the write budget of STREAM_ID + // Register PROC_ID as reader of shm SHM_ID starting at offset 0 + // This immediately limits the write budget of SHM_ID // (Subsequent attempt to overwrite data not yet consumed by PROC_ID causes // either reject or blocking wait) - void AddReadMember(ams::ProcId proc_id, ams::StreamId stream_id); - - // Open stream STREAM for reading and add it to the list of streams - // which lib_ams scans for messages (i.e. control streams). - // Attach lib_ams message dispatch to the stream - bool AddCtlIn(lib_ams::FStream &stream); - void CloseAllStreams(); - - // Match trace expression REGX against stream STREAM. - // If it matches, enable/disable tracing as indicated by ENABLE - // For full description see txt/trace.md - bool ApplyTrace(lib_ams::FStream &stream, algo_lib::Regx ®x, bool enable); - - // Enable or disable logcat tracing based on regex WHAT - // If TRACE is specified, logcats matching regex are enabled; otherwise - // they are disabled. - // This affects all future `prlog_cat` calls. - // Return number of matches - int ApplyTrace(algo::strptr what, bool enable); - - // Same as ApplyTrace, but - // If expression doesn't match anything, print a helpful message for the user - void ApplyTraceV(algo::strptr what, bool enable); - - // prlog hook for ams application, could be used for sending log messages to output stream - void Prlog(algo_lib::FLogcat *logcat, algo::SchedTime tstamp, strptr str); + void AddReadShmember(ams::ShmId shm_id, ams::ProcId proc_id); + + // Open shm SHM for reading and add it to the list of shms + // which lib_ams scans for messages (i.e. control shms). + // Attach lib_ams message dispatch to the shm + bool AddCtlIn(lib_ams::FShm &shm); + void CloseAllShms(); + bool EnsureOutput(lib_ams::FShm &outshm, int budget); + + // ------------------------------------------------------------------- + // cpp/lib_ams/shmember.cpp + // + + // If the shm is open for reading, check to see if a message + // is available. If it is available, return pointer to message. + ams::Shmmsg *PeekMsg(lib_ams::FShmember &shmember); + + // Called by the client + // to avoid reading current message + void StopReading(lib_ams::FShm &shm); + + // Read up to N messages from the message heap + // Messages are processed in the order in which they were posted to the shms. + // (user-implemented function, prototype is in amc-generated header) + // void bh_shmember_read_Step(); // fstep:lib_ams.FDb.bh_shmember_read + + // Check all shms (that are not already readable) for readability and + // transfer readable shms to the read heap with correct sort key. + // If powersave is enabled, then non-readable shms + // are transferred to the slow_poll_read list where they are polled less frequently + // void cd_poll_read_Step(); // fstep:lib_ams.FDb.cd_poll_read + // void cd_slow_poll_read_Step(); // fstep:lib_ams.FDb.cd_slow_poll_read + + // Mark current message as read and move to the next message. + void SkipMsg(lib_ams::FShmember &shmember); + + // Send heartbeat to control shm + void SendHb(lib_ams::FShmember &shmember); + + // Publish shm heartbeats to c_shm_ctl shm + // (user-implemented function, prototype is in amc-generated header) + // void cd_hb_Step(); // fstep:lib_ams.FDb.cd_hb + + // Create a read shmember for shm SHM + // Begin hot-polling the shm + bool OpenRead(lib_ams::FShm &shm, u64 off); + + // Create a write shmember for shm SHM + bool OpenWrite(lib_ams::FShm &shm, u64 off); + void UnreadMsg(); + + // ------------------------------------------------------------------- + // include/lib_ams.inl.h + // + inline u64 AddOffset(u64 offset, int n); + inline ams::Shmmsg *MsgAtOffset(lib_ams::FShm &shm, u64 offset); + + // next_ackoff is the read offset at which an unconditional + // Shmhb is sent out. It is enabled when the shm is being read. + inline void UpdateAckOffset(lib_ams::FShm &shm, lib_ams::FShmember &shmember); + inline ams::ProcId MakeProcId(ams::Proctype proctype, int node, int index); + inline u64 GetWriteBudget(lib_ams::FShm &shm); } + +#include "include/lib_ams.inl.h" diff --git a/include/lib_ams.inl.h b/include/lib_ams.inl.h new file mode 100644 index 00000000..193e87e8 --- /dev/null +++ b/include/lib_ams.inl.h @@ -0,0 +1,52 @@ +// 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: lib_ams (lib) -- Library for AMS middleware, supporting file format & messaging +// Exceptions: yes +// Header: include/lib_ams.inl.h +// +// ----------------------------------------------------------------------------- +// The length field of a message must reside entirely within one cache line, +// or the sfence/lfence instructions won't behave as expected. +// So, we force each message to start at an address that'a a multiple of machine +// cache line size. + +inline u64 lib_ams::AddOffset(u64 offset, int n) { + return (offset + n + 63) & ~63; +} + +inline ams::Shmmsg *lib_ams::MsgAtOffset(lib_ams::FShm &shm, u64 offset) { + offset = offset & shm.offset_mask; + return (ams::Shmmsg*)(shm.shm_region.elems + offset); +} + +// next_ackoff is the read offset at which an unconditional +// Shmhb is sent out. It is enabled when the shm is being read. +inline void lib_ams::UpdateAckOffset(lib_ams::FShm &shm, lib_ams::FShmember &shmember) { + shm.next_ackoff = shmember.off + shm.offset_mask / 8; +} + +inline ams::ProcId lib_ams::MakeProcId(ams::Proctype proctype, int node, int index) { + ams::ProcId ret; + proctype_Set(ret,proctype); + nodeidx_Set(ret,node); + procidx_Set(ret,index); + return ret; +} + +inline u64 lib_ams::GetWriteBudget(lib_ams::FShm &shm) { + return algo::u64_SubClip(shm.writelimit, shm.c_write->off); +} diff --git a/include/lib_ctype.h b/include/lib_ctype.h index 620ba675..dbad92b4 100644 --- a/include/lib_ctype.h +++ b/include/lib_ctype.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2023 Astra // Copyright (C) 2017-2019 NYSE | Intercontinental Exchange // diff --git a/include/lib_curl.h b/include/lib_curl.h new file mode 100644 index 00000000..45f3e575 --- /dev/null +++ b/include/lib_curl.h @@ -0,0 +1,39 @@ +// 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: lib_curl (lib) -- covers curl_easy +// Exceptions: yes +// Header: include/lib_curl.h +// + +#include "include/gen/lib_curl_gen.h" +#include "include/gen/lib_curl_gen.inl.h" + +namespace lib_curl { // update-hdr + // Dear human: + // Text from here to the closing curly brace was produced by scanning + // source files. Editing this text is futile. + // To refresh the contents of this section, run 'update-hdr'. + // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. + + // ------------------------------------------------------------------- + // cpp/lib/lib_curl.cpp + // + + // ----------------- Public API ----------------- + bool Curl(lib_curl::FRequest &req, lib_curl::FResponse &out_resp); + tempstr PrintCurlResp(lib_curl::FResponse &resp, bool nodate = false); +} diff --git a/include/lib_exec.h b/include/lib_exec.h index e4c3f752..32e70cad 100644 --- a/include/lib_exec.h +++ b/include/lib_exec.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2013-2019 NYSE | Intercontinental Exchange // // License: GPL @@ -34,7 +34,8 @@ namespace lib_exec { // update-hdr // ------------------------------------------------------------------- // cpp/lib/lib_exec.cpp // - i64 execkey_Get(lib_exec::FSyscmd &cmd); + // (user-implemented function, prototype is in amc-generated header) + // i64 execkey_Get(lib_exec::FSyscmd &cmd); // Spawn process associated with command. // If the command was started successfully, its pid can be diff --git a/include/lib_fm.h b/include/lib_fm.h index bd4c2f4f..748d9392 100644 --- a/include/lib_fm.h +++ b/include/lib_fm.h @@ -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 diff --git a/include/lib_git.h b/include/lib_git.h index 2985cea0..3b48fe9e 100644 --- a/include/lib_git.h +++ b/include/lib_git.h @@ -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/include/lib_http.h b/include/lib_http.h new file mode 100644 index 00000000..084f9d48 --- /dev/null +++ b/include/lib_http.h @@ -0,0 +1,72 @@ +// Copyright (C) 2024,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: lib_http (lib) -- Library for HTTP support +// Exceptions: yes +// Header: include/lib_http.h +// +// This source code constitutes confidential information and trade secrets +// of AlgoRND. Unauthorized copying, distribution or sharing of this file, +// via any medium, is strictly prohibited. + +#include "include/gen/lib_http_gen.h" +#include "include/gen/lib_http_gen.inl.h" +#include "include/gen/http_gen.h" +#include "include/gen/http_gen.inl.h" + +namespace lib_http { + // comma-separated token list (with optional whitespace around commas) + struct List_curs { + typedef strptr ChildType ; + strptr elem; + strptr rest; + }; +} + +namespace lib_http { // update-hdr + // Dear human: + // Text from here to the closing curly brace was produced by scanning + // source files. Editing this text is futile. + // To refresh the contents of this section, run 'update-hdr'. + // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. + + // ------------------------------------------------------------------- + // cpp/lib_http/lib_http.cpp + // + void List_curs_Next(List_curs &curs); + void List_curs_Reset(List_curs &curs, strptr list); + bool List_curs_ValidQ(List_curs &curs); + strptr &List_curs_Access(List_curs &curs); + + // Whether http list contains token + bool ListContainsQ(strptr list, strptr token); + + // Get single line of HTTP ptotocol + bool DecodeLine(strptr &buf, strptr &result); + + // decode HTTP request + bool DecodeRequest(strptr &buf, http::Request &request); + + // Add request header + bool SetRequestHeader(http::Request &request, strptr name, strptr value); + + // Encode HTTP response + void EncodeResponse(cstring &buf, http::Response &response); + + // Get HTTP message length + // TODO content-length, chunked + i32 GetMsgLen(strptr buf); +} diff --git a/include/lib_iconv.h b/include/lib_iconv.h index 6b6d415c..250a2990 100644 --- a/include/lib_iconv.h +++ b/include/lib_iconv.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2013-2019 NYSE | Intercontinental Exchange // // License: GPL diff --git a/include/lib_json.h b/include/lib_json.h index 85b89b15..7b0a7008 100644 --- a/include/lib_json.h +++ b/include/lib_json.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2020-2021 Astra // Copyright (C) 2014-2019 NYSE | Intercontinental Exchange // @@ -59,11 +59,19 @@ namespace lib_json { // update-hdr // TYPE node type // VALUE node value where applicable (only for field, string, number) lib_json::FNode &NewNode(lib_json::FNode *parent, lib_json_FNode_type_Enum type); + + // PARENT parent node or NULL + // TYPE node type + // VALUE node value where applicable (only for field, string, number) + // Construct 2 nodes, a "field" node which has the name FIELD, and its value + // of type TYPE. Return the VALUE + lib_json::FNode &NewFieldVal(lib_json::FNode *parent, lib_json_FNode_type_Enum type, strptr field); lib_json::FNode &NewFieldNode(lib_json::FNode *parent, strptr field); lib_json::FNode &NewObjectNode(lib_json::FNode *parent, strptr field = strptr()); lib_json::FNode &NewArrayNode(lib_json::FNode *parent, strptr field = strptr()); lib_json::FNode &NewStringNode(lib_json::FNode *parent, strptr field = strptr(), strptr value = strptr()); lib_json::FNode &NewNumberNode(lib_json::FNode *parent, strptr field = strptr(), strptr value = strptr("0")); + lib_json::FNode &NewBoolNode(lib_json::FNode *parent, strptr field = strptr(), bool value = true); // Parses JSON text into tree structure according to ECMA-404 // can be invoked repeadetly with new data portions (can be used directly as read hook) @@ -80,7 +88,8 @@ namespace lib_json { // update-hdr bool JsonParse(lib_json::FParser &parser, strptr buf); // AMC cleanup function - automatically delete parsed JSON tree - void root_node_Cleanup(lib_json::FParser& parent); + // (user-implemented function, prototype is in amc-generated header) + // void root_node_Cleanup(lib_json::FParser& parent); // fcleanup:lib_json.FParser.root_node // encode json string // "The representation of strings is similar to conventions used in the C @@ -90,17 +99,18 @@ namespace lib_json { // update-hdr // quotation mark, reverse solidus, and the control characters (U+0000 // through U+001F)." // -- this says that solidus need not be escaped when printing -- only when parsing! - void JsonSerializeString(algo::strptr str, algo::cstring &lhs); + void JsonSerializeString(algo::strptr str, algo::cstring &out); // Serialize to string // Serialize to JSON tree to text // NODE root node to start from - // LHS target string - // PRETTY whether or not pretty-format + // OUT target string + // PRETTY pretty printer setting: + // 0 = no pretty printer (compact output) + // 1 = algo style pretty printer + // 2 = standard (jq) style) pretty printer // INDENT level of indenting (for pretty-formatting) - void JsonSerialize(lib_json::FNode* node, cstring &lhs, bool pretty, u32 indent); - void JsonSerialize(lib_json::FNode* node, cstring &lhs, bool pretty); - void JsonSerialize(lib_json::FNode* node, cstring &lhs); + void JsonSerialize(lib_json::FNode* node, cstring &out, u32 pretty = 0, u32 indent = 0); // Find node in object chain // PARENT node to start from @@ -130,7 +140,25 @@ namespace lib_json { // update-hdr // PARENT node to start from // PATH dot-separated list of field keys u32 u32_Get(lib_json::FNode* parent, strptr path, int dflt = 0); - lib_json::FldKey fldkey_Get(lib_json::FNode &node); + + // Get node value as u32 + // If the path is not found, or the value is malformatted, DFLT is returned. + // true/false is converted to 0/1 + // + // PARENT node to start from + // PATH dot-separated list of field keys + u32 i32_Get(lib_json::FNode* parent, strptr path, int dflt = 0); + + // Get node value as bool + // number is converted: zero - false, nonzero true + // empty string - false, non-empty string true + // On any error, DFLT is returned. + // + // PARENT node to start from + // PATH dot-separated list of field keys + u32 bool_Get(lib_json::FNode* parent, strptr path, int dflt = false); + // (user-implemented function, prototype is in amc-generated header) + // lib_json::FldKey fldkey_Get(lib_json::FNode &node); // ------------------------------------------------------------------- // include/lib_json.inl.h diff --git a/include/lib_json.inl.h b/include/lib_json.inl.h index faf97061..84dde866 100644 --- a/include/lib_json.inl.h +++ b/include/lib_json.inl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2014-2019 NYSE | Intercontinental Exchange // // License: GPL diff --git a/include/lib_mysql.h b/include/lib_mysql.h index 87f8a77a..7c79b9ab 100644 --- a/include/lib_mysql.h +++ b/include/lib_mysql.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2023 Astra // Copyright (C) 2013-2019 NYSE | Intercontinental Exchange // Copyright (C) 2008-2013 AlgoEngineering LLC @@ -58,6 +58,7 @@ namespace lib_mysql { // update-hdr // "Commands out of sync; you can't run this command now" // error void MQuery(MYSQL *conn, strptr query, lib_mysql::Res &res); - void mysql_Cleanup(); - void res_Cleanup(lib_mysql::Res &res); + // (user-implemented function, prototype is in amc-generated header) + // void mysql_Cleanup(); // fcleanup:lib_mysql.FDb.mysql + // void res_Cleanup(lib_mysql::Res &res); // fcleanup:lib_mysql.Res.res } diff --git a/include/lib_netio.h b/include/lib_netio.h new file mode 100644 index 00000000..daa1cb6f --- /dev/null +++ b/include/lib_netio.h @@ -0,0 +1,153 @@ +// Copyright (C) 2024,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: lib_netio (lib) -- Network I/O library +// Exceptions: yes +// Header: include/lib_netio.h +// +// This source code constitutes confidential information and trade secrets +// of AlgoRND. Unauthorized copying, distribution or sharing of this file, +// via any medium, is strictly prohibited. + +#include "include/gen/lib_netio_gen.h" +#include "include/gen/lib_netio_gen.inl.h" + +#include +#include +#include +#include +#include + +namespace lib_netio { // update-hdr + // Dear human: + // Text from here to the closing curly brace was produced by scanning + // source files. Editing this text is futile. + // To refresh the contents of this section, run 'update-hdr'. + // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. + + // ------------------------------------------------------------------- + // cpp/lib_netio/socket.cpp + // + + // Create TCP socket + algo::Fildes CreateTcpSocket(); + + // Create UDP socket + algo::Fildes CreateUdpSocket(); + + // Create Netlink socket + algo::Fildes CreateNetlinkSocket(); + + // Wrapper for bind() -- Ipport + bool Bind(algo::Fildes sock, ietf::Ipport ipport); + + // Wrapper for bind() -- strptr + bool Bind(algo::Fildes sock, strptr addr); + + // Wrapper for bind to netlink + bool BindNetlink(algo::Fildes sock); + + // send GETLINK netlink request + bool RequestLinkDump(algo::Fildes sock); + + // Wrapper for listen() -- strptr + bool Listen(algo::Fildes sock, int backlog); + + // Wrapper for connect() -- ipport + bool Connect(algo::Fildes sock, ietf::Ipport ipport); + + // Wrapper for connect() -- strptr + int Connect(algo::Fildes sock, strptr addr); + + // accept remote connection: + // return connection socket and fills ipport with client address/port + algo::Fildes Accept(algo::Fildes listen_sock, ietf::Ipport &ipport); + + // Get socket error -- getsockopt(SO_ERROR); + // in case of getsockopt failure, return errno + int GetSocketError(algo::Fildes sock); + + // Wrapper for setsockopt(SO_REUSEADDR) + bool SetReuseAddress(algo::Fildes sock, bool value = true); + + // Wrapper for setsockopt(TCP_NODELAY) + bool SetTcpNoDelay(algo::Fildes sock, bool value = true); + + // Wrapper for setsockopt(SO_LINGER) - timeout in seconds to drain output buffers before close(). + // set 0 to drop connection with RST. + bool SetLinger(algo::Fildes sock, algo::UnixDiff timeout = algo::UnixDiff()); + + // Set TCP keepalive + bool SetTcpKeepalive(algo::Fildes sock, bool on = true, algo::UnixDiff idle = algo::UnixDiff(2), algo::UnixDiff interval = algo::UnixDiff(2), int max_probes = 5); + + // Set send buffer size -- setsockopt(SO_SNDBUF) + bool SetSendBufferSize(algo::Fildes sock, int size); + + // Set receive buffer size -- setsockopt(SO_RCVBUF) + bool SetReceiveBufferSize(algo::Fildes sock, int size); + + // Set multicast loop (enabled by defult) + bool SetMulticastLoop(algo::Fildes sock, bool loop); + + // Set multicast TTL + // TTL Scope + // 0 Restricted to the same host. Won't be output by any interface. + // 1 Restricted to the same subnet. Won't be forwarded by a router. This is the default. + // <32 Restricted to the same site, organization or department. + // <64 Restricted to the same region. + // <128 Restricted to the same continent. + // <255 Unrestricted in scope. Global. + bool SetMulticastTtl(algo::Fildes sock, u8 ttl); + + // Join or leave multicast group (on the interface basis!) + bool SetMulticastMembership(algo::Fildes sock, ietf::Ipv4 group, ietf::Ipv4 interface, bool membership); + + // Set multicast send interface (default specified by system administrator) + bool SetMulticastInterface(algo::Fildes sock, ietf::Ipv4 interface); + + // Get local ip/port -- getsockname() + bool GetIpportLocal(algo::Fildes sock, ietf::Ipport &ipport); + + // Get remote ip/port -- getpeername() + bool GetIpportRemote(algo::Fildes sock, ietf::Ipport &ipport); + + // get list of interface names as space-separated string + tempstr GetInterfaces(algo::Fildes sock); + tempstr GetHostAddr(strptr hostname); + + // ioctl with ifreq + bool Ioctl(algo::Fildes sock, strptr name, u32 request, ifreq &ifr); + + // get hardware address for intrface + bool GetHwAddrFamily(algo::Fildes sock, strptr name, sa_family_t &result); + + // get ip address of interface + bool GetIpv4(algo::Fildes sock, strptr name, ietf::Ipv4 &result); + + // find interface name for known ip + tempstr FindInterfaceByIpv4(algo::Fildes sock, ietf::Ipv4 &ip); + + // Resolve ip:port or : to an Ipport struct + ietf::Ipport Resolve(algo::strptr addr); + + // ------------------------------------------------------------------- + // include/lib_netio.inl.h + // + inline bool MulticastQ(ietf::Ipv4 addr); + + // Wrapper for setsockopt + template bool SetSocketOption(algo::Fildes sock, int level, int option, const T &value); +} diff --git a/include/lib_netio.inl.h b/include/lib_netio.inl.h new file mode 100644 index 00000000..19ca178b --- /dev/null +++ b/include/lib_netio.inl.h @@ -0,0 +1,33 @@ +// Copyright (C) 2024,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: lib_netio (lib) -- Network I/O library +// Exceptions: yes +// Header: include/lib_netio.inl.h +// +// This source code constitutes confidential information and trade secrets +// of AlgoRND. Unauthorized copying, distribution or sharing of this file, +// via any medium, is strictly prohibited. +// Check whether IP address is multicast group + +inline bool lib_netio::MulticastQ(ietf::Ipv4 addr) { + return (addr.ipv4 & 0xf0000000) == 0xe0000000; +} + +// Wrapper for setsockopt +template bool lib_netio::SetSocketOption(algo::Fildes sock, int level, int option, const T &value) { + return setsockopt(sock.value, level, option, &const_cast(value), sizeof value) == 0; +} diff --git a/include/lib_rl.h b/include/lib_rl.h new file mode 100644 index 00000000..6a6dd197 --- /dev/null +++ b/include/lib_rl.h @@ -0,0 +1,98 @@ +// 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: lib_rl (lib) -- GNU readline support library +// Exceptions: yes +// Header: include/lib_rl.h +// + +#include "include/gen/lib_rl_gen.h" +#include "include/gen/lib_rl_gen.inl.h" + +namespace lib_rl { // update-hdr + // Dear human: + // Text from here to the closing curly brace was produced by scanning + // source files. Editing this text is futile. + // To refresh the contents of this section, run 'update-hdr'. + // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. + + // ------------------------------------------------------------------- + // cpp/lib_rl/lib_rl.cpp + // + + // compose history file name + tempstr HistoryFile(strptr app); + + // initialize history from file + // TODO lock + void InitHistory(); + + // get last history line, empty if none + strptr LastHistory(); + + // add line to history + void AddHistory(strptr line); + + // prlog handler - safe print when redline is active + void Prlog(algo_lib::FLogcat *logcat, algo::SchedTime time, strptr str); + + // setup own prlog function + void RedirectPrlog(); + + // restore prlog function + void RestorePrlog(); + + // whether the line is valid + bool LineValidQ(); + + // whether EOF + bool EofQ(); + + // stream error + int Error(); + + // whether realine in substate - not bare chars + bool SubstateQ(); + + // whether mode is readline or normal + bool ReadlineQ(); + void SetPrompt(algo::strptr prompt); + + // switch mode 0 - normal, 1 - readline + void SwitchMode(int mode); + + // get line + strptr GetLine(); + + // called inside rl_callback_read_char() when new input line entered + void OnLine(char *zline); + + // Skip current line + void SkipLine(); + + // Kill entire buffer + void KillBuffer(); + + // begin readline, user shall add own iohook function + void BeginReadline(strptr app, strptr prompt); + + // stop reading readline + void EndReadline(); + + // restore terminal settings + // (user-implemented function, prototype is in amc-generated header) + // void iohook_Cleanup(); // fcleanup:lib_rl.FDb.iohook +} diff --git a/include/lib_sql.h b/include/lib_sql.h index a05f5bed..225363c0 100644 --- a/include/lib_sql.h +++ b/include/lib_sql.h @@ -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/include/lib_sqlite.h b/include/lib_sqlite.h index 2eae02e1..33dd74ff 100644 --- a/include/lib_sqlite.h +++ b/include/lib_sqlite.h @@ -1,3 +1,4 @@ +// Copyright (C) 2026 AlgoRND // Copyright (C) 2023 Astra // // License: GPL @@ -38,7 +39,8 @@ namespace lib_sqlite { // update-hdr // cpp/lib_sqlite/lib_sqlite.cpp // int Open(lib_sqlite::FConn& conn); - void db_Cleanup(lib_sqlite::FConn &parent); + // (user-implemented function, prototype is in amc-generated header) + // void db_Cleanup(lib_sqlite::FConn &parent); // fcleanup:lib_sqlite.FConn.db void Init(); // ------------------------------------------------------------------- diff --git a/include/lib_ws.h b/include/lib_ws.h new file mode 100644 index 00000000..3a5bc695 --- /dev/null +++ b/include/lib_ws.h @@ -0,0 +1,84 @@ +// Copyright (C) 2023-2024,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: lib_ws (lib) -- WebSocket library +// Exceptions: yes +// Header: include/lib_ws.h +// +// This source code constitutes confidential information and trade secrets +// of AlgoRND. Unauthorized copying, distribution or sharing of this file, +// via any medium, is strictly prohibited. + +#include "include/gen/lib_ws_gen.h" +#include "include/gen/lib_ws_gen.inl.h" + +#include "include/gen/ws_gen.h" +#include "include/gen/ws_gen.inl.h" + +#include "include/gen/http_gen.h" +#include "include/gen/http_gen.inl.h" + +namespace ws { // update-hdr + // Dear human: + // Text from here to the closing curly brace was produced by scanning + // source files. Editing this text is futile. + // To refresh the contents of this section, run 'update-hdr'. + // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. + + // ------------------------------------------------------------------- + // cpp/lib_ws/lib_ws.cpp + // + cstring &operator<<(cstring &lhs, const ws::FrameHeader &rhs); + // (user-implemented function, prototype is in amc-generated header) + // u32 payload_N(const ws::Frame& parent); // field:ws.FrameMasked.payload + // u32 payload_N(const ws::FrameMasked& parent); // field:ws.FrameMasked.payload + ws::Frame *Frame_Castdown(ws::FrameHeader &hdr); + ws::FrameMasked *FrameMasked_Castdown(ws::FrameHeader &hdr); + bool FrameHeaderMsgs_ReadStrptrMaybe2(algo::strptr str, algo::ByteAry &buf); + void FrameHeaderMsgs_Print2(algo::cstring &str, ws::FrameHeader &msg); +} + +namespace lib_ws { // update-hdr + // Dear human: + // Text from here to the closing curly brace was produced by scanning + // source files. Editing this text is futile. + // To refresh the contents of this section, run 'update-hdr'. + // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. + + // ------------------------------------------------------------------- + // cpp/lib_ws/lib_ws.cpp + // + ws::FrameHeader *FrameHeader_FmtByteAry(algo::ByteAry &buf, bool fin, bool rsv1, bool rsv2, bool rsv3, ws::Opcode opcode, bool mask, u32 masking_key, strptr payload); + // (user-implemented function, prototype is in amc-generated header) + // void FrameLen_Frame16(i32 &len, ws::Frame16 &frame, u32 msg_len); // dispatch_msg:lib_ws.FrameLen/ws.Frame16 + // void FrameLen_FrameMasked16(i32 &len, ws::FrameMasked16 &frame, u32 msg_len); // dispatch_msg:lib_ws.FrameLen/ws.FrameMasked16 + // void FrameLen_Frame64(i32 &len, ws::Frame64 &frame, u32 msg_len); // dispatch_msg:lib_ws.FrameLen/ws.Frame64 + // void FrameLen_FrameMasked64(i32 &len, ws::FrameMasked64 &frame, u32 msg_len); // dispatch_msg:lib_ws.FrameLen/ws.FrameMasked64 + // int FrameLen_Unkmsg(i32 &len, ws::FrameHeader &hdr, u32 msg_len); // dispatch:lib_ws.FrameLen + i32 GetMsgLen(algo::memptr buf); + void ToggleMasking(strptr payload, u32 masking_key); + // (user-implemented function, prototype is in amc-generated header) + // void FrameIdx_Frame16(lib_ws::FrameIdx &idx, ws::Frame16 &frame, u32); // dispatch_msg:lib_ws.FrameIdx/ws.Frame16 + // void FrameIdx_FrameMasked16(lib_ws::FrameIdx &idx, ws::FrameMasked16 &frame, u32); // dispatch_msg:lib_ws.FrameIdx/ws.FrameMasked16 + // void FrameIdx_Frame64(lib_ws::FrameIdx &idx, ws::Frame64 &frame, u32); // dispatch_msg:lib_ws.FrameIdx/ws.Frame64 + // void FrameIdx_FrameMasked64(lib_ws::FrameIdx &idx, ws::FrameMasked64 &frame, u32); // dispatch_msg:lib_ws.FrameIdx/ws.FrameMasked64 + // int FrameIdx_Unkmsg(lib_ws::FrameIdx &idx, ws::FrameHeader &hdr, u32); // dispatch:lib_ws.FrameIdx + void ToggleMasking(ws::FrameHeader &frame, bool reset_key); + strptr payload_Getary(ws::FrameHeader &frame); + + // Compute Sec-WebSocket-Accept from Sec-WebSocket-Key + tempstr ComputeSecWebSocketAccept(strptr sec_websocket_key); +} diff --git a/include/ams_cat.h b/include/mdbg.h similarity index 75% rename from include/ams_cat.h rename to include/mdbg.h index d0f09dcf..401b1c78 100644 --- a/include/ams_cat.h +++ b/include/mdbg.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2025-2026 AlgoRND // // License: GPL // This program is free software: you can redistribute it and/or modify @@ -14,16 +14,14 @@ // 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 -// Header: include/ams_cat.h +// Target: mdbg (exe) -- Gdb front-end +// Exceptions: NO +// Header: include/mdbg.h // #include "include/algo.h" -#include "include/gen/ams_cat_gen.h" -#include "include/gen/ams_cat_gen.inl.h" -namespace ams_cat { // update-hdr +namespace mdbg { // update-hdr // Dear human: // Text from here to the closing curly brace was produced by scanning // source files. Editing this text is futile. @@ -31,7 +29,12 @@ namespace ams_cat { // update-hdr // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. // ------------------------------------------------------------------- - // cpp/ams/ams_cat.cpp + // cpp/mdbg/mdbg.cpp // - void Main(); + + // Generate gdb script + // + void Main_Gdb(algo_lib::Replscope &R); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:mdbg } diff --git a/include/orgfile.h b/include/orgfile.h index b4bf48ba..78f23915 100644 --- a/include/orgfile.h +++ b/include/orgfile.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2020-2021 Astra // // License: GPL @@ -62,5 +62,6 @@ namespace orgfile { // update-hdr void MoveFile(strptr pathname); bool RawMove(strptr line); bool RawDedup(strptr line); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:orgfile } diff --git a/include/samp_make.h b/include/samp_make.h new file mode 100644 index 00000000..a6cf98b4 --- /dev/null +++ b/include/samp_make.h @@ -0,0 +1,37 @@ +// Copyright (C) 2023-2024,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: samp_make (exe) -- sample program for Makefile management +// Exceptions: yes +// Header: include/samp_make.h +// + +#include "include/gen/samp_make_gen.h" +#include "include/gen/samp_make_gen.inl.h" + +namespace samp_make { // update-hdr + // Dear human: + // Text from here to the closing curly brace was produced by scanning + // source files. Editing this text is futile. + // To refresh the contents of this section, run 'update-hdr'. + // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. + + // ------------------------------------------------------------------- + // cpp/samp_make/samp_make.cpp + // + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:samp_make +} diff --git a/include/samp_meng.h b/include/samp_meng.h index 93636dec..73b8f58f 100644 --- a/include/samp_meng.h +++ b/include/samp_meng.h @@ -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 @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . // -// Target: samp_meng (exe) +// Target: samp_meng (exe) -- Sample matching engine // Exceptions: yes -// Header: include/samp_meng.h +// Header: include/samp_meng.h -- Main header // #include "include/gen/samp_meng_gen.h" @@ -30,16 +30,16 @@ namespace samp_meng { // update-hdr // To convert this section to a hand-written section, remove the word 'update-hdr' from namespace line. // ------------------------------------------------------------------- - // cpp/samp_meng/samp_meng.cpp + // cpp/samp_meng/samp_meng.cpp -- Main source // // (user-implemented function, prototype is in amc-generated header) - // void In_TextMsg(samp_meng::TextMsg &); + // void In_TextMsg(samp_meng::TextMsg &); // dispatch_msg:samp_meng.In/samp_meng.TextMsg // Create new symbol - // void In_NewSymbolReqMsg(samp_meng::NewSymbolReqMsg &msg); + // void In_NewSymbolReqMsg(samp_meng::NewSymbolReqMsg &msg); // dispatch_msg:samp_meng.In/samp_meng.NewSymbolReqMsg // Create new user. - // void In_NewUserReqMsg(samp_meng::NewUserReqMsg &msg); + // void In_NewUserReqMsg(samp_meng::NewUserReqMsg &msg); // dispatch_msg:samp_meng.In/samp_meng.NewUserReqMsg // Add an order to the orderbook. // Publish any resulting trades; If order is IOC, cancel the remainder back, @@ -49,20 +49,20 @@ namespace samp_meng { // update-hdr // PRICE: order price // QTY: signed quantity; positive=buy, negative=sell // IOC: if TRUE, order is cancelled immediately after matching - // void In_NewOrderReqMsg(samp_meng::NewOrderReqMsg &msg); + // void In_NewOrderReqMsg(samp_meng::NewOrderReqMsg &msg); // dispatch_msg:samp_meng.In/samp_meng.NewOrderReqMsg // Cancel a single order void CancelOrder(samp_meng::FOrder *order, bool notify); // Cancel a single order // (user-implemented function, prototype is in amc-generated header) - // void In_CancelReqMsg(samp_meng::CancelReqMsg &msg); + // void In_CancelReqMsg(samp_meng::CancelReqMsg &msg); // dispatch_msg:samp_meng.In/samp_meng.CancelReqMsg // Cancel all orders for user - // void In_MassCancelReqMsg(samp_meng::MassCancelReqMsg &msg); - // void cd_fdin_eof_Step(); + // void In_MassCancelReqMsg(samp_meng::MassCancelReqMsg &msg); // dispatch_msg:samp_meng.In/samp_meng.MassCancelReqMsg + // void cd_fdin_eof_Step(); // fstep:samp_meng.FDb.cd_fdin_eof // Read next input line from stdin - // void cd_fdin_read_Step(); - void Main(); + // void cd_fdin_read_Step(); // fstep:samp_meng.FDb.cd_fdin_read + // void Main(); // main:samp_meng } diff --git a/include/samp_regx.h b/include/samp_regx.h index 4d2a2e3a..4cf45017 100644 --- a/include/samp_regx.h +++ b/include/samp_regx.h @@ -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 @@ -33,5 +33,6 @@ namespace samp_regx { // update-hdr // ------------------------------------------------------------------- // cpp/samp_regx/samp_regx.cpp // - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:samp_regx } diff --git a/include/sandbox.h b/include/sandbox.h index 32b9f04d..258f26c2 100644 --- a/include/sandbox.h +++ b/include/sandbox.h @@ -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 @@ -36,5 +36,6 @@ namespace sandbox { // update-hdr void ResetSandbox(sandbox::FSandbox &sandbox); void AcrApply(algo::strptr script, algo::strptr op); void ListSandbox(); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:sandbox } diff --git a/include/sha.h b/include/sha.h index 922a06de..df196ca2 100644 --- a/include/sha.h +++ b/include/sha.h @@ -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/include/src_func.h b/include/src_func.h index b0d1443c..f4340afe 100644 --- a/include/src_func.h +++ b/include/src_func.h @@ -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 // @@ -37,6 +37,7 @@ namespace src_func { // update-hdr // cpp/src_func/edit.cpp -- Implementation of -e // void Main_EditFunc(); + void Main_CreateMissing(); // ------------------------------------------------------------------- // cpp/src_func/fileloc.cpp -- Location in file, for each function @@ -94,13 +95,17 @@ namespace src_func { // update-hdr // Check if line contains function start // Criteria are: // - first character nonblank + // - has parentheses // - last nonblank character is { // - it's not namespace, enum or struct bool FuncstartQ(strptr line, strptr trimmedline); // Extract function namespace name // void *ns::blah(arg1, arg2) -> ns - strptr GetFuncNs(strptr funcname); + tempstr GetFuncNs(src_func::FFunc &func); + + // Filter functions based on parameters provided on command line. + bool MatchFuncQ(src_func::FFunc &func); // Get srcfile filter from update-hdr line. // If none specified, use % @@ -108,9 +113,23 @@ namespace src_func { // update-hdr // extract namespace name from a line like 'namespace xyz {' strptr Nsline_GetNamespace(strptr str); + void RewriteOpts(); + + // Calculate a set of prefixes & suffixes (together:affixes) + // which "look like generated code" + // We will not generate prototypes for functions that look like generated code + // (this is a heuristic, not a hard rule, but it saves hours of debugging when it works) + // The reason is that if something changes in the underlying table where the userfunc + // no longer gets generated (and thus expected) by amc, the user function should trigger + // a compile error from lack of prototype. + // Also, for each prototype that we refused to generate because a function matched + // a known gen affix, we add a comment to the include file. + void CalcGenaffix(); + src_func::FGenaffix *FindAffix(strptr cppname); // Main - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:src_func // ------------------------------------------------------------------- // cpp/src_func/nextfile.cpp -- Find next file in target diff --git a/include/ssimfilt.h b/include/ssimfilt.h index 05f253e4..40c9ed14 100644 --- a/include/ssimfilt.h +++ b/include/ssimfilt.h @@ -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,5 +56,6 @@ namespace ssimfilt { // update-hdr void Table_Save(algo::Tuple &tuple); void MDTable_Save(algo::Tuple &tuple); void Table_Flush(); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:ssimfilt } diff --git a/include/strconv.h b/include/strconv.h index 71080e10..4dd81d00 100644 --- a/include/strconv.h +++ b/include/strconv.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2024,2026 AlgoRND // Copyright (C) 2018-2019 NYSE | Intercontinental Exchange // // License: GPL @@ -35,5 +35,6 @@ namespace strconv { // update-hdr // ------------------------------------------------------------------- // cpp/strconv/strconv.cpp // - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:strconv } diff --git a/include/sv2ssim.h b/include/sv2ssim.h index 8538bf53..5dda3fcd 100644 --- a/include/sv2ssim.h +++ b/include/sv2ssim.h @@ -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 @@ -59,5 +59,6 @@ namespace sv2ssim { // update-hdr // With , -> use csv output files // With other separators, strip separator character from token before printing tempstr CurlineToString(); - void Main(); + // (user-implemented function, prototype is in amc-generated header) + // void Main(); // main:sv2ssim } diff --git a/include/sysincl.h b/include/sysincl.h index 341ff1ac..ab27de72 100644 --- a/include/sysincl.h +++ b/include/sysincl.h @@ -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/include/typedef.h b/include/typedef.h index 4648de47..506df70d 100644 --- a/include/typedef.h +++ b/include/typedef.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2020-2023 Astra // Copyright (C) 2017-2019 NYSE | Intercontinental Exchange // @@ -44,18 +44,13 @@ typedef unsigned int u32; typedef float f32; typedef double f64; typedef long double f80; -#if defined(WIN32) +#ifdef WIN32 typedef __int64 i64; typedef i64 ssize_t; typedef unsigned __int64 u64; #else -#if defined(__LP64__) || defined(_LP64) || defined(__x86_64__) typedef unsigned long u64; typedef signed long i64; -#else -typedef unsigned long long u64; -typedef signed long long i64; -#endif #endif typedef i64 int_ptr; typedef u64 uint_ptr; @@ -79,7 +74,6 @@ namespace algo { struct ImrowPtr; struct Tuple; struct SchedTime; - typedef void (*TuplecmdFcn)(Tuple&); typedef void(*InitFcn)(void* str); typedef bool(*SetnumFcn)(void* str, i64 num); typedef i64(*Geti64Fcn)(void* str, bool &out_ok); @@ -92,18 +86,27 @@ namespace algo { typedef void (*ImrowXrefXFcn)(algo::ImrowPtr); typedef int (*ImrowNItemsFcn)(); typedef void (*ImrowPrintFcn)(algo::ImrowPtr data, algo::cstring &lhs); - typedef algo::ImrowPtr (*ImrowGetElemFcn)(algo::memptr pkey); typedef algo::ImrowPtr (*ImrowRowidFindFcn)(int i); template struct aryptr { - typedef T ValueType; + typedef T ValueType; T *elems; i32 n_elems; aryptr(const T *e, i32 in_n); - aryptr(const char *e); aryptr(); - T &operator [](u32 idx) const; + T &operator [](u32 idx) const; + }; + // specialization for char + template<> struct aryptr { + typedef char ValueType; + char *elems; + i32 n_elems; + + aryptr() : elems(NULL), n_elems(0) {} + aryptr(const char *e) { elems=(char*)e; n_elems=e ? strlen(e) : 0; } + aryptr(const char *e, i32 n) : elems((char*)e), n_elems(n) {} + char &operator [](u32 idx) const { return elems[idx]; } }; } using algo::strptr; diff --git a/include/u128.h b/include/u128.h index c8cc16f2..fabead2d 100644 --- a/include/u128.h +++ b/include/u128.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2020-2021 Astra // // License: GPL diff --git a/include/win32.h b/include/win32.h index e081224c..02f38975 100644 --- a/include/win32.h +++ b/include/win32.h @@ -1,4 +1,4 @@ -// Copyright (C) 2023-2024 AlgoRND +// Copyright (C) 2023-2026 AlgoRND // Copyright (C) 2020-2021 Astra // // License: GPL diff --git a/test/atf_comp/acr.CascDel3 b/test/atf_comp/acr.CascDel3 new file mode 100644 index 00000000..eee4a897 --- /dev/null +++ b/test/atf_comp/acr.CascDel3 @@ -0,0 +1,4 @@ +acr.delete dmmeta.field field:acr.FBltin.base arg:amcdb.Bltin reftype:Base dflt:"" comment:"" + +acr.delete dmmeta.fbase field:acr.FBltin.base stripcomment:Y comment:"" +report.acr n_select:2 n_insert:0 n_delete:2 n_ignore:0 n_update:0 n_file_mod:0 diff --git a/test/atf_comp/acr.RenameField b/test/atf_comp/acr.RenameField index b46a6d3c..4dd74945 100644 --- a/test/atf_comp/acr.RenameField +++ b/test/atf_comp/acr.RenameField @@ -2,5 +2,6 @@ acr.update dmmeta.ns ns:ns1 blah:exe license:GPL comment:"" acr.update dmmeta.ns ns:ns2 blah:ssimdb license:GPL comment:"" acr.update dmmeta.ns ns:ns3 blah:protocol license:GPL comment:"" -acr.update dmmeta.field field:dmmeta.Ns.blah arg:dmmeta.Nstype reftype:Pkey dflt:"" comment:"Namespace type" +acr.delete dmmeta.field field:dmmeta.Ns.nstype +acr.insert dmmeta.field field:dmmeta.Ns.blah arg:dmmeta.Nstype reftype:Pkey dflt:"" comment:"Namespace type" report.acr n_select:4 n_insert:0 n_delete:0 n_ignore:0 n_update:4 n_file_mod:0 diff --git a/test/atf_comp/acr.RenameRecord b/test/atf_comp/acr.RenameRecord index d3027b58..ba9fe661 100644 --- a/test/atf_comp/acr.RenameRecord +++ b/test/atf_comp/acr.RenameRecord @@ -1,7 +1,11 @@ -acr.update dev.target target:xyz +acr.delete dev.target target:samp +acr.insert dev.target target:xyz -acr.update dev.targdep targdep:xyz.algo_lib comment:"" +acr.delete dev.targdep targdep:samp.algo_lib +acr.insert dev.targdep targdep:xyz.algo_lib comment:"" -acr.update dev.targsrc targsrc:xyz/cpp/samp/1.cpp comment:"" -acr.update dev.targsrc targsrc:xyz/cpp/samp/2.cpp comment:"" +acr.delete dev.targsrc targsrc:samp/cpp/samp/1.cpp +acr.insert dev.targsrc targsrc:xyz/cpp/samp/1.cpp comment:"" +acr.delete dev.targsrc targsrc:samp/cpp/samp/2.cpp +acr.insert dev.targsrc targsrc:xyz/cpp/samp/2.cpp comment:"" report.acr n_select:4 n_insert:0 n_delete:0 n_ignore:0 n_update:4 n_file_mod:0 diff --git a/test/atf_comp/acr.TooManyArgs b/test/atf_comp/acr.TooManyArgs index 0f4a0128..7f563c57 100644 --- a/test/atf_comp/acr.TooManyArgs +++ b/test/atf_comp/acr.TooManyArgs @@ -1,2 +1 @@ acr: too many arguments. error at y - diff --git a/test/atf_comp/acr_compl.T10 b/test/atf_comp/acr_compl.T10 index fc19adc7..51fc2e1f 100644 --- a/test/atf_comp/acr_compl.T10 +++ b/test/atf_comp/acr_compl.T10 @@ -9,7 +9,7 @@ -dregx: -dstr: -exec --fconst: +-fconst: -flag -h -help diff --git a/test/atf_comp/acr_ed.CreateMsg b/test/atf_comp/acr_ed.CreateMsg new file mode 100644 index 00000000..1df2b772 --- /dev/null +++ b/test/atf_comp/acr_ed.CreateMsg @@ -0,0 +1,11 @@ +set -e +bin/acr -query:'' -replace:Y -check:Y -selerr:N -write:Y -t:Y << EOF +dmmeta.ctype ctype:ams.AbcMsg comment:"" +dmmeta.field field:ams.AbcMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" +dmmeta.pack ctype:ams.AbcMsg comment:"" +dmmeta.msgtype ctype:ams.AbcMsg type:706 +dmmeta.cpptype ctype:ams.AbcMsg ctor:N dtor:N cheap_copy:N +dmmeta.cfmt cfmt:ams.AbcMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +EOF + +bin/amc diff --git a/test/atf_comp/acr_ed.CreateSrcfileTarget b/test/atf_comp/acr_ed.CreateSrcfileTarget index b0cb75e0..3a05241a 100644 --- a/test/atf_comp/acr_ed.CreateSrcfileTarget +++ b/test/atf_comp/acr_ed.CreateSrcfileTarget @@ -1,8 +1,8 @@ acr_ed.create_srcfile srcfile:cpp/acr_ed/blah.cpp target:algo_lib set -e bin/acr -query:'' -replace:Y -check:Y -selerr:N -write:Y -t:Y << EOF -dev.gitfile gitfile:cpp/acr_ed/blah.cpp dev.targsrc targsrc:algo_lib/cpp/acr_ed/blah.cpp comment:"" +dev.gitfile gitfile:cpp/acr_ed/blah.cpp EOF cat > cpp/acr_ed/blah.cpp << EOF @@ -10,6 +10,8 @@ cat > cpp/acr_ed/blah.cpp << EOF #include "include/algo_lib.h" EOF +mkdir -p cpp/acr_ed/ +touch cpp/acr_ed/blah.cpp git add cpp/acr_ed/blah.cpp -bin/src_hdr -targsrc:algo_lib/% -write +bin/src_hdr -targsrc:algo_lib/% -write -update_copyright # $EDITOR +4 cpp/acr_ed/blah.cpp diff --git a/test/atf_comp/acr_ed.CreateSsimfile b/test/atf_comp/acr_ed.CreateSsimfile new file mode 100644 index 00000000..ea7d9270 --- /dev/null +++ b/test/atf_comp/acr_ed.CreateSsimfile @@ -0,0 +1,20 @@ +set -e +bin/acr -query:'' -replace:Y -check:Y -selerr:N -write:Y -t:Y << EOF +dmmeta.ctype ctype:dmmeta.Xyz comment:"" +dmmeta.field field:dmmeta.Xyz.xyz arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" +dmmeta.ssimfile ssimfile:dmmeta.xyz ctype:dmmeta.Xyz +dmmeta.ssimsort ssimfile:dmmeta.xyz sortfld:dmmeta.Xyz.xyz comment:"" +dmmeta.field field:dmmeta.Xyz.comment arg:algo.Comment reftype:Val dflt:"" comment:"" +dev.gitfile gitfile:data/dmmeta/xyz.ssim +dev.gitfile gitfile:txt/ssimdb/dmmeta/xyz.md +dev.readmefile gitfile:txt/ssimdb/dmmeta/xyz.md inl:N sandbox:N filter:"" comment:"" +dmmeta.cfmt cfmt:dmmeta.Xyz.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +EOF + +mkdir -p data/dmmeta/ +touch data/dmmeta/xyz.ssim +git add data/dmmeta/xyz.ssim +mkdir -p txt/ssimdb/dmmeta/ +touch txt/ssimdb/dmmeta/xyz.md +git add txt/ssimdb/dmmeta/xyz.md +bin/amc diff --git a/test/atf_comp/acr_ed.CreateTarget b/test/atf_comp/acr_ed.CreateTarget new file mode 100644 index 00000000..95d46f4b --- /dev/null +++ b/test/atf_comp/acr_ed.CreateTarget @@ -0,0 +1,84 @@ +acr_ed.create_target target:xyz +set -e +bin/acr -query:'' -replace:Y -check:Y -selerr:N -write:Y -t:Y << EOF +dmmeta.ns ns:xyz nstype:exe license:GPL comment:"" +dmmeta.nsx ns:xyz genthrow:Y correct_getorcreate:Y pool:algo_lib.FDb.malloc sortxref:Y pack:N comment:"" +dmmeta.main ns:xyz ismodule:N +dmmeta.nscpp ns:xyz comment:"" +dev.target target:xyz +dev.gitfile gitfile:cpp/xyz/xyz.cpp +dev.gitfile gitfile:include/xyz.h +dev.gitfile gitfile:cpp/gen/xyz_gen.cpp +dev.gitfile gitfile:include/gen/xyz_gen.h +dev.gitfile gitfile:include/gen/xyz_gen.inl.h +dev.gitfile gitfile:bin/xyz comment:'' +dev.targsrc targsrc:xyz/cpp/xyz/xyz.cpp comment:'' +dev.targsrc targsrc:xyz/include/xyz.h comment:'' +dev.targsrc targsrc:xyz/cpp/gen/xyz_gen.cpp comment:'' +dev.targsrc targsrc:xyz/include/gen/xyz_gen.h comment:'' +dev.targsrc targsrc:xyz/include/gen/xyz_gen.inl.h comment:'' +dev.targdep targdep:xyz.algo_lib comment:'' +dev.targdep targdep:xyz.lib_prot comment:'' +dmmeta.ctype ctype:xyz.FDb comment:'' +dmmeta.field field:xyz.FDb._db arg:xyz.FDb reftype:Global dflt:'' comment:'' +dmmeta.ctype ctype:command.xyz comment:"" +dmmeta.cfmt cfmt:command.xyz.Argv printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" +dmmeta.field field:xyz.FDb.cmdline arg:command.xyz reftype:Val dflt:"" comment:"" +dmmeta.fcmdline field:xyz.FDb.cmdline read:Y basecmdline:algo_lib.FDb.cmdline comment:"" +dmmeta.field field:command.xyz.in arg:algo.cstring reftype:Val dflt:'"data"' comment:"Input directory or filename, - for stdin" +dmmeta.floadtuples field:command.xyz.in comment:"" +dev.gitfile gitfile:txt/exe/xyz/README.md +dev.readmefile gitfile:txt/exe/xyz/README.md inl:N sandbox:N filter:"" comment:"" +dev.gitfile gitfile:txt/exe/xyz/internals.md +dev.readmefile gitfile:txt/exe/xyz/internals.md inl:N sandbox:N filter:"" comment:"" +EOF + +mkdir -p cpp/xyz/ +touch cpp/xyz/xyz.cpp +git add cpp/xyz/xyz.cpp +mkdir -p include/ +touch include/xyz.h +git add include/xyz.h +mkdir -p cpp/gen/ +touch cpp/gen/xyz_gen.cpp +git add cpp/gen/xyz_gen.cpp +mkdir -p include/gen/ +touch include/gen/xyz_gen.h +git add include/gen/xyz_gen.h +mkdir -p include/gen/ +touch include/gen/xyz_gen.inl.h +git add include/gen/xyz_gen.inl.h +mkdir -p cpp/xyz/ +cat > include/xyz.h << EOF +#include "include/gen/xyz_gen.h" +#include "include/gen/xyz_gen.inl.h" + +namespace xyz { // update-hdr +} +EOF + +cat > cpp/xyz/xyz.cpp << EOF +#include "include/algo.h" +#include "include/algo.h" +#include "include/xyz.h" + +void xyz::Main() { + prlog("Hello, World!"); + xyz::MainLoop(); +} +EOF + +bin/amc # make sure */gen/* files are created +ln -s ../build/release/xyz bin/xyz +git add -f bin/xyz +mkdir -p txt/exe/xyz/ +touch txt/exe/xyz/README.md +git add txt/exe/xyz/README.md +mkdir -p txt/exe/xyz/ +touch txt/exe/xyz/internals.md +git add txt/exe/xyz/internals.md +bin/src_hdr -targsrc:xyz/% -write:Y -update_copyright:Y +bin/abt -target:xyz -install:Y +echo 'please execute $(acr_compl -install) to add completions support for new target' +bin/abt_md -readmefile:% -ns:xyz -section:% +bin/amc diff --git a/test/atf_comp/atf_cmdline.Bare b/test/atf_comp/atf_cmdline.Bare index 816d0f91..30b59631 100644 --- a/test/atf_comp/atf_cmdline.Bare +++ b/test/atf_comp/atf_cmdline.Bare @@ -1,3 +1,2 @@ atf_cmdline: Missing value for required argument -astr (see -help) atf_cmdline: Missing value for required argument -str (see -help) - diff --git a/test/atf_comp/atf_cmdline.Help b/test/atf_comp/atf_cmdline.Help index b83aa1ff..2c629db6 100644 --- a/test/atf_comp/atf_cmdline.Help +++ b/test/atf_comp/atf_cmdline.Help @@ -19,15 +19,15 @@ Usage: atf_cmdline [-astr:] [[-anum:]] [[-adbl:]] -str:") 'mdbg-up) (global-set-key (kbd "") 'other-window) (global-set-key (kbd "") 'gdb-restore-windows-full) +(setq gdb-debuginfod-enable-setting "set debuginfod enabled off") (gdb "gdb -i=mi --init-command=temp/mdbg.gdb") diff --git a/test/atf_comp/mdbg.SmokeBreak b/test/atf_comp/mdbg.SmokeBreak index 6bc3af51..8b03c59a 100644 --- a/test/atf_comp/mdbg.SmokeBreak +++ b/test/atf_comp/mdbg.SmokeBreak @@ -1,18 +1,20 @@ bin/abt -target:mdbg -cfg:debug #Gdb script is shown below # This file was generated by mdbg -file build/debug/mdbg -set args mdbg -start set history filename temp/gdb.history set history save on +set debuginfod enabled off set record instruction-history-size 1000000 set record function-call-history-size 100000 set record function-call-history 1000 set confirm off -handle SIGPIPE nostop +handle all nostop noprint pass +handle SIGSEGV SIGBUS stop print nopass set pagination off catch throw +file build/debug/mdbg +set args mdbg +start break a break b break c diff --git a/test/atf_comp/mdbg.SmokeBreak2 b/test/atf_comp/mdbg.SmokeBreak2 index 12141857..a836b152 100644 --- a/test/atf_comp/mdbg.SmokeBreak2 +++ b/test/atf_comp/mdbg.SmokeBreak2 @@ -1,18 +1,20 @@ bin/abt -target:mdbg -cfg:debug #Gdb script is shown below # This file was generated by mdbg -file build/debug/mdbg -set args mdbg -start set history filename temp/gdb.history set history save on +set debuginfod enabled off set record instruction-history-size 1000000 set record function-call-history-size 100000 set record function-call-history 1000 set confirm off -handle SIGPIPE nostop +handle all nostop noprint pass +handle SIGSEGV SIGBUS stop print nopass set pagination off catch throw +file build/debug/mdbg +set args mdbg +start break a break b break c diff --git a/test/atf_unit/lib_curl.GET_Echo b/test/atf_unit/lib_curl.GET_Echo new file mode 100644 index 00000000..70d0e047 --- /dev/null +++ b/test/atf_unit/lib_curl.GET_Echo @@ -0,0 +1,13 @@ +# code:0 +# reason:"" +# content:"" +# body:"" +# status_line:"" +#---curlrc--- +url = "http://127.0.0.1:8080/echo" +user-agent = "lib_curl/1.0" +connect-timeout = "5" +max-time = "120" +keepalive-time = "1" +request = GET + diff --git a/test/atf_unit/lib_curl.POST_JSON b/test/atf_unit/lib_curl.POST_JSON new file mode 100644 index 00000000..4d297c9d --- /dev/null +++ b/test/atf_unit/lib_curl.POST_JSON @@ -0,0 +1,16 @@ +# code:0 +# reason:"" +# content:"" +# body:"" +# status_line:"" +#---curlrc--- +header = "Content-Type: application/json" +header = "X-Demo: test" +url = "http://127.0.0.1:8080/echo" +user-agent = "lib_curl/1.0" +connect-timeout = "5" +max-time = "120" +keepalive-time = "1" +request = POST +data = {"x":1,"y":"z"} + diff --git a/test/atf_unit/lib_curl.PUT_PLAINTEXT b/test/atf_unit/lib_curl.PUT_PLAINTEXT new file mode 100644 index 00000000..9a8f8de6 --- /dev/null +++ b/test/atf_unit/lib_curl.PUT_PLAINTEXT @@ -0,0 +1,14 @@ +# code:0 +# reason:"" +# content:"" +# body:"" +# status_line:"" +#---curlrc--- +url = "http://127.0.0.1:8080/echo" +user-agent = "lib_curl/1.0" +connect-timeout = "5" +max-time = "120" +keepalive-time = "1" +request = PUT +data = "plain text payload" + diff --git a/test/atf_unit/lib_curl.STATUS_200 b/test/atf_unit/lib_curl.STATUS_200 new file mode 100644 index 00000000..2331e945 --- /dev/null +++ b/test/atf_unit/lib_curl.STATUS_200 @@ -0,0 +1,13 @@ +# code:0 +# reason:"" +# content:"" +# body:"" +# status_line:"" +#---curlrc--- +url = "http://127.0.0.1:8080/status/200" +user-agent = "lib_curl/1.0" +connect-timeout = "5" +max-time = "120" +keepalive-time = "1" +request = GET + diff --git a/test/cppcheck-suppressions.txt b/test/cppcheck-suppressions.txt index 31b27fc2..22eb58a1 100644 --- a/test/cppcheck-suppressions.txt +++ b/test/cppcheck-suppressions.txt @@ -1,2 +1,3 @@ unknownMacro -nullPointer:cpp/wcli/main.cpp +preprocessorErrorDirective:cpp/lib/algo/bin_encode.cpp +preprocessorErrorDirective:cpp/lib/algo/bin_decode.cpp diff --git a/txt/exe/README.md b/txt/exe/README.md index c3342de6..dc3f0465 100644 --- a/txt/exe/README.md +++ b/txt/exe/README.md @@ -42,8 +42,6 @@ 📄 [amc_gc - Internals](/txt/exe/amc_gc/internals.md)
📄 [amc_vis - Draw access path diagrams](/txt/exe/amc_vis/README.md)
📄 [amc_vis - Internals](/txt/exe/amc_vis/internals.md)
-📄 [ams_cat - Algo Messaging System sample tool](/txt/exe/ams_cat/README.md)
-📄 [ams_cat - Internals](/txt/exe/ams_cat/internals.md)
📄 [ams_sendtest - Algo Messaging System test tool](/txt/exe/ams_sendtest/README.md)
📄 [ams_sendtest - Internals](/txt/exe/ams_sendtest/internals.md)
📄 [apm - Algo Package Manager](/txt/exe/apm/README.md)
@@ -60,6 +58,8 @@ 📄 [atf_comp - Internals](/txt/exe/atf_comp/internals.md)
📄 [atf_cov - Line coverage](/txt/exe/atf_cov/README.md)
📄 [atf_cov - Internals](/txt/exe/atf_cov/internals.md)
+📄 [atf_exp - ATF expect](/txt/exe/atf_exp/README.md)
+📄 [atf_exp - Internals](/txt/exe/atf_exp/internals.md)
📄 [atf_fuzz - Generator of bad inputs for targets](/txt/exe/atf_fuzz/README.md)
📄 [atf_fuzz - Internals](/txt/exe/atf_fuzz/internals.md)
📄 [atf_gcli - test harness for gcli](/txt/exe/atf_gcli/README.md)
@@ -74,13 +74,17 @@ 📄 [gcache - Internals](/txt/exe/gcache/internals.md)
📄 [gcli - Gcli - gitlab/github command-line client](/txt/exe/gcli/README.md)
📄 [gcli - Internals](/txt/exe/gcli/internals.md)
+📄 [jkv - JSON <-> key-value mapping tool](/txt/exe/jkv/README.md)
+📄 [jkv - Internals](/txt/exe/jkv/internals.md)
📄 [mdbg - Gdb front-end](/txt/exe/mdbg/README.md)
📄 [mdbg - Internals](/txt/exe/mdbg/internals.md)
📄 [mysql2ssim - mysql -> ssim conversion tool](/txt/exe/mysql2ssim/README.md)
📄 [mysql2ssim - Internals](/txt/exe/mysql2ssim/internals.md)
📄 [orgfile - Organize and deduplicate files by timestamp and by contents](/txt/exe/orgfile/README.md)
📄 [orgfile - Internals](/txt/exe/orgfile/internals.md)
-📄 [samp_meng -](/txt/exe/samp_meng/README.md)
+📄 [samp_make - sample program for Makefile management](/txt/exe/samp_make/README.md)
+📄 [samp_make - Internals](/txt/exe/samp_make/internals.md)
+📄 [samp_meng - Sample matching engine](/txt/exe/samp_meng/README.md)
📄 [samp_meng - Internals](/txt/exe/samp_meng/internals.md)
📄 [samp_regx - Test tool for regular expressions](/txt/exe/samp_regx/README.md)
📄 [samp_regx - Internals](/txt/exe/samp_regx/internals.md)
diff --git a/txt/exe/abt/README.md b/txt/exe/abt/README.md index 6441acf3..8a580223 100644 --- a/txt/exe/abt/README.md +++ b/txt/exe/abt/README.md @@ -47,15 +47,15 @@ Usage: abt [[-target:]] [options] -disas regx "" Regex of function to disassemble -report Y Print final report -jcdb string "" Create JSON compilation database in specified file - -cache int auto Cache mode (auto|none|gcache|gcache-force|ccache) + -cache enum auto Cache mode (auto|none|gcache|gcache-force|ccache) auto Select cache automatically among enabled none No cache gcache Select gcache if enabled (no cache if disabled) gcache-force Pass --force to gcache (no cache if disabled) ccache Select ccache if enabled (no cache if disabled) -shortlink Try to shorten sort link if possible - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -232,7 +232,7 @@ dev.include include:cpp/abt/ood.cpp:include/abt.h sys:N comment:"" dev.include include:cpp/abt/opt.cpp:include/abt.h sys:N comment:"" dev.include include:cpp/abt/scan.cpp:include/algo.h sys:N comment:"" dev.include include:cpp/abt/scan.cpp:include/abt.h sys:N comment:"" -abt.config builddir:*** ood_src:*** ood_target:*** cache:*** +abt.config builddir:Linux-g++.release-x86_64 ood_src:*** ood_target:*** cache:*** report.abt n_target:*** time:*** hitrate:*** pch_hitrate:*** n_warn:0 n_err:0 n_install:*** ``` @@ -348,22 +348,22 @@ instead of `../build/Linux-g++.release-x86_64`. `abt` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| |[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dev.uname](/txt/ssimdb/dev/uname.md)|List of known unames| -|[dev.tool_opt](/txt/ssimdb/dev/tool_opt.md)|Compiler/linker options to use| -|[dev.target](/txt/ssimdb/dev/target.md)|Build target| -|[dev.syslib](/txt/ssimdb/dev/syslib.md)|Registered system library| -|[dev.targsyslib](/txt/ssimdb/dev/targsyslib.md)|Use of system library by target| -|[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|List of sources for target| -|[dev.targdep](/txt/ssimdb/dev/targdep.md)|Dependency between targets| -|[dev.syscmd](/txt/ssimdb/dev/syscmd.md)|System command to execute| -|[dev.syscmddep](/txt/ssimdb/dev/syscmddep.md)|Dependency between two commands| -|[dev.include](/txt/ssimdb/dev/include.md)|A site where one file includes another| -|[dev.compiler](/txt/ssimdb/dev/compiler.md)|One of the known compilers| -|[dev.cfg](/txt/ssimdb/dev/cfg.md)|Compiler configuration| |[dev.arch](/txt/ssimdb/dev/arch.md)|System architecture| |[dev.builddir](/txt/ssimdb/dev/builddir.md)|Directory where object files/executables go. Determines compile/link options| +|[dev.cfg](/txt/ssimdb/dev/cfg.md)|Compiler configuration| +|[dev.compiler](/txt/ssimdb/dev/compiler.md)|One of the known compilers| +|[dev.include](/txt/ssimdb/dev/include.md)|A site where one file includes another| +|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dev.syscmd](/txt/ssimdb/dev/syscmd.md)|System command to execute| +|[dev.syscmddep](/txt/ssimdb/dev/syscmddep.md)|Dependency between two commands| +|[dev.syslib](/txt/ssimdb/dev/syslib.md)|Registered system library| +|[dev.targdep](/txt/ssimdb/dev/targdep.md)|Dependency between targets| +|[dev.target](/txt/ssimdb/dev/target.md)|Build target| +|[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|List of sources for target| +|[dev.targsyslib](/txt/ssimdb/dev/targsyslib.md)|Use of system library by target| +|[dev.tool_opt](/txt/ssimdb/dev/tool_opt.md)|Compiler/linker options to use| +|[dev.uname](/txt/ssimdb/dev/uname.md)|List of known unames| diff --git a/txt/exe/abt/internals.md b/txt/exe/abt/internals.md index 6c708ef1..50a8c970 100644 --- a/txt/exe/abt/internals.md +++ b/txt/exe/abt/internals.md @@ -113,9 +113,10 @@ All allocations are done through global `abt::_db` [abt.FDb](#abt-fdb) structure Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include/gen/abt_gen.h) ``` struct FArch { // abt.FArch: Machine architecture - algo::Smallstr50 arch; // - algo::Comment comment; // - abt::FArch* ind_arch_next; // hash next + algo::Smallstr50 arch; // + algo::Comment comment; // + abt::FArch* ind_arch_next; // hash next + u32 ind_arch_hashval; // hash value // func:abt.FArch..AssignOp inline abt::FArch& operator =(const abt::FArch &rhs) = delete; // func:abt.FArch..CopyCtor @@ -152,14 +153,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include/gen/abt_gen.h) ``` struct FBuilddir { // abt.FBuilddir - algo::Smallstr50 builddir; // Primary key - uname.compiler.cfg-arch - algo::Comment comment; // - bool select; // false - algo::cstring path; // Path for this builddir - algo_lib::FLockfile lockfile; // - algo_lib::Replscope R; // - abt::FCompiler* p_compiler; // reference to parent row - abt::FBuilddir* ind_builddir_next; // hash next + algo::Smallstr50 builddir; // Primary key - uname.compiler.cfg-arch + algo::Comment comment; // + bool select; // false + algo::cstring path; // Path for this builddir + algo_lib::FLockfile lockfile; // + algo_lib::Replscope R; // + abt::FCompiler* p_compiler; // reference to parent row + abt::FBuilddir* ind_builddir_next; // hash next + u32 ind_builddir_hashval; // hash value // value field abt.FBuilddir.R is not copiable // x-reference on abt.FBuilddir.p_compiler prevents copy // func:abt.FBuilddir..AssignOp @@ -196,10 +198,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include/gen/abt_gen.h) ``` struct FCfg { // abt.FCfg: Build configuration - algo::Smallstr50 cfg; // - algo::Smallstr5 suffix; // - algo::Comment comment; // - abt::FCfg* ind_cfg_next; // hash next + algo::Smallstr50 cfg; // + algo::Smallstr5 suffix; // + algo::Comment comment; // + abt::FCfg* ind_cfg_next; // hash next + u32 ind_cfg_hashval; // hash value // func:abt.FCfg..AssignOp inline abt::FCfg& operator =(const abt::FCfg &rhs) = delete; // func:abt.FCfg..CopyCtor @@ -231,17 +234,18 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include/gen/abt_gen.h) ``` struct FCompiler { // abt.FCompiler: Compiler - algo::Smallstr50 compiler; // - algo::Smallstr50 ranlib; // - algo::Smallstr50 ar; // - algo::Smallstr50 link; // - algo::Smallstr50 libext; // - algo::Smallstr20 exeext; // - algo::Smallstr20 pchext; // - algo::Smallstr20 objext; // - algo::Smallstr50 rc; // - algo::Comment comment; // - abt::FCompiler* ind_compiler_next; // hash next + algo::Smallstr50 compiler; // + algo::Smallstr50 ranlib; // + algo::Smallstr50 ar; // + algo::Smallstr50 link; // + algo::Smallstr50 libext; // + algo::Smallstr20 exeext; // + algo::Smallstr20 pchext; // + algo::Smallstr20 objext; // + algo::Smallstr50 rc; // + algo::Comment comment; // + abt::FCompiler* ind_compiler_next; // hash next + u32 ind_compiler_hashval; // hash value // func:abt.FCompiler..AssignOp abt::FCompiler& operator =(const abt::FCompiler &rhs) = delete; // func:abt.FCompiler..CopyCtor @@ -436,12 +440,13 @@ struct FDb { // abt.FDb: In-memory database for abt Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include/gen/abt_gen.h) ``` struct FFilestat { // abt.FFilestat: Stat cache - abt::FFilestat* ind_filestat_next; // hash next - algo::cstring filename; // - algo::UnTime modtime; // - u64 size; // 0 - bool isdir; // false - bool exists; // false + abt::FFilestat* ind_filestat_next; // hash next + u32 ind_filestat_hashval; // hash value + algo::cstring filename; // + algo::UnTime modtime; // + u64 size; // 0 + bool isdir; // false + bool exists; // false // func:abt.FFilestat..AssignOp inline abt::FFilestat& operator =(const abt::FFilestat &rhs) = delete; // func:abt.FFilestat..CopyCtor @@ -476,14 +481,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include/gen/abt_gen.h) ``` struct FInclude { // abt.FInclude - abt::FInclude* ind_include_next; // hash next - algo::Smallstr200 include; // - bool sys; // false - algo::Comment comment; // - abt::FSrcfile* p_header; // reference to parent row - bool wantprint; // false - abt::FInclude* zd_include_next; // zslist link; -1 means not-in-list - abt::FInclude* zd_include_prev; // previous element + abt::FInclude* ind_include_next; // hash next + u32 ind_include_hashval; // hash value + algo::Smallstr200 include; // + bool sys; // false + algo::Comment comment; // + abt::FSrcfile* p_header; // reference to parent row + bool wantprint; // false + abt::FInclude* srcfile_zd_include_next; // zslist link; -1 means not-in-list + abt::FInclude* srcfile_zd_include_prev; // previous element // x-reference on abt.FInclude.p_header prevents copy // func:abt.FInclude..AssignOp inline abt::FInclude& operator =(const abt::FInclude &rhs) = delete; @@ -517,11 +523,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include/gen/abt_gen.h) ``` struct FNs { // abt.FNs - abt::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // + abt::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // // func:abt.FNs..AssignOp inline abt::FNs& operator =(const abt::FNs &rhs) = delete; // func:abt.FNs..CopyCtor @@ -564,6 +571,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include ``` struct FSrcfile { // abt.FSrcfile: Source file or header (key is pathname) abt::FSrcfile* ind_srcfile_next; // hash next + u32 ind_srcfile_hashval; // hash value abt::FSrcfile* zs_srcfile_read_next; // zslist link; -1 means not-in-list abt::FSrcfile* zd_inclstack_next; // zslist link; -1 means not-in-list abt::FSrcfile* zd_inclstack_prev; // previous element @@ -624,31 +632,33 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include/gen/abt_gen.h) ``` struct FSyscmd { // abt.FSyscmd: A build command - abt::FSyscmd* ind_syscmd_next; // hash next - abt::FSyscmd* ind_running_next; // hash next - i32 bh_syscmd_idx; // index in heap; -1 means not-in-heap - i64 syscmd; // 0 Step number - algo::cstring command; // Command to execute - i32 pid; // 0 PID, if running - i32 status; // 0 Exit status (if command has completed) - i32 nprereq; // 0 Number of live pre-requisites - bool fail_prereq; // false Set if one of pre-requisites fails - bool completed; // false Completed? - i32 maxtime; // 0 Optional max running time (used to use SIGALRM) - algo::cstring fstdout; // filename for stdout output - algo::cstring fstderr; // filename for stderr output - abt::FSyscmddep** c_prior_elems; // array of pointers - u32 c_prior_n; // array of pointers - u32 c_prior_max; // capacity of allocated array - abt::FSyscmddep** c_next_elems; // array of pointers - u32 c_next_n; // array of pointers - u32 c_next_max; // capacity of allocated array - i32 rowid; // 0 - algo_lib::FFildes fd_stdout; // fd for stdout - algo_lib::FFildes fd_stderr; // fd for stderr - u64 line_n; // 0 Number of lines attributed to this command - algo::cstring outfile; // - bool redirect; // true + abt::FSyscmd* ind_syscmd_next; // hash next + u32 ind_syscmd_hashval; // hash value + abt::FSyscmd* ind_running_next; // hash next + u32 ind_running_hashval; // hash value + i32 bh_syscmd_idx; // index in heap; -1 means not-in-heap + i64 syscmd; // 0 Step number + algo::cstring command; // Command to execute + i32 pid; // 0 PID, if running + i32 status; // 0 Exit status (if command has completed) + i32 nprereq; // 0 Number of live pre-requisites + bool fail_prereq; // false Set if one of pre-requisites fails + bool completed; // false Completed? + i32 maxtime; // 0 Optional max running time (used to use SIGALRM) + algo::cstring fstdout; // filename for stdout output + algo::cstring fstderr; // filename for stderr output + abt::FSyscmddep** c_prior_elems; // array of pointers + u32 c_prior_n; // array of pointers + u32 c_prior_max; // capacity of allocated array + abt::FSyscmddep** c_next_elems; // array of pointers + u32 c_next_n; // array of pointers + u32 c_next_max; // capacity of allocated array + i32 rowid; // 0 + algo_lib::FFildes fd_stdout; // fd for stdout + algo_lib::FFildes fd_stderr; // fd for stderr + u64 line_n; // 0 Number of lines attributed to this command + algo::cstring outfile; // + bool redirect; // true // reftype Ptrary of abt.FSyscmd.c_prior prohibits copy // reftype Ptrary of abt.FSyscmd.c_next prohibits copy // func:abt.FSyscmd..AssignOp @@ -727,9 +737,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include/gen/abt_gen.h) ``` struct FSyslib { // abt.FSyslib: System library - abt::FSyslib* ind_syslib_next; // hash next - algo::Smallstr50 syslib; // - algo::Comment comment; // + abt::FSyslib* ind_syslib_next; // hash next + u32 ind_syslib_hashval; // hash value + algo::Smallstr50 syslib; // + algo::Comment comment; // // func:abt.FSyslib..AssignOp inline abt::FSyslib& operator =(const abt::FSyslib &rhs) = delete; // func:abt.FSyslib..CopyCtor @@ -816,6 +827,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include ``` struct FTarget { // abt.FTarget: Build target abt::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value abt::FTarget* zs_sel_target_next; // zslist link; -1 means not-in-list abt::FTarget* zs_origsel_target_next; // zslist link; -1 means not-in-list algo::Smallstr16 target; // Primary key - name of target @@ -890,6 +902,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include ``` struct FTargsrc { // abt.FTargsrc: Source file for specific target abt::FTargsrc* ind_targsrc_next; // hash next + u32 ind_targsrc_hashval; // hash value algo::Smallstr100 targsrc; // algo::Comment comment; // abt::FTarget* p_target; // reference to parent row @@ -996,9 +1009,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_gen.h](/include/gen/abt_gen.h) ``` struct FUname { // abt.FUname: Unix name - abt::FUname* ind_uname_next; // hash next - algo::Smallstr50 uname; // - algo::Comment comment; // + abt::FUname* ind_uname_next; // hash next + u32 ind_uname_hashval; // hash value + algo::Smallstr50 uname; // + algo::Comment comment; // // func:abt.FUname..AssignOp inline abt::FUname& operator =(const abt::FUname &rhs) = delete; // func:abt.FUname..CopyCtor diff --git a/txt/exe/abt_md/README.md b/txt/exe/abt_md/README.md index 524c5bcb..1232d942 100644 --- a/txt/exe/abt_md/README.md +++ b/txt/exe/abt_md/README.md @@ -17,25 +17,25 @@ ``` abt_md: Tool to generate markdown documentation -Usage: abt_md [[-readme:]] [[-section:]] [options] - OPTION TYPE DFLT COMMENT - -in string "data" Input directory or filename, - for stdin - [readme] regx "%" Regx of readme to process/show (empty=all) - -ns regx "" (overrides -readme) Process readmes for this namespace - [section] regx "%" Select specific section to process - -update Y (action) Update mode: Re-generate mdfiles - -check (action) Check mode: Check syntax and links - -link (with -print) Print links - -anchor (with -print) Print anchors - -print (action) Query mode: Print .md section without evaluating - -dry_run Do not write changes to disk - -external Check external links as well (may fail if no internet connection) - -evalcmd Y Execute inline-commands - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative - -help Print help and exit; alias -h - -version Print version and exit - -signature Show signatures and exit; alias -sig +Usage: abt_md [[-readmefile:]] [[-section:]] [options] + OPTION TYPE DFLT COMMENT + -in string "data" Input directory or filename, - for stdin + [readmefile] regx "%" Regx of readme to process/show (empty=all) + -ns regx "" (overrides -readme) Process readmes for this namespace + [section] regx "%" Select specific section to process + -update Y (action) Update mode: Re-generate mdfiles + -check (action) Check mode: Check syntax and links + -link (with -print) Print links + -anchor (with -print) Print anchors + -print (action) Query mode: Print .md section without evaluating + -dry_run Do not write changes to disk + -external Check external links as well (may fail if no internet connection) + -evalcmd Y Execute inline-commands + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative + -help Print help and exit; alias -h + -version Print version and exit + -signature Show signatures and exit; alias -sig ``` @@ -72,8 +72,8 @@ processing. #### -in -- Input directory or filename, - for stdin
-#### -readme -- Regx of readme to process/show (empty=all) - +#### -readmefile -- Regx of readme to process/show (empty=all) + #### -ns -- (overrides -readme) Process readmes for this namespace @@ -118,25 +118,28 @@ errlist abt_md -check `abt_md` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[amcdb.tclass](/txt/ssimdb/amcdb/tclass.md)|AMC template class| -|[dmmeta.reftype](/txt/ssimdb/dmmeta/reftype.md)|Field type constructor (e.g. reference type)| -|[dmmeta.nstype](/txt/ssimdb/dmmeta/nstype.md)|Namespace type| -|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[atfdb.comptest](/txt/ssimdb/atfdb/comptest.md)|| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| +|[dmmeta.dispatch](/txt/ssimdb/dmmeta/dispatch.md)|Generate code for a multi-way branch| +|[dmmeta.dispatch_msg](/txt/ssimdb/dmmeta/dispatch_msg.md)|Add message to a dispatch| +|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| -|[dmmeta.gstatic](/txt/ssimdb/dmmeta/gstatic.md)|Load entries for this table at startup time| +|[dmmeta.finput](/txt/ssimdb/dmmeta/finput.md)|Describe input table of a program| |[dmmeta.gconst](/txt/ssimdb/dmmeta/gconst.md)|Import ssim table columns as fconst for a field| -|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dmmeta.gstatic](/txt/ssimdb/dmmeta/gstatic.md)|Load entries for this table at startup time| +|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.nstype](/txt/ssimdb/dmmeta/nstype.md)|Namespace type| +|[dev.readmefile](/txt/ssimdb/dev/readmefile.md)|File containing documentation| +|[dev.readmesort](/txt/ssimdb/dev/readmesort.md)|sorted categories of txt/ *.md files presented in dev.readme| +|[dmmeta.reftype](/txt/ssimdb/dmmeta/reftype.md)|Field type constructor (e.g. reference type)| +|[dev.scriptfile](/txt/ssimdb/dev/scriptfile.md)|Known script file| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| +|[dev.targdep](/txt/ssimdb/dev/targdep.md)|Dependency between targets| |[dev.target](/txt/ssimdb/dev/target.md)|Build target| |[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|List of sources for target| -|[dev.targdep](/txt/ssimdb/dev/targdep.md)|Dependency between targets| -|[dev.scriptfile](/txt/ssimdb/dev/scriptfile.md)|Known script file| -|[dev.readmesort](/txt/ssimdb/dev/readmesort.md)|sorted categories of txt/ *.md files presented in dev.readme| -|[dev.readme](/txt/ssimdb/dev/readme.md)|File containing documentation| -|[atfdb.comptest](/txt/ssimdb/atfdb/comptest.md)|| +|[amcdb.tclass](/txt/ssimdb/amcdb/tclass.md)|AMC template class| diff --git a/txt/exe/abt_md/internals.md b/txt/exe/abt_md/internals.md index 63a75b49..edcdc949 100644 --- a/txt/exe/abt_md/internals.md +++ b/txt/exe/abt_md/internals.md @@ -59,10 +59,11 @@ All allocations are done through global `abt_md::_db` [abt_md.FDb](#abt_md-fdb) |[abt_md.FComptest](#abt_md-fcomptest)|[atfdb.comptest](/txt/ssimdb/atfdb/comptest.md)|FDb.comptest (Lary)|comptest (Lary, by rowid)| ||||FNs.c_comptest (Ptrary)| |[abt_md.FCtype](#abt_md-fctype)|[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|FDb.ctype (Lary)|ctype (Lary, by rowid)|ind_ctype (Thash, hash field ctype)| +||||FDispatchMsg.p_ctype (Upptr)| ||||FField.p_arg (Upptr)| ||||FField.p_ctype (Upptr)| ||||FNs.c_ctype (Ptrary)| -||||FReadme.p_ctype (Upptr)| +||||FReadmefile.p_ctype (Upptr)| ||||FSsimfile.p_ctype (Upptr)| |[abt_md.FMdsection](#abt_md-fmdsection)|[dev.mdsection](/txt/ssimdb/dev/mdsection.md)|FDb.mdsection (Inlary)|**static**| ||||FFileSection.p_mdsection (Upptr)| @@ -71,34 +72,41 @@ All allocations are done through global `abt_md::_db` [abt_md.FDb](#abt_md-fdb) ||||FDirscan.bh_dirent (Bheap)| |[abt_md.FDirscan](#abt_md-fdirscan)|| ||||FDirent.p_dirscan (Upptr)| +|[abt_md.FDispatch](#abt_md-fdispatch)|[dmmeta.dispatch](/txt/ssimdb/dmmeta/dispatch.md)|FDb.dispatch (Lary)|dispatch (Lary, by rowid)|ind_dispatch (Thash, hash field dispatch)| +||||FNs.c_dispatch (Ptrary)| +|[abt_md.FDispatchMsg](#abt_md-fdispatchmsg)|[dmmeta.dispatch_msg](/txt/ssimdb/dmmeta/dispatch_msg.md)|FDb.dispatch_msg (Lary)|dispatch_msg (Lary, by rowid)| +||||FDispatch.c_dispatch_msg (Ptrary)| |[abt_md.FFconst](#abt_md-ffconst)|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|FDb.fconst (Lary)|fconst (Lary, by rowid)| ||||FField.c_fconst (Ptrary)| |[abt_md.FField](#abt_md-ffield)|[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|FDb.field (Lary)|field (Lary, by rowid)|ind_field (Thash, hash field field)| ||||FCtype.c_field (Ptrary)| ||||FCtype.c_field_arg (Ptrary)| +||||FFinput.p_field (Upptr)| ||||FSubstr.p_srcfield (Upptr)| |[abt_md.FFileSection](#abt_md-ffilesection)||FDb.file_section (Lary)|file_section (Lary, by rowid)|bh_file_section (Bheap, sort field sortkey)| ||||FMdsection.step (Hook)| ||||FMdsection.zd_file_section (Llist)| +|[abt_md.FFinput](#abt_md-ffinput)|[dmmeta.finput](/txt/ssimdb/dmmeta/finput.md)|FDb.finput (Lary)|finput (Lary, by rowid)| +||||FNs.zd_finput (Llist)| |[abt_md.FGconst](#abt_md-fgconst)|[dmmeta.gconst](/txt/ssimdb/dmmeta/gconst.md)|FDb.gconst (Lary)|gconst (Lary, by rowid)| ||||FField.c_gconst (Ptr)| |[abt_md.FGstatic](#abt_md-fgstatic)|[dmmeta.gstatic](/txt/ssimdb/dmmeta/gstatic.md)|FDb.gstatic (Lary)|gstatic (Lary, by rowid)|ind_gstatic (Thash, hash field field)| |[abt_md.FHumanText](#abt_md-fhumantext)||FDb.human_text (Tpool)|ind_human_text (Thash, hash field key)| |[abt_md.FLink](#abt_md-flink)||FDb.link (Lary)|link (Lary, by rowid)| -|[abt_md.FNs](#abt_md-fns)|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|FDb.ns (Lary)|ns (Lary, by rowid)|ind_ns (Thash, hash field ns)| +|[abt_md.FNs](#abt_md-fns)|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|FDb.ns (Lary)|ns (Lary, by rowid)|ind_ns (Thash, hash field ns)|zd_scanns (Llist)| ||||FCtype.p_ns (Upptr)| -||||FReadme.p_ns (Upptr)| +||||FReadmefile.p_ns (Upptr)| ||||FTarget.p_ns (Upptr)| |[abt_md.FNstype](#abt_md-fnstype)|[dmmeta.nstype](/txt/ssimdb/dmmeta/nstype.md)|FDb.nstype (Lary)|nstype (Lary, by rowid)|ind_nstype (Thash, hash field nstype)| -|[abt_md.FReadme](#abt_md-freadme)|[dev.readme](/txt/ssimdb/dev/readme.md)|FDb.readme (Lary)|readme (Lary, by rowid)|ind_readme (Thash, hash field gitfile)|c_readme (Ptr)| -||||FNs.c_readme (Ptr)| +|[abt_md.FReadmefile](#abt_md-freadmefile)|[dev.readmefile](/txt/ssimdb/dev/readmefile.md)|FDb.readmefile (Lary)|readmefile (Lary, by rowid)|ind_readmefile (Thash, hash field gitfile)|c_readmefile (Ptr)| +||||FNs.c_readmefile (Ptr)| |[abt_md.FReadmesort](#abt_md-freadmesort)|[dev.readmesort](/txt/ssimdb/dev/readmesort.md)|FDb.readmesort (Lary)|readmesort (Lary, by rowid)|ind_readmesort (Thash, hash field readmesort)| |[abt_md.FReftype](#abt_md-freftype)|[dmmeta.reftype](/txt/ssimdb/dmmeta/reftype.md)|FDb.reftype (Lary)|reftype (Lary, by rowid)| |[abt_md.FScriptfile](#abt_md-fscriptfile)|[dev.scriptfile](/txt/ssimdb/dev/scriptfile.md)|FDb.scriptfile (Lary)|scriptfile (Lary, by rowid)|ind_scriptfile (Thash, hash field gitfile)| -||||FReadme.p_scriptfile (Upptr)| +||||FReadmefile.p_scriptfile (Upptr)| |[abt_md.FSsimfile](#abt_md-fssimfile)|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|FDb.ssimfile (Lary)|ssimfile (Lary, by rowid)|ind_ssimfile (Thash, hash field ssimfile)| ||||FCtype.c_ssimfile (Ptr)| -||||FReadme.p_ssimfile (Upptr)| +||||FReadmefile.p_ssimfile (Upptr)| |[abt_md.FSubstr](#abt_md-fsubstr)|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|FDb.substr (Lary)|substr (Lary, by rowid)| ||||FField.c_substr (Ptr)| |[abt_md.FTargdep](#abt_md-ftargdep)|[dev.targdep](/txt/ssimdb/dev/targdep.md)|FDb.targdep (Lary)|targdep (Lary, by rowid)| @@ -125,8 +133,9 @@ All allocations are done through global `abt_md::_db` [abt_md.FDb](#abt_md-fdb) Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FAnchor { // abt_md.FAnchor - algo::cstring anchor; // - abt_md::FAnchor* ind_anchor_next; // hash next + algo::cstring anchor; // + abt_md::FAnchor* ind_anchor_next; // hash next + u32 ind_anchor_hashval; // hash value // func:abt_md.FAnchor..AssignOp inline abt_md::FAnchor& operator =(const abt_md::FAnchor &rhs) = delete; // func:abt_md.FAnchor..CopyCtor @@ -162,13 +171,16 @@ struct FComptest { // abt_md.FComptest algo::Smallstr50 comptest; // i32 timeout; // 10 bool memcheck; // true + bool coverage; // true u8 exit_code; // 0 Exit code to check + i32 ncore; // 1 + i32 repeat; // 1 Number of times to repeat the test algo::Comment comment; // bool ns_c_comptest_in_ary; // false membership flag // func:abt_md.FComptest..AssignOp - inline abt_md::FComptest& operator =(const abt_md::FComptest &rhs) = delete; + abt_md::FComptest& operator =(const abt_md::FComptest &rhs) = delete; // func:abt_md.FComptest..CopyCtor - inline FComptest(const abt_md::FComptest &rhs) = delete; + FComptest(const abt_md::FComptest &rhs) = delete; private: // func:abt_md.FComptest..Ctor inline FComptest() __attribute__((nothrow)); @@ -213,6 +225,7 @@ struct FCtype { // abt_md.FCtype u32 c_field_arg_max; // capacity of allocated array bool ns_c_ctype_in_ary; // false membership flag abt_md::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // x-reference on abt_md.FCtype.c_ssimfile prevents copy // reftype Ptrary of abt_md.FCtype.c_field prohibits copy // x-reference on abt_md.FCtype.p_ns prevents copy @@ -284,12 +297,12 @@ struct FMdsection { // abt_md.FMdsection |---|---|---|---|---| |abt_md.FDb._db|[abt_md.FDb](/txt/exe/abt_md/internals.md#abt_md-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| |abt_md.FDb.cmdline|[command.abt_md](/txt/protocol/command/README.md#command-abt_md)|[Val](/txt/exe/amc/reftypes.md#val)||| -|abt_md.FDb.readme|[abt_md.FReadme](/txt/exe/abt_md/internals.md#abt_md-freadme)|[Lary](/txt/exe/amc/reftypes.md#lary)||| -|abt_md.FDb.ind_readme|[abt_md.FReadme](/txt/exe/abt_md/internals.md#abt_md-freadme)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|abt_md.FDb.readmefile|[abt_md.FReadmefile](/txt/exe/abt_md/internals.md#abt_md-freadmefile)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|abt_md.FDb.ind_readmefile|[abt_md.FReadmefile](/txt/exe/abt_md/internals.md#abt_md-freadmefile)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |abt_md.FDb.mdsection|[abt_md.FMdsection](/txt/exe/abt_md/internals.md#abt_md-fmdsection)|[Inlary](/txt/exe/amc/reftypes.md#inlary)||| |abt_md.FDb.file_section|[abt_md.FFileSection](/txt/exe/abt_md/internals.md#abt_md-ffilesection)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |abt_md.FDb.bh_file_section|[abt_md.FFileSection](/txt/exe/abt_md/internals.md#abt_md-ffilesection)|[Bheap](/txt/exe/amc/reftypes.md#bheap)||| -|abt_md.FDb.c_readme|[abt_md.FReadme](/txt/exe/abt_md/internals.md#abt_md-freadme)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| +|abt_md.FDb.c_readmefile|[abt_md.FReadmefile](/txt/exe/abt_md/internals.md#abt_md-freadmefile)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |abt_md.FDb.ns|[abt_md.FNs](/txt/exe/abt_md/internals.md#abt_md-fns)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |abt_md.FDb.ind_ns|[abt_md.FNs](/txt/exe/abt_md/internals.md#abt_md-fns)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |abt_md.FDb.R|[algo_lib.Replscope](/txt/lib/algo_lib/README.md#algo_lib-replscope)|[Val](/txt/exe/amc/reftypes.md#val)||| @@ -323,6 +336,11 @@ struct FMdsection { // abt_md.FMdsection |abt_md.FDb.target|[abt_md.FTarget](/txt/exe/abt_md/internals.md#abt_md-ftarget)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |abt_md.FDb.targdep|[abt_md.FTargdep](/txt/exe/abt_md/internals.md#abt_md-ftargdep)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |abt_md.FDb.ind_target|[abt_md.FTarget](/txt/exe/abt_md/internals.md#abt_md-ftarget)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|abt_md.FDb.finput|[abt_md.FFinput](/txt/exe/abt_md/internals.md#abt_md-ffinput)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|abt_md.FDb.zd_scanns|[abt_md.FNs](/txt/exe/abt_md/internals.md#abt_md-fns)|[Llist](/txt/exe/amc/reftypes.md#llist)||| +|abt_md.FDb.dispatch|[abt_md.FDispatch](/txt/exe/abt_md/internals.md#abt_md-fdispatch)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|abt_md.FDb.ind_dispatch|[abt_md.FDispatch](/txt/exe/abt_md/internals.md#abt_md-fdispatch)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|abt_md.FDb.dispatch_msg|[abt_md.FDispatchMsg](/txt/exe/abt_md/internals.md#abt_md-fdispatchmsg)|[Lary](/txt/exe/amc/reftypes.md#lary)||| #### Struct FDb @@ -330,20 +348,20 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/incl ``` struct FDb { // abt_md.FDb: In-memory database for abt_md command::abt_md cmdline; // - abt_md::FReadme* readme_lary[32]; // level array - i32 readme_n; // number of elements in array - abt_md::FReadme** ind_readme_buckets_elems; // pointer to bucket array - i32 ind_readme_buckets_n; // number of elements in bucket array - i32 ind_readme_n; // number of elements in the hash table - u128 mdsection_data[sizeu128(abt_md::FMdsection,25)]; // place for data + abt_md::FReadmefile* readmefile_lary[32]; // level array + i32 readmefile_n; // number of elements in array + abt_md::FReadmefile** ind_readmefile_buckets_elems; // pointer to bucket array + i32 ind_readmefile_buckets_n; // number of elements in bucket array + i32 ind_readmefile_n; // number of elements in the hash table + u128 mdsection_data[sizeu128(abt_md::FMdsection,26)]; // place for data i32 mdsection_n; // number of elems current in existence - enum { mdsection_max = 25 }; + enum { mdsection_max = 26 }; abt_md::FFileSection* file_section_lary[32]; // level array i32 file_section_n; // number of elements in array abt_md::FFileSection** bh_file_section_elems; // binary heap by sortkey i32 bh_file_section_n; // number of elements in the heap i32 bh_file_section_max; // max elements in bh_file_section_elems - abt_md::FReadme* c_readme; // optional pointer + abt_md::FReadmefile* c_readmefile; // optional pointer abt_md::FNs* ns_lary[32]; // level array i32 ns_n; // number of elements in array abt_md::FNs** ind_ns_buckets_elems; // pointer to bucket array @@ -421,6 +439,18 @@ struct FDb { // abt_md.FDb: In-memory database for abt_md abt_md::FTarget** ind_target_buckets_elems; // pointer to bucket array i32 ind_target_buckets_n; // number of elements in bucket array i32 ind_target_n; // number of elements in the hash table + abt_md::FFinput* finput_lary[32]; // level array + i32 finput_n; // number of elements in array + abt_md::FNs* zd_scanns_head; // zero-terminated doubly linked list + i32 zd_scanns_n; // zero-terminated doubly linked list + abt_md::FNs* zd_scanns_tail; // pointer to last element + abt_md::FDispatch* dispatch_lary[32]; // level array + i32 dispatch_n; // number of elements in array + abt_md::FDispatch** ind_dispatch_buckets_elems; // pointer to bucket array + i32 ind_dispatch_buckets_n; // number of elements in bucket array + i32 ind_dispatch_n; // number of elements in the hash table + abt_md::FDispatchMsg* dispatch_msg_lary[32]; // level array + i32 dispatch_msg_n; // number of elements in array abt_md::trace trace; // }; ``` @@ -443,12 +473,12 @@ struct FDb { // abt_md.FDb: In-memory database for abt_md Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FDirent { // abt_md.FDirent - bool is_dir; // false - abt_md::FDirscan* p_dirscan; // reference to parent row - algo::cstring filename; // - algo::cstring sortfld; // - algo::cstring pathname; // - i32 bh_dirent_idx; // index in heap; -1 means not-in-heap + bool is_dir; // false + abt_md::FDirscan* p_dirscan; // reference to parent row + algo::cstring filename; // + algo::cstring sortfld; // + algo::cstring pathname; // + i32 parent_bh_dirent_idx; // index in heap; -1 means not-in-heap // func:abt_md.FDirent..AssignOp inline abt_md::FDirent& operator =(const abt_md::FDirent &rhs) = delete; // func:abt_md.FDirent..CopyCtor @@ -492,6 +522,96 @@ struct FDirscan { // abt_md.FDirscan }; ``` +#### abt_md.FDispatch - Generate code for a multi-way branch + + +#### abt_md.FDispatch Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|abt_md.FDispatch.base|[dmmeta.Dispatch](/txt/ssimdb/dmmeta/dispatch.md)|[Base](/txt/ssimdb/dmmeta/dispatch.md)||| +|abt_md.FDispatch.c_dispatch_msg|[abt_md.FDispatchMsg](/txt/exe/abt_md/internals.md#abt_md-fdispatchmsg)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| + +#### Struct FDispatch + +*Note:* field ``abt_md.FDispatch.base`` has reftype ``base`` so the fields of [dmmeta.Dispatch](/txt/ssimdb/dmmeta/dispatch.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) +``` +struct FDispatch { // abt_md.FDispatch + abt_md::FDispatch* ind_dispatch_next; // hash next + u32 ind_dispatch_hashval; // hash value + algo::Smallstr50 dispatch; // Primary key (ns.name) + bool unk; // false Want default case? + bool read; // false Generate read function + bool print; // false Generate print function + bool haslen; // false Include length in dispatch function + bool call; // false Generate call to user-defined function + bool strict; // false Only dispatch if length matches exactly + bool dyn; // false Use dynamic memory allocation: new, delete instead of ByteAry + bool kafka; // false generate kafka codec + algo::Comment comment; // + abt_md::FDispatchMsg** c_dispatch_msg_elems; // array of pointers + u32 c_dispatch_msg_n; // array of pointers + u32 c_dispatch_msg_max; // capacity of allocated array + bool ns_c_dispatch_in_ary; // false membership flag + // reftype Ptrary of abt_md.FDispatch.c_dispatch_msg prohibits copy + // func:abt_md.FDispatch..AssignOp + abt_md::FDispatch& operator =(const abt_md::FDispatch &rhs) = delete; + // reftype Ptrary of abt_md.FDispatch.c_dispatch_msg prohibits copy + // func:abt_md.FDispatch..CopyCtor + FDispatch(const abt_md::FDispatch &rhs) = delete; +private: + // func:abt_md.FDispatch..Ctor + inline FDispatch() __attribute__((nothrow)); + // func:abt_md.FDispatch..Dtor + inline ~FDispatch() __attribute__((nothrow)); + friend abt_md::FDispatch& dispatch_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend abt_md::FDispatch* dispatch_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void dispatch_RemoveAll() __attribute__((nothrow)); + friend void dispatch_RemoveLast() __attribute__((nothrow)); +}; +``` + +#### abt_md.FDispatchMsg - Add message to a dispatch + + +#### abt_md.FDispatchMsg Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|abt_md.FDispatchMsg.base|[dmmeta.DispatchMsg](/txt/ssimdb/dmmeta/dispatch_msg.md)|[Base](/txt/ssimdb/dmmeta/dispatch_msg.md)||| +|abt_md.FDispatchMsg.p_ctype|[abt_md.FCtype](/txt/exe/abt_md/internals.md#abt_md-fctype)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| + +#### Struct FDispatchMsg + +*Note:* field ``abt_md.FDispatchMsg.base`` has reftype ``base`` so the fields of [dmmeta.DispatchMsg](/txt/ssimdb/dmmeta/dispatch_msg.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) +``` +struct FDispatchMsg { // abt_md.FDispatchMsg + algo::Smallstr100 dispatch_msg; // + algo::Comment comment; // + abt_md::FCtype* p_ctype; // reference to parent row + bool dispatch_c_dispatch_msg_in_ary; // false membership flag + // x-reference on abt_md.FDispatchMsg.p_ctype prevents copy + // func:abt_md.FDispatchMsg..AssignOp + inline abt_md::FDispatchMsg& operator =(const abt_md::FDispatchMsg &rhs) = delete; + // x-reference on abt_md.FDispatchMsg.p_ctype prevents copy + // func:abt_md.FDispatchMsg..CopyCtor + inline FDispatchMsg(const abt_md::FDispatchMsg &rhs) = delete; +private: + // func:abt_md.FDispatchMsg..Ctor + inline FDispatchMsg() __attribute__((nothrow)); + // func:abt_md.FDispatchMsg..Dtor + inline ~FDispatchMsg() __attribute__((nothrow)); + friend abt_md::FDispatchMsg& dispatch_msg_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend abt_md::FDispatchMsg* dispatch_msg_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void dispatch_msg_RemoveAll() __attribute__((nothrow)); + friend void dispatch_msg_RemoveLast() __attribute__((nothrow)); +}; +``` + #### abt_md.FFconst - Specify enum value (integer + string constant) for a field @@ -552,6 +672,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/incl ``` struct FField { // abt_md.FField abt_md::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -613,15 +734,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FFileSection { // abt_md.FFileSection - abt_md::FFileSection* zd_file_section_next; // zslist link; -1 means not-in-list - abt_md::FFileSection* zd_file_section_prev; // previous element - i32 bh_file_section_idx; // index in heap; -1 means not-in-heap - algo::cstring title; // First line - algo::cstring text; // Remaining lines - i32 sortkey; // 0 Sort key - bool select; // true Selected for processing - i32 firstline; // 0 Line in file where section starts - abt_md::FMdsection* p_mdsection; // reference to parent row + abt_md::FFileSection* mdsection_zd_file_section_next; // zslist link; -1 means not-in-list + abt_md::FFileSection* mdsection_zd_file_section_prev; // previous element + i32 bh_file_section_idx; // index in heap; -1 means not-in-heap + algo::cstring title; // First line + algo::cstring text; // Remaining lines + i32 sortkey; // 0 Sort key + bool select; // true Selected for processing + i32 firstline; // 0 Line in file where section starts + abt_md::FMdsection* p_mdsection; // reference to parent row // func:abt_md.FFileSection..AssignOp inline abt_md::FFileSection& operator =(const abt_md::FFileSection &rhs) = delete; // func:abt_md.FFileSection..CopyCtor @@ -638,6 +759,49 @@ private: }; ``` +#### abt_md.FFinput - Describe input table of a program + + +#### abt_md.FFinput Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|abt_md.FFinput.base|[dmmeta.Finput](/txt/ssimdb/dmmeta/finput.md)|[Base](/txt/ssimdb/dmmeta/finput.md)||| +|abt_md.FFinput.p_field|[abt_md.FField](/txt/exe/abt_md/internals.md#abt_md-ffield)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| + +#### Struct FFinput + +*Note:* field ``abt_md.FFinput.base`` has reftype ``base`` so the fields of [dmmeta.Finput](/txt/ssimdb/dmmeta/finput.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) +``` +struct FFinput { // abt_md.FFinput + algo::Smallstr100 field; // Target field to read + bool extrn; // false Call user-provided function + bool update; // false + bool strict; // true Exist process if record contains error + algo::Comment comment; // + abt_md::FField* p_field; // reference to parent row + abt_md::FFinput* ns_zd_finput_next; // zslist link; -1 means not-in-list + abt_md::FFinput* ns_zd_finput_prev; // previous element + // x-reference on abt_md.FFinput.p_field prevents copy + // func:abt_md.FFinput..AssignOp + inline abt_md::FFinput& operator =(const abt_md::FFinput &rhs) = delete; + // x-reference on abt_md.FFinput.p_field prevents copy + // func:abt_md.FFinput..CopyCtor + inline FFinput(const abt_md::FFinput &rhs) = delete; +private: + // func:abt_md.FFinput..Ctor + inline FFinput() __attribute__((nothrow)); + // func:abt_md.FFinput..Dtor + inline ~FFinput() __attribute__((nothrow)); + friend abt_md::FFinput& finput_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend abt_md::FFinput* finput_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void finput_RemoveAll() __attribute__((nothrow)); + friend void finput_RemoveLast() __attribute__((nothrow)); +}; +``` + #### abt_md.FGconst - Import ssim table columns as fconst for a field @@ -690,9 +854,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FGstatic { // abt_md.FGstatic - abt_md::FGstatic* ind_gstatic_next; // hash next - algo::Smallstr100 field; // - algo::Comment comment; // + abt_md::FGstatic* ind_gstatic_next; // hash next + u32 ind_gstatic_hashval; // hash value + algo::Smallstr100 field; // + algo::Comment comment; // // func:abt_md.FGstatic..AssignOp inline abt_md::FGstatic& operator =(const abt_md::FGstatic &rhs) = delete; // func:abt_md.FGstatic..CopyCtor @@ -725,11 +890,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FHumanText { // abt_md.FHumanText - abt_md::FHumanText* human_text_next; // Pointer to next free element int tpool - abt_md::FHumanText* ind_human_text_next; // hash next - algo::cstring key; // - algo::cstring text; // - bool used; // false + abt_md::FHumanText* human_text_next; // Pointer to next free element int tpool + abt_md::FHumanText* ind_human_text_next; // hash next + u32 ind_human_text_hashval; // hash value + algo::cstring key; // + algo::cstring text; // + bool used; // false // func:abt_md.FHumanText..AssignOp inline abt_md::FHumanText& operator =(const abt_md::FHumanText &rhs) = delete; // func:abt_md.FHumanText..CopyCtor @@ -782,11 +948,13 @@ private: |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| |abt_md.FNs.base|[dmmeta.Ns](/txt/ssimdb/dmmeta/ns.md)|[Base](/txt/ssimdb/dmmeta/ns.md)||| -|abt_md.FNs.c_readme|[abt_md.FReadme](/txt/exe/abt_md/internals.md#abt_md-freadme)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| +|abt_md.FNs.c_readmefile|[abt_md.FReadmefile](/txt/exe/abt_md/internals.md#abt_md-freadmefile)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |abt_md.FNs.c_targsrc|[abt_md.FTargsrc](/txt/exe/abt_md/internals.md#abt_md-ftargsrc)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |abt_md.FNs.c_ctype|[abt_md.FCtype](/txt/exe/abt_md/internals.md#abt_md-fctype)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |abt_md.FNs.c_comptest|[abt_md.FComptest](/txt/exe/abt_md/internals.md#abt_md-fcomptest)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |abt_md.FNs.c_target|[abt_md.FTarget](/txt/exe/abt_md/internals.md#abt_md-ftarget)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| +|abt_md.FNs.zd_finput|[abt_md.FFinput](/txt/exe/abt_md/internals.md#abt_md-ffinput)|[Llist](/txt/exe/amc/reftypes.md#llist)||| +|abt_md.FNs.c_dispatch|[abt_md.FDispatch](/txt/exe/abt_md/internals.md#abt_md-fdispatch)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| #### Struct FNs @@ -795,32 +963,45 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FNs { // abt_md.FNs - abt_md::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // - abt_md::FReadme* c_readme; // optional pointer - abt_md::FTargsrc** c_targsrc_elems; // array of pointers - u32 c_targsrc_n; // array of pointers - u32 c_targsrc_max; // capacity of allocated array - abt_md::FCtype** c_ctype_elems; // array of pointers - u32 c_ctype_n; // array of pointers - u32 c_ctype_max; // capacity of allocated array - abt_md::FComptest** c_comptest_elems; // array of pointers - u32 c_comptest_n; // array of pointers - u32 c_comptest_max; // capacity of allocated array - abt_md::FTarget* c_target; // optional pointer + abt_md::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + abt_md::FNs* zd_scanns_next; // zslist link; -1 means not-in-list + abt_md::FNs* zd_scanns_prev; // previous element + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // + abt_md::FReadmefile* c_readmefile; // optional pointer + abt_md::FTargsrc** c_targsrc_elems; // array of pointers + u32 c_targsrc_n; // array of pointers + u32 c_targsrc_max; // capacity of allocated array + abt_md::FCtype** c_ctype_elems; // array of pointers + u32 c_ctype_n; // array of pointers + u32 c_ctype_max; // capacity of allocated array + abt_md::FComptest** c_comptest_elems; // array of pointers + u32 c_comptest_n; // array of pointers + u32 c_comptest_max; // capacity of allocated array + abt_md::FTarget* c_target; // optional pointer + abt_md::FFinput* zd_finput_head; // zero-terminated doubly linked list + i32 zd_finput_n; // zero-terminated doubly linked list + abt_md::FFinput* zd_finput_tail; // pointer to last element + abt_md::FDispatch** c_dispatch_elems; // array of pointers + u32 c_dispatch_n; // array of pointers + u32 c_dispatch_max; // capacity of allocated array // reftype Ptrary of abt_md.FNs.c_targsrc prohibits copy // reftype Ptrary of abt_md.FNs.c_ctype prohibits copy // reftype Ptrary of abt_md.FNs.c_comptest prohibits copy // x-reference on abt_md.FNs.c_target prevents copy + // reftype Llist of abt_md.FNs.zd_finput prohibits copy + // reftype Ptrary of abt_md.FNs.c_dispatch prohibits copy // func:abt_md.FNs..AssignOp abt_md::FNs& operator =(const abt_md::FNs &rhs) = delete; // reftype Ptrary of abt_md.FNs.c_targsrc prohibits copy // reftype Ptrary of abt_md.FNs.c_ctype prohibits copy // reftype Ptrary of abt_md.FNs.c_comptest prohibits copy // x-reference on abt_md.FNs.c_target prevents copy + // reftype Llist of abt_md.FNs.zd_finput prohibits copy + // reftype Ptrary of abt_md.FNs.c_dispatch prohibits copy // func:abt_md.FNs..CopyCtor FNs(const abt_md::FNs &rhs) = delete; private: @@ -851,9 +1032,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FNstype { // abt_md.FNstype - abt_md::FNstype* ind_nstype_next; // hash next - algo::Smallstr50 nstype; // - algo::Comment comment; // + abt_md::FNstype* ind_nstype_next; // hash next + u32 ind_nstype_hashval; // hash value + algo::Smallstr50 nstype; // + algo::Comment comment; // // func:abt_md.FNstype..AssignOp inline abt_md::FNstype& operator =(const abt_md::FNstype &rhs) = delete; // func:abt_md.FNstype..CopyCtor @@ -870,51 +1052,52 @@ private: }; ``` -#### abt_md.FReadme - File containing documentation - +#### abt_md.FReadmefile - File containing documentation + -#### abt_md.FReadme Fields - +#### abt_md.FReadmefile Fields + |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|abt_md.FReadme.base|[dev.Readme](/txt/ssimdb/dev/readme.md)|[Base](/txt/ssimdb/dev/readme.md)||| -|abt_md.FReadme.p_ns|[abt_md.FNs](/txt/exe/abt_md/internals.md#abt_md-fns)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Optional Associated namespace| -|abt_md.FReadme.p_ssimfile|[abt_md.FSsimfile](/txt/exe/abt_md/internals.md#abt_md-fssimfile)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Optional Associated ssimfile| -|abt_md.FReadme.p_ctype|[abt_md.FCtype](/txt/exe/abt_md/internals.md#abt_md-fctype)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Optional Associated ctype| -|abt_md.FReadme.p_scriptfile|[abt_md.FScriptfile](/txt/exe/abt_md/internals.md#abt_md-fscriptfile)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Optional Associated scriptfile| -|abt_md.FReadme.select|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|abt_md.FReadmefile.base|[dev.Readmefile](/txt/ssimdb/dev/readmefile.md)|[Base](/txt/ssimdb/dev/readmefile.md)||| +|abt_md.FReadmefile.p_ns|[abt_md.FNs](/txt/exe/abt_md/internals.md#abt_md-fns)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Optional Associated namespace| +|abt_md.FReadmefile.p_ssimfile|[abt_md.FSsimfile](/txt/exe/abt_md/internals.md#abt_md-fssimfile)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Optional Associated ssimfile| +|abt_md.FReadmefile.p_ctype|[abt_md.FCtype](/txt/exe/abt_md/internals.md#abt_md-fctype)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Optional Associated ctype| +|abt_md.FReadmefile.p_scriptfile|[abt_md.FScriptfile](/txt/exe/abt_md/internals.md#abt_md-fscriptfile)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Optional Associated scriptfile| +|abt_md.FReadmefile.select|bool|[Val](/txt/exe/amc/reftypes.md#val)||| -#### Struct FReadme - -*Note:* field ``abt_md.FReadme.base`` has reftype ``base`` so the fields of [dev.Readme](/txt/ssimdb/dev/readme.md) above are included into the resulting struct. +#### Struct FReadmefile + +*Note:* field ``abt_md.FReadmefile.base`` has reftype ``base`` so the fields of [dev.Readmefile](/txt/ssimdb/dev/readmefile.md) above are included into the resulting struct. Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` -struct FReadme { // abt_md.FReadme - abt_md::FReadme* ind_readme_next; // hash next - algo::Smallstr200 gitfile; // - bool inl; // false - bool sandbox; // false - algo::Smallstr100 filter; // - algo::Comment comment; // - abt_md::FNs* p_ns; // reference to parent row - abt_md::FSsimfile* p_ssimfile; // reference to parent row - abt_md::FCtype* p_ctype; // reference to parent row - abt_md::FScriptfile* p_scriptfile; // reference to parent row - bool select; // false - // func:abt_md.FReadme..AssignOp - abt_md::FReadme& operator =(const abt_md::FReadme &rhs) = delete; - // func:abt_md.FReadme..CopyCtor - FReadme(const abt_md::FReadme &rhs) = delete; +struct FReadmefile { // abt_md.FReadmefile + abt_md::FReadmefile* ind_readmefile_next; // hash next + u32 ind_readmefile_hashval; // hash value + algo::Smallstr200 gitfile; // + bool inl; // false + bool sandbox; // false + algo::Smallstr100 filter; // + algo::Comment comment; // + abt_md::FNs* p_ns; // reference to parent row + abt_md::FSsimfile* p_ssimfile; // reference to parent row + abt_md::FCtype* p_ctype; // reference to parent row + abt_md::FScriptfile* p_scriptfile; // reference to parent row + bool select; // false + // func:abt_md.FReadmefile..AssignOp + abt_md::FReadmefile& operator =(const abt_md::FReadmefile &rhs) = delete; + // func:abt_md.FReadmefile..CopyCtor + FReadmefile(const abt_md::FReadmefile &rhs) = delete; private: - // func:abt_md.FReadme..Ctor - inline FReadme() __attribute__((nothrow)); - // func:abt_md.FReadme..Dtor - inline ~FReadme() __attribute__((nothrow)); - friend abt_md::FReadme& readme_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend abt_md::FReadme* readme_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void readme_RemoveAll() __attribute__((nothrow)); - friend void readme_RemoveLast() __attribute__((nothrow)); + // func:abt_md.FReadmefile..Ctor + inline FReadmefile() __attribute__((nothrow)); + // func:abt_md.FReadmefile..Dtor + inline ~FReadmefile() __attribute__((nothrow)); + friend abt_md::FReadmefile& readmefile_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend abt_md::FReadmefile* readmefile_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void readmefile_RemoveAll() __attribute__((nothrow)); + friend void readmefile_RemoveLast() __attribute__((nothrow)); }; ``` @@ -935,10 +1118,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FReadmesort { // abt_md.FReadmesort - abt_md::FReadmesort* ind_readmesort_next; // hash next - algo::Smallstr250 readmesort; // - algo::Comment comment; // - algo::cstring sortfld; // + abt_md::FReadmesort* ind_readmesort_next; // hash next + u32 ind_readmesort_hashval; // hash value + algo::Smallstr250 readmesort; // + algo::Comment comment; // + algo::cstring sortfld; // // func:abt_md.FReadmesort..AssignOp inline abt_md::FReadmesort& operator =(const abt_md::FReadmesort &rhs) = delete; // func:abt_md.FReadmesort..CopyCtor @@ -1011,10 +1195,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FScriptfile { // abt_md.FScriptfile - abt_md::FScriptfile* ind_scriptfile_next; // hash next - algo::Smallstr200 gitfile; // - algo::Smallstr50 license; // - algo::Comment comment; // + abt_md::FScriptfile* ind_scriptfile_next; // hash next + u32 ind_scriptfile_hashval; // hash value + algo::Smallstr200 gitfile; // + algo::Smallstr50 license; // + algo::Comment comment; // // func:abt_md.FScriptfile..AssignOp inline abt_md::FScriptfile& operator =(const abt_md::FScriptfile &rhs) = delete; // func:abt_md.FScriptfile..CopyCtor @@ -1048,10 +1233,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FSsimfile { // abt_md.FSsimfile - abt_md::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - abt_md::FCtype* p_ctype; // reference to parent row + abt_md::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + abt_md::FCtype* p_ctype; // reference to parent row // x-reference on abt_md.FSsimfile.p_ctype prevents copy // func:abt_md.FSsimfile..AssignOp inline abt_md::FSsimfile& operator =(const abt_md::FSsimfile &rhs) = delete; @@ -1166,12 +1352,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FTarget { // abt_md.FTarget - abt_md::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target - abt_md::FTargdep** c_targdep_elems; // array of pointers - u32 c_targdep_n; // array of pointers - u32 c_targdep_max; // capacity of allocated array - abt_md::FNs* p_ns; // reference to parent row + abt_md::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target + abt_md::FTargdep** c_targdep_elems; // array of pointers + u32 c_targdep_n; // array of pointers + u32 c_targdep_max; // capacity of allocated array + abt_md::FNs* p_ns; // reference to parent row // reftype Ptrary of abt_md.FTarget.c_targdep prohibits copy // x-reference on abt_md.FTarget.p_ns prevents copy // func:abt_md.FTarget..AssignOp @@ -1243,9 +1430,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/abt_md_gen.h](/include/gen/abt_md_gen.h) ``` struct FTclass { // abt_md.FTclass - abt_md::FTclass* ind_tclass_next; // hash next - algo::Smallstr50 tclass; // - algo::Comment comment; // + abt_md::FTclass* ind_tclass_next; // hash next + u32 ind_tclass_hashval; // hash value + algo::Smallstr50 tclass; // + algo::Comment comment; // // func:abt_md.FTclass..AssignOp inline abt_md::FTclass& operator =(const abt_md::FTclass &rhs) = delete; // func:abt_md.FTclass..CopyCtor diff --git a/txt/exe/acr/README.md b/txt/exe/acr/README.md index a916c06f..e3814e54 100644 --- a/txt/exe/acr/README.md +++ b/txt/exe/acr/README.md @@ -65,8 +65,8 @@ Usage: acr [[-query:]] [options] -field... string Fields to select -regxof string "" Single field: output regx of matching field values -meta Select meta-data for selected records - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -420,19 +420,19 @@ Deselect any selected records and selects their meta-data instead. `acr` takes the following tables on input: |Ssimfile|Comment| |---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dmmeta.anonfld](/txt/ssimdb/dmmeta/anonfld.md)|Omit field name where possible (command line, enums, constants)| +|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| +|[dmmeta.funique](/txt/ssimdb/dmmeta/funique.md)|This field must be unique in the table. Not needed for primary key| +|[dmmeta.smallstr](/txt/ssimdb/dmmeta/smallstr.md)|Generated fixed-length padded or length-delimited string field| |[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| -|[dmmeta.ssimsort](/txt/ssimdb/dmmeta/ssimsort.md)|Define sort order for ssimfile| |[dmmeta.ssimreq](/txt/ssimdb/dmmeta/ssimreq.md)|Extended constraints for ssim records| -|[dmmeta.smallstr](/txt/ssimdb/dmmeta/smallstr.md)|Generated fixed-length padded or length-delimited string field| -|[dmmeta.funique](/txt/ssimdb/dmmeta/funique.md)|This field must be unique in the table. Not needed for primary key| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| -|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| -|[dmmeta.anonfld](/txt/ssimdb/dmmeta/anonfld.md)|Omit field name where possible (command line, enums, constants)| -|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dmmeta.ssimsort](/txt/ssimdb/dmmeta/ssimsort.md)|Define sort order for ssimfile| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| diff --git a/txt/exe/acr/internals.md b/txt/exe/acr/internals.md index 0a236b7b..74bf986e 100644 --- a/txt/exe/acr/internals.md +++ b/txt/exe/acr/internals.md @@ -119,9 +119,9 @@ All allocations are done through global `acr::_db` [acr.FDb](#acr-fdb) structure |[acr.FRec](#acr-frec)||FDb.rec (Tpool)|zd_all_selrec (Llist)|c_ssimreq_rec (Ptrary)| ||||Err.rec (Ptr)| ||||FCheck.c_bad_rec (Ptrary)| -||||FCtype.zd_ctype_rec (Llist)| +||||FCtype.zd_rec (Llist)| ||||FCtype.ind_ctype_rec (Thash)| -||||FCtype.zd_ctype_selrec (Llist)| +||||FCtype.zd_selrec (Llist)| ||||FFile.zd_frec (Llist)| ||||FPline.p_rec (Upptr)| ||||FQuery.c_rec (Ptrary)| @@ -403,9 +403,9 @@ private: |acr.FCtype.c_field|[acr.FField](/txt/exe/acr/internals.md#acr-ffield)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |acr.FCtype.c_cdflt|[acr.FCdflt](/txt/exe/acr/internals.md#acr-fcdflt)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |acr.FCtype.c_ssimfile|[acr.FSsimfile](/txt/exe/acr/internals.md#acr-fssimfile)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| -|acr.FCtype.zd_ctype_rec|[acr.FRec](/txt/exe/acr/internals.md#acr-frec)|[Llist](/txt/exe/amc/reftypes.md#llist)||List of all records with this ctype| +|acr.FCtype.zd_rec|[acr.FRec](/txt/exe/acr/internals.md#acr-frec)|[Llist](/txt/exe/amc/reftypes.md#llist)||List of all records with this ctype| |acr.FCtype.ind_ctype_rec|[acr.FRec](/txt/exe/acr/internals.md#acr-frec)|[Thash](/txt/exe/amc/reftypes.md#thash)||Index of records by primary key| -|acr.FCtype.zd_ctype_selrec|[acr.FRec](/txt/exe/acr/internals.md#acr-frec)|[Llist](/txt/exe/amc/reftypes.md#llist)||List of selected records| +|acr.FCtype.zd_selrec|[acr.FRec](/txt/exe/acr/internals.md#acr-frec)|[Llist](/txt/exe/amc/reftypes.md#llist)||List of selected records| |acr.FCtype.n_insert|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|Number of tuples inserted| |acr.FCtype.rank|i32|[Val](/txt/exe/amc/reftypes.md#val)|false|Topological sort rank| |acr.FCtype.c_child|[acr.FCtype](/txt/exe/acr/internals.md#acr-fctype)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||all tables that reference this table| @@ -434,13 +434,13 @@ struct FCtype { // acr.FCtype u32 c_field_max; // capacity of allocated array acr::FCdflt* c_cdflt; // optional pointer acr::FSsimfile* c_ssimfile; // optional pointer - acr::FRec* zd_ctype_rec_head; // zero-terminated doubly linked list - acr::FRec* zd_ctype_rec_tail; // pointer to last element + acr::FRec* zd_rec_head; // zero-terminated doubly linked list + acr::FRec* zd_rec_tail; // pointer to last element acr::FRec** ind_ctype_rec_buckets_elems; // pointer to bucket array i32 ind_ctype_rec_buckets_n; // number of elements in bucket array i32 ind_ctype_rec_n; // number of elements in the hash table - acr::FRec* zd_ctype_selrec_head; // zero-terminated doubly linked list - acr::FRec* zd_ctype_selrec_tail; // pointer to last element + acr::FRec* zd_selrec_head; // zero-terminated doubly linked list + acr::FRec* zd_selrec_tail; // pointer to last element i32 n_insert; // 0 Number of tuples inserted i32 rank; // false Topological sort rank acr::FCtype** c_child_elems; // array of pointers @@ -460,17 +460,18 @@ struct FCtype { // acr.FCtype acr::FSsimreq** c_ssimreq_elems; // array of pointers u32 c_ssimreq_n; // array of pointers u32 c_ssimreq_max; // capacity of allocated array - bool _db_c_ctype_front_in_ary; // false membership flag + bool c_ctype_front_in_ary; // false membership flag acr::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value acr::FCtype* zd_sel_ctype_next; // zslist link; -1 means not-in-list acr::FCtype* zd_sel_ctype_prev; // previous element i32 bh_ctype_topo_idx; // index in heap; -1 means not-in-heap // reftype Ptrary of acr.FCtype.c_field prohibits copy // x-reference on acr.FCtype.c_cdflt prevents copy // x-reference on acr.FCtype.c_ssimfile prevents copy - // reftype Llist of acr.FCtype.zd_ctype_rec prohibits copy + // reftype Llist of acr.FCtype.zd_rec prohibits copy // reftype Thash of acr.FCtype.ind_ctype_rec prohibits copy - // reftype Llist of acr.FCtype.zd_ctype_selrec prohibits copy + // reftype Llist of acr.FCtype.zd_selrec prohibits copy // reftype Ptrary of acr.FCtype.c_child prohibits copy // x-reference on acr.FCtype.c_bltin prevents copy // reftype Llist of acr.FCtype.zd_arg prohibits copy @@ -480,9 +481,9 @@ struct FCtype { // acr.FCtype // reftype Ptrary of acr.FCtype.c_field prohibits copy // x-reference on acr.FCtype.c_cdflt prevents copy // x-reference on acr.FCtype.c_ssimfile prevents copy - // reftype Llist of acr.FCtype.zd_ctype_rec prohibits copy + // reftype Llist of acr.FCtype.zd_rec prohibits copy // reftype Thash of acr.FCtype.ind_ctype_rec prohibits copy - // reftype Llist of acr.FCtype.zd_ctype_selrec prohibits copy + // reftype Llist of acr.FCtype.zd_selrec prohibits copy // reftype Ptrary of acr.FCtype.c_child prohibits copy // x-reference on acr.FCtype.c_bltin prevents copy // reftype Llist of acr.FCtype.zd_arg prohibits copy @@ -773,9 +774,10 @@ struct FEvalattr { // acr.FEvalattr Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_gen.h](/include/gen/acr_gen.h) ``` struct FField { // acr.FField - acr::FField* zd_arg_next; // zslist link; -1 means not-in-list - acr::FField* zd_arg_prev; // previous element + acr::FField* ctype_zd_arg_next; // zslist link; -1 means not-in-list + acr::FField* ctype_zd_arg_prev; // previous element acr::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -832,16 +834,17 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_gen.h](/include/gen/acr_gen.h) ``` struct FFile { // acr.FFile - acr::FFile* ind_file_next; // hash next - algo::cstring file; // Primary key - algo::cstring filename; // Non-empty if it's a real file - bool ephemeral; // false Do not save back - bool sticky; // false Records loaded from file are written back to file - u32 lineno; // 1 Current line number - acr::FRec* zd_frec_head; // zero-terminated doubly linked list - acr::FRec* zd_frec_tail; // pointer to last element - algo::UnTime modtime; // File modification time at time of loading - bool autoloaded; // false File was pulled in implicitly: loaded records are not 'inserted' + acr::FFile* ind_file_next; // hash next + u32 ind_file_hashval; // hash value + algo::cstring file; // Primary key + algo::cstring filename; // Non-empty if it's a real file + bool ephemeral; // false Do not save back + bool sticky; // false Records loaded from file are written back to file + u32 lineno; // 1 Current line number + acr::FRec* zd_frec_head; // zero-terminated doubly linked list + acr::FRec* zd_frec_tail; // pointer to last element + algo::UnTime modtime; // File modification time at time of loading + bool autoloaded; // false File was pulled in implicitly: loaded records are not 'inserted' // reftype Llist of acr.FFile.zd_frec prohibits copy // func:acr.FFile..AssignOp inline acr::FFile& operator =(const acr::FFile &rhs) = delete; @@ -903,15 +906,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_gen.h](/include/gen/acr_gen.h) ``` struct FPdep { // acr.FPdep: Dependency between two print-line records - acr::FPdep* pdep_next; // Pointer to next free element int tpool - acr::FPdep* zd_pdep_next; // zslist link; -1 means not-in-list - acr::FPdep* zd_pdep_prev; // previous element - acr::FPline* p_parent; // reference to parent row - acr::FPline* p_child; // reference to parent row - i32 weight; // 0 - i32 lindex; // 0 Index of child referencing attr - acr::FPdep* zd_child_next; // zslist link; -1 means not-in-list - acr::FPdep* zd_child_prev; // previous element + acr::FPdep* pdep_next; // Pointer to next free element int tpool + acr::FPdep* zd_pdep_next; // zslist link; -1 means not-in-list + acr::FPdep* zd_pdep_prev; // previous element + acr::FPline* p_parent; // reference to parent row + acr::FPline* p_child; // reference to parent row + i32 weight; // 0 + i32 lindex; // 0 Index of child referencing attr + acr::FPdep* pline_zd_child_next; // zslist link; -1 means not-in-list + acr::FPdep* pline_zd_child_prev; // previous element // func:acr.FPdep..AssignOp inline acr::FPdep& operator =(const acr::FPdep &rhs) = delete; // func:acr.FPdep..CopyCtor @@ -1114,10 +1117,11 @@ struct FPrint { // acr.FPrint: Print function Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_gen.h](/include/gen/acr_gen.h) ``` struct FPrintAttr { // acr.FPrintAttr - acr::FPrintAttr* ind_printattr_next; // hash next - acr::FPrint* p_print; // reference to parent row - algo::Smallstr100 field; // 0 - u32 width; // 0 Name width + acr::FPrintAttr* print_ind_printattr_next; // hash next + u32 print_ind_printattr_hashval; // hash value + acr::FPrint* p_print; // reference to parent row + algo::Smallstr100 field; // 0 + u32 width; // 0 Name width // func:acr.FPrintAttr..AssignOp inline acr::FPrintAttr& operator =(const acr::FPrintAttr &rhs) = delete; // func:acr.FPrintAttr..CopyCtor @@ -1238,6 +1242,7 @@ private: |---|---|---|---|---| |acr.FRec.pkey|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Record key (arbitrary string)| |acr.FRec.oldpkey|[algo.cstring](/txt/protocol/algo/cstring.md)|[Delptr](/txt/exe/amc/reftypes.md#delptr)||Old pkey (if renamed)| +|acr.FRec.oldhead|[algo.cstring](/txt/protocol/algo/cstring.md)|[Delptr](/txt/exe/amc/reftypes.md#delptr)||Old tuple head (if renamed)| |acr.FRec.tuple|[algo.Tuple](/txt/protocol/algo/Tuple.md)|[Val](/txt/exe/amc/reftypes.md#val)||Data item| |acr.FRec.del|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Delete?| |acr.FRec.mod|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Record was modified?| @@ -1256,36 +1261,40 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_gen.h](/include/gen/acr_gen.h) ``` struct FRec { // acr.FRec - acr::FRec* zd_ctype_rec_next; // zslist link; -1 means not-in-list - acr::FRec* zd_ctype_rec_prev; // previous element - acr::FRec* ind_ctype_rec_next; // hash next - acr::FRec* zd_ctype_selrec_next; // zslist link; -1 means not-in-list - acr::FRec* zd_ctype_selrec_prev; // previous element - acr::FRec* rec_next; // Pointer to next free element int tpool - acr::FRec* zd_all_selrec_next; // zslist link; -1 means not-in-list - acr::FRec* zd_all_selrec_prev; // previous element - acr::FRec* zd_frec_next; // zslist link; -1 means not-in-list - acr::FRec* zd_frec_prev; // previous element - algo::cstring pkey; // Record key (arbitrary string) - algo::cstring* oldpkey; // Private pointer to value - algo::Tuple tuple; // Data item - bool del; // false Delete? - bool mod; // false Record was modified? - bool metasel; // false Select for meta-data - bool isnew; // false Inserted newly - i32 seldist; // 0 Distance to selection. >0 is up, <0 is down - acr::RecSortkey sortkey; // Output sort key - acr::FPline* c_pline; // Optional pline. optional pointer - acr::FFile* p_outfile; // reference to parent row - acr::FFile* p_infile; // reference to parent row - acr::FCtype* p_ctype; // reference to parent row - i32 lineno; // 0 - bool _db_c_ssimreq_rec_in_ary; // false membership flag + acr::FRec* ctype_zd_rec_next; // zslist link; -1 means not-in-list + acr::FRec* ctype_zd_rec_prev; // previous element + acr::FRec* ctype_ind_ctype_rec_next; // hash next + u32 ctype_ind_ctype_rec_hashval; // hash value + acr::FRec* ctype_zd_selrec_next; // zslist link; -1 means not-in-list + acr::FRec* ctype_zd_selrec_prev; // previous element + acr::FRec* rec_next; // Pointer to next free element int tpool + acr::FRec* zd_all_selrec_next; // zslist link; -1 means not-in-list + acr::FRec* zd_all_selrec_prev; // previous element + acr::FRec* file_zd_frec_next; // zslist link; -1 means not-in-list + acr::FRec* file_zd_frec_prev; // previous element + algo::cstring pkey; // Record key (arbitrary string) + algo::cstring* oldpkey; // Private pointer to value + algo::cstring* oldhead; // Private pointer to value + algo::Tuple tuple; // Data item + bool del; // false Delete? + bool mod; // false Record was modified? + bool metasel; // false Select for meta-data + bool isnew; // false Inserted newly + i32 seldist; // 0 Distance to selection. >0 is up, <0 is down + acr::RecSortkey sortkey; // Output sort key + acr::FPline* c_pline; // Optional pline. optional pointer + acr::FFile* p_outfile; // reference to parent row + acr::FFile* p_infile; // reference to parent row + acr::FCtype* p_ctype; // reference to parent row + i32 lineno; // 0 + bool c_ssimreq_rec_in_ary; // false membership flag // reftype Delptr of acr.FRec.oldpkey prohibits copy + // reftype Delptr of acr.FRec.oldhead prohibits copy // x-reference on acr.FRec.c_pline prevents copy // func:acr.FRec..AssignOp acr::FRec& operator =(const acr::FRec &rhs) = delete; // reftype Delptr of acr.FRec.oldpkey prohibits copy + // reftype Delptr of acr.FRec.oldhead prohibits copy // x-reference on acr.FRec.c_pline prevents copy // func:acr.FRec..CopyCtor FRec(const acr::FRec &rhs) = delete; @@ -1345,9 +1354,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_gen.h](/include/gen/acr_gen.h) ``` struct FSortkey { // acr.FSortkey: Keep track of next rowid for each sortkey - acr::FSortkey* ind_sortkey_next; // hash next - acr::RecSortkey sortkey; // Sort key - double next_rowid; // 0 + acr::FSortkey* ind_sortkey_next; // hash next + u32 ind_sortkey_hashval; // hash value + acr::RecSortkey sortkey; // Sort key + double next_rowid; // 0 // func:acr.FSortkey..AssignOp inline acr::FSortkey& operator =(const acr::FSortkey &rhs) = delete; // func:acr.FSortkey..CopyCtor @@ -1383,12 +1393,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_gen.h](/include/gen/acr_gen.h) ``` struct FSsimfile { // acr.FSsimfile: One full table - acr::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - acr::FFile* c_file; // optional!. optional pointer - acr::FCtype* p_ctype; // reference to parent row - acr::FSsimsort* c_ssimsort; // Optional sort order. optional pointer + acr::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + acr::FFile* c_file; // optional!. optional pointer + acr::FCtype* p_ctype; // reference to parent row + acr::FSsimsort* c_ssimsort; // Optional sort order. optional pointer // x-reference on acr.FSsimfile.p_ctype prevents copy // x-reference on acr.FSsimfile.c_ssimsort prevents copy // func:acr.FSsimfile..AssignOp @@ -1476,9 +1487,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_gen.h](/include/gen/acr_gen.h) ``` struct FSsimsort { // acr.FSsimsort - acr::FSsimsort* ind_ssimsort_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 sortfld; // + acr::FSsimsort* ind_ssimsort_next; // hash next + u32 ind_ssimsort_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 sortfld; // // func:acr.FSsimsort..AssignOp inline acr::FSsimsort& operator =(const acr::FSsimsort &rhs) = delete; // func:acr.FSsimsort..CopyCtor @@ -1542,8 +1554,9 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_gen.h](/include/gen/acr_gen.h) ``` struct FTempkey { // acr.FTempkey - acr::FTempkey* ind_tempkey_next; // hash next - algo::cstring tempkey; // + acr::FTempkey* ind_tempkey_next; // hash next + u32 ind_tempkey_hashval; // hash value + algo::cstring tempkey; // // func:acr.FTempkey..AssignOp inline acr::FTempkey& operator =(const acr::FTempkey &rhs) = delete; // func:acr.FTempkey..CopyCtor @@ -1574,9 +1587,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_gen.h](/include/gen/acr_gen.h) ``` struct FUniqueattr { // acr.FUniqueattr - acr::FUniqueattr* uniqueattr_next; // Pointer to next free element int tpool - acr::FUniqueattr* ind_uniqueattr_next; // hash next - algo::cstring uniqueattr; // Data + acr::FUniqueattr* uniqueattr_next; // Pointer to next free element int tpool + acr::FUniqueattr* ind_uniqueattr_next; // hash next + u32 ind_uniqueattr_hashval; // hash value + algo::cstring uniqueattr; // Data // func:acr.FUniqueattr..AssignOp inline acr::FUniqueattr& operator =(const acr::FUniqueattr &rhs) = delete; // func:acr.FUniqueattr..CopyCtor @@ -1657,6 +1671,7 @@ These can be executed with `atf_comp -v` |[acr.BadReftype](/test/atf_comp/acr.BadReftype)|Invalid reftype detected| |[acr.CascDel](/test/atf_comp/acr.CascDel)|-del recursively deletes dependent records| |[acr.CascDel2](/test/atf_comp/acr.CascDel2)|Insert records & cascade delete them -- no change| +|[acr.CascDel3](/test/atf_comp/acr.CascDel3)|acr.delete cascade deletes| |[acr.DelField](/test/atf_comp/acr.DelField)|A field is deleted| |[acr.DelRecord](/test/atf_comp/acr.DelRecord)|A record is deleted| |[acr.DeleteReinsert](/test/atf_comp/acr.DeleteReinsert)|A record is deleted and re-inserted| diff --git a/txt/exe/acr_compl/README.md b/txt/exe/acr_compl/README.md index d5a2b5ce..45107754 100644 --- a/txt/exe/acr_compl/README.md +++ b/txt/exe/acr_compl/README.md @@ -25,8 +25,8 @@ Usage: acr_compl [options] -type string "9" Simulates COMP_TYPE (debug) -install Produce bash commands to install the handler -debug_log string "" Log file for debug information, overrides ACR_COMPL_DEBUG_LOG - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -68,17 +68,17 @@ Usage: acr_compl [options] `acr_compl` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dmmeta.anonfld](/txt/ssimdb/dmmeta/anonfld.md)|Omit field name where possible (command line, enums, constants)| +|[dmmeta.argvtype](/txt/ssimdb/dmmeta/argvtype.md)|Customize parsing of command lines (rarely used)| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| +|[dmmeta.falias](/txt/ssimdb/dmmeta/falias.md)|Alias field| +|[dmmeta.fcmdline](/txt/ssimdb/dmmeta/fcmdline.md)|Annotate field that holds process command line| +|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| +|[dmmeta.fflag](/txt/ssimdb/dmmeta/fflag.md)|Options for command-line flags| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| +|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| |[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| -|[dmmeta.fflag](/txt/ssimdb/dmmeta/fflag.md)|Options for command-line flags| -|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| -|[dmmeta.fcmdline](/txt/ssimdb/dmmeta/fcmdline.md)|Annotate field that holds process command line| -|[dmmeta.falias](/txt/ssimdb/dmmeta/falias.md)|Alias field| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dmmeta.argvtype](/txt/ssimdb/dmmeta/argvtype.md)|Customize parsing of command lines (rarely used)| -|[dmmeta.anonfld](/txt/ssimdb/dmmeta/anonfld.md)|Omit field name where possible (command line, enums, constants)| diff --git a/txt/exe/acr_compl/internals.md b/txt/exe/acr_compl/internals.md index c7a9a627..c70b48a5 100644 --- a/txt/exe/acr_compl/internals.md +++ b/txt/exe/acr_compl/internals.md @@ -303,14 +303,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_compl_gen.h](/include/gen/acr_compl_gen.h) ``` struct FCtype { // acr_compl.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - acr_compl::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - acr_compl::FSsimfile* c_ssimfile; // optional pointer - acr_compl::FArgvtype* c_argvtype; // optional pointer - acr_compl::FCtype* ind_ctype_next; // hash next + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + acr_compl::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + acr_compl::FSsimfile* c_ssimfile; // optional pointer + acr_compl::FArgvtype* c_argvtype; // optional pointer + acr_compl::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // reftype Ptrary of acr_compl.FCtype.c_field prohibits copy // x-reference on acr_compl.FCtype.c_ssimfile prevents copy // x-reference on acr_compl.FCtype.c_argvtype prevents copy @@ -621,28 +622,30 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_compl_gen.h](/include/gen/acr_compl_gen.h) ``` struct FField { // acr_compl.FField - acr_compl::FField* ind_field_next; // hash next - acr_compl::FField* zd_cmd_field_next; // zslist link; -1 means not-in-list - acr_compl::FField* zd_cmd_field_prev; // previous element - acr_compl::FField* ind_cmd_field_name_next; // hash next - algo::Smallstr100 field; // Primary key, as ctype.name - algo::Smallstr100 arg; // Type of field - algo::Smallstr50 reftype; // "Val" Type constructor - algo::CppExpr dflt; // Default value (c++ expression) - algo::Comment comment; // - acr_compl::FCtype* p_arg; // reference to parent row - acr_compl::FAnonfld* c_anonfld; // optional pointer - acr_compl::FFconst** c_fconst_elems; // array of pointers - u32 c_fconst_n; // array of pointers - u32 c_fconst_max; // capacity of allocated array - bool seen; // false - acr_compl::FFflag* c_fflag; // optional pointer - acr_compl::FCtype* p_ctype; // reference to parent row - acr_compl::FFalias* c_falias; // optional pointer - acr_compl::FFalias** c_falias_srcfield_elems; // array of pointers - u32 c_falias_srcfield_n; // array of pointers - u32 c_falias_srcfield_max; // capacity of allocated array - bool ctype_c_field_in_ary; // false membership flag + acr_compl::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value + acr_compl::FField* zd_cmd_field_next; // zslist link; -1 means not-in-list + acr_compl::FField* zd_cmd_field_prev; // previous element + acr_compl::FField* ind_cmd_field_name_next; // hash next + u32 ind_cmd_field_name_hashval; // hash value + algo::Smallstr100 field; // Primary key, as ctype.name + algo::Smallstr100 arg; // Type of field + algo::Smallstr50 reftype; // "Val" Type constructor + algo::CppExpr dflt; // Default value (c++ expression) + algo::Comment comment; // + acr_compl::FCtype* p_arg; // reference to parent row + acr_compl::FAnonfld* c_anonfld; // optional pointer + acr_compl::FFconst** c_fconst_elems; // array of pointers + u32 c_fconst_n; // array of pointers + u32 c_fconst_max; // capacity of allocated array + bool seen; // false + acr_compl::FFflag* c_fflag; // optional pointer + acr_compl::FCtype* p_ctype; // reference to parent row + acr_compl::FFalias* c_falias; // optional pointer + acr_compl::FFalias** c_falias_srcfield_elems; // array of pointers + u32 c_falias_srcfield_n; // array of pointers + u32 c_falias_srcfield_max; // capacity of allocated array + bool ctype_c_field_in_ary; // false membership flag // x-reference on acr_compl.FField.p_arg prevents copy // x-reference on acr_compl.FField.c_anonfld prevents copy // reftype Ptrary of acr_compl.FField.c_fconst prohibits copy @@ -689,12 +692,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_compl_gen.h](/include/gen/acr_compl_gen.h) ``` struct FNs { // acr_compl.FNs - acr_compl::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // - acr_compl::FFcmdline* c_fcmdline; // optional pointer + acr_compl::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // + acr_compl::FFcmdline* c_fcmdline; // optional pointer // x-reference on acr_compl.FNs.c_fcmdline prevents copy // func:acr_compl.FNs..AssignOp inline acr_compl::FNs& operator =(const acr_compl::FNs &rhs) = delete; @@ -730,10 +734,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_compl_gen.h](/include/gen/acr_compl_gen.h) ``` struct FSsimfile { // acr_compl.FSsimfile - acr_compl::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - acr_compl::FCtype* p_ctype; // reference to parent row + acr_compl::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + acr_compl::FCtype* p_ctype; // reference to parent row // x-reference on acr_compl.FSsimfile.p_ctype prevents copy // func:acr_compl.FSsimfile..AssignOp inline acr_compl::FSsimfile& operator =(const acr_compl::FSsimfile &rhs) = delete; diff --git a/txt/exe/acr_dm/README.md b/txt/exe/acr_dm/README.md index 633ddc20..62e7fe7e 100644 --- a/txt/exe/acr_dm/README.md +++ b/txt/exe/acr_dm/README.md @@ -36,8 +36,8 @@ Usage: acr_dm [[-arg:]] [options] -write_ours Write result to ours file -msize int 7 Conflict marker size -rowid Output 'ours' rowid for merging into original ssimfiles - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig diff --git a/txt/exe/acr_dm/internals.md b/txt/exe/acr_dm/internals.md index 74d99225..406d8f0c 100644 --- a/txt/exe/acr_dm/internals.md +++ b/txt/exe/acr_dm/internals.md @@ -79,12 +79,12 @@ All allocations are done through global `acr_dm::_db` [acr_dm.FDb](#acr_dm-fdb) Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_dm_gen.h](/include/gen/acr_dm_gen.h) ``` struct FAttr { // acr_dm.FAttr - algo::cstring name; // - acr_dm::FTuple* p_tuple; // reference to parent row - acr_dm::FValue* zs_value_head; // zero-terminated singly linked list - i32 zs_value_n; // zero-terminated singly linked list - acr_dm::FValue* zs_value_tail; // pointer to last element - acr_dm::FAttr* zs_attr_next; // zslist link; -1 means not-in-list + algo::cstring name; // + acr_dm::FTuple* p_tuple; // reference to parent row + acr_dm::FValue* zs_value_head; // zero-terminated singly linked list + i32 zs_value_n; // zero-terminated singly linked list + acr_dm::FValue* zs_value_tail; // pointer to last element + acr_dm::FAttr* tuple_zs_attr_next; // zslist link; -1 means not-in-list // reftype Llist of acr_dm.FAttr.zs_value prohibits copy // func:acr_dm.FAttr..AssignOp inline acr_dm::FAttr& operator =(const acr_dm::FAttr &rhs) = delete; @@ -215,14 +215,15 @@ struct Source { // acr_dm.Source Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_dm_gen.h](/include/gen/acr_dm_gen.h) ``` struct FTuple { // acr_dm.FTuple - acr_dm::FTuple* ind_tuple_next; // hash next - i32 bh_tuple_idx; // index in heap; -1 means not-in-heap - algo::cstring key; // - acr_dm::Rowid rowid; // - acr_dm::FAttr* zs_attr_head; // zero-terminated singly linked list - i32 zs_attr_n; // zero-terminated singly linked list - acr_dm::FAttr* zs_attr_tail; // pointer to last element - acr_dm::Source source; // + acr_dm::FTuple* ind_tuple_next; // hash next + u32 ind_tuple_hashval; // hash value + i32 bh_tuple_idx; // index in heap; -1 means not-in-heap + algo::cstring key; // + acr_dm::Rowid rowid; // + acr_dm::FAttr* zs_attr_head; // zero-terminated singly linked list + i32 zs_attr_n; // zero-terminated singly linked list + acr_dm::FAttr* zs_attr_tail; // pointer to last element + acr_dm::Source source; // // reftype Llist of acr_dm.FTuple.zs_attr prohibits copy // func:acr_dm.FTuple..AssignOp inline acr_dm::FTuple& operator =(const acr_dm::FTuple &rhs) = delete; @@ -257,10 +258,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_dm_gen.h](/include/gen/acr_dm_gen.h) ``` struct FValue { // acr_dm.FValue - acr_dm::FValue* zs_value_next; // zslist link; -1 means not-in-list - algo::cstring value; // - acr_dm::FAttr* p_attr; // reference to parent row - acr_dm::Source source; // + acr_dm::FValue* attr_zs_value_next; // zslist link; -1 means not-in-list + algo::cstring value; // + acr_dm::FAttr* p_attr; // reference to parent row + acr_dm::Source source; // // func:acr_dm.FValue..AssignOp inline acr_dm::FValue& operator =(const acr_dm::FValue &rhs) = delete; // func:acr_dm.FValue..CopyCtor diff --git a/txt/exe/acr_ed/README.md b/txt/exe/acr_ed/README.md index f623db14..ec6bd7ad 100644 --- a/txt/exe/acr_ed/README.md +++ b/txt/exe/acr_ed/README.md @@ -64,8 +64,9 @@ Usage: acr_ed [options] -showcpp (With -sandbox), show resulting diff -msgtype string "" (with -ctype) use this msgtype as type -anonfld Create anonfld - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -amc Y Run amc if needed + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -587,6 +588,9 @@ transaction in sandbox. #### -anonfld -- Create anonfld +#### -amc -- Run amc if needed + + ### Inputs @@ -595,23 +599,24 @@ transaction in sandbox. `acr_ed` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dev.gitfile](/txt/ssimdb/dev/gitfile.md)|File managed by git| -|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| +|[dmmeta.cpptype](/txt/ssimdb/dmmeta/cpptype.md)|Specify whether a ctype can be passed by value, and other c++ options| +|[dmmeta.cstr](/txt/ssimdb/dmmeta/cstr.md)|Specify that type behaves like a string| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.typefld](/txt/ssimdb/dmmeta/typefld.md)|Specifies which field of a message carries the type| -|[dmmeta.nsdb](/txt/ssimdb/dmmeta/nsdb.md)|Annotate ssimdb namespaces| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| -|[dmmeta.pack](/txt/ssimdb/dmmeta/pack.md)|Request byte-packing of structure fields| |[dmmeta.fprefix](/txt/ssimdb/dmmeta/fprefix.md)|Mapping between field prefix and Reftype| +|[dev.gitfile](/txt/ssimdb/dev/gitfile.md)|File managed by git| |[dmmeta.listtype](/txt/ssimdb/dmmeta/listtype.md)|Specify structure of linked list based on field prefix| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dmmeta.cstr](/txt/ssimdb/dmmeta/cstr.md)|Specify that type behaves like a string| -|[dmmeta.cpptype](/txt/ssimdb/dmmeta/cpptype.md)|Specify whether a ctype can be passed by value, and other c++ options| -|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| +|[dmmeta.msgtype](/txt/ssimdb/dmmeta/msgtype.md)|Specify message type for each eligible message, controls dispatch| +|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.nsdb](/txt/ssimdb/dmmeta/nsdb.md)|Annotate ssimdb namespaces| +|[dmmeta.pack](/txt/ssimdb/dmmeta/pack.md)|Request byte-packing of structure fields| +|[dev.sbpath](/txt/ssimdb/dev/sbpath.md)|Extra files to copy into the sandbox| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| |[dev.target](/txt/ssimdb/dev/target.md)|Build target| |[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|List of sources for target| -|[dev.sbpath](/txt/ssimdb/dev/sbpath.md)|Extra files to copy into the sandbox| +|[dmmeta.typefld](/txt/ssimdb/dmmeta/typefld.md)|Specifies which field of a message carries the type| diff --git a/txt/exe/acr_ed/internals.md b/txt/exe/acr_ed/internals.md index 11bde1c2..883241c7 100644 --- a/txt/exe/acr_ed/internals.md +++ b/txt/exe/acr_ed/internals.md @@ -77,6 +77,7 @@ All allocations are done through global `acr_ed::_db` [acr_ed.FDb](#acr_ed-fdb) |[acr_ed.FFprefix](#acr_ed-ffprefix)|[dmmeta.fprefix](/txt/ssimdb/dmmeta/fprefix.md)|FDb.fprefix (Lary)|fprefix (Lary, by rowid)|ind_fprefix (Thash, hash field fprefix)| |[acr_ed.FGitfile](#acr_ed-fgitfile)|[dev.gitfile](/txt/ssimdb/dev/gitfile.md)|FDb.gitfile (Lary)|gitfile (Lary, by rowid)| |[acr_ed.FListtype](#acr_ed-flisttype)|[dmmeta.listtype](/txt/ssimdb/dmmeta/listtype.md)|FDb.listtype (Lary)|listtype (Lary, by rowid)|ind_listtype (Thash, hash field listtype)| +|[acr_ed.FMsgtype](#acr_ed-fmsgtype)|[dmmeta.msgtype](/txt/ssimdb/dmmeta/msgtype.md)|FDb.msgtype (Lary)|msgtype (Lary, by rowid)| |[acr_ed.FNs](#acr_ed-fns)|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|FDb.ns (Lary)|ns (Lary, by rowid)|ind_ns (Thash, hash field ns)| ||||FCtype.p_ns (Upptr)| ||||FField.p_ns (Upptr)| @@ -228,21 +229,22 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_ed_gen.h](/include/gen/acr_ed_gen.h) ``` struct FCtype { // acr_ed.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - acr_ed::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - acr_ed::FCstr* c_cstr; // optional pointer - acr_ed::FNs* p_ns; // reference to parent row - acr_ed::FSsimfile* c_ssimfile; // optional pointer - acr_ed::FPack* c_pack; // optional pointer - acr_ed::FTypefld* c_typefld; // optional pointer - acr_ed::FCpptype* c_cpptype; // optional pointer - acr_ed::FCfmt** c_cfmt_elems; // array of pointers - u32 c_cfmt_n; // array of pointers - u32 c_cfmt_max; // capacity of allocated array - acr_ed::FCtype* ind_ctype_next; // hash next + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + acr_ed::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + acr_ed::FCstr* c_cstr; // optional pointer + acr_ed::FNs* p_ns; // reference to parent row + acr_ed::FSsimfile* c_ssimfile; // optional pointer + acr_ed::FPack* c_pack; // optional pointer + acr_ed::FTypefld* c_typefld; // optional pointer + acr_ed::FCpptype* c_cpptype; // optional pointer + acr_ed::FCfmt** c_cfmt_elems; // array of pointers + u32 c_cfmt_n; // array of pointers + u32 c_cfmt_max; // capacity of allocated array + acr_ed::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // reftype Ptrary of acr_ed.FCtype.c_field prohibits copy // x-reference on acr_ed.FCtype.c_cstr prevents copy // x-reference on acr_ed.FCtype.p_ns prevents copy @@ -292,12 +294,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_ed_gen.h](/include/gen/acr_ed_gen.h) ``` struct FEdaction { // acr_ed.FEdaction - algo::Smallstr50 edaction; // - bool needamc; // false - algo::Comment comment; // - acr_ed::edaction_step_hook step; // NULL Pointer to a function - bool select; // false - acr_ed::FEdaction* ind_edaction_next; // hash next + algo::Smallstr50 edaction; // + bool needamc; // false + algo::Comment comment; // + acr_ed::edaction_step_hook step; // NULL Pointer to a function + bool select; // false + acr_ed::FEdaction* ind_edaction_next; // hash next + u32 ind_edaction_hashval; // hash value // reftype Hook of acr_ed.FEdaction.step prohibits copy // func:acr_ed.FEdaction..AssignOp inline acr_ed::FEdaction& operator =(const acr_ed::FEdaction &rhs) = delete; @@ -355,6 +358,7 @@ struct FEdaction { // acr_ed.FEdaction |acr_ed.FDb.edaction|[acr_ed.FEdaction](/txt/exe/acr_ed/internals.md#acr_ed-fedaction)|[Inlary](/txt/exe/amc/reftypes.md#inlary)||| |acr_ed.FDb.ind_edaction|[acr_ed.FEdaction](/txt/exe/acr_ed/internals.md#acr_ed-fedaction)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |acr_ed.FDb.gitfile|[acr_ed.FGitfile](/txt/exe/acr_ed/internals.md#acr_ed-fgitfile)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|acr_ed.FDb.msgtype|[acr_ed.FMsgtype](/txt/exe/acr_ed/internals.md#acr_ed-fmsgtype)|[Lary](/txt/exe/amc/reftypes.md#lary)||| #### Struct FDb @@ -442,6 +446,8 @@ struct FDb { // acr_ed.FDb: In-memory database for acr_ed i32 ind_edaction_n; // number of elements in the hash table acr_ed::FGitfile* gitfile_lary[32]; // level array i32 gitfile_n; // number of elements in array + acr_ed::FMsgtype* msgtype_lary[32]; // level array + i32 msgtype_n; // number of elements in array acr_ed::trace trace; // }; ``` @@ -466,6 +472,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_ed_gen.h](/incl ``` struct FField { // acr_ed.FField acr_ed::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -512,10 +519,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_ed_gen.h](/include/gen/acr_ed_gen.h) ``` struct FFprefix { // acr_ed.FFprefix - acr_ed::FFprefix* ind_fprefix_next; // hash next - algo::Smallstr5 fprefix; // - algo::Smallstr50 reftype; // - algo::Comment comment; // + acr_ed::FFprefix* ind_fprefix_next; // hash next + u32 ind_fprefix_hashval; // hash value + algo::Smallstr5 fprefix; // + algo::Smallstr50 reftype; // + algo::Comment comment; // // func:acr_ed.FFprefix..AssignOp inline acr_ed::FFprefix& operator =(const acr_ed::FFprefix &rhs) = delete; // func:acr_ed.FFprefix..CopyCtor @@ -574,12 +582,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_ed_gen.h](/include/gen/acr_ed_gen.h) ``` struct FListtype { // acr_ed.FListtype - acr_ed::FListtype* ind_listtype_next; // hash next - algo::Smallstr5 listtype; // - bool circular; // false Circular list - bool haveprev; // false Previous link - bool instail; // false Queue - algo::Comment comment; // + acr_ed::FListtype* ind_listtype_next; // hash next + u32 ind_listtype_hashval; // hash value + algo::Smallstr5 listtype; // + bool circular; // false Circular list + bool haveprev; // false Previous link + bool instail; // false Queue + algo::Comment comment; // // func:acr_ed.FListtype..AssignOp inline acr_ed::FListtype& operator =(const acr_ed::FListtype &rhs) = delete; // func:acr_ed.FListtype..CopyCtor @@ -595,6 +604,34 @@ private: }; ``` +#### acr_ed.FMsgtype - Specify message type for each eligible message, controls dispatch + + +#### acr_ed.FMsgtype Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|acr_ed.FMsgtype.base|[dmmeta.Msgtype](/txt/ssimdb/dmmeta/msgtype.md)|[Base](/txt/ssimdb/dmmeta/msgtype.md)||| + +#### Struct FMsgtype + +*Note:* field ``acr_ed.FMsgtype.base`` has reftype ``base`` so the fields of [dmmeta.Msgtype](/txt/ssimdb/dmmeta/msgtype.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_ed_gen.h](/include/gen/acr_ed_gen.h) +``` +struct FMsgtype { // acr_ed.FMsgtype + algo::Smallstr100 ctype; // + algo::CppExpr type; // +private: + // func:acr_ed.FMsgtype..Ctor + inline FMsgtype() __attribute__((nothrow)); + friend acr_ed::FMsgtype& msgtype_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend acr_ed::FMsgtype* msgtype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void msgtype_RemoveAll() __attribute__((nothrow)); + friend void msgtype_RemoveLast() __attribute__((nothrow)); +}; +``` + #### acr_ed.FNs - Namespace (for in-memory database, protocol, etc) @@ -611,11 +648,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_ed_gen.h](/include/gen/acr_ed_gen.h) ``` struct FNs { // acr_ed.FNs - acr_ed::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // + acr_ed::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // // func:acr_ed.FNs..AssignOp inline acr_ed::FNs& operator =(const acr_ed::FNs &rhs) = delete; // func:acr_ed.FNs..CopyCtor @@ -647,9 +685,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_ed_gen.h](/include/gen/acr_ed_gen.h) ``` struct FNsdb { // acr_ed.FNsdb - acr_ed::FNsdb* ind_nsdb_next; // hash next - algo::Smallstr16 ns; // - algo::Comment comment; // + acr_ed::FNsdb* ind_nsdb_next; // hash next + u32 ind_nsdb_hashval; // hash value + algo::Smallstr16 ns; // + algo::Comment comment; // // func:acr_ed.FNsdb..AssignOp inline acr_ed::FNsdb& operator =(const acr_ed::FNsdb &rhs) = delete; // func:acr_ed.FNsdb..CopyCtor @@ -746,11 +785,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_ed_gen.h](/include/gen/acr_ed_gen.h) ``` struct FSsimfile { // acr_ed.FSsimfile - acr_ed::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - acr_ed::FCtype* p_ctype; // reference to parent row - acr_ed::FNs* p_ns; // reference to parent row + acr_ed::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + acr_ed::FCtype* p_ctype; // reference to parent row + acr_ed::FNs* p_ns; // reference to parent row // x-reference on acr_ed.FSsimfile.p_ctype prevents copy // x-reference on acr_ed.FSsimfile.p_ns prevents copy // func:acr_ed.FSsimfile..AssignOp @@ -789,13 +829,14 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_ed_gen.h](/include/gen/acr_ed_gen.h) ``` struct FTarget { // acr_ed.FTarget - acr_ed::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target - u32 score; // 0 For guessing target from source file - acr_ed::FTargsrc* zd_targsrc_head; // zero-terminated doubly linked list - i32 zd_targsrc_n; // zero-terminated doubly linked list - acr_ed::FTargsrc* zd_targsrc_tail; // pointer to last element - acr_ed::FNs* p_ns; // reference to parent row + acr_ed::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target + u32 score; // 0 For guessing target from source file + acr_ed::FTargsrc* zd_targsrc_head; // zero-terminated doubly linked list + i32 zd_targsrc_n; // zero-terminated doubly linked list + acr_ed::FTargsrc* zd_targsrc_tail; // pointer to last element + acr_ed::FNs* p_ns; // reference to parent row // reftype Llist of acr_ed.FTarget.zd_targsrc prohibits copy // x-reference on acr_ed.FTarget.p_ns prevents copy // func:acr_ed.FTarget..AssignOp @@ -832,11 +873,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_ed_gen.h](/include/gen/acr_ed_gen.h) ``` struct FTargsrc { // acr_ed.FTargsrc - acr_ed::FTargsrc* zd_targsrc_next; // zslist link; -1 means not-in-list - acr_ed::FTargsrc* zd_targsrc_prev; // previous element - algo::Smallstr100 targsrc; // - algo::Comment comment; // - acr_ed::FTarget* p_target; // reference to parent row + acr_ed::FTargsrc* target_zd_targsrc_next; // zslist link; -1 means not-in-list + acr_ed::FTargsrc* target_zd_targsrc_prev; // previous element + algo::Smallstr100 targsrc; // + algo::Comment comment; // + acr_ed::FTarget* p_target; // reference to parent row // x-reference on acr_ed.FTargsrc.p_target prevents copy // func:acr_ed.FTargsrc..AssignOp inline acr_ed::FTargsrc& operator =(const acr_ed::FTargsrc &rhs) = delete; @@ -899,8 +940,11 @@ These can be executed with `atf_comp -v` |Comptest|Comment| |---|---| |[acr_ed.CreateCtype](/test/atf_comp/acr_ed.CreateCtype)|Create a regular ctype| +|[acr_ed.CreateMsg](/test/atf_comp/acr_ed.CreateMsg)|Create a message| |[acr_ed.CreateSrcfileTarget](/test/atf_comp/acr_ed.CreateSrcfileTarget)|Create a source file in a non-standard location for its target| +|[acr_ed.CreateSsimfile](/test/atf_comp/acr_ed.CreateSsimfile)|Script to create a new ssimfile| |[acr_ed.CreateSsimfileBadNs](/test/atf_comp/acr_ed.CreateSsimfileBadNs)|Create a ssimfile for a non-existence namespace| +|[acr_ed.CreateTarget](/test/atf_comp/acr_ed.CreateTarget)|Script to create a new target| diff --git a/txt/exe/acr_in/README.md b/txt/exe/acr_in/README.md index b595a4ce..f1e03860 100644 --- a/txt/exe/acr_in/README.md +++ b/txt/exe/acr_in/README.md @@ -30,8 +30,8 @@ Usage: acr_in [[-ns:]] [options] -notssimfile regx "" Exclude ssimfiles matching regx -checkable Ensure output passes acr -check -r regx "" Reverse lookup of target by ssimfile - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -179,16 +179,16 @@ via the targdep table. `acr_in` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| +|[dmmeta.dispsig](/txt/ssimdb/dmmeta/dispsig.md)|Cryptographic signature of all dispatches| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| |[dmmeta.finput](/txt/ssimdb/dmmeta/finput.md)|Describe input table of a program| -|[dmmeta.dispsig](/txt/ssimdb/dmmeta/dispsig.md)|Cryptographic signature of all dispatches| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dev.target](/txt/ssimdb/dev/target.md)|Build target| +|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| |[dev.targdep](/txt/ssimdb/dev/targdep.md)|Dependency between targets| +|[dev.target](/txt/ssimdb/dev/target.md)|Build target| diff --git a/txt/exe/acr_in/internals.md b/txt/exe/acr_in/internals.md index 468f54cf..16fc6cff 100644 --- a/txt/exe/acr_in/internals.md +++ b/txt/exe/acr_in/internals.md @@ -113,25 +113,26 @@ All allocations are done through global `acr_in::_db` [acr_in.FDb](#acr_in-fdb) Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_in_gen.h](/include/gen/acr_in_gen.h) ``` struct FCtype { // acr_in.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - acr_in::FSsimfile* c_ssimfile; // optional pointer - bool related; // false Matches 'related' regex - bool select; // false - bool visit; // false - acr_in::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - acr_in::FCtype** c_ctype_elems; // array of pointers - u32 c_ctype_n; // array of pointers - u32 c_ctype_max; // capacity of allocated array - bool parent_of_finput; // false Ctype required by one of the namespaces - acr_in::FNs* p_ns; // reference to parent row - acr_in::FCtype* ind_ctype_next; // hash next - acr_in::FCtype* zd_todo_next; // zslist link; -1 means not-in-list - acr_in::FCtype* zd_todo_prev; // previous element - acr_in::FCtype* zd_related_next; // zslist link; -1 means not-in-list - acr_in::FCtype* zd_related_prev; // previous element + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + acr_in::FSsimfile* c_ssimfile; // optional pointer + bool related; // false Matches 'related' regex + bool select; // false + bool visit; // false + acr_in::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + acr_in::FCtype** c_ctype_elems; // array of pointers + u32 c_ctype_n; // array of pointers + u32 c_ctype_max; // capacity of allocated array + bool parent_of_finput; // false Ctype required by one of the namespaces + acr_in::FNs* p_ns; // reference to parent row + acr_in::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value + acr_in::FCtype* zd_todo_next; // zslist link; -1 means not-in-list + acr_in::FCtype* zd_todo_prev; // previous element + acr_in::FCtype* zd_related_next; // zslist link; -1 means not-in-list + acr_in::FCtype* zd_related_prev; // previous element // x-reference on acr_in.FCtype.c_ssimfile prevents copy // reftype Ptrary of acr_in.FCtype.c_field prohibits copy // reftype Ptrary of acr_in.FCtype.c_ctype prohibits copy @@ -285,10 +286,11 @@ struct FDb { // acr_in.FDb: In-memory database for acr_in Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_in_gen.h](/include/gen/acr_in_gen.h) ``` struct FDispsig { // acr_in.FDispsig - acr_in::FDispsig* ind_dispsig_next; // hash next - algo::Smallstr50 dispsig; // - algo::Sha1sig signature; // - acr_in::FNs* p_ns; // reference to parent row + acr_in::FDispsig* ind_dispsig_next; // hash next + u32 ind_dispsig_hashval; // hash value + algo::Smallstr50 dispsig; // + algo::Sha1sig signature; // + acr_in::FNs* p_ns; // reference to parent row // x-reference on acr_in.FDispsig.p_ns prevents copy // func:acr_in.FDispsig..AssignOp inline acr_in::FDispsig& operator =(const acr_in::FDispsig &rhs) = delete; @@ -326,6 +328,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_in_gen.h](/incl ``` struct FField { // acr_in.FField acr_in::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -374,14 +377,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_in_gen.h](/include/gen/acr_in_gen.h) ``` struct FFinput { // acr_in.FFinput - acr_in::FFinput* ind_finput_next; // hash next - algo::Smallstr100 field; // Target field to read - bool extrn; // false Call user-provided function - bool update; // false - bool strict; // true Exist process if record contains error - algo::Comment comment; // - acr_in::FNs* p_ns; // reference to parent row - acr_in::FField* p_field; // reference to parent row + acr_in::FFinput* ind_finput_next; // hash next + u32 ind_finput_hashval; // hash value + algo::Smallstr100 field; // Target field to read + bool extrn; // false Call user-provided function + bool update; // false + bool strict; // true Exist process if record contains error + algo::Comment comment; // + acr_in::FNs* p_ns; // reference to parent row + acr_in::FField* p_field; // reference to parent row // x-reference on acr_in.FFinput.p_ns prevents copy // x-reference on acr_in.FFinput.p_field prevents copy // func:acr_in.FFinput..AssignOp @@ -421,6 +425,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_in_gen.h](/incl ``` struct FNs { // acr_in.FNs acr_in::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value algo::Smallstr16 ns; // Namespace name (primary key) algo::Smallstr50 nstype; // Namespace type algo::Smallstr50 license; // Associated license @@ -468,15 +473,16 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_in_gen.h](/include/gen/acr_in_gen.h) ``` struct FNsssimfile { // acr_in.FNsssimfile - acr_in::FNsssimfile* ind_nsssimfile_next; // hash next - acr_in::FNsssimfile* zd_nsssimfile_ns_next; // zslist link; -1 means not-in-list - acr_in::FNsssimfile* zd_nsssimfile_ns_prev; // previous element - algo::Smallstr200 nsssimfile; // - bool show; // false - acr_in::FNs* p_ns; // reference to parent row - acr_in::FSsimfile* p_ssimfile; // reference to parent row - acr_in::FNsssimfile* zd_nsssimfile_ssimfile_next; // zslist link; -1 means not-in-list - acr_in::FNsssimfile* zd_nsssimfile_ssimfile_prev; // previous element + acr_in::FNsssimfile* ind_nsssimfile_next; // hash next + u32 ind_nsssimfile_hashval; // hash value + acr_in::FNsssimfile* ns_zd_nsssimfile_ns_next; // zslist link; -1 means not-in-list + acr_in::FNsssimfile* ns_zd_nsssimfile_ns_prev; // previous element + algo::Smallstr200 nsssimfile; // + bool show; // false + acr_in::FNs* p_ns; // reference to parent row + acr_in::FSsimfile* p_ssimfile; // reference to parent row + acr_in::FNsssimfile* ssimfile_zd_nsssimfile_ssimfile_next; // zslist link; -1 means not-in-list + acr_in::FNsssimfile* ssimfile_zd_nsssimfile_ssimfile_prev; // previous element // x-reference on acr_in.FNsssimfile.p_ns prevents copy // x-reference on acr_in.FNsssimfile.p_ssimfile prevents copy // func:acr_in.FNsssimfile..AssignOp @@ -519,6 +525,7 @@ struct FSsimfile { // acr_in.FSsimfile acr_in::FSsimfile* zd_ssimfile_next; // zslist link; -1 means not-in-list acr_in::FSsimfile* zd_ssimfile_prev; // previous element acr_in::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value algo::Smallstr50 ssimfile; // algo::Smallstr100 ctype; // acr_in::FCtype* p_ctype; // reference to parent row @@ -638,6 +645,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_in_gen.h](/incl ``` struct FTarget { // acr_in.FTarget acr_in::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value acr_in::FTarget* zd_targ_visit_next; // zslist link; -1 means not-in-list acr_in::FTarget* zd_targ_visit_prev; // previous element algo::Smallstr16 target; // Primary key - name of target @@ -688,21 +696,22 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/acr_in_gen.h](/include/gen/acr_in_gen.h) ``` struct FTuple { // acr_in.FTuple - acr_in::FTuple* ind_tuple_next; // hash next - acr_in::FTuple* zd_select_next; // zslist link; -1 means not-in-list - acr_in::FTuple* zd_select_prev; // previous element - acr_in::FTuple* zd_deselect_next; // zslist link; -1 means not-in-list - acr_in::FTuple* zd_deselect_prev; // previous element - algo::cstring key; // - algo::cstring str; // - acr_in::FTuple** c_child_elems; // array of pointers - u32 c_child_n; // array of pointers - u32 c_child_max; // capacity of allocated array - acr_in::FCtype* p_ctype; // reference to parent row - acr_in::FTuple** c_parent_elems; // array of pointers - u32 c_parent_n; // array of pointers - u32 c_parent_max; // capacity of allocated array - bool deselect_visited; // false + acr_in::FTuple* ind_tuple_next; // hash next + u32 ind_tuple_hashval; // hash value + acr_in::FTuple* zd_select_next; // zslist link; -1 means not-in-list + acr_in::FTuple* zd_select_prev; // previous element + acr_in::FTuple* zd_deselect_next; // zslist link; -1 means not-in-list + acr_in::FTuple* zd_deselect_prev; // previous element + algo::cstring key; // + algo::cstring str; // + acr_in::FTuple** c_child_elems; // array of pointers + u32 c_child_n; // array of pointers + u32 c_child_max; // capacity of allocated array + acr_in::FCtype* p_ctype; // reference to parent row + acr_in::FTuple** c_parent_elems; // array of pointers + u32 c_parent_n; // array of pointers + u32 c_parent_max; // capacity of allocated array + bool deselect_visited; // false // reftype Ptrary of acr_in.FTuple.c_child prohibits copy // reftype Ptrary of acr_in.FTuple.c_parent prohibits copy // func:acr_in.FTuple..AssignOp diff --git a/txt/exe/acr_my/README.md b/txt/exe/acr_my/README.md index 3afd18e5..a0541a32 100644 --- a/txt/exe/acr_my/README.md +++ b/txt/exe/acr_my/README.md @@ -32,8 +32,8 @@ Usage: acr_my [[-nsdb:]] [options] -abort Abort local mysql server, losing data -shell Connect to local mysql server -serv Start mysql with TCP/IP service enabled - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -147,9 +147,9 @@ can be round tripped through MariaDB with no change. `acr_my` takes the following tables on input: |Ssimfile|Comment| |---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| |[dmmeta.nsdb](/txt/ssimdb/dmmeta/nsdb.md)|Annotate ssimdb namespaces| |[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| diff --git a/txt/exe/amc/README.md b/txt/exe/amc/README.md index 3a477ca1..6462ec07 100644 --- a/txt/exe/amc/README.md +++ b/txt/exe/amc/README.md @@ -35,19 +35,20 @@ of concepts, see [Intro](/txt/exe/amc/intro.md) ``` amc: Algo Model Compiler: generate code under include/gen and cpp/gen Usage: amc [[-query:]] [options] - OPTION TYPE DFLT COMMENT - -in_dir string "data" Root of input ssim dir - [query] string "" Query mode: generate code for specified object - -out_dir string "." Root of output cpp dir - -proto Print prototype - -report Y Final report - -e Open matching records in editor - -trace regx "" Regx of something to trace code generation - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative - -help Print help and exit; alias -h - -version Print version and exit - -signature Show signatures and exit; alias -sig + OPTION TYPE DFLT COMMENT + -in_dir string "data" Root of input ssim dir + [query] string "" Query mode: generate code for specified object + -out_dir string "." Root of output cpp dir + -proto Print prototype + -showcomment Y Show generated comments + -report Y Final report + -e Open matching records in editor + -trace regx "" Regx of something to trace code generation + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative + -help Print help and exit; alias -h + -version Print version and exit + -signature Show signatures and exit; alias -sig ``` @@ -135,6 +136,9 @@ Example: output all functions which are used to compile amc itself Used with `-query`, limits the output to just function prototypes +#### -showcomment -- Show generated comments + + #### -report -- Final report @@ -152,107 +156,112 @@ Used with `-query`, limits the output to just function prototypes `amc` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dev.license](/txt/ssimdb/dev/license.md)|Source code license| -|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dmmeta.anonfld](/txt/ssimdb/dmmeta/anonfld.md)|Omit field name where possible (command line, enums, constants)| +|[dmmeta.argvtype](/txt/ssimdb/dmmeta/argvtype.md)|Customize parsing of command lines (rarely used)| +|[dmmeta.basepool](/txt/ssimdb/dmmeta/basepool.md)|Specify pool to be used for allocating elements of a type| +|[dmmeta.bitfld](/txt/ssimdb/dmmeta/bitfld.md)|Specify offset/width of a bitfield within another field| +|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dmmeta.cafter](/txt/ssimdb/dmmeta/cafter.md)|Control amc processing order for unrelated types (used in rare situations)| +|[dmmeta.cascdel](/txt/ssimdb/dmmeta/cascdel.md)|Request cascading delete of referenced rows| +|[dmmeta.ccmp](/txt/ssimdb/dmmeta/ccmp.md)|Generate hash function| +|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.cextern](/txt/ssimdb/dmmeta/cextern.md)|Externally defined ctype (a struct from system header, or from a c++ library)| +|[dmmeta.cfast](/txt/ssimdb/dmmeta/cfast.md)|FAST properties for ctype| +|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| +|[dmmeta.cget](/txt/ssimdb/dmmeta/cget.md)|Generate state functions for these ctypes| +|[dmmeta.charset](/txt/ssimdb/dmmeta/charset.md)|Generate functions to determine if a character is a member of a set| +|[dmmeta.chash](/txt/ssimdb/dmmeta/chash.md)|Generate hash function| +|[dmmeta.ckafka](/txt/ssimdb/dmmeta/ckafka.md)|| +|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| +|[dmmeta.cpptype](/txt/ssimdb/dmmeta/cpptype.md)|Specify whether a ctype can be passed by value, and other c++ options| +|[dmmeta.csize](/txt/ssimdb/dmmeta/csize.md)|Specify size/alignment for built-in C++ types| +|[dmmeta.cstr](/txt/ssimdb/dmmeta/cstr.md)|Specify that type behaves like a string| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| +|[dmmeta.dispatch](/txt/ssimdb/dmmeta/dispatch.md)|Generate code for a multi-way branch| +|[dmmeta.dispatch_msg](/txt/ssimdb/dmmeta/dispatch_msg.md)|Add message to a dispatch| +|[dmmeta.dispctx](/txt/ssimdb/dmmeta/dispctx.md)|Use context with dispatch| +|[dmmeta.dispfilter](/txt/ssimdb/dmmeta/dispfilter.md)|Generate filter function on dispatch| +|[dmmeta.disptrace](/txt/ssimdb/dmmeta/disptrace.md)|Generate trace fields (cycles, counts) for all dispatch branches| +|[dmmeta.falias](/txt/ssimdb/dmmeta/falias.md)|Alias field| +|[dmmeta.fbase](/txt/ssimdb/dmmeta/fbase.md)|Customize imported Base fields| +|[dmmeta.fbigend](/txt/ssimdb/dmmeta/fbigend.md)|Annotate field as having big-endian storage| +|[dmmeta.fbitset](/txt/ssimdb/dmmeta/fbitset.md)|Generate bitset functions over integer field or array| +|[dmmeta.fbuf](/txt/ssimdb/dmmeta/fbuf.md)|Buffer for reading/writing messages, works with Iohook| +|[dmmeta.fbuftype](/txt/ssimdb/dmmeta/fbuftype.md)|Buffer type| +|[dmmeta.fcast](/txt/ssimdb/dmmeta/fcast.md)|Generate implicit conversion from field to c++ expression| +|[dmmeta.fcleanup](/txt/ssimdb/dmmeta/fcleanup.md)|Request user-implemented function to be called at Uninit time for a field| +|[dmmeta.fcmap](/txt/ssimdb/dmmeta/fcmap.md)|Bidirectional mapping between fconst values| +|[dmmeta.fcmdline](/txt/ssimdb/dmmeta/fcmdline.md)|Annotate field that holds process command line| +|[dmmeta.fcmp](/txt/ssimdb/dmmeta/fcmp.md)|Request versionsort or case-insensitive sort for field| +|[dmmeta.fcompact](/txt/ssimdb/dmmeta/fcompact.md)|Request compaction upon removal from index| +|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| +|[dmmeta.fcurs](/txt/ssimdb/dmmeta/fcurs.md)|Request generation of custom cursor| +|[dmmeta.fdec](/txt/ssimdb/dmmeta/fdec.md)|Specify that field has an implied # of decimal places and specify formatting options| +|[dmmeta.fdelay](/txt/ssimdb/dmmeta/fdelay.md)|Control elapsed time between execution of a step| +|[dmmeta.ffast](/txt/ssimdb/dmmeta/ffast.md)|FAST properties for field| +|[dmmeta.fflag](/txt/ssimdb/dmmeta/fflag.md)|Options for command-line flags| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.xref](/txt/ssimdb/dmmeta/xref.md)|Specify how to cross-reference (i.e. project, or group-by) one record with another| -|[dmmeta.usertracefld](/txt/ssimdb/dmmeta/usertracefld.md)|Add custom user trace fields to process's trace struct| -|[dmmeta.typefld](/txt/ssimdb/dmmeta/typefld.md)|Specifies which field of a message carries the type| -|[dmmeta.thash](/txt/ssimdb/dmmeta/thash.md)|Hash index, required for fields with reftype Thash| -|[dmmeta.tary](/txt/ssimdb/dmmeta/tary.md)|Indirect linear dynamically alocated array (used for strings, arrays of data, etc)| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -|[dmmeta.nsdb](/txt/ssimdb/dmmeta/nsdb.md)|Annotate ssimdb namespaces| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| -|[dmmeta.ssimvolatile](/txt/ssimdb/dmmeta/ssimvolatile.md)|Types based on ssim files marked this way cannot be cross-referenced| -|[dmmeta.ssimsort](/txt/ssimdb/dmmeta/ssimsort.md)|Define sort order for ssimfile| -|[dmmeta.sortfld](/txt/ssimdb/dmmeta/sortfld.md)|Specify what field an index (Bheap,Atree) is sorted on| -|[dmmeta.smallstr](/txt/ssimdb/dmmeta/smallstr.md)|Generated fixed-length padded or length-delimited string field| -|[dmmeta.rowid](/txt/ssimdb/dmmeta/rowid.md)|Initialize field to row id of element| -|[dmmeta.ptrary](/txt/ssimdb/dmmeta/ptrary.md)|Required for fields with reftype:Ptrary| -|[dmmeta.pnew](/txt/ssimdb/dmmeta/pnew.md)|Generate custom constructor (placement new), for use with binary protocols| -|[dmmeta.pmaskfld](/txt/ssimdb/dmmeta/pmaskfld.md)|Specify which field holds presence mask bits (one for each field in struct)| -|[dmmeta.pmaskfld_member](/txt/ssimdb/dmmeta/pmaskfld_member.md)|Explicit field-to-pmask association| -|[dmmeta.pack](/txt/ssimdb/dmmeta/pack.md)|Request byte-packing of structure fields| -|[dmmeta.numstr](/txt/ssimdb/dmmeta/numstr.md)|Add functions to read numbers out of a string field| -|[dmmeta.nsx](/txt/ssimdb/dmmeta/nsx.md)|Control code-generation and exception handling options for process/library| -|[dmmeta.nsproto](/txt/ssimdb/dmmeta/nsproto.md)|Annotate protocol namespace (collection of types, no state)| -|[dmmeta.nsinclude](/txt/ssimdb/dmmeta/nsinclude.md)|Explicitly specify a C++ include file for namespace| -|[dmmeta.nscpp](/txt/ssimdb/dmmeta/nscpp.md)|Generate C++ code for this namespace| -|[dmmeta.noxref](/txt/ssimdb/dmmeta/noxref.md)|Explicitly specify that no x-ref exists between tables (don't use unless forced)| -|[dmmeta.nossimfile](/txt/ssimdb/dmmeta/nossimfile.md)|Indicates that ssimfile does not exist for this ssimdb ctype| -|[dmmeta.nocascdel](/txt/ssimdb/dmmeta/nocascdel.md)|Remove cascade delete for this index| -|[dmmeta.msgtype](/txt/ssimdb/dmmeta/msgtype.md)|Specify message type for each eligible message, controls dispatch| -|[dmmeta.main](/txt/ssimdb/dmmeta/main.md)|Generate Main function for namespace| +|[dmmeta.findrem](/txt/ssimdb/dmmeta/findrem.md)|Request generation of FindRemove function| +|[dmmeta.finput](/txt/ssimdb/dmmeta/finput.md)|Describe input table of a program| +|[dmmeta.fkafka](/txt/ssimdb/dmmeta/fkafka.md)|| +|[dmmeta.fldoffset](/txt/ssimdb/dmmeta/fldoffset.md)|Assert field offset - will result in compile-time error if violated| +|[dmmeta.floadtuples](/txt/ssimdb/dmmeta/floadtuples.md)|Request that process automatically load any input tables on startup| +|[dmmeta.fnoremove](/txt/ssimdb/dmmeta/fnoremove.md)|Omit any functions for removing elements from table; Table is append-only| +|[dmmeta.foutput](/txt/ssimdb/dmmeta/foutput.md)|Generate function to save index/table back to disk| |[dmmeta.fprefix](/txt/ssimdb/dmmeta/fprefix.md)|Mapping between field prefix and Reftype| +|[dmmeta.fregx](/txt/ssimdb/dmmeta/fregx.md)|Specify options for command-line regx field| +|[dmmeta.fsort](/txt/ssimdb/dmmeta/fsort.md)|Generate custom sort function for array field| +|[dmmeta.fstep](/txt/ssimdb/dmmeta/fstep.md)|Generate a main loop step to be executed whenever a field is non-empty| +|[dmmeta.ftrace](/txt/ssimdb/dmmeta/ftrace.md)|Generate cycle/step counting fields for a step| +|[dmmeta.func](/txt/ssimdb/dmmeta/func.md)|| +|[dmmeta.funique](/txt/ssimdb/dmmeta/funique.md)|This field must be unique in the table. Not needed for primary key| +|[dmmeta.fuserinit](/txt/ssimdb/dmmeta/fuserinit.md)|Add user-defined initialization function for field (see fcleanup)| +|[dmmeta.fwddecl](/txt/ssimdb/dmmeta/fwddecl.md)|Request forward declaration of a field| +|[dmmeta.gconst](/txt/ssimdb/dmmeta/gconst.md)|Import ssim table columns as fconst for a field| +|[dmmeta.gstatic](/txt/ssimdb/dmmeta/gstatic.md)|Load entries for this table at startup time| +|[dmmeta.gsymbol](/txt/ssimdb/dmmeta/gsymbol.md)|Create C++ symbols from entries in ssim table| +|[dmmeta.hook](/txt/ssimdb/dmmeta/hook.md)|Required on Hook fields| +|[dmmeta.inlary](/txt/ssimdb/dmmeta/inlary.md)|Generate inline array of fixed or variable length (all entries fit within parent struct)| +|[dmmeta.jstype](/txt/ssimdb/dmmeta/jstype.md)|| +|[dmmeta.lenfld](/txt/ssimdb/dmmeta/lenfld.md)|Specify which gives length of varlen portion in bytes| +|[dev.license](/txt/ssimdb/dev/license.md)|Source code license| |[dmmeta.listtype](/txt/ssimdb/dmmeta/listtype.md)|Specify structure of linked list based on field prefix| |[dmmeta.llist](/txt/ssimdb/dmmeta/llist.md)|Options for Llist field| -|[dmmeta.lenfld](/txt/ssimdb/dmmeta/lenfld.md)|Specify which gives length of varlen portion in bytes| -|[dmmeta.inlary](/txt/ssimdb/dmmeta/inlary.md)|Generate inline array of fixed or variable length (all entries fit within parent struct)| -|[dmmeta.hook](/txt/ssimdb/dmmeta/hook.md)|Required on Hook fields| -|[dmmeta.gsymbol](/txt/ssimdb/dmmeta/gsymbol.md)|Create C++ symbols from entries in ssim table| -|[dmmeta.gstatic](/txt/ssimdb/dmmeta/gstatic.md)|Load entries for this table at startup time| -|[dmmeta.gconst](/txt/ssimdb/dmmeta/gconst.md)|Import ssim table columns as fconst for a field| -|[dmmeta.fwddecl](/txt/ssimdb/dmmeta/fwddecl.md)|Request forward declaration of a field| -|[dmmeta.fuserinit](/txt/ssimdb/dmmeta/fuserinit.md)|Add user-defined initialization function for field (see fcleanup)| -|[dmmeta.funique](/txt/ssimdb/dmmeta/funique.md)|This field must be unique in the table. Not needed for primary key| -|[dmmeta.func](/txt/ssimdb/dmmeta/func.md)|| -|[dmmeta.ftrace](/txt/ssimdb/dmmeta/ftrace.md)|Generate cycle/step counting fields for a step| -|[dmmeta.fstep](/txt/ssimdb/dmmeta/fstep.md)|Generate a main loop step to be executed whenever a field is non-empty| -|[dmmeta.fsort](/txt/ssimdb/dmmeta/fsort.md)|Generate custom sort function for array field| -|[dmmeta.fregx](/txt/ssimdb/dmmeta/fregx.md)|Specify options for command-line regx field| -|[dmmeta.foutput](/txt/ssimdb/dmmeta/foutput.md)|Generate function to save index/table back to disk| -|[dmmeta.fnoremove](/txt/ssimdb/dmmeta/fnoremove.md)|Omit any functions for removing elements from table; Table is append-only| -|[dmmeta.floadtuples](/txt/ssimdb/dmmeta/floadtuples.md)|Request that process automatically load any input tables on startup| -|[dmmeta.fldoffset](/txt/ssimdb/dmmeta/fldoffset.md)|Assert field offset - will result in compile-time error if violated| -|[dmmeta.finput](/txt/ssimdb/dmmeta/finput.md)|Describe input table of a program| -|[dmmeta.findrem](/txt/ssimdb/dmmeta/findrem.md)|Request generation of FindRemove function| -|[dmmeta.fflag](/txt/ssimdb/dmmeta/fflag.md)|Options for command-line flags| -|[dmmeta.ffast](/txt/ssimdb/dmmeta/ffast.md)|FAST properties for field| -|[dmmeta.fdelay](/txt/ssimdb/dmmeta/fdelay.md)|Control elapsed time between execution of a step| -|[dmmeta.fdec](/txt/ssimdb/dmmeta/fdec.md)|Specify that field has an implied # of decimal places and specify formatting options| -|[dmmeta.fcurs](/txt/ssimdb/dmmeta/fcurs.md)|Request generation of custom cursor| -|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| -|[dmmeta.fcompact](/txt/ssimdb/dmmeta/fcompact.md)|Request compaction upon removal from index| -|[dmmeta.fcmp](/txt/ssimdb/dmmeta/fcmp.md)|Request versionsort or case-insensitive sort for field| -|[dmmeta.fcmdline](/txt/ssimdb/dmmeta/fcmdline.md)|Annotate field that holds process command line| -|[dmmeta.fcmap](/txt/ssimdb/dmmeta/fcmap.md)|Bidirectional mapping between fconst values| -|[dmmeta.fcleanup](/txt/ssimdb/dmmeta/fcleanup.md)|Request user-implemented function to be called at Uninit time for a field| -|[dmmeta.fcast](/txt/ssimdb/dmmeta/fcast.md)|Generate implicit conversion from field to c++ expression| -|[dmmeta.fbuftype](/txt/ssimdb/dmmeta/fbuftype.md)|Buffer type| -|[dmmeta.fbuf](/txt/ssimdb/dmmeta/fbuf.md)|Buffer for reading/writing messages, works with Iohook| -|[dmmeta.fbitset](/txt/ssimdb/dmmeta/fbitset.md)|Generate bitset functions over integer field or array| -|[dmmeta.fbigend](/txt/ssimdb/dmmeta/fbigend.md)|Annotate field as having big-endian storage| -|[dmmeta.fbase](/txt/ssimdb/dmmeta/fbase.md)|Customize imported Base fields| -|[dmmeta.falias](/txt/ssimdb/dmmeta/falias.md)|Alias field| -|[dmmeta.dispatch](/txt/ssimdb/dmmeta/dispatch.md)|Generate code for a multi-way branch| -|[dmmeta.disptrace](/txt/ssimdb/dmmeta/disptrace.md)|Generate trace fields (cycles, counts) for all dispatch branches| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dmmeta.dispfilter](/txt/ssimdb/dmmeta/dispfilter.md)|Generate filter function on dispatch| -|[dmmeta.dispctx](/txt/ssimdb/dmmeta/dispctx.md)|Use context with dispatch| -|[dmmeta.dispatch_msg](/txt/ssimdb/dmmeta/dispatch_msg.md)|Add message to a dispatch| -|[dmmeta.cstr](/txt/ssimdb/dmmeta/cstr.md)|Specify that type behaves like a string| -|[dmmeta.csize](/txt/ssimdb/dmmeta/csize.md)|Specify size/alignment for built-in C++ types| -|[dmmeta.cpptype](/txt/ssimdb/dmmeta/cpptype.md)|Specify whether a ctype can be passed by value, and other c++ options| -|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| -|[dmmeta.chash](/txt/ssimdb/dmmeta/chash.md)|Generate hash function| -|[dmmeta.charset](/txt/ssimdb/dmmeta/charset.md)|Generate functions to determine if a character is a member of a set| -|[dmmeta.cget](/txt/ssimdb/dmmeta/cget.md)|Generate state functions for these ctypes| -|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| -|[dmmeta.cfast](/txt/ssimdb/dmmeta/cfast.md)|FAST properties for ctype| -|[dmmeta.cextern](/txt/ssimdb/dmmeta/cextern.md)|Externally defined ctype (a struct from system header, or from a c++ library)| -|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| -|[dmmeta.ccmp](/txt/ssimdb/dmmeta/ccmp.md)|Generate hash function| -|[dmmeta.cascdel](/txt/ssimdb/dmmeta/cascdel.md)|Request cascading delete of referenced rows| -|[dmmeta.cafter](/txt/ssimdb/dmmeta/cafter.md)|Control amc processing order for unrelated types (used in rare situations)| -|[dmmeta.bitfld](/txt/ssimdb/dmmeta/bitfld.md)|Specify offset/width of a bitfield within another field| -|[dmmeta.basepool](/txt/ssimdb/dmmeta/basepool.md)|Specify pool to be used for allocating elements of a type| -|[dmmeta.argvtype](/txt/ssimdb/dmmeta/argvtype.md)|Customize parsing of command lines (rarely used)| -|[dmmeta.anonfld](/txt/ssimdb/dmmeta/anonfld.md)|Omit field name where possible (command line, enums, constants)| -|[dev.target](/txt/ssimdb/dev/target.md)|Build target| +|[dmmeta.main](/txt/ssimdb/dmmeta/main.md)|Generate Main function for namespace| +|[dmmeta.msgtype](/txt/ssimdb/dmmeta/msgtype.md)|Specify message type for each eligible message, controls dispatch| +|[dmmeta.nocascdel](/txt/ssimdb/dmmeta/nocascdel.md)|Remove cascade delete for this index| +|[dmmeta.nossimfile](/txt/ssimdb/dmmeta/nossimfile.md)|Indicates that ssimfile does not exist for this ssimdb ctype| +|[dmmeta.noxref](/txt/ssimdb/dmmeta/noxref.md)|Explicitly specify that no x-ref exists between tables (don't use unless forced)| +|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.nscpp](/txt/ssimdb/dmmeta/nscpp.md)|Generate C++ code for this namespace| +|[dmmeta.nsdb](/txt/ssimdb/dmmeta/nsdb.md)|Annotate ssimdb namespaces| +|[dmmeta.nsinclude](/txt/ssimdb/dmmeta/nsinclude.md)|Explicitly specify a C++ include file for namespace| +|[dmmeta.nsjs](/txt/ssimdb/dmmeta/nsjs.md)|Generate JavaScript code for this namespace| +|[dmmeta.nsproto](/txt/ssimdb/dmmeta/nsproto.md)|Annotate protocol namespace (collection of types, no state)| +|[dmmeta.nsx](/txt/ssimdb/dmmeta/nsx.md)|Control code-generation and exception handling options for process/library| +|[dmmeta.numstr](/txt/ssimdb/dmmeta/numstr.md)|Add functions to read numbers out of a string field| +|[dmmeta.pack](/txt/ssimdb/dmmeta/pack.md)|Request byte-packing of structure fields| +|[dmmeta.pmaskfld](/txt/ssimdb/dmmeta/pmaskfld.md)|Specify which field holds presence mask bits (one for each field in struct)| +|[dmmeta.pmaskfld_member](/txt/ssimdb/dmmeta/pmaskfld_member.md)|Explicit field-to-pmask association| +|[dmmeta.pnew](/txt/ssimdb/dmmeta/pnew.md)|Generate custom constructor (placement new), for use with binary protocols| +|[dmmeta.ptrary](/txt/ssimdb/dmmeta/ptrary.md)|Required for fields with reftype:Ptrary| +|[dmmeta.rowid](/txt/ssimdb/dmmeta/rowid.md)|Initialize field to row id of element| +|[dmmeta.smallstr](/txt/ssimdb/dmmeta/smallstr.md)|Generated fixed-length padded or length-delimited string field| +|[dmmeta.sortfld](/txt/ssimdb/dmmeta/sortfld.md)|Specify what field an index (Bheap,Atree) is sorted on| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.ssimsort](/txt/ssimdb/dmmeta/ssimsort.md)|Define sort order for ssimfile| +|[dmmeta.ssimvolatile](/txt/ssimdb/dmmeta/ssimvolatile.md)|Types based on ssim files marked this way cannot be cross-referenced| +|[dmmeta.steptype](/txt/ssimdb/dmmeta/steptype.md)|Type of scheduler step| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| |[dev.targdep](/txt/ssimdb/dev/targdep.md)|Dependency between targets| +|[dev.target](/txt/ssimdb/dev/target.md)|Build target| +|[dmmeta.tary](/txt/ssimdb/dmmeta/tary.md)|Indirect linear dynamically alocated array (used for strings, arrays of data, etc)| |[amcdb.tcurs](/txt/ssimdb/amcdb/tcurs.md)|Cursor template| -|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dmmeta.thash](/txt/ssimdb/dmmeta/thash.md)|Hash index, required for fields with reftype Thash| +|[dmmeta.typefld](/txt/ssimdb/dmmeta/typefld.md)|Specifies which field of a message carries the type| +|[dmmeta.usertracefld](/txt/ssimdb/dmmeta/usertracefld.md)|Add custom user trace fields to process's trace struct| +|[dmmeta.xref](/txt/ssimdb/dmmeta/xref.md)|Specify how to cross-reference (i.e. project, or group-by) one record with another| diff --git a/txt/exe/amc/fbuf.md b/txt/exe/amc/fbuf.md index 81a43bd5..c43057d1 100644 --- a/txt/exe/amc/fbuf.md +++ b/txt/exe/amc/fbuf.md @@ -111,7 +111,7 @@ to read more data. ### Generated Functions ``` -inline-command: src_func atf_amc -comment:%atf_amc.Msgbuf.in_buf% -gen -proto -showloc:N +inline-command: src_func atf_amc.% -matchcomment:%atf_amc.Msgbuf.in_buf% -gen -showcomment // --- atf_amc.Msgbuf.in_buf.BeginRead // Attach fbuf to Iohook for reading // Attach file descriptor and begin reading using edge-triggered epoll. @@ -129,6 +129,12 @@ void atf_amc::in_buf_EndRead(atf_amc::Msgbuf& msgbuf) // The message is length-delimited based on field length field // atf_amc::MsgHeader* atf_amc::in_buf_GetMsg(atf_amc::Msgbuf& msgbuf) +// --- atf_amc.Msgbuf.in_buf.Realloc +// Set buffer size. +// Unconditionally reallocate buffer to have size NEW_MAX +// If the buffer has data in it, NEW_MAX is adjusted so that the data is not lost +// (best to call this before filling the buffer) +void atf_amc::in_buf_Realloc(atf_amc::Msgbuf& msgbuf, int new_max) // --- atf_amc.Msgbuf.in_buf.Refill // Refill buffer. Return false if no further refill possible (input buffer exhausted) bool atf_amc::in_buf_Refill(atf_amc::Msgbuf& msgbuf) @@ -149,12 +155,16 @@ static void atf_amc::in_buf_Shift(atf_amc::Msgbuf& msgbuf) // Skip current message, if any. void atf_amc::in_buf_SkipMsg(atf_amc::Msgbuf& msgbuf) // --- atf_amc.Msgbuf.in_buf.WriteAll -// Attempt to write buffer contents to fd +// Attempt to write buffer contents to fbuf, return success // Write bytes to the buffer. If the entire block is written, return true, // Otherwise return false. // Bytes in the buffer are potentially shifted left to make room for the message. // bool atf_amc::in_buf_WriteAll(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) +// --- atf_amc.Msgbuf.in_buf.WriteReserve +// Write buffer contents to fbuf, reallocate as needed +// Write bytes to the buffer. The entire block is always written +void atf_amc::in_buf_WriteReserve(atf_amc::Msgbuf& msgbuf, u8 *in, i32 in_n) // --- atf_amc.Msgbuf.in_buf.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. diff --git a/txt/exe/amc/internals.md b/txt/exe/amc/internals.md index 69f463b0..ebd3d75b 100644 --- a/txt/exe/amc/internals.md +++ b/txt/exe/amc/internals.md @@ -45,7 +45,10 @@ The following source files are part of this tool: |[cpp/amc/dflt.cpp](/cpp/amc/dflt.cpp)|Field default| |[cpp/amc/disp/call.cpp](/cpp/amc/disp/call.cpp)|Dispatch call| |[cpp/amc/disp/casetype.cpp](/cpp/amc/disp/casetype.cpp)|Dispatch casetype generator| +|[cpp/amc/disp/del.cpp](/cpp/amc/disp/del.cpp)|| |[cpp/amc/disp/filter.cpp](/cpp/amc/disp/filter.cpp)|Dispatch filter| +|[cpp/amc/disp/kafka_decode.cpp](/cpp/amc/disp/kafka_decode.cpp)|| +|[cpp/amc/disp/kafka_encode.cpp](/cpp/amc/disp/kafka_encode.cpp)|| |[cpp/amc/disp/main.cpp](/cpp/amc/disp/main.cpp)|Dispatch main| |[cpp/amc/disp/msg.cpp](/cpp/amc/disp/msg.cpp)|Dispatch on message| |[cpp/amc/disp/print.cpp](/cpp/amc/disp/print.cpp)|Dispatch print| @@ -68,6 +71,8 @@ The following source files are part of this tool: |[cpp/amc/include.cpp](/cpp/amc/include.cpp)|Manage includes for generated files| |[cpp/amc/inlary.cpp](/cpp/amc/inlary.cpp)|Inline array| |[cpp/amc/io.cpp](/cpp/amc/io.cpp)|I/O functions| +|[cpp/amc/js.cpp](/cpp/amc/js.cpp)|| +|[cpp/amc/kafka.cpp](/cpp/amc/kafka.cpp)|| |[cpp/amc/lary.cpp](/cpp/amc/lary.cpp)|Level array with permanent pointers| |[cpp/amc/llist.cpp](/cpp/amc/llist.cpp)|Linked lists| |[cpp/amc/lpool.cpp](/cpp/amc/lpool.cpp)|Variable-length free pool| @@ -163,6 +168,8 @@ All allocations are done through global `amc::_db` [amc.FDb](#amc-fdb) structure ||||FField.c_charset (Ptr)| |[amc.FChash](#amc-fchash)|[dmmeta.chash](/txt/ssimdb/dmmeta/chash.md)|FDb.chash (Lary)|chash (Lary, by rowid)|ind_chash (Thash, hash field ctype)| ||||FCtype.c_chash (Ptr)| +|[amc.FCkafka](#amc-fckafka)|[dmmeta.ckafka](/txt/ssimdb/dmmeta/ckafka.md)|FDb.ckafka (Lary)|ckafka (Lary, by rowid)| +||||FCtype.c_ckafka (Ptr)| |[amc.FCppfunc](#amc-fcppfunc)|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|FDb.cppfunc (Lary)|cppfunc (Lary, by rowid)| ||||FField.c_cppfunc (Ptr)| |[amc.FCpptype](#amc-fcpptype)|[dmmeta.cpptype](/txt/ssimdb/dmmeta/cpptype.md)|FDb.cpptype (Lary)|cpptype (Lary, by rowid)|ind_cpptype (Thash, hash field ctype)| @@ -171,6 +178,7 @@ All allocations are done through global `amc::_db` [amc.FDb](#amc-fdb) structure ||||FCtype.c_csize (Ptr)| |[amc.FCstr](#amc-fcstr)|[dmmeta.cstr](/txt/ssimdb/dmmeta/cstr.md)|FDb.cstr (Lary)|cstr (Lary, by rowid)| ||||FCtype.c_cstr (Ptr)| +|[amc.JsCtype](#amc-jsctype)|| |[amc.FCtype](#amc-fctype)|[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|FDb.ctype (Lary)|ctype (Lary, by rowid)|ind_ctype (Thash, hash field ctype)|c_ctype_sorted (Ptrary)|zsl_ctype_pack_tran (Llist)|zs_sig_visit (Llist)|c_u64 (Ptr)| ||||FCafter.p_after (Upptr)| ||||FCget.p_ctype (Upptr)| @@ -194,7 +202,7 @@ All allocations are done through global `amc::_db` [amc.FDb](#amc-fdb) structure ||||FXref.p_ctype (Upptr)| ||||Genctx.p_ctype (Upptr)| ||||Genpnew.p_ctype (Upptr)| -|[amc.FCtypelen](#amc-fctypelen)|[dmmeta.ctypelen](/txt/ssimdb/dmmeta/ctypelen.md)|FDb.ctypelen (Lary)|ctypelen (Lary, by rowid)|c_ctypelen (Ptrary)| +|[amc.FCtypelen](#amc-fctypelen)|[dmmeta.ctypelen](/txt/ssimdb/dmmeta/ctypelen.md)|FDb.ctypelen (Lary)|ctypelen (Lary, by rowid)| ||||FCtype.c_ctypelen (Ptr)| |[amc.Genctx](#amc-genctx)|| |[amc.FTclass](#amc-ftclass)|[amcdb.tclass](/txt/ssimdb/amcdb/tclass.md)|FDb.tclass (Inlary)|**static**|ind_tclass (Thash, hash field tclass)| @@ -210,7 +218,7 @@ All allocations are done through global `amc::_db` [amc.FDb](#amc-fdb) structure ||||FDispatch.c_dispctx (Ptr)| |[amc.FDispfilter](#amc-fdispfilter)|[dmmeta.dispfilter](/txt/ssimdb/dmmeta/dispfilter.md)|FDb.dispfilter (Lary)|dispfilter (Lary, by rowid)| ||||FDispatch.c_dispfilter (Ptr)| -|[amc.FDispsig](#amc-fdispsig)|[dmmeta.dispsig](/txt/ssimdb/dmmeta/dispsig.md)|FDb.dispsig (Lary)|dispsig (Lary, by rowid)|c_dispsig_sorted (Ptrary)| +|[amc.FDispsig](#amc-fdispsig)|[dmmeta.dispsig](/txt/ssimdb/dmmeta/dispsig.md)|FDb.dispsig (Lary)|dispsig (Lary, by rowid)| ||||FNs.c_dispsig (Ptrary)| |[amc.FDisptrace](#amc-fdisptrace)|[dmmeta.disptrace](/txt/ssimdb/dmmeta/disptrace.md)|FDb.disptrace (Lary)|disptrace (Lary, by rowid)| ||||FDispatch.c_disptrace (Ptr)| @@ -259,19 +267,19 @@ All allocations are done through global `amc::_db` [amc.FDb](#amc-fdb) structure ||||FField.c_ffast (Ptrary)| |[amc.FFflag](#amc-ffflag)|[dmmeta.fflag](/txt/ssimdb/dmmeta/fflag.md)|FDb.fflag (Lary)|fflag (Lary, by rowid)|ind_fflag (Thash, hash field field)| ||||FField.c_fflag (Ptr)| -|[amc.FField](#amc-ffield)|[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|FDb.field (Lary)|field (Lary, by rowid)|ind_field (Thash, hash field field)|c_malloc (Ptr)|zs_ordkeyfield (Llist)|c_tempfield (Ptrary)| +|[amc.FField](#amc-ffield)|[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|FDb.field (Lary)|field (Lary, by rowid)|ind_field (Thash, hash field field)|c_malloc (Ptr)|zs_ordkeyfield (Llist)| ||||FBasepool.p_field (Upptr)| ||||FBasepool.p_base (Upptr)| ||||FBitfld.p_srcfield (Upptr)| ||||FBitfld.p_field (Upptr)| ||||FCascdel.p_field (Upptr)| ||||FCtype.c_field (Ptrary)| -||||FCtype.c_varlenfld (Ptr)| ||||FCtype.c_optfld (Ptr)| ||||FCtype.c_datafld (Ptrary)| ||||FCtype.zd_inst (Llist)| ||||FCtype.zd_access (Llist)| ||||FCtype.c_pkeyfield (Ptr)| +||||FCtype.zd_varlenfld (Llist)| ||||FFalias.p_srcfield (Upptr)| ||||FFbigend.p_field (Upptr)| ||||FFbitset.p_field (Upptr)| @@ -321,6 +329,8 @@ All allocations are done through global `amc::_db` [amc.FDb](#amc-fdb) structure ||||FField.c_findrem (Ptr)| |[amc.FFinput](#amc-ffinput)|[dmmeta.finput](/txt/ssimdb/dmmeta/finput.md)|FDb.finput (Lary)|finput (Lary, by rowid)| ||||FField.c_finput (Ptr)| +|[amc.FFkafka](#amc-ffkafka)|[dmmeta.fkafka](/txt/ssimdb/dmmeta/fkafka.md)|FDb.fkafka (Lary)|fkafka (Lary, by rowid)| +||||FField.c_fkafka (Ptr)| |[amc.FFldoffset](#amc-ffldoffset)|[dmmeta.fldoffset](/txt/ssimdb/dmmeta/fldoffset.md)|FDb.fldoffset (Lary)|fldoffset (Lary, by rowid)| ||||FField.c_fldoffset (Ptr)| |[amc.FFloadtuples](#amc-ffloadtuples)|[dmmeta.floadtuples](/txt/ssimdb/dmmeta/floadtuples.md)|FDb.floadtuples (Lary)|floadtuples (Lary, by rowid)| @@ -369,8 +379,11 @@ All allocations are done through global `amc::_db` [amc.FDb](#amc-fdb) structure ||||FField.c_hook (Ptr)| |[amc.FInlary](#amc-finlary)|[dmmeta.inlary](/txt/ssimdb/dmmeta/inlary.md)|FDb.inlary (Lary)|inlary (Lary, by rowid)|ind_inlary (Thash, hash field field)| ||||FField.c_inlary (Ptr)| +|[amc.FJstype](#amc-fjstype)|[dmmeta.jstype](/txt/ssimdb/dmmeta/jstype.md)|FDb.jstype (Lary)|jstype (Lary, by rowid)| +||||FCtype.c_jstype (Ptr)| |[amc.FLenfld](#amc-flenfld)|[dmmeta.lenfld](/txt/ssimdb/dmmeta/lenfld.md)|FDb.lenfld (Lary)|lenfld (Lary, by rowid)| ||||FCtype.c_lenfld (Ptr)| +||||FField.c_lenfld (Ptr)| |[amc.FLicense](#amc-flicense)|[dev.license](/txt/ssimdb/dev/license.md)|FDb.license (Lary)|license (Lary, by rowid)|ind_license (Thash, hash field license)| ||||FNs.p_license (Upptr)| |[amc.FListtype](#amc-flisttype)|[dmmeta.listtype](/txt/ssimdb/dmmeta/listtype.md)|FDb.listtype (Lary)|listtype (Lary, by rowid)|ind_listtype (Thash, hash field listtype)| @@ -387,6 +400,7 @@ All allocations are done through global `amc::_db` [amc.FDb](#amc-fdb) structure ||||FCtype.c_nossimfile (Ptr)| |[amc.FNoxref](#amc-fnoxref)|[dmmeta.noxref](/txt/ssimdb/dmmeta/noxref.md)|FDb.noxref (Lary)|noxref (Lary, by rowid)| ||||FField.c_noxref (Ptr)| +|[amc.JsNs](#amc-jsns)|| |[amc.FNs](#amc-fns)|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|FDb.ns (Lary)|ns (Lary, by rowid)|ind_ns (Thash, hash field ns)|c_ns_sorted (Ptrary)|c_curns (Ptr)|c_ns (Ptr)| ||||FCtype.p_ns (Upptr)| ||||FDispatch.p_ns (Upptr)| @@ -405,6 +419,8 @@ All allocations are done through global `amc::_db` [amc.FDb](#amc-fdb) structure ||||FNs.c_nsdb (Ptr)| |[amc.FNsinclude](#amc-fnsinclude)|[dmmeta.nsinclude](/txt/ssimdb/dmmeta/nsinclude.md)|FDb.nsinclude (Lary)|nsinclude (Lary, by rowid)| ||||FNs.c_nsinclude (Ptrary)| +|[amc.FNsjs](#amc-fnsjs)|[dmmeta.nsjs](/txt/ssimdb/dmmeta/nsjs.md)|FDb.nsjs (Lary)|nsjs (Lary, by rowid)| +||||FNs.c_nsjs (Ptr)| |[amc.FNsproto](#amc-fnsproto)|[dmmeta.nsproto](/txt/ssimdb/dmmeta/nsproto.md)|FDb.nsproto (Lary)|nsproto (Lary, by rowid)| ||||FNs.c_nsproto (Ptr)| |[amc.FNsx](#amc-fnsx)|[dmmeta.nsx](/txt/ssimdb/dmmeta/nsx.md)|FDb.nsx (Lary)|nsx (Lary, by rowid)| @@ -443,6 +459,8 @@ All allocations are done through global `amc::_db` [amc.FDb](#amc-fdb) structure ||||FSsimfile.c_ssimvolatile (Ptr)| |[amc.FStatictuple](#amc-fstatictuple)||FDb.static_tuple (Lary)|static_tuple (Lary, by rowid)| ||||FCtype.c_static (Ptrary)| +|[amc.FSteptype](#amc-fsteptype)|[dmmeta.steptype](/txt/ssimdb/dmmeta/steptype.md)|FDb.steptype (Lary)|steptype (Lary, by rowid)|ind_steptype (Thash, hash field steptype)| +||||FFstep.p_steptype (Upptr)| |[amc.FSubstr](#amc-fsubstr)|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|FDb.substr (Lary)|substr (Lary, by rowid)|zd_substr_params (Llist)|c_substr_field (Ptrary)| ||||FField.c_substr (Ptr)| |[amc.FTargdep](#amc-ftargdep)|[dev.targdep](/txt/ssimdb/dev/targdep.md)|FDb.targdep (Lary)|targdep (Lary, by rowid)| @@ -465,6 +483,7 @@ All allocations are done through global `amc::_db` [amc.FDb](#amc-fdb) structure |[amc.FTypefld](#amc-ftypefld)|[dmmeta.typefld](/txt/ssimdb/dmmeta/typefld.md)|FDb.typefld (Lary)|typefld (Lary, by rowid)| ||||FCtype.c_typefld (Ptr)| ||||FField.c_typefld (Ptr)| +|[amc.FUserfunc](#amc-fuserfunc)|[dmmeta.userfunc](/txt/ssimdb/dmmeta/userfunc.md)|FDb.userfunc (Lary)|userfunc (Lary, by rowid)| |[amc.FUsertracefld](#amc-fusertracefld)|[dmmeta.usertracefld](/txt/ssimdb/dmmeta/usertracefld.md)|FDb.usertracefld (Lary)|usertracefld (Lary, by rowid)| |[amc.FXref](#amc-fxref)|[dmmeta.xref](/txt/ssimdb/dmmeta/xref.md)|FDb.xref (Lary)|xref (Lary, by rowid)|ind_xref (Thash, hash field field)| ||||FCtype.zs_xref (Llist)| @@ -685,13 +704,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FBitfld { // amc.FBitfld - algo::Smallstr100 field; // - i32 offset; // 0 Offset, in bits, within parent field - i32 width; // 0 Width, in bits, within parent field. - algo::Smallstr100 srcfield; // - amc::FField* p_srcfield; // reference to parent row - amc::FField* p_field; // reference to parent row - i32 bh_bitfld_idx; // index in heap; -1 means not-in-heap + algo::Smallstr100 field; // + i32 offset; // 0 Offset, in bits, within parent field + i32 width; // 0 Width, in bits, within parent field. + algo::Smallstr100 srcfield; // + amc::FField* p_srcfield; // reference to parent row + amc::FField* p_field; // reference to parent row + i32 field_bh_bitfld_idx; // index in heap; -1 means not-in-heap // x-reference on amc.FBitfld.p_srcfield prevents copy // x-reference on amc.FBitfld.p_field prevents copy // func:amc.FBitfld..AssignOp @@ -727,11 +746,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FBltin { // amc.FBltin - algo::Smallstr100 ctype; // - bool likeu64; // false - bool bigendok; // false - bool issigned; // false - amc::FBltin* ind_bltin_next; // hash next + algo::Smallstr100 ctype; // + bool likeu64; // false + bool bigendok; // false + bool issigned; // false + amc::FBltin* ind_bltin_next; // hash next + u32 ind_bltin_hashval; // hash value // func:amc.FBltin..AssignOp inline amc::FBltin& operator =(const amc::FBltin &rhs) = delete; // func:amc.FBltin..CopyCtor @@ -764,10 +784,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FCafter { // amc.FCafter - algo::Smallstr50 cafter; // - amc::FCtype* p_after; // reference to parent row - amc::FCafter* zd_cafter_next; // zslist link; -1 means not-in-list - amc::FCafter* zd_cafter_prev; // previous element + algo::Smallstr50 cafter; // + amc::FCtype* p_after; // reference to parent row + amc::FCafter* ctype_zd_cafter_next; // zslist link; -1 means not-in-list + amc::FCafter* ctype_zd_cafter_prev; // previous element // x-reference on amc.FCafter.p_after prevents copy // func:amc.FCafter..AssignOp inline amc::FCafter& operator =(const amc::FCafter &rhs) = delete; @@ -837,12 +857,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FCcmp { // amc.FCcmp - algo::Smallstr100 ctype; // Target ctype - bool extrn; // false Whether implementation is external - bool genop; // false Generate C++ comparison operators (<,>, etc) - bool order; // false - bool minmax; // false - amc::FCcmp* ind_ccmp_next; // hash next + algo::Smallstr100 ctype; // Target ctype + bool extrn; // false Whether implementation is external + bool genop; // false Generate C++ comparison operators (<,>, etc) + bool order; // false + bool minmax; // false + amc::FCcmp* ind_ccmp_next; // hash next + u32 ind_ccmp_hashval; // hash value // func:amc.FCcmp..AssignOp inline amc::FCcmp& operator =(const amc::FCcmp &rhs) = delete; // func:amc.FCcmp..CopyCtor @@ -983,14 +1004,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FCfmt { // amc.FCfmt - algo::Smallstr100 cfmt; // - algo::Smallstr50 printfmt; // - bool read; // false - bool print; // false - algo::Smallstr20 sep; // - bool genop; // false - amc::FCfmt* zs_cfmt_next; // zslist link; -1 means not-in-list - amc::FCfmt* ind_cfmt_next; // hash next + algo::Smallstr100 cfmt; // + algo::Smallstr50 printfmt; // + bool read; // false + bool print; // false + algo::Smallstr20 sep; // + bool genop; // false + amc::FCfmt* ctype_zs_cfmt_next; // zslist link; -1 means not-in-list + amc::FCfmt* ind_cfmt_next; // hash next + u32 ind_cfmt_hashval; // hash value // func:amc.FCfmt..AssignOp inline amc::FCfmt& operator =(const amc::FCfmt &rhs) = delete; // func:amc.FCfmt..CopyCtor @@ -1090,9 +1112,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FChash { // amc.FChash - algo::Smallstr100 ctype; // Target ctype - algo::Smallstr50 hashtype; // Hash type - amc::FChash* ind_chash_next; // hash next + algo::Smallstr100 ctype; // Target ctype + algo::Smallstr50 hashtype; // Hash type + amc::FChash* ind_chash_next; // hash next + u32 ind_chash_hashval; // hash value // func:amc.FChash..AssignOp inline amc::FChash& operator =(const amc::FChash &rhs) = delete; // func:amc.FChash..CopyCtor @@ -1108,6 +1131,44 @@ private: }; ``` +#### amc.FCkafka - + + +#### amc.FCkafka Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc.FCkafka.base|[dmmeta.Ckafka](/txt/ssimdb/dmmeta/ckafka.md)|[Base](/txt/ssimdb/dmmeta/ckafka.md)||| + +#### Struct FCkafka + +*Note:* field ``amc.FCkafka.base`` has reftype ``base`` so the fields of [dmmeta.Ckafka](/txt/ssimdb/dmmeta/ckafka.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) +``` +struct FCkafka { // amc.FCkafka + algo::Smallstr100 ctype; // + algo::Smallstr50 kind; // + algo::cstring root; // + algo::Smallstr10 valid_versions; // + algo::Smallstr10 flexible_versions; // + algo::Comment comment; // + // func:amc.FCkafka..AssignOp + inline amc::FCkafka& operator =(const amc::FCkafka &rhs) = delete; + // func:amc.FCkafka..CopyCtor + inline FCkafka(const amc::FCkafka &rhs) = delete; +private: + // func:amc.FCkafka..Ctor + inline FCkafka() __attribute__((nothrow)); + // func:amc.FCkafka..Dtor + inline ~FCkafka() __attribute__((nothrow)); + friend amc::FCkafka& ckafka_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FCkafka* ckafka_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void ckafka_RemoveAll() __attribute__((nothrow)); + friend void ckafka_RemoveLast() __attribute__((nothrow)); +}; +``` + #### amc.FCppfunc - Value of field provided by this expression @@ -1160,12 +1221,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FCpptype { // amc.FCpptype - algo::Smallstr100 ctype; // - bool ctor; // false if true, generate non-default constructor from all fields - bool dtor; // true generate non-default destructor - bool cheap_copy; // false Pass by value whenever possible - amc::FCtype* p_ctype; // reference to parent row - amc::FCpptype* ind_cpptype_next; // hash next + algo::Smallstr100 ctype; // + bool ctor; // false if true, generate non-default constructor from all fields + bool dtor; // true generate non-default destructor + bool cheap_copy; // false Pass by value whenever possible + amc::FCtype* p_ctype; // reference to parent row + amc::FCpptype* ind_cpptype_next; // hash next + u32 ind_cpptype_hashval; // hash value // x-reference on amc.FCpptype.p_ctype prevents copy // func:amc.FCpptype..AssignOp inline amc::FCpptype& operator =(const amc::FCpptype &rhs) = delete; @@ -1250,6 +1312,32 @@ private: }; ``` +#### amc.JsCtype - + + +#### amc.JsCtype Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc.JsCtype.body|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc.JsCtype.ctor|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc.JsCtype.args|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc.JsCtype.funcs|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct JsCtype + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) +``` +struct JsCtype { // amc.JsCtype + algo::cstring body; // + algo::cstring ctor; // + algo::cstring args; // + algo::cstring funcs; // + // func:amc.JsCtype..Ctor + inline JsCtype() __attribute__((nothrow)); +}; +``` + #### amc.FCtype - Struct @@ -1267,7 +1355,6 @@ private: |amc.FCtype.c_bltin|[amc.FBltin](/txt/exe/amc/internals.md#amc-fbltin)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |amc.FCtype.c_field|[amc.FField](/txt/exe/amc/internals.md#amc-ffield)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |amc.FCtype.c_msgtype|[amc.FMsgtype](/txt/exe/amc/internals.md#amc-fmsgtype)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| -|amc.FCtype.c_varlenfld|[amc.FField](/txt/exe/amc/internals.md#amc-ffield)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |amc.FCtype.c_optfld|[amc.FField](/txt/exe/amc/internals.md#amc-ffield)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |amc.FCtype.c_static|[amc.FStatictuple](/txt/exe/amc/internals.md#amc-fstatictuple)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |amc.FCtype.c_cpptype|[amc.FCpptype](/txt/exe/amc/internals.md#amc-fcpptype)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| @@ -1294,16 +1381,13 @@ private: |amc.FCtype.c_floadtuples|[amc.FFloadtuples](/txt/exe/amc/internals.md#amc-ffloadtuples)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |amc.FCtype.c_pkeyfield|[amc.FField](/txt/exe/amc/internals.md#amc-ffield)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Field corresponding to pkey of this type| |amc.FCtype.c_fcurs|[amc.FFcurs](/txt/exe/amc/internals.md#amc-ffcurs)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| -|amc.FCtype.copy_priv_reason|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| |amc.FCtype.c_ctypelen|[amc.FCtypelen](/txt/exe/amc/internals.md#amc-fctypelen)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |amc.FCtype.size_unknown|bool|[Val](/txt/exe/amc/reftypes.md#val)||| -|amc.FCtype.copy_priv_valid|bool|[Val](/txt/exe/amc/reftypes.md#val)||| |amc.FCtype.size_locked|bool|[Val](/txt/exe/amc/reftypes.md#val)||| |amc.FCtype.topo_visited|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Temporary| |amc.FCtype.enum_visited|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Temporary| |amc.FCtype.fields_cloned|bool|[Val](/txt/exe/amc/reftypes.md#val)||True if fields from c_cbase have been cloned.| |amc.FCtype.original|bool|[Val](/txt/exe/amc/reftypes.md#val)||True if this ctype comes from disk| -|amc.FCtype.copy_priv|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|disallow copy ctor / assign op| |amc.FCtype.plaindata|bool|[Val](/txt/exe/amc/reftypes.md#val)||| |amc.FCtype.alignment|u32|[Val](/txt/exe/amc/reftypes.md#val)|1|| |amc.FCtype.n_padbytes|i32|[Val](/txt/exe/amc/reftypes.md#val)||| @@ -1315,6 +1399,10 @@ private: |amc.FCtype.c_cfast|[amc.FCfast](/txt/exe/amc/internals.md#amc-fcfast)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |amc.FCtype.c_ffast|[amc.FFfast](/txt/exe/amc/internals.md#amc-fffast)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |amc.FCtype.in_copy_priv|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc.FCtype.zd_varlenfld|[amc.FField](/txt/exe/amc/internals.md#amc-ffield)|[Llist](/txt/exe/amc/reftypes.md#llist)||| +|amc.FCtype.js|[amc.JsCtype](/txt/exe/amc/internals.md#amc-jsctype)|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc.FCtype.c_jstype|[amc.FJstype](/txt/exe/amc/internals.md#amc-fjstype)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| +|amc.FCtype.c_ckafka|[amc.FCkafka](/txt/exe/amc/internals.md#amc-fckafka)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| #### Struct FCtype @@ -1337,7 +1425,6 @@ struct FCtype { // amc.FCtype u32 c_field_n; // array of pointers u32 c_field_max; // capacity of allocated array amc::FMsgtype* c_msgtype; // optional pointer - amc::FField* c_varlenfld; // optional pointer amc::FField* c_optfld; // optional pointer amc::FStatictuple** c_static_elems; // array of pointers u32 c_static_n; // array of pointers @@ -1384,16 +1471,13 @@ struct FCtype { // amc.FCtype amc::FFcurs** c_fcurs_elems; // array of pointers u32 c_fcurs_n; // array of pointers u32 c_fcurs_max; // capacity of allocated array - algo::cstring copy_priv_reason; // amc::FCtypelen* c_ctypelen; // optional pointer bool size_unknown; // false - bool copy_priv_valid; // false bool size_locked; // false bool topo_visited; // false Temporary bool enum_visited; // false Temporary bool fields_cloned; // false True if fields from c_cbase have been cloned. bool original; // false True if this ctype comes from disk - bool copy_priv; // false disallow copy ctor / assign op bool plaindata; // false u32 alignment; // 1 i32 n_padbytes; // 0 @@ -1407,8 +1491,15 @@ struct FCtype { // amc.FCtype u32 c_ffast_n; // array of pointers u32 c_ffast_max; // capacity of allocated array bool in_copy_priv; // false + amc::FField* zd_varlenfld_head; // zero-terminated doubly linked list + i32 zd_varlenfld_n; // zero-terminated doubly linked list + amc::FField* zd_varlenfld_tail; // pointer to last element + amc::JsCtype js; // + amc::FJstype* c_jstype; // optional pointer + amc::FCkafka* c_ckafka; // optional pointer bool ns_c_ctype_in_ary; // false membership flag amc::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value amc::FCtype* zsl_ctype_pack_tran_next; // zslist link; -1 means not-in-list amc::FCtype* zs_sig_visit_next; // zslist link; -1 means not-in-list // reftype Llist of amc.FCtype.zs_cfmt prohibits copy @@ -1416,7 +1507,6 @@ struct FCtype { // amc.FCtype // x-reference on amc.FCtype.c_bltin prevents copy // reftype Ptrary of amc.FCtype.c_field prohibits copy // x-reference on amc.FCtype.c_msgtype prevents copy - // x-reference on amc.FCtype.c_varlenfld prevents copy // x-reference on amc.FCtype.c_optfld prevents copy // reftype Ptrary of amc.FCtype.c_static prohibits copy // x-reference on amc.FCtype.c_cpptype prevents copy @@ -1445,6 +1535,9 @@ struct FCtype { // amc.FCtype // x-reference on amc.FCtype.c_nossimfile prevents copy // x-reference on amc.FCtype.c_cfast prevents copy // reftype Ptrary of amc.FCtype.c_ffast prohibits copy + // reftype Llist of amc.FCtype.zd_varlenfld prohibits copy + // x-reference on amc.FCtype.c_jstype prevents copy + // x-reference on amc.FCtype.c_ckafka prevents copy // func:amc.FCtype..AssignOp amc::FCtype& operator =(const amc::FCtype &rhs) = delete; // reftype Llist of amc.FCtype.zs_cfmt prohibits copy @@ -1452,7 +1545,6 @@ struct FCtype { // amc.FCtype // x-reference on amc.FCtype.c_bltin prevents copy // reftype Ptrary of amc.FCtype.c_field prohibits copy // x-reference on amc.FCtype.c_msgtype prevents copy - // x-reference on amc.FCtype.c_varlenfld prevents copy // x-reference on amc.FCtype.c_optfld prevents copy // reftype Ptrary of amc.FCtype.c_static prohibits copy // x-reference on amc.FCtype.c_cpptype prevents copy @@ -1481,6 +1573,9 @@ struct FCtype { // amc.FCtype // x-reference on amc.FCtype.c_nossimfile prevents copy // x-reference on amc.FCtype.c_cfast prevents copy // reftype Ptrary of amc.FCtype.c_ffast prohibits copy + // reftype Llist of amc.FCtype.zd_varlenfld prohibits copy + // x-reference on amc.FCtype.c_jstype prevents copy + // x-reference on amc.FCtype.c_ckafka prevents copy // func:amc.FCtype..CopyCtor FCtype(const amc::FCtype &rhs) = delete; private: @@ -1510,12 +1605,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FCtypelen { // amc.FCtypelen - algo::Smallstr100 ctype; // Identifies the Ctype - u32 len; // 0 (calculated) length of the C++ struct in bytes - i32 alignment; // 0 (calculated) alignment for the struct - i32 padbytes; // 0 (calculated) total # of pad bytes - bool plaindata; // false (calculated) this struct can me safely memcpy'ed - bool _db_c_ctypelen_in_ary; // false membership flag + algo::Smallstr100 ctype; // Identifies the Ctype + u32 len; // 0 (calculated) length of the C++ struct in bytes + i32 alignment; // 0 (calculated) alignment for the struct + i32 padbytes; // 0 (calculated) total # of pad bytes + bool plaindata; // false (calculated) this struct can me safely memcpy'ed // func:amc.FCtypelen..AssignOp inline amc::FCtypelen& operator =(const amc::FCtypelen &rhs) = delete; // func:amc.FCtypelen..CopyCtor @@ -1578,12 +1672,13 @@ struct Genctx { // amc.Genctx Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FTclass { // amc.FTclass - algo::Smallstr50 tclass; // - amc::FTfunc** c_tfunc_elems; // array of pointers - u32 c_tfunc_n; // array of pointers - u32 c_tfunc_max; // capacity of allocated array - amc::tclass_step_hook step; // NULL Pointer to a function - amc::FTclass* ind_tclass_next; // hash next + algo::Smallstr50 tclass; // + amc::FTfunc** c_tfunc_elems; // array of pointers + u32 c_tfunc_n; // array of pointers + u32 c_tfunc_max; // capacity of allocated array + amc::tclass_step_hook step; // NULL Pointer to a function + amc::FTclass* ind_tclass_next; // hash next + u32 ind_tclass_hashval; // hash value // reftype Ptrary of amc.FTclass.c_tfunc prohibits copy // reftype Hook of amc.FTclass.step prohibits copy // func:amc.FTclass..AssignOp @@ -1701,7 +1796,6 @@ struct FTclass { // amc.FTclass |amc.FDb.tracefld|[amc.FTracefld](/txt/exe/amc/internals.md#amc-ftracefld)|[Lary](/txt/exe/amc/reftypes.md#lary)||Word trace is already taken...| |amc.FDb.tracerec|[amc.FTracerec](/txt/exe/amc/internals.md#amc-ftracerec)|[Lary](/txt/exe/amc/reftypes.md#lary)||Word trace is already taken...| |amc.FDb.dispsig|[amc.FDispsig](/txt/exe/amc/internals.md#amc-fdispsig)|[Lary](/txt/exe/amc/reftypes.md#lary)||| -|amc.FDb.c_dispsig_sorted|[amc.FDispsig](/txt/exe/amc/internals.md#amc-fdispsig)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |amc.FDb.zs_sig_visit|[amc.FCtype](/txt/exe/amc/internals.md#amc-fctype)|[Llist](/txt/exe/amc/reftypes.md#llist)||| |amc.FDb.target|[amc.FTarget](/txt/exe/amc/internals.md#amc-ftarget)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |amc.FDb.ind_target|[amc.FTarget](/txt/exe/amc/internals.md#amc-ftarget)|[Thash](/txt/exe/amc/reftypes.md#thash)||| @@ -1750,9 +1844,7 @@ struct FTclass { // amc.FTclass |amc.FDb.fnoremove|[amc.FFnoremove](/txt/exe/amc/internals.md#amc-ffnoremove)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |amc.FDb.c_substr_field|[amc.FSubstr](/txt/exe/amc/internals.md#amc-fsubstr)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |amc.FDb.ctypelen|[amc.FCtypelen](/txt/exe/amc/internals.md#amc-fctypelen)|[Lary](/txt/exe/amc/reftypes.md#lary)||| -|amc.FDb.c_ctypelen|[amc.FCtypelen](/txt/exe/amc/internals.md#amc-fctypelen)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |amc.FDb.c_u64|[amc.FCtype](/txt/exe/amc/internals.md#amc-fctype)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| -|amc.FDb.c_tempfield|[amc.FField](/txt/exe/amc/internals.md#amc-ffield)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |amc.FDb.fbase|[amc.FFbase](/txt/exe/amc/internals.md#amc-ffbase)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |amc.FDb.ind_fcmap|[amc.FFcmap](/txt/exe/amc/internals.md#amc-ffcmap)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |amc.FDb.nossimfile|[amc.FNossimfile](/txt/exe/amc/internals.md#amc-fnossimfile)|[Lary](/txt/exe/amc/reftypes.md#lary)||| @@ -1788,6 +1880,13 @@ struct FTclass { // amc.FTclass |amc.FDb.ssimsort|[amc.FSsimsort](/txt/exe/amc/internals.md#amc-fssimsort)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |amc.FDb.fbuftype|[amc.FFbuftype](/txt/exe/amc/internals.md#amc-ffbuftype)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |amc.FDb.ind_fbuftype|[amc.FFbuftype](/txt/exe/amc/internals.md#amc-ffbuftype)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|amc.FDb.nsjs|[amc.FNsjs](/txt/exe/amc/internals.md#amc-fnsjs)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|amc.FDb.jstype|[amc.FJstype](/txt/exe/amc/internals.md#amc-fjstype)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|amc.FDb.ckafka|[amc.FCkafka](/txt/exe/amc/internals.md#amc-fckafka)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|amc.FDb.fkafka|[amc.FFkafka](/txt/exe/amc/internals.md#amc-ffkafka)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|amc.FDb.userfunc|[amc.FUserfunc](/txt/exe/amc/internals.md#amc-fuserfunc)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|amc.FDb.steptype|[amc.FSteptype](/txt/exe/amc/internals.md#amc-fsteptype)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|amc.FDb.ind_steptype|[amc.FSteptype](/txt/exe/amc/internals.md#amc-fsteptype)|[Thash](/txt/exe/amc/reftypes.md#thash)||| #### Struct FDb @@ -2009,9 +2108,6 @@ struct FDb { // amc.FDb: In-memory database for amc i32 tracerec_n; // number of elements in array amc::FDispsig* dispsig_lary[32]; // level array i32 dispsig_n; // number of elements in array - amc::FDispsig** c_dispsig_sorted_elems; // array of pointers - u32 c_dispsig_sorted_n; // array of pointers - u32 c_dispsig_sorted_max; // capacity of allocated array amc::FCtype* zs_sig_visit_head; // zero-terminated singly linked list amc::FCtype* zs_sig_visit_tail; // pointer to last element amc::FTarget* target_lary[32]; // level array @@ -2111,13 +2207,7 @@ struct FDb { // amc.FDb: In-memory database for amc u32 c_substr_field_max; // capacity of allocated array amc::FCtypelen* ctypelen_lary[32]; // level array i32 ctypelen_n; // number of elements in array - amc::FCtypelen** c_ctypelen_elems; // array of pointers - u32 c_ctypelen_n; // array of pointers - u32 c_ctypelen_max; // capacity of allocated array amc::FCtype* c_u64; // optional pointer - amc::FField** c_tempfield_elems; // array of pointers - u32 c_tempfield_n; // array of pointers - u32 c_tempfield_max; // capacity of allocated array amc::FFbase* fbase_lary[32]; // level array i32 fbase_n; // number of elements in array amc::FFcmap** ind_fcmap_buckets_elems; // pointer to bucket array @@ -2192,6 +2282,21 @@ struct FDb { // amc.FDb: In-memory database for amc amc::FFbuftype** ind_fbuftype_buckets_elems; // pointer to bucket array i32 ind_fbuftype_buckets_n; // number of elements in bucket array i32 ind_fbuftype_n; // number of elements in the hash table + amc::FNsjs* nsjs_lary[32]; // level array + i32 nsjs_n; // number of elements in array + amc::FJstype* jstype_lary[32]; // level array + i32 jstype_n; // number of elements in array + amc::FCkafka* ckafka_lary[32]; // level array + i32 ckafka_n; // number of elements in array + amc::FFkafka* fkafka_lary[32]; // level array + i32 fkafka_n; // number of elements in array + amc::FUserfunc* userfunc_lary[32]; // level array + i32 userfunc_n; // number of elements in array + amc::FSteptype* steptype_lary[32]; // level array + i32 steptype_n; // number of elements in array + amc::FSteptype** ind_steptype_buckets_elems; // pointer to bucket array + i32 ind_steptype_buckets_n; // number of elements in bucket array + i32 ind_steptype_n; // number of elements in the hash table amc::trace trace; // }; ``` @@ -2221,6 +2326,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include ``` struct FDispatch { // amc.FDispatch amc::FDispatch* ind_dispatch_next; // hash next + u32 ind_dispatch_hashval; // hash value algo::Smallstr50 dispatch; // Primary key (ns.name) bool unk; // false Want default case? bool read; // false Generate read function @@ -2228,6 +2334,8 @@ struct FDispatch { // amc.FDispatch bool haslen; // false Include length in dispatch function bool call; // false Generate call to user-defined function bool strict; // false Only dispatch if length matches exactly + bool dyn; // false Use dynamic memory allocation: new, delete instead of ByteAry + bool kafka; // false generate kafka codec amc::FCtype* p_ctype_hdr; // reference to parent row amc::FCtype* p_casetype; // reference to parent row amc::FDispfilter* c_dispfilter; // optional pointer @@ -2393,10 +2501,9 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FDispsig { // amc.FDispsig - algo::Smallstr50 dispsig; // - algo::Sha1sig signature; // - bool _db_c_dispsig_sorted_in_ary; // false membership flag - bool ns_c_dispsig_in_ary; // false membership flag + algo::Smallstr50 dispsig; // + algo::Sha1sig signature; // + bool ns_c_dispsig_in_ary; // false membership flag // func:amc.FDispsig..AssignOp inline amc::FDispsig& operator =(const amc::FDispsig &rhs) = delete; // func:amc.FDispsig..CopyCtor @@ -2466,12 +2573,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FEnumstr { // amc.FEnumstr: All values of a given length - amc::FEnumstr* ind_enumstr_next; // hash next - amc::Enumstr enumstr; // - amc::FFconst** c_fconst_elems; // array of pointers - u32 c_fconst_n; // array of pointers - u32 c_fconst_max; // capacity of allocated array - i32 bh_enumstr_idx; // index in heap; -1 means not-in-heap + amc::FEnumstr* ind_enumstr_next; // hash next + u32 ind_enumstr_hashval; // hash value + amc::Enumstr enumstr; // + amc::FFconst** c_fconst_elems; // array of pointers + u32 c_fconst_n; // array of pointers + u32 c_fconst_max; // capacity of allocated array + i32 enumstr_len_bh_enumstr_idx; // index in heap; -1 means not-in-heap // reftype Ptrary of amc.FEnumstr.c_fconst prohibits copy // func:amc.FEnumstr..AssignOp inline amc::FEnumstr& operator =(const amc::FEnumstr &rhs) = delete; @@ -2505,12 +2613,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FEnumstrLen { // amc.FEnumstrLen - i32 bh_enumstr_len_idx; // index in heap; -1 means not-in-heap - amc::FEnumstrLen* ind_enumstr_len_next; // hash next - i32 len; // 0 - amc::FEnumstr** bh_enumstr_elems; // binary heap by str - i32 bh_enumstr_n; // number of elements in the heap - i32 bh_enumstr_max; // max elements in bh_enumstr_elems + i32 bh_enumstr_len_idx; // index in heap; -1 means not-in-heap + amc::FEnumstrLen* ind_enumstr_len_next; // hash next + u32 ind_enumstr_len_hashval; // hash value + i32 len; // 0 + amc::FEnumstr** bh_enumstr_elems; // binary heap by str + i32 bh_enumstr_n; // number of elements in the heap + i32 bh_enumstr_max; // max elements in bh_enumstr_elems // reftype Bheap of amc.FEnumstrLen.bh_enumstr prohibits copy // func:amc.FEnumstrLen..AssignOp inline amc::FEnumstrLen& operator =(const amc::FEnumstrLen &rhs) = delete; @@ -2657,9 +2766,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FFbitset { // amc.FFbitset - amc::FFbitset* ind_fbitset_next; // hash next - algo::Smallstr100 field; // - amc::FField* p_field; // reference to parent row + amc::FFbitset* ind_fbitset_next; // hash next + u32 ind_fbitset_hashval; // hash value + algo::Smallstr100 field; // + amc::FField* p_field; // reference to parent row // x-reference on amc.FFbitset.p_field prevents copy // func:amc.FFbitset..AssignOp inline amc::FFbitset& operator =(const amc::FFbitset &rhs) = delete; @@ -2696,15 +2806,17 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FFbuf { // amc.FFbuf - amc::FFbuf* ind_fbuf_next; // hash next - algo::Smallstr100 field; // - u32 max; // 0 Size of buffer in bytes - algo::Smallstr50 fbuftype; // Type of buffer - algo::Smallstr100 insready; // - algo::Smallstr100 inseof; // - amc::FField* p_insready; // reference to parent row - amc::FField* p_inseof; // reference to parent row - amc::FFbuftype* p_fbuftype; // reference to parent row + amc::FFbuf* ind_fbuf_next; // hash next + u32 ind_fbuf_hashval; // hash value + algo::Smallstr100 field; // + u32 max; // 0 Size of buffer in bytes + algo::Smallstr50 fbuftype; // Type of buffer + algo::Smallstr100 insready; // + algo::Smallstr100 inseof; // + algo::Smallstr50 iotype; // "standard" + amc::FField* p_insready; // reference to parent row + amc::FField* p_inseof; // reference to parent row + amc::FFbuftype* p_fbuftype; // reference to parent row // x-reference on amc.FFbuf.p_insready prevents copy // x-reference on amc.FFbuf.p_inseof prevents copy // x-reference on amc.FFbuf.p_fbuftype prevents copy @@ -2742,10 +2854,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FFbuftype { // amc.FFbuftype - amc::FFbuftype* ind_fbuftype_next; // hash next - algo::Smallstr50 fbuftype; // - bool skipbytes; // false Has skipbytes function? - algo::Comment comment; // + amc::FFbuftype* ind_fbuftype_next; // hash next + u32 ind_fbuftype_hashval; // hash value + algo::Smallstr50 fbuftype; // + bool skipbytes; // false Has skipbytes function? + algo::Comment comment; // // func:amc.FFbuftype..AssignOp inline amc::FFbuftype& operator =(const amc::FFbuftype &rhs) = delete; // func:amc.FFbuftype..CopyCtor @@ -2850,14 +2963,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FFcmap { // amc.FFcmap - amc::FFcmap* ind_fcmap_next; // hash next - algo::Smallstr250 fcmap; // cstring maybe? - bool bidir; // true - algo::Comment comment; // - amc::FField* p_leftField; // reference to parent row - amc::FField* p_rightField; // reference to parent row - amc::FFunc* c_convfunc; // Generated conversion func. optional pointer - amc::FFcmap* zs_fcmap_next; // zslist link; -1 means not-in-list + amc::FFcmap* ind_fcmap_next; // hash next + u32 ind_fcmap_hashval; // hash value + algo::Smallstr250 fcmap; // cstring maybe? + bool bidir; // true + algo::Comment comment; // + amc::FField* p_leftField; // reference to parent row + amc::FField* p_rightField; // reference to parent row + amc::FFunc* c_convfunc; // Generated conversion func. optional pointer + amc::FFcmap* field_zs_fcmap_next; // zslist link; -1 means not-in-list // x-reference on amc.FFcmap.p_leftField prevents copy // x-reference on amc.FFcmap.p_rightField prevents copy // func:amc.FFcmap..AssignOp @@ -3013,16 +3127,18 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FFconst { // amc.FFconst - amc::FFconst* ind_fconst_next; // hash next - amc::FFconst* ind_fconst_int_next; // hash next - algo::Smallstr100 fconst; // - algo::CppExpr value; // - algo::Comment comment; // - amc::FField* p_field; // reference to parent row - algo::cstring cpp_value; // - i64 int_val; // 0 integer value - algo::cstring cpp_name; // symbol to use in cpp file - bool field_c_fconst_in_ary; // false membership flag + amc::FFconst* ind_fconst_next; // hash next + u32 ind_fconst_hashval; // hash value + amc::FFconst* ind_fconst_int_next; // hash next + u32 ind_fconst_int_hashval; // hash value + algo::Smallstr100 fconst; // + algo::CppExpr value; // + algo::Comment comment; // + amc::FField* p_field; // reference to parent row + algo::cstring cpp_value; // + i64 int_val; // 0 integer value + algo::cstring cpp_name; // symbol to use in cpp file + bool field_c_fconst_in_ary; // false membership flag // x-reference on amc.FFconst.p_field prevents copy // func:amc.FFconst..AssignOp amc::FFconst& operator =(const amc::FFconst &rhs) = delete; @@ -3058,6 +3174,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include ``` struct FFcurs { // amc.FFcurs amc::FFcurs* ind_fcurs_next; // hash next + u32 ind_fcurs_hashval; // hash value algo::Smallstr50 fcurs; // algo::Comment comment; // amc::FField* p_field; // reference to parent row @@ -3096,11 +3213,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FFdec { // amc.FFdec - amc::FFdec* ind_fdec_next; // hash next - algo::Smallstr100 field; // Target field - i32 nplace; // 0 Number of implied decimal places - bool fixedfmt; // false Print exactly SCALE chars after decimal point - amc::FField* p_field; // reference to parent row + amc::FFdec* ind_fdec_next; // hash next + u32 ind_fdec_hashval; // hash value + algo::Smallstr100 field; // Target field + i32 nplace; // 0 Number of implied decimal places + bool fixedfmt; // false Print exactly SCALE chars after decimal point + amc::FField* p_field; // reference to parent row // x-reference on amc.FFdec.p_field prevents copy // func:amc.FFdec..AssignOp inline amc::FFdec& operator =(const amc::FFdec &rhs) = delete; @@ -3215,11 +3333,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FFflag { // amc.FFflag - amc::FFflag* ind_fflag_next; // hash next - algo::Smallstr100 field; // - bool cumulative; // false Accumulate on every read - algo::cstring emptyval; // "" - algo::Comment comment; // + amc::FFflag* ind_fflag_next; // hash next + u32 ind_fflag_hashval; // hash value + algo::Smallstr100 field; // + bool cumulative; // false Accumulate on every read + algo::cstring emptyval; // "" + algo::Comment comment; // // func:amc.FFflag..AssignOp inline amc::FFflag& operator =(const amc::FFflag &rhs) = delete; // func:amc.FFflag..CopyCtor @@ -3313,6 +3432,8 @@ private: |amc.FField.c_ffast_mantissa|[amc.FFfast](/txt/exe/amc/internals.md#amc-fffast)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |amc.FField.c_ffast|[amc.FFfast](/txt/exe/amc/internals.md#amc-fffast)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |amc.FField.c_pmaskfld_member|[amc.FPmaskfldMember](/txt/exe/amc/internals.md#amc-fpmaskfldmember)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| +|amc.FField.c_lenfld|[amc.FLenfld](/txt/exe/amc/internals.md#amc-flenfld)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| +|amc.FField.c_fkafka|[amc.FFkafka](/txt/exe/amc/internals.md#amc-ffkafka)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| #### Struct FField @@ -3321,11 +3442,14 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FField { // amc.FField - amc::FField* zd_inst_next; // zslist link; -1 means not-in-list - amc::FField* zd_inst_prev; // previous element - amc::FField* zd_access_next; // zslist link; -1 means not-in-list - amc::FField* zd_access_prev; // previous element + amc::FField* ctype_zd_inst_next; // zslist link; -1 means not-in-list + amc::FField* ctype_zd_inst_prev; // previous element + amc::FField* ctype_zd_access_next; // zslist link; -1 means not-in-list + amc::FField* ctype_zd_access_prev; // previous element + amc::FField* ctype_zd_varlenfld_next; // zslist link; -1 means not-in-list + amc::FField* ctype_zd_varlenfld_prev; // previous element amc::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value amc::FField* zs_ordkeyfield_next; // zslist link; -1 means not-in-list algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field @@ -3414,8 +3538,9 @@ struct FField { // amc.FField amc::FPmaskfldMember** c_pmaskfld_member_elems; // array of pointers u32 c_pmaskfld_member_n; // array of pointers u32 c_pmaskfld_member_max; // capacity of allocated array + amc::FLenfld* c_lenfld; // optional pointer + amc::FFkafka* c_fkafka; // optional pointer bool ctype_c_datafld_in_ary; // false membership flag - bool _db_c_tempfield_in_ary; // false membership flag // x-reference on amc.FField.c_fsort prevents copy // x-reference on amc.FField.c_fbitset prevents copy // x-reference on amc.FField.c_smallstr prevents copy @@ -3473,6 +3598,8 @@ struct FField { // amc.FField // x-reference on amc.FField.c_ffast_mantissa prevents copy // reftype Ptrary of amc.FField.c_ffast prohibits copy // reftype Ptrary of amc.FField.c_pmaskfld_member prohibits copy + // x-reference on amc.FField.c_lenfld prevents copy + // x-reference on amc.FField.c_fkafka prevents copy // func:amc.FField..AssignOp amc::FField& operator =(const amc::FField &rhs) = delete; // x-reference on amc.FField.c_fsort prevents copy @@ -3532,6 +3659,8 @@ struct FField { // amc.FField // x-reference on amc.FField.c_ffast_mantissa prevents copy // reftype Ptrary of amc.FField.c_ffast prohibits copy // reftype Ptrary of amc.FField.c_pmaskfld_member prohibits copy + // x-reference on amc.FField.c_lenfld prevents copy + // x-reference on amc.FField.c_fkafka prevents copy // func:amc.FField..CopyCtor FField(const amc::FField &rhs) = delete; private: @@ -3617,6 +3746,44 @@ private: }; ``` +#### amc.FFkafka - + + +#### amc.FFkafka Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc.FFkafka.base|[dmmeta.Fkafka](/txt/ssimdb/dmmeta/fkafka.md)|[Base](/txt/ssimdb/dmmeta/fkafka.md)||| + +#### Struct FFkafka + +*Note:* field ``amc.FFkafka.base`` has reftype ``base`` so the fields of [dmmeta.Fkafka](/txt/ssimdb/dmmeta/fkafka.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) +``` +struct FFkafka { // amc.FFkafka + algo::Smallstr100 field; // + algo::Smallstr10 versions; // + algo::Smallstr10 nullable_versions; // + algo::Smallstr10 tagged_versions; // + u64 tag; // 0 + algo::Comment comment; // + // func:amc.FFkafka..AssignOp + inline amc::FFkafka& operator =(const amc::FFkafka &rhs) = delete; + // func:amc.FFkafka..CopyCtor + inline FFkafka(const amc::FFkafka &rhs) = delete; +private: + // func:amc.FFkafka..Ctor + inline FFkafka() __attribute__((nothrow)); + // func:amc.FFkafka..Dtor + inline ~FFkafka() __attribute__((nothrow)); + friend amc::FFkafka& fkafka_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FFkafka* fkafka_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void fkafka_RemoveAll() __attribute__((nothrow)); + friend void fkafka_RemoveLast() __attribute__((nothrow)); +}; +``` + #### amc.FFldoffset - Assert field offset - will result in compile-time error if violated @@ -3773,11 +3940,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FFprefix { // amc.FFprefix - amc::FFprefix* ind_prefix_next; // hash next - algo::Smallstr5 fprefix; // - algo::Smallstr50 reftype; // - algo::Comment comment; // - amc::FFprefix* zs_fprefix_next; // zslist link; -1 means not-in-list + amc::FFprefix* ind_prefix_next; // hash next + u32 ind_prefix_hashval; // hash value + algo::Smallstr5 fprefix; // + algo::Smallstr50 reftype; // + algo::Comment comment; // + amc::FFprefix* reftype_zs_fprefix_next; // zslist link; -1 means not-in-list // func:amc.FFprefix..AssignOp inline amc::FFprefix& operator =(const amc::FFprefix &rhs) = delete; // func:amc.FFprefix..CopyCtor @@ -3880,6 +4048,7 @@ private: |amc.FFstep.msghdr|[dmmeta.Fstep](/txt/ssimdb/dmmeta/fstep.md)|[Base](/txt/ssimdb/dmmeta/fstep.md)||| |amc.FFstep.c_fdelay|[amc.FFdelay](/txt/exe/amc/internals.md#amc-ffdelay)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |amc.FFstep.p_field|[amc.FField](/txt/exe/amc/internals.md#amc-ffield)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| +|amc.FFstep.p_steptype|[amc.FSteptype](/txt/exe/amc/internals.md#amc-fsteptype)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| #### Struct FFstep @@ -3889,18 +4058,22 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include ``` struct FFstep { // amc.FFstep amc::FFstep* ind_fstep_next; // hash next + u32 ind_fstep_hashval; // hash value algo::Smallstr100 fstep; // algo::Smallstr50 steptype; // algo::Comment comment; // amc::FFdelay* c_fdelay; // optional pointer amc::FField* p_field; // reference to parent row + amc::FSteptype* p_steptype; // reference to parent row bool ns_c_fstep_in_ary; // false membership flag // x-reference on amc.FFstep.c_fdelay prevents copy // x-reference on amc.FFstep.p_field prevents copy + // x-reference on amc.FFstep.p_steptype prevents copy // func:amc.FFstep..AssignOp amc::FFstep& operator =(const amc::FFstep &rhs) = delete; // x-reference on amc.FFstep.c_fdelay prevents copy // x-reference on amc.FFstep.p_field prevents copy + // x-reference on amc.FFstep.p_steptype prevents copy // func:amc.FFstep..CopyCtor FFstep(const amc::FFstep &rhs) = delete; private: @@ -3956,15 +4129,17 @@ private: |---|---|---|---|---| |amc.FFunc.msghdr|[dmmeta.Func](/txt/ssimdb/dmmeta/func.md)|[Base](/txt/ssimdb/dmmeta/func.md)||| |amc.FFunc.p_ns|[amc.FNs](/txt/exe/amc/internals.md#amc-fns)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| -|amc.FFunc.inl|bool|[Val](/txt/exe/amc/reftypes.md#val)||Make inline?| +|amc.FFunc.body|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Body of function| +|amc.FFunc.prepcond|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Preprocessor #if condition| +|amc.FFunc.proto|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Prototype| |amc.FFunc.nonnull|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||List of non-null attributes| +|amc.FFunc.initializer|[algo.StringAry](/txt/protocol/algo/README.md#algo-stringary)|[Val](/txt/exe/amc/reftypes.md#val)||Initializer list (constructors only)| +|amc.FFunc.ret|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Return type (c++ expression)| +|amc.FFunc.acrkey|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Acr key due to which function was created| |amc.FFunc.funcarg|[amc.Funcarg](/txt/exe/amc/internals.md#amc-funcarg)|[Tary](/txt/exe/amc/reftypes.md#tary)||Array of declared function arguments| |amc.FFunc.printed|bool|[Val](/txt/exe/amc/reftypes.md#val)||Already printed? (internal)| |amc.FFunc.throws|bool|[Val](/txt/exe/amc/reftypes.md#val)||Throws exceptions| -|amc.FFunc.proto|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Prototype| |amc.FFunc.nothrow|bool|[Val](/txt/exe/amc/reftypes.md#val)||Definitely doesn't throw exception| -|amc.FFunc.oper|bool|[Val](/txt/exe/amc/reftypes.md#val)||Is operator?| -|amc.FFunc.body|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Body of function| |amc.FFunc.member|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Function is a member (print inside struct)| |amc.FFunc.disable|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Function is enabled (if not, don't print)| |amc.FFunc.deprecate|bool|[Val](/txt/exe/amc/reftypes.md#val)||Make deprecated?| @@ -3975,15 +4150,13 @@ private: |amc.FFunc.glob|bool|[Val](/txt/exe/amc/reftypes.md#val)||Function is not attached to a field (EXPLAIN!!)| |amc.FFunc.wur|bool|[Val](/txt/exe/amc/reftypes.md#val)||Warn on unused result| |amc.FFunc.priv|bool|[Val](/txt/exe/amc/reftypes.md#val)||Private to translateion unit (static)| -|amc.FFunc.ret|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Return type (c++ expression)| |amc.FFunc.pure|bool|[Val](/txt/exe/amc/reftypes.md#val)||OK to call fewer times than specified in text| |amc.FFunc.isprivate|bool|[Val](/txt/exe/amc/reftypes.md#val)||Applies to member functions only -- private| |amc.FFunc.finalized|bool|[Val](/txt/exe/amc/reftypes.md#val)||Don't add any more code to me| |amc.FFunc.isexplicit|bool|[Val](/txt/exe/amc/reftypes.md#val)||Is explicit constructor (add 'explicit')| |amc.FFunc.istmpl|bool|[Val](/txt/exe/amc/reftypes.md#val)||Function is a template| |amc.FFunc.deleted|bool|[Val](/txt/exe/amc/reftypes.md#val)||Function is marked as deleted| -|amc.FFunc.prepcond|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Preprocessor #if condition| -|amc.FFunc.initializer|[algo.StringAry](/txt/protocol/algo/README.md#algo-stringary)|[Val](/txt/exe/amc/reftypes.md#val)||Initializer list (constructors only)| +|amc.FFunc.inl|bool|[Val](/txt/exe/amc/reftypes.md#val)||Make inline?| #### Struct FFunc @@ -3993,23 +4166,26 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include ``` struct FFunc { // amc.FFunc amc::FFunc* ind_func_next; // hash next + u32 ind_func_hashval; // hash value amc::FFunc* cd_temp_func_next; // zslist link; -1 means not-in-list amc::FFunc* cd_temp_func_prev; // previous element algo::Smallstr100 func; // Primary key bool extrn; // false Implemented externally by user algo::cstring comment; // Description amc::FNs* p_ns; // reference to parent row - bool inl; // false Make inline? + algo::cstring body; // Body of function + algo::cstring prepcond; // Preprocessor #if condition + algo::cstring proto; // Prototype algo::cstring nonnull; // List of non-null attributes + algo::StringAry initializer; // Initializer list (constructors only) + algo::cstring ret; // Return type (c++ expression) + algo::cstring acrkey; // Acr key due to which function was created amc::Funcarg* funcarg_elems; // pointer to elements u32 funcarg_n; // number of elements in array u32 funcarg_max; // max. capacity of array before realloc bool printed; // false Already printed? (internal) bool throws; // false Throws exceptions - algo::cstring proto; // Prototype bool nothrow; // false Definitely doesn't throw exception - bool oper; // false Is operator? - algo::cstring body; // Body of function bool member; // false Function is a member (print inside struct) bool disable; // false Function is enabled (if not, don't print) bool deprecate; // false Make deprecated? @@ -4020,15 +4196,13 @@ struct FFunc { // amc.FFunc bool glob; // false Function is not attached to a field (EXPLAIN!!) bool wur; // false Warn on unused result bool priv; // false Private to translateion unit (static) - algo::cstring ret; // Return type (c++ expression) bool pure; // false OK to call fewer times than specified in text bool isprivate; // false Applies to member functions only -- private bool finalized; // false Don't add any more code to me bool isexplicit; // false Is explicit constructor (add 'explicit') bool istmpl; // false Function is a template bool deleted; // false Function is marked as deleted - algo::cstring prepcond; // Preprocessor #if condition - algo::StringAry initializer; // Initializer list (constructors only) + bool inl; // false Make inline? bool ns_c_func_in_ary; // false membership flag // x-reference on amc.FFunc.p_ns prevents copy // func:amc.FFunc..AssignOp @@ -4132,6 +4306,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include ``` struct FFwddecl { // amc.FFwddecl amc::FFwddecl* ind_fwddecl_next; // hash next + u32 ind_fwddecl_hashval; // hash value algo::Smallstr100 fwddecl; // bool ns_c_fwddecl_in_ary; // false membership flag // func:amc.FFwddecl..AssignOp @@ -4277,10 +4452,11 @@ struct FGenXref { // amc.FGenXref Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FGenXrefSeen { // amc.FGenXrefSeen - amc::FGenXrefSeen* ind_seen_next; // hash next - algo::cstring value; // - algo::Smallstr100 via; // Saved via - algo::Smallstr100 xreffld; // Saved xreffld + amc::FGenXrefSeen* parent_ind_seen_next; // hash next + u32 parent_ind_seen_hashval; // hash value + algo::cstring value; // + algo::Smallstr100 via; // Saved via + algo::Smallstr100 xreffld; // Saved xreffld private: // func:amc.FGenXrefSeen..Ctor inline FGenXrefSeen() __attribute__((nothrow)); @@ -4394,7 +4570,6 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include ``` struct FHook { // amc.FHook algo::Smallstr100 field; // The field - algo::Comment comment; // amc::FCtype* p_funcptr; // reference to parent row amc::FField* p_field; // reference to parent row // x-reference on amc.FHook.p_field prevents copy @@ -4431,11 +4606,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FInlary { // amc.FInlary - amc::FInlary* ind_inlary_next; // hash next - algo::Smallstr100 field; // - i32 min; // 0 Min. elements to preallocate - i32 max; // 0 Max. elements - algo::Comment comment; // + amc::FInlary* ind_inlary_next; // hash next + u32 ind_inlary_hashval; // hash value + algo::Smallstr100 field; // + i32 min; // 0 Min. elements to preallocate + i32 max; // 0 Max. elements + algo::Comment comment; // // func:amc.FInlary..AssignOp inline amc::FInlary& operator =(const amc::FInlary &rhs) = delete; // func:amc.FInlary..CopyCtor @@ -4451,6 +4627,40 @@ private: }; ``` +#### amc.FJstype - + + +#### amc.FJstype Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc.FJstype.base|[dmmeta.Jstype](/txt/ssimdb/dmmeta/jstype.md)|[Base](/txt/ssimdb/dmmeta/jstype.md)||| + +#### Struct FJstype + +*Note:* field ``amc.FJstype.base`` has reftype ``base`` so the fields of [dmmeta.Jstype](/txt/ssimdb/dmmeta/jstype.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) +``` +struct FJstype { // amc.FJstype + algo::Smallstr100 ctype; // + algo::Comment comment; // + // func:amc.FJstype..AssignOp + inline amc::FJstype& operator =(const amc::FJstype &rhs) = delete; + // func:amc.FJstype..CopyCtor + inline FJstype(const amc::FJstype &rhs) = delete; +private: + // func:amc.FJstype..Ctor + inline FJstype() __attribute__((nothrow)); + // func:amc.FJstype..Dtor + inline ~FJstype() __attribute__((nothrow)); + friend amc::FJstype& jstype_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FJstype* jstype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void jstype_RemoveAll() __attribute__((nothrow)); + friend void jstype_RemoveLast() __attribute__((nothrow)); +}; +``` + #### amc.FLenfld - Specify which gives length of varlen portion in bytes @@ -4505,10 +4715,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FLicense { // amc.FLicense - amc::FLicense* ind_license_next; // hash next - algo::Smallstr50 license; // - algo::Comment comment; // - algo::cstring text; // + amc::FLicense* ind_license_next; // hash next + u32 ind_license_hashval; // hash value + algo::Smallstr50 license; // + algo::Comment comment; // + algo::cstring text; // // func:amc.FLicense..AssignOp inline amc::FLicense& operator =(const amc::FLicense &rhs) = delete; // func:amc.FLicense..CopyCtor @@ -4541,11 +4752,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FListtype { // amc.FListtype - amc::FListtype* ind_listtype_next; // hash next - algo::Smallstr5 listtype; // - bool circular; // false Circular list - bool haveprev; // false Previous link - bool instail; // false Queue + amc::FListtype* ind_listtype_next; // hash next + u32 ind_listtype_hashval; // hash value + algo::Smallstr5 listtype; // + bool circular; // false Circular list + bool haveprev; // false Previous link + bool instail; // false Queue // func:amc.FListtype..AssignOp inline amc::FListtype& operator =(const amc::FListtype &rhs) = delete; // func:amc.FListtype..CopyCtor @@ -4615,9 +4827,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FMain { // amc.FMain - amc::FMain* ind_main_next; // hash next - algo::Smallstr16 ns; // - bool ismodule; // false + amc::FMain* ind_main_next; // hash next + u32 ind_main_hashval; // hash value + algo::Smallstr16 ns; // + bool ismodule; // false // func:amc.FMain..AssignOp inline amc::FMain& operator =(const amc::FMain &rhs) = delete; // func:amc.FMain..CopyCtor @@ -4768,6 +4981,30 @@ private: }; ``` +#### amc.JsNs - + + +#### amc.JsNs Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc.JsNs.import|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc.JsNs.mdl|[algo.cstring](/txt/protocol/algo/cstring.md)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| +|amc.JsNs.body|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct JsNs + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) +``` +struct JsNs { // amc.JsNs + algo::cstring import; // + algo::cstring* mdl; // optional pointer + algo::cstring body; // + // func:amc.JsNs..Ctor + inline JsNs() __attribute__((nothrow)); +}; +``` + #### amc.FNs - Namespace (for in-memory database, protocol, etc) @@ -4809,6 +5046,8 @@ private: |amc.FNs.c_nsinclude|[amc.FNsinclude](/txt/exe/amc/internals.md#amc-fnsinclude)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |amc.FNs.c_nscpp|[amc.FNscpp](/txt/exe/amc/internals.md#amc-fnscpp)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |amc.FNs.p_license|[amc.FLicense](/txt/exe/amc/internals.md#amc-flicense)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| +|amc.FNs.js|[amc.JsNs](/txt/exe/amc/internals.md#amc-jsns)|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc.FNs.c_nsjs|[amc.FNsjs](/txt/exe/amc/internals.md#amc-fnsjs)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| #### Struct FNs @@ -4818,6 +5057,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include ``` struct FNs { // amc.FNs amc::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value algo::Smallstr16 ns; // Namespace name (primary key) algo::Smallstr50 nstype; // Namespace type algo::Smallstr50 license; // Associated license @@ -4887,6 +5127,8 @@ struct FNs { // amc.FNs u32 c_nsinclude_max; // capacity of allocated array amc::FNscpp* c_nscpp; // optional pointer amc::FLicense* p_license; // reference to parent row + amc::JsNs js; // + amc::FNsjs* c_nsjs; // optional pointer // reftype Ptrary of amc.FNs.c_ctype prohibits copy // reftype Ptrary of amc.FNs.c_func prohibits copy // reftype Ptrary of amc.FNs.c_dispatch prohibits copy @@ -4911,6 +5153,7 @@ struct FNs { // amc.FNs // reftype Ptrary of amc.FNs.c_nsinclude prohibits copy // x-reference on amc.FNs.c_nscpp prevents copy // x-reference on amc.FNs.p_license prevents copy + // x-reference on amc.FNs.c_nsjs prevents copy // func:amc.FNs..AssignOp amc::FNs& operator =(const amc::FNs &rhs) = delete; // reftype Ptrary of amc.FNs.c_ctype prohibits copy @@ -4937,6 +5180,7 @@ struct FNs { // amc.FNs // reftype Ptrary of amc.FNs.c_nsinclude prohibits copy // x-reference on amc.FNs.c_nscpp prevents copy // x-reference on amc.FNs.p_license prevents copy + // x-reference on amc.FNs.c_nsjs prevents copy // func:amc.FNs..CopyCtor FNs(const amc::FNs &rhs) = delete; private: @@ -5053,6 +5297,42 @@ private: }; ``` +#### amc.FNsjs - Generate JavaScript code for this namespace + + +#### amc.FNsjs Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc.FNsjs.base|[dmmeta.Nsjs](/txt/ssimdb/dmmeta/nsjs.md)|[Base](/txt/ssimdb/dmmeta/nsjs.md)||| + +#### Struct FNsjs + +*Note:* field ``amc.FNsjs.base`` has reftype ``base`` so the fields of [dmmeta.Nsjs](/txt/ssimdb/dmmeta/nsjs.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) +``` +struct FNsjs { // amc.FNsjs + algo::Smallstr16 ns; // + bool typescript; // false Generate typescript + bool gensel; // false Generate selected, false-all + algo::Comment comment; // + // func:amc.FNsjs..AssignOp + inline amc::FNsjs& operator =(const amc::FNsjs &rhs) = delete; + // func:amc.FNsjs..CopyCtor + inline FNsjs(const amc::FNsjs &rhs) = delete; +private: + // func:amc.FNsjs..Ctor + inline FNsjs() __attribute__((nothrow)); + // func:amc.FNsjs..Dtor + inline ~FNsjs() __attribute__((nothrow)); + friend amc::FNsjs& nsjs_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FNsjs* nsjs_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void nsjs_RemoveAll() __attribute__((nothrow)); + friend void nsjs_RemoveLast() __attribute__((nothrow)); +}; +``` + #### amc.FNsproto - Annotate protocol namespace (collection of types, no state) @@ -5233,9 +5513,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FPack { // amc.FPack - amc::FPack* ind_pack_next; // hash next - algo::Smallstr100 ctype; // Target ctype - amc::FCtype* p_ctype; // reference to parent row + amc::FPack* ind_pack_next; // hash next + u32 ind_pack_hashval; // hash value + algo::Smallstr100 ctype; // Target ctype + amc::FCtype* p_ctype; // reference to parent row // x-reference on amc.FPack.p_ctype prevents copy // func:amc.FPack..AssignOp inline amc::FPack& operator =(const amc::FPack &rhs) = delete; @@ -5274,6 +5555,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include ``` struct FPmaskfld { // amc.FPmaskfld amc::FPmaskfld* ind_pmaskfld_next; // hash next + u32 ind_pmaskfld_hashval; // hash value algo::Smallstr100 field; // bool filter_print; // true Omit non-present fields when printing algo::Comment comment; // @@ -5322,7 +5604,7 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FPmaskfldMember { // amc.FPmaskfldMember - algo::Smallstr100 pmaskfld_member; // + algo::Smallstr200 pmaskfld_member; // algo::Comment comment; // u32 bit; // 0 amc::FField* p_field; // reference to parent row @@ -5368,6 +5650,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include ``` struct FPnew { // amc.FPnew amc::FPnew* ind_pnew_next; // hash next + u32 ind_pnew_hashval; // hash value algo::Smallstr100 pnew; // amc::FCtype* p_ctype; // reference to parent row amc::FNs* p_ns; // reference to parent row @@ -5408,9 +5691,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FPtrary { // amc.FPtrary - algo::Smallstr100 field; // - bool unique; // false Search for and ignore duplicates - amc::FField* p_field; // reference to parent row + algo::Smallstr100 field; // + bool unique; // false Search for and ignore duplicates + bool heaplike; // false + amc::FField* p_field; // reference to parent row // x-reference on amc.FPtrary.p_field prevents copy // func:amc.FPtrary..AssignOp inline amc::FPtrary& operator =(const amc::FPtrary &rhs) = delete; @@ -5447,23 +5731,24 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FReftype { // amc.FReftype - amc::FReftype* ind_reftype_next; // hash next - algo::Smallstr50 reftype; // "Val" - bool isval; // false True if field makes values of target type - bool cascins; // false Field is cascade-insert - bool usebasepool; // false Fields with this type make use of dmmeta.basepool - bool cancopy; // false This type of field can be copied - bool isxref; // false This type of field is an x-ref - bool del; // false Supports random deletion? - bool up; // false This type of field is a reference - bool isnew; // false If set, skip this relation in amc_vis - bool hasalloc; // false Generte Alloc/Delete functions for arg type - bool inst; // false Field creates an instance of arg type (directly or indirectly) - bool varlen; // false This pool supports varlen allocations - i32 rowid; // 0 - amc::FTclass* p_tclass; // reference to parent row - amc::FFprefix* zs_fprefix_head; // zero-terminated singly linked list - amc::FFprefix* zs_fprefix_tail; // pointer to last element + amc::FReftype* ind_reftype_next; // hash next + u32 ind_reftype_hashval; // hash value + algo::Smallstr50 reftype; // "Val" + bool isval; // false True if field makes values of target type + bool cascins; // false Field is cascade-insert + bool usebasepool; // false Fields with this type make use of dmmeta.basepool + bool cancopy; // false This type of field can be copied + bool isxref; // false This type of field is an x-ref + bool del; // false Supports random deletion? + bool up; // false This type of field is a reference + bool isnew; // false If set, skip this relation in amc_vis + bool hasalloc; // false Generte Alloc/Delete functions for arg type + bool inst; // false Field creates an instance of arg type (directly or indirectly) + bool varlen; // false This pool supports varlen allocations + i32 rowid; // 0 + amc::FTclass* p_tclass; // reference to parent row + amc::FFprefix* zs_fprefix_head; // zero-terminated singly linked list + amc::FFprefix* zs_fprefix_tail; // pointer to last element // x-reference on amc.FReftype.p_tclass prevents copy // reftype Llist of amc.FReftype.zs_fprefix prohibits copy // func:amc.FReftype..AssignOp @@ -5500,9 +5785,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FRowid { // amc.FRowid - amc::FRowid* ind_rowid_next; // hash next - algo::Smallstr100 field; // - algo::Comment comment; // + amc::FRowid* ind_rowid_next; // hash next + u32 ind_rowid_hashval; // hash value + algo::Smallstr100 field; // + algo::Comment comment; // // func:amc.FRowid..AssignOp inline amc::FRowid& operator =(const amc::FRowid &rhs) = delete; // func:amc.FRowid..CopyCtor @@ -5536,14 +5822,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FSmallstr { // amc.FSmallstr - amc::FSmallstr* ind_smallstr_next; // hash next - algo::Smallstr100 field; // - i32 length; // 0 Maximum characters in the string - algo::Smallstr50 strtype; // Data format for string - algo::CppExpr pad; // Pad character (if applicable) - bool strict; // false - amc::FField* p_field; // reference to parent row - amc::FNumstr* c_numstr; // optional pointer + amc::FSmallstr* ind_smallstr_next; // hash next + u32 ind_smallstr_hashval; // hash value + algo::Smallstr100 field; // + i32 length; // 0 Maximum characters in the string + algo::Smallstr50 strtype; // Data format for string + algo::CppExpr pad; // Pad character (if applicable) + bool strict; // false + amc::FField* p_field; // reference to parent row + amc::FNumstr* c_numstr; // optional pointer // x-reference on amc.FSmallstr.p_field prevents copy // x-reference on amc.FSmallstr.c_numstr prevents copy // func:amc.FSmallstr..AssignOp @@ -5622,18 +5909,19 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FSsimfile { // amc.FSsimfile - amc::FSsimfile* ind_ssimfile_next; // hash next - amc::FSsimfile* zd_ssimfile_todo_next; // zslist link; -1 means not-in-list - amc::FSsimfile* zd_ssimfile_todo_prev; // previous element - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - algo::cstring ssim; // Ssim content - amc::FCtype* p_ctype; // reference to parent row - amc::FSsimvolatile* c_ssimvolatile; // optional pointer - bool topovisit; // false - i32 topoindex; // 0 - bool input_select; // false - bool _db_c_ssimfile_sorted_in_ary; // false membership flag + amc::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + amc::FSsimfile* zd_ssimfile_todo_next; // zslist link; -1 means not-in-list + amc::FSsimfile* zd_ssimfile_todo_prev; // previous element + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + algo::cstring ssim; // Ssim content + amc::FCtype* p_ctype; // reference to parent row + amc::FSsimvolatile* c_ssimvolatile; // optional pointer + bool topovisit; // false + i32 topoindex; // 0 + bool input_select; // false + bool c_ssimfile_sorted_in_ary; // false membership flag // x-reference on amc.FSsimfile.p_ctype prevents copy // x-reference on amc.FSsimfile.c_ssimvolatile prevents copy // func:amc.FSsimfile..AssignOp @@ -5756,6 +6044,42 @@ private: }; ``` +#### amc.FSteptype - Type of scheduler step + + +#### amc.FSteptype Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc.FSteptype.base|[dmmeta.Steptype](/txt/ssimdb/dmmeta/steptype.md)|[Base](/txt/ssimdb/dmmeta/steptype.md)||| + +#### Struct FSteptype + +*Note:* field ``amc.FSteptype.base`` has reftype ``base`` so the fields of [dmmeta.Steptype](/txt/ssimdb/dmmeta/steptype.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) +``` +struct FSteptype { // amc.FSteptype + amc::FSteptype* ind_steptype_next; // hash next + u32 ind_steptype_hashval; // hash value + algo::Smallstr50 steptype; // + algo::Comment comment; // + // func:amc.FSteptype..AssignOp + inline amc::FSteptype& operator =(const amc::FSteptype &rhs) = delete; + // func:amc.FSteptype..CopyCtor + inline FSteptype(const amc::FSteptype &rhs) = delete; +private: + // func:amc.FSteptype..Ctor + inline FSteptype() __attribute__((nothrow)); + // func:amc.FSteptype..Dtor + inline ~FSteptype() __attribute__((nothrow)); + friend amc::FSteptype& steptype_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FSteptype* steptype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void steptype_RemoveAll() __attribute__((nothrow)); + friend void steptype_RemoveLast() __attribute__((nothrow)); +}; +``` + #### amc.FSubstr - Specify that the field value is computed from a substring of another field @@ -5775,15 +6099,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FSubstr { // amc.FSubstr - amc::FSubstr* zd_substr_params_next; // zslist link; -1 means not-in-list - amc::FSubstr* zd_substr_params_prev; // previous element - algo::Smallstr100 field; // - algo::CppExpr expr; // - algo::Smallstr100 srcfield; // - amc::FField* p_field; // reference to parent row - amc::FField* p_srcfield; // reference to parent row - u64 range; // 0 - bool _db_c_substr_field_in_ary; // false membership flag + amc::FSubstr* zd_substr_params_next; // zslist link; -1 means not-in-list + amc::FSubstr* zd_substr_params_prev; // previous element + algo::Smallstr100 field; // + algo::CppExpr expr; // + algo::Smallstr100 srcfield; // + amc::FField* p_field; // reference to parent row + amc::FField* p_srcfield; // reference to parent row + u64 range; // 0 + bool c_substr_field_in_ary; // false membership flag // x-reference on amc.FSubstr.p_field prevents copy // x-reference on amc.FSubstr.p_srcfield prevents copy // func:amc.FSubstr..AssignOp @@ -5862,12 +6186,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FTarget { // amc.FTarget - amc::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target - amc::FTargdep** c_targdep_elems; // array of pointers - u32 c_targdep_n; // array of pointers - u32 c_targdep_max; // capacity of allocated array - amc::FNs* p_ns; // reference to parent row + amc::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target + amc::FTargdep** c_targdep_elems; // array of pointers + u32 c_targdep_n; // array of pointers + u32 c_targdep_max; // capacity of allocated array + amc::FNs* p_ns; // reference to parent row // reftype Ptrary of amc.FTarget.c_targdep prohibits copy // x-reference on amc.FTarget.p_ns prevents copy // func:amc.FTarget..AssignOp @@ -5904,10 +6229,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FTary { // amc.FTary - amc::FTary* ind_tary_next; // hash next - algo::Smallstr100 field; // - bool aliased; // false Geneate functions to copy from aryptr - amc::FField* p_field; // reference to parent row + amc::FTary* ind_tary_next; // hash next + u32 ind_tary_hashval; // hash value + algo::Smallstr100 field; // + bool aliased; // false Geneate functions to copy from aryptr + amc::FField* p_field; // reference to parent row // x-reference on amc.FTary.p_field prevents copy // func:amc.FTary..AssignOp inline amc::FTary& operator =(const amc::FTary &rhs) = delete; @@ -5979,6 +6305,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include ``` struct FTfunc { // amc.FTfunc amc::FTfunc* ind_tfunc_next; // hash next + u32 ind_tfunc_hashval; // hash value algo::Smallstr50 tfunc; // bool hasthrow; // false Important defaults for new tfuncs to work bool leaf; // true Important defaults for new tfuncs to work @@ -6150,6 +6477,36 @@ private: }; ``` +#### amc.FUserfunc - + + +#### amc.FUserfunc Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc.FUserfunc.base|[dmmeta.Userfunc](/txt/ssimdb/dmmeta/userfunc.md)|[Base](/txt/ssimdb/dmmeta/userfunc.md)||| + +#### Struct FUserfunc + +*Note:* field ``amc.FUserfunc.base`` has reftype ``base`` so the fields of [dmmeta.Userfunc](/txt/ssimdb/dmmeta/userfunc.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) +``` +struct FUserfunc { // amc.FUserfunc + algo::Smallstr50 userfunc; // + algo::Smallstr200 acrkey; // + algo::Smallstr100 cppname; // + algo::Comment comment; // +private: + // func:amc.FUserfunc..Ctor + inline FUserfunc() __attribute__((nothrow)); + friend amc::FUserfunc& userfunc_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc::FUserfunc* userfunc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void userfunc_RemoveAll() __attribute__((nothrow)); + friend void userfunc_RemoveLast() __attribute__((nothrow)); +}; +``` + #### amc.FUsertracefld - Add custom user trace fields to process's trace struct @@ -6198,18 +6555,19 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_gen.h](/include/gen/amc_gen.h) ``` struct FXref { // amc.FXref - amc::FXref* zs_xref_next; // zslist link; -1 means not-in-list - amc::FXref* ind_xref_next; // hash next - amc::FXref* zd_xref_keyfld_next; // zslist link; -1 means not-in-list - amc::FXref* zd_xref_keyfld_prev; // previous element - algo::Smallstr100 field; // - algo::CppExpr inscond; // "true" Insert condition - algo::Smallstr200 via; // - amc::FField* p_field; // reference to parent row - amc::FCtype* p_ctype; // reference to parent row - amc::FNocascdel* c_nocascdel; // optional pointer - amc::FField* p_viafld; // reference to parent row - amc::FField* p_keyfld; // reference to parent row + amc::FXref* ctype_zs_xref_next; // zslist link; -1 means not-in-list + amc::FXref* ind_xref_next; // hash next + u32 ind_xref_hashval; // hash value + amc::FXref* field_zd_xref_keyfld_next; // zslist link; -1 means not-in-list + amc::FXref* field_zd_xref_keyfld_prev; // previous element + algo::Smallstr100 field; // + algo::CppExpr inscond; // "true" Insert condition + algo::Smallstr200 via; // + amc::FField* p_field; // reference to parent row + amc::FCtype* p_ctype; // reference to parent row + amc::FNocascdel* c_nocascdel; // optional pointer + amc::FField* p_viafld; // reference to parent row + amc::FField* p_keyfld; // reference to parent row // x-reference on amc.FXref.p_field prevents copy // x-reference on amc.FXref.c_nocascdel prevents copy // x-reference on amc.FXref.p_viafld prevents copy diff --git a/txt/exe/amc/reftypes.md b/txt/exe/amc/reftypes.md index 7e0409c8..8a594a68 100644 --- a/txt/exe/amc/reftypes.md +++ b/txt/exe/amc/reftypes.md @@ -66,15 +66,14 @@ Here is an example of a `Delptr` field: The following functions are generated: ``` -inline-command: amc -report:N atf_amc.DelType1.u32val.% -proto +inline-command: src_func -gen -showcomment -targsrc:atf_amc/% atf_amc.u32val% +// --- atf_amc.DelType1.u32val.Access // Get or Create // Access value, creating it if necessary. Process dies if not successful. -// func:atf_amc.DelType1.u32val.Access -u32& u32val_Access(atf_amc::DelType1& parent) __attribute__((nothrow)); +u32& atf_amc::u32val_Access(atf_amc::DelType1& parent) +// --- atf_amc.DelType1.u32val.Delete // Delete value. -// func:atf_amc.DelType1.u32val.Delete -void u32val_Delete(atf_amc::DelType1& parent) __attribute__((nothrow)); - +void atf_amc::u32val_Delete(atf_amc::DelType1& parent) ``` #### Exec - Subprocess @@ -111,46 +110,67 @@ dmmeta.field field:ssim2mysql.FDb.ctype arg:ssim2mysql.FCtype reftype:Lary d The following functions are generated: ``` -inline-command: amc -report:N ssim2mysql.FDb.ctype.% -proto +inline-command: src_func -gen -showcomment -targsrc:ssim2mysql/% ssim2mysql.ctype_% +// --- ssim2mysql.FCtype.msghdr.CopyOut +// Copy fields out of row +void ssim2mysql::ctype_CopyOut(ssim2mysql::FCtype &row, dmmeta::Ctype &out) +// --- ssim2mysql.FCtype.msghdr.CopyIn +// Copy fields in to row +void ssim2mysql::ctype_CopyIn(ssim2mysql::FCtype &row, dmmeta::Ctype &in) +// --- ssim2mysql.FDb.ctype.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -// func:ssim2mysql.FDb.ctype.Alloc -ssim2mysql::FCtype& ctype_Alloc() __attribute__((__warn_unused_result__, nothrow)); +ssim2mysql::FCtype& ssim2mysql::ctype_Alloc() +// --- ssim2mysql.FDb.ctype.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -// func:ssim2mysql.FDb.ctype.AllocMaybe -ssim2mysql::FCtype* ctype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +ssim2mysql::FCtype* ssim2mysql::ctype_AllocMaybe() +// --- ssim2mysql.FDb.ctype.InsertMaybe // Create new row from struct. // Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc) -// func:ssim2mysql.FDb.ctype.InsertMaybe -ssim2mysql::FCtype* ctype_InsertMaybe(const dmmeta::Ctype &value) __attribute__((nothrow)); +ssim2mysql::FCtype* ssim2mysql::ctype_InsertMaybe(const dmmeta::Ctype &value) +// --- ssim2mysql.FDb.ctype.AllocMem // Allocate space for one element. If no memory available, return NULL. -// func:ssim2mysql.FDb.ctype.AllocMem -void* ctype_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +void* ssim2mysql::ctype_AllocMem() +// --- ssim2mysql.FDb.ctype.RemoveLast +// Delete last element of array. Do nothing if array is empty. +void ssim2mysql::ctype_RemoveLast() +// --- ssim2mysql.FDb.ctype.InputMaybe +static bool ssim2mysql::ctype_InputMaybe(dmmeta::Ctype &elem) +// --- ssim2mysql.FDb.ctype.XrefMaybe +// Insert row into all appropriate indices. If error occurs, store error +// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. +bool ssim2mysql::ctype_XrefMaybe(ssim2mysql::FCtype &row) +// --- ssim2mysql.FField.ctype.Get +algo::Smallstr100 ssim2mysql::ctype_Get(ssim2mysql::FField& field) +// --- ssim2mysql.FCtype.c_field.InAryQ +// True if row is in any ptrary instance +inline bool ssim2mysql::ctype_c_field_InAryQ(ssim2mysql::FField& row) +// --- ssim2mysql.FCtype.c_field_curs.Reset +inline void ssim2mysql::ctype_c_field_curs_Reset(ctype_c_field_curs &curs, ssim2mysql::FCtype &parent) +// --- ssim2mysql.FCtype.c_field_curs.ValidQ +// cursor points to valid item +inline bool ssim2mysql::ctype_c_field_curs_ValidQ(ctype_c_field_curs &curs) +// --- ssim2mysql.FCtype.c_field_curs.Next +// proceed to next item +inline void ssim2mysql::ctype_c_field_curs_Next(ctype_c_field_curs &curs) +// --- ssim2mysql.FCtype.c_field_curs.Access +// item access +inline ssim2mysql::FField& ssim2mysql::ctype_c_field_curs_Access(ctype_c_field_curs &curs) +// --- ssim2mysql.FDb.ctype.EmptyQ // Return true if index is empty -// func:ssim2mysql.FDb.ctype.EmptyQ -inline bool ctype_EmptyQ() __attribute__((nothrow, pure)); +inline bool ssim2mysql::ctype_EmptyQ() +// --- ssim2mysql.FDb.ctype.Find // Look up row by row id. Return NULL if out of range -// func:ssim2mysql.FDb.ctype.Find -inline ssim2mysql::FCtype* ctype_Find(u64 t) __attribute__((__warn_unused_result__, nothrow, pure)); +inline ssim2mysql::FCtype* ssim2mysql::ctype_Find(u64 t) +// --- ssim2mysql.FDb.ctype.Last // Return pointer to last element of array, or NULL if array is empty -// func:ssim2mysql.FDb.ctype.Last -inline ssim2mysql::FCtype* ctype_Last() __attribute__((nothrow, pure)); +inline ssim2mysql::FCtype* ssim2mysql::ctype_Last() +// --- ssim2mysql.FDb.ctype.N // Return number of items in the pool -// func:ssim2mysql.FDb.ctype.N -inline i32 ctype_N() __attribute__((__warn_unused_result__, nothrow, pure)); -// Delete last element of array. Do nothing if array is empty. -// func:ssim2mysql.FDb.ctype.RemoveLast -void ctype_RemoveLast() __attribute__((nothrow)); +inline i32 ssim2mysql::ctype_N() +// --- ssim2mysql.FDb.ctype.qFind // 'quick' Access row by row id. No bounds checking. -// func:ssim2mysql.FDb.ctype.qFind -inline ssim2mysql::FCtype& ctype_qFind(u64 t) __attribute__((nothrow, pure)); -// func:ssim2mysql.FDb.ctype.InputMaybe -static bool ctype_InputMaybe(dmmeta::Ctype &elem) __attribute__((nothrow)); -// Insert row into all appropriate indices. If error occurs, store error -// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:ssim2mysql.FDb.ctype.XrefMaybe -bool ctype_XrefMaybe(ssim2mysql::FCtype &row); - +inline ssim2mysql::FCtype& ssim2mysql::ctype_qFind(u64 t) ``` #### Llist - X-reference: any of 32 possible types of linked list @@ -226,37 +246,36 @@ Here is an example of an Lpool declaration: The following functions are generated: ``` -inline-command: amc -report:N algo_lib.FDb.lpool.% -proto +inline-command: src_func -gen -showcomment -targsrc:algo_lib/% algo_lib.lpool_% +// --- algo_lib.FDb.lpool.FreeMem // Free block of memory previously returned by Lpool. -// func:algo_lib.FDb.lpool.FreeMem -void lpool_FreeMem(void* mem, u64 size) __attribute__((nothrow)); +void algo_lib::lpool_FreeMem(void* mem, u64 size) +// --- algo_lib.FDb.lpool.AllocMem // Allocate new piece of memory at least SIZE bytes long. // If not successful, return NULL // The allocated block is at least 1<<4 // The maximum allocation size is at most 1<<(36+4) -// func:algo_lib.FDb.lpool.AllocMem -void* lpool_AllocMem(u64 size) __attribute__((__warn_unused_result__, nothrow)); +void* algo_lib::lpool_AllocMem(u64 size) +// --- algo_lib.FDb.lpool.ReserveBuffers // Add N buffers of some size to the free store // Reserve NBUF buffers of size BUFSIZE from the base pool (algo_lib::sbrk) -// func:algo_lib.FDb.lpool.ReserveBuffers -bool lpool_ReserveBuffers(u64 nbuf, u64 bufsize) __attribute__((nothrow)); +bool algo_lib::lpool_ReserveBuffers(u64 nbuf, u64 bufsize) +// --- algo_lib.FDb.lpool.ReallocMem // Allocate new block, copy old to new, delete old. // If the new size is same as old size, do nothing. // In all other cases, new memory is allocated (i.e. size reduction is not a no-op) // If no memory, return NULL; old memory remains untouched -// func:algo_lib.FDb.lpool.ReallocMem -void* lpool_ReallocMem(void* oldmem, u64 old_size, u64 new_size) __attribute__((nothrow)); +void* algo_lib::lpool_ReallocMem(void* oldmem, u64 old_size, u64 new_size) +// --- algo_lib.FDb.lpool.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -// func:algo_lib.FDb.lpool.Alloc -u8& lpool_Alloc() __attribute__((__warn_unused_result__, nothrow)); +u8& algo_lib::lpool_Alloc() +// --- algo_lib.FDb.lpool.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -// func:algo_lib.FDb.lpool.AllocMaybe -u8* lpool_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +u8* algo_lib::lpool_AllocMaybe() +// --- algo_lib.FDb.lpool.Delete // Remove row from all global and cross indices, then deallocate row -// func:algo_lib.FDb.lpool.Delete -void lpool_Delete(u8 &row) __attribute__((nothrow)); - +void algo_lib::lpool_Delete(u8 &row) ``` #### Malloc - Pass-through for malloc / free @@ -296,15 +315,14 @@ dmmeta.field field:algo_lib.FDb.sbrk arg:u8 reftype:Sbrk dflt:"" comment:"B The following functions are generated: ``` -inline-command: amc -report:N algo_lib.FDb.sbrk.% -proto +inline-command: src_func -gen -showcomment -targsrc:algo_lib/% algo_lib.sbrk_% +// --- algo_lib.FDb.sbrk.AllocMem // Allocate a new piece of memory at least SIZE bytes long. // If out of memory, return NULL // Newly allocated memory is initialized to zeros -// func:algo_lib.FDb.sbrk.AllocMem -void* sbrk_AllocMem(u32 size) __attribute__((__warn_unused_result__, nothrow)); -// func:algo_lib.FDb.sbrk.FreeMem -void sbrk_FreeMem(void *mem, u32 size) __attribute__((nothrow)); - +void* algo_lib::sbrk_AllocMem(u32 size) +// --- algo_lib.FDb.sbrk.FreeMem +void algo_lib::sbrk_FreeMem(void *mem, u32 size) ``` Sbrk supports huge memory pages. To enable this behavior, set `_huge_limit` to some value. @@ -360,6 +378,11 @@ char& buf_AllocAt(algo::LineBuf& parent, int at) __attribute__((_ // Reserve space. Insert N elements at the end of the array, return pointer to array // func:algo.LineBuf.buf.AllocN algo::aryptr buf_AllocN(algo::LineBuf& parent, int n_elems) __attribute__((__warn_unused_result__, nothrow)); +// Reserve space. Insert N elements at the given position of the array, return pointer to inserted elements +// Reserve space for new element, reallocating the array if necessary +// Insert new element at specified index. Index must be in range or a fatal error occurs. +// func:algo.LineBuf.buf.AllocNAt +algo::aryptr buf_AllocNAt(algo::LineBuf& parent, int n_elems, int at) __attribute__((__warn_unused_result__, nothrow)); // Return true if index is empty // func:algo.LineBuf.buf.EmptyQ inline bool buf_EmptyQ(algo::LineBuf& parent) __attribute__((nothrow)); @@ -418,6 +441,10 @@ algo::aryptr buf_AllocNVal(algo::LineBuf& parent, int n_elems, const cha // The array is replaced with the input string. Function always succeeds. // func:algo.LineBuf.buf.ReadStrptrMaybe bool buf_ReadStrptrMaybe(algo::LineBuf& parent, algo::strptr in_str) __attribute__((nothrow)); +// Insert array at specific position +// Insert N elements at specified index. Index must be in range or a fatal error occurs.Reserve space, and move existing elements to end.If the RHS argument aliases the array (refers to the same memory), exit program with fatal error. +// func:algo.LineBuf.buf.Insary +void buf_Insary(algo::LineBuf& parent, algo::aryptr rhs, int at) __attribute__((nothrow)); ``` @@ -442,37 +469,36 @@ Here is an example of a `Tpool`: And here is the generated code: ``` -inline-command: amc -report:N ssim2mysql.FDb.cmd.% -proto +inline-command: src_func -gen -showcomment -targsrc:ssim2mysql/% ssim2mysql.cmd% +// --- ssim2mysql.FDb.cmd.Alloc // Allocate memory for new default row. // If out of memory, process is killed. -// func:ssim2mysql.FDb.cmd.Alloc -ssim2mysql::FCmd& cmd_Alloc() __attribute__((__warn_unused_result__, nothrow)); +ssim2mysql::FCmd& ssim2mysql::cmd_Alloc() +// --- ssim2mysql.FDb.cmd.AllocMaybe // Allocate memory for new element. If out of memory, return NULL. -// func:ssim2mysql.FDb.cmd.AllocMaybe -ssim2mysql::FCmd* cmd_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); +ssim2mysql::FCmd* ssim2mysql::cmd_AllocMaybe() +// --- ssim2mysql.FDb.cmd.Delete // Remove row from all global and cross indices, then deallocate row -// func:ssim2mysql.FDb.cmd.Delete -void cmd_Delete(ssim2mysql::FCmd &row) __attribute__((nothrow)); +void ssim2mysql::cmd_Delete(ssim2mysql::FCmd &row) +// --- ssim2mysql.FDb.cmd.AllocMem // Allocate space for one element // If no memory available, return NULL. -// func:ssim2mysql.FDb.cmd.AllocMem -void* cmd_AllocMem() __attribute__((__warn_unused_result__, nothrow)); +void* ssim2mysql::cmd_AllocMem() +// --- ssim2mysql.FDb.cmd.FreeMem // Remove mem from all global and cross indices, then deallocate mem -// func:ssim2mysql.FDb.cmd.FreeMem -void cmd_FreeMem(ssim2mysql::FCmd &row) __attribute__((nothrow)); +void ssim2mysql::cmd_FreeMem(ssim2mysql::FCmd &row) +// --- ssim2mysql.FDb.cmd.Reserve // Preallocate memory for N more elements // Return number of elements actually reserved. -// func:ssim2mysql.FDb.cmd.Reserve -u64 cmd_Reserve(u64 n_elems) __attribute__((nothrow)); +u64 ssim2mysql::cmd_Reserve(u64 n_elems) +// --- ssim2mysql.FDb.cmd.ReserveMem // Allocate block of given size, break up into small elements and append to free list. // Return number of elements reserved. -// func:ssim2mysql.FDb.cmd.ReserveMem -u64 cmd_ReserveMem(u64 size) __attribute__((nothrow)); +u64 ssim2mysql::cmd_ReserveMem(u64 size) +// --- ssim2mysql.FDb.cmd.XrefMaybe // Insert row into all appropriate indices. If error occurs, store error // in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row. -// func:ssim2mysql.FDb.cmd.XrefMaybe -bool cmd_XrefMaybe(ssim2mysql::FCmd &row); - +bool ssim2mysql::cmd_XrefMaybe(ssim2mysql::FCmd &row) ``` #### Upptr - Pointer to a past (pre-existing) record diff --git a/txt/exe/amc/strings.md b/txt/exe/amc/strings.md index b7e296eb..d83ac3cc 100644 --- a/txt/exe/amc/strings.md +++ b/txt/exe/amc/strings.md @@ -75,8 +75,6 @@ inline-command: amc algo.LspaceStr5.ch% -proto -report:N // Access string as array of chars // func:algo.LspaceStr5.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr5& parent) __attribute__((nothrow)); -// func:algo.LspaceStr5.ch.HashStrptr -inline u32 LspaceStr5_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr5.ch.Init inline void ch_Init(algo::LspaceStr5 &parent) __attribute__((nothrow)); // always return constant 5 @@ -123,8 +121,6 @@ inline-command: amc algo.LspaceStr5_I16.ch% -proto -report:N // Access string as array of chars // func:algo.LspaceStr5_I16.ch.Getary inline algo::aryptr ch_Getary(const algo::LspaceStr5_I16& parent) __attribute__((nothrow)); -// func:algo.LspaceStr5_I16.ch.HashStrptr -inline u32 LspaceStr5_I16_Hash(u32 prev, const algo::strptr &str); // func:algo.LspaceStr5_I16.ch.Init inline void ch_Init(algo::LspaceStr5_I16 &parent) __attribute__((nothrow)); // always return constant 5 diff --git a/txt/exe/amc/xref.md b/txt/exe/amc/xref.md index 641d34be..bebd420a 100644 --- a/txt/exe/amc/xref.md +++ b/txt/exe/amc/xref.md @@ -48,16 +48,12 @@ To visualize xrefs, it may be useful to use [amc_vis](/txt/exe/amc_vis/README.md To visualize the example above, we would use ``` inline-command: amc_vis amc.FTarget\|amc.FTargdep - - - / amc.FTargdep - | - / amc.FTarget | - |<------------------|Upptr p_target - |Ptrary c_targdep-->| - |<------------------|Upptr p_parent - | - - | - - + / amc.FTargdep + / amc.FTarget | + |<------------------|Upptr p_target + |Ptrary c_targdep-->| + |<------------------|Upptr p_parent + | - + - ``` diff --git a/txt/exe/amc_gc/README.md b/txt/exe/amc_gc/README.md index b57e48fc..2ce7eed8 100644 --- a/txt/exe/amc_gc/README.md +++ b/txt/exe/amc_gc/README.md @@ -23,8 +23,8 @@ Usage: amc_gc [options] -key regx "" ACR query selecting records to eliminate, e.g. dmmeta.ctype:amc.% -include Garbage collect includes for specified target -in string "data" Input directory or filename, - for stdin - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig diff --git a/txt/exe/amc_vis/README.md b/txt/exe/amc_vis/README.md index 076148c6..24e12f67 100644 --- a/txt/exe/amc_vis/README.md +++ b/txt/exe/amc_vis/README.md @@ -23,12 +23,12 @@ Usage: amc_vis [[-ctype:]] [options] -in string "data" Input directory or filename, - for stdin -dot string "" Save dot file with specified filename -xref Include all ctypes referenced by selected ones - -xns Cross namespace boundaries + -xns Y Cross namespace boundaries -noinput Deselect module inputs -check Check model for dependency problems -render Y Produce an ascii drawing - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -110,11 +110,11 @@ amc_vis can also output an dot file, which can then be viewed in a browser: `amc_vis` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dmmeta.reftype](/txt/ssimdb/dmmeta/reftype.md)|Field type constructor (e.g. reference type)| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| |[dmmeta.finput](/txt/ssimdb/dmmeta/finput.md)|Describe input table of a program| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dmmeta.reftype](/txt/ssimdb/dmmeta/reftype.md)|Field type constructor (e.g. reference type)| diff --git a/txt/exe/amc_vis/internals.md b/txt/exe/amc_vis/internals.md index 692f04d5..3513fcc7 100644 --- a/txt/exe/amc_vis/internals.md +++ b/txt/exe/amc_vis/internals.md @@ -60,29 +60,29 @@ All allocations are done through global `amc_vis::_db` [amc_vis.FDb](#amc_vis-fd ||||FCtype.c_field (Ptrary)| |[amc_vis.FFinput](#amc_vis-ffinput)|[dmmeta.finput](/txt/ssimdb/dmmeta/finput.md)|FDb.finput (Lary)|finput (Lary, by rowid)| ||||FField.c_finput (Ptr)| +|[amc_vis.Linkkey](#amc_vis-linkkey)|| +|[amc_vis.FLink](#amc_vis-flink)||FDb.link (Lary)|link (Lary, by rowid)|ind_link (Thash, hash field link)|c_linklist (Ptrary)|bh_link (Bheap, sort field linkkey)| +||||FLinkdep.p_link_from (Upptr)| +||||FLinkdep.p_link_to (Upptr)| +||||FNode.c_bottom (Ptr)| +||||FNode.c_top (Ptr)| +||||FNode.zd_link_out (Llist)| +||||FNode.zd_link_in (Llist)| +|[amc_vis.FLinkdep](#amc_vis-flinkdep)||FDb.linkdep (Lary)|linkdep (Lary, by rowid)| +||||FLink.zd_linkdep_out (Llist)| +||||FLink.zd_linkdep_in (Llist)| |[amc_vis.Nodekey](#amc_vis-nodekey)|| |[amc_vis.FNode](#amc_vis-fnode)||FDb.node (Lary)|node (Lary, by rowid)|ind_node (Thash, hash field node)|bh_node (Bheap, sort field nodekey)| +||||FLink.p_node1 (Upptr)| +||||FLink.p_node2 (Upptr)| ||||FNodedep.p_node1 (Upptr)| ||||FNodedep.p_node2 (Upptr)| -||||Link.p_node1 (Upptr)| -||||Link.p_node2 (Upptr)| |[amc_vis.FNodedep](#amc_vis-fnodedep)||FDb.nodedep (Lary)|nodedep (Lary, by rowid)| ||||FNode.zd_nodedep_out (Llist)| ||||FNode.zd_nodedep_in (Llist)| +|[amc_vis.FOutrow](#amc_vis-foutrow)||FDb.outrow (Lary)|outrow (Lary, by rowid)| |[amc_vis.FReftype](#amc_vis-freftype)|[dmmeta.reftype](/txt/ssimdb/dmmeta/reftype.md)|FDb.reftype (Lary)|reftype (Lary, by rowid)|ind_reftype (Thash, hash field reftype)| ||||FField.p_reftype (Upptr)| -|[amc_vis.Linkkey](#amc_vis-linkkey)|| -|[amc_vis.Link](#amc_vis-link)||FDb.link (Lary)|link (Lary, by rowid)|ind_link (Thash, hash field link)|c_linklist (Ptrary)|bh_link (Bheap, sort field linkkey)| -||||FNode.c_bottom (Ptr)| -||||FNode.c_top (Ptr)| -||||FNode.zd_link_out (Llist)| -||||FNode.zd_link_in (Llist)| -||||Linkdep.p_link_from (Upptr)| -||||Linkdep.p_link_to (Upptr)| -|[amc_vis.Linkdep](#amc_vis-linkdep)||FDb.linkdep (Lary)|linkdep (Lary, by rowid)| -||||Link.zd_linkdep_out (Llist)| -||||Link.zd_linkdep_in (Llist)| -|[amc_vis.Outrow](#amc_vis-outrow)||FDb.outrow (Lary)|outrow (Lary, by rowid)| #### amc_vis.FCtype - Struct @@ -97,6 +97,8 @@ All allocations are done through global `amc_vis::_db` [amc_vis.FDb](#amc_vis-fd |amc_vis.FCtype.c_field|[amc_vis.FField](/txt/exe/amc_vis/internals.md#amc_vis-ffield)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |amc_vis.FCtype.mm_id|i32|[Val](/txt/exe/amc/reftypes.md#val)||Model matrix ID| |amc_vis.FCtype.isinput|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc_vis.FCtype.userselect|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc_vis.FCtype.color|u16|[Val](/txt/exe/amc/reftypes.md#val)||| #### Struct FCtype @@ -105,18 +107,21 @@ All allocations are done through global `amc_vis::_db` [amc_vis.FDb](#amc_vis-fd Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) ``` struct FCtype { // amc_vis.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - algo::cstring cpp_type; // type name to use in c++ - amc_vis::FCtype* p_base; // reference to parent row - amc_vis::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - i32 mm_id; // 0 Model matrix ID - bool isinput; // false - amc_vis::FCtype* ind_ctype_next; // hash next - amc_vis::FCtype* zd_select_next; // zslist link; -1 means not-in-list - amc_vis::FCtype* zd_select_prev; // previous element + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + algo::cstring cpp_type; // type name to use in c++ + amc_vis::FCtype* p_base; // reference to parent row + amc_vis::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + i32 mm_id; // 0 Model matrix ID + bool isinput; // false + bool userselect; // false + u16 color; // 0 + amc_vis::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value + amc_vis::FCtype* zd_select_next; // zslist link; -1 means not-in-list + amc_vis::FCtype* zd_select_prev; // previous element // reftype Ptrary of amc_vis.FCtype.c_field prohibits copy // func:amc_vis.FCtype..AssignOp amc_vis::FCtype& operator =(const amc_vis::FCtype &rhs) = delete; @@ -150,18 +155,22 @@ private: |amc_vis.FDb.ind_field|[amc_vis.FField](/txt/exe/amc_vis/internals.md#amc_vis-ffield)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |amc_vis.FDb.node|[amc_vis.FNode](/txt/exe/amc_vis/internals.md#amc_vis-fnode)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |amc_vis.FDb.ind_node|[amc_vis.FNode](/txt/exe/amc_vis/internals.md#amc_vis-fnode)|[Thash](/txt/exe/amc/reftypes.md#thash)||| -|amc_vis.FDb.link|[amc_vis.Link](/txt/exe/amc_vis/internals.md#amc_vis-link)|[Lary](/txt/exe/amc/reftypes.md#lary)||| -|amc_vis.FDb.ind_link|[amc_vis.Link](/txt/exe/amc_vis/internals.md#amc_vis-link)|[Thash](/txt/exe/amc/reftypes.md#thash)||| -|amc_vis.FDb.linkdep|[amc_vis.Linkdep](/txt/exe/amc_vis/internals.md#amc_vis-linkdep)|[Lary](/txt/exe/amc/reftypes.md#lary)||| -|amc_vis.FDb.c_linklist|[amc_vis.Link](/txt/exe/amc_vis/internals.md#amc_vis-link)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| +|amc_vis.FDb.link|[amc_vis.FLink](/txt/exe/amc_vis/internals.md#amc_vis-flink)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|amc_vis.FDb.ind_link|[amc_vis.FLink](/txt/exe/amc_vis/internals.md#amc_vis-flink)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|amc_vis.FDb.linkdep|[amc_vis.FLinkdep](/txt/exe/amc_vis/internals.md#amc_vis-flinkdep)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|amc_vis.FDb.c_linklist|[amc_vis.FLink](/txt/exe/amc_vis/internals.md#amc_vis-flink)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |amc_vis.FDb.bh_node|[amc_vis.FNode](/txt/exe/amc_vis/internals.md#amc_vis-fnode)|[Bheap](/txt/exe/amc/reftypes.md#bheap)||Heap of ctypes, used to compute columns| -|amc_vis.FDb.bh_link|[amc_vis.Link](/txt/exe/amc_vis/internals.md#amc_vis-link)|[Bheap](/txt/exe/amc/reftypes.md#bheap)||Heap of links, used to place links| +|amc_vis.FDb.bh_link|[amc_vis.FLink](/txt/exe/amc_vis/internals.md#amc_vis-flink)|[Bheap](/txt/exe/amc/reftypes.md#bheap)||Heap of links, used to place links| |amc_vis.FDb.reftype|[amc_vis.FReftype](/txt/exe/amc_vis/internals.md#amc_vis-freftype)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |amc_vis.FDb.ind_reftype|[amc_vis.FReftype](/txt/exe/amc_vis/internals.md#amc_vis-freftype)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |amc_vis.FDb.nodedep|[amc_vis.FNodedep](/txt/exe/amc_vis/internals.md#amc_vis-fnodedep)|[Lary](/txt/exe/amc/reftypes.md#lary)||| -|amc_vis.FDb.outrow|[amc_vis.Outrow](/txt/exe/amc_vis/internals.md#amc_vis-outrow)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|amc_vis.FDb.outrow|[amc_vis.FOutrow](/txt/exe/amc_vis/internals.md#amc_vis-foutrow)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |amc_vis.FDb.zd_select|[amc_vis.FCtype](/txt/exe/amc_vis/internals.md#amc_vis-fctype)|[Llist](/txt/exe/amc/reftypes.md#llist)||| |amc_vis.FDb.finput|[amc_vis.FFinput](/txt/exe/amc_vis/internals.md#amc_vis-ffinput)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|amc_vis.FDb.term_hei|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc_vis.FDb.term_wid|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc_vis.FDb.usecolor|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc_vis.FDb.hastty|bool|[Val](/txt/exe/amc/reftypes.md#val)||| #### Struct FDb @@ -185,20 +194,20 @@ struct FDb { // amc_vis.FDb: In-memory database for amc_vis amc_vis::FNode** ind_node_buckets_elems; // pointer to bucket array i32 ind_node_buckets_n; // number of elements in bucket array i32 ind_node_n; // number of elements in the hash table - amc_vis::Link* link_lary[32]; // level array + amc_vis::FLink* link_lary[32]; // level array i32 link_n; // number of elements in array - amc_vis::Link** ind_link_buckets_elems; // pointer to bucket array + amc_vis::FLink** ind_link_buckets_elems; // pointer to bucket array i32 ind_link_buckets_n; // number of elements in bucket array i32 ind_link_n; // number of elements in the hash table - amc_vis::Linkdep* linkdep_lary[32]; // level array + amc_vis::FLinkdep* linkdep_lary[32]; // level array i32 linkdep_n; // number of elements in array - amc_vis::Link** c_linklist_elems; // array of pointers + amc_vis::FLink** c_linklist_elems; // array of pointers u32 c_linklist_n; // array of pointers u32 c_linklist_max; // capacity of allocated array amc_vis::FNode** bh_node_elems; // binary heap by nodekey i32 bh_node_n; // number of elements in the heap i32 bh_node_max; // max elements in bh_node_elems - amc_vis::Link** bh_link_elems; // binary heap by linkkey + amc_vis::FLink** bh_link_elems; // binary heap by linkkey i32 bh_link_n; // number of elements in the heap i32 bh_link_max; // max elements in bh_link_elems amc_vis::FReftype* reftype_lary[32]; // level array @@ -208,13 +217,17 @@ struct FDb { // amc_vis.FDb: In-memory database for amc_vis i32 ind_reftype_n; // number of elements in the hash table amc_vis::FNodedep* nodedep_lary[32]; // level array i32 nodedep_n; // number of elements in array - amc_vis::Outrow* outrow_lary[32]; // level array + amc_vis::FOutrow* outrow_lary[32]; // level array i32 outrow_n; // number of elements in array amc_vis::FCtype* zd_select_head; // zero-terminated doubly linked list i32 zd_select_n; // zero-terminated doubly linked list amc_vis::FCtype* zd_select_tail; // pointer to last element amc_vis::FFinput* finput_lary[32]; // level array i32 finput_n; // number of elements in array + i32 term_hei; // 0 + i32 term_wid; // 0 + bool usecolor; // false + bool hastty; // false amc_vis::trace trace; // }; ``` @@ -240,6 +253,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/inc ``` struct FField { // amc_vis.FField amc_vis::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -309,6 +323,154 @@ private: }; ``` +#### amc_vis.Linkkey - Heap key for selecting next link to render - fields quantify selection criteria + + +#### amc_vis.Linkkey Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc_vis.Linkkey.n_link_in|u32|[Val](/txt/exe/amc/reftypes.md#val)||Number of incoming dependencies| +|amc_vis.Linkkey.samecol|i32|[Val](/txt/exe/amc/reftypes.md#val)||Set on links that lead to the same column| +|amc_vis.Linkkey.colweight|i32|[Val](/txt/exe/amc/reftypes.md#val)||Heavier columns are scheduled first| + +#### Struct Linkkey + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) +``` +struct Linkkey { // amc_vis.Linkkey: Heap key for selecting next link to render - fields quantify selection criteria + u32 n_link_in; // 0 Number of incoming dependencies + i32 samecol; // 0 Set on links that lead to the same column + i32 colweight; // 0 Heavier columns are scheduled first + // func:amc_vis.Linkkey..EqOp + inline bool operator ==(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..NeOp + inline bool operator !=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..LtOp + inline bool operator <(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..GtOp + inline bool operator >(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..LeOp + inline bool operator <=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..GeOp + inline bool operator >=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); + // func:amc_vis.Linkkey..Ctor + inline Linkkey() __attribute__((nothrow)); + // func:amc_vis.Linkkey..FieldwiseCtor + explicit inline Linkkey(u32 in_n_link_in, i32 in_samecol, i32 in_colweight) __attribute__((nothrow)); +}; +``` + +#### amc_vis.FLink - Correspodns to a ctype + + +#### amc_vis.FLink Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc_vis.FLink.link|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Primary key| +|amc_vis.FLink.label1|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Label in column 1| +|amc_vis.FLink.label2|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Label in column 2| +|amc_vis.FLink.linkkey|[amc_vis.Linkkey](/txt/exe/amc_vis/internals.md#amc_vis-linkkey)|[Val](/txt/exe/amc/reftypes.md#val)||| +|amc_vis.FLink.outrow|i32|[Val](/txt/exe/amc/reftypes.md#val)||Outrow #| +|amc_vis.FLink.p_node1|[amc_vis.FNode](/txt/exe/amc_vis/internals.md#amc_vis-fnode)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| +|amc_vis.FLink.p_node2|[amc_vis.FNode](/txt/exe/amc_vis/internals.md#amc_vis-fnode)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| +|amc_vis.FLink.upptr|bool|[Val](/txt/exe/amc/reftypes.md#val)||Up-arrow (not a constraint)| +|amc_vis.FLink.zd_linkdep_out|[amc_vis.FLinkdep](/txt/exe/amc_vis/internals.md#amc_vis-flinkdep)|[Llist](/txt/exe/amc/reftypes.md#llist)||Arrow from this ctype| +|amc_vis.FLink.zd_linkdep_in|[amc_vis.FLinkdep](/txt/exe/amc_vis/internals.md#amc_vis-flinkdep)|[Llist](/txt/exe/amc/reftypes.md#llist)||Arrows to this ctype| + +#### Struct FLink + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) +``` +struct FLink { // amc_vis.FLink: Correspodns to a ctype + amc_vis::FLink* ind_link_next; // hash next + u32 ind_link_hashval; // hash value + i32 bh_link_idx; // index in heap; -1 means not-in-heap + algo::cstring link; // Primary key + algo::cstring label1; // Label in column 1 + algo::cstring label2; // Label in column 2 + amc_vis::Linkkey linkkey; // + i32 outrow; // 0 Outrow # + amc_vis::FNode* p_node1; // reference to parent row + amc_vis::FNode* p_node2; // reference to parent row + bool upptr; // false Up-arrow (not a constraint) + amc_vis::FLinkdep* zd_linkdep_out_head; // zero-terminated doubly linked list + amc_vis::FLinkdep* zd_linkdep_out_tail; // pointer to last element + amc_vis::FLinkdep* zd_linkdep_in_head; // zero-terminated doubly linked list + amc_vis::FLinkdep* zd_linkdep_in_tail; // pointer to last element + bool c_linklist_in_ary; // false membership flag + amc_vis::FLink* node_zd_link_out_next; // zslist link; -1 means not-in-list + amc_vis::FLink* node_zd_link_out_prev; // previous element + amc_vis::FLink* node_zd_link_in_next; // zslist link; -1 means not-in-list + amc_vis::FLink* node_zd_link_in_prev; // previous element + // reftype Llist of amc_vis.FLink.zd_linkdep_out prohibits copy + // reftype Llist of amc_vis.FLink.zd_linkdep_in prohibits copy + // func:amc_vis.FLink..AssignOp + amc_vis::FLink& operator =(const amc_vis::FLink &rhs) = delete; + // reftype Llist of amc_vis.FLink.zd_linkdep_out prohibits copy + // reftype Llist of amc_vis.FLink.zd_linkdep_in prohibits copy + // func:amc_vis.FLink..CopyCtor + FLink(const amc_vis::FLink &rhs) = delete; +private: + // func:amc_vis.FLink..Ctor + inline FLink() __attribute__((nothrow)); + // func:amc_vis.FLink..Dtor + inline ~FLink() __attribute__((nothrow)); + friend amc_vis::FLink& link_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc_vis::FLink* link_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void link_RemoveAll() __attribute__((nothrow)); + friend void link_RemoveLast() __attribute__((nothrow)); +}; +``` + +#### amc_vis.FLinkdep - Corresponds to a field + + +#### amc_vis.FLinkdep Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc_vis.FLinkdep.row|[amc_vis.FOutrow](/txt/exe/amc_vis/internals.md#amc_vis-foutrow)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| +|amc_vis.FLinkdep.rowid|i32|[Val](/txt/exe/amc/reftypes.md#val)||Id| +|amc_vis.FLinkdep.up|bool|[Val](/txt/exe/amc/reftypes.md#val)||Points up| +|amc_vis.FLinkdep.inst|bool|[Val](/txt/exe/amc/reftypes.md#val)||Instance (vs. index)| +|amc_vis.FLinkdep.p_link_from|[amc_vis.FLink](/txt/exe/amc_vis/internals.md#amc_vis-flink)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Source ctype| +|amc_vis.FLinkdep.p_link_to|[amc_vis.FLink](/txt/exe/amc_vis/internals.md#amc_vis-flink)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Target ctype| + +#### Struct FLinkdep + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) +``` +struct FLinkdep { // amc_vis.FLinkdep: Corresponds to a field + amc_vis::FLinkdep* link_zd_linkdep_out_next; // zslist link; -1 means not-in-list + amc_vis::FLinkdep* link_zd_linkdep_out_prev; // previous element + amc_vis::FLinkdep* link_zd_linkdep_in_next; // zslist link; -1 means not-in-list + amc_vis::FLinkdep* link_zd_linkdep_in_prev; // previous element + i32 row; // 0 + i32 rowid; // 0 Id + bool up; // false Points up + bool inst; // false Instance (vs. index) + amc_vis::FLink* p_link_from; // reference to parent row + amc_vis::FLink* p_link_to; // reference to parent row + // func:amc_vis.FLinkdep..AssignOp + inline amc_vis::FLinkdep& operator =(const amc_vis::FLinkdep &rhs) = delete; + // func:amc_vis.FLinkdep..CopyCtor + inline FLinkdep(const amc_vis::FLinkdep &rhs) = delete; + // func:amc_vis.FLinkdep..FieldwiseCtor + explicit inline FLinkdep(i32 in_row, i32 in_rowid, bool in_up, bool in_inst, amc_vis::FLink* in_p_link_from, amc_vis::FLink* in_p_link_to) __attribute__((nothrow)); +private: + // func:amc_vis.FLinkdep..Ctor + inline FLinkdep() __attribute__((nothrow)); + // func:amc_vis.FLinkdep..Dtor + inline ~FLinkdep() __attribute__((nothrow)); + friend amc_vis::FLinkdep& linkdep_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc_vis::FLinkdep* linkdep_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void linkdep_RemoveAll() __attribute__((nothrow)); + friend void linkdep_RemoveLast() __attribute__((nothrow)); +}; +``` + #### amc_vis.Nodekey - Correspodns to a ctype @@ -318,16 +480,14 @@ private: |---|---|---|---|---| |amc_vis.Nodekey.n_ct_in|u32|[Val](/txt/exe/amc/reftypes.md#val)||Number of incoming dependencies| |amc_vis.Nodekey.idx|i32|[Val](/txt/exe/amc/reftypes.md#val)||Set to -rowid| -|amc_vis.Nodekey.prev_xpos|i32|[Val](/txt/exe/amc/reftypes.md#val)|99999999|| #### Struct Nodekey Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) ``` struct Nodekey { // amc_vis.Nodekey: Correspodns to a ctype - u32 n_ct_in; // 0 Number of incoming dependencies - i32 idx; // 0 Set to -rowid - i32 prev_xpos; // 99999999 + u32 n_ct_in; // 0 Number of incoming dependencies + i32 idx; // 0 Set to -rowid // func:amc_vis.Nodekey..EqOp inline bool operator ==(const amc_vis::Nodekey &rhs) const __attribute__((nothrow)); // func:amc_vis.Nodekey..NeOp @@ -343,7 +503,7 @@ struct Nodekey { // amc_vis.Nodekey: Correspodns to a ctype // func:amc_vis.Nodekey..Ctor inline Nodekey() __attribute__((nothrow)); // func:amc_vis.Nodekey..FieldwiseCtor - explicit inline Nodekey(u32 in_n_ct_in, i32 in_idx, i32 in_prev_xpos) __attribute__((nothrow)); + explicit inline Nodekey(u32 in_n_ct_in, i32 in_idx) __attribute__((nothrow)); }; ``` @@ -357,16 +517,16 @@ struct Nodekey { // amc_vis.Nodekey: Correspodns to a ctype |amc_vis.FNode.node|[algo.Smallstr100](/txt/protocol/algo/README.md#algo-smallstr100)|[Val](/txt/exe/amc/reftypes.md#val)||| |amc_vis.FNode.nodekey|[amc_vis.Nodekey](/txt/exe/amc_vis/internals.md#amc_vis-nodekey)|[Val](/txt/exe/amc/reftypes.md#val)||Sort key for columns| |amc_vis.FNode.label|[algo.Smallstr100](/txt/protocol/algo/README.md#algo-smallstr100)|[Val](/txt/exe/amc/reftypes.md#val)||Display label| -|amc_vis.FNode.xpos|i32|[Val](/txt/exe/amc/reftypes.md#val)|1|| +|amc_vis.FNode.xpos|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|| |amc_vis.FNode.label2|[algo.Smallstr100](/txt/protocol/algo/README.md#algo-smallstr100)|[Val](/txt/exe/amc/reftypes.md#val)||Display label| -|amc_vis.FNode.c_bottom|[amc_vis.Link](/txt/exe/amc_vis/internals.md#amc_vis-link)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Bottom| -|amc_vis.FNode.c_top|[amc_vis.Link](/txt/exe/amc_vis/internals.md#amc_vis-link)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Top| +|amc_vis.FNode.c_bottom|[amc_vis.FLink](/txt/exe/amc_vis/internals.md#amc_vis-flink)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Bottom| +|amc_vis.FNode.c_top|[amc_vis.FLink](/txt/exe/amc_vis/internals.md#amc_vis-flink)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Top| |amc_vis.FNode.p_ctype|[amc_vis.FCtype](/txt/exe/amc_vis/internals.md#amc_vis-fctype)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| |amc_vis.FNode.rowid|i32|[Val](/txt/exe/amc/reftypes.md#val)||| |amc_vis.FNode.zd_nodedep_out|[amc_vis.FNodedep](/txt/exe/amc_vis/internals.md#amc_vis-fnodedep)|[Llist](/txt/exe/amc/reftypes.md#llist)||Arrow from this ctype| |amc_vis.FNode.zd_nodedep_in|[amc_vis.FNodedep](/txt/exe/amc_vis/internals.md#amc_vis-fnodedep)|[Llist](/txt/exe/amc/reftypes.md#llist)||Arrows to this ctype| -|amc_vis.FNode.zd_link_out|[amc_vis.Link](/txt/exe/amc_vis/internals.md#amc_vis-link)|[Llist](/txt/exe/amc/reftypes.md#llist)||Arrow from this ctype| -|amc_vis.FNode.zd_link_in|[amc_vis.Link](/txt/exe/amc_vis/internals.md#amc_vis-link)|[Llist](/txt/exe/amc/reftypes.md#llist)||Arrow from this ctype| +|amc_vis.FNode.zd_link_out|[amc_vis.FLink](/txt/exe/amc_vis/internals.md#amc_vis-flink)|[Llist](/txt/exe/amc/reftypes.md#llist)||Arrow from this ctype| +|amc_vis.FNode.zd_link_in|[amc_vis.FLink](/txt/exe/amc_vis/internals.md#amc_vis-flink)|[Llist](/txt/exe/amc/reftypes.md#llist)||Arrow from this ctype| #### Struct FNode @@ -374,14 +534,15 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/inc ``` struct FNode { // amc_vis.FNode: Corresponds to a ctype amc_vis::FNode* ind_node_next; // hash next + u32 ind_node_hashval; // hash value i32 bh_node_idx; // index in heap; -1 means not-in-heap algo::Smallstr100 node; // amc_vis::Nodekey nodekey; // Sort key for columns algo::Smallstr100 label; // Display label - i32 xpos; // 1 + i32 xpos; // 0 algo::Smallstr100 label2; // Display label - amc_vis::Link* c_bottom; // Bottom. optional pointer - amc_vis::Link* c_top; // Top. optional pointer + amc_vis::FLink* c_bottom; // Bottom. optional pointer + amc_vis::FLink* c_top; // Top. optional pointer amc_vis::FCtype* p_ctype; // reference to parent row i32 rowid; // 0 amc_vis::FNodedep* zd_nodedep_out_head; // zero-terminated doubly linked list @@ -389,12 +550,12 @@ struct FNode { // amc_vis.FNode: Corresponds to a ctype amc_vis::FNodedep* zd_nodedep_in_head; // zero-terminated doubly linked list i32 zd_nodedep_in_n; // zero-terminated doubly linked list amc_vis::FNodedep* zd_nodedep_in_tail; // pointer to last element - amc_vis::Link* zd_link_out_head; // zero-terminated doubly linked list + amc_vis::FLink* zd_link_out_head; // zero-terminated doubly linked list i32 zd_link_out_n; // zero-terminated doubly linked list - amc_vis::Link* zd_link_out_tail; // pointer to last element - amc_vis::Link* zd_link_in_head; // zero-terminated doubly linked list + amc_vis::FLink* zd_link_out_tail; // pointer to last element + amc_vis::FLink* zd_link_in_head; // zero-terminated doubly linked list i32 zd_link_in_n; // zero-terminated doubly linked list - amc_vis::Link* zd_link_in_tail; // pointer to last element + amc_vis::FLink* zd_link_in_tail; // pointer to last element // reftype Llist of amc_vis.FNode.zd_nodedep_out prohibits copy // reftype Llist of amc_vis.FNode.zd_nodedep_in prohibits copy // reftype Llist of amc_vis.FNode.zd_link_out prohibits copy @@ -426,7 +587,7 @@ private: |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|amc_vis.FNodedep.row|[amc_vis.Outrow](/txt/exe/amc_vis/internals.md#amc_vis-outrow)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| +|amc_vis.FNodedep.row|[amc_vis.FOutrow](/txt/exe/amc_vis/internals.md#amc_vis-foutrow)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| |amc_vis.FNodedep.rowid|i32|[Val](/txt/exe/amc/reftypes.md#val)||Id| |amc_vis.FNodedep.up|bool|[Val](/txt/exe/amc/reftypes.md#val)||Points up| |amc_vis.FNodedep.inst|bool|[Val](/txt/exe/amc/reftypes.md#val)||Instance (vs. index)| @@ -440,18 +601,18 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) ``` struct FNodedep { // amc_vis.FNodedep: Edge for computing node dependencies - amc_vis::FNodedep* zd_nodedep_out_next; // zslist link; -1 means not-in-list - amc_vis::FNodedep* zd_nodedep_out_prev; // previous element - amc_vis::FNodedep* zd_nodedep_in_next; // zslist link; -1 means not-in-list - amc_vis::FNodedep* zd_nodedep_in_prev; // previous element - i32 row; // 0 - i32 rowid; // 0 Id - bool up; // false Points up - bool inst; // false Instance (vs. index) - amc_vis::FNode* p_node1; // reference to parent row - amc_vis::FNode* p_node2; // reference to parent row - algo::Smallstr50 name; // - algo::Smallstr50 reftype; // + amc_vis::FNodedep* node_zd_nodedep_out_next; // zslist link; -1 means not-in-list + amc_vis::FNodedep* node_zd_nodedep_out_prev; // previous element + amc_vis::FNodedep* node_zd_nodedep_in_next; // zslist link; -1 means not-in-list + amc_vis::FNodedep* node_zd_nodedep_in_prev; // previous element + i32 row; // 0 + i32 rowid; // 0 Id + bool up; // false Points up + bool inst; // false Instance (vs. index) + amc_vis::FNode* p_node1; // reference to parent row + amc_vis::FNode* p_node2; // reference to parent row + algo::Smallstr50 name; // + algo::Smallstr50 reftype; // // func:amc_vis.FNodedep..AssignOp inline amc_vis::FNodedep& operator =(const amc_vis::FNodedep &rhs) = delete; // func:amc_vis.FNodedep..CopyCtor @@ -470,6 +631,41 @@ private: }; ``` +#### amc_vis.FOutrow - One line of text + + +#### amc_vis.FOutrow Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|amc_vis.FOutrow.rowid|i32|[Val](/txt/exe/amc/reftypes.md#val)||FOutrow pkey| +|amc_vis.FOutrow.text|u16|[Tary](/txt/exe/amc/reftypes.md#tary)||Lower byte=text; Upper byte=color| + +#### Struct FOutrow + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) +``` +struct FOutrow { // amc_vis.FOutrow: One line of text + i32 rowid; // 0 FOutrow pkey + u16* text_elems; // pointer to elements + u32 text_n; // number of elements in array + u32 text_max; // max. capacity of array before realloc + // func:amc_vis.FOutrow..AssignOp + amc_vis::FOutrow& operator =(const amc_vis::FOutrow &rhs) __attribute__((nothrow)); + // func:amc_vis.FOutrow..CopyCtor + FOutrow(const amc_vis::FOutrow &rhs) __attribute__((nothrow)); +private: + // func:amc_vis.FOutrow..Ctor + inline FOutrow() __attribute__((nothrow)); + // func:amc_vis.FOutrow..Dtor + inline ~FOutrow() __attribute__((nothrow)); + friend amc_vis::FOutrow& outrow_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend amc_vis::FOutrow* outrow_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void outrow_RemoveAll() __attribute__((nothrow)); + friend void outrow_RemoveLast() __attribute__((nothrow)); +}; +``` + #### amc_vis.FReftype - Field type constructor (e.g. reference type) @@ -486,19 +682,20 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) ``` struct FReftype { // amc_vis.FReftype - amc_vis::FReftype* ind_reftype_next; // hash next - algo::Smallstr50 reftype; // "Val" - bool isval; // false True if field makes values of target type - bool cascins; // false Field is cascade-insert - bool usebasepool; // false Fields with this type make use of dmmeta.basepool - bool cancopy; // false This type of field can be copied - bool isxref; // false This type of field is an x-ref - bool del; // false Supports random deletion? - bool up; // false This type of field is a reference - bool isnew; // false If set, skip this relation in amc_vis - bool hasalloc; // false Generte Alloc/Delete functions for arg type - bool inst; // false Field creates an instance of arg type (directly or indirectly) - bool varlen; // false This pool supports varlen allocations + amc_vis::FReftype* ind_reftype_next; // hash next + u32 ind_reftype_hashval; // hash value + algo::Smallstr50 reftype; // "Val" + bool isval; // false True if field makes values of target type + bool cascins; // false Field is cascade-insert + bool usebasepool; // false Fields with this type make use of dmmeta.basepool + bool cancopy; // false This type of field can be copied + bool isxref; // false This type of field is an x-ref + bool del; // false Supports random deletion? + bool up; // false This type of field is a reference + bool isnew; // false If set, skip this relation in amc_vis + bool hasalloc; // false Generte Alloc/Delete functions for arg type + bool inst; // false Field creates an instance of arg type (directly or indirectly) + bool varlen; // false This pool supports varlen allocations // func:amc_vis.FReftype..AssignOp amc_vis::FReftype& operator =(const amc_vis::FReftype &rhs) = delete; // func:amc_vis.FReftype..CopyCtor @@ -514,189 +711,5 @@ private: }; ``` -#### amc_vis.Linkkey - Correspodns to a ctype - - -#### amc_vis.Linkkey Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|amc_vis.Linkkey.n_link_in|u32|[Val](/txt/exe/amc/reftypes.md#val)||Number of incoming dependencies| -|amc_vis.Linkkey.samecol|i32|[Val](/txt/exe/amc/reftypes.md#val)||Set on links that lead to the same col| -|amc_vis.Linkkey.colweight|i32|[Val](/txt/exe/amc/reftypes.md#val)||Smaller cols are scheduled first| -|amc_vis.Linkkey.topbot|i32|[Val](/txt/exe/amc/reftypes.md#val)||Set to -1 for bottoms and tops to schedule them sooner| - -#### Struct Linkkey - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) -``` -struct Linkkey { // amc_vis.Linkkey: Correspodns to a ctype - u32 n_link_in; // 0 Number of incoming dependencies - i32 samecol; // 0 Set on links that lead to the same col - i32 colweight; // 0 Smaller cols are scheduled first - i32 topbot; // 0 Set to -1 for bottoms and tops to schedule them sooner - // func:amc_vis.Linkkey..EqOp - inline bool operator ==(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..NeOp - inline bool operator !=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..LtOp - inline bool operator <(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..GtOp - inline bool operator >(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..LeOp - inline bool operator <=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..GeOp - inline bool operator >=(const amc_vis::Linkkey &rhs) const __attribute__((nothrow)); - // func:amc_vis.Linkkey..Ctor - inline Linkkey() __attribute__((nothrow)); - // func:amc_vis.Linkkey..FieldwiseCtor - explicit inline Linkkey(u32 in_n_link_in, i32 in_samecol, i32 in_colweight, i32 in_topbot) __attribute__((nothrow)); -}; -``` - -#### amc_vis.Link - Correspodns to a ctype - - -#### amc_vis.Link Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|amc_vis.Link.link|[algo.Smallstr100](/txt/protocol/algo/README.md#algo-smallstr100)|[Val](/txt/exe/amc/reftypes.md#val)||Primary key| -|amc_vis.Link.label1|[algo.Smallstr100](/txt/protocol/algo/README.md#algo-smallstr100)|[Val](/txt/exe/amc/reftypes.md#val)||Label in column 1| -|amc_vis.Link.label2|[algo.Smallstr100](/txt/protocol/algo/README.md#algo-smallstr100)|[Val](/txt/exe/amc/reftypes.md#val)||Label in column 2| -|amc_vis.Link.linkkey|[amc_vis.Linkkey](/txt/exe/amc_vis/internals.md#amc_vis-linkkey)|[Val](/txt/exe/amc/reftypes.md#val)||| -|amc_vis.Link.outrow|i32|[Val](/txt/exe/amc/reftypes.md#val)||Outrow #| -|amc_vis.Link.p_node1|[amc_vis.FNode](/txt/exe/amc_vis/internals.md#amc_vis-fnode)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| -|amc_vis.Link.p_node2|[amc_vis.FNode](/txt/exe/amc_vis/internals.md#amc_vis-fnode)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| -|amc_vis.Link.upptr|bool|[Val](/txt/exe/amc/reftypes.md#val)||Up-arrow (not a constraint)| -|amc_vis.Link.zd_linkdep_out|[amc_vis.Linkdep](/txt/exe/amc_vis/internals.md#amc_vis-linkdep)|[Llist](/txt/exe/amc/reftypes.md#llist)||Arrow from this ctype| -|amc_vis.Link.zd_linkdep_in|[amc_vis.Linkdep](/txt/exe/amc_vis/internals.md#amc_vis-linkdep)|[Llist](/txt/exe/amc/reftypes.md#llist)||Arrows to this ctype| - -#### Struct Link - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) -``` -struct Link { // amc_vis.Link: Correspodns to a ctype - amc_vis::Link* ind_link_next; // hash next - i32 bh_link_idx; // index in heap; -1 means not-in-heap - amc_vis::Link* zd_link_out_next; // zslist link; -1 means not-in-list - amc_vis::Link* zd_link_out_prev; // previous element - amc_vis::Link* zd_link_in_next; // zslist link; -1 means not-in-list - amc_vis::Link* zd_link_in_prev; // previous element - algo::Smallstr100 link; // Primary key - algo::Smallstr100 label1; // Label in column 1 - algo::Smallstr100 label2; // Label in column 2 - amc_vis::Linkkey linkkey; // - i32 outrow; // 0 Outrow # - amc_vis::FNode* p_node1; // reference to parent row - amc_vis::FNode* p_node2; // reference to parent row - bool upptr; // false Up-arrow (not a constraint) - amc_vis::Linkdep* zd_linkdep_out_head; // zero-terminated doubly linked list - amc_vis::Linkdep* zd_linkdep_out_tail; // pointer to last element - amc_vis::Linkdep* zd_linkdep_in_head; // zero-terminated doubly linked list - amc_vis::Linkdep* zd_linkdep_in_tail; // pointer to last element - bool _db_c_linklist_in_ary; // false membership flag - // reftype Llist of amc_vis.Link.zd_linkdep_out prohibits copy - // reftype Llist of amc_vis.Link.zd_linkdep_in prohibits copy - // func:amc_vis.Link..AssignOp - amc_vis::Link& operator =(const amc_vis::Link &rhs) = delete; - // reftype Llist of amc_vis.Link.zd_linkdep_out prohibits copy - // reftype Llist of amc_vis.Link.zd_linkdep_in prohibits copy - // func:amc_vis.Link..CopyCtor - Link(const amc_vis::Link &rhs) = delete; -private: - // func:amc_vis.Link..Ctor - inline Link() __attribute__((nothrow)); - // func:amc_vis.Link..Dtor - inline ~Link() __attribute__((nothrow)); - friend amc_vis::Link& link_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend amc_vis::Link* link_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void link_RemoveAll() __attribute__((nothrow)); - friend void link_RemoveLast() __attribute__((nothrow)); -}; -``` - -#### amc_vis.Linkdep - Corresponds to a field - - -#### amc_vis.Linkdep Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|amc_vis.Linkdep.row|[amc_vis.Outrow](/txt/exe/amc_vis/internals.md#amc_vis-outrow)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| -|amc_vis.Linkdep.rowid|i32|[Val](/txt/exe/amc/reftypes.md#val)||Id| -|amc_vis.Linkdep.up|bool|[Val](/txt/exe/amc/reftypes.md#val)||Points up| -|amc_vis.Linkdep.inst|bool|[Val](/txt/exe/amc/reftypes.md#val)||Instance (vs. index)| -|amc_vis.Linkdep.p_link_from|[amc_vis.Link](/txt/exe/amc_vis/internals.md#amc_vis-link)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Source ctype| -|amc_vis.Linkdep.p_link_to|[amc_vis.Link](/txt/exe/amc_vis/internals.md#amc_vis-link)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Target ctype| - -#### Struct Linkdep - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) -``` -struct Linkdep { // amc_vis.Linkdep: Corresponds to a field - amc_vis::Linkdep* zd_linkdep_out_next; // zslist link; -1 means not-in-list - amc_vis::Linkdep* zd_linkdep_out_prev; // previous element - amc_vis::Linkdep* zd_linkdep_in_next; // zslist link; -1 means not-in-list - amc_vis::Linkdep* zd_linkdep_in_prev; // previous element - i32 row; // 0 - i32 rowid; // 0 Id - bool up; // false Points up - bool inst; // false Instance (vs. index) - amc_vis::Link* p_link_from; // reference to parent row - amc_vis::Link* p_link_to; // reference to parent row - // func:amc_vis.Linkdep..AssignOp - inline amc_vis::Linkdep& operator =(const amc_vis::Linkdep &rhs) = delete; - // func:amc_vis.Linkdep..CopyCtor - inline Linkdep(const amc_vis::Linkdep &rhs) = delete; - // func:amc_vis.Linkdep..FieldwiseCtor - explicit inline Linkdep(i32 in_row, i32 in_rowid, bool in_up, bool in_inst, amc_vis::Link* in_p_link_from, amc_vis::Link* in_p_link_to) __attribute__((nothrow)); -private: - // func:amc_vis.Linkdep..Ctor - inline Linkdep() __attribute__((nothrow)); - // func:amc_vis.Linkdep..Dtor - inline ~Linkdep() __attribute__((nothrow)); - friend amc_vis::Linkdep& linkdep_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend amc_vis::Linkdep* linkdep_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void linkdep_RemoveAll() __attribute__((nothrow)); - friend void linkdep_RemoveLast() __attribute__((nothrow)); -}; -``` - -#### amc_vis.Outrow - One line of text - - -#### amc_vis.Outrow Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|amc_vis.Outrow.rowid|i32|[Val](/txt/exe/amc/reftypes.md#val)||Outrow pkey| -|amc_vis.Outrow.text|u8|[Tary](/txt/exe/amc/reftypes.md#tary)||text| - -#### Struct Outrow - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/amc_vis_gen.h](/include/gen/amc_vis_gen.h) -``` -struct Outrow { // amc_vis.Outrow: One line of text - i32 rowid; // 0 Outrow pkey - u8* text_elems; // pointer to elements - u32 text_n; // number of elements in array - u32 text_max; // max. capacity of array before realloc - // func:amc_vis.Outrow..AssignOp - amc_vis::Outrow& operator =(const amc_vis::Outrow &rhs) __attribute__((nothrow)); - // func:amc_vis.Outrow..CopyCtor - Outrow(const amc_vis::Outrow &rhs) __attribute__((nothrow)); -private: - // func:amc_vis.Outrow..Ctor - inline Outrow() __attribute__((nothrow)); - // func:amc_vis.Outrow..Dtor - inline ~Outrow() __attribute__((nothrow)); - friend amc_vis::Outrow& outrow_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend amc_vis::Outrow* outrow_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void outrow_RemoveAll() __attribute__((nothrow)); - friend void outrow_RemoveLast() __attribute__((nothrow)); -}; -``` - diff --git a/txt/exe/ams_cat/README.md b/txt/exe/ams_cat/README.md deleted file mode 100644 index d44b734e..00000000 --- a/txt/exe/ams_cat/README.md +++ /dev/null @@ -1,50 +0,0 @@ -## ams_cat - Algo Messaging System sample tool - - -### Table Of Contents - - -  •  [Syntax](#syntax)
-  •  [Options](#options)
-  •  [Inputs](#inputs)
-📄 [ams_cat - Internals](/txt/exe/ams_cat/internals.md)
- - - -### Syntax - - -``` -ams_cat: Algo Messaging System sample tool -Usage: ams_cat [options] - OPTION TYPE DFLT COMMENT - -in string "data" Input directory or filename, - for stdin - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative - -help Print help and exit; alias -h - -version Print version and exit - -signature Show signatures and exit; alias -sig - -``` - - - -### Options - - - -#### -in -- Input directory or filename, - for stdin - - - - -### Inputs - - -`ams_cat` takes the following tables on input: -|Ssimfile|Comment| -|---|---| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| - - - diff --git a/txt/exe/ams_cat/internals.md b/txt/exe/ams_cat/internals.md deleted file mode 100644 index 8f675deb..00000000 --- a/txt/exe/ams_cat/internals.md +++ /dev/null @@ -1,78 +0,0 @@ -## ams_cat - Internals - - -### Table Of Contents - - -* [Description](#description) -* [Sources](#sources) -* [Dependencies](#dependencies) -* [In Memory DB](#in-memory-db) - - - -### Description - - -for usage, see [ams_cat - Algo Messaging System sample tool](/txt/exe/ams_cat/README.md) - - - -### Sources - - -The source code license is GPL -The following source files are part of this tool: - -|Source File|Comment| -|---|---| -|[cpp/ams/ams_cat.cpp](/cpp/ams/ams_cat.cpp)|| -|[cpp/gen/ams_cat_gen.cpp](/cpp/gen/ams_cat_gen.cpp)|| -|[include/ams_cat.h](/include/ams_cat.h)|| -|[include/gen/ams_cat_gen.h](/include/gen/ams_cat_gen.h)|| -|[include/gen/ams_cat_gen.inl.h](/include/gen/ams_cat_gen.inl.h)|| - - - -### Dependencies - - -The build target depends on the following libraries -|Target|Comment| -|---|---| -|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| -|[lib_ams](/txt/lib/lib_ams/README.md)|Library for AMS middleware, supporting file format & messaging| - - - -### In Memory DB - - -`ams_cat` generated code creates the tables below. -All allocations are done through global `ams_cat::_db` [ams_cat.FDb](#ams_cat-fdb) structure -|Ctype|Ssimfile|Create|Access| -|---|---|---|---| -|[ams_cat.FDb](#ams_cat-fdb)||FDb._db (Global)| - -#### ams_cat.FDb - In-memory database for ams_cat - - -#### ams_cat.FDb Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|ams_cat.FDb._db|[ams_cat.FDb](/txt/exe/ams_cat/internals.md#ams_cat-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| -|ams_cat.FDb.cmdline|[command.ams_cat](/txt/protocol/command/README.md#command-ams_cat)|[Val](/txt/exe/amc/reftypes.md#val)||| - -#### Struct FDb - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/ams_cat_gen.h](/include/gen/ams_cat_gen.h) -``` -struct FDb { // ams_cat.FDb: In-memory database for ams_cat - command::ams_cat cmdline; // - ams_cat::trace trace; // -}; -``` - - - diff --git a/txt/exe/ams_sendtest/README.md b/txt/exe/ams_sendtest/README.md index 7bb0e6f9..42d1c062 100644 --- a/txt/exe/ams_sendtest/README.md +++ b/txt/exe/ams_sendtest/README.md @@ -32,8 +32,8 @@ Usage: ams_sendtest [options] -msgsize_max int 1024 Maximum message length -bufsize int 32768 Shared memory buffer size -recvdelay int 0 Pause nanoseconds between messages - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig diff --git a/txt/exe/ams_sendtest/internals.md b/txt/exe/ams_sendtest/internals.md index ffd84d0e..c2a97da3 100644 --- a/txt/exe/ams_sendtest/internals.md +++ b/txt/exe/ams_sendtest/internals.md @@ -64,6 +64,8 @@ All allocations are done through global `ams_sendtest::_db` [ams_sendtest.FDb](# |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| |ams_sendtest.AmsSendTest.n_msg_send|u64|[Val](/txt/exe/amc/reftypes.md#val)||Number of messages sent| +|ams_sendtest.AmsSendTest.off_send|u64|[Val](/txt/exe/amc/reftypes.md#val)||Offset sent| +|ams_sendtest.AmsSendTest.off_recv|u64|[Val](/txt/exe/amc/reftypes.md#val)||Offset received| |ams_sendtest.AmsSendTest.n_msg_recv|u64|[Val](/txt/exe/amc/reftypes.md#val)||Number of messages received| |ams_sendtest.AmsSendTest.n_write_wait|u64|[Val](/txt/exe/amc/reftypes.md#val)||Number of waits by parent| |ams_sendtest.AmsSendTest.n_msg_limit|u64|[Val](/txt/exe/amc/reftypes.md#val)|1000000|Limit of messages to send| @@ -76,6 +78,8 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/ams_sendtest_gen.h] ``` struct AmsSendTest { // ams_sendtest.AmsSendTest u64 n_msg_send; // 0 Number of messages sent + u64 off_send; // 0 Offset sent + u64 off_recv; // 0 Offset received u64 n_msg_recv; // 0 Number of messages received u64 n_write_wait; // 0 Number of waits by parent u64 n_msg_limit; // 1000000 Limit of messages to send @@ -129,7 +133,7 @@ private: |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|ams_sendtest.FDb.c_out|[lib_ams.FStream](/txt/lib/lib_ams/README.md#lib_ams-fstream)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Output goes here| +|ams_sendtest.FDb.c_out|[lib_ams.FShm](/txt/lib/lib_ams/README.md#lib_ams-fshm)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Output goes here| |ams_sendtest.FDb._db|[ams_sendtest.FDb](/txt/exe/ams_sendtest/internals.md#ams_sendtest-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| |ams_sendtest.FDb.cmdline|[command.ams_sendtest](/txt/protocol/command/README.md#command-ams_sendtest)|[Val](/txt/exe/amc/reftypes.md#val)||| |ams_sendtest.FDb.ams_send_test|[ams_sendtest.AmsSendTest](/txt/exe/ams_sendtest/internals.md#ams_sendtest-amssendtest)|[Val](/txt/exe/amc/reftypes.md#val)||| @@ -140,7 +144,7 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/ams_sendtest_gen.h](/include/gen/ams_sendtest_gen.h) ``` struct FDb { // ams_sendtest.FDb: In-memory database for ams_sendtest - lib_ams::FStream* c_out; // Output goes here. optional pointer + lib_ams::FShm* c_out; // Output goes here. optional pointer command::ams_sendtest cmdline; // ams_sendtest::AmsSendTest ams_send_test; // ams_sendtest::FChild* child_lary[32]; // level array diff --git a/txt/exe/apm/README.md b/txt/exe/apm/README.md index 1e251ce2..4c245ee1 100644 --- a/txt/exe/apm/README.md +++ b/txt/exe/apm/README.md @@ -41,7 +41,6 @@ in the package repo corresponding to the last synchronization point.   •  [Sandboxes](#sandboxes)
  •  [Options](#options)
  •  [Inputs](#inputs)
-  •  [Sources](#sources)
📄 [apm - Internals](/txt/exe/apm/internals.md)
@@ -79,8 +78,8 @@ Usage: apm [[-package:]] [options] -data_in string "data" Dataset from which package records are loaded -e Open selected records in editor -binpath string "bin" (internal use) - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -415,47 +414,28 @@ simply use the `gitfile` table. `apm` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| +|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| +|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| -|[dmmeta.ssimreq](/txt/ssimdb/dmmeta/ssimreq.md)|Extended constraints for ssim records| -|[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| |[dmmeta.ftuple](/txt/ssimdb/dmmeta/ftuple.md)|| -|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| -|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| -|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| |[dev.unstablefld](/txt/ssimdb/dev/unstablefld.md)|Fields that should be stripped from component test output because they contain timestamps etc.| +|[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| +|[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| +|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| |[dev.package](/txt/ssimdb/dev/package.md)|OpenACR package| -|[dev.pkgkey](/txt/ssimdb/dev/pkgkey.md)|Keys belonging to the OpenACR package| |[dev.pkgdep](/txt/ssimdb/dev/pkgdep.md)|OpenACR Package dependency| -|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dev.pkgkey](/txt/ssimdb/dev/pkgkey.md)|Keys belonging to the OpenACR package| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.ssimreq](/txt/ssimdb/dmmeta/ssimreq.md)|Extended constraints for ssim records| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -### Sources - -The source code license is GPL -The following source files are part of this tool: - -|Source File|Comment| -|---|---| -|[cpp/apm/annotate.cpp](/cpp/apm/annotate.cpp)|| -|[cpp/apm/check.cpp](/cpp/apm/check.cpp)|| -|[cpp/apm/diff.cpp](/cpp/apm/diff.cpp)|| -|[cpp/apm/install.cpp](/cpp/apm/install.cpp)|| -|[cpp/apm/main.cpp](/cpp/apm/main.cpp)|| -|[cpp/apm/push.cpp](/cpp/apm/push.cpp)|| -|[cpp/apm/rec.cpp](/cpp/apm/rec.cpp)|| -|[cpp/apm/remove.cpp](/cpp/apm/remove.cpp)|| -|[cpp/apm/reset.cpp](/cpp/apm/reset.cpp)|| -|[cpp/apm/show.cpp](/cpp/apm/show.cpp)|| -|[cpp/apm/update.cpp](/cpp/apm/update.cpp)|| -|[cpp/gen/apm_gen.cpp](/cpp/gen/apm_gen.cpp)|| -|[include/apm.h](/include/apm.h)|| -|[include/gen/apm_gen.h](/include/gen/apm_gen.h)|| -|[include/gen/apm_gen.inl.h](/include/gen/apm_gen.inl.h)|| - diff --git a/txt/exe/apm/internals.md b/txt/exe/apm/internals.md index 794a78e7..4fdbf061 100644 --- a/txt/exe/apm/internals.md +++ b/txt/exe/apm/internals.md @@ -1,6 +1,23 @@ ## apm - Internals +### Table Of Contents + + +* [Description](#description) +* [Sources](#sources) +* [Dependencies](#dependencies) +* [In Memory DB](#in-memory-db) + + + +### Description + + +for usage, see [apm - Algo Package Manager](/txt/exe/apm/README.md) + + + ### Sources @@ -106,16 +123,17 @@ All allocations are done through global `apm::_db` [apm.FDb](#apm-fdb) structure Generated by [amc](/txt/exe/amc/README.md) into [include/gen/apm_gen.h](/include/gen/apm_gen.h) ``` struct FCtype { // apm.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - apm::FSsimfile* c_ssimfile; // optional pointer - apm::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - apm::FSsimreq** c_ssimreq_elems; // array of pointers - u32 c_ssimreq_n; // array of pointers - u32 c_ssimreq_max; // capacity of allocated array - apm::FCtype* ind_ctype_next; // hash next + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + apm::FSsimfile* c_ssimfile; // optional pointer + apm::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + apm::FSsimreq** c_ssimreq_elems; // array of pointers + u32 c_ssimreq_n; // array of pointers + u32 c_ssimreq_max; // capacity of allocated array + apm::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // x-reference on apm.FCtype.c_ssimfile prevents copy // reftype Ptrary of apm.FCtype.c_field prohibits copy // reftype Ptrary of apm.FCtype.c_ssimreq prohibits copy @@ -287,6 +305,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/apm_gen.h](/include ``` struct FField { // apm.FField apm::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -338,14 +357,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/apm_gen.h](/include/gen/apm_gen.h) ``` struct FMergefile { // apm.FMergefile - apm::FMergefile* ind_mergefile_next; // hash next - algo::cstring mergefile; // - algo::cstring base_file; // - i32 base_mode; // 0 - algo::cstring ours_file; // - i32 ours_mode; // 0 - algo::cstring theirs_file; // - i32 theirs_mode; // 0 + apm::FMergefile* ind_mergefile_next; // hash next + u32 ind_mergefile_hashval; // hash value + algo::cstring mergefile; // + algo::cstring base_file; // + i32 base_mode; // 0 + algo::cstring ours_file; // + i32 ours_mode; // 0 + algo::cstring theirs_file; // + i32 theirs_mode; // 0 // func:apm.FMergefile..AssignOp inline apm::FMergefile& operator =(const apm::FMergefile &rhs) = delete; // func:apm.FMergefile..CopyCtor @@ -376,8 +396,9 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/apm_gen.h](/include/gen/apm_gen.h) ``` struct FMkdir { // apm.FMkdir - apm::FMkdir* ind_mkdir_next; // hash next - algo::cstring mkdir; // + apm::FMkdir* ind_mkdir_next; // hash next + u32 ind_mkdir_hashval; // hash value + algo::cstring mkdir; // // func:apm.FMkdir..AssignOp inline apm::FMkdir& operator =(const apm::FMkdir &rhs) = delete; // func:apm.FMkdir..CopyCtor @@ -448,6 +469,7 @@ struct FPackage { // apm.FPackage apm::FPackage* zd_sel_package_next; // zslist link; -1 means not-in-list apm::FPackage* zd_sel_package_prev; // previous element apm::FPackage* ind_package_next; // hash next + u32 ind_package_hashval; // hash value apm::FPackage* zd_topo_package_next; // zslist link; -1 means not-in-list apm::FPackage* zd_topo_package_prev; // previous element algo::Smallstr50 package; // Package name @@ -553,14 +575,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/apm_gen.h](/include/gen/apm_gen.h) ``` struct FPkgkey { // apm.FPkgkey - apm::FPkgkey* ind_pkgkey_next; // hash next - apm::FPkgkey* zd_pkgkey_next; // zslist link; -1 means not-in-list - apm::FPkgkey* zd_pkgkey_prev; // previous element - algo::Smallstr150 pkgkey; // - algo::Comment comment; // - apm::FPkgrec** c_pkgrec_elems; // array of pointers - u32 c_pkgrec_n; // array of pointers - u32 c_pkgrec_max; // capacity of allocated array + apm::FPkgkey* ind_pkgkey_next; // hash next + u32 ind_pkgkey_hashval; // hash value + apm::FPkgkey* package_zd_pkgkey_next; // zslist link; -1 means not-in-list + apm::FPkgkey* package_zd_pkgkey_prev; // previous element + algo::Smallstr150 pkgkey; // + algo::Comment comment; // + apm::FPkgrec** c_pkgrec_elems; // array of pointers + u32 c_pkgrec_n; // array of pointers + u32 c_pkgrec_max; // capacity of allocated array // reftype Ptrary of apm.FPkgkey.c_pkgrec prohibits copy // func:apm.FPkgkey..AssignOp inline apm::FPkgkey& operator =(const apm::FPkgkey &rhs) = delete; @@ -596,14 +619,14 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/apm_gen.h](/include ``` struct FPkgrec { // apm.FPkgrec apm::FPkgrec* pkgrec_next; // Pointer to next free element int tpool - apm::FPkgrec* zd_pkgrec_next; // zslist link; -1 means not-in-list - apm::FPkgrec* zd_pkgrec_prev; // previous element + apm::FPkgrec* package_zd_pkgrec_next; // zslist link; -1 means not-in-list + apm::FPkgrec* package_zd_pkgrec_prev; // previous element apm::FPackage* p_package; // reference to parent row apm::FRec* p_rec; // reference to parent row apm::FPkgkey* p_pkgkey; // reference to parent row bool pkgkey_c_pkgrec_in_ary; // false membership flag - apm::FPkgrec* zd_rec_pkgrec_next; // zslist link; -1 means not-in-list - apm::FPkgrec* zd_rec_pkgrec_prev; // previous element + apm::FPkgrec* rec_zd_rec_pkgrec_next; // zslist link; -1 means not-in-list + apm::FPkgrec* rec_zd_rec_pkgrec_prev; // previous element // func:apm.FPkgrec..AssignOp inline apm::FPkgrec& operator =(const apm::FPkgrec &rhs) = delete; // func:apm.FPkgrec..CopyCtor @@ -638,26 +661,27 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/apm_gen.h](/include/gen/apm_gen.h) ``` struct FRec { // apm.FRec - apm::FRec* rec_next; // Pointer to next free element int tpool - apm::FRec* ind_rec_next; // hash next - apm::FRec* zd_rec_next; // zslist link; -1 means not-in-list - apm::FRec* zd_rec_prev; // previous element - apm::FRec* zd_selrec_next; // zslist link; -1 means not-in-list - apm::FRec* zd_selrec_prev; // previous element - apm::FRec* zd_chooserec_next; // zslist link; -1 means not-in-list - apm::FRec* zd_chooserec_prev; // previous element - algo::cstring rec; // Primary key: ssimfile:pkey - apm::FSsimfile* p_ssimfile; // reference to parent row - algo::Tuple tuple; // Original record from file - apm::FRec** c_child_elems; // array of pointers - u32 c_child_n; // array of pointers - u32 c_child_max; // capacity of allocated array - i32 level; // 0 - apm::FPkgrec* zd_rec_pkgrec_head; // zero-terminated doubly linked list - i32 zd_rec_pkgrec_n; // zero-terminated doubly linked list - apm::FPkgrec* zd_rec_pkgrec_tail; // pointer to last element - apm::FRec* zd_ssimfile_rec_next; // zslist link; -1 means not-in-list - apm::FRec* zd_ssimfile_rec_prev; // previous element + apm::FRec* rec_next; // Pointer to next free element int tpool + apm::FRec* ind_rec_next; // hash next + u32 ind_rec_hashval; // hash value + apm::FRec* zd_rec_next; // zslist link; -1 means not-in-list + apm::FRec* zd_rec_prev; // previous element + apm::FRec* zd_selrec_next; // zslist link; -1 means not-in-list + apm::FRec* zd_selrec_prev; // previous element + apm::FRec* zd_chooserec_next; // zslist link; -1 means not-in-list + apm::FRec* zd_chooserec_prev; // previous element + algo::cstring rec; // Primary key: ssimfile:pkey + apm::FSsimfile* p_ssimfile; // reference to parent row + algo::Tuple tuple; // Original record from file + apm::FRec** c_child_elems; // array of pointers + u32 c_child_n; // array of pointers + u32 c_child_max; // capacity of allocated array + i32 level; // 0 + apm::FPkgrec* zd_rec_pkgrec_head; // zero-terminated doubly linked list + i32 zd_rec_pkgrec_n; // zero-terminated doubly linked list + apm::FPkgrec* zd_rec_pkgrec_tail; // pointer to last element + apm::FRec* ssimfile_zd_ssimfile_rec_next; // zslist link; -1 means not-in-list + apm::FRec* ssimfile_zd_ssimfile_rec_prev; // previous element // reftype Ptrary of apm.FRec.c_child prohibits copy // reftype Llist of apm.FRec.zd_rec_pkgrec prohibits copy // func:apm.FRec..AssignOp @@ -696,6 +720,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/apm_gen.h](/include ``` struct FSsimfile { // apm.FSsimfile apm::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value algo::Smallstr50 ssimfile; // algo::Smallstr100 ctype; // apm::FCtype* p_ctype; // reference to parent row diff --git a/txt/exe/aqlite/README.md b/txt/exe/aqlite/README.md index c6836d03..84159cc6 100644 --- a/txt/exe/aqlite/README.md +++ b/txt/exe/aqlite/README.md @@ -19,15 +19,16 @@ ``` aqlite: Runs sqlite queries against ssim files Usage: aqlite [-cmd:] [options] - OPTION TYPE DFLT COMMENT - -in string "data" Input directory or filename, - for stdin - -schema string "data" Schema dir - [cmd] string Sql Query to run - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative - -help Print help and exit; alias -h - -version Print version and exit - -signature Show signatures and exit; alias -sig + OPTION TYPE DFLT COMMENT + -in string "data" Input directory or filename, - for stdin + -schema string "data" Schema dir + [cmd] string Sql Query to run + -ns regx "dmmeta" Regx of databases to attach + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative + -help Print help and exit; alias -h + -version Print version and exit + -signature Show signatures and exit; alias -sig ``` @@ -46,6 +47,9 @@ Usage: aqlite [-cmd:] [options] #### -cmd -- Sql Query to run +#### -ns -- Regx of databases to attach + + ### Inputs @@ -54,13 +58,13 @@ Usage: aqlite [-cmd:] [options] `aqlite` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| |[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| diff --git a/txt/exe/atf_amc/README.md b/txt/exe/atf_amc/README.md index 37cb6e1e..fed90fb8 100644 --- a/txt/exe/atf_amc/README.md +++ b/txt/exe/atf_amc/README.md @@ -7,6 +7,7 @@   •  [Syntax](#syntax)
  •  [Options](#options)
  •  [Inputs](#inputs)
+  •  [Input Messages](#input-messages)
📄 [atf_amc - Internals](/txt/exe/atf_amc/internals.md)
@@ -22,8 +23,8 @@ Usage: atf_amc [[-amctest:]] [options] [amctest] regx "%" SQL regex, selecting test to run -dofork Y Use fork -q Quiet mode - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -60,3 +61,25 @@ Usage: atf_amc [[-amctest:]] [options] +### Input Messages + + +`atf_amc` Consumes the following messages via atf_amc.Disp () +|Message|Comment| +|---|---| +|[atf_amc.DispType1](/txt/exe/atf_amc/internals.md#atf_amc-disptype1)|Dispfilter test 1| +|[atf_amc.DispType2](/txt/exe/atf_amc/internals.md#atf_amc-disptype2)|Dispfilter test 2| +|[atf_amc.DispType3](/txt/exe/atf_amc/internals.md#atf_amc-disptype3)|Dispfilter test 3| + +`atf_amc` Consumes the following messages via atf_amc.Msgs () +|Message|Comment| +|---|---| +|[atf_amc.VarlenK](/txt/exe/atf_amc/internals.md#atf_amc-varlenk)|An optional instance of atf_unit.A| + +`atf_amc` Consumes the following messages via atf_amc.Ssimfiles () +|Message|Comment| +|---|---| +|[dmmeta.Ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| + + + diff --git a/txt/exe/atf_amc/internals.md b/txt/exe/atf_amc/internals.md index c7f487ae..270d9be1 100644 --- a/txt/exe/atf_amc/internals.md +++ b/txt/exe/atf_amc/internals.md @@ -122,10 +122,12 @@ All allocations are done through global `atf_amc::_db` [atf_amc.FDb](#atf_amc-fd |[atf_amc.FListtype](#atf_amc-flisttype)|[dmmeta.listtype](/txt/ssimdb/dmmeta/listtype.md)|FDb.listtype (Inlary)|**static**| ||||FListtype.step (Hook)| |[atf_amc.FDb](#atf_amc-fdb)||FDb._db (Global)| +|[atf_amc.FHashableLinear](#atf_amc-fhashablelinear)||FDb.hashable_linear (Tpool)|ind_linear (Thash, hash field key)| |[atf_amc.TypeG](#atf_amc-typeg)||OptAlloc.typeg (Opt)|OptG.typeg (Opt)|FOptG.typeg (Opt)| |[atf_amc.FOptG](#atf_amc-foptg)||FDb.optg (Lpool)| |[atf_amc.FPerfSortString](#atf_amc-fperfsortstring)|| |[atf_amc.FThashElem](#atf_amc-fthashelem)||FDb.thash_elem (Lary)|ind_thash_elem (Thash, hash field key)|thash_elem (Lary, by rowid)| +|[atf_amc.FTimeEntry](#atf_amc-ftimeentry)||FDb.time_entry (Tpool)|bh_time_entry (Bheap, sort field time)| |[atf_amc.FTypeC](#atf_amc-ftypec)||FTypeA.typec (Inlary)|bh_typec (Bheap, sort field typec)|zdl_h_typec (Llist)|zd_t_typec (Llist)|zsl_h_typec (Llist)|zs_t_typec (Llist)|zs_mt_typec (ZSListMT)|zdl_hnt_typec (Llist)|cdl_h_typec (Llist)|cd_t_typec (Llist)|csl_h_typec (Llist)|cs_t_typec (Llist)| |[atf_amc.FTypeA](#atf_amc-ftypea)||FDb.typea (Lary)|typea (Lary, by rowid)|ind_typea (Thash, hash field typea)| |[atf_amc.FTypeB](#atf_amc-ftypeb)||FDb.typeb (Tpool)| @@ -133,6 +135,8 @@ All allocations are done through global `atf_amc::_db` [atf_amc.FDb](#atf_amc-fd ||||FTypeA.bh_typeb (Bheap)| |[atf_amc.FTypeD](#atf_amc-ftyped)||FDb.typed (Tpool)|zd_typed (Llist)|zs_t_typed (Llist)|cd_typed (Llist)| |[atf_amc.FTypeK](#atf_amc-ftypek)||c_typek (Ptrary)| +|[atf_amc.FTypeL](#atf_amc-ftypel)||c_typel (Ptrary)| +|[atf_amc.FTypeM](#atf_amc-ftypem)||c_typem (Ptrary)| |[atf_amc.FTypeS](#atf_amc-ftypes)||FDb.types (Lary)|types (Lary, by rowid)|ind_types (Thash, hash field types)| |[atf_amc.FTypeT](#atf_amc-ftypet)||FDb.typet (Lary)|typet (Lary, by rowid)| ||||FTypeS.zdl_typet (Llist)| @@ -140,6 +144,7 @@ All allocations are done through global `atf_amc::_db` [atf_amc.FDb](#atf_amc-fd ||||FTypeA.msghdr (Base)| ||||FUnitSort.c_ptrary (Ptrary)| |[atf_amc.FUnitSort](#atf_amc-funitsort)|| +|[atf_amc.Hashable](#atf_amc-hashable)||FDb.hashable (Tpool)|ind_hashable (Thash, hash field key)| |[atf_amc.Hooktype](#atf_amc-hooktype)|| ||||Hooktype.callback (Hook)| |[atf_amc.InlaryPrint](#atf_amc-inlaryprint)|| @@ -153,9 +158,13 @@ All allocations are done through global `atf_amc::_db` [atf_amc.FDb](#atf_amc-fd ||||MsgHdrLT_curs.msg (Ptr)| |[atf_amc.MsgType](#atf_amc-msgtype)|| |[atf_amc.MsgLength](#atf_amc-msglength)|| -|[atf_amc.MsgHeader](#atf_amc-msgheader)||Msgbuf.in_buf (Fbuf)|Seqmsg.payload (Opt)| +|[atf_amc.MsgHeader](#atf_amc-msgheader)||Msgbuf.in_buf (Fbuf)|Seqmsg.payload (Opt)|Varlen2mMsg.m1 (Varlen)|Varlen2mMsg.m2 (Varlen)|Varlen2mMsg.m3 (Varlen)| ||||Seqmsg.msghdr (Base)| ||||Text.msghdr (Base)| +||||Varlen2Msg.base (Base)| +||||Varlen2aMsg.base (Base)| +||||Varlen2mMsg.base (Base)| +||||Varlen2vMsg.base (Base)| ||||VarlenMsg.base (Base)| ||||MsgHeader_curs.msg (Ptr)| |[atf_amc.MsgLTA](#atf_amc-msglta)|| @@ -181,6 +190,7 @@ All allocations are done through global `atf_amc::_db` [atf_amc.FDb](#atf_amc-fd |[atf_amc.Sep1](#atf_amc-sep1)|| |[atf_amc.Seqmsg](#atf_amc-seqmsg)|| |[atf_amc.SortedStr](#atf_amc-sortedstr)|| +|[atf_amc.Strkey](#atf_amc-strkey)||FDb.strkey (Tpool)|ind_strkey (Thash, hash field strkey)| |[atf_amc.TaryU32](#atf_amc-taryu32)|| |[atf_amc.TaryU8](#atf_amc-taryu8)|| |[atf_amc.TestRegx1](#atf_amc-testregx1)|| @@ -204,14 +214,18 @@ All allocations are done through global `atf_amc::_db` [atf_amc.FDb](#atf_amc-fd ||||FTypeT.msghdr (Base)| |[atf_amc.TypeTVal](#atf_amc-typetval)|| |[atf_amc.Typefconst](#atf_amc-typefconst)|| +|[atf_amc.Varlen2Msg](#atf_amc-varlen2msg)|| +|[atf_amc.Varlen2aMsg](#atf_amc-varlen2amsg)|| +|[atf_amc.Varlen2mMsg](#atf_amc-varlen2mmsg)|| +|[atf_amc.VarlenK](#atf_amc-varlenk)||Varlen2vMsg.v1 (Varlen)|Varlen2vMsg.v2 (Varlen)|Varlen2vMsg.v3 (Varlen)|VarlenMsg.k (Varlen)| +||||VarlenK_curs.msg (Ptr)| +|[atf_amc.Varlen2vMsg](#atf_amc-varlen2vmsg)|| |[atf_amc.VarlenAlloc](#atf_amc-varlenalloc)||FDb.varlenalloc (Lpool)| ||||VarlenAlloc_curs.msg (Ptr)| |[atf_amc.VarlenExtern](#atf_amc-varlenextern)||FDb.varlen_extern (Lpool)| ||||VarlenExtern_curs.msg (Ptr)| |[atf_amc.VarlenH](#atf_amc-varlenh)|| ||||VarlenH_curs.msg (Ptr)| -|[atf_amc.VarlenK](#atf_amc-varlenk)||VarlenMsg.k (Varlen)| -||||VarlenK_curs.msg (Ptr)| |[atf_amc.VarlenMsg](#atf_amc-varlenmsg)|| #### atf_amc.AmcCleanup2 - @@ -390,17 +404,19 @@ struct Bitset { // atf_amc.Bitset: Test bitset Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) ``` struct Bytebuf { // atf_amc.Bytebuf - u8 in_elems[64]; // pointer to elements of inline array + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array i32 in_start; // beginning of valid bytes (in bytes) i32 in_end; // end of valid bytes (in bytes) - bool in_eof; // no more data will be written to buffer + i32 in_msglen; // current message length algo::Errcode in_err; // system error code + bool in_eof; // no more data will be written to buffer bool in_msgvalid; // current message is valid - i32 in_msglen; // current message length bool in_epoll_enable; // use epoll? - enum { in_max = 64 }; // func:atf_amc.Bytebuf..Ctor inline Bytebuf() __attribute__((nothrow)); + // func:atf_amc.Bytebuf..Dtor + inline ~Bytebuf() __attribute__((nothrow)); }; ``` @@ -422,10 +438,10 @@ struct BytebufDyn { // atf_amc.BytebufDyn u32 in_max; // 0 current length of allocated array i32 in_start; // beginning of valid bytes (in bytes) i32 in_end; // end of valid bytes (in bytes) - bool in_eof; // no more data will be written to buffer + i32 in_msglen; // current message length algo::Errcode in_err; // system error code + bool in_eof; // no more data will be written to buffer bool in_msgvalid; // current message is valid - i32 in_msglen; // current message length bool in_epoll_enable; // use epoll? // func:atf_amc.BytebufDyn..Ctor inline BytebufDyn() __attribute__((nothrow)); @@ -767,34 +783,35 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) ``` struct FCascdel { // atf_amc.FCascdel: Test type for cascade delete - atf_amc::FCascdel* p_parent; // reference to parent row - u32 key; // 0 - u32 type; // 0 - atf_amc::FCascdel* child_ptr; // optional pointer - atf_amc::FCascdel** c_child_ptrary_elems; // array of pointers - u32 c_child_ptrary_n; // array of pointers - u32 c_child_ptrary_max; // capacity of allocated array - atf_amc::FCascdel** ind_child_thash_buckets_elems; // pointer to bucket array - i32 ind_child_thash_buckets_n; // number of elements in bucket array - i32 ind_child_thash_n; // number of elements in the hash table - atf_amc::FCascdel* ind_child_thash_next; // hash next - atf_amc::FCascdel** bh_child_bheap_elems; // binary heap by key - i32 bh_child_bheap_n; // number of elements in the heap - i32 bh_child_bheap_max; // max elements in bh_child_bheap_elems - i32 bh_child_bheap_idx; // index in heap; -1 means not-in-heap - atf_amc::FCascdel* zd_childlist_head; // zero-terminated doubly linked list - i32 zd_childlist_n; // zero-terminated doubly linked list - atf_amc::FCascdel* zd_childlist_tail; // pointer to last element - atf_amc::FCascdel* zd_childlist_next; // zslist link; -1 means not-in-list - atf_amc::FCascdel* zd_childlist_prev; // previous element - atf_amc::FCascdel* tr_child_atree_root; // Root of the tree - i32 tr_child_atree_n; // number of elements in the tree - atf_amc::FCascdel* tr_child_atree_up; // pointer to parent - atf_amc::FCascdel* tr_child_atree_left; // Left child - atf_amc::FCascdel* tr_child_atree_right; // Right child - i32 tr_child_atree_depth; // Depth - bool cascdel_c_child_ptrary_in_ary; // false membership flag - atf_amc::FCascdel* cascdel_next; // Pointer to next free element int tpool + atf_amc::FCascdel* p_parent; // reference to parent row + u32 key; // 0 + u32 type; // 0 + atf_amc::FCascdel* child_ptr; // optional pointer + atf_amc::FCascdel** c_child_ptrary_elems; // array of pointers + u32 c_child_ptrary_n; // array of pointers + u32 c_child_ptrary_max; // capacity of allocated array + atf_amc::FCascdel** ind_child_thash_buckets_elems; // pointer to bucket array + i32 ind_child_thash_buckets_n; // number of elements in bucket array + i32 ind_child_thash_n; // number of elements in the hash table + atf_amc::FCascdel* cascdel_ind_child_thash_next; // hash next + u32 cascdel_ind_child_thash_hashval; // hash value + atf_amc::FCascdel** bh_child_bheap_elems; // binary heap by key + i32 bh_child_bheap_n; // number of elements in the heap + i32 bh_child_bheap_max; // max elements in bh_child_bheap_elems + i32 cascdel_bh_child_bheap_idx; // index in heap; -1 means not-in-heap + atf_amc::FCascdel* zd_childlist_head; // zero-terminated doubly linked list + i32 zd_childlist_n; // zero-terminated doubly linked list + atf_amc::FCascdel* zd_childlist_tail; // pointer to last element + atf_amc::FCascdel* cascdel_zd_childlist_next; // zslist link; -1 means not-in-list + atf_amc::FCascdel* cascdel_zd_childlist_prev; // previous element + atf_amc::FCascdel* tr_child_atree_root; // Root of the tree + i32 tr_child_atree_n; // number of elements in the tree + atf_amc::FCascdel* cascdel_tr_child_atree_up; // pointer to parent + atf_amc::FCascdel* cascdel_tr_child_atree_left; // Left child + atf_amc::FCascdel* cascdel_tr_child_atree_right; // Right child + i32 cascdel_tr_child_atree_depth; // Depth + bool cascdel_c_child_ptrary_in_ary; // false membership flag + atf_amc::FCascdel* cascdel_next; // Pointer to next free element int tpool // x-reference on atf_amc.FCascdel.child_ptr prevents copy // reftype Ptrary of atf_amc.FCascdel.c_child_ptrary prohibits copy // reftype Thash of atf_amc.FCascdel.ind_child_thash prohibits copy @@ -841,8 +858,9 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) ``` struct FCstring { // atf_amc.FCstring - algo::cstring str; // - atf_amc::FCstring* ind_cstring_next; // hash next + algo::cstring str; // + atf_amc::FCstring* ind_cstring_next; // hash next + u32 ind_cstring_hashval; // hash value // func:atf_amc.FCstring..AssignOp inline atf_amc::FCstring& operator =(const atf_amc::FCstring &rhs) = delete; // func:atf_amc.FCstring..CopyCtor @@ -940,6 +958,8 @@ struct FListtype { // atf_amc.FListtype |atf_amc.FDb.varlenalloc|[atf_amc.VarlenAlloc](/txt/exe/atf_amc/internals.md#atf_amc-varlenalloc)|[Lpool](/txt/exe/amc/reftypes.md#lpool)||| |atf_amc.FDb.optg|[atf_amc.FOptG](/txt/exe/atf_amc/internals.md#atf_amc-foptg)|[Lpool](/txt/exe/amc/reftypes.md#lpool)||| |atf_amc.FDb.c_typek|[atf_amc.FTypeK](/txt/exe/atf_amc/internals.md#atf_amc-ftypek)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| +|atf_amc.FDb.c_typel|[atf_amc.FTypeL](/txt/exe/atf_amc/internals.md#atf_amc-ftypel)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| +|atf_amc.FDb.c_typem|[atf_amc.FTypeM](/txt/exe/atf_amc/internals.md#atf_amc-ftypem)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| |atf_amc.FDb.avl|[atf_amc.FAvl](/txt/exe/atf_amc/internals.md#atf_amc-favl)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |atf_amc.FDb.tr_avl|[atf_amc.FAvl](/txt/exe/atf_amc/internals.md#atf_amc-favl)|[Atree](/txt/exe/amc/reftypes.md#atree)||| |atf_amc.FDb.listtype|[atf_amc.FListtype](/txt/exe/atf_amc/internals.md#atf_amc-flisttype)|[Inlary](/txt/exe/amc/reftypes.md#inlary)||| @@ -948,112 +968,184 @@ struct FListtype { // atf_amc.FListtype |atf_amc.FDb.bytebuf_dyn|[atf_amc.BytebufDyn](/txt/exe/atf_amc/internals.md#atf_amc-bytebufdyn)|[Cppstack](/txt/exe/amc/reftypes.md#cppstack)||Provides default name for variables of this type| |atf_amc.FDb.ind_thash_elem|[atf_amc.FThashElem](/txt/exe/atf_amc/internals.md#atf_amc-fthashelem)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |atf_amc.FDb.thash_elem|[atf_amc.FThashElem](/txt/exe/atf_amc/internals.md#atf_amc-fthashelem)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|atf_amc.FDb.hashable|[atf_amc.Hashable](/txt/exe/atf_amc/internals.md#atf_amc-hashable)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||| +|atf_amc.FDb.ind_hashable|[atf_amc.Hashable](/txt/exe/atf_amc/internals.md#atf_amc-hashable)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|atf_amc.FDb.time_entry|[atf_amc.FTimeEntry](/txt/exe/atf_amc/internals.md#atf_amc-ftimeentry)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||| +|atf_amc.FDb.bh_time_entry|[atf_amc.FTimeEntry](/txt/exe/atf_amc/internals.md#atf_amc-ftimeentry)|[Bheap](/txt/exe/amc/reftypes.md#bheap)||| +|atf_amc.FDb.timehook_recur_counter|u64|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_amc.FDb.timehook_once_counter|u64|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_amc.FDb.ind_linear|[atf_amc.FHashableLinear](/txt/exe/atf_amc/internals.md#atf_amc-fhashablelinear)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|atf_amc.FDb.hashable_linear|[atf_amc.FHashableLinear](/txt/exe/atf_amc/internals.md#atf_amc-fhashablelinear)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||| +|atf_amc.FDb.strkey|[atf_amc.Strkey](/txt/exe/atf_amc/internals.md#atf_amc-strkey)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||| +|atf_amc.FDb.ind_strkey|[atf_amc.Strkey](/txt/exe/atf_amc/internals.md#atf_amc-strkey)|[Thash](/txt/exe/amc/reftypes.md#thash)||| #### Struct FDb Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) ``` struct FDb { // atf_amc.FDb: In-memory database for atf_amc - command::atf_amc cmdline; // - atf_amc::FTypeC** bh_typec_elems; // binary heap by typec - i32 bh_typec_n; // number of elements in the heap - i32 bh_typec_max; // max elements in bh_typec_elems - atf_amc::FTypeC* zdl_h_typec_head; // zero-terminated doubly linked list - i32 zdl_h_typec_n; // zero-terminated doubly linked list - atf_amc::FTypeC* zdl_h_typec_tail; // pointer to last element - atf_amc::FTypeC* zd_t_typec_head; // zero-terminated doubly linked list - i32 zd_t_typec_n; // zero-terminated doubly linked list - atf_amc::FTypeC* zd_t_typec_tail; // pointer to last element - atf_amc::FTypeD* zd_typed_head; // zero-terminated doubly linked list - i32 zd_typed_n; // zero-terminated doubly linked list - atf_amc::FTypeD* zd_typed_tail; // pointer to last element - atf_amc::FTypeD* zs_t_typed_head; // zero-terminated singly linked list - i32 zs_t_typed_n; // zero-terminated singly linked list - atf_amc::FTypeD* zs_t_typed_tail; // pointer to last element - atf_amc::FTypeD* cd_typed_head; // zero-terminated doubly linked list - i32 cd_typed_n; // zero-terminated doubly linked list - atf_amc::FTypeC* zsl_h_typec_head; // zero-terminated singly linked list - i32 zsl_h_typec_n; // zero-terminated singly linked list - atf_amc::FTypeC* zsl_h_typec_tail; // pointer to last element - atf_amc::FTypeC* zs_t_typec_head; // zero-terminated singly linked list - i32 zs_t_typec_n; // zero-terminated singly linked list - atf_amc::FTypeC* zs_t_typec_tail; // pointer to last element - - atf_amc::FTypeC* zs_mt_typec_head; // ZSListMT - zero-terminated singly linked list -- read side - atf_amc::FTypeC* zs_mt_typec_mt; // elements inserted here from another thread -- write side - atf_amc::FTypeC* zdl_hnt_typec_head; // zero-terminated doubly linked list - i32 zdl_hnt_typec_n; // zero-terminated doubly linked list - atf_amc::FTypeC* cdl_h_typec_head; // zero-terminated doubly linked list - i32 cdl_h_typec_n; // zero-terminated doubly linked list - atf_amc::FTypeC* cd_t_typec_head; // zero-terminated doubly linked list - i32 cd_t_typec_n; // zero-terminated doubly linked list - atf_amc::FTypeC* csl_h_typec_head; // zero-terminated singly linked list - i32 csl_h_typec_n; // zero-terminated singly linked list - atf_amc::FTypeC* csl_h_typec_tail; // pointer to last element - atf_amc::FTypeC* cs_t_typec_head; // zero-terminated singly linked list - i32 cs_t_typec_n; // zero-terminated singly linked list - atf_amc::FTypeC* cs_t_typec_tail; // pointer to last element - atf_amc::FTypeA* typea_lary[32]; // level array - i32 typea_n; // number of elements in array - atf_amc::FTypeS* types_lary[32]; // level array - i32 types_n; // number of elements in array - atf_amc::FTypeS** ind_types_buckets_elems; // pointer to bucket array - i32 ind_types_buckets_n; // number of elements in bucket array - i32 ind_types_n; // number of elements in the hash table - atf_amc::FTypeA** ind_typea_buckets_elems; // pointer to bucket array - i32 ind_typea_buckets_n; // number of elements in bucket array - i32 ind_typea_n; // number of elements in the hash table - i32 cs_h_count; // 0 FirstChanged trigger fire count - i32 cs_t_count; // 0 FirstChanged trigger fire count - i32 zs_h_count; // 0 FirstChanged trigger fire count - i32 zs_t_count; // 0 FirstChanged trigger fire count - i32 zs_mt_count; // 0 FirstChanged trigger fire count - i32 bh_count; // 0 FirstChanged trigger fire count - atf_amc::FTypeT* typet_lary[32]; // level array - i32 typet_n; // number of elements in array - atf_amc::FCstring* cstring_lary[32]; // level array - i32 cstring_n; // number of elements in array - atf_amc::FCstring** ind_cstring_buckets_elems; // pointer to bucket array - i32 ind_cstring_buckets_n; // number of elements in bucket array - i32 ind_cstring_n; // number of elements in the hash table - atf_amc::Msgbuf* cd_in_msg_head; // zero-terminated doubly linked list - u64 typeb_blocksize; // # bytes per block - atf_amc::FTypeB* typeb_free; // - u64 pooledbe64_blocksize; // # bytes per block - atf_amc::PooledBE64* pooledbe64_free; // - i64 varlen_extern_n; // Number of elements - varlen_extern_Lpblock* varlen_extern_free[36]; // Lpool levels - atf_amc::FAmctest* amctest_lary[32]; // level array - i32 amctest_n; // number of elements in array - u64 cascdel_blocksize; // # bytes per block - atf_amc::FCascdel* cascdel_free; // - algo_lib::Bitset cascdel_check; // Bitset of FCascdel records in existence - u32 cascdel_next_key; // 0 Next sequence number for FCascdel record - i64 optalloc_n; // Number of elements - optalloc_Lpblock* optalloc_free[36]; // Lpool levels - i64 varlenalloc_n; // Number of elements - varlenalloc_Lpblock* varlenalloc_free[36]; // Lpool levels - i64 optg_n; // Number of elements - optg_Lpblock* optg_free[36]; // Lpool levels - atf_amc::FTypeK** c_typek_elems; // array of pointers - u32 c_typek_n; // array of pointers - u32 c_typek_max; // capacity of allocated array - atf_amc::FAvl* avl_lary[32]; // level array - i32 avl_n; // number of elements in array - atf_amc::FAvl* tr_avl_root; // Root of the tree - i32 tr_avl_n; // number of elements in the tree - u128 listtype_data[sizeu128(atf_amc::FListtype,10)]; // place for data - i32 listtype_n; // number of elems current in existence + command::atf_amc cmdline; // + atf_amc::FTypeC** bh_typec_elems; // binary heap by typec + i32 bh_typec_n; // number of elements in the heap + i32 bh_typec_max; // max elements in bh_typec_elems + atf_amc::FTypeC* zdl_h_typec_head; // zero-terminated doubly linked list + i32 zdl_h_typec_n; // zero-terminated doubly linked list + atf_amc::FTypeC* zdl_h_typec_tail; // pointer to last element + atf_amc::FTypeC* zd_t_typec_head; // zero-terminated doubly linked list + i32 zd_t_typec_n; // zero-terminated doubly linked list + atf_amc::FTypeC* zd_t_typec_tail; // pointer to last element + atf_amc::FTypeD* zd_typed_head; // zero-terminated doubly linked list + i32 zd_typed_n; // zero-terminated doubly linked list + atf_amc::FTypeD* zd_typed_tail; // pointer to last element + atf_amc::FTypeD* zs_t_typed_head; // zero-terminated singly linked list + i32 zs_t_typed_n; // zero-terminated singly linked list + atf_amc::FTypeD* zs_t_typed_tail; // pointer to last element + atf_amc::FTypeD* cd_typed_head; // zero-terminated doubly linked list + i32 cd_typed_n; // zero-terminated doubly linked list + atf_amc::FTypeC* zsl_h_typec_head; // zero-terminated singly linked list + i32 zsl_h_typec_n; // zero-terminated singly linked list + atf_amc::FTypeC* zsl_h_typec_tail; // pointer to last element + atf_amc::FTypeC* zs_t_typec_head; // zero-terminated singly linked list + i32 zs_t_typec_n; // zero-terminated singly linked list + atf_amc::FTypeC* zs_t_typec_tail; // pointer to last element + + atf_amc::FTypeC* zs_mt_typec_head; // ZSListMT - zero-terminated singly linked list -- read side + atf_amc::FTypeC* zs_mt_typec_mt; // elements inserted here from another thread -- write side + atf_amc::FTypeC* zdl_hnt_typec_head; // zero-terminated doubly linked list + i32 zdl_hnt_typec_n; // zero-terminated doubly linked list + atf_amc::FTypeC* cdl_h_typec_head; // zero-terminated doubly linked list + i32 cdl_h_typec_n; // zero-terminated doubly linked list + atf_amc::FTypeC* cd_t_typec_head; // zero-terminated doubly linked list + i32 cd_t_typec_n; // zero-terminated doubly linked list + atf_amc::FTypeC* csl_h_typec_head; // zero-terminated singly linked list + i32 csl_h_typec_n; // zero-terminated singly linked list + atf_amc::FTypeC* csl_h_typec_tail; // pointer to last element + atf_amc::FTypeC* cs_t_typec_head; // zero-terminated singly linked list + i32 cs_t_typec_n; // zero-terminated singly linked list + atf_amc::FTypeC* cs_t_typec_tail; // pointer to last element + atf_amc::FTypeA* typea_lary[32]; // level array + i32 typea_n; // number of elements in array + atf_amc::FTypeS* types_lary[32]; // level array + i32 types_n; // number of elements in array + atf_amc::FTypeS** ind_types_buckets_elems; // pointer to bucket array + i32 ind_types_buckets_n; // number of elements in bucket array + i32 ind_types_n; // number of elements in the hash table + atf_amc::FTypeA** ind_typea_buckets_elems; // pointer to bucket array + i32 ind_typea_buckets_n; // number of elements in bucket array + i32 ind_typea_n; // number of elements in the hash table + i32 cs_h_count; // 0 FirstChanged trigger fire count + i32 cs_t_count; // 0 FirstChanged trigger fire count + i32 zs_h_count; // 0 FirstChanged trigger fire count + i32 zs_t_count; // 0 FirstChanged trigger fire count + i32 zs_mt_count; // 0 FirstChanged trigger fire count + i32 bh_count; // 0 FirstChanged trigger fire count + atf_amc::FTypeT* typet_lary[32]; // level array + i32 typet_n; // number of elements in array + atf_amc::FCstring* cstring_lary[32]; // level array + i32 cstring_n; // number of elements in array + atf_amc::FCstring** ind_cstring_buckets_elems; // pointer to bucket array + i32 ind_cstring_buckets_n; // number of elements in bucket array + i32 ind_cstring_n; // number of elements in the hash table + atf_amc::Msgbuf* cd_in_msg_head; // zero-terminated doubly linked list + u64 typeb_blocksize; // # bytes per block + atf_amc::FTypeB* typeb_free; // + u64 pooledbe64_blocksize; // # bytes per block + atf_amc::PooledBE64* pooledbe64_free; // + i64 varlen_extern_n; // Number of elements + varlen_extern_Lpblock* varlen_extern_free[36]; // Lpool levels + atf_amc::FAmctest* amctest_lary[32]; // level array + i32 amctest_n; // number of elements in array + u64 cascdel_blocksize; // # bytes per block + atf_amc::FCascdel* cascdel_free; // + algo_lib::Bitset cascdel_check; // Bitset of FCascdel records in existence + u32 cascdel_next_key; // 0 Next sequence number for FCascdel record + i64 optalloc_n; // Number of elements + optalloc_Lpblock* optalloc_free[36]; // Lpool levels + i64 varlenalloc_n; // Number of elements + varlenalloc_Lpblock* varlenalloc_free[36]; // Lpool levels + i64 optg_n; // Number of elements + optg_Lpblock* optg_free[36]; // Lpool levels + atf_amc::FTypeK** c_typek_elems; // array of pointers + u32 c_typek_n; // array of pointers + u32 c_typek_max; // capacity of allocated array + atf_amc::FTypeL** c_typel_elems; // array of pointers + u32 c_typel_n; // array of pointers + u32 c_typel_max; // capacity of allocated array + atf_amc::FTypeM** c_typem_elems; // array of pointers + u32 c_typem_n; // array of pointers + u32 c_typem_max; // capacity of allocated array + atf_amc::FAvl* avl_lary[32]; // level array + i32 avl_n; // number of elements in array + atf_amc::FAvl* tr_avl_root; // Root of the tree + i32 tr_avl_n; // number of elements in the tree + u128 listtype_data[sizeu128(atf_amc::FListtype,10)]; // place for data + i32 listtype_n; // number of elems current in existence enum { listtype_max = 10 }; - bool dofork; // false - u64 typed_blocksize; // # bytes per block - atf_amc::FTypeD* typed_free; // - atf_amc::FThashElem** ind_thash_elem_buckets_elems; // pointer to bucket array - i32 ind_thash_elem_buckets_n; // number of elements in bucket array - i32 ind_thash_elem_n; // number of elements in the hash table - atf_amc::FThashElem* thash_elem_lary[32]; // level array - i32 thash_elem_n; // number of elements in array - atf_amc::trace trace; // + bool dofork; // false + u64 typed_blocksize; // # bytes per block + atf_amc::FTypeD* typed_free; // + atf_amc::FThashElem** ind_thash_elem_buckets_elems; // pointer to bucket array + i32 ind_thash_elem_buckets_n; // number of elements in bucket array + i32 ind_thash_elem_n; // number of elements in the hash table + atf_amc::FThashElem* thash_elem_lary[32]; // level array + i32 thash_elem_n; // number of elements in array + u64 hashable_blocksize; // # bytes per block + atf_amc::Hashable* hashable_free; // + atf_amc::Hashable** ind_hashable_buckets_elems; // pointer to bucket array + i32 ind_hashable_buckets_n; // number of elements in bucket array + i32 ind_hashable_n; // number of elements in the hash table + u64 time_entry_blocksize; // # bytes per block + atf_amc::FTimeEntry* time_entry_free; // + atf_amc::FTimeEntry** bh_time_entry_elems; // binary heap by time + i32 bh_time_entry_n; // number of elements in the heap + i32 bh_time_entry_max; // max elements in bh_time_entry_elems + algo_lib::FTimehook th_bh_time_entry; // atf_amc.FDb.bh_time_entry fstep time hook for atf_amc.FDb.bh_time_entry + u64 timehook_recur_counter; // 0 + u64 timehook_once_counter; // 0 + atf_amc::FHashableLinear** ind_linear_buckets_elems; // pointer to bucket array + i32 ind_linear_buckets_n; // number of elements in bucket array + i32 ind_linear_n; // number of elements in the hash table + u64 hashable_linear_blocksize; // # bytes per block + atf_amc::FHashableLinear* hashable_linear_free; // + u64 strkey_blocksize; // # bytes per block + atf_amc::Strkey* strkey_free; // + atf_amc::Strkey** ind_strkey_buckets_elems; // pointer to bucket array + i32 ind_strkey_buckets_n; // number of elements in bucket array + i32 ind_strkey_n; // number of elements in the hash table + atf_amc::trace trace; // +}; +``` + +#### atf_amc.FHashableLinear - + + +#### atf_amc.FHashableLinear Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.FHashableLinear.key|[algo.U32LinearKey](/txt/protocol/algo/README.md#algo-u32linearkey)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FHashableLinear + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) +``` +struct FHashableLinear { // atf_amc.FHashableLinear + atf_amc::FHashableLinear* ind_linear_next; // hash next + u32 ind_linear_hashval; // hash value + atf_amc::FHashableLinear* hashable_linear_next; // Pointer to next free element int tpool + algo::U32LinearKey key; // + // func:atf_amc.FHashableLinear..AssignOp + inline atf_amc::FHashableLinear& operator =(const atf_amc::FHashableLinear &rhs) = delete; + // func:atf_amc.FHashableLinear..CopyCtor + inline FHashableLinear(const atf_amc::FHashableLinear &rhs) = delete; +private: + // func:atf_amc.FHashableLinear..Ctor + inline FHashableLinear() __attribute__((nothrow)); + // func:atf_amc.FHashableLinear..Dtor + inline ~FHashableLinear() __attribute__((nothrow)); + friend atf_amc::FHashableLinear& hashable_linear_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_amc::FHashableLinear* hashable_linear_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void hashable_linear_Delete(atf_amc::FHashableLinear &row) __attribute__((nothrow)); }; ``` @@ -1167,8 +1259,9 @@ struct FPerfSortString { // atf_amc.FPerfSortString: Function to test string sor Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) ``` struct FThashElem { // atf_amc.FThashElem - atf_amc::FThashElem* ind_thash_elem_next; // hash next - u64 key; // 0 + atf_amc::FThashElem* ind_thash_elem_next; // hash next + u32 ind_thash_elem_hashval; // hash value + u64 key; // 0 // func:atf_amc.FThashElem..AssignOp inline atf_amc::FThashElem& operator =(const atf_amc::FThashElem &rhs) = delete; // func:atf_amc.FThashElem..CopyCtor @@ -1185,6 +1278,38 @@ private: }; ``` +#### atf_amc.FTimeEntry - + + +#### atf_amc.FTimeEntry Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.FTimeEntry.time|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FTimeEntry + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) +``` +struct FTimeEntry { // atf_amc.FTimeEntry + atf_amc::FTimeEntry* time_entry_next; // Pointer to next free element int tpool + i32 bh_time_entry_idx; // index in heap; -1 means not-in-heap + algo::SchedTime time; // + // func:atf_amc.FTimeEntry..AssignOp + inline atf_amc::FTimeEntry& operator =(const atf_amc::FTimeEntry &rhs) = delete; + // func:atf_amc.FTimeEntry..CopyCtor + inline FTimeEntry(const atf_amc::FTimeEntry &rhs) = delete; +private: + // func:atf_amc.FTimeEntry..Ctor + inline FTimeEntry() __attribute__((nothrow)); + // func:atf_amc.FTimeEntry..Dtor + inline ~FTimeEntry() __attribute__((nothrow)); + friend atf_amc::FTimeEntry& time_entry_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_amc::FTimeEntry* time_entry_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void time_entry_Delete(atf_amc::FTimeEntry &row) __attribute__((nothrow)); +}; +``` + #### atf_amc.FTypeC - @@ -1256,6 +1381,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/inc ``` struct FTypeA { // atf_amc.FTypeA atf_amc::FTypeA* ind_typea_next; // hash next + u32 ind_typea_hashval; // hash value i32 typea; // 0 u128 typec_data[sizeu128(atf_amc::FTypeC,10)]; // place for data i32 typec_n; // number of elems current in existence @@ -1307,12 +1433,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) ``` struct FTypeB { // atf_amc.FTypeB - atf_amc::FTypeB* typeb_next; // Pointer to next free element int tpool - atf_amc::FTypeB* zdl_typeb_next; // zslist link; -1 means not-in-list - atf_amc::FTypeB* zdl_typeb_prev; // previous element - i32 bh_typeb_idx; // index in heap; -1 means not-in-heap - i32 typea; // 0 - i32 j; // 0 + atf_amc::FTypeB* typeb_next; // Pointer to next free element int tpool + atf_amc::FTypeB* typea_zdl_typeb_next; // zslist link; -1 means not-in-list + atf_amc::FTypeB* typea_zdl_typeb_prev; // previous element + i32 typea_bh_typeb_idx; // index in heap; -1 means not-in-heap + i32 typea; // 0 + i32 j; // 0 // func:atf_amc.FTypeB..AssignOp inline atf_amc::FTypeB& operator =(const atf_amc::FTypeB &rhs) = delete; // func:atf_amc.FTypeB..CopyCtor @@ -1369,7 +1495,7 @@ private: }; ``` -#### atf_amc.FTypeK - +#### atf_amc.FTypeK - Test element for Ptrary #### atf_amc.FTypeK Fields @@ -1382,14 +1508,55 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) ``` -struct FTypeK { // atf_amc.FTypeK - u32 value; // 0 - bool _db_c_typek_in_ary; // false membership flag +struct FTypeK { // atf_amc.FTypeK: Test element for Ptrary + u32 value; // 0 + bool c_typek_in_ary; // false membership flag // func:atf_amc.FTypeK..Ctor inline FTypeK() __attribute__((nothrow)); }; ``` +#### atf_amc.FTypeL - Test element for heap-like Ptrary + + +#### atf_amc.FTypeL Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.FTypeL.value|u32|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FTypeL + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) +``` +struct FTypeL { // atf_amc.FTypeL: Test element for heap-like Ptrary + u32 value; // 0 + i32 c_typel_idx; // -1 Array index (-1 = not in array) + // func:atf_amc.FTypeL..Ctor + inline FTypeL() __attribute__((nothrow)); +}; +``` + +#### atf_amc.FTypeM - Test element for non-unique Ptrary + + +#### atf_amc.FTypeM Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.FTypeM.value|u32|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FTypeM + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) +``` +struct FTypeM { // atf_amc.FTypeM: Test element for non-unique Ptrary + u32 value; // 0 + // func:atf_amc.FTypeM..Ctor + inline FTypeM() __attribute__((nothrow)); +}; +``` + #### atf_amc.FTypeS - @@ -1411,12 +1578,13 @@ struct FTypeK { // atf_amc.FTypeK Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) ``` struct FTypeS { // atf_amc.FTypeS - atf_amc::FTypeS* ind_types_next; // hash next - i32 types; // 0 - algo::Comment comment; // - atf_amc::FTypeT* zdl_typet_head; // zero-terminated doubly linked list - i32 zdl_typet_n; // zero-terminated doubly linked list - atf_amc::FTypeT* zdl_typet_tail; // pointer to last element + atf_amc::FTypeS* ind_types_next; // hash next + u32 ind_types_hashval; // hash value + i32 types; // 0 + algo::Comment comment; // + atf_amc::FTypeT* zdl_typet_head; // zero-terminated doubly linked list + i32 zdl_typet_n; // zero-terminated doubly linked list + atf_amc::FTypeT* zdl_typet_tail; // pointer to last element // reftype Llist of atf_amc.FTypeS.zdl_typet prohibits copy // func:atf_amc.FTypeS..AssignOp inline atf_amc::FTypeS& operator =(const atf_amc::FTypeS &rhs) = delete; @@ -1455,10 +1623,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) ``` struct FTypeT { // atf_amc.FTypeT - atf_amc::FTypeT* zdl_typet_next; // zslist link; -1 means not-in-list - atf_amc::FTypeT* zdl_typet_prev; // previous element - i32 types; // 0 - i32 j; // 0 + atf_amc::FTypeT* types_zdl_typet_next; // zslist link; -1 means not-in-list + atf_amc::FTypeT* types_zdl_typet_prev; // previous element + i32 types; // 0 + i32 j; // 0 // func:atf_amc.FTypeT..AssignOp inline atf_amc::FTypeT& operator =(const atf_amc::FTypeT &rhs) = delete; // func:atf_amc.FTypeT..CopyCtor @@ -1543,6 +1711,41 @@ struct FUnitSort { // atf_amc.FUnitSort }; ``` +#### atf_amc.Hashable - + + +#### atf_amc.Hashable Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.Hashable.hashable|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_amc.Hashable.key|[algo.U64Ary](/txt/protocol/algo/README.md#algo-u64ary)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct Hashable + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) +``` +struct Hashable { // atf_amc.Hashable + atf_amc::Hashable* hashable_next; // Pointer to next free element int tpool + atf_amc::Hashable* ind_hashable_next; // hash next + u32 ind_hashable_hashval; // hash value + i32 hashable; // 0 + algo::U64Ary key; // + // func:atf_amc.Hashable..AssignOp + inline atf_amc::Hashable& operator =(const atf_amc::Hashable &rhs) = delete; + // func:atf_amc.Hashable..CopyCtor + inline Hashable(const atf_amc::Hashable &rhs) = delete; +private: + // func:atf_amc.Hashable..Ctor + inline Hashable() __attribute__((nothrow)); + // func:atf_amc.Hashable..Dtor + inline ~Hashable() __attribute__((nothrow)); + friend atf_amc::Hashable& hashable_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_amc::Hashable* hashable_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void hashable_Delete(atf_amc::Hashable &row) __attribute__((nothrow)); +}; +``` + #### atf_amc.Hooktype - @@ -1633,17 +1836,19 @@ struct Lary32 { // atf_amc.Lary32 Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) ``` struct Linebuf { // atf_amc.Linebuf - u8 in_elems[64]; // pointer to elements of inline array + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array i32 in_start; // beginning of valid bytes (in bytes) i32 in_end; // end of valid bytes (in bytes) - bool in_eof; // no more data will be written to buffer + i32 in_msglen; // current message length algo::Errcode in_err; // system error code + bool in_eof; // no more data will be written to buffer bool in_msgvalid; // current message is valid - i32 in_msglen; // current message length bool in_epoll_enable; // use epoll? - enum { in_max = 64 }; // func:atf_amc.Linebuf..Ctor inline Linebuf() __attribute__((nothrow)); + // func:atf_amc.Linebuf..Dtor + inline ~Linebuf() __attribute__((nothrow)); }; ``` @@ -1911,44 +2116,44 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/inc struct Msgbuf { // atf_amc.Msgbuf atf_amc::Msgbuf* cd_in_msg_next; // zslist link; -1 means not-in-list atf_amc::Msgbuf* cd_in_msg_prev; // previous element - u8 in_buf_elems[64]; // pointer to elements of inline array + u8* in_buf_elems; // NULL pointer to elements of indirect array + u32 in_buf_max; // 0 current length of allocated array i32 in_buf_start; // beginning of valid bytes (in bytes) i32 in_buf_end; // end of valid bytes (in bytes) - bool in_buf_eof; // no more data will be written to buffer + i32 in_buf_msglen; // current message length algo::Errcode in_buf_err; // system error code + algo_lib::FIohook in_buf_iohook; // edge-triggered hook for the buffer + bool in_buf_eof; // no more data will be written to buffer bool in_buf_msgvalid; // current message is valid - i32 in_buf_msglen; // current message length - algo_lib::FIohook in_buf_iohook; // edge-triggered hook for refilling buffer bool in_buf_epoll_enable; // use epoll? - enum { in_buf_max = 64 }; - u8 in_custom_elems[64]; // pointer to elements of inline array + u8* in_custom_elems; // NULL pointer to elements of indirect array + u32 in_custom_max; // 0 current length of allocated array i32 in_custom_start; // beginning of valid bytes (in bytes) i32 in_custom_end; // end of valid bytes (in bytes) - bool in_custom_eof; // no more data will be written to buffer + i32 in_custom_msglen; // current message length algo::Errcode in_custom_err; // system error code + algo_lib::FIohook in_custom_iohook; // edge-triggered hook for the buffer + bool in_custom_eof; // no more data will be written to buffer bool in_custom_msgvalid; // current message is valid - i32 in_custom_msglen; // current message length - algo_lib::FIohook in_custom_iohook; // edge-triggered hook for refilling buffer bool in_custom_epoll_enable; // use epoll? - enum { in_custom_max = 64 }; - u8 out_extra_elems[64]; // pointer to elements of inline array + u8* out_extra_elems; // NULL pointer to elements of indirect array + u32 out_extra_max; // 0 current length of allocated array i32 out_extra_start; // beginning of valid bytes (in bytes) i32 out_extra_end; // end of valid bytes (in bytes) - bool out_extra_eof; // no more data will be written to buffer + i32 out_extra_msglen; // current message length algo::Errcode out_extra_err; // system error code + bool out_extra_eof; // no more data will be written to buffer bool out_extra_msgvalid; // current message is valid - i32 out_extra_msglen; // current message length bool out_extra_epoll_enable; // use epoll? - enum { out_extra_max = 64 }; - u8 in_extra_elems[64]; // pointer to elements of inline array + u8* in_extra_elems; // NULL pointer to elements of indirect array + u32 in_extra_max; // 0 current length of allocated array i32 in_extra_start; // beginning of valid bytes (in bytes) i32 in_extra_end; // end of valid bytes (in bytes) - bool in_extra_eof; // no more data will be written to buffer + i32 in_extra_msglen; // current message length algo::Errcode in_extra_err; // system error code + bool in_extra_eof; // no more data will be written to buffer bool in_extra_msgvalid; // current message is valid - i32 in_extra_msglen; // current message length bool in_extra_epoll_enable; // use epoll? - enum { in_extra_max = 64 }; // field atf_amc.Msgbuf.in_buf prevents copy // field atf_amc.Msgbuf.in_custom prevents copy // field atf_amc.Msgbuf.out_extra prevents copy @@ -2540,6 +2745,39 @@ struct SortedStr { // atf_amc.SortedStr }; ``` +#### atf_amc.Strkey - + + +#### atf_amc.Strkey Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.Strkey.strkey|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct Strkey + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) +``` +struct Strkey { // atf_amc.Strkey + atf_amc::Strkey* strkey_next; // Pointer to next free element int tpool + atf_amc::Strkey* ind_strkey_next; // hash next + u32 ind_strkey_hashval; // hash value + algo::cstring strkey; // + // func:atf_amc.Strkey..AssignOp + inline atf_amc::Strkey& operator =(const atf_amc::Strkey &rhs) = delete; + // func:atf_amc.Strkey..CopyCtor + inline Strkey(const atf_amc::Strkey &rhs) = delete; +private: + // func:atf_amc.Strkey..Ctor + inline Strkey() __attribute__((nothrow)); + // func:atf_amc.Strkey..Dtor + inline ~Strkey() __attribute__((nothrow)); + friend atf_amc::Strkey& strkey_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_amc::Strkey* strkey_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void strkey_Delete(atf_amc::Strkey &row) __attribute__((nothrow)); +}; +``` + #### atf_amc.TaryU32 - @@ -3018,6 +3256,173 @@ struct Typefconst { // atf_amc.Typefconst }; ``` +#### atf_amc.Varlen2Msg - + + +#### atf_amc.Varlen2Msg Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.Varlen2Msg.base|[atf_amc.MsgHeader](/txt/exe/atf_amc/internals.md#atf_amc-msgheader)|[Base](#atf_amc-msgheader-fields)||| +|atf_amc.Varlen2Msg.s1|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +|atf_amc.Varlen2Msg.s2|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +|atf_amc.Varlen2Msg.s3|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +#### atf_amc.MsgHeader Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.MsgHeader.type|[atf_amc.MsgType](/txt/exe/atf_amc/internals.md#atf_amc-msgtype)|[Val](/txt/exe/amc/reftypes.md#val)||Message type| +|atf_amc.MsgHeader.length|[atf_amc.MsgLength](/txt/exe/atf_amc/internals.md#atf_amc-msglength)|[Val](/txt/exe/amc/reftypes.md#val)||Total message length, including this header| + +#### Struct Varlen2Msg + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) +``` +#pragma pack(push,1) +struct Varlen2Msg { // atf_amc.Varlen2Msg + atf_amc::MsgType type; // 0x1001 Message type + atf_amc::MsgLength length; // ssizeof(parent) + (0) Total message length, including this header + atf_amc::MsgLength s1_end; // end of s1 field + // var-length field atf_amc.Varlen2Msg.s1 starts here. access it with s1_Addr + atf_amc::MsgLength s2_end; // end of s2 field + // var-length field atf_amc.Varlen2Msg.s2 starts here. access it with s2_Addr + // var-length field atf_amc.Varlen2Msg.s3 starts here. access it with s3_Addr + // func:atf_amc.Varlen2Msg..Ctor + inline Varlen2Msg() __attribute__((nothrow)); +}; +``` + +#### atf_amc.Varlen2aMsg - + + +#### atf_amc.Varlen2aMsg Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.Varlen2aMsg.base|[atf_amc.MsgHeader](/txt/exe/atf_amc/internals.md#atf_amc-msgheader)|[Base](#atf_amc-msgheader-fields)||| +|atf_amc.Varlen2aMsg.u1|u32|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +|atf_amc.Varlen2aMsg.u2|u32|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +|atf_amc.Varlen2aMsg.u3|u32|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +#### atf_amc.MsgHeader Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.MsgHeader.type|[atf_amc.MsgType](/txt/exe/atf_amc/internals.md#atf_amc-msgtype)|[Val](/txt/exe/amc/reftypes.md#val)||Message type| +|atf_amc.MsgHeader.length|[atf_amc.MsgLength](/txt/exe/atf_amc/internals.md#atf_amc-msglength)|[Val](/txt/exe/amc/reftypes.md#val)||Total message length, including this header| + +#### Struct Varlen2aMsg + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) +``` +#pragma pack(push,1) +struct Varlen2aMsg { // atf_amc.Varlen2aMsg + atf_amc::MsgType type; // 0x1002 Message type + atf_amc::MsgLength length; // ssizeof(parent) + (0) Total message length, including this header + atf_amc::MsgLength u1_end; // end of u1 field + // var-length field atf_amc.Varlen2aMsg.u1 starts here. access it with u1_Addr + atf_amc::MsgLength u2_end; // end of u2 field + // var-length field atf_amc.Varlen2aMsg.u2 starts here. access it with u2_Addr + // var-length field atf_amc.Varlen2aMsg.u3 starts here. access it with u3_Addr + // func:atf_amc.Varlen2aMsg..Ctor + inline Varlen2aMsg() __attribute__((nothrow)); +}; +``` + +#### atf_amc.Varlen2mMsg - + + +#### atf_amc.Varlen2mMsg Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.Varlen2mMsg.base|[atf_amc.MsgHeader](/txt/exe/atf_amc/internals.md#atf_amc-msgheader)|[Base](#atf_amc-msgheader-fields)||| +|atf_amc.Varlen2mMsg.m1|[atf_amc.MsgHeader](/txt/exe/atf_amc/internals.md#atf_amc-msgheader)|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +|atf_amc.Varlen2mMsg.m2|[atf_amc.MsgHeader](/txt/exe/atf_amc/internals.md#atf_amc-msgheader)|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +|atf_amc.Varlen2mMsg.m3|[atf_amc.MsgHeader](/txt/exe/atf_amc/internals.md#atf_amc-msgheader)|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +#### atf_amc.MsgHeader Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.MsgHeader.type|[atf_amc.MsgType](/txt/exe/atf_amc/internals.md#atf_amc-msgtype)|[Val](/txt/exe/amc/reftypes.md#val)||Message type| +|atf_amc.MsgHeader.length|[atf_amc.MsgLength](/txt/exe/atf_amc/internals.md#atf_amc-msglength)|[Val](/txt/exe/amc/reftypes.md#val)||Total message length, including this header| + +#### Struct Varlen2mMsg + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) +``` +#pragma pack(push,1) +struct Varlen2mMsg { // atf_amc.Varlen2mMsg + atf_amc::MsgType type; // 0x1004 Message type + atf_amc::MsgLength length; // ssizeof(parent) + (0) Total message length, including this header + atf_amc::MsgLength m1_end; // end of m1 field + // var-length field atf_amc.Varlen2mMsg.m1 starts here. access it with m1_Addr + atf_amc::MsgLength m2_end; // end of m2 field + // var-length field atf_amc.Varlen2mMsg.m2 starts here. access it with m2_Addr + // var-length field atf_amc.Varlen2mMsg.m3 starts here. access it with m3_Addr + // func:atf_amc.Varlen2mMsg..Ctor + inline Varlen2mMsg() __attribute__((nothrow)); +}; +``` + +#### atf_amc.VarlenK - An optional instance of atf_unit.A + + +#### atf_amc.VarlenK Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.VarlenK.length|u32|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_amc.VarlenK.i|u32|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### Struct VarlenK + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) +``` +#pragma pack(push,1) +struct VarlenK { // atf_amc.VarlenK: An optional instance of atf_unit.A + u32 length; // 0 + // var-length field atf_amc.VarlenK.i starts here. access it with i_Addr + // func:atf_amc.VarlenK..Ctor + inline VarlenK() __attribute__((nothrow)); +}; +``` + +#### atf_amc.Varlen2vMsg - + + +#### atf_amc.Varlen2vMsg Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.Varlen2vMsg.base|[atf_amc.MsgHeader](/txt/exe/atf_amc/internals.md#atf_amc-msgheader)|[Base](#atf_amc-msgheader-fields)||| +|atf_amc.Varlen2vMsg.v1|[atf_amc.VarlenK](/txt/exe/atf_amc/internals.md#atf_amc-varlenk)|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +|atf_amc.Varlen2vMsg.v2|[atf_amc.VarlenK](/txt/exe/atf_amc/internals.md#atf_amc-varlenk)|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +|atf_amc.Varlen2vMsg.v3|[atf_amc.VarlenK](/txt/exe/atf_amc/internals.md#atf_amc-varlenk)|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| +#### atf_amc.MsgHeader Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_amc.MsgHeader.type|[atf_amc.MsgType](/txt/exe/atf_amc/internals.md#atf_amc-msgtype)|[Val](/txt/exe/amc/reftypes.md#val)||Message type| +|atf_amc.MsgHeader.length|[atf_amc.MsgLength](/txt/exe/atf_amc/internals.md#atf_amc-msglength)|[Val](/txt/exe/amc/reftypes.md#val)||Total message length, including this header| + +#### Struct Varlen2vMsg + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) +``` +#pragma pack(push,1) +struct Varlen2vMsg { // atf_amc.Varlen2vMsg + atf_amc::MsgType type; // 0x1003 Message type + atf_amc::MsgLength length; // ssizeof(parent) + (0) Total message length, including this header + atf_amc::MsgLength v1_end; // end of v1 field + // var-length field atf_amc.Varlen2vMsg.v1 starts here. access it with v1_Addr + atf_amc::MsgLength v2_end; // end of v2 field + // var-length field atf_amc.Varlen2vMsg.v2 starts here. access it with v2_Addr + // var-length field atf_amc.Varlen2vMsg.v3 starts here. access it with v3_Addr + // func:atf_amc.Varlen2vMsg..Ctor + inline Varlen2vMsg() __attribute__((nothrow)); +}; +``` + #### atf_amc.VarlenAlloc - An optional instance of atf_unit.A @@ -3103,29 +3508,6 @@ struct VarlenH { // atf_amc.VarlenH }; ``` -#### atf_amc.VarlenK - An optional instance of atf_unit.A - - -#### atf_amc.VarlenK Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|atf_amc.VarlenK.length|u32|[Val](/txt/exe/amc/reftypes.md#val)||| -|atf_amc.VarlenK.i|u32|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| - -#### Struct VarlenK - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_amc_gen.h](/include/gen/atf_amc_gen.h) -``` -#pragma pack(push,1) -struct VarlenK { // atf_amc.VarlenK: An optional instance of atf_unit.A - u32 length; // 0 - // var-length field atf_amc.VarlenK.i starts here. access it with i_Addr - // func:atf_amc.VarlenK..Ctor - inline VarlenK() __attribute__((nothrow)); -}; -``` - #### atf_amc.VarlenMsg - diff --git a/txt/exe/atf_ci/README.md b/txt/exe/atf_ci/README.md index 29f6f118..15da85d0 100644 --- a/txt/exe/atf_ci/README.md +++ b/txt/exe/atf_ci/README.md @@ -17,17 +17,18 @@ ``` atf_ci: Normalization tests (see citest table) Usage: atf_ci [[-citest:]] [options] - OPTION TYPE DFLT COMMENT - -in string "data" Input directory or filename, - for stdin - [citest] regx "%" Regx of tests to run - -maxerr int 0 Exit after this many errors - -cijob regx "%" - -capture Capture the output of the test - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative - -help Print help and exit; alias -h - -version Print version and exit - -signature Show signatures and exit; alias -sig + OPTION TYPE DFLT COMMENT + -in string "data" Input directory or filename, - for stdin + [citest] regx "%" Regx of tests to run + -maxerr int 0 Exit after this many errors + -cijob regx "%" + -capture Capture the output of the test + -check_clean Y Check for modifications after each test + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative + -help Print help and exit; alias -h + -version Print version and exit + -signature Show signatures and exit; alias -sig ``` @@ -52,6 +53,9 @@ Usage: atf_ci [[-citest:]] [options] #### -capture -- Capture the output of the test +#### -check_clean -- Check for modifications after each test + + ### Inputs @@ -60,29 +64,30 @@ Usage: atf_ci [[-citest:]] [options] `atf_ci` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dev.gitfile](/txt/ssimdb/dev/gitfile.md)|File managed by git| -|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| +|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| +|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| -|[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| |[dmmeta.ftuple](/txt/ssimdb/dmmeta/ftuple.md)|| -|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| -|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| -|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| |[dev.unstablefld](/txt/ssimdb/dev/unstablefld.md)|Fields that should be stripped from component test output because they contain timestamps etc.| -|[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|List of sources for target| -|[dev.scriptfile](/txt/ssimdb/dev/scriptfile.md)|Known script file| -|[dev.readme](/txt/ssimdb/dev/readme.md)|File containing documentation| -|[dev.noindent](/txt/ssimdb/dev/noindent.md)|Indicates that a file should not be automatically indented| -|[dev.msgfile](/txt/ssimdb/dev/msgfile.md)|File in repo containing messages that should be normalized during CI| -|[dev.cfg](/txt/ssimdb/dev/cfg.md)|Compiler configuration| |[dev.builddir](/txt/ssimdb/dev/builddir.md)|Directory where object files/executables go. Determines compile/link options| +|[dev.cfg](/txt/ssimdb/dev/cfg.md)|Compiler configuration| |[atfdb.cipackage](/txt/ssimdb/atfdb/cipackage.md)|| -|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dev.gitfile](/txt/ssimdb/dev/gitfile.md)|File managed by git| +|[dev.msgfile](/txt/ssimdb/dev/msgfile.md)|File in repo containing messages that should be normalized during CI| +|[dev.noindent](/txt/ssimdb/dev/noindent.md)|Indicates that a file should not be automatically indented| +|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dev.readmefile](/txt/ssimdb/dev/readmefile.md)|File containing documentation| +|[dev.scriptfile](/txt/ssimdb/dev/scriptfile.md)|Known script file| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|List of sources for target| diff --git a/txt/exe/atf_ci/internals.md b/txt/exe/atf_ci/internals.md index e8f633b5..373d9f4e 100644 --- a/txt/exe/atf_ci/internals.md +++ b/txt/exe/atf_ci/internals.md @@ -26,6 +26,7 @@ The following source files are part of this tool: |Source File|Comment| |---|---| +|[cpp/atf_ci/abt_md.cpp](/cpp/atf_ci/abt_md.cpp)|| |[cpp/atf_ci/acr_ed.cpp](/cpp/atf_ci/acr_ed.cpp)|| |[cpp/atf_ci/apm.cpp](/cpp/atf_ci/apm.cpp)|| |[cpp/atf_ci/bootstrap.cpp](/cpp/atf_ci/bootstrap.cpp)|| @@ -71,7 +72,7 @@ All allocations are done through global `atf_ci::_db` [atf_ci.FDb](#atf_ci-fdb) |[atf_ci.FNoindent](#atf_ci-fnoindent)|[dev.noindent](/txt/ssimdb/dev/noindent.md)|FDb.noindent (Lary)|noindent (Lary, by rowid)| ||||FGitfile.c_noindent (Ptr)| |[atf_ci.FNs](#atf_ci-fns)|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|FDb.ns (Lary)|ns (Lary, by rowid)|ind_ns (Thash, hash field ns)| -|[atf_ci.FReadme](#atf_ci-freadme)|[dev.readme](/txt/ssimdb/dev/readme.md)|FDb.readme (Lary)|readme (Lary, by rowid)| +|[atf_ci.FReadmefile](#atf_ci-freadmefile)|[dev.readmefile](/txt/ssimdb/dev/readmefile.md)|FDb.readmefile (Lary)|readmefile (Lary, by rowid)| |[atf_ci.FScriptfile](#atf_ci-fscriptfile)|[dev.scriptfile](/txt/ssimdb/dev/scriptfile.md)|FDb.scriptfile (Lary)|scriptfile (Lary, by rowid)|ind_scriptfile (Thash, hash field gitfile)| ||||FGitfile.c_scriptfile (Ptr)| |[atf_ci.FSsimfile](#atf_ci-fssimfile)|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|FDb.ssimfile (Lary)|ssimfile (Lary, by rowid)|ind_ssimfile (Thash, hash field ssimfile)| @@ -95,9 +96,10 @@ All allocations are done through global `atf_ci::_db` [atf_ci.FDb](#atf_ci-fdb) Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_ci_gen.h](/include/gen/atf_ci_gen.h) ``` struct FBuilddir { // atf_ci.FBuilddir - algo::Smallstr50 builddir; // Primary key - uname.compiler.cfg-arch - algo::Comment comment; // - atf_ci::FBuilddir* ind_builddir_next; // hash next + algo::Smallstr50 builddir; // Primary key - uname.compiler.cfg-arch + algo::Comment comment; // + atf_ci::FBuilddir* ind_builddir_next; // hash next + u32 ind_builddir_hashval; // hash value // func:atf_ci.FBuilddir..AssignOp inline atf_ci::FBuilddir& operator =(const atf_ci::FBuilddir &rhs) = delete; // func:atf_ci.FBuilddir..CopyCtor @@ -192,13 +194,14 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_ci_gen.h](/include/gen/atf_ci_gen.h) ``` struct FCitest { // atf_ci.FCitest - algo::Smallstr50 citest; // Primary key - algo::Smallstr50 cijob; // "test" CI job in which this test runs - bool sandbox; // false Run test in sandbox - algo::Comment comment; // - i32 nerr; // 0 - atf_ci::citest_step_hook step; // NULL Pointer to a function - atf_ci::FCitest* ind_citest_next; // hash next + algo::Smallstr50 citest; // Primary key + algo::Smallstr50 cijob; // "test" CI job in which this test runs + bool sandbox; // false Run test in sandbox + algo::Comment comment; // + i32 nerr; // 0 + atf_ci::citest_step_hook step; // NULL Pointer to a function + atf_ci::FCitest* ind_citest_next; // hash next + u32 ind_citest_hashval; // hash value // reftype Hook of atf_ci.FCitest.step prohibits copy // func:atf_ci.FCitest..AssignOp inline atf_ci::FCitest& operator =(const atf_ci::FCitest &rhs) = delete; @@ -234,7 +237,7 @@ private: |atf_ci.FDb.ind_scriptfile|[atf_ci.FScriptfile](/txt/exe/atf_ci/internals.md#atf_ci-fscriptfile)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |atf_ci.FDb.ns|[atf_ci.FNs](/txt/exe/atf_ci/internals.md#atf_ci-fns)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |atf_ci.FDb.ind_ns|[atf_ci.FNs](/txt/exe/atf_ci/internals.md#atf_ci-fns)|[Thash](/txt/exe/amc/reftypes.md#thash)||| -|atf_ci.FDb.readme|[atf_ci.FReadme](/txt/exe/atf_ci/internals.md#atf_ci-freadme)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|atf_ci.FDb.readmefile|[atf_ci.FReadmefile](/txt/exe/atf_ci/internals.md#atf_ci-freadmefile)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |atf_ci.FDb.builddir|[atf_ci.FBuilddir](/txt/exe/atf_ci/internals.md#atf_ci-fbuilddir)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |atf_ci.FDb.cfg|[atf_ci.FCfg](/txt/exe/atf_ci/internals.md#atf_ci-fcfg)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |atf_ci.FDb.ind_builddir|[atf_ci.FBuilddir](/txt/exe/atf_ci/internals.md#atf_ci-fbuilddir)|[Thash](/txt/exe/amc/reftypes.md#thash)||| @@ -248,6 +251,7 @@ private: |atf_ci.FDb.ind_file|[atf_ci.File](/txt/exe/atf_ci/internals.md#atf_ci-file)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |atf_ci.FDb.sandbox_need_init|bool|[Val](/txt/exe/amc/reftypes.md#val)||| |atf_ci.FDb.cipackage|[atf_ci.FCipackage](/txt/exe/atf_ci/internals.md#atf_ci-fcipackage)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|atf_ci.FDb.called_npm_install|bool|[Val](/txt/exe/amc/reftypes.md#val)||| #### Struct FDb @@ -273,8 +277,8 @@ struct FDb { // atf_ci.FDb: In-memory database for atf_ci atf_ci::FNs** ind_ns_buckets_elems; // pointer to bucket array i32 ind_ns_buckets_n; // number of elements in bucket array i32 ind_ns_n; // number of elements in the hash table - atf_ci::FReadme* readme_lary[32]; // level array - i32 readme_n; // number of elements in array + atf_ci::FReadmefile* readmefile_lary[32]; // level array + i32 readmefile_n; // number of elements in array atf_ci::FBuilddir* builddir_lary[32]; // level array i32 builddir_n; // number of elements in array atf_ci::FCfg* cfg_lary[32]; // level array @@ -304,6 +308,7 @@ struct FDb { // atf_ci.FDb: In-memory database for atf_ci bool sandbox_need_init; // false atf_ci::FCipackage* cipackage_lary[32]; // level array i32 cipackage_n; // number of elements in array + bool called_npm_install; // false atf_ci::trace trace; // }; ``` @@ -345,11 +350,12 @@ struct FExecLimit { // atf_ci.FExecLimit Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_ci_gen.h](/include/gen/atf_ci_gen.h) ``` struct FGitfile { // atf_ci.FGitfile - atf_ci::FGitfile* ind_gitfile_next; // hash next - algo::Smallstr200 gitfile; // - atf_ci::FNoindent* c_noindent; // optional pointer - atf_ci::FScriptfile* c_scriptfile; // optional pointer - atf_ci::FTargsrc* c_targsrc; // optional pointer + atf_ci::FGitfile* ind_gitfile_next; // hash next + u32 ind_gitfile_hashval; // hash value + algo::Smallstr200 gitfile; // + atf_ci::FNoindent* c_noindent; // optional pointer + atf_ci::FScriptfile* c_scriptfile; // optional pointer + atf_ci::FTargsrc* c_targsrc; // optional pointer // x-reference on atf_ci.FGitfile.c_noindent prevents copy // x-reference on atf_ci.FGitfile.c_scriptfile prevents copy // x-reference on atf_ci.FGitfile.c_targsrc prevents copy @@ -451,11 +457,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_ci_gen.h](/include/gen/atf_ci_gen.h) ``` struct FNs { // atf_ci.FNs - atf_ci::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // + atf_ci::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // // func:atf_ci.FNs..AssignOp inline atf_ci::FNs& operator =(const atf_ci::FNs &rhs) = delete; // func:atf_ci.FNs..CopyCtor @@ -472,34 +479,34 @@ private: }; ``` -#### atf_ci.FReadme - File containing documentation - +#### atf_ci.FReadmefile - File containing documentation + -#### atf_ci.FReadme Fields - +#### atf_ci.FReadmefile Fields + |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|atf_ci.FReadme.base|[dev.Readme](/txt/ssimdb/dev/readme.md)|[Base](/txt/ssimdb/dev/readme.md)||| +|atf_ci.FReadmefile.base|[dev.Readmefile](/txt/ssimdb/dev/readmefile.md)|[Base](/txt/ssimdb/dev/readmefile.md)||| -#### Struct FReadme - -*Note:* field ``atf_ci.FReadme.base`` has reftype ``base`` so the fields of [dev.Readme](/txt/ssimdb/dev/readme.md) above are included into the resulting struct. +#### Struct FReadmefile + +*Note:* field ``atf_ci.FReadmefile.base`` has reftype ``base`` so the fields of [dev.Readmefile](/txt/ssimdb/dev/readmefile.md) above are included into the resulting struct. Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_ci_gen.h](/include/gen/atf_ci_gen.h) ``` -struct FReadme { // atf_ci.FReadme +struct FReadmefile { // atf_ci.FReadmefile algo::Smallstr200 gitfile; // bool inl; // false bool sandbox; // false algo::Smallstr100 filter; // algo::Comment comment; // private: - // func:atf_ci.FReadme..Ctor - inline FReadme() __attribute__((nothrow)); - friend atf_ci::FReadme& readme_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend atf_ci::FReadme* readme_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void readme_RemoveAll() __attribute__((nothrow)); - friend void readme_RemoveLast() __attribute__((nothrow)); + // func:atf_ci.FReadmefile..Ctor + inline FReadmefile() __attribute__((nothrow)); + friend atf_ci::FReadmefile& readmefile_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_ci::FReadmefile* readmefile_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void readmefile_RemoveAll() __attribute__((nothrow)); + friend void readmefile_RemoveLast() __attribute__((nothrow)); }; ``` @@ -519,10 +526,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_ci_gen.h](/include/gen/atf_ci_gen.h) ``` struct FScriptfile { // atf_ci.FScriptfile - atf_ci::FScriptfile* ind_scriptfile_next; // hash next - algo::Smallstr200 gitfile; // - algo::Smallstr50 license; // - algo::Comment comment; // + atf_ci::FScriptfile* ind_scriptfile_next; // hash next + u32 ind_scriptfile_hashval; // hash value + algo::Smallstr200 gitfile; // + algo::Smallstr50 license; // + algo::Comment comment; // // func:atf_ci.FScriptfile..AssignOp inline atf_ci::FScriptfile& operator =(const atf_ci::FScriptfile &rhs) = delete; // func:atf_ci.FScriptfile..CopyCtor @@ -555,9 +563,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_ci_gen.h](/include/gen/atf_ci_gen.h) ``` struct FSsimfile { // atf_ci.FSsimfile - atf_ci::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // + atf_ci::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // // func:atf_ci.FSsimfile..AssignOp inline atf_ci::FSsimfile& operator =(const atf_ci::FSsimfile &rhs) = delete; // func:atf_ci.FSsimfile..CopyCtor @@ -623,10 +632,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_ci_gen.h](/include/gen/atf_ci_gen.h) ``` struct File { // atf_ci.File - atf_ci::File* ind_file_next; // hash next - algo::cstring file; // Filename - bool file_exists; // false - bool record_exists; // false + atf_ci::File* ind_file_next; // hash next + u32 ind_file_hashval; // hash value + algo::cstring file; // Filename + bool file_exists; // false + bool record_exists; // false // func:atf_ci.File..AssignOp inline atf_ci::File& operator =(const atf_ci::File &rhs) = delete; // func:atf_ci.File..CopyCtor diff --git a/txt/exe/atf_cmdline/README.md b/txt/exe/atf_cmdline/README.md index 1313af32..77def509 100644 --- a/txt/exe/atf_cmdline/README.md +++ b/txt/exe/atf_cmdline/README.md @@ -36,15 +36,15 @@ Usage: atf_cmdline [-astr:] [[-anum:]] [[-adbl:]] -str:] [options] -normalize (action) Renumber and normalize tmsgs -covcapture (action) Capture new coverage percentages and save back -covcheck (action) Check coverage percentages against tgtcov table - -compdir string "" Component image directory (exe) + -bindir string "" Directory with binaries (default: build/cfg) -cfg string "release" Set config -check_untracked Y Check for untracked file before allowing test to run - -maxerr int 1 Exit after this many errors + -maxerr int 3 Exit after this many errors -build Build given cfg before test - -ood Check given cfg for ood before test -memcheck Run under memory checker (valgrind) -force (With -memcheck) run suppressed memcheck -callgrind Run under callgrind profiler (valgrind) @@ -59,10 +58,13 @@ Usage: atf_comp [[-comptest:]] [options] -stream prints component's output -i Read and execute testcase from stdin -write Y (implied with -e) Write any changes back to ssim tables - -report Print final report + -report Y Print final report -b string "" Breakpoint passed to mdbg as-is - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -covfast Y Speedup coverage processing + -minrepeat int 0 Execute every comptest at least this many times + -maxrepeat int 1 Don't repeat any individual comptest more than X times + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -348,8 +350,8 @@ For complex filter, dedicated executable is possible. #### -covcheck -- (action) Check coverage percentages against tgtcov table -#### -compdir -- Component image directory (exe) - +#### -bindir -- Directory with binaries (default: build/cfg) + #### -cfg -- Set config @@ -363,9 +365,6 @@ For complex filter, dedicated executable is possible. #### -build -- Build given cfg before test -#### -ood -- Check given cfg for ood before test - - #### -memcheck -- Run under memory checker (valgrind) @@ -393,6 +392,15 @@ For complex filter, dedicated executable is possible. #### -b -- Breakpoint passed to mdbg as-is +#### -covfast -- Speedup coverage processing + + +#### -minrepeat -- Execute every comptest at least this many times + + +#### -maxrepeat -- Don't repeat any individual comptest more than X times + + ### Inputs @@ -401,23 +409,23 @@ For complex filter, dedicated executable is possible. `atf_comp` takes the following tables on input: |Ssimfile|Comment| |---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| +|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| +|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| -|[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| |[dmmeta.ftuple](/txt/ssimdb/dmmeta/ftuple.md)|| -|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| -|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| -|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| |[dev.unstablefld](/txt/ssimdb/dev/unstablefld.md)|Fields that should be stripped from component test output because they contain timestamps etc.| |[atfdb.comptest](/txt/ssimdb/atfdb/comptest.md)|| -|[atfdb.tmsg](/txt/ssimdb/atfdb/tmsg.md)|| -|[atfdb.tfilt](/txt/ssimdb/atfdb/tfilt.md)|| |[atfdb.targs](/txt/ssimdb/atfdb/targs.md)|| -|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[atfdb.tfilt](/txt/ssimdb/atfdb/tfilt.md)|| +|[atfdb.tmsg](/txt/ssimdb/atfdb/tmsg.md)|| diff --git a/txt/exe/atf_comp/internals.md b/txt/exe/atf_comp/internals.md index 016376b8..51a368cd 100644 --- a/txt/exe/atf_comp/internals.md +++ b/txt/exe/atf_comp/internals.md @@ -56,10 +56,12 @@ All allocations are done through global `atf_comp::_db` [atf_comp.FDb](#atf_comp |Ctype|Ssimfile|Create|Access| |---|---|---|---| |[atf_comp.FComptest](#atf_comp-fcomptest)|[atfdb.comptest](/txt/ssimdb/atfdb/comptest.md)|FDb.comptest (Lary)|comptest (Lary, by rowid)|ind_comptest (Thash, hash field comptest)|zd_sel_comptest (Llist)|zd_run_comptest (Llist)|zd_out_comptest (Llist)| +|[atf_comp.FCovdir](#atf_comp-fcovdir)||FDb.covdir (Lary)|covdir (Lary, by rowid)|zd_covdir_free (Llist)| +||||FComptest.c_covdir (Ptr)| |[atf_comp.FDb](#atf_comp-fdb)||FDb._db (Global)| |[atf_comp.FTargs](#atf_comp-ftargs)|[atfdb.targs](/txt/ssimdb/atfdb/targs.md)|FDb.targs (Tpool)|zd_out_targs (Llist)| ||||FComptest.c_targs (Ptr)| -|[atf_comp.FTfilt](#atf_comp-ftfilt)|[atfdb.tfilt](/txt/ssimdb/atfdb/tfilt.md)|FDb.tfilt (Tpool)|zd_out_tfilt (Llist)| +|[atf_comp.FTfilt](#atf_comp-ftfilt)|[atfdb.tfilt](/txt/ssimdb/atfdb/tfilt.md)|FDb.tfilt (Tpool)|zd_out_tfilt (Llist)|ind_tfilt (Thash, hash field comptest)| ||||FComptest.c_tfilt (Ptr)| |[atf_comp.FTmsg](#atf_comp-ftmsg)|[atfdb.tmsg](/txt/ssimdb/atfdb/tmsg.md)|FDb.tmsg (Tpool)|zd_out_tmsg (Llist)| ||||FComptest.zd_tmsg (Llist)| @@ -82,15 +84,17 @@ All allocations are done through global `atf_comp::_db` [atf_comp.FDb](#atf_comp |atf_comp.FComptest.finish|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)||| |atf_comp.FComptest.elapsed|double|[Val](/txt/exe/amc/reftypes.md#val)||| |atf_comp.FComptest.thook|[algo_lib.FTimehook](/txt/lib/algo_lib/README.md#algo_lib-ftimehook)|[Val](/txt/exe/amc/reftypes.md#val)||| -|atf_comp.FComptest.success|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_comp.FComptest.success|bool|[Val](/txt/exe/amc/reftypes.md#val)||Success so far| +|atf_comp.FComptest.nrun|i32|[Val](/txt/exe/amc/reftypes.md#val)||Number of times the test ran| |atf_comp.FComptest.file_memcheck|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| |atf_comp.FComptest.file_callgrind_log|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| |atf_comp.FComptest.file_callgrind_out|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| -|atf_comp.FComptest.covdir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| |atf_comp.FComptest.zd_tmsg|[atf_comp.FTmsg](/txt/exe/atf_comp/internals.md#atf_comp-ftmsg)|[Llist](/txt/exe/amc/reftypes.md#llist)||| |atf_comp.FComptest.need_write|bool|[Val](/txt/exe/amc/reftypes.md#val)||Component test modified during runtime, needs to be written back| |atf_comp.FComptest.err|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Error string| |atf_comp.FComptest.filter_command|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_comp.FComptest.c_covdir|[atf_comp.FCovdir](/txt/exe/atf_comp/internals.md#atf_comp-fcovdir)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| +|atf_comp.FComptest.dir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| #### Struct FComptest @@ -102,7 +106,10 @@ struct FComptest { // atf_comp.FComptest algo::Smallstr50 comptest; // i32 timeout; // 10 bool memcheck; // true + bool coverage; // true u8 exit_code; // 0 Exit code to check + i32 ncore; // 1 + i32 repeat; // 1 Number of times to repeat the test algo::Comment comment; // algo::cstring file_test_out; // algo::cstring file_test_in; // @@ -114,18 +121,21 @@ struct FComptest { // atf_comp.FComptest algo::SchedTime finish; // double elapsed; // 0.0 algo_lib::FTimehook thook; // - bool success; // false + bool success; // false Success so far + i32 nrun; // 0 Number of times the test ran algo::cstring file_memcheck; // algo::cstring file_callgrind_log; // algo::cstring file_callgrind_out; // - algo::cstring covdir; // atf_comp::FTmsg* zd_tmsg_head; // zero-terminated doubly linked list i32 zd_tmsg_n; // zero-terminated doubly linked list atf_comp::FTmsg* zd_tmsg_tail; // pointer to last element bool need_write; // false Component test modified during runtime, needs to be written back algo::cstring err; // Error string algo::cstring filter_command; // + atf_comp::FCovdir* c_covdir; // optional pointer + algo::cstring dir; // atf_comp::FComptest* ind_comptest_next; // hash next + u32 ind_comptest_hashval; // hash value atf_comp::FComptest* zd_sel_comptest_next; // zslist link; -1 means not-in-list atf_comp::FComptest* zd_sel_comptest_prev; // previous element atf_comp::FComptest* zd_run_comptest_next; // zslist link; -1 means not-in-list @@ -158,6 +168,39 @@ private: }; ``` +#### atf_comp.FCovdir - + + +#### atf_comp.FCovdir Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_comp.FCovdir.covdir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FCovdir + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_comp_gen.h](/include/gen/atf_comp_gen.h) +``` +struct FCovdir { // atf_comp.FCovdir + algo::cstring covdir; // + atf_comp::FCovdir* zd_covdir_free_next; // zslist link; -1 means not-in-list + atf_comp::FCovdir* zd_covdir_free_prev; // previous element + // func:atf_comp.FCovdir..AssignOp + inline atf_comp::FCovdir& operator =(const atf_comp::FCovdir &rhs) = delete; + // func:atf_comp.FCovdir..CopyCtor + inline FCovdir(const atf_comp::FCovdir &rhs) = delete; +private: + // func:atf_comp.FCovdir..Ctor + inline FCovdir() __attribute__((nothrow)); + // func:atf_comp.FCovdir..Dtor + inline ~FCovdir() __attribute__((nothrow)); + friend atf_comp::FCovdir& covdir_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_comp::FCovdir* covdir_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void covdir_RemoveAll() __attribute__((nothrow)); + friend void covdir_RemoveLast() __attribute__((nothrow)); +}; +``` + #### atf_comp.FDb - In-memory database for atf_comp @@ -170,7 +213,7 @@ private: |atf_comp.FDb.tempdir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"temp/atf_comp"|| |atf_comp.FDb.comptest|[atf_comp.FComptest](/txt/exe/atf_comp/internals.md#atf_comp-fcomptest)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |atf_comp.FDb.ind_comptest|[atf_comp.FComptest](/txt/exe/atf_comp/internals.md#atf_comp-fcomptest)|[Thash](/txt/exe/amc/reftypes.md#thash)||| -|atf_comp.FDb.compdir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_comp.FDb.bindir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Directory with binaries| |atf_comp.FDb.report|[report.atf_comp](/txt/protocol/report/README.md#report-atf_comp)|[Val](/txt/exe/amc/reftypes.md#val)||Final report| |atf_comp.FDb.zd_sel_comptest|[atf_comp.FComptest](/txt/exe/atf_comp/internals.md#atf_comp-fcomptest)|[Llist](/txt/exe/amc/reftypes.md#llist)||| |atf_comp.FDb.targs|[atf_comp.FTargs](/txt/exe/atf_comp/internals.md#atf_comp-ftargs)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||| @@ -182,6 +225,11 @@ private: |atf_comp.FDb.nchange|i32|[Val](/txt/exe/amc/reftypes.md#val)||| |atf_comp.FDb.zd_out_tfilt|[atf_comp.FTfilt](/txt/exe/atf_comp/internals.md#atf_comp-ftfilt)|[Llist](/txt/exe/amc/reftypes.md#llist)||| |atf_comp.FDb.zd_out_targs|[atf_comp.FTargs](/txt/exe/atf_comp/internals.md#atf_comp-ftargs)|[Llist](/txt/exe/amc/reftypes.md#llist)||| +|atf_comp.FDb.covdir|[atf_comp.FCovdir](/txt/exe/atf_comp/internals.md#atf_comp-fcovdir)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|atf_comp.FDb.zd_covdir_free|[atf_comp.FCovdir](/txt/exe/atf_comp/internals.md#atf_comp-fcovdir)|[Llist](/txt/exe/amc/reftypes.md#llist)||| +|atf_comp.FDb.ncore_used|i32|[Val](/txt/exe/amc/reftypes.md#val)||Number of cores 'used' by running child tests| +|atf_comp.FDb.ind_tfilt|[atf_comp.FTfilt](/txt/exe/atf_comp/internals.md#atf_comp-ftfilt)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|atf_comp.FDb.th_runtest|[algo_lib.FTimehook](/txt/lib/algo_lib/README.md#algo_lib-ftimehook)|[Val](/txt/exe/amc/reftypes.md#val)||| #### Struct FDb @@ -195,7 +243,7 @@ struct FDb { // atf_comp.FDb: In-memory database for atf_comp atf_comp::FComptest** ind_comptest_buckets_elems; // pointer to bucket array i32 ind_comptest_buckets_n; // number of elements in bucket array i32 ind_comptest_n; // number of elements in the hash table - algo::cstring compdir; // + algo::cstring bindir; // Directory with binaries report::atf_comp report; // Final report atf_comp::FComptest* zd_sel_comptest_head; // zero-terminated doubly linked list i32 zd_sel_comptest_n; // zero-terminated doubly linked list @@ -209,8 +257,8 @@ struct FDb { // atf_comp.FDb: In-memory database for atf_comp atf_comp::FComptest* zd_run_comptest_head; // zero-terminated doubly linked list i32 zd_run_comptest_n; // zero-terminated doubly linked list atf_comp::FComptest* zd_run_comptest_tail; // pointer to last element - algo::SchedTime zd_run_comptest_next; // atf_comp.FDb.zd_run_comptest Next invocation time - algo::SchedTime zd_run_comptest_delay; // atf_comp.FDb.zd_run_comptest Delay between invocations + algo::SchedTime zd_run_comptest_next; // atf_comp.FDb.zd_run_comptest Next invocation time + algo::SchedTime zd_run_comptest_delay; // atf_comp.FDb.zd_run_comptest Delay between invocations atf_comp::FTmsg* zd_out_tmsg_head; // zero-terminated doubly linked list i32 zd_out_tmsg_n; // zero-terminated doubly linked list atf_comp::FTmsg* zd_out_tmsg_tail; // pointer to last element @@ -224,6 +272,16 @@ struct FDb { // atf_comp.FDb: In-memory database for atf_comp atf_comp::FTargs* zd_out_targs_head; // zero-terminated doubly linked list i32 zd_out_targs_n; // zero-terminated doubly linked list atf_comp::FTargs* zd_out_targs_tail; // pointer to last element + atf_comp::FCovdir* covdir_lary[32]; // level array + i32 covdir_n; // number of elements in array + atf_comp::FCovdir* zd_covdir_free_head; // zero-terminated doubly linked list + i32 zd_covdir_free_n; // zero-terminated doubly linked list + atf_comp::FCovdir* zd_covdir_free_tail; // pointer to last element + i32 ncore_used; // 0 Number of cores 'used' by running child tests + atf_comp::FTfilt** ind_tfilt_buckets_elems; // pointer to bucket array + i32 ind_tfilt_buckets_n; // number of elements in bucket array + i32 ind_tfilt_n; // number of elements in the hash table + algo_lib::FTimehook th_runtest; // atf_comp::trace trace; // }; ``` @@ -283,6 +341,8 @@ struct FTfilt { // atf_comp.FTfilt atf_comp::FTfilt* tfilt_next; // Pointer to next free element int tpool atf_comp::FTfilt* zd_out_tfilt_next; // zslist link; -1 means not-in-list atf_comp::FTfilt* zd_out_tfilt_prev; // previous element + atf_comp::FTfilt* ind_tfilt_next; // hash next + u32 ind_tfilt_hashval; // hash value algo::Smallstr50 comptest; // algo::cstring filter; // algo::Comment comment; // @@ -317,14 +377,14 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_comp_gen.h](/include/gen/atf_comp_gen.h) ``` struct FTmsg { // atf_comp.FTmsg - atf_comp::FTmsg* zd_tmsg_next; // zslist link; -1 means not-in-list - atf_comp::FTmsg* zd_tmsg_prev; // previous element - atf_comp::FTmsg* tmsg_next; // Pointer to next free element int tpool - atf_comp::FTmsg* zd_out_tmsg_next; // zslist link; -1 means not-in-list - atf_comp::FTmsg* zd_out_tmsg_prev; // previous element - algo::Smallstr50 tmsg; // - bool istuple; // false - algo::cstring msg; // + atf_comp::FTmsg* comptest_zd_tmsg_next; // zslist link; -1 means not-in-list + atf_comp::FTmsg* comptest_zd_tmsg_prev; // previous element + atf_comp::FTmsg* tmsg_next; // Pointer to next free element int tpool + atf_comp::FTmsg* zd_out_tmsg_next; // zslist link; -1 means not-in-list + atf_comp::FTmsg* zd_out_tmsg_prev; // previous element + algo::Smallstr50 tmsg; // + bool istuple; // false + algo::cstring msg; // // func:atf_comp.FTmsg..AssignOp inline atf_comp::FTmsg& operator =(const atf_comp::FTmsg &rhs) = delete; // func:atf_comp.FTmsg..CopyCtor diff --git a/txt/exe/atf_cov/README.md b/txt/exe/atf_cov/README.md index be7c6a7f..6982d5c3 100644 --- a/txt/exe/atf_cov/README.md +++ b/txt/exe/atf_cov/README.md @@ -34,25 +34,26 @@ ``` atf_cov: Line coverage Usage: atf_cov [options] - OPTION TYPE DFLT COMMENT - -in string "data" Input directory or filename, - for stdin - -covdir string "temp/covdata" Output directory to save coverage data - -logfile string "" Log file - -runcmd string "" command to run - -exclude regx "(extern|include/gen|cpp/gen)/%" Exclude gitfiles (external, generated) - -mergepath string "" colon-separated dir list to load .cov.ssim files from - -gcov run gcov - -ssim write out ssim files - -report write out all reports - -capture Write coverage information into tgtcov table - -xmlpretty Generate pretty-formatted XML - -summary Y Show summary figures - -check Check coverage information against tgtcov table - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative - -help Print help and exit; alias -h - -version Print version and exit - -signature Show signatures and exit; alias -sig + OPTION TYPE DFLT COMMENT + -in string "data" Input directory or filename, - for stdin + -covdir string "temp/covdata" Output directory to save coverage data + -logfile string "" Log file + -runcmd string "" command to run + -exclude regx "(extern|include/gen|cpp/gen)/%" Exclude gitfiles (external, generated) + -mergepath string "" colon-separated dir list to load .cov.ssim files from + -gcov run gcov + -ssim write out ssim files + -report write out all reports + -capture Write coverage information into tgtcov table + -xmlpretty Generate pretty-formatted XML + -summary Y Show summary figures + -check Check coverage information against tgtcov table + -incremental Keep *.gcda files from previous run + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative + -help Print help and exit; alias -h + -version Print version and exit + -signature Show signatures and exit; alias -sig ``` @@ -313,12 +314,12 @@ Ssim file format is described as 'dev.covline' table: ``` inline-command: acr dmmeta.field:dev.Covline.% -dmmeta.field field:dev.Covline.covline arg:algo.Smallstr200 reftype:Val dflt:"" comment:file:line -dmmeta.field field:dev.Covline.src arg:dev.Gitfile reftype:Pkey dflt:"" comment:"Source file" -dmmeta.field field:dev.Covline.line arg:u32 reftype:Val dflt:"" comment:"Source line" -dmmeta.field field:dev.Covline.flag arg:char reftype:Val dflt:"'N'" comment:Flag -dmmeta.field field:dev.Covline.hit arg:u32 reftype:Val dflt:"" comment:"Number of hits" -dmmeta.field field:dev.Covline.text arg:algo.cstring reftype:Val dflt:"" comment:"Line text" +dmmeta.field field:dev.Covline.covline arg:algo.cstring reftype:Val dflt:"" comment:"Key: file:line" +dmmeta.field field:dev.Covline.src arg:dev.Gitfile reftype:Pkey dflt:"" comment:"Source file" +dmmeta.field field:dev.Covline.line arg:u32 reftype:Val dflt:"" comment:"Source line" +dmmeta.field field:dev.Covline.flag arg:char reftype:Val dflt:"'N'" comment:Flag +dmmeta.field field:dev.Covline.hit arg:u32 reftype:Val dflt:"" comment:"Number of hits" +dmmeta.field field:dev.Covline.text arg:algo.cstring reftype:Val dflt:"" comment:"Line text" report.acr n_select:6 n_insert:0 n_delete:0 n_ignore:0 n_update:0 n_file_mod:0 ``` @@ -441,6 +442,9 @@ Atf_cov generates output files on `-covdata` directory; #### -check -- Check coverage information against tgtcov table +#### -incremental -- Keep *.gcda files from previous run + + ### Inputs @@ -449,14 +453,14 @@ Atf_cov generates output files on `-covdata` directory; `atf_cov` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dev.gitfile](/txt/ssimdb/dev/gitfile.md)|File managed by git| |[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dev.covfile](/txt/ssimdb/dev/covfile.md)|| +|[dev.covline](/txt/ssimdb/dev/covline.md)|| +|[dev.covtarget](/txt/ssimdb/dev/covtarget.md)|| +|[dev.gitfile](/txt/ssimdb/dev/gitfile.md)|File managed by git| |[dev.target](/txt/ssimdb/dev/target.md)|Build target| -|[dev.tgtcov](/txt/ssimdb/dev/tgtcov.md)|Captured line coverate information by target| |[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|List of sources for target| -|[dev.covtarget](/txt/ssimdb/dev/covtarget.md)|| -|[dev.covline](/txt/ssimdb/dev/covline.md)|| -|[dev.covfile](/txt/ssimdb/dev/covfile.md)|| +|[dev.tgtcov](/txt/ssimdb/dev/tgtcov.md)|Captured line coverate information by target| diff --git a/txt/exe/atf_cov/internals.md b/txt/exe/atf_cov/internals.md index 254d240b..48673f3e 100644 --- a/txt/exe/atf_cov/internals.md +++ b/txt/exe/atf_cov/internals.md @@ -126,13 +126,14 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_cov_gen.h](/include/gen/atf_cov_gen.h) ``` struct FCovline { // atf_cov.FCovline - algo::Smallstr200 covline; // file:line + algo::cstring covline; // Key: file:line char flag; // 'N' Flag u32 hit; // 0 Number of hits algo::cstring text; // Line text atf_cov::FGitfile* p_gitfile; // reference to parent row bool gitfile_c_covline_in_ary; // false membership flag atf_cov::FCovline* ind_covline_next; // hash next + u32 ind_covline_hashval; // hash value // x-reference on atf_cov.FCovline.p_gitfile prevents copy // func:atf_cov.FCovline..AssignOp inline atf_cov::FCovline& operator =(const atf_cov::FCovline &rhs) = delete; @@ -276,13 +277,14 @@ struct FDb { // atf_cov.FDb: In-memory database for atf_cov Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_cov_gen.h](/include/gen/atf_cov_gen.h) ``` struct FGitfile { // atf_cov.FGitfile - atf_cov::FGitfile* ind_gitfile_next; // hash next - algo::Smallstr200 gitfile; // - atf_cov::FTargsrc* c_targsrc; // optional pointer - atf_cov::FCovline** c_covline_elems; // array of pointers - u32 c_covline_n; // array of pointers - u32 c_covline_max; // capacity of allocated array - atf_cov::FCovfile* c_covfile; // optional pointer + atf_cov::FGitfile* ind_gitfile_next; // hash next + u32 ind_gitfile_hashval; // hash value + algo::Smallstr200 gitfile; // + atf_cov::FTargsrc* c_targsrc; // optional pointer + atf_cov::FCovline** c_covline_elems; // array of pointers + u32 c_covline_n; // array of pointers + u32 c_covline_max; // capacity of allocated array + atf_cov::FCovfile* c_covfile; // optional pointer // x-reference on atf_cov.FGitfile.c_targsrc prevents copy // reftype Ptrary of atf_cov.FGitfile.c_covline prohibits copy // x-reference on atf_cov.FGitfile.c_covfile prevents copy @@ -324,13 +326,14 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_cov_gen.h](/include/gen/atf_cov_gen.h) ``` struct FTarget { // atf_cov.FTarget - atf_cov::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target - atf_cov::FTargsrc** c_targsrc_elems; // array of pointers - u32 c_targsrc_n; // array of pointers - u32 c_targsrc_max; // capacity of allocated array - atf_cov::FCovtarget* c_covtarget; // optional pointer - atf_cov::FTgtcov* c_tgtcov; // optional pointer + atf_cov::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target + atf_cov::FTargsrc** c_targsrc_elems; // array of pointers + u32 c_targsrc_n; // array of pointers + u32 c_targsrc_max; // capacity of allocated array + atf_cov::FCovtarget* c_covtarget; // optional pointer + atf_cov::FTgtcov* c_tgtcov; // optional pointer // reftype Ptrary of atf_cov.FTarget.c_targsrc prohibits copy // x-reference on atf_cov.FTarget.c_covtarget prevents copy // x-reference on atf_cov.FTarget.c_tgtcov prevents copy @@ -372,6 +375,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_cov_gen.h](/inc ``` struct FTargsrc { // atf_cov.FTargsrc atf_cov::FTargsrc* ind_targsrc_next; // hash next + u32 ind_targsrc_hashval; // hash value algo::Smallstr100 targsrc; // algo::Comment comment; // atf_cov::FGitfile* p_gitfile; // reference to parent row @@ -413,11 +417,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_cov_gen.h](/include/gen/atf_cov_gen.h) ``` struct FTgtcov { // atf_cov.FTgtcov - atf_cov::FTgtcov* ind_tgtcov_next; // hash next - algo::Smallstr16 target; // Target - algo::U32Dec2 cov_min; // Minimal coverage limit - algo::U32Dec2 maxerr; // Tolerable error - algo::Comment comment; // + atf_cov::FTgtcov* ind_tgtcov_next; // hash next + u32 ind_tgtcov_hashval; // hash value + algo::Smallstr16 target; // Target + algo::U32Dec2 cov_min; // Minimal coverage limit + algo::U32Dec2 maxerr; // Tolerable error + algo::Comment comment; // // func:atf_cov.FTgtcov..AssignOp inline atf_cov::FTgtcov& operator =(const atf_cov::FTgtcov &rhs) = delete; // func:atf_cov.FTgtcov..CopyCtor diff --git a/txt/exe/atf_exp/README.md b/txt/exe/atf_exp/README.md new file mode 100644 index 00000000..7af581ee --- /dev/null +++ b/txt/exe/atf_exp/README.md @@ -0,0 +1,96 @@ +## atf_exp - ATF expect + + +Usage example:
+
+acr tmsg:atf_exp.Kafka/% -field msg | atf_exp +
+ +### Table Of Contents + + +  •  [Syntax](#syntax)
+  •  [Options](#options)
+  •  [Inputs](#inputs)
+  •  [Input Messages](#input-messages)
+📄 [atf_exp - Internals](/txt/exe/atf_exp/internals.md)
+ + + +### Syntax + + +``` +atf_exp: ATF expect +Usage: atf_exp [options] + OPTION TYPE DFLT COMMENT + -in string "data" Input directory or filename, - for stdin + -trace string "" Regx of things to trace + -bindir string "bin" Directory with binaries + -comptest string "" Component test name + -tempdir string "" Temporary directory for the component test + -timeout double 8.0 Timeout in seconds for a step + -dbgshell Invoke bash with curr envs in case of timeout + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative + -help Print help and exit; alias -h + -version Print version and exit + -signature Show signatures and exit; alias -sig + +``` + + + +### Options + + + +#### -in -- Input directory or filename, - for stdin + + +#### -trace -- Regx of things to trace + + +#### -bindir -- Directory with binaries + + +#### -comptest -- Component test name + + +#### -tempdir -- Temporary directory for the component test + + +#### -timeout -- Timeout in seconds for a step + + +#### -dbgshell -- Invoke bash with curr envs in case of timeout + + + + +### Inputs + + +`atf_exp` takes the following tables on input: +|Ssimfile|Comment| +|---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| + + + +### Input Messages + + +`atf_exp` Consumes the following messages via atf_exp.In () +|Message|Comment| +|---|---| +|[ams.ProcEofMsg](/txt/protocol/ams/README.md#ams-proceofmsg)|EOF from/to a process| +|[ams.ProcKillMsg](/txt/protocol/ams/README.md#ams-prockillmsg)|Kill process| +|[ams.ProcMsg](/txt/protocol/ams/README.md#ams-procmsg)|Message from/to a process| +|[ams.ProcReadMsg](/txt/protocol/ams/README.md#ams-procreadmsg)|Read process output| +|[ams.ProcStartMsg](/txt/protocol/ams/README.md#ams-procstartmsg)|Start process| +|[ams.RemDirRecurseMsg](/txt/protocol/ams/README.md#ams-remdirrecursemsg)|Message sent to process to terminate it| +|[ams.TerminateMsg](/txt/protocol/ams/TerminateMsg.md)|Message sent to process to terminate it| + + + diff --git a/txt/exe/atf_exp/internals.md b/txt/exe/atf_exp/internals.md new file mode 100644 index 00000000..747aec8c --- /dev/null +++ b/txt/exe/atf_exp/internals.md @@ -0,0 +1,264 @@ +## atf_exp - Internals + + +### Sources + + +The source code license is GPL +The following source files are part of this tool: + +|Source File|Comment| +|---|---| +|[cpp/atf_exp/atf_exp.cpp](/cpp/atf_exp/atf_exp.cpp)|| +|[cpp/gen/atf_exp_gen.cpp](/cpp/gen/atf_exp_gen.cpp)|| +|[include/atf_exp.h](/include/atf_exp.h)|| +|[include/gen/atf_exp_gen.h](/include/gen/atf_exp_gen.h)|| +|[include/gen/atf_exp_gen.inl.h](/include/gen/atf_exp_gen.inl.h)|| + + + +### Dependencies + + +The build target depends on the following libraries +|Target|Comment| +|---|---| +|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| +|[lib_prot](/txt/lib/lib_prot/README.md)|Library covering all protocols| + + + +### In Memory DB + + +`atf_exp` generated code creates the tables below. +All allocations are done through global `atf_exp::_db` [atf_exp.FDb](#atf_exp-fdb) structure +|Ctype|Ssimfile|Create|Access| +|---|---|---|---| +|[atf_exp.FDb](#atf_exp-fdb)||FDb._db (Global)| +|[atf_exp.FFdin](#atf_exp-ffdin)||FDb.fdin (Tpool)|cd_fdin_eof (Llist)|cd_fdin_read (Llist)|cd_fdin_suspend (Llist)| +|[atf_exp.FProc](#atf_exp-fproc)||FDb.proc (Tpool)|ind_proc (Thash, hash field proc)|zd_proc (Llist)|cd_proc_read (Llist)|cd_proc_outflow (Llist)|ind_proc_pid (Thash, hash field pid)|c_proc_read (Ptr)| +|[atf_exp.Proc](#atf_exp-proc)|| +||||FProc.base (Base)| + +#### atf_exp.FDb - + + +#### atf_exp.FDb Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_exp.FDb._db|[atf_exp.FDb](/txt/exe/atf_exp/internals.md#atf_exp-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| +|atf_exp.FDb.cmdline|[command.atf_exp](/txt/protocol/command/README.md#command-atf_exp)|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_exp.FDb.proc|[atf_exp.FProc](/txt/exe/atf_exp/internals.md#atf_exp-fproc)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||| +|atf_exp.FDb.ind_proc|[atf_exp.FProc](/txt/exe/atf_exp/internals.md#atf_exp-fproc)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|atf_exp.FDb.zd_proc|[atf_exp.FProc](/txt/exe/atf_exp/internals.md#atf_exp-fproc)|[Llist](/txt/exe/amc/reftypes.md#llist)||| +|atf_exp.FDb.cd_proc_read|[atf_exp.FProc](/txt/exe/atf_exp/internals.md#atf_exp-fproc)|[Llist](/txt/exe/amc/reftypes.md#llist)||| +|atf_exp.FDb.cd_proc_outflow|[atf_exp.FProc](/txt/exe/atf_exp/internals.md#atf_exp-fproc)|[Llist](/txt/exe/amc/reftypes.md#llist)||| +|atf_exp.FDb.R|[algo_lib.Replscope](/txt/lib/algo_lib/README.md#algo_lib-replscope)|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_exp.FDb.ind_proc_pid|[atf_exp.FProc](/txt/exe/atf_exp/internals.md#atf_exp-fproc)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|atf_exp.FDb.c_proc_read|[atf_exp.FProc](/txt/exe/atf_exp/internals.md#atf_exp-fproc)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| +|atf_exp.FDb.proc_read_until|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_exp.FDb.fdin|[atf_exp.FFdin](/txt/exe/atf_exp/internals.md#atf_exp-ffdin)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||input| +|atf_exp.FDb.cd_fdin_eof|[atf_exp.FFdin](/txt/exe/atf_exp/internals.md#atf_exp-ffdin)|[Llist](/txt/exe/amc/reftypes.md#llist)||End reading from stdin| +|atf_exp.FDb.cd_fdin_read|[atf_exp.FFdin](/txt/exe/atf_exp/internals.md#atf_exp-ffdin)|[Llist](/txt/exe/amc/reftypes.md#llist)||Read next message from file descriptor| +|atf_exp.FDb.cd_fdin_suspend|[atf_exp.FFdin](/txt/exe/atf_exp/internals.md#atf_exp-ffdin)|[Llist](/txt/exe/amc/reftypes.md#llist)||| +|atf_exp.FDb.timeout|[algo_lib.FTimehook](/txt/lib/algo_lib/README.md#algo_lib-ftimehook)|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_exp.FDb.vars_file|[algo_lib.FFildes](/txt/lib/algo_lib/README.md#algo_lib-ffildes)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FDb + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_exp_gen.h](/include/gen/atf_exp_gen.h) +``` +struct FDb { // atf_exp.FDb + command::atf_exp cmdline; // + u64 proc_blocksize; // # bytes per block + atf_exp::FProc* proc_free; // + atf_exp::FProc** ind_proc_buckets_elems; // pointer to bucket array + i32 ind_proc_buckets_n; // number of elements in bucket array + i32 ind_proc_n; // number of elements in the hash table + atf_exp::FProc* zd_proc_head; // zero-terminated doubly linked list + i32 zd_proc_n; // zero-terminated doubly linked list + atf_exp::FProc* zd_proc_tail; // pointer to last element + atf_exp::FProc* cd_proc_read_head; // zero-terminated doubly linked list + i32 cd_proc_read_n; // zero-terminated doubly linked list + atf_exp::FProc* cd_proc_outflow_head; // zero-terminated doubly linked list + i32 cd_proc_outflow_n; // zero-terminated doubly linked list + algo_lib::Replscope R; // + atf_exp::FProc** ind_proc_pid_buckets_elems; // pointer to bucket array + i32 ind_proc_pid_buckets_n; // number of elements in bucket array + i32 ind_proc_pid_n; // number of elements in the hash table + algo::SchedTime ind_proc_pid_next; // atf_exp.FDb.ind_proc_pid Next invocation time + algo::SchedTime ind_proc_pid_delay; // atf_exp.FDb.ind_proc_pid Delay between invocations + atf_exp::FProc* c_proc_read; // optional pointer + algo::cstring proc_read_until; // + u64 fdin_blocksize; // # bytes per block + atf_exp::FFdin* fdin_free; // + atf_exp::FFdin* cd_fdin_eof_head; // zero-terminated doubly linked list + i32 cd_fdin_eof_n; // zero-terminated doubly linked list + atf_exp::FFdin* cd_fdin_read_head; // zero-terminated doubly linked list + i32 cd_fdin_read_n; // zero-terminated doubly linked list + atf_exp::FFdin* cd_fdin_suspend_head; // zero-terminated doubly linked list + i32 cd_fdin_suspend_n; // zero-terminated doubly linked list + algo_lib::FTimehook timeout; // + algo_lib::FFildes vars_file; // + atf_exp::trace trace; // +}; +``` + +#### atf_exp.FFdin - FD input (normally stdin) + + +#### atf_exp.FFdin Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_exp.FFdin.in|char|[Fbuf](/txt/exe/amc/reftypes.md#fbuf)|'\n'|| + +#### Struct FFdin + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_exp_gen.h](/include/gen/atf_exp_gen.h) +``` +struct FFdin { // atf_exp.FFdin: FD input (normally stdin) + atf_exp::FFdin* fdin_next; // Pointer to next free element int tpool + atf_exp::FFdin* cd_fdin_eof_next; // zslist link; -1 means not-in-list + atf_exp::FFdin* cd_fdin_eof_prev; // previous element + atf_exp::FFdin* cd_fdin_read_next; // zslist link; -1 means not-in-list + atf_exp::FFdin* cd_fdin_read_prev; // previous element + atf_exp::FFdin* cd_fdin_suspend_next; // zslist link; -1 means not-in-list + atf_exp::FFdin* cd_fdin_suspend_prev; // previous element + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array + i32 in_start; // beginning of valid bytes (in bytes) + i32 in_end; // end of valid bytes (in bytes) + i32 in_msglen; // current message length + algo::Errcode in_err; // system error code + algo_lib::FIohook in_iohook; // edge-triggered hook for the buffer + bool in_eof; // no more data will be written to buffer + bool in_msgvalid; // current message is valid + bool in_epoll_enable; // use epoll? + // field atf_exp.FFdin.in prevents copy + // func:atf_exp.FFdin..AssignOp + inline atf_exp::FFdin& operator =(const atf_exp::FFdin &rhs) = delete; + // field atf_exp.FFdin.in prevents copy + // func:atf_exp.FFdin..CopyCtor + inline FFdin(const atf_exp::FFdin &rhs) = delete; +private: + // func:atf_exp.FFdin..Ctor + inline FFdin() __attribute__((nothrow)); + // func:atf_exp.FFdin..Dtor + inline ~FFdin() __attribute__((nothrow)); + friend atf_exp::FFdin& fdin_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_exp::FFdin* fdin_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void fdin_Delete(atf_exp::FFdin &row) __attribute__((nothrow)); +}; +``` + +#### atf_exp.FProc - + + +#### atf_exp.FProc Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_exp.FProc.base|[atf_exp.Proc](/txt/exe/atf_exp/internals.md#atf_exp-proc)|[Base](#atf_exp-proc-fields)||| +|atf_exp.FProc.bash|[command.bash_proc](/txt/protocol/command/README.md#command-bash_proc)|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_exp.FProc.in|char|[Fbuf](/txt/exe/amc/reftypes.md#fbuf)|'\n'|| +|atf_exp.FProc.out|char|[Fbuf](/txt/exe/amc/reftypes.md#fbuf)|'\n'|| +|atf_exp.FProc.pid|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_exp.FProc.out_delay_close|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_exp.FProc.output|[algo.ByteAry](/txt/protocol/algo/README.md#algo-byteary)|[Val](/txt/exe/amc/reftypes.md#val)||| +|atf_exp.FProc.wait|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +#### atf_exp.Proc Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_exp.Proc.proc|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FProc + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_exp_gen.h](/include/gen/atf_exp_gen.h) +``` +struct FProc { // atf_exp.FProc + atf_exp::FProc* proc_next; // Pointer to next free element int tpool + atf_exp::FProc* ind_proc_next; // hash next + u32 ind_proc_hashval; // hash value + atf_exp::FProc* zd_proc_next; // zslist link; -1 means not-in-list + atf_exp::FProc* zd_proc_prev; // previous element + atf_exp::FProc* cd_proc_read_next; // zslist link; -1 means not-in-list + atf_exp::FProc* cd_proc_read_prev; // previous element + atf_exp::FProc* cd_proc_outflow_next; // zslist link; -1 means not-in-list + atf_exp::FProc* cd_proc_outflow_prev; // previous element + atf_exp::FProc* ind_proc_pid_next; // hash next + u32 ind_proc_pid_hashval; // hash value + algo::Smallstr50 proc; // + command::bash_proc bash; // + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array + i32 in_start; // beginning of valid bytes (in bytes) + i32 in_end; // end of valid bytes (in bytes) + i32 in_msglen; // current message length + algo::Errcode in_err; // system error code + algo_lib::FIohook in_iohook; // edge-triggered hook for the buffer + bool in_eof; // no more data will be written to buffer + bool in_msgvalid; // current message is valid + bool in_epoll_enable; // use epoll? + u8* out_elems; // NULL pointer to elements of indirect array + u32 out_max; // 0 current length of allocated array + i32 out_start; // beginning of valid bytes (in bytes) + i32 out_end; // end of valid bytes (in bytes) + i32 out_msglen; // current message length + algo::Errcode out_err; // system error code + algo_lib::FIohook out_iohook; // edge-triggered hook for the buffer + u64 out_n_eagain; // eagain counter + bool out_eof; // no more data will be written to buffer + bool out_msgvalid; // current message is valid + bool out_epoll_enable; // use epoll? + bool out_zerocopy; // support zero-copy optimization + i32 pid; // 0 + bool out_delay_close; // false + algo::ByteAry output; // + bool wait; // false + // value field atf_exp.FProc.bash is not copiable + // field atf_exp.FProc.in prevents copy + // field atf_exp.FProc.out prevents copy + // func:atf_exp.FProc..AssignOp + inline atf_exp::FProc& operator =(const atf_exp::FProc &rhs) = delete; + // value field atf_exp.FProc.bash is not copiable + // field atf_exp.FProc.in prevents copy + // field atf_exp.FProc.out prevents copy + // func:atf_exp.FProc..CopyCtor + inline FProc(const atf_exp::FProc &rhs) = delete; +private: + // func:atf_exp.FProc..Ctor + inline FProc() __attribute__((nothrow)); + // func:atf_exp.FProc..Dtor + inline ~FProc() __attribute__((nothrow)); + friend atf_exp::FProc& proc_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend atf_exp::FProc* proc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void proc_Delete(atf_exp::FProc &row) __attribute__((nothrow)); +}; +``` + +#### atf_exp.Proc - + + +#### atf_exp.Proc Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|atf_exp.Proc.proc|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct Proc + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_exp_gen.h](/include/gen/atf_exp_gen.h) +``` +struct Proc { // atf_exp.Proc + algo::Smallstr50 proc; // + // func:atf_exp.Proc..Ctor + inline Proc() __attribute__((nothrow)); +}; +``` + + + diff --git a/txt/exe/atf_fuzz/README.md b/txt/exe/atf_fuzz/README.md index bb74b0de..8930ca25 100644 --- a/txt/exe/atf_fuzz/README.md +++ b/txt/exe/atf_fuzz/README.md @@ -27,8 +27,8 @@ Usage: atf_fuzz [[-target:]] [[-args:]] [options] -in string "data" Input directory or filename, - for stdin -seed int 0 Random seed -testprob double 1 Run each case with this probability - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig diff --git a/txt/exe/atf_fuzz/internals.md b/txt/exe/atf_fuzz/internals.md index a3d9c4d3..9f32d366 100644 --- a/txt/exe/atf_fuzz/internals.md +++ b/txt/exe/atf_fuzz/internals.md @@ -134,8 +134,9 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_fuzz_gen.h](/include/gen/atf_fuzz_gen.h) ``` struct FTarget { // atf_fuzz.FTarget - atf_fuzz::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target + atf_fuzz::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target // func:atf_fuzz.FTarget..AssignOp inline atf_fuzz::FTarget& operator =(const atf_fuzz::FTarget &rhs) = delete; // func:atf_fuzz.FTarget..CopyCtor diff --git a/txt/exe/atf_gcli/README.md b/txt/exe/atf_gcli/README.md index 4a38aa3c..25c8da96 100644 --- a/txt/exe/atf_gcli/README.md +++ b/txt/exe/atf_gcli/README.md @@ -7,7 +7,6 @@   •  [Syntax](#syntax)
  •  [Options](#options)
  •  [Inputs](#inputs)
-  •  [Sources](#sources)
📄 [atf_gcli - Internals](/txt/exe/atf_gcli/internals.md)
@@ -28,8 +27,8 @@ Usage: atf_gcli [options] -skip_init Skip setting local files - already set -skip_git_init Skip setting local files - already set -dry_run Print actions, do not perform - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -77,25 +76,12 @@ Usage: atf_gcli [options] `atf_gcli` takes the following tables on input: |Ssimfile|Comment| |---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| |[gclidb.gclienv](/txt/ssimdb/gclidb/gclienv.md)|| -|[gclidb.gtblact](/txt/ssimdb/gclidb/gtblact.md)|| +|[gclidb.gclienvsub](/txt/ssimdb/gclidb/gclienvsub.md)|| +|[gclidb.gtblact](/txt/ssimdb/gclidb/gtblact.md)|static combination of gcli tables and actions| |[gclidb.gtblacttst](/txt/ssimdb/gclidb/gtblacttst.md)|| |[gclidb.gtblacttstout](/txt/ssimdb/gclidb/gtblacttstout.md)|| -|[gclidb.gclienvsub](/txt/ssimdb/gclidb/gclienvsub.md)|| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -### Sources - -The source code license is GPL -The following source files are part of this tool: - -|Source File|Comment| -|---|---| -|[cpp/atf/atf_gcli.cpp](/cpp/atf/atf_gcli.cpp)|| -|[cpp/gen/atf_gcli_gen.cpp](/cpp/gen/atf_gcli_gen.cpp)|| -|[include/atf_gcli.h](/include/atf_gcli.h)|| -|[include/gen/atf_gcli_gen.h](/include/gen/atf_gcli_gen.h)|| -|[include/gen/atf_gcli_gen.inl.h](/include/gen/atf_gcli_gen.inl.h)|| - diff --git a/txt/exe/atf_gcli/internals.md b/txt/exe/atf_gcli/internals.md index c86a9d56..20d00383 100644 --- a/txt/exe/atf_gcli/internals.md +++ b/txt/exe/atf_gcli/internals.md @@ -1,6 +1,23 @@ ## atf_gcli - Internals +### Table Of Contents + + +* [Description](#description) +* [Sources](#sources) +* [Dependencies](#dependencies) +* [In Memory DB](#in-memory-db) + + + +### Description + + +for usage, see [atf_gcli - test harness for gcli](/txt/exe/atf_gcli/README.md) + + + ### Sources @@ -9,7 +26,7 @@ The following source files are part of this tool: |Source File|Comment| |---|---| -|[cpp/atf/atf_gcli.cpp](/cpp/atf/atf_gcli.cpp)|| +|[cpp/atf_gcli/atf_gcli.cpp](/cpp/atf_gcli/atf_gcli.cpp)|| |[cpp/gen/atf_gcli_gen.cpp](/cpp/gen/atf_gcli_gen.cpp)|| |[include/atf_gcli.h](/include/atf_gcli.h)|| |[include/gen/atf_gcli_gen.h](/include/gen/atf_gcli_gen.h)|| @@ -124,13 +141,14 @@ struct FDb { // atf_gcli.FDb: In-memory database for atf_gcli Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_gcli_gen.h](/include/gen/atf_gcli_gen.h) ``` struct FGclienv { // atf_gcli.FGclienv - atf_gcli::FGclienv* ind_gclienv_next; // hash next - algo::Smallstr50 gclienv; // - algo::cstring addon; // - algo::Comment comment; // - atf_gcli::FGclienvsub** c_gclienvsub_elems; // array of pointers - u32 c_gclienvsub_n; // array of pointers - u32 c_gclienvsub_max; // capacity of allocated array + atf_gcli::FGclienv* ind_gclienv_next; // hash next + u32 ind_gclienv_hashval; // hash value + algo::Smallstr50 gclienv; // + algo::cstring addon; // + algo::Comment comment; // + atf_gcli::FGclienvsub** c_gclienvsub_elems; // array of pointers + u32 c_gclienvsub_n; // array of pointers + u32 c_gclienvsub_max; // capacity of allocated array // reftype Ptrary of atf_gcli.FGclienv.c_gclienvsub prohibits copy // func:atf_gcli.FGclienv..AssignOp inline atf_gcli::FGclienv& operator =(const atf_gcli::FGclienv &rhs) = delete; @@ -166,6 +184,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_gcli_gen.h](/in ``` struct FGclienvsub { // atf_gcli.FGclienvsub atf_gcli::FGclienvsub* ind_gclienvsub_next; // hash next + u32 ind_gclienvsub_hashval; // hash value algo::Smallstr50 gclienvsub; // bool fwd; // false bool rev; // false @@ -187,7 +206,7 @@ private: }; ``` -#### atf_gcli.FGtblact - +#### atf_gcli.FGtblact - static combination of gcli tables and actions #### atf_gcli.FGtblact Fields @@ -207,15 +226,16 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_gcli_gen.h](/include/gen/atf_gcli_gen.h) ``` struct FGtblact { // atf_gcli.FGtblact - atf_gcli::FGtblact* ind_gtblact_next; // hash next - algo::Smallstr50 gtblact; // - bool t; // false - bool e; // false - bool auth; // false - u32 glab_fail; // 0 - u32 glab_run; // 0 - u32 ghub_run; // 0 - u32 ghub_fail; // 0 + atf_gcli::FGtblact* ind_gtblact_next; // hash next + u32 ind_gtblact_hashval; // hash value + algo::Smallstr50 gtblact; // + bool t; // false + bool e; // false + bool auth; // false + u32 glab_fail; // 0 + u32 glab_run; // 0 + u32 ghub_run; // 0 + u32 ghub_fail; // 0 // func:atf_gcli.FGtblact..AssignOp atf_gcli::FGtblact& operator =(const atf_gcli::FGtblact &rhs) = delete; // func:atf_gcli.FGtblact..CopyCtor @@ -253,19 +273,20 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_gcli_gen.h](/include/gen/atf_gcli_gen.h) ``` struct FGtblacttst { // atf_gcli.FGtblacttst - atf_gcli::FGtblacttst* ind_gtblacttst_next; // hash next - algo::Smallstr250 gtblacttst; // - bool working; // true - algo::cstring cmd; // - algo::Comment comment; // - bool fail; // false - atf_gcli::FGtblacttstout** c_gtblacttstout_elems; // array of pointers - u32 c_gtblacttstout_n; // array of pointers - u32 c_gtblacttstout_max; // capacity of allocated array - bool select; // false - atf_gcli::FGclienv* p_gclienv; // reference to parent row - atf_gcli::FGtblact* p_gtblact; // reference to parent row - bool _db_c_gtblacttst_in_ary; // false membership flag + atf_gcli::FGtblacttst* ind_gtblacttst_next; // hash next + u32 ind_gtblacttst_hashval; // hash value + algo::Smallstr250 gtblacttst; // + bool working; // true + algo::cstring cmd; // + algo::Comment comment; // + bool fail; // false + atf_gcli::FGtblacttstout** c_gtblacttstout_elems; // array of pointers + u32 c_gtblacttstout_n; // array of pointers + u32 c_gtblacttstout_max; // capacity of allocated array + bool select; // false + atf_gcli::FGclienv* p_gclienv; // reference to parent row + atf_gcli::FGtblact* p_gtblact; // reference to parent row + bool c_gtblacttst_in_ary; // false membership flag // reftype Ptrary of atf_gcli.FGtblacttst.c_gtblacttstout prohibits copy // x-reference on atf_gcli.FGtblacttst.p_gclienv prevents copy // x-reference on atf_gcli.FGtblacttst.p_gtblact prevents copy @@ -306,6 +327,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_gcli_gen.h](/in ``` struct FGtblacttstout { // atf_gcli.FGtblacttstout atf_gcli::FGtblacttstout* ind_gtblacttstout_next; // hash next + u32 ind_gtblacttstout_hashval; // hash value algo::Smallstr250 gtblacttstout; // algo::cstring text; // algo::cstring tout; // diff --git a/txt/exe/atf_nrun/README.md b/txt/exe/atf_nrun/README.md index a64be3f7..5e26e8bd 100644 --- a/txt/exe/atf_nrun/README.md +++ b/txt/exe/atf_nrun/README.md @@ -21,8 +21,8 @@ Usage: atf_nrun [[-ncmd:]] [options] -in string "data" Input directory or filename, - for stdin -maxjobs int 2 Number of simultaneous jobs [ncmd] int 6 - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig diff --git a/txt/exe/atf_nrun/internals.md b/txt/exe/atf_nrun/internals.md index 1152147a..efba1ebe 100644 --- a/txt/exe/atf_nrun/internals.md +++ b/txt/exe/atf_nrun/internals.md @@ -105,19 +105,20 @@ struct FDb { // atf_nrun.FDb: In-memory database for atf_nrun Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_nrun_gen.h](/include/gen/atf_nrun_gen.h) ``` struct FEntry { // atf_nrun.FEntry - atf_nrun::FEntry* ind_running_next; // hash next - atf_nrun::FEntry* zd_todo_next; // zslist link; -1 means not-in-list - atf_nrun::FEntry* zd_todo_prev; // previous element - algo::cstring command; // Command to execute - i32 pid; // 0 Pid of running bash job - algo::cstring job_path; // "bin/bash" path for executable - command::bash job_cmd; // command line for child process - algo::cstring job_fstdin; // redirect for stdin - algo::cstring job_fstdout; // redirect for stdout - algo::cstring job_fstderr; // redirect for stderr - pid_t job_pid; // 0 pid of running child process - i32 job_timeout; // 0 optional timeout for child process - i32 job_status; // 0 last exit status of child process + atf_nrun::FEntry* ind_running_next; // hash next + u32 ind_running_hashval; // hash value + atf_nrun::FEntry* zd_todo_next; // zslist link; -1 means not-in-list + atf_nrun::FEntry* zd_todo_prev; // previous element + algo::cstring command; // Command to execute + i32 pid; // 0 Pid of running bash job + algo::cstring job_path; // "bin/bash" path for executable + command::bash job_cmd; // command line for child process + algo::cstring job_fstdin; // redirect for stdin + algo::cstring job_fstdout; // redirect for stdout + algo::cstring job_fstderr; // redirect for stderr + pid_t job_pid; // 0 pid of running child process + i32 job_timeout; // 0 optional timeout for child process + i32 job_status; // 0 last exit status of child process // reftype Exec of atf_nrun.FEntry.job prohibits copy // func:atf_nrun.FEntry..AssignOp atf_nrun::FEntry& operator =(const atf_nrun::FEntry &rhs) = delete; diff --git a/txt/exe/atf_unit/README.md b/txt/exe/atf_unit/README.md index 7c08e9cc..8928c224 100644 --- a/txt/exe/atf_unit/README.md +++ b/txt/exe/atf_unit/README.md @@ -28,8 +28,8 @@ Usage: atf_unit [[-unittest:]] [options] -report Y Print final report -capture Re-capture test results -check_untracked Y Check for untracked file before allowing test to run - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -80,9 +80,9 @@ Usage: atf_unit [[-unittest:]] [options] `atf_unit` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[fmdb.alm_objtype](/txt/ssimdb/fmdb/alm_objtype.md)|Alarm resource type| -|[fmdb.alm_code](/txt/ssimdb/fmdb/alm_code.md)|| |[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[fmdb.alm_code](/txt/ssimdb/fmdb/alm_code.md)|| +|[fmdb.alm_objtype](/txt/ssimdb/fmdb/alm_objtype.md)|Alarm resource type| diff --git a/txt/exe/atf_unit/internals.md b/txt/exe/atf_unit/internals.md index 8db65ecf..c6d70687 100644 --- a/txt/exe/atf_unit/internals.md +++ b/txt/exe/atf_unit/internals.md @@ -36,8 +36,10 @@ The following source files are part of this tool: |[cpp/atf_unit/decimal.cpp](/cpp/atf_unit/decimal.cpp)|| |[cpp/atf_unit/fm.cpp](/cpp/atf_unit/fm.cpp)|| |[cpp/atf_unit/lib_ams.cpp](/cpp/atf_unit/lib_ams.cpp)|| +|[cpp/atf_unit/lib_curl.cpp](/cpp/atf_unit/lib_curl.cpp)|| |[cpp/atf_unit/lib_exec.cpp](/cpp/atf_unit/lib_exec.cpp)|| |[cpp/atf_unit/lib_json.cpp](/cpp/atf_unit/lib_json.cpp)|| +|[cpp/atf_unit/lib_netio.cpp](/cpp/atf_unit/lib_netio.cpp)|| |[cpp/atf_unit/lib_sql.cpp](/cpp/atf_unit/lib_sql.cpp)|| |[cpp/atf_unit/line.cpp](/cpp/atf_unit/line.cpp)|| |[cpp/atf_unit/lockfile.cpp](/cpp/atf_unit/lockfile.cpp)|| @@ -61,9 +63,11 @@ The build target depends on the following libraries |Target|Comment| |---|---| |[lib_ams](/txt/lib/lib_ams/README.md)|Library for AMS middleware, supporting file format & messaging| +|[lib_curl](/txt/lib/lib_curl/README.md)|covers curl_easy| |[lib_exec](/txt/lib/lib_exec/README.md)|Build and run a dag of subprocesses with N parallel jobs| |[lib_fm](/txt/lib/lib_fm/README.md)|Library for dynamic alarm management| |[lib_json](/txt/lib/lib_json/README.md)|Full json support library| +|[lib_netio](/txt/lib/lib_netio/README.md)|Network I/O library| |[lib_sql](/txt/lib/lib_sql/README.md)|SQL formatting functions| @@ -291,14 +295,15 @@ struct FPerfSort { // atf_unit.FPerfSort: Function to test double sorting Generated by [amc](/txt/exe/amc/README.md) into [include/gen/atf_unit_gen.h](/include/gen/atf_unit_gen.h) ``` struct FUnittest { // atf_unit.FUnittest: Test function - atf_unit::FUnittest* ind_unittest_next; // hash next - algo::Smallstr50 unittest; // - algo::Comment comment; // - bool select; // false Select test for running? - atf_unit::unittest_step_hook step; // NULL Pointer to a function - bool success; // false - algo::cstring error; // - lib_exec::FSyscmd* c_syscmd; // optional pointer + atf_unit::FUnittest* ind_unittest_next; // hash next + u32 ind_unittest_hashval; // hash value + algo::Smallstr50 unittest; // + algo::Comment comment; // + bool select; // false Select test for running? + atf_unit::unittest_step_hook step; // NULL Pointer to a function + bool success; // false + algo::cstring error; // + lib_exec::FSyscmd* c_syscmd; // optional pointer // reftype Hook of atf_unit.FUnittest.step prohibits copy // func:atf_unit.FUnittest..AssignOp atf_unit::FUnittest& operator =(const atf_unit::FUnittest &rhs) = delete; diff --git a/txt/exe/bash2html/README.md b/txt/exe/bash2html/README.md index 9a7cff76..fd694f5a 100644 --- a/txt/exe/bash2html/README.md +++ b/txt/exe/bash2html/README.md @@ -20,8 +20,8 @@ Usage: bash2html [options] OPTION TYPE DFLT COMMENT -in string "data" Input directory or filename, - for stdin -test Produce Test Output - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig diff --git a/txt/exe/gcache/README.md b/txt/exe/gcache/README.md index a3ad8d3d..a8f4fc59 100644 --- a/txt/exe/gcache/README.md +++ b/txt/exe/gcache/README.md @@ -43,8 +43,8 @@ Usage: gcache [[-cmd:]] [options] -after string Start time for reporting -report Show end-of-run report -force Force recompile and update cache - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig diff --git a/txt/exe/gcli/README.md b/txt/exe/gcli/README.md index 136462f9..f77081f7 100644 --- a/txt/exe/gcli/README.md +++ b/txt/exe/gcli/README.md @@ -11,6 +11,7 @@ Examples are provided below   •  [Syntax](#syntax)
  •  [Operation](#operation)
+  •  [Starting](#starting)
  •  [Example: Get help (beyond command syntax)](#example-get-help--beyond-command-syntax-)
  •  [Example: Get detailed help](#example-get-detailed-help)
  •  [Example: create access to repository](#example-create-access-to-repository)
@@ -37,7 +38,6 @@ Examples are provided below   •  [Example: list remote users](#example-list-remote-users)
  •  [Options](#options)
  •  [Inputs](#inputs)
-  •  [Sources](#sources)
📄 [gcli - Internals](/txt/exe/gcli/internals.md)
@@ -52,7 +52,7 @@ Usage: gcli [[-selector:]] [[-fields:]] [options] -in string "data" Input directory or filename, - for stdin [selector] string "issue:%" table:key, where table is issue,repo,mr, etc. and key is a regex. [fields]... string additional key:value pairs for use with -create, -list, -update - -accept (action) accept a slected merge request + -accept (action) accept a selected merge request -start (action) start working on a selected issue -list (action) show selected table -create (action) create a table record(s) @@ -66,8 +66,8 @@ Usage: gcli [[-selector:]] [[-fields:]] [options] -dry_run Print actions, do not perform -gitdir string "" (setup) Change directory of git repository -show_gitlab_system_notes (misc) Show issue and mr notes created by gitlab - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -86,6 +86,14 @@ pair `[table]:[key]` identifying the table on which to perform an action; Table is by default `issue`, but can be any table from the list provided by `gcli help`. Key is a regex. Actions can be `-create`, `-update`, `-start`, `-e`, etc. +### Starting + +First a user have to create access token and ssh key on user's (not prject!) account and run gcli command repo -create to populate grepo table. +`gcli` is governed by grepo table that is set up by executing gcli repo -create host:xxx token:yyy command. +After the command is successfully executed, gcli gitconfig -create will populate git remote with the right hosts and ports for accessing gitlab or github + +execute these commands with -dry_run option to see what they do. + ### Example: Get help (beyond command syntax) @@ -400,7 +408,7 @@ gcli user #### -fields -- additional key:value pairs for use with -create, -list, -update -#### -accept -- (action) accept a slected merge request +#### -accept -- (action) accept a selected merge request #### -start -- (action) start working on a selected issue @@ -450,45 +458,19 @@ gcli user `gcli` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[gclidb.gtype](/txt/ssimdb/gclidb/gtype.md)|Platform type (ghp=github; glpat=gitlab)| -|[gclidb.gtypeprefix](/txt/ssimdb/gclidb/gtypeprefix.md)|Token prefix mapping to platform| -|[gclidb.gtypeh](/txt/ssimdb/gclidb/gtypeh.md)|HTTP heaaderes for user with platform| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| |[gclidb.gact](/txt/ssimdb/gclidb/gact.md)|Action that may be performed on a table| -|[gclidb.gtbl](/txt/ssimdb/gclidb/gtbl.md)|Supported gcli tables| +|[gclidb.gclicmdf2j](/txt/ssimdb/gclidb/gclicmdf2j.md)|Mapping of internal fields to JSON fields for gitlab/github| +|[gclidb.gclicmdt](/txt/ssimdb/gclidb/gclicmdt.md)|Internal test| |[gclidb.gfld](/txt/ssimdb/gclidb/gfld.md)|Gitlab/github field name| -|[gclidb.gtblactfld](/txt/ssimdb/gclidb/gtblactfld.md)|List of available for each table & action combination| -|[gclidb.gstatet](/txt/ssimdb/gclidb/gstatet.md)|Internal| -|[gclidb.grepossh](/txt/ssimdb/gclidb/grepossh.md)|Ssh key table| -|[gclidb.grepogitport](/txt/ssimdb/gclidb/grepogitport.md)|Default ports for repositories| -|[gclidb.grepo](/txt/ssimdb/gclidb/grepo.md)|Repo table (acr grepo -in ~/.ssim)| |[gclidb.gmethod](/txt/ssimdb/gclidb/gmethod.md)|HTTP method list| -|[gclidb.gclicmdt](/txt/ssimdb/gclidb/gclicmdt.md)|Internal test| -|[gclidb.gclicmdf2j](/txt/ssimdb/gclidb/gclicmdf2j.md)|Mapping of internal fields to JSON fields for gitlab/github| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[gclidb.grepo](/txt/ssimdb/gclidb/grepo.md)|Repo table (acr grepo -in ~/.ssim)| +|[gclidb.gstatet](/txt/ssimdb/gclidb/gstatet.md)|Internal| +|[gclidb.gtbl](/txt/ssimdb/gclidb/gtbl.md)|Supported gcli tables| +|[gclidb.gtblactfld](/txt/ssimdb/gclidb/gtblactfld.md)|List of available for each table & action combination| +|[gclidb.gtype](/txt/ssimdb/gclidb/gtype.md)|Platform type (ghp=github; glpat=gitlab)| +|[gclidb.gtypeh](/txt/ssimdb/gclidb/gtypeh.md)|HTTP heaaderes for user with platform| +|[gclidb.gtypeprefix](/txt/ssimdb/gclidb/gtypeprefix.md)|Token prefix mapping to platform| -### Sources - -The source code license is GPL -The following source files are part of this tool: - -|Source File|Comment| -|---|---| -|[cpp/gcli/git.cpp](/cpp/gcli/git.cpp)|| -|[cpp/gcli/gtblact.cpp](/cpp/gcli/gtblact.cpp)|| -|[cpp/gcli/help.cpp](/cpp/gcli/help.cpp)|| -|[cpp/gcli/issue.cpp](/cpp/gcli/issue.cpp)|| -|[cpp/gcli/main.cpp](/cpp/gcli/main.cpp)|| -|[cpp/gcli/milestone.cpp](/cpp/gcli/milestone.cpp)|| -|[cpp/gcli/mr.cpp](/cpp/gcli/mr.cpp)|| -|[cpp/gcli/note.cpp](/cpp/gcli/note.cpp)|| -|[cpp/gcli/repo.cpp](/cpp/gcli/repo.cpp)|| -|[cpp/gcli/rest.cpp](/cpp/gcli/rest.cpp)|| -|[cpp/gcli/search.cpp](/cpp/gcli/search.cpp)|| -|[cpp/gcli/user.cpp](/cpp/gcli/user.cpp)|| -|[cpp/gen/gcli_gen.cpp](/cpp/gen/gcli_gen.cpp)|| -|[include/gcli.h](/include/gcli.h)|| -|[include/gen/gcli_gen.h](/include/gen/gcli_gen.h)|| -|[include/gen/gcli_gen.inl.h](/include/gen/gcli_gen.inl.h)|| - diff --git a/txt/exe/gcli/internals.md b/txt/exe/gcli/internals.md index 5569c7a8..acd83771 100644 --- a/txt/exe/gcli/internals.md +++ b/txt/exe/gcli/internals.md @@ -1,6 +1,23 @@ ## gcli - Internals +### Table Of Contents + + +* [Description](#description) +* [Sources](#sources) +* [Dependencies](#dependencies) +* [In Memory DB](#in-memory-db) + + + +### Description + + +for usage, see [gcli - Gcli - gitlab/github command-line client](/txt/exe/gcli/README.md) + + + ### Sources @@ -70,8 +87,6 @@ All allocations are done through global `gcli::_db` [gcli.FDb](#gcli-fdb) struct |[gcli.FGithost](#gcli-fgithost)||FDb.githost (Lary)|githost (Lary, by rowid)|ind_githost (Thash, hash field githost)| |[gcli.FGmethod](#gcli-fgmethod)|[gclidb.gmethod](/txt/ssimdb/gclidb/gmethod.md)|FDb.gmethod (Lary)|gmethod (Lary, by rowid)|ind_gmethod (Thash, hash field gmethod)| |[gcli.FGrepo](#gcli-fgrepo)|[gclidb.grepo](/txt/ssimdb/gclidb/grepo.md)|FDb.grepo (Lary)|ind_grepo (Thash, hash field grepo)|grepo (Lary, by rowid)| -|[gcli.FGrepogitport](#gcli-fgrepogitport)|[gclidb.grepogitport](/txt/ssimdb/gclidb/grepogitport.md)|FDb.grepogitport (Lary)|grepogitport (Lary, by rowid)|ind_grepogitport (Thash, hash field grepogitport)| -|[gcli.FGrepossh](#gcli-fgrepossh)|[gclidb.grepossh](/txt/ssimdb/gclidb/grepossh.md)|FDb.grepossh (Lary)|grepossh (Lary, by rowid)|ind_grepossh (Thash, hash field grepossh)| |[gcli.FGstatet](#gcli-fgstatet)|[gclidb.gstatet](/txt/ssimdb/gclidb/gstatet.md)|FDb.gstatet (Lary)|gstatet (Lary, by rowid)|ind_gstatet (Thash, hash field gstatet)| |[gcli.FGtbl](#gcli-fgtbl)|[gclidb.gtbl](/txt/ssimdb/gclidb/gtbl.md)|FDb.gtbl (Lary)|p_gtbl (Ptr)|gtbl (Lary, by rowid)|ind_gtbl (Thash, hash field gtbl)| |[gcli.FGtblact](#gcli-fgtblact)|[gclidb.gtblact](/txt/ssimdb/gclidb/gtblact.md)|FDb.gtblact (Lary)|**static**|gtblact (Lary, by rowid)|ind_gtblact (Thash, hash field gtblact)|zd_gtblact (Llist)| @@ -115,8 +130,6 @@ All allocations are done through global `gcli::_db` [gcli.FDb](#gcli-fdb) struct |gcli.FDb._db|[gcli.FDb](/txt/exe/gcli/internals.md#gcli-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| |gcli.FDb.cmdline|[command.gcli](/txt/protocol/command/README.md#command-gcli)|[Val](/txt/exe/amc/reftypes.md#val)||| |gcli.FDb.gtype|[gcli.FGtype](/txt/exe/gcli/internals.md#gcli-fgtype)|[Lary](/txt/exe/amc/reftypes.md#lary)||| -|gcli.FDb.grepossh|[gcli.FGrepossh](/txt/exe/gcli/internals.md#gcli-fgrepossh)|[Lary](/txt/exe/amc/reftypes.md#lary)||| -|gcli.FDb.grepogitport|[gcli.FGrepogitport](/txt/exe/gcli/internals.md#gcli-fgrepogitport)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |gcli.FDb.githost|[gcli.FGithost](/txt/exe/gcli/internals.md#gcli-fgithost)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |gcli.FDb.need_auth|bool|[Val](/txt/exe/amc/reftypes.md#val)||| |gcli.FDb.gstatet|[gcli.FGstatet](/txt/exe/gcli/internals.md#gcli-fgstatet)|[Lary](/txt/exe/amc/reftypes.md#lary)||| @@ -138,8 +151,6 @@ All allocations are done through global `gcli::_db` [gcli.FDb](#gcli-fdb) struct |gcli.FDb.regx_repo|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|| |gcli.FDb.ind_gstatet|[gcli.FGstatet](/txt/exe/gcli/internals.md#gcli-fgstatet)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |gcli.FDb.ind_githost|[gcli.FGithost](/txt/exe/gcli/internals.md#gcli-fgithost)|[Thash](/txt/exe/amc/reftypes.md#thash)||| -|gcli.FDb.ind_grepogitport|[gcli.FGrepogitport](/txt/exe/gcli/internals.md#gcli-fgrepogitport)|[Thash](/txt/exe/amc/reftypes.md#thash)||| -|gcli.FDb.ind_grepossh|[gcli.FGrepossh](/txt/exe/gcli/internals.md#gcli-fgrepossh)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |gcli.FDb.ind_gtype|[gcli.FGtype](/txt/exe/gcli/internals.md#gcli-fgtype)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |gcli.FDb.home|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||User's HOME directory| |gcli.FDb.auth_file|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| @@ -187,160 +198,150 @@ All allocations are done through global `gcli::_db` [gcli.FDb](#gcli-fdb) struct Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FDb { // gcli.FDb: In-memory database for gcli - command::gcli cmdline; // - gcli::FGtype* gtype_lary[32]; // level array - i32 gtype_n; // number of elements in array - gcli::FGrepossh* grepossh_lary[32]; // level array - i32 grepossh_n; // number of elements in array - gcli::FGrepogitport* grepogitport_lary[32]; // level array - i32 grepogitport_n; // number of elements in array - gcli::FGithost* githost_lary[32]; // level array - i32 githost_n; // number of elements in array - bool need_auth; // false - gcli::FGstatet* gstatet_lary[32]; // level array - i32 gstatet_n; // number of elements in array - gcli::FGmethod* gmethod_lary[32]; // level array - i32 gmethod_n; // number of elements in array - gcli::FGclicmdt* gclicmdt_lary[32]; // level array - i32 gclicmdt_n; // number of elements in array - gcli::FGclicmdf* gclicmdf_lary[32]; // level array - i32 gclicmdf_n; // number of elements in array - gcli::FGclicmdf2j* gclicmdf2j_lary[32]; // level array - i32 gclicmdf2j_n; // number of elements in array - gcli::FGclicmd* gclicmd_lary[32]; // level array - i32 gclicmd_n; // number of elements in array - gcli::FGtypeh* gtypeh_lary[32]; // level array - i32 gtypeh_n; // number of elements in array - gcli::FGtype* p_gtype; // optional pointer - gcli::FGtbl* p_gtbl; // optional pointer - gclidb::Grepo grepo_sel; // - gcli::FGclicmd** ind_gclicmd_buckets_elems; // pointer to bucket array - i32 ind_gclicmd_buckets_n; // number of elements in bucket array - i32 ind_gclicmd_n; // number of elements in the hash table - gcli::FGclicmdf** ind_gclicmdf_buckets_elems; // pointer to bucket array - i32 ind_gclicmdf_buckets_n; // number of elements in bucket array - i32 ind_gclicmdf_n; // number of elements in the hash table - gcli::FGclicmdt** ind_gclicmdt_buckets_elems; // pointer to bucket array - i32 ind_gclicmdt_buckets_n; // number of elements in bucket array - i32 ind_gclicmdt_n; // number of elements in the hash table - gcli::FGmethod** ind_gmethod_buckets_elems; // pointer to bucket array - i32 ind_gmethod_buckets_n; // number of elements in bucket array - i32 ind_gmethod_n; // number of elements in the hash table - gcli::FGrepo** ind_grepo_buckets_elems; // pointer to bucket array - i32 ind_grepo_buckets_n; // number of elements in bucket array - i32 ind_grepo_n; // number of elements in the hash table - gcli::FIssue** ind_issue_buckets_elems; // pointer to bucket array - i32 ind_issue_buckets_n; // number of elements in bucket array - i32 ind_issue_n; // number of elements in the hash table - algo_lib::Regx regx_repo; // "%" Sql Regx - gcli::FGstatet** ind_gstatet_buckets_elems; // pointer to bucket array - i32 ind_gstatet_buckets_n; // number of elements in bucket array - i32 ind_gstatet_n; // number of elements in the hash table - gcli::FGithost** ind_githost_buckets_elems; // pointer to bucket array - i32 ind_githost_buckets_n; // number of elements in bucket array - i32 ind_githost_n; // number of elements in the hash table - gcli::FGrepogitport** ind_grepogitport_buckets_elems; // pointer to bucket array - i32 ind_grepogitport_buckets_n; // number of elements in bucket array - i32 ind_grepogitport_n; // number of elements in the hash table - gcli::FGrepossh** ind_grepossh_buckets_elems; // pointer to bucket array - i32 ind_grepossh_buckets_n; // number of elements in bucket array - i32 ind_grepossh_n; // number of elements in the hash table - gcli::FGtype** ind_gtype_buckets_elems; // pointer to bucket array - i32 ind_gtype_buckets_n; // number of elements in bucket array - i32 ind_gtype_n; // number of elements in the hash table - algo::cstring home; // User's HOME directory - algo::cstring auth_file; // - algo::cstring edit_file; // - gcli::FGclicmd** c_gclicmd_elems; // array of pointers - u32 c_gclicmd_n; // array of pointers - u32 c_gclicmd_max; // capacity of allocated array - algo::cstring unix_user; // UNIX user login name - algo::cstring editor; // Command line to invoke editor - gcli::FGclicmdj2f* gclicmdj2f_lary[32]; // level array - i32 gclicmdj2f_n; // number of elements in array - gcli::FGclicmdc* gclicmdc_lary[32]; // level array - i32 gclicmdc_n; // number of elements in array - gcli::FGclicmdarg* gclicmdarg_lary[32]; // level array - i32 gclicmdarg_n; // number of elements in array - gcli::FGclicmdj2f** ind_gclicmdj2f_buckets_elems; // pointer to bucket array - i32 ind_gclicmdj2f_buckets_n; // number of elements in bucket array - i32 ind_gclicmdj2f_n; // number of elements in the hash table - gcli::FGclicmdarg** ind_gclicmdarg_buckets_elems; // pointer to bucket array - i32 ind_gclicmdarg_buckets_n; // number of elements in bucket array - i32 ind_gclicmdarg_n; // number of elements in the hash table - gcli::FGclicmdc** ind_gclicmdc_buckets_elems; // pointer to bucket array - i32 ind_gclicmdc_buckets_n; // number of elements in bucket array - i32 ind_gclicmdc_n; // number of elements in the hash table - gcli::FIssue* issue_lary[32]; // level array - i32 issue_n; // number of elements in array - gcli::FGrepo* grepo_lary[32]; // level array - i32 grepo_n; // number of elements in array - gcli::FTuples* tuples_lary[32]; // level array - i32 tuples_n; // number of elements in array - gcli::FIssuenote* issuenote_lary[32]; // level array - i32 issuenote_n; // number of elements in array - gcli::FMrjob* mrjob_lary[32]; // level array - i32 mrjob_n; // number of elements in array - gcli::FMrnote* mrnote_lary[32]; // level array - i32 mrnote_n; // number of elements in array - gcli::FMrnote** ind_mrnote_buckets_elems; // pointer to bucket array - i32 ind_mrnote_buckets_n; // number of elements in bucket array - i32 ind_mrnote_n; // number of elements in the hash table - gcli::FIssuenote** ind_issuenote_buckets_elems; // pointer to bucket array - i32 ind_issuenote_buckets_n; // number of elements in bucket array - i32 ind_issuenote_n; // number of elements in the hash table - gcli::FMrjob** ind_mrjob_buckets_elems; // pointer to bucket array - i32 ind_mrjob_buckets_n; // number of elements in bucket array - i32 ind_mrjob_n; // number of elements in the hash table - gcli::FUser* user_lary[32]; // level array - i32 user_n; // number of elements in array - gcli::FUser** ind_user_buckets_elems; // pointer to bucket array - i32 ind_user_buckets_n; // number of elements in bucket array - i32 ind_user_n; // number of elements in the hash table - gcli::FMr** ind_mr_buckets_elems; // pointer to bucket array - i32 ind_mr_buckets_n; // number of elements in bucket array - i32 ind_mr_n; // number of elements in the hash table - gcli::FMilestone** ind_milestone_buckets_elems; // pointer to bucket array - i32 ind_milestone_buckets_n; // number of elements in bucket array - i32 ind_milestone_n; // number of elements in the hash table - gcli::FMilestone* milestone_lary[32]; // level array - i32 milestone_n; // number of elements in array - gcli::FMr* mr_lary[32]; // level array - i32 mr_n; // number of elements in array - gcli::FGtypeprefix* gtypeprefix_lary[32]; // level array - i32 gtypeprefix_n; // number of elements in array - gcli::FGtblact* gtblact_lary[32]; // level array - i32 gtblact_n; // number of elements in array - gcli::FGtblactfld* gtblactfld_lary[32]; // level array - i32 gtblactfld_n; // number of elements in array - gcli::FGtblact** ind_gtblact_buckets_elems; // pointer to bucket array - i32 ind_gtblact_buckets_n; // number of elements in bucket array - i32 ind_gtblact_n; // number of elements in the hash table - gcli::FGtblact* zd_gtblact_head; // zero-terminated doubly linked list - i32 zd_gtblact_n; // zero-terminated doubly linked list - gcli::FGtblact* zd_gtblact_tail; // pointer to last element - gcli::FGtblactfld** ind_gtblactfld_buckets_elems; // pointer to bucket array - i32 ind_gtblactfld_buckets_n; // number of elements in bucket array - i32 ind_gtblactfld_n; // number of elements in the hash table - gcli::FGfld* gfld_lary[32]; // level array - i32 gfld_n; // number of elements in array - gcli::FGfld** ind_gfld_buckets_elems; // pointer to bucket array - i32 ind_gfld_buckets_n; // number of elements in bucket array - i32 ind_gfld_n; // number of elements in the hash table - gcli::FGfld** c_gfld_elems; // array of pointers - u32 c_gfld_n; // array of pointers - u32 c_gfld_max; // capacity of allocated array - gcli::FGtbl* gtbl_lary[32]; // level array - i32 gtbl_n; // number of elements in array - gcli::FGtbl** ind_gtbl_buckets_elems; // pointer to bucket array - i32 ind_gtbl_buckets_n; // number of elements in bucket array - i32 ind_gtbl_n; // number of elements in the hash table - gcli::FGact* gact_lary[32]; // level array - i32 gact_n; // number of elements in array - gcli::FGact** ind_gact_buckets_elems; // pointer to bucket array - i32 ind_gact_buckets_n; // number of elements in bucket array - i32 ind_gact_n; // number of elements in the hash table - gcli::trace trace; // + command::gcli cmdline; // + gcli::FGtype* gtype_lary[32]; // level array + i32 gtype_n; // number of elements in array + gcli::FGithost* githost_lary[32]; // level array + i32 githost_n; // number of elements in array + bool need_auth; // false + gcli::FGstatet* gstatet_lary[32]; // level array + i32 gstatet_n; // number of elements in array + gcli::FGmethod* gmethod_lary[32]; // level array + i32 gmethod_n; // number of elements in array + gcli::FGclicmdt* gclicmdt_lary[32]; // level array + i32 gclicmdt_n; // number of elements in array + gcli::FGclicmdf* gclicmdf_lary[32]; // level array + i32 gclicmdf_n; // number of elements in array + gcli::FGclicmdf2j* gclicmdf2j_lary[32]; // level array + i32 gclicmdf2j_n; // number of elements in array + gcli::FGclicmd* gclicmd_lary[32]; // level array + i32 gclicmd_n; // number of elements in array + gcli::FGtypeh* gtypeh_lary[32]; // level array + i32 gtypeh_n; // number of elements in array + gcli::FGtype* p_gtype; // optional pointer + gcli::FGtbl* p_gtbl; // optional pointer + gclidb::Grepo grepo_sel; // + gcli::FGclicmd** ind_gclicmd_buckets_elems; // pointer to bucket array + i32 ind_gclicmd_buckets_n; // number of elements in bucket array + i32 ind_gclicmd_n; // number of elements in the hash table + gcli::FGclicmdf** ind_gclicmdf_buckets_elems; // pointer to bucket array + i32 ind_gclicmdf_buckets_n; // number of elements in bucket array + i32 ind_gclicmdf_n; // number of elements in the hash table + gcli::FGclicmdt** ind_gclicmdt_buckets_elems; // pointer to bucket array + i32 ind_gclicmdt_buckets_n; // number of elements in bucket array + i32 ind_gclicmdt_n; // number of elements in the hash table + gcli::FGmethod** ind_gmethod_buckets_elems; // pointer to bucket array + i32 ind_gmethod_buckets_n; // number of elements in bucket array + i32 ind_gmethod_n; // number of elements in the hash table + gcli::FGrepo** ind_grepo_buckets_elems; // pointer to bucket array + i32 ind_grepo_buckets_n; // number of elements in bucket array + i32 ind_grepo_n; // number of elements in the hash table + gcli::FIssue** ind_issue_buckets_elems; // pointer to bucket array + i32 ind_issue_buckets_n; // number of elements in bucket array + i32 ind_issue_n; // number of elements in the hash table + algo_lib::Regx regx_repo; // "%" Sql Regx + gcli::FGstatet** ind_gstatet_buckets_elems; // pointer to bucket array + i32 ind_gstatet_buckets_n; // number of elements in bucket array + i32 ind_gstatet_n; // number of elements in the hash table + gcli::FGithost** ind_githost_buckets_elems; // pointer to bucket array + i32 ind_githost_buckets_n; // number of elements in bucket array + i32 ind_githost_n; // number of elements in the hash table + gcli::FGtype** ind_gtype_buckets_elems; // pointer to bucket array + i32 ind_gtype_buckets_n; // number of elements in bucket array + i32 ind_gtype_n; // number of elements in the hash table + algo::cstring home; // User's HOME directory + algo::cstring auth_file; // + algo::cstring edit_file; // + gcli::FGclicmd** c_gclicmd_elems; // array of pointers + u32 c_gclicmd_n; // array of pointers + u32 c_gclicmd_max; // capacity of allocated array + algo::cstring unix_user; // UNIX user login name + algo::cstring editor; // Command line to invoke editor + gcli::FGclicmdj2f* gclicmdj2f_lary[32]; // level array + i32 gclicmdj2f_n; // number of elements in array + gcli::FGclicmdc* gclicmdc_lary[32]; // level array + i32 gclicmdc_n; // number of elements in array + gcli::FGclicmdarg* gclicmdarg_lary[32]; // level array + i32 gclicmdarg_n; // number of elements in array + gcli::FGclicmdj2f** ind_gclicmdj2f_buckets_elems; // pointer to bucket array + i32 ind_gclicmdj2f_buckets_n; // number of elements in bucket array + i32 ind_gclicmdj2f_n; // number of elements in the hash table + gcli::FGclicmdarg** ind_gclicmdarg_buckets_elems; // pointer to bucket array + i32 ind_gclicmdarg_buckets_n; // number of elements in bucket array + i32 ind_gclicmdarg_n; // number of elements in the hash table + gcli::FGclicmdc** ind_gclicmdc_buckets_elems; // pointer to bucket array + i32 ind_gclicmdc_buckets_n; // number of elements in bucket array + i32 ind_gclicmdc_n; // number of elements in the hash table + gcli::FIssue* issue_lary[32]; // level array + i32 issue_n; // number of elements in array + gcli::FGrepo* grepo_lary[32]; // level array + i32 grepo_n; // number of elements in array + gcli::FTuples* tuples_lary[32]; // level array + i32 tuples_n; // number of elements in array + gcli::FIssuenote* issuenote_lary[32]; // level array + i32 issuenote_n; // number of elements in array + gcli::FMrjob* mrjob_lary[32]; // level array + i32 mrjob_n; // number of elements in array + gcli::FMrnote* mrnote_lary[32]; // level array + i32 mrnote_n; // number of elements in array + gcli::FMrnote** ind_mrnote_buckets_elems; // pointer to bucket array + i32 ind_mrnote_buckets_n; // number of elements in bucket array + i32 ind_mrnote_n; // number of elements in the hash table + gcli::FIssuenote** ind_issuenote_buckets_elems; // pointer to bucket array + i32 ind_issuenote_buckets_n; // number of elements in bucket array + i32 ind_issuenote_n; // number of elements in the hash table + gcli::FMrjob** ind_mrjob_buckets_elems; // pointer to bucket array + i32 ind_mrjob_buckets_n; // number of elements in bucket array + i32 ind_mrjob_n; // number of elements in the hash table + gcli::FUser* user_lary[32]; // level array + i32 user_n; // number of elements in array + gcli::FUser** ind_user_buckets_elems; // pointer to bucket array + i32 ind_user_buckets_n; // number of elements in bucket array + i32 ind_user_n; // number of elements in the hash table + gcli::FMr** ind_mr_buckets_elems; // pointer to bucket array + i32 ind_mr_buckets_n; // number of elements in bucket array + i32 ind_mr_n; // number of elements in the hash table + gcli::FMilestone** ind_milestone_buckets_elems; // pointer to bucket array + i32 ind_milestone_buckets_n; // number of elements in bucket array + i32 ind_milestone_n; // number of elements in the hash table + gcli::FMilestone* milestone_lary[32]; // level array + i32 milestone_n; // number of elements in array + gcli::FMr* mr_lary[32]; // level array + i32 mr_n; // number of elements in array + gcli::FGtypeprefix* gtypeprefix_lary[32]; // level array + i32 gtypeprefix_n; // number of elements in array + gcli::FGtblact* gtblact_lary[32]; // level array + i32 gtblact_n; // number of elements in array + gcli::FGtblactfld* gtblactfld_lary[32]; // level array + i32 gtblactfld_n; // number of elements in array + gcli::FGtblact** ind_gtblact_buckets_elems; // pointer to bucket array + i32 ind_gtblact_buckets_n; // number of elements in bucket array + i32 ind_gtblact_n; // number of elements in the hash table + gcli::FGtblact* zd_gtblact_head; // zero-terminated doubly linked list + i32 zd_gtblact_n; // zero-terminated doubly linked list + gcli::FGtblact* zd_gtblact_tail; // pointer to last element + gcli::FGtblactfld** ind_gtblactfld_buckets_elems; // pointer to bucket array + i32 ind_gtblactfld_buckets_n; // number of elements in bucket array + i32 ind_gtblactfld_n; // number of elements in the hash table + gcli::FGfld* gfld_lary[32]; // level array + i32 gfld_n; // number of elements in array + gcli::FGfld** ind_gfld_buckets_elems; // pointer to bucket array + i32 ind_gfld_buckets_n; // number of elements in bucket array + i32 ind_gfld_n; // number of elements in the hash table + gcli::FGfld** c_gfld_elems; // array of pointers + u32 c_gfld_n; // array of pointers + u32 c_gfld_max; // capacity of allocated array + gcli::FGtbl* gtbl_lary[32]; // level array + i32 gtbl_n; // number of elements in array + gcli::FGtbl** ind_gtbl_buckets_elems; // pointer to bucket array + i32 ind_gtbl_buckets_n; // number of elements in bucket array + i32 ind_gtbl_n; // number of elements in the hash table + gcli::FGact* gact_lary[32]; // level array + i32 gact_n; // number of elements in array + gcli::FGact** ind_gact_buckets_elems; // pointer to bucket array + i32 ind_gact_buckets_n; // number of elements in bucket array + i32 ind_gact_n; // number of elements in the hash table + gcli::trace trace; // }; ``` @@ -360,9 +361,10 @@ struct FDb { // gcli.FDb: In-memory database for gcli Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FGact { // gcli.FGact - gcli::FGact* ind_gact_next; // hash next - algo::Smallstr50 gact; // - algo::Comment comment; // + gcli::FGact* ind_gact_next; // hash next + u32 ind_gact_hashval; // hash value + algo::Smallstr50 gact; // + algo::Comment comment; // // func:gcli.FGact..AssignOp inline gcli::FGact& operator =(const gcli::FGact &rhs) = delete; // func:gcli.FGact..CopyCtor @@ -379,7 +381,7 @@ private: }; ``` -#### gcli.FGclicmd - +#### gcli.FGclicmd - table of static gcli commands #### gcli.FGclicmd Fields @@ -417,41 +419,42 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FGclicmd { // gcli.FGclicmd - gcli::FGclicmd* ind_gclicmd_next; // hash next - algo::Smallstr250 gclicmd; // - algo::Smallstr250 gclicmdf2j; // Base for gclicmdf2j - algo::Comment comment; // - algo::cstring url; // - algo::cstring sep; // - algo::cstring host; // - algo::cstring proj; // - algo::cstring token; // - algo::cstring body; // - algo::cstring note_id; // - algo::cstring issue_id; // - algo::cstring cond; // - bool select; // false - bool write_auth; // false - bool finish; // false - algo::cstring gclicmdt_key; // - u32 method; // 0 - gcli::FIssue* p_issue; // optional pointer - gcli::FMr* p_mr; // optional pointer - gcli::FTuples** c_tuples_elems; // array of pointers - u32 c_tuples_n; // array of pointers - u32 c_tuples_max; // capacity of allocated array - gcli::gclicmd_step_hook step; // NULL Pointer to a function - gcli::FGclicmdarg** c_gclicmdarg_elems; // array of pointers - u32 c_gclicmdarg_n; // array of pointers - u32 c_gclicmdarg_max; // capacity of allocated array - gcli::FGclicmdc** c_gclicmdc_elems; // array of pointers - u32 c_gclicmdc_n; // array of pointers - u32 c_gclicmdc_max; // capacity of allocated array - gcli::FGclicmdf2j** c_gclicmdf2j_elems; // array of pointers - u32 c_gclicmdf2j_n; // array of pointers - u32 c_gclicmdf2j_max; // capacity of allocated array - gcli::FGclicmd* p_gclicmd; // reference to parent row - bool _db_c_gclicmd_in_ary; // false membership flag + gcli::FGclicmd* ind_gclicmd_next; // hash next + u32 ind_gclicmd_hashval; // hash value + algo::Smallstr250 gclicmd; // table of static commands + algo::Smallstr250 gclicmdf2j; // Base for gclicmdf2j + algo::Comment comment; // + algo::cstring url; // + algo::cstring sep; // + algo::cstring host; // + algo::cstring proj; // + algo::cstring token; // + algo::cstring body; // + algo::cstring note_id; // + algo::cstring issue_id; // + algo::cstring cond; // + bool select; // false + bool write_auth; // false + bool finish; // false + algo::cstring gclicmdt_key; // + u32 method; // 0 + gcli::FIssue* p_issue; // optional pointer + gcli::FMr* p_mr; // optional pointer + gcli::FTuples** c_tuples_elems; // array of pointers + u32 c_tuples_n; // array of pointers + u32 c_tuples_max; // capacity of allocated array + gcli::gclicmd_step_hook step; // NULL Pointer to a function + gcli::FGclicmdarg** c_gclicmdarg_elems; // array of pointers + u32 c_gclicmdarg_n; // array of pointers + u32 c_gclicmdarg_max; // capacity of allocated array + gcli::FGclicmdc** c_gclicmdc_elems; // array of pointers + u32 c_gclicmdc_n; // array of pointers + u32 c_gclicmdc_max; // capacity of allocated array + gcli::FGclicmdf2j** c_gclicmdf2j_elems; // array of pointers + u32 c_gclicmdf2j_n; // array of pointers + u32 c_gclicmdf2j_max; // capacity of allocated array + gcli::FGclicmd* p_gclicmd; // reference to parent row + bool c_gclicmd_in_ary; // false membership flag // reftype Ptrary of gcli.FGclicmd.c_tuples prohibits copy // reftype Hook of gcli.FGclicmd.step prohibits copy // reftype Ptrary of gcli.FGclicmd.c_gclicmdarg prohibits copy @@ -495,6 +498,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FGclicmdarg { // gcli.FGclicmdarg gcli::FGclicmdarg* ind_gclicmdarg_next; // hash next + u32 ind_gclicmdarg_hashval; // hash value algo::Smallstr250 gclicmdarg; // bool gclicmd_c_gclicmdarg_in_ary; // false membership flag // func:gcli.FGclicmdarg..AssignOp @@ -531,6 +535,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FGclicmdc { // gcli.FGclicmdc gcli::FGclicmdc* ind_gclicmdc_next; // hash next + u32 ind_gclicmdc_hashval; // hash value algo::Smallstr250 gclicmdc; // gcli::FGclicmdf** c_gclicmdf_elems; // array of pointers u32 c_gclicmdf_n; // array of pointers @@ -574,6 +579,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FGclicmdf { // gcli.FGclicmdf: fields gcli::FGclicmdf* ind_gclicmdf_next; // hash next + u32 ind_gclicmdf_hashval; // hash value algo::Smallstr250 gclicmdf; // algo::cstring uval; // bool gclicmdc_c_gclicmdf_in_ary; // false membership flag @@ -652,13 +658,14 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FGclicmdj2f { // gcli.FGclicmdj2f - gcli::FGclicmdj2f* ind_gclicmdj2f_next; // hash next - algo::Smallstr250 gclicmdj2f; // - bool select; // false - bool dup; // false - gcli::FGclicmdf** c_gclicmdf_elems; // array of pointers - u32 c_gclicmdf_n; // array of pointers - u32 c_gclicmdf_max; // capacity of allocated array + gcli::FGclicmdj2f* ind_gclicmdj2f_next; // hash next + u32 ind_gclicmdj2f_hashval; // hash value + algo::Smallstr250 gclicmdj2f; // + bool select; // false + bool dup; // false + gcli::FGclicmdf** c_gclicmdf_elems; // array of pointers + u32 c_gclicmdf_n; // array of pointers + u32 c_gclicmdf_max; // capacity of allocated array // reftype Ptrary of gcli.FGclicmdj2f.c_gclicmdf prohibits copy // func:gcli.FGclicmdj2f..AssignOp inline gcli::FGclicmdj2f& operator =(const gcli::FGclicmdj2f &rhs) = delete; @@ -695,13 +702,14 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FGclicmdt { // gcli.FGclicmdt - gcli::FGclicmdt* ind_gclicmdt_next; // hash next - algo::Smallstr250 gclicmdt; // - algo::Smallstr50 gmethod; // "GET" - algo::Comment uri; // - algo::Comment comment; // - gcli::FGclicmd* p_gclicmd; // reference to parent row - gcli::FGtype* p_gtype; // reference to parent row + gcli::FGclicmdt* ind_gclicmdt_next; // hash next + u32 ind_gclicmdt_hashval; // hash value + algo::Smallstr250 gclicmdt; // + algo::Smallstr50 gmethod; // "GET" + algo::Comment uri; // + algo::Comment comment; // + gcli::FGclicmd* p_gclicmd; // reference to parent row + gcli::FGtype* p_gtype; // reference to parent row // x-reference on gcli.FGclicmdt.p_gclicmd prevents copy // x-reference on gcli.FGclicmdt.p_gtype prevents copy // func:gcli.FGclicmdt..AssignOp @@ -740,12 +748,13 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FGfld { // gcli.FGfld gcli::FGfld* ind_gfld_next; // hash next + u32 ind_gfld_hashval; // hash value algo::Smallstr50 gfld; // algo::Comment comment; // gcli::FGtblactfld** c_gtblactfld_elems; // array of pointers u32 c_gtblactfld_n; // array of pointers u32 c_gtblactfld_max; // capacity of allocated array - bool _db_c_gfld_in_ary; // false membership flag + bool c_gfld_in_ary; // false membership flag // reftype Ptrary of gcli.FGfld.c_gtblactfld prohibits copy // func:gcli.FGfld..AssignOp inline gcli::FGfld& operator =(const gcli::FGfld &rhs) = delete; @@ -785,15 +794,16 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FGithost { // gcli.FGithost - gcli::FGithost* ind_githost_next; // hash next - algo::Smallstr250 githost; // - algo::cstring ip; // - algo::cstring id; // - algo::cstring id_file; // - algo::cstring port; // - algo::cstring user; // - algo::cstring ssh_config; // - algo::cstring ssh_cmd; // + gcli::FGithost* ind_githost_next; // hash next + u32 ind_githost_hashval; // hash value + algo::Smallstr250 githost; // + algo::cstring ip; // + algo::cstring id; // + algo::cstring id_file; // + algo::cstring port; // + algo::cstring user; // + algo::cstring ssh_config; // + algo::cstring ssh_cmd; // // func:gcli.FGithost..AssignOp inline gcli::FGithost& operator =(const gcli::FGithost &rhs) = delete; // func:gcli.FGithost..CopyCtor @@ -826,10 +836,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FGmethod { // gcli.FGmethod - gcli::FGmethod* ind_gmethod_next; // hash next - algo::Smallstr50 gmethod; // - u32 val; // 0 - algo::Comment comment; // + gcli::FGmethod* ind_gmethod_next; // hash next + u32 ind_gmethod_hashval; // hash value + algo::Smallstr50 gmethod; // + u32 val; // 0 + algo::Comment comment; // // func:gcli.FGmethod..AssignOp inline gcli::FGmethod& operator =(const gcli::FGmethod &rhs) = delete; // func:gcli.FGmethod..CopyCtor @@ -864,19 +875,20 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FGrepo { // gcli.FGrepo - gcli::FGrepo* ind_grepo_next; // hash next - algo::Smallstr250 grepo; // gcli host/full name - algo::cstring name; // gcli full name - algo::cstring token; // gitlab project or repo access token - algo::cstring default_branch; // "origin" gcli remote used in the workflow - algo::cstring keyid; // gcli project id or repo - algo::cstring ssh_repo; // - algo::cstring web_url; // - algo::cstring descr; // - bool active; // true set to false to ignore the line but keep it in the file - algo::cstring priv; // - bool select; // false - algo::cstring gitremote_cmd; // + gcli::FGrepo* ind_grepo_next; // hash next + u32 ind_grepo_hashval; // hash value + algo::Smallstr250 grepo; // gcli host/full name + algo::cstring name; // gcli full name + algo::cstring token; // gitlab project or repo access token + algo::cstring default_branch; // "origin" gcli remote used in the workflow + algo::cstring keyid; // gcli project id or repo + algo::cstring ssh_repo; // + algo::cstring web_url; // + algo::cstring descr; // + bool active; // true set to false to ignore the line but keep it in the file + algo::cstring priv; // + bool select; // false + algo::cstring gitremote_cmd; // // func:gcli.FGrepo..AssignOp gcli::FGrepo& operator =(const gcli::FGrepo &rhs) = delete; // func:gcli.FGrepo..CopyCtor @@ -893,78 +905,6 @@ private: }; ``` -#### gcli.FGrepogitport - Default ports for repositories - - -#### gcli.FGrepogitport Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|gcli.FGrepogitport.base|[gclidb.Grepogitport](/txt/ssimdb/gclidb/grepogitport.md)|[Base](/txt/ssimdb/gclidb/grepogitport.md)||| - -#### Struct FGrepogitport - -*Note:* field ``gcli.FGrepogitport.base`` has reftype ``base`` so the fields of [gclidb.Grepogitport](/txt/ssimdb/gclidb/grepogitport.md) above are included into the resulting struct. - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) -``` -struct FGrepogitport { // gcli.FGrepogitport - gcli::FGrepogitport* ind_grepogitport_next; // hash next - algo::Smallstr50 grepogitport; // grepo git host - algo::cstring port; // ssh port for config - algo::Comment comment; // - // func:gcli.FGrepogitport..AssignOp - inline gcli::FGrepogitport& operator =(const gcli::FGrepogitport &rhs) = delete; - // func:gcli.FGrepogitport..CopyCtor - inline FGrepogitport(const gcli::FGrepogitport &rhs) = delete; -private: - // func:gcli.FGrepogitport..Ctor - inline FGrepogitport() __attribute__((nothrow)); - // func:gcli.FGrepogitport..Dtor - inline ~FGrepogitport() __attribute__((nothrow)); - friend gcli::FGrepogitport& grepogitport_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend gcli::FGrepogitport* grepogitport_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void grepogitport_RemoveAll() __attribute__((nothrow)); - friend void grepogitport_RemoveLast() __attribute__((nothrow)); -}; -``` - -#### gcli.FGrepossh - Ssh key table - - -#### gcli.FGrepossh Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|gcli.FGrepossh.base|[gclidb.Grepossh](/txt/ssimdb/gclidb/grepossh.md)|[Base](/txt/ssimdb/gclidb/grepossh.md)||| - -#### Struct FGrepossh - -*Note:* field ``gcli.FGrepossh.base`` has reftype ``base`` so the fields of [gclidb.Grepossh](/txt/ssimdb/gclidb/grepossh.md) above are included into the resulting struct. - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) -``` -struct FGrepossh { // gcli.FGrepossh - gcli::FGrepossh* ind_grepossh_next; // hash next - algo::Smallstr50 grepossh; // grepo project/repo name - algo::Smallstr200 sshid; // ssh id key name for ssh config - algo::Comment comment; // - // func:gcli.FGrepossh..AssignOp - inline gcli::FGrepossh& operator =(const gcli::FGrepossh &rhs) = delete; - // func:gcli.FGrepossh..CopyCtor - inline FGrepossh(const gcli::FGrepossh &rhs) = delete; -private: - // func:gcli.FGrepossh..Ctor - inline FGrepossh() __attribute__((nothrow)); - // func:gcli.FGrepossh..Dtor - inline ~FGrepossh() __attribute__((nothrow)); - friend gcli::FGrepossh& grepossh_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend gcli::FGrepossh* grepossh_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void grepossh_RemoveAll() __attribute__((nothrow)); - friend void grepossh_RemoveLast() __attribute__((nothrow)); -}; -``` - #### gcli.FGstatet - Internal @@ -981,9 +921,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FGstatet { // gcli.FGstatet - gcli::FGstatet* ind_gstatet_next; // hash next - algo::Smallstr50 gstatet; // - algo::cstring state; // + gcli::FGstatet* ind_gstatet_next; // hash next + u32 ind_gstatet_hashval; // hash value + algo::Smallstr50 gstatet; // + algo::cstring state; // // func:gcli.FGstatet..AssignOp inline gcli::FGstatet& operator =(const gcli::FGstatet &rhs) = delete; // func:gcli.FGstatet..CopyCtor @@ -1020,15 +961,16 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FGtbl { // gcli.FGtbl - gcli::FGtbl* ind_gtbl_next; // hash next - algo::Smallstr250 gtbl; // - algo::Comment comment; // - algo::cstring id; // - bool set_as_dflt; // false - bool tail_dot; // false - gcli::FGtblact** c_gtblact_elems; // array of pointers - u32 c_gtblact_n; // array of pointers - u32 c_gtblact_max; // capacity of allocated array + gcli::FGtbl* ind_gtbl_next; // hash next + u32 ind_gtbl_hashval; // hash value + algo::Smallstr250 gtbl; // + algo::Comment comment; // + algo::cstring id; // + bool set_as_dflt; // false + bool tail_dot; // false + gcli::FGtblact** c_gtblact_elems; // array of pointers + u32 c_gtblact_n; // array of pointers + u32 c_gtblact_max; // capacity of allocated array // reftype Ptrary of gcli.FGtbl.c_gtblact prohibits copy // func:gcli.FGtbl..AssignOp inline gcli::FGtbl& operator =(const gcli::FGtbl &rhs) = delete; @@ -1047,7 +989,7 @@ private: }; ``` -#### gcli.FGtblact - +#### gcli.FGtblact - static combination of gcli tables and actions #### gcli.FGtblact Fields @@ -1069,6 +1011,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FGtblact { // gcli.FGtblact gcli::FGtblact* ind_gtblact_next; // hash next + u32 ind_gtblact_hashval; // hash value gcli::FGtblact* zd_gtblact_next; // zslist link; -1 means not-in-list gcli::FGtblact* zd_gtblact_prev; // previous element algo::Smallstr50 gtblact; // @@ -1126,6 +1069,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FGtblactfld { // gcli.FGtblactfld gcli::FGtblactfld* ind_gtblactfld_next; // hash next + u32 ind_gtblactfld_hashval; // hash value algo::Smallstr50 gtblactfld; // algo::cstring dflt; // bool field_name_dflt; // false @@ -1177,6 +1121,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FGtype { // gcli.FGtype gcli::FGtype* ind_gtype_next; // hash next + u32 ind_gtype_hashval; // hash value algo::Smallstr50 gtype; // algo::cstring default_url; // algo::Comment comment; // @@ -1355,6 +1300,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FIssue { // gcli.FIssue gcli::FIssue* ind_issue_next; // hash next + u32 ind_issue_hashval; // hash value algo::Smallstr50 issue; // Identifier. must be in form project.iid algo::Smallstr50 assignee; // User the issue is assigned to algo::cstring labels; // issue labels - comma-separated list @@ -1412,6 +1358,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FIssuenote { // gcli.FIssuenote gcli::FIssuenote* ind_issuenote_next; // hash next + u32 ind_issuenote_hashval; // hash value algo::Smallstr250 issuenote; // Identifier. must be in form issue.id algo::cstring note; // Body of issue note algo::cstring system; // System or user note (glab only) @@ -1451,11 +1398,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FMilestone { // gcli.FMilestone - gcli::FMilestone* ind_milestone_next; // hash next - algo::Smallstr200 milestone; // Milestone id - algo::cstring description; // Milestone description - algo::cstring title; // Milestone title - bool select; // false + gcli::FMilestone* ind_milestone_next; // hash next + u32 ind_milestone_hashval; // hash value + algo::Smallstr200 milestone; // Milestone id + algo::cstring description; // Milestone description + algo::cstring title; // Milestone title + bool select; // false // func:gcli.FMilestone..AssignOp inline gcli::FMilestone& operator =(const gcli::FMilestone &rhs) = delete; // func:gcli.FMilestone..CopyCtor @@ -1492,6 +1440,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FMr { // gcli.FMr gcli::FMr* ind_mr_next; // hash next + u32 ind_mr_hashval; // hash value algo::Smallstr150 mr; // Identifier. must be in form project.iid algo::cstring state; // Mr state algo::cstring title; // Mr title @@ -1549,6 +1498,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FMrjob { // gcli.FMrjob gcli::FMrjob* ind_mrjob_next; // hash next + u32 ind_mrjob_hashval; // hash value algo::Smallstr250 mrjob; // Identifier. must be in form mr.id algo::Smallstr150 ref; // Mr portion of mr job algo::cstring id; // Job ID @@ -1593,6 +1543,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/includ ``` struct FMrnote { // gcli.FMrnote gcli::FMrnote* ind_mrnote_next; // hash next + u32 ind_mrnote_hashval; // hash value algo::cstring system; // System or user note (glab only) algo::Smallstr250 mrnote; // Identifier. must be in form issue.id algo::cstring note; // Body of mr note @@ -1657,11 +1608,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/gcli_gen.h](/include/gen/gcli_gen.h) ``` struct FUser { // gcli.FUser - gcli::FUser* ind_user_next; // hash next - algo::Smallstr50 user; // - u32 id; // 0 - algo::cstring name; // - bool select; // false + gcli::FUser* ind_user_next; // hash next + u32 ind_user_hashval; // hash value + algo::Smallstr50 user; // + u32 id; // 0 + algo::cstring name; // + bool select; // false // func:gcli.FUser..AssignOp inline gcli::FUser& operator =(const gcli::FUser &rhs) = delete; // func:gcli.FUser..CopyCtor diff --git a/txt/exe/jkv/README.md b/txt/exe/jkv/README.md new file mode 100644 index 00000000..9bdbb8aa --- /dev/null +++ b/txt/exe/jkv/README.md @@ -0,0 +1,170 @@ +## jkv - JSON <-> key-value mapping tool + +In regular mode, input (file or stdin) is read as JSON and converted to a series of lines. +Recursively, all fields in the JSON file are given a name. The output is printed +to stdout. Before printing, the in-memory object is updated by applying kvs from the command line +before writing it back. With -r (reverse), the input is a list of key-values and the +output is JSON. A filename of "-" means stdin. With `-write`, the input file is updated in-place. +Default output format can be overridden with `-output`. + +### Table Of Contents + + +  •  [Syntax](#syntax)
+  •  [Examples](#examples)
+  •  [Options](#options)
+  •  [Inputs](#inputs)
+📄 [jkv - Internals](/txt/exe/jkv/internals.md)
+ + + +### Syntax + + +``` +jkv: JSON <-> key-value mapping tool +Usage: jkv [-file:] [[-kv:]] [options] + OPTION TYPE DFLT COMMENT + -in string "data" Input directory or filename, - for stdin + [file] string Filename (use - for stdin) + [kv]... string JSON Keyvals + -r Reverse (json keyvals -> JSON) mapping + -write Write the modified file back + -output enum auto Output format (auto|json|kv) + auto Automatic + json Json only + kv Key-value only + -pretty int 2 Pretty-printer (0-compact; 1=algo style; 2=jq style) + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative + -help Print help and exit; alias -h + -version Print version and exit + -signature Show signatures and exit; alias -sig + +``` + + + +### Examples + +#### Update values in a JSON file + + +``` +jkv .vscode/launch.json -write configurations-0.program::myprog .args-0::-arg1 ::-arg2 ::-arg3 +``` + +#### Rename fields in a JSON file + +``` +jkv X.json | sed 's/^attr:/^attr2:/' | jkv -r > tempfile +mv tempfile X.json +``` + +#### Sort field names in a JSON file + +``` +jkv X.json | sort -t ':' -k1,1 +``` + +#### Merge two JSON files + +``` +(jkv A.json; jkv B.json) | jkv -r - +``` + +#### Select an object from a JSON file + +``` +jkv X.json | grep '^a\.b\.c\.' | jkv -r - +``` + +#### Construct JSON object from command line + + +``` +inline-command: jkv /dev/null -r a:true b:false c:null d:[] :3 :{} $'f::line1\nline2' e.g::h +{ + "a": true, + "b": false, + "c": null, + "d": [ + 3, + {} + ], + "f": "line1\nline2", + "e": { + "g": "h" + } +} +``` + +#### Set array element by index + + +``` +inline-command: jkv /dev/null -r -pretty:0 -- a.b.c-0:true -10:false +{"a":{"b":{"c":[true,null,null,null,null,null,null,null,null,null,false]}}} +``` + +### Options + + + +#### -in -- Input directory or filename, - for stdin + + +#### -file -- Filename (use - for stdin) + + +#### -kv -- JSON Keyvals + +Key-value pair. This has the form `:` +`` is a JSON expression, so it could be `null`, a number, `{}`, `[]`, `true`, `false` or a quoted string. +But if `` starts with `:` then the remainder of the value is a JSON string as if there were quotes around it. +I.e. `value::` is exactly the same as `value:"blah"` but a lot more convenient for use on UNIX command line. +Notice the string must be fully escaped according to JSON rules. + +If key starts with `.` or `-`, then it shares a prefix with the most recently seen key. So, specifying `a.b.c:true .d:false` +is the same as specifying `a.b.c:true a.b.d:false`. Specifying `a.b.c-0:true -10:false` +is the same as specifying `a.b.c-0:true a.b.c-10:false` and will result in a JSON array with 11 elements, 9 of which are null. + +If key is empty, then it is taken to tbe the last array index plus one. So, `a.b.c-0:true :false ::x` +is the same as specifying `a.b.c-0:true a.b.c-1:false a.b.c-2::x` + +#### -r -- Reverse (json keyvals -> JSON) mapping + + +Read input filename (- for stdin), with one key-value per line. +By default, output a JSON object (may be overridden with `-output`) + +#### -write -- Write the modified file back + + +Write output back to the file from which it was read. + +#### -output -- Output format + + +Select output format. Default (`auto`) is to perform a mapping either to or from kv format, +depending on input. + +#### -pretty -- Pretty-printer (0-compact; 1=algo style; 2=jq style) + + +Default value (2) uses jq-style pretty printer. +Value 0 means compact output with no newlines. +Value 1 is algo-style pretty printer (comma at the beginning of the new line) + + + +### Inputs + + +`jkv` takes the following tables on input: +|Ssimfile|Comment| +|---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| + + + diff --git a/txt/exe/jkv/internals.md b/txt/exe/jkv/internals.md new file mode 100644 index 00000000..cf25b637 --- /dev/null +++ b/txt/exe/jkv/internals.md @@ -0,0 +1,77 @@ +## jkv - Internals + + +### Sources + + +The source code license is GPL +The following source files are part of this tool: + +|Source File|Comment| +|---|---| +|[cpp/gen/jkv_gen.cpp](/cpp/gen/jkv_gen.cpp)|| +|[cpp/jkv/jkv.cpp](/cpp/jkv/jkv.cpp)|| +|[include/gen/jkv_gen.h](/include/gen/jkv_gen.h)|| +|[include/gen/jkv_gen.inl.h](/include/gen/jkv_gen.inl.h)|| +|[include/jkv.h](/include/jkv.h)|| + + + +### Dependencies + + +The build target depends on the following libraries +|Target|Comment| +|---|---| +|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| +|[lib_json](/txt/lib/lib_json/README.md)|Full json support library| +|[lib_prot](/txt/lib/lib_prot/README.md)|Library covering all protocols| + + + +### In Memory DB + + +`jkv` generated code creates the tables below. +All allocations are done through global `jkv::_db` [jkv.FDb](#jkv-fdb) structure +|Ctype|Ssimfile|Create|Access| +|---|---|---|---| +|[jkv.FDb](#jkv-fdb)||FDb._db (Global)| + +#### jkv.FDb - + + +#### jkv.FDb Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|jkv.FDb._db|[jkv.FDb](/txt/exe/jkv/internals.md#jkv-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| +|jkv.FDb.cmdline|[command.jkv](/txt/protocol/command/README.md#command-jkv)|[Val](/txt/exe/amc/reftypes.md#val)||| +|jkv.FDb.last_kv|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FDb + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/jkv_gen.h](/include/gen/jkv_gen.h) +``` +struct FDb { // jkv.FDb + command::jkv cmdline; // + algo::cstring last_kv; // + jkv::trace trace; // +}; +``` + + + +### Tests + + +The following component tests are defined for `jkv`. +These can be executed with `atf_comp -v` +|Comptest|Comment| +|---|---| +|[jkv.ArrayFill](/test/atf_comp/jkv.ArrayFill)|| +|[jkv.ReverseSmoke](/test/atf_comp/jkv.ReverseSmoke)|| +|[jkv.Smoke](/test/atf_comp/jkv.Smoke)|| + + + diff --git a/txt/exe/mdbg/README.md b/txt/exe/mdbg/README.md index b5489904..37aae500 100644 --- a/txt/exe/mdbg/README.md +++ b/txt/exe/mdbg/README.md @@ -30,17 +30,19 @@ Usage: mdbg [-target:] [[-args:]] [options] -cfg string "debug" Configuration to use -disas Show disassembly (use F12) -attach Attach to a running process + -pid int 0 (with -attach) Pid, if omitted mdbg will guess -b... string Set breakpoint, e.g. 'a.cpp:123 if cond1', 'func#3' -catchthrow Y Stop on exceptions -tui Use gdb -tui as the debugger -bcmd string "" Evaluate command at breakpoint -emacs Y Use emacs environment as the debugger -manywin Use gdb-many-windows emacs mode - -follow_child + -follow_child When forking, follow child (default is parent) -py Enable python scripting -dry_run Print commands but don't execute - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -mp Multi-process debugging + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -159,6 +161,9 @@ This option configures the environment to show disassembly when running #### -attach -- Attach to a running process +#### -pid -- (with -attach) Pid, if omitted mdbg will guess + + #### -b -- Set breakpoint, e.g. 'a.cpp:123 if cond1', 'func#3' @@ -199,7 +204,7 @@ Enable emacs' gdb's `gud-many-windows` mode, which brings up a debugger layout reminiscent of Visual Studio or Eclipse, with locals, breakpoints, threads subwindows, etc. See also `-disas` -#### -follow_child -- +#### -follow_child -- When forking, follow child (default is parent) This controlls gdb's `follow child` so that the debugger traces the child process instead @@ -217,6 +222,9 @@ Configure gdb to enable gdb python scriptability #### -dry_run -- Print commands but don't execute +#### -mp -- Multi-process debugging + + ### Inputs @@ -226,8 +234,8 @@ Configure gdb to enable gdb python scriptability |Ssimfile|Comment| |---|---| |[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dev.cfg](/txt/ssimdb/dev/cfg.md)|Compiler configuration| |[dev.builddir](/txt/ssimdb/dev/builddir.md)|Directory where object files/executables go. Determines compile/link options| +|[dev.cfg](/txt/ssimdb/dev/cfg.md)|Compiler configuration| diff --git a/txt/exe/mdbg/internals.md b/txt/exe/mdbg/internals.md index 2c1acccf..9ebfbbf2 100644 --- a/txt/exe/mdbg/internals.md +++ b/txt/exe/mdbg/internals.md @@ -31,6 +31,7 @@ The following source files are part of this tool: |[cpp/mdbg/mdbg.cpp](/cpp/mdbg/mdbg.cpp)|| |[include/gen/mdbg_gen.h](/include/gen/mdbg_gen.h)|| |[include/gen/mdbg_gen.inl.h](/include/gen/mdbg_gen.inl.h)|| +|[include/mdbg.h](/include/mdbg.h)|| @@ -115,6 +116,7 @@ struct FCfg { // mdbg.FCfg u32 c_builddir_n; // array of pointers u32 c_builddir_max; // capacity of allocated array mdbg::FCfg* ind_cfg_next; // hash next + u32 ind_cfg_hashval; // hash value // reftype Ptrary of mdbg.FCfg.c_builddir prohibits copy // func:mdbg.FCfg..AssignOp inline mdbg::FCfg& operator =(const mdbg::FCfg &rhs) = delete; diff --git a/txt/exe/mysql2ssim/README.md b/txt/exe/mysql2ssim/README.md index 8aebe7fd..8f8f4fb5 100644 --- a/txt/exe/mysql2ssim/README.md +++ b/txt/exe/mysql2ssim/README.md @@ -26,8 +26,8 @@ Usage: mysql2ssim [-url:] [[-tables:]] [options] -pretty Format output for the screen -nologo Don't show copyright notice -baddbok Don't claim if bad database - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig diff --git a/txt/exe/orgfile/README.md b/txt/exe/orgfile/README.md index 39b9e09e..65601ce4 100644 --- a/txt/exe/orgfile/README.md +++ b/txt/exe/orgfile/README.md @@ -30,8 +30,8 @@ Usage: orgfile [options] -commit Apply changes -undo Read previous orgfile output, undoing movement -hash string "sha1" Hash command to use for deduplication - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig diff --git a/txt/exe/orgfile/internals.md b/txt/exe/orgfile/internals.md index 1e9b4dc2..abcd9a76 100644 --- a/txt/exe/orgfile/internals.md +++ b/txt/exe/orgfile/internals.md @@ -112,11 +112,12 @@ struct FDb { // orgfile.FDb: In-memory database for orgfile Generated by [amc](/txt/exe/amc/README.md) into [include/gen/orgfile_gen.h](/include/gen/orgfile_gen.h) ``` struct FFilehash { // orgfile.FFilehash - orgfile::FFilehash* ind_filehash_next; // hash next - algo::Smallstr40 filehash; // - orgfile::FFilename** c_filename_elems; // array of pointers - u32 c_filename_n; // array of pointers - u32 c_filename_max; // capacity of allocated array + orgfile::FFilehash* ind_filehash_next; // hash next + u32 ind_filehash_hashval; // hash value + algo::Smallstr40 filehash; // + orgfile::FFilename** c_filename_elems; // array of pointers + u32 c_filename_n; // array of pointers + u32 c_filename_max; // capacity of allocated array // reftype Ptrary of orgfile.FFilehash.c_filename prohibits copy // func:orgfile.FFilehash..AssignOp inline orgfile::FFilehash& operator =(const orgfile::FFilehash &rhs) = delete; @@ -153,6 +154,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/orgfile_gen.h](/inc struct FFilename { // orgfile.FFilename orgfile::FFilename* filename_next; // Pointer to next free element int tpool orgfile::FFilename* ind_filename_next; // hash next + u32 ind_filename_hashval; // hash value algo::cstring filename; // algo::Smallstr40 filehash; // orgfile::FFilehash* p_filehash; // reference to parent row diff --git a/txt/exe/samp_make/README.md b/txt/exe/samp_make/README.md new file mode 100644 index 00000000..157625f3 --- /dev/null +++ b/txt/exe/samp_make/README.md @@ -0,0 +1,95 @@ +## samp_make - sample program for Makefile management + +This program is a sample program covered in [Tutorial on transitioning from Makefile to OpenACR build](/txt/tut/tut9_make.md). +It parses a specified Makefile, produces all requisite ssimfiles, and generates Makefile(s) from its [Inputs](#inputs). + +### Table Of Contents + + +  •  [Syntax](#syntax)
+  •  [Internals](#internals)
+  •  [Options](#options)
+  •  [Inputs](#inputs)
+  •  [Sources](#sources)
+📄 [samp_make - Internals](/txt/exe/samp_make/internals.md)
+ + + +### Syntax + + +``` +samp_make: sample program for Makefile management +Usage: samp_make [options] + OPTION TYPE DFLT COMMENT + -in string "data" Input directory or filename, - for stdin + -target regx "%" Create Makefile for selected targets + -parse_make Parse extern/gnumake/Simple-Makefile + -makefile string "extern/gnumake/Simple-Makefile" (with parse_make) makefile to parse + -write P(with parse_make) write ssimfiles, otherwise print them + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative + -help Print help and exit; alias -h + -version Print version and exit + -signature Show signatures and exit; alias -sig + +``` + + + +### Internals + + +for internals description see [samp_make - sample program for Makefile management](/txt/exe/samp_make/internals.md) + + + +### Options + + + +#### -in -- Input directory or filename, - for stdin + + +#### -target -- Create Makefile for selected targets + + +#### -parse_make -- Parse extern/gnumake/Simple-Makefile + + +#### -makefile -- (with parse_make) makefile to parse + + +#### -write -- P(with parse_make) write ssimfiles, otherwise print them + + + + +### Inputs + + +`samp_make` takes the following tables on input: +|Ssimfile|Comment| +|---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[sampdb.gitfile](/txt/ssimdb/sampdb/gitfile.md)|samp_make list of gitfile sources| +|[sampdb.targdep](/txt/ssimdb/sampdb/targdep.md)|samp_make targets dependencies| +|[sampdb.target](/txt/ssimdb/sampdb/target.md)|samp_make targets list| +|[sampdb.targrec](/txt/ssimdb/sampdb/targrec.md)|samp_make recipe for a target| +|[sampdb.targsrc](/txt/ssimdb/sampdb/targsrc.md)|samp_make targets source dependencies| + + + +### Sources + +The source code license is GPL +The following source files are part of this tool: + +|Source File|Comment| +|---|---| +|[cpp/gen/samp_make_gen.cpp](/cpp/gen/samp_make_gen.cpp)|| +|[cpp/samp_make/samp_make.cpp](/cpp/samp_make/samp_make.cpp)|| +|[include/gen/samp_make_gen.h](/include/gen/samp_make_gen.h)|| +|[include/gen/samp_make_gen.inl.h](/include/gen/samp_make_gen.inl.h)|| +|[include/samp_make.h](/include/samp_make.h)|| + diff --git a/txt/exe/samp_make/internals.md b/txt/exe/samp_make/internals.md new file mode 100644 index 00000000..57de975c --- /dev/null +++ b/txt/exe/samp_make/internals.md @@ -0,0 +1,345 @@ +## samp_make - Internals + + +### Table Of Contents + + +* [Description](#description) +* [Sources](#sources) +* [In Memory DB](#in-memory-db) + + + +### Description + + +for operations description see [samp_make - sample program for Makefile management](/txt/exe/samp_make/README.md) + + + +### Sources + + +The source code license is GPL +The following source files are part of this tool: + +|Source File|Comment| +|---|---| +|[cpp/gen/samp_make_gen.cpp](/cpp/gen/samp_make_gen.cpp)|| +|[cpp/samp_make/samp_make.cpp](/cpp/samp_make/samp_make.cpp)|| +|[include/gen/samp_make_gen.h](/include/gen/samp_make_gen.h)|| +|[include/gen/samp_make_gen.inl.h](/include/gen/samp_make_gen.inl.h)|| +|[include/samp_make.h](/include/samp_make.h)|| + + + +### Dependencies + + +The build target depends on the following libraries +|Target|Comment| +|---|---| +|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| +|[lib_prot](/txt/lib/lib_prot/README.md)|Library covering all protocols| + + + +### In Memory DB + + +`samp_make` generated code creates the tables below. +All allocations are done through global `samp_make::_db` [samp_make.FDb](#samp_make-fdb) structure +|Ctype|Ssimfile|Create|Access| +|---|---|---|---| +|[samp_make.FDb](#samp_make-fdb)||FDb._db (Global)| +|[samp_make.FGitfile](#samp_make-fgitfile)|[sampdb.gitfile](/txt/ssimdb/sampdb/gitfile.md)|FDb.gitfile (Lary)|gitfile (Lary, by rowid)|ind_gitfile (Thash, hash field gitfile)| +|[samp_make.FTargdep](#samp_make-ftargdep)|[sampdb.targdep](/txt/ssimdb/sampdb/targdep.md)|FDb.targdep (Lary)|targdep (Lary, by rowid)|ind_targdep (Thash, hash field targdep)| +||||FTarget.c_targdep (Ptrary)| +|[samp_make.FTarget](#samp_make-ftarget)|[sampdb.target](/txt/ssimdb/sampdb/target.md)|FDb.target (Lary)|target (Lary, by rowid)|ind_target (Thash, hash field target)|c_target (Ptrary)| +||||FTargdep.p_parent (Upptr)| +||||FTargdep.p_target (Upptr)| +|[samp_make.FTargrec](#samp_make-ftargrec)|[sampdb.targrec](/txt/ssimdb/sampdb/targrec.md)|FDb.targrec (Lary)|targrec (Lary, by rowid)|ind_targrec (Thash, hash field target)| +||||FTarget.c_targrec (Ptr)| +|[samp_make.FTargsrc](#samp_make-ftargsrc)|[sampdb.targsrc](/txt/ssimdb/sampdb/targsrc.md)|FDb.targsrc (Lary)|targsrc (Lary, by rowid)|ind_targsrc (Thash, hash field targsrc)| +||||FTarget.c_targsrc (Ptrary)| + +#### samp_make.FDb - + + +#### samp_make.FDb Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|samp_make.FDb._db|[samp_make.FDb](/txt/exe/samp_make/internals.md#samp_make-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| +|samp_make.FDb.cmdline|[command.samp_make](/txt/protocol/command/README.md#command-samp_make)|[Val](/txt/exe/amc/reftypes.md#val)||| +|samp_make.FDb.gitfile|[samp_make.FGitfile](/txt/exe/samp_make/internals.md#samp_make-fgitfile)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|samp_make.FDb.ind_gitfile|[samp_make.FGitfile](/txt/exe/samp_make/internals.md#samp_make-fgitfile)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|samp_make.FDb.target|[samp_make.FTarget](/txt/exe/samp_make/internals.md#samp_make-ftarget)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|samp_make.FDb.ind_target|[samp_make.FTarget](/txt/exe/samp_make/internals.md#samp_make-ftarget)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|samp_make.FDb.targdep|[samp_make.FTargdep](/txt/exe/samp_make/internals.md#samp_make-ftargdep)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|samp_make.FDb.ind_targdep|[samp_make.FTargdep](/txt/exe/samp_make/internals.md#samp_make-ftargdep)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|samp_make.FDb.targsrc|[samp_make.FTargsrc](/txt/exe/samp_make/internals.md#samp_make-ftargsrc)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|samp_make.FDb.ind_targsrc|[samp_make.FTargsrc](/txt/exe/samp_make/internals.md#samp_make-ftargsrc)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|samp_make.FDb.targrec|[samp_make.FTargrec](/txt/exe/samp_make/internals.md#samp_make-ftargrec)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|samp_make.FDb.ind_targrec|[samp_make.FTargrec](/txt/exe/samp_make/internals.md#samp_make-ftargrec)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|samp_make.FDb.c_target|[samp_make.FTarget](/txt/exe/samp_make/internals.md#samp_make-ftarget)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| + +#### Struct FDb + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_make_gen.h](/include/gen/samp_make_gen.h) +``` +struct FDb { // samp_make.FDb + command::samp_make cmdline; // + samp_make::FGitfile* gitfile_lary[32]; // level array + i32 gitfile_n; // number of elements in array + samp_make::FGitfile** ind_gitfile_buckets_elems; // pointer to bucket array + i32 ind_gitfile_buckets_n; // number of elements in bucket array + i32 ind_gitfile_n; // number of elements in the hash table + samp_make::FTarget* target_lary[32]; // level array + i32 target_n; // number of elements in array + samp_make::FTarget** ind_target_buckets_elems; // pointer to bucket array + i32 ind_target_buckets_n; // number of elements in bucket array + i32 ind_target_n; // number of elements in the hash table + samp_make::FTargdep* targdep_lary[32]; // level array + i32 targdep_n; // number of elements in array + samp_make::FTargdep** ind_targdep_buckets_elems; // pointer to bucket array + i32 ind_targdep_buckets_n; // number of elements in bucket array + i32 ind_targdep_n; // number of elements in the hash table + samp_make::FTargsrc* targsrc_lary[32]; // level array + i32 targsrc_n; // number of elements in array + samp_make::FTargsrc** ind_targsrc_buckets_elems; // pointer to bucket array + i32 ind_targsrc_buckets_n; // number of elements in bucket array + i32 ind_targsrc_n; // number of elements in the hash table + samp_make::FTargrec* targrec_lary[32]; // level array + i32 targrec_n; // number of elements in array + samp_make::FTargrec** ind_targrec_buckets_elems; // pointer to bucket array + i32 ind_targrec_buckets_n; // number of elements in bucket array + i32 ind_targrec_n; // number of elements in the hash table + samp_make::FTarget** c_target_elems; // array of pointers + u32 c_target_n; // array of pointers + u32 c_target_max; // capacity of allocated array + samp_make::trace trace; // +}; +``` + +#### samp_make.FGitfile - samp_make list of gitfile sources + + +#### samp_make.FGitfile Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|samp_make.FGitfile.base|[sampdb.Gitfile](/txt/ssimdb/sampdb/gitfile.md)|[Base](/txt/ssimdb/sampdb/gitfile.md)||| + +#### Struct FGitfile + +*Note:* field ``samp_make.FGitfile.base`` has reftype ``base`` so the fields of [sampdb.Gitfile](/txt/ssimdb/sampdb/gitfile.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_make_gen.h](/include/gen/samp_make_gen.h) +``` +struct FGitfile { // samp_make.FGitfile + samp_make::FGitfile* ind_gitfile_next; // hash next + u32 ind_gitfile_hashval; // hash value + algo::Smallstr50 gitfile; // + algo::Comment comment; // + // func:samp_make.FGitfile..AssignOp + inline samp_make::FGitfile& operator =(const samp_make::FGitfile &rhs) = delete; + // func:samp_make.FGitfile..CopyCtor + inline FGitfile(const samp_make::FGitfile &rhs) = delete; +private: + // func:samp_make.FGitfile..Ctor + inline FGitfile() __attribute__((nothrow)); + // func:samp_make.FGitfile..Dtor + inline ~FGitfile() __attribute__((nothrow)); + friend samp_make::FGitfile& gitfile_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend samp_make::FGitfile* gitfile_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void gitfile_RemoveAll() __attribute__((nothrow)); + friend void gitfile_RemoveLast() __attribute__((nothrow)); +}; +``` + +#### samp_make.FTargdep - samp_make targets dependencies + + +#### samp_make.FTargdep Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|samp_make.FTargdep.base|[sampdb.Targdep](/txt/ssimdb/sampdb/targdep.md)|[Base](/txt/ssimdb/sampdb/targdep.md)||| +|samp_make.FTargdep.p_parent|[samp_make.FTarget](/txt/exe/samp_make/internals.md#samp_make-ftarget)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| +|samp_make.FTargdep.p_target|[samp_make.FTarget](/txt/exe/samp_make/internals.md#samp_make-ftarget)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| + +#### Struct FTargdep + +*Note:* field ``samp_make.FTargdep.base`` has reftype ``base`` so the fields of [sampdb.Targdep](/txt/ssimdb/sampdb/targdep.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_make_gen.h](/include/gen/samp_make_gen.h) +``` +struct FTargdep { // samp_make.FTargdep + samp_make::FTargdep* ind_targdep_next; // hash next + u32 ind_targdep_hashval; // hash value + algo::Smallstr50 targdep; // + bool rec; // false use in recipe + bool pre; // false use in prerequisite + algo::Comment comment; // + samp_make::FTarget* p_parent; // reference to parent row + samp_make::FTarget* p_target; // reference to parent row + bool target_c_targdep_in_ary; // false membership flag + // x-reference on samp_make.FTargdep.p_parent prevents copy + // x-reference on samp_make.FTargdep.p_target prevents copy + // func:samp_make.FTargdep..AssignOp + samp_make::FTargdep& operator =(const samp_make::FTargdep &rhs) = delete; + // x-reference on samp_make.FTargdep.p_parent prevents copy + // x-reference on samp_make.FTargdep.p_target prevents copy + // func:samp_make.FTargdep..CopyCtor + FTargdep(const samp_make::FTargdep &rhs) = delete; +private: + // func:samp_make.FTargdep..Ctor + inline FTargdep() __attribute__((nothrow)); + // func:samp_make.FTargdep..Dtor + inline ~FTargdep() __attribute__((nothrow)); + friend samp_make::FTargdep& targdep_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend samp_make::FTargdep* targdep_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void targdep_RemoveAll() __attribute__((nothrow)); + friend void targdep_RemoveLast() __attribute__((nothrow)); +}; +``` + +#### samp_make.FTarget - samp_make targets list + + +#### samp_make.FTarget Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|samp_make.FTarget.base|[sampdb.Target](/txt/ssimdb/sampdb/target.md)|[Base](/txt/ssimdb/sampdb/target.md)||| +|samp_make.FTarget.prereq|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||collection of make prereq lines| +|samp_make.FTarget.select|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|samp_make.FTarget.recipe|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||collection of make recipe lines| +|samp_make.FTarget.c_targsrc|[samp_make.FTargsrc](/txt/exe/samp_make/internals.md#samp_make-ftargsrc)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| +|samp_make.FTarget.c_targdep|[samp_make.FTargdep](/txt/exe/samp_make/internals.md#samp_make-ftargdep)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| +|samp_make.FTarget.c_targrec|[samp_make.FTargrec](/txt/exe/samp_make/internals.md#samp_make-ftargrec)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| + +#### Struct FTarget + +*Note:* field ``samp_make.FTarget.base`` has reftype ``base`` so the fields of [sampdb.Target](/txt/ssimdb/sampdb/target.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_make_gen.h](/include/gen/samp_make_gen.h) +``` +struct FTarget { // samp_make.FTarget + samp_make::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr50 target; // + bool dflt; // false make first target - default target + algo::Comment comment; // + algo::cstring prereq; // collection of make prereq lines + bool select; // false + algo::cstring recipe; // collection of make recipe lines + samp_make::FTargsrc** c_targsrc_elems; // array of pointers + u32 c_targsrc_n; // array of pointers + u32 c_targsrc_max; // capacity of allocated array + samp_make::FTargdep** c_targdep_elems; // array of pointers + u32 c_targdep_n; // array of pointers + u32 c_targdep_max; // capacity of allocated array + samp_make::FTargrec* c_targrec; // optional pointer + bool c_target_in_ary; // false membership flag + // reftype Ptrary of samp_make.FTarget.c_targsrc prohibits copy + // reftype Ptrary of samp_make.FTarget.c_targdep prohibits copy + // x-reference on samp_make.FTarget.c_targrec prevents copy + // func:samp_make.FTarget..AssignOp + samp_make::FTarget& operator =(const samp_make::FTarget &rhs) = delete; + // reftype Ptrary of samp_make.FTarget.c_targsrc prohibits copy + // reftype Ptrary of samp_make.FTarget.c_targdep prohibits copy + // x-reference on samp_make.FTarget.c_targrec prevents copy + // func:samp_make.FTarget..CopyCtor + FTarget(const samp_make::FTarget &rhs) = delete; +private: + // func:samp_make.FTarget..Ctor + inline FTarget() __attribute__((nothrow)); + // func:samp_make.FTarget..Dtor + inline ~FTarget() __attribute__((nothrow)); + friend samp_make::FTarget& target_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend samp_make::FTarget* target_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void target_RemoveAll() __attribute__((nothrow)); + friend void target_RemoveLast() __attribute__((nothrow)); +}; +``` + +#### samp_make.FTargrec - samp_make recipe for a target + + +#### samp_make.FTargrec Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|samp_make.FTargrec.base|[sampdb.Targrec](/txt/ssimdb/sampdb/targrec.md)|[Base](/txt/ssimdb/sampdb/targrec.md)||| + +#### Struct FTargrec + +*Note:* field ``samp_make.FTargrec.base`` has reftype ``base`` so the fields of [sampdb.Targrec](/txt/ssimdb/sampdb/targrec.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_make_gen.h](/include/gen/samp_make_gen.h) +``` +struct FTargrec { // samp_make.FTargrec + samp_make::FTargrec* ind_targrec_next; // hash next + u32 ind_targrec_hashval; // hash value + algo::Smallstr50 target; // + algo::cstring recipe; // + algo::Comment comment; // + // func:samp_make.FTargrec..AssignOp + inline samp_make::FTargrec& operator =(const samp_make::FTargrec &rhs) = delete; + // func:samp_make.FTargrec..CopyCtor + inline FTargrec(const samp_make::FTargrec &rhs) = delete; +private: + // func:samp_make.FTargrec..Ctor + inline FTargrec() __attribute__((nothrow)); + // func:samp_make.FTargrec..Dtor + inline ~FTargrec() __attribute__((nothrow)); + friend samp_make::FTargrec& targrec_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend samp_make::FTargrec* targrec_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void targrec_RemoveAll() __attribute__((nothrow)); + friend void targrec_RemoveLast() __attribute__((nothrow)); +}; +``` + +#### samp_make.FTargsrc - samp_make targets source dependencies + + +#### samp_make.FTargsrc Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|samp_make.FTargsrc.base|[sampdb.Targsrc](/txt/ssimdb/sampdb/targsrc.md)|[Base](/txt/ssimdb/sampdb/targsrc.md)||| + +#### Struct FTargsrc + +*Note:* field ``samp_make.FTargsrc.base`` has reftype ``base`` so the fields of [sampdb.Targsrc](/txt/ssimdb/sampdb/targsrc.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_make_gen.h](/include/gen/samp_make_gen.h) +``` +struct FTargsrc { // samp_make.FTargsrc + samp_make::FTargsrc* ind_targsrc_next; // hash next + u32 ind_targsrc_hashval; // hash value + algo::Smallstr50 targsrc; // + bool pre; // false use in prerequisite + bool rec; // false use in recipe + algo::Comment comment; // + bool target_c_targsrc_in_ary; // false membership flag + // func:samp_make.FTargsrc..AssignOp + inline samp_make::FTargsrc& operator =(const samp_make::FTargsrc &rhs) = delete; + // func:samp_make.FTargsrc..CopyCtor + inline FTargsrc(const samp_make::FTargsrc &rhs) = delete; +private: + // func:samp_make.FTargsrc..Ctor + inline FTargsrc() __attribute__((nothrow)); + // func:samp_make.FTargsrc..Dtor + inline ~FTargsrc() __attribute__((nothrow)); + friend samp_make::FTargsrc& targsrc_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend samp_make::FTargsrc* targsrc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void targsrc_RemoveAll() __attribute__((nothrow)); + friend void targsrc_RemoveLast() __attribute__((nothrow)); +}; +``` + + + diff --git a/txt/exe/samp_meng/README.md b/txt/exe/samp_meng/README.md index 52a08366..785a22f3 100644 --- a/txt/exe/samp_meng/README.md +++ b/txt/exe/samp_meng/README.md @@ -1,4 +1,4 @@ -## samp_meng - +## samp_meng - Sample matching engine ### Table Of Contents @@ -7,6 +7,7 @@   •  [Syntax](#syntax)
  •  [Options](#options)
  •  [Inputs](#inputs)
+  •  [Input Messages](#input-messages)
📄 [samp_meng - Internals](/txt/exe/samp_meng/internals.md)
@@ -15,11 +16,12 @@ ``` +samp_meng: Sample matching engine Usage: samp_meng [options] OPTION TYPE DFLT COMMENT -in string "data" Input directory or filename, - for stdin - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -47,3 +49,18 @@ Usage: samp_meng [options] +### Input Messages + + +`samp_meng` Consumes the following messages via samp_meng.In () +|Message|Comment| +|---|---| +|[samp_meng.CancelReqMsg](/txt/exe/samp_meng/internals.md#samp_meng-cancelreqmsg)|From user: cancel request| +|[samp_meng.MassCancelReqMsg](/txt/exe/samp_meng/internals.md#samp_meng-masscancelreqmsg)|From user: cancel mass request| +|[samp_meng.NewOrderReqMsg](/txt/exe/samp_meng/internals.md#samp_meng-neworderreqmsg)|From user: new order request| +|[samp_meng.NewSymbolReqMsg](/txt/exe/samp_meng/internals.md#samp_meng-newsymbolreqmsg)|To matching engine: new symbol request| +|[samp_meng.NewUserReqMsg](/txt/exe/samp_meng/internals.md#samp_meng-newuserreqmsg)|To matching engine: new user request| +|[samp_meng.TextMsg](/txt/exe/samp_meng/internals.md#samp_meng-textmsg)|Debug message| + + + diff --git a/txt/exe/samp_meng/internals.md b/txt/exe/samp_meng/internals.md index 3e6ed663..03ed4a3b 100644 --- a/txt/exe/samp_meng/internals.md +++ b/txt/exe/samp_meng/internals.md @@ -28,10 +28,10 @@ The following source files are part of this tool: |Source File|Comment| |---|---| |[cpp/gen/samp_meng_gen.cpp](/cpp/gen/samp_meng_gen.cpp)|| -|[cpp/samp_meng/samp_meng.cpp](/cpp/samp_meng/samp_meng.cpp)|| +|[cpp/samp_meng/samp_meng.cpp](/cpp/samp_meng/samp_meng.cpp)|Main source| |[include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h)|| |[include/gen/samp_meng_gen.inl.h](/include/gen/samp_meng_gen.inl.h)|| -|[include/samp_meng.h](/include/samp_meng.h)|| +|[include/samp_meng.h](/include/samp_meng.h)|Main header| @@ -157,7 +157,7 @@ struct CancelReqMsg { // samp_meng.CancelReqMsg: From user: cancel request }; ``` -#### samp_meng.FDb - +#### samp_meng.FDb - In-memory database #### samp_meng.FDb Fields @@ -182,7 +182,7 @@ struct CancelReqMsg { // samp_meng.CancelReqMsg: From user: cancel request Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h) ``` -struct FDb { // samp_meng.FDb +struct FDb { // samp_meng.FDb: In-memory database samp_meng::FFdin* fdin_lary[32]; // level array i32 fdin_n; // number of elements in array command::samp_meng cmdline; // @@ -212,7 +212,7 @@ struct FDb { // samp_meng.FDb }; ``` -#### samp_meng.FFdin - FD input +#### samp_meng.FFdin - File descriptor input #### samp_meng.FFdin Fields @@ -226,22 +226,22 @@ struct FDb { // samp_meng.FDb Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h) ``` -struct FFdin { // samp_meng.FFdin: FD input +struct FFdin { // samp_meng.FFdin: File descriptor input samp_meng::FFdin* cd_fdin_eof_next; // zslist link; -1 means not-in-list samp_meng::FFdin* cd_fdin_eof_prev; // previous element samp_meng::FFdin* cd_fdin_read_next; // zslist link; -1 means not-in-list samp_meng::FFdin* cd_fdin_read_prev; // previous element algo_lib::FIohook iohook; // - u8 in_elems[8192]; // pointer to elements of inline array + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array i32 in_start; // beginning of valid bytes (in bytes) i32 in_end; // end of valid bytes (in bytes) - bool in_eof; // no more data will be written to buffer + i32 in_msglen; // current message length algo::Errcode in_err; // system error code + algo_lib::FIohook in_iohook; // edge-triggered hook for the buffer + bool in_eof; // no more data will be written to buffer bool in_msgvalid; // current message is valid - i32 in_msglen; // current message length - algo_lib::FIohook in_iohook; // edge-triggered hook for refilling buffer bool in_epoll_enable; // use epoll? - enum { in_max = 8192 }; // value field samp_meng.FFdin.iohook is not copiable // field samp_meng.FFdin.in prevents copy // func:samp_meng.FFdin..AssignOp @@ -262,7 +262,7 @@ private: }; ``` -#### samp_meng.I64Price8 - +#### samp_meng.I64Price8 - Price type (8 implied decimal places) #### samp_meng.I64Price8 Fields @@ -276,7 +276,7 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h) ``` #pragma pack(push,1) -struct I64Price8 { // samp_meng.I64Price8 +struct I64Price8 { // samp_meng.I64Price8: Price type (8 implied decimal places) i64 value; // 0 // func:samp_meng.I64Price8..EqOp inline bool operator ==(const samp_meng::I64Price8 &rhs) const __attribute__((nothrow)); @@ -297,7 +297,7 @@ struct I64Price8 { // samp_meng.I64Price8 }; ``` -#### samp_meng.Ordkey - +#### samp_meng.Ordkey - Order key #### samp_meng.Ordkey Fields @@ -311,7 +311,7 @@ struct I64Price8 { // samp_meng.I64Price8 Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h) ``` -struct Ordkey { // samp_meng.Ordkey +struct Ordkey { // samp_meng.Ordkey: Order key u64 price; // 0 u64 time; // 0 // func:samp_meng.Ordkey..EqOp @@ -331,7 +331,7 @@ struct Ordkey { // samp_meng.Ordkey }; ``` -#### samp_meng.FOrder - +#### samp_meng.FOrder - Order record #### samp_meng.FOrder Fields @@ -350,19 +350,20 @@ struct Ordkey { // samp_meng.Ordkey Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h) ``` -struct FOrder { // samp_meng.FOrder - samp_meng::FOrder* order_next; // Pointer to next free element int tpool - samp_meng::FOrder* ind_order_next; // hash next - i64 order; // 0 - samp_meng::FOrdq* p_ordq; // reference to parent row - samp_meng::I64Price8 price; // - algo::UnTime time; // - u32 qty; // 0 - samp_meng::Ordkey ordkey; // - samp_meng::FUser* p_user; // reference to parent row - i32 bh_order_idx; // index in heap; -1 means not-in-heap - samp_meng::FOrder* zd_order_next; // zslist link; -1 means not-in-list - samp_meng::FOrder* zd_order_prev; // previous element +struct FOrder { // samp_meng.FOrder: Order record + samp_meng::FOrder* order_next; // Pointer to next free element int tpool + samp_meng::FOrder* ind_order_next; // hash next + u32 ind_order_hashval; // hash value + i64 order; // 0 + samp_meng::FOrdq* p_ordq; // reference to parent row + samp_meng::I64Price8 price; // + algo::UnTime time; // + u32 qty; // 0 + samp_meng::Ordkey ordkey; // + samp_meng::FUser* p_user; // reference to parent row + i32 ordq_bh_order_idx; // index in heap; -1 means not-in-heap + samp_meng::FOrder* user_zd_order_next; // zslist link; -1 means not-in-list + samp_meng::FOrder* user_zd_order_prev; // previous element // func:samp_meng.FOrder..AssignOp inline samp_meng::FOrder& operator =(const samp_meng::FOrder &rhs) = delete; // func:samp_meng.FOrder..CopyCtor @@ -378,7 +379,7 @@ private: }; ``` -#### samp_meng.FOrdq - +#### samp_meng.FOrdq - Order queue record #### samp_meng.FOrdq Fields @@ -393,7 +394,7 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h) ``` -struct FOrdq { // samp_meng.FOrdq +struct FOrdq { // samp_meng.FOrdq: Order queue record samp_meng::FOrdq* ordq_next; // Pointer to next free element int tpool u8 side; // 0 samp_meng::FSymbol* p_symbol; // reference to parent row @@ -418,7 +419,7 @@ private: }; ``` -#### samp_meng.Symbol - +#### samp_meng.Symbol - Symbol name #### samp_meng.Symbol Fields @@ -432,7 +433,7 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h) ``` #pragma pack(push,1) -struct Symbol { // samp_meng.Symbol +struct Symbol { // samp_meng.Symbol: Symbol name algo::RnullStr8 symbol; // // func:samp_meng.Symbol..EqOp inline bool operator ==(const samp_meng::Symbol &rhs) const __attribute__((nothrow)); @@ -443,7 +444,7 @@ struct Symbol { // samp_meng.Symbol }; ``` -#### samp_meng.FSymbol - +#### samp_meng.FSymbol - Symbol record #### samp_meng.FSymbol Fields @@ -458,13 +459,14 @@ struct Symbol { // samp_meng.Symbol Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h) ``` -struct FSymbol { // samp_meng.FSymbol - samp_meng::FSymbol* ind_symbol_next; // hash next - samp_meng::Symbol symbol; // - i32 id; // 0 - samp_meng::FOrdq** c_ordq_elems; // array of pointers - u32 c_ordq_n; // array of pointers - u32 c_ordq_max; // capacity of allocated array +struct FSymbol { // samp_meng.FSymbol: Symbol record + samp_meng::FSymbol* ind_symbol_next; // hash next + u32 ind_symbol_hashval; // hash value + samp_meng::Symbol symbol; // + i32 id; // 0 + samp_meng::FOrdq** c_ordq_elems; // array of pointers + u32 c_ordq_n; // array of pointers + u32 c_ordq_max; // capacity of allocated array // reftype Ptrary of samp_meng.FSymbol.c_ordq prohibits copy // func:samp_meng.FSymbol..AssignOp inline samp_meng::FSymbol& operator =(const samp_meng::FSymbol &rhs) = delete; @@ -483,7 +485,7 @@ private: }; ``` -#### samp_meng.FUser - +#### samp_meng.FUser - User record #### samp_meng.FUser Fields @@ -497,12 +499,13 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h) ``` -struct FUser { // samp_meng.FUser - samp_meng::FUser* ind_user_next; // hash next - i32 user; // 0 - samp_meng::FOrder* zd_order_head; // zero-terminated doubly linked list - i32 zd_order_n; // zero-terminated doubly linked list - samp_meng::FOrder* zd_order_tail; // pointer to last element +struct FUser { // samp_meng.FUser: User record + samp_meng::FUser* ind_user_next; // hash next + u32 ind_user_hashval; // hash value + i32 user; // 0 + samp_meng::FOrder* zd_order_head; // zero-terminated doubly linked list + i32 zd_order_n; // zero-terminated doubly linked list + samp_meng::FOrder* zd_order_tail; // pointer to last element // reftype Llist of samp_meng.FUser.zd_order prohibits copy // func:samp_meng.FUser..AssignOp inline samp_meng::FUser& operator =(const samp_meng::FUser &rhs) = delete; @@ -553,7 +556,7 @@ struct MassCancelReqMsg { // samp_meng.MassCancelReqMsg: From user: cancel mass }; ``` -#### samp_meng.MsgHeader - +#### samp_meng.MsgHeader - Message header #### samp_meng.MsgHeader Fields @@ -568,7 +571,7 @@ struct MassCancelReqMsg { // samp_meng.MassCancelReqMsg: From user: cancel mass Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h) ``` #pragma pack(push,1) -struct MsgHeader { // samp_meng.MsgHeader +struct MsgHeader { // samp_meng.MsgHeader: Message header u8 type; // 0 u8 length; // 0 // func:samp_meng.MsgHeader..Ctor @@ -822,7 +825,7 @@ struct OrderTradeMsg { // samp_meng.OrderTradeMsg: From matching engine: trade o }; ``` -#### samp_meng.TextMsg - debug message +#### samp_meng.TextMsg - Debug message #### samp_meng.TextMsg Fields @@ -843,7 +846,7 @@ struct OrderTradeMsg { // samp_meng.OrderTradeMsg: From matching engine: trade o Generated by [amc](/txt/exe/amc/README.md) into [include/gen/samp_meng_gen.h](/include/gen/samp_meng_gen.h) ``` #pragma pack(push,1) -struct TextMsg { // samp_meng.TextMsg: debug message +struct TextMsg { // samp_meng.TextMsg: Debug message u8 type; // 7 u8 length; // ssizeof(parent) + (0) // var-length field samp_meng.TextMsg.text starts here. access it with text_Addr diff --git a/txt/exe/samp_regx/README.md b/txt/exe/samp_regx/README.md index f7074a80..22178329 100644 --- a/txt/exe/samp_regx/README.md +++ b/txt/exe/samp_regx/README.md @@ -20,16 +20,15 @@ Usage: samp_regx [-expr:] [[-string:]] [options] OPTION TYPE DFLT COMMENT -in string "data" Input directory or filename, - for stdin [expr] string Expression - -style int acr Regx style (acr|shell|classic|literal) - acr ACR-style regx - shell Shell-style regx - classic Classic regx - literal Literal string - -match Match a string + -style enum acr Regx style (default|sql|acr|shell|literal) + -trace Trace regx innards + -capture Use capture groups + -full Y Match full string + -f is a filename, grep the lines + -match Match a string, exit code represnts success [string] string "" String to match - -show Show regx innards - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -51,15 +50,24 @@ Usage: samp_regx [-expr:] [[-string:]] [options] #### -style -- Regx style -#### -match -- Match a string +#### -trace -- Trace regx innards + + +#### -capture -- Use capture groups + + +#### -full -- Match full string + + +#### -f -- is a filename, grep the lines + + +#### -match -- Match a string, exit code represnts success #### -string -- String to match -#### -show -- Show regx innards - - ### Inputs diff --git a/txt/exe/sandbox/README.md b/txt/exe/sandbox/README.md index 724f0265..ee867eb4 100644 --- a/txt/exe/sandbox/README.md +++ b/txt/exe/sandbox/README.md @@ -44,10 +44,11 @@ Usage: sandbox [-name:] [[-cmd:]] [options] [cmd]... string Command to execute in sandbox -diff Show diff after running command -files... string Shell regx to diff - -refs string "HEAD" Refs to fetch into sandbox + -refs string "HEAD" Additional list of refs to fetch into sandbox + -ref string "HEAD" Reset to this ref -q Quiet mode - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -206,9 +207,12 @@ $ sandbox test -create "sandbox test2 -create 'command'" -del #### -files -- Shell regx to diff -#### -refs -- Refs to fetch into sandbox +#### -refs -- Additional list of refs to fetch into sandbox +#### -ref -- Reset to this ref + + #### -q -- Quiet mode @@ -221,8 +225,8 @@ $ sandbox test -create "sandbox test2 -create 'command'" -del |Ssimfile|Comment| |---|---| |[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dev.sbpath](/txt/ssimdb/dev/sbpath.md)|Extra files to copy into the sandbox| |[dev.sandbox](/txt/ssimdb/dev/sandbox.md)|Registered sandbox| +|[dev.sbpath](/txt/ssimdb/dev/sbpath.md)|Extra files to copy into the sandbox| diff --git a/txt/exe/sandbox/internals.md b/txt/exe/sandbox/internals.md index 89042ae0..da8c2da4 100644 --- a/txt/exe/sandbox/internals.md +++ b/txt/exe/sandbox/internals.md @@ -103,11 +103,12 @@ struct FDb { // sandbox.FDb: In-memory database for sandbox Generated by [amc](/txt/exe/amc/README.md) into [include/gen/sandbox_gen.h](/include/gen/sandbox_gen.h) ``` struct FSandbox { // sandbox.FSandbox - sandbox::FSandbox* ind_sandbox_next; // hash next - algo::Smallstr50 sandbox; // - algo::Comment comment; // - algo::cstring dir; // - bool select; // false + sandbox::FSandbox* ind_sandbox_next; // hash next + u32 ind_sandbox_hashval; // hash value + algo::Smallstr50 sandbox; // + algo::Comment comment; // + algo::cstring dir; // + bool select; // false // func:sandbox.FSandbox..AssignOp inline sandbox::FSandbox& operator =(const sandbox::FSandbox &rhs) = delete; // func:sandbox.FSandbox..CopyCtor diff --git a/txt/exe/src_func/README.md b/txt/exe/src_func/README.md index f0550399..5bb316a8 100644 --- a/txt/exe/src_func/README.md +++ b/txt/exe/src_func/README.md @@ -17,34 +17,38 @@ ``` src_func: Access / edit functions -Usage: src_func [[-target:]] [[-name:]] [[-body:]] [options] - OPTION TYPE DFLT COMMENT - -in string "data" Input directory or filename, - for stdin - [target] regx "%" Visit these targets - [name] regx "%" Match function name - [body] regx "%" Match function body - -targsrc regx "" Visit these sources (optional) - -func regx "%" (with -listfunc) Match function prototype - -comment regx "%" (with -listfunc) Match function comment - -nextfile string "" Print name of next srcfile in targsrc list - -other (with -nextfile), name of previous file - -updateproto Update prototypes in headers - -listfunc Show functions in target - -iffy Select functions that may contain errors - -proto (with -listfunc) List prototypes only - -gen (with -listfunc) Visit generated files - -showloc Y (with -listfunc) Show file location - -showstatic Y (with -listfunc) Show static functions - -showsortkey (with -listfunc) Display function sortkey - -sortname (with -listfunc) Sort functions by name - -e (with -listfunc) Edit found functions - -baddecl Report and fail on bad declarations - -report - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative - -help Print help and exit; alias -h - -version Print version and exit - -signature Show signatures and exit; alias -sig +Usage: src_func [[-func:]] [options] + OPTION TYPE DFLT COMMENT + -in string "data" Input directory or filename, - for stdin + -targsrc regx "%" (scan) Limit scanning to these sources only + -acrkey regx "%" Select function by acr key that caused it + [func] regx "%" Target.function regex + -nextfile string "" (action) Print name of next srcfile in targsrc list + -other (with -nextfile), name of previous file + -list (action) List matching functions + -updateproto (action) Update prototypes in headers + -createmissing (action) Create missing functions declared in userfunc table + -iffy (filter) Select functions that may contain errors + -gen (scan) Scan generated files + -showloc (output) Show file location + -f (output) -sortname -showcomment -showbody + -showstatic Y (filter) Allow static functions + -matchproto regx "%" (filter) Match function prototype + -matchbody regx "%" (filter) Match function body + -matchcomment regx "%" (filter) Match function comment + -showsortkey (output) Display function sortkey + -showcomment (output) Display function comment + -showbody (output) Print function body + -sortname (output) Sort functions by name + -printssim (output) Print ssim tuples + -e Edit found functions + -baddecl Report and fail on bad declarations + -report Print final report + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative + -help Print help and exit; alias -h + -version Print version and exit + -signature Show signatures and exit; alias -sig ``` @@ -108,64 +112,76 @@ Usage: src_func [[-target:]] [[-name:]] [[-body:]] [options] #### -in -- Input directory or filename, - for stdin -#### -target -- Visit these targets - - -#### -name -- Match function name - - -#### -body -- Match function body - - -#### -targsrc -- Visit these sources (optional) +#### -targsrc -- (scan) Limit scanning to these sources only -#### -func -- (with -listfunc) Match function prototype - +#### -acrkey -- Select function by acr key that caused it + -#### -comment -- (with -listfunc) Match function comment - +#### -func -- Target.function regex + -#### -nextfile -- Print name of next srcfile in targsrc list +#### -nextfile -- (action) Print name of next srcfile in targsrc list -#### -other -- (with -nextfile), name of previous file +#### -other -- (with -nextfile), name of previous file -#### -updateproto -- Update prototypes in headers +#### -list -- (action) List matching functions + + +#### -updateproto -- (action) Update prototypes in headers -#### -listfunc -- Show functions in target - +#### -createmissing -- (action) Create missing functions declared in userfunc table + -#### -iffy -- Select functions that may contain errors +#### -iffy -- (filter) Select functions that may contain errors -#### -proto -- (with -listfunc) List prototypes only - - -#### -gen -- (with -listfunc) Visit generated files +#### -gen -- (scan) Scan generated files -#### -showloc -- (with -listfunc) Show file location +#### -showloc -- (output) Show file location -#### -showstatic -- (with -listfunc) Show static functions +#### -f -- (output) -sortname -showcomment -showbody + + +#### -showstatic -- (filter) Allow static functions -#### -showsortkey -- (with -listfunc) Display function sortkey +#### -matchproto -- (filter) Match function prototype + + +#### -matchbody -- (filter) Match function body + + +#### -matchcomment -- (filter) Match function comment + + +#### -showsortkey -- (output) Display function sortkey -#### -sortname -- (with -listfunc) Sort functions by name +#### -showcomment -- (output) Display function comment + + +#### -showbody -- (output) Print function body + + +#### -sortname -- (output) Sort functions by name -#### -e -- (with -listfunc) Edit found functions +#### -printssim -- (output) Print ssim tuples + + +#### -e -- Edit found functions #### -baddecl -- Report and fail on bad declarations -#### -report -- +#### -report -- Print final report @@ -176,13 +192,11 @@ Usage: src_func [[-target:]] [[-name:]] [[-body:]] [options] `src_func` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dmmeta.gstatic](/txt/ssimdb/dmmeta/gstatic.md)|Load entries for this table at startup time| -|[dmmeta.fstep](/txt/ssimdb/dmmeta/fstep.md)|Generate a main loop step to be executed whenever a field is non-empty| -|[dmmeta.dispatch](/txt/ssimdb/dmmeta/dispatch.md)|Generate code for a multi-way branch| |[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| |[dmmeta.ctypelen](/txt/ssimdb/dmmeta/ctypelen.md)|Size of Ctype| |[dev.target](/txt/ssimdb/dev/target.md)|Build target| |[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|List of sources for target| +|[dmmeta.userfunc](/txt/ssimdb/dmmeta/userfunc.md)|| diff --git a/txt/exe/src_func/internals.md b/txt/exe/src_func/internals.md index 91248d28..6327c906 100644 --- a/txt/exe/src_func/internals.md +++ b/txt/exe/src_func/internals.md @@ -60,18 +60,18 @@ All allocations are done through global `src_func::_db` [src_func.FDb](#src_func |---|---|---|---| |[src_func.FCtypelen](#src_func-fctypelen)|[dmmeta.ctypelen](/txt/ssimdb/dmmeta/ctypelen.md)|FDb.ctypelen (Lary)|ctypelen (Lary, by rowid)|ind_ctypelen (Thash, hash field ctype)| |[src_func.FDb](#src_func-fdb)||FDb._db (Global)| -|[src_func.FDispatch](#src_func-fdispatch)|[dmmeta.dispatch](/txt/ssimdb/dmmeta/dispatch.md)|FDb.dispatch (Lary)|dispatch (Lary, by rowid)| -|[src_func.FFstep](#src_func-ffstep)|[dmmeta.fstep](/txt/ssimdb/dmmeta/fstep.md)|FDb.fstep (Lary)|fstep (Lary, by rowid)| |[src_func.FFunc](#src_func-ffunc)||FDb.func (Lary)|func (Lary, by rowid)|ind_func (Thash, hash field func)|bh_func (Bheap, sort field sortkey)| ||||FTargsrc.zd_func (Llist)| -|[src_func.FGenprefix](#src_func-fgenprefix)||FDb.genprefix (Lary)|genprefix (Lary, by rowid)|ind_genprefix (Thash, hash field genprefix)| -|[src_func.FGstatic](#src_func-fgstatic)|[dmmeta.gstatic](/txt/ssimdb/dmmeta/gstatic.md)|FDb.gstatic (Lary)|gstatic (Lary, by rowid)| +||||FUserfunc.zd_func (Llist)| +|[src_func.FGenaffix](#src_func-fgenaffix)||FDb.genaffix (Lary)|genaffix (Lary, by rowid)|ind_genaffix (Thash, hash field genaffix)| |[src_func.FTarget](#src_func-ftarget)|[dev.target](/txt/ssimdb/dev/target.md)|FDb.target (Lary)|target (Lary, by rowid)|ind_target (Thash, hash field target)| ||||FTargsrc.p_target (Upptr)| |[src_func.FTargsrc](#src_func-ftargsrc)|[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|FDb.targsrc (Lary)|targsrc (Lary, by rowid)|c_cur_targsrc (Ptr)| ||||FFunc.p_targsrc (Upptr)| ||||FFunc.p_written_to (Upptr)| ||||FTarget.cd_targsrc (Llist)| +|[src_func.FUserfunc](#src_func-fuserfunc)|[dmmeta.userfunc](/txt/ssimdb/dmmeta/userfunc.md)|FDb.userfunc (Lary)|userfunc (Lary, by rowid)|ind_userfunc (Thash, hash field userfunc)|ind_userfunc_cppname (Thash, hash field cppname)| +||||FFunc.p_userfunc (Upptr)| #### src_func.FCtypelen - Size of Ctype @@ -89,12 +89,13 @@ All allocations are done through global `src_func::_db` [src_func.FDb](#src_func Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_func_gen.h](/include/gen/src_func_gen.h) ``` struct FCtypelen { // src_func.FCtypelen - algo::Smallstr100 ctype; // Identifies the Ctype - u32 len; // 0 (calculated) length of the C++ struct in bytes - i32 alignment; // 0 (calculated) alignment for the struct - i32 padbytes; // 0 (calculated) total # of pad bytes - bool plaindata; // false (calculated) this struct can me safely memcpy'ed - src_func::FCtypelen* ind_ctypelen_next; // hash next + algo::Smallstr100 ctype; // Identifies the Ctype + u32 len; // 0 (calculated) length of the C++ struct in bytes + i32 alignment; // 0 (calculated) alignment for the struct + i32 padbytes; // 0 (calculated) total # of pad bytes + bool plaindata; // false (calculated) this struct can me safely memcpy'ed + src_func::FCtypelen* ind_ctypelen_next; // hash next + u32 ind_ctypelen_hashval; // hash value // func:src_func.FCtypelen..AssignOp inline src_func::FCtypelen& operator =(const src_func::FCtypelen &rhs) = delete; // func:src_func.FCtypelen..CopyCtor @@ -119,7 +120,6 @@ private: |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| |src_func.FDb.report|[report.src_func](/txt/protocol/report/README.md#report-src_func)|[Val](/txt/exe/amc/reftypes.md#val)||Final report| -|src_func.FDb.genprefix|[src_func.FGenprefix](/txt/exe/src_func/internals.md#src_func-fgenprefix)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |src_func.FDb._db|[src_func.FDb](/txt/exe/src_func/internals.md#src_func-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| |src_func.FDb.cmdline|[command.src_func](/txt/protocol/command/README.md#command-src_func)|[Val](/txt/exe/amc/reftypes.md#val)||| |src_func.FDb.targsrc|[src_func.FTargsrc](/txt/exe/src_func/internals.md#src_func-ftargsrc)|[Lary](/txt/exe/amc/reftypes.md#lary)||| @@ -128,123 +128,65 @@ private: |src_func.FDb.func|[src_func.FFunc](/txt/exe/src_func/internals.md#src_func-ffunc)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |src_func.FDb.ind_func|[src_func.FFunc](/txt/exe/src_func/internals.md#src_func-ffunc)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |src_func.FDb.bh_func|[src_func.FFunc](/txt/exe/src_func/internals.md#src_func-ffunc)|[Bheap](/txt/exe/amc/reftypes.md#bheap)||| -|src_func.FDb.dispatch|[src_func.FDispatch](/txt/exe/src_func/internals.md#src_func-fdispatch)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |src_func.FDb.c_cur_targsrc|[src_func.FTargsrc](/txt/exe/src_func/internals.md#src_func-ftargsrc)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| |src_func.FDb.cur_line|i32|[Val](/txt/exe/amc/reftypes.md#val)||| |src_func.FDb.ignore_funcstart|[algo_lib.Regx](/txt/lib/algo_lib/README.md#algo_lib-regx)|[Val](/txt/exe/amc/reftypes.md#val)||| -|src_func.FDb.fstep|[src_func.FFstep](/txt/exe/src_func/internals.md#src_func-ffstep)|[Lary](/txt/exe/amc/reftypes.md#lary)||| -|src_func.FDb.gstatic|[src_func.FGstatic](/txt/exe/src_func/internals.md#src_func-fgstatic)|[Lary](/txt/exe/amc/reftypes.md#lary)||| -|src_func.FDb.ind_genprefix|[src_func.FGenprefix](/txt/exe/src_func/internals.md#src_func-fgenprefix)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |src_func.FDb.ctypelen|[src_func.FCtypelen](/txt/exe/src_func/internals.md#src_func-fctypelen)|[Lary](/txt/exe/amc/reftypes.md#lary)||| |src_func.FDb.ind_ctypelen|[src_func.FCtypelen](/txt/exe/src_func/internals.md#src_func-fctypelen)|[Thash](/txt/exe/amc/reftypes.md#thash)||| |src_func.FDb.printed_user_impl_notice|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|src_func.FDb.userfunc|[src_func.FUserfunc](/txt/exe/src_func/internals.md#src_func-fuserfunc)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|src_func.FDb.ind_userfunc|[src_func.FUserfunc](/txt/exe/src_func/internals.md#src_func-fuserfunc)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|src_func.FDb.ind_userfunc_cppname|[src_func.FUserfunc](/txt/exe/src_func/internals.md#src_func-fuserfunc)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|src_func.FDb.editloc|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||List of locations to edit| +|src_func.FDb.genaffix|[src_func.FGenaffix](/txt/exe/src_func/internals.md#src_func-fgenaffix)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|src_func.FDb.ind_genaffix|[src_func.FGenaffix](/txt/exe/src_func/internals.md#src_func-fgenaffix)|[Thash](/txt/exe/amc/reftypes.md#thash)||| #### Struct FDb Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_func_gen.h](/include/gen/src_func_gen.h) ``` struct FDb { // src_func.FDb: In-memory database for src_func - report::src_func report; // Final report - src_func::FGenprefix* genprefix_lary[32]; // level array - i32 genprefix_n; // number of elements in array - command::src_func cmdline; // - src_func::FTargsrc* targsrc_lary[32]; // level array - i32 targsrc_n; // number of elements in array - src_func::FTarget* target_lary[32]; // level array - i32 target_n; // number of elements in array - src_func::FTarget** ind_target_buckets_elems; // pointer to bucket array - i32 ind_target_buckets_n; // number of elements in bucket array - i32 ind_target_n; // number of elements in the hash table - src_func::FFunc* func_lary[32]; // level array - i32 func_n; // number of elements in array - src_func::FFunc** ind_func_buckets_elems; // pointer to bucket array - i32 ind_func_buckets_n; // number of elements in bucket array - i32 ind_func_n; // number of elements in the hash table - src_func::FFunc** bh_func_elems; // binary heap by sortkey - i32 bh_func_n; // number of elements in the heap - i32 bh_func_max; // max elements in bh_func_elems - src_func::FDispatch* dispatch_lary[32]; // level array - i32 dispatch_n; // number of elements in array - src_func::FTargsrc* c_cur_targsrc; // optional pointer - i32 cur_line; // 0 - algo_lib::Regx ignore_funcstart; // - src_func::FFstep* fstep_lary[32]; // level array - i32 fstep_n; // number of elements in array - src_func::FGstatic* gstatic_lary[32]; // level array - i32 gstatic_n; // number of elements in array - src_func::FGenprefix** ind_genprefix_buckets_elems; // pointer to bucket array - i32 ind_genprefix_buckets_n; // number of elements in bucket array - i32 ind_genprefix_n; // number of elements in the hash table - src_func::FCtypelen* ctypelen_lary[32]; // level array - i32 ctypelen_n; // number of elements in array - src_func::FCtypelen** ind_ctypelen_buckets_elems; // pointer to bucket array - i32 ind_ctypelen_buckets_n; // number of elements in bucket array - i32 ind_ctypelen_n; // number of elements in the hash table - bool printed_user_impl_notice; // false - src_func::trace trace; // -}; -``` - -#### src_func.FDispatch - Generate code for a multi-way branch - - -#### src_func.FDispatch Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|src_func.FDispatch.base|[dmmeta.Dispatch](/txt/ssimdb/dmmeta/dispatch.md)|[Base](/txt/ssimdb/dmmeta/dispatch.md)||| - -#### Struct FDispatch - -*Note:* field ``src_func.FDispatch.base`` has reftype ``base`` so the fields of [dmmeta.Dispatch](/txt/ssimdb/dmmeta/dispatch.md) above are included into the resulting struct. - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_func_gen.h](/include/gen/src_func_gen.h) -``` -struct FDispatch { // src_func.FDispatch - algo::Smallstr50 dispatch; // Primary key (ns.name) - bool unk; // false Want default case? - bool read; // false Generate read function - bool print; // false Generate print function - bool haslen; // false Include length in dispatch function - bool call; // false Generate call to user-defined function - bool strict; // false Only dispatch if length matches exactly - algo::Comment comment; // -private: - // func:src_func.FDispatch..Ctor - inline FDispatch() __attribute__((nothrow)); - friend src_func::FDispatch& dispatch_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend src_func::FDispatch* dispatch_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void dispatch_RemoveAll() __attribute__((nothrow)); - friend void dispatch_RemoveLast() __attribute__((nothrow)); -}; -``` - -#### src_func.FFstep - Generate a main loop step to be executed whenever a field is non-empty - - -#### src_func.FFstep Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|src_func.FFstep.base|[dmmeta.Fstep](/txt/ssimdb/dmmeta/fstep.md)|[Base](/txt/ssimdb/dmmeta/fstep.md)||| - -#### Struct FFstep - -*Note:* field ``src_func.FFstep.base`` has reftype ``base`` so the fields of [dmmeta.Fstep](/txt/ssimdb/dmmeta/fstep.md) above are included into the resulting struct. - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_func_gen.h](/include/gen/src_func_gen.h) -``` -struct FFstep { // src_func.FFstep - algo::Smallstr100 fstep; // - algo::Smallstr50 steptype; // - algo::Comment comment; // -private: - // func:src_func.FFstep..Ctor - inline FFstep() __attribute__((nothrow)); - friend src_func::FFstep& fstep_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend src_func::FFstep* fstep_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void fstep_RemoveAll() __attribute__((nothrow)); - friend void fstep_RemoveLast() __attribute__((nothrow)); + report::src_func report; // Final report + command::src_func cmdline; // + src_func::FTargsrc* targsrc_lary[32]; // level array + i32 targsrc_n; // number of elements in array + src_func::FTarget* target_lary[32]; // level array + i32 target_n; // number of elements in array + src_func::FTarget** ind_target_buckets_elems; // pointer to bucket array + i32 ind_target_buckets_n; // number of elements in bucket array + i32 ind_target_n; // number of elements in the hash table + src_func::FFunc* func_lary[32]; // level array + i32 func_n; // number of elements in array + src_func::FFunc** ind_func_buckets_elems; // pointer to bucket array + i32 ind_func_buckets_n; // number of elements in bucket array + i32 ind_func_n; // number of elements in the hash table + src_func::FFunc** bh_func_elems; // binary heap by sortkey + i32 bh_func_n; // number of elements in the heap + i32 bh_func_max; // max elements in bh_func_elems + src_func::FTargsrc* c_cur_targsrc; // optional pointer + i32 cur_line; // 0 + algo_lib::Regx ignore_funcstart; // + src_func::FCtypelen* ctypelen_lary[32]; // level array + i32 ctypelen_n; // number of elements in array + src_func::FCtypelen** ind_ctypelen_buckets_elems; // pointer to bucket array + i32 ind_ctypelen_buckets_n; // number of elements in bucket array + i32 ind_ctypelen_n; // number of elements in the hash table + bool printed_user_impl_notice; // false + src_func::FUserfunc* userfunc_lary[32]; // level array + i32 userfunc_n; // number of elements in array + src_func::FUserfunc** ind_userfunc_buckets_elems; // pointer to bucket array + i32 ind_userfunc_buckets_n; // number of elements in bucket array + i32 ind_userfunc_n; // number of elements in the hash table + src_func::FUserfunc** ind_userfunc_cppname_buckets_elems; // pointer to bucket array + i32 ind_userfunc_cppname_buckets_n; // number of elements in bucket array + i32 ind_userfunc_cppname_n; // number of elements in the hash table + algo::cstring editloc; // List of locations to edit + src_func::FGenaffix* genaffix_lary[32]; // level array + i32 genaffix_n; // number of elements in array + src_func::FGenaffix** ind_genaffix_buckets_elems; // pointer to bucket array + i32 ind_genaffix_buckets_n; // number of elements in bucket array + i32 ind_genaffix_n; // number of elements in the hash table + src_func::trace trace; // }; ``` @@ -256,43 +198,48 @@ private: |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| |src_func.FFunc.func|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||First line of function -- primary key| +|src_func.FFunc.name|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Function name in the form ns.name| |src_func.FFunc.args|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Argument list -- everything beyond first open parenthesis| |src_func.FFunc.sortkey|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| |src_func.FFunc.body|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Function body| -|src_func.FFunc.p_targsrc|[src_func.FTargsrc](/txt/exe/src_func/internals.md#src_func-ftargsrc)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| -|src_func.FFunc.line|i32|[Val](/txt/exe/amc/reftypes.md#val)||Line where function started| +|src_func.FFunc.p_targsrc|[src_func.FTargsrc](/txt/exe/src_func/internals.md#src_func-ftargsrc)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Pointer to source file| +|src_func.FFunc.line|i32|[Val](/txt/exe/amc/reftypes.md#val)||Line number where function started| |src_func.FFunc.precomment|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Comments that appeare before function body| |src_func.FFunc.isstatic|bool|[Val](/txt/exe/amc/reftypes.md#val)||Static?| |src_func.FFunc.isinline|bool|[Val](/txt/exe/amc/reftypes.md#val)||Inline?| -|src_func.FFunc.amcprot|bool|[Val](/txt/exe/amc/reftypes.md#val)||Looks like a function where amc has already provided prototype?| |src_func.FFunc.select|bool|[Val](/txt/exe/amc/reftypes.md#val)||Select for further processing| -|src_func.FFunc.iffy|bool|[Val](/txt/exe/amc/reftypes.md#val)||| -|src_func.FFunc.mystery|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|src_func.FFunc.iffy|bool|[Val](/txt/exe/amc/reftypes.md#val)||Something wrong with the declaration| +|src_func.FFunc.mystery|bool|[Val](/txt/exe/amc/reftypes.md#val)||Non-static and missing a comment| |src_func.FFunc.p_written_to|[src_func.FTargsrc](/txt/exe/src_func/internals.md#src_func-ftargsrc)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||If non-NULL, header where this function is written| +|src_func.FFunc.p_userfunc|[src_func.FUserfunc](/txt/exe/src_func/internals.md#src_func-fuserfunc)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| #### Struct FFunc Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_func_gen.h](/include/gen/src_func_gen.h) ``` struct FFunc { // src_func.FFunc - src_func::FFunc* ind_func_next; // hash next - i32 bh_func_idx; // index in heap; -1 means not-in-heap - algo::cstring func; // First line of function -- primary key - algo::cstring args; // Argument list -- everything beyond first open parenthesis - algo::cstring sortkey; // - algo::cstring body; // Function body - src_func::FTargsrc* p_targsrc; // reference to parent row - i32 line; // 0 Line where function started - algo::cstring precomment; // Comments that appeare before function body - bool isstatic; // false Static? - bool isinline; // false Inline? - bool amcprot; // false Looks like a function where amc has already provided prototype? - bool select; // false Select for further processing - bool iffy; // false - bool mystery; // false - src_func::FTargsrc* p_written_to; // reference to parent row - src_func::FFunc* zd_func_next; // zslist link; -1 means not-in-list - src_func::FFunc* zd_func_prev; // previous element + src_func::FFunc* ind_func_next; // hash next + u32 ind_func_hashval; // hash value + i32 bh_func_idx; // index in heap; -1 means not-in-heap + algo::cstring func; // First line of function -- primary key + algo::cstring name; // Function name in the form ns.name + algo::cstring args; // Argument list -- everything beyond first open parenthesis + algo::cstring sortkey; // + algo::cstring body; // Function body + src_func::FTargsrc* p_targsrc; // reference to parent row + i32 line; // 0 Line number where function started + algo::cstring precomment; // Comments that appeare before function body + bool isstatic; // false Static? + bool isinline; // false Inline? + bool select; // false Select for further processing + bool iffy; // false Something wrong with the declaration + bool mystery; // false Non-static and missing a comment + src_func::FTargsrc* p_written_to; // reference to parent row + src_func::FUserfunc* p_userfunc; // reference to parent row + src_func::FFunc* targsrc_zd_func_next; // zslist link; -1 means not-in-list + src_func::FFunc* targsrc_zd_func_prev; // previous element + src_func::FFunc* userfunc_zd_func_next; // zslist link; -1 means not-in-list + src_func::FFunc* userfunc_zd_func_prev; // previous element // func:src_func.FFunc..AssignOp src_func::FFunc& operator =(const src_func::FFunc &rhs) = delete; // func:src_func.FFunc..CopyCtor @@ -309,63 +256,36 @@ private: }; ``` -#### src_func.FGenprefix - Prefixes of generated functions, skip generating prototypes for those - +#### src_func.FGenaffix - Prefix or suffix of a generated function -- skip generating prototype + -#### src_func.FGenprefix Fields - +#### src_func.FGenaffix Fields + |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|src_func.FGenprefix.genprefix|[dmmeta.Field](/txt/ssimdb/dmmeta/field.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| +|src_func.FGenaffix.genaffix|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| -#### Struct FGenprefix - +#### Struct FGenaffix + Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_func_gen.h](/include/gen/src_func_gen.h) ``` -struct FGenprefix { // src_func.FGenprefix: Prefixes of generated functions, skip generating prototypes for those - src_func::FGenprefix* ind_genprefix_next; // hash next - algo::Smallstr100 genprefix; // - // func:src_func.FGenprefix..AssignOp - inline src_func::FGenprefix& operator =(const src_func::FGenprefix &rhs) = delete; - // func:src_func.FGenprefix..CopyCtor - inline FGenprefix(const src_func::FGenprefix &rhs) = delete; +struct FGenaffix { // src_func.FGenaffix: Prefix or suffix of a generated function -- skip generating prototype + src_func::FGenaffix* ind_genaffix_next; // hash next + u32 ind_genaffix_hashval; // hash value + algo::cstring genaffix; // + // func:src_func.FGenaffix..AssignOp + inline src_func::FGenaffix& operator =(const src_func::FGenaffix &rhs) = delete; + // func:src_func.FGenaffix..CopyCtor + inline FGenaffix(const src_func::FGenaffix &rhs) = delete; private: - // func:src_func.FGenprefix..Ctor - inline FGenprefix() __attribute__((nothrow)); - // func:src_func.FGenprefix..Dtor - inline ~FGenprefix() __attribute__((nothrow)); - friend src_func::FGenprefix& genprefix_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend src_func::FGenprefix* genprefix_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void genprefix_RemoveAll() __attribute__((nothrow)); - friend void genprefix_RemoveLast() __attribute__((nothrow)); -}; -``` - -#### src_func.FGstatic - Load entries for this table at startup time - - -#### src_func.FGstatic Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|src_func.FGstatic.base|[dmmeta.Gstatic](/txt/ssimdb/dmmeta/gstatic.md)|[Base](/txt/ssimdb/dmmeta/gstatic.md)||| - -#### Struct FGstatic - -*Note:* field ``src_func.FGstatic.base`` has reftype ``base`` so the fields of [dmmeta.Gstatic](/txt/ssimdb/dmmeta/gstatic.md) above are included into the resulting struct. - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_func_gen.h](/include/gen/src_func_gen.h) -``` -struct FGstatic { // src_func.FGstatic - algo::Smallstr100 field; // - algo::Comment comment; // -private: - // func:src_func.FGstatic..Ctor - inline FGstatic() __attribute__((nothrow)); - friend src_func::FGstatic& gstatic_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend src_func::FGstatic* gstatic_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void gstatic_RemoveAll() __attribute__((nothrow)); - friend void gstatic_RemoveLast() __attribute__((nothrow)); + // func:src_func.FGenaffix..Ctor + inline FGenaffix() __attribute__((nothrow)); + // func:src_func.FGenaffix..Dtor + inline ~FGenaffix() __attribute__((nothrow)); + friend src_func::FGenaffix& genaffix_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend src_func::FGenaffix* genaffix_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void genaffix_RemoveAll() __attribute__((nothrow)); + friend void genaffix_RemoveLast() __attribute__((nothrow)); }; ``` @@ -378,7 +298,6 @@ private: |---|---|---|---|---| |src_func.FTarget.base|[dev.Target](/txt/ssimdb/dev/target.md)|[Base](/txt/ssimdb/dev/target.md)||| |src_func.FTarget.cd_targsrc|[src_func.FTargsrc](/txt/exe/src_func/internals.md#src_func-ftargsrc)|[Llist](/txt/exe/amc/reftypes.md#llist)||| -|src_func.FTarget.select|bool|[Val](/txt/exe/amc/reftypes.md#val)||| #### Struct FTarget @@ -387,11 +306,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_func_gen.h](/include/gen/src_func_gen.h) ``` struct FTarget { // src_func.FTarget - src_func::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target - src_func::FTargsrc* cd_targsrc_head; // zero-terminated doubly linked list - i32 cd_targsrc_n; // zero-terminated doubly linked list - bool select; // false + src_func::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target + src_func::FTargsrc* cd_targsrc_head; // zero-terminated doubly linked list + i32 cd_targsrc_n; // zero-terminated doubly linked list // reftype Llist of src_func.FTarget.cd_targsrc prohibits copy // func:src_func.FTarget..AssignOp inline src_func::FTarget& operator =(const src_func::FTarget &rhs) = delete; @@ -420,6 +339,7 @@ private: |src_func.FTargsrc.zd_func|[src_func.FFunc](/txt/exe/src_func/internals.md#src_func-ffunc)|[Llist](/txt/exe/amc/reftypes.md#llist)||| |src_func.FTargsrc.p_target|[src_func.FTarget](/txt/exe/src_func/internals.md#src_func-ftarget)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| |src_func.FTargsrc.select|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|src_func.FTargsrc.counter|i32|[Val](/txt/exe/amc/reftypes.md#val)||| #### Struct FTargsrc @@ -428,23 +348,24 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_func_gen.h](/include/gen/src_func_gen.h) ``` struct FTargsrc { // src_func.FTargsrc - src_func::FTargsrc* cd_targsrc_next; // zslist link; -1 means not-in-list - src_func::FTargsrc* cd_targsrc_prev; // previous element - algo::Smallstr100 targsrc; // - algo::Comment comment; // - src_func::FFunc* zd_func_head; // zero-terminated doubly linked list - i32 zd_func_n; // zero-terminated doubly linked list - src_func::FFunc* zd_func_tail; // pointer to last element - src_func::FTarget* p_target; // reference to parent row - bool select; // false + src_func::FTargsrc* target_cd_targsrc_next; // zslist link; -1 means not-in-list + src_func::FTargsrc* target_cd_targsrc_prev; // previous element + algo::Smallstr100 targsrc; // + algo::Comment comment; // + src_func::FFunc* zd_func_head; // zero-terminated doubly linked list + i32 zd_func_n; // zero-terminated doubly linked list + src_func::FFunc* zd_func_tail; // pointer to last element + src_func::FTarget* p_target; // reference to parent row + bool select; // false + i32 counter; // 0 // reftype Llist of src_func.FTargsrc.zd_func prohibits copy // x-reference on src_func.FTargsrc.p_target prevents copy // func:src_func.FTargsrc..AssignOp - inline src_func::FTargsrc& operator =(const src_func::FTargsrc &rhs) = delete; + src_func::FTargsrc& operator =(const src_func::FTargsrc &rhs) = delete; // reftype Llist of src_func.FTargsrc.zd_func prohibits copy // x-reference on src_func.FTargsrc.p_target prevents copy // func:src_func.FTargsrc..CopyCtor - inline FTargsrc(const src_func::FTargsrc &rhs) = delete; + FTargsrc(const src_func::FTargsrc &rhs) = delete; private: // func:src_func.FTargsrc..Ctor inline FTargsrc() __attribute__((nothrow)); @@ -456,5 +377,51 @@ private: }; ``` +#### src_func.FUserfunc - + + +#### src_func.FUserfunc Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|src_func.FUserfunc.base|[dmmeta.Userfunc](/txt/ssimdb/dmmeta/userfunc.md)|[Base](/txt/ssimdb/dmmeta/userfunc.md)||| +|src_func.FUserfunc.zd_func|[src_func.FFunc](/txt/exe/src_func/internals.md#src_func-ffunc)|[Llist](/txt/exe/amc/reftypes.md#llist)||| + +#### Struct FUserfunc + +*Note:* field ``src_func.FUserfunc.base`` has reftype ``base`` so the fields of [dmmeta.Userfunc](/txt/ssimdb/dmmeta/userfunc.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_func_gen.h](/include/gen/src_func_gen.h) +``` +struct FUserfunc { // src_func.FUserfunc + src_func::FUserfunc* ind_userfunc_next; // hash next + u32 ind_userfunc_hashval; // hash value + src_func::FUserfunc* ind_userfunc_cppname_next; // hash next + u32 ind_userfunc_cppname_hashval; // hash value + algo::Smallstr50 userfunc; // + algo::Smallstr200 acrkey; // + algo::Smallstr100 cppname; // + algo::Comment comment; // + src_func::FFunc* zd_func_head; // zero-terminated doubly linked list + i32 zd_func_n; // zero-terminated doubly linked list + src_func::FFunc* zd_func_tail; // pointer to last element + // reftype Llist of src_func.FUserfunc.zd_func prohibits copy + // func:src_func.FUserfunc..AssignOp + inline src_func::FUserfunc& operator =(const src_func::FUserfunc &rhs) = delete; + // reftype Llist of src_func.FUserfunc.zd_func prohibits copy + // func:src_func.FUserfunc..CopyCtor + inline FUserfunc(const src_func::FUserfunc &rhs) = delete; +private: + // func:src_func.FUserfunc..Ctor + inline FUserfunc() __attribute__((nothrow)); + // func:src_func.FUserfunc..Dtor + inline ~FUserfunc() __attribute__((nothrow)); + friend src_func::FUserfunc& userfunc_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend src_func::FUserfunc* userfunc_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void userfunc_RemoveAll() __attribute__((nothrow)); + friend void userfunc_RemoveLast() __attribute__((nothrow)); +}; +``` + diff --git a/txt/exe/src_hdr/README.md b/txt/exe/src_hdr/README.md index e80da19a..d7a42afc 100644 --- a/txt/exe/src_hdr/README.md +++ b/txt/exe/src_hdr/README.md @@ -24,8 +24,8 @@ Usage: src_hdr [options] -indent Indent source files -update_copyright Update copyright year for current company -scriptfile regx "" Regx of scripts to update header - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -64,14 +64,14 @@ Usage: src_hdr [options] `src_hdr` takes the following tables on input: |Ssimfile|Comment| |---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dev.copyright](/txt/ssimdb/dev/copyright.md)|Copyrighting entity| |[dev.license](/txt/ssimdb/dev/license.md)|Source code license| |[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| |[dmmeta.nsx](/txt/ssimdb/dmmeta/nsx.md)|Control code-generation and exception handling options for process/library| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dev.scriptfile](/txt/ssimdb/dev/scriptfile.md)|Known script file| |[dev.target](/txt/ssimdb/dev/target.md)|Build target| |[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|List of sources for target| -|[dev.scriptfile](/txt/ssimdb/dev/scriptfile.md)|Known script file| -|[dev.copyright](/txt/ssimdb/dev/copyright.md)|Copyrighting entity| diff --git a/txt/exe/src_hdr/internals.md b/txt/exe/src_hdr/internals.md index 0b89ccce..e3d21b4e 100644 --- a/txt/exe/src_hdr/internals.md +++ b/txt/exe/src_hdr/internals.md @@ -84,9 +84,10 @@ All allocations are done through global `src_hdr::_db` [src_hdr.FDb](#src_hdr-fd Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_hdr_gen.h](/include/gen/src_hdr_gen.h) ``` struct FCopyline { // src_hdr.FCopyline - algo::cstring fcopyline; // - src_hdr::FCopyline* fcopyline_next; // Pointer to next free element int tpool - src_hdr::FCopyline* ind_fcopyline_next; // hash next + algo::cstring fcopyline; // + src_hdr::FCopyline* fcopyline_next; // Pointer to next free element int tpool + src_hdr::FCopyline* ind_fcopyline_next; // hash next + u32 ind_fcopyline_hashval; // hash value // func:src_hdr.FCopyline..AssignOp inline src_hdr::FCopyline& operator =(const src_hdr::FCopyline &rhs) = delete; // func:src_hdr.FCopyline..CopyCtor @@ -120,13 +121,14 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_hdr_gen.h](/include/gen/src_hdr_gen.h) ``` struct FCopyright { // src_hdr.FCopyright - algo::Smallstr50 copyright; // - bool dflt; // false - algo::Comment comment; // - algo::cstring years; // - i32 sortkey; // 0 - src_hdr::FCopyright* ind_copyright_next; // hash next - i32 bh_copyright_idx; // index in heap; -1 means not-in-heap + algo::Smallstr50 copyright; // + bool dflt; // false + algo::Comment comment; // + algo::cstring years; // + i32 sortkey; // 0 + src_hdr::FCopyright* ind_copyright_next; // hash next + u32 ind_copyright_hashval; // hash value + i32 bh_copyright_idx; // index in heap; -1 means not-in-heap // func:src_hdr.FCopyright..AssignOp inline src_hdr::FCopyright& operator =(const src_hdr::FCopyright &rhs) = delete; // func:src_hdr.FCopyright..CopyCtor @@ -230,10 +232,11 @@ struct FDb { // src_hdr.FDb: In-memory database for src_hdr Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_hdr_gen.h](/include/gen/src_hdr_gen.h) ``` struct FLicense { // src_hdr.FLicense - src_hdr::FLicense* ind_license_next; // hash next - algo::Smallstr50 license; // - algo::Comment comment; // - algo::cstring text; // + src_hdr::FLicense* ind_license_next; // hash next + u32 ind_license_hashval; // hash value + algo::Smallstr50 license; // + algo::Comment comment; // + algo::cstring text; // // func:src_hdr.FLicense..AssignOp inline src_hdr::FLicense& operator =(const src_hdr::FLicense &rhs) = delete; // func:src_hdr.FLicense..CopyCtor @@ -268,13 +271,14 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_hdr_gen.h](/include/gen/src_hdr_gen.h) ``` struct FNs { // src_hdr.FNs - src_hdr::FNs* ind_ns_next; // hash next - algo::Smallstr16 ns; // Namespace name (primary key) - algo::Smallstr50 nstype; // Namespace type - algo::Smallstr50 license; // Associated license - algo::Comment comment; // - src_hdr::FNsx* c_nsx; // optional pointer - src_hdr::FLicense* p_license; // reference to parent row + src_hdr::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value + algo::Smallstr16 ns; // Namespace name (primary key) + algo::Smallstr50 nstype; // Namespace type + algo::Smallstr50 license; // Associated license + algo::Comment comment; // + src_hdr::FNsx* c_nsx; // optional pointer + src_hdr::FLicense* p_license; // reference to parent row // x-reference on src_hdr.FNs.c_nsx prevents copy // x-reference on src_hdr.FNs.p_license prevents copy // func:src_hdr.FNs..AssignOp @@ -421,12 +425,13 @@ struct FSrc { // src_hdr.FSrc Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_hdr_gen.h](/include/gen/src_hdr_gen.h) ``` struct FTarget { // src_hdr.FTarget - src_hdr::FTarget* ind_target_next; // hash next - algo::Smallstr16 target; // Primary key - name of target - src_hdr::FTargsrc** c_targsrc_elems; // array of pointers - u32 c_targsrc_n; // array of pointers - u32 c_targsrc_max; // capacity of allocated array - src_hdr::FNs* p_ns; // reference to parent row + src_hdr::FTarget* ind_target_next; // hash next + u32 ind_target_hashval; // hash value + algo::Smallstr16 target; // Primary key - name of target + src_hdr::FTargsrc** c_targsrc_elems; // array of pointers + u32 c_targsrc_n; // array of pointers + u32 c_targsrc_max; // capacity of allocated array + src_hdr::FNs* p_ns; // reference to parent row // reftype Ptrary of src_hdr.FTarget.c_targsrc prohibits copy // x-reference on src_hdr.FTarget.p_ns prevents copy // func:src_hdr.FTarget..AssignOp diff --git a/txt/exe/src_lim/README.md b/txt/exe/src_lim/README.md index 4c565949..7e312902 100644 --- a/txt/exe/src_lim/README.md +++ b/txt/exe/src_lim/README.md @@ -26,8 +26,8 @@ Usage: src_lim [options] -write Update ssim database (with -capture) -badchar Check for bad chars in source files -badline regx "" Check badline (acr badline) - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -72,12 +72,12 @@ Usage: src_lim [options] `src_lim` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dev.gitfile](/txt/ssimdb/dev/gitfile.md)|File managed by git| |[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|List of sources for target| -|[dev.linelim](/txt/ssimdb/dev/linelim.md)|| -|[dev.include](/txt/ssimdb/dev/include.md)|A site where one file includes another| |[dev.badline](/txt/ssimdb/dev/badline.md)|Regex of a dubious source code line| +|[dev.gitfile](/txt/ssimdb/dev/gitfile.md)|File managed by git| +|[dev.include](/txt/ssimdb/dev/include.md)|A site where one file includes another| +|[dev.linelim](/txt/ssimdb/dev/linelim.md)|| +|[dev.targsrc](/txt/ssimdb/dev/targsrc.md)|List of sources for target| diff --git a/txt/exe/src_lim/internals.md b/txt/exe/src_lim/internals.md index 4eb31c16..ee277491 100644 --- a/txt/exe/src_lim/internals.md +++ b/txt/exe/src_lim/internals.md @@ -157,13 +157,14 @@ struct FDb { // src_lim.FDb: In-memory database for src_lim Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_lim_gen.h](/include/gen/src_lim_gen.h) ``` struct FGitfile { // src_lim.FGitfile - src_lim::FGitfile* ind_gitfile_next; // hash next - algo::Smallstr200 gitfile; // - src_lim::FInclude* zd_include_head; // zero-terminated doubly linked list - i32 zd_include_n; // zero-terminated doubly linked list - src_lim::FInclude* zd_include_tail; // pointer to last element - src_lim::FLinelim* c_linelim; // optional pointer - src_lim::FTargsrc* c_targsrc; // optional pointer + src_lim::FGitfile* ind_gitfile_next; // hash next + u32 ind_gitfile_hashval; // hash value + algo::Smallstr200 gitfile; // + src_lim::FInclude* zd_include_head; // zero-terminated doubly linked list + i32 zd_include_n; // zero-terminated doubly linked list + src_lim::FInclude* zd_include_tail; // pointer to last element + src_lim::FLinelim* c_linelim; // optional pointer + src_lim::FTargsrc* c_targsrc; // optional pointer // reftype Llist of src_lim.FGitfile.zd_include prohibits copy // x-reference on src_lim.FGitfile.c_linelim prevents copy // x-reference on src_lim.FGitfile.c_targsrc prevents copy @@ -201,11 +202,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/src_lim_gen.h](/include/gen/src_lim_gen.h) ``` struct FInclude { // src_lim.FInclude - src_lim::FInclude* zd_include_next; // zslist link; -1 means not-in-list - src_lim::FInclude* zd_include_prev; // previous element - algo::Smallstr200 include; // - bool sys; // false - algo::Comment comment; // + src_lim::FInclude* gitfile_zd_include_next; // zslist link; -1 means not-in-list + src_lim::FInclude* gitfile_zd_include_prev; // previous element + algo::Smallstr200 include; // + bool sys; // false + algo::Comment comment; // // func:src_lim.FInclude..AssignOp inline src_lim::FInclude& operator =(const src_lim::FInclude &rhs) = delete; // func:src_lim.FInclude..CopyCtor diff --git a/txt/exe/ssim2csv/README.md b/txt/exe/ssim2csv/README.md index 2cb76dec..71759d5b 100644 --- a/txt/exe/ssim2csv/README.md +++ b/txt/exe/ssim2csv/README.md @@ -20,8 +20,8 @@ Usage: ssim2csv [options] OPTION TYPE DFLT COMMENT -expand string "" -ignoreQuote - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig diff --git a/txt/exe/ssim2csv/internals.md b/txt/exe/ssim2csv/internals.md index 317368b5..af33d788 100644 --- a/txt/exe/ssim2csv/internals.md +++ b/txt/exe/ssim2csv/internals.md @@ -115,8 +115,9 @@ struct FDb { // ssim2csv.FDb: In-memory database for ssim2csv Generated by [amc](/txt/exe/amc/README.md) into [include/gen/ssim2csv_gen.h](/include/gen/ssim2csv_gen.h) ``` struct FExpand { // ssim2csv.FExpand - ssim2csv::FExpand* ind_expand_next; // hash next - algo::cstring expand; // + ssim2csv::FExpand* ind_expand_next; // hash next + u32 ind_expand_hashval; // hash value + algo::cstring expand; // // func:ssim2csv.FExpand..AssignOp inline ssim2csv::FExpand& operator =(const ssim2csv::FExpand &rhs) = delete; // func:ssim2csv.FExpand..CopyCtor @@ -171,10 +172,11 @@ struct FFlatten { // ssim2csv.FFlatten Generated by [amc](/txt/exe/amc/README.md) into [include/gen/ssim2csv_gen.h](/include/gen/ssim2csv_gen.h) ``` struct FOutfile { // ssim2csv.FOutfile - ssim2csv::FOutfile* ind_outfile_next; // hash next - algo_lib::FFildes fildes; // - algo::cstring header; // - algo::cstring outfile; // + ssim2csv::FOutfile* ind_outfile_next; // hash next + u32 ind_outfile_hashval; // hash value + algo_lib::FFildes fildes; // + algo::cstring header; // + algo::cstring outfile; // // func:ssim2csv.FOutfile..AssignOp inline ssim2csv::FOutfile& operator =(const ssim2csv::FOutfile &rhs) = delete; // func:ssim2csv.FOutfile..CopyCtor diff --git a/txt/exe/ssim2mysql/README.md b/txt/exe/ssim2mysql/README.md index 1bda128b..d9a6aaef 100644 --- a/txt/exe/ssim2mysql/README.md +++ b/txt/exe/ssim2mysql/README.md @@ -29,8 +29,8 @@ Usage: ssim2mysql [options] -db string "" Optional database name -createdb Emit CREATE DATABASE code for namespace specified with -fkey Enable foreign key constraints (uses InnoDB storage engine) - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -84,13 +84,13 @@ Usage: ssim2mysql [options] `ssim2mysql` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| |[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| diff --git a/txt/exe/ssim2mysql/internals.md b/txt/exe/ssim2mysql/internals.md index 1900aa1d..ab00b9b1 100644 --- a/txt/exe/ssim2mysql/internals.md +++ b/txt/exe/ssim2mysql/internals.md @@ -133,6 +133,7 @@ struct FColumn { // ssim2mysql.FColumn bool is_pkey; // false bool ssimfile_c_column_in_ary; // false membership flag ssim2mysql::FColumn* ind_column_next; // hash next + u32 ind_column_hashval; // hash value // func:ssim2mysql.FColumn..AssignOp inline ssim2mysql::FColumn& operator =(const ssim2mysql::FColumn &rhs) = delete; // func:ssim2mysql.FColumn..CopyCtor @@ -169,15 +170,16 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/ssim2mysql_gen.h](/include/gen/ssim2mysql_gen.h) ``` struct FCtype { // ssim2mysql.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - ssim2mysql::FNs* p_ns; // reference to parent row - ssim2mysql::FSqltype* c_sqltype; // optional pointer - ssim2mysql::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - ssim2mysql::FSsimfile* c_ssimfile; // optional pointer - ssim2mysql::FCtype* ind_ctype_next; // hash next + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + ssim2mysql::FNs* p_ns; // reference to parent row + ssim2mysql::FSqltype* c_sqltype; // optional pointer + ssim2mysql::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + ssim2mysql::FSsimfile* c_ssimfile; // optional pointer + ssim2mysql::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // x-reference on ssim2mysql.FCtype.p_ns prevents copy // x-reference on ssim2mysql.FCtype.c_sqltype prevents copy // reftype Ptrary of ssim2mysql.FCtype.c_field prohibits copy @@ -304,6 +306,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/ssim2mysql_gen.h](/ ``` struct FField { // ssim2mysql.FField ssim2mysql::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -355,16 +358,16 @@ struct FInput { // ssim2mysql.FInput ssim2mysql::FInput* input_next; // Pointer to next free element int tpool ssim2mysql::FInput* cd_input_line_next; // zslist link; -1 means not-in-list ssim2mysql::FInput* cd_input_line_prev; // previous element - u8 in_buf_elems[65536]; // pointer to elements of inline array + u8* in_buf_elems; // NULL pointer to elements of indirect array + u32 in_buf_max; // 0 current length of allocated array i32 in_buf_start; // beginning of valid bytes (in bytes) i32 in_buf_end; // end of valid bytes (in bytes) - bool in_buf_eof; // no more data will be written to buffer + i32 in_buf_msglen; // current message length algo::Errcode in_buf_err; // system error code + algo_lib::FIohook in_buf_iohook; // edge-triggered hook for the buffer + bool in_buf_eof; // no more data will be written to buffer bool in_buf_msgvalid; // current message is valid - i32 in_buf_msglen; // current message length - algo_lib::FIohook in_buf_iohook; // edge-triggered hook for refilling buffer bool in_buf_epoll_enable; // use epoll? - enum { in_buf_max = 65536 }; algo::Tuple tuple; // Temp tuple algo::cstring warnstr; // Warning string // field ssim2mysql.FInput.in_buf prevents copy @@ -402,6 +405,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/ssim2mysql_gen.h](/ ``` struct FNs { // ssim2mysql.FNs ssim2mysql::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value algo::Smallstr16 ns; // Namespace name (primary key) algo::Smallstr50 nstype; // Namespace type algo::Smallstr50 license; // Associated license @@ -481,6 +485,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/ssim2mysql_gen.h](/ ``` struct FSsimfile { // ssim2mysql.FSsimfile ssim2mysql::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value ssim2mysql::FSsimfile* zd_ssimfile_next; // zslist link; -1 means not-in-list ssim2mysql::FSsimfile* zd_ssimfile_prev; // previous element algo::Smallstr50 ssimfile; // diff --git a/txt/exe/ssimfilt/README.md b/txt/exe/ssimfilt/README.md index 8fdbad7d..81479017 100644 --- a/txt/exe/ssimfilt/README.md +++ b/txt/exe/ssimfilt/README.md @@ -22,7 +22,7 @@ Usage: ssimfilt [[-typetag:]] [[-match:]] [options] [typetag] regx "%" (filter) Match typetag. ^=first encountered typetag [match]... string (filter) Select input tuple if value of key matches value (regx:regx) -field... string (project) Select fields for output (regx) - -format int ssim Output format for selected tuples (ssim|csv|field|cmd|json|stablefld|table|mdtable) + -format enum ssim Output format for selected tuples (ssim|csv|field|cmd|json|stablefld|table|mdtable) ssim Print selected/filtered tuples csv First tuple determines header. CSV quoting is used. Newlines are removed field Print selected fields, one per line @@ -33,8 +33,8 @@ Usage: ssimfilt [[-typetag:]] [[-match:]] [options] mdtable ASCII Markdown table with | separators for each group of tuples -t Alias for -format:table -cmd string "" Command to output - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -100,19 +100,20 @@ acr field | ssimfilt -cmd 'echo $field/$arg' | bash `ssimfilt` takes the following tables on input: |Ssimfile|Comment| |---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| +|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| +|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| -|[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| |[dmmeta.ftuple](/txt/ssimdb/dmmeta/ftuple.md)|| -|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| -|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| -|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| +|[dev.unstablefld](/txt/ssimdb/dev/unstablefld.md)|Fields that should be stripped from component test output because they contain timestamps etc.| |[dev.unstablefld](/txt/ssimdb/dev/unstablefld.md)|Fields that should be stripped from component test output because they contain timestamps etc.| -|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| diff --git a/txt/exe/ssimfilt/internals.md b/txt/exe/ssimfilt/internals.md index 07a75213..c13a2d98 100644 --- a/txt/exe/ssimfilt/internals.md +++ b/txt/exe/ssimfilt/internals.md @@ -114,9 +114,10 @@ struct FDb { // ssimfilt.FDb: In-memory database for ssimfilt Generated by [amc](/txt/exe/amc/README.md) into [include/gen/ssimfilt_gen.h](/include/gen/ssimfilt_gen.h) ``` struct FUnstablefld { // ssimfilt.FUnstablefld - ssimfilt::FUnstablefld* ind_unstablefld_next; // hash next - algo::Smallstr100 field; // - algo::Comment comment; // + ssimfilt::FUnstablefld* ind_unstablefld_next; // hash next + u32 ind_unstablefld_hashval; // hash value + algo::Smallstr100 field; // + algo::Comment comment; // // func:ssimfilt.FUnstablefld..AssignOp inline ssimfilt::FUnstablefld& operator =(const ssimfilt::FUnstablefld &rhs) = delete; // func:ssimfilt.FUnstablefld..CopyCtor diff --git a/txt/exe/strconv/README.md b/txt/exe/strconv/README.md index 99cb103e..258e97ac 100644 --- a/txt/exe/strconv/README.md +++ b/txt/exe/strconv/README.md @@ -23,8 +23,8 @@ Usage: strconv [-str:] [options] -tolowerunder Convert string to lower-under -in string "data" Input directory or filename, - for stdin -pathcomp string "" Extract path component from string - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig diff --git a/txt/exe/sv2ssim/README.md b/txt/exe/sv2ssim/README.md index 74e8416e..4ad734de 100644 --- a/txt/exe/sv2ssim/README.md +++ b/txt/exe/sv2ssim/README.md @@ -33,8 +33,8 @@ Usage: sv2ssim [-fname:] [options] -data (output) Convert input file to ssim tuples -report Y Print final report -prefer_signed Prefer signed types when given a choice - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -65,8 +65,10 @@ dmmeta.svtype ctype:algo.Smallstr10 maxwid:10 fixedwid1:0 fixedwid2 dmmeta.svtype ctype:algo.Smallstr100 maxwid:100 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.Smallstr150 maxwid:150 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.Smallstr200 maxwid:200 fixedwid1:0 fixedwid2:0 comment:"" +dmmeta.svtype ctype:algo.Smallstr249 maxwid:249 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.Smallstr25 maxwid:25 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.Smallstr250 maxwid:250 fixedwid1:0 fixedwid2:0 comment:"" +dmmeta.svtype ctype:algo.Smallstr255 maxwid:255 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.Smallstr50 maxwid:10 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:algo.cstring maxwid:1000000000 fixedwid1:0 fixedwid2:0 comment:"" dmmeta.svtype ctype:bool maxwid:1 fixedwid1:0 fixedwid2:0 comment:"" @@ -85,11 +87,11 @@ dmmeta.svtype ctype:u64 maxwid:64 fixedwid1:0 fixedwid2 ``` inline-command: acr comptest:sv2ssim.% -atfdb.comptest comptest:sv2ssim.Convert1 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:sv2ssim.Convert1Signed timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:sv2ssim.Convert2 timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:sv2ssim.Convert2Tsv timeout:10 memcheck:Y exit_code:0 comment:"" -atfdb.comptest comptest:sv2ssim.UniqueFieldName timeout:10 memcheck:Y exit_code:0 comment:"" +atfdb.comptest comptest:sv2ssim.Convert1 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:sv2ssim.Convert1Signed timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:sv2ssim.Convert2 timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:sv2ssim.Convert2Tsv timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" +atfdb.comptest comptest:sv2ssim.UniqueFieldName timeout:10 memcheck:Y coverage:Y exit_code:0 ncore:1 repeat:1 comment:"" report.acr n_select:5 n_insert:0 n_delete:0 n_ignore:0 n_update:0 n_file_mod:0 ``` @@ -181,9 +183,9 @@ dmmeta.field field:a.B._1960 arg:i32 reftype:Val dflt:"" comment:_1960 `sv2ssim` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dmmeta.svtype](/txt/ssimdb/dmmeta/svtype.md)|Table for determining ctype from separated value file| |[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| |[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dmmeta.svtype](/txt/ssimdb/dmmeta/svtype.md)|Table for determining ctype from separated value file| diff --git a/txt/exe/sv2ssim/internals.md b/txt/exe/sv2ssim/internals.md index ee52e470..2e781f40 100644 --- a/txt/exe/sv2ssim/internals.md +++ b/txt/exe/sv2ssim/internals.md @@ -74,12 +74,13 @@ All allocations are done through global `sv2ssim::_db` [sv2ssim.FDb](#sv2ssim-fd Generated by [amc](/txt/exe/amc/README.md) into [include/gen/sv2ssim_gen.h](/include/gen/sv2ssim_gen.h) ``` struct FBltin { // sv2ssim.FBltin - algo::Smallstr100 ctype; // - bool likeu64; // false - bool bigendok; // false - bool issigned; // false - algo::Comment comment; // - sv2ssim::FBltin* ind_bltin_next; // hash next + algo::Smallstr100 ctype; // + bool likeu64; // false + bool bigendok; // false + bool issigned; // false + algo::Comment comment; // + sv2ssim::FBltin* ind_bltin_next; // hash next + u32 ind_bltin_hashval; // hash value // func:sv2ssim.FBltin..AssignOp inline sv2ssim::FBltin& operator =(const sv2ssim::FBltin &rhs) = delete; // func:sv2ssim.FBltin..CopyCtor @@ -172,23 +173,24 @@ struct FDb { // sv2ssim.FDb: In-memory database for sv2ssim Generated by [amc](/txt/exe/amc/README.md) into [include/gen/sv2ssim_gen.h](/include/gen/sv2ssim_gen.h) ``` struct FField { // sv2ssim.FField - sv2ssim::FField* ind_field_next; // hash next - sv2ssim::FField* zd_selfield_next; // zslist link; -1 means not-in-list - sv2ssim::FField* zd_selfield_prev; // previous element - algo::cstring name; // Field name - algo::Smallstr100 ctype; // Determined type - i32 maxwid; // 0 Max field width in chars - double minval; // 1e300 Min numeric value - double maxval; // -1e300 Max numeric value - i32 minwid_fix1; // 100000 Min digits before . - i32 maxwid_fix1; // 0 Max digits before . - i32 minwid_fix2; // 100000 Min digits after . - i32 maxwid_fix2; // 0 Max digits after . - bool couldbe_int; // true - bool couldbe_bool; // true - bool couldbe_fixwid; // true Fixed width char - bool couldbe_double; // true - i32 rowid; // 0 + sv2ssim::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value + sv2ssim::FField* zd_selfield_next; // zslist link; -1 means not-in-list + sv2ssim::FField* zd_selfield_prev; // previous element + algo::cstring name; // Field name + algo::Smallstr100 ctype; // Determined type + i32 maxwid; // 0 Max field width in chars + double minval; // 1e300 Min numeric value + double maxval; // -1e300 Max numeric value + i32 minwid_fix1; // 100000 Min digits before . + i32 maxwid_fix1; // 0 Max digits before . + i32 minwid_fix2; // 100000 Min digits after . + i32 maxwid_fix2; // 0 Max digits after . + bool couldbe_int; // true + bool couldbe_bool; // true + bool couldbe_fixwid; // true Fixed width char + bool couldbe_double; // true + i32 rowid; // 0 // func:sv2ssim.FField..AssignOp sv2ssim::FField& operator =(const sv2ssim::FField &rhs) = delete; // func:sv2ssim.FField..CopyCtor diff --git a/txt/lib/README.md b/txt/lib/README.md index fda30599..452f2360 100644 --- a/txt/lib/README.md +++ b/txt/lib/README.md @@ -9,15 +9,20 @@ 📁 [lib_amcdb - Library used by amc](/txt/lib/lib_amcdb/README.md)
📁 [lib_ams - Library for AMS middleware, supporting file format & messaging](/txt/lib/lib_ams/README.md)
📁 [lib_ctype - Helpful library for reading/writing ctypes as text tuples](/txt/lib/lib_ctype/README.md)
+📁 [lib_curl - covers curl_easy](/txt/lib/lib_curl/README.md)
📁 [lib_exec - Build and run a dag of subprocesses with N parallel jobs](/txt/lib/lib_exec/README.md)
📁 [lib_fm - Library for dynamic alarm management](/txt/lib/lib_fm/README.md)
📁 [lib_git - Helpful git wrappers](/txt/lib/lib_git/README.md)
+📁 [lib_http - Library for HTTP support](/txt/lib/lib_http/README.md)
📁 [lib_iconv - Iconv wrapper](/txt/lib/lib_iconv/README.md)
📁 [lib_json - Full json support library](/txt/lib/lib_json/README.md)
📁 [lib_mysql - Mysql adaptor](/txt/lib/lib_mysql/README.md)
+📁 [lib_netio - Network I/O library](/txt/lib/lib_netio/README.md)
📁 [lib_prot - Library covering all protocols](/txt/lib/lib_prot/README.md)
+📁 [lib_rl - GNU readline support library](/txt/lib/lib_rl/README.md)
📁 [lib_sql - SQL formatting functions](/txt/lib/lib_sql/README.md)
📁 [lib_sqlite -](/txt/lib/lib_sqlite/README.md)
+📁 [lib_ws - WebSocket library](/txt/lib/lib_ws/README.md)
diff --git a/txt/lib/algo_lib/README.md b/txt/lib/algo_lib/README.md index a655e040..f09db400 100644 --- a/txt/lib/algo_lib/README.md +++ b/txt/lib/algo_lib/README.md @@ -13,6 +13,7 @@   •  [Functions](#functions)
  •  [Inputs](#inputs)
  •  [Sources](#sources)
+  •  [Dependencies](#dependencies)
  •  [In Memory DB](#in-memory-db)
@@ -53,7 +54,7 @@ Each log category has a name and an `enable` flag, which can be switched at runt Printing to a log category xyz is performed with ``` -prlog_cat(algo_lib_logcat_xyz, "some output"); +prcat(xyz, "some output"); ``` And is equivalent to @@ -68,11 +69,14 @@ Stdout and stderr are generalized as log categories. The table of log categories is given below: ``` -inline-command: acr logcat -dmmeta.logcat logcat:expect enabled:N builtin:N comment:"lib_ams expect implementation" -dmmeta.logcat logcat:stderr enabled:Y builtin:Y comment:"Standard error (cannot be disabled)" -dmmeta.logcat logcat:stdout enabled:Y builtin:Y comment:"Standard output (cannot be disabled)" -report.acr n_select:3 n_insert:0 n_delete:0 n_ignore:0 n_update:0 n_file_mod:0 +inline-command: acr logcat:'(stdout|stderr|debug|verbose|verbose2)' -report:N | ssimfilt -t +LOGCAT ENABLED BUILTIN STDOUT MAXMSG WINDOW COMMENT +debug N N N 0 0 Debug messages +stderr Y Y N 0 0 Standard error (cannot be disabled) +stdout Y Y Y 0 0 Standard output (cannot be disabled) +verbose N N N 0 0 Verbose messages go here +verbose2 N N N 0 0 Extra verbose messages go here + ``` ### Verblog @@ -109,3676 +113,1032 @@ an exact correspondence between the command line and the process behavior. Functions exported from this namespace: ```c++ -strptr algo::gitinfo_Get() -``` - -```c++ -void algo::ShowStackTrace(uintptr_t start_ip, cstring &out) -``` - -```c++ -void algo::FatalErrorExit(const char *a) NORETURN -``` - -```c++ -// catch fatal signals and show backtrace -void algo::SetupFatalSignals() -``` - -```c++ -// print base64-encoded string -void algo::strptr_PrintBase64(strptr str, cstring &out) -``` - -```c++ -void algo_lib::InitCpuHz() -``` - -```c++ -= -``` - -```c++ -u32 algo::CRC32Step(u32 old, const u8 *data, size_t len) -``` - -```c++ -// This is a low-quality random number generator suitable for simple tasks... -// Set seed for srng state -void algo_lib::srng_SetSeed(algo_lib::Srng &srng, int z, int w) +inline bool operator !=(const algo::strptr &a, const algo::strptr &b) ``` ```c++ -// retrieve random u32 -u32 algo_lib::srng_GetU32(algo_lib::Srng &srng) +U128 U128::operator %(const U128 &val) const ``` ```c++ -// retrieve random double in 0..1 range -double algo_lib::srng_GetDouble(algo_lib::Srng &srng) +U128 U128::operator &(const U128 &rhs) const ``` ```c++ -// Normalize decimal, so mantissa does not contain tail 0 -void algo::Decimal_Normalize(algo::Decimal &parent) +U128 U128::operator *(const U128 &rhs) const ``` ```c++ -// Try parse Decimal [+-][0-9]*[.][0-9]* -// Stop after first non-conforming char, error if no digit has been met. -bool algo::TryParseDecimal(algo::StringIter &iter, algo::Decimal &result) +inline char *ToCstr(char *to, const strptr &x) ``` ```c++ -// Print Decimal -void algo::Decimal_Print(algo::Decimal parent, algo::cstring &str) +void *mmap(void *base_addr, i64 size, MmapProt prot, MmapFlags mapflags, int fd, int flags2) ``` ```c++ -// Read Decimal from string -bool algo::Decimal_ReadStrptrMaybe(algo::Decimal &parent, algo::strptr in_str) +DIR *opendir(const char *path) ``` ```c++ -// Convert Decimal to double -double algo::Decimal_GetDouble(algo::Decimal parent) +char *strerror_r(int code, char *buf, int bufsize) ``` ```c++ -// Convert double to Decimal -void algo::Decimal_SetDouble(algo::Decimal &parent, double value) +const char *strsignal(int sig) ``` ```c++ -void algo_lib::SaveBadField(strptr name, strptr value) +// https://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Atomic-Builtins.html +void *sync_lock_test_and_set(void **addr, void *val) ``` ```c++ -// Reset value of algo_lib::_db.errtext and return it for further editing -// Usage: -// algo_lib::ResetBadTags() << ...errors... -algo::cstring &algo_lib::ResetErrtext() +// https://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Atomic-Builtins.html +void *sync_val_compare_and_swap(void **addr, void *oldval, void *newval) ``` ```c++ -// Add key-value pair to algo_lib::_db.errtext -// Error text beyond a reasonable limit is discarded -- keep errors short! -void algo_lib::SaveBadTag(const strptr &name, const strptr &value) +U128 U128::operator +(const U128 &val) const ``` ```c++ -// Better name than SaveBadTAg -void algo_lib::AppendErrtext(const strptr &name, const strptr &value) +U128 U128::operator -(const U128 &val) const ``` ```c++ -// Retrieve whatever bad tags were saved with SaveBadTag, -// and clear the state. -// SaveBadTag is typically called by string read functions that encounter -// something unreadable. This is the only way to retrieve that -// additional information -tempstr algo_lib::DetachBadTags() +inline algo::SchedTime operator + (const algo::SchedTime &a, algo::SchedTime d) ``` ```c++ -// Increment algo_lib::_db.trace.tot_insert_err -// And print accumulated 'bad tags' using prerr. -// if SetShowInsertErrLim was previously called. -// Note: printing is disabled by default, and must be explicitly enabled. -void algo_lib::NoteInsertErr(strptr tuple) +inline algo::SchedTime operator - (const algo::SchedTime &a, algo::SchedTime d) ``` ```c++ -// Specify how many times NoteInsertErr can use prerr -// to output. -void algo_lib::SetShowInsertErrLim(int n) +inline algo::UnDiff operator * (const algo::UnDiff &a, i64 d) ``` ```c++ -inline char *ToCstr(char *to, const strptr &x) +inline algo::UnDiff operator + (const algo::UnDiff &a, algo::UnDiff d) ``` ```c++ -// Copy file FROM to file TO, creating the file if necessary -// with mode MODE. -// Throw exception on failure. -void algo::CopyFileX(strptr from, strptr to, int mode) +inline algo::UnDiff operator += (algo::UnDiff &a, const algo::UnDiff d) ``` ```c++ -// Read all bytes from IN_FD and copy them to OUT_FD, using read/write. -// Return success status. -bool algo::CopyFd(Fildes in_fd, Fildes out_fd) NOTHROW +inline algo::UnDiff operator - (algo::UnTime a, algo::UnTime b) ``` ```c++ -// Test whether FNAME refers to a valid filesystem entity (file, directory, or special file) -// If FNAME is a soft link, then TRUE is returned even if the link points to -// a non-existent location. -bool algo::FileObjectExistsQ(strptr fname) NOTHROW +inline algo::UnDiff operator - (const algo::UnDiff &a, algo::UnDiff d) ``` ```c++ -// Test whether PATH is an existing directory -bool algo::DirectoryQ(strptr path) NOTHROW +inline algo::UnDiff operator - (const algo::UnDiff a) ``` ```c++ -// Test if F refers to an existing regular file (i.e. not a special file or directory) -bool algo::FileQ(strptr fname) NOTHROW +inline algo::UnDiff operator / (const algo::UnDiff &a, i64 d) ``` ```c++ -// Wrapper for c library realpath function. -// On Windows: read path and expand all soft links along the way; Also eat ..'s. -// The following table shows successive values of LEFT and RIGHT as the loop executes -// ExpandLinks("bin/amc") -// LEFT RIGHT -// bin amc -// bin/amc -// link=../build/release/amc -// bin ../build/release/amc -// build/release/amc -// build release/amc -// build/release amc -// link=CYGWIN_NT-cl.release-x86_64 -// build CYGWIN_NT-cl.release-x86_64/amc -// build/CYGWIN_NT-cl.release-x86_64 amc -// build/CYGWIN_NT-cl.release-x86_64/amc -tempstr algo::GetFullPath(strptr path) NOTHROW +inline algo::UnTime operator + (algo::UnTime a, algo::UnDiff d) ``` ```c++ -// Delete file F. -// Return success code. -bool algo::DeleteFile(strptr f) NOTHROW +inline algo::UnTime operator += (algo::UnTime &a, const algo::UnDiff d) ``` ```c++ -// Remove everything up to and including the last slash in A, -// and return that. This is equivalent to Pathcomp(A,"/RR"); -strptr algo::StripDirName(strptr a) NOTHROW +inline algo::UnTime operator - (algo::UnTime a, algo::UnDiff d) ``` ```c++ -// Strip last slash and everything after it in A, -// and return that. This is equivalent to Pathcomp(A,"/RL"); -strptr algo::GetDirName(strptr a) NOTHROW +inline algo::UnixDiff operator * (const algo::UnixDiff &a, i64 d) ``` ```c++ -// Recursively create directory S and all of its components, -// using mode MODE for newly created directories. -// if DO_THROW is specified, throw exceptions on failure. -// If DO_THROW is false, return success value. -// TODO: test on windows -bool algo::CreateDirRecurse(strptr s, bool do_throw = true, u32 mode = 0755) +inline algo::UnixDiff operator + (const algo::UnixDiff &a, algo::UnixDiff d) ``` ```c++ -// Strip last component of a path. -// If the path ends in a slash, the slash is stripped as well. -// So, StripDirComponent("abcde/d/") -> abcde/ -// So, StripDirComponent("abcde/d") -> abcde/ -strptr algo::StripDirComponent(strptr a) NOTHROW +inline algo::UnixDiff operator - (const algo::UnixDiff &a, algo::UnixDiff d) ``` ```c++ -// Combine paths A and B, placing a slash in the middle if necessary. -// If B is already an absolute pathname, just return that. -tempstr algo::DirFileJoin(strptr a, strptr b) NOTHROW +inline algo::UnixDiff operator - (const algo::UnixTime &a, algo::UnixTime b) ``` ```c++ -// Remove pathname A with any extension stripped. -// StripExt("abcd/e.txt") -> "abcd/e" -// StripExt("abcd/e.txt/f") -> "abcd/e/f" -// (The last slash shields the extension, so this function has no corresponding -// Pathcomp expression) -strptr algo::StripExt(strptr a) NOTHROW +inline algo::UnixDiff operator / (const algo::UnixDiff &a, i64 d) ``` ```c++ -// Return extension of pathname A, including the dot. -// GetFileExt("abcd/e.txt") -> ".txt" -// GetFileExt("abcd/e.txt/f") -> "" -// This function is equivalent to Pathcomp(A,"/RR.RR") -strptr algo::GetFileExt(strptr a) NOTHROW +inline algo::UnixTime operator + (const algo::UnixTime &a, algo::UnixDiff d) ``` ```c++ -// Check if path PATH is an absolute pathname, -// meaning that it starts with / or ~ -// On windows, the same test is in force, but in addition any pathname -// where the second character is a : (e.g. c:\blah) is recognized as an absolute -// path name -bool algo::AbsolutePathQ(strptr path) NOTHROW +inline algo::UnixTime operator - (const algo::UnixTime &a, algo::UnixDiff d) ``` ```c++ -// Replace extension in pathname A with string B. -tempstr algo::ReplaceExt(strptr a, strptr b) NOTHROW +inline u32 _mm_crc32_u8 (u32 prev, u8 val) ``` ```c++ -// Return current directory name. -tempstr algo::GetCurDir() NOTHROW +U128 U128::operator /(const U128 &val) const ``` ```c++ -// Change current directory to DIR and return success status -// errno is set as witih chdir() call -bool algo::SetCurDir(strptr in_dir) NOTHROW +inline bool operator <(const algo::strptr &a, const algo::strptr &b) ``` ```c++ -// Calculate size of file referred to by FILENAME. -// If file is not found or an error occurs, 0 is returned. -i64 algo::GetFileSize(strptr filename) NOTHROW +U128 U128::operator <<(u64 count) const ``` ```c++ -// Return size of file referred to by FD. -// On error, return zero. -i64 algo::GetFileSize(Fildes fd) NOTHROW +template inline tempstr &algo::operator <<(const tempstr &lhs, const T &rhs) ``` ```c++ -// Strip extension from PATH, then strip directory name from PATH, -// and return the remainder. -// c.d -> c -// /a/b/c.d -> c -strptr algo::GetFileName(const strptr& path) NOTHROW +inline bool operator ==(const algo::strptr &a, const algo::strptr &b) ``` ```c++ -// F ("a.txt","b") -> "b.txt"; -// F ("a.txt","/b.jpg") -> "b.jpg.txt" -tempstr algo::ReplaceFileName(const strptr& a, const strptr& b) +U128 U128::operator >>(u64 count) const ``` ```c++ -// Return modification time of file FILENAME -// If file is not found or is not accessible, return 0. -algo::UnTime algo::ModTime(strptr filename) +algo::cstring &algo_lib::AddCell(algo_lib::FTxttbl &txttbl) ``` ```c++ -// Remove directory. -// Return TRUE if operaiton succeeds -// The function will fail if the directory is not empty. For that case, -// use RemDirRecurse. -bool algo::RemDir(strptr name) +// Add new cell to the given row. +// TEXT specifies the text for the cell +algo_lib::FTxtcell &algo_lib::AddCell(algo_lib::FTxtrow &txtrow, algo::strptr text, algo_TextJustEnum justify = algo_TextJust_j_auto) ``` ```c++ -// Destroy directory NAME, and any subdirectories. -// If REMOVE_TOPMOST is specified, delete the directory as well, -// (otherwise, only the contents are deleted). -// If filesystem entry exists and is NOT a directory, return true. -bool algo::RemDirRecurse(strptr name, bool remove_topmost) +// Add column to the last row of table and return reference to it +// The justification for the column is copied from the header row +algo_lib::FTxtcell &algo_lib::AddCellEx(algo_lib::FTxttbl &txttbl) ``` ```c++ -// User-defined cleanup trigger for dir_handle field of ctype:algo.DirEntry -void algo::dir_handle_Cleanup(algo::DirEntry &dir_entry) +// Add a column with specified text TEXT to the last row of the table +// If optional JUSTIFY is provided, the justification is set. Otherwise, justification is automatically +// determined from the header cell. +void algo_lib::AddCol(algo_lib::FTxttbl &txttbl, algo::strptr text, algo_TextJustEnum justify = algo_TextJust_j_auto) ``` ```c++ -// User-defined cleanup trigger fildes field of ctype:algo_lib.FLockfile -void algo_lib::fildes_Cleanup(algo_lib::FLockfile &lockfile) +// Add a comma-separated list of columns to the table +void algo_lib::AddCols(algo_lib::FTxttbl &txttbl, algo::strptr csv, algo_TextJustEnum justify = algo_TextJust_j_left) ``` ```c++ -// Open file FILENAME with flags FLAGS, return resulting file descriptor -// Possible flags: -// write -> open file for writing, create file if missing -// if write is specified, and append is not, then file is truncated upon opening -// append -> open file in append mode (automatically sets 'write' flag) -// in append mode, seek to end of file after opening -// read -> open flag in read-only mode -// _throw -> throw exception if an error occurs -// NOTE: this function doesn't set O_APPEND flag, because it doesn't work' -// on NFS mounted filesystems. -// Without O_APPEND, two processes cannot reliably append to the same file. -algo::Fildes algo::OpenFile(const strptr& filename, algo::FileFlags flags) +// Add new row to the table and return a reference to it +algo_lib::FTxtrow &algo_lib::AddRow(algo_lib::FTxttbl &txttbl) ``` ```c++ -// Write BYTES to file FD; -// If FD is non-blocking, the function may fail. -// Throw exception on error. Upon completion, the function has succeeded -void algo::WriteFileX(Fildes fd, memptr bytes) +// Add key-value pair to algo_lib::_db.errtext +// Error text beyond a reasonable limit is discarded -- keep errors short! +void algo_lib::AppendErrtext(const strptr &name, const strptr &value) ``` ```c++ -// Set file position of FD to OFF -// Return success status -bool algo::SeekFile(Fildes fd, i64 off) +// Interpret redirect string and make DST_FD consistent with +// the intended state. Return 0 on success, -1 on failure +// This function is usually called in the child process right after fork +// See CreateRedirect for interpretation of redirect string +int algo_lib::ApplyRedirect(strptr redirect, int dst_fd) ``` ```c++ -// Return current file position on FD -// There is no provision to return an error code; only the offset is returned -// (zero on failure?) -i64 algo::GetPos(Fildes fd) +// Enable/disable log category NAME with filter FILTER. +// If NAME is prefixed with +, logging is enabled +// If NAME is prefixed with -, logging is disabled +// If NAME is an empty string. current state is printed +// FILTER is a regex +// If FILTER starts with !, it is a negative filter (any matching lines are omitted) +// Return number of logcats affected. +int algo_lib::ApplyTrace(algo::strptr name, algo::strptr filter) ``` ```c++ -// Truncate file indicated by FD to size SIZE. -// Return success status -// TODO: Test on windows -bool algo::TruncateFile(Fildes fd, i64 size) +// Enable or disable logcat tracing based on traace expression WHAT +// WHAT is a comma-separated list of logcat regexes, e.g. a,b,c +// Each component can be prefixed with + or -, e.g. +a,-b etc. +// Finally, each component can be a key-value pair, e.g. +a:,-b,+c +// is an optional regex; Regex can be prefixed with ! to indicate a negative match. +// Timestamps can be enabled with 'timestamps', disabled with '-timestamps' +// Verbose can be enabled with 'verbose', disabled with '-verbose' +// Debug can be enabled with 'debug', disabled with '-debug' +int algo_lib::ApplyTrace(algo::strptr what) ``` ```c++ -// Return contents of file as string. -// File is trimmed at first NULL character -// Implementation note: -// linux files in /proc directory lie about their size -// and are sometimes zero-terminated. -// File is read using a "safe" method of succesively calling read. -// relying on reported file size or using mmap does not work in all cases -// Todo: test on windows -const tempstr algo::FileToString(const strptr& fname, algo::FileFlags flags = algo_FileFlags__throw) +// Close specified handle if it open +// Set value to NULL +void CloseHandleSafe(HANDLE &handle) ``` ```c++ -// Read all bytes from IN_FD as a string. -// NUL characters in file will appear in the string -- -// TODO: add option to sanitize string -// If FD is non-blocking, reading will terminate at first EAGAIN. -// If an error occurs, all data prior to occurrence of the error is returned. -const tempstr algo::FdToString(Fildes in_fd) NOTHROW +// Interpret redirect string, return resulting fd +// If no redirect applies, return -1 +// If a valid fd is returned, it is unique and may be closd with close() +// Supported redirects: +// >filename -- on exit, dst_fd is writing to a file +// >filename -- on exit, dst_fd is appending to a file +// >&fd -- on exit, dst_fd is pointing to fd +// <&fd -- on exit, dst_fd is pointing to fd +// This function could be called openex +int algo_lib::CreateRedirect(strptr redirect) ``` ```c++ -algo::Fildes algo::CreateReplacementFile(cstring &oldfname, cstring &newfname, int dfltmode) +// Retrieve whatever bad tags were saved with AppendErrtext, +// and clear the state. +// AppendErrtext is typically called by string read functions that encounter +// something unreadable. This is the only way to retrieve that +// additional information +tempstr algo_lib::DetachBadTags() ``` ```c++ -// Compare STR to contents of FILENAME. -// If they differ, use a tempfile construction to atomically UPDATE file -// with contents of STR. -// NOTE: This will result in a new inode for file! -// No exceptions are thrown. If the function fails, check errno. -// Default mode for new file is provided by MODE. -// If the file is being replaced, MODE is ignored and copied from the old file. -bool algo::SafeStringToFile(const strptr& str, const strptr& filename, int dfltmode) +// Die when parent process dies +void algo_lib::DieWithParent() ``` ```c++ -bool algo::SafeStringToFile(const strptr& str, const strptr& filename) +// Return name of user executing this command. +// If the command is being executed under sudo, return name +// of original user. +tempstr algo_lib::EffectiveUser() ``` ```c++ -// Replace contents of file FILENAME with string STR. -// If CHECK_SAME is specified, first compare contents and do not perform a write -// if the contents are the same. -// FLAGS may specify algo_FileFlags__throw, in which case an exception is thrown on error -bool algo::StringToFile(const strptr& str, const strptr& filename, algo::FileFlags flags = algo_FileFlags__throw, bool check_same = true) +// For InlineOnce and TimeHookOnce steps, break +// out of the enclosing while loop (over timeouts). +// Calling this function may be necessary when it becomes known that +// no further progress can be made by the step function. +void algo_lib::EndStep() ``` ```c++ -algo::Fildes algo::OpenWrite(const strptr& filename, algo::FileFlags flags = algo::FileFlags()) +void algo_lib::ErrorX_Print(algo_lib::ErrorX &row, algo::cstring &str) ``` ```c++ -algo::Fildes algo::OpenRead(const strptr& filename, algo::FileFlags flags = algo::FileFlags()) +algo_TextJustEnum algo_lib::EvalJust(algo_lib::FTxttbl &txttbl, u32 col, algo_TextJustEnum just) ``` ```c++ -// Write NWRITE bytes starting at START to file descriptor FILDES. -// Go until all bytes are written on an error occurs. -// If FILDES is non-blocking, spin indefinitely until bytes do get through. -// At the end, return success status (TRUE if all bytes written) -bool algo::WriteFile(algo::Fildes fildes, u8 *start, int nwrite) +// Print table TXTTBL using markdown, appending to string STR. +// First row of the table is assumed to be the header. +// Newlines in cells are converted to '
'. +void algo_lib::FTxttbl_Markdown(algo_lib::FTxttbl &txttbl, algo::cstring &str) ``` ```c++ -void algo::Dir_curs_Next(Dir_curs &curs) NOTHROW +void algo_lib::FTxttbl_Print(algo_lib::FTxttbl &txttbl, algo::cstring &str) ``` ```c++ -// Begin scanning files matching shell pattern PATTERN. -void algo::Dir_curs_Reset(Dir_curs &curs, strptr pattern) NOTHROW +// Look up cell with specific coordinates. +algo_lib::FTxtcell *algo_lib::FindCell(algo_lib::FTxttbl &txttbl, int row, int col) ``` ```c++ -bool algo::Dir_curs_ValidQ(Dir_curs &curs) NOTHROW +// Return name of temp directory. +// If it's not already initialized, it is set to the default value: +// temp/ where is taken from argv[0]. +// The directory is created as needed. +algo::strptr algo_lib::GetTempDir() ``` ```c++ -algo::DirEntry &algo::Dir_curs_Access(Dir_curs &curs) NOTHROW +void algo_lib::InitCpuHz() ``` ```c++ -// Set blocking mode on file descriptor FD to BLOCKING -// Return result of FCNTL (0==success) -int algo::SetBlockingMode(Fildes fildes, bool blocking) NOTHROW +// Append TEXT to OUT, performing $-substitution using variables from SCOPE (must be non-NULL) +// if EOL is set, then new line is appended at the end. +void algo_lib::Ins(algo_lib::Replscope *scope, algo::cstring &out, strptr text, bool eol = true) ``` ```c++ -// If PATH is an existing path, leave it unchanged -// On Windows, If PATH.EXE is an existing path, return that -// Return true if file exists -bool algo_lib::TryExeSuffix(algo::cstring &path) +// Register IOHOOK to be called whenever an IO operation is possible. +// OK to add an fd twice with different flags. Subsequent calls override previous ones. +// Add iohook to epoll in read, write or read/write mode +// Optionally, add as edge triggered +void algo_lib::IohookAdd(algo_lib::FIohook& iohook, algo::IOEvtFlags inflags) NOTHROW ``` ```c++ -// Update FNAME to be a filename that can be passed to Unix exec call. -// If FNAME is an absolute path, don't perform a search -// If FNAME is a relative path, perform a search using the PATH environment -// the first executable file that's found is the result. -void algo_lib::ResolveExecFname(algo::cstring &fname) +void algo_lib::IohookInit() ``` ```c++ -// Read soft link and return resulting path. -// If PATH is not a soft link, return empty string -// This is not the function to resolve symlinks (if link temp/x points to y, then -// this function will return string "y", not "temp/y"), use GetFullPath for -// full service -tempstr algo::ReadLink(strptr path) +// De-register interest in iohook +void algo_lib::IohookRemove(algo_lib::FIohook& iohook) NOTHROW ``` ```c++ -// Examine string VALUE -// Determine if it needs quoting as an ssim key/value, -// and return appropriate quote character. If no quote character is needed, -// return NUL. -char algo::PickSsimQuoteChar(strptr value) +bool algo_lib::IpmaskValidQ(const strptr ipmask) ``` ```c++ -bool char_ReadStrptrMaybe(char &row, algo::strptr str) +// Walk child process tree for parent process pid, in post-order traversal way, +// and send signal sig to each process. Kill_topmost is an option whether +// to send signal to parent process itself. Return value - number of processes +// to whose the signal has been actually sent. +// Does not throw exceptions, just prints error message if kill() fails. +// Linux only. +int algo_lib::KillRecurse(int pid, int sig, bool kill_topmost) ``` ```c++ -bool float_ReadStrptrMaybe(float &row, algo::strptr str) +// Attempt to lock the file named NAME, updating state of LOCKFILE. +// Return TRUE if lock is successfully applied. +// If FAIL_OK is false, an error causes an exception (function always returns true) +// If an exception is thrown, the text contains error description. +// Otherwise, algo_lib::_db.errtext (DetachBadTags()) contains human-readable description of error. +// If WAIT_TIMEOUT is non-zero, block up to WAIT_TIMEOUT seconds before failing +// Write pid to file specified in NAME, and lock file using flock(). +bool algo_lib::LockFileInit(algo_lib::FLockfile &lockfile, strptr name, algo::FailokQ fail_ok = algo::FailokQ(false), algo::UnDiff wait_timeout = algo::UnDiff()) ``` ```c++ -bool double_ReadStrptrMaybe(double &row, algo::strptr str) +// Read contents of lock file FNAME, extracting the pid that's stored in there. +// On failure, return 0 +pid_t algo_lib::LockFileRead(strptr fname) ``` ```c++ -bool bool_ReadStrptrMaybe(bool &row, algo::strptr str) +// Filter string STR for output on LOGCAT. +// The string must match FILTER and not match NEGFILTER. +// The initial state is that filter is empty (uninitialized), so empty filter +// is interpreted as "match all" +// Filter and negfilter are configured with ApplyTrace which parses a trace expression +// In addition, if throttling is enabled on LOGCAT, block message +// if more than MAXMSG are being printed within WINDOW secs. The counter +// is reset every WINDOW secs. +bool algo_lib::LogcatFilterQ(algo_lib::FLogcat &logcat, algo::strptr str) ``` ```c++ -// Read time from STR to ROW +// Attach mmapfile MMAPFILE to FNAME // Return success code. -// If funciton does not succeed, ROW is not modified -// Several formats are supported: -// %Y-%m-%dT%T -// %Y-%m-%d %T -// %Y/%m/%d %T -// %Y-%m-%d -// %Y/%m/%d -// Where %T is %H:%M:%S.%X -// And %X is the nanosecond portion -bool algo::UnTime_ReadStrptrMaybe(algo::UnTime &row, algo::strptr str) -``` - -```c++ -bool algo::UnDiff_ReadStrptrMaybe(UnDiff &row, algo::strptr str) -``` - -```c++ -bool algo::UnixTime_ReadStrptrMaybe(algo::UnixTime &row, algo::strptr str) -``` - -```c++ -bool algo::cstring_ReadStrptrMaybe(algo::cstring &row, algo::strptr str) -``` - -```c++ -// Parse a URL from string STR to OUT. -// The format of a URL is -// protocol://user:password@somehost:port<-source_interface/dir1/dir2 -// URL fields are -// protocol, username, password, server, port, host, source_addr_host, dir -// -// -// Windows pathnames are supported, e.g. -// when parsing -// file://c:/dir/dir2 -// c: will not be parsed as a username, but as part of the pathname. -// -bool algo::URL_ReadStrptrMaybe(URL &out, algo::strptr str) -``` - -```c++ -bool ietf::Ipv4_ReadStrptrMaybe(ietf::Ipv4 &ip, algo::strptr str) -``` - -```c++ -// Parse an IpV4 address from STR to IP -// Return success value. If not successful, output value is not modified. -bool ietf::Ipv4Addr_ReadStrptrMaybe(ietf::Ipv4Addr &ip, algo::strptr str) -``` - -```c++ -bool algo::Ipmask_ReadStrptrMaybe(Ipmask &row, algo::strptr str) -``` - -```c++ -void algo::Ptr_Print(void *ptr, algo::cstring &out) -``` - -```c++ -// pads with zeros on the left so that at least 'atleast' characters are output. -void algo::i64_PrintPadLeft(i64 num, algo::cstring &out, int atleast) +bool algo_lib::MmapFile_Load(MmapFile &mmapfile, strptr fname) ``` ```c++ -// Assuming SRC is a number, Transfer SRC to OUT, inserting -// commas between groups of 3 numbers. -// 0 -> 0 -// 11 -> 11 -// 222 -> 222 -// 3333 -> 3,333 -// 4567.3 -> 4,567.3 -// 1.11111 -> 1.11111 -void algo::strptr_PrintWithCommas(strptr src, algo::cstring &out) +// Attach mmapfile MMAPFILE to FD. +// Return success code. +bool algo_lib::MmapFile_LoadFd(MmapFile &mmapfile, algo::Fildes fd) ``` ```c++ -// Assuming STR is a number, remove any unnecessary characters from the right of it. -// Unnecessary characters are trailing zeros after a dot. -// If the string contains no dot, nothing is done. -// If a trailing '.' or a single '-' remains, it is removed as well. -// If the resulting string is empty, a single zero is returned. -// -// 0 -> 0 -// 0.1 -> 0.1 -// 0.0 -> 0 -// 12345.000 -> 12345 -// -0 -> -0 -// .0 -> 0 -// -.0 -> 0 -// -0.0 -> -0 -// -10.0 -> -10 -// -> empty string is not touched -// Since the string may be edited, you can't pass compile-time constants -// to this function. In fact the only reason this function is not private to algo_lib -// is because of unit testing. -// If the initial string is empty, nothing is done. -// BEWARE: this function will happily convert 1e+60 to 1e+6 -// -void algo::strptr_TrimZerosRight(strptr &str) +// Increment algo_lib::_db.trace.tot_insert_err +// And print accumulated 'bad tags' using prerr. +// if SetShowInsertErrLim was previously called. +void algo_lib::NoteInsertErr(strptr tuple) ``` ```c++ -// Print double D into string OUT with PRECISION digits -// after the decimal point. -// If OMIT_ZEROS is specified, trailing zeros that are safe to omit are omitted. -// If COMMAS is specified, the large numbers are printed in groups of 3 digits -// with commas between them. -void algo::double_PrintPrec(double d, algo::cstring &out, int precision, bool omit_zeros, bool commas) +// Change to the directory that was current before sandbox mode +// Must be balanced with PushDir +void algo_lib::PopDir() ``` ```c++ -// Print string, replacing '_x' with 'X', and capitalizing first word. -void algo::strptr_PrintCamel(algo::strptr str, algo::cstring& out) +// Enter sandbox directory remember previous directory +void algo_lib::PushDir(algo::strptr dir) ``` ```c++ -// Convert CamelCase to lower_under. -// A consecutive run of caps gets a single leading underscore. -// Leading cap doesn't get an underscore -// Example: "abcd testString" -> "abcd test_string" -// Example: "Abcd" -> "abcd" -// Example: "BBOPrice" -> "bboprice" -// Example: "SymbolID" -> "symbol_id" -// Example: "A_B" -> "a_b" -void algo::strptr_PrintLowerUnder(algo::strptr str, algo::cstring &out) +// Read next line from FILE into RESULT +// When end of file is reached, return FALSE. +// If error occurs during reading, return false. +// Typical usage: +// InTextFile file; +// file.file = OpenRead(filename); +// for (strptr line; ReadLine(file,line); ) { +// +// } +// A partial line at the end of the file is returned. +bool algo_lib::ReadLine(algo_lib::InTextFile &file, algo::strptr &result) ``` ```c++ -// Output string STR to OUT changing all characters to uppercase. -void algo::strptr_ToUpper(algo::strptr str, algo::cstring& out) +void algo_lib::RegxState_Print(algo_lib::RegxState &state, algo::cstring &lhs) ``` ```c++ -void algo::u128_PrintHex(u128 value, algo::cstring &out, bool prefix) +// Find REGX in TEXT and return range of chars which match. +// If the regx is not found, return empty range. +// For this to work, REGX must be parsed with "full:N". +algo::i32_Range algo_lib::Regx_Find(algo_lib::Regx ®x, algo::strptr text, int start = 0) ``` ```c++ -void algo::u64_PrintHex(u64 value, algo::cstring &out, int atleast, bool prefix, bool caps) +// Check if REGX matches TEXT, return result +bool algo_lib::Regx_Match(algo_lib::Regx ®x, algo::strptr text) ``` ```c++ -// Print value VALUE to string OUT, -// producing least ATLEAST hex characters. -// Include prefix 0x. -void algo::u64_PrintHex(u64 value, algo::cstring &out, int atleast) +// there is not enough information in a regx expression to fully specify it. +// sql vs shell vs classic regx, vs acr, partial vs full. +// we print back the original expression that was read in, but the information +// about what function read it is lost. +void algo_lib::Regx_Print(algo_lib::Regx ®x, algo::cstring &lhs) ``` ```c++ -// Print value VALUE to string OUT, -// producing least ATLEAST hex characters. -// if PREFIX is specified, include prefix 0x. -void algo::u64_PrintHex(u64 value, algo::cstring &out, int atleast, bool prefix) +void algo_lib::Regx_ReadAcr(algo_lib::Regx ®x, algo::strptr input, bool full) ``` ```c++ -// print character as c++ character, surrounded by single quotes -// and properly escaped according to c++ rules -void algo::char_PrintCppSingleQuote(int c, algo::cstring &out) +// Parse string INPUT as regex and store in REGX. +// Supported features: +// \n,\r,\t,\a,\e,\v,\f regular escaped chars +// [..] char range, possibly with negation +// $, ^ anchors +// . any char +// * repetition +// + one or more +// (..) precedence grouping and capture groups +// \d,\D,\w,\W,\s,\S macros +void algo_lib::Regx_ReadDflt(algo_lib::Regx ®x, algo::strptr input) ``` ```c++ -// prints a character suitable for appearance inside an XML string. -// character is either printed as-is, or is escaped so that its meaning does not change. -void algo::char_PrintXml(char c, algo::cstring &out, bool quoted) +// Set REGX to match string INPUT literally +void algo_lib::Regx_ReadLiteral(algo_lib::Regx ®x, algo::strptr input) ``` ```c++ -// Print string NAME as a TeX identifier to OUT, converting digits to letters -// (0 -> zero, etc) and squashing other characters not belonging to TeX -// identifier character class -void algo::strptr_PrintTexIdent(strptr name, algo::cstring &out) +void algo_lib::Regx_ReadShell(algo_lib::Regx ®x, algo::strptr input, bool full) ``` ```c++ -// print STR to OUT, escaping TeX characters that switch modes -// (_, #, &, $) -void algo::strptr_PrintTexString(strptr str, algo::cstring &out) +void algo_lib::Regx_ReadSql(algo_lib::Regx ®x, algo::strptr input, bool full) ``` ```c++ -// Print string using XML rules. -void algo::strptr_PrintXml(algo::strptr s, algo::cstring &out, bool quoted) +bool algo_lib::Regx_ReadStrptrMaybe(algo_lib::Regx ®x, algo::strptr input) ``` ```c++ -// Append N instances of character C to string OUT. -void algo::char_PrintNTimes(char c, algo::cstring &out, int n) +void algo_lib::Regx_ReadStyle(algo_lib::Regx ®x, algo::strptr input, algo_lib::RegxStyle style, bool full) ``` ```c++ -void algo::strptr_PrintAligned(algo::strptr str, algo::cstring &out, int nplaces, algo::TextJust align, char c) +// Set exit time of main loop to current time. +void algo_lib::ReqExitMainLoop() ``` ```c++ -void i32_Print(i32 i, algo::cstring &str) +// Reset value of algo_lib::_db.errtext and return it for further editing +// Usage: +// algo_lib::ResetBadTags() << ...errors... +algo::cstring &algo_lib::ResetErrtext() ``` ```c++ -void i64_Print(i64 i, algo::cstring &str) -``` - -```c++ -void i16_Print(i16 i, algo::cstring &str) -``` - -```c++ -void u16_Print(u16 i, algo::cstring &str) -``` - -```c++ -void u8_Print(u8 i, algo::cstring &str) -``` - -```c++ -void i8_Print(i8 i, algo::cstring &str) -``` - -```c++ -void u32_Print(u32 i, algo::cstring &str) -``` - -```c++ -void u64_Print(u64 i, algo::cstring &str) -``` - -```c++ -void u128_Print(u128 num, algo::cstring &out) -``` - -```c++ -void algo::cstring_Print(algo::cstring &row, algo::cstring &str) -``` - -```c++ -void algo::strptr_Print(const algo::strptr &row, algo::cstring &str) -``` - -```c++ -// Append a space unless the string already ends with a space -void algo::MaybeSpace(cstring &str) -``` - -```c++ -// print value*100 -// Example: -// double_PrintPercent(0.334, str, 1) -> "33.4%" -void algo::double_PrintPercent(double value, algo::cstring &str, int prec) -``` - -```c++ -void algo::i32_Range_Print(algo::i32_Range &r, algo::cstring &o) -``` - -```c++ -void double_Print(double d, algo::cstring &str) -``` - -```c++ -void float_Print(float d, algo::cstring &str) -``` - -```c++ -void algo::double_PrintWithCommas(double value, algo::cstring &str, int prec) -``` - -```c++ -// ignore:bigret -algo::cstring algo::double_PrintWithCommas(double value, int prec) -``` - -```c++ -// Print scaled decimal. -// VALUE integer value -// SCALE log10 to get the real value: real value = value / pow(10,scale) -// BUF target buffer. buffer must be large enough. -// FIXED if true, make sure there are exactly SCALE characters after decimal point (and always emit decimal point) -// RETURN number of characters printed. -// Example: -// u64_FmtBufDec(0 , 2, .. false ) -> "0" -// u64_FmtBufDec(0 , 2, .. true ) -> "0.00" -// u64_FmtBufDec(123 , 1, .. false ) -> "12.3" -// u64_FmtBufDec(123 , 2, .. false ) -> "1.23" -// u64_FmtBufDec(123 , 2, .. true ) -> "1.23" -// u64_FmtBufDec(1230 , 3, .. false ) -> "1.23" -// u64_FmtBufDec(1230 , 3, .. true ) -> "1.230" -u32 algo::u64_FmtBufDec(u64 num, int scale, u8 *buf, bool fixed) -``` - -```c++ -u32 algo::u64_FmtBufDec(u64 num, int scale, u8 *buf) -``` - -```c++ -// print TIME to STR, according to spec SPEC -// The following control characters are supported in SPEC. -// %Y Year printed as 4 digits, e.g. 2002 -// %y Last 2 digits of year printed as 2 digits -// %B Long month name (February) -// %b Short month name (Feb) -// %a Week day name (Monday) -// %m Month printed as 2 digits, with January being 01 -// %d Day of month printed as at least 2 digits (or WIDTH) -// %.X where X is a number -- set width -// %I Hour using 12-hour format -// %H Hour using 24-hour format, printed as 2 digits -// %M Minute, printed as 2 digits -// %S Second, printed as 2 digits -// %T Shortcut for %H:%M:%S.%.9X -// %X Print fractions of a second according to width -// %x Print milliseconds with 3 decimal places -// %- Print - sign if timespec is negative -// %% Print % sign -void algo::TimeStruct_Print(const TimeStruct &time, algo::cstring &str, const algo::strptr &spec) -``` - -```c++ -void algo::Tuple_Print(algo::Tuple &row_, algo::cstring &str) -``` - -```c++ -void char_Print(char c, algo::cstring &str) -``` - -```c++ -void bool_Print(bool row, algo::cstring &str) -``` - -```c++ -void algo::Bool_Print(algo::Bool row, algo::cstring &str) -``` - -```c++ -void algo::UnDiff_Print(UnDiff row, algo::cstring &str) -``` - -```c++ -void algo::UnixDiff_Print(UnixDiff row, algo::cstring &str) -``` - -```c++ -void algo::UnTime_Print(algo::UnTime row, algo::cstring &str) -``` - -```c++ -void algo::UnixTime_Print(algo::UnixTime row, algo::cstring &str) -``` - -```c++ -void algo::UnTime_PrintSpec(UnTime t, algo::cstring &out, const algo::strptr &spec) -``` - -```c++ -void algo::UnixTime_PrintSpec(UnixTime t, algo::cstring &out, const algo::strptr &spec) -``` - -```c++ -void algo::UnDiff_PrintSpec(UnDiff t, algo::cstring &out, const algo::strptr &spec) -``` - -```c++ -void algo::UnixDiff_PrintSpec(UnixDiff t, algo::cstring &out, const algo::strptr &spec) -``` - -```c++ -void ietf::Ipv4_Print(ietf::Ipv4 row, algo::cstring &str) -``` - -```c++ -void ietf::Ipv4Addr_Print(ietf::Ipv4Addr row, algo::cstring &str) -``` - -```c++ -void algo::Ipmask_Print(algo::Ipmask &row, algo::cstring &str) -``` - -```c++ -void algo::Errcode_Print(algo::Errcode &row, algo::cstring &str) -``` - -```c++ -void algo_lib::ErrorX_Print(algo_lib::ErrorX &row, algo::cstring &str) -``` - -```c++ -void ietf::Ipport_Print(ietf::Ipport row, algo::cstring &str) -``` - -```c++ -bool ietf::Ipport_ReadStrptrMaybe(ietf::Ipport &row, strptr in) -``` - -```c++ -// Append STR to OUT, using comma-separated-values encoding -// If QUOTE is 0, the need for quotes and the type of quote is determined automatically. -// If it is any other value, then that type of quote is used -// According to the CSV standard, the quote itself is the escape character. -void algo::strptr_PrintCsv(algo::strptr str, algo::cstring &out, char quote) -``` - -```c++ -// Print CSV field, auto-determine quotes -void algo::strptr_PrintCsv(algo::strptr str, algo::cstring &out) -``` - -```c++ -void algo_lib::FTxttbl_Print(algo_lib::FTxttbl &T_, algo::cstring &str) -``` - -```c++ -void algo_lib::FTxttbl_Markdown(algo_lib::FTxttbl &T_, algo::cstring &str) -``` - -```c++ -void algo::URL_Print(algo::URL &url, algo::cstring &str) -``` - -```c++ -// Append STR to OUT, and pad remainder with character FILL -void algo::strptr_PrintPadRight(algo::strptr str, algo::cstring &out, int nplaces, char fill) -``` - -```c++ -// Append STR to OUT, and pad remainder with space characters -void algo::strptr_PrintPadRight(algo::strptr str, algo::cstring &out, int nplaces) -``` - -```c++ -// Append STR to OUT, padding start with character FILL -void algo::strptr_PrintPadLeft(algo::strptr str, algo::cstring &out, int nplaces, char fill) -``` - -```c++ -// Append STR to OUT, padding start with spaces. -void algo::strptr_PrintPadLeft(algo::strptr str, algo::cstring &out, int nplaces) -``` - -```c++ -// Append STR to OUT as an SQL string using quote character Q. -// Escaped characters: -// '\' (backslash) -// ' quoted with '' if q is ' and not quoted otherwise. (Compatible with MariaDB & T-SQL.) -// " quoted with "" if q is " and not quoted otherwise. (Compatible with MariaDB & T-SQL.) -// NUL (ascii zero) -// \n -// \r -// \t -void algo::strptr_PrintSql(algo::strptr str, algo::cstring &out, char q) -``` - -```c++ -void algo::strptr_PrintSql(algo::strptr str, algo::cstring &out) -``` - -```c++ -void algo::Attr_Print(algo::Attr &attr, algo::cstring &str) -``` - -```c++ -// Print a string suitable for parsing with Tuple -// If the string doesn't need quotes, it is printed as-is. -// If quotes are needed, first determine whether to use single or double quotes to minimize -// escaping. Then print the string using char_PrintCppEsc for quoting. -// Empty string is printed as "" -void algo::PrintAttrSpace(cstring &str, algo::strptr name, const strptr &value) -``` - -```c++ -void algo::ListSep_Print(const algo::ListSep &t, algo::cstring &str) -``` - -```c++ -// copy string B to TO, using ORIG as a case template -// I.e. PrintCopyCase("AbcD", to, "somestring") -> "SomEstring" -void algo::strptr_PrintCopyCase(const algo::strptr &orig, algo::cstring &to, const algo::strptr &b) -``` - -```c++ -bool algo::Tuple_ReadStrptrMaybe(Tuple &row, algo::strptr s) -``` - -```c++ -// T target tuple. the tuple is not emptied before parsing. -// STR source string -// ATTRONLY if set, all loaded attrs are appended to the ATTRS -// array. otherwise, the first attr becomes HEAD. -// CMT_CHAR character at which to stop parsing. -// Parse sequence of attrs (name-value pairs) into tuple T. -// Roughly: -// ATTR -> VALUE | VALUE ':' VALUE -// VALUE -> IDENTIFIER | C++-STRING -// Return value: FALSE if unterminated string or other badness found in data. -bool algo::Tuple_ReadStrptr(algo::Tuple &tuple, strptr str, bool attronly) -``` - -```c++ -// Implementations of built-in read functions for AMC. -// basis function for reading tuples. -// scan ITER for identifier, or quoted string. -// return FALSE if attribute is malformed (i.e. unterminated string) -bool algo::cstring_ReadCmdarg(cstring &out, algo::StringIter &S, bool is_value) -``` - -```c++ -// Read Charset from list of chars. -// Every character in RHS is simply added to the bitset -void algo::Charset_ReadStrptrPlain(algo::Charset &lhs, strptr desc) -``` - -```c++ -bool algo::Charset_ReadStrptrMaybe(algo::Charset &lhs, strptr rhs) -``` - -```c++ -// Print STR to OUT in a way that's acceptable as input for bash. -void algo::strptr_PrintBash(strptr str, algo::cstring &out) -``` - -```c++ -// Escape S according to bash rules and return result -tempstr algo::strptr_ToBash(strptr str) -``` - -```c++ -// Escape S according to ssim rules and return result -tempstr algo::strptr_ToSsim(strptr str) -``` - -```c++ -// encode uri component. -// before ? use plus=false (no + substitution by space) -void algo::strptr_PrintUri(strptr str, algo::cstring &out, bool plus) -``` - -```c++ -// Print string, escaping characters in a way suitable for graphviz dot format -void algo::strptr_PrintDot(strptr s, algo::cstring &out) -``` - -```c++ -// print binary octet string as hex -void algo::Sha1sig_Print(algo::Sha1sig &sha1sig, algo::cstring &out) -``` - -```c++ -bool algo::Sha1sig_ReadStrptrMaybe(algo::Sha1sig &sha1sig, algo::strptr str) -``` - -```c++ -// Write character C into string OUT, using C++ character escapement rules -// QUOTE_CHAR also gets escaped. -void algo::char_PrintCppEsc(char c, algo::cstring &out, char quote_char) -``` - -```c++ -// Print STR, surrounded by quotes as C++ string -// surrounded by QUOTE_CHAR quotes, to buffer OUT. -// All string characters are escaped using char_PrintCppEsc. -void algo::strptr_PrintCppQuoted(algo::strptr str, algo::cstring &out, char quote_char) -``` - -```c++ -// Print STR as a C++ string to OUT. -void algo::strptr_PrintCpp(algo::strptr str, algo::cstring &out) -``` - -```c++ -// Print STR as a valid SSIM key/value to OUT. -// SSIM tokens use quotes only when the printed value contains -// characters outside of the 'safe' set a-zA-Z0-9_;&*^%$@.!:,+/- -void algo::strptr_PrintSsim(algo::strptr str, algo::cstring &out) -``` - -```c++ -// Begin append key/value to string LHS -int algo::BeginKeyval(cstring &lhs, const strptr &name) -``` - -```c++ -// End append key/value to string LHS -cstring &algo::EndKeyval(cstring &lhs, int start) -``` - -```c++ -// Append key-value pair NAME:VALUE to string STR -void algo::PrintAttr(cstring &str, const algo::strptr &name, const strptr &value) -``` - -```c++ -// Append key-value pair NAME:VALUE to string STR, and remove all -// characters from VALUE (used by amc) -void algo::PrintAttrSpaceReset(cstring &str, const algo::strptr &name, algo::cstring &value) -``` - -```c++ -// Append key-value pair NAME:VALUE to string STR, -// and remove all characters from VALUE (used by amc) -void algo::PrintAttrSpaceReset(cstring &str, const char *name, algo::cstring &value) -``` - -```c++ -// Convert VALUE to a string, encoded as a u64. -// Value must be >=0 and <100000000. -// Resulting u64 is little-endian -- MSB contains first byte -// of the resulting string. To be used as an ascii string, value -// 0x3030303030303030 (8 ascii '0's) must be added to the result. -// Don't use this function. Use u32_FmtBufSmall, and u64_FmtBuf. -u64 algo::u32_CvtLestr8Small(u32 value) -``` - -```c++ -// Format VALUE, which should be >=0 and <100000000, -// as a string and write it to buffer BUF. Return length of resulting string. -// Buffer must be big enough. -u32 algo::u32_FmtBufSmall(u32 value, u8 *buf) -``` - -```c++ -// Format VALUE, which is an arbitrary u64, -// as a string and write it to buffer BUF. -// Return length of resulting string. -// Buffer must be big enough. -u32 algo::u64_FmtBuf(u64 value, u8 *buf) -``` - -```c++ -// Format VALUE, which is an arbitrary u32, -// as a string and write it to buffer BUF. -// Return length of resulting string. -// Buffer must be big enough. -u32 algo::u32_FmtBuf(u32 value, u8 *buf) -``` - -```c++ -u64 algo::aParseNum16(strptr s, u32 &ok) -``` - -```c++ -// STR little-endian string up to 2 chars in length -// LEN length of STR -// RESULT value of hex number encoded in STR -// RETURN number of characters to skip (0 - unsuccessful) -int algo::ParseHex2(u32 str, int len, u8 &result) -``` - -```c++ -// STR little-endian string up to 4 chars -// LEN length of STR -// RESULT Octal value encoded in str -// RETURN number of characters to skip (0 - unsuccessful) -int algo::ParseOct3(u32 str, int len, u8 &result) -``` - -```c++ -u32 algo::ParseNum4(u32 x, u32 len, u32 &ok) -``` - -```c++ -u32 algo::ParseNum8(u64 x, u32 len, u32 &ok) -``` - -```c++ -// Print a string as a classic regex, escaping all special -// characters. This regex will only match the specified string. -void algo::strptr_PrintRegxSql(algo::strptr value, algo::cstring &str) -``` - -```c++ -void algo::WDiff_Print(algo::WDiff row, algo::cstring &str) -``` - -```c++ -void algo::WTime_Print(algo::WTime row, algo::cstring &str) -``` - -```c++ -bool algo::WDiff_ReadStrptrMaybe(algo::WDiff &parent, algo::strptr in_str) -``` - -```c++ -bool algo::WTime_ReadStrptrMaybe(algo::WTime &parent, algo::strptr in_str) -``` - -```c++ -void algo::u64_PrintBase32(u64 k, algo::cstring &str) -``` - -```c++ -void algo::Uuid_Print(algo::Uuid &parent, algo::cstring &str) -``` - -```c++ -void algo_lib::IohookInit() -``` - -```c++ -// Register IOHOOK to be called whenever an IO operation is possible. -// OK to add an fd twice with different flags. Subsequent calls override previous ones. -// Add iohook to epoll in read, write or read/write mode -// Optionally, add as edge triggered -void algo_lib::IohookAdd(algo_lib::FIohook& iohook, algo::IOEvtFlags inflags) NOTHROW -``` - -```c++ -// De-register interest in iohook -void algo_lib::IohookRemove(algo_lib::FIohook& iohook) NOTHROW -``` - -```c++ -// give up unused time to the OS. -// Compute number of clocks to sleep before next scheduling cycle -// If there was no sleep on the previous cycle, the sleep is zero. -// This last bit is important because it prevents deadlocks -// when one step implicitly creates work for another step -// that occurs before it in the main loop. -// Sleep will not extend beyond algo_lib::_db.limit -void algo_lib::giveup_time_Step() -``` - -```c++ -// Execute unix command and return output. -tempstr algo::SysEval(strptr cmd, FailokQ fail_ok, int max_output, bool echo = false) -``` - -```c++ -// Execute unix command and return status code. -// Execute command using system(). -// fail_ok: if true, command must succeed or throw exception -// dry_run: if true, do not run command, just print -// echo: print command. command alwyas echoed if verbose mode is on -int algo::SysCmd(strptr cmd, FailokQ fail_ok = FailokQ(true), DryrunQ dry_run = DryrunQ(false), EchoQ echo = EchoQ(false)) -``` - -```c++ -// Return a human-readable description of STATUS as returned by wait() / waitpid() -tempstr algo::DescribeWaitStatus(int status) -``` - -```c++ -// The several variants of Throw are all the same -- the goal is to get as many -// setup instructions out of the execution path as possible, to avoid polluting instruction -// cache. -void algo::Throw(strptr text, Errcode err) NORETURN -``` - -```c++ -void algo::Throw() NORETURN -``` - -```c++ -// Set exit time of main loop to current time. -void algo_lib::ReqExitMainLoop() -``` - -```c++ -void algo_lib::fd_Cleanup(algo_lib::FFildes &fildes) -``` - -```c++ -Attr* algo::attr_Find(Tuple &tuple, strptr name, int occurence = 0) -``` - -```c++ -strptr algo::attr_GetString(Tuple &T, strptr name, strptr dflt = strptr()) -``` - -```c++ -// Append new attribute with specified name and value. -void algo::attr_Add(Tuple &T, strptr name, strptr value) -``` - -```c++ -void algo_lib::fildes_Cleanup(algo_lib::FIohook &iohook) -``` - -```c++ -// Call sleep/usleep, giving up MS milliseconds -void algo::SleepMsec(int ms) -``` - -```c++ -Errcode algo::FromErrno(i64 val) -``` - -```c++ -Errcode algo::FromWinErr(i64 val) -``` - -```c++ -i64 algo::I64Power10(u32 power) -``` - -```c++ -// Copy bytes from one location to another in blocks of 16 bytes. -void algo::StreamFromToB16(void *from, void *to, u32 n) -``` - -```c++ -void algo::CopyFromToB16(void *from, void *to, u32 n) -``` - -```c++ -// SSE implementation of fast exponentiation idea from -// http//nic.linotune.com/pubs/Schraudolph99.pdf -// ExpFast(x) goes bad at x < -709 (exp doesn't) -// Where it works, ExpFast makes a steady relative error of about 2%. -double algo::ExpFast(double y) -``` - -```c++ -// lock all presently, and future allocated bytes in physical memory. -// Return success value. Errno provides more info. -bool algo::LockAllMemory() -``` - -```c++ -void algo::SetupExitSignals(bool sigint = true) -``` - -```c++ -void algo_lib::bh_timehook_Step() -``` - -```c++ -// Check signature on incoming data -bool algo_lib::dispsigcheck_InputMaybe(dmmeta::Dispsigcheck &dispsigcheck) -``` - -```c++ -const tempstr algo::GetHostname() -``` - -```c++ -const tempstr algo::GetDomainname() -``` - -```c++ -// Die when parent process dies -void algo_lib::DieWithParent() -``` - -```c++ -// Create temporary file -// tempfile.fildes points to the new temp file after this -// temp file is created under temp/ -// prefix is a namespace-unique name, such as "amc.xyz" -// Actual file that's created becomes "temp/amc.xyz.XXXXXX" -// Computed filename is saved to tempfile.filename -void algo_lib::TempfileInitX(algo_lib::FTempfile &tempfile, strptr prefix) -``` - -```c++ -void algo_lib::fildes_Cleanup(algo_lib::FTempfile &tempfile) -``` - -```c++ -double algo::double_WeakRandom(double scale) -``` - -```c++ -i32 algo::i32_WeakRandom(i32 modulo) -``` - -```c++ -// Interpret redirect string, return resulting fd -// If no redirect applies, return -1 -// If a valid fd is returned, it is unique and may be closd with close() -// Supported redirects: -// >filename -- on exit, dst_fd is writing to a file -// >filename -- on exit, dst_fd is appending to a file -// >&fd -- on exit, dst_fd is pointing to fd -// <&fd -- on exit, dst_fd is pointing to fd -// This function could be called openex -int algo_lib::CreateRedirect(strptr redirect) -``` - -```c++ -// Interpret redirect string and make DST_FD consistent with -// the intended state. Return 0 on success, -1 on failure -// This function is usually called in the child process right after fork -// See CreateRedirect for interpretation of redirect string -int algo_lib::ApplyRedirect(strptr redirect, int dst_fd) -``` - -```c++ -bool algo_lib::IpmaskValidQ(const strptr ipmask) -``` - -```c++ -// Return TRUE if current user is root. -// #AL# is this more correct than checking that effective uid is 0? -bool algo_lib::RootQ() -``` - -```c++ -// Return name of user executing this command. -// If the command is being executed under sudo, return name -// of original user. -tempstr algo_lib::EffectiveUser() -``` - -```c++ -// if OWN_FD is cleared, clean up file descriptor before it is closed -void algo_lib::file_Cleanup(algo_lib::InTextFile &file) -``` - -```c++ -// Walk child process tree for parent process pid, in post-order traversal way, -// and send signal sig to each process. Kill_topmost is an option whether -// to send signal to parent process itself. Return value - number of processes -// to whose the signal has been actually sent. -// Does not throw exceptions, just prints error message if kill() fails. -// Linux only. -int algo_lib::KillRecurse(int pid, int sig, bool kill_topmost) -``` - -```c++ -// Return computed name for sandbox SANDBOX -tempstr algo_lib::SandboxDir(algo::strptr sandbox) -``` - -```c++ -// Enter sandbox directory remember previous directory -void algo_lib::PushDir(algo::strptr dir) -``` - -```c++ -// Change to the directory that was current before sandbox mode -// Must be balanced with PushDir -void algo_lib::PopDir() -``` - -```c++ -// Accept data block DATA as input for the line buffer -// LinebufNext will attempt to return pointers to a subregion of DATA until -// it returns false, so this block must be valid until then. -// If IMPLIED_EOF is set, then this is the last call to LinebufBegin. -// LinebufNext will know to return a partial line (with no \n) and set the -// EOF flag -void algo::LinebufBegin(LineBuf &L, memptr data, bool implied_eof) -``` - -```c++ -// Scan memory provided by LinebufBegin for line separator (hard-coded to be '\n') -// If the function returns FALSE, and there is a partial line remaining, -// it is saved to an internal buffer in LineBuf (called BUF). -// It will be subsequently recombined with incoming data to form a contiguous line, -// but copying memory is avoided whenever possible. -// Usage: -// LinebufBegin(linebuf,data,true); -// for (strptr line; LinebufNext(linebuf,line); ) { -// -// } -bool algo::LinebufNext(LineBuf &L, strptr &result) -``` - -```c++ -// Read characters up to newline or end of file. Return -// resulting substring, skipping the newline -// (which is either \n or \r\n). -strptr algo::GetLine(StringIter &S) -``` - -```c++ -// Line_curs uses strptr to hold on to the string being scanned -// (to avoid copying a potentially huge string) -// The use of "strptr&" prevents passing a temporary. -// Line_curs handling of newlines is identical to that of FileLine_curs -void algo::Line_curs_Reset(Line_curs &curs, algo::strptr &text) -``` - -```c++ -void algo::Line_curs_Reset(Line_curs &curs, algo::cstring &text) -``` - -```c++ -// Scan for next line. -void algo::Line_curs_Next(Line_curs &curs) -``` - -```c++ -// Read next line from FILE into RESULT -// When end of file is reached, return FALSE. -// If error occurs during reading, return false. -// Typical usage: -// InTextFile file; -// file.file = OpenRead(filename); -// for (strptr line; ReadLine(file,line); ) { -// -// } -// A partial line at the end of the file is returned. -bool algo_lib::ReadLine(algo_lib::InTextFile &file, algo::strptr &result) -``` - -```c++ -void algo::FileLine_curs_Reset(algo::FileLine_curs &curs, strptr filename) -``` - -```c++ -void algo::FileLine_curs_Reset(algo::FileLine_curs &curs, algo::Fildes fd) -``` - -```c++ -void algo::FileLine_curs_Next(algo::FileLine_curs &curs) -``` - -```c++ -// Attempt to lock the file named NAME, updating state of LOCKFILE. -// Return TRUE if lock is successfully applied. -// If FAIL_OK is false, an error causes an exception (function always returns true) -// If an exception is thrown, the text contains error description. -// Otherwise, algo_lib::_db.errtext (DetachBadTags()) contains human-readable description of error. -// If WAIT_TIMEOUT is non-zero, block up to WAIT_TIMEOUT seconds before failing -// Write pid to file specified in NAME, and lock file using flock(). -bool algo_lib::LockFileInit(algo_lib::FLockfile &lockfile, strptr name, algo::FailokQ fail_ok, algo::UnDiff wait_timeout) -``` - -```c++ -// Write pid to lockfile, separate function to update pid after fork(). -// Sets error text in case of error, and return false. -bool algo_lib::WritePid(algo_lib::FLockfile &lockfile) -``` - -```c++ -// Non-blocking attempt to lock LOCKFILE -// Return success status -// If FAIL_OK is FALSE, throw exception on error (must succeed) -bool algo_lib::LockFileInit(algo_lib::FLockfile &lockfile, strptr name, algo::FailokQ fail_ok) -``` - -```c++ -// Non-blocking attempt to lock LOCKFILE. -// Throw exception on error. -// If the function returns, it has succeeded. -void algo_lib::LockFileInit(algo_lib::FLockfile &lockfile, strptr name) -``` - -```c++ -// Read contents of lock file FNAME, extracting the pid that's stored in there. -// On failure, return 0 -pid_t algo_lib::LockFileRead(strptr fname) -``` - -```c++ -// User-defined cleanup function for MMAP.MEM -void algo_lib::mem_Cleanup(algo_lib::Mmap &mmap) -``` - -```c++ -// Attach mmapfile MMAPFILE to FD. -// Return success code. -bool algo_lib::MmapFile_LoadFd(MmapFile &mmapfile, algo::Fildes fd) -``` - -```c++ -// Attach mmapfile MMAPFILE to FNAME -// Return success code. -bool algo_lib::MmapFile_Load(MmapFile &mmapfile, strptr fname) -``` - -```c++ -// Default implementation of prlog handler -// -// Notes on WriteFile use: -// some tools set fd 1 to nonblocking mode, which causes EAGAIN during fast writes, -// so we must use WriteFile (which contains a loop) to write all the bytes out. -void algo::Prlog(algo_lib::FLogcat *logcat, algo::SchedTime tstamp, strptr str) -``` - -```c++ -// there is not enough information in a regx expression to fully specify it. -// sql vs shell vs classic regx, vs acr, partial vs full. -// we print back the original expression that was read in, but the information -// about what function read it is lost. -void algo_lib::Regx_Print(algo_lib::Regx ®x, algo::cstring &lhs) -``` - -```c++ -// Check if REGX matches S, return result -bool algo_lib::Regx_Match(algo_lib::Regx ®x, algo::strptr text) -``` - -```c++ -// Parse string INPUT as regex and store in REGX. -// Supported features: -// \n,\r,\t,\a,\e,\v,\f, [..], $, ^, -// ., *, +, (..), {..}, \d,\D,\w,\W,\s,\S -void algo_lib::Regx_ReadDflt(algo_lib::Regx ®x, algo::strptr input) -``` - -```c++ -// Parse bash-style regx: -// * -> .* -// ? -> .? -// All other regx chars are escaped away -// if FULL is set to false, input is treated as ".*input.*" -void algo_lib::Regx_ReadShell(algo_lib::Regx ®x, algo::strptr input, bool full) -``` - -```c++ -// Parse SQL-style regx: -// % is rewritten as .* -// _ is rewritten as . -// (, ), [, ] are passed through -// ., *, ?, + are escaped -// if FULL is set to false, input is treated as ".*input.*" -void algo_lib::Regx_ReadSql(algo_lib::Regx ®x, algo::strptr input, bool full) -``` - -```c++ -// Parse ACR-style regx: -// % is rewritten as .* -// (, ), [, ], _ are passed through -// ., *, ?, + are escaped -// if FULL is set to false, input is treated as ".*input.*" -// If the input expression can be matched as a string, set REGX.LITERAL to true -void algo_lib::Regx_ReadAcr(algo_lib::Regx ®x, algo::strptr input, bool full) -``` - -```c++ -// Set REGX to match string INPUT literally -void algo_lib::Regx_ReadLiteral(algo_lib::Regx ®x, algo::strptr input) -``` - -```c++ -bool algo_lib::Regx_ReadStrptrMaybe(algo_lib::Regx ®x, algo::strptr input) -``` - -```c++ -// S source string -// EXPR string in the form (XYZ)* -// - X is the character to search -// - Y is L to search from left, R to search from right -// - Z is which site to pick: L=left, R=right -// If the character to search is not found, it assumed to be found -// at the far end of the string with respect to search direction. -// Function processes characters from expr in groups of 3. -// Example: -// s = "a.b.c.d" -// expr = ".LR.LL" -// first, search for . from left; pick right hand side (b.c.d) -// then, search for . from left. pick left hand side (b) -// result: b -// More examples: -// s = "abcd"; expr = ".LL"; result = "abcd" -// s = "abcd"; expr = ".LR"; result = "" -strptr algo::Pathcomp(strptr s, strptr expr) -``` - -```c++ -// Check if the Pathcomp expression PATHCOMP -// refers to the leftmost part of the key -// (The third character of each Pathcomp step must be 'L') -bool algo::LeftPathcompQ(algo::strptr pathcomp) -``` - -```c++ -// Append NUL character to the end of the string and return a -// pointer to the C string. -// There is no guarantee that there are no NUL characters in the middle -// of STR, that is up to the user. -// cstring is normally NOT null terminated (it is length-based), -// so this function is necessary when passing strings to C library functions -// or the OS -char *algo::Zeroterm(cstring &rhs) -``` - -```c++ -// Same thing but with tempstr. -// Typical usage is to take a strptr -// expression and pass it to some unix call -// some_unix_call(Zeroterm(tempstr(some_strptr))) -// -char *algo::Zeroterm(const tempstr &rhs) -``` - -```c++ -// Construct ssim filename from key -// SsimFname("data", "abcd") -> data/abcd.ssim -// SsimFname("data/", "abcd.ef") -> data/abcd/ef.ssim -tempstr algo::SsimFname(strptr root, strptr rel) -``` - -```c++ -// Extract Namespace name from "ns.name" format. -// This is equivalent to Pathcomp(s,".LL") -strptr algo::GetNs(strptr s) -``` - -```c++ -// if IDENT starts with NS_NAME., return ident without prefix -// otherwise return ident -// if NS_NAME is empty, removes any dotted prefix from IDENT. -// NS_NAME name of 'current' namespace (optional) -// IDENT identifier in question -// -// StripNs("abc", "abc.def") -> "def" -// StripNs("" , "abc.def") -> "def" -// StripNs("abc", "def.ghi") -> "def.ghi" -strptr algo::StripNs(strptr ns_name, strptr ident) -``` - -```c++ -// This function echoes the corresponding MySQL function. -// Treat STR as an array of tokens separated by C. -// Locate and return tokens 1..IDX. Negative numbers cause scanning from the right. -// Indexes are 1-based -// Example: -// SubstringIndex("a.b.c", '.', 1) -> "a" -// SubstringIndex("a.b.c", '.', 2) -> "a.b" -// SubstringIndex("a.b.c", '.', 3) -> "a.b.c" -// SubstringIndex("a.b.c", '.', 4) -> "a.b.c" -// SubstringIndex("a.b.c", '.', -1) -> "c" -// SubstringIndex("a.b.c", '.', -2) -> "b.c" -// SubstringIndex("a.b.c", '.', -3) -> "a.b.c" -strptr algo::SubstringIndex(strptr str, char c, int idx) -``` - -```c++ -int algo::FindFrom(strptr s, strptr t, int from, bool case_sensitive) -``` - -```c++ -int algo::FindFrom(strptr s, strptr t, int from) -``` - -```c++ -int algo::FindFrom(strptr s, char c, int from) -``` - -```c++ -// Search for character/string from left to right -// If found, return index where match occurs. -// If not found, return -1 -int algo::FindChar(strptr lhs, char c) -``` - -```c++ -int algo::FindStr(strptr lhs, strptr t, bool case_sensitive) -``` - -```c++ -int algo::FindStr(strptr lhs, strptr t) -``` - -```c++ -int algo::CompareNoCase(strptr lhs, strptr s) -``` - -```c++ -// Check strings for equality, optionally in a case-insensitive way -bool algo::StrEqual(strptr a, strptr b, bool case_sens) -``` - -```c++ -bool algo::StartsWithQ(strptr s, strptr sstr, bool case_sensitive = true) -``` - -```c++ -bool algo::EndsWithQ(strptr s, strptr sstr) -``` - -```c++ -void algo::MakeLower(strptr s) -``` - -```c++ -void algo::MakeUpper(strptr s) -``` - -```c++ -// Locate all occurences of SEP in string IN, scanning line-by-line. -// Compute column widths; Scan string IN again. -// Expand each column to the required width, leaving COLSPACE characters between -// columns. -// String FMT specifies, for each column, whether to align its contents left,center,or right -// ('l','c','r'). Default is 'l'. -// Example text -// aa\tcc\tbb -// asdfasdf\t\tyy -// Tabulated(text, "\t", "rl", 2) -> -// aa cc bb -// asdfasdf yy -tempstr algo::Tabulated(strptr in, strptr sep, strptr fmt, int colspace) -``` - -```c++ -tempstr algo::Tabulated(strptr in, strptr sep) -``` - -```c++ -// Given a string of up to 4 characters encoded in u32 STR -// (LSB = first char, etc.) -// Decode character into RESULT, returning number of characters read. -// The character is C++-escaped: \a, \b, \f, \n, \r, \t, \v, \', \", \\, \? are supported -// as well as octal (\OOO) and hex (\xHH) sequences. -int algo::UnescapeC(u32 str, int len, u8 &result) -``` - -```c++ -int algo::Replace(cstring &str, const strptr& from, const strptr& to, bool case_sensitive = true, bool preserve_case = true) -``` - -```c++ -// Scan S. For any character in S that occurs in string FROM, replace with corresponding -// character from string TO. -// Example: -// Translate("aabcd", "bd", "xy") -> "aaxcy" -void algo::Translate(strptr s, strptr from, strptr to) -``` - -```c++ -void algo_lib::ind_replvar_Cleanup(algo_lib::Replscope &replscope) -``` - -```c++ -// Set value of key KEY value VALUE -// KEY string to replace -// VALUE value to replace it with -// SUBST If set, $-expand the VALUE parameter -void algo_lib::Set(algo_lib::Replscope &scope, strptr from, strptr to, bool subst = true) -``` - -```c++ -// Append TEXT to OUT, performing $-substitution using variables from SCOPE (must be non-NULL) -// if EOL is set, then new line is appended at the end. -void algo_lib::Ins(algo_lib::Replscope *scope, algo::cstring &out, strptr text, bool eol = true) -``` - -```c++ -// Enable comma-eating (default true) -void algo_lib::eatcomma_Set(algo_lib::Replscope &scope, bool enable) -``` - -```c++ -// Enable strict mode (default true -- any failed substitution kills process) -// If strict mode is off, failed substitution acts as if there was no substitution -void algo_lib::fatal_Set(algo_lib::Replscope &scope, bool enable) -``` - -```c++ -// Perform $-substitutions in TEXT and return new value. -tempstr algo_lib::Subst(algo_lib::Replscope &scope, strptr text) -``` - -```c++ -// read TEXT into a tuple. -// perform variable substitution on key-value pairs. -// write tuple back. -// return resulting string -tempstr algo_lib::Tuple_Subst(algo_lib::Replscope &R, strptr text) -``` - -```c++ -algo::tempstr::tempstr() -``` - -```c++ -algo::tempstr::~tempstr() -``` - -```c++ -// Return a run of characters up to next occurence of SEP (or to end of string) -// Skip any characters equal to SEP that follow the run -// sep="|", string = "a||b|"; return value -> "a", rest -> "b|"; -// sep="|", string = "a"; return value -> "a", rest -> ""; -// sep="|", string = "|x"; return value -> "" , rest -> "x"; -strptr algo::GetTokenChar(algo::StringIter &S, char sep) -``` - -```c++ -// Skip leading characters matching SEP -// Return run of characters up to next matching SEP, or EOF. -// Do not skip trailing separators. -strptr algo::GetWordCharf(algo::StringIter &iter, bool (*sep)(u32) = algo_lib::WhiteCharQ) -``` - -```c++ -// Skip any leading whitespace in STR. -// Read and return next word. -strptr algo::GetTypeTag(strptr str) -``` - -```c++ -bool algo::TryParseI32(algo::StringIter &iter, i32 &result) -``` - -```c++ -bool algo::TryParseI64(algo::StringIter &iter, i64 &result) -``` - -```c++ -bool algo::TryParseU32(algo::StringIter &iter, u32 &result) -``` - -```c++ -bool algo::TryParseU64(algo::StringIter &iter, u64 &result) -``` - -```c++ -bool algo::TryParseU128(algo::StringIter &iter, u128 &result) -``` - -```c++ -// Read a series of digits and return resulting number. -// Return success code -bool algo::TryParseDigits(algo::StringIter &S, double &result) -``` - -```c++ -// TODO: document these more carefully -// Read a series of digits N, returning N / pow(10, length(N)) -// If successful, advance index. Otherwise, leave index where it was. -bool algo::TryParseFraction(algo::StringIter &S, double &result) -``` - -```c++ -bool algo::TryParseDouble(algo::StringIter &iter, double &result) -``` - -```c++ -// Search for the next occurence of SEP. If not found, assume it occurs at EOF -// Return any characters between current position and the occurence of SEP -// Skip SEP, if needed. -strptr algo::GetTokenStrptr(StringIter &iter, const strptr& separator) -``` - -```c++ -// if the next characters match STR, skip and return true -// optionally do case sensitive comparison -bool algo::SkipStrptr(StringIter &iter, strptr str, bool case_sens) -``` - -```c++ -// Case-sensitive version -bool algo::SkipStrptr(StringIter &iter, strptr str) -``` - -```c++ -i64 algo::ParseI64(StringIter &iter, i64 dflt) -``` - -```c++ -// Convert string to numeric type. -// If there is an error, or string is empty, return DFLT. -// If there is junk at the end of the string, silently ignore it. -// Use StringIter version to check for junk, or use -X version to throw exception. -u64 algo::ParseU64(StringIter &iter, u64 dflt) -``` - -```c++ -int algo::ParseI32(StringIter &iter, int dflt) -``` - -```c++ -u32 algo::ParseU32(StringIter &iter, u32 dflt) -``` - -```c++ -int algo::StringIter::GetDigit(int dflt) -``` - -```c++ -void algo_lib::RunCsvParse(algo_lib::CsvParse &csvparse) -``` - -```c++ -// Find first occurence of MATCH in S -// If found, return range corresponding to the match. -// If not found, return range (S.n_elems,S.n_elems) -- an empty range positioned at -// the end of S -algo::i32_Range algo::substr_FindFirst(const aryptr &s, const aryptr &match) -``` - -```c++ -// Same as above but search right-to-left. -// In case of failure, return range (0,0) -- empty range positioned at start of S. -algo::i32_Range algo::substr_FindLast(const aryptr &s, const aryptr &match) -``` - -```c++ -// Strip leading whitespace, return new strptr. -strptr algo::TrimmedLeft(strptr s) -``` - -```c++ -// Strip trailing whitespace, return new strptr. -strptr algo::TrimmedRight(strptr s) -``` - -```c++ -// TrimmedLeft + TrimmedRight -strptr algo::Trimmed(strptr s) -``` - -```c++ -// scan STR until character SEP is found. -// if SEP is not found, it is assumed to be beyond the right side of the string -// set LEFT to point to the characters to the left of found location. -// set STR to point to the characters to the right of found location. -// Example: -// str = "abc.def", sep='.'; After NextSep, str="def", left="abc" -// str = "abc-def", sep='.'; After NextSep, str="", left="abc-def" -void algo::NextSep(algo::strptr &str, char sep, algo::strptr &left) -``` - -```c++ -void algo::Word_curs_Reset(Word_curs &curs, strptr text) -``` - -```c++ -void algo::Word_curs_Next(Word_curs &curs) -``` - -```c++ -// Skip any leading whitespace. -// Read next word (GetWordCharf) and compare to typetag. -// Skip any subsequent whitespace as well. -// Return true if type typetag matches -// if typetag doesn't match, input string remains unchanged -// " a b " -> typetag is "a", rest is "b " -// "a b" -> typetag is "a", rest is "b" -bool algo::StripTypeTag(strptr &in_str, strptr typetag) -``` - -```c++ -// Limit length of string S ot at most LEN characters -// If S is trimmed, append "..." to the end -tempstr algo::LimitLengthEllipsis(strptr s, int len) -``` - -```c++ -algo::i32_Range algo::ch_FindFirst(const algo::strptr &s, char match) -``` - -```c++ -algo::i32_Range algo::ch_FindLast(const algo::strptr &s, char match) -``` - -```c++ -bool algo::strptr_ReadStrptrMaybe(strptr , strptr ) -``` - -```c++ -// Append / to string STR unless STR already ends in one. -// str << dirname << MaybeDirSep << filename. -// The separator is always /. To support windows-specific pathnames, -// use ToWindows path where appropriate. -void algo::MaybeDirSep(cstring &str) -``` - -```c++ -algo::Attr_curs::Attr_curs() -``` - -```c++ -void algo::Attr_curs_Reset(Attr_curs &curs, strptr line) -``` - -```c++ -void algo::Attr_curs_Next(Attr_curs &curs) -``` - -```c++ -// Compare two strings whose start address is 16-byte aligned -// Do not use this function -- -bool algo::AlignedEqual(strptr a, strptr b) -``` - -```c++ -// insert TEXT into OUT, indenting as necessary; -// Initial indentation is INDENT, it's adjusted as necessary as { and } are found -// in the TEXT. -// Each indent is 4 spaces. -// Trailing //-sytle comments are stripped -// /* */-style comments are not supported -// Lines beginning with # (#ifdef, etc) are printed at column zero. -void algo::InsertIndent(algo::cstring &out, strptr text, int indent) -``` - -```c++ -// Convert unix path to windows path -// This replaces slashes with backslashes -tempstr algo::ToWindowsPath(strptr path) -``` - -```c++ -// compatibility -void algo::reset(algo::cstring &lhs) -``` - -```c++ -void algo::DayRange_curs_Reset(algo::DayRange_curs &curs, const algo::DayRange& range) -``` - -```c++ -void algo::DayRange_curs_Next(algo::DayRange_curs &curs) -``` - -```c++ -bool algo::DayRange_curs_ValidQ(algo::DayRange_curs &curs) -``` - -```c++ -algo::UnTime& algo::DayRange_curs_Access(algo::DayRange_curs &curs) -``` - -```c++ -algo::u64_Ranges_curs::u64_Ranges_curs() : cur(0), end(0), valid(false) -``` - -```c++ -void algo::u64_Ranges_curs_Reset(algo::u64_Ranges_curs &curs, strptr str) -``` - -```c++ -void algo::u64_Ranges_curs_Next(algo::u64_Ranges_curs &curs) -``` - -```c++ -bool algo::u64_Ranges_curs_ValidQ(algo::u64_Ranges_curs &curs) -``` - -```c++ -u64 &algo::u64_Ranges_curs_Access(algo::u64_Ranges_curs &curs) -``` - -```c++ -void algo::Sep_curs_Reset(algo::Sep_curs &curs, strptr line, char sep) -``` - -```c++ -void algo::Sep_curs_Next(algo::Sep_curs &curs) -``` - -```c++ -bool algo::TimeStruct_Read(TimeStruct &out, algo::StringIter &iter, const strptr& spec) -``` - -```c++ -TimeStruct algo::ToTimeStruct(UnDiff U) -``` - -```c++ -TimeStruct algo::ToTimeStruct(UnixDiff U) -``` - -```c++ -algo::UnixDiff algo::ToUnixDiff(const TimeStruct &S) -``` - -```c++ -algo::UnDiff algo::ToUnDiff(const TimeStruct &S) -``` - -```c++ -const algo::UnixTime algo::LocalDate(UnixTime in) -``` - -```c++ -TimeStruct algo::GetLocalTimeStruct(UnixTime U) -``` - -```c++ -TimeStruct algo::GetLocalTimeStruct(UnTime U) -``` - -```c++ -const algo::UnTime algo::LocalDate(UnTime in) -``` - -```c++ -algo::UnDiff algo::StripDate(UnTime t) -``` - -```c++ -algo::TimeStruct algo::GetGMTimeStruct(algo::UnTime U) -``` - -```c++ -algo::UnixTime algo::ToUnixTime(const TimeStruct &S) -``` - -```c++ -algo::UnTime algo::ToUnTime(const TimeStruct &S) -``` - -```c++ -// empty string -> 0 -// invalid weekday -> -1 -// All other weeks days map to 0..6, numbers compatible with struct tm's tm_wday field -int algo::GetWeekday(strptr wday) -``` - -```c++ -const strptr algo::GetWeekdayName(int index) -``` - -```c++ -int algo::GetMonthZeroBased(strptr month) -``` - -```c++ -int algo::GetWholeMonthZeroBased(strptr s) -``` - -```c++ -// Inverse mapping to abbreviated month names (Jan, Feb, etc.) -// If short_name==false, returns full name (January, February, etc.) -const strptr algo::GetMonthNameZeroBased(int index) -``` - -```c++ -const strptr algo::GetMonthNameZeroBasedShort(int index) -``` - -```c++ -// DateCache -- Roughly 200x faster LocalDate -const algo::UnTime algo::DateCache_LocalDate(algo::DateCache &dc, UnTime in) -``` - -```c++ -algo::UnTime algo::ToUnTime(WTime s) -``` - -```c++ -algo::UnTime algo::ParseUnTime(StringIter &s, const algo::strptr spec) -``` - -```c++ -algo::UnTime algo::ParseUnTime(const algo::strptr& s, const algo::strptr spec) -``` - -```c++ -// Change TZ environment variable to specified value -// and notify C runtime lib of the change -void algo::SetTz(strptr zone) -``` - -```c++ -// Initialize time hook TH as non-recurrent, with delay DELAY. -// Usage: -// ThInit(th, SchedTime()); // schedule at current time -// hook_Set0(th, myfunction); // set callback -// bh_timehook_Reheap(th); // insert into timehook heap -// ... eventually algo_lib::Step() will call the hook -void algo_lib::ThInit(algo_lib::FTimehook& th, algo::SchedTime delay) NOTHROW -``` - -```c++ -// Similar to the above, but recurrent. -void algo_lib::ThInitRecur(algo_lib::FTimehook& th, algo::SchedTime delay) NOTHROW -``` - -```c++ -// Allowing only for fixed length formats. -void algo::tstamp_cache_Init(TstampCache& cache, strptr spec, bool gmt) -``` - -```c++ -void algo::tstamp_cache_Print(algo::TstampCache& cache, UnTime t, cstring& out) -``` - -```c++ -// Add new cell to the given row. -algo_lib::FTxtcell &algo_lib::AddCell(algo_lib::FTxtrow &txtrow, algo::strptr title, algo_TextJustEnum justify, int span) -``` - -```c++ -algo_lib::FTxtcell &algo_lib::AddCell(algo_lib::FTxtrow &txtrow, algo::strptr title, algo_TextJustEnum justify) -``` - -```c++ -// Add new cell to the last row of of table and return references to its text -algo_lib::FTxtrow &algo_lib::AddRow(algo_lib::FTxttbl &txttbl) -``` - -```c++ -// Add column to the last row of table and return reference to it -algo_lib::FTxtcell &algo_lib::AddCellEx(algo_lib::FTxttbl &txttbl) -``` - -```c++ -// Text table. -// Text table is a table with rows; Each row has an array of cells. -// Each call has text, col span, text justification, and optional style (color). -// Add column to the last row of table. -void algo_lib::AddCol(algo_lib::FTxttbl &txttbl, algo::strptr col, algo_TextJustEnum justify) -``` - -```c++ -void algo_lib::AddCol(algo_lib::FTxttbl &txttbl, algo::strptr col) -``` - -```c++ -void algo_lib::AddCols(algo_lib::FTxttbl &txttbl, algo::strptr csv, algo_TextJustEnum justify) -``` - -```c++ -void algo_lib::AddCols(algo_lib::FTxttbl &txttbl, algo::strptr csv) -``` - -```c++ -algo::cstring &algo_lib::AddCell(algo_lib::FTxttbl &txttbl) -``` - -```c++ -// Use prlog(txttbl) to print. -void algo_lib::TxttblCsv(algo_lib::FTxttbl &tbl) -``` - -```c++ -bool algo::SaneTerminalQ() -``` - -```c++ -U128 U128::operator >>(u64 count) const -``` - -```c++ -U128 U128::operator <<(u64 count) const -``` - -```c++ -U128 U128::operator &(const U128 &rhs) const -``` - -```c++ -U128 U128::operator |(const U128 &rhs) const -``` - -```c++ -U128 U128::operator -(const U128 &val) const -``` - -```c++ -U128 U128::operator +(const U128 &val) const -``` - -```c++ -U128 U128::operator %(const U128 &val) const -``` - -```c++ -U128 U128::operator /(const U128 &val) const -``` - -```c++ -U128 U128::operator *(const U128 &rhs) const -``` - -```c++ -int fork() -``` - -```c++ -int alarm(int sec) -``` - -```c++ -// redirect to MS implementation -int pipe(int fd[2]) -``` - -```c++ -int kill(pid_t pid, int signal) -``` - -```c++ -// not too important -int fchmod(int fd, int mode) -``` - -```c++ -pid_t waitpid(pid_t pid, int *status, int options) -``` - -```c++ -void srandom(int val) -``` - -```c++ -int random() -``` - -```c++ -int mkdir(const char *path, int mode) -``` - -```c++ -int mkstemp(char *tmpl) -``` - -```c++ -int isatty(int fd) -``` - -```c++ -int flock(int fd, int flags) -``` - -```c++ -void usleep(int microsec) -``` - -```c++ -void sleep(int sec) -``` - -```c++ -int setenv(const char *name, const char *value, int overwrite) -``` - -```c++ -const char *strsignal(int sig) -``` - -```c++ -int WIFSIGNALED(int status) -``` - -```c++ -int WCOREDUMP(int status) -``` - -```c++ -int WIFEXITED(int status) -``` - -```c++ -int WEXITSTATUS(int status) -``` - -```c++ -int WTERMSIG(int status) -``` - -```c++ -int WIFSTOPPED(int status) -``` - -```c++ -int WSTOPSIG(int status) -``` - -```c++ -int getrlimit(RlimitEnum what, rlimit *r) -``` - -```c++ -int setrlimit(RlimitEnum what, const rlimit *r) -``` - -```c++ -// Create linux-type soft link -// Return 0 if success -int symlink(const char *target, const char *path) -``` - -```c++ -int link(const char *target, const char *path) -``` - -```c++ -void sigemptyset(u32 *mask) -``` - -```c++ -// no sigaciton on windows -int sigaction(int signal, struct sigaction *sa, void*) -``` - -```c++ -char *strerror_r(int code, char *buf, int bufsize) -``` - -```c++ -int getdomainname(char *buf, int bufsize) -``` - -```c++ -DIR *opendir(const char *path) -``` - -```c++ -void closedir(DIR *dir) -``` - -```c++ -int fnmatch(const char *pattern, const char *filename, int flags) -``` - -```c++ -// Windows doesn't support soft links. -// So implement lstat via stat -int lstat(const char *path, StatStruct *buf) -``` - -```c++ -int stat(const char *path, StatStruct *s) -``` - -```c++ -int fstat(int fd, StatStruct *s) -``` - -```c++ -void gettimeofday(struct timeval *tv, struct timezone *) -``` - -```c++ -int ftruncate(int fd, u64 size) -``` - -```c++ -// https://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Atomic-Builtins.html -void *sync_lock_test_and_set(void **addr, void *val) -``` - -```c++ -// https://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Atomic-Builtins.html -void *sync_val_compare_and_swap(void **addr, void *oldval, void *newval) -``` - -```c++ -// Close specified handle if it open -// Set value to NULL -void CloseHandleSafe(HANDLE &handle) -``` - -```c++ -int dospawn(char *path, char *cmdline, int timeout, strptr fstdin, strptr fstdout, strptr fstderr) -``` - -```c++ -int readlink(const char *path, char *out, int bufsize) -``` - -```c++ -int sysconf(int selector) -``` - -```c++ -void *mmap(void *base_addr, i64 size, MmapProt prot, MmapFlags mapflags, int fd, int flags2) -``` - -```c++ -int munmap(void *base_addr, i64 size) -``` - -```c++ -int pthread_create(pthread_t *thread, pthread_attr_t *attr, ThreadFunc func, void *arg) -``` - -```c++ -pthread_t pthread_self() -``` - -```c++ -template inline tempstr &algo::operator <<(const tempstr &lhs, const T &rhs) -``` - -```c++ -// Refurbish: destroy and re-create object in place. -// This function is exception-safe: if ~T throws an exception, T::T still gets -// called. -// Implementation note: explicit calls to destructor are checked for NULL pointer -// by GCC, so the nonnull attribute is required. -template inline void algo::Refurbish(T &t) F_NONNULL -``` - -```c++ -template inline int algo::elems_N(const aryptr &ary) -``` - -```c++ -template inline int algo::ch_N(const aryptr &ary) -``` - -```c++ -template inline void algo::Fill(const aryptr &lhs, const T &t) -``` - -```c++ -template inline algo::aryptr::aryptr() -``` - -```c++ -template inline T &algo::aryptr::operator [](u32 idx) const -``` - -```c++ -template inline int algo::Find(const algo::aryptr &lhs, const U&t) -``` - -```c++ -template inline algo::aryptr algo::FirstN(const algo::aryptr &lhs, u32 n) -``` - -```c++ -template inline algo::aryptr algo::LastN(const algo::aryptr &lhs, u32 n) -``` - -```c++ -template inline algo::aryptr algo::RestFrom(const algo::aryptr &lhs, u32 n) -``` - -```c++ -template inline algo::aryptr algo::qGetRegion(const algo::aryptr &lhs, u32 lo, u32 n) -``` - -```c++ -template inline algo::aryptr algo::GetRegion(const algo::aryptr &lhs, u32 lo, u32 n) -``` - -```c++ -template inline algo::aryptr algo::BytesOf(const T &t) -``` - -```c++ -template inline algo::aryptr::aryptr(const T *e, i32 in_n) : elems(const_cast(e)) , n_elems(in_n) -``` - -```c++ -template inline algo::aryptr::aryptr(const char *e) : elems(const_cast(e)) , n_elems(algo::ImpliedLength((T*)NULL,e)) -``` - -```c++ -template inline T &algo::qLast(const algo::aryptr &ary) -``` - -```c++ -// Taylor series expansion. For x around 0.01, this produces 2 digits per -// iteration, so with N=4 will be reasonably fast. -inline double algo::ExpTaylor(double x, int n) -``` - -```c++ -inline u32 algo::ParseNum8(u64 x, u32 &ok) -``` - -```c++ -inline u32 algo::ParseNum4(u32 x, u32 &ok) -``` - -```c++ -inline u32 algo::aParseNum8(strptr s, u32 &ok) -``` - -```c++ -inline u32 algo::aParseNum4(strptr s, u32 &ok) -``` - -```c++ -inline int algo::ParseOct1(u32 c, u8 &result) -``` - -```c++ -// C single hex character, upper or lowercase -// RETURN value of hex character -// RESULT value of hex digit -// RETURN success code -inline int algo::ParseHex1(u32 c, u8 &result) -``` - -```c++ -inline void algo::PageBufInit(PageBuf &F, u64 n, u64 align) -``` - -```c++ -inline u32 u8_Hash (u32 prev, u8 val) -``` - -```c++ -inline u32 u16_Hash(u32 prev, u16 val) -``` - -```c++ -inline u32 u32_Hash(u32 prev, u32 val) -``` - -```c++ -inline u32 u64_Hash(u32 prev, u64 val) -``` - -```c++ -inline u32 i8_Hash (u32 prev, i8 val) -``` - -```c++ -inline u32 i16_Hash(u32 prev, i16 val) -``` - -```c++ -inline u32 i32_Hash(u32 prev, i32 val) -``` - -```c++ -inline u32 i64_Hash(u32 prev, i64 val) -``` - -```c++ -inline u32 bool_Hash(u32 prev, bool val) -``` - -```c++ -inline u32 char_Hash(u32 prev, char val) -``` - -```c++ -inline u32 float_Hash(u32 prev, float val) -``` - -```c++ -inline u32 double_Hash(u32 prev, double val) -``` - -```c++ -inline u32 u128_Hash(u32 prev, u128 t) -``` - -```c++ -inline u32 algo::strptr_Hash(u32 prev, algo::strptr val) -``` - -```c++ -inline u32 algo::cstring_Hash(u32 prev, const algo::strptr &val) -``` - -```c++ -inline u32 algo::cstring_Hash(u32 prev, algo::cstring &val) -``` - -```c++ -inline u32 algo::cstring_Hash(u32 prev, const algo::cstring &val) -``` - -```c++ -inline i32 u8_Cmp (u8 a, u8 b) -``` - -```c++ -inline i32 u16_Cmp(u16 a, u16 b) -``` - -```c++ -inline i32 u32_Cmp(u32 a, u32 b) -``` - -```c++ -inline i32 u64_Cmp(u64 a, u64 b) -``` - -```c++ -inline i32 i8_Cmp (i8 a, i8 b) -``` - -```c++ -inline i32 i16_Cmp(i16 a, i16 b) -``` - -```c++ -inline i32 i32_Cmp(i32 a, i32 b) -``` - -```c++ -inline i32 i64_Cmp(i64 a, i64 b) -``` - -```c++ -inline i32 bool_Cmp(bool a, bool b) -``` - -```c++ -inline i32 char_Cmp(char a, char b) -``` - -```c++ -inline i32 float_Cmp(float a, float b) -``` - -```c++ -inline i32 double_Cmp(double a, double b) -``` - -```c++ -inline i32 u128_Cmp(u128 a, u128 b) -``` - -```c++ -inline bool u8_Lt (u8 a, u8 b) -``` - -```c++ -inline bool u16_Lt(u16 a, u16 b) -``` - -```c++ -inline bool u32_Lt(u32 a, u32 b) -``` - -```c++ -inline bool u64_Lt(u64 a, u64 b) -``` - -```c++ -inline bool i8_Lt (i8 a, i8 b) -``` - -```c++ -inline bool i16_Lt(i16 a, i16 b) -``` - -```c++ -inline bool i32_Lt(i32 a, i32 b) -``` - -```c++ -inline bool i64_Lt(i64 a, i64 b) -``` - -```c++ -inline bool bool_Lt(bool a, bool b) -``` - -```c++ -inline bool char_Lt(char a, char b) -``` - -```c++ -inline bool float_Lt(float a, float b) -``` - -```c++ -inline bool double_Lt(double a, double b) -``` - -```c++ -inline bool u128_Lt(u128 a, u128 b) -``` - -```c++ -inline bool u8_Eq (u8 a, u8 b) -``` - -```c++ -inline bool u16_Eq(u16 a, u16 b) -``` - -```c++ -inline bool u32_Eq(u32 a, u32 b) -``` - -```c++ -inline bool u64_Eq(u64 a, u64 b) -``` - -```c++ -inline bool i8_Eq (i8 a, i8 b) -``` - -```c++ -inline bool i16_Eq(i16 a, i16 b) -``` - -```c++ -inline bool i32_Eq(i32 a, i32 b) -``` - -```c++ -inline bool i64_Eq(i64 a, i64 b) -``` - -```c++ -inline bool bool_Eq(bool a, bool b) -``` - -```c++ -inline bool char_Eq(char a, char b) -``` - -```c++ -inline bool float_Eq(float a, float b) -``` - -```c++ -inline bool double_Eq(double a, double b) -``` - -```c++ -inline bool u128_Eq(u128 a, u128 b) -``` - -```c++ -// this is inefficient because it would be nice to be able to overrun strings. -// however, we don't check byte alignment at the beginning, -// so a 2-byte string that lies 4 bytes before the end of a page could fault. -inline u32 algo::CRC32Step(u32 old, const u8 *x, size_t len) -``` - -```c++ -inline u32 _mm_crc32_u64(u32 prev, u64 val) -``` - -```c++ -inline u32 _mm_crc32_u32(u32 prev, u32 val) -``` - -```c++ -inline u32 _mm_crc32_u16(u32 prev, u16 val) -``` - -```c++ -inline u32 _mm_crc32_u8 (u32 prev, u8 val) -``` - -```c++ -inline int algo::P1Mod(int a, int b) -``` - -```c++ -inline bool operator ==(const algo::strptr &a, const algo::strptr &b) -``` - -```c++ -inline bool operator !=(const algo::strptr &a, const algo::strptr &b) -``` - -```c++ -inline bool operator <(const algo::strptr &a, const algo::strptr &b) -``` - -```c++ -inline algo::UnixTime operator + (const algo::UnixTime &a, algo::UnixDiff d) -``` - -```c++ -inline algo::UnixTime operator - (const algo::UnixTime &a, algo::UnixDiff d) -``` - -```c++ -inline algo::UnixDiff operator - (const algo::UnixTime &a, algo::UnixTime b) -``` - -```c++ -inline algo::UnTime operator + (algo::UnTime a, algo::UnDiff d) -``` - -```c++ -inline algo::UnTime operator += (algo::UnTime &a, const algo::UnDiff d) -``` - -```c++ -inline algo::UnDiff operator += (algo::UnDiff &a, const algo::UnDiff d) -``` - -```c++ -inline algo::UnTime operator - (algo::UnTime a, algo::UnDiff d) -``` - -```c++ -inline algo::UnDiff operator - (algo::UnTime a, algo::UnTime b) -``` - -```c++ -inline algo::UnDiff operator - (const algo::UnDiff a) -``` - -```c++ -inline algo::UnixDiff operator * (const algo::UnixDiff &a, i64 d) -``` - -```c++ -inline algo::UnixDiff operator / (const algo::UnixDiff &a, i64 d) -``` - -```c++ -inline algo::UnixDiff operator + (const algo::UnixDiff &a, algo::UnixDiff d) -``` - -```c++ -inline algo::UnixDiff operator - (const algo::UnixDiff &a, algo::UnixDiff d) -``` - -```c++ -inline algo::UnDiff operator + (const algo::UnDiff &a, algo::UnDiff d) -``` - -```c++ -inline algo::UnDiff operator - (const algo::UnDiff &a, algo::UnDiff d) -``` - -```c++ -inline algo::UnDiff operator * (const algo::UnDiff &a, i64 d) -``` - -```c++ -inline algo::UnDiff operator / (const algo::UnDiff &a, i64 d) -``` - -```c++ -inline algo::WTime operator+(const algo::WTime &t, const algo::WDiff &t2) -``` - -```c++ -inline algo::WDiff operator+(const algo::WDiff &t, const algo::WDiff &t2) -``` - -```c++ -inline algo::WTime operator-(const algo::WTime &t, const algo::WDiff &t2) -``` - -```c++ -inline algo::WDiff operator-(const algo::WTime &t, const algo::WTime &t2) -``` - -```c++ -inline algo::WDiff operator-(const algo::WDiff &t, const algo::WDiff &t2) -``` - -```c++ -inline algo::SchedTime operator + (const algo::SchedTime &a, algo::SchedTime d) -``` - -```c++ -inline algo::SchedTime operator - (const algo::SchedTime &a, algo::SchedTime d) -``` - -```c++ -// move ctor -inline algo::tempstr::tempstr(const tempstr &rhs) : algo::cstring(rhs) -``` - -```c++ -inline u32 algo::u32_Count1s(u32 x) -``` - -```c++ -inline u32 algo::u8_Count1s(u8 x) -``` - -```c++ -inline u32 algo::u16_Count1s(u16 x) -``` - -```c++ -inline u32 algo::u64_Count1s(u64 x) -``` - -```c++ -inline u32 algo::u128_Count1s(u128 x) -``` - -```c++ -template inline void algo::ZeroBytes(T &t) -``` - -```c++ -template inline T algo::PtrAdd(U *ptr, int_ptr offset) -``` - -```c++ -template inline void algo::TSwap(T &a, T &b) -``` - -```c++ -// Default, and invalid, value for Fildes is -1. 0 is a valid value (stdin)! -inline bool algo::ValidQ(Fildes fd) -``` - -```c++ -inline int algo::i32_NegateIf(int x, bool i) -``` - -```c++ -inline i64 algo::i64_NegateIf(i64 x, bool i) -``` - -```c++ -inline float algo::float_NegateIf(float x, bool i) -``` - -```c++ -inline double algo::double_NegateIf(double x, bool i) -``` - -```c++ -inline double algo::DRound(double a) -``` - -```c++ -inline double algo::DCeiling(double a) -``` - -```c++ -inline double algo::DFloor(double a) -``` - -```c++ -inline double algo::DTrunc(double a) -``` - -```c++ -inline algo_FileFlagsEnum operator |(algo_FileFlagsEnum lhs, algo_FileFlagsEnum rhs) -``` - -```c++ -// Clipping to an open interval (exclisive upper limit) [0..hi-1] or [lo..hi-1] -inline int algo::Clipped(int a, int hi) -``` - -```c++ -inline int algo::Clipped(int a, int lo, int hi) -``` - -```c++ -// Clipping to a closed interval lo..hi -inline double algo::Clippedf(double a, double lo, double hi) -``` - -```c++ -// unsigned subtract with clipping -inline u64 algo::u64_SubClip( u64 a, u64 b) -``` - -```c++ -inline u32 algo::u32_SubClip( u32 a, u32 b) -``` - -```c++ -inline u16 algo::u16_SubClip( u16 a, u16 b) -``` - -```c++ -inline int algo::Abs(i8 a) -``` - -```c++ -inline int algo::Abs(i16 a) -``` - -```c++ -inline i32 algo::Abs(i32 a) -``` - -```c++ -inline i64 algo::Abs(i64 a) -``` - -```c++ -inline f32 algo::Abs(f32 a) -``` - -```c++ -inline f64 algo::Abs(f64 a) -``` - -```c++ -inline f80 algo::Abs(f80 a) -``` - -```c++ -// Read big-endian word -inline u16 algo::ReadBE16(const void *val) -``` - -```c++ -inline u32 algo::ReadBE32(const void *val) -``` - -```c++ -inline u64 algo::ReadBE64(const void *val) -``` - -```c++ -// Read little-endian word -inline u16 algo::ReadLE16(const void *val) +// Update FNAME to be a filename that can be passed to Unix exec call. +// If FNAME is an absolute path, don't perform a search +// If FNAME is a relative path, perform a search using the PATH environment +// the first executable file that's found is the result. +void algo_lib::ResolveExecFname(algo::cstring &fname) ``` ```c++ -inline u32 algo::ReadLE32(const void *val) +// Return TRUE if current user is root. +// #AL# is this more correct than checking that effective uid is 0? +bool algo_lib::RootQ() ``` ```c++ -inline u64 algo::ReadLE64(const void *val) +void algo_lib::RunCsvParse(algo_lib::CsvParse &csvparse) ``` ```c++ -// Forward: returns 0-based index of least significant bit that is set -// Reverse: returns 0-based index of most significant bit that is set. -// input argument must not be zero. -// input result in 0 is undefined (see Intel manual) -// http://www.intel.com/content/dam/doc/manual/64-ia-32-architectures-software-developer-vol-2a-2b-instruction-set-a-z-manual.pdf -inline u32 algo::u32_BitScanForward(u32 v) +// Return computed name for sandbox SANDBOX +tempstr algo_lib::SandboxDir(algo::strptr sandbox) ``` ```c++ -inline u64 algo::u64_BitScanForward(u64 v) +// Set value of key KEY value VALUE +// KEY string to replace +// VALUE value to replace it with +// SUBST If set, $-expand the VALUE parameter +// NOTES +// With 'strict' Replscope, avoid expressions like this: +// Set(R, "$var", field.comment); +// This will trigger an error when field.comment contains a $ sign and the substitution fails. +// Use +// Set(R, "$var", field.comment, false); +// +void algo_lib::Set(algo_lib::Replscope &scope, strptr from, strptr to, bool subst = true) ``` ```c++ -inline u32 algo::u32_BitScanReverse(u32 v) +void algo_lib::ShowTrace() ``` ```c++ -inline u64 algo::u64_BitScanReverse(u64 v) +// Perform $-substitutions in TEXT and return new value. +tempstr algo_lib::Subst(algo_lib::Replscope &scope, strptr text) ``` ```c++ -inline u32 algo::u16_BitScanForward(u16 v) +// Create temporary file +// tempfile.fildes points to the new temp file after this +// temp file is created under _db.tempdir +// prefix is a namespace-unique name, such as "amc.xyz" +// Actual file that's created becomes "temp/amc/xyz.XXXXXX" +// Computed filename is saved to tempfile.filename +void algo_lib::TempfileInitX(algo_lib::FTempfile &tempfile, strptr prefix) ``` ```c++ -inline u32 algo::u16_BitScanReverse(u16 v) +// Initialize a recurrent time hook TH to execute on the next scheduling cycle, +// and after that, every DELAY clocks +// NOTE: 'delay' field of a recurrent timehook is used when automatically rescheduling it. +void algo_lib::ThInitRecur(algo_lib::FTimehook& th, algo::SchedTime delay) NOTHROW ``` ```c++ -inline u32 algo::u8_BitScanForward(u8 v) +// Initialize a non-recurrent time hook TH to execute after DELAY clock cycles with +// respect to current time +// NOTE: 'delay' field of non-recurrent timehook is ignored +// NOTE: this function updates scheduling clock to the most current value +void algo_lib::ThScheduleIn(algo_lib::FTimehook& th, algo::SchedTime delay) NOTHROW ``` ```c++ -inline u32 algo::u8_BitScanReverse(u8 v) +// Schedule a time hook TH to execute on the next scheduling cycle, +// and after that, every DELAY clocks +void algo_lib::ThScheduleRecur(algo_lib::FTimehook& th, algo::SchedTime delay) NOTHROW ``` ```c++ -inline u32 algo::CeilingLog2(u32 orig) +algo::tempstr algo_lib::ToDbgString(algo_lib::Bitset &bitset) ``` ```c++ -inline u64 algo::CeilingLog2(u64 orig) +algo::tempstr algo_lib::ToDbgString(algo_lib::Regx ®x) ``` ```c++ -inline u32 algo::FloorLog2(u32 i) +algo::tempstr algo_lib::ToDbgString(algo_lib::RegxState &state, int index) ``` ```c++ -inline u64 algo::FloorLog2(u64 i) +tempstr algo_lib::ToDbgString(algo_lib::RegxExpr *expr) ``` ```c++ -inline u32 algo::BumpToPow2(u32 i) +tempstr algo_lib::ToDbgString(algo_lib::RegxParse ®xparse) ``` ```c++ -inline u64 algo::BumpToPow2(u64 i) +// If PATH is an existing path, leave it unchanged +// On Windows, If PATH.EXE is an existing path, return that +// Return true if file exists +bool algo_lib::TryExeSuffix(algo::cstring &path) ``` ```c++ -inline u64 algo::u64_CeilPow2(u64 a, u64 b) +// read TEXT into a tuple. +// perform variable substitution on key-value pairs. +// write tuple back. +// return resulting string +tempstr algo_lib::Tuple_Subst(algo_lib::Replscope &R, strptr text) ``` ```c++ -inline u32 algo::u32_CeilPow2(u32 a, u32 b) +void algo_lib::UpdateRate(algo::I64Rate &rate, i64 val) ``` ```c++ -inline u64 algo::u64_ModPow2(u64 a, u64 b) +int WCOREDUMP(int status) ``` ```c++ -inline u32 algo::u32_ModPow2(u32 a, u32 b) +int WEXITSTATUS(int status) ``` ```c++ -inline bool algo::u64_Pow2Q(u64 i) +int WIFEXITED(int status) ``` ```c++ -inline bool algo::u32_Pow2Q(u32 i) +int WIFSIGNALED(int status) ``` ```c++ -inline algo::PageBuf::~PageBuf() +int WIFSTOPPED(int status) ``` ```c++ -// get CPU HZ value as u64 -inline u64 algo::get_cpu_hz_int() +int WSTOPSIG(int status) ``` ```c++ -// get CPU HZ value as double -inline double algo::get_cpu_hz() +int WTERMSIG(int status) ``` ```c++ -// cpu_hz (untyped SchedTime) -// use this for timestamps. -// these calls may be pipelined and reordered, so measuring instruction -// latency with these is not possible. for that, use rdtscp -inline u64 algo::get_cycles() +// Write pid to lockfile, separate function to update pid after fork(). +// Sets error text in case of error, and return false. +bool algo_lib::WritePid(algo_lib::FLockfile &lockfile) ``` ```c++ -// Convert scheduler time units to seconds. -inline double algo::ToSecs(SchedTime ticks) +template inline T &algo::aryptr::operator [](u32 idx) const ``` ```c++ -inline algo::UnDiff algo::ToUnDiff(SchedTime ticks) +void algo_lib::_db_Userinit() ``` ```c++ -inline algo::SchedTime algo::ToSchedTime(double secs) +inline u32 _mm_crc32_u16(u32 prev, u16 val) ``` ```c++ -inline algo::UnTime algo::ToUnTime(UnixTime t) +inline u32 _mm_crc32_u32(u32 prev, u32 val) ``` ```c++ -inline algo::UnixTime algo::ToUnixTime(UnTime t) +inline u32 _mm_crc32_u64(u32 prev, u64 val) ``` ```c++ -inline double algo::ToSecs(UnDiff t) +int alarm(int sec) ``` ```c++ -inline double algo::ToSecs(UnTime t) +template inline algo::aryptr::aryptr() ``` ```c++ -inline algo::UnixTime algo::CurrUnixTime() +template inline algo::aryptr::aryptr(const T *e, i32 in_n) : elems(const_cast(e)) , n_elems(in_n) ``` ```c++ -// use this for performance measurements. -// according to Intel software manual, lfence followed by rdtsc -// is the beez knees. -inline u64 algo::rdtscp() +inline u16 be16toh(u16 val) ``` ```c++ -inline algo::UnixDiff algo::UnixDiffHMS(i64 h, int m, int s) +inline u32 be32toh(u32 val) ``` ```c++ -inline algo::UnDiff algo::UnDiffSecs(double d) +inline u64 be64toh(u64 val) ``` ```c++ -inline algo::UnDiff algo::UnDiffMsecs(const i64 i) +void algo_lib::bh_timehook_Step() ``` ```c++ -inline algo::UnDiff algo::UnDiffUsecs(const double d) +void bool_Print(bool row, algo::cstring &str) ``` ```c++ -inline algo::UnTime algo::UnTimeSecs(double d) +bool bool_ReadStrptrMaybe(bool &row, algo::strptr str) ``` ```c++ -inline algo::UnDiff algo::UnDiffSecs(i64 i) +void char_Print(char c, algo::cstring &str) ``` ```c++ -inline algo::UnDiff algo::UnDiffSecs(i32 i) +bool char_ReadStrptrMaybe(char &row, algo::strptr str) ``` ```c++ -inline algo::UnDiff algo::UnDiffHMS(int h, int m, int s) +void closedir(DIR *dir) ``` ```c++ -// Current value of get_cycles(); -inline algo::SchedTime algo::CurrSchedTime() +// Check signature on incoming data +bool algo_lib::dispsigcheck_InputMaybe(dmmeta::Dispsigcheck &dispsigcheck) ``` ```c++ -// Elapsed time in seconds between two SchedTimes. -inline double algo::ElapsedSecs(algo::SchedTime start, algo::SchedTime end) +int dospawn(char *path, char *cmdline, int timeout, strptr fstdin, strptr fstdout, strptr fstderr) ``` ```c++ -inline algo::TimeStruct::TimeStruct() +void double_Print(double d, algo::cstring &str) ``` ```c++ -inline algo::TimeStruct::TimeStruct(const struct tm &t) : tm(t) +bool double_ReadStrptrMaybe(double &row, algo::strptr str) ``` ```c++ -inline algo::WDiff algo::ToWDiff(algo::UnixDiff d) +// Enable comma-eating (default true) +void algo_lib::eatcomma_Set(algo_lib::Replscope &scope, bool enable) ``` ```c++ -inline algo::WDiff algo::ToWDiff(algo::UnDiff d) +// Global initializer, called from algo_lib::FDb_Init +void algo_lib::errns_Userinit() ``` ```c++ -inline algo::UnixDiff algo::ToUnixDiff(algo::WDiff d) +// not too important +int fchmod(int fd, int mode) ``` ```c++ -inline algo::WTime algo::ToWTime(algo::UnTime s) +void algo_lib::fd_Cleanup(algo_lib::FFildes &fildes) ``` ```c++ -inline algo::UnDiff algo::ToUnDiff(algo::WDiff d) +void algo_lib::fildes_Cleanup(algo_lib::FIohook &iohook) ``` ```c++ -inline algo::UnixTime algo::ToUnixTime(algo::WTime nt) +// User-defined cleanup trigger fildes field of ctype:algo_lib.FLockfile +void algo_lib::fildes_Cleanup(algo_lib::FLockfile &lockfile) ``` ```c++ -inline algo::WTime algo::ToWTime(algo::UnixTime t) +void algo_lib::fildes_Cleanup(algo_lib::FTempfile &tempfile) ``` ```c++ -inline double algo::ToSecs(algo::WDiff t) +// if OWN_FD is cleared, clean up file descriptor before it is closed +void algo_lib::file_Cleanup(algo_lib::InTextFile &file) ``` ```c++ -// Append and end-of-line sequence to string S. -inline void algo::eol(cstring &s) +void float_Print(float d, algo::cstring &str) ``` ```c++ -inline algo::strptr algo::ToStrPtr(memptr buf) +bool float_ReadStrptrMaybe(float &row, algo::strptr str) ``` ```c++ -// Note: cstring << algo::ToLower(int) will output an *integer*, not a character -inline int algo::ToLower(int i) +int flock(int fd, int flags) ``` ```c++ -// Note: cstring << algo::ToUpper(int) will output an *integer*, not a character -inline int algo::ToUpper(int i) +int fnmatch(const char *pattern, const char *filename, int flags) ``` ```c++ -inline char algo::ToLower(char i) +int fork() ``` ```c++ -inline char algo::ToUpper(char i) +int fstat(int fd, StatStruct *s) ``` ```c++ -inline bool algo::StringIter::EofQ() const +int ftruncate(int fd, u64 size) ``` ```c++ -inline char algo::StringIter::Peek() +int getdomainname(char *buf, int bufsize) ``` ```c++ -inline char algo::StringIter::GetChar() +int getrlimit(RlimitEnum what, rlimit *r) ``` ```c++ -inline algo::StringIter &algo::StringIter::Ws() +void gettimeofday(struct timeval *tv, struct timezone *) ``` ```c++ -inline algo::i32_Range algo::TFind(const strptr &s, char match) +// give up unused time to the OS. +// Compute number of clocks to sleep before next scheduling cycle +// If there was no sleep on the previous cycle, the sleep is zero. +// This last bit is important because it prevents deadlocks +// when one step implicitly creates work for another step +// that occurs before it in the main loop. +// Sleep will not extend beyond algo_lib::_db.limit +void algo_lib::giveup_time_Step() ``` ```c++ -inline algo::i32_Range algo::TRevFind(const strptr &s, char match) +inline u16 htobe16(u16 val) ``` ```c++ -inline algo::aryptr algo::ch_FirstN(const strptr &lhs, u32 n) +inline u32 htobe32(u32 val) ``` ```c++ -inline algo::aryptr algo::ch_LastN(const strptr &lhs, u32 n) +inline u64 htobe64(u64 val) ``` ```c++ -inline algo::aryptr algo::ch_RestFrom(const strptr &lhs, u32 n) +inline u16 htole16(u16 val) ``` ```c++ -inline algo::aryptr algo::ch_GetRegion(const strptr &lhs, u32 lo, u32 n) +inline u32 htole32(u32 val) ``` ```c++ -inline int algo::ImpliedLength(char *, const char *c) +inline u64 htole64(u64 val) ``` ```c++ -inline int algo::ImpliedLength(const char *, const char *c) +void i8_Print(i8 i, algo::cstring &str) ``` ```c++ -inline int algo::ch_N(const strptr &s) +void i16_Print(i16 i, algo::cstring &str) ``` ```c++ -inline int algo::ch_First(const strptr &s, int dflt = 0) +void i32_Print(i32 i, algo::cstring &str) ``` ```c++ -inline int algo::ch_Last(const strptr &s, int dflt = 0) +void i64_Print(i64 i, algo::cstring &str) ``` ```c++ -inline int algo::ch_N(const tempstr &str) +int isatty(int fd) ``` ```c++ -inline int algo::range_N(const i32_Range &rhs) +int kill(pid_t pid, int signal) ``` ```c++ -inline algo::aryptr algo::strptr_ToMemptr(algo::aryptr rhs) +int link(const char *target, const char *path) ``` ```c++ -inline algo::aryptr algo::memptr_ToStrptr(algo::aryptr rhs) +// Windows doesn't support soft links. +// So implement lstat via stat +int lstat(const char *path, StatStruct *buf) ``` ```c++ -// if next character matches WHAT, skip and return true -// otherwise return false -inline bool algo::SkipChar(StringIter &iter, char what) +// User-defined cleanup function for MMAP.MEM +void algo_lib::mem_Cleanup(algo_lib::Mmap &mmap) ``` ```c++ -// Convert string to numeric type. -// If there is an error, or string is empty, return DFLT. -// If there is junk at the end of the string, silently ignore it. -// Use StringIter version to check for junk, or use -X version to throw exception. -inline int algo::ParseI32(strptr str, int dflt) +int mkdir(const char *path, int mode) ``` ```c++ -inline u32 algo::ParseU32(strptr str, u32 dflt) +int mkstemp(char *tmpl) ``` ```c++ -inline i64 algo::ParseI64(strptr str, i64 dflt) +int munmap(void *base_addr, i64 size) ``` ```c++ -inline u64 algo::ParseU64(strptr str, u64 dflt) +inline algo::WDiff operator+(const algo::WDiff &t, const algo::WDiff &t2) ``` ```c++ -inline strptr algo::StringIter::Rest() +inline algo::WTime operator+(const algo::WTime &t, const algo::WDiff &t2) ``` ```c++ -inline algo::Attr_curs &algo::Attr_curs_Access(Attr_curs &curs) +inline algo::WDiff operator-(const algo::WDiff &t, const algo::WDiff &t2) ``` ```c++ -inline bool algo::Attr_curs_ValidQ(Attr_curs &curs) +inline algo::WDiff operator-(const algo::WTime &t, const algo::WTime &t2) ``` ```c++ -inline bool algo::Line_curs_ValidQ(Line_curs &curs) +inline algo::WTime operator-(const algo::WTime &t, const algo::WDiff &t2) ``` ```c++ -inline strptr &algo::Line_curs_Access(Line_curs &curs) +// redirect to MS implementation +int pipe(int fd[2]) ``` ```c++ -inline bool algo::Word_curs_ValidQ(Word_curs &curs) +int pthread_create(pthread_t *thread, pthread_attr_t *attr, ThreadFunc func, void *arg) ``` ```c++ -inline strptr &algo::Word_curs_Access(Word_curs &curs) +pthread_t pthread_self() ``` ```c++ -template inline void algo::Init_Set(StringDesc &desc, void(*fcn)(T&)) +int random() ``` ```c++ -template inline void algo::SetnumMaybe_Set(StringDesc &desc, bool(*fcn)(T&, i64 num)) +int readlink(const char *path, char *out, int bufsize) ``` ```c++ -template inline void algo::Geti64_Set(StringDesc &desc, i64(*fcn)(T&, bool &)) +int setenv(const char *name, const char *value, int overwrite) ``` ```c++ -template inline void algo::Getary_Set(StringDesc &desc, algo::aryptr(*fcn)(T&)) +int setrlimit(RlimitEnum what, const rlimit *r) ``` ```c++ -inline strptr &algo::FileLine_curs_Access(algo::FileLine_curs &curs) +// no sigaciton on windows +int sigaction(int signal, struct sigaction *sa, void*) ``` ```c++ -inline bool algo::FileLine_curs_ValidQ(algo::FileLine_curs &curs) +void sigemptyset(u32 *mask) ``` ```c++ -inline algo::ListSep::ListSep(strptr sep_) : sep(sep_), iter(0) +void sleep(int sec) ``` ```c++ -inline algo::Line_curs::Line_curs() : eof(true),i(-1) +void srandom(int val) ``` ```c++ -inline algo::Word_curs::Word_curs() : index(0) +// retrieve random double in 0..1 range +double algo_lib::srng_GetDouble(algo_lib::Srng &srng) ``` ```c++ -inline bool algo::Sep_curs_ValidQ(algo::Sep_curs &curs) +// retrieve random u32 +u32 algo_lib::srng_GetU32(algo_lib::Srng &srng) ``` ```c++ -inline strptr &algo::Sep_curs_Access(algo::Sep_curs &curs) +// This is a low-quality random number generator suitable for simple tasks... +// Set seed for srng state +void algo_lib::srng_SetSeed(algo_lib::Srng &srng, int z, int w) ``` ```c++ -inline algo::Sep_curs::Sep_curs() : sep('\0'), index(-1), state(algo::Sep_curs::State::invalid) +int stat(const char *path, StatStruct *s) ``` ```c++ -inline u32 algo::u16_FmtBuf(u32 value, u8 *buf) +// Create linux-type soft link +// Return 0 if success +int symlink(const char *target, const char *path) ``` ```c++ -inline algo::cstring &algo::operator<<(algo::cstring &out, const char* t) +int sysconf(int selector) ``` ```c++ -inline algo::cstring &algo::operator<<(algo::cstring &out, const ListSep &t) +void u8_Print(u8 i, algo::cstring &str) ``` ```c++ -inline algo::cstring &algo::operator<<(algo::cstring &out, const strptr &t) +void u16_Print(u16 i, algo::cstring &str) ``` ```c++ -inline algo::cstring &algo::operator<<(algo::cstring &out, void (*t)(algo::cstring &)) +void u32_Print(u32 i, algo::cstring &str) ``` ```c++ -// SameSign returns false if one of the arguments is zero. -template inline bool algo::SameSignQ(T a, T b) +void u64_Print(u64 i, algo::cstring &str) ``` ```c++ -// Compare two strings for equality, case-sensitively -inline bool algo::strptr_Eq(algo::strptr a, algo::strptr b) +void u128_Print(u128 num, algo::cstring &out) ``` ```c++ -// Test if string A is lexicographically less than string B. -inline bool algo::strptr_Lt(algo::strptr a, algo::strptr b) +void usleep(int microsec) ``` ```c++ -// reverse bit order in a byte -inline u8 algo::u8_ReverseBits(u8 b) +pid_t waitpid(pid_t pid, int *status, int options) ``` ```c++ -// Return unix-epoch time with nanosecond resolution -// On Linux, this function calls clock_gettime() which takes about -// 30ns and uses rdtsc() to increase underlying clock resolution -inline algo::UnTime algo::CurrUnTime() +U128 U128::operator |(const U128 &rhs) const ``` ```c++ -inline i32 algo::strptr_Cmp(algo::strptr a, algo::strptr b) +inline algo_FileFlagsEnum operator |(algo_FileFlagsEnum lhs, algo_FileFlagsEnum rhs) ``` @@ -3811,6 +1171,8 @@ The following source files are part of this tool: |[cpp/lib/algo/arg.cpp](/cpp/lib/algo/arg.cpp)|Parse command-line| |[cpp/lib/algo/backtrace.cpp](/cpp/lib/algo/backtrace.cpp)|Print stack trace in case of crash| |[cpp/lib/algo/base64.cpp](/cpp/lib/algo/base64.cpp)|base64 encoding| +|[cpp/lib/algo/bin_decode.cpp](/cpp/lib/algo/bin_decode.cpp)|| +|[cpp/lib/algo/bin_encode.cpp](/cpp/lib/algo/bin_encode.cpp)|| |[cpp/lib/algo/cpu_hz.cpp](/cpp/lib/algo/cpu_hz.cpp)|Grab cpu_hz from OS| |[cpp/lib/algo/crc32.cpp](/cpp/lib/algo/crc32.cpp)|Software-based CRC32| |[cpp/lib/algo/decimal.cpp](/cpp/lib/algo/decimal.cpp)|| @@ -3824,12 +1186,15 @@ The following source files are part of this tool: |[cpp/lib/algo/mmap.cpp](/cpp/lib/algo/mmap.cpp)|Mmap wrapper| |[cpp/lib/algo/prlog.cpp](/cpp/lib/algo/prlog.cpp)|prlog macro| |[cpp/lib/algo/regx.cpp](/cpp/lib/algo/regx.cpp)|Sql Regx implementation| +|[cpp/lib/algo/replscope.cpp](/cpp/lib/algo/replscope.cpp)|| |[cpp/lib/algo/string.cpp](/cpp/lib/algo/string.cpp)|cstring functions| |[cpp/lib/algo/time.cpp](/cpp/lib/algo/time.cpp)|UnTime / UnDiff functions| |[cpp/lib/algo/timehook.cpp](/cpp/lib/algo/timehook.cpp)|| |[cpp/lib/algo/tstamp.cpp](/cpp/lib/algo/tstamp.cpp)|timestamp cache| |[cpp/lib/algo/txttbl.cpp](/cpp/lib/algo/txttbl.cpp)|Ascii table| |[cpp/lib/algo/u128.cpp](/cpp/lib/algo/u128.cpp)|| +|[cpp/lib/algo/url.cpp](/cpp/lib/algo/url.cpp)|| +|[cpp/lib/algo/uuid.cpp](/cpp/lib/algo/uuid.cpp)|| |[cpp/lib/algo/win32.cpp](/cpp/lib/algo/win32.cpp)|| |[include/algo.h](/include/algo.h)|Main header| |[include/algo.inl.h](/include/algo.inl.h)|Inline functions| @@ -3844,10 +1209,6 @@ The following source files are part of this tool: |[include/gen/command_gen.inl.h](/include/gen/command_gen.inl.h)|| |[include/gen/dev_gen.h](/include/gen/dev_gen.h)|| |[include/gen/dev_gen.inl.h](/include/gen/dev_gen.inl.h)|| -|[include/gen/dmmeta_gen.h](/include/gen/dmmeta_gen.h)|| -|[include/gen/dmmeta_gen.inl.h](/include/gen/dmmeta_gen.inl.h)|| -|[include/gen/ietf_gen.h](/include/gen/ietf_gen.h)|| -|[include/gen/ietf_gen.inl.h](/include/gen/ietf_gen.inl.h)|| |[include/gen/report_gen.h](/include/gen/report_gen.h)|| |[include/gen/report_gen.inl.h](/include/gen/report_gen.inl.h)|| |[include/sha.h](/include/sha.h)|| @@ -3858,6 +1219,16 @@ The following source files are part of this tool: +### Dependencies + + +The build target depends on the following libraries +|Target|Comment| +|---|---| +|[lib_json](/txt/lib/lib_json/README.md)|Full json support library| + + + ### In Memory DB @@ -3869,12 +1240,18 @@ All allocations are done through global `algo_lib::_db` [algo_lib.FDb](#algo_lib |[algo_lib.Cmdline](#algo_lib-cmdline)|| |[algo_lib.CsvParse](#algo_lib-csvparse)||FDb.csvparse (Cppstack)| |[algo_lib.ErrorX](#algo_lib-errorx)||FDb.error (Cppstack)| +|[algo_lib.RegxM](#algo_lib-regxm)|| |[algo_lib.FFildes](#algo_lib-ffildes)||FDb.fildes (Cppstack)| |[algo_lib.FLockfile](#algo_lib-flockfile)|| |[algo_lib.FTimehook](#algo_lib-ftimehook)||FDb.timehook (Cppstack)|bh_timehook (Bheap, sort field time)|c_timehook (Ptr)| ||||FTimehook.hook (Hook)| |[algo_lib.FImdb](#algo_lib-fimdb)||FDb.imdb (Inlary)|ind_imdb (Thash, hash field imdb)| +|[algo_lib.RegxFlags](#algo_lib-regxflags)|| +|[algo_lib.RegxStyle](#algo_lib-regxstyle)|| +|[algo_lib.Regx](#algo_lib-regx)||FDb.regx (Cppstack)| +||||RegxParse.p_regx (Upptr)| |[algo_lib.FLogcat](#algo_lib-flogcat)|[dmmeta.logcat](/txt/ssimdb/dmmeta/logcat.md)|FDb.logcat (Inlary)|**static**|ind_logcat (Thash, hash field logcat)| +|[algo_lib.FErrns](#algo_lib-ferrns)||FDb.errns (Inlary)| |[algo_lib.FDb](#algo_lib-fdb)||FDb._db (Global)| |[algo_lib.FDispsigcheck](#algo_lib-fdispsigcheck)|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|FDb.dispsigcheck (Lary)|dispsigcheck (Lary, by rowid)|ind_dispsigcheck (Thash, hash field dispsig)| |[algo_lib.FImtable](#algo_lib-fimtable)||FDb.imtable (Lary)|imtable (Lary, by rowid)|ind_imtable (Thash, hash field imtable)| @@ -3893,10 +1270,9 @@ All allocations are done through global `algo_lib::_db` [algo_lib.FDb](#algo_lib |[algo_lib.InTextFile](#algo_lib-intextfile)|| |[algo_lib.Mmap](#algo_lib-mmap)|| |[algo_lib.MmapFile](#algo_lib-mmapfile)|| -|[algo_lib.Regx](#algo_lib-regx)||FDb.regx (Cppstack)| -||||RegxParse.p_regx (Upptr)| |[algo_lib.RegxToken](#algo_lib-regxtoken)|| |[algo_lib.RegxExpr](#algo_lib-regxexpr)||RegxParse.ary_expr (Tary)| +|[algo_lib.RegxOp](#algo_lib-regxop)|| |[algo_lib.RegxParse](#algo_lib-regxparse)||FDb.regxparse (Cppstack)| |[algo_lib.RegxState](#algo_lib-regxstate)||Regx.state (Tary)| |[algo_lib.Replscope](#algo_lib-replscope)||FDb.replscope (Cppstack)| @@ -4032,6 +1408,32 @@ struct ErrorX { // algo_lib.ErrorX }; ``` +#### algo_lib.RegxM - Matching context for regex + + +#### algo_lib.RegxM Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|algo_lib.RegxM.front|[algo_lib.Bitset](/txt/lib/algo_lib/README.md#algo_lib-bitset)|[Val](/txt/exe/amc/reftypes.md#val)||Temporary front (for matching)| +|algo_lib.RegxM.this_char|[algo_lib.Bitset](/txt/lib/algo_lib/README.md#algo_lib-bitset)|[Val](/txt/exe/amc/reftypes.md#val)||States to test on this char| +|algo_lib.RegxM.next_char|[algo_lib.Bitset](/txt/lib/algo_lib/README.md#algo_lib-bitset)|[Val](/txt/exe/amc/reftypes.md#val)||States to test on next char| +|algo_lib.RegxM.matchrange|[algo.I32RangeAry](/txt/protocol/algo/README.md#algo-i32rangeary)|[Val](/txt/exe/amc/reftypes.md#val)||List of match char ranges| + +#### Struct RegxM + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) +``` +struct RegxM { // algo_lib.RegxM: Matching context for regex + algo_lib::Bitset front; // Temporary front (for matching) + algo_lib::Bitset this_char; // States to test on this char + algo_lib::Bitset next_char; // States to test on next char + algo::I32RangeAry matchrange; // List of match char ranges + // func:algo_lib.RegxM..Ctor + inline RegxM() __attribute__((nothrow)); +}; +``` + #### algo_lib.FFildes - Wrapper for unix file descritor, call close() on Uninit @@ -4145,6 +1547,7 @@ struct FImdb { // algo_lib.FImdb algo::ImdbGetTraceFcn GetTrace; // 0 algo::Comment comment; // algo_lib::FImdb* ind_imdb_next; // hash next + u32 ind_imdb_hashval; // hash value // func:algo_lib.FImdb..AssignOp inline algo_lib::FImdb& operator =(const algo_lib::FImdb &rhs) = delete; // func:algo_lib.FImdb..Ctor @@ -4156,6 +1559,97 @@ struct FImdb { // algo_lib.FImdb }; ``` +#### algo_lib.RegxFlags - + + +#### algo_lib.RegxFlags Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|algo_lib.RegxFlags.value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| +|algo_lib.RegxFlags.trace|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||Enable tracing| +|algo_lib.RegxFlags.capture|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||Enable capture groups| +|algo_lib.RegxFlags.valid|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||The regx parsed successfully| +|algo_lib.RegxFlags.literal|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||The regx expression is a literal string| +|algo_lib.RegxFlags.accepts_all|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||Compiled regx accepts all intputs| +|algo_lib.RegxFlags.fullmatch|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||Regx expression is a substring| + +#### Struct RegxFlags + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) +``` +#pragma pack(push,1) +struct RegxFlags { // algo_lib.RegxFlags + u8 value; // 0 + // func:algo_lib.RegxFlags..Ctor + inline RegxFlags() __attribute__((nothrow)); + // func:algo_lib.RegxFlags..FieldwiseCtor + explicit inline RegxFlags(u8 in_value) __attribute__((nothrow)); + // func:algo_lib.RegxFlags..EnumCtor + inline RegxFlags(algo_lib_RegxFlagsEnum arg) __attribute__((nothrow)); +}; +``` + +#### algo_lib.RegxStyle - Regex encoding style (Acr, Sql, Classic, Shell etc) + + +#### algo_lib.RegxStyle Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|algo_lib.RegxStyle.value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct RegxStyle + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) +``` +struct RegxStyle { // algo_lib.RegxStyle: Regex encoding style (Acr, Sql, Classic, Shell etc) + u8 value; // 0 + // func:algo_lib.RegxStyle.value.Cast + inline operator algo_lib_RegxStyleEnum() const __attribute__((nothrow)); + // func:algo_lib.RegxStyle..Ctor + inline RegxStyle() __attribute__((nothrow)); + // func:algo_lib.RegxStyle..FieldwiseCtor + explicit inline RegxStyle(u8 in_value) __attribute__((nothrow)); + // func:algo_lib.RegxStyle..EnumCtor + inline RegxStyle(algo_lib_RegxStyleEnum arg) __attribute__((nothrow)); +}; +``` + +#### algo_lib.Regx - Parsed regular expression + + +#### algo_lib.Regx Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|algo_lib.Regx.expr|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Original string expression| +|algo_lib.Regx.state|[algo_lib.RegxState](/txt/lib/algo_lib/README.md#algo_lib-regxstate)|[Tary](/txt/exe/amc/reftypes.md#tary)||Array of states| +|algo_lib.Regx.flags|[algo_lib.RegxFlags](/txt/lib/algo_lib/README.md#algo_lib-regxflags)|[Val](/txt/exe/amc/reftypes.md#val)||| +|algo_lib.Regx.style|[algo_lib.RegxStyle](/txt/lib/algo_lib/README.md#algo_lib-regxstyle)|[Val](/txt/exe/amc/reftypes.md#val)||Regx style according to which EXPR was parsed| + +#### Struct Regx + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) +``` +struct Regx { // algo_lib.Regx: Parsed regular expression + algo::cstring expr; // Original string expression + algo_lib::RegxState* state_elems; // pointer to elements + u32 state_n; // number of elements in array + u32 state_max; // max. capacity of array before realloc + algo_lib::RegxFlags flags; // + algo_lib::RegxStyle style; // Regx style according to which EXPR was parsed + // func:algo_lib.Regx..AssignOp + algo_lib::Regx& operator =(const algo_lib::Regx &rhs) __attribute__((nothrow)); + // func:algo_lib.Regx..Ctor + inline Regx() __attribute__((nothrow)); + // func:algo_lib.Regx..Dtor + inline ~Regx() __attribute__((nothrow)); + // func:algo_lib.Regx..CopyCtor + Regx(const algo_lib::Regx &rhs) __attribute__((nothrow)); +}; +``` + #### algo_lib.FLogcat - Log category @@ -4164,6 +1658,10 @@ struct FImdb { // algo_lib.FImdb |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| |algo_lib.FLogcat.base|[dmmeta.Logcat](/txt/ssimdb/dmmeta/logcat.md)|[Base](/txt/ssimdb/dmmeta/logcat.md)||| +|algo_lib.FLogcat.filter|[algo_lib.Regx](/txt/lib/algo_lib/README.md#algo_lib-regx)|[Val](/txt/exe/amc/reftypes.md#val)||Output filter| +|algo_lib.FLogcat.negfilter|[algo_lib.Regx](/txt/lib/algo_lib/README.md#algo_lib-regx)|[Val](/txt/exe/amc/reftypes.md#val)||Negative output filter| +|algo_lib.FLogcat.nmsg|i64|[Val](/txt/exe/amc/reftypes.md#val)||Number of messages printed inside current window| +|algo_lib.FLogcat.th_throttle|[algo_lib.FTimehook](/txt/lib/algo_lib/README.md#algo_lib-ftimehook)|[Val](/txt/exe/amc/reftypes.md#val)||| #### Struct FLogcat @@ -4172,19 +1670,54 @@ struct FImdb { // algo_lib.FImdb Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) ``` struct FLogcat { // algo_lib.FLogcat - algo::Smallstr50 logcat; // - bool enabled; // false - bool builtin; // false - algo::Comment comment; // - algo_lib::FLogcat* ind_logcat_next; // hash next + algo::Smallstr50 logcat; // + bool enabled; // false + bool builtin; // false + bool stdout; // false + i32 maxmsg; // 0 + i32 window; // 0 + algo::Comment comment; // + algo_lib::Regx filter; // Output filter + algo_lib::Regx negfilter; // Negative output filter + i64 nmsg; // 0 Number of messages printed inside current window + algo_lib::FTimehook th_throttle; // + algo_lib::FLogcat* ind_logcat_next; // hash next + u32 ind_logcat_hashval; // hash value + // value field algo_lib.FLogcat.th_throttle is not copiable // func:algo_lib.FLogcat..AssignOp - inline algo_lib::FLogcat& operator =(const algo_lib::FLogcat &rhs) = delete; + algo_lib::FLogcat& operator =(const algo_lib::FLogcat &rhs) = delete; // func:algo_lib.FLogcat..Ctor inline FLogcat() __attribute__((nothrow)); // func:algo_lib.FLogcat..Dtor inline ~FLogcat() __attribute__((nothrow)); + // value field algo_lib.FLogcat.th_throttle is not copiable // func:algo_lib.FLogcat..CopyCtor - inline FLogcat(const algo_lib::FLogcat &rhs) = delete; + FLogcat(const algo_lib::FLogcat &rhs) = delete; +}; +``` + +#### algo_lib.FErrns - + + +#### algo_lib.FErrns Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|algo_lib.FErrns.errns|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|algo_lib.FErrns.decode|i32|[Hook](/txt/exe/amc/reftypes.md#hook)||| +|algo_lib.FErrns.outstr|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Output of decode operation| + +#### Struct FErrns + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) +``` +struct FErrns { // algo_lib.FErrns + i32 errns; // 0 + algo_lib::errns_decode_hook decode; // NULL Pointer to a function + u64 decode_ctx; // 0 Callback context + algo::cstring outstr; // Output of decode operation + // func:algo_lib.FErrns..Ctor + inline FErrns() __attribute__((nothrow)); }; ``` @@ -4199,22 +1732,21 @@ struct FLogcat { // algo_lib.FLogcat |algo_lib.FDb.sbrk|u8|[Sbrk](/txt/exe/amc/reftypes.md#sbrk)||Base allocator for everything| |algo_lib.FDb.lpool|u8|[Lpool](/txt/exe/amc/reftypes.md#lpool)||private memory pool| |algo_lib.FDb.next_loop|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)||| -|algo_lib.FDb.limit|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)|0x7fffffffffffffff|| +|algo_lib.FDb.limit|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)|0x7fffffffffffffff|Main loop clock limit| |algo_lib.FDb.clocks_to_ms|double|[Val](/txt/exe/amc/reftypes.md#val)||| |algo_lib.FDb.n_iohook|u32|[Val](/txt/exe/amc/reftypes.md#val)|0|Number of iohooks in epoll| -|algo_lib.FDb.clock|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)||Current cpu clock value| -|algo_lib.FDb.mainloop_clock|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)||Mainloop cpu clock value| +|algo_lib.FDb.clock|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)||Most recent cpu clock value| +|algo_lib.FDb.step_limit|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)||Execution limit for current step| |algo_lib.FDb.start_clock|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)||cpu clock value at startup| |algo_lib.FDb.hz|double|[Val](/txt/exe/amc/reftypes.md#val)||| |algo_lib.FDb.t_last_signal|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)||Time last async signal was processed| -|algo_lib.FDb.exit_code|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|Exit code from main program. 0 = success (this is the unix exit code!)| +|algo_lib.FDb.exit_code|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|Unix exit code from main program. 0 = success| |algo_lib.FDb.clocks_to_ns|double|[Val](/txt/exe/amc/reftypes.md#val)||| -|algo_lib.FDb.n_temp|u32|[Val](/txt/exe/amc/reftypes.md#val)|0|* initialization order is important *| +|algo_lib.FDb.n_temp|u32|[Val](/txt/exe/amc/reftypes.md#val)|0|| |algo_lib.FDb.last_signal|u32|[Val](/txt/exe/amc/reftypes.md#val)||Value of last signal (used by SetupExitSignals)| -|algo_lib.FDb.eol|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|| |algo_lib.FDb.cpu_hz|u64|[Val](/txt/exe/amc/reftypes.md#val)||Cpu HZ, determined at startup| |algo_lib.FDb.fildes|[algo_lib.FFildes](/txt/lib/algo_lib/README.md#algo_lib-ffildes)|[Cppstack](/txt/exe/amc/reftypes.md#cppstack)||Provides default name for variables of this type| -|algo_lib.FDb.temp_strings|[algo.cstring](/txt/protocol/algo/cstring.md)|[Inlary](/txt/exe/amc/reftypes.md#inlary)||* initialization order is important *| +|algo_lib.FDb.temp_strings|[algo.cstring](/txt/protocol/algo/cstring.md)|[Inlary](/txt/exe/amc/reftypes.md#inlary)||| |algo_lib.FDb.ArgvIdent|[algo.Charset](/txt/protocol/algo/Charset.md)|[Charset](/txt/exe/amc/reftypes.md#charset)||| |algo_lib.FDb.BashQuotesafe|[algo.Charset](/txt/protocol/algo/Charset.md)|[Charset](/txt/exe/amc/reftypes.md#charset)||| |algo_lib.FDb.RegxSqlSpecial|[algo.Charset](/txt/protocol/algo/Charset.md)|[Charset](/txt/exe/amc/reftypes.md#charset)||| @@ -4231,6 +1763,7 @@ struct FLogcat { // algo_lib.FLogcat |algo_lib.FDb.csvparse|[algo_lib.CsvParse](/txt/lib/algo_lib/README.md#algo_lib-csvparse)|[Cppstack](/txt/exe/amc/reftypes.md#cppstack)||Provides default name for variables of this type| |algo_lib.FDb.regxparse|[algo_lib.RegxParse](/txt/lib/algo_lib/README.md#algo_lib-regxparse)|[Cppstack](/txt/exe/amc/reftypes.md#cppstack)||Provides default name for variables of this type| |algo_lib.FDb.regx|[algo_lib.Regx](/txt/lib/algo_lib/README.md#algo_lib-regx)|[Cppstack](/txt/exe/amc/reftypes.md#cppstack)||Provides default name for variables of this type| +|algo_lib.FDb.regxm|[algo_lib.RegxM](/txt/lib/algo_lib/README.md#algo_lib-regxm)|[Val](/txt/exe/amc/reftypes.md#val)||Context for Regx matching| |algo_lib.FDb.tabulate|[algo_lib.Tabulate](/txt/lib/algo_lib/README.md#algo_lib-tabulate)|[Cppstack](/txt/exe/amc/reftypes.md#cppstack)||Provides default name for variables of this type| |algo_lib.FDb.log_str|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| |algo_lib.FDb.bh_timehook|[algo_lib.FTimehook](/txt/lib/algo_lib/README.md#algo_lib-ftimehook)|[Bheap](/txt/exe/amc/reftypes.md#bheap)||Binary heap of time-based callbacks| @@ -4257,11 +1790,8 @@ struct FLogcat { // algo_lib.FLogcat |algo_lib.FDb.giveup_count|u64|[Val](/txt/exe/amc/reftypes.md#val)||| |algo_lib.FDb.fatalerr|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| |algo_lib.FDb.stringtofile_nwrite|u32|[Val](/txt/exe/amc/reftypes.md#val)||Global counter of # of files written| -|algo_lib.FDb.giveup_time|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Trigger for giveup_time loop| -|algo_lib.FDb.sleep_roundup|bool|[Val](/txt/exe/amc/reftypes.md#val)||| |algo_lib.FDb.last_sleep_clocks|u64|[Val](/txt/exe/amc/reftypes.md#val)||| |algo_lib.FDb.msgtemp|[algo.ByteAry](/txt/protocol/algo/README.md#algo-byteary)|[Val](/txt/exe/amc/reftypes.md#val)||| -|algo_lib.FDb.show_insert_err_lim|u32|[Val](/txt/exe/amc/reftypes.md#val)||| |algo_lib.FDb.DigitChar|[algo.Charset](/txt/protocol/algo/Charset.md)|[Charset](/txt/exe/amc/reftypes.md#charset)||| |algo_lib.FDb.NewLineChar|[algo.Charset](/txt/protocol/algo/Charset.md)|[Charset](/txt/exe/amc/reftypes.md#charset)||| |algo_lib.FDb.WhiteChar|[algo.Charset](/txt/protocol/algo/Charset.md)|[Charset](/txt/exe/amc/reftypes.md#charset)||| @@ -4280,112 +1810,113 @@ struct FLogcat { // algo_lib.FLogcat |algo_lib.FDb.Prlog|[algo.PrlogFcn](/txt/protocol/algo/PrlogFcn.md)|[Val](/txt/exe/amc/reftypes.md#val)|algo::Prlog|| |algo_lib.FDb.logcat|[algo_lib.FLogcat](/txt/lib/algo_lib/README.md#algo_lib-flogcat)|[Inlary](/txt/exe/amc/reftypes.md#inlary)||| |algo_lib.FDb.ind_logcat|[algo_lib.FLogcat](/txt/lib/algo_lib/README.md#algo_lib-flogcat)|[Thash](/txt/exe/amc/reftypes.md#thash)||| -|algo_lib.FDb.show_tstamp|bool|[Val](/txt/exe/amc/reftypes.md#val)||| |algo_lib.FDb.tstamp_fmt|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"%Y/%m/%dT%H:%M:%S.%.6X "|| -|algo_lib.FDb.fildes_stdout|[algo.Fildes](/txt/protocol/algo/Fildes.md)|[Val](/txt/exe/amc/reftypes.md#val)|1|| -|algo_lib.FDb.fildes_stderr|[algo.Fildes](/txt/protocol/algo/Fildes.md)|[Val](/txt/exe/amc/reftypes.md#val)|2|| -|algo_lib.FDb.pending_eol|bool|[Val](/txt/exe/amc/reftypes.md#val)||| |algo_lib.FDb.exec_args|[algo.cstring](/txt/protocol/algo/cstring.md)|[Tary](/txt/exe/amc/reftypes.md#tary)||| |algo_lib.FDb.dirstack|[algo.cstring](/txt/protocol/algo/cstring.md)|[Tary](/txt/exe/amc/reftypes.md#tary)||Directory stack for PushDir/PopDir| +|algo_lib.FDb.errns|[algo_lib.FErrns](/txt/lib/algo_lib/README.md#algo_lib-ferrns)|[Inlary](/txt/exe/amc/reftypes.md#inlary)||Fixed table of errns decoders| +|algo_lib.FDb.tempdir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|algo_lib.FDb.use_epoll_pwait2|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Use epoll_pwait2 system call| +|algo_lib.FDb.pending_eol|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|algo_lib.FDb.giveup_time|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Trigger for giveup_time loop| +|algo_lib.FDb.show_tstamp|bool|[Val](/txt/exe/amc/reftypes.md#val)||| #### Struct FDb Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) ``` struct FDb { // algo_lib.FDb: In-memory database for algo_lib - u64 sbrk_huge_limit; // Huge page limit in bytes -- set to 0 with fork! - u64 sbrk_huge_alloc; // Huge page bytes allocated - bool sbrk_zeromem; // Zero allocated memory - lpool_Lpblock* lpool_free[36]; // Lpool levels - algo::SchedTime next_loop; // - algo::SchedTime limit; // 0x7fffffffffffffff - double clocks_to_ms; // 0.0 - u32 n_iohook; // 0 Number of iohooks in epoll - algo::SchedTime clock; // Current cpu clock value - algo::SchedTime mainloop_clock; // Mainloop cpu clock value - algo::SchedTime start_clock; // cpu clock value at startup - double hz; // 0.0 - algo::SchedTime t_last_signal; // Time last async signal was processed - i32 exit_code; // 0 Exit code from main program. 0 = success (this is the unix exit code!) - double clocks_to_ns; // 0.0 - u32 n_temp; // 0 * initialization order is important * - u32 last_signal; // 0 Value of last signal (used by SetupExitSignals) - bool eol; // false - u64 cpu_hz; // 0 Cpu HZ, determined at startup - algo::cstring temp_strings_elems[8]; // fixed array - algo::Charset ArgvIdent; // - algo::Charset BashQuotesafe; // - algo::Charset RegxSqlSpecial; // - algo::Charset SsimBreakName; // - algo::Charset SsimBreakValue; // - algo::Charset SsimQuotesafe; // - algo_lib::FImtable* imtable_lary[32]; // level array - i32 imtable_n; // number of elements in array - algo_lib::FImtable** ind_imtable_buckets_elems; // pointer to bucket array - i32 ind_imtable_buckets_n; // number of elements in bucket array - i32 ind_imtable_n; // number of elements in the hash table - algo::cstring log_str; // - algo_lib::FTimehook** bh_timehook_elems; // binary heap by time - i32 bh_timehook_n; // number of elements in the heap - i32 bh_timehook_max; // max elements in bh_timehook_elems - i32 epoll_fd; // -1 - algo_lib::FLockfile lock_core; // - algo_lib::FTimehook* c_timehook; // TEMP: here only for dependency reasons. optional pointer - algo_lib::FTimehook _timehook; // Keep me here i'm special - algo_lib::FDispsigcheck* dispsigcheck_lary[32]; // level array - i32 dispsigcheck_n; // number of elements in array - algo_lib::FDispsigcheck** ind_dispsigcheck_buckets_elems; // pointer to bucket array - i32 ind_dispsigcheck_buckets_n; // number of elements in bucket array - i32 ind_dispsigcheck_n; // number of elements in the hash table - u128 imdb_data[sizeu128(algo_lib::FImdb,32)]; // place for data - i32 imdb_n; // number of elems current in existence + u64 sbrk_huge_limit; // Huge page limit in bytes -- set to 0 with fork! + u64 sbrk_huge_alloc; // Huge page bytes allocated + bool sbrk_zeromem; // Zero allocated memory + lpool_Lpblock* lpool_free[36]; // Lpool levels + algo::SchedTime next_loop; // + algo::SchedTime limit; // 0x7fffffffffffffff Main loop clock limit + double clocks_to_ms; // 0.0 + u32 n_iohook; // 0 Number of iohooks in epoll + algo::SchedTime clock; // Most recent cpu clock value + algo::SchedTime step_limit; // Execution limit for current step + algo::SchedTime start_clock; // cpu clock value at startup + double hz; // 0.0 + algo::SchedTime t_last_signal; // Time last async signal was processed + i32 exit_code; // 0 Unix exit code from main program. 0 = success + double clocks_to_ns; // 0.0 + u32 n_temp; // 0 + u32 last_signal; // 0 Value of last signal (used by SetupExitSignals) + u64 cpu_hz; // 0 Cpu HZ, determined at startup + algo::cstring temp_strings_elems[8]; // fixed array + algo::Charset ArgvIdent; // + algo::Charset BashQuotesafe; // + algo::Charset RegxSqlSpecial; // + algo::Charset SsimBreakName; // + algo::Charset SsimBreakValue; // + algo::Charset SsimQuotesafe; // + algo_lib::FImtable* imtable_lary[32]; // level array + i32 imtable_n; // number of elements in array + algo_lib::FImtable** ind_imtable_buckets_elems; // pointer to bucket array + i32 ind_imtable_buckets_n; // number of elements in bucket array + i32 ind_imtable_n; // number of elements in the hash table + algo_lib::RegxM regxm; // Context for Regx matching + algo::cstring log_str; // + algo_lib::FTimehook** bh_timehook_elems; // binary heap by time + i32 bh_timehook_n; // number of elements in the heap + i32 bh_timehook_max; // max elements in bh_timehook_elems + i32 epoll_fd; // -1 + algo_lib::FLockfile lock_core; // + algo_lib::FTimehook* c_timehook; // TEMP: here only for dependency reasons. optional pointer + algo_lib::FTimehook _timehook; // Keep me here i'm special + algo_lib::FDispsigcheck* dispsigcheck_lary[32]; // level array + i32 dispsigcheck_n; // number of elements in array + algo_lib::FDispsigcheck** ind_dispsigcheck_buckets_elems; // pointer to bucket array + i32 ind_dispsigcheck_buckets_n; // number of elements in bucket array + i32 ind_dispsigcheck_n; // number of elements in the hash table + u128 imdb_data[sizeu128(algo_lib::FImdb,32)]; // place for data + i32 imdb_n; // number of elems current in existence enum { imdb_max = 32 }; - algo_lib::FImdb** ind_imdb_buckets_elems; // pointer to bucket array - i32 ind_imdb_buckets_n; // number of elements in bucket array - i32 ind_imdb_n; // number of elements in the hash table - u64 txtcell_blocksize; // # bytes per block - algo_lib::FTxtcell* txtcell_free; // - u64 txtrow_blocksize; // # bytes per block - algo_lib::FTxtrow* txtrow_free; // - i32 argc; // 0 Argc from main - char** argv; // Argv from main. optional pointer - algo::cstring xref_error; // - algo::cstring errtext; // - algo::ByteAry* varlenbuf; // optional pointer - u64 replvar_blocksize; // # bytes per block - algo_lib::FReplvar* replvar_free; // - algo_lib::Cmdline cmdline; // - algo_lib::_db_h_fatalerror_hook h_fatalerror; // NULL Pointer to a function - u64 h_fatalerror_ctx; // 0 Callback context - u64 giveup_count; // 0 - algo::cstring fatalerr; // - u32 stringtofile_nwrite; // 0 Global counter of # of files written - bool giveup_time; // true Trigger for giveup_time loop - bool sleep_roundup; // false - u64 last_sleep_clocks; // 0 - algo::ByteAry msgtemp; // - u32 show_insert_err_lim; // 0 - algo::Charset Urlsafe; // - u64 winjob; // 0 - algo::PrlogFcn Prlog; // algo::Prlog - u128 logcat_data[sizeu128(algo_lib::FLogcat,3)]; // place for data - i32 logcat_n; // number of elems current in existence - enum { logcat_max = 3 }; - algo_lib::FLogcat** ind_logcat_buckets_elems; // pointer to bucket array - i32 ind_logcat_buckets_n; // number of elements in bucket array - i32 ind_logcat_n; // number of elements in the hash table - bool show_tstamp; // false - algo::cstring tstamp_fmt; // "%Y/%m/%dT%H:%M:%S.%.6X " - algo::Fildes fildes_stdout; // 1 - algo::Fildes fildes_stderr; // 2 - bool pending_eol; // false - algo::cstring* exec_args_elems; // pointer to elements - u32 exec_args_n; // number of elements in array - u32 exec_args_max; // max. capacity of array before realloc - algo::cstring* dirstack_elems; // pointer to elements - u32 dirstack_n; // number of elements in array - u32 dirstack_max; // max. capacity of array before realloc - algo_lib::trace trace; // + algo_lib::FImdb** ind_imdb_buckets_elems; // pointer to bucket array + i32 ind_imdb_buckets_n; // number of elements in bucket array + i32 ind_imdb_n; // number of elements in the hash table + u64 txtcell_blocksize; // # bytes per block + algo_lib::FTxtcell* txtcell_free; // + u64 txtrow_blocksize; // # bytes per block + algo_lib::FTxtrow* txtrow_free; // + i32 argc; // 0 Argc from main + char** argv; // Argv from main. optional pointer + algo::cstring xref_error; // + algo::cstring errtext; // + algo::ByteAry* varlenbuf; // optional pointer + u64 replvar_blocksize; // # bytes per block + algo_lib::FReplvar* replvar_free; // + algo_lib::Cmdline cmdline; // + algo_lib::_db_h_fatalerror_hook h_fatalerror; // NULL Pointer to a function + u64 h_fatalerror_ctx; // 0 Callback context + u64 giveup_count; // 0 + algo::cstring fatalerr; // + u32 stringtofile_nwrite; // 0 Global counter of # of files written + u64 last_sleep_clocks; // 0 + algo::ByteAry msgtemp; // + algo::Charset Urlsafe; // + u64 winjob; // 0 + algo::PrlogFcn Prlog; // algo::Prlog + u128 logcat_data[sizeu128(algo_lib::FLogcat,10)]; // place for data + i32 logcat_n; // number of elems current in existence + enum { logcat_max = 10 }; + algo_lib::FLogcat** ind_logcat_buckets_elems; // pointer to bucket array + i32 ind_logcat_buckets_n; // number of elements in bucket array + i32 ind_logcat_n; // number of elements in the hash table + algo::cstring tstamp_fmt; // "%Y/%m/%dT%H:%M:%S.%.6X " + algo::cstring* exec_args_elems; // pointer to elements + u32 exec_args_n; // number of elements in array + u32 exec_args_max; // max. capacity of array before realloc + algo::cstring* dirstack_elems; // pointer to elements + u32 dirstack_n; // number of elements in array + u32 dirstack_max; // max. capacity of array before realloc + algo_lib::FErrns errns_elems[8]; // fixed array + algo::cstring tempdir; // + bool use_epoll_pwait2; // false Use epoll_pwait2 system call + bool pending_eol; // false + bool giveup_time; // true Trigger for giveup_time loop + bool show_tstamp; // false + algo_lib::trace trace; // }; ``` @@ -4405,9 +1936,10 @@ struct FDb { // algo_lib.FDb: In-memory database for algo_lib Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) ``` struct FDispsigcheck { // algo_lib.FDispsigcheck - algo_lib::FDispsigcheck* ind_dispsigcheck_next; // hash next - algo::Smallstr50 dispsig; // - algo::Sha1sig signature; // + algo_lib::FDispsigcheck* ind_dispsigcheck_next; // hash next + u32 ind_dispsigcheck_hashval; // hash value + algo::Smallstr50 dispsig; // + algo::Sha1sig signature; // // func:algo_lib.FDispsigcheck..AssignOp inline algo_lib::FDispsigcheck& operator =(const algo_lib::FDispsigcheck &rhs) = delete; // func:algo_lib.FDispsigcheck..CopyCtor @@ -4450,16 +1982,17 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) ``` struct FImtable { // algo_lib.FImtable - algo_lib::FImtable* ind_imtable_next; // hash next - algo::Smallstr50 imtable; // Table name - algo::Smallstr100 elem_type; // Element type name - algo::ImrowRowidFindFcn c_RowidFind; // 0 Function to find element by rowid (may be NULL) - algo::ImrowXrefXFcn XrefX; // 0 Function to x-reference an element (may be NULL) - algo::ImrowNItemsFcn NItems; // 0 Return number of elements in the table - algo::ImrowPrintFcn Print; // 0 Convert specified element to string (may be NULL) - i32 size; // 0 Size of one element (for fixed-width elements only) - algo::Smallstr50 ssimfile; // Ssimfile name (if associated) - algo::Comment comment; // + algo_lib::FImtable* ind_imtable_next; // hash next + u32 ind_imtable_hashval; // hash value + algo::Smallstr50 imtable; // Table name + algo::Smallstr100 elem_type; // Element type name + algo::ImrowRowidFindFcn c_RowidFind; // 0 Function to find element by rowid (may be NULL) + algo::ImrowXrefXFcn XrefX; // 0 Function to x-reference an element (may be NULL) + algo::ImrowNItemsFcn NItems; // 0 Return number of elements in the table + algo::ImrowPrintFcn Print; // 0 Convert specified element to string (may be NULL) + i32 size; // 0 Size of one element (for fixed-width elements only) + algo::Smallstr50 ssimfile; // Ssimfile name (if associated) + algo::Comment comment; // // func:algo_lib.FImtable..AssignOp algo_lib::FImtable& operator =(const algo_lib::FImtable &rhs) = delete; // func:algo_lib.FImtable..CopyCtor @@ -4520,18 +2053,21 @@ struct FIohook { // algo_lib.FIohook |algo_lib.FReplvar.key|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Key| |algo_lib.FReplvar.value|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Value| |algo_lib.FReplvar.nsubst|i32|[Val](/txt/exe/amc/reftypes.md#val)||Number of times variable accessed| +|algo_lib.FReplvar.partial|bool|[Val](/txt/exe/amc/reftypes.md#val)||This is a partial match on another variable| #### Struct FReplvar Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) ``` struct FReplvar { // algo_lib.FReplvar - algo_lib::FReplvar* replvar_next; // Pointer to next free element int tpool - algo_lib::Replscope* p_replscope; // reference to parent row - algo::cstring key; // Key - algo::cstring value; // Value - i32 nsubst; // 0 Number of times variable accessed - algo_lib::FReplvar* ind_replvar_next; // hash next + algo_lib::FReplvar* replvar_next; // Pointer to next free element int tpool + algo_lib::Replscope* p_replscope; // reference to parent row + algo::cstring key; // Key + algo::cstring value; // Value + i32 nsubst; // 0 Number of times variable accessed + bool partial; // false This is a partial match on another variable + algo_lib::FReplvar* replscope_ind_replvar_next; // hash next + u32 replscope_ind_replvar_hashval; // hash value // func:algo_lib.FReplvar..AssignOp inline algo_lib::FReplvar& operator =(const algo_lib::FReplvar &rhs) = delete; // func:algo_lib.FReplvar..CopyCtor @@ -4581,7 +2117,7 @@ struct FTempfile { // algo_lib.FTempfile |algo_lib.FTxtcell.p_txtrow|[algo_lib.FTxtrow](/txt/lib/algo_lib/README.md#algo_lib-ftxtrow)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| |algo_lib.FTxtcell.justify|[algo.TextJust](/txt/protocol/algo/TextJust.md)|[Val](/txt/exe/amc/reftypes.md#val)|algo_TextJust_j_left|Justification of text within cell| |algo_lib.FTxtcell.style|[algo.TermStyle](/txt/protocol/algo/TermStyle.md)|[Val](/txt/exe/amc/reftypes.md#val)||Text style| -|algo_lib.FTxtcell.span|i32|[Val](/txt/exe/amc/reftypes.md#val)|1|Span in columns| +|algo_lib.FTxtcell.span|i32|[Val](/txt/exe/amc/reftypes.md#val)|1|Column span of this cell| |algo_lib.FTxtcell.width|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|Width in chars| |algo_lib.FTxtcell.text|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Cell contents| |algo_lib.FTxtcell.rsep|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Right separator| @@ -4595,7 +2131,7 @@ struct FTxtcell { // algo_lib.FTxtcell algo_lib::FTxtrow* p_txtrow; // reference to parent row algo::TextJust justify; // algo_TextJust_j_left Justification of text within cell algo::TermStyle style; // Text style - i32 span; // 1 Span in columns + i32 span; // 1 Column span of this cell i32 width; // 0 Width in chars algo::cstring text; // Cell contents algo::cstring rsep; // Right separator @@ -4668,9 +2204,8 @@ private: |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|algo_lib.FTxttbl.c_txtrow|[algo_lib.FTxtrow](/txt/lib/algo_lib/README.md#algo_lib-ftxtrow)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||Array of cells| -|algo_lib.FTxttbl.col_space|i32|[Val](/txt/exe/amc/reftypes.md#val)|2|Extra space between columns| -|algo_lib.FTxttbl.hdr_row|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|Index of header row (default -1)| +|algo_lib.FTxttbl.c_txtrow|[algo_lib.FTxtrow](/txt/lib/algo_lib/README.md#algo_lib-ftxtrow)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||Array of rows| +|algo_lib.FTxttbl.col_space|i32|[Val](/txt/exe/amc/reftypes.md#val)|2|Default extra space between columns| |algo_lib.FTxttbl.normalized|bool|[Val](/txt/exe/amc/reftypes.md#val)||Cell widths computed| #### Struct FTxttbl @@ -4681,8 +2216,7 @@ struct FTxttbl { // algo_lib.FTxttbl: Table row. Todo: absolute index for cells? algo_lib::FTxtrow** c_txtrow_elems; // array of pointers u32 c_txtrow_n; // array of pointers u32 c_txtrow_max; // capacity of allocated array - i32 col_space; // 2 Extra space between columns - i32 hdr_row; // 0 Index of header row (default -1) + i32 col_space; // 2 Default extra space between columns bool normalized; // false Cell widths computed // func:algo_lib.FTxttbl..Ctor inline FTxttbl() __attribute__((nothrow)); @@ -4771,51 +2305,7 @@ struct MmapFile { // algo_lib.MmapFile }; ``` -#### algo_lib.Regx - Parsed regular expression - - -#### algo_lib.Regx Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|algo_lib.Regx.expr|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Original string expression in some unspecified regx dialect| -|algo_lib.Regx.state|[algo_lib.RegxState](/txt/lib/algo_lib/README.md#algo_lib-regxstate)|[Tary](/txt/exe/amc/reftypes.md#tary)||Array of states| -|algo_lib.Regx.front|[algo_lib.Bitset](/txt/lib/algo_lib/README.md#algo_lib-bitset)|[Val](/txt/exe/amc/reftypes.md#val)||Temporary front (for matching)| -|algo_lib.Regx.next_front|[algo_lib.Bitset](/txt/lib/algo_lib/README.md#algo_lib-bitset)|[Val](/txt/exe/amc/reftypes.md#val)||Next front (for matching)| -|algo_lib.Regx.start|[algo_lib.Bitset](/txt/lib/algo_lib/README.md#algo_lib-bitset)|[Val](/txt/exe/amc/reftypes.md#val)||Set of starting states| -|algo_lib.Regx.accept|i32|[Val](/txt/exe/amc/reftypes.md#val)||Accept state| -|algo_lib.Regx.parseerror|bool|[Val](/txt/exe/amc/reftypes.md#val)||Non-fatal error while parsing| -|algo_lib.Regx.accepts_all|bool|[Val](/txt/exe/amc/reftypes.md#val)||True if this regx matches anything| -|algo_lib.Regx.literal|bool|[Val](/txt/exe/amc/reftypes.md#val)||True if expr may be matched literally (set during translation)| - -#### Struct Regx - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) -``` -struct Regx { // algo_lib.Regx: Parsed regular expression - algo::cstring expr; // Original string expression in some unspecified regx dialect - algo_lib::RegxState* state_elems; // pointer to elements - u32 state_n; // number of elements in array - u32 state_max; // max. capacity of array before realloc - algo_lib::Bitset front; // Temporary front (for matching) - algo_lib::Bitset next_front; // Next front (for matching) - algo_lib::Bitset start; // Set of starting states - i32 accept; // 0 Accept state - bool parseerror; // false Non-fatal error while parsing - bool accepts_all; // false True if this regx matches anything - bool literal; // false True if expr may be matched literally (set during translation) - // func:algo_lib.Regx..AssignOp - algo_lib::Regx& operator =(const algo_lib::Regx &rhs) __attribute__((nothrow)); - // func:algo_lib.Regx..Ctor - inline Regx() __attribute__((nothrow)); - // func:algo_lib.Regx..Dtor - inline ~Regx() __attribute__((nothrow)); - // func:algo_lib.Regx..CopyCtor - Regx(const algo_lib::Regx &rhs) __attribute__((nothrow)); -}; -``` - -#### algo_lib.RegxToken - +#### algo_lib.RegxToken - Used when parsing #### algo_lib.RegxToken Fields @@ -4828,7 +2318,7 @@ struct Regx { // algo_lib.Regx: Parsed regular expression Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) ``` -struct RegxToken { // algo_lib.RegxToken +struct RegxToken { // algo_lib.RegxToken: Used when parsing i32 type; // 0 State // func:algo_lib.RegxToken.type.Cast inline operator algo_lib_RegxToken_type_Enum() const __attribute__((nothrow)); @@ -4841,7 +2331,7 @@ struct RegxToken { // algo_lib.RegxToken }; ``` -#### algo_lib.RegxExpr - +#### algo_lib.RegxExpr - Expression during parsing #### algo_lib.RegxExpr Fields @@ -4849,22 +2339,48 @@ struct RegxToken { // algo_lib.RegxToken |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| |algo_lib.RegxExpr.type|[algo_lib.RegxToken](/txt/lib/algo_lib/README.md#algo_lib-regxtoken)|[Val](/txt/exe/amc/reftypes.md#val)||| -|algo_lib.RegxExpr.in|i32|[Val](/txt/exe/amc/reftypes.md#val)||Input state| -|algo_lib.RegxExpr.out|[algo_lib.Bitset](/txt/lib/algo_lib/README.md#algo_lib-bitset)|[Val](/txt/exe/amc/reftypes.md#val)||Output states| +|algo_lib.RegxExpr.first|i32|[Val](/txt/exe/amc/reftypes.md#val)||First character| +|algo_lib.RegxExpr.last|[algo_lib.Bitset](/txt/lib/algo_lib/README.md#algo_lib-bitset)|[Val](/txt/exe/amc/reftypes.md#val)||Last character(s)| #### Struct RegxExpr Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) ``` -struct RegxExpr { // algo_lib.RegxExpr - algo_lib::RegxToken type; // - i32 in; // 0 Input state - algo_lib::Bitset out; // Output states +struct RegxExpr { // algo_lib.RegxExpr: Expression during parsing + algo_lib::RegxToken type; // + i32 first; // 0 First character + algo_lib::Bitset last; // Last character(s) // func:algo_lib.RegxExpr..Ctor inline RegxExpr() __attribute__((nothrow)); }; ``` +#### algo_lib.RegxOp - A single instruction for Regex NFA + + +#### algo_lib.RegxOp Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|algo_lib.RegxOp.op|u8|[Val](/txt/exe/amc/reftypes.md#val)|0|What test to perform| +|algo_lib.RegxOp.consume|u8|[Val](/txt/exe/amc/reftypes.md#val)|1|Number of characters to consume| +|algo_lib.RegxOp.imm|u16|[Val](/txt/exe/amc/reftypes.md#val)|0|immediate value| + +#### Struct RegxOp + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) +``` +struct RegxOp { // algo_lib.RegxOp: A single instruction for Regex NFA + u8 op; // 0 What test to perform + u8 consume; // 1 Number of characters to consume + u16 imm; // 0 immediate value + // func:algo_lib.RegxOp..Ctor + inline RegxOp() __attribute__((nothrow)); + // func:algo_lib.RegxOp..FieldwiseCtor + explicit inline RegxOp(u8 in_op, u8 in_consume, u16 in_imm) __attribute__((nothrow)); +}; +``` + #### algo_lib.RegxParse - Function to parse regx @@ -4873,8 +2389,9 @@ struct RegxExpr { // algo_lib.RegxExpr |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| |algo_lib.RegxParse.input|[algo.strptr](/txt/protocol/algo/strptr.md)|[Val](/txt/exe/amc/reftypes.md#val)||Input string| -|algo_lib.RegxParse.p_regx|[algo_lib.Regx](/txt/lib/algo_lib/README.md#algo_lib-regx)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Output regx -- by reference| -|algo_lib.RegxParse.ary_expr|[algo_lib.RegxExpr](/txt/lib/algo_lib/README.md#algo_lib-regxexpr)|[Tary](/txt/exe/amc/reftypes.md#tary)||Output expression array| +|algo_lib.RegxParse.nextgroup|i32|[Val](/txt/exe/amc/reftypes.md#val)||Next capture group #| +|algo_lib.RegxParse.p_regx|[algo_lib.Regx](/txt/lib/algo_lib/README.md#algo_lib-regx)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||Regx being compiled| +|algo_lib.RegxParse.ary_expr|[algo_lib.RegxExpr](/txt/lib/algo_lib/README.md#algo_lib-regxexpr)|[Tary](/txt/exe/amc/reftypes.md#tary)||Expression stack| #### Struct RegxParse @@ -4882,6 +2399,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/in ``` struct RegxParse { // algo_lib.RegxParse: Function to parse regx algo::strptr input; // Input string + i32 nextgroup; // 0 Next capture group # algo_lib::Regx* p_regx; // reference to parent row algo_lib::RegxExpr* ary_expr_elems; // pointer to elements u32 ary_expr_n; // number of elements in array @@ -4897,35 +2415,29 @@ struct RegxParse { // algo_lib.RegxParse: Function to parse regx }; ``` -#### algo_lib.RegxState - +#### algo_lib.RegxState - Instruction + jumps #### algo_lib.RegxState Fields |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|algo_lib.RegxState.ch_class|[algo.i32_Range](/txt/protocol/algo/README.md#algo-i32_range)|[Tary](/txt/exe/amc/reftypes.md#tary)||What to match| -|algo_lib.RegxState.out|[algo_lib.Bitset](/txt/lib/algo_lib/README.md#algo_lib-bitset)|[Val](/txt/exe/amc/reftypes.md#val)||Where to go on a match| -|algo_lib.RegxState.accept_all|bool|[Val](/txt/exe/amc/reftypes.md#val)||Regx always succeeds from here| +|algo_lib.RegxState.ch_class|[algo.U16Ary](/txt/protocol/algo/README.md#algo-u16ary)|[Val](/txt/exe/amc/reftypes.md#val)||What to match| +|algo_lib.RegxState.op|[algo_lib.RegxOp](/txt/lib/algo_lib/README.md#algo_lib-regxop)|[Val](/txt/exe/amc/reftypes.md#val)||Operation to perform| +|algo_lib.RegxState.lparen|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|algo_lib.RegxState.next|[algo_lib.Bitset](/txt/lib/algo_lib/README.md#algo_lib-bitset)|[Val](/txt/exe/amc/reftypes.md#val)||Where to go on a match| #### Struct RegxState Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) ``` -struct RegxState { // algo_lib.RegxState - algo::i32_Range* ch_class_elems; // pointer to elements - u32 ch_class_n; // number of elements in array - u32 ch_class_max; // max. capacity of array before realloc - algo_lib::Bitset out; // Where to go on a match - bool accept_all; // false Regx always succeeds from here - // func:algo_lib.RegxState..AssignOp - algo_lib::RegxState& operator =(const algo_lib::RegxState &rhs) __attribute__((nothrow)); +struct RegxState { // algo_lib.RegxState: Instruction + jumps + algo::U16Ary ch_class; // What to match + algo_lib::RegxOp op; // Operation to perform + i32 lparen; // 0 + algo_lib::Bitset next; // Where to go on a match // func:algo_lib.RegxState..Ctor inline RegxState() __attribute__((nothrow)); - // func:algo_lib.RegxState..Dtor - inline ~RegxState() __attribute__((nothrow)); - // func:algo_lib.RegxState..CopyCtor - RegxState(const algo_lib::RegxState &rhs) __attribute__((nothrow)); }; ``` @@ -4936,8 +2448,8 @@ struct RegxState { // algo_lib.RegxState |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|algo_lib.Replscope.eatcomma|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|| -|algo_lib.Replscope.fatal|bool|[Val](/txt/exe/amc/reftypes.md#val)||Kill process on bad substitution| +|algo_lib.Replscope.eatcomma|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Delete comma+space after substitution| +|algo_lib.Replscope.strict|u8|[Val](/txt/exe/amc/reftypes.md#val)||1=warnings; 2=throw exception on error| |algo_lib.Replscope.ind_replvar|[algo_lib.FReplvar](/txt/lib/algo_lib/README.md#algo_lib-freplvar)|[Thash](/txt/exe/amc/reftypes.md#thash)||| #### Struct Replscope @@ -4945,8 +2457,8 @@ struct RegxState { // algo_lib.RegxState Generated by [amc](/txt/exe/amc/README.md) into [include/gen/algo_lib_gen.h](/include/gen/algo_lib_gen.h) ``` struct Replscope { // algo_lib.Replscope - bool eatcomma; // true - bool fatal; // false Kill process on bad substitution + bool eatcomma; // true Delete comma+space after substitution + u8 strict; // 0 1=warnings; 2=throw exception on error algo_lib::FReplvar** ind_replvar_buckets_elems; // pointer to bucket array i32 ind_replvar_buckets_n; // number of elements in bucket array i32 ind_replvar_n; // number of elements in the hash table diff --git a/txt/lib/lib_amcdb/README.md b/txt/lib/lib_amcdb/README.md index 5897c4fe..5893863c 100644 --- a/txt/lib/lib_amcdb/README.md +++ b/txt/lib/lib_amcdb/README.md @@ -4,11 +4,22 @@ ### Table Of Contents +  •  [Inputs](#inputs)
  •  [Sources](#sources)
  •  [Dependencies](#dependencies)
+### Inputs + + +`lib_amcdb` takes the following tables on input: +|Ssimfile|Comment| +|---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| + + + ### Sources diff --git a/txt/lib/lib_ams/README.md b/txt/lib/lib_ams/README.md index 03addf30..0d2e6312 100644 --- a/txt/lib/lib_ams/README.md +++ b/txt/lib/lib_ams/README.md @@ -5,49 +5,46 @@ AMS is a shared memory transport for communication between single-threaded proce Every process is a single-threaded process. When invoked with default options, each process reads messages from stdin and writes all of its outputs to stdout. -Some of the inputs (see list of ams messages, specifically message `ams.OpenMsg`) +Some of the inputs (see list of ams messages) may instruct the process to start reading / writing shared memory and turn off reading of messages from stdin. -AMS communication is based on streams. A stream is a named append-only sequence of messages. -Every stream has only a single writer process, but may have multiple readers. -All stream messages are sequenced and gaps are not allowed. +AMS communication is based on shms. A shm is a named append-only sequence of messages. +Every shm has only a single writer process, but may have multiple readers. +All shm messages are sequenced and gaps are not allowed. Writers wait until readers consume data before overwriting old messages. -Stream readers are registered with the control process which watches for liveness and keeps track of overall state. +Shm readers are registered with the control process which watches for liveness and keeps track of overall state. -A stream ID is a 32-bit entity consisting of four 8-bit fields: process type, process id, stream type, and stream index. +A shm ID is a 32-bit entity consisting of four 8-bit fields: process type, process id, shm type, and shm index. - ProcType: 8-bit value, see table proctype - ProcId: 16-bit value, ProcType + index -- StreamType: 8-bit value, see table streamtype -- StreamId: proc_id + stream_type + stream_idx +- Shmtype: 8-bit value, see table shmtype +- ShmId: proc_id + shm_type + shm_idx Process types are registered in table `amsdb.proctype`. The standard types are: ``` inline-command: acr proctype | ssimfilt ^ -t -PROCTYPE ID NS COMMENT -0 0 No process -amstest 5 ams_sendtest Ams testing +PROCTYPE ID NS COMMENT + 0 No process +ams_sendtest 5 ams_sendtest Ams testing ``` -Stream types are registered in table `amsdb.streamtype`. The standard types are: +Shm types are registered in table `amsdb.shmtype`. The standard types are: ``` -inline-command: acr streamtype -amsdb.streamtype streamtype:0 id:0 comment:"No stream" -amsdb.streamtype streamtype:ctl id:1 comment:"AMS control messages" -amsdb.streamtype streamtype:io id:5 comment:"Messages intended for file output" -amsdb.streamtype streamtype:out id:2 comment:"Log messages, alarms" -amsdb.streamtype streamtype:trace id:6 comment:"Trace messages" -report.acr n_select:5 n_insert:0 n_delete:0 n_ignore:0 n_update:0 n_file_mod:0 +inline-command: acr shmtype -report:N +amsdb.shmtype shmtype:ctl id:1 nonblock:Y comment:"AMS control messages" +amsdb.shmtype shmtype:log id:9 nonblock:N comment:"Log messages" +amsdb.shmtype shmtype:out id:2 nonblock:N comment:"Log messages, alarms" ``` -Together, stream id is formatted like this: `proctype-index.streamtype-index`. +Together, shm id is formatted like this: `proctype-index.shmtype-index`. For instance, `proc1-0.md-0`. -Proc types and stream types can be extended for the given system being implemented. -For every stream that a process reads or writes, it publishes one `ams.StreamHb` message to its `ctl` -output stream. The `ctl` output stream is different from standard output because it is non-deterministic +Proc types and shm types can be extended for the given system being implemented. +For every shm that a process reads or writes, it publishes one `ams.ShmHb` message to its `ctl` +output shm. The `ctl` output shm is different from standard output because it is non-deterministic (contains time-based messages such as heartbeats). ### Table Of Contents @@ -55,14 +52,11 @@ output stream. The `ctl` output stream is different from standard output because   •  [AMS Library](#ams-library)
  •  [List of AMS Messages](#list-of-ams-messages)
-  •  [`ams.ProcAdd`: Create process](#-ams-procadd--create-process)
-  •  [`ams.ProcRemove`: Destroy process](#-ams-procremove--destroy-process)
-  •  [`ams.Seqmsg`: A sequenced message](#-ams-seqmsg--a-sequenced-message)
-  •  [`ams.OpenMsg`: Open stream for reading/writing](#-ams-openmsg--open-stream-for-reading-writing)
-  •  [`ams.StreamHb`: Stream heartbeat](#-ams-streamhb--stream-heartbeat)
-  •  [In-memory stream format; Flow control](#in-memory-stream-format--flow-control)
+  •  [`ams.Shmmsg`: Shm message frame](#-ams-shmmsg--shm-message-frame)
+  •  [`ams.ShmHb`: Shm heartbeat](#-ams-shmhb--shm-heartbeat)
+  •  [In-memory shm format; Flow control](#in-memory-shm-format--flow-control)
  •  [Performance](#performance)
-  •  [AMS Stream Tracing](#ams-stream-tracing)
+  •  [AMS Shm Tracing](#ams-shm-tracing)
  •  [Functions](#functions)
  •  [Inputs](#inputs)
  •  [Sources](#sources)
@@ -75,8 +69,8 @@ output stream. The `ctl` output stream is different from standard output because Ams logic is implemented in the library `lib_ams`. -Each process knows what to do with certain streams; For instance, each process will direct -disk IO to the io stream if it's configured. +Each process knows what to do with certain shms; For instance, each process will direct +disk IO to the io shm if it's configured. ## List of AMS Messages @@ -84,127 +78,59 @@ disk IO to the io stream if it's configured. All ams messages are derived from `ams.MsgHeader`, which is a 32-bit header with type and length. -### `ams.ProcAdd`: Create process - - -``` -inline-command: acr ctype:ams.ProcAddMsg -t | awk -v RS='' '/dmmeta.ctype/' -dev.license license:GPL comment:"" -dmmeta.nstype nstype:protocol comment:"Protocol (not a target)" - dmmeta.ns ns:ams nstype:protocol license:GPL comment:"Algo Messaging System protocol" - dmmeta.ctype ctype:ams.ProcAddMsg comment:"Add process to process group" - dmmeta.cpptype ctype:ams.ProcAddMsg ctor:Y dtor:N cheap_copy:N - dmmeta.msgtype ctype:ams.ProcAddMsg type:4 - dmmeta.pack ctype:ams.ProcAddMsg comment:"" - dmmeta.field field:ams.ProcAddMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" - dmmeta.field field:ams.ProcAddMsg.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"ID of process being added" - dmmeta.cfmt cfmt:ams.ProcAddMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" - dmmeta.ctypelen ctype:ams.ProcAddMsg len:10 alignment:1 padbytes:0 plaindata:Y -``` - -Control process creates a new subprocess. -The new subprocess reads main control stream starting with latest sequence number. -The control stream reads output of the child process. By default, the output is directed to stdout. - -### `ams.ProcRemove`: Destroy process - - -``` -inline-command: acr ctype:ams.ProcRemoveMsg -t | awk -v RS='' '/dmmeta.ctype/' -dev.license license:GPL comment:"" -dmmeta.nstype nstype:protocol comment:"Protocol (not a target)" - dmmeta.ns ns:ams nstype:protocol license:GPL comment:"Algo Messaging System protocol" - dmmeta.ctype ctype:ams.ProcRemoveMsg comment:"Remove process from process group" - dmmeta.cpptype ctype:ams.ProcRemoveMsg ctor:Y dtor:N cheap_copy:N - dmmeta.msgtype ctype:ams.ProcRemoveMsg type:5 - dmmeta.pack ctype:ams.ProcRemoveMsg comment:"" - dmmeta.field field:ams.ProcRemoveMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" - dmmeta.field field:ams.ProcRemoveMsg.proc_id arg:ams.ProcId reftype:Val dflt:"" comment:"ID of process being removed" - dmmeta.cfmt cfmt:ams.ProcRemoveMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" - dmmeta.ctypelen ctype:ams.ProcRemoveMsg len:10 alignment:1 padbytes:0 plaindata:Y -``` - -Control process destroys the subprocess and removes its streams. - -### `ams.Seqmsg`: A sequenced message - - +### `ams.Shmmsg`: Shm message frame + All shared memory messages have this header. -Each Seqmsg is identified with `seqmsg_id`, a 96-bit quantity formatted as `stream_id@seqno`. -Each Seqmsg has a `tsc` field, which holds the value of CPU's TSC register, filled out at the time -of creation. - -``` -inline-command: acr ctype:ams.Seqmsg -t | awk -v RS='' '/dmmeta.ctype/' -dev.license license:GPL comment:"" -dmmeta.nstype nstype:protocol comment:"Protocol (not a target)" - dmmeta.ns ns:ams nstype:protocol license:GPL comment:"Algo Messaging System protocol" - dmmeta.ctype ctype:ams.Seqmsg comment:"Sequenced stream message" - dmmeta.cpptype ctype:ams.Seqmsg ctor:Y dtor:N cheap_copy:N - dmmeta.msgtype ctype:ams.Seqmsg type:10 - dmmeta.pack ctype:ams.Seqmsg comment:"" - dmmeta.field field:ams.Seqmsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" - dmmeta.field field:ams.Seqmsg.seqmsg_id arg:ams.SeqmsgId reftype:Val dflt:"" comment:"Message ID" - dmmeta.field field:ams.Seqmsg.tsc arg:u64 reftype:Val dflt:"" comment:"TSC of sender" - dmmeta.field field:ams.Seqmsg.payload arg:ams.MsgHeader reftype:Opt dflt:"" comment:"Actual Payload" - dmmeta.cfmt cfmt:ams.Seqmsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" - dmmeta.ctypelen ctype:ams.Seqmsg len:32 alignment:1 padbytes:0 plaindata:N -``` - -### `ams.OpenMsg`: Open stream for reading/writing - +Each Shmmsg is identified with `shm_id` and `offset`. ``` -inline-command: acr ctype:ams.OpenMsg -t | awk -v RS='' '/dmmeta.ctype/' +inline-command: acr ctype:ams.Shmmsg -t -l dev.license license:GPL comment:"" dmmeta.nstype nstype:protocol comment:"Protocol (not a target)" dmmeta.ns ns:ams nstype:protocol license:GPL comment:"Algo Messaging System protocol" - dmmeta.ctype ctype:ams.OpenMsg comment:"Open stream for reading" - dmmeta.cpptype ctype:ams.OpenMsg ctor:Y dtor:N cheap_copy:N - dmmeta.msgtype ctype:ams.OpenMsg type:7 - dmmeta.pack ctype:ams.OpenMsg comment:"" - dmmeta.field field:ams.OpenMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" - dmmeta.field field:ams.OpenMsg.member arg:ams.Member reftype:Val dflt:"" comment:"Target process_id and stream_id" - dmmeta.field field:ams.OpenMsg.pos arg:ams.StreamPos reftype:Val dflt:"" comment:"Start reading here" - dmmeta.cfmt cfmt:ams.OpenMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" - dmmeta.ctypelen ctype:ams.OpenMsg len:31 alignment:1 padbytes:0 plaindata:Y + dmmeta.ctype ctype:ams.Shmmsg comment:"Sequenced message on a shm" + dmmeta.cpptype ctype:ams.Shmmsg ctor:Y dtor:N cheap_copy:N + dmmeta.msgtype ctype:ams.Shmmsg type:10 + dmmeta.pack ctype:ams.Shmmsg comment:"" + dmmeta.field field:ams.Shmmsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" + dmmeta.field field:ams.Shmmsg.shm_id arg:ams.ShmId reftype:Val dflt:"" comment:"" + dmmeta.field field:ams.Shmmsg.off arg:u64 reftype:Val dflt:0 comment:"" + dmmeta.field field:ams.Shmmsg.tstamp arg:u64 reftype:Val dflt:0 comment:"" + dmmeta.field field:ams.Shmmsg.payload arg:ams.MsgHeader reftype:Opt dflt:"" comment:"Actual Payload" + dmmeta.cfmt cfmt:ams.Shmmsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" + dmmeta.ctypelen ctype:ams.Shmmsg len:30 alignment:1 padbytes:0 plaindata:N +report.acr n_select:14 n_insert:0 n_delete:0 n_ignore:0 n_update:0 n_file_mod:0 ``` -Begin reading/writing stream identified by `streamid` from shared memory region -For a shared memory region, reading begins at sequence number 1 and proceeds with no gaps. -Writing begins at sequence number 1. -Begin publishing a heartbeat describing current reading state. -Only one process can write to a given shared memory area, but multiple processes can read from it - -### `ams.StreamHb`: Stream heartbeat - +### `ams.ShmHb`: Shm heartbeat + ``` -inline-command: acr ctype:ams.StreamHbMsg -t | awk -v RS='' '/dmmeta.ctype/' +inline-command: acr ctype:ams.ShmHbMsg -t | awk -v RS='' '/dmmeta.ctype/' dev.license license:GPL comment:"" dmmeta.nstype nstype:protocol comment:"Protocol (not a target)" dmmeta.ns ns:ams nstype:protocol license:GPL comment:"Algo Messaging System protocol" - dmmeta.ctype ctype:ams.StreamHbMsg comment:"Stream heartbeat" - dmmeta.cpptype ctype:ams.StreamHbMsg ctor:Y dtor:N cheap_copy:N - dmmeta.msgtype ctype:ams.StreamHbMsg type:3 - dmmeta.pack ctype:ams.StreamHbMsg comment:"" - dmmeta.field field:ams.StreamHbMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" - dmmeta.field field:ams.StreamHbMsg.member arg:ams.Member reftype:Val dflt:"" comment:"Primary key" - dmmeta.field field:ams.StreamHbMsg.pos arg:ams.StreamPos reftype:Val dflt:"" comment:"Read/write position" - dmmeta.field field:ams.StreamHbMsg.wbudget arg:u32 reftype:Val dflt:"" comment:"Max. offset for writing" - dmmeta.cfmt cfmt:ams.StreamHbMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" - dmmeta.ctypelen ctype:ams.StreamHbMsg len:35 alignment:1 padbytes:0 plaindata:Y -``` - -For each stream being either read or written, each process outputs a StreamHb message. + dmmeta.ctype ctype:ams.ShmHbMsg comment:"Shm heartbeat" + dmmeta.cpptype ctype:ams.ShmHbMsg ctor:Y dtor:N cheap_copy:N + dmmeta.msgtype ctype:ams.ShmHbMsg type:3 + dmmeta.pack ctype:ams.ShmHbMsg comment:"" + dmmeta.field field:ams.ShmHbMsg.base arg:ams.MsgHeader reftype:Base dflt:"" comment:"" + dmmeta.field field:ams.ShmHbMsg.shmember arg:ams.ShmemberId reftype:Val dflt:"" comment:"Primary key" + dmmeta.field field:ams.ShmHbMsg.off arg:u64 reftype:Val dflt:"" comment:"Read/write position" + dmmeta.field field:ams.ShmHbMsg.wbudget arg:u32 reftype:Val dflt:"" comment:"Max. offset for writing" + dmmeta.cfmt cfmt:ams.ShmHbMsg.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" + dmmeta.ctypelen ctype:ams.ShmHbMsg len:32 alignment:1 padbytes:0 plaindata:Y +``` + +For each shm being either read or written, each process outputs a ShmHb message. For a reading process, the message declares how many messages have been read. For a writing process (`write:Y`), the message declares how many messages have been written For a process writing to disk, `commit:Y` is specified -## In-memory stream format; Flow control - +## In-memory shm format; Flow control + -The contents of a stream can be thought of as a sequence of back-to-back `Seqmsg` messages. +The contents of a shm can be thought of as a sequence of back-to-back `Seqmsg` messages. The first message is at offset 0, the second one has offset msg0.length, etc. The messages are published through a shared memory region of size 2^k. The region, plus a 4Kb helper region are mapped into memory of both reading and writing process. @@ -213,14 +139,14 @@ The message is written in such a way that the length field is populated last. Th checks the length field at a known offset to poll for message receive. Looking at the memory region it's not possible to tell where the next message starts. -One has to follow the progress of the stream to know the offsets. -The heartbeat message written to ctl stream reports a {sequence,offset} pair +One has to follow the progress of the shm to know the offsets. +The heartbeat message written to ctl shm reports a {sequence,offset} pair that can be used to start reading at that location. However, randomly reading a shared memory region isn't possible either, as the writer process could overwrite a region at any time. One has to be registered as a reader first. The writer will avoid overwriting any memory not read by the reader yet. -Readers are announced to the writer on input, and are added to the table of streams. +Readers are announced to the writer on input, and are added to the table of shms. All readers must read all messages before the those message bytes can be overwritten. When writing a message, the length is saved to memory last. Zero length means the message is not yet published. Writer process calls `sfence()` before writing length, reader process calls `lfence()` @@ -267,32 +193,10 @@ atf_unit.unittest unittest:lib_ams.SendData8 success:Y comment:"" report.atf_unit n_test_total:526 success:Y n_test_run:1 n_err:0 ``` -### AMS Stream Tracing - - -When the traace expression is applied using the function `lib_ams::ApplyTrace`, -both log categories and AMS streams are considered. - -The trace expression is also applied to each each stream as follows: -The following string is matched against the regex: -- proc_id/stream_id enable all tracing in ascii -- proc_id/stream_id,r enable tracing of read messages in ascii -- proc_id/stream_id,w enable tracing of written messages in ascii -- proc_id/stream_id,rb enable tracing of read messages in binary -- proc_id/stream_id,wb enable tracing of written messages in binary - -Messages are considered "written" to a stream when the process calls `lib_ams::WriteMsg`. -This is when tracing happens. +### AMS Shm Tracing + -Notably, `WriteMsg` is called when a messages is read from stdin and posted to a stream. - -Message is considered read from a stream when it is skipped using `lib_ams::SkipMsg` -This happens after all of the outputs produced while handling the message. -Examples of ams stream trace expressions: - -- %/%.out-0 read+write, output from all processes in the tree -- %/%.md-0,w all messages written to md-0 stream -- (bbox-0/bbox-0.out-0,r|...) explicit list +All messages read from the AMS bus can be traced with the `ams` logcat. ### Functions @@ -300,88 +204,68 @@ Examples of ams stream trace expressions: Functions exported from this namespace: ```c++ -// In-process `expect` implementation allows pausing reading of inputs until -// a certain prlog output is produced -// Motivating example: -// InputMsg1 -// InputMsg2 -// Expect text:blah -// InputMsg3 -// InputMsg3 is not processed until blah is printed. -// Implementation: -// When reading an input message: -// clear output buffer -// if read an ExpectMsg: -// set expect string to the input data -// check output buffer (match any outputs since last input against expect string) -// set expect timeout -// Expect timeout: -// exit process with error -// When printing: -// add to output buffer (limit: 100K). -// if expect mode, check output buffer -void lib_ams::ExpectEnable(strptr str) -``` - -```c++ -// Replace input reading function with one that pauses output -// to support ExpectMsg functionality -void lib_ams::ExpectAttach(lib_ams::FStream &stream) +// Open shm SHM for reading and add it to the list of shms +// which lib_ams scans for messages (i.e. control shms). +// Attach lib_ams message dispatch to the shm +bool lib_ams::AddCtlIn(lib_ams::FShm &shm) ``` ```c++ -// Function that replaces uses-provided message hook for a given stream -// Having no cost until the first call to ExpectEnable, the purpose -// is to block processing of any messages until expect_Str is empty -void lib_ams::ExpectHook(lib_ams::FStream &stream, ams::MsgHeader &msg) +inline u64 lib_ams::AddOffset(u64 offset, int n) ``` ```c++ -// Save output to possibly check against expect string later -// Keep last 50k-100k of output -void lib_ams::ExpectSaveOutput(algo::strptr text) +// Register PROC_ID as reader of shm SHM_ID starting at offset 0 +// This immediately limits the write budget of SHM_ID +// (Subsequent attempt to overwrite data not yet consumed by PROC_ID causes +// either reject or blocking wait) +void lib_ams::AddReadShmember(ams::ShmId shm_id, ams::ProcId proc_id) ``` ```c++ -void lib_ams::ExpectTimeout() +// Begin reading ams control messages from stdin +void lib_ams::BeginReadStdin() ``` ```c++ -// Check saved output buffer against expect string -// WARNING: calling prlog() from this function will cause an infinite loop -void lib_ams::ExpectCheck() +// Begin writing message of length LENGTH +// Used by WriteMsg and with amc's pnew (acr pnew) for zero-copy sends. +// If successful, return pointer to region of size LENGTH whre the mssage can be written, +// otherwise return NULL. +void *lib_ams::BeginWrite(lib_ams::FShm &shm, int length) ``` ```c++ -// Whether write file is in good state - valid fd and no failure -bool lib_ams::OkQ(lib_ams::FWritefile &wf) +// Whether can read from file - file is good and no EOF +bool lib_ams::CanReadQ(lib_ams::FReadfile &rf) ``` ```c++ -// Check for failure. This is intended for checking Close errors. -// After Close, OkQ could not be used for this purpose, -// but failure flag is preserved, and could be retrieved with FailQ. -bool lib_ams::FailQ(lib_ams::FWritefile &wf) +// Scan /dev/shm for stale shm files and delete them +// A file is stale if it's flockable (i.e. no process has locked it for writing) +// and it's at least 15 seconds old +void lib_ams::CleanOldShmFiles() ``` ```c++ -// Open file for appending messages -void lib_ams::OpenAppend(lib_ams::FWritefile &wf, algo::strptr filename) +// Close read file +void lib_ams::Close(lib_ams::FReadfile &wf) ``` ```c++ -// Flush data to file -void lib_ams::zd_flush_Step() +// Close shm. +// If shm is opened for writing, remove its file. +// BUG: I think if the shm is opened for reading, the mmap() leaks +void lib_ams::Close(lib_ams::FShm &shm) ``` ```c++ -// Write message (buffered) -void lib_ams::WriteMsg(lib_ams::FWritefile &wf, ams::MsgHeader &msg) +// Close written file +void lib_ams::Close(lib_ams::FWritefile &wf) ``` ```c++ -// Write buffer as message block -void lib_ams::Flush(lib_ams::FWritefile &wf) +void lib_ams::CloseAllShms() ``` ```c++ @@ -390,35 +274,28 @@ void lib_ams::Compress(lib_ams::FWritefile &wf) ``` ```c++ -// Write message block to file -void lib_ams::WriteMsgBlock(lib_ams::FWritefile &wf) -``` - -```c++ -// starts new message block - discard buffer, adjust seqno -void lib_ams::StartNextMsgBlock(lib_ams::FWritefile &wf) +void lib_ams::CtlMsg_ShmHbMsg(ams::ShmHbMsg &msg) ``` ```c++ -// Close written file -void lib_ams::Close(lib_ams::FWritefile &wf) +// Print table of shms in lib_ams, using ssim format +// if MEMBER is specified, print member information as well +void lib_ams::DumpShmTableDflt(algo_lib::Regx ®x, bool member) ``` ```c++ -// cleanup function -void lib_ams::fd_Cleanup(lib_ams::FWritefile& parent) +// Print table of shms in lib_ams, using a more readable layout +void lib_ams::DumpShmTableVisual(algo_lib::Regx ®x) ``` ```c++ -// Whether read file is in good state - valid fd and no failure. -// EOF is not a failure. -bool lib_ams::OkQ(lib_ams::FReadfile &rf) +// Finish writing message of length LENGTH, +// and send the result. +void lib_ams::EndWrite(lib_ams::FShm &shm, void *ptr, int len) ``` ```c++ -// Check for failure after close. -// EOF is not a failure. -bool lib_ams::FailQ(lib_ams::FReadfile &rf) +bool lib_ams::EnsureOutput(lib_ams::FShm &outshm, int budget) ``` ```c++ @@ -427,363 +304,336 @@ bool lib_ams::EofQ(lib_ams::FReadfile &rf) ``` ```c++ -// Whether can read from file - file is good and no EOF -bool lib_ams::CanReadQ(lib_ams::FReadfile &rf) -``` - -```c++ -// Open file for reading messages -void lib_ams::OpenRead(lib_ams::FReadfile &rf, algo::strptr filename) -``` - -```c++ -// Read message by sequence number -ams::MsgHeader *lib_ams::ReadMsg(lib_ams::FReadfile &rf, u64 seqno) -``` - -```c++ -// Scan file up to end -void lib_ams::ScanToEnd(lib_ams::FReadfile &rf) -``` - -```c++ -// Scan up to seqno, rewind if needed -void lib_ams::ScanToSeqno(lib_ams::FReadfile &rf, u64 seqno) -``` - -```c++ -// Scan and block load engine. -// if seqno is NULL, scans to end, fills block with last block. -// If seqno is present, scans up to given seqno, reads cbuf with payload -// Note is does only forward scan. -void lib_ams::Scan(lib_ams::FReadfile &rf,const u64 *seqno) -``` - -```c++ -// Skip bytes -void lib_ams::Skip(lib_ams::FReadfile &rf,u32 skip) +// Check for failure after close. +// EOF is not a failure. +bool lib_ams::FailQ(lib_ams::FReadfile &rf) ``` ```c++ -// Read bytes -bool lib_ams::Read(lib_ams::FReadfile &rf,void *buf,u32 n) +// Check for failure. This is intended for checking Close errors. +// After Close, OkQ could not be used for this purpose, +// but failure flag is preserved, and could be retrieved with FailQ. +bool lib_ams::FailQ(lib_ams::FWritefile &wf) ``` ```c++ -// Uncompress -void lib_ams::Uncompress(lib_ams::FReadfile &rf) +// Write buffer as message block +void lib_ams::Flush(lib_ams::FWritefile &wf) ``` ```c++ -// Reindex -void lib_ams::Reindex(lib_ams::FReadfile &rf) +inline u64 lib_ams::GetWriteBudget(lib_ams::FShm &shm) ``` ```c++ -// Close read file -void lib_ams::Close(lib_ams::FReadfile &wf) +// Initialize shm library +// FILE_PREFIX: unique filesystem prefix for all subsequently created shms. +// This is copied to lib_ams::_db.file_prefix. +// if FILE_PREFIX is empty, we are running in NON-SHMEM mode. In this mode, +// the library begins reading STDIN and posting any input messages to the default +// input shm. +// PROC_ID: process ID for this app. This is copied to lib_ams::_db.proc_id. +// The PROC_ID is .- -- enough to identify any number of processes within +// a cluster. +// If the variable _db.shm_files_cleaned is FALSE (which is the default), +// clean any stale (unlocked) shm files in /dev/shm/*.ams +// In SHMEM mode, all current and future memory is locked using mlockall. +bool lib_ams::Init(algo::strptr file_prefix, ams::ProcId proc_id) ``` ```c++ -// cleanup function -void lib_ams::fd_Cleanup(lib_ams::FReadfile& parent) +inline ams::ProcId lib_ams::MakeProcId(ams::Proctype proctype, int node, int index) ``` ```c++ -// The length field of a message must reside entirely within one cache line, -// or the sfence/lfence instructions won't behave as expected. -// So, we force each message to start at an address that'a a multiple of machine -// cache line size. -inline u64 AddOffset(u64 offset, int n) +inline ams::Shmmsg *lib_ams::MsgAtOffset(lib_ams::FShm &shm, u64 offset) ``` ```c++ -inline ams::Seqmsg *MsgAtOffset(lib_ams::FStream &stream, u64 offset) +// Whether read file is in good state - valid fd and no failure. +// EOF is not a failure. +bool lib_ams::OkQ(lib_ams::FReadfile &rf) ``` ```c++ -inline void UpdateAckOffset(lib_ams::FStream &stream) +// Whether write file is in good state - valid fd and no failure +bool lib_ams::OkQ(lib_ams::FWritefile &wf) ``` ```c++ -// Scan /dev/shm for stale stream files and delete them -// A file is stale if it's flockable (i.e. no process has locked it for writing) -// and it's at least 1 hour old -void lib_ams::CleanOldStreamFiles() +// Open file for appending messages +void lib_ams::OpenAppend(lib_ams::FWritefile &wf, algo::strptr filename) ``` ```c++ -// return TRUE if shared memory region is attached to stream STREAM. -bool lib_ams::ShmemOpenQ(lib_ams::FStream &stream) +// Create a read shmember for shm SHM +// Begin hot-polling the shm +bool lib_ams::OpenRead(lib_ams::FShm &shm, u64 off) ``` ```c++ -// Open shared memory for reading/writing (as specified in FLAGS) -// and return resulting shared memory region size. -// Fields initialized: -// - stream.filename -// - stream.shm_handle (windows) -// - stream.shm_file (linux) -// - stream.shm_region, if mapped successfully -i64 lib_ams::OpenShmem(lib_ams::FStream &stream, ams::StreamFlags flags) +// Open file for reading messages +void lib_ams::OpenRead(lib_ams::FReadfile &rf, algo::strptr filename) ``` ```c++ -// Open stream for reading or writing (but not both) -// If shared memory mode (lib_ams::_db.shmem_mode) is set, -// The file creator sets stream size. +// Open shm for reading or writing (or both) +// The file creator sets shm size. // Writer creates & locks the file. // Reader determines file from file size -// If shared memory mode is not set (stdio mode), -// the stream is attached to a private memory block of default size. // When opening for writing: -// The next message written to the stream will have sequence SEQ and offset OFFSET. -// Default is to use sequence 1, offset 0. +// The next message written to the shm will have OFFSET as determined by POS +// Initial value of offset is 0 // (However a newly spawned child process can be provided a known sequence & offset by the parent.) // When opening for reading: -// begin hot-polling for new messages on the stream -bool lib_ams::OpenStream(lib_ams::FStream &stream, ams::StreamFlags flags, ams::StreamPos pos) +// begin hot-polling for new messages on the shm +bool lib_ams::OpenShm(lib_ams::FShm &shm, ams::ShmFlags flags, u64 pos = 0) ``` ```c++ -bool lib_ams::OpenStream(lib_ams::FStream &stream, ams::StreamFlags flags) +// Create a write shmember for shm SHM +bool lib_ams::OpenWrite(lib_ams::FShm &shm, u64 off) ``` ```c++ -// TBD not sure if this function is needed in non-fork() environment -bool lib_ams::ReopenForReading(lib_ams::FStream &stream) -``` - -```c++ -// Update budget for stream STREAM -// Return TRUE if the stream is potentially unblocked for -// writing due to WRITELIMIT being increased. -// (WRITELIMIT is the point beyond which no message can be written -// because doing so would overwrite data not yet consumed by one of the read members.) -// TODO: do not update budget for a stream that is not opened for writing -bool lib_ams::UpdateBudget(lib_ams::FStream &stream) +// If the shm is open for reading, check to see if a message +// is available. If it is available, return pointer to message. +ams::Shmmsg *lib_ams::PeekMsg(lib_ams::FShmember &shmember) ``` ```c++ -// Update stream budgets -void lib_ams::UpdateBudgets() +void lib_ams::PollCtlIn() ``` ```c++ -// Register a bad, unskippable incoming message -// on STREAM, report it, and stop reading. -void lib_ams::WriterError(lib_ams::FStream &stream, ams::Seqmsg *msg) +// Print message MSG to string OUT according to format FMT +// if FMT.STRIP > 0, strip this many outer "layers"; +// if FMT.BIN, the message is printed as pure binary; otherwise, convert to text +// if FMT.PRETTY, every next layer / payload is printed on a new line with indent +// for readability. +// FMT.PAYLOAD_LEN limits maximum printed payload length, allowing to fit one messge per +// screen even if payload is 10MB +// Finally, if FMT.SHOWLEN is true, message length is included in output. +void lib_ams::PrintMsg(lib_ams::MsgFmt &fmt, ams::MsgHeader &msg, cstring &out) ``` ```c++ -// If the stream is open for reading, check to see if a message -// is available. -// If it is available, return pointer to message. -ams::Seqmsg *lib_ams::PeekMsg(lib_ams::FStream &stream) +// Read bytes +bool lib_ams::Read(lib_ams::FReadfile &rf,void *buf,u32 n) ``` ```c++ -// Called by the client -// to aoivd reading current message -void lib_ams::StopReading(lib_ams::FStream &stream) +void lib_ams::ReadCtlMsg(lib_ams::FShm &, ams::MsgHeader &msg) ``` ```c++ -// Mark current message as read and move to the next message. -void lib_ams::SkipMsg(lib_ams::FStream &stream) +// Read message by sequence number +ams::MsgHeader *lib_ams::ReadMsg(lib_ams::FReadfile &rf, u64 seqno) ``` ```c++ -int lib_ams::WriteBudget(lib_ams::FStream &stream) +// Reindex +void lib_ams::Reindex(lib_ams::FReadfile &rf) ``` ```c++ -// Send heartbeat to control stream -// Update -void lib_ams::SendHb(lib_ams::FStream &stream) +// Scan and block load engine. +// if seqno is NULL, scans to end, fills block with last block. +// If seqno is present, scans up to given seqno, reads cbuf with payload +// Note is does only forward scan. +void lib_ams::Scan(lib_ams::FReadfile &rf,const u64 *seqno) ``` ```c++ -// Publish stream heartbeats to c_stream_ctl stream -void lib_ams::cd_stream_hb_Step() +// Scan file up to end +void lib_ams::ScanToEnd(lib_ams::FReadfile &rf) ``` ```c++ -// Check all streams (that are not already readable) for readability. -// If readable, call h_msg hook. -void lib_ams::cd_poll_read_Step() +// Scan up to seqno, rewind if needed +void lib_ams::ScanToSeqno(lib_ams::FReadfile &rf, u64 seqno) ``` ```c++ -void lib_ams::PollCtlIn() +// Send heartbeat to control shm +void lib_ams::SendHb(lib_ams::FShmember &shmember) ``` ```c++ -// Begin writing message of length LENGTH -// Used by WriteMsg and with amc's pnew (acr pnew) for zero-copy sends. -// If successful, return pointer to region of size LENGTH whre the mssage can be written, -// otherwise return NULL. -void *lib_ams::BeginWrite(lib_ams::FStream &stream, int length) +void lib_ams::SetDfltShmSize(u32 size) ``` ```c++ -// Finish writing message of length LENGTH, -// and send the result. -void lib_ams::EndWrite(lib_ams::FStream &stream, void *ptr, int len) +// Register a bad, unskippable incoming message +// on SHM, report it, and stop reading. +void lib_ams::ShmError(lib_ams::FShm &shm, ams::Shmmsg *msg, const char *text) ``` ```c++ -// If the stream is attached to a writable shared memory segment, -// write sequenced message to stream STREAM, and increment sequence number -// and stream offset. -// Message must be within max. message size -// If the stream is not configured for writingIf an output fd is associated with the stream, hthe stream, write -bool lib_ams::WriteMsg(lib_ams::FStream &stream, ams::MsgHeader &msg) +// return TRUE if shared memory region is attached to shm SHM. +bool lib_ams::ShmemFdOpenQ(lib_ams::FShm &shm) ``` ```c++ -// Write message MSG to output, either in binary or text mode. -// Return success status -// If ISREAD flag is set, this is a copy of a message that has just been read -// from another stream. Otherwise, it's a copy of a message that's just been written. -// In stdin mode, where messages are read from ascii input and posted to the -void lib_ams::TraceMsg(lib_ams::FStream &stream, ams::MsgHeader &msg, bool isread) +// Open shared memory for reading/writing (as specified in FLAGS) +// and return success status +// Fields initialized: +// - shm.filename +// - shm.shm_handle (windows) +// - shm.shm_file (linux) +// - shm.shm_region, if mapped successfully +// If the segment is opened for writing, it is flocked. +bool lib_ams::ShmemOpenFile(lib_ams::FShm &shm, ams::ShmFlags flags) ``` ```c++ -// Initialize stream library -// FILE_PREFIX: unique filesystem prefix for all subsequently created streams -// Also clean any stale (unlocked) stream files. -// (this can be disabled by setting _db.stream_files_cleaned to true) -bool lib_ams::Init(algo::strptr file_prefix, ams::ProcId proc_id) +// Skip bytes +void lib_ams::Skip(lib_ams::FReadfile &rf,u32 skip) ``` ```c++ -void lib_ams::Uninit() +// Mark current message as read and move to the next message. +void lib_ams::SkipMsg(lib_ams::FShmember &shmember) ``` ```c++ -void lib_ams::shm_handle_Cleanup(lib_ams::FStream &stream) +// starts new message block - discard buffer, adjust seqno +void lib_ams::StartNextMsgBlock(lib_ams::FWritefile &wf) ``` ```c++ -void lib_ams::shm_file_Cleanup(lib_ams::FStream &stream) +// Called by the client +// to avoid reading current message +void lib_ams::StopReading(lib_ams::FShm &shm) ``` ```c++ -// Process joined the group -void lib_ams::CtlMsg_ProcAddMsg(ams::ProcAddMsg &msg) +// Convert message MSG to string in a way suitable for debugging +// (some information is lost in exchange for readability) +tempstr lib_ams::ToDbgString(ams::MsgHeader &msg) ``` ```c++ -// A process has exited -// Remove any read/write members contributed by the process and -// potentially unblock some write streams -void lib_ams::CtlMsg_ProcRemoveMsg(ams::ProcRemoveMsg &msg) +tempstr lib_ams::ToString(ams::MsgHeader &msg) ``` ```c++ -void lib_ams::CtlMsg_DumpStreamTableMsg(ams::DumpStreamTableMsg &msg) +// This function should be called if the ams logcat is enabled +// It prints the given MSG to ams logcat using pretty format. +// Heartbeats (ShmHb, MemberHb, PubMetric) are skipped unless verbose is on +void lib_ams::TraceMsg(ams::Shmmsg *msg, ams::MsgHeader *payload) ``` ```c++ -void lib_ams::CtlMsg_StreamHbMsg(ams::StreamHbMsg &msg) +// Uncompress +void lib_ams::Uncompress(lib_ams::FReadfile &rf) ``` ```c++ -void lib_ams::ReadCtlMsg(lib_ams::FStream &, ams::MsgHeader &msg) +void lib_ams::Uninit() ``` ```c++ -// Read next input line from stdin -void lib_ams::cd_fdin_read_Step() +void lib_ams::UnreadMsg() ``` ```c++ -// Stop reading stdin -void lib_ams::cd_fdin_eof_Step() +// next_ackoff is the read offset at which an unconditional +// Shmhb is sent out. It is enabled when the shm is being read. +inline void lib_ams::UpdateAckOffset(lib_ams::FShm &shm, lib_ams::FShmember &shmember) ``` ```c++ -// Begin reading ams control messages from stdin -void lib_ams::BeginReadStdin() +// Update budget for shm SHM +// Return TRUE if the shm is potentially unblocked for +// writing due to WRITELIMIT being increased. +// (WRITELIMIT is the point beyond which no message can be written +// because doing so would overwrite data not yet consumed by one of the read members.) +bool lib_ams::UpdateWriteLimit(lib_ams::FShm &shm) ``` ```c++ -lib_ams::FStream &lib_ams::ind_stream_GetOrCreate(ams::StreamId stream_id) +// If the shm is attached to a writable shared memory segment, +// write sequenced message to shm SHM, and increment sequence number +// and shm offset. +// Message must be within max. message size +// If the shm is not configured for writingIf an output fd is associated with the shm, hthe shm, write +bool lib_ams::WriteMsg(lib_ams::FShm &shm, ams::MsgHeader &msg) ``` ```c++ -void lib_ams::DumpStreamTableDflt() +// Write message (buffered) +void lib_ams::WriteMsg(lib_ams::FWritefile &wf, ams::MsgHeader &msg) ``` ```c++ -void lib_ams::DumpStreamTableVisual() +// Write message block to file +void lib_ams::WriteMsgBlock(lib_ams::FWritefile &wf) ``` ```c++ -void lib_ams::DumpStreamTable(int format = 0) +// Read up to N messages from the message heap +// Messages are processed in the order in which they were posted to the shms. +void lib_ams::bh_shmember_read_Step() ``` ```c++ -// Close stream. -// If stream is opened for writing, remove its file. -// BUG: I think if the stream is opened for reading, the mmap() leaks -void lib_ams::Close(lib_ams::FStream &stream) +// Stop reading stdin +void lib_ams::cd_fdin_eof_Step() ``` ```c++ -void lib_ams::SetDfltShmSize(u32 size) +// Read next input line from stdin +// The line is parsed as an AMS message. It could be a Shmmsg or any other msg. +// If the line doesn't look like anything, it is converted to ams.InputLineMsg +// Then, look up a shm where to post the message. +// If we see a Shmmsg, find shm where this message is intended to go and write the message there. +// Otherwise, post the message to the default shm (lib_ams::_db.dflt_shm_id) +// If the shm where we are posting the message is full (won't accept the message) +// then reading of fdin is stopped and will resume after the shm has room. +// If there is nowhere to post the message because no target shm is found, the counter +// trace.n_fdin_drop_notgt is incremented and a message is printed in verbose mode. +void lib_ams::cd_fdin_read_Step() ``` ```c++ -ams::StreamPos lib_ams::ReadStreamPos(algo::strptr val) +// Publish shm heartbeats to c_shm_ctl shm +void lib_ams::cd_hb_Step() ``` ```c++ -// Register PROC_ID as reader of stream STREAM_ID starting at offset 0 -// This immediately limits the write budget of STREAM_ID -// (Subsequent attempt to overwrite data not yet consumed by PROC_ID causes -// either reject or blocking wait) -void lib_ams::AddReadMember(ams::ProcId proc_id, ams::StreamId stream_id) +// Check all shms (that are not already readable) for readability and +// transfer readable shms to the read heap with correct sort key. +// If powersave is enabled, then non-readable shms +// are transferred to the slow_poll_read list where they are polled less frequently +void lib_ams::cd_poll_read_Step() ``` ```c++ -// Open stream STREAM for reading and add it to the list of streams -// which lib_ams scans for messages (i.e. control streams). -// Attach lib_ams message dispatch to the stream -bool lib_ams::AddCtlIn(lib_ams::FStream &stream) +void lib_ams::cd_slow_poll_read_Step() ``` ```c++ -void lib_ams::CloseAllStreams() +// cleanup function +void lib_ams::fd_Cleanup(lib_ams::FReadfile& parent) ``` ```c++ -// Match trace expression REGX against stream STREAM. -// If it matches, enable/disable tracing as indicated by ENABLE -// For full description see txt/trace.md -bool lib_ams::ApplyTrace(lib_ams::FStream &stream, algo_lib::Regx ®x, bool enable) +// cleanup function +void lib_ams::fd_Cleanup(lib_ams::FWritefile& parent) ``` ```c++ -// Enable or disable logcat tracing based on regex WHAT -// If TRACE is specified, logcats matching regex are enabled; otherwise -// they are disabled. -// This affects all future `prlog_cat` calls. -// Return number of matches -int lib_ams::ApplyTrace(algo::strptr what, bool enable) +lib_ams::FShm &lib_ams::ind_shm_GetOrCreate(ams::ShmId shm_id) ``` ```c++ -// Same as ApplyTrace, but -// If expression doesn't match anything, print a helpful message for the user -void lib_ams::ApplyTraceV(algo::strptr what, bool enable) +void lib_ams::shm_file_Cleanup(lib_ams::FShm &shm) ``` ```c++ -// prlog hook for ams application, could be used for sending log messages to output stream -void lib_ams::Prlog(algo_lib::FLogcat *logcat, algo::SchedTime tstamp, strptr str) +// Flush data to file +void lib_ams::zd_flush_Step() ``` @@ -807,12 +657,14 @@ The following source files are part of this tool: |Source File|Comment| |---|---| |[cpp/gen/lib_ams_gen.cpp](/cpp/gen/lib_ams_gen.cpp)|| -|[cpp/lib_ams/expect.cpp](/cpp/lib_ams/expect.cpp)|Expect implementation| +|[cpp/lib_ams/dump.cpp](/cpp/lib_ams/dump.cpp)|| |[cpp/lib_ams/file.cpp](/cpp/lib_ams/file.cpp)|| -|[cpp/lib_ams/stream.cpp](/cpp/lib_ams/stream.cpp)|| +|[cpp/lib_ams/shm.cpp](/cpp/lib_ams/shm.cpp)|| +|[cpp/lib_ams/shmember.cpp](/cpp/lib_ams/shmember.cpp)|| |[include/gen/lib_ams_gen.h](/include/gen/lib_ams_gen.h)|| |[include/gen/lib_ams_gen.inl.h](/include/gen/lib_ams_gen.inl.h)|| |[include/lib_ams.h](/include/lib_ams.h)|| +|[include/lib_ams.inl.h](/include/lib_ams.inl.h)|| @@ -836,17 +688,22 @@ All allocations are done through global `lib_ams::_db` [lib_ams.FDb](#lib_ams-fd |---|---|---|---| |[lib_ams.FDb](#lib_ams-fdb)||FDb._db (Global)| |[lib_ams.FFdin](#lib_ams-ffdin)||FDb.fdin (Lary)|fdin (Lary, by rowid)|cd_fdin_eof (Llist)|cd_fdin_read (Llist)| -|[lib_ams.FMember](#lib_ams-fmember)||FDb.member (Tpool)|ind_member (Thash, hash field member)| -||||FProc.zd_member_byproc (Llist)| -||||FStream.zd_member_bystream (Llist)| -|[lib_ams.FProc](#lib_ams-fproc)||FDb.proc (Tpool)|ind_proc (Thash, hash field proc_id)|zd_proc (Llist)| -||||FMember.p_proc (Upptr)| +|[lib_ams.FProc](#lib_ams-fproc)||FDb.proc (Tpool)|ind_proc (Thash, hash field proc_id)|zd_proc (Llist)|c_thisproc (Ptr)| +||||FShmember.p_proc (Upptr)| |[lib_ams.FReadfile](#lib_ams-freadfile)|| -|[lib_ams.FStream](#lib_ams-fstream)||FDb.stream (Lary)|stream (Lary, by rowid)|ind_stream (Thash, hash field stream_id)|cd_stream_hb (Llist)|cd_poll_read (Llist)|zd_ctlin (Llist)|c_stream_ctl (Ptr)|c_stream_out (Ptr)| -||||FMember.p_stream (Upptr)| -|[lib_ams.FStreamType](#lib_ams-fstreamtype)|[amsdb.streamtype](/txt/ssimdb/amsdb/streamtype.md)|FDb.streamtype (Lary)|**static**|streamtype (Lary, by rowid)|ind_streamtype (Thash, hash field id)| -||||FStream.p_streamtype (Upptr)| +|[lib_ams.FShm](#lib_ams-fshm)||FDb.shm (Lary)|shm (Lary, by rowid)|ind_shm (Thash, hash field shm_id)|c_shm_ctl (Ptr)| +||||FProc.c_shm (Ptrary)| +||||FShmember.p_shm (Upptr)| +|[lib_ams.FShmember](#lib_ams-fshmember)||FDb.shmember (Tpool)|cd_hb (Llist)|cd_poll_read (Llist)|cd_slow_poll_read (Llist)|ind_shmember (Thash, hash field shmember)|c_ctlin (Ptrary)|c_cur_shmember (Ptr)|bh_shmember_read (Bheap, sort field sortkey)| +||||FProc.c_shmember (Ptrary)| +||||FShm.c_shmember (Ptrary)| +||||FShm.c_read (Ptr)| +||||FShm.c_write (Ptr)| +|[lib_ams.FShmtype](#lib_ams-fshmtype)|[amsdb.shmtype](/txt/ssimdb/amsdb/shmtype.md)|FDb.shmtype (Lary)|**static**|shmtype (Lary, by rowid)|ind_shmtype (Thash, hash field id)| +||||FShm.p_shmtype (Upptr)| |[lib_ams.FWritefile](#lib_ams-fwritefile)||FDb.writefile (Cppstack)|zd_flush (Llist)| +|[lib_ams.MsgFmt](#lib_ams-msgfmt)|| +||||MsgFmt.h_convert (Hook)| #### lib_ams.FDb - In-memory database for lib_ams @@ -861,102 +718,111 @@ All allocations are done through global `lib_ams::_db` [lib_ams.FDb](#lib_ams-fd |lib_ams.FDb._db|[lib_ams.FDb](/txt/lib/lib_ams/README.md#lib_ams-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| |lib_ams.FDb.writefile|[lib_ams.FWritefile](/txt/lib/lib_ams/README.md#lib_ams-fwritefile)|[Cppstack](/txt/exe/amc/reftypes.md#cppstack)||Provides default name for variables of this type| |lib_ams.FDb.zd_flush|[lib_ams.FWritefile](/txt/lib/lib_ams/README.md#lib_ams-fwritefile)|[Llist](/txt/exe/amc/reftypes.md#llist)||| -|lib_ams.FDb.stream|[lib_ams.FStream](/txt/lib/lib_ams/README.md#lib_ams-fstream)|[Lary](/txt/exe/amc/reftypes.md#lary)||Table of streams| -|lib_ams.FDb.ind_stream|[lib_ams.FStream](/txt/lib/lib_ams/README.md#lib_ams-fstream)|[Thash](/txt/exe/amc/reftypes.md#thash)||Index of streams by stream id| -|lib_ams.FDb.cd_stream_hb|[lib_ams.FStream](/txt/lib/lib_ams/README.md#lib_ams-fstream)|[Llist](/txt/exe/amc/reftypes.md#llist)||| +|lib_ams.FDb.shm|[lib_ams.FShm](/txt/lib/lib_ams/README.md#lib_ams-fshm)|[Lary](/txt/exe/amc/reftypes.md#lary)||Table of streams| +|lib_ams.FDb.ind_shm|[lib_ams.FShm](/txt/lib/lib_ams/README.md#lib_ams-fshm)|[Thash](/txt/exe/amc/reftypes.md#thash)||Index of streams by stream id| +|lib_ams.FDb.cd_hb|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Llist](/txt/exe/amc/reftypes.md#llist)||Send heartbeats (per-member)| |lib_ams.FDb.proc_id|[ams.ProcId](/txt/protocol/ams/ProcId.md)|[Val](/txt/exe/amc/reftypes.md#val)||Process id, e.g. amstest-0| |lib_ams.FDb.shmem_size|i32|[Val](/txt/exe/amc/reftypes.md#val)|32768|Default stream shared memory size| -|lib_ams.FDb.max_msg_size|i32|[Val](/txt/exe/amc/reftypes.md#val)|4096|Maximum message size| -|lib_ams.FDb.cd_poll_read|[lib_ams.FStream](/txt/lib/lib_ams/README.md#lib_ams-fstream)|[Llist](/txt/exe/amc/reftypes.md#llist)||Hot poll input stream for reading| +|lib_ams.FDb.max_msg_size|i32|[Val](/txt/exe/amc/reftypes.md#val)|4096|Max. size| +|lib_ams.FDb.cd_poll_read|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Llist](/txt/exe/amc/reftypes.md#llist)||Hot poll input stream for reading| +|lib_ams.FDb.cd_slow_poll_read|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Llist](/txt/exe/amc/reftypes.md#llist)||Cold poll input stream for reading| |lib_ams.FDb.file_prefix|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|File prefix for all streams| |lib_ams.FDb.proc|[lib_ams.FProc](/txt/lib/lib_ams/README.md#lib_ams-fproc)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||| |lib_ams.FDb.ind_proc|[lib_ams.FProc](/txt/lib/lib_ams/README.md#lib_ams-fproc)|[Thash](/txt/exe/amc/reftypes.md#thash)||| -|lib_ams.FDb.member|[lib_ams.FMember](/txt/lib/lib_ams/README.md#lib_ams-fmember)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||| -|lib_ams.FDb.ind_member|[lib_ams.FMember](/txt/lib/lib_ams/README.md#lib_ams-fmember)|[Thash](/txt/exe/amc/reftypes.md#thash)||| -|lib_ams.FDb.streamtype|[lib_ams.FStreamType](/txt/lib/lib_ams/README.md#lib_ams-fstreamtype)|[Lary](/txt/exe/amc/reftypes.md#lary)||| -|lib_ams.FDb.ind_streamtype|[lib_ams.FStreamType](/txt/lib/lib_ams/README.md#lib_ams-fstreamtype)|[Thash](/txt/exe/amc/reftypes.md#thash)||| -|lib_ams.FDb.zd_ctlin|[lib_ams.FStream](/txt/lib/lib_ams/README.md#lib_ams-fstream)|[Llist](/txt/exe/amc/reftypes.md#llist)||| -|lib_ams.FDb.stream_files_cleaned|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_ams.FDb.shmember|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||| +|lib_ams.FDb.ind_shmember|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|lib_ams.FDb.shmtype|[lib_ams.FShmtype](/txt/lib/lib_ams/README.md#lib_ams-fshmtype)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|lib_ams.FDb.ind_shmtype|[lib_ams.FShmtype](/txt/lib/lib_ams/README.md#lib_ams-fshmtype)|[Thash](/txt/exe/amc/reftypes.md#thash)||| +|lib_ams.FDb.c_ctlin|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| +|lib_ams.FDb.shm_files_cleaned|bool|[Val](/txt/exe/amc/reftypes.md#val)||| |lib_ams.FDb.shmem_mode|bool|[Val](/txt/exe/amc/reftypes.md#val)||| |lib_ams.FDb.fdin_buf|[algo.ByteAry](/txt/protocol/algo/README.md#algo-byteary)|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FDb.dflt_stream_id|[ams.StreamId](/txt/protocol/ams/StreamId.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_ams.FDb.dflt_shm_id|[ams.ShmId](/txt/protocol/ams/README.md#ams-shmid)|[Val](/txt/exe/amc/reftypes.md#val)||| |lib_ams.FDb.zd_proc|[lib_ams.FProc](/txt/lib/lib_ams/README.md#lib_ams-fproc)|[Llist](/txt/exe/amc/reftypes.md#llist)||| -|lib_ams.FDb.c_stream_ctl|[lib_ams.FStream](/txt/lib/lib_ams/README.md#lib_ams-fstream)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Ctl output stream (process events)| +|lib_ams.FDb.c_shm_ctl|[lib_ams.FShm](/txt/lib/lib_ams/README.md#lib_ams-fshm)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Ctl output shm (process events)| |lib_ams.FDb.expect_buf|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Buffer containing outputs produced since last input| |lib_ams.FDb.expect_str|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||If non-empty, pause reading inputs until this string is non-empty| -|lib_ams.FDb.th_expect|[algo_lib.FTimehook](/txt/lib/algo_lib/README.md#algo_lib-ftimehook)|[Val](/txt/exe/amc/reftypes.md#val)||Timeout for expect message| |lib_ams.FDb.expect_pos|i32|[Val](/txt/exe/amc/reftypes.md#val)||Match position within expect buf| |lib_ams.FDb.expect_timeout|double|[Val](/txt/exe/amc/reftypes.md#val)|10.0|Default expect timeout| |lib_ams.FDb.fmt_buf|[algo.ByteAry](/txt/protocol/algo/README.md#algo-byteary)|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FDb.regx_trace|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)||Regx of streams to trace| -|lib_ams.FDb.c_stream_out|[lib_ams.FStream](/txt/lib/lib_ams/README.md#lib_ams-fstream)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Output stream| +|lib_ams.FDb.c_cur_shmember|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||lib_ams message read callback context| +|lib_ams.FDb.bh_shmember_read|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Bheap](/txt/exe/amc/reftypes.md#bheap)||| +|lib_ams.FDb.c_thisproc|[lib_ams.FProc](/txt/lib/lib_ams/README.md#lib_ams-fproc)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| +|lib_ams.FDb.powersave|bool|[Val](/txt/exe/amc/reftypes.md#val)||| #### Struct FDb Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ams_gen.h](/include/gen/lib_ams_gen.h) ``` struct FDb { // lib_ams.FDb: In-memory database for lib_ams - lib_ams::FFdin* fdin_lary[32]; // level array - i32 fdin_n; // number of elements in array - lib_ams::FFdin* cd_fdin_eof_head; // zero-terminated doubly linked list - i32 cd_fdin_eof_n; // zero-terminated doubly linked list - lib_ams::FFdin* cd_fdin_read_head; // zero-terminated doubly linked list - i32 cd_fdin_read_n; // zero-terminated doubly linked list - lib_ams::FWritefile* zd_flush_head; // zero-terminated doubly linked list - i32 zd_flush_n; // zero-terminated doubly linked list - lib_ams::FWritefile* zd_flush_tail; // pointer to last element - algo::SchedTime zd_flush_next; // lib_ams.FDb.zd_flush Next invocation time - algo::SchedTime zd_flush_delay; // lib_ams.FDb.zd_flush Delay between invocations - lib_ams::FStream* stream_lary[32]; // level array - i32 stream_n; // number of elements in array - lib_ams::FStream** ind_stream_buckets_elems; // pointer to bucket array - i32 ind_stream_buckets_n; // number of elements in bucket array - i32 ind_stream_n; // number of elements in the hash table - lib_ams::FStream* cd_stream_hb_head; // zero-terminated doubly linked list - i32 cd_stream_hb_n; // zero-terminated doubly linked list - algo::SchedTime cd_stream_hb_next; // lib_ams.FDb.cd_stream_hb Next invocation time - algo::SchedTime cd_stream_hb_delay; // lib_ams.FDb.cd_stream_hb Delay between invocations - ams::ProcId proc_id; // Process id, e.g. amstest-0 - i32 shmem_size; // 32768 Default stream shared memory size - i32 max_msg_size; // 4096 Maximum message size - lib_ams::FStream* cd_poll_read_head; // zero-terminated doubly linked list - i32 cd_poll_read_n; // zero-terminated doubly linked list - algo::cstring file_prefix; // "" File prefix for all streams - u64 proc_blocksize; // # bytes per block - lib_ams::FProc* proc_free; // - lib_ams::FProc** ind_proc_buckets_elems; // pointer to bucket array - i32 ind_proc_buckets_n; // number of elements in bucket array - i32 ind_proc_n; // number of elements in the hash table - u64 member_blocksize; // # bytes per block - lib_ams::FMember* member_free; // - lib_ams::FMember** ind_member_buckets_elems; // pointer to bucket array - i32 ind_member_buckets_n; // number of elements in bucket array - i32 ind_member_n; // number of elements in the hash table - lib_ams::FStreamType* streamtype_lary[32]; // level array - i32 streamtype_n; // number of elements in array - lib_ams::FStreamType** ind_streamtype_buckets_elems; // pointer to bucket array - i32 ind_streamtype_buckets_n; // number of elements in bucket array - i32 ind_streamtype_n; // number of elements in the hash table - lib_ams::FStream* zd_ctlin_head; // zero-terminated doubly linked list - i32 zd_ctlin_n; // zero-terminated doubly linked list - lib_ams::FStream* zd_ctlin_tail; // pointer to last element - bool stream_files_cleaned; // false - bool shmem_mode; // false - algo::ByteAry fdin_buf; // - ams::StreamId dflt_stream_id; // - lib_ams::FProc* zd_proc_head; // zero-terminated doubly linked list - i32 zd_proc_n; // zero-terminated doubly linked list - lib_ams::FProc* zd_proc_tail; // pointer to last element - lib_ams::FStream* c_stream_ctl; // Ctl output stream (process events). optional pointer - algo::cstring expect_buf; // Buffer containing outputs produced since last input - algo::cstring expect_str; // If non-empty, pause reading inputs until this string is non-empty - algo_lib::FTimehook th_expect; // Timeout for expect message - i32 expect_pos; // 0 Match position within expect buf - double expect_timeout; // 10.0 Default expect timeout - algo::ByteAry fmt_buf; // - algo_lib::Regx regx_trace; // Sql Regx - lib_ams::FStream* c_stream_out; // Output stream. optional pointer - lib_ams::trace trace; // + lib_ams::FFdin* fdin_lary[32]; // level array + i32 fdin_n; // number of elements in array + lib_ams::FFdin* cd_fdin_eof_head; // zero-terminated doubly linked list + i32 cd_fdin_eof_n; // zero-terminated doubly linked list + lib_ams::FFdin* cd_fdin_read_head; // zero-terminated doubly linked list + i32 cd_fdin_read_n; // zero-terminated doubly linked list + lib_ams::FWritefile* zd_flush_head; // zero-terminated doubly linked list + i32 zd_flush_n; // zero-terminated doubly linked list + lib_ams::FWritefile* zd_flush_tail; // pointer to last element + algo::SchedTime zd_flush_next; // lib_ams.FDb.zd_flush Next invocation time + algo::SchedTime zd_flush_delay; // lib_ams.FDb.zd_flush Delay between invocations + lib_ams::FShm* shm_lary[32]; // level array + i32 shm_n; // number of elements in array + lib_ams::FShm** ind_shm_buckets_elems; // pointer to bucket array + i32 ind_shm_buckets_n; // number of elements in bucket array + i32 ind_shm_n; // number of elements in the hash table + lib_ams::FShmember* cd_hb_head; // zero-terminated doubly linked list + i32 cd_hb_n; // zero-terminated doubly linked list + algo::SchedTime cd_hb_next; // lib_ams.FDb.cd_hb Next invocation time + algo::SchedTime cd_hb_delay; // lib_ams.FDb.cd_hb Delay between invocations + ams::ProcId proc_id; // Process id, e.g. amstest-0 + i32 shmem_size; // 32768 Default stream shared memory size + i32 max_msg_size; // 4096 Max. size + lib_ams::FShmember* cd_poll_read_head; // zero-terminated doubly linked list + i32 cd_poll_read_n; // zero-terminated doubly linked list + lib_ams::FShmember* cd_slow_poll_read_head; // zero-terminated doubly linked list + i32 cd_slow_poll_read_n; // zero-terminated doubly linked list + algo::SchedTime cd_slow_poll_read_next; // lib_ams.FDb.cd_slow_poll_read Next invocation time + algo::SchedTime cd_slow_poll_read_delay; // lib_ams.FDb.cd_slow_poll_read Delay between invocations + algo::cstring file_prefix; // "" File prefix for all streams + u64 proc_blocksize; // # bytes per block + lib_ams::FProc* proc_free; // + lib_ams::FProc** ind_proc_buckets_elems; // pointer to bucket array + i32 ind_proc_buckets_n; // number of elements in bucket array + i32 ind_proc_n; // number of elements in the hash table + u64 shmember_blocksize; // # bytes per block + lib_ams::FShmember* shmember_free; // + lib_ams::FShmember** ind_shmember_buckets_elems; // pointer to bucket array + i32 ind_shmember_buckets_n; // number of elements in bucket array + i32 ind_shmember_n; // number of elements in the hash table + lib_ams::FShmtype* shmtype_lary[32]; // level array + i32 shmtype_n; // number of elements in array + lib_ams::FShmtype** ind_shmtype_buckets_elems; // pointer to bucket array + i32 ind_shmtype_buckets_n; // number of elements in bucket array + i32 ind_shmtype_n; // number of elements in the hash table + lib_ams::FShmember** c_ctlin_elems; // array of pointers + u32 c_ctlin_n; // array of pointers + u32 c_ctlin_max; // capacity of allocated array + bool shm_files_cleaned; // false + bool shmem_mode; // false + algo::ByteAry fdin_buf; // + ams::ShmId dflt_shm_id; // + lib_ams::FProc* zd_proc_head; // zero-terminated doubly linked list + i32 zd_proc_n; // zero-terminated doubly linked list + lib_ams::FProc* zd_proc_tail; // pointer to last element + lib_ams::FShm* c_shm_ctl; // Ctl output shm (process events). optional pointer + algo::cstring expect_buf; // Buffer containing outputs produced since last input + algo::cstring expect_str; // If non-empty, pause reading inputs until this string is non-empty + i32 expect_pos; // 0 Match position within expect buf + double expect_timeout; // 10.0 Default expect timeout + algo::ByteAry fmt_buf; // + lib_ams::FShmember* c_cur_shmember; // lib_ams message read callback context. optional pointer + lib_ams::FShmember** bh_shmember_read_elems; // binary heap by sortkey + i32 bh_shmember_read_n; // number of elements in the heap + i32 bh_shmember_read_max; // max elements in bh_shmember_read_elems + lib_ams::FProc* c_thisproc; // optional pointer + bool powersave; // false + lib_ams::trace trace; // }; ``` @@ -980,16 +846,16 @@ struct FFdin { // lib_ams.FFdin: FD input (normally stdin) lib_ams::FFdin* cd_fdin_read_next; // zslist link; -1 means not-in-list lib_ams::FFdin* cd_fdin_read_prev; // previous element algo_lib::FIohook iohook; // - u8 in_elems[8192]; // pointer to elements of inline array + u8* in_elems; // NULL pointer to elements of indirect array + u32 in_max; // 0 current length of allocated array i32 in_start; // beginning of valid bytes (in bytes) i32 in_end; // end of valid bytes (in bytes) - bool in_eof; // no more data will be written to buffer + i32 in_msglen; // current message length algo::Errcode in_err; // system error code + algo_lib::FIohook in_iohook; // edge-triggered hook for the buffer + bool in_eof; // no more data will be written to buffer bool in_msgvalid; // current message is valid - i32 in_msglen; // current message length - algo_lib::FIohook in_iohook; // edge-triggered hook for refilling buffer bool in_epoll_enable; // use epoll? - enum { in_max = 8192 }; // value field lib_ams.FFdin.iohook is not copiable // field lib_ams.FFdin.in prevents copy // func:lib_ams.FFdin..AssignOp @@ -1010,56 +876,6 @@ private: }; ``` -#### lib_ams.FMember - - - -#### lib_ams.FMember Fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|lib_ams.FMember.member|[ams.Member](/txt/protocol/ams/Member.md)|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FMember.pos|[ams.StreamPos](/txt/protocol/ams/StreamPos.md)|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FMember.last_hb|[algo.UnTime](/txt/protocol/algo/UnTime.md)|[Val](/txt/exe/amc/reftypes.md#val)||Time last heartbeat received| -|lib_ams.FMember.budget|u32|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FMember.p_stream|[lib_ams.FStream](/txt/lib/lib_ams/README.md#lib_ams-fstream)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| -|lib_ams.FMember.p_proc|[lib_ams.FProc](/txt/lib/lib_ams/README.md#lib_ams-fproc)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| - -#### Struct FMember - -Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ams_gen.h](/include/gen/lib_ams_gen.h) -``` -struct FMember { // lib_ams.FMember - lib_ams::FMember* member_next; // Pointer to next free element int tpool - lib_ams::FMember* ind_member_next; // hash next - ams::Member member; // - ams::StreamPos pos; // - algo::UnTime last_hb; // Time last heartbeat received - u32 budget; // 0 - lib_ams::FStream* p_stream; // reference to parent row - lib_ams::FProc* p_proc; // reference to parent row - lib_ams::FMember* zd_member_byproc_next; // zslist link; -1 means not-in-list - lib_ams::FMember* zd_member_byproc_prev; // previous element - lib_ams::FMember* zd_member_bystream_next; // zslist link; -1 means not-in-list - lib_ams::FMember* zd_member_bystream_prev; // previous element - // x-reference on lib_ams.FMember.p_stream prevents copy - // x-reference on lib_ams.FMember.p_proc prevents copy - // func:lib_ams.FMember..AssignOp - inline lib_ams::FMember& operator =(const lib_ams::FMember &rhs) = delete; - // x-reference on lib_ams.FMember.p_stream prevents copy - // x-reference on lib_ams.FMember.p_proc prevents copy - // func:lib_ams.FMember..CopyCtor - inline FMember(const lib_ams::FMember &rhs) = delete; -private: - // func:lib_ams.FMember..Ctor - inline FMember() __attribute__((nothrow)); - // func:lib_ams.FMember..Dtor - inline ~FMember() __attribute__((nothrow)); - friend lib_ams::FMember& member_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend lib_ams::FMember* member_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void member_Delete(lib_ams::FMember &row) __attribute__((nothrow)); -}; -``` - #### lib_ams.FProc - @@ -1067,38 +883,41 @@ private: |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|lib_ams.FProc.proc_id|[ams.ProcId](/txt/protocol/ams/ProcId.md)|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FProc.zd_member_byproc|[lib_ams.FMember](/txt/lib/lib_ams/README.md#lib_ams-fmember)|[Llist](/txt/exe/amc/reftypes.md#llist)||| -|lib_ams.FProc.pid|i32|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FProc.status|i32|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FProc.logbuf|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FProc.hbtimeout|u32|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FProc.critical|bool|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FProc.realtime|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_ams.FProc.proc_id|[ams.ProcId](/txt/protocol/ams/ProcId.md)|[Val](/txt/exe/amc/reftypes.md#val)||Unique ID| +|lib_ams.FProc.c_shm|[lib_ams.FShm](/txt/lib/lib_ams/README.md#lib_ams-fshm)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||| +|lib_ams.FProc.c_shmember|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||List of AMS shm readers/writers at this proc| +|lib_ams.FProc.pid|i32|[Val](/txt/exe/amc/reftypes.md#val)||Current PID| +|lib_ams.FProc.status|i32|[Val](/txt/exe/amc/reftypes.md#val)||Exit status| +|lib_ams.FProc.hbtimeout|u32|[Val](/txt/exe/amc/reftypes.md#val)||Heartbeat timeout| +|lib_ams.FProc.critical|bool|[Val](/txt/exe/amc/reftypes.md#val)||Exit if process dies?| #### Struct FProc Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ams_gen.h](/include/gen/lib_ams_gen.h) ``` struct FProc { // lib_ams.FProc - lib_ams::FProc* proc_next; // Pointer to next free element int tpool - lib_ams::FProc* ind_proc_next; // hash next - lib_ams::FProc* zd_proc_next; // zslist link; -1 means not-in-list - lib_ams::FProc* zd_proc_prev; // previous element - ams::ProcId proc_id; // - lib_ams::FMember* zd_member_byproc_head; // zero-terminated doubly linked list - i32 zd_member_byproc_n; // zero-terminated doubly linked list - lib_ams::FMember* zd_member_byproc_tail; // pointer to last element - i32 pid; // 0 - i32 status; // 0 - algo::cstring logbuf; // - u32 hbtimeout; // 0 - bool critical; // false - bool realtime; // false - // reftype Llist of lib_ams.FProc.zd_member_byproc prohibits copy + lib_ams::FProc* proc_next; // Pointer to next free element int tpool + lib_ams::FProc* ind_proc_next; // hash next + u32 ind_proc_hashval; // hash value + lib_ams::FProc* zd_proc_next; // zslist link; -1 means not-in-list + lib_ams::FProc* zd_proc_prev; // previous element + ams::ProcId proc_id; // Unique ID + lib_ams::FShm** c_shm_elems; // array of pointers + u32 c_shm_n; // array of pointers + u32 c_shm_max; // capacity of allocated array + lib_ams::FShmember** c_shmember_elems; // array of pointers + u32 c_shmember_n; // array of pointers + u32 c_shmember_max; // capacity of allocated array + i32 pid; // 0 Current PID + i32 status; // 0 Exit status + u32 hbtimeout; // 0 Heartbeat timeout + bool critical; // false Exit if process dies? + // reftype Ptrary of lib_ams.FProc.c_shm prohibits copy + // reftype Ptrary of lib_ams.FProc.c_shmember prohibits copy // func:lib_ams.FProc..AssignOp inline lib_ams::FProc& operator =(const lib_ams::FProc &rhs) = delete; - // reftype Llist of lib_ams.FProc.zd_member_byproc prohibits copy + // reftype Ptrary of lib_ams.FProc.c_shm prohibits copy + // reftype Ptrary of lib_ams.FProc.c_shmember prohibits copy // func:lib_ams.FProc..CopyCtor inline FProc(const lib_ams::FProc &rhs) = delete; private: @@ -1158,129 +977,186 @@ struct FReadfile { // lib_ams.FReadfile }; ``` -#### lib_ams.FStream - Stream record - +#### lib_ams.FShm - Shm record + -#### lib_ams.FStream Fields - +#### lib_ams.FShm Fields + |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|lib_ams.FStream.stream_id|[ams.StreamId](/txt/protocol/ams/StreamId.md)|[Val](/txt/exe/amc/reftypes.md#val)||Stream ID (primary key)| -|lib_ams.FStream.filename|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Name of the file (if opened)| -|lib_ams.FStream.shm_file|[algo_lib.FFildes](/txt/lib/algo_lib/README.md#algo_lib-ffildes)|[Val](/txt/exe/amc/reftypes.md#val)||Associated file| -|lib_ams.FStream.flags|[ams.StreamFlags](/txt/protocol/ams/StreamFlags.md)|[Val](/txt/exe/amc/reftypes.md#val)||Is stream open for writing| -|lib_ams.FStream.byteary|[algo.ByteAry](/txt/protocol/algo/README.md#algo-byteary)|[Val](/txt/exe/amc/reftypes.md#val)||Substitute for shm_region| -|lib_ams.FStream.shm_handle|u8|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Associated memory segment handle (windows only)| -|lib_ams.FStream.rpos|[ams.StreamPos](/txt/protocol/ams/StreamPos.md)|[Val](/txt/exe/amc/reftypes.md#val)||Read position| -|lib_ams.FStream.wpos|[ams.StreamPos](/txt/protocol/ams/StreamPos.md)|[Val](/txt/exe/amc/reftypes.md#val)||Write position| -|lib_ams.FStream.shm_region|[algo.memptr](/txt/protocol/algo/memptr.md)|[Val](/txt/exe/amc/reftypes.md#val)||Shared memory region| -|lib_ams.FStream.limit|u64|[Val](/txt/exe/amc/reftypes.md#val)||Updated with ackoff, limit for nextoff| -|lib_ams.FStream.offset_mask|u64|[Val](/txt/exe/amc/reftypes.md#val)||Mask for byte eof| -|lib_ams.FStream.cur_msg|[ams.Seqmsg](/txt/protocol/ams/Seqmsg.md)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Current message| -|lib_ams.FStream.h_msg|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Hook](/txt/exe/amc/reftypes.md#hook)||Message processing hook| -|lib_ams.FStream.h_msg_orig|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Hook](/txt/exe/amc/reftypes.md#hook)||Saved message processing hook (EXPECT)| -|lib_ams.FStream.zd_member_bystream|[lib_ams.FMember](/txt/lib/lib_ams/README.md#lib_ams-fmember)|[Llist](/txt/exe/amc/reftypes.md#llist)||| -|lib_ams.FStream.next_ackoff|u64|[Val](/txt/exe/amc/reftypes.md#val)|1023|Force StreamHb after reaching this offset| -|lib_ams.FStream.p_streamtype|[lib_ams.FStreamType](/txt/lib/lib_ams/README.md#lib_ams-fstreamtype)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| -|lib_ams.FStream.n_write_block|u32|[Val](/txt/exe/amc/reftypes.md#val)||| -|lib_ams.FStream.burst|i32|[Val](/txt/exe/amc/reftypes.md#val)|20|Max number of messages processed at once| -|lib_ams.FStream.writer_error|bool|[Val](/txt/exe/amc/reftypes.md#val)||Writer error was detected| - -#### Struct FStream - +|lib_ams.FShm.shm_id|[ams.ShmId](/txt/protocol/ams/README.md#ams-shmid)|[Val](/txt/exe/amc/reftypes.md#val)||Stream ID (primary key)| +|lib_ams.FShm.c_shmember|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Ptrary](/txt/exe/amc/reftypes.md#ptrary)||List of all read/write members| +|lib_ams.FShm.filename|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Name of the file (if opened)| +|lib_ams.FShm.shm_file|[algo_lib.FFildes](/txt/lib/algo_lib/README.md#algo_lib-ffildes)|[Val](/txt/exe/amc/reftypes.md#val)||Associated file| +|lib_ams.FShm.flags|[ams.ShmFlags](/txt/protocol/ams/README.md#ams-shmflags)|[Val](/txt/exe/amc/reftypes.md#val)||Is stream open for writing| +|lib_ams.FShm.shm_handle|u8|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Associated memory segment handle (windows only)| +|lib_ams.FShm.c_read|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||This process| +|lib_ams.FShm.c_write|[lib_ams.FShmember](/txt/lib/lib_ams/README.md#lib_ams-fshmember)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||This process| +|lib_ams.FShm.shm_region|[algo.memptr](/txt/protocol/algo/memptr.md)|[Val](/txt/exe/amc/reftypes.md#val)||Shared memory region| +|lib_ams.FShm.writelimit|u64|[Val](/txt/exe/amc/reftypes.md#val)||Write limit, based on all read members| +|lib_ams.FShm.offset_mask|u64|[Val](/txt/exe/amc/reftypes.md#val)||Mask for byte eof| +|lib_ams.FShm.h_amsmsg|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Hook](/txt/exe/amc/reftypes.md#hook)||Message processing hook| +|lib_ams.FShm.h_msg_orig|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Hook](/txt/exe/amc/reftypes.md#hook)||Saved message processing hook (EXPECT)| +|lib_ams.FShm.next_ackoff|u64|[Val](/txt/exe/amc/reftypes.md#val)|1023|Force StreamHb after reaching this offset| +|lib_ams.FShm.p_shmtype|[lib_ams.FShmtype](/txt/lib/lib_ams/README.md#lib_ams-fshmtype)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| +|lib_ams.FShm.n_write_block|u32|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_ams.FShm.error|bool|[Val](/txt/exe/amc/reftypes.md#val)||Error was detected| +|lib_ams.FShm.created|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_ams.FShm.schedbias|i64|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FShm + Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ams_gen.h](/include/gen/lib_ams_gen.h) ``` -struct FStream { // lib_ams.FStream: Stream record - lib_ams::FStream* ind_stream_next; // hash next - lib_ams::FStream* cd_stream_hb_next; // zslist link; -1 means not-in-list - lib_ams::FStream* cd_stream_hb_prev; // previous element - lib_ams::FStream* cd_poll_read_next; // zslist link; -1 means not-in-list - lib_ams::FStream* cd_poll_read_prev; // previous element - lib_ams::FStream* zd_ctlin_next; // zslist link; -1 means not-in-list - lib_ams::FStream* zd_ctlin_prev; // previous element - ams::StreamId stream_id; // Stream ID (primary key) - algo::cstring filename; // Name of the file (if opened) - algo_lib::FFildes shm_file; // Associated file - ams::StreamFlags flags; // Is stream open for writing - algo::ByteAry byteary; // Substitute for shm_region - u8* shm_handle; // Associated memory segment handle (windows only). optional pointer - ams::StreamPos rpos; // Read position - ams::StreamPos wpos; // Write position - algo::memptr shm_region; // Shared memory region - u64 limit; // 0 Updated with ackoff, limit for nextoff - u64 offset_mask; // 0 Mask for byte eof - ams::Seqmsg* cur_msg; // Current message. optional pointer - lib_ams::stream_h_msg_hook h_msg; // NULL Pointer to a function - u64 h_msg_ctx; // 0 Callback context - lib_ams::stream_h_msg_orig_hook h_msg_orig; // NULL Pointer to a function - u64 h_msg_orig_ctx; // 0 Callback context - lib_ams::FMember* zd_member_bystream_head; // zero-terminated doubly linked list - i32 zd_member_bystream_n; // zero-terminated doubly linked list - lib_ams::FMember* zd_member_bystream_tail; // pointer to last element - u64 next_ackoff; // 1023 Force StreamHb after reaching this offset - lib_ams::FStreamType* p_streamtype; // reference to parent row - u32 n_write_block; // 0 - i32 burst; // 20 Max number of messages processed at once - bool writer_error; // false Writer error was detected - // user-defined fcleanup on lib_ams.FStream.shm_handle prevents copy - // reftype Hook of lib_ams.FStream.h_msg prohibits copy - // reftype Hook of lib_ams.FStream.h_msg_orig prohibits copy - // reftype Llist of lib_ams.FStream.zd_member_bystream prohibits copy - // x-reference on lib_ams.FStream.p_streamtype prevents copy - // func:lib_ams.FStream..AssignOp - lib_ams::FStream& operator =(const lib_ams::FStream &rhs) = delete; - // user-defined fcleanup on lib_ams.FStream.shm_handle prevents copy - // reftype Hook of lib_ams.FStream.h_msg prohibits copy - // reftype Hook of lib_ams.FStream.h_msg_orig prohibits copy - // reftype Llist of lib_ams.FStream.zd_member_bystream prohibits copy - // x-reference on lib_ams.FStream.p_streamtype prevents copy - // func:lib_ams.FStream..CopyCtor - FStream(const lib_ams::FStream &rhs) = delete; +struct FShm { // lib_ams.FShm: Shm record + lib_ams::FShm* ind_shm_next; // hash next + u32 ind_shm_hashval; // hash value + ams::ShmId shm_id; // Stream ID (primary key) + lib_ams::FShmember** c_shmember_elems; // array of pointers + u32 c_shmember_n; // array of pointers + u32 c_shmember_max; // capacity of allocated array + algo::cstring filename; // Name of the file (if opened) + algo_lib::FFildes shm_file; // Associated file + ams::ShmFlags flags; // Is stream open for writing + u8* shm_handle; // Associated memory segment handle (windows only). optional pointer + lib_ams::FShmember* c_read; // This process. optional pointer + lib_ams::FShmember* c_write; // This process. optional pointer + algo::memptr shm_region; // Shared memory region + u64 writelimit; // 0 Write limit, based on all read members + u64 offset_mask; // 0 Mask for byte eof + lib_ams::shm_h_amsmsg_hook h_amsmsg; // NULL Pointer to a function + u64 h_amsmsg_ctx; // 0 Callback context + lib_ams::shm_h_msg_orig_hook h_msg_orig; // NULL Pointer to a function + u64 h_msg_orig_ctx; // 0 Callback context + u64 next_ackoff; // 1023 Force StreamHb after reaching this offset + lib_ams::FShmtype* p_shmtype; // reference to parent row + u32 n_write_block; // 0 + bool error; // false Error was detected + bool created; // false + i64 schedbias; // 0 + i32 proc_c_shm_idx; // -1 Array index (-1 = not in array) + // reftype Ptrary of lib_ams.FShm.c_shmember prohibits copy + // reftype Hook of lib_ams.FShm.h_amsmsg prohibits copy + // reftype Hook of lib_ams.FShm.h_msg_orig prohibits copy + // x-reference on lib_ams.FShm.p_shmtype prevents copy + // func:lib_ams.FShm..AssignOp + lib_ams::FShm& operator =(const lib_ams::FShm &rhs) = delete; + // reftype Ptrary of lib_ams.FShm.c_shmember prohibits copy + // reftype Hook of lib_ams.FShm.h_amsmsg prohibits copy + // reftype Hook of lib_ams.FShm.h_msg_orig prohibits copy + // x-reference on lib_ams.FShm.p_shmtype prevents copy + // func:lib_ams.FShm..CopyCtor + FShm(const lib_ams::FShm &rhs) = delete; private: - // func:lib_ams.FStream..Ctor - inline FStream() __attribute__((nothrow)); - // func:lib_ams.FStream..Dtor - inline ~FStream() __attribute__((nothrow)); - friend lib_ams::FStream& stream_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend lib_ams::FStream* stream_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void stream_RemoveAll() __attribute__((nothrow)); - friend void stream_RemoveLast() __attribute__((nothrow)); + // func:lib_ams.FShm..Ctor + inline FShm() __attribute__((nothrow)); + // func:lib_ams.FShm..Dtor + inline ~FShm() __attribute__((nothrow)); + friend lib_ams::FShm& shm_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_ams::FShm* shm_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void shm_RemoveAll() __attribute__((nothrow)); + friend void shm_RemoveLast() __attribute__((nothrow)); }; ``` -#### lib_ams.FStreamType - - +#### lib_ams.FShmember - + -#### lib_ams.FStreamType Fields - +#### lib_ams.FShmember Fields + |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|lib_ams.FStreamType.base|[amsdb.StreamType](/txt/ssimdb/amsdb/streamtype.md)|[Base](/txt/ssimdb/amsdb/streamtype.md)||| +|lib_ams.FShmember.shmember|[ams.ShmemberId](/txt/protocol/ams/README.md#ams-shmemberid)|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_ams.FShmember.off|u64|[Val](/txt/exe/amc/reftypes.md#val)||Current offset| +|lib_ams.FShmember.rate_off|[algo.I64Rate](/txt/protocol/algo/README.md#algo-i64rate)|[Val](/txt/exe/amc/reftypes.md#val)||Rate of change of offset| +|lib_ams.FShmember.sortkey|u64|[Val](/txt/exe/amc/reftypes.md#val)||Sort key for reading| +|lib_ams.FShmember.last_hb|[algo.SchedTime](/txt/protocol/algo/SchedTime.md)|[Val](/txt/exe/amc/reftypes.md#val)||Time last heartbeat received| +|lib_ams.FShmember.budget|u64|[Val](/txt/exe/amc/reftypes.md#val)||Write budget (if applicable)| +|lib_ams.FShmember.p_shm|[lib_ams.FShm](/txt/lib/lib_ams/README.md#lib_ams-fshm)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| +|lib_ams.FShmember.c_cur_msg|[ams.Shmmsg](/txt/protocol/ams/README.md#ams-shmmsg)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||Current message| +|lib_ams.FShmember.p_proc|[lib_ams.FProc](/txt/lib/lib_ams/README.md#lib_ams-fproc)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| + +#### Struct FShmember + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ams_gen.h](/include/gen/lib_ams_gen.h) +``` +struct FShmember { // lib_ams.FShmember + lib_ams::FShmember* cd_hb_next; // zslist link; -1 means not-in-list + lib_ams::FShmember* cd_hb_prev; // previous element + lib_ams::FShmember* cd_poll_read_next; // zslist link; -1 means not-in-list + lib_ams::FShmember* cd_poll_read_prev; // previous element + lib_ams::FShmember* cd_slow_poll_read_next; // zslist link; -1 means not-in-list + lib_ams::FShmember* cd_slow_poll_read_prev; // previous element + lib_ams::FShmember* shmember_next; // Pointer to next free element int tpool + lib_ams::FShmember* ind_shmember_next; // hash next + u32 ind_shmember_hashval; // hash value + i32 bh_shmember_read_idx; // index in heap; -1 means not-in-heap + ams::ShmemberId shmember; // + u64 off; // 0 Current offset + algo::I64Rate rate_off; // Rate of change of offset + u64 sortkey; // 0 Sort key for reading + algo::SchedTime last_hb; // Time last heartbeat received + u64 budget; // 0 Write budget (if applicable) + lib_ams::FShm* p_shm; // reference to parent row + ams::Shmmsg* c_cur_msg; // Current message. optional pointer + lib_ams::FProc* p_proc; // reference to parent row + i32 c_ctlin_idx; // -1 Array index (-1 = not in array) + i32 proc_c_shmember_idx; // -1 Array index (-1 = not in array) + i32 shm_c_shmember_idx; // -1 Array index (-1 = not in array) + // x-reference on lib_ams.FShmember.p_shm prevents copy + // x-reference on lib_ams.FShmember.p_proc prevents copy + // func:lib_ams.FShmember..AssignOp + lib_ams::FShmember& operator =(const lib_ams::FShmember &rhs) = delete; + // x-reference on lib_ams.FShmember.p_shm prevents copy + // x-reference on lib_ams.FShmember.p_proc prevents copy + // func:lib_ams.FShmember..CopyCtor + FShmember(const lib_ams::FShmember &rhs) = delete; +private: + // func:lib_ams.FShmember..Ctor + inline FShmember() __attribute__((nothrow)); + // func:lib_ams.FShmember..Dtor + inline ~FShmember() __attribute__((nothrow)); + friend lib_ams::FShmember& shmember_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_ams::FShmember* shmember_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void shmember_Delete(lib_ams::FShmember &row) __attribute__((nothrow)); +}; +``` + +#### lib_ams.FShmtype - + -#### Struct FStreamType - -*Note:* field ``lib_ams.FStreamType.base`` has reftype ``base`` so the fields of [amsdb.StreamType](/txt/ssimdb/amsdb/streamtype.md) above are included into the resulting struct. +#### lib_ams.FShmtype Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_ams.FShmtype.base|[amsdb.Shmtype](/txt/ssimdb/amsdb/shmtype.md)|[Base](/txt/ssimdb/amsdb/shmtype.md)||| + +#### Struct FShmtype + +*Note:* field ``lib_ams.FShmtype.base`` has reftype ``base`` so the fields of [amsdb.Shmtype](/txt/ssimdb/amsdb/shmtype.md) above are included into the resulting struct. Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ams_gen.h](/include/gen/lib_ams_gen.h) ``` -struct FStreamType { // lib_ams.FStreamType - lib_ams::FStreamType* ind_streamtype_next; // hash next - algo::Smallstr50 streamtype; // - ams::StreamType id; // - algo::Comment comment; // - // func:lib_ams.FStreamType..AssignOp - inline lib_ams::FStreamType& operator =(const lib_ams::FStreamType &rhs) = delete; - // func:lib_ams.FStreamType..CopyCtor - inline FStreamType(const lib_ams::FStreamType &rhs) = delete; +struct FShmtype { // lib_ams.FShmtype + lib_ams::FShmtype* ind_shmtype_next; // hash next + u32 ind_shmtype_hashval; // hash value + algo::Smallstr50 shmtype; // + ams::Shmtype id; // + bool nonblock; // false Non-blocking (lossy) stream + algo::Comment comment; // + // func:lib_ams.FShmtype..AssignOp + inline lib_ams::FShmtype& operator =(const lib_ams::FShmtype &rhs) = delete; + // func:lib_ams.FShmtype..CopyCtor + inline FShmtype(const lib_ams::FShmtype &rhs) = delete; private: - // func:lib_ams.FStreamType..Ctor - inline FStreamType() __attribute__((nothrow)); - // func:lib_ams.FStreamType..Dtor - inline ~FStreamType() __attribute__((nothrow)); - friend lib_ams::FStreamType& streamtype_Alloc() __attribute__((__warn_unused_result__, nothrow)); - friend lib_ams::FStreamType* streamtype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); - friend void streamtype_RemoveAll() __attribute__((nothrow)); - friend void streamtype_RemoveLast() __attribute__((nothrow)); + // func:lib_ams.FShmtype..Ctor + inline FShmtype() __attribute__((nothrow)); + // func:lib_ams.FShmtype..Dtor + inline ~FShmtype() __attribute__((nothrow)); + friend lib_ams::FShmtype& shmtype_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_ams::FShmtype* shmtype_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void shmtype_RemoveAll() __attribute__((nothrow)); + friend void shmtype_RemoveLast() __attribute__((nothrow)); }; ``` @@ -1328,5 +1204,42 @@ struct FWritefile { // lib_ams.FWritefile }; ``` +#### lib_ams.MsgFmt - + + +#### lib_ams.MsgFmt Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_ams.MsgFmt.payload_lim|i32|[Val](/txt/exe/amc/reftypes.md#val)|1024000|Print up to this many chars from payload| +|lib_ams.MsgFmt.indent|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|Print indentation (with -pretty)| +|lib_ams.MsgFmt.format|u8|[Val](/txt/exe/amc/reftypes.md#val)|0|Output format| +|lib_ams.MsgFmt.strip|i32|[Val](/txt/exe/amc/reftypes.md#val)||Number of headers to strip| +|lib_ams.MsgFmt.pretty|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Use structured and indented printing| +|lib_ams.MsgFmt.showlen|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Show message length| +|lib_ams.MsgFmt.h_convert|[lib_ams.MsgFmt](/txt/lib/lib_ams/README.md#lib_ams-msgfmt)|[Hook](/txt/exe/amc/reftypes.md#hook)||| +|lib_ams.MsgFmt.convert_key|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||conversion key| +|lib_ams.MsgFmt.convert_val|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||conversion value - overwritten by the return| + +#### Struct MsgFmt + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ams_gen.h](/include/gen/lib_ams_gen.h) +``` +struct MsgFmt { // lib_ams.MsgFmt + i32 payload_lim; // 1024000 Print up to this many chars from payload + i32 indent; // 0 Print indentation (with -pretty) + u8 format; // 0 Output format + i32 strip; // 0 Number of headers to strip + bool pretty; // true Use structured and indented printing + bool showlen; // false Show message length + lib_ams::parent_h_convert_hook h_convert; // NULL Pointer to a function + u64 h_convert_ctx; // 0 Callback context + algo::cstring convert_key; // conversion key + algo::cstring convert_val; // conversion value - overwritten by the return + // func:lib_ams.MsgFmt..Ctor + inline MsgFmt() __attribute__((nothrow)); +}; +``` + diff --git a/txt/lib/lib_ctype/README.md b/txt/lib/lib_ctype/README.md index f79095b0..d2848088 100644 --- a/txt/lib/lib_ctype/README.md +++ b/txt/lib/lib_ctype/README.md @@ -18,15 +18,8 @@ Functions exported from this namespace: ```c++ -// Find ctype from ctype name -// Supports ctype and ssimfile lookups. -lib_ctype::FCtype *lib_ctype::TagToCtype(strptr name) -``` - -```c++ -// Find ctype from tuple type tag. -// Supports ctype and ssimfile lookups. -lib_ctype::FCtype *lib_ctype::TagToCtype(algo::Tuple &tuple) +// Retrieve base type for the given ctype +lib_ctype::FCtype *lib_ctype::Basetype(lib_ctype::FCtype &ctype) ``` ```c++ @@ -35,32 +28,21 @@ bool lib_ctype::EqualDefaultQ(algo::Attr *attr, lib_ctype::FField &field) ``` ```c++ -// Print attributes from TUPLE, -// which is known to be of ctype CTYPE, to cstring TEXT. -// Output fields in normalized order, respecting Base. -// If SKIP_DFLT is true, do not print fields which happen to match their default. -// Suports Varlen fields. -// Attributes that are themselves tuples are recursively normalized as well. -void lib_ctype::PrintTupleAttrs(cstring& text, algo::Tuple &tuple, lib_ctype::FCtype &ctype, bool skip_dflt) +// Fill Replscope with attribute values (including substrings) of tuple +// So, if STR is dev.targdep targdep:a.b comment:"blah" +// Then R will be filled with variables $targdep, $target, $parent, $comment +// This can be used to perform $-substitution in strings. +void lib_ctype::FillReplscope(algo_lib::Replscope &R, algo::Tuple &tuple) ``` ```c++ -// Normalize a string that's supposed to correspond CTYPE -// If CTYPE is NULL, it is guessed from the type tag -// The following actions are done: -// 1. Print correct type tag back -// 2. Remove any attributes from tuple that don't correspond to fields of CTYPE -// 3. Print back any fields in ctype that don't appear in the string -// 4. Optionally skip printing any field that's already equal to the default value (if SKIP_DFLT is specified) -// 5. Recursively call NormalizeTuple on any field that has Tuple print format -// NOTE: -// Ctype from parent field has been removed, as it is wrong for derived types! -tempstr lib_ctype::NormalizeSsimTuple(strptr str, bool skip_dflt) +// Same as tuple version of FillReplscope, but also parses the tuple from STR +void lib_ctype::FillReplscope(algo_lib::Replscope &R, strptr str) ``` ```c++ -// Retrieve base type for the given ctype -lib_ctype::FCtype *lib_ctype::Basetype(lib_ctype::FCtype &ctype) +// Find fconst from field and ssim attr value. +lib_ctype::FFconst *lib_ctype::FindFconst(lib_ctype::FField *field, cstring& attr_value) ``` ```c++ @@ -69,28 +51,11 @@ lib_ctype::FCtype *lib_ctype::Basetype(lib_ctype::FCtype &ctype) lib_ctype::FField *lib_ctype::FindField(lib_ctype::FCtype &ctype, strptr name) ``` -```c++ -// Check if field is printed as tuple -- i.e. requires recursive parsing -bool lib_ctype::TupleFieldQ(lib_ctype::FField &field) -``` - -```c++ -// Check if attribute is a tuple. -// This is basically the same as TupleFieldQ, but returns false for -// empty Opt fields. -bool lib_ctype::TupleAttrQ(lib_ctype::FField &field, strptr val) -``` - ```c++ // Prepare main schema void lib_ctype::Init() ``` -```c++ -// Find fconst from field and ssim attr value. -lib_ctype::FFconst *lib_ctype::FindFconst(lib_ctype::FField *field, cstring& attr_value) -``` - ```c++ // Match Tuple EXPECT against tuple RESULT. // EXPECT must be a subset of RESULT for the match to pass. @@ -99,6 +64,30 @@ lib_ctype::FFconst *lib_ctype::FindFconst(lib_ctype::FField *field, cstring& att void lib_ctype::Match_Tuple(lib_ctype::Match &match, Tuple &expect, Tuple &result) ``` +```c++ +// Normalize a string that's supposed to correspond CTYPE +// If CTYPE is NULL, it is guessed from the type tag +// The following actions are done: +// 1. Print correct type tag back +// 2. Remove any attributes from tuple that don't correspond to fields of CTYPE +// 3. Print back any fields in ctype that don't appear in the string +// 4. Optionally skip printing any field that's already equal to the default value (if SKIP_DFLT is specified) +// 5. Recursively call NormalizeTuple on any field that has Tuple print format +// NOTE: +// Ctype from parent field has been removed, as it is wrong for derived types! +tempstr lib_ctype::NormalizeSsimTuple(strptr str, bool skip_dflt) +``` + +```c++ +// Print attributes from TUPLE, +// which is known to be of ctype CTYPE, to cstring TEXT. +// Output fields in normalized order, respecting Base. +// If SKIP_DFLT is true, do not print fields which happen to match their default. +// Suports Varlen fields. +// Attributes that are themselves tuples are recursively normalized as well. +void lib_ctype::PrintTupleAttrs(cstring& text, algo::Tuple &tuple, lib_ctype::FCtype &ctype, bool skip_dflt) +``` + ```c++ // Remove unstable fields from a tuple encoded in STR, print it back and return // So, if STR is ams.TraceInfo2Msg tstamp:... field:xxx @@ -108,16 +97,27 @@ tempstr lib_ctype::StabilizeSsimTuple(strptr str) ``` ```c++ -// Same as tuple version of FillReplscope, but also parses the tuple from STR -void lib_ctype::FillReplscope(algo_lib::Replscope &R, strptr str) +// Find ctype from tuple type tag. +// Supports ctype and ssimfile lookups. +lib_ctype::FCtype *lib_ctype::TagToCtype(algo::Tuple &tuple) ``` ```c++ -// Fill Replscope with attribute values (including substrings) of tuple -// So, if STR is dev.targdep targdep:a.b comment:"blah" -// Then R will be filled with variables $targdep, $target, $parent, $comment -// This can be used to perform $-substitution in strings. -void lib_ctype::FillReplscope(algo_lib::Replscope &R, algo::Tuple &tuple) +// Find ctype from ctype name +// Supports ctype and ssimfile lookups. +lib_ctype::FCtype *lib_ctype::TagToCtype(strptr name) +``` + +```c++ +// Check if attribute is a tuple. +// This is basically the same as TupleFieldQ, but returns false for +// empty Opt fields. +bool lib_ctype::TupleAttrQ(lib_ctype::FField &field, strptr val) +``` + +```c++ +// Check if field is printed as tuple -- i.e. requires recursive parsing +bool lib_ctype::TupleFieldQ(lib_ctype::FField &field) ``` @@ -128,19 +128,19 @@ void lib_ctype::FillReplscope(algo_lib::Replscope &R, algo::Tuple &tuple) `lib_ctype` takes the following tables on input: |Ssimfile|Comment| |---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| +|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| +|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| +|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| -|[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| |[dmmeta.ftuple](/txt/ssimdb/dmmeta/ftuple.md)|| -|[dmmeta.fconst](/txt/ssimdb/dmmeta/fconst.md)|Specify enum value (integer + string constant) for a field| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| -|[dmmeta.cppfunc](/txt/ssimdb/dmmeta/cppfunc.md)|Value of field provided by this expression| -|[dmmeta.cfmt](/txt/ssimdb/dmmeta/cfmt.md)|Specify options for printing/reading ctypes into multiple formats| -|[dmmeta.cdflt](/txt/ssimdb/dmmeta/cdflt.md)|Specify default value for single-value types that lack fields| +|[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| |[dev.unstablefld](/txt/ssimdb/dev/unstablefld.md)|Fields that should be stripped from component test output because they contain timestamps etc.| -|[amcdb.bltin](/txt/ssimdb/amcdb/bltin.md)|Specify properties of a C built-in type| @@ -327,6 +327,7 @@ struct FCfmt { // lib_ctype.FCfmt algo::Comment comment; // bool ctype_c_cfmt_in_ary; // false membership flag lib_ctype::FCfmt* ind_cfmt_next; // hash next + u32 ind_cfmt_hashval; // hash value // func:lib_ctype.FCfmt..AssignOp lib_ctype::FCfmt& operator =(const lib_ctype::FCfmt &rhs) = delete; // func:lib_ctype.FCfmt..CopyCtor @@ -400,19 +401,20 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ctype_gen.h](/include/gen/lib_ctype_gen.h) ``` struct FCtype { // lib_ctype.FCtype - algo::Smallstr100 ctype; // Identifier. must be ns.typename - algo::Comment comment; // - lib_ctype::FField** c_field_elems; // array of pointers - u32 c_field_n; // array of pointers - u32 c_field_max; // capacity of allocated array - algo::Smallstr50 printfmt; // - lib_ctype::FCdflt* c_cdflt; // optional pointer - lib_ctype::FCfmt** c_cfmt_elems; // array of pointers - u32 c_cfmt_n; // array of pointers - u32 c_cfmt_max; // capacity of allocated array - lib_ctype::FBltin* c_bltin; // optional pointer - lib_ctype::FSqltype* c_sqltype; // optional pointer - lib_ctype::FCtype* ind_ctype_next; // hash next + algo::Smallstr100 ctype; // Identifier. must be ns.typename + algo::Comment comment; // + lib_ctype::FField** c_field_elems; // array of pointers + u32 c_field_n; // array of pointers + u32 c_field_max; // capacity of allocated array + algo::Smallstr50 printfmt; // + lib_ctype::FCdflt* c_cdflt; // optional pointer + lib_ctype::FCfmt** c_cfmt_elems; // array of pointers + u32 c_cfmt_n; // array of pointers + u32 c_cfmt_max; // capacity of allocated array + lib_ctype::FBltin* c_bltin; // optional pointer + lib_ctype::FSqltype* c_sqltype; // optional pointer + lib_ctype::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // reftype Ptrary of lib_ctype.FCtype.c_field prohibits copy // x-reference on lib_ctype.FCtype.c_cdflt prevents copy // reftype Ptrary of lib_ctype.FCtype.c_cfmt prohibits copy @@ -539,14 +541,16 @@ struct FDb { // lib_ctype.FDb: In-memory database for lib_ctype Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ctype_gen.h](/include/gen/lib_ctype_gen.h) ``` struct FFconst { // lib_ctype.FFconst - lib_ctype::FFconst* ind_fconst_key_next; // hash next - lib_ctype::FFconst* ind_fconst_next; // hash next - algo::Smallstr100 fconst; // - algo::CppExpr value; // - algo::Comment comment; // - algo::cstring key; // - lib_ctype::FFconst* zd_fconst_next; // zslist link; -1 means not-in-list - lib_ctype::FFconst* zd_fconst_prev; // previous element + lib_ctype::FFconst* ind_fconst_key_next; // hash next + u32 ind_fconst_key_hashval; // hash value + lib_ctype::FFconst* ind_fconst_next; // hash next + u32 ind_fconst_hashval; // hash value + algo::Smallstr100 fconst; // + algo::CppExpr value; // + algo::Comment comment; // + algo::cstring key; // + lib_ctype::FFconst* field_zd_fconst_next; // zslist link; -1 means not-in-list + lib_ctype::FFconst* field_zd_fconst_prev; // previous element // func:lib_ctype.FFconst..AssignOp inline lib_ctype::FFconst& operator =(const lib_ctype::FFconst &rhs) = delete; // func:lib_ctype.FFconst..CopyCtor @@ -589,6 +593,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ctype_gen.h](/i ``` struct FField { // lib_ctype.FField lib_ctype::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value algo::Smallstr100 field; // Primary key, as ctype.name algo::Smallstr100 arg; // Type of field algo::Smallstr50 reftype; // "Val" Type constructor @@ -723,10 +728,11 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ctype_gen.h](/include/gen/lib_ctype_gen.h) ``` struct FSsimfile { // lib_ctype.FSsimfile - lib_ctype::FSsimfile* ind_ssimfile_next; // hash next - algo::Smallstr50 ssimfile; // - algo::Smallstr100 ctype; // - lib_ctype::FCtype* p_ctype; // reference to parent row + lib_ctype::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value + algo::Smallstr50 ssimfile; // + algo::Smallstr100 ctype; // + lib_ctype::FCtype* p_ctype; // reference to parent row // x-reference on lib_ctype.FSsimfile.p_ctype prevents copy // func:lib_ctype.FSsimfile..AssignOp inline lib_ctype::FSsimfile& operator =(const lib_ctype::FSsimfile &rhs) = delete; diff --git a/txt/lib/lib_curl/README.md b/txt/lib/lib_curl/README.md new file mode 100644 index 00000000..76c4c5a0 --- /dev/null +++ b/txt/lib/lib_curl/README.md @@ -0,0 +1,192 @@ +## lib_curl - covers curl_easy + + +All uses of lib_curl are covered in unittest:lib_curl.%
. unittest is based on the lib_curl::PrintCurlResp
+An insight for debugging is that lib_curl::PrintCurlResp function produces functional curlrc text.
+If it is saved in, say xyz, than curl --config xyz will execute it as if it is a full curl command line
+To see unittest in action one can start bin/curl_server and execute commands like
+$curl --config test/atf_unit/lib_curl.GET_Echo + +### Table Of Contents + + +  •  [Functions](#functions)
+  •  [Inputs](#inputs)
+  •  [Sources](#sources)
+  •  [Dependencies](#dependencies)
+  •  [In Memory DB](#in-memory-db)
+ + + +### Functions + + +Functions exported from this namespace: + +```c++ +// ----------------- Public API ----------------- +bool lib_curl::Curl(lib_curl::FRequest &req, lib_curl::FResponse &out_resp) +``` + +```c++ +tempstr lib_curl::PrintCurlResp(lib_curl::FResponse &resp, bool nodate = false) +``` + + + +### Inputs + + +`lib_curl` takes the following tables on input: +|Ssimfile|Comment| +|---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| + + + +### Sources + + +The source code license is GPL +The following source files are part of this tool: + +|Source File|Comment| +|---|---| +|[cpp/gen/lib_curl_gen.cpp](/cpp/gen/lib_curl_gen.cpp)|| +|[cpp/lib/lib_curl.cpp](/cpp/lib/lib_curl.cpp)|| +|[include/gen/lib_curl_gen.h](/include/gen/lib_curl_gen.h)|| +|[include/gen/lib_curl_gen.inl.h](/include/gen/lib_curl_gen.inl.h)|| +|[include/lib_curl.h](/include/lib_curl.h)|| + + + +### Dependencies + + +The build target depends on the following libraries +|Target|Comment| +|---|---| +|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| +|[lib_prot](/txt/lib/lib_prot/README.md)|Library covering all protocols| + + + +### In Memory DB + + +`lib_curl` generated code creates the tables below. +All allocations are done through global `lib_curl::_db` [lib_curl.FDb](#lib_curl-fdb) structure +|Ctype|Ssimfile|Create|Access| +|---|---|---|---| +|[lib_curl.FDb](#lib_curl-fdb)||FDb._db (Global)| +|[lib_curl.FRequest](#lib_curl-frequest)||FDb.request (Tpool)| +|[lib_curl.FResponse](#lib_curl-fresponse)||FDb.response (Tpool)| + +#### lib_curl.FDb - + + +#### lib_curl.FDb Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_curl.FDb._db|[lib_curl.FDb](/txt/lib/lib_curl/README.md#lib_curl-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| +|lib_curl.FDb.request|[lib_curl.FRequest](/txt/lib/lib_curl/README.md#lib_curl-frequest)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||| +|lib_curl.FDb.response|[lib_curl.FResponse](/txt/lib/lib_curl/README.md#lib_curl-fresponse)|[Tpool](/txt/exe/amc/reftypes.md#tpool)||| + +#### Struct FDb + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_curl_gen.h](/include/gen/lib_curl_gen.h) +``` +struct FDb { // lib_curl.FDb + u64 request_blocksize; // # bytes per block + lib_curl::FRequest* request_free; // + u64 response_blocksize; // # bytes per block + lib_curl::FResponse* response_free; // + lib_curl::trace trace; // +}; +``` + +#### lib_curl.FRequest - curl request structure + + +#### lib_curl.FRequest Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_curl.FRequest.method|[httpdb.Method](/txt/ssimdb/httpdb/method.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)|"GET"|HTTP verb: GET, POST, PUT, PATCH, DELETE| +|lib_curl.FRequest.curlrc_only|bool|[Val](/txt/exe/amc/reftypes.md#val)||Generate curlrc info, do not call curl| +|lib_curl.FRequest.url|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Absolute URL (e.g., https://api.example.com/v1/data)| +|lib_curl.FRequest.headers|[algo.cstring](/txt/protocol/algo/cstring.md)|[Lary](/txt/exe/amc/reftypes.md#lary)||Arbitrary headers: "Authorization: Bearer ...", "Content-Type: ..."| +|lib_curl.FRequest.body|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Optional request body (sent as-is, often JSON string)| +|lib_curl.FRequest.insecure_tls|bool|[Val](/txt/exe/amc/reftypes.md#val)||Skip TLS verification if true| +|lib_curl.FRequest.connect_timeout_sec|u32|[Val](/txt/exe/amc/reftypes.md#val)|5|connect_timeout_sec| +|lib_curl.FRequest.total_timeout_sec|u32|[Val](/txt/exe/amc/reftypes.md#val)|120|Total request timeout (s)| + +#### Struct FRequest + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_curl_gen.h](/include/gen/lib_curl_gen.h) +``` +struct FRequest { // lib_curl.FRequest: curl request structure + lib_curl::FRequest* request_next; // Pointer to next free element int tpool + algo::Smallstr50 method; // "GET" HTTP verb: GET, POST, PUT, PATCH, DELETE + bool curlrc_only; // false Generate curlrc info, do not call curl + algo::cstring url; // Absolute URL (e.g., https://api.example.com/v1/data) + algo::cstring* headers_lary[32]; // level array + i32 headers_n; // number of elements in array + algo::cstring body; // Optional request body (sent as-is, often JSON string) + bool insecure_tls; // false Skip TLS verification if true + u32 connect_timeout_sec; // 5 connect_timeout_sec + u32 total_timeout_sec; // 120 Total request timeout (s) +private: + // func:lib_curl.FRequest..Ctor + inline FRequest() __attribute__((nothrow)); + // func:lib_curl.FRequest..Dtor + inline ~FRequest() __attribute__((nothrow)); + friend lib_curl::FRequest& request_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_curl::FRequest* request_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void request_Delete(lib_curl::FRequest &row) __attribute__((nothrow)); +}; +``` + +#### lib_curl.FResponse - curl response structure + + +#### lib_curl.FResponse Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_curl.FResponse.code|u16|[Val](/txt/exe/amc/reftypes.md#val)||HTTP status code| +|lib_curl.FResponse.body|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||raw response body| +|lib_curl.FResponse.content_type|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||parsed Content-Type (no params)| +|lib_curl.FResponse.status_line|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||e.g., HTTP/1.1 200 OK| +|lib_curl.FResponse.reason|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||parsed reason phrase, if available| +|lib_curl.FResponse.headers|[algo.cstring](/txt/protocol/algo/cstring.md)|[Lary](/txt/exe/amc/reftypes.md#lary)||raw header lines (trimmed)| +|lib_curl.FResponse.curlrc|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||curlrc content| + +#### Struct FResponse + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_curl_gen.h](/include/gen/lib_curl_gen.h) +``` +struct FResponse { // lib_curl.FResponse: curl response structure + lib_curl::FResponse* response_next; // Pointer to next free element int tpool + u16 code; // 0 HTTP status code + algo::cstring body; // raw response body + algo::cstring content_type; // parsed Content-Type (no params) + algo::cstring status_line; // e.g., HTTP/1.1 200 OK + algo::cstring reason; // parsed reason phrase, if available + algo::cstring* headers_lary[32]; // level array + i32 headers_n; // number of elements in array + algo::cstring curlrc; // curlrc content +private: + // func:lib_curl.FResponse..Ctor + inline FResponse() __attribute__((nothrow)); + // func:lib_curl.FResponse..Dtor + inline ~FResponse() __attribute__((nothrow)); + friend lib_curl::FResponse& response_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_curl::FResponse* response_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void response_Delete(lib_curl::FResponse &row) __attribute__((nothrow)); +}; +``` + + + diff --git a/txt/lib/lib_exec/README.md b/txt/lib/lib_exec/README.md index 92fd6812..e7b435ba 100644 --- a/txt/lib/lib_exec/README.md +++ b/txt/lib/lib_exec/README.md @@ -18,7 +18,21 @@ Functions exported from this namespace: ```c++ -i64 lib_exec::execkey_Get(lib_exec::FSyscmd &cmd) +// Returns true if command was actually invoked and did exist successfully. +// If the command never ran, return false. +bool lib_exec::CompletedOKQ(lib_exec::FSyscmd &cmd) +``` + +```c++ +// Return a new command record which will be started after START, +// and is guaranteed to exit before END. +// This is the basic building block for creating commands. +lib_exec::FSyscmd &lib_exec::NewCmd(lib_exec::FSyscmd *start, lib_exec::FSyscmd *end) +``` + +```c++ +// Frees FDs for stdout and stderr +void lib_exec::RefurbishStd(lib_exec::FSyscmd &cmd) ``` ```c++ @@ -37,21 +51,7 @@ int lib_exec::SyscmdExecute() ``` ```c++ -// Return a new command record which will be started after START, -// and is guaranteed to exit before END. -// This is the basic building block for creating commands. -lib_exec::FSyscmd &lib_exec::NewCmd(lib_exec::FSyscmd *start, lib_exec::FSyscmd *end) -``` - -```c++ -// Returns true if command was actually invoked and did exist successfully. -// If the command never ran, return false. -bool lib_exec::CompletedOKQ(lib_exec::FSyscmd &cmd) -``` - -```c++ -// Frees FDs for stdout and stderr -void lib_exec::RefurbishStd(lib_exec::FSyscmd &cmd) +i64 lib_exec::execkey_Get(lib_exec::FSyscmd &cmd) ``` @@ -202,32 +202,33 @@ struct FDb { // lib_exec.FDb Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_exec_gen.h](/include/gen/lib_exec_gen.h) ``` struct FSyscmd { // lib_exec.FSyscmd - lib_exec::FSyscmd* ind_running_next; // hash next - i32 bh_syscmd_idx; // index in heap; -1 means not-in-heap - lib_exec::FSyscmd* zd_started_next; // zslist link; -1 means not-in-list - lib_exec::FSyscmd* zd_started_prev; // previous element - i64 syscmd; // 0 Step number - algo::cstring command; // Command to execute - i32 pid; // 0 PID, if running - i32 status; // 0 Exit status (if command has completed) - i32 nprereq; // 0 Number of live pre-requisites - bool fail_prereq; // false Set if one of pre-requisites fails - bool completed; // false Completed? - i32 maxtime; // 0 Optional max running time (used to use SIGALRM) - lib_exec::FSyscmddep** c_prior_elems; // array of pointers - u32 c_prior_n; // array of pointers - u32 c_prior_max; // capacity of allocated array - lib_exec::FSyscmddep** c_next_elems; // array of pointers - u32 c_next_n; // array of pointers - u32 c_next_max; // capacity of allocated array - i32 rowid; // 0 - algo::cstring message; // Message to print when command finishes - bool redir_out; // true Redirect stdout/stderr to temp file - bool show_out; // true Print stdout/stderr - algo_lib::FFildes stdout_fd; // Temporary file containing stdout of subprocess - algo_lib::FFildes stderr_fd; // Temporary file containing stderr of subprocess - i32 signal; // 0 Signal received by process (if any) - algo::StringAry args; // Overrides 'command' + lib_exec::FSyscmd* ind_running_next; // hash next + u32 ind_running_hashval; // hash value + i32 bh_syscmd_idx; // index in heap; -1 means not-in-heap + lib_exec::FSyscmd* zd_started_next; // zslist link; -1 means not-in-list + lib_exec::FSyscmd* zd_started_prev; // previous element + i64 syscmd; // 0 Step number + algo::cstring command; // Command to execute + i32 pid; // 0 PID, if running + i32 status; // 0 Exit status (if command has completed) + i32 nprereq; // 0 Number of live pre-requisites + bool fail_prereq; // false Set if one of pre-requisites fails + bool completed; // false Completed? + i32 maxtime; // 0 Optional max running time (used to use SIGALRM) + lib_exec::FSyscmddep** c_prior_elems; // array of pointers + u32 c_prior_n; // array of pointers + u32 c_prior_max; // capacity of allocated array + lib_exec::FSyscmddep** c_next_elems; // array of pointers + u32 c_next_n; // array of pointers + u32 c_next_max; // capacity of allocated array + i32 rowid; // 0 + algo::cstring message; // Message to print when command finishes + bool redir_out; // true Redirect stdout/stderr to temp file + bool show_out; // true Print stdout/stderr + algo_lib::FFildes stdout_fd; // Temporary file containing stdout of subprocess + algo_lib::FFildes stderr_fd; // Temporary file containing stderr of subprocess + i32 signal; // 0 Signal received by process (if any) + algo::StringAry args; // Overrides 'command' // reftype Ptrary of lib_exec.FSyscmd.c_prior prohibits copy // reftype Ptrary of lib_exec.FSyscmd.c_next prohibits copy // func:lib_exec.FSyscmd..AssignOp diff --git a/txt/lib/lib_fm/README.md b/txt/lib/lib_fm/README.md index 9db1c67d..225ff29a 100644 --- a/txt/lib/lib_fm/README.md +++ b/txt/lib/lib_fm/README.md @@ -312,15 +312,24 @@ Alarm log file name follows the convention: Functions exported from this namespace: ```c++ -// Initialize FM library -// prefix - automatically add prefix to object instance ID -void lib_fm::FmInit(algo::strptr object_prefix) +// clear existing alarm, return true if cleared, false if not +bool lib_fm::ClearAlarm(lib_fm::FAlarm &alarm, algo::UnTime time) ``` ```c++ -// Compose log file name from file_prefix and date: -// file_prefix%Y-%b-%d.ssim -tempstr lib_fm::LogFile(algo::strptr file_prefix, algo::UnTime date) +// copy alarm to message +void lib_fm::CopyToMsg(lib_fm::FAlarm &from, fm::AlarmMsg &to) +``` + +```c++ +// dump all alarms (for debugging purpose) +void lib_fm::DumpAlarms() +``` + +```c++ +// Initialize FM library +// prefix - automatically add prefix to object instance ID +void lib_fm::FmInit(algo::strptr object_prefix) ``` ```c++ @@ -332,8 +341,9 @@ void lib_fm::GatherAlarmHistory(algo::strptr file_prefix, algo::UnTime time, int ``` ```c++ -// clear existing alarm, return true if cleared, false if not -bool lib_fm::ClearAlarm(lib_fm::FAlarm &alarm, algo::UnTime time) +// Compose log file name from file_prefix and date: +// file_prefix%Y-%b-%d.ssim +tempstr lib_fm::LogFile(algo::strptr file_prefix, algo::UnTime date) ``` ```c++ @@ -346,21 +356,11 @@ bool lib_fm::ClearAlarm(lib_fm::FAlarm &alarm, algo::UnTime time) lib_fm::FAlarm *lib_fm::SetAlarm(bool raise, algo::UnTime time, algo::strptr code, algo::strptr objtype, algo::strptr objinst, algo::strptr message) ``` -```c++ -// copy alarm to message -void lib_fm::CopyToMsg(lib_fm::FAlarm &from, fm::AlarmMsg &to) -``` - ```c++ // update from message void lib_fm::UpdateFromMsg(fm::AlarmMsg &msg) ``` -```c++ -// dump all alarms (for debugging purpose) -void lib_fm::DumpAlarms() -``` - ### Inputs @@ -369,9 +369,9 @@ void lib_fm::DumpAlarms() `lib_fm` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[fmdb.alm_objtype](/txt/ssimdb/fmdb/alm_objtype.md)|Alarm resource type| -|[fmdb.alm_code](/txt/ssimdb/fmdb/alm_code.md)|| |[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[fmdb.alm_code](/txt/ssimdb/fmdb/alm_code.md)|| +|[fmdb.alm_objtype](/txt/ssimdb/fmdb/alm_objtype.md)|Alarm resource type| @@ -430,19 +430,20 @@ All allocations are done through global `lib_fm::_db` [lib_fm.FDb](#lib_fm-fdb) Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_fm_gen.h](/include/gen/lib_fm_gen.h) ``` struct FAlarm { // lib_fm.FAlarm - algo::Smallstr200 alarm; // Alarm identity: code@object - fm::Flag flag; // Flag: raised or cleared - fm::Severity severity; // Perceived severity - i32 n_occurred; // 0 How many times the alarm occurred since first_time - algo::UnTime first_time; // Time of first occurrence - algo::UnTime last_time; // Time of last occurrence - algo::UnTime clear_time; // Time when the alarm has beed cleared (only for cleared alarms - algo::UnTime update_time; // Time of last update - fm::Summary objtype_summary; // Object type explained - fm::Summary summary; // Alarm summary from inventory - fm::Description description; // Alarm message from object - fm::Source source; // Subsystem where alarm has been detected - lib_fm::FAlarm* ind_alarm_next; // hash next + algo::Smallstr200 alarm; // Alarm identity: code@object + fm::Flag flag; // Flag: raised or cleared + fm::Severity severity; // Perceived severity + i32 n_occurred; // 0 How many times the alarm occurred since first_time + algo::UnTime first_time; // Time of first occurrence + algo::UnTime last_time; // Time of last occurrence + algo::UnTime clear_time; // Time when the alarm has beed cleared (only for cleared alarms + algo::UnTime update_time; // Time of last update + fm::Summary objtype_summary; // Object type explained + fm::Summary summary; // Alarm summary from inventory + fm::Description description; // Alarm message from object + fm::Source source; // Subsystem where alarm has been detected + lib_fm::FAlarm* ind_alarm_next; // hash next + u32 ind_alarm_hashval; // hash value // func:lib_fm.FAlarm..AssignOp lib_fm::FAlarm& operator =(const lib_fm::FAlarm &rhs) = delete; // func:lib_fm.FAlarm..CopyCtor @@ -475,11 +476,12 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_fm_gen.h](/include/gen/lib_fm_gen.h) ``` struct FAlmCode { // lib_fm.FAlmCode - fm::Code alm_code; // Alarm code - fm::Severity severity; // Assigned severity - fm::Source source; // - fm::Summary summary; // Alarm summary (slogan) - lib_fm::FAlmCode* ind_alm_code_next; // hash next + fm::Code alm_code; // Alarm code + fm::Severity severity; // Assigned severity + fm::Source source; // + fm::Summary summary; // Alarm summary (slogan) + lib_fm::FAlmCode* ind_alm_code_next; // hash next + u32 ind_alm_code_hashval; // hash value // func:lib_fm.FAlmCode..AssignOp inline lib_fm::FAlmCode& operator =(const lib_fm::FAlmCode &rhs) = delete; // func:lib_fm.FAlmCode..CopyCtor @@ -512,9 +514,10 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_fm_gen.h](/include/gen/lib_fm_gen.h) ``` struct FAlmObjtype { // lib_fm.FAlmObjtype - fm::Objtype alm_objtype; // Object type - fm::Summary summary; // Object type summary - lib_fm::FAlmObjtype* ind_alm_objtype_next; // hash next + fm::Objtype alm_objtype; // Object type + fm::Summary summary; // Object type summary + lib_fm::FAlmObjtype* ind_alm_objtype_next; // hash next + u32 ind_alm_objtype_hashval; // hash value // func:lib_fm.FAlmObjtype..AssignOp inline lib_fm::FAlmObjtype& operator =(const lib_fm::FAlmObjtype &rhs) = delete; // func:lib_fm.FAlmObjtype..CopyCtor diff --git a/txt/lib/lib_git/README.md b/txt/lib/lib_git/README.md index e293ff1f..122f00f2 100644 --- a/txt/lib/lib_git/README.md +++ b/txt/lib/lib_git/README.md @@ -18,9 +18,9 @@ Functions exported from this namespace: ```c++ -// Return current git ref, e.g. ac18e6cb142a86136b58561f2f1d63e3ff4b749e -// Any error output is suppressed. -tempstr lib_git::CurrentRef() +// Check that specified DIR is free of any git modifications. +// If failed, throw exception with MSG. +void lib_git::CheckGitCleanX(strptr dir, strptr msg) ``` ```c++ @@ -30,47 +30,47 @@ tempstr lib_git::CurrentBranch() ``` ```c++ -// Return date + gitref string describing most recent commit, e.g. 2017-05-24.21f8ce8 -tempstr lib_git::ShortRef() +// Return current git ref, e.g. ac18e6cb142a86136b58561f2f1d63e3ff4b749e +// Any error output is suppressed. +tempstr lib_git::CurrentRef() ``` ```c++ -// Return most recent log entry -// If there was a merge, this will describe 2 or more commits. If there was a straight -// commit, there will be just 1 entry (compare with git log -1) -tempstr lib_git::LastCommitLog() +// Get year of latest commit of given file +u32 lib_git::GetLastCommitYear(strptr file) ``` ```c++ -// Check that specified DIR is free of any git modifications. -// Return a string describing modified files, or an empty string if none -tempstr lib_git::GitModifiedFiles(strptr dir) +// Get configured user: name +tempstr lib_git::GetUser() ``` ```c++ -// Check that specified DIR is free of any git modifications. -// If failed, throw exception with MSG. -void lib_git::CheckGitCleanX(strptr dir, strptr msg) +// Return TRUE if BRANCH is a valid git branch +bool lib_git::GitBranchExistsQ(strptr branch) ``` ```c++ -// Return TRUE if REMOTE is a valid git remote -bool lib_git::GitRemoteExistsQ(strptr remote) +// Check that specified DIR is free of any git modifications. +// Return a string describing modified files, or an empty string if none +tempstr lib_git::GitModifiedFiles(strptr dir) ``` ```c++ -// Return TRUE if BRANCH is a valid git branch -bool lib_git::GitBranchExistsQ(strptr branch) +// Return TRUE if REMOTE is a valid git remote +bool lib_git::GitRemoteExistsQ(strptr remote) ``` ```c++ -// Get configured user: name -tempstr lib_git::GetUser() +// Return most recent log entry +// If there was a merge, this will describe 2 or more commits. If there was a straight +// commit, there will be just 1 entry (compare with git log -1) +tempstr lib_git::LastCommitLog() ``` ```c++ -// Get year of latest commit of given file -u32 lib_git::GetLastCommitYear(strptr file) +// Return date + gitref string describing most recent commit, e.g. 2017-05-24.21f8ce8 +tempstr lib_git::ShortRef() ``` diff --git a/txt/lib/lib_http/README.md b/txt/lib/lib_http/README.md new file mode 100644 index 00000000..82204a7c --- /dev/null +++ b/txt/lib/lib_http/README.md @@ -0,0 +1,161 @@ +## lib_http - Library for HTTP support + + +### Table Of Contents + + +  •  [Functions](#functions)
+  •  [Inputs](#inputs)
+  •  [Sources](#sources)
+  •  [Dependencies](#dependencies)
+  •  [In Memory DB](#in-memory-db)
+ + + +### Functions + + +Functions exported from this namespace: + +```c++ +// Get single line of HTTP ptotocol +bool lib_http::DecodeLine(strptr &buf, strptr &result) +``` + +```c++ +// decode HTTP request +bool lib_http::DecodeRequest(strptr &buf, http::Request &request) +``` + +```c++ +// Encode HTTP response +void lib_http::EncodeResponse(cstring &buf, http::Response &response) +``` + +```c++ +// Get HTTP message length +// TODO content-length, chunked +i32 lib_http::GetMsgLen(strptr buf) +``` + +```c++ +// Whether http list contains token +bool lib_http::ListContainsQ(strptr list, strptr token) +``` + +```c++ +strptr &lib_http::List_curs_Access(List_curs &curs) +``` + +```c++ +void lib_http::List_curs_Next(List_curs &curs) +``` + +```c++ +void lib_http::List_curs_Reset(List_curs &curs, strptr list) +``` + +```c++ +bool lib_http::List_curs_ValidQ(List_curs &curs) +``` + +```c++ +// Add request header +bool lib_http::SetRequestHeader(http::Request &request, strptr name, strptr value) +``` + + + +### Inputs + + +`lib_http` takes the following tables on input: +|Ssimfile|Comment| +|---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| + + + +### Sources + + +The source code license is GPL +The following source files are part of this tool: + +|Source File|Comment| +|---|---| +|[cpp/gen/lib_http_gen.cpp](/cpp/gen/lib_http_gen.cpp)|| +|[cpp/lib_http/lib_http.cpp](/cpp/lib_http/lib_http.cpp)|| +|[include/gen/lib_http_gen.h](/include/gen/lib_http_gen.h)|| +|[include/gen/lib_http_gen.inl.h](/include/gen/lib_http_gen.inl.h)|| +|[include/lib_http.h](/include/lib_http.h)|| + + + +### Dependencies + + +The build target depends on the following libraries +|Target|Comment| +|---|---| +|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| +|[lib_prot](/txt/lib/lib_prot/README.md)|Library covering all protocols| + + + +### In Memory DB + + +`lib_http` generated code creates the tables below. +All allocations are done through global `lib_http::_db` [lib_http.FDb](#lib_http-fdb) structure +|Ctype|Ssimfile|Create|Access| +|---|---|---|---| +|[lib_http.FStatus](#lib_http-fstatus)|[httpdb.status](/txt/ssimdb/httpdb/status.md)|FDb.status (Inlary)|**static**| +|[lib_http.FDb](#lib_http-fdb)||FDb._db (Global)| + +#### lib_http.FStatus - + + +#### lib_http.FStatus Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_http.FStatus.base|[httpdb.Status](/txt/ssimdb/httpdb/status.md)|[Base](/txt/ssimdb/httpdb/status.md)||| + +#### Struct FStatus + +*Note:* field ``lib_http.FStatus.base`` has reftype ``base`` so the fields of [httpdb.Status](/txt/ssimdb/httpdb/status.md) above are included into the resulting struct. + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_http_gen.h](/include/gen/lib_http_gen.h) +``` +struct FStatus { // lib_http.FStatus + algo::Smallstr50 status; // + // func:lib_http.FStatus..Ctor + inline FStatus() __attribute__((nothrow)); +}; +``` + +#### lib_http.FDb - + + +#### lib_http.FDb Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_http.FDb._db|[lib_http.FDb](/txt/lib/lib_http/README.md#lib_http-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| +|lib_http.FDb.status|[lib_http.FStatus](/txt/lib/lib_http/README.md#lib_http-fstatus)|[Inlary](/txt/exe/amc/reftypes.md#inlary)||| + +#### Struct FDb + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_http_gen.h](/include/gen/lib_http_gen.h) +``` +struct FDb { // lib_http.FDb + u128 status_data[sizeu128(lib_http::FStatus,40)]; // place for data + i32 status_n; // number of elems current in existence + enum { status_max = 40 }; + lib_http::trace trace; // +}; +``` + + + diff --git a/txt/lib/lib_iconv/README.md b/txt/lib/lib_iconv/README.md index bd079d38..7dfdfb28 100644 --- a/txt/lib/lib_iconv/README.md +++ b/txt/lib/lib_iconv/README.md @@ -4,34 +4,12 @@ ### Table Of Contents -  •  [Ctypes](#ctypes)
  •  [Functions](#functions)
-  •  [Inputs](#inputs)
  •  [Sources](#sources)
-  •  [Dependencies](#dependencies)
  •  [In Memory DB](#in-memory-db)
-### Ctypes - -Other ctypes in this namespace which don't have own readme files - -#### lib_iconv.FDb - In-memory database for lib_iconv - - -|Name|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|_db|lib_iconv.FDb|Global| -|icd|lib_iconv.Icd|Cppstack||Provides default name for variables of this type| - -#### lib_iconv.Icd - - - -|Name|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|icd|iconv_t|Val|((iconv_t)-1)|iconv descriptor| - ### Functions @@ -42,13 +20,13 @@ void lib_iconv::Close(lib_iconv::Icd &icd) ``` ```c++ -// open conversion descriptor -void lib_iconv::Open(lib_iconv::Icd& icd, strptr tocode, strptr fromcode) +// convert multibyte sequence +tempstr lib_iconv::Convert(lib_iconv::Icd &icd, strptr in, bool no_throw) ``` ```c++ -// convert multibyte sequence -tempstr lib_iconv::Convert(lib_iconv::Icd &icd, strptr in, bool no_throw) +// open conversion descriptor +void lib_iconv::Open(lib_iconv::Icd& icd, strptr tocode, strptr fromcode) ``` ```c++ @@ -57,16 +35,6 @@ void lib_iconv::icd_Cleanup(lib_iconv::Icd &icd) -### Inputs - - -`lib_iconv` takes the following tables on input: -|Ssimfile|Comment| -|---|---| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| - - - ### Sources @@ -83,16 +51,6 @@ The following source files are part of this tool: -### Dependencies - - -The build target depends on the following libraries -|Target|Comment| -|---|---| -|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| - - - ### In Memory DB diff --git a/txt/lib/lib_json/README.md b/txt/lib/lib_json/README.md index 8284131f..d48e6bb1 100644 --- a/txt/lib/lib_json/README.md +++ b/txt/lib/lib_json/README.md @@ -4,115 +4,66 @@ ### Table Of Contents -  •  [Ctypes](#ctypes)
  •  [Functions](#functions)
-  •  [Inputs](#inputs)
  •  [Sources](#sources)
-  •  [Dependencies](#dependencies)
  •  [In Memory DB](#in-memory-db)
-### Ctypes - -Other ctypes in this namespace which don't have own readme files - -#### lib_json.FDb - In-memory database for lib_json - - -|Name|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|lpool|u8|Lpool||private memory pool| -|_db|lib_json.FDb|Global| -|node|lib_json.FNode|Tpool| -|ind_objfld|lib_json.FNode|Thash| -|JsonNumChar|algo.Charset|Charset| -|JsonFirstNumChar|algo.Charset|Charset| - -#### lib_json.FNode - - - -|Name|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|p_parent|lib_json.FNode|Upptr||Parent node, may be NULL| -|c_child|lib_json.FNode|Ptrary||Child node(s)| -|type|u32|Val| -|value|algo.cstring|Val| -|fldkey|lib_json.FldKey|Val| - -#### lib_json.FParser - - - -|Name|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|buf|algo.strptr|Val| -|ind|i32|Val| -|node|lib_json.FNode|Ptr| -|root_node|lib_json.FNode|Ptr| -|state|u32|Val| -|need_comma|bool|Val| -|have_comma|bool|Val| -|need_colon|bool|Val| -|err_info|algo.cstring|Val| -|err_offset|i32|Val| -|offset|i32|Val| -|uesc_value|u32|Val| -|uesc_need|u8|Val| -|value|algo.cstring|Val| - -#### lib_json.FldKey - - - -|Name|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|object|lib_json.FNode|Ptr| -|field|algo.strptr|Val| - ### Functions Functions exported from this namespace: ```c++ -// Note: this detects duplicate field names. -inline bool NodeParentingRulesOkQ(lib_json::FNode *parent, lib_json_FNode_type_Enum type, strptr value) +lib_json::FNode *bool_FmtJson(bool value, lib_json::FNode *parent) ``` ```c++ -// Create new node -// enforce hierarchy rules -lib_json::FNode &lib_json::NewNode(lib_json::FNode *parent, lib_json_FNode_type_Enum type, strptr field) +lib_json::FNode *char_FmtJson(char value, lib_json::FNode *parent) ``` ```c++ -// PARENT parent node or NULL -// TYPE node type -// VALUE node value where applicable (only for field, string, number) -lib_json::FNode &lib_json::NewNode(lib_json::FNode *parent, lib_json_FNode_type_Enum type) +lib_json::FNode *double_FmtJson(double value, lib_json::FNode *parent) ``` ```c++ -lib_json::FNode &lib_json::NewFieldNode(lib_json::FNode *parent, strptr field) +lib_json::FNode *float_FmtJson(float value, lib_json::FNode *parent) ``` ```c++ -lib_json::FNode &lib_json::NewObjectNode(lib_json::FNode *parent, strptr field = strptr()) +lib_json::FNode *i8_FmtJson(i8 value, lib_json::FNode *parent) ``` ```c++ -lib_json::FNode &lib_json::NewArrayNode(lib_json::FNode *parent, strptr field = strptr()) +lib_json::FNode *i16_FmtJson(i16 value, lib_json::FNode *parent) ``` ```c++ -lib_json::FNode &lib_json::NewStringNode(lib_json::FNode *parent, strptr field = strptr(), strptr value = strptr()) +lib_json::FNode *i32_FmtJson(i32 value, lib_json::FNode *parent) ``` ```c++ -lib_json::FNode &lib_json::NewNumberNode(lib_json::FNode *parent, strptr field = strptr(), strptr value = strptr("0")) +lib_json::FNode *i64_FmtJson(i64 value, lib_json::FNode *parent) ``` ```c++ -inline bool ScalarNodeQ(lib_json::FNode &node) +lib_json::FNode *u8_FmtJson(u8 value, lib_json::FNode *parent) +``` + +```c++ +lib_json::FNode *u16_FmtJson(u16 value, lib_json::FNode *parent) +``` + +```c++ +lib_json::FNode *u32_FmtJson(u32 value, lib_json::FNode *parent) +``` + +```c++ +// +// predefined conversion functions +// +lib_json::FNode *u64_FmtJson(u64 value, lib_json::FNode *parent) ``` ```c++ @@ -132,8 +83,24 @@ bool lib_json::JsonParse(lib_json::FParser &parser, strptr buf) ``` ```c++ -// AMC cleanup function - automatically delete parsed JSON tree -void lib_json::root_node_Cleanup(lib_json::FParser& parent) +// Check for parse error +// +// PARSER parser handle +// RETURN true for OK, false for parse error +inline bool lib_json::JsonParseOkQ(lib_json::FParser &parser) +``` + +```c++ +// Serialize to string +// Serialize to JSON tree to text +// NODE root node to start from +// OUT target string +// PRETTY pretty printer setting: +// 0 = no pretty printer (compact output) +// 1 = algo style pretty printer +// 2 = standard (jq) style) pretty printer +// INDENT level of indenting (for pretty-formatting) +void lib_json::JsonSerialize(lib_json::FNode* node, cstring &out, u32 pretty = 0, u32 indent = 0) ``` ```c++ @@ -145,147 +112,133 @@ void lib_json::root_node_Cleanup(lib_json::FParser& parent) // quotation mark, reverse solidus, and the control characters (U+0000 // through U+001F)." // -- this says that solidus need not be escaped when printing -- only when parsing! -void lib_json::JsonSerializeString(algo::strptr str, algo::cstring &lhs) +void lib_json::JsonSerializeString(algo::strptr str, algo::cstring &out) ``` ```c++ -// Serialize to string -// Serialize to JSON tree to text -// NODE root node to start from -// LHS target string -// PRETTY whether or not pretty-format -// INDENT level of indenting (for pretty-formatting) -void lib_json::JsonSerialize(lib_json::FNode* node, cstring &lhs, bool pretty, u32 indent) -``` - -```c++ -void lib_json::JsonSerialize(lib_json::FNode* node, cstring &lhs, bool pretty) -``` - -```c++ -void lib_json::JsonSerialize(lib_json::FNode* node, cstring &lhs) -``` - -```c++ -// Find node in object chain -// PARENT node to start from -// PATH dot-separated list of field keys -// e.g. path abc.def.ghi and parent pointing to {"abc:{"def":{"ghi":value}}} -// yields value node -lib_json::FNode* lib_json::node_Find(lib_json::FNode* parent, strptr path) -``` - -```c++ -// Get node value as string -// Empty string is returned in case of any error or null value -// true/false is converted to 0/1 -// -// PARENT node to start from -// PATH dot-separated list of field keys -strptr lib_json::strptr_Get(lib_json::FNode* parent, strptr path) +lib_json::FNode &lib_json::NewArrayNode(lib_json::FNode *parent, strptr field = strptr()) ``` ```c++ -// Get array node, NULL in case of any error -// -// PARENT node to start from -// PATH dot-separated list of field keys -lib_json::FNode* lib_json::node_GetArray(lib_json::FNode* parent, strptr path) +lib_json::FNode &lib_json::NewBoolNode(lib_json::FNode *parent, strptr field = strptr(), bool value = true) ``` ```c++ -// Get node value as u32 -// If the path is not found, or the value is malformatted, DFLT is returned. -// true/false is converted to 0/1 -// -// PARENT node to start from -// PATH dot-separated list of field keys -u32 lib_json::u32_Get(lib_json::FNode* parent, strptr path, int dflt = 0) +lib_json::FNode &lib_json::NewFieldNode(lib_json::FNode *parent, strptr field) ``` ```c++ -// -// predefined conversion functions -// -lib_json::FNode *u64_FmtJson(u64 value, lib_json::FNode *parent) +// PARENT parent node or NULL +// TYPE node type +// VALUE node value where applicable (only for field, string, number) +// Construct 2 nodes, a "field" node which has the name FIELD, and its value +// of type TYPE. Return the VALUE +lib_json::FNode &lib_json::NewFieldVal(lib_json::FNode *parent, lib_json_FNode_type_Enum type, strptr field) ``` ```c++ -lib_json::FNode *u32_FmtJson(u32 value, lib_json::FNode *parent) +// PARENT parent node or NULL +// TYPE node type +// VALUE node value where applicable (only for field, string, number) +lib_json::FNode &lib_json::NewNode(lib_json::FNode *parent, lib_json_FNode_type_Enum type) ``` ```c++ -lib_json::FNode *u16_FmtJson(u16 value, lib_json::FNode *parent) +// Create new node +// enforce hierarchy rules +lib_json::FNode &lib_json::NewNode(lib_json::FNode *parent, lib_json_FNode_type_Enum type, strptr field) ``` ```c++ -lib_json::FNode *u8_FmtJson(u8 value, lib_json::FNode *parent) +lib_json::FNode &lib_json::NewNumberNode(lib_json::FNode *parent, strptr field = strptr(), strptr value = strptr("0")) ``` ```c++ -lib_json::FNode *i64_FmtJson(i64 value, lib_json::FNode *parent) +lib_json::FNode &lib_json::NewObjectNode(lib_json::FNode *parent, strptr field = strptr()) ``` ```c++ -lib_json::FNode *i32_FmtJson(i32 value, lib_json::FNode *parent) +lib_json::FNode &lib_json::NewStringNode(lib_json::FNode *parent, strptr field = strptr(), strptr value = strptr()) ``` ```c++ -lib_json::FNode *i16_FmtJson(i16 value, lib_json::FNode *parent) +// Note: this detects duplicate field names. +inline bool NodeParentingRulesOkQ(lib_json::FNode *parent, lib_json_FNode_type_Enum type, strptr value) ``` ```c++ -lib_json::FNode *i8_FmtJson(i8 value, lib_json::FNode *parent) +inline bool ScalarNodeQ(lib_json::FNode &node) ``` ```c++ -lib_json::FNode *double_FmtJson(double value, lib_json::FNode *parent) +// Get node value as bool +// number is converted: zero - false, nonzero true +// empty string - false, non-empty string true +// On any error, DFLT is returned. +// +// PARENT node to start from +// PATH dot-separated list of field keys +u32 lib_json::bool_Get(lib_json::FNode* parent, strptr path, int dflt = false) ``` ```c++ -lib_json::FNode *float_FmtJson(float value, lib_json::FNode *parent) +lib_json::FldKey lib_json::fldkey_Get(lib_json::FNode &node) ``` ```c++ -lib_json::FNode *bool_FmtJson(bool value, lib_json::FNode *parent) +// Get node value as u32 +// If the path is not found, or the value is malformatted, DFLT is returned. +// true/false is converted to 0/1 +// +// PARENT node to start from +// PATH dot-separated list of field keys +u32 lib_json::i32_Get(lib_json::FNode* parent, strptr path, int dflt = 0) ``` ```c++ -lib_json::FNode *char_FmtJson(char value, lib_json::FNode *parent) +// Find node in object chain +// PARENT node to start from +// PATH dot-separated list of field keys +// e.g. path abc.def.ghi and parent pointing to {"abc:{"def":{"ghi":value}}} +// yields value node +lib_json::FNode* lib_json::node_Find(lib_json::FNode* parent, strptr path) ``` ```c++ -lib_json::FNode *algo::strptr_FmtJson(const algo::strptr value, lib_json::FNode *parent) +// Get array node, NULL in case of any error +// +// PARENT node to start from +// PATH dot-separated list of field keys +lib_json::FNode* lib_json::node_GetArray(lib_json::FNode* parent, strptr path) ``` ```c++ -lib_json::FNode *algo::cstring_FmtJson(algo::cstring &value, lib_json::FNode *parent) +// AMC cleanup function - automatically delete parsed JSON tree +void lib_json::root_node_Cleanup(lib_json::FParser& parent) ``` ```c++ -lib_json::FldKey lib_json::fldkey_Get(lib_json::FNode &node) +// Get node value as string +// Empty string is returned in case of any error or null value +// true/false is converted to 0/1 +// +// PARENT node to start from +// PATH dot-separated list of field keys +strptr lib_json::strptr_Get(lib_json::FNode* parent, strptr path) ``` ```c++ -// Check for parse error +// Get node value as u32 +// If the path is not found, or the value is malformatted, DFLT is returned. +// true/false is converted to 0/1 // -// PARSER parser handle -// RETURN true for OK, false for parse error -inline bool lib_json::JsonParseOkQ(lib_json::FParser &parser) +// PARENT node to start from +// PATH dot-separated list of field keys +u32 lib_json::u32_Get(lib_json::FNode* parent, strptr path, int dflt = 0) ``` -### Inputs - - -`lib_json` takes the following tables on input: -|Ssimfile|Comment| -|---|---| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| - - - ### Sources @@ -303,16 +256,6 @@ The following source files are part of this tool: -### Dependencies - - -The build target depends on the following libraries -|Target|Comment| -|---|---| -|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| - - - ### In Memory DB @@ -327,7 +270,7 @@ All allocations are done through global `lib_json::_db` [lib_json.FDb](#lib_json ||||FNode.c_child (Ptrary)| ||||FParser.node (Ptr)| ||||FParser.root_node (Ptr)| -||||FldKey.object (Ptr)| +||||FldKey.p_object (Upptr)| |[lib_json.FParser](#lib_json-fparser)|| #### lib_json.FDb - In-memory database for lib_json @@ -366,7 +309,7 @@ struct FDb { // lib_json.FDb: In-memory database for lib_json |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|lib_json.FldKey.object|[lib_json.FNode](/txt/lib/lib_json/README.md#lib_json-fnode)|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| +|lib_json.FldKey.p_object|[lib_json.FNode](/txt/lib/lib_json/README.md#lib_json-fnode)|[Upptr](/txt/exe/amc/reftypes.md#upptr)||| |lib_json.FldKey.field|[algo.strptr](/txt/protocol/algo/strptr.md)|[Val](/txt/exe/amc/reftypes.md#val)||| #### Struct FldKey @@ -374,8 +317,8 @@ struct FDb { // lib_json.FDb: In-memory database for lib_json Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_json_gen.h](/include/gen/lib_json_gen.h) ``` struct FldKey { // lib_json.FldKey - lib_json::FNode* object; // optional pointer - algo::strptr field; // + lib_json::FNode* p_object; // reference to parent row + algo::strptr field; // // func:lib_json.FldKey..EqOp inline bool operator ==(const lib_json::FldKey &rhs) const __attribute__((nothrow)); // func:lib_json.FldKey..NeOp @@ -391,7 +334,7 @@ struct FldKey { // lib_json.FldKey // func:lib_json.FldKey..Ctor inline FldKey() __attribute__((nothrow)); // func:lib_json.FldKey..FieldwiseCtor - explicit inline FldKey(lib_json::FNode* in_object, algo::strptr in_field) __attribute__((nothrow)); + explicit inline FldKey(lib_json::FNode* in_p_object, algo::strptr in_field) __attribute__((nothrow)); }; ``` @@ -415,6 +358,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_json_gen.h](/in struct FNode { // lib_json.FNode lib_json::FNode* node_next; // Pointer to next free element int tpool lib_json::FNode* ind_objfld_next; // hash next + u32 ind_objfld_hashval; // hash value lib_json::FNode* p_parent; // reference to parent row lib_json::FNode** c_child_elems; // array of pointers u32 c_child_n; // array of pointers diff --git a/txt/lib/lib_mysql/README.md b/txt/lib/lib_mysql/README.md index 7f515662..97faa7d2 100644 --- a/txt/lib/lib_mysql/README.md +++ b/txt/lib/lib_mysql/README.md @@ -4,52 +4,29 @@ ### Table Of Contents -  •  [Ctypes](#ctypes)
  •  [Functions](#functions)
-  •  [Inputs](#inputs)
  •  [Sources](#sources)
-  •  [Dependencies](#dependencies)
  •  [In Memory DB](#in-memory-db)
-### Ctypes - -Other ctypes in this namespace which don't have own readme files - -#### lib_mysql.FDb - In-memory database for lib_mysql - - -|Name|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|res|lib_mysql.Res|Cppstack||Provides default name for variables of this type| -|_db|lib_mysql.FDb|Global| -|mysql|MYSQL|Ptr| - -#### lib_mysql.Res - - - -|Name|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|res|MYSQL_RES|Ptr| - ### Functions Functions exported from this namespace: ```c++ -// LHS output buffer -// CONN mysql context (includes collation info) -// RHS string to print +// replace first occurence of ? in LHS with Y // QUOTES quotes to use (' or "); if set to zero, quotes are omitted. -void lib_mysql::MPrintQuoted(cstring &lhs, MYSQL *conn, strptr rhs, char quotes) +void lib_mysql::MBind(MYSQL *conn, cstring &lhs, strptr y, char quotes) ``` ```c++ -// replace first occurence of ? in LHS with Y +// LHS output buffer +// CONN mysql context (includes collation info) +// RHS string to print // QUOTES quotes to use (' or "); if set to zero, quotes are omitted. -void lib_mysql::MBind(MYSQL *conn, cstring &lhs, strptr y, char quotes) +void lib_mysql::MPrintQuoted(cstring &lhs, MYSQL *conn, strptr rhs, char quotes) ``` ```c++ @@ -71,16 +48,6 @@ void lib_mysql::res_Cleanup(lib_mysql::Res &res) -### Inputs - - -`lib_mysql` takes the following tables on input: -|Ssimfile|Comment| -|---|---| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| - - - ### Sources @@ -97,16 +64,6 @@ The following source files are part of this tool: -### Dependencies - - -The build target depends on the following libraries -|Target|Comment| -|---|---| -|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| - - - ### In Memory DB diff --git a/txt/lib/lib_netio/README.md b/txt/lib/lib_netio/README.md new file mode 100644 index 00000000..e84e9a01 --- /dev/null +++ b/txt/lib/lib_netio/README.md @@ -0,0 +1,303 @@ +## lib_netio - Network I/O library + + +### Table Of Contents + + +  •  [Functions](#functions)
+  •  [Inputs](#inputs)
+  •  [Sources](#sources)
+  •  [Dependencies](#dependencies)
+  •  [In Memory DB](#in-memory-db)
+ + + +### Functions + + +Functions exported from this namespace: + +```c++ +// accept remote connection: +// return connection socket and fills ipport with client address/port +algo::Fildes lib_netio::Accept(algo::Fildes listen_sock, ietf::Ipport &ipport) +``` + +```c++ +// Wrapper for bind() -- Ipport +bool lib_netio::Bind(algo::Fildes sock, ietf::Ipport ipport) +``` + +```c++ +// Wrapper for bind() -- strptr +bool lib_netio::Bind(algo::Fildes sock, strptr addr) +``` + +```c++ +// Wrapper for bind to netlink +bool lib_netio::BindNetlink(algo::Fildes sock) +``` + +```c++ +// Wrapper for connect() -- ipport +bool lib_netio::Connect(algo::Fildes sock, ietf::Ipport ipport) +``` + +```c++ +// Wrapper for connect() -- strptr +int lib_netio::Connect(algo::Fildes sock, strptr addr) +``` + +```c++ +// Create Netlink socket +algo::Fildes lib_netio::CreateNetlinkSocket() +``` + +```c++ +// Create TCP socket +algo::Fildes lib_netio::CreateTcpSocket() +``` + +```c++ +// Create UDP socket +algo::Fildes lib_netio::CreateUdpSocket() +``` + +```c++ +// find interface name for known ip +tempstr lib_netio::FindInterfaceByIpv4(algo::Fildes sock, ietf::Ipv4 &ip) +``` + +```c++ +tempstr lib_netio::GetHostAddr(strptr hostname) +``` + +```c++ +// get hardware address for intrface +bool lib_netio::GetHwAddrFamily(algo::Fildes sock, strptr name, sa_family_t &result) +``` + +```c++ +// get list of interface names as space-separated string +tempstr lib_netio::GetInterfaces(algo::Fildes sock) +``` + +```c++ +// Get local ip/port -- getsockname() +bool lib_netio::GetIpportLocal(algo::Fildes sock, ietf::Ipport &ipport) +``` + +```c++ +// Get remote ip/port -- getpeername() +bool lib_netio::GetIpportRemote(algo::Fildes sock, ietf::Ipport &ipport) +``` + +```c++ +// get ip address of interface +bool lib_netio::GetIpv4(algo::Fildes sock, strptr name, ietf::Ipv4 &result) +``` + +```c++ +// Get socket error -- getsockopt(SO_ERROR); +// in case of getsockopt failure, return errno +int lib_netio::GetSocketError(algo::Fildes sock) +``` + +```c++ +// ioctl with ifreq +bool lib_netio::Ioctl(algo::Fildes sock, strptr name, u32 request, ifreq &ifr) +``` + +```c++ +// Wrapper for listen() -- strptr +bool lib_netio::Listen(algo::Fildes sock, int backlog) +``` + +```c++ +inline bool lib_netio::MulticastQ(ietf::Ipv4 addr) +``` + +```c++ +// send GETLINK netlink request +bool lib_netio::RequestLinkDump(algo::Fildes sock) +``` + +```c++ +// Resolve ip:port or : to an Ipport struct +ietf::Ipport lib_netio::Resolve(algo::strptr addr) +``` + +```c++ +// Wrapper for setsockopt(SO_LINGER) - timeout in seconds to drain output buffers before close(). +// set 0 to drop connection with RST. +bool lib_netio::SetLinger(algo::Fildes sock, algo::UnixDiff timeout = algo::UnixDiff()) +``` + +```c++ +// Set multicast send interface (default specified by system administrator) +bool lib_netio::SetMulticastInterface(algo::Fildes sock, ietf::Ipv4 interface) +``` + +```c++ +// Set multicast loop (enabled by defult) +bool lib_netio::SetMulticastLoop(algo::Fildes sock, bool loop) +``` + +```c++ +// Join or leave multicast group (on the interface basis!) +bool lib_netio::SetMulticastMembership(algo::Fildes sock, ietf::Ipv4 group, ietf::Ipv4 interface, bool membership) +``` + +```c++ +// Set multicast TTL +// TTL Scope +// 0 Restricted to the same host. Won't be output by any interface. +// 1 Restricted to the same subnet. Won't be forwarded by a router. This is the default. +// <32 Restricted to the same site, organization or department. +// <64 Restricted to the same region. +// <128 Restricted to the same continent. +// <255 Unrestricted in scope. Global. +bool lib_netio::SetMulticastTtl(algo::Fildes sock, u8 ttl) +``` + +```c++ +// Set receive buffer size -- setsockopt(SO_RCVBUF) +bool lib_netio::SetReceiveBufferSize(algo::Fildes sock, int size) +``` + +```c++ +// Wrapper for setsockopt(SO_REUSEADDR) +bool lib_netio::SetReuseAddress(algo::Fildes sock, bool value = true) +``` + +```c++ +// Set send buffer size -- setsockopt(SO_SNDBUF) +bool lib_netio::SetSendBufferSize(algo::Fildes sock, int size) +``` + +```c++ +// Wrapper for setsockopt +template bool lib_netio::SetSocketOption(algo::Fildes sock, int level, int option, const T &value) +``` + +```c++ +// Set TCP keepalive +bool lib_netio::SetTcpKeepalive(algo::Fildes sock, bool on = true, algo::UnixDiff idle = algo::UnixDiff(2), algo::UnixDiff interval = algo::UnixDiff(2), int max_probes = 5) +``` + +```c++ +// Wrapper for setsockopt(TCP_NODELAY) +bool lib_netio::SetTcpNoDelay(algo::Fildes sock, bool value = true) +``` + + + +### Inputs + + +`lib_netio` takes the following tables on input: +|Ssimfile|Comment| +|---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| + + + +### Sources + + +The source code license is GPL +The following source files are part of this tool: + +|Source File|Comment| +|---|---| +|[cpp/gen/lib_netio_gen.cpp](/cpp/gen/lib_netio_gen.cpp)|| +|[cpp/lib_netio/socket.cpp](/cpp/lib_netio/socket.cpp)|| +|[include/gen/lib_netio_gen.h](/include/gen/lib_netio_gen.h)|| +|[include/gen/lib_netio_gen.inl.h](/include/gen/lib_netio_gen.inl.h)|| +|[include/lib_netio.h](/include/lib_netio.h)|| +|[include/lib_netio.inl.h](/include/lib_netio.inl.h)|| + + + +### Dependencies + + +The build target depends on the following libraries +|Target|Comment| +|---|---| +|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| + + + +### In Memory DB + + +`lib_netio` generated code creates the tables below. +All allocations are done through global `lib_netio::_db` [lib_netio.FDb](#lib_netio-fdb) structure +|Ctype|Ssimfile|Create|Access| +|---|---|---|---| +|[lib_netio.FDb](#lib_netio-fdb)||FDb._db (Global)| +|[lib_netio.FVar](#lib_netio-fvar)||FDb.var (Lary)|var (Lary, by rowid)|ind_var (Thash, hash field var)| + +#### lib_netio.FDb - + + +#### lib_netio.FDb Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_netio.FDb._db|[lib_netio.FDb](/txt/lib/lib_netio/README.md#lib_netio-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| +|lib_netio.FDb.var|[lib_netio.FVar](/txt/lib/lib_netio/README.md#lib_netio-fvar)|[Lary](/txt/exe/amc/reftypes.md#lary)||| +|lib_netio.FDb.ind_var|[lib_netio.FVar](/txt/lib/lib_netio/README.md#lib_netio-fvar)|[Thash](/txt/exe/amc/reftypes.md#thash)||| + +#### Struct FDb + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_netio_gen.h](/include/gen/lib_netio_gen.h) +``` +struct FDb { // lib_netio.FDb + lib_netio::FVar* var_lary[32]; // level array + i32 var_n; // number of elements in array + lib_netio::FVar** ind_var_buckets_elems; // pointer to bucket array + i32 ind_var_buckets_n; // number of elements in bucket array + i32 ind_var_n; // number of elements in the hash table + lib_netio::trace trace; // +}; +``` + +#### lib_netio.FVar - + + +#### lib_netio.FVar Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_netio.FVar.var|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_netio.FVar.value|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FVar + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_netio_gen.h](/include/gen/lib_netio_gen.h) +``` +struct FVar { // lib_netio.FVar + lib_netio::FVar* ind_var_next; // hash next + u32 ind_var_hashval; // hash value + algo::cstring var; // + algo::cstring value; // + // func:lib_netio.FVar..AssignOp + inline lib_netio::FVar& operator =(const lib_netio::FVar &rhs) = delete; + // func:lib_netio.FVar..CopyCtor + inline FVar(const lib_netio::FVar &rhs) = delete; +private: + // func:lib_netio.FVar..Ctor + inline FVar() __attribute__((nothrow)); + // func:lib_netio.FVar..Dtor + inline ~FVar() __attribute__((nothrow)); + friend lib_netio::FVar& var_Alloc() __attribute__((__warn_unused_result__, nothrow)); + friend lib_netio::FVar* var_AllocMaybe() __attribute__((__warn_unused_result__, nothrow)); + friend void var_RemoveAll() __attribute__((nothrow)); + friend void var_RemoveLast() __attribute__((nothrow)); +}; +``` + + + diff --git a/txt/lib/lib_prot/README.md b/txt/lib/lib_prot/README.md index 66530d8b..cfdbdff2 100644 --- a/txt/lib/lib_prot/README.md +++ b/txt/lib/lib_prot/README.md @@ -1,14 +1,6 @@ ## lib_prot - Library covering all protocols -### Table Of Contents - - -  •  [Sources](#sources)
-  •  [Dependencies](#dependencies)
- - - ### Sources @@ -24,8 +16,14 @@ The following source files are part of this tool: |[cpp/gen/fm_gen.cpp](/cpp/gen/fm_gen.cpp)|| |[cpp/gen/fmdb_gen.cpp](/cpp/gen/fmdb_gen.cpp)|| |[cpp/gen/gclidb_gen.cpp](/cpp/gen/gclidb_gen.cpp)|| +|[cpp/gen/http_gen.cpp](/cpp/gen/http_gen.cpp)|| +|[cpp/gen/httpdb_gen.cpp](/cpp/gen/httpdb_gen.cpp)|| |[cpp/gen/ietf_gen.cpp](/cpp/gen/ietf_gen.cpp)|| +|[cpp/gen/kafka_gen.cpp](/cpp/gen/kafka_gen.cpp)|| |[cpp/gen/lib_prot_gen.cpp](/cpp/gen/lib_prot_gen.cpp)|| +|[cpp/gen/sampdb_gen.cpp](/cpp/gen/sampdb_gen.cpp)|| +|[cpp/gen/ws_gen.cpp](/cpp/gen/ws_gen.cpp)|| +|[cpp/gen/wsdb_gen.cpp](/cpp/gen/wsdb_gen.cpp)|| |[include/gen/ams_gen.h](/include/gen/ams_gen.h)|| |[include/gen/ams_gen.inl.h](/include/gen/ams_gen.inl.h)|| |[include/gen/amsdb_gen.h](/include/gen/amsdb_gen.h)|| @@ -34,24 +32,28 @@ The following source files are part of this tool: |[include/gen/atf_gen.inl.h](/include/gen/atf_gen.inl.h)|| |[include/gen/atfdb_gen.h](/include/gen/atfdb_gen.h)|| |[include/gen/atfdb_gen.inl.h](/include/gen/atfdb_gen.inl.h)|| +|[include/gen/dmmeta_gen.h](/include/gen/dmmeta_gen.h)|| +|[include/gen/dmmeta_gen.inl.h](/include/gen/dmmeta_gen.inl.h)|| |[include/gen/fm_gen.h](/include/gen/fm_gen.h)|| |[include/gen/fm_gen.inl.h](/include/gen/fm_gen.inl.h)|| |[include/gen/fmdb_gen.h](/include/gen/fmdb_gen.h)|| |[include/gen/fmdb_gen.inl.h](/include/gen/fmdb_gen.inl.h)|| |[include/gen/gclidb_gen.h](/include/gen/gclidb_gen.h)|| |[include/gen/gclidb_gen.inl.h](/include/gen/gclidb_gen.inl.h)|| +|[include/gen/http_gen.h](/include/gen/http_gen.h)|| +|[include/gen/http_gen.inl.h](/include/gen/http_gen.inl.h)|| +|[include/gen/httpdb_gen.h](/include/gen/httpdb_gen.h)|| +|[include/gen/httpdb_gen.inl.h](/include/gen/httpdb_gen.inl.h)|| +|[include/gen/ietf_gen.h](/include/gen/ietf_gen.h)|| +|[include/gen/ietf_gen.inl.h](/include/gen/ietf_gen.inl.h)|| |[include/gen/lib_prot_gen.h](/include/gen/lib_prot_gen.h)|| |[include/gen/lib_prot_gen.inl.h](/include/gen/lib_prot_gen.inl.h)|| +|[include/gen/sampdb_gen.h](/include/gen/sampdb_gen.h)|| +|[include/gen/sampdb_gen.inl.h](/include/gen/sampdb_gen.inl.h)|| +|[include/gen/ws_gen.h](/include/gen/ws_gen.h)|| +|[include/gen/ws_gen.inl.h](/include/gen/ws_gen.inl.h)|| +|[include/gen/wsdb_gen.h](/include/gen/wsdb_gen.h)|| +|[include/gen/wsdb_gen.inl.h](/include/gen/wsdb_gen.inl.h)|| -### Dependencies - - -The build target depends on the following libraries -|Target|Comment| -|---|---| -|[lib_json](/txt/lib/lib_json/README.md)|Full json support library| - - - diff --git a/txt/lib/lib_rl/README.md b/txt/lib/lib_rl/README.md new file mode 100644 index 00000000..8d4eebdd --- /dev/null +++ b/txt/lib/lib_rl/README.md @@ -0,0 +1,237 @@ +## lib_rl - GNU readline support library + + +### Table Of Contents + + +  •  [Functions](#functions)
+  •  [Inputs](#inputs)
+  •  [Sources](#sources)
+  •  [Dependencies](#dependencies)
+  •  [In Memory DB](#in-memory-db)
+ + + +### Functions + + +Functions exported from this namespace: + +```c++ +// add line to history +void lib_rl::AddHistory(strptr line) +``` + +```c++ +// begin readline, user shall add own iohook function +void lib_rl::BeginReadline(strptr app, strptr prompt) +``` + +```c++ +// stop reading readline +void lib_rl::EndReadline() +``` + +```c++ +// whether EOF +bool lib_rl::EofQ() +``` + +```c++ +// stream error +int lib_rl::Error() +``` + +```c++ +// get line +strptr lib_rl::GetLine() +``` + +```c++ +// compose history file name +tempstr lib_rl::HistoryFile(strptr app) +``` + +```c++ +// initialize history from file +// TODO lock +void lib_rl::InitHistory() +``` + +```c++ +// Kill entire buffer +void lib_rl::KillBuffer() +``` + +```c++ +// get last history line, empty if none +strptr lib_rl::LastHistory() +``` + +```c++ +// whether the line is valid +bool lib_rl::LineValidQ() +``` + +```c++ +// called inside rl_callback_read_char() when new input line entered +void lib_rl::OnLine(char *zline) +``` + +```c++ +// prlog handler - safe print when redline is active +void lib_rl::Prlog(algo_lib::FLogcat *logcat, algo::SchedTime time, strptr str) +``` + +```c++ +// whether mode is readline or normal +bool lib_rl::ReadlineQ() +``` + +```c++ +// setup own prlog function +void lib_rl::RedirectPrlog() +``` + +```c++ +// restore prlog function +void lib_rl::RestorePrlog() +``` + +```c++ +void lib_rl::SetPrompt(algo::strptr prompt) +``` + +```c++ +// Skip current line +void lib_rl::SkipLine() +``` + +```c++ +// whether realine in substate - not bare chars +bool lib_rl::SubstateQ() +``` + +```c++ +// switch mode 0 - normal, 1 - readline +void lib_rl::SwitchMode(int mode) +``` + +```c++ +// restore terminal settings +void lib_rl::iohook_Cleanup() +``` + + + +### Inputs + + +`lib_rl` takes the following tables on input: +|Ssimfile|Comment| +|---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| + + + +### Sources + + +The source code license is GPL +The following source files are part of this tool: + +|Source File|Comment| +|---|---| +|[cpp/gen/lib_rl_gen.cpp](/cpp/gen/lib_rl_gen.cpp)|| +|[cpp/lib_rl/lib_rl.cpp](/cpp/lib_rl/lib_rl.cpp)|| +|[include/gen/lib_rl_gen.h](/include/gen/lib_rl_gen.h)|| +|[include/gen/lib_rl_gen.inl.h](/include/gen/lib_rl_gen.inl.h)|| +|[include/lib_rl.h](/include/lib_rl.h)|| + + + +### Dependencies + + +The build target depends on the following libraries +|Target|Comment| +|---|---| +|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| +|[lib_prot](/txt/lib/lib_prot/README.md)|Library covering all protocols| + + + +### In Memory DB + + +`lib_rl` generated code creates the tables below. +All allocations are done through global `lib_rl::_db` [lib_rl.FDb](#lib_rl-fdb) structure +|Ctype|Ssimfile|Create|Access| +|---|---|---|---| +|[lib_rl.Cmdline](#lib_rl-cmdline)|| +|[lib_rl.FDb](#lib_rl-fdb)||FDb._db (Global)| + +#### lib_rl.Cmdline - + + +#### lib_rl.Cmdline Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_rl.Cmdline.app|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|Application name| +|lib_rl.Cmdline.prompt|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|Application name| +|lib_rl.Cmdline.add_history|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Automatically add to history| +|lib_rl.Cmdline.max_history|i32|[Val](/txt/exe/amc/reftypes.md#val)|1000|Number to history entries to keep| + +#### Struct Cmdline + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_rl_gen.h](/include/gen/lib_rl_gen.h) +``` +struct Cmdline { // lib_rl.Cmdline + algo::cstring app; // "" Application name + algo::cstring prompt; // "" Application name + bool add_history; // true Automatically add to history + i32 max_history; // 1000 Number to history entries to keep + // func:lib_rl.Cmdline..Ctor + inline Cmdline() __attribute__((nothrow)); +}; +``` + +#### lib_rl.FDb - + + +#### lib_rl.FDb Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_rl.FDb._db|[lib_rl.FDb](/txt/lib/lib_rl/README.md#lib_rl-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| +|lib_rl.FDb.cmdline|[lib_rl.Cmdline](/txt/lib/lib_rl/README.md#lib_rl-cmdline)|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_rl.FDb.Prlog|[algo.PrlogFcn](/txt/protocol/algo/PrlogFcn.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_rl.FDb.history_file|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_rl.FDb.iohook|[algo_lib.FIohook](/txt/lib/algo_lib/README.md#algo_lib-fiohook)|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_rl.FDb.line|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_rl.FDb.line_valid|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_rl.FDb.eof|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_rl.FDb.err|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|lib_rl.FDb.isatty|bool|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FDb + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_rl_gen.h](/include/gen/lib_rl_gen.h) +``` +struct FDb { // lib_rl.FDb + lib_rl::Cmdline cmdline; // + algo::PrlogFcn Prlog; // + algo::cstring history_file; // + algo_lib::FIohook iohook; // + algo::cstring line; // + bool line_valid; // false + bool eof; // false + i32 err; // 0 + bool isatty; // false + lib_rl::trace trace; // +}; +``` + + + diff --git a/txt/lib/lib_sql/README.md b/txt/lib/lib_sql/README.md index 245c2499..8f0cb2a1 100644 --- a/txt/lib/lib_sql/README.md +++ b/txt/lib/lib_sql/README.md @@ -18,16 +18,13 @@ Functions exported from this namespace: ```c++ -// SQL-quote string S -// and return result -const tempstr lib_sql::SqlQuoted(strptr s) +// Declare attribute NAME as boolean so it can be translated to SQL Server format +void lib_sql::DeclareBool(strptr name) ``` ```c++ -// Return contents of ATTR as a SQL expression in the context of tuple TUPLE. -// The string is properly quoted (i.e. SqlQuoted is not required) -// Translation is controlled with DeclareBool etc. -const tempstr lib_sql::SqlQuotedValue(Tuple &tuple, Attr &attr) +// Return a comma-separate SQL name=value list +const tempstr lib_sql::SqlNameValues(Tuple &tuple) ``` ```c++ @@ -36,8 +33,16 @@ const tempstr lib_sql::SqlNames(Tuple &tuple) ``` ```c++ -// Return a comma-separate SQL name=value list -const tempstr lib_sql::SqlNameValues(Tuple &tuple) +// SQL-quote string S +// and return result +const tempstr lib_sql::SqlQuoted(strptr s) +``` + +```c++ +// Return contents of ATTR as a SQL expression in the context of tuple TUPLE. +// The string is properly quoted (i.e. SqlQuoted is not required) +// Translation is controlled with DeclareBool etc. +const tempstr lib_sql::SqlQuotedValue(Tuple &tuple, Attr &attr) ``` ```c++ @@ -51,11 +56,6 @@ tempstr lib_sql::SqlValues(Tuple &tuple) void lib_sql::UpsertOrDelete(strptr strtuple, strptr tablename, cstring &query, bool del) ``` -```c++ -// Declare attribute NAME as boolean so it can be translated to SQL Server format -void lib_sql::DeclareBool(strptr name) -``` - ### Inputs @@ -119,9 +119,10 @@ All allocations are done through global `lib_sql::_db` [lib_sql.FDb](#lib_sql-fd Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_sql_gen.h](/include/gen/lib_sql_gen.h) ``` struct FAttr { // lib_sql.FAttr - algo::cstring attr; // - bool isbool; // false - lib_sql::FAttr* ind_attr_next; // hash next + algo::cstring attr; // + bool isbool; // false + lib_sql::FAttr* ind_attr_next; // hash next + u32 ind_attr_hashval; // hash value // func:lib_sql.FAttr..AssignOp inline lib_sql::FAttr& operator =(const lib_sql::FAttr &rhs) = delete; // func:lib_sql.FAttr..CopyCtor diff --git a/txt/lib/lib_sqlite/README.md b/txt/lib/lib_sqlite/README.md index c6e9f61a..ef01b93f 100644 --- a/txt/lib/lib_sqlite/README.md +++ b/txt/lib/lib_sqlite/README.md @@ -18,19 +18,16 @@ Functions exported from this namespace: ```c++ -int lib_sqlite::Open(lib_sqlite::FConn& conn) -``` - -```c++ -void lib_sqlite::db_Cleanup(lib_sqlite::FConn &parent) +void lib_sqlite::Init() ``` ```c++ -void lib_sqlite::Init() +int lib_sqlite::Open(lib_sqlite::FConn& conn) ``` ```c++ -sqlite3_module lib_sqlite::SsimModule = +// Entrypoint for vtab extension +int lib_sqlite::VtabInitExt(sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi) ``` ```c++ @@ -39,8 +36,7 @@ void lib_sqlite::VtabInitFunc(sqlite3_context *context, int argc, sqlite3_value ``` ```c++ -// Entrypoint for vtab extension -int lib_sqlite::VtabInitExt(sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi) +void lib_sqlite::db_Cleanup(lib_sqlite::FConn &parent) ``` @@ -51,13 +47,13 @@ int lib_sqlite::VtabInitExt(sqlite3 *db, char **pzErrMsg, const sqlite3_api_rout `lib_sqlite` takes the following tables on input: |Ssimfile|Comment| |---|---| -|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| |[dmmeta.ctype](/txt/ssimdb/dmmeta/ctype.md)|Struct| |[dmmeta.field](/txt/ssimdb/dmmeta/field.md)|Specify field of a struct| -|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| -|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.ns](/txt/ssimdb/dmmeta/ns.md)|Namespace (for in-memory database, protocol, etc)| |[dmmeta.sqltype](/txt/ssimdb/dmmeta/sqltype.md)|Mapping of ctype -> SQL expression| -|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| +|[dmmeta.ssimfile](/txt/ssimdb/dmmeta/ssimfile.md)|File with ssim tuples| +|[dmmeta.substr](/txt/ssimdb/dmmeta/substr.md)|Specify that the field value is computed from a substring of another field| @@ -176,10 +172,11 @@ struct Cons { // lib_sqlite.Cons Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_sqlite_gen.h](/include/gen/lib_sqlite_gen.h) ``` struct FConn { // lib_sqlite.FConn - algo::cstring name; // - sqlite3* db; // optional pointer - lib_sqlite::FConn* conn_next; // Pointer to next free element int tpool - lib_sqlite::FConn* ind_conn_next; // hash next + algo::cstring name; // + sqlite3* db; // optional pointer + lib_sqlite::FConn* conn_next; // Pointer to next free element int tpool + lib_sqlite::FConn* ind_conn_next; // hash next + u32 ind_conn_hashval; // hash value // user-defined fcleanup on lib_sqlite.FConn.db prevents copy // func:lib_sqlite.FConn..AssignOp inline lib_sqlite::FConn& operator =(const lib_sqlite::FConn &rhs) = delete; @@ -240,6 +237,7 @@ struct FCtype { // lib_sqlite.FCtype u32 c_row_n; // array of pointers u32 c_row_max; // capacity of allocated array lib_sqlite::FCtype* ind_ctype_next; // hash next + u32 ind_ctype_hashval; // hash value // reftype Ptrary of lib_sqlite.FCtype.c_field prohibits copy // x-reference on lib_sqlite.FCtype.c_sqltype prevents copy // reftype Thash of lib_sqlite.FCtype.ind_field_name prohibits copy @@ -356,18 +354,20 @@ struct FDb { // lib_sqlite.FDb Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_sqlite_gen.h](/include/gen/lib_sqlite_gen.h) ``` struct FField { // lib_sqlite.FField - lib_sqlite::FField* ind_field_name_next; // hash next - lib_sqlite::FField* ind_field_next; // hash next - algo::Smallstr100 field; // Primary key, as ctype.name - algo::Smallstr100 arg; // Type of field - algo::Smallstr50 reftype; // "Val" Type constructor - algo::CppExpr dflt; // Default value (c++ expression) - algo::Comment comment; // - lib_sqlite::FSubstr* c_substr; // optional pointer - lib_sqlite::FCtype* p_arg; // reference to parent row - lib_sqlite::FCtype* p_ctype; // reference to parent row - u32 id; // 0 - bool ctype_c_field_in_ary; // false membership flag + lib_sqlite::FField* ctype_ind_field_name_next; // hash next + u32 ctype_ind_field_name_hashval; // hash value + lib_sqlite::FField* ind_field_next; // hash next + u32 ind_field_hashval; // hash value + algo::Smallstr100 field; // Primary key, as ctype.name + algo::Smallstr100 arg; // Type of field + algo::Smallstr50 reftype; // "Val" Type constructor + algo::CppExpr dflt; // Default value (c++ expression) + algo::Comment comment; // + lib_sqlite::FSubstr* c_substr; // optional pointer + lib_sqlite::FCtype* p_arg; // reference to parent row + lib_sqlite::FCtype* p_ctype; // reference to parent row + u32 id; // 0 + bool ctype_c_field_in_ary; // false membership flag // x-reference on lib_sqlite.FField.c_substr prevents copy // x-reference on lib_sqlite.FField.p_arg prevents copy // x-reference on lib_sqlite.FField.p_ctype prevents copy @@ -438,6 +438,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_sqlite_gen.h](/ ``` struct FNs { // lib_sqlite.FNs lib_sqlite::FNs* ind_ns_next; // hash next + u32 ind_ns_hashval; // hash value algo::Smallstr16 ns; // Namespace name (primary key) algo::Smallstr50 nstype; // Namespace type algo::Smallstr50 license; // Associated license @@ -480,14 +481,15 @@ private: Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_sqlite_gen.h](/include/gen/lib_sqlite_gen.h) ``` struct FRow { // lib_sqlite.FRow - lib_sqlite::FRow* zd_row_next; // zslist link; -1 means not-in-list - lib_sqlite::FRow* zd_row_prev; // previous element - lib_sqlite::FRow* ind_pkey_next; // hash next - algo::cstring pkey; // - algo::Tuple tuple; // - lib_sqlite::FCtype* p_ctype; // reference to parent row - i64 rowid; // 0 - bool ctype_c_row_in_ary; // false membership flag + lib_sqlite::FRow* ctype_zd_row_next; // zslist link; -1 means not-in-list + lib_sqlite::FRow* ctype_zd_row_prev; // previous element + lib_sqlite::FRow* ctype_ind_pkey_next; // hash next + u32 ctype_ind_pkey_hashval; // hash value + algo::cstring pkey; // + algo::Tuple tuple; // + lib_sqlite::FCtype* p_ctype; // reference to parent row + i64 rowid; // 0 + bool ctype_c_row_in_ary; // false membership flag // func:lib_sqlite.FRow..AssignOp inline lib_sqlite::FRow& operator =(const lib_sqlite::FRow &rhs) = delete; // func:lib_sqlite.FRow..CopyCtor @@ -558,6 +560,7 @@ Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_sqlite_gen.h](/ ``` struct FSsimfile { // lib_sqlite.FSsimfile lib_sqlite::FSsimfile* ind_ssimfile_next; // hash next + u32 ind_ssimfile_hashval; // hash value algo::Smallstr50 ssimfile; // algo::Smallstr100 ctype; // lib_sqlite::FCtype* p_ctype; // reference to parent row diff --git a/txt/lib/lib_ws/README.md b/txt/lib/lib_ws/README.md new file mode 100644 index 00000000..b6a89b2f --- /dev/null +++ b/txt/lib/lib_ws/README.md @@ -0,0 +1,442 @@ +## lib_ws - WebSocket library + + +### Table Of Contents + + +  •  [Description](#description)
+  •  [Restrictions and limitations](#restrictions-and-limitations)
+  •  [Introduction](#introduction)
+  •  [Data model](#data-model)
+  •  [Library initialization](#library-initialization)
+  •  [Creating and starting new server](#creating-and-starting-new-server)
+  •  [Registering hooks](#registering-hooks)
+  •  [h_open](#h_open)
+  •  [h_message](#h_message)
+  •  [h_close](#h_close)
+  •  [Sending messages](#sending-messages)
+  •  [Ping/pong](#ping-pong)
+  •  [Tuning server limits](#tuning-server-limits)
+  •  [Example](#example)
+  •  [Functions](#functions)
+  •  [Inputs](#inputs)
+  •  [Sources](#sources)
+  •  [Dependencies](#dependencies)
+  •  [In Memory DB](#in-memory-db)
+ + + +### Description + + + +Lib_ws is a lightweight implementation of server part of WebSocket protocol, +that allows C++ app to be a WebSocket server. + +The library implements: +- TCP server, +- opening handshake over HTTP protocol, +- closing handshake, +- sending and receiving WebSocket messages - user and control ones, +- unmasking of incoming messages, +- assembly of fragmented incoming messages, +- ping/pong, +- notifications (app hooks) on connection events: + - open + - close + - incoming message +- tunable incoming frame and message size limits; + + + +### Restrictions and limitations + + +- Only current version of WebSocket protocol is supported (11), it is not checked; +- HTTP/1.1 only; +- Server connections are assumed to be WebSocket only: + - URL is not seen; + - HTTP headers are not seen, except `Sec-WebSocket-Key`; + - use other Web server to serve static files like html pages +and scripts needed for working with our WebSocket server; +- Fragmentation of outgoing messages is not supported; +- Connection timeouts are not implemented (TODO); +- HTTPS protocol is not supported - use reverse proxy; +- Extensions are not supported - RCVD fields are not analyzed. + +### Introduction + + +WebSocket protocol has been created for full-duplex communication +between Web browser and server in a single TCP connection without abusing +distinct HTTP calls and long polls for upstream notifications. + +WebSocket protocol takes an advantage of: +- bidirectionality, +- real time, +- text and binary message support, +- built-in message framing, +- extremely low overhead thanks to binary protocol and adaptive framing. + +WebSocket killer uses are: social feeds, multiplayer games, collaborative editing, +clickstream data, financial tickers, sports updates, multimedia chat, +location-based apps, communal chalkboard and more. + +For theory in deep, refer to RFC 6455. + +### Data model + + +Library data model consists of two entities: +- `FServer` - server, identified by bind address and port; +- `FConn` - server connection identified by two pairs - server bind address/port and client address/port; + +Connection has state machine for HTTP protocol, there are the following states: +``` +inline-command: acr dmmeta.fconst:ws.HttpState.value/% +dmmeta.fconst fconst:ws.HttpState.value/INIT value:0 comment:"created connection, waiting request-line" +dmmeta.fconst fconst:ws.HttpState.value/REQLINE value:1 comment:"request-line received, waiting first header" +dmmeta.fconst fconst:ws.HttpState.value/HEADER value:2 comment:"waiting next header" +dmmeta.fconst fconst:ws.HttpState.value/BODY value:3 comment:"headers received, waiting body" +dmmeta.fconst fconst:ws.HttpState.value/FIN value:4 comment:"connection closed, to be deleted" +report.acr n_select:5 n_insert:0 n_delete:0 n_ignore:0 n_update:0 n_file_mod:0 +``` + +Protocol constructs are defined within `ws` namespace. + +WebSocket Status is defined on `wsdb.status` table. + +``` +inline-command: acr wsdb.status +wsdb.status code:1000 reason:"Normal closure" local_only:N comment:"" +wsdb.status code:1001 reason:"Going away" local_only:N comment:"Server going down or browser page close" +wsdb.status code:1002 reason:"Protocol error" local_only:N comment:"" +wsdb.status code:1003 reason:"Unsupported message data type" local_only:N comment:"Text message while expecting binary and vice-versa" +wsdb.status code:1005 reason:"No status code" local_only:Y comment:"No status code received in remote close message" +wsdb.status code:1006 reason:"Abnormal closure" local_only:Y comment:"Lower layer failure" +wsdb.status code:1007 reason:"Invalid message data" local_only:N comment:"E.g. non-UTF-8 within text message" +wsdb.status code:1008 reason:"Policy violation" local_only:N comment:"" +wsdb.status code:1009 reason:"Message too big" local_only:N comment:"" +wsdb.status code:1010 reason:"Missing extension" local_only:N comment:"" +wsdb.status code:1011 reason:"Internal error" local_only:N comment:"" +wsdb.status code:1015 reason:"TLS Handshake" local_only:Y comment:"" +report.acr n_select:12 n_insert:0 n_delete:0 n_ignore:0 n_update:0 n_file_mod:0 +``` + +If necessary, one may add private codes in range 4000-4999 as per RFC 6455. + +### Library initialization + + +Not needed - done statically. + +### Creating and starting new server + + +``` +lib_ws::FServer *StartServer(strptr addr); +``` + +`addr` is user to bind lisen socket, it is in form of `ip:port`, +which is internally read as `ietf::Ipport` type. +If port is omitted or zero, default port is assumed. +Default port is tunable on the library basis (initial value is 80). +If ip address is omitted, 0.0.0.0 (aka INADDR_ANY) is used. + +Valid calls are: +``` +StartServer("1.2.3.4:5000"); +StartServer(":5000"); // 0.0.0.0:5000 +StartServer("1.2.3.4"); // 1.2.3.4:80 +StartServer(""); // 0.0.0.0:80 +``` +The API creates server socket, binds it to specified address, starts listening, register iohook for read and write. +The API returns server context on succes, NULL otherwise. +Returned server context may be tuned as appropriate. + +### Registering hooks + + +Three hooks are available +``` +lib_ws::_db.h_open - new connection +lib_ws::_db.h_message - incoming text or binary message on connection +lib_ws::_db.h_close - connection close + +``` + +All three hooks has the same signature - server connection context as an argument. +``` +HookFunction(void*,lib_ws::FConn& conn); +``` + +### h_open + + +`h_open` is used to allocate server resources for new client connection. +The hook is called when opening handshake has been completed, +and connection is ready to send and receive WebSocket frames. + +### h_message + + +`h_message` is used to process incoming text or binary message. +The hook is called as soon as complete message has been received, +that is if message is fragmented, it is reassembled. + +Message bytes or characters are available on `conn.msg`. + +Message opcode (text or binary) is available on `msg.opcode`. + +### h_close + + +`h_close` is used to free connection resources. +The hook is called when server closes connection on its side. +`conn.code` and `conn.reason` are WebSocket status code and reason. + +### Sending messages + + +One may send messages when connection is open i.e. from `h_open` call up to `h_close` call. +To check if an arbitrary connection is open or not use `OpenQ()`. +Do not send messages if connection is not open, this yields an exception. +Message sending is non-blocking operation. +WebSocket frame is constructed directly on connection write buffer (conn.wrbuf), +and sent immediately if socket is ready, or later if not. + +Core API to send messages: +``` +void lib_ws::SendMessage(lib_ws::FConn &conn, ws_OpcodeEnum opcode, strptr payload); +``` + +And basic helpers: +``` +void SendTextMessage(lib_ws::FConn &conn, strptr payload); +void SendBinaryMessage(lib_ws::FConn &conn, algo::memptr payload); +``` + +Other helpers are intended to be used internally, do not call them directly. + +Example: +``` +SendTextMessage(conn,"Hello!") +``` + +#### Closing connection - server initiated + + +One may call `Close()` API to force connection closing at any time, inside or outside hooks. +To set the code and reason, set `code`, and `reason` as appropriate. +If code is not set, 1006 will be used. If reason is omited, it is filled from `wsdb.status` table. +`h_close` always called directly from `Close()` if connection was open +(i.e. opening handshake has been completed, and `h_open` has been previously called. + +Example: + +``` +value_SetEnum(conn.code,ws_StatusCode_Internal_Error); +conn.reason = "Assertion failed: ..."; +Close(conn); +``` + +Server sends `close` message with given reason and code, +and closes connection immediately - it shall not wait response from client. + +Note that API does not delete connection context immediately because +it may be used in various hooks those may access connection context after `Close()` call. + +#### Closing connection - client initiated + + +Client sends close frame - server receives it, echoes it back and immediately closes the connection. + +### Ping/pong + + +On `ping` message, server automatically answers with `pong` message echoing message payload. +Server never sends unsolicited pong message, and ignores incoming one. + +This function implemented according to specification, +but it is useless, as browsers do not support ping/pong. + +### Tuning server limits + + +Configuration parameters on server context protects from malicious attacks using huge frames and messages. +- `max_rcvd_frame_size` limits frame size in bytes (default: 128 kibibytes); +- `max_rcvd_msg_size` limits message size in bytes (default: 10 mebibytes). + +### Example + + +For server example, see `cpp/samp_ws.cpp`. + +For client example, see `www/wsdemo.html`. + +### Functions + + +Functions exported from this namespace: + +```c++ +// safe cast for cppcheck +template ws::FrameHeader *CastbasePtr(T *ptr) +``` + +```c++ +// Compute Sec-WebSocket-Accept from Sec-WebSocket-Key +tempstr lib_ws::ComputeSecWebSocketAccept(strptr sec_websocket_key) +``` + +```c++ +ws::FrameHeader *lib_ws::FrameHeader_FmtByteAry(algo::ByteAry &buf, bool fin, bool rsv1, bool rsv2, bool rsv3, ws::Opcode opcode, bool mask, u32 masking_key, strptr payload) +``` + +```c++ +void lib_ws::FrameIdx_Frame16(lib_ws::FrameIdx &idx, ws::Frame16 &frame, u32) +``` + +```c++ +void lib_ws::FrameIdx_Frame64(lib_ws::FrameIdx &idx, ws::Frame64 &frame, u32) +``` + +```c++ +void lib_ws::FrameIdx_FrameMasked16(lib_ws::FrameIdx &idx, ws::FrameMasked16 &frame, u32) +``` + +```c++ +void lib_ws::FrameIdx_FrameMasked64(lib_ws::FrameIdx &idx, ws::FrameMasked64 &frame, u32) +``` + +```c++ +int lib_ws::FrameIdx_Unkmsg(lib_ws::FrameIdx &idx, ws::FrameHeader &hdr, u32) +``` + +```c++ +void lib_ws::FrameLen_Frame16(i32 &len, ws::Frame16 &frame, u32 msg_len) +``` + +```c++ +void lib_ws::FrameLen_Frame64(i32 &len, ws::Frame64 &frame, u32 msg_len) +``` + +```c++ +void lib_ws::FrameLen_FrameMasked16(i32 &len, ws::FrameMasked16 &frame, u32 msg_len) +``` + +```c++ +void lib_ws::FrameLen_FrameMasked64(i32 &len, ws::FrameMasked64 &frame, u32 msg_len) +``` + +```c++ +int lib_ws::FrameLen_Unkmsg(i32 &len, ws::FrameHeader &hdr, u32 msg_len) +``` + +```c++ +i32 lib_ws::GetMsgLen(algo::memptr buf) +``` + +```c++ +void lib_ws::ToggleMasking(strptr payload, u32 masking_key) +``` + +```c++ +void lib_ws::ToggleMasking(ws::FrameHeader &frame, bool reset_key) +``` + +```c++ +strptr lib_ws::payload_Getary(ws::FrameHeader &frame) +``` + + + +### Inputs + + +`lib_ws` takes the following tables on input: +|Ssimfile|Comment| +|---|---| +|[dmmeta.dispsigcheck](/txt/ssimdb/dmmeta/dispsigcheck.md)|Check signature of input data against executable's version| + + + +### Sources + + +The source code license is GPL +The following source files are part of this tool: + +|Source File|Comment| +|---|---| +|[cpp/gen/lib_ws_gen.cpp](/cpp/gen/lib_ws_gen.cpp)|| +|[cpp/lib_ws/lib_ws.cpp](/cpp/lib_ws/lib_ws.cpp)|| +|[include/gen/lib_ws_gen.h](/include/gen/lib_ws_gen.h)|| +|[include/gen/lib_ws_gen.inl.h](/include/gen/lib_ws_gen.inl.h)|| +|[include/lib_ws.h](/include/lib_ws.h)|| + + + +### Dependencies + + +The build target depends on the following libraries +|Target|Comment| +|---|---| +|[algo_lib](/txt/lib/algo_lib/README.md)|Support library for all executables| +|[lib_prot](/txt/lib/lib_prot/README.md)|Library covering all protocols| + + + +### In Memory DB + + +`lib_ws` generated code creates the tables below. +All allocations are done through global `lib_ws::_db` [lib_ws.FDb](#lib_ws-fdb) structure +|Ctype|Ssimfile|Create|Access| +|---|---|---|---| +|[lib_ws.FDb](#lib_ws-fdb)||FDb._db (Global)| +|[lib_ws.FrameIdx](#lib_ws-frameidx)|| + +#### lib_ws.FDb - In-memory database for lib_ws + + +#### lib_ws.FDb Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_ws.FDb._db|[lib_ws.FDb](/txt/lib/lib_ws/README.md#lib_ws-fdb)|[Global](/txt/exe/amc/reftypes.md#global)||| + +#### Struct FDb + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ws_gen.h](/include/gen/lib_ws_gen.h) +``` +struct FDb { // lib_ws.FDb: In-memory database for lib_ws + lib_ws::trace trace; // +}; +``` + +#### lib_ws.FrameIdx - + + +#### lib_ws.FrameIdx Fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|lib_ws.FrameIdx.masking_key|u32|[Ptr](/txt/exe/amc/reftypes.md#ptr)||| +|lib_ws.FrameIdx.payload|[algo.strptr](/txt/protocol/algo/strptr.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### Struct FrameIdx + +Generated by [amc](/txt/exe/amc/README.md) into [include/gen/lib_ws_gen.h](/include/gen/lib_ws_gen.h) +``` +struct FrameIdx { // lib_ws.FrameIdx + u32* masking_key; // optional pointer + algo::strptr payload; // + // func:lib_ws.FrameIdx..Ctor + inline FrameIdx() __attribute__((nothrow)); +}; +``` + + + diff --git a/txt/protocol/README.md b/txt/protocol/README.md index e5dafa49..a2efa104 100644 --- a/txt/protocol/README.md +++ b/txt/protocol/README.md @@ -10,8 +10,12 @@ 📁 [atf - Algo Testing Framework](/txt/protocol/atf/README.md)
📁 [command - Command line descriptions](/txt/protocol/command/README.md)
📁 [fm - Fault management types](/txt/protocol/fm/README.md)
+📁 [http -](/txt/protocol/http/README.md)
📁 [ietf - Some IETF structs](/txt/protocol/ietf/README.md)
+📁 [js - Reserved for JavaScript builtin types](/txt/protocol/js/README.md)
+📁 [kafka - Kafka protocol](/txt/protocol/kafka/README.md)
📁 [report - Command reports](/txt/protocol/report/README.md)
+📁 [ws - WebSocket binary protocol](/txt/protocol/ws/README.md)
diff --git a/txt/protocol/algo/README.md b/txt/protocol/algo/README.md index 9019c2fd..13754127 100644 --- a/txt/protocol/algo/README.md +++ b/txt/protocol/algo/README.md @@ -4,6 +4,8 @@ ### Table Of Contents +  •  [Ctypes](#ctypes)
+  •  [Functions](#functions)
📄 [algo.Attr - Tuple attribute](/txt/protocol/algo/Attr.md)
📄 [algo.Bool - Bool type for converting booleans to string](/txt/protocol/algo/Bool.md)
@@ -123,6 +125,13 @@ Other ctypes in this namespace which don't have own readme files |---|---|---|---|---| |value|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +#### algo.I32RangeAry - Byte array + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|ary|[algo.i32_Range](/txt/protocol/algo/README.md#algo-i32_range)|[Tary](/txt/exe/amc/reftypes.md#tary)||| + #### algo.I64Dec1 - signed i64, scale 1e1 @@ -193,6 +202,14 @@ Other ctypes in this namespace which don't have own readme files |---|---|---|---|---| |value|i64|[Val](/txt/exe/amc/reftypes.md#val)||| +#### algo.I64Rate - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|last|i64|[Val](/txt/exe/amc/reftypes.md#val)||Last value| +|delta|i64|[Val](/txt/exe/amc/reftypes.md#val)||Delta of last value| + #### algo.Imdb - In-memory database descriptor (reflection) @@ -1083,6 +1100,13 @@ Other ctypes in this namespace which don't have own readme files |---|---|---|---|---| |ch|char|[Smallstr](/txt/exe/amc/reftypes.md#smallstr)||| +#### algo.Smallstr249 - inline string with length field + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|ch|char|[Smallstr](/txt/exe/amc/reftypes.md#smallstr)||| + #### algo.Smallstr25 - inline string with length field @@ -1097,6 +1121,13 @@ Other ctypes in this namespace which don't have own readme files |---|---|---|---|---| |ch|char|[Smallstr](/txt/exe/amc/reftypes.md#smallstr)||| +#### algo.Smallstr255 - inline string with length field + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|ch|char|[Smallstr](/txt/exe/amc/reftypes.md#smallstr)||| + #### algo.Smallstr3 - inline string with length field @@ -1153,6 +1184,13 @@ Other ctypes in this namespace which don't have own readme files |---|---|---|---|---| |ary|[algo.cstring](/txt/protocol/algo/cstring.md)|[Tary](/txt/exe/amc/reftypes.md#tary)||| +#### algo.U16Ary - Array of u16 + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|ary|u16|[Tary](/txt/exe/amc/reftypes.md#tary)||Array of u16 values| + #### algo.U16Dec2 - u16, scale 1e2 @@ -1160,6 +1198,13 @@ Other ctypes in this namespace which don't have own readme files |---|---|---|---|---| |value|u16|[Val](/txt/exe/amc/reftypes.md#val)||| +#### algo.U32Ary - Array of u16 + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|ary|u32|[Tary](/txt/exe/amc/reftypes.md#tary)||Array of u16 values| + #### algo.U32Dec1 - u32, scale 1e1 @@ -1195,6 +1240,13 @@ Other ctypes in this namespace which don't have own readme files |---|---|---|---|---| |value|u32|[Val](/txt/exe/amc/reftypes.md#val)||| +#### algo.U32LinearKey - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u32|[Val](/txt/exe/amc/reftypes.md#val)||| + #### algo.U64Ary - Array of u64 @@ -1289,3 +1341,2659 @@ Other ctypes in this namespace which don't have own readme files +### Functions + + +Functions exported from this namespace: + +```c++ +inline f32 algo::Abs(f32 a) +``` + +```c++ +inline f64 algo::Abs(f64 a) +``` + +```c++ +inline f80 algo::Abs(f80 a) +``` + +```c++ +inline i32 algo::Abs(i32 a) +``` + +```c++ +inline i64 algo::Abs(i64 a) +``` + +```c++ +inline int algo::Abs(i8 a) +``` + +```c++ +inline int algo::Abs(i16 a) +``` + +```c++ +// Check if path PATH is an absolute pathname, +// meaning that it starts with / or ~ +// On windows, the same test is in force, but in addition any pathname +// where the second character is a : (e.g. c:\blah) is recognized as an absolute +// path name +bool algo::AbsolutePathQ(strptr path) NOTHROW +``` + +```c++ +// Compare two strings whose start address is 16-byte aligned +// Do not use this function -- +bool algo::AlignedEqual(strptr a, strptr b) +``` + +```c++ +void algo::Append(algo::u64_RangesList &p, u64 item) +``` + +```c++ +void algo::Attr_Print(algo::Attr &attr, algo::cstring &str) +``` + +```c++ +inline algo::Attr_curs &algo::Attr_curs_Access(Attr_curs &curs) +``` + +```c++ +void algo::Attr_curs_Next(Attr_curs &curs) +``` + +```c++ +void algo::Attr_curs_Reset(Attr_curs &curs, strptr line) +``` + +```c++ +inline bool algo::Attr_curs_ValidQ(Attr_curs &curs) +``` + +```c++ +// Begin append key/value to string LHS +int algo::BeginKeyval(cstring &lhs, const strptr &name) +``` + +```c++ +void algo::Bool_Print(algo::Bool row, algo::cstring &str) +``` + +```c++ +inline u32 algo::BumpToPow2(u32 i) +``` + +```c++ +inline u64 algo::BumpToPow2(u64 i) +``` + +```c++ +void algo::ByteAry_Print(algo::ByteAry &parent, algo::cstring &str) +``` + +```c++ +// read bytes in hex e.g: 00 01 ff +bool algo::ByteAry_ReadStrptrMaybe(algo::ByteAry &parent, strptr str) +``` + +```c++ +template inline algo::aryptr algo::BytesOf(const T &t) +``` + +```c++ +// When compiled with AOS_SSE42, use intrinsics. +// Otherwise, the function is defined in crc32.cpp and uses a software implementation +inline u32 algo::CRC32Step(u32 old, const u8 *x, size_t len) +``` + +```c++ +u32 algo::CRC32Step(u32 old, const u8 *data, size_t len) +``` + +```c++ +inline u32 algo::CeilingLog2(u32 orig) +``` + +```c++ +inline u64 algo::CeilingLog2(u64 orig) +``` + +```c++ +bool algo::Charset_ReadStrptrMaybe(algo::Charset &lhs, strptr rhs) +``` + +```c++ +// Read Charset from list of chars. +// Every character in RHS is simply added to the bitset +void algo::Charset_ReadStrptrPlain(algo::Charset &lhs, strptr desc) +``` + +```c++ +// Clipping to an open interval (exclisive upper limit) [0..hi-1] or [lo..hi-1] +inline int algo::Clipped(int a, int hi) +``` + +```c++ +inline int algo::Clipped(int a, int lo, int hi) +``` + +```c++ +// Clipping to a closed interval lo..hi +inline double algo::Clippedf(double a, double lo, double hi) +``` + +```c++ +int algo::CompareNoCase(strptr lhs, strptr s) +``` + +```c++ +// Read all bytes from IN_FD and copy them to OUT_FD, using read/write. +// Return success status. +bool algo::CopyFd(Fildes in_fd, Fildes out_fd) NOTHROW +``` + +```c++ +// Copy file FROM to file TO, creating the file if necessary +// with mode MODE. +// Throw exception on failure. +void algo::CopyFileX(strptr from, strptr to, int mode) +``` + +```c++ +void algo::CopyFromToB16(void *from, void *to, u32 n) +``` + +```c++ +// Recursively create directory S and all of its components, +// using mode MODE for newly created directories. +// if DO_THROW is specified, throw exceptions on failure. +// If DO_THROW is false, return success value. +// TODO: test on windows +bool algo::CreateDirRecurse(strptr s, bool do_throw = true, u32 mode = 0755) +``` + +```c++ +algo::Fildes algo::CreateReplacementFile(cstring &oldfname, cstring &newfname, int dfltmode) +``` + +```c++ +// Current value of get_cycles(); +inline algo::SchedTime algo::CurrSchedTime() +``` + +```c++ +// Return unix-epoch time with nanosecond resolution +// On Linux, this function calls clock_gettime() which takes about +// 30ns and uses rdtsc() to increase underlying clock resolution +inline algo::UnTime algo::CurrUnTime() +``` + +```c++ +inline algo::UnixTime algo::CurrUnixTime() +``` + +```c++ +inline double algo::DCeiling(double a) +``` + +```c++ +inline double algo::DFloor(double a) +``` + +```c++ +inline double algo::DRound(double a) +``` + +```c++ +inline double algo::DTrunc(double a) +``` + +```c++ +// DateCache -- Roughly 200x faster LocalDate +const algo::UnTime algo::DateCache_LocalDate(algo::DateCache &dc, UnTime in) +``` + +```c++ +algo::UnTime& algo::DayRange_curs_Access(algo::DayRange_curs &curs) +``` + +```c++ +void algo::DayRange_curs_Next(algo::DayRange_curs &curs) +``` + +```c++ +void algo::DayRange_curs_Reset(algo::DayRange_curs &curs, const algo::DayRange& range) +``` + +```c++ +bool algo::DayRange_curs_ValidQ(algo::DayRange_curs &curs) +``` + +```c++ +// Convert Decimal to double +double algo::Decimal_GetDouble(algo::Decimal parent) +``` + +```c++ +// Normalize decimal, so mantissa does not contain tail 0 +void algo::Decimal_Normalize(algo::Decimal &parent) +``` + +```c++ +// Print Decimal +void algo::Decimal_Print(algo::Decimal parent, algo::cstring &str) +``` + +```c++ +// Read Decimal from string +bool algo::Decimal_ReadStrptrMaybe(algo::Decimal &parent, algo::strptr in_str) +``` + +```c++ +// Convert double to Decimal +void algo::Decimal_SetDouble(algo::Decimal &parent, double value) +``` + +```c++ +bool algo::DecodeBEF64(algo::memptr &buf, double &result) +``` + +```c++ +// two-byte, big endian, signed +bool algo::DecodeBEI16(algo::memptr &buf, i16 &result) +``` + +```c++ +// four-byte, big-endian signed +bool algo::DecodeBEI32(algo::memptr &buf, i32 &result) +``` + +```c++ +// eight-byte, big-endian signed +bool algo::DecodeBEI64(algo::memptr &buf, i64 &result) +``` + +```c++ +// two-byte, big-endian +bool algo::DecodeBEU16(algo::memptr &buf, u16 &result) +``` + +```c++ +// four-byte, big-endian +bool algo::DecodeBEU32(algo::memptr &buf, u32 &result) +``` + +```c++ +// eight-byte, big-endian +bool algo::DecodeBEU64(algo::memptr &buf, u64 &result) +``` + +```c++ +// single byte, boolean +bool algo::DecodeBoolean(algo::memptr &buf, bool &result) +``` + +```c++ +// single byte, signed +bool algo::DecodeI8(algo::memptr &buf, i8 &result) +``` + +```c++ +// N bytes, raw +bool algo::DecodeNBytes(algo::memptr &buf, int n, algo::memptr &result) +``` + +```c++ +// N bytes as chars +bool algo::DecodeNChars(algo::memptr &buf, int n, strptr &result) +``` + +```c++ +// helper: N bytes as chars +template inline bool algo::DecodeNChars(algo::memptr &buf, int n, T &result) +``` + +```c++ +// single byte +bool algo::DecodeU8(algo::memptr &buf, u8 &result) +``` + +```c++ +// UUID - raw bytes +bool algo::DecodeUuid(algo::memptr &buf, algo::Uuid &result) +``` + +```c++ +// continuation bit (bit 7 of each byte), little-endian, u32, signed zigzag +// sign - bit 0 (lsb) +// unsigned mantissa - bits 1..N (msb) +bool algo::DecodeVLCLEI32Z(algo::memptr &buf, i32 &result) +``` + +```c++ +// continuation - bit 7 (msb) of each byte, little-endian, signed zigzag: +// sign - bit 0 (lsb) +// unsigned mantissa - bits 1..N (msb) +bool algo::DecodeVLCLEI64Z(algo::memptr &buf, i64 &result) +``` + +```c++ +// continuation bit (bit 7 of each byte), little-endian, u32 +bool algo::DecodeVLCLEU32(algo::memptr &buf, u32 &result) +``` + +```c++ +// continuation bit (bit 7 of each byte), little-endian, u64 +bool algo::DecodeVLCLEU64(algo::memptr &buf, u64 &result) +``` + +```c++ +// zero-terminated string +bool algo::DecodeZeroterm(algo::memptr &buf, strptr &result) +``` + +```c++ +// zero-terminated string +bool algo::DecodeZeroterm(algo::strptr &buf, strptr &result) +``` + +```c++ +// Delete file F. +// Return success code. +bool algo::DeleteFile(strptr f) NOTHROW +``` + +```c++ +// Return a human-readable description of STATUS as returned by wait() / waitpid() +tempstr algo::DescribeWaitStatus(int status) +``` + +```c++ +// Combine paths A and B, placing a slash in the middle if necessary. +// If B is already an absolute pathname, just return that. +tempstr algo::DirFileJoin(strptr a, strptr b) NOTHROW +``` + +```c++ +algo::DirEntry &algo::Dir_curs_Access(Dir_curs &curs) NOTHROW +``` + +```c++ +void algo::Dir_curs_Next(Dir_curs &curs) NOTHROW +``` + +```c++ +// Begin scanning files matching shell pattern PATTERN. +void algo::Dir_curs_Reset(Dir_curs &curs, strptr pattern) NOTHROW +``` + +```c++ +bool algo::Dir_curs_ValidQ(Dir_curs &curs) NOTHROW +``` + +```c++ +// Test whether PATH is an existing directory +bool algo::DirectoryQ(strptr path) NOTHROW +``` + +```c++ +// Elapsed time in seconds between two SchedTimes. +inline double algo::ElapsedSecs(algo::SchedTime start, algo::SchedTime end) +``` + +```c++ +void algo::EncodeBEF64(algo::ByteAry &buf, double value) +``` + +```c++ +void algo::EncodeBEI16(algo::ByteAry &buf, i16 value) +``` + +```c++ +void algo::EncodeBEI32(algo::ByteAry &buf, i32 value) +``` + +```c++ +void algo::EncodeBEI64(algo::ByteAry &buf, i64 value) +``` + +```c++ +void algo::EncodeBEU16(algo::ByteAry &buf, u16 value) +``` + +```c++ +void algo::EncodeBEU32(algo::ByteAry &buf, u32 value) +``` + +```c++ +void algo::EncodeBEU64(algo::ByteAry &buf, u64 value) +``` + +```c++ +void algo::EncodeBoolean(algo::ByteAry &buf, bool value) +``` + +```c++ +void algo::EncodeI8(algo::ByteAry &buf, i8 value) +``` + +```c++ +void algo::EncodeU8(algo::ByteAry &buf, u8 value) +``` + +```c++ +// UUID - raw bytes +void algo::EncodeUuid(algo::ByteAry &buf, algo::Uuid &value) +``` + +```c++ +// variable-length, continuation bit, i32, zigzag +void algo::EncodeVLCLEI32Z(algo::ByteAry &buf, i32 value) +``` + +```c++ +// variable-length, continuation bit, i64, zigzag +void algo::EncodeVLCLEI64Z(algo::ByteAry &buf, i64 value) +``` + +```c++ +// variable-length, continuation bit, u32 +void algo::EncodeVLCLEU32(algo::ByteAry &buf, u32 value) +``` + +```c++ +// variable-length, continuation bit, u64 +void algo::EncodeVLCLEU64(algo::ByteAry &buf, u64 value) +``` + +```c++ +// End append key/value to string LHS +cstring &algo::EndKeyval(cstring &lhs, int start) +``` + +```c++ +bool algo::EndsWithQ(strptr s, strptr sstr) +``` + +```c++ +// Decode error using algo_lib table of decoders +void algo::Errcode_Print(algo::Errcode &row, algo::cstring &str) +``` + +```c++ +// SSE implementation of fast exponentiation idea from +// http//nic.linotune.com/pubs/Schraudolph99.pdf +// ExpFast(x) goes bad at x < -709 (exp doesn't) +// Where it works, ExpFast makes a steady relative error of about 2%. +double algo::ExpFast(double y) +``` + +```c++ +// Taylor series expansion. For x around 0.01, this produces 2 digits per +// iteration, so with N=4 will be reasonably fast. +inline double algo::ExpTaylor(double x, int n) +``` + +```c++ +void algo::FatalErrorExit(const char *a) NORETURN +``` + +```c++ +// Read all bytes from IN_FD as a string. +// NUL characters in file will appear in the string -- +// TODO: add option to sanitize string +// If FD is non-blocking, reading will terminate at first EAGAIN. +// If an error occurs, all data prior to occurrence of the error is returned. +const tempstr algo::FdToString(Fildes in_fd) NOTHROW +``` + +```c++ +inline strptr &algo::FileLine_curs_Access(algo::FileLine_curs &curs) +``` + +```c++ +void algo::FileLine_curs_Next(algo::FileLine_curs &curs) +``` + +```c++ +void algo::FileLine_curs_Reset(algo::FileLine_curs &curs, algo::Fildes fd) +``` + +```c++ +void algo::FileLine_curs_Reset(algo::FileLine_curs &curs, strptr filename) +``` + +```c++ +inline bool algo::FileLine_curs_ValidQ(algo::FileLine_curs &curs) +``` + +```c++ +// Test whether FNAME refers to a valid filesystem entity (file, directory, or special file) +// If FNAME is a soft link, then TRUE is returned even if the link points to +// a non-existent location. +bool algo::FileObjectExistsQ(strptr fname) NOTHROW +``` + +```c++ +// Test if F refers to an existing regular file (i.e. not a special file or directory) +bool algo::FileQ(strptr fname) NOTHROW +``` + +```c++ +// Return contents of file as string. +// File is trimmed at first NULL character +// Implementation note: +// linux files in /proc directory lie about their size +// and are sometimes zero-terminated. +// File is read using a "safe" method of succesively calling read. +// relying on reported file size or using mmap does not work in all cases +// Todo: test on windows +const tempstr algo::FileToString(const strptr& fname, algo::FileFlags flags = algo::FileFlags()) +``` + +```c++ +template inline void algo::Fill(const aryptr &lhs, const T &t) +``` + +```c++ +template inline int algo::Find(const algo::aryptr &lhs, const U&t) +``` + +```c++ +// Search for character/string from left to right +// If found, return index where match occurs. +// If not found, return -1 +int algo::FindChar(strptr lhs, char c) +``` + +```c++ +int algo::FindFrom(strptr s, char c, int from) +``` + +```c++ +int algo::FindFrom(strptr s, strptr t, int from) +``` + +```c++ +int algo::FindFrom(strptr s, strptr t, int from, bool case_sensitive) +``` + +```c++ +int algo::FindStr(strptr lhs, strptr t) +``` + +```c++ +int algo::FindStr(strptr lhs, strptr t, bool case_sensitive) +``` + +```c++ +template inline algo::aryptr algo::FirstN(const algo::aryptr &lhs, u32 n) +``` + +```c++ +inline u32 algo::FloorLog2(u32 i) +``` + +```c++ +inline u64 algo::FloorLog2(u64 i) +``` + +```c++ +// Reeturn Errcode corresponding to a UNIX error code VAL +Errcode algo::FromErrno(i64 val) +``` + +```c++ +algo::Uuid algo::GenerateRandomUuid() +``` + +```c++ +void algo::GenerateRandomUuid(algo::Uuid &uuid) +``` + +```c++ +// Return current directory name. +tempstr algo::GetCurDir() NOTHROW +``` + +```c++ +// Strip last slash and everything after it in A, +// and return that. This is equivalent to Pathcomp(A,"/RL"); +strptr algo::GetDirName(strptr a) NOTHROW +``` + +```c++ +const tempstr algo::GetDomainname() +``` + +```c++ +// Return extension of pathname A, including the dot. +// GetFileExt("abcd/e.txt") -> ".txt" +// GetFileExt("abcd/e.txt/f") -> "" +// This function is equivalent to Pathcomp(A,"/RR.RR") +strptr algo::GetFileExt(strptr a) NOTHROW +``` + +```c++ +// Strip extension from PATH, then strip directory name from PATH, +// and return the remainder. +// c.d -> c +// /a/b/c.d -> c +strptr algo::GetFileName(const strptr& path) NOTHROW +``` + +```c++ +// Return size of file referred to by FD. +// On error, return zero. +i64 algo::GetFileSize(Fildes fd) NOTHROW +``` + +```c++ +// Calculate size of file referred to by FILENAME. +// If file is not found or an error occurs, 0 is returned. +i64 algo::GetFileSize(strptr filename) NOTHROW +``` + +```c++ +// Wrapper for c library realpath function. +// On Windows: read path and expand all soft links along the way; Also eat ..'s. +// The following table shows successive values of LEFT and RIGHT as the loop executes +// ExpandLinks("bin/amc") +// LEFT RIGHT +// bin amc +// bin/amc +// link=../build/release/amc +// bin ../build/release/amc +// build/release/amc +// build release/amc +// build/release amc +// link=CYGWIN_NT-cl.release-x86_64 +// build CYGWIN_NT-cl.release-x86_64/amc +// build/CYGWIN_NT-cl.release-x86_64 amc +// build/CYGWIN_NT-cl.release-x86_64/amc +tempstr algo::GetFullPath(strptr path) NOTHROW +``` + +```c++ +algo::TimeStruct algo::GetGMTimeStruct(algo::UnTime U) +``` + +```c++ +const tempstr algo::GetHostname() +``` + +```c++ +// Read characters up to newline or end of file. Return +// resulting substring, skipping the newline +// (which is either \n or \r\n). +strptr algo::GetLine(StringIter &S) +``` + +```c++ +TimeStruct algo::GetLocalTimeStruct(UnTime U) +``` + +```c++ +TimeStruct algo::GetLocalTimeStruct(UnixTime U) +``` + +```c++ +// Inverse mapping to abbreviated month names (Jan, Feb, etc.) +// If short_name==false, returns full name (January, February, etc.) +const strptr algo::GetMonthNameZeroBased(int index) +``` + +```c++ +const strptr algo::GetMonthNameZeroBasedShort(int index) +``` + +```c++ +int algo::GetMonthZeroBased(strptr month) +``` + +```c++ +// Extract Namespace name from "ns.name" format. +// This is equivalent to Pathcomp(s,".LL") +strptr algo::GetNs(strptr s) +``` + +```c++ +// Return current file position on FD +// There is no provision to return an error code; only the offset is returned +// (zero on failure?) +i64 algo::GetPos(Fildes fd) +``` + +```c++ +template inline algo::aryptr algo::GetRegion(const algo::aryptr &lhs, u32 lo, u32 n) +``` + +```c++ +// Return a run of characters up to next occurence of SEP (or to end of string) +// Skip any characters equal to SEP that follow the run +// sep="|", string = "a||b|"; return value -> "a", rest -> "b|"; +// sep="|", string = "a"; return value -> "a", rest -> ""; +// sep="|", string = "|x"; return value -> "" , rest -> "x"; +strptr algo::GetTokenChar(algo::StringIter &S, char sep) +``` + +```c++ +// Search for the next occurence of SEP. If not found, assume it occurs at EOF +// Return any characters between current position and the occurence of SEP +// Skip SEP, if needed. +strptr algo::GetTokenStrptr(StringIter &iter, const strptr& separator) +``` + +```c++ +// Skip any leading whitespace in STR. +// Read and return next word. +strptr algo::GetTypeTag(strptr str) +``` + +```c++ +// empty string -> 0 +// invalid weekday -> -1 +// All other weeks days map to 0..6, numbers compatible with struct tm's tm_wday field +int algo::GetWeekday(strptr wday) +``` + +```c++ +const strptr algo::GetWeekdayName(int index) +``` + +```c++ +int algo::GetWholeMonthZeroBased(strptr s) +``` + +```c++ +// Skip leading characters matching SEP +// Return run of characters up to next matching SEP, or EOF. +// Do not skip trailing separators. +strptr algo::GetWordCharf(algo::StringIter &iter, bool (*sep)(u32) = algo_lib::WhiteCharQ) +``` + +```c++ +template inline void algo::Getary_Set(StringDesc &desc, algo::aryptr(*fcn)(T&)) +``` + +```c++ +template inline void algo::Geti64_Set(StringDesc &desc, i64(*fcn)(T&, bool &)) +``` + +```c++ +i64 algo::I64Power10(u32 power) +``` + +```c++ +template inline void algo::Init_Set(StringDesc &desc, void(*fcn)(T&)) +``` + +```c++ +// insert TEXT into OUT, indenting as necessary; +// Initial indentation is INDENT, it's adjusted as necessary as { and } are found +// in the TEXT. +// Each indent is 4 spaces. +// Trailing //-sytle comments are stripped +// /* */-style comments are not supported +// Lines beginning with # (#ifdef, etc) are printed at column zero. +void algo::InsertIndent(algo::cstring &out, strptr text, int indent) +``` + +```c++ +void algo::Ipmask_Print(algo::Ipmask &row, algo::cstring &str) +``` + +```c++ +bool algo::Ipmask_ReadStrptrMaybe(Ipmask &row, algo::strptr str) +``` + +```c++ +template inline algo::aryptr algo::LastN(const algo::aryptr &lhs, u32 n) +``` + +```c++ +// Check if the Pathcomp expression PATHCOMP +// refers to the leftmost part of the key +// (The third character of each Pathcomp step must be 'L') +bool algo::LeftPathcompQ(algo::strptr pathcomp) +``` + +```c++ +// Limit length of string S ot at most LEN characters +// If S is trimmed, append "..." to the end +tempstr algo::LimitLengthEllipsis(strptr s, int len) +``` + +```c++ +inline strptr &algo::Line_curs_Access(Line_curs &curs) +``` + +```c++ +// Scan for next line. +void algo::Line_curs_Next(Line_curs &curs) +``` + +```c++ +void algo::Line_curs_Reset(Line_curs &curs, algo::cstring &text) +``` + +```c++ +// Line_curs uses strptr to hold on to the string being scanned +// (to avoid copying a potentially huge string) +// The use of "strptr&" prevents passing a temporary. +// Line_curs handling of newlines is identical to that of FileLine_curs +void algo::Line_curs_Reset(Line_curs &curs, algo::strptr &text) +``` + +```c++ +inline bool algo::Line_curs_ValidQ(Line_curs &curs) +``` + +```c++ +// Accept data block DATA as input for the line buffer +// LinebufNext will attempt to return pointers to a subregion of DATA until +// it returns false, so this block must be valid until then. +// If IMPLIED_EOF is set, then this is the last call to LinebufBegin. +// LinebufNext will know to return a partial line (with no \n) and set the +// EOF flag +void algo::LinebufBegin(LineBuf &L, memptr data, bool implied_eof) +``` + +```c++ +// Scan memory provided by LinebufBegin for line separator (hard-coded to be '\n') +// If the function returns FALSE, and there is a partial line remaining, +// it is saved to an internal buffer in LineBuf (called BUF). +// It will be subsequently recombined with incoming data to form a contiguous line, +// but copying memory is avoided whenever possible. +// Usage: +// LinebufBegin(linebuf,data,true); +// for (strptr line; LinebufNext(linebuf,line); ) { +// +// } +bool algo::LinebufNext(LineBuf &L, strptr &result) +``` + +```c++ +void algo::ListSep_Print(const algo::ListSep &t, algo::cstring &str) +``` + +```c++ +const algo::UnTime algo::LocalDate(UnTime in) +``` + +```c++ +const algo::UnixTime algo::LocalDate(UnixTime in) +``` + +```c++ +// lock all presently, and future allocated bytes in physical memory. +// Return success value. Errno provides more info. +bool algo::LockAllMemory() +``` + +```c++ +// Return Errcode corresponding to namespace and code VAL +// The namespace should have a decoder function (decode_Call(*errns_Find(ns), val)) +Errcode algo::MakeErrcode(algo::Errns ns, i64 val) +``` + +```c++ +void algo::MakeLower(strptr s) +``` + +```c++ +void algo::MakeUpper(strptr s) +``` + +```c++ +// Append / to string STR unless STR already ends in one. +// str << dirname << MaybeDirSep << filename. +// The separator is always /. To support windows-specific pathnames, +// use ToWindows path where appropriate. +void algo::MaybeDirSep(cstring &str) +``` + +```c++ +// Append a space unless the string already ends with a space +void algo::MaybeSpace(cstring &str) +``` + +```c++ +// Return modification time of file FILENAME +// If file is not found or is not accessible, return 0. +algo::UnTime algo::ModTime(strptr filename) +``` + +```c++ +// scan STR until character SEP is found. +// if SEP is not found, it is assumed to be beyond the right side of the string +// set LEFT to point to the characters to the left of found location. +// set STR to point to the characters to the right of found location. +// Example: +// str = "abc.def", sep='.'; After NextSep, str="def", left="abc" +// str = "abc-def", sep='.'; After NextSep, str="", left="abc-def" +void algo::NextSep(algo::strptr &str, char sep, algo::strptr &left) +``` + +```c++ +bool algo::NullUuidQ(const algo::Uuid &uuid) +``` + +```c++ +// Open file FILENAME with flags FLAGS, return resulting file descriptor +// Possible flags: +// write -> open file for writing, create file if missing +// if write is specified, and append is not, then file is truncated upon opening +// append -> open file in append mode (automatically sets 'write' flag) +// in append mode, seek to end of file after opening +// read -> open flag in read-only mode +// _throw -> throw exception if an error occurs +// NOTE: this function doesn't set O_APPEND flag, because it doesn't work' +// on NFS mounted filesystems. +// Without O_APPEND, two processes cannot reliably append to the same file. +algo::Fildes algo::OpenFile(const strptr& filename, algo::FileFlags flags) +``` + +```c++ +algo::Fildes algo::OpenRead(const strptr& filename, algo::FileFlags flags = algo::FileFlags()) +``` + +```c++ +algo::Fildes algo::OpenWrite(const strptr& filename, algo::FileFlags flags = algo::FileFlags()) +``` + +```c++ +inline int algo::P1Mod(int a, int b) +``` + +```c++ +// C single hex character, upper or lowercase +// RETURN value of hex character +// RESULT value of hex digit +// RETURN success code +inline int algo::ParseHex1(u32 c, u8 &result) +``` + +```c++ +// STR little-endian string up to 2 chars in length +// LEN length of STR +// RESULT value of hex number encoded in STR +// RETURN number of characters to skip (0 - unsuccessful) +int algo::ParseHex2(u32 str, int len, u8 &result) +``` + +```c++ +// Convert string to numeric type. +// If there is an error, or string is empty, return DFLT. +// If there is junk at the end of the string, silently ignore it. +// Use StringIter version to check for junk, or use -X version to throw exception. +inline int algo::ParseI32(strptr str, int dflt) +``` + +```c++ +int algo::ParseI32(StringIter &iter, int dflt) +``` + +```c++ +i64 algo::ParseI64(StringIter &iter, i64 dflt) +``` + +```c++ +inline i64 algo::ParseI64(strptr str, i64 dflt) +``` + +```c++ +inline u32 algo::ParseNum4(u32 x, u32 &ok) +``` + +```c++ +u32 algo::ParseNum4(u32 x, u32 len, u32 &ok) +``` + +```c++ +inline u32 algo::ParseNum8(u64 x, u32 &ok) +``` + +```c++ +u32 algo::ParseNum8(u64 x, u32 len, u32 &ok) +``` + +```c++ +inline int algo::ParseOct1(u32 c, u8 &result) +``` + +```c++ +// STR little-endian string up to 4 chars +// LEN length of STR +// RESULT Octal value encoded in str +// RETURN number of characters to skip (0 - unsuccessful) +int algo::ParseOct3(u32 str, int len, u8 &result) +``` + +```c++ +inline u32 algo::ParseU32(strptr str, u32 dflt) +``` + +```c++ +u32 algo::ParseU32(StringIter &iter, u32 dflt) +``` + +```c++ +inline u64 algo::ParseU64(strptr str, u64 dflt) +``` + +```c++ +// Convert string to numeric type. +// If there is an error, or string is empty, return DFLT. +// If there is junk at the end of the string, silently ignore it. +// Use StringIter version to check for junk, or use -X version to throw exception. +u64 algo::ParseU64(StringIter &iter, u64 dflt) +``` + +```c++ +algo::UnTime algo::ParseUnTime(StringIter &s, const algo::strptr spec) +``` + +```c++ +algo::UnTime algo::ParseUnTime(const algo::strptr& s, const algo::strptr spec) +``` + +```c++ +// Parses HTTP URL +// Place path part as value of first attr, +// other attrs are key-value pairs in order as the appear +void algo::ParseUrl(algo::Tuple &out, strptr in) +``` + +```c++ +// S source string +// EXPR string in the form (XYZ)* +// - X is the character to search +// - Y is L to search from left, R to search from right +// - Z is which site to pick: L=left, R=right +// If the character to search is not found, it assumed to be found +// at the far end of the string with respect to search direction. +// Function processes characters from expr in groups of 3. +// Example: +// s = "a.b.c.d" +// expr = ".LR.LL" +// first, search for . from left; pick right hand side (b.c.d) +// then, search for . from left. pick left hand side (b) +// result: b +// More examples: +// s = "abcd"; expr = ".LL"; result = "abcd" +// s = "abcd"; expr = ".LR"; result = "" +strptr algo::Pathcomp(strptr s, strptr expr) +``` + +```c++ +// Examine string VALUE +// Determine if it needs quoting as an ssim key/value, +// and return appropriate quote character. If no quote character is needed, +// return NUL. +char algo::PickSsimQuoteChar(strptr value) +``` + +```c++ +// Append key-value pair NAME:VALUE to string STR +void algo::PrintAttr(cstring &str, const algo::strptr &name, const strptr &value) +``` + +```c++ +// Print a string suitable for parsing with Tuple +// If the string doesn't need quotes, it is printed as-is. +// If quotes are needed, first determine whether to use single or double quotes to minimize +// escaping. Then print the string using char_PrintCppEsc for quoting. +// Empty string is printed as "" +void algo::PrintAttrSpace(cstring &str, algo::strptr name, const strptr &value) +``` + +```c++ +// Append key-value pair NAME:VALUE to string STR, and remove all +// characters from VALUE (used by amc) +void algo::PrintAttrSpaceReset(cstring &str, const algo::strptr &name, algo::cstring &value) +``` + +```c++ +// Append key-value pair NAME:VALUE to string STR, +// and remove all characters from VALUE (used by amc) +void algo::PrintAttrSpaceReset(cstring &str, const char *name, algo::cstring &value) +``` + +```c++ +// Default implementation of prlog handler +// This function is called via algo_lib::_db.Prlog pointer. +// The pointer may be set by the application to replace the function with something else. +// +// Notes on WriteFile use: +// we must use WriteFile (which contains a loop) to write all the bytes out, +// otherwise some terminals push back and refuse the data. +void algo::Prlog(algo_lib::FLogcat *logcat, algo::SchedTime tstamp, strptr str) +``` + +```c++ +template inline T algo::PtrAdd(U *ptr, int_ptr offset) +``` + +```c++ +void algo::Ptr_Print(void *ptr, algo::cstring &out) +``` + +```c++ +// Read big-endian word +inline u16 algo::ReadBE16(const void *val) +``` + +```c++ +inline u32 algo::ReadBE32(const void *val) +``` + +```c++ +inline u64 algo::ReadBE64(const void *val) +``` + +```c++ +// Read little-endian word +inline u16 algo::ReadLE16(const void *val) +``` + +```c++ +inline u32 algo::ReadLE32(const void *val) +``` + +```c++ +inline u64 algo::ReadLE64(const void *val) +``` + +```c++ +// Read soft link and return resulting path. +// If PATH is not a soft link, return empty string +// This is not the function to resolve symlinks (if link temp/x points to y, then +// this function will return string "y", not "temp/y"), use GetFullPath for +// full service +tempstr algo::ReadLink(strptr path) +``` + +```c++ +// Refurbish: destroy and re-create object in place. +// This function is exception-safe: if ~T throws an exception, T::T still gets +// called. +// Implementation note: explicit calls to destructor are checked for NULL pointer +// by GCC, so the nonnull attribute is required. +template inline void algo::Refurbish(T &t) F_NONNULL +``` + +```c++ +// Remove directory. +// Return TRUE if operaiton succeeds +// The function will fail if the directory is not empty. For that case, +// use RemDirRecurse. +bool algo::RemDir(strptr name) +``` + +```c++ +// Destroy directory NAME, and any subdirectories. +// If REMOVE_TOPMOST is specified, delete the directory as well, +// (otherwise, only the contents are deleted). +// If filesystem entry exists and is NOT a directory, return true. +bool algo::RemDirRecurse(strptr name, bool remove_topmost) +``` + +```c++ +int algo::Replace(cstring &str, const strptr& from, const strptr& to, bool case_sensitive = true, bool preserve_case = true) +``` + +```c++ +// Replace extension in pathname A with string B. +tempstr algo::ReplaceExt(strptr a, strptr b) NOTHROW +``` + +```c++ +// F ("a.txt","b") -> "b.txt"; +// F ("a.txt","/b.jpg") -> "b.jpg.txt" +tempstr algo::ReplaceFileName(const strptr& a, const strptr& b) +``` + +```c++ +template inline algo::aryptr algo::RestFrom(const algo::aryptr &lhs, u32 n) +``` + +```c++ +bool algo::SafeStringToFile(const strptr& str, const strptr& filename) +``` + +```c++ +// Compare STR to contents of FILENAME. +// If they differ, use a tempfile construction to atomically UPDATE file +// with contents of STR. +// NOTE: This will result in a new inode for file! +// No exceptions are thrown. If the function fails, check errno. +// Default mode for new file is provided by MODE. +// If the file is being replaced, MODE is ignored and copied from the old file. +bool algo::SafeStringToFile(const strptr& str, const strptr& filename, int dfltmode) +``` + +```c++ +// SameSign returns false if one of the arguments is zero. +template inline bool algo::SameSignQ(T a, T b) +``` + +```c++ +bool algo::SaneTerminalQ() +``` + +```c++ +// Set file position of FD to OFF +// Return success status +bool algo::SeekFile(Fildes fd, i64 off) +``` + +```c++ +inline strptr &algo::Sep_curs_Access(algo::Sep_curs &curs) +``` + +```c++ +void algo::Sep_curs_Next(algo::Sep_curs &curs) +``` + +```c++ +void algo::Sep_curs_Reset(algo::Sep_curs &curs, strptr line, char sep) +``` + +```c++ +inline bool algo::Sep_curs_ValidQ(algo::Sep_curs &curs) +``` + +```c++ +// Set blocking mode on file descriptor FD to BLOCKING +// Return result of FCNTL (0==success) +int algo::SetBlockingMode(Fildes fildes, bool blocking) NOTHROW +``` + +```c++ +// Change current directory to DIR and return success status +// errno is set as witih chdir() call +bool algo::SetCurDir(strptr in_dir) NOTHROW +``` + +```c++ +// Change TZ environment variable to specified value +// and notify C runtime lib of the change +void algo::SetTz(strptr zone) +``` + +```c++ +template inline void algo::SetnumMaybe_Set(StringDesc &desc, bool(*fcn)(T&, i64 num)) +``` + +```c++ +void algo::SetupExitSignals(bool sigint = true) +``` + +```c++ +// catch fatal signals and show backtrace +void algo::SetupFatalSignals() +``` + +```c++ +// print binary octet string as hex +void algo::Sha1sig_Print(algo::Sha1sig &sha1sig, algo::cstring &out) +``` + +```c++ +bool algo::Sha1sig_ReadStrptrMaybe(algo::Sha1sig &sha1sig, algo::strptr str) +``` + +```c++ +void algo::ShowStackTrace(uintptr_t start_ip, cstring &out) +``` + +```c++ +// if next character matches WHAT, skip and return true +// otherwise return false +inline bool algo::SkipChar(StringIter &iter, char what) +``` + +```c++ +// Case-sensitive version +bool algo::SkipStrptr(StringIter &iter, strptr str) +``` + +```c++ +// if the next characters match STR, skip and return true +// optionally do case sensitive comparison +bool algo::SkipStrptr(StringIter &iter, strptr str, bool case_sens) +``` + +```c++ +// Call sleep/usleep, giving up MS milliseconds +void algo::SleepMsec(int ms) +``` + +```c++ +// TODO generate with amc +lib_json::FNode *algo::Smallstr50_FmtJson(algo::Smallstr50 &value, lib_json::FNode *parent) +``` + +```c++ +// Construct ssim filename from key +// SsimFname("data", "abcd") -> data/abcd.ssim +// SsimFname("data/", "abcd.ef") -> data/abcd/ef.ssim +tempstr algo::SsimFname(strptr root, strptr rel) +``` + +```c++ +bool algo::StartsWithQ(strptr s, strptr sstr, bool case_sensitive = true) +``` + +```c++ +// Check strings for equality, optionally in a case-insensitive way +bool algo::StrEqual(strptr a, strptr b, bool case_sens) +``` + +```c++ +// Copy bytes from one location to another in blocks of 16 bytes. +void algo::StreamFromToB16(void *from, void *to, u32 n) +``` + +```c++ +// Replace contents of file FILENAME with string STR. +// If CHECK_SAME is specified, first compare contents and do not perform a write +// if the contents are the same. +// FLAGS may specify algo_FileFlags__throw, in which case an exception is thrown on error +bool algo::StringToFile(const strptr& str, const strptr& filename, algo::FileFlags flags = algo_FileFlags__throw, bool check_same = true) +``` + +```c++ +algo::UnDiff algo::StripDate(UnTime t) +``` + +```c++ +// Strip last component of a path. +// If the path ends in a slash, the slash is stripped as well. +// So, StripDirComponent("abcde/d/") -> abcde/ +// So, StripDirComponent("abcde/d") -> abcde/ +strptr algo::StripDirComponent(strptr a) NOTHROW +``` + +```c++ +// Remove everything up to and including the last slash in A, +// and return that. This is equivalent to Pathcomp(A,"/RR"); +strptr algo::StripDirName(strptr a) NOTHROW +``` + +```c++ +// Remove pathname A with any extension stripped. +// StripExt("abcd/e.txt") -> "abcd/e" +// StripExt("abcd/e.txt/f") -> "abcd/e/f" +// (The last slash shields the extension, so this function has no corresponding +// Pathcomp expression) +strptr algo::StripExt(strptr a) NOTHROW +``` + +```c++ +// if IDENT starts with NS_NAME., return ident without prefix +// otherwise return ident +// if NS_NAME is empty, removes any dotted prefix from IDENT. +// NS_NAME name of 'current' namespace (optional) +// IDENT identifier in question +// +// StripNs("abc", "abc.def") -> "def" +// StripNs("" , "abc.def") -> "def" +// StripNs("abc", "def.ghi") -> "def.ghi" +strptr algo::StripNs(strptr ns_name, strptr ident) +``` + +```c++ +// Skip any leading whitespace. +// Read next word (GetWordCharf) and compare to typetag. +// Skip any subsequent whitespace as well. +// Return true if type typetag matches +// if typetag doesn't match, input string remains unchanged +// " a b " -> typetag is "a", rest is "b " +// "a b" -> typetag is "a", rest is "b" +bool algo::StripTypeTag(strptr &in_str, strptr typetag) +``` + +```c++ +// This function echoes the corresponding MySQL function. +// Treat STR as an array of tokens separated by C. +// Locate and return tokens 1..IDX. Negative numbers cause scanning from the right. +// Indexes are 1-based +// Example: +// SubstringIndex("a.b.c", '.', 1) -> "a" +// SubstringIndex("a.b.c", '.', 2) -> "a.b" +// SubstringIndex("a.b.c", '.', 3) -> "a.b.c" +// SubstringIndex("a.b.c", '.', 4) -> "a.b.c" +// SubstringIndex("a.b.c", '.', -1) -> "c" +// SubstringIndex("a.b.c", '.', -2) -> "b.c" +// SubstringIndex("a.b.c", '.', -3) -> "a.b.c" +strptr algo::SubstringIndex(strptr str, char c, int idx) +``` + +```c++ +// Execute unix command and return status code. +// Execute command using system(). +// fail_ok: if true, command must succeed or throw exception +// dry_run: if true, do not run command, just print +// echo: print command. command alwyas echoed if verbose mode is on +int algo::SysCmd(strptr cmd, FailokQ fail_ok = FailokQ(true), DryrunQ dry_run = DryrunQ(false), EchoQ echo = EchoQ(false)) +``` + +```c++ +// Execute unix command and return output. +tempstr algo::SysEval(strptr cmd, FailokQ fail_ok, int max_output, bool echo = false) +``` + +```c++ +inline algo::i32_Range algo::TFind(const strptr &s, char match) +``` + +```c++ +inline algo::i32_Range algo::TRevFind(const strptr &s, char match) +``` + +```c++ +template inline void algo::TSwap(T &a, T &b) +``` + +```c++ +tempstr algo::Tabulated(strptr in, strptr sep) +``` + +```c++ +// Locate all occurences of SEP in string IN, scanning line-by-line. +// Compute column widths; Scan string IN again. +// Expand each column to the required width, leaving COLSPACE characters between +// columns. +// String FMT specifies, for each column, whether to align its contents left,center,or right +// ('l','c','r'). Default is 'l'. +// Example text +// aa\tcc\tbb +// asdfasdf\t\tyy +// Tabulated(text, "\t", "rl", 2) -> +// aa cc bb +// asdfasdf yy +tempstr algo::Tabulated(strptr in, strptr sep, strptr fmt, int colspace) +``` + +```c++ +void algo::Throw() NORETURN +``` + +```c++ +// The several variants of Throw are all the same -- the goal is to get as many +// setup instructions out of the execution path as possible, to avoid polluting instruction +// cache. +void algo::Throw(strptr text, Errcode err) NORETURN +``` + +```c++ +// print TIME to STR, according to spec SPEC +// The following control characters are supported in SPEC. +// %Y Year printed as 4 digits, e.g. 2002 +// %y Last 2 digits of year printed as 2 digits +// %B Long month name (February) +// %b Short month name (Feb) +// %a Week day name (Monday) +// %m Month printed as 2 digits, with January being 01 +// %d Day of month printed as at least 2 digits (or WIDTH) +// %.X where X is a number -- set width +// %I Hour using 12-hour format +// %H Hour using 24-hour format, printed as 2 digits +// %M Minute, printed as 2 digits +// %S Second, printed as 2 digits +// %T Shortcut for %H:%M:%S.%.9X +// %X Print fractions of a second according to width +// %x Print milliseconds with 3 decimal places +// %- Print - sign if timespec is negative +// %% Print % sign +void algo::TimeStruct_Print(const TimeStruct &time, algo::cstring &str, const algo::strptr &spec) +``` + +```c++ +bool algo::TimeStruct_Read(TimeStruct &out, algo::StringIter &iter, const strptr& spec) +``` + +```c++ +inline char algo::ToLower(char i) +``` + +```c++ +// Note: cstring << algo::ToLower(int) will output an *integer*, not a character +inline int algo::ToLower(int i) +``` + +```c++ +inline algo::SchedTime algo::ToSchedTime(double secs) +``` + +```c++ +// Convert scheduler time units to seconds. +inline double algo::ToSecs(SchedTime ticks) +``` + +```c++ +inline double algo::ToSecs(UnDiff t) +``` + +```c++ +inline double algo::ToSecs(UnTime t) +``` + +```c++ +inline double algo::ToSecs(algo::WDiff t) +``` + +```c++ +inline algo::strptr algo::ToStrPtr(memptr buf) +``` + +```c++ +TimeStruct algo::ToTimeStruct(UnDiff U) +``` + +```c++ +TimeStruct algo::ToTimeStruct(UnixDiff U) +``` + +```c++ +algo::UnDiff algo::ToUnDiff(const TimeStruct &S) +``` + +```c++ +inline algo::UnDiff algo::ToUnDiff(SchedTime ticks) +``` + +```c++ +inline algo::UnDiff algo::ToUnDiff(algo::WDiff d) +``` + +```c++ +algo::UnTime algo::ToUnTime(WTime s) +``` + +```c++ +algo::UnTime algo::ToUnTime(const TimeStruct &S) +``` + +```c++ +inline algo::UnTime algo::ToUnTime(UnixTime t) +``` + +```c++ +algo::UnixDiff algo::ToUnixDiff(const TimeStruct &S) +``` + +```c++ +inline algo::UnixDiff algo::ToUnixDiff(algo::WDiff d) +``` + +```c++ +algo::UnixTime algo::ToUnixTime(const TimeStruct &S) +``` + +```c++ +inline algo::UnixTime algo::ToUnixTime(UnTime t) +``` + +```c++ +inline algo::UnixTime algo::ToUnixTime(algo::WTime nt) +``` + +```c++ +inline char algo::ToUpper(char i) +``` + +```c++ +// Note: cstring << algo::ToUpper(int) will output an *integer*, not a character +inline int algo::ToUpper(int i) +``` + +```c++ +inline algo::WDiff algo::ToWDiff(algo::UnDiff d) +``` + +```c++ +inline algo::WDiff algo::ToWDiff(algo::UnixDiff d) +``` + +```c++ +inline algo::WTime algo::ToWTime(algo::UnTime s) +``` + +```c++ +inline algo::WTime algo::ToWTime(algo::UnixTime t) +``` + +```c++ +// Convert unix path to windows path +// This replaces slashes with backslashes +tempstr algo::ToWindowsPath(strptr path) +``` + +```c++ +// Scan S. For any character in S that occurs in string FROM, replace with corresponding +// character from string TO. +// Example: +// Translate("aabcd", "bd", "xy") -> "aaxcy" +void algo::Translate(strptr s, strptr from, strptr to) +``` + +```c++ +// TrimmedLeft + TrimmedRight +strptr algo::Trimmed(strptr s) +``` + +```c++ +// Strip leading whitespace, return new strptr. +strptr algo::TrimmedLeft(strptr s) +``` + +```c++ +// Strip trailing whitespace, return new strptr. +strptr algo::TrimmedRight(strptr s) +``` + +```c++ +// Truncate file indicated by FD to size SIZE. +// Return success status +// TODO: Test on windows +bool algo::TruncateFile(Fildes fd, i64 size) +``` + +```c++ +// Try parse Decimal [+-][0-9]*[.][0-9]* +// Stop after first non-conforming char, error if no digit has been met. +bool algo::TryParseDecimal(algo::StringIter &iter, algo::Decimal &result) +``` + +```c++ +// Read a series of digits and return resulting number. +// Return success code +bool algo::TryParseDigits(algo::StringIter &S, double &result) +``` + +```c++ +bool algo::TryParseDouble(algo::StringIter &iter, double &result) +``` + +```c++ +// TODO: document these more carefully +// Read a series of digits N, returning N / pow(10, length(N)) +// If successful, advance index. Otherwise, leave index where it was. +bool algo::TryParseFraction(algo::StringIter &S, double &result) +``` + +```c++ +bool algo::TryParseI32(algo::StringIter &iter, i32 &result) +``` + +```c++ +bool algo::TryParseI64(algo::StringIter &iter, i64 &result) +``` + +```c++ +bool algo::TryParseU32(algo::StringIter &iter, u32 &result) +``` + +```c++ +bool algo::TryParseU64(algo::StringIter &iter, u64 &result) +``` + +```c++ +bool algo::TryParseU128(algo::StringIter &iter, u128 &result) +``` + +```c++ +void algo::Tuple_Print(algo::Tuple &row_, algo::cstring &str) +``` + +```c++ +// T target tuple. the tuple is not emptied before parsing. +// STR source string +// ATTRONLY if set, all loaded attrs are appended to the ATTRS +// array. otherwise, the first attr becomes HEAD. +// CMT_CHAR character at which to stop parsing. +// Parse sequence of attrs (name-value pairs) into tuple T. +// Roughly: +// ATTR -> VALUE | VALUE ':' VALUE +// VALUE -> IDENTIFIER | C++-STRING +// Return value: FALSE if unterminated string or other badness found in data. +bool algo::Tuple_ReadStrptr(algo::Tuple &tuple, strptr str, bool attronly) +``` + +```c++ +bool algo::Tuple_ReadStrptrMaybe(Tuple &row, algo::strptr s) +``` + +```c++ +void algo::URL_Print(algo::URL &url, algo::cstring &str) +``` + +```c++ +// Parse a URL from string STR to OUT. +// The format of a URL is +// protocol://user:password@somehost:port<-source_interface/dir1/dir2 +// URL fields are +// protocol, username, password, server, port, host, source_addr_host, dir +// +// +// Windows pathnames are supported, e.g. +// when parsing +// file://c:/dir/dir2 +// c: will not be parsed as a username, but as part of the pathname. +// +bool algo::URL_ReadStrptrMaybe(URL &out, algo::strptr str) +``` + +```c++ +inline algo::UnDiff algo::UnDiffHMS(int h, int m, int s) +``` + +```c++ +inline algo::UnDiff algo::UnDiffMsecs(const i64 i) +``` + +```c++ +inline algo::UnDiff algo::UnDiffSecs(double d) +``` + +```c++ +inline algo::UnDiff algo::UnDiffSecs(i32 i) +``` + +```c++ +inline algo::UnDiff algo::UnDiffSecs(i64 i) +``` + +```c++ +inline algo::UnDiff algo::UnDiffUsecs(const double d) +``` + +```c++ +void algo::UnDiff_Print(UnDiff row, algo::cstring &str) +``` + +```c++ +void algo::UnDiff_PrintSpec(UnDiff t, algo::cstring &out, const algo::strptr &spec) +``` + +```c++ +bool algo::UnDiff_ReadStrptrMaybe(UnDiff &row, algo::strptr str) +``` + +```c++ +inline algo::UnTime algo::UnTimeSecs(double d) +``` + +```c++ +void algo::UnTime_Print(algo::UnTime row, algo::cstring &str) +``` + +```c++ +void algo::UnTime_PrintSpec(UnTime t, algo::cstring &out, const algo::strptr &spec) +``` + +```c++ +// Read time from STR to ROW +// Return success code. +// If funciton does not succeed, ROW is not modified +// Several formats are supported: +// %Y-%m-%dT%T +// %Y-%m-%d %T +// %Y/%m/%d %T +// %Y-%m-%d +// %Y/%m/%d +// Where %T is %H:%M:%S.%X +// And %X is the nanosecond portion +bool algo::UnTime_ReadStrptrMaybe(algo::UnTime &row, algo::strptr str) +``` + +```c++ +// Given a string of up to 4 characters encoded in u32 STR +// (LSB = first char, etc.) +// Decode character into RESULT, returning number of characters read. +// The character is C++-escaped: \a, \b, \f, \n, \r, \t, \v, \', \", \\, \? are supported +// as well as octal (\OOO) and hex (\xHH) sequences. +int algo::UnescapeC(u32 str, int len, u8 &result) +``` + +```c++ +inline algo::UnixDiff algo::UnixDiffHMS(i64 h, int m, int s) +``` + +```c++ +void algo::UnixDiff_Print(UnixDiff row, algo::cstring &str) +``` + +```c++ +void algo::UnixDiff_PrintSpec(UnixDiff t, algo::cstring &out, const algo::strptr &spec) +``` + +```c++ +void algo::UnixTime_Print(algo::UnixTime row, algo::cstring &str) +``` + +```c++ +void algo::UnixTime_PrintSpec(UnixTime t, algo::cstring &out, const algo::strptr &spec) +``` + +```c++ +bool algo::UnixTime_ReadStrptrMaybe(algo::UnixTime &row, algo::strptr str) +``` + +```c++ +// perform standard url percent decoding (for raw url, path), +// and optionally translate '+' to space (for application/x-www-form-urlencoded) +tempstr algo::UrlDecode(strptr in, bool plus) +``` + +```c++ +void algo::Uuid_Print(algo::Uuid &parent, algo::cstring &str) +``` + +```c++ +bool algo::Uuid_ReadStrptrMaybe(algo::Uuid &parent, strptr str) +``` + +```c++ +// Default, and invalid, value for Fildes is -1. 0 is a valid value (stdin)! +inline bool algo::ValidQ(Fildes fd) +``` + +```c++ +void algo::WDiff_Print(algo::WDiff row, algo::cstring &str) +``` + +```c++ +bool algo::WDiff_ReadStrptrMaybe(algo::WDiff &parent, algo::strptr in_str) +``` + +```c++ +void algo::WTime_Print(algo::WTime row, algo::cstring &str) +``` + +```c++ +bool algo::WTime_ReadStrptrMaybe(algo::WTime &parent, algo::strptr in_str) +``` + +```c++ +inline strptr &algo::Word_curs_Access(Word_curs &curs) +``` + +```c++ +void algo::Word_curs_Next(Word_curs &curs) +``` + +```c++ +void algo::Word_curs_Reset(Word_curs &curs, strptr text) +``` + +```c++ +inline bool algo::Word_curs_ValidQ(Word_curs &curs) +``` + +```c++ +// Write NWRITE bytes starting at START to file descriptor FILDES. +// Go until all bytes are written on an error occurs. +// If FILDES is non-blocking, spin indefinitely until bytes do get through. +// At the end, return success status (TRUE if all bytes written) +bool algo::WriteFile(algo::Fildes fildes, u8 *start, int nwrite) +``` + +```c++ +// Write BYTES to file FD; +// If FD is non-blocking, the function may fail. +// Throw exception on error. Upon completion, the function has succeeded +void algo::WriteFileX(Fildes fd, memptr bytes) +``` + +```c++ +strptr algo::Yield(algo::u64_RangesList &p) +``` + +```c++ +template inline void algo::ZeroBytes(T &t) +``` + +```c++ +// Same thing but with tempstr. +// Typical usage is to take a strptr +// expression and pass it to some unix call +// some_unix_call(Zeroterm(tempstr(some_strptr))) +// +char *algo::Zeroterm(const tempstr &rhs) +``` + +```c++ +// Append NUL character to the end of the string and return a +// pointer to the C string. +// There is no guarantee that there are no NUL characters in the middle +// of STR, that is up to the user. +// cstring is normally NOT null terminated (it is length-based), +// so this function is necessary when passing strings to C library functions +// or the OS +char *algo::Zeroterm(cstring &rhs) +``` + +```c++ +inline u32 algo::aParseNum4(strptr s, u32 &ok) +``` + +```c++ +inline u32 algo::aParseNum8(strptr s, u32 &ok) +``` + +```c++ +u64 algo::aParseNum16(strptr s, u32 &ok) +``` + +```c++ +// Append new attribute with specified name and value. +void algo::attr_Add(Tuple &T, strptr name, strptr value) +``` + +```c++ +Attr* algo::attr_Find(Tuple &tuple, strptr name, int occurence = 0) +``` + +```c++ +strptr algo::attr_GetString(Tuple &T, strptr name, strptr dflt = strptr()) +``` + +```c++ +// Update atribute if exists, otherwise create new one +void algo::attr_Set(Tuple &T, strptr name, strptr value) +``` + +```c++ +algo::i32_Range algo::ch_FindFirst(const algo::strptr &s, char match) +``` + +```c++ +algo::i32_Range algo::ch_FindLast(const algo::strptr &s, char match) +``` + +```c++ +inline int algo::ch_First(const strptr &s, int dflt = 0) +``` + +```c++ +inline algo::aryptr algo::ch_FirstN(const strptr &lhs, u32 n) +``` + +```c++ +inline algo::aryptr algo::ch_GetRegion(const strptr &lhs, u32 lo, u32 n) +``` + +```c++ +inline int algo::ch_Last(const strptr &s, int dflt = 0) +``` + +```c++ +inline algo::aryptr algo::ch_LastN(const strptr &lhs, u32 n) +``` + +```c++ +inline int algo::ch_N(const strptr &s) +``` + +```c++ +inline int algo::ch_N(const tempstr &str) +``` + +```c++ +template inline int algo::ch_N(const aryptr &ary) +``` + +```c++ +inline algo::aryptr algo::ch_RestFrom(const strptr &lhs, u32 n) +``` + +```c++ +// Write character C into string OUT, using C++ character escapement rules +// QUOTE_CHAR also gets escaped. +void algo::char_PrintCppEsc(char c, algo::cstring &out, char quote_char) +``` + +```c++ +// print character as c++ character, surrounded by single quotes +// and properly escaped according to c++ rules +void algo::char_PrintCppSingleQuote(int c, algo::cstring &out) +``` + +```c++ +// Append N instances of character C to string OUT. +void algo::char_PrintNTimes(char c, algo::cstring &out, int n) +``` + +```c++ +// prints a character suitable for appearance inside an XML string. +// character is either printed as-is, or is escaped so that its meaning does not change. +void algo::char_PrintXml(char c, algo::cstring &out, bool quoted) +``` + +```c++ +lib_json::FNode *algo::cstring_FmtJson(algo::cstring &value, lib_json::FNode *parent) +``` + +```c++ +inline u32 algo::cstring_Hash(u32 prev, const algo::strptr &val) +``` + +```c++ +void algo::cstring_Print(algo::cstring &row, algo::cstring &str) +``` + +```c++ +// Implementations of built-in read functions for AMC. +// basis function for reading tuples. +// scan ITER for identifier, or quoted string. +// return FALSE if attribute is malformed (i.e. unterminated string) +bool algo::cstring_ReadCmdarg(cstring &out, algo::StringIter &S, bool is_value) +``` + +```c++ +bool algo::cstring_ReadStrptrMaybe(algo::cstring &row, algo::strptr str) +``` + +```c++ +// User-defined cleanup trigger for dir_handle field of ctype:algo.DirEntry +void algo::dir_handle_Cleanup(algo::DirEntry &dir_entry) +``` + +```c++ +inline double algo::double_NegateIf(double x, bool i) +``` + +```c++ +// print value*100 +// Example: +// double_PrintPercent(0.334, str, 1) -> "33.4%" +void algo::double_PrintPercent(double value, algo::cstring &str, int prec) +``` + +```c++ +// Print double D into string OUT with PRECISION digits +// after the decimal point. +// If OMIT_ZEROS is specified, trailing zeros that are safe to omit are omitted. +// If COMMAS is specified, the large numbers are printed in groups of 3 digits +// with commas between them. +void algo::double_PrintPrec(double d, algo::cstring &out, int precision, bool omit_zeros, bool commas) +``` + +```c++ +// ignore:bigret +algo::cstring algo::double_PrintWithCommas(double value, int prec) +``` + +```c++ +void algo::double_PrintWithCommas(double value, algo::cstring &str, int prec) +``` + +```c++ +double algo::double_WeakRandom(double scale) +``` + +```c++ +template inline int algo::elems_N(const aryptr &ary) +``` + +```c++ +// Append and end-of-line sequence to string S. +inline void algo::eol(cstring &s) +``` + +```c++ +inline float algo::float_NegateIf(float x, bool i) +``` + +```c++ +// get CPU HZ value as double +inline double algo::get_cpu_hz() +``` + +```c++ +// get CPU HZ value as u64 +inline u64 algo::get_cpu_hz_int() +``` + +```c++ +// cpu_hz (untyped SchedTime) +// use this for timestamps. +// these calls may be pipelined and reordered, so measuring instruction +// latency with these is not possible. for that, use rdtscp +inline u64 algo::get_cycles() +``` + +```c++ +strptr algo::gitinfo_Get() +``` + +```c++ +inline int algo::i32_NegateIf(int x, bool i) +``` + +```c++ +void algo::i32_Range_Print(algo::i32_Range &r, algo::cstring &o) +``` + +```c++ +i32 algo::i32_WeakRandom(i32 modulo) +``` + +```c++ +inline i64 algo::i64_NegateIf(i64 x, bool i) +``` + +```c++ +// pads with zeros on the left so that at least 'atleast' characters are output. +void algo::i64_PrintPadLeft(i64 num, algo::cstring &out, int atleast) +``` + +```c++ +// print bytes in hex e.g: 00 01 ff +void algo::memptr_Print(algo::memptr parent, algo::cstring &str) +``` + +```c++ +inline algo::aryptr algo::memptr_ToStrptr(algo::aryptr rhs) +``` + +```c++ +inline algo::cstring &algo::operator<<(algo::cstring &out, const ListSep &t) +``` + +```c++ +inline algo::cstring &algo::operator<<(algo::cstring &out, const char* t) +``` + +```c++ +inline algo::cstring &algo::operator<<(algo::cstring &out, const strptr &t) +``` + +```c++ +inline algo::cstring &algo::operator<<(algo::cstring &out, void (*t)(algo::cstring &)) +``` + +```c++ +template inline algo::aryptr algo::qGetRegion(const algo::aryptr &lhs, u32 lo, u32 n) +``` + +```c++ +template inline T &algo::qLast(const algo::aryptr &ary) +``` + +```c++ +inline int algo::range_N(const i32_Range &rhs) +``` + +```c++ +// use this for performance measurements. +// according to Intel software manual, lfence followed by rdtsc +// is the beez knees. +inline u64 algo::rdtscp() +``` + +```c++ +// compatibility +void algo::reset(algo::cstring &lhs) +``` + +```c++ +inline i32 algo::strptr_Cmp(algo::strptr a, algo::strptr b) +``` + +```c++ +// Compare two strings for equality, case-sensitively +inline bool algo::strptr_Eq(algo::strptr a, algo::strptr b) +``` + +```c++ +lib_json::FNode *algo::strptr_FmtJson(const algo::strptr value, lib_json::FNode *parent) +``` + +```c++ +inline u32 algo::strptr_Hash(u32 prev, algo::strptr val) +``` + +```c++ +// Test if string A is lexicographically less than string B. +inline bool algo::strptr_Lt(algo::strptr a, algo::strptr b) +``` + +```c++ +void algo::strptr_Print(const algo::strptr &row, algo::cstring &str) +``` + +```c++ +void algo::strptr_PrintAligned(algo::strptr str, algo::cstring &out, int nplaces, algo::TextJust align, char c) +``` + +```c++ +// print base64-encoded string +void algo::strptr_PrintBase64(strptr str, cstring &out) +``` + +```c++ +// Print STR to OUT in a way that's acceptable as input for bash. +void algo::strptr_PrintBash(strptr str, algo::cstring &out) +``` + +```c++ +// Print string, replacing '_x' with 'X', and capitalizing first word. +void algo::strptr_PrintCamel(algo::strptr str, algo::cstring& out) +``` + +```c++ +// copy string B to TO, using ORIG as a case template +// I.e. PrintCopyCase("AbcD", to, "somestring") -> "SomEstring" +void algo::strptr_PrintCopyCase(const algo::strptr &orig, algo::cstring &to, const algo::strptr &b) +``` + +```c++ +// Print STR as a C++ string to OUT. +void algo::strptr_PrintCpp(algo::strptr str, algo::cstring &out) +``` + +```c++ +// Print STR, surrounded by quotes as C++ string +// surrounded by QUOTE_CHAR quotes, to buffer OUT. +// All string characters are escaped using char_PrintCppEsc. +void algo::strptr_PrintCppQuoted(algo::strptr str, algo::cstring &out, char quote_char) +``` + +```c++ +// Print CSV field, auto-determine quotes +void algo::strptr_PrintCsv(algo::strptr str, algo::cstring &out) +``` + +```c++ +// Append STR to OUT, using comma-separated-values encoding +// If QUOTE is 0, the need for quotes and the type of quote is determined automatically. +// If it is any other value, then that type of quote is used +// According to the CSV standard, the quote itself is the escape character. +void algo::strptr_PrintCsv(algo::strptr str, algo::cstring &out, char quote) +``` + +```c++ +// Print string, escaping characters in a way suitable for graphviz dot format +void algo::strptr_PrintDot(strptr s, algo::cstring &out) +``` + +```c++ +// Convert CamelCase to lower_under. +// A consecutive run of caps gets a single leading underscore. +// Leading cap doesn't get an underscore +// Example: "abcd testString" -> "abcd test_string" +// Example: "Abcd" -> "abcd" +// Example: "BBOPrice" -> "bboprice" +// Example: "SymbolID" -> "symbol_id" +// Example: "A_B" -> "a_b" +void algo::strptr_PrintLowerUnder(algo::strptr str, algo::cstring &out) +``` + +```c++ +// Append STR to OUT, padding start with spaces. +void algo::strptr_PrintPadLeft(algo::strptr str, algo::cstring &out, int nplaces) +``` + +```c++ +// Append STR to OUT, padding start with character FILL +void algo::strptr_PrintPadLeft(algo::strptr str, algo::cstring &out, int nplaces, char fill) +``` + +```c++ +// Append STR to OUT, and pad remainder with space characters +void algo::strptr_PrintPadRight(algo::strptr str, algo::cstring &out, int nplaces) +``` + +```c++ +// Append STR to OUT, and pad remainder with character FILL +void algo::strptr_PrintPadRight(algo::strptr str, algo::cstring &out, int nplaces, char fill) +``` + +```c++ +// Print a string as a classic regex, escaping all special +// characters. This regex will only match the specified string. +void algo::strptr_PrintRegxSql(algo::strptr value, algo::cstring &str) +``` + +```c++ +void algo::strptr_PrintSql(algo::strptr str, algo::cstring &out) +``` + +```c++ +// Append STR to OUT as an SQL string using quote character Q. +// Escaped characters: +// '\' (backslash) +// ' quoted with '' if q is ' and not quoted otherwise. (Compatible with MariaDB & T-SQL.) +// " quoted with "" if q is " and not quoted otherwise. (Compatible with MariaDB & T-SQL.) +// NUL (ascii zero) +// \n +// \r +// \t +void algo::strptr_PrintSql(algo::strptr str, algo::cstring &out, char q) +``` + +```c++ +// Print STR as a valid SSIM key/value to OUT. +// SSIM tokens use quotes only when the printed value contains +// characters outside of the 'safe' set a-zA-Z0-9_;&*^%$@.!:,+/- +void algo::strptr_PrintSsim(algo::strptr str, algo::cstring &out) +``` + +```c++ +// Print string NAME as a TeX identifier to OUT, converting digits to letters +// (0 -> zero, etc) and squashing other characters not belonging to TeX +// identifier character class +void algo::strptr_PrintTexIdent(strptr name, algo::cstring &out) +``` + +```c++ +// print STR to OUT, escaping TeX characters that switch modes +// (_, #, &, $) +void algo::strptr_PrintTexString(strptr str, algo::cstring &out) +``` + +```c++ +// encode uri component. +// before ? use plus=false (no + substitution by space) +void algo::strptr_PrintUri(strptr str, algo::cstring &out, bool plus) +``` + +```c++ +// Assuming SRC is a number, Transfer SRC to OUT, inserting +// commas between groups of 3 numbers. +// 0 -> 0 +// 11 -> 11 +// 222 -> 222 +// 3333 -> 3,333 +// 4567.3 -> 4,567.3 +// 1.11111 -> 1.11111 +void algo::strptr_PrintWithCommas(strptr src, algo::cstring &out) +``` + +```c++ +// Print string using XML rules. +void algo::strptr_PrintXml(algo::strptr s, algo::cstring &out, bool quoted) +``` + +```c++ +bool algo::strptr_ReadStrptrMaybe(strptr , strptr ) +``` + +```c++ +// Escape S according to bash rules and return result +tempstr algo::strptr_ToBash(strptr str) +``` + +```c++ +inline algo::aryptr algo::strptr_ToMemptr(algo::aryptr rhs) +``` + +```c++ +// Escape S according to ssim rules and return result +tempstr algo::strptr_ToSsim(strptr str) +``` + +```c++ +// Output string STR to OUT changing all characters to uppercase. +void algo::strptr_ToUpper(algo::strptr str, algo::cstring& out) +``` + +```c++ +// Assuming STR is a number, remove any unnecessary characters from the right of it. +// Unnecessary characters are trailing zeros after a dot. +// If the string contains no dot, nothing is done. +// If a trailing '.' or a single '-' remains, it is removed as well. +// If the resulting string is empty, a single zero is returned. +// +// 0 -> 0 +// 0.1 -> 0.1 +// 0.0 -> 0 +// 12345.000 -> 12345 +// -0 -> -0 +// .0 -> 0 +// -.0 -> 0 +// -0.0 -> -0 +// -10.0 -> -10 +// -> empty string is not touched +// Since the string may be edited, you can't pass compile-time constants +// to this function. In fact the only reason this function is not private to algo_lib +// is because of unit testing. +// If the initial string is empty, nothing is done. +// BEWARE: this function will happily convert 1e+60 to 1e+6 +// +void algo::strptr_TrimZerosRight(strptr &str) +``` + +```c++ +// Find first occurence of MATCH in S +// If found, return range corresponding to the match. +// If not found, return range (S.n_elems,S.n_elems) -- an empty range positioned at +// the end of S +algo::i32_Range algo::substr_FindFirst(const aryptr &s, const aryptr &match) +``` + +```c++ +// Same as above but search right-to-left. +// In case of failure, return range (0,0) -- empty range positioned at start of S. +algo::i32_Range algo::substr_FindLast(const aryptr &s, const aryptr &match) +``` + +```c++ +// Allowing only for fixed length formats. +void algo::tstamp_cache_Init(TstampCache& cache, strptr spec, bool gmt) +``` + +```c++ +void algo::tstamp_cache_Print(algo::TstampCache& cache, UnTime t, cstring& out) +``` + +```c++ +inline u32 algo::u8_BitScanForward(u8 v) +``` + +```c++ +inline u32 algo::u8_BitScanReverse(u8 v) +``` + +```c++ +inline u32 algo::u8_Count1s(u8 x) +``` + +```c++ +// reverse bit order in a byte +inline u8 algo::u8_ReverseBits(u8 b) +``` + +```c++ +inline u32 algo::u16_BitScanForward(u16 v) +``` + +```c++ +inline u32 algo::u16_BitScanReverse(u16 v) +``` + +```c++ +inline u32 algo::u16_Count1s(u16 x) +``` + +```c++ +inline u32 algo::u16_FmtBuf(u32 value, u8 *buf) +``` + +```c++ +inline u16 algo::u16_SubClip( u16 a, u16 b) +``` + +```c++ +// Forward: returns 0-based index of least significant bit that is set +// Reverse: returns 0-based index of most significant bit that is set. +// input argument must not be zero. +// input result in 0 is undefined (see Intel manual) +// http://www.intel.com/content/dam/doc/manual/64-ia-32-architectures-software-developer-vol-2a-2b-instruction-set-a-z-manual.pdf +inline u32 algo::u32_BitScanForward(u32 v) +``` + +```c++ +inline u32 algo::u32_BitScanReverse(u32 v) +``` + +```c++ +inline u32 algo::u32_CeilPow2(u32 a, u32 b) +``` + +```c++ +inline u32 algo::u32_Count1s(u32 x) +``` + +```c++ +// Convert VALUE to a string, encoded as a u64. +// Value must be >=0 and <100000000. +// Resulting u64 is little-endian -- MSB contains first byte +// of the resulting string. To be used as an ascii string, value +// 0x3030303030303030 (8 ascii '0's) must be added to the result. +// Don't use this function. Use u32_FmtBufSmall, and u64_FmtBuf. +u64 algo::u32_CvtLestr8Small(u32 value) +``` + +```c++ +// Format VALUE, which is an arbitrary u32, +// as a string and write it to buffer BUF. +// Return length of resulting string. +// Buffer must be big enough. +u32 algo::u32_FmtBuf(u32 value, u8 *buf) +``` + +```c++ +// Format VALUE, which should be >=0 and <100000000, +// as a string and write it to buffer BUF. Return length of resulting string. +// Buffer must be big enough. +u32 algo::u32_FmtBufSmall(u32 value, u8 *buf) +``` + +```c++ +inline u32 algo::u32_ModPow2(u32 a, u32 b) +``` + +```c++ +inline bool algo::u32_Pow2Q(u32 i) +``` + +```c++ +inline u32 algo::u32_SubClip( u32 a, u32 b) +``` + +```c++ +inline u64 algo::u64_BitScanForward(u64 v) +``` + +```c++ +inline u64 algo::u64_BitScanReverse(u64 v) +``` + +```c++ +inline u64 algo::u64_CeilPow2(u64 a, u64 b) +``` + +```c++ +inline u32 algo::u64_Count1s(u64 x) +``` + +```c++ +// Format VALUE, which is an arbitrary u64, +// as a string and write it to buffer BUF. +// Return length of resulting string. +// Buffer must be big enough. +u32 algo::u64_FmtBuf(u64 value, u8 *buf) +``` + +```c++ +u32 algo::u64_FmtBufDec(u64 num, int scale, u8 *buf) +``` + +```c++ +// Print scaled decimal. +// VALUE integer value +// SCALE log10 to get the real value: real value = value / pow(10,scale) +// BUF target buffer. buffer must be large enough. +// FIXED if true, make sure there are exactly SCALE characters after decimal point (and always emit decimal point) +// RETURN number of characters printed. +// Example: +// u64_FmtBufDec(0 , 2, .. false ) -> "0" +// u64_FmtBufDec(0 , 2, .. true ) -> "0.00" +// u64_FmtBufDec(123 , 1, .. false ) -> "12.3" +// u64_FmtBufDec(123 , 2, .. false ) -> "1.23" +// u64_FmtBufDec(123 , 2, .. true ) -> "1.23" +// u64_FmtBufDec(1230 , 3, .. false ) -> "1.23" +// u64_FmtBufDec(1230 , 3, .. true ) -> "1.230" +u32 algo::u64_FmtBufDec(u64 num, int scale, u8 *buf, bool fixed) +``` + +```c++ +inline u64 algo::u64_ModPow2(u64 a, u64 b) +``` + +```c++ +inline bool algo::u64_Pow2Q(u64 i) +``` + +```c++ +void algo::u64_PrintBase32(u64 k, algo::cstring &str) +``` + +```c++ +// Print value VALUE to string OUT, +// producing least ATLEAST hex characters. +// Include prefix 0x. +void algo::u64_PrintHex(u64 value, algo::cstring &out, int atleast) +``` + +```c++ +// Print value VALUE to string OUT, +// producing least ATLEAST hex characters. +// if PREFIX is specified, include prefix 0x. +void algo::u64_PrintHex(u64 value, algo::cstring &out, int atleast, bool prefix) +``` + +```c++ +void algo::u64_PrintHex(u64 value, algo::cstring &out, int atleast, bool prefix, bool caps) +``` + +```c++ +u64 &algo::u64_Ranges_curs_Access(algo::u64_Ranges_curs &curs) +``` + +```c++ +void algo::u64_Ranges_curs_Next(algo::u64_Ranges_curs &curs) +``` + +```c++ +void algo::u64_Ranges_curs_Reset(algo::u64_Ranges_curs &curs, strptr str) +``` + +```c++ +bool algo::u64_Ranges_curs_ValidQ(algo::u64_Ranges_curs &curs) +``` + +```c++ +// unsigned subtract with clipping +inline u64 algo::u64_SubClip( u64 a, u64 b) +``` + +```c++ +inline u32 algo::u128_Count1s(u128 x) +``` + +```c++ +void algo::u128_PrintHex(u128 value, algo::cstring &out, bool prefix) +``` + + + diff --git a/txt/protocol/ams/DfltStream.md b/txt/protocol/ams/DfltStream.md deleted file mode 100644 index 09e95107..00000000 --- a/txt/protocol/ams/DfltStream.md +++ /dev/null @@ -1,15 +0,0 @@ -## ams.DfltStream - Set default stream for subsequent messages - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.DfltStream - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|stream_id|ams.StreamId|Val||Message ID| - - - diff --git a/txt/protocol/ams/DumpStreamTableMsg.md b/txt/protocol/ams/DumpStreamTableMsg.md deleted file mode 100644 index ae3d8196..00000000 --- a/txt/protocol/ams/DumpStreamTableMsg.md +++ /dev/null @@ -1,15 +0,0 @@ -## ams.DumpStreamTableMsg - Remove process from process group - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.DumpStreamTableMsg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|proc_id|ams.ProcId|Val||Target process| - - - diff --git a/txt/protocol/ams/HeartbeatMsg.md b/txt/protocol/ams/HeartbeatMsg.md deleted file mode 100644 index 2e0d14a9..00000000 --- a/txt/protocol/ams/HeartbeatMsg.md +++ /dev/null @@ -1,15 +0,0 @@ -## ams.HeartbeatMsg - - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.HeartbeatMsg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|time|algo.UnTime|Val||| - - - diff --git a/txt/protocol/ams/Member.md b/txt/protocol/ams/Member.md deleted file mode 100644 index 15b4961e..00000000 --- a/txt/protocol/ams/Member.md +++ /dev/null @@ -1,16 +0,0 @@ -## ams.Member - Process/Stream/Mode - primary key for reader/writer of stream - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.Member - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|proc_id|ams.ProcId|Val||Proces ID| -|stream_id|ams.StreamId|Val||Stream ID| -|mode|u8|Val|0|0=read, 1=write (2 or more =read)| - - - diff --git a/txt/protocol/ams/OpenMsg.md b/txt/protocol/ams/OpenMsg.md deleted file mode 100644 index 4f8c4952..00000000 --- a/txt/protocol/ams/OpenMsg.md +++ /dev/null @@ -1,16 +0,0 @@ -## ams.OpenMsg - Open stream for reading - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.OpenMsg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|member|ams.Member|Val||Target process_id and stream_id| -|pos|ams.StreamPos|Val||Start reading here| - - - diff --git a/txt/protocol/ams/PrlogMsg.md b/txt/protocol/ams/PrlogMsg.md deleted file mode 100644 index e3dac9bb..00000000 --- a/txt/protocol/ams/PrlogMsg.md +++ /dev/null @@ -1,17 +0,0 @@ -## ams.PrlogMsg - - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.PrlogMsg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|logcat|algo.RnullStr50|Val||| -|tstamp|algo.SchedTime|Val||| -|data|ams.MsgHeader|Opt||| - - - diff --git a/txt/protocol/ams/ProcAddMsg.md b/txt/protocol/ams/ProcAddMsg.md deleted file mode 100644 index 37ccb25d..00000000 --- a/txt/protocol/ams/ProcAddMsg.md +++ /dev/null @@ -1,15 +0,0 @@ -## ams.ProcAddMsg - Add process to process group - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.ProcAddMsg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|proc_id|ams.ProcId|Val||ID of process being added| - - - diff --git a/txt/protocol/ams/ProcId.md b/txt/protocol/ams/ProcId.md index c1e13c53..1fbe69e5 100644 --- a/txt/protocol/ams/ProcId.md +++ b/txt/protocol/ams/ProcId.md @@ -1,4 +1,4 @@ -## ams.ProcId - Local process id, such as proc1-0, proc2-1 etc +## ams.ProcId - Process ID within topology: type, node index, process index, e.g. proc-0-0 ### Attributes diff --git a/txt/protocol/ams/ProcRemoveMsg.md b/txt/protocol/ams/ProcRemoveMsg.md deleted file mode 100644 index 14123e56..00000000 --- a/txt/protocol/ams/ProcRemoveMsg.md +++ /dev/null @@ -1,15 +0,0 @@ -## ams.ProcRemoveMsg - Remove process from process group - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.ProcRemoveMsg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|proc_id|ams.ProcId|Val||ID of process being removed| - - - diff --git a/txt/protocol/ams/ProcType.md b/txt/protocol/ams/ProcType.md deleted file mode 100644 index df3b702e..00000000 --- a/txt/protocol/ams/ProcType.md +++ /dev/null @@ -1,14 +0,0 @@ -## ams.ProcType - StreamID + Sequence number - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.ProcType - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|value|u8|Val||| - - - diff --git a/txt/protocol/ams/README.md b/txt/protocol/ams/README.md index 76623426..e3824c4f 100644 --- a/txt/protocol/ams/README.md +++ b/txt/protocol/ams/README.md @@ -5,38 +5,159 @@ -📄 [ams.AlarmSyncMsg -](/txt/protocol/ams/AlarmSyncMsg.md)
-📄 [ams.DfltStream - Set default stream for subsequent messages](/txt/protocol/ams/DfltStream.md)
-📄 [ams.DumpStreamTableMsg - Remove process from process group](/txt/protocol/ams/DumpStreamTableMsg.md)
📄 [ams.ExpectMsg - Pause reading until some output is produced](/txt/protocol/ams/ExpectMsg.md)
-📄 [ams.HeartbeatMsg -](/txt/protocol/ams/HeartbeatMsg.md)
📄 [ams.InputLineMsg - Unrecognized input line](/txt/protocol/ams/InputLineMsg.md)
📄 [ams.LogMsg - Log message](/txt/protocol/ams/LogMsg.md)
-📄 [ams.Member - Process/Stream/Mode - primary key for reader/writer of stream](/txt/protocol/ams/Member.md)
📄 [ams.MsgBlock - A block of messages from ams commit file](/txt/protocol/ams/MsgBlock.md)
📄 [ams.MsgHeader -](/txt/protocol/ams/MsgHeader.md)
-📄 [ams.OpenMsg - Open stream for reading](/txt/protocol/ams/OpenMsg.md)
-📄 [ams.PrlogMsg -](/txt/protocol/ams/PrlogMsg.md)
-📄 [ams.ProcAddMsg - Add process to process group](/txt/protocol/ams/ProcAddMsg.md)
-📄 [ams.ProcId - Local process id, such as proc1-0, proc2-1 etc](/txt/protocol/ams/ProcId.md)
-📄 [ams.ProcRemoveMsg - Remove process from process group](/txt/protocol/ams/ProcRemoveMsg.md)
-📄 [ams.ProcType - StreamID + Sequence number](/txt/protocol/ams/ProcType.md)
-📄 [ams.Seqmsg - Sequenced stream message](/txt/protocol/ams/Seqmsg.md)
-📄 [ams.SeqmsgId - StreamID + Sequence number, e.g. proc1-0.out-0@1](/txt/protocol/ams/SeqmsgId.md)
-📄 [ams.SeqmsgTrace - Message used to trace reading/writing seqmsgs](/txt/protocol/ams/SeqmsgTrace.md)
-📄 [ams.StreamFlags -](/txt/protocol/ams/StreamFlags.md)
-📄 [ams.StreamHbMsg - Stream heartbeat](/txt/protocol/ams/StreamHbMsg.md)
-📄 [ams.StreamId - Host-unique stream ID. E.g. proc1-0.out-0](/txt/protocol/ams/StreamId.md)
-📄 [ams.StreamPos - Sequence,Offset](/txt/protocol/ams/StreamPos.md)
-📄 [ams.StreamType - StreamID + Sequence number](/txt/protocol/ams/StreamType.md)
+📄 [ams.ProcId - Process ID within topology: type, node index, process index, e.g. proc-0-0](/txt/protocol/ams/ProcId.md)
📄 [ams.TerminateMsg - Message sent to process to terminate it](/txt/protocol/ams/TerminateMsg.md)
-📄 [ams.Trace2Msg - Trace2 message](/txt/protocol/ams/Trace2Msg.md)
-📄 [ams.TraceInfo2Msg - Trace info message](/txt/protocol/ams/TraceInfo2Msg.md)
-📄 [ams.TraceInfoMsg - Trace info message](/txt/protocol/ams/TraceInfoMsg.md)
-📄 [ams.TraceMsg - Trace message](/txt/protocol/ams/TraceMsg.md)
📄 [ams.UdpFrame - sniffer-captured ethernet frame](/txt/protocol/ams/UdpFrame.md)
+### Ctypes + + +Other ctypes in this namespace which don't have own readme files + +#### ams.ProcEofMsg - EOF from/to a process + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|proc|[algo.RnullStr50](/txt/protocol/algo/README.md#algo-rnullstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### ams.ProcKillMsg - Kill process + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|proc|[algo.RnullStr50](/txt/protocol/algo/README.md#algo-rnullstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|signal|i32|[Val](/txt/exe/amc/reftypes.md#val)|15|| + +#### ams.ProcMsg - Message from/to a process + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|proc|[algo.RnullStr50](/txt/protocol/algo/README.md#algo-rnullstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|payload|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ams.ProcReadMsg - Read process output + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|proc|[algo.RnullStr50](/txt/protocol/algo/README.md#algo-rnullstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|until|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ams.ProcStartMsg - Start process + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|proc|[algo.RnullStr50](/txt/protocol/algo/README.md#algo-rnullstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|pty|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|cmd|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ams.ProcStatusMsg - Process status + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|proc|[algo.RnullStr50](/txt/protocol/algo/README.md#algo-rnullstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|status|[algo.RnullStr50](/txt/protocol/algo/README.md#algo-rnullstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### ams.Proctype - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### ams.RemDirRecurseMsg - Message sent to process to terminate it + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|remove_topmost|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|pathname|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ams.ShmFlags - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| +|write|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|read|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|nonblock|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|write_err|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||Error occurred during output| + +#### ams.ShmHbMsg - Shm heartbeat + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|shmember|[ams.ShmemberId](/txt/protocol/ams/README.md#ams-shmemberid)|[Val](/txt/exe/amc/reftypes.md#val)||Primary key| +|off|u64|[Val](/txt/exe/amc/reftypes.md#val)||Read/write position| +|wbudget|u32|[Val](/txt/exe/amc/reftypes.md#val)||Max. offset for writing| + +#### ams.ShmId - Host-unique stream ID. E.g. proc1-0.out-0 + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|proc_id|[ams.ProcId](/txt/protocol/ams/ProcId.md)|[Val](/txt/exe/amc/reftypes.md#val)||Writer process ID| +|shmtype|[ams.Shmtype](/txt/protocol/ams/README.md#ams-shmtype)|[Val](/txt/exe/amc/reftypes.md#val)||Stream type ID| +|index|u8|[Val](/txt/exe/amc/reftypes.md#val)||Stream index| + +#### ams.ShmemberFlags - Shm member flags + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u16|[Val](/txt/exe/amc/reftypes.md#val)|0|Shm member flags| +|r|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)|0|| +|w|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)|0|| + +#### ams.ShmemberId - Shm/Process - member ID for AMS SHM + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|shm_id|[ams.ShmId](/txt/protocol/ams/README.md#ams-shmid)|[Val](/txt/exe/amc/reftypes.md#val)||Stream ID| +|proc_id|[ams.ProcId](/txt/protocol/ams/ProcId.md)|[Val](/txt/exe/amc/reftypes.md#val)||Process ID| +|flags|[ams.ShmemberFlags](/txt/protocol/ams/README.md#ams-shmemberflags)|[Val](/txt/exe/amc/reftypes.md#val)|0|| + +#### ams.Shmmsg - Sequenced message on a shm + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|shm_id|[ams.ShmId](/txt/protocol/ams/README.md#ams-shmid)|[Val](/txt/exe/amc/reftypes.md#val)||| +|off|u64|[Val](/txt/exe/amc/reftypes.md#val)|0|| +|tstamp|u64|[Val](/txt/exe/amc/reftypes.md#val)|0|| +|payload|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Opt](/txt/exe/amc/reftypes.md#opt)||Actual Payload| + +#### ams.Shmtype - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + + + diff --git a/txt/protocol/ams/Seqmsg.md b/txt/protocol/ams/Seqmsg.md deleted file mode 100644 index 965fc1af..00000000 --- a/txt/protocol/ams/Seqmsg.md +++ /dev/null @@ -1,17 +0,0 @@ -## ams.Seqmsg - Sequenced stream message - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.Seqmsg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|seqmsg_id|ams.SeqmsgId|Val||Message ID| -|tsc|u64|Val||TSC of sender| -|payload|ams.MsgHeader|Opt||Actual Payload| - - - diff --git a/txt/protocol/ams/SeqmsgId.md b/txt/protocol/ams/SeqmsgId.md deleted file mode 100644 index 6dac37a1..00000000 --- a/txt/protocol/ams/SeqmsgId.md +++ /dev/null @@ -1,16 +0,0 @@ -## ams.SeqmsgId - StreamID + Sequence number, e.g. proc1-0.out-0@1 - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.SeqmsgId - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|stream_id|ams.StreamId|Val||| -|seq|u64|Val|1|| -|off|u32|Val|0|| - - - diff --git a/txt/protocol/ams/SeqmsgTrace.md b/txt/protocol/ams/SeqmsgTrace.md deleted file mode 100644 index c67511a4..00000000 --- a/txt/protocol/ams/SeqmsgTrace.md +++ /dev/null @@ -1,19 +0,0 @@ -## ams.SeqmsgTrace - Message used to trace reading/writing seqmsgs - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.SeqmsgTrace - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|proc_id|ams.ProcId|Val||Proces ID| -|mode|u8|Val|0|0=read, 1=write (2 or more =read)| -|seqmsg_id|ams.SeqmsgId|Val||Message ID| -|tsc|u64|Val||TSC of sender| -|payload|ams.MsgHeader|Opt||Actual Payload| - - - diff --git a/txt/protocol/ams/StreamFlags.md b/txt/protocol/ams/StreamFlags.md deleted file mode 100644 index 0681ff85..00000000 --- a/txt/protocol/ams/StreamFlags.md +++ /dev/null @@ -1,21 +0,0 @@ -## ams.StreamFlags - - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.StreamFlags - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|value|u8|Val||| -|write|bool|Bitfld||| -|read|bool|Bitfld||| -|nonblock|bool|Bitfld||| -|trace_read|bool|Bitfld||| -|trace_write|bool|Bitfld||| -|write_err|bool|Bitfld||Error occurred during output| -|trace_text|bool|Bitfld||ASCII tracing mode| - - - diff --git a/txt/protocol/ams/StreamHbMsg.md b/txt/protocol/ams/StreamHbMsg.md deleted file mode 100644 index bf58a2db..00000000 --- a/txt/protocol/ams/StreamHbMsg.md +++ /dev/null @@ -1,17 +0,0 @@ -## ams.StreamHbMsg - Stream heartbeat - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.StreamHbMsg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|member|ams.Member|Val||Primary key| -|pos|ams.StreamPos|Val||Read/write position| -|wbudget|u32|Val||Max. offset for writing| - - - diff --git a/txt/protocol/ams/StreamId.md b/txt/protocol/ams/StreamId.md deleted file mode 100644 index 2a718d54..00000000 --- a/txt/protocol/ams/StreamId.md +++ /dev/null @@ -1,16 +0,0 @@ -## ams.StreamId - Host-unique stream ID. E.g. proc1-0.out-0 - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.StreamId - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|proc_id|ams.ProcId|Val||Writer process ID| -|stream_type|ams.StreamType|Val||Stream type ID| -|streamidx|u8|Val||Stream index| - - - diff --git a/txt/protocol/ams/StreamPos.md b/txt/protocol/ams/StreamPos.md deleted file mode 100644 index 9b200ab4..00000000 --- a/txt/protocol/ams/StreamPos.md +++ /dev/null @@ -1,15 +0,0 @@ -## ams.StreamPos - Sequence,Offset - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.StreamPos - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|seq|u64|Val|1|| -|off|u64|Val||| - - - diff --git a/txt/protocol/ams/StreamType.md b/txt/protocol/ams/StreamType.md deleted file mode 100644 index 8f45933a..00000000 --- a/txt/protocol/ams/StreamType.md +++ /dev/null @@ -1,14 +0,0 @@ -## ams.StreamType - StreamID + Sequence number - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.StreamType - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|value|u8|Val||| - - - diff --git a/txt/protocol/ams/Trace2Msg.md b/txt/protocol/ams/Trace2Msg.md deleted file mode 100644 index d7980bde..00000000 --- a/txt/protocol/ams/Trace2Msg.md +++ /dev/null @@ -1,18 +0,0 @@ -## ams.Trace2Msg - Trace2 message - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.Trace2Msg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|proc|ams.ProcId|Val||| -|trace|u8|Val||| -|tstamp|algo.UnTime|Val||| -|data|u64|Varlen||| - - - diff --git a/txt/protocol/ams/TraceInfo2Msg.md b/txt/protocol/ams/TraceInfo2Msg.md deleted file mode 100644 index 2fe387e4..00000000 --- a/txt/protocol/ams/TraceInfo2Msg.md +++ /dev/null @@ -1,19 +0,0 @@ -## ams.TraceInfo2Msg - Trace info message - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.TraceInfo2Msg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|proc|ams.ProcId|Val||| -|trace|u8|Val||| -|tstamp|algo.UnTime|Val||| -|part|u8|Val||| -|data|char|Varlen||| - - - diff --git a/txt/protocol/ams/TraceInfoMsg.md b/txt/protocol/ams/TraceInfoMsg.md deleted file mode 100644 index e99f33b1..00000000 --- a/txt/protocol/ams/TraceInfoMsg.md +++ /dev/null @@ -1,18 +0,0 @@ -## ams.TraceInfoMsg - Trace info message - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.TraceInfoMsg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|proc|ams.ProcId|Val||| -|tstamp|algo.UnTime|Val||| -|part|u8|Val||| -|data|char|Varlen||| - - - diff --git a/txt/protocol/ams/TraceMsg.md b/txt/protocol/ams/TraceMsg.md deleted file mode 100644 index 46f1bbf5..00000000 --- a/txt/protocol/ams/TraceMsg.md +++ /dev/null @@ -1,17 +0,0 @@ -## ams.TraceMsg - Trace message - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.TraceMsg - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|proc|ams.ProcId|Val||| -|tstamp|algo.UnTime|Val||| -|data|u64|Varlen||| - - - diff --git a/txt/protocol/command/README.md b/txt/protocol/command/README.md index 224271b1..f710eaee 100644 --- a/txt/protocol/command/README.md +++ b/txt/protocol/command/README.md @@ -47,7 +47,7 @@ Other ctypes in this namespace which don't have own readme files |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| |in|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"data"|Input directory or filename, - for stdin| -|readme|[dev.Readme](/txt/ssimdb/dev/readme.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|Regx of readme to process/show (empty=all)| +|readmefile|[dev.Readmefile](/txt/ssimdb/dev/readmefile.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|Regx of readme to process/show (empty=all)| |ns|[dmmeta.Ns](/txt/ssimdb/dmmeta/ns.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|""|(overrides -readme) Process readmes for this namespace| |section|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|Select specific section to process| |update|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|(action) Update mode: Re-generate mdfiles| @@ -178,6 +178,7 @@ Other ctypes in this namespace which don't have own readme files |showcpp|bool|[Val](/txt/exe/amc/reftypes.md#val)||(With -sandbox), show resulting diff| |msgtype|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|(with -ctype) use this msgtype as type| |anonfld|bool|[Val](/txt/exe/amc/reftypes.md#val)||Create anonfld| +|amc|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Run amc if needed| #### command.acr_in - Command line for [acr_in](/txt/exe/acr_in/README.md) @@ -222,6 +223,7 @@ Other ctypes in this namespace which don't have own readme files |query|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|Query mode: generate code for specified object| |out_dir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"."|Root of output cpp dir| |proto|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Print prototype| +|showcomment|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Show generated comments| |report|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Final report| |e|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Open matching records in editor| |trace|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|""|Regx of something to trace code generation| @@ -245,18 +247,11 @@ Other ctypes in this namespace which don't have own readme files |in|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"data"|Input directory or filename, - for stdin| |dot|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|Save dot file with specified filename| |xref|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Include all ctypes referenced by selected ones| -|xns|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Cross namespace boundaries| +|xns|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Cross namespace boundaries| |noinput|bool|[Val](/txt/exe/amc/reftypes.md#val)||Deselect module inputs| |check|bool|[Val](/txt/exe/amc/reftypes.md#val)||Check model for dependency problems| |render|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Produce an ascii drawing| -#### command.ams_cat - Command line for [ams_cat](/txt/exe/ams_cat/README.md) - - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|in|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"data"|Input directory or filename, - for stdin| - #### command.ams_sendtest - Command line for [ams_sendtest](/txt/exe/ams_sendtest/README.md) @@ -317,6 +312,7 @@ Other ctypes in this namespace which don't have own readme files |in|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"data"|Input directory or filename, - for stdin| |schema|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"data"|Schema dir| |cmd|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Sql Query to run| +|ns|[dmmeta.Ns](/txt/ssimdb/dmmeta/ns.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"dmmeta"|Regx of databases to attach| #### command.atf_amc - Command line for [atf_amc](/txt/exe/atf_amc/README.md) @@ -338,6 +334,7 @@ Other ctypes in this namespace which don't have own readme files |maxerr|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|Exit after this many errors| |cijob|[atfdb.Cijob](/txt/ssimdb/atfdb/cijob.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|| |capture|bool|[Val](/txt/exe/amc/reftypes.md#val)||Capture the output of the test| +|check_clean|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Check for modifications after each test| #### command.atf_cmdline - Command line for [atf_cmdline](/txt/exe/atf_cmdline/README.md) @@ -363,7 +360,7 @@ Other ctypes in this namespace which don't have own readme files |mdbl|double|[Tary](/txt/exe/amc/reftypes.md#tary)||Double array| |amnum|i32|[Tary](/txt/exe/amc/reftypes.md#tary)||Anon number array| |fconst|u8|[Val](/txt/exe/amc/reftypes.md#val)||Fconst for field| -|cconst|[algo.Month](/txt/protocol/algo/Month.md)|[Val](/txt/exe/amc/reftypes.md#val)|0|Fconst for arg ctype| +|cconst|[algo.Month](/txt/protocol/algo/Month.md)|[Val](/txt/exe/amc/reftypes.md#val)||Fconst for arg ctype| |dregx|[dmmeta.Ctype](/txt/ssimdb/dmmeta/ctype.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|Predefined regx| |dpkey|[dmmeta.Ctype](/txt/ssimdb/dmmeta/ctype.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)|""|Predefined pkey| @@ -383,12 +380,11 @@ Other ctypes in this namespace which don't have own readme files |normalize|bool|[Val](/txt/exe/amc/reftypes.md#val)||(action) Renumber and normalize tmsgs| |covcapture|bool|[Val](/txt/exe/amc/reftypes.md#val)||(action) Capture new coverage percentages and save back| |covcheck|bool|[Val](/txt/exe/amc/reftypes.md#val)||(action) Check coverage percentages against tgtcov table| -|compdir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|Component image directory (exe)| +|bindir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|Directory with binaries (default: build/cfg)| |cfg|[dev.Cfg](/txt/ssimdb/dev/cfg.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)|"release"|Set config| |check_untracked|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Check for untracked file before allowing test to run| -|maxerr|i32|[Val](/txt/exe/amc/reftypes.md#val)|1|Exit after this many errors| +|maxerr|i32|[Val](/txt/exe/amc/reftypes.md#val)|3|Exit after this many errors| |build|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Build given cfg before test| -|ood|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Check given cfg for ood before test| |memcheck|bool|[Val](/txt/exe/amc/reftypes.md#val)||Run under memory checker (valgrind)| |force|bool|[Val](/txt/exe/amc/reftypes.md#val)||(With -memcheck) run suppressed memcheck| |callgrind|bool|[Val](/txt/exe/amc/reftypes.md#val)||Run under callgrind profiler (valgrind)| @@ -396,8 +392,11 @@ Other ctypes in this namespace which don't have own readme files |stream|bool|[Val](/txt/exe/amc/reftypes.md#val)||prints component's output| |i|bool|[Val](/txt/exe/amc/reftypes.md#val)||Read and execute testcase from stdin| |write|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|(implied with -e) Write any changes back to ssim tables| -|report|bool|[Val](/txt/exe/amc/reftypes.md#val)||Print final report| +|report|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Print final report| |b|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|Breakpoint passed to mdbg as-is| +|covfast|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Speedup coverage processing| +|minrepeat|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|Execute every comptest at least this many times| +|maxrepeat|i32|[Val](/txt/exe/amc/reftypes.md#val)|1|Don't repeat any individual comptest more than X times| #### command.atf_cov - Command line for [atf_cov](/txt/exe/atf_cov/README.md) @@ -417,6 +416,20 @@ Other ctypes in this namespace which don't have own readme files |xmlpretty|bool|[Val](/txt/exe/amc/reftypes.md#val)||Generate pretty-formatted XML| |summary|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Show summary figures| |check|bool|[Val](/txt/exe/amc/reftypes.md#val)||Check coverage information against tgtcov table| +|incremental|bool|[Val](/txt/exe/amc/reftypes.md#val)||Keep *.gcda files from previous run| + +#### command.atf_exp - Command line for [atf_exp](/txt/exe/atf_exp/README.md) + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|in|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"data"|Input directory or filename, - for stdin| +|trace|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|Regx of things to trace| +|bindir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"bin"|Directory with binaries| +|comptest|[atfdb.Comptest](/txt/ssimdb/atfdb/comptest.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)|""|Component test name| +|tempdir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|Temporary directory for the component test| +|timeout|double|[Val](/txt/exe/amc/reftypes.md#val)|8.0|Timeout in seconds for a step| +|dbgshell|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Invoke bash with curr envs in case of timeout| #### command.atf_fuzz - Command line for [atf_fuzz](/txt/exe/atf_fuzz/README.md) @@ -521,7 +534,7 @@ Other ctypes in this namespace which don't have own readme files |in|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"data"|Input directory or filename, - for stdin| |selector|[gclidb.Gtbl](/txt/ssimdb/gclidb/gtbl.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)|"issue:%"|table:key, where table is issue,repo,mr, etc. and key is a regex.| |fields|[algo.cstring](/txt/protocol/algo/cstring.md)|[Tary](/txt/exe/amc/reftypes.md#tary)|""|additional key:value pairs for use with -create, -list, -update| -|accept|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(action) accept a slected merge request| +|accept|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(action) accept a selected merge request| |start|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(action) start working on a selected issue| |list|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(action) show selected table| |create|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(action) create a table record(s)| @@ -536,6 +549,29 @@ Other ctypes in this namespace which don't have own readme files |gitdir|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|(setup) Change directory of git repository| |show_gitlab_system_notes|bool|[Val](/txt/exe/amc/reftypes.md#val)||(misc) Show issue and mr notes created by gitlab| +#### command.generic - Any generic subprocess + + +#### command.generic_proc - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|name|[command.generic](/txt/protocol/command/README.md#command-generic)|[Exec](/txt/exe/amc/reftypes.md#exec)|""|| + +#### command.jkv - Command line for [jkv](/txt/exe/jkv/README.md) + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|in|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"data"|Input directory or filename, - for stdin| +|file|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Filename (use - for stdin)| +|kv|[algo.cstring](/txt/protocol/algo/cstring.md)|[Tary](/txt/exe/amc/reftypes.md#tary)||JSON Keyvals| +|r|bool|[Val](/txt/exe/amc/reftypes.md#val)||Reverse (json keyvals -> JSON) mapping| +|write|bool|[Val](/txt/exe/amc/reftypes.md#val)||Write the modified file back| +|output|u8|[Val](/txt/exe/amc/reftypes.md#val)|0|Output format| +|pretty|u32|[Val](/txt/exe/amc/reftypes.md#val)|2|Pretty-printer (0-compact; 1=algo style; 2=jq style)| + #### command.mdbg - Command line for [mdbg](/txt/exe/mdbg/README.md) @@ -547,15 +583,17 @@ Other ctypes in this namespace which don't have own readme files |cfg|[dev.Cfg](/txt/ssimdb/dev/cfg.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)|"debug"|Configuration to use| |disas|bool|[Val](/txt/exe/amc/reftypes.md#val)||Show disassembly (use F12)| |attach|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Attach to a running process| +|pid|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|(with -attach) Pid, if omitted mdbg will guess| |b|[algo.cstring](/txt/protocol/algo/cstring.md)|[Tary](/txt/exe/amc/reftypes.md#tary)|""|Set breakpoint, e.g. 'a.cpp:123 if cond1', 'func#3'| |catchthrow|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Stop on exceptions| |tui|bool|[Val](/txt/exe/amc/reftypes.md#val)||Use gdb -tui as the debugger| |bcmd|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|Evaluate command at breakpoint| |emacs|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Use emacs environment as the debugger| |manywin|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Use gdb-many-windows emacs mode| -|follow_child|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|follow_child|bool|[Val](/txt/exe/amc/reftypes.md#val)||When forking, follow child (default is parent)| |py|bool|[Val](/txt/exe/amc/reftypes.md#val)||Enable python scripting| |dry_run|bool|[Val](/txt/exe/amc/reftypes.md#val)||Print commands but don't execute| +|mp|bool|[Val](/txt/exe/amc/reftypes.md#val)||Multi-process debugging| #### command.mysql2ssim - Command line for [mysql2ssim](/txt/exe/mysql2ssim/README.md) @@ -583,6 +621,17 @@ Other ctypes in this namespace which don't have own readme files |undo|bool|[Val](/txt/exe/amc/reftypes.md#val)||Read previous orgfile output, undoing movement| |hash|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"sha1"|Hash command to use for deduplication| +#### command.samp_make - Command line for [samp_make](/txt/exe/samp_make/README.md) + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|in|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"data"|Input directory or filename, - for stdin| +|target|[sampdb.Target](/txt/ssimdb/sampdb/target.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|Create Makefile for selected targets| +|parse_make|bool|[Val](/txt/exe/amc/reftypes.md#val)||Parse extern/gnumake/Simple-Makefile| +|makefile|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"extern/gnumake/Simple-Makefile"|(with parse_make) makefile to parse| +|write|bool|[Val](/txt/exe/amc/reftypes.md#val)||P(with parse_make) write ssimfiles, otherwise print them| + #### command.samp_meng - Command line for [samp_meng](/txt/exe/samp_meng/README.md) @@ -597,10 +646,13 @@ Other ctypes in this namespace which don't have own readme files |---|---|---|---|---| |in|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"data"|Input directory or filename, - for stdin| |expr|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Expression| -|style|u8|[Val](/txt/exe/amc/reftypes.md#val)|0|Regx style| -|match|bool|[Val](/txt/exe/amc/reftypes.md#val)||Match a string| +|style|[algo_lib.RegxStyle](/txt/lib/algo_lib/README.md#algo_lib-regxstyle)|[Val](/txt/exe/amc/reftypes.md#val)|2|Regx style| +|trace|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Trace regx innards| +|capture|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Use capture groups| +|full|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|Match full string| +|f|bool|[Val](/txt/exe/amc/reftypes.md#val)|false| is a filename, grep the lines| +|match|bool|[Val](/txt/exe/amc/reftypes.md#val)||Match a string, exit code represnts success| |string|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|""|String to match| -|show|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Show regx innards| #### command.sandbox - Command line for [sandbox](/txt/exe/sandbox/README.md) @@ -619,7 +671,8 @@ Other ctypes in this namespace which don't have own readme files |cmd|[algo.cstring](/txt/protocol/algo/cstring.md)|[Tary](/txt/exe/amc/reftypes.md#tary)||Command to execute in sandbox| |diff|bool|[Val](/txt/exe/amc/reftypes.md#val)||Show diff after running command| |files|[algo.cstring](/txt/protocol/algo/cstring.md)|[Tary](/txt/exe/amc/reftypes.md#tary)||Shell regx to diff| -|refs|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"HEAD"|Refs to fetch into sandbox| +|refs|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"HEAD"|Additional list of refs to fetch into sandbox| +|ref|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"HEAD"|Reset to this ref| |q|bool|[Val](/txt/exe/amc/reftypes.md#val)||Quiet mode| #### command.src_func - Command line for [src_func](/txt/exe/src_func/README.md) @@ -628,26 +681,30 @@ Other ctypes in this namespace which don't have own readme files |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| |in|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)|"data"|Input directory or filename, - for stdin| -|target|[dev.Target](/txt/ssimdb/dev/target.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|Visit these targets| -|name|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|Match function name| -|body|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|Match function body| -|targsrc|[dev.Targsrc](/txt/ssimdb/dev/targsrc.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|""|Visit these sources (optional)| -|func|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|(with -listfunc) Match function prototype| -|comment|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|(with -listfunc) Match function comment| -|nextfile|[dev.Gitfile](/txt/ssimdb/dev/gitfile.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)|""|Print name of next srcfile in targsrc list| -|other|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(with -nextfile), name of previous file| -|updateproto|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Update prototypes in headers| -|listfunc|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Show functions in target| -|iffy|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Select functions that may contain errors| -|proto|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(with -listfunc) List prototypes only| -|gen|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(with -listfunc) Visit generated files| -|showloc|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|(with -listfunc) Show file location| -|showstatic|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|(with -listfunc) Show static functions| -|showsortkey|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(with -listfunc) Display function sortkey| -|sortname|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(with -listfunc) Sort functions by name| -|e|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(with -listfunc) Edit found functions| +|targsrc|[dev.Targsrc](/txt/ssimdb/dev/targsrc.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|(scan) Limit scanning to these sources only| +|acrkey|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|Select function by acr key that caused it| +|func|[dev.Target](/txt/ssimdb/dev/target.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|Target.function regex| +|nextfile|[dev.Gitfile](/txt/ssimdb/dev/gitfile.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)|""|(action) Print name of next srcfile in targsrc list| +|other|bool|[Val](/txt/exe/amc/reftypes.md#val)|false| (with -nextfile), name of previous file| +|list|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(action) List matching functions| +|updateproto|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(action) Update prototypes in headers| +|createmissing|bool|[Val](/txt/exe/amc/reftypes.md#val)||(action) Create missing functions declared in userfunc table| +|iffy|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(filter) Select functions that may contain errors| +|gen|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(scan) Scan generated files| +|showloc|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(output) Show file location| +|f|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(output) -sortname -showcomment -showbody| +|showstatic|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|(filter) Allow static functions| +|matchproto|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|(filter) Match function prototype| +|matchbody|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|(filter) Match function body| +|matchcomment|[algo.cstring](/txt/protocol/algo/cstring.md)|[RegxSql](/txt/exe/amc/reftypes.md#regxsql)|"%"|(filter) Match function comment| +|showsortkey|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(output) Display function sortkey| +|showcomment|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(output) Display function comment| +|showbody|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(output) Print function body| +|sortname|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(output) Sort functions by name| +|printssim|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|(output) Print ssim tuples| +|e|bool|[Val](/txt/exe/amc/reftypes.md#val)|false|Edit found functions| |baddecl|bool|[Val](/txt/exe/amc/reftypes.md#val)||Report and fail on bad declarations| -|report|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|report|bool|[Val](/txt/exe/amc/reftypes.md#val)||Print final report| #### command.src_hdr - Command line for [src_hdr](/txt/exe/src_hdr/README.md) diff --git a/txt/protocol/http/README.md b/txt/protocol/http/README.md new file mode 100644 index 00000000..d6da4a2a --- /dev/null +++ b/txt/protocol/http/README.md @@ -0,0 +1,128 @@ +## http - + + +### Ctypes + + +Other ctypes in this namespace which don't have own readme files + +#### http.ExtensionHeader - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|name|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|value|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### http.HeaderType - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u16|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### http.Method - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### http.Request - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|method|[http.Method](/txt/protocol/http/README.md#http-method)|[Val](/txt/exe/amc/reftypes.md#val)||| +|extension_method|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|uri|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|version|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|cache_control|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|connection|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|date|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|pragma|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|trailer|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|transfer_encoding|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|upgrade|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|via|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|warning|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|accept|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|accept_charset|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|accept_encoding|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|accept_language|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|authorization|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|expect|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|from|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|host|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|if_match|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|if_modified_since|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|if_none_match|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|if_range|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|if_unmodified_since|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|max_forwards|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|proxy_authorization|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|range|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|referer|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|te|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|user_agent|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|allow|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_encoding|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_language|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_length|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_location|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_md5|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_range|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_type|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|expires|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|last_modified|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|sec_websocket_key|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|sec_websocket_extensions|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|sec_websocket_protocol|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|sec_websocket_version|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|extension_header|[http.ExtensionHeader](/txt/protocol/http/README.md#http-extensionheader)|[Tary](/txt/exe/amc/reftypes.md#tary)||| +|body|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### http.Response - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|version|[httpdb.Version](/txt/ssimdb/httpdb/version.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)|"HTTP/1.0"|| +|status|[httpdb.Status](/txt/ssimdb/httpdb/status.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)|"200 OK"|| +|cache_control|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|connection|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|date|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|pragma|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|trailer|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|transfer_encoding|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|upgrade|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|via|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|warning|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|accept_ranges|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|age|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|etag|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|location|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|proxy_authenticate|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|retry_after|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|server|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|vary|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|www_authenticate|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|allow|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_encoding|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_language|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_length|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_location|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_md5|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_range|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|content_type|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|expires|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|last_modified|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|sec_websocket_accept|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|sec_websocket_extensions|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|sec_websocket_protocol|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|sec_websocket_version|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|extension_header|[http.ExtensionHeader](/txt/protocol/http/README.md#http-extensionheader)|[Tary](/txt/exe/amc/reftypes.md#tary)||| +|body|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + diff --git a/txt/protocol/ietf/README.md b/txt/protocol/ietf/README.md index 1001c60e..c1b02ab8 100644 --- a/txt/protocol/ietf/README.md +++ b/txt/protocol/ietf/README.md @@ -1,6 +1,14 @@ ## ietf - Some IETF structs +### Table Of Contents + + +  •  [Ctypes](#ctypes)
+  •  [Functions](#functions)
+ + + ### Ctypes @@ -30,3 +38,36 @@ Other ctypes in this namespace which don't have own readme files +### Functions + + +Functions exported from this namespace: + +```c++ +void ietf::Ipport_Print(ietf::Ipport row, algo::cstring &str) +``` + +```c++ +bool ietf::Ipport_ReadStrptrMaybe(ietf::Ipport &row, strptr in) +``` + +```c++ +void ietf::Ipv4Addr_Print(ietf::Ipv4Addr row, algo::cstring &str) +``` + +```c++ +// Parse an IpV4 address from STR to IP +// Return success value. If not successful, output value is not modified. +bool ietf::Ipv4Addr_ReadStrptrMaybe(ietf::Ipv4Addr &ip, algo::strptr str) +``` + +```c++ +void ietf::Ipv4_Print(ietf::Ipv4 row, algo::cstring &str) +``` + +```c++ +bool ietf::Ipv4_ReadStrptrMaybe(ietf::Ipv4 &ip, algo::strptr str) +``` + + + diff --git a/txt/protocol/js/README.md b/txt/protocol/js/README.md new file mode 100644 index 00000000..39724a8d --- /dev/null +++ b/txt/protocol/js/README.md @@ -0,0 +1,124 @@ +## js - Reserved for JavaScript builtin types + + +### Ctypes + + +Other ctypes in this namespace which don't have own readme files + +#### js.AggregateError - Multiple error instances wrapped into one object + + +#### js.Array - Array: property name is an array index (+0..2^32-1) + + +#### js.ArrayBuffer - Generic raw binary data buffer + + +#### js.BigInt - Arbitrary-precision integer + + +#### js.BigInt64Array - TypedArray: 64-bit two's complement signed integer + + +#### js.BigUint64Array - TypedArray: 64-bit unsigned integer + + +#### js.Boolean - Boolean value - `true` and `false` + + +#### js.DataView - Reading and writing multiple number types in a binary ArrayBuffer + + +#### js.Date - Number - UTC time in milliseconds since start of 1-Jan-1970 + + +#### js.Error - Thrown when runtime errors occurs + + +#### js.EvalError - Native error type: (obsolete) + + +#### js.Float32Array - TypedArray: IEEE floating point + + +#### js.Float64Array - TypedArray: 64-bit IEEE floating point + + +#### js.Int16Array - TypedArray: 16-bit two's complement signed integer + + +#### js.Int32Array - TypedArray: 32-bit two's complement signed integer + + +#### js.Int8Array - TypedArray: 8-bit two's complement signed integer + + +#### js.Map - Map: collection of key/value pairs + + +#### js.Null - Intentional absence of any value, sole value `null` + + +#### js.Number - IEEE 754-2019 double-precision 64-bit binary + + +#### js.Object - logically a collection of properties + + +#### js.RangeError - Native error type: value is out of range + + +#### js.ReferenceError - Native error type: invalid reference + + +#### js.RegExp - Regular expression + + +#### js.Set - Set: collection of distinct values + + +#### js.SharedArrayBuffer - shared raw binary data buffer + + +#### js.String - Zero or more 16-bit unsigned integer values + + +#### js.Symbol - Unique, non-String Object property key + + +#### js.SyntaxError - Native error type: parsing error + + +#### js.TypeError - Native error type: unsuccessful operation + + +#### js.TypedArray - Array-like view of an underlying binary data buffer + + +#### js.URIError - Native error type: URI encode/decode error + + +#### js.Uint16Array - TypedArray: 16-bit unsigned integer + + +#### js.Uint32Array - TypedArray: 32-bit unsigned integer + + +#### js.Uint8Array - TypedArray: 8-bit unsigned integer + + +#### js.Uint8ClampedArray - TypedArray: 8-bit unsigned integer (clamped conversion) + + +#### js.Undefined - A variable has not been assigned a value, sole value `undefined` + + +#### js.WeakMap - Weak map + + +#### js.WeakSet - Weak set + + + + diff --git a/txt/protocol/kafka/README.md b/txt/protocol/kafka/README.md new file mode 100644 index 00000000..f05181b9 --- /dev/null +++ b/txt/protocol/kafka/README.md @@ -0,0 +1,188 @@ +## kafka - Kafka protocol + + +### Ctypes + + +Other ctypes in this namespace which don't have own readme files + +#### kafka.AclOperationType - AclOperation type + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.AclOperations - ACL operations + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|UNKNOWN|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|ANY|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|ALL|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|READ|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|WRITE|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|CREATE|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|DELETE|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|ALTER|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|DESCRIBE|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|CLUSTER_ACTION|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|DESCRIBE_CONFIGS|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|ALTER_CONFIGS|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|IDEMPOTENT_WRITE|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|CREATE_TOKENS|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|DESCRIBE_TOKENS|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|OMITTED|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| + +#### kafka.AclPermissionType - AclPermission type + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.CompressionType - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.ConfigSource - Config type + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.ConfigType - Config type + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.Error - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|i16|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.Frame - Frame of binary Kafka protocol + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|size|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|payload|u8|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### kafka.GroupRecordKeyHeader - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|type|i16|[Val](/txt/exe/amc/reftypes.md#val)||| +|version|i16|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.GroupRecordValueHeader - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|type|i16|[Val](/txt/exe/amc/reftypes.md#val)||| +|version|i16|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.GroupState - Group state + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)|5|| + +#### kafka.Header - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|key|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|value|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.OffsetCommitKey - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[kafka.GroupRecordKeyHeader](/txt/protocol/kafka/README.md#kafka-grouprecordkeyheader)|[Base](/txt/exe/amc/reftypes.md#base)||| +|group|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|topic|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|partition|i32|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.OffsetCommitValue - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[kafka.GroupRecordValueHeader](/txt/protocol/kafka/README.md#kafka-grouprecordvalueheader)|[Base](/txt/exe/amc/reftypes.md#base)||| +|offset|i64|[Val](/txt/exe/amc/reftypes.md#val)||| +|leader_epoch|i32|[Val](/txt/exe/amc/reftypes.md#val)|-1|| +|metadata|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|commit_timestamp|i64|[Val](/txt/exe/amc/reftypes.md#val)||| +|expire_timestamp|i64|[Val](/txt/exe/amc/reftypes.md#val)|-1|| + +#### kafka.PatternType - Pattern type + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.Record - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|attributes|u8|[Val](/txt/exe/amc/reftypes.md#val)||| +|pmask|u8|[Val](/txt/exe/amc/reftypes.md#val)||| +|timestamp_delta|i64|[Val](/txt/exe/amc/reftypes.md#val)||| +|offset_delta|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|key|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|value|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|headers|[kafka.Header](/txt/protocol/kafka/README.md#kafka-header)|[Tary](/txt/exe/amc/reftypes.md#tary)||| + +#### kafka.RecordBatch - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base_offset|i64|[Val](/txt/exe/amc/reftypes.md#val)||| +|partition_leader_epoch|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|magic|i8|[Val](/txt/exe/amc/reftypes.md#val)|2|| +|crc|u32|[Val](/txt/exe/amc/reftypes.md#val)||| +|attributes|i16|[Val](/txt/exe/amc/reftypes.md#val)||| +|last_offset_delta|i32|[Val](/txt/exe/amc/reftypes.md#val)||| +|base_timestamp|i64|[Val](/txt/exe/amc/reftypes.md#val)||| +|max_timestamp|i64|[Val](/txt/exe/amc/reftypes.md#val)||| +|producer_id|i64|[Val](/txt/exe/amc/reftypes.md#val)|-1|| +|producer_epoch|i16|[Val](/txt/exe/amc/reftypes.md#val)|-1|| +|base_sequence|i32|[Val](/txt/exe/amc/reftypes.md#val)|-1|| +|records|[kafka.Record](/txt/protocol/kafka/README.md#kafka-record)|[Tary](/txt/exe/amc/reftypes.md#tary)||| + +#### kafka.ResourceType - Resource type + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### kafka.TimestampType - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + + + diff --git a/txt/protocol/report/README.md b/txt/protocol/report/README.md index 34992868..a1b1efe5 100644 --- a/txt/protocol/report/README.md +++ b/txt/protocol/report/README.md @@ -61,7 +61,7 @@ Other ctypes in this namespace which don't have own readme files |ntest|i32|[Val](/txt/exe/amc/reftypes.md#val)||Total number of tests| |nselect|i32|[Val](/txt/exe/amc/reftypes.md#val)||Number of tests selected for execution| |npass|i32|[Val](/txt/exe/amc/reftypes.md#val)||Number of tests succeeded| -|nskip|i32|[Val](/txt/exe/amc/reftypes.md#val)||Number of tests failed| +|nskip|i32|[Val](/txt/exe/amc/reftypes.md#val)||Number of tests not selected| |nrun|i32|[Val](/txt/exe/amc/reftypes.md#val)||Number of tests run| |nwrite|i32|[Val](/txt/exe/amc/reftypes.md#val)||Number of files written| |nerr|i32|[Val](/txt/exe/amc/reftypes.md#val)||Number of errors| diff --git a/txt/protocol/ws/README.md b/txt/protocol/ws/README.md new file mode 100644 index 00000000..f25d2170 --- /dev/null +++ b/txt/protocol/ws/README.md @@ -0,0 +1,198 @@ +## ws - WebSocket binary protocol + + +### Table Of Contents + + +  •  [Ctypes](#ctypes)
+  •  [Functions](#functions)
+ + + +### Ctypes + + +Other ctypes in this namespace which don't have own readme files + +#### ws.CloseMsg - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|conn|[algo.RspaceStr50](/txt/protocol/algo/README.md#algo-rspacestr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|side|[ws.Side](/txt/protocol/ws/README.md#ws-side)|[Val](/txt/exe/amc/reftypes.md#val)||| +|code|[ws.StatusCode](/txt/protocol/ws/README.md#ws-statuscode)|[Val](/txt/exe/amc/reftypes.md#val)||| +|reason|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ws.ConnectMsg - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|conn|[algo.RspaceStr50](/txt/protocol/algo/README.md#algo-rspacestr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|side|[ws.Side](/txt/protocol/ws/README.md#ws-side)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### ws.DataMsg - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|conn|[algo.RspaceStr50](/txt/protocol/algo/README.md#algo-rspacestr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|side|[ws.Side](/txt/protocol/ws/README.md#ws-side)|[Val](/txt/exe/amc/reftypes.md#val)||| +|opcode|[ws.Opcode](/txt/protocol/ws/README.md#ws-opcode)|[Val](/txt/exe/amc/reftypes.md#val)||| +|data|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ws.Frame - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ws.FrameHeader](/txt/protocol/ws/README.md#ws-frameheader)|[Base](/txt/exe/amc/reftypes.md#base)||| +|payload|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ws.Frame16 - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ws.FrameHeader](/txt/protocol/ws/README.md#ws-frameheader)|[Base](/txt/exe/amc/reftypes.md#base)||| +|ext_payload_len|u16|[Val](/txt/exe/amc/reftypes.md#val)||| +|payload|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ws.Frame64 - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ws.FrameHeader](/txt/protocol/ws/README.md#ws-frameheader)|[Base](/txt/exe/amc/reftypes.md#base)||| +|ext_payload_len|u64|[Val](/txt/exe/amc/reftypes.md#val)||| +|payload|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ws.FrameHeader - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|byte0|u8|[Val](/txt/exe/amc/reftypes.md#val)||| +|byte1|u8|[Val](/txt/exe/amc/reftypes.md#val)||| +|fin|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|rsv1|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|rsv2|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|rsv3|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|opcode|[ws.Opcode](/txt/protocol/ws/README.md#ws-opcode)|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|mask|bool|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| +|payload_len|u8|[Bitfld](/txt/exe/amc/reftypes.md#bitfld)||| + +#### ws.FrameMasked - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ws.FrameHeader](/txt/protocol/ws/README.md#ws-frameheader)|[Base](/txt/exe/amc/reftypes.md#base)||| +|masking_key|u32|[Val](/txt/exe/amc/reftypes.md#val)||| +|payload|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ws.FrameMasked16 - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ws.FrameHeader](/txt/protocol/ws/README.md#ws-frameheader)|[Base](/txt/exe/amc/reftypes.md#base)||| +|ext_payload_len|u16|[Val](/txt/exe/amc/reftypes.md#val)||| +|masking_key|u32|[Val](/txt/exe/amc/reftypes.md#val)||| +|payload|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ws.FrameMasked64 - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ws.FrameHeader](/txt/protocol/ws/README.md#ws-frameheader)|[Base](/txt/exe/amc/reftypes.md#base)||| +|ext_payload_len|u64|[Val](/txt/exe/amc/reftypes.md#val)||| +|masking_key|u32|[Val](/txt/exe/amc/reftypes.md#val)||| +|payload|char|[Varlen](/txt/exe/amc/reftypes.md#varlen)||| + +#### ws.HttpState - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### ws.Opcode - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u8|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### ws.ServerStartMsg - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|server|[algo.RspaceStr25](/txt/protocol/algo/README.md#algo-rspacestr25)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### ws.ServerStopMsg - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|base|[ams.MsgHeader](/txt/protocol/ams/MsgHeader.md)|[Base](/txt/exe/amc/reftypes.md#base)||| +|server|[algo.RspaceStr25](/txt/protocol/algo/README.md#algo-rspacestr25)|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### ws.Side - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|char|[Val](/txt/exe/amc/reftypes.md#val)||| + +#### ws.StatusCode - + + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|value|u16|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Functions + + +Functions exported from this namespace: + +```c++ +void ws::FrameHeaderMsgs_Print2(algo::cstring &str, ws::FrameHeader &msg) +``` + +```c++ +bool ws::FrameHeaderMsgs_ReadStrptrMaybe2(algo::strptr str, algo::ByteAry &buf) +``` + +```c++ +ws::FrameMasked *ws::FrameMasked_Castdown(ws::FrameHeader &hdr) +``` + +```c++ +ws::Frame *ws::Frame_Castdown(ws::FrameHeader &hdr) +``` + +```c++ +cstring &ws::operator<<(cstring &lhs, const ws::FrameHeader &rhs) +``` + +```c++ +u32 ws::payload_N(const ws::Frame& parent) +``` + +```c++ +u32 ws::payload_N(const ws::FrameMasked& parent) +``` + + + diff --git a/txt/script/README.md b/txt/script/README.md index 5b9a630b..90cdbb13 100644 --- a/txt/script/README.md +++ b/txt/script/README.md @@ -8,8 +8,11 @@ 📄 [bin/abt_md_filt - Eliminate unstable fields from inline-command output](/txt/script/abt_md_filt.md)
📄 [bin/ai - Bootstrapped compilation script](/txt/script/ai.md)
📄 [bin/alexei-setup-soft-links -](/txt/script/alexei-setup-soft-links.md)
+📄 [bin/bash-indent - bash formatting with shfmt](/txt/script/bash-indent.md)
📄 [bin/break-long-lines - Read input and break long lines into multiple lines](/txt/script/break-long-lines.md)
-📄 [bin/ci-show-log - Fetch gitlab runner output for current issue](/txt/script/ci-show-log.md)
+📄 [bin/check-json.mjs -](/txt/script/check-json.mjs.md)
+📄 [bin/ci-show-log - Fetch gitlab-runner output for current issue](/txt/script/ci-show-log.md)
+📄 [bin/core-decode -](/txt/script/core-decode.md)
📄 [bin/cpp-indent - Indent specified files using emacs](/txt/script/cpp-indent.md)
📄 [bin/delete-duplicate-lines - Read input and eliminate duplicate lines](/txt/script/delete-duplicate-lines.md)
📄 [bin/diff-to-errlist - Read standard diff format on input and produce output suitable for errlist](/txt/script/diff-to-errlist.md)
@@ -17,10 +20,12 @@ 📄 [bin/em - Alias for 'emacs -nw'](/txt/script/em.md)
📄 [bin/errlist - Open error list in editor](/txt/script/errlist.md)
📄 [bin/ff - Find files and inside files](/txt/script/ff.md)
+📄 [bin/filt-gc -](/txt/script/filt-gc.md)
📄 [bin/find-non-copyrighted - Find any files with missing copyrights](/txt/script/find-non-copyrighted.md)
📄 [bin/fix-gen-conflicts - Auto-fix for git merge- or rebase-related conflicts by re-running generator](/txt/script/fix-gen-conflicts.md)
📄 [bin/git-add-to-last-commit - Add any currently modified changes to the most recent commit](/txt/script/git-add-to-last-commit.md)
📄 [bin/git-branch-gc - Attempt to rebase all branches and delete branches merged into HEAD](/txt/script/git-branch-gc.md)
+📄 [bin/git-checkout-master -](/txt/script/git-checkout-master.md)
📄 [bin/git-clean-branches -](/txt/script/git-clean-branches.md)
📄 [bin/git-commits-per-user -](/txt/script/git-commits-per-user.md)
📄 [bin/git-current-ref - Print gitref of current HEAD](/txt/script/git-current-ref.md)
@@ -43,18 +48,24 @@ 📄 [bin/lsfunc - List all functions from all source files](/txt/script/lsfunc.md)
📄 [bin/msloc.pl - Word count statistics for non-generated source files](/txt/script/msloc.pl.md)
📄 [bin/normalize - Run standard normalization tests](/txt/script/normalize.md)
+📄 [bin/normalize_loop -](/txt/script/normalize_loop.md)
+📄 [bin/open-link -](/txt/script/open-link.md)
+📄 [bin/revert-executable -](/txt/script/revert-executable.md)
📄 [bin/select-bootstrap -](/txt/script/select-bootstrap.md)
📄 [bin/sha1 -](/txt/script/sha1.md)
📄 [bin/sloc.pl - Word count statistics for specified list of source files](/txt/script/sloc.pl.md)
+📄 [bin/sortwrap - run a command and its stdout using sort(1)](/txt/script/sortwrap.md)
+📄 [bin/stepper - Allow user to interactively edit each line from stdin before sending to stdout](/txt/script/stepper.md)
📄 [bin/tags -](/txt/script/tags.md)
📄 [bin/targ-diff - Show changes in TARG's source code between this branch and REF](/txt/script/targ-diff.md)
📄 [bin/test-orgfile -](/txt/script/test-orgfile.md)
📄 [bin/timestamps - Read input and timestamp each line](/txt/script/timestamps.md)
📄 [bin/toamc - Try to extract amc schema from specified C++ file](/txt/script/toamc.md)
📄 [bin/todo -](/txt/script/todo.md)
-📄 [bin/update-gitfile -](/txt/script/update-gitfile.md)
-📄 [bin/update-hdr -](/txt/script/update-hdr.md)
-📄 [bin/update-scriptfile -](/txt/script/update-scriptfile.md)
+📄 [bin/update-gitfile - Update dev.gitfile table](/txt/script/update-gitfile.md)
+📄 [bin/update-hdr - Update copyright headers in all sources](/txt/script/update-hdr.md)
+📄 [bin/update-scriptfile - Update dev.scriptfile table from git](/txt/script/update-scriptfile.md)
+📄 [bin/vscode-select-debug-target -](/txt/script/vscode-select-debug-target.md)
📄 [bin/zfs_snapshot.pl -](/txt/script/zfs_snapshot.pl.md)
diff --git a/txt/script/bash-indent.md b/txt/script/bash-indent.md new file mode 100644 index 00000000..f4912326 --- /dev/null +++ b/txt/script/bash-indent.md @@ -0,0 +1,3 @@ +## bin/bash-indent - bash formatting with shfmt + + diff --git a/txt/script/check-json.mjs.md b/txt/script/check-json.mjs.md new file mode 100644 index 00000000..8e88128c --- /dev/null +++ b/txt/script/check-json.mjs.md @@ -0,0 +1,3 @@ +## bin/check-json.mjs - + + diff --git a/txt/script/ci-show-log.md b/txt/script/ci-show-log.md index ea12ba1b..1c3dce4e 100644 --- a/txt/script/ci-show-log.md +++ b/txt/script/ci-show-log.md @@ -1,4 +1,4 @@ -## bin/ci-show-log - Fetch gitlab runner output for current issue +## bin/ci-show-log - Fetch gitlab-runner output for current issue ### Sources diff --git a/txt/script/core-decode.md b/txt/script/core-decode.md new file mode 100644 index 00000000..d4f0481f --- /dev/null +++ b/txt/script/core-decode.md @@ -0,0 +1,3 @@ +## bin/core-decode - + + diff --git a/txt/script/filt-gc.md b/txt/script/filt-gc.md new file mode 100644 index 00000000..637e94a8 --- /dev/null +++ b/txt/script/filt-gc.md @@ -0,0 +1,3 @@ +## bin/filt-gc - + + diff --git a/txt/script/git-checkout-master.md b/txt/script/git-checkout-master.md new file mode 100644 index 00000000..19a0a255 --- /dev/null +++ b/txt/script/git-checkout-master.md @@ -0,0 +1,3 @@ +## bin/git-checkout-master - + + diff --git a/txt/script/normalize_loop.md b/txt/script/normalize_loop.md new file mode 100644 index 00000000..19b6cca4 --- /dev/null +++ b/txt/script/normalize_loop.md @@ -0,0 +1,3 @@ +## bin/normalize_loop - + + diff --git a/txt/script/open-link.md b/txt/script/open-link.md new file mode 100644 index 00000000..875b01ba --- /dev/null +++ b/txt/script/open-link.md @@ -0,0 +1,3 @@ +## bin/open-link - + + diff --git a/txt/script/revert-executable.md b/txt/script/revert-executable.md new file mode 100644 index 00000000..27bee4f2 --- /dev/null +++ b/txt/script/revert-executable.md @@ -0,0 +1,3 @@ +## bin/revert-executable - + + diff --git a/txt/script/sortwrap.md b/txt/script/sortwrap.md new file mode 100644 index 00000000..41dfc9fc --- /dev/null +++ b/txt/script/sortwrap.md @@ -0,0 +1,3 @@ +## bin/sortwrap - run a command and its stdout using sort(1) + + diff --git a/txt/script/stepper.md b/txt/script/stepper.md new file mode 100644 index 00000000..df979588 --- /dev/null +++ b/txt/script/stepper.md @@ -0,0 +1,3 @@ +## bin/stepper - Allow user to interactively edit each line from stdin before sending to stdout + + diff --git a/txt/script/update-gitfile.md b/txt/script/update-gitfile.md index 00f8ff13..54cc4111 100644 --- a/txt/script/update-gitfile.md +++ b/txt/script/update-gitfile.md @@ -1,4 +1,4 @@ -## bin/update-gitfile - +## bin/update-gitfile - Update dev.gitfile table ### Sources diff --git a/txt/script/update-hdr.md b/txt/script/update-hdr.md index f41f4729..744662ac 100644 --- a/txt/script/update-hdr.md +++ b/txt/script/update-hdr.md @@ -1,4 +1,4 @@ -## bin/update-hdr - +## bin/update-hdr - Update copyright headers in all sources ### Sources diff --git a/txt/script/update-scriptfile.md b/txt/script/update-scriptfile.md index 0d7d65fa..4fce4512 100644 --- a/txt/script/update-scriptfile.md +++ b/txt/script/update-scriptfile.md @@ -1,4 +1,4 @@ -## bin/update-scriptfile - +## bin/update-scriptfile - Update dev.scriptfile table from git ### Sources diff --git a/txt/script/vscode-select-debug-target.md b/txt/script/vscode-select-debug-target.md new file mode 100644 index 00000000..b8b379b0 --- /dev/null +++ b/txt/script/vscode-select-debug-target.md @@ -0,0 +1,3 @@ +## bin/vscode-select-debug-target - + + diff --git a/txt/ssimdb/README.md b/txt/ssimdb/README.md index d4f67859..17023446 100644 --- a/txt/ssimdb/README.md +++ b/txt/ssimdb/README.md @@ -12,6 +12,9 @@ 📁 [dmmeta - Tables holding metadata (data model meta)](/txt/ssimdb/dmmeta/README.md)
📁 [fmdb - Fault management tables (ssim database)](/txt/ssimdb/fmdb/README.md)
📁 [gclidb - gcli db](/txt/ssimdb/gclidb/README.md)
+📁 [httpdb -](/txt/ssimdb/httpdb/README.md)
+📁 [sampdb - ssimdb for tutorials and recipes](/txt/ssimdb/sampdb/README.md)
+📁 [wsdb - WebSocket db](/txt/ssimdb/wsdb/README.md)
diff --git a/txt/ssimdb/amsdb/README.md b/txt/ssimdb/amsdb/README.md index 314cc965..e8762368 100644 --- a/txt/ssimdb/amsdb/README.md +++ b/txt/ssimdb/amsdb/README.md @@ -6,7 +6,7 @@ 📄 [amsdb.proctype -](/txt/ssimdb/amsdb/proctype.md)
-📄 [amsdb.streamtype -](/txt/ssimdb/amsdb/streamtype.md)
+📄 [amsdb.shmtype -](/txt/ssimdb/amsdb/shmtype.md)
diff --git a/txt/ssimdb/amsdb/proctype.md b/txt/ssimdb/amsdb/proctype.md index d3e8cc12..ed91eb6e 100644 --- a/txt/ssimdb/amsdb/proctype.md +++ b/txt/ssimdb/amsdb/proctype.md @@ -4,13 +4,13 @@ ### Attributes -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)amsdb.ProcType +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)amsdb.Proctype * file:[data/amsdb/proctype.ssim](/data/amsdb/proctype.ssim) |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|proctype|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|proctype|[dmmeta.Ns](/txt/ssimdb/dmmeta/ns.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| |id|u32|[Val](/txt/exe/amc/reftypes.md#val)||| |ns|[dmmeta.Ns](/txt/ssimdb/dmmeta/ns.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| diff --git a/txt/ssimdb/gclidb/grepogitport.md b/txt/ssimdb/amsdb/shmtype.md similarity index 53% rename from txt/ssimdb/gclidb/grepogitport.md rename to txt/ssimdb/amsdb/shmtype.md index 3c7f52e4..2c7b322c 100644 --- a/txt/ssimdb/gclidb/grepogitport.md +++ b/txt/ssimdb/amsdb/shmtype.md @@ -1,17 +1,18 @@ -## gclidb.grepogitport - Default ports for repositories +## amsdb.shmtype - ### Attributes -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)gclidb.Grepogitport +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)amsdb.Shmtype -* file:[data/gclidb/grepogitport.ssim](/data/gclidb/grepogitport.ssim) +* file:[data/amsdb/shmtype.ssim](/data/amsdb/shmtype.ssim) |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|grepogitport|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||grepo git host| -|port|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||ssh port for config| +|shmtype|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|id|[ams.Shmtype](/txt/protocol/ams/README.md#ams-shmtype)|[Val](/txt/exe/amc/reftypes.md#val)||| +|nonblock|bool|[Val](/txt/exe/amc/reftypes.md#val)||Non-blocking (lossy) stream| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| @@ -20,7 +21,7 @@ -* [gcli](/txt/exe/gcli/internals.md) as [gcli.FGrepogitport](/txt/exe/gcli/internals.md#gcli-fgrepogitport) +* [lib_ams](/txt/lib/lib_ams/README.md) as [lib_ams.FShmtype](/txt/lib/lib_ams/README.md#lib_ams-fshmtype) diff --git a/txt/ssimdb/atfdb/README.md b/txt/ssimdb/atfdb/README.md index 40319bf7..10b65673 100644 --- a/txt/ssimdb/atfdb/README.md +++ b/txt/ssimdb/atfdb/README.md @@ -19,6 +19,7 @@ 📄 [atfdb.tfilt -](/txt/ssimdb/atfdb/tfilt.md)
📄 [atfdb.tmsg -](/txt/ssimdb/atfdb/tmsg.md)
📄 [atfdb.unittest -](/txt/ssimdb/atfdb/unittest.md)
+📄 [atfdb.var -](/txt/ssimdb/atfdb/var.md)
diff --git a/txt/ssimdb/atfdb/comptest.md b/txt/ssimdb/atfdb/comptest.md index 923c12ff..ae392309 100644 --- a/txt/ssimdb/atfdb/comptest.md +++ b/txt/ssimdb/atfdb/comptest.md @@ -17,7 +17,10 @@ italicised fields: *target, testname* are [**fldfunc**](/txt/ssim.md#fldfunc) fi |*testname*|*[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)*|*[Val](/txt/exe/amc/reftypes.md#val)*||*
.LR of comptest*| |timeout|i32|[Val](/txt/exe/amc/reftypes.md#val)|10|| |memcheck|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|| +|coverage|bool|[Val](/txt/exe/amc/reftypes.md#val)|true|| |exit_code|u8|[Val](/txt/exe/amc/reftypes.md#val)||Exit code to check| +|ncore|i32|[Val](/txt/exe/amc/reftypes.md#val)|1|| +|repeat|i32|[Val](/txt/exe/amc/reftypes.md#val)|1|Number of times to repeat the test| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| @@ -46,6 +49,7 @@ These ssimfiles reference atfdb.comptest * [atf_comp -comptest](/txt/exe/atf_comp/README.md) - Select comptest (SQL regex) +* [atf_exp -comptest](/txt/exe/atf_exp/README.md) - Component test name diff --git a/txt/ssimdb/atfdb/unittest.md b/txt/ssimdb/atfdb/unittest.md index ae6831c1..202c3f11 100644 --- a/txt/ssimdb/atfdb/unittest.md +++ b/txt/ssimdb/atfdb/unittest.md @@ -8,12 +8,12 @@ * file:[data/atfdb/unittest.ssim](/data/atfdb/unittest.ssim) -italicised fields: *target, testname* are [**fldfunc**](/txt/ssim.md#fldfunc) fields +italicised fields: *ns, testname* are [**fldfunc**](/txt/ssim.md#fldfunc) fields |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| |unittest|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| -|*target*|*[dmmeta.Ns](/txt/ssimdb/dmmeta/ns.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*
.RL of unittest*| +|*ns*|*[dmmeta.Ns](/txt/ssimdb/dmmeta/ns.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*
.RL of unittest*| |*testname*|*[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)*|*[Val](/txt/exe/amc/reftypes.md#val)*||*
.RR of unittest*| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| diff --git a/txt/ssimdb/atfdb/var.md b/txt/ssimdb/atfdb/var.md new file mode 100644 index 00000000..994aea3a --- /dev/null +++ b/txt/ssimdb/atfdb/var.md @@ -0,0 +1,18 @@ +## atfdb.var - + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)atfdb.Var + +* file:[data/atfdb/var.ssim](/data/atfdb/var.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|var|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|value|[algo.Smallstr100](/txt/protocol/algo/README.md#algo-smallstr100)|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + diff --git a/txt/ssimdb/dev/README.md b/txt/ssimdb/dev/README.md index d6e1c6e1..198afb33 100644 --- a/txt/ssimdb/dev/README.md +++ b/txt/ssimdb/dev/README.md @@ -26,13 +26,16 @@ 📄 [dev.mdmark - invisible markers for markdown files](/txt/ssimdb/dev/mdmark.md)
📄 [dev.mdsection - Template for updating a markdown file](/txt/ssimdb/dev/mdsection.md)
📄 [dev.msgfile - File in repo containing messages that should be normalized during CI](/txt/ssimdb/dev/msgfile.md)
+📄 [dev.netproto - Network protocol: add all levels here](/txt/ssimdb/dev/netproto.md)
📄 [dev.noindent - Indicates that a file should not be automatically indented](/txt/ssimdb/dev/noindent.md)
📄 [dev.opt_type - Type of option (used in tool_opt)](/txt/ssimdb/dev/opt_type.md)
📄 [dev.package - OpenACR package](/txt/ssimdb/dev/package.md)
📄 [dev.pkgdep - OpenACR Package dependency](/txt/ssimdb/dev/pkgdep.md)
📄 [dev.pkgkey - Keys belonging to the OpenACR package](/txt/ssimdb/dev/pkgkey.md)
-📄 [dev.readme - File containing documentation](/txt/ssimdb/dev/readme.md)
+📄 [dev.prototransport - Protocol/transport binding](/txt/ssimdb/dev/prototransport.md)
+📄 [dev.readmefile - File containing documentation](/txt/ssimdb/dev/readmefile.md)
📄 [dev.readmesort - sorted categories of txt/ *.md files presented in dev.readme](/txt/ssimdb/dev/readmesort.md)
+📄 [dev.rpm -](/txt/ssimdb/dev/rpm.md)
📄 [dev.sandbox - Registered sandbox](/txt/ssimdb/dev/sandbox.md)
📄 [dev.sbpath - Extra files to copy into the sandbox](/txt/ssimdb/dev/sbpath.md)
📄 [dev.scriptfile - Known script file](/txt/ssimdb/dev/scriptfile.md)
@@ -47,6 +50,7 @@ 📄 [dev.tgtcov - Captured line coverate information by target](/txt/ssimdb/dev/tgtcov.md)
📄 [dev.timefmt - Time formats supported by orgfile](/txt/ssimdb/dev/timefmt.md)
📄 [dev.tool_opt - Compiler/linker options to use](/txt/ssimdb/dev/tool_opt.md)
+📄 [dev.transport - Transport layer](/txt/ssimdb/dev/transport.md)
📄 [dev.uname - List of known unames](/txt/ssimdb/dev/uname.md)
📄 [dev.unstablefld - Fields that should be stripped from component test output because they contain timestamps etc.](/txt/ssimdb/dev/unstablefld.md)
diff --git a/txt/ssimdb/dev/covline.md b/txt/ssimdb/dev/covline.md index 69069396..b8318d22 100644 --- a/txt/ssimdb/dev/covline.md +++ b/txt/ssimdb/dev/covline.md @@ -12,7 +12,7 @@ italicised fields: *src, line* are [**fldfunc**](/txt/ssim.md#fldfunc) fields |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|covline|[algo.Smallstr200](/txt/protocol/algo/README.md#algo-smallstr200)|[Val](/txt/exe/amc/reftypes.md#val)||file:line| +|covline|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||Key: file:line| |*src*|*[dev.Gitfile](/txt/ssimdb/dev/gitfile.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*Source file
:RL of covline*| |*line*|*u32*|*[Val](/txt/exe/amc/reftypes.md#val)*||*Source line
:RR of covline*| |flag|char|[Val](/txt/exe/amc/reftypes.md#val)|'N'|Flag| diff --git a/txt/ssimdb/dev/gitfile.md b/txt/ssimdb/dev/gitfile.md index b50896c1..2a37a74c 100644 --- a/txt/ssimdb/dev/gitfile.md +++ b/txt/ssimdb/dev/gitfile.md @@ -26,7 +26,7 @@ These ssimfiles are subsets of dev.gitfile * [dev.Linelim](/txt/ssimdb/dev/linelim.md) - * [dev.Msgfile](/txt/ssimdb/dev/msgfile.md) - File in repo containing messages that should be normalized during CI * [dev.Noindent](/txt/ssimdb/dev/noindent.md) - Indicates that a file should not be automatically indented -* [dev.Readme](/txt/ssimdb/dev/readme.md) - File containing documentation +* [dev.Readmefile](/txt/ssimdb/dev/readmefile.md) - File containing documentation * [dev.Scriptfile](/txt/ssimdb/dev/scriptfile.md) - Known script file * [dev.Srcfile](/txt/ssimdb/dev/srcfile.md) - Source file or header (key is pathname) @@ -39,7 +39,6 @@ These ssimfiles reference dev.gitfile * [dev.covline via src](/txt/ssimdb/dev/covline.md) - Source file * [dev.targsrc via src](/txt/ssimdb/dev/targsrc.md) - List of sources for target -* [gclidb.grepossh via sshid](/txt/ssimdb/gclidb/grepossh.md) - ssh id key name for ssh config @@ -49,7 +48,7 @@ These ssimfiles reference dev.gitfile * [abt -srcfile](/txt/exe/abt/README.md) - Build/disassemble/preprocess specific file * [atf_cov -exclude](/txt/exe/atf_cov/README.md) - Exclude gitfiles (external, generated) -* [src_func -nextfile](/txt/exe/src_func/README.md) - Print name of next srcfile in targsrc list +* [src_func -nextfile](/txt/exe/src_func/README.md) - (action) Print name of next srcfile in targsrc list * [src_lim -srcfile](/txt/exe/src_lim/README.md) - Filter for source files to process diff --git a/txt/ssimdb/dev/netproto.md b/txt/ssimdb/dev/netproto.md new file mode 100644 index 00000000..49324d05 --- /dev/null +++ b/txt/ssimdb/dev/netproto.md @@ -0,0 +1,27 @@ +## dev.netproto - Network protocol: add all levels here + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dev.Netproto + +* file:[data/dev/netproto.ssim](/data/dev/netproto.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|netproto|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|tls|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Related + + +These ssimfiles reference dev.netproto + +* [dev.prototransport via netproto](/txt/ssimdb/dev/prototransport.md) - Protocol/transport binding + + + diff --git a/txt/ssimdb/dev/pkgkey.md b/txt/ssimdb/dev/pkgkey.md index d77b6742..95eb16eb 100644 --- a/txt/ssimdb/dev/pkgkey.md +++ b/txt/ssimdb/dev/pkgkey.md @@ -14,7 +14,7 @@ italicised fields: *package, key* are [**fldfunc**](/txt/ssim.md#fldfunc) fields |---|---|---|---|---| |pkgkey|[algo.Smallstr150](/txt/protocol/algo/README.md#algo-smallstr150)|[Val](/txt/exe/amc/reftypes.md#val)||| |*package*|*[dev.Package](/txt/ssimdb/dev/package.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*Parent package
/LL of pkgkey*| -|*key*|*[algo.Smallstr150](/txt/protocol/algo/README.md#algo-smallstr150)*|*[Val](/txt/exe/amc/reftypes.md#val)*||*Acr query (regx)
/LR of pkgkey*| +|*key*|*[algo.Smallstr150](/txt/protocol/algo/README.md#algo-smallstr150)*|*[Val](/txt/exe/amc/reftypes.md#val)*||*Acr query (regx) - named key for clarity
/LR of pkgkey*| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| diff --git a/txt/ssimdb/dev/prototransport.md b/txt/ssimdb/dev/prototransport.md new file mode 100644 index 00000000..b372b518 --- /dev/null +++ b/txt/ssimdb/dev/prototransport.md @@ -0,0 +1,21 @@ +## dev.prototransport - Protocol/transport binding + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dev.Prototransport + +* file:[data/dev/prototransport.ssim](/data/dev/prototransport.ssim) + +italicised fields: *netproto, transport* are [**fldfunc**](/txt/ssim.md#fldfunc) fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|prototransport|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|*netproto*|*[dev.Netproto](/txt/ssimdb/dev/netproto.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*
/RL of prototransport*| +|*transport*|*[dev.Transport](/txt/ssimdb/dev/transport.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*
/RR of prototransport*| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + diff --git a/txt/ssimdb/dev/readme.md b/txt/ssimdb/dev/readmefile.md similarity index 69% rename from txt/ssimdb/dev/readme.md rename to txt/ssimdb/dev/readmefile.md index 6bf6c4c2..7109d07d 100644 --- a/txt/ssimdb/dev/readme.md +++ b/txt/ssimdb/dev/readmefile.md @@ -1,12 +1,12 @@ -## dev.readme - File containing documentation +## dev.readmefile - File containing documentation ### Attributes -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dev.Readme +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dev.Readmefile -* file:[data/dev/readme.ssim](/data/dev/readme.ssim) +* file:[data/dev/readmefile.ssim](/data/dev/readmefile.ssim) |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| @@ -22,7 +22,7 @@ -* [abt_md -readme](/txt/exe/abt_md/README.md) - Regx of readme to process/show (empty=all) +* [abt_md -readmefile](/txt/exe/abt_md/README.md) - Regx of readme to process/show (empty=all) @@ -30,8 +30,8 @@ -* [abt_md](/txt/exe/abt_md/internals.md) as [abt_md.FReadme](/txt/exe/abt_md/internals.md#abt_md-freadme) -* [atf_ci](/txt/exe/atf_ci/internals.md) as [atf_ci.FReadme](/txt/exe/atf_ci/internals.md#atf_ci-freadme) +* [abt_md](/txt/exe/abt_md/internals.md) as [abt_md.FReadmefile](/txt/exe/abt_md/internals.md#abt_md-freadmefile) +* [atf_ci](/txt/exe/atf_ci/internals.md) as [atf_ci.FReadmefile](/txt/exe/atf_ci/internals.md#atf_ci-freadmefile) diff --git a/txt/protocol/ams/AlarmSyncMsg.md b/txt/ssimdb/dev/rpm.md similarity index 50% rename from txt/protocol/ams/AlarmSyncMsg.md rename to txt/ssimdb/dev/rpm.md index 6d79dfa2..0483e6b0 100644 --- a/txt/protocol/ams/AlarmSyncMsg.md +++ b/txt/ssimdb/dev/rpm.md @@ -1,15 +1,17 @@ -## ams.AlarmSyncMsg - +## dev.rpm - ### Attributes -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)ams.AlarmSyncMsg +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dev.Rpm + +* file:[data/dev/rpm.ssim](/data/dev/rpm.ssim) |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|base|ams.MsgHeader|Base||| -|updated_after|algo.UnTime|Val||| +|rpm|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| diff --git a/txt/ssimdb/dev/syscmd.md b/txt/ssimdb/dev/syscmd.md index e5f0e433..6a840b20 100644 --- a/txt/ssimdb/dev/syscmd.md +++ b/txt/ssimdb/dev/syscmd.md @@ -22,12 +22,20 @@ +### Subsets + + +These ssimfiles are subsets of dev.syscmd + +* [dev.Syscmddep](/txt/ssimdb/dev/syscmddep.md) - Dependency between two commands + + + ### Related These ssimfiles reference dev.syscmd -* [dev.syscmddep via child](/txt/ssimdb/dev/syscmddep.md) - Dependency between two commands * [dev.syscmddep via parent](/txt/ssimdb/dev/syscmddep.md) - Dependency between two commands diff --git a/txt/ssimdb/dev/syscmddep.md b/txt/ssimdb/dev/syscmddep.md index 6229aa6c..f210a8a0 100644 --- a/txt/ssimdb/dev/syscmddep.md +++ b/txt/ssimdb/dev/syscmddep.md @@ -10,7 +10,6 @@ |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|syscmddep|[algo.RspaceStr16](/txt/protocol/algo/README.md#algo-rspacestr16)|[Val](/txt/exe/amc/reftypes.md#val)||| |child|[dev.Syscmd](/txt/ssimdb/dev/syscmd.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| |parent|[dev.Syscmd](/txt/ssimdb/dev/syscmd.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| diff --git a/txt/ssimdb/dev/target.md b/txt/ssimdb/dev/target.md index aa7327cf..d76af5ee 100644 --- a/txt/ssimdb/dev/target.md +++ b/txt/ssimdb/dev/target.md @@ -45,7 +45,7 @@ These ssimfiles reference dev.target * [amc_gc -target](/txt/exe/amc_gc/README.md) - Target to test-build * [atf_fuzz -target](/txt/exe/atf_fuzz/README.md) - Target to fuzz * [mdbg -target](/txt/exe/mdbg/README.md) - Executable name -* [src_func -target](/txt/exe/src_func/README.md) - Visit these targets +* [src_func -func](/txt/exe/src_func/README.md) - Target.function regex diff --git a/txt/ssimdb/dev/targsrc.md b/txt/ssimdb/dev/targsrc.md index bfb1eeb9..2f367f05 100644 --- a/txt/ssimdb/dev/targsrc.md +++ b/txt/ssimdb/dev/targsrc.md @@ -24,7 +24,7 @@ italicised fields: *target, src, ext* are [**fldfunc**](/txt/ssim.md#fldfunc) fi -* [src_func -targsrc](/txt/exe/src_func/README.md) - Visit these sources (optional) +* [src_func -targsrc](/txt/exe/src_func/README.md) - (scan) Limit scanning to these sources only * [src_hdr -targsrc](/txt/exe/src_hdr/README.md) - Regx of targsrc to update diff --git a/txt/ssimdb/dev/targsyslib.md b/txt/ssimdb/dev/targsyslib.md index dbac8358..e48b6376 100644 --- a/txt/ssimdb/dev/targsyslib.md +++ b/txt/ssimdb/dev/targsyslib.md @@ -8,7 +8,7 @@ * file:[data/dev/targsyslib.ssim](/data/dev/targsyslib.ssim) -italicised fields: *target, syslib, uname* are [**fldfunc**](/txt/ssim.md#fldfunc) fields +italicised fields: *target, syslib, uname, prefix* are [**fldfunc**](/txt/ssim.md#fldfunc) fields |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| @@ -16,6 +16,7 @@ italicised fields: *target, syslib, uname* are [**fldfunc**](/txt/ssim.md#fldfun |*target*|*[dev.Target](/txt/ssimdb/dev/target.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*
/LR.LL of targsyslib*| |*syslib*|*[dev.Syslib](/txt/ssimdb/dev/syslib.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*
/LR.LR of targsyslib*| |*uname*|*[dev.Uname](/txt/ssimdb/dev/uname.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*
/LL of targsyslib*| +|*prefix*|*[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)*|*[Val](/txt/exe/amc/reftypes.md#val)*||*
.RL of targsyslib*| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| diff --git a/txt/ssimdb/dev/transport.md b/txt/ssimdb/dev/transport.md new file mode 100644 index 00000000..bc719947 --- /dev/null +++ b/txt/ssimdb/dev/transport.md @@ -0,0 +1,27 @@ +## dev.transport - Transport layer + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dev.Transport + +* file:[data/dev/transport.ssim](/data/dev/transport.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|transport|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|ip|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Related + + +These ssimfiles reference dev.transport + +* [dev.prototransport via transport](/txt/ssimdb/dev/prototransport.md) - Protocol/transport binding + + + diff --git a/txt/ssimdb/dmmeta/README.md b/txt/ssimdb/dmmeta/README.md index c4c18726..63c5752b 100644 --- a/txt/ssimdb/dmmeta/README.md +++ b/txt/ssimdb/dmmeta/README.md @@ -19,6 +19,7 @@ 📄 [dmmeta.cget - Generate state functions for these ctypes](/txt/ssimdb/dmmeta/cget.md)
📄 [dmmeta.charset - Generate functions to determine if a character is a member of a set](/txt/ssimdb/dmmeta/charset.md)
📄 [dmmeta.chash - Generate hash function](/txt/ssimdb/dmmeta/chash.md)
+📄 [dmmeta.ckafka -](/txt/ssimdb/dmmeta/ckafka.md)
📄 [dmmeta.cppfunc - Value of field provided by this expression](/txt/ssimdb/dmmeta/cppfunc.md)
📄 [dmmeta.cppkeyword - Built-in C++ keyword](/txt/ssimdb/dmmeta/cppkeyword.md)
📄 [dmmeta.cpptype - Specify whether a ctype can be passed by value, and other c++ options](/txt/ssimdb/dmmeta/cpptype.md)
@@ -42,6 +43,7 @@ 📄 [dmmeta.fbitset - Generate bitset functions over integer field or array](/txt/ssimdb/dmmeta/fbitset.md)
📄 [dmmeta.fbuf - Buffer for reading/writing messages, works with Iohook](/txt/ssimdb/dmmeta/fbuf.md)
📄 [dmmeta.fbufdir - Buffer direction (in,out)](/txt/ssimdb/dmmeta/fbufdir.md)
+📄 [dmmeta.fbufiotype - Underlying IO type](/txt/ssimdb/dmmeta/fbufiotype.md)
📄 [dmmeta.fbuftype - Buffer type](/txt/ssimdb/dmmeta/fbuftype.md)
📄 [dmmeta.fcast - Generate implicit conversion from field to c++ expression](/txt/ssimdb/dmmeta/fcast.md)
📄 [dmmeta.fcleanup - Request user-implemented function to be called at Uninit time for a field](/txt/ssimdb/dmmeta/fcleanup.md)
@@ -58,6 +60,7 @@ 📄 [dmmeta.field - Specify field of a struct](/txt/ssimdb/dmmeta/field.md)
📄 [dmmeta.findrem - Request generation of FindRemove function](/txt/ssimdb/dmmeta/findrem.md)
📄 [dmmeta.finput - Describe input table of a program](/txt/ssimdb/dmmeta/finput.md)
+📄 [dmmeta.fkafka -](/txt/ssimdb/dmmeta/fkafka.md)
📄 [dmmeta.fldoffset - Assert field offset - will result in compile-time error if violated](/txt/ssimdb/dmmeta/fldoffset.md)
📄 [dmmeta.floadtuples - Request that process automatically load any input tables on startup](/txt/ssimdb/dmmeta/floadtuples.md)
📄 [dmmeta.fnoremove - Omit any functions for removing elements from table; Table is append-only](/txt/ssimdb/dmmeta/fnoremove.md)
@@ -78,6 +81,8 @@ 📄 [dmmeta.hashtype - Hash function type](/txt/ssimdb/dmmeta/hashtype.md)
📄 [dmmeta.hook - Required on Hook fields](/txt/ssimdb/dmmeta/hook.md)
📄 [dmmeta.inlary - Generate inline array of fixed or variable length (all entries fit within parent struct)](/txt/ssimdb/dmmeta/inlary.md)
+📄 [dmmeta.jstype -](/txt/ssimdb/dmmeta/jstype.md)
+📄 [dmmeta.kafka_type_kind -](/txt/ssimdb/dmmeta/kafka_type_kind.md)
📄 [dmmeta.lenfld - Specify which gives length of varlen portion in bytes](/txt/ssimdb/dmmeta/lenfld.md)
📄 [dmmeta.listtype - Specify structure of linked list based on field prefix](/txt/ssimdb/dmmeta/listtype.md)
📄 [dmmeta.llist - Options for Llist field](/txt/ssimdb/dmmeta/llist.md)
@@ -92,6 +97,7 @@ 📄 [dmmeta.nsdb - Annotate ssimdb namespaces](/txt/ssimdb/dmmeta/nsdb.md)
📄 [dmmeta.nsfast - Whether namespace is FAST](/txt/ssimdb/dmmeta/nsfast.md)
📄 [dmmeta.nsinclude - Explicitly specify a C++ include file for namespace](/txt/ssimdb/dmmeta/nsinclude.md)
+📄 [dmmeta.nsjs - Generate JavaScript code for this namespace](/txt/ssimdb/dmmeta/nsjs.md)
📄 [dmmeta.nsproto - Annotate protocol namespace (collection of types, no state)](/txt/ssimdb/dmmeta/nsproto.md)
📄 [dmmeta.nstype - Namespace type](/txt/ssimdb/dmmeta/nstype.md)
📄 [dmmeta.nsversion - Namespace version](/txt/ssimdb/dmmeta/nsversion.md)
@@ -124,6 +130,7 @@ 📄 [dmmeta.tracefld - Trace fields](/txt/ssimdb/dmmeta/tracefld.md)
📄 [dmmeta.tracerec - Trace record](/txt/ssimdb/dmmeta/tracerec.md)
📄 [dmmeta.typefld - Specifies which field of a message carries the type](/txt/ssimdb/dmmeta/typefld.md)
+📄 [dmmeta.userfunc -](/txt/ssimdb/dmmeta/userfunc.md)
📄 [dmmeta.usertracefld - Add custom user trace fields to process's trace struct](/txt/ssimdb/dmmeta/usertracefld.md)
📄 [dmmeta.xref - Specify how to cross-reference (i.e. project, or group-by) one record with another](/txt/ssimdb/dmmeta/xref.md)
diff --git a/txt/ssimdb/dmmeta/ckafka.md b/txt/ssimdb/dmmeta/ckafka.md new file mode 100644 index 00000000..6993fd55 --- /dev/null +++ b/txt/ssimdb/dmmeta/ckafka.md @@ -0,0 +1,29 @@ +## dmmeta.ckafka - + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dmmeta.Ckafka + +* file:[data/dmmeta/ckafka.ssim](/data/dmmeta/ckafka.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|ctype|[dmmeta.Ctype](/txt/ssimdb/dmmeta/ctype.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| +|kind|[dmmeta.KafkaTypeKind](/txt/ssimdb/dmmeta/kafka_type_kind.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| +|root|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|valid_versions|[algo.Smallstr10](/txt/protocol/algo/README.md#algo-smallstr10)|[Val](/txt/exe/amc/reftypes.md#val)||| +|flexible_versions|[algo.Smallstr10](/txt/protocol/algo/README.md#algo-smallstr10)|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Used In Executables + + + +* [amc](/txt/exe/amc/internals.md) as [amc.FCkafka](/txt/exe/amc/internals.md#amc-fckafka) + + + diff --git a/txt/ssimdb/dmmeta/ctype.md b/txt/ssimdb/dmmeta/ctype.md index 41414881..c8a74492 100644 --- a/txt/ssimdb/dmmeta/ctype.md +++ b/txt/ssimdb/dmmeta/ctype.md @@ -32,10 +32,12 @@ These ssimfiles are subsets of dmmeta.ctype * [dmmeta.Cfast](/txt/ssimdb/dmmeta/cfast.md) - FAST properties for ctype * [dmmeta.Cget](/txt/ssimdb/dmmeta/cget.md) - Generate state functions for these ctypes * [dmmeta.Chash](/txt/ssimdb/dmmeta/chash.md) - Generate hash function +* [dmmeta.Ckafka](/txt/ssimdb/dmmeta/ckafka.md) - * [dmmeta.Cpptype](/txt/ssimdb/dmmeta/cpptype.md) - Specify whether a ctype can be passed by value, and other c++ options * [dmmeta.Csize](/txt/ssimdb/dmmeta/csize.md) - Specify size/alignment for built-in C++ types * [dmmeta.Cstr](/txt/ssimdb/dmmeta/cstr.md) - Specify that type behaves like a string * [dmmeta.Ctypelen](/txt/ssimdb/dmmeta/ctypelen.md) - Size of Ctype +* [dmmeta.Jstype](/txt/ssimdb/dmmeta/jstype.md) - * [dmmeta.Msgtype](/txt/ssimdb/dmmeta/msgtype.md) - Specify message type for each eligible message, controls dispatch * [dmmeta.Nossimfile](/txt/ssimdb/dmmeta/nossimfile.md) - Indicates that ssimfile does not exist for this ssimdb ctype * [dmmeta.Pack](/txt/ssimdb/dmmeta/pack.md) - Request byte-packing of structure fields diff --git a/txt/ssimdb/dmmeta/dispatch.md b/txt/ssimdb/dmmeta/dispatch.md index 8c2b4ac7..33398294 100644 --- a/txt/ssimdb/dmmeta/dispatch.md +++ b/txt/ssimdb/dmmeta/dispatch.md @@ -21,6 +21,8 @@ italicised fields: *ns, name* are [**fldfunc**](/txt/ssim.md#fldfunc) fields |haslen|bool|[Val](/txt/exe/amc/reftypes.md#val)||Include length in dispatch function| |call|bool|[Val](/txt/exe/amc/reftypes.md#val)||Generate call to user-defined function| |strict|bool|[Val](/txt/exe/amc/reftypes.md#val)||Only dispatch if length matches exactly| +|dyn|bool|[Val](/txt/exe/amc/reftypes.md#val)||Use dynamic memory allocation: new, delete instead of ByteAry| +|kafka|bool|[Val](/txt/exe/amc/reftypes.md#val)||generate kafka codec| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| @@ -49,8 +51,8 @@ These ssimfiles reference dmmeta.dispatch +* [abt_md](/txt/exe/abt_md/internals.md) as [abt_md.FDispatch](/txt/exe/abt_md/internals.md#abt_md-fdispatch) * [amc](/txt/exe/amc/internals.md) as [amc.FDispatch](/txt/exe/amc/internals.md#amc-fdispatch) -* [src_func](/txt/exe/src_func/internals.md) as [src_func.FDispatch](/txt/exe/src_func/internals.md#src_func-fdispatch) diff --git a/txt/ssimdb/dmmeta/dispatch_msg.md b/txt/ssimdb/dmmeta/dispatch_msg.md index 79c35d0d..636b3255 100644 --- a/txt/ssimdb/dmmeta/dispatch_msg.md +++ b/txt/ssimdb/dmmeta/dispatch_msg.md @@ -23,6 +23,7 @@ italicised fields: *dispatch, ctype* are [**fldfunc**](/txt/ssim.md#fldfunc) fie +* [abt_md](/txt/exe/abt_md/internals.md) as [abt_md.FDispatchMsg](/txt/exe/abt_md/internals.md#abt_md-fdispatchmsg) * [amc](/txt/exe/amc/internals.md) as [amc.FDispatchmsg](/txt/exe/amc/internals.md#amc-fdispatchmsg) diff --git a/txt/ssimdb/dmmeta/fbitset.md b/txt/ssimdb/dmmeta/fbitset.md index 793d558a..a5b7b6f2 100644 --- a/txt/ssimdb/dmmeta/fbitset.md +++ b/txt/ssimdb/dmmeta/fbitset.md @@ -10,6 +10,7 @@ inline-command: acr -t field:atf_amc.Bitset.fld8 | egrep Bitset dmmeta.ctype ctype:atf_amc.Bitset comment:"Test bitset" dmmeta.field field:atf_amc.Bitset.fld8 arg:u8 reftype:Val dflt:"" comment:"Bitset field" dmmeta.fbitset field:atf_amc.Bitset.fld8 comment:"" + dmmeta.fcurs fcurs:atf_amc.Bitset.fld8/bitcurs comment:"" ``` The generated functions are as follows: diff --git a/txt/ssimdb/dmmeta/fbuf.md b/txt/ssimdb/dmmeta/fbuf.md index 3c154e12..fd44fefd 100644 --- a/txt/ssimdb/dmmeta/fbuf.md +++ b/txt/ssimdb/dmmeta/fbuf.md @@ -18,6 +18,7 @@ italicised fields: *fbufdir* are [**fldfunc**](/txt/ssim.md#fldfunc) fields |fbuftype|[dmmeta.Fbuftype](/txt/ssimdb/dmmeta/fbuftype.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||Type of buffer| |insready|[dmmeta.Field](/txt/ssimdb/dmmeta/field.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| |inseof|[dmmeta.Field](/txt/ssimdb/dmmeta/field.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| +|iotype|[dmmeta.Fbufiotype](/txt/ssimdb/dmmeta/fbufiotype.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)|"standard"|| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| diff --git a/txt/ssimdb/dmmeta/fbufiotype.md b/txt/ssimdb/dmmeta/fbufiotype.md new file mode 100644 index 00000000..b488ca3b --- /dev/null +++ b/txt/ssimdb/dmmeta/fbufiotype.md @@ -0,0 +1,26 @@ +## dmmeta.fbufiotype - Underlying IO type + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dmmeta.Fbufiotype + +* file:[data/dmmeta/fbufiotype.ssim](/data/dmmeta/fbufiotype.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|fbufiotype|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Related + + +These ssimfiles reference dmmeta.fbufiotype + +* [dmmeta.fbuf via iotype](/txt/ssimdb/dmmeta/fbuf.md) - Buffer for reading/writing messages, works with Iohook + + + diff --git a/txt/ssimdb/dmmeta/fcurs.md b/txt/ssimdb/dmmeta/fcurs.md index 1bd9b9fe..1563de9f 100644 --- a/txt/ssimdb/dmmeta/fcurs.md +++ b/txt/ssimdb/dmmeta/fcurs.md @@ -12,16 +12,15 @@ See [curstype](/txt/ssimdb/amcdb/curstype.md) for the list of known cursor types The following cursors are generated by default: ``` inline-command: acr tcurs -where dflt:Y | ssimfilt ^ -t -TFUNC DFLT COMMENT -Atree.curs Y -Bheap.curs Y -Bitset.bitcurs Y -Inlary.curs Y -Lary.curs Y -Llist.curs Y -Ptrary.curs Y -Tary.curs Y -Varlen.curs Y +TFUNC DFLT COMMENT +Atree.curs Y +Bheap.curs Y +Inlary.curs Y +Lary.curs Y +Llist.curs Y +Ptrary.curs Y +Tary.curs Y +Varlen.curs Y ``` @@ -30,6 +29,7 @@ The following cursors can be generated on demand: inline-command: acr tcurs -where dflt:N | ssimfilt ^ -t TFUNC DFLT COMMENT Bheap.unordcurs N +Bitset.bitcurs N Llist.delcurs N Ptrary.oncecurs N Thash.curs N diff --git a/txt/ssimdb/dmmeta/field.md b/txt/ssimdb/dmmeta/field.md index d32275d6..09b46bc7 100644 --- a/txt/ssimdb/dmmeta/field.md +++ b/txt/ssimdb/dmmeta/field.md @@ -49,6 +49,7 @@ These ssimfiles are subsets of dmmeta.field * [dmmeta.Fflag](/txt/ssimdb/dmmeta/fflag.md) - Options for command-line flags * [dmmeta.Findrem](/txt/ssimdb/dmmeta/findrem.md) - Request generation of FindRemove function * [dmmeta.Finput](/txt/ssimdb/dmmeta/finput.md) - Describe input table of a program +* [dmmeta.Fkafka](/txt/ssimdb/dmmeta/fkafka.md) - * [dmmeta.Fldoffset](/txt/ssimdb/dmmeta/fldoffset.md) - Assert field offset - will result in compile-time error if violated * [dmmeta.Floadtuples](/txt/ssimdb/dmmeta/floadtuples.md) - Request that process automatically load any input tables on startup * [dmmeta.Fnoremove](/txt/ssimdb/dmmeta/fnoremove.md) - Omit any functions for removing elements from table; Table is append-only diff --git a/txt/ssimdb/dmmeta/finput.md b/txt/ssimdb/dmmeta/finput.md index 3174d442..b017ea25 100644 --- a/txt/ssimdb/dmmeta/finput.md +++ b/txt/ssimdb/dmmeta/finput.md @@ -25,6 +25,7 @@ italicised fields: *ns* are [**fldfunc**](/txt/ssim.md#fldfunc) fields +* [abt_md](/txt/exe/abt_md/internals.md) as [abt_md.FFinput](/txt/exe/abt_md/internals.md#abt_md-ffinput) * [acr_in](/txt/exe/acr_in/internals.md) as [acr_in.FFinput](/txt/exe/acr_in/internals.md#acr_in-ffinput) * [amc](/txt/exe/amc/internals.md) as [amc.FFinput](/txt/exe/amc/internals.md#amc-ffinput) * [amc_vis](/txt/exe/amc_vis/internals.md) as [amc_vis.FFinput](/txt/exe/amc_vis/internals.md#amc_vis-ffinput) diff --git a/txt/ssimdb/dmmeta/fkafka.md b/txt/ssimdb/dmmeta/fkafka.md new file mode 100644 index 00000000..8c0f1cea --- /dev/null +++ b/txt/ssimdb/dmmeta/fkafka.md @@ -0,0 +1,29 @@ +## dmmeta.fkafka - + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dmmeta.Fkafka + +* file:[data/dmmeta/fkafka.ssim](/data/dmmeta/fkafka.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|field|[dmmeta.Field](/txt/ssimdb/dmmeta/field.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| +|versions|[algo.Smallstr10](/txt/protocol/algo/README.md#algo-smallstr10)|[Val](/txt/exe/amc/reftypes.md#val)||| +|nullable_versions|[algo.Smallstr10](/txt/protocol/algo/README.md#algo-smallstr10)|[Val](/txt/exe/amc/reftypes.md#val)||| +|tagged_versions|[algo.Smallstr10](/txt/protocol/algo/README.md#algo-smallstr10)|[Val](/txt/exe/amc/reftypes.md#val)||| +|tag|u64|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Used In Executables + + + +* [amc](/txt/exe/amc/internals.md) as [amc.FFkafka](/txt/exe/amc/internals.md#amc-ffkafka) + + + diff --git a/txt/ssimdb/dmmeta/fstep.md b/txt/ssimdb/dmmeta/fstep.md index ee7132e9..8c799315 100644 --- a/txt/ssimdb/dmmeta/fstep.md +++ b/txt/ssimdb/dmmeta/fstep.md @@ -43,7 +43,6 @@ These ssimfiles are subsets of dmmeta.fstep * [amc](/txt/exe/amc/internals.md) as [amc.FFstep](/txt/exe/amc/internals.md#amc-ffstep) -* [src_func](/txt/exe/src_func/internals.md) as [src_func.FFstep](/txt/exe/src_func/internals.md#src_func-ffstep) diff --git a/txt/ssimdb/dmmeta/gstatic.md b/txt/ssimdb/dmmeta/gstatic.md index 2e5ebc3b..4af04ecd 100644 --- a/txt/ssimdb/dmmeta/gstatic.md +++ b/txt/ssimdb/dmmeta/gstatic.md @@ -68,17 +68,17 @@ check_bitfld N Check that bitfields don't overlap Select first 10 functions from amc source code: ``` -inline-command: src_func amc gen_% -proto -comment: | sort -k 3 | head -cpp/amc/gen.cpp:230: void amc::gen_basepool() -cpp/amc/cget.cpp:121: void amc::gen_cget() -cpp/amc/gen.cpp:614: void amc::gen_check_bigend() -cpp/amc/gen.cpp:310: void amc::gen_check_bitfld() -cpp/amc/gen.cpp:110: void amc::gen_check_cascdel() -cpp/amc/gen.cpp:496: void amc::gen_check_cpptype() -cpp/amc/gen.cpp:1454: void amc::gen_check_fcurs() -cpp/amc/gen.cpp:215: void amc::gen_check_prefix() -cpp/amc/gen.cpp:432: void amc::gen_check_reftype() -cpp/amc/gen.cpp:136: void amc::gen_check_ssimsort() +inline-command: src_func amc.gen_% | sort -k 3 | head +void amc::gen_cget() +void amc::gen_fcmap() +void amc::gen_basepool() +void amc::gen_bitfldenum() +void amc::gen_check_basefield() +void amc::gen_check_basepool() +void amc::gen_check_bigend() +void amc::gen_check_bitfld() +void amc::gen_check_cascdel() +void amc::gen_check_cheapcopy() ``` In language-centric systems, one would start by writing some functions, and then use "reflection" to @@ -112,7 +112,6 @@ italicised fields: *ns* are [**fldfunc**](/txt/ssim.md#fldfunc) fields * [abt_md](/txt/exe/abt_md/internals.md) as [abt_md.FGstatic](/txt/exe/abt_md/internals.md#abt_md-fgstatic) * [amc](/txt/exe/amc/internals.md) as [amc.FGstatic](/txt/exe/amc/internals.md#amc-fgstatic) -* [src_func](/txt/exe/src_func/internals.md) as [src_func.FGstatic](/txt/exe/src_func/internals.md#src_func-fgstatic) diff --git a/txt/ssimdb/dmmeta/hook.md b/txt/ssimdb/dmmeta/hook.md index c9b98c24..296e6ab1 100644 --- a/txt/ssimdb/dmmeta/hook.md +++ b/txt/ssimdb/dmmeta/hook.md @@ -22,7 +22,6 @@ This is a very commonly used trick to structure processes. |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| |field|[dmmeta.Field](/txt/ssimdb/dmmeta/field.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||The field| -|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| diff --git a/txt/ssimdb/dmmeta/inlary.md b/txt/ssimdb/dmmeta/inlary.md index bbcb54d3..f2203836 100644 --- a/txt/ssimdb/dmmeta/inlary.md +++ b/txt/ssimdb/dmmeta/inlary.md @@ -12,7 +12,7 @@ Here is an example: ``` inline-command: acr -t field:algo_lib.FDb.temp_strings | egrep algo_lib.FDb dmmeta.ctype ctype:algo_lib.FDb comment:"In-memory database for algo_lib" - dmmeta.field field:algo_lib.FDb.temp_strings arg:algo.cstring reftype:Inlary dflt:"" comment:"* initialization order is important *" + dmmeta.field field:algo_lib.FDb.temp_strings arg:algo.cstring reftype:Inlary dflt:"" comment:"" dmmeta.inlary field:algo_lib.FDb.temp_strings min:8 max:8 comment:"" ``` diff --git a/txt/ssimdb/dmmeta/jstype.md b/txt/ssimdb/dmmeta/jstype.md new file mode 100644 index 00000000..7a36c4c4 --- /dev/null +++ b/txt/ssimdb/dmmeta/jstype.md @@ -0,0 +1,25 @@ +## dmmeta.jstype - + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dmmeta.Jstype + +* file:[data/dmmeta/jstype.ssim](/data/dmmeta/jstype.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|ctype|[dmmeta.Ctype](/txt/ssimdb/dmmeta/ctype.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Used In Executables + + + +* [amc](/txt/exe/amc/internals.md) as [amc.FJstype](/txt/exe/amc/internals.md#amc-fjstype) + + + diff --git a/txt/ssimdb/dmmeta/kafka_type_kind.md b/txt/ssimdb/dmmeta/kafka_type_kind.md new file mode 100644 index 00000000..3decbf1a --- /dev/null +++ b/txt/ssimdb/dmmeta/kafka_type_kind.md @@ -0,0 +1,26 @@ +## dmmeta.kafka_type_kind - + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dmmeta.KafkaTypeKind + +* file:[data/dmmeta/kafka_type_kind.ssim](/data/dmmeta/kafka_type_kind.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|kafka_type_kind|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Related + + +These ssimfiles reference dmmeta.kafka_type_kind + +* [dmmeta.ckafka via kind](/txt/ssimdb/dmmeta/ckafka.md) - + + + diff --git a/txt/ssimdb/dmmeta/logcat.md b/txt/ssimdb/dmmeta/logcat.md index b6ad7f7c..ad82faed 100644 --- a/txt/ssimdb/dmmeta/logcat.md +++ b/txt/ssimdb/dmmeta/logcat.md @@ -13,6 +13,9 @@ |logcat|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| |enabled|bool|[Val](/txt/exe/amc/reftypes.md#val)||| |builtin|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|stdout|bool|[Val](/txt/exe/amc/reftypes.md#val)||| +|maxmsg|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|| +|window|i32|[Val](/txt/exe/amc/reftypes.md#val)|0|| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| diff --git a/txt/ssimdb/dmmeta/msgtype.md b/txt/ssimdb/dmmeta/msgtype.md index 9dbce5d8..9096e213 100644 --- a/txt/ssimdb/dmmeta/msgtype.md +++ b/txt/ssimdb/dmmeta/msgtype.md @@ -19,6 +19,7 @@ +* [acr_ed](/txt/exe/acr_ed/internals.md) as [acr_ed.FMsgtype](/txt/exe/acr_ed/internals.md#acr_ed-fmsgtype) * [amc](/txt/exe/amc/internals.md) as [amc.FMsgtype](/txt/exe/amc/internals.md#amc-fmsgtype) diff --git a/txt/ssimdb/dmmeta/ns.md b/txt/ssimdb/dmmeta/ns.md index 6c708b6b..f54c50ef 100644 --- a/txt/ssimdb/dmmeta/ns.md +++ b/txt/ssimdb/dmmeta/ns.md @@ -22,11 +22,13 @@ These ssimfiles are subsets of dmmeta.ns +* [amsdb.Proctype](/txt/ssimdb/amsdb/proctype.md) - * [dev.Target](/txt/ssimdb/dev/target.md) - Build target * [dmmeta.Main](/txt/ssimdb/dmmeta/main.md) - Generate Main function for namespace * [dmmeta.Nscpp](/txt/ssimdb/dmmeta/nscpp.md) - Generate C++ code for this namespace * [dmmeta.Nsdb](/txt/ssimdb/dmmeta/nsdb.md) - Annotate ssimdb namespaces * [dmmeta.Nsfast](/txt/ssimdb/dmmeta/nsfast.md) - Whether namespace is FAST +* [dmmeta.Nsjs](/txt/ssimdb/dmmeta/nsjs.md) - Generate JavaScript code for this namespace * [dmmeta.Nsproto](/txt/ssimdb/dmmeta/nsproto.md) - Annotate protocol namespace (collection of types, no state) * [dmmeta.Nsversion](/txt/ssimdb/dmmeta/nsversion.md) - Namespace version * [dmmeta.Nsx](/txt/ssimdb/dmmeta/nsx.md) - Control code-generation and exception handling options for process/library @@ -40,7 +42,7 @@ These ssimfiles reference dmmeta.ns * [amsdb.proctype via ns](/txt/ssimdb/amsdb/proctype.md) - * [atfdb.comptest via target](/txt/ssimdb/atfdb/comptest.md) - -* [atfdb.unittest via target](/txt/ssimdb/atfdb/unittest.md) - +* [atfdb.unittest via ns](/txt/ssimdb/atfdb/unittest.md) - * [dmmeta.ctype via ns](/txt/ssimdb/dmmeta/ctype.md) - Parent namespace * [dmmeta.dispatch via ns](/txt/ssimdb/dmmeta/dispatch.md) - Parent namespace * [dmmeta.dispsig via ns](/txt/ssimdb/dmmeta/dispsig.md) - Cryptographic signature of all dispatches @@ -68,6 +70,7 @@ These ssimfiles reference dmmeta.ns * [abt_md -ns](/txt/exe/abt_md/README.md) - (overrides -readme) Process readmes for this namespace * [acr_in -ns](/txt/exe/acr_in/README.md) - Regx of matching namespace * [apm -ns](/txt/exe/apm/README.md) - Operate on specified namespace only +* [aqlite -ns](/txt/exe/aqlite/README.md) - Regx of databases to attach diff --git a/txt/ssimdb/dmmeta/nsjs.md b/txt/ssimdb/dmmeta/nsjs.md new file mode 100644 index 00000000..a2e9d21c --- /dev/null +++ b/txt/ssimdb/dmmeta/nsjs.md @@ -0,0 +1,27 @@ +## dmmeta.nsjs - Generate JavaScript code for this namespace + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dmmeta.Nsjs + +* file:[data/dmmeta/nsjs.ssim](/data/dmmeta/nsjs.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|ns|[dmmeta.Ns](/txt/ssimdb/dmmeta/ns.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| +|typescript|bool|[Val](/txt/exe/amc/reftypes.md#val)||Generate typescript| +|gensel|bool|[Val](/txt/exe/amc/reftypes.md#val)||Generate selected, false-all| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Used In Executables + + + +* [amc](/txt/exe/amc/internals.md) as [amc.FNsjs](/txt/exe/amc/internals.md#amc-fnsjs) + + + diff --git a/txt/ssimdb/dmmeta/pmaskfld_member.md b/txt/ssimdb/dmmeta/pmaskfld_member.md index 7dfc14a2..4e43859e 100644 --- a/txt/ssimdb/dmmeta/pmaskfld_member.md +++ b/txt/ssimdb/dmmeta/pmaskfld_member.md @@ -21,7 +21,7 @@ italicised fields: *pmaskfld, field* are [**fldfunc**](/txt/ssim.md#fldfunc) fie |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|pmaskfld_member|[algo.Smallstr100](/txt/protocol/algo/README.md#algo-smallstr100)|[Val](/txt/exe/amc/reftypes.md#val)||| +|pmaskfld_member|[algo.Smallstr200](/txt/protocol/algo/README.md#algo-smallstr200)|[Val](/txt/exe/amc/reftypes.md#val)||| |*pmaskfld*|*[dmmeta.Pmaskfld](/txt/ssimdb/dmmeta/pmaskfld.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*
/RL of pmaskfld_member*| |*field*|*[dmmeta.Field](/txt/ssimdb/dmmeta/field.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*
/RR of pmaskfld_member*| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| diff --git a/txt/ssimdb/dmmeta/ptrary.md b/txt/ssimdb/dmmeta/ptrary.md index 3ba0975c..e43bb7c5 100644 --- a/txt/ssimdb/dmmeta/ptrary.md +++ b/txt/ssimdb/dmmeta/ptrary.md @@ -75,6 +75,7 @@ inline atf_amc::FCascdel& c_child_ptrary_qLast(atf_amc::FCascdel& cascdel) __att |---|---|---|---|---| |field|[dmmeta.Field](/txt/ssimdb/dmmeta/field.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| |unique|bool|[Val](/txt/exe/amc/reftypes.md#val)||Search for and ignore duplicates| +|heaplike|bool|[Val](/txt/exe/amc/reftypes.md#val)||| diff --git a/txt/ssimdb/dmmeta/steptype.md b/txt/ssimdb/dmmeta/steptype.md index 4a44476e..83509849 100644 --- a/txt/ssimdb/dmmeta/steptype.md +++ b/txt/ssimdb/dmmeta/steptype.md @@ -5,12 +5,13 @@ List of supported step types ``` inline-command: acr steptype | ssimfilt ^ -t STEPTYPE COMMENT -Callback Check field on every scheduler cycle; Does not update _db.next_loop -Extern -Inline Check field on every scheduler cycle -InlineOnce Check timeout field on every scheduler cycle; Do not reschedule -InlineRecur Check timeout field on every scheduler cycle; reschedule with delay -TimeHookRecur Bheap version of InlineRecur +Callback Inline, call step func always; Does not update _db.next_loop, does not affect hot polling +Extern User provides scheduling by implementing _FirstChanged. +Inline Inline, call step func always +InlineOnce Inline, call step func at given time (time is given by first elemement of index) +InlineRecur Inline, call step func with given periodicity +TimeHookOnce TimeHook, call step func at given time (time is given by first elemement of index) +TimeHookRecur TimeHook, call step func with given periodicity ``` @@ -37,3 +38,11 @@ These ssimfiles reference dmmeta.steptype +### Used In Executables + + + +* [amc](/txt/exe/amc/internals.md) as [amc.FSteptype](/txt/exe/amc/internals.md#amc-fsteptype) + + + diff --git a/txt/ssimdb/dmmeta/userfunc.md b/txt/ssimdb/dmmeta/userfunc.md new file mode 100644 index 00000000..a06d2cac --- /dev/null +++ b/txt/ssimdb/dmmeta/userfunc.md @@ -0,0 +1,28 @@ +## dmmeta.userfunc - + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)dmmeta.Userfunc + +* file:[data/dmmeta/userfunc.ssim](/data/dmmeta/userfunc.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|userfunc|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|acrkey|[algo.Smallstr200](/txt/protocol/algo/README.md#algo-smallstr200)|[Val](/txt/exe/amc/reftypes.md#val)||| +|cppname|[algo.Smallstr100](/txt/protocol/algo/README.md#algo-smallstr100)|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Used In Executables + + + +* [amc](/txt/exe/amc/internals.md) as [amc.FUserfunc](/txt/exe/amc/internals.md#amc-fuserfunc) +* [src_func](/txt/exe/src_func/internals.md) as [src_func.FUserfunc](/txt/exe/src_func/internals.md#src_func-fuserfunc) + + + diff --git a/txt/ssimdb/gclidb/README.md b/txt/ssimdb/gclidb/README.md index 783c3935..2671d4ce 100644 --- a/txt/ssimdb/gclidb/README.md +++ b/txt/ssimdb/gclidb/README.md @@ -7,7 +7,7 @@ 📄 [gclidb.gact - Action that may be performed on a table](/txt/ssimdb/gclidb/gact.md)
📄 [gclidb.gatv -](/txt/ssimdb/gclidb/gatv.md)
-📄 [gclidb.gclicmd -](/txt/ssimdb/gclidb/gclicmd.md)
+📄 [gclidb.gclicmd - table of static gcli commands](/txt/ssimdb/gclidb/gclicmd.md)
📄 [gclidb.gclicmdf2j - Mapping of internal fields to JSON fields for gitlab/github](/txt/ssimdb/gclidb/gclicmdf2j.md)
📄 [gclidb.gclicmdt - Internal test](/txt/ssimdb/gclidb/gclicmdt.md)
📄 [gclidb.gclienv -](/txt/ssimdb/gclidb/gclienv.md)
@@ -17,12 +17,10 @@ 📄 [gclidb.githost -](/txt/ssimdb/gclidb/githost.md)
📄 [gclidb.gmethod - HTTP method list](/txt/ssimdb/gclidb/gmethod.md)
📄 [gclidb.grepo - Repo table (acr grepo -in ~/.ssim)](/txt/ssimdb/gclidb/grepo.md)
-📄 [gclidb.grepogitport - Default ports for repositories](/txt/ssimdb/gclidb/grepogitport.md)
-📄 [gclidb.grepossh - Ssh key table](/txt/ssimdb/gclidb/grepossh.md)
📄 [gclidb.gstate - Issue/MR state list](/txt/ssimdb/gclidb/gstate.md)
📄 [gclidb.gstatet - Internal](/txt/ssimdb/gclidb/gstatet.md)
📄 [gclidb.gtbl - Supported gcli tables](/txt/ssimdb/gclidb/gtbl.md)
-📄 [gclidb.gtblact -](/txt/ssimdb/gclidb/gtblact.md)
+📄 [gclidb.gtblact - static combination of gcli tables and actions](/txt/ssimdb/gclidb/gtblact.md)
📄 [gclidb.gtblactfld - List of available for each table & action combination](/txt/ssimdb/gclidb/gtblactfld.md)
📄 [gclidb.gtblacttst -](/txt/ssimdb/gclidb/gtblacttst.md)
📄 [gclidb.gtblacttstout -](/txt/ssimdb/gclidb/gtblacttstout.md)
diff --git a/txt/ssimdb/gclidb/gact.md b/txt/ssimdb/gclidb/gact.md index 3ed567e6..02d51899 100644 --- a/txt/ssimdb/gclidb/gact.md +++ b/txt/ssimdb/gclidb/gact.md @@ -20,7 +20,7 @@ These ssimfiles reference gclidb.gact -* [gclidb.gtblact via gact](/txt/ssimdb/gclidb/gtblact.md) - +* [gclidb.gtblact via gact](/txt/ssimdb/gclidb/gtblact.md) - static combination of gcli tables and actions diff --git a/txt/ssimdb/gclidb/gclicmd.md b/txt/ssimdb/gclidb/gclicmd.md index 0e045894..947530fe 100644 --- a/txt/ssimdb/gclidb/gclicmd.md +++ b/txt/ssimdb/gclidb/gclicmd.md @@ -1,4 +1,4 @@ -## gclidb.gclicmd - +## gclidb.gclicmd - table of static gcli commands ### Attributes @@ -10,7 +10,7 @@ |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|gclicmd|[algo.Smallstr250](/txt/protocol/algo/README.md#algo-smallstr250)|[Val](/txt/exe/amc/reftypes.md#val)||| +|gclicmd|[algo.Smallstr250](/txt/protocol/algo/README.md#algo-smallstr250)|[Val](/txt/exe/amc/reftypes.md#val)||table of static commands| |gclicmdf2j|[gclidb.Gclicmd](/txt/ssimdb/gclidb/gclicmd.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||Base for gclicmdf2j| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| diff --git a/txt/ssimdb/gclidb/grepossh.md b/txt/ssimdb/gclidb/grepossh.md deleted file mode 100644 index adaaf865..00000000 --- a/txt/ssimdb/gclidb/grepossh.md +++ /dev/null @@ -1,29 +0,0 @@ -## gclidb.grepossh - Ssh key table - - -### Attributes - - -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)gclidb.Grepossh - -* file:[data/gclidb/grepossh.ssim](/data/gclidb/grepossh.ssim) - -italicised fields: *name* are [**fldfunc**](/txt/ssim.md#fldfunc) fields - -|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| -|---|---|---|---|---| -|grepossh|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||grepo project/repo name| -|sshid|[dev.Gitfile](/txt/ssimdb/dev/gitfile.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||ssh id key name for ssh config| -|*name*|*[algo.cstring](/txt/protocol/algo/cstring.md)*|*[Val](/txt/exe/amc/reftypes.md#val)*||*ssh id key name for ssh config
/RR of sshid*| -|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| - - - -### Used In Executables - - - -* [gcli](/txt/exe/gcli/internals.md) as [gcli.FGrepossh](/txt/exe/gcli/internals.md#gcli-fgrepossh) - - - diff --git a/txt/ssimdb/gclidb/gtbl.md b/txt/ssimdb/gclidb/gtbl.md index 653aa60d..04086c80 100644 --- a/txt/ssimdb/gclidb/gtbl.md +++ b/txt/ssimdb/gclidb/gtbl.md @@ -20,7 +20,7 @@ These ssimfiles reference gclidb.gtbl -* [gclidb.gtblact via gtbl](/txt/ssimdb/gclidb/gtblact.md) - +* [gclidb.gtblact via gtbl](/txt/ssimdb/gclidb/gtblact.md) - static combination of gcli tables and actions diff --git a/txt/ssimdb/gclidb/gtblact.md b/txt/ssimdb/gclidb/gtblact.md index 66e55fc2..4a981bbb 100644 --- a/txt/ssimdb/gclidb/gtblact.md +++ b/txt/ssimdb/gclidb/gtblact.md @@ -1,4 +1,4 @@ -## gclidb.gtblact - +## gclidb.gtblact - static combination of gcli tables and actions ### Attributes diff --git a/txt/ssimdb/httpdb/README.md b/txt/ssimdb/httpdb/README.md new file mode 100644 index 00000000..ddb8b76e --- /dev/null +++ b/txt/ssimdb/httpdb/README.md @@ -0,0 +1,17 @@ +## httpdb - + + +### Table Of Contents + + + +📄 [httpdb.content - core/common Content-Type values](/txt/ssimdb/httpdb/content.md)
+📄 [httpdb.header -](/txt/ssimdb/httpdb/header.md)
+📄 [httpdb.method -](/txt/ssimdb/httpdb/method.md)
+📄 [httpdb.status -](/txt/ssimdb/httpdb/status.md)
+📄 [httpdb.version -](/txt/ssimdb/httpdb/version.md)
+ + + + + diff --git a/txt/ssimdb/httpdb/content.md b/txt/ssimdb/httpdb/content.md new file mode 100644 index 00000000..06b1e4a6 --- /dev/null +++ b/txt/ssimdb/httpdb/content.md @@ -0,0 +1,17 @@ +## httpdb.content - core/common Content-Type values + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)httpdb.Content + +* file:[data/httpdb/content.ssim](/data/httpdb/content.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|content|[algo.Smallstr250](/txt/protocol/algo/README.md#algo-smallstr250)|[Val](/txt/exe/amc/reftypes.md#val)||| +|description|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + diff --git a/txt/ssimdb/httpdb/header.md b/txt/ssimdb/httpdb/header.md new file mode 100644 index 00000000..c14d03b5 --- /dev/null +++ b/txt/ssimdb/httpdb/header.md @@ -0,0 +1,17 @@ +## httpdb.header - + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)httpdb.Header + +* file:[data/httpdb/header.ssim](/data/httpdb/header.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|header|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + diff --git a/txt/ssimdb/httpdb/method.md b/txt/ssimdb/httpdb/method.md new file mode 100644 index 00000000..0fa9501a --- /dev/null +++ b/txt/ssimdb/httpdb/method.md @@ -0,0 +1,18 @@ +## httpdb.method - + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)httpdb.Method + +* file:[data/httpdb/method.ssim](/data/httpdb/method.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|method|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|id|u8|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + diff --git a/txt/ssimdb/httpdb/status.md b/txt/ssimdb/httpdb/status.md new file mode 100644 index 00000000..52ad2037 --- /dev/null +++ b/txt/ssimdb/httpdb/status.md @@ -0,0 +1,28 @@ +## httpdb.status - + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)httpdb.Status + +* file:[data/httpdb/status.ssim](/data/httpdb/status.ssim) + +italicised fields: *code, reason* are [**fldfunc**](/txt/ssim.md#fldfunc) fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|status|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|*code*|*u16*|*[Val](/txt/exe/amc/reftypes.md#val)*||*
LL of status*| +|*reason*|*[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)*|*[Val](/txt/exe/amc/reftypes.md#val)*||*
LR of status*| + + + +### Used In Executables + + + +* [lib_http](/txt/lib/lib_http/README.md) as [lib_http.FStatus](/txt/lib/lib_http/README.md#lib_http-fstatus) + + + diff --git a/txt/ssimdb/httpdb/version.md b/txt/ssimdb/httpdb/version.md new file mode 100644 index 00000000..4d5ea3af --- /dev/null +++ b/txt/ssimdb/httpdb/version.md @@ -0,0 +1,17 @@ +## httpdb.version - + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)httpdb.Version + +* file:[data/httpdb/version.ssim](/data/httpdb/version.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|version|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + diff --git a/txt/ssimdb/sampdb/README.md b/txt/ssimdb/sampdb/README.md new file mode 100644 index 00000000..41952d5b --- /dev/null +++ b/txt/ssimdb/sampdb/README.md @@ -0,0 +1,17 @@ +## sampdb - ssimdb for tutorials and recipes + + +### Table Of Contents + + + +📄 [sampdb.gitfile - samp_make list of gitfile sources](/txt/ssimdb/sampdb/gitfile.md)
+📄 [sampdb.targdep - samp_make targets dependencies](/txt/ssimdb/sampdb/targdep.md)
+📄 [sampdb.target - samp_make targets list](/txt/ssimdb/sampdb/target.md)
+📄 [sampdb.targrec - samp_make recipe for a target](/txt/ssimdb/sampdb/targrec.md)
+📄 [sampdb.targsrc - samp_make targets source dependencies](/txt/ssimdb/sampdb/targsrc.md)
+ + + + + diff --git a/txt/ssimdb/sampdb/gitfile.md b/txt/ssimdb/sampdb/gitfile.md new file mode 100644 index 00000000..c446f76a --- /dev/null +++ b/txt/ssimdb/sampdb/gitfile.md @@ -0,0 +1,34 @@ +## sampdb.gitfile - samp_make list of gitfile sources + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)sampdb.Gitfile + +* file:[data/sampdb/gitfile.ssim](/data/sampdb/gitfile.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|gitfile|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Related + + +These ssimfiles reference sampdb.gitfile + +* [sampdb.targsrc via src](/txt/ssimdb/sampdb/targsrc.md) - samp_make targets source dependencies + + + +### Used In Executables + + + +* [samp_make](/txt/exe/samp_make/internals.md) as [samp_make.FGitfile](/txt/exe/samp_make/internals.md#samp_make-fgitfile) + + + diff --git a/txt/ssimdb/sampdb/targdep.md b/txt/ssimdb/sampdb/targdep.md new file mode 100644 index 00000000..94862a92 --- /dev/null +++ b/txt/ssimdb/sampdb/targdep.md @@ -0,0 +1,31 @@ +## sampdb.targdep - samp_make targets dependencies + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)sampdb.Targdep + +* file:[data/sampdb/targdep.ssim](/data/sampdb/targdep.ssim) + +italicised fields: *target, parent* are [**fldfunc**](/txt/ssim.md#fldfunc) fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|targdep|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|*target*|*[sampdb.Target](/txt/ssimdb/sampdb/target.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*Child target
.LL of targdep*| +|*parent*|*[sampdb.Target](/txt/ssimdb/sampdb/target.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*Parent target
.LR of targdep*| +|rec|bool|[Val](/txt/exe/amc/reftypes.md#val)||use in recipe| +|pre|bool|[Val](/txt/exe/amc/reftypes.md#val)||use in prerequisite| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Used In Executables + + + +* [samp_make](/txt/exe/samp_make/internals.md) as [samp_make.FTargdep](/txt/exe/samp_make/internals.md#samp_make-ftargdep) + + + diff --git a/txt/ssimdb/sampdb/target.md b/txt/ssimdb/sampdb/target.md new file mode 100644 index 00000000..8f5b1cb4 --- /dev/null +++ b/txt/ssimdb/sampdb/target.md @@ -0,0 +1,54 @@ +## sampdb.target - samp_make targets list + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)sampdb.Target + +* file:[data/sampdb/target.ssim](/data/sampdb/target.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|target|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|dflt|bool|[Val](/txt/exe/amc/reftypes.md#val)||make first target - default target| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Subsets + + +These ssimfiles are subsets of sampdb.target + +* [sampdb.Targrec](/txt/ssimdb/sampdb/targrec.md) - samp_make recipe for a target + + + +### Related + + +These ssimfiles reference sampdb.target + +* [sampdb.targdep via target](/txt/ssimdb/sampdb/targdep.md) - Child target +* [sampdb.targdep via parent](/txt/ssimdb/sampdb/targdep.md) - Parent target +* [sampdb.targsrc via target](/txt/ssimdb/sampdb/targsrc.md) - samp_make targets source dependencies + + + +### Used In Commands + + + +* [samp_make -target](/txt/exe/samp_make/README.md) - Create Makefile for selected targets + + + +### Used In Executables + + + +* [samp_make](/txt/exe/samp_make/internals.md) as [samp_make.FTarget](/txt/exe/samp_make/internals.md#samp_make-ftarget) + + + diff --git a/txt/ssimdb/amsdb/streamtype.md b/txt/ssimdb/sampdb/targrec.md similarity index 58% rename from txt/ssimdb/amsdb/streamtype.md rename to txt/ssimdb/sampdb/targrec.md index 6b60a8f2..373b768c 100644 --- a/txt/ssimdb/amsdb/streamtype.md +++ b/txt/ssimdb/sampdb/targrec.md @@ -1,17 +1,17 @@ -## amsdb.streamtype - +## sampdb.targrec - samp_make recipe for a target ### Attributes -* [ctype:](/txt/ssimdb/dmmeta/ctype.md)amsdb.StreamType +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)sampdb.Targrec -* file:[data/amsdb/streamtype.ssim](/data/amsdb/streamtype.ssim) +* file:[data/sampdb/targrec.ssim](/data/sampdb/targrec.ssim) |Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| |---|---|---|---|---| -|streamtype|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| -|id|[ams.StreamType](/txt/protocol/ams/StreamType.md)|[Val](/txt/exe/amc/reftypes.md#val)||| +|target|[sampdb.Target](/txt/ssimdb/sampdb/target.md)|[Pkey](/txt/exe/amc/reftypes.md#pkey)||| +|recipe|[algo.cstring](/txt/protocol/algo/cstring.md)|[Val](/txt/exe/amc/reftypes.md#val)||| |comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| @@ -20,7 +20,7 @@ -* [lib_ams](/txt/lib/lib_ams/README.md) as [lib_ams.FStreamType](/txt/lib/lib_ams/README.md#lib_ams-fstreamtype) +* [samp_make](/txt/exe/samp_make/internals.md) as [samp_make.FTargrec](/txt/exe/samp_make/internals.md#samp_make-ftargrec) diff --git a/txt/ssimdb/sampdb/targsrc.md b/txt/ssimdb/sampdb/targsrc.md new file mode 100644 index 00000000..984b04a1 --- /dev/null +++ b/txt/ssimdb/sampdb/targsrc.md @@ -0,0 +1,31 @@ +## sampdb.targsrc - samp_make targets source dependencies + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)sampdb.Targsrc + +* file:[data/sampdb/targsrc.ssim](/data/sampdb/targsrc.ssim) + +italicised fields: *target, src* are [**fldfunc**](/txt/ssim.md#fldfunc) fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|targsrc|[algo.Smallstr50](/txt/protocol/algo/README.md#algo-smallstr50)|[Val](/txt/exe/amc/reftypes.md#val)||| +|pre|bool|[Val](/txt/exe/amc/reftypes.md#val)||use in prerequisite| +|*target*|*[sampdb.Target](/txt/ssimdb/sampdb/target.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*
/LL of targsrc*| +|*src*|*[sampdb.Gitfile](/txt/ssimdb/sampdb/gitfile.md)*|*[Pkey](/txt/exe/amc/reftypes.md#pkey)*||*
/LR of targsrc*| +|rec|bool|[Val](/txt/exe/amc/reftypes.md#val)||use in recipe| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + +### Used In Executables + + + +* [samp_make](/txt/exe/samp_make/internals.md) as [samp_make.FTargsrc](/txt/exe/samp_make/internals.md#samp_make-ftargsrc) + + + diff --git a/txt/ssimdb/wsdb/README.md b/txt/ssimdb/wsdb/README.md new file mode 100644 index 00000000..3cd553f5 --- /dev/null +++ b/txt/ssimdb/wsdb/README.md @@ -0,0 +1,13 @@ +## wsdb - WebSocket db + + +### Table Of Contents + + + +📄 [wsdb.status -](/txt/ssimdb/wsdb/status.md)
+ + + + + diff --git a/txt/ssimdb/wsdb/status.md b/txt/ssimdb/wsdb/status.md new file mode 100644 index 00000000..ee350708 --- /dev/null +++ b/txt/ssimdb/wsdb/status.md @@ -0,0 +1,19 @@ +## wsdb.status - + + +### Attributes + + +* [ctype:](/txt/ssimdb/dmmeta/ctype.md)wsdb.Status + +* file:[data/wsdb/status.ssim](/data/wsdb/status.ssim) + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|code|u32|[Val](/txt/exe/amc/reftypes.md#val)||Status code| +|reason|[algo.Smallstr32](/txt/protocol/algo/README.md#algo-smallstr32)|[Val](/txt/exe/amc/reftypes.md#val)||Status reason| +|local_only|bool|[Val](/txt/exe/amc/reftypes.md#val)||Never sent on close frame, use locally| +|comment|[algo.Comment](/txt/protocol/algo/Comment.md)|[Val](/txt/exe/amc/reftypes.md#val)||| + + + diff --git a/txt/tut/README.md b/txt/tut/README.md index 41a7c50a..82e47beb 100644 --- a/txt/tut/README.md +++ b/txt/tut/README.md @@ -13,6 +13,7 @@ 📄 [Iohook & Fbuf](/txt/tut/tut6.md)
📄 [Tests](/txt/tut/tut7.md)
📄 [tut8 - ACR live tutorial](/txt/tut/tut8.md)
+📄 [Tutorial on transitioning from Makefile to OpenACR build](/txt/tut/tut9_make.md)
diff --git a/txt/tut/tut1.md b/txt/tut/tut1.md index e64bb7ea..5e16910c 100644 --- a/txt/tut/tut1.md +++ b/txt/tut/tut1.md @@ -20,7 +20,7 @@ CI by running it in a sandbox Step 1: Create new target. ``` -inline-command: acr_ed -create -target samp_tut1 -write +inline-command: acr_ed -create -target samp_tut1 -write -amc:N acr_ed.create_target target:samp_tut1 report.acr_check records:*** errors:0 acr.insert dev.gitfile gitfile:bin/samp_tut1 @@ -30,10 +30,10 @@ acr.insert dev.gitfile gitfile:include/gen/samp_tut1_gen.h acr.insert dev.gitfile gitfile:include/gen/samp_tut1_gen.inl.h acr.insert dev.gitfile gitfile:include/samp_tut1.h acr.insert dev.gitfile gitfile:txt/exe/samp_tut1/README.md - acr.insert dev.readme gitfile:txt/exe/samp_tut1/README.md inl:N sandbox:N filter:"" comment:"" + acr.insert dev.readmefile gitfile:txt/exe/samp_tut1/README.md inl:N sandbox:N filter:"" comment:"" acr.insert dev.gitfile gitfile:txt/exe/samp_tut1/internals.md - acr.insert dev.readme gitfile:txt/exe/samp_tut1/internals.md inl:N sandbox:N filter:"" comment:"" + acr.insert dev.readmefile gitfile:txt/exe/samp_tut1/internals.md inl:N sandbox:N filter:"" comment:"" acr.insert dmmeta.ns ns:samp_tut1 nstype:exe license:GPL comment:"" acr.insert dev.target target:samp_tut1 @@ -61,16 +61,15 @@ acr.insert dmmeta.ctype ctype:command.samp_tut1 comment:"" acr.insert dmmeta.cfmt cfmt:command.samp_tut1.Argv printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** -abt.config builddir:*** ood_src:*** ood_target:*** cache:*** +abt.config builddir:Linux-g++.release-x86_64 ood_src:*** ood_target:*** cache:*** report.abt n_target:*** time:*** hitrate:*** pch_hitrate:*** n_warn:0 n_err:0 n_install:*** please execute $(acr_compl -install) to add completions support for new target -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` Step 2: Define data structures for samp_tut1 ``` -inline-command: acr_ed -create -ctype samp_tut1.Proj -pooltype Tpool -indexed -write +inline-command: acr_ed -create -ctype samp_tut1.Proj -pooltype Tpool -indexed -write -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.ctype ctype:samp_tut1.Proj comment:"" acr.insert dmmeta.field field:samp_tut1.Proj.proj arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" @@ -80,11 +79,10 @@ acr.insert dmmeta.field field:samp_tut1.FDb.ind_proj arg:samp_tut1.Proj reft acr.insert dmmeta.thash field:samp_tut1.FDb.ind_proj hashfld:samp_tut1.Proj.proj unique:Y comment:"" acr.insert dmmeta.xref field:samp_tut1.FDb.ind_proj inscond:true via:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` ``` -inline-command: acr_ed -create -ctype samp_tut1.Part -pooltype Tpool -indexed -write +inline-command: acr_ed -create -ctype samp_tut1.Part -pooltype Tpool -indexed -write -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.ctype ctype:samp_tut1.Part comment:"" acr.insert dmmeta.field field:samp_tut1.Part.part arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" @@ -94,37 +92,33 @@ acr.insert dmmeta.field field:samp_tut1.FDb.ind_part arg:samp_tut1.Part reft acr.insert dmmeta.thash field:samp_tut1.FDb.ind_part hashfld:samp_tut1.Part.part unique:Y comment:"" acr.insert dmmeta.xref field:samp_tut1.FDb.ind_part inscond:true via:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` ``` -inline-command: acr_ed -create -ctype samp_tut1.Partproj -pooltype Tpool -write +inline-command: acr_ed -create -ctype samp_tut1.Partproj -pooltype Tpool -write -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.ctype ctype:samp_tut1.Partproj comment:"" acr.insert dmmeta.field field:samp_tut1.FDb.partproj arg:samp_tut1.Partproj reftype:Tpool dflt:"" comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` Step 3: Create reference fields. The first field is a pointer from Partproj to Part ``` -inline-command: acr_ed -create -field samp_tut1.Partproj.p_part -arg samp_tut1.Part -reftype Upptr -write +inline-command: acr_ed -create -field samp_tut1.Partproj.p_part -arg samp_tut1.Part -reftype Upptr -write -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.field field:samp_tut1.Partproj.p_part arg:samp_tut1.Part reftype:Upptr dflt:"" comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` The second field is a pointer from Partproj to Proj ``` -inline-command: acr_ed -create -field samp_tut1.Partproj.p_proj -arg samp_tut1.Proj -reftype Upptr -write +inline-command: acr_ed -create -field samp_tut1.Partproj.p_proj -arg samp_tut1.Proj -reftype Upptr -write -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.field field:samp_tut1.Partproj.p_proj arg:samp_tut1.Proj reftype:Upptr dflt:"" comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` Step 4: Create x-reference (cross reference) fields. @@ -134,43 +128,40 @@ A cross reference is a synonym for an index. First, let's create two global lists so we can scan projects and parts: ``` -inline-command: acr_ed -create -field samp_tut1.FDb.zd_part -write -comment "List of all parts" +inline-command: acr_ed -create -field samp_tut1.FDb.zd_part -write -comment "List of all parts" -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.field field:samp_tut1.FDb.zd_part arg:samp_tut1.Part reftype:Llist dflt:"" comment:"List of all parts" acr.insert dmmeta.llist field:samp_tut1.FDb.zd_part havetail:Y havecount:Y comment:"" acr.insert dmmeta.xref field:samp_tut1.FDb.zd_part inscond:true via:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` ``` -inline-command: acr_ed -create -field samp_tut1.FDb.zd_proj -write -comment "List of all projects" +inline-command: acr_ed -create -field samp_tut1.FDb.zd_proj -write -comment "List of all projects" -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.field field:samp_tut1.FDb.zd_proj arg:samp_tut1.Proj reftype:Llist dflt:"" comment:"List of all projects" acr.insert dmmeta.llist field:samp_tut1.FDb.zd_proj havetail:Y havecount:Y comment:"" acr.insert dmmeta.xref field:samp_tut1.FDb.zd_proj inscond:true via:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` Second, let's add group-bys. The first is a pointer from Part to Partproj that is initialized in response to a new Partproj being created. A part can only be used in one project, so it's a pointer. ``` -inline-command: acr_ed -create -field samp_tut1.Part.c_partproj -reftype Ptr -cascdel -write -comment "List of projects by part" +inline-command: acr_ed -create -field samp_tut1.Part.c_partproj -reftype Ptr -cascdel -write -comment "List of projects by part" -amc:N acr_ed.via_match1 child:samp_tut1.Partproj.p_part comment:"This child field is a possible via key candidate" report.acr_check records:*** errors:0 acr.insert dmmeta.field field:samp_tut1.Part.c_partproj arg:samp_tut1.Partproj reftype:Ptr dflt:"" comment:"List of projects by part" acr.insert dmmeta.cascdel field:samp_tut1.Part.c_partproj comment:"" acr.insert dmmeta.xref field:samp_tut1.Part.c_partproj inscond:true via:samp_tut1.Partproj.p_part report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` The second cross-reference is a doubly linked, zero-terminated list of Partprojs by Proj. ``` -inline-command: acr_ed -create -field samp_tut1.Proj.zd_partproj -cascdel -write -comment "List of parts by project" +inline-command: acr_ed -create -field samp_tut1.Proj.zd_partproj -cascdel -write -comment "List of parts by project" -amc:N acr_ed.via_match1 child:samp_tut1.Partproj.p_proj comment:"This child field is a possible via key candidate" report.acr_check records:*** errors:0 acr.insert dmmeta.field field:samp_tut1.Proj.zd_partproj arg:samp_tut1.Partproj reftype:Llist dflt:"" comment:"List of parts by project" @@ -178,7 +169,6 @@ acr.insert dmmeta.field field:samp_tut1.Proj.zd_partproj arg:samp_tut1.Partpr acr.insert dmmeta.llist field:samp_tut1.Proj.zd_partproj havetail:Y havecount:Y comment:"" acr.insert dmmeta.xref field:samp_tut1.Proj.zd_partproj inscond:true via:samp_tut1.Partproj.p_proj report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` Step 5: Enter the program text in cpp/samp_tut1.cpp: @@ -287,8 +277,9 @@ inline-command: cp conf/samp_tut1.txt cpp/samp_tut1/samp_tut1.cpp And build samp_tut1: ``` -inline-command: ai samp_tut1 -abt.config builddir:*** ood_src:*** ood_target:*** cache:*** +inline-command: amc && ai samp_tut1 +report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** +abt.config builddir:Linux-g++.release-x86_64 ood_src:*** ood_target:*** cache:*** report.abt n_target:*** time:*** hitrate:*** pch_hitrate:*** n_warn:0 n_err:0 n_install:*** ``` @@ -353,30 +344,22 @@ in the in-memory database of `samp_tut1` ``` inline-command: amc_vis samp_tut1.% - - - / samp_tut1.FDb - | - |Tpool proj---------->/ samp_tut1.Proj - |Thash ind_proj------>| - |Llist zd_proj------->| - | | - |Tpool part-----------|------------------->/ samp_tut1.Part - |Thash ind_part-------|------------------->| - |Llist zd_part--------|------------------->| - | | | - |Tpool partproj-------|--------------------|---------------->/ samp_tut1.Partproj - - | | | - | | | - |<-------------------|-----------------|Upptr p_proj - | |<----------------|Upptr p_part - |Llist zd_partproj---|---------------->| - - | | - | | - |Ptr c_partproj-->| - - | - | - - +/ samp_tut1.FDb +|Tpool proj------>/ samp_tut1.Proj +|Thash ind_proj-->| +|Llist zd_proj--->| +|Tpool part-------|------------------->/ samp_tut1.Part +|Thash ind_part---|------------------->| +|Llist zd_part----|------------------->| +|Tpool partproj---|--------------------|---------------->/ samp_tut1.Partproj +- | | | + |<-------------------|-----------------|Upptr p_proj + | |<----------------|Upptr p_part + |Llist zd_partproj---|---------------->| + | |Ptr c_partproj-->| + - | | + | - + - ``` ### Generated Code @@ -402,7 +385,7 @@ When creating this tutorial, we accidentally introduced unnecessary (and unused) `samp_tut1.FDb.ind_proj` and `samp_tut1.FDb.ind_part`. We can easily delete them: ``` -inline-command: acr_ed -del -field samp_tut1.FDb.ind_proj -write +inline-command: acr_ed -del -field samp_tut1.FDb.ind_proj -write -amc:N report.acr_check records:*** errors:0 report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** acr.delete dmmeta.field field:samp_tut1.FDb.ind_proj arg:samp_tut1.Proj reftype:Thash dflt:"" comment:"" @@ -411,11 +394,10 @@ acr.delete dmmeta.thash field:samp_tut1.FDb.ind_proj hashfld:samp_tut1.Proj.p acr.delete dmmeta.xref field:samp_tut1.FDb.ind_proj inscond:true via:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` ``` -inline-command: acr_ed -del -field samp_tut1.FDb.ind_part -write +inline-command: acr_ed -del -field samp_tut1.FDb.ind_part -write -amc:N report.acr_check records:*** errors:0 report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** acr.delete dmmeta.field field:samp_tut1.FDb.ind_part arg:samp_tut1.Part reftype:Thash dflt:"" comment:"" @@ -424,7 +406,6 @@ acr.delete dmmeta.thash field:samp_tut1.FDb.ind_part hashfld:samp_tut1.Part.p acr.delete dmmeta.xref field:samp_tut1.FDb.ind_part inscond:true via:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` And rebuild the tutorial. These indexes can be easily introduced later if necessary. diff --git a/txt/tut/tut3.md b/txt/tut/tut3.md index df7c05c2..baef05d3 100644 --- a/txt/tut/tut3.md +++ b/txt/tut/tut3.md @@ -35,10 +35,10 @@ acr.insert dev.gitfile gitfile:include/gen/samp_tut3_gen.h acr.insert dev.gitfile gitfile:include/gen/samp_tut3_gen.inl.h acr.insert dev.gitfile gitfile:include/samp_tut3.h acr.insert dev.gitfile gitfile:txt/exe/samp_tut3/README.md - acr.insert dev.readme gitfile:txt/exe/samp_tut3/README.md inl:N sandbox:N filter:"" comment:"" + acr.insert dev.readmefile gitfile:txt/exe/samp_tut3/README.md inl:N sandbox:N filter:"" comment:"" acr.insert dev.gitfile gitfile:txt/exe/samp_tut3/internals.md - acr.insert dev.readme gitfile:txt/exe/samp_tut3/internals.md inl:N sandbox:N filter:"" comment:"" + acr.insert dev.readmefile gitfile:txt/exe/samp_tut3/internals.md inl:N sandbox:N filter:"" comment:"" acr.insert dmmeta.ns ns:samp_tut3 nstype:exe license:GPL comment:"" acr.insert dev.target target:samp_tut3 @@ -66,7 +66,7 @@ acr.insert dmmeta.ctype ctype:command.samp_tut3 comment:"" acr.insert dmmeta.cfmt cfmt:command.samp_tut3.Argv printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** -abt.config builddir:*** ood_src:*** ood_target:*** cache:*** +abt.config builddir:Linux-g++.release-x86_64 ood_src:*** ood_target:*** cache:*** report.abt n_target:*** time:*** hitrate:*** pch_hitrate:*** n_warn:0 n_err:0 n_install:*** please execute $(acr_compl -install) to add completions support for new target report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** @@ -124,25 +124,23 @@ Now let's modify our app so that it prints numbers `0..10`, asynchronously, then There are many ways to do it, so we'll start with the most general one: a table. ``` -inline-command: acr_ed -create -ctype samp_tut3.Value -subset i32 -pooltype Tpool -write +inline-command: acr_ed -create -ctype samp_tut3.Value -subset i32 -pooltype Tpool -write -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.ctype ctype:samp_tut3.Value comment:"" acr.insert dmmeta.field field:samp_tut3.Value.value arg:i32 reftype:Val dflt:"" comment:"" acr.insert dmmeta.field field:samp_tut3.FDb.value arg:samp_tut3.Value reftype:Tpool dflt:"" comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` ``` -inline-command: acr_ed -create -field samp_tut3.FDb.zd_value -fstep Inline -write +inline-command: acr_ed -create -field samp_tut3.FDb.zd_value -fstep Inline -write -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.field field:samp_tut3.FDb.zd_value arg:samp_tut3.Value reftype:Llist dflt:"" comment:"" acr.insert dmmeta.llist field:samp_tut3.FDb.zd_value havetail:Y havecount:Y comment:"" acr.insert dmmeta.fstep fstep:samp_tut3.FDb.zd_value steptype:Inline comment:"" acr.insert dmmeta.xref field:samp_tut3.FDb.zd_value inscond:true via:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` The above commands, which are best practiced interactively, add the following records to our database: @@ -154,7 +152,6 @@ dmmeta.nstype nstype:exe comment:Executable dmmeta.ns ns:samp_tut3 nstype:exe license:GPL comment:"" dmmeta.ctype ctype:samp_tut3.Value comment:"" dmmeta.field field:samp_tut3.Value.value arg:i32 reftype:Val dflt:"" comment:"" - dmmeta.ctypelen ctype:samp_tut3.Value len:32 alignment:8 padbytes:4 plaindata:N dmmeta.field field:samp_tut3.FDb.value arg:samp_tut3.Value reftype:Tpool dflt:"" comment:"" dmmeta.field field:samp_tut3.FDb.zd_value arg:samp_tut3.Value reftype:Llist dflt:"" comment:"" @@ -196,8 +193,9 @@ void samp_tut3::Main() { ``` ``` -inline-command: ai samp_tut3 -abt.config builddir:*** ood_src:*** ood_target:*** cache:*** +inline-command: amc && ai samp_tut3 +report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** +abt.config builddir:Linux-g++.release-x86_64 ood_src:*** ood_target:*** cache:*** report.abt n_target:*** time:*** hitrate:*** pch_hitrate:*** n_warn:0 n_err:0 n_install:*** ``` @@ -223,8 +221,7 @@ Let's proceed slowly and understand what code got generated, and what we can do First, let's check the new `MainLoop`; ``` -inline-command: amc samp_tut3.%.MainLoop - +inline-command: src_func -gen -f samp_tut3.MainLoop // --- samp_tut3.FDb._db.MainLoop // Main loop. void samp_tut3::MainLoop() { @@ -236,32 +233,25 @@ void samp_tut3::MainLoop() { } while (algo_lib::_db.next_loop < algo_lib::_db.limit); } -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` We see that `samp_tut3::Step` is now called. That's because we defined the `fstep` record on `zd_value`. Let's drill down to `Step`: ``` -inline-command: amc samp_tut3.%.Step - +inline-command: src_func -gen -f samp_tut3.Step // --- samp_tut3.FDb._db.Step // Main step void samp_tut3::Step() { zd_value_Call(); } -// func:samp_tut3.FDb.zd_value.Step -// this function is 'extrn' and implemented by user -void zd_value_Step() __attribute__((nothrow)); -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` Almost nothing interesting here... Let's check `zd_value_Call`: ``` -inline-command: amc samp_tut3.%.zd_value.Call - +inline-command: src_func -gen -f samp_tut3.zd_value_Call // --- samp_tut3.FDb.zd_value.Call inline static void samp_tut3::zd_value_Call() { if (!samp_tut3::zd_value_EmptyQ()) { // fstep:samp_tut3.FDb.zd_value @@ -271,7 +261,6 @@ inline static void samp_tut3::zd_value_Call() { } } -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` Finally, the interesting bit. We see that the main `Step` checks to see if `zd_value` is empty. diff --git a/txt/tut/tut4.md b/txt/tut/tut4.md index 8b3364e4..cd4a13c7 100644 --- a/txt/tut/tut4.md +++ b/txt/tut/tut4.md @@ -2,11 +2,13 @@ All programs created with `amc` come with full command line support. This means that there is a standard way in which every program parses -its command line. -A command line is defined as a ctype (a struct), and options are described as fields. -The fields can be of any type, including a custom type (as usual, the notion of +its command line. And also that the command line is a regular struct and a +function for parsing it from argc/argv. +Command line options are described as fields. +The fields can be of any type, including any custom type (as usual, the notion of 'built-in' is not really relevant since pre-existing features are implemented in the -same way as new features might be). +same way as new features might be). For instance, if you defined a type and a way to read it +from string, you can use fields of that type in any command line. The command lines of *all* programs are described in the `command` namespace. Amc generates code to handle the following tasks: @@ -396,11 +398,13 @@ Here is the code amc generated for `amc_proc`: ### Verbosity -You may have noticed the use of `prlog` to print things. `prlog` is one of a few C++ macros in OpenACR. -(All macros are defined in [include/define.h]). -Along with `prlog`, there is `prerr` that prints to stderr, `verblog`, which prints only -if the command was invoked with `-v` or `-verbose`, and `dbglog`, which prints if the command was -invoked with `-d` or `-debug`. +You may have noticed the use of `prlog` to print things. `prlog` is a macro that accesses a temporary string +for formatting, so you can write `prlog(a<] [options] -in string "data" Input directory or filename, - for stdin -maxjobs int 2 Number of simultaneous jobs [ncmd] int 6 - -verbose int Verbosity level (0..255); alias -v; cumulative - -debug int Debug level (0..255); alias -d; cumulative + -verbose flag Verbosity level (0..255); alias -v; cumulative + -debug flag Debug level (0..255); alias -d; cumulative -help Print help and exit; alias -h -version Print version and exit -signature Show signatures and exit; alias -sig @@ -60,23 +60,19 @@ Here is the visualization of this structure: ``` inline-command: amc_vis atf_nrun.% - - - / atf_nrun.FDb - | - |Lary fentry-------->/ atf_nrun.FEntry - |Thash ind_running-->| - |Llist zd_todo------>| - - | - | - - +/ atf_nrun.FDb +|Lary fentry-------->/ atf_nrun.FEntry +|Thash ind_running-->| +|Llist zd_todo------>| +- | + - ``` Since this is a sample, there are no inputs. We will creates all the `FEntry` records in Main, and then enter main loop. ``` -inline-command: src_func atf_nrun Main -report:N -showloc:N +inline-command: src_func atf_nrun.Main -f void atf_nrun::Main() { struct sigaction sigact; sigact.sa_handler = SignalHandler; @@ -114,7 +110,7 @@ for it. If we have reached the maximum number of running jobs, we set the delay spawning a child process. ``` -inline-command: src_func atf_nrun zd_todo_Step -report:N -showloc:N +inline-command: src_func atf_nrun.zd_todo_Step -f // Attempted every minute until zd_todo is empty // Increases # of jobs void atf_nrun::zd_todo_Step() { @@ -148,7 +144,14 @@ to run immediately since it becomes possible to spawn more jobs after a child ex The signal handler is installed in the `Main` function (see above). ``` -inline-command: src_func atf_nrun '(%Signal%|ind_running_Step)' -report:N -showloc:N +inline-command: src_func atf_nrun.'(%Signal%|ind_running_Step)' -f +// trigger waitpid call +static void SignalHandler(int sig) { + (void)sig; + atf_nrun::ind_running_SetDelay(algo::SchedTime());// cause it to execute immediately + prlog("SIGCHLD"); +} + // Attempted whenever we suspect that waitpid() // will return something interesting // Decreases # of jobs @@ -174,13 +177,6 @@ void atf_nrun::ind_running_Step() { } } -// trigger waitpid call -static void SignalHandler(int sig) { - (void)sig; - atf_nrun::ind_running_SetDelay(algo::SchedTime());// cause it to execute immediately - prlog("SIGCHLD"); -} - ``` For completeness, here are the ssim lines defining the `atf_nrun` process, minus @@ -193,7 +189,7 @@ dmmeta.nstype nstype:exe comment:Executable dmmeta.ns ns:atf_nrun nstype:exe license:GPL comment:"Run N subprocesses in parallel" dev.target target:atf_nrun dev.targdep targdep:atf_nrun.algo_lib comment:"" - dev.tgtcov target:atf_nrun cov_min:0.00 maxerr:1.00 comment:"" + dev.tgtcov target:atf_nrun cov_min:0.00 maxerr:5.00 comment:"" dmmeta.ctype ctype:atf_nrun.FDb comment:"In-memory database for atf_nrun" dmmeta.field field:atf_nrun.FDb._db arg:atf_nrun.FDb reftype:Global dflt:"" comment:"" diff --git a/txt/tut/tut8.md b/txt/tut/tut8.md index f3ca0fc6..1b8301a4 100644 --- a/txt/tut/tut8.md +++ b/txt/tut/tut8.md @@ -8,11 +8,11 @@ and proceed interactively. We will choose the `dev` namespace; this choice is arbitrary. ``` -inline-command: acr_ed -create -ssimfile dev.a -write +inline-command: acr_ed -create -ssimfile dev.a -write -amc:N report.acr_check records:*** errors:0 acr.insert dev.gitfile gitfile:data/dev/a.ssim acr.insert dev.gitfile gitfile:txt/ssimdb/dev/a.md - acr.insert dev.readme gitfile:txt/ssimdb/dev/a.md inl:N sandbox:N filter:"" comment:"" + acr.insert dev.readmefile gitfile:txt/ssimdb/dev/a.md inl:N sandbox:N filter:"" comment:"" acr.insert dmmeta.ctype ctype:dev.A comment:"" acr.insert dmmeta.field field:dev.A.a arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" @@ -22,7 +22,6 @@ acr.insert dmmeta.ctype ctype:dev.A comment:"" acr.insert dmmeta.ssimfile ssimfile:dev.a ctype:dev.A acr.insert dmmeta.ssimsort ssimfile:dev.a sortfld:dev.A.a comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` This will create a new empty table data/dev/a.ssim. The ctype for `a` has a single string field @@ -89,11 +88,11 @@ Any fields that aren't specified are assigned default values. Let's illustrate b creating a temporary table: ``` -inline-command: acr_ed -create -ssimfile dev.t -write +inline-command: acr_ed -create -ssimfile dev.t -write -amc:N report.acr_check records:*** errors:0 acr.insert dev.gitfile gitfile:data/dev/t.ssim acr.insert dev.gitfile gitfile:txt/ssimdb/dev/t.md - acr.insert dev.readme gitfile:txt/ssimdb/dev/t.md inl:N sandbox:N filter:"" comment:"" + acr.insert dev.readmefile gitfile:txt/ssimdb/dev/t.md inl:N sandbox:N filter:"" comment:"" acr.insert dmmeta.ctype ctype:dev.T comment:"" acr.insert dmmeta.field field:dev.T.t arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" @@ -103,17 +102,15 @@ acr.insert dmmeta.ctype ctype:dev.T comment:"" acr.insert dmmeta.ssimfile ssimfile:dev.t ctype:dev.T acr.insert dmmeta.ssimsort ssimfile:dev.t sortfld:dev.T.t comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` Now we add an extra attribute to `t` called `val`, with integer type. ``` -inline-command: acr_ed -create -field dev.T.val -arg u32 -write +inline-command: acr_ed -create -field dev.T.val -arg u32 -write -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.field field:dev.T.val arg:u32 reftype:Val dflt:"" comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` Insert some data using a bash one-liner: @@ -149,11 +146,10 @@ Let's illustrate using the same `t` table. We'll need another column, call it `v set `val` back to 3: ``` -inline-command: acr_ed -create -field dev.T.val2 -arg u32 -write +inline-command: acr_ed -create -field dev.T.val2 -arg u32 -write -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.field field:dev.T.val2 arg:u32 reftype:Val dflt:"" comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` ``` @@ -216,11 +212,10 @@ One command per output row would have been much slower Let's illustrate adding a column to the `a` table: ``` -inline-command: acr_ed -create -field dev.A.b -arg u32 -write +inline-command: acr_ed -create -field dev.A.b -arg u32 -write -amc:N report.acr_check records:*** errors:0 acr.insert dmmeta.field field:dev.A.b arg:u32 reftype:Val dflt:"" comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` Let's update a few values with `acr -merge`: @@ -267,11 +262,11 @@ Now let's create another table which will be a subset of the first, and populate When we specify the -subset parameter, we must include the ctype (not ssimfile). ``` -inline-command: acr_ed -create -ssimfile:dev.b -subset dev.A -write +inline-command: acr_ed -create -ssimfile:dev.b -subset dev.A -write -amc:N report.acr_check records:*** errors:0 acr.insert dev.gitfile gitfile:data/dev/b.ssim acr.insert dev.gitfile gitfile:txt/ssimdb/dev/b.md - acr.insert dev.readme gitfile:txt/ssimdb/dev/b.md inl:N sandbox:N filter:"" comment:"" + acr.insert dev.readmefile gitfile:txt/ssimdb/dev/b.md inl:N sandbox:N filter:"" comment:"" acr.insert dmmeta.ctype ctype:dev.B comment:"" acr.insert dmmeta.field field:dev.B.a arg:dev.A reftype:Pkey dflt:"" comment:"" @@ -281,7 +276,6 @@ acr.insert dmmeta.ctype ctype:dev.B comment:"" acr.insert dmmeta.ssimfile ssimfile:dev.b ctype:dev.B acr.insert dmmeta.ssimsort ssimfile:dev.b sortfld:dev.B.a comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` Let's quickly check how `B`'s fields were defined: @@ -467,9 +461,11 @@ Here is an example: ``` inline-command: acr a:a3 -rename a99 -write -acr.update dev.a a:a99 b:0 comment:"" +acr.delete dev.a a:a3 +acr.insert dev.a a:a99 b:0 comment:"" -acr.update dev.b a:a99 comment:"" +acr.delete dev.b a:a3 +acr.insert dev.b a:a99 comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** ``` @@ -489,11 +485,11 @@ an independent table; we will populate it with a few colors. Then, we'll let's create a table `d`, whose key is a cross product of `b` and `c`. ``` -inline-command: acr_ed -create -ssimfile:dev.c -write +inline-command: acr_ed -create -ssimfile:dev.c -write -amc:N report.acr_check records:*** errors:0 acr.insert dev.gitfile gitfile:data/dev/c.ssim acr.insert dev.gitfile gitfile:txt/ssimdb/dev/c.md - acr.insert dev.readme gitfile:txt/ssimdb/dev/c.md inl:N sandbox:N filter:"" comment:"" + acr.insert dev.readmefile gitfile:txt/ssimdb/dev/c.md inl:N sandbox:N filter:"" comment:"" acr.insert dmmeta.ctype ctype:dev.C comment:"" acr.insert dmmeta.field field:dev.C.c arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" @@ -503,7 +499,6 @@ acr.insert dmmeta.ctype ctype:dev.C comment:"" acr.insert dmmeta.ssimfile ssimfile:dev.c ctype:dev.C acr.insert dmmeta.ssimsort ssimfile:dev.c sortfld:dev.C.c comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` ``` @@ -515,11 +510,11 @@ report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** ``` ``` -inline-command: acr_ed -create -ssimfile dev.d -subset dev.B -subset2 dev.C -separator . -write +inline-command: acr_ed -create -ssimfile dev.d -subset dev.B -subset2 dev.C -separator . -write -amc:N report.acr_check records:*** errors:0 acr.insert dev.gitfile gitfile:data/dev/d.ssim acr.insert dev.gitfile gitfile:txt/ssimdb/dev/d.md - acr.insert dev.readme gitfile:txt/ssimdb/dev/d.md inl:N sandbox:N filter:"" comment:"" + acr.insert dev.readmefile gitfile:txt/ssimdb/dev/d.md inl:N sandbox:N filter:"" comment:"" acr.insert dmmeta.ctype ctype:dev.D comment:"" acr.insert dmmeta.field field:dev.D.d arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" @@ -535,7 +530,6 @@ acr.insert dmmeta.ctype ctype:dev.D comment:"" acr.insert dmmeta.ssimfile ssimfile:dev.d ctype:dev.D acr.insert dmmeta.ssimsort ssimfile:dev.d sortfld:dev.D.d comment:"" report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** -report.amc n_cppfile:*** n_cppline:*** n_ctype:*** n_func:*** n_xref:*** n_filemod:*** ``` ``` @@ -609,7 +603,6 @@ dmmeta.nstype nstype:ssimdb comment:"Ssim database (not a target)" dmmeta.field field:dev.D.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.cfmt cfmt:dev.D.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" - dmmeta.ctypelen ctype:dev.D len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.ssimfile ssimfile:dev.d ctype:dev.D dmmeta.ssimsort ssimfile:dev.d sortfld:dev.D.d comment:"" @@ -663,7 +656,7 @@ search is called algo::Pathcomp. The function that parses these expressions is called Pathcomp, and we can view its source code: ``` -inline-command: src_func algo_lib Pathcomp +inline-command: src_func -f algo.Pathcomp // S source string // EXPR string in the form (XYZ)* // - X is the character to search @@ -681,7 +674,6 @@ inline-command: src_func algo_lib Pathcomp // More examples: // s = "abcd"; expr = ".LL"; result = "abcd" // s = "abcd"; expr = ".LR"; result = "" -cpp/lib/algo/string.cpp:44: strptr algo::Pathcomp(strptr s, strptr expr) { int start = 0; int end = s.n_elems; @@ -780,7 +772,6 @@ dmmeta.nstype nstype:ssimdb comment:"Ssim database (not a target)" dmmeta.field field:dev.C.c arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:dev.C.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.cfmt cfmt:dev.C.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" - dmmeta.ctypelen ctype:dev.C len:204 alignment:1 padbytes:0 plaindata:Y dmmeta.field field:dev.D.c arg:dev.C reftype:Pkey dflt:"" comment:"" dmmeta.substr field:dev.D.c expr:.RR srcfield:dev.D.d @@ -901,7 +892,6 @@ dmmeta.ctype ctype:dev.C comment:"" dmmeta.field field:dev.C.c arg:algo.Smallstr50 reftype:Val dflt:"" comment:"" dmmeta.field field:dev.C.comment arg:algo.Comment reftype:Val dflt:"" comment:"" dmmeta.cfmt cfmt:dev.C.String printfmt:Tuple read:Y print:Y sep:"" genop:Y comment:"" - dmmeta.ctypelen ctype:dev.C len:204 alignment:1 padbytes:0 plaindata:Y report.acr n_select:*** n_insert:*** n_delete:*** n_ignore:*** n_update:*** n_file_mod:*** ``` diff --git a/txt/tut/tut9_make.md b/txt/tut/tut9_make.md new file mode 100644 index 00000000..5ed91f06 --- /dev/null +++ b/txt/tut/tut9_make.md @@ -0,0 +1,343 @@ +## Tutorial on transitioning from Makefile to OpenACR build + +The goal of this tutorial is to show step-by-step how a ``build`` system utilizing a well known ["GNU Make"](https://www.gnu.org/software/make/manual/make.html) can be transformed with the help of ["Openacr"](https://github.com/alexeilebedev/openacr). The purpose of the transformation is an illustration of ssim definitions, Primary Keys, Foreign Keys, composite keys with **fldfunc** and the resulting Referential Integrity. The Makefile here is an artificial example from GNU Make documentation, the actual build system will not have object files as targets etc... + +We will first go through all data definitions, and after the data is defined, refer to cpp program that utilizes the data to deliver the Makefile. The sample program and the data definitions are described below. All definition details are also present via **generated** automatic documentation reference: + +### Automatic Reference Set + +* [samp_make - sample program for Makefile management](/txt/exe/samp_make/README.md) + +* [sampdb.gitfile - samp_make list of gitfile sources](/txt/ssimdb/sampdb/gitfile.md) + +* [sampdb.targdep - samp_make targets dependencies](/txt/ssimdb/sampdb/targdep.md) + +* [sampdb.target - samp_make targets list](/txt/ssimdb/sampdb/target.md) + +* [sampdb.targrec - samp_make recipe for a target](/txt/ssimdb/sampdb/targrec.md) + +* [sampdb.targsrc - samp_make targets source dependencies](/txt/ssimdb/sampdb/targsrc.md) + +### Problem Statement + +We want to transform "hand-written" process of writing the Makefile into a process of filling out some tables and getting Makefile as a result of a cpp program that uses the tables as the input and produces the Makefile. The tables have to have a very strong ***Referential Integrity***, so the data entry process can be verified at the entry point, guaranteeing the final result. The presentation emphasis is on the Primary Keys and the Referential Integrity. + +``GNU Make`` is driven by its ``Makefile`` - [A Simple Makefile](https://www.gnu.org/software/make/manual/make.html#Simple-Makefile) from the documentation is given below: + +``` +edit : main.o kbd.o command.o display.o \ + insert.o search.o files.o utils.o + cc -o edit main.o kbd.o command.o display.o \ + insert.o search.o files.o utils.o + +main.o : main.c defs.h + cc -c main.c +kbd.o : kbd.c defs.h command.h + cc -c kbd.c +command.o : command.c defs.h command.h + cc -c command.c +display.o : display.c defs.h buffer.h + cc -c display.c +insert.o : insert.c defs.h buffer.h + cc -c insert.c +search.o : search.c defs.h buffer.h + cc -c search.c +files.o : files.c defs.h buffer.h command.h + cc -c files.c +utils.o : utils.c defs.h + cc -c utils.c +clean : + rm edit main.o kbd.o command.o display.o \ + insert.o search.o files.o utils.o +``` + +Let's create a list of **facts** that this ``Makefile`` contains, record them into the tables and write a [samp_make - sample program for Makefile management](/txt/exe/samp_make/README.md) program that will read the tables and (re)construct the Makefile. We'll also have additional properties when the facts are collected and the program is written. + +We will record the facts into [ssim tuples](/txt/ssimdb/sampdb/README.md) dataset. By design the first column in any table in ``openacr`` must be unique - be the primary key. + +### List of Targets + +First, there is a list of targets - all left-aligned names in Makefile. Lets' define a table named [sampdb.target](/txt/ssimdb/sampdb/target.md). It will contain all targets from the Makefile. Targets are unique by definition, so the first column of our table is the primary key. + +|TARGET| +|---| +|clean +|command.o +|display.o +|edit +|files.o +|insert.o +|kbd.o +|main.o +|search.o +|utils.o + +### List of Targets combined with the ``precondition`` Sources + +Next, we want to record what source files correspond to each target. Here we want to relate the fact that each target might have a list of source files as a precondition. So we want to express in the records that ``command.o``, the target, will have ``command.c`` source file as a precondition. To express it as a primary key we combine ``target`` name with the ``source`` name, separated by a character, in this case "/". This table has a ``composite`` key that is split into target and source keys. The split is expressed the table definition below (copied here from [sampdb.targsrc](/txt/ssimdb/sampdb/targsrc.md) reference). There are two implied fields in the primary key targsrc field. They are tied to our [List of Targets](#list-of-targets), and defined below [List of Sources](#list-of-sources) + +italicised fields: *target, src* are [*Ssim Fundamentals*](/txt/ssim.md) fields + +|Field|[Type](/txt/ssimdb/dmmeta/ctype.md)|[Reftype](/txt/ssimdb/dmmeta/reftype.md)|Default|Comment| +|---|---|---|---|---| +|targsrc|algo.Smallstr50|Val||| +|*target*|*[sampdb.Target](/txt/ssimdb/sampdb/target.md)*|*Pkey*||*
/LL of targsrc*| +|*src*|*[sampdb.Gitfile](/txt/ssimdb/sampdb/gitfile.md)*|*Pkey*||*
/LR of targsrc*| + + The table [sampdb.targsrc](/txt/ssimdb/sampdb/targsrc.md) records will look like this: + +|TARGSRC| +|---| +|command.o/command.c +|command.o/command.h +|command.o/defs.h +|display.o/buffer.h +|display.o/defs.h +|display.o/display.c +|files.o/buffer.h +|files.o/command.h +|files.o/defs.h +|files.o/files.c +|insert.o/buffer.h +|insert.o/defs.h +|insert.o/insert.c +|kbd.o/command.h +|kbd.o/defs.h +|kbd.o/kbd.c +|main.o/defs.h +|main.o/main.c +|search.o/buffer.h +|search.o/defs.h +|search.o/search.c +|utils.o/defs.h +|utils.o/utils.c + +### List of Sources + +We will have a table of all sources. We can match it to git controlled files: [samdb.gitfile](/txt/ssimdb/sampdb/gitfile.md). This table is the **foreign** key to [List of Targets with Sources](#list-of-targets-combined-with-the---precondition---sources) - it validates the **src** ***fldfunc*** key there. + +|GITFILE|COMMENT| +|---|---| +|buffer.h|| +|command.c|| +|command.h|| +|defs.h|| +|display.c|| +|files.c|| +|insert.c|| +|kbd.c|| +|main.c|| +|search.c|| +|utils.c|| + +### List of Targets combined with ``precondition`` Targets + +Targets dependance on each other, as in preconditions, will be expressed by a table [samp.targdep](/txt/ssimdb/sampdb/targdep.md). Here we use the same **fldfunc** approach, with "." as the separator. Our **fdlfunc** here are *Target* and *Parent*, both referring to our [List of Targets](#list-of-targets). For the precise table definition see reference [samp.targdep](/txt/ssimdb/sampdb/targdep.md). + +|TARGDEP| +|---| +|clean.command.o +|clean.display.o +|clean.edit +|clean.files.o +|clean.insert.o +|clean.kbd.o +|clean.main.o +|clean.search.o +|clean.utils.o +|edit.command.o +|edit.display.o +|edit.files.o +|edit.insert.o +|edit.kbd.o +|edit.main.o +|edit.search.o +|edit.utils.o + +### List of Recipes for each Target + +Finally, we will have a recipe table for each target: [sampdb.targrec](/txt/ssimdb/sampdb/targrec.md). Again we are tying [List of Targets](#list-of-targets) to the columns, this time directly, without **fldfunc**. + +|TARGET|RECIPE|COMMENT| +|---|---|---| +|clean|rm|| +|command.o|cc -c|| +|display.o|cc -c|| +|edit|cc -o edit|| +|files.o|cc -c|| +|insert.o|cc -c|| +|kbd.o|cc -c|| +|main.o|cc -c|| +|search.o|cc -c|| +|utils.o|cc -c|| + +### All data dependencies visualized + +All these tables together represent the full extent of the information contained in the Makefile. + +The information comes *cross-referenced* via Primary and Foreign key constraints. The constraints tie all records together into a [Transitive Closure](https://en.wikipedia.org/wiki/Transitive_closure) set. The actual dependencies and the set are fully visible via [acr](/txt/exe/acr/README.md) command, with the output below. The command returns all relations defined for each record in the target table [sampdb.target](/txt/ssimdb/sampdb/target.md) for a selected target, selected targets, or for the totality of it: + +``` +$ acr sampdb.target:edit -t +sampdb.target target:edit dflt:Y comment:"" + sampdb.targdep targdep:edit.command.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.display.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.files.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.insert.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.kbd.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.main.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.search.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.utils.o rec:Y pre:Y comment:"" + sampdb.targrec target:edit recipe:"cc -o edit" comment:"" + +sampdb.targdep targdep:clean.edit rec:Y pre:N comment:"" +``` + +selected targets + +``` +$ acr sampdb.target:'edit|clean' -t +sampdb.target target:clean dflt:N comment:"" + sampdb.targdep targdep:clean.command.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.display.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.edit rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.files.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.insert.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.kbd.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.main.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.search.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.utils.o rec:Y pre:N comment:"" + sampdb.targrec target:clean recipe:rm comment:"" + +sampdb.target target:edit dflt:Y comment:"" + sampdb.targdep targdep:edit.command.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.display.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.files.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.insert.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.kbd.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.main.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.search.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.utils.o rec:Y pre:Y comment:"" + sampdb.targrec target:edit recipe:"cc -o edit" comment:"" + +``` + +or for all targets + +``` +$ acr sampdb.target -t + +sampdb.target target:clean dflt:N comment:"" + sampdb.targdep targdep:clean.command.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.display.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.edit rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.files.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.insert.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.kbd.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.main.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.search.o rec:Y pre:N comment:"" + sampdb.targdep targdep:clean.utils.o rec:Y pre:N comment:"" + sampdb.targrec target:clean recipe:rm comment:"" + +sampdb.target target:command.o dflt:N comment:"" + sampdb.targrec target:command.o recipe:"cc -c" comment:"" + sampdb.targsrc targsrc:command.o/command.c pre:Y rec:Y comment:"" + sampdb.targsrc targsrc:command.o/command.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:command.o/defs.h pre:Y rec:N comment:"" + +sampdb.target target:display.o dflt:N comment:"" + sampdb.targrec target:display.o recipe:"cc -c" comment:"" + sampdb.targsrc targsrc:display.o/buffer.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:display.o/defs.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:display.o/display.c pre:Y rec:Y comment:"" + +sampdb.target target:edit dflt:Y comment:"" + sampdb.targdep targdep:edit.command.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.display.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.files.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.insert.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.kbd.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.main.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.search.o rec:Y pre:Y comment:"" + sampdb.targdep targdep:edit.utils.o rec:Y pre:Y comment:"" + sampdb.targrec target:edit recipe:"cc -o edit" comment:"" + +sampdb.target target:files.o dflt:N comment:"" + sampdb.targrec target:files.o recipe:"cc -c" comment:"" + sampdb.targsrc targsrc:files.o/buffer.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:files.o/command.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:files.o/defs.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:files.o/files.c pre:Y rec:Y comment:"" + +sampdb.target target:insert.o dflt:N comment:"" + sampdb.targrec target:insert.o recipe:"cc -c" comment:"" + sampdb.targsrc targsrc:insert.o/buffer.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:insert.o/defs.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:insert.o/insert.c pre:Y rec:Y comment:"" + +sampdb.target target:kbd.o dflt:N comment:"" + sampdb.targrec target:kbd.o recipe:"cc -c" comment:"" + sampdb.targsrc targsrc:kbd.o/command.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:kbd.o/defs.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:kbd.o/kbd.c pre:Y rec:Y comment:"" + +sampdb.target target:main.o dflt:N comment:"" + sampdb.targrec target:main.o recipe:"cc -c" comment:"" + sampdb.targsrc targsrc:main.o/defs.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:main.o/main.c pre:Y rec:Y comment:"" + +sampdb.target target:search.o dflt:N comment:"" + sampdb.targrec target:search.o recipe:"cc -c" comment:"" + sampdb.targsrc targsrc:search.o/buffer.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:search.o/defs.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:search.o/search.c pre:Y rec:Y comment:"" + +sampdb.target target:utils.o dflt:N comment:"" + sampdb.targrec target:utils.o recipe:"cc -c" comment:"" + sampdb.targsrc targsrc:utils.o/defs.h pre:Y rec:N comment:"" + sampdb.targsrc targsrc:utils.o/utils.c pre:Y rec:Y comment:"" +report.acr n_select:60 n_insert:0 n_delete:0 n_ignore:0 n_update:0 n_file_mod:0 +``` + +### Using the defined tables to generate Makefile + +Now we can use this information in a cpp program [samp_make](/txt/exe/samp_make/README.md), and restore Makefile by iterating over these tables and reconstructing the Makefile. The result will look like this: + +``` +$samp_make -target:% + +edit : command.o display.o files.o insert.o kbd.o main.o search.o + +utils.o + cc -o edit command.o display.o files.o insert.o kbd.o main.o search.o utils.o +command.o : command.c command.h defs.h + cc -c command.c +display.o : buffer.h defs.h display.c + cc -c display.c +files.o : buffer.h command.h defs.h files.c + cc -c files.c +insert.o : buffer.h defs.h insert.c + cc -c insert.c +kbd.o : command.h defs.h kbd.c + cc -c kbd.c +main.o : defs.h main.c + cc -c main.c +search.o : buffer.h defs.h search.c + cc -c search.c +utils.o : defs.h utils.c + cc -c utils.c +clean : + rm command.o display.o edit files.o insert.o kbd.o main.o search.o utils.o +``` + +Now we can create new targets or amend this target by adding/removing the information into the tables and not dealing with the actual Makefile syntax. We can generate each individual target is we wish so: target parameter takes a ``regex`` of targets. + +``` +$ samp_make -target:'clean|insert.o' +clean : + rm command.o display.o edit files.o insert.o kbd.o main.o search.o utils.o +insert.o : buffer.h defs.h insert.c + cc -c insert.c + +``` +